From afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1c Mon Sep 17 00:00:00 2001 From: jtg Date: Thu, 19 Aug 1999 00:55:39 +0000 Subject: Initial revision --- include/GL/Makefile.am | 30 + include/GL/amesa.h | 75 ++ include/GL/foomesa.h | 89 ++ include/GL/fxmesa.h | 120 +++ include/GL/ggimesa.h | 67 ++ include/GL/gl.h | 2235 +++++++++++++++++++++++++++++++++++++++++++++++ include/GL/gl_mangle.h | 531 +++++++++++ include/GL/glu.h | 444 ++++++++++ include/GL/glu_mangle.h | 86 ++ include/GL/glut.h | 751 ++++++++++++++++ include/GL/glut_h.dja | 352 ++++++++ include/GL/glutf90.h | 81 ++ include/GL/glx.h | 261 ++++++ include/GL/glx_mangle.h | 72 ++ include/GL/mglmesa.h | 80 ++ include/GL/osmesa.h | 256 ++++++ include/GL/svgamesa.h | 106 +++ include/GL/wmesa.h | 155 ++++ include/GL/xmesa.h | 357 ++++++++ include/GL/xmesa_x.h | 92 ++ include/GL/xmesa_xf86.h | 189 ++++ 21 files changed, 6429 insertions(+) create mode 100644 include/GL/Makefile.am create mode 100644 include/GL/amesa.h create mode 100644 include/GL/foomesa.h create mode 100644 include/GL/fxmesa.h create mode 100644 include/GL/ggimesa.h create mode 100644 include/GL/gl.h create mode 100644 include/GL/gl_mangle.h create mode 100644 include/GL/glu.h create mode 100644 include/GL/glu_mangle.h create mode 100644 include/GL/glut.h create mode 100644 include/GL/glut_h.dja create mode 100644 include/GL/glutf90.h create mode 100644 include/GL/glx.h create mode 100644 include/GL/glx_mangle.h create mode 100644 include/GL/mglmesa.h create mode 100644 include/GL/osmesa.h create mode 100644 include/GL/svgamesa.h create mode 100644 include/GL/wmesa.h create mode 100644 include/GL/xmesa.h create mode 100644 include/GL/xmesa_x.h create mode 100644 include/GL/xmesa_xf86.h (limited to 'include') diff --git a/include/GL/Makefile.am b/include/GL/Makefile.am new file mode 100644 index 00000000000..61af039384a --- /dev/null +++ b/include/GL/Makefile.am @@ -0,0 +1,30 @@ +## 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 + +EXTRA_DIST = fxmesa.h ggimesa.h osmesa.h svgamesa.h \ + glx.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h + +GLinclude_HEADERS = gl.h gl_mangle.h glu.h glu_mangle.h \ + $(INC_FX) $(INC_GGI) $(INC_OSMESA) $(INC_SVGA) $(INC_X11) + diff --git a/include/GL/amesa.h b/include/GL/amesa.h new file mode 100644 index 00000000000..b4a1867d042 --- /dev/null +++ b/include/GL/amesa.h @@ -0,0 +1,75 @@ +/* $Id: amesa.h,v 1.1 1999/08/19 00:55:40 jtg 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: amesa.h,v $ + * Revision 1.1 1999/08/19 00:55:40 jtg + * Initial revision + * + * Revision 1.1 1999/03/16 01:24:13 brianp + * initial check-in + * + */ + + +/* Allegro (DJGPP) driver by Bernhard Tschirren (bernie-t@geocities.com) */ + + + +#ifndef AMESA_H +#define AMESA_H + + +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/include/GL/foomesa.h b/include/GL/foomesa.h new file mode 100644 index 00000000000..88746294501 --- /dev/null +++ b/include/GL/foomesa.h @@ -0,0 +1,89 @@ +/* $Id: foomesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 3.0 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * $Log: foomesa.h,v $ + * Revision 1.1 1999/08/19 00:55:40 jtg + * Initial revision + * + * Revision 1.1 1998/06/02 01:34:18 brianp + * Initial revision + * + */ + + +/* + * Example Foo/Mesa interface. See src/ddsample.c for more info. + */ + + + +#ifndef FOOMESA_H +#define FOOMESA_H + + + +typedef struct foo_mesa_visual *FooMesaVisual; + +typedef struct foo_mesa_buffer *FooMesaBuffer; + +typedef struct foo_mesa_context *FooMesaContext; + + + +#ifdef BEOS +#pragma export on +#endif + + +extern FooMesaVisual FooMesaChooseVisual( /* your params */ ); + +extern void FooMesaDestroyVisual( FooMesaVisual visual ); + + +extern FooMesaBuffer FooMesaCreateBuffer( FooMesaVisual visual, + void *your_window_id ); + +extern void FooMesaDestroyBuffer( FooMesaBuffer buffer ); + + +extern FooMesaContext FooMesaCreateContext( FooMesaVisual visual, + FooMesaContext sharelist ); + +extern void FooMesaDestroyContext( FooMesaContext context ); + + +extern void FooMesaMakeCurrent( FooMesaContext context, FooMesaBuffer buffer ); + + +extern void FooMesaSwapBuffers( FooMesaBuffer buffer ); + + +/* Probably some more functions... */ + + +#ifdef BEOS +#pragma export off +#endif + +#endif diff --git a/include/GL/fxmesa.h b/include/GL/fxmesa.h new file mode 100644 index 00000000000..68f15eb3cbb --- /dev/null +++ b/include/GL/fxmesa.h @@ -0,0 +1,120 @@ +/* $Id: fxmesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 3.1 + * Copyright (C) 1995-1999 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * $Log: fxmesa.h,v $ + * Revision 1.1 1999/08/19 00:55:40 jtg + * Initial revision + * + * Revision 3.2 1999/01/03 02:46:31 brianp + * now using GLAPI and GLAPIENTRY keywords (Ted Jump) + * + * Revision 3.1 1998/04/01 03:00:28 brianp + * updated for v0.24 of 3Dfx/Glide driver + * + * Revision 3.0 1998/02/20 05:04:45 brianp + * initial rev + * + */ + + +/* + * FXMesa - 3Dfx Glide driver for Mesa. Contributed by David Bucciarelli + * + * NOTE: This version requires Glide 2.3 or later. + */ + + +#ifndef FXMESA_H +#define FXMESA_H + + +#include + + +#ifdef __cplusplus +extern "C" { +#endif + + +#define FXMESA_MAJOR_VERSION 3 +#define FXMESA_MINOR_VERSION 0 + + +/* + * Values for attribList parameter to fxMesaCreateContext(): + */ +#define FXMESA_NONE 0 /* to terminate attribList */ +#define FXMESA_DOUBLEBUFFER 10 +#define FXMESA_ALPHA_SIZE 11 /* followed by an integer */ +#define FXMESA_DEPTH_SIZE 12 /* followed by an integer */ +#define FXMESA_STENCIL_SIZE 13 /* followed by an integer */ +#define FXMESA_ACCUM_SIZE 14 /* followed by an integer */ + + + +typedef struct tfxMesaContext *fxMesaContext; + + +#if defined (__BEOS__) +#pragma export on +#endif + + +GLAPI fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win, GrScreenResolution_t, + GrScreenRefresh_t, + const GLint attribList[]); + +GLAPI fxMesaContext GLAPIENTRY fxMesaCreateBestContext(GLuint win, + GLint width, GLint height, + const GLint attribList[]); +GLAPI void GLAPIENTRY fxMesaDestroyContext(fxMesaContext ctx); + +GLAPI GLboolean GLAPIENTRY fxMesaSelectCurrentBoard(int n); + +GLAPI void GLAPIENTRY fxMesaMakeCurrent(fxMesaContext ctx); + +GLAPI fxMesaContext GLAPIENTRY fxMesaGetCurrentContext(void); + +GLAPI void GLAPIENTRY fxMesaSwapBuffers(void); + +GLAPI void GLAPIENTRY fxMesaSetNearFar(GLfloat nearVal, GLfloat farVal); + +GLAPI void GLAPIENTRY fxMesaUpdateScreenSize(fxMesaContext ctx); + +GLAPI int GLAPIENTRY fxQueryHardware(void); + +GLAPI void GLAPIENTRY fxCloseHardware(void); + + +#if defined (__BEOS__) +#pragma export off +#endif + + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/include/GL/ggimesa.h b/include/GL/ggimesa.h new file mode 100644 index 00000000000..b7f937976b3 --- /dev/null +++ b/include/GL/ggimesa.h @@ -0,0 +1,67 @@ +/* $Id: ggimesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 3.1 + * Copyright (C) 1995-1998 Brian Paul + * Copyright (C) 1998 Uwe Maurer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * $Log: ggimesa.h,v $ + * Revision 1.1 1999/08/19 00:55:40 jtg + * Initial revision + * + * Revision 1.2 1998/09/29 01:46:40 brianp + * applied Emmanuel Marty's patches for latest GGI + * + */ + + +#ifndef GGIMESA_H +#define GGIMESA_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "GL/gl.h" + + +typedef struct ggi_mesa_context *GGIMesaContext; + +#include + +extern GGIMesaContext GGIMesaCreateContext(void); + +extern void GGIMesaDestroyContext( GGIMesaContext ctx ); + +extern void GGIMesaMakeCurrent(GGIMesaContext ctx ); + +extern GGIMesaContext GGIMesaGetCurrentContext( void ); + +extern void GGIMesaSwapBuffers( void ); + +extern int GGIMesaSetVisual(GGIMesaContext ctx,ggi_visual_t vis, + GLboolean rgb_flag,GLboolean db_flag); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/GL/gl.h b/include/GL/gl.h new file mode 100644 index 00000000000..58b51d5abf6 --- /dev/null +++ b/include/GL/gl.h @@ -0,0 +1,2235 @@ +/* $Id: gl.h,v 1.1 1999/08/19 00:55:40 jtg 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. + */ + + + + +#ifndef GL_H +#define GL_H + +#if defined(USE_MGL_NAMESPACE) +#include "gl_mangle.h" +#endif + + +#if defined(__BEOS__) +#include /* to get some BeOS-isms */ +#endif + + +#if !defined(OPENSTEP) && (defined(NeXT) || defined(NeXT_PDO)) +#define OPENSTEP +#endif + + +#if defined(_WIN32) && !defined(__WIN32__) +# define __WIN32__ +#endif + +#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__)) +# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ +# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ +# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ +# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */ +# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ +# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ +# define GLAPI __declspec(dllexport) +# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ +# define GLAPI __declspec(dllimport) +# else /* for use with static link lib build of Win32 edition only */ +# define GLAPI extern +# endif /* _STATIC_MESA support */ +# define GLAPIENTRY __stdcall +# define GLCALLBACK __stdcall +# define GLWINAPI __stdcall +# define GLWINAPIV __cdecl +#else +/* non-Windows compilation */ +# define GLAPI extern +# define GLAPIENTRY +# define GLCALLBACK +# define GLWINAPI +# define GLWINAPIV +#endif /* WIN32 / CYGWIN32 bracket */ + +/* compatability guard so we don't need to change client code */ + +#if defined(_WIN32) && !defined(_WINDEF_) && !defined(OPENSTEP) +# if !defined(MESA_MINWARN) +# pragma message( "note: WINDOWS.H not included, providing Mesa definition of CALLBACK macro" ) +# pragma message( "----: and PROC typedef. If you receive compiler warnings about either ") +# pragma message( "----: being multiply defined you should include WINDOWS.H priot to gl/gl.h" ) +# endif +# define CALLBACK GLCALLBACK +typedef int (GLAPIENTRY *PROC)(); +typedef void *HGLRC; +typedef void *HDC; +typedef unsigned long COLORREF; +#endif + +#if defined(_WIN32) && !defined(_WINGDI_) && !defined(OPENSTEP) +# if !defined(MESA_MINWARN) +# pragma message( "note: WINDOWS.H not included, providing Mesa definition of wgl functions" ) +# pragma message( "----: and macros. If you receive compiler warnings about any being multiply ") +# pragma message( "----: defined you should include WINDOWS.H priot to gl/gl.h" ) +# endif +# define WGL_FONT_LINES 0 +# define WGL_FONT_POLYGONS 1 +# ifdef UNICODE +# define wglUseFontBitmaps wglUseFontBitmapsW +# define wglUseFontOutlines wglUseFontOutlinesW +# else +# define wglUseFontBitmaps wglUseFontBitmapsA +# define wglUseFontOutlines wglUseFontOutlinesA +# endif /* !UNICODE */ +typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR; +typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT; +GLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int); +GLAPI HGLRC GLAPIENTRY wglCreateContext(HDC); +GLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC, int); +GLAPI int GLAPIENTRY wglDeleteContext(HGLRC); +GLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void); +GLAPI HDC GLAPIENTRY wglGetCurrentDC(void); +GLAPI PROC GLAPIENTRY wglGetProcAddress(char*); +GLAPI int GLAPIENTRY wglMakeCurrent(HDC, HGLRC); +GLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC); +GLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long); +GLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long); +GLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT); +GLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT); +GLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR); +GLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *); +GLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *); +GLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int); +GLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int); +GLAPI int GLAPIENTRY SwapBuffers(HDC); +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifdef macintosh + #pragma enumsalwaysint on + #if PRAGMA_IMPORT_SUPPORTED + #pragma import on + #endif +#endif + + + +/* + * Apps can test for this symbol to do conditional compilation if needed. + */ +#define MESA + +#define MESA_MAJOR_VERSION 3 +#define MESA_MINOR_VERSION 1 + + +#define GL_VERSION_1_1 1 +#define GL_VERSION_1_2 1 + + +/* + * + * Enumerations + * + */ + +typedef enum { + /* Boolean values */ + GL_FALSE = 0, + GL_TRUE = 1, + + /* Data types */ + GL_BYTE = 0x1400, + GL_UNSIGNED_BYTE = 0x1401, + GL_SHORT = 0x1402, + GL_UNSIGNED_SHORT = 0x1403, + GL_INT = 0x1404, + GL_UNSIGNED_INT = 0x1405, + GL_FLOAT = 0x1406, + GL_DOUBLE = 0x140A, + GL_2_BYTES = 0x1407, + GL_3_BYTES = 0x1408, + GL_4_BYTES = 0x1409, + + /* Primitives */ + GL_POINTS = 0x0000, + GL_LINES = 0x0001, + GL_LINE_LOOP = 0x0002, + GL_LINE_STRIP = 0x0003, + GL_TRIANGLES = 0x0004, + GL_TRIANGLE_STRIP = 0x0005, + GL_TRIANGLE_FAN = 0x0006, + GL_QUADS = 0x0007, + GL_QUAD_STRIP = 0x0008, + GL_POLYGON = 0x0009, + + /* Vertex Arrays */ + GL_VERTEX_ARRAY = 0x8074, + GL_NORMAL_ARRAY = 0x8075, + GL_COLOR_ARRAY = 0x8076, + GL_INDEX_ARRAY = 0x8077, + GL_TEXTURE_COORD_ARRAY = 0x8078, + GL_EDGE_FLAG_ARRAY = 0x8079, + GL_VERTEX_ARRAY_SIZE = 0x807A, + GL_VERTEX_ARRAY_TYPE = 0x807B, + GL_VERTEX_ARRAY_STRIDE = 0x807C, + GL_NORMAL_ARRAY_TYPE = 0x807E, + GL_NORMAL_ARRAY_STRIDE = 0x807F, + GL_COLOR_ARRAY_SIZE = 0x8081, + GL_COLOR_ARRAY_TYPE = 0x8082, + GL_COLOR_ARRAY_STRIDE = 0x8083, + GL_INDEX_ARRAY_TYPE = 0x8085, + GL_INDEX_ARRAY_STRIDE = 0x8086, + GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088, + GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089, + GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A, + GL_EDGE_FLAG_ARRAY_STRIDE = 0x808C, + GL_VERTEX_ARRAY_POINTER = 0x808E, + GL_NORMAL_ARRAY_POINTER = 0x808F, + GL_COLOR_ARRAY_POINTER = 0x8090, + GL_INDEX_ARRAY_POINTER = 0x8091, + GL_TEXTURE_COORD_ARRAY_POINTER = 0x8092, + GL_EDGE_FLAG_ARRAY_POINTER = 0x8093, + GL_V2F = 0x2A20, + GL_V3F = 0x2A21, + GL_C4UB_V2F = 0x2A22, + GL_C4UB_V3F = 0x2A23, + GL_C3F_V3F = 0x2A24, + GL_N3F_V3F = 0x2A25, + GL_C4F_N3F_V3F = 0x2A26, + GL_T2F_V3F = 0x2A27, + GL_T4F_V4F = 0x2A28, + GL_T2F_C4UB_V3F = 0x2A29, + GL_T2F_C3F_V3F = 0x2A2A, + GL_T2F_N3F_V3F = 0x2A2B, + GL_T2F_C4F_N3F_V3F = 0x2A2C, + GL_T4F_C4F_N3F_V4F = 0x2A2D, + + /* Matrix Mode */ + GL_MATRIX_MODE = 0x0BA0, + GL_MODELVIEW = 0x1700, + GL_PROJECTION = 0x1701, + GL_TEXTURE = 0x1702, + + /* Points */ + GL_POINT_SMOOTH = 0x0B10, + GL_POINT_SIZE = 0x0B11, + GL_POINT_SIZE_GRANULARITY = 0x0B13, + GL_POINT_SIZE_RANGE = 0x0B12, + + /* Lines */ + GL_LINE_SMOOTH = 0x0B20, + GL_LINE_STIPPLE = 0x0B24, + GL_LINE_STIPPLE_PATTERN = 0x0B25, + GL_LINE_STIPPLE_REPEAT = 0x0B26, + GL_LINE_WIDTH = 0x0B21, + GL_LINE_WIDTH_GRANULARITY = 0x0B23, + GL_LINE_WIDTH_RANGE = 0x0B22, + + /* Polygons */ + GL_POINT = 0x1B00, + GL_LINE = 0x1B01, + GL_FILL = 0x1B02, + GL_CW = 0x0900, + GL_CCW = 0x0901, + GL_FRONT = 0x0404, + GL_BACK = 0x0405, + GL_POLYGON_MODE = 0x0B40, + GL_POLYGON_SMOOTH = 0x0B41, + GL_POLYGON_STIPPLE = 0x0B42, + GL_EDGE_FLAG = 0x0B43, + GL_CULL_FACE = 0x0B44, + GL_CULL_FACE_MODE = 0x0B45, + GL_FRONT_FACE = 0x0B46, + GL_POLYGON_OFFSET_FACTOR = 0x8038, + GL_POLYGON_OFFSET_UNITS = 0x2A00, + GL_POLYGON_OFFSET_POINT = 0x2A01, + GL_POLYGON_OFFSET_LINE = 0x2A02, + GL_POLYGON_OFFSET_FILL = 0x8037, + + /* Display Lists */ + GL_COMPILE = 0x1300, + GL_COMPILE_AND_EXECUTE = 0x1301, + GL_LIST_BASE = 0x0B32, + GL_LIST_INDEX = 0x0B33, + GL_LIST_MODE = 0x0B30, + + /* Depth buffer */ + GL_NEVER = 0x0200, + GL_LESS = 0x0201, + GL_GEQUAL = 0x0206, + GL_LEQUAL = 0x0203, + GL_GREATER = 0x0204, + GL_NOTEQUAL = 0x0205, + GL_EQUAL = 0x0202, + GL_ALWAYS = 0x0207, + GL_DEPTH_TEST = 0x0B71, + GL_DEPTH_BITS = 0x0D56, + GL_DEPTH_CLEAR_VALUE = 0x0B73, + GL_DEPTH_FUNC = 0x0B74, + GL_DEPTH_RANGE = 0x0B70, + GL_DEPTH_WRITEMASK = 0x0B72, + GL_DEPTH_COMPONENT = 0x1902, + + /* Lighting */ + GL_LIGHTING = 0x0B50, + GL_LIGHT0 = 0x4000, + GL_LIGHT1 = 0x4001, + GL_LIGHT2 = 0x4002, + GL_LIGHT3 = 0x4003, + GL_LIGHT4 = 0x4004, + GL_LIGHT5 = 0x4005, + GL_LIGHT6 = 0x4006, + GL_LIGHT7 = 0x4007, + GL_SPOT_EXPONENT = 0x1205, + GL_SPOT_CUTOFF = 0x1206, + GL_CONSTANT_ATTENUATION = 0x1207, + GL_LINEAR_ATTENUATION = 0x1208, + GL_QUADRATIC_ATTENUATION = 0x1209, + GL_AMBIENT = 0x1200, + GL_DIFFUSE = 0x1201, + GL_SPECULAR = 0x1202, + GL_SHININESS = 0x1601, + GL_EMISSION = 0x1600, + GL_POSITION = 0x1203, + GL_SPOT_DIRECTION = 0x1204, + GL_AMBIENT_AND_DIFFUSE = 0x1602, + GL_COLOR_INDEXES = 0x1603, + GL_LIGHT_MODEL_TWO_SIDE = 0x0B52, + GL_LIGHT_MODEL_LOCAL_VIEWER = 0x0B51, + GL_LIGHT_MODEL_AMBIENT = 0x0B53, + GL_FRONT_AND_BACK = 0x0408, + GL_SHADE_MODEL = 0x0B54, + GL_FLAT = 0x1D00, + GL_SMOOTH = 0x1D01, + GL_COLOR_MATERIAL = 0x0B57, + GL_COLOR_MATERIAL_FACE = 0x0B55, + GL_COLOR_MATERIAL_PARAMETER = 0x0B56, + GL_NORMALIZE = 0x0BA1, + + /* User clipping planes */ + GL_CLIP_PLANE0 = 0x3000, + GL_CLIP_PLANE1 = 0x3001, + GL_CLIP_PLANE2 = 0x3002, + GL_CLIP_PLANE3 = 0x3003, + GL_CLIP_PLANE4 = 0x3004, + GL_CLIP_PLANE5 = 0x3005, + + /* Accumulation buffer */ + GL_ACCUM_RED_BITS = 0x0D58, + GL_ACCUM_GREEN_BITS = 0x0D59, + GL_ACCUM_BLUE_BITS = 0x0D5A, + GL_ACCUM_ALPHA_BITS = 0x0D5B, + GL_ACCUM_CLEAR_VALUE = 0x0B80, + GL_ACCUM = 0x0100, + GL_ADD = 0x0104, + GL_LOAD = 0x0101, + GL_MULT = 0x0103, + GL_RETURN = 0x0102, + + /* Alpha testing */ + GL_ALPHA_TEST = 0x0BC0, + GL_ALPHA_TEST_REF = 0x0BC2, + GL_ALPHA_TEST_FUNC = 0x0BC1, + + /* Blending */ + GL_BLEND = 0x0BE2, + GL_BLEND_SRC = 0x0BE1, + GL_BLEND_DST = 0x0BE0, + GL_ZERO = 0, + GL_ONE = 1, + GL_SRC_COLOR = 0x0300, + GL_ONE_MINUS_SRC_COLOR = 0x0301, + GL_DST_COLOR = 0x0306, + GL_ONE_MINUS_DST_COLOR = 0x0307, + GL_SRC_ALPHA = 0x0302, + GL_ONE_MINUS_SRC_ALPHA = 0x0303, + GL_DST_ALPHA = 0x0304, + GL_ONE_MINUS_DST_ALPHA = 0x0305, + GL_SRC_ALPHA_SATURATE = 0x0308, + GL_CONSTANT_COLOR = 0x8001, + GL_ONE_MINUS_CONSTANT_COLOR = 0x8002, + GL_CONSTANT_ALPHA = 0x8003, + GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004, + + /* Render Mode */ + GL_FEEDBACK = 0x1C01, + GL_RENDER = 0x1C00, + GL_SELECT = 0x1C02, + + /* Feedback */ + GL_2D = 0x0600, + GL_3D = 0x0601, + GL_3D_COLOR = 0x0602, + GL_3D_COLOR_TEXTURE = 0x0603, + GL_4D_COLOR_TEXTURE = 0x0604, + GL_POINT_TOKEN = 0x0701, + GL_LINE_TOKEN = 0x0702, + GL_LINE_RESET_TOKEN = 0x0707, + GL_POLYGON_TOKEN = 0x0703, + GL_BITMAP_TOKEN = 0x0704, + GL_DRAW_PIXEL_TOKEN = 0x0705, + GL_COPY_PIXEL_TOKEN = 0x0706, + GL_PASS_THROUGH_TOKEN = 0x0700, + GL_FEEDBACK_BUFFER_POINTER = 0x0DF0, + GL_FEEDBACK_BUFFER_SIZE = 0x0DF1, + GL_FEEDBACK_BUFFER_TYPE = 0x0DF2, + + /* Selection */ + GL_SELECTION_BUFFER_POINTER = 0x0DF3, + GL_SELECTION_BUFFER_SIZE = 0x0DF4, + + /* Fog */ + GL_FOG = 0x0B60, + GL_FOG_MODE = 0x0B65, + GL_FOG_DENSITY = 0x0B62, + GL_FOG_COLOR = 0x0B66, + GL_FOG_INDEX = 0x0B61, + GL_FOG_START = 0x0B63, + GL_FOG_END = 0x0B64, + GL_LINEAR = 0x2601, + GL_EXP = 0x0800, + GL_EXP2 = 0x0801, + + /* Logic Ops */ + GL_LOGIC_OP = 0x0BF1, + GL_INDEX_LOGIC_OP = 0x0BF1, + GL_COLOR_LOGIC_OP = 0x0BF2, + GL_LOGIC_OP_MODE = 0x0BF0, + GL_CLEAR = 0x1500, + GL_SET = 0x150F, + GL_COPY = 0x1503, + GL_COPY_INVERTED = 0x150C, + GL_NOOP = 0x1505, + GL_INVERT = 0x150A, + GL_AND = 0x1501, + GL_NAND = 0x150E, + GL_OR = 0x1507, + GL_NOR = 0x1508, + GL_XOR = 0x1506, + GL_EQUIV = 0x1509, + GL_AND_REVERSE = 0x1502, + GL_AND_INVERTED = 0x1504, + GL_OR_REVERSE = 0x150B, + GL_OR_INVERTED = 0x150D, + + /* Stencil */ + GL_STENCIL_TEST = 0x0B90, + GL_STENCIL_WRITEMASK = 0x0B98, + GL_STENCIL_BITS = 0x0D57, + GL_STENCIL_FUNC = 0x0B92, + GL_STENCIL_VALUE_MASK = 0x0B93, + GL_STENCIL_REF = 0x0B97, + GL_STENCIL_FAIL = 0x0B94, + GL_STENCIL_PASS_DEPTH_PASS = 0x0B96, + GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95, + GL_STENCIL_CLEAR_VALUE = 0x0B91, + GL_STENCIL_INDEX = 0x1901, + GL_KEEP = 0x1E00, + GL_REPLACE = 0x1E01, + GL_INCR = 0x1E02, + GL_DECR = 0x1E03, + + /* Buffers, Pixel Drawing/Reading */ + GL_NONE = 0, + GL_LEFT = 0x0406, + GL_RIGHT = 0x0407, + /*GL_FRONT = 0x0404, */ + /*GL_BACK = 0x0405, */ + /*GL_FRONT_AND_BACK = 0x0408, */ + GL_FRONT_LEFT = 0x0400, + GL_FRONT_RIGHT = 0x0401, + GL_BACK_LEFT = 0x0402, + GL_BACK_RIGHT = 0x0403, + GL_AUX0 = 0x0409, + GL_AUX1 = 0x040A, + GL_AUX2 = 0x040B, + GL_AUX3 = 0x040C, + GL_COLOR_INDEX = 0x1900, + GL_RED = 0x1903, + GL_GREEN = 0x1904, + GL_BLUE = 0x1905, + GL_ALPHA = 0x1906, + GL_LUMINANCE = 0x1909, + GL_LUMINANCE_ALPHA = 0x190A, + GL_ALPHA_BITS = 0x0D55, + GL_RED_BITS = 0x0D52, + GL_GREEN_BITS = 0x0D53, + GL_BLUE_BITS = 0x0D54, + GL_INDEX_BITS = 0x0D51, + GL_SUBPIXEL_BITS = 0x0D50, + GL_AUX_BUFFERS = 0x0C00, + GL_READ_BUFFER = 0x0C02, + GL_DRAW_BUFFER = 0x0C01, + GL_DOUBLEBUFFER = 0x0C32, + GL_STEREO = 0x0C33, + GL_BITMAP = 0x1A00, + GL_COLOR = 0x1800, + GL_DEPTH = 0x1801, + GL_STENCIL = 0x1802, + GL_DITHER = 0x0BD0, + GL_RGB = 0x1907, + GL_RGBA = 0x1908, + + /* Implementation limits */ + GL_MAX_LIST_NESTING = 0x0B31, + GL_MAX_ATTRIB_STACK_DEPTH = 0x0D35, + GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36, + GL_MAX_NAME_STACK_DEPTH = 0x0D37, + GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38, + GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39, + GL_MAX_EVAL_ORDER = 0x0D30, + GL_MAX_LIGHTS = 0x0D31, + GL_MAX_CLIP_PLANES = 0x0D32, + GL_MAX_TEXTURE_SIZE = 0x0D33, + GL_MAX_PIXEL_MAP_TABLE = 0x0D34, + GL_MAX_VIEWPORT_DIMS = 0x0D3A, + GL_MAX_CLIENT_ATTRIB_STACK_DEPTH= 0x0D3B, + + /* Gets */ + GL_ATTRIB_STACK_DEPTH = 0x0BB0, + GL_CLIENT_ATTRIB_STACK_DEPTH = 0x0BB1, + GL_COLOR_CLEAR_VALUE = 0x0C22, + GL_COLOR_WRITEMASK = 0x0C23, + GL_CURRENT_INDEX = 0x0B01, + GL_CURRENT_COLOR = 0x0B00, + GL_CURRENT_NORMAL = 0x0B02, + GL_CURRENT_RASTER_COLOR = 0x0B04, + GL_CURRENT_RASTER_DISTANCE = 0x0B09, + GL_CURRENT_RASTER_INDEX = 0x0B05, + GL_CURRENT_RASTER_POSITION = 0x0B07, + GL_CURRENT_RASTER_TEXTURE_COORDS = 0x0B06, + GL_CURRENT_RASTER_POSITION_VALID = 0x0B08, + GL_CURRENT_TEXTURE_COORDS = 0x0B03, + GL_INDEX_CLEAR_VALUE = 0x0C20, + GL_INDEX_MODE = 0x0C30, + GL_INDEX_WRITEMASK = 0x0C21, + GL_MODELVIEW_MATRIX = 0x0BA6, + GL_MODELVIEW_STACK_DEPTH = 0x0BA3, + GL_NAME_STACK_DEPTH = 0x0D70, + GL_PROJECTION_MATRIX = 0x0BA7, + GL_PROJECTION_STACK_DEPTH = 0x0BA4, + GL_RENDER_MODE = 0x0C40, + GL_RGBA_MODE = 0x0C31, + GL_TEXTURE_MATRIX = 0x0BA8, + GL_TEXTURE_STACK_DEPTH = 0x0BA5, + GL_VIEWPORT = 0x0BA2, + + /* Evaluators */ + GL_AUTO_NORMAL = 0x0D80, + GL_MAP1_COLOR_4 = 0x0D90, + GL_MAP1_GRID_DOMAIN = 0x0DD0, + GL_MAP1_GRID_SEGMENTS = 0x0DD1, + GL_MAP1_INDEX = 0x0D91, + GL_MAP1_NORMAL = 0x0D92, + GL_MAP1_TEXTURE_COORD_1 = 0x0D93, + GL_MAP1_TEXTURE_COORD_2 = 0x0D94, + GL_MAP1_TEXTURE_COORD_3 = 0x0D95, + GL_MAP1_TEXTURE_COORD_4 = 0x0D96, + GL_MAP1_VERTEX_3 = 0x0D97, + GL_MAP1_VERTEX_4 = 0x0D98, + GL_MAP2_COLOR_4 = 0x0DB0, + GL_MAP2_GRID_DOMAIN = 0x0DD2, + GL_MAP2_GRID_SEGMENTS = 0x0DD3, + GL_MAP2_INDEX = 0x0DB1, + GL_MAP2_NORMAL = 0x0DB2, + GL_MAP2_TEXTURE_COORD_1 = 0x0DB3, + GL_MAP2_TEXTURE_COORD_2 = 0x0DB4, + GL_MAP2_TEXTURE_COORD_3 = 0x0DB5, + GL_MAP2_TEXTURE_COORD_4 = 0x0DB6, + GL_MAP2_VERTEX_3 = 0x0DB7, + GL_MAP2_VERTEX_4 = 0x0DB8, + GL_COEFF = 0x0A00, + GL_DOMAIN = 0x0A02, + GL_ORDER = 0x0A01, + + /* Hints */ + GL_FOG_HINT = 0x0C54, + GL_LINE_SMOOTH_HINT = 0x0C52, + GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50, + GL_POINT_SMOOTH_HINT = 0x0C51, + GL_POLYGON_SMOOTH_HINT = 0x0C53, + GL_DONT_CARE = 0x1100, + GL_FASTEST = 0x1101, + GL_NICEST = 0x1102, + + /* Scissor box */ + GL_SCISSOR_TEST = 0x0C11, + GL_SCISSOR_BOX = 0x0C10, + + /* Pixel Mode / Transfer */ + GL_MAP_COLOR = 0x0D10, + GL_MAP_STENCIL = 0x0D11, + GL_INDEX_SHIFT = 0x0D12, + GL_INDEX_OFFSET = 0x0D13, + GL_RED_SCALE = 0x0D14, + GL_RED_BIAS = 0x0D15, + GL_GREEN_SCALE = 0x0D18, + GL_GREEN_BIAS = 0x0D19, + GL_BLUE_SCALE = 0x0D1A, + GL_BLUE_BIAS = 0x0D1B, + GL_ALPHA_SCALE = 0x0D1C, + GL_ALPHA_BIAS = 0x0D1D, + GL_DEPTH_SCALE = 0x0D1E, + GL_DEPTH_BIAS = 0x0D1F, + GL_PIXEL_MAP_S_TO_S_SIZE = 0x0CB1, + GL_PIXEL_MAP_I_TO_I_SIZE = 0x0CB0, + GL_PIXEL_MAP_I_TO_R_SIZE = 0x0CB2, + GL_PIXEL_MAP_I_TO_G_SIZE = 0x0CB3, + GL_PIXEL_MAP_I_TO_B_SIZE = 0x0CB4, + GL_PIXEL_MAP_I_TO_A_SIZE = 0x0CB5, + GL_PIXEL_MAP_R_TO_R_SIZE = 0x0CB6, + GL_PIXEL_MAP_G_TO_G_SIZE = 0x0CB7, + GL_PIXEL_MAP_B_TO_B_SIZE = 0x0CB8, + GL_PIXEL_MAP_A_TO_A_SIZE = 0x0CB9, + GL_PIXEL_MAP_S_TO_S = 0x0C71, + GL_PIXEL_MAP_I_TO_I = 0x0C70, + GL_PIXEL_MAP_I_TO_R = 0x0C72, + GL_PIXEL_MAP_I_TO_G = 0x0C73, + GL_PIXEL_MAP_I_TO_B = 0x0C74, + GL_PIXEL_MAP_I_TO_A = 0x0C75, + GL_PIXEL_MAP_R_TO_R = 0x0C76, + GL_PIXEL_MAP_G_TO_G = 0x0C77, + GL_PIXEL_MAP_B_TO_B = 0x0C78, + GL_PIXEL_MAP_A_TO_A = 0x0C79, + GL_PACK_ALIGNMENT = 0x0D05, + GL_PACK_LSB_FIRST = 0x0D01, + GL_PACK_ROW_LENGTH = 0x0D02, + GL_PACK_SKIP_PIXELS = 0x0D04, + GL_PACK_SKIP_ROWS = 0x0D03, + GL_PACK_SWAP_BYTES = 0x0D00, + GL_UNPACK_ALIGNMENT = 0x0CF5, + GL_UNPACK_LSB_FIRST = 0x0CF1, + GL_UNPACK_ROW_LENGTH = 0x0CF2, + GL_UNPACK_SKIP_PIXELS = 0x0CF4, + GL_UNPACK_SKIP_ROWS = 0x0CF3, + GL_UNPACK_SWAP_BYTES = 0x0CF0, + GL_ZOOM_X = 0x0D16, + GL_ZOOM_Y = 0x0D17, + + /* Texture mapping */ + GL_TEXTURE_ENV = 0x2300, + GL_TEXTURE_ENV_MODE = 0x2200, + GL_TEXTURE_1D = 0x0DE0, + GL_TEXTURE_2D = 0x0DE1, + GL_TEXTURE_WRAP_S = 0x2802, + GL_TEXTURE_WRAP_T = 0x2803, + GL_TEXTURE_MAG_FILTER = 0x2800, + GL_TEXTURE_MIN_FILTER = 0x2801, + GL_TEXTURE_ENV_COLOR = 0x2201, + GL_TEXTURE_GEN_S = 0x0C60, + GL_TEXTURE_GEN_T = 0x0C61, + GL_TEXTURE_GEN_MODE = 0x2500, + GL_TEXTURE_BORDER_COLOR = 0x1004, + GL_TEXTURE_WIDTH = 0x1000, + GL_TEXTURE_HEIGHT = 0x1001, + GL_TEXTURE_BORDER = 0x1005, + GL_TEXTURE_COMPONENTS = 0x1003, + GL_TEXTURE_RED_SIZE = 0x805C, + GL_TEXTURE_GREEN_SIZE = 0x805D, + GL_TEXTURE_BLUE_SIZE = 0x805E, + GL_TEXTURE_ALPHA_SIZE = 0x805F, + GL_TEXTURE_LUMINANCE_SIZE = 0x8060, + GL_TEXTURE_INTENSITY_SIZE = 0x8061, + GL_NEAREST_MIPMAP_NEAREST = 0x2700, + GL_NEAREST_MIPMAP_LINEAR = 0x2702, + GL_LINEAR_MIPMAP_NEAREST = 0x2701, + GL_LINEAR_MIPMAP_LINEAR = 0x2703, + GL_OBJECT_LINEAR = 0x2401, + GL_OBJECT_PLANE = 0x2501, + GL_EYE_LINEAR = 0x2400, + GL_EYE_PLANE = 0x2502, + GL_SPHERE_MAP = 0x2402, + GL_DECAL = 0x2101, + GL_MODULATE = 0x2100, + GL_NEAREST = 0x2600, + GL_REPEAT = 0x2901, + GL_CLAMP = 0x2900, + GL_S = 0x2000, + GL_T = 0x2001, + GL_R = 0x2002, + GL_Q = 0x2003, + GL_TEXTURE_GEN_R = 0x0C62, + GL_TEXTURE_GEN_Q = 0x0C63, + + /* GL 1.1 texturing */ + GL_PROXY_TEXTURE_1D = 0x8063, + GL_PROXY_TEXTURE_2D = 0x8064, + GL_TEXTURE_PRIORITY = 0x8066, + GL_TEXTURE_RESIDENT = 0x8067, + GL_TEXTURE_BINDING_1D = 0x8068, + GL_TEXTURE_BINDING_2D = 0x8069, + GL_TEXTURE_INTERNAL_FORMAT = 0x1003, + + /* GL 1.2 texturing */ + GL_PACK_SKIP_IMAGES = 0x806B, + GL_PACK_IMAGE_HEIGHT = 0x806C, + GL_UNPACK_SKIP_IMAGES = 0x806D, + GL_UNPACK_IMAGE_HEIGHT = 0x806E, + GL_TEXTURE_3D = 0x806F, + GL_PROXY_TEXTURE_3D = 0x8070, + GL_TEXTURE_DEPTH = 0x8071, + GL_TEXTURE_WRAP_R = 0x8072, + GL_MAX_3D_TEXTURE_SIZE = 0x8073, + GL_TEXTURE_BINDING_3D = 0x806A, + + /* Internal texture formats (GL 1.1) */ + GL_ALPHA4 = 0x803B, + GL_ALPHA8 = 0x803C, + GL_ALPHA12 = 0x803D, + GL_ALPHA16 = 0x803E, + GL_LUMINANCE4 = 0x803F, + GL_LUMINANCE8 = 0x8040, + GL_LUMINANCE12 = 0x8041, + GL_LUMINANCE16 = 0x8042, + GL_LUMINANCE4_ALPHA4 = 0x8043, + GL_LUMINANCE6_ALPHA2 = 0x8044, + GL_LUMINANCE8_ALPHA8 = 0x8045, + GL_LUMINANCE12_ALPHA4 = 0x8046, + GL_LUMINANCE12_ALPHA12 = 0x8047, + GL_LUMINANCE16_ALPHA16 = 0x8048, + GL_INTENSITY = 0x8049, + GL_INTENSITY4 = 0x804A, + GL_INTENSITY8 = 0x804B, + GL_INTENSITY12 = 0x804C, + GL_INTENSITY16 = 0x804D, + GL_R3_G3_B2 = 0x2A10, + GL_RGB4 = 0x804F, + GL_RGB5 = 0x8050, + GL_RGB8 = 0x8051, + GL_RGB10 = 0x8052, + GL_RGB12 = 0x8053, + GL_RGB16 = 0x8054, + GL_RGBA2 = 0x8055, + GL_RGBA4 = 0x8056, + GL_RGB5_A1 = 0x8057, + GL_RGBA8 = 0x8058, + GL_RGB10_A2 = 0x8059, + GL_RGBA12 = 0x805A, + GL_RGBA16 = 0x805B, + + /* Utility */ + GL_VENDOR = 0x1F00, + GL_RENDERER = 0x1F01, + GL_VERSION = 0x1F02, + GL_EXTENSIONS = 0x1F03, + + /* Errors */ + GL_INVALID_VALUE = 0x0501, + GL_INVALID_ENUM = 0x0500, + GL_INVALID_OPERATION = 0x0502, + GL_STACK_OVERFLOW = 0x0503, + GL_STACK_UNDERFLOW = 0x0504, + GL_OUT_OF_MEMORY = 0x0505, + + /* + * Extensions + */ + + /* GL_EXT_blend_minmax and GL_EXT_blend_color */ + GL_CONSTANT_COLOR_EXT = 0x8001, + GL_ONE_MINUS_CONSTANT_COLOR_EXT = 0x8002, + GL_CONSTANT_ALPHA_EXT = 0x8003, + GL_ONE_MINUS_CONSTANT_ALPHA_EXT = 0x8004, + GL_BLEND_EQUATION_EXT = 0x8009, + GL_MIN_EXT = 0x8007, + GL_MAX_EXT = 0x8008, + GL_FUNC_ADD_EXT = 0x8006, + GL_FUNC_SUBTRACT_EXT = 0x800A, + GL_FUNC_REVERSE_SUBTRACT_EXT = 0x800B, + GL_BLEND_COLOR_EXT = 0x8005, + + /* GL_EXT_polygon_offset */ + GL_POLYGON_OFFSET_EXT = 0x8037, + GL_POLYGON_OFFSET_FACTOR_EXT = 0x8038, + GL_POLYGON_OFFSET_BIAS_EXT = 0x8039, + + /* GL_EXT_vertex_array */ + GL_VERTEX_ARRAY_EXT = 0x8074, + GL_NORMAL_ARRAY_EXT = 0x8075, + GL_COLOR_ARRAY_EXT = 0x8076, + GL_INDEX_ARRAY_EXT = 0x8077, + GL_TEXTURE_COORD_ARRAY_EXT = 0x8078, + GL_EDGE_FLAG_ARRAY_EXT = 0x8079, + GL_VERTEX_ARRAY_SIZE_EXT = 0x807A, + GL_VERTEX_ARRAY_TYPE_EXT = 0x807B, + GL_VERTEX_ARRAY_STRIDE_EXT = 0x807C, + GL_VERTEX_ARRAY_COUNT_EXT = 0x807D, + GL_NORMAL_ARRAY_TYPE_EXT = 0x807E, + GL_NORMAL_ARRAY_STRIDE_EXT = 0x807F, + GL_NORMAL_ARRAY_COUNT_EXT = 0x8080, + GL_COLOR_ARRAY_SIZE_EXT = 0x8081, + GL_COLOR_ARRAY_TYPE_EXT = 0x8082, + GL_COLOR_ARRAY_STRIDE_EXT = 0x8083, + GL_COLOR_ARRAY_COUNT_EXT = 0x8084, + GL_INDEX_ARRAY_TYPE_EXT = 0x8085, + GL_INDEX_ARRAY_STRIDE_EXT = 0x8086, + GL_INDEX_ARRAY_COUNT_EXT = 0x8087, + GL_TEXTURE_COORD_ARRAY_SIZE_EXT = 0x8088, + GL_TEXTURE_COORD_ARRAY_TYPE_EXT = 0x8089, + GL_TEXTURE_COORD_ARRAY_STRIDE_EXT = 0x808A, + GL_TEXTURE_COORD_ARRAY_COUNT_EXT = 0x808B, + GL_EDGE_FLAG_ARRAY_STRIDE_EXT = 0x808C, + GL_EDGE_FLAG_ARRAY_COUNT_EXT = 0x808D, + GL_VERTEX_ARRAY_POINTER_EXT = 0x808E, + GL_NORMAL_ARRAY_POINTER_EXT = 0x808F, + GL_COLOR_ARRAY_POINTER_EXT = 0x8090, + GL_INDEX_ARRAY_POINTER_EXT = 0x8091, + GL_TEXTURE_COORD_ARRAY_POINTER_EXT = 0x8092, + GL_EDGE_FLAG_ARRAY_POINTER_EXT = 0x8093, + + /* GL_EXT_texture_object */ + GL_TEXTURE_PRIORITY_EXT = 0x8066, + GL_TEXTURE_RESIDENT_EXT = 0x8067, + GL_TEXTURE_1D_BINDING_EXT = 0x8068, + GL_TEXTURE_2D_BINDING_EXT = 0x8069, + + /* GL_EXT_texture3D */ + GL_PACK_SKIP_IMAGES_EXT = 0x806B, + GL_PACK_IMAGE_HEIGHT_EXT = 0x806C, + GL_UNPACK_SKIP_IMAGES_EXT = 0x806D, + GL_UNPACK_IMAGE_HEIGHT_EXT = 0x806E, + GL_TEXTURE_3D_EXT = 0x806F, + GL_PROXY_TEXTURE_3D_EXT = 0x8070, + GL_TEXTURE_DEPTH_EXT = 0x8071, + GL_TEXTURE_WRAP_R_EXT = 0x8072, + GL_MAX_3D_TEXTURE_SIZE_EXT = 0x8073, + GL_TEXTURE_3D_BINDING_EXT = 0x806A, + + /* GL_EXT_paletted_texture */ + GL_TABLE_TOO_LARGE_EXT = 0x8031, + GL_COLOR_TABLE_FORMAT_EXT = 0x80D8, + GL_COLOR_TABLE_WIDTH_EXT = 0x80D9, + GL_COLOR_TABLE_RED_SIZE_EXT = 0x80DA, + GL_COLOR_TABLE_GREEN_SIZE_EXT = 0x80DB, + GL_COLOR_TABLE_BLUE_SIZE_EXT = 0x80DC, + GL_COLOR_TABLE_ALPHA_SIZE_EXT = 0x80DD, + GL_COLOR_TABLE_LUMINANCE_SIZE_EXT = 0x80DE, + GL_COLOR_TABLE_INTENSITY_SIZE_EXT = 0x80DF, + GL_TEXTURE_INDEX_SIZE_EXT = 0x80ED, + GL_COLOR_INDEX1_EXT = 0x80E2, + GL_COLOR_INDEX2_EXT = 0x80E3, + GL_COLOR_INDEX4_EXT = 0x80E4, + GL_COLOR_INDEX8_EXT = 0x80E5, + GL_COLOR_INDEX12_EXT = 0x80E6, + GL_COLOR_INDEX16_EXT = 0x80E7, + + /* GL_EXT_shared_texture_palette */ + GL_SHARED_TEXTURE_PALETTE_EXT = 0x81FB, + + /* GL_EXT_point_parameters */ + GL_POINT_SIZE_MIN_EXT = 0x8126, + GL_POINT_SIZE_MAX_EXT = 0x8127, + GL_POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128, + GL_DISTANCE_ATTENUATION_EXT = 0x8129, + + /* GL_EXT_rescale_normal */ + GL_RESCALE_NORMAL_EXT = 0x803A, + + /* GL_EXT_abgr */ + GL_ABGR_EXT = 0x8000, + + /* GL_EXT_stencil_wrap */ + GL_INCR_WRAP_EXT = 0x8507, + GL_DECR_WRAP_EXT = 0x8508, + + /* GL_SGIS_texture_edge_clamp */ + GL_CLAMP_TO_EDGE_SGIS = 0x812F, + + /* GL_INGR_blend_func_separate */ + GL_BLEND_DST_RGB_INGR = 0x80C8, + GL_BLEND_SRC_RGB_INGR = 0x80C9, + GL_BLEND_DST_ALPHA_INGR = 0x80CA, + GL_BLEND_SRC_ALPHA_INGR = 0x80CB, + + /* OpenGL 1.2 */ + GL_RESCALE_NORMAL = 0x803A, + GL_CLAMP_TO_EDGE = 0x812F, + GL_MAX_ELEMENTS_VERTICES = 0xF0E8, + GL_MAX_ELEMENTS_INDICES = 0xF0E9, + GL_BGR = 0x80E0, + GL_BGRA = 0x80E1, + GL_UNSIGNED_BYTE_3_3_2 = 0x8032, + GL_UNSIGNED_BYTE_2_3_3_REV = 0x8362, + GL_UNSIGNED_SHORT_5_6_5 = 0x8363, + GL_UNSIGNED_SHORT_5_6_5_REV = 0x8364, + GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033, + GL_UNSIGNED_SHORT_4_4_4_4_REV = 0x8365, + GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034, + GL_UNSIGNED_SHORT_1_5_5_5_REV = 0x8366, + GL_UNSIGNED_INT_8_8_8_8 = 0x8035, + GL_UNSIGNED_INT_8_8_8_8_REV = 0x8367, + GL_UNSIGNED_INT_10_10_10_2 = 0x8036, + GL_UNSIGNED_INT_2_10_10_10_REV = 0x8368, + GL_LIGHT_MODEL_COLOR_CONTROL = 0x81F8, + GL_SINGLE_COLOR = 0x81F9, + GL_SEPARATE_SPECULAR_COLOR = 0x81FA, + GL_TEXTURE_MIN_LOD = 0x813A, + GL_TEXTURE_MAX_LOD = 0x813B, + GL_TEXTURE_BASE_LEVEL = 0x813C, + GL_TEXTURE_MAX_LEVEL = 0x813D, + + /* GL_ARB_multitexture */ + GL_TEXTURE0_ARB = 0x84C0, + GL_TEXTURE1_ARB = 0x84C1, + GL_TEXTURE2_ARB = 0x84C2, + GL_TEXTURE3_ARB = 0x84C3, + GL_TEXTURE4_ARB = 0x84C4, + GL_TEXTURE5_ARB = 0x84C5, + GL_TEXTURE6_ARB = 0x84C6, + GL_TEXTURE7_ARB = 0x84C7, + GL_TEXTURE8_ARB = 0x84C8, + GL_TEXTURE9_ARB = 0x84C9, + GL_TEXTURE10_ARB = 0x84CA, + GL_TEXTURE11_ARB = 0x84CB, + GL_TEXTURE12_ARB = 0x84CC, + GL_TEXTURE13_ARB = 0x84CD, + GL_TEXTURE14_ARB = 0x84CE, + GL_TEXTURE15_ARB = 0x84CF, + GL_TEXTURE16_ARB = 0x84D0, + GL_TEXTURE17_ARB = 0x84D1, + GL_TEXTURE18_ARB = 0x84D2, + GL_TEXTURE19_ARB = 0x84D3, + GL_TEXTURE20_ARB = 0x84D4, + GL_TEXTURE21_ARB = 0x84D5, + GL_TEXTURE22_ARB = 0x84D6, + GL_TEXTURE23_ARB = 0x84D7, + GL_TEXTURE24_ARB = 0x84D8, + GL_TEXTURE25_ARB = 0x84D9, + GL_TEXTURE26_ARB = 0x84DA, + GL_TEXTURE27_ARB = 0x84DB, + GL_TEXTURE28_ARB = 0x84DC, + GL_TEXTURE29_ARB = 0x84DD, + GL_TEXTURE30_ARB = 0x84DE, + GL_TEXTURE31_ARB = 0x84DF, + GL_ACTIVE_TEXTURE_ARB = 0x84E0, + GL_CLIENT_ACTIVE_TEXTURE_ARB = 0x84E1, + GL_MAX_TEXTURE_UNITS_ARB = 0x84E2, + + /* + * OpenGL 1.2 imaging subset (NOT IMPLEMENTED BY MESA) + */ + /* GL_EXT_color_table */ + GL_COLOR_TABLE = 0x80D0, + GL_POST_CONVOLUTION_COLOR_TABLE = 0x80D1, + GL_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D2, + GL_PROXY_COLOR_TABLE = 0x80D3, + GL_PROXY_POST_CONVOLUTION_COLOR_TABLE = 0x80D4, + GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D5, + GL_COLOR_TABLE_SCALE = 0x80D6, + GL_COLOR_TABLE_BIAS = 0x80D7, + GL_COLOR_TABLE_FORMAT = 0x80D8, + GL_COLOR_TABLE_WIDTH = 0x80D9, + GL_COLOR_TABLE_RED_SIZE = 0x80DA, + GL_COLOR_TABLE_GREEN_SIZE = 0x80DB, + GL_COLOR_TABLE_BLUE_SIZE = 0x80DC, + GL_COLOR_TABLE_ALPHA_SIZE = 0x80DD, + GL_COLOR_TABLE_LUMINANCE_SIZE = 0x80DE, + GL_COLOR_TABLE_INTENSITY_SIZE = 0x80DF, + + /* GL_EXT_convolution and GL_HP_convolution_border_modes */ + GL_CONVOLUTION_1D = 0x8010, + GL_CONVOLUTION_2D = 0x8011, + GL_SEPARABLE_2D = 0x8012, + GL_CONVOLUTION_BORDER_MODE = 0x8013, + GL_CONVOLUTION_FILTER_SCALE = 0x8014, + GL_CONVOLUTION_FILTER_BIAS = 0x8015, + GL_REDUCE = 0x8016, + GL_CONVOLUTION_FORMAT = 0x8017, + GL_CONVOLUTION_WIDTH = 0x8018, + GL_CONVOLUTION_HEIGHT = 0x8019, + GL_MAX_CONVOLUTION_WIDTH = 0x801A, + GL_MAX_CONVOLUTION_HEIGHT = 0x801B, + GL_POST_CONVOLUTION_RED_SCALE = 0x801C, + GL_POST_CONVOLUTION_GREEN_SCALE = 0x801D, + GL_POST_CONVOLUTION_BLUE_SCALE = 0x801E, + GL_POST_CONVOLUTION_ALPHA_SCALE = 0x801F, + GL_POST_CONVOLUTION_RED_BIAS = 0x8020, + GL_POST_CONVOLUTION_GREEN_BIAS = 0x8021, + GL_POST_CONVOLUTION_BLUE_BIAS = 0x8022, + GL_POST_CONVOLUTION_ALPHA_BIAS = 0x8023, + GL_CONSTANT_BORDER = 0x8151, + GL_REPLICATE_BORDER = 0x8153, + GL_CONVOLUTION_BORDER_COLOR = 0x8154, + + /* GL_SGI_color_matrix */ + GL_COLOR_MATRIX = 0x80B1, + GL_COLOR_MATRIX_STACK_DEPTH = 0x80B2, + GL_MAX_COLOR_MATRIX_STACK_DEPTH = 0x80B3, + GL_POST_COLOR_MATRIX_RED_SCALE = 0x80B4, + GL_POST_COLOR_MATRIX_GREEN_SCALE = 0x80B5, + GL_POST_COLOR_MATRIX_BLUE_SCALE = 0x80B6, + GL_POST_COLOR_MATRIX_ALPHA_SCALE = 0x80B7, + GL_POST_COLOR_MATRIX_RED_BIAS = 0x80B8, + GL_POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9, + GL_POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA, + GL_POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB, + + /* GL_EXT_histogram */ + GL_HISTOGRAM = 0x8024, + GL_PROXY_HISTOGRAM = 0x8025, + GL_HISTOGRAM_WIDTH = 0x8026, + GL_HISTOGRAM_FORMAT = 0x8027, + GL_HISTOGRAM_RED_SIZE = 0x8028, + GL_HISTOGRAM_GREEN_SIZE = 0x8029, + GL_HISTOGRAM_BLUE_SIZE = 0x802A, + GL_HISTOGRAM_ALPHA_SIZE = 0x802B, + GL_HISTOGRAM_LUMINANCE_SIZE = 0x802C, + GL_HISTOGRAM_SINK = 0x802D, + GL_MINMAX = 0x802E, + GL_MINMAX_FORMAT = 0x802F, + GL_MINMAX_SINK = 0x8030, + GL_TABLE_TOO_LARGE = 0x8031, + + /* GL_NV_texgen_reflection (nVidia) */ + GL_NORMAL_MAP_NV = 0x8511, + GL_REFLECTION_MAP_NV = 0x8512, + + /* GL_PGI_misc_hints */ + GL_PREFER_DOUBLEBUFFER_HINT_PGI = 107000, + GL_STRICT_DEPTHFUNC_HINT_PGI = 107030, + GL_STRICT_LIGHTING_HINT_PGI = 107031, + GL_STRICT_SCISSOR_HINT_PGI = 107032, + GL_FULL_STIPPLE_HINT_PGI = 107033, + GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI = 107011, + GL_NATIVE_GRAPHICS_END_HINT_PGI = 107012, + GL_CONSERVE_MEMORY_HINT_PGI = 107005, + GL_RECLAIM_MEMORY_HINT_PGI = 107006, + GL_ALWAYS_FAST_HINT_PGI = 107020, + GL_ALWAYS_SOFT_HINT_PGI = 107021, + GL_ALLOW_DRAW_OBJ_HINT_PGI = 107022, + GL_ALLOW_DRAW_WIN_HINT_PGI = 107023, + GL_ALLOW_DRAW_FRG_HINT_PGI = 107024, + GL_ALLOW_DRAW_SPN_HINT_PGI = 107024, + GL_ALLOW_DRAW_MEM_HINT_PGI = 107025, + GL_CLIP_NEAR_HINT_PGI = 107040, + GL_CLIP_FAR_HINT_PGI = 107041, + GL_WIDE_LINE_HINT_PGI = 107042, + GL_BACK_NORMALS_HINT_PGI = 107043, + GL_NATIVE_GRAPHICS_HANDLE_PGI = 107010, + + /* GL_EXT_compiled_vertex_array */ + GL_ARRAY_ELEMENT_LOCK_FIRST_SGI = 0x81A8, + GL_ARRAY_ELEMENT_LOCK_COUNT_SGI = 0x81A9, + + /* GL_EXT_clip_volume_hint */ + GL_CLIP_VOLUME_CLIPPING_HINT_EXT = 0x80F0 + + +/* When you add new enums, please make sure you update the strings + * in enums.c as well... + */ + +} +#ifdef CENTERLINE_CLPP + /* CenterLine C++ workaround: */ + gl_enum; + typedef int GLenum; +#else + /* all other compilers */ + GLenum; +#endif + + +/* GL_NO_ERROR must be zero */ +#define GL_NO_ERROR 0 + + + +enum { + GL_CURRENT_BIT = 0x00000001, + GL_POINT_BIT = 0x00000002, + GL_LINE_BIT = 0x00000004, + GL_POLYGON_BIT = 0x00000008, + GL_POLYGON_STIPPLE_BIT = 0x00000010, + GL_PIXEL_MODE_BIT = 0x00000020, + GL_LIGHTING_BIT = 0x00000040, + GL_FOG_BIT = 0x00000080, + GL_DEPTH_BUFFER_BIT = 0x00000100, + GL_ACCUM_BUFFER_BIT = 0x00000200, + GL_STENCIL_BUFFER_BIT = 0x00000400, + GL_VIEWPORT_BIT = 0x00000800, + GL_TRANSFORM_BIT = 0x00001000, + GL_ENABLE_BIT = 0x00002000, + GL_COLOR_BUFFER_BIT = 0x00004000, + GL_HINT_BIT = 0x00008000, + GL_EVAL_BIT = 0x00010000, + GL_LIST_BIT = 0x00020000, + GL_TEXTURE_BIT = 0x00040000, + GL_SCISSOR_BIT = 0x00080000, + GL_ALL_ATTRIB_BITS = 0x000FFFFF +}; + + +enum { + GL_CLIENT_PIXEL_STORE_BIT = 0x00000001, + GL_CLIENT_VERTEX_ARRAY_BIT = 0x00000002 +}; +#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF + + +typedef unsigned int GLbitfield; + + +#ifdef CENTERLINE_CLPP +#define signed +#endif + + +/* + * + * Data types (may be architecture dependent in some cases) + * + */ + +/* C type GL type storage */ +/*-------------------------------------------------------------------------*/ +typedef void GLvoid; +typedef unsigned char GLboolean; +typedef signed char GLbyte; /* 1-byte signed */ +typedef short GLshort; /* 2-byte signed */ +typedef int GLint; /* 4-byte signed */ +typedef unsigned char GLubyte; /* 1-byte unsigned */ +typedef unsigned short GLushort; /* 2-byte unsigned */ +typedef unsigned int GLuint; /* 4-byte unsigned */ +typedef int GLsizei; /* 4-byte signed */ +typedef float GLfloat; /* single precision float */ +typedef float GLclampf; /* single precision float in [0,1] */ +typedef double GLdouble; /* double precision float */ +typedef double GLclampd; /* double precision float in [0,1] */ + + + +#if defined(__BEOS__) || defined(__QUICKDRAW__) +#pragma export on +#endif + + +/* + * Miscellaneous + */ + +GLAPI void GLAPIENTRY glClearIndex( GLfloat c ); + +GLAPI void GLAPIENTRY glClearColor( GLclampf red, + GLclampf green, + GLclampf blue, + GLclampf alpha ); + +GLAPI void GLAPIENTRY glClear( GLbitfield mask ); + +GLAPI void GLAPIENTRY glIndexMask( GLuint mask ); + +GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, + GLboolean blue, GLboolean alpha ); + +GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref ); + +GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor ); + +GLAPI void GLAPIENTRY glLogicOp( GLenum opcode ); + +GLAPI void GLAPIENTRY glCullFace( GLenum mode ); + +GLAPI void GLAPIENTRY glFrontFace( GLenum mode ); + +GLAPI void GLAPIENTRY glPointSize( GLfloat size ); + +GLAPI void GLAPIENTRY glLineWidth( GLfloat width ); + +GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern ); + +GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode ); + +GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units ); + +GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask ); + +GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask ); + +GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag ); + +GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag ); + +GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, + GLsizei width, GLsizei height); + +GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation ); + +GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation ); + +GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode ); + +GLAPI void GLAPIENTRY glReadBuffer( GLenum mode ); + +GLAPI void GLAPIENTRY glEnable( GLenum cap ); + +GLAPI void GLAPIENTRY glDisable( GLenum cap ); + +GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap ); + + +GLAPI void GLAPIENTRY glEnableClientState( GLenum cap ); /* 1.1 */ + +GLAPI void GLAPIENTRY glDisableClientState( GLenum cap ); /* 1.1 */ + + +GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params ); + +GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params ); + +GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params ); + +GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask ); + +GLAPI void GLAPIENTRY glPopAttrib( void ); + + +GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask ); /* 1.1 */ + +GLAPI void GLAPIENTRY glPopClientAttrib( void ); /* 1.1 */ + + +GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode ); + +GLAPI GLenum GLAPIENTRY glGetError( void ); + +GLAPI const GLubyte* GLAPIENTRY glGetString( GLenum name ); + +GLAPI void GLAPIENTRY glFinish( void ); + +GLAPI void GLAPIENTRY glFlush( void ); + +GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode ); + + + +/* + * Depth Buffer + */ + +GLAPI void GLAPIENTRY glClearDepth( GLclampd depth ); + +GLAPI void GLAPIENTRY glDepthFunc( GLenum func ); + +GLAPI void GLAPIENTRY glDepthMask( GLboolean flag ); + +GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val ); + + +/* + * Accumulation Buffer + */ + +GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, + GLfloat blue, GLfloat alpha ); + +GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value ); + + + +/* + * Transformation + */ + +GLAPI void GLAPIENTRY glMatrixMode( GLenum mode ); + +GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble near_val, GLdouble far_val ); + +GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble near_val, GLdouble far_val ); + +GLAPI void GLAPIENTRY glViewport( GLint x, GLint y, + GLsizei width, GLsizei height ); + +GLAPI void GLAPIENTRY glPushMatrix( void ); + +GLAPI void GLAPIENTRY glPopMatrix( void ); + +GLAPI void GLAPIENTRY glLoadIdentity( void ); + +GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m ); +GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m ); + +GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m ); +GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m ); + +GLAPI void GLAPIENTRY glRotated( GLdouble angle, + GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glRotatef( GLfloat angle, + GLfloat x, GLfloat y, GLfloat z ); + +GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z ); + +GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z ); + + + +/* + * Display Lists + */ + +GLAPI GLboolean GLAPIENTRY glIsList( GLuint list ); + +GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range ); + +GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range ); + +GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode ); + +GLAPI void GLAPIENTRY glEndList( void ); + +GLAPI void GLAPIENTRY glCallList( GLuint list ); + +GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type, + const GLvoid *lists ); + +GLAPI void GLAPIENTRY glListBase( GLuint base ); + + + +/* + * Drawing Functions + */ + +GLAPI void GLAPIENTRY glBegin( GLenum mode ); + +GLAPI void GLAPIENTRY glEnd( void ); + + +GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y ); +GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y ); +GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y ); +GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y ); + +GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z ); +GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z ); +GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z ); + +GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); +GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w ); +GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w ); + +GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glVertex2iv( const GLint *v ); +GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glVertex3iv( const GLint *v ); +GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glVertex4iv( const GLint *v ); +GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz ); +GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz ); +GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz ); +GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz ); +GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz ); + +GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v ); +GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glNormal3iv( const GLint *v ); +GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glIndexd( GLdouble c ); +GLAPI void GLAPIENTRY glIndexf( GLfloat c ); +GLAPI void GLAPIENTRY glIndexi( GLint c ); +GLAPI void GLAPIENTRY glIndexs( GLshort c ); +GLAPI void GLAPIENTRY glIndexub( GLubyte c ); /* 1.1 */ + +GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c ); +GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c ); +GLAPI void GLAPIENTRY glIndexiv( const GLint *c ); +GLAPI void GLAPIENTRY glIndexsv( const GLshort *c ); +GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c ); /* 1.1 */ + +GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue ); +GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue ); +GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue ); +GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue ); +GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue ); +GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue ); +GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue ); +GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue ); + +GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green, + GLbyte blue, GLbyte alpha ); +GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green, + GLdouble blue, GLdouble alpha ); +GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green, + GLfloat blue, GLfloat alpha ); +GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green, + GLint blue, GLint alpha ); +GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green, + GLshort blue, GLshort alpha ); +GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green, + GLubyte blue, GLubyte alpha ); +GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green, + GLuint blue, GLuint alpha ); +GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green, + GLushort blue, GLushort alpha ); + + +GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v ); +GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glColor3iv( const GLint *v ); +GLAPI void GLAPIENTRY glColor3sv( const GLshort *v ); +GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v ); +GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v ); +GLAPI void GLAPIENTRY glColor3usv( const GLushort *v ); + +GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v ); +GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glColor4iv( const GLint *v ); +GLAPI void GLAPIENTRY glColor4sv( const GLshort *v ); +GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v ); +GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v ); +GLAPI void GLAPIENTRY glColor4usv( const GLushort *v ); + + +GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s ); +GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s ); +GLAPI void GLAPIENTRY glTexCoord1i( GLint s ); +GLAPI void GLAPIENTRY glTexCoord1s( GLshort s ); + +GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t ); +GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t ); +GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t ); +GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t ); + +GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r ); +GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r ); +GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r ); +GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r ); + +GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q ); +GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q ); +GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q ); +GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q ); + +GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y ); +GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y ); +GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y ); +GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y ); + +GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z ); +GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z ); +GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z ); + +GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); +GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w ); +GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w ); + +GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v ); +GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v ); +GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v ); +GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 ); +GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ); +GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 ); +GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 ); + + +GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 ); +GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 ); +GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 ); +GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 ); + + + +/* + * Vertex Arrays (1.1) + */ + +GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride, + const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride, + const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, void **params ); + +GLAPI void GLAPIENTRY glArrayElement( GLint i ); + +GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count ); + +GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count, + GLenum type, const GLvoid *indices ); + +GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride, + const GLvoid *pointer ); + + +/* + * Lighting + */ + +GLAPI void GLAPIENTRY glShadeModel( GLenum mode ); + +GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param ); +GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname, + const GLfloat *params ); +GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname, + const GLint *params ); + +GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname, + GLfloat *params ); +GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param ); +GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param ); +GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params ); + +GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode ); + + + + +/* + * Raster functions + */ + +GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor ); + +GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLint mapsize, + const GLfloat *values ); +GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLint mapsize, + const GLuint *values ); +GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLint mapsize, + const GLushort *values ); + +GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values ); +GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values ); +GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values ); + +GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height, + GLfloat xorig, GLfloat yorig, + GLfloat xmove, GLfloat ymove, + const GLubyte *bitmap ); + +GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + GLvoid *pixels ); + +GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum type ); + + + +/* + * Stenciling + */ + +GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask ); + +GLAPI void GLAPIENTRY glStencilMask( GLuint mask ); + +GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass ); + +GLAPI void GLAPIENTRY glClearStencil( GLint s ); + + + +/* + * Texture mapping + */ + +GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param ); +GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params ); +GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); +GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname, + const GLfloat *params ); +GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname, + const GLint *params ); + +GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target, + GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target, + GLenum pname, GLint *params ); + +GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level, + GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level, + GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLsizei height, + GLint border, GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level, + GLenum format, GLenum type, + GLvoid *pixels ); + + + +/* 1.1 functions */ + +GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures ); + +GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures); + +GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture ); + +GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n, + const GLuint *textures, + const GLclampf *priorities ); + +GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n, + const GLuint *textures, + GLboolean *residences ); + +GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture ); + + +GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level, + GLint xoffset, + GLsizei width, GLenum format, + GLenum type, const GLvoid *pixels ); + + +GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ); + + +GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level, + GLenum internalformat, + GLint x, GLint y, + GLsizei width, GLint border ); + + +GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level, + GLenum internalformat, + GLint x, GLint y, + GLsizei width, GLsizei height, + GLint border ); + + +GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level, + GLint xoffset, GLint x, GLint y, + GLsizei width ); + + +GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, + GLsizei width, GLsizei height ); + + + + +/* + * Evaluators + */ + +GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2, + GLint stride, + GLint order, const GLdouble *points ); +GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2, + GLint stride, + GLint order, const GLfloat *points ); + +GLAPI void GLAPIENTRY glMap2d( GLenum target, + GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, + GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, + const GLdouble *points ); +GLAPI void GLAPIENTRY glMap2f( GLenum target, + GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, + GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, + const GLfloat *points ); + +GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v ); +GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v ); +GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v ); + +GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u ); +GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u ); + +GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u ); +GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u ); + +GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v ); +GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v ); + +GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u ); +GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u ); + +GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); +GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); + +GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2, + GLint vn, GLdouble v1, GLdouble v2 ); +GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2, + GLint vn, GLfloat v1, GLfloat v2 ); + +GLAPI void GLAPIENTRY glEvalPoint1( GLint i ); + +GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j ); + +GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 ); + +GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); + + + +/* + * Fog + */ + +GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param ); + +GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params ); + +GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params ); + + + +/* + * Selection and Feedback + */ + +GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); + +GLAPI void GLAPIENTRY glPassThrough( GLfloat token ); + +GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer ); + +GLAPI void GLAPIENTRY glInitNames( void ); + +GLAPI void GLAPIENTRY glLoadName( GLuint name ); + +GLAPI void GLAPIENTRY glPushName( GLuint name ); + +GLAPI void GLAPIENTRY glPopName( void ); + + + +/* + * 1.0 Extensions + */ + +/* GL_EXT_blend_minmax */ +GLAPI void GLAPIENTRY glBlendEquationEXT( GLenum mode ); + + + +/* GL_EXT_blend_color */ +GLAPI void GLAPIENTRY glBlendColorEXT( GLclampf red, GLclampf green, + GLclampf blue, GLclampf alpha ); + + + +/* GL_EXT_polygon_offset */ +GLAPI void GLAPIENTRY glPolygonOffsetEXT( GLfloat factor, GLfloat bias ); + + + +/* GL_EXT_vertex_array */ + +GLAPI void GLAPIENTRY glVertexPointerEXT( GLint size, GLenum type, + GLsizei stride, + GLsizei count, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glNormalPointerEXT( GLenum type, GLsizei stride, + GLsizei count, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glColorPointerEXT( GLint size, GLenum type, + GLsizei stride, + GLsizei count, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glIndexPointerEXT( GLenum type, GLsizei stride, + GLsizei count, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glTexCoordPointerEXT( GLint size, GLenum type, + GLsizei stride, GLsizei count, + const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glEdgeFlagPointerEXT( GLsizei stride, GLsizei count, + const GLboolean *ptr ); + +GLAPI void GLAPIENTRY glGetPointervEXT( GLenum pname, void **params ); + +GLAPI void GLAPIENTRY glArrayElementEXT( GLint i ); + +GLAPI void GLAPIENTRY glDrawArraysEXT( GLenum mode, GLint first, + GLsizei count ); + + + +/* GL_EXT_texture_object */ + +GLAPI void GLAPIENTRY glGenTexturesEXT( GLsizei n, GLuint *textures ); + +GLAPI void GLAPIENTRY glDeleteTexturesEXT( GLsizei n, const GLuint *textures); + +GLAPI void GLAPIENTRY glBindTextureEXT( GLenum target, GLuint texture ); + +GLAPI void GLAPIENTRY glPrioritizeTexturesEXT( GLsizei n, + const GLuint *textures, + const GLclampf *priorities ); + +GLAPI GLboolean GLAPIENTRY glAreTexturesResidentEXT( GLsizei n, + const GLuint *textures, + GLboolean *residences ); + +GLAPI GLboolean GLAPIENTRY glIsTextureEXT( GLuint texture ); + + + +/* GL_EXT_texture3D */ + +GLAPI void GLAPIENTRY glTexImage3DEXT( GLenum target, GLint level, + GLenum internalFormat, + GLsizei width, GLsizei height, + GLsizei depth, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glTexSubImage3DEXT( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint zoffset, GLsizei width, + GLsizei height, GLsizei depth, + GLenum format, + GLenum type, const GLvoid *pixels); + +GLAPI void GLAPIENTRY glCopyTexSubImage3DEXT( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint zoffset, GLint x, + GLint y, GLsizei width, + GLsizei height ); + + + +/* GL_EXT_color_table */ + +GLAPI void GLAPIENTRY glColorTableEXT( GLenum target, GLenum internalformat, + GLsizei width, GLenum format, + GLenum type, const GLvoid *table ); + +GLAPI void GLAPIENTRY glColorSubTableEXT( GLenum target, + GLsizei start, GLsizei count, + GLenum format, GLenum type, + const GLvoid *data ); + +GLAPI void GLAPIENTRY glGetColorTableEXT( GLenum target, GLenum format, + GLenum type, GLvoid *table ); + +GLAPI void GLAPIENTRY glGetColorTableParameterfvEXT( GLenum target, + GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetColorTableParameterivEXT( GLenum target, + GLenum pname, + GLint *params ); + + +/* GL_ARB_multitexture */ + +GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture); +GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture); +GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s); +GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s); +GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s); +GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s); +GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); +GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); +GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); + + + +/* GL_EXT_point_parameters */ +GLAPI void GLAPIENTRY glPointParameterfEXT( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glPointParameterfvEXT( GLenum pname, + const GLfloat *params ); + + + +/* GL_INGR_blend_func_separate */ +GLAPI void GLAPIENTRY glBlendFuncSeparateINGR( GLenum sfactorRGB, + GLenum dfactorRGB, + GLenum sfactorAlpha, + GLenum dfactorAlpha ); + + + +/* GL_MESA_window_pos */ + +GLAPI void GLAPIENTRY glWindowPos2iMESA( GLint x, GLint y ); +GLAPI void GLAPIENTRY glWindowPos2sMESA( GLshort x, GLshort y ); +GLAPI void GLAPIENTRY glWindowPos2fMESA( GLfloat x, GLfloat y ); +GLAPI void GLAPIENTRY glWindowPos2dMESA( GLdouble x, GLdouble y ); + +GLAPI void GLAPIENTRY glWindowPos2ivMESA( const GLint *p ); +GLAPI void GLAPIENTRY glWindowPos2svMESA( const GLshort *p ); +GLAPI void GLAPIENTRY glWindowPos2fvMESA( const GLfloat *p ); +GLAPI void GLAPIENTRY glWindowPos2dvMESA( const GLdouble *p ); + +GLAPI void GLAPIENTRY glWindowPos3iMESA( GLint x, GLint y, GLint z ); +GLAPI void GLAPIENTRY glWindowPos3sMESA( GLshort x, GLshort y, GLshort z ); +GLAPI void GLAPIENTRY glWindowPos3fMESA( GLfloat x, GLfloat y, GLfloat z ); +GLAPI void GLAPIENTRY glWindowPos3dMESA( GLdouble x, GLdouble y, GLdouble z ); + +GLAPI void GLAPIENTRY glWindowPos3ivMESA( const GLint *p ); +GLAPI void GLAPIENTRY glWindowPos3svMESA( const GLshort *p ); +GLAPI void GLAPIENTRY glWindowPos3fvMESA( const GLfloat *p ); +GLAPI void GLAPIENTRY glWindowPos3dvMESA( const GLdouble *p ); + +GLAPI void GLAPIENTRY glWindowPos4iMESA( GLint x, GLint y, GLint z, GLint w ); +GLAPI void GLAPIENTRY glWindowPos4sMESA( GLshort x, GLshort y, GLshort z, GLshort w ); +GLAPI void GLAPIENTRY glWindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +GLAPI void GLAPIENTRY glWindowPos4dMESA( GLdouble x, GLdouble y, GLdouble z, GLdouble w); + +GLAPI void GLAPIENTRY glWindowPos4ivMESA( const GLint *p ); +GLAPI void GLAPIENTRY glWindowPos4svMESA( const GLshort *p ); +GLAPI void GLAPIENTRY glWindowPos4fvMESA( const GLfloat *p ); +GLAPI void GLAPIENTRY glWindowPos4dvMESA( const GLdouble *p ); + + +/* GL_MESA_resize_buffers */ + +GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); + + +/* 1.2 functions */ +GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start, + GLuint end, GLsizei count, GLenum type, const GLvoid *indices ); + +GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLsizei height, + GLsizei depth, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint zoffset, GLsizei width, + GLsizei height, GLsizei depth, + GLenum format, + GLenum type, const GLvoid *pixels); + +GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint zoffset, GLint x, + GLint y, GLsizei width, + GLsizei height ); + + +/* 1.2 imaging extension functions */ + +GLAPI void GLAPIENTRY glBlendEquation( GLenum mode ); + +GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green, + GLclampf blue, GLclampf alpha ); + +GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width, + GLenum internalformat, GLboolean sink ); + +GLAPI void GLAPIENTRY glResetHistogram( GLenum target ); + +GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset, + GLenum format, GLenum type, + GLvoid *values ); + +GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat, + GLboolean sink ); + +GLAPI void GLAPIENTRY glResetMinmax( GLenum target ); + +GLAPI void GLAPIENTRY glGetMinMax( GLenum target, GLboolean reset, + GLenum format, GLenum types, + GLvoid *values ); + +GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target, + GLenum internalformat, GLsizei width, GLenum format, GLenum type, + const GLvoid *image ); + +GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target, + GLenum internalformat, GLsizei width, GLsizei height, GLenum format, + GLenum type, const GLvoid *image ); + +GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname, + GLfloat params ); + +GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname, + const GLfloat *params ); + +GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname, + GLint params ); + +GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname, + const GLint *params ); + +GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target, + GLenum internalformat, GLint x, GLint y, GLsizei width ); + +GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target, + GLenum internalformat, GLint x, GLint y, GLsizei width, + GLsizei height); + +GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format, + GLenum type, GLvoid *image ); + +GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target, + GLenum internalformat, GLsizei width, GLsizei height, GLenum format, + GLenum type, const GLvoid *row, const GLvoid *column ); + +GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, + GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); + +GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start, + GLint x, GLint y, GLsizei width ); + +GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat, + GLint x, GLint y, GLsizei width ); + + + +/* GL_EXT_compiled_vertex_array */ +GLAPI void GLAPIENTRY glLockArraysEXT( GLint first, GLsizei count ); +GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); + + +#if defined(__BEOS__) || defined(__QUICKDRAW__) +#pragma export off +#endif + + +/* + * Compile-time tests for extensions: + */ +#define GL_EXT_blend_color 1 +#define GL_EXT_blend_logic_op 1 +#define GL_EXT_blend_minmax 1 +#define GL_EXT_blend_subtract 1 +#define GL_EXT_polygon_offset 1 +#define GL_EXT_vertex_array 1 +#define GL_EXT_texture_object 1 +#define GL_EXT_texture3D 1 +#define GL_EXT_paletted_texture 1 +#define GL_EXT_shared_texture_palette 1 +#define GL_EXT_point_parameters 1 +#define GL_EXT_rescale_normal 1 +#define GL_EXT_abgr 1 +#define GL_EXT_stencil_wrap 1 +#define GL_MESA_window_pos 1 +#define GL_MESA_resize_buffers 1 +#define GL_SGIS_texture_edge_clamp 1 +#define GL_INGR_blend_func_separate 1 +#define GL_ARB_multitexture 1 +#define GL_NV_texgen_reflection 1 +#define GL_PGI_misc_hints 1 +#define GL_EXT_compiled_vertex_array 1 +#define GL_EXT_clip_volume_hint 1 + + +#ifdef macintosh + #pragma enumsalwaysint reset + #if PRAGMA_IMPORT_SUPPORTED + #pragma import off + #endif +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h new file mode 100644 index 00000000000..8ab25a90f07 --- /dev/null +++ b/include/GL/gl_mangle.h @@ -0,0 +1,531 @@ +/* $Id: gl_mangle.h,v 1.1 1999/08/19 00:55:40 jtg 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. + */ + + +/* + * 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 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 glColorTableEXT mglColorTableEXT +#define glColorSubTableEXT mglColorSubTableEXT +#define glGetColorTableEXT mglGetColorTableEXT +#define glGetColorTableParameterfvEXT mglGetColorTableParameterfvEXT +#define glGetColorTableParameterivEXT mglGetColorTableParameterivEXT +#define glGetMinMax mglGetMinMax +#define glMultiTexCoord1dSGIS mglMultiTexCoord1dSGIS +#define glMultiTexCoord1dvSGIS mglMultiTexCoord1dvSGIS +#define glMultiTexCoord1fSGIS mglMultiTexCoord1fSGIS +#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 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/include/GL/glu.h b/include/GL/glu.h new file mode 100644 index 00000000000..b1321c0e978 --- /dev/null +++ b/include/GL/glu.h @@ -0,0 +1,444 @@ +/* $Id: glu.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 3.1 + * Copyright (C) 1995-1999 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * $Log: glu.h,v $ + * Revision 1.1 1999/08/19 00:55:40 jtg + * Initial revision + * + * Revision 3.6 1999/02/14 03:39:45 brianp + * updated for BeOS R4 + * + * Revision 3.5 1999/01/03 03:02:55 brianp + * now using GLAPI and GLAPIENTRY keywords, misc Windows changes (Ted Jump) + * + * Revision 3.4 1998/12/01 02:34:27 brianp + * applied Mark Kilgard's patches from November 30, 1998 + * + * Revision 3.3 1998/11/17 01:14:02 brianp + * minor changes for OpenStep compilation (pete@ohm.york.ac.uk) + * + * Revision 3.2 1998/07/26 01:36:27 brianp + * changes for Windows compilation per Ted Jump + * + * Revision 3.1 1998/06/23 00:33:08 brianp + * added some WIN32 APIENTRY, CALLBACK stuff (Eric Lassauge) + * + * Revision 3.0 1998/02/20 05:06:01 brianp + * initial rev + * + */ + + +#ifndef GLU_H +#define GLU_H + + +#if defined(USE_MGL_NAMESPACE) +#include "glu_mangle.h" +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +#include "GL/gl.h" + + /* to facilitate clean DLL building ... */ +#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__)) +# if defined(_MSC_VER) && defined(BUILD_GLU32) /* tag specify we're building mesa as a DLL */ +# define GLUAPI __declspec(dllexport) +# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ +# define GLUAPI __declspec(dllimport) +# else /* for use with static link lib build of Win32 edition only */ +# define GLUAPI extern +# endif /* _STATIC_MESA support */ +#else +# define GLUAPI extern +#endif /* WIN32 / CYGWIN32 bracket */ + +#ifdef macintosh + #pragma enumsalwaysint on + #if PRAGMA_IMPORT_SUPPORTED + #pragma import on + #endif +#endif + + +#define GLU_VERSION_1_1 1 + + +#define GLU_TRUE GL_TRUE +#define GLU_FALSE GL_FALSE + + +enum { + /* Normal vectors */ + GLU_SMOOTH = 100000, + GLU_FLAT = 100001, + GLU_NONE = 100002, + + /* Quadric draw styles */ + GLU_POINT = 100010, + GLU_LINE = 100011, + GLU_FILL = 100012, + GLU_SILHOUETTE = 100013, + + /* Quadric orientation */ + GLU_OUTSIDE = 100020, + GLU_INSIDE = 100021, + + /* Tesselator */ + GLU_BEGIN = 100100, + GLU_VERTEX = 100101, + GLU_END = 100102, + GLU_ERROR = 100103, + GLU_EDGE_FLAG = 100104, + + /* Contour types */ + GLU_CW = 100120, + GLU_CCW = 100121, + GLU_INTERIOR = 100122, + GLU_EXTERIOR = 100123, + GLU_UNKNOWN = 100124, + + /* Tesselation errors */ + GLU_TESS_ERROR1 = 100151, /* missing gluEndPolygon */ + GLU_TESS_ERROR2 = 100152, /* missing gluBeginPolygon */ + GLU_TESS_ERROR3 = 100153, /* misoriented contour */ + GLU_TESS_ERROR4 = 100154, /* vertex/edge intersection */ + GLU_TESS_ERROR5 = 100155, /* misoriented or self-intersecting loops */ + GLU_TESS_ERROR6 = 100156, /* coincident vertices */ + GLU_TESS_ERROR7 = 100157, /* all vertices collinear */ + GLU_TESS_ERROR8 = 100158, /* intersecting edges */ + GLU_TESS_ERROR9 = 100159, /* not coplanar contours */ + + /* NURBS */ + GLU_AUTO_LOAD_MATRIX = 100200, + GLU_CULLING = 100201, + GLU_PARAMETRIC_TOLERANCE= 100202, + GLU_SAMPLING_TOLERANCE = 100203, + GLU_DISPLAY_MODE = 100204, + GLU_SAMPLING_METHOD = 100205, + GLU_U_STEP = 100206, + GLU_V_STEP = 100207, + + GLU_PATH_LENGTH = 100215, + GLU_PARAMETRIC_ERROR = 100216, + GLU_DOMAIN_DISTANCE = 100217, + + GLU_MAP1_TRIM_2 = 100210, + GLU_MAP1_TRIM_3 = 100211, + + GLU_OUTLINE_POLYGON = 100240, + GLU_OUTLINE_PATCH = 100241, + + GLU_NURBS_ERROR1 = 100251, /* spline order un-supported */ + GLU_NURBS_ERROR2 = 100252, /* too few knots */ + GLU_NURBS_ERROR3 = 100253, /* valid knot range is empty */ + GLU_NURBS_ERROR4 = 100254, /* decreasing knot sequence */ + GLU_NURBS_ERROR5 = 100255, /* knot multiplicity > spline order */ + GLU_NURBS_ERROR6 = 100256, /* endcurve() must follow bgncurve() */ + GLU_NURBS_ERROR7 = 100257, /* bgncurve() must precede endcurve() */ + GLU_NURBS_ERROR8 = 100258, /* ctrlarray or knot vector is NULL */ + GLU_NURBS_ERROR9 = 100259, /* can't draw pwlcurves */ + GLU_NURBS_ERROR10 = 100260, /* missing gluNurbsCurve() */ + GLU_NURBS_ERROR11 = 100261, /* missing gluNurbsSurface() */ + GLU_NURBS_ERROR12 = 100262, /* endtrim() must precede endsurface() */ + GLU_NURBS_ERROR13 = 100263, /* bgnsurface() must precede endsurface() */ + GLU_NURBS_ERROR14 = 100264, /* curve of improper type passed as trim curve */ + GLU_NURBS_ERROR15 = 100265, /* bgnsurface() must precede bgntrim() */ + GLU_NURBS_ERROR16 = 100266, /* endtrim() must follow bgntrim() */ + GLU_NURBS_ERROR17 = 100267, /* bgntrim() must precede endtrim()*/ + GLU_NURBS_ERROR18 = 100268, /* invalid or missing trim curve*/ + GLU_NURBS_ERROR19 = 100269, /* bgntrim() must precede pwlcurve() */ + GLU_NURBS_ERROR20 = 100270, /* pwlcurve referenced twice*/ + GLU_NURBS_ERROR21 = 100271, /* pwlcurve and nurbscurve mixed */ + GLU_NURBS_ERROR22 = 100272, /* improper usage of trim data type */ + GLU_NURBS_ERROR23 = 100273, /* nurbscurve referenced twice */ + GLU_NURBS_ERROR24 = 100274, /* nurbscurve and pwlcurve mixed */ + GLU_NURBS_ERROR25 = 100275, /* nurbssurface referenced twice */ + GLU_NURBS_ERROR26 = 100276, /* invalid property */ + GLU_NURBS_ERROR27 = 100277, /* endsurface() must follow bgnsurface() */ + GLU_NURBS_ERROR28 = 100278, /* intersecting or misoriented trim curves */ + GLU_NURBS_ERROR29 = 100279, /* intersecting trim curves */ + GLU_NURBS_ERROR30 = 100280, /* UNUSED */ + GLU_NURBS_ERROR31 = 100281, /* unconnected trim curves */ + GLU_NURBS_ERROR32 = 100282, /* unknown knot error */ + GLU_NURBS_ERROR33 = 100283, /* negative vertex count encountered */ + GLU_NURBS_ERROR34 = 100284, /* negative byte-stride */ + GLU_NURBS_ERROR35 = 100285, /* unknown type descriptor */ + GLU_NURBS_ERROR36 = 100286, /* null control point reference */ + GLU_NURBS_ERROR37 = 100287, /* duplicate point on pwlcurve */ + + /* Errors */ + GLU_INVALID_ENUM = 100900, + GLU_INVALID_VALUE = 100901, + GLU_OUT_OF_MEMORY = 100902, + GLU_INCOMPATIBLE_GL_VERSION = 100903, + + /* New in GLU 1.1 */ + GLU_VERSION = 100800, + GLU_EXTENSIONS = 100801 +}; + + +/* + * These are the GLU 1.1 typedefs. GLU 1.2 has different ones! + */ +#if defined(__BEOS__) + /* The BeOS does something funky and makes these typedefs in one + * of its system headers. + */ +#else + typedef struct GLUquadric GLUquadricObj; + typedef struct GLUtesselator GLUtriangulatorObj; + typedef struct GLUnurbs GLUnurbsObj; +#endif + + + +#if defined(__BEOS__) || defined(__QUICKDRAW__) +#pragma export on +#endif + + +/* + * + * Miscellaneous functions + * + */ + +GLUAPI void GLAPIENTRY gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez, + GLdouble centerx, GLdouble centery, + GLdouble centerz, + GLdouble upx, GLdouble upy, GLdouble upz ); + + +GLUAPI void GLAPIENTRY gluOrtho2D( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top ); + + +GLUAPI void GLAPIENTRY gluPerspective( GLdouble fovy, GLdouble aspect, + GLdouble zNear, GLdouble zFar ); + + +GLUAPI void GLAPIENTRY gluPickMatrix( GLdouble x, GLdouble y, + GLdouble width, GLdouble height, + const GLint viewport[4] ); + +GLUAPI GLint GLAPIENTRY gluProject( GLdouble objx, GLdouble objy, GLdouble objz, + const GLdouble modelMatrix[16], + const GLdouble projMatrix[16], + const GLint viewport[4], + GLdouble *winx, GLdouble *winy, + GLdouble *winz ); + +GLUAPI GLint GLAPIENTRY gluUnProject( GLdouble winx, GLdouble winy, + GLdouble winz, + const GLdouble modelMatrix[16], + const GLdouble projMatrix[16], + const GLint viewport[4], + GLdouble *objx, GLdouble *objy, + GLdouble *objz ); + +GLUAPI const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode ); + + + +/* + * + * Mipmapping and image scaling + * + */ + +GLUAPI GLint GLAPIENTRY gluScaleImage( GLenum format, + GLint widthin, GLint heightin, + GLenum typein, const void *datain, + GLint widthout, GLint heightout, + GLenum typeout, void *dataout ); + +GLUAPI GLint GLAPIENTRY gluBuild1DMipmaps( GLenum target, GLint components, + GLint width, GLenum format, + GLenum type, const void *data ); + +GLUAPI GLint GLAPIENTRY gluBuild2DMipmaps( GLenum target, GLint components, + GLint width, GLint height, + GLenum format, + GLenum type, const void *data ); + + + +/* + * + * Quadrics + * + */ + +GLUAPI GLUquadricObj* GLAPIENTRY gluNewQuadric( void ); + +GLUAPI void GLAPIENTRY gluDeleteQuadric( GLUquadricObj *state ); + +GLUAPI void GLAPIENTRY gluQuadricDrawStyle( GLUquadricObj *quadObject, + GLenum drawStyle ); + +GLUAPI void GLAPIENTRY gluQuadricOrientation( GLUquadricObj *quadObject, + GLenum orientation ); + +GLUAPI void GLAPIENTRY gluQuadricNormals( GLUquadricObj *quadObject, + GLenum normals ); + +GLUAPI void GLAPIENTRY gluQuadricTexture( GLUquadricObj *quadObject, + GLboolean textureCoords ); + +GLUAPI void GLAPIENTRY gluQuadricCallback( GLUquadricObj *qobj, + GLenum which, void (GLCALLBACK *fn)() ); + +GLUAPI void GLAPIENTRY gluCylinder( GLUquadricObj *qobj, + GLdouble baseRadius, + GLdouble topRadius, + GLdouble height, + GLint slices, GLint stacks ); + +GLUAPI void GLAPIENTRY gluSphere( GLUquadricObj *qobj, + GLdouble radius, GLint slices, GLint stacks ); + +GLUAPI void GLAPIENTRY gluDisk( GLUquadricObj *qobj, + GLdouble innerRadius, GLdouble outerRadius, + GLint slices, GLint loops ); + +GLUAPI void GLAPIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius, + GLdouble outerRadius, GLint slices, + GLint loops, GLdouble startAngle, + GLdouble sweepAngle ); + + + +/* + * + * Nurbs + * + */ + +GLUAPI GLUnurbsObj* GLAPIENTRY gluNewNurbsRenderer( void ); + +GLUAPI void GLAPIENTRY gluDeleteNurbsRenderer( GLUnurbsObj *nobj ); + +GLUAPI void GLAPIENTRY gluLoadSamplingMatrices( GLUnurbsObj *nobj, + const GLfloat modelMatrix[16], + const GLfloat projMatrix[16], + const GLint viewport[4] ); + +GLUAPI void GLAPIENTRY gluNurbsProperty( GLUnurbsObj *nobj, GLenum property, + GLfloat value ); + +GLUAPI void GLAPIENTRY gluGetNurbsProperty( GLUnurbsObj *nobj, GLenum property, + GLfloat *value ); + +GLUAPI void GLAPIENTRY gluBeginCurve( GLUnurbsObj *nobj ); + +GLUAPI void GLAPIENTRY gluEndCurve( GLUnurbsObj * nobj ); + +GLUAPI void GLAPIENTRY gluNurbsCurve( GLUnurbsObj *nobj, GLint nknots, + GLfloat *knot, GLint stride, + GLfloat *ctlarray, GLint order, + GLenum type ); + +GLUAPI void GLAPIENTRY gluBeginSurface( GLUnurbsObj *nobj ); + +GLUAPI void GLAPIENTRY gluEndSurface( GLUnurbsObj * nobj ); + +GLUAPI void GLAPIENTRY gluNurbsSurface( GLUnurbsObj *nobj, + GLint sknot_count, GLfloat *sknot, + GLint tknot_count, GLfloat *tknot, + GLint s_stride, GLint t_stride, + GLfloat *ctlarray, + GLint sorder, GLint torder, + GLenum type ); + +GLUAPI void GLAPIENTRY gluBeginTrim( GLUnurbsObj *nobj ); + +GLUAPI void GLAPIENTRY gluEndTrim( GLUnurbsObj *nobj ); + +GLUAPI void GLAPIENTRY gluPwlCurve( GLUnurbsObj *nobj, GLint count, + GLfloat *array, GLint stride, GLenum type ); + +GLUAPI void GLAPIENTRY gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, + void (GLCALLBACK *fn)() ); + + + +/* + * + * Polygon tesselation + * + */ + +GLUAPI GLUtriangulatorObj* GLAPIENTRY gluNewTess( void ); + +GLUAPI void GLAPIENTRY gluTessCallback( GLUtriangulatorObj *tobj, GLenum which, + void (GLCALLBACK *fn)() ); + +GLUAPI void GLAPIENTRY gluDeleteTess( GLUtriangulatorObj *tobj ); + +GLUAPI void GLAPIENTRY gluBeginPolygon( GLUtriangulatorObj *tobj ); + +GLUAPI void GLAPIENTRY gluEndPolygon( GLUtriangulatorObj *tobj ); + +GLUAPI void GLAPIENTRY gluNextContour( GLUtriangulatorObj *tobj, GLenum type ); + +GLUAPI void GLAPIENTRY gluTessVertex( GLUtriangulatorObj *tobj, GLdouble v[3], + void *data ); + + + +/* + * + * New functions in GLU 1.1 + * + */ + +GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name ); + + +#if defined(__BEOS__) || defined(__QUICKDRAW__) +#pragma export off +#endif + + +#ifdef macintosh + #pragma enumsalwaysint reset + #if PRAGMA_IMPORT_SUPPORTED + #pragma import off + #endif +#endif + + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/include/GL/glu_mangle.h b/include/GL/glu_mangle.h new file mode 100644 index 00000000000..ed3944c54b1 --- /dev/null +++ b/include/GL/glu_mangle.h @@ -0,0 +1,86 @@ +/* $Id: glu_mangle.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 3.0 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * $Log: glu_mangle.h,v $ + * Revision 1.1 1999/08/19 00:55:40 jtg + * Initial revision + * + * Revision 3.1 1999/06/21 22:00:42 brianp + * added #ifndef GLU_MANGLE_H stuff + * + * Revision 3.0 1998/02/20 05:04:45 brianp + * initial rev + * + */ + +#ifndef GLU_MANGLE_H +#define GLU_MANGLE_H + + +#define gluLookAt mgluLookAt +#define gluOrtho2D mgluOrtho2D +#define gluPerspective mgluPerspective +#define gluPickMatrix mgluPickMatrix +#define gluProject mgluProject +#define gluUnProject mgluUnProject +#define gluErrorString mgluErrorString +#define gluScaleImage mgluScaleImage +#define gluBuild1DMipmaps mgluBuild1DMipmaps +#define gluBuild2DMipmaps mgluBuild2DMipmaps +#define gluNewQuadric mgluNewQuadric +#define gluDeleteQuadric mgluDeleteQuadric +#define gluQuadricDrawStyle mgluQuadricDrawStyle +#define gluQuadricOrientation mgluQuadricOrientation +#define gluQuadricNormals mgluQuadricNormals +#define gluQuadricTexture mgluQuadricTexture +#define gluQuadricCallback mgluQuadricCallback +#define gluCylinder mgluCylinder +#define gluSphere mgluSphere +#define gluDisk mgluDisk +#define gluPartialDisk mgluPartialDisk +#define gluNewNurbsRenderer mgluNewNurbsRenderer +#define gluDeleteNurbsRenderer mgluDeleteNurbsRenderer +#define gluLoadSamplingMatrices mgluLoadSamplingMatrices +#define gluNurbsProperty mgluNurbsProperty +#define gluGetNurbsProperty mgluGetNurbsProperty +#define gluBeginCurve mgluBeginCurve +#define gluEndCurve mgluEndCurve +#define gluNurbsCurve mgluNurbsCurve +#define gluBeginSurface mgluBeginSurface +#define gluEndSurface mgluEndSurface +#define gluNurbsSurface mgluNurbsSurface +#define gluBeginTrim mgluBeginTrim +#define gluEndTrim mgluEndTrim +#define gluPwlCurve mgluPwlCurve +#define gluNurbsCallback mgluNurbsCallback +#define gluNewTess mgluNewTess +#define gluTessCallback mgluTessCallback +#define gluDeleteTess mgluDeleteTess +#define gluBeginPolygon mgluBeginPolygon +#define gluEndPolygon mgluEndPolygon +#define gluNextContour mgluNextContour +#define gluTessVertex mgluTessVertex +#define gluGetString mgluGetString + +#endif diff --git a/include/GL/glut.h b/include/GL/glut.h new file mode 100644 index 00000000000..1b7fc43667b --- /dev/null +++ b/include/GL/glut.h @@ -0,0 +1,751 @@ +#ifndef __glut_h__ +#define __glut_h__ + +/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */ + +/* This program is freely distributable without licensing fees and is + provided without guarantee or warrantee expressed or implied. This + program is -not- in the public domain. */ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_WIN32) + +/* GLUT 3.7 now tries to avoid including + to avoid name space pollution, but Win32's + needs APIENTRY and WINGDIAPI defined properly. + + tjump@spgs.com contributes: + If users are building glut code on MS Windows, then they should + make sure they include windows.h early, let's not get into a + header definitions war since MS has proven it's capability to + change header dependencies w/o publishing they have done so. + + So, let's not include windows.h here, as it's not really required and + MS own gl/gl.h *should* include it if the dependency is there. */ + +/* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA + in your compile preprocessor options. */ +# if !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA) +# pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */ +/* To enable automatic SGI OpenGL for Windows library usage for GLUT, + define GLUT_USE_SGI_OPENGL in your compile preprocessor options. */ +# ifdef GLUT_USE_SGI_OPENGL +# pragma comment (lib, "opengl.lib") /* link with SGI OpenGL for Windows lib */ +# pragma comment (lib, "glu.lib") /* link with SGI OpenGL Utility lib */ +# pragma comment (lib, "glut.lib") /* link with Win32 GLUT for SGI OpenGL lib */ +# else +# pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */ +# pragma comment (lib, "glu32.lib") /* link with Microsoft OpenGL Utility lib */ +# pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */ +# endif +# endif + +/* To disable supression of annoying warnings about floats being promoted + to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor + options. */ +# ifndef GLUT_NO_WARNING_DISABLE +# pragma warning (disable:4244) /* Disable bogus VC++ 4.2 conversion warnings. */ +# pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */ +# endif + +/* Win32 has an annoying issue where there are multiple C run-time + libraries (CRTs). If the executable is linked with a different CRT + from the GLUT DLL, the GLUT DLL will not share the same CRT static + data seen by the executable. In particular, atexit callbacks registered + in the executable will not be called if GLUT calls its (different) + exit routine). GLUT is typically built with the + "/MD" option (the CRT with multithreading DLL support), but the Visual + C++ linker default is "/ML" (the single threaded CRT). + + One workaround to this issue is requiring users to always link with + the same CRT as GLUT is compiled with. That requires users supply a + non-standard option. GLUT 3.7 has its own built-in workaround where + the executable's "exit" function pointer is covertly passed to GLUT. + GLUT then calls the executable's exit function pointer to ensure that + any "atexit" calls registered by the application are called if GLUT + needs to exit. + + Note that the __glut*WithExit routines should NEVER be called directly. + To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */ + +/* XXX This is from Win32's */ +# if !defined(_MSC_VER) && !defined(__cdecl) + /* Define __cdecl for non-Microsoft compilers. */ +# define __cdecl +# define GLUT_DEFINED___CDECL +# endif +# ifndef _CRTIMP +# ifdef _NTSDK + /* Definition compatible with NT SDK */ +# define _CRTIMP +# else + /* Current definition */ +# ifdef _DLL +# define _CRTIMP __declspec(dllimport) +# else +# define _CRTIMP +# endif +# endif +# define GLUT_DEFINED__CRTIMP +# endif +# ifndef GLUT_BUILDING_LIB +extern _CRTIMP void __cdecl exit(int); +# endif + +/* GLUT callback calling convention for Win32. */ +# define GLUTCALLBACK __cdecl + +/* for callback/function pointer defs */ +# define GLUTAPIENTRYV __cdecl + +/* glut-win32 specific macros, defined to prevent collision with + and redifinition of Windows system defs, also removes requirement of + pretty much any standard windows header from this file */ + +#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) +# define GLUTAPIENTRY __stdcall +#else +# define GLUTAPIENTRY +#endif + +/* GLUT API entry point declarations for Win32. */ +#if defined(GLUT_BUILDING_LIB) && defined(_DLL) +# define GLUTAPI __declspec(dllexport) +#elif defined(_DLL) +# define GLUTAPI __declspec(dllimport) +#else +# define GLUTAPI extern +#endif + +#if defined(_WIN32) && !defined(_WINDEF_) && !defined(MESA) +# if !defined(MESA_MINWARN) +# pragma message( "note: WINDOWS.H not included, providing Mesa definition of CALLBACK macro" ) +# pragma message( "----: and PROC typedef. If you receive compiler warnings about either ") +# pragma message( "----: being multiply defined you should include WINDOWS.H priot to gl/glut.h" ) +# endif +# define CALLBACK __stdcall +typedef int (GLUTAPIENTRY *PROC)(); +typedef void *HGLRC; +typedef void *HDC; +typedef unsigned long COLORREF; +#endif + +#if defined(_WIN32) && !defined(_WINGDI_) && !defined(MESA) +# if !defined(MESA_MINWARN) +# pragma message( "note: WINDOWS.H not included, providing Mesa definition of wgl functions" ) +# pragma message( "----: and macros. If you receive compiler warnings about any being multiply ") +# pragma message( "----: defined you should include WINDOWS.H priot to gl/glut.h" ) +# endif +# define WGL_FONT_LINES 0 +# define WGL_FONT_POLYGONS 1 +# ifdef UNICODE +# define wglUseFontBitmaps wglUseFontBitmapsW +# define wglUseFontOutlines wglUseFontOutlinesW +# else +# define wglUseFontBitmaps wglUseFontBitmapsA +# define wglUseFontOutlines wglUseFontOutlinesA +# endif /* !UNICODE */ +typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR; +typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT; +GLUTAPI int GLUTAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int); +GLUTAPI HGLRC GLUTAPIENTRY wglCreateContext(HDC); +GLUTAPI HGLRC GLUTAPIENTRY wglCreateLayerContext(HDC, int); +GLUTAPI int GLUTAPIENTRY wglDeleteContext(HGLRC); +GLUTAPI HGLRC GLUTAPIENTRY wglGetCurrentContext(void); +GLUTAPI HDC GLUTAPIENTRY wglGetCurrentDC(void); +GLUTAPI PROC GLUTAPIENTRY wglGetProcAddress(char*); +GLUTAPI int GLUTAPIENTRY wglMakeCurrent(HDC, HGLRC); +GLUTAPI int GLUTAPIENTRY wglShareLists(HGLRC, HGLRC); +GLUTAPI int GLUTAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long); +GLUTAPI int GLUTAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long); +GLUTAPI int GLUTAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT); +GLUTAPI int GLUTAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT); +GLUTAPI int GLUTAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR); +GLUTAPI int GLUTAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *); +GLUTAPI int GLUTAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *); +GLUTAPI int GLUTAPIENTRY wglRealizeLayerPalette(HDC, int, int); +GLUTAPI int GLUTAPIENTRY wglSwapLayerBuffers(HDC, unsigned int); +GLUTAPI int GLUTAPIENTRY SwapBuffers(HDC); +#endif + +#else /* _WIN32 not defined */ + +/* Define GLUTAPIENTRY and GLUTCALLBACK to nothing if we aren't on Win32. */ +# define GLUTAPIENTRY +# define GLUTAPIENTRYV +# define GLUT_APIENTRY_DEFINED +# define GLUTCALLBACK +# define GLUTAPI extern +/* Prototype exit for the non-Win32 case (see above). */ +extern void exit(int); +#endif + + +/** + GLUT API revision history: + + GLUT_API_VERSION is updated to reflect incompatible GLUT + API changes (interface changes, semantic changes, deletions, + or additions). + + GLUT_API_VERSION=1 First public release of GLUT. 11/29/94 + + GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling, + extension. Supports new input devices like tablet, dial and button + box, and Spaceball. Easy to query OpenGL extensions. + + GLUT_API_VERSION=3 glutMenuStatus added. + + GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer, + glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic + video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc, + glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat, + glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!). +**/ +#ifndef GLUT_API_VERSION /* allow this to be overriden */ +#define GLUT_API_VERSION 3 +#endif + +/** + GLUT implementation revision history: + + GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT + API revisions and implementation revisions (ie, bug fixes). + + GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of + GLUT Xlib-based implementation. 11/29/94 + + GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of + GLUT Xlib-based implementation providing GLUT version 2 + interfaces. + + GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95 + + GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95 + + GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95 + + GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96 + + GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner + and video resize. 1/3/97 + + GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines. + + GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release. + + GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling. + + GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support. + + GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface. + + GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa +**/ +#ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */ +#define GLUT_XLIB_IMPLEMENTATION 15 +#endif + +/* Display mode bit masks. */ +#define GLUT_RGB 0 +#define GLUT_RGBA GLUT_RGB +#define GLUT_INDEX 1 +#define GLUT_SINGLE 0 +#define GLUT_DOUBLE 2 +#define GLUT_ACCUM 4 +#define GLUT_ALPHA 8 +#define GLUT_DEPTH 16 +#define GLUT_STENCIL 32 +#if (GLUT_API_VERSION >= 2) +#define GLUT_MULTISAMPLE 128 +#define GLUT_STEREO 256 +#endif +#if (GLUT_API_VERSION >= 3) +#define GLUT_LUMINANCE 512 +#endif + +/* Mouse buttons. */ +#define GLUT_LEFT_BUTTON 0 +#define GLUT_MIDDLE_BUTTON 1 +#define GLUT_RIGHT_BUTTON 2 + +/* Mouse button state. */ +#define GLUT_DOWN 0 +#define GLUT_UP 1 + +#if (GLUT_API_VERSION >= 2) +/* function keys */ +#define GLUT_KEY_F1 1 +#define GLUT_KEY_F2 2 +#define GLUT_KEY_F3 3 +#define GLUT_KEY_F4 4 +#define GLUT_KEY_F5 5 +#define GLUT_KEY_F6 6 +#define GLUT_KEY_F7 7 +#define GLUT_KEY_F8 8 +#define GLUT_KEY_F9 9 +#define GLUT_KEY_F10 10 +#define GLUT_KEY_F11 11 +#define GLUT_KEY_F12 12 +/* directional keys */ +#define GLUT_KEY_LEFT 100 +#define GLUT_KEY_UP 101 +#define GLUT_KEY_RIGHT 102 +#define GLUT_KEY_DOWN 103 +#define GLUT_KEY_PAGE_UP 104 +#define GLUT_KEY_PAGE_DOWN 105 +#define GLUT_KEY_HOME 106 +#define GLUT_KEY_END 107 +#define GLUT_KEY_INSERT 108 +#endif + +/* Entry/exit state. */ +#define GLUT_LEFT 0 +#define GLUT_ENTERED 1 + +/* Menu usage state. */ +#define GLUT_MENU_NOT_IN_USE 0 +#define GLUT_MENU_IN_USE 1 + +/* Visibility state. */ +#define GLUT_NOT_VISIBLE 0 +#define GLUT_VISIBLE 1 + +/* Window status state. */ +#define GLUT_HIDDEN 0 +#define GLUT_FULLY_RETAINED 1 +#define GLUT_PARTIALLY_RETAINED 2 +#define GLUT_FULLY_COVERED 3 + +/* Color index component selection values. */ +#define GLUT_RED 0 +#define GLUT_GREEN 1 +#define GLUT_BLUE 2 + +/* Layers for use. */ +#define GLUT_NORMAL 0 +#define GLUT_OVERLAY 1 + +#if defined(_WIN32) +/* Stroke font constants (use these in GLUT program). */ +#define GLUT_STROKE_ROMAN ((void*)0) +#define GLUT_STROKE_MONO_ROMAN ((void*)1) + +/* Bitmap font constants (use these in GLUT program). */ +#define GLUT_BITMAP_9_BY_15 ((void*)2) +#define GLUT_BITMAP_8_BY_13 ((void*)3) +#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4) +#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5) +#if (GLUT_API_VERSION >= 3) +#define GLUT_BITMAP_HELVETICA_10 ((void*)6) +#define GLUT_BITMAP_HELVETICA_12 ((void*)7) +#define GLUT_BITMAP_HELVETICA_18 ((void*)8) +#endif +#else +/* Stroke font opaque addresses (use constants instead in source code). */ +GLUTAPI void *glutStrokeRoman; +GLUTAPI void *glutStrokeMonoRoman; + +/* Stroke font constants (use these in GLUT program). */ +#define GLUT_STROKE_ROMAN (&glutStrokeRoman) +#define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman) + +/* Bitmap font opaque addresses (use constants instead in source code). */ +GLUTAPI void *glutBitmap9By15; +GLUTAPI void *glutBitmap8By13; +GLUTAPI void *glutBitmapTimesRoman10; +GLUTAPI void *glutBitmapTimesRoman24; +GLUTAPI void *glutBitmapHelvetica10; +GLUTAPI void *glutBitmapHelvetica12; +GLUTAPI void *glutBitmapHelvetica18; + +/* Bitmap font constants (use these in GLUT program). */ +#define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15) +#define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13) +#define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10) +#define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24) +#if (GLUT_API_VERSION >= 3) +#define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10) +#define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12) +#define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18) +#endif +#endif + +/* glutGet parameters. */ +#define GLUT_WINDOW_X 100 +#define GLUT_WINDOW_Y 101 +#define GLUT_WINDOW_WIDTH 102 +#define GLUT_WINDOW_HEIGHT 103 +#define GLUT_WINDOW_BUFFER_SIZE 104 +#define GLUT_WINDOW_STENCIL_SIZE 105 +#define GLUT_WINDOW_DEPTH_SIZE 106 +#define GLUT_WINDOW_RED_SIZE 107 +#define GLUT_WINDOW_GREEN_SIZE 108 +#define GLUT_WINDOW_BLUE_SIZE 109 +#define GLUT_WINDOW_ALPHA_SIZE 110 +#define GLUT_WINDOW_ACCUM_RED_SIZE 111 +#define GLUT_WINDOW_ACCUM_GREEN_SIZE 112 +#define GLUT_WINDOW_ACCUM_BLUE_SIZE 113 +#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114 +#define GLUT_WINDOW_DOUBLEBUFFER 115 +#define GLUT_WINDOW_RGBA 116 +#define GLUT_WINDOW_PARENT 117 +#define GLUT_WINDOW_NUM_CHILDREN 118 +#define GLUT_WINDOW_COLORMAP_SIZE 119 +#if (GLUT_API_VERSION >= 2) +#define GLUT_WINDOW_NUM_SAMPLES 120 +#define GLUT_WINDOW_STEREO 121 +#endif +#if (GLUT_API_VERSION >= 3) +#define GLUT_WINDOW_CURSOR 122 +#endif +#define GLUT_SCREEN_WIDTH 200 +#define GLUT_SCREEN_HEIGHT 201 +#define GLUT_SCREEN_WIDTH_MM 202 +#define GLUT_SCREEN_HEIGHT_MM 203 +#define GLUT_MENU_NUM_ITEMS 300 +#define GLUT_DISPLAY_MODE_POSSIBLE 400 +#define GLUT_INIT_WINDOW_X 500 +#define GLUT_INIT_WINDOW_Y 501 +#define GLUT_INIT_WINDOW_WIDTH 502 +#define GLUT_INIT_WINDOW_HEIGHT 503 +#define GLUT_INIT_DISPLAY_MODE 504 +#if (GLUT_API_VERSION >= 2) +#define GLUT_ELAPSED_TIME 700 +#endif +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) +#define GLUT_WINDOW_FORMAT_ID 123 +#endif + +#if (GLUT_API_VERSION >= 2) +/* glutDeviceGet parameters. */ +#define GLUT_HAS_KEYBOARD 600 +#define GLUT_HAS_MOUSE 601 +#define GLUT_HAS_SPACEBALL 602 +#define GLUT_HAS_DIAL_AND_BUTTON_BOX 603 +#define GLUT_HAS_TABLET 604 +#define GLUT_NUM_MOUSE_BUTTONS 605 +#define GLUT_NUM_SPACEBALL_BUTTONS 606 +#define GLUT_NUM_BUTTON_BOX_BUTTONS 607 +#define GLUT_NUM_DIALS 608 +#define GLUT_NUM_TABLET_BUTTONS 609 +#endif +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) +#define GLUT_DEVICE_IGNORE_KEY_REPEAT 610 +#define GLUT_DEVICE_KEY_REPEAT 611 +#define GLUT_HAS_JOYSTICK 612 +#define GLUT_OWNS_JOYSTICK 613 +#define GLUT_JOYSTICK_BUTTONS 614 +#define GLUT_JOYSTICK_AXES 615 +#define GLUT_JOYSTICK_POLL_RATE 616 +#endif + +#if (GLUT_API_VERSION >= 3) +/* glutLayerGet parameters. */ +#define GLUT_OVERLAY_POSSIBLE 800 +#define GLUT_LAYER_IN_USE 801 +#define GLUT_HAS_OVERLAY 802 +#define GLUT_TRANSPARENT_INDEX 803 +#define GLUT_NORMAL_DAMAGED 804 +#define GLUT_OVERLAY_DAMAGED 805 + +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +/* glutVideoResizeGet parameters. */ +#define GLUT_VIDEO_RESIZE_POSSIBLE 900 +#define GLUT_VIDEO_RESIZE_IN_USE 901 +#define GLUT_VIDEO_RESIZE_X_DELTA 902 +#define GLUT_VIDEO_RESIZE_Y_DELTA 903 +#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904 +#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905 +#define GLUT_VIDEO_RESIZE_X 906 +#define GLUT_VIDEO_RESIZE_Y 907 +#define GLUT_VIDEO_RESIZE_WIDTH 908 +#define GLUT_VIDEO_RESIZE_HEIGHT 909 +#endif + +/* glutUseLayer parameters. */ +#define GLUT_NORMAL 0 +#define GLUT_OVERLAY 1 + +/* glutGetModifiers return mask. */ +#define GLUT_ACTIVE_SHIFT 1 +#define GLUT_ACTIVE_CTRL 2 +#define GLUT_ACTIVE_ALT 4 + +/* glutSetCursor parameters. */ +/* Basic arrows. */ +#define GLUT_CURSOR_RIGHT_ARROW 0 +#define GLUT_CURSOR_LEFT_ARROW 1 +/* Symbolic cursor shapes. */ +#define GLUT_CURSOR_INFO 2 +#define GLUT_CURSOR_DESTROY 3 +#define GLUT_CURSOR_HELP 4 +#define GLUT_CURSOR_CYCLE 5 +#define GLUT_CURSOR_SPRAY 6 +#define GLUT_CURSOR_WAIT 7 +#define GLUT_CURSOR_TEXT 8 +#define GLUT_CURSOR_CROSSHAIR 9 +/* Directional cursors. */ +#define GLUT_CURSOR_UP_DOWN 10 +#define GLUT_CURSOR_LEFT_RIGHT 11 +/* Sizing cursors. */ +#define GLUT_CURSOR_TOP_SIDE 12 +#define GLUT_CURSOR_BOTTOM_SIDE 13 +#define GLUT_CURSOR_LEFT_SIDE 14 +#define GLUT_CURSOR_RIGHT_SIDE 15 +#define GLUT_CURSOR_TOP_LEFT_CORNER 16 +#define GLUT_CURSOR_TOP_RIGHT_CORNER 17 +#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18 +#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19 +/* Inherit from parent window. */ +#define GLUT_CURSOR_INHERIT 100 +/* Blank cursor. */ +#define GLUT_CURSOR_NONE 101 +/* Fullscreen crosshair (if available). */ +#define GLUT_CURSOR_FULL_CROSSHAIR 102 +#endif + +/* GLUT initialization sub-API. */ +GLUTAPI void GLUTAPIENTRY glutInit(int *argcp, char **argv); +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) +GLUTAPI void GLUTAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int)); +#ifndef GLUT_BUILDING_LIB +static void GLUTAPIENTRY glutInit_ATEXIT_HACK(int *argcp, char **argv) { __glutInitWithExit(argcp, argv, exit); } +#define glutInit glutInit_ATEXIT_HACK +#endif +#endif +GLUTAPI void GLUTAPIENTRY glutInitDisplayMode(unsigned int mode); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +GLUTAPI void GLUTAPIENTRY glutInitDisplayString(const char *string); +#endif +GLUTAPI void GLUTAPIENTRY glutInitWindowPosition(int x, int y); +GLUTAPI void GLUTAPIENTRY glutInitWindowSize(int width, int height); +GLUTAPI void GLUTAPIENTRY glutMainLoop(void); + +/* GLUT window sub-API. */ +GLUTAPI int GLUTAPIENTRY glutCreateWindow(const char *title); +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) +GLUTAPI int GLUTAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int)); +#ifndef GLUT_BUILDING_LIB +static int GLUTAPIENTRY glutCreateWindow_ATEXIT_HACK(const char *title) { return __glutCreateWindowWithExit(title, exit); } +#define glutCreateWindow glutCreateWindow_ATEXIT_HACK +#endif +#endif +GLUTAPI int GLUTAPIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height); +GLUTAPI void GLUTAPIENTRY glutDestroyWindow(int win); +GLUTAPI void GLUTAPIENTRY glutPostRedisplay(void); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11) +GLUTAPI void GLUTAPIENTRY glutPostWindowRedisplay(int win); +#endif +GLUTAPI void GLUTAPIENTRY glutSwapBuffers(void); +GLUTAPI int GLUTAPIENTRY glutGetWindow(void); +GLUTAPI void GLUTAPIENTRY glutSetWindow(int win); +GLUTAPI void GLUTAPIENTRY glutSetWindowTitle(const char *title); +GLUTAPI void GLUTAPIENTRY glutSetIconTitle(const char *title); +GLUTAPI void GLUTAPIENTRY glutPositionWindow(int x, int y); +GLUTAPI void GLUTAPIENTRY glutReshapeWindow(int width, int height); +GLUTAPI void GLUTAPIENTRY glutPopWindow(void); +GLUTAPI void GLUTAPIENTRY glutPushWindow(void); +GLUTAPI void GLUTAPIENTRY glutIconifyWindow(void); +GLUTAPI void GLUTAPIENTRY glutShowWindow(void); +GLUTAPI void GLUTAPIENTRY glutHideWindow(void); +#if (GLUT_API_VERSION >= 3) +GLUTAPI void GLUTAPIENTRY glutFullScreen(void); +GLUTAPI void GLUTAPIENTRY glutSetCursor(int cursor); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +GLUTAPI void GLUTAPIENTRY glutWarpPointer(int x, int y); +#endif + +/* GLUT overlay sub-API. */ +GLUTAPI void GLUTAPIENTRY glutEstablishOverlay(void); +GLUTAPI void GLUTAPIENTRY glutRemoveOverlay(void); +GLUTAPI void GLUTAPIENTRY glutUseLayer(GLenum layer); +GLUTAPI void GLUTAPIENTRY glutPostOverlayRedisplay(void); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11) +GLUTAPI void GLUTAPIENTRY glutPostWindowOverlayRedisplay(int win); +#endif +GLUTAPI void GLUTAPIENTRY glutShowOverlay(void); +GLUTAPI void GLUTAPIENTRY glutHideOverlay(void); +#endif + +/* GLUT menu sub-API. */ +GLUTAPI int GLUTAPIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int)); +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) +GLUTAPI int GLUTAPIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int)); +#ifndef GLUT_BUILDING_LIB +static int GLUTAPIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK *func)(int)) { return __glutCreateMenuWithExit(func, exit); } +#define glutCreateMenu glutCreateMenu_ATEXIT_HACK +#endif +#endif +GLUTAPI void GLUTAPIENTRY glutDestroyMenu(int menu); +GLUTAPI int GLUTAPIENTRY glutGetMenu(void); +GLUTAPI void GLUTAPIENTRY glutSetMenu(int menu); +GLUTAPI void GLUTAPIENTRY glutAddMenuEntry(const char *label, int value); +GLUTAPI void GLUTAPIENTRY glutAddSubMenu(const char *label, int submenu); +GLUTAPI void GLUTAPIENTRY glutChangeToMenuEntry(int item, const char *label, int value); +GLUTAPI void GLUTAPIENTRY glutChangeToSubMenu(int item, const char *label, int submenu); +GLUTAPI void GLUTAPIENTRY glutRemoveMenuItem(int item); +GLUTAPI void GLUTAPIENTRY glutAttachMenu(int button); +GLUTAPI void GLUTAPIENTRY glutDetachMenu(int button); + +/* GLUT window callback sub-API. */ +GLUTAPI void GLUTAPIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void)); +GLUTAPI void GLUTAPIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height)); +GLUTAPI void GLUTAPIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y)); +GLUTAPI void GLUTAPIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y)); +GLUTAPI void GLUTAPIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y)); +GLUTAPI void GLUTAPIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y)); +GLUTAPI void GLUTAPIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state)); +GLUTAPI void GLUTAPIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state)); +GLUTAPI void GLUTAPIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void)); +GLUTAPI void GLUTAPIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value); +GLUTAPI void GLUTAPIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state)); +#if (GLUT_API_VERSION >= 2) +GLUTAPI void GLUTAPIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y)); +GLUTAPI void GLUTAPIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z)); +GLUTAPI void GLUTAPIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z)); +GLUTAPI void GLUTAPIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state)); +GLUTAPI void GLUTAPIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state)); +GLUTAPI void GLUTAPIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value)); +GLUTAPI void GLUTAPIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y)); +GLUTAPI void GLUTAPIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y)); +#if (GLUT_API_VERSION >= 3) +GLUTAPI void GLUTAPIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y)); +GLUTAPI void GLUTAPIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void)); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +GLUTAPI void GLUTAPIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state)); +#endif +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) +GLUTAPI void GLUTAPIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y)); +GLUTAPI void GLUTAPIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y)); +GLUTAPI void GLUTAPIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval); +#endif +#endif +#endif + +/* GLUT color index sub-API. */ +GLUTAPI void GLUTAPIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue); +GLUTAPI GLfloat GLUTAPIENTRY glutGetColor(int ndx, int component); +GLUTAPI void GLUTAPIENTRY glutCopyColormap(int win); + +/* GLUT state retrieval sub-API. */ +GLUTAPI int GLUTAPIENTRY glutGet(GLenum type); +GLUTAPI int GLUTAPIENTRY glutDeviceGet(GLenum type); +#if (GLUT_API_VERSION >= 2) +/* GLUT extension support sub-API */ +GLUTAPI int GLUTAPIENTRY glutExtensionSupported(const char *name); +#endif +#if (GLUT_API_VERSION >= 3) +GLUTAPI int GLUTAPIENTRY glutGetModifiers(void); +GLUTAPI int GLUTAPIENTRY glutLayerGet(GLenum type); +#endif + +/* GLUT font sub-API */ +GLUTAPI void GLUTAPIENTRY glutBitmapCharacter(void *font, int character); +GLUTAPI int GLUTAPIENTRY glutBitmapWidth(void *font, int character); +GLUTAPI void GLUTAPIENTRY glutStrokeCharacter(void *font, int character); +GLUTAPI int GLUTAPIENTRY glutStrokeWidth(void *font, int character); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +GLUTAPI int GLUTAPIENTRY glutBitmapLength(void *font, const unsigned char *string); +GLUTAPI int GLUTAPIENTRY glutStrokeLength(void *font, const unsigned char *string); +#endif + +/* GLUT pre-built models sub-API */ +GLUTAPI void GLUTAPIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks); +GLUTAPI void GLUTAPIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks); +GLUTAPI void GLUTAPIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); +GLUTAPI void GLUTAPIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); +GLUTAPI void GLUTAPIENTRY glutWireCube(GLdouble size); +GLUTAPI void GLUTAPIENTRY glutSolidCube(GLdouble size); +GLUTAPI void GLUTAPIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); +GLUTAPI void GLUTAPIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); +GLUTAPI void GLUTAPIENTRY glutWireDodecahedron(void); +GLUTAPI void GLUTAPIENTRY glutSolidDodecahedron(void); +GLUTAPI void GLUTAPIENTRY glutWireTeapot(GLdouble size); +GLUTAPI void GLUTAPIENTRY glutSolidTeapot(GLdouble size); +GLUTAPI void GLUTAPIENTRY glutWireOctahedron(void); +GLUTAPI void GLUTAPIENTRY glutSolidOctahedron(void); +GLUTAPI void GLUTAPIENTRY glutWireTetrahedron(void); +GLUTAPI void GLUTAPIENTRY glutSolidTetrahedron(void); +GLUTAPI void GLUTAPIENTRY glutWireIcosahedron(void); +GLUTAPI void GLUTAPIENTRY glutSolidIcosahedron(void); + +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) +/* GLUT video resize sub-API. */ +GLUTAPI int GLUTAPIENTRY glutVideoResizeGet(GLenum param); +GLUTAPI void GLUTAPIENTRY glutSetupVideoResizing(void); +GLUTAPI void GLUTAPIENTRY glutStopVideoResizing(void); +GLUTAPI void GLUTAPIENTRY glutVideoResize(int x, int y, int width, int height); +GLUTAPI void GLUTAPIENTRY glutVideoPan(int x, int y, int width, int height); + +/* GLUT debugging sub-API. */ +GLUTAPI void GLUTAPIENTRY glutReportErrors(void); +#endif + +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) +/* GLUT device control sub-API. */ +/* glutSetKeyRepeat modes. */ +#define GLUT_KEY_REPEAT_OFF 0 +#define GLUT_KEY_REPEAT_ON 1 +#define GLUT_KEY_REPEAT_DEFAULT 2 + +/* Joystick button masks. */ +#define GLUT_JOYSTICK_BUTTON_A 1 +#define GLUT_JOYSTICK_BUTTON_B 2 +#define GLUT_JOYSTICK_BUTTON_C 4 +#define GLUT_JOYSTICK_BUTTON_D 8 + +GLUTAPI void GLUTAPIENTRY glutIgnoreKeyRepeat(int ignore); +GLUTAPI void GLUTAPIENTRY glutSetKeyRepeat(int repeatMode); +GLUTAPI void GLUTAPIENTRY glutForceJoystickFunc(void); + +/* GLUT game mode sub-API. */ +/* glutGameModeGet. */ +#define GLUT_GAME_MODE_ACTIVE 0 +#define GLUT_GAME_MODE_POSSIBLE 1 +#define GLUT_GAME_MODE_WIDTH 2 +#define GLUT_GAME_MODE_HEIGHT 3 +#define GLUT_GAME_MODE_PIXEL_DEPTH 4 +#define GLUT_GAME_MODE_REFRESH_RATE 5 +#define GLUT_GAME_MODE_DISPLAY_CHANGED 6 + +GLUTAPI void GLUTAPIENTRY glutGameModeString(const char *string); +GLUTAPI int GLUTAPIENTRY glutEnterGameMode(void); +GLUTAPI void GLUTAPIENTRY glutLeaveGameMode(void); +GLUTAPI int GLUTAPIENTRY glutGameModeGet(GLenum mode); +#endif + +#ifdef __cplusplus +} + +#endif + +#if 0 +#ifdef GLUT_APIENTRY_DEFINED +# undef GLUT_APIENTRY_DEFINED +# undef APIENTRY +#endif + +#ifdef GLUT_WINGDIAPI_DEFINED +# undef GLUT_WINGDIAPI_DEFINED +# undef WINGDIAPI +#endif + +#ifdef GLUT_DEFINED___CDECL +# undef GLUT_DEFINED___CDECL +# undef __cdecl +#endif + +#ifdef GLUT_DEFINED__CRTIMP +# undef GLUT_DEFINED__CRTIMP +# undef _CRTIMP +#endif +#endif + +#endif /* __glut_h__ */ diff --git a/include/GL/glut_h.dja b/include/GL/glut_h.dja new file mode 100644 index 00000000000..d5713f0c90a --- /dev/null +++ b/include/GL/glut_h.dja @@ -0,0 +1,352 @@ +/* $Id*/ + +/* + * Mesa 3-D graphics library + * Version: 3.1 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * $Log: glut_h.dja,v $ + * Revision 1.1 1999/08/19 00:55:40 jtg + * Initial revision + * + * Revision 1.1 1999/06/23 00:51:27 brianp + * initial check-in + * + */ + + +/* + * This header file is based on the REAL glut.h by Mark J. Kilgard. + * + * The DJGPP/ALLEGRO (DJA) GLUT implementation was written by + * Bernhard Tschirren (bernie-t@geocities.com) for the sole purpose + * of compiling all the sample programs (which use GLUT). Therefore, + * is NOT AT ALL a complete version of GLUT! + */ + + +#ifndef __AGLUT_H__ +#define __AGLUT_H__ + +#include +#include + +#define GLUTCALLBACK +#define APIENTRY +#define GLUTAPI extern + +#define GLUT_RGB 0 +#define GLUT_RGBA GLUT_RGB +#define GLUT_INDEX 1 +#define GLUT_SINGLE 0 +#define GLUT_DOUBLE 2 +#define GLUT_ACCUM 4 +#define GLUT_ALPHA 8 +#define GLUT_DEPTH 16 +#define GLUT_STENCIL 32 + +/* Mouse buttons. */ +#define GLUT_LEFT_BUTTON 0 +#define GLUT_MIDDLE_BUTTON 1 +#define GLUT_RIGHT_BUTTON 2 + +/* Mouse button state. */ +#define GLUT_DOWN 0 +#define GLUT_UP 1 + +/* function keys */ +#define GLUT_KEY_F1 1 +#define GLUT_KEY_F2 2 +#define GLUT_KEY_F3 3 +#define GLUT_KEY_F4 4 +#define GLUT_KEY_F5 5 +#define GLUT_KEY_F6 6 +#define GLUT_KEY_F7 7 +#define GLUT_KEY_F8 8 +#define GLUT_KEY_F9 9 +#define GLUT_KEY_F10 10 +#define GLUT_KEY_F11 11 +#define GLUT_KEY_F12 12 + +/* directional keys */ +#define GLUT_KEY_LEFT 100 +#define GLUT_KEY_UP 101 +#define GLUT_KEY_RIGHT 102 +#define GLUT_KEY_DOWN 103 +#define GLUT_KEY_PAGE_UP 104 +#define GLUT_KEY_PAGE_DOWN 105 +#define GLUT_KEY_HOME 106 +#define GLUT_KEY_END 107 +#define GLUT_KEY_INSERT 108 + +/* Entry/exit state. */ +#define GLUT_LEFT 0 +#define GLUT_ENTERED 1 + +/* Visibility state. */ +#define GLUT_NOT_VISIBLE 0 +#define GLUT_VISIBLE 1 + +/* Color index component selection values. */ +#define GLUT_RED 0 +#define GLUT_GREEN 1 +#define GLUT_BLUE 2 + +/* Layers for use. */ +#define GLUT_NORMAL 0 +#define GLUT_OVERLAY 1 + +/* Stroke font constants (use these in GLUT program). */ +#define GLUT_STROKE_ROMAN ((void*)0) +#define GLUT_STROKE_MONO_ROMAN ((void*)1) + +/* Bitmap font constants (use these in GLUT program). */ +#define GLUT_BITMAP_9_BY_15 ((void*)2) +#define GLUT_BITMAP_8_BY_13 ((void*)3) +#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4) +#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5) +#define GLUT_BITMAP_HELVETICA_10 ((void*)6) +#define GLUT_BITMAP_HELVETICA_12 ((void*)7) +#define GLUT_BITMAP_HELVETICA_18 ((void*)8) + +/* glutGet parameters. */ +#define GLUT_WINDOW_X 100 +#define GLUT_WINDOW_Y 101 +#define GLUT_WINDOW_WIDTH 102 +#define GLUT_WINDOW_HEIGHT 103 +#define GLUT_WINDOW_BUFFER_SIZE 104 +#define GLUT_WINDOW_STENCIL_SIZE 105 +#define GLUT_WINDOW_DEPTH_SIZE 106 +#define GLUT_WINDOW_RED_SIZE 107 +#define GLUT_WINDOW_GREEN_SIZE 108 +#define GLUT_WINDOW_BLUE_SIZE 109 +#define GLUT_WINDOW_ALPHA_SIZE 110 +#define GLUT_WINDOW_ACCUM_RED_SIZE 111 +#define GLUT_WINDOW_ACCUM_GREEN_SIZE 112 +#define GLUT_WINDOW_ACCUM_BLUE_SIZE 113 +#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114 +#define GLUT_WINDOW_DOUBLEBUFFER 115 +#define GLUT_WINDOW_RGBA 116 +#define GLUT_WINDOW_PARENT 117 +#define GLUT_WINDOW_NUM_CHILDREN 118 +#define GLUT_WINDOW_COLORMAP_SIZE 119 +#define GLUT_WINDOW_NUM_SAMPLES 120 +#define GLUT_WINDOW_STEREO 121 +#define GLUT_WINDOW_CURSOR 122 +#define GLUT_SCREEN_WIDTH 200 +#define GLUT_SCREEN_HEIGHT 201 +#define GLUT_SCREEN_WIDTH_MM 202 +#define GLUT_SCREEN_HEIGHT_MM 203 +#define GLUT_MENU_NUM_ITEMS 300 +#define GLUT_DISPLAY_MODE_POSSIBLE 400 +#define GLUT_INIT_WINDOW_X 500 +#define GLUT_INIT_WINDOW_Y 501 +#define GLUT_INIT_WINDOW_WIDTH 502 +#define GLUT_INIT_WINDOW_HEIGHT 503 +#define GLUT_INIT_DISPLAY_MODE 504 +#define GLUT_ELAPSED_TIME 700 +#define GLUT_WINDOW_FORMAT_ID 123 + +/* glutDeviceGet parameters. */ +#define GLUT_HAS_KEYBOARD 600 +#define GLUT_HAS_MOUSE 601 +#define GLUT_HAS_SPACEBALL 602 +#define GLUT_HAS_DIAL_AND_BUTTON_BOX 603 +#define GLUT_HAS_TABLET 604 +#define GLUT_NUM_MOUSE_BUTTONS 605 +#define GLUT_NUM_SPACEBALL_BUTTONS 606 +#define GLUT_NUM_BUTTON_BOX_BUTTONS 607 +#define GLUT_NUM_DIALS 608 +#define GLUT_NUM_TABLET_BUTTONS 609 +#define GLUT_DEVICE_IGNORE_KEY_REPEAT 610 +#define GLUT_DEVICE_KEY_REPEAT 611 +#define GLUT_HAS_JOYSTICK 612 +#define GLUT_OWNS_JOYSTICK 613 +#define GLUT_JOYSTICK_BUTTONS 614 +#define GLUT_JOYSTICK_AXES 615 +#define GLUT_JOYSTICK_POLL_RATE 616 + +/* glutLayerGet parameters. */ +#define GLUT_OVERLAY_POSSIBLE 800 +#define GLUT_LAYER_IN_USE 801 +#define GLUT_HAS_OVERLAY 802 +#define GLUT_TRANSPARENT_INDEX 803 +#define GLUT_NORMAL_DAMAGED 804 +#define GLUT_OVERLAY_DAMAGED 805 + +/* glutVideoResizeGet parameters. */ +#define GLUT_VIDEO_RESIZE_POSSIBLE 900 +#define GLUT_VIDEO_RESIZE_IN_USE 901 +#define GLUT_VIDEO_RESIZE_X_DELTA 902 +#define GLUT_VIDEO_RESIZE_Y_DELTA 903 +#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904 +#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905 +#define GLUT_VIDEO_RESIZE_X 906 +#define GLUT_VIDEO_RESIZE_Y 907 +#define GLUT_VIDEO_RESIZE_WIDTH 908 +#define GLUT_VIDEO_RESIZE_HEIGHT 909 + +/* glutUseLayer parameters. */ +#define GLUT_NORMAL 0 +#define GLUT_OVERLAY 1 + +/* glutGetModifiers return mask. */ +#define GLUT_ACTIVE_SHIFT 1 +#define GLUT_ACTIVE_CTRL 2 +#define GLUT_ACTIVE_ALT 4 + +/* glutSetCursor parameters. */ +/* Basic arrows. */ +#define GLUT_CURSOR_RIGHT_ARROW 0 +#define GLUT_CURSOR_LEFT_ARROW 1 +/* Symbolic cursor shapes. */ +#define GLUT_CURSOR_INFO 2 +#define GLUT_CURSOR_DESTROY 3 +#define GLUT_CURSOR_HELP 4 +#define GLUT_CURSOR_CYCLE 5 +#define GLUT_CURSOR_SPRAY 6 +#define GLUT_CURSOR_WAIT 7 +#define GLUT_CURSOR_TEXT 8 +#define GLUT_CURSOR_CROSSHAIR 9 +/* Directional cursors. */ +#define GLUT_CURSOR_UP_DOWN 10 +#define GLUT_CURSOR_LEFT_RIGHT 11 +/* Sizing cursors. */ +#define GLUT_CURSOR_TOP_SIDE 12 +#define GLUT_CURSOR_BOTTOM_SIDE 13 +#define GLUT_CURSOR_LEFT_SIDE 14 +#define GLUT_CURSOR_RIGHT_SIDE 15 +#define GLUT_CURSOR_TOP_LEFT_CORNER 16 +#define GLUT_CURSOR_TOP_RIGHT_CORNER 17 +#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18 +#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19 +/* Inherit from parent window. */ +#define GLUT_CURSOR_INHERIT 100 +/* Blank cursor. */ +#define GLUT_CURSOR_NONE 101 +/* Fullscreen crosshair (if available). */ +#define GLUT_CURSOR_FULL_CROSSHAIR 102 + +/* GLUT initialization sub-API. */ +GLUTAPI void APIENTRY glutInit(int *argcp, char **argv); +GLUTAPI void APIENTRY glutInitDisplayMode(unsigned int mode); +GLUTAPI void APIENTRY glutInitWindowPosition(int x, int y); +GLUTAPI void APIENTRY glutInitWindowSize(int width, int height); +GLUTAPI void APIENTRY glutMainLoop(void); + +/* GLUT window sub-API. */ +GLUTAPI int APIENTRY glutCreateWindow(const char *title); +GLUTAPI int APIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height); +GLUTAPI void APIENTRY glutDestroyWindow(int win); +GLUTAPI void APIENTRY glutPostRedisplay(void); +GLUTAPI void APIENTRY glutSwapBuffers(void); +GLUTAPI int APIENTRY glutGetWindow(void); +GLUTAPI void APIENTRY glutSetWindow(int win); +GLUTAPI void APIENTRY glutSetWindowTitle(const char *title); +GLUTAPI void APIENTRY glutSetIconTitle(const char *title); +GLUTAPI void APIENTRY glutPositionWindow(int x, int y); +GLUTAPI void APIENTRY glutReshapeWindow(int width, int height); +GLUTAPI void APIENTRY glutPopWindow(void); +GLUTAPI void APIENTRY glutPushWindow(void); +GLUTAPI void APIENTRY glutIconifyWindow(void); +GLUTAPI void APIENTRY glutShowWindow(void); +GLUTAPI void APIENTRY glutHideWindow(void); + +/* GLUT overlay sub-API. */ +GLUTAPI void APIENTRY glutEstablishOverlay(void); +GLUTAPI void APIENTRY glutRemoveOverlay(void); +GLUTAPI void APIENTRY glutUseLayer(GLenum layer); +GLUTAPI void APIENTRY glutPostOverlayRedisplay(void); +GLUTAPI void APIENTRY glutShowOverlay(void); +GLUTAPI void APIENTRY glutHideOverlay(void); + +/* GLUT menu sub-API. */ +GLUTAPI int APIENTRY glutCreateMenu(void (GLUTCALLBACK *)(int)); +GLUTAPI void APIENTRY glutDestroyMenu(int menu); +GLUTAPI int APIENTRY glutGetMenu(void); +GLUTAPI void APIENTRY glutSetMenu(int menu); +GLUTAPI void APIENTRY glutAddMenuEntry(const char *label, int value); +GLUTAPI void APIENTRY glutAddSubMenu(const char *label, int submenu); +GLUTAPI void APIENTRY glutChangeToMenuEntry(int item, const char *label, int value); +GLUTAPI void APIENTRY glutChangeToSubMenu(int item, const char *label, int submenu); +GLUTAPI void APIENTRY glutRemoveMenuItem(int item); +GLUTAPI void APIENTRY glutAttachMenu(int button); +GLUTAPI void APIENTRY glutDetachMenu(int button); + +/* GLUT window callback sub-API. */ +GLUTAPI void APIENTRY glutDisplayFunc(void (GLUTCALLBACK * func)(void)); +GLUTAPI void APIENTRY glutReshapeFunc(void (GLUTCALLBACK * func)(int width, int height)); +GLUTAPI void APIENTRY glutKeyboardFunc(void (GLUTCALLBACK * func)(unsigned char key, int x, int y)); +GLUTAPI void APIENTRY glutMouseFunc(void (GLUTCALLBACK * func)(int button, int state, int x, int y)); +GLUTAPI void APIENTRY glutMotionFunc(void (GLUTCALLBACK * func)(int x, int y)); +GLUTAPI void APIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK * func)(int x, int y)); +GLUTAPI void APIENTRY glutEntryFunc(void (GLUTCALLBACK * func)(int state)); +GLUTAPI void APIENTRY glutVisibilityFunc(void (GLUTCALLBACK * func)(int state)); +GLUTAPI void APIENTRY glutIdleFunc(void (GLUTCALLBACK * func)(void)); +GLUTAPI void APIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK * func)(int value), int value); +GLUTAPI void APIENTRY glutMenuStateFunc(void (GLUTCALLBACK * func)(int state)); +GLUTAPI void APIENTRY glutSpecialFunc(void (GLUTCALLBACK * func)(int key, int x, int y)); +GLUTAPI void APIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK * func)(int x, int y, int z)); +GLUTAPI void APIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK * func)(int x, int y, int z)); +GLUTAPI void APIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK * func)(int button, int state)); +GLUTAPI void APIENTRY glutButtonBoxFunc(void (GLUTCALLBACK * func)(int button, int state)); +GLUTAPI void APIENTRY glutDialsFunc(void (GLUTCALLBACK * func)(int dial, int value)); +GLUTAPI void APIENTRY glutTabletMotionFunc(void (GLUTCALLBACK * func)(int x, int y)); +GLUTAPI void APIENTRY glutTabletButtonFunc(void (GLUTCALLBACK * func)(int button, int state, int x, int y)); +GLUTAPI void APIENTRY glutMenuStatusFunc(void (GLUTCALLBACK * func)(int status, int x, int y)); +GLUTAPI void APIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK * func)(void)); +GLUTAPI void APIENTRY glutWindowStatusFunc(void (GLUTCALLBACK * func)(int state)); + +/* GLUT color index sub-API. */ +GLUTAPI void APIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue); +GLUTAPI GLfloat APIENTRY glutGetColor(int ndx, int component); +GLUTAPI void APIENTRY glutCopyColormap(int win); + +/* GLUT state retrieval sub-API. */ +GLUTAPI int APIENTRY glutGet(GLenum type); +GLUTAPI int APIENTRY glutDeviceGet(GLenum type); + +/* GLUT font sub-API */ +GLUTAPI void APIENTRY glutBitmapCharacter(void *font, int character); +GLUTAPI int APIENTRY glutBitmapWidth(void *font, int character); +GLUTAPI void APIENTRY glutStrokeCharacter(void *font, int character); +GLUTAPI int APIENTRY glutStrokeWidth(void *font, int character); + +/* GLUT pre-built models sub-API */ +GLUTAPI void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks); +GLUTAPI void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks); +GLUTAPI void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); +GLUTAPI void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); +GLUTAPI void APIENTRY glutWireCube(GLdouble size); +GLUTAPI void APIENTRY glutSolidCube(GLdouble size); +GLUTAPI void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); +GLUTAPI void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); +GLUTAPI void APIENTRY glutWireDodecahedron(void); +GLUTAPI void APIENTRY glutSolidDodecahedron(void); +GLUTAPI void APIENTRY glutWireTeapot(GLdouble size); +GLUTAPI void APIENTRY glutSolidTeapot(GLdouble size); +GLUTAPI void APIENTRY glutWireOctahedron(void); +GLUTAPI void APIENTRY glutSolidOctahedron(void); +GLUTAPI void APIENTRY glutWireTetrahedron(void); +GLUTAPI void APIENTRY glutSolidTetrahedron(void); +GLUTAPI void APIENTRY glutWireIcosahedron(void); +GLUTAPI void APIENTRY glutSolidIcosahedron(void); + +#endif /* __AGLUT_H__ */ diff --git a/include/GL/glutf90.h b/include/GL/glutf90.h new file mode 100644 index 00000000000..46f19796a7b --- /dev/null +++ b/include/GL/glutf90.h @@ -0,0 +1,81 @@ +#ifndef __glutf90_h__ +#define __glutf90_h__ + +/* Copyright (c) Mark J. Kilgard & Willam F. Mitchell, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +/* This header provides the binding interface for William Mitchell's + f90gl Fortran 90 GLUT binding. Other GLUT language bindings + can and should use this interace. */ + +/* I appreciate the guidance from William Mitchell + (mitchell@cam.nist.gov) in developing this friend interface + for use by the f90gl package. See ../../README.fortran */ + +#include + +/* Which callback enumerants for the __glutSetFCB/__glutGetFCB routines. */ +/* NOTE These values are part of a binary interface for the f90gl Fortran + 90 binding and so must NOT changes (additions are allowed). */ + +/* GLUTwindow callbacks. */ +#define GLUT_FCB_DISPLAY 0 /* GLUTdisplayFCB */ +#define GLUT_FCB_RESHAPE 1 /* GLUTreshapeFCB */ +#define GLUT_FCB_MOUSE 2 /* GLUTmouseFCB */ +#define GLUT_FCB_MOTION 3 /* GLUTmotionFCB */ +#define GLUT_FCB_PASSIVE 4 /* GLUTpassiveFCB */ +#define GLUT_FCB_ENTRY 5 /* GLUTentryFCB */ +#define GLUT_FCB_KEYBOARD 6 /* GLUTkeyboardFCB */ +#define GLUT_FCB_KEYBOARD_UP 7 /* GLUTkeyboardFCB */ +#define GLUT_FCB_WINDOW_STATUS 8 /* GLUTwindowStatusFCB */ +#define GLUT_FCB_VISIBILITY 9 /* GLUTvisibilityFCB */ +#define GLUT_FCB_SPECIAL 10 /* GLUTspecialFCB */ +#define GLUT_FCB_SPECIAL_UP 11 /* GLUTspecialFCB */ +#define GLUT_FCB_BUTTON_BOX 12 /* GLUTbuttonBoxFCB */ +#define GLUT_FCB_DIALS 13 /* GLUTdialsFCB */ +#define GLUT_FCB_SPACE_MOTION 14 /* GLUTspaceMotionFCB */ +#define GLUT_FCB_SPACE_ROTATE 15 /* GLUTspaceRotateFCB */ +#define GLUT_FCB_SPACE_BUTTON 16 /* GLUTspaceButtonFCB */ +#define GLUT_FCB_TABLET_MOTION 17 /* GLUTtabletMotionFCB */ +#define GLUT_FCB_TABLET_BUTTON 18 /* GLUTtabletButtonFCB */ +#define GLUT_FCB_JOYSTICK 19 /* GLUTjoystickFCB */ +/* Non-GLUTwindow callbacks. */ +#define GLUT_FCB_OVERLAY_DISPLAY 100 /* GLUTdisplayFCB */ +#define GLUT_FCB_SELECT 101 /* GLUTselectFCB */ +#define GLUT_FCB_TIMER 102 /* GLUTtimerFCB */ + +/* GLUT Fortran callback function types. */ +typedef void (GLUTCALLBACK *GLUTdisplayFCB) (void); +typedef void (GLUTCALLBACK *GLUTreshapeFCB) (int *, int *); +/* NOTE the pressed key is int, not unsigned char for Fortran! */ +typedef void (GLUTCALLBACK *GLUTkeyboardFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTmouseFCB) (int *, int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTmotionFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTpassiveFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTentryFCB) (int *); +typedef void (GLUTCALLBACK *GLUTwindowStatusFCB) (int *); +typedef void (GLUTCALLBACK *GLUTvisibilityFCB) (int *); +typedef void (GLUTCALLBACK *GLUTspecialFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTbuttonBoxFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTdialsFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTspaceMotionFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTspaceRotateFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTspaceButtonFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTtabletMotionFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTtabletButtonFCB) (int *, int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTjoystickFCB) (unsigned int *buttonMask, int *x, int *y, int *z); + +typedef void (GLUTCALLBACK *GLUTselectFCB) (int *); +typedef void (GLUTCALLBACK *GLUTtimerFCB) (int *); +typedef void (GLUTCALLBACK *GLUTmenuStateFCB) (int *); /* DEPRICATED. */ +typedef void (GLUTCALLBACK *GLUTmenuStatusFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTidleFCB) (void); + +/* Functions that set and return Fortran callback functions. */ +extern void* GLUTAPIENTRY __glutGetFCB(int which); +extern void GLUTAPIENTRY __glutSetFCB(int which, void *func); + +#endif /* __glutf90_h__ */ diff --git a/include/GL/glx.h b/include/GL/glx.h new file mode 100644 index 00000000000..4b27880eba9 --- /dev/null +++ b/include/GL/glx.h @@ -0,0 +1,261 @@ +/* $Id: glx.h,v 1.1 1999/08/19 00:55:40 jtg 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: glx.h,v $ + * Revision 1.1 1999/08/19 00:55:40 jtg + * Initial revision + * + * Revision 3.3 1999/02/14 03:39:09 brianp + * new copyright + * + * Revision 3.2 1998/06/18 03:44:00 brianp + * replaced "uint" with "unsigned int" + * + * Revision 3.1 1998/06/01 00:00:17 brianp + * added GLX_SGI_video_sync extension + * + * Revision 3.0 1998/02/20 05:06:01 brianp + * initial rev + * + */ + + +#ifndef GLX_H +#define GLX_H + + +/* + * A pseudo-GLX implementation to allow GLX-based OpenGL programs to + * work with Mesa. + * + * Notes: + * 1. If the visual passed to glXGetConfig was not one returned by + * glXChooseVisual then the GLX_RGBA and GLX_DOUBLEBUFFER queries + * will always return True and the GLX_DEPTH_SIZE query will always + * return non-zero. + * 2. The glXIsDirect() function always returns True. + */ + + + +#include +#include +#include "GL/gl.h" +#ifdef MESA +#include "GL/xmesa.h" +#endif + + +#if defined(USE_MGL_NAMESPACE) +#include "glx_mangle.h" +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +#define GLX_VERSION_1_1 1 + + +/* + * Tokens for glXChooseVisual and glXGetConfig: + */ +enum _GLX_CONFIGS { + GLX_USE_GL = 1, + GLX_BUFFER_SIZE = 2, + GLX_LEVEL = 3, + GLX_RGBA = 4, + GLX_DOUBLEBUFFER = 5, + GLX_STEREO = 6, + GLX_AUX_BUFFERS = 7, + GLX_RED_SIZE = 8, + GLX_GREEN_SIZE = 9, + GLX_BLUE_SIZE = 10, + GLX_ALPHA_SIZE = 11, + GLX_DEPTH_SIZE = 12, + GLX_STENCIL_SIZE = 13, + GLX_ACCUM_RED_SIZE = 14, + GLX_ACCUM_GREEN_SIZE = 15, + GLX_ACCUM_BLUE_SIZE = 16, + GLX_ACCUM_ALPHA_SIZE = 17, + + /* GLX_EXT_visual_info extension */ + GLX_X_VISUAL_TYPE_EXT = 0x22, + GLX_TRANSPARENT_TYPE_EXT = 0x23, + GLX_TRANSPARENT_INDEX_VALUE_EXT = 0x24, + GLX_TRANSPARENT_RED_VALUE_EXT = 0x25, + GLX_TRANSPARENT_GREEN_VALUE_EXT = 0x26, + GLX_TRANSPARENT_BLUE_VALUE_EXT = 0x27, + GLX_TRANSPARENT_ALPHA_VALUE_EXT = 0x28 +}; + + +/* + * Error codes returned by glXGetConfig: + */ +#define GLX_BAD_SCREEN 1 +#define GLX_BAD_ATTRIBUTE 2 +#define GLX_NO_EXTENSION 3 +#define GLX_BAD_VISUAL 4 +#define GLX_BAD_CONTEXT 5 +#define GLX_BAD_VALUE 6 +#define GLX_BAD_ENUM 7 + + +/* + * GLX 1.1 and later: + */ +#define GLX_VENDOR 1 +#define GLX_VERSION 2 +#define GLX_EXTENSIONS 3 + + +/* + * GLX_visual_info extension + */ +#define GLX_TRUE_COLOR_EXT 0x8002 +#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_PSEUDO_COLOR_EXT 0x8004 +#define GLX_STATIC_COLOR_EXT 0x8005 +#define GLX_GRAY_SCALE_EXT 0x8006 +#define GLX_STATIC_GRAY_EXT 0x8007 +#define GLX_NONE_EXT 0x8000 +#define GLX_TRANSPARENT_RGB_EXT 0x8008 +#define GLX_TRANSPARENT_INDEX_EXT 0x8009 + + +/* + * Compile-time extension tests + */ +#ifdef MESA +#define GLX_EXT_visual_info 1 +#define GLX_MESA_pixmap_colormap 1 +#define GLX_MESA_release_buffers 1 +#define GLX_MESA_copy_sub_buffer 1 +#define GLX_SGI_video_sync 1 +#endif + + + +#ifdef MESA + typedef XMesaContext GLXContext; + typedef Pixmap GLXPixmap; + typedef Drawable GLXDrawable; +#else + typedef void * GLXContext; + typedef XID GLXPixmap; + typedef XID GLXDrawable; +#endif +typedef XID GLXContextID; + + + +extern XVisualInfo* glXChooseVisual( Display *dpy, int screen, + int *attribList ); + +extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis, + GLXContext shareList, Bool direct ); + +extern void glXDestroyContext( Display *dpy, GLXContext ctx ); + +extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable, + GLXContext ctx); + +extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst, + GLuint mask ); + +extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable ); + +extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual, + Pixmap pixmap ); + +extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap ); + +extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event ); + +extern Bool glXQueryVersion( Display *dpy, int *maj, int *min ); + +extern Bool glXIsDirect( Display *dpy, GLXContext ctx ); + +extern int glXGetConfig( Display *dpy, XVisualInfo *visual, + int attrib, int *value ); + +extern GLXContext glXGetCurrentContext( void ); + +extern GLXDrawable glXGetCurrentDrawable( void ); + +extern void glXWaitGL( void ); + +extern void glXWaitX( void ); + +extern void glXUseXFont( Font font, int first, int count, int list ); + + + +/* GLX 1.1 and later */ +extern const char *glXQueryExtensionsString( Display *dpy, int screen ); + +extern const char *glXQueryServerString( Display *dpy, int screen, int name ); + +extern const char *glXGetClientString( Display *dpy, int name ); + + + +/* + * Mesa GLX Extensions + */ + +#ifdef GLX_MESA_pixmap_colormap +extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual, + Pixmap pixmap, Colormap cmap ); +#endif + +#ifdef GLX_MESA_release_buffers +extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d ); +#endif + +#ifdef GLX_MESA_copy_sub_buffer +extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable, + int x, int y, int width, int height ); +#endif + +#ifdef GLX_SGI_video_sync +extern int glXGetVideoSyncSGI(unsigned int *count); +extern int glXWaitVideoSyncSGI(int divisor, int remainder, + unsigned int *count); +#endif + + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/GL/glx_mangle.h b/include/GL/glx_mangle.h new file mode 100644 index 00000000000..e246801f78c --- /dev/null +++ b/include/GL/glx_mangle.h @@ -0,0 +1,72 @@ +/* $Id: glx_mangle.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 3.0 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * $Log: glx_mangle.h,v $ + * Revision 1.1 1999/08/19 00:55:40 jtg + * Initial revision + * + * Revision 3.3 1999/06/21 22:01:00 brianp + * added #ifndef GLX_MANGLE_H stuff, video sync extension functions + * + * Revision 3.2 1998/03/26 02:44:53 brianp + * removed ^M characters + * + * Revision 3.1 1998/03/17 02:41:19 brianp + * updated by Randy Frank + * + * Revision 3.0 1998/02/20 05:04:45 brianp + * initial rev + * + */ + +#ifndef GLX_MANGLE_H +#define GLX_MANGLE_H + +#define glXChooseVisual mglXChooseVisual +#define glXCreateContext mglXCreateContext +#define glXDestroyContext mglXDestroyContext +#define glXMakeCurrent mglXMakeCurrent +#define glXCopyContext mglXCopyContext +#define glXSwapBuffers mglXSwapBuffers +#define glXCreateGLXPixmap mglXCreateGLXPixmap +#define glXDestroyGLXPixmap mglXDestroyGLXPixmap +#define glXQueryExtension mglXQueryExtension +#define glXQueryVersion mglXQueryVersion +#define glXIsDirect mglXIsDirect +#define glXGetConfig mglXGetConfig +#define glXGetCurrentContext mglXGetCurrentContext +#define glXGetCurrentDrawable mglXGetCurrentDrawable +#define glXWaitGL mglXWaitGL +#define glXWaitX mglXWaitX +#define glXUseXFont mglXUseXFont +#define glXQueryExtensionsString mglXQueryExtensionsString +#define glXQueryServerString mglXQueryServerString +#define glXGetClientString mglXGetClientString +#define glXCreateGLXPixmapMESA mglXCreateGLXPixmapMESA +#define glXReleaseBuffersMESA mglXReleaseBuffersMESA +#define glXCopySubBufferMESA mglXCopySubBufferMESA +#define glXGetVideoSyncSGI mglXGetVideoSyncSGI +#define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI + +#endif diff --git a/include/GL/mglmesa.h b/include/GL/mglmesa.h new file mode 100644 index 00000000000..76deb339710 --- /dev/null +++ b/include/GL/mglmesa.h @@ -0,0 +1,80 @@ +/**************************************************************************** +* +* Mesa bindings for SciTech MGL +* +* Copyright (C) 1996 SciTech Software. +* All rights reserved. +* +* Filename: $Workfile: mglmesa.h $ +* Version: $Revision: 1.1 $ +* +* Language: ANSI C +* Environment: Any +* +* Description: Header file for the Mesa/OpenGL interface bindings for the +* SciTech MGL graphics library. Uses the MGL internal +* device context structures to get direct access to the +* high performance MGL rasterization functions for maximum +* performance. Utilizes the VESA VBE/AF Accelerator Functions +* via the MGL's accelerated device driver functions, as well +* as basic DirectDraw accelerated functions provided by the +* MGL. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Library General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Library General Public License for more details. +* +* You should have received a copy of the GNU Library General Public +* License along with this library; if not, write to the Free +* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +* +* $Date: 1999/08/19 00:55:40 $ $Author: jtg $ +* +****************************************************************************/ + +#ifndef __MGLMESA_H +#define __MGLMESA_H + +#include "mgraph.h" + +/*------------------------- Function Prototypes ---------------------------*/ + +#ifdef __cplusplus +extern "C" { /* Use "C" linkage when in C++ mode */ +#endif + +#ifndef __WINDOWS__ +#define GLAPIENTRY +#endif + +#ifdef __WINDOWS__ +bool GLAPIENTRY MGLMesaInitDLL(MGLCallbacks *cb,char *version); +#endif +void GLAPIENTRY MGLMesaChooseVisual(MGLDC *dc,MGLVisual *visual); +bool GLAPIENTRY MGLMesaSetVisual(MGLDC *dc,MGLVisual *visual); +bool GLAPIENTRY MGLMesaCreateContext(MGLDC *dc,bool forceMemDC); +void GLAPIENTRY MGLMesaDestroyContext(MGLDC *dc); +void GLAPIENTRY MGLMesaMakeCurrent(MGLDC *dc); +void GLAPIENTRY MGLMesaSwapBuffers(MGLDC *dc,bool waitVRT); + +/* Palette manipulation support. The reason we provide palette manipulation + * routines is so that when rendering in double buffered modes with a + * software backbuffer, the palette for the backbuffer is kept consistent + * with the hardware front buffer. + */ + +void GLAPIENTRY MGLMesaSetPaletteEntry(MGLDC *dc,int entry,uchar red,uchar green,uchar blue); +void GLAPIENTRY MGLMesaSetPalette(MGLDC *dc,palette_t *pal,int numColors,int startIndex); +void GLAPIENTRY MGLMesaRealizePalette(MGLDC *dc,int numColors,int startIndex,int waitVRT); + +#ifdef __cplusplus +} /* End of "C" linkage for C++ */ +#endif /* __cplusplus */ + +#endif /* __MGLMESA_H */ diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h new file mode 100644 index 00000000000..11423a8e3d0 --- /dev/null +++ b/include/GL/osmesa.h @@ -0,0 +1,256 @@ +/* $Id: osmesa.h,v 1.1 1999/08/19 00:55:40 jtg 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: osmesa.h,v $ + * Revision 1.1 1999/08/19 00:55:40 jtg + * Initial revision + * + * Revision 1.4 1999/02/14 03:39:09 brianp + * new copyright + * + * Revision 1.3 1999/01/03 02:52:30 brianp + * now using GLAPI and GLAPIENTRY keywords (Ted Jump) + * + * Revision 1.2 1998/07/26 01:33:51 brianp + * added WINGDIAPI and APIENTRY keywords per Ted Jump + * + * Revision 1.1 1998/02/13 03:17:50 brianp + * Initial revision + * + */ + + +/* + * Mesa Off-Screen rendering interface. + * + * This is an operating system and window system independent interface to + * Mesa which allows one to render images into a client-supplied buffer in + * main memory. Such images may manipulated or saved in whatever way the + * client wants. + * + * These are the API functions: + * OSMesaCreateContext - create a new Off-Screen Mesa rendering context + * OSMesaMakeCurrent - bind an OSMesaContext to a client's image buffer + * and make the specified context the current one. + * OSMesaDestroyContext - destroy an OSMesaContext + * OSMesaGetCurrentContext - return thread's current context ID + * OSMesaPixelStore - controls how pixels are stored in image buffer + * OSMesaGetIntegerv - return OSMesa state parameters + * + * + * The limits on the width and height of an image buffer are MAX_WIDTH and + * MAX_HEIGHT as defined in Mesa/src/config.h. Defaults are 1280 and 1024. + * You can increase them as needed but beware that many temporary arrays in + * Mesa are dimensioned by MAX_WIDTH or MAX_HEIGHT. + */ + + + +#ifndef OSMESA_H +#define OSMESA_H + + + +#ifdef __cplusplus +extern "C" { +#endif + + +#include "GL/gl.h" + + + +#define OSMESA_MAJOR_VERSION 3 +#define OSMESA_MINOR_VERSION 0 + + + +/* + * Values for the format parameter of OSMesaCreateContext() + * New in version 2.0. + */ +#define OSMESA_COLOR_INDEX GL_COLOR_INDEX +#define OSMESA_RGBA GL_RGBA +#define OSMESA_BGRA 0x1 +#define OSMESA_ARGB 0x2 +#define OSMESA_RGB GL_RGB +#define OSMESA_BGR 0x4 + + +/* + * OSMesaPixelStore() parameters: + * New in version 2.0. + */ +#define OSMESA_ROW_LENGTH 0x10 +#define OSMESA_Y_UP 0x11 + + +/* + * Accepted by OSMesaGetIntegerv: + */ +#define OSMESA_WIDTH 0x20 +#define OSMESA_HEIGHT 0x21 +#define OSMESA_FORMAT 0x22 +#define OSMESA_TYPE 0x23 + + + +typedef struct osmesa_context *OSMesaContext; + + +#if defined(__BEOS__) || defined(__QUICKDRAW__) +#pragma export on +#endif + + +/* + * Create an Off-Screen Mesa rendering context. The only attribute needed is + * an RGBA vs Color-Index mode flag. + * + * Input: format - one of OSMESA_COLOR_INDEX, OSMESA_RGBA, OSMESA_BGRA, + * OSMESA_ARGB, OSMESA_RGB, or OSMESA_BGR. + * sharelist - specifies another OSMesaContext with which to share + * display lists. NULL indicates no sharing. + * Return: an OSMesaContext or 0 if error + */ +GLAPI OSMesaContext GLAPIENTRY OSMesaCreateContext( GLenum format, + OSMesaContext sharelist ); + + + + +/* + * Destroy an Off-Screen Mesa rendering context. + * + * Input: ctx - the context to destroy + */ +GLAPI void GLAPIENTRY OSMesaDestroyContext( OSMesaContext ctx ); + + + +/* + * Bind an OSMesaContext to an image buffer. The image buffer is just a + * block of memory which the client provides. Its size must be at least + * as large as width*height*sizeof(type). Its address should be a multiple + * of 4 if using RGBA mode. + * + * Image data is stored in the order of glDrawPixels: row-major order + * with the lower-left image pixel stored in the first array position + * (ie. bottom-to-top). + * + * Since the only type initially supported is GL_UNSIGNED_BYTE, if the + * context is in RGBA mode, each pixel will be stored as a 4-byte RGBA + * value. If the context is in color indexed mode, each pixel will be + * stored as a 1-byte value. + * + * If the context's viewport hasn't been initialized yet, it will now be + * initialized to (0,0,width,height). + * + * Input: ctx - the rendering context + * buffer - the image buffer memory + * type - data type for pixel components, only GL_UNSIGNED_BYTE + * supported now + * width, height - size of image buffer in pixels, at least 1 + * Return: GL_TRUE if success, GL_FALSE if error because of invalid ctx, + * invalid buffer address, type!=GL_UNSIGNED_BYTE, width<1, height<1, + * width>internal limit or height>internal limit. + */ +GLAPI GLboolean GLAPIENTRY OSMesaMakeCurrent( OSMesaContext ctx, + void *buffer, GLenum type, + GLsizei width, GLsizei height ); + + + + +/* + * Return the current Off-Screen Mesa rendering context handle. + */ +GLAPI OSMesaContext GLAPIENTRY OSMesaGetCurrentContext( void ); + + + +/* + * Set pixel store/packing parameters for the current context. + * This is similar to glPixelStore. + * Input: pname - OSMESA_ROW_LENGTH + * specify actual pixels per row in image buffer + * 0 = same as image width (default) + * OSMESA_Y_UP + * zero = Y coordinates increase downward + * non-zero = Y coordinates increase upward (default) + * value - the value for the parameter pname + * + * New in version 2.0. + */ +GLAPI void GLAPIENTRY OSMesaPixelStore( GLint pname, GLint value ); + + + +/* + * Return context info. This is like glGetIntegerv. + * Input: pname - + * OSMESA_WIDTH return current image width + * OSMESA_HEIGHT return current image height + * OSMESA_FORMAT return image format + * OSMESA_TYPE return color component data type + * OSMESA_ROW_LENGTH return row length in pixels + * OSMESA_Y_UP returns 1 or 0 to indicate Y axis direction + * value - pointer to integer in which to return result. + */ +GLAPI void GLAPIENTRY OSMesaGetIntegerv( GLint pname, GLint *value ); + + + +/* + * Return the depth buffer associated with an OSMesa context. + * Input: c - the OSMesa context + * Output: width, height - size of buffer in pixels + * bytesPerValue - bytes per depth value (2 or 4) + * buffer - pointer to depth buffer values + * Return: GL_TRUE or GL_FALSE to indicate success or failure. + * + * New in Mesa 2.4. + */ +GLAPI GLboolean GLAPIENTRY OSMesaGetDepthBuffer( OSMesaContext c, + GLint *width, GLint *height, + GLint *bytesPerValue, void **buffer ); + + + + +#if defined(__BEOS__) || defined(__QUICKDRAW__) +#pragma export off +#endif + + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/include/GL/svgamesa.h b/include/GL/svgamesa.h new file mode 100644 index 00000000000..9625a5b59ab --- /dev/null +++ b/include/GL/svgamesa.h @@ -0,0 +1,106 @@ +/* $Id: svgamesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 3.0 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * $Log: svgamesa.h,v $ + * Revision 1.1 1999/08/19 00:55:40 jtg + * Initial revision + * + * Revision 3.0 1998/02/20 05:07:24 brianp + * initial rev + * + */ + + + +/* + * SVGA/Mesa interface for Linux. + */ + + +/* + * Intro to using the VGA/Mesa interface + * + * 1. #include the file + * 2. Call vga_init() to initialize the SVGA library. + * 3. Call vga_setmode() to specify the screen size and color depth. + * 4. Call SVGAMesaCreateContext() to setup a Mesa context. If using 8-bit + * color Mesa assumes color index mode, if using 16-bit or deeper color + * Mesa assumes RGB mode. + * 5. Call SVGAMesaMakeCurrent() to activate the Mesa context. + * 6. You can now use the Mesa API functions. + * 7. Before exiting, call SVGAMesaDestroyContext() then vga_setmode(TEXT) + * to restore the original text screen. + * + * Notes + * 1. You must run your executable as root (or use the set UID-bit) because + * the SVGA library requires it. + * 2. The SVGA driver is not fully implemented yet. See svgamesa.c for what + * has to be done yet. + */ + + +#ifndef SVGAMESA_H +#define SVGAMESA_H + + +#define SVGAMESA_MAJOR_VERSION 3 +#define SVGAMESA_MINOR_VERSION 0 + + +#ifdef __cplusplus +extern "C" { +#endif + + +#include "GL/gl.h" + + + +/* + * This is the SVGAMesa context 'handle': + */ +typedef struct svgamesa_context *SVGAMesaContext; + + + +/* + * doubleBuffer flag new in version 2.4 + */ +extern SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer ); + +extern void SVGAMesaDestroyContext( SVGAMesaContext ctx ); + +extern void SVGAMesaMakeCurrent( SVGAMesaContext ctx ); + +extern SVGAMesaContext SVGAMesaGetCurrentContext( void ); + +extern void SVGAMesaSwapBuffers( void ); + + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/include/GL/wmesa.h b/include/GL/wmesa.h new file mode 100644 index 00000000000..94b61974c37 --- /dev/null +++ b/include/GL/wmesa.h @@ -0,0 +1,155 @@ +/* $Id: wmesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 3.0 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + + +/* + * $Log: wmesa.h,v $ + * Revision 1.1 1999/08/19 00:55:40 jtg + * Initial revision + * + * Revision 3.2 1999/01/03 02:54:45 brianp + * updated per Ted Jump + * + * Revision 3.1 1998/12/01 02:34:27 brianp + * applied Mark Kilgard's patches from November 30, 1998 + * + * Revision 3.0 1998/02/20 05:06:59 brianp + * initial rev + * + */ + + +/* + * Windows driver by: Mark E. Peterson (markp@ic.mankato.mn.us) + * Updated by Li Wei (liwei@aiar.xjtu.edu.cn) + * + * + *************************************************************** + * WMesa * + * version 2.3 * + * * + * By * + * Li Wei * + * Institute of Artificial Intelligence & Robotics * + * Xi'an Jiaotong University * + * Email: liwei@aiar.xjtu.edu.cn * + * Web page: http://sun.aiar.xjtu.edu.cn * + * * + * July 7th, 1997 * + *************************************************************** + */ + + +#ifndef WMESA_H +#define WMESA_H + + +#ifdef __cplusplus +extern "C" { +#endif + + +#include "gl\gl.h" + +#pragma warning (disable:4273) +#pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ +#pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ +#pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ +#pragma warning( disable : 4013 ) /* 'function' undefined; assuming extern returning int */ +#pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ +#pragma warning( disable : 4273 ) /* 'identifier' : inconsistent DLL linkage. dllexport assumed */ +#if (MESA_WARNQUIET>1) +# pragma warning( disable : 4146 ) /* unary minus operator applied to unsigned type, result still unsigned */ +#endif + +/* + * This is the WMesa context 'handle': + */ +typedef struct wmesa_context *WMesaContext; + + + +/* + * Create a new WMesaContext for rendering into a window. You must + * have already created the window of correct visual type and with an + * appropriate colormap. + * + * Input: + * hWnd - Window handle + * Pal - Palette to use + * rgb_flag - GL_TRUE = RGB mode, + * GL_FALSE = color index mode + * db_flag - GL_TRUE = double-buffered, + * GL_FALSE = single buffered + * + * Note: Indexed mode requires double buffering under Windows. + * + * Return: a WMesa_context or NULL if error. + */ +extern WMesaContext WMesaCreateContext(HWND hWnd,HPALETTE* pPal, + GLboolean rgb_flag,GLboolean db_flag); + + +/* + * Destroy a rendering context as returned by WMesaCreateContext() + */ +/*extern void WMesaDestroyContext( WMesaContext ctx );*/ +extern void WMesaDestroyContext( void ); + + + +/* + * Make the specified context the current one. + */ +extern void WMesaMakeCurrent( WMesaContext ctx ); + + +/* + * Return a handle to the current context. + */ +extern WMesaContext WMesaGetCurrentContext( void ); + + +/* + * Swap the front and back buffers for the current context. No action + * taken if the context is not double buffered. + */ +extern void WMesaSwapBuffers(void); + + +/* + * In indexed color mode we need to know when the palette changes. + */ +extern void WMesaPaletteChange(HPALETTE Pal); + +extern void WMesaMove(void); + + + +#ifdef __cplusplus +} +#endif + + +#endif + diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h new file mode 100644 index 00000000000..b25a2ace7e8 --- /dev/null +++ b/include/GL/xmesa.h @@ -0,0 +1,357 @@ +/* $Id: xmesa.h,v 1.1 1999/08/19 00:55:40 jtg 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: xmesa.h,v $ + * Revision 1.1 1999/08/19 00:55:40 jtg + * Initial revision + * + * Revision 1.3 1999/02/24 22:43:27 jens + * Name changes to get XMesa to compile standalone inside XFree86 + * + * Revision 1.2 1999/02/14 03:39:09 brianp + * new copyright + * + * Revision 1.1 1998/02/13 03:17:32 brianp + * Initial revision + * + */ + + +/* + * Mesa/X11 interface. This header file serves as the documentation for + * the Mesa/X11 interface functions. + * + * Note: this interface isn't intended for user programs. It's primarily + * just for implementing the pseudo-GLX interface. + */ + + +/* Sample Usage: + +In addition to the usual X calls to select a visual, create a colormap +and create a window, you must do the following to use the X/Mesa interface: + +1. Call XMesaCreateVisual() to make an XMesaVisual from an XVisualInfo. + +2. Call XMesaCreateContext() to create an X/Mesa rendering context, given + the XMesaVisual. + +3. Call XMesaCreateWindowBuffer() to create an XMesaBuffer from an X window + and XMesaVisual. + +4. Call XMesaMakeCurrent() to bind the XMesaBuffer to an XMesaContext and + to make the context the current one. + +5. Make gl* calls to render your graphics. + +6. Use XMesaSwapBuffers() when double buffering to swap front/back buffers. + +7. Before the X window is destroyed, call XMesaDestroyBuffer(). + +8. Before exiting, call XMesaDestroyVisual and XMesaDestroyContext. + +See the demos/xdemo.c and xmesa1.c files for examples. +*/ + + + + +#ifndef XMESA_H +#define XMESA_H + + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifdef XFree86Server +#include "xmesa_xf86.h" +#else +#include +#include +#include "xmesa_x.h" +#endif +#include "GL/gl.h" + +#ifdef AMIWIN +#include +extern struct Library *XLibBase; +#endif + + +#define XMESA_MAJOR_VERSION 3 +#define XMESA_MINOR_VERSION 0 + + + +/* + * Values passed to XMesaGetString: + */ +#define XMESA_VERSION 1 +#define XMESA_EXTENSIONS 2 + + +/* + * Values passed to XMesaSetFXmode: + */ +#define XMESA_FX_WINDOW 1 +#define XMESA_FX_FULLSCREEN 2 + + + +typedef struct xmesa_context *XMesaContext; + +typedef struct xmesa_visual *XMesaVisual; + +typedef struct xmesa_buffer *XMesaBuffer; + + + + +/* + * Create a new X/Mesa visual. + * Input: display - X11 display + * visinfo - an XVisualInfo pointer + * rgb_flag - GL_TRUE = RGB mode, + * GL_FALSE = color index mode + * alpha_flag - alpha buffer requested? + * db_flag - GL_TRUE = double-buffered, + * GL_FALSE = single buffered + * stereo_flag - stereo visual? + * depth_size - requested bits/depth values, or zero + * stencil_size - requested bits/stencil values, or zero + * accum_size - requested bits/component values, or zero + * ximage_flag - GL_TRUE = use an XImage for back buffer, + * GL_FALSE = use an off-screen pixmap for back buffer + * Return; a new XMesaVisual or 0 if error. + */ +extern XMesaVisual XMesaCreateVisual( XMesaDisplay *display, + XMesaVisualInfo visinfo, + GLboolean rgb_flag, + GLboolean alpha_flag, + GLboolean db_flag, + GLboolean stereo_flag, + GLboolean ximage_flag, + GLint depth_size, + GLint stencil_size, + GLint accum_size, + GLint level ); + +/* + * Destroy an XMesaVisual, but not the associated XVisualInfo. + */ +extern void XMesaDestroyVisual( XMesaVisual v ); + + + +/* + * Create a new XMesaContext for rendering into an X11 window. + * + * Input: visual - an XMesaVisual + * share_list - another XMesaContext with which to share display + * lists or NULL if no sharing is wanted. + * Return: an XMesaContext or NULL if error. + */ +extern XMesaContext XMesaCreateContext( XMesaVisual v, + XMesaContext share_list ); + + +/* + * Destroy a rendering context as returned by XMesaCreateContext() + */ +extern void XMesaDestroyContext( XMesaContext c ); + + +/* + * Create an XMesaBuffer from an X window. + */ +extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v, + XMesaWindow w ); + + +/* + * Create an XMesaBuffer from an X pixmap. + */ +extern XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v, + XMesaPixmap p, + XMesaColormap cmap ); + + +/* + * Destroy an XMesaBuffer, but not the corresponding window or pixmap. + */ +extern void XMesaDestroyBuffer( XMesaBuffer b ); + + +/* + * Return the XMesaBuffer handle which corresponds to an X drawable, if any. + * + * New in Mesa 2.3. + */ +extern XMesaBuffer XMesaFindBuffer( XMesaDisplay *dpy, + XMesaDrawable d ); + + + +/* + * Bind a buffer to a context and make the context the current one. + */ +extern GLboolean XMesaMakeCurrent( XMesaContext c, + XMesaBuffer b ); + + +/* + * Return a handle to the current context. + */ +extern XMesaContext XMesaGetCurrentContext( void ); + + +/* + * Return handle to the current buffer. + */ +extern XMesaBuffer XMesaGetCurrentBuffer( void ); + + +/* + * Swap the front and back buffers for the given buffer. No action is + * taken if the buffer is not double buffered. + */ +extern void XMesaSwapBuffers( XMesaBuffer b ); + + +/* + * Copy a sub-region of the back buffer to the front buffer. + * + * New in Mesa 2.6 + */ +extern void XMesaCopySubBuffer( XMesaBuffer b, + int x, + int y, + int width, + int height ); + + +/* + * Return a pointer to the the Pixmap or XImage being used as the back + * color buffer of an XMesaBuffer. This function is a way to get "under + * the hood" of X/Mesa so one can manipulate the back buffer directly. + * Input: b - the XMesaBuffer + * Output: pixmap - pointer to back buffer's Pixmap, or 0 + * ximage - pointer to back buffer's XImage, or NULL + * Return: GL_TRUE = context is double buffered + * GL_FALSE = context is single buffered + */ +extern GLboolean XMesaGetBackBuffer( XMesaBuffer b, + XMesaPixmap *pixmap, + XMesaImage **ximage ); + + + +/* + * Return the depth buffer associated with an XMesaBuffer. + * Input: b - the XMesa buffer handle + * Output: width, height - size of buffer in pixels + * bytesPerValue - bytes per depth value (2 or 4) + * buffer - pointer to depth buffer values + * Return: GL_TRUE or GL_FALSE to indicate success or failure. + * + * New in Mesa 2.4. + */ +extern GLboolean XMesaGetDepthBuffer( XMesaBuffer b, + GLint *width, + GLint *height, + GLint *bytesPerValue, + void **buffer ); + + + +/* + * Flush/sync a context + */ +extern void XMesaFlush( XMesaContext c ); + + + +/* + * Get an X/Mesa-specific string. + * Input: name - either XMESA_VERSION or XMESA_EXTENSIONS + */ +extern const char *XMesaGetString( XMesaContext c, int name ); + + + +/* + * Scan for XMesaBuffers whose window/pixmap has been destroyed, then free + * any memory used by that buffer. + * + * New in Mesa 2.3. + */ +extern void XMesaGarbageCollect( void ); + + + +/* + * Return a dithered pixel value. + * Input: c - XMesaContext + * x, y - window coordinate + * red, green, blue, alpha - color components in [0,1] + * Return: pixel value + * + * New in Mesa 2.3. + */ +extern unsigned long XMesaDitherColor( XMesaContext xmesa, + GLint x, + GLint y, + GLfloat red, + GLfloat green, + GLfloat blue, + GLfloat alpha ); + + + +/* + * 3Dfx Glide driver only! + * Set 3Dfx/Glide full-screen or window rendering mode. + * Input: mode - either XMESA_FX_WINDOW (window rendering mode) or + * XMESA_FX_FULLSCREEN (full-screen rendering mode) + * Return: GL_TRUE if success + * GL_FALSE if invalid mode or if not using 3Dfx driver + * + * New in Mesa 2.6. + */ +extern GLboolean XMesaSetFXmode( GLint mode ); + + + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/include/GL/xmesa_x.h b/include/GL/xmesa_x.h new file mode 100644 index 00000000000..c9bb17a53f7 --- /dev/null +++ b/include/GL/xmesa_x.h @@ -0,0 +1,92 @@ + +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +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, sub license, 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 (including the +next paragraph) 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 NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. + +**************************************************************************/ + +/* + * Authors: + * Kevin E. Martin + * + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/xmesa_x.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ + */ + +#ifndef _XMESA_X_H_ +#define _XMESA_X_H_ + +typedef Display XMesaDisplay; +typedef Pixmap XMesaPixmap; +typedef Colormap XMesaColormap; +typedef Drawable XMesaDrawable; +typedef Window XMesaWindow; +typedef GC XMesaGC; +typedef XVisualInfo *XMesaVisualInfo; +typedef XImage XMesaImage; +typedef XPoint XMesaPoint; +typedef XColor XMesaColor; + +#define XMesaDestroyImage XDestroyImage + +#define XMesaPutPixel XPutPixel +#define XMesaGetPixel XGetPixel + +#define XMesaSetForeground XSetForeground +#define XMesaSetBackground XSetBackground +#define XMesaSetPlaneMask XSetPlaneMask +#define XMesaSetFunction XSetFunction +#define XMesaSetDashes XSetDashes +#define XMesaSetLineAttributes XSetLineAttributes +#define XMesaSetFillStyle XSetFillStyle +#define XMesaSetTile XSetTile +#define XMesaSetStipple XSetStipple + +#define XMesaDrawPoint XDrawPoint +#define XMesaDrawPoints XDrawPoints +#define XMesaDrawLine XDrawLine +#define XMesaFillRectangle XFillRectangle +#define XMesaPutImage XPutImage +#define XMesaCopyArea XCopyArea +#define XMesaFillPolygon XFillPolygon + +#define XMesaCreatePixmap XCreatePixmap +#define XMesaFreePixmap XFreePixmap +#define XMesaFreeGC XFreeGC + +#define GET_COLORMAP_SIZE(__v) __v->visinfo->colormap_size +#define GET_REDMASK(__v) __v->visinfo->red_mask +#define GET_GREENMASK(__v) __v->visinfo->green_mask +#define GET_BLUEMASK(__v) __v->visinfo->blue_mask +#define GET_BITS_PER_PIXEL(__v) bits_per_pixel(__v->display, __v->visinfo) +#if defined(__cplusplus) || defined(c_plusplus) +#define GET_VISUAL_CLASS(__v) __v->visinfo->c_class +#else +#define GET_VISUAL_CLASS(__v) __v->visinfo->class +#endif +#define GET_VISUAL_DEPTH(__v) __v->visinfo->depth +#define GET_BLACK_PIXEL(__v) BlackPixel(__v->display, __v->visinfo->screen) +#define CHECK_BYTE_ORDER(__v) host_byte_order()==ImageByteOrder(__v->display) +#define CHECK_FOR_HPCR(__v) XInternAtom(__v->display, "_HP_RGB_SMOOTH_MAP_LIST", True) + +#endif diff --git a/include/GL/xmesa_xf86.h b/include/GL/xmesa_xf86.h new file mode 100644 index 00000000000..5c1af7a641f --- /dev/null +++ b/include/GL/xmesa_xf86.h @@ -0,0 +1,189 @@ + +/************************************************************************** + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +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, sub license, 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 (including the +next paragraph) 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 NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. + +**************************************************************************/ + +/* + * Authors: + * Kevin E. Martin + * + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/xmesa_xf86.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ + */ + +#ifndef _XMESA_XF86_H_ +#define _XMESA_XF86_H_ + +#include "scrnintstr.h" +#include "pixmapstr.h" + +typedef struct _XMesaImageRec XMesaImage; + +typedef ScreenRec XMesaDisplay; +typedef PixmapPtr XMesaPixmap; +typedef ColormapPtr XMesaColormap; +typedef DrawablePtr XMesaDrawable; +typedef WindowPtr XMesaWindow; +typedef GCPtr XMesaGC; +typedef VisualPtr XMesaVisualInfo; +typedef DDXPointRec XMesaPoint; +typedef xColorItem XMesaColor; + +#define XMesaSetGeneric(__d,__gc,__val,__mask) \ +{ \ + CARD32 __v[1]; \ + (void) __d; \ + __v[0] = __val; \ + dixChangeGC(NullClient, __gc, __mask, __v, NULL); \ +} + +#define XMesaSetGenericPtr(__d,__gc,__pval,__mask) \ +{ \ + ChangeGCVal __v[1]; \ + (void) __d; \ + __v[0].ptr = __pval; \ + dixChangeGC(NullClient, __gc, __mask, NULL, __v); \ +} + +#define XMesaSetDashes(__d,__gc,__do,__dl,__n) \ +{ \ + (void) __d; \ + SetDashes(__gc, __do, __n, (unsigned char *)__dl); \ +} + +#define XMesaSetLineAttributes(__d,__gc,__lw,__ls,__cs,__js) \ +{ \ + CARD32 __v[4]; \ + (void) __d; \ + __v[0] = __lw; \ + __v[1] = __ls; \ + __v[2] = __cs; \ + __v[3] = __js; \ + dixChangeGC(NullClient, __gc, \ + GCLineWidth|GCLineStyle|GCCapStyle|GCJoinStyle, \ + __v, NULL); \ +} + +#define XMesaSetForeground(d,gc,v) XMesaSetGeneric(d,gc,v,GCForeground) +#define XMesaSetBackground(d,gc,v) XMesaSetGeneric(d,gc,v,GCBackground) +#define XMesaSetPlaneMask(d,gc,v) XMesaSetGeneric(d,gc,v,GCPlaneMask) +#define XMesaSetFunction(d,gc,v) XMesaSetGeneric(d,gc,v,GCFunction) +#define XMesaSetFillStyle(d,gc,v) XMesaSetGeneric(d,gc,v,GCFillStyle) + +#define XMesaSetTile(d,gc,v) XMesaSetGenericPtr(d,gc,v,GCTile) +#define XMesaSetStipple(d,gc,v) XMesaSetGenericPtr(d,gc,v,GCStipple) + +#define XMesaDrawPoint(__d,__b,__gc,__x,__y) \ +{ \ + XMesaPoint __p[1]; \ + (void) __d; \ + __p[0].x = __x; \ + __p[0].y = __y; \ + ValidateGC(__b, __gc); \ + (*gc->ops->PolyPoint)(__b, __gc, CoordModeOrigin, 1, __p); \ +} + +#define XMesaDrawPoints(__d,__b,__gc,__p,__n,__m) \ +{ \ + (void) __d; \ + ValidateGC(__b, __gc); \ + (*gc->ops->PolyPoint)(__b, __gc, __m, __n, __p); \ +} + +#define XMesaDrawLine(__d,__b,__gc,__x0,__y0,__x1,__y1) \ +{ \ + XMesaPoint __p[2]; \ + (void) __d; \ + ValidateGC(__b, __gc); \ + __p[0].x = __x0; \ + __p[0].y = __y0; \ + __p[1].x = __x1; \ + __p[1].y = __y1; \ + (*__gc->ops->Polylines)(__b, __gc, CoordModeOrigin, 2, __p); \ +} + +#define XMesaFillRectangle(__d,__b,__gc,__x,__y,__w,__h) \ +{ \ + xRectangle __r[1]; \ + (void) __d; \ + ValidateGC(__b, __gc); \ + __r[0].x = __x; \ + __r[0].y = __y; \ + __r[0].width = __w; \ + __r[0].height = __h; \ + (*__gc->ops->PolyFillRect)(__b, __gc, 1, __r); \ +} + +#define XMesaPutImage(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h) \ +{ \ + /* Assumes: Images are always in ZPixmap format */ \ + (void) __d; \ + if (__sx || __sy) /* The non-trivial case */ \ + XMesaPutImageHelper(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h); \ + ValidateGC(__b, __gc); \ + (*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \ + __x, __y, __w, __h, 0, ZPixmap, \ + ((XMesaImage *)(__i))->data); \ +} + +#define XMesaCopyArea(__d,__sb,__db,__gc,__sx,__sy,__w,__h,__x,__y) \ +{ \ + (void) __d; \ + ValidateGC(__db, __gc); \ + (*__gc->ops->CopyArea)((DrawablePtr)__sb, __db, __gc, \ + __sx, __sy, __w, __h, __x, __y); \ +} + +#define XMesaFillPolygon(__d,__b,__gc,__p,__n,__s,__m) \ +{ \ + (void) __d; \ + ValidateGC(__b, __gc); \ + (*__gc->ops->FillPolygon)(__b, __gc, __s, __m, __n, __p); \ +} + +/* CreatePixmap returns a PixmapPtr; so, it cannot be inside braces */ +#define XMesaCreatePixmap(__d,__b,__w,__h,__depth) \ + (*__d->CreatePixmap)(__d, __w, __h, __depth) +#define XMesaFreePixmap(__d,__b) \ + (*__d->DestroyPixmap)(__b) + +#define XMesaFreeGC(__d,__gc) \ +{ \ + (void) __d; \ + FreeScratchGC(__gc); \ +} + +#define GET_COLORMAP_SIZE(__v) __v->visinfo->ColormapEntries +#define GET_REDMASK(__v) __v->visinfo->redMask +#define GET_GREENMASK(__v) __v->visinfo->greenMask +#define GET_BLUEMASK(__v) __v->visinfo->blueMask +#define GET_BITS_PER_PIXEL(__v) __v->visinfo->bitsPerRGBValue +#define GET_VISUAL_CLASS(__v) __v->visinfo->class +#define GET_VISUAL_DEPTH(__v) __v->visinfo->nplanes +#define GET_BLACK_PIXEL(__v) __v->display->blackPixel +#define CHECK_BYTE_ORDER(__v) GL_TRUE +#define CHECK_FOR_HPCR(__v) GL_FALSE + +#endif -- cgit v1.2.3 From 6583efcfe9bb139d03b0a35ff76d180268574ce2 Mon Sep 17 00:00:00 2001 From: Jon Taylor Date: Mon, 23 Aug 1999 22:34:08 +0000 Subject: Misc small cleanups --- include/GL/ggimesa.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/GL/ggimesa.h b/include/GL/ggimesa.h index b7f937976b3..86b598d1781 100644 --- a/include/GL/ggimesa.h +++ b/include/GL/ggimesa.h @@ -1,4 +1,4 @@ -/* $Id: ggimesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ +/* $Id: ggimesa.h,v 1.2 1999/08/23 22:34:08 jtaylor Exp $ */ /* * Mesa 3-D graphics library @@ -24,8 +24,11 @@ /* * $Log: ggimesa.h,v $ - * Revision 1.1 1999/08/19 00:55:40 jtg - * Initial revision + * Revision 1.2 1999/08/23 22:34:08 jtaylor + * Misc small cleanups + * + * Revision 1.1.1.1 1999/08/19 00:55:40 jtg + * Imported sources * * Revision 1.2 1998/09/29 01:46:40 brianp * applied Emmanuel Marty's patches for latest GGI @@ -49,16 +52,16 @@ typedef struct ggi_mesa_context *GGIMesaContext; extern GGIMesaContext GGIMesaCreateContext(void); -extern void GGIMesaDestroyContext( GGIMesaContext ctx ); +extern void GGIMesaDestroyContext(GGIMesaContext ctx); -extern void GGIMesaMakeCurrent(GGIMesaContext ctx ); +extern void GGIMesaMakeCurrent(GGIMesaContext ctx); -extern GGIMesaContext GGIMesaGetCurrentContext( void ); +extern GGIMesaContext GGIMesaGetCurrentContext(void); -extern void GGIMesaSwapBuffers( void ); +extern void GGIMesaSwapBuffers(void); -extern int GGIMesaSetVisual(GGIMesaContext ctx,ggi_visual_t vis, - GLboolean rgb_flag,GLboolean db_flag); +extern int GGIMesaSetVisual(GGIMesaContext ctx, ggi_visual_t vis, + GLboolean rgb_flag, GLboolean db_flag); #ifdef __cplusplus } -- cgit v1.2.3 From 2856b53e03a59d1a567a56b99450a44be1a60e13 Mon Sep 17 00:00:00 2001 From: Gareth Hughes Date: Fri, 10 Sep 1999 02:03:31 +0000 Subject: Added GLU 1.3 tessellation (except winding rule code). --- include/GL/glu.h | 148 ++++-- include/GL/glu_mangle.h | 22 +- src/glu/mesa/Makefile.BeOS | 2 +- src/glu/mesa/Makefile.BeOS-R4 | 11 +- src/glu/mesa/Makefile.X11 | 4 +- src/glu/mesa/MesaGLU.def | 13 +- src/glu/mesa/descrip.mms | 5 +- src/glu/mesa/glu.c | 14 +- src/glu/mesa/mms_depend | 5 +- src/glu/mesa/polytest.c | 1049 ------------------------------------ src/glu/mesa/tess.c | 1174 +++++++++++++++++++++++++++++++---------- src/glu/mesa/tess.h | 185 +++---- src/glu/mesa/tesselat.c | 456 ---------------- 13 files changed, 1127 insertions(+), 1961 deletions(-) delete mode 100644 src/glu/mesa/polytest.c delete mode 100644 src/glu/mesa/tesselat.c (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index b1321c0e978..1123705547b 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ +/* $Id: glu.h,v 1.2 1999/09/10 02:08:18 gareth Exp $ */ /* * Mesa 3-D graphics library @@ -23,8 +23,11 @@ /* * $Log: glu.h,v $ - * Revision 1.1 1999/08/19 00:55:40 jtg - * Initial revision + * Revision 1.2 1999/09/10 02:08:18 gareth + * Added GLU 1.3 tessellation (except winding rule code). + * + * Revision 1.1.1.1 1999/08/19 00:55:40 jtg + * Imported sources * * Revision 3.6 1999/02/14 03:39:45 brianp * updated for BeOS R4 @@ -88,6 +91,7 @@ extern "C" { #define GLU_VERSION_1_1 1 +#define GLU_VERSION_1_2 1 #define GLU_TRUE GL_TRUE @@ -110,30 +114,42 @@ enum { GLU_OUTSIDE = 100020, GLU_INSIDE = 100021, - /* Tesselator */ - GLU_BEGIN = 100100, - GLU_VERTEX = 100101, - GLU_END = 100102, - GLU_ERROR = 100103, - GLU_EDGE_FLAG = 100104, - - /* Contour types */ - GLU_CW = 100120, - GLU_CCW = 100121, - GLU_INTERIOR = 100122, - GLU_EXTERIOR = 100123, - GLU_UNKNOWN = 100124, - - /* Tesselation errors */ - GLU_TESS_ERROR1 = 100151, /* missing gluEndPolygon */ - GLU_TESS_ERROR2 = 100152, /* missing gluBeginPolygon */ - GLU_TESS_ERROR3 = 100153, /* misoriented contour */ - GLU_TESS_ERROR4 = 100154, /* vertex/edge intersection */ - GLU_TESS_ERROR5 = 100155, /* misoriented or self-intersecting loops */ - GLU_TESS_ERROR6 = 100156, /* coincident vertices */ - GLU_TESS_ERROR7 = 100157, /* all vertices collinear */ - GLU_TESS_ERROR8 = 100158, /* intersecting edges */ - GLU_TESS_ERROR9 = 100159, /* not coplanar contours */ + /* Tessellator */ + GLU_TESS_BEGIN = 100100, + GLU_TESS_VERTEX = 100101, + GLU_TESS_END = 100102, + GLU_TESS_ERROR = 100103, + GLU_TESS_EDGE_FLAG = 100104, + GLU_TESS_COMBINE = 100105, + + GLU_TESS_BEGIN_DATA = 100106, + GLU_TESS_VERTEX_DATA = 100107, + GLU_TESS_END_DATA = 100108, + GLU_TESS_ERROR_DATA = 100109, + GLU_TESS_EDGE_FLAG_DATA = 100110, + GLU_TESS_COMBINE_DATA = 100111, + + /* Winding rules */ + GLU_TESS_WINDING_ODD = 100130, + GLU_TESS_WINDING_NONZERO = 100131, + GLU_TESS_WINDING_POSITIVE = 100132, + GLU_TESS_WINDING_NEGATIVE = 100133, + GLU_TESS_WINDING_ABS_GEQ_TWO = 100134, + + /* Tessellation properties */ + GLU_TESS_WINDING_RULE = 100140, + GLU_TESS_BOUNDARY_ONLY = 100141, + GLU_TESS_TOLERANCE = 100142, + + /* Tessellation errors */ + GLU_TESS_ERROR1 = 100151, /* Missing gluBeginPolygon */ + GLU_TESS_ERROR2 = 100152, /* Missing gluBeginContour */ + GLU_TESS_ERROR3 = 100153, /* Missing gluEndPolygon */ + GLU_TESS_ERROR4 = 100154, /* Missing gluEndContour */ + GLU_TESS_ERROR5 = 100155, /* */ + GLU_TESS_ERROR6 = 100156, /* */ + GLU_TESS_ERROR7 = 100157, /* */ + GLU_TESS_ERROR8 = 100158, /* */ /* NURBS */ GLU_AUTO_LOAD_MATRIX = 100200, @@ -201,21 +217,39 @@ enum { /* New in GLU 1.1 */ GLU_VERSION = 100800, - GLU_EXTENSIONS = 100801 + GLU_EXTENSIONS = 100801, + + /*** GLU 1.0 tessellation - obsolete! ***/ + + /* Contour types */ + GLU_CW = 100120, + GLU_CCW = 100121, + GLU_INTERIOR = 100122, + GLU_EXTERIOR = 100123, + GLU_UNKNOWN = 100124, + + /* Tessellator */ + GLU_BEGIN = GLU_TESS_BEGIN, + GLU_VERTEX = GLU_TESS_VERTEX, + GLU_END = GLU_TESS_END, + GLU_ERROR = GLU_TESS_ERROR, + GLU_EDGE_FLAG = GLU_TESS_EDGE_FLAG }; /* - * These are the GLU 1.1 typedefs. GLU 1.2 has different ones! + * These are the GLU 1.1 typedefs. GLU 1.3 has different ones! */ #if defined(__BEOS__) - /* The BeOS does something funky and makes these typedefs in one - * of its system headers. - */ + /* The BeOS does something funky and makes these typedefs in one + * of its system headers. + */ #else - typedef struct GLUquadric GLUquadricObj; - typedef struct GLUtesselator GLUtriangulatorObj; - typedef struct GLUnurbs GLUnurbsObj; + typedef struct GLUquadric GLUquadricObj; + typedef struct GLUnurbs GLUnurbsObj; + + /* FIXME: We need to implement the other 1.3 typedefs - GH */ + typedef struct GLUtesselator GLUtesselator; #endif @@ -392,25 +426,49 @@ GLUAPI void GLAPIENTRY gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, /* * - * Polygon tesselation + * Polygon tessellation * */ -GLUAPI GLUtriangulatorObj* GLAPIENTRY gluNewTess( void ); +GLUAPI GLUtesselator* GLAPIENTRY gluNewTess( void ); + +GLUAPI void GLAPIENTRY gluDeleteTess( GLUtesselator *tobj ); + +GLUAPI void GLAPIENTRY gluTessBeginPolygon( GLUtesselator *tobj, + void *polygon_data ); + +GLUAPI void GLAPIENTRY gluTessBeginContour( GLUtesselator *tobj ); + +GLUAPI void GLAPIENTRY gluTessVertex( GLUtesselator *tobj, GLdouble coords[3], + void *vertex_data ); + +GLUAPI void GLAPIENTRY gluTessEndContour( GLUtesselator *tobj ); -GLUAPI void GLAPIENTRY gluTessCallback( GLUtriangulatorObj *tobj, GLenum which, - void (GLCALLBACK *fn)() ); +GLUAPI void GLAPIENTRY gluTessEndPolygon( GLUtesselator *tobj ); -GLUAPI void GLAPIENTRY gluDeleteTess( GLUtriangulatorObj *tobj ); +GLUAPI void GLAPIENTRY gluTessProperty( GLUtesselator *tobj, GLenum which, + GLdouble value ); -GLUAPI void GLAPIENTRY gluBeginPolygon( GLUtriangulatorObj *tobj ); +GLUAPI void GLAPIENTRY gluTessNormal( GLUtesselator *tobj, GLdouble x, + GLdouble y, GLdouble z ); + +GLUAPI void GLAPIENTRY gluTessCallback( GLUtesselator *tobj, GLenum which, + void (GLCALLBACK *fn)() ); + +GLUAPI void GLAPIENTRY gluGetTessProperty( GLUtesselator *tobj, GLenum which, + GLdouble *value ); + +/* + * + * Obsolete 1.0 tessellation functions + * + */ -GLUAPI void GLAPIENTRY gluEndPolygon( GLUtriangulatorObj *tobj ); +GLUAPI void GLAPIENTRY gluBeginPolygon( GLUtesselator *tobj ); -GLUAPI void GLAPIENTRY gluNextContour( GLUtriangulatorObj *tobj, GLenum type ); +GLUAPI void GLAPIENTRY gluNextContour( GLUtesselator *tobj, GLenum type ); -GLUAPI void GLAPIENTRY gluTessVertex( GLUtriangulatorObj *tobj, GLdouble v[3], - void *data ); +GLUAPI void GLAPIENTRY gluEndPolygon( GLUtesselator *tobj ); diff --git a/include/GL/glu_mangle.h b/include/GL/glu_mangle.h index ed3944c54b1..a52b19617cb 100644 --- a/include/GL/glu_mangle.h +++ b/include/GL/glu_mangle.h @@ -1,4 +1,4 @@ -/* $Id: glu_mangle.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ +/* $Id: glu_mangle.h,v 1.2 1999/09/10 02:08:19 gareth Exp $ */ /* * Mesa 3-D graphics library @@ -23,8 +23,11 @@ /* * $Log: glu_mangle.h,v $ - * Revision 1.1 1999/08/19 00:55:40 jtg - * Initial revision + * Revision 1.2 1999/09/10 02:08:19 gareth + * Added GLU 1.3 tessellation (except winding rule code). + * + * Revision 1.1.1.1 1999/08/19 00:55:40 jtg + * Imported sources * * Revision 3.1 1999/06/21 22:00:42 brianp * added #ifndef GLU_MANGLE_H stuff @@ -75,12 +78,19 @@ #define gluPwlCurve mgluPwlCurve #define gluNurbsCallback mgluNurbsCallback #define gluNewTess mgluNewTess -#define gluTessCallback mgluTessCallback #define gluDeleteTess mgluDeleteTess +#define gluTessBeginPolygon mgluTessBeginPolygon +#define gluTessBeginContour mgluTessBeginContour +#define gluTessVertex mgluTessVertex +#define gluTessEndPolygon mgluTessEndPolygon +#define gluTessEndContour mgluTessEndContour +#define gluTessProperty mgluTessProperty +#define gluTessNormal mgluTessNormal +#define gluTessCallback mgluTessCallback +#define gluGetTessProperty mgluGetTessProperty #define gluBeginPolygon mgluBeginPolygon -#define gluEndPolygon mgluEndPolygon #define gluNextContour mgluNextContour -#define gluTessVertex mgluTessVertex +#define gluEndPolygon mgluEndPolygon #define gluGetString mgluGetString #endif diff --git a/src/glu/mesa/Makefile.BeOS b/src/glu/mesa/Makefile.BeOS index d1e489c1999..016bb580ae3 100644 --- a/src/glu/mesa/Makefile.BeOS +++ b/src/glu/mesa/Makefile.BeOS @@ -29,7 +29,7 @@ INCDIR = ../include LIBDIR = ../lib SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \ - project.c quadric.c tess.c tesselat.c polytest.c + project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c OBJECTS = $(SOURCES:.c=.o) diff --git a/src/glu/mesa/Makefile.BeOS-R4 b/src/glu/mesa/Makefile.BeOS-R4 index d664534491d..4584c3201b8 100644 --- a/src/glu/mesa/Makefile.BeOS-R4 +++ b/src/glu/mesa/Makefile.BeOS-R4 @@ -19,11 +19,14 @@ # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# $Id: Makefile.BeOS-R4,v 1.1 1999/08/19 00:55:42 jtg Exp $ +# $Id: Makefile.BeOS-R4,v 1.2 1999/09/10 02:03:31 gareth Exp $ # $Log: Makefile.BeOS-R4,v $ -# Revision 1.1 1999/08/19 00:55:42 jtg -# Initial revision +# Revision 1.2 1999/09/10 02:03:31 gareth +# Added GLU 1.3 tessellation (except winding rule code). +# +# Revision 1.1.1.1 1999/08/19 00:55:42 jtg +# Imported sources # # Revision 1.2 1999/02/02 04:44:40 brianp # fixed some problems @@ -42,7 +45,7 @@ INCDIR = ../include LIBDIR = ../lib SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \ - project.c quadric.c tess.c tesselat.c polytest.c + project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c OBJECTS = $(SOURCES:.c=.o) diff --git a/src/glu/mesa/Makefile.X11 b/src/glu/mesa/Makefile.X11 index c155aea9a55..2b123810a57 100644 --- a/src/glu/mesa/Makefile.X11 +++ b/src/glu/mesa/Makefile.X11 @@ -1,4 +1,4 @@ -# $Id: Makefile.X11,v 1.1 1999/08/19 00:55:42 jtg Exp $ +# $Id: Makefile.X11,v 1.2 1999/09/10 02:03:31 gareth Exp $ # Mesa 3-D graphics library # Version: 3.1 @@ -15,7 +15,7 @@ INCDIR = ../include LIBDIR = ../lib SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \ - project.c quadric.c tess.c tesselat.c polytest.c + project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c OBJECTS = $(SOURCES:.c=.o) diff --git a/src/glu/mesa/MesaGLU.def b/src/glu/mesa/MesaGLU.def index 8b1c4449ff1..e61782b65a0 100644 --- a/src/glu/mesa/MesaGLU.def +++ b/src/glu/mesa/MesaGLU.def @@ -45,10 +45,17 @@ EXPORTS gluPwlCurve gluNurbsCallback gluNewTess - gluTessCallback gluDeleteTess + gluTessBeginPolygon + gluTessBeginContour + gluTessVertex + gluTessEndContour + gluTessEndPolygon + gluTessProperty + gluTessNormal + gluTessCallback + gluGetTessProperty gluBeginPolygon - gluEndPolygon gluNextContour - gluTessVertex + gluEndPolygon gluGetString diff --git a/src/glu/mesa/descrip.mms b/src/glu/mesa/descrip.mms index b660f6914de..bcce68ff94e 100644 --- a/src/glu/mesa/descrip.mms +++ b/src/glu/mesa/descrip.mms @@ -15,10 +15,11 @@ LIBDIR = [-.lib] CFLAGS = /include=$(INCDIR)/define=(FBIND=1) SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \ - project.c quadric.c tess.c tesselat.c polytest.c + project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c OBJECTS =glu.obj,mipmap.obj,nurbs.obj,nurbscrv.obj,nurbssrf.obj,nurbsutl.obj,\ - project.obj,quadric.obj,tess.obj,tesselat.obj,polytest.obj + project.obj,quadric.obj,tess.obj,tess_fist.obj,tess_hash.obj,\ + tess_heap.obj diff --git a/src/glu/mesa/glu.c b/src/glu/mesa/glu.c index 2cceb8b743e..5569ca9d49c 100644 --- a/src/glu/mesa/glu.c +++ b/src/glu/mesa/glu.c @@ -1,4 +1,4 @@ -/* $Id: glu.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ +/* $Id: glu.c,v 1.2 1999/09/10 02:03:31 gareth Exp $ */ /* * Mesa 3-D graphics library @@ -23,8 +23,11 @@ /* * $Log: glu.c,v $ - * Revision 1.1 1999/08/19 00:55:42 jtg - * Initial revision + * Revision 1.2 1999/09/10 02:03:31 gareth + * Added GLU 1.3 tessellation (except winding rule code). + * + * Revision 1.1.1.1 1999/08/19 00:55:42 jtg + * Imported sources * * Revision 1.13 1999/03/31 19:07:28 brianp * added GL_EXT_abgr to extensions @@ -220,8 +223,7 @@ const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode ) "misoriented or self-intersecting loops", "coincident vertices", "colinear vertices", - "intersecting edges", - "not coplanar contours" + "intersecting edges" }; static char *nurbs_error[] = { "spline order un-supported", @@ -301,7 +303,7 @@ const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode ) else if (errorCode==GLU_INCOMPATIBLE_GL_VERSION) { return (GLubyte *) "incompatible GL version"; } - else if (errorCode>=GLU_TESS_ERROR1 && errorCode<=GLU_TESS_ERROR9) { + else if (errorCode>=GLU_TESS_ERROR1 && errorCode<=GLU_TESS_ERROR8) { return (GLubyte *) tess_error[errorCode-GLU_TESS_ERROR1]; } else if (errorCode>=GLU_NURBS_ERROR1 && errorCode<=GLU_NURBS_ERROR37) { diff --git a/src/glu/mesa/mms_depend b/src/glu/mesa/mms_depend index 372e3fff1e9..37e9eb2b920 100644 --- a/src/glu/mesa/mms_depend +++ b/src/glu/mesa/mms_depend @@ -9,5 +9,6 @@ nurbsutl.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h nurbs.h project.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h quadric.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h -tesselat.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h -polytest.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h +tess_fist.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h +tess_hash.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h +tess_heap.obj : gluP.h [-.include.gl]gl.h [-.include.gl]glu.h tess.h diff --git a/src/glu/mesa/polytest.c b/src/glu/mesa/polytest.c deleted file mode 100644 index 9b42c63477e..00000000000 --- a/src/glu/mesa/polytest.c +++ /dev/null @@ -1,1049 +0,0 @@ -/* $Id: polytest.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ - -/* - * Mesa 3-D graphics library - * Version: 2.4 - * Copyright (C) 1995-1997 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * $Log: polytest.c,v $ - * Revision 1.1 1999/08/19 00:55:42 jtg - * Initial revision - * - * Revision 1.7 1999/06/08 00:44:51 brianp - * OpenStep updates (pete@ohm.york.ac.uk) - * - * Revision 1.6 1998/07/26 02:08:52 brianp - * updated for Windows compilation per Ted Jump - * - * Revision 1.5 1997/10/29 02:02:20 brianp - * various MS Windows compiler changes (David Bucciarelli, v20 3dfx driver) - * - * Revision 1.4 1997/07/24 01:28:44 brianp - * changed precompiled header symbol from PCH to PC_HEADER - * - * Revision 1.3 1997/05/28 02:29:38 brianp - * added support for precompiled headers (PCH), inserted APIENTRY keyword - * - * Revision 1.2 1997/05/08 01:53:21 brianp - * fixed memory leak in free_current_polygon() reported by Randy Frank - * - * Revision 1.1 1996/09/27 01:19:39 brianp - * Initial revision - * - */ - - -/* - * This file is part of the polygon tesselation code contributed by - * Bogdan Sikorski - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include "gluP.h" -#include "tess.h" -#endif - - - -static GLenum store_polygon_as_contour(GLUtriangulatorObj *); -static void free_current_polygon(tess_polygon *); -static void prepare_projection_info(GLUtriangulatorObj *); -static GLdouble twice_the_polygon_area(tess_vertex *,tess_vertex *); -static GLenum verify_edge_vertex_intersections(GLUtriangulatorObj *); -void tess_find_contour_hierarchies(GLUtriangulatorObj *); -static GLenum test_for_overlapping_contours(GLUtriangulatorObj *); -static GLenum contours_overlap(tess_contour *, tess_polygon *); -static GLenum is_contour_contained_in(tess_contour *,tess_contour *); -static void add_new_exterior(GLUtriangulatorObj *,tess_contour *); -static void add_new_interior(GLUtriangulatorObj *,tess_contour *, - tess_contour *); -static void add_interior_with_hierarchy_check(GLUtriangulatorObj *, - tess_contour *,tess_contour *); -static void reverse_hierarchy_and_add_exterior(GLUtriangulatorObj *, - tess_contour *,tess_contour *); -static GLboolean point_in_polygon(tess_contour *,GLdouble,GLdouble); -static void shift_interior_to_exterior(GLUtriangulatorObj *,tess_contour *); -static void add_exterior_with_check(GLUtriangulatorObj *,tess_contour *, - tess_contour *); -static GLenum cut_out_hole(GLUtriangulatorObj *,tess_contour *, - tess_contour *); -static GLenum merge_hole_with_contour(GLUtriangulatorObj *, - tess_contour *,tess_contour *,tess_vertex *, - tess_vertex *); - -static GLenum -find_normal(GLUtriangulatorObj *tobj) -{ - tess_polygon *polygon=tobj->current_polygon; - tess_vertex *va,*vb,*vc; - GLdouble A,B,C; - GLdouble A0,A1,A2,B0,B1,B2; - - va=polygon->vertices; - vb=va->next; - A0=vb->location[0]-va->location[0]; - A1=vb->location[1]-va->location[1]; - A2=vb->location[2]-va->location[2]; - for(vc=vb->next;vc!=va;vc=vc->next) - { - B0=vc->location[0]-va->location[0]; - B1=vc->location[1]-va->location[1]; - B2=vc->location[2]-va->location[2]; - A=A1*B2-A2*B1; - B=A2*B0-A0*B2; - C=A0*B1-A1*B0; - if(fabs(A)>EPSILON || fabs(B)>EPSILON || fabs(C)>EPSILON) - { - polygon->A=A; - polygon->B=B; - polygon->C=C; - polygon->D= -A*va->location[0]-B*va->location[1]-C*va->location[2]; - return GLU_NO_ERROR; - } - } - tess_call_user_error(tobj,GLU_TESS_ERROR7); - return GLU_ERROR; -} - -void -tess_test_polygon( GLUtriangulatorObj *tobj ) -{ - tess_polygon *polygon=tobj->current_polygon; - - /* any vertices defined? */ - if(polygon->vertex_cnt<3) - { - free_current_polygon(polygon); - return; - } - /* wrap pointers */ - polygon->last_vertex->next=polygon->vertices; - polygon->vertices->previous=polygon->last_vertex; - /* determine the normal */ - if(find_normal(tobj)==GLU_ERROR) - return; - /* compare the normals of previously defined contours and this one */ - /* first contour define ? */ - if(tobj->contours==NULL) - { - tobj->A=polygon->A; - tobj->B=polygon->B; - tobj->C=polygon->C; - tobj->D=polygon->D; - /* determine the best projection to use */ - if(fabs(polygon->A) > fabs(polygon->B)) - if(fabs(polygon->A) > fabs(polygon->C)) - tobj->projection=OYZ; - else - tobj->projection=OXY; - else - if(fabs(polygon->B) > fabs(polygon->C)) - tobj->projection=OXZ; - else - tobj->projection=OXY; - } - else - { - GLdouble a[3],b[3]; - tess_vertex *vertex=polygon->vertices; - - a[0]=tobj->A; - a[1]=tobj->B; - a[2]=tobj->C; - b[0]=polygon->A; - b[1]=polygon->B; - b[2]=polygon->C; - - /* compare the normals */ - if( fabs(a[1]*b[2]-a[2]*b[1]) > EPSILON || - fabs(a[2]*b[0]-a[0]*b[2]) > EPSILON || - fabs(a[0]*b[1]-a[1]*b[0]) > EPSILON) - { - /* not coplanar */ - tess_call_user_error(tobj,GLU_TESS_ERROR9); - return; - } - /* the normals are parallel - test for plane equation */ - if(fabs(a[0]*vertex->location[0]+a[1]*vertex->location[1]+ - a[2]*vertex->location[2]+tobj->D) > EPSILON) - { - /* not the same plane */ - tess_call_user_error(tobj,GLU_TESS_ERROR9); - return; - } - } - prepare_projection_info(tobj); - if(verify_edge_vertex_intersections(tobj)==GLU_ERROR) - return; - if(test_for_overlapping_contours(tobj)==GLU_ERROR) - return; - if(store_polygon_as_contour(tobj)==GLU_ERROR) - return; -} - -static GLenum test_for_overlapping_contours(GLUtriangulatorObj *tobj) -{ - tess_contour *contour; - tess_polygon *polygon; - - polygon=tobj->current_polygon; - for(contour=tobj->contours;contour!=NULL;contour=contour->next) - if(contours_overlap(contour,polygon)!=GLU_NO_ERROR) - { - tess_call_user_error(tobj,GLU_TESS_ERROR5); - return GLU_ERROR; - } - return GLU_NO_ERROR; -} - -static GLenum store_polygon_as_contour(GLUtriangulatorObj *tobj) -{ - tess_polygon *polygon=tobj->current_polygon; - tess_contour *contour=tobj->contours; - - /* the first contour defined */ - if(contour==NULL) - { - if((contour=(tess_contour *)malloc( - sizeof(tess_contour)))==NULL) - { - tess_call_user_error(tobj,GLU_OUT_OF_MEMORY); - free_current_polygon(polygon); - return GLU_ERROR; - } - tobj->contours=tobj->last_contour=contour; - contour->next=contour->previous=NULL; - } - else - { - if((contour=(tess_contour *)malloc( - sizeof(tess_contour)))==NULL) - { - tess_call_user_error(tobj,GLU_OUT_OF_MEMORY); - free_current_polygon(polygon); - return GLU_ERROR; - } - contour->previous=tobj->last_contour; - tobj->last_contour->next=contour; - tobj->last_contour=contour; - contour->next=NULL; - } - /* mark all vertices in new contour as not special */ - /* and all are boundary edges */ - { - tess_vertex *vertex; - GLuint vertex_cnt,i; - - for(vertex=polygon->vertices , i=0 , vertex_cnt=polygon->vertex_cnt; - inext , i++) - { - vertex->shadow_vertex=NULL; - vertex->edge_flag=GL_TRUE; - } - } - contour->vertex_cnt=polygon->vertex_cnt; - contour->area=polygon->area; - contour->orientation=polygon->orientation; - contour->type=GLU_UNKNOWN; - contour->vertices=polygon->vertices; - contour->last_vertex=polygon->last_vertex; - polygon->vertices=polygon->last_vertex=NULL; - polygon->vertex_cnt=0; - ++(tobj->contour_cnt); - return GLU_NO_ERROR; -} - -static void free_current_polygon(tess_polygon *polygon) -{ - tess_vertex *vertex,*vertex_tmp; - GLuint i; - - /* free current_polygon structures */ - for(vertex=polygon->vertices,i=0;ivertex_cnt;i++) - { - vertex_tmp=vertex->next; - free(vertex); - vertex=vertex_tmp; - } - polygon->vertices=polygon->last_vertex=NULL; - polygon->vertex_cnt=0; -} - -static void prepare_projection_info(GLUtriangulatorObj *tobj) -{ - tess_polygon *polygon=tobj->current_polygon; - tess_vertex *vertex,*last_vertex_ptr; - GLdouble area; - - last_vertex_ptr=polygon->last_vertex; - switch(tobj->projection) - { - case OXY: - for(vertex=polygon->vertices;vertex!=last_vertex_ptr; - vertex=vertex->next) - { - vertex->x=vertex->location[0]; - vertex->y=vertex->location[1]; - } - last_vertex_ptr->x=last_vertex_ptr->location[0]; - last_vertex_ptr->y=last_vertex_ptr->location[1]; - break; - case OXZ: - for(vertex=polygon->vertices;vertex!=last_vertex_ptr; - vertex=vertex->next) - { - vertex->x=vertex->location[0]; - vertex->y=vertex->location[2]; - } - last_vertex_ptr->x=last_vertex_ptr->location[0]; - last_vertex_ptr->y=last_vertex_ptr->location[2]; - break; - case OYZ: - for(vertex=polygon->vertices;vertex!=last_vertex_ptr; - vertex=vertex->next) - { - vertex->x=vertex->location[1]; - vertex->y=vertex->location[2]; - } - last_vertex_ptr->x=last_vertex_ptr->location[1]; - last_vertex_ptr->y=last_vertex_ptr->location[2]; - break; - } - area=twice_the_polygon_area(polygon->vertices,polygon->last_vertex); - if(area >= 0.0) - { - polygon->orientation=GLU_CCW; - polygon->area=area; - } - else - { - polygon->orientation=GLU_CW; - polygon->area= -area; - } -} - -static GLdouble twice_the_polygon_area(tess_vertex *vertex, - tess_vertex *last_vertex) -{ - tess_vertex *next; - GLdouble area,x,y; - - area=0.0; - x=vertex->x; - y=vertex->y; - vertex=vertex->next; - for(; vertex!=last_vertex; vertex=vertex->next) - { - next=vertex->next; - area+=(vertex->x - x)*(next->y - y) - (vertex->y - y)*(next->x - x); - } - return area; -} - -/* test if edges ab and cd intersect */ -/* if not return GLU_NO_ERROR, else if cross return GLU_TESS_ERROR8, */ -/* else if adjacent return GLU_TESS_ERROR4 */ -static GLenum edge_edge_intersect( - tess_vertex *a, - tess_vertex *b, - tess_vertex *c, - tess_vertex *d) -{ - GLdouble denom,r,s; - GLdouble xba,ydc,yba,xdc,yac,xac; - - xba=b->x - a->x; - yba=b->y - a->y; - xdc=d->x - c->x; - ydc=d->y - c->y; - xac=a->x - c->x; - yac=a->y - c->y; - denom= xba*ydc - yba*xdc; - r = yac*xdc - xac*ydc; - /* parallel? */ - if(fabs(denom) < EPSILON) - { - if(fabs(r) < EPSILON) - { - /* colinear */ - if(fabs(xba) < EPSILON) - { - /* compare the Y coordinate */ - if(yba > 0.0) - { - if((fabs(a->y - c->y)y - b->y)y - d->y)y - b->y)y - c->y)y - a->y)y - d->y)y - a->y) 0.0) - { - if((fabs(a->x - c->x)x - b->x)x - d->x)x - b->x)x - c->x)x - a->x)x - d->x)x - a->x) 1.0-EPSILON)) && - s > -EPSILON && s < 1.0+EPSILON) || - ((fabs(s) < EPSILON || (s < 1.0+EPSILON && s > 1.0-EPSILON)) && - r > -EPSILON && r < 1.0+EPSILON)) - { - return GLU_TESS_ERROR4; - } - /* test for crossing */ - if(r > -EPSILON && r < 1.0+EPSILON && - s > -EPSILON && s < 1.0+EPSILON) - { - return GLU_TESS_ERROR8; - } - return GLU_NO_ERROR; -} - -static GLenum verify_edge_vertex_intersections(GLUtriangulatorObj *tobj) -{ - tess_polygon *polygon=tobj->current_polygon; - tess_vertex *vertex1,*last_vertex,*vertex2; - GLenum test; - - last_vertex=polygon->last_vertex; - vertex1=last_vertex; - for(vertex2=vertex1->next->next; - vertex2->next!=last_vertex; - vertex2=vertex2->next) - { - test=edge_edge_intersect(vertex1,vertex1->next,vertex2, - vertex2->next); - if(test!=GLU_NO_ERROR) - { - tess_call_user_error(tobj,test); - return GLU_ERROR; - } - } - for(vertex1=polygon->vertices; - vertex1->next->next!=last_vertex; - vertex1=vertex1->next) - { - for(vertex2=vertex1->next->next; - vertex2!=last_vertex; - vertex2=vertex2->next) - { - test=edge_edge_intersect(vertex1,vertex1->next,vertex2, - vertex2->next); - if(test!=GLU_NO_ERROR) - { - tess_call_user_error(tobj,test); - return GLU_ERROR; - } - } - } - return GLU_NO_ERROR; -} - -static int -#if defined(WIN32) && !defined(OPENSTEP) -__cdecl -#endif -area_compare(const void *a,const void *b) -{ - GLdouble area1,area2; - - area1=(*((tess_contour **)a))->area; - area2=(*((tess_contour **)b))->area; - if(area1 < area2) - return 1; - if(area1 > area2) - return -1; - return 0; -} - -void tess_find_contour_hierarchies(GLUtriangulatorObj *tobj) -{ - tess_contour **contours; /* dinamic array of pointers */ - tess_contour *tmp_contour_ptr=tobj->contours; - GLuint cnt,i; - GLenum result; - GLboolean hierarchy_changed; - - /* any contours? */ - if(tobj->contour_cnt < 2) - { - tobj->contours->type=GLU_EXTERIOR; - return; - } - if((contours=(tess_contour **) - malloc(sizeof(tess_contour *)*(tobj->contour_cnt)))==NULL) - { - tess_call_user_error(tobj,GLU_OUT_OF_MEMORY); - return; - } - for(tmp_contour_ptr=tobj->contours , cnt=0; - tmp_contour_ptr!=NULL; - tmp_contour_ptr=tmp_contour_ptr->next) - contours[cnt++]=tmp_contour_ptr; - /* now sort the contours in decreasing area size order */ - qsort((void *)contours,(size_t)cnt,(size_t)sizeof(tess_contour *),area_compare); - /* we leave just the first contour - remove others from list */ - tobj->contours=contours[0]; - tobj->contours->next=tobj->contours->previous=NULL; - tobj->last_contour=tobj->contours; - tobj->contour_cnt=1; - /* first contour is the one with greatest area */ - /* must be EXTERIOR */ - tobj->contours->type=GLU_EXTERIOR; - tmp_contour_ptr=tobj->contours; - /* now we play! */ - for(i=1;icontours; - tmp_contour_ptr!=NULL; - tmp_contour_ptr=tmp_contour_ptr->next) - { - if(tmp_contour_ptr->type==GLU_EXTERIOR) - { - /* check if contour completely contained in EXTERIOR */ - result=is_contour_contained_in(tmp_contour_ptr,contours[i]); - switch(result) - { - case GLU_INTERIOR: - /* now we have to check if contour is inside interiors */ - /* or not */ - /* any interiors? */ - if(tmp_contour_ptr->next!=NULL && - tmp_contour_ptr->next->type==GLU_INTERIOR) - { - /* for all interior, check if inside any of them */ - /* if not inside any of interiors, its another */ - /* interior */ - /* or it may contain some interiors, then change */ - /* the contained interiors to exterior ones */ - add_interior_with_hierarchy_check(tobj, - tmp_contour_ptr,contours[i]); - } - else - { - /* not in interior, add as new interior contour */ - add_new_interior(tobj,tmp_contour_ptr,contours[i]); - } - hierarchy_changed=GL_TRUE; - break; - case GLU_EXTERIOR: - /* ooops, the marked as EXTERIOR (contours[i]) is */ - /* actually an interior of tmp_contour_ptr */ - /* reverse the local hierarchy */ - reverse_hierarchy_and_add_exterior(tobj,tmp_contour_ptr, - contours[i]); - hierarchy_changed=GL_TRUE; - break; - case GLU_NO_ERROR: - break; - default: - abort(); - } - } - if(hierarchy_changed) - break; /* break from for loop */ - } - if(hierarchy_changed==GL_FALSE) - { - /* disjoint with all contours, add to contour list */ - add_new_exterior(tobj,contours[i]); - } - } - free(contours); -} - -/* returns GLU_INTERIOR if inner is completey enclosed within outer */ -/* returns GLU_EXTERIOR if outer is completely enclosed within inner */ -/* returns GLU_NO_ERROR if contours are disjoint */ -static GLenum is_contour_contained_in( - tess_contour *outer, - tess_contour *inner) -{ - GLenum relation_flag; - - /* set relation_flag to relation of containment of first inner vertex */ - /* regarding outer contour */ - if(point_in_polygon(outer,inner->vertices->x,inner->vertices->y)) - relation_flag=GLU_INTERIOR; - else - relation_flag=GLU_EXTERIOR; - if(relation_flag==GLU_INTERIOR) - return GLU_INTERIOR; - if(point_in_polygon(inner,outer->vertices->x,outer->vertices->y)) - return GLU_EXTERIOR; - return GLU_NO_ERROR; -} - -static GLboolean point_in_polygon( - tess_contour *contour, - GLdouble x, - GLdouble y) -{ - tess_vertex *v1,*v2; - GLuint i,vertex_cnt; - GLdouble xp1,yp1,xp2,yp2; - GLboolean tst; - - tst=GL_FALSE; - v1=contour->vertices; - v2=contour->vertices->previous; - for(i=0 , vertex_cnt=contour->vertex_cnt; - i < vertex_cnt; - i++) - { - xp1=v1->x; - yp1=v1->y; - xp2=v2->x; - yp2=v2->y; - if ((((yp1<=y) && (ynext; - } - return tst; -} - -static GLenum contours_overlap( - tess_contour *contour, - tess_polygon *polygon) -{ - tess_vertex *vertex1,*vertex2; - GLuint vertex1_cnt,vertex2_cnt,i,j; - GLenum test; - - vertex1=contour->vertices; - vertex2=polygon->vertices; - vertex1_cnt=contour->vertex_cnt; - vertex2_cnt=polygon->vertex_cnt; - for(i=0; inext , i++) - { - for(j=0; jnext , j++) - if((test=edge_edge_intersect(vertex1,vertex1->next,vertex2, - vertex2->next))!=GLU_NO_ERROR) - return test; - } - return GLU_NO_ERROR; -} - -static void add_new_exterior( - GLUtriangulatorObj *tobj, - tess_contour *contour) -{ - contour->type=GLU_EXTERIOR; - contour->next=NULL; - contour->previous=tobj->last_contour; - tobj->last_contour->next=contour; - tobj->last_contour=contour; -} - -static void add_new_interior( - GLUtriangulatorObj *tobj, - tess_contour *outer, - tess_contour *contour) -{ - contour->type=GLU_INTERIOR; - contour->next=outer->next; - contour->previous=outer; - if(outer->next!=NULL) - outer->next->previous=contour; - outer->next=contour; - if(tobj->last_contour==outer) - tobj->last_contour=contour; -} - -static void add_interior_with_hierarchy_check( - GLUtriangulatorObj *tobj, - tess_contour *outer, - tess_contour *contour) -{ - tess_contour *ptr; - - /* for all interiors of outer check if they are interior of contour */ - /* if so, change that interior to exterior and move it of of the */ - /* interior sequence */ - if(outer->next!=NULL && outer->next->type==GLU_INTERIOR) - { - GLenum test; - - for(ptr=outer->next;ptr!=NULL && ptr->type==GLU_INTERIOR;ptr=ptr->next) - { - test=is_contour_contained_in(ptr,contour); - switch(test) - { - case GLU_INTERIOR: - /* contour is contained in one of the interiors */ - /* check if possibly contained in other exteriors */ - /* move ptr to first EXTERIOR */ - for(;ptr!=NULL && ptr->type==GLU_INTERIOR;ptr=ptr->next); - if(ptr==NULL) - /* another exterior */ - add_new_exterior(tobj,contour); - else - add_exterior_with_check(tobj,ptr,contour); - return; - case GLU_EXTERIOR: - /* one of the interiors is contained in the contour */ - /* change it to EXTERIOR, and shift it away from the */ - /* interior sequence */ - shift_interior_to_exterior(tobj,ptr); - break; - case GLU_NO_ERROR: - /* disjoint */ - break; - default: - abort(); - } - } - } - /* add contour to the interior sequence */ - add_new_interior(tobj,outer,contour); -} - -static void reverse_hierarchy_and_add_exterior( - GLUtriangulatorObj *tobj, - tess_contour *outer, - tess_contour *contour) -{ - tess_contour *ptr; - - /* reverse INTERIORS to EXTERIORS */ - /* any INTERIORS? */ - if(outer->next!=NULL && outer->next->type==GLU_INTERIOR) - for(ptr=outer->next;ptr!=NULL && ptr->type==GLU_INTERIOR;ptr=ptr->next) - ptr->type=GLU_EXTERIOR; - /* the outer now becomes inner */ - outer->type=GLU_INTERIOR; - /* contour is the EXTERIOR */ - contour->next=outer; - if(tobj->contours==outer) - { - /* first contour beeing reversed */ - contour->previous=NULL; - tobj->contours=contour; - } - else - { - outer->previous->next=contour; - contour->previous=outer->previous; - } - outer->previous=contour; -} - -static void shift_interior_to_exterior( - GLUtriangulatorObj *tobj, - tess_contour *contour) -{ - contour->previous->next=contour->next; - if(contour->next!=NULL) - contour->next->previous=contour->previous; - else - tobj->last_contour=contour->previous; -} - -static void add_exterior_with_check( - GLUtriangulatorObj *tobj, - tess_contour *outer, - tess_contour *contour) -{ - GLenum test; - - /* this contour might be interior to further exteriors - check */ - /* if not, just add as a new exterior */ - for(;outer!=NULL && outer->type==GLU_EXTERIOR;outer=outer->next) - { - test=is_contour_contained_in(outer,contour); - switch(test) - { - case GLU_INTERIOR: - /* now we have to check if contour is inside interiors */ - /* or not */ - /* any interiors? */ - if(outer->next!=NULL && outer->next->type==GLU_INTERIOR) - { - /* for all interior, check if inside any of them */ - /* if not inside any of interiors, its another */ - /* interior */ - /* or it may contain some interiors, then change */ - /* the contained interiors to exterior ones */ - add_interior_with_hierarchy_check(tobj, - outer,contour); - } - else - { - /* not in interior, add as new interior contour */ - add_new_interior(tobj,outer,contour); - } - return; - case GLU_NO_ERROR: - /* disjoint */ - break; - default: - abort(); - } - } - /* add contour to the exterior sequence */ - add_new_exterior(tobj,contour); -} - -void tess_handle_holes(GLUtriangulatorObj *tobj) -{ - tess_contour *contour,*hole; - GLenum exterior_orientation; - - /* verify hole orientation */ - for(contour=tobj->contours;contour!=NULL;) - { - exterior_orientation=contour->orientation; - for(contour=contour->next; - contour!=NULL && contour->type==GLU_INTERIOR; - contour=contour->next) - { - if(contour->orientation==exterior_orientation) - { - tess_call_user_error(tobj,GLU_TESS_ERROR5); - return; - } - } - } - /* now cut-out holes */ - for(contour=tobj->contours;contour!=NULL;) - { - hole=contour->next; - while(hole!=NULL && hole->type==GLU_INTERIOR) - { - if(cut_out_hole(tobj,contour,hole)==GLU_ERROR) - return; - hole=contour->next; - } - contour=contour->next; - } -} - -static GLenum cut_out_hole( - GLUtriangulatorObj *tobj, - tess_contour *contour, - tess_contour *hole) -{ - tess_contour *tmp_hole; - tess_vertex *v1,*v2,*tmp_vertex; - GLuint vertex1_cnt,vertex2_cnt,tmp_vertex_cnt; - GLuint i,j,k; - GLenum test; - - /* find an edge connecting contour and hole not intersecting any other */ - /* edge belonging to either the contour or any of the other holes */ - for(v1=contour->vertices , vertex1_cnt=contour->vertex_cnt , i=0; - inext) - { - for(v2=hole->vertices , vertex2_cnt=hole->vertex_cnt , j=0; - jnext) - { - /* does edge (v1,v2) intersect any edge of contour */ - for(tmp_vertex=contour->vertices , tmp_vertex_cnt=contour->vertex_cnt , - k=0; - knext , k++) - { - /* skip edge tests for edges directly connected */ - if(v1==tmp_vertex || v1==tmp_vertex->next) - continue; - test=edge_edge_intersect(v1,v2,tmp_vertex,tmp_vertex->next); - if(test!=GLU_NO_ERROR) - break; - } - if(test==GLU_NO_ERROR) - { - /* does edge (v1,v2) intersect any edge of hole */ - for(tmp_vertex=hole->vertices , - tmp_vertex_cnt=hole->vertex_cnt , k=0; - knext , k++) - { - /* skip edge tests for edges directly connected */ - if(v2==tmp_vertex || v2==tmp_vertex->next) - continue; - test=edge_edge_intersect(v1,v2,tmp_vertex,tmp_vertex->next); - if(test!=GLU_NO_ERROR) - break; - } - if(test==GLU_NO_ERROR) - { - /* does edge (v1,v2) intersect any other hole? */ - for(tmp_hole=hole->next; - tmp_hole!=NULL && tmp_hole->type==GLU_INTERIOR; - tmp_hole=tmp_hole->next) - { - /* does edge (v1,v2) intersect any edge of hole */ - for(tmp_vertex=tmp_hole->vertices , - tmp_vertex_cnt=tmp_hole->vertex_cnt , k=0; - knext , k++) - { - test=edge_edge_intersect(v1,v2,tmp_vertex, - tmp_vertex->next); - if(test!=GLU_NO_ERROR) - break; - } - if(test!=GLU_NO_ERROR) - break; - } - } - } - if(test==GLU_NO_ERROR) - { - /* edge (v1,v2) is good for eliminating the hole */ - if(merge_hole_with_contour(tobj,contour,hole,v1,v2) - ==GLU_NO_ERROR) - return GLU_NO_ERROR; - else - return GLU_ERROR; - } - } - } - /* other holes are blocking all possible connections of hole */ - /* with contour, we shift this hole as the last hole and retry */ - for(tmp_hole=hole; - tmp_hole!=NULL && tmp_hole->type==GLU_INTERIOR; - tmp_hole=tmp_hole->next); - contour->next=hole->next; - hole->next->previous=contour; - if(tmp_hole==NULL) - { - /* last EXTERIOR contour, shift hole as last contour */ - hole->next=NULL; - hole->previous=tobj->last_contour; - tobj->last_contour->next=hole; - tobj->last_contour=hole; - } - else - { - tmp_hole->previous->next=hole; - hole->previous=tmp_hole->previous; - tmp_hole->previous=hole; - hole->next=tmp_hole; - } - hole=contour->next; - /* try once again - recurse */ - return cut_out_hole(tobj,contour,hole); -} - -static GLenum merge_hole_with_contour( - GLUtriangulatorObj *tobj, - tess_contour *contour, - tess_contour *hole, - tess_vertex *v1, - tess_vertex *v2) -{ - tess_vertex *v1_new,*v2_new; - - /* make copies of v1 and v2, place them respectively after their originals */ - if((v1_new=(tess_vertex *)malloc(sizeof(tess_vertex)))==NULL) - { - tess_call_user_error(tobj,GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - if((v2_new=(tess_vertex *)malloc(sizeof(tess_vertex)))==NULL) - { - tess_call_user_error(tobj,GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - v1_new->edge_flag=GL_TRUE; - v1_new->data=v1->data; - v1_new->location[0]=v1->location[0]; - v1_new->location[1]=v1->location[1]; - v1_new->location[2]=v1->location[2]; - v1_new->x=v1->x; - v1_new->y=v1->y; - v1_new->shadow_vertex=v1; - v1->shadow_vertex=v1_new; - v1_new->next=v1->next; - v1_new->previous=v1; - v1->next->previous=v1_new; - v1->next=v1_new; - v2_new->edge_flag=GL_TRUE; - v2_new->data=v2->data; - v2_new->location[0]=v2->location[0]; - v2_new->location[1]=v2->location[1]; - v2_new->location[2]=v2->location[2]; - v2_new->x=v2->x; - v2_new->y=v2->y; - v2_new->shadow_vertex=v2; - v2->shadow_vertex=v2_new; - v2_new->next=v2->next; - v2_new->previous=v2; - v2->next->previous=v2_new; - v2->next=v2_new; - /* link together the two lists */ - v1->next=v2_new; - v2_new->previous=v1; - v2->next=v1_new; - v1_new->previous=v2; - /* update the vertex count of the contour */ - contour->vertex_cnt += hole->vertex_cnt+2; - /* remove the INTERIOR contour */ - contour->next=hole->next; - if(hole->next!=NULL) - hole->next->previous=contour; - free(hole); - /* update tobj structure */ - --(tobj->contour_cnt); - if(contour->last_vertex==v1) - contour->last_vertex=v1_new; - /* mark two vertices with edge_flag */ - v2->edge_flag=GL_FALSE; - v1->edge_flag=GL_FALSE; - return GLU_NO_ERROR; -} diff --git a/src/glu/mesa/tess.c b/src/glu/mesa/tess.c index c773fbaae4b..c2e0e1cd988 100644 --- a/src/glu/mesa/tess.c +++ b/src/glu/mesa/tess.c @@ -1,369 +1,971 @@ -/* $Id: tess.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ +/* $Id: tess.c,v 1.2 1999/09/10 02:03:31 gareth Exp $ */ /* * Mesa 3-D graphics library * Version: 3.1 - * Copyright (C) 1995-1999 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * 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: tess.c,v $ - * Revision 1.1 1999/08/19 00:55:42 jtg - * Initial revision - * - * Revision 1.11 1999/02/27 13:55:31 brianp - * fixed BeOS-related GLU typedef problems - * - * Revision 1.10 1999/01/03 03:23:15 brianp - * now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump) +/***************************************************************************** * - * Revision 1.9 1998/06/01 01:10:29 brianp - * small update for Next/OpenStep from Alexander Mai + * GLU 1.3 Polygon Tessellation by Gareth Hughes * - * Revision 1.8 1998/02/04 00:27:58 brianp - * cygnus changes from Stephane Rehel - * - * Revision 1.7 1998/01/16 03:35:26 brianp - * fixed Windows compilation warnings (Theodore Jump) - * - * Revision 1.6 1997/09/17 01:51:48 brianp - * changed glu*Callback() functions to match prototype in glu.h - * - * Revision 1.5 1997/07/24 01:28:44 brianp - * changed precompiled header symbol from PCH to PC_HEADER - * - * Revision 1.4 1997/05/28 02:29:38 brianp - * added support for precompiled headers (PCH), inserted APIENTRY keyword - * - * Revision 1.3 1996/11/12 01:23:02 brianp - * added test to prevent free(vertex) when vertex==NULL in delete_contours() - * - * Revision 1.2 1996/10/22 22:57:19 brianp - * better error handling in gluBegin/EndPolygon() from Erich Eder + *****************************************************************************/ + +#include +#include +#include +#include + +#include "tess.h" +#include "tess_macros.h" +#include "tess_fist.h" +#if 0 +#include "tess_grid.h" +#endif + +/***************************************************************************** + * Internal function prototypes: + *****************************************************************************/ + +static void init_callbacks( tess_callbacks_t *callbacks ); + +static void tess_cleanup( GLUtesselator *tobj ); +static void inspect_current_contour( GLUtesselator *tobj ); + +static void delete_current_contour( GLUtesselator *tobj ); +static void delete_all_contours( GLUtesselator *tobj ); + +#define TESS_CHECK_ERRORS(t) if ( (t)->error != GLU_NO_ERROR ) goto cleanup + +int tess_debug_level = 0; +GLdouble origin[3] = { 0.0, 0.0, 0.0 }; + + +/***************************************************************************** * - * Revision 1.1 1996/09/27 01:19:39 brianp - * Initial revision + * GLU TESSELLATION FUNCTIONS * - */ + *****************************************************************************/ -/* - * This file is part of the polygon tesselation code contributed by - * Bogdan Sikorski - */ +/***************************************************************************** + * gluNewTess + *****************************************************************************/ +GLUtesselator* GLAPIENTRY gluNewTess( void ) +{ + GLUtesselator *tobj; + if ( ( tobj = (GLUtesselator *) + malloc( sizeof(GLUtesselator) ) ) == NULL ) + { + return NULL; + } -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include "tess.h" -#endif + init_callbacks( &tobj->callbacks ); + tobj->boundary_only = GL_FALSE; + tobj->winding_rule = GLU_TESS_WINDING_ODD; + tobj->tolerance = 0.0; -/* - * This is ugly, but seems the easiest way to do things to make the - * code work under YellowBox for Windows - */ -#if defined(OPENSTEP) && defined(GLCALLBACK) -#undef GLCALLBACK -#define GLCALLBACK -#endif + tobj->plane.normal[X] = 0.0; + tobj->plane.normal[Y] = 0.0; + tobj->plane.normal[Z] = 0.0; + tobj->plane.dist = 0.0; + tobj->contour_count = 0; + tobj->contours = tobj->last_contour = NULL; + tobj->current_contour = NULL; -extern void tess_test_polygon(GLUtriangulatorObj *); -extern void tess_find_contour_hierarchies(GLUtriangulatorObj *); -extern void tess_handle_holes(GLUtriangulatorObj *); -extern void tess_tesselate(GLUtriangulatorObj *); -extern void tess_tesselate_with_edge_flag(GLUtriangulatorObj *); -static void delete_contours(GLUtriangulatorObj *); + CLEAR_BBOX_2DV( tobj->mins, tobj->maxs ); -#ifdef __CYGWIN32__ -#define _CALLBACK -#else -#define _CALLBACK GLCALLBACK + tobj->vertex_count = 0; + tobj->sorted_vertices = NULL; +#if 0 + tobj->grid = NULL; #endif -void init_callbacks(tess_callbacks *callbacks) + tobj->error = GLU_NO_ERROR; + + return tobj; +} + + +/***************************************************************************** + * gluDeleteTess + *****************************************************************************/ +void GLAPIENTRY gluDeleteTess( GLUtesselator *tobj ) { - callbacks->begin = ( void (_CALLBACK*)(GLenum) ) 0; - callbacks->edgeFlag = ( void (_CALLBACK*)(GLboolean) ) 0; - callbacks->vertex = ( void (_CALLBACK*)(void*) ) 0; - callbacks->end = ( void (_CALLBACK*)(void) ) 0; - callbacks->error = ( void (_CALLBACK*)(GLenum) ) 0; + DEBUGP(2, ("-> gluDeleteTess(tobj: %p)\n", tobj)); + + if ( tobj->error == GLU_NO_ERROR && ( tobj->contour_count > 0 ) ) + { + /* Was gluEndContour called? */ + tess_error_callback( tobj, GLU_TESS_ERROR4, NULL ); + } + + /* Delete all internal structures */ + tess_cleanup( tobj ); + free( tobj ); + + DEBUGP(2, ("<- gluDeleteTess()\n\n")); } -void tess_call_user_error(GLUtriangulatorObj *tobj, GLenum gluerr) + +/***************************************************************************** + * gluTessBeginPolygon + *****************************************************************************/ +void GLAPIENTRY gluTessBeginPolygon( GLUtesselator *tobj, void *polygon_data ) { - if(tobj->error==GLU_NO_ERROR) - tobj->error=gluerr; - if(tobj->callbacks.error!=NULL) - (tobj->callbacks.error)(gluerr); + DEBUGP(2, ("-> gluTessBeginPolygon(tobj: %p, data: %p)\n", + tobj, polygon_data)); + + tobj->error = GLU_NO_ERROR; + + if ( tobj->current_contour != NULL ) + { + /* gluEndPolygon was not called */ + tess_error_callback( tobj, GLU_TESS_ERROR1, NULL ); + + tess_cleanup( tobj ); + } + + DEBUGP(2, ("<- gluTessBeginPolygon(tobj: %p)\n\n", tobj)); } -GLUtriangulatorObj* GLAPIENTRY gluNewTess( void ) + +/***************************************************************************** + * gluTessBeginContour + *****************************************************************************/ +void GLAPIENTRY gluTessBeginContour( GLUtesselator *tobj ) { - GLUtriangulatorObj *tobj; - tobj = (GLUtriangulatorObj *) malloc(sizeof(struct GLUtesselator)); - if (!tobj) - return NULL; - tobj->contours=tobj->last_contour=NULL; - init_callbacks(&tobj->callbacks); - tobj->error=GLU_NO_ERROR; - tobj->current_polygon=NULL; - tobj->contour_cnt=0; - return tobj; + DEBUGP(2, (" -> gluTessBeginContour(tobj: %p)\n", tobj)); + TESS_CHECK_ERRORS( tobj ); + + if ( tobj->current_contour != NULL ) + { + tess_error_callback( tobj, GLU_TESS_ERROR2, NULL ); + return; + } + + if ( ( tobj->current_contour = + (tess_contour_t *) malloc( sizeof(tess_contour_t) ) ) == NULL ) + { + tess_error_callback( tobj, GLU_OUT_OF_MEMORY, NULL ); + return; + } + + COPY_3V( tobj->plane.normal, tobj->current_contour->plane.normal ); + tobj->current_contour->plane.dist = tobj->plane.dist; + + tobj->current_contour->vertex_count = 0; + tobj->current_contour->vertices = + tobj->current_contour->last_vertex = NULL; + + tobj->current_contour->reflex_count = 0; + tobj->current_contour->reflex_vertices = + tobj->current_contour->last_reflex = NULL; + + tobj->current_contour->orientation = GLU_UNKNOWN; + tobj->current_contour->area = 0.0; + + tobj->current_contour->winding = 0; + CLEAR_BBOX_2DV( tobj->current_contour->mins, + tobj->current_contour->maxs ); + + cleanup: + DEBUGP(2, (" <- gluTessBeginContour(tobj: %p)\n\n", tobj)); + return; } -void GLAPIENTRY gluTessCallback( GLUtriangulatorObj *tobj, GLenum which, - void (GLCALLBACK *fn)() ) +/***************************************************************************** + * gluTessVertex + *****************************************************************************/ +void GLAPIENTRY gluTessVertex( GLUtesselator *tobj, GLdouble coords[3], + void *vertex_data ) { - switch(which) + tess_contour_t *current = tobj->current_contour; + tess_vertex_t *last_vertex; + + DEBUGP(2, (" -> gluTessVertex(tobj: %p, (%.2f, %.2f, %.2f))\n", + tobj, coords[X], coords[Y], coords[Z])); + TESS_CHECK_ERRORS( tobj ); + + if ( current == NULL ) { + tess_error_callback( tobj, GLU_TESS_ERROR2, NULL ); + return; + } + + tobj->vertex_count++; + + last_vertex = current->last_vertex; + + if ( last_vertex == NULL ) + { + if ( ( last_vertex = (tess_vertex_t *) + malloc( sizeof(tess_vertex_t) ) ) == NULL ) { - case GLU_BEGIN: - tobj->callbacks.begin = (void (_CALLBACK*)(GLenum)) fn; - break; - case GLU_EDGE_FLAG: - tobj->callbacks.edgeFlag = (void (_CALLBACK*)(GLboolean)) fn; - break; - case GLU_VERTEX: - tobj->callbacks.vertex = (void (_CALLBACK*)(void *)) fn; - break; - case GLU_END: - tobj->callbacks.end = (void (_CALLBACK*)(void)) fn; - break; - case GLU_ERROR: - tobj->callbacks.error = (void (_CALLBACK*)(GLenum)) fn; - break; - default: - tobj->error=GLU_INVALID_ENUM; - break; + tess_error_callback( tobj, GLU_OUT_OF_MEMORY, NULL ); + return; } -} + current->vertices = last_vertex; + current->last_vertex = last_vertex; + + last_vertex->index = -1; + last_vertex->data = vertex_data; + + last_vertex->coords[X] = coords[X]; + last_vertex->coords[Y] = coords[Y]; + last_vertex->coords[Z] = coords[Z]; + + last_vertex->next = NULL; + last_vertex->previous = NULL; + + current->vertex_count++; + } + else + { + tess_vertex_t *vertex; + + if ( ( vertex = (tess_vertex_t *) + malloc( sizeof(tess_vertex_t) ) ) == NULL ) + { + tess_error_callback( tobj, GLU_OUT_OF_MEMORY, NULL ); + return; + } + + vertex->index = -1; + vertex->data = vertex_data; + + vertex->coords[X] = coords[X]; + vertex->coords[Y] = coords[Y]; + vertex->coords[Z] = coords[Z]; + + vertex->next = NULL; + vertex->previous = last_vertex; + current->vertex_count++; + + last_vertex->next = vertex; + current->last_vertex = vertex; + } + + DEBUGP(3, ("\t vertex: (%.2f, %.2f, %.2f)\n", + current->last_vertex->coords[X], + current->last_vertex->coords[Y], + current->last_vertex->coords[Z])); + cleanup: + DEBUGP(2, (" <- gluTessVertex(tobj: %p)\n", tobj)); + return; +} -void GLAPIENTRY gluDeleteTess( GLUtriangulatorObj *tobj ) + +/***************************************************************************** + * gluTessEndContour + *****************************************************************************/ +void GLAPIENTRY gluTessEndContour( GLUtesselator *tobj ) { - if(tobj->error==GLU_NO_ERROR && tobj->contour_cnt) - /* was gluEndPolygon called? */ - tess_call_user_error(tobj,GLU_TESS_ERROR1); - /* delete all internal structures */ - delete_contours(tobj); - free(tobj); + DEBUGIF(2) fprintf( stderr, "\n" ); DEBUGENDIF; + DEBUGP(2, (" -> gluTessEndContour(tobj: %p)\n", tobj)); + + TESS_CHECK_ERRORS( tobj ); + + if ( tobj->current_contour == NULL ) { + tess_error_callback( tobj, GLU_TESS_ERROR2, NULL ); + return; + } + + if ( tobj->current_contour->vertex_count > 0 ) + { + inspect_current_contour( tobj ); + } + + cleanup: + DEBUGP(2, (" <- gluTessEndContour(tobj: %p)\n\n", tobj)); + return; } -void GLAPIENTRY gluBeginPolygon( GLUtriangulatorObj *tobj ) +/***************************************************************************** + * gluTessEndPolygon + *****************************************************************************/ +void GLAPIENTRY gluTessEndPolygon( GLUtesselator *tobj ) { -/* - if(tobj->error!=GLU_NO_ERROR) - return; -*/ - tobj->error = GLU_NO_ERROR; - if(tobj->current_polygon!=NULL) + DEBUGP(2, ("-> gluTessEndPolygon(tobj: %p)\n", tobj)); + TESS_CHECK_ERRORS( tobj ); + + /* + * Ensure gluTessBeginPolygon was called, otherwise we can't do anything. + */ + if ( tobj->current_contour != NULL ) { + tess_error_callback( tobj, GLU_TESS_ERROR2, NULL ); + return; + } + TESS_CHECK_ERRORS( tobj ); + + /* + * Ensure we have at least one contour to tessellate. If we have none, + * clean up and exit gracefully. + */ + if ( tobj->contour_count == 0 ) + { + DEBUGP(2, (" contour count: 0\n")); + + tess_cleanup( tobj ); + return; + } + + /* Wrap the contour list. */ + + tobj->last_contour->next = tobj->contours; + tobj->contours->previous = tobj->last_contour; + + /* tess_find_contour_hierarchies(tobj); */ + + TESS_CHECK_ERRORS( tobj ); + + /* tess_handle_holes(tobj); */ + + TESS_CHECK_ERRORS( tobj ); + + /* + * Before we tessellate the contours, ensure we have the appropriate + * callbacks registered. We at least need the begin, vertex and end + * callbacks to do any meaningful work. + */ + if ( ( ( tobj->callbacks.begin != NULL ) || + ( tobj->callbacks.beginData != NULL ) ) && + ( ( tobj->callbacks.vertex != NULL ) || + ( tobj->callbacks.vertexData != NULL ) ) && + ( ( tobj->callbacks.end != NULL ) || + ( tobj->callbacks.endData != NULL ) ) ) + { + if ( ( tobj->callbacks.edgeFlag == NULL ) && + ( tobj->callbacks.edgeFlagData == NULL ) ) { - /* gluEndPolygon was not called */ - tess_call_user_error(tobj,GLU_TESS_ERROR1); - /* delete all internal structures */ - delete_contours(tobj); + fist_tessellation( tobj ); } else { - if((tobj->current_polygon= - (tess_polygon *)malloc(sizeof(tess_polygon)))==NULL) - { - tess_call_user_error(tobj,GLU_OUT_OF_MEMORY); - return; - } - tobj->current_polygon->vertex_cnt=0; - tobj->current_polygon->vertices= - tobj->current_polygon->last_vertex=NULL; + fist_tessellation( tobj ); } + } + + cleanup: + delete_all_contours( tobj ); + + DEBUGP(2, ("<- gluTessEndPolygon(tobj: %p)\n\n", tobj)); } -void GLAPIENTRY gluEndPolygon( GLUtriangulatorObj *tobj ) +/***************************************************************************** + * gluTessCallback + *****************************************************************************/ +void GLAPIENTRY gluTessCallback( GLUtesselator *tobj, GLenum which, + void (GLCALLBACK *fn)() ) { - /*tess_contour *contour_ptr;*/ + switch ( which ) + { + /* Register the begin callbacks. */ + case GLU_TESS_BEGIN: + tobj->callbacks.begin = (void (GLCALLBACK*)(GLenum)) fn; + break; + case GLU_TESS_BEGIN_DATA: + tobj->callbacks.beginData = (void (GLCALLBACK*)(GLenum, void *)) fn; + break; + + /* Register the edge flag callbacks. */ + case GLU_TESS_EDGE_FLAG: + tobj->callbacks.edgeFlag = (void (GLCALLBACK*)(GLboolean)) fn; + break; + case GLU_TESS_EDGE_FLAG_DATA: + tobj->callbacks.edgeFlagData = + (void (GLCALLBACK*)(GLboolean, void *)) fn; + break; + + /* Register the vertex callbacks. */ + case GLU_TESS_VERTEX: + tobj->callbacks.vertex = (void (GLCALLBACK*)(void *)) fn; + break; + case GLU_TESS_VERTEX_DATA: + tobj->callbacks.vertexData = (void (GLCALLBACK*)(void *, void *)) fn; + break; + + /* Register the end callbacks. */ + case GLU_TESS_END: + tobj->callbacks.end = (void (GLCALLBACK*)(void)) fn; + break; + case GLU_TESS_END_DATA: + tobj->callbacks.endData = (void (GLCALLBACK*)(void *)) fn; + break; + + /* Register the error callbacks. */ + case GLU_TESS_ERROR: + tobj->callbacks.error = (void (GLCALLBACK*)(GLenum)) fn; + break; + case GLU_TESS_ERROR_DATA: + tobj->callbacks.errorData = (void (GLCALLBACK*)(GLenum, void *)) fn; + break; + + /* Register the combine callbacks. */ + case GLU_TESS_COMBINE: + tobj->callbacks.combine = + (void (GLCALLBACK*)(GLdouble[3], void *[4], + GLfloat [4], void **)) fn; + break; + case GLU_TESS_COMBINE_DATA: + tobj->callbacks.combineData = + (void (GLCALLBACK*)(GLdouble[3], void *[4], GLfloat [4], + void **, void *)) fn; + break; + + default: + tobj->error = GLU_INVALID_ENUM; + break; + } +} - /* there was an error */ - if(tobj->error!=GLU_NO_ERROR) goto end; - /* check if gluBeginPolygon was called */ - if(tobj->current_polygon==NULL) - { - tess_call_user_error(tobj,GLU_TESS_ERROR2); - return; - } - tess_test_polygon(tobj); - /* there was an error */ - if(tobj->error!=GLU_NO_ERROR) goto end; +/***************************************************************************** + * gluTessProperty + * + * Set the current value of the given property. + *****************************************************************************/ +void GLAPIENTRY gluTessProperty( GLUtesselator *tobj, GLenum which, + GLdouble value ) +{ + switch ( which ) + { + case GLU_TESS_BOUNDARY_ONLY: + tobj->boundary_only = (GLboolean) value; + break; + + case GLU_TESS_TOLERANCE: + tobj->tolerance = value; + break; + + case GLU_TESS_WINDING_RULE: + tobj->winding_rule = (GLenum) value; + break; + + default: + tobj->error = GLU_INVALID_ENUM; + break; + } +} - /* any real contours? */ - if(tobj->contour_cnt==0) - { - /* delete all internal structures */ - delete_contours(tobj); - return; - } - tess_find_contour_hierarchies(tobj); - /* there was an error */ - if(tobj->error!=GLU_NO_ERROR) goto end; - tess_handle_holes(tobj); - /* there was an error */ - if(tobj->error!=GLU_NO_ERROR) goto end; +/***************************************************************************** + * gluGetTessProperty + * + * Return the current value of the given property. + *****************************************************************************/ +void GLAPIENTRY gluGetTessProperty( GLUtesselator *tobj, GLenum which, + GLdouble *value ) +{ + switch ( which ) + { + case GLU_TESS_BOUNDARY_ONLY: + *value = tobj->boundary_only; + break; + + case GLU_TESS_TOLERANCE: + *value = tobj->tolerance; + break; + + case GLU_TESS_WINDING_RULE: + *value = tobj->winding_rule; + break; + + default: + tobj->error = GLU_INVALID_ENUM; + break; + } +} + + +/***************************************************************************** + * gluTessNormal + * + * Set the current tessellation normal. + *****************************************************************************/ +void GLAPIENTRY gluTessNormal( GLUtesselator *tobj, GLdouble x, + GLdouble y, GLdouble z ) +{ + tobj->plane.normal[X] = x; + tobj->plane.normal[Y] = y; + tobj->plane.normal[Z] = z; +} - /* if no callbacks, nothing to do */ - if(tobj->callbacks.begin!=NULL && tobj->callbacks.vertex!=NULL && - tobj->callbacks.end!=NULL) - { - if(tobj->callbacks.edgeFlag==NULL) - tess_tesselate(tobj); - else - tess_tesselate_with_edge_flag(tobj); - } -end: - /* delete all internal structures */ - delete_contours(tobj); + +/***************************************************************************** + * + * OBSOLETE TESSELLATION FUNCTIONS + * + *****************************************************************************/ + +void GLAPIENTRY gluBeginPolygon( GLUtesselator *tobj ) +{ + gluTessBeginPolygon( tobj, NULL ); + gluTessBeginContour( tobj ); } +void GLAPIENTRY gluNextContour( GLUtesselator *tobj, GLenum type ) +{ + gluTessEndContour( tobj ); + gluTessBeginContour( tobj ); +} -void GLAPIENTRY gluNextContour( GLUtriangulatorObj *tobj, GLenum type ) +void GLAPIENTRY gluEndPolygon( GLUtesselator *tobj ) { - if(tobj->error!=GLU_NO_ERROR) - return; - if(tobj->current_polygon==NULL) - { - tess_call_user_error(tobj,GLU_TESS_ERROR2); - return; - } - /* first contour? */ - if(tobj->current_polygon->vertex_cnt) - tess_test_polygon(tobj); + gluTessEndContour( tobj ); + gluTessEndPolygon( tobj ); } -void GLAPIENTRY gluTessVertex( GLUtriangulatorObj *tobj, GLdouble v[3], void *data ) + +/***************************************************************************** + * tess_error_callback + * + * Internal error handler. Call the user-registered error callback. + *****************************************************************************/ +void tess_error_callback( GLUtesselator *tobj, GLenum errno, void *data ) { - tess_polygon *polygon=tobj->current_polygon; - tess_vertex *last_vertex_ptr; + if ( tobj->error == GLU_NO_ERROR ) + { + tobj->error = errno; + } + + if ( tobj->callbacks.errorData != NULL ) + { + ( tobj->callbacks.errorData )( errno, data ); + } + else if ( tobj->callbacks.error != NULL ) + { + ( tobj->callbacks.error )( errno ); + } +} - if(tobj->error!=GLU_NO_ERROR) - return; - if(polygon==NULL) - { - tess_call_user_error(tobj,GLU_TESS_ERROR2); - return; + + +/***************************************************************************** + * + * INTERNAL FUNCTIONS + * + *****************************************************************************/ + + +/***************************************************************************** + * init_callbacks + *****************************************************************************/ +static void init_callbacks( tess_callbacks_t *callbacks ) +{ + callbacks->begin = ( void (GLCALLBACK*)(GLenum) ) NULL; + callbacks->beginData = ( void (GLCALLBACK*)(GLenum, void *) ) NULL; + callbacks->edgeFlag = ( void (GLCALLBACK*)(GLboolean) ) NULL; + callbacks->edgeFlagData = ( void (GLCALLBACK*)(GLboolean, void *) ) NULL; + callbacks->vertex = ( void (GLCALLBACK*)(void *) ) NULL; + callbacks->vertexData = ( void (GLCALLBACK*)(void *, void *) ) NULL; + callbacks->end = ( void (GLCALLBACK*)(void) ) NULL; + callbacks->endData = ( void (GLCALLBACK*)(void *) ) NULL; + callbacks->error = ( void (GLCALLBACK*)(GLenum) ) NULL; + callbacks->errorData = ( void (GLCALLBACK*)(GLenum, void *) ) NULL; + callbacks->combine = ( void (GLCALLBACK*)(GLdouble [3], void *[4], + GLfloat [4], void **) ) NULL; + callbacks->combineData = ( void (GLCALLBACK*)(GLdouble [3], void *[4], + GLfloat [4], void **, + void *) ) NULL; +} + + +/***************************************************************************** + * tess_cleanup + *****************************************************************************/ +static void tess_cleanup( GLUtesselator *tobj ) +{ + DEBUGP(3, (" -> tess_cleanup(tobj: %p)\n", tobj)); + + if ( tobj->current_contour != NULL ) + { + delete_current_contour( tobj ); + } + + if ( tobj->contours != NULL ) + { + delete_all_contours( tobj ); + } + + DEBUGP(3, (" <- tess_cleanup(tobj: %p)\n", tobj)); +} + + +/***************************************************************************** + * inspect_current_contour + *****************************************************************************/ +static GLenum find_normal( GLUtesselator *tobj ); +static void project_current_contour( GLUtesselator *tobj ); +static GLenum save_current_contour( GLUtesselator *tobj ); + +static void inspect_current_contour( GLUtesselator *tobj ) +{ + tess_contour_t *current = tobj->current_contour; + + DEBUGP(3, (" -> inspect_current_contour(tobj: %p)\n", tobj)); + + if ( current->vertex_count < 3 ) + { + delete_current_contour( tobj ); + return; + } + + current->last_vertex->next = current->vertices; + current->vertices->previous = current->last_vertex; + + if ( ( tobj->contours == NULL ) && + ( COMPARE_3DV( current->plane.normal, origin ) ) ) + { + /* We haven't been given a normal, so let's take a guess. */ + if ( find_normal( tobj ) == GLU_ERROR ) { + return; } - last_vertex_ptr=polygon->last_vertex; - if(last_vertex_ptr==NULL) + COPY_3V( current->plane.normal, tobj->plane.normal ); + tobj->plane.dist = current->plane.dist; + } + + project_current_contour( tobj ); + + if ( save_current_contour( tobj ) == GLU_ERROR ) { + return; + } + + DEBUGP(3, (" <- inspect_current_contour(tobj: %p)\n", tobj)); +} + +/***************************************************************************** + * find_normal + *****************************************************************************/ +static GLenum find_normal( GLUtesselator *tobj ) +{ + tess_contour_t *contour = tobj->current_contour; + tess_vertex_t *va, *vb, *vc; + GLdouble a[3], b[3], c[3]; + + DEBUGP(3, (" -> find_normal(tobj: %p)\n", tobj)); + + if ( contour == NULL ) { return GLU_ERROR; } + + va = contour->vertices; + vb = va->next; + + /* If va and vb are the same point, keep looking for a different vertex. */ + + while ( COMPARE_3DV( va->coords, vb->coords ) && ( vb != va ) ) { + vb = vb->next; + } + + if ( vb == va ) { + tess_error_callback( tobj, GLU_TESS_ERROR7, NULL ); + } + + SUB_3V( a, vb->coords, va->coords ); + + for ( vc = vb->next; vc != va; vc = vc->next ) + { + SUB_3V( b, vc->coords, va->coords ); + + CROSS3( c, a, b ); + + if ( ( fabs( c[X] ) > EQUAL_EPSILON ) || + ( fabs( c[Y] ) > EQUAL_EPSILON ) || + ( fabs( c[Z] ) > EQUAL_EPSILON ) ) { - if((last_vertex_ptr=(tess_vertex *) - malloc(sizeof(tess_vertex)))==NULL) - { - tess_call_user_error(tobj,GLU_OUT_OF_MEMORY); - return; - } - polygon->vertices=last_vertex_ptr; - polygon->last_vertex=last_vertex_ptr; - last_vertex_ptr->data=data; - last_vertex_ptr->location[0]=v[0]; - last_vertex_ptr->location[1]=v[1]; - last_vertex_ptr->location[2]=v[2]; - last_vertex_ptr->next=NULL; - last_vertex_ptr->previous=NULL; - ++(polygon->vertex_cnt); + COPY_3V( contour->plane.normal, c ); + NORMALIZE_3DV( contour->plane.normal ); + + contour->plane.dist = - DOT3( contour->plane.normal, va->coords ); + + DEBUGP(3, (" <- find_normal(tobj: %p) (%.2f, %.2f, %.2f)\n", + tobj, contour->plane.normal[X], + contour->plane.normal[Y], contour->plane.normal[Z])); + return GLU_NO_ERROR; } else { - tess_vertex *vertex_ptr; - - /* same point twice? */ - if(fabs(last_vertex_ptr->location[0]-v[0]) < EPSILON && - fabs(last_vertex_ptr->location[1]-v[1]) < EPSILON && - fabs(last_vertex_ptr->location[2]-v[2]) < EPSILON) - { - tess_call_user_error(tobj,GLU_TESS_ERROR6); - return; - } - if((vertex_ptr=(tess_vertex *) - malloc(sizeof(tess_vertex)))==NULL) - { - tess_call_user_error(tobj,GLU_OUT_OF_MEMORY); - return; - } - vertex_ptr->data=data; - vertex_ptr->location[0]=v[0]; - vertex_ptr->location[1]=v[1]; - vertex_ptr->location[2]=v[2]; - vertex_ptr->next=NULL; - vertex_ptr->previous=last_vertex_ptr; - ++(polygon->vertex_cnt); - last_vertex_ptr->next=vertex_ptr; - polygon->last_vertex=vertex_ptr; + DEBUGP(3, (" *** skipping colinear points...\n")); } + } + tess_error_callback( tobj, GLU_TESS_ERROR7, NULL ); + + DEBUGP(3, (" <- find_normal(tobj: %p) ERROR\n", tobj)); + return GLU_ERROR; } +/***************************************************************************** + * project_current_contour + *****************************************************************************/ +static GLdouble twice_contour_area( tess_vertex_t *vertex, + tess_vertex_t *last_vertex ); -static void delete_contours(GLUtriangulatorObj *tobj) +static void project_current_contour( GLUtesselator *tobj ) { - tess_polygon *polygon=tobj->current_polygon; - tess_contour *contour,*contour_tmp; - tess_vertex *vertex,*vertex_tmp; + tess_contour_t *current = tobj->current_contour; + tess_vertex_t *vertex; + GLdouble area; + GLdouble zaxis[3] = { 0.0, 0.0, 1.0 }, znormal[3], xnormal[3]; + GLdouble dot, rotx, roty; + GLuint i; - /* remove current_polygon list - if exists due to detected error */ - if(polygon!=NULL) - { - if (polygon->vertices) - { - for(vertex=polygon->vertices;vertex!=polygon->last_vertex;) - { - vertex_tmp=vertex->next; - free(vertex); - vertex=vertex_tmp; - } - free(vertex); - } - free(polygon); - tobj->current_polygon=NULL; - } - /* remove all contour data */ - for(contour=tobj->contours;contour!=NULL;) + DEBUGP(3, (" -> project_current_contour(tobj: %p)\n", tobj)); + + if ( current == NULL ) { return; } + + DEBUGP(3, (" normal: (%.2f, %.2f, %.2f) dist: %.2f n: %u\n", + current->plane.normal[X], current->plane.normal[Y], + current->plane.normal[Z], current->plane.dist, + current->vertex_count)); + + /* Rotate the plane normal around the y-axis. */ + + znormal[X] = current->plane.normal[X]; + znormal[Y] = 0.0; + znormal[Z] = current->plane.normal[Z]; + + dot = DOT3( znormal, zaxis ); + roty = acos( dot ); + + /* Rotate the plane normal around the x-axis. */ + + xnormal[X] = cos( roty ) * znormal[X] - sin( roty ) * znormal[Z]; + xnormal[Y] = znormal[Y]; + xnormal[Z] = sin( roty ) * znormal[X] + cos( roty ) * znormal[Z]; + + dot = DOT3( xnormal, zaxis ); + rotx = acos( dot ); + + for ( vertex = current->vertices, i = 0; + i < current->vertex_count; vertex = vertex->next, i++ ) + { + tess_plane_t *plane = ¤t->plane; + GLdouble proj[3], yrot[3], xrot[3]; + + /* FIXME: This needs a cleanup, 'cos I'm sure it's inefficient. */ + + proj[X] = vertex->coords[X] - plane->dist * plane->normal[X]; + proj[Y] = vertex->coords[Y] - plane->dist * plane->normal[Y]; + proj[Z] = vertex->coords[Z] - plane->dist * plane->normal[Z]; + + yrot[X] = cos( roty ) * proj[X] - sin( roty ) * proj[Z]; + yrot[Y] = proj[Y]; + yrot[Z] = sin( roty ) * proj[X] + cos( roty ) * proj[Z]; + + xrot[X] = yrot[X]; + xrot[Y] = cos( rotx ) * yrot[Y] - sin( rotx ) * yrot[Z]; + xrot[Z] = sin( rotx ) * yrot[Y] + cos( rotx ) * yrot[Z]; + + vertex->v[X] = xrot[X]; + vertex->v[Y] = xrot[Y]; + + ACC_BBOX_2V( vertex->v, tobj->mins, tobj->maxs ); + ACC_BBOX_2V( vertex->v, current->mins, current->maxs ); + + DEBUGP(3, (" v %d: (%.2f, %.2f, %.2f) -> (%.2f, %.2f)\n", + i, vertex->coords[X], vertex->coords[Y], + vertex->coords[Z], vertex->v[X], vertex->v[Y])); + } + + area = twice_contour_area( current->vertices, + current->last_vertex ); + if ( area >= 0.0 ) + { + current->orientation = GLU_CCW; + current->area = area; + } + else + { + current->orientation = GLU_CW; + current->area = -area; + } + + DEBUGP(3, (" <- project_current_contour(tobj: %p)\n", tobj)); +} + +/***************************************************************************** + * twice_contour_area + *****************************************************************************/ +static GLdouble twice_contour_area( tess_vertex_t *vertex, + tess_vertex_t *last_vertex ) +{ + tess_vertex_t *next; + GLdouble area, x, y; + + area = 0.0; + + x = vertex->v[X]; + y = vertex->v[Y]; + + vertex = vertex->next; + + while ( vertex != last_vertex ) + { + next = vertex->next; + area += + (vertex->v[X] - x) * (next->v[Y] - y) - + (vertex->v[Y] - y) * (next->v[X] - x); + + vertex = vertex->next; + } + return area; +} + + +/***************************************************************************** + * save_current_contour + *****************************************************************************/ +static GLenum save_current_contour( GLUtesselator *tobj ) +{ + tess_contour_t *current = tobj->current_contour; + tess_vertex_t *vertex; + GLuint i; + + DEBUGP(3, (" -> save_current_contour(tobj: %p)\n", tobj)); + + if ( current == NULL ) { return GLU_ERROR; } + + if ( tobj->contours == NULL ) + { + tobj->contours = tobj->last_contour = current; + current->next = current->previous = NULL; + } + else + { + current->previous = tobj->last_contour; + + tobj->last_contour->next = current; + tobj->last_contour = current; + + current->next = NULL; + } + + for ( vertex = current->vertices, i = 0; + i < current->vertex_count; vertex = vertex->next, i++ ) + { + vertex->shadow_vertex = NULL; + vertex->edge_flag = GL_TRUE; + } + + current->type = GLU_UNKNOWN; + + tobj->contour_count++; + tobj->current_contour = NULL; + + DEBUGP(3, (" <- save_current_contour()\n")); + return GLU_NO_ERROR; +} + +/***************************************************************************** + * delete_current_contour + *****************************************************************************/ +static void delete_current_contour( GLUtesselator *tobj ) +{ + tess_contour_t *current = tobj->current_contour; + tess_vertex_t *vertex, *next; + GLuint i; + + DEBUGP(3, (" -> delete_current_contour(contour: %p)\n", current)); + + if ( current == NULL ) { return; } + + for ( vertex = current->vertices, i = 0; i < current->vertex_count; i++) + { + next = vertex->next; + free( vertex ); + vertex = next; + } + + free( current ); + tobj->current_contour = NULL; + + DEBUGP(3, (" <- delete_current_contour()\n")); +} + +/***************************************************************************** + * delete_all_contours + *****************************************************************************/ +static void delete_all_contours( GLUtesselator *tobj ) +{ + tess_contour_t *current = tobj->current_contour, *next_contour; + tess_vertex_t *vertex, *next_vertex; + GLuint i; + + DEBUGP(3, (" -> delete_all_contours(tobj: %p)\n", tobj)); + + if ( current != NULL ) + { + delete_current_contour( tobj ); + } + + for ( current = tobj->contours, i = 0; i < tobj->contour_count; i++ ) + { + vertex = current->vertices; + + while ( vertex != current->last_vertex ) { - for(vertex=contour->vertices;vertex!=contour->last_vertex;) - { - vertex_tmp=vertex->next; - free(vertex); - vertex=vertex_tmp; - } - free(vertex); - contour_tmp=contour->next; - free(contour); - contour=contour_tmp; + next_vertex = vertex->next; + free( vertex ); + vertex = next_vertex; } - tobj->contours=tobj->last_contour=NULL; - tobj->contour_cnt=0; + free( vertex ); + next_contour = current->next; + + free( current ); + current = next_contour; + } + + tobj->contour_count = tobj->vertex_count = 0; + tobj->contours = tobj->last_contour = NULL; + + CLEAR_BBOX_2DV( tobj->mins, tobj->maxs ); + + ZERO_3V( tobj->plane.normal ); + tobj->plane.dist = 0.0; + + DEBUGP(3, (" <- delete_all_contours(tobj: %p)\n", tobj)); } +/***************************************************************************** + * Debugging output + *****************************************************************************/ +#ifdef _DEBUG +int vdebugstr( char *format_str, ... ) +{ + va_list ap; + va_start( ap, format_str ); + + vfprintf( stderr, format_str, ap ); + va_end( ap ); + return 0; +} +#endif diff --git a/src/glu/mesa/tess.h b/src/glu/mesa/tess.h index 53d673ccbea..fe8296c976c 100644 --- a/src/glu/mesa/tess.h +++ b/src/glu/mesa/tess.h @@ -1,121 +1,108 @@ -/* $Id: tess.h,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ +/* $Id: tess.h,v 1.2 1999/09/10 02:03:31 gareth Exp $ */ /* * Mesa 3-D graphics library * Version: 3.1 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * 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: tess.h,v $ - * Revision 1.1 1999/08/19 00:55:42 jtg - * Initial revision - * - * Revision 1.5 1999/02/27 13:55:31 brianp - * fixed BeOS-related GLU typedef problems - * - * Revision 1.4 1999/01/03 03:23:15 brianp - * now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump) - * - * Revision 1.3 1997/10/29 02:02:20 brianp - * various MS Windows compiler changes (David Bucciarelli, v20 3dfx driver) +/***************************************************************************** * - * Revision 1.2 1997/05/24 13:30:58 brianp - * added TESS_H multi-inclusion prevention test + * GLU 1.3 Polygon Tessellation by Gareth Hughes * - * Revision 1.1 1996/09/27 01:19:39 brianp - * Initial revision - * - */ - - -/* - * This file is part of the polygon tesselation code contributed by - * Bogdan Sikorski - */ - + *****************************************************************************/ -#ifndef TESS_H -#define TESS_H +#ifndef __GLU_TESS_H__ +#define __GLU_TESS_H__ +#include +#include #include "gluP.h" -#define EPSILON 1e-06 /* epsilon for double precision compares */ - -typedef enum -{ - OXY, - OYZ, - OXZ -} projection_type; - -typedef struct callbacks_str -{ - void (GLCALLBACK *begin)( GLenum mode ); - void (GLCALLBACK *edgeFlag)( GLboolean flag ); - void (GLCALLBACK *vertex)( GLvoid *v ); - void (GLCALLBACK *end)( void ); - void (GLCALLBACK *error)( GLenum err ); -} tess_callbacks; - -typedef struct vertex_str -{ - void *data; - GLdouble location[3]; - GLdouble x,y; - GLboolean edge_flag; - struct vertex_str *shadow_vertex; - struct vertex_str *next,*previous; -} tess_vertex; - -typedef struct contour_str -{ - GLenum type; - GLuint vertex_cnt; - GLdouble area; - GLenum orientation; - struct vertex_str *vertices,*last_vertex; - struct contour_str *next,*previous; -} tess_contour; +#include "tess_typedefs.h" +#include "tess_heap.h" +#if 0 +#include "tess_grid.h" +#endif -typedef struct polygon_str -{ - GLuint vertex_cnt; - GLdouble A,B,C,D; - GLdouble area; - GLenum orientation; - struct vertex_str *vertices,*last_vertex; -} tess_polygon; +#ifdef __cplusplus +extern "C" { +#endif +/***************************************************************************** + * The GLUtesselator structure: + *****************************************************************************/ struct GLUtesselator { - tess_contour *contours,*last_contour; - GLuint contour_cnt; - tess_callbacks callbacks; - tess_polygon *current_polygon; - GLenum error; - GLdouble A,B,C,D; - projection_type projection; + tess_callbacks_t callbacks; + GLboolean boundary_only; + GLenum winding_rule; + GLdouble tolerance; + tess_plane_t plane; + GLuint contour_count; + tess_contour_t *contours, *last_contour; + tess_contour_t *current_contour; + GLdouble mins[2], maxs[2]; + GLuint vertex_count; + tess_vertex_t **sorted_vertices; +#if 0 + tess_grid_t *grid; /* Not currently used... */ +#endif + heap_t *heap; + GLenum error; }; -extern void tess_call_user_error(GLUtriangulatorObj *,GLenum); - +/***************************************************************************** + * Tessellation error handler: + *****************************************************************************/ +extern void tess_error_callback( GLUtesselator *, GLenum, void * ); + + +/***************************************************************************** + * Debugging output: (to be removed...) + *****************************************************************************/ +extern int tess_debug_level; +int vdebugstr( char *format_str, ... ); + +#ifdef _DEBUG +#define DEBUGP(level, body) \ + do { \ + if ( tess_debug_level >= level ) { \ + vdebugstr( "%11.11s:%-5d ", __FILE__, __LINE__, level ); \ + vdebugstr body; \ + fflush ( stderr ); \ + } \ + } while ( 0 ) +#define DEBUGIF(level) do { if ( tess_debug_level >= level ) { +#define DEBUGENDIF } } while ( 0 ) +#else +#define DEBUGP(level, body) +#define DEBUGIF(level) while(0) { +#define DEBUGENDIF } +#endif +#ifdef __cplusplus +} #endif + +#endif // __GLU_TESS_H__ diff --git a/src/glu/mesa/tesselat.c b/src/glu/mesa/tesselat.c deleted file mode 100644 index 1e424c17ca7..00000000000 --- a/src/glu/mesa/tesselat.c +++ /dev/null @@ -1,456 +0,0 @@ -/* $Id: tesselat.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ - -/* - * Mesa 3-D graphics library - * Version: 2.4 - * Copyright (C) 1995-1997 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * $Log: tesselat.c,v $ - * Revision 1.1 1999/08/19 00:55:42 jtg - * Initial revision - * - * Revision 1.5 1997/07/24 01:28:44 brianp - * changed precompiled header symbol from PCH to PC_HEADER - * - * Revision 1.4 1997/05/28 02:29:38 brianp - * added support for precompiled headers (PCH), inserted APIENTRY keyword - * - * Revision 1.3 1997/02/17 17:24:58 brianp - * more tesselation changes (Randy Frank) - * - * Revision 1.2 1997/02/13 18:31:57 brianp - * fixed some numerical precision problems (Randy Frank) - * - * Revision 1.1 1996/09/27 01:19:39 brianp - * Initial revision - * - */ - - -/* - * This file is part of the polygon tesselation code contributed by - * Bogdan Sikorski - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include "tess.h" -#endif - - - -static GLboolean edge_flag; - -static void emit_triangle(GLUtriangulatorObj *, tess_vertex *, - tess_vertex *,tess_vertex *); - -static void emit_triangle_with_edge_flag(GLUtriangulatorObj *, - tess_vertex *,GLboolean,tess_vertex *,GLboolean, - tess_vertex *,GLboolean); - -static GLdouble twice_the_triangle_area( - tess_vertex *va, - tess_vertex *vb, - tess_vertex *vc) -{ - return (vb->x - va->x)*(vc->y - va->y) - (vb->y - va->y)*(vc->x - va->x); -} - -static GLboolean left( - GLdouble A, - GLdouble B, - GLdouble C, - GLdouble x, - GLdouble y) -{ - if(A*x+B*y+C > -EPSILON) - return GL_TRUE; - else - return GL_FALSE; -} - -static GLboolean right( - GLdouble A, - GLdouble B, - GLdouble C, - GLdouble x, - GLdouble y) -{ - if(A*x+B*y+C < EPSILON) - return GL_TRUE; - else - return GL_FALSE; -} - -static GLint convex_ccw( - tess_vertex *va, - tess_vertex *vb, - tess_vertex *vc, - GLUtriangulatorObj *tobj) -{ - GLdouble d; - - d = twice_the_triangle_area(va,vb,vc); - - if (d > EPSILON ) { - return 1; - } else if (d < -EPSILON ) { - return 0; - } else { - return -1; - } -} - -static GLint convex_cw( - tess_vertex *va, - tess_vertex *vb, - tess_vertex *vc, - GLUtriangulatorObj *tobj) -{ - GLdouble d; - - d = twice_the_triangle_area(va,vb,vc); - - if (d < -EPSILON ) { - return 1; - } else if (d > EPSILON ) { - return 0; - } else { - return -1; - } -} - -static GLboolean diagonal_ccw( - tess_vertex *va, - tess_vertex *vb, - GLUtriangulatorObj *tobj, - tess_contour *contour) -{ - tess_vertex *vc=va->next , *vertex , *shadow_vertex; - struct - { - GLdouble A,B,C; - } ac,cb,ba; - GLdouble x,y; - - GLint res = convex_ccw(va,vc,vb,tobj); - if (res == 0) return GL_FALSE; - if (res == -1) return GL_TRUE; - - ba.A=vb->y - va->y; - ba.B=va->x - vb->x; - ba.C= -ba.A*va->x - ba.B*va->y; - ac.A=va->y - vc->y; - ac.B=vc->x - va->x; - ac.C= -ac.A*vc->x - ac.B*vc->y; - cb.A=vc->y - vb->y; - cb.B=vb->x - vc->x; - cb.C= -cb.A*vb->x - cb.B*vb->y; - for(vertex=vb->next;vertex!=va;vertex=vertex->next) - { - shadow_vertex=vertex->shadow_vertex; - if(shadow_vertex!=NULL && - (shadow_vertex==va || shadow_vertex==vb || shadow_vertex==vc)) - continue; - x=vertex->x; - y=vertex->y; - if(left(ba.A,ba.B,ba.C,x,y) && - left(ac.A,ac.B,ac.C,x,y) && - left(cb.A,cb.B,cb.C,x,y)) - return GL_FALSE; - } - return GL_TRUE; -} - -static GLboolean diagonal_cw( - tess_vertex *va, - tess_vertex *vb, - GLUtriangulatorObj *tobj, - tess_contour *contour) -{ - tess_vertex *vc=va->next , *vertex , *shadow_vertex; - struct - { - GLdouble A,B,C; - } ac,cb,ba; - GLdouble x,y; - - GLint res = convex_cw(va,vc,vb,tobj); - if (res == 0) return GL_FALSE; - if (res == -1) return GL_TRUE; - - ba.A=vb->y - va->y; - ba.B=va->x - vb->x; - ba.C= -ba.A*va->x - ba.B*va->y; - ac.A=va->y - vc->y; - ac.B=vc->x - va->x; - ac.C= -ac.A*vc->x - ac.B*vc->y; - cb.A=vc->y - vb->y; - cb.B=vb->x - vc->x; - cb.C= -cb.A*vb->x - cb.B*vb->y; - for(vertex=vb->next;vertex!=va;vertex=vertex->next) - { - shadow_vertex=vertex->shadow_vertex; - if(shadow_vertex!=NULL && - (shadow_vertex==va || shadow_vertex==vb || shadow_vertex==vc)) - continue; - x=vertex->x; - y=vertex->y; - if(right(ba.A,ba.B,ba.C,x,y) && - right(ac.A,ac.B,ac.C,x,y) && - right(cb.A,cb.B,cb.C,x,y)) - return GL_FALSE; - } - return GL_TRUE; -} - -static void clip_ear( - GLUtriangulatorObj *tobj, - tess_vertex *v, - tess_contour *contour) -{ - emit_triangle(tobj,v->previous,v,v->next); - /* the first in the list */ - if(contour->vertices==v) - { - contour->vertices=v->next; - contour->last_vertex->next=v->next; - v->next->previous=contour->last_vertex; - } - else - /* the last ? */ - if(contour->last_vertex==v) - { - contour->vertices->previous=v->previous; - v->previous->next=v->next; - contour->last_vertex=v->previous; - } - else - { - v->next->previous=v->previous; - v->previous->next=v->next; - } - free(v); - --(contour->vertex_cnt); -} - -static void clip_ear_with_edge_flag( - GLUtriangulatorObj *tobj, - tess_vertex *v, - tess_contour *contour) -{ - emit_triangle_with_edge_flag(tobj,v->previous,v->previous->edge_flag, - v,v->edge_flag,v->next,GL_FALSE); - v->previous->edge_flag=GL_FALSE; - /* the first in the list */ - if(contour->vertices==v) - { - contour->vertices=v->next; - contour->last_vertex->next=v->next; - v->next->previous=contour->last_vertex; - } - else - /* the last ? */ - if(contour->last_vertex==v) - { - contour->vertices->previous=v->previous; - v->previous->next=v->next; - contour->last_vertex=v->previous; - } - else - { - v->next->previous=v->previous; - v->previous->next=v->next; - } - free(v); - --(contour->vertex_cnt); -} - -static void triangulate_ccw( - GLUtriangulatorObj *tobj, - tess_contour *contour) -{ - tess_vertex *vertex; - GLuint vertex_cnt=contour->vertex_cnt; - - while(vertex_cnt > 3) - { - vertex=contour->vertices; - while(diagonal_ccw(vertex,vertex->next->next,tobj,contour)==GL_FALSE && - tobj->error==GLU_NO_ERROR) - vertex=vertex->next; - if(tobj->error!=GLU_NO_ERROR) - return; - clip_ear(tobj,vertex->next,contour); - --vertex_cnt; - } -} - -static void triangulate_cw( - GLUtriangulatorObj *tobj, - tess_contour *contour) -{ - tess_vertex *vertex; - GLuint vertex_cnt=contour->vertex_cnt; - - while(vertex_cnt > 3) - { - vertex=contour->vertices; - while(diagonal_cw(vertex,vertex->next->next,tobj,contour)==GL_FALSE && - tobj->error==GLU_NO_ERROR) - vertex=vertex->next; - if(tobj->error!=GLU_NO_ERROR) - return; - clip_ear(tobj,vertex->next,contour); - --vertex_cnt; - } -} - -static void triangulate_ccw_with_edge_flag( - GLUtriangulatorObj *tobj, - tess_contour *contour) -{ - tess_vertex *vertex; - GLuint vertex_cnt=contour->vertex_cnt; - - while(vertex_cnt > 3) - { - vertex=contour->vertices; - while(diagonal_ccw(vertex,vertex->next->next,tobj,contour)==GL_FALSE && - tobj->error==GLU_NO_ERROR) - vertex=vertex->next; - if(tobj->error!=GLU_NO_ERROR) - return; - clip_ear_with_edge_flag(tobj,vertex->next,contour); - --vertex_cnt; - } -} - -static void triangulate_cw_with_edge_flag( - GLUtriangulatorObj *tobj, - tess_contour *contour) -{ - tess_vertex *vertex; - GLuint vertex_cnt=contour->vertex_cnt; - - while(vertex_cnt > 3) - { - vertex=contour->vertices; - while(diagonal_cw(vertex,vertex->next->next,tobj,contour)==GL_FALSE && - tobj->error==GLU_NO_ERROR) - vertex=vertex->next; - if(tobj->error!=GLU_NO_ERROR) - return; - clip_ear_with_edge_flag(tobj,vertex->next,contour); - --vertex_cnt; - } -} - -void tess_tesselate(GLUtriangulatorObj *tobj) -{ - tess_contour *contour; - - for(contour=tobj->contours;contour!=NULL;contour=contour->next) - { - if(contour->orientation==GLU_CCW) { - triangulate_ccw(tobj,contour); - } else { - triangulate_cw(tobj,contour); - } - if(tobj->error!=GLU_NO_ERROR) - return; - - /* emit the last triangle */ - emit_triangle(tobj,contour->vertices,contour->vertices->next, - contour->vertices->next->next); - } -} - -void tess_tesselate_with_edge_flag(GLUtriangulatorObj *tobj) -{ - tess_contour *contour; - - edge_flag=GL_TRUE; - /* first callback with edgeFlag set to GL_TRUE */ - (tobj->callbacks.edgeFlag)(GL_TRUE); - - for(contour=tobj->contours;contour!=NULL;contour=contour->next) - { - if(contour->orientation==GLU_CCW) - triangulate_ccw_with_edge_flag(tobj,contour); - else - triangulate_cw_with_edge_flag(tobj,contour); - if(tobj->error!=GLU_NO_ERROR) - return; - /* emit the last triangle */ - emit_triangle_with_edge_flag(tobj,contour->vertices, - contour->vertices->edge_flag,contour->vertices->next, - contour->vertices->next->edge_flag,contour->vertices->next->next, - contour->vertices->next->next->edge_flag); - } -} - -static void emit_triangle( - GLUtriangulatorObj *tobj, - tess_vertex *v1, - tess_vertex *v2, - tess_vertex *v3) -{ - (tobj->callbacks.begin)(GL_TRIANGLES); - (tobj->callbacks.vertex)(v1->data); - (tobj->callbacks.vertex)(v2->data); - (tobj->callbacks.vertex)(v3->data); - (tobj->callbacks.end)(); -} - -static void emit_triangle_with_edge_flag( - GLUtriangulatorObj *tobj, - tess_vertex *v1, - GLboolean edge_flag1, - tess_vertex *v2, - GLboolean edge_flag2, - tess_vertex *v3, - GLboolean edge_flag3) -{ - (tobj->callbacks.begin)(GL_TRIANGLES); - if(edge_flag1!=edge_flag) - { - edge_flag = (edge_flag==GL_TRUE ? GL_FALSE : GL_TRUE); - (tobj->callbacks.edgeFlag)(edge_flag); - } - (tobj->callbacks.vertex)(v1->data); - if(edge_flag2!=edge_flag) - { - edge_flag = (edge_flag==GL_TRUE ? GL_FALSE : GL_TRUE); - (tobj->callbacks.edgeFlag)(edge_flag); - } - (tobj->callbacks.vertex)(v2->data); - if(edge_flag3!=edge_flag) - { - edge_flag = (edge_flag==GL_TRUE ? GL_FALSE : GL_TRUE); - (tobj->callbacks.edgeFlag)(edge_flag); - } - (tobj->callbacks.vertex)(v3->data); - (tobj->callbacks.end)(); -} -- cgit v1.2.3 From ed3453350a8567184975182abddd7e4008f7518d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 11 Sep 1999 11:26:34 +0000 Subject: added GL_EXT_get_proc_address --- include/GL/gl.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 58b51d5abf6..23aa596d377 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ +/* $Id: gl.h,v 1.2 1999/09/11 11:26:34 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1859,7 +1859,7 @@ GLAPI void GLAPIENTRY glPopName( void ); /* - * 1.0 Extensions + * Extensions */ /* GL_EXT_blend_minmax */ @@ -2187,6 +2187,12 @@ GLAPI void GLAPIENTRY glLockArraysEXT( GLint first, GLsizei count ); GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); +/* GL_EXT_get_proc_address */ +typedef void (*GLfunction)(); +GLAPI GLfunction GLAPIENTRY glGetProcAddressEXT( const GLubyte *procName ); + + + #if defined(__BEOS__) || defined(__QUICKDRAW__) #pragma export off #endif @@ -2218,6 +2224,7 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); #define GL_PGI_misc_hints 1 #define GL_EXT_compiled_vertex_array 1 #define GL_EXT_clip_volume_hint 1 +#define GL_EXT_get_proc_address 1 #ifdef macintosh -- cgit v1.2.3 From 89a42b7e736bd9b0ab090906cab0cd047a6ec12e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 11 Sep 1999 11:33:45 +0000 Subject: added GLX_EXT_get_proc_address --- include/GL/glx.h | 15 ++++++++++----- src/mesa/drivers/x11/fakeglx.c | 28 +++++++++++++++++++++++++++- src/mesa/drivers/x11/glxapi.c | 13 ++++++++++++- 3 files changed, 49 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 4b27880eba9..4163fe28579 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ +/* $Id: glx.h,v 1.2 1999/09/11 11:33:45 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -27,8 +27,11 @@ /* * $Log: glx.h,v $ - * Revision 1.1 1999/08/19 00:55:40 jtg - * Initial revision + * Revision 1.2 1999/09/11 11:33:45 brianp + * added GLX_EXT_get_proc_address + * + * Revision 1.1.1.1 1999/08/19 00:55:40 jtg + * Imported sources * * Revision 3.3 1999/02/14 03:39:09 brianp * new copyright @@ -154,13 +157,12 @@ enum _GLX_CONFIGS { /* * Compile-time extension tests */ -#ifdef MESA #define GLX_EXT_visual_info 1 #define GLX_MESA_pixmap_colormap 1 #define GLX_MESA_release_buffers 1 #define GLX_MESA_copy_sub_buffer 1 #define GLX_SGI_video_sync 1 -#endif +#define GLX_EXT_get_proc_address 1 @@ -227,6 +229,9 @@ extern const char *glXQueryServerString( Display *dpy, int screen, int name ); extern const char *glXGetClientString( Display *dpy, int name ); +/* GLX_EXT_get_proc_address */ +extern GLfunction glXGetProcAddressEXT(const GLubyte *procName); + /* * Mesa GLX Extensions diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 2704e35ad59..108c5570191 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1,4 +1,4 @@ -/* $Id: fakeglx.c,v 1.2 1999/09/03 11:53:33 keithw Exp $ */ +/* $Id: fakeglx.c,v 1.3 1999/09/11 11:35:11 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1472,3 +1472,29 @@ void Fake_glXDummyFunc( void ) (void) HPCR_DRGB; (void) kernel1; } + + +GLfunction Fake_glXGetProcAddress( const GLubyte *procName ) +{ + struct proc { + const char *name; + void *address; + }; + static struct proc procTable[] = { + { "glXGetProcAddressEXT", glXGetProcAddressEXT }, /* myself! */ + { "glXReleaseBuffersMESA", glXReleaseBuffersMESA }, + { "glXReleaseBuffersMESA", glXReleaseBuffersMESA }, + { "glXCopySubBufferMESA", glXCopySubBufferMESA }, + /* NOTE: GLX_SGI_video_sync not implemented in Mesa */ + { NULL, NULL } /* end of list token */ + }; + GLuint i; + + /* First, look for core library functions */ + for (i = 0; procTable[i].address; i++) { + if (strcmp((const char *) procName, procTable[i].name) == 0) + return (GLfunction) procTable[i].address; + } + + return NULL; +} diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index b65bada72b9..23b23b90cb4 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -1,4 +1,4 @@ -/* $Id: glxapi.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ +/* $Id: glxapi.c,v 1.2 1999/09/11 11:35:11 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -403,3 +403,14 @@ int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count) } #endif + + +#ifdef GLX_EXT_get_proc_address +GLfunction glXGetProcAddressEXT( const GLubyte *procName ) +{ +#ifdef REALGLX + return 0; /* XXX todo */ +#endif + return Fake_glXGetProcAddress( procName ); +} +#endif -- cgit v1.2.3 From f893f032faebd6c6f4be4f9de7c8181575bb247c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 11 Sep 1999 11:34:21 +0000 Subject: added GLU_EXT_get_proc_address --- include/GL/glu.h | 21 ++++++++++++++++++++- src/glu/mesa/glu.c | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 51 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index 1123705547b..a2dfbfaa845 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.2 1999/09/10 02:08:18 gareth Exp $ */ +/* $Id: glu.h,v 1.3 1999/09/11 11:34:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -23,6 +23,9 @@ /* * $Log: glu.h,v $ + * Revision 1.3 1999/09/11 11:34:21 brianp + * added GLU_EXT_get_proc_address + * * Revision 1.2 1999/09/10 02:08:18 gareth * Added GLU 1.3 tessellation (except winding rule code). * @@ -481,6 +484,22 @@ GLUAPI void GLAPIENTRY gluEndPolygon( GLUtesselator *tobj ); GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name ); + +/* + * GLU_EXT_get_proc_address extensions + */ + +#ifdef GL_EXT_get_proc_address +/* This extension requires GL_EXT_get_proc_address */ + +GLUAPI GLfunction GLAPIENTRY gluGetProcAddressEXT( const GLubyte *procName ); + +#define GLU_EXT_get_proc_address 1 + +#endif /* GL_EXT_get_proc_address */ + + + #if defined(__BEOS__) || defined(__QUICKDRAW__) #pragma export off #endif diff --git a/src/glu/mesa/glu.c b/src/glu/mesa/glu.c index e9037b7614d..9e0fb460309 100644 --- a/src/glu/mesa/glu.c +++ b/src/glu/mesa/glu.c @@ -1,4 +1,4 @@ -/* $Id: glu.c,v 1.3 1999/09/10 04:32:10 gareth Exp $ */ +/* $Id: glu.c,v 1.4 1999/09/11 11:36:26 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -23,6 +23,9 @@ /* * $Log: glu.c,v $ + * Revision 1.4 1999/09/11 11:36:26 brianp + * added GLU_EXT_get_proc_address + * * Revision 1.3 1999/09/10 04:32:10 gareth * Fixed triangle output, recovery process termination. * @@ -325,7 +328,7 @@ const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode ) const GLubyte* GLAPIENTRY gluGetString( GLenum name ) { - static char *extensions = "GL_EXT_abgr"; + static char *extensions = "GL_EXT_abgr GLU_EXT_get_proc_address"; static char *version = "1.1 Mesa 3.1"; switch (name) { @@ -338,3 +341,29 @@ const GLubyte* GLAPIENTRY gluGetString( GLenum name ) } } + + +#ifdef GLU_EXT_get_proc_address + +GLfunction GLAPIENTRY gluGetProcAddressEXT( const GLubyte *procName ) +{ + struct proc { + const char *name; + void *address; + }; + static struct proc procTable[] = { + { "gluGetProcAddressEXT", (void *) gluGetProcAddressEXT }, /* myself! */ + { NULL, NULL } + }; + GLuint i; + + for (i = 0; procTable[i].address; i++) { + if (strcmp((const char *) procName, procTable[i].name) == 0) + return (GLfunction) procTable[i].address; + } + + return NULL; +} + +#endif + -- cgit v1.2.3 From 32c658b057c9f3af2c2d459fa3b0b1485aea5b05 Mon Sep 17 00:00:00 2001 From: Gareth Hughes Date: Tue, 14 Sep 1999 01:32:58 +0000 Subject: Fixed definition of GLUtriangluatorObj for 1.3 tessellator. --- include/GL/glu.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index a2dfbfaa845..7e52b5b8ba4 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.3 1999/09/11 11:34:21 brianp Exp $ */ +/* $Id: glu.h,v 1.4 1999/09/14 01:32:58 gareth Exp $ */ /* * Mesa 3-D graphics library @@ -23,6 +23,9 @@ /* * $Log: glu.h,v $ + * Revision 1.4 1999/09/14 01:32:58 gareth + * Fixed definition of GLUtriangluatorObj for 1.3 tessellator. + * * Revision 1.3 1999/09/11 11:34:21 brianp * added GLU_EXT_get_proc_address * @@ -253,6 +256,7 @@ enum { /* FIXME: We need to implement the other 1.3 typedefs - GH */ typedef struct GLUtesselator GLUtesselator; + typedef GLUtesselator GLUtriangluatorObj; #endif -- cgit v1.2.3 From 49e0bc42e2328c81265707404e2321c3cd88e150 Mon Sep 17 00:00:00 2001 From: Gareth Hughes Date: Tue, 14 Sep 1999 03:23:08 +0000 Subject: Fixed GLUtriangulatorObj again (spelling). --- include/GL/glu.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index 7e52b5b8ba4..b7d94ba4d7e 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.4 1999/09/14 01:32:58 gareth Exp $ */ +/* $Id: glu.h,v 1.5 1999/09/14 03:23:08 gareth Exp $ */ /* * Mesa 3-D graphics library @@ -23,6 +23,9 @@ /* * $Log: glu.h,v $ + * Revision 1.5 1999/09/14 03:23:08 gareth + * Fixed GLUtriangulatorObj again (spelling). + * * Revision 1.4 1999/09/14 01:32:58 gareth * Fixed definition of GLUtriangluatorObj for 1.3 tessellator. * @@ -256,7 +259,7 @@ enum { /* FIXME: We need to implement the other 1.3 typedefs - GH */ typedef struct GLUtesselator GLUtesselator; - typedef GLUtesselator GLUtriangluatorObj; + typedef GLUtesselator GLUtriangulatorObj; #endif -- cgit v1.2.3 From 43c9c2cfae458cf0d7618af5f25d57c0a5ebae08 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 16 Sep 1999 15:52:51 +0000 Subject: added GLX_MESA_set_3dfx_mode. clean-up of glXGetProcAddress --- include/GL/glx.h | 37 ++++++++++++++++------------ src/mesa/drivers/x11/fakeglx.c | 55 ++++++++++++++++++++++++++++++------------ src/mesa/drivers/x11/glxapi.c | 23 +++++++++++++++--- 3 files changed, 80 insertions(+), 35 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 4163fe28579..e7576e741c3 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.2 1999/09/11 11:33:45 brianp Exp $ */ +/* $Id: glx.h,v 1.3 1999/09/16 15:52:51 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -27,6 +27,9 @@ /* * $Log: glx.h,v $ + * Revision 1.3 1999/09/16 15:52:51 brianp + * added GLX_MESA_set_3dfx_mode. clean-up of glXGetProcAddress + * * Revision 1.2 1999/09/11 11:33:45 brianp * added GLX_EXT_get_proc_address * @@ -158,11 +161,12 @@ enum _GLX_CONFIGS { * Compile-time extension tests */ #define GLX_EXT_visual_info 1 +#define GLX_EXT_get_proc_address 1 #define GLX_MESA_pixmap_colormap 1 #define GLX_MESA_release_buffers 1 #define GLX_MESA_copy_sub_buffer 1 +#define GLX_MESA_set_3dfx_mode 1 #define GLX_SGI_video_sync 1 -#define GLX_EXT_get_proc_address 1 @@ -229,33 +233,36 @@ extern const char *glXQueryServerString( Display *dpy, int screen, int name ); extern const char *glXGetClientString( Display *dpy, int name ); -/* GLX_EXT_get_proc_address */ -extern GLfunction glXGetProcAddressEXT(const GLubyte *procName); - -/* - * Mesa GLX Extensions +/* GLX_EXT_get_proc_address */ +/* WARNING: this extension is not finalized yet! Do not release code + * which uses this extension yet! It may change! */ +extern void (*glXGetProcAddressEXT(const GLubyte *procName))(); -#ifdef GLX_MESA_pixmap_colormap + +/* GLX_MESA_pixmap_colormap */ extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap ); -#endif -#ifdef GLX_MESA_release_buffers + +/* GLX_MESA_release_buffers */ extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d ); -#endif -#ifdef GLX_MESA_copy_sub_buffer + +/* GLX_MESA_copy_sub_buffer */ extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable, int x, int y, int width, int height ); -#endif -#ifdef GLX_SGI_video_sync + +/* GLX_MESA_set_3dfx_mode */ +extern GLboolean glXSet3DfxModeMESA( GLint mode ); + + +/* GLX_SGI_video_sync */ extern int glXGetVideoSyncSGI(unsigned int *count); extern int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count); -#endif diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 87a9dd1b71e..716e0599b98 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1,4 +1,4 @@ -/* $Id: fakeglx.c,v 1.6 1999/09/15 20:04:04 brianp Exp $ */ +/* $Id: fakeglx.c,v 1.7 1999/09/16 15:53:51 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -65,6 +65,17 @@ +/* Silence compiler warnings */ +void Fake_glXDummyFunc( void ) +{ + (void) kernel8; + (void) DitherValues; + (void) HPCR_DRGB; + (void) kernel1; +} + + + #define DONT_CARE -1 @@ -1387,17 +1398,28 @@ void Fake_glXWaitX( void ) } +/* + * Return the extensions string, which is 3Dfx-dependant. + */ +static const char *get_extensions( void ) +{ +#ifdef FX + const char *fx = getenv("MESA_GLX_FX"); + if (fx && fx[0] != 'd') { + return "GLX_MESA_pixmap_colormap GLX_EXT_visual_info GLX_MESA_release_buffers GLX_MESA_copy_sub_buffer GLX_SGI_video_sync GLX_MESA_set_3dfx_mode"; + } +#endif + return "GLX_MESA_pixmap_colormap GLX_EXT_visual_info GLX_MESA_release_buffers GLX_MESA_copy_sub_buffer GLX_SGI_video_sync"; +} -#define EXTENSIONS "GLX_MESA_pixmap_colormap GLX_EXT_visual_info GLX_MESA_release_buffers GLX_MESA_copy_sub_buffer GLX_SGI_video_sync" /* GLX 1.1 and later */ const char *Fake_glXQueryExtensionsString( Display *dpy, int screen ) { - static char *extensions = EXTENSIONS; (void) dpy; (void) screen; - return extensions; + return get_extensions(); } @@ -1405,7 +1427,6 @@ const char *Fake_glXQueryExtensionsString( Display *dpy, int screen ) /* GLX 1.1 and later */ const char *Fake_glXQueryServerString( Display *dpy, int screen, int name ) { - static char *extensions = EXTENSIONS; static char *vendor = "Brian Paul"; static char *version = "1.1 Mesa 3.1"; @@ -1414,7 +1435,7 @@ const char *Fake_glXQueryServerString( Display *dpy, int screen, int name ) switch (name) { case GLX_EXTENSIONS: - return extensions; + return get_extensions(); case GLX_VENDOR: return vendor; case GLX_VERSION: @@ -1429,7 +1450,6 @@ const char *Fake_glXQueryServerString( Display *dpy, int screen, int name ) /* GLX 1.1 and later */ const char *Fake_glXGetClientString( Display *dpy, int name ) { - static char *extensions = EXTENSIONS; static char *vendor = "Brian Paul"; static char *version = "1.1 Mesa 3.1"; @@ -1437,7 +1457,7 @@ const char *Fake_glXGetClientString( Display *dpy, int name ) switch (name) { case GLX_EXTENSIONS: - return extensions; + return get_extensions(); case GLX_VENDOR: return vendor; case GLX_VERSION: @@ -1464,19 +1484,21 @@ Bool Fake_glXReleaseBuffersMESA( Display *dpy, GLXDrawable d ) } -/* Silence compiler warnings */ -void Fake_glXDummyFunc( void ) +/* + * GLX_MESA_set_3dfx_mode + */ +GLboolean Fake_glXSet3DfxModeMESA( GLint mode ) { - (void) kernel8; - (void) DitherValues; - (void) HPCR_DRGB; - (void) kernel1; + return XMesaSetFXmode( mode ); } -GLfunction Fake_glXGetProcAddress( const GLubyte *procName ) + +/*GLfunction Fake_glXGetProcAddress( const GLubyte *procName )*/ +void (*Fake_glXGetProcAddress( const GLubyte *procName ))() { - struct proc { + typedef void (*GLfunction)(); + struct proc { const char *name; GLfunction address; }; @@ -1485,6 +1507,7 @@ GLfunction Fake_glXGetProcAddress( const GLubyte *procName ) { "glXCreateGLXPixmapMESA", (GLfunction) glXCreateGLXPixmapMESA }, { "glXReleaseBuffersMESA", (GLfunction) glXReleaseBuffersMESA }, { "glXCopySubBufferMESA", (GLfunction) glXCopySubBufferMESA }, + { "glXSet3DfxModeMESA", (GLfunction) glXSet3DfxModeMESA }, /* NOTE: GLX_SGI_video_sync not implemented in Mesa */ { NULL, NULL } /* end of list token */ }; diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index 23b23b90cb4..dba92aa04dc 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -1,4 +1,4 @@ -/* $Id: glxapi.c,v 1.2 1999/09/11 11:35:11 brianp Exp $ */ +/* $Id: glxapi.c,v 1.3 1999/09/16 15:54:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -405,12 +405,27 @@ int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count) #endif -#ifdef GLX_EXT_get_proc_address -GLfunction glXGetProcAddressEXT( const GLubyte *procName ) + +#ifdef GLX_MESA_set_3dfx_mode +GLboolean glXSet3DfxModeMESA( GLint mode ) { #ifdef REALGLX - return 0; /* XXX todo */ + return GL_FALSE; +#else + return Fake_glXSet3DfxModeMESA( mode ); #endif +} +#endif + + + +#ifdef GLX_EXT_get_proc_address +void (*glXGetProcAddressEXT( const GLubyte *procName ))() +{ +#ifdef REALGLX + return NULL; +#else return Fake_glXGetProcAddress( procName ); +#endif } #endif -- cgit v1.2.3 From dd4f70889464c9db132d75b3ab3cd3dbbdb9d3f2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 16 Sep 1999 16:47:35 +0000 Subject: GL_EXT_get_proc_address clean-up --- include/GL/gl.h | 18 ++++++++++++------ src/mesa/main/extensions.c | 10 +++++----- 2 files changed, 17 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 23aa596d377..a2c42ca6a87 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.2 1999/09/11 11:26:34 brianp Exp $ */ +/* $Id: gl.h,v 1.3 1999/09/16 16:48:27 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2187,10 +2187,17 @@ GLAPI void GLAPIENTRY glLockArraysEXT( GLint first, GLsizei count ); GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); -/* GL_EXT_get_proc_address */ -typedef void (*GLfunction)(); -GLAPI GLfunction GLAPIENTRY glGetProcAddressEXT( const GLubyte *procName ); - +/* + * GL_EXT_get_proc_address + * + * XXX this is a preliminary extension. It may change! Use at your + * own risk! Do not release code which uses this extension yet! + * If you want to try it out, #define GL_EXT_get_proc_address before + * #include + */ +#ifdef GL_EXT_get_proc_address +GLAPI void GLAPIENTRY (*glGetProcAddressEXT(const GLubyte *procName))(); +#endif #if defined(__BEOS__) || defined(__QUICKDRAW__) @@ -2224,7 +2231,6 @@ GLAPI GLfunction GLAPIENTRY glGetProcAddressEXT( const GLubyte *procName ); #define GL_PGI_misc_hints 1 #define GL_EXT_compiled_vertex_array 1 #define GL_EXT_clip_volume_hint 1 -#define GL_EXT_get_proc_address 1 #ifdef macintosh diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 606a75c1df5..3130caccf85 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -1,4 +1,4 @@ -/* $Id: extensions.c,v 1.3 1999/09/11 11:48:11 brianp Exp $ */ +/* $Id: extensions.c,v 1.4 1999/09/16 16:47:35 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -203,8 +203,7 @@ const char *gl_extensions_get_string( GLcontext *ctx ) * NOTE: this function could be optimized to binary search a sorted * list of function names. * Also, this function does not yet do per-context function searches. - * But since the client must also call glGetString(GL_EXTENSIONS) to - * test for the extension this isn't a big deal. + * Not applicable to Mesa at this time. */ GLfunction gl_GetProcAddress( GLcontext *ctx, const GLubyte *procName ) { @@ -213,8 +212,9 @@ GLfunction gl_GetProcAddress( GLcontext *ctx, const GLubyte *procName ) GLfunction address; }; static struct proc procTable[] = { +#ifdef GL_EXT_get_proc_address { "glGetProcAddressEXT", (GLfunction) glGetProcAddressEXT }, /* me! */ - +#endif /* OpenGL 1.1 functions */ { "glEnableClientState", (GLfunction) glEnableClientState }, { "glDisableClientState", (GLfunction) glDisableClientState }, @@ -377,7 +377,7 @@ GLfunction gl_GetProcAddress( GLcontext *ctx, const GLubyte *procName ) for (i = 0; procTable[i].address; i++) { if (strcmp((const char *) procName, procTable[i].name) == 0) - return procTable[i].address; + return procTable[i].address; } return NULL; -- cgit v1.2.3 From 1447677fa4cf18ceeae76c28b23f02eb966cfb71 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 16 Sep 1999 16:54:22 +0000 Subject: GLU_EXT_get_proc_address clean-up --- include/GL/glu.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index b7d94ba4d7e..3ed121f69cc 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.5 1999/09/14 03:23:08 gareth Exp $ */ +/* $Id: glu.h,v 1.6 1999/09/16 16:54:22 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -23,6 +23,9 @@ /* * $Log: glu.h,v $ + * Revision 1.6 1999/09/16 16:54:22 brianp + * GLU_EXT_get_proc_address clean-up + * * Revision 1.5 1999/09/14 03:23:08 gareth * Fixed GLUtriangulatorObj again (spelling). * @@ -493,17 +496,15 @@ GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name ); /* - * GLU_EXT_get_proc_address extensions + * GLU_EXT_get_proc_address extension + */ +/* + * WARNING: this extension is not finalized yet! Do not release code + * which uses this extension yet! It may change! */ - -#ifdef GL_EXT_get_proc_address -/* This extension requires GL_EXT_get_proc_address */ - -GLUAPI GLfunction GLAPIENTRY gluGetProcAddressEXT( const GLubyte *procName ); - #define GLU_EXT_get_proc_address 1 +GLUAPI void GLAPIENTRY (*gluGetProcAddressEXT(const GLubyte *procName))(); -#endif /* GL_EXT_get_proc_address */ -- cgit v1.2.3 From 3849b44d666482a14aac41f4e19a596c420cfa80 Mon Sep 17 00:00:00 2001 From: Ted Jump Date: Fri, 17 Sep 1999 02:44:19 +0000 Subject: I changed the xxxGetProcAddressEXT function declarations to be more MSVC friendly. Brianp - could you verify that they describe and operate as intended on Linux/ETC platforms? --- include/GL/gl.h | 5 +++-- include/GL/glu.h | 10 ++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index a2c42ca6a87..202a7e91127 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.3 1999/09/16 16:48:27 brianp Exp $ */ +/* $Id: gl.h,v 1.4 1999/09/17 02:44:19 tjump Exp $ */ /* * Mesa 3-D graphics library @@ -2196,7 +2196,8 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); * #include */ #ifdef GL_EXT_get_proc_address -GLAPI void GLAPIENTRY (*glGetProcAddressEXT(const GLubyte *procName))(); +typedef (void (GLAPIENTRY *glProcAddress))(); +glProcAddress GLAPIENTRY glGetProcAddressEXT(const GLubyte *procName); #endif diff --git a/include/GL/glu.h b/include/GL/glu.h index 3ed121f69cc..43727bcce02 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.6 1999/09/16 16:54:22 brianp Exp $ */ +/* $Id: glu.h,v 1.7 1999/09/17 02:44:19 tjump Exp $ */ /* * Mesa 3-D graphics library @@ -23,6 +23,11 @@ /* * $Log: glu.h,v $ + * Revision 1.7 1999/09/17 02:44:19 tjump + * I changed the xxxGetProcAddressEXT function declarations to be more + * MSVC friendly. Brianp - could you verify that they describe and operate + * as intended on Linux/ETC platforms? + * * Revision 1.6 1999/09/16 16:54:22 brianp * GLU_EXT_get_proc_address clean-up * @@ -503,7 +508,8 @@ GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name ); * which uses this extension yet! It may change! */ #define GLU_EXT_get_proc_address 1 -GLUAPI void GLAPIENTRY (*gluGetProcAddressEXT(const GLubyte *procName))(); +typedef (GLAPIENTRY *gluProcAddress)(); +gluProcAddress GLAPIENTRY gluGetProcAddressEXT(const GLubyte *procName); -- cgit v1.2.3 From 5eea3d068f0f5f3baa29157fc8dedc54acd06332 Mon Sep 17 00:00:00 2001 From: Ted Jump Date: Fri, 17 Sep 1999 04:25:10 +0000 Subject: wgl function prototypes moved out to better work with fxwgl --- include/GL/mesa_wgl.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 include/GL/mesa_wgl.h (limited to 'include') diff --git a/include/GL/mesa_wgl.h b/include/GL/mesa_wgl.h new file mode 100644 index 00000000000..afa70d2c62f --- /dev/null +++ b/include/GL/mesa_wgl.h @@ -0,0 +1,33 @@ +/* prototypes for the Mesa WGL functions */ +/* relocated here so that I could make GLUT get them properly */ + +#ifndef GL_H +#include +#endif + +WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC); +WGLAPI int GLAPIENTRY wglMakeCurrent(HDC,HGLRC); +WGLAPI int GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *); +WGLAPI int GLAPIENTRY wglSwapBuffers(HDC hdc); +WGLAPI HDC GLAPIENTRY wglGetCurrentDC(void); +WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC); +WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int); +WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void); +WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*); +WGLAPI int GLAPIENTRY SwapBuffers(HDC); +WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *); +WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int); +WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC); +WGLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR); +WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR); +WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *); +WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc); +WGLAPI int GLAPIENTRY wglMakeCurrent(HDC, HGLRC); +WGLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int); +WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *); +WGLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC); +WGLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int); +WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long); +WGLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long); +WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT); +WGLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT); -- cgit v1.2.3 From 6799ecb6753f2ec5b1b66c9e8c447bc82035f94c Mon Sep 17 00:00:00 2001 From: Ted Jump Date: Fri, 17 Sep 1999 04:25:56 +0000 Subject: Relocated wgl function prototypes to separate .h for easier work with fxwgl & glut --- include/GL/gl.h | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 202a7e91127..e45acbc066f 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.4 1999/09/17 02:44:19 tjump Exp $ */ +/* $Id: gl.h,v 1.5 1999/09/17 04:25:56 tjump Exp $ */ /* * Mesa 3-D graphics library @@ -57,10 +57,13 @@ # pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ # if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ # define GLAPI __declspec(dllexport) +# define WGLAPI __declspec(dllexport) # elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ # define GLAPI __declspec(dllimport) +# define WGLAPI __declspec(dllimport) # else /* for use with static link lib build of Win32 edition only */ # define GLAPI extern +# define WGLAPI __declspec(dllimport) # endif /* _STATIC_MESA support */ # define GLAPIENTRY __stdcall # define GLCALLBACK __stdcall @@ -107,25 +110,8 @@ typedef unsigned long COLORREF; # endif /* !UNICODE */ typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR; typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT; -GLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int); -GLAPI HGLRC GLAPIENTRY wglCreateContext(HDC); -GLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC, int); -GLAPI int GLAPIENTRY wglDeleteContext(HGLRC); -GLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void); -GLAPI HDC GLAPIENTRY wglGetCurrentDC(void); -GLAPI PROC GLAPIENTRY wglGetProcAddress(char*); -GLAPI int GLAPIENTRY wglMakeCurrent(HDC, HGLRC); -GLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC); -GLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long); -GLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long); -GLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT); -GLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT); -GLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR); -GLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *); -GLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *); -GLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int); -GLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int); -GLAPI int GLAPIENTRY SwapBuffers(HDC); +typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR; +#include #endif -- cgit v1.2.3 From 1bf28c46c2d4d3f2d0a502e45abfa66d37afe733 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 17 Sep 1999 12:21:36 +0000 Subject: glGetProcAddressEXT changes to accomodate Win32 and non-Win32 --- include/GL/gl.h | 12 +++++++++--- include/GL/glu.h | 14 ++++++++++---- src/glu/mesa/glu.c | 17 +++++++++++++---- 3 files changed, 32 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index e45acbc066f..ff67f263a31 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.5 1999/09/17 04:25:56 tjump Exp $ */ +/* $Id: gl.h,v 1.6 1999/09/17 12:21:36 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2181,9 +2181,15 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); * If you want to try it out, #define GL_EXT_get_proc_address before * #include */ +#define GL_EXT_get_proc_address 1 #ifdef GL_EXT_get_proc_address -typedef (void (GLAPIENTRY *glProcAddress))(); -glProcAddress GLAPIENTRY glGetProcAddressEXT(const GLubyte *procName); +#ifdef __WIN32__ + typedef (void GLAPIENTRY *glProcAddress)(); + glProcAddress GLAPIENTRY glGetProcAddressEXT(const GLubyte *procName); +#else + /* everything but Windows */ + GLAPI void GLAPIENTRY (*glGetProcAddressEXT(const GLubyte *procName))(); +#endif #endif diff --git a/include/GL/glu.h b/include/GL/glu.h index 43727bcce02..01d630ef8b1 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.7 1999/09/17 02:44:19 tjump Exp $ */ +/* $Id: glu.h,v 1.8 1999/09/17 12:21:36 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -23,6 +23,9 @@ /* * $Log: glu.h,v $ + * Revision 1.8 1999/09/17 12:21:36 brianp + * glGetProcAddressEXT changes to accomodate Win32 and non-Win32 + * * Revision 1.7 1999/09/17 02:44:19 tjump * I changed the xxxGetProcAddressEXT function declarations to be more * MSVC friendly. Brianp - could you verify that they describe and operate @@ -508,9 +511,12 @@ GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name ); * which uses this extension yet! It may change! */ #define GLU_EXT_get_proc_address 1 -typedef (GLAPIENTRY *gluProcAddress)(); -gluProcAddress GLAPIENTRY gluGetProcAddressEXT(const GLubyte *procName); - +#ifdef __WIN32__ + typedef (void (GLAPIENTRY *gluProcAddress))(); + gluProcAddress GLAPIENTRY gluGetProcAddressEXT(const GLubyte *procName); +#else + GLUAPI void GLAPIENTRY (*gluGetProcAddressEXT(const GLubyte *procName))(); +#endif diff --git a/src/glu/mesa/glu.c b/src/glu/mesa/glu.c index 110e267aa8f..e844633906f 100644 --- a/src/glu/mesa/glu.c +++ b/src/glu/mesa/glu.c @@ -1,4 +1,4 @@ -/* $Id: glu.c,v 1.13 1999/09/17 03:17:18 tjump Exp $ */ +/* $Id: glu.c,v 1.14 1999/09/17 12:21:53 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -23,6 +23,9 @@ /* * $Log: glu.c,v $ + * Revision 1.14 1999/09/17 12:21:53 brianp + * glGetProcAddressEXT changes to accomodate Win32 and non-Win32 + * * Revision 1.13 1999/09/17 03:17:18 tjump * Patch error fixup * @@ -376,10 +379,12 @@ const GLubyte* GLAPIENTRY gluGetString( GLenum name ) #ifdef GLU_EXT_get_proc_address #ifdef __cplusplus -/* for BeOS R4.5 */ -gluProcAddress GLAPIENTRY gluGetProcAddressEXT(const GLubyte *procName) + /* for BeOS R4.5 */ + void GLAPIENTRY (*gluGetProcAddressEXT(const GLubyte *procName))(...) +#elif defined(__WIN32__) + gluProcAddress GLAPIENTRY gluGetProcAddressEXT(const GLubyte *procName) #else -gluProcAddress GLAPIENTRY gluGetProcAddressEXT(const GLubyte *procName) + void GLAPIENTRY (*gluGetProcAddressEXT(const GLubyte *procName))() #endif { struct proc { @@ -407,7 +412,11 @@ gluProcAddress GLAPIENTRY gluGetProcAddressEXT(const GLubyte *procName) for (i = 0; procTable[i].address; i++) { if (strcmp((const char *) procName, procTable[i].name) == 0) +#ifdef __WIN32__ return (gluProcAddress) procTable[i].address; +#else + return (void (*)()) procTable[i].address; +#endif } return NULL; -- cgit v1.2.3 From 56b58668e86e6156555e36050df14b49faa14f31 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 18 Sep 1999 01:06:52 +0000 Subject: disabled GL_EXT_get_proc_address for the time being --- include/GL/gl.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index ff67f263a31..02b12393894 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.6 1999/09/17 12:21:36 brianp Exp $ */ +/* $Id: gl.h,v 1.7 1999/09/18 01:06:52 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2181,7 +2181,6 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); * If you want to try it out, #define GL_EXT_get_proc_address before * #include */ -#define GL_EXT_get_proc_address 1 #ifdef GL_EXT_get_proc_address #ifdef __WIN32__ typedef (void GLAPIENTRY *glProcAddress)(); -- cgit v1.2.3 From 725ec81ae80e024df4a5490405dbfbc598533e6e Mon Sep 17 00:00:00 2001 From: Ted Jump Date: Sun, 19 Sep 1999 02:03:18 +0000 Subject: More Win32 build compliance fixups --- include/GL/gl.h | 12 +++--------- include/GL/glu.h | 13 ++++++------- progs/redbook/image.c | 2 +- progs/samples/overlay.c | 2 +- src/glu/mesa/glu.c | 15 ++++++--------- src/mesa/main/feedback.c | 7 ++++--- src/mesa/main/stencil.c | 3 ++- 7 files changed, 23 insertions(+), 31 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 02b12393894..8c00484d58f 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.7 1999/09/18 01:06:52 brianp Exp $ */ +/* $Id: gl.h,v 1.8 1999/09/19 02:03:18 tjump Exp $ */ /* * Mesa 3-D graphics library @@ -2181,17 +2181,11 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); * If you want to try it out, #define GL_EXT_get_proc_address before * #include */ +#define GL_EXT_get_proc_address 1 #ifdef GL_EXT_get_proc_address -#ifdef __WIN32__ - typedef (void GLAPIENTRY *glProcAddress)(); - glProcAddress GLAPIENTRY glGetProcAddressEXT(const GLubyte *procName); -#else - /* everything but Windows */ - GLAPI void GLAPIENTRY (*glGetProcAddressEXT(const GLubyte *procName))(); -#endif +GLAPI void (GLAPIENTRY *glGetProcAddressEXT(const GLubyte *procName))(); #endif - #if defined(__BEOS__) || defined(__QUICKDRAW__) #pragma export off #endif diff --git a/include/GL/glu.h b/include/GL/glu.h index 01d630ef8b1..6861a171908 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.8 1999/09/17 12:21:36 brianp Exp $ */ +/* $Id: glu.h,v 1.9 1999/09/19 02:03:18 tjump Exp $ */ /* * Mesa 3-D graphics library @@ -23,6 +23,9 @@ /* * $Log: glu.h,v $ + * Revision 1.9 1999/09/19 02:03:18 tjump + * More Win32 build compliance fixups + * * Revision 1.8 1999/09/17 12:21:36 brianp * glGetProcAddressEXT changes to accomodate Win32 and non-Win32 * @@ -511,15 +514,11 @@ GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name ); * which uses this extension yet! It may change! */ #define GLU_EXT_get_proc_address 1 -#ifdef __WIN32__ - typedef (void (GLAPIENTRY *gluProcAddress))(); - gluProcAddress GLAPIENTRY gluGetProcAddressEXT(const GLubyte *procName); -#else - GLUAPI void GLAPIENTRY (*gluGetProcAddressEXT(const GLubyte *procName))(); +#ifdef GLU_EXT_get_proc_address +GLUAPI void (GLAPIENTRY *glGetProcAddressEXT(const GLubyte *procName))(); #endif - #if defined(__BEOS__) || defined(__QUICKDRAW__) #pragma export off #endif diff --git a/progs/redbook/image.c b/progs/redbook/image.c index 8e62f5afd35..dc1a7246eba 100644 --- a/progs/redbook/image.c +++ b/progs/redbook/image.c @@ -64,7 +64,7 @@ void makeCheckImage(void) for (i = 0; i < checkImageHeight; i++) { for (j = 0; j < checkImageWidth; j++) { - c = ((((i&0x8)==0)^((j&0x8))==0))*255; + c = (((i&0x8)==0)^((j&0x8)==0))*255; checkImage[i][j][0] = (GLubyte) c; checkImage[i][j][1] = (GLubyte) c; checkImage[i][j][2] = (GLubyte) c; diff --git a/progs/samples/overlay.c b/progs/samples/overlay.c index 0def2b1105e..4542b49a0a7 100644 --- a/progs/samples/overlay.c +++ b/progs/samples/overlay.c @@ -347,7 +347,7 @@ int main(int argc, char **argv) if (!glutLayerGet(GLUT_OVERLAY_POSSIBLE)) { fprintf(stderr, "Overlay not available\n"); - return; + return(1); } if (Args(argc, argv) == GL_FALSE) { diff --git a/src/glu/mesa/glu.c b/src/glu/mesa/glu.c index e844633906f..1efc35cfd33 100644 --- a/src/glu/mesa/glu.c +++ b/src/glu/mesa/glu.c @@ -1,4 +1,4 @@ -/* $Id: glu.c,v 1.14 1999/09/17 12:21:53 brianp Exp $ */ +/* $Id: glu.c,v 1.15 1999/09/19 02:03:19 tjump Exp $ */ /* * Mesa 3-D graphics library @@ -23,6 +23,9 @@ /* * $Log: glu.c,v $ + * Revision 1.15 1999/09/19 02:03:19 tjump + * More Win32 build compliance fixups + * * Revision 1.14 1999/09/17 12:21:53 brianp * glGetProcAddressEXT changes to accomodate Win32 and non-Win32 * @@ -381,10 +384,8 @@ const GLubyte* GLAPIENTRY gluGetString( GLenum name ) #ifdef __cplusplus /* for BeOS R4.5 */ void GLAPIENTRY (*gluGetProcAddressEXT(const GLubyte *procName))(...) -#elif defined(__WIN32__) - gluProcAddress GLAPIENTRY gluGetProcAddressEXT(const GLubyte *procName) #else - void GLAPIENTRY (*gluGetProcAddressEXT(const GLubyte *procName))() + void (GLAPIENTRY *gluGetProcAddressEXT(const GLubyte *procName))() #endif { struct proc { @@ -412,11 +413,7 @@ const GLubyte* GLAPIENTRY gluGetString( GLenum name ) for (i = 0; procTable[i].address; i++) { if (strcmp((const char *) procName, procTable[i].name) == 0) -#ifdef __WIN32__ - return (gluProcAddress) procTable[i].address; -#else - return (void (*)()) procTable[i].address; -#endif + return (void (GLAPIENTRY *)()) procTable[i].address; } return NULL; diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c index 433d0391e88..0fb09d07563 100644 --- a/src/mesa/main/feedback.c +++ b/src/mesa/main/feedback.c @@ -1,4 +1,4 @@ -/* $Id: feedback.c,v 1.2 1999/09/18 20:41:23 keithw Exp $ */ +/* $Id: feedback.c,v 1.3 1999/09/19 02:03:19 tjump Exp $ */ /* * Mesa 3-D graphics library @@ -39,6 +39,7 @@ #include "macros.h" #include "mmath.h" #include "types.h" +#include "triangle.h" #ifdef XFree86Server #include "GL/xf86glx.h" #endif @@ -203,7 +204,7 @@ static void gl_do_feedback_vertex( GLcontext *ctx, GLuint v, GLuint pv ) void gl_feedback_triangle( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv ) { - if (gl_cull_triangle( ctx, v0, v1, v2 )) { + if (gl_cull_triangle( ctx, v0, v1, v2, 0 )) { FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_POLYGON_TOKEN ); FEEDBACK_TOKEN( ctx, (GLfloat) 3 ); /* three vertices */ @@ -294,7 +295,7 @@ void gl_select_triangle( GLcontext *ctx, { struct vertex_buffer *VB = ctx->VB; - if (gl_cull_triangle( ctx, v0, v1, v2 )) { + if (gl_cull_triangle( ctx, v0, v1, v2, 0 )) { gl_update_hitflag( ctx, VB->Win.data[v0][3] / DEPTH_SCALE ); gl_update_hitflag( ctx, VB->Win.data[v1][3] / DEPTH_SCALE ); gl_update_hitflag( ctx, VB->Win.data[v2][3] / DEPTH_SCALE ); diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c index f03303de585..8bcced1fe7b 100644 --- a/src/mesa/main/stencil.c +++ b/src/mesa/main/stencil.c @@ -1,4 +1,4 @@ -/* $Id: stencil.c,v 1.2 1999/09/18 20:41:23 keithw Exp $ */ +/* $Id: stencil.c,v 1.3 1999/09/19 02:03:19 tjump Exp $ */ /* * Mesa 3-D graphics library @@ -35,6 +35,7 @@ #include "pb.h" #include "stencil.h" #include "types.h" +#include "enable.h" #ifdef XFree86Server #include "GL/xf86glx.h" #endif -- cgit v1.2.3 From 01db31b67860f93b110733eb523d45e320a1c948 Mon Sep 17 00:00:00 2001 From: Ted Jump Date: Sun, 19 Sep 1999 10:04:01 +0000 Subject: Changed name 'glGetProcAddressEXT' to 'gluGetProcAddressEXT' --- include/GL/glu.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index 6861a171908..c400f9609b9 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.9 1999/09/19 02:03:18 tjump Exp $ */ +/* $Id: glu.h,v 1.10 1999/09/19 10:04:01 tjump Exp $ */ /* * Mesa 3-D graphics library @@ -23,8 +23,8 @@ /* * $Log: glu.h,v $ - * Revision 1.9 1999/09/19 02:03:18 tjump - * More Win32 build compliance fixups + * Revision 1.10 1999/09/19 10:04:01 tjump + * Changed name 'glGetProcAddressEXT' to 'gluGetProcAddressEXT' * * Revision 1.8 1999/09/17 12:21:36 brianp * glGetProcAddressEXT changes to accomodate Win32 and non-Win32 @@ -515,7 +515,7 @@ GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name ); */ #define GLU_EXT_get_proc_address 1 #ifdef GLU_EXT_get_proc_address -GLUAPI void (GLAPIENTRY *glGetProcAddressEXT(const GLubyte *procName))(); +GLUAPI void (GLAPIENTRY *gluGetProcAddressEXT(const GLubyte *procName))(); #endif -- cgit v1.2.3 From bc34adfc54369c216261548a2b251b258d64cd43 Mon Sep 17 00:00:00 2001 From: tanner Date: Sun, 19 Sep 1999 20:09:00 +0000 Subject: lots of autoconf updates --- docs/VERSIONS | 3 ++- include/GL/Makefile.am | 6 +++++- progs/demos/tessdemo.c | 12 ++++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/docs/VERSIONS b/docs/VERSIONS index 258a0fc5e3e..80f4010afac 100644 --- a/docs/VERSIONS +++ b/docs/VERSIONS @@ -1,4 +1,4 @@ -$Id: VERSIONS,v 1.12 1999/09/15 16:34:43 brianp Exp $ +$Id: VERSIONS,v 1.13 1999/09/19 20:09:00 tanner Exp $ Mesa Version History @@ -658,3 +658,4 @@ Mesa Version History - 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) diff --git a/include/GL/Makefile.am b/include/GL/Makefile.am index 61af039384a..16b4913e470 100644 --- a/include/GL/Makefile.am +++ b/include/GL/Makefile.am @@ -22,9 +22,13 @@ if HAVE_X11 INC_X11 = glx.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h endif +if NEED_GLUT +INC_GLUT = glut.h +endif + EXTRA_DIST = fxmesa.h ggimesa.h osmesa.h svgamesa.h \ glx.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h GLinclude_HEADERS = gl.h gl_mangle.h glu.h glu_mangle.h \ - $(INC_FX) $(INC_GGI) $(INC_OSMESA) $(INC_SVGA) $(INC_X11) + $(INC_FX) $(INC_GGI) $(INC_OSMESA) $(INC_SVGA) $(INC_X11) $(INC_GLUT) diff --git a/progs/demos/tessdemo.c b/progs/demos/tessdemo.c index 497b105a880..c0d0242b2e8 100644 --- a/progs/demos/tessdemo.c +++ b/progs/demos/tessdemo.c @@ -1,4 +1,4 @@ -/* $Id: tessdemo.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ +/* $Id: tessdemo.c,v 1.2 1999/09/19 20:09:00 tanner Exp $ */ /* * A demo of the GLU polygon tesselation functions written by Bogdan Sikorski. @@ -11,8 +11,12 @@ /* * $Log: tessdemo.c,v $ - * Revision 1.1 1999/08/19 00:55:40 jtg - * Initial revision + * Revision 1.2 1999/09/19 20:09:00 tanner + * + * lots of autoconf updates + * + * Revision 1.1.1.1 1999/08/19 00:55:40 jtg + * Imported sources * * Revision 3.5 1999/03/28 18:24:37 brianp * minor clean-up @@ -148,7 +152,7 @@ void set_screen_wh(GLsizei w, GLsizei h) void tesse(void) { - GLUtriangulatorObj *tobj; + GLUtesselator *tobj; GLdouble data[3]; GLuint i,j,point_cnt; -- cgit v1.2.3 From 251ba69ffc6f153f75bba075c9f23c53b2317e9c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 15 Oct 1999 21:59:23 +0000 Subject: replaced glGetMinMax() with glGetMinmax() --- include/GL/gl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 8c00484d58f..17ce5e5f17e 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.8 1999/09/19 02:03:18 tjump Exp $ */ +/* $Id: gl.h,v 1.9 1999/10/15 21:59:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2107,7 +2107,7 @@ GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat, GLAPI void GLAPIENTRY glResetMinmax( GLenum target ); -GLAPI void GLAPIENTRY glGetMinMax( GLenum target, GLboolean reset, +GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values ); -- cgit v1.2.3 From b80429e49ef62686792e2f95c8f52b5e6c8a59a9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 16 Oct 1999 11:27:02 +0000 Subject: removed GL_EXT_get_proc_address --- include/GL/gl.h | 14 +-- src/mesa/main/dlist.c | 5 +- src/mesa/main/extensions.c | 263 ++++++++++++++++++++++----------------------- src/mesa/main/extensions.h | 4 +- 4 files changed, 133 insertions(+), 153 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 17ce5e5f17e..97b8b002a99 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.9 1999/10/15 21:59:23 brianp Exp $ */ +/* $Id: gl.h,v 1.10 1999/10/16 11:27:02 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2173,18 +2173,6 @@ GLAPI void GLAPIENTRY glLockArraysEXT( GLint first, GLsizei count ); GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); -/* - * GL_EXT_get_proc_address - * - * XXX this is a preliminary extension. It may change! Use at your - * own risk! Do not release code which uses this extension yet! - * If you want to try it out, #define GL_EXT_get_proc_address before - * #include - */ -#define GL_EXT_get_proc_address 1 -#ifdef GL_EXT_get_proc_address -GLAPI void (GLAPIENTRY *glGetProcAddressEXT(const GLubyte *procName))(); -#endif #if defined(__BEOS__) || defined(__QUICKDRAW__) #pragma export off diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 15ca3d9a452..f69205c02e8 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -1,4 +1,4 @@ -/* $Id: dlist.c,v 1.9 1999/10/13 18:42:50 brianp Exp $ */ +/* $Id: dlist.c,v 1.10 1999/10/16 11:31:50 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -3344,9 +3344,6 @@ void gl_init_dlist_pointers( struct gl_api_table *table ) /* GL_ARB_multitexture */ table->ActiveTexture = save_ActiveTexture; table->ClientActiveTexture = save_ClientActiveTexture; - - /* GL_EXT_get_proc_address */ - table->GetProcAddress = gl_GetProcAddress; /* NOT SAVED */ } diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 377b22b7c06..b233d1483e0 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -1,4 +1,4 @@ -/* $Id: extensions.c,v 1.8 1999/10/13 22:09:09 tjump Exp $ */ +/* $Id: extensions.c,v 1.9 1999/10/16 11:30:31 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -69,7 +69,6 @@ static struct { int enabled; const char *name; } default_extensions[] = { { DEFAULT_ON, "GL_EXT_compiled_vertex_array" }, { DEFAULT_OFF, "GL_EXT_vertex_array_set" }, { DEFAULT_ON, "GL_EXT_clip_volume_hint" }, - { ALWAYS_ENABLED, "GL_EXT_get_proc_address" } }; @@ -201,181 +200,177 @@ const char *gl_extensions_get_string( GLcontext *ctx ) /* * Return the address of an extension function. + * This is meant to be called by glXGetProcAddress(), wglGetProcAddress(), + * or similar function. * NOTE: this function could be optimized to binary search a sorted * list of function names. - * Also, this function does not yet do per-context function searches. - * Not applicable to Mesa at this time. */ -void (* gl_GetProcAddress( GLcontext *ctx, const GLubyte *procName ))() +void (*gl_get_proc_address( const GLubyte *procName ))() { + typedef void (*gl_function)(); struct proc { const char *name; - GLfunction address; + gl_function address; }; static struct proc procTable[] = { -#ifdef GL_EXT_get_proc_address - { "glGetProcAddressEXT", (GLfunction) glGetProcAddressEXT }, /* me! */ -#endif /* OpenGL 1.1 functions */ - { "glEnableClientState", (GLfunction) glEnableClientState }, - { "glDisableClientState", (GLfunction) glDisableClientState }, - { "glPushClientAttrib", (GLfunction) glPushClientAttrib }, - { "glPopClientAttrib", (GLfunction) glPopClientAttrib }, - { "glIndexub", (GLfunction) glIndexub }, - { "glIndexubv", (GLfunction) glIndexubv }, - { "glVertexPointer", (GLfunction) glVertexPointer }, - { "glNormalPointer", (GLfunction) glNormalPointer }, - { "glColorPointer", (GLfunction) glColorPointer }, - { "glIndexPointer", (GLfunction) glIndexPointer }, - { "glTexCoordPointer", (GLfunction) glTexCoordPointer }, - { "glEdgeFlagPointer", (GLfunction) glEdgeFlagPointer }, - { "glGetPointerv", (GLfunction) glGetPointerv }, - { "glArrayElement", (GLfunction) glArrayElement }, - { "glDrawArrays", (GLfunction) glDrawArrays }, - { "glDrawElements", (GLfunction) glDrawElements }, - { "glInterleavedArrays", (GLfunction) glInterleavedArrays }, - { "glGenTextures", (GLfunction) glGenTextures }, - { "glDeleteTextures", (GLfunction) glDeleteTextures }, - { "glBindTexture", (GLfunction) glBindTexture }, - { "glPrioritizeTextures", (GLfunction) glPrioritizeTextures }, - { "glAreTexturesResident", (GLfunction) glAreTexturesResident }, - { "glIsTexture", (GLfunction) glIsTexture }, - { "glTexSubImage1D", (GLfunction) glTexSubImage1D }, - { "glTexSubImage2D", (GLfunction) glTexSubImage2D }, - { "glCopyTexImage1D", (GLfunction) glCopyTexImage1D }, - { "glCopyTexImage2D", (GLfunction) glCopyTexImage2D }, - { "glCopyTexSubImage1D", (GLfunction) glCopyTexSubImage1D }, - { "glCopyTexSubImage2D", (GLfunction) glCopyTexSubImage2D }, + { "glEnableClientState", (gl_function) glEnableClientState }, + { "glDisableClientState", (gl_function) glDisableClientState }, + { "glPushClientAttrib", (gl_function) glPushClientAttrib }, + { "glPopClientAttrib", (gl_function) glPopClientAttrib }, + { "glIndexub", (gl_function) glIndexub }, + { "glIndexubv", (gl_function) glIndexubv }, + { "glVertexPointer", (gl_function) glVertexPointer }, + { "glNormalPointer", (gl_function) glNormalPointer }, + { "glColorPointer", (gl_function) glColorPointer }, + { "glIndexPointer", (gl_function) glIndexPointer }, + { "glTexCoordPointer", (gl_function) glTexCoordPointer }, + { "glEdgeFlagPointer", (gl_function) glEdgeFlagPointer }, + { "glGetPointerv", (gl_function) glGetPointerv }, + { "glArrayElement", (gl_function) glArrayElement }, + { "glDrawArrays", (gl_function) glDrawArrays }, + { "glDrawElements", (gl_function) glDrawElements }, + { "glInterleavedArrays", (gl_function) glInterleavedArrays }, + { "glGenTextures", (gl_function) glGenTextures }, + { "glDeleteTextures", (gl_function) glDeleteTextures }, + { "glBindTexture", (gl_function) glBindTexture }, + { "glPrioritizeTextures", (gl_function) glPrioritizeTextures }, + { "glAreTexturesResident", (gl_function) glAreTexturesResident }, + { "glIsTexture", (gl_function) glIsTexture }, + { "glTexSubImage1D", (gl_function) glTexSubImage1D }, + { "glTexSubImage2D", (gl_function) glTexSubImage2D }, + { "glCopyTexImage1D", (gl_function) glCopyTexImage1D }, + { "glCopyTexImage2D", (gl_function) glCopyTexImage2D }, + { "glCopyTexSubImage1D", (gl_function) glCopyTexSubImage1D }, + { "glCopyTexSubImage2D", (gl_function) glCopyTexSubImage2D }, /* OpenGL 1.2 functions */ - { "glDrawRangeElements", (GLfunction) glDrawRangeElements }, - { "glTexImage3D", (GLfunction) glTexImage3D }, - { "glTexSubImage3D", (GLfunction) glTexSubImage3D }, - { "glCopyTexSubImage3D", (GLfunction) glCopyTexSubImage3D }, + { "glDrawRangeElements", (gl_function) glDrawRangeElements }, + { "glTexImage3D", (gl_function) glTexImage3D }, + { "glTexSubImage3D", (gl_function) glTexSubImage3D }, + { "glCopyTexSubImage3D", (gl_function) glCopyTexSubImage3D }, /* NOTE: 1.2 imaging subset functions not implemented in Mesa */ /* GL_EXT_blend_minmax */ - { "glBlendEquationEXT", (GLfunction) glBlendEquationEXT }, + { "glBlendEquationEXT", (gl_function) glBlendEquationEXT }, /* GL_EXT_blend_color */ - { "glBlendColorEXT", (GLfunction) glBlendColorEXT }, + { "glBlendColorEXT", (gl_function) glBlendColorEXT }, /* GL_EXT_polygon_offset */ - { "glPolygonOffsetEXT", (GLfunction) glPolygonOffsetEXT }, + { "glPolygonOffsetEXT", (gl_function) glPolygonOffsetEXT }, /* GL_EXT_vertex_arrays */ - { "glVertexPointerEXT", (GLfunction) glVertexPointerEXT }, - { "glNormalPointerEXT", (GLfunction) glNormalPointerEXT }, - { "glColorPointerEXT", (GLfunction) glColorPointerEXT }, - { "glIndexPointerEXT", (GLfunction) glIndexPointerEXT }, - { "glTexCoordPointerEXT", (GLfunction) glTexCoordPointerEXT }, - { "glEdgeFlagPointerEXT", (GLfunction) glEdgeFlagPointerEXT }, - { "glGetPointervEXT", (GLfunction) glGetPointervEXT }, - { "glArrayElementEXT", (GLfunction) glArrayElementEXT }, - { "glDrawArraysEXT", (GLfunction) glDrawArraysEXT }, + { "glVertexPointerEXT", (gl_function) glVertexPointerEXT }, + { "glNormalPointerEXT", (gl_function) glNormalPointerEXT }, + { "glColorPointerEXT", (gl_function) glColorPointerEXT }, + { "glIndexPointerEXT", (gl_function) glIndexPointerEXT }, + { "glTexCoordPointerEXT", (gl_function) glTexCoordPointerEXT }, + { "glEdgeFlagPointerEXT", (gl_function) glEdgeFlagPointerEXT }, + { "glGetPointervEXT", (gl_function) glGetPointervEXT }, + { "glArrayElementEXT", (gl_function) glArrayElementEXT }, + { "glDrawArraysEXT", (gl_function) glDrawArraysEXT }, /* GL_EXT_texture_object */ - { "glGenTexturesEXT", (GLfunction) glGenTexturesEXT }, - { "glDeleteTexturesEXT", (GLfunction) glDeleteTexturesEXT }, - { "glBindTextureEXT", (GLfunction) glBindTextureEXT }, - { "glPrioritizeTexturesEXT", (GLfunction) glPrioritizeTexturesEXT }, - { "glAreTexturesResidentEXT", (GLfunction) glAreTexturesResidentEXT }, - { "glIsTextureEXT", (GLfunction) glIsTextureEXT }, + { "glGenTexturesEXT", (gl_function) glGenTexturesEXT }, + { "glDeleteTexturesEXT", (gl_function) glDeleteTexturesEXT }, + { "glBindTextureEXT", (gl_function) glBindTextureEXT }, + { "glPrioritizeTexturesEXT", (gl_function) glPrioritizeTexturesEXT }, + { "glAreTexturesResidentEXT", (gl_function) glAreTexturesResidentEXT }, + { "glIsTextureEXT", (gl_function) glIsTextureEXT }, /* GL_EXT_texture3D */ - { "glTexImage3DEXT", (GLfunction) glTexImage3DEXT }, - { "glTexSubImage3DEXT", (GLfunction) glTexSubImage3DEXT }, - { "glCopyTexSubImage3DEXT", (GLfunction) glCopyTexSubImage3DEXT }, + { "glTexImage3DEXT", (gl_function) glTexImage3DEXT }, + { "glTexSubImage3DEXT", (gl_function) glTexSubImage3DEXT }, + { "glCopyTexSubImage3DEXT", (gl_function) glCopyTexSubImage3DEXT }, /* GL_EXT_color_table */ - { "glColorTableEXT", (GLfunction) glColorTableEXT }, - { "glColorSubTableEXT", (GLfunction) glColorSubTableEXT }, - { "glGetColorTableEXT", (GLfunction) glGetColorTableEXT }, - { "glGetColorTableParameterfvEXT", (GLfunction) glGetColorTableParameterfvEXT }, - { "glGetColorTableParameterivEXT", (GLfunction) glGetColorTableParameterivEXT }, + { "glColorTableEXT", (gl_function) glColorTableEXT }, + { "glColorSubTableEXT", (gl_function) glColorSubTableEXT }, + { "glGetColorTableEXT", (gl_function) glGetColorTableEXT }, + { "glGetColorTableParameterfvEXT", (gl_function) glGetColorTableParameterfvEXT }, + { "glGetColorTableParameterivEXT", (gl_function) glGetColorTableParameterivEXT }, /* GL_ARB_multitexture */ - { "glActiveTextureARB", (GLfunction) glActiveTextureARB }, - { "glClientActiveTextureARB", (GLfunction) glClientActiveTextureARB }, - { "glMultiTexCoord1dARB", (GLfunction) glMultiTexCoord1dARB }, - { "glMultiTexCoord1dvARB", (GLfunction) glMultiTexCoord1dvARB }, - { "glMultiTexCoord1fARB", (GLfunction) glMultiTexCoord1fARB }, - { "glMultiTexCoord1fvARB", (GLfunction) glMultiTexCoord1fvARB }, - { "glMultiTexCoord1iARB", (GLfunction) glMultiTexCoord1iARB }, - { "glMultiTexCoord1ivARB", (GLfunction) glMultiTexCoord1ivARB }, - { "glMultiTexCoord1sARB", (GLfunction) glMultiTexCoord1sARB }, - { "glMultiTexCoord1svARB", (GLfunction) glMultiTexCoord1svARB }, - { "glMultiTexCoord2dARB", (GLfunction) glMultiTexCoord2dARB }, - { "glMultiTexCoord2dvARB", (GLfunction) glMultiTexCoord2dvARB }, - { "glMultiTexCoord2fARB", (GLfunction) glMultiTexCoord2fARB }, - { "glMultiTexCoord2fvARB", (GLfunction) glMultiTexCoord2fvARB }, - { "glMultiTexCoord2iARB", (GLfunction) glMultiTexCoord2iARB }, - { "glMultiTexCoord2ivARB", (GLfunction) glMultiTexCoord2ivARB }, - { "glMultiTexCoord2sARB", (GLfunction) glMultiTexCoord2sARB }, - { "glMultiTexCoord2svARB", (GLfunction) glMultiTexCoord2svARB }, - { "glMultiTexCoord3dARB", (GLfunction) glMultiTexCoord3dARB }, - { "glMultiTexCoord3dvARB", (GLfunction) glMultiTexCoord3dvARB }, - { "glMultiTexCoord3fARB", (GLfunction) glMultiTexCoord3fARB }, - { "glMultiTexCoord3fvARB", (GLfunction) glMultiTexCoord3fvARB }, - { "glMultiTexCoord3iARB", (GLfunction) glMultiTexCoord3iARB }, - { "glMultiTexCoord3ivARB", (GLfunction) glMultiTexCoord3ivARB }, - { "glMultiTexCoord3sARB", (GLfunction) glMultiTexCoord3sARB }, - { "glMultiTexCoord3svARB", (GLfunction) glMultiTexCoord3svARB }, - { "glMultiTexCoord4dARB", (GLfunction) glMultiTexCoord4dARB }, - { "glMultiTexCoord4dvARB", (GLfunction) glMultiTexCoord4dvARB }, - { "glMultiTexCoord4fARB", (GLfunction) glMultiTexCoord4fARB }, - { "glMultiTexCoord4fvARB", (GLfunction) glMultiTexCoord4fvARB }, - { "glMultiTexCoord4iARB", (GLfunction) glMultiTexCoord4iARB }, - { "glMultiTexCoord4ivARB", (GLfunction) glMultiTexCoord4ivARB }, - { "glMultiTexCoord4sARB", (GLfunction) glMultiTexCoord4sARB }, - { "glMultiTexCoord4svARB", (GLfunction) glMultiTexCoord4svARB }, + { "glActiveTextureARB", (gl_function) glActiveTextureARB }, + { "glClientActiveTextureARB", (gl_function) glClientActiveTextureARB }, + { "glMultiTexCoord1dARB", (gl_function) glMultiTexCoord1dARB }, + { "glMultiTexCoord1dvARB", (gl_function) glMultiTexCoord1dvARB }, + { "glMultiTexCoord1fARB", (gl_function) glMultiTexCoord1fARB }, + { "glMultiTexCoord1fvARB", (gl_function) glMultiTexCoord1fvARB }, + { "glMultiTexCoord1iARB", (gl_function) glMultiTexCoord1iARB }, + { "glMultiTexCoord1ivARB", (gl_function) glMultiTexCoord1ivARB }, + { "glMultiTexCoord1sARB", (gl_function) glMultiTexCoord1sARB }, + { "glMultiTexCoord1svARB", (gl_function) glMultiTexCoord1svARB }, + { "glMultiTexCoord2dARB", (gl_function) glMultiTexCoord2dARB }, + { "glMultiTexCoord2dvARB", (gl_function) glMultiTexCoord2dvARB }, + { "glMultiTexCoord2fARB", (gl_function) glMultiTexCoord2fARB }, + { "glMultiTexCoord2fvARB", (gl_function) glMultiTexCoord2fvARB }, + { "glMultiTexCoord2iARB", (gl_function) glMultiTexCoord2iARB }, + { "glMultiTexCoord2ivARB", (gl_function) glMultiTexCoord2ivARB }, + { "glMultiTexCoord2sARB", (gl_function) glMultiTexCoord2sARB }, + { "glMultiTexCoord2svARB", (gl_function) glMultiTexCoord2svARB }, + { "glMultiTexCoord3dARB", (gl_function) glMultiTexCoord3dARB }, + { "glMultiTexCoord3dvARB", (gl_function) glMultiTexCoord3dvARB }, + { "glMultiTexCoord3fARB", (gl_function) glMultiTexCoord3fARB }, + { "glMultiTexCoord3fvARB", (gl_function) glMultiTexCoord3fvARB }, + { "glMultiTexCoord3iARB", (gl_function) glMultiTexCoord3iARB }, + { "glMultiTexCoord3ivARB", (gl_function) glMultiTexCoord3ivARB }, + { "glMultiTexCoord3sARB", (gl_function) glMultiTexCoord3sARB }, + { "glMultiTexCoord3svARB", (gl_function) glMultiTexCoord3svARB }, + { "glMultiTexCoord4dARB", (gl_function) glMultiTexCoord4dARB }, + { "glMultiTexCoord4dvARB", (gl_function) glMultiTexCoord4dvARB }, + { "glMultiTexCoord4fARB", (gl_function) glMultiTexCoord4fARB }, + { "glMultiTexCoord4fvARB", (gl_function) glMultiTexCoord4fvARB }, + { "glMultiTexCoord4iARB", (gl_function) glMultiTexCoord4iARB }, + { "glMultiTexCoord4ivARB", (gl_function) glMultiTexCoord4ivARB }, + { "glMultiTexCoord4sARB", (gl_function) glMultiTexCoord4sARB }, + { "glMultiTexCoord4svARB", (gl_function) glMultiTexCoord4svARB }, /* GL_EXT_point_parameters */ - { "glPointParameterfEXT", (GLfunction) glPointParameterfEXT }, - { "glPointParameterfvEXT", (GLfunction) glPointParameterfvEXT }, + { "glPointParameterfEXT", (gl_function) glPointParameterfEXT }, + { "glPointParameterfvEXT", (gl_function) glPointParameterfvEXT }, /* GL_INGR_blend_func_separate */ - { "glBlendFuncSeparateINGR", (GLfunction) glBlendFuncSeparateINGR }, + { "glBlendFuncSeparateINGR", (gl_function) glBlendFuncSeparateINGR }, /* GL_MESA_window_pos */ - { "glWindowPos2iMESA", (GLfunction) glWindowPos2iMESA }, - { "glWindowPos2sMESA", (GLfunction) glWindowPos2sMESA }, - { "glWindowPos2fMESA", (GLfunction) glWindowPos2fMESA }, - { "glWindowPos2dMESA", (GLfunction) glWindowPos2dMESA }, - { "glWindowPos2ivMESA", (GLfunction) glWindowPos2ivMESA }, - { "glWindowPos2svMESA", (GLfunction) glWindowPos2svMESA }, - { "glWindowPos2fvMESA", (GLfunction) glWindowPos2fvMESA }, - { "glWindowPos2dvMESA", (GLfunction) glWindowPos2dvMESA }, - { "glWindowPos3iMESA", (GLfunction) glWindowPos3iMESA }, - { "glWindowPos3sMESA", (GLfunction) glWindowPos3sMESA }, - { "glWindowPos3fMESA", (GLfunction) glWindowPos3fMESA }, - { "glWindowPos3dMESA", (GLfunction) glWindowPos3dMESA }, - { "glWindowPos3ivMESA", (GLfunction) glWindowPos3ivMESA }, - { "glWindowPos3svMESA", (GLfunction) glWindowPos3svMESA }, - { "glWindowPos3fvMESA", (GLfunction) glWindowPos3fvMESA }, - { "glWindowPos3dvMESA", (GLfunction) glWindowPos3dvMESA }, - { "glWindowPos4iMESA", (GLfunction) glWindowPos4iMESA }, - { "glWindowPos4sMESA", (GLfunction) glWindowPos4sMESA }, - { "glWindowPos4fMESA", (GLfunction) glWindowPos4fMESA }, - { "glWindowPos4dMESA", (GLfunction) glWindowPos4dMESA }, - { "glWindowPos4ivMESA", (GLfunction) glWindowPos4ivMESA }, - { "glWindowPos4svMESA", (GLfunction) glWindowPos4svMESA }, - { "glWindowPos4fvMESA", (GLfunction) glWindowPos4fvMESA }, - { "glWindowPos4dvMESA", (GLfunction) glWindowPos4dvMESA }, + { "glWindowPos2iMESA", (gl_function) glWindowPos2iMESA }, + { "glWindowPos2sMESA", (gl_function) glWindowPos2sMESA }, + { "glWindowPos2fMESA", (gl_function) glWindowPos2fMESA }, + { "glWindowPos2dMESA", (gl_function) glWindowPos2dMESA }, + { "glWindowPos2ivMESA", (gl_function) glWindowPos2ivMESA }, + { "glWindowPos2svMESA", (gl_function) glWindowPos2svMESA }, + { "glWindowPos2fvMESA", (gl_function) glWindowPos2fvMESA }, + { "glWindowPos2dvMESA", (gl_function) glWindowPos2dvMESA }, + { "glWindowPos3iMESA", (gl_function) glWindowPos3iMESA }, + { "glWindowPos3sMESA", (gl_function) glWindowPos3sMESA }, + { "glWindowPos3fMESA", (gl_function) glWindowPos3fMESA }, + { "glWindowPos3dMESA", (gl_function) glWindowPos3dMESA }, + { "glWindowPos3ivMESA", (gl_function) glWindowPos3ivMESA }, + { "glWindowPos3svMESA", (gl_function) glWindowPos3svMESA }, + { "glWindowPos3fvMESA", (gl_function) glWindowPos3fvMESA }, + { "glWindowPos3dvMESA", (gl_function) glWindowPos3dvMESA }, + { "glWindowPos4iMESA", (gl_function) glWindowPos4iMESA }, + { "glWindowPos4sMESA", (gl_function) glWindowPos4sMESA }, + { "glWindowPos4fMESA", (gl_function) glWindowPos4fMESA }, + { "glWindowPos4dMESA", (gl_function) glWindowPos4dMESA }, + { "glWindowPos4ivMESA", (gl_function) glWindowPos4ivMESA }, + { "glWindowPos4svMESA", (gl_function) glWindowPos4svMESA }, + { "glWindowPos4fvMESA", (gl_function) glWindowPos4fvMESA }, + { "glWindowPos4dvMESA", (gl_function) glWindowPos4dvMESA }, /* GL_MESA_resize_buffers */ - { "glResizeBuffersMESA", (GLfunction) glResizeBuffersMESA }, + { "glResizeBuffersMESA", (gl_function) glResizeBuffersMESA }, /* GL_EXT_compiled_vertex_array */ - { "glLockArraysEXT", (GLfunction) glLockArraysEXT }, - { "glUnlockArraysEXT", (GLfunction) glUnlockArraysEXT }, + { "glLockArraysEXT", (gl_function) glLockArraysEXT }, + { "glUnlockArraysEXT", (gl_function) glUnlockArraysEXT }, { NULL, NULL } /* end of list token */ }; GLuint i; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glGetProcAddressEXT", NULL); - for (i = 0; procTable[i].address; i++) { if (strcmp((const char *) procName, procTable[i].name) == 0) return procTable[i].address; diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h index ded2bae7976..c5316192f8d 100644 --- a/src/mesa/main/extensions.h +++ b/src/mesa/main/extensions.h @@ -1,4 +1,4 @@ -/* $Id: extensions.h,v 1.4 1999/10/08 09:27:10 keithw Exp $ */ +/* $Id: extensions.h,v 1.5 1999/10/16 11:30:27 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -46,7 +46,7 @@ extern void gl_extensions_dtr( struct gl_context *ctx ); extern void gl_extensions_ctr( struct gl_context *ctx ); extern const char *gl_extensions_get_string( struct gl_context *ctx ); -extern void (*gl_GetProcAddress( GLcontext *ctx, const GLubyte *procName ))( void ); +extern void (*gl_get_proc_address( const GLubyte *procName ))(); #endif -- cgit v1.2.3 From bc95b2f07ea03535de4e984737c365e6f853a2bc Mon Sep 17 00:00:00 2001 From: Miklos Fazekas Date: Sat, 16 Oct 1999 12:52:56 +0000 Subject: Added glGetMinmax --- include/GL/gl_mangle.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 8ab25a90f07..bbb454149a8 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -1,4 +1,4 @@ -/* $Id: gl_mangle.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ +/* $Id: gl_mangle.h,v 1.2 1999/10/16 12:52:56 miklos Exp $ */ /* * Mesa 3-D graphics library @@ -344,6 +344,7 @@ #define glGetMapdv mglGetMapdv #define glGetMapfv mglGetMapfv #define glGetMapiv mglGetMapiv +#define glGetMinmax mglGetMinmax #define glEvalCoord1d mglEvalCoord1d #define glEvalCoord1f mglEvalCoord1f #define glEvalCoord1dv mglEvalCoord1dv @@ -399,7 +400,6 @@ #define glGetColorTableEXT mglGetColorTableEXT #define glGetColorTableParameterfvEXT mglGetColorTableParameterfvEXT #define glGetColorTableParameterivEXT mglGetColorTableParameterivEXT -#define glGetMinMax mglGetMinMax #define glMultiTexCoord1dSGIS mglMultiTexCoord1dSGIS #define glMultiTexCoord1dvSGIS mglMultiTexCoord1dvSGIS #define glMultiTexCoord1fSGIS mglMultiTexCoord1fSGIS @@ -508,6 +508,7 @@ #define glGetHistogramParameteriv mglGetHistogramParameteriv #define glMinmax mglMinmax #define glResetMinmax mglResetMinmax +#define glGetMinmax mglGetMinmax #define glGetMinmaxParameterfv mglGetMinmaxParameterfv #define glGetMinmaxParameteriv mglGetMinmaxParameteriv #define glConvolutionFilter1D mglConvolutionFilter1D -- cgit v1.2.3 From 053f2020cac8e57e44e66ec9f5a8ed046af6dce6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 17 Oct 1999 20:18:15 +0000 Subject: added missing GL_ARB_imaging color table functions --- include/GL/gl.h | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 97b8b002a99..92920485dac 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.10 1999/10/16 11:27:02 brianp Exp $ */ +/* $Id: gl.h,v 1.11 1999/10/17 20:18:15 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -941,7 +941,6 @@ typedef enum { GL_COLOR_TABLE_ALPHA_SIZE = 0x80DD, GL_COLOR_TABLE_LUMINANCE_SIZE = 0x80DE, GL_COLOR_TABLE_INTENSITY_SIZE = 0x80DF, - /* GL_EXT_convolution and GL_HP_convolution_border_modes */ GL_CONVOLUTION_1D = 0x8010, GL_CONVOLUTION_2D = 0x8011, @@ -966,7 +965,6 @@ typedef enum { GL_CONSTANT_BORDER = 0x8151, GL_REPLICATE_BORDER = 0x8153, GL_CONVOLUTION_BORDER_COLOR = 0x8154, - /* GL_SGI_color_matrix */ GL_COLOR_MATRIX = 0x80B1, GL_COLOR_MATRIX_STACK_DEPTH = 0x80B2, @@ -979,7 +977,6 @@ typedef enum { GL_POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9, GL_POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA, GL_POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB, - /* GL_EXT_histogram */ GL_HISTOGRAM = 0x8024, GL_PROXY_HISTOGRAM = 0x8025, @@ -995,6 +992,14 @@ typedef enum { GL_MINMAX_FORMAT = 0x802F, GL_MINMAX_SINK = 0x8030, GL_TABLE_TOO_LARGE = 0x8031, + /* GL_EXT_blend_color, GL_EXT_blend_minmax */ + GL_BLEND_EQUATION = 0x8009, + GL_MIN = 0x8007, + GL_MAX = 0x8008, + GL_FUNC_ADD = 0x8006, + GL_FUNC_SUBTRACT = 0x800A, + GL_FUNC_REVERSE_SUBTRACT = 0x800B, + GL_BLEND_COLOR = 0x8005, /* GL_NV_texgen_reflection (nVidia) */ GL_NORMAL_MAP_NV = 0x8511, @@ -2082,6 +2087,26 @@ GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level, /* 1.2 imaging extension functions */ +GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat, + GLsizei width, GLenum format, + GLenum type, const GLvoid *table ); + +GLAPI void GLAPIENTRY glColorSubTable( GLenum target, + GLsizei start, GLsizei count, + GLenum format, GLenum type, + const GLvoid *data ); + +GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format, + GLenum type, GLvoid *table ); + +GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, + GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, + GLenum pname, + GLint *params ); + GLAPI void GLAPIENTRY glBlendEquation( GLenum mode ); GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green, -- cgit v1.2.3 From c782c911e90953349b3a5259705df2b9dcffcc63 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 17 Oct 1999 21:42:32 +0000 Subject: more ARB_imaging colortable functions --- include/GL/gl.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 92920485dac..cd417cf6920 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.11 1999/10/17 20:18:15 brianp Exp $ */ +/* $Id: gl.h,v 1.12 1999/10/17 21:42:32 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2096,15 +2096,25 @@ GLAPI void GLAPIENTRY glColorSubTable( GLenum target, GLenum format, GLenum type, const GLvoid *data ); +GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname, + const GLint *params); + +GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname, + const GLfloat *params); + +GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start, + GLint x, GLint y, GLsizei width ); + +GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat, + GLint x, GLint y, GLsizei width ); + GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format, GLenum type, GLvoid *table ); -GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, - GLenum pname, +GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ); -GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, - GLenum pname, +GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ); GLAPI void GLAPIENTRY glBlendEquation( GLenum mode ); @@ -2185,12 +2195,6 @@ GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target, GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); -GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width ); - -GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width ); - /* GL_EXT_compiled_vertex_array */ -- cgit v1.2.3 From 52880f85b5270fb156c1b75effabc9c2c8b61511 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 17 Oct 1999 23:24:49 +0000 Subject: GL_MAX_ELEMENTS_VERTICES/INDICES enums had wrong values --- include/GL/gl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index cd417cf6920..d5a93878bbe 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.12 1999/10/17 21:42:32 brianp Exp $ */ +/* $Id: gl.h,v 1.13 1999/10/17 23:24:49 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -860,8 +860,8 @@ typedef enum { /* OpenGL 1.2 */ GL_RESCALE_NORMAL = 0x803A, GL_CLAMP_TO_EDGE = 0x812F, - GL_MAX_ELEMENTS_VERTICES = 0xF0E8, - GL_MAX_ELEMENTS_INDICES = 0xF0E9, + GL_MAX_ELEMENTS_VERTICES = 0x80E8, + GL_MAX_ELEMENTS_INDICES = 0x80E9, GL_BGR = 0x80E0, GL_BGRA = 0x80E1, GL_UNSIGNED_BYTE_3_3_2 = 0x8032, -- cgit v1.2.3 From 3f17dfb8ba48d874814ce0e4a0b7d9e57feb4c36 Mon Sep 17 00:00:00 2001 From: Ted Jump Date: Wed, 20 Oct 1999 06:56:40 +0000 Subject: Minor patches to cleanup some compiler warnings in MSVC --- include/GL/gl.h | 4 +-- include/GL/glut.h | 56 +++++++++++++++++++++++++++--------------- include/GL/mesa_wgl.h | 17 +++++++++++-- src/mesa/drivers/glide/fxwgl.c | 6 ++--- 4 files changed, 56 insertions(+), 27 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index d5a93878bbe..eeec8afc5c2 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.13 1999/10/17 23:24:49 brianp Exp $ */ +/* $Id: gl.h,v 1.14 1999/10/20 06:56:40 tjump Exp $ */ /* * Mesa 3-D graphics library @@ -55,6 +55,7 @@ # pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ # pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */ # pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ +# pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */ # if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ # define GLAPI __declspec(dllexport) # define WGLAPI __declspec(dllexport) @@ -114,7 +115,6 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC #include #endif - #ifdef __cplusplus extern "C" { #endif diff --git a/include/GL/glut.h b/include/GL/glut.h index 1b7fc43667b..0c17f65b2cd 100644 --- a/include/GL/glut.h +++ b/include/GL/glut.h @@ -152,26 +152,42 @@ typedef unsigned long COLORREF; # define wglUseFontOutlines wglUseFontOutlinesA # endif /* !UNICODE */ typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR; -typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT; -GLUTAPI int GLUTAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int); -GLUTAPI HGLRC GLUTAPIENTRY wglCreateContext(HDC); -GLUTAPI HGLRC GLUTAPIENTRY wglCreateLayerContext(HDC, int); -GLUTAPI int GLUTAPIENTRY wglDeleteContext(HGLRC); -GLUTAPI HGLRC GLUTAPIENTRY wglGetCurrentContext(void); -GLUTAPI HDC GLUTAPIENTRY wglGetCurrentDC(void); -GLUTAPI PROC GLUTAPIENTRY wglGetProcAddress(char*); -GLUTAPI int GLUTAPIENTRY wglMakeCurrent(HDC, HGLRC); -GLUTAPI int GLUTAPIENTRY wglShareLists(HGLRC, HGLRC); -GLUTAPI int GLUTAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long); -GLUTAPI int GLUTAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long); -GLUTAPI int GLUTAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT); -GLUTAPI int GLUTAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT); -GLUTAPI int GLUTAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR); -GLUTAPI int GLUTAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *); -GLUTAPI int GLUTAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *); -GLUTAPI int GLUTAPIENTRY wglRealizeLayerPalette(HDC, int, int); -GLUTAPI int GLUTAPIENTRY wglSwapLayerBuffers(HDC, unsigned int); -GLUTAPI int GLUTAPIENTRY SwapBuffers(HDC); +typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT +# pragma warning( push ) +# pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */ +# define WGLAPI __declspec(dllimport) +WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC); +WGLAPI int GLAPIENTRY wglMakeCurrent(HDC,HGLRC); +WGLAPI int GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *); +WGLAPI int GLAPIENTRY wglSwapBuffers(HDC hdc); +WGLAPI HDC GLAPIENTRY wglGetCurrentDC(void); +WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC); +WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int); +WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void); +WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*); +WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *); +WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int); +WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC); +WGLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR); +WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR); +WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *); +WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc); +WGLAPI int GLAPIENTRY wglMakeCurrent(HDC, HGLRC); +WGLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int); +WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *); +WGLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC); +WGLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int); +WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long); +WGLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long); +WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT); +WGLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT); +WGLAPI int GLAPIENTRY SwapBuffers(HDC); +WGLAPI int GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *); +WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned long,LPPIXELFORMATDESCRIPTOR); +WGLAPI int GLAPIENTRY GetPixelFormat(HDC); +WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *); +# undef WGLAPI +# pragma warning( pop ) #endif #else /* _WIN32 not defined */ diff --git a/include/GL/mesa_wgl.h b/include/GL/mesa_wgl.h index afa70d2c62f..40bbe573542 100644 --- a/include/GL/mesa_wgl.h +++ b/include/GL/mesa_wgl.h @@ -2,7 +2,12 @@ /* relocated here so that I could make GLUT get them properly */ #ifndef GL_H -#include +# include +#endif + +#ifdef _MSC_VER +# pragma warning( push ) +# pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */ #endif WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC); @@ -14,7 +19,6 @@ WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC); WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int); WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void); WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*); -WGLAPI int GLAPIENTRY SwapBuffers(HDC); WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *); WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int); WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC); @@ -31,3 +35,12 @@ WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, un 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,PIXELFORMATDESCRIPTOR *); +WGLAPI int GLAPIENTRY GetPixelFormat(HDC); +WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *); + +#ifdef _MSC_VER +# pragma warning( pop ) +#endif diff --git a/src/mesa/drivers/glide/fxwgl.c b/src/mesa/drivers/glide/fxwgl.c index 3ba7f7a4b4d..7b19176c7ef 100644 --- a/src/mesa/drivers/glide/fxwgl.c +++ b/src/mesa/drivers/glide/fxwgl.c @@ -28,14 +28,14 @@ extern "C" { #endif #include -#include +#include "GL/gl.h" #ifdef __cplusplus } #endif #include -#include +#include "GL/fxmesa.h" #include "fxdrv.h" #define MAX_MESA_ATTRS 20 @@ -542,7 +542,7 @@ BOOL GLAPIENTRY wglUseFontBitmaps(HDC fontDevice, DWORD firstChar, DWORD numChar SetTextColor(bitDevice, tempColor); // Place chars based on base line - VERIFY(SetTextAlign(bitDevice, TA_BASELINE) >= 0); + VERIFY(SetTextAlign(bitDevice, TA_BASELINE) >= 0 ? 1 : 0); for(i = 0; i < numChars; i++) { SIZE size; -- cgit v1.2.3 From b19ba7827cded079470fc0c848124089ecb6ca5f Mon Sep 17 00:00:00 2001 From: Ted Jump Date: Thu, 21 Oct 1999 06:04:20 +0000 Subject: Added pragma to disable warning about unk pragmas for MSVC5 --- include/GL/gl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index eeec8afc5c2..4a2923b362c 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.14 1999/10/20 06:56:40 tjump Exp $ */ +/* $Id: gl.h,v 1.15 1999/10/21 06:04:20 tjump Exp $ */ /* * Mesa 3-D graphics library @@ -50,6 +50,7 @@ #endif #if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__)) +# pragma warning( disable : 4068 ) /* unknown pragma */ # pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ # pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ # pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ -- cgit v1.2.3 From a6f09fa88074a84e902a34958866c1eaf0b4ef2e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 22 Oct 1999 10:47:01 +0000 Subject: define GLUAPI, GLAPIENTRY and GLCALLBACK to nothing if not using Mesa's gl.h --- include/GL/glu.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index c400f9609b9..14a8ff5dece 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.10 1999/09/19 10:04:01 tjump Exp $ */ +/* $Id: glu.h,v 1.11 1999/10/22 10:47:01 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -23,6 +23,9 @@ /* * $Log: glu.h,v $ + * Revision 1.11 1999/10/22 10:47:01 brianp + * define GLUAPI, GLAPIENTRY and GLCALLBACK to nothing if not using Mesa's gl.h + * * Revision 1.10 1999/09/19 10:04:01 tjump * Changed name 'glGetProcAddressEXT' to 'gluGetProcAddressEXT' * @@ -112,6 +115,18 @@ extern "C" { #endif #endif +#ifndef GLUAPI +#define GLUAPI +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef GLCALLBACK +#define GLCALLBACK +#endif + #define GLU_VERSION_1_1 1 #define GLU_VERSION_1_2 1 -- cgit v1.2.3 From e261963104561a9c195852a11eaa9b57ef41a67b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 22 Oct 1999 10:47:58 +0000 Subject: removed revision history info --- include/GL/glu.h | 60 +------------------------------------------------------- 1 file changed, 1 insertion(+), 59 deletions(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index 14a8ff5dece..7ab9a9b6e37 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.11 1999/10/22 10:47:01 brianp Exp $ */ +/* $Id: glu.h,v 1.12 1999/10/22 10:47:58 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -21,64 +21,6 @@ */ -/* - * $Log: glu.h,v $ - * Revision 1.11 1999/10/22 10:47:01 brianp - * define GLUAPI, GLAPIENTRY and GLCALLBACK to nothing if not using Mesa's gl.h - * - * Revision 1.10 1999/09/19 10:04:01 tjump - * Changed name 'glGetProcAddressEXT' to 'gluGetProcAddressEXT' - * - * Revision 1.8 1999/09/17 12:21:36 brianp - * glGetProcAddressEXT changes to accomodate Win32 and non-Win32 - * - * Revision 1.7 1999/09/17 02:44:19 tjump - * I changed the xxxGetProcAddressEXT function declarations to be more - * MSVC friendly. Brianp - could you verify that they describe and operate - * as intended on Linux/ETC platforms? - * - * Revision 1.6 1999/09/16 16:54:22 brianp - * GLU_EXT_get_proc_address clean-up - * - * Revision 1.5 1999/09/14 03:23:08 gareth - * Fixed GLUtriangulatorObj again (spelling). - * - * Revision 1.4 1999/09/14 01:32:58 gareth - * Fixed definition of GLUtriangluatorObj for 1.3 tessellator. - * - * Revision 1.3 1999/09/11 11:34:21 brianp - * added GLU_EXT_get_proc_address - * - * Revision 1.2 1999/09/10 02:08:18 gareth - * Added GLU 1.3 tessellation (except winding rule code). - * - * Revision 1.1.1.1 1999/08/19 00:55:40 jtg - * Imported sources - * - * Revision 3.6 1999/02/14 03:39:45 brianp - * updated for BeOS R4 - * - * Revision 3.5 1999/01/03 03:02:55 brianp - * now using GLAPI and GLAPIENTRY keywords, misc Windows changes (Ted Jump) - * - * Revision 3.4 1998/12/01 02:34:27 brianp - * applied Mark Kilgard's patches from November 30, 1998 - * - * Revision 3.3 1998/11/17 01:14:02 brianp - * minor changes for OpenStep compilation (pete@ohm.york.ac.uk) - * - * Revision 3.2 1998/07/26 01:36:27 brianp - * changes for Windows compilation per Ted Jump - * - * Revision 3.1 1998/06/23 00:33:08 brianp - * added some WIN32 APIENTRY, CALLBACK stuff (Eric Lassauge) - * - * Revision 3.0 1998/02/20 05:06:01 brianp - * initial rev - * - */ - - #ifndef GLU_H #define GLU_H -- cgit v1.2.3 From c7af1b0b94a190b284dde807b3d806dec8cc8ee7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 27 Oct 1999 09:43:48 +0000 Subject: removed gluGetProcAddressEXT() --- include/GL/glu.h | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index 7ab9a9b6e37..6cf56d789b8 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.12 1999/10/22 10:47:58 brianp Exp $ */ +/* $Id: glu.h,v 1.13 1999/10/27 09:43:48 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -463,19 +463,6 @@ GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name ); -/* - * GLU_EXT_get_proc_address extension - */ -/* - * WARNING: this extension is not finalized yet! Do not release code - * which uses this extension yet! It may change! - */ -#define GLU_EXT_get_proc_address 1 -#ifdef GLU_EXT_get_proc_address -GLUAPI void (GLAPIENTRY *gluGetProcAddressEXT(const GLubyte *procName))(); -#endif - - #if defined(__BEOS__) || defined(__QUICKDRAW__) #pragma export off #endif -- cgit v1.2.3 From 782ca03d6d3e8172961349dfb198e713ca1305ee Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 27 Oct 1999 09:44:10 +0000 Subject: removed glXGetProcAddressEXT --- include/GL/glx.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index e7576e741c3..8743bc4a50e 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.3 1999/09/16 15:52:51 brianp Exp $ */ +/* $Id: glx.h,v 1.4 1999/10/27 09:44:10 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -27,6 +27,9 @@ /* * $Log: glx.h,v $ + * Revision 1.4 1999/10/27 09:44:10 brianp + * removed glXGetProcAddressEXT + * * Revision 1.3 1999/09/16 15:52:51 brianp * added GLX_MESA_set_3dfx_mode. clean-up of glXGetProcAddress * @@ -234,13 +237,6 @@ extern const char *glXGetClientString( Display *dpy, int name ); -/* GLX_EXT_get_proc_address */ -/* WARNING: this extension is not finalized yet! Do not release code - * which uses this extension yet! It may change! - */ -extern void (*glXGetProcAddressEXT(const GLubyte *procName))(); - - /* GLX_MESA_pixmap_colormap */ extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap ); -- cgit v1.2.3 From d865227d214544426c2ab396417e48aedc0ee1e5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 27 Oct 1999 09:46:07 +0000 Subject: removed cvs history logs and old comments --- include/GL/glx.h | 44 +------------------------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 8743bc4a50e..2df9c277472 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.4 1999/10/27 09:44:10 brianp Exp $ */ +/* $Id: glx.h,v 1.5 1999/10/27 09:46:07 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,53 +25,11 @@ */ -/* - * $Log: glx.h,v $ - * Revision 1.4 1999/10/27 09:44:10 brianp - * removed glXGetProcAddressEXT - * - * Revision 1.3 1999/09/16 15:52:51 brianp - * added GLX_MESA_set_3dfx_mode. clean-up of glXGetProcAddress - * - * Revision 1.2 1999/09/11 11:33:45 brianp - * added GLX_EXT_get_proc_address - * - * Revision 1.1.1.1 1999/08/19 00:55:40 jtg - * Imported sources - * - * Revision 3.3 1999/02/14 03:39:09 brianp - * new copyright - * - * Revision 3.2 1998/06/18 03:44:00 brianp - * replaced "uint" with "unsigned int" - * - * Revision 3.1 1998/06/01 00:00:17 brianp - * added GLX_SGI_video_sync extension - * - * Revision 3.0 1998/02/20 05:06:01 brianp - * initial rev - * - */ - #ifndef GLX_H #define GLX_H -/* - * A pseudo-GLX implementation to allow GLX-based OpenGL programs to - * work with Mesa. - * - * Notes: - * 1. If the visual passed to glXGetConfig was not one returned by - * glXChooseVisual then the GLX_RGBA and GLX_DOUBLEBUFFER queries - * will always return True and the GLX_DEPTH_SIZE query will always - * return non-zero. - * 2. The glXIsDirect() function always returns True. - */ - - - #include #include #include "GL/gl.h" -- cgit v1.2.3 From 38136ec3ddef8f1e7f7c96b69efc33bf2d7706cc Mon Sep 17 00:00:00 2001 From: Ted Jump Date: Sat, 30 Oct 1999 18:39:06 +0000 Subject: Changed over to maximal warnings on Win32 builds. --- include/GL/gl.h | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 4a2923b362c..7759824d4fe 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.15 1999/10/21 06:04:20 tjump Exp $ */ +/* $Id: gl.h,v 1.16 1999/10/30 18:39:06 tjump Exp $ */ /* * Mesa 3-D graphics library @@ -51,12 +51,16 @@ #if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__)) # pragma warning( disable : 4068 ) /* unknown pragma */ -# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ -# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ -# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ -# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */ -# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ +# pragma warning( disable : 4710 ) /* function 'foo' not inlined */ # pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */ +# if defined(MESA_MINWARN) +# pragma warning( disable : 4127 ) /* conditional expression is constant */ +# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ +# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ +# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ +# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */ +# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ +# endif # if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ # define GLAPI __declspec(dllexport) # define WGLAPI __declspec(dllexport) @@ -83,11 +87,6 @@ /* compatability guard so we don't need to change client code */ #if defined(_WIN32) && !defined(_WINDEF_) && !defined(OPENSTEP) -# if !defined(MESA_MINWARN) -# pragma message( "note: WINDOWS.H not included, providing Mesa definition of CALLBACK macro" ) -# pragma message( "----: and PROC typedef. If you receive compiler warnings about either ") -# pragma message( "----: being multiply defined you should include WINDOWS.H priot to gl/gl.h" ) -# endif # define CALLBACK GLCALLBACK typedef int (GLAPIENTRY *PROC)(); typedef void *HGLRC; @@ -96,11 +95,6 @@ typedef unsigned long COLORREF; #endif #if defined(_WIN32) && !defined(_WINGDI_) && !defined(OPENSTEP) -# if !defined(MESA_MINWARN) -# pragma message( "note: WINDOWS.H not included, providing Mesa definition of wgl functions" ) -# pragma message( "----: and macros. If you receive compiler warnings about any being multiply ") -# pragma message( "----: defined you should include WINDOWS.H priot to gl/gl.h" ) -# endif # define WGL_FONT_LINES 0 # define WGL_FONT_POLYGONS 1 # ifdef UNICODE -- cgit v1.2.3 From 6bc96bfebeb16cafb1cea88c1cc6e4cd724e4bb1 Mon Sep 17 00:00:00 2001 From: Miklos Fazekas Date: Thu, 4 Nov 1999 00:43:09 +0000 Subject: Added glColorTable, etc. --- include/GL/gl_mangle.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index bbb454149a8..2c039aa1432 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -1,4 +1,4 @@ -/* $Id: gl_mangle.h,v 1.2 1999/10/16 12:52:56 miklos Exp $ */ +/* $Id: gl_mangle.h,v 1.3 1999/11/04 00:43:09 miklos Exp $ */ /* * Mesa 3-D graphics library @@ -395,6 +395,11 @@ #define glTexImage3DEXT mglTexImage3DEXT #define glTexSubImage3DEXT mglTexSubImage3DEXT #define glCopyTexSubImage3DEXT mglCopyTexSubImage3DEXT +#define glColorTable mglColorTable +#define glColorSubTable mglColorSubTable +#define glGetColorTable mglGetColorTable +#define glGetColorTableParameteriv mglGetColorTableParameteriv +#define glGetColorTableParameterfv mglGetColorTableParameterfv #define glColorTableEXT mglColorTableEXT #define glColorSubTableEXT mglColorSubTableEXT #define glGetColorTableEXT mglGetColorTableEXT -- cgit v1.2.3 From f7190d4b1f63ce94526d526c4c6c326c6833bf2b Mon Sep 17 00:00:00 2001 From: Ted Jump Date: Fri, 5 Nov 1999 18:20:31 +0000 Subject: turned off 'conditional expression is constant' warning for win32 --- include/GL/gl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 7759824d4fe..a37382bd820 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.16 1999/10/30 18:39:06 tjump Exp $ */ +/* $Id: gl.h,v 1.17 1999/11/05 18:20:31 tjump Exp $ */ /* * Mesa 3-D graphics library @@ -53,8 +53,8 @@ # pragma warning( disable : 4068 ) /* unknown pragma */ # pragma warning( disable : 4710 ) /* function 'foo' not inlined */ # pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */ +# pragma warning( disable : 4127 ) /* conditional expression is constant */ # if defined(MESA_MINWARN) -# pragma warning( disable : 4127 ) /* conditional expression is constant */ # pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ # pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ # pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ -- cgit v1.2.3 From 0822c1050ea4e91957fc7109358c3bd7daca3480 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 9 Nov 1999 06:16:59 +0000 Subject: replace GLint with GLsizei in a gluScaleImage, gluBuild1/2DMipmaps() --- include/GL/glu.h | 10 +++++----- src/glu/mesa/mipmap.c | 13 ++++++++----- 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index 6cf56d789b8..394883c548b 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.13 1999/10/27 09:43:48 brianp Exp $ */ +/* $Id: glu.h,v 1.14 1999/11/09 06:17:08 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -290,17 +290,17 @@ GLUAPI const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode ); */ GLUAPI GLint GLAPIENTRY gluScaleImage( GLenum format, - GLint widthin, GLint heightin, + GLsizei widthin, GLsizei heightin, GLenum typein, const void *datain, - GLint widthout, GLint heightout, + GLsizei widthout, GLsizei heightout, GLenum typeout, void *dataout ); GLUAPI GLint GLAPIENTRY gluBuild1DMipmaps( GLenum target, GLint components, - GLint width, GLenum format, + GLsizei width, GLenum format, GLenum type, const void *data ); GLUAPI GLint GLAPIENTRY gluBuild2DMipmaps( GLenum target, GLint components, - GLint width, GLint height, + GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data ); diff --git a/src/glu/mesa/mipmap.c b/src/glu/mesa/mipmap.c index 63246f3958e..9f4ffcfea89 100644 --- a/src/glu/mesa/mipmap.c +++ b/src/glu/mesa/mipmap.c @@ -1,4 +1,4 @@ -/* $Id: mipmap.c,v 1.2 1999/09/14 00:30:28 brianp Exp $ */ +/* $Id: mipmap.c,v 1.3 1999/11/09 06:16:59 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -23,6 +23,9 @@ /* * $Log: mipmap.c,v $ + * Revision 1.3 1999/11/09 06:16:59 brianp + * replace GLint with GLsizei in a gluScaleImage, gluBuild1/2DMipmaps() + * * Revision 1.2 1999/09/14 00:30:28 brianp * fixed pixel packing/unpacking code in gluBuild2DMipmaps() * @@ -105,9 +108,9 @@ void dummy(GLuint j, GLuint k){ GLint GLAPIENTRY gluScaleImage( GLenum format, - GLint widthin, GLint heightin, + GLsizei widthin, GLsizei heightin, GLenum typein, const void *datain, - GLint widthout, GLint heightout, + GLsizei widthout, GLsizei heightout, GLenum typeout, void *dataout ) { GLint components, i, j, k; @@ -633,7 +636,7 @@ static GLint bytes_per_pixel( GLenum format, GLenum type ) * WARNING: This function isn't finished and has never been tested!!!! */ GLint GLAPIENTRY gluBuild1DMipmaps( GLenum target, GLint components, - GLint width, GLenum format, + GLsizei width, GLenum format, GLenum type, const void *data ) { GLubyte *texture; @@ -711,7 +714,7 @@ GLint GLAPIENTRY gluBuild1DMipmaps( GLenum target, GLint components, GLint GLAPIENTRY gluBuild2DMipmaps( GLenum target, GLint components, - GLint width, GLint height, GLenum format, + GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data ) { GLint w, h, maxsize; -- cgit v1.2.3 From fbd8f212c3866ec98c1d8c9d3db3ddb7e7c479a5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 11 Nov 1999 01:22:25 +0000 Subject: first big check-in of new Mesa 3.3 code --- include/GL/gl.h | 2451 +++++++++++++++----------- include/GL/glu.h | 410 ++--- include/GL/glx.h | 63 +- src/mesa/Makefile.X11 | 14 +- src/mesa/drivers/x11/fakeglx.c | 16 +- src/mesa/drivers/x11/glxheader.h | 71 + src/mesa/drivers/x11/xfonts.c | 6 +- src/mesa/glapi/glapi.c | 3505 ++++++++++++++++++++++++++++++++++++++ src/mesa/glapi/glapi.h | 591 +++++++ src/mesa/main/Makefile.X11 | 14 +- src/mesa/main/accum.c | 24 +- src/mesa/main/accum.h | 11 +- src/mesa/main/attrib.c | 63 +- src/mesa/main/attrib.h | 20 +- src/mesa/main/blend.c | 27 +- src/mesa/main/blend.h | 16 +- src/mesa/main/clip.c | 28 +- src/mesa/main/clip.h | 8 +- src/mesa/main/colortab.c | 301 +++- src/mesa/main/colortab.h | 31 +- src/mesa/main/config.h | 34 +- src/mesa/main/context.c | 260 ++- src/mesa/main/context.h | 38 +- src/mesa/main/depth.c | 34 +- src/mesa/main/depth.h | 20 +- src/mesa/main/dispatch.c | 546 ++++++ src/mesa/main/dlist.c | 2274 ++++++++++++++++++------- src/mesa/main/dlist.h | 21 +- src/mesa/main/drawpix.c | 573 ++----- src/mesa/main/drawpix.h | 24 +- src/mesa/main/enable.c | 50 +- src/mesa/main/enable.h | 25 +- src/mesa/main/enums.c | 18 +- src/mesa/main/eval.c | 507 ++++-- src/mesa/main/eval.h | 97 +- src/mesa/main/extensions.c | 13 +- src/mesa/main/feedback.c | 45 +- src/mesa/main/feedback.h | 33 +- src/mesa/main/fog.c | 58 +- src/mesa/main/fog.h | 21 +- src/mesa/main/get.c | 85 +- src/mesa/main/get.h | 29 +- src/mesa/main/glheader.h | 65 + src/mesa/main/hash.c | 17 +- src/mesa/main/hash.h | 9 +- src/mesa/main/image.c | 1552 ++++------------- src/mesa/main/image.h | 75 +- src/mesa/main/light.c | 246 ++- src/mesa/main/light.h | 78 +- src/mesa/main/lines.c | 21 +- src/mesa/main/lines.h | 16 +- src/mesa/main/macros.h | 103 +- src/mesa/main/matrix.c | 123 +- src/mesa/main/matrix.h | 102 +- src/mesa/main/pixel.c | 98 +- src/mesa/main/pixel.h | 41 +- src/mesa/main/points.c | 74 +- src/mesa/main/points.h | 18 +- src/mesa/main/polygon.c | 49 +- src/mesa/main/polygon.h | 29 +- src/mesa/main/rastpos.c | 212 ++- src/mesa/main/rastpos.h | 79 +- src/mesa/main/stencil.c | 33 +- src/mesa/main/stencil.h | 21 +- src/mesa/main/teximage.c | 181 +- src/mesa/main/teximage.h | 121 +- src/mesa/main/texobj.c | 61 +- src/mesa/main/texobj.h | 32 +- src/mesa/main/texstate.c | 192 ++- src/mesa/main/texstate.h | 94 +- src/mesa/main/varray.c | 188 +- src/mesa/main/varray.h | 80 +- 72 files changed, 11285 insertions(+), 5200 deletions(-) create mode 100644 src/mesa/drivers/x11/glxheader.h create mode 100644 src/mesa/glapi/glapi.c create mode 100644 src/mesa/glapi/glapi.h create mode 100644 src/mesa/main/dispatch.c create mode 100644 src/mesa/main/glheader.h (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index a37382bd820..0ab6b2aa138 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,8 +1,8 @@ -/* $Id: gl.h,v 1.17 1999/11/05 18:20:31 tjump Exp $ */ +/* $Id: gl.h,v 1.18 1999/11/11 01:27:17 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -45,6 +45,11 @@ #endif +/* + * XXX move as many of these pragma's and MS Windows-isms into + * the new src/glheader.h file. + */ + #if defined(_WIN32) && !defined(__WIN32__) # define __WIN32__ #endif @@ -127,991 +132,967 @@ extern "C" { /* * Apps can test for this symbol to do conditional compilation if needed. */ +/* XXX these Mesa symbols are going away #define MESA - #define MESA_MAJOR_VERSION 3 #define MESA_MINOR_VERSION 1 +*/ #define GL_VERSION_1_1 1 #define GL_VERSION_1_2 1 + /* * - * Enumerations + * Datatypes * */ +#ifdef CENTERLINE_CLPP +#define signed +#endif +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef void GLvoid; +typedef signed char GLbyte; /* 1-byte signed */ +typedef short GLshort; /* 2-byte signed */ +typedef int GLint; /* 4-byte signed */ +typedef unsigned char GLubyte; /* 1-byte unsigned */ +typedef unsigned short GLushort; /* 2-byte unsigned */ +typedef unsigned int GLuint; /* 4-byte unsigned */ +typedef int GLsizei; /* 4-byte signed */ +typedef float GLfloat; /* single precision float */ +typedef float GLclampf; /* single precision float in [0,1] */ +typedef double GLdouble; /* double precision float */ +typedef double GLclampd; /* double precision float in [0,1] */ -typedef enum { - /* Boolean values */ - GL_FALSE = 0, - GL_TRUE = 1, - - /* Data types */ - GL_BYTE = 0x1400, - GL_UNSIGNED_BYTE = 0x1401, - GL_SHORT = 0x1402, - GL_UNSIGNED_SHORT = 0x1403, - GL_INT = 0x1404, - GL_UNSIGNED_INT = 0x1405, - GL_FLOAT = 0x1406, - GL_DOUBLE = 0x140A, - GL_2_BYTES = 0x1407, - GL_3_BYTES = 0x1408, - GL_4_BYTES = 0x1409, - - /* Primitives */ - GL_POINTS = 0x0000, - GL_LINES = 0x0001, - GL_LINE_LOOP = 0x0002, - GL_LINE_STRIP = 0x0003, - GL_TRIANGLES = 0x0004, - GL_TRIANGLE_STRIP = 0x0005, - GL_TRIANGLE_FAN = 0x0006, - GL_QUADS = 0x0007, - GL_QUAD_STRIP = 0x0008, - GL_POLYGON = 0x0009, - - /* Vertex Arrays */ - GL_VERTEX_ARRAY = 0x8074, - GL_NORMAL_ARRAY = 0x8075, - GL_COLOR_ARRAY = 0x8076, - GL_INDEX_ARRAY = 0x8077, - GL_TEXTURE_COORD_ARRAY = 0x8078, - GL_EDGE_FLAG_ARRAY = 0x8079, - GL_VERTEX_ARRAY_SIZE = 0x807A, - GL_VERTEX_ARRAY_TYPE = 0x807B, - GL_VERTEX_ARRAY_STRIDE = 0x807C, - GL_NORMAL_ARRAY_TYPE = 0x807E, - GL_NORMAL_ARRAY_STRIDE = 0x807F, - GL_COLOR_ARRAY_SIZE = 0x8081, - GL_COLOR_ARRAY_TYPE = 0x8082, - GL_COLOR_ARRAY_STRIDE = 0x8083, - GL_INDEX_ARRAY_TYPE = 0x8085, - GL_INDEX_ARRAY_STRIDE = 0x8086, - GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088, - GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089, - GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A, - GL_EDGE_FLAG_ARRAY_STRIDE = 0x808C, - GL_VERTEX_ARRAY_POINTER = 0x808E, - GL_NORMAL_ARRAY_POINTER = 0x808F, - GL_COLOR_ARRAY_POINTER = 0x8090, - GL_INDEX_ARRAY_POINTER = 0x8091, - GL_TEXTURE_COORD_ARRAY_POINTER = 0x8092, - GL_EDGE_FLAG_ARRAY_POINTER = 0x8093, - GL_V2F = 0x2A20, - GL_V3F = 0x2A21, - GL_C4UB_V2F = 0x2A22, - GL_C4UB_V3F = 0x2A23, - GL_C3F_V3F = 0x2A24, - GL_N3F_V3F = 0x2A25, - GL_C4F_N3F_V3F = 0x2A26, - GL_T2F_V3F = 0x2A27, - GL_T4F_V4F = 0x2A28, - GL_T2F_C4UB_V3F = 0x2A29, - GL_T2F_C3F_V3F = 0x2A2A, - GL_T2F_N3F_V3F = 0x2A2B, - GL_T2F_C4F_N3F_V3F = 0x2A2C, - GL_T4F_C4F_N3F_V4F = 0x2A2D, - - /* Matrix Mode */ - GL_MATRIX_MODE = 0x0BA0, - GL_MODELVIEW = 0x1700, - GL_PROJECTION = 0x1701, - GL_TEXTURE = 0x1702, - - /* Points */ - GL_POINT_SMOOTH = 0x0B10, - GL_POINT_SIZE = 0x0B11, - GL_POINT_SIZE_GRANULARITY = 0x0B13, - GL_POINT_SIZE_RANGE = 0x0B12, - - /* Lines */ - GL_LINE_SMOOTH = 0x0B20, - GL_LINE_STIPPLE = 0x0B24, - GL_LINE_STIPPLE_PATTERN = 0x0B25, - GL_LINE_STIPPLE_REPEAT = 0x0B26, - GL_LINE_WIDTH = 0x0B21, - GL_LINE_WIDTH_GRANULARITY = 0x0B23, - GL_LINE_WIDTH_RANGE = 0x0B22, - - /* Polygons */ - GL_POINT = 0x1B00, - GL_LINE = 0x1B01, - GL_FILL = 0x1B02, - GL_CW = 0x0900, - GL_CCW = 0x0901, - GL_FRONT = 0x0404, - GL_BACK = 0x0405, - GL_POLYGON_MODE = 0x0B40, - GL_POLYGON_SMOOTH = 0x0B41, - GL_POLYGON_STIPPLE = 0x0B42, - GL_EDGE_FLAG = 0x0B43, - GL_CULL_FACE = 0x0B44, - GL_CULL_FACE_MODE = 0x0B45, - GL_FRONT_FACE = 0x0B46, - GL_POLYGON_OFFSET_FACTOR = 0x8038, - GL_POLYGON_OFFSET_UNITS = 0x2A00, - GL_POLYGON_OFFSET_POINT = 0x2A01, - GL_POLYGON_OFFSET_LINE = 0x2A02, - GL_POLYGON_OFFSET_FILL = 0x8037, - - /* Display Lists */ - GL_COMPILE = 0x1300, - GL_COMPILE_AND_EXECUTE = 0x1301, - GL_LIST_BASE = 0x0B32, - GL_LIST_INDEX = 0x0B33, - GL_LIST_MODE = 0x0B30, - - /* Depth buffer */ - GL_NEVER = 0x0200, - GL_LESS = 0x0201, - GL_GEQUAL = 0x0206, - GL_LEQUAL = 0x0203, - GL_GREATER = 0x0204, - GL_NOTEQUAL = 0x0205, - GL_EQUAL = 0x0202, - GL_ALWAYS = 0x0207, - GL_DEPTH_TEST = 0x0B71, - GL_DEPTH_BITS = 0x0D56, - GL_DEPTH_CLEAR_VALUE = 0x0B73, - GL_DEPTH_FUNC = 0x0B74, - GL_DEPTH_RANGE = 0x0B70, - GL_DEPTH_WRITEMASK = 0x0B72, - GL_DEPTH_COMPONENT = 0x1902, - - /* Lighting */ - GL_LIGHTING = 0x0B50, - GL_LIGHT0 = 0x4000, - GL_LIGHT1 = 0x4001, - GL_LIGHT2 = 0x4002, - GL_LIGHT3 = 0x4003, - GL_LIGHT4 = 0x4004, - GL_LIGHT5 = 0x4005, - GL_LIGHT6 = 0x4006, - GL_LIGHT7 = 0x4007, - GL_SPOT_EXPONENT = 0x1205, - GL_SPOT_CUTOFF = 0x1206, - GL_CONSTANT_ATTENUATION = 0x1207, - GL_LINEAR_ATTENUATION = 0x1208, - GL_QUADRATIC_ATTENUATION = 0x1209, - GL_AMBIENT = 0x1200, - GL_DIFFUSE = 0x1201, - GL_SPECULAR = 0x1202, - GL_SHININESS = 0x1601, - GL_EMISSION = 0x1600, - GL_POSITION = 0x1203, - GL_SPOT_DIRECTION = 0x1204, - GL_AMBIENT_AND_DIFFUSE = 0x1602, - GL_COLOR_INDEXES = 0x1603, - GL_LIGHT_MODEL_TWO_SIDE = 0x0B52, - GL_LIGHT_MODEL_LOCAL_VIEWER = 0x0B51, - GL_LIGHT_MODEL_AMBIENT = 0x0B53, - GL_FRONT_AND_BACK = 0x0408, - GL_SHADE_MODEL = 0x0B54, - GL_FLAT = 0x1D00, - GL_SMOOTH = 0x1D01, - GL_COLOR_MATERIAL = 0x0B57, - GL_COLOR_MATERIAL_FACE = 0x0B55, - GL_COLOR_MATERIAL_PARAMETER = 0x0B56, - GL_NORMALIZE = 0x0BA1, - - /* User clipping planes */ - GL_CLIP_PLANE0 = 0x3000, - GL_CLIP_PLANE1 = 0x3001, - GL_CLIP_PLANE2 = 0x3002, - GL_CLIP_PLANE3 = 0x3003, - GL_CLIP_PLANE4 = 0x3004, - GL_CLIP_PLANE5 = 0x3005, - - /* Accumulation buffer */ - GL_ACCUM_RED_BITS = 0x0D58, - GL_ACCUM_GREEN_BITS = 0x0D59, - GL_ACCUM_BLUE_BITS = 0x0D5A, - GL_ACCUM_ALPHA_BITS = 0x0D5B, - GL_ACCUM_CLEAR_VALUE = 0x0B80, - GL_ACCUM = 0x0100, - GL_ADD = 0x0104, - GL_LOAD = 0x0101, - GL_MULT = 0x0103, - GL_RETURN = 0x0102, - - /* Alpha testing */ - GL_ALPHA_TEST = 0x0BC0, - GL_ALPHA_TEST_REF = 0x0BC2, - GL_ALPHA_TEST_FUNC = 0x0BC1, - - /* Blending */ - GL_BLEND = 0x0BE2, - GL_BLEND_SRC = 0x0BE1, - GL_BLEND_DST = 0x0BE0, - GL_ZERO = 0, - GL_ONE = 1, - GL_SRC_COLOR = 0x0300, - GL_ONE_MINUS_SRC_COLOR = 0x0301, - GL_DST_COLOR = 0x0306, - GL_ONE_MINUS_DST_COLOR = 0x0307, - GL_SRC_ALPHA = 0x0302, - GL_ONE_MINUS_SRC_ALPHA = 0x0303, - GL_DST_ALPHA = 0x0304, - GL_ONE_MINUS_DST_ALPHA = 0x0305, - GL_SRC_ALPHA_SATURATE = 0x0308, - GL_CONSTANT_COLOR = 0x8001, - GL_ONE_MINUS_CONSTANT_COLOR = 0x8002, - GL_CONSTANT_ALPHA = 0x8003, - GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004, - - /* Render Mode */ - GL_FEEDBACK = 0x1C01, - GL_RENDER = 0x1C00, - GL_SELECT = 0x1C02, - - /* Feedback */ - GL_2D = 0x0600, - GL_3D = 0x0601, - GL_3D_COLOR = 0x0602, - GL_3D_COLOR_TEXTURE = 0x0603, - GL_4D_COLOR_TEXTURE = 0x0604, - GL_POINT_TOKEN = 0x0701, - GL_LINE_TOKEN = 0x0702, - GL_LINE_RESET_TOKEN = 0x0707, - GL_POLYGON_TOKEN = 0x0703, - GL_BITMAP_TOKEN = 0x0704, - GL_DRAW_PIXEL_TOKEN = 0x0705, - GL_COPY_PIXEL_TOKEN = 0x0706, - GL_PASS_THROUGH_TOKEN = 0x0700, - GL_FEEDBACK_BUFFER_POINTER = 0x0DF0, - GL_FEEDBACK_BUFFER_SIZE = 0x0DF1, - GL_FEEDBACK_BUFFER_TYPE = 0x0DF2, - - /* Selection */ - GL_SELECTION_BUFFER_POINTER = 0x0DF3, - GL_SELECTION_BUFFER_SIZE = 0x0DF4, - - /* Fog */ - GL_FOG = 0x0B60, - GL_FOG_MODE = 0x0B65, - GL_FOG_DENSITY = 0x0B62, - GL_FOG_COLOR = 0x0B66, - GL_FOG_INDEX = 0x0B61, - GL_FOG_START = 0x0B63, - GL_FOG_END = 0x0B64, - GL_LINEAR = 0x2601, - GL_EXP = 0x0800, - GL_EXP2 = 0x0801, - - /* Logic Ops */ - GL_LOGIC_OP = 0x0BF1, - GL_INDEX_LOGIC_OP = 0x0BF1, - GL_COLOR_LOGIC_OP = 0x0BF2, - GL_LOGIC_OP_MODE = 0x0BF0, - GL_CLEAR = 0x1500, - GL_SET = 0x150F, - GL_COPY = 0x1503, - GL_COPY_INVERTED = 0x150C, - GL_NOOP = 0x1505, - GL_INVERT = 0x150A, - GL_AND = 0x1501, - GL_NAND = 0x150E, - GL_OR = 0x1507, - GL_NOR = 0x1508, - GL_XOR = 0x1506, - GL_EQUIV = 0x1509, - GL_AND_REVERSE = 0x1502, - GL_AND_INVERTED = 0x1504, - GL_OR_REVERSE = 0x150B, - GL_OR_INVERTED = 0x150D, - - /* Stencil */ - GL_STENCIL_TEST = 0x0B90, - GL_STENCIL_WRITEMASK = 0x0B98, - GL_STENCIL_BITS = 0x0D57, - GL_STENCIL_FUNC = 0x0B92, - GL_STENCIL_VALUE_MASK = 0x0B93, - GL_STENCIL_REF = 0x0B97, - GL_STENCIL_FAIL = 0x0B94, - GL_STENCIL_PASS_DEPTH_PASS = 0x0B96, - GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95, - GL_STENCIL_CLEAR_VALUE = 0x0B91, - GL_STENCIL_INDEX = 0x1901, - GL_KEEP = 0x1E00, - GL_REPLACE = 0x1E01, - GL_INCR = 0x1E02, - GL_DECR = 0x1E03, - - /* Buffers, Pixel Drawing/Reading */ - GL_NONE = 0, - GL_LEFT = 0x0406, - GL_RIGHT = 0x0407, - /*GL_FRONT = 0x0404, */ - /*GL_BACK = 0x0405, */ - /*GL_FRONT_AND_BACK = 0x0408, */ - GL_FRONT_LEFT = 0x0400, - GL_FRONT_RIGHT = 0x0401, - GL_BACK_LEFT = 0x0402, - GL_BACK_RIGHT = 0x0403, - GL_AUX0 = 0x0409, - GL_AUX1 = 0x040A, - GL_AUX2 = 0x040B, - GL_AUX3 = 0x040C, - GL_COLOR_INDEX = 0x1900, - GL_RED = 0x1903, - GL_GREEN = 0x1904, - GL_BLUE = 0x1905, - GL_ALPHA = 0x1906, - GL_LUMINANCE = 0x1909, - GL_LUMINANCE_ALPHA = 0x190A, - GL_ALPHA_BITS = 0x0D55, - GL_RED_BITS = 0x0D52, - GL_GREEN_BITS = 0x0D53, - GL_BLUE_BITS = 0x0D54, - GL_INDEX_BITS = 0x0D51, - GL_SUBPIXEL_BITS = 0x0D50, - GL_AUX_BUFFERS = 0x0C00, - GL_READ_BUFFER = 0x0C02, - GL_DRAW_BUFFER = 0x0C01, - GL_DOUBLEBUFFER = 0x0C32, - GL_STEREO = 0x0C33, - GL_BITMAP = 0x1A00, - GL_COLOR = 0x1800, - GL_DEPTH = 0x1801, - GL_STENCIL = 0x1802, - GL_DITHER = 0x0BD0, - GL_RGB = 0x1907, - GL_RGBA = 0x1908, - - /* Implementation limits */ - GL_MAX_LIST_NESTING = 0x0B31, - GL_MAX_ATTRIB_STACK_DEPTH = 0x0D35, - GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36, - GL_MAX_NAME_STACK_DEPTH = 0x0D37, - GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38, - GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39, - GL_MAX_EVAL_ORDER = 0x0D30, - GL_MAX_LIGHTS = 0x0D31, - GL_MAX_CLIP_PLANES = 0x0D32, - GL_MAX_TEXTURE_SIZE = 0x0D33, - GL_MAX_PIXEL_MAP_TABLE = 0x0D34, - GL_MAX_VIEWPORT_DIMS = 0x0D3A, - GL_MAX_CLIENT_ATTRIB_STACK_DEPTH= 0x0D3B, - - /* Gets */ - GL_ATTRIB_STACK_DEPTH = 0x0BB0, - GL_CLIENT_ATTRIB_STACK_DEPTH = 0x0BB1, - GL_COLOR_CLEAR_VALUE = 0x0C22, - GL_COLOR_WRITEMASK = 0x0C23, - GL_CURRENT_INDEX = 0x0B01, - GL_CURRENT_COLOR = 0x0B00, - GL_CURRENT_NORMAL = 0x0B02, - GL_CURRENT_RASTER_COLOR = 0x0B04, - GL_CURRENT_RASTER_DISTANCE = 0x0B09, - GL_CURRENT_RASTER_INDEX = 0x0B05, - GL_CURRENT_RASTER_POSITION = 0x0B07, - GL_CURRENT_RASTER_TEXTURE_COORDS = 0x0B06, - GL_CURRENT_RASTER_POSITION_VALID = 0x0B08, - GL_CURRENT_TEXTURE_COORDS = 0x0B03, - GL_INDEX_CLEAR_VALUE = 0x0C20, - GL_INDEX_MODE = 0x0C30, - GL_INDEX_WRITEMASK = 0x0C21, - GL_MODELVIEW_MATRIX = 0x0BA6, - GL_MODELVIEW_STACK_DEPTH = 0x0BA3, - GL_NAME_STACK_DEPTH = 0x0D70, - GL_PROJECTION_MATRIX = 0x0BA7, - GL_PROJECTION_STACK_DEPTH = 0x0BA4, - GL_RENDER_MODE = 0x0C40, - GL_RGBA_MODE = 0x0C31, - GL_TEXTURE_MATRIX = 0x0BA8, - GL_TEXTURE_STACK_DEPTH = 0x0BA5, - GL_VIEWPORT = 0x0BA2, - - /* Evaluators */ - GL_AUTO_NORMAL = 0x0D80, - GL_MAP1_COLOR_4 = 0x0D90, - GL_MAP1_GRID_DOMAIN = 0x0DD0, - GL_MAP1_GRID_SEGMENTS = 0x0DD1, - GL_MAP1_INDEX = 0x0D91, - GL_MAP1_NORMAL = 0x0D92, - GL_MAP1_TEXTURE_COORD_1 = 0x0D93, - GL_MAP1_TEXTURE_COORD_2 = 0x0D94, - GL_MAP1_TEXTURE_COORD_3 = 0x0D95, - GL_MAP1_TEXTURE_COORD_4 = 0x0D96, - GL_MAP1_VERTEX_3 = 0x0D97, - GL_MAP1_VERTEX_4 = 0x0D98, - GL_MAP2_COLOR_4 = 0x0DB0, - GL_MAP2_GRID_DOMAIN = 0x0DD2, - GL_MAP2_GRID_SEGMENTS = 0x0DD3, - GL_MAP2_INDEX = 0x0DB1, - GL_MAP2_NORMAL = 0x0DB2, - GL_MAP2_TEXTURE_COORD_1 = 0x0DB3, - GL_MAP2_TEXTURE_COORD_2 = 0x0DB4, - GL_MAP2_TEXTURE_COORD_3 = 0x0DB5, - GL_MAP2_TEXTURE_COORD_4 = 0x0DB6, - GL_MAP2_VERTEX_3 = 0x0DB7, - GL_MAP2_VERTEX_4 = 0x0DB8, - GL_COEFF = 0x0A00, - GL_DOMAIN = 0x0A02, - GL_ORDER = 0x0A01, - - /* Hints */ - GL_FOG_HINT = 0x0C54, - GL_LINE_SMOOTH_HINT = 0x0C52, - GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50, - GL_POINT_SMOOTH_HINT = 0x0C51, - GL_POLYGON_SMOOTH_HINT = 0x0C53, - GL_DONT_CARE = 0x1100, - GL_FASTEST = 0x1101, - GL_NICEST = 0x1102, - - /* Scissor box */ - GL_SCISSOR_TEST = 0x0C11, - GL_SCISSOR_BOX = 0x0C10, - - /* Pixel Mode / Transfer */ - GL_MAP_COLOR = 0x0D10, - GL_MAP_STENCIL = 0x0D11, - GL_INDEX_SHIFT = 0x0D12, - GL_INDEX_OFFSET = 0x0D13, - GL_RED_SCALE = 0x0D14, - GL_RED_BIAS = 0x0D15, - GL_GREEN_SCALE = 0x0D18, - GL_GREEN_BIAS = 0x0D19, - GL_BLUE_SCALE = 0x0D1A, - GL_BLUE_BIAS = 0x0D1B, - GL_ALPHA_SCALE = 0x0D1C, - GL_ALPHA_BIAS = 0x0D1D, - GL_DEPTH_SCALE = 0x0D1E, - GL_DEPTH_BIAS = 0x0D1F, - GL_PIXEL_MAP_S_TO_S_SIZE = 0x0CB1, - GL_PIXEL_MAP_I_TO_I_SIZE = 0x0CB0, - GL_PIXEL_MAP_I_TO_R_SIZE = 0x0CB2, - GL_PIXEL_MAP_I_TO_G_SIZE = 0x0CB3, - GL_PIXEL_MAP_I_TO_B_SIZE = 0x0CB4, - GL_PIXEL_MAP_I_TO_A_SIZE = 0x0CB5, - GL_PIXEL_MAP_R_TO_R_SIZE = 0x0CB6, - GL_PIXEL_MAP_G_TO_G_SIZE = 0x0CB7, - GL_PIXEL_MAP_B_TO_B_SIZE = 0x0CB8, - GL_PIXEL_MAP_A_TO_A_SIZE = 0x0CB9, - GL_PIXEL_MAP_S_TO_S = 0x0C71, - GL_PIXEL_MAP_I_TO_I = 0x0C70, - GL_PIXEL_MAP_I_TO_R = 0x0C72, - GL_PIXEL_MAP_I_TO_G = 0x0C73, - GL_PIXEL_MAP_I_TO_B = 0x0C74, - GL_PIXEL_MAP_I_TO_A = 0x0C75, - GL_PIXEL_MAP_R_TO_R = 0x0C76, - GL_PIXEL_MAP_G_TO_G = 0x0C77, - GL_PIXEL_MAP_B_TO_B = 0x0C78, - GL_PIXEL_MAP_A_TO_A = 0x0C79, - GL_PACK_ALIGNMENT = 0x0D05, - GL_PACK_LSB_FIRST = 0x0D01, - GL_PACK_ROW_LENGTH = 0x0D02, - GL_PACK_SKIP_PIXELS = 0x0D04, - GL_PACK_SKIP_ROWS = 0x0D03, - GL_PACK_SWAP_BYTES = 0x0D00, - GL_UNPACK_ALIGNMENT = 0x0CF5, - GL_UNPACK_LSB_FIRST = 0x0CF1, - GL_UNPACK_ROW_LENGTH = 0x0CF2, - GL_UNPACK_SKIP_PIXELS = 0x0CF4, - GL_UNPACK_SKIP_ROWS = 0x0CF3, - GL_UNPACK_SWAP_BYTES = 0x0CF0, - GL_ZOOM_X = 0x0D16, - GL_ZOOM_Y = 0x0D17, - - /* Texture mapping */ - GL_TEXTURE_ENV = 0x2300, - GL_TEXTURE_ENV_MODE = 0x2200, - GL_TEXTURE_1D = 0x0DE0, - GL_TEXTURE_2D = 0x0DE1, - GL_TEXTURE_WRAP_S = 0x2802, - GL_TEXTURE_WRAP_T = 0x2803, - GL_TEXTURE_MAG_FILTER = 0x2800, - GL_TEXTURE_MIN_FILTER = 0x2801, - GL_TEXTURE_ENV_COLOR = 0x2201, - GL_TEXTURE_GEN_S = 0x0C60, - GL_TEXTURE_GEN_T = 0x0C61, - GL_TEXTURE_GEN_MODE = 0x2500, - GL_TEXTURE_BORDER_COLOR = 0x1004, - GL_TEXTURE_WIDTH = 0x1000, - GL_TEXTURE_HEIGHT = 0x1001, - GL_TEXTURE_BORDER = 0x1005, - GL_TEXTURE_COMPONENTS = 0x1003, - GL_TEXTURE_RED_SIZE = 0x805C, - GL_TEXTURE_GREEN_SIZE = 0x805D, - GL_TEXTURE_BLUE_SIZE = 0x805E, - GL_TEXTURE_ALPHA_SIZE = 0x805F, - GL_TEXTURE_LUMINANCE_SIZE = 0x8060, - GL_TEXTURE_INTENSITY_SIZE = 0x8061, - GL_NEAREST_MIPMAP_NEAREST = 0x2700, - GL_NEAREST_MIPMAP_LINEAR = 0x2702, - GL_LINEAR_MIPMAP_NEAREST = 0x2701, - GL_LINEAR_MIPMAP_LINEAR = 0x2703, - GL_OBJECT_LINEAR = 0x2401, - GL_OBJECT_PLANE = 0x2501, - GL_EYE_LINEAR = 0x2400, - GL_EYE_PLANE = 0x2502, - GL_SPHERE_MAP = 0x2402, - GL_DECAL = 0x2101, - GL_MODULATE = 0x2100, - GL_NEAREST = 0x2600, - GL_REPEAT = 0x2901, - GL_CLAMP = 0x2900, - GL_S = 0x2000, - GL_T = 0x2001, - GL_R = 0x2002, - GL_Q = 0x2003, - GL_TEXTURE_GEN_R = 0x0C62, - GL_TEXTURE_GEN_Q = 0x0C63, - - /* GL 1.1 texturing */ - GL_PROXY_TEXTURE_1D = 0x8063, - GL_PROXY_TEXTURE_2D = 0x8064, - GL_TEXTURE_PRIORITY = 0x8066, - GL_TEXTURE_RESIDENT = 0x8067, - GL_TEXTURE_BINDING_1D = 0x8068, - GL_TEXTURE_BINDING_2D = 0x8069, - GL_TEXTURE_INTERNAL_FORMAT = 0x1003, - - /* GL 1.2 texturing */ - GL_PACK_SKIP_IMAGES = 0x806B, - GL_PACK_IMAGE_HEIGHT = 0x806C, - GL_UNPACK_SKIP_IMAGES = 0x806D, - GL_UNPACK_IMAGE_HEIGHT = 0x806E, - GL_TEXTURE_3D = 0x806F, - GL_PROXY_TEXTURE_3D = 0x8070, - GL_TEXTURE_DEPTH = 0x8071, - GL_TEXTURE_WRAP_R = 0x8072, - GL_MAX_3D_TEXTURE_SIZE = 0x8073, - GL_TEXTURE_BINDING_3D = 0x806A, - - /* Internal texture formats (GL 1.1) */ - GL_ALPHA4 = 0x803B, - GL_ALPHA8 = 0x803C, - GL_ALPHA12 = 0x803D, - GL_ALPHA16 = 0x803E, - GL_LUMINANCE4 = 0x803F, - GL_LUMINANCE8 = 0x8040, - GL_LUMINANCE12 = 0x8041, - GL_LUMINANCE16 = 0x8042, - GL_LUMINANCE4_ALPHA4 = 0x8043, - GL_LUMINANCE6_ALPHA2 = 0x8044, - GL_LUMINANCE8_ALPHA8 = 0x8045, - GL_LUMINANCE12_ALPHA4 = 0x8046, - GL_LUMINANCE12_ALPHA12 = 0x8047, - GL_LUMINANCE16_ALPHA16 = 0x8048, - GL_INTENSITY = 0x8049, - GL_INTENSITY4 = 0x804A, - GL_INTENSITY8 = 0x804B, - GL_INTENSITY12 = 0x804C, - GL_INTENSITY16 = 0x804D, - GL_R3_G3_B2 = 0x2A10, - GL_RGB4 = 0x804F, - GL_RGB5 = 0x8050, - GL_RGB8 = 0x8051, - GL_RGB10 = 0x8052, - GL_RGB12 = 0x8053, - GL_RGB16 = 0x8054, - GL_RGBA2 = 0x8055, - GL_RGBA4 = 0x8056, - GL_RGB5_A1 = 0x8057, - GL_RGBA8 = 0x8058, - GL_RGB10_A2 = 0x8059, - GL_RGBA12 = 0x805A, - GL_RGBA16 = 0x805B, - - /* Utility */ - GL_VENDOR = 0x1F00, - GL_RENDERER = 0x1F01, - GL_VERSION = 0x1F02, - GL_EXTENSIONS = 0x1F03, - - /* Errors */ - GL_INVALID_VALUE = 0x0501, - GL_INVALID_ENUM = 0x0500, - GL_INVALID_OPERATION = 0x0502, - GL_STACK_OVERFLOW = 0x0503, - GL_STACK_UNDERFLOW = 0x0504, - GL_OUT_OF_MEMORY = 0x0505, - - /* - * Extensions - */ - - /* GL_EXT_blend_minmax and GL_EXT_blend_color */ - GL_CONSTANT_COLOR_EXT = 0x8001, - GL_ONE_MINUS_CONSTANT_COLOR_EXT = 0x8002, - GL_CONSTANT_ALPHA_EXT = 0x8003, - GL_ONE_MINUS_CONSTANT_ALPHA_EXT = 0x8004, - GL_BLEND_EQUATION_EXT = 0x8009, - GL_MIN_EXT = 0x8007, - GL_MAX_EXT = 0x8008, - GL_FUNC_ADD_EXT = 0x8006, - GL_FUNC_SUBTRACT_EXT = 0x800A, - GL_FUNC_REVERSE_SUBTRACT_EXT = 0x800B, - GL_BLEND_COLOR_EXT = 0x8005, - - /* GL_EXT_polygon_offset */ - GL_POLYGON_OFFSET_EXT = 0x8037, - GL_POLYGON_OFFSET_FACTOR_EXT = 0x8038, - GL_POLYGON_OFFSET_BIAS_EXT = 0x8039, - - /* GL_EXT_vertex_array */ - GL_VERTEX_ARRAY_EXT = 0x8074, - GL_NORMAL_ARRAY_EXT = 0x8075, - GL_COLOR_ARRAY_EXT = 0x8076, - GL_INDEX_ARRAY_EXT = 0x8077, - GL_TEXTURE_COORD_ARRAY_EXT = 0x8078, - GL_EDGE_FLAG_ARRAY_EXT = 0x8079, - GL_VERTEX_ARRAY_SIZE_EXT = 0x807A, - GL_VERTEX_ARRAY_TYPE_EXT = 0x807B, - GL_VERTEX_ARRAY_STRIDE_EXT = 0x807C, - GL_VERTEX_ARRAY_COUNT_EXT = 0x807D, - GL_NORMAL_ARRAY_TYPE_EXT = 0x807E, - GL_NORMAL_ARRAY_STRIDE_EXT = 0x807F, - GL_NORMAL_ARRAY_COUNT_EXT = 0x8080, - GL_COLOR_ARRAY_SIZE_EXT = 0x8081, - GL_COLOR_ARRAY_TYPE_EXT = 0x8082, - GL_COLOR_ARRAY_STRIDE_EXT = 0x8083, - GL_COLOR_ARRAY_COUNT_EXT = 0x8084, - GL_INDEX_ARRAY_TYPE_EXT = 0x8085, - GL_INDEX_ARRAY_STRIDE_EXT = 0x8086, - GL_INDEX_ARRAY_COUNT_EXT = 0x8087, - GL_TEXTURE_COORD_ARRAY_SIZE_EXT = 0x8088, - GL_TEXTURE_COORD_ARRAY_TYPE_EXT = 0x8089, - GL_TEXTURE_COORD_ARRAY_STRIDE_EXT = 0x808A, - GL_TEXTURE_COORD_ARRAY_COUNT_EXT = 0x808B, - GL_EDGE_FLAG_ARRAY_STRIDE_EXT = 0x808C, - GL_EDGE_FLAG_ARRAY_COUNT_EXT = 0x808D, - GL_VERTEX_ARRAY_POINTER_EXT = 0x808E, - GL_NORMAL_ARRAY_POINTER_EXT = 0x808F, - GL_COLOR_ARRAY_POINTER_EXT = 0x8090, - GL_INDEX_ARRAY_POINTER_EXT = 0x8091, - GL_TEXTURE_COORD_ARRAY_POINTER_EXT = 0x8092, - GL_EDGE_FLAG_ARRAY_POINTER_EXT = 0x8093, - - /* GL_EXT_texture_object */ - GL_TEXTURE_PRIORITY_EXT = 0x8066, - GL_TEXTURE_RESIDENT_EXT = 0x8067, - GL_TEXTURE_1D_BINDING_EXT = 0x8068, - GL_TEXTURE_2D_BINDING_EXT = 0x8069, - - /* GL_EXT_texture3D */ - GL_PACK_SKIP_IMAGES_EXT = 0x806B, - GL_PACK_IMAGE_HEIGHT_EXT = 0x806C, - GL_UNPACK_SKIP_IMAGES_EXT = 0x806D, - GL_UNPACK_IMAGE_HEIGHT_EXT = 0x806E, - GL_TEXTURE_3D_EXT = 0x806F, - GL_PROXY_TEXTURE_3D_EXT = 0x8070, - GL_TEXTURE_DEPTH_EXT = 0x8071, - GL_TEXTURE_WRAP_R_EXT = 0x8072, - GL_MAX_3D_TEXTURE_SIZE_EXT = 0x8073, - GL_TEXTURE_3D_BINDING_EXT = 0x806A, - - /* GL_EXT_paletted_texture */ - GL_TABLE_TOO_LARGE_EXT = 0x8031, - GL_COLOR_TABLE_FORMAT_EXT = 0x80D8, - GL_COLOR_TABLE_WIDTH_EXT = 0x80D9, - GL_COLOR_TABLE_RED_SIZE_EXT = 0x80DA, - GL_COLOR_TABLE_GREEN_SIZE_EXT = 0x80DB, - GL_COLOR_TABLE_BLUE_SIZE_EXT = 0x80DC, - GL_COLOR_TABLE_ALPHA_SIZE_EXT = 0x80DD, - GL_COLOR_TABLE_LUMINANCE_SIZE_EXT = 0x80DE, - GL_COLOR_TABLE_INTENSITY_SIZE_EXT = 0x80DF, - GL_TEXTURE_INDEX_SIZE_EXT = 0x80ED, - GL_COLOR_INDEX1_EXT = 0x80E2, - GL_COLOR_INDEX2_EXT = 0x80E3, - GL_COLOR_INDEX4_EXT = 0x80E4, - GL_COLOR_INDEX8_EXT = 0x80E5, - GL_COLOR_INDEX12_EXT = 0x80E6, - GL_COLOR_INDEX16_EXT = 0x80E7, - - /* GL_EXT_shared_texture_palette */ - GL_SHARED_TEXTURE_PALETTE_EXT = 0x81FB, - - /* GL_EXT_point_parameters */ - GL_POINT_SIZE_MIN_EXT = 0x8126, - GL_POINT_SIZE_MAX_EXT = 0x8127, - GL_POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128, - GL_DISTANCE_ATTENUATION_EXT = 0x8129, - - /* GL_EXT_rescale_normal */ - GL_RESCALE_NORMAL_EXT = 0x803A, - - /* GL_EXT_abgr */ - GL_ABGR_EXT = 0x8000, - - /* GL_EXT_stencil_wrap */ - GL_INCR_WRAP_EXT = 0x8507, - GL_DECR_WRAP_EXT = 0x8508, - - /* GL_SGIS_texture_edge_clamp */ - GL_CLAMP_TO_EDGE_SGIS = 0x812F, - - /* GL_INGR_blend_func_separate */ - GL_BLEND_DST_RGB_INGR = 0x80C8, - GL_BLEND_SRC_RGB_INGR = 0x80C9, - GL_BLEND_DST_ALPHA_INGR = 0x80CA, - GL_BLEND_SRC_ALPHA_INGR = 0x80CB, - - /* OpenGL 1.2 */ - GL_RESCALE_NORMAL = 0x803A, - GL_CLAMP_TO_EDGE = 0x812F, - GL_MAX_ELEMENTS_VERTICES = 0x80E8, - GL_MAX_ELEMENTS_INDICES = 0x80E9, - GL_BGR = 0x80E0, - GL_BGRA = 0x80E1, - GL_UNSIGNED_BYTE_3_3_2 = 0x8032, - GL_UNSIGNED_BYTE_2_3_3_REV = 0x8362, - GL_UNSIGNED_SHORT_5_6_5 = 0x8363, - GL_UNSIGNED_SHORT_5_6_5_REV = 0x8364, - GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033, - GL_UNSIGNED_SHORT_4_4_4_4_REV = 0x8365, - GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034, - GL_UNSIGNED_SHORT_1_5_5_5_REV = 0x8366, - GL_UNSIGNED_INT_8_8_8_8 = 0x8035, - GL_UNSIGNED_INT_8_8_8_8_REV = 0x8367, - GL_UNSIGNED_INT_10_10_10_2 = 0x8036, - GL_UNSIGNED_INT_2_10_10_10_REV = 0x8368, - GL_LIGHT_MODEL_COLOR_CONTROL = 0x81F8, - GL_SINGLE_COLOR = 0x81F9, - GL_SEPARATE_SPECULAR_COLOR = 0x81FA, - GL_TEXTURE_MIN_LOD = 0x813A, - GL_TEXTURE_MAX_LOD = 0x813B, - GL_TEXTURE_BASE_LEVEL = 0x813C, - GL_TEXTURE_MAX_LEVEL = 0x813D, - - /* GL_ARB_multitexture */ - GL_TEXTURE0_ARB = 0x84C0, - GL_TEXTURE1_ARB = 0x84C1, - GL_TEXTURE2_ARB = 0x84C2, - GL_TEXTURE3_ARB = 0x84C3, - GL_TEXTURE4_ARB = 0x84C4, - GL_TEXTURE5_ARB = 0x84C5, - GL_TEXTURE6_ARB = 0x84C6, - GL_TEXTURE7_ARB = 0x84C7, - GL_TEXTURE8_ARB = 0x84C8, - GL_TEXTURE9_ARB = 0x84C9, - GL_TEXTURE10_ARB = 0x84CA, - GL_TEXTURE11_ARB = 0x84CB, - GL_TEXTURE12_ARB = 0x84CC, - GL_TEXTURE13_ARB = 0x84CD, - GL_TEXTURE14_ARB = 0x84CE, - GL_TEXTURE15_ARB = 0x84CF, - GL_TEXTURE16_ARB = 0x84D0, - GL_TEXTURE17_ARB = 0x84D1, - GL_TEXTURE18_ARB = 0x84D2, - GL_TEXTURE19_ARB = 0x84D3, - GL_TEXTURE20_ARB = 0x84D4, - GL_TEXTURE21_ARB = 0x84D5, - GL_TEXTURE22_ARB = 0x84D6, - GL_TEXTURE23_ARB = 0x84D7, - GL_TEXTURE24_ARB = 0x84D8, - GL_TEXTURE25_ARB = 0x84D9, - GL_TEXTURE26_ARB = 0x84DA, - GL_TEXTURE27_ARB = 0x84DB, - GL_TEXTURE28_ARB = 0x84DC, - GL_TEXTURE29_ARB = 0x84DD, - GL_TEXTURE30_ARB = 0x84DE, - GL_TEXTURE31_ARB = 0x84DF, - GL_ACTIVE_TEXTURE_ARB = 0x84E0, - GL_CLIENT_ACTIVE_TEXTURE_ARB = 0x84E1, - GL_MAX_TEXTURE_UNITS_ARB = 0x84E2, - - /* - * OpenGL 1.2 imaging subset (NOT IMPLEMENTED BY MESA) - */ - /* GL_EXT_color_table */ - GL_COLOR_TABLE = 0x80D0, - GL_POST_CONVOLUTION_COLOR_TABLE = 0x80D1, - GL_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D2, - GL_PROXY_COLOR_TABLE = 0x80D3, - GL_PROXY_POST_CONVOLUTION_COLOR_TABLE = 0x80D4, - GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D5, - GL_COLOR_TABLE_SCALE = 0x80D6, - GL_COLOR_TABLE_BIAS = 0x80D7, - GL_COLOR_TABLE_FORMAT = 0x80D8, - GL_COLOR_TABLE_WIDTH = 0x80D9, - GL_COLOR_TABLE_RED_SIZE = 0x80DA, - GL_COLOR_TABLE_GREEN_SIZE = 0x80DB, - GL_COLOR_TABLE_BLUE_SIZE = 0x80DC, - GL_COLOR_TABLE_ALPHA_SIZE = 0x80DD, - GL_COLOR_TABLE_LUMINANCE_SIZE = 0x80DE, - GL_COLOR_TABLE_INTENSITY_SIZE = 0x80DF, - /* GL_EXT_convolution and GL_HP_convolution_border_modes */ - GL_CONVOLUTION_1D = 0x8010, - GL_CONVOLUTION_2D = 0x8011, - GL_SEPARABLE_2D = 0x8012, - GL_CONVOLUTION_BORDER_MODE = 0x8013, - GL_CONVOLUTION_FILTER_SCALE = 0x8014, - GL_CONVOLUTION_FILTER_BIAS = 0x8015, - GL_REDUCE = 0x8016, - GL_CONVOLUTION_FORMAT = 0x8017, - GL_CONVOLUTION_WIDTH = 0x8018, - GL_CONVOLUTION_HEIGHT = 0x8019, - GL_MAX_CONVOLUTION_WIDTH = 0x801A, - GL_MAX_CONVOLUTION_HEIGHT = 0x801B, - GL_POST_CONVOLUTION_RED_SCALE = 0x801C, - GL_POST_CONVOLUTION_GREEN_SCALE = 0x801D, - GL_POST_CONVOLUTION_BLUE_SCALE = 0x801E, - GL_POST_CONVOLUTION_ALPHA_SCALE = 0x801F, - GL_POST_CONVOLUTION_RED_BIAS = 0x8020, - GL_POST_CONVOLUTION_GREEN_BIAS = 0x8021, - GL_POST_CONVOLUTION_BLUE_BIAS = 0x8022, - GL_POST_CONVOLUTION_ALPHA_BIAS = 0x8023, - GL_CONSTANT_BORDER = 0x8151, - GL_REPLICATE_BORDER = 0x8153, - GL_CONVOLUTION_BORDER_COLOR = 0x8154, - /* GL_SGI_color_matrix */ - GL_COLOR_MATRIX = 0x80B1, - GL_COLOR_MATRIX_STACK_DEPTH = 0x80B2, - GL_MAX_COLOR_MATRIX_STACK_DEPTH = 0x80B3, - GL_POST_COLOR_MATRIX_RED_SCALE = 0x80B4, - GL_POST_COLOR_MATRIX_GREEN_SCALE = 0x80B5, - GL_POST_COLOR_MATRIX_BLUE_SCALE = 0x80B6, - GL_POST_COLOR_MATRIX_ALPHA_SCALE = 0x80B7, - GL_POST_COLOR_MATRIX_RED_BIAS = 0x80B8, - GL_POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9, - GL_POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA, - GL_POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB, - /* GL_EXT_histogram */ - GL_HISTOGRAM = 0x8024, - GL_PROXY_HISTOGRAM = 0x8025, - GL_HISTOGRAM_WIDTH = 0x8026, - GL_HISTOGRAM_FORMAT = 0x8027, - GL_HISTOGRAM_RED_SIZE = 0x8028, - GL_HISTOGRAM_GREEN_SIZE = 0x8029, - GL_HISTOGRAM_BLUE_SIZE = 0x802A, - GL_HISTOGRAM_ALPHA_SIZE = 0x802B, - GL_HISTOGRAM_LUMINANCE_SIZE = 0x802C, - GL_HISTOGRAM_SINK = 0x802D, - GL_MINMAX = 0x802E, - GL_MINMAX_FORMAT = 0x802F, - GL_MINMAX_SINK = 0x8030, - GL_TABLE_TOO_LARGE = 0x8031, - /* GL_EXT_blend_color, GL_EXT_blend_minmax */ - GL_BLEND_EQUATION = 0x8009, - GL_MIN = 0x8007, - GL_MAX = 0x8008, - GL_FUNC_ADD = 0x8006, - GL_FUNC_SUBTRACT = 0x800A, - GL_FUNC_REVERSE_SUBTRACT = 0x800B, - GL_BLEND_COLOR = 0x8005, - - /* GL_NV_texgen_reflection (nVidia) */ - GL_NORMAL_MAP_NV = 0x8511, - GL_REFLECTION_MAP_NV = 0x8512, - - /* GL_PGI_misc_hints */ - GL_PREFER_DOUBLEBUFFER_HINT_PGI = 107000, - GL_STRICT_DEPTHFUNC_HINT_PGI = 107030, - GL_STRICT_LIGHTING_HINT_PGI = 107031, - GL_STRICT_SCISSOR_HINT_PGI = 107032, - GL_FULL_STIPPLE_HINT_PGI = 107033, - GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI = 107011, - GL_NATIVE_GRAPHICS_END_HINT_PGI = 107012, - GL_CONSERVE_MEMORY_HINT_PGI = 107005, - GL_RECLAIM_MEMORY_HINT_PGI = 107006, - GL_ALWAYS_FAST_HINT_PGI = 107020, - GL_ALWAYS_SOFT_HINT_PGI = 107021, - GL_ALLOW_DRAW_OBJ_HINT_PGI = 107022, - GL_ALLOW_DRAW_WIN_HINT_PGI = 107023, - GL_ALLOW_DRAW_FRG_HINT_PGI = 107024, - GL_ALLOW_DRAW_SPN_HINT_PGI = 107024, - GL_ALLOW_DRAW_MEM_HINT_PGI = 107025, - GL_CLIP_NEAR_HINT_PGI = 107040, - GL_CLIP_FAR_HINT_PGI = 107041, - GL_WIDE_LINE_HINT_PGI = 107042, - GL_BACK_NORMALS_HINT_PGI = 107043, - GL_NATIVE_GRAPHICS_HANDLE_PGI = 107010, - - /* GL_EXT_compiled_vertex_array */ - GL_ARRAY_ELEMENT_LOCK_FIRST_SGI = 0x81A8, - GL_ARRAY_ELEMENT_LOCK_COUNT_SGI = 0x81A9, - - /* GL_EXT_clip_volume_hint */ - GL_CLIP_VOLUME_CLIPPING_HINT_EXT = 0x80F0 - - -/* When you add new enums, please make sure you update the strings - * in enums.c as well... + + +/* + * + * Constants + * */ -} -#ifdef CENTERLINE_CLPP - /* CenterLine C++ workaround: */ - gl_enum; - typedef int GLenum; -#else - /* all other compilers */ - GLenum; -#endif +/* Boolean values */ +#define GL_FALSE 0x0 +#define GL_TRUE 0x1 + +/* Data types */ +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_DOUBLE 0x140A +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 + +/* Primitives */ +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON 0x0009 + +/* Vertex Arrays */ +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D + +/* Matrix Mode */ +#define GL_MATRIX_MODE 0x0BA0 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 + +/* Points */ +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_POINT_SIZE_RANGE 0x0B12 + +/* Lines */ +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_WIDTH_RANGE 0x0B22 + +/* Polygons */ +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_POLYGON_OFFSET_FILL 0x8037 + +/* Display Lists */ +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_LIST_MODE 0x0B30 + +/* Depth buffer */ +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_GEQUAL 0x0206 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_EQUAL 0x0202 +#define GL_ALWAYS 0x0207 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_BITS 0x0D56 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_COMPONENT 0x1902 + +/* Lighting */ +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT0 0x4000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_SHININESS 0x1601 +#define GL_EMISSION 0x1600 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_SHADE_MODEL 0x0B54 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_NORMALIZE 0x0BA1 + +/* User clipping planes */ +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 + +/* Accumulation buffer */ +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_ACCUM 0x0100 +#define GL_ADD 0x0104 +#define GL_LOAD 0x0101 +#define GL_MULT 0x0103 +#define GL_RETURN 0x0102 + +/* Alpha testing */ +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_ALPHA_TEST_FUNC 0x0BC1 + +/* Blending */ +#define GL_BLEND 0x0BE2 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND_DST 0x0BE0 +#define GL_ZERO 0x0 +#define GL_ONE 0x1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 + +/* Render Mode */ +#define GL_FEEDBACK 0x1C01 +#define GL_RENDER 0x1C00 +#define GL_SELECT 0x1C02 + +/* Feedback */ +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 + +/* Selection */ +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 + +/* Fog */ +#define GL_FOG 0x0B60 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_COLOR 0x0B66 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_LINEAR 0x2601 +#define GL_EXP 0x0800 +#define GL_EXP2 0x0801 + +/* Logic Ops */ +#define GL_LOGIC_OP 0x0BF1 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_CLEAR 0x1500 +#define GL_SET 0x150F +#define GL_COPY 0x1503 +#define GL_COPY_INVERTED 0x150C +#define GL_NOOP 0x1505 +#define GL_INVERT 0x150A +#define GL_AND 0x1501 +#define GL_NAND 0x150E +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_XOR 0x1506 +#define GL_EQUIV 0x1509 +#define GL_AND_REVERSE 0x1502 +#define GL_AND_INVERTED 0x1504 +#define GL_OR_REVERSE 0x150B +#define GL_OR_INVERTED 0x150D + +/* Stencil */ +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_STENCIL_BITS 0x0D57 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_INDEX 0x1901 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 + +/* Buffers, Pixel Drawing/Reading */ +#define GL_NONE 0x0 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +/*GL_FRONT 0x0404 */ +/*GL_BACK 0x0405 */ +/*GL_FRONT_AND_BACK 0x0408 */ +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_COLOR_INDEX 0x1900 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_ALPHA_BITS 0x0D55 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_INDEX_BITS 0x0D51 +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_READ_BUFFER 0x0C02 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_BITMAP 0x1A00 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_DITHER 0x0BD0 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 + +/* Implementation limits */ +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B + +/* Gets */ +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_MODE 0x0C30 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_RENDER_MODE 0x0C40 +#define GL_RGBA_MODE 0x0C31 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_VIEWPORT 0x0BA2 + +/* Evaluators */ +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_COEFF 0x0A00 +#define GL_DOMAIN 0x0A02 +#define GL_ORDER 0x0A01 + +/* Hints */ +#define GL_FOG_HINT 0x0C54 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 + +/* Scissor box */ +#define GL_SCISSOR_TEST 0x0C11 +#define GL_SCISSOR_BOX 0x0C10 + +/* Pixel Mode / Transfer */ +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 + +/* Texture mapping */ +#define GL_TEXTURE_ENV 0x2300 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_LINEAR 0x2400 +#define GL_EYE_PLANE 0x2502 +#define GL_SPHERE_MAP 0x2402 +#define GL_DECAL 0x2101 +#define GL_MODULATE 0x2100 +#define GL_NEAREST 0x2600 +#define GL_REPEAT 0x2901 +#define GL_CLAMP 0x2900 +#define GL_S 0x2000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 + +/* GL 1.1 texturing */ +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 + +/* GL 1.2 texturing */ +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_TEXTURE_BINDING_3D 0x806A + +/* Internal texture formats (GL 1.1) */ +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_R3_G3_B2 0x2A10 +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B + +/* Utility */ +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 + +/* Errors */ +#define GL_NO_ERROR 0x0 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 +/* + * Extensions + */ -/* GL_NO_ERROR must be zero */ -#define GL_NO_ERROR 0 +/* GL_EXT_blend_minmax and GL_EXT_blend_color */ +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_EQUATION_EXT 0x8009 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#define GL_BLEND_COLOR_EXT 0x8005 +/* GL_EXT_polygon_offset */ +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +/* GL_EXT_vertex_array */ +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 -enum { - GL_CURRENT_BIT = 0x00000001, - GL_POINT_BIT = 0x00000002, - GL_LINE_BIT = 0x00000004, - GL_POLYGON_BIT = 0x00000008, - GL_POLYGON_STIPPLE_BIT = 0x00000010, - GL_PIXEL_MODE_BIT = 0x00000020, - GL_LIGHTING_BIT = 0x00000040, - GL_FOG_BIT = 0x00000080, - GL_DEPTH_BUFFER_BIT = 0x00000100, - GL_ACCUM_BUFFER_BIT = 0x00000200, - GL_STENCIL_BUFFER_BIT = 0x00000400, - GL_VIEWPORT_BIT = 0x00000800, - GL_TRANSFORM_BIT = 0x00001000, - GL_ENABLE_BIT = 0x00002000, - GL_COLOR_BUFFER_BIT = 0x00004000, - GL_HINT_BIT = 0x00008000, - GL_EVAL_BIT = 0x00010000, - GL_LIST_BIT = 0x00020000, - GL_TEXTURE_BIT = 0x00040000, - GL_SCISSOR_BIT = 0x00080000, - GL_ALL_ATTRIB_BITS = 0x000FFFFF -}; +/* GL_EXT_texture_object */ +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +/* GL_EXT_texture3D */ +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A + +/* GL_EXT_paletted_texture */ +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 +#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 + +/* GL_EXT_shared_texture_palette */ +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB -enum { - GL_CLIENT_PIXEL_STORE_BIT = 0x00000001, - GL_CLIENT_VERTEX_ARRAY_BIT = 0x00000002 -}; -#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF +/* GL_EXT_point_parameters */ +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +/* GL_EXT_rescale_normal */ +#define GL_RESCALE_NORMAL_EXT 0x803A -typedef unsigned int GLbitfield; +/* GL_EXT_abgr */ +#define GL_ABGR_EXT 0x8000 +/* GL_EXT_stencil_wrap */ +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 -#ifdef CENTERLINE_CLPP -#define signed -#endif +/* GL_SGIS_texture_edge_clamp */ +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +/* GL_INGR_blend_func_separate */ +#define GL_BLEND_DST_RGB_INGR 0x80C8 +#define GL_BLEND_SRC_RGB_INGR 0x80C9 +#define GL_BLEND_DST_ALPHA_INGR 0x80CA +#define GL_BLEND_SRC_ALPHA_INGR 0x80CB + +/* OpenGL 1.2 */ +#define GL_RESCALE_NORMAL 0x803A +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D + +/* GL_ARB_multitexture */ +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 /* - * - * Data types (may be architecture dependent in some cases) - * + * OpenGL 1.2 imaging subset (NOT IMPLEMENTED BY MESA) */ +/* GL_EXT_color_table */ +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +/* GL_EXT_convolution and GL_HP_convolution_border_modes */ +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +/* GL_SGI_color_matrix */ +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +/* GL_EXT_histogram */ +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +/* GL_EXT_blend_color, GL_EXT_blend_minmax */ +#define GL_BLEND_EQUATION 0x8009 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_FUNC_ADD 0x8006 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_BLEND_COLOR 0x8005 + +/* GL_NV_texgen_reflection (nVidia) */ +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 + +/* GL_PGI_misc_hints */ +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 +#define GL_STRICT_LIGHTING_HINT_PGI 107031 +#define GL_STRICT_SCISSOR_HINT_PGI 107032 +#define GL_FULL_STIPPLE_HINT_PGI 107033 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 +#define GL_CONSERVE_MEMORY_HINT_PGI 107005 +#define GL_RECLAIM_MEMORY_HINT_PGI 107006 +#define GL_ALWAYS_FAST_HINT_PGI 107020 +#define GL_ALWAYS_SOFT_HINT_PGI 107021 +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 +#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 +#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 +#define GL_ALLOW_DRAW_SPN_HINT_PGI 107024 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 +#define GL_CLIP_NEAR_HINT_PGI 107040 +#define GL_CLIP_FAR_HINT_PGI 107041 +#define GL_WIDE_LINE_HINT_PGI 107042 +#define GL_BACK_NORMALS_HINT_PGI 107043 +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 + +/* GL_EXT_compiled_vertex_array */ +#define GL_ARRAY_ELEMENT_LOCK_FIRST_SGI 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_SGI 0x81A9 + +/* GL_EXT_clip_volume_hint */ +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F + + +/* glPush/PopAttrib bits */ +#define GL_CURRENT_BIT 0x00000001 +#define GL_POINT_BIT 0x00000002 +#define GL_LINE_BIT 0x00000004 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_HINT_BIT 0x00008000 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000FFFFF + + +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF + -/* C type GL type storage */ -/*-------------------------------------------------------------------------*/ -typedef void GLvoid; -typedef unsigned char GLboolean; -typedef signed char GLbyte; /* 1-byte signed */ -typedef short GLshort; /* 2-byte signed */ -typedef int GLint; /* 4-byte signed */ -typedef unsigned char GLubyte; /* 1-byte unsigned */ -typedef unsigned short GLushort; /* 2-byte unsigned */ -typedef unsigned int GLuint; /* 4-byte unsigned */ -typedef int GLsizei; /* 4-byte signed */ -typedef float GLfloat; /* single precision float */ -typedef float GLclampf; /* single precision float in [0,1] */ -typedef double GLdouble; /* double precision float */ -typedef double GLclampd; /* double precision float in [0,1] */ @@ -2198,37 +2179,543 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); -#if defined(__BEOS__) || defined(__QUICKDRAW__) -#pragma export off -#endif +/* + * XXX these extensions may eventually be moved into a new glext.h file + */ + + +/* + * GL_EXT_point_parameters + */ +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 + +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 + +GLAPI void GLAPIENTRY glPointParameterfEXT( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glPointParameterfvEXT( GLenum pname, const GLfloat *params ); + +#endif /* GL_EXT_point_parameters */ + + + +/* + * GL_EXT_blend_minmax + */ +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 + +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 + +GLAPI void GLAPIENTRY glBlendEquationEXT( GLenum mode ); + +#endif /* GL_EXT_blend_minmax */ + + + +/* + * GL_EXT_blend_subtract (requires GL_EXT_blend_max ) + */ +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 + +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B + +#endif /* GL_EXT_blend_subtract */ + + + +/* + * GL_EXT_blend_logic_op + */ +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 + +/* No new tokens or functions */ + +#endif /* GL_EXT_blend_logic_op */ + + + +/* + * GL_EXT_blend_color + */ +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 + +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 + +GLAPI void GLAPIENTRY glBlendColorEXT( GLclampf red, GLclampf green, + GLclampf blue, GLclampf alpha ); + +#endif /* GL_EXT_blend_color */ + + + +/* + * GL_EXT_stencil_wrap + */ +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 + +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 + +#endif /* GL_EXT_stencil_wrap */ + + + +/* + * GL_EXT_clip_volume_hint + */ +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 + +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F + +#endif /* GL_EXT_clip_volume_hint */ + + + +/* + * GL_EXT_abgr + */ +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 + +#define GL_ABGR_EXT 0x8000 + +#endif /* GL_EXT_abgr */ + + + +/* + * GL_EXT_rescale_normal + */ +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 + +#define GL_RESCALE_NORMAL_EXT 0x803A + +#endif /* GL_EXT_rescale_normal */ + + + +/* + * GL_EXT_paletted_texture + */ +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 + +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 +#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 + +GLAPI void GLAPIENTRY glColorTableEXT( GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table ); + +GLAPI void GLAPIENTRY glColorSubTableEXT( GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data ); + +GLAPI void GLAPIENTRY glGetColorTableEXT( GLenum target, GLenum format, GLenum type, GLvoid *table ); + +GLAPI void GLAPIENTRY glGetColorTableParameterfvEXT( GLenum target, GLenum pname, GLfloat *params ); + +GLAPI void GLAPIENTRY glGetColorTableParameterivEXT( GLenum target, GLenum pname, GLint *params ); + +#endif /* GL_EXT_paletted_texture */ + + + +/* + * GL_EXT_shared_texture_palette (requires GL_EXT_paletted_texture) + */ +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 + +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB + +#endif /* GL_EXT_shared_texture_palette */ + + + +/* + * GL_EXT_texture3D + */ +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 + +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A + +GLAPI void GLAPIENTRY glTexImage3DEXT( GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glTexSubImage3DEXT( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); + +GLAPI void GLAPIENTRY glCopyTexSubImage3DEXT( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ); + +#endif /* GL_EXT_texture3D */ + + + + +/* + * GL_EXT_texture_object + */ +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 + +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 + +GLAPI void GLAPIENTRY glGenTexturesEXT( GLsizei n, GLuint *textures ); + +GLAPI void GLAPIENTRY glDeleteTexturesEXT( GLsizei n, const GLuint *textures); + +GLAPI void GLAPIENTRY glBindTextureEXT( GLenum target, GLuint texture ); + +GLAPI void GLAPIENTRY glPrioritizeTexturesEXT( GLsizei n, const GLuint *textures, const GLclampf *priorities ); + +GLAPI GLboolean GLAPIENTRY glAreTexturesResidentEXT( GLsizei n, const GLuint *textures, GLboolean *residences ); + +GLAPI GLboolean GLAPIENTRY glIsTextureEXT( GLuint texture ); + +#endif /* GL_EXT_texture_object */ + /* - * Compile-time tests for extensions: + * GL_EXT_polygon_offset */ -#define GL_EXT_blend_color 1 -#define GL_EXT_blend_logic_op 1 -#define GL_EXT_blend_minmax 1 -#define GL_EXT_blend_subtract 1 -#define GL_EXT_polygon_offset 1 -#define GL_EXT_vertex_array 1 -#define GL_EXT_texture_object 1 -#define GL_EXT_texture3D 1 -#define GL_EXT_paletted_texture 1 -#define GL_EXT_shared_texture_palette 1 -#define GL_EXT_point_parameters 1 -#define GL_EXT_rescale_normal 1 -#define GL_EXT_abgr 1 -#define GL_EXT_stencil_wrap 1 -#define GL_MESA_window_pos 1 -#define GL_MESA_resize_buffers 1 -#define GL_SGIS_texture_edge_clamp 1 -#define GL_INGR_blend_func_separate 1 -#define GL_ARB_multitexture 1 -#define GL_NV_texgen_reflection 1 -#define GL_PGI_misc_hints 1 -#define GL_EXT_compiled_vertex_array 1 -#define GL_EXT_clip_volume_hint 1 +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 + +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 + +GLAPI void GLAPIENTRY glPolygonOffsetEXT( GLfloat factor, GLfloat bias ); + +#endif /* GL_EXT_polygon_offset */ + + + +/* + * GL_EXT_vertex_array + */ +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 + +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 + +GLAPI void GLAPIENTRY glVertexPointerEXT( GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glNormalPointerEXT( GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glColorPointerEXT( GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glIndexPointerEXT( GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glTexCoordPointerEXT( GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glEdgeFlagPointerEXT( GLsizei stride, GLsizei count, const GLboolean *ptr ); + +GLAPI void GLAPIENTRY glGetPointervEXT( GLenum pname, void **params ); + +GLAPI void GLAPIENTRY glArrayElementEXT( GLint i ); + +GLAPI void GLAPIENTRY glDrawArraysEXT( GLenum mode, GLint first, GLsizei count ); + +#endif /* GL_EXT_vertex_array */ + + + +/* + * GL_EXT_compiled_vertex_array + */ +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 + +#define GL_ARRAY_ELEMENT_LOCK_FIRST_SGI 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_SGI 0x81A9 + +GLAPI void GLAPIENTRY glLockArraysEXT( GLint first, GLsizei count ); +GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); + +#endif /* GL_EXT_compiled_vertex_array */ + + + +/* + * GL_NV_texgen_reflection + */ +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 + +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 + +#endif /* GL_NV_texgen_reflection */ + + + +/* + * GL_INGR_blend_func_separate + */ +#ifndef GL_INGR_blend_func_separate +#define GL_INGR_blend_func_separate 1 + +#define GL_BLEND_DST_RGB_INGR 0x80C8 +#define GL_BLEND_SRC_RGB_INGR 0x80C9 +#define GL_BLEND_DST_ALPHA_INGR 0x80CA +#define GL_BLEND_SRC_ALPHA_INGR 0x80CB + +GLAPI void GLAPIENTRY glBlendFuncSeparateINGR( GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha ); + +#endif /* GL_INGR_blend_func_separate */ + + + +/* + * GL_ARB_multitexture + */ +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 + +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + +GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture); +GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture); +GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s); +GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s); +GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s); +GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s); +GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); +GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); +GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); + +#endif /* GL_ARB_multitexture */ + + + +/* + * GL_SGIS_texture_edge_clamp + */ +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_SGIS 0x812F + +#endif /* GL_SGIS_texture_edge_clamp */ + + + +/* + * GL_PGI_misc_hints + */ +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 + +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 +#define GL_STRICT_LIGHTING_HINT_PGI 107031 +#define GL_STRICT_SCISSOR_HINT_PGI 107032 +#define GL_FULL_STIPPLE_HINT_PGI 107033 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 +#define GL_CONSERVE_MEMORY_HINT_PGI 107005 +#define GL_RECLAIM_MEMORY_HINT_PGI 107006 +#define GL_ALWAYS_FAST_HINT_PGI 107020 +#define GL_ALWAYS_SOFT_HINT_PGI 107021 +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 +#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 +#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 +#define GL_ALLOW_DRAW_SPN_HINT_PGI 107024 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 +#define GL_CLIP_NEAR_HINT_PGI 107040 +#define GL_CLIP_FAR_HINT_PGI 107041 +#define GL_WIDE_LINE_HINT_PGI 107042 +#define GL_BACK_NORMALS_HINT_PGI 107043 +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 + +#endif /* GL_PGI_misc_hints */ + + + +/* + * GL_MESA_window_pos + */ +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 + +GLAPI void GLAPIENTRY glWindowPos2iMESA( GLint x, GLint y ); +GLAPI void GLAPIENTRY glWindowPos2sMESA( GLshort x, GLshort y ); +GLAPI void GLAPIENTRY glWindowPos2fMESA( GLfloat x, GLfloat y ); +GLAPI void GLAPIENTRY glWindowPos2dMESA( GLdouble x, GLdouble y ); +GLAPI void GLAPIENTRY glWindowPos2ivMESA( const GLint *p ); +GLAPI void GLAPIENTRY glWindowPos2svMESA( const GLshort *p ); +GLAPI void GLAPIENTRY glWindowPos2fvMESA( const GLfloat *p ); +GLAPI void GLAPIENTRY glWindowPos2dvMESA( const GLdouble *p ); +GLAPI void GLAPIENTRY glWindowPos3iMESA( GLint x, GLint y, GLint z ); +GLAPI void GLAPIENTRY glWindowPos3sMESA( GLshort x, GLshort y, GLshort z ); +GLAPI void GLAPIENTRY glWindowPos3fMESA( GLfloat x, GLfloat y, GLfloat z ); +GLAPI void GLAPIENTRY glWindowPos3dMESA( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glWindowPos3ivMESA( const GLint *p ); +GLAPI void GLAPIENTRY glWindowPos3svMESA( const GLshort *p ); +GLAPI void GLAPIENTRY glWindowPos3fvMESA( const GLfloat *p ); +GLAPI void GLAPIENTRY glWindowPos3dvMESA( const GLdouble *p ); +GLAPI void GLAPIENTRY glWindowPos4iMESA( GLint x, GLint y, GLint z, GLint w ); +GLAPI void GLAPIENTRY glWindowPos4sMESA( GLshort x, GLshort y, GLshort z, GLshort w ); +GLAPI void GLAPIENTRY glWindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +GLAPI void GLAPIENTRY glWindowPos4dMESA( GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glWindowPos4ivMESA( const GLint *p ); +GLAPI void GLAPIENTRY glWindowPos4svMESA( const GLshort *p ); +GLAPI void GLAPIENTRY glWindowPos4fvMESA( const GLfloat *p ); +GLAPI void GLAPIENTRY glWindowPos4dvMESA( const GLdouble *p ); + +#endif /* GL_MESA_window_pos */ + + + +/* + * GL_MESA_resize_bufffers + */ +#ifndef GL_MESA_resize_bufffers +#define GL_MESA_resize_buffers 1 + +GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); + +#endif /* GL_MESA_resize_bufffers */ + + + + + +#if defined(__BEOS__) || defined(__QUICKDRAW__) +#pragma export off +#endif #ifdef macintosh diff --git a/include/GL/glu.h b/include/GL/glu.h index 394883c548b..bfb9e90f66b 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,8 +1,9 @@ -/* $Id: glu.h,v 1.14 1999/11/09 06:17:08 brianp Exp $ */ +/* $Id: glu.h,v 1.15 1999/11/11 01:27:17 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 + * * Copyright (C) 1995-1999 Brian Paul * * This library is free software; you can redistribute it and/or @@ -70,151 +71,149 @@ extern "C" { #endif -#define GLU_VERSION_1_1 1 -#define GLU_VERSION_1_2 1 - - -#define GLU_TRUE GL_TRUE -#define GLU_FALSE GL_FALSE - - -enum { - /* Normal vectors */ - GLU_SMOOTH = 100000, - GLU_FLAT = 100001, - GLU_NONE = 100002, - - /* Quadric draw styles */ - GLU_POINT = 100010, - GLU_LINE = 100011, - GLU_FILL = 100012, - GLU_SILHOUETTE = 100013, - - /* Quadric orientation */ - GLU_OUTSIDE = 100020, - GLU_INSIDE = 100021, - - /* Tessellator */ - GLU_TESS_BEGIN = 100100, - GLU_TESS_VERTEX = 100101, - GLU_TESS_END = 100102, - GLU_TESS_ERROR = 100103, - GLU_TESS_EDGE_FLAG = 100104, - GLU_TESS_COMBINE = 100105, - - GLU_TESS_BEGIN_DATA = 100106, - GLU_TESS_VERTEX_DATA = 100107, - GLU_TESS_END_DATA = 100108, - GLU_TESS_ERROR_DATA = 100109, - GLU_TESS_EDGE_FLAG_DATA = 100110, - GLU_TESS_COMBINE_DATA = 100111, - - /* Winding rules */ - GLU_TESS_WINDING_ODD = 100130, - GLU_TESS_WINDING_NONZERO = 100131, - GLU_TESS_WINDING_POSITIVE = 100132, - GLU_TESS_WINDING_NEGATIVE = 100133, - GLU_TESS_WINDING_ABS_GEQ_TWO = 100134, - - /* Tessellation properties */ - GLU_TESS_WINDING_RULE = 100140, - GLU_TESS_BOUNDARY_ONLY = 100141, - GLU_TESS_TOLERANCE = 100142, - - /* Tessellation errors */ - GLU_TESS_ERROR1 = 100151, /* Missing gluBeginPolygon */ - GLU_TESS_ERROR2 = 100152, /* Missing gluBeginContour */ - GLU_TESS_ERROR3 = 100153, /* Missing gluEndPolygon */ - GLU_TESS_ERROR4 = 100154, /* Missing gluEndContour */ - GLU_TESS_ERROR5 = 100155, /* */ - GLU_TESS_ERROR6 = 100156, /* */ - GLU_TESS_ERROR7 = 100157, /* */ - GLU_TESS_ERROR8 = 100158, /* */ - - /* NURBS */ - GLU_AUTO_LOAD_MATRIX = 100200, - GLU_CULLING = 100201, - GLU_PARAMETRIC_TOLERANCE= 100202, - GLU_SAMPLING_TOLERANCE = 100203, - GLU_DISPLAY_MODE = 100204, - GLU_SAMPLING_METHOD = 100205, - GLU_U_STEP = 100206, - GLU_V_STEP = 100207, - - GLU_PATH_LENGTH = 100215, - GLU_PARAMETRIC_ERROR = 100216, - GLU_DOMAIN_DISTANCE = 100217, - - GLU_MAP1_TRIM_2 = 100210, - GLU_MAP1_TRIM_3 = 100211, - - GLU_OUTLINE_POLYGON = 100240, - GLU_OUTLINE_PATCH = 100241, - - GLU_NURBS_ERROR1 = 100251, /* spline order un-supported */ - GLU_NURBS_ERROR2 = 100252, /* too few knots */ - GLU_NURBS_ERROR3 = 100253, /* valid knot range is empty */ - GLU_NURBS_ERROR4 = 100254, /* decreasing knot sequence */ - GLU_NURBS_ERROR5 = 100255, /* knot multiplicity > spline order */ - GLU_NURBS_ERROR6 = 100256, /* endcurve() must follow bgncurve() */ - GLU_NURBS_ERROR7 = 100257, /* bgncurve() must precede endcurve() */ - GLU_NURBS_ERROR8 = 100258, /* ctrlarray or knot vector is NULL */ - GLU_NURBS_ERROR9 = 100259, /* can't draw pwlcurves */ - GLU_NURBS_ERROR10 = 100260, /* missing gluNurbsCurve() */ - GLU_NURBS_ERROR11 = 100261, /* missing gluNurbsSurface() */ - GLU_NURBS_ERROR12 = 100262, /* endtrim() must precede endsurface() */ - GLU_NURBS_ERROR13 = 100263, /* bgnsurface() must precede endsurface() */ - GLU_NURBS_ERROR14 = 100264, /* curve of improper type passed as trim curve */ - GLU_NURBS_ERROR15 = 100265, /* bgnsurface() must precede bgntrim() */ - GLU_NURBS_ERROR16 = 100266, /* endtrim() must follow bgntrim() */ - GLU_NURBS_ERROR17 = 100267, /* bgntrim() must precede endtrim()*/ - GLU_NURBS_ERROR18 = 100268, /* invalid or missing trim curve*/ - GLU_NURBS_ERROR19 = 100269, /* bgntrim() must precede pwlcurve() */ - GLU_NURBS_ERROR20 = 100270, /* pwlcurve referenced twice*/ - GLU_NURBS_ERROR21 = 100271, /* pwlcurve and nurbscurve mixed */ - GLU_NURBS_ERROR22 = 100272, /* improper usage of trim data type */ - GLU_NURBS_ERROR23 = 100273, /* nurbscurve referenced twice */ - GLU_NURBS_ERROR24 = 100274, /* nurbscurve and pwlcurve mixed */ - GLU_NURBS_ERROR25 = 100275, /* nurbssurface referenced twice */ - GLU_NURBS_ERROR26 = 100276, /* invalid property */ - GLU_NURBS_ERROR27 = 100277, /* endsurface() must follow bgnsurface() */ - GLU_NURBS_ERROR28 = 100278, /* intersecting or misoriented trim curves */ - GLU_NURBS_ERROR29 = 100279, /* intersecting trim curves */ - GLU_NURBS_ERROR30 = 100280, /* UNUSED */ - GLU_NURBS_ERROR31 = 100281, /* unconnected trim curves */ - GLU_NURBS_ERROR32 = 100282, /* unknown knot error */ - GLU_NURBS_ERROR33 = 100283, /* negative vertex count encountered */ - GLU_NURBS_ERROR34 = 100284, /* negative byte-stride */ - GLU_NURBS_ERROR35 = 100285, /* unknown type descriptor */ - GLU_NURBS_ERROR36 = 100286, /* null control point reference */ - GLU_NURBS_ERROR37 = 100287, /* duplicate point on pwlcurve */ - - /* Errors */ - GLU_INVALID_ENUM = 100900, - GLU_INVALID_VALUE = 100901, - GLU_OUT_OF_MEMORY = 100902, - GLU_INCOMPATIBLE_GL_VERSION = 100903, - - /* New in GLU 1.1 */ - GLU_VERSION = 100800, - GLU_EXTENSIONS = 100801, - - /*** GLU 1.0 tessellation - obsolete! ***/ - - /* Contour types */ - GLU_CW = 100120, - GLU_CCW = 100121, - GLU_INTERIOR = 100122, - GLU_EXTERIOR = 100123, - GLU_UNKNOWN = 100124, - - /* Tessellator */ - GLU_BEGIN = GLU_TESS_BEGIN, - GLU_VERTEX = GLU_TESS_VERTEX, - GLU_END = GLU_TESS_END, - GLU_ERROR = GLU_TESS_ERROR, - GLU_EDGE_FLAG = GLU_TESS_EDGE_FLAG -}; +#define GLU_VERSION_1_1 1 +#define GLU_VERSION_1_2 1 + + +#define GLU_TRUE 1 +#define GLU_FALSE 0 + + +/* Normal vectors */ +#define GLU_SMOOTH 100000 +#define GLU_FLAT 100001 +#define GLU_NONE 100002 + +/* Quadric draw styles */ +#define GLU_POINT 100010 +#define GLU_LINE 100011 +#define GLU_FILL 100012 +#define GLU_SILHOUETTE 100013 + +/* Quadric orientation */ +#define GLU_OUTSIDE 100020 +#define GLU_INSIDE 100021 + +/* Tessellator */ +#define GLU_TESS_BEGIN 100100 +#define GLU_TESS_VERTEX 100101 +#define GLU_TESS_END 100102 +#define GLU_TESS_ERROR 100103 +#define GLU_TESS_EDGE_FLAG 100104 +#define GLU_TESS_COMBINE 100105 + +#define GLU_TESS_BEGIN_DATA 100106 +#define GLU_TESS_VERTEX_DATA 100107 +#define GLU_TESS_END_DATA 100108 +#define GLU_TESS_ERROR_DATA 100109 +#define GLU_TESS_EDGE_FLAG_DATA 100110 +#define GLU_TESS_COMBINE_DATA 100111 + +/* Winding rules */ +#define GLU_TESS_WINDING_ODD 100130 +#define GLU_TESS_WINDING_NONZERO 100131 +#define GLU_TESS_WINDING_POSITIVE 100132 +#define GLU_TESS_WINDING_NEGATIVE 100133 +#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134 + +/* Tessellation properties */ +#define GLU_TESS_WINDING_RULE 100140 +#define GLU_TESS_BOUNDARY_ONLY 100141 +#define GLU_TESS_TOLERANCE 100142 + +/* Tessellation errors */ +#define GLU_TESS_ERROR1 100151 /* Missing gluBeginPolygon */ +#define GLU_TESS_ERROR2 100152 /* Missing gluBeginContour */ +#define GLU_TESS_ERROR3 100153 /* Missing gluEndPolygon */ +#define GLU_TESS_ERROR4 100154 /* Missing gluEndContour */ +#define GLU_TESS_ERROR5 100155 /* */ +#define GLU_TESS_ERROR6 100156 /* */ +#define GLU_TESS_ERROR7 100157 /* */ +#define GLU_TESS_ERROR8 100158 /* */ + +/* NURBS */ +#define GLU_AUTO_LOAD_MATRIX 100200 +#define GLU_CULLING 100201 +#define GLU_PARAMETRIC_TOLERANC 100202 +#define GLU_SAMPLING_TOLERANCE 100203 +#define GLU_DISPLAY_MODE 100204 +#define GLU_SAMPLING_METHOD 100205 +#define GLU_U_STEP 100206 +#define GLU_V_STEP 100207 + +#define GLU_PATH_LENGTH 100215 +#define GLU_PARAMETRIC_ERROR 100216 +#define GLU_DOMAIN_DISTANCE 100217 + +#define GLU_MAP1_TRIM_2 100210 +#define GLU_MAP1_TRIM_3 100211 + +#define GLU_OUTLINE_POLYGON 100240 +#define GLU_OUTLINE_PATCH 100241 + +#define GLU_NURBS_ERROR1 100251 /* spline order un-supported */ +#define GLU_NURBS_ERROR2 100252 /* too few knots */ +#define GLU_NURBS_ERROR3 100253 /* valid knot range is empty */ +#define GLU_NURBS_ERROR4 100254 /* decreasing knot sequence */ +#define GLU_NURBS_ERROR5 100255 /* knot multiplicity > spline order */ +#define GLU_NURBS_ERROR6 100256 /* endcurve() must follow bgncurve() */ +#define GLU_NURBS_ERROR7 100257 /* bgncurve() must precede endcurve() */ +#define GLU_NURBS_ERROR8 100258 /* ctrlarray or knot vector is NULL */ +#define GLU_NURBS_ERROR9 100259 /* can't draw pwlcurves */ +#define GLU_NURBS_ERROR10 100260 /* missing gluNurbsCurve() */ +#define GLU_NURBS_ERROR11 100261 /* missing gluNurbsSurface() */ +#define GLU_NURBS_ERROR12 100262 /* endtrim() must precede endsurface() */ +#define GLU_NURBS_ERROR13 100263 /* bgnsurface() must precede endsurface() */ +#define GLU_NURBS_ERROR14 100264 /* curve of improper type passed as trim curve */ +#define GLU_NURBS_ERROR15 100265 /* bgnsurface() must precede bgntrim() */ +#define GLU_NURBS_ERROR16 100266 /* endtrim() must follow bgntrim() */ +#define GLU_NURBS_ERROR17 100267 /* bgntrim() must precede endtrim()*/ +#define GLU_NURBS_ERROR18 100268 /* invalid or missing trim curve*/ +#define GLU_NURBS_ERROR19 100269 /* bgntrim() must precede pwlcurve() */ +#define GLU_NURBS_ERROR20 100270 /* pwlcurve referenced twice*/ +#define GLU_NURBS_ERROR21 100271 /* pwlcurve and nurbscurve mixed */ +#define GLU_NURBS_ERROR22 100272 /* improper usage of trim data type */ +#define GLU_NURBS_ERROR23 100273 /* nurbscurve referenced twice */ +#define GLU_NURBS_ERROR24 100274 /* nurbscurve and pwlcurve mixed */ +#define GLU_NURBS_ERROR25 100275 /* nurbssurface referenced twice */ +#define GLU_NURBS_ERROR26 100276 /* invalid property */ +#define GLU_NURBS_ERROR27 100277 /* endsurface() must follow bgnsurface() */ +#define GLU_NURBS_ERROR28 100278 /* intersecting or misoriented trim curves */ +#define GLU_NURBS_ERROR29 100279 /* intersecting trim curves */ +#define GLU_NURBS_ERROR30 100280 /* UNUSED */ +#define GLU_NURBS_ERROR31 100281 /* unconnected trim curves */ +#define GLU_NURBS_ERROR32 100282 /* unknown knot error */ +#define GLU_NURBS_ERROR33 100283 /* negative vertex count encountered */ +#define GLU_NURBS_ERROR34 100284 /* negative byte-stride */ +#define GLU_NURBS_ERROR35 100285 /* unknown type descriptor */ +#define GLU_NURBS_ERROR36 100286 /* null control point reference */ +#define GLU_NURBS_ERROR37 100287 /* duplicate point on pwlcurve */ + +/* Errors */ +#define GLU_INVALID_ENUM 100900 +#define GLU_INVALID_VALUE 100901 +#define GLU_OUT_OF_MEMORY 100902 +#define GLU_INCOMPATIBLE_GL_VERSION 100903 + +/* New in GLU 1.1 */ +#define GLU_VERSION 100800 +#define GLU_EXTENSIONS 100801 + +/*** GLU 1.0 tessellation - obsolete! ***/ + +/* Contour types */ +#define GLU_CW 100120 +#define GLU_CCW 100121 +#define GLU_INTERIOR 100122 +#define GLU_EXTERIOR 100123 +#define GLU_UNKNOWN 100124 + +/* Tessellator */ +#define GLU_BEGIN GLU_TESS_BEGIN +#define GLU_VERTEX GLU_TESS_VERTEX +#define GLU_END GLU_TESS_END +#define GLU_ERROR GLU_TESS_ERROR +#define GLU_EDGE_FLAG GLU_TESS_EDGE_FLAG /* @@ -247,37 +246,37 @@ enum { */ GLUAPI void GLAPIENTRY gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez, - GLdouble centerx, GLdouble centery, - GLdouble centerz, - GLdouble upx, GLdouble upy, GLdouble upz ); + GLdouble centerx, GLdouble centery, + GLdouble centerz, + GLdouble upx, GLdouble upy, GLdouble upz ); GLUAPI void GLAPIENTRY gluOrtho2D( GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top ); + GLdouble bottom, GLdouble top ); GLUAPI void GLAPIENTRY gluPerspective( GLdouble fovy, GLdouble aspect, - GLdouble zNear, GLdouble zFar ); + GLdouble zNear, GLdouble zFar ); GLUAPI void GLAPIENTRY gluPickMatrix( GLdouble x, GLdouble y, - GLdouble width, GLdouble height, - const GLint viewport[4] ); + GLdouble width, GLdouble height, + const GLint viewport[4] ); GLUAPI GLint GLAPIENTRY gluProject( GLdouble objx, GLdouble objy, GLdouble objz, - const GLdouble modelMatrix[16], - const GLdouble projMatrix[16], - const GLint viewport[4], - GLdouble *winx, GLdouble *winy, - GLdouble *winz ); - -GLUAPI GLint GLAPIENTRY gluUnProject( GLdouble winx, GLdouble winy, - GLdouble winz, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], const GLint viewport[4], - GLdouble *objx, GLdouble *objy, - GLdouble *objz ); + GLdouble *winx, GLdouble *winy, + GLdouble *winz ); + +GLUAPI GLint GLAPIENTRY gluUnProject( GLdouble winx, GLdouble winy, + GLdouble winz, + const GLdouble modelMatrix[16], + const GLdouble projMatrix[16], + const GLint viewport[4], + GLdouble *objx, GLdouble *objy, + GLdouble *objz ); GLUAPI const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode ); @@ -290,19 +289,19 @@ GLUAPI const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode ); */ GLUAPI GLint GLAPIENTRY gluScaleImage( GLenum format, - GLsizei widthin, GLsizei heightin, - GLenum typein, const void *datain, - GLsizei widthout, GLsizei heightout, - GLenum typeout, void *dataout ); + GLint widthin, GLint heightin, + GLenum typein, const void *datain, + GLint widthout, GLint heightout, + GLenum typeout, void *dataout ); GLUAPI GLint GLAPIENTRY gluBuild1DMipmaps( GLenum target, GLint components, - GLsizei width, GLenum format, - GLenum type, const void *data ); + GLint width, GLenum format, + GLenum type, const void *data ); GLUAPI GLint GLAPIENTRY gluBuild2DMipmaps( GLenum target, GLint components, - GLsizei width, GLsizei height, - GLenum format, - GLenum type, const void *data ); + GLint width, GLint height, + GLenum format, + GLenum type, const void *data ); @@ -317,37 +316,39 @@ GLUAPI GLUquadricObj* GLAPIENTRY gluNewQuadric( void ); GLUAPI void GLAPIENTRY gluDeleteQuadric( GLUquadricObj *state ); GLUAPI void GLAPIENTRY gluQuadricDrawStyle( GLUquadricObj *quadObject, - GLenum drawStyle ); + GLenum drawStyle ); GLUAPI void GLAPIENTRY gluQuadricOrientation( GLUquadricObj *quadObject, - GLenum orientation ); + GLenum orientation ); GLUAPI void GLAPIENTRY gluQuadricNormals( GLUquadricObj *quadObject, - GLenum normals ); + GLenum normals ); GLUAPI void GLAPIENTRY gluQuadricTexture( GLUquadricObj *quadObject, - GLboolean textureCoords ); + GLboolean textureCoords ); GLUAPI void GLAPIENTRY gluQuadricCallback( GLUquadricObj *qobj, - GLenum which, void (GLCALLBACK *fn)() ); + GLenum which, + void (GLCALLBACK *fn)() ); GLUAPI void GLAPIENTRY gluCylinder( GLUquadricObj *qobj, - GLdouble baseRadius, - GLdouble topRadius, - GLdouble height, - GLint slices, GLint stacks ); + GLdouble baseRadius, + GLdouble topRadius, + GLdouble height, + GLint slices, GLint stacks ); GLUAPI void GLAPIENTRY gluSphere( GLUquadricObj *qobj, - GLdouble radius, GLint slices, GLint stacks ); + GLdouble radius, GLint slices, + GLint stacks ); GLUAPI void GLAPIENTRY gluDisk( GLUquadricObj *qobj, - GLdouble innerRadius, GLdouble outerRadius, - GLint slices, GLint loops ); + GLdouble innerRadius, GLdouble outerRadius, + GLint slices, GLint loops ); GLUAPI void GLAPIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius, - GLdouble outerRadius, GLint slices, - GLint loops, GLdouble startAngle, - GLdouble sweepAngle ); + GLdouble outerRadius, GLint slices, + GLint loops, GLdouble startAngle, + GLdouble sweepAngle ); @@ -362,46 +363,47 @@ GLUAPI GLUnurbsObj* GLAPIENTRY gluNewNurbsRenderer( void ); GLUAPI void GLAPIENTRY gluDeleteNurbsRenderer( GLUnurbsObj *nobj ); GLUAPI void GLAPIENTRY gluLoadSamplingMatrices( GLUnurbsObj *nobj, - const GLfloat modelMatrix[16], - const GLfloat projMatrix[16], - const GLint viewport[4] ); + const GLfloat modelMatrix[16], + const GLfloat projMatrix[16], + const GLint viewport[4] ); GLUAPI void GLAPIENTRY gluNurbsProperty( GLUnurbsObj *nobj, GLenum property, - GLfloat value ); + GLfloat value ); GLUAPI void GLAPIENTRY gluGetNurbsProperty( GLUnurbsObj *nobj, GLenum property, - GLfloat *value ); + GLfloat *value ); GLUAPI void GLAPIENTRY gluBeginCurve( GLUnurbsObj *nobj ); GLUAPI void GLAPIENTRY gluEndCurve( GLUnurbsObj * nobj ); GLUAPI void GLAPIENTRY gluNurbsCurve( GLUnurbsObj *nobj, GLint nknots, - GLfloat *knot, GLint stride, - GLfloat *ctlarray, GLint order, - GLenum type ); + GLfloat *knot, GLint stride, + GLfloat *ctlarray, GLint order, + GLenum type ); GLUAPI void GLAPIENTRY gluBeginSurface( GLUnurbsObj *nobj ); GLUAPI void GLAPIENTRY gluEndSurface( GLUnurbsObj * nobj ); GLUAPI void GLAPIENTRY gluNurbsSurface( GLUnurbsObj *nobj, - GLint sknot_count, GLfloat *sknot, - GLint tknot_count, GLfloat *tknot, - GLint s_stride, GLint t_stride, - GLfloat *ctlarray, - GLint sorder, GLint torder, - GLenum type ); + GLint sknot_count, GLfloat *sknot, + GLint tknot_count, GLfloat *tknot, + GLint s_stride, GLint t_stride, + GLfloat *ctlarray, + GLint sorder, GLint torder, + GLenum type ); GLUAPI void GLAPIENTRY gluBeginTrim( GLUnurbsObj *nobj ); GLUAPI void GLAPIENTRY gluEndTrim( GLUnurbsObj *nobj ); GLUAPI void GLAPIENTRY gluPwlCurve( GLUnurbsObj *nobj, GLint count, - GLfloat *array, GLint stride, GLenum type ); + GLfloat *array, GLint stride, + GLenum type ); GLUAPI void GLAPIENTRY gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, - void (GLCALLBACK *fn)() ); + void (GLCALLBACK *fn)() ); diff --git a/include/GL/glx.h b/include/GL/glx.h index 2df9c277472..9d4c2023f8e 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,8 +1,8 @@ -/* $Id: glx.h,v 1.5 1999/10/27 09:46:07 brianp Exp $ */ +/* $Id: glx.h,v 1.6 1999/11/11 01:27:17 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -50,38 +50,41 @@ extern "C" { #define GLX_VERSION_1_1 1 +#define GLX_EXTENSION_NAME "GLX" + + /* * Tokens for glXChooseVisual and glXGetConfig: */ -enum _GLX_CONFIGS { - GLX_USE_GL = 1, - GLX_BUFFER_SIZE = 2, - GLX_LEVEL = 3, - GLX_RGBA = 4, - GLX_DOUBLEBUFFER = 5, - GLX_STEREO = 6, - GLX_AUX_BUFFERS = 7, - GLX_RED_SIZE = 8, - GLX_GREEN_SIZE = 9, - GLX_BLUE_SIZE = 10, - GLX_ALPHA_SIZE = 11, - GLX_DEPTH_SIZE = 12, - GLX_STENCIL_SIZE = 13, - GLX_ACCUM_RED_SIZE = 14, - GLX_ACCUM_GREEN_SIZE = 15, - GLX_ACCUM_BLUE_SIZE = 16, - GLX_ACCUM_ALPHA_SIZE = 17, - - /* GLX_EXT_visual_info extension */ - GLX_X_VISUAL_TYPE_EXT = 0x22, - GLX_TRANSPARENT_TYPE_EXT = 0x23, - GLX_TRANSPARENT_INDEX_VALUE_EXT = 0x24, - GLX_TRANSPARENT_RED_VALUE_EXT = 0x25, - GLX_TRANSPARENT_GREEN_VALUE_EXT = 0x26, - GLX_TRANSPARENT_BLUE_VALUE_EXT = 0x27, - GLX_TRANSPARENT_ALPHA_VALUE_EXT = 0x28 -}; +#define GLX_USE_GL 1 +#define GLX_BUFFER_SIZE 2 +#define GLX_LEVEL 3 +#define GLX_RGBA 4 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 + + +/* GLX_EXT_visual_info extension */ +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 + /* diff --git a/src/mesa/Makefile.X11 b/src/mesa/Makefile.X11 index da5dc4549e3..d026075c8e4 100644 --- a/src/mesa/Makefile.X11 +++ b/src/mesa/Makefile.X11 @@ -1,7 +1,7 @@ -# $Id: Makefile.X11,v 1.6 1999/10/08 09:27:09 keithw Exp $ +# $Id: Makefile.X11,v 1.7 1999/11/11 01:22:28 brianp Exp $ # Mesa 3-D graphics library -# Version: 3.1 +# Version: 3.3 # Copyright (C) 1995-1999 Brian Paul # Makefile for core library @@ -18,13 +18,13 @@ VPATH = RCS INCDIR = ../include LIBDIR = ../lib + CORE_SOURCES = \ + glapi.c \ + glapinoop.c \ accum.c \ alpha.c \ alphabuf.c \ - api1.c \ - api2.c \ - apiext.c \ attrib.c \ bbox.c \ bitmap.c \ @@ -37,6 +37,7 @@ CORE_SOURCES = \ cva.c \ debug_xform.c \ depth.c \ + dispatch.c \ dlist.c \ drawpix.c \ enable.c \ @@ -49,18 +50,19 @@ CORE_SOURCES = \ glmisc.c \ hash.c \ image.c \ + imaging.c \ light.c \ lines.c \ logic.c \ masking.c \ matrix.c \ + mem.c \ mmath.c \ mthreads.c \ pb.c \ pixel.c \ pipeline.c \ points.c \ - pointers.c \ polygon.c \ quads.c \ rastpos.c \ diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index bbd23686d49..c4021731da5 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1,4 +1,4 @@ -/* $Id: fakeglx.c,v 1.12 1999/10/27 09:50:10 brianp Exp $ */ +/* $Id: fakeglx.c,v 1.13 1999/11/11 01:29:28 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -45,16 +45,7 @@ -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#include -#include -#include -#include -#include -#include "GL/gl.h" +#include "glxheader.h" #include "GL/xmesa.h" #include "context.h" #include "config.h" @@ -1056,6 +1047,7 @@ Bool Fake_glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx ) { if (ctx && drawable) { XMesaBuffer buffer; + XMesaContext xmctx = (XMesaContext) ctx; if (drawable==MakeCurrent_PrevDrawable && ctx==MakeCurrent_PrevContext) { buffer = MakeCurrent_PrevBuffer; @@ -1065,7 +1057,7 @@ Bool Fake_glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx ) } if (!buffer) { /* drawable must be a new window! */ - buffer = XMesaCreateWindowBuffer2( ctx->xm_visual, drawable, ctx ); + buffer = XMesaCreateWindowBuffer2( xmctx->xm_visual, drawable, ctx ); if (!buffer) { /* Out of memory, or context/drawable depth mismatch */ return False; diff --git a/src/mesa/drivers/x11/glxheader.h b/src/mesa/drivers/x11/glxheader.h new file mode 100644 index 00000000000..28e53659f00 --- /dev/null +++ b/src/mesa/drivers/x11/glxheader.h @@ -0,0 +1,71 @@ +/* $Id: glxheader.h,v 1.1 1999/11/11 01:29:28 brianp 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. + */ + + +#ifndef GLX_HEADER_H +#define GLX_HEADER_H + + +#ifdef HAVE_CONFIG_H +#include "conf.h" +#endif + + +#include "glheader.h" + + +#ifdef XFree86Server + +# include "resource.h" +# include "windowstr.h" +# include "gcstruct.h" +# include "GL/xf86glx.h" +# include "xf86glx_util.h" + +#else + +# ifdef GLX_DIRECT_RENDERING +# include "dri_mesaint.h" +# endif +# include +# include +# ifdef USE_XSHM /* was SHM */ +# include +# include +# include +# endif + +#endif + + + +/* this silences a compiler warning on several systems */ +struct timespec; +struct itimerspec; + + + +#endif /*GLX_HEADER*/ diff --git a/src/mesa/drivers/x11/xfonts.c b/src/mesa/drivers/x11/xfonts.c index 8745276123c..de6bc918b0a 100644 --- a/src/mesa/drivers/x11/xfonts.c +++ b/src/mesa/drivers/x11/xfonts.c @@ -1,8 +1,8 @@ -/* $Id: xfonts.c,v 1.2 1999/10/13 18:49:47 brianp Exp $ */ +/* $Id: xfonts.c,v 1.3 1999/11/11 01:29:28 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -44,7 +44,7 @@ #include "GL/xmesa.h" #include "context.h" #include "fakeglx.h" -#include "macros.h" +#include "mem.h" #include "xmesaP.h" /* Some debugging info. */ diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c new file mode 100644 index 00000000000..5cada8f6b1f --- /dev/null +++ b/src/mesa/glapi/glapi.c @@ -0,0 +1,3505 @@ +/* $Id: glapi.c,v 1.1 1999/11/11 01:22:26 brianp 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. + */ + + +#include +#include +#include +#include +#include "glapi.h" +#include "glapinoop.h" + + + +#if defined(MULTI_THREAD) + +/* XXX to do */ + +#else + +static struct _glapi_table *Dispatch = &__glapi_noop_table; +#define DISPATCH(FUNC) (Dispatch->FUNC) + +#endif + + +void GLAPIENTRY glAccum(GLenum op, GLfloat value) +{ + DISPATCH(Accum)(op, value); +} + +void GLAPIENTRY glAlphaFunc(GLenum func, GLclampf ref) +{ + DISPATCH(AlphaFunc)(func, ref); +} + +void GLAPIENTRY glBegin(GLenum mode) +{ + DISPATCH(Begin)(mode); +} + +void GLAPIENTRY glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap) +{ + DISPATCH(Bitmap)(width, height, xorig, yorig, xmove, ymove, bitmap); +} + +void GLAPIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor) +{ + DISPATCH(BlendFunc)(sfactor, dfactor); +} + +void GLAPIENTRY glCallList(GLuint list) +{ + DISPATCH(CallList)(list); +} + +void GLAPIENTRY glCallLists(GLsizei n, GLenum type, const GLvoid *lists) +{ + DISPATCH(CallLists)(n, type, lists); +} + +void GLAPIENTRY glClear(GLbitfield mask) +{ + DISPATCH(Clear)(mask); +} + +void GLAPIENTRY glClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) +{ + DISPATCH(ClearAccum)(red, green, blue, alpha); +} + +void GLAPIENTRY glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) +{ + DISPATCH(ClearColor)(red, green, blue, alpha); +} + +void GLAPIENTRY glClearDepth(GLclampd depth) +{ + DISPATCH(ClearDepth)(depth); +} + +void GLAPIENTRY glClearIndex(GLfloat c) +{ + DISPATCH(ClearIndex)(c); +} + +void GLAPIENTRY glClearStencil(GLint s) +{ + DISPATCH(ClearStencil)(s); +} + +void GLAPIENTRY glClipPlane(GLenum plane, const GLdouble *equation) +{ + DISPATCH(ClipPlane)(plane, equation); +} + +void GLAPIENTRY glColor3b(GLbyte red, GLbyte green, GLbyte blue) +{ + DISPATCH(Color3b)(red, green, blue); +} + +void GLAPIENTRY glColor3d(GLdouble red, GLdouble green, GLdouble blue) +{ + DISPATCH(Color3d)(red, green, blue); +} + +void GLAPIENTRY glColor3f(GLfloat red, GLfloat green, GLfloat blue) +{ + DISPATCH(Color3f)(red, green, blue); +} + +void GLAPIENTRY glColor3i(GLint red, GLint green, GLint blue) +{ + DISPATCH(Color3i)(red, green, blue); +} + +void GLAPIENTRY glColor3s(GLshort red, GLshort green, GLshort blue) +{ + DISPATCH(Color3s)(red, green, blue); +} + +void GLAPIENTRY glColor3ub(GLubyte red, GLubyte green, GLubyte blue) +{ + DISPATCH(Color3ub)(red, green, blue); +} + +void GLAPIENTRY glColor3ui(GLuint red, GLuint green, GLuint blue) +{ + DISPATCH(Color3ui)(red, green, blue); +} + +void GLAPIENTRY glColor3us(GLushort red, GLushort green, GLushort blue) +{ + DISPATCH(Color3us)(red, green, blue); +} + +void GLAPIENTRY glColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha) +{ + DISPATCH(Color4b)(red, green, blue, alpha); +} + +void GLAPIENTRY glColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha) +{ + DISPATCH(Color4d)(red, green, blue, alpha); +} + +void GLAPIENTRY glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) +{ + DISPATCH(Color4f)(red, green, blue, alpha); +} + +void GLAPIENTRY glColor4i(GLint red, GLint green, GLint blue, GLint alpha) +{ + DISPATCH(Color4i)(red, green, blue, alpha); +} + +void GLAPIENTRY glColor4s(GLshort red, GLshort green, GLshort blue, GLshort alpha) +{ + DISPATCH(Color4s)(red, green, blue, alpha); +} + +void GLAPIENTRY glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) +{ + DISPATCH(Color4ub)(red, green, blue, alpha); +} + +void GLAPIENTRY glColor4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha) +{ + DISPATCH(Color4ui)(red, green, blue, alpha); +} + +void GLAPIENTRY glColor4us(GLushort red, GLushort green, GLushort blue, GLushort alpha) +{ + DISPATCH(Color4us)(red, green, blue, alpha); +} + +void GLAPIENTRY glColor3bv(const GLbyte *v) +{ + DISPATCH(Color3bv)(v); +} + +void GLAPIENTRY glColor3dv(const GLdouble *v) +{ + DISPATCH(Color3dv)(v); +} + +void GLAPIENTRY glColor3fv(const GLfloat *v) +{ + DISPATCH(Color3fv)(v); +} + +void GLAPIENTRY glColor3iv(const GLint *v) +{ + DISPATCH(Color3iv)(v); +} + +void GLAPIENTRY glColor3sv(const GLshort *v) +{ + DISPATCH(Color3sv)(v); +} + +void GLAPIENTRY glColor3ubv(const GLubyte *v) +{ + DISPATCH(Color3ubv)(v); +} + +void GLAPIENTRY glColor3uiv(const GLuint *v) +{ + DISPATCH(Color3uiv)(v); +} + +void GLAPIENTRY glColor3usv(const GLushort *v) +{ + DISPATCH(Color3usv)(v); +} + +void GLAPIENTRY glColor4bv(const GLbyte *v) +{ + DISPATCH(Color4bv)(v); +} + +void GLAPIENTRY glColor4dv(const GLdouble *v) +{ + DISPATCH(Color4dv)(v); +} + +void GLAPIENTRY glColor4fv(const GLfloat *v) +{ + DISPATCH(Color4fv)(v); +} + +void GLAPIENTRY glColor4iv(const GLint *v) +{ + DISPATCH(Color4iv)(v); +} + +void GLAPIENTRY glColor4sv(const GLshort *v) +{ + DISPATCH(Color4sv)(v); +} + +void GLAPIENTRY glColor4ubv(const GLubyte *v) +{ + DISPATCH(Color4ubv)(v); +} + +void GLAPIENTRY glColor4uiv(const GLuint *v) +{ + DISPATCH(Color4uiv)(v); +} + +void GLAPIENTRY glColor4usv(const GLushort *v) +{ + DISPATCH(Color4usv)(v); +} + +void GLAPIENTRY glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) +{ + DISPATCH(ColorMask)(red, green, blue, alpha); +} + +void GLAPIENTRY glColorMaterial(GLenum face, GLenum mode) +{ + DISPATCH(ColorMaterial)(face, mode); +} + +void GLAPIENTRY glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) +{ + DISPATCH(CopyPixels)(x, y, width, height, type); +} + +void GLAPIENTRY glCullFace(GLenum mode) +{ + DISPATCH(CullFace)(mode); +} + +void GLAPIENTRY glDepthFunc(GLenum func) +{ + DISPATCH(DepthFunc)(func); +} + +void GLAPIENTRY glDepthMask(GLboolean flag) +{ + DISPATCH(DepthMask)(flag); +} + +void GLAPIENTRY glDepthRange(GLclampd nearVal, GLclampd farVal) +{ + DISPATCH(DepthRange)(nearVal, farVal); +} + +void GLAPIENTRY glDeleteLists(GLuint list, GLsizei range) +{ + DISPATCH(DeleteLists)(list, range); +} + +void GLAPIENTRY glDisable(GLenum cap) +{ + DISPATCH(Disable)(cap); +} + +void GLAPIENTRY glDisableClientState(GLenum cap) +{ + DISPATCH(DisableClientState)(cap); +} + +void GLAPIENTRY glDrawArrays(GLenum mode, GLint first, GLsizei count) +{ + DISPATCH(DrawArrays)(mode, first, count); +} + +void GLAPIENTRY glDrawBuffer(GLenum mode) +{ + DISPATCH(DrawBuffer)(mode); +} + +void GLAPIENTRY glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) +{ + DISPATCH(DrawElements)(mode, count, type, indices); +} + +void GLAPIENTRY glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) +{ + DISPATCH(DrawPixels)(width, height, format, type, pixels); +} + +void GLAPIENTRY glEnable(GLenum mode) +{ + DISPATCH(Enable)(mode); +} + +void GLAPIENTRY glEnableClientState(GLenum cap) +{ + DISPATCH(EnableClientState)(cap); +} + +void GLAPIENTRY glEnd(void) +{ + DISPATCH(End)(); +} + +void GLAPIENTRY glEndList(void) +{ + DISPATCH(EndList)(); +} + +void GLAPIENTRY glEvalCoord1d(GLdouble u) +{ + DISPATCH(EvalCoord1d)(u); +} + +void GLAPIENTRY glEvalCoord1f(GLfloat u) +{ + DISPATCH(EvalCoord1f)(u); +} + +void GLAPIENTRY glEvalCoord1dv(const GLdouble *u) +{ + DISPATCH(EvalCoord1dv)(u); +} + +void GLAPIENTRY glEvalCoord1fv(const GLfloat *u) +{ + DISPATCH(EvalCoord1fv)(u); +} + +void GLAPIENTRY glEvalCoord2d(GLdouble u, GLdouble v) +{ + DISPATCH(EvalCoord2d)(u, v); +} + +void GLAPIENTRY glEvalCoord2f(GLfloat u, GLfloat v) +{ + DISPATCH(EvalCoord2f)(u, v); +} + +void GLAPIENTRY glEvalCoord2dv(const GLdouble *u) +{ + DISPATCH(EvalCoord2dv)(u); +} + +void GLAPIENTRY glEvalCoord2fv(const GLfloat *u) +{ + DISPATCH(EvalCoord2fv)(u); +} + +void GLAPIENTRY glEvalPoint1(GLint i) +{ + DISPATCH(EvalPoint1)(i); +} + +void GLAPIENTRY glEvalPoint2(GLint i, GLint j) +{ + DISPATCH(EvalPoint2)(i, j); +} + +void GLAPIENTRY glEvalMesh1(GLenum mode, GLint i1, GLint i2) +{ + DISPATCH(EvalMesh1)(mode, i1, i2); +} + +void GLAPIENTRY glEdgeFlag(GLboolean flag) +{ + DISPATCH(EdgeFlag)(flag); +} + +void GLAPIENTRY glEdgeFlagv(const GLboolean *flag) +{ + DISPATCH(EdgeFlagv)(flag); +} + +void GLAPIENTRY glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) +{ + DISPATCH(EvalMesh2)(mode, i1, i2, j1, j2); +} + +void GLAPIENTRY glFeedbackBuffer(GLsizei size, GLenum type, GLfloat *buffer) +{ + DISPATCH(FeedbackBuffer)(size, type, buffer); +} + +void GLAPIENTRY glFinish(void) +{ + DISPATCH(Finish)(); +} + +void GLAPIENTRY glFlush(void) +{ + DISPATCH(Flush)(); +} + +void GLAPIENTRY glFogf(GLenum pname, GLfloat param) +{ + DISPATCH(Fogf)(pname, param); +} + +void GLAPIENTRY glFogi(GLenum pname, GLint param) +{ + DISPATCH(Fogi)(pname, param); +} + +void GLAPIENTRY glFogfv(GLenum pname, const GLfloat *params) +{ + DISPATCH(Fogfv)(pname, params); +} + +void GLAPIENTRY glFogiv(GLenum pname, const GLint *params) +{ + DISPATCH(Fogiv)(pname, params); +} + +void GLAPIENTRY glFrontFace(GLenum mode) +{ + DISPATCH(FrontFace)(mode); +} + +void GLAPIENTRY glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval) +{ + DISPATCH(Frustum)(left, right, bottom, top, nearval, farval); +} + +GLuint GLAPIENTRY glGenLists(GLsizei range) +{ + return DISPATCH(GenLists)(range); +} + +void GLAPIENTRY glGenTextures(GLsizei n, GLuint *textures) +{ + DISPATCH(GenTextures)(n, textures); +} + +void GLAPIENTRY glGetBooleanv(GLenum pname, GLboolean *params) +{ + DISPATCH(GetBooleanv)(pname, params); +} + +void GLAPIENTRY glGetClipPlane(GLenum plane, GLdouble *equation) +{ + DISPATCH(GetClipPlane)(plane, equation); +} + +void GLAPIENTRY glGetDoublev(GLenum pname, GLdouble *params) +{ + DISPATCH(GetDoublev)(pname, params); +} + +GLenum GLAPIENTRY glGetError(void) +{ + return DISPATCH(GetError)(); +} + +void GLAPIENTRY glGetFloatv(GLenum pname, GLfloat *params) +{ + DISPATCH(GetFloatv)(pname, params); +} + +void GLAPIENTRY glGetIntegerv(GLenum pname, GLint *params) +{ + DISPATCH(GetIntegerv)(pname, params); +} + +void GLAPIENTRY glGetLightfv(GLenum light, GLenum pname, GLfloat *params) +{ + DISPATCH(GetLightfv)(light, pname, params); +} + +void GLAPIENTRY glGetLightiv(GLenum light, GLenum pname, GLint *params) +{ + DISPATCH(GetLightiv)(light, pname, params); +} + +void GLAPIENTRY glGetMapdv(GLenum target, GLenum query, GLdouble *v) +{ + DISPATCH(GetMapdv)(target, query, v); +} + +void GLAPIENTRY glGetMapfv(GLenum target, GLenum query, GLfloat *v) +{ + DISPATCH(GetMapfv)(target, query, v); +} + +void GLAPIENTRY glGetMapiv(GLenum target, GLenum query, GLint *v) +{ + DISPATCH(GetMapiv)(target, query, v); +} + +void GLAPIENTRY glGetMaterialfv(GLenum face, GLenum pname, GLfloat *params) +{ + DISPATCH(GetMaterialfv)(face, pname, params); +} + +void GLAPIENTRY glGetMaterialiv(GLenum face, GLenum pname, GLint *params) +{ + DISPATCH(GetMaterialiv)(face, pname, params); +} + +void GLAPIENTRY glGetPixelMapfv(GLenum map, GLfloat *values) +{ + DISPATCH(GetPixelMapfv)(map, values); +} + +void GLAPIENTRY glGetPixelMapuiv(GLenum map, GLuint *values) +{ + DISPATCH(GetPixelMapuiv)(map, values); +} + +void GLAPIENTRY glGetPixelMapusv(GLenum map, GLushort *values) +{ + DISPATCH(GetPixelMapusv)(map, values); +} + +void GLAPIENTRY glGetPointerv(GLenum pname, GLvoid **params) +{ + DISPATCH(GetPointerv)(pname, params); +} + +void GLAPIENTRY glGetPolygonStipple(GLubyte *mask) +{ + DISPATCH(GetPolygonStipple)(mask); +} + +const GLubyte * GLAPIENTRY glGetString(GLenum name) +{ + return DISPATCH(GetString)(name); +} + +void GLAPIENTRY glGetTexEnvfv(GLenum target, GLenum pname, GLfloat *params) +{ + DISPATCH(GetTexEnvfv)(target, pname, params); +} + +void GLAPIENTRY glGetTexEnviv(GLenum target, GLenum pname, GLint *params) +{ + DISPATCH(GetTexEnviv)(target, pname, params); +} + +void GLAPIENTRY glGetTexGeniv(GLenum target, GLenum pname, GLint *params) +{ + DISPATCH(GetTexGeniv)(target, pname, params); +} + +void GLAPIENTRY glGetTexGendv(GLenum target, GLenum pname, GLdouble *params) +{ + DISPATCH(GetTexGendv)(target, pname, params); +} + +void GLAPIENTRY glGetTexGenfv(GLenum target, GLenum pname, GLfloat *params) +{ + DISPATCH(GetTexGenfv)(target, pname, params); +} + +void GLAPIENTRY glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) +{ + DISPATCH(GetTexImage)(target, level, format, type, pixels); +} + +void GLAPIENTRY glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params) +{ + DISPATCH(GetTexLevelParameterfv)(target, level, pname, params); +} + +void GLAPIENTRY glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params) +{ + DISPATCH(GetTexLevelParameteriv)(target, level, pname, params); +} + +void GLAPIENTRY glGetTexParameterfv(GLenum target, GLenum pname, GLfloat *params) +{ + DISPATCH(GetTexParameterfv)(target, pname, params); +} + +void GLAPIENTRY glGetTexParameteriv(GLenum target, GLenum pname, GLint *params) +{ + DISPATCH(GetTexParameteriv)(target, pname, params); +} + +void GLAPIENTRY glHint(GLenum target, GLenum mode) +{ + DISPATCH(Hint)(target, mode); +} + +void GLAPIENTRY glIndexd(GLdouble c) +{ + DISPATCH(Indexd)(c); +} + +void GLAPIENTRY glIndexdv(const GLdouble *c) +{ + DISPATCH(Indexdv)(c); +} + +void GLAPIENTRY glIndexf(GLfloat c) +{ + DISPATCH(Indexf)(c); +} + +void GLAPIENTRY glIndexfv(const GLfloat *c) +{ + DISPATCH(Indexfv)(c); +} + +void GLAPIENTRY glIndexi(GLint c) +{ + DISPATCH(Indexi)(c); +} + +void GLAPIENTRY glIndexiv(const GLint *c) +{ + DISPATCH(Indexiv)(c); +} + +void GLAPIENTRY glIndexs(GLshort c) +{ + DISPATCH(Indexs)(c); +} + +void GLAPIENTRY glIndexsv(const GLshort *c) +{ + DISPATCH(Indexsv)(c); +} + +void GLAPIENTRY glIndexub(GLubyte c) +{ + DISPATCH(Indexub)(c); +} + +void GLAPIENTRY glIndexubv(const GLubyte *c) +{ + DISPATCH(Indexubv)(c); +} + +void GLAPIENTRY glIndexMask(GLuint mask) +{ + DISPATCH(IndexMask)(mask); +} + +void GLAPIENTRY glInitNames(void) +{ + DISPATCH(InitNames)(); +} + +void GLAPIENTRY glInterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer) +{ + DISPATCH(InterleavedArrays)(format, stride, pointer); +} + +GLboolean GLAPIENTRY glIsList(GLuint list) +{ + return DISPATCH(IsList)(list); +} + +GLboolean GLAPIENTRY glIsTexture(GLuint texture) +{ + return DISPATCH(IsTexture)(texture); +} + +void GLAPIENTRY glLightf(GLenum light, GLenum pname, GLfloat param) +{ + DISPATCH(Lightf)(light, pname, param); +} + +void GLAPIENTRY glLighti(GLenum light, GLenum pname, GLint param) +{ + DISPATCH(Lighti)(light, pname, param); +} + +void GLAPIENTRY glLightfv(GLenum light, GLenum pname, const GLfloat *params) +{ + DISPATCH(Lightfv)(light, pname, params); +} + +void GLAPIENTRY glLightiv(GLenum light, GLenum pname, const GLint *params) +{ + DISPATCH(Lightiv)(light, pname, params); +} + +void GLAPIENTRY glLightModelf(GLenum pname, GLfloat param) +{ + DISPATCH(LightModelf)(pname, param); +} + +void GLAPIENTRY glLightModeli(GLenum pname, GLint param) +{ + DISPATCH(LightModeli)(pname, param); +} + +void GLAPIENTRY glLightModelfv(GLenum pname, const GLfloat *params) +{ + DISPATCH(LightModelfv)(pname, params); +} + +void GLAPIENTRY glLightModeliv(GLenum pname, const GLint *params) +{ + DISPATCH(LightModeliv)(pname, params); +} + +void GLAPIENTRY glLineWidth(GLfloat width) +{ + DISPATCH(LineWidth)(width); +} + +void GLAPIENTRY glLineStipple(GLint factor, GLushort pattern) +{ + DISPATCH(LineStipple)(factor, pattern); +} + +void GLAPIENTRY glListBase(GLuint base) +{ + DISPATCH(ListBase)(base); +} + +void GLAPIENTRY glLoadIdentity(void) +{ + DISPATCH(LoadIdentity)(); +} + +void GLAPIENTRY glLoadMatrixd(const GLdouble *m) +{ + DISPATCH(LoadMatrixd)(m); +} + +void GLAPIENTRY glLoadMatrixf(const GLfloat *m) +{ + DISPATCH(LoadMatrixf)(m); +} + +void GLAPIENTRY glLoadName(GLuint name) +{ + DISPATCH(LoadName)(name); +} + +void GLAPIENTRY glLogicOp(GLenum opcode) +{ + DISPATCH(LogicOp)(opcode); +} + +void GLAPIENTRY glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points) +{ + DISPATCH(Map1d)(target, u1, u2, stride, order, points); +} + +void GLAPIENTRY glMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points) +{ + DISPATCH(Map1f)(target, u1, u2, stride, order, points); +} + +void GLAPIENTRY glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points) +{ + DISPATCH(Map2d)(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); +} + +void GLAPIENTRY glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points) +{ + DISPATCH(Map2f)(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); +} + +void GLAPIENTRY glMapGrid1d(GLint un, GLdouble u1, GLdouble u2) +{ + DISPATCH(MapGrid1d)(un, u1, u2); +} + +void GLAPIENTRY glMapGrid1f(GLint un, GLfloat u1, GLfloat u2) +{ + DISPATCH(MapGrid1f)(un, u1, u2); +} + +void GLAPIENTRY glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2) +{ + DISPATCH(MapGrid2d)(un, u1, u2, vn, v1, v2); +} + +void GLAPIENTRY glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2) +{ + DISPATCH(MapGrid2f)(un, u1, u2, vn, v1, v2); +} + +void GLAPIENTRY glMaterialf(GLenum face, GLenum pname, GLfloat param) +{ + DISPATCH(Materialf)(face, pname, param); +} + +void GLAPIENTRY glMateriali(GLenum face, GLenum pname, GLint param) +{ + DISPATCH(Materiali)(face, pname, param); +} + +void GLAPIENTRY glMaterialfv(GLenum face, GLenum pname, const GLfloat *params) +{ + DISPATCH(Materialfv)(face, pname, params); +} + +void GLAPIENTRY glMaterialiv(GLenum face, GLenum pname, const GLint *params) +{ + DISPATCH(Materialiv)(face, pname, params); +} + +void GLAPIENTRY glMatrixMode(GLenum mode) +{ + DISPATCH(MatrixMode)(mode); +} + +void GLAPIENTRY glMultMatrixd(const GLdouble *m) +{ + DISPATCH(MultMatrixd)(m); +} + +void GLAPIENTRY glMultMatrixf(const GLfloat *m) +{ + DISPATCH(MultMatrixf)(m); +} + +void GLAPIENTRY glNewList(GLuint list, GLenum mode) +{ + DISPATCH(NewList)(list, mode); +} + +void GLAPIENTRY glNormal3b(GLbyte nx, GLbyte ny, GLbyte nz) +{ + DISPATCH(Normal3b)(nx, ny, nz); +} + +void GLAPIENTRY glNormal3bv(const GLbyte *v) +{ + DISPATCH(Normal3bv)(v); +} + +void GLAPIENTRY glNormal3d(GLdouble nx, GLdouble ny, GLdouble nz) +{ + DISPATCH(Normal3d)(nx, ny, nz); +} + +void GLAPIENTRY glNormal3dv(const GLdouble *v) +{ + DISPATCH(Normal3dv)(v); +} + +void GLAPIENTRY glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz) +{ + DISPATCH(Normal3f)(nx, ny, nz); +} + +void GLAPIENTRY glNormal3fv(const GLfloat *v) +{ + DISPATCH(Normal3fv)(v); +} + +void GLAPIENTRY glNormal3i(GLint nx, GLint ny, GLint nz) +{ + DISPATCH(Normal3i)(nx, ny, nz); +} + +void GLAPIENTRY glNormal3iv(const GLint *v) +{ + DISPATCH(Normal3iv)(v); +} + +void GLAPIENTRY glNormal3s(GLshort nx, GLshort ny, GLshort nz) +{ + DISPATCH(Normal3s)(nx, ny, nz); +} + +void GLAPIENTRY glNormal3sv(const GLshort *v) +{ + DISPATCH(Normal3sv)(v); +} + +void GLAPIENTRY glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval) +{ + DISPATCH(Ortho)(left, right, bottom, top, nearval, farval); +} + +void GLAPIENTRY glPassThrough(GLfloat token) +{ + DISPATCH(PassThrough)(token); +} + +void GLAPIENTRY glPixelMapfv(GLenum map, GLint mapsize, const GLfloat *values) +{ + DISPATCH(PixelMapfv)(map, mapsize, values); +} + +void GLAPIENTRY glPixelMapuiv(GLenum map, GLint mapsize, const GLuint *values) +{ + DISPATCH(PixelMapuiv)(map, mapsize, values); +} + +void GLAPIENTRY glPixelMapusv(GLenum map, GLint mapsize, const GLushort *values) +{ + DISPATCH(PixelMapusv)(map, mapsize, values); +} + +void GLAPIENTRY glPixelStoref(GLenum pname, GLfloat param) +{ + DISPATCH(PixelStoref)(pname, param); +} + +void GLAPIENTRY glPixelStorei(GLenum pname, GLint param) +{ + DISPATCH(PixelStorei)(pname, param); +} + +void GLAPIENTRY glPixelTransferf(GLenum pname, GLfloat param) +{ + DISPATCH(PixelTransferf)(pname, param); +} + +void GLAPIENTRY glPixelTransferi(GLenum pname, GLint param) +{ + DISPATCH(PixelTransferi)(pname, param); +} + +void GLAPIENTRY glPixelZoom(GLfloat xfactor, GLfloat yfactor) +{ + DISPATCH(PixelZoom)(xfactor, yfactor); +} + +void GLAPIENTRY glPointSize(GLfloat size) +{ + DISPATCH(PointSize)(size); +} + +void GLAPIENTRY glPolygonMode(GLenum face, GLenum mode) +{ + DISPATCH(PolygonMode)(face, mode); +} + +void GLAPIENTRY glPolygonOffset(GLfloat factor, GLfloat units) +{ + DISPATCH(PolygonOffset)(factor, units); +} + +void GLAPIENTRY glPolygonStipple(const GLubyte *pattern) +{ + DISPATCH(PolygonStipple)(pattern); +} + +void GLAPIENTRY glPopAttrib(void) +{ + DISPATCH(PopAttrib)(); +} + +void GLAPIENTRY glPopClientAttrib(void) +{ + DISPATCH(PopClientAttrib)(); +} + +void GLAPIENTRY glPopMatrix(void) +{ + DISPATCH(PopMatrix)(); +} + +void GLAPIENTRY glPopName(void) +{ + DISPATCH(PopName)(); +} + +void GLAPIENTRY glPrioritizeTextures(GLsizei n, const GLuint *textures, const GLclampf *priorities) +{ + DISPATCH(PrioritizeTextures)(n, textures, priorities); +} + +void GLAPIENTRY glPushMatrix(void) +{ + DISPATCH(PushMatrix)(); +} + +void GLAPIENTRY glRasterPos2d(GLdouble x, GLdouble y) +{ + DISPATCH(RasterPos2d)(x, y); +} + +void GLAPIENTRY glRasterPos2f(GLfloat x, GLfloat y) +{ + DISPATCH(RasterPos2f)(x, y); +} + +void GLAPIENTRY glRasterPos2i(GLint x, GLint y) +{ + DISPATCH(RasterPos2i)(x, y); +} + +void GLAPIENTRY glRasterPos2s(GLshort x, GLshort y) +{ + DISPATCH(RasterPos2s)(x, y); +} + +void GLAPIENTRY glRasterPos3d(GLdouble x, GLdouble y, GLdouble z) +{ + DISPATCH(RasterPos3d)(x, y, z); +} + +void GLAPIENTRY glRasterPos3f(GLfloat x, GLfloat y, GLfloat z) +{ + DISPATCH(RasterPos3f)(x, y, z); +} + +void GLAPIENTRY glRasterPos3i(GLint x, GLint y, GLint z) +{ + DISPATCH(RasterPos3i)(x, y, z); +} + +void GLAPIENTRY glRasterPos3s(GLshort x, GLshort y, GLshort z) +{ + DISPATCH(RasterPos3s)(x, y, z); +} + +void GLAPIENTRY glRasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) +{ + DISPATCH(RasterPos4d)(x, y, z, w); +} + +void GLAPIENTRY glRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) +{ + DISPATCH(RasterPos4f)(x, y, z, w); +} + +void GLAPIENTRY glRasterPos4i(GLint x, GLint y, GLint z, GLint w) +{ + DISPATCH(RasterPos4i)(x, y, z, w); +} + +void GLAPIENTRY glRasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) +{ + DISPATCH(RasterPos4s)(x, y, z, w); +} + +void GLAPIENTRY glRasterPos2dv(const GLdouble *v) +{ + DISPATCH(RasterPos2dv)(v); +} + +void GLAPIENTRY glRasterPos2fv(const GLfloat *v) +{ + DISPATCH(RasterPos2fv)(v); +} + +void GLAPIENTRY glRasterPos2iv(const GLint *v) +{ + DISPATCH(RasterPos2iv)(v); +} + +void GLAPIENTRY glRasterPos2sv(const GLshort *v) +{ + DISPATCH(RasterPos2sv)(v); +} + +void GLAPIENTRY glRasterPos3dv(const GLdouble *v) +{ + DISPATCH(RasterPos3dv)(v); +} + +void GLAPIENTRY glRasterPos3fv(const GLfloat *v) +{ + DISPATCH(RasterPos3fv)(v); +} + +void GLAPIENTRY glRasterPos3iv(const GLint *v) +{ + DISPATCH(RasterPos3iv)(v); +} + +void GLAPIENTRY glRasterPos3sv(const GLshort *v) +{ + DISPATCH(RasterPos3sv)(v); +} + +void GLAPIENTRY glRasterPos4dv(const GLdouble *v) +{ + DISPATCH(RasterPos4dv)(v); +} + +void GLAPIENTRY glRasterPos4fv(const GLfloat *v) +{ + DISPATCH(RasterPos4fv)(v); +} + +void GLAPIENTRY glRasterPos4iv(const GLint *v) +{ + DISPATCH(RasterPos4iv)(v); +} + +void GLAPIENTRY glRasterPos4sv(const GLshort *v) +{ + DISPATCH(RasterPos4sv)(v); +} + +void GLAPIENTRY glReadBuffer(GLenum mode) +{ + DISPATCH(ReadBuffer)(mode); +} + +void GLAPIENTRY glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels) +{ + DISPATCH(ReadPixels)(x, y, width, height, format, type, pixels); +} + +void GLAPIENTRY glRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) +{ + DISPATCH(Rectd)(x1, y1, x2, y2); +} + +void GLAPIENTRY glRectdv(const GLdouble *v1, const GLdouble *v2) +{ + DISPATCH(Rectdv)(v1, v2); +} + +void GLAPIENTRY glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) +{ + DISPATCH(Rectf)(x1, y1, x2, y2); +} + +void GLAPIENTRY glRectfv(const GLfloat *v1, const GLfloat *v2) +{ + DISPATCH(Rectfv)(v1, v2); +} + +void GLAPIENTRY glRecti(GLint x1, GLint y1, GLint x2, GLint y2) +{ + DISPATCH(Recti)(x1, y1, x2, y2); +} + +void GLAPIENTRY glRectiv(const GLint *v1, const GLint *v2) +{ + DISPATCH(Rectiv)(v1, v2); +} + +void GLAPIENTRY glRects(GLshort x1, GLshort y1, GLshort x2, GLshort y2) +{ + DISPATCH(Rects)(x1, y1, x2, y2); +} + +void GLAPIENTRY glRectsv(const GLshort *v1, const GLshort *v2) +{ + DISPATCH(Rectsv)(v1, v2); +} + +void GLAPIENTRY glScissor(GLint x, GLint y, GLsizei width, GLsizei height) +{ + DISPATCH(Scissor)(x, y, width, height); +} + +GLboolean GLAPIENTRY glIsEnabled(GLenum cap) +{ + return DISPATCH(IsEnabled)(cap); +} + +void GLAPIENTRY glPushAttrib(GLbitfield mask) +{ + DISPATCH(PushAttrib)(mask); +} + +void GLAPIENTRY glPushClientAttrib(GLbitfield mask) +{ + DISPATCH(PushClientAttrib)(mask); +} + +void GLAPIENTRY glPushName(GLuint name) +{ + DISPATCH(PushName)(name); +} + +GLint GLAPIENTRY glRenderMode(GLenum mode) +{ + return DISPATCH(RenderMode)(mode); +} + +void GLAPIENTRY glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) +{ + DISPATCH(Rotated)(angle, x, y, z); +} + +void GLAPIENTRY glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) +{ + DISPATCH(Rotatef)(angle, x, y, z); +} + +void GLAPIENTRY glSelectBuffer(GLsizei size, GLuint *buffer) +{ + DISPATCH(SelectBuffer)(size, buffer); +} + +void GLAPIENTRY glScaled(GLdouble x, GLdouble y, GLdouble z) +{ + DISPATCH(Scaled)(x, y, z); +} + +void GLAPIENTRY glScalef(GLfloat x, GLfloat y, GLfloat z) +{ + DISPATCH(Scalef)(x, y, z); +} + +void GLAPIENTRY glShadeModel(GLenum mode) +{ + DISPATCH(ShadeModel)(mode); +} + +void GLAPIENTRY glStencilFunc(GLenum func, GLint ref, GLuint mask) +{ + DISPATCH(StencilFunc)(func, ref, mask); +} + +void GLAPIENTRY glStencilMask(GLuint mask) +{ + DISPATCH(StencilMask)(mask); +} + +void GLAPIENTRY glStencilOp(GLenum fail, GLenum zfail, GLenum zpass) +{ + DISPATCH(StencilOp)(fail, zfail, zpass); +} + +void GLAPIENTRY glTexCoord1d(GLdouble s) +{ + DISPATCH(TexCoord1d)(s); +} + +void GLAPIENTRY glTexCoord1f(GLfloat s) +{ + DISPATCH(TexCoord1f)(s); +} + +void GLAPIENTRY glTexCoord1i(GLint s) +{ + DISPATCH(TexCoord1i)(s); +} + +void GLAPIENTRY glTexCoord1s(GLshort s) +{ + DISPATCH(TexCoord1s)(s); +} + +void GLAPIENTRY glTexCoord2d(GLdouble s, GLdouble t) +{ + DISPATCH(TexCoord2d)(s, t); +} + +void GLAPIENTRY glTexCoord2f(GLfloat s, GLfloat t) +{ + DISPATCH(TexCoord2f)(s, t); +} + +void GLAPIENTRY glTexCoord2s(GLshort s, GLshort t) +{ + DISPATCH(TexCoord2s)(s, t); +} + +void GLAPIENTRY glTexCoord2i(GLint s, GLint t) +{ + DISPATCH(TexCoord2i)(s, t); +} + +void GLAPIENTRY glTexCoord3d(GLdouble s, GLdouble t, GLdouble r) +{ + DISPATCH(TexCoord3d)(s, t, r); +} + +void GLAPIENTRY glTexCoord3f(GLfloat s, GLfloat t, GLfloat r) +{ + DISPATCH(TexCoord3f)(s, t, r); +} + +void GLAPIENTRY glTexCoord3i(GLint s, GLint t, GLint r) +{ + DISPATCH(TexCoord3i)(s, t, r); +} + +void GLAPIENTRY glTexCoord3s(GLshort s, GLshort t, GLshort r) +{ + DISPATCH(TexCoord3s)(s, t, r); +} + +void GLAPIENTRY glTexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q) +{ + DISPATCH(TexCoord4d)(s, t, r, q); +} + +void GLAPIENTRY glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q) +{ + DISPATCH(TexCoord4f)(s, t, r, q); +} + +void GLAPIENTRY glTexCoord4i(GLint s, GLint t, GLint r, GLint q) +{ + DISPATCH(TexCoord4i)(s, t, r, q); +} + +void GLAPIENTRY glTexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q) +{ + DISPATCH(TexCoord4s)(s, t, r, q); +} + +void GLAPIENTRY glTexCoord1dv(const GLdouble *v) +{ + DISPATCH(TexCoord1dv)(v); +} + +void GLAPIENTRY glTexCoord1fv(const GLfloat *v) +{ + DISPATCH(TexCoord1fv)(v); +} + +void GLAPIENTRY glTexCoord1iv(const GLint *v) +{ + DISPATCH(TexCoord1iv)(v); +} + +void GLAPIENTRY glTexCoord1sv(const GLshort *v) +{ + DISPATCH(TexCoord1sv)(v); +} + +void GLAPIENTRY glTexCoord2dv(const GLdouble *v) +{ + DISPATCH(TexCoord2dv)(v); +} + +void GLAPIENTRY glTexCoord2fv(const GLfloat *v) +{ + DISPATCH(TexCoord2fv)(v); +} + +void GLAPIENTRY glTexCoord2iv(const GLint *v) +{ + DISPATCH(TexCoord2iv)(v); +} + +void GLAPIENTRY glTexCoord2sv(const GLshort *v) +{ + DISPATCH(TexCoord2sv)(v); +} + +void GLAPIENTRY glTexCoord3dv(const GLdouble *v) +{ + DISPATCH(TexCoord3dv)(v); +} + +void GLAPIENTRY glTexCoord3fv(const GLfloat *v) +{ + DISPATCH(TexCoord3fv)(v); +} + +void GLAPIENTRY glTexCoord3iv(const GLint *v) +{ + DISPATCH(TexCoord3iv)(v); +} + +void GLAPIENTRY glTexCoord3sv(const GLshort *v) +{ + DISPATCH(TexCoord3sv)(v); +} + +void GLAPIENTRY glTexCoord4dv(const GLdouble *v) +{ + DISPATCH(TexCoord4dv)(v); +} + +void GLAPIENTRY glTexCoord4fv(const GLfloat *v) +{ + DISPATCH(TexCoord4fv)(v); +} + +void GLAPIENTRY glTexCoord4iv(const GLint *v) +{ + DISPATCH(TexCoord4iv)(v); +} + +void GLAPIENTRY glTexCoord4sv(const GLshort *v) +{ + DISPATCH(TexCoord4sv)(v); +} + +void GLAPIENTRY glTexGend(GLenum coord, GLenum pname, GLdouble param) +{ + DISPATCH(TexGend)(coord, pname, param); +} + +void GLAPIENTRY glTexGendv(GLenum coord, GLenum pname, const GLdouble *params) +{ + DISPATCH(TexGendv)(coord, pname, params); +} + +void GLAPIENTRY glTexGenf(GLenum coord, GLenum pname, GLfloat param) +{ + DISPATCH(TexGenf)(coord, pname, param); +} + +void GLAPIENTRY glTexGenfv(GLenum coord, GLenum pname, const GLfloat *params) +{ + DISPATCH(TexGenfv)(coord, pname, params); +} + +void GLAPIENTRY glTexGeni(GLenum coord, GLenum pname, GLint param) +{ + DISPATCH(TexGeni)(coord, pname, param); +} + +void GLAPIENTRY glTexGeniv(GLenum coord, GLenum pname, const GLint *params) +{ + DISPATCH(TexGeniv)(coord, pname, params); +} + +void GLAPIENTRY glTexEnvf(GLenum target, GLenum pname, GLfloat param) +{ + DISPATCH(TexEnvf)(target, pname, param); +} + +void GLAPIENTRY glTexEnvfv(GLenum target, GLenum pname, const GLfloat *param) +{ + DISPATCH(TexEnvfv)(target, pname, param); +} + +void GLAPIENTRY glTexEnvi(GLenum target, GLenum pname, GLint param) +{ + DISPATCH(TexEnvi)(target, pname, param); +} + +void GLAPIENTRY glTexEnviv(GLenum target, GLenum pname, const GLint *param) +{ + DISPATCH(TexEnviv)(target, pname, param); +} + +void GLAPIENTRY glTexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) +{ + DISPATCH(TexImage1D)(target, level, internalformat, width, border, format, type, pixels); +} + +void GLAPIENTRY glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) +{ + DISPATCH(TexImage2D)(target, level, internalformat, width, height, border, format, type, pixels); +} + +void GLAPIENTRY glTexParameterf(GLenum target, GLenum pname, GLfloat param) +{ + DISPATCH(TexParameterf)(target, pname, param); +} + +void GLAPIENTRY glTexParameterfv(GLenum target, GLenum pname, const GLfloat *params) +{ + DISPATCH(TexParameterfv)(target, pname, params); +} + +void GLAPIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param) +{ + DISPATCH(TexParameteri)(target, pname, param); +} + +void GLAPIENTRY glTexParameteriv(GLenum target, GLenum pname, const GLint *params) +{ + DISPATCH(TexParameteriv)(target, pname, params); +} + +void GLAPIENTRY glTranslated(GLdouble x, GLdouble y, GLdouble z) +{ + DISPATCH(Translated)(x, y, z); +} + +void GLAPIENTRY glTranslatef(GLfloat x, GLfloat y, GLfloat z) +{ + DISPATCH(Translatef)(x, y, z); +} + +void GLAPIENTRY glVertex2d(GLdouble x, GLdouble y) +{ + DISPATCH(Vertex2d)(x, y); +} + +void GLAPIENTRY glVertex2dv(const GLdouble *v) +{ + DISPATCH(Vertex2dv)(v); +} + +void GLAPIENTRY glVertex2f(GLfloat x, GLfloat y) +{ + DISPATCH(Vertex2f)(x, y); +} + +void GLAPIENTRY glVertex2fv(const GLfloat *v) +{ + DISPATCH(Vertex2fv)(v); +} + +void GLAPIENTRY glVertex2i(GLint x, GLint y) +{ + DISPATCH(Vertex2i)(x, y); +} + +void GLAPIENTRY glVertex2iv(const GLint *v) +{ + DISPATCH(Vertex2iv)(v); +} + +void GLAPIENTRY glVertex2s(GLshort x, GLshort y) +{ + DISPATCH(Vertex2s)(x, y); +} + +void GLAPIENTRY glVertex2sv(const GLshort *v) +{ + DISPATCH(Vertex2sv)(v); +} + +void GLAPIENTRY glVertex3d(GLdouble x, GLdouble y, GLdouble z) +{ + DISPATCH(Vertex3d)(x, y, z); +} + +void GLAPIENTRY glVertex3dv(const GLdouble *v) +{ + DISPATCH(Vertex3dv)(v); +} + +void GLAPIENTRY glVertex3f(GLfloat x, GLfloat y, GLfloat z) +{ + DISPATCH(Vertex3f)(x, y, z); +} + +void GLAPIENTRY glVertex3fv(const GLfloat *v) +{ + DISPATCH(Vertex3fv)(v); +} + +void GLAPIENTRY glVertex3i(GLint x, GLint y, GLint z) +{ + DISPATCH(Vertex3i)(x, y, z); +} + +void GLAPIENTRY glVertex3iv(const GLint *v) +{ + DISPATCH(Vertex3iv)(v); +} + +void GLAPIENTRY glVertex3s(GLshort x, GLshort y, GLshort z) +{ + DISPATCH(Vertex3s)(x, y, z); +} + +void GLAPIENTRY glVertex3sv(const GLshort *v) +{ + DISPATCH(Vertex3sv)(v); +} + +void GLAPIENTRY glVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) +{ + DISPATCH(Vertex4d)(x, y, z, w); +} + +void GLAPIENTRY glVertex4dv(const GLdouble *v) +{ + DISPATCH(Vertex4dv)(v); +} + +void GLAPIENTRY glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) +{ + DISPATCH(Vertex4f)(x, y, z, w); +} + +void GLAPIENTRY glVertex4fv(const GLfloat *v) +{ + DISPATCH(Vertex4fv)(v); +} + +void GLAPIENTRY glVertex4i(GLint x, GLint y, GLint z, GLint w) +{ + DISPATCH(Vertex4i)(x, y, z, w); +} + +void GLAPIENTRY glVertex4iv(const GLint *v) +{ + DISPATCH(Vertex4iv)(v); +} + +void GLAPIENTRY glVertex4s(GLshort x, GLshort y, GLshort z, GLshort w) +{ + DISPATCH(Vertex4s)(x, y, z, w); +} + +void GLAPIENTRY glVertex4sv(const GLshort *v) +{ + DISPATCH(Vertex4sv)(v); +} + +void GLAPIENTRY glViewport(GLint x, GLint y, GLsizei width, GLsizei height) +{ + DISPATCH(Viewport)(x, y, width, height); +} + + + + +#ifdef _GLAPI_VERSION_1_1 + +GLboolean GLAPIENTRY glAreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences) +{ + return DISPATCH(AreTexturesResident)(n, textures, residences); +} + +void GLAPIENTRY glArrayElement(GLint i) +{ + DISPATCH(ArrayElement)(i); +} + +void GLAPIENTRY glBindTexture(GLenum target, GLuint texture) +{ + DISPATCH(BindTexture)(target, texture); +} + +void GLAPIENTRY glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) +{ + DISPATCH(ColorPointer)(size, type, stride, ptr); +} + +void GLAPIENTRY glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) +{ + DISPATCH(CopyTexImage1D)(target, level, internalformat, x, y, width, border); +} + +void GLAPIENTRY glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) +{ + DISPATCH(CopyTexImage2D)(target, level, internalformat, x, y, width, height, border); +} + +void GLAPIENTRY glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) +{ + DISPATCH(CopyTexSubImage1D)(target, level, xoffset, x, y, width); +} + +void GLAPIENTRY glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) +{ + DISPATCH(CopyTexSubImage2D)(target, level, xoffset, yoffset, x, y, width, height); +} + +void GLAPIENTRY glDeleteTextures(GLsizei n, const GLuint *textures) +{ + DISPATCH(DeleteTextures)(n, textures); +} + +void GLAPIENTRY glEdgeFlagPointer(GLsizei stride, const GLvoid *ptr) +{ + DISPATCH(EdgeFlagPointer)(stride, ptr); +} + +void GLAPIENTRY glIndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr) +{ + DISPATCH(IndexPointer)(type, stride, ptr); +} + +void GLAPIENTRY glNormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr) +{ + DISPATCH(NormalPointer)(type, stride, ptr); +} + +void GLAPIENTRY glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) +{ + DISPATCH(TexCoordPointer)(size, type, stride, ptr); +} + +void GLAPIENTRY glTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) +{ + DISPATCH(TexSubImage1D)(target, level, xoffset, width, format, type, pixels); +} + +void GLAPIENTRY glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) +{ + DISPATCH(TexSubImage2D)(target, level, xoffset, yoffset, width, height, format, type, pixels); +} + +void GLAPIENTRY glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) +{ + DISPATCH(VertexPointer)(size, type, stride, ptr); +} + +#endif /*GL_VERSION_1_1*/ + + + +#ifdef _GLAPI_VERSION_1_2 + +void GLAPIENTRY glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) +{ + DISPATCH(CopyTexSubImage3D)(target, level, xoffset, yoffset, zoffset, x, y, width, height); +} + +void GLAPIENTRY glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices) +{ + DISPATCH(DrawRangeElements)(mode, start, end, count, type, indices); +} + +void GLAPIENTRY glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) +{ + DISPATCH(TexImage3D)(target, level, internalformat, width, height, depth, border, format, type, pixels); +} + +void GLAPIENTRY glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) +{ + DISPATCH(TexSubImage3D)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); +} + + +#ifdef _GLAPI_ARB_imaging + +void GLAPIENTRY glBlendColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a) +{ + DISPATCH(BlendColor)(r, g, b, a); +} + +void GLAPIENTRY glBlendEquation(GLenum mode) +{ + DISPATCH(BlendEquation)(mode); +} + +void GLAPIENTRY glColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data) +{ + DISPATCH(ColorSubTable)(target, start, count, format, type, data); +} + +void GLAPIENTRY glColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table) +{ + DISPATCH(ColorTable)(target, internalformat, width, format, type, table); +} + +void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) +{ + DISPATCH(ColorTableParameterfv)(target, pname, params); +} + +void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) +{ + DISPATCH(ColorTableParameteriv)(target, pname, params); +} + +void glConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image) +{ + DISPATCH(ConvolutionFilter1D)(target, internalformat, width, format, type, image); +} + +void glConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image) +{ + DISPATCH(ConvolutionFilter2D)(target, internalformat, width, height, format, type, image); +} + +void glConvolutionParameterf(GLenum target, GLenum pname, GLfloat params) +{ + DISPATCH(ConvolutionParameterf)(target, pname, params); +} + +void glConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params) +{ + DISPATCH(ConvolutionParameterfv)(target, pname, params); +} + +void glConvolutionParameteri(GLenum target, GLenum pname, GLint params) +{ + DISPATCH(ConvolutionParameteri)(target, pname, params); +} + +void glConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) +{ + DISPATCH(ConvolutionParameteriv)(target, pname, params); +} + +void glCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) +{ + DISPATCH(CopyColorSubTable)(target, start, x, y, width); +} + +void glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) +{ + DISPATCH(CopyColorTable)(target, internalformat, x, y, width); +} + +void GLAPIENTRY glCopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) +{ + DISPATCH(CopyConvolutionFilter1D)(target, internalformat, x, y, width); +} + +void GLAPIENTRY glCopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) +{ + DISPATCH(CopyConvolutionFilter2D)(target, internalformat, x, y, width, height); +} + +void GLAPIENTRY glGetColorTable(GLenum target, GLenum format, GLenum type, GLvoid *table) +{ + DISPATCH(GetColorTable)(target, format, type, table); +} + +void GLAPIENTRY glGetColorTableParameterfv(GLenum target, GLenum pname, GLfloat *params) +{ + DISPATCH(GetColorTableParameterfv)(target, pname, params); +} + +void GLAPIENTRY glGetColorTableParameteriv(GLenum target, GLenum pname, GLint *params) +{ + DISPATCH(GetColorTableParameteriv)(target, pname, params); +} + +void GLAPIENTRY glGetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image) +{ + DISPATCH(GetConvolutionFilter)(target, format, type, image); +} + +void GLAPIENTRY glGetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params) +{ + DISPATCH(GetConvolutionParameterfv)(target, pname, params); +} + +void GLAPIENTRY glGetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params) +{ + DISPATCH(GetConvolutionParameteriv)(target, pname, params); +} + +void GLAPIENTRY glGetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) +{ + DISPATCH(GetHistogram)(target, reset, format, type, values); +} + +void GLAPIENTRY glGetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) +{ + DISPATCH(GetHistogramParameterfv)(target, pname, params); +} + +void GLAPIENTRY glGetHistogramParameteriv(GLenum target, GLenum pname, GLint *params) +{ + DISPATCH(GetHistogramParameteriv)(target, pname, params); +} + +void GLAPIENTRY glGetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values) +{ + DISPATCH(GetMinmax)(target, reset, format, types, values); +} + +void GLAPIENTRY glGetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params) +{ + DISPATCH(GetMinmaxParameterfv)(target, pname, params); +} + +void GLAPIENTRY glGetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params) +{ + DISPATCH(GetMinmaxParameteriv)(target, pname, params); +} + +void GLAPIENTRY glGetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span) +{ + DISPATCH(GetSeparableFilter)(target, format, type, row, column, span); +} + +void GLAPIENTRY glHistogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) +{ + DISPATCH(Histogram)(target, width, internalformat, sink); +} + +void GLAPIENTRY glMinmax(GLenum target, GLenum internalformat, GLboolean sink) +{ + DISPATCH(Minmax)(target, internalformat, sink); +} + +void GLAPIENTRY glResetMinmax(GLenum target) +{ + DISPATCH(ResetMinmax)(target); +} + +void GLAPIENTRY glResetHistogram(GLenum target) +{ + DISPATCH(ResetHistogram)(target); +} + +void GLAPIENTRY glSeparableFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column) +{ + DISPATCH(SeparableFilter2D)(target, internalformat, width, height, format, type, row, column); +} + + +#endif /*GL_ARB_imaging*/ +#endif /*GL_VERSION_1_2*/ + + + +/*** + *** Extension functions + ***/ + +#ifdef _GLAPI_EXT_blend_minmax +void GLAPIENTRY glBlendEquationEXT(GLenum mode) +{ + DISPATCH(BlendEquationEXT)(mode); +} +#endif + + +#ifdef _GLAPI_EXT_blend_color +void GLAPIENTRY glBlendColorEXT(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) +{ + DISPATCH(BlendColorEXT)(red, green, blue, alpha); +} +#endif + + +#ifdef _GLAPI_EXT_polygon_offset +void GLAPIENTRY glPolygonOffsetEXT(GLfloat factor, GLfloat bias) +{ + DISPATCH(PolygonOffsetEXT)(factor, bias); +} +#endif + + + +#ifdef _GLAPI_EXT_vertex_array + +void GLAPIENTRY glVertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr) +{ + (void) count; + DISPATCH(VertexPointer)(size, type, stride, ptr); +} + +void GLAPIENTRY glNormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr) +{ + (void) count; + DISPATCH(NormalPointer)(type, stride, ptr); +} + +void GLAPIENTRY glColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr) +{ + (void) count; + DISPATCH(ColorPointer)(size, type, stride, ptr); +} + +void GLAPIENTRY glIndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr) +{ + (void) count; + DISPATCH(IndexPointer)(type, stride, ptr); +} + +void GLAPIENTRY glTexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr) +{ + (void) count; + DISPATCH(ColorPointer)(size, type, stride, ptr); +} + +void GLAPIENTRY glEdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *ptr) +{ + (void) count; + DISPATCH(EdgeFlagPointer)(stride, ptr); +} + +void GLAPIENTRY glGetPointervEXT(GLenum pname, void **params) +{ + DISPATCH(GetPointerv)(pname, params); +} + +void GLAPIENTRY glArrayElementEXT(GLint i) +{ + DISPATCH(ArrayElement)(i); +} + +void GLAPIENTRY glDrawArraysEXT(GLenum mode, GLint first, GLsizei count) +{ + DISPATCH(DrawArrays)(mode, first, count); +} + +#endif /* GL_EXT_vertex_arrays */ + + + +#ifdef _GLAPI_EXT_texture_object + +void GLAPIENTRY glGenTexturesEXT(GLsizei n, GLuint *textures) +{ + DISPATCH(GenTextures)(n, textures); +} + +void GLAPIENTRY glDeleteTexturesEXT(GLsizei n, const GLuint *texture) +{ + DISPATCH(DeleteTextures)(n, texture); +} + +void GLAPIENTRY glBindTextureEXT(GLenum target, GLuint texture) +{ + DISPATCH(BindTexture)(target, texture); +} + +void GLAPIENTRY glPrioritizeTexturesEXT(GLsizei n, const GLuint *textures, const GLclampf *priorities) +{ + DISPATCH(PrioritizeTextures)(n, textures, priorities); +} + +GLboolean GLAPIENTRY glAreTexturesResidentEXT(GLsizei n, const GLuint *textures, GLboolean *residences) +{ + DISPATCH(AreTexturesResident)(n, textures, residences); + return GL_FALSE; +} + +GLboolean GLAPIENTRY glIsTextureEXT(GLuint texture) +{ + DISPATCH(IsTexture)(texture); + return GL_FALSE; +} +#endif /* GL_EXT_texture_object */ + + + +#ifdef _GLAPI_EXT_texture3D + +void GLAPIENTRY glTexImage3DEXT(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) +{ + DISPATCH(TexImage3D)(target, level, internalFormat, width, height, depth, border, format, type, pixels); +} + +void GLAPIENTRY glTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) +{ + DISPATCH(TexSubImage3D)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); +} + +void GLAPIENTRY glCopyTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) +{ + DISPATCH(CopyTexSubImage3D)(target, level, xoffset, yoffset, zoffset, x, y, width, height); +} + +#endif /* GL_EXT_texture3D*/ + + + +#ifdef _GLAPI_EXT_color_table + +void GLAPIENTRY glColorTableEXT(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table) +{ + DISPATCH(ColorTableEXT)(target, internalformat, width, format, type, table); +} + +void GLAPIENTRY glColorSubTableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data) +{ + DISPATCH(ColorSubTableEXT)(target, start, count, format, type, data); +} + +void GLAPIENTRY glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid *table) +{ + DISPATCH(GetColorTableEXT)(target, format, type, table); +} + +void GLAPIENTRY glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat *params) +{ + DISPATCH(GetColorTableParameterfvEXT)(target, pname, params); +} + +void GLAPIENTRY glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint *params) +{ + DISPATCH(GetColorTableParameterivEXT)(target, pname, params); +} + +#endif /* GL_EXT_color_table */ + + + +#ifdef _GLAPI_EXT_compiled_vertex_array + +void GLAPIENTRY glLockArraysEXT(GLint first, GLsizei count) +{ + DISPATCH(LockArraysEXT)(first, count); +} + +void GLAPIENTRY glUnlockArraysEXT(void) +{ + DISPATCH(UnlockArraysEXT)(); +} + +#endif /* GL_EXT_compiled_vertex_array */ + + + +#ifdef _GLAPI_EXT_point_parameters + +void GLAPIENTRY glPointParameterfEXT(GLenum target, GLfloat param) +{ + DISPATCH(PointParameterfEXT)(target, param); +} + +void GLAPIENTRY glPointParameterfvEXT(GLenum target, const GLfloat *param) +{ + DISPATCH(PointParameterfvEXT)(target, param); +} + +#endif /* GL_EXT_point_parameters */ + + + +#ifdef _GLAPI_ARB_multitexture + +void GLAPIENTRY glActiveTextureARB(GLenum texture) +{ + DISPATCH(ActiveTextureARB)(texture); +} + +void GLAPIENTRY glClientActiveTextureARB(GLenum texture) +{ + DISPATCH(ClientActiveTextureARB)(texture); +} + +void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s) +{ + DISPATCH(MultiTexCoord1dARB)(target, s); +} + +void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v) +{ + DISPATCH(MultiTexCoord1dvARB)(target, v); +} + +void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s) +{ + DISPATCH(MultiTexCoord1fARB)(target, s); +} + +void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v) +{ + DISPATCH(MultiTexCoord1fvARB)(target, v); +} + +void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s) +{ + DISPATCH(MultiTexCoord1iARB)(target, s); +} + +void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v) +{ + DISPATCH(MultiTexCoord1ivARB)(target, v); +} + +void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s) +{ + DISPATCH(MultiTexCoord1sARB)(target, s); +} + +void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v) +{ + DISPATCH(MultiTexCoord1svARB)(target, v); +} + +void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t) +{ + DISPATCH(MultiTexCoord2dARB)(target, s, t); +} + +void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v) +{ + DISPATCH(MultiTexCoord2dvARB)(target, v); +} + +void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t) +{ + DISPATCH(MultiTexCoord2fARB)(target, s, t); +} + +void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v) +{ + DISPATCH(MultiTexCoord2fvARB)(target, v); +} + +void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t) +{ + DISPATCH(MultiTexCoord2iARB)(target, s, t); +} + +void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v) +{ + DISPATCH(MultiTexCoord2ivARB)(target, v); +} + +void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t) +{ + DISPATCH(MultiTexCoord2sARB)(target, s, t); +} + +void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v) +{ + DISPATCH(MultiTexCoord2svARB)(target, v); +} + +void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r) +{ + DISPATCH(MultiTexCoord3dARB)(target, s, t, r); +} + +void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v) +{ + DISPATCH(MultiTexCoord3dvARB)(target, v); +} + +void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r) +{ + DISPATCH(MultiTexCoord3fARB)(target, s, t, r); +} + +void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v) +{ + DISPATCH(MultiTexCoord3fvARB)(target, v); +} + +void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r) +{ + DISPATCH(MultiTexCoord3iARB)(target, s, t, r); +} + +void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v) +{ + DISPATCH(MultiTexCoord3ivARB)(target, v); +} + +void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r) +{ + DISPATCH(MultiTexCoord3sARB)(target, s, t, r); +} + +void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v) +{ + DISPATCH(MultiTexCoord3svARB)(target, v); +} + +void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) +{ + DISPATCH(MultiTexCoord4dARB)(target, s, t, r, q); +} + +void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v) +{ + DISPATCH(MultiTexCoord4dvARB)(target, v); +} + +void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) +{ + DISPATCH(MultiTexCoord4fARB)(target, s, t, r, q); +} + +void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v) +{ + DISPATCH(MultiTexCoord4fvARB)(target, v); +} + +void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q) +{ + DISPATCH(MultiTexCoord4iARB)(target, s, t, r, q); +} + +void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v) +{ + DISPATCH(MultiTexCoord4ivARB)(target, v); +} + +void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) +{ + DISPATCH(MultiTexCoord4sARB)(target, s, t, r, q); +} + +void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v) +{ + DISPATCH(MultiTexCoord4svARB)(target, v); +} + +#endif /* GL_ARB_multitexture */ + + + +#ifdef _GLAPI_INGR_blend_func_separate +void GLAPIENTRY glBlendFuncSeparateINGR(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) +{ + DISPATCH(BlendFuncSeparateINGR)(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); +} +#endif /* GL_INGR_blend_func_separate */ + + + +#ifdef _GLAPI_MESA_window_pos + +void GLAPIENTRY glWindowPos2iMESA(GLint x, GLint y) +{ + DISPATCH(WindowPos4fMESA)(x, y, 0, 1); +} + +void GLAPIENTRY glWindowPos2sMESA(GLshort x, GLshort y) +{ + DISPATCH(WindowPos4fMESA)(x, y, 0, 1); +} + +void GLAPIENTRY glWindowPos2fMESA(GLfloat x, GLfloat y) +{ + DISPATCH(WindowPos4fMESA)(x, y, 0, 1); +} + +void GLAPIENTRY glWindowPos2dMESA(GLdouble x, GLdouble y) +{ + DISPATCH(WindowPos4fMESA)(x, y, 0, 1); +} + +void GLAPIENTRY glWindowPos2ivMESA(const GLint *p) +{ + DISPATCH(WindowPos4fMESA)(p[0], p[1], 0, 1); +} + +void GLAPIENTRY glWindowPos2svMESA(const GLshort *p) +{ + DISPATCH(WindowPos4fMESA)(p[0], p[1], 0, 1); +} + +void GLAPIENTRY glWindowPos2fvMESA(const GLfloat *p) +{ + DISPATCH(WindowPos4fMESA)(p[0], p[1], 0, 1); +} + +void GLAPIENTRY glWindowPos2dvMESA(const GLdouble *p) +{ + DISPATCH(WindowPos4fMESA)(p[0], p[1], 0, 1); +} + +void GLAPIENTRY glWindowPos3iMESA(GLint x, GLint y, GLint z) +{ + DISPATCH(WindowPos4fMESA)(x, y, z, 1); +} + +void GLAPIENTRY glWindowPos3sMESA(GLshort x, GLshort y, GLshort z) +{ + DISPATCH(WindowPos4fMESA)(x, y, z, 1); +} + +void GLAPIENTRY glWindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z) +{ + DISPATCH(WindowPos4fMESA)(x, y, z, 1); +} + +void GLAPIENTRY glWindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z) +{ + DISPATCH(WindowPos4fMESA)(x, y, z, 1); +} + +void GLAPIENTRY glWindowPos3ivMESA(const GLint *p) +{ + DISPATCH(WindowPos4fMESA)(p[0], p[1], p[2], 1.0); +} + +void GLAPIENTRY glWindowPos3svMESA(const GLshort *p) +{ + DISPATCH(WindowPos4fMESA)(p[0], p[1], p[2], 1.0); +} + +void GLAPIENTRY glWindowPos3fvMESA(const GLfloat *p) +{ + DISPATCH(WindowPos4fMESA)(p[0], p[1], p[2], 1.0); +} + +void GLAPIENTRY glWindowPos3dvMESA(const GLdouble *p) +{ + DISPATCH(WindowPos4fMESA)(p[0], p[1], p[2], 1.0); +} + +void GLAPIENTRY glWindowPos4iMESA(GLint x, GLint y, GLint z, GLint w) +{ + DISPATCH(WindowPos4fMESA)(x, y, z, w); +} + +void GLAPIENTRY glWindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w) +{ + DISPATCH(WindowPos4fMESA)(x, y, z, w); +} + +void GLAPIENTRY glWindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w) +{ + DISPATCH(WindowPos4fMESA)(x, y, z, w); +} + +void GLAPIENTRY glWindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w) +{ + DISPATCH(WindowPos4fMESA)(x, y, z, w); +} + +void GLAPIENTRY glWindowPos4ivMESA(const GLint *p) +{ + DISPATCH(WindowPos4fMESA)(p[0], p[1], p[2], p[3]); +} + +void GLAPIENTRY glWindowPos4svMESA(const GLshort *p) +{ + DISPATCH(WindowPos4fMESA)(p[0], p[1], p[2], p[3]); +} + +void GLAPIENTRY glWindowPos4fvMESA(const GLfloat *p) +{ + DISPATCH(WindowPos4fMESA)(p[0], p[1], p[2], p[3]); +} + +void GLAPIENTRY glWindowPos4dvMESA(const GLdouble *p) +{ + DISPATCH(WindowPos4fMESA)(p[0], p[1], p[2], p[3]); +} + +#endif /* GL_MESA_window_pos */ + + + +#ifdef _GLAPI_MESA_resize_buffers +GLAPI void GLAPIENTRY glResizeBuffersMESA(void) +{ + DISPATCH(ResizeBuffersMESA)(); +} +#endif /* GL_MESA_resize_buffers */ + + +#ifdef DEBUG +/* + * This struct is just used to be sure we've defined all the API functions. + */ +static struct _glapi_table completeness_test = { + glAccum, + glAlphaFunc, + glBegin, + glBitmap, + 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, + glCopyPixels, + glCullFace, + glDeleteLists, + glDepthFunc, + glDepthMask, + glDepthRange, + glDisable, + glDrawBuffer, + glDrawPixels, + glEdgeFlag, + glEdgeFlagv, + glEnable, + glEnd, + glEndList, + glEvalCoord1d, + glEvalCoord1dv, + glEvalCoord1f, + glEvalCoord1fv, + glEvalCoord2d, + glEvalCoord2dv, + glEvalCoord2f, + glEvalCoord2fv, + glEvalMesh1, + glEvalMesh2, + glEvalPoint1, + glEvalPoint2, + glFeedbackBuffer, + glFinish, + glFlush, + glFogf, + glFogfv, + glFogi, + glFogiv, + glFrontFace, + glFrustum, + glGenLists, + glGetBooleanv, + glGetClipPlane, + glGetDoublev, + glGetError, + glGetFloatv, + glGetIntegerv, + glGetLightfv, + glGetLightiv, + glGetMapdv, + glGetMapfv, + glGetMapiv, + glGetMaterialfv, + glGetMaterialiv, + glGetPixelMapfv, + glGetPixelMapuiv, + glGetPixelMapusv, + glGetPolygonStipple, + glGetString, + glGetTexEnvfv, + glGetTexEnviv, + glGetTexGendv, + glGetTexGenfv, + glGetTexGeniv, + glGetTexImage, + glGetTexLevelParameterfv, + glGetTexLevelParameteriv, + glGetTexParameterfv, + glGetTexParameteriv, + glHint, + glIndexMask, + glIndexd, + glIndexdv, + glIndexf, + glIndexfv, + glIndexi, + glIndexiv, + glIndexs, + glIndexsv, + glInitNames, + glIsEnabled, + glIsList, + glLightModelf, + glLightModelfv, + glLightModeli, + glLightModeliv, + glLightf, + glLightfv, + glLighti, + glLightiv, + 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, + glOrtho, + glPassThrough, + glPixelMapfv, + glPixelMapuiv, + glPixelMapusv, + glPixelStoref, + glPixelStorei, + glPixelTransferf, + glPixelTransferi, + glPixelZoom, + glPointSize, + glPolygonMode, + glPolygonOffset, + glPolygonStipple, + glPopAttrib, + glPopMatrix, + glPopName, + glPushAttrib, + 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, + 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, + glTexEnvf, + glTexEnvfv, + glTexEnvi, + glTexEnviv, + glTexGend, + glTexGendv, + glTexGenf, + glTexGenfv, + glTexGeni, + glTexGeniv, + glTexImage1D, + glTexImage2D, + glTexParameterf, + glTexParameterfv, + glTexParameteri, + glTexParameteriv, + 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, + glViewport, + +#ifdef _GLAPI_VERSION_1_1 + glAreTexturesResident, + glArrayElement, + glBindTexture, + glColorPointer, + glCopyTexImage1D, + glCopyTexImage2D, + glCopyTexSubImage1D, + glCopyTexSubImage2D, + glDeleteTextures, + glDisableClientState, + glDrawArrays, + glDrawElements, + glEdgeFlagPointer, + glEnableClientState, + glGenTextures, + glGetPointerv, + glIndexPointer, + glIndexub, + glIndexubv, + glInterleavedArrays, + glIsTexture, + glNormalPointer, + glPopClientAttrib, + glPrioritizeTextures, + glPushClientAttrib, + glTexCoordPointer, + glTexSubImage1D, + glTexSubImage2D, + glVertexPointer, +#endif + +#ifdef _GLAPI_VERSION_1_2 + glCopyTexSubImage3D, + glDrawRangeElements, + glTexImage3D, + glTexSubImage3D, + +#ifdef _GLAPI_ARB_imaging + glBlendColor, + glBlendEquation, + glColorSubTable, + glColorTable, + glColorTableParameterfv, + glColorTableParameteriv, + glConvolutionFilter1D, + glConvolutionFilter2D, + glConvolutionParameterf, + glConvolutionParameterfv, + glConvolutionParameteri, + glConvolutionParameteriv, + glCopyColorSubTable, + glCopyColorTable, + glCopyConvolutionFilter1D, + glCopyConvolutionFilter2D, + glGetColorTable, + glGetColorTableParameterfv, + glGetColorTableParameteriv, + glGetConvolutionFilter, + glGetConvolutionParameterfv, + glGetConvolutionParameteriv, + glGetHistogram, + glGetHistogramParameterfv, + glGetHistogramParameteriv, + glGetMinmax, + glGetMinmaxParameterfv, + glGetMinmaxParameteriv, + glGetSeparableFilter, + glHistogram, + glMinmax, + glResetHistogram, + glResetMinmax, + glSeparableFilter2D, +#endif +#endif + + + /* + * Extensions + */ + +#ifdef _GLAPI_EXT_color_table + glColorTableEXT, + glColorSubTableEXT, + glGetColorTableEXT, + glGetColorTableParameterfvEXT, + glGetColorTableParameterivEXT, +#endif + +#ifdef _GLAPI_EXT_compiled_vertex_array + glLockArraysEXT, + glUnlockArraysEXT, +#endif + +#ifdef _GLAPI_EXT_point_parameters + glPointParameterfEXT, + glPointParameterfvEXT, +#endif + +#ifdef _GLAPI_EXT_polygon_offset + glPolygonOffsetEXT, +#endif + +#ifdef _GLAPI_EXT_blend_minmax + glBlendEquationEXT, +#endif + +#ifdef _GLAPI_EXT_blend_color + glBlendColorEXT, +#endif + +#ifdef _GLAPI_ARB_multitexture + 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, +#endif + +#ifdef _GLAPI_INGR_blend_func_separate + glBlendFuncSeparateINGR, +#endif + +#ifdef _GLAPI_MESA_window_pos + glWindowPos4fMESA, +#endif + +#ifdef _GLAPI_MESA_resize_buffers + glResizeBuffersMESA +#endif + +}; + +#endif /*DEBUG*/ + + + + + + + +/* + * Set the global or per-thread dispatch table pointer. + */ +void +_glapi_set_dispatch(struct _glapi_table *dispatch) +{ +#ifdef DEBUG + (void) completeness_test; /* to silence compiler warnings */ +#endif + + if (dispatch) { +#ifdef DEBUG + _glapi_check_table(dispatch); +#endif +#if defined(MULTI_THREAD) + /* set this thread's dispatch pointer */ + /* XXX To Do */ +#else + Dispatch = dispatch; +#endif + } + else { + /* no current context, each function is a no-op */ + Dispatch = &__glapi_noop_table; + } +} + + +/* + * Get the global or per-thread dispatch table pointer. + */ +struct _glapi_table * +_glapi_get_dispatch(void) +{ +#if defined(MULTI_THREAD) + /* return this thread's dispatch pointer */ + return NULL; +#else + return Dispatch; +#endif +} + + +/* + * Get API dispatcher version string. + */ +const char * +_glapi_get_version(void) +{ + return "1.2"; /* XXX this isn't well defined yet */ +} + + +/* + * Return list of hard-coded extension entrypoints in the dispatch table. + */ +const char * +_glapi_get_extensions(void) +{ + return "GL_EXT_color_table GL_EXT_compiled_vertex_array GL_EXT_point_parameters GL_EXT_polygon_offset GL_EXT_blend_minmax GL_EXT_blend_color GL_ARB_multitexture GL_INGR_blend_func_separate GL_MESA_window_pos GL_MESA_resize_buffers"; +} + + + +/* + * Dynamically allocate an extension entry point. Return a slot number. + */ +GLint +_glapi_alloc_entrypoint(const char *funcName) +{ + return -1; +} + + + +/* + * Find the dynamic entry point for the named function. + */ +GLint +_glapi_get_entrypoint(const char *funcName) +{ + return -1; +} + + +/* + * Return entrypoint for named function. + */ +const GLvoid * +_glapi_get_proc_address(const char *funcName) +{ + return NULL; +} + + + +/* + * Make sure there are no NULL pointers in the given dispatch table. + * Intented for debugging purposes. + */ +void +_glapi_check_table(const struct _glapi_table *table) +{ + assert(table->Accum); + assert(table->AlphaFunc); + assert(table->Begin); + assert(table->Bitmap); + assert(table->BlendFunc); + assert(table->CallList); + assert(table->CallLists); + assert(table->Clear); + assert(table->ClearAccum); + assert(table->ClearColor); + assert(table->ClearDepth); + assert(table->ClearIndex); + assert(table->ClearStencil); + assert(table->ClipPlane); + assert(table->Color3b); + assert(table->Color3bv); + assert(table->Color3d); + assert(table->Color3dv); + assert(table->Color3f); + assert(table->Color3fv); + assert(table->Color3i); + assert(table->Color3iv); + assert(table->Color3s); + assert(table->Color3sv); + assert(table->Color3ub); + assert(table->Color3ubv); + assert(table->Color3ui); + assert(table->Color3uiv); + assert(table->Color3us); + assert(table->Color3usv); + assert(table->Color4b); + assert(table->Color4bv); + assert(table->Color4d); + assert(table->Color4dv); + assert(table->Color4f); + assert(table->Color4fv); + assert(table->Color4i); + assert(table->Color4iv); + assert(table->Color4s); + assert(table->Color4sv); + assert(table->Color4ub); + assert(table->Color4ubv); + assert(table->Color4ui); + assert(table->Color4uiv); + assert(table->Color4us); + assert(table->Color4usv); + assert(table->ColorMask); + assert(table->ColorMaterial); + assert(table->CopyPixels); + assert(table->CullFace); + assert(table->DeleteLists); + assert(table->DepthFunc); + assert(table->DepthMask); + assert(table->DepthRange); + assert(table->Disable); + assert(table->DrawBuffer); + assert(table->DrawElements); + assert(table->DrawPixels); + assert(table->EdgeFlag); + assert(table->EdgeFlagv); + assert(table->Enable); + assert(table->End); + assert(table->EndList); + assert(table->EvalCoord1d); + assert(table->EvalCoord1dv); + assert(table->EvalCoord1f); + assert(table->EvalCoord1fv); + assert(table->EvalCoord2d); + assert(table->EvalCoord2dv); + assert(table->EvalCoord2f); + assert(table->EvalCoord2fv); + assert(table->EvalMesh1); + assert(table->EvalMesh2); + assert(table->EvalPoint1); + assert(table->EvalPoint2); + assert(table->FeedbackBuffer); + assert(table->Finish); + assert(table->Flush); + assert(table->Fogf); + assert(table->Fogfv); + assert(table->Fogi); + assert(table->Fogiv); + assert(table->FrontFace); + assert(table->Frustum); + assert(table->GenLists); + assert(table->GetBooleanv); + assert(table->GetClipPlane); + assert(table->GetDoublev); + assert(table->GetError); + assert(table->GetFloatv); + assert(table->GetIntegerv); + assert(table->GetLightfv); + assert(table->GetLightiv); + assert(table->GetMapdv); + assert(table->GetMapfv); + assert(table->GetMapiv); + assert(table->GetMaterialfv); + assert(table->GetMaterialiv); + assert(table->GetPixelMapfv); + assert(table->GetPixelMapuiv); + assert(table->GetPixelMapusv); + assert(table->GetPolygonStipple); + assert(table->GetString); + assert(table->GetTexEnvfv); + assert(table->GetTexEnviv); + assert(table->GetTexGendv); + assert(table->GetTexGenfv); + assert(table->GetTexGeniv); + assert(table->GetTexImage); + assert(table->GetTexLevelParameterfv); + assert(table->GetTexLevelParameteriv); + assert(table->GetTexParameterfv); + assert(table->GetTexParameteriv); + assert(table->Hint); + assert(table->IndexMask); + assert(table->Indexd); + assert(table->Indexdv); + assert(table->Indexf); + assert(table->Indexfv); + assert(table->Indexi); + assert(table->Indexiv); + assert(table->Indexs); + assert(table->Indexsv); + assert(table->InitNames); + assert(table->IsEnabled); + assert(table->IsList); + assert(table->LightModelf); + assert(table->LightModelfv); + assert(table->LightModeli); + assert(table->LightModeliv); + assert(table->Lightf); + assert(table->Lightfv); + assert(table->Lighti); + assert(table->Lightiv); + assert(table->LineStipple); + assert(table->LineWidth); + assert(table->ListBase); + assert(table->LoadIdentity); + assert(table->LoadMatrixd); + assert(table->LoadMatrixf); + assert(table->LoadName); + assert(table->LogicOp); + assert(table->Map1d); + assert(table->Map1f); + assert(table->Map2d); + assert(table->Map2f); + assert(table->MapGrid1d); + assert(table->MapGrid1f); + assert(table->MapGrid2d); + assert(table->MapGrid2f); + assert(table->Materialf); + assert(table->Materialfv); + assert(table->Materiali); + assert(table->Materialiv); + assert(table->MatrixMode); + assert(table->MultMatrixd); + assert(table->MultMatrixf); + assert(table->NewList); + assert(table->Normal3b); + assert(table->Normal3bv); + assert(table->Normal3d); + assert(table->Normal3dv); + assert(table->Normal3f); + assert(table->Normal3fv); + assert(table->Normal3i); + assert(table->Normal3iv); + assert(table->Normal3s); + assert(table->Normal3sv); + assert(table->Ortho); + assert(table->PassThrough); + assert(table->PixelMapfv); + assert(table->PixelMapuiv); + assert(table->PixelMapusv); + assert(table->PixelStoref); + assert(table->PixelStorei); + assert(table->PixelTransferf); + assert(table->PixelTransferi); + assert(table->PixelZoom); + assert(table->PointSize); + assert(table->PolygonMode); + assert(table->PolygonOffset); + assert(table->PolygonStipple); + assert(table->PopAttrib); + assert(table->PopMatrix); + assert(table->PopName); + assert(table->PushAttrib); + assert(table->PushMatrix); + assert(table->PushName); + assert(table->RasterPos2d); + assert(table->RasterPos2dv); + assert(table->RasterPos2f); + assert(table->RasterPos2fv); + assert(table->RasterPos2i); + assert(table->RasterPos2iv); + assert(table->RasterPos2s); + assert(table->RasterPos2sv); + assert(table->RasterPos3d); + assert(table->RasterPos3dv); + assert(table->RasterPos3f); + assert(table->RasterPos3fv); + assert(table->RasterPos3i); + assert(table->RasterPos3iv); + assert(table->RasterPos3s); + assert(table->RasterPos3sv); + assert(table->RasterPos4d); + assert(table->RasterPos4dv); + assert(table->RasterPos4f); + assert(table->RasterPos4fv); + assert(table->RasterPos4i); + assert(table->RasterPos4iv); + assert(table->RasterPos4s); + assert(table->RasterPos4sv); + assert(table->ReadBuffer); + assert(table->ReadPixels); + assert(table->Rectd); + assert(table->Rectdv); + assert(table->Rectf); + assert(table->Rectfv); + assert(table->Recti); + assert(table->Rectiv); + assert(table->Rects); + assert(table->Rectsv); + assert(table->RenderMode); + assert(table->Rotated); + assert(table->Rotatef); + assert(table->Scaled); + assert(table->Scalef); + assert(table->Scissor); + assert(table->SelectBuffer); + assert(table->ShadeModel); + assert(table->StencilFunc); + assert(table->StencilMask); + assert(table->StencilOp); + assert(table->TexCoord1d); + assert(table->TexCoord1dv); + assert(table->TexCoord1f); + assert(table->TexCoord1fv); + assert(table->TexCoord1i); + assert(table->TexCoord1iv); + assert(table->TexCoord1s); + assert(table->TexCoord1sv); + assert(table->TexCoord2d); + assert(table->TexCoord2dv); + assert(table->TexCoord2f); + assert(table->TexCoord2fv); + assert(table->TexCoord2i); + assert(table->TexCoord2iv); + assert(table->TexCoord2s); + assert(table->TexCoord2sv); + assert(table->TexCoord3d); + assert(table->TexCoord3dv); + assert(table->TexCoord3f); + assert(table->TexCoord3fv); + assert(table->TexCoord3i); + assert(table->TexCoord3iv); + assert(table->TexCoord3s); + assert(table->TexCoord3sv); + assert(table->TexCoord4d); + assert(table->TexCoord4dv); + assert(table->TexCoord4f); + assert(table->TexCoord4fv); + assert(table->TexCoord4i); + assert(table->TexCoord4iv); + assert(table->TexCoord4s); + assert(table->TexCoord4sv); + assert(table->TexEnvf); + assert(table->TexEnvfv); + assert(table->TexEnvi); + assert(table->TexEnviv); + assert(table->TexGend); + assert(table->TexGendv); + assert(table->TexGenf); + assert(table->TexGenfv); + assert(table->TexGeni); + assert(table->TexGeniv); + assert(table->TexImage1D); + assert(table->TexImage2D); + assert(table->TexParameterf); + assert(table->TexParameterfv); + assert(table->TexParameteri); + assert(table->TexParameteriv); + assert(table->Translated); + assert(table->Translatef); + assert(table->Vertex2d); + assert(table->Vertex2dv); + assert(table->Vertex2f); + assert(table->Vertex2fv); + assert(table->Vertex2i); + assert(table->Vertex2iv); + assert(table->Vertex2s); + assert(table->Vertex2sv); + assert(table->Vertex3d); + assert(table->Vertex3dv); + assert(table->Vertex3f); + assert(table->Vertex3fv); + assert(table->Vertex3i); + assert(table->Vertex3iv); + assert(table->Vertex3s); + assert(table->Vertex3sv); + assert(table->Vertex4d); + assert(table->Vertex4dv); + assert(table->Vertex4f); + assert(table->Vertex4fv); + assert(table->Vertex4i); + assert(table->Vertex4iv); + assert(table->Vertex4s); + assert(table->Vertex4sv); + assert(table->Viewport); + +#ifdef _GLAPI_VERSION_1_1 + assert(table->AreTexturesResident); + assert(table->ArrayElement); + assert(table->BindTexture); + assert(table->ColorPointer); + assert(table->CopyTexImage1D); + assert(table->CopyTexImage2D); + assert(table->CopyTexSubImage1D); + assert(table->CopyTexSubImage2D); + assert(table->DeleteTextures); + assert(table->DisableClientState); + assert(table->DrawArrays); + assert(table->EdgeFlagPointer); + assert(table->EnableClientState); + assert(table->GenTextures); + assert(table->GetPointerv); + assert(table->IndexPointer); + assert(table->Indexub); + assert(table->Indexubv); + assert(table->InterleavedArrays); + assert(table->IsTexture); + assert(table->NormalPointer); + assert(table->PopClientAttrib); + assert(table->PrioritizeTextures); + assert(table->PushClientAttrib); + assert(table->TexCoordPointer); + assert(table->TexSubImage1D); + assert(table->TexSubImage2D); + assert(table->VertexPointer); +#endif + +#ifdef _GLAPI_VERSION_1_2 + assert(table->CopyTexSubImage3D); + assert(table->DrawRangeElements); + assert(table->TexImage3D); + assert(table->TexSubImage3D); +#ifdef _GLAPI_ARB_imaging + assert(table->BlendColor); + assert(table->BlendEquation); + assert(table->ColorSubTable); + assert(table->ColorTable); + assert(table->ColorTableParameterfv); + assert(table->ColorTableParameteriv); + assert(table->ConvolutionFilter1D); + assert(table->ConvolutionFilter2D); + assert(table->ConvolutionParameterf); + assert(table->ConvolutionParameterfv); + assert(table->ConvolutionParameteri); + assert(table->ConvolutionParameteriv); + assert(table->CopyColorSubTable); + assert(table->CopyColorTable); + assert(table->CopyConvolutionFilter1D); + assert(table->CopyConvolutionFilter2D); + assert(table->GetColorTable); + assert(table->GetColorTableParameterfv); + assert(table->GetColorTableParameteriv); + assert(table->GetConvolutionFilter); + assert(table->GetConvolutionParameterfv); + assert(table->GetConvolutionParameteriv); + assert(table->GetHistogram); + assert(table->GetHistogramParameterfv); + assert(table->GetHistogramParameteriv); + assert(table->GetMinmax); + assert(table->GetMinmaxParameterfv); + assert(table->GetMinmaxParameteriv); + assert(table->Histogram); + assert(table->Minmax); + assert(table->ResetHistogram); + assert(table->ResetMinmax); + assert(table->SeparableFilter2D); +#endif +#endif + + +#ifdef _GLAPI_EXT_color_table + assert(table->ColorTableEXT); + assert(table->ColorSubTableEXT); + assert(table->GetColorTableEXT); + assert(table->GetColorTableParameterfvEXT); + assert(table->GetColorTableParameterivEXT); +#endif + +#ifdef _GLAPI_EXT_compiled_vertex_array + assert(table->LockArraysEXT); + assert(table->UnlockArraysEXT); +#endif + +#ifdef _GLAPI_EXT_point_parameter + assert(table->PointParameterfEXT); + assert(table->PointParameterfvEXT); +#endif + +#ifdef _GLAPI_EXT_polygon_offset + assert(table->PolygonOffsetEXT); +#endif + +#ifdef _GLAPI_ARB_multitexture + assert(table->ActiveTextureARB); + assert(table->ClientActiveTextureARB); + assert(table->MultiTexCoord1dARB); + assert(table->MultiTexCoord1dvARB); + assert(table->MultiTexCoord1fARB); + assert(table->MultiTexCoord1fvARB); + assert(table->MultiTexCoord1iARB); + assert(table->MultiTexCoord1ivARB); + assert(table->MultiTexCoord1sARB); + assert(table->MultiTexCoord1svARB); + assert(table->MultiTexCoord2dARB); + assert(table->MultiTexCoord2dvARB); + assert(table->MultiTexCoord2fARB); + assert(table->MultiTexCoord2fvARB); + assert(table->MultiTexCoord2iARB); + assert(table->MultiTexCoord2ivARB); + assert(table->MultiTexCoord2sARB); + assert(table->MultiTexCoord2svARB); + assert(table->MultiTexCoord3dARB); + assert(table->MultiTexCoord3dvARB); + assert(table->MultiTexCoord3fARB); + assert(table->MultiTexCoord3fvARB); + assert(table->MultiTexCoord3iARB); + assert(table->MultiTexCoord3ivARB); + assert(table->MultiTexCoord3sARB); + assert(table->MultiTexCoord3svARB); + assert(table->MultiTexCoord4dARB); + assert(table->MultiTexCoord4dvARB); + assert(table->MultiTexCoord4fARB); + assert(table->MultiTexCoord4fvARB); + assert(table->MultiTexCoord4iARB); + assert(table->MultiTexCoord4ivARB); + assert(table->MultiTexCoord4sARB); + assert(table->MultiTexCoord4svARB); +#endif + +#ifdef _GLAPI_INGR_blend_func_separate + assert(table->BlendFuncSeparateINGR); +#endif + +#ifdef _GLAPI_MESA_window_pos + assert(table->WindowPos4fMESA); +#endif + +#ifdef _GLAPI_MESA_resize_buffers + assert(table->ResizeBuffersMESA); +#endif +} + diff --git a/src/mesa/glapi/glapi.h b/src/mesa/glapi/glapi.h new file mode 100644 index 00000000000..72d92e917b4 --- /dev/null +++ b/src/mesa/glapi/glapi.h @@ -0,0 +1,591 @@ +/* $Id: glapi.h,v 1.1 1999/11/11 01:22:26 brianp 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. + */ + + +/* + * This file is not specific to Mesa. It defines a dispatch table + * which could be used by any number of OpenGL implementations. + * It's designed to be gl.h-independent as well. That is, it does + * not depend on any particular extensions being defined in the gl.h + * header. We #define extension symbols (like _GLAPI_EXT_blend_color) + * to determine which entry points to compile. Clients of this dispatcher + * (like Mesa) can #ifdef test these symbols to know how to fill in the + * table. + */ + + +#ifndef _GLAPI_H +#define _GLAPI_H + + +#include "GL/gl.h" + + +/* Which OpenGL API revisisions are supported by the table: */ +#define _GLAPI_VERSION_1_1 1 +#define _GLAPI_VERSION_1_2 1 + +/* And which extensions: */ +#define _GLAPI_ARB_imaging 1 +#define _GLAPI_ARB_multitexture 1 +#define _GLAPI_EXT_color_table 1 +#define _GLAPI_EXT_compiled_vertex_array 1 +#define _GLAPI_EXT_point_parameters 1 +#define _GLAPI_EXT_polygon_offset 1 +#define _GLAPI_EXT_blend_minmax 1 +#define _GLAPI_EXT_blend_color 1 +#define _GLAPI_EXT_texture3D 1 +#define _GLAPI_EXT_texture_object 1 +#define _GLAPI_EXT_vertex_array 1 +#define _GLAPI_INGR_blend_func_separate 1 +#define _GLAPI_MESA_window_pos 1 +#define _GLAPI_MESA_resize_buffers 1 + + + + +/* + * This struct contains pointers for all the GL API entrypoints + * plus some reserved slots for dynamic extensions. + * + */ +struct _glapi_table +{ + /* + * OpenGL 1.0 + */ + void (*Accum)(GLenum, GLfloat); + void (*AlphaFunc)(GLenum, GLclampf); + void (*Begin)(GLenum); + void (*Bitmap)(GLsizei, GLsizei, GLfloat, GLfloat, GLfloat, GLfloat, const GLubyte *); + void (*BlendFunc)(GLenum, GLenum); + void (*CallList)(GLuint list); + void (*CallLists)(GLsizei, GLenum, const GLvoid *); + void (*Clear)(GLbitfield); + void (*ClearAccum)(GLfloat, GLfloat, GLfloat, GLfloat); + void (*ClearColor)(GLclampf, GLclampf, GLclampf, GLclampf); + void (*ClearDepth)(GLclampd); + void (*ClearIndex)(GLfloat); + void (*ClearStencil)(GLint); + void (*ClipPlane)(GLenum, const GLdouble *); + void (*Color3b)(GLbyte, GLbyte, GLbyte); + void (*Color3bv)(const GLbyte *); + void (*Color3d)(GLdouble, GLdouble, GLdouble); + void (*Color3dv)(const GLdouble *); + void (*Color3f)(GLfloat, GLfloat, GLfloat); + void (*Color3fv)(const GLfloat *); + void (*Color3i)(GLint, GLint, GLint); + void (*Color3iv)(const GLint *); + void (*Color3s)(GLshort, GLshort, GLshort); + void (*Color3sv)(const GLshort *); + void (*Color3ub)(GLubyte, GLubyte, GLubyte); + void (*Color3ubv)(const GLubyte *); + void (*Color3ui)(GLuint, GLuint, GLuint); + void (*Color3uiv)(const GLuint *); + void (*Color3us)(GLushort, GLushort, GLushort); + void (*Color3usv)(const GLushort *); + void (*Color4b)(GLbyte, GLbyte, GLbyte, GLbyte); + void (*Color4bv)(const GLbyte *); + void (*Color4d)(GLdouble, GLdouble, GLdouble, GLdouble); + void (*Color4dv)(const GLdouble *); + void (*Color4f)(GLfloat, GLfloat, GLfloat, GLfloat); + void (*Color4fv)(const GLfloat *); + void (*Color4i)(GLint, GLint, GLint, GLint); + void (*Color4iv)(const GLint *); + void (*Color4s)(GLshort, GLshort, GLshort, GLshort); + void (*Color4sv)(const GLshort *); + void (*Color4ub)(GLubyte, GLubyte, GLubyte, GLubyte); + void (*Color4ubv)(const GLubyte *); + void (*Color4ui)(GLuint, GLuint, GLuint, GLuint); + void (*Color4uiv)(const GLuint *); + void (*Color4us)(GLushort, GLushort, GLushort, GLushort); + void (*Color4usv)(const GLushort *); + void (*ColorMask)(GLboolean, GLboolean, GLboolean, GLboolean); + void (*ColorMaterial)(GLenum, GLenum); + void (*CopyPixels)(GLint, GLint, GLsizei, GLsizei, GLenum); + void (*CullFace)(GLenum); + void (*DeleteLists)(GLuint, GLsizei); + void (*DepthFunc)(GLenum); + void (*DepthMask)(GLboolean); + void (*DepthRange)(GLclampd, GLclampd); + void (*Disable)(GLenum); + void (*DrawBuffer)(GLenum); + void (*DrawPixels)(GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); + void (*EdgeFlag)(GLboolean); + void (*EdgeFlagv)(const GLboolean *); + void (*Enable)(GLenum); + void (*End)(void); + void (*EndList)(void); + void (*EvalCoord1d)(GLdouble); + void (*EvalCoord1dv)(const GLdouble *); + void (*EvalCoord1f)(GLfloat); + void (*EvalCoord1fv)(const GLfloat *); + void (*EvalCoord2d)(GLdouble u, GLdouble); + void (*EvalCoord2dv)(const GLdouble *); + void (*EvalCoord2f)(GLfloat u, GLfloat); + void (*EvalCoord2fv)(const GLfloat *); + void (*EvalMesh1)(GLenum, GLint, GLint); + void (*EvalMesh2)(GLenum, GLint, GLint, GLint, GLint); + void (*EvalPoint1)(GLint); + void (*EvalPoint2)(GLint, GLint); + void (*FeedbackBuffer)(GLsizei, GLenum, GLfloat *); + void (*Finish)(void); + void (*Flush)(void); + void (*Fogf)(GLenum, GLfloat); + void (*Fogfv)(GLenum, const GLfloat *); + void (*Fogi)(GLenum, GLint); + void (*Fogiv)(GLenum, const GLint *); + void (*FrontFace)(GLenum); + void (*Frustum)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); + GLuint (*GenLists)(GLsizei); + void (*GetBooleanv)(GLenum, GLboolean *); + void (*GetClipPlane)(GLenum, GLdouble *); + void (*GetDoublev)(GLenum, GLdouble *); + GLenum (*GetError)(void); + void (*GetFloatv)(GLenum, GLfloat *); + void (*GetIntegerv)(GLenum, GLint *); + void (*GetLightfv)(GLenum light, GLenum, GLfloat *); + void (*GetLightiv)(GLenum light, GLenum, GLint *); + void (*GetMapdv)(GLenum, GLenum, GLdouble *); + void (*GetMapfv)(GLenum, GLenum, GLfloat *); + void (*GetMapiv)(GLenum, GLenum, GLint *); + void (*GetMaterialfv)(GLenum, GLenum, GLfloat *); + void (*GetMaterialiv)(GLenum, GLenum, GLint *); + void (*GetPixelMapfv)(GLenum, GLfloat *); + void (*GetPixelMapuiv)(GLenum, GLuint *); + void (*GetPixelMapusv)(GLenum, GLushort *); + void (*GetPolygonStipple)(GLubyte *); + const GLubyte* (*GetString)(GLenum name); + void (*GetTexEnvfv)(GLenum, GLenum, GLfloat *); + void (*GetTexEnviv)(GLenum, GLenum, GLint *); + void (*GetTexGendv)(GLenum coord, GLenum, GLdouble *); + void (*GetTexGenfv)(GLenum coord, GLenum, GLfloat *); + void (*GetTexGeniv)(GLenum coord, GLenum, GLint *); + void (*GetTexImage)(GLenum, GLint level, GLenum, GLenum, GLvoid *); + void (*GetTexLevelParameterfv)(GLenum, GLint, GLenum, GLfloat *); + void (*GetTexLevelParameteriv)(GLenum, GLint, GLenum, GLint *); + void (*GetTexParameterfv)(GLenum, GLenum, GLfloat *); + void (*GetTexParameteriv)(GLenum, GLenum, GLint *); + void (*Hint)(GLenum, GLenum); + void (*IndexMask)(GLuint); + void (*Indexd)(GLdouble); + void (*Indexdv)(const GLdouble *); + void (*Indexf)(GLfloat); + void (*Indexfv)(const GLfloat *); + void (*Indexi)(GLint); + void (*Indexiv)(const GLint *); + void (*Indexs)(GLshort); + void (*Indexsv)(const GLshort *); + void (*InitNames)(void); + GLboolean (*IsEnabled)(GLenum); + GLboolean (*IsList)(GLuint); + void (*LightModelf)(GLenum, GLfloat); + void (*LightModelfv)(GLenum, const GLfloat *); + void (*LightModeli)(GLenum, GLint); + void (*LightModeliv)(GLenum, const GLint *); + void (*Lightf)(GLenum light, GLenum, GLfloat); + void (*Lightfv)(GLenum light, GLenum, const GLfloat *); + void (*Lighti)(GLenum light, GLenum, GLint); + void (*Lightiv)(GLenum light, GLenum, const GLint *); + void (*LineStipple)(GLint factor, GLushort); + void (*LineWidth)(GLfloat); + void (*ListBase)(GLuint); + void (*LoadIdentity)(void); + void (*LoadMatrixd)(const GLdouble *); + void (*LoadMatrixf)(const GLfloat *); + void (*LoadName)(GLuint); + void (*LogicOp)(GLenum); + void (*Map1d)(GLenum, GLdouble, GLdouble, GLint, GLint, const GLdouble *); + void (*Map1f)(GLenum, GLfloat, GLfloat, GLint, GLint, const GLfloat *); + void (*Map2d)(GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); + void (*Map2f)(GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); + void (*MapGrid1d)(GLint, GLdouble, GLdouble); + void (*MapGrid1f)(GLint, GLfloat, GLfloat); + void (*MapGrid2d)(GLint, GLdouble, GLdouble, GLint, GLdouble, GLdouble); + void (*MapGrid2f)(GLint, GLfloat, GLfloat, GLint, GLfloat, GLfloat); + void (*Materialf)(GLenum, GLenum, GLfloat); + void (*Materialfv)(GLenum, GLenum, const GLfloat *); + void (*Materiali)(GLenum, GLenum, GLint); + void (*Materialiv)(GLenum, GLenum, const GLint *); + void (*MatrixMode)(GLenum); + void (*MultMatrixd)(const GLdouble *); + void (*MultMatrixf)(const GLfloat *); + void (*NewList)(GLuint list, GLenum); + void (*Normal3b)(GLbyte, GLbyte, GLbyte); + void (*Normal3bv)(const GLbyte *); + void (*Normal3d)(GLdouble, GLdouble, GLdouble); + void (*Normal3dv)(const GLdouble *); + void (*Normal3f)(GLfloat, GLfloat, GLfloat); + void (*Normal3fv)(const GLfloat *); + void (*Normal3i)(GLint, GLint, GLint); + void (*Normal3iv)(const GLint *); + void (*Normal3s)(GLshort, GLshort, GLshort); + void (*Normal3sv)(const GLshort *); + void (*Ortho)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); + void (*PassThrough)(GLfloat); + void (*PixelMapfv)(GLenum, GLint, const GLfloat *); + void (*PixelMapuiv)(GLenum, GLint, const GLuint *); + void (*PixelMapusv)(GLenum, GLint, const GLushort *); + void (*PixelStoref)(GLenum, GLfloat); + void (*PixelStorei)(GLenum, GLint); + void (*PixelTransferf)(GLenum, GLfloat); + void (*PixelTransferi)(GLenum, GLint); + void (*PixelZoom)(GLfloat, GLfloat); + void (*PointSize)(GLfloat); + void (*PolygonMode)(GLenum, GLenum); + void (*PolygonOffset)(GLfloat, GLfloat); + void (*PolygonStipple)(const GLubyte *); + void (*PopAttrib)(void); + void (*PopMatrix)(void); + void (*PopName)(void); + void (*PushAttrib)(GLbitfield); + void (*PushMatrix)(void); + void (*PushName)(GLuint); + void (*RasterPos2d)(GLdouble, GLdouble); + void (*RasterPos2dv)(const GLdouble *); + void (*RasterPos2f)(GLfloat, GLfloat); + void (*RasterPos2fv)(const GLfloat *); + void (*RasterPos2i)(GLint, GLint); + void (*RasterPos2iv)(const GLint *); + void (*RasterPos2s)(GLshort, GLshort); + void (*RasterPos2sv)(const GLshort *); + void (*RasterPos3d)(GLdouble, GLdouble, GLdouble); + void (*RasterPos3dv)(const GLdouble *); + void (*RasterPos3f)(GLfloat, GLfloat, GLfloat); + void (*RasterPos3fv)(const GLfloat *); + void (*RasterPos3i)(GLint, GLint, GLint); + void (*RasterPos3iv)(const GLint *); + void (*RasterPos3s)(GLshort, GLshort, GLshort); + void (*RasterPos3sv)(const GLshort *); + void (*RasterPos4d)(GLdouble, GLdouble, GLdouble, GLdouble); + void (*RasterPos4dv)(const GLdouble *); + void (*RasterPos4f)(GLfloat, GLfloat, GLfloat, GLfloat); + void (*RasterPos4fv)(const GLfloat *); + void (*RasterPos4i)(GLint, GLint, GLint, GLint); + void (*RasterPos4iv)(const GLint *); + void (*RasterPos4s)(GLshort, GLshort, GLshort, GLshort); + void (*RasterPos4sv)(const GLshort *); + void (*ReadBuffer)(GLenum); + void (*ReadPixels)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid *); + void (*Rectd)(GLdouble, GLdouble, GLdouble, GLdouble); + void (*Rectdv)(const GLdouble *, const GLdouble *); + void (*Rectf)(GLfloat, GLfloat, GLfloat, GLfloat); + void (*Rectfv)(const GLfloat *, const GLfloat *); + void (*Recti)(GLint, GLint, GLint, GLint); + void (*Rectiv)(const GLint *, const GLint *); + void (*Rects)(GLshort, GLshort, GLshort, GLshort); + void (*Rectsv)(const GLshort *, const GLshort *); + GLint (*RenderMode)(GLenum); + void (*Rotated)(GLdouble, GLdouble, GLdouble, GLdouble); + void (*Rotatef)(GLfloat, GLfloat, GLfloat, GLfloat); + void (*Scaled)(GLdouble, GLdouble, GLdouble); + void (*Scalef)(GLfloat, GLfloat, GLfloat); + void (*Scissor)(GLint, GLint, GLsizei, GLsizei); + void (*SelectBuffer)(GLsizei, GLuint *); + void (*ShadeModel)(GLenum); + void (*StencilFunc)(GLenum, GLint, GLuint); + void (*StencilMask)(GLuint); + void (*StencilOp)(GLenum, GLenum, GLenum); + void (*TexCoord1d)(GLdouble); + void (*TexCoord1dv)(const GLdouble *); + void (*TexCoord1f)(GLfloat); + void (*TexCoord1fv)(const GLfloat *); + void (*TexCoord1i)(GLint); + void (*TexCoord1iv)(const GLint *); + void (*TexCoord1s)(GLshort); + void (*TexCoord1sv)(const GLshort *); + void (*TexCoord2d)(GLdouble, GLdouble); + void (*TexCoord2dv)(const GLdouble *); + void (*TexCoord2f)(GLfloat, GLfloat); + void (*TexCoord2fv)(const GLfloat *); + void (*TexCoord2i)(GLint, GLint); + void (*TexCoord2iv)(const GLint *); + void (*TexCoord2s)(GLshort, GLshort); + void (*TexCoord2sv)(const GLshort *); + void (*TexCoord3d)(GLdouble, GLdouble, GLdouble); + void (*TexCoord3dv)(const GLdouble *); + void (*TexCoord3f)(GLfloat, GLfloat, GLfloat); + void (*TexCoord3fv)(const GLfloat *); + void (*TexCoord3i)(GLint, GLint, GLint); + void (*TexCoord3iv)(const GLint *); + void (*TexCoord3s)(GLshort, GLshort, GLshort); + void (*TexCoord3sv)(const GLshort *); + void (*TexCoord4d)(GLdouble, GLdouble, GLdouble, GLdouble); + void (*TexCoord4dv)(const GLdouble *); + void (*TexCoord4f)(GLfloat, GLfloat, GLfloat, GLfloat); + void (*TexCoord4fv)(const GLfloat *); + void (*TexCoord4i)(GLint, GLint, GLint, GLint); + void (*TexCoord4iv)(const GLint *); + void (*TexCoord4s)(GLshort, GLshort, GLshort, GLshort); + void (*TexCoord4sv)(const GLshort *); + void (*TexEnvf)(GLenum, GLenum, GLfloat); + void (*TexEnvfv)(GLenum, GLenum, const GLfloat *); + void (*TexEnvi)(GLenum, GLenum, GLint); + void (*TexEnviv)(GLenum, GLenum, const GLint *); + void (*TexGend)(GLenum, GLenum, GLdouble); + void (*TexGendv)(GLenum, GLenum, const GLdouble *); + void (*TexGenf)(GLenum, GLenum, GLfloat); + void (*TexGenfv)(GLenum, GLenum, const GLfloat *); + void (*TexGeni)(GLenum, GLenum, GLint); + void (*TexGeniv)(GLenum, GLenum, const GLint *); + void (*TexImage1D)(GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, const GLvoid *); + void (*TexImage2D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); + void (*TexParameterf)(GLenum, GLenum, GLfloat); + void (*TexParameterfv)(GLenum, GLenum, const GLfloat *); + void (*TexParameteri)(GLenum, GLenum, GLint); + void (*TexParameteriv)(GLenum, GLenum, const GLint *); + void (*Translated)(GLdouble, GLdouble, GLdouble); + void (*Translatef)(GLfloat, GLfloat, GLfloat); + void (*Vertex2d)(GLdouble, GLdouble); + void (*Vertex2dv)(const GLdouble *); + void (*Vertex2f)(GLfloat, GLfloat); + void (*Vertex2fv)(const GLfloat *); + void (*Vertex2i)(GLint, GLint); + void (*Vertex2iv)(const GLint *); + void (*Vertex2s)(GLshort, GLshort); + void (*Vertex2sv)(const GLshort *); + void (*Vertex3d)(GLdouble, GLdouble, GLdouble); + void (*Vertex3dv)(const GLdouble *); + void (*Vertex3f)(GLfloat, GLfloat, GLfloat); + void (*Vertex3fv)(const GLfloat *); + void (*Vertex3i)(GLint, GLint, GLint); + void (*Vertex3iv)(const GLint *); + void (*Vertex3s)(GLshort, GLshort, GLshort); + void (*Vertex3sv)(const GLshort *); + void (*Vertex4d)(GLdouble, GLdouble, GLdouble, GLdouble); + void (*Vertex4dv)(const GLdouble *); + void (*Vertex4f)(GLfloat, GLfloat, GLfloat, GLfloat); + void (*Vertex4fv)(const GLfloat *); + void (*Vertex4i)(GLint, GLint, GLint, GLint); + void (*Vertex4iv)(const GLint *); + void (*Vertex4s)(GLshort, GLshort, GLshort, GLshort); + void (*Vertex4sv)(const GLshort *); + void (*Viewport)(GLint, GLint, GLsizei, GLsizei); + + /* + * OpenGL 1.1 + */ +#ifdef _GLAPI_VERSION_1_1 + GLboolean (*AreTexturesResident)(GLsizei, const GLuint *, GLboolean *); + void (*ArrayElement)(GLint); + void (*BindTexture)(GLenum, GLuint); + void (*ColorPointer)(GLint, GLenum, GLsizei, const GLvoid *); + void (*CopyTexImage1D)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); + void (*CopyTexImage2D)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); + void (*CopyTexSubImage1D)(GLenum, GLint, GLint, GLint, GLint, GLsizei); + void (*CopyTexSubImage2D)(GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); + void (*DeleteTextures)(GLsizei, const GLuint *); + void (*DisableClientState)(GLenum); + void (*DrawArrays)(GLenum, GLint, GLsizei); + void (*DrawElements)(GLenum, GLsizei, GLenum, const GLvoid *); + void (*EdgeFlagPointer)(GLsizei, const GLvoid *); + void (*EnableClientState)(GLenum); + void (*GenTextures)(GLsizei, GLuint *); + void (*GetPointerv)(GLenum, GLvoid **); + void (*IndexPointer)(GLenum, GLsizei, const GLvoid *); + void (*Indexub)(GLubyte); + void (*Indexubv)(const GLubyte *); + void (*InterleavedArrays)(GLenum, GLsizei, const GLvoid *); + GLboolean (*IsTexture)(GLuint); + void (*NormalPointer)(GLenum, GLsizei, const GLvoid *); + void (*PopClientAttrib)(void); + void (*PrioritizeTextures)(GLsizei, const GLuint *, const GLclampf *); + void (*PushClientAttrib)(GLbitfield); + void (*TexCoordPointer)(GLint, GLenum, GLsizei, const GLvoid *); + void (*TexSubImage1D)(GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); + void (*TexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); + void (*VertexPointer)(GLint, GLenum, GLsizei, const GLvoid *); +#endif + + /* + * OpenGL 1.2 + */ +#ifdef _GLAPI_VERSION_1_2 + void (*CopyTexSubImage3D)(GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); + void (*DrawRangeElements)(GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); + void (*TexImage3D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); + void (*TexSubImage3D)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); + +#ifdef _GLAPI_ARB_imaging + void (*BlendColor)(GLclampf, GLclampf, GLclampf, GLclampf); + void (*BlendEquation)(GLenum); + void (*ColorSubTable)(GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); + void (*ColorTable)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); + void (*ColorTableParameterfv)(GLenum, GLenum, const GLfloat *); + void (*ColorTableParameteriv)(GLenum, GLenum, const GLint *); + void (*ConvolutionFilter1D)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); + void (*ConvolutionFilter2D)(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); + void (*ConvolutionParameterf)(GLenum, GLenum, GLfloat); + void (*ConvolutionParameterfv)(GLenum, GLenum, const GLfloat *); + void (*ConvolutionParameteri)(GLenum, GLenum, GLint); + void (*ConvolutionParameteriv)(GLenum, GLenum, const GLint *); + void (*CopyColorSubTable)(GLenum, GLsizei, GLint, GLint, GLsizei); + void (*CopyColorTable)(GLenum, GLenum, GLint, GLint, GLsizei); + void (*CopyConvolutionFilter1D)(GLenum, GLenum, GLint x, GLint y, GLsizei); + void (*CopyConvolutionFilter2D)(GLenum, GLenum, GLint x, GLint y, GLsizei, GLsizei); + void (*GetColorTable)(GLenum, GLenum, GLenum, GLvoid *); + void (*GetColorTableParameterfv)(GLenum, GLenum, GLfloat *); + void (*GetColorTableParameteriv)(GLenum, GLenum, GLint *); + void (*GetConvolutionFilter)(GLenum, GLenum, GLenum, GLvoid *); + void (*GetConvolutionParameterfv)(GLenum, GLenum, GLfloat *); + void (*GetConvolutionParameteriv)(GLenum, GLenum, GLint *); + void (*GetHistogram)(GLenum, GLboolean, GLenum, GLenum, GLvoid *); + void (*GetHistogramParameterfv)(GLenum, GLenum, GLfloat *); + void (*GetHistogramParameteriv)(GLenum, GLenum, GLint *); + void (*GetMinmax)(GLenum, GLboolean, GLenum, GLenum, GLvoid *); + void (*GetMinmaxParameterfv)(GLenum, GLenum, GLfloat *); + void (*GetMinmaxParameteriv)(GLenum, GLenum, GLint *); + void (*GetSeparableFilter)(GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); + void (*Histogram)(GLenum, GLsizei, GLenum, GLboolean); + void (*Minmax)(GLenum, GLenum, GLboolean); + void (*ResetHistogram)(GLenum); + void (*ResetMinmax)(GLenum); + void (*SeparableFilter2D)(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +#endif /*_GLAPI_ARB_imaging*/ +#endif /*_GLAPI_VERSION_1_2*/ + + + /* + * Extensions + */ + +#ifdef _GLAPI_EXT_color_table + void (*ColorTableEXT)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); + void (*ColorSubTableEXT)(GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); + void (*GetColorTableEXT)(GLenum, GLenum, GLenum, GLvoid *); + void (*GetColorTableParameterfvEXT)(GLenum, GLenum, GLfloat *); + void (*GetColorTableParameterivEXT)(GLenum, GLenum, GLint *); +#endif + +#ifdef _GLAPI_EXT_compiled_vertex_array + void (*LockArraysEXT)(GLint, GLsizei); + void (*UnlockArraysEXT)(void); +#endif + +#ifdef _GLAPI_EXT_point_parameters + void (*PointParameterfEXT)(GLenum, GLfloat); + void (*PointParameterfvEXT)(GLenum, const GLfloat *); +#endif + +#ifdef _GLAPI_EXT_polygon_offset + void (*PolygonOffsetEXT)(GLfloat, GLfloat); +#endif + +#ifdef _GLAPI_EXT_blend_minmax + void (*BlendEquationEXT)(GLenum); +#endif + +#ifdef _GLAPI_EXT_blend_color + void (*BlendColorEXT)(GLclampf, GLclampf, GLclampf, GLclampf); +#endif + +#ifdef _GLAPI_ARB_multitexture + void (*ActiveTextureARB)(GLenum); + void (*ClientActiveTextureARB)(GLenum); + void (*MultiTexCoord1dARB)(GLenum, GLdouble); + void (*MultiTexCoord1dvARB)(GLenum, const GLdouble *); + void (*MultiTexCoord1fARB)(GLenum, GLfloat); + void (*MultiTexCoord1fvARB)(GLenum, const GLfloat *); + void (*MultiTexCoord1iARB)(GLenum, GLint); + void (*MultiTexCoord1ivARB)(GLenum, const GLint *); + void (*MultiTexCoord1sARB)(GLenum, GLshort); + void (*MultiTexCoord1svARB)(GLenum, const GLshort *); + void (*MultiTexCoord2dARB)(GLenum, GLdouble, GLdouble); + void (*MultiTexCoord2dvARB)(GLenum, const GLdouble *); + void (*MultiTexCoord2fARB)(GLenum, GLfloat, GLfloat); + void (*MultiTexCoord2fvARB)(GLenum, const GLfloat *); + void (*MultiTexCoord2iARB)(GLenum, GLint, GLint); + void (*MultiTexCoord2ivARB)(GLenum, const GLint *); + void (*MultiTexCoord2sARB)(GLenum, GLshort, GLshort); + void (*MultiTexCoord2svARB)(GLenum, const GLshort *); + void (*MultiTexCoord3dARB)(GLenum, GLdouble, GLdouble, GLdouble); + void (*MultiTexCoord3dvARB)(GLenum, const GLdouble *); + void (*MultiTexCoord3fARB)(GLenum, GLfloat, GLfloat, GLfloat); + void (*MultiTexCoord3fvARB)(GLenum, const GLfloat *); + void (*MultiTexCoord3iARB)(GLenum, GLint, GLint, GLint); + void (*MultiTexCoord3ivARB)(GLenum, const GLint *); + void (*MultiTexCoord3sARB)(GLenum, GLshort, GLshort, GLshort); + void (*MultiTexCoord3svARB)(GLenum, const GLshort *); + void (*MultiTexCoord4dARB)(GLenum, GLdouble, GLdouble, GLdouble, GLdouble); + void (*MultiTexCoord4dvARB)(GLenum, const GLdouble *); + void (*MultiTexCoord4fARB)(GLenum, GLfloat, GLfloat, GLfloat, GLfloat); + void (*MultiTexCoord4fvARB)(GLenum, const GLfloat *); + void (*MultiTexCoord4iARB)(GLenum, GLint, GLint, GLint, GLint); + void (*MultiTexCoord4ivARB)(GLenum, const GLint *); + void (*MultiTexCoord4sARB)(GLenum, GLshort, GLshort, GLshort, GLshort); + void (*MultiTexCoord4svARB)(GLenum, const GLshort *); +#endif + +#ifdef _GLAPI_INGR_blend_func_separate + void (*BlendFuncSeparateINGR)(GLenum, GLenum, GLenum, GLenum); +#endif + +#ifdef _GLAPI_MESA_window_pos + void (*WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +#endif + +#ifdef _GLAPI_MESA_resize_buffers + void (*ResizeBuffersMESA)(void); +#endif + +}; + + + + +extern void +_glapi_set_dispatch(struct _glapi_table *dispatch); + + +extern struct _glapi_table * +_glapi_get_dispatch(void); + + +extern const char * +_glapi_get_version(void); + + +extern const char * +_glapi_get_extensions(void); + + +extern void +_glapi_check_table(const struct _glapi_table *table); + + +extern GLint +_glapi_alloc_entrypoint(const char *funcName); + + +extern GLint +_glapi_get_entrypoint(const char *funcName); + + +extern const GLvoid * +_glapi_get_proc_address(const char *funcName); + + +#endif diff --git a/src/mesa/main/Makefile.X11 b/src/mesa/main/Makefile.X11 index da5dc4549e3..d026075c8e4 100644 --- a/src/mesa/main/Makefile.X11 +++ b/src/mesa/main/Makefile.X11 @@ -1,7 +1,7 @@ -# $Id: Makefile.X11,v 1.6 1999/10/08 09:27:09 keithw Exp $ +# $Id: Makefile.X11,v 1.7 1999/11/11 01:22:28 brianp Exp $ # Mesa 3-D graphics library -# Version: 3.1 +# Version: 3.3 # Copyright (C) 1995-1999 Brian Paul # Makefile for core library @@ -18,13 +18,13 @@ VPATH = RCS INCDIR = ../include LIBDIR = ../lib + CORE_SOURCES = \ + glapi.c \ + glapinoop.c \ accum.c \ alpha.c \ alphabuf.c \ - api1.c \ - api2.c \ - apiext.c \ attrib.c \ bbox.c \ bitmap.c \ @@ -37,6 +37,7 @@ CORE_SOURCES = \ cva.c \ debug_xform.c \ depth.c \ + dispatch.c \ dlist.c \ drawpix.c \ enable.c \ @@ -49,18 +50,19 @@ CORE_SOURCES = \ glmisc.c \ hash.c \ image.c \ + imaging.c \ light.c \ lines.c \ logic.c \ masking.c \ matrix.c \ + mem.c \ mmath.c \ mthreads.c \ pb.c \ pixel.c \ pipeline.c \ points.c \ - pointers.c \ polygon.c \ quads.c \ rastpos.c \ diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c index 68e567bdf1e..1e8cce0ec34 100644 --- a/src/mesa/main/accum.c +++ b/src/mesa/main/accum.c @@ -1,4 +1,4 @@ -/* $Id: accum.c,v 1.10 1999/11/08 07:36:43 brianp Exp $ */ +/* $Id: accum.c,v 1.11 1999/11/11 01:22:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,22 +25,13 @@ */ -/* $XFree86: xc/lib/GL/mesa/src/accum.c,v 1.3 1999/04/04 00:20:17 dawes Exp $ */ - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "accum.h" #include "context.h" -#include "macros.h" +#include "mem.h" #include "masking.h" #include "span.h" #include "types.h" @@ -101,9 +92,10 @@ void gl_alloc_accum_buffer( GLcontext *ctx ) -void gl_ClearAccum( GLcontext *ctx, - GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) +void +_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glAccum"); ctx->Accum.ClearColor[0] = CLAMP( red, -1.0, 1.0 ); @@ -139,8 +131,10 @@ static void rescale_accum( GLcontext *ctx ) -void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value ) +void +_mesa_Accum( GLenum op, GLfloat value ) { + GET_CURRENT_CONTEXT(ctx); GLuint xpos, ypos, width, height, width4; GLfloat acc_scale; GLubyte rgba[MAX_WIDTH][4]; diff --git a/src/mesa/main/accum.h b/src/mesa/main/accum.h index dd641da456a..0f2263bd49c 100644 --- a/src/mesa/main/accum.h +++ b/src/mesa/main/accum.h @@ -1,4 +1,4 @@ -/* $Id: accum.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: accum.h,v 1.2 1999/11/11 01:22:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -38,14 +38,15 @@ extern void gl_alloc_accum_buffer( GLcontext *ctx ); -extern void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value ); +extern void gl_clear_accum_buffer( GLcontext *ctx ); -extern void gl_ClearAccum( GLcontext *ctx, GLfloat red, GLfloat green, - GLfloat blue, GLfloat alpha ); +extern void +_mesa_Accum( GLenum op, GLfloat value ); -extern void gl_clear_accum_buffer( GLcontext *ctx ); +extern void +_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); #endif diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index e346538eead..4ca036110af 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1,4 +1,4 @@ -/* $Id: attrib.c,v 1.10 1999/11/08 15:28:08 brianp Exp $ */ +/* $Id: attrib.c,v 1.11 1999/11/11 01:22:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,23 +25,16 @@ */ - -#include - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "attrib.h" #include "context.h" #include "glmisc.h" #include "enable.h" #include "enums.h" -#include "macros.h" +#include "mem.h" #include "simple_list.h" #include "texstate.h" #include "types.h" @@ -92,11 +85,7 @@ static void copy_texobj_state( struct gl_texture_object *dest, dest->P = src->P; dest->M = src->M; dest->MinMagThresh = src->MinMagThresh; - memcpy( dest->Palette, src->Palette, - sizeof(GLubyte) * MAX_TEXTURE_PALETTE_SIZE * 4 ); - dest->PaletteSize = src->PaletteSize; - dest->PaletteIntFormat = src->PaletteIntFormat; - dest->PaletteFormat = src->PaletteFormat; + dest->Palette = src->Palette; dest->Complete = src->Complete; dest->SampleFunc = src->SampleFunc; } @@ -431,7 +420,7 @@ void gl_PopAttrib( GLcontext* ctx ) MEMCPY( &ctx->Color, attr->data, sizeof(struct gl_colorbuffer_attrib) ); if (ctx->Color.DrawBuffer != oldDrawBuffer) { - gl_DrawBuffer(ctx, ctx->Color.DrawBuffer); + _mesa_DrawBuffer( ctx->Color.DrawBuffer); } if ((ctx->Color.AlphaFunc != oldAlphaFunc || ctx->Color.AlphaRef != oldAlphaRef) && @@ -471,7 +460,7 @@ void gl_PopAttrib( GLcontext* ctx ) #define TEST_AND_UPDATE(VALUE, NEWVALUE, ENUM) \ if ((VALUE) != (NEWVALUE)) { \ - gl_set_enable( ctx, ENUM, (NEWVALUE) ); \ + _mesa_set_enable( ctx, ENUM, (NEWVALUE) ); \ } TEST_AND_UPDATE(ctx->Color.AlphaEnabled, enable->AlphaTest, GL_ALPHA_TEST); @@ -481,7 +470,7 @@ void gl_PopAttrib( GLcontext* ctx ) GLuint i; for (i=0;iTransform.ClipEnabled[i] != enable->ClipPlane[i]) - gl_set_enable( ctx, (GLenum) (GL_CLIP_PLANE0 + i), enable->ClipPlane[i] ); + _mesa_set_enable( ctx, (GLenum) (GL_CLIP_PLANE0 + i), enable->ClipPlane[i] ); } } TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial, GL_COLOR_MATERIAL); @@ -742,8 +731,8 @@ void gl_PopAttrib( GLcontext* ctx ) struct gl_viewport_attrib *v = (struct gl_viewport_attrib *)attr->data; - gl_Viewport( ctx, v->X, v->Y, v->Width, v->Height ); - gl_DepthRange( ctx, v->Near, v->Far ); + _mesa_Viewport( v->X, v->Y, v->Width, v->Height ); + _mesa_DepthRange( v->Near, v->Far ); break; } default: @@ -857,3 +846,37 @@ void gl_PopClientAttrib( GLcontext *ctx ) ctx->NewState = NEW_ALL; } + + +void +_mesa_PushAttrib( GLbitfield mask ) +{ + GET_CURRENT_CONTEXT(ctx); + gl_PushAttrib(ctx, mask); +} + + +void +_mesa_PopAttrib( void ) +{ + GET_CURRENT_CONTEXT(ctx); + gl_PopAttrib(ctx); +} + + +void +_mesa_PushClientAttrib( GLbitfield mask ) +{ + GET_CURRENT_CONTEXT(ctx); + gl_PushClientAttrib(ctx, mask); +} + + +void +_mesa_PopClientAttrib( void ) +{ + GET_CURRENT_CONTEXT(ctx); + gl_PopClientAttrib(ctx); +} + + diff --git a/src/mesa/main/attrib.h b/src/mesa/main/attrib.h index 0661c261230..91301dcb6d3 100644 --- a/src/mesa/main/attrib.h +++ b/src/mesa/main/attrib.h @@ -1,8 +1,8 @@ -/* $Id: attrib.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: attrib.h,v 1.2 1999/11/11 01:22:25 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,9 +25,6 @@ */ - - - #ifndef ATTRIB_H #define ATTRIB_h @@ -44,4 +41,17 @@ extern void gl_PushClientAttrib( GLcontext *ctx, GLbitfield mask ); extern void gl_PopClientAttrib( GLcontext *ctx ); +extern void +_mesa_PushAttrib( GLbitfield mask ); + +extern void +_mesa_PopAttrib( void ); + +extern void +_mesa_PushClientAttrib( GLbitfield mask ); + +extern void +_mesa_PopClientAttrib( void ); + + #endif diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index 357d1265c2f..4dac9a4f6a7 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -1,4 +1,4 @@ -/* $Id: blend.c,v 1.7 1999/11/08 15:28:08 brianp Exp $ */ +/* $Id: blend.c,v 1.8 1999/11/11 01:22:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -29,13 +29,7 @@ #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "alphabuf.h" #include "blend.h" #include "context.h" @@ -47,8 +41,9 @@ #endif -void gl_BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor ) +void _mesa_BlendFunc( GLenum sfactor, GLenum dfactor ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glBlendFunc"); if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) @@ -108,9 +103,10 @@ void gl_BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor ) /* GL_INGR_blend_func_separate */ void -gl_BlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB, - GLenum sfactorA, GLenum dfactorA ) +_mesa_BlendFuncSeparateINGR( GLenum sfactorRGB, GLenum dfactorRGB, + GLenum sfactorA, GLenum dfactorA ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glBlendFuncSeparate"); if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) @@ -214,8 +210,10 @@ gl_BlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB, /* This is really an extension function! */ -void gl_BlendEquation( GLcontext *ctx, GLenum mode ) +void +_mesa_BlendEquationEXT( GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glBlendEquation"); if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) @@ -256,9 +254,10 @@ void gl_BlendEquation( GLcontext *ctx, GLenum mode ) -void gl_BlendColor( GLcontext *ctx, GLclampf red, GLclampf green, - GLclampf blue, GLclampf alpha ) +void +_mesa_BlendColorEXT( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) { + GET_CURRENT_CONTEXT(ctx); ctx->Color.BlendColor[0] = CLAMP( red, 0.0F, 1.0F ); ctx->Color.BlendColor[1] = CLAMP( green, 0.0F, 1.0F ); ctx->Color.BlendColor[2] = CLAMP( blue, 0.0F, 1.0F ); diff --git a/src/mesa/main/blend.h b/src/mesa/main/blend.h index 837ea9d6bf2..8396880eae8 100644 --- a/src/mesa/main/blend.h +++ b/src/mesa/main/blend.h @@ -1,4 +1,4 @@ -/* $Id: blend.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: blend.h,v 1.2 1999/11/11 01:22:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,9 +25,6 @@ */ - - - #ifndef BLEND_H #define BLEND_H @@ -48,21 +45,20 @@ gl_blend_pixels( GLcontext *ctx, extern void -gl_BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor ); +_mesa_BlendFunc( GLenum sfactor, GLenum dfactor ); extern void -gl_BlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB, - GLenum sfactorA, GLenum dfactorA ); +_mesa_BlendFuncSeparateINGR( GLenum sfactorRGB, GLenum dfactorRGB, + GLenum sfactorA, GLenum dfactorA ); extern void -gl_BlendEquation( GLcontext *ctx, GLenum mode ); +_mesa_BlendEquationEXT( GLenum mode ); extern void -gl_BlendColor( GLcontext *ctx, GLclampf red, GLclampf green, - GLclampf blue, GLclampf alpha ); +_mesa_BlendColorEXT(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); #endif diff --git a/src/mesa/main/clip.c b/src/mesa/main/clip.c index d93e50958ae..acecb60b6bf 100644 --- a/src/mesa/main/clip.c +++ b/src/mesa/main/clip.c @@ -1,8 +1,8 @@ -/* $Id: clip.c,v 1.4 1999/11/08 07:36:43 brianp Exp $ */ +/* $Id: clip.c,v 1.5 1999/11/11 01:22:25 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,18 +25,10 @@ */ - - - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "clip.h" #include "context.h" #include "macros.h" @@ -130,9 +122,17 @@ static clip_interp_func clip_interp_tab[0x40]; -void gl_ClipPlane( GLcontext* ctx, GLenum plane, const GLfloat *equation ) +void +_mesa_ClipPlane( GLenum plane, const GLdouble *eq ) { + GET_CURRENT_CONTEXT(ctx); GLint p; + GLfloat equation[4]; + + equation[0] = eq[0]; + equation[1] = eq[1]; + equation[2] = eq[2]; + equation[3] = eq[3]; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClipPlane"); @@ -183,8 +183,10 @@ void gl_update_userclip( GLcontext *ctx ) } } -void gl_GetClipPlane( GLcontext* ctx, GLenum plane, GLdouble *equation ) +void +_mesa_GetClipPlane( GLenum plane, GLdouble *equation ) { + GET_CURRENT_CONTEXT(ctx); GLint p; ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetClipPlane"); diff --git a/src/mesa/main/clip.h b/src/mesa/main/clip.h index b8ea954dca4..abf2f7e9ce0 100644 --- a/src/mesa/main/clip.h +++ b/src/mesa/main/clip.h @@ -1,4 +1,4 @@ -/* $Id: clip.h,v 1.2 1999/09/18 20:41:22 keithw Exp $ */ +/* $Id: clip.h,v 1.3 1999/11/11 01:22:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -63,11 +63,9 @@ extern GLuint gl_userclip_point( GLcontext* ctx, const GLfloat v[] ); extern void gl_user_cliptest( struct vertex_buffer *VB ); -extern void gl_ClipPlane( GLcontext* ctx, - GLenum plane, const GLfloat *equation ); +extern void _mesa_ClipPlane( GLenum plane, const GLdouble *equation ); -extern void gl_GetClipPlane( GLcontext* ctx, - GLenum plane, GLdouble *equation ); +extern void _mesa_GetClipPlane( GLenum plane, GLdouble *equation ); /* diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index f0744ae1cf9..798eda44c8c 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -1,4 +1,4 @@ -/* $Id: colortab.c,v 1.3 1999/11/08 07:36:43 brianp Exp $ */ +/* $Id: colortab.c,v 1.4 1999/11/11 01:22:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -23,20 +23,15 @@ * 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. */ -/* $XFree86: xc/lib/GL/mesa/src/colortab.c,v 1.2 1999/04/04 00:20:21 dawes Exp $ */ - - - #ifdef PC_HEADER #include "all.h" #else -#ifdef XFree86Server -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "colortab.h" #include "context.h" +#include "image.h" #include "macros.h" #endif @@ -45,7 +40,8 @@ /* * Return GL_TRUE if k is a power of two, else return GL_FALSE. */ -static GLboolean power_of_two( GLint k ) +static GLboolean +power_of_two( GLint k ) { GLint i, m = 1; for (i=0; i<32; i++) { @@ -57,7 +53,8 @@ static GLboolean power_of_two( GLint k ) } -static GLint decode_internal_format( GLint format ) +static GLint +decode_internal_format( GLint format ) { switch (format) { case GL_ALPHA: @@ -114,81 +111,95 @@ static GLint decode_internal_format( GLint format ) } -void gl_ColorTable( GLcontext *ctx, GLenum target, - GLenum internalFormat, struct gl_image *table ) +void +_mesa_ColorTable( GLenum target, GLenum internalFormat, + GLsizei width, GLenum format, GLenum type, + const GLvoid *table ) { + GET_CURRENT_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; struct gl_texture_object *texObj; + struct gl_palette *palette; GLboolean proxy = GL_FALSE; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glColorTable"); - if (decode_internal_format(internalFormat) < 0) { - gl_error( ctx, GL_INVALID_ENUM, "glColorTable(internalFormat)" ); - return; - } - switch (target) { case GL_TEXTURE_1D: texObj = texUnit->CurrentD[1]; + palette = &texObj->Palette; break; case GL_TEXTURE_2D: texObj = texUnit->CurrentD[2]; + palette = &texObj->Palette; break; - case GL_TEXTURE_3D_EXT: + case GL_TEXTURE_3D: texObj = texUnit->CurrentD[3]; + palette = &texObj->Palette; break; case GL_PROXY_TEXTURE_1D: texObj = ctx->Texture.Proxy1D; + palette = &texObj->Palette; proxy = GL_TRUE; break; case GL_PROXY_TEXTURE_2D: texObj = ctx->Texture.Proxy2D; + palette = &texObj->Palette; proxy = GL_TRUE; break; - case GL_PROXY_TEXTURE_3D_EXT: + case GL_PROXY_TEXTURE_3D: texObj = ctx->Texture.Proxy3D; + palette = &texObj->Palette; proxy = GL_TRUE; break; case GL_SHARED_TEXTURE_PALETTE_EXT: texObj = NULL; + palette = &ctx->Texture.Palette; break; default: - gl_error(ctx, GL_INVALID_ENUM, "glColorTableEXT(target)"); + gl_error(ctx, GL_INVALID_ENUM, "glColorTable(target)"); return; } - /* internalformat = just like glTexImage */ + assert(palette); + + if (!gl_is_legal_format_and_type(format, type)) { + gl_error(ctx, GL_INVALID_ENUM, "glColorTable(format or type)"); + return; + } + + if (decode_internal_format(internalFormat) < 0) { + gl_error( ctx, GL_INVALID_ENUM, "glColorTable(internalFormat)" ); + return; + } - if (table->Width < 1 || table->Width > MAX_TEXTURE_PALETTE_SIZE - || !power_of_two(table->Width)) { - gl_error(ctx, GL_INVALID_VALUE, "glColorTableEXT(width)"); + if (width < 1 || width > MAX_TEXTURE_PALETTE_SIZE || !power_of_two(width)) { + gl_error(ctx, GL_INVALID_VALUE, "glColorTable(width)"); if (proxy) { - texObj->PaletteSize = 0; - texObj->PaletteIntFormat = (GLenum) 0; - texObj->PaletteFormat = (GLenum) 0; + palette->Size = 0; + palette->IntFormat = (GLenum) 0; + palette->Format = (GLenum) 0; } return; } + palette->Size = width; + palette->IntFormat = internalFormat; + palette->Format = (GLenum) decode_internal_format(internalFormat); + if (!proxy) { + _mesa_unpack_ubyte_color_span(ctx, width, palette->Format, + palette->Table, /* dest */ + format, type, table, + &ctx->Unpack, GL_FALSE); + } if (texObj) { /* per-texture object palette */ - texObj->PaletteSize = table->Width; - texObj->PaletteIntFormat = internalFormat; - texObj->PaletteFormat = (GLenum) decode_internal_format(internalFormat); - if (!proxy) { - MEMCPY(texObj->Palette, table->Data, table->Width*table->Components); - if (ctx->Driver.UpdateTexturePalette) { - (*ctx->Driver.UpdateTexturePalette)( ctx, texObj ); - } + if (ctx->Driver.UpdateTexturePalette) { + (*ctx->Driver.UpdateTexturePalette)( ctx, texObj ); } } else { /* shared texture palette */ - ctx->Texture.PaletteSize = table->Width; - ctx->Texture.PaletteIntFormat = internalFormat; - ctx->Texture.PaletteFormat = (GLenum) decode_internal_format(internalFormat); - MEMCPY(ctx->Texture.Palette, table->Data, table->Width*table->Components); if (ctx->Driver.UpdateTexturePalette) { (*ctx->Driver.UpdateTexturePalette)( ctx, NULL ); } @@ -197,38 +208,172 @@ void gl_ColorTable( GLcontext *ctx, GLenum target, -void gl_ColorSubTable( GLcontext *ctx, GLenum target, - GLsizei start, struct gl_image *data ) +void +_mesa_ColorSubTable( GLenum target, GLsizei start, + GLsizei count, GLenum format, GLenum type, + const GLvoid *table ) { - /* XXX TODO */ - gl_problem(ctx, "glColorSubTableEXT not implemented"); - (void) target; - (void) start; - (void) data; + GET_CURRENT_CONTEXT(ctx); + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_object *texObj; + struct gl_palette *palette; + GLint comps; + GLubyte *dest; + + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glColorSubTable"); + + switch (target) { + case GL_TEXTURE_1D: + texObj = texUnit->CurrentD[1]; + palette = &texObj->Palette; + break; + case GL_TEXTURE_2D: + texObj = texUnit->CurrentD[2]; + palette = &texObj->Palette; + break; + case GL_TEXTURE_3D: + texObj = texUnit->CurrentD[3]; + palette = &texObj->Palette; + break; + case GL_SHARED_TEXTURE_PALETTE_EXT: + texObj = NULL; + palette = &ctx->Texture.Palette; + break; + default: + gl_error(ctx, GL_INVALID_ENUM, "glColorSubTable(target)"); + return; + } + + assert(palette); + + if (!gl_is_legal_format_and_type(format, type)) { + gl_error(ctx, GL_INVALID_ENUM, "glColorSubTable(format or type)"); + return; + } + + if (count < 1) { + gl_error(ctx, GL_INVALID_VALUE, "glColorSubTable(count)"); + return; + } + + comps = gl_components_in_format(format); + assert(comps > 0); /* error should be caught sooner */ + + if (start + count > palette->Size) { + gl_error(ctx, GL_INVALID_VALUE, "glColorSubTable(count)"); + return; + } + dest = palette->Table + start * comps * sizeof(GLubyte); + _mesa_unpack_ubyte_color_span(ctx, count, palette->Format, dest, + format, type, table, + &ctx->Unpack, GL_FALSE); + + if (texObj) { + /* per-texture object palette */ + if (ctx->Driver.UpdateTexturePalette) { + (*ctx->Driver.UpdateTexturePalette)( ctx, texObj ); + } + } + else { + /* shared texture palette */ + if (ctx->Driver.UpdateTexturePalette) { + (*ctx->Driver.UpdateTexturePalette)( ctx, NULL ); + } + } } -void gl_GetColorTable( GLcontext *ctx, GLenum target, GLenum format, - GLenum type, GLvoid *table ) +void +_mesa_GetColorTable( GLenum target, GLenum format, + GLenum type, GLvoid *table ) { + GET_CURRENT_CONTEXT(ctx); + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_palette *palette; + GLubyte rgba[MAX_TEXTURE_PALETTE_SIZE][4]; + GLint i; + ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetBooleanv"); switch (target) { case GL_TEXTURE_1D: + palette = &texUnit->CurrentD[1]->Palette; break; case GL_TEXTURE_2D: + palette = &texUnit->CurrentD[2]->Palette; break; - case GL_TEXTURE_3D_EXT: + case GL_TEXTURE_3D: + palette = &texUnit->CurrentD[3]->Palette; break; case GL_SHARED_TEXTURE_PALETTE_EXT: + palette = &ctx->Texture.Palette; + break; + default: + gl_error(ctx, GL_INVALID_ENUM, "glGetColorTable(target)"); + return; + } + + assert(palette); + + switch (palette->Format) { + case GL_ALPHA: + for (i = 0; i < palette->Size; i++) { + rgba[i][RCOMP] = 0; + rgba[i][GCOMP] = 0; + rgba[i][BCOMP] = 0; + rgba[i][ACOMP] = palette->Table[i]; + } + break; + case GL_LUMINANCE: + for (i = 0; i < palette->Size; i++) { + rgba[i][RCOMP] = palette->Table[i]; + rgba[i][GCOMP] = palette->Table[i]; + rgba[i][BCOMP] = palette->Table[i]; + rgba[i][ACOMP] = 255; + } + break; + case GL_LUMINANCE_ALPHA: + for (i = 0; i < palette->Size; i++) { + rgba[i][RCOMP] = palette->Table[i*2+0]; + rgba[i][GCOMP] = palette->Table[i*2+0]; + rgba[i][BCOMP] = palette->Table[i*2+0]; + rgba[i][ACOMP] = palette->Table[i*2+1]; + } + break; + case GL_INTENSITY: + for (i = 0; i < palette->Size; i++) { + rgba[i][RCOMP] = palette->Table[i]; + rgba[i][GCOMP] = palette->Table[i]; + rgba[i][BCOMP] = palette->Table[i]; + rgba[i][ACOMP] = 255; + } + break; + case GL_RGB: + for (i = 0; i < palette->Size; i++) { + rgba[i][RCOMP] = palette->Table[i*3+0]; + rgba[i][GCOMP] = palette->Table[i*3+1]; + rgba[i][BCOMP] = palette->Table[i*3+2]; + rgba[i][ACOMP] = 255; + } + break; + case GL_RGBA: + for (i = 0; i < palette->Size; i++) { + rgba[i][RCOMP] = palette->Table[i*4+0]; + rgba[i][GCOMP] = palette->Table[i*4+1]; + rgba[i][BCOMP] = palette->Table[i*4+2]; + rgba[i][ACOMP] = palette->Table[i*4+3]; + } break; default: - gl_error(ctx, GL_INVALID_ENUM, "glGetColorTableEXT(target)"); + gl_problem(ctx, "bad palette format in glGetColorTable"); return; } - gl_problem(ctx, "glGetColorTableEXT not implemented!"); + gl_pack_rgba_span(ctx, palette->Size, (const GLubyte (*)[]) rgba, + format, type, table, &ctx->Pack, GL_FALSE); + + gl_problem(ctx, "glGetColorTable not implemented!"); (void) format; (void) type; (void) table; @@ -236,37 +381,37 @@ void gl_GetColorTable( GLcontext *ctx, GLenum target, GLenum format, -void gl_GetColorTableParameterfv( GLcontext *ctx, GLenum target, - GLenum pname, GLfloat *params ) +void +_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) { GLint iparams[10]; - - gl_GetColorTableParameteriv( ctx, target, pname, iparams ); + _mesa_GetColorTableParameteriv( target, pname, iparams ); *params = (GLfloat) iparams[0]; } -void gl_GetColorTableParameteriv( GLcontext *ctx, GLenum target, - GLenum pname, GLint *params ) +void +_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) { + GET_CURRENT_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - struct gl_texture_object *texObj; + struct gl_palette *palette; ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetColorTableParameter"); switch (target) { case GL_TEXTURE_1D: - texObj = texUnit->CurrentD[1]; + palette = &texUnit->CurrentD[1]->Palette; break; case GL_TEXTURE_2D: - texObj = texUnit->CurrentD[2]; + palette = &texUnit->CurrentD[2]->Palette; break; - case GL_TEXTURE_3D_EXT: - texObj = texUnit->CurrentD[3]; + case GL_TEXTURE_3D: + palette = &texUnit->CurrentD[3]->Palette; break; case GL_SHARED_TEXTURE_PALETTE_EXT: - texObj = NULL; + palette = &ctx->Texture.Palette; break; default: gl_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameter(target)"); @@ -274,34 +419,28 @@ void gl_GetColorTableParameteriv( GLcontext *ctx, GLenum target, } switch (pname) { - case GL_COLOR_TABLE_FORMAT_EXT: - if (texObj) - *params = texObj->PaletteIntFormat; - else - *params = ctx->Texture.PaletteIntFormat; - break; - case GL_COLOR_TABLE_WIDTH_EXT: - if (texObj) - *params = texObj->PaletteSize; - else - *params = ctx->Texture.PaletteSize; - break; - case GL_COLOR_TABLE_RED_SIZE_EXT: + case GL_COLOR_TABLE_FORMAT: + *params = palette->IntFormat; + break; + case GL_COLOR_TABLE_WIDTH: + *params = palette->Size; + break; + case GL_COLOR_TABLE_RED_SIZE: *params = 8; break; - case GL_COLOR_TABLE_GREEN_SIZE_EXT: + case GL_COLOR_TABLE_GREEN_SIZE: *params = 8; break; - case GL_COLOR_TABLE_BLUE_SIZE_EXT: + case GL_COLOR_TABLE_BLUE_SIZE: *params = 8; break; - case GL_COLOR_TABLE_ALPHA_SIZE_EXT: + case GL_COLOR_TABLE_ALPHA_SIZE: *params = 8; break; - case GL_COLOR_TABLE_LUMINANCE_SIZE_EXT: + case GL_COLOR_TABLE_LUMINANCE_SIZE: *params = 8; break; - case GL_COLOR_TABLE_INTENSITY_SIZE_EXT: + case GL_COLOR_TABLE_INTENSITY_SIZE: *params = 8; break; default: diff --git a/src/mesa/main/colortab.h b/src/mesa/main/colortab.h index 8e75f13dac7..633d342dc48 100644 --- a/src/mesa/main/colortab.h +++ b/src/mesa/main/colortab.h @@ -1,4 +1,4 @@ -/* $Id: colortab.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: colortab.h,v 1.2 1999/11/11 01:22:25 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,9 +25,6 @@ */ - - - #ifndef COLORTAB_H #define COLORTAB_H @@ -35,21 +32,25 @@ #include "types.h" -extern void gl_ColorTable( GLcontext *ctx, GLenum target, - GLenum internalformat, - struct gl_image *table ); +extern void +_mesa_ColorTable( GLenum target, GLenum internalformat, + GLsizei width, GLenum format, GLenum type, + const GLvoid *table ); -extern void gl_ColorSubTable( GLcontext *ctx, GLenum target, - GLsizei start, struct gl_image *data ); +extern void +_mesa_ColorSubTable( GLenum target, GLsizei start, + GLsizei count, GLenum format, GLenum type, + const GLvoid *table ); -extern void gl_GetColorTable( GLcontext *ctx, GLenum target, GLenum format, - GLenum type, GLvoid *table ); +extern void +_mesa_GetColorTable( GLenum target, GLenum format, + GLenum type, GLvoid *table ); -extern void gl_GetColorTableParameterfv( GLcontext *ctx, GLenum target, - GLenum pname, GLfloat *params ); +extern void +_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ); -extern void gl_GetColorTableParameteriv( GLcontext *ctx, GLenum target, - GLenum pname, GLint *params ); +extern void +_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ); #endif diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index 0b35aba7dc6..9affa9c4d3d 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -1,8 +1,8 @@ -/* $Id: config.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: config.h,v 1.2 1999/11/11 01:22:25 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,10 +25,6 @@ */ - - - - /* * Tunable configuration parameters. */ @@ -42,13 +38,11 @@ #include "conf.h" #endif + /* - * * OpenGL implementation limits - * */ - /* Maximum modelview matrix stack depth: */ #define MAX_MODELVIEW_STACK_DEPTH 32 @@ -116,10 +110,9 @@ #define MAX_ARRAY_LOCK_SIZE 3000 + /* - * * Mesa-specific parameters - * */ @@ -129,6 +122,9 @@ #define ACCUM_BITS 16 +/* + * Bits per depth buffer value: 16 or 32 + */ #ifdef MESAD3D /* Mesa / Direct3D driver only */ extern float g_DepthScale, g_MaxDepth; @@ -136,9 +132,6 @@ # define DEPTH_SCALE g_DepthScale # define MAX_DEPTH g_MaxDepth #else - /* - * Bits per depth buffer value: 16 or 32 - */ # define DEPTH_BITS 16 # if DEPTH_BITS==16 # define MAX_DEPTH 0xffff @@ -201,19 +194,6 @@ #define VB_SIZE (VB_MAX + VB_MAX_CLIPPED_VERTS) -/* - * - * For X11 driver only: - * - */ - -/* - * When defined, use 6x6x6 dithering instead of 5x9x5. - * 5x9x5 better for general colors, 6x6x6 better for grayscale. - */ -/*#define DITHER666*/ - - typedef struct gl_context GLcontext; diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 628e7341916..cf8bb8bd479 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1,8 +1,8 @@ -/* $Id: context.c,v 1.18 1999/11/08 07:36:43 brianp Exp $ */ +/* $Id: context.c,v 1.19 1999/11/11 01:22:25 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,8 +25,6 @@ */ -/* $XFree86: xc/lib/GL/mesa/src/context.c,v 1.4 1999/04/04 00:20:21 dawes Exp $ */ - /* * If multi-threading is enabled (-DTHREADS) then each thread has it's * own rendering context. A thread obtains the pointer to its GLcontext @@ -36,42 +34,34 @@ */ - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#include -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "accum.h" #include "alphabuf.h" -#include "api.h" #include "clip.h" #include "context.h" #include "cva.h" #include "depth.h" +#include "dispatch.h" #include "dlist.h" #include "eval.h" #include "enums.h" #include "extensions.h" #include "fog.h" +#include "glapi.h" #include "hash.h" #include "light.h" #include "lines.h" #include "dlist.h" #include "macros.h" #include "matrix.h" +#include "mem.h" #include "mmath.h" #include "pb.h" #include "pipeline.h" #include "points.h" -#include "pointers.h" #include "quads.h" #include "shade.h" #include "simple_list.h" @@ -95,40 +85,6 @@ #endif -/* - * Memory allocation functions. Called via the MALLOC, CALLOC and - * FREE macros when DEBUG symbol is defined. - * You might want to set breakpoints on these functions or plug in - * other memory allocation functions. The Mesa sources should only - * use the MALLOC and FREE macros (which could also be overriden). - * - * XXX these functions should probably go into a new glmemory.c file. - */ - -/* - * Allocate memory (uninitialized) - */ -void *gl_malloc(size_t bytes) -{ - return malloc(bytes); -} - -/* - * Allocate memory and initialize to zero. - */ -void *gl_calloc(size_t bytes) -{ - return calloc(1, bytes); -} - -/* - * Free memory - */ -void gl_free(void *ptr) -{ - free(ptr); -} - /**********************************************************************/ /***** Context and Thread management *****/ @@ -157,7 +113,7 @@ static void set_thread_context( GLcontext *ctx ) { #else /* One Current Context pointer for all threads in the address space */ -GLcontext *CC = NULL; +GLcontext *_mesa_current_context = NULL; struct immediate *CURRENT_INPUT = NULL; #endif /*THREADS*/ @@ -578,7 +534,6 @@ static void init_1d_map( struct gl_1d_map *map, int n, const float *initial ) for (i=0;iPoints[i] = initial[i]; } - map->Retain = GL_FALSE; } @@ -597,10 +552,20 @@ static void init_2d_map( struct gl_2d_map *map, int n, const float *initial ) for (i=0;iPoints[i] = initial[i]; } - map->Retain = GL_FALSE; } +static void init_palette( struct gl_palette *p ) +{ + p->Table[0] = 255; + p->Table[1] = 255; + p->Table[2] = 255; + p->Table[3] = 255; + p->Size = 1; + p->IntFormat = GL_RGBA; + p->Format = GL_RGBA; +} + /* * Initialize a gl_context structure to default values. @@ -929,14 +894,7 @@ static void initialize_context( GLcontext *ctx ) for (i=0; iTexture.SharedPalette = GL_FALSE; - ctx->Texture.Palette[0] = 255; - ctx->Texture.Palette[1] = 255; - ctx->Texture.Palette[2] = 255; - ctx->Texture.Palette[3] = 255; - ctx->Texture.PaletteSize = 1; - ctx->Texture.PaletteIntFormat = GL_RGBA; - ctx->Texture.PaletteFormat = GL_RGBA; + init_palette(&ctx->Texture.Palette); /* Transformation group */ ctx->Transform.MatrixMode = GL_MODELVIEW; @@ -1331,13 +1289,10 @@ GLcontext *gl_create_context( GLvisual *visual, ctx->Driver.ReadDepthSpanFloat = gl_read_depth_span_float; ctx->Driver.ReadDepthSpanInt = gl_read_depth_span_int; - - #ifdef PROFILE init_timings( ctx ); #endif -#ifdef GL_VERSION_1_1 if (!alloc_proxy_textures(ctx)) { free_shared_state(ctx, ctx->Shared); FREE(ctx->VB); @@ -1345,10 +1300,11 @@ GLcontext *gl_create_context( GLvisual *visual, FREE(ctx); return NULL; } -#endif - gl_init_api_function_pointers( ctx ); - ctx->API = ctx->Exec; /* GL_EXECUTE is default */ + /* setup API dispatch tables */ + _mesa_init_exec_table( &ctx->Exec ); + _mesa_init_dlist_table( &ctx->Save ); + ctx->CurrentDispatch = &ctx->Exec; return ctx; } @@ -1462,8 +1418,8 @@ void gl_destroy_context( GLcontext *ctx ) FREE( (void *) ctx ); #ifndef THREADS - if (ctx==CC) { - CC = NULL; + if (ctx == _mesa_current_context) { + _mesa_current_context = NULL; CURRENT_INPUT = NULL; } #endif @@ -1532,37 +1488,42 @@ void gl_destroy_framebuffer( GLframebuffer *buffer ) /* * Set the current context, binding the given frame buffer to the context. */ -void gl_make_current( GLcontext *ctx, GLframebuffer *buffer ) +void gl_make_current( GLcontext *newCtx, GLframebuffer *buffer ) { - GET_CONTEXT; + GET_CURRENT_CONTEXT(oldCtx); /* Flush the old context */ - if (CC) { - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(CC, "gl_make_current"); + if (oldCtx) { + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(oldCtx, "gl_make_current"); } #ifdef THREADS /* TODO: unbind old buffer from context? */ - set_thread_context( ctx ); + set_thread_context( newCtx ); #else - if (CC && CC->Buffer) { + if (oldCtx && oldCtx->Buffer) { /* unbind frame buffer from context */ - CC->Buffer = NULL; + oldCtx->Buffer = NULL; } - CC = ctx; - if (ctx) { - SET_IMMEDIATE(ctx, ctx->input); + _mesa_current_context = newCtx; + if (newCtx) { + SET_IMMEDIATE(newCtx, newCtx->input); } #endif + if (newCtx) + _glapi_set_dispatch(newCtx->CurrentDispatch); + else + _glapi_set_dispatch(NULL); /* none current */ + if (MESA_VERBOSE) fprintf(stderr, "gl_make_current()\n"); - if (ctx && buffer) { - /* TODO: check if ctx and buffer's visual match??? */ - ctx->Buffer = buffer; /* Bind the frame buffer to the context */ - ctx->NewState = NEW_ALL; /* just to be safe */ - gl_update_state( ctx ); + if (newCtx && buffer) { + /* TODO: check if newCtx and buffer's visual match??? */ + newCtx->Buffer = buffer; /* Bind the frame buffer to the context */ + newCtx->NewState = NEW_ALL; /* just to be safe */ + gl_update_state( newCtx ); } } @@ -1575,7 +1536,7 @@ GLcontext *gl_get_current_context( void ) #ifdef THREADS return gl_get_thread_context(); #else - return CC; + return _mesa_current_context; #endif } @@ -1659,27 +1620,74 @@ void gl_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask ) } +/* + * This should be called by device drivers just before they do a + * swapbuffers. Any pending rendering commands will be executed. + */ +void +_mesa_swapbuffers(GLcontext *ctx) +{ + FLUSH_VB( ctx, "swap buffers" ); +} + /* - * Someday a GLS library or OpenGL-like debugger may call this function - * to register it's own set of API entry points. - * Input: ctx - the context to set API pointers for - * api - if NULL, restore original API pointers - * else, set API function table to this table. + * Return pointer to this context's current API dispatch table. + * It'll either be the immediate-mode execute dispatcher or the + * display list compile dispatcher. */ -void gl_set_api_table( GLcontext *ctx, const struct gl_api_table *api ) +struct _glapi_table * +_mesa_get_dispatch(GLcontext *ctx) +{ + return ctx->CurrentDispatch; +} + + + +void +_mesa_ResizeBuffersMESA( void ) { - if (api) { - MEMCPY( &ctx->API, api, sizeof(struct gl_api_table) ); + GET_CURRENT_CONTEXT(ctx); + + GLuint buf_width, buf_height; + + if (MESA_VERBOSE & VERBOSE_API) + fprintf(stderr, "glResizeBuffersMESA\n"); + + /* ask device driver for size of output buffer */ + (*ctx->Driver.GetBufferSize)( ctx, &buf_width, &buf_height ); + + /* see if size of device driver's color buffer (window) has changed */ + if (ctx->Buffer->Width == (GLint) buf_width && + ctx->Buffer->Height == (GLint) buf_height) + return; + + ctx->NewState |= NEW_RASTER_OPS; /* to update scissor / window bounds */ + + /* save buffer size */ + ctx->Buffer->Width = buf_width; + ctx->Buffer->Height = buf_height; + + /* Reallocate other buffers if needed. */ + if (ctx->Visual->DepthBits>0) { + /* reallocate depth buffer */ + (*ctx->Driver.AllocDepthBuffer)( ctx ); } - else { - MEMCPY( &ctx->API, &ctx->Exec, sizeof(struct gl_api_table) ); + if (ctx->Visual->StencilBits>0) { + /* reallocate stencil buffer */ + gl_alloc_stencil_buffer( ctx ); + } + if (ctx->Visual->AccumBits>0) { + /* reallocate accum buffer */ + gl_alloc_accum_buffer( ctx ); + } + if (ctx->Visual->SoftwareAlpha) { + gl_alloc_alpha_buffers( ctx ); } } - /**********************************************************************/ /***** Miscellaneous functions *****/ /**********************************************************************/ @@ -1801,66 +1809,6 @@ void gl_error( GLcontext *ctx, GLenum error, const char *s ) -/* - * Execute a glGetError command - */ -GLenum gl_GetError( GLcontext *ctx ) -{ - GLenum e = ctx->ErrorValue; - - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL( ctx, "glGetError", (GLenum) 0); - - if (MESA_VERBOSE & VERBOSE_API) - fprintf(stderr, "glGetError <-- %s\n", gl_lookup_enum_by_nr(e)); - - ctx->ErrorValue = (GLenum) GL_NO_ERROR; - return e; -} - - - -void gl_ResizeBuffersMESA( GLcontext *ctx ) -{ - GLuint buf_width, buf_height; - - if (MESA_VERBOSE & VERBOSE_API) - fprintf(stderr, "glResizeBuffersMESA\n"); - - /* ask device driver for size of output buffer */ - (*ctx->Driver.GetBufferSize)( ctx, &buf_width, &buf_height ); - - /* see if size of device driver's color buffer (window) has changed */ - if (ctx->Buffer->Width == (GLint) buf_width && - ctx->Buffer->Height == (GLint) buf_height) - return; - - ctx->NewState |= NEW_RASTER_OPS; /* to update scissor / window bounds */ - - /* save buffer size */ - ctx->Buffer->Width = buf_width; - ctx->Buffer->Height = buf_height; - - /* Reallocate other buffers if needed. */ - if (ctx->Visual->DepthBits>0) { - /* reallocate depth buffer */ - (*ctx->Driver.AllocDepthBuffer)( ctx ); - } - if (ctx->Visual->StencilBits>0) { - /* reallocate stencil buffer */ - gl_alloc_stencil_buffer( ctx ); - } - if (ctx->Visual->AccumBits>0) { - /* reallocate accum buffer */ - gl_alloc_accum_buffer( ctx ); - } - if (ctx->Visual->SoftwareAlpha) { - gl_alloc_alpha_buffers( ctx ); - } -} - - - - /**********************************************************************/ /***** State update logic *****/ /**********************************************************************/ diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index f136da42b2d..1da01fbb79b 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -1,8 +1,8 @@ -/* $Id: context.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: context.h,v 1.2 1999/11/11 01:22:25 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,9 +25,6 @@ */ - - - #ifndef CONTEXT_H #define CONTEXT_H @@ -35,18 +32,35 @@ #include "types.h" - #ifdef THREADS /* * A seperate GLcontext for each thread */ extern GLcontext *gl_get_thread_context( void ); + +#define GET_IMMEDIATE struct immediate *IM = (gl_get_thread_context())->input; +#define SET_IMMEDIATE(ctx, im) \ +do { \ + ctx->input = im; \ +} while (0) + + #else /* * All threads use same pointer to current context. */ - extern GLcontext *CC; + extern GLcontext *_mesa_current_context; extern struct immediate *CURRENT_INPUT; + #define GET_CURRENT_CONTEXT(C) GLcontext *C = _mesa_current_context + +#define GET_IMMEDIATE struct immediate *IM = CURRENT_INPUT +#define SET_IMMEDIATE(ctx, im) \ +do { \ + ctx->input = im; \ + CURRENT_INPUT = im; \ +} while (0) + + #endif @@ -124,14 +138,18 @@ extern GLcontext *gl_get_current_context(void); extern void gl_copy_context(const GLcontext *src, GLcontext *dst, GLuint mask); -extern void gl_set_api_table( GLcontext *ctx, const struct gl_api_table *api ); +extern void +_mesa_swapbuffers(GLcontext *ctx); + +extern struct _glapi_table * +_mesa_get_dispatch(GLcontext *ctx); /* * GL_MESA_resize_buffers extension */ -extern void gl_ResizeBuffersMESA( GLcontext *ctx ); +extern void _mesa_ResizeBuffersMESA( void ); @@ -146,8 +164,6 @@ extern void gl_warning( const GLcontext *ctx, const char *s ); extern void gl_error( GLcontext *ctx, GLenum error, const char *s ); extern void gl_compile_error( GLcontext *ctx, GLenum error, const char *s ); -extern GLenum gl_GetError( GLcontext *ctx ); - extern void gl_update_state( GLcontext *ctx ); diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c index e05f1f45eba..dcd84f58480 100644 --- a/src/mesa/main/depth.c +++ b/src/mesa/main/depth.c @@ -1,8 +1,8 @@ -/* $Id: depth.c,v 1.8 1999/11/08 07:36:43 brianp Exp $ */ +/* $Id: depth.c,v 1.9 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -24,28 +24,14 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -/* $XFree86: xc/lib/GL/mesa/src/depth.c,v 1.3 1999/04/04 00:20:22 dawes Exp $ */ - -/* - * Depth buffer functions - */ - -#include - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "enums.h" #include "depth.h" -#include "macros.h" +#include "mem.h" #include "types.h" #endif @@ -57,8 +43,10 @@ -void gl_ClearDepth( GLcontext* ctx, GLclampd depth ) +void +_mesa_ClearDepth( GLclampd depth ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClearDepth"); ctx->Depth.Clear = (GLfloat) CLAMP( depth, 0.0, 1.0 ); if (ctx->Driver.ClearDepth) @@ -67,8 +55,10 @@ void gl_ClearDepth( GLcontext* ctx, GLclampd depth ) -void gl_DepthFunc( GLcontext* ctx, GLenum func ) +void +_mesa_DepthFunc( GLenum func ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDepthFunc"); if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) @@ -108,8 +98,10 @@ void gl_DepthFunc( GLcontext* ctx, GLenum func ) -void gl_DepthMask( GLcontext* ctx, GLboolean flag ) +void +_mesa_DepthMask( GLboolean flag ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDepthMask"); if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) diff --git a/src/mesa/main/depth.h b/src/mesa/main/depth.h index 86706ee2147..9749905d2c4 100644 --- a/src/mesa/main/depth.h +++ b/src/mesa/main/depth.h @@ -1,9 +1,8 @@ - -/* $Id: depth.h,v 1.2 1999/10/08 09:27:10 keithw Exp $ */ +/* $Id: depth.h,v 1.3 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -26,9 +25,6 @@ */ - - - #ifndef DEPTH_H #define DEPTH_H @@ -90,10 +86,16 @@ extern void gl_alloc_depth_buffer( GLcontext* ctx ); extern void gl_clear_depth_buffer( GLcontext* ctx ); -extern void gl_ClearDepth( GLcontext* ctx, GLclampd depth ); -extern void gl_DepthFunc( GLcontext* ctx, GLenum func ); +extern void +_mesa_ClearDepth( GLclampd depth ); + +extern void +_mesa_DepthFunc( GLenum func ); + + +extern void +_mesa_DepthMask( GLboolean flag ); -extern void gl_DepthMask( GLcontext* ctx, GLboolean flag ); #endif diff --git a/src/mesa/main/dispatch.c b/src/mesa/main/dispatch.c new file mode 100644 index 00000000000..4aaa01559ed --- /dev/null +++ b/src/mesa/main/dispatch.c @@ -0,0 +1,546 @@ +/* $Id: dispatch.c,v 1.1 1999/11/11 01:22:26 brianp 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. + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include "glheader.h" +#include "accum.h" +#include "alpha.h" +#include "attrib.h" +#include "bitmap.h" +#include "blend.h" +#include "clip.h" +#include "context.h" +#include "colortab.h" +#include "copypix.h" +#include "cva.h" +#include "depth.h" +#include "dlist.h" +#include "drawpix.h" +#include "enable.h" +#include "eval.h" +#include "feedback.h" +#include "fog.h" +#include "get.h" +#include "glmisc.h" +#include "imaging.h" +#include "light.h" +#include "lines.h" +#include "logic.h" +#include "masking.h" +#include "matrix.h" +#include "pixel.h" +#include "points.h" +#include "polygon.h" +#include "rastpos.h" +#include "readpix.h" +#include "rect.h" +#include "scissor.h" +#include "stencil.h" +#include "teximage.h" +#include "texobj.h" +#include "texstate.h" +#include "types.h" +#include "varray.h" +#include "vbfill.h" +#include "winpos.h" +#endif + + +/* + * Initialize the given dispatch table with pointers to Mesa's + * immediate-mode commands. + */ +void +_mesa_init_exec_table(struct _glapi_table *exec) +{ + exec->Accum = _mesa_Accum; + exec->AlphaFunc = _mesa_AlphaFunc; + exec->Begin = _mesa_Begin; + exec->Bitmap = _mesa_Bitmap; + exec->BlendFunc = _mesa_BlendFunc; + exec->CallList = _mesa_CallList; + exec->CallLists = _mesa_CallLists; + exec->Clear = _mesa_Clear; + exec->ClearAccum = _mesa_ClearAccum; + exec->ClearColor = _mesa_ClearColor; + exec->ClearDepth = _mesa_ClearDepth; + exec->ClearIndex = _mesa_ClearIndex; + exec->ClearStencil = _mesa_ClearStencil; + exec->ClipPlane = _mesa_ClipPlane; + exec->Color3b = _mesa_Color3b; + exec->Color3bv = _mesa_Color3bv; + exec->Color3d = _mesa_Color3d; + exec->Color3dv = _mesa_Color3dv; + exec->Color3f = _mesa_Color3f; + exec->Color3fv = _mesa_Color3fv; + exec->Color3i = _mesa_Color3i; + exec->Color3iv = _mesa_Color3iv; + exec->Color3s = _mesa_Color3s; + exec->Color3sv = _mesa_Color3sv; + exec->Color3ub = _mesa_Color3ub; + exec->Color3ubv = _mesa_Color3ubv; + exec->Color3ui = _mesa_Color3ui; + exec->Color3uiv = _mesa_Color3uiv; + exec->Color3us = _mesa_Color3us; + exec->Color3usv = _mesa_Color3usv; + exec->Color4b = _mesa_Color4b; + exec->Color4bv = _mesa_Color4bv; + exec->Color4d = _mesa_Color4d; + exec->Color4dv = _mesa_Color4dv; + exec->Color4f = _mesa_Color4f; + exec->Color4fv = _mesa_Color4fv; + exec->Color4i = _mesa_Color4i; + exec->Color4iv = _mesa_Color4iv; + exec->Color4s = _mesa_Color4s; + exec->Color4sv = _mesa_Color4sv; + exec->Color4ub = _mesa_Color4ub; + exec->Color4ubv = _mesa_Color4ubv; + exec->Color4ui = _mesa_Color4ui; + exec->Color4uiv = _mesa_Color4uiv; + exec->Color4us = _mesa_Color4us; + exec->Color4usv = _mesa_Color4usv; + exec->ColorMask = _mesa_ColorMask; + exec->ColorMaterial = _mesa_ColorMaterial; + exec->CopyPixels = _mesa_CopyPixels; + exec->CullFace = _mesa_CullFace; + exec->DeleteLists = _mesa_DeleteLists; + exec->DepthFunc = _mesa_DepthFunc; + exec->DepthMask = _mesa_DepthMask; + exec->DepthRange = _mesa_DepthRange; + exec->Disable = _mesa_Disable; + exec->DrawBuffer = _mesa_DrawBuffer; + exec->DrawPixels = _mesa_DrawPixels; + exec->EdgeFlag = _mesa_EdgeFlag; + exec->EdgeFlagv = _mesa_EdgeFlagv; + exec->Enable = _mesa_Enable; + exec->End = _mesa_End; + exec->EndList = _mesa_EndList; + exec->EvalCoord1d = _mesa_EvalCoord1d; + exec->EvalCoord1dv = _mesa_EvalCoord1dv; + exec->EvalCoord1f = _mesa_EvalCoord1f; + exec->EvalCoord1fv = _mesa_EvalCoord1fv; + exec->EvalCoord2d = _mesa_EvalCoord2d; + exec->EvalCoord2dv = _mesa_EvalCoord2dv; + exec->EvalCoord2f = _mesa_EvalCoord2f; + exec->EvalCoord2fv = _mesa_EvalCoord2fv; + exec->EvalMesh1 = _mesa_EvalMesh1; + exec->EvalMesh2 = _mesa_EvalMesh2; + exec->EvalPoint1 = _mesa_EvalPoint1; + exec->EvalPoint2 = _mesa_EvalPoint2; + exec->FeedbackBuffer = _mesa_FeedbackBuffer; + exec->Finish = _mesa_Finish; + exec->Flush = _mesa_Flush; + exec->Fogf = _mesa_Fogf; + exec->Fogfv = _mesa_Fogfv; + exec->Fogi = _mesa_Fogi; + exec->Fogiv = _mesa_Fogiv; + exec->FrontFace = _mesa_FrontFace; + exec->Frustum = _mesa_Frustum; + exec->GenLists = _mesa_GenLists; + exec->GetBooleanv = _mesa_GetBooleanv; + exec->GetClipPlane = _mesa_GetClipPlane; + exec->GetDoublev = _mesa_GetDoublev; + exec->GetError = _mesa_GetError; + exec->GetFloatv = _mesa_GetFloatv; + exec->GetIntegerv = _mesa_GetIntegerv; + exec->GetLightfv = _mesa_GetLightfv; + exec->GetLightiv = _mesa_GetLightiv; + exec->GetMapdv = _mesa_GetMapdv; + exec->GetMapfv = _mesa_GetMapfv; + exec->GetMapiv = _mesa_GetMapiv; + exec->GetMaterialfv = _mesa_GetMaterialfv; + exec->GetMaterialiv = _mesa_GetMaterialiv; + exec->GetPixelMapfv = _mesa_GetPixelMapfv; + exec->GetPixelMapuiv = _mesa_GetPixelMapuiv; + exec->GetPixelMapusv = _mesa_GetPixelMapusv; + exec->GetPolygonStipple = _mesa_GetPolygonStipple; + exec->GetString = _mesa_GetString; + exec->GetTexEnvfv = _mesa_GetTexEnvfv; + exec->GetTexEnviv = _mesa_GetTexEnviv; + exec->GetTexGendv = _mesa_GetTexGendv; + exec->GetTexGenfv = _mesa_GetTexGenfv; + exec->GetTexGeniv = _mesa_GetTexGeniv; + exec->GetTexImage = _mesa_GetTexImage; + exec->GetTexLevelParameterfv = _mesa_GetTexLevelParameterfv; + exec->GetTexLevelParameteriv = _mesa_GetTexLevelParameteriv; + exec->GetTexParameterfv = _mesa_GetTexParameterfv; + exec->GetTexParameteriv = _mesa_GetTexParameteriv; + exec->Hint = _mesa_Hint; + exec->IndexMask = _mesa_IndexMask; + exec->Indexd = _mesa_Indexd; + exec->Indexdv = _mesa_Indexdv; + exec->Indexf = _mesa_Indexf; + exec->Indexfv = _mesa_Indexfv; + exec->Indexi = _mesa_Indexi; + exec->Indexiv = _mesa_Indexiv; + exec->Indexs = _mesa_Indexs; + exec->Indexsv = _mesa_Indexsv; + exec->InitNames = _mesa_InitNames; + exec->IsEnabled = _mesa_IsEnabled; + exec->IsList = _mesa_IsList; + exec->LightModelf = _mesa_LightModelf; + exec->LightModelfv = _mesa_LightModelfv; + exec->LightModeli = _mesa_LightModeli; + exec->LightModeliv = _mesa_LightModeliv; + exec->Lightf = _mesa_Lightf; + exec->Lightfv = _mesa_Lightfv; + exec->Lighti = _mesa_Lighti; + exec->Lightiv = _mesa_Lightiv; + exec->LineStipple = _mesa_LineStipple; + exec->LineWidth = _mesa_LineWidth; + exec->ListBase = _mesa_ListBase; + exec->LoadIdentity = _mesa_LoadIdentity; + exec->LoadMatrixd = _mesa_LoadMatrixd; + exec->LoadMatrixf = _mesa_LoadMatrixf; + exec->LoadName = _mesa_LoadName; + exec->LogicOp = _mesa_LogicOp; + exec->Map1d = _mesa_Map1d; + exec->Map1f = _mesa_Map1f; + exec->Map2d = _mesa_Map2d; + exec->Map2f = _mesa_Map2f; + exec->MapGrid1d = _mesa_MapGrid1d; + exec->MapGrid1f = _mesa_MapGrid1f; + exec->MapGrid2d = _mesa_MapGrid2d; + exec->MapGrid2f = _mesa_MapGrid2f; + exec->Materialf = _mesa_Materialf; + exec->Materialfv = _mesa_Materialfv; + exec->Materiali = _mesa_Materiali; + exec->Materialiv = _mesa_Materialiv; + exec->MatrixMode = _mesa_MatrixMode; + exec->MultMatrixd = _mesa_MultMatrixd; + exec->MultMatrixf = _mesa_MultMatrixf; + exec->NewList = _mesa_NewList; + exec->Normal3b = _mesa_Normal3b; + exec->Normal3bv = _mesa_Normal3bv; + exec->Normal3d = _mesa_Normal3d; + exec->Normal3dv = _mesa_Normal3dv; + exec->Normal3f = _mesa_Normal3f; + exec->Normal3fv = _mesa_Normal3fv; + exec->Normal3i = _mesa_Normal3i; + exec->Normal3iv = _mesa_Normal3iv; + exec->Normal3s = _mesa_Normal3s; + exec->Normal3sv = _mesa_Normal3sv; + exec->Ortho = _mesa_Ortho; + exec->PassThrough = _mesa_PassThrough; + exec->PixelMapfv = _mesa_PixelMapfv; + exec->PixelMapuiv = _mesa_PixelMapuiv; + exec->PixelMapusv = _mesa_PixelMapusv; + exec->PixelStoref = _mesa_PixelStoref; + exec->PixelStorei = _mesa_PixelStorei; + exec->PixelTransferf = _mesa_PixelTransferf; + exec->PixelTransferi = _mesa_PixelTransferi; + exec->PixelZoom = _mesa_PixelZoom; + exec->PointSize = _mesa_PointSize; + exec->PolygonMode = _mesa_PolygonMode; + exec->PolygonOffset = _mesa_PolygonOffset; + exec->PolygonStipple = _mesa_PolygonStipple; + exec->PopAttrib = _mesa_PopAttrib; + exec->PopMatrix = _mesa_PopMatrix; + exec->PopName = _mesa_PopName; + exec->PushAttrib = _mesa_PushAttrib; + exec->PushMatrix = _mesa_PushMatrix; + exec->PushName = _mesa_PushName; + exec->RasterPos2d = _mesa_RasterPos2d; + exec->RasterPos2dv = _mesa_RasterPos2dv; + exec->RasterPos2f = _mesa_RasterPos2f; + exec->RasterPos2fv = _mesa_RasterPos2fv; + exec->RasterPos2i = _mesa_RasterPos2i; + exec->RasterPos2iv = _mesa_RasterPos2iv; + exec->RasterPos2s = _mesa_RasterPos2s; + exec->RasterPos2sv = _mesa_RasterPos2sv; + exec->RasterPos3d = _mesa_RasterPos3d; + exec->RasterPos3dv = _mesa_RasterPos3dv; + exec->RasterPos3f = _mesa_RasterPos3f; + exec->RasterPos3fv = _mesa_RasterPos3fv; + exec->RasterPos3i = _mesa_RasterPos3i; + exec->RasterPos3iv = _mesa_RasterPos3iv; + exec->RasterPos3s = _mesa_RasterPos3s; + exec->RasterPos3sv = _mesa_RasterPos3sv; + exec->RasterPos4d = _mesa_RasterPos4d; + exec->RasterPos4dv = _mesa_RasterPos4dv; + exec->RasterPos4f = _mesa_RasterPos4f; + exec->RasterPos4fv = _mesa_RasterPos4fv; + exec->RasterPos4i = _mesa_RasterPos4i; + exec->RasterPos4iv = _mesa_RasterPos4iv; + exec->RasterPos4s = _mesa_RasterPos4s; + exec->RasterPos4sv = _mesa_RasterPos4sv; + exec->ReadBuffer = _mesa_ReadBuffer; + exec->ReadPixels = _mesa_ReadPixels; + exec->Rectd = _mesa_Rectd; + exec->Rectdv = _mesa_Rectdv; + exec->Rectf = _mesa_Rectf; + exec->Rectfv = _mesa_Rectfv; + exec->Recti = _mesa_Recti; + exec->Rectiv = _mesa_Rectiv; + exec->Rects = _mesa_Rects; + exec->Rectsv = _mesa_Rectsv; + exec->RenderMode = _mesa_RenderMode; + exec->Rotated = _mesa_Rotated; + exec->Rotatef = _mesa_Rotatef; + exec->Scaled = _mesa_Scaled; + exec->Scalef = _mesa_Scalef; + exec->Scissor = _mesa_Scissor; + exec->SelectBuffer = _mesa_SelectBuffer; + exec->ShadeModel = _mesa_ShadeModel; + exec->StencilFunc = _mesa_StencilFunc; + exec->StencilMask = _mesa_StencilMask; + exec->StencilOp = _mesa_StencilOp; + exec->TexCoord1d = _mesa_TexCoord1d; + exec->TexCoord1dv = _mesa_TexCoord1dv; + exec->TexCoord1f = _mesa_TexCoord1f; + exec->TexCoord1fv = _mesa_TexCoord1fv; + exec->TexCoord1i = _mesa_TexCoord1i; + exec->TexCoord1iv = _mesa_TexCoord1iv; + exec->TexCoord1s = _mesa_TexCoord1s; + exec->TexCoord1sv = _mesa_TexCoord1sv; + exec->TexCoord2d = _mesa_TexCoord2d; + exec->TexCoord2dv = _mesa_TexCoord2dv; + exec->TexCoord2f = _mesa_TexCoord2f; + exec->TexCoord2fv = _mesa_TexCoord2fv; + exec->TexCoord2i = _mesa_TexCoord2i; + exec->TexCoord2iv = _mesa_TexCoord2iv; + exec->TexCoord2s = _mesa_TexCoord2s; + exec->TexCoord2sv = _mesa_TexCoord2sv; + exec->TexCoord3d = _mesa_TexCoord3d; + exec->TexCoord3dv = _mesa_TexCoord3dv; + exec->TexCoord3f = _mesa_TexCoord3f; + exec->TexCoord3fv = _mesa_TexCoord3fv; + exec->TexCoord3i = _mesa_TexCoord3i; + exec->TexCoord3iv = _mesa_TexCoord3iv; + exec->TexCoord3s = _mesa_TexCoord3s; + exec->TexCoord3sv = _mesa_TexCoord3sv; + exec->TexCoord4d = _mesa_TexCoord4d; + exec->TexCoord4dv = _mesa_TexCoord4dv; + exec->TexCoord4f = _mesa_TexCoord4f; + exec->TexCoord4fv = _mesa_TexCoord4fv; + exec->TexCoord4i = _mesa_TexCoord4i; + exec->TexCoord4iv = _mesa_TexCoord4iv; + exec->TexCoord4s = _mesa_TexCoord4s; + exec->TexCoord4sv = _mesa_TexCoord4sv; + exec->TexEnvf = _mesa_TexEnvf; + exec->TexEnvfv = _mesa_TexEnvfv; + exec->TexEnvi = _mesa_TexEnvi; + exec->TexEnviv = _mesa_TexEnviv; + exec->TexGend = _mesa_TexGend; + exec->TexGendv = _mesa_TexGendv; + exec->TexGenf = _mesa_TexGenf; + exec->TexGenfv = _mesa_TexGenfv; + exec->TexGeni = _mesa_TexGeni; + exec->TexGeniv = _mesa_TexGeniv; + exec->TexImage1D = _mesa_TexImage1D; + exec->TexImage2D = _mesa_TexImage2D; + exec->TexParameterf = _mesa_TexParameterf; + exec->TexParameterfv = _mesa_TexParameterfv; + exec->TexParameteri = _mesa_TexParameteri; + exec->TexParameteriv = _mesa_TexParameteriv; + exec->Translated = _mesa_Translated; + exec->Translatef = _mesa_Translatef; + exec->Vertex2d = _mesa_Vertex2d; + exec->Vertex2dv = _mesa_Vertex2dv; + exec->Vertex2f = _mesa_Vertex2f; + exec->Vertex2fv = _mesa_Vertex2fv; + exec->Vertex2i = _mesa_Vertex2i; + exec->Vertex2iv = _mesa_Vertex2iv; + exec->Vertex2s = _mesa_Vertex2s; + exec->Vertex2sv = _mesa_Vertex2sv; + exec->Vertex3d = _mesa_Vertex3d; + exec->Vertex3dv = _mesa_Vertex3dv; + exec->Vertex3f = _mesa_Vertex3f; + exec->Vertex3fv = _mesa_Vertex3fv; + exec->Vertex3i = _mesa_Vertex3i; + exec->Vertex3iv = _mesa_Vertex3iv; + exec->Vertex3s = _mesa_Vertex3s; + exec->Vertex3sv = _mesa_Vertex3sv; + exec->Vertex4d = _mesa_Vertex4d; + exec->Vertex4dv = _mesa_Vertex4dv; + exec->Vertex4f = _mesa_Vertex4f; + exec->Vertex4fv = _mesa_Vertex4fv; + exec->Vertex4i = _mesa_Vertex4i; + exec->Vertex4iv = _mesa_Vertex4iv; + exec->Vertex4s = _mesa_Vertex4s; + exec->Vertex4sv = _mesa_Vertex4sv; + exec->Viewport = _mesa_Viewport; + +#ifdef _GLAPI_VERSION_1_1 + exec->AreTexturesResident = _mesa_AreTexturesResident; + exec->ArrayElement = _mesa_ArrayElement; + exec->BindTexture = _mesa_BindTexture; + exec->ColorPointer = _mesa_ColorPointer; + exec->CopyTexImage1D = _mesa_CopyTexImage1D; + exec->CopyTexImage2D = _mesa_CopyTexImage2D; + exec->CopyTexSubImage1D = _mesa_CopyTexSubImage1D; + exec->CopyTexSubImage2D = _mesa_CopyTexSubImage2D; + exec->DeleteTextures = _mesa_DeleteTextures; + exec->DisableClientState = _mesa_DisableClientState; + exec->DrawArrays = _mesa_DrawArrays; + exec->DrawElements = _mesa_DrawElements; + exec->EdgeFlagPointer = _mesa_EdgeFlagPointer; + exec->EnableClientState = _mesa_EnableClientState; + exec->GenTextures = _mesa_GenTextures; + exec->GetPointerv = _mesa_GetPointerv; + exec->IndexPointer = _mesa_IndexPointer; + exec->Indexub = _mesa_Indexub; + exec->Indexubv = _mesa_Indexubv; + exec->InterleavedArrays = _mesa_InterleavedArrays; + exec->IsTexture = _mesa_IsTexture; + exec->NormalPointer = _mesa_NormalPointer; + exec->PopClientAttrib = _mesa_PopClientAttrib; + exec->PrioritizeTextures = _mesa_PrioritizeTextures; + exec->PushClientAttrib = _mesa_PushClientAttrib; + exec->TexCoordPointer = _mesa_TexCoordPointer; + exec->TexSubImage1D = _mesa_TexSubImage1D; + exec->TexSubImage2D = _mesa_TexSubImage2D; + exec->VertexPointer = _mesa_VertexPointer; +#endif + +#ifdef _GLAPI_VERSION_1_2 + exec->CopyTexSubImage3D = _mesa_CopyTexSubImage3D; + exec->DrawRangeElements = _mesa_DrawRangeElements; + exec->TexImage3D = _mesa_TexImage3D; + exec->TexSubImage3D = _mesa_TexSubImage3D; +#endif + + /* OpenGL 1.2 GL_ARB_imaging */ +#ifdef _GLAPI_ARB_imaging + exec->BlendColor = _mesa_BlendColor; + exec->BlendEquation = _mesa_BlendEquation; + exec->ColorSubTable = _mesa_ColorSubTable; + exec->ColorTable = _mesa_ColorTable; + exec->ColorTableParameterfv = _mesa_ColorTableParameterfv; + exec->ColorTableParameteriv = _mesa_ColorTableParameteriv; + exec->ConvolutionFilter1D = _mesa_ConvolutionFilter1D; + exec->ConvolutionFilter2D = _mesa_ConvolutionFilter2D; + exec->ConvolutionParameterf = _mesa_ConvolutionParameterf; + exec->ConvolutionParameterfv = _mesa_ConvolutionParameterfv; + exec->ConvolutionParameteri = _mesa_ConvolutionParameteri; + exec->ConvolutionParameteriv = _mesa_ConvolutionParameteriv; + exec->CopyColorSubTable = _mesa_CopyColorSubTable; + exec->CopyColorTable = _mesa_CopyColorTable; + exec->CopyConvolutionFilter1D = _mesa_CopyConvolutionFilter1D; + exec->CopyConvolutionFilter2D = _mesa_CopyConvolutionFilter2D; + exec->GetColorTable = _mesa_GetColorTable; + exec->GetColorTableParameterfv = _mesa_GetColorTableParameterfv; + exec->GetColorTableParameteriv = _mesa_GetColorTableParameteriv; + exec->GetConvolutionFilter = _mesa_GetConvolutionFilter; + exec->GetConvolutionParameterfv = _mesa_GetConvolutionParameterfv; + exec->GetConvolutionParameteriv = _mesa_GetConvolutionParameteriv; + exec->GetHistogram = _mesa_GetHistogram; + exec->GetHistogramParameterfv = _mesa_GetHistogramParameterfv; + exec->GetHistogramParameteriv = _mesa_GetHistogramParameteriv; + exec->GetMinmax = _mesa_GetMinmax; + exec->GetMinmaxParameterfv = _mesa_GetMinmaxParameterfv; + exec->GetMinmaxParameteriv = _mesa_GetMinmaxParameteriv; + exec->GetSeparableFilter = _mesa_GetSeparableFilter; + exec->Histogram = _mesa_Histogram; + exec->Minmax = _mesa_Minmax; + exec->ResetHistogram = _mesa_ResetHistogram; + exec->ResetMinmax = _mesa_ResetMinmax; + exec->SeparableFilter2D = _mesa_SeparableFilter2D; +#endif + +#ifdef _GLAPI_EXT_color_table + exec->ColorTableEXT = _mesa_ColorTable; + exec->ColorSubTableEXT = _mesa_ColorSubTable; + exec->GetColorTableEXT = _mesa_GetColorTable; + exec->GetColorTableParameterfvEXT = _mesa_GetColorTableParameterfv; + exec->GetColorTableParameterivEXT = _mesa_GetColorTableParameteriv; +#endif + +#ifdef _GLAPI_EXT_compiled_vertex_array + exec->LockArraysEXT = _mesa_LockArraysEXT; + exec->UnlockArraysEXT = _mesa_UnlockArraysEXT; +#endif + +#ifdef _GLAPI_EXT_point_parameters + exec->PointParameterfEXT = _mesa_PointParameterfEXT; + exec->PointParameterfvEXT = _mesa_PointParameterfvEXT; +#endif + +#ifdef _GLAPI_EXT_polygon_offset + exec->PolygonOffsetEXT = _mesa_PolygonOffsetEXT; +#endif + +#ifdef _GLAPI_EXT_blend_minmax + exec->BlendEquationEXT = _mesa_BlendEquationEXT; +#endif + +#ifdef _GLAPI_EXT_blend_color + exec->BlendColorEXT = _mesa_BlendColorEXT; +#endif + +#ifdef _GLAPI_ARB_multitexture + exec->ActiveTextureARB = _mesa_ActiveTextureARB; + exec->ClientActiveTextureARB = _mesa_ClientActiveTextureARB; + exec->MultiTexCoord1dARB = _mesa_MultiTexCoord1dARB; + exec->MultiTexCoord1dvARB = _mesa_MultiTexCoord1dvARB; + exec->MultiTexCoord1fARB = _mesa_MultiTexCoord1fARB; + exec->MultiTexCoord1fvARB = _mesa_MultiTexCoord1fvARB; + exec->MultiTexCoord1iARB = _mesa_MultiTexCoord1iARB; + exec->MultiTexCoord1ivARB = _mesa_MultiTexCoord1ivARB; + exec->MultiTexCoord1sARB = _mesa_MultiTexCoord1sARB; + exec->MultiTexCoord1svARB = _mesa_MultiTexCoord1svARB; + exec->MultiTexCoord2dARB = _mesa_MultiTexCoord2dARB; + exec->MultiTexCoord2dvARB = _mesa_MultiTexCoord2dvARB; + exec->MultiTexCoord2fARB = _mesa_MultiTexCoord2fARB; + exec->MultiTexCoord2fvARB = _mesa_MultiTexCoord2fvARB; + exec->MultiTexCoord2iARB = _mesa_MultiTexCoord2iARB; + exec->MultiTexCoord2ivARB = _mesa_MultiTexCoord2ivARB; + exec->MultiTexCoord2sARB = _mesa_MultiTexCoord2sARB; + exec->MultiTexCoord2svARB = _mesa_MultiTexCoord2svARB; + exec->MultiTexCoord3dARB = _mesa_MultiTexCoord3dARB; + exec->MultiTexCoord3dvARB = _mesa_MultiTexCoord3dvARB; + exec->MultiTexCoord3fARB = _mesa_MultiTexCoord3fARB; + exec->MultiTexCoord3fvARB = _mesa_MultiTexCoord3fvARB; + exec->MultiTexCoord3iARB = _mesa_MultiTexCoord3iARB; + exec->MultiTexCoord3ivARB = _mesa_MultiTexCoord3ivARB; + exec->MultiTexCoord3sARB = _mesa_MultiTexCoord3sARB; + exec->MultiTexCoord3svARB = _mesa_MultiTexCoord3svARB; + exec->MultiTexCoord4dARB = _mesa_MultiTexCoord4dARB; + exec->MultiTexCoord4dvARB = _mesa_MultiTexCoord4dvARB; + exec->MultiTexCoord4fARB = _mesa_MultiTexCoord4fARB; + exec->MultiTexCoord4fvARB = _mesa_MultiTexCoord4fvARB; + exec->MultiTexCoord4iARB = _mesa_MultiTexCoord4iARB; + exec->MultiTexCoord4ivARB = _mesa_MultiTexCoord4ivARB; + exec->MultiTexCoord4sARB = _mesa_MultiTexCoord4sARB; + exec->MultiTexCoord4svARB = _mesa_MultiTexCoord4svARB; +#endif + +#ifdef _GLAPI_INGR_blend_func_separate + exec->BlendFuncSeparateINGR = _mesa_BlendFuncSeparateINGR; +#endif + +#ifdef _GLAPI_MESA_window_pos + exec->WindowPos4fMESA = _mesa_WindowPos4fMESA; +#endif + +#ifdef _GLAPI_MESA_resize_buffers + exec->ResizeBuffersMESA = _mesa_ResizeBuffersMESA; +#endif +} + diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index c3d3167f618..5e8c203d886 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -1,8 +1,8 @@ -/* $Id: dlist.c,v 1.15 1999/11/09 17:00:25 keithw Exp $ */ +/* $Id: dlist.c,v 1.16 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,21 +25,11 @@ */ -/* $XFree86: xc/lib/GL/mesa/src/dlist.c,v 1.3 1999/04/04 00:20:22 dawes Exp $ */ - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "accum.h" -#include "api.h" #include "alpha.h" #include "attrib.h" #include "bitmap.h" @@ -49,6 +39,7 @@ #include "colortab.h" #include "context.h" #include "copypix.h" +#include "cva.h" #include "depth.h" #include "drawpix.h" #include "enable.h" @@ -61,6 +52,7 @@ #include "glmisc.h" #include "hash.h" #include "image.h" +#include "imaging.h" #include "light.h" #include "lines.h" #include "dlist.h" @@ -68,6 +60,7 @@ #include "macros.h" #include "masking.h" #include "matrix.h" +#include "mem.h" #include "pipeline.h" #include "pixel.h" #include "points.h" @@ -159,7 +152,6 @@ typedef enum { OPCODE_COPY_PIXELS, OPCODE_COPY_TEX_IMAGE1D, OPCODE_COPY_TEX_IMAGE2D, - OPCODE_COPY_TEX_IMAGE3D, OPCODE_COPY_TEX_SUB_IMAGE1D, OPCODE_COPY_TEX_SUB_IMAGE2D, OPCODE_COPY_TEX_SUB_IMAGE3D, @@ -357,27 +349,27 @@ void gl_destroy_list( GLcontext *ctx, GLuint list ) n += InstSize[n[0].opcode]; break; case OPCODE_MAP1: - gl_free_control_points( ctx, n[1].e, (GLfloat *) n[6].data ); + FREE(n[6].data); n += InstSize[n[0].opcode]; break; case OPCODE_MAP2: - gl_free_control_points( ctx, n[1].e, (GLfloat *) n[10].data ); + FREE(n[10].data); n += InstSize[n[0].opcode]; break; case OPCODE_DRAW_PIXELS: - gl_free_image( (struct gl_image *) n[1].data ); + FREE( n[5].data ); n += InstSize[n[0].opcode]; break; case OPCODE_BITMAP: - gl_free_image( (struct gl_image *) n[7].data ); + FREE( n[7].data ); n += InstSize[n[0].opcode]; break; case OPCODE_COLOR_TABLE: - gl_free_image( (struct gl_image *) n[3].data ); + FREE( n[6].data ); n += InstSize[n[0].opcode]; break; case OPCODE_COLOR_SUB_TABLE: - gl_free_image( (struct gl_image *) n[3].data ); + FREE( n[6].data ); n += InstSize[n[0].opcode]; break; case OPCODE_POLYGON_STIPPLE: @@ -385,27 +377,27 @@ void gl_destroy_list( GLcontext *ctx, GLuint list ) n += InstSize[n[0].opcode]; break; case OPCODE_TEX_IMAGE1D: - FREE( n[8]. data ); + FREE(n[8].data); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_IMAGE2D: - FREE( n[9].data ); + FREE( n[9]. data ); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_IMAGE3D: - FREE( n[10].data ); + FREE( n[10]. data ); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_SUB_IMAGE1D: - FREE( n[7].data ); + FREE(n[7].data); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_SUB_IMAGE2D: - FREE( n[9].data ); + FREE(n[9].data); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_SUB_IMAGE3D: - FREE( n[11].data ); + FREE(n[11].data); n += InstSize[n[0].opcode]; break; case OPCODE_CONTINUE: @@ -514,8 +506,8 @@ void gl_init_lists( void ) InstSize[OPCODE_CLIP_PLANE] = 6; InstSize[OPCODE_COLOR_MASK] = 5; InstSize[OPCODE_COLOR_MATERIAL] = 3; - InstSize[OPCODE_COLOR_TABLE] = 4; - InstSize[OPCODE_COLOR_SUB_TABLE] = 4; + InstSize[OPCODE_COLOR_TABLE] = 7; + InstSize[OPCODE_COLOR_SUB_TABLE] = 7; InstSize[OPCODE_COPY_PIXELS] = 6; InstSize[OPCODE_COPY_TEX_IMAGE1D] = 8; InstSize[OPCODE_COPY_TEX_IMAGE2D] = 9; @@ -528,7 +520,7 @@ void gl_init_lists( void ) InstSize[OPCODE_DEPTH_RANGE] = 3; InstSize[OPCODE_DISABLE] = 2; InstSize[OPCODE_DRAW_BUFFER] = 2; - InstSize[OPCODE_DRAW_PIXELS] = 2; + InstSize[OPCODE_DRAW_PIXELS] = 6; InstSize[OPCODE_ENABLE] = 2; InstSize[OPCODE_EVALCOORD1] = 2; InstSize[OPCODE_EVALCOORD2] = 3; @@ -613,8 +605,9 @@ void gl_init_lists( void ) -static void save_Accum( GLcontext *ctx, GLenum op, GLfloat value ) +static void save_Accum( GLenum op, GLfloat value ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_ACCUM, 2 ); @@ -623,13 +616,14 @@ static void save_Accum( GLcontext *ctx, GLenum op, GLfloat value ) n[2].f = value; } if (ctx->ExecuteFlag) { - (*ctx->Exec.Accum)( ctx, op, value ); + (*ctx->Exec.Accum)( op, value ); } } -static void save_AlphaFunc( GLcontext *ctx, GLenum func, GLclampf ref ) +static void save_AlphaFunc( GLenum func, GLclampf ref ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_ALPHA_FUNC, 2 ); @@ -638,12 +632,20 @@ static void save_AlphaFunc( GLcontext *ctx, GLenum func, GLclampf ref ) n[2].f = (GLfloat) ref; } if (ctx->ExecuteFlag) { - (*ctx->Exec.AlphaFunc)( ctx, func, ref ); + (*ctx->Exec.AlphaFunc)( func, ref ); } } -static void save_BindTexture( GLcontext *ctx, GLenum target, GLuint texture ) + +static void save_Begin( GLenum mode ) +{ + _mesa_Begin(mode); /* special case */ +} + + +static void save_BindTexture( GLenum target, GLuint texture ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_BIND_TEXTURE, 2 ); @@ -652,44 +654,43 @@ static void save_BindTexture( GLcontext *ctx, GLenum target, GLuint texture ) n[2].ui = texture; } if (ctx->ExecuteFlag) { - (*ctx->Exec.BindTexture)( ctx, target, texture ); + (*ctx->Exec.BindTexture)( target, texture ); } } -static void save_Bitmap( GLcontext *ctx, - GLsizei width, GLsizei height, +static void save_Bitmap( GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, - const GLubyte *bitmap, - const struct gl_pixelstore_attrib *packing ) + const GLubyte *pixels ) { + GET_CURRENT_CONTEXT(ctx); + GLvoid *image = _mesa_unpack_bitmap( width, height, pixels, &ctx->Unpack ); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_BITMAP, 7 ); if (n) { - struct gl_image *image = gl_unpack_bitmap( ctx, width, height, - bitmap, packing ); - if (image) { - image->RefCount = 1; - } n[1].i = (GLint) width; n[2].i = (GLint) height; n[3].f = xorig; n[4].f = yorig; n[5].f = xmove; n[6].f = ymove; - n[7].data = (void *) image; + n[7].data = image; + } + else if (image) { + FREE(image); } if (ctx->ExecuteFlag) { - (*ctx->Exec.Bitmap)( ctx, width, height, - xorig, yorig, xmove, ymove, bitmap, packing ); + (*ctx->Exec.Bitmap)( width, height, + xorig, yorig, xmove, ymove, pixels ); } } -static void save_BlendEquation( GLcontext *ctx, GLenum mode ) +static void save_BlendEquation( GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_BLEND_EQUATION, 1 ); @@ -697,13 +698,14 @@ static void save_BlendEquation( GLcontext *ctx, GLenum mode ) n[1].e = mode; } if (ctx->ExecuteFlag) { - (*ctx->Exec.BlendEquation)( ctx, mode ); + (*ctx->Exec.BlendEquationEXT)( mode ); } } -static void save_BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor ) +static void save_BlendFunc( GLenum sfactor, GLenum dfactor ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_BLEND_FUNC, 2 ); @@ -712,15 +714,15 @@ static void save_BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor ) n[2].e = dfactor; } if (ctx->ExecuteFlag) { - (*ctx->Exec.BlendFunc)( ctx, sfactor, dfactor ); + (*ctx->Exec.BlendFunc)( sfactor, dfactor ); } } -static void save_BlendFuncSeparate( GLcontext *ctx, - GLenum sfactorRGB, GLenum dfactorRGB, - GLenum sfactorA, GLenum dfactorA) +static void save_BlendFuncSeparateINGR(GLenum sfactorRGB, GLenum dfactorRGB, + GLenum sfactorA, GLenum dfactorA) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_BLEND_FUNC_SEPARATE, 4 ); @@ -731,15 +733,16 @@ static void save_BlendFuncSeparate( GLcontext *ctx, n[4].e = dfactorA; } if (ctx->ExecuteFlag) { - (*ctx->Exec.BlendFuncSeparate)( ctx, sfactorRGB, dfactorRGB, - sfactorA, dfactorA); + (*ctx->Exec.BlendFuncSeparateINGR)( sfactorRGB, dfactorRGB, + sfactorA, dfactorA); } } -static void save_BlendColor( GLcontext *ctx, GLfloat red, GLfloat green, - GLfloat blue, GLfloat alpha ) +static void save_BlendColor( GLfloat red, GLfloat green, + GLfloat blue, GLfloat alpha ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_BLEND_COLOR, 4 ); @@ -750,13 +753,14 @@ static void save_BlendColor( GLcontext *ctx, GLfloat red, GLfloat green, n[4].f = alpha; } if (ctx->ExecuteFlag) { - (*ctx->Exec.BlendColor)( ctx, red, green, blue, alpha ); + (*ctx->Exec.BlendColorEXT)( red, green, blue, alpha ); } } -static void save_CallList( GLcontext *ctx, GLuint list ) +static void save_CallList( GLuint list ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_CALL_LIST, 1 ); @@ -764,14 +768,14 @@ static void save_CallList( GLcontext *ctx, GLuint list ) n[1].ui = list; } if (ctx->ExecuteFlag) { - (*ctx->Exec.CallList)( ctx, list ); + (*ctx->Exec.CallList)( list ); } } -static void save_CallLists( GLcontext *ctx, - GLsizei n, GLenum type, const GLvoid *lists ) +static void save_CallLists( GLsizei n, GLenum type, const GLvoid *lists ) { + GET_CURRENT_CONTEXT(ctx); GLint i; FLUSH_VB(ctx, "dlist"); @@ -783,13 +787,14 @@ static void save_CallLists( GLcontext *ctx, } } if (ctx->ExecuteFlag) { - (*ctx->Exec.CallLists)( ctx, n, type, lists ); + (*ctx->Exec.CallLists)( n, type, lists ); } } -static void save_Clear( GLcontext *ctx, GLbitfield mask ) +static void save_Clear( GLbitfield mask ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_CLEAR, 1 ); @@ -797,14 +802,15 @@ static void save_Clear( GLcontext *ctx, GLbitfield mask ) n[1].bf = mask; } if (ctx->ExecuteFlag) { - (*ctx->Exec.Clear)( ctx, mask ); + (*ctx->Exec.Clear)( mask ); } } -static void save_ClearAccum( GLcontext *ctx, GLfloat red, GLfloat green, - GLfloat blue, GLfloat alpha ) +static void save_ClearAccum( GLfloat red, GLfloat green, + GLfloat blue, GLfloat alpha ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_CLEAR_ACCUM, 4 ); @@ -815,14 +821,15 @@ static void save_ClearAccum( GLcontext *ctx, GLfloat red, GLfloat green, n[4].f = alpha; } if (ctx->ExecuteFlag) { - (*ctx->Exec.ClearAccum)( ctx, red, green, blue, alpha ); + (*ctx->Exec.ClearAccum)( red, green, blue, alpha ); } } -static void save_ClearColor( GLcontext *ctx, GLclampf red, GLclampf green, - GLclampf blue, GLclampf alpha ) +static void save_ClearColor( GLclampf red, GLclampf green, + GLclampf blue, GLclampf alpha ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_CLEAR_COLOR, 4 ); @@ -833,13 +840,14 @@ static void save_ClearColor( GLcontext *ctx, GLclampf red, GLclampf green, n[4].f = alpha; } if (ctx->ExecuteFlag) { - (*ctx->Exec.ClearColor)( ctx, red, green, blue, alpha ); + (*ctx->Exec.ClearColor)( red, green, blue, alpha ); } } -static void save_ClearDepth( GLcontext *ctx, GLclampd depth ) +static void save_ClearDepth( GLclampd depth ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_CLEAR_DEPTH, 1 ); @@ -847,13 +855,14 @@ static void save_ClearDepth( GLcontext *ctx, GLclampd depth ) n[1].f = (GLfloat) depth; } if (ctx->ExecuteFlag) { - (*ctx->Exec.ClearDepth)( ctx, depth ); + (*ctx->Exec.ClearDepth)( depth ); } } -static void save_ClearIndex( GLcontext *ctx, GLfloat c ) +static void save_ClearIndex( GLfloat c ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_CLEAR_INDEX, 1 ); @@ -861,13 +870,14 @@ static void save_ClearIndex( GLcontext *ctx, GLfloat c ) n[1].f = c; } if (ctx->ExecuteFlag) { - (*ctx->Exec.ClearIndex)( ctx, c ); + (*ctx->Exec.ClearIndex)( c ); } } -static void save_ClearStencil( GLcontext *ctx, GLint s ) +static void save_ClearStencil( GLint s ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_CLEAR_STENCIL, 1 ); @@ -875,13 +885,14 @@ static void save_ClearStencil( GLcontext *ctx, GLint s ) n[1].i = s; } if (ctx->ExecuteFlag) { - (*ctx->Exec.ClearStencil)( ctx, s ); + (*ctx->Exec.ClearStencil)( s ); } } -static void save_ClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *equ ) +static void save_ClipPlane( GLenum plane, const GLdouble *equ ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_CLIP_PLANE, 5 ); @@ -893,15 +904,16 @@ static void save_ClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *equ ) n[5].f = equ[3]; } if (ctx->ExecuteFlag) { - (*ctx->Exec.ClipPlane)( ctx, plane, equ ); + (*ctx->Exec.ClipPlane)( plane, equ ); } } -static void save_ColorMask( GLcontext *ctx, GLboolean red, GLboolean green, - GLboolean blue, GLboolean alpha ) +static void save_ColorMask( GLboolean red, GLboolean green, + GLboolean blue, GLboolean alpha ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_COLOR_MASK, 4 ); @@ -912,13 +924,14 @@ static void save_ColorMask( GLcontext *ctx, GLboolean red, GLboolean green, n[4].b = alpha; } if (ctx->ExecuteFlag) { - (*ctx->Exec.ColorMask)( ctx, red, green, blue, alpha ); + (*ctx->Exec.ColorMask)( red, green, blue, alpha ); } } -static void save_ColorMaterial( GLcontext *ctx, GLenum face, GLenum mode ) +static void save_ColorMaterial( GLenum face, GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_COLOR_MATERIAL, 2 ); @@ -927,57 +940,80 @@ static void save_ColorMaterial( GLcontext *ctx, GLenum face, GLenum mode ) n[2].e = mode; } if (ctx->ExecuteFlag) { - (*ctx->Exec.ColorMaterial)( ctx, face, mode ); + (*ctx->Exec.ColorMaterial)( face, mode ); } } -static void save_ColorTable( GLcontext *ctx, GLenum target, GLenum internalFormat, - struct gl_image *table ) +static void save_ColorTable( GLenum target, GLenum internalFormat, + GLsizei width, GLenum format, GLenum type, + const GLvoid *table ) { - Node *n; - FLUSH_VB(ctx, "dlist"); - n = alloc_instruction( ctx, OPCODE_COLOR_TABLE, 3 ); - if (n) { - n[1].e = target; - n[2].e = internalFormat; - n[3].data = (GLvoid *) table; - if (table) { - /* must retain this image */ - table->RefCount = 1; - } + GET_CURRENT_CONTEXT(ctx); + if (target == GL_PROXY_TEXTURE_1D || + target == GL_PROXY_TEXTURE_2D || + target == GL_PROXY_TEXTURE_3D) { + /* execute immediately */ + (*ctx->Exec.ColorTableEXT)( target, internalFormat, width, + format, type, table ); } - if (ctx->ExecuteFlag) { - (*ctx->Exec.ColorTable)( ctx, target, internalFormat, table ); + else { + GLvoid *image = _mesa_unpack_image(width, 1, 1, format, type, table, + &ctx->Unpack); + Node *n; + FLUSH_VB(ctx, "dlist"); + n = alloc_instruction( ctx, OPCODE_COLOR_TABLE, 6 ); + if (n) { + n[1].e = target; + n[2].e = internalFormat; + n[3].i = width; + n[4].e = format; + n[5].e = type; + n[6].data = image; + } + else if (image) { + FREE(image); + } + if (ctx->ExecuteFlag) { + (*ctx->Exec.ColorTableEXT)( target, internalFormat, width, + format, type, table ); + } } } -static void save_ColorSubTable( GLcontext *ctx, GLenum target, - GLsizei start, struct gl_image *data ) +static void save_ColorSubTable( GLenum target, GLsizei start, GLsizei count, + GLenum format, GLenum type, + const GLvoid *table) { + GET_CURRENT_CONTEXT(ctx); + GLvoid *image = _mesa_unpack_image(count, 1, 1, format, type, table, + &ctx->Unpack); Node *n; FLUSH_VB(ctx, "dlist"); - n = alloc_instruction( ctx, OPCODE_COLOR_SUB_TABLE, 3 ); + n = alloc_instruction( ctx, OPCODE_COLOR_SUB_TABLE, 6 ); if (n) { n[1].e = target; n[2].i = start; - n[3].data = (GLvoid *) data; - if (data) { - /* must retain this image */ - data->RefCount = 1; - } + n[3].i = count; + n[4].e = format; + n[5].e = type; + n[6].data = image; + } + else if (image) { + FREE(image); } if (ctx->ExecuteFlag) { - (*ctx->Exec.ColorSubTable)( ctx, target, start, data ); + (*ctx->Exec.ColorSubTableEXT)(target, start, count, format, type, table); } } -static void save_CopyPixels( GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height, GLenum type ) +static void save_CopyPixels( GLint x, GLint y, + GLsizei width, GLsizei height, GLenum type ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_COPY_PIXELS, 5 ); @@ -989,18 +1025,17 @@ static void save_CopyPixels( GLcontext *ctx, GLint x, GLint y, n[5].e = type; } if (ctx->ExecuteFlag) { - (*ctx->Exec.CopyPixels)( ctx, x, y, width, height, type ); + (*ctx->Exec.CopyPixels)( x, y, width, height, type ); } } -static void save_CopyTexImage1D( GLcontext *ctx, - GLenum target, GLint level, - GLenum internalformat, - GLint x, GLint y, GLsizei width, - GLint border ) +static void +save_CopyTexImage1D( GLenum target, GLint level, GLenum internalformat, + GLint x, GLint y, GLsizei width, GLint border ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_COPY_TEX_IMAGE1D, 7 ); @@ -1014,18 +1049,19 @@ static void save_CopyTexImage1D( GLcontext *ctx, n[7].i = border; } if (ctx->ExecuteFlag) { - (*ctx->Exec.CopyTexImage1D)( ctx, target, level, internalformat, - x, y, width, border ); + (*ctx->Exec.CopyTexImage1D)( target, level, internalformat, + x, y, width, border ); } } -static void save_CopyTexImage2D( GLcontext *ctx, - GLenum target, GLint level, - GLenum internalformat, - GLint x, GLint y, GLsizei width, - GLsizei height, GLint border ) +static void +save_CopyTexImage2D( GLenum target, GLint level, + GLenum internalformat, + GLint x, GLint y, GLsizei width, + GLsizei height, GLint border ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_COPY_TEX_IMAGE2D, 8 ); @@ -1040,18 +1076,19 @@ static void save_CopyTexImage2D( GLcontext *ctx, n[8].i = border; } if (ctx->ExecuteFlag) { - (*ctx->Exec.CopyTexImage2D)( ctx, target, level, internalformat, - x, y, width, height, border ); + (*ctx->Exec.CopyTexImage2D)( target, level, internalformat, + x, y, width, height, border ); } } -static void save_CopyTexSubImage1D( GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, - GLsizei width ) +static void +save_CopyTexSubImage1D( GLenum target, GLint level, + GLint xoffset, GLint x, GLint y, + GLsizei width ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_COPY_TEX_SUB_IMAGE1D, 6 ); @@ -1064,17 +1101,18 @@ static void save_CopyTexSubImage1D( GLcontext *ctx, n[6].i = width; } if (ctx->ExecuteFlag) { - (*ctx->Exec.CopyTexSubImage1D)( ctx, target, level, xoffset, x, y, width ); + (*ctx->Exec.CopyTexSubImage1D)( target, level, xoffset, x, y, width ); } } -static void save_CopyTexSubImage2D( GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, - GLsizei width, GLint height ) +static void +save_CopyTexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, + GLsizei width, GLint height ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_COPY_TEX_SUB_IMAGE2D, 8 ); @@ -1089,19 +1127,19 @@ static void save_CopyTexSubImage2D( GLcontext *ctx, n[8].i = height; } if (ctx->ExecuteFlag) { - (*ctx->Exec.CopyTexSubImage2D)( ctx, target, level, xoffset, yoffset, + (*ctx->Exec.CopyTexSubImage2D)( target, level, xoffset, yoffset, x, y, width, height ); } } -static void save_CopyTexSubImage3D( GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint zoffset, - GLint x, GLint y, - GLsizei width, GLint height ) +static void +save_CopyTexSubImage3D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLint x, GLint y, + GLsizei width, GLint height ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9 ); @@ -1117,14 +1155,16 @@ static void save_CopyTexSubImage3D( GLcontext *ctx, n[9].i = height; } if (ctx->ExecuteFlag) { - (*ctx->Exec.CopyTexSubImage3D)(ctx, target, level, xoffset, yoffset, - zoffset, x, y, width, height ); + (*ctx->Exec.CopyTexSubImage3D)( target, level, + xoffset, yoffset, zoffset, + x, y, width, height ); } } -static void save_CullFace( GLcontext *ctx, GLenum mode ) +static void save_CullFace( GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_CULL_FACE, 1 ); @@ -1132,13 +1172,14 @@ static void save_CullFace( GLcontext *ctx, GLenum mode ) n[1].e = mode; } if (ctx->ExecuteFlag) { - (*ctx->Exec.CullFace)( ctx, mode ); + (*ctx->Exec.CullFace)( mode ); } } -static void save_DepthFunc( GLcontext *ctx, GLenum func ) +static void save_DepthFunc( GLenum func ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_DEPTH_FUNC, 1 ); @@ -1146,13 +1187,14 @@ static void save_DepthFunc( GLcontext *ctx, GLenum func ) n[1].e = func; } if (ctx->ExecuteFlag) { - (*ctx->Exec.DepthFunc)( ctx, func ); + (*ctx->Exec.DepthFunc)( func ); } } -static void save_DepthMask( GLcontext *ctx, GLboolean mask ) +static void save_DepthMask( GLboolean mask ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_DEPTH_MASK, 1 ); @@ -1160,13 +1202,14 @@ static void save_DepthMask( GLcontext *ctx, GLboolean mask ) n[1].b = mask; } if (ctx->ExecuteFlag) { - (*ctx->Exec.DepthMask)( ctx, mask ); + (*ctx->Exec.DepthMask)( mask ); } } -static void save_DepthRange( GLcontext *ctx, GLclampd nearval, GLclampd farval ) +static void save_DepthRange( GLclampd nearval, GLclampd farval ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_DEPTH_RANGE, 2 ); @@ -1175,13 +1218,14 @@ static void save_DepthRange( GLcontext *ctx, GLclampd nearval, GLclampd farval ) n[2].f = (GLfloat) farval; } if (ctx->ExecuteFlag) { - (*ctx->Exec.DepthRange)( ctx, nearval, farval ); + (*ctx->Exec.DepthRange)( nearval, farval ); } } -static void save_Disable( GLcontext *ctx, GLenum cap ) +static void save_Disable( GLenum cap ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_DISABLE, 1 ); @@ -1189,13 +1233,14 @@ static void save_Disable( GLcontext *ctx, GLenum cap ) n[1].e = cap; } if (ctx->ExecuteFlag) { - (*ctx->Exec.Disable)( ctx, cap ); + (*ctx->Exec.Disable)( cap ); } } -static void save_DrawBuffer( GLcontext *ctx, GLenum mode ) +static void save_DrawBuffer( GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_DRAW_BUFFER, 1 ); @@ -1203,31 +1248,41 @@ static void save_DrawBuffer( GLcontext *ctx, GLenum mode ) n[1].e = mode; } if (ctx->ExecuteFlag) { - (*ctx->Exec.DrawBuffer)( ctx, mode ); + (*ctx->Exec.DrawBuffer)( mode ); } } -static void save_DrawPixels( GLcontext *ctx, struct gl_image *image ) +static void save_DrawPixels( GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ) { + GET_CURRENT_CONTEXT(ctx); + GLvoid *image = _mesa_unpack_image(width, height, 1, format, type, + pixels, &ctx->Unpack); Node *n; FLUSH_VB(ctx, "dlist"); - n = alloc_instruction( ctx, OPCODE_DRAW_PIXELS, 1 ); + n = alloc_instruction( ctx, OPCODE_DRAW_PIXELS, 5 ); if (n) { - n[1].data = (GLvoid *) image; + n[1].i = width; + n[2].i = height; + n[3].e = format; + n[4].e = type; + n[5].data = image; } - if (image) { - image->RefCount = 1; + else if (image) { + FREE(image); } if (ctx->ExecuteFlag) { - (*ctx->Exec.DrawPixels)( ctx, image ); + (*ctx->Exec.DrawPixels)( width, height, format, type, pixels ); } } -static void save_Enable( GLcontext *ctx, GLenum cap ) +static void save_Enable( GLenum cap ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_ENABLE, 1 ); @@ -1235,15 +1290,15 @@ static void save_Enable( GLcontext *ctx, GLenum cap ) n[1].e = cap; } if (ctx->ExecuteFlag) { - (*ctx->Exec.Enable)( ctx, cap ); + (*ctx->Exec.Enable)( cap ); } } -static void save_EvalMesh1( GLcontext *ctx, - GLenum mode, GLint i1, GLint i2 ) +static void save_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_EVALMESH1, 3 ); @@ -1253,14 +1308,15 @@ static void save_EvalMesh1( GLcontext *ctx, n[3].i = i2; } if (ctx->ExecuteFlag) { - (*ctx->Exec.EvalMesh1)( ctx, mode, i1, i2 ); + (*ctx->Exec.EvalMesh1)( mode, i1, i2 ); } } -static void save_EvalMesh2( GLcontext *ctx, +static void save_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_EVALMESH2, 5 ); @@ -1272,15 +1328,16 @@ static void save_EvalMesh2( GLcontext *ctx, n[5].i = j2; } if (ctx->ExecuteFlag) { - (*ctx->Exec.EvalMesh2)( ctx, mode, i1, i2, j1, j2 ); + (*ctx->Exec.EvalMesh2)( mode, i1, i2, j1, j2 ); } } -static void save_Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *params ) +static void save_Fogfv( GLenum pname, const GLfloat *params ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_FOG, 5 ); @@ -1292,13 +1349,51 @@ static void save_Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *params ) n[5].f = params[3]; } if (ctx->ExecuteFlag) { - (*ctx->Exec.Fogfv)( ctx, pname, params ); + (*ctx->Exec.Fogfv)( pname, params ); } } -static void save_FrontFace( GLcontext *ctx, GLenum mode ) +static void save_Fogf( GLenum pname, GLfloat param ) +{ + save_Fogfv(pname, ¶m); +} + + +static void save_Fogiv(GLenum pname, const GLint *params ) { + GLfloat p[4]; + switch (pname) { + case GL_FOG_MODE: + case GL_FOG_DENSITY: + case GL_FOG_START: + case GL_FOG_END: + case GL_FOG_INDEX: + p[0] = (GLfloat) *params; + break; + case GL_FOG_COLOR: + p[0] = INT_TO_FLOAT( params[0] ); + p[1] = INT_TO_FLOAT( params[1] ); + p[2] = INT_TO_FLOAT( params[2] ); + p[3] = INT_TO_FLOAT( params[3] ); + break; + default: + /* Error will be caught later in gl_Fogfv */ + ; + } + save_Fogfv(pname, p); +} + + +void save_Fogi(GLenum pname, GLint param ) +{ + save_Fogiv(pname, ¶m); +} + + +static void save_FrontFace( GLenum mode ) +{ + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_FRONT_FACE, 1 ); @@ -1306,15 +1401,16 @@ static void save_FrontFace( GLcontext *ctx, GLenum mode ) n[1].e = mode; } if (ctx->ExecuteFlag) { - (*ctx->Exec.FrontFace)( ctx, mode ); + (*ctx->Exec.FrontFace)( mode ); } } -static void save_Frustum( GLcontext *ctx, GLdouble left, GLdouble right, +static void save_Frustum( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_FRUSTUM, 6 ); @@ -1327,13 +1423,14 @@ static void save_Frustum( GLcontext *ctx, GLdouble left, GLdouble right, n[6].f = farval; } if (ctx->ExecuteFlag) { - (*ctx->Exec.Frustum)( ctx, left, right, bottom, top, nearval, farval ); + (*ctx->Exec.Frustum)( left, right, bottom, top, nearval, farval ); } } -static GLboolean save_Hint( GLcontext *ctx, GLenum target, GLenum mode ) +static void save_Hint( GLenum target, GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_HINT, 2 ); @@ -1342,15 +1439,15 @@ static GLboolean save_Hint( GLcontext *ctx, GLenum target, GLenum mode ) n[2].e = mode; } if (ctx->ExecuteFlag) { - return (*ctx->Exec.Hint)( ctx, target, mode ); + (*ctx->Exec.Hint)( target, mode ); } - return GL_TRUE; /* not queried */ } -static void save_IndexMask( GLcontext *ctx, GLuint mask ) +static void save_IndexMask( GLuint mask ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_INDEX_MASK, 1 ); @@ -1358,44 +1455,129 @@ static void save_IndexMask( GLcontext *ctx, GLuint mask ) n[1].ui = mask; } if (ctx->ExecuteFlag) { - (*ctx->Exec.IndexMask)( ctx, mask ); + (*ctx->Exec.IndexMask)( mask ); } } -static void save_InitNames( GLcontext *ctx ) +static void save_InitNames( void ) { + GET_CURRENT_CONTEXT(ctx); FLUSH_VB(ctx, "dlist"); (void) alloc_instruction( ctx, OPCODE_INIT_NAMES, 0 ); if (ctx->ExecuteFlag) { - (*ctx->Exec.InitNames)( ctx ); + (*ctx->Exec.InitNames)(); } } -static void save_Lightfv( GLcontext *ctx, GLenum light, GLenum pname, - const GLfloat *params, GLint numparams ) +static void save_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_LIGHT, 6 ); if (OPCODE_LIGHT) { - GLint i; + GLint i, nParams; n[1].e = light; n[2].e = pname; - for (i=0;iExecuteFlag) { - (*ctx->Exec.Lightfv)( ctx, light, pname, params, numparams ); + (*ctx->Exec.Lightfv)( light, pname, params ); + } +} + + +static void save_Lightf( GLenum light, GLenum pname, GLfloat params ) +{ + save_Lightfv(light, pname, ¶ms); +} + + +static void save_Lightiv( GLenum light, GLenum pname, const GLint *params ) +{ + GLfloat fparam[4]; + switch (pname) { + case GL_AMBIENT: + case GL_DIFFUSE: + case GL_SPECULAR: + fparam[0] = INT_TO_FLOAT( params[0] ); + fparam[1] = INT_TO_FLOAT( params[1] ); + fparam[2] = INT_TO_FLOAT( params[2] ); + fparam[3] = INT_TO_FLOAT( params[3] ); + break; + case GL_POSITION: + fparam[0] = (GLfloat) params[0]; + fparam[1] = (GLfloat) params[1]; + fparam[2] = (GLfloat) params[2]; + fparam[3] = (GLfloat) params[3]; + break; + case GL_SPOT_DIRECTION: + fparam[0] = (GLfloat) params[0]; + fparam[1] = (GLfloat) params[1]; + fparam[2] = (GLfloat) params[2]; + break; + case GL_SPOT_EXPONENT: + case GL_SPOT_CUTOFF: + case GL_CONSTANT_ATTENUATION: + case GL_LINEAR_ATTENUATION: + case GL_QUADRATIC_ATTENUATION: + fparam[0] = (GLfloat) params[0]; + break; + default: + /* error will be caught later in gl_Lightfv */ + ; } + save_Lightfv( light, pname, fparam ); +} + + +static void save_Lighti( GLenum light, GLenum pname, GLint param ) +{ + save_Lightiv( light, pname, ¶m ); } -static void save_LightModelfv( GLcontext *ctx, - GLenum pname, const GLfloat *params ) +static void save_LightModelfv( GLenum pname, const GLfloat *params ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_LIGHT_MODEL, 5 ); @@ -1407,13 +1589,49 @@ static void save_LightModelfv( GLcontext *ctx, n[5].f = params[3]; } if (ctx->ExecuteFlag) { - (*ctx->Exec.LightModelfv)( ctx, pname, params ); + (*ctx->Exec.LightModelfv)( pname, params ); } } -static void save_LineStipple( GLcontext *ctx, GLint factor, GLushort pattern ) +static void save_LightModelf( GLenum pname, GLfloat param ) +{ + save_LightModelfv(pname, ¶m); +} + + +static void save_LightModeliv( GLenum pname, const GLint *params ) { + GLfloat fparam[4]; + switch (pname) { + case GL_LIGHT_MODEL_AMBIENT: + fparam[0] = INT_TO_FLOAT( params[0] ); + fparam[1] = INT_TO_FLOAT( params[1] ); + fparam[2] = INT_TO_FLOAT( params[2] ); + fparam[3] = INT_TO_FLOAT( params[3] ); + break; + case GL_LIGHT_MODEL_LOCAL_VIEWER: + case GL_LIGHT_MODEL_TWO_SIDE: + case GL_LIGHT_MODEL_COLOR_CONTROL: + fparam[0] = (GLfloat) params[0]; + break; + default: + /* Error will be caught later in gl_LightModelfv */ + ; + } + save_LightModelfv(pname, fparam); +} + + +static void save_LightModeli( GLenum pname, GLint param ) +{ + save_LightModeliv(pname, ¶m); +} + + +static void save_LineStipple( GLint factor, GLushort pattern ) +{ + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_LINE_STIPPLE, 2 ); @@ -1422,13 +1640,14 @@ static void save_LineStipple( GLcontext *ctx, GLint factor, GLushort pattern ) n[2].us = pattern; } if (ctx->ExecuteFlag) { - (*ctx->Exec.LineStipple)( ctx, factor, pattern ); + (*ctx->Exec.LineStipple)( factor, pattern ); } } -static void save_LineWidth( GLcontext *ctx, GLfloat width ) +static void save_LineWidth( GLfloat width ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_LINE_WIDTH, 1 ); @@ -1436,13 +1655,14 @@ static void save_LineWidth( GLcontext *ctx, GLfloat width ) n[1].f = width; } if (ctx->ExecuteFlag) { - (*ctx->Exec.LineWidth)( ctx, width ); + (*ctx->Exec.LineWidth)( width ); } } -static void save_ListBase( GLcontext *ctx, GLuint base ) +static void save_ListBase( GLuint base ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_LIST_BASE, 1 ); @@ -1450,23 +1670,25 @@ static void save_ListBase( GLcontext *ctx, GLuint base ) n[1].ui = base; } if (ctx->ExecuteFlag) { - (*ctx->Exec.ListBase)( ctx, base ); + (*ctx->Exec.ListBase)( base ); } } -static void save_LoadIdentity( GLcontext *ctx ) +static void save_LoadIdentity( void ) { + GET_CURRENT_CONTEXT(ctx); FLUSH_VB(ctx, "dlist"); (void) alloc_instruction( ctx, OPCODE_LOAD_IDENTITY, 0 ); if (ctx->ExecuteFlag) { - (*ctx->Exec.LoadIdentity)( ctx ); + (*ctx->Exec.LoadIdentity)(); } } -static void save_LoadMatrixf( GLcontext *ctx, const GLfloat *m ) +static void save_LoadMatrixf( const GLfloat *m ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_LOAD_MATRIX, 16 ); @@ -1477,13 +1699,25 @@ static void save_LoadMatrixf( GLcontext *ctx, const GLfloat *m ) } } if (ctx->ExecuteFlag) { - (*ctx->Exec.LoadMatrixf)( ctx, m ); + (*ctx->Exec.LoadMatrixf)( m ); } } -static void save_LoadName( GLcontext *ctx, GLuint name ) +static void save_LoadMatrixd( const GLdouble *m ) { + GLfloat f[16]; + GLint i; + for (i = 0; i < 16; i++) { + f[i] = m[i]; + } + save_LoadMatrixf(f); +} + + +static void save_LoadName( GLuint name ) +{ + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_LOAD_NAME, 1 ); @@ -1491,13 +1725,14 @@ static void save_LoadName( GLcontext *ctx, GLuint name ) n[1].ui = name; } if (ctx->ExecuteFlag) { - (*ctx->Exec.LoadName)( ctx, name ); + (*ctx->Exec.LoadName)( name ); } } -static void save_LogicOp( GLcontext *ctx, GLenum opcode ) +static void save_LogicOp( GLenum opcode ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_LOGIC_OP, 1 ); @@ -1505,64 +1740,120 @@ static void save_LogicOp( GLcontext *ctx, GLenum opcode ) n[1].e = opcode; } if (ctx->ExecuteFlag) { - (*ctx->Exec.LogicOp)( ctx, opcode ); + (*ctx->Exec.LogicOp)( opcode ); } } -static void save_Map1f( GLcontext *ctx, - GLenum target, GLfloat u1, GLfloat u2, GLint stride, - GLint order, const GLfloat *points, GLboolean retain ) +static void save_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, + GLint order, const GLdouble *points) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + FLUSH_VB(ctx, "dlist"); + n = alloc_instruction( ctx, OPCODE_MAP1, 6 ); + if (n) { + GLfloat *pnts = gl_copy_map_points1d( target, stride, order, points ); + n[1].e = target; + n[2].f = u1; + n[3].f = u2; + n[4].i = _mesa_evaluator_components(target); /* stride */ + n[5].i = order; + n[6].data = (void *) pnts; + } + if (ctx->ExecuteFlag) { + (*ctx->Exec.Map1d)( target, u1, u2, stride, order, points ); + } +} + +static void save_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, + GLint order, const GLfloat *points) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_MAP1, 6 ); if (n) { + GLfloat *pnts = gl_copy_map_points1f( target, stride, order, points ); n[1].e = target; n[2].f = u1; n[3].f = u2; - n[4].i = stride; + n[4].i = _mesa_evaluator_components(target); /* stride */ n[5].i = order; - n[6].data = (void *) points; + n[6].data = (void *) pnts; + } + if (ctx->ExecuteFlag) { + (*ctx->Exec.Map1f)( target, u1, u2, stride, order, points ); + } +} + + +static void save_Map2d( GLenum target, + GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, + GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, + const GLdouble *points ) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + FLUSH_VB(ctx, "dlist"); + n = alloc_instruction( ctx, OPCODE_MAP2, 10 ); + if (n) { + GLfloat *pnts = gl_copy_map_points2d( target, ustride, uorder, + vstride, vorder, points ); + n[1].e = target; + n[2].f = u1; + n[3].f = u2; + n[4].f = v1; + n[5].f = v2; + /* XXX verify these strides are correct */ + n[6].i = _mesa_evaluator_components(target) * vorder; /*ustride*/ + n[7].i = _mesa_evaluator_components(target); /*vstride*/ + n[8].i = uorder; + n[9].i = vorder; + n[10].data = (void *) pnts; } if (ctx->ExecuteFlag) { - (*ctx->Exec.Map1f)( ctx, target, u1, u2, stride, order, points, GL_TRUE ); + (*ctx->Exec.Map2d)( target, + u1, u2, ustride, uorder, + v1, v2, vstride, vorder, points ); } - (void) retain; } -static void save_Map2f( GLcontext *ctx, GLenum target, - GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, - GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, - const GLfloat *points, GLboolean retain ) +static void save_Map2f( GLenum target, + GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, + GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, + const GLfloat *points ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_MAP2, 10 ); if (n) { + GLfloat *pnts = gl_copy_map_points2f( target, ustride, uorder, + vstride, vorder, points ); n[1].e = target; n[2].f = u1; n[3].f = u2; n[4].f = v1; n[5].f = v2; - n[6].i = ustride; - n[7].i = vstride; + /* XXX verify these strides are correct */ + n[6].i = _mesa_evaluator_components(target) * vorder; /*ustride*/ + n[7].i = _mesa_evaluator_components(target); /*vstride*/ n[8].i = uorder; n[9].i = vorder; - n[10].data = (void *) points; + n[10].data = (void *) pnts; } if (ctx->ExecuteFlag) { - (*ctx->Exec.Map2f)( ctx, target, - u1, u2, ustride, uorder, - v1, v2, vstride, vorder, points, GL_TRUE ); + (*ctx->Exec.Map2f)( target, u1, u2, ustride, uorder, + v1, v2, vstride, vorder, points ); } - (void) retain; } -static void save_MapGrid1f( GLcontext *ctx, GLint un, GLfloat u1, GLfloat u2 ) +static void save_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_MAPGRID1, 3 ); @@ -1572,15 +1863,21 @@ static void save_MapGrid1f( GLcontext *ctx, GLint un, GLfloat u1, GLfloat u2 ) n[3].f = u2; } if (ctx->ExecuteFlag) { - (*ctx->Exec.MapGrid1f)( ctx, un, u1, u2 ); + (*ctx->Exec.MapGrid1f)( un, u1, u2 ); } } -static void save_MapGrid2f( GLcontext *ctx, - GLint un, GLfloat u1, GLfloat u2, - GLint vn, GLfloat v1, GLfloat v2 ) +static void save_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ) { + save_MapGrid1f(un, u1, u2); +} + + +static void save_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, + GLint vn, GLfloat v1, GLfloat v2 ) +{ + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_MAPGRID2, 6 ); @@ -1593,13 +1890,22 @@ static void save_MapGrid2f( GLcontext *ctx, n[6].f = v2; } if (ctx->ExecuteFlag) { - (*ctx->Exec.MapGrid2f)( ctx, un, u1, u2, vn, v1, v2 ); + (*ctx->Exec.MapGrid2f)( un, u1, u2, vn, v1, v2 ); } } -static void save_MatrixMode( GLcontext *ctx, GLenum mode ) + +static void save_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, + GLint vn, GLdouble v1, GLdouble v2 ) { + save_MapGrid2f(un, u1, u2, vn, v1, v2); +} + + +static void save_MatrixMode( GLenum mode ) +{ + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_MATRIX_MODE, 1 ); @@ -1607,13 +1913,14 @@ static void save_MatrixMode( GLcontext *ctx, GLenum mode ) n[1].e = mode; } if (ctx->ExecuteFlag) { - (*ctx->Exec.MatrixMode)( ctx, mode ); + (*ctx->Exec.MatrixMode)( mode ); } } -static void save_MultMatrixf( GLcontext *ctx, const GLfloat *m ) +static void save_MultMatrixf( const GLfloat *m ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_MULT_MATRIX, 16 ); @@ -1624,13 +1931,25 @@ static void save_MultMatrixf( GLcontext *ctx, const GLfloat *m ) } } if (ctx->ExecuteFlag) { - (*ctx->Exec.MultMatrixf)( ctx, m ); + (*ctx->Exec.MultMatrixf)( m ); + } +} + + +static void save_MultMatrixd( const GLdouble *m ) +{ + GLfloat f[16]; + GLint i; + for (i = 0; i < 16; i++) { + f[i] = m[i]; } + save_MultMatrixf(f); } -static void save_NewList( GLcontext *ctx, GLuint list, GLenum mode ) +static void save_NewList( GLuint list, GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); /* It's an error to call this function while building a display list */ gl_error( ctx, GL_INVALID_OPERATION, "glNewList" ); (void) list; @@ -1639,10 +1958,11 @@ static void save_NewList( GLcontext *ctx, GLuint list, GLenum mode ) -static void save_Ortho( GLcontext *ctx, GLdouble left, GLdouble right, +static void save_Ortho( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_ORTHO, 6 ); @@ -1655,14 +1975,14 @@ static void save_Ortho( GLcontext *ctx, GLdouble left, GLdouble right, n[6].f = farval; } if (ctx->ExecuteFlag) { - (*ctx->Exec.Ortho)( ctx, left, right, bottom, top, nearval, farval ); + (*ctx->Exec.Ortho)( left, right, bottom, top, nearval, farval ); } } -static void save_PixelMapfv( GLcontext *ctx, - GLenum map, GLint mapsize, const GLfloat *values ) +static void save_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_PIXEL_MAP, 3 ); @@ -1673,13 +1993,50 @@ static void save_PixelMapfv( GLcontext *ctx, MEMCPY( n[3].data, (void *) values, mapsize * sizeof(GLfloat) ); } if (ctx->ExecuteFlag) { - (*ctx->Exec.PixelMapfv)( ctx, map, mapsize, values ); + (*ctx->Exec.PixelMapfv)( map, mapsize, values ); + } +} + + +static void save_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values ) +{ + GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; + GLint i; + if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) { + for (i=0;iExecuteFlag) { - (*ctx->Exec.PixelTransferf)( ctx, pname, param ); + (*ctx->Exec.PixelTransferf)( pname, param ); } } -static void save_PixelZoom( GLcontext *ctx, GLfloat xfactor, GLfloat yfactor ) +static void save_PixelTransferi( GLenum pname, GLint param ) { + save_PixelTransferf( pname, (GLfloat) param ); +} + + +static void save_PixelZoom( GLfloat xfactor, GLfloat yfactor ) +{ + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_PIXEL_ZOOM, 2 ); @@ -1703,14 +2067,14 @@ static void save_PixelZoom( GLcontext *ctx, GLfloat xfactor, GLfloat yfactor ) n[2].f = yfactor; } if (ctx->ExecuteFlag) { - (*ctx->Exec.PixelZoom)( ctx, xfactor, yfactor ); + (*ctx->Exec.PixelZoom)( xfactor, yfactor ); } } -static void save_PointParameterfvEXT( GLcontext *ctx, GLenum pname, - const GLfloat *params) +static void save_PointParameterfvEXT( GLenum pname, const GLfloat *params ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_POINT_PARAMETERS, 4 ); @@ -1721,13 +2085,20 @@ static void save_PointParameterfvEXT( GLcontext *ctx, GLenum pname, n[4].f = params[2]; } if (ctx->ExecuteFlag) { - (*ctx->Exec.PointParameterfvEXT)( ctx, pname, params ); + (*ctx->Exec.PointParameterfvEXT)( pname, params ); } } -static void save_PointSize( GLcontext *ctx, GLfloat size ) +static void save_PointParameterfEXT( GLenum pname, GLfloat param ) +{ + save_PointParameterfvEXT(pname, ¶m); +} + + +static void save_PointSize( GLfloat size ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_POINT_SIZE, 1 ); @@ -1735,13 +2106,14 @@ static void save_PointSize( GLcontext *ctx, GLfloat size ) n[1].f = size; } if (ctx->ExecuteFlag) { - (*ctx->Exec.PointSize)( ctx, size ); + (*ctx->Exec.PointSize)( size ); } } -static void save_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode ) +static void save_PolygonMode( GLenum face, GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_POLYGON_MODE, 2 ); @@ -1750,7 +2122,7 @@ static void save_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode ) n[2].e = mode; } if (ctx->ExecuteFlag) { - (*ctx->Exec.PolygonMode)( ctx, face, mode ); + (*ctx->Exec.PolygonMode)( face, mode ); } } @@ -1758,8 +2130,9 @@ static void save_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode ) /* * Polygon stipple must have been upacked already! */ -static void save_PolygonStipple( GLcontext *ctx, const GLuint *pattern ) +static void save_PolygonStipple( const GLubyte *pattern ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_POLYGON_STIPPLE, 1 ); @@ -1770,13 +2143,14 @@ static void save_PolygonStipple( GLcontext *ctx, const GLuint *pattern ) MEMCPY( data, pattern, 32 * 4 ); } if (ctx->ExecuteFlag) { - (*ctx->Exec.PolygonStipple)( ctx, pattern ); + (*ctx->Exec.PolygonStipple)( (GLubyte*) pattern ); } } -static void save_PolygonOffset( GLcontext *ctx, GLfloat factor, GLfloat units ) +static void save_PolygonOffset( GLfloat factor, GLfloat units ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_POLYGON_OFFSET, 2 ); @@ -1785,45 +2159,54 @@ static void save_PolygonOffset( GLcontext *ctx, GLfloat factor, GLfloat units ) n[2].f = units; } if (ctx->ExecuteFlag) { - (*ctx->Exec.PolygonOffset)( ctx, factor, units ); + (*ctx->Exec.PolygonOffset)( factor, units ); } } -static void save_PopAttrib( GLcontext *ctx ) +static void save_PolygonOffsetEXT( GLfloat factor, GLfloat bias ) { + save_PolygonOffset(factor, DEPTH_SCALE * bias); +} + + +static void save_PopAttrib( void ) +{ + GET_CURRENT_CONTEXT(ctx); FLUSH_VB(ctx, "dlist"); (void) alloc_instruction( ctx, OPCODE_POP_ATTRIB, 0 ); if (ctx->ExecuteFlag) { - (*ctx->Exec.PopAttrib)( ctx ); + (*ctx->Exec.PopAttrib)(); } } -static void save_PopMatrix( GLcontext *ctx ) +static void save_PopMatrix( void ) { + GET_CURRENT_CONTEXT(ctx); FLUSH_VB(ctx, "dlist"); (void) alloc_instruction( ctx, OPCODE_POP_MATRIX, 0 ); if (ctx->ExecuteFlag) { - (*ctx->Exec.PopMatrix)( ctx ); + (*ctx->Exec.PopMatrix)(); } } -static void save_PopName( GLcontext *ctx ) +static void save_PopName( void ) { + GET_CURRENT_CONTEXT(ctx); FLUSH_VB(ctx, "dlist"); (void) alloc_instruction( ctx, OPCODE_POP_NAME, 0 ); if (ctx->ExecuteFlag) { - (*ctx->Exec.PopName)( ctx ); + (*ctx->Exec.PopName)(); } } -static void save_PrioritizeTextures( GLcontext *ctx, - GLsizei num, const GLuint *textures, - const GLclampf *priorities ) +static void save_PrioritizeTextures( GLsizei num, const GLuint *textures, + const GLclampf *priorities ) { + GET_CURRENT_CONTEXT(ctx); GLint i; FLUSH_VB(ctx, "dlist"); @@ -1836,13 +2219,14 @@ static void save_PrioritizeTextures( GLcontext *ctx, } } if (ctx->ExecuteFlag) { - (*ctx->Exec.PrioritizeTextures)( ctx, num, textures, priorities ); + (*ctx->Exec.PrioritizeTextures)( num, textures, priorities ); } } -static void save_PushAttrib( GLcontext *ctx, GLbitfield mask ) +static void save_PushAttrib( GLbitfield mask ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_PUSH_ATTRIB, 1 ); @@ -1850,23 +2234,25 @@ static void save_PushAttrib( GLcontext *ctx, GLbitfield mask ) n[1].bf = mask; } if (ctx->ExecuteFlag) { - (*ctx->Exec.PushAttrib)( ctx, mask ); + (*ctx->Exec.PushAttrib)( mask ); } } -static void save_PushMatrix( GLcontext *ctx ) +static void save_PushMatrix( void ) { + GET_CURRENT_CONTEXT(ctx); FLUSH_VB(ctx, "dlist"); (void) alloc_instruction( ctx, OPCODE_PUSH_MATRIX, 0 ); if (ctx->ExecuteFlag) { - (*ctx->Exec.PushMatrix)( ctx ); + (*ctx->Exec.PushMatrix)(); } } -static void save_PushName( GLcontext *ctx, GLuint name ) +static void save_PushName( GLuint name ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_PUSH_NAME, 1 ); @@ -1874,14 +2260,14 @@ static void save_PushName( GLcontext *ctx, GLuint name ) n[1].ui = name; } if (ctx->ExecuteFlag) { - (*ctx->Exec.PushName)( ctx, name ); + (*ctx->Exec.PushName)( name ); } } -static void save_RasterPos4f( GLcontext *ctx, - GLfloat x, GLfloat y, GLfloat z, GLfloat w ) +static void save_RasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_RASTER_POS, 4 ); @@ -1892,13 +2278,129 @@ static void save_RasterPos4f( GLcontext *ctx, n[4].f = w; } if (ctx->ExecuteFlag) { - (*ctx->Exec.RasterPos4f)( ctx, x, y, z, w ); + (*ctx->Exec.RasterPos4f)( x, y, z, w ); } } +void save_RasterPos2d(GLdouble x, GLdouble y) +{ + save_RasterPos4f(x, y, 0.0F, 1.0F); +} + +void save_RasterPos2f(GLfloat x, GLfloat y) +{ + save_RasterPos4f(x, y, 0.0F, 1.0F); +} + +void save_RasterPos2i(GLint x, GLint y) +{ + save_RasterPos4f(x, y, 0.0F, 1.0F); +} + +void save_RasterPos2s(GLshort x, GLshort y) +{ + save_RasterPos4f(x, y, 0.0F, 1.0F); +} + +void save_RasterPos3d(GLdouble x, GLdouble y, GLdouble z) +{ + save_RasterPos4f(x, y, z, 1.0F); +} + +void save_RasterPos3f(GLfloat x, GLfloat y, GLfloat z) +{ + save_RasterPos4f(x, y, z, 1.0F); +} + +void save_RasterPos3i(GLint x, GLint y, GLint z) +{ + save_RasterPos4f(x, y, z, 1.0F); +} + +void save_RasterPos3s(GLshort x, GLshort y, GLshort z) +{ + save_RasterPos4f(x, y, z, 1.0F); +} + +void save_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) +{ + save_RasterPos4f(x, y, z, w); +} + +void save_RasterPos4i(GLint x, GLint y, GLint z, GLint w) +{ + save_RasterPos4f(x, y, z, w); +} + +void save_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) +{ + save_RasterPos4f(x, y, z, w); +} + +void save_RasterPos2dv(const GLdouble *v) +{ + save_RasterPos4f(v[0], v[1], 0.0F, 1.0F); +} + +void save_RasterPos2fv(const GLfloat *v) +{ + save_RasterPos4f(v[0], v[1], 0.0F, 1.0F); +} + +void save_RasterPos2iv(const GLint *v) +{ + save_RasterPos4f(v[0], v[1], 0.0F, 1.0F); +} + +void save_RasterPos2sv(const GLshort *v) +{ + save_RasterPos4f(v[0], v[1], 0.0F, 1.0F); +} + +void save_RasterPos3dv(const GLdouble *v) +{ + save_RasterPos4f(v[0], v[1], v[2], 1.0F); +} + +void save_RasterPos3fv(const GLfloat *v) +{ + save_RasterPos4f(v[0], v[1], v[2], 1.0F); +} + +void save_RasterPos3iv(const GLint *v) +{ + save_RasterPos4f(v[0], v[1], v[2], 1.0F); +} + +void save_RasterPos3sv(const GLshort *v) +{ + save_RasterPos4f(v[0], v[1], v[2], 1.0F); +} -static void save_PassThrough( GLcontext *ctx, GLfloat token ) +void save_RasterPos4dv(const GLdouble *v) { + save_RasterPos4f(v[0], v[1], v[2], v[3]); +} + +void save_RasterPos4fv(const GLfloat *v) +{ + save_RasterPos4f(v[0], v[1], v[2], v[3]); +} + +void save_RasterPos4iv(const GLint *v) +{ + save_RasterPos4f(v[0], v[1], v[2], v[3]); +} + +void save_RasterPos4sv(const GLshort *v) +{ + save_RasterPos4f(v[0], v[1], v[2], v[3]); +} + + +static void save_PassThrough( GLfloat token ) +{ + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_PASSTHROUGH, 1 ); @@ -1906,13 +2408,14 @@ static void save_PassThrough( GLcontext *ctx, GLfloat token ) n[1].f = token; } if (ctx->ExecuteFlag) { - (*ctx->Exec.PassThrough)( ctx, token ); + (*ctx->Exec.PassThrough)( token ); } } -static void save_ReadBuffer( GLcontext *ctx, GLenum mode ) +static void save_ReadBuffer( GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_READ_BUFFER, 1 ); @@ -1920,14 +2423,14 @@ static void save_ReadBuffer( GLcontext *ctx, GLenum mode ) n[1].e = mode; } if (ctx->ExecuteFlag) { - (*ctx->Exec.ReadBuffer)( ctx, mode ); + (*ctx->Exec.ReadBuffer)( mode ); } } -static void save_Rectf( GLcontext *ctx, - GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) +static void save_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_RECTF, 4 ); @@ -1938,22 +2441,63 @@ static void save_Rectf( GLcontext *ctx, n[4].f = y2; } if (ctx->ExecuteFlag) { - (*ctx->Exec.Rectf)( ctx, x1, y1, x2, y2 ); + (*ctx->Exec.Rectf)( x1, y1, x2, y2 ); } } +static void save_Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) +{ + save_Rectf(x1, y1, x2, y2); +} + +static void save_Rectdv(const GLdouble *v1, const GLdouble *v2) +{ + save_Rectf(v1[0], v1[1], v2[0], v2[1]); +} + +static void save_Rectfv( const GLfloat *v1, const GLfloat *v2 ) +{ + save_Rectf(v1[0], v1[1], v2[0], v2[1]); +} + +static void save_Recti(GLint x1, GLint y1, GLint x2, GLint y2) +{ + save_Rectf(x1, y1, x2, y2); +} -static void save_Rotatef( GLcontext *ctx, GLfloat angle, - GLfloat x, GLfloat y, GLfloat z ) +static void save_Rectiv(const GLint *v1, const GLint *v2) +{ + save_Rectf(v1[0], v1[1], v2[0], v2[1]); +} + +static void save_Rects(GLshort x1, GLshort y1, GLshort x2, GLshort y2) +{ + save_Rectf(x1, y1, x2, y2); +} + +static void save_Rectsv(const GLshort *v1, const GLshort *v2) +{ + save_Rectf(v1[0], v1[1], v2[0], v2[1]); +} + + +static void save_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) { GLfloat m[16]; gl_rotation_matrix( angle, x, y, z, m ); - save_MultMatrixf( ctx, m ); /* save and maybe execute */ + save_MultMatrixf( m ); /* save and maybe execute */ } -static void save_Scalef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ) +static void save_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ) { + save_Rotatef(angle, x, y, z); +} + + +static void save_Scalef( GLfloat x, GLfloat y, GLfloat z ) +{ + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_SCALE, 3 ); @@ -1963,14 +2507,20 @@ static void save_Scalef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ) n[3].f = z; } if (ctx->ExecuteFlag) { - (*ctx->Exec.Scalef)( ctx, x, y, z ); + (*ctx->Exec.Scalef)( x, y, z ); } } -static void save_Scissor( GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height ) +static void save_Scaled( GLdouble x, GLdouble y, GLdouble z ) +{ + save_Scalef(x, y, z); +} + + +static void save_Scissor( GLint x, GLint y, GLsizei width, GLsizei height ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_SCISSOR, 4 ); @@ -1981,13 +2531,14 @@ static void save_Scissor( GLcontext *ctx, n[4].i = height; } if (ctx->ExecuteFlag) { - (*ctx->Exec.Scissor)( ctx, x, y, width, height ); + (*ctx->Exec.Scissor)( x, y, width, height ); } } -static void save_ShadeModel( GLcontext *ctx, GLenum mode ) +static void save_ShadeModel( GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_SHADE_MODEL, 1 ); @@ -1995,13 +2546,14 @@ static void save_ShadeModel( GLcontext *ctx, GLenum mode ) n[1].e = mode; } if (ctx->ExecuteFlag) { - (*ctx->Exec.ShadeModel)( ctx, mode ); + (*ctx->Exec.ShadeModel)( mode ); } } -static void save_StencilFunc( GLcontext *ctx, GLenum func, GLint ref, GLuint mask ) +static void save_StencilFunc( GLenum func, GLint ref, GLuint mask ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_STENCIL_FUNC, 3 ); @@ -2011,13 +2563,14 @@ static void save_StencilFunc( GLcontext *ctx, GLenum func, GLint ref, GLuint mas n[3].ui = mask; } if (ctx->ExecuteFlag) { - (*ctx->Exec.StencilFunc)( ctx, func, ref, mask ); + (*ctx->Exec.StencilFunc)( func, ref, mask ); } } -static void save_StencilMask( GLcontext *ctx, GLuint mask ) +static void save_StencilMask( GLuint mask ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_STENCIL_MASK, 1 ); @@ -2025,14 +2578,14 @@ static void save_StencilMask( GLcontext *ctx, GLuint mask ) n[1].ui = mask; } if (ctx->ExecuteFlag) { - (*ctx->Exec.StencilMask)( ctx, mask ); + (*ctx->Exec.StencilMask)( mask ); } } -static void save_StencilOp( GLcontext *ctx, - GLenum fail, GLenum zfail, GLenum zpass ) +static void save_StencilOp( GLenum fail, GLenum zfail, GLenum zpass ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_STENCIL_OP, 3 ); @@ -2042,16 +2595,14 @@ static void save_StencilOp( GLcontext *ctx, n[3].e = zpass; } if (ctx->ExecuteFlag) { - (*ctx->Exec.StencilOp)( ctx, fail, zfail, zpass ); + (*ctx->Exec.StencilOp)( fail, zfail, zpass ); } } - - -static void save_TexEnvfv( GLcontext *ctx, - GLenum target, GLenum pname, const GLfloat *params ) +static void save_TexEnvfv( GLenum target, GLenum pname, const GLfloat *params ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_TEXENV, 6 ); @@ -2064,14 +2615,40 @@ static void save_TexEnvfv( GLcontext *ctx, n[6].f = params[3]; } if (ctx->ExecuteFlag) { - (*ctx->Exec.TexEnvfv)( ctx, target, pname, params ); + (*ctx->Exec.TexEnvfv)( target, pname, params ); } } -static void save_TexGenfv( GLcontext *ctx, - GLenum coord, GLenum pname, const GLfloat *params ) +static void save_TexEnvf( GLenum target, GLenum pname, GLfloat param ) +{ + save_TexEnvfv( target, pname, ¶m ); +} + + +static void save_TexEnvi( GLenum target, GLenum pname, GLint param ) +{ + GLfloat p[4]; + p[0] = (GLfloat) param; + p[1] = p[2] = p[3] = 0.0; + save_TexEnvfv( target, pname, p ); +} + + +static void save_TexEnviv( GLenum target, GLenum pname, const GLint *param ) +{ + GLfloat p[4]; + p[0] = INT_TO_FLOAT( param[0] ); + p[1] = INT_TO_FLOAT( param[1] ); + p[2] = INT_TO_FLOAT( param[2] ); + p[3] = INT_TO_FLOAT( param[3] ); + save_TexEnvfv( target, pname, p ); +} + + +static void save_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_TEXGEN, 6 ); @@ -2084,14 +2661,56 @@ static void save_TexGenfv( GLcontext *ctx, n[6].f = params[3]; } if (ctx->ExecuteFlag) { - (*ctx->Exec.TexGenfv)( ctx, coord, pname, params ); + (*ctx->Exec.TexGenfv)( coord, pname, params ); } } -static void save_TexParameterfv( GLcontext *ctx, GLenum target, +static void save_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) +{ + GLfloat p[4]; + p[0] = params[0]; + p[1] = params[1]; + p[2] = params[2]; + p[3] = params[3]; + save_TexGenfv(coord, pname, p); +} + + +static void save_TexGend(GLenum coord, GLenum pname, GLdouble param ) +{ + GLfloat p = (GLfloat) param; + save_TexGenfv( coord, pname, &p ); +} + + +static void save_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) +{ + GLfloat p[4]; + p[0] = params[0]; + p[1] = params[1]; + p[2] = params[2]; + p[3] = params[3]; + save_TexGenfv( coord, pname, p ); +} + + +static void save_TexGenf( GLenum coord, GLenum pname, GLfloat param ) +{ + save_TexGenfv(coord, pname, ¶m); +} + + +static void save_TexGeni( GLenum coord, GLenum pname, GLint param ) +{ + save_TexGeniv( coord, pname, ¶m ); +} + + +static void save_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_TEXPARAMETER, 6 ); @@ -2104,26 +2723,52 @@ static void save_TexParameterfv( GLcontext *ctx, GLenum target, n[6].f = params[3]; } if (ctx->ExecuteFlag) { - (*ctx->Exec.TexParameterfv)( ctx, target, pname, params ); + (*ctx->Exec.TexParameterfv)( target, pname, params ); } } -static void save_TexImage1D( GLcontext *ctx, GLenum target, +static void save_TexParameterf( GLenum target, GLenum pname, GLfloat param ) +{ + save_TexParameterfv(target, pname, ¶m); +} + + +static void save_TexParameteri( GLenum target, GLenum pname, const GLint param ) +{ + GLfloat fparam[4]; + fparam[0] = (GLfloat) param; + fparam[1] = fparam[2] = fparam[3] = 0.0; + save_TexParameterfv(target, pname, fparam); +} + + +static void save_TexParameteriv( GLenum target, GLenum pname, const GLint *params ) +{ + GLfloat fparam[4]; + fparam[0] = (GLfloat) params[0]; + fparam[1] = fparam[2] = fparam[3] = 0.0; + save_TexParameterfv(target, pname, fparam); +} + + +static void save_TexImage1D( GLenum target, GLint level, GLint components, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) { - FLUSH_VB(ctx, "dlist"); + GET_CURRENT_CONTEXT(ctx); if (target == GL_PROXY_TEXTURE_1D) { - (*ctx->Exec.TexImage1D)( ctx, target, level, components, width, + /* don't compile, execute immediately */ + (*ctx->Exec.TexImage1D)( target, level, components, width, border, format, type, pixels ); } else { - Node *n; GLvoid *image = _mesa_unpack_image(width, 1, 1, format, type, pixels, &ctx->Unpack); + Node *n; + FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_TEX_IMAGE1D, 8 ); if (n) { n[1].e = target; @@ -2135,32 +2780,34 @@ static void save_TexImage1D( GLcontext *ctx, GLenum target, n[7].e = type; n[8].data = image; } - else { + else if (image) { FREE(image); } if (ctx->ExecuteFlag) { - (*ctx->Exec.TexImage1D)( ctx, target, level, components, width, + (*ctx->Exec.TexImage1D)( target, level, components, width, border, format, type, pixels ); } } } -static void save_TexImage2D( GLcontext *ctx, GLenum target, +static void save_TexImage2D( GLenum target, GLint level, GLint components, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, - const GLvoid *pixels ) + const GLvoid *pixels) { - FLUSH_VB(ctx, "dlist"); + GET_CURRENT_CONTEXT(ctx); if (target == GL_PROXY_TEXTURE_2D) { - (*ctx->Exec.TexImage2D)( ctx, target, level, components, width, + /* don't compile, execute immediately */ + (*ctx->Exec.TexImage2D)( target, level, components, width, height, border, format, type, pixels ); } else { - Node *n; GLvoid *image = _mesa_unpack_image(width, height, 1, format, type, pixels, &ctx->Unpack); + Node *n; + FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_TEX_IMAGE2D, 9 ); if (n) { n[1].e = target; @@ -2173,33 +2820,35 @@ static void save_TexImage2D( GLcontext *ctx, GLenum target, n[8].e = type; n[9].data = image; } - else { + else if (image) { FREE(image); } if (ctx->ExecuteFlag) { - (*ctx->Exec.TexImage2D)( ctx, target, level, components, width, + (*ctx->Exec.TexImage2D)( target, level, components, width, height, border, format, type, pixels ); } } } -static void save_TexImage3D( GLcontext *ctx, GLenum target, +static void save_TexImage3D( GLenum target, GLint level, GLint components, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) { - FLUSH_VB(ctx, "dlist"); + GET_CURRENT_CONTEXT(ctx); if (target == GL_PROXY_TEXTURE_3D) { - (*ctx->Exec.TexImage3D)( ctx, target, level, components, width, + /* don't compile, execute immediately */ + (*ctx->Exec.TexImage3D)( target, level, components, width, height, depth, border, format, type, pixels ); } else { + Node *n; GLvoid *image = _mesa_unpack_image(width, height, depth, format, type, pixels, &ctx->Unpack); - Node *n; + FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_TEX_IMAGE3D, 10 ); if (n) { n[1].e = target; @@ -2213,22 +2862,22 @@ static void save_TexImage3D( GLcontext *ctx, GLenum target, n[9].e = type; n[10].data = image; } - else { + else if (image) { FREE(image); } if (ctx->ExecuteFlag) { - (*ctx->Exec.TexImage3D)( ctx, target, level, components, width, - height, depth, border, format, type, pixels ); + (*ctx->Exec.TexImage3D)( target, level, components, width, + height, depth, border, format, type, pixels ); } } } -static void save_TexSubImage1D( GLcontext *ctx, - GLenum target, GLint level, GLint xoffset, +static void save_TexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels ) { + GET_CURRENT_CONTEXT(ctx); Node *n; GLvoid *image = _mesa_unpack_image(width, 1, 1, format, type, pixels, &ctx->Unpack); @@ -2243,23 +2892,23 @@ static void save_TexSubImage1D( GLcontext *ctx, n[6].e = type; n[7].data = image; } - else { + else if (image) { FREE(image); } if (ctx->ExecuteFlag) { - (*ctx->Exec.TexSubImage1D)( ctx, target, level, xoffset, width, + (*ctx->Exec.TexSubImage1D)( target, level, xoffset, width, format, type, pixels ); } } -static void save_TexSubImage2D( GLcontext *ctx, - GLenum target, GLint level, +static void save_TexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) { + GET_CURRENT_CONTEXT(ctx); Node *n; GLvoid *image = _mesa_unpack_image(width, height, 1, format, type, pixels, &ctx->Unpack); @@ -2276,23 +2925,23 @@ static void save_TexSubImage2D( GLcontext *ctx, n[8].e = type; n[9].data = image; } - else { + else if (image) { FREE(image); } if (ctx->ExecuteFlag) { - (*ctx->Exec.TexSubImage2D)( ctx, target, level, xoffset, yoffset, - width, height, format, type, pixels ); + (*ctx->Exec.TexSubImage2D)( target, level, xoffset, yoffset, + width, height, format, type, pixels ); } } -static void save_TexSubImage3D( GLcontext *ctx, - GLenum target, GLint level, +static void save_TexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset,GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels ) { + GET_CURRENT_CONTEXT(ctx); Node *n; GLvoid *image = _mesa_unpack_image(width, height, depth, format, type, pixels, &ctx->Unpack); @@ -2311,18 +2960,20 @@ static void save_TexSubImage3D( GLcontext *ctx, n[10].e = type; n[11].data = image; } - else { + else if (image) { FREE(image); } if (ctx->ExecuteFlag) { - (*ctx->Exec.TexSubImage3D)(ctx, target, level, xoffset, yoffset, zoffset, - width, height, depth, format, type, pixels ); + (*ctx->Exec.TexSubImage3D)( target, level, + xoffset, yoffset, zoffset, + width, height, depth, format, type, pixels ); } } -static void save_Translatef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ) +static void save_Translatef( GLfloat x, GLfloat y, GLfloat z ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_TRANSLATE, 3 ); @@ -2332,15 +2983,21 @@ static void save_Translatef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ) n[3].f = z; } if (ctx->ExecuteFlag) { - (*ctx->Exec.Translatef)( ctx, x, y, z ); + (*ctx->Exec.Translatef)( x, y, z ); } } +static void save_Translated( GLdouble x, GLdouble y, GLdouble z ) +{ + save_Translatef(x, y, z); +} + + -static void save_Viewport( GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height ) +static void save_Viewport( GLint x, GLint y, GLsizei width, GLsizei height ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_VIEWPORT, 4 ); @@ -2351,14 +3008,14 @@ static void save_Viewport( GLcontext *ctx, n[4].i = (GLint) height; } if (ctx->ExecuteFlag) { - (*ctx->Exec.Viewport)( ctx, x, y, width, height ); + (*ctx->Exec.Viewport)( x, y, width, height ); } } -static void save_WindowPos4fMESA( GLcontext *ctx, - GLfloat x, GLfloat y, GLfloat z, GLfloat w ) +static void save_WindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_WINDOW_POS, 4 ); @@ -2369,18 +3026,17 @@ static void save_WindowPos4fMESA( GLcontext *ctx, n[4].f = w; } if (ctx->ExecuteFlag) { - (*ctx->Exec.WindowPos4fMESA)( ctx, x, y, z, w ); + (*ctx->Exec.WindowPos4fMESA)( x, y, z, w ); } } - - /* GL_ARB_multitexture */ -static void save_ActiveTexture( GLcontext *ctx, GLenum target ) +static void save_ActiveTextureARB( GLenum target ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_ACTIVE_TEXTURE, 1 ); @@ -2388,14 +3044,15 @@ static void save_ActiveTexture( GLcontext *ctx, GLenum target ) n[1].e = target; } if (ctx->ExecuteFlag) { - (*ctx->Exec.ActiveTexture)( ctx, target ); + (*ctx->Exec.ActiveTextureARB)( target ); } } /* GL_ARB_multitexture */ -static void save_ClientActiveTexture( GLcontext *ctx, GLenum target ) +static void save_ClientActiveTextureARB( GLenum target ) { + GET_CURRENT_CONTEXT(ctx); Node *n; FLUSH_VB(ctx, "dlist"); n = alloc_instruction( ctx, OPCODE_CLIENT_ACTIVE_TEXTURE, 1 ); @@ -2403,7 +3060,7 @@ static void save_ClientActiveTexture( GLcontext *ctx, GLenum target ) n[1].e = target; } if (ctx->ExecuteFlag) { - (*ctx->Exec.ClientActiveTexture)( ctx, target ); + (*ctx->Exec.ClientActiveTextureARB)( target ); } } @@ -2476,6 +3133,20 @@ void gl_save_error( GLcontext *ctx, GLenum error, const char *s ) /* execute already done */ } + +static GLboolean +islist(GLcontext *ctx, GLuint list) +{ + if (list > 0 && HashLookup(ctx->Shared->DisplayList, list)) { + return GL_TRUE; + } + else { + return GL_FALSE; + } +} + + + /**********************************************************************/ /* Display list execution */ /**********************************************************************/ @@ -2489,21 +3160,11 @@ void gl_save_error( GLcontext *ctx, GLenum error, const char *s ) */ static void execute_list( GLcontext *ctx, GLuint list ) { - static struct gl_pixelstore_attrib defaultPacking = { - 1, /* Alignment */ - 0, /* RowLength */ - 0, /* SkipPixels */ - 0, /* SkipRows */ - 0, /* ImageHeight */ - 0, /* SkipImages */ - GL_FALSE, /* SwapBytes */ - GL_FALSE /* LsbFirst */ - }; Node *n; GLboolean done; OpCode opcode; - if (!gl_IsList(ctx,list)) + if (!islist(ctx,list)) return; /* mesa_print_display_list( list ); */ @@ -2556,34 +3217,34 @@ static void execute_list( GLcontext *ctx, GLuint list ) break; } case OPCODE_ACCUM: - gl_Accum( ctx, n[1].e, n[2].f ); + (*ctx->Exec.Accum)( n[1].e, n[2].f ); break; case OPCODE_ALPHA_FUNC: - gl_AlphaFunc( ctx, n[1].e, n[2].f ); + (*ctx->Exec.AlphaFunc)( n[1].e, n[2].f ); break; case OPCODE_BIND_TEXTURE: - gl_BindTexture( ctx, n[1].e, n[2].ui ); + (*ctx->Exec.BindTexture)( n[1].e, n[2].ui ); break; case OPCODE_BITMAP: { - const struct gl_image *image = (struct gl_image *) n[7].data; - const GLubyte *bitmap = image ? image->Data : NULL; - gl_Bitmap( ctx, (GLsizei) n[1].i, (GLsizei) n[2].i, - n[3].f, n[4].f, n[5].f, n[6].f, - bitmap, &defaultPacking ); + struct gl_pixelstore_attrib save = ctx->Unpack; + ctx->Unpack = _mesa_native_packing; + (*ctx->Exec.Bitmap)( (GLsizei) n[1].i, (GLsizei) n[2].i, + n[3].f, n[4].f, n[5].f, n[6].f, n[7].data ); + ctx->Unpack = save; /* restore */ } break; case OPCODE_BLEND_COLOR: - gl_BlendColor( ctx, n[1].f, n[2].f, n[3].f, n[4].f ); + (*ctx->Exec.BlendColorEXT)( n[1].f, n[2].f, n[3].f, n[4].f ); break; case OPCODE_BLEND_EQUATION: - gl_BlendEquation( ctx, n[1].e ); + (*ctx->Exec.BlendEquationEXT)( n[1].e ); break; case OPCODE_BLEND_FUNC: - gl_BlendFunc( ctx, n[1].e, n[2].e ); + (*ctx->Exec.BlendFunc)( n[1].e, n[2].e ); break; case OPCODE_BLEND_FUNC_SEPARATE: - gl_BlendFuncSeparate( ctx, n[1].e, n[2].e, n[3].e, n[4].e ); + (*ctx->Exec.BlendFuncSeparateINGR)(n[1].e, n[2].e, n[3].e, n[4].e); break; case OPCODE_CALL_LIST: /* Generated by glCallList(), don't add ListBase */ @@ -2598,99 +3259,116 @@ static void execute_list( GLcontext *ctx, GLuint list ) } break; case OPCODE_CLEAR: - gl_Clear( ctx, n[1].bf ); + (*ctx->Exec.Clear)( n[1].bf ); break; case OPCODE_CLEAR_COLOR: - gl_ClearColor( ctx, n[1].f, n[2].f, n[3].f, n[4].f ); + (*ctx->Exec.ClearColor)( n[1].f, n[2].f, n[3].f, n[4].f ); break; case OPCODE_CLEAR_ACCUM: - gl_ClearAccum( ctx, n[1].f, n[2].f, n[3].f, n[4].f ); + (*ctx->Exec.ClearAccum)( n[1].f, n[2].f, n[3].f, n[4].f ); break; case OPCODE_CLEAR_DEPTH: - gl_ClearDepth( ctx, (GLclampd) n[1].f ); + (*ctx->Exec.ClearDepth)( (GLclampd) n[1].f ); break; case OPCODE_CLEAR_INDEX: - gl_ClearIndex( ctx, n[1].ui ); + (*ctx->Exec.ClearIndex)( n[1].ui ); break; case OPCODE_CLEAR_STENCIL: - gl_ClearStencil( ctx, n[1].i ); + (*ctx->Exec.ClearStencil)( n[1].i ); break; case OPCODE_CLIP_PLANE: { - GLfloat equ[4]; - equ[0] = n[2].f; - equ[1] = n[3].f; - equ[2] = n[4].f; - equ[3] = n[5].f; - gl_ClipPlane( ctx, n[1].e, equ ); + GLdouble eq[4]; + eq[0] = n[2].f; + eq[1] = n[3].f; + eq[2] = n[4].f; + eq[3] = n[5].f; + (*ctx->Exec.ClipPlane)( n[1].e, eq ); } break; case OPCODE_COLOR_MASK: - gl_ColorMask( ctx, n[1].b, n[2].b, n[3].b, n[4].b ); + (*ctx->Exec.ColorMask)( n[1].b, n[2].b, n[3].b, n[4].b ); break; case OPCODE_COLOR_MATERIAL: - gl_ColorMaterial( ctx, n[1].e, n[2].e ); + (*ctx->Exec.ColorMaterial)( n[1].e, n[2].e ); break; case OPCODE_COLOR_TABLE: - gl_ColorTable( ctx, n[1].e, n[2].e, (struct gl_image *) n[3].data); + { + struct gl_pixelstore_attrib save = ctx->Unpack; + ctx->Unpack = _mesa_native_packing; + (*ctx->Exec.ColorTableEXT)( n[1].e, n[2].e, n[3].i, n[4].e, + n[5].e, n[6].data ); + ctx->Unpack = save; /* restore */ + } break; case OPCODE_COLOR_SUB_TABLE: - gl_ColorSubTable( ctx, n[1].e, n[2].i, - (struct gl_image *) n[3].data); + { + struct gl_pixelstore_attrib save = ctx->Unpack; + ctx->Unpack = _mesa_native_packing; + (*ctx->Exec.ColorSubTableEXT)( n[1].e, n[2].i, n[3].i, + n[4].e, n[5].e, n[6].data ); + ctx->Unpack = save; /* restore */ + } break; case OPCODE_COPY_PIXELS: - gl_CopyPixels( ctx, n[1].i, n[2].i, + (*ctx->Exec.CopyPixels)( n[1].i, n[2].i, (GLsizei) n[3].i, (GLsizei) n[4].i, n[5].e ); break; case OPCODE_COPY_TEX_IMAGE1D: - gl_CopyTexImage1D( ctx, n[1].e, n[2].i, n[3].e, n[4].i, - n[5].i, n[6].i, n[7].i ); + (*ctx->Exec.CopyTexImage1D)( n[1].e, n[2].i, n[3].e, n[4].i, + n[5].i, n[6].i, n[7].i ); break; case OPCODE_COPY_TEX_IMAGE2D: - gl_CopyTexImage2D( ctx, n[1].e, n[2].i, n[3].e, n[4].i, - n[5].i, n[6].i, n[7].i, n[8].i ); + (*ctx->Exec.CopyTexImage2D)( n[1].e, n[2].i, n[3].e, n[4].i, + n[5].i, n[6].i, n[7].i, n[8].i ); break; case OPCODE_COPY_TEX_SUB_IMAGE1D: - gl_CopyTexSubImage1D( ctx, n[1].e, n[2].i, n[3].i, n[4].i, - n[5].i, n[6].i ); + (*ctx->Exec.CopyTexSubImage1D)( n[1].e, n[2].i, n[3].i, + n[4].i, n[5].i, n[6].i ); break; case OPCODE_COPY_TEX_SUB_IMAGE2D: - gl_CopyTexSubImage2D( ctx, n[1].e, n[2].i, n[3].i, n[4].i, - n[5].i, n[6].i, n[7].i, n[8].i ); + (*ctx->Exec.CopyTexSubImage2D)( n[1].e, n[2].i, n[3].i, + n[4].i, n[5].i, n[6].i, n[7].i, n[8].i ); break; case OPCODE_COPY_TEX_SUB_IMAGE3D: - gl_CopyTexSubImage3D( ctx, n[1].e, n[2].i, n[3].i, n[4].i, - n[5].i, n[6].i, n[7].i, n[8].i, n[9].i); + (*ctx->Exec.CopyTexSubImage3D)( n[1].e, n[2].i, n[3].i, + n[4].i, n[5].i, n[6].i, n[7].i, n[8].i , n[9].i); break; case OPCODE_CULL_FACE: - gl_CullFace( ctx, n[1].e ); + (*ctx->Exec.CullFace)( n[1].e ); break; case OPCODE_DEPTH_FUNC: - gl_DepthFunc( ctx, n[1].e ); + (*ctx->Exec.DepthFunc)( n[1].e ); break; case OPCODE_DEPTH_MASK: - gl_DepthMask( ctx, n[1].b ); + (*ctx->Exec.DepthMask)( n[1].b ); break; case OPCODE_DEPTH_RANGE: - gl_DepthRange( ctx, (GLclampd) n[1].f, (GLclampd) n[2].f ); + (*ctx->Exec.DepthRange)( (GLclampd) n[1].f, (GLclampd) n[2].f ); break; case OPCODE_DISABLE: - gl_Disable( ctx, n[1].e ); + (*ctx->Exec.Disable)( n[1].e ); break; case OPCODE_DRAW_BUFFER: - gl_DrawBuffer( ctx, n[1].e ); + (*ctx->Exec.DrawBuffer)( n[1].e ); break; case OPCODE_DRAW_PIXELS: - gl_DrawPixels( ctx, (struct gl_image *) n[1].data ); + { + struct gl_pixelstore_attrib save = ctx->Unpack; + ctx->Unpack = _mesa_native_packing; + (*ctx->Exec.DrawPixels)( n[1].i, n[2].i, n[3].e, n[4].e, + n[5].data ); + ctx->Unpack = save; /* restore */ + } break; case OPCODE_ENABLE: - gl_Enable( ctx, n[1].e ); + (*ctx->Exec.Enable)( n[1].e ); break; case OPCODE_EVALMESH1: - gl_EvalMesh1( ctx, n[1].e, n[2].i, n[3].i ); + (*ctx->Exec.EvalMesh1)( n[1].e, n[2].i, n[3].i ); break; case OPCODE_EVALMESH2: - gl_EvalMesh2( ctx, n[1].e, n[2].i, n[3].i, n[4].i, n[5].i ); + (*ctx->Exec.EvalMesh2)( n[1].e, n[2].i, n[3].i, n[4].i, n[5].i ); break; case OPCODE_FOG: { @@ -2699,23 +3377,23 @@ static void execute_list( GLcontext *ctx, GLuint list ) p[1] = n[3].f; p[2] = n[4].f; p[3] = n[5].f; - gl_Fogfv( ctx, n[1].e, p ); + (*ctx->Exec.Fogfv)( n[1].e, p ); } break; case OPCODE_FRONT_FACE: - gl_FrontFace( ctx, n[1].e ); + (*ctx->Exec.FrontFace)( n[1].e ); break; case OPCODE_FRUSTUM: - gl_Frustum( ctx, n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f ); + (*ctx->Exec.Frustum)( n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f ); break; case OPCODE_HINT: - gl_Hint( ctx, n[1].e, n[2].e ); + (*ctx->Exec.Hint)( n[1].e, n[2].e ); break; case OPCODE_INDEX_MASK: - gl_IndexMask( ctx, n[1].ui ); + (*ctx->Exec.IndexMask)( n[1].ui ); break; case OPCODE_INIT_NAMES: - gl_InitNames( ctx ); + (*ctx->Exec.InitNames)(); break; case OPCODE_LIGHT: { @@ -2724,7 +3402,7 @@ static void execute_list( GLcontext *ctx, GLuint list ) p[1] = n[4].f; p[2] = n[5].f; p[3] = n[6].f; - gl_Lightfv( ctx, n[1].e, n[2].e, p, 4 ); + (*ctx->Exec.Lightfv)( n[1].e, n[2].e, p ); } break; case OPCODE_LIGHT_MODEL: @@ -2734,24 +3412,24 @@ static void execute_list( GLcontext *ctx, GLuint list ) p[1] = n[3].f; p[2] = n[4].f; p[3] = n[5].f; - gl_LightModelfv( ctx, n[1].e, p ); + (*ctx->Exec.LightModelfv)( n[1].e, p ); } break; case OPCODE_LINE_STIPPLE: - gl_LineStipple( ctx, n[1].i, n[2].us ); + (*ctx->Exec.LineStipple)( n[1].i, n[2].us ); break; case OPCODE_LINE_WIDTH: - gl_LineWidth( ctx, n[1].f ); + (*ctx->Exec.LineWidth)( n[1].f ); break; case OPCODE_LIST_BASE: - gl_ListBase( ctx, n[1].ui ); + (*ctx->Exec.ListBase)( n[1].ui ); break; case OPCODE_LOAD_IDENTITY: - gl_LoadIdentity( ctx ); + (*ctx->Exec.LoadIdentity)(); break; case OPCODE_LOAD_MATRIX: if (sizeof(Node)==sizeof(GLfloat)) { - gl_LoadMatrixf( ctx, &n[1].f ); + (*ctx->Exec.LoadMatrixf)( &n[1].f ); } else { GLfloat m[16]; @@ -2759,40 +3437,54 @@ static void execute_list( GLcontext *ctx, GLuint list ) for (i=0;i<16;i++) { m[i] = n[1+i].f; } - gl_LoadMatrixf( ctx, m ); + (*ctx->Exec.LoadMatrixf)( m ); } break; case OPCODE_LOAD_NAME: - gl_LoadName( ctx, n[1].ui ); + (*ctx->Exec.LoadName)( n[1].ui ); break; case OPCODE_LOGIC_OP: - gl_LogicOp( ctx, n[1].e ); + (*ctx->Exec.LogicOp)( n[1].e ); break; case OPCODE_MAP1: - gl_Map1f( ctx, n[1].e, n[2].f, n[3].f, - n[4].i, n[5].i, (GLfloat *) n[6].data, GL_TRUE ); + { + GLenum target = n[1].e; + GLint ustride = _mesa_evaluator_components(target); + GLint uorder = n[5].i; + GLfloat u1 = n[2].f; + GLfloat u2 = n[3].f; + (*ctx->Exec.Map1f)( target, u1, u2, ustride, uorder, + (GLfloat *) n[6].data ); + } break; case OPCODE_MAP2: - gl_Map2f( ctx, n[1].e, - n[2].f, n[3].f, /* u1, u2 */ - n[6].i, n[8].i, /* ustride, uorder */ - n[4].f, n[5].f, /* v1, v2 */ - n[7].i, n[9].i, /* vstride, vorder */ - (GLfloat *) n[10].data, - GL_TRUE); + { + GLenum target = n[1].e; + GLfloat u1 = n[2].f; + GLfloat u2 = n[3].f; + GLfloat v1 = n[4].f; + GLfloat v2 = n[5].f; + GLint ustride = n[6].i; + GLint vstride = n[7].i; + GLint uorder = n[8].i; + GLint vorder = n[9].i; + (*ctx->Exec.Map2f)( target, u1, u2, ustride, uorder, + v1, v2, vstride, vorder, + (GLfloat *) n[10].data ); + } break; case OPCODE_MAPGRID1: - gl_MapGrid1f( ctx, n[1].i, n[2].f, n[3].f ); + (*ctx->Exec.MapGrid1f)( n[1].i, n[2].f, n[3].f ); break; case OPCODE_MAPGRID2: - gl_MapGrid2f( ctx, n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f); + (*ctx->Exec.MapGrid2f)( n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f); break; case OPCODE_MATRIX_MODE: - gl_MatrixMode( ctx, n[1].e ); + (*ctx->Exec.MatrixMode)( n[1].e ); break; case OPCODE_MULT_MATRIX: if (sizeof(Node)==sizeof(GLfloat)) { - gl_MultMatrixf( ctx, &n[1].f ); + (*ctx->Exec.MultMatrixf)( &n[1].f ); } else { GLfloat m[16]; @@ -2800,26 +3492,26 @@ static void execute_list( GLcontext *ctx, GLuint list ) for (i=0;i<16;i++) { m[i] = n[1+i].f; } - gl_MultMatrixf( ctx, m ); + (*ctx->Exec.MultMatrixf)( m ); } break; case OPCODE_ORTHO: - gl_Ortho( ctx, n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f ); + (*ctx->Exec.Ortho)( n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f ); break; case OPCODE_PASSTHROUGH: - gl_PassThrough( ctx, n[1].f ); + (*ctx->Exec.PassThrough)( n[1].f ); break; case OPCODE_PIXEL_MAP: - gl_PixelMapfv( ctx, n[1].e, n[2].i, (GLfloat *) n[3].data ); + (*ctx->Exec.PixelMapfv)( n[1].e, n[2].i, (GLfloat *) n[3].data ); break; case OPCODE_PIXEL_TRANSFER: - gl_PixelTransferf( ctx, n[1].e, n[2].f ); + (*ctx->Exec.PixelTransferf)( n[1].e, n[2].f ); break; case OPCODE_PIXEL_ZOOM: - gl_PixelZoom( ctx, n[1].f, n[2].f ); + (*ctx->Exec.PixelZoom)( n[1].f, n[2].f ); break; case OPCODE_POINT_SIZE: - gl_PointSize( ctx, n[1].f ); + (*ctx->Exec.PointSize)( n[1].f ); break; case OPCODE_POINT_PARAMETERS: { @@ -2827,65 +3519,65 @@ static void execute_list( GLcontext *ctx, GLuint list ) params[0] = n[2].f; params[1] = n[3].f; params[2] = n[4].f; - gl_PointParameterfvEXT( ctx, n[1].e, params ); + (*ctx->Exec.PointParameterfvEXT)( n[1].e, params ); } break; case OPCODE_POLYGON_MODE: - gl_PolygonMode( ctx, n[1].e, n[2].e ); + (*ctx->Exec.PolygonMode)( n[1].e, n[2].e ); break; case OPCODE_POLYGON_STIPPLE: - gl_PolygonStipple( ctx, (GLuint *) n[1].data ); + (*ctx->Exec.PolygonStipple)( (GLubyte *) n[1].data ); break; case OPCODE_POLYGON_OFFSET: - gl_PolygonOffset( ctx, n[1].f, n[2].f ); + (*ctx->Exec.PolygonOffset)( n[1].f, n[2].f ); break; case OPCODE_POP_ATTRIB: - gl_PopAttrib( ctx ); + (*ctx->Exec.PopAttrib)(); break; case OPCODE_POP_MATRIX: - gl_PopMatrix( ctx ); + (*ctx->Exec.PopMatrix)(); break; case OPCODE_POP_NAME: - gl_PopName( ctx ); + (*ctx->Exec.PopName)(); break; case OPCODE_PRIORITIZE_TEXTURE: - gl_PrioritizeTextures( ctx, 1, &n[1].ui, &n[2].f ); + (*ctx->Exec.PrioritizeTextures)( 1, &n[1].ui, &n[2].f ); break; case OPCODE_PUSH_ATTRIB: - gl_PushAttrib( ctx, n[1].bf ); + (*ctx->Exec.PushAttrib)( n[1].bf ); break; case OPCODE_PUSH_MATRIX: - gl_PushMatrix( ctx ); + (*ctx->Exec.PushMatrix)(); break; case OPCODE_PUSH_NAME: - gl_PushName( ctx, n[1].ui ); + (*ctx->Exec.PushName)( n[1].ui ); break; case OPCODE_RASTER_POS: - gl_RasterPos4f( ctx, n[1].f, n[2].f, n[3].f, n[4].f ); + (*ctx->Exec.RasterPos4f)( n[1].f, n[2].f, n[3].f, n[4].f ); break; case OPCODE_READ_BUFFER: - gl_ReadBuffer( ctx, n[1].e ); + (*ctx->Exec.ReadBuffer)( n[1].e ); break; case OPCODE_RECTF: - gl_Rectf( ctx, n[1].f, n[2].f, n[3].f, n[4].f ); + (*ctx->Exec.Rectf)( n[1].f, n[2].f, n[3].f, n[4].f ); break; case OPCODE_SCALE: - gl_Scalef( ctx, n[1].f, n[2].f, n[3].f ); + (*ctx->Exec.Scalef)( n[1].f, n[2].f, n[3].f ); break; case OPCODE_SCISSOR: - gl_Scissor( ctx, n[1].i, n[2].i, n[3].i, n[4].i ); + (*ctx->Exec.Scissor)( n[1].i, n[2].i, n[3].i, n[4].i ); break; case OPCODE_SHADE_MODEL: - gl_ShadeModel( ctx, n[1].e ); + (*ctx->Exec.ShadeModel)( n[1].e ); break; case OPCODE_STENCIL_FUNC: - gl_StencilFunc( ctx, n[1].e, n[2].i, n[3].ui ); + (*ctx->Exec.StencilFunc)( n[1].e, n[2].i, n[3].ui ); break; case OPCODE_STENCIL_MASK: - gl_StencilMask( ctx, n[1].ui ); + (*ctx->Exec.StencilMask)( n[1].ui ); break; case OPCODE_STENCIL_OP: - gl_StencilOp( ctx, n[1].e, n[2].e, n[3].e ); + (*ctx->Exec.StencilOp)( n[1].e, n[2].e, n[3].e ); break; case OPCODE_TEXENV: { @@ -2894,7 +3586,7 @@ static void execute_list( GLcontext *ctx, GLuint list ) params[1] = n[4].f; params[2] = n[5].f; params[3] = n[6].f; - gl_TexEnvfv( ctx, n[1].e, n[2].e, params ); + (*ctx->Exec.TexEnvfv)( n[1].e, n[2].e, params ); } break; case OPCODE_TEXGEN: @@ -2904,7 +3596,7 @@ static void execute_list( GLcontext *ctx, GLuint list ) params[1] = n[4].f; params[2] = n[5].f; params[3] = n[6].f; - gl_TexGenfv( ctx, n[1].e, n[2].e, params ); + (*ctx->Exec.TexGenfv)( n[1].e, n[2].e, params ); } break; case OPCODE_TEXPARAMETER: @@ -2914,74 +3606,75 @@ static void execute_list( GLcontext *ctx, GLuint list ) params[1] = n[4].f; params[2] = n[5].f; params[3] = n[6].f; - gl_TexParameterfv( ctx, n[1].e, n[2].e, params ); + (*ctx->Exec.TexParameterfv)( n[1].e, n[2].e, params ); } break; case OPCODE_TEX_IMAGE1D: { struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = defaultPacking; - gl_TexImage1D( ctx, - n[1].e, /* target */ - n[2].i, /* level */ - n[3].i, /* components */ - n[4].i, /* width */ - n[5].e, /* border */ - n[6].e, /* format */ - n[7].e, /* type */ - n[8].data ); + ctx->Unpack = _mesa_native_packing; + (*ctx->Exec.TexImage1D)( + n[1].e, /* target */ + n[2].i, /* level */ + n[3].i, /* components */ + n[4].i, /* width */ + n[5].e, /* border */ + n[6].e, /* format */ + n[7].e, /* type */ + n[8].data ); ctx->Unpack = save; /* restore */ } break; case OPCODE_TEX_IMAGE2D: { struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = defaultPacking; - gl_TexImage2D( ctx, - n[1].e, /* target */ - n[2].i, /* level */ - n[3].i, /* components */ - n[4].i, /* width */ - n[5].i, /* height */ - n[6].e, /* border */ - n[7].e, /* format */ - n[8].e, /* type */ - n[9].data ); + ctx->Unpack = _mesa_native_packing; + (*ctx->Exec.TexImage2D)( + n[1].e, /* target */ + n[2].i, /* level */ + n[3].i, /* components */ + n[4].i, /* width */ + n[5].i, /* height */ + n[6].e, /* border */ + n[7].e, /* format */ + n[8].e, /* type */ + n[9].data ); ctx->Unpack = save; /* restore */ } break; case OPCODE_TEX_IMAGE3D: { struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = defaultPacking; - gl_TexImage3D( ctx, - n[1].e, /* target */ - n[2].i, /* level */ - n[3].i, /* components */ - n[4].i, /* width */ - n[5].i, /* height */ - n[6].i, /* depth */ - n[7].e, /* border */ - n[8].e, /* format */ - n[9].e, /* type */ - n[10].data ); + ctx->Unpack = _mesa_native_packing; + (*ctx->Exec.TexImage3D)( + n[1].e, /* target */ + n[2].i, /* level */ + n[3].i, /* components */ + n[4].i, /* width */ + n[5].i, /* height */ + n[6].i, /* depth */ + n[7].e, /* border */ + n[8].e, /* format */ + n[9].e, /* type */ + n[10].data ); ctx->Unpack = save; /* restore */ } break; case OPCODE_TEX_SUB_IMAGE1D: { struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = defaultPacking; - gl_TexSubImage1D( ctx, n[1].e, n[2].i, n[3].i, n[4].i, n[5].e, - n[6].e, n[7].data ); + ctx->Unpack = _mesa_native_packing; + (*ctx->Exec.TexSubImage1D)( n[1].e, n[2].i, n[3].i, + n[4].i, n[5].e, + n[6].e, n[7].data ); ctx->Unpack = save; /* restore */ } break; case OPCODE_TEX_SUB_IMAGE2D: { struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = defaultPacking; - (*ctx->Exec.TexSubImage2D)( ctx, n[1].e, n[2].i, n[3].i, + ctx->Unpack = _mesa_native_packing; + (*ctx->Exec.TexSubImage2D)( n[1].e, n[2].i, n[3].i, n[4].i, n[5].e, n[6].i, n[7].e, n[8].e, n[9].data ); ctx->Unpack = save; /* restore */ @@ -2990,28 +3683,29 @@ static void execute_list( GLcontext *ctx, GLuint list ) case OPCODE_TEX_SUB_IMAGE3D: { struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = defaultPacking; - gl_TexSubImage3D( ctx, n[1].e, n[2].i, n[3].i, n[4].i, n[5].i, - n[6].i, n[7].i, n[8].i, n[9].e, n[10].e, - n[11].data ); + ctx->Unpack = _mesa_native_packing; + (*ctx->Exec.TexSubImage3D)( n[1].e, n[2].i, n[3].i, + n[4].i, n[5].i, n[6].i, n[7].i, + n[8].i, n[9].e, n[10].e, + n[11].data ); ctx->Unpack = save; /* restore */ } break; case OPCODE_TRANSLATE: - gl_Translatef( ctx, n[1].f, n[2].f, n[3].f ); + (*ctx->Exec.Translatef)( n[1].f, n[2].f, n[3].f ); break; case OPCODE_VIEWPORT: - gl_Viewport( ctx, - n[1].i, n[2].i, (GLsizei) n[3].i, (GLsizei) n[4].i ); + (*ctx->Exec.Viewport)(n[1].i, n[2].i, + (GLsizei) n[3].i, (GLsizei) n[4].i); break; case OPCODE_WINDOW_POS: - gl_WindowPos4fMESA( ctx, n[1].f, n[2].f, n[3].f, n[4].f ); + (*ctx->Exec.WindowPos4fMESA)( n[1].f, n[2].f, n[3].f, n[4].f ); break; case OPCODE_ACTIVE_TEXTURE: /* GL_ARB_multitexture */ - gl_ActiveTexture( ctx, n[1].e ); + (*ctx->Exec.ActiveTextureARB)( n[1].e ); break; case OPCODE_CLIENT_ACTIVE_TEXTURE: /* GL_ARB_multitexture */ - gl_ClientActiveTexture( ctx, n[1].e ); + (*ctx->Exec.ClientActiveTextureARB)( n[1].e ); break; case OPCODE_CONTINUE: n = (Node *) n[1].next; @@ -3051,23 +3745,21 @@ static void execute_list( GLcontext *ctx, GLuint list ) /* * Test if a display list number is valid. */ -GLboolean gl_IsList( GLcontext *ctx, GLuint list ) +GLboolean +_mesa_IsList( GLuint list ) { - if (list > 0 && HashLookup(ctx->Shared->DisplayList, list)) { - return GL_TRUE; - } - else { - return GL_FALSE; - } + GET_CURRENT_CONTEXT(ctx); + return islist(ctx, list); } - /* * Delete a sequence of consecutive display lists. */ -void gl_DeleteLists( GLcontext *ctx, GLuint list, GLsizei range ) +void +_mesa_DeleteLists( GLuint list, GLsizei range ) { + GET_CURRENT_CONTEXT(ctx); GLuint i; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDeleteLists"); @@ -3086,8 +3778,10 @@ void gl_DeleteLists( GLcontext *ctx, GLuint list, GLsizei range ) * Return a display list number, n, such that lists n through n+range-1 * are free. */ -GLuint gl_GenLists( GLcontext *ctx, GLsizei range ) +GLuint +_mesa_GenLists(GLsizei range ) { + GET_CURRENT_CONTEXT(ctx); GLuint base; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glGenLists", 0); @@ -3115,8 +3809,10 @@ GLuint gl_GenLists( GLcontext *ctx, GLsizei range ) /* * Begin a new display list. */ -void gl_NewList( GLcontext *ctx, GLuint list, GLenum mode ) +void +_mesa_NewList( GLuint list, GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); struct immediate *IM; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glNewList"); @@ -3152,7 +3848,9 @@ void gl_NewList( GLcontext *ctx, GLuint list, GLenum mode ) ctx->CompileFlag = GL_TRUE; ctx->CompileCVAFlag = GL_FALSE; ctx->ExecuteFlag = (mode == GL_COMPILE_AND_EXECUTE); - ctx->API = ctx->Save; /* Switch the API function pointers */ + + ctx->CurrentDispatch = &ctx->Save; + _glapi_set_dispatch( ctx->CurrentDispatch ); } @@ -3160,8 +3858,10 @@ void gl_NewList( GLcontext *ctx, GLuint list, GLenum mode ) /* * End definition of current display list. */ -void gl_EndList( GLcontext *ctx ) +void +_mesa_EndList( void ) { + GET_CURRENT_CONTEXT(ctx); if (MESA_VERBOSE&VERBOSE_API) fprintf(stderr, "glEndList\n"); @@ -3202,13 +3902,16 @@ void gl_EndList( GLcontext *ctx ) */ ctx->NewState = ~0; - ctx->API = ctx->Exec; /* Switch the API function pointers */ + ctx->CurrentDispatch = &ctx->Exec; + _glapi_set_dispatch( ctx->CurrentDispatch ); } -void gl_CallList( GLcontext *ctx, GLuint list ) +void +_mesa_CallList( GLuint list ) { + GET_CURRENT_CONTEXT(ctx); /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */ /* execute the display list, and restore the CompileFlag. */ GLboolean save_compile_flag; @@ -3226,8 +3929,10 @@ void gl_CallList( GLcontext *ctx, GLuint list ) ctx->CompileFlag = save_compile_flag; /* also restore API function pointers to point to "save" versions */ - if (save_compile_flag) - ctx->API = ctx->Save; + if (save_compile_flag) { + ctx->CurrentDispatch = &ctx->Save; + _glapi_set_dispatch( ctx->CurrentDispatch ); + } } @@ -3235,9 +3940,10 @@ void gl_CallList( GLcontext *ctx, GLuint list ) /* * Execute glCallLists: call multiple display lists. */ -void gl_CallLists( GLcontext *ctx, - GLsizei n, GLenum type, const GLvoid *lists ) +void +_mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists ) { + GET_CURRENT_CONTEXT(ctx); GLuint list; GLint i; GLboolean save_compile_flag; @@ -3258,9 +3964,10 @@ void gl_CallLists( GLcontext *ctx, ctx->CompileFlag = save_compile_flag; /* also restore API function pointers to point to "save" versions */ - if (save_compile_flag) - ctx->API = ctx->Save; - + if (save_compile_flag) { + ctx->CurrentDispatch = &ctx->Save; + _glapi_set_dispatch( ctx->CurrentDispatch ); + } /* RESET_IMMEDIATE( ctx ); */ } @@ -3270,8 +3977,10 @@ void gl_CallLists( GLcontext *ctx, /* * Set the offset added to list numbers in glCallLists. */ -void gl_ListBase( GLcontext *ctx, GLuint base ) +void +_mesa_ListBase( GLuint base ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glListBase"); ctx->List.ListBase = base; } @@ -3279,23 +3988,18 @@ void gl_ListBase( GLcontext *ctx, GLuint base ) - - /* * Assign all the pointers in 'table' to point to Mesa's display list * building functions. */ -void gl_init_dlist_pointers( struct gl_api_table *table ) +void +_mesa_init_dlist_table( struct _glapi_table *table ) { table->Accum = save_Accum; table->AlphaFunc = save_AlphaFunc; - table->AreTexturesResident = gl_AreTexturesResident; - table->BindTexture = save_BindTexture; + table->Begin = save_Begin; table->Bitmap = save_Bitmap; - table->BlendColor = save_BlendColor; - table->BlendEquation = save_BlendEquation; table->BlendFunc = save_BlendFunc; - table->BlendFuncSeparate = save_BlendFuncSeparate; table->CallList = save_CallList; table->CallLists = save_CallLists; table->Clear = save_Clear; @@ -3305,150 +4009,455 @@ void gl_init_dlist_pointers( struct gl_api_table *table ) table->ClearIndex = save_ClearIndex; table->ClearStencil = save_ClearStencil; table->ClipPlane = save_ClipPlane; + table->Color3b = _mesa_Color3b; + table->Color3bv = _mesa_Color3bv; + table->Color3d = _mesa_Color3d; + table->Color3dv = _mesa_Color3dv; + table->Color3f = _mesa_Color3f; + table->Color3fv = _mesa_Color3fv; + table->Color3i = _mesa_Color3i; + table->Color3iv = _mesa_Color3iv; + table->Color3s = _mesa_Color3s; + table->Color3sv = _mesa_Color3sv; + table->Color3ub = _mesa_Color3ub; + table->Color3ubv = _mesa_Color3ubv; + table->Color3ui = _mesa_Color3ui; + table->Color3uiv = _mesa_Color3uiv; + table->Color3us = _mesa_Color3us; + table->Color3usv = _mesa_Color3usv; + table->Color4b = _mesa_Color4b; + table->Color4bv = _mesa_Color4bv; + table->Color4d = _mesa_Color4d; + table->Color4dv = _mesa_Color4dv; + table->Color4f = _mesa_Color4f; + table->Color4fv = _mesa_Color4fv; + table->Color4i = _mesa_Color4i; + table->Color4iv = _mesa_Color4iv; + table->Color4s = _mesa_Color4s; + table->Color4sv = _mesa_Color4sv; + table->Color4ub = _mesa_Color4ub; + table->Color4ubv = _mesa_Color4ubv; + table->Color4ui = _mesa_Color4ui; + table->Color4uiv = _mesa_Color4uiv; + table->Color4us = _mesa_Color4us; + table->Color4usv = _mesa_Color4usv; table->ColorMask = save_ColorMask; table->ColorMaterial = save_ColorMaterial; - table->ColorTable = save_ColorTable; - table->ColorSubTable = save_ColorSubTable; table->CopyPixels = save_CopyPixels; - table->CopyTexImage1D = save_CopyTexImage1D; - table->CopyTexImage2D = save_CopyTexImage2D; - table->CopyTexSubImage1D = save_CopyTexSubImage1D; - table->CopyTexSubImage2D = save_CopyTexSubImage2D; - table->CopyTexSubImage3D = save_CopyTexSubImage3D; table->CullFace = save_CullFace; - table->DeleteLists = gl_DeleteLists; /* NOT SAVED */ - table->DeleteTextures = gl_DeleteTextures; /* NOT SAVED */ + table->DeleteLists = _mesa_DeleteLists; table->DepthFunc = save_DepthFunc; table->DepthMask = save_DepthMask; table->DepthRange = save_DepthRange; table->Disable = save_Disable; - table->DisableClientState = gl_DisableClientState; /* NOT SAVED */ table->DrawBuffer = save_DrawBuffer; table->DrawPixels = save_DrawPixels; + table->EdgeFlag = _mesa_EdgeFlag; + table->EdgeFlagv = _mesa_EdgeFlagv; table->Enable = save_Enable; - table->Error = gl_save_error; - table->EnableClientState = gl_EnableClientState; /* NOT SAVED */ - table->EndList = gl_EndList; /* NOT SAVED */ + table->End = _mesa_End; + table->EndList = _mesa_EndList; + table->EvalCoord1d = _mesa_EvalCoord1d; + table->EvalCoord1dv = _mesa_EvalCoord1dv; + table->EvalCoord1f = _mesa_EvalCoord1f; + table->EvalCoord1fv = _mesa_EvalCoord1fv; + table->EvalCoord2d = _mesa_EvalCoord2d; + table->EvalCoord2dv = _mesa_EvalCoord2dv; + table->EvalCoord2f = _mesa_EvalCoord2f; + table->EvalCoord2fv = _mesa_EvalCoord2fv; table->EvalMesh1 = save_EvalMesh1; table->EvalMesh2 = save_EvalMesh2; - table->FeedbackBuffer = gl_FeedbackBuffer; /* NOT SAVED */ - table->Finish = gl_Finish; /* NOT SAVED */ - table->Flush = gl_Flush; /* NOT SAVED */ + table->EvalPoint1 = _mesa_EvalPoint1; + table->EvalPoint2 = _mesa_EvalPoint2; + table->FeedbackBuffer = _mesa_FeedbackBuffer; + table->Finish = _mesa_Finish; + table->Flush = _mesa_Flush; + table->Fogf = save_Fogf; table->Fogfv = save_Fogfv; + table->Fogi = save_Fogi; + table->Fogiv = save_Fogiv; table->FrontFace = save_FrontFace; table->Frustum = save_Frustum; - table->GenLists = gl_GenLists; /* NOT SAVED */ - table->GenTextures = gl_GenTextures; /* NOT SAVED */ - - /* NONE OF THESE COMMANDS ARE COMPILED INTO DISPLAY LISTS */ - table->GetBooleanv = gl_GetBooleanv; - table->GetClipPlane = gl_GetClipPlane; - table->GetColorTable = gl_GetColorTable; - table->GetColorTableParameteriv = gl_GetColorTableParameteriv; - table->GetDoublev = gl_GetDoublev; - table->GetError = gl_GetError; - table->GetFloatv = gl_GetFloatv; - table->GetIntegerv = gl_GetIntegerv; - table->GetString = gl_GetString; - table->GetLightfv = gl_GetLightfv; - table->GetLightiv = gl_GetLightiv; - table->GetMapdv = gl_GetMapdv; - table->GetMapfv = gl_GetMapfv; - table->GetMapiv = gl_GetMapiv; - table->GetMaterialfv = gl_GetMaterialfv; - table->GetMaterialiv = gl_GetMaterialiv; - table->GetPixelMapfv = gl_GetPixelMapfv; - table->GetPixelMapuiv = gl_GetPixelMapuiv; - table->GetPixelMapusv = gl_GetPixelMapusv; - table->GetPointerv = gl_GetPointerv; - table->GetPolygonStipple = gl_GetPolygonStipple; - table->GetTexEnvfv = gl_GetTexEnvfv; - table->GetTexEnviv = gl_GetTexEnviv; - table->GetTexGendv = gl_GetTexGendv; - table->GetTexGenfv = gl_GetTexGenfv; - table->GetTexGeniv = gl_GetTexGeniv; - table->GetTexImage = gl_GetTexImage; - table->GetTexLevelParameterfv = gl_GetTexLevelParameterfv; - table->GetTexLevelParameteriv = gl_GetTexLevelParameteriv; - table->GetTexParameterfv = gl_GetTexParameterfv; - table->GetTexParameteriv = gl_GetTexParameteriv; - + table->GenLists = _mesa_GenLists; + table->GetBooleanv = _mesa_GetBooleanv; + table->GetClipPlane = _mesa_GetClipPlane; + table->GetDoublev = _mesa_GetDoublev; + table->GetError = _mesa_GetError; + table->GetFloatv = _mesa_GetFloatv; + table->GetIntegerv = _mesa_GetIntegerv; + table->GetLightfv = _mesa_GetLightfv; + table->GetLightiv = _mesa_GetLightiv; + table->GetMapdv = _mesa_GetMapdv; + table->GetMapfv = _mesa_GetMapfv; + table->GetMapiv = _mesa_GetMapiv; + table->GetMaterialfv = _mesa_GetMaterialfv; + table->GetMaterialiv = _mesa_GetMaterialiv; + table->GetPixelMapfv = _mesa_GetPixelMapfv; + table->GetPixelMapuiv = _mesa_GetPixelMapuiv; + table->GetPixelMapusv = _mesa_GetPixelMapusv; + table->GetPolygonStipple = _mesa_GetPolygonStipple; + table->GetString = _mesa_GetString; + table->GetTexEnvfv = _mesa_GetTexEnvfv; + table->GetTexEnviv = _mesa_GetTexEnviv; + table->GetTexGendv = _mesa_GetTexGendv; + table->GetTexGenfv = _mesa_GetTexGenfv; + table->GetTexGeniv = _mesa_GetTexGeniv; + table->GetTexImage = _mesa_GetTexImage; + table->GetTexLevelParameterfv = _mesa_GetTexLevelParameterfv; + table->GetTexLevelParameteriv = _mesa_GetTexLevelParameteriv; + table->GetTexParameterfv = _mesa_GetTexParameterfv; + table->GetTexParameteriv = _mesa_GetTexParameteriv; table->Hint = save_Hint; table->IndexMask = save_IndexMask; + table->Indexd = _mesa_Indexd; + table->Indexdv = _mesa_Indexdv; + table->Indexf = _mesa_Indexf; + table->Indexfv = _mesa_Indexfv; + table->Indexi = _mesa_Indexi; + table->Indexiv = _mesa_Indexiv; + table->Indexs = _mesa_Indexs; + table->Indexsv = _mesa_Indexsv; table->InitNames = save_InitNames; - table->IsEnabled = gl_IsEnabled; /* NOT SAVED */ - table->IsTexture = gl_IsTexture; /* NOT SAVED */ - table->IsList = gl_IsList; /* NOT SAVED */ + table->IsEnabled = _mesa_IsEnabled; + table->IsList = _mesa_IsList; + table->LightModelf = save_LightModelf; table->LightModelfv = save_LightModelfv; + table->LightModeli = save_LightModeli; + table->LightModeliv = save_LightModeliv; + table->Lightf = save_Lightf; table->Lightfv = save_Lightfv; + table->Lighti = save_Lighti; + table->Lightiv = save_Lightiv; table->LineStipple = save_LineStipple; table->LineWidth = save_LineWidth; table->ListBase = save_ListBase; table->LoadIdentity = save_LoadIdentity; + table->LoadMatrixd = save_LoadMatrixd; table->LoadMatrixf = save_LoadMatrixf; table->LoadName = save_LoadName; table->LogicOp = save_LogicOp; + table->Map1d = save_Map1d; table->Map1f = save_Map1f; + table->Map2d = save_Map2d; table->Map2f = save_Map2f; + table->MapGrid1d = save_MapGrid1d; table->MapGrid1f = save_MapGrid1f; + table->MapGrid2d = save_MapGrid2d; table->MapGrid2f = save_MapGrid2f; + table->Materialf = _mesa_Materialf; + table->Materialfv = _mesa_Materialfv; + table->Materiali = _mesa_Materiali; + table->Materialiv = _mesa_Materialiv; table->MatrixMode = save_MatrixMode; + table->MultMatrixd = save_MultMatrixd; table->MultMatrixf = save_MultMatrixf; table->NewList = save_NewList; + table->Normal3b = _mesa_Normal3b; + table->Normal3bv = _mesa_Normal3bv; + table->Normal3d = _mesa_Normal3d; + table->Normal3dv = _mesa_Normal3dv; + table->Normal3f = _mesa_Normal3f; + table->Normal3fv = _mesa_Normal3fv; + table->Normal3i = _mesa_Normal3i; + table->Normal3iv = _mesa_Normal3iv; + table->Normal3s = _mesa_Normal3s; + table->Normal3sv = _mesa_Normal3sv; table->Ortho = save_Ortho; - table->PointParameterfvEXT = save_PointParameterfvEXT; table->PassThrough = save_PassThrough; table->PixelMapfv = save_PixelMapfv; - table->PixelStorei = gl_PixelStorei; /* NOT SAVED */ + table->PixelMapuiv = save_PixelMapuiv; + table->PixelMapusv = save_PixelMapusv; + table->PixelStoref = _mesa_PixelStoref; + table->PixelStorei = _mesa_PixelStorei; table->PixelTransferf = save_PixelTransferf; + table->PixelTransferi = save_PixelTransferi; table->PixelZoom = save_PixelZoom; table->PointSize = save_PointSize; table->PolygonMode = save_PolygonMode; table->PolygonOffset = save_PolygonOffset; table->PolygonStipple = save_PolygonStipple; table->PopAttrib = save_PopAttrib; - table->PopClientAttrib = gl_PopClientAttrib; /* NOT SAVED */ table->PopMatrix = save_PopMatrix; table->PopName = save_PopName; - table->PrioritizeTextures = save_PrioritizeTextures; table->PushAttrib = save_PushAttrib; - table->PushClientAttrib = gl_PushClientAttrib; /* NOT SAVED */ table->PushMatrix = save_PushMatrix; table->PushName = save_PushName; + table->RasterPos2d = save_RasterPos2d; + table->RasterPos2dv = save_RasterPos2dv; + table->RasterPos2f = save_RasterPos2f; + table->RasterPos2fv = save_RasterPos2fv; + table->RasterPos2i = save_RasterPos2i; + table->RasterPos2iv = save_RasterPos2iv; + table->RasterPos2s = save_RasterPos2s; + table->RasterPos2sv = save_RasterPos2sv; + table->RasterPos3d = save_RasterPos3d; + table->RasterPos3dv = save_RasterPos3dv; + table->RasterPos3f = save_RasterPos3f; + table->RasterPos3fv = save_RasterPos3fv; + table->RasterPos3i = save_RasterPos3i; + table->RasterPos3iv = save_RasterPos3iv; + table->RasterPos3s = save_RasterPos3s; + table->RasterPos3sv = save_RasterPos3sv; + table->RasterPos4d = save_RasterPos4d; + table->RasterPos4dv = save_RasterPos4dv; table->RasterPos4f = save_RasterPos4f; + table->RasterPos4fv = save_RasterPos4fv; + table->RasterPos4i = save_RasterPos4i; + table->RasterPos4iv = save_RasterPos4iv; + table->RasterPos4s = save_RasterPos4s; + table->RasterPos4sv = save_RasterPos4sv; table->ReadBuffer = save_ReadBuffer; - table->ReadPixels = gl_ReadPixels; /* NOT SAVED */ + table->ReadPixels = _mesa_ReadPixels; + table->Rectd = save_Rectd; + table->Rectdv = save_Rectdv; table->Rectf = save_Rectf; - table->RenderMode = gl_RenderMode; /* NOT SAVED */ + table->Rectfv = save_Rectfv; + table->Recti = save_Recti; + table->Rectiv = save_Rectiv; + table->Rects = save_Rects; + table->Rectsv = save_Rectsv; + table->RenderMode = _mesa_RenderMode; + table->Rotated = save_Rotated; table->Rotatef = save_Rotatef; + table->Scaled = save_Scaled; table->Scalef = save_Scalef; table->Scissor = save_Scissor; - table->SelectBuffer = gl_SelectBuffer; /* NOT SAVED */ + table->SelectBuffer = _mesa_SelectBuffer; table->ShadeModel = save_ShadeModel; table->StencilFunc = save_StencilFunc; table->StencilMask = save_StencilMask; table->StencilOp = save_StencilOp; + table->TexCoord1d = _mesa_TexCoord1d; + table->TexCoord1dv = _mesa_TexCoord1dv; + table->TexCoord1f = _mesa_TexCoord1f; + table->TexCoord1fv = _mesa_TexCoord1fv; + table->TexCoord1i = _mesa_TexCoord1i; + table->TexCoord1iv = _mesa_TexCoord1iv; + table->TexCoord1s = _mesa_TexCoord1s; + table->TexCoord1sv = _mesa_TexCoord1sv; + table->TexCoord2d = _mesa_TexCoord2d; + table->TexCoord2dv = _mesa_TexCoord2dv; + table->TexCoord2f = _mesa_TexCoord2f; + table->TexCoord2fv = _mesa_TexCoord2fv; + table->TexCoord2i = _mesa_TexCoord2i; + table->TexCoord2iv = _mesa_TexCoord2iv; + table->TexCoord2s = _mesa_TexCoord2s; + table->TexCoord2sv = _mesa_TexCoord2sv; + table->TexCoord3d = _mesa_TexCoord3d; + table->TexCoord3dv = _mesa_TexCoord3dv; + table->TexCoord3f = _mesa_TexCoord3f; + table->TexCoord3fv = _mesa_TexCoord3fv; + table->TexCoord3i = _mesa_TexCoord3i; + table->TexCoord3iv = _mesa_TexCoord3iv; + table->TexCoord3s = _mesa_TexCoord3s; + table->TexCoord3sv = _mesa_TexCoord3sv; + table->TexCoord4d = _mesa_TexCoord4d; + table->TexCoord4dv = _mesa_TexCoord4dv; + table->TexCoord4f = _mesa_TexCoord4f; + table->TexCoord4fv = _mesa_TexCoord4fv; + table->TexCoord4i = _mesa_TexCoord4i; + table->TexCoord4iv = _mesa_TexCoord4iv; + table->TexCoord4s = _mesa_TexCoord4s; + table->TexCoord4sv = _mesa_TexCoord4sv; + table->TexEnvf = save_TexEnvf; table->TexEnvfv = save_TexEnvfv; + table->TexEnvi = save_TexEnvi; + table->TexEnviv = save_TexEnviv; + table->TexGend = save_TexGend; + table->TexGendv = save_TexGendv; + table->TexGenf = save_TexGenf; table->TexGenfv = save_TexGenfv; + table->TexGeni = save_TexGeni; + table->TexGeniv = save_TexGeniv; table->TexImage1D = save_TexImage1D; table->TexImage2D = save_TexImage2D; - table->TexImage3D = save_TexImage3D; - table->TexSubImage1D = save_TexSubImage1D; - table->TexSubImage2D = save_TexSubImage2D; - table->TexSubImage3D = save_TexSubImage3D; + table->TexParameterf = save_TexParameterf; table->TexParameterfv = save_TexParameterfv; + table->TexParameteri = save_TexParameteri; + table->TexParameteriv = save_TexParameteriv; + table->Translated = save_Translated; table->Translatef = save_Translatef; + table->Vertex2d = _mesa_Vertex2d; + table->Vertex2dv = _mesa_Vertex2dv; + table->Vertex2f = _mesa_Vertex2f; + table->Vertex2fv = _mesa_Vertex2fv; + table->Vertex2i = _mesa_Vertex2i; + table->Vertex2iv = _mesa_Vertex2iv; + table->Vertex2s = _mesa_Vertex2s; + table->Vertex2sv = _mesa_Vertex2sv; + table->Vertex3d = _mesa_Vertex3d; + table->Vertex3dv = _mesa_Vertex3dv; + table->Vertex3f = _mesa_Vertex3f; + table->Vertex3fv = _mesa_Vertex3fv; + table->Vertex3i = _mesa_Vertex3i; + table->Vertex3iv = _mesa_Vertex3iv; + table->Vertex3s = _mesa_Vertex3s; + table->Vertex3sv = _mesa_Vertex3sv; + table->Vertex4d = _mesa_Vertex4d; + table->Vertex4dv = _mesa_Vertex4dv; + table->Vertex4f = _mesa_Vertex4f; + table->Vertex4fv = _mesa_Vertex4fv; + table->Vertex4i = _mesa_Vertex4i; + table->Vertex4iv = _mesa_Vertex4iv; + table->Vertex4s = _mesa_Vertex4s; + table->Vertex4sv = _mesa_Vertex4sv; table->Viewport = save_Viewport; - /* GL_MESA_window_pos extension */ - table->WindowPos4fMESA = save_WindowPos4fMESA; +#ifdef _GLAPI_VERSION_1_1 + table->AreTexturesResident = _mesa_AreTexturesResident; + table->ArrayElement = _mesa_ArrayElement; + table->BindTexture = save_BindTexture; + table->ColorPointer = _mesa_ColorPointer; + table->CopyTexImage1D = save_CopyTexImage1D; + table->CopyTexImage2D = save_CopyTexImage2D; + table->CopyTexSubImage1D = save_CopyTexSubImage1D; + table->CopyTexSubImage2D = save_CopyTexSubImage2D; + table->DeleteTextures = _mesa_DeleteTextures; + table->DisableClientState = _mesa_DisableClientState; + table->DrawArrays = _mesa_DrawArrays; + table->DrawElements = _mesa_DrawElements; + table->EdgeFlagPointer = _mesa_EdgeFlagPointer; + table->EnableClientState = _mesa_EnableClientState; + table->GenTextures = _mesa_GenTextures; + table->GetPointerv = _mesa_GetPointerv; + table->IndexPointer = _mesa_IndexPointer; + table->Indexub = _mesa_Indexub; + table->Indexubv = _mesa_Indexubv; + table->InterleavedArrays = _mesa_InterleavedArrays; + table->IsTexture = _mesa_IsTexture; + table->NormalPointer = _mesa_NormalPointer; + table->PopClientAttrib = _mesa_PopClientAttrib; + table->PrioritizeTextures = save_PrioritizeTextures; + table->PushClientAttrib = _mesa_PushClientAttrib; + table->TexCoordPointer = _mesa_TexCoordPointer; + table->TexSubImage1D = save_TexSubImage1D; + table->TexSubImage2D = save_TexSubImage2D; + table->VertexPointer = _mesa_VertexPointer; +#endif - /* GL_MESA_resize_buffers extension */ - table->ResizeBuffersMESA = gl_ResizeBuffersMESA; +#ifdef _GLAPI_VERSION_1_2 + table->CopyTexSubImage3D = save_CopyTexSubImage3D; + table->DrawRangeElements = _mesa_DrawRangeElements; + table->TexImage3D = save_TexImage3D; + table->TexSubImage3D = save_TexSubImage3D; +#endif - /* GL_ARB_multitexture */ - table->ActiveTexture = save_ActiveTexture; - table->ClientActiveTexture = save_ClientActiveTexture; +#ifdef _GLAPI_ARB_imaging + /* NOT supported, just call stub functions */ + table->BlendColor = _mesa_BlendColor; + table->BlendEquation = _mesa_BlendEquation; + table->ColorSubTable = _mesa_ColorSubTable; + table->ColorTable = _mesa_ColorTable; + table->ColorTableParameterfv = _mesa_ColorTableParameterfv; + table->ColorTableParameteriv = _mesa_ColorTableParameteriv; + table->ConvolutionFilter1D = _mesa_ConvolutionFilter1D; + table->ConvolutionFilter2D = _mesa_ConvolutionFilter2D; + table->ConvolutionParameterf = _mesa_ConvolutionParameterf; + table->ConvolutionParameterfv = _mesa_ConvolutionParameterfv; + table->ConvolutionParameteri = _mesa_ConvolutionParameteri; + table->ConvolutionParameteriv = _mesa_ConvolutionParameteriv; + table->CopyColorSubTable = _mesa_CopyColorSubTable; + table->CopyColorTable = _mesa_CopyColorTable; + table->CopyConvolutionFilter1D = _mesa_CopyConvolutionFilter1D; + table->CopyConvolutionFilter2D = _mesa_CopyConvolutionFilter2D; + table->GetColorTable = _mesa_GetColorTable; + table->GetColorTableParameterfv = _mesa_GetColorTableParameterfv; + table->GetColorTableParameteriv = _mesa_GetColorTableParameteriv; + table->GetConvolutionFilter = _mesa_GetConvolutionFilter; + table->GetConvolutionParameterfv = _mesa_GetConvolutionParameterfv; + table->GetConvolutionParameteriv = _mesa_GetConvolutionParameteriv; + table->GetHistogram = _mesa_GetHistogram; + table->GetHistogramParameterfv = _mesa_GetHistogramParameterfv; + table->GetHistogramParameteriv = _mesa_GetHistogramParameteriv; + table->GetMinmax = _mesa_GetMinmax; + table->GetMinmaxParameterfv = _mesa_GetMinmaxParameterfv; + table->GetMinmaxParameteriv = _mesa_GetMinmaxParameteriv; + table->GetSeparableFilter = _mesa_GetSeparableFilter; + table->Histogram = _mesa_Histogram; + table->Minmax = _mesa_Minmax; + table->ResetHistogram = _mesa_ResetHistogram; + table->ResetMinmax = _mesa_ResetMinmax; + table->SeparableFilter2D = _mesa_SeparableFilter2D; +#endif + +#ifdef _GLAPI_EXT_color_table + table->ColorTableEXT = save_ColorTable; + table->ColorSubTableEXT = save_ColorSubTable; + table->GetColorTableEXT = _mesa_GetColorTable; + table->GetColorTableParameterfvEXT = _mesa_GetColorTableParameterfv; + table->GetColorTableParameterivEXT = _mesa_GetColorTableParameteriv; +#endif + +#ifdef _GLAPI_EXT_compiled_vertex_array + table->LockArraysEXT = _mesa_LockArraysEXT; + table->UnlockArraysEXT = _mesa_UnlockArraysEXT; +#endif + +#ifdef _GLAPI_EXT_point_parameters + table->PointParameterfEXT = save_PointParameterfEXT; + table->PointParameterfvEXT = save_PointParameterfvEXT; +#endif + +#ifdef _GLAPI_EXT_polygon_offset + table->PolygonOffsetEXT = save_PolygonOffsetEXT; +#endif + +#ifdef _GLAPI_EXT_blend_minmax + table->BlendEquationEXT = save_BlendEquation; +#endif + +#ifdef _GLAPI_EXT_blend_color + table->BlendColorEXT = save_BlendColor; +#endif + +#ifdef _GLAPI_ARB_multitexture + table->ActiveTextureARB = save_ActiveTextureARB; + table->ClientActiveTextureARB = save_ClientActiveTextureARB; + table->MultiTexCoord1dARB = _mesa_MultiTexCoord1dARB; + table->MultiTexCoord1dvARB = _mesa_MultiTexCoord1dvARB; + table->MultiTexCoord1fARB = _mesa_MultiTexCoord1fARB; + table->MultiTexCoord1fvARB = _mesa_MultiTexCoord1fvARB; + table->MultiTexCoord1iARB = _mesa_MultiTexCoord1iARB; + table->MultiTexCoord1ivARB = _mesa_MultiTexCoord1ivARB; + table->MultiTexCoord1sARB = _mesa_MultiTexCoord1sARB; + table->MultiTexCoord1svARB = _mesa_MultiTexCoord1svARB; + table->MultiTexCoord2dARB = _mesa_MultiTexCoord2dARB; + table->MultiTexCoord2dvARB = _mesa_MultiTexCoord2dvARB; + table->MultiTexCoord2fARB = _mesa_MultiTexCoord2fARB; + table->MultiTexCoord2fvARB = _mesa_MultiTexCoord2fvARB; + table->MultiTexCoord2iARB = _mesa_MultiTexCoord2iARB; + table->MultiTexCoord2ivARB = _mesa_MultiTexCoord2ivARB; + table->MultiTexCoord2sARB = _mesa_MultiTexCoord2sARB; + table->MultiTexCoord2svARB = _mesa_MultiTexCoord2svARB; + table->MultiTexCoord3dARB = _mesa_MultiTexCoord3dARB; + table->MultiTexCoord3dvARB = _mesa_MultiTexCoord3dvARB; + table->MultiTexCoord3fARB = _mesa_MultiTexCoord3fARB; + table->MultiTexCoord3fvARB = _mesa_MultiTexCoord3fvARB; + table->MultiTexCoord3iARB = _mesa_MultiTexCoord3iARB; + table->MultiTexCoord3ivARB = _mesa_MultiTexCoord3ivARB; + table->MultiTexCoord3sARB = _mesa_MultiTexCoord3sARB; + table->MultiTexCoord3svARB = _mesa_MultiTexCoord3svARB; + table->MultiTexCoord4dARB = _mesa_MultiTexCoord4dARB; + table->MultiTexCoord4dvARB = _mesa_MultiTexCoord4dvARB; + table->MultiTexCoord4fARB = _mesa_MultiTexCoord4fARB; + table->MultiTexCoord4fvARB = _mesa_MultiTexCoord4fvARB; + table->MultiTexCoord4iARB = _mesa_MultiTexCoord4iARB; + table->MultiTexCoord4ivARB = _mesa_MultiTexCoord4ivARB; + table->MultiTexCoord4sARB = _mesa_MultiTexCoord4sARB; + table->MultiTexCoord4svARB = _mesa_MultiTexCoord4svARB; +#endif + +#ifdef _GLAPI_INGR_blend_func_separate + table->BlendFuncSeparateINGR = save_BlendFuncSeparateINGR; +#endif + +#ifdef _GLAPI_MESA_window_pos + table->WindowPos4fMESA = save_WindowPos4fMESA; +#endif + +#ifdef _GLAPI_MESA_resize_buffers + table->ResizeBuffersMESA = _mesa_ResizeBuffersMESA; +#endif } @@ -3612,11 +4621,6 @@ static void print_list( GLcontext *ctx, FILE *f, GLuint list ) - - - - - /* * Clients may call this function to help debug display list problems. * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed, @@ -3624,6 +4628,6 @@ static void print_list( GLcontext *ctx, FILE *f, GLuint list ) */ void mesa_print_display_list( GLuint list ) { - GET_CONTEXT; - print_list( CC, stderr, list ); + GET_CURRENT_CONTEXT(ctx); + print_list( ctx, stderr, list ); } diff --git a/src/mesa/main/dlist.h b/src/mesa/main/dlist.h index c5a59181904..f2aaa948c52 100644 --- a/src/mesa/main/dlist.h +++ b/src/mesa/main/dlist.h @@ -1,4 +1,4 @@ -/* $Id: dlist.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: dlist.h,v 1.2 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -51,24 +51,23 @@ extern void gl_init_lists( void ); extern void gl_destroy_list( GLcontext *ctx, GLuint list ); -extern void gl_CallList( GLcontext *ctx, GLuint list ); +extern void _mesa_CallList( GLuint list ); -extern void gl_CallLists( GLcontext *ctx, - GLsizei n, GLenum type, const GLvoid *lists ); +extern void _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists ); -extern void gl_DeleteLists( GLcontext *ctx, GLuint list, GLsizei range ); +extern void _mesa_DeleteLists( GLuint list, GLsizei range ); -extern void gl_EndList( GLcontext *ctx ); +extern void _mesa_EndList( void ); -extern GLuint gl_GenLists( GLcontext *ctx, GLsizei range ); +extern GLuint _mesa_GenLists( GLsizei range ); -extern GLboolean gl_IsList( GLcontext *ctx, GLuint list ); +extern GLboolean _mesa_IsList( GLuint list ); -extern void gl_ListBase( GLcontext *ctx, GLuint base ); +extern void _mesa_ListBase( GLuint base ); -extern void gl_NewList( GLcontext *ctx, GLuint list, GLenum mode ); +extern void _mesa_NewList( GLuint list, GLenum mode ); -extern void gl_init_dlist_pointers( struct gl_api_table *table ); +extern void _mesa_init_dlist_table( struct _glapi_table *table ); extern void gl_compile_cassette( GLcontext *ctx ); diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index c5bdb6fcba1..103855f7fa8 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -1,8 +1,8 @@ -/* $Id: drawpix.c,v 1.5 1999/11/08 07:36:44 brianp Exp $ */ +/* $Id: drawpix.c,v 1.6 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,19 +25,10 @@ */ - - - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "drawpix.h" #include "feedback.h" @@ -53,23 +44,16 @@ -/* TODO: apply texture mapping to fragments */ - - /* - * Try to do a fast glDrawPixels. Conditions include: - * not using a display list - * simple pixel unpacking - * no raster ops - * etc.... + * Try to do a fast and simple RGB(a) glDrawPixels. * 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 ) +static GLboolean +simple_DrawPixels( GLcontext *ctx, GLint x, GLint y, + GLsizei width, GLsizei height, GLenum format, GLenum type, + const GLvoid *pixels ) { + const struct gl_pixelstore_attrib *unpack = &ctx->Unpack; GLubyte rgb[MAX_WIDTH][3]; GLubyte rgba[MAX_WIDTH][4]; @@ -87,12 +71,10 @@ GLboolean gl_direct_DrawPixels( GLcontext *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->Driver.DrawPixels + && (*ctx->Driver.DrawPixels)(ctx, x, y, width, height, format, type, + unpack, pixels)) { + return GL_TRUE; } if ((ctx->RasterMask&(~(SCISSOR_BIT|WINCLIP_BIT)))==0 @@ -106,8 +88,8 @@ GLboolean gl_direct_DrawPixels( GLcontext *ctx, && !unpack->SwapBytes && !unpack->LsbFirst) { - GLint destX = (GLint) (ctx->Current.RasterPos[0] + 0.5F); - GLint destY = (GLint) (ctx->Current.RasterPos[1] + 0.5F); + GLint destX = x; + GLint destY = y; GLint drawWidth = width; /* actual width drawn */ GLint drawHeight = height; /* actual height drawn */ GLint skipPixels = unpack->SkipPixels; @@ -364,10 +346,9 @@ GLboolean gl_direct_DrawPixels( GLcontext *ctx, return GL_FALSE; } } - else { - /* can't do direct render, have to use slow path */ - return GL_FALSE; - } + + /* can't do a simple draw, have to use slow path */ + return GL_FALSE; } @@ -375,99 +356,43 @@ GLboolean gl_direct_DrawPixels( GLcontext *ctx, /* * Do glDrawPixels of index pixels. */ -static void draw_index_pixels( GLcontext *ctx, GLint x, GLint y, - const struct gl_image *image ) +static void +draw_index_pixels( GLcontext *ctx, GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum type, const GLvoid *pixels ) { - GLint width, height, widthInBytes; + const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; const GLint desty = y; - GLint i, j; + GLint row, drawWidth; GLdepth zspan[MAX_WIDTH]; - const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; - assert(image); - assert(image->Format == GL_COLOR_INDEX); - - width = image->Width; - height = image->Height; - if (image->Type == GL_BITMAP) - widthInBytes = (width + 7) / 8; - else - widthInBytes = width; + drawWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width; /* Fragment depth values */ if (ctx->Depth.Test) { GLdepth zval = (GLdepth) (ctx->Current.RasterPos[2] * DEPTH_SCALE); - for (i=0;iType) { - case GL_UNSIGNED_BYTE: - { - GLubyte *src = (GLubyte *) image->Data + i * width; - for (j=0;jData + i * width; - for (j=0;jData + i * widthInBytes; - for (j=0;j> 3] >> (7 - (j & 0x7)) ) & 1; - } - } - break; - default: - gl_problem( ctx, "draw_index_pixels type" ); - return; - } - - /* apply shift and offset */ - if (ctx->Pixel.IndexOffset || ctx->Pixel.IndexShift) { - gl_shift_and_offset_ci( ctx, width, ispan ); - } - - if (ctx->Visual->RGBAflag) { - /* Convert index to RGBA and write to frame buffer */ - GLubyte rgba[MAX_WIDTH][4]; - gl_map_ci_to_rgba( ctx, width, ispan, rgba ); - if (zoom) { - gl_write_zoomed_rgba_span( ctx, width, x, y, zspan, - (const GLubyte (*)[4])rgba, desty ); - } - else { - gl_write_rgba_span( ctx, width, x, y, zspan, rgba, GL_BITMAP ); - } + /* + * General solution + */ + for (row = 0; row < height; row++, y++) { + GLuint indexes[MAX_WIDTH]; + const GLvoid *source = gl_pixel_addr_in_image(&ctx->Unpack, + pixels, width, height, GL_COLOR_INDEX, type, 0, row, 0); + _mesa_unpack_index_span(ctx, drawWidth, GL_UNSIGNED_INT, indexes, + type, source, &ctx->Unpack, GL_TRUE); + if (zoom) { + gl_write_zoomed_index_span(ctx, drawWidth, x, y, zspan, indexes, desty); } else { - /* optionally apply index map then write to frame buffer */ - if (ctx->Pixel.MapColorFlag) { - gl_map_ci(ctx, width, ispan); - } - if (zoom) { - gl_write_zoomed_index_span( ctx, width, x, y, zspan, ispan, desty ); - } - else { - gl_write_index_span( ctx, width, x, y, zspan, ispan, GL_BITMAP ); - } + gl_write_index_span(ctx, drawWidth, x, y, zspan, indexes, GL_BITMAP); } } - } @@ -476,83 +401,44 @@ static void draw_index_pixels( GLcontext *ctx, GLint x, GLint y, * Do glDrawPixels of stencil image. The image datatype may either * be GLubyte or GLbitmap. */ -static void draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y, - const struct gl_image *image ) +static void +draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum type, const GLvoid *pixels ) { - GLint widthInBytes, width, height; - const GLint desty = y; - GLint i; const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; - - if (image->Type != GL_BYTE && - image->Type != GL_UNSIGNED_BYTE && - image->Type != GL_SHORT && - image->Type != GL_UNSIGNED_SHORT && - image->Type != GL_INT && - image->Type != GL_UNSIGNED_INT && - image->Type != GL_FLOAT && - image->Type != GL_BITMAP) { - gl_error( ctx, GL_INVALID_OPERATION, "glDrawPixels(stencil type)"); + const GLint desty = y; + GLint row, drawWidth; + + if (type != GL_BYTE && + type != GL_UNSIGNED_BYTE && + type != GL_SHORT && + type != GL_UNSIGNED_SHORT && + type != GL_INT && + type != GL_UNSIGNED_INT && + type != GL_FLOAT && + type != GL_BITMAP) { + gl_error( ctx, GL_INVALID_ENUM, "glDrawPixels(stencil type)"); return; } - assert(image); - assert(image->Format == GL_STENCIL_INDEX); - assert(image->Type == GL_UNSIGNED_BYTE || image->Type == GL_BITMAP); - - if (image->Type == GL_UNSIGNED_BYTE) - widthInBytes = image->Width; - else - widthInBytes = (image->Width + 7) / 8; - width = image->Width; - height = image->Height; - - /* process the image row by row */ - for (i=0;iData + i * widthInBytes; - GLstencil *stencilValues; - GLstencil stencilCopy[MAX_WIDTH]; - - if (image->Type == GL_BITMAP) { - /* convert bitmap data to GLubyte (0 or 1) data */ - GLint j; - for (j = 0; j < width; j++) { - stencilCopy[j] = ( src[j >> 3] >> (7 - (j & 0x7)) ) & 1; - } - src = stencilCopy; - } - - if (ctx->Pixel.IndexOffset || ctx->Pixel.IndexShift - || ctx->Pixel.MapStencilFlag) { + drawWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width; - /* make copy of stencil values */ - if (src != stencilCopy) - MEMCPY( stencilCopy, src, width * sizeof(GLstencil)); + for (row = 0; row < height; row++, y++) { + GLstencil values[MAX_WIDTH]; + GLenum destType = (sizeof(GLstencil) == sizeof(GLubyte)) + ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT; + const GLvoid *source = gl_pixel_addr_in_image(&ctx->Unpack, + pixels, width, height, GL_COLOR_INDEX, type, 0, row, 0); + _mesa_unpack_index_span(ctx, drawWidth, destType, values, + type, source, &ctx->Unpack, GL_TRUE); - /* apply shift and offset */ - if (ctx->Pixel.IndexOffset || ctx->Pixel.IndexShift) { - gl_shift_and_offset_stencil( ctx, width, stencilCopy ); - } - - /* mapping */ - if (ctx->Pixel.MapStencilFlag) { - gl_map_stencil( ctx, width, stencilCopy ); - } - - stencilValues = stencilCopy; - } - else { - /* use stencil values in-place */ - stencilValues = src; - } - - /* write stencil values to stencil buffer */ if (zoom) { - gl_write_zoomed_stencil_span( ctx, (GLuint) width, x, y, - stencilValues, desty ); + gl_write_zoomed_stencil_span( ctx, (GLuint) drawWidth, x, y, + values, desty ); } else { - gl_write_stencil_span( ctx, (GLuint) width, x, y, stencilValues ); + gl_write_stencil_span( ctx, (GLuint) drawWidth, x, y, values ); } } } @@ -562,30 +448,37 @@ static void draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y, /* * Do a glDrawPixels of depth values. */ -static void draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, - const struct gl_image *image ) +static void +draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum type, const GLvoid *pixels ) { - GLint width, height; + const GLboolean bias_or_scale = ctx->Pixel.DepthBias!=0.0 || ctx->Pixel.DepthScale!=1.0; + const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; const GLint desty = y; GLubyte rgba[MAX_WIDTH][4]; GLuint ispan[MAX_WIDTH]; - const GLboolean bias_or_scale = ctx->Pixel.DepthBias!=0.0 || ctx->Pixel.DepthScale!=1.0; - const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; - - assert(image); - assert(image->Format == GL_DEPTH_COMPONENT); - - width = image->Width; - height = image->Height; + GLint drawWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width; + + if (type != GL_UNSIGNED_BYTE + && type != GL_UNSIGNED_BYTE + && type != GL_UNSIGNED_SHORT + && type != GL_UNSIGNED_SHORT + && type != GL_UNSIGNED_INT + && type != GL_UNSIGNED_INT + && type != GL_FLOAT) { + gl_error(ctx, GL_INVALID_ENUM, "glDrawPixels(type)"); + return; + } - /* Color or index */ + /* Colors or indexes */ if (ctx->Visual->RGBAflag) { GLint r = (GLint) (ctx->Current.RasterColor[0] * 255.0F); GLint g = (GLint) (ctx->Current.RasterColor[1] * 255.0F); GLint b = (GLint) (ctx->Current.RasterColor[2] * 255.0F); GLint a = (GLint) (ctx->Current.RasterColor[3] * 255.0F); GLint i; - for (i=0; iCurrent.RasterIndex; } } - if (image->Type==GL_UNSIGNED_SHORT && sizeof(GLdepth)==sizeof(GLushort) + if (type==GL_UNSIGNED_SHORT && sizeof(GLdepth)==sizeof(GLushort) && !bias_or_scale && !zoom && ctx->Visual->RGBAflag) { /* Special case: directly write 16-bit depth values */ - GLint j; - for (j=0;jData + j * width; + GLint row; + for (row = 0; row < height; row++, y++) { + const GLdepth *zptr = gl_pixel_addr_in_image(&ctx->Unpack, + pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0); gl_write_rgba_span( ctx, width, x, y, zptr, rgba, GL_BITMAP ); } } - else if (image->Type==GL_UNSIGNED_INT && sizeof(GLdepth)==sizeof(GLuint) + else if (type==GL_UNSIGNED_INT && sizeof(GLdepth)==sizeof(GLuint) && !bias_or_scale && !zoom && ctx->Visual->RGBAflag) { /* Special case: directly write 32-bit depth values */ - GLint i, j; + GLint i, row; /* Compute shift value to scale 32-bit uints down to depth values. */ GLuint shift = 0; GLuint max = MAX_DEPTH; - while ((max&0x80000000)==0) { + while ((max & 0x80000000) == 0) { max = max << 1; shift++; } - for (j=0;jData + j * width; + const GLdepth *zptr = gl_pixel_addr_in_image(&ctx->Unpack, + pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0); for (i=0;i> shift; } @@ -629,72 +524,30 @@ static void draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, } } else { - /* General case (slower) */ - GLint i, j; - - /* process image row by row */ - for (i=0;iType) { - case GL_UNSIGNED_SHORT: - { - GLushort *src = (GLushort *) image->Data + i * width; - for (j=0;jData + i * width; - for (j=0;jData + i * width; - for (j=0;jPixel.DepthScale!=1.0 || ctx->Pixel.DepthBias!=0.0) { - for (j=0;jPixel.DepthScale + ctx->Pixel.DepthBias; - } - } - - /* clamp depth values to [0,1] and convert from floats to integers */ - for (j=0;jUnpack, + pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0); + _mesa_unpack_depth_span( ctx, drawWidth, zspan, type, src, + &ctx->Unpack, GL_TRUE ); if (ctx->Visual->RGBAflag) { if (zoom) { - gl_write_zoomed_rgba_span( ctx, width, x, y, zspan, - (const GLubyte (*)[4])rgba, desty ); + gl_write_zoomed_rgba_span(ctx, width, x, y, zspan, + (const GLubyte (*)[4])rgba, desty); } else { - gl_write_rgba_span( ctx, width, x, y, zspan, rgba, GL_BITMAP ); + gl_write_rgba_span(ctx, width, x, y, zspan, rgba, GL_BITMAP); } } else { if (zoom) { - gl_write_zoomed_index_span( ctx, width, x, y, zspan, - ispan, GL_BITMAP ); + gl_write_zoomed_index_span(ctx, width, x, y, zspan, + ispan, GL_BITMAP); } else { - gl_write_index_span( ctx, width, x, y, zspan, ispan, GL_BITMAP ); + gl_write_index_span(ctx, width, x, y, zspan, ispan, GL_BITMAP); } } @@ -703,184 +556,71 @@ static void draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, } - -/* Simple unpacking parameters: */ -static struct gl_pixelstore_attrib NoUnpack = { - 1, /* Alignment */ - 0, /* RowLength */ - 0, /* SkipPixels */ - 0, /* SkipRows */ - 0, /* ImageHeight */ - 0, /* SkipImages */ - GL_FALSE, /* SwapBytes */ - GL_FALSE /* LsbFirst */ -}; - - /* * Do glDrawPixels of RGBA pixels. */ -static void draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, - const struct gl_image *image ) +static void +draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, GLenum type, const GLvoid *pixels ) { - GLint width, height; - GLint i, j; + const struct gl_pixelstore_attrib *unpack = &ctx->Unpack; + const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; const GLint desty = y; GLdepth zspan[MAX_WIDTH]; GLboolean quickDraw; - const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; - - assert(image); /* Try an optimized glDrawPixels first */ - if (gl_direct_DrawPixels(ctx, &NoUnpack, image->Width, image->Height, - image->Format, image->Type, image->Data )) + if (simple_DrawPixels(ctx, x, y, width, height, format, type, pixels)) return; - width = image->Width; - height = image->Height; - /* Fragment depth values */ if (ctx->Depth.Test) { /* fill in array of z values */ GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * DEPTH_SCALE); + GLint i; for (i=0;iRasterMask==0 && !zoom && x>=0 && y>=0 - && x+width<=ctx->Buffer->Width && y+height<=ctx->Buffer->Height) { + + if (ctx->RasterMask == 0 && !zoom + && x >= 0 && y >= 0 + && x + width <= ctx->Buffer->Width + && y + height <= ctx->Buffer->Height) { quickDraw = GL_TRUE; } else { quickDraw = GL_FALSE; } + /* + * General solution + */ { - /* General solution */ - GLboolean r_flag, g_flag, b_flag, a_flag, l_flag; - GLuint components; GLubyte rgba[MAX_WIDTH][4]; - GLfloat rf[MAX_WIDTH]; - GLfloat gf[MAX_WIDTH]; - GLfloat bf[MAX_WIDTH]; - DEFARRAY(GLfloat,af,MAX_WIDTH); - CHECKARRAY(af,return); - - r_flag = g_flag = b_flag = a_flag = l_flag = GL_FALSE; - switch (image->Format) { - case GL_RED: - r_flag = GL_TRUE; - components = 1; - break; - case GL_GREEN: - g_flag = GL_TRUE; - components = 1; - break; - case GL_BLUE: - b_flag = GL_TRUE; - components = 1; - break; - case GL_ALPHA: - a_flag = GL_TRUE; - components = 1; - break; - case GL_RGB: - r_flag = g_flag = b_flag = GL_TRUE; - components = 3; - break; - case GL_LUMINANCE: - l_flag = GL_TRUE; - components = 1; - break; - case GL_LUMINANCE_ALPHA: - l_flag = a_flag = GL_TRUE; - components = 2; - break; - case GL_RGBA: - r_flag = g_flag = b_flag = a_flag = GL_TRUE; - components = 4; - break; - default: - gl_problem(ctx, "Bad type in draw_rgba_pixels"); - goto cleanup; - } + GLint row; + if (width > MAX_WIDTH) + width = MAX_WIDTH; + for (row = 0; row < height; row++, y++) { + const GLvoid *source = gl_pixel_addr_in_image(unpack, + pixels, width, height, format, type, 0, row, 0); + _mesa_unpack_ubyte_color_span(ctx, width, GL_RGBA, (void*) rgba, + format, type, source, unpack, GL_TRUE); - /* process the image row by row */ - for (i=0;iType) { - case GL_UNSIGNED_BYTE: - { - GLubyte *src = (GLubyte *) image->Data + i * width * components; - for (j=0;jData + i * width * components; - for (j=0;jPixel.ScaleOrBiasRGBA) { - gl_scale_and_bias_color(ctx, width, rf, gf, bf, af); - } - - /* apply pixel mappings */ - if (ctx->Pixel.MapColorFlag) { - gl_map_color(ctx, width, rf, gf, bf, af); - } - - /* convert to integers */ - for (j=0;jDriver.WriteRGBASpan)( ctx, width, x, y, - (const GLubyte (*)[4])rgba, NULL); + (*ctx->Driver.WriteRGBASpan)( ctx, width, x, y, + (CONST GLubyte (*)[]) rgba, NULL); } else if (zoom) { gl_write_zoomed_rgba_span( ctx, width, x, y, zspan, - (const GLubyte (*)[4])rgba, desty ); + (CONST GLubyte (*)[]) rgba, desty ); } else { gl_write_rgba_span( ctx, (GLuint) width, x, y, zspan, rgba, GL_BITMAP); } } -cleanup: - UNDEFARRAY(af); } } @@ -889,45 +629,50 @@ cleanup: /* * Execute glDrawPixels */ -void gl_DrawPixels( GLcontext* ctx, struct gl_image *image ) +void +_mesa_DrawPixels( GLsizei width, GLsizei height, + GLenum format, GLenum type, const GLvoid *pixels ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDrawPixels"); - - if (gl_image_error_test( ctx, image, "glDrawPixels" )) - return; - if (ctx->RenderMode==GL_RENDER) { GLint x, y; - if (!ctx->Current.RasterPosValid) { + if (!pixels || !ctx->Current.RasterPosValid) { return; } x = (GLint) (ctx->Current.RasterPos[0] + 0.5F); y = (GLint) (ctx->Current.RasterPos[1] + 0.5F); - switch (image->Format) { - case GL_COLOR_INDEX: - draw_index_pixels( ctx, x, y, image ); - break; + switch (format) { case GL_STENCIL_INDEX: - draw_stencil_pixels( ctx, x, y, image ); + draw_stencil_pixels( ctx, x, y, width, height, type, pixels ); break; case GL_DEPTH_COMPONENT: - draw_depth_pixels( ctx, x, y, image ); + draw_depth_pixels( ctx, x, y, width, height, type, pixels ); + break; + case GL_COLOR_INDEX: + if (ctx->Visual->RGBAflag) + draw_index_pixels(ctx, x, y, width, height, type, pixels); + else + draw_rgba_pixels(ctx, x,y, width, height, format, type, pixels); break; case GL_RED: case GL_GREEN: case GL_BLUE: case GL_ALPHA: - case GL_RGB: case GL_LUMINANCE: case GL_LUMINANCE_ALPHA: + case GL_RGB: + case GL_BGR: case GL_RGBA: - draw_rgba_pixels( ctx, x, y, image ); + case GL_BGRA: + case GL_ABGR_EXT: + draw_rgba_pixels(ctx, x, y, width, height, format, type, pixels); break; default: - gl_error( ctx, GL_INVALID_ENUM, "glDrawPixels" ); + gl_error( ctx, GL_INVALID_ENUM, "glDrawPixels(format)" ); return; } } diff --git a/src/mesa/main/drawpix.h b/src/mesa/main/drawpix.h index cb517ced03b..40da8dfb2c8 100644 --- a/src/mesa/main/drawpix.h +++ b/src/mesa/main/drawpix.h @@ -1,8 +1,8 @@ -/* $Id: drawpix.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: drawpix.h,v 1.2 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,9 +25,6 @@ */ - - - #ifndef DRAWPIXELS_H #define DRAWPIXELS_H @@ -35,20 +32,9 @@ #include "types.h" -extern GLboolean -gl_direct_DrawPixels( GLcontext *ctx, - const struct gl_pixelstore_attrib *unpack, - GLsizei width, GLsizei height, - GLenum format, GLenum type, const GLvoid *pixels ); - - -#if 000 -extern void gl_DrawPixels( GLcontext *ctx, GLsizei width, GLsizei height, - GLenum format, GLenum type, const GLvoid *pixels ); -#endif - - -extern void gl_DrawPixels( GLcontext *ctx, struct gl_image *image ); +extern void +_mesa_DrawPixels( GLsizei width, GLsizei height, + GLenum format, GLenum type, const GLvoid *pixels ); #endif diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index c12013a421a..8a1b79f610f 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -1,8 +1,8 @@ -/* $Id: enable.c,v 1.9 1999/11/10 06:29:44 keithw Exp $ */ +/* $Id: enable.c,v 1.10 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,17 +25,10 @@ */ -/* $XFree86: xc/lib/GL/mesa/src/enable.c,v 1.3 1999/04/04 00:20:23 dawes Exp $ */ - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "enable.h" #include "light.h" @@ -54,7 +47,7 @@ /* * Perform glEnable and glDisable calls. */ -void gl_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) +void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) { ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "gl_enable/disable" ); @@ -123,8 +116,8 @@ void gl_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) if (ctx->Light.ColorMaterialEnabled!=state) { ctx->Light.ColorMaterialEnabled = state; ctx->NewState |= NEW_LIGHTING; - if (state) - gl_update_color_material( ctx, ctx->Current.ByteColor ); + if (state) + gl_update_color_material( ctx, ctx->Current.ByteColor ); } break; case GL_CULL_FACE: @@ -478,22 +471,28 @@ void gl_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) -void gl_Enable( GLcontext* ctx, GLenum cap ) +void +_mesa_Enable( GLenum cap ) { - gl_set_enable( ctx, cap, GL_TRUE ); + GET_CURRENT_CONTEXT(ctx); + _mesa_set_enable( ctx, cap, GL_TRUE ); } -void gl_Disable( GLcontext* ctx, GLenum cap ) +void +_mesa_Disable( GLenum cap ) { - gl_set_enable( ctx, cap, GL_FALSE ); + GET_CURRENT_CONTEXT(ctx); + _mesa_set_enable( ctx, cap, GL_FALSE ); } -GLboolean gl_IsEnabled( GLcontext* ctx, GLenum cap ) +GLboolean +_mesa_IsEnabled( GLenum cap ) { + GET_CURRENT_CONTEXT(ctx); switch (cap) { case GL_ALPHA_TEST: return ctx->Color.AlphaEnabled; @@ -656,7 +655,8 @@ GLboolean gl_IsEnabled( GLcontext* ctx, GLenum cap ) -static void gl_client_state( GLcontext *ctx, GLenum cap, GLboolean state ) +static void +client_state( GLcontext *ctx, GLenum cap, GLboolean state ) { ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, (state @@ -691,15 +691,19 @@ static void gl_client_state( GLcontext *ctx, GLenum cap, GLboolean state ) -void gl_EnableClientState( GLcontext *ctx, GLenum cap ) +void +_mesa_EnableClientState( GLenum cap ) { - gl_client_state( ctx, cap, GL_TRUE ); + GET_CURRENT_CONTEXT(ctx); + client_state( ctx, cap, GL_TRUE ); } -void gl_DisableClientState( GLcontext *ctx, GLenum cap ) +void +_mesa_DisableClientState( GLenum cap ) { - gl_client_state( ctx, cap, GL_FALSE ); + GET_CURRENT_CONTEXT(ctx); + client_state( ctx, cap, GL_FALSE ); } diff --git a/src/mesa/main/enable.h b/src/mesa/main/enable.h index 92a916a9849..f0e9dfd6ae8 100644 --- a/src/mesa/main/enable.h +++ b/src/mesa/main/enable.h @@ -1,8 +1,8 @@ -/* $Id: enable.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: enable.h,v 1.2 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,9 +25,6 @@ */ - - - #ifndef ENABLE_H #define ENABLE_H @@ -35,17 +32,23 @@ #include "types.h" -extern void gl_set_enable( GLcontext* ctx, GLenum cap, GLboolean state ); +extern void +_mesa_set_enable( GLcontext* ctx, GLenum cap, GLboolean state ); -extern void gl_Disable( GLcontext* ctx, GLenum cap ); +extern void +_mesa_Disable( GLenum cap ); -extern void gl_Enable( GLcontext* ctx, GLenum cap ); +extern void +_mesa_Enable( GLenum cap ); -extern GLboolean gl_IsEnabled( GLcontext* ctx, GLenum cap ); +extern GLboolean +_mesa_IsEnabled( GLenum cap ); -extern void gl_EnableClientState( GLcontext *ctx, GLenum cap ); +extern void +_mesa_EnableClientState( GLenum cap ); -extern void gl_DisableClientState( GLcontext *ctx, GLenum cap ); +extern void +_mesa_DisableClientState( GLenum cap ); #endif diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 695af735fac..3ee2c6fa29b 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -1,8 +1,8 @@ -/* $Id: enums.c,v 1.4 1999/11/08 07:36:44 brianp Exp $ */ +/* $Id: enums.c,v 1.5 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -24,16 +24,14 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef XFree86Server -#include -#include -#else -#include "GL/xf86glx.h" -#endif -#include "GL/gl.h" +#ifdef PC_HEADER +#include "all.h" +#else +#include "glheader.h" #include "enums.h" -#include "macros.h" +#include "mem.h" +#endif typedef struct { diff --git a/src/mesa/main/eval.c b/src/mesa/main/eval.c index 36f0616effb..0c0d9507515 100644 --- a/src/mesa/main/eval.c +++ b/src/mesa/main/eval.c @@ -1,8 +1,8 @@ -/* $Id: eval.c,v 1.6 1999/11/08 15:30:05 brianp Exp $ */ +/* $Id: eval.c,v 1.7 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -41,16 +41,11 @@ #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "eval.h" #include "macros.h" +#include "mem.h" #include "mmath.h" #include "types.h" #include "vbcull.h" @@ -528,9 +523,9 @@ de_casteljau_surf(GLfloat *cn, GLfloat *out, GLfloat *du, GLfloat *dv, /* * Return the number of components per control point for any type of * evaluator. Return 0 if bad target. + * See table 5.1 in the OpenGL 1.2 spec. */ - -static GLint components( GLenum target ) +GLuint _mesa_evaluator_components( GLenum target ) { switch (target) { case GL_MAP1_VERTEX_3: return 3; @@ -568,12 +563,11 @@ static GLint components( GLenum target ) * Return: pointer to buffer of contiguous control points or NULL if out * of memory. */ -GLfloat *gl_copy_map_points1f( GLenum target, - GLint ustride, GLint uorder, +GLfloat *gl_copy_map_points1f( GLenum target, GLint ustride, GLint uorder, const GLfloat *points ) { GLfloat *buffer, *p; - GLint i, k, size = components(target); + GLint i, k, size = _mesa_evaluator_components(target); if (!points || size==0) { return NULL; @@ -594,12 +588,11 @@ GLfloat *gl_copy_map_points1f( GLenum target, /* * Same as above but convert doubles to floats. */ -GLfloat *gl_copy_map_points1d( GLenum target, - GLint ustride, GLint uorder, - const GLdouble *points ) +GLfloat *gl_copy_map_points1d( GLenum target, GLint ustride, GLint uorder, + const GLdouble *points ) { GLfloat *buffer, *p; - GLint i, k, size = components(target); + GLint i, k, size = _mesa_evaluator_components(target); if (!points || size==0) { return NULL; @@ -628,15 +621,15 @@ GLfloat *gl_copy_map_points1d( GLenum target, * of memory. */ GLfloat *gl_copy_map_points2f( GLenum target, - GLint ustride, GLint uorder, - GLint vstride, GLint vorder, - const GLfloat *points ) + GLint ustride, GLint uorder, + GLint vstride, GLint vorder, + const GLfloat *points ) { GLfloat *buffer, *p; GLint i, j, k, size, dsize, hsize; GLint uinc; - size = components(target); + size = _mesa_evaluator_components(target); if (!points || size==0) { return NULL; @@ -679,7 +672,7 @@ GLfloat *gl_copy_map_points2d(GLenum target, GLint i, j, k, size, hsize, dsize; GLint uinc; - size = components(target); + size = _mesa_evaluator_components(target); if (!points || size==0) { return NULL; @@ -709,6 +702,7 @@ GLfloat *gl_copy_map_points2d(GLenum target, } +#if 00 /* * This function is called by the display list deallocator function to * specify that a given set of control points are no longer needed. @@ -804,6 +798,7 @@ void gl_free_control_points( GLcontext* ctx, GLenum target, GLfloat *data ) } } +#endif @@ -813,154 +808,130 @@ void gl_free_control_points( GLcontext* ctx, GLenum target, GLfloat *data ) /* - * Note that the array of control points must be 'unpacked' at this time. - * Input: retain - if TRUE, this control point data is also in a display - * list and can't be freed until the list is freed. + * This does the work of glMap1[fd]. */ -void gl_Map1f( GLcontext* ctx, GLenum target, - GLfloat u1, GLfloat u2, GLint stride, - GLint order, const GLfloat *points, GLboolean retain ) +static void +map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, + GLint uorder, const GLvoid *points, GLenum type ) { + GET_CURRENT_CONTEXT(ctx); GLint k; - - if (!points) { - gl_error( ctx, GL_OUT_OF_MEMORY, "glMap1f" ); - return; - } - - /* may be a new stride after copying control points */ - stride = components( target ); + GLfloat *pnts; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glMap1"); - if (u1==u2) { + assert(type == GL_FLOAT || type == GL_DOUBLE); + + if (u1 == u2) { gl_error( ctx, GL_INVALID_VALUE, "glMap1(u1,u2)" ); return; } - - if (order<1 || order>MAX_EVAL_ORDER) { + if (uorder < 1 || uorder > MAX_EVAL_ORDER) { gl_error( ctx, GL_INVALID_VALUE, "glMap1(order)" ); return; } + if (!points) { + gl_error( ctx, GL_INVALID_VALUE, "glMap1(points)" ); + return; + } - k = components( target ); - if (k==0) { + k = _mesa_evaluator_components( target ); + if (k == 0) { gl_error( ctx, GL_INVALID_ENUM, "glMap1(target)" ); } - if (stride < k) { + if (ustride < k) { gl_error( ctx, GL_INVALID_VALUE, "glMap1(stride)" ); return; } + /* make copy of the control points */ + if (type == GL_FLOAT) + pnts = gl_copy_map_points1f(target, ustride, uorder, (GLfloat*) points); + else + pnts = gl_copy_map_points1d(target, ustride, uorder, (GLdouble*) points); + switch (target) { case GL_MAP1_VERTEX_3: - ctx->EvalMap.Map1Vertex3.Order = order; + ctx->EvalMap.Map1Vertex3.Order = uorder; ctx->EvalMap.Map1Vertex3.u1 = u1; ctx->EvalMap.Map1Vertex3.u2 = u2; ctx->EvalMap.Map1Vertex3.du = 1.0 / (u2 - u1); - if (ctx->EvalMap.Map1Vertex3.Points - && !ctx->EvalMap.Map1Vertex3.Retain) { + if (ctx->EvalMap.Map1Vertex3.Points) FREE( ctx->EvalMap.Map1Vertex3.Points ); - } - ctx->EvalMap.Map1Vertex3.Points = (GLfloat *) points; - ctx->EvalMap.Map1Vertex3.Retain = retain; + ctx->EvalMap.Map1Vertex3.Points = pnts; break; case GL_MAP1_VERTEX_4: - ctx->EvalMap.Map1Vertex4.Order = order; + ctx->EvalMap.Map1Vertex4.Order = uorder; ctx->EvalMap.Map1Vertex4.u1 = u1; ctx->EvalMap.Map1Vertex4.u2 = u2; ctx->EvalMap.Map1Vertex4.du = 1.0 / (u2 - u1); - if (ctx->EvalMap.Map1Vertex4.Points - && !ctx->EvalMap.Map1Vertex4.Retain) { + if (ctx->EvalMap.Map1Vertex4.Points) FREE( ctx->EvalMap.Map1Vertex4.Points ); - } - ctx->EvalMap.Map1Vertex4.Points = (GLfloat *) points; - ctx->EvalMap.Map1Vertex4.Retain = retain; + ctx->EvalMap.Map1Vertex4.Points = pnts; break; case GL_MAP1_INDEX: - ctx->EvalMap.Map1Index.Order = order; + ctx->EvalMap.Map1Index.Order = uorder; ctx->EvalMap.Map1Index.u1 = u1; ctx->EvalMap.Map1Index.u2 = u2; ctx->EvalMap.Map1Index.du = 1.0 / (u2 - u1); - if (ctx->EvalMap.Map1Index.Points - && !ctx->EvalMap.Map1Index.Retain) { + if (ctx->EvalMap.Map1Index.Points) FREE( ctx->EvalMap.Map1Index.Points ); - } - ctx->EvalMap.Map1Index.Points = (GLfloat *) points; - ctx->EvalMap.Map1Index.Retain = retain; + ctx->EvalMap.Map1Index.Points = pnts; break; case GL_MAP1_COLOR_4: - ctx->EvalMap.Map1Color4.Order = order; + ctx->EvalMap.Map1Color4.Order = uorder; ctx->EvalMap.Map1Color4.u1 = u1; ctx->EvalMap.Map1Color4.u2 = u2; ctx->EvalMap.Map1Color4.du = 1.0 / (u2 - u1); - if (ctx->EvalMap.Map1Color4.Points - && !ctx->EvalMap.Map1Color4.Retain) { + if (ctx->EvalMap.Map1Color4.Points) FREE( ctx->EvalMap.Map1Color4.Points ); - } - ctx->EvalMap.Map1Color4.Points = (GLfloat *) points; - ctx->EvalMap.Map1Color4.Retain = retain; + ctx->EvalMap.Map1Color4.Points = pnts; break; case GL_MAP1_NORMAL: - ctx->EvalMap.Map1Normal.Order = order; + ctx->EvalMap.Map1Normal.Order = uorder; ctx->EvalMap.Map1Normal.u1 = u1; ctx->EvalMap.Map1Normal.u2 = u2; ctx->EvalMap.Map1Normal.du = 1.0 / (u2 - u1); - if (ctx->EvalMap.Map1Normal.Points - && !ctx->EvalMap.Map1Normal.Retain) { + if (ctx->EvalMap.Map1Normal.Points) FREE( ctx->EvalMap.Map1Normal.Points ); - } - ctx->EvalMap.Map1Normal.Points = (GLfloat *) points; - ctx->EvalMap.Map1Normal.Retain = retain; + ctx->EvalMap.Map1Normal.Points = pnts; break; case GL_MAP1_TEXTURE_COORD_1: - ctx->EvalMap.Map1Texture1.Order = order; + ctx->EvalMap.Map1Texture1.Order = uorder; ctx->EvalMap.Map1Texture1.u1 = u1; ctx->EvalMap.Map1Texture1.u2 = u2; ctx->EvalMap.Map1Texture1.du = 1.0 / (u2 - u1); - if (ctx->EvalMap.Map1Texture1.Points - && !ctx->EvalMap.Map1Texture1.Retain) { + if (ctx->EvalMap.Map1Texture1.Points) FREE( ctx->EvalMap.Map1Texture1.Points ); - } - ctx->EvalMap.Map1Texture1.Points = (GLfloat *) points; - ctx->EvalMap.Map1Texture1.Retain = retain; + ctx->EvalMap.Map1Texture1.Points = pnts; break; case GL_MAP1_TEXTURE_COORD_2: - ctx->EvalMap.Map1Texture2.Order = order; + ctx->EvalMap.Map1Texture2.Order = uorder; ctx->EvalMap.Map1Texture2.u1 = u1; ctx->EvalMap.Map1Texture2.u2 = u2; ctx->EvalMap.Map1Texture2.du = 1.0 / (u2 - u1); - if (ctx->EvalMap.Map1Texture2.Points - && !ctx->EvalMap.Map1Texture2.Retain) { + if (ctx->EvalMap.Map1Texture2.Points) FREE( ctx->EvalMap.Map1Texture2.Points ); - } - ctx->EvalMap.Map1Texture2.Points = (GLfloat *) points; - ctx->EvalMap.Map1Texture2.Retain = retain; + ctx->EvalMap.Map1Texture2.Points = pnts; break; case GL_MAP1_TEXTURE_COORD_3: - ctx->EvalMap.Map1Texture3.Order = order; + ctx->EvalMap.Map1Texture3.Order = uorder; ctx->EvalMap.Map1Texture3.u1 = u1; ctx->EvalMap.Map1Texture3.u2 = u2; ctx->EvalMap.Map1Texture3.du = 1.0 / (u2 - u1); - if (ctx->EvalMap.Map1Texture3.Points - && !ctx->EvalMap.Map1Texture3.Retain) { + if (ctx->EvalMap.Map1Texture3.Points) FREE( ctx->EvalMap.Map1Texture3.Points ); - } - ctx->EvalMap.Map1Texture3.Points = (GLfloat *) points; - ctx->EvalMap.Map1Texture3.Retain = retain; + ctx->EvalMap.Map1Texture3.Points = pnts; break; case GL_MAP1_TEXTURE_COORD_4: - ctx->EvalMap.Map1Texture4.Order = order; + ctx->EvalMap.Map1Texture4.Order = uorder; ctx->EvalMap.Map1Texture4.u1 = u1; ctx->EvalMap.Map1Texture4.u2 = u2; ctx->EvalMap.Map1Texture4.du = 1.0 / (u2 - u1); - if (ctx->EvalMap.Map1Texture4.Points - && !ctx->EvalMap.Map1Texture4.Retain) { + if (ctx->EvalMap.Map1Texture4.Points) FREE( ctx->EvalMap.Map1Texture4.Points ); - } - ctx->EvalMap.Map1Texture4.Points = (GLfloat *) points; - ctx->EvalMap.Map1Texture4.Retain = retain; + ctx->EvalMap.Map1Texture4.Points = pnts; break; default: gl_error( ctx, GL_INVALID_ENUM, "glMap1(target)" ); @@ -969,18 +940,30 @@ void gl_Map1f( GLcontext* ctx, GLenum target, +void +_mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, + GLint order, const GLfloat *points ) +{ + map1(target, u1, u2, stride, order, points, GL_FLOAT); +} -/* - * Note that the array of control points must be 'unpacked' at this time. - * Input: retain - if TRUE, this control point data is also in a display - * list and can't be freed until the list is freed. - */ -void gl_Map2f( GLcontext* ctx, GLenum target, - GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, - GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, - const GLfloat *points, GLboolean retain ) + +void +_mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, + GLint order, const GLdouble *points ) { + map1(target, u1, u2, stride, order, points, GL_DOUBLE); +} + + +static void +map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, + GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, + const GLvoid *points, GLenum type ) +{ + GET_CURRENT_CONTEXT(ctx); GLint k; + GLfloat *pnts; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glMap2"); @@ -1004,7 +987,7 @@ void gl_Map2f( GLcontext* ctx, GLenum target, return; } - k = components( target ); + k = _mesa_evaluator_components( target ); if (k==0) { gl_error( ctx, GL_INVALID_ENUM, "glMap2(target)" ); } @@ -1018,6 +1001,14 @@ void gl_Map2f( GLcontext* ctx, GLenum target, return; } + /* make copy of the control points */ + if (type == GL_FLOAT) + pnts = gl_copy_map_points2f(target, ustride, uorder, + vstride, vorder, (GLfloat*) points); + else + pnts = gl_copy_map_points2d(target, ustride, uorder, + vstride, vorder, (GLdouble*) points); + switch (target) { case GL_MAP2_VERTEX_3: ctx->EvalMap.Map2Vertex3.Uorder = uorder; @@ -1028,12 +1019,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, ctx->EvalMap.Map2Vertex3.v1 = v1; ctx->EvalMap.Map2Vertex3.v2 = v2; ctx->EvalMap.Map2Vertex3.dv = 1.0 / (v2 - v1); - if (ctx->EvalMap.Map2Vertex3.Points - && !ctx->EvalMap.Map2Vertex3.Retain) { + if (ctx->EvalMap.Map2Vertex3.Points) FREE( ctx->EvalMap.Map2Vertex3.Points ); - } - ctx->EvalMap.Map2Vertex3.Retain = retain; - ctx->EvalMap.Map2Vertex3.Points = (GLfloat *) points; + ctx->EvalMap.Map2Vertex3.Points = pnts; break; case GL_MAP2_VERTEX_4: ctx->EvalMap.Map2Vertex4.Uorder = uorder; @@ -1044,12 +1032,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, ctx->EvalMap.Map2Vertex4.v1 = v1; ctx->EvalMap.Map2Vertex4.v2 = v2; ctx->EvalMap.Map2Vertex4.dv = 1.0 / (v2 - v1); - if (ctx->EvalMap.Map2Vertex4.Points - && !ctx->EvalMap.Map2Vertex4.Retain) { + if (ctx->EvalMap.Map2Vertex4.Points) FREE( ctx->EvalMap.Map2Vertex4.Points ); - } - ctx->EvalMap.Map2Vertex4.Points = (GLfloat *) points; - ctx->EvalMap.Map2Vertex4.Retain = retain; + ctx->EvalMap.Map2Vertex4.Points = pnts; break; case GL_MAP2_INDEX: ctx->EvalMap.Map2Index.Uorder = uorder; @@ -1060,12 +1045,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, ctx->EvalMap.Map2Index.v1 = v1; ctx->EvalMap.Map2Index.v2 = v2; ctx->EvalMap.Map2Index.dv = 1.0 / (v2 - v1); - if (ctx->EvalMap.Map2Index.Points - && !ctx->EvalMap.Map2Index.Retain) { + if (ctx->EvalMap.Map2Index.Points) FREE( ctx->EvalMap.Map2Index.Points ); - } - ctx->EvalMap.Map2Index.Retain = retain; - ctx->EvalMap.Map2Index.Points = (GLfloat *) points; + ctx->EvalMap.Map2Index.Points = pnts; break; case GL_MAP2_COLOR_4: ctx->EvalMap.Map2Color4.Uorder = uorder; @@ -1076,12 +1058,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, ctx->EvalMap.Map2Color4.v1 = v1; ctx->EvalMap.Map2Color4.v2 = v2; ctx->EvalMap.Map2Color4.dv = 1.0 / (v2 - v1); - if (ctx->EvalMap.Map2Color4.Points - && !ctx->EvalMap.Map2Color4.Retain) { + if (ctx->EvalMap.Map2Color4.Points) FREE( ctx->EvalMap.Map2Color4.Points ); - } - ctx->EvalMap.Map2Color4.Retain = retain; - ctx->EvalMap.Map2Color4.Points = (GLfloat *) points; + ctx->EvalMap.Map2Color4.Points = pnts; break; case GL_MAP2_NORMAL: ctx->EvalMap.Map2Normal.Uorder = uorder; @@ -1092,12 +1071,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, ctx->EvalMap.Map2Normal.v1 = v1; ctx->EvalMap.Map2Normal.v2 = v2; ctx->EvalMap.Map2Normal.dv = 1.0 / (v2 - v1); - if (ctx->EvalMap.Map2Normal.Points - && !ctx->EvalMap.Map2Normal.Retain) { + if (ctx->EvalMap.Map2Normal.Points) FREE( ctx->EvalMap.Map2Normal.Points ); - } - ctx->EvalMap.Map2Normal.Retain = retain; - ctx->EvalMap.Map2Normal.Points = (GLfloat *) points; + ctx->EvalMap.Map2Normal.Points = pnts; break; case GL_MAP2_TEXTURE_COORD_1: ctx->EvalMap.Map2Texture1.Uorder = uorder; @@ -1108,12 +1084,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, ctx->EvalMap.Map2Texture1.v1 = v1; ctx->EvalMap.Map2Texture1.v2 = v2; ctx->EvalMap.Map2Texture1.dv = 1.0 / (v2 - v1); - if (ctx->EvalMap.Map2Texture1.Points - && !ctx->EvalMap.Map2Texture1.Retain) { + if (ctx->EvalMap.Map2Texture1.Points) FREE( ctx->EvalMap.Map2Texture1.Points ); - } - ctx->EvalMap.Map2Texture1.Retain = retain; - ctx->EvalMap.Map2Texture1.Points = (GLfloat *) points; + ctx->EvalMap.Map2Texture1.Points = pnts; break; case GL_MAP2_TEXTURE_COORD_2: ctx->EvalMap.Map2Texture2.Uorder = uorder; @@ -1124,12 +1097,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, ctx->EvalMap.Map2Texture2.v1 = v1; ctx->EvalMap.Map2Texture2.v2 = v2; ctx->EvalMap.Map2Texture2.dv = 1.0 / (v2 - v1); - if (ctx->EvalMap.Map2Texture2.Points - && !ctx->EvalMap.Map2Texture2.Retain) { + if (ctx->EvalMap.Map2Texture2.Points) FREE( ctx->EvalMap.Map2Texture2.Points ); - } - ctx->EvalMap.Map2Texture2.Retain = retain; - ctx->EvalMap.Map2Texture2.Points = (GLfloat *) points; + ctx->EvalMap.Map2Texture2.Points = pnts; break; case GL_MAP2_TEXTURE_COORD_3: ctx->EvalMap.Map2Texture3.Uorder = uorder; @@ -1140,12 +1110,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, ctx->EvalMap.Map2Texture3.v1 = v1; ctx->EvalMap.Map2Texture3.v2 = v2; ctx->EvalMap.Map2Texture3.dv = 1.0 / (v2 - v1); - if (ctx->EvalMap.Map2Texture3.Points - && !ctx->EvalMap.Map2Texture3.Retain) { + if (ctx->EvalMap.Map2Texture3.Points) FREE( ctx->EvalMap.Map2Texture3.Points ); - } - ctx->EvalMap.Map2Texture3.Retain = retain; - ctx->EvalMap.Map2Texture3.Points = (GLfloat *) points; + ctx->EvalMap.Map2Texture3.Points = pnts; break; case GL_MAP2_TEXTURE_COORD_4: ctx->EvalMap.Map2Texture4.Uorder = uorder; @@ -1156,12 +1123,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, ctx->EvalMap.Map2Texture4.v1 = v1; ctx->EvalMap.Map2Texture4.v2 = v2; ctx->EvalMap.Map2Texture4.dv = 1.0 / (v2 - v1); - if (ctx->EvalMap.Map2Texture4.Points - && !ctx->EvalMap.Map2Texture4.Retain) { + if (ctx->EvalMap.Map2Texture4.Points) FREE( ctx->EvalMap.Map2Texture4.Points ); - } - ctx->EvalMap.Map2Texture4.Retain = retain; - ctx->EvalMap.Map2Texture4.Points = (GLfloat *) points; + ctx->EvalMap.Map2Texture4.Points = pnts; break; default: gl_error( ctx, GL_INVALID_ENUM, "glMap2(target)" ); @@ -1169,11 +1133,33 @@ void gl_Map2f( GLcontext* ctx, GLenum target, } - +void +_mesa_Map2f( GLenum target, + GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, + GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, + const GLfloat *points) +{ + map2(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, + points, GL_FLOAT); +} -void gl_GetMapdv( GLcontext* ctx, GLenum target, GLenum query, GLdouble *v ) +void +_mesa_Map2d( GLenum target, + GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, + GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, + const GLdouble *points ) { + map2(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, + points, GL_DOUBLE); +} + + + +void +_mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ) +{ + GET_CURRENT_CONTEXT(ctx); GLint i, n; GLfloat *data; @@ -1443,8 +1429,10 @@ void gl_GetMapdv( GLcontext* ctx, GLenum target, GLenum query, GLdouble *v ) } -void gl_GetMapfv( GLcontext* ctx, GLenum target, GLenum query, GLfloat *v ) +void +_mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ) { + GET_CURRENT_CONTEXT(ctx); GLint i, n; GLfloat *data; @@ -1714,8 +1702,10 @@ void gl_GetMapfv( GLcontext* ctx, GLenum target, GLenum query, GLfloat *v ) } -void gl_GetMapiv( GLcontext* ctx, GLenum target, GLenum query, GLint *v ) +void +_mesa_GetMapiv( GLenum target, GLenum query, GLint *v ) { + GET_CURRENT_CONTEXT(ctx); GLuint i, n; GLfloat *data; @@ -2613,8 +2603,10 @@ void gl_eval_vb( struct vertex_buffer *VB ) } -void gl_MapGrid1f( GLcontext* ctx, GLint un, GLfloat u1, GLfloat u2 ) +void +_mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glMapGrid1f"); if (un<1) { @@ -2628,9 +2620,18 @@ void gl_MapGrid1f( GLcontext* ctx, GLint un, GLfloat u1, GLfloat u2 ) } -void gl_MapGrid2f( GLcontext* ctx, GLint un, GLfloat u1, GLfloat u2, - GLint vn, GLfloat v1, GLfloat v2 ) +void +_mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ) +{ + _mesa_MapGrid1f( un, u1, u2 ); +} + + +void +_mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, + GLint vn, GLfloat v1, GLfloat v2 ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glMapGrid2f"); if (un<1) { gl_error( ctx, GL_INVALID_VALUE, "glMapGrid2f(un)" ); @@ -2651,9 +2652,185 @@ void gl_MapGrid2f( GLcontext* ctx, GLint un, GLfloat u1, GLfloat u2, } +void +_mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, + GLint vn, GLdouble v1, GLdouble v2 ) +{ + _mesa_MapGrid2f( un, u1, u2, vn, v1, v2 ); +} + + + + +/* KW: If are compiling, we don't know whether eval will produce a + * vertex when it is run in the future. If this is pure immediate + * mode, eval is a noop if neither vertex map is enabled. + * + * Thus we need to have a check in the display list code or + * elsewhere for eval(1,2) vertices in the case where + * map(1,2)_vertex is disabled, and to purge those vertices from + * the vb. This is currently done + * via modifications to the cull_vb and render_vb operations, and + * by using the existing cullmask mechanism for all other operations. + */ + + +/* KW: Because the eval values don't become 'current', fixup will flow + * through these vertices, and then evaluation will write on top + * of the fixup results. + * + * This is a little inefficient, but at least it is correct. This + * could be short-circuited in the case where all vertices are + * eval-vertices, or more generally by a cullmask in fixup. + * + * Note: using Obj to hold eval coord data. This data is actually + * transformed if eval is disabled. But disabling eval & sending + * eval coords is stupid, right? + */ + + +#define EVALCOORD1(IM, x) \ +{ \ + GLuint count = IM->Count++; \ + IM->Flag[count] |= VERT_EVAL_C1; \ + ASSIGN_4V(IM->Obj[count], x, 0, 0, 1); \ + if (count == VB_MAX-1) \ + IM->maybe_transform_vb( IM ); \ +} + +#define EVALCOORD2(IM, x, y) \ +{ \ + GLuint count = IM->Count++; \ + IM->Flag[count] |= VERT_EVAL_C2; \ + ASSIGN_4V(IM->Obj[count], x, y, 0, 1); \ + if (count == VB_MAX-1) \ + IM->maybe_transform_vb( IM ); \ +} + +#define EVALPOINT1(IM, x) \ +{ \ + GLuint count = IM->Count++; \ + IM->Flag[count] |= VERT_EVAL_P1; \ + ASSIGN_4V(IM->Obj[count], x, 0, 0, 1); \ + if (count == VB_MAX-1) \ + IM->maybe_transform_vb( IM ); \ +} + +#define EVALPOINT2(IM, x, y) \ +{ \ + GLuint count = IM->Count++; \ + IM->Flag[count] |= VERT_EVAL_P2; \ + ASSIGN_4V(IM->Obj[count], x, y, 0, 1); \ + if (count == VB_MAX-1) \ + IM->maybe_transform_vb( IM ); \ +} + + +/* Lame internal function: + */ +void gl_EvalCoord1f( GLcontext *CC, GLfloat u ) +{ + struct immediate *i = CC->input; + EVALCOORD1( i, u ); +} + + +void +_mesa_EvalCoord1d( GLdouble u ) +{ + GET_IMMEDIATE; + EVALCOORD1( IM, (GLfloat) u ); +} + + +void +_mesa_EvalCoord1f( GLfloat u ) +{ + GET_IMMEDIATE; + EVALCOORD1( IM, u ); +} + + +void +_mesa_EvalCoord1dv( const GLdouble *u ) +{ + GET_IMMEDIATE; + EVALCOORD1( IM, (GLfloat) *u ); +} + + +void +_mesa_EvalCoord1fv( const GLfloat *u ) +{ + GET_IMMEDIATE; + EVALCOORD1( IM, (GLfloat) *u ); +} + + +void +_mesa_EvalCoord2d( GLdouble u, GLdouble v ) +{ + GET_IMMEDIATE; + EVALCOORD2( IM, (GLfloat) u, (GLfloat) v ); +} + + +void +_mesa_EvalCoord2f( GLfloat u, GLfloat v ) +{ + GET_IMMEDIATE; + EVALCOORD2( IM, u, v ); +} + + +/* Lame internal function: + */ +void gl_EvalCoord2f( GLcontext *CC, GLfloat u, GLfloat v ) +{ + struct immediate *i = CC->input; + EVALCOORD2( i, u, v ); +} + + +void +_mesa_EvalCoord2dv( const GLdouble *u ) +{ + GET_IMMEDIATE; + EVALCOORD2( IM, (GLfloat) u[0], (GLfloat) u[1] ); +} + + +void +_mesa_EvalCoord2fv( const GLfloat *u ) +{ + GET_IMMEDIATE; + EVALCOORD2( IM, u[0], u[1] ); +} + + +void +_mesa_EvalPoint1( GLint i ) +{ + GET_IMMEDIATE; + EVALPOINT1( IM, i ); +} + + +void +_mesa_EvalPoint2( GLint i, GLint j ) +{ + GET_IMMEDIATE; + EVALPOINT2( IM, i, j ); +} + + + -void gl_EvalMesh1( GLcontext* ctx, GLenum mode, GLint i1, GLint i2 ) + +void +_mesa_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) { + GET_CURRENT_CONTEXT(ctx); GLint i; GLfloat u, du; GLenum prim; @@ -2693,11 +2870,10 @@ void gl_EvalMesh1( GLcontext* ctx, GLenum mode, GLint i1, GLint i2 ) -void gl_EvalMesh2( GLcontext* ctx, - GLenum mode, - GLint i1, GLint i2, - GLint j1, GLint j2 ) +void +_mesa_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) { + GET_CURRENT_CONTEXT(ctx); GLint i, j; GLfloat u, du, v, dv, v1, u1; @@ -2758,3 +2934,6 @@ void gl_EvalMesh2( GLcontext* ctx, return; } } + + + diff --git a/src/mesa/main/eval.h b/src/mesa/main/eval.h index cde76b08dde..0b87be3d5fe 100644 --- a/src/mesa/main/eval.h +++ b/src/mesa/main/eval.h @@ -1,8 +1,8 @@ -/* $Id: eval.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: eval.h,v 1.2 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -35,6 +35,9 @@ extern void gl_init_eval( void ); +extern GLuint _mesa_evaluator_components( GLenum target ); + + extern void gl_free_control_points( GLcontext *ctx, GLenum target, GLfloat *data ); @@ -58,38 +61,86 @@ extern GLfloat *gl_copy_map_points2d(GLenum target, const GLdouble *points ); -extern void gl_Map1f( GLcontext* ctx, - GLenum target, GLfloat u1, GLfloat u2, GLint stride, - GLint order, const GLfloat *points, GLboolean retain ); +extern void gl_eval_vb( struct vertex_buffer *VB ); -extern void gl_Map2f( GLcontext* ctx, GLenum target, - GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, - GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, - const GLfloat *points, GLboolean retain ); +extern void +_mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, + GLint order, const GLfloat *points ); +extern void +_mesa_Map2f( GLenum target, + GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, + GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, + const GLfloat *points ); -extern void gl_MapGrid1f( GLcontext* ctx, GLint un, GLfloat u1, GLfloat u2 ); +extern void +_mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, + GLint order, const GLdouble *points ); -extern void gl_MapGrid2f( GLcontext* ctx, - GLint un, GLfloat u1, GLfloat u2, - GLint vn, GLfloat v1, GLfloat v2 ); +extern void +_mesa_Map2d( GLenum target, + GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, + GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, + const GLdouble *points ); -extern void gl_GetMapdv( GLcontext* ctx, - GLenum target, GLenum query, GLdouble *v ); +extern void +_mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); -extern void gl_GetMapfv( GLcontext* ctx, - GLenum target, GLenum query, GLfloat *v ); +extern void +_mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); -extern void gl_GetMapiv( GLcontext* ctx, - GLenum target, GLenum query, GLint *v ); +extern void +_mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, + GLint vn, GLfloat v1, GLfloat v2 ); -extern void gl_EvalMesh1( GLcontext* ctx, GLenum mode, GLint i1, GLint i2 ); +extern void +_mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, + GLint vn, GLdouble v1, GLdouble v2 ); -extern void gl_EvalMesh2( GLcontext* ctx, GLenum mode, - GLint i1, GLint i2, GLint j1, GLint j2 ); +extern void +_mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ); -extern void gl_eval_vb( struct vertex_buffer *VB ); +extern void +_mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ); + +extern void +_mesa_GetMapiv( GLenum target, GLenum query, GLint *v ); + +extern void +_mesa_EvalMesh1( GLenum mode, GLint i1, GLint i2 ); + +extern void +_mesa_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); + +extern void +_mesa_EvalCoord1d( GLdouble u ); + +extern void +_mesa_EvalCoord1f( GLfloat u ); + +extern void +_mesa_EvalCoord1dv( const GLdouble *u ); + +extern void +_mesa_EvalCoord1fv( const GLfloat *u ); + +extern void +_mesa_EvalCoord2d( GLdouble u, GLdouble v ); + +extern void +_mesa_EvalCoord2f( GLfloat u, GLfloat v ); + +extern void +_mesa_EvalCoord2dv( const GLdouble *u ); + +extern void +_mesa_EvalCoord2fv( const GLfloat *u ); + +extern void +_mesa_EvalPoint1( GLint i ); +extern void +_mesa_EvalPoint2( GLint i, GLint j ); #endif diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 80918ca1857..683fba79a0f 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -1,8 +1,8 @@ -/* $Id: extensions.c,v 1.10 1999/11/08 07:36:44 brianp Exp $ */ +/* $Id: extensions.c,v 1.11 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,15 +25,16 @@ */ -#ifndef XFree86Server -#include +#ifdef PC_HEADER +#include "all.h" #else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "extensions.h" +#include "mem.h" #include "simple_list.h" #include "types.h" +#endif #define MAX_EXT_NAMELEN 80 diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c index d377bd8a7e9..c2a52aaa538 100644 --- a/src/mesa/main/feedback.c +++ b/src/mesa/main/feedback.c @@ -1,8 +1,8 @@ -/* $Id: feedback.c,v 1.5 1999/11/08 07:36:44 brianp Exp $ */ +/* $Id: feedback.c,v 1.6 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,18 +25,10 @@ */ - - - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "enums.h" #include "feedback.h" @@ -57,8 +49,9 @@ void -gl_FeedbackBuffer( GLcontext *ctx, GLsizei size, GLenum type, GLfloat *buffer ) +_mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "glFeedbackBuffer" ); if (ctx->RenderMode==GL_FEEDBACK) { @@ -114,8 +107,10 @@ gl_FeedbackBuffer( GLcontext *ctx, GLsizei size, GLenum type, GLfloat *buffer ) -void gl_PassThrough( GLcontext *ctx, GLfloat token ) +void +_mesa_PassThrough( GLfloat token ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPassThrough"); if (ctx->RenderMode==GL_FEEDBACK) { @@ -256,8 +251,10 @@ void gl_feedback_points( GLcontext *ctx, GLuint first, GLuint last ) /* * NOTE: this function can't be put in a display list. */ -void gl_SelectBuffer( GLcontext *ctx, GLsizei size, GLuint *buffer ) +void +_mesa_SelectBuffer( GLsizei size, GLuint *buffer ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glSelectBuffer"); if (ctx->RenderMode==GL_SELECT) { gl_error( ctx, GL_INVALID_OPERATION, "glSelectBuffer" ); @@ -351,8 +348,10 @@ static void write_hit_record( GLcontext *ctx ) -void gl_InitNames( GLcontext *ctx ) +void +_mesa_InitNames( void ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glInitNames"); /* Record the hit before the HitFlag is wiped out again. */ if (ctx->RenderMode==GL_SELECT) { @@ -368,8 +367,10 @@ void gl_InitNames( GLcontext *ctx ) -void gl_LoadName( GLcontext *ctx, GLuint name ) +void +_mesa_LoadName( GLuint name ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLoadName"); if (ctx->RenderMode!=GL_SELECT) { return; @@ -390,8 +391,10 @@ void gl_LoadName( GLcontext *ctx, GLuint name ) } -void gl_PushName( GLcontext *ctx, GLuint name ) +void +_mesa_PushName( GLuint name ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPushName"); if (ctx->RenderMode!=GL_SELECT) { return; @@ -409,8 +412,10 @@ void gl_PushName( GLcontext *ctx, GLuint name ) -void gl_PopName( GLcontext *ctx ) +void +_mesa_PopName( void ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPopName"); if (ctx->RenderMode!=GL_SELECT) { return; @@ -437,8 +442,10 @@ void gl_PopName( GLcontext *ctx ) /* * NOTE: this function can't be put in a display list. */ -GLint gl_RenderMode( GLcontext *ctx, GLenum mode ) +GLint +_mesa_RenderMode( GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); GLint result; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glRenderMode", 0); diff --git a/src/mesa/main/feedback.h b/src/mesa/main/feedback.h index 08aee085199..1909009b565 100644 --- a/src/mesa/main/feedback.h +++ b/src/mesa/main/feedback.h @@ -1,8 +1,8 @@ -/* $Id: feedback.h,v 1.2 1999/09/18 20:41:23 keithw Exp $ */ +/* $Id: feedback.h,v 1.3 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,9 +25,6 @@ */ - - - #ifndef FEEDBACK_H #define FEEDBACK_H @@ -52,22 +49,30 @@ extern void gl_feedback_vertex( GLcontext *ctx, extern void gl_update_hitflag( GLcontext *ctx, GLfloat z ); -extern void gl_PassThrough( GLcontext *ctx, GLfloat token ); +extern void +_mesa_PassThrough( GLfloat token ); + +extern void +_mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); -extern void gl_FeedbackBuffer( GLcontext *ctx, GLsizei size, - GLenum type, GLfloat *buffer ); +extern void +_mesa_SelectBuffer( GLsizei size, GLuint *buffer ); -extern void gl_SelectBuffer( GLcontext *ctx, GLsizei size, GLuint *buffer ); +extern void +_mesa_InitNames( void ); -extern void gl_InitNames( GLcontext *ctx ); +extern void +_mesa_LoadName( GLuint name ); -extern void gl_LoadName( GLcontext *ctx, GLuint name ); +extern void +_mesa_PushName( GLuint name ); -extern void gl_PushName( GLcontext *ctx, GLuint name ); +extern void +_mesa_PopName( void ); -extern void gl_PopName( GLcontext *ctx ); +extern GLint +_mesa_RenderMode( GLenum mode ); -extern GLint gl_RenderMode( GLcontext *ctx, GLenum mode ); extern void gl_feedback_points( GLcontext *ctx, GLuint first, GLuint last ); extern void gl_feedback_line( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv ); diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c index 211454b1127..e1a69f3b0d9 100644 --- a/src/mesa/main/fog.c +++ b/src/mesa/main/fog.c @@ -1,8 +1,8 @@ -/* $Id: fog.c,v 1.3 1999/11/08 07:36:44 brianp Exp $ */ +/* $Id: fog.c,v 1.4 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,17 +25,10 @@ */ -/* $XFree86: xc/lib/GL/mesa/src/fog.c,v 1.4 1999/04/04 00:20:24 dawes Exp $ */ - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "fog.h" #include "macros.h" @@ -45,8 +38,51 @@ -void gl_Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *params ) +void +_mesa_Fogf(GLenum pname, GLfloat param) +{ + _mesa_Fogfv(pname, ¶m); +} + + +void +_mesa_Fogi(GLenum pname, GLint param ) +{ + GLfloat fparam = (GLfloat) param; + _mesa_Fogfv(pname, &fparam); +} + + +void +_mesa_Fogiv(GLenum pname, const GLint *params ) +{ + GLfloat p[4]; + switch (pname) { + case GL_FOG_MODE: + case GL_FOG_DENSITY: + case GL_FOG_START: + case GL_FOG_END: + case GL_FOG_INDEX: + p[0] = (GLfloat) *params; + break; + case GL_FOG_COLOR: + p[0] = INT_TO_FLOAT( params[0] ); + p[1] = INT_TO_FLOAT( params[1] ); + p[2] = INT_TO_FLOAT( params[2] ); + p[3] = INT_TO_FLOAT( params[3] ); + break; + default: + /* Error will be caught later in gl_Fogfv */ + ; + } + _mesa_Fogfv(pname, p); +} + + +void +_mesa_Fogfv( GLenum pname, const GLfloat *params ) { + GET_CURRENT_CONTEXT(ctx); GLenum m; switch (pname) { diff --git a/src/mesa/main/fog.h b/src/mesa/main/fog.h index cf9dcebaf7d..0bb4d9d72aa 100644 --- a/src/mesa/main/fog.h +++ b/src/mesa/main/fog.h @@ -1,8 +1,8 @@ -/* $Id: fog.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: fog.h,v 1.2 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,7 +25,6 @@ */ - #ifndef FOG_H #define FOG_H @@ -33,7 +32,21 @@ #include "types.h" -extern void gl_Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *params ); +extern void +_mesa_Fogf(GLenum pname, GLfloat param); + + +extern void +_mesa_Fogi(GLenum pname, GLint param ); + + +extern void +_mesa_Fogfv(GLenum pname, const GLfloat *params ); + + +extern void +_mesa_Fogiv(GLenum pname, const GLint *params ); + extern void gl_fog_vertices( struct vertex_buffer *VB ); diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 25544d01263..165b9589ed5 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1,8 +1,8 @@ -/* $Id: get.c,v 1.5 1999/10/17 22:36:35 brianp Exp $ */ +/* $Id: get.c,v 1.6 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,18 +25,10 @@ */ -/* $XFree86: xc/lib/GL/mesa/src/get.c,v 1.3 1999/04/04 00:20:25 dawes Exp $ */ - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "enable.h" #include "enums.h" @@ -66,8 +58,10 @@ -void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params ) +void +_mesa_GetBooleanv( GLenum pname, GLboolean *params ) { + GET_CURRENT_CONTEXT(ctx); GLuint i; GLuint texUnit = ctx->Texture.CurrentUnit; GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit; @@ -748,13 +742,13 @@ void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params ) *params = INT_TO_BOOL(0); /* TODO */ break; case GL_TEXTURE_1D: - *params = gl_IsEnabled( ctx, GL_TEXTURE_1D ); + *params = _mesa_IsEnabled(GL_TEXTURE_1D ); break; case GL_TEXTURE_2D: - *params = gl_IsEnabled( ctx, GL_TEXTURE_2D ); + *params = _mesa_IsEnabled(GL_TEXTURE_2D ); break; case GL_TEXTURE_3D: - *params = gl_IsEnabled( ctx, GL_TEXTURE_3D ); + *params = _mesa_IsEnabled(GL_TEXTURE_3D ); break; case GL_TEXTURE_BINDING_1D: *params = INT_TO_BOOL(textureUnit->CurrentD[1]->Name); @@ -978,8 +972,10 @@ void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params ) -void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params ) +void +_mesa_GetDoublev( GLenum pname, GLdouble *params ) { + GET_CURRENT_CONTEXT(ctx); GLuint i; GLuint texUnit = ctx->Texture.CurrentUnit; GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit; @@ -1660,13 +1656,13 @@ void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params ) *params = 0.0; /* TODO */ break; case GL_TEXTURE_1D: - *params = gl_IsEnabled(ctx, GL_TEXTURE_1D) ? 1.0 : 0.0; + *params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1.0 : 0.0; break; case GL_TEXTURE_2D: - *params = gl_IsEnabled(ctx, GL_TEXTURE_2D) ? 1.0 : 0.0; + *params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1.0 : 0.0; break; case GL_TEXTURE_3D: - *params = gl_IsEnabled(ctx, GL_TEXTURE_3D) ? 1.0 : 0.0; + *params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1.0 : 0.0; break; case GL_TEXTURE_BINDING_1D: *params = (GLdouble) textureUnit->CurrentD[1]->Name; @@ -1893,8 +1889,10 @@ void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params ) -void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params ) +void +_mesa_GetFloatv( GLenum pname, GLfloat *params ) { + GET_CURRENT_CONTEXT(ctx); GLuint i; GLuint texUnit = ctx->Texture.CurrentUnit; GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit; @@ -2572,13 +2570,13 @@ void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params ) *params = 0.0F; /* TODO */ break; case GL_TEXTURE_1D: - *params = gl_IsEnabled(ctx, GL_TEXTURE_1D) ? 1.0 : 0.0; + *params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1.0 : 0.0; break; case GL_TEXTURE_2D: - *params = gl_IsEnabled(ctx, GL_TEXTURE_2D) ? 1.0 : 0.0; + *params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1.0 : 0.0; break; case GL_TEXTURE_3D: - *params = gl_IsEnabled(ctx, GL_TEXTURE_3D) ? 1.0 : 0.0; + *params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1.0 : 0.0; break; case GL_TEXTURE_BINDING_1D: *params = (GLfloat) textureUnit->CurrentD[1]->Name; @@ -2802,8 +2800,10 @@ void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params ) -void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params ) +void +_mesa_GetIntegerv( GLenum pname, GLint *params ) { + GET_CURRENT_CONTEXT(ctx); GLuint i; GLuint texUnit = ctx->Texture.CurrentUnit; GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit; @@ -3485,13 +3485,13 @@ void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params ) *params = 0; /* TODO */ break; case GL_TEXTURE_1D: - *params = gl_IsEnabled(ctx, GL_TEXTURE_1D) ? 1 : 0; + *params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1 : 0; break; case GL_TEXTURE_2D: - *params = gl_IsEnabled(ctx, GL_TEXTURE_2D) ? 1 : 0; + *params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1 : 0; break; case GL_TEXTURE_3D: - *params = gl_IsEnabled(ctx, GL_TEXTURE_3D) ? 1 : 0; + *params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1 : 0; break; case GL_TEXTURE_BINDING_1D: *params = textureUnit->CurrentD[1]->Name; @@ -3725,8 +3725,10 @@ void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params ) -void gl_GetPointerv( GLcontext *ctx, GLenum pname, GLvoid **params ) +void +_mesa_GetPointerv( GLenum pname, GLvoid **params ) { + GET_CURRENT_CONTEXT(ctx); GLuint texUnit = ctx->Texture.CurrentUnit; /*GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;*/ @@ -3766,11 +3768,13 @@ void gl_GetPointerv( GLcontext *ctx, GLenum pname, GLvoid **params ) -const GLubyte *gl_GetString( GLcontext *ctx, GLenum name ) +const GLubyte * +_mesa_GetString( GLenum name ) { + GET_CURRENT_CONTEXT(ctx); static char result[1000]; static char *vendor = "Brian Paul"; - static char *version = "1.2 Mesa 3.1 beta"; + static char *version = "1.2 Mesa 3.3 beta"; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glGetString", 0); @@ -3811,3 +3815,24 @@ const GLubyte *gl_GetString( GLcontext *ctx, GLenum name ) return NULL; } } + + +/* + * Execute a glGetError command + */ +GLenum +_mesa_GetError( void ) +{ + GET_CURRENT_CONTEXT(ctx); + + GLenum e = ctx->ErrorValue; + + ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL( ctx, "glGetError", (GLenum) 0); + + if (MESA_VERBOSE & VERBOSE_API) + fprintf(stderr, "glGetError <-- %s\n", gl_lookup_enum_by_nr(e)); + + ctx->ErrorValue = (GLenum) GL_NO_ERROR; + return e; +} + diff --git a/src/mesa/main/get.h b/src/mesa/main/get.h index fefdb219c95..609a86ad3c8 100644 --- a/src/mesa/main/get.h +++ b/src/mesa/main/get.h @@ -1,8 +1,8 @@ -/* $Id: get.h,v 1.2 1999/09/09 23:47:09 brianp Exp $ */ +/* $Id: get.h,v 1.3 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,9 +25,6 @@ */ - - - #ifndef GET_H #define GET_H @@ -35,17 +32,27 @@ #include "types.h" -extern void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params ); +extern void +_mesa_GetBooleanv( GLenum pname, GLboolean *params ); + +extern void +_mesa_GetDoublev( GLenum pname, GLdouble *params ); + +extern void +_mesa_GetFloatv( GLenum pname, GLfloat *params ); -extern void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params ); +extern void +_mesa_GetIntegerv( GLenum pname, GLint *params ); -extern void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params ); +extern void +_mesa_GetPointerv( GLenum pname, GLvoid **params ); -extern void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params ); +extern const GLubyte * +_mesa_GetString( GLenum name ); -extern void gl_GetPointerv( GLcontext *ctx, GLenum pname, GLvoid **params ); +extern GLenum +_mesa_GetError( void ); -extern const GLubyte *gl_GetString( GLcontext *ctx, GLenum name ); #endif diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h new file mode 100644 index 00000000000..f4930cb01fe --- /dev/null +++ b/src/mesa/main/glheader.h @@ -0,0 +1,65 @@ +/* $Id: glheader.h,v 1.1 1999/11/11 01:22:26 brianp 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. + */ + + +#ifndef GLHEADER_H +#define GLHEADER_H + + +/* + * This is the top-most include file of the Mesa sources. + * It includes gl.h and all system headers which are needed. + * Other Mesa source files should _not_ directly include any system + * headers. This allows Mesa to be integrated into XFree86 and + * allows system-dependent hacks/work-arounds to be collected in one place. + * + * If you touch this file, everything gets recompiled! + * + * This file should be included before any other header in the .c files. + */ + + +#ifdef XFree86LOADER +#include "xf86_ansic.h" +#else +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#ifdef HAVE_CONFIG_H +#include "conf.h" +#endif + +#include + + +#endif diff --git a/src/mesa/main/hash.c b/src/mesa/main/hash.c index 0b0eabfb102..c25190335d3 100644 --- a/src/mesa/main/hash.c +++ b/src/mesa/main/hash.c @@ -1,8 +1,8 @@ -/* $Id: hash.c,v 1.3 1999/10/13 18:42:50 brianp Exp $ */ +/* $Id: hash.c,v 1.4 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,24 +25,17 @@ */ - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "hash.h" -#include "macros.h" +#include "mem.h" #endif /* - * Generic hash table. Only dependency is the GLuint datatype. + * Generic hash table. * * This is used to implement display list and texture object lookup. * NOTE: key=0 is illegal. diff --git a/src/mesa/main/hash.h b/src/mesa/main/hash.h index a38159ce090..bd4788ace1a 100644 --- a/src/mesa/main/hash.h +++ b/src/mesa/main/hash.h @@ -1,8 +1,8 @@ -/* $Id: hash.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: hash.h,v 1.2 1999/11/11 01:22:26 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,14 +25,11 @@ */ - - - #ifndef HASH_H #define HASH_H -#include "GL/gl.h" +#include "glheader.h" struct HashTable; diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 582fa5c147e..87a5c4800a6 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1,8 +1,8 @@ -/* $Id: image.c,v 1.13 1999/11/08 07:36:44 brianp Exp $ */ +/* $Id: image.c,v 1.14 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,20 +25,14 @@ */ - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "image.h" #include "macros.h" +#include "mem.h" #include "mmath.h" #include "pixel.h" #include "types.h" @@ -46,6 +40,26 @@ +/* + * These are the image packing parameters for Mesa's internal images. + * That is, _mesa_unpack_image() returns image data in this format. + * When we execute image commands (glDrawPixels, glTexImage, etc) + * from within display lists we have to be sure to set the current + * unpacking params to these values! + */ +struct gl_pixelstore_attrib _mesa_native_packing = { + 1, /* Alignment */ + 0, /* RowLength */ + 0, /* SkipPixels */ + 0, /* SkipRows */ + 0, /* ImageHeight */ + 0, /* SkipImages */ + GL_FALSE, /* SwapBytes */ + GL_FALSE /* LsbFirst */ +}; + + + /* * Flip the 8 bits in each byte of the given array. */ @@ -207,7 +221,6 @@ GLint gl_components_in_format( GLenum format ) case GL_BLUE: case GL_ALPHA: case GL_LUMINANCE: - case GL_INTENSITY: return 1; case GL_LUMINANCE_ALPHA: return 2; @@ -476,441 +489,6 @@ GLvoid *gl_pixel_addr_in_image( const struct gl_pixelstore_attrib *packing, -/* - * Allocate a new gl_image. All fields are initialized to zero. - */ -static struct gl_image *alloc_image( void ) -{ - return CALLOC_STRUCT(gl_image); -} - - - -/* - * Allocate a new gl_image with the error flag set. - */ -static struct gl_image *alloc_error_image( GLint width, GLint height, - GLint depth, GLenum format, - GLenum type ) -{ - struct gl_image *image = alloc_image(); - if (image) { - image->Width = width; - image->Height = height; - image->Depth = depth; - image->Format = format; - image->Type = type; - image->ErrorFlag = GL_TRUE; - } - return image; -} - - - -/* - * Free a gl_image. - */ -void gl_free_image( struct gl_image *image ) -{ - if (image->Data) { - FREE(image->Data); - } - FREE(image); -} - - - -/* - * Do error checking on an image. If there's an error, register it and - * return GL_TRUE, else return GL_FALSE. - */ -GLboolean gl_image_error_test( GLcontext *ctx, const struct gl_image *image, - const char *msg ) -{ - if (!image) { - gl_error( ctx, GL_OUT_OF_MEMORY, msg ); - return GL_TRUE; - } - if (image->Width <= 0 || image->Height <= 0 || image->Depth <= 0) { - gl_error( ctx, GL_INVALID_VALUE, msg ); - return GL_TRUE; - } - else if (!gl_is_legal_format_and_type(image->Format, image->Type)) { - return GL_TRUE; - } - else { - return GL_FALSE; - } -} - - - -/* - * Unpack a depth-buffer image storing values as GLshort, GLuint, or GLfloats. - * Input: type - datatype of src depth image - * Return pointer to a new gl_image structure. - * - * Notes: if the source image type is GLushort then the gl_image will - * also store GLushorts. If the src image type is GLuint then the gl_image - * will also store GLuints. For all other src image types the gl_image - * will store GLfloats. The integer cases can later be optimized. - */ -static struct gl_image * -unpack_depth_image( GLcontext *ctx, GLenum type, GLint width, GLint height, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing) - -{ - struct gl_image *image; - GLfloat *fDst; - GLushort *sDst; - GLuint *iDst; - GLint i, j; - GLboolean errorType; - - errorType = type != GL_BYTE && - type != GL_UNSIGNED_BYTE && - type != GL_SHORT && - type != GL_UNSIGNED_SHORT && - type != GL_INT && - type != GL_UNSIGNED_INT && - type != GL_FLOAT; - - image = alloc_image(); - if (image) { - image->Width = width; - image->Height = height; - image->Depth = 1; - image->Components = 1; - image->Format = GL_DEPTH_COMPONENT; - if (errorType) { - image->Type = type; - image->Data = NULL; - } - if (type==GL_UNSIGNED_SHORT) { - image->Type = GL_UNSIGNED_SHORT; - image->Data = MALLOC( width * height * sizeof(GLushort)); - } - else if (type==GL_UNSIGNED_INT) { - image->Type = GL_UNSIGNED_INT; - image->Data = MALLOC( width * height * sizeof(GLuint)); - } - else { - image->Type = GL_FLOAT; - image->Data = MALLOC( width * height * sizeof(GLfloat)); - } - image->RefCount = 0; - if (!image->Data) - return image; - } - else { - return NULL; - } - - if (errorType) - return image; - - fDst = (GLfloat *) image->Data; - sDst = (GLushort *) image->Data; - iDst = (GLuint *) image->Data; - - for (i=0;iType == GL_FLOAT); - for (j=0; jType == GL_FLOAT); - for (j=0; jType == GL_UNSIGNED_SHORT); - MEMCPY( sDst, src, width * sizeof(GLushort) ); - if (packing->SwapBytes) { - gl_swap2( sDst, width ); - } - sDst += width; - break; - case GL_SHORT: - assert(image->Type == GL_FLOAT); - if (packing->SwapBytes) { - for (j=0;j> 8) & 0xff) | ((value&0xff) << 8); - *fDst++ = SHORT_TO_FLOAT(value); - } - } - else { - for (j=0;jType == GL_FLOAT); - if (packing->SwapBytes) { - for (j=0;j> 24) & 0x000000ff) | - ((value >> 8) & 0x0000ff00) | - ((value << 8) & 0x00ff0000) | - ((value << 24) & 0xff000000); - *fDst++ = INT_TO_FLOAT(value); - } - } - else { - for (j=0;jType == GL_UNSIGNED_INT); - MEMCPY( iDst, src, width * sizeof(GLuint) ); - if (packing->SwapBytes) { - gl_swap4( iDst, width ); - } - iDst += width; - break; - case GL_FLOAT: - assert(image->Type == GL_FLOAT); - MEMCPY( fDst, src, width * sizeof(GLfloat) ); - if (packing->SwapBytes) { - gl_swap4( (GLuint*) fDst, width ); - } - fDst += width; - break; - default: - gl_problem(ctx, "unpack_depth_image type" ); - return image; - } - } - - return image; -} - - - -/* - * Unpack a stencil image. Store as GLubytes in a gl_image structure. - * Return: pointer to new gl_image structure. - */ -static struct gl_image * -unpack_stencil_image( GLcontext *ctx, GLenum type, GLint width, GLint height, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing ) -{ - struct gl_image *image; - GLubyte *dst; - GLint i, j; - GLboolean errorType; - - assert(sizeof(GLstencil) == sizeof(GLubyte)); - - errorType = type != GL_BYTE && - type != GL_UNSIGNED_BYTE && - type != GL_SHORT && - type != GL_UNSIGNED_SHORT && - type != GL_INT && - type != GL_UNSIGNED_INT && - type != GL_FLOAT && - type != GL_BITMAP; - - image = alloc_image(); - if (image) { - image->Width = width; - image->Height = height; - image->Depth = 1; - image->Components = 1; - image->Format = GL_STENCIL_INDEX; - if (errorType) { - image->Type = type; - image->Data = NULL; - } - else { - image->Type = GL_UNSIGNED_BYTE; - image->Data = MALLOC( width * height * sizeof(GLubyte)); - } - image->RefCount = 0; - if (!image->Data) - return image; - } - else { - return NULL; - } - - if (errorType) - return image; /* error will be generated later */ - - dst = (GLubyte *) image->Data; - - for (i=0;iSwapBytes) { - /* grab upper byte */ - for (j=0; j < width; j++) { - *dst++ = (((GLushort*)src)[j] & 0xff00) >> 8; - } - } - else { - for (j=0; j < width; j++) { - *dst++ = (((GLushort*)src)[j]) & 0xff; - } - } - break; - case GL_INT: - if (packing->SwapBytes) { - /* grab upper byte */ - for (j=0; j < width; j++) { - *dst++ = (((GLuint*)src)[j] & 0xff000000) >> 8; - } - } - else { - for (j=0; j < width; j++) { - *dst++ = (((GLuint*)src)[j]) & 0xff; - } - } - break; - case GL_UNSIGNED_INT: - if (packing->SwapBytes) { - /* grab upper byte */ - for (j=0; j < width; j++) { - *dst++ = (((GLuint*)src)[j] & 0xff000000) >> 8; - } - } - else { - for (j=0; j < width; j++) { - *dst++ = (((GLuint*)src)[j]) & 0xff; - } - } - break; - case GL_FLOAT: - if (packing->SwapBytes) { - for (j=0; j < width; j++) { - GLfloat fvalue; - GLint value = ((GLuint*)src)[j]; - value = ((value & 0xff000000) >> 24) - | ((value & 0x00ff0000) >> 8) - | ((value & 0x0000ff00) << 8) - | ((value & 0x000000ff) << 24); - fvalue = *((GLfloat*) &value); - *dst++ = ((GLint) fvalue) & 0xff; - } - } - else { - for (j=0; j < width; j++) { - GLfloat fvalue = ((GLfloat *)src)[j]; - *dst++ = ((GLint) fvalue) & 0xff; - } - } - break; - default: - gl_problem(ctx, "unpack_stencil_image type" ); - return image; - } - } - - return image; -} - - - -/* - * Unpack a bitmap, return a new gl_image struct. - */ -static struct gl_image * -unpack_bitmap( GLenum format, GLint width, GLint height, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing ) -{ - struct gl_image *image; - GLint bytes, i, width_in_bytes; - GLubyte *buffer, *dst; - - assert(format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX); - - /* Alloc dest storage */ - bytes = ((width+7)/8 * height); - if (bytes>0 && pixels!=NULL) { - buffer = (GLubyte *) MALLOC( bytes ); - if (!buffer) { - return NULL; - } - /* Copy/unpack pixel data to buffer */ - width_in_bytes = CEILING( width, 8 ); - dst = buffer; - for (i=0; iLsbFirst) { - gl_flip_bytes( buffer, bytes ); - } - } - else { - /* a 'null' bitmap */ - buffer = NULL; - } - - image = alloc_image(); - if (image) { - image->Width = width; - image->Height = height; - image->Depth = 1; - image->Components = 0; - image->Format = format; - image->Type = GL_BITMAP; - image->Data = buffer; - image->RefCount = 0; - } - else { - FREE( buffer ); - return NULL; - } - - return image; -} - - - /* * Unpack a 32x32 pixel polygon stipple from user memory using the * current pixel unpack settings. @@ -935,723 +513,28 @@ void gl_unpack_polygon_stipple( const GLcontext *ctx, } - -/* - * Pack polygon stipple into user memory given current pixel packing - * settings. - */ -void gl_pack_polygon_stipple( const GLcontext *ctx, - const GLuint pattern[32], - GLubyte *dest ) -{ - GLint i; - for (i = 0; i < 32; i++) { - GLubyte *dst = (GLubyte *) gl_pixel_addr_in_image( &ctx->Pack, dest, - 32, 32, GL_COLOR_INDEX, GL_BITMAP, 0, i, 0 ); - dst[0] = (pattern[i] >> 24) & 0xff; - dst[1] = (pattern[i] >> 16) & 0xff; - dst[2] = (pattern[i] >> 8) & 0xff; - dst[3] = (pattern[i] ) & 0xff; - - /* Bit flipping within each byte */ - if (ctx->Pack.LsbFirst) { - gl_flip_bytes( (GLubyte *) dst, 4 ); - } - } -} - - - -/* - * Unpack an RGBA or CI image and store it as unsigned bytes - */ -static struct gl_image * -unpack_ubyte_image( GLint width, GLint height, - GLint depth, GLenum format, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing ) -{ - struct gl_image *image; - GLint width_in_bytes; - GLint components; - GLubyte *buffer, *dst; - GLint i, d; - - components = gl_components_in_format( format ); - - width_in_bytes = width * components * sizeof(GLubyte); - buffer = (GLubyte *) MALLOC( height * width_in_bytes * depth ); - if (!buffer) { - return NULL; - } - - /* Copy/unpack pixel data to buffer */ - dst = buffer; - for (d=0; dWidth = width; - image->Height = height; - image->Depth = depth; - image->Components = components; - if (format == GL_BGR) - image->Format = GL_RGB; - else if (format == GL_BGRA) - image->Format = GL_RGBA; - else if (format == GL_ABGR_EXT) - image->Format = GL_RGBA; - else - image->Format = format; - image->Type = GL_UNSIGNED_BYTE; - image->Data = buffer; - image->RefCount = 0; - } - else { - FREE( buffer ); - } - - return image; -} - - - -/* - * Unpack a color image storing image as GLfloats - */ -static struct gl_image * -unpack_float_image( GLcontext *ctx, GLint width, GLint height, GLint depth, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing ) -{ - struct gl_image *image; - GLfloat *dst; - GLint elems_per_row; - GLint components; - GLint i, j, d; - GLboolean normalize; - - assert(type != GL_BITMAP); - - components = gl_components_in_format( format ); - assert(components > 0); /* should have been caught earlier */ - - if (!gl_is_legal_format_and_type( format, type )) { - /* bad pixel type for format, make dummy image */ - image = alloc_image(); - if (image) { - image->Width = width; - image->Height = height; - image->Depth = depth; - image->Components = components; - image->Format = format; - image->Type = type; - image->Data = NULL; - image->RefCount = 0; - } - return image; - } - - elems_per_row = width * components; - - image = alloc_image(); - if (image) { - image->Width = width; - image->Height = height; - image->Depth = depth; - image->Components = components; - if (format == GL_BGR) - image->Format = GL_RGB; - else if (format == GL_BGRA) - image->Format = GL_RGBA; - else if (format == GL_ABGR_EXT) - image->Format = GL_RGBA; - else - image->Format = format; - image->Type = GL_FLOAT; - image->Data = MALLOC( elems_per_row * height * depth * sizeof(GLfloat)); - image->RefCount = 0; - if (!image->Data) - return image; - } - else { - return NULL; - } - - normalize = (format != GL_COLOR_INDEX) && (format != GL_STENCIL_INDEX); - - dst = (GLfloat *) image->Data; - - for (d=0; dSwapBytes) { - for (j=0;j> 8) & 0xff) | ((value&0xff) << 8); - if (normalize) { - *dst++ = USHORT_TO_FLOAT(value); - } - else { - *dst++ = (GLfloat) value; - } - } - } - else { - if (normalize) { - for (j=0;jSwapBytes) { - for (j=0;j> 8) & 0xff) | ((value&0xff) << 8); - if (normalize) { - *dst++ = SHORT_TO_FLOAT(value); - } - else { - *dst++ = (GLfloat) value; - } - } - } - else { - if (normalize) { - for (j=0;jSwapBytes) { - GLuint value; - for (j=0;j> 24) - | ((value & 0x00ff0000) >> 8) - | ((value & 0x0000ff00) << 8) - | ((value & 0x000000ff) << 24); - if (normalize) { - *dst++ = UINT_TO_FLOAT(value); - } - else { - *dst++ = (GLfloat) value; - } - } - } - else { - if (normalize) { - for (j=0;jSwapBytes) { - GLint value; - for (j=0;j> 24) - | ((value & 0x00ff0000) >> 8) - | ((value & 0x0000ff00) << 8) - | ((value & 0x000000ff) << 24); - if (normalize) { - *dst++ = INT_TO_FLOAT(value); - } - else { - *dst++ = (GLfloat) value; - } - } - } - else { - if (normalize) { - for (j=0;jSwapBytes) { - GLint value; - for (j=0;j> 24) - | ((value & 0x00ff0000) >> 8) - | ((value & 0x0000ff00) << 8) - | ((value & 0x000000ff) << 24); - *dst++ = *((GLfloat*) &value); - } - } - else { - MEMCPY( dst, src, elems_per_row*sizeof(GLfloat) ); - dst += elems_per_row; - } - break; - case GL_UNSIGNED_BYTE_3_3_2: - { - GLubyte *ubsrc = (GLubyte *) src; - for (j=0;j> 5) ) * (1.0F / 7.0F); /* red */ - *dst++ = ((p >> 2) & 0x7) * (1.0F / 7.0F); /* green */ - *dst++ = ((p ) & 0x3) * (1.0F / 3.0F); /* blue */ - } - } - break; - case GL_UNSIGNED_BYTE_2_3_3_REV: - { - GLubyte *ubsrc = (GLubyte *) src; - for (j=0;j> 3) & 0x7) * (1.0F / 7.0F); /* green */ - *dst++ = ((p >> 6) ) * (1.0F / 3.0F); /* blue */ - } - } - break; - case GL_UNSIGNED_SHORT_5_6_5: - { - GLushort *ussrc = (GLushort *) src; - for (j=0;j> 11) ) * (1.0F / 31.0F); /* red */ - *dst++ = ((p >> 5) & 0x3f) * (1.0F / 63.0F); /* green */ - *dst++ = ((p ) & 0x1f) * (1.0F / 31.0F); /* blue */ - } - } - break; - case GL_UNSIGNED_SHORT_5_6_5_REV: - { - GLushort *ussrc = (GLushort *) src; - for (j=0;j> 5) & 0x3f) * (1.0F / 63.0F); /* green */ - *dst++ = ((p >> 11) ) * (1.0F / 31.0F); /* blue */ - } - } - break; - case GL_UNSIGNED_SHORT_4_4_4_4: - { - GLushort *ussrc = (GLushort *) src; - for (j=0;j> 12) ) * (1.0F / 15.0F); /* red */ - *dst++ = ((p >> 8) & 0xf) * (1.0F / 15.0F); /* green */ - *dst++ = ((p >> 4) & 0xf) * (1.0F / 15.0F); /* blue */ - *dst++ = ((p ) & 0xf) * (1.0F / 15.0F); /* alpha */ - } - } - break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - { - GLushort *ussrc = (GLushort *) src; - for (j=0;j> 4) & 0xf) * (1.0F / 15.0F); /* green */ - *dst++ = ((p >> 8) & 0xf) * (1.0F / 15.0F); /* blue */ - *dst++ = ((p >> 12) ) * (1.0F / 15.0F); /* alpha */ - } - } - break; - case GL_UNSIGNED_SHORT_5_5_5_1: - { - GLushort *ussrc = (GLushort *) src; - for (j=0;j> 11) ) * (1.0F / 31.0F); /* red */ - *dst++ = ((p >> 6) & 0x1f) * (1.0F / 31.0F); /* green */ - *dst++ = ((p >> 1) & 0x1f) * (1.0F / 31.0F); /* blue */ - *dst++ = ((p ) & 0x1) * (1.0F / 1.0F); /* alpha */ - } - } - break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - { - GLushort *ussrc = (GLushort *) src; - for (j=0;j> 5) & 0x1f) * (1.0F / 31.0F); /* green */ - *dst++ = ((p >> 10) & 0x1f) * (1.0F / 31.0F); /* blue */ - *dst++ = ((p >> 15) ) * (1.0F / 1.0F); /* alpha */ - } - } - break; - case GL_UNSIGNED_INT_8_8_8_8: - { - GLuint *uisrc = (GLuint *) src; - for (j=0;j> 24) ); - *dst++ = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 16) & 0xff); - *dst++ = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 8) & 0xff); - *dst++ = UBYTE_COLOR_TO_FLOAT_COLOR((p ) & 0xff); - } - } - break; - case GL_UNSIGNED_INT_8_8_8_8_REV: - { - GLuint *uisrc = (GLuint *) src; - for (j=0;j> 8) & 0xff); - *dst++ = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 16) & 0xff); - *dst++ = UBYTE_COLOR_TO_FLOAT_COLOR((p >> 24) ); - } - } - break; - case GL_UNSIGNED_INT_10_10_10_2: - { - GLuint *uisrc = (GLuint *) src; - for (j=0;j> 22) ) * (1.0F / 1023.0F); /* r */ - *dst++ = ((p >> 12) & 0x3ff) * (1.0F / 1023.0F); /* g */ - *dst++ = ((p >> 2) & 0x3ff) * (1.0F / 1023.0F); /* b */ - *dst++ = ((p ) & 0x3 ) * (1.0F / 3.0F); /* a */ - } - } - break; - case GL_UNSIGNED_INT_2_10_10_10_REV: - { - GLuint *uisrc = (GLuint *) src; - for (j=0;j> 10) & 0x3ff) * (1.0F / 1023.0F); /* g */ - *dst++ = ((p >> 20) & 0x3ff) * (1.0F / 1023.0F); /* b */ - *dst++ = ((p >> 30) ) * (1.0F / 3.0F); /* a */ - } - } - break; - default: - gl_problem(ctx, "unpack_float_image type" ); - return image; - } - } - } - - if (format == GL_BGR) { - /* swap order of every float triplet from BGR to RGBA */ - GLfloat *buffer = (GLfloat *) image->Data; - for (i=0; iData; - for (i=0; iData; - for (i=0; i= 0); - - start = row * image->Width * image->Components; - - for (i=0; i < image->Width; i++) { - GLint pos = start+i; - GLfloat red, green, blue, alpha; - if (image->Type == GL_UNSIGNED_BYTE) { - const GLubyte *data = (GLubyte *) image->Data; - switch (image->Format) { - case GL_RED: - red = data[pos] * (1.0F/255.0F); - green = 0; - blue = 0; - alpha = 0; - break; - case GL_RGB: - red = data[pos*3+0] * (1.0F/255.0F); - green = data[pos*3+1] * (1.0F/255.0F); - blue = data[pos*3+2] * (1.0F/255.0F); - alpha = 0; - break; - default: - gl_problem(ctx, "bad image format in gl_scale...image_data"); - return; - } - } - else if (image->Type == GL_FLOAT) { - const GLubyte *data = (GLubyte *) image->Data; - switch (image->Format) { - case GL_RED: - red = data[pos]; - green = 0; - blue = 0; - alpha = 0; - break; - case GL_RGB: - red = data[pos*3+0]; - green = data[pos*3+1]; - blue = data[pos*3+2]; - alpha = 0; - break; - default: - gl_problem(ctx, "bad image format in gl_scale...image_data"); - return; - } - } - else { - gl_problem(ctx, "Bad image type in gl_scale_...image_data"); - return; - } - - assert(red >= 0.0 && red <= 1.0); - assert(green >= 0.0 && green <= 1.0); - assert(blue >= 0.0 && blue <= 1.0); - assert(alpha >= 0.0 && alpha <= 1.0); - - /* - if (scale or bias) { - - - } - if (mapping) { + GLint i; + for (i = 0; i < 32; i++) { + GLubyte *dst = (GLubyte *) gl_pixel_addr_in_image( &ctx->Pack, dest, + 32, 32, GL_COLOR_INDEX, GL_BITMAP, 0, i, 0 ); + dst[0] = (pattern[i] >> 24) & 0xff; + dst[1] = (pattern[i] >> 16) & 0xff; + dst[2] = (pattern[i] >> 8) & 0xff; + dst[3] = (pattern[i] ) & 0xff; + /* Bit flipping within each byte */ + if (ctx->Pack.LsbFirst) { + gl_flip_bytes( (GLubyte *) dst, 4 ); } - */ - - result[i*4+0] = (GLubyte) (red * 255.0); - result[i*4+1] = (GLubyte) (green * 255.0); - result[i*4+2] = (GLubyte) (blue * 255.0); - result[i*4+3] = (GLubyte) (alpha * 255.0); } } @@ -1678,14 +561,14 @@ void gl_pack_rgba_span( const GLcontext *ctx, const struct gl_pixelstore_attrib *packing, GLboolean applyTransferOps ) { + applyTransferOps &= (ctx->Pixel.ScaleOrBiasRGBA || ctx->Pixel.MapColorFlag); + /* Test for optimized case first */ - if (!ctx->Pixel.ScaleOrBiasRGBA && !ctx->Pixel.MapColorFlag && - format == GL_RGBA && type == GL_UNSIGNED_BYTE) { + if (!applyTransferOps && format == GL_RGBA && type == GL_UNSIGNED_BYTE) { /* common simple case */ MEMCPY( destination, rgba, n * 4 * sizeof(GLubyte) ); } - else if (!ctx->Pixel.ScaleOrBiasRGBA && !ctx->Pixel.MapColorFlag && - format == GL_RGB && type == GL_UNSIGNED_BYTE) { + else if (!applyTransferOps && format == GL_RGB && type == GL_UNSIGNED_BYTE) { /* common simple case */ GLint i; GLubyte *dest = (GLubyte *) destination; @@ -1697,6 +580,7 @@ void gl_pack_rgba_span( const GLcontext *ctx, } } else { + /* general solution */ GLfloat red[MAX_WIDTH], green[MAX_WIDTH], blue[MAX_WIDTH]; GLfloat alpha[MAX_WIDTH], luminance[MAX_WIDTH]; const GLfloat rscale = 1.0F / 255.0F; @@ -2470,11 +1354,6 @@ void gl_pack_rgba_span( const GLcontext *ctx, } - -/* - * New (3.3) functions - */ - #define SWAP2BYTE(VALUE) \ { \ GLubyte *bytes = (GLubyte *) &(VALUE); \ @@ -2679,16 +1558,6 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4], GLint stride; GLint rComp, bComp, gComp, aComp; - if (0) - { - int i; - for (i = 0; i= -1 && redIndex <= 4); - assert(greenIndex >= -1 && greenIndex <= 4); - assert(blueIndex >= -1 && blueIndex <= 4); - assert(alphaIndex >= -1 && alphaIndex <= 4); #define PROCESS(INDEX, CHANNEL, DEFAULT, TYPE, CONVERSION) \ if ((INDEX) < 0) { \ @@ -3228,22 +2086,16 @@ _mesa_unpack_ubyte_color_span( const GLcontext *ctx, srcType == GL_INT || srcType == GL_FLOAT || srcType == GL_UNSIGNED_BYTE_3_3_2 || - srcType == GL_UNSIGNED_BYTE_2_3_3_REV || - srcType == GL_UNSIGNED_SHORT_5_6_5 || - srcType == GL_UNSIGNED_SHORT_5_6_5_REV || srcType == GL_UNSIGNED_SHORT_4_4_4_4 || - srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV || srcType == GL_UNSIGNED_SHORT_5_5_5_1 || - srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV || srcType == GL_UNSIGNED_INT_8_8_8_8 || - srcType == GL_UNSIGNED_INT_8_8_8_8_REV || - srcType == GL_UNSIGNED_INT_10_10_10_2 || - srcType == GL_UNSIGNED_INT_2_10_10_10_REV); + srcType == GL_UNSIGNED_INT_10_10_10_2); /* this is intended for RGBA mode */ - ASSERT(ctx->Visual->RGBAflag); + assert(ctx->Visual->RGBAflag); applyTransferOps &= (ctx->Pixel.ScaleOrBiasRGBA || + ctx->Pixel.MapColorFlag || ctx->Pixel.MapColorFlag); /* Try simple cases first */ @@ -3426,6 +2278,7 @@ _mesa_unpack_ubyte_color_span( const GLcontext *ctx, /* Now return the GLubyte data in the requested dstFormat */ + if (dstRedIndex >= 0) { GLubyte *dst = dest; GLuint i; @@ -3588,6 +2441,206 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n, } +/* + * Unpack a row of stencil data from a client buffer according to + * the pixel unpacking parameters. Apply pixel transfer ops if enabled + * and applyTransferOps is true. + * This is (or will be) used by glDrawPixels + * + * Args: ctx - the context + * n - number of pixels + * dstType - destination datatype + * dest - destination array + * srcType - source pixel type + * source - source data pointer + * unpacking - pixel unpacking parameters + * applyTransferOps - apply offset/bias/lookup ops? + */ +void +_mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, + GLenum dstType, GLvoid *dest, + GLenum srcType, const GLvoid *source, + const struct gl_pixelstore_attrib *unpacking, + GLboolean applyTransferOps ) +{ + ASSERT(srcType == GL_BITMAP || + srcType == GL_UNSIGNED_BYTE || + srcType == GL_BYTE || + srcType == GL_UNSIGNED_SHORT || + srcType == GL_SHORT || + srcType == GL_UNSIGNED_INT || + srcType == GL_INT || + srcType == GL_FLOAT); + + ASSERT(dstType == GL_UNSIGNED_BYTE || + dstType == GL_UNSIGNED_SHORT || + dstType == GL_UNSIGNED_INT); + + applyTransferOps &= (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset || ctx->Pixel.MapColorFlag); + + /* + * Try simple cases first + */ + if (!applyTransferOps && srcType == GL_UNSIGNED_BYTE + && dstType == GL_UNSIGNED_BYTE) { + MEMCPY(dest, source, n * sizeof(GLubyte)); + } + else if (!applyTransferOps && srcType == GL_UNSIGNED_INT + && dstType == GL_UNSIGNED_INT && !unpacking->SwapBytes) { + MEMCPY(dest, source, n * sizeof(GLuint)); + } + else { + /* + * general solution + */ + GLuint indexes[MAX_WIDTH]; + assert(n <= MAX_WIDTH); + + extract_uint_indexes(n, indexes, GL_COLOR_INDEX, srcType, source, + unpacking); + + if (applyTransferOps) { + if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset) { + /* shift and offset indexes */ + gl_shift_and_offset_ci(ctx, n, indexes); + } + + if (ctx->Pixel.MapStencilFlag) { + /* Apply stencil lookup table */ + GLuint mask = ctx->Pixel.MapStoSsize - 1; + GLuint i; + for (i=0;iPixel.MapStoS[ indexes[i] & mask ]; + } + } + } + + /* convert to dest type */ + switch (dstType) { + case GL_UNSIGNED_BYTE: + { + GLubyte *dst = (GLubyte *) dest; + GLuint i; + for (i = 0; i < n; i++) { + dst[i] = (GLubyte) (indexes[i] & 0xff); + } + } + break; + case GL_UNSIGNED_SHORT: + { + GLuint *dst = (GLuint *) dest; + GLuint i; + for (i = 0; i < n; i++) { + dst[i] = (GLushort) (indexes[i] & 0xffff); + } + } + break; + case GL_UNSIGNED_INT: + MEMCPY(dest, indexes, n * sizeof(GLuint)); + break; + default: + gl_problem(ctx, "bad dstType in _mesa_unpack_stencil_span"); + } + } +} + + + +void +_mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLdepth *dest, + GLenum srcType, const GLvoid *source, + const struct gl_pixelstore_attrib *unpacking, + GLboolean applyTransferOps ) +{ + GLfloat *depth = MALLOC(n * sizeof(GLfloat)); + if (!depth) + return; + + switch (srcType) { + case GL_BYTE: + { + GLuint i; + const GLubyte *src = (const GLubyte *) source; + for (i = 0; i < n; i++) { + depth[i] = BYTE_TO_FLOAT(src[i]); + } + } + break; + case GL_UNSIGNED_BYTE: + { + GLuint i; + const GLubyte *src = (const GLubyte *) source; + for (i = 0; i < n; i++) { + depth[i] = UBYTE_TO_FLOAT(src[i]); + } + } + break; + case GL_SHORT: + { + GLuint i; + const GLshort *src = (const GLshort *) source; + for (i = 0; i < n; i++) { + depth[i] = SHORT_TO_FLOAT(src[i]); + } + } + break; + case GL_UNSIGNED_SHORT: + { + GLuint i; + const GLushort *src = (const GLushort *) source; + for (i = 0; i < n; i++) { + depth[i] = USHORT_TO_FLOAT(src[i]); + } + } + break; + case GL_INT: + { + GLuint i; + const GLint *src = (const GLint *) source; + for (i = 0; i < n; i++) { + depth[i] = INT_TO_FLOAT(src[i]); + } + } + break; + case GL_UNSIGNED_INT: + { + GLuint i; + const GLuint *src = (const GLuint *) source; + for (i = 0; i < n; i++) { + depth[i] = UINT_TO_FLOAT(src[i]); + } + } + break; + case GL_FLOAT: + MEMCPY(depth, source, n * sizeof(GLfloat)); + break; + default: + gl_problem(NULL, "bad type in _mesa_unpack_depth_span()"); + return; + } + + + /* apply depth scale and bias */ + if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) { + GLuint i; + for (i = 0; i < n; i++) { + depth[i] = depth[i] * ctx->Pixel.DepthScale + ctx->Pixel.DepthBias; + } + } + + /* clamp depth values to [0,1] and convert from floats to integers */ + { + GLuint i; + for (i = 0; i < n; i++) { + dest[i] = (GLdepth) (CLAMP(depth[i], 0.0F, 1.0F) * DEPTH_SCALE); + } + } + + FREE(depth); +} + + + /* * Unpack image data. Apply byteswapping, byte flipping (bitmap). * Return all image data in a contiguous block. @@ -3656,3 +2709,106 @@ _mesa_unpack_image( GLsizei width, GLsizei height, GLsizei depth, return destBuffer; } } + + +/* + * Unpack bitmap data. Resulting data will be in most-significant-bit-first + * order with row alignment = 1 byte. + */ +GLvoid * +_mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels, + const struct gl_pixelstore_attrib *packing ) +{ + GLint bytes, row, width_in_bytes; + GLubyte *buffer, *dst; + + if (!pixels) + return NULL; + + /* Alloc dest storage */ + bytes = ((width + 7) / 8 * height); + buffer = (GLubyte *) MALLOC( bytes ); + if (!buffer) + return NULL; + + + width_in_bytes = CEILING( width, 8 ); + dst = buffer; + for (row = 0; row < height; row++) { + GLubyte *src = gl_pixel_addr_in_image( packing, pixels, width, height, + GL_COLOR_INDEX, GL_BITMAP, + 0, row, 0 ); + if (!src) { + FREE(buffer); + return NULL; + } + + if (packing->SkipPixels == 0) { + MEMCPY( dst, src, width_in_bytes ); + if (packing->LsbFirst) { + gl_flip_bytes( dst, width_in_bytes ); + } + } + else { + /* handling SkipPixels is a bit tricky (no pun intended!) */ + GLint i; + if (packing->LsbFirst) { + GLubyte srcMask = 1 << (packing->SkipPixels & 0x7); + GLubyte dstMask = 128; + GLubyte *s = src; + GLubyte *d = dst; + *d = 0; + for (i = 0; i < width; i++) { + if (*s & srcMask) { + *d |= dstMask; + } + if (srcMask == 128) { + srcMask = 1; + s++; + } + else { + srcMask = srcMask << 1; + } + if (dstMask == 1) { + dstMask = 128; + d++; + *d = 0; + } + else { + dstMask = dstMask >> 1; + } + } + } + else { + GLubyte srcMask = 128 >> (packing->SkipPixels & 0x7); + GLubyte dstMask = 128; + GLubyte *s = src; + GLubyte *d = dst; + *d = 0; + for (i = 0; i < width; i++) { + if (*s & srcMask) { + *d |= dstMask; + } + if (srcMask == 1) { + srcMask = 128; + s++; + } + else { + srcMask = srcMask >> 1; + } + if (dstMask == 1) { + dstMask = 128; + d++; + *d = 0; + } + else { + dstMask = dstMask >> 1; + } + } + } + } + dst += width_in_bytes; + } + + return buffer; +} diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h index 80e5ea7c3fc..03651cc14a1 100644 --- a/src/mesa/main/image.h +++ b/src/mesa/main/image.h @@ -1,4 +1,4 @@ -/* $Id: image.h,v 1.2 1999/11/03 17:27:05 brianp Exp $ */ +/* $Id: image.h,v 1.3 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,9 +25,6 @@ */ - - - #ifndef IMAGE_H #define IMAGE_H @@ -35,6 +32,9 @@ #include "types.h" +extern struct gl_pixelstore_attrib _mesa_native_packing; + + extern void gl_flip_bytes( GLubyte *p, GLuint n ); @@ -61,33 +61,16 @@ gl_pixel_addr_in_image( const struct gl_pixelstore_attrib *packing, GLint img, GLint row, GLint column ); -extern struct gl_image * -gl_unpack_bitmap( GLcontext *ctx, GLsizei width, GLsizei height, - const GLubyte *bitmap, - const struct gl_pixelstore_attrib *packing ); - - -extern void gl_unpack_polygon_stipple( const GLcontext *ctx, - const GLubyte *pattern, - GLuint dest[32] ); - - -extern void gl_pack_polygon_stipple( const GLcontext *ctx, - const GLuint pattern[32], - GLubyte *dest ); - - -extern struct gl_image * -gl_unpack_image( GLcontext *ctx, GLint width, GLint height, - GLenum srcFormat, GLenum srcType, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing ); - +extern void +gl_unpack_polygon_stipple( const GLcontext *ctx, + const GLubyte *pattern, + GLuint dest[32] ); -struct gl_image * -gl_unpack_image3D( GLcontext *ctx, GLint width, GLint height,GLint depth, - GLenum srcFormat, GLenum srcType, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing ); +extern void +gl_pack_polygon_stipple( const GLcontext *ctx, + const GLuint pattern[32], + GLubyte *dest ); extern void @@ -98,19 +81,6 @@ gl_pack_rgba_span( const GLcontext *ctx, GLboolean applyTransferOps ); -extern void gl_free_image( struct gl_image *image ); - - -extern GLboolean gl_image_error_test( GLcontext *ctx, - const struct gl_image *image, - const char *msg ); - - -/* - * New (3.3) functions - */ - - extern void _mesa_unpack_ubyte_color_span( const GLcontext *ctx, GLuint n, GLenum dstFormat, GLubyte dest[], @@ -127,10 +97,31 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n, const struct gl_pixelstore_attrib *unpacking, GLboolean applyTransferOps ); + +extern void +_mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, + GLenum dstType, GLvoid *dest, + GLenum srcType, const GLvoid *source, + const struct gl_pixelstore_attrib *unpacking, + GLboolean applyTransferOps ); + + +extern void +_mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLdepth *dest, + GLenum srcType, const GLvoid *source, + const struct gl_pixelstore_attrib *unpacking, + GLboolean applyTransferOps ); + + extern void * _mesa_unpack_image( GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *unpack ); +extern GLvoid * +_mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels, + const struct gl_pixelstore_attrib *packing ); + + #endif diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index e38e25ba822..f5a611dd140 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -1,8 +1,8 @@ -/* $Id: light.c,v 1.8 1999/11/10 06:29:44 keithw Exp $ */ +/* $Id: light.c,v 1.9 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,27 +25,16 @@ */ - - - #ifdef PC_HEADER #include "all.h" #else -#include -#ifndef XFree86Server -#include -#include -#include -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "enums.h" #include "light.h" #include "macros.h" #include "matrix.h" +#include "mem.h" #include "mmath.h" #include "simple_list.h" #include "types.h" @@ -55,46 +44,50 @@ -void gl_ShadeModel( GLcontext *ctx, GLenum mode ) +void +_mesa_ShadeModel( GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glShadeModel"); if (MESA_VERBOSE & VERBOSE_API) fprintf(stderr, "glShadeModel %s\n", gl_lookup_enum_by_nr(mode)); - - switch (mode) { - case GL_FLAT: - case GL_SMOOTH: + if (mode == GL_FLAT || mode == GL_SMOOTH) { if (ctx->Light.ShadeModel!=mode) { - ctx->Light.ShadeModel = mode; - ctx->TriangleCaps ^= DD_FLATSHADE; - ctx->NewState |= NEW_RASTER_OPS; + ctx->Light.ShadeModel = mode; + ctx->TriangleCaps ^= DD_FLATSHADE; + ctx->NewState |= NEW_RASTER_OPS; + if (ctx->Driver.ShadeModel) + (*ctx->Driver.ShadeModel)( ctx, mode ); } - break; - default: + } + else { gl_error( ctx, GL_INVALID_ENUM, "glShadeModel" ); } - - if (ctx->Driver.ShadeModel) - (*ctx->Driver.ShadeModel)( ctx, mode ); } -void gl_Lightfv( GLcontext *ctx, - GLenum light, GLenum pname, const GLfloat *params, - GLint nparams ) +void +_mesa_Lightf( GLenum light, GLenum pname, GLfloat param ) { - GLint l; + _mesa_Lightfv( light, pname, ¶m ); +} - (void) nparams; + +void +_mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) +{ + GET_CURRENT_CONTEXT(ctx); + GLint l; + GLint nParams; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLight"); l = (GLint) (light - GL_LIGHT0); - if (l<0 || l>=MAX_LIGHTS) { + if (l < 0 || l >= MAX_LIGHTS) { gl_error( ctx, GL_INVALID_ENUM, "glLight" ); return; } @@ -102,18 +95,22 @@ void gl_Lightfv( GLcontext *ctx, switch (pname) { case GL_AMBIENT: COPY_4V( ctx->Light.Light[l].Ambient, params ); + nParams = 4; break; case GL_DIFFUSE: COPY_4V( ctx->Light.Light[l].Diffuse, params ); + nParams = 4; break; case GL_SPECULAR: COPY_4V( ctx->Light.Light[l].Specular, params ); + nParams = 4; break; case GL_POSITION: /* transform position by ModelView matrix */ TRANSFORM_POINT( ctx->Light.Light[l].EyePosition, ctx->ModelView.m, params ); + nParams = 4; break; case GL_SPOT_DIRECTION: /* transform direction by inverse modelview */ @@ -123,6 +120,7 @@ void gl_Lightfv( GLcontext *ctx, TRANSFORM_NORMAL( ctx->Light.Light[l].EyeDirection, params, ctx->ModelView.inv ); + nParams = 3; break; case GL_SPOT_EXPONENT: if (params[0]<0.0 || params[0]>128.0) { @@ -133,6 +131,7 @@ void gl_Lightfv( GLcontext *ctx, ctx->Light.Light[l].SpotExponent = params[0]; gl_compute_spot_exp_table( &ctx->Light.Light[l] ); } + nParams = 1; break; case GL_SPOT_CUTOFF: if ((params[0]<0.0 || params[0]>90.0) && params[0]!=180.0) { @@ -143,6 +142,7 @@ void gl_Lightfv( GLcontext *ctx, ctx->Light.Light[l].CosCutoff = cos(params[0]*DEG2RAD); if (ctx->Light.Light[l].CosCutoff < 0) ctx->Light.Light[l].CosCutoff = 0; + nParams = 1; break; case GL_CONSTANT_ATTENUATION: if (params[0]<0.0) { @@ -150,6 +150,7 @@ void gl_Lightfv( GLcontext *ctx, return; } ctx->Light.Light[l].ConstantAttenuation = params[0]; + nParams = 1; break; case GL_LINEAR_ATTENUATION: if (params[0]<0.0) { @@ -157,6 +158,7 @@ void gl_Lightfv( GLcontext *ctx, return; } ctx->Light.Light[l].LinearAttenuation = params[0]; + nParams = 1; break; case GL_QUADRATIC_ATTENUATION: if (params[0]<0.0) { @@ -164,23 +166,73 @@ void gl_Lightfv( GLcontext *ctx, return; } ctx->Light.Light[l].QuadraticAttenuation = params[0]; + nParams = 1; break; default: gl_error( ctx, GL_INVALID_ENUM, "glLight" ); - break; + return; } if (ctx->Driver.Lightfv) - ctx->Driver.Lightfv( ctx, light, pname, params, nparams ); + ctx->Driver.Lightfv( ctx, light, pname, params, nParams ); ctx->NewState |= NEW_LIGHTING; } +void +_mesa_Lighti( GLenum light, GLenum pname, GLint param ) +{ + _mesa_Lightiv( light, pname, ¶m ); +} + -void gl_GetLightfv( GLcontext *ctx, - GLenum light, GLenum pname, GLfloat *params ) +void +_mesa_Lightiv( GLenum light, GLenum pname, const GLint *params ) { + GLfloat fparam[4]; + + switch (pname) { + case GL_AMBIENT: + case GL_DIFFUSE: + case GL_SPECULAR: + fparam[0] = INT_TO_FLOAT( params[0] ); + fparam[1] = INT_TO_FLOAT( params[1] ); + fparam[2] = INT_TO_FLOAT( params[2] ); + fparam[3] = INT_TO_FLOAT( params[3] ); + break; + case GL_POSITION: + fparam[0] = (GLfloat) params[0]; + fparam[1] = (GLfloat) params[1]; + fparam[2] = (GLfloat) params[2]; + fparam[3] = (GLfloat) params[3]; + break; + case GL_SPOT_DIRECTION: + fparam[0] = (GLfloat) params[0]; + fparam[1] = (GLfloat) params[1]; + fparam[2] = (GLfloat) params[2]; + break; + case GL_SPOT_EXPONENT: + case GL_SPOT_CUTOFF: + case GL_CONSTANT_ATTENUATION: + case GL_LINEAR_ATTENUATION: + case GL_QUADRATIC_ATTENUATION: + fparam[0] = (GLfloat) params[0]; + break; + default: + /* error will be caught later in gl_Lightfv */ + ; + } + + _mesa_Lightfv( light, pname, fparam ); +} + + + +void +_mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params ) +{ + GET_CURRENT_CONTEXT(ctx); GLint l = (GLint) (light - GL_LIGHT0); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetLight"); @@ -229,8 +281,10 @@ void gl_GetLightfv( GLcontext *ctx, -void gl_GetLightiv( GLcontext *ctx, GLenum light, GLenum pname, GLint *params ) +void +_mesa_GetLightiv( GLenum light, GLenum pname, GLint *params ) { + GET_CURRENT_CONTEXT(ctx); GLint l = (GLint) (light - GL_LIGHT0); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetLight"); @@ -298,9 +352,11 @@ void gl_GetLightiv( GLcontext *ctx, GLenum light, GLenum pname, GLint *params ) /**********************************************************************/ -void gl_LightModelfv( GLcontext *ctx, GLenum pname, const GLfloat *params ) +void +_mesa_LightModelfv( GLenum pname, const GLfloat *params ) { - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLightModel"); + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLightModelfv"); switch (pname) { case GL_LIGHT_MODEL_AMBIENT: @@ -344,6 +400,46 @@ void gl_LightModelfv( GLcontext *ctx, GLenum pname, const GLfloat *params ) } +void +_mesa_LightModeliv( GLenum pname, const GLint *params ) +{ + GLfloat fparam[4]; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLightModeliv"); + + switch (pname) { + case GL_LIGHT_MODEL_AMBIENT: + fparam[0] = INT_TO_FLOAT( params[0] ); + fparam[1] = INT_TO_FLOAT( params[1] ); + fparam[2] = INT_TO_FLOAT( params[2] ); + fparam[3] = INT_TO_FLOAT( params[3] ); + break; + case GL_LIGHT_MODEL_LOCAL_VIEWER: + case GL_LIGHT_MODEL_TWO_SIDE: + case GL_LIGHT_MODEL_COLOR_CONTROL: + fparam[0] = (GLfloat) params[0]; + break; + default: + /* Error will be caught later in gl_LightModelfv */ + ; + } + _mesa_LightModelfv( pname, fparam ); +} + + +void +_mesa_LightModeli( GLenum pname, GLint param ) +{ + _mesa_LightModeliv( pname, ¶m ); +} + + +void +_mesa_LightModelf( GLenum pname, GLfloat param ) +{ + _mesa_LightModelfv( pname, ¶m ); +} + /********** MATERIAL **********/ @@ -569,11 +665,11 @@ void gl_update_color_material( GLcontext *ctx, GLfloat tmp[4], color[4]; UBYTE_RGBA_TO_FLOAT_RGBA( color, rgba ); - + if (MESA_VERBOSE&VERBOSE_IMMEDIATE) fprintf(stderr, "gl_update_color_material, mask %x\n", bitmask); - + if (bitmask & FRONT_AMBIENT_BIT) { struct gl_material *mat = &ctx->Light.Material[0]; SUB_3V( tmp, color, mat->Ambient ); @@ -676,8 +772,10 @@ void gl_update_color_material( GLcontext *ctx, -void gl_ColorMaterial( GLcontext *ctx, GLenum face, GLenum mode ) +void +_mesa_ColorMaterial( GLenum face, GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); GLuint bitmask; GLuint legal = (FRONT_EMISSION_BIT | BACK_EMISSION_BIT | FRONT_SPECULAR_BIT | BACK_SPECULAR_BIT | @@ -705,12 +803,21 @@ void gl_ColorMaterial( GLcontext *ctx, GLenum face, GLenum mode ) + +void +_mesa_Materialf( GLenum face, GLenum pname, GLfloat param ) +{ + _mesa_Materialfv( face, pname, ¶m ); +} + + /* KW: This is now called directly (ie by name) from the glMaterial* * API functions. */ -void gl_Materialfv( GLcontext *ctx, - GLenum face, GLenum pname, const GLfloat *params ) +void +_mesa_Materialfv( GLenum face, GLenum pname, const GLfloat *params ) { + GET_CURRENT_CONTEXT(ctx); struct immediate *IM; struct gl_material *mat; GLuint bitmask; @@ -736,6 +843,7 @@ void gl_Materialfv( GLcontext *ctx, IM->MaterialMask[count] = 0; } + IM->MaterialMask[count] |= bitmask; mat = IM->Material[count]; @@ -784,11 +892,48 @@ void gl_Materialfv( GLcontext *ctx, } +void +_mesa_Materiali(GLenum face, GLenum pname, GLint param ) +{ + _mesa_Materialiv(face, pname, ¶m); +} + + +void +_mesa_Materialiv(GLenum face, GLenum pname, const GLint *params ) +{ + GLfloat fparam[4]; + switch (pname) { + case GL_AMBIENT: + case GL_DIFFUSE: + case GL_SPECULAR: + case GL_EMISSION: + case GL_AMBIENT_AND_DIFFUSE: + fparam[0] = INT_TO_FLOAT( params[0] ); + fparam[1] = INT_TO_FLOAT( params[1] ); + fparam[2] = INT_TO_FLOAT( params[2] ); + fparam[3] = INT_TO_FLOAT( params[3] ); + break; + case GL_SHININESS: + fparam[0] = (GLfloat) params[0]; + break; + case GL_COLOR_INDEXES: + fparam[0] = (GLfloat) params[0]; + fparam[1] = (GLfloat) params[1]; + fparam[2] = (GLfloat) params[2]; + break; + default: + /* Error will be caught later in gl_Materialfv */ + ; + } + _mesa_Materialfv(face, pname, fparam); +} -void gl_GetMaterialfv( GLcontext *ctx, - GLenum face, GLenum pname, GLfloat *params ) +void +_mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params ) { + GET_CURRENT_CONTEXT(ctx); GLuint f; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetMaterialfv"); @@ -831,9 +976,10 @@ void gl_GetMaterialfv( GLcontext *ctx, -void gl_GetMaterialiv( GLcontext *ctx, - GLenum face, GLenum pname, GLint *params ) +void +_mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params ) { + GET_CURRENT_CONTEXT(ctx); GLuint f; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetMaterialiv"); diff --git a/src/mesa/main/light.h b/src/mesa/main/light.h index 18d25e9828f..fc1ed0be673 100644 --- a/src/mesa/main/light.h +++ b/src/mesa/main/light.h @@ -1,8 +1,8 @@ -/* $Id: light.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: light.h,v 1.2 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,9 +25,6 @@ */ - - - #ifndef LIGHT_H #define LIGHT_H @@ -42,44 +39,69 @@ struct gl_shine_tab { }; -extern void gl_ShadeModel( GLcontext *ctx, GLenum mode ); +extern void +_mesa_ShadeModel( GLenum mode ); -extern void gl_ColorMaterial( GLcontext *ctx, GLenum face, GLenum mode ); +extern void +_mesa_ColorMaterial( GLenum face, GLenum mode ); -extern void gl_Lightfv( GLcontext *ctx, - GLenum light, GLenum pname, const GLfloat *params, - GLint nparams ); +extern void +_mesa_Lightf( GLenum light, GLenum pname, GLfloat param ); -extern void gl_LightModelfv( GLcontext *ctx, - GLenum pname, const GLfloat *params ); +extern void +_mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ); +extern void +_mesa_Lightiv( GLenum light, GLenum pname, const GLint *params ); -extern GLuint gl_material_bitmask( GLcontext *ctx, - GLenum face, GLenum pname, - GLuint legal, - const char * ); +extern void +_mesa_Lighti( GLenum light, GLenum pname, GLint param ); -extern void gl_set_material( GLcontext *ctx, GLuint bitmask, - const GLfloat *params); +extern void +_mesa_LightModelf( GLenum pname, GLfloat param ); + +extern void +_mesa_LightModelfv( GLenum pname, const GLfloat *params ); + +extern void +_mesa_LightModeli( GLenum pname, GLint param ); -extern void gl_Materialfv( GLcontext *ctx, - GLenum face, GLenum pname, const GLfloat *params ); +extern void +_mesa_LightModeliv( GLenum pname, const GLint *params ); +extern void +_mesa_Materialf( GLenum face, GLenum pname, GLfloat param ); +extern void +_mesa_Materialfv( GLenum face, GLenum pname, const GLfloat *params ); -extern void gl_GetLightfv( GLcontext *ctx, - GLenum light, GLenum pname, GLfloat *params ); +extern void +_mesa_Materiali( GLenum face, GLenum pname, GLint param ); -extern void gl_GetLightiv( GLcontext *ctx, - GLenum light, GLenum pname, GLint *params ); +extern void +_mesa_Materialiv( GLenum face, GLenum pname, const GLint *params ); +extern void +_mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params ); -extern void gl_GetMaterialfv( GLcontext *ctx, - GLenum face, GLenum pname, GLfloat *params ); +extern void +_mesa_GetLightiv( GLenum light, GLenum pname, GLint *params ); -extern void gl_GetMaterialiv( GLcontext *ctx, - GLenum face, GLenum pname, GLint *params ); +extern void +_mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params ); +extern void +_mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params ); + + + +extern GLuint gl_material_bitmask( GLcontext *ctx, + GLenum face, GLenum pname, + GLuint legal, + const char * ); + +extern void gl_set_material( GLcontext *ctx, GLuint bitmask, + const GLfloat *params); extern void gl_compute_spot_exp_table( struct gl_light *l ); diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c index ee3ab24ca98..199686f60f3 100644 --- a/src/mesa/main/lines.c +++ b/src/mesa/main/lines.c @@ -1,8 +1,8 @@ -/* $Id: lines.c,v 1.5 1999/11/08 14:36:32 brianp Exp $ */ +/* $Id: lines.c,v 1.6 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,17 +25,10 @@ */ - - - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "depth.h" #include "feedback.h" @@ -50,8 +43,10 @@ -void gl_LineWidth( GLcontext *ctx, GLfloat width ) +void +_mesa_LineWidth( GLfloat width ) { + GET_CURRENT_CONTEXT(ctx); if (width<=0.0) { gl_error( ctx, GL_INVALID_VALUE, "glLineWidth" ); return; @@ -68,8 +63,10 @@ void gl_LineWidth( GLcontext *ctx, GLfloat width ) -void gl_LineStipple( GLcontext *ctx, GLint factor, GLushort pattern ) +void +_mesa_LineStipple( GLint factor, GLushort pattern ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLineStipple"); ctx->Line.StippleFactor = CLAMP( factor, 1, 256 ); ctx->Line.StipplePattern = pattern; diff --git a/src/mesa/main/lines.h b/src/mesa/main/lines.h index f85a7a49103..36a6bed1f75 100644 --- a/src/mesa/main/lines.h +++ b/src/mesa/main/lines.h @@ -1,8 +1,8 @@ -/* $Id: lines.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: lines.h,v 1.2 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,9 +25,6 @@ */ - - - #ifndef LINES_H #define LINES_H @@ -35,11 +32,14 @@ #include "types.h" -extern void gl_LineWidth( GLcontext *ctx, GLfloat width ); +extern void +_mesa_LineWidth( GLfloat width ); -extern void gl_LineStipple( GLcontext *ctx, GLint factor, GLushort pattern ); +extern void +_mesa_LineStipple( GLint factor, GLushort pattern ); -extern void gl_set_line_function( GLcontext *ctx ); +extern void +gl_set_line_function( GLcontext *ctx ); #endif diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index bba09837215..9e7b8194396 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -1,8 +1,8 @@ -/* $Id: macros.h,v 1.6 1999/11/08 15:29:43 brianp Exp $ */ +/* $Id: macros.h,v 1.7 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,9 +25,6 @@ */ - - - /* * A collection of useful macros. */ @@ -36,13 +33,8 @@ #ifndef MACROS_H #define MACROS_H -#ifndef XFree86Server -#include -#include -#include -#else -#include -#endif + +#include "glheader.h" #ifdef DEBUG @@ -165,26 +157,26 @@ do { \ #define ACC_4V( DST, SRC ) \ do { \ - (DST)[0] += (SRC)[0]; \ - (DST)[1] += (SRC)[1]; \ - (DST)[2] += (SRC)[2]; \ - (DST)[3] += (SRC)[3]; \ + (DST)[0] += (SRC)[0]; \ + (DST)[1] += (SRC)[1]; \ + (DST)[2] += (SRC)[2]; \ + (DST)[3] += (SRC)[3]; \ } while (0) #define ACC_SCALE_4V( DST, SRCA, SRCB ) \ do { \ - (DST)[0] += (SRCA)[0] * (SRCB)[0]; \ - (DST)[1] += (SRCA)[1] * (SRCB)[1]; \ - (DST)[2] += (SRCA)[2] * (SRCB)[2]; \ - (DST)[3] += (SRCA)[3] * (SRCB)[3]; \ + (DST)[0] += (SRCA)[0] * (SRCB)[0]; \ + (DST)[1] += (SRCA)[1] * (SRCB)[1]; \ + (DST)[2] += (SRCA)[2] * (SRCB)[2]; \ + (DST)[3] += (SRCA)[3] * (SRCB)[3]; \ } while (0) #define ACC_SCALE_SCALAR_4V( DST, S, SRCB ) \ do { \ - (DST)[0] += S * (SRCB)[0]; \ - (DST)[1] += S * (SRCB)[1]; \ - (DST)[2] += S * (SRCB)[2]; \ - (DST)[3] += S * (SRCB)[3]; \ + (DST)[0] += S * (SRCB)[0]; \ + (DST)[1] += S * (SRCB)[1]; \ + (DST)[2] += S * (SRCB)[2]; \ + (DST)[3] += S * (SRCB)[3]; \ } while (0) #define SCALE_SCALAR_4V( DST, S, SRCB ) \ @@ -480,69 +472,6 @@ do { \ -/* - * Memory allocation - * XXX these should probably go into a new glmemory.h file. - */ -#ifdef DEBUG -extern void *gl_malloc(size_t bytes); -extern void *gl_calloc(size_t bytes); -extern void gl_free(void *ptr); -#define MALLOC(BYTES) gl_malloc(BYTES) -#define CALLOC(BYTES) gl_calloc(BYTES) -#define MALLOC_STRUCT(T) (struct T *) gl_malloc(sizeof(struct T)) -#define CALLOC_STRUCT(T) (struct T *) gl_calloc(sizeof(struct T)) -#define FREE(PTR) gl_free(PTR) -#else -#define MALLOC(BYTES) (void *) malloc(BYTES) -#define CALLOC(BYTES) (void *) calloc(1, BYTES) -#define MALLOC_STRUCT(T) (struct T *) malloc(sizeof(struct T)) -#define CALLOC_STRUCT(T) (struct T *) calloc(1,sizeof(struct T)) -#define FREE(PTR) free(PTR) -#endif - - -/* Memory copy: */ -#ifdef SUNOS4 -#define MEMCPY( DST, SRC, BYTES) \ - memcpy( (char *) (DST), (char *) (SRC), (int) (BYTES) ) -#else -#define MEMCPY( DST, SRC, BYTES) \ - memcpy( (void *) (DST), (void *) (SRC), (size_t) (BYTES) ) -#endif - - -/* Memory set: */ -#ifdef SUNOS4 -#define MEMSET( DST, VAL, N ) \ - memset( (char *) (DST), (int) (VAL), (int) (N) ) -#else -#define MEMSET( DST, VAL, N ) \ - memset( (void *) (DST), (int) (VAL), (size_t) (N) ) -#endif - - -/* MACs and BeOS don't support static larger than 32kb, so... */ -#if defined(macintosh) && !defined(__MRC__) - extern char *AGLAlloc(int size); - extern void AGLFree(char* ptr); -# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)AGLAlloc(sizeof(TYPE)*(SIZE)) -# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])AGLAlloc(sizeof(TYPE)*(SIZE1)*(SIZE2)) -# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0) -# define UNDEFARRAY(NAME) do {if ((NAME)) {AGLFree((char*)NAME);} }while (0) -#elif defined(__BEOS__) -# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)malloc(sizeof(TYPE)*(SIZE)) -# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])malloc(sizeof(TYPE)*(SIZE1)*(SIZE2)) -# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0) -# define UNDEFARRAY(NAME) do {if ((NAME)) {free((char*)NAME);} }while (0) -#else -# define DEFARRAY(TYPE,NAME,SIZE) TYPE NAME[SIZE] -# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE NAME[SIZE1][SIZE2] -# define CHECKARRAY(NAME,CMD) do {} while(0) -# define UNDEFARRAY(NAME) -#endif - - /* Some compilers don't like some of Mesa's const usage */ #ifdef NO_CONST # define CONST diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index fea77709a9f..16f30be1f04 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -1,8 +1,8 @@ -/* $Id: matrix.c,v 1.8 1999/11/08 07:36:44 brianp Exp $ */ +/* $Id: matrix.c,v 1.9 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,9 +25,6 @@ */ - - - /* * Matrix operations * @@ -43,18 +40,11 @@ #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "enums.h" -#include "macros.h" #include "matrix.h" +#include "mem.h" #include "mmath.h" #include "types.h" #endif @@ -902,11 +892,12 @@ do { \ } while (0) -void gl_Frustum( GLcontext *ctx, - GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble nearval, GLdouble farval ) +void +_mesa_Frustum( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble nearval, GLdouble farval ) { + GET_CURRENT_CONTEXT(ctx); GLfloat x, y, a, b, c, d; GLfloat m[16]; GLmatrix *mat = 0; @@ -952,11 +943,12 @@ void gl_Frustum( GLcontext *ctx, } -void gl_Ortho( GLcontext *ctx, - GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble nearval, GLdouble farval ) +void +_mesa_Ortho( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble nearval, GLdouble farval ) { + GET_CURRENT_CONTEXT(ctx); GLfloat x, y, z; GLfloat tx, ty, tz; GLfloat m[16]; @@ -991,8 +983,10 @@ void gl_Ortho( GLcontext *ctx, } -void gl_MatrixMode( GLcontext *ctx, GLenum mode ) +void +_mesa_MatrixMode( GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glMatrixMode"); switch (mode) { case GL_MODELVIEW: @@ -1007,8 +1001,10 @@ void gl_MatrixMode( GLcontext *ctx, GLenum mode ) -void gl_PushMatrix( GLcontext *ctx ) +void +_mesa_PushMatrix( void ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPushMatrix"); if (MESA_VERBOSE&VERBOSE_API) @@ -1056,8 +1052,10 @@ void gl_PushMatrix( GLcontext *ctx ) -void gl_PopMatrix( GLcontext *ctx ) +void +_mesa_PopMatrix( void ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPopMatrix"); if (MESA_VERBOSE&VERBOSE_API) @@ -1111,8 +1109,10 @@ void gl_PopMatrix( GLcontext *ctx ) -void gl_LoadIdentity( GLcontext *ctx ) +void +_mesa_LoadIdentity( void ) { + GET_CURRENT_CONTEXT(ctx); GLmatrix *mat = 0; GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glLoadIdentity"); @@ -1131,8 +1131,10 @@ void gl_LoadIdentity( GLcontext *ctx ) } -void gl_LoadMatrixf( GLcontext *ctx, const GLfloat *m ) +void +_mesa_LoadMatrixf( const GLfloat *m ) { + GET_CURRENT_CONTEXT(ctx); GLmatrix *mat = 0; GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glLoadMatrix"); @@ -1162,12 +1164,25 @@ void gl_LoadMatrixf( GLcontext *ctx, const GLfloat *m ) } +void +_mesa_LoadMatrixd( const GLdouble *m ) +{ + GLfloat f[16]; + GLint i; + for (i = 0; i < 16; i++) + f[i] = m[i]; + _mesa_LoadMatrixf(f); +} + + /* * Multiply the active matrix by an arbitary matrix. */ -void gl_MultMatrixf( GLcontext *ctx, const GLfloat *m ) +void +_mesa_MultMatrixf( const GLfloat *m ) { + GET_CURRENT_CONTEXT(ctx); GLmatrix *mat = 0; GET_ACTIVE_MATRIX( ctx, mat, ctx->NewState, "glMultMatrix" ); matmul4( mat->m, mat->m, m ); @@ -1178,8 +1193,10 @@ void gl_MultMatrixf( GLcontext *ctx, const GLfloat *m ) /* * Multiply the active matrix by an arbitary matrix. */ -void gl_MultMatrixd( GLcontext *ctx, const GLdouble *m ) +void +_mesa_MultMatrixd( const GLdouble *m ) { + GET_CURRENT_CONTEXT(ctx); GLmatrix *mat = 0; GET_ACTIVE_MATRIX( ctx, mat, ctx->NewState, "glMultMatrix" ); matmul4fd( mat->m, mat->m, m ); @@ -1227,9 +1244,10 @@ void gl_mat_mul_mat( GLmatrix *mat, const GLmatrix *m ) /* * Execute a glRotate call */ -void gl_Rotatef( GLcontext *ctx, - GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) +void +_mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) { + GET_CURRENT_CONTEXT(ctx); GLfloat m[16]; if (angle != 0.0F) { GLmatrix *mat = 0; @@ -1240,11 +1258,20 @@ void gl_Rotatef( GLcontext *ctx, } } +void +_mesa_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ) +{ + _mesa_Rotatef(angle, x, y, z); +} + + /* * Execute a glScale call */ -void gl_Scalef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ) +void +_mesa_Scalef( GLfloat x, GLfloat y, GLfloat z ) { + GET_CURRENT_CONTEXT(ctx); GLmatrix *mat = 0; GLfloat *m; GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glScale"); @@ -1265,11 +1292,21 @@ void gl_Scalef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ) MAT_DIRTY_DEPENDENTS); } + +void +_mesa_Scaled( GLdouble x, GLdouble y, GLdouble z ) +{ + _mesa_Scalef(x, y, z); +} + + /* * Execute a glTranslate call */ -void gl_Translatef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ) +void +_mesa_Translatef( GLfloat x, GLfloat y, GLfloat z ) { + GET_CURRENT_CONTEXT(ctx); GLmatrix *mat = 0; GLfloat *m; GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glTranslate"); @@ -1286,13 +1323,22 @@ void gl_Translatef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ) } +void +_mesa_Translated( GLdouble x, GLdouble y, GLdouble z ) +{ + _mesa_Translatef(x, y, z); +} + + + /* * Define a new viewport and reallocate auxillary buffers if the size of * the window (color buffer) has changed. */ -void gl_Viewport( GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height ) +void +_mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glViewport"); if (width<0 || height<0) { @@ -1330,7 +1376,7 @@ void gl_Viewport( GLcontext *ctx, /* Check if window/buffer has been resized and if so, reallocate the * ancillary buffers. */ - gl_ResizeBuffersMESA(ctx); + _mesa_ResizeBuffersMESA(); ctx->RasterMask &= ~WINCLIP_BIT; @@ -1350,7 +1396,8 @@ void gl_Viewport( GLcontext *ctx, -void gl_DepthRange( GLcontext *ctx, GLclampd nearval, GLclampd farval ) +void +_mesa_DepthRange( GLclampd nearval, GLclampd farval ) { /* * nearval - specifies mapping of the near clipping plane to window @@ -1364,7 +1411,7 @@ void gl_DepthRange( GLcontext *ctx, GLclampd nearval, GLclampd farval ) * this range to window z coords. */ GLfloat n, f; - + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDepthRange"); if (MESA_VERBOSE&VERBOSE_API) diff --git a/src/mesa/main/matrix.h b/src/mesa/main/matrix.h index fcc630f62a6..24796687990 100644 --- a/src/mesa/main/matrix.h +++ b/src/mesa/main/matrix.h @@ -1,8 +1,8 @@ -/* $Id: matrix.h,v 1.2 1999/10/08 09:27:11 keithw Exp $ */ +/* $Id: matrix.h,v 1.3 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,16 +25,14 @@ */ - - - #ifndef MATRIX_H #define MATRIX_H -#include "GL/gl.h" +#include "types.h" #include "config.h" + typedef struct { GLfloat m[16]; GLfloat *inv; /* optional */ @@ -42,6 +40,7 @@ typedef struct { GLuint type; } GLmatrix; + #ifdef VMS #define gl_calculate_model_project_matrix gl_calculate_model_project_matr #endif @@ -51,69 +50,90 @@ extern void gl_rotation_matrix( GLfloat angle, GLfloat x, GLfloat y, GLfloat z, GLfloat m[] ); +extern void gl_mat_mul_floats( GLmatrix *mat, const GLfloat *m, GLuint flags ); -extern void gl_Frustum( GLcontext *ctx, - GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble nearval, GLdouble farval ); +extern void gl_mat_mul_mat( GLmatrix *mat, const GLmatrix *mat2 ); -extern void gl_Ortho( GLcontext *ctx, - GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble nearval, GLdouble farval ); +extern void gl_calculate_model_project_matrix( GLcontext *ctx ); -extern void gl_PushMatrix( GLcontext *ctx ); +extern void gl_matrix_ctr( GLmatrix *m ); -extern void gl_PopMatrix( GLcontext *ctx ); +extern void gl_matrix_dtr( GLmatrix *m ); -extern void gl_LoadIdentity( GLcontext *ctx ); +extern void gl_matrix_alloc_inv( GLmatrix *m ); -extern void gl_LoadMatrixf( GLcontext *ctx, const GLfloat *m ); +extern void gl_matrix_copy( GLmatrix *to, const GLmatrix *from ); -extern void gl_MatrixMode( GLcontext *ctx, GLenum mode ); +extern void gl_matrix_mul( GLmatrix *dest, + const GLmatrix *a, + const GLmatrix *b ); -extern void gl_MultMatrixf( GLcontext *ctx, const GLfloat *m ); +extern void gl_matrix_analyze( GLmatrix *mat ); -extern void gl_mat_mul_floats( GLmatrix *mat, const GLfloat *m, GLuint flags ); -extern void gl_mat_mul_mat( GLmatrix *mat, const GLmatrix *mat2 ); +extern GLboolean gl_matrix_invert( GLmatrix *mat ); -extern void gl_Rotatef( GLcontext *ctx, - GLfloat angle, GLfloat x, GLfloat y, GLfloat z ); +extern void gl_print_matrix( const GLmatrix *m ); -extern void gl_Scalef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ); -extern void gl_Translatef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ); -extern void gl_Viewport( GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height ); +extern void +_mesa_Frustum( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble nearval, GLdouble farval ); -extern void gl_DepthRange( GLcontext* ctx, GLclampd nearval, GLclampd farval ); +extern void +_mesa_Ortho( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble nearval, GLdouble farval ); +extern void +_mesa_PushMatrix( void ); +extern void +_mesa_PopMatrix( void ); +extern void +_mesa_LoadIdentity( void ); +extern void +_mesa_LoadMatrixf( const GLfloat *m ); -extern void gl_calculate_model_project_matrix( GLcontext *ctx ); +extern void +_mesa_LoadMatrixd( const GLdouble *m ); +extern void +_mesa_MatrixMode( GLenum mode ); -extern void gl_matrix_ctr( GLmatrix *m ); +extern void +_mesa_MultMatrixf( const GLfloat *m ); -extern void gl_matrix_dtr( GLmatrix *m ); +extern void +_mesa_MultMatrixd( const GLdouble *m ); -extern void gl_matrix_alloc_inv( GLmatrix *m ); +extern void +_mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ); -extern void gl_matrix_copy( GLmatrix *to, const GLmatrix *from ); +extern void +_mesa_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ); -extern void gl_matrix_mul( GLmatrix *dest, - const GLmatrix *a, - const GLmatrix *b ); +extern void +_mesa_Scalef( GLfloat x, GLfloat y, GLfloat z ); -extern void gl_matrix_analyze( GLmatrix *mat ); +extern void +_mesa_Scaled( GLdouble x, GLdouble y, GLdouble z ); +extern void +_mesa_Translatef( GLfloat x, GLfloat y, GLfloat z ); + +extern void +_mesa_Translated( GLdouble x, GLdouble y, GLdouble z ); + +extern void +_mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height ); + +extern void +_mesa_DepthRange( GLclampd nearval, GLclampd farval ); -extern void gl_MultMatrixd( GLcontext *ctx, const GLdouble *m ); -extern GLboolean gl_matrix_invert( GLmatrix *mat ); -extern void gl_print_matrix( const GLmatrix *m ); #endif diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index 2bc95208038..1651fe1190c 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -1,8 +1,8 @@ -/* $Id: pixel.c,v 1.4 1999/11/08 07:36:44 brianp Exp $ */ +/* $Id: pixel.c,v 1.5 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,9 +25,6 @@ */ - - - /* * glPixelStore, glPixelTransfer, glPixelMap, glPixelZoom, etc. */ @@ -36,15 +33,10 @@ #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "macros.h" +#include "mem.h" #include "pixel.h" #include "types.h" #endif @@ -57,8 +49,10 @@ -void gl_PixelZoom( GLcontext *ctx, GLfloat xfactor, GLfloat yfactor ) +void +_mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPixelZoom"); ctx->Pixel.ZoomX = xfactor; @@ -72,13 +66,13 @@ void gl_PixelZoom( GLcontext *ctx, GLfloat xfactor, GLfloat yfactor ) /**********************************************************************/ -void gl_PixelStorei( GLcontext *ctx, GLenum pname, GLint param ) +void +_mesa_PixelStorei( GLenum pname, GLint param ) { /* NOTE: this call can't be compiled into the display list */ - + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPixelStore"); - switch (pname) { case GL_PACK_SWAP_BYTES: ctx->Pack.SwapBytes = param ? GL_TRUE : GL_FALSE; @@ -174,6 +168,11 @@ void gl_PixelStorei( GLcontext *ctx, GLenum pname, GLint param ) } +void +_mesa_PixelStoref( GLenum pname, GLfloat param ) +{ + _mesa_PixelStorei( pname, (GLint) param ); +} @@ -183,11 +182,11 @@ void gl_PixelStorei( GLcontext *ctx, GLenum pname, GLint param ) -void gl_PixelMapfv( GLcontext *ctx, - GLenum map, GLint mapsize, const GLfloat *values ) +void +_mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ) { GLint i; - + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPixelMapfv"); @@ -288,10 +287,50 @@ void gl_PixelMapfv( GLcontext *ctx, +void +_mesa_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values ) +{ + GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; + GLint i; + if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) { + for (i=0;i -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "feedback.h" #include "macros.h" @@ -45,18 +39,20 @@ #include "texstate.h" #include "types.h" #include "vb.h" -#include "mmath.h" #endif -void gl_PointSize( GLcontext *ctx, GLfloat size ) +void +_mesa_PointSize( GLfloat size ) { - if (size<=0.0) { + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPointSize"); + + if (size <= 0.0) { gl_error( ctx, GL_INVALID_VALUE, "glPointSize" ); return; } - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPointSize"); if (ctx->Point.Size != size) { ctx->Point.Size = size; @@ -68,11 +64,20 @@ void gl_PointSize( GLcontext *ctx, GLfloat size ) -void gl_PointParameterfvEXT( GLcontext *ctx, GLenum pname, - const GLfloat *params) +void +_mesa_PointParameterfEXT( GLenum pname, GLfloat param) { + _mesa_PointParameterfvEXT(pname, ¶m); +} + + +void +_mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params) +{ + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPointParameterfvEXT"); - if(pname==GL_DISTANCE_ATTENUATION_EXT) { + + if (pname == GL_DISTANCE_ATTENUATION_EXT) { GLboolean tmp = ctx->Point.Attenuated; COPY_3V(ctx->Point.Params,params); ctx->Point.Attenuated = (params[0] != 1.0 || @@ -84,25 +89,26 @@ void gl_PointParameterfvEXT( GLcontext *ctx, GLenum pname, ctx->TriangleCaps ^= DD_POINT_ATTEN; ctx->NewState |= NEW_RASTER_OPS; } - } else { - if (*params<0.0 ) { - gl_error( ctx, GL_INVALID_VALUE, "glPointParameterfvEXT" ); + } + else { + if (*params<0.0 ) { + gl_error( ctx, GL_INVALID_VALUE, "glPointParameterfvEXT" ); + return; + } + switch (pname) { + case GL_POINT_SIZE_MIN_EXT: + ctx->Point.MinSize=*params; + break; + case GL_POINT_SIZE_MAX_EXT: + ctx->Point.MaxSize=*params; + break; + case GL_POINT_FADE_THRESHOLD_SIZE_EXT: + ctx->Point.Threshold=*params; + break; + default: + gl_error( ctx, GL_INVALID_ENUM, "glPointParameterfvEXT" ); return; - } - switch (pname) { - case GL_POINT_SIZE_MIN_EXT: - ctx->Point.MinSize=*params; - break; - case GL_POINT_SIZE_MAX_EXT: - ctx->Point.MaxSize=*params; - break; - case GL_POINT_FADE_THRESHOLD_SIZE_EXT: - ctx->Point.Threshold=*params; - break; - default: - gl_error( ctx, GL_INVALID_ENUM, "glPointParameterfvEXT" ); - return; - } + } } ctx->NewState |= NEW_RASTER_OPS; } diff --git a/src/mesa/main/points.h b/src/mesa/main/points.h index a53ce9b2d22..b024ffbdf85 100644 --- a/src/mesa/main/points.h +++ b/src/mesa/main/points.h @@ -1,8 +1,8 @@ -/* $Id: points.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: points.h,v 1.2 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -35,11 +35,19 @@ #include "types.h" -extern void gl_PointSize( GLcontext *ctx, GLfloat size ); +extern void +_mesa_PointSize( GLfloat size ); + + +extern void +_mesa_PointParameterfEXT( GLenum pname, GLfloat param); + + +extern void +_mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params ); + extern void gl_set_point_function( GLcontext *ctx ); -extern void gl_PointParameterfvEXT( GLcontext *ctx, GLenum pname, - const GLfloat *params ); #endif diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c index eebbaa886fa..f93ab195665 100644 --- a/src/mesa/main/polygon.c +++ b/src/mesa/main/polygon.c @@ -1,8 +1,8 @@ -/* $Id: polygon.c,v 1.6 1999/11/08 15:28:08 brianp Exp $ */ +/* $Id: polygon.c,v 1.7 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,31 +25,25 @@ */ -/* $XFree86: xc/lib/GL/mesa/src/polygon.c,v 1.3 1999/04/04 00:20:29 dawes Exp $ */ - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "image.h" #include "enums.h" #include "macros.h" +#include "mem.h" #include "polygon.h" #include "types.h" #endif -void gl_CullFace( GLcontext *ctx, GLenum mode ) +void +_mesa_CullFace( GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCullFace"); if (MESA_VERBOSE&VERBOSE_API) @@ -69,8 +63,10 @@ void gl_CullFace( GLcontext *ctx, GLenum mode ) -void gl_FrontFace( GLcontext *ctx, GLenum mode ) +void +_mesa_FrontFace( GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glFrontFace"); if (MESA_VERBOSE&VERBOSE_API) @@ -91,8 +87,10 @@ void gl_FrontFace( GLcontext *ctx, GLenum mode ) -void gl_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode ) +void +_mesa_PolygonMode( GLenum face, GLenum mode ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonMode"); if (MESA_VERBOSE&VERBOSE_API) @@ -137,8 +135,11 @@ void gl_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode ) /* * NOTE: stipple pattern has already been unpacked. */ -void gl_PolygonStipple( GLcontext *ctx, const GLuint pattern[32] ) +void +_mesa_PolygonStipple( const GLubyte *mask ) { + GET_CURRENT_CONTEXT(ctx); + GLuint *pattern = (GLuint *) mask; /* XXX verify */ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonStipple"); if (MESA_VERBOSE&VERBOSE_API) @@ -153,8 +154,10 @@ void gl_PolygonStipple( GLcontext *ctx, const GLuint pattern[32] ) -void gl_GetPolygonStipple( GLcontext *ctx, GLubyte *dest ) +void +_mesa_GetPolygonStipple( GLubyte *dest ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonOffset"); if (MESA_VERBOSE&VERBOSE_API) @@ -165,9 +168,10 @@ void gl_GetPolygonStipple( GLcontext *ctx, GLubyte *dest ) -void gl_PolygonOffset( GLcontext *ctx, - GLfloat factor, GLfloat units ) +void +_mesa_PolygonOffset( GLfloat factor, GLfloat units ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonOffset"); if (MESA_VERBOSE&VERBOSE_API) @@ -177,3 +181,10 @@ void gl_PolygonOffset( GLcontext *ctx, ctx->Polygon.OffsetUnits = units; } + +void +_mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias ) +{ + _mesa_PolygonOffset(factor, bias * DEPTH_SCALE ); +} + diff --git a/src/mesa/main/polygon.h b/src/mesa/main/polygon.h index ac591bbda4b..71e17cf56a7 100644 --- a/src/mesa/main/polygon.h +++ b/src/mesa/main/polygon.h @@ -1,8 +1,8 @@ -/* $Id: polygon.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: polygon.h,v 1.2 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,9 +25,6 @@ */ - - - #ifndef POLYGON_H #define POLYGON_H @@ -35,18 +32,26 @@ #include "types.h" -extern void gl_CullFace( GLcontext *ctx, GLenum mode ); +extern void +_mesa_CullFace( GLenum mode ); + +extern void +_mesa_FrontFace( GLenum mode ); -extern void gl_FrontFace( GLcontext *ctx, GLenum mode ); +extern void +_mesa_PolygonMode( GLenum face, GLenum mode ); -extern void gl_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode ); +extern void +_mesa_PolygonOffset( GLfloat factor, GLfloat units ); -extern void gl_PolygonOffset( GLcontext *ctx, - GLfloat factor, GLfloat units ); +extern void +_mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias ); -extern void gl_PolygonStipple( GLcontext *ctx, const GLuint pattern[32] ); +extern void +_mesa_PolygonStipple( const GLubyte *mask ); -extern void gl_GetPolygonStipple( GLcontext *ctx, GLubyte *mask ); +extern void +_mesa_GetPolygonStipple( GLubyte *mask ); #endif diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index eeca646f2f0..160c9e3ed13 100644 --- a/src/mesa/main/rastpos.c +++ b/src/mesa/main/rastpos.c @@ -1,8 +1,8 @@ -/* $Id: rastpos.c,v 1.3 1999/11/08 15:28:08 brianp Exp $ */ +/* $Id: rastpos.c,v 1.4 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,18 +25,10 @@ */ - - - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "clip.h" #include "context.h" #include "feedback.h" @@ -54,8 +46,8 @@ /* * Caller: context->API.RasterPos4f */ -void gl_RasterPos4f( GLcontext *ctx, - GLfloat x, GLfloat y, GLfloat z, GLfloat w ) +static void raster_pos4f( GLcontext *ctx, + GLfloat x, GLfloat y, GLfloat z, GLfloat w ) { GLfloat v[4], eye[4], clip[4], ndc[3], d; @@ -161,69 +153,147 @@ void gl_RasterPos4f( GLcontext *ctx, -/* - * This is a MESA extension function. Pretty much just like glRasterPos - * except we don't apply the modelview or projection matrices; specify a - * window coordinate directly. - * Caller: context->API.WindowPos4fMESA pointer. - */ -void gl_windowpos( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) +void +_mesa_RasterPos2d(GLdouble x, GLdouble y) { - /* KW: Assume that like rasterpos, this must be outside begin/end. - */ - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "glWindowPosMESA" ); + _mesa_RasterPos4f(x, y, 0.0F, 1.0F); +} - /* set raster position */ - ctx->Current.RasterPos[0] = x; - ctx->Current.RasterPos[1] = y; - ctx->Current.RasterPos[2] = CLAMP( z, 0.0F, 1.0F ); - ctx->Current.RasterPos[3] = w; +void +_mesa_RasterPos2f(GLfloat x, GLfloat y) +{ + _mesa_RasterPos4f(x, y, 0.0F, 1.0F); +} - ctx->Current.RasterPosValid = GL_TRUE; +void +_mesa_RasterPos2i(GLint x, GLint y) +{ + _mesa_RasterPos4f(x, y, 0.0F, 1.0F); +} - /* raster color */ - if (0 && ctx->Light.Enabled) { - - /* KW: I don't see how this can work - would have to take the - * inverse of the projection matrix or the combined - * modelProjection matrix, transform point and normal, and - * do the lighting. Those inverses are not used for - * anything else. This is not an object-space lighting - * issue - what this is trying to do is something like - * clip-space or window-space lighting... - * - * Anyway, since the implementation was never correct, I'm - * not fixing it now - just use the unlit color. - */ - - /* KW: As a reprise, we now *do* keep the inverse of the projection - * matrix, so it is not infeasible to try to swim up stream - * in this manner. I still don't want to implement it, - * however. - */ - } - else { - /* use current color or index */ - if (ctx->Visual->RGBAflag) { - UBYTE_RGBA_TO_FLOAT_RGBA(ctx->Current.RasterColor, - ctx->Current.ByteColor); - } - else { - ctx->Current.RasterIndex = ctx->Current.Index; - } - } +void +_mesa_RasterPos2s(GLshort x, GLshort y) +{ + _mesa_RasterPos4f(x, y, 0.0F, 1.0F); +} - ctx->Current.RasterDistance = 0.0; +void +_mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z) +{ + _mesa_RasterPos4f(x, y, z, 1.0F); +} - { - GLuint texSet; - for (texSet=0; texSetCurrent.RasterMultiTexCoord[texSet], - ctx->Current.Texcoord[texSet] ); - } - } +void +_mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z) +{ + _mesa_RasterPos4f(x, y, z, 1.0F); +} - if (ctx->RenderMode==GL_SELECT) { - gl_update_hitflag( ctx, ctx->Current.RasterPos[2] ); - } +void +_mesa_RasterPos3i(GLint x, GLint y, GLint z) +{ + _mesa_RasterPos4f(x, y, z, 1.0F); +} + +void +_mesa_RasterPos3s(GLshort x, GLshort y, GLshort z) +{ + _mesa_RasterPos4f(x, y, z, 1.0F); +} + +void +_mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) +{ + _mesa_RasterPos4f(x, y, z, w); +} + +void +_mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) +{ + GET_CURRENT_CONTEXT(ctx); + raster_pos4f(ctx, x, y, z, w); +} + +void +_mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w) +{ + _mesa_RasterPos4f(x, y, z, w); +} + +void +_mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) +{ + _mesa_RasterPos4f(x, y, z, w); +} + +void +_mesa_RasterPos2dv(const GLdouble *v) +{ + _mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F); +} + +void +_mesa_RasterPos2fv(const GLfloat *v) +{ + _mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F); +} + +void +_mesa_RasterPos2iv(const GLint *v) +{ + _mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F); +} + +void +_mesa_RasterPos2sv(const GLshort *v) +{ + _mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F); +} + +void +_mesa_RasterPos3dv(const GLdouble *v) +{ + _mesa_RasterPos4f(v[0], v[1], v[2], 1.0F); +} + +void +_mesa_RasterPos3fv(const GLfloat *v) +{ + _mesa_RasterPos4f(v[0], v[1], v[2], 1.0F); +} + +void +_mesa_RasterPos3iv(const GLint *v) +{ + _mesa_RasterPos4f(v[0], v[1], v[2], 1.0F); +} + +void +_mesa_RasterPos3sv(const GLshort *v) +{ + _mesa_RasterPos4f(v[0], v[1], v[2], 1.0F); +} + +void +_mesa_RasterPos4dv(const GLdouble *v) +{ + _mesa_RasterPos4f(v[0], v[1], v[2], v[3]); +} + +void +_mesa_RasterPos4fv(const GLfloat *v) +{ + _mesa_RasterPos4f(v[0], v[1], v[2], v[3]); +} + +void +_mesa_RasterPos4iv(const GLint *v) +{ + _mesa_RasterPos4f(v[0], v[1], v[2], v[3]); +} + +void +_mesa_RasterPos4sv(const GLshort *v) +{ + _mesa_RasterPos4f(v[0], v[1], v[2], v[3]); } diff --git a/src/mesa/main/rastpos.h b/src/mesa/main/rastpos.h index 44dfbab0d62..49223ce236c 100644 --- a/src/mesa/main/rastpos.h +++ b/src/mesa/main/rastpos.h @@ -1,8 +1,8 @@ -/* $Id: rastpos.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: rastpos.h,v 1.2 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,23 +25,84 @@ */ +#ifndef RASTPOS_H +#define RASTPOS_H +#include "glheader.h" -#ifndef RASTPOS_H -#define RASTPOS_H +extern void +_mesa_RasterPos2d(GLdouble x, GLdouble y); + +extern void +_mesa_RasterPos2f(GLfloat x, GLfloat y); + +extern void +_mesa_RasterPos2i(GLint x, GLint y); + +extern void +_mesa_RasterPos2s(GLshort x, GLshort y); + +extern void +_mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z); + +extern void +_mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z); + +extern void +_mesa_RasterPos3i(GLint x, GLint y, GLint z); + +extern void +_mesa_RasterPos3s(GLshort x, GLshort y, GLshort z); + +extern void +_mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w); + +extern void +_mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w); + +extern void +_mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w); + +extern void +_mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w); + +extern void +_mesa_RasterPos2dv(const GLdouble *v); + +extern void +_mesa_RasterPos2fv(const GLfloat *v); + +extern void +_mesa_RasterPos2iv(const GLint *v); + +extern void +_mesa_RasterPos2sv(const GLshort *v); + +extern void +_mesa_RasterPos3dv(const GLdouble *v); + +extern void +_mesa_RasterPos3fv(const GLfloat *v); -#include "types.h" +extern void +_mesa_RasterPos3iv(const GLint *v); +extern void +_mesa_RasterPos3sv(const GLshort *v); -extern void gl_RasterPos4f( GLcontext *ctx, - GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +extern void +_mesa_RasterPos4dv(const GLdouble *v); +extern void +_mesa_RasterPos4fv(const GLfloat *v); -extern void gl_windowpos( GLcontext *ctx, - GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +extern void +_mesa_RasterPos4iv(const GLint *v); +extern void +_mesa_RasterPos4sv(const GLshort *v); #endif diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c index 4510d7f4fcf..0530700d827 100644 --- a/src/mesa/main/stencil.c +++ b/src/mesa/main/stencil.c @@ -1,8 +1,8 @@ -/* $Id: stencil.c,v 1.8 1999/11/08 15:28:08 brianp Exp $ */ +/* $Id: stencil.c,v 1.9 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,19 +25,12 @@ */ -/* $XFree86: xc/lib/GL/mesa/src/stencil.c,v 1.3 1999/04/04 00:20:32 dawes Exp $ */ - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" -#include "macros.h" +#include "mem.h" #include "pb.h" #include "stencil.h" #include "types.h" @@ -61,8 +54,10 @@ #define STENCIL_ADDRESS(X,Y) (ctx->Buffer->Stencil + ctx->Buffer->Width * (Y) + (X)) -void gl_ClearStencil( GLcontext *ctx, GLint s ) +void +_mesa_ClearStencil( GLint s ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClearStencil"); ctx->Stencil.Clear = (GLstencil) s; @@ -73,8 +68,10 @@ void gl_ClearStencil( GLcontext *ctx, GLint s ) -void gl_StencilFunc( GLcontext *ctx, GLenum func, GLint ref, GLuint mask ) +void +_mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) { + GET_CURRENT_CONTEXT(ctx); GLint maxref; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glStencilFunc"); @@ -106,8 +103,10 @@ void gl_StencilFunc( GLcontext *ctx, GLenum func, GLint ref, GLuint mask ) -void gl_StencilMask( GLcontext *ctx, GLuint mask ) +void +_mesa_StencilMask( GLuint mask ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glStencilMask"); ctx->Stencil.WriteMask = (GLstencil) mask; @@ -118,8 +117,10 @@ void gl_StencilMask( GLcontext *ctx, GLuint mask ) -void gl_StencilOp( GLcontext *ctx, GLenum fail, GLenum zfail, GLenum zpass ) +void +_mesa_StencilOp( GLenum fail, GLenum zfail, GLenum zpass ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glStencilOp"); switch (fail) { case GL_KEEP: @@ -1061,7 +1062,7 @@ void gl_alloc_stencil_buffer( GLcontext *ctx ) ctx->Buffer->Stencil = (GLstencil *) MALLOC(buffersize * sizeof(GLstencil)); if (!ctx->Buffer->Stencil) { /* out of memory */ - gl_set_enable( ctx, GL_STENCIL_TEST, GL_FALSE ); + _mesa_set_enable( ctx, GL_STENCIL_TEST, GL_FALSE ); gl_error( ctx, GL_OUT_OF_MEMORY, "gl_alloc_stencil_buffer" ); } } diff --git a/src/mesa/main/stencil.h b/src/mesa/main/stencil.h index 989cd988fe8..8d8cbda4bc2 100644 --- a/src/mesa/main/stencil.h +++ b/src/mesa/main/stencil.h @@ -1,8 +1,8 @@ -/* $Id: stencil.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: stencil.h,v 1.2 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,9 +25,6 @@ */ - - - #ifndef STENCIL_H #define STENCIL_H @@ -35,18 +32,20 @@ #include "types.h" -extern void gl_ClearStencil( GLcontext *ctx, GLint s ); +extern void +_mesa_ClearStencil( GLint s ); -extern void gl_StencilFunc( GLcontext *ctx, GLenum func, - GLint ref, GLuint mask ); +extern void +_mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ); -extern void gl_StencilMask( GLcontext *ctx, GLuint mask ); +extern void +_mesa_StencilMask( GLuint mask ); -extern void gl_StencilOp( GLcontext *ctx, GLenum fail, - GLenum zfail, GLenum zpass ); +extern void +_mesa_StencilOp( GLenum fail, GLenum zfail, GLenum zpass ); diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index e2644b733a1..42d1c90efbf 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1,8 +1,8 @@ -/* $Id: teximage.c,v 1.11 1999/11/08 07:36:44 brianp Exp $ */ +/* $Id: teximage.c,v 1.12 1999/11/11 01:22:27 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -28,17 +28,10 @@ #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "image.h" -#include "macros.h" +#include "mem.h" #include "mmath.h" #include "span.h" #include "teximage.h" @@ -58,25 +51,13 @@ -static struct gl_pixelstore_attrib defaultPacking = { - 1, /* Alignment */ - 0, /* RowLength */ - 0, /* SkipPixels */ - 0, /* SkipRows */ - 0, /* ImageHeight */ - 0, /* SkipImages */ - GL_FALSE, /* SwapBytes */ - GL_FALSE /* LsbFirst */ -}; - - - /* * Compute log base 2 of n. * If n isn't an exact power of two return -1. * If n<0 return -1. */ -static int logbase2( int n ) +static int +logbase2( int n ) { GLint i = 1; GLint log2 = 0; @@ -105,7 +86,8 @@ static int logbase2( int n ) * GL_LUMANCE_ALPHA, GL_INTENSITY, GL_RGB, or GL_RGBA. * Return -1 if invalid enum. */ -static GLint decode_internal_format( GLint format ) +static GLint +decode_internal_format( GLint format ) { switch (format) { case GL_ALPHA: @@ -177,7 +159,8 @@ static GLint decode_internal_format( GLint format ) * GL_LUMANCE_ALPHA, GL_INTENSITY, GL_RGB, or GL_RGBA. Return the * number of components for the format. Return -1 if invalid enum. */ -static GLint components_in_intformat( GLint format ) +static GLint +components_in_intformat( GLint format ) { switch (format) { case GL_ALPHA: @@ -243,14 +226,16 @@ static GLint components_in_intformat( GLint format ) -struct gl_texture_image *gl_alloc_texture_image( void ) +struct gl_texture_image * +gl_alloc_texture_image( void ) { return CALLOC_STRUCT(gl_texture_image); } -void gl_free_texture_image( struct gl_texture_image *teximage ) +void +gl_free_texture_image( struct gl_texture_image *teximage ) { if (teximage->Data) { FREE( teximage->Data ); @@ -267,7 +252,8 @@ void gl_free_texture_image( struct gl_texture_image *teximage ) * These fields are set only here by core Mesa but device drivers may * overwritting these fields to indicate true texel resolution. */ -static void set_teximage_component_sizes( struct gl_texture_image *texImage ) +static void +set_teximage_component_sizes( struct gl_texture_image *texImage ) { switch (texImage->Format) { case GL_ALPHA: @@ -762,7 +748,7 @@ texture_error_check( GLcontext *ctx, GLenum target, * Return: GL_TRUE = an error was detected, GL_FALSE = no errors */ static GLboolean -subtexture_error_check( GLcontext *ctx, GLint dimensions, +subtexture_error_check( GLcontext *ctx, GLuint dimensions, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint width, GLint height, GLint depth, @@ -870,7 +856,7 @@ subtexture_error_check( GLcontext *ctx, GLint dimensions, * Return: GL_TRUE = an error was detected, GL_FALSE = no errors */ static GLboolean -copytexture_error_check( GLcontext *ctx, GLint dimensions, +copytexture_error_check( GLcontext *ctx, GLuint dimensions, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint border ) { @@ -940,7 +926,7 @@ copytexture_error_check( GLcontext *ctx, GLint dimensions, static GLboolean -copytexsubimage_error_check( GLcontext *ctx, GLint dimensions, +copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height ) @@ -981,7 +967,7 @@ copytexsubimage_error_check( GLcontext *ctx, GLint dimensions, return GL_TRUE; } - teximage = texUnit->CurrentD[dimensions]->Image[level]; + teximage = texUnit->CurrentD[3]->Image[level]; if (!teximage) { char message[100]; sprintf(message, "glCopyTexSubImage%dD(undefined texture)", dimensions); @@ -1042,11 +1028,12 @@ copytexsubimage_error_check( GLcontext *ctx, GLint dimensions, /* * Called from the API. Note that width includes the border. */ -void gl_TexImage1D( GLcontext *ctx, GLenum target, GLint level, - GLint internalformat, - GLsizei width, GLint border, GLenum format, - GLenum type, const GLvoid *pixels ) +void +_mesa_TexImage1D( GLenum target, GLint level, GLint internalformat, + GLsizei width, GLint border, GLenum format, + GLenum type, const GLvoid *pixels ) { + GET_CURRENT_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexImage1D"); @@ -1111,12 +1098,13 @@ void gl_TexImage1D( GLcontext *ctx, GLenum target, GLint level, } -void gl_TexImage2D( GLcontext *ctx, GLenum target, GLint level, - GLint internalformat, - GLsizei width, GLsizei height, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ) +void +_mesa_TexImage2D( GLenum target, GLint level, GLint internalformat, + GLsizei width, GLsizei height, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ) { + GET_CURRENT_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexImage2D"); @@ -1186,16 +1174,17 @@ void gl_TexImage2D( GLcontext *ctx, GLenum target, GLint level, * Called by the API or display list executor. * Note that width and height include the border. */ -void gl_TexImage3D( GLcontext *ctx, GLenum target, GLint level, - GLint internalformat, - GLsizei width, GLsizei height, GLsizei depth, - GLint border, GLenum format, GLenum type, - const GLvoid *pixels ) +void +_mesa_TexImage3D( GLenum target, GLint level, GLint internalformat, + GLsizei width, GLsizei height, GLsizei depth, + GLint border, GLenum format, GLenum type, + const GLvoid *pixels ) { + GET_CURRENT_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexImage3D"); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexImage3DEXT"); - if (target==GL_TEXTURE_3D) { + if (target==GL_TEXTURE_3D_EXT) { struct gl_texture_image *teximage; if (texture_error_check( ctx, target, level, internalformat, format, type, 3, width, height, depth, @@ -1259,9 +1248,11 @@ void gl_TexImage3D( GLcontext *ctx, GLenum target, GLint level, -void gl_GetTexImage( GLcontext *ctx, GLenum target, GLint level, GLenum format, - GLenum type, GLvoid *pixels ) +void +_mesa_GetTexImage( GLenum target, GLint level, GLenum format, + GLenum type, GLvoid *pixels ) { + GET_CURRENT_CONTEXT(ctx); const struct gl_texture_object *texObj; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetTexImage"); @@ -1387,11 +1378,13 @@ void gl_GetTexImage( GLcontext *ctx, GLenum target, GLint level, GLenum format, -void gl_TexSubImage1D( GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLsizei width, - GLenum format, GLenum type, - const GLvoid *pixels ) +void +_mesa_TexSubImage1D( GLenum target, GLint level, + GLint xoffset, GLsizei width, + GLenum format, GLenum type, + const GLvoid *pixels ) { + GET_CURRENT_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; struct gl_texture_image *destTex; @@ -1454,12 +1447,14 @@ void gl_TexSubImage1D( GLcontext *ctx, GLenum target, GLint level, } -void gl_TexSubImage2D( GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels ) +void +_mesa_TexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ) { + GET_CURRENT_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; struct gl_texture_image *destTex; @@ -1535,12 +1530,14 @@ void gl_TexSubImage2D( GLcontext *ctx, GLenum target, GLint level, -void gl_TexSubImage3D( GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, - const GLvoid *pixels ) +void +_mesa_TexSubImage3D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type, + const GLvoid *pixels ) { + GET_CURRENT_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; struct gl_texture_image *destTex; @@ -1647,11 +1644,13 @@ read_color_image( GLcontext *ctx, GLint x, GLint y, -void gl_CopyTexImage1D( GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, - GLsizei width, GLint border ) +void +_mesa_CopyTexImage1D( GLenum target, GLint level, + GLenum internalFormat, + GLint x, GLint y, + GLsizei width, GLint border ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexImage1D"); if (!copytexture_error_check(ctx, 1, target, level, internalFormat, @@ -1661,19 +1660,20 @@ void gl_CopyTexImage1D( GLcontext *ctx, GLenum target, GLint level, gl_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D" ); return; } - (*ctx->Exec.TexImage1D)( ctx, target, level, internalFormat, width, - border, GL_RGBA, GL_UNSIGNED_BYTE, image ); + (*ctx->Exec.TexImage1D)( target, level, internalFormat, width, + border, GL_RGBA, GL_UNSIGNED_BYTE, image ); FREE(image); } } -void gl_CopyTexImage2D( GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height, - GLint border ) +void +_mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, + GLint x, GLint y, GLsizei width, GLsizei height, + GLint border ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexImage2D"); if (!copytexture_error_check(ctx, 2, target, level, internalFormat, @@ -1683,13 +1683,8 @@ void gl_CopyTexImage2D( GLcontext *ctx, GLenum target, GLint level, gl_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D" ); return; } - { - struct gl_pixelstore_attrib save = ctx->Unpack; - ctx->Unpack = defaultPacking; - (ctx->Exec.TexImage2D)( ctx, target, level, internalFormat, width, + (ctx->Exec.TexImage2D)( target, level, internalFormat, width, height, border, GL_RGBA, GL_UNSIGNED_BYTE, image ); - ctx->Unpack = save; /* restore */ - } FREE(image); } } @@ -1751,9 +1746,11 @@ copy_tex_sub_image( GLcontext *ctx, struct gl_texture_image *dest, -void gl_CopyTexSubImage1D( GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, GLsizei width ) +void +_mesa_CopyTexSubImage1D( GLenum target, GLint level, + GLint xoffset, GLint x, GLint y, GLsizei width ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexSubImage1D"); if (!copytexsubimage_error_check(ctx, 1, target, level, @@ -1777,10 +1774,12 @@ void gl_CopyTexSubImage1D( GLcontext *ctx, GLenum target, GLint level, -void gl_CopyTexSubImage2D( GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, GLsizei width, GLsizei height ) +void +_mesa_CopyTexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, GLsizei width, GLsizei height ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexSubImage2D"); if (!copytexsubimage_error_check(ctx, 2, target, level, @@ -1805,10 +1804,12 @@ void gl_CopyTexSubImage2D( GLcontext *ctx, GLenum target, GLint level, -void gl_CopyTexSubImage3D( GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint x, GLint y, GLsizei width, GLsizei height ) +void +_mesa_CopyTexSubImage3D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLint x, GLint y, GLsizei width, GLsizei height ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexSubImage3D"); if (!copytexsubimage_error_check(ctx, 3, target, level, diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h index 032f44ce7fd..98ab512262a 100644 --- a/src/mesa/main/teximage.h +++ b/src/mesa/main/teximage.h @@ -1,8 +1,8 @@ -/* $Id: teximage.h,v 1.2 1999/11/03 17:27:05 brianp Exp $ */ +/* $Id: teximage.h,v 1.3 1999/11/11 01:22:28 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -35,97 +35,90 @@ /*** Internal functions ***/ -extern struct gl_texture_image *gl_alloc_texture_image( void ); +extern struct gl_texture_image * +gl_alloc_texture_image( void ); -extern void gl_free_texture_image( struct gl_texture_image *teximage ); +extern void +gl_free_texture_image( struct gl_texture_image *teximage ); +/*** API entry point functions ***/ -/*** API entry points ***/ +extern void +_mesa_TexImage1D( GLenum target, GLint level, GLint internalformat, + GLsizei width, GLint border, + GLenum format, GLenum type, const GLvoid *pixels ); -extern void gl_TexImage1D( GLcontext *ctx, - GLenum target, GLint level, GLint internalformat, - GLsizei width, GLint border, GLenum format, - GLenum type, const GLvoid *pixels ); +extern void +_mesa_TexImage2D( GLenum target, GLint level, GLint internalformat, + GLsizei width, GLsizei height, GLint border, + GLenum format, GLenum type, const GLvoid *pixels ); -extern void gl_TexImage2D( GLcontext *ctx, - GLenum target, GLint level, GLint internalformat, - GLsizei width, GLsizei height, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ); +extern void +_mesa_TexImage3D( GLenum target, GLint level, GLint internalformat, + GLsizei width, GLsizei height, GLsizei depth, GLint border, + GLenum format, GLenum type, const GLvoid *pixels ); -extern void gl_TexImage3D( GLcontext *ctx, - GLenum target, GLint level, GLint internalformat, - GLsizei width, GLsizei height, GLsizei depth, - GLint border, GLenum format, GLenum type, - const GLvoid *pixels ); +extern void +_mesa_GetTexImage( GLenum target, GLint level, + GLenum format, GLenum type, GLvoid *pixels ); -extern void gl_GetTexImage( GLcontext *ctx, GLenum target, GLint level, - GLenum format, GLenum type, GLvoid *pixels ); +extern void +_mesa_TexSubImage1D( GLenum target, GLint level, GLint xoffset, + GLsizei width, + GLenum format, GLenum type, + const GLvoid *pixels ); -extern void gl_TexSubImage1D( GLcontext *ctx, - GLenum target, GLint level, GLint xoffset, - GLsizei width, GLenum format, GLenum type, - const GLvoid *pixels ); +extern void +_mesa_TexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ); -extern void gl_TexSubImage2D( GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels ); +extern void +_mesa_TexSubImage3D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLenum type, + const GLvoid *pixels ); -extern void gl_TexSubImage3D( GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, - const GLvoid *pixels ); +extern void +_mesa_CopyTexImage1D( GLenum target, GLint level, GLenum internalformat, + GLint x, GLint y, GLsizei width, GLint border ); -extern void gl_CopyTexImage1D( GLcontext *ctx, - GLenum target, GLint level, - GLenum internalformat, - GLint x, GLint y, - GLsizei width, GLint border ); +extern void +_mesa_CopyTexImage2D( GLenum target, GLint level, + GLenum internalformat, GLint x, GLint y, + GLsizei width, GLsizei height, GLint border ); -extern void gl_CopyTexImage2D( GLcontext *ctx, - GLenum target, GLint level, - GLenum internalformat, GLint x, GLint y, - GLsizei width, GLsizei height, - GLint border ); +extern void +_mesa_CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset, + GLint x, GLint y, GLsizei width ); -extern void gl_CopyTexSubImage1D( GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, - GLsizei width ); +extern void +_mesa_CopyTexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, GLsizei width, GLsizei height ); -extern void gl_CopyTexSubImage2D( GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, - GLsizei width, GLsizei height ); - - -extern void gl_CopyTexSubImage3D( GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint zoffset, - GLint x, GLint y, - GLsizei width, GLsizei height ); +extern void +_mesa_CopyTexSubImage3D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLint x, GLint y, GLsizei width, GLsizei height ); #endif diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 2d7db2d5193..fae67d4fc7c 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1,8 +1,8 @@ -/* $Id: texobj.c,v 1.7 1999/11/05 06:43:11 brianp Exp $ */ +/* $Id: texobj.c,v 1.8 1999/11/11 01:22:28 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -23,25 +23,16 @@ * 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. */ -/* $XFree86: xc/lib/GL/mesa/src/texobj.c,v 1.3 1999/04/04 00:20:32 dawes Exp $ */ - - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "enums.h" #include "hash.h" -#include "macros.h" +#include "mem.h" #include "teximage.h" #include "texstate.h" #include "texobj.h" @@ -83,13 +74,13 @@ gl_alloc_texture_object( struct gl_shared_state *shared, GLuint name, obj->BaseLevel = 0; obj->MaxLevel = 1000; obj->MinMagThresh = 0.0F; - obj->Palette[0] = 255; - obj->Palette[1] = 255; - obj->Palette[2] = 255; - obj->Palette[3] = 255; - obj->PaletteSize = 1; - obj->PaletteIntFormat = GL_RGBA; - obj->PaletteFormat = GL_RGBA; + obj->Palette.Table[0] = 255; + obj->Palette.Table[1] = 255; + obj->Palette.Table[2] = 255; + obj->Palette.Table[3] = 255; + obj->Palette.Size = 1; + obj->Palette.IntFormat = GL_RGBA; + obj->Palette.Format = GL_RGBA; /* insert into linked list */ if (shared) { @@ -334,8 +325,10 @@ void gl_test_texture_object_completeness( const GLcontext *ctx, struct gl_textur /* * Execute glGenTextures */ -void gl_GenTextures( GLcontext *ctx, GLsizei n, GLuint *texName ) +void +_mesa_GenTextures( GLsizei n, GLuint *texName ) { + GET_CURRENT_CONTEXT(ctx); GLuint first; GLint i; @@ -365,8 +358,10 @@ void gl_GenTextures( GLcontext *ctx, GLsizei n, GLuint *texName ) /* * Execute glDeleteTextures */ -void gl_DeleteTextures( GLcontext *ctx, GLsizei n, const GLuint *texName) +void +_mesa_DeleteTextures( GLsizei n, const GLuint *texName) { + GET_CURRENT_CONTEXT(ctx); GLint i; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDeleteTextures"); @@ -409,8 +404,10 @@ void gl_DeleteTextures( GLcontext *ctx, GLsizei n, const GLuint *texName) /* * Execute glBindTexture */ -void gl_BindTexture( GLcontext *ctx, GLenum target, GLuint texName ) +void +_mesa_BindTexture( GLenum target, GLuint texName ) { + GET_CURRENT_CONTEXT(ctx); GLuint unit = ctx->Texture.CurrentUnit; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; struct gl_texture_object *oldTexObj; @@ -501,10 +498,11 @@ void gl_BindTexture( GLcontext *ctx, GLenum target, GLuint texName ) /* * Execute glPrioritizeTextures */ -void gl_PrioritizeTextures( GLcontext *ctx, - GLsizei n, const GLuint *texName, - const GLclampf *priorities ) +void +_mesa_PrioritizeTextures( GLsizei n, const GLuint *texName, + const GLclampf *priorities ) { + GET_CURRENT_CONTEXT(ctx); GLint i; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPrioritizeTextures"); @@ -533,10 +531,11 @@ void gl_PrioritizeTextures( GLcontext *ctx, /* * Execute glAreTexturesResident */ -GLboolean gl_AreTexturesResident( GLcontext *ctx, GLsizei n, - const GLuint *texName, - GLboolean *residences ) +GLboolean +_mesa_AreTexturesResident( GLsizei n, const GLuint *texName, + GLboolean *residences ) { + GET_CURRENT_CONTEXT(ctx); GLboolean resident = GL_TRUE; GLint i; @@ -575,8 +574,10 @@ GLboolean gl_AreTexturesResident( GLcontext *ctx, GLsizei n, /* * Execute glIsTexture */ -GLboolean gl_IsTexture( GLcontext *ctx, GLuint texture ) +GLboolean +_mesa_IsTexture( GLuint texture ) { + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glIsTextures", GL_FALSE); if (texture>0 && HashLookup(ctx->Shared->TexObjects, texture)) { diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h index 655c823753c..a4bf3961518 100644 --- a/src/mesa/main/texobj.h +++ b/src/mesa/main/texobj.h @@ -1,8 +1,8 @@ -/* $Id: texobj.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: texobj.h,v 1.2 1999/11/11 01:22:28 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,9 +25,6 @@ */ - - - #ifndef TEXTOBJ_H #define TEXTOBJ_H @@ -59,27 +56,30 @@ extern void gl_test_texture_object_completeness( const GLcontext *ctx, struct gl * API functions */ -extern void gl_GenTextures( GLcontext *ctx, GLsizei n, GLuint *textures ); +extern void +_mesa_GenTextures( GLsizei n, GLuint *textures ); -extern void gl_DeleteTextures( GLcontext *ctx, - GLsizei n, const GLuint *textures); +extern void +_mesa_DeleteTextures( GLsizei n, const GLuint *textures ); -extern void gl_BindTexture( GLcontext *ctx, GLenum target, GLuint texture ); +extern void +_mesa_BindTexture( GLenum target, GLuint texture ); -extern void gl_PrioritizeTextures( GLcontext *ctx, - GLsizei n, const GLuint *textures, - const GLclampf *priorities ); +extern void +_mesa_PrioritizeTextures( GLsizei n, const GLuint *textures, + const GLclampf *priorities ); -extern GLboolean gl_AreTexturesResident( GLcontext *ctx, GLsizei n, - const GLuint *textures, - GLboolean *residences ); +extern GLboolean +_mesa_AreTexturesResident( GLsizei n, const GLuint *textures, + GLboolean *residences ); -extern GLboolean gl_IsTexture( GLcontext *ctx, GLuint texture ); +extern GLboolean +_mesa_IsTexture( GLuint texture ); #endif diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 5a3664e79aa..7e5ce3085a0 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1,8 +1,8 @@ -/* $Id: texstate.c,v 1.4 1999/11/05 06:43:11 brianp Exp $ */ +/* $Id: texstate.c,v 1.5 1999/11/11 01:22:28 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,16 +25,10 @@ */ - #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" #include "enums.h" #include "macros.h" @@ -66,9 +60,10 @@ /**********************************************************************/ -void gl_TexEnvfv( GLcontext *ctx, - GLenum target, GLenum pname, const GLfloat *param ) +void +_mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) { + GET_CURRENT_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexEnv"); @@ -128,12 +123,40 @@ void gl_TexEnvfv( GLcontext *ctx, } +void +_mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param ) +{ + _mesa_TexEnvfv( target, pname, ¶m ); +} + + + +void +_mesa_TexEnvi( GLenum target, GLenum pname, GLint param ) +{ + GLfloat p[4]; + p[0] = (GLfloat) param; + p[1] = p[2] = p[3] = 0.0; + _mesa_TexEnvfv( target, pname, p ); +} + +void +_mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param ) +{ + GLfloat p[4]; + p[0] = INT_TO_FLOAT( param[0] ); + p[1] = INT_TO_FLOAT( param[1] ); + p[2] = INT_TO_FLOAT( param[2] ); + p[3] = INT_TO_FLOAT( param[3] ); + _mesa_TexEnvfv( target, pname, p ); +} -void gl_GetTexEnvfv( GLcontext *ctx, - GLenum target, GLenum pname, GLfloat *params ) +void +_mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) { + GET_CURRENT_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; if (target!=GL_TEXTURE_ENV) { gl_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" ); @@ -152,9 +175,10 @@ void gl_GetTexEnvfv( GLcontext *ctx, } -void gl_GetTexEnviv( GLcontext *ctx, - GLenum target, GLenum pname, GLint *params ) +void +_mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) { + GET_CURRENT_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; if (target!=GL_TEXTURE_ENV) { gl_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" ); @@ -183,9 +207,17 @@ void gl_GetTexEnviv( GLcontext *ctx, /**********************************************************************/ -void gl_TexParameterfv( GLcontext *ctx, - GLenum target, GLenum pname, const GLfloat *params ) +void +_mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ) +{ + _mesa_TexParameterfv(target, pname, ¶m); +} + + +void +_mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) { + GET_CURRENT_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; GLenum eparam = (GLenum) (GLint) params[0]; struct gl_texture_object *texObj; @@ -330,20 +362,41 @@ void gl_TexParameterfv( GLcontext *ctx, } +void +_mesa_TexParameteri( GLenum target, GLenum pname, const GLint param ) +{ + GLfloat fparam[4]; + fparam[0] = (GLfloat) param; + fparam[1] = fparam[2] = fparam[3] = 0.0; + _mesa_TexParameterfv(target, pname, fparam); +} + +void +_mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params ) +{ + GLfloat fparam[4]; + fparam[0] = (GLfloat) params[0]; + fparam[1] = fparam[2] = fparam[3] = 0.0; + _mesa_TexParameterfv(target, pname, fparam); +} + -void gl_GetTexLevelParameterfv( GLcontext *ctx, GLenum target, GLint level, - GLenum pname, GLfloat *params ) +void +_mesa_GetTexLevelParameterfv( GLenum target, GLint level, + GLenum pname, GLfloat *params ) { GLint iparam; - gl_GetTexLevelParameteriv( ctx, target, level, pname, &iparam ); + _mesa_GetTexLevelParameteriv( target, level, pname, &iparam ); *params = (GLfloat) iparam; } -void gl_GetTexLevelParameteriv( GLcontext *ctx, GLenum target, GLint level, - GLenum pname, GLint *params ) +void +_mesa_GetTexLevelParameteriv( GLenum target, GLint level, + GLenum pname, GLint *params ) { + GET_CURRENT_CONTEXT(ctx); const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; const struct gl_texture_image *img = NULL; GLuint dimensions; @@ -448,10 +501,10 @@ void gl_GetTexLevelParameteriv( GLcontext *ctx, GLenum target, GLint level, - -void gl_GetTexParameterfv( GLcontext *ctx, - GLenum target, GLenum pname, GLfloat *params ) +void +_mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) { + GET_CURRENT_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; struct gl_texture_object *obj; @@ -516,9 +569,10 @@ void gl_GetTexParameterfv( GLcontext *ctx, } -void gl_GetTexParameteriv( GLcontext *ctx, - GLenum target, GLenum pname, GLint *params ) +void +_mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) { + GET_CURRENT_CONTEXT(ctx); struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; struct gl_texture_object *obj; @@ -597,9 +651,10 @@ void gl_GetTexParameteriv( GLcontext *ctx, /**********************************************************************/ -void gl_TexGenfv( GLcontext *ctx, - GLenum coord, GLenum pname, const GLfloat *params ) +void +_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) { + GET_CURRENT_CONTEXT(ctx); GLuint tUnit = ctx->Texture.CurrentTransformUnit; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[tUnit]; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexGenfv"); @@ -610,7 +665,7 @@ void gl_TexGenfv( GLcontext *ctx, gl_lookup_enum_by_nr(pname), *(int *)params); - switch( coord ) { + switch (coord) { case GL_S: if (pname==GL_TEXTURE_GEN_MODE) { GLenum mode = (GLenum) (GLint) *params; @@ -796,10 +851,57 @@ void gl_TexGenfv( GLcontext *ctx, } +void +_mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) +{ + GLfloat p[4]; + p[0] = params[0]; + p[1] = params[1]; + p[2] = params[2]; + p[3] = params[3]; + _mesa_TexGenfv(coord, pname, p); +} + + +void +_mesa_TexGend(GLenum coord, GLenum pname, GLdouble param ) +{ + GLfloat p = (GLfloat) param; + _mesa_TexGenfv( coord, pname, &p ); +} + + +void +_mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) +{ + GLfloat p[4]; + p[0] = params[0]; + p[1] = params[1]; + p[2] = params[2]; + p[3] = params[3]; + _mesa_TexGenfv( coord, pname, p ); +} + -void gl_GetTexGendv( GLcontext *ctx, - GLenum coord, GLenum pname, GLdouble *params ) +void +_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) { + _mesa_TexGenfv(coord, pname, ¶m); +} + + +void +_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) +{ + _mesa_TexGeniv( coord, pname, ¶m ); +} + + + +void +_mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) +{ + GET_CURRENT_CONTEXT(ctx); GLuint tUnit = ctx->Texture.CurrentTransformUnit; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[tUnit]; @@ -874,9 +976,10 @@ void gl_GetTexGendv( GLcontext *ctx, -void gl_GetTexGenfv( GLcontext *ctx, - GLenum coord, GLenum pname, GLfloat *params ) +void +_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) { + GET_CURRENT_CONTEXT(ctx); GLuint tUnit = ctx->Texture.CurrentTransformUnit; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[tUnit]; @@ -951,9 +1054,10 @@ void gl_GetTexGenfv( GLcontext *ctx, -void gl_GetTexGeniv( GLcontext *ctx, - GLenum coord, GLenum pname, GLint *params ) +void +_mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) { + GET_CURRENT_CONTEXT(ctx); GLuint tUnit = ctx->Texture.CurrentTransformUnit; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[tUnit]; @@ -983,7 +1087,7 @@ void gl_GetTexGeniv( GLcontext *ctx, break; case GL_T: if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = (GLint) texUnit->GenModeT; + params[0] = texUnit->GenModeT; } else if (pname==GL_OBJECT_PLANE) { params[0] = (GLint) texUnit->ObjectPlaneT[0]; @@ -1004,7 +1108,7 @@ void gl_GetTexGeniv( GLcontext *ctx, break; case GL_R: if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = (GLint) texUnit->GenModeR; + params[0] = texUnit->GenModeR; } else if (pname==GL_OBJECT_PLANE) { params[0] = (GLint) texUnit->ObjectPlaneR[0]; @@ -1025,7 +1129,7 @@ void gl_GetTexGeniv( GLcontext *ctx, break; case GL_Q: if (pname==GL_TEXTURE_GEN_MODE) { - params[0] = (GLint) texUnit->GenModeQ; + params[0] = texUnit->GenModeQ; } else if (pname==GL_OBJECT_PLANE) { params[0] = (GLint) texUnit->ObjectPlaneQ[0]; @@ -1038,7 +1142,7 @@ void gl_GetTexGeniv( GLcontext *ctx, params[1] = (GLint) texUnit->EyePlaneQ[1]; params[2] = (GLint) texUnit->EyePlaneQ[2]; params[3] = (GLint) texUnit->EyePlaneQ[3]; - } + } else { gl_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); return; @@ -1052,8 +1156,10 @@ void gl_GetTexGeniv( GLcontext *ctx, /* GL_ARB_multitexture */ -void gl_ActiveTexture( GLcontext *ctx, GLenum target ) +void +_mesa_ActiveTextureARB( GLenum target ) { + GET_CURRENT_CONTEXT(ctx); GLint maxUnits = ctx->Const.MaxTextureUnits; ASSERT_OUTSIDE_BEGIN_END( ctx, "glActiveTextureARB" ); @@ -1077,8 +1183,10 @@ void gl_ActiveTexture( GLcontext *ctx, GLenum target ) /* GL_ARB_multitexture */ -void gl_ClientActiveTexture( GLcontext *ctx, GLenum target ) +void +_mesa_ClientActiveTextureARB( GLenum target ) { + GET_CURRENT_CONTEXT(ctx); GLint maxUnits = ctx->Const.MaxTextureUnits; ASSERT_OUTSIDE_BEGIN_END( ctx, "glClientActiveTextureARB" ); diff --git a/src/mesa/main/texstate.h b/src/mesa/main/texstate.h index 870693bfa70..d3111f02e3f 100644 --- a/src/mesa/main/texstate.h +++ b/src/mesa/main/texstate.h @@ -1,4 +1,4 @@ -/* $Id: texstate.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: texstate.h,v 1.2 1999/11/11 01:22:28 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -37,46 +37,80 @@ /*** Called from API ***/ -extern void gl_GetTexEnvfv( GLcontext *ctx, - GLenum target, GLenum pname, GLfloat *params ); +extern void +_mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); -extern void gl_GetTexEnviv( GLcontext *ctx, - GLenum target, GLenum pname, GLint *params ); +extern void +_mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ); -extern void gl_GetTexGendv( GLcontext *ctx, - GLenum coord, GLenum pname, GLdouble *params ); +extern void +_mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); -extern void gl_GetTexGenfv( GLcontext *ctx, - GLenum coord, GLenum pname, GLfloat *params ); +extern void +_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); -extern void gl_GetTexGeniv( GLcontext *ctx, - GLenum coord, GLenum pname, GLint *params ); +extern void +_mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ); -extern void gl_GetTexLevelParameterfv( GLcontext *ctx, - GLenum target, GLint level, - GLenum pname, GLfloat *params ); +extern void +_mesa_GetTexLevelParameterfv( GLenum target, GLint level, + GLenum pname, GLfloat *params ); -extern void gl_GetTexLevelParameteriv( GLcontext *ctx, - GLenum target, GLint level, - GLenum pname, GLint *params ); +extern void +_mesa_GetTexLevelParameteriv( GLenum target, GLint level, + GLenum pname, GLint *params ); -extern void gl_GetTexParameterfv( GLcontext *ctx, GLenum target, - GLenum pname, GLfloat *params ); +extern void +_mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ); -extern void gl_GetTexParameteriv( GLcontext *ctx, - GLenum target, GLenum pname, GLint *params ); +extern void +_mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ); -extern void gl_TexEnvfv( GLcontext *ctx, - GLenum target, GLenum pname, const GLfloat *param ); +extern void +_mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param ); +extern void +_mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ); -extern void gl_TexParameterfv( GLcontext *ctx, GLenum target, GLenum pname, - const GLfloat *params ); +extern void +_mesa_TexEnvi( GLenum target, GLenum pname, GLint param ); +extern void +_mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param ); -extern void gl_TexGenfv( GLcontext *ctx, - GLenum coord, GLenum pname, const GLfloat *params ); + +extern void +_mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ); + +extern void +_mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ); + + +extern void +_mesa_TexParameteri( GLenum target, GLenum pname, GLint param ); + +extern void +_mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params ); + + +extern void +_mesa_TexGend( GLenum coord, GLenum pname, GLdouble param ); + +extern void +_mesa_TexGendv( GLenum coord, GLenum pname, const GLdouble *params ); + +extern void +_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ); + +extern void +_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); + +extern void +_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ); + +extern void +_mesa_TexGeniv( GLenum coord, GLenum pname, const GLint *params ); @@ -86,9 +120,11 @@ extern void gl_SelectTextureTransform( GLcontext *ctx, GLenum target ); /* * GL_ARB_multitexture */ -extern void gl_ActiveTexture( GLcontext *ctx, GLenum target ); +extern void +_mesa_ActiveTextureARB( GLenum target ); -extern void gl_ClientActiveTexture( GLcontext *ctx, GLenum target ); +extern void +_mesa_ClientActiveTextureARB( GLenum target ); diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index bf7053cd1ac..8fcc63b9e72 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -1,4 +1,4 @@ -/* $Id: varray.c,v 1.13 1999/11/09 17:26:15 keithw Exp $ */ +/* $Id: varray.c,v 1.14 1999/11/11 01:22:28 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -27,15 +27,8 @@ #ifdef PC_HEADER #include "all.h" #else -#ifndef XFree86Server -#include -#include -#include -#else -#include "GL/xf86glx.h" -#endif +#include "glheader.h" #include "context.h" -#include "api.h" #include "cva.h" #include "enable.h" #include "enums.h" @@ -54,24 +47,14 @@ #include "vbindirect.h" #include "vbxform.h" #include "xform.h" -#ifdef XFree86Server -#include "GL/xf86glx.h" -#endif #endif -#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server) && !defined(GLX_USE_DLOPEN) -#define NEED_MESA_FUNCS_WRAPPED -#include "mesa_api.h" -#endif -void GLAPIENTRY glVertexPointer(CTX_ARG GLint size, GLenum type, GLsizei stride, - const GLvoid *ptr ) +void +_mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) { - GLcontext *ctx; - GET_CONTEXT; - CHECK_CONTEXT; - ctx = CC; + GET_CURRENT_CONTEXT(ctx); if (size<2 || size>4) { gl_error( ctx, GL_INVALID_VALUE, "glVertexPointer(size)" ); @@ -120,13 +103,10 @@ void GLAPIENTRY glVertexPointer(CTX_ARG GLint size, GLenum type, GLsizei stride, -void GLAPIENTRY glNormalPointer(CTX_ARG GLenum type, GLsizei stride, - const GLvoid *ptr ) +void +_mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr ) { - GLcontext *ctx; - GET_CONTEXT; - CHECK_CONTEXT; - ctx = CC; + GET_CURRENT_CONTEXT(ctx); if (stride<0) { gl_error( ctx, GL_INVALID_VALUE, "glNormalPointer(stride)" ); @@ -172,13 +152,11 @@ void GLAPIENTRY glNormalPointer(CTX_ARG GLenum type, GLsizei stride, -void GLAPIENTRY glColorPointer(CTX_ARG GLint size, GLenum type, GLsizei stride, - const GLvoid *ptr ) +void +_mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) { - GLcontext *ctx; - GET_CONTEXT; - CHECK_CONTEXT; - ctx = CC; + GET_CURRENT_CONTEXT(ctx); + if (size<3 || size>4) { gl_error( ctx, GL_INVALID_VALUE, "glColorPointer(size)" ); return; @@ -237,13 +215,10 @@ void GLAPIENTRY glColorPointer(CTX_ARG GLint size, GLenum type, GLsizei stride, -void GLAPIENTRY glIndexPointer(CTX_ARG GLenum type, GLsizei stride, - const GLvoid *ptr ) +void +_mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr) { - GLcontext *ctx; - GET_CONTEXT; - CHECK_CONTEXT; - ctx = CC; + GET_CURRENT_CONTEXT(ctx); if (stride<0) { gl_error( ctx, GL_INVALID_VALUE, "glIndexPointer(stride)" ); @@ -284,16 +259,12 @@ void GLAPIENTRY glIndexPointer(CTX_ARG GLenum type, GLsizei stride, -void GLAPIENTRY glTexCoordPointer(CTX_ARG GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr ) +void +_mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) { + GET_CURRENT_CONTEXT(ctx); GLuint texUnit; - GLcontext *ctx; - GET_CONTEXT; - CHECK_CONTEXT; - ctx = CC; - texUnit = ctx->Array.ActiveTexture; if (size<1 || size>4) { @@ -346,14 +317,11 @@ void GLAPIENTRY glTexCoordPointer(CTX_ARG GLint size, GLenum type, -void GLAPIENTRY glEdgeFlagPointer(CTX_ARG GLsizei stride, const void *vptr ) +void +_mesa_EdgeFlagPointer(GLsizei stride, const void *vptr) { + GET_CURRENT_CONTEXT(ctx); const GLboolean *ptr = (GLboolean *)vptr; - - GLcontext *ctx; - GET_CONTEXT; - CHECK_CONTEXT; - ctx = CC; if (stride<0) { gl_error( ctx, GL_INVALID_VALUE, "glEdgeFlagPointer(stride)" ); @@ -470,8 +438,42 @@ void gl_exec_array_elements( GLcontext *ctx, struct immediate *IM, -void gl_DrawArrays( GLcontext *ctx, GLenum mode, GLint start, GLsizei count ) +/* Enough funny business going on in here it might be quicker to use a + * function pointer. + */ +#define ARRAY_ELT( IM, i ) \ +{ \ + GLuint count = IM->Count; \ + IM->Elt[count] = i; \ + IM->Flag[count] = ((IM->Flag[count] & IM->ArrayAndFlags) | \ + VERT_ELT); \ + IM->FlushElt |= IM->ArrayEltFlush; \ + IM->Count = count += IM->ArrayIncr; \ + if (count == VB_MAX) \ + IM->maybe_transform_vb( IM ); \ +} + + +void +_mesa_ArrayElement( GLint i ) +{ + GET_IMMEDIATE; + ARRAY_ELT( IM, i ); +} + + +void gl_ArrayElement( GLcontext *CC, GLint i ) +{ + struct immediate *im = CC->input; + ARRAY_ELT( im, i ); +} + + + +void +_mesa_DrawArrays(GLenum mode, GLint start, GLsizei count) { + GET_CURRENT_CONTEXT(ctx); struct vertex_buffer *VB = ctx->VB; GLint i; @@ -781,16 +783,13 @@ static GLuint natural_stride[0x10] = 0 /* f */ }; -void GLAPIENTRY glDrawElements(CTX_ARG GLenum mode, GLsizei count, - GLenum type, const GLvoid *indices ) + +void +_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) { - GLcontext *ctx; + GET_CURRENT_CONTEXT(ctx); struct gl_cva *cva; - GET_CONTEXT; - CHECK_CONTEXT; - ctx = CC; - cva = &ctx->CVA; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDrawElements"); @@ -900,10 +899,10 @@ void GLAPIENTRY glDrawElements(CTX_ARG GLenum mode, GLsizei count, -void GLAPIENTRY glInterleavedArrays(CTX_ARG GLenum format, GLsizei stride, - const GLvoid *pointer ) +void +_mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer) { - GLcontext *ctx; + GET_CURRENT_CONTEXT(ctx); GLboolean tflag, cflag, nflag; /* enable/disable flags */ GLint tcomps, ccomps, vcomps; /* components per texcoord, color, vertex */ @@ -913,11 +912,6 @@ void GLAPIENTRY glInterleavedArrays(CTX_ARG GLenum format, GLsizei stride, GLint c, f; GLint coordUnitSave; - GET_CONTEXT; - CHECK_CONTEXT; - ctx = CC; - - f = sizeof(GLfloat); c = f * ((4*sizeof(GLubyte) + (f-1)) / f); @@ -1041,8 +1035,8 @@ void GLAPIENTRY glInterleavedArrays(CTX_ARG GLenum format, GLsizei stride, stride = defstride; } - gl_DisableClientState( ctx, GL_EDGE_FLAG_ARRAY ); - gl_DisableClientState( ctx, GL_INDEX_ARRAY ); + _mesa_DisableClientState( GL_EDGE_FLAG_ARRAY ); + _mesa_DisableClientState( GL_INDEX_ARRAY ); /* Texcoords */ coordUnitSave = ctx->Array.ActiveTexture; @@ -1050,63 +1044,61 @@ void GLAPIENTRY glInterleavedArrays(CTX_ARG GLenum format, GLsizei stride, GLint i; GLint factor = ctx->Array.TexCoordInterleaveFactor; for (i = 0; i < factor; i++) { - gl_ClientActiveTexture( ctx, (GLenum) (GL_TEXTURE0_ARB + i) ); - gl_EnableClientState( ctx, GL_TEXTURE_COORD_ARRAY ); - glTexCoordPointer(CTX_PRM tcomps, GL_FLOAT, stride, + _mesa_ClientActiveTextureARB( (GLenum) (GL_TEXTURE0_ARB + i) ); + _mesa_EnableClientState( GL_TEXTURE_COORD_ARRAY ); + glTexCoordPointer( tcomps, GL_FLOAT, stride, (GLubyte *) pointer + i * coffset ); } for (i = factor; i < ctx->Const.MaxTextureUnits; i++) { - gl_ClientActiveTexture( ctx, (GLenum) (GL_TEXTURE0_ARB + i) ); - gl_DisableClientState( ctx, GL_TEXTURE_COORD_ARRAY ); + _mesa_ClientActiveTextureARB( (GLenum) (GL_TEXTURE0_ARB + i) ); + _mesa_DisableClientState( GL_TEXTURE_COORD_ARRAY ); } } else { GLint i; for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { - gl_ClientActiveTexture( ctx, (GLenum) (GL_TEXTURE0_ARB + i) ); - gl_DisableClientState( ctx, GL_TEXTURE_COORD_ARRAY ); + _mesa_ClientActiveTextureARB( (GLenum) (GL_TEXTURE0_ARB + i) ); + _mesa_DisableClientState( GL_TEXTURE_COORD_ARRAY ); } } /* Restore texture coordinate unit index */ - gl_ClientActiveTexture( ctx, (GLenum) (GL_TEXTURE0_ARB + coordUnitSave) ); + _mesa_ClientActiveTextureARB( (GLenum) (GL_TEXTURE0_ARB + coordUnitSave) ); /* Color */ if (cflag) { - gl_EnableClientState( ctx, GL_COLOR_ARRAY ); - glColorPointer(CTX_PRM ccomps, ctype, stride, + _mesa_EnableClientState( GL_COLOR_ARRAY ); + glColorPointer( ccomps, ctype, stride, (GLubyte*) pointer + coffset ); } else { - gl_DisableClientState( ctx, GL_COLOR_ARRAY ); + _mesa_DisableClientState( GL_COLOR_ARRAY ); } /* Normals */ if (nflag) { - gl_EnableClientState( ctx, GL_NORMAL_ARRAY ); - glNormalPointer(CTX_PRM GL_FLOAT, stride, + _mesa_EnableClientState( GL_NORMAL_ARRAY ); + glNormalPointer( GL_FLOAT, stride, (GLubyte*) pointer + noffset ); } else { - gl_DisableClientState( ctx, GL_NORMAL_ARRAY ); + _mesa_DisableClientState( GL_NORMAL_ARRAY ); } - gl_EnableClientState( ctx, GL_VERTEX_ARRAY ); - glVertexPointer(CTX_PRM vcomps, GL_FLOAT, stride, + _mesa_EnableClientState( GL_VERTEX_ARRAY ); + glVertexPointer( vcomps, GL_FLOAT, stride, (GLubyte *) pointer + voffset ); } -void GLAPIENTRY glDrawRangeElements(CTX_ARG GLenum mode, GLuint start, - GLuint end, GLsizei count, - GLenum type, const GLvoid *indices ) +void +_mesa_DrawRangeElements(GLenum mode, GLuint start, + GLuint end, GLsizei count, + GLenum type, const GLvoid *indices) { - GLcontext *ctx; - GET_CONTEXT; - CHECK_CONTEXT; - ctx = CC; + GET_CURRENT_CONTEXT(ctx); if (end < start) { gl_error(ctx, GL_INVALID_VALUE, "glDrawRangeElements( end < start )"); @@ -1114,11 +1106,11 @@ void GLAPIENTRY glDrawRangeElements(CTX_ARG GLenum mode, GLuint start, } if (!ctx->Array.LockCount && 2*count > (GLint) 3*(end-start)) { - glLockArraysEXT(CTX_PRM start, end ); - glDrawElements(CTX_PRM mode, count, type, indices ); - glUnlockArraysEXT(CTX_VPRM ); + glLockArraysEXT( start, end ); + glDrawElements( mode, count, type, indices ); + glUnlockArraysEXT(); } else { - glDrawElements(CTX_PRM mode, count, type, indices ); + glDrawElements( mode, count, type, indices ); } } diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h index 88cedb4a1ce..f4d0981b103 100644 --- a/src/mesa/main/varray.h +++ b/src/mesa/main/varray.h @@ -1,4 +1,4 @@ -/* $Id: varray.h,v 1.4 1999/10/19 18:37:05 keithw Exp $ */ +/* $Id: varray.h,v 1.5 1999/11/11 01:22:28 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -32,70 +32,67 @@ #include "types.h" -extern void gl_VertexPointer( GLcontext *ctx, - GLint size, GLenum type, GLsizei stride, - const GLvoid *ptr ); +extern void +_mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, + const GLvoid *ptr); -extern void gl_NormalPointer( GLcontext *ctx, - GLenum type, GLsizei stride, const GLvoid *ptr ); +extern void +_mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr); -extern void gl_ColorPointer( GLcontext *ctx, - GLint size, GLenum type, GLsizei stride, - const GLvoid *ptr ); +extern void +_mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr); -extern void gl_IndexPointer( GLcontext *ctx, - GLenum type, GLsizei stride, - const GLvoid *ptr ); +extern void +_mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr); -extern void gl_TexCoordPointer( GLcontext *ctx, - GLint size, GLenum type, GLsizei stride, - const GLvoid *ptr ); +extern void +_mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, + const GLvoid *ptr); -extern void gl_EdgeFlagPointer( GLcontext *ctx, - GLsizei stride, const GLboolean *ptr ); +extern void +_mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr); -extern void gl_GetPointerv( GLcontext *ctx, GLenum pname, GLvoid **params ); +extern void +_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count); +extern void +_mesa_save_DrawArrays(GLenum mode, GLint first, GLsizei count); -extern void gl_DrawArrays( GLcontext *ctx, - GLenum mode, GLint first, GLsizei count ); -extern void gl_save_DrawArrays( GLcontext *ctx, - GLenum mode, GLint first, GLsizei count ); +extern void +_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, + const GLvoid *indices); -extern void gl_DrawElements( GLcontext *ctx, - GLenum mode, GLsizei count, - GLenum type, const GLvoid *indices ); - -extern void gl_save_DrawElements( GLcontext *ctx, - GLenum mode, GLsizei count, - GLenum type, const GLvoid *indices ); +extern void +_mesa_save_DrawElements(GLenum mode, GLsizei count, + GLenum type, const GLvoid *indices); -extern void gl_InterleavedArrays( GLcontext *ctx, - GLenum format, GLsizei stride, - const GLvoid *pointer ); +extern void +_mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer); -extern void gl_save_InterleavedArrays( GLcontext *ctx, - GLenum format, GLsizei stride, - const GLvoid *pointer ); +extern void +_mesa_save_InterleavedArrays(GLenum format, GLsizei stride, + const GLvoid *pointer); -extern void gl_DrawRangeElements( GLcontext *ctx, GLenum mode, GLuint start, - GLuint end, GLsizei count, GLenum type, - const GLvoid *indices ); +extern void +_mesa_DrawRangeElements(GLenum mode, GLuint start, + GLuint end, GLsizei count, GLenum type, + const GLvoid *indices); -extern void gl_save_DrawRangeElements( GLcontext *ctx, GLenum mode, - GLuint start, GLuint end, GLsizei count, - GLenum type, const GLvoid *indices ); +extern void +_mesa_save_DrawRangeElements(GLenum mode, + GLuint start, GLuint end, GLsizei count, + GLenum type, const GLvoid *indices ); extern void gl_exec_array_elements( GLcontext *ctx, @@ -105,4 +102,5 @@ extern void gl_exec_array_elements( GLcontext *ctx, extern void gl_update_client_state( GLcontext *ctx ); + #endif -- cgit v1.2.3 From a73119234cc5d0b78ebd48c7bb7c43b755028836 Mon Sep 17 00:00:00 2001 From: Kendall Bennett Date: Thu, 11 Nov 1999 03:21:43 +0000 Subject: . Updated GL/gl.h with GLCALLACKP and GLAPIENTRYP macros for compatibility with the IBM VisualAge C++ compiler. Eventually some more code will be needed in the headers to enable the reversal of (__stdcall*) to (*__stdcall) for the IBM compilers, however we currently build using our own header files that already handle this. . Changed instances of (GLCALLBACK*) to GLCALLBACKP for compatibility with the IBM VisualAge C++ compiler in src-glu. . Misc cleanups for warnings generated with Watcom C++ in src-glu. Compiles with 0 warnings now. . tess_hash.c: line 244 - Why is this function stubbed out? I removed the code with a #if 0 to avoid a compiler warning, but it looks dangerous. --- include/GL/gl.h | 6 +++++- include/GL/glu.h | 4 ++-- src/glu/mesa/nurbs.c | 27 +++++++++++++++++++++----- src/glu/mesa/nurbs.h | 25 ++++++++++++++++++++---- src/glu/mesa/quadric.c | 44 ++++++++++++++++++++++++------------------ src/glu/mesa/tess.c | 52 +++++++++++++++++++++++++------------------------- 6 files changed, 101 insertions(+), 57 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 0ab6b2aa138..68fb1b3adba 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.18 1999/11/11 01:27:17 brianp Exp $ */ +/* $Id: gl.h,v 1.19 1999/11/11 03:21:43 kendallb Exp $ */ /* * Mesa 3-D graphics library @@ -77,14 +77,18 @@ # define WGLAPI __declspec(dllimport) # endif /* _STATIC_MESA support */ # define GLAPIENTRY __stdcall +# define GLAPIENTRYP __stdcall * # define GLCALLBACK __stdcall +# define GLCALLBACKP __stdcall * # define GLWINAPI __stdcall # define GLWINAPIV __cdecl #else /* non-Windows compilation */ # define GLAPI extern # define GLAPIENTRY +# define GLAPIENTRYP * # define GLCALLBACK +# define GLCALLBACKP * # define GLWINAPI # define GLWINAPIV #endif /* WIN32 / CYGWIN32 bracket */ diff --git a/include/GL/glu.h b/include/GL/glu.h index bfb9e90f66b..1fb396b6f8f 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.15 1999/11/11 01:27:17 brianp Exp $ */ +/* $Id: glu.h,v 1.16 1999/11/11 03:21:43 kendallb Exp $ */ /* * Mesa 3-D graphics library @@ -134,7 +134,7 @@ extern "C" { /* NURBS */ #define GLU_AUTO_LOAD_MATRIX 100200 #define GLU_CULLING 100201 -#define GLU_PARAMETRIC_TOLERANC 100202 +#define GLU_PARAMETRIC_TOLERANCE 100202 #define GLU_SAMPLING_TOLERANCE 100203 #define GLU_DISPLAY_MODE 100204 #define GLU_SAMPLING_METHOD 100205 diff --git a/src/glu/mesa/nurbs.c b/src/glu/mesa/nurbs.c index 65bc6f8acb7..0ce9a449873 100644 --- a/src/glu/mesa/nurbs.c +++ b/src/glu/mesa/nurbs.c @@ -1,4 +1,4 @@ -/* $Id: nurbs.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ +/* $Id: nurbs.c,v 1.2 1999/11/11 03:21:43 kendallb Exp $ */ /* * Mesa 3-D graphics library @@ -23,8 +23,25 @@ /* * $Log: nurbs.c,v $ - * Revision 1.1 1999/08/19 00:55:42 jtg - * Initial revision + * Revision 1.2 1999/11/11 03:21:43 kendallb + * + * . Updated GL/gl.h with GLCALLACKP and GLAPIENTRYP macros for compatibility + * with the IBM VisualAge C++ compiler. Eventually some more code will be + * needed in the headers to enable the reversal of (__stdcall*) to (*__stdcall) + * for the IBM compilers, however we currently build using our own header files + * that already handle this. + * + * . Changed instances of (GLCALLBACK*) to GLCALLBACKP for compatibility + * with the IBM VisualAge C++ compiler in src-glu. + * + * . Misc cleanups for warnings generated with Watcom C++ in src-glu. Compiles + * with 0 warnings now. + * + * . tess_hash.c: line 244 - Why is this function stubbed out? I removed the + * code with a #if 0 to avoid a compiler warning, but it looks dangerous. + * + * Revision 1.1.1.1 1999/08/19 00:55:42 jtg + * Imported sources * * Revision 1.14 1999/01/03 03:23:15 brianp * now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump) @@ -600,12 +617,12 @@ void GLAPIENTRY gluNurbsSurface( GLUnurbsObj *nobj, void GLAPIENTRY -gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, void (GLCALLBACK *fn)()) +gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, void (GLCALLBACKP fn)()) { #if defined(__CYGWIN32__) || defined(OPENSTEP) nobj->error_callback = (void(*)(GLenum))fn; #else - nobj->error_callback = (void(GLCALLBACK*)(GLenum))fn; + nobj->error_callback = (void(GLCALLBACKP)(GLenum))fn; #endif if(which!=GLU_ERROR) diff --git a/src/glu/mesa/nurbs.h b/src/glu/mesa/nurbs.h index fc2b4f7d557..3e38ea40068 100644 --- a/src/glu/mesa/nurbs.h +++ b/src/glu/mesa/nurbs.h @@ -1,4 +1,4 @@ -/* $Id: nurbs.h,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ +/* $Id: nurbs.h,v 1.2 1999/11/11 03:21:43 kendallb Exp $ */ /* * Mesa 3-D graphics library @@ -23,8 +23,25 @@ /* * $Log: nurbs.h,v $ - * Revision 1.1 1999/08/19 00:55:42 jtg - * Initial revision + * Revision 1.2 1999/11/11 03:21:43 kendallb + * + * . Updated GL/gl.h with GLCALLACKP and GLAPIENTRYP macros for compatibility + * with the IBM VisualAge C++ compiler. Eventually some more code will be + * needed in the headers to enable the reversal of (__stdcall*) to (*__stdcall) + * for the IBM compilers, however we currently build using our own header files + * that already handle this. + * + * . Changed instances of (GLCALLBACK*) to GLCALLBACKP for compatibility + * with the IBM VisualAge C++ compiler in src-glu. + * + * . Misc cleanups for warnings generated with Watcom C++ in src-glu. Compiles + * with 0 warnings now. + * + * . tess_hash.c: line 244 - Why is this function stubbed out? I removed the + * code with a #if 0 to avoid a compiler warning, but it looks dangerous. + * + * Revision 1.1.1.1 1999/08/19 00:55:42 jtg + * Imported sources * * Revision 1.5 1999/02/27 13:55:31 brianp * fixed BeOS-related GLU typedef problems @@ -151,7 +168,7 @@ typedef struct struct GLUnurbs { GLboolean culling; GLenum error; - void (GLCALLBACK *error_callback)( GLenum err ); + void (GLCALLBACKP error_callback)( GLenum err ); GLenum display_mode; GLU_nurbs_enum nurbs_type; GLboolean auto_load_matrix; diff --git a/src/glu/mesa/quadric.c b/src/glu/mesa/quadric.c index 4698e795b15..8bdf7cc0852 100644 --- a/src/glu/mesa/quadric.c +++ b/src/glu/mesa/quadric.c @@ -1,4 +1,4 @@ -/* $Id: quadric.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ +/* $Id: quadric.c,v 1.2 1999/11/11 03:21:43 kendallb Exp $ */ /* * Mesa 3-D graphics library @@ -23,8 +23,25 @@ /* * $Log: quadric.c,v $ - * Revision 1.1 1999/08/19 00:55:42 jtg - * Initial revision + * Revision 1.2 1999/11/11 03:21:43 kendallb + * + * . Updated GL/gl.h with GLCALLACKP and GLAPIENTRYP macros for compatibility + * with the IBM VisualAge C++ compiler. Eventually some more code will be + * needed in the headers to enable the reversal of (__stdcall*) to (*__stdcall) + * for the IBM compilers, however we currently build using our own header files + * that already handle this. + * + * . Changed instances of (GLCALLBACK*) to GLCALLBACKP for compatibility + * with the IBM VisualAge C++ compiler in src-glu. + * + * . Misc cleanups for warnings generated with Watcom C++ in src-glu. Compiles + * with 0 warnings now. + * + * . tess_hash.c: line 244 - Why is this function stubbed out? I removed the + * code with a #if 0 to avoid a compiler warning, but it looks dangerous. + * + * Revision 1.1.1.1 1999/08/19 00:55:42 jtg + * Imported sources * * Revision 1.19 1999/02/27 13:55:31 brianp * fixed BeOS-related GLU typedef problems @@ -105,17 +122,6 @@ -#ifndef M_PI -# define M_PI (3.1415926) -#endif - - -/* - * Convert degrees to radians: - */ -#define DEG_TO_RAD(A) ((A)*(M_PI/180.0)) - - /* * Sin and Cos for degree angles: */ @@ -135,7 +141,7 @@ struct GLUquadric { GLenum Orientation; /* GLU_INSIDE or GLU_OUTSIDE */ GLboolean TextureFlag; /* Generate texture coords? */ GLenum Normals; /* GLU_NONE, GLU_FLAT, or GLU_SMOOTH */ - void (GLCALLBACK *ErrorFunc)(GLenum err); /* Error handler callback function */ + void (GLCALLBACKP ErrorFunc)(GLenum err); /* Error handler callback function */ }; @@ -221,7 +227,7 @@ void GLAPIENTRY gluQuadricOrientation( GLUquadricObj *quadObject, * Set the error handler callback function. */ void GLAPIENTRY gluQuadricCallback( GLUquadricObj *qobj, - GLenum which, void (GLCALLBACK *fn)() ) + GLenum which, void (GLCALLBACKP fn)() ) { /* * UGH, this is a mess! I thought ANSI was a standard. @@ -232,13 +238,13 @@ void GLAPIENTRY gluQuadricCallback( GLUquadricObj *qobj, #elif defined(OPENSTEP) qobj->ErrorFunc = (void(*)(GLenum))fn; #elif defined(_WIN32) - qobj->ErrorFunc = (void(GLCALLBACK*)(int))fn; + qobj->ErrorFunc = (void(GLCALLBACKP)(int))fn; #elif defined(__STORM__) - qobj->ErrorFunc = (void(GLCALLBACK*)(GLenum))fn; + qobj->ErrorFunc = (void(GLCALLBACKP)(GLenum))fn; #elif defined(__BEOS__) qobj->ErrorFunc = (void(*)(GLenum))fn; #else - qobj->ErrorFunc = (void(GLCALLBACK*)())fn; + qobj->ErrorFunc = (void(GLCALLBACKP)())fn; #endif } } diff --git a/src/glu/mesa/tess.c b/src/glu/mesa/tess.c index 6daa7220542..7f1b5a56823 100644 --- a/src/glu/mesa/tess.c +++ b/src/glu/mesa/tess.c @@ -1,4 +1,4 @@ -/* $Id: tess.c,v 1.20 1999/11/05 20:36:55 gareth Exp $ */ +/* $Id: tess.c,v 1.21 1999/11/11 03:21:43 kendallb Exp $ */ /* * Mesa 3-D graphics library @@ -388,60 +388,60 @@ void GLAPIENTRY gluTessEndPolygon( GLUtesselator *tobj ) * gluTessCallback *****************************************************************************/ void GLAPIENTRY gluTessCallback( GLUtesselator *tobj, GLenum which, - void (GLCALLBACK *fn)() ) + void (GLCALLBACKP fn)() ) { switch ( which ) { /* Register the begin callbacks. */ case GLU_TESS_BEGIN: - tobj->callbacks.begin = (void (GLCALLBACK*)(GLenum)) fn; + tobj->callbacks.begin = (void (GLCALLBACKP)(GLenum)) fn; break; case GLU_TESS_BEGIN_DATA: - tobj->callbacks.beginData = (void (GLCALLBACK*)(GLenum, void *)) fn; + tobj->callbacks.beginData = (void (GLCALLBACKP)(GLenum, void *)) fn; break; /* Register the edge flag callbacks. */ case GLU_TESS_EDGE_FLAG: - tobj->callbacks.edgeFlag = (void (GLCALLBACK*)(GLboolean)) fn; + tobj->callbacks.edgeFlag = (void (GLCALLBACKP)(GLboolean)) fn; break; case GLU_TESS_EDGE_FLAG_DATA: tobj->callbacks.edgeFlagData = - (void (GLCALLBACK*)(GLboolean, void *)) fn; + (void (GLCALLBACKP)(GLboolean, void *)) fn; break; /* Register the vertex callbacks. */ case GLU_TESS_VERTEX: - tobj->callbacks.vertex = (void (GLCALLBACK*)(void *)) fn; + tobj->callbacks.vertex = (void (GLCALLBACKP)(void *)) fn; break; case GLU_TESS_VERTEX_DATA: - tobj->callbacks.vertexData = (void (GLCALLBACK*)(void *, void *)) fn; + tobj->callbacks.vertexData = (void (GLCALLBACKP)(void *, void *)) fn; break; /* Register the end callbacks. */ case GLU_TESS_END: - tobj->callbacks.end = (void (GLCALLBACK*)(void)) fn; + tobj->callbacks.end = (void (GLCALLBACKP)(void)) fn; break; case GLU_TESS_END_DATA: - tobj->callbacks.endData = (void (GLCALLBACK*)(void *)) fn; + tobj->callbacks.endData = (void (GLCALLBACKP)(void *)) fn; break; /* Register the error callbacks. */ case GLU_TESS_ERROR: - tobj->callbacks.error = (void (GLCALLBACK*)(GLenum)) fn; + tobj->callbacks.error = (void (GLCALLBACKP)(GLenum)) fn; break; case GLU_TESS_ERROR_DATA: - tobj->callbacks.errorData = (void (GLCALLBACK*)(GLenum, void *)) fn; + tobj->callbacks.errorData = (void (GLCALLBACKP)(GLenum, void *)) fn; break; /* Register the combine callbacks. */ case GLU_TESS_COMBINE: tobj->callbacks.combine = - (void (GLCALLBACK*)(GLdouble[3], void *[4], + (void (GLCALLBACKP)(GLdouble[3], void *[4], GLfloat [4], void **)) fn; break; case GLU_TESS_COMBINE_DATA: tobj->callbacks.combineData = - (void (GLCALLBACK*)(GLdouble[3], void *[4], GLfloat [4], + (void (GLCALLBACKP)(GLdouble[3], void *[4], GLfloat [4], void **, void *)) fn; break; @@ -597,19 +597,19 @@ void tess_error_callback( GLUtesselator *tobj, GLenum errnum ) *****************************************************************************/ static void init_callbacks( tess_callbacks_t *callbacks ) { - callbacks->begin = ( void (GLCALLBACK*)(GLenum) ) NULL; - callbacks->beginData = ( void (GLCALLBACK*)(GLenum, void *) ) NULL; - callbacks->edgeFlag = ( void (GLCALLBACK*)(GLboolean) ) NULL; - callbacks->edgeFlagData = ( void (GLCALLBACK*)(GLboolean, void *) ) NULL; - callbacks->vertex = ( void (GLCALLBACK*)(void *) ) NULL; - callbacks->vertexData = ( void (GLCALLBACK*)(void *, void *) ) NULL; - callbacks->end = ( void (GLCALLBACK*)(void) ) NULL; - callbacks->endData = ( void (GLCALLBACK*)(void *) ) NULL; - callbacks->error = ( void (GLCALLBACK*)(GLenum) ) NULL; - callbacks->errorData = ( void (GLCALLBACK*)(GLenum, void *) ) NULL; - callbacks->combine = ( void (GLCALLBACK*)(GLdouble [3], void *[4], + callbacks->begin = ( void (GLCALLBACKP)(GLenum) ) NULL; + callbacks->beginData = ( void (GLCALLBACKP)(GLenum, void *) ) NULL; + callbacks->edgeFlag = ( void (GLCALLBACKP)(GLboolean) ) NULL; + callbacks->edgeFlagData = ( void (GLCALLBACKP)(GLboolean, void *) ) NULL; + callbacks->vertex = ( void (GLCALLBACKP)(void *) ) NULL; + callbacks->vertexData = ( void (GLCALLBACKP)(void *, void *) ) NULL; + callbacks->end = ( void (GLCALLBACKP)(void) ) NULL; + callbacks->endData = ( void (GLCALLBACKP)(void *) ) NULL; + callbacks->error = ( void (GLCALLBACKP)(GLenum) ) NULL; + callbacks->errorData = ( void (GLCALLBACKP)(GLenum, void *) ) NULL; + callbacks->combine = ( void (GLCALLBACKP)(GLdouble [3], void *[4], GLfloat [4], void **) ) NULL; - callbacks->combineData = ( void (GLCALLBACK*)(GLdouble [3], void *[4], + callbacks->combineData = ( void (GLCALLBACKP)(GLdouble [3], void *[4], GLfloat [4], void **, void *) ) NULL; } -- cgit v1.2.3 From 9ad72cd9b11b3a81379f61ec582f4cf0962a921d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 11 Nov 1999 17:48:32 +0000 Subject: removed redundant extension prototypes --- include/GL/gl.h | 411 +------------------------------------------------------- 1 file changed, 2 insertions(+), 409 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 68fb1b3adba..22477924dee 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.19 1999/11/11 03:21:43 kendallb Exp $ */ +/* $Id: gl.h,v 1.20 1999/11/11 17:48:32 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -769,125 +769,6 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_STACK_UNDERFLOW 0x0504 #define GL_OUT_OF_MEMORY 0x0505 -/* - * Extensions - */ - -/* GL_EXT_blend_minmax and GL_EXT_blend_color */ -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_EQUATION_EXT 0x8009 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B -#define GL_BLEND_COLOR_EXT 0x8005 - -/* GL_EXT_polygon_offset */ -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 - -/* GL_EXT_vertex_array */ -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 - -/* GL_EXT_texture_object */ -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 - -/* GL_EXT_texture3D */ -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A - -/* GL_EXT_paletted_texture */ -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 -#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 - -/* GL_EXT_shared_texture_palette */ -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB - -/* GL_EXT_point_parameters */ -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 - -/* GL_EXT_rescale_normal */ -#define GL_RESCALE_NORMAL_EXT 0x803A - -/* GL_EXT_abgr */ -#define GL_ABGR_EXT 0x8000 - -/* GL_EXT_stencil_wrap */ -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 - -/* GL_SGIS_texture_edge_clamp */ -#define GL_CLAMP_TO_EDGE_SGIS 0x812F - -/* GL_INGR_blend_func_separate */ -#define GL_BLEND_DST_RGB_INGR 0x80C8 -#define GL_BLEND_SRC_RGB_INGR 0x80C9 -#define GL_BLEND_DST_ALPHA_INGR 0x80CA -#define GL_BLEND_SRC_ALPHA_INGR 0x80CB /* OpenGL 1.2 */ #define GL_RESCALE_NORMAL 0x803A @@ -916,43 +797,6 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_TEXTURE_BASE_LEVEL 0x813C #define GL_TEXTURE_MAX_LEVEL 0x813D -/* GL_ARB_multitexture */ -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 - /* * OpenGL 1.2 imaging subset (NOT IMPLEMENTED BY MESA) */ @@ -1033,40 +877,6 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_FUNC_REVERSE_SUBTRACT 0x800B #define GL_BLEND_COLOR 0x8005 -/* GL_NV_texgen_reflection (nVidia) */ -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 - -/* GL_PGI_misc_hints */ -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 -#define GL_STRICT_LIGHTING_HINT_PGI 107031 -#define GL_STRICT_SCISSOR_HINT_PGI 107032 -#define GL_FULL_STIPPLE_HINT_PGI 107033 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 -#define GL_CONSERVE_MEMORY_HINT_PGI 107005 -#define GL_RECLAIM_MEMORY_HINT_PGI 107006 -#define GL_ALWAYS_FAST_HINT_PGI 107020 -#define GL_ALWAYS_SOFT_HINT_PGI 107021 -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 -#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 -#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 -#define GL_ALLOW_DRAW_SPN_HINT_PGI 107024 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 -#define GL_CLIP_NEAR_HINT_PGI 107040 -#define GL_CLIP_FAR_HINT_PGI 107041 -#define GL_WIDE_LINE_HINT_PGI 107042 -#define GL_BACK_NORMALS_HINT_PGI 107043 -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 - -/* GL_EXT_compiled_vertex_array */ -#define GL_ARRAY_ELEMENT_LOCK_FIRST_SGI 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_SGI 0x81A9 - -/* GL_EXT_clip_volume_hint */ -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F - /* glPush/PopAttrib bits */ #define GL_CURRENT_BIT 0x00000001 @@ -1829,217 +1639,6 @@ GLAPI void GLAPIENTRY glPopName( void ); -/* - * Extensions - */ - -/* GL_EXT_blend_minmax */ -GLAPI void GLAPIENTRY glBlendEquationEXT( GLenum mode ); - - - -/* GL_EXT_blend_color */ -GLAPI void GLAPIENTRY glBlendColorEXT( GLclampf red, GLclampf green, - GLclampf blue, GLclampf alpha ); - - - -/* GL_EXT_polygon_offset */ -GLAPI void GLAPIENTRY glPolygonOffsetEXT( GLfloat factor, GLfloat bias ); - - - -/* GL_EXT_vertex_array */ - -GLAPI void GLAPIENTRY glVertexPointerEXT( GLint size, GLenum type, - GLsizei stride, - GLsizei count, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glNormalPointerEXT( GLenum type, GLsizei stride, - GLsizei count, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glColorPointerEXT( GLint size, GLenum type, - GLsizei stride, - GLsizei count, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glIndexPointerEXT( GLenum type, GLsizei stride, - GLsizei count, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glTexCoordPointerEXT( GLint size, GLenum type, - GLsizei stride, GLsizei count, - const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glEdgeFlagPointerEXT( GLsizei stride, GLsizei count, - const GLboolean *ptr ); - -GLAPI void GLAPIENTRY glGetPointervEXT( GLenum pname, void **params ); - -GLAPI void GLAPIENTRY glArrayElementEXT( GLint i ); - -GLAPI void GLAPIENTRY glDrawArraysEXT( GLenum mode, GLint first, - GLsizei count ); - - - -/* GL_EXT_texture_object */ - -GLAPI void GLAPIENTRY glGenTexturesEXT( GLsizei n, GLuint *textures ); - -GLAPI void GLAPIENTRY glDeleteTexturesEXT( GLsizei n, const GLuint *textures); - -GLAPI void GLAPIENTRY glBindTextureEXT( GLenum target, GLuint texture ); - -GLAPI void GLAPIENTRY glPrioritizeTexturesEXT( GLsizei n, - const GLuint *textures, - const GLclampf *priorities ); - -GLAPI GLboolean GLAPIENTRY glAreTexturesResidentEXT( GLsizei n, - const GLuint *textures, - GLboolean *residences ); - -GLAPI GLboolean GLAPIENTRY glIsTextureEXT( GLuint texture ); - - - -/* GL_EXT_texture3D */ - -GLAPI void GLAPIENTRY glTexImage3DEXT( GLenum target, GLint level, - GLenum internalFormat, - GLsizei width, GLsizei height, - GLsizei depth, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glTexSubImage3DEXT( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint zoffset, GLsizei width, - GLsizei height, GLsizei depth, - GLenum format, - GLenum type, const GLvoid *pixels); - -GLAPI void GLAPIENTRY glCopyTexSubImage3DEXT( GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint zoffset, GLint x, - GLint y, GLsizei width, - GLsizei height ); - - - -/* GL_EXT_color_table */ - -GLAPI void GLAPIENTRY glColorTableEXT( GLenum target, GLenum internalformat, - GLsizei width, GLenum format, - GLenum type, const GLvoid *table ); - -GLAPI void GLAPIENTRY glColorSubTableEXT( GLenum target, - GLsizei start, GLsizei count, - GLenum format, GLenum type, - const GLvoid *data ); - -GLAPI void GLAPIENTRY glGetColorTableEXT( GLenum target, GLenum format, - GLenum type, GLvoid *table ); - -GLAPI void GLAPIENTRY glGetColorTableParameterfvEXT( GLenum target, - GLenum pname, - GLfloat *params ); - -GLAPI void GLAPIENTRY glGetColorTableParameterivEXT( GLenum target, - GLenum pname, - GLint *params ); - - -/* GL_ARB_multitexture */ - -GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture); -GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture); -GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s); -GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s); -GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s); -GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s); -GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); -GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); -GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); -GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); -GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); -GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); - - - -/* GL_EXT_point_parameters */ -GLAPI void GLAPIENTRY glPointParameterfEXT( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glPointParameterfvEXT( GLenum pname, - const GLfloat *params ); - - - -/* GL_INGR_blend_func_separate */ -GLAPI void GLAPIENTRY glBlendFuncSeparateINGR( GLenum sfactorRGB, - GLenum dfactorRGB, - GLenum sfactorAlpha, - GLenum dfactorAlpha ); - - - -/* GL_MESA_window_pos */ - -GLAPI void GLAPIENTRY glWindowPos2iMESA( GLint x, GLint y ); -GLAPI void GLAPIENTRY glWindowPos2sMESA( GLshort x, GLshort y ); -GLAPI void GLAPIENTRY glWindowPos2fMESA( GLfloat x, GLfloat y ); -GLAPI void GLAPIENTRY glWindowPos2dMESA( GLdouble x, GLdouble y ); - -GLAPI void GLAPIENTRY glWindowPos2ivMESA( const GLint *p ); -GLAPI void GLAPIENTRY glWindowPos2svMESA( const GLshort *p ); -GLAPI void GLAPIENTRY glWindowPos2fvMESA( const GLfloat *p ); -GLAPI void GLAPIENTRY glWindowPos2dvMESA( const GLdouble *p ); - -GLAPI void GLAPIENTRY glWindowPos3iMESA( GLint x, GLint y, GLint z ); -GLAPI void GLAPIENTRY glWindowPos3sMESA( GLshort x, GLshort y, GLshort z ); -GLAPI void GLAPIENTRY glWindowPos3fMESA( GLfloat x, GLfloat y, GLfloat z ); -GLAPI void GLAPIENTRY glWindowPos3dMESA( GLdouble x, GLdouble y, GLdouble z ); - -GLAPI void GLAPIENTRY glWindowPos3ivMESA( const GLint *p ); -GLAPI void GLAPIENTRY glWindowPos3svMESA( const GLshort *p ); -GLAPI void GLAPIENTRY glWindowPos3fvMESA( const GLfloat *p ); -GLAPI void GLAPIENTRY glWindowPos3dvMESA( const GLdouble *p ); - -GLAPI void GLAPIENTRY glWindowPos4iMESA( GLint x, GLint y, GLint z, GLint w ); -GLAPI void GLAPIENTRY glWindowPos4sMESA( GLshort x, GLshort y, GLshort z, GLshort w ); -GLAPI void GLAPIENTRY glWindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); -GLAPI void GLAPIENTRY glWindowPos4dMESA( GLdouble x, GLdouble y, GLdouble z, GLdouble w); - -GLAPI void GLAPIENTRY glWindowPos4ivMESA( const GLint *p ); -GLAPI void GLAPIENTRY glWindowPos4svMESA( const GLshort *p ); -GLAPI void GLAPIENTRY glWindowPos4fvMESA( const GLfloat *p ); -GLAPI void GLAPIENTRY glWindowPos4dvMESA( const GLdouble *p ); - - -/* GL_MESA_resize_buffers */ - -GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); - - /* 1.2 functions */ GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ); @@ -2177,11 +1776,6 @@ GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, -/* GL_EXT_compiled_vertex_array */ -GLAPI void GLAPIENTRY glLockArraysEXT( GLint first, GLsizei count ); -GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); - - /* * XXX these extensions may eventually be moved into a new glext.h file @@ -2260,8 +1854,7 @@ GLAPI void GLAPIENTRY glBlendEquationEXT( GLenum mode ); #define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 #define GL_BLEND_COLOR_EXT 0x8005 -GLAPI void GLAPIENTRY glBlendColorEXT( GLclampf red, GLclampf green, - GLclampf blue, GLclampf alpha ); +GLAPI void GLAPIENTRY glBlendColorEXT( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); #endif /* GL_EXT_blend_color */ -- cgit v1.2.3 From b95d252c347e14825cd61b28223040cfc5d0e7de Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 12 Nov 1999 02:07:56 +0000 Subject: added GL_EXT_texture_env_add extension --- include/GL/gl.h | 13 ++++++++++++- src/mesa/main/extensions.c | 3 ++- src/mesa/main/texstate.c | 17 ++++++++++++----- 3 files changed, 26 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 22477924dee..a0f71bed0b9 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.20 1999/11/11 17:48:32 brianp Exp $ */ +/* $Id: gl.h,v 1.21 1999/11/12 02:08:59 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2308,6 +2308,17 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); +/* + * GL_EXT_texture_env_add + */ +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 + +/* No new tokens or functions */ + +#endif /* GL_EXT_texture_env_add */ + + #if defined(__BEOS__) || defined(__QUICKDRAW__) diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index c8b154d0613..98a7551191d 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -1,4 +1,4 @@ -/* $Id: extensions.c,v 1.12 1999/11/12 02:05:46 brianp Exp $ */ +/* $Id: extensions.c,v 1.13 1999/11/12 02:07:56 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -74,6 +74,7 @@ static struct { int enabled; const char *name; } default_extensions[] = { { DEFAULT_ON, "GL_EXT_compiled_vertex_array" }, { DEFAULT_OFF, "GL_EXT_vertex_array_set" }, { DEFAULT_ON, "GL_EXT_clip_volume_hint" }, + { DEFAULT_ON, "GL_EXT_texture_env_add" }, }; diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 7e5ce3085a0..fa893e7f2d7 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1,4 +1,4 @@ -/* $Id: texstate.c,v 1.5 1999/11/11 01:22:28 brianp Exp $ */ +/* $Id: texstate.c,v 1.6 1999/11/12 02:07:56 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -31,6 +31,7 @@ #include "glheader.h" #include "context.h" #include "enums.h" +#include "extensions.h" #include "macros.h" #include "matrix.h" #include "texobj.h" @@ -84,10 +85,16 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) if (pname==GL_TEXTURE_ENV_MODE) { GLenum mode = (GLenum) (GLint) *param; switch (mode) { - case GL_MODULATE: - case GL_BLEND: - case GL_DECAL: - case GL_REPLACE: + case GL_ADD: + if (!gl_extension_is_enabled(ctx, "GL_EXT_texture_env_add")) { + gl_error(ctx, GL_INVALID_ENUM, "glTexEnv(param)"); + return; + } + /* FALL-THROUGH */ + case GL_MODULATE: + case GL_BLEND: + case GL_DECAL: + case GL_REPLACE: /* A small optimization for drivers */ if (texUnit->EnvMode == mode) return; -- cgit v1.2.3 From e23e2759fc67973c0d2e3318f79837f88f8bad0d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 15 Nov 1999 14:26:07 +0000 Subject: changed multi-include guard symbol --- include/GL/gl.h | 10 ++++------ include/GL/glu.h | 8 ++++---- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index a0f71bed0b9..e27a39dc67a 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.21 1999/11/12 02:08:59 brianp Exp $ */ +/* $Id: gl.h,v 1.22 1999/11/15 14:26:07 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,10 +25,8 @@ */ - - -#ifndef GL_H -#define GL_H +#ifndef __gl_h_ +#define __gl_h_ #if defined(USE_MGL_NAMESPACE) #include "gl_mangle.h" @@ -2338,4 +2336,4 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); } #endif -#endif +#endif /* __gl_h_ */ diff --git a/include/GL/glu.h b/include/GL/glu.h index 1fb396b6f8f..5fef2512b68 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.16 1999/11/11 03:21:43 kendallb Exp $ */ +/* $Id: glu.h,v 1.17 1999/11/15 14:26:07 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -22,8 +22,8 @@ */ -#ifndef GLU_H -#define GLU_H +#ifndef __glu_h__ +#define __glu_h__ #if defined(USE_MGL_NAMESPACE) @@ -483,4 +483,4 @@ GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name ); #endif -#endif +#endif /* __glu_h__ */ -- cgit v1.2.3 From 36d8d7ae815dc78e56ab64379d86f9e85b4d1c63 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 17 Nov 1999 21:19:48 +0000 Subject: fixed some glitches (Eero Pajarre) --- include/GL/glut.h | 5 ++--- include/GL/mesa_wgl.h | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/GL/glut.h b/include/GL/glut.h index 0c17f65b2cd..225bb87e525 100644 --- a/include/GL/glut.h +++ b/include/GL/glut.h @@ -152,7 +152,7 @@ typedef unsigned long COLORREF; # define wglUseFontOutlines wglUseFontOutlinesA # endif /* !UNICODE */ typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR; -typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT +typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT; # pragma warning( push ) # pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */ # define WGLAPI __declspec(dllimport) @@ -183,7 +183,7 @@ WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, u 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 long,LPPIXELFORMATDESCRIPTOR); +WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR); WGLAPI int GLAPIENTRY GetPixelFormat(HDC); WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *); # undef WGLAPI @@ -739,7 +739,6 @@ GLUTAPI int GLUTAPIENTRY glutGameModeGet(GLenum mode); #ifdef __cplusplus } - #endif #if 0 diff --git a/include/GL/mesa_wgl.h b/include/GL/mesa_wgl.h index 40bbe573542..36215e81d5a 100644 --- a/include/GL/mesa_wgl.h +++ b/include/GL/mesa_wgl.h @@ -1,10 +1,17 @@ /* prototypes for the Mesa WGL functions */ /* relocated here so that I could make GLUT get them properly */ -#ifndef GL_H -# include +#ifndef _mesa_wgl_h_ +#define _mesa_wgl_h_ + + +#include + +#ifdef __cplusplus +extern "C" { #endif + #ifdef _MSC_VER # pragma warning( push ) # pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */ @@ -37,10 +44,17 @@ WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, u 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,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_ */ -- cgit v1.2.3 From a65efe4b75683d1cced3ff27e732cd5c095661fa Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 18 Nov 1999 20:23:31 +0000 Subject: reordered the extensions and numbered them --- include/GL/gl.h | 449 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 224 insertions(+), 225 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index e27a39dc67a..8b2fcd1dc59 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.22 1999/11/15 14:26:07 brianp Exp $ */ +/* $Id: gl.h,v 1.23 1999/11/18 20:23:31 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1781,67 +1781,19 @@ GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, /* - * GL_EXT_point_parameters + * GL_EXT_abgr (number 1) */ -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 - -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 - -GLAPI void GLAPIENTRY glPointParameterfEXT( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glPointParameterfvEXT( GLenum pname, const GLfloat *params ); - -#endif /* GL_EXT_point_parameters */ - - - -/* - * GL_EXT_blend_minmax - */ -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 - -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_BLEND_EQUATION_EXT 0x8009 - -GLAPI void GLAPIENTRY glBlendEquationEXT( GLenum mode ); - -#endif /* GL_EXT_blend_minmax */ - - - -/* - * GL_EXT_blend_subtract (requires GL_EXT_blend_max ) - */ -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 - -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B - -#endif /* GL_EXT_blend_subtract */ - - - -/* - * GL_EXT_blend_logic_op - */ -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 -/* No new tokens or functions */ +#define GL_ABGR_EXT 0x8000 -#endif /* GL_EXT_blend_logic_op */ +#endif /* GL_EXT_abgr */ /* - * GL_EXT_blend_color + * GL_EXT_blend_color (number 2) */ #ifndef GL_EXT_blend_color #define GL_EXT_blend_color 1 @@ -1859,105 +1811,23 @@ GLAPI void GLAPIENTRY glBlendColorEXT( GLclampf red, GLclampf green, GLclampf bl /* - * GL_EXT_stencil_wrap - */ -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 - -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 - -#endif /* GL_EXT_stencil_wrap */ - - - -/* - * GL_EXT_clip_volume_hint - */ -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 - -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F - -#endif /* GL_EXT_clip_volume_hint */ - - - -/* - * GL_EXT_abgr + * GL_EXT_polygon_offset (number 3) */ -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 - -#define GL_ABGR_EXT 0x8000 - -#endif /* GL_EXT_abgr */ - - - -/* - * GL_EXT_rescale_normal - */ -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 - -#define GL_RESCALE_NORMAL_EXT 0x803A - -#endif /* GL_EXT_rescale_normal */ - - - -/* - * GL_EXT_paletted_texture - */ -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 - -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 -#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 - -GLAPI void GLAPIENTRY glColorTableEXT( GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table ); - -GLAPI void GLAPIENTRY glColorSubTableEXT( GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data ); - -GLAPI void GLAPIENTRY glGetColorTableEXT( GLenum target, GLenum format, GLenum type, GLvoid *table ); - -GLAPI void GLAPIENTRY glGetColorTableParameterfvEXT( GLenum target, GLenum pname, GLfloat *params ); - -GLAPI void GLAPIENTRY glGetColorTableParameterivEXT( GLenum target, GLenum pname, GLint *params ); - -#endif /* GL_EXT_paletted_texture */ - - +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 -/* - * GL_EXT_shared_texture_palette (requires GL_EXT_paletted_texture) - */ -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +GLAPI void GLAPIENTRY glPolygonOffsetEXT( GLfloat factor, GLfloat bias ); -#endif /* GL_EXT_shared_texture_palette */ +#endif /* GL_EXT_polygon_offset */ /* - * GL_EXT_texture3D + * GL_EXT_texture3D (number 6) */ #ifndef GL_EXT_texture3D #define GL_EXT_texture3D 1 @@ -1983,9 +1853,8 @@ GLAPI void GLAPIENTRY glCopyTexSubImage3DEXT( GLenum target, GLint level, GLint - /* - * GL_EXT_texture_object + * GL_EXT_texture_object (number 20) */ #ifndef GL_EXT_texture_object #define GL_EXT_texture_object 1 @@ -2012,23 +1881,19 @@ GLAPI GLboolean GLAPIENTRY glIsTextureEXT( GLuint texture ); /* - * GL_EXT_polygon_offset + * GL_EXT_rescale_normal (number 27) */ -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 - -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 -GLAPI void GLAPIENTRY glPolygonOffsetEXT( GLfloat factor, GLfloat bias ); +#define GL_RESCALE_NORMAL_EXT 0x803A -#endif /* GL_EXT_polygon_offset */ +#endif /* GL_EXT_rescale_normal */ /* - * GL_EXT_vertex_array + * GL_EXT_vertex_array (number 30) */ #ifndef GL_EXT_vertex_array #define GL_EXT_vertex_array 1 @@ -2089,7 +1954,160 @@ GLAPI void GLAPIENTRY glDrawArraysEXT( GLenum mode, GLint first, GLsizei count ) /* - * GL_EXT_compiled_vertex_array + * GL_SGIS_texture_edge_clamp (number 35) + */ +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_SGIS 0x812F + +#endif /* GL_SGIS_texture_edge_clamp */ + + + +/* + * GL_EXT_blend_minmax (number 37) + */ +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 + +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 + +GLAPI void GLAPIENTRY glBlendEquationEXT( GLenum mode ); + +#endif /* GL_EXT_blend_minmax */ + + + +/* + * GL_EXT_blend_subtract (number 38) (requires GL_EXT_blend_max ) + */ +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 + +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B + +#endif /* GL_EXT_blend_subtract */ + + + +/* + * GL_EXT_blend_logic_op (number 39) + */ +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 + +/* No new tokens or functions */ + +#endif /* GL_EXT_blend_logic_op */ + + + +/* + * GL_EXT_point_parameters (number 54) + */ +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 + +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 + +GLAPI void GLAPIENTRY glPointParameterfEXT( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glPointParameterfvEXT( GLenum pname, const GLfloat *params ); + +#endif /* GL_EXT_point_parameters */ + + + +/* + * GL_PGI_misc_hints (number 77) + */ +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 + +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 +#define GL_STRICT_LIGHTING_HINT_PGI 107031 +#define GL_STRICT_SCISSOR_HINT_PGI 107032 +#define GL_FULL_STIPPLE_HINT_PGI 107033 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 +#define GL_CONSERVE_MEMORY_HINT_PGI 107005 +#define GL_RECLAIM_MEMORY_HINT_PGI 107006 +#define GL_ALWAYS_FAST_HINT_PGI 107020 +#define GL_ALWAYS_SOFT_HINT_PGI 107021 +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 +#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 +#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 +#define GL_ALLOW_DRAW_SPN_HINT_PGI 107024 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 +#define GL_CLIP_NEAR_HINT_PGI 107040 +#define GL_CLIP_FAR_HINT_PGI 107041 +#define GL_WIDE_LINE_HINT_PGI 107042 +#define GL_BACK_NORMALS_HINT_PGI 107043 +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 + +#endif /* GL_PGI_misc_hints */ + + + +/* + * GL_EXT_paletted_texture (number 78) + */ +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 + +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 +#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 + +GLAPI void GLAPIENTRY glColorTableEXT( GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table ); + +GLAPI void GLAPIENTRY glColorSubTableEXT( GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data ); + +GLAPI void GLAPIENTRY glGetColorTableEXT( GLenum target, GLenum format, GLenum type, GLvoid *table ); + +GLAPI void GLAPIENTRY glGetColorTableParameterfvEXT( GLenum target, GLenum pname, GLfloat *params ); + +GLAPI void GLAPIENTRY glGetColorTableParameterivEXT( GLenum target, GLenum pname, GLint *params ); + +#endif /* GL_EXT_paletted_texture */ + + + +/* + * GL_EXT_clip_volume_hint (number 79) + */ +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 + +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F + +#endif /* GL_EXT_clip_volume_hint */ + + + +/* + * GL_EXT_compiled_vertex_array (number 97) */ #ifndef GL_EXT_compiled_vertex_array #define GL_EXT_compiled_vertex_array 1 @@ -2105,20 +2123,32 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); /* - * GL_NV_texgen_reflection + * GL_EXT_shared_texture_palette (number 141) (req's GL_EXT_paletted_texture) */ -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB -#endif /* GL_NV_texgen_reflection */ +#endif /* GL_EXT_shared_texture_palette */ /* - * GL_INGR_blend_func_separate + * GL_EXT_stencil_wrap (number 176) + */ +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 + +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 + +#endif /* GL_EXT_stencil_wrap */ + + + +/* + * GL_INGR_blend_func_separate (EXT number 173) */ #ifndef GL_INGR_blend_func_separate #define GL_INGR_blend_func_separate 1 @@ -2135,7 +2165,32 @@ GLAPI void GLAPIENTRY glBlendFuncSeparateINGR( GLenum sfactorRGB, GLenum dfactor /* - * GL_ARB_multitexture + * GL_NV_texgen_reflection (number 179) + */ +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 + +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 + +#endif /* GL_NV_texgen_reflection */ + + + +/* + * GL_EXT_texture_env_add (number 185) + */ +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 + +/* No new tokens or functions */ + +#endif /* GL_EXT_texture_env_add */ + + + +/* + * GL_ARB_multitexture (no number) */ #ifndef GL_ARB_multitexture #define GL_ARB_multitexture 1 @@ -2216,51 +2271,7 @@ GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); /* - * GL_SGIS_texture_edge_clamp - */ -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 - -#define GL_CLAMP_TO_EDGE_SGIS 0x812F - -#endif /* GL_SGIS_texture_edge_clamp */ - - - -/* - * GL_PGI_misc_hints - */ -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 - -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 -#define GL_STRICT_LIGHTING_HINT_PGI 107031 -#define GL_STRICT_SCISSOR_HINT_PGI 107032 -#define GL_FULL_STIPPLE_HINT_PGI 107033 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 -#define GL_CONSERVE_MEMORY_HINT_PGI 107005 -#define GL_RECLAIM_MEMORY_HINT_PGI 107006 -#define GL_ALWAYS_FAST_HINT_PGI 107020 -#define GL_ALWAYS_SOFT_HINT_PGI 107021 -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 -#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 -#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 -#define GL_ALLOW_DRAW_SPN_HINT_PGI 107024 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 -#define GL_CLIP_NEAR_HINT_PGI 107040 -#define GL_CLIP_FAR_HINT_PGI 107041 -#define GL_WIDE_LINE_HINT_PGI 107042 -#define GL_BACK_NORMALS_HINT_PGI 107043 -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 - -#endif /* GL_PGI_misc_hints */ - - - -/* - * GL_MESA_window_pos + * GL_MESA_window_pos (no number) */ #ifndef GL_MESA_window_pos #define GL_MESA_window_pos 1 @@ -2295,7 +2306,7 @@ GLAPI void GLAPIENTRY glWindowPos4dvMESA( const GLdouble *p ); /* - * GL_MESA_resize_bufffers + * GL_MESA_resize_bufffers (no number) */ #ifndef GL_MESA_resize_bufffers #define GL_MESA_resize_buffers 1 @@ -2306,18 +2317,6 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); -/* - * GL_EXT_texture_env_add - */ -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 - -/* No new tokens or functions */ - -#endif /* GL_EXT_texture_env_add */ - - - #if defined(__BEOS__) || defined(__QUICKDRAW__) #pragma export off -- cgit v1.2.3 From 47cdadc6261f3b516229bdb04c56ffb6aa5c4e40 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 22 Nov 1999 14:05:44 +0000 Subject: added pragma 4615 (Eero), added copyright --- include/GL/mesa_wgl.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'include') diff --git a/include/GL/mesa_wgl.h b/include/GL/mesa_wgl.h index 36215e81d5a..6e7d287d025 100644 --- a/include/GL/mesa_wgl.h +++ b/include/GL/mesa_wgl.h @@ -1,3 +1,30 @@ +/* $Id: mesa_wgl.h,v 1.4 1999/11/22 14:05:44 brianp Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 3.1 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + /* prototypes for the Mesa WGL functions */ /* relocated here so that I could make GLUT get them properly */ @@ -13,6 +40,7 @@ extern "C" { #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 -- cgit v1.2.3 From bf3f9bdaae9f17de8ac82ec7789e4e689a6f67f2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 22 Nov 1999 21:51:53 +0000 Subject: bumped GLX version to 1.2, added glXGetCurrentDisplay() --- include/GL/glx.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 9d4c2023f8e..c4a0325d77a 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.6 1999/11/11 01:27:17 brianp Exp $ */ +/* $Id: glx.h,v 1.7 1999/11/22 21:51:53 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -49,6 +49,7 @@ extern "C" { #define GLX_VERSION_1_1 1 +#define GLX_VERSION_1_2 1 #define GLX_EXTENSION_NAME "GLX" @@ -197,6 +198,11 @@ extern const char *glXQueryServerString( Display *dpy, int screen, int name ); extern const char *glXGetClientString( Display *dpy, int name ); +/* GLX 1.2 and later */ + +extern Display *glXGetCurrentDisplay( void ); + + /* GLX_MESA_pixmap_colormap */ extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual, -- cgit v1.2.3 From 664a1f88f2e39fa52eccd7217a1f7aaa4c48f5af Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 23 Nov 1999 19:54:53 +0000 Subject: added GLX 1.3 tokens and functions --- include/GL/glx.h | 135 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 122 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index c4a0325d77a..e98f9cb8e74 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.7 1999/11/22 21:51:53 brianp Exp $ */ +/* $Id: glx.h,v 1.8 1999/11/23 19:54:53 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -50,6 +50,7 @@ extern "C" { #define GLX_VERSION_1_1 1 #define GLX_VERSION_1_2 1 +#define GLX_VERSION_1_3 1 #define GLX_EXTENSION_NAME "GLX" @@ -77,17 +78,6 @@ extern "C" { #define GLX_ACCUM_ALPHA_SIZE 17 -/* GLX_EXT_visual_info extension */ -#define GLX_X_VISUAL_TYPE_EXT 0x22 -#define GLX_TRANSPARENT_TYPE_EXT 0x23 -#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 -#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 -#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 -#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 -#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 - - - /* * Error codes returned by glXGetConfig: */ @@ -108,6 +98,73 @@ extern "C" { #define GLX_EXTENSIONS 3 +/* + * GLX 1.3 and later: + * XXX don't know the values of some of these enums! + * XXX some 1.3 enums may be missing! + */ +#define GLX_CONFIG_CAVEAT ? +#define GLX_DONT_CARE ? +#define GLX_SLOW_CONFIG ? +#define GLX_NON_CONFORMANT_CONFIG ? +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_MAX_PBUFFER_WIDTH ? +#define GLX_MAX_PBUFFER_HEIGHT ? +#define GLX_MAX_PBUFFER_PIXELS ? +#define GLX_PRESERVED_CONTENTS ? +#define GLX_LARGEST_BUFFER ? +#define GLX_DRAWABLE_TYPE ? +#define GLX_FBCONFIG_ID ? +#define GLX_VISUAL_ID ? +#define GLX_WINDOW_BIT ? +#define GLX_PBUFFER_BIT ? +#define GLX_AUX_BUFFERS_BIT ? +#define GLX_FRONT_LEFT_BUFFER_BIT ? +#define GLX_FRONT_RIGHT_BUFFER_BIT ? +#define GLX_BACK_LEFT_BUFFER_BIT ? +#define GLX_BACK_RIGHT_BUFFER_BIT ? +#define GLX_AUX_BUFFERS_BIT ? +#define GLX_DEPTH_BUFFER_BIT ? +#define GLX_STENCIL_BUFFER_BIT ? +#define GLX_ACCUM_BUFFER_BIT ? +#define GLX_RENDER_TYPE ? +#define GLX_DRAWABLE_TYPE ? +#define GLX_X_RENDERABLE ? +#define GLX_NONE 0x8000 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_COLOR_INDEX_TYPE ? +#define GLX_SCREEN ? +#define GLX_PBUFFER_CLOBBER_MASK ? +#define GLX_DAMAGED ? +#define GLX_SAVED ? +#define GLX_WINDOW ? +#define GLX_PBUFFER ? + + +/* + * GLX_EXT_visual_info extension + */ +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 + + /* * GLX_visual_info extension */ @@ -143,6 +200,12 @@ extern "C" { typedef void * GLXContext; typedef XID GLXPixmap; typedef XID GLXDrawable; + /* GLX 1.3 and later */ + typedef XID GLXFBConfigID; + typedef XID GLXPfuffer; + typedef XID GLXWindow; + typedef XID GLXPbuffer; + typedef XID GLXFBConfig; #endif typedef XID GLXContextID; @@ -199,10 +262,56 @@ extern const char *glXGetClientString( Display *dpy, int name ); /* GLX 1.2 and later */ - extern Display *glXGetCurrentDisplay( void ); +/* GLX 1.3 and later */ +extern GLXFBConfig glXChooseFBConfig( Display *dpy, int screen, + const int *attribList, int *nitems ); + +extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config, + int attribute, int *value ); + +extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy, + GLXFBConfig config ); + +extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config, + Window win, const int *attribList ); + +extern void glXDestroyWindow( Display *dpy, GLXWindow window ); + +extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config, + Pixmap pixmap, const int *attribList ); + +extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap ); + +extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config, + const int *attribList ); + +extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf ); + +extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute, + unsigned int *value ); + +extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config, + int renderType, GLXContext shareList, + Bool direct ); + +extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw, + GLXDrawable read, GLXContext ctx ); + +extern GLXDrawable glXGetCurrentReadDrawable( void ); + +extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute, + int *value ); + +extern void glXSelectEvent( Display *dpy, GLXDrawable drawable, + unsigned long mask ); + +extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable, + unsigned long *mask ); + + /* GLX_MESA_pixmap_colormap */ extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual, -- cgit v1.2.3 From 9331b6702cee82cfe8a83281106196b3493c4206 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 23 Nov 1999 22:41:10 +0000 Subject: added GLU 1.3 functions --- include/GL/glu.h | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index 5fef2512b68..08d98592b65 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.17 1999/11/15 14:26:07 brianp Exp $ */ +/* $Id: glu.h,v 1.18 1999/11/23 22:41:10 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -30,14 +30,14 @@ #include "glu_mangle.h" #endif +#include "GL/gl.h" + #ifdef __cplusplus extern "C" { #endif -#include "GL/gl.h" - /* to facilitate clean DLL building ... */ #if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__)) # if defined(_MSC_VER) && defined(BUILD_GLU32) /* tag specify we're building mesa as a DLL */ @@ -189,16 +189,22 @@ extern "C" { #define GLU_NURBS_ERROR36 100286 /* null control point reference */ #define GLU_NURBS_ERROR37 100287 /* duplicate point on pwlcurve */ +/* GLU 1.3 and later */ +#define GLU_NURBS_MODE ? + + /* Errors */ #define GLU_INVALID_ENUM 100900 #define GLU_INVALID_VALUE 100901 #define GLU_OUT_OF_MEMORY 100902 #define GLU_INCOMPATIBLE_GL_VERSION 100903 -/* New in GLU 1.1 */ +/* GLU 1.1 and later */ #define GLU_VERSION 100800 #define GLU_EXTENSIONS 100801 + + /*** GLU 1.0 tessellation - obsolete! ***/ /* Contour types */ @@ -465,6 +471,47 @@ GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name ); +/* + * + * GLU 1.3 functions + * + */ + +GLUAPI GLboolean GLAPIENTRY +gluCheckExtension(const char *extName, const GLubyte *extString); + + +GLUAPI GLint GLAPIENTRY +gluBuild3DMipmaps( GLenum target, GLint internalFormat, GLsizei width, + GLsizei height, GLsizei depth, GLenum format, + GLenum type, const void *data ); + +GLUAPI GLint GLAPIENTRY +gluBuild1DMipmapLevels( GLenum target, GLint internalFormat, GLsizei width, + GLenum format, GLenum type, GLint level, GLint base, + GLint max, const void *data ); + +GLUAPI GLint GLAPIENTRY +gluBuild2DMipmapLevels( GLenum target, GLint internalFormat, GLsizei width, + GLsizei height, GLenum format, GLenum type, + GLint level, GLint base, GLint max, + const void *data ); + +GLUAPI GLint GLAPIENTRY +gluBuild3DMipmapLevels( GLenum target, GLint internalFormat, GLsizei width, + GLsizei height, GLsizei depth, GLenum format, + GLenum type, GLint level, GLint base, GLint max, + const void *data ); + +GLUAPI GLint GLAPIENTRY +gluUnProject4( GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, + const GLdouble modelMatrix[16], const GLdouble projMatrix[16], + const GLint viewport[4], GLclampd near, GLclampd far, + GLdouble *objx, GLdouble *objy, GLdouble *objz, + GLdouble *objw ); + + + #if defined(__BEOS__) || defined(__QUICKDRAW__) #pragma export off #endif -- cgit v1.2.3 From 5fff37ecd4669ee58b0e1949dadbe349f9730418 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Nov 1999 13:06:48 +0000 Subject: renamed near and far arguments to gluUnProject4() --- include/GL/glu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index 08d98592b65..5acd0b73921 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.18 1999/11/23 22:41:10 brianp Exp $ */ +/* $Id: glu.h,v 1.19 1999/11/24 13:06:48 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -506,7 +506,7 @@ gluBuild3DMipmapLevels( GLenum target, GLint internalFormat, GLsizei width, GLUAPI GLint GLAPIENTRY gluUnProject4( GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, const GLdouble modelMatrix[16], const GLdouble projMatrix[16], - const GLint viewport[4], GLclampd near, GLclampd far, + const GLint viewport[4], GLclampd zNear, GLclampd zFar, GLdouble *objx, GLdouble *objy, GLdouble *objz, GLdouble *objw ); -- cgit v1.2.3 From b314d1d3af04a4d79bc2e1ce05dacd902ec999f2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Nov 1999 17:04:46 +0000 Subject: added a few more GLX 1.3 tokens --- include/GL/glx.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index e98f9cb8e74..d6389453cdb 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.8 1999/11/23 19:54:53 brianp Exp $ */ +/* $Id: glx.h,v 1.9 1999/11/24 17:04:46 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -123,6 +123,7 @@ extern "C" { #define GLX_FBCONFIG_ID ? #define GLX_VISUAL_ID ? #define GLX_WINDOW_BIT ? +#define GLX_PIXMAP_BIT ? #define GLX_PBUFFER_BIT ? #define GLX_AUX_BUFFERS_BIT ? #define GLX_FRONT_LEFT_BUFFER_BIT ? @@ -145,6 +146,7 @@ extern "C" { #define GLX_STATIC_GRAY 0x8007 #define GLX_TRANSPARENT_INDEX 0x8009 #define GLX_COLOR_INDEX_TYPE ? +#define GLX_COLOR_INDEX_BIT ? #define GLX_SCREEN ? #define GLX_PBUFFER_CLOBBER_MASK ? #define GLX_DAMAGED ? -- cgit v1.2.3 From 2257a120133010f42b4d0c3eb78b6a46a579e55b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Nov 1999 18:36:14 +0000 Subject: added XMesaMakeCurrent2(), XMesaGetCurrentReadBuffer(), bumped version to 3.3 --- include/GL/xmesa.h | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index b25a2ace7e8..4a2ed9ac250 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -1,8 +1,8 @@ -/* $Id: xmesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ +/* $Id: xmesa.h,v 1.2 1999/11/24 18:36:14 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -27,8 +27,11 @@ /* * $Log: xmesa.h,v $ - * Revision 1.1 1999/08/19 00:55:40 jtg - * Initial revision + * Revision 1.2 1999/11/24 18:36:14 brianp + * added XMesaMakeCurrent2(), XMesaGetCurrentReadBuffer(), bumped version to 3.3 + * + * Revision 1.1.1.1 1999/08/19 00:55:40 jtg + * Imported sources * * Revision 1.3 1999/02/24 22:43:27 jens * Name changes to get XMesa to compile standalone inside XFree86 @@ -106,7 +109,7 @@ extern struct Library *XLibBase; #define XMESA_MAJOR_VERSION 3 -#define XMESA_MINOR_VERSION 0 +#define XMESA_MINOR_VERSION 3 @@ -226,6 +229,16 @@ extern GLboolean XMesaMakeCurrent( XMesaContext c, XMesaBuffer b ); +/* + * Bind two buffers (read and draw) to a context and make the + * context the current one. + * New in Mesa 3.3 + */ +extern GLboolean XMesaMakeCurrent2( XMesaContext c, + XMesaBuffer drawBuffer, + XMesaBuffer readBuffer ); + + /* * Return a handle to the current context. */ @@ -233,11 +246,18 @@ extern XMesaContext XMesaGetCurrentContext( void ); /* - * Return handle to the current buffer. + * Return handle to the current (draw) buffer. */ extern XMesaBuffer XMesaGetCurrentBuffer( void ); +/* + * Return handle to the current read buffer. + * New in Mesa 3.3 + */ +extern XMesaBuffer XMesaGetCurrentReadBuffer( void ); + + /* * Swap the front and back buffers for the given buffer. No action is * taken if the buffer is not double buffered. -- cgit v1.2.3 From b16103c4668fb7adaf3b17dc7a416e10ffdbee7f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Nov 1999 18:43:19 +0000 Subject: bumped version to 3.3 --- include/GL/fxmesa.h | 23 +++-------------------- include/GL/osmesa.h | 26 +++----------------------- include/GL/svgamesa.h | 18 +++--------------- 3 files changed, 9 insertions(+), 58 deletions(-) (limited to 'include') diff --git a/include/GL/fxmesa.h b/include/GL/fxmesa.h index 68f15eb3cbb..be1bb7570e4 100644 --- a/include/GL/fxmesa.h +++ b/include/GL/fxmesa.h @@ -1,8 +1,8 @@ -/* $Id: fxmesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ +/* $Id: fxmesa.h,v 1.2 1999/11/24 18:44:53 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * Copyright (C) 1995-1999 Brian Paul * * This library is free software; you can redistribute it and/or @@ -21,23 +21,6 @@ */ -/* - * $Log: fxmesa.h,v $ - * Revision 1.1 1999/08/19 00:55:40 jtg - * Initial revision - * - * Revision 3.2 1999/01/03 02:46:31 brianp - * now using GLAPI and GLAPIENTRY keywords (Ted Jump) - * - * Revision 3.1 1998/04/01 03:00:28 brianp - * updated for v0.24 of 3Dfx/Glide driver - * - * Revision 3.0 1998/02/20 05:04:45 brianp - * initial rev - * - */ - - /* * FXMesa - 3Dfx Glide driver for Mesa. Contributed by David Bucciarelli * @@ -58,7 +41,7 @@ extern "C" { #define FXMESA_MAJOR_VERSION 3 -#define FXMESA_MINOR_VERSION 0 +#define FXMESA_MINOR_VERSION 3 /* diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h index 11423a8e3d0..26b2181bc03 100644 --- a/include/GL/osmesa.h +++ b/include/GL/osmesa.h @@ -1,8 +1,8 @@ -/* $Id: osmesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ +/* $Id: osmesa.h,v 1.2 1999/11/24 18:43:19 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -25,26 +25,6 @@ */ -/* - * $Log: osmesa.h,v $ - * Revision 1.1 1999/08/19 00:55:40 jtg - * Initial revision - * - * Revision 1.4 1999/02/14 03:39:09 brianp - * new copyright - * - * Revision 1.3 1999/01/03 02:52:30 brianp - * now using GLAPI and GLAPIENTRY keywords (Ted Jump) - * - * Revision 1.2 1998/07/26 01:33:51 brianp - * added WINGDIAPI and APIENTRY keywords per Ted Jump - * - * Revision 1.1 1998/02/13 03:17:50 brianp - * Initial revision - * - */ - - /* * Mesa Off-Screen rendering interface. * @@ -86,7 +66,7 @@ extern "C" { #define OSMESA_MAJOR_VERSION 3 -#define OSMESA_MINOR_VERSION 0 +#define OSMESA_MINOR_VERSION 3 diff --git a/include/GL/svgamesa.h b/include/GL/svgamesa.h index 9625a5b59ab..b8e1773260b 100644 --- a/include/GL/svgamesa.h +++ b/include/GL/svgamesa.h @@ -1,8 +1,8 @@ -/* $Id: svgamesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ +/* $Id: svgamesa.h,v 1.2 1999/11/24 18:43:48 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.0 + * Version: 3.3 * Copyright (C) 1995-1998 Brian Paul * * This library is free software; you can redistribute it and/or @@ -21,18 +21,6 @@ */ -/* - * $Log: svgamesa.h,v $ - * Revision 1.1 1999/08/19 00:55:40 jtg - * Initial revision - * - * Revision 3.0 1998/02/20 05:07:24 brianp - * initial rev - * - */ - - - /* * SVGA/Mesa interface for Linux. */ @@ -65,7 +53,7 @@ #define SVGAMESA_MAJOR_VERSION 3 -#define SVGAMESA_MINOR_VERSION 0 +#define SVGAMESA_MINOR_VERSION 3 #ifdef __cplusplus -- cgit v1.2.3 From 5bf7f47083f29f4e5f44107f2f398b8b37dd423b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Nov 1999 18:45:44 +0000 Subject: removed version logging --- include/GL/xmesa.h | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'include') diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index 4a2ed9ac250..313aa23c94c 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -1,4 +1,4 @@ -/* $Id: xmesa.h,v 1.2 1999/11/24 18:36:14 brianp Exp $ */ +/* $Id: xmesa.h,v 1.3 1999/11/24 18:45:44 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,26 +25,6 @@ */ -/* - * $Log: xmesa.h,v $ - * Revision 1.2 1999/11/24 18:36:14 brianp - * added XMesaMakeCurrent2(), XMesaGetCurrentReadBuffer(), bumped version to 3.3 - * - * Revision 1.1.1.1 1999/08/19 00:55:40 jtg - * Imported sources - * - * Revision 1.3 1999/02/24 22:43:27 jens - * Name changes to get XMesa to compile standalone inside XFree86 - * - * Revision 1.2 1999/02/14 03:39:09 brianp - * new copyright - * - * Revision 1.1 1998/02/13 03:17:32 brianp - * Initial revision - * - */ - - /* * Mesa/X11 interface. This header file serves as the documentation for * the Mesa/X11 interface functions. -- cgit v1.2.3 From 0056c5e40d7c5702420f314fa4f68159e5a64cd6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 10 Dec 1999 19:54:50 +0000 Subject: added GL_ARB_transpose_matrix --- include/GL/gl.h | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 8b2fcd1dc59..b4de2330a09 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.23 1999/11/18 20:23:31 brianp Exp $ */ +/* $Id: gl.h,v 1.24 1999/12/10 19:54:50 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -301,11 +301,11 @@ typedef double GLclampd; /* double precision float in [0,1] */ /* Depth buffer */ #define GL_NEVER 0x0200 #define GL_LESS 0x0201 -#define GL_GEQUAL 0x0206 +#define GL_EQUAL 0x0202 #define GL_LEQUAL 0x0203 #define GL_GREATER 0x0204 #define GL_NOTEQUAL 0x0205 -#define GL_EQUAL 0x0202 +#define GL_GEQUAL 0x0206 #define GL_ALWAYS 0x0207 #define GL_DEPTH_TEST 0x0B71 #define GL_DEPTH_BITS 0x0D56 @@ -2317,6 +2317,26 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); +/* + * GL_ARB_tranpose_matrix (number ?) + */ +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 + +/* XXX these aren't the final enum values!!! */ +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0xffff0001 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0xffff0002 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0xffff0003 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0xffff0004 + +GLAPI void GLAPIENTRY glLoadTransposeMatrixdARB( const GLdouble m[16] ); +GLAPI void GLAPIENTRY glLoadTransposeMatrixfARB( const GLfloat m[16] ); +GLAPI void GLAPIENTRY glMultTransposeMatrixdARB( const GLdouble m[16] ); +GLAPI void GLAPIENTRY glMultTransposeMatrixfARB( const GLfloat m[16] ); + +#endif + + #if defined(__BEOS__) || defined(__QUICKDRAW__) #pragma export off -- cgit v1.2.3 From ff06c837b5c743d2fe6cec4ca3474245861b699c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 11 Dec 1999 09:54:33 +0000 Subject: added GLX_ARB_get_proc_address --- include/GL/glx.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index d6389453cdb..b9c494697ea 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.9 1999/11/24 17:04:46 brianp Exp $ */ +/* $Id: glx.h,v 1.10 1999/12/11 09:54:33 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -185,12 +185,12 @@ extern "C" { * Compile-time extension tests */ #define GLX_EXT_visual_info 1 -#define GLX_EXT_get_proc_address 1 #define GLX_MESA_pixmap_colormap 1 #define GLX_MESA_release_buffers 1 #define GLX_MESA_copy_sub_buffer 1 #define GLX_MESA_set_3dfx_mode 1 #define GLX_SGI_video_sync 1 +#define GLX_ARB_get_proc_address 1 @@ -339,6 +339,10 @@ extern int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count); +/* GLX_ARB_get_proc_address */ +extern void (*glXGetProcAddressARB(const GLubyte *procName))(); + + #ifdef __cplusplus } -- cgit v1.2.3 From 2d2e9c0c0aa2db30e9fc567ea76b80ab5721289a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 4 Jan 2000 08:07:09 +0000 Subject: added missing glColorTableParameter defines --- include/GL/gl_mangle.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 2c039aa1432..2c709e8b655 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -1,8 +1,8 @@ -/* $Id: gl_mangle.h,v 1.3 1999/11/04 00:43:09 miklos Exp $ */ +/* $Id: gl_mangle.h,v 1.4 2000/01/04 08:07:09 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -396,6 +396,8 @@ #define glTexSubImage3DEXT mglTexSubImage3DEXT #define glCopyTexSubImage3DEXT mglCopyTexSubImage3DEXT #define glColorTable mglColorTable +#define glColorTableParameteriv mglColorTableParameteriv +#define glColorTableParameterfv mglColorTableParameterfv #define glColorSubTable mglColorSubTable #define glGetColorTable mglGetColorTable #define glGetColorTableParameteriv mglGetColorTableParameteriv -- cgit v1.2.3 From 0a654a5d5a99e00e1456cd04870dd6e656b558f9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 7 Jan 2000 05:35:37 +0000 Subject: assigned official GL_ARB_transpose_matrix enums --- include/GL/gl.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index b4de2330a09..5da2a230ef8 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,10 +1,10 @@ -/* $Id: gl.h,v 1.24 1999/12/10 19:54:50 brianp Exp $ */ +/* $Id: gl.h,v 1.25 2000/01/07 05:35:37 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 3.3 * - * Copyright (C) 1999 Brian Paul All Rights Reserved. + * 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"), @@ -2323,11 +2323,10 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); #ifndef GL_ARB_transpose_matrix #define GL_ARB_transpose_matrix 1 -/* XXX these aren't the final enum values!!! */ -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0xffff0001 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0xffff0002 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0xffff0003 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0xffff0004 +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 GLAPI void GLAPIENTRY glLoadTransposeMatrixdARB( const GLdouble m[16] ); GLAPI void GLAPIENTRY glLoadTransposeMatrixfARB( const GLfloat m[16] ); -- cgit v1.2.3 From 3c3533c5c8070fcca25247945cebedea60616082 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 7 Jan 2000 07:42:33 +0000 Subject: added missing glHintPGI() function --- include/GL/gl.h | 4 +++- src/mesa/main/dispatch.c | 5 ++++- src/mesa/main/dlist.c | 28 ++++++++++++++++++++++++++-- 3 files changed, 33 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 5da2a230ef8..3749700c912 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.25 2000/01/07 05:35:37 brianp Exp $ */ +/* $Id: gl.h,v 1.26 2000/01/07 07:43:41 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2053,6 +2053,8 @@ GLAPI void GLAPIENTRY glPointParameterfvEXT( GLenum pname, const GLfloat *params #define GL_BACK_NORMALS_HINT_PGI 107043 #define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 +GLAPI void APIENTRY glHintPGI(GLenum target, GLint mode); + #endif /* GL_PGI_misc_hints */ diff --git a/src/mesa/main/dispatch.c b/src/mesa/main/dispatch.c index 66040961350..b1b9ce429a5 100644 --- a/src/mesa/main/dispatch.c +++ b/src/mesa/main/dispatch.c @@ -1,4 +1,4 @@ -/* $Id: dispatch.c,v 1.7 2000/01/07 07:16:34 brianp Exp $ */ +/* $Id: dispatch.c,v 1.8 2000/01/07 07:42:33 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -509,6 +509,9 @@ _mesa_init_exec_table(struct _glapi_table *exec) exec->PointParameterfEXT = _mesa_PointParameterfEXT; exec->PointParameterfvEXT = _mesa_PointParameterfvEXT; + /* 77. GL_PGI_misc_hints */ + exec->HintPGI = _mesa_HintPGI; + /* GL_EXT_polygon_offset */ exec->PolygonOffsetEXT = _mesa_PolygonOffsetEXT; diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 2f9f4ed2a3b..cfbcb003a7f 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -1,10 +1,10 @@ -/* $Id: dlist.c,v 1.22 1999/12/15 12:55:54 brianp Exp $ */ +/* $Id: dlist.c,v 1.23 2000/01/07 07:42:34 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 3.3 * - * Copyright (C) 1999 Brian Paul All Rights Reserved. + * 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"), @@ -175,6 +175,7 @@ typedef enum { OPCODE_FRONT_FACE, OPCODE_FRUSTUM, OPCODE_HINT, + OPCODE_HINT_PGI, OPCODE_INDEX_MASK, OPCODE_INIT_NAMES, OPCODE_LIGHT, @@ -534,6 +535,7 @@ void gl_init_lists( void ) InstSize[OPCODE_FRONT_FACE] = 2; InstSize[OPCODE_FRUSTUM] = 7; InstSize[OPCODE_HINT] = 3; + InstSize[OPCODE_HINT_PGI] = 3; InstSize[OPCODE_INDEX_MASK] = 2; InstSize[OPCODE_INIT_NAMES] = 1; InstSize[OPCODE_LIGHT] = 7; @@ -1446,6 +1448,22 @@ static void save_Hint( GLenum target, GLenum mode ) } +/* GL_PGI_misc_hints*/ +static void save_HintPGI( GLenum target, GLint mode ) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + FLUSH_VB(ctx, "dlist"); + n = alloc_instruction( ctx, OPCODE_HINT_PGI, 2 ); + if (n) { + n[1].e = target; + n[2].i = mode; + } + if (ctx->ExecuteFlag) { + (*ctx->Exec.HintPGI)( target, mode ); + } +} + static void save_IndexMask( GLuint mask ) { @@ -3424,6 +3442,9 @@ static void execute_list( GLcontext *ctx, GLuint list ) case OPCODE_HINT: (*ctx->Exec.Hint)( n[1].e, n[2].e ); break; + case OPCODE_HINT_PGI: + (*ctx->Exec.HintPGI)( n[1].e, n[2].i ); + break; case OPCODE_INDEX_MASK: (*ctx->Exec.IndexMask)( n[1].ui ); break; @@ -4430,6 +4451,9 @@ _mesa_init_dlist_table( struct _glapi_table *table ) table->PointParameterfEXT = save_PointParameterfEXT; table->PointParameterfvEXT = save_PointParameterfvEXT; + /* GL_PGI_misc_hints */ + table->HintPGI = save_HintPGI; + /* GL_EXT_polygon_offset */ table->PolygonOffsetEXT = save_PolygonOffsetEXT; -- cgit v1.2.3 From e8dad9dbe4f83f1cd446f1eece8de67d7ccbcc2c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 8 Jan 2000 10:51:20 +0000 Subject: fixed prototype typo in glHintPGI ( ) --- include/GL/gl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 3749700c912..b485b3bd5a8 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.26 2000/01/07 07:43:41 brianp Exp $ */ +/* $Id: gl.h,v 1.27 2000/01/08 10:51:20 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2053,7 +2053,7 @@ GLAPI void GLAPIENTRY glPointParameterfvEXT( GLenum pname, const GLfloat *params #define GL_BACK_NORMALS_HINT_PGI 107043 #define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 -GLAPI void APIENTRY glHintPGI(GLenum target, GLint mode); +GLAPI void GLAPIENTRY glHintPGI(GLenum target, GLint mode); #endif /* GL_PGI_misc_hints */ -- cgit v1.2.3 From 4049cd35d89ad5eb29de15705ddc4190df5e8946 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 13 Jan 2000 17:40:12 +0000 Subject: applied Daryll's patches for GLX_DIRECT_RENDERING --- include/GL/xmesa.h | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index 313aa23c94c..a61258d1c7b 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -1,10 +1,10 @@ -/* $Id: xmesa.h,v 1.3 1999/11/24 18:45:44 brianp Exp $ */ +/* $Id: xmesa.h,v 1.4 2000/01/13 17:40:12 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 3.3 * - * Copyright (C) 1999 Brian Paul All Rights Reserved. + * 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"), @@ -79,6 +79,9 @@ extern "C" { #include #include #include "xmesa_x.h" +#ifdef GLX_DIRECT_RENDERING +#include "dri_mesa.h" +#endif #endif #include "GL/gl.h" @@ -114,6 +117,17 @@ typedef struct xmesa_visual *XMesaVisual; typedef struct xmesa_buffer *XMesaBuffer; +#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server) +/* + * Initialize the XMesa driver. + */ +extern GLboolean XMesaInitDriver( __DRIscreenPrivate *driScrnPriv ); + +/* + * Reset the XMesa driver when the X server resets. + */ +extern void XMesaResetDriver( __DRIscreenPrivate *driScrnPriv ); +#endif @@ -162,7 +176,11 @@ extern void XMesaDestroyVisual( XMesaVisual v ); * Return: an XMesaContext or NULL if error. */ extern XMesaContext XMesaCreateContext( XMesaVisual v, - XMesaContext share_list ); + XMesaContext share_list +#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server) + , __DRIcontextPrivate *driContextPriv +#endif + ); /* @@ -175,7 +193,11 @@ extern void XMesaDestroyContext( XMesaContext c ); * Create an XMesaBuffer from an X window. */ extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v, - XMesaWindow w ); + XMesaWindow w +#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server) + , __DRIdrawablePrivate *driDrawPriv +#endif + ); /* @@ -183,7 +205,11 @@ extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v, */ extern XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v, XMesaPixmap p, - XMesaColormap cmap ); + XMesaColormap cmap +#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server) + , __DRIdrawablePrivate *driDrawPriv +#endif + ); /* -- cgit v1.2.3 From 0deb3737c4f41c914f3536bb12bba9e6a668919c Mon Sep 17 00:00:00 2001 From: Randy Frank Date: Sat, 15 Jan 2000 06:12:18 +0000 Subject: Added entry point and define for the occlusion test. --- include/GL/osmesa.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h index 26b2181bc03..15415a63f25 100644 --- a/include/GL/osmesa.h +++ b/include/GL/osmesa.h @@ -1,4 +1,4 @@ -/* $Id: osmesa.h,v 1.2 1999/11/24 18:43:19 brianp Exp $ */ +/* $Id: osmesa.h,v 1.3 2000/01/15 06:12:18 rjfrank Exp $ */ /* * Mesa 3-D graphics library @@ -98,6 +98,13 @@ extern "C" { #define OSMESA_FORMAT 0x22 #define OSMESA_TYPE 0x23 +/* + * Accepted by OSMesaGetBooleanv: + * New in version 3.3 + */ +/* This is based on the HP proposed extension */ +#define OSMESA_OCCLUSION_TEST_RESULT_HP 0x30 + typedef struct osmesa_context *OSMesaContext; @@ -204,7 +211,13 @@ GLAPI void GLAPIENTRY OSMesaPixelStore( GLint pname, GLint value ); */ GLAPI void GLAPIENTRY OSMesaGetIntegerv( GLint pname, GLint *value ); - +/* + * Return context info. This is like glGetBooleanv. + * Input: pname - + * OSMESA_OCCLUSION_TEST_RESULT_HP return current test result + * value - pointer to boolean in which to return result. + */ +GLAPI void GLAPIENTRY OSMesaGetBooleanv( GLint pname, GLboolean *value ); /* * Return the depth buffer associated with an OSMesa context. -- cgit v1.2.3 From d0edf6ad30f3265caf181941055d1b578109b5e7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 16 Jan 2000 18:35:25 +0000 Subject: use nplanes instead of bitsPerRGBValue in GET_BITS_PER_PIXEL macro --- include/GL/xmesa_xf86.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/xmesa_xf86.h b/include/GL/xmesa_xf86.h index 5c1af7a641f..2a30e1e082b 100644 --- a/include/GL/xmesa_xf86.h +++ b/include/GL/xmesa_xf86.h @@ -30,7 +30,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Authors: * Kevin E. Martin * - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/xmesa_xf86.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/xmesa_xf86.h,v 1.2 2000/01/16 18:35:25 brianp Exp $ */ #ifndef _XMESA_XF86_H_ @@ -179,7 +179,13 @@ typedef xColorItem XMesaColor; #define GET_REDMASK(__v) __v->visinfo->redMask #define GET_GREENMASK(__v) __v->visinfo->greenMask #define GET_BLUEMASK(__v) __v->visinfo->blueMask -#define GET_BITS_PER_PIXEL(__v) __v->visinfo->bitsPerRGBValue + +/*XXX this was wrong. However, using nplanes instead may fail when + * we have overlay planes in the future! + */ +/*#define GET_BITS_PER_PIXEL(__v) __v->visinfo->bitsPerRGBValue*/ +#define GET_BITS_PER_PIXEL(__v) __v->visinfo->nplanes + #define GET_VISUAL_CLASS(__v) __v->visinfo->class #define GET_VISUAL_DEPTH(__v) __v->visinfo->nplanes #define GET_BLACK_PIXEL(__v) __v->display->blackPixel -- cgit v1.2.3 From 3db088f7d792021c8ed628a776355fc315a479a9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 17 Jan 2000 18:05:24 +0000 Subject: added missing POINT/LINE RANGE/GRANULARITY tokens --- include/GL/gl.h | 10 +++++++++- src/mesa/main/get.c | 12 ++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index b485b3bd5a8..beea5a8157d 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.27 2000/01/08 10:51:20 brianp Exp $ */ +/* $Id: gl.h,v 1.28 2000/01/17 18:05:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -794,6 +794,14 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_TEXTURE_MAX_LOD 0x813B #define GL_TEXTURE_BASE_LEVEL 0x813C #define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E + + /* * OpenGL 1.2 imaging subset (NOT IMPLEMENTED BY MESA) diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 684537adf53..ed7740becda 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1,10 +1,10 @@ -/* $Id: get.c,v 1.7 1999/12/10 20:01:06 brianp Exp $ */ +/* $Id: get.c,v 1.8 2000/01/17 18:05:46 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 3.3 * - * Copyright (C) 1999 Brian Paul All Rights Reserved. + * 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"), @@ -388,6 +388,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) *params = FLOAT_TO_BOOL(LINE_WIDTH_GRANULARITY); break; case GL_LINE_WIDTH_RANGE: + case GL_ALIASED_LINE_WIDTH_RANGE: params[0] = FLOAT_TO_BOOL(MIN_LINE_WIDTH); params[1] = FLOAT_TO_BOOL(MAX_LINE_WIDTH); break; @@ -615,6 +616,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) *params = FLOAT_TO_BOOL(POINT_SIZE_GRANULARITY ); break; case GL_POINT_SIZE_RANGE: + case GL_ALIASED_POINT_SIZE_RANGE: params[0] = FLOAT_TO_BOOL(MIN_POINT_SIZE ); params[1] = FLOAT_TO_BOOL(MAX_POINT_SIZE ); break; @@ -1338,6 +1340,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) *params = (GLdouble) LINE_WIDTH_GRANULARITY; break; case GL_LINE_WIDTH_RANGE: + case GL_ALIASED_LINE_WIDTH_RANGE: params[0] = (GLdouble) MIN_LINE_WIDTH; params[1] = (GLdouble) MAX_LINE_WIDTH; break; @@ -1565,6 +1568,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) *params = (GLdouble) POINT_SIZE_GRANULARITY; break; case GL_POINT_SIZE_RANGE: + case GL_ALIASED_POINT_SIZE_RANGE: params[0] = (GLdouble) MIN_POINT_SIZE; params[1] = (GLdouble) MAX_POINT_SIZE; break; @@ -2285,6 +2289,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) *params = (GLfloat) LINE_WIDTH_GRANULARITY; break; case GL_LINE_WIDTH_RANGE: + case GL_ALIASED_LINE_WIDTH_RANGE: params[0] = (GLfloat) MIN_LINE_WIDTH; params[1] = (GLfloat) MAX_LINE_WIDTH; break; @@ -2512,6 +2517,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) *params = (GLfloat) POINT_SIZE_GRANULARITY; break; case GL_POINT_SIZE_RANGE: + case GL_ALIASED_POINT_SIZE_RANGE: params[0] = (GLfloat) MIN_POINT_SIZE; params[1] = (GLfloat) MAX_POINT_SIZE; break; @@ -3214,6 +3220,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) *params = (GLint) LINE_WIDTH_GRANULARITY; break; case GL_LINE_WIDTH_RANGE: + case GL_ALIASED_LINE_WIDTH_RANGE: params[0] = (GLint) MIN_LINE_WIDTH; params[1] = (GLint) MAX_LINE_WIDTH; break; @@ -3441,6 +3448,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) *params = (GLint) POINT_SIZE_GRANULARITY; break; case GL_POINT_SIZE_RANGE: + case GL_ALIASED_POINT_SIZE_RANGE: params[0] = (GLint) MIN_POINT_SIZE; params[1] = (GLint) MAX_POINT_SIZE; break; -- cgit v1.2.3 From c902f7d05ae854f4c0b520f2f8c37263c96995af Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 17 Jan 2000 23:22:57 +0000 Subject: added do /while to multi-line macros --- include/GL/xmesa_xf86.h | 50 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'include') diff --git a/include/GL/xmesa_xf86.h b/include/GL/xmesa_xf86.h index 2a30e1e082b..c52de765357 100644 --- a/include/GL/xmesa_xf86.h +++ b/include/GL/xmesa_xf86.h @@ -30,7 +30,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Authors: * Kevin E. Martin * - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/xmesa_xf86.h,v 1.2 2000/01/16 18:35:25 brianp Exp $ + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/xmesa_xf86.h,v 1.3 2000/01/17 23:22:57 brianp Exp $ */ #ifndef _XMESA_XF86_H_ @@ -52,29 +52,29 @@ typedef DDXPointRec XMesaPoint; typedef xColorItem XMesaColor; #define XMesaSetGeneric(__d,__gc,__val,__mask) \ -{ \ +do { \ CARD32 __v[1]; \ (void) __d; \ __v[0] = __val; \ dixChangeGC(NullClient, __gc, __mask, __v, NULL); \ -} +} while (0) #define XMesaSetGenericPtr(__d,__gc,__pval,__mask) \ -{ \ +do { \ ChangeGCVal __v[1]; \ (void) __d; \ __v[0].ptr = __pval; \ dixChangeGC(NullClient, __gc, __mask, NULL, __v); \ -} +} while (0) #define XMesaSetDashes(__d,__gc,__do,__dl,__n) \ -{ \ +do { \ (void) __d; \ SetDashes(__gc, __do, __n, (unsigned char *)__dl); \ -} +} while (0) #define XMesaSetLineAttributes(__d,__gc,__lw,__ls,__cs,__js) \ -{ \ +do { \ CARD32 __v[4]; \ (void) __d; \ __v[0] = __lw; \ @@ -84,7 +84,7 @@ typedef xColorItem XMesaColor; dixChangeGC(NullClient, __gc, \ GCLineWidth|GCLineStyle|GCCapStyle|GCJoinStyle, \ __v, NULL); \ -} +} while (0) #define XMesaSetForeground(d,gc,v) XMesaSetGeneric(d,gc,v,GCForeground) #define XMesaSetBackground(d,gc,v) XMesaSetGeneric(d,gc,v,GCBackground) @@ -96,24 +96,24 @@ typedef xColorItem XMesaColor; #define XMesaSetStipple(d,gc,v) XMesaSetGenericPtr(d,gc,v,GCStipple) #define XMesaDrawPoint(__d,__b,__gc,__x,__y) \ -{ \ +do { \ XMesaPoint __p[1]; \ (void) __d; \ __p[0].x = __x; \ __p[0].y = __y; \ ValidateGC(__b, __gc); \ (*gc->ops->PolyPoint)(__b, __gc, CoordModeOrigin, 1, __p); \ -} +} while (0) #define XMesaDrawPoints(__d,__b,__gc,__p,__n,__m) \ -{ \ +do { \ (void) __d; \ ValidateGC(__b, __gc); \ (*gc->ops->PolyPoint)(__b, __gc, __m, __n, __p); \ -} +} while (0) #define XMesaDrawLine(__d,__b,__gc,__x0,__y0,__x1,__y1) \ -{ \ +do { \ XMesaPoint __p[2]; \ (void) __d; \ ValidateGC(__b, __gc); \ @@ -122,10 +122,10 @@ typedef xColorItem XMesaColor; __p[1].x = __x1; \ __p[1].y = __y1; \ (*__gc->ops->Polylines)(__b, __gc, CoordModeOrigin, 2, __p); \ -} +} while (0) #define XMesaFillRectangle(__d,__b,__gc,__x,__y,__w,__h) \ -{ \ +do { \ xRectangle __r[1]; \ (void) __d; \ ValidateGC(__b, __gc); \ @@ -134,10 +134,10 @@ typedef xColorItem XMesaColor; __r[0].width = __w; \ __r[0].height = __h; \ (*__gc->ops->PolyFillRect)(__b, __gc, 1, __r); \ -} +} while (0) #define XMesaPutImage(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h) \ -{ \ +do { \ /* Assumes: Images are always in ZPixmap format */ \ (void) __d; \ if (__sx || __sy) /* The non-trivial case */ \ @@ -146,22 +146,22 @@ typedef xColorItem XMesaColor; (*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \ __x, __y, __w, __h, 0, ZPixmap, \ ((XMesaImage *)(__i))->data); \ -} +} while (0) #define XMesaCopyArea(__d,__sb,__db,__gc,__sx,__sy,__w,__h,__x,__y) \ -{ \ +do { \ (void) __d; \ ValidateGC(__db, __gc); \ (*__gc->ops->CopyArea)((DrawablePtr)__sb, __db, __gc, \ __sx, __sy, __w, __h, __x, __y); \ -} +} while (0) #define XMesaFillPolygon(__d,__b,__gc,__p,__n,__s,__m) \ -{ \ +do { \ (void) __d; \ ValidateGC(__b, __gc); \ (*__gc->ops->FillPolygon)(__b, __gc, __s, __m, __n, __p); \ -} +} while (0) /* CreatePixmap returns a PixmapPtr; so, it cannot be inside braces */ #define XMesaCreatePixmap(__d,__b,__w,__h,__depth) \ @@ -170,10 +170,10 @@ typedef xColorItem XMesaColor; (*__d->DestroyPixmap)(__b) #define XMesaFreeGC(__d,__gc) \ -{ \ +do { \ (void) __d; \ FreeScratchGC(__gc); \ -} +} while (0) #define GET_COLORMAP_SIZE(__v) __v->visinfo->ColormapEntries #define GET_REDMASK(__v) __v->visinfo->redMask -- cgit v1.2.3 From 187bce0724fe0606614df3de57c2dc2b65623545 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 18 Jan 2000 17:29:18 +0000 Subject: minor clean-up --- include/GL/osmesa.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h index 15415a63f25..ac66e77e854 100644 --- a/include/GL/osmesa.h +++ b/include/GL/osmesa.h @@ -1,10 +1,10 @@ -/* $Id: osmesa.h,v 1.3 2000/01/15 06:12:18 rjfrank Exp $ */ +/* $Id: osmesa.h,v 1.4 2000/01/18 17:29:18 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 3.3 * - * Copyright (C) 1999 Brian Paul All Rights Reserved. + * 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"), @@ -50,12 +50,10 @@ */ - #ifndef OSMESA_H #define OSMESA_H - #ifdef __cplusplus extern "C" { #endif @@ -64,7 +62,6 @@ extern "C" { #include "GL/gl.h" - #define OSMESA_MAJOR_VERSION 3 #define OSMESA_MINOR_VERSION 3 @@ -98,6 +95,7 @@ extern "C" { #define OSMESA_FORMAT 0x22 #define OSMESA_TYPE 0x23 + /* * Accepted by OSMesaGetBooleanv: * New in version 3.3 @@ -126,7 +124,7 @@ typedef struct osmesa_context *OSMesaContext; * Return: an OSMesaContext or 0 if error */ GLAPI OSMesaContext GLAPIENTRY OSMesaCreateContext( GLenum format, - OSMesaContext sharelist ); + OSMesaContext sharelist ); @@ -168,8 +166,8 @@ GLAPI void GLAPIENTRY OSMesaDestroyContext( OSMesaContext ctx ); * width>internal limit or height>internal limit. */ GLAPI GLboolean GLAPIENTRY OSMesaMakeCurrent( OSMesaContext ctx, - void *buffer, GLenum type, - GLsizei width, GLsizei height ); + void *buffer, GLenum type, + GLsizei width, GLsizei height ); @@ -199,7 +197,7 @@ GLAPI void GLAPIENTRY OSMesaPixelStore( GLint pname, GLint value ); /* - * Return context info. This is like glGetIntegerv. + * Return an integer value like glGetIntegerv. * Input: pname - * OSMESA_WIDTH return current image width * OSMESA_HEIGHT return current image height @@ -211,14 +209,18 @@ GLAPI void GLAPIENTRY OSMesaPixelStore( GLint pname, GLint value ); */ GLAPI void GLAPIENTRY OSMesaGetIntegerv( GLint pname, GLint *value ); + + /* - * Return context info. This is like glGetBooleanv. + * Return a boolean value like glGetBooleanv. * Input: pname - * OSMESA_OCCLUSION_TEST_RESULT_HP return current test result * value - pointer to boolean in which to return result. */ GLAPI void GLAPIENTRY OSMesaGetBooleanv( GLint pname, GLboolean *value ); + + /* * Return the depth buffer associated with an OSMesa context. * Input: c - the OSMesa context @@ -230,8 +232,9 @@ GLAPI void GLAPIENTRY OSMesaGetBooleanv( GLint pname, GLboolean *value ); * New in Mesa 2.4. */ GLAPI GLboolean GLAPIENTRY OSMesaGetDepthBuffer( OSMesaContext c, - GLint *width, GLint *height, - GLint *bytesPerValue, void **buffer ); + GLint *width, GLint *height, + GLint *bytesPerValue, + void **buffer ); -- cgit v1.2.3 From 50a46abdd93f290c0dceb440f9b35b307f337c72 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 22 Jan 2000 20:09:30 +0000 Subject: updated for Mesa 3.2 --- include/GL/svgamesa.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/GL/svgamesa.h b/include/GL/svgamesa.h index b8e1773260b..6025aaefc5b 100644 --- a/include/GL/svgamesa.h +++ b/include/GL/svgamesa.h @@ -1,9 +1,9 @@ -/* $Id: svgamesa.h,v 1.2 1999/11/24 18:43:48 brianp Exp $ */ +/* $Id: svgamesa.h,v 1.3 2000/01/22 20:09:30 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-1998 Brian Paul + * Version: 3.2 + * Copyright (C) 1995-2000 Brian Paul * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -53,7 +53,7 @@ #define SVGAMESA_MAJOR_VERSION 3 -#define SVGAMESA_MINOR_VERSION 3 +#define SVGAMESA_MINOR_VERSION 2 #ifdef __cplusplus @@ -75,16 +75,21 @@ typedef struct svgamesa_context *SVGAMesaContext; /* * doubleBuffer flag new in version 2.4 */ +extern int SVGAMesaInit( int GraphMode ); + +extern int SVGAMesaClose( void ); + extern SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer ); extern void SVGAMesaDestroyContext( SVGAMesaContext ctx ); extern void SVGAMesaMakeCurrent( SVGAMesaContext ctx ); -extern SVGAMesaContext SVGAMesaGetCurrentContext( void ); - extern void SVGAMesaSwapBuffers( void ); +extern void SVGAMesaSetCI(int ndx, GLubyte red, GLubyte green, GLubyte blue); + +extern SVGAMesaContext SVGAMesaGetCurrentContext( void ); #ifdef __cplusplus } -- cgit v1.2.3 From e69f1f54f9506210c58f104db80adadca0b1fe2c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 5 Feb 2000 01:51:54 +0000 Subject: GL_ARRAY_ELEMENT_LOCK_FIRST/COUNT_SGI changed to _EXT suffix --- include/GL/gl.h | 6 +++--- src/mesa/main/enums.c | 8 ++++---- src/mesa/main/get.c | 7 +++---- 3 files changed, 10 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index beea5a8157d..9cde2af134c 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.28 2000/01/17 18:05:24 brianp Exp $ */ +/* $Id: gl.h,v 1.29 2000/02/05 01:51:54 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2122,8 +2122,8 @@ GLAPI void GLAPIENTRY glGetColorTableParameterivEXT( GLenum target, GLenum pname #ifndef GL_EXT_compiled_vertex_array #define GL_EXT_compiled_vertex_array 1 -#define GL_ARRAY_ELEMENT_LOCK_FIRST_SGI 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_SGI 0x81A9 +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 GLAPI void GLAPIENTRY glLockArraysEXT( GLint first, GLsizei count ); GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 3ee2c6fa29b..5dbda02dfb3 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -1,10 +1,10 @@ -/* $Id: enums.c,v 1.5 1999/11/11 01:22:26 brianp Exp $ */ +/* $Id: enums.c,v 1.6 2000/02/05 01:52:05 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 3.3 * - * Copyright (C) 1999 Brian Paul All Rights Reserved. + * 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"), @@ -795,8 +795,8 @@ enum_elt all_enums[] = { "GL_NATIVE_GRAPHICS_HANDLE_PGI", 107010 }, /* GL_EXT_compiled_vertex_array */ - { "GL_ARRAY_ELEMENT_LOCK_FIRST_SGI", 0x81A8}, - { "GL_ARRAY_ELEMENT_LOCK_COUNT_SGI", 0x81A9}, + { "GL_ARRAY_ELEMENT_LOCK_FIRST_EXT", 0x81A8}, + { "GL_ARRAY_ELEMENT_LOCK_COUNT_EXT", 0x81A9}, /* GL_EXT_clip_volume_hint */ { "GL_CLIP_VOLUME_CLIPPING_HINT_EXT", 0x80F0} diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 04f1e42b8a5..b0a7fc677ef 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1,4 +1,4 @@ -/* $Id: get.c,v 1.10 2000/02/03 19:40:07 brianp Exp $ */ +/* $Id: get.c,v 1.11 2000/02/05 01:52:05 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -3812,11 +3812,10 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) break; /* GL_EXT_compiled_vertex_array */ - case GL_ARRAY_ELEMENT_LOCK_FIRST_SGI: + case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT: *params = ctx->Array.LockFirst; break; - - case GL_ARRAY_ELEMENT_LOCK_COUNT_SGI: + case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT: *params = ctx->Array.LockCount; break; -- cgit v1.2.3 From 668ac873a0435689d3d1b663ed73fbd876b49ffd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 9 Feb 2000 19:03:28 +0000 Subject: updated version info --- include/GL/amesa.h | 22 +++++++--------------- include/GL/ggimesa.h | 25 ++++++++----------------- include/GL/svgamesa.h | 6 +++--- 3 files changed, 18 insertions(+), 35 deletions(-) (limited to 'include') diff --git a/include/GL/amesa.h b/include/GL/amesa.h index b4a1867d042..25a5aa48a82 100644 --- a/include/GL/amesa.h +++ b/include/GL/amesa.h @@ -1,10 +1,10 @@ -/* $Id: amesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ +/* $Id: amesa.h,v 1.2 2000/02/09 19:03:28 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 * - * Copyright (C) 1999 Brian Paul All Rights Reserved. + * 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"), @@ -25,25 +25,17 @@ */ -/* - * $Log: amesa.h,v $ - * Revision 1.1 1999/08/19 00:55:40 jtg - * Initial revision - * - * Revision 1.1 1999/03/16 01:24:13 brianp - * initial check-in - * - */ - - /* 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; diff --git a/include/GL/ggimesa.h b/include/GL/ggimesa.h index 86b598d1781..f88ecffc5e2 100644 --- a/include/GL/ggimesa.h +++ b/include/GL/ggimesa.h @@ -1,9 +1,9 @@ -/* $Id: ggimesa.h,v 1.2 1999/08/23 22:34:08 jtaylor Exp $ */ +/* $Id: ggimesa.h,v 1.3 2000/02/09 19:03:28 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 - * Copyright (C) 1995-1998 Brian Paul + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul * Copyright (C) 1998 Uwe Maurer * * This library is free software; you can redistribute it and/or @@ -22,23 +22,14 @@ */ -/* - * $Log: ggimesa.h,v $ - * Revision 1.2 1999/08/23 22:34:08 jtaylor - * Misc small cleanups - * - * Revision 1.1.1.1 1999/08/19 00:55:40 jtg - * Imported sources - * - * Revision 1.2 1998/09/29 01:46:40 brianp - * applied Emmanuel Marty's patches for latest GGI - * - */ - - #ifndef GGIMESA_H #define GGIMESA_H + +#define GGIMESA_MAJOR_VERSION 3 +#define GGIMESA_MINOR_VERSION 3 + + #ifdef __cplusplus extern "C" { #endif diff --git a/include/GL/svgamesa.h b/include/GL/svgamesa.h index 6025aaefc5b..5084a2133d6 100644 --- a/include/GL/svgamesa.h +++ b/include/GL/svgamesa.h @@ -1,8 +1,8 @@ -/* $Id: svgamesa.h,v 1.3 2000/01/22 20:09:30 brianp Exp $ */ +/* $Id: svgamesa.h,v 1.4 2000/02/09 19:03:28 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.2 + * Version: 3.3 * Copyright (C) 1995-2000 Brian Paul * * This library is free software; you can redistribute it and/or @@ -53,7 +53,7 @@ #define SVGAMESA_MAJOR_VERSION 3 -#define SVGAMESA_MINOR_VERSION 2 +#define SVGAMESA_MINOR_VERSION 3 #ifdef __cplusplus -- cgit v1.2.3 From 3d41d5ade74fd6a742139544a8a9ed54b0f5ba83 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 10 Feb 2000 17:27:55 +0000 Subject: added GLCALLBACKPCAST for Cygnus (Sven Panne) --- include/GL/gl.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 9cde2af134c..fe669bb511e 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.29 2000/02/05 01:51:54 brianp Exp $ */ +/* $Id: gl.h,v 1.30 2000/02/10 17:27:55 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -78,6 +78,11 @@ # define GLAPIENTRYP __stdcall * # define GLCALLBACK __stdcall # define GLCALLBACKP __stdcall * +#if defined(__CYGWIN32__) +# define GLCALLBACKPCAST * +#else +# define GLCALLBACKPCAST __stdcall * +#endif # define GLWINAPI __stdcall # define GLWINAPIV __cdecl #else @@ -87,6 +92,7 @@ # define GLAPIENTRYP * # define GLCALLBACK # define GLCALLBACKP * +# define GLCALLBACKPCAST * # define GLWINAPI # define GLWINAPIV #endif /* WIN32 / CYGWIN32 bracket */ -- cgit v1.2.3 From ae773f612c0b9262e9cf9fb63423a44d2125ce46 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 11 Feb 2000 20:44:22 +0000 Subject: clean-up --- include/GL/gl.h | 82 +++++++++++++++++++++++++-------------------------------- 1 file changed, 36 insertions(+), 46 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index fe669bb511e..fd8d9688883 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.30 2000/02/10 17:27:55 brianp Exp $ */ +/* $Id: gl.h,v 1.31 2000/02/11 20:44:22 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -57,44 +57,44 @@ # pragma warning( disable : 4710 ) /* function 'foo' not inlined */ # pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */ # pragma warning( disable : 4127 ) /* conditional expression is constant */ -# if defined(MESA_MINWARN) -# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ -# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ -# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ -# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */ -# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ +# if defined(MESA_MINWARN) +# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ +# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ +# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ +# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */ +# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ # endif -# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ -# define GLAPI __declspec(dllexport) -# define WGLAPI __declspec(dllexport) -# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ -# define GLAPI __declspec(dllimport) -# define WGLAPI __declspec(dllimport) -# else /* for use with static link lib build of Win32 edition only */ -# define GLAPI extern -# define WGLAPI __declspec(dllimport) -# endif /* _STATIC_MESA support */ -# define GLAPIENTRY __stdcall -# define GLAPIENTRYP __stdcall * -# define GLCALLBACK __stdcall -# define GLCALLBACKP __stdcall * -#if defined(__CYGWIN32__) -# define GLCALLBACKPCAST * -#else -# define GLCALLBACKPCAST __stdcall * -#endif -# define GLWINAPI __stdcall -# define GLWINAPIV __cdecl +# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ +# define GLAPI __declspec(dllexport) +# define WGLAPI __declspec(dllexport) +# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ +# define GLAPI __declspec(dllimport) +# define WGLAPI __declspec(dllimport) +# else /* for use with static link lib build of Win32 edition only */ +# define GLAPI extern +# define WGLAPI __declspec(dllimport) +# endif /* _STATIC_MESA support */ +# define GLAPIENTRY __stdcall +# define GLAPIENTRYP __stdcall * +# define GLCALLBACK __stdcall +# define GLCALLBACKP __stdcall * +# if defined(__CYGWIN32__) +# define GLCALLBACKPCAST * +# else +# define GLCALLBACKPCAST __stdcall * +# endif +# define GLWINAPI __stdcall +# define GLWINAPIV __cdecl #else /* non-Windows compilation */ -# define GLAPI extern -# define GLAPIENTRY -# define GLAPIENTRYP * -# define GLCALLBACK -# define GLCALLBACKP * -# define GLCALLBACKPCAST * -# define GLWINAPI -# define GLWINAPIV +# define GLAPI extern +# define GLAPIENTRY +# define GLAPIENTRYP * +# define GLCALLBACK +# define GLCALLBACKP * +# define GLCALLBACKPCAST * +# define GLWINAPI +# define GLWINAPIV #endif /* WIN32 / CYGWIN32 bracket */ /* compatability guard so we don't need to change client code */ @@ -137,16 +137,6 @@ extern "C" { -/* - * Apps can test for this symbol to do conditional compilation if needed. - */ -/* XXX these Mesa symbols are going away -#define MESA -#define MESA_MAJOR_VERSION 3 -#define MESA_MINOR_VERSION 1 -*/ - - #define GL_VERSION_1_1 1 #define GL_VERSION_1_2 1 -- cgit v1.2.3 From cec5f6f00de7254d9598374f7b574492c5ef439f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Feb 2000 00:55:38 +0000 Subject: initial revision --- include/GL/glext.h | 972 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 972 insertions(+) create mode 100644 include/GL/glext.h (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h new file mode 100644 index 00000000000..3978af5e4ad --- /dev/null +++ b/include/GL/glext.h @@ -0,0 +1,972 @@ +#ifndef __glext_h_ +#define __glext_h_ + + +/* + * XXX Many extensions need to be added yet. + * XXX Some token values aren't known (grep for ?) + * XXX This file may be automatically generated in the future. + */ + + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#ifndef GLAPI +#define GLAPI extern +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif + + + +/* + * 1. GL_EXT_abgr + */ +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 + +#define GL_ABGR_EXT 0x8000 + +#endif /* GL_EXT_abgr */ + + + +/* + * 2. GL_EXT_blend_color + */ +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 + +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 + +GLAPI void APIENTRY glBlendColorEXT(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); + +#endif /* GL_EXT_blend_color */ + + + +/* + * 3. GL_EXT_polygon_offset + */ +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 + +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 + +GLAPI void APIENTRY glPolygonOffsetEXT(GLfloat factor, GLfloat bias); + +#endif /* GL_EXT_polygon_offset */ + + + +/* + * 6. GL_EXT_texture3D + */ +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 + +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A + +GLAPI void APIENTRY glTexImage3DEXT(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); + +GLAPI void APIENTRY glTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); + +GLAPI void APIENTRY glCopyTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + +#endif /* GL_EXT_texture3D */ + + + +/* + * 7. GL_SGI_texture_filter4 + */ +#ifndef GL_SGI_texture_filter4 +#define GL_SGI_texture_filter4 1 + +#define GL_FILTER4_SGIS ? +#define GL_TEXTURE_FILTER4_SIZE_SGIS ? + +GLAPI void APIENTRY glGetTexFilterFuncSGIS(GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); + +GLAPI void APIENTRY glTexFilterFuncSGIS(GLenum target, GLenum filter, GLfloat *weights); + +#endif /* GL_SGI_texture_filter4 */ + + + +/* + * 9. GL_EXT_subtexture + */ +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 + +GLAPI void APIENTRY glCopyTexSubImage1DEXT(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); + +GLAPI void APIENTRY glTexSubImage1DEXT(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); + +GLAPI void APIENTRY glTexSubImage2DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); + +#endif /* GL_EXT_subtexture */ + + + +/* + * 10. GL_EXT_copy_texture + */ +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 + +GLAPI void APIENTRY glCopyTexImage1DEXT(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); + +GLAPI void APIENTRY glCopyTexImage2DEXT(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); + +GLAPI void APIENTRY glCopyTexSubImage2DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); + +#endif /* GL_EXT_copy_texture */ + + + +/* + * 11. GL_EXT_histogram + */ +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 + + +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D + +GLAPI void APIENTRY glGetHistogramEXT(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); + +GLAPI void APIENTRY glGetHistogramParameterfvEXT(GLenum target, GLenum pname, GLfloat *params); + +GLAPI void APIENTRY glGetHistogramParameterivEXT(GLenum target, GLenum pname, GLint *params); + +GLAPI void APIENTRY glGetMinmaxEXT(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); + +GLAPI void APIENTRY glGetMinmaxParameterfvEXT(GLenum target, GLenum pname, GLfloat *params); + +GLAPI void APIENTRY glGetMinmaxParameterivEXT(GLenum target, GLenum pname, GLint *params); + +GLAPI void APIENTRY glHistogramEXT(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); + +GLAPI void APIENTRY glMinmaxEXT(GLenum target, GLenum internalformat, GLboolean sink); + +GLAPI void APIENTRY glResetHistogramEXT(GLenum target); + +GLAPI void APIENTRY glResetMinmaxEXT(GLenum target); + +#endif /* GL_EXT_histogram */ + + + +/* + * 12. GL_EXT_convolution + */ +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 + +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 + +GLAPI void APIENTRY glConvolutionFilter1DEXT(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); + +GLAPI void APIENTRY glConvolutionFilter2DEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); + +GLAPI void APIENTRY glConvolutionParameterfEXT(GLenum target, GLenum pname, GLfloat params); + +GLAPI void APIENTRY glConvolutionParameterfvEXT(GLenum target, GLenum pname, const GLfloat *params); + +GLAPI void APIENTRY glConvolutionParameteriEXT(GLenum target, GLenum pname, GLint params); + +GLAPI void APIENTRY glConvolutionParameterivEXT(GLenum target, GLenum pname, const GLint *params); + +GLAPI void APIENTRY glCopyConvolutionFilter1DEXT(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); + +GLAPI void APIENTRY glCopyConvolutionFilter2DEXT(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); + +GLAPI void APIENTRY glGetConvolutionFilterEXT(GLenum target, GLenum format, GLenum type, GLvoid *image); + +GLAPI void APIENTRY glGetConvolutionParameterfvEXT(GLenum target, GLenum pname, GLfloat *params); + +GLAPI void APIENTRY glGetConvolutionParameterivEXT(GLenum target, GLenum pname, GLint *params); + +GLAPI void APIENTRY glGetSeparableFilterEXT(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); + +GLAPI void APIENTRY glSeparableFilter2DEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); + +#endif /* GL_EXT_convolution */ + + + +/* + * 13. GL_SGI_color_matrix + */ +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 + +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB + +#endif /* GL_SGI_color_matrix */ + + + +/* + * 14. GL_SGI_color_table + */ +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 + +#define COLOR_TABLE_SGI 0x80D0 +#define POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define PROXY_COLOR_TABLE_SGI 0x80D3 +#define PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define COLOR_TABLE_SCALE_SGI 0x80D6 +#define COLOR_TABLE_BIAS_SGI 0x80D7 +#define COLOR_TABLE_FORMAT_SGI 0x80D8 +#define COLOR_TABLE_WIDTH_SGI 0x80D9 +#define COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF + +GLAPI void APIENTRY glColorTableParameterfvSGI(GLenum target, GLenum pname, const GLfloat *params); + +GLAPI void APIENTRY glColorTableParameterivSGI(GLenum target, GLenum pname, const GLint *params); + +GLAPI void APIENTRY glColorTableSGI(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); + +GLAPI void APIENTRY glCopyColorTableSGI(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width); + +GLAPI void APIENTRY glGetColorTableParameterfvSGI(GLenum target, GLenum pname, GLfloat *params); + +GLAPI void APIENTRY glGetColorTableParameterivSGI(GLenum target, GLenum pname, GLint *params); + +GLAPI void APIENTRY glGetColorTableSGI(GLenum target, GLenum format, GLenum type, GLvoid *table); + +#endif /* GL_SGI_color_table */ + + + +/* + * 15. GL_SGIS_pixel_texture + */ +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 + +#define GL_PIXEL_TEXTURE_SGIS ? +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS ? +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS ? +#define GL_PIXEL_GROUP_COLOR_SGIS ? + +GLAPI void APIENTRY glPixelTexGenParameterfSGIS(GLenum target, GLfloat value); + +GLAPI void APIENTRY glPixelTexGenParameteriSGIS(GLenum target, GLint value); + +GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS(GLenum target, GLfloat *value); + +GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS(GLenum target, GLint *value); + +#endif /* GL_SGIS_pixel_texture */ + + + +/* + * 16. GL_SGIS_texture4D + */ +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 + +#define GL_PACK_SKIP_VOLUMES_SGIS ? +#define GL_PACK_IMAGE_DEPTH_SGIS ? +#define GL_UNPACK_SKIP_VOLUMES_SGIS ? +#define GL_UNPACK_IMAGE_DEPTH_SGIS ? +#define GL_TEXTURE_4D_SGIS ? +#define GL_PROXY_TEXTURE_4D_SGIS ? +#define GL_TEXTURE_4DSIZE_SGIS ? +#define GL_TEXTURE_WRAP_Q_SGIS ? +#define GL_MAX_4D_TEXTURE_SIZE_SGIS ? +#define GL_TEXTURE_4D_BINDING_SGIS ? + +GLAPI void APIENTRY glTexImage4DSGIS(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); + +GLAPI void APIENTRY glTexSubImage4DSGIS(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels); + +#endif /* GL_SGIS_texture4D */ + + + +/* + * 20. GL_EXT_texture_object + */ +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 + +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 + +GLAPI void APIENTRY glGenTexturesEXT(GLsizei n, GLuint *textures); + +GLAPI void APIENTRY glDeleteTexturesEXT(GLsizei n, const GLuint *textures); + +GLAPI void APIENTRY glBindTextureEXT(GLenum target, GLuint texture); + +GLAPI void APIENTRY glPrioritizeTexturesEXT(GLsizei n, const GLuint *textures, const GLclampf *priorities); + +GLAPI GLboolean APIENTRY glAreTexturesResidentEXT(GLsizei n, const GLuint *textures, GLboolean *residences); + +GLAPI GLboolean APIENTRY glIsTextureEXT(GLuint texture); + +#endif /* GL_EXT_texture_object */ + + + +/* + * 23. GL_EXT_packed_pixels + */ +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 + +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 + +#endif /* GL_EXT_packed_pixels */ + + + +/* + * 27. GL_EXT_rescale_normal + */ +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 + +#define GL_RESCALE_NORMAL_EXT 0x803A + +#endif /* GL_EXT_rescale_normal */ + + + +/* + * 30. GL_EXT_vertex_array + */ +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 + +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 + +GLAPI void APIENTRY glVertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr); + +GLAPI void APIENTRY glNormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr); + +GLAPI void APIENTRY glColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr); + +GLAPI void APIENTRY glIndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr); + +GLAPI void APIENTRY glTexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr); + +GLAPI void APIENTRY glEdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *ptr); + +GLAPI void APIENTRY glGetPointervEXT(GLenum pname, void **params); + +GLAPI void APIENTRY glArrayElementEXT(GLint i); + +GLAPI void APIENTRY glDrawArraysEXT(GLenum mode, GLint first, GLsizei count); + +typedef void (APIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (APIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); +typedef void (APIENTRY * PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); +typedef void (APIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); + +#endif /* GL_EXT_vertex_array */ + + + +/* + * 35. GL_SGIS_texture_edge_clamp + */ +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_SGIS 0x812F + +#endif /* GL_SGIS_texture_edge_clamp */ + + + +/* + * 37. GL_EXT_blend_minmax + */ +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 + +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 + +GLAPI void APIENTRY glBlendEquationEXT(GLenum mode); + +#endif /* GL_EXT_blend_minmax */ + + + +/* + * 38. GL_EXT_blend_subtract (requires GL_EXT_blend_max) + */ +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 + +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B + +#endif /* GL_EXT_blend_subtract */ + + + +/* + * 39. GL_EXT_blend_logic_op + */ +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 + +/* No new tokens or functions */ + +#endif /* GL_EXT_blend_logic_op */ + + + +/* + * 54. GL_EXT_point_parameters + */ +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 + +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 + +GLAPI void APIENTRY glPointParameterfEXT(GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvEXT(GLenum pname, const GLfloat *params); + +typedef void (APIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); + +#endif /* GL_EXT_point_parameters */ + + + +/* + * 77. GL_PGI_misc_hints + */ +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 + +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 +#define GL_STRICT_LIGHTING_HINT_PGI 107031 +#define GL_STRICT_SCISSOR_HINT_PGI 107032 +#define GL_FULL_STIPPLE_HINT_PGI 107033 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 +#define GL_CONSERVE_MEMORY_HINT_PGI 107005 +#define GL_RECLAIM_MEMORY_HINT_PGI 107006 +#define GL_ALWAYS_FAST_HINT_PGI 107020 +#define GL_ALWAYS_SOFT_HINT_PGI 107021 +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 +#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 +#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 +#define GL_ALLOW_DRAW_SPN_HINT_PGI 107024 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 +#define GL_CLIP_NEAR_HINT_PGI 107040 +#define GL_CLIP_FAR_HINT_PGI 107041 +#define GL_WIDE_LINE_HINT_PGI 107042 +#define GL_BACK_NORMALS_HINT_PGI 107043 +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 + +GLAPI void APIENTRY glHintPGI(GLenum target, GLint mode); + +#endif /* GL_PGI_misc_hints */ + + + +/* + * 78. GL_EXT_paletted_texture + */ +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 + +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 +#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 + +GLAPI void APIENTRY glColorTableEXT(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); + +GLAPI void APIENTRY glColorSubTableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); + +GLAPI void APIENTRY glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid *table); + +GLAPI void APIENTRY glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat *params); + +GLAPI void APIENTRY glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint *params); + +#endif /* GL_EXT_paletted_texture */ + + + +/* + * 79. GL_EXT_clip_volume_hint + */ +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 + +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F + +#endif /* GL_EXT_clip_volume_hint */ + + + +/* + * 97. GL_EXT_compiled_vertex_array + */ +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 + +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 + +GLAPI void APIENTRY glLockArraysEXT(GLint first, GLsizei count); +GLAPI void APIENTRY glUnlockArraysEXT(void); + +typedef void (APIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); + +#endif /* GL_EXT_compiled_vertex_array */ + + + +/* + * 98. GL_EXT_cull_vertex + */ +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC + +GLAPI void APIENTRY glCullParameterdvEXT(GLenum pname, const GLdouble *params); +GLAPI void APIENTRY glCullParameterfvEXT(GLenum pname, const GLfloat *params); + +typedef void (APIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); +typedef void (APIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); + + + +/* + * 129. GL_EXT_bgra + */ +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 + +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 + +#endif /* GL_EXT_bgra */ + + + +/* + * 141. GL_EXT_shared_texture_palette (req's GL_EXT_paletted_texture) + */ +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 + +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB + +#endif /* GL_EXT_shared_texture_palette */ + + + +/* + * 149. GL_EXT_fog_coord + */ +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 + +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 + +GLAPI void APIENTRY glFogCoordfEXT(GLfloat coord); + +GLAPI void APIENTRY glFogCoordfvEXT(const GLfloat * coord); + +GLAPI void APIENTRY glFogCoorddEXT(GLdouble coord); + +GLAPI void APIENTRY glFogCoorddvEXT(const GLdouble * coord); + +GLAPI void APIENTRY glFogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid * pointer); + +#endif + + + +/* + * 158. GL_EXT_texture_env_combine + */ +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 + +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A + +#endif /* GL_EXT_texture_env_combine */ + + + +/* + * 173. GL_EXT_blend_func_separate (AKA GL_INGR_blend_func_separate) + */ +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 + +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB + +GLAPI void APIENTRY glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + +#endif /* GL_EXT_blend_func_separate */ + + + +/* + * 176. GL_EXT_stencil_wrap + */ +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 + +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 + +#endif /* GL_EXT_stencil_wrap */ + + + +/* + * 179. GL_NV_texgen_reflection + */ +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 + +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 + +#endif /* GL_NV_texgen_reflection */ + + + +/* + * 185. GL_EXT_texture_env_add + */ +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 + +/* No new tokens or functions */ + +#endif /* GL_EXT_texture_env_add */ + + + +/* + * ??. GL_WIN_swap_hint + */ +#ifndef GL_WIN_swap_hint +#define GL_WIN_swap_hint 1 + +GLAPI void APIENTRY glAddSwapHintRectWIN(GLint x, GLint y, GLsizei width, GLsizei height); + +typedef void (APIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); + +#endif /* GL_WIN_swap_hint */ + + + +/* + * 188. GL_EXT_vertex_weighting + */ +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 + +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT 0x1700 +#define GL_MODELVIEW1_EXT 0x850a +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850b +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850c +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850d +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850e +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850f +#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 + +GLAPI void APIENTRY VertexWeightfEXT(GLfloat weight); + +GLAPI void APIENTRY VertexWeightfvEXT(GLfloat *weight); + +GLAPI void APIENTRY VertexWeightPointerEXT(GLint size, GLenum type, GLsizei stride, GLvoid *pointer); + +#endif + + + +/* + * 189. GL_NV_light_max_exponent + */ +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 + +#define GL_MAX_SHININESS_NV 0x8507 +#define GL_MAX_SPOT_EXPONENT_NV 0x8508 + +#endif + + + +/* + * 192. GL_NV_fog_distance + */ +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 + +#define GL_FOG_DISTANCE_MODE_NV 0x855a +#define GL_EYE_RADIAL_NV 0x855b +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855c + +#endif /* GL_NV_fog_distance*/ + + + +/* + * 194. GL_NV_blend_square + */ +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 + +/* no tokens or functions */ + +#endif /* GL_NV_blend_square */ + + + +/* + * 195. GL_NV_texture_env_combine4 + */ +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 + +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B + +#endif /* GL_NV_texture_env_combine4 */ + + + +/* + * 196. GL_MESA_resize_bufffers + */ +#ifndef GL_MESA_resize_bufffers +#define GL_MESA_resize_buffers 1 + +GLAPI void APIENTRY glResizeBuffersMESA(void); + +#endif /* GL_MESA_resize_bufffers */ + + + +/* + * 197. GL_MESA_window_pos + */ +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 + +GLAPI void APIENTRY glWindowPos2iMESA(GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2sMESA(GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2fMESA(GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2dMESA(GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2ivMESA(const GLint *p); +GLAPI void APIENTRY glWindowPos2svMESA(const GLshort *p); +GLAPI void APIENTRY glWindowPos2fvMESA(const GLfloat *p); +GLAPI void APIENTRY glWindowPos2dvMESA(const GLdouble *p); +GLAPI void APIENTRY glWindowPos3iMESA(GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3sMESA(GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3ivMESA(const GLint *p); +GLAPI void APIENTRY glWindowPos3svMESA(const GLshort *p); +GLAPI void APIENTRY glWindowPos3fvMESA(const GLfloat *p); +GLAPI void APIENTRY glWindowPos3dvMESA(const GLdouble *p); +GLAPI void APIENTRY glWindowPos4iMESA(GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glWindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glWindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glWindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glWindowPos4ivMESA(const GLint *p); +GLAPI void APIENTRY glWindowPos4svMESA(const GLshort *p); +GLAPI void APIENTRY glWindowPos4fvMESA(const GLfloat *p); +GLAPI void APIENTRY glWindowPos4dvMESA(const GLdouble *p); + +#endif /* GL_MESA_window_pos */ + + + +#ifdef __cplusplus +} +#endif + + +#endif /* __glext_h_ */ -- cgit v1.2.3 From 67333973b64d7e1882505fa195ab439d07eb13f4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Feb 2000 01:13:33 +0000 Subject: added some missing tokens, fixed some errors --- include/GL/glext.h | 69 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 63 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 3978af5e4ad..8fdc1e028cd 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -111,9 +111,9 @@ GLAPI void APIENTRY glCopyTexSubImage3DEXT(GLenum target, GLint level, GLint xof #define GL_FILTER4_SGIS ? #define GL_TEXTURE_FILTER4_SIZE_SGIS ? -GLAPI void APIENTRY glGetTexFilterFuncSGIS(GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +GLAPI void APIENTRY glGetTexFilterFuncSGIS(GLenum target, GLenum filter, GLfloat *weights); -GLAPI void APIENTRY glTexFilterFuncSGIS(GLenum target, GLenum filter, GLfloat *weights); +GLAPI void APIENTRY glTexFilterFuncSGIS(GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); #endif /* GL_SGI_texture_filter4 */ @@ -313,6 +313,18 @@ GLAPI void APIENTRY glGetColorTableSGI(GLenum target, GLenum format, GLenum type +/* + * ?. GL_SGIX_pixel_texture + */ +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 + +GLAPI void APIENTRY glPixelTexGenSGIX(GLenum mode); + +#endif /* GL_SGIX_pixel_texture */ + + + /* * 15. GL_SGIS_pixel_texture */ @@ -326,8 +338,12 @@ GLAPI void APIENTRY glGetColorTableSGI(GLenum target, GLenum format, GLenum type GLAPI void APIENTRY glPixelTexGenParameterfSGIS(GLenum target, GLfloat value); +GLAPI void APIENTRY glPixelTexGenParameterfvSGIS(GLenum target, const GLfloat *value); + GLAPI void APIENTRY glPixelTexGenParameteriSGIS(GLenum target, GLint value); +GLAPI void APIENTRY glPixelTexGenParameterivSGIS(GLenum target, const GLint *value); + GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS(GLenum target, GLfloat *value); GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS(GLenum target, GLint *value); @@ -353,7 +369,7 @@ GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS(GLenum target, GLint *value) #define GL_MAX_4D_TEXTURE_SIZE_SGIS ? #define GL_TEXTURE_4D_BINDING_SGIS ? -GLAPI void APIENTRY glTexImage4DSGIS(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTexImage4DSGIS(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); GLAPI void APIENTRY glTexSubImage4DSGIS(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels); @@ -388,6 +404,47 @@ GLAPI GLboolean APIENTRY glIsTextureEXT(GLuint texture); +/* + * 21. GL_SGIS_detail_texture + */ +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture + +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B + +GLAPI void APIENTRY glDetailTexFuncSGIS(GLenum target, GLsizei n, const GLfloat *points); + +GLAPI void APIENTRY glGetDetailTexFuncSGIS(GLenum target, GLfloat *points); + +#endif /* GL_SGIS_detail_texture */ + + + +/* + * 22. GL_SGIS_sharpen_texture + */ +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 + +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 + +GLAPI void APIENTRY glGetSharpenTexFuncSGIS(GLenum target, GLfloat *points); + +GLAPI void APIENTRY glSharpenTexFuncSGIS(GLenum target, GLsizei n, const GLfloat *points); + +#endif /* GL_SGIS_sharpen_texture */ + + + /* * 23. GL_EXT_packed_pixels */ @@ -852,11 +909,11 @@ typedef void (APIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei #define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 #define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 -GLAPI void APIENTRY VertexWeightfEXT(GLfloat weight); +GLAPI void APIENTRY glVertexWeightfEXT(GLfloat weight); -GLAPI void APIENTRY VertexWeightfvEXT(GLfloat *weight); +GLAPI void APIENTRY glVertexWeightfvEXT(const GLfloat *weight); -GLAPI void APIENTRY VertexWeightPointerEXT(GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +GLAPI void APIENTRY glVertexWeightPointerEXT(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); #endif -- cgit v1.2.3 From 4278ec184d297b3923c07742ed71b05e5f0ab2f4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Feb 2000 01:36:17 +0000 Subject: added a bunch of extensions --- include/GL/glext.h | 447 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 446 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 8fdc1e028cd..6608d3b91d2 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -461,6 +461,39 @@ GLAPI void APIENTRY glSharpenTexFuncSGIS(GLenum target, GLsizei n, const GLfloat +/* + * 25. GL_SGIS_multisample + */ + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 + +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC + +GLAPI void APIENTRY glSampleMaskSGIS(GLclampf value, GLboolean invert); + +GLAPI void APIENTRY glSamplePatternSGIS(GLenum pattern); + +#endif /* GL_SGIS_multisample */ + + + /* * 27. GL_EXT_rescale_normal */ @@ -598,6 +631,32 @@ GLAPI void APIENTRY glBlendEquationEXT(GLenum mode); +/* + * 52. GL_SGIX_sprite + */ +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 + +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E + +GLAPI void APIENTRY glSpriteParameterfSGIX(GLenum pname, GLfloat param); + +GLAPI void APIENTRY glSpriteParameterfvSGIX(GLenum pname, const GLfloat *param); + +GLAPI void APIENTRY glSpriteParameteriSGIX(GLenum pname, GLint param); + +GLAPI void APIENTRY glSpriteParameterivSGIX(GLenum pname, const GLint *param); + +#endif /* GL_SGIX_sprite */ + + + /* * 54. GL_EXT_point_parameters */ @@ -619,6 +678,99 @@ typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfl +/* + * 55. GL_SGIX_instruments + */ +#ifndef GL_SGIX_instruments +#define GL_SGIX_instruments 1 + +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 + +GLAPI GLint APIENTRY glGetInstrumentsSGIX(void); + +GLAPI void APIENTRY glInstrumentsBufferSGIX(GLsizei size, GLint *buf); + +GLAPI GLint APIENTRY glPollInstrumentsSGIX(GLint *markerp); + +GLAPI void APIENTRY glReadInstrumentsSGIX(GLint marker); + +GLAPI void APIENTRY glStartInstrumentsSGIX(void); + +GLAPI void APIENTRY glStopInstrumentsSGIX(GLint marker); + +#endif + + +/* + * 57. GL_SGIX_framezoom + */ +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 + +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D + +GLAPI void APIENTRY glFrameZoomSGIX(GLint factor); + +#endif /* GL_SGIX_framezoom */ + + + +/* + * 58. GL_SGIX_tag_sample_buffer + */ +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 + +GLAPI void APIENTRY glTagSampleBufferSGIX(void); + +#endif /* GL_SGIX_tag_sample_buffer */ + + + +/* + * 60. GL_SGIX_reference_plane + */ +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 + +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E + +GLAPI void APIENTRY glReferencePlaneSGIX(const GLdouble *plane); + +#endif /* GL_SGIX_reference_plane */ + + + +/* + * 61. GL_SGIX_flush_raster + */ +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 + +GLAPI void APIENTRY glFlushRasterSGIX(void); + +#endif /* GL_SGIX_flush_raster */ + + + +/* + * 74. GL_EXT_color_subtable + */ + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 + +GLAPI void APIENTRY glColorSubTableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); + +GLAPI void APIENTRY glCopyColorSubTableEXT(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); + +#endif + + /* * 77. GL_PGI_misc_hints */ @@ -702,6 +854,62 @@ GLAPI void APIENTRY glGetColorTableParameterivEXT(GLenum target, GLenum pname, G +/* + * 80. GL_SGIX_list_priority + */ +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 + +#define GL_LIST_PRIORITY_SGIX 0x8182 + +GLAPI void APIENTRY glGetListParameterfvSGIX(GLuint list, GLenum name, GLfloat *param); + +GLAPI void APIENTRY glGetListParameterivSGIX(GLuint list, GLenum name, GLint *param); + +GLAPI void APIENTRY glListParameterfSGIX(GLuint list, GLenum name, GLfloat param); + +GLAPI void APIENTRY glListParameterfvSGIX(GLuint list, GLenum name, const GLfloat *param); + +GLAPI void APIENTRY glListParameteriSGIX(GLuint list, GLenum name, GLint param); + +GLAPI void APIENTRY glListParameterivSGIX(GLuint list, GLenum name, const GLint *param); + +#endif /* GL_SGIX_list_priority */ + + + +/* + * 94. GL_EXT_index_material + */ +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 + +#define GL_INDEX_MATERIAL_EXT ? +#define GL_INDEX_MATERIAL_PARAMETER_EXT ? +#define GL_INDEX_MATERIAL_FACE_EXT ? + +GLAPI void APIENTRY glIndexMaterialEXT(GLenum face, GLenum mode); + +#endif /* GL_EXT_index_material */ + + + +/* + * 95. GL_EXT_index_func + */ +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 + +#define GL_INDEX_TEST_EXT ? +#define GL_INDEX_TEST_FUNC_EXT ? +#define GL_INDEX_TEST_REF_EXT ? + +GLAPI void APIENTRY glIndexFuncEXT(GLenum func, GLfloat ref); + +#endif /* GL_EXT_index_func */ + + + /* * 97. GL_EXT_compiled_vertex_array */ @@ -724,6 +932,9 @@ typedef void (APIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); /* * 98. GL_EXT_cull_vertex */ +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 + #define GL_CULL_VERTEX_EXT 0x81AA #define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB #define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC @@ -734,6 +945,54 @@ GLAPI void APIENTRY glCullParameterfvEXT(GLenum pname, const GLfloat *params); typedef void (APIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); typedef void (APIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); +#endif /* GL_EXT_cull_vertex */ + + + +/* + * 102. GL_SGIX_fragment_lighting + */ +#ifndef GL_SGIX_fragment_lighting +#define GL_SGIX_fragment_lighting 1 + +GLAPI void APIENTRY glFragmentColorMaterialSGIX(GLenum face, GLenum mode); + +GLAPI void APIENTRY glFragmentLightfSGIX(GLenum light, GLenum pname, GLfloat param); + +GLAPI void APIENTRY glFragmentLightfvSGIX(GLenum light, GLenum pname, const GLfloat * params); + +GLAPI void APIENTRY glFragmentLightiSGIX(GLenum light, GLenum pname, GLint param); + +GLAPI void APIENTRY glFragmentLightivSGIX(GLenum light, GLenum pname, const GLint * params); + +GLAPI void APIENTRY glFragmentLightModelfSGIX(GLenum pname, GLfloat param); + +GLAPI void APIENTRY glFragmentLightModelfvSGIX(GLenum pname, const GLfloat * params); + +GLAPI void APIENTRY glFragmentLightModeliSGIX(GLenum pname, GLint param); + +GLAPI void APIENTRY glFragmentLightModelivSGIX(GLenum pname, const GLint * params); + +GLAPI void APIENTRY glFragmentMaterialfSGIX(GLenum face, GLenum pname, GLfloat param); + +GLAPI void APIENTRY glFragmentMaterialfvSGIX(GLenum face, GLenum pname, const GLfloat * params); + +GLAPI void APIENTRY glFragmentMaterialiSGIX(GLenum face, GLenum pname, GLint param); + +GLAPI void APIENTRY glFragmentMaterialivSGIX(GLenum face, GLenum pname, const GLint * params); + +GLAPI void APIENTRY glGetFragmentLightfvSGIX(GLenum light, GLenum pname, GLfloat * params); + +GLAPI void APIENTRY glGetFragmentLightivSGIX(GLenum light, GLenum pname, GLint * params); + +GLAPI void APIENTRY glGetFragmentMaterialfvSGIX(GLenum face, GLenum pname, GLfloat * params); + +GLAPI void APIENTRY glGetFragmentMaterialivSGIX(GLenum face, GLenum pname, GLint * params); + +GLAPI void APIENTRY glLightEnviSGIX(GLenum pname, GLint param); + +#endif /* GL_SGIX_fragment_lighting */ + /* @@ -823,7 +1082,7 @@ GLAPI void APIENTRY glFogCoordPointerEXT(GLenum type, GLsizei stride, const GLvo /* - * 173. GL_EXT_blend_func_separate (AKA GL_INGR_blend_func_separate) + * 173. GL_EXT_blend_func_separate */ #ifndef GL_EXT_blend_func_separate #define GL_EXT_blend_func_separate 1 @@ -839,6 +1098,23 @@ GLAPI void APIENTRY glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, +/* + * 173. GL_INGR_blend_func_separate + */ +#ifndef GL_INGR_blend_func_separate +#define GL_INGR_blend_func_separate 1 + +#define GL_BLEND_DST_RGB_INGR 0x80C8 +#define GL_BLEND_SRC_RGB_INGR 0x80C9 +#define GL_BLEND_DST_ALPHA_INGR 0x80CA +#define GL_BLEND_SRC_ALPHA_INGR 0x80CB + +GLAPI void APIENTRY glBlendFuncSeparateINGR(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + +#endif /* GL_INGR_blend_func_separate */ + + + /* * 176. GL_EXT_stencil_wrap */ @@ -932,6 +1208,60 @@ GLAPI void APIENTRY glVertexWeightPointerEXT(GLint size, GLenum type, GLsizei st +/* + * 190. GL_NV_vertex_array_range + */ +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 + +/* TOKENS? */ + +GLAPI void APIENTRY glFlushVertexArrayRangeNV(void); + +GLAPI void APIENTRY glVertexArrayRangeNV(GLsizei size, const GLvoid * pointer); + +#endif + + + +/* + * 191. GL_NV_register_combiners + */ +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 + +/* TOKENS? */ + +GLAPI void APIENTRY glCombinerParameterfvNV(GLenum pname, const GLfloat * params); + +GLAPI void APIENTRY glCombinerParameterfNV(GLenum pname, GLfloat param); + +GLAPI void APIENTRY glCombinerParameterivNV(GLenum pname, const GLint * params); + +GLAPI void APIENTRY glCombinerParameteriNV(GLenum pname, GLint param); + +GLAPI void APIENTRY glCombinerInputNV(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); + +GLAPI void APIENTRY glCombinerOutputNV(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); + +GLAPI void APIENTRY glFinalCombinerInputNV(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); + +GLAPI void APIENTRY glGetCombinerInputParameterfvNV(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); + +GLAPI void APIENTRY glGetCombinerInputParameterivNV(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); + +GLAPI void APIENTRY glGetCombinerOutputParameterfvNV(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); + +GLAPI void APIENTRY glGetCombinerOutputParameterivNV(GLenum stage, GLenum portion, GLenum pname, GLint * params); + +GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV(GLenum variable, GLenum pname, GLfloat * params); + +GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV(GLenum variable, GLenum pname, GLint * params); + +#endif /* GL_NV_register_combiners */ + + + /* * 192. GL_NV_fog_distance */ @@ -1021,6 +1351,121 @@ GLAPI void APIENTRY glWindowPos4dvMESA(const GLdouble *p); +/* + * ARB 0. GL_ARB_multitexture + */ +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 + +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + +GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture); +GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture); +GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s); +GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s); +GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s); +GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s); +GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); +GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); +GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); + +#endif /* GL_ARB_multitexture */ + + + +/* + * ARB 2. GL_ARB_tranpose_matrix + */ +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 + +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 + +GLAPI void GLAPIENTRY glLoadTransposeMatrixdARB( const GLdouble m[16] ); +GLAPI void GLAPIENTRY glLoadTransposeMatrixfARB( const GLfloat m[16] ); +GLAPI void GLAPIENTRY glMultTransposeMatrixdARB( const GLdouble m[16] ); +GLAPI void GLAPIENTRY glMultTransposeMatrixfARB( const GLfloat m[16] ); + +#endif /* GL_ARB_tranpose_matrix */ + + + +/* + * ARB 4. GL_ARB_multisample + */ +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 + +GLAPI void GLAPIENTRY glSampleCoverageARB(GLclampf value, GLboolean invert); + +GLAPI void GLAPIENTRY glSamplePassARB(GLenum pass); + +#endif /* GL_ARB_multisample */ + + + #ifdef __cplusplus } #endif -- cgit v1.2.3 From 7d4d54cf94b634b78552d0b4457f98da85142112 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Feb 2000 01:38:29 +0000 Subject: fixed a typo in GL_MESA_resize_buffers --- include/GL/glext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 6608d3b91d2..934c7f6755c 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -1307,7 +1307,7 @@ GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV(GLenum variable, GLenum /* * 196. GL_MESA_resize_bufffers */ -#ifndef GL_MESA_resize_bufffers +#ifndef GL_MESA_resize_buffers #define GL_MESA_resize_buffers 1 GLAPI void APIENTRY glResizeBuffersMESA(void); -- cgit v1.2.3 From f3232bcaf1f875e6a7198e3b5ede3e286ceb04fa Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Feb 2000 23:04:27 +0000 Subject: changed glXCopyContext()'s mask to unsigned long --- include/GL/glx.h | 6 +++--- src/mesa/drivers/x11/fakeglx.c | 6 +++--- src/mesa/drivers/x11/glxapi.c | 5 +++-- src/mesa/drivers/x11/glxapi.h | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index b9c494697ea..d54a6684f64 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,10 +1,10 @@ -/* $Id: glx.h,v 1.10 1999/12/11 09:54:33 brianp Exp $ */ +/* $Id: glx.h,v 1.11 2000/02/23 23:04:27 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 3.3 * - * Copyright (C) 1999 Brian Paul All Rights Reserved. + * 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"), @@ -225,7 +225,7 @@ extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx); extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst, - GLuint mask ); + unsigned long mask ); extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable ); diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index fad572f0901..fd57fba7ee4 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1,4 +1,4 @@ -/* $Id: fakeglx.c,v 1.21 2000/01/27 16:45:50 brianp Exp $ */ +/* $Id: fakeglx.c,v 1.22 2000/02/23 23:09:12 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1207,12 +1207,12 @@ Fake_glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap ) static void Fake_glXCopyContext( Display *dpy, GLXContext src, GLXContext dst, - GLuint mask ) + unsigned long mask ) { XMesaContext xm_src = (XMesaContext) src; XMesaContext xm_dst = (XMesaContext) dst; (void) dpy; - gl_copy_context( xm_src->gl_ctx, xm_dst->gl_ctx, mask ); + gl_copy_context( xm_src->gl_ctx, xm_dst->gl_ctx, (GLuint) mask ); } diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index 2bbe879f953..f46e36062b2 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -1,4 +1,4 @@ -/* $Id: glxapi.c,v 1.10 1999/12/10 15:16:49 brianp Exp $ */ +/* $Id: glxapi.c,v 1.11 2000/02/23 23:09:12 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -169,7 +169,8 @@ XVisualInfo *glXChooseVisual(Display *dpy, int screen, int *list) } -void glXCopyContext(Display *dpy, GLXContext src, GLXContext dst, GLuint mask) +void glXCopyContext(Display *dpy, GLXContext src, GLXContext dst, + unsigned long mask) { struct _glxapi_table *t = get_dispatch(dpy); if (!t) diff --git a/src/mesa/drivers/x11/glxapi.h b/src/mesa/drivers/x11/glxapi.h index 33105f43d88..c9a8f938164 100644 --- a/src/mesa/drivers/x11/glxapi.h +++ b/src/mesa/drivers/x11/glxapi.h @@ -1,4 +1,4 @@ -/* $Id: glxapi.h,v 1.1 1999/11/28 20:07:19 brianp Exp $ */ +/* $Id: glxapi.h,v 1.2 2000/02/23 23:09:12 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -56,7 +56,7 @@ struct _glxapi_table { /* GLX 1.0 functions */ XVisualInfo *(*ChooseVisual)(Display *dpy, int screen, int *list); - void (*CopyContext)(Display *dpy, GLXContext src, GLXContext dst, GLuint mask); + void (*CopyContext)(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask); GLXContext (*CreateContext)(Display *dpy, XVisualInfo *visinfo, GLXContext shareList, Bool direct); GLXPixmap (*CreateGLXPixmap)(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap); void (*DestroyContext)(Display *dpy, GLXContext ctx); -- cgit v1.2.3 From 8814124f35612c007af6d6674a05e398746f6deb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 24 Feb 2000 22:03:21 +0000 Subject: bunch of extension clean-up --- include/GL/gl.h | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index fd8d9688883..aa8a6e9c166 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.31 2000/02/11 20:44:22 brianp Exp $ */ +/* $Id: gl.h,v 1.32 2000/02/24 22:03:21 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1780,7 +1780,7 @@ GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, /* - * XXX these extensions may eventually be moved into a new glext.h file + * XXX these extensions may eventually be moved into glext.h */ @@ -2154,19 +2154,19 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); /* - * GL_INGR_blend_func_separate (EXT number 173) + * GL_EXT_blend_func_separate (EXT number 173) (aka GL_INGR_blend_func_separate) */ -#ifndef GL_INGR_blend_func_separate -#define GL_INGR_blend_func_separate 1 +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 -#define GL_BLEND_DST_RGB_INGR 0x80C8 -#define GL_BLEND_SRC_RGB_INGR 0x80C9 -#define GL_BLEND_DST_ALPHA_INGR 0x80CA -#define GL_BLEND_SRC_ALPHA_INGR 0x80CB +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB -GLAPI void GLAPIENTRY glBlendFuncSeparateINGR( GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha ); +GLAPI void GLAPIENTRY glBlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha ); -#endif /* GL_INGR_blend_func_separate */ +#endif /* GL_EXT_blend_func_separate */ @@ -2196,7 +2196,7 @@ GLAPI void GLAPIENTRY glBlendFuncSeparateINGR( GLenum sfactorRGB, GLenum dfactor /* - * GL_ARB_multitexture (no number) + * GL_ARB_multitexture (ARB 0) */ #ifndef GL_ARB_multitexture #define GL_ARB_multitexture 1 @@ -2277,7 +2277,7 @@ GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); /* - * GL_MESA_window_pos (no number) + * GL_MESA_window_pos (197) */ #ifndef GL_MESA_window_pos #define GL_MESA_window_pos 1 @@ -2312,7 +2312,7 @@ GLAPI void GLAPIENTRY glWindowPos4dvMESA( const GLdouble *p ); /* - * GL_MESA_resize_bufffers (no number) + * GL_MESA_resize_bufffers (196) */ #ifndef GL_MESA_resize_bufffers #define GL_MESA_resize_buffers 1 @@ -2324,7 +2324,7 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); /* - * GL_ARB_tranpose_matrix (number ?) + * GL_ARB_tranpose_matrix (ARB 2) */ #ifndef GL_ARB_transpose_matrix #define GL_ARB_transpose_matrix 1 @@ -2339,7 +2339,21 @@ GLAPI void GLAPIENTRY glLoadTransposeMatrixfARB( const GLfloat m[16] ); GLAPI void GLAPIENTRY glMultTransposeMatrixdARB( const GLdouble m[16] ); GLAPI void GLAPIENTRY glMultTransposeMatrixfARB( const GLfloat m[16] ); -#endif +#endif /* GL_ARB_tranpose_matrix */ + + + +/* + * GL_ARB_multisample (ARB 4) + */ +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 + +GLAPI void GLAPIENTRY glSampleCoverageARB(GLclampf value, GLboolean invert); + +GLAPI void GLAPIENTRY glSamplePassARB(GLenum pass); + +#endif /* GL_ARB_multisample */ -- cgit v1.2.3 From eaba005f189d73995fc13920e523d66e814f8326 Mon Sep 17 00:00:00 2001 From: Jouk Jansen Date: Fri, 25 Feb 2000 12:35:57 +0000 Subject: Committing in . VMS & type-mismatch problems Modified Files: Mesa/include/GL/glext.h Mesa/include/GL/glx.h ---------------------------------------------------------------------- --- include/GL/glext.h | 9 ++++++++- include/GL/glx.h | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 934c7f6755c..588994774c7 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -1250,6 +1250,14 @@ GLAPI void APIENTRY glGetCombinerInputParameterfvNV(GLenum stage, GLenum portion GLAPI void APIENTRY glGetCombinerInputParameterivNV(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); +#ifdef VMS +/*VMS only allows externals of maximal 31 characters! */ +# define glGetCombinerOutputParameterfvNV glGetCombinerOutputParameterfvN +#define glGetCombinerOutputParameterivNV glGetCombinerOutputParameterivN +#define glGetFinalCombinerInputParameterfvNV glGetFnlCmbinerInpParameterfvNV +#define glGetFinalCombinerInputParameterivNV glGetFnlCmbinerInpParameterivNV +#endif + GLAPI void APIENTRY glGetCombinerOutputParameterfvNV(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); GLAPI void APIENTRY glGetCombinerOutputParameterivNV(GLenum stage, GLenum portion, GLenum pname, GLint * params); @@ -1257,7 +1265,6 @@ GLAPI void APIENTRY glGetCombinerOutputParameterivNV(GLenum stage, GLenum portio GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV(GLenum variable, GLenum pname, GLfloat * params); GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV(GLenum variable, GLenum pname, GLint * params); - #endif /* GL_NV_register_combiners */ diff --git a/include/GL/glx.h b/include/GL/glx.h index d54a6684f64..d770fb989e8 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.11 2000/02/23 23:04:27 brianp Exp $ */ +/* $Id: glx.h,v 1.12 2000/02/25 12:35:57 joukj Exp $ */ /* * Mesa 3-D graphics library @@ -225,7 +225,7 @@ extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx); extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst, - unsigned long mask ); + GLuint mask ); extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable ); -- cgit v1.2.3 From f9db0039b161759892e5e9b04334de89ab448811 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 25 Feb 2000 20:30:23 +0000 Subject: added XMesaUnbindContext (for DRI) --- include/GL/xmesa.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index a61258d1c7b..57d1efe549d 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -1,4 +1,4 @@ -/* $Id: xmesa.h,v 1.4 2000/01/13 17:40:12 brianp Exp $ */ +/* $Id: xmesa.h,v 1.5 2000/02/25 20:30:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -245,6 +245,12 @@ extern GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer readBuffer ); +/* + * Unbind the current context from its buffer. + */ +extern GLboolean XMesaUnbindContext( XMesaContext c ); + + /* * Return a handle to the current context. */ -- cgit v1.2.3 From 9f9de170f22f4bc7fc6a31406842fa32b4a92ade Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 25 Feb 2000 20:31:11 +0000 Subject: removed the GET_BITS_PER_PIXEL macro --- include/GL/xmesa_x.h | 3 +-- include/GL/xmesa_xf86.h | 9 +-------- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/GL/xmesa_x.h b/include/GL/xmesa_x.h index c9bb17a53f7..d5fb399b446 100644 --- a/include/GL/xmesa_x.h +++ b/include/GL/xmesa_x.h @@ -30,7 +30,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Authors: * Kevin E. Martin * - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/xmesa_x.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/xmesa_x.h,v 1.2 2000/02/25 20:31:11 brianp Exp $ */ #ifndef _XMESA_X_H_ @@ -78,7 +78,6 @@ typedef XColor XMesaColor; #define GET_REDMASK(__v) __v->visinfo->red_mask #define GET_GREENMASK(__v) __v->visinfo->green_mask #define GET_BLUEMASK(__v) __v->visinfo->blue_mask -#define GET_BITS_PER_PIXEL(__v) bits_per_pixel(__v->display, __v->visinfo) #if defined(__cplusplus) || defined(c_plusplus) #define GET_VISUAL_CLASS(__v) __v->visinfo->c_class #else diff --git a/include/GL/xmesa_xf86.h b/include/GL/xmesa_xf86.h index c52de765357..2be3efe78d1 100644 --- a/include/GL/xmesa_xf86.h +++ b/include/GL/xmesa_xf86.h @@ -30,7 +30,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Authors: * Kevin E. Martin * - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/xmesa_xf86.h,v 1.3 2000/01/17 23:22:57 brianp Exp $ + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/xmesa_xf86.h,v 1.4 2000/02/25 20:31:11 brianp Exp $ */ #ifndef _XMESA_XF86_H_ @@ -179,13 +179,6 @@ do { \ #define GET_REDMASK(__v) __v->visinfo->redMask #define GET_GREENMASK(__v) __v->visinfo->greenMask #define GET_BLUEMASK(__v) __v->visinfo->blueMask - -/*XXX this was wrong. However, using nplanes instead may fail when - * we have overlay planes in the future! - */ -/*#define GET_BITS_PER_PIXEL(__v) __v->visinfo->bitsPerRGBValue*/ -#define GET_BITS_PER_PIXEL(__v) __v->visinfo->nplanes - #define GET_VISUAL_CLASS(__v) __v->visinfo->class #define GET_VISUAL_DEPTH(__v) __v->visinfo->nplanes #define GET_BLACK_PIXEL(__v) __v->display->blackPixel -- cgit v1.2.3 From f5d36aefd10bde366adb268c0dce001afab1cc57 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 25 Feb 2000 21:01:41 +0000 Subject: added GL_HAS_GLEXT --- include/GL/gl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index aa8a6e9c166..55cd9df9f1d 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.32 2000/02/24 22:03:21 brianp Exp $ */ +/* $Id: gl.h,v 1.33 2000/02/25 21:01:41 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -139,6 +139,7 @@ extern "C" { #define GL_VERSION_1_1 1 #define GL_VERSION_1_2 1 +#define GL_HAS_GLEXT 1 -- cgit v1.2.3 From 4c5fb703804661adaeb2437e06e73726b1b9a8cb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 26 Feb 2000 00:48:02 +0000 Subject: added all the PFNGL...PROC typedefs --- include/GL/glext.h | 450 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 291 insertions(+), 159 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 588994774c7..808a2a5a60d 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -55,6 +55,8 @@ extern "C" { GLAPI void APIENTRY glBlendColorEXT(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); + #endif /* GL_EXT_blend_color */ @@ -71,6 +73,8 @@ GLAPI void APIENTRY glBlendColorEXT(GLclampf red, GLclampf green, GLclampf blue, GLAPI void APIENTRY glPolygonOffsetEXT(GLfloat factor, GLfloat bias); +typedef void (APIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); + #endif /* GL_EXT_polygon_offset */ @@ -93,11 +97,13 @@ GLAPI void APIENTRY glPolygonOffsetEXT(GLfloat factor, GLfloat bias); #define GL_TEXTURE_3D_BINDING_EXT 0x806A GLAPI void APIENTRY glTexImage3DEXT(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); - GLAPI void APIENTRY glTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); - GLAPI void APIENTRY glCopyTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + #endif /* GL_EXT_texture3D */ @@ -112,9 +118,11 @@ GLAPI void APIENTRY glCopyTexSubImage3DEXT(GLenum target, GLint level, GLint xof #define GL_TEXTURE_FILTER4_SIZE_SGIS ? GLAPI void APIENTRY glGetTexFilterFuncSGIS(GLenum target, GLenum filter, GLfloat *weights); - GLAPI void APIENTRY glTexFilterFuncSGIS(GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +typedef void (APIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); + #endif /* GL_SGI_texture_filter4 */ @@ -126,11 +134,13 @@ GLAPI void APIENTRY glTexFilterFuncSGIS(GLenum target, GLenum filter, GLsizei n, #define GL_EXT_subtexture 1 GLAPI void APIENTRY glCopyTexSubImage1DEXT(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); - GLAPI void APIENTRY glTexSubImage1DEXT(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); - GLAPI void APIENTRY glTexSubImage2DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); + #endif /* GL_EXT_subtexture */ @@ -142,11 +152,13 @@ GLAPI void APIENTRY glTexSubImage2DEXT(GLenum target, GLint level, GLint xoffset #define GL_EXT_copy_texture 1 GLAPI void APIENTRY glCopyTexImage1DEXT(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); - GLAPI void APIENTRY glCopyTexImage2DEXT(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); - GLAPI void APIENTRY glCopyTexSubImage2DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); + #endif /* GL_EXT_copy_texture */ @@ -157,7 +169,6 @@ GLAPI void APIENTRY glCopyTexSubImage2DEXT(GLenum target, GLint level, GLint xof #ifndef GL_EXT_histogram #define GL_EXT_histogram 1 - #define GL_HISTOGRAM_EXT 0x8024 #define GL_PROXY_HISTOGRAM_EXT 0x8025 #define GL_HISTOGRAM_WIDTH_EXT 0x8026 @@ -170,25 +181,27 @@ GLAPI void APIENTRY glCopyTexSubImage2DEXT(GLenum target, GLint level, GLint xof #define GL_HISTOGRAM_SINK_EXT 0x802D GLAPI void APIENTRY glGetHistogramEXT(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); - GLAPI void APIENTRY glGetHistogramParameterfvEXT(GLenum target, GLenum pname, GLfloat *params); - GLAPI void APIENTRY glGetHistogramParameterivEXT(GLenum target, GLenum pname, GLint *params); - GLAPI void APIENTRY glGetMinmaxEXT(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); - GLAPI void APIENTRY glGetMinmaxParameterfvEXT(GLenum target, GLenum pname, GLfloat *params); - GLAPI void APIENTRY glGetMinmaxParameterivEXT(GLenum target, GLenum pname, GLint *params); - GLAPI void APIENTRY glHistogramEXT(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); - GLAPI void APIENTRY glMinmaxEXT(GLenum target, GLenum internalformat, GLboolean sink); - GLAPI void APIENTRY glResetHistogramEXT(GLenum target); - GLAPI void APIENTRY glResetMinmaxEXT(GLenum target); +typedef void (APIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); + #endif /* GL_EXT_histogram */ @@ -221,31 +234,33 @@ GLAPI void APIENTRY glResetMinmaxEXT(GLenum target); #define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 GLAPI void APIENTRY glConvolutionFilter1DEXT(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); - GLAPI void APIENTRY glConvolutionFilter2DEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); - GLAPI void APIENTRY glConvolutionParameterfEXT(GLenum target, GLenum pname, GLfloat params); - GLAPI void APIENTRY glConvolutionParameterfvEXT(GLenum target, GLenum pname, const GLfloat *params); - GLAPI void APIENTRY glConvolutionParameteriEXT(GLenum target, GLenum pname, GLint params); - GLAPI void APIENTRY glConvolutionParameterivEXT(GLenum target, GLenum pname, const GLint *params); - GLAPI void APIENTRY glCopyConvolutionFilter1DEXT(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); - GLAPI void APIENTRY glCopyConvolutionFilter2DEXT(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); - GLAPI void APIENTRY glGetConvolutionFilterEXT(GLenum target, GLenum format, GLenum type, GLvoid *image); - GLAPI void APIENTRY glGetConvolutionParameterfvEXT(GLenum target, GLenum pname, GLfloat *params); - GLAPI void APIENTRY glGetConvolutionParameterivEXT(GLenum target, GLenum pname, GLint *params); - GLAPI void APIENTRY glGetSeparableFilterEXT(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); - GLAPI void APIENTRY glSeparableFilter2DEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); + #endif /* GL_EXT_convolution */ @@ -296,19 +311,21 @@ GLAPI void APIENTRY glSeparableFilter2DEXT(GLenum target, GLenum internalformat, #define COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF GLAPI void APIENTRY glColorTableParameterfvSGI(GLenum target, GLenum pname, const GLfloat *params); - GLAPI void APIENTRY glColorTableParameterivSGI(GLenum target, GLenum pname, const GLint *params); - GLAPI void APIENTRY glColorTableSGI(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); - GLAPI void APIENTRY glCopyColorTableSGI(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width); - GLAPI void APIENTRY glGetColorTableParameterfvSGI(GLenum target, GLenum pname, GLfloat *params); - GLAPI void APIENTRY glGetColorTableParameterivSGI(GLenum target, GLenum pname, GLint *params); - GLAPI void APIENTRY glGetColorTableSGI(GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); + #endif /* GL_SGI_color_table */ @@ -321,6 +338,8 @@ GLAPI void APIENTRY glGetColorTableSGI(GLenum target, GLenum format, GLenum type GLAPI void APIENTRY glPixelTexGenSGIX(GLenum mode); +typedef void (APIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); + #endif /* GL_SGIX_pixel_texture */ @@ -337,17 +356,19 @@ GLAPI void APIENTRY glPixelTexGenSGIX(GLenum mode); #define GL_PIXEL_GROUP_COLOR_SGIS ? GLAPI void APIENTRY glPixelTexGenParameterfSGIS(GLenum target, GLfloat value); - GLAPI void APIENTRY glPixelTexGenParameterfvSGIS(GLenum target, const GLfloat *value); - GLAPI void APIENTRY glPixelTexGenParameteriSGIS(GLenum target, GLint value); - GLAPI void APIENTRY glPixelTexGenParameterivSGIS(GLenum target, const GLint *value); - GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS(GLenum target, GLfloat *value); - GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS(GLenum target, GLint *value); +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum target, GLfloat value); +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum target, const GLfloat *value); +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum target, GLint value); +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum target, const GLint *value); +typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum target, GLfloat *value); +typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum target, GLint *value); + #endif /* GL_SGIS_pixel_texture */ @@ -370,9 +391,11 @@ GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS(GLenum target, GLint *value) #define GL_TEXTURE_4D_BINDING_SGIS ? GLAPI void APIENTRY glTexImage4DSGIS(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); - GLAPI void APIENTRY glTexSubImage4DSGIS(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels); + #endif /* GL_SGIS_texture4D */ @@ -389,17 +412,19 @@ GLAPI void APIENTRY glTexSubImage4DSGIS(GLenum target, GLint level, GLint xoffse #define GL_TEXTURE_2D_BINDING_EXT 0x8069 GLAPI void APIENTRY glGenTexturesEXT(GLsizei n, GLuint *textures); - GLAPI void APIENTRY glDeleteTexturesEXT(GLsizei n, const GLuint *textures); - GLAPI void APIENTRY glBindTextureEXT(GLenum target, GLuint texture); - GLAPI void APIENTRY glPrioritizeTexturesEXT(GLsizei n, const GLuint *textures, const GLclampf *priorities); - GLAPI GLboolean APIENTRY glAreTexturesResidentEXT(GLsizei n, const GLuint *textures, GLboolean *residences); - GLAPI GLboolean APIENTRY glIsTextureEXT(GLuint texture); +typedef void (APIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); +typedef void (APIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); +typedef void (APIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); +typedef GLboolean (APIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); +typedef GLboolean (APIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); + #endif /* GL_EXT_texture_object */ @@ -419,9 +444,11 @@ GLAPI GLboolean APIENTRY glIsTextureEXT(GLuint texture); #define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B GLAPI void APIENTRY glDetailTexFuncSGIS(GLenum target, GLsizei n, const GLfloat *points); - GLAPI void APIENTRY glGetDetailTexFuncSGIS(GLenum target, GLfloat *points); +typedef void (APIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); + #endif /* GL_SGIS_detail_texture */ @@ -438,9 +465,11 @@ GLAPI void APIENTRY glGetDetailTexFuncSGIS(GLenum target, GLfloat *points); #define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 GLAPI void APIENTRY glGetSharpenTexFuncSGIS(GLenum target, GLfloat *points); - GLAPI void APIENTRY glSharpenTexFuncSGIS(GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +typedef void (APIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); + #endif /* GL_SGIS_sharpen_texture */ @@ -487,9 +516,11 @@ GLAPI void APIENTRY glSharpenTexFuncSGIS(GLenum target, GLsizei n, const GLfloat #define GL_SAMPLE_PATTERN_SGIS 0x80AC GLAPI void APIENTRY glSampleMaskSGIS(GLclampf value, GLboolean invert); - GLAPI void APIENTRY glSamplePatternSGIS(GLenum pattern); +typedef void (APIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); + #endif /* GL_SGIS_multisample */ @@ -546,21 +577,13 @@ GLAPI void APIENTRY glSamplePatternSGIS(GLenum pattern); #define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 GLAPI void APIENTRY glVertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr); - GLAPI void APIENTRY glNormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr); - GLAPI void APIENTRY glColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr); - GLAPI void APIENTRY glIndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr); - GLAPI void APIENTRY glTexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr); - GLAPI void APIENTRY glEdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *ptr); - GLAPI void APIENTRY glGetPointervEXT(GLenum pname, void **params); - GLAPI void APIENTRY glArrayElementEXT(GLint i); - GLAPI void APIENTRY glDrawArraysEXT(GLenum mode, GLint first, GLsizei count); typedef void (APIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); @@ -602,6 +625,8 @@ typedef void (APIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GL GLAPI void APIENTRY glBlendEquationEXT(GLenum mode); +typedef void (APIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); + #endif /* GL_EXT_blend_minmax */ @@ -646,13 +671,15 @@ GLAPI void APIENTRY glBlendEquationEXT(GLenum mode); #define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E GLAPI void APIENTRY glSpriteParameterfSGIX(GLenum pname, GLfloat param); - GLAPI void APIENTRY glSpriteParameterfvSGIX(GLenum pname, const GLfloat *param); - GLAPI void APIENTRY glSpriteParameteriSGIX(GLenum pname, GLint param); - GLAPI void APIENTRY glSpriteParameterivSGIX(GLenum pname, const GLint *param); +typedef void (APIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *param); +typedef void (APIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *param); + #endif /* GL_SGIX_sprite */ @@ -688,17 +715,19 @@ typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfl #define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 GLAPI GLint APIENTRY glGetInstrumentsSGIX(void); - GLAPI void APIENTRY glInstrumentsBufferSGIX(GLsizei size, GLint *buf); - GLAPI GLint APIENTRY glPollInstrumentsSGIX(GLint *markerp); - GLAPI void APIENTRY glReadInstrumentsSGIX(GLint marker); - GLAPI void APIENTRY glStartInstrumentsSGIX(void); - GLAPI void APIENTRY glStopInstrumentsSGIX(GLint marker); +typedef GLint (APIENTRY * PFNGLGETINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRY * PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buf); +typedef GLint (APIENTRY * PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *markerp); +typedef void (APIENTRY * PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); +typedef void (APIENTRY * PFNGLSTARTINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRY * PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); + #endif @@ -714,6 +743,8 @@ GLAPI void APIENTRY glStopInstrumentsSGIX(GLint marker); GLAPI void APIENTRY glFrameZoomSGIX(GLint factor); +typedef void (APIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); + #endif /* GL_SGIX_framezoom */ @@ -726,6 +757,8 @@ GLAPI void APIENTRY glFrameZoomSGIX(GLint factor); GLAPI void APIENTRY glTagSampleBufferSGIX(void); +typedef void (APIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); + #endif /* GL_SGIX_tag_sample_buffer */ @@ -741,6 +774,8 @@ GLAPI void APIENTRY glTagSampleBufferSGIX(void); GLAPI void APIENTRY glReferencePlaneSGIX(const GLdouble *plane); +typedef void (APIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *plane); + #endif /* GL_SGIX_reference_plane */ @@ -753,6 +788,8 @@ GLAPI void APIENTRY glReferencePlaneSGIX(const GLdouble *plane); GLAPI void APIENTRY glFlushRasterSGIX(void); +typedef void (APIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); + #endif /* GL_SGIX_flush_raster */ @@ -765,9 +802,11 @@ GLAPI void APIENTRY glFlushRasterSGIX(void); #define GL_EXT_color_subtable 1 GLAPI void APIENTRY glColorSubTableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); - GLAPI void APIENTRY glCopyColorSubTableEXT(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); + #endif @@ -801,6 +840,8 @@ GLAPI void APIENTRY glCopyColorSubTableEXT(GLenum target, GLsizei start, GLint x GLAPI void APIENTRY glHintPGI(GLenum target, GLint mode); +typedef void (APIENTRY * PFNGLHINTPGIPROC) (GLenum target, GLint mode); + #endif /* GL_PGI_misc_hints */ @@ -829,15 +870,17 @@ GLAPI void APIENTRY glHintPGI(GLenum target, GLint mode); #define GL_COLOR_INDEX16_EXT 0x80E7 GLAPI void APIENTRY glColorTableEXT(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); - GLAPI void APIENTRY glColorSubTableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); - GLAPI void APIENTRY glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid *table); - GLAPI void APIENTRY glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat *params); - GLAPI void APIENTRY glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); + #endif /* GL_EXT_paletted_texture */ @@ -863,17 +906,19 @@ GLAPI void APIENTRY glGetColorTableParameterivEXT(GLenum target, GLenum pname, G #define GL_LIST_PRIORITY_SGIX 0x8182 GLAPI void APIENTRY glGetListParameterfvSGIX(GLuint list, GLenum name, GLfloat *param); - GLAPI void APIENTRY glGetListParameterivSGIX(GLuint list, GLenum name, GLint *param); - GLAPI void APIENTRY glListParameterfSGIX(GLuint list, GLenum name, GLfloat param); - GLAPI void APIENTRY glListParameterfvSGIX(GLuint list, GLenum name, const GLfloat *param); - GLAPI void APIENTRY glListParameteriSGIX(GLuint list, GLenum name, GLint param); - GLAPI void APIENTRY glListParameterivSGIX(GLuint list, GLenum name, const GLint *param); +typedef void (APIENTRY * PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum name, GLfloat *param); +typedef void (APIENTRY * PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum name, GLint *param); +typedef void (APIENTRY * PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum name, GLfloat param); +typedef void (APIENTRY * PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum name, const GLfloat *param); +typedef void (APIENTRY * PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum name, GLint param); +typedef void (APIENTRY * PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum name, const GLint *param); + #endif /* GL_SGIX_list_priority */ @@ -890,6 +935,8 @@ GLAPI void APIENTRY glListParameterivSGIX(GLuint list, GLenum name, const GLint GLAPI void APIENTRY glIndexMaterialEXT(GLenum face, GLenum mode); +typedef void (APIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); + #endif /* GL_EXT_index_material */ @@ -906,6 +953,8 @@ GLAPI void APIENTRY glIndexMaterialEXT(GLenum face, GLenum mode); GLAPI void APIENTRY glIndexFuncEXT(GLenum func, GLfloat ref); +typedef void (APIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); + #endif /* GL_EXT_index_func */ @@ -956,41 +1005,43 @@ typedef void (APIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* pa #define GL_SGIX_fragment_lighting 1 GLAPI void APIENTRY glFragmentColorMaterialSGIX(GLenum face, GLenum mode); - GLAPI void APIENTRY glFragmentLightfSGIX(GLenum light, GLenum pname, GLfloat param); - GLAPI void APIENTRY glFragmentLightfvSGIX(GLenum light, GLenum pname, const GLfloat * params); - GLAPI void APIENTRY glFragmentLightiSGIX(GLenum light, GLenum pname, GLint param); - GLAPI void APIENTRY glFragmentLightivSGIX(GLenum light, GLenum pname, const GLint * params); - GLAPI void APIENTRY glFragmentLightModelfSGIX(GLenum pname, GLfloat param); - GLAPI void APIENTRY glFragmentLightModelfvSGIX(GLenum pname, const GLfloat * params); - GLAPI void APIENTRY glFragmentLightModeliSGIX(GLenum pname, GLint param); - GLAPI void APIENTRY glFragmentLightModelivSGIX(GLenum pname, const GLint * params); - GLAPI void APIENTRY glFragmentMaterialfSGIX(GLenum face, GLenum pname, GLfloat param); - GLAPI void APIENTRY glFragmentMaterialfvSGIX(GLenum face, GLenum pname, const GLfloat * params); - GLAPI void APIENTRY glFragmentMaterialiSGIX(GLenum face, GLenum pname, GLint param); - GLAPI void APIENTRY glFragmentMaterialivSGIX(GLenum face, GLenum pname, const GLint * params); - GLAPI void APIENTRY glGetFragmentLightfvSGIX(GLenum light, GLenum pname, GLfloat * params); - GLAPI void APIENTRY glGetFragmentLightivSGIX(GLenum light, GLenum pname, GLint * params); - GLAPI void APIENTRY glGetFragmentMaterialfvSGIX(GLenum face, GLenum pname, GLfloat * params); - GLAPI void APIENTRY glGetFragmentMaterialivSGIX(GLenum face, GLenum pname, GLint * params); - GLAPI void APIENTRY glLightEnviSGIX(GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat * params); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint * params); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat * params); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint * params); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat * params); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint * params); +typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat * params); +typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint * params); +typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat * params); +typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint * params); +typedef void (APIENTRY * PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); + #endif /* GL_SGIX_fragment_lighting */ @@ -1036,15 +1087,17 @@ GLAPI void APIENTRY glLightEnviSGIX(GLenum pname, GLint param); #define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 GLAPI void APIENTRY glFogCoordfEXT(GLfloat coord); - GLAPI void APIENTRY glFogCoordfvEXT(const GLfloat * coord); - GLAPI void APIENTRY glFogCoorddEXT(GLdouble coord); - GLAPI void APIENTRY glFogCoorddvEXT(const GLdouble * coord); - GLAPI void APIENTRY glFogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid * pointer); +typedef void (APIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat * coord); +typedef void (APIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble * coord); +typedef void (APIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid * pointer); + #endif @@ -1094,6 +1147,8 @@ GLAPI void APIENTRY glFogCoordPointerEXT(GLenum type, GLsizei stride, const GLvo GLAPI void APIENTRY glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + #endif /* GL_EXT_blend_func_separate */ @@ -1111,6 +1166,8 @@ GLAPI void APIENTRY glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, GLAPI void APIENTRY glBlendFuncSeparateINGR(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + #endif /* GL_INGR_blend_func_separate */ @@ -1186,11 +1243,13 @@ typedef void (APIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei #define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 GLAPI void APIENTRY glVertexWeightfEXT(GLfloat weight); - GLAPI void APIENTRY glVertexWeightfvEXT(const GLfloat *weight); - GLAPI void APIENTRY glVertexWeightPointerEXT(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + #endif @@ -1217,9 +1276,10 @@ GLAPI void APIENTRY glVertexWeightPointerEXT(GLint size, GLenum type, GLsizei st /* TOKENS? */ GLAPI void APIENTRY glFlushVertexArrayRangeNV(void); - GLAPI void APIENTRY glVertexArrayRangeNV(GLsizei size, const GLvoid * pointer); +typedef void (APIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); + #endif @@ -1232,39 +1292,43 @@ GLAPI void APIENTRY glVertexArrayRangeNV(GLsizei size, const GLvoid * pointer); /* TOKENS? */ -GLAPI void APIENTRY glCombinerParameterfvNV(GLenum pname, const GLfloat * params); +#ifdef VMS +/*VMS only allows externals of maximal 31 characters! */ +#define glGetCombinerOutputParameterfvNV glGetCombinerOutputParameterfvN +#define glGetCombinerOutputParameterivNV glGetCombinerOutputParameterivN +#define glGetFinalCombinerInputParameterfvNV glGetFnlCmbinerInpParameterfvNV +#define glGetFinalCombinerInputParameterivNV glGetFnlCmbinerInpParameterivNV +#endif +GLAPI void APIENTRY glCombinerParameterfvNV(GLenum pname, const GLfloat * params); GLAPI void APIENTRY glCombinerParameterfNV(GLenum pname, GLfloat param); - GLAPI void APIENTRY glCombinerParameterivNV(GLenum pname, const GLint * params); - GLAPI void APIENTRY glCombinerParameteriNV(GLenum pname, GLint param); - GLAPI void APIENTRY glCombinerInputNV(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); - GLAPI void APIENTRY glCombinerOutputNV(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); - GLAPI void APIENTRY glFinalCombinerInputNV(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); - GLAPI void APIENTRY glGetCombinerInputParameterfvNV(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); - GLAPI void APIENTRY glGetCombinerInputParameterivNV(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); - -#ifdef VMS -/*VMS only allows externals of maximal 31 characters! */ -# define glGetCombinerOutputParameterfvNV glGetCombinerOutputParameterfvN -#define glGetCombinerOutputParameterivNV glGetCombinerOutputParameterivN -#define glGetFinalCombinerInputParameterfvNV glGetFnlCmbinerInpParameterfvNV -#define glGetFinalCombinerInputParameterivNV glGetFnlCmbinerInpParameterivNV -#endif - GLAPI void APIENTRY glGetCombinerOutputParameterfvNV(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); - GLAPI void APIENTRY glGetCombinerOutputParameterivNV(GLenum stage, GLenum portion, GLenum pname, GLint * params); - GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV(GLenum variable, GLenum pname, GLfloat * params); - GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV(GLenum variable, GLenum pname, GLint * params); + +typedef void (APIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei size, const GLvoid * pointer); +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat * params); +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint * params); +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); +typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); +typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat * params); +typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint * params); +typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat * params); +typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint * params); + #endif /* GL_NV_register_combiners */ @@ -1319,6 +1383,8 @@ GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV(GLenum variable, GLenum GLAPI void APIENTRY glResizeBuffersMESA(void); +typedef void (APIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); + #endif /* GL_MESA_resize_bufffers */ @@ -1354,6 +1420,30 @@ GLAPI void APIENTRY glWindowPos4svMESA(const GLshort *p); GLAPI void APIENTRY glWindowPos4fvMESA(const GLfloat *p); GLAPI void APIENTRY glWindowPos4dvMESA(const GLdouble *p); +typedef void (APIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint *p); +typedef void (APIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *p); +typedef void (APIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *p); +typedef void (APIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *p); +typedef void (APIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint *p); +typedef void (APIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *p); +typedef void (APIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *p); +typedef void (APIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *p); +typedef void (APIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint *p); +typedef void (APIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *p); +typedef void (APIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *p); +typedef void (APIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *p); + #endif /* GL_MESA_window_pos */ @@ -1400,40 +1490,75 @@ GLAPI void APIENTRY glWindowPos4dvMESA(const GLdouble *p); #define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 #define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 -GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture); -GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture); -GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s); -GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s); -GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s); -GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s); -GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); -GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); -GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); -GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); -GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); -GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); +GLAPI void APIENTRY glActiveTextureARB(GLenum texture); +GLAPI void APIENTRY glClientActiveTextureARB(GLenum texture); +GLAPI void APIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s); +GLAPI void APIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s); +GLAPI void APIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord1iARB(GLenum target, GLint s); +GLAPI void APIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s); +GLAPI void APIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); +GLAPI void APIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); +GLAPI void APIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); +GLAPI void APIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); +GLAPI void APIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void APIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void APIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); +GLAPI void APIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void APIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void APIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void APIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void APIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void APIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); + +typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); #endif /* GL_ARB_multitexture */ @@ -1450,10 +1575,15 @@ GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); #define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 #define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 -GLAPI void GLAPIENTRY glLoadTransposeMatrixdARB( const GLdouble m[16] ); -GLAPI void GLAPIENTRY glLoadTransposeMatrixfARB( const GLfloat m[16] ); -GLAPI void GLAPIENTRY glMultTransposeMatrixdARB( const GLdouble m[16] ); -GLAPI void GLAPIENTRY glMultTransposeMatrixfARB( const GLfloat m[16] ); +GLAPI void APIENTRY glLoadTransposeMatrixdARB( const GLdouble m[16] ); +GLAPI void APIENTRY glLoadTransposeMatrixfARB( const GLfloat m[16] ); +GLAPI void APIENTRY glMultTransposeMatrixdARB( const GLdouble m[16] ); +GLAPI void APIENTRY glMultTransposeMatrixfARB( const GLfloat m[16] ); + +typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) ( const GLdouble m[16] ); +typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) ( const GLfloat m[16] ); +typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) ( const GLdouble m[16] ); +typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) ( const GLfloat m[16] ); #endif /* GL_ARB_tranpose_matrix */ @@ -1465,9 +1595,11 @@ GLAPI void GLAPIENTRY glMultTransposeMatrixfARB( const GLfloat m[16] ); #ifndef GL_ARB_multisample #define GL_ARB_multisample 1 -GLAPI void GLAPIENTRY glSampleCoverageARB(GLclampf value, GLboolean invert); +GLAPI void APIENTRY glSamplePassARB(GLenum pass); +GLAPI void APIENTRY glSampleCoverageARB(GLclampf value, GLboolean invert); -GLAPI void GLAPIENTRY glSamplePassARB(GLenum pass); +typedef void (APIENTRY * PFNGLSAMPLEPASSARBPROC) (GLenum pass); +typedef void (APIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); #endif /* GL_ARB_multisample */ -- cgit v1.2.3 From 0f21a5d36b5ec77e19fd660af90c09eab684fec5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Feb 2000 18:12:41 +0000 Subject: added a bit of GLAPIENTRY, APIENTRY setup --- include/GL/glext.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 808a2a5a60d..a8580b4260b 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -23,6 +23,10 @@ extern "C" { #define GLAPI extern #endif +#ifdef GLAPIENTRY +#define APIENTRY GLAPIENTRY +#endif + #ifndef APIENTRY #define APIENTRY #endif -- cgit v1.2.3 From 3994b77bab8c62a4c1a4dffdfba233ef46662b99 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Feb 2000 18:26:54 +0000 Subject: changed glXCopyContext() mask to unsigned long, per GLX spec --- include/GL/glx.h | 4 ++-- src/mesa/drivers/x11/fakeglx.c | 4 ++-- src/mesa/drivers/x11/glxapi.c | 4 ++-- src/mesa/drivers/x11/glxapi.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index d770fb989e8..a1d28bcc7fe 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.12 2000/02/25 12:35:57 joukj Exp $ */ +/* $Id: glx.h,v 1.13 2000/02/27 18:26:54 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -225,7 +225,7 @@ extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx); extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst, - GLuint mask ); + unsigned long mask ); extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable ); diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index c9e5a2b1cc4..152e661e983 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1,4 +1,4 @@ -/* $Id: fakeglx.c,v 1.23 2000/02/25 17:04:42 brianp Exp $ */ +/* $Id: fakeglx.c,v 1.24 2000/02/27 18:26:54 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1207,7 +1207,7 @@ Fake_glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap ) static void Fake_glXCopyContext( Display *dpy, GLXContext src, GLXContext dst, - GLuint mask ) + unsigned long mask ) { XMesaContext xm_src = (XMesaContext) src; XMesaContext xm_dst = (XMesaContext) dst; diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index 73fbba3263c..ffdfe65ac0d 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -1,4 +1,4 @@ -/* $Id: glxapi.c,v 1.14 2000/02/25 17:04:42 brianp Exp $ */ +/* $Id: glxapi.c,v 1.15 2000/02/27 18:26:54 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -169,7 +169,7 @@ XVisualInfo *glXChooseVisual(Display *dpy, int screen, int *list) } -void glXCopyContext(Display *dpy, GLXContext src, GLXContext dst, GLuint mask) +void glXCopyContext(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask) { struct _glxapi_table *t = get_dispatch(dpy); if (!t) diff --git a/src/mesa/drivers/x11/glxapi.h b/src/mesa/drivers/x11/glxapi.h index 64102c45bf8..27d62d8fae1 100644 --- a/src/mesa/drivers/x11/glxapi.h +++ b/src/mesa/drivers/x11/glxapi.h @@ -1,4 +1,4 @@ -/* $Id: glxapi.h,v 1.3 2000/02/25 17:04:42 brianp Exp $ */ +/* $Id: glxapi.h,v 1.4 2000/02/27 18:26:54 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -56,7 +56,7 @@ struct _glxapi_table { /* GLX 1.0 functions */ XVisualInfo *(*ChooseVisual)(Display *dpy, int screen, int *list); - void (*CopyContext)(Display *dpy, GLXContext src, GLXContext dst, GLuint mask); + void (*CopyContext)(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask); GLXContext (*CreateContext)(Display *dpy, XVisualInfo *visinfo, GLXContext shareList, Bool direct); GLXPixmap (*CreateGLXPixmap)(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap); void (*DestroyContext)(Display *dpy, GLXContext ctx); -- cgit v1.2.3 From 6b729d41f055ec29b8e229663147a1af891a35f1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 1 Mar 2000 03:44:10 +0000 Subject: added GL_GLEXT_VERSION_EXT --- include/GL/glext.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index a8580b4260b..4c7ccbb2fb6 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -32,6 +32,8 @@ extern "C" { #endif +#define GL_GLEXT_VERSION_EXT 1 + /* * 1. GL_EXT_abgr -- cgit v1.2.3 From 4c7e3c29f7cbf9443b7abe11881504fff3cbfcc2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 3 Mar 2000 15:00:14 +0000 Subject: changes to _WIN32 test and APIENTRY test --- include/GL/glext.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 4c7ccbb2fb6..bfbaaa81530 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -14,7 +14,7 @@ extern "C" { #endif -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CYGWIN32__) #define WIN32_LEAN_AND_MEAN 1 #include #endif @@ -23,7 +23,7 @@ extern "C" { #define GLAPI extern #endif -#ifdef GLAPIENTRY +#if defined(GLAPIENTRY) && !defined(APIENTRY) #define APIENTRY GLAPIENTRY #endif -- cgit v1.2.3 From 54ec0cbfa9b42a0f03c6a5fe945cac94b37e4885 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 3 Mar 2000 15:35:51 +0000 Subject: removed GLX_VERSION_1_3 for now --- include/GL/glx.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index a1d28bcc7fe..e3a580bc814 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.13 2000/02/27 18:26:54 brianp Exp $ */ +/* $Id: glx.h,v 1.14 2000/03/03 15:35:51 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -50,7 +50,6 @@ extern "C" { #define GLX_VERSION_1_1 1 #define GLX_VERSION_1_2 1 -#define GLX_VERSION_1_3 1 #define GLX_EXTENSION_NAME "GLX" -- cgit v1.2.3 From 3f600e47cf36080abbc00a1f08c7e80fd5137a67 Mon Sep 17 00:00:00 2001 From: Jouk Jansen Date: Mon, 6 Mar 2000 12:59:24 +0000 Subject: Committing in . VMS : C++ & Xlib.h problems. Modified Files: Mesa/include/GL/glx.h ---------------------------------------------------------------------- --- include/GL/glx.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index e3a580bc814..fcea293f9b9 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.14 2000/03/03 15:35:51 brianp Exp $ */ +/* $Id: glx.h,v 1.15 2000/03/06 12:59:24 joukj Exp $ */ /* * Mesa 3-D graphics library @@ -30,8 +30,20 @@ #define GLX_H +#ifdef __VMS +# ifdef __cplusplus +/* VMS Xlib.h gives problems with C++. + * this avoids a bunch of trivial warnings */ +#pragma message disable nosimpint +#endif +#endif #include #include +#ifdef __VMS +# ifdef __cplusplus +#pragma message enable nosimpint +#endif +#endif #include "GL/gl.h" #ifdef MESA #include "GL/xmesa.h" -- cgit v1.2.3 From 64eef48741a858c6783eea33d7646014af8be09b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 7 Mar 2000 17:55:40 +0000 Subject: added GL_HP_occlusion_test, GL_EXT_texture_lod_bias --- include/GL/glext.h | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index bfbaaa81530..9588692ac38 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -32,7 +32,14 @@ extern "C" { #endif -#define GL_GLEXT_VERSION_EXT 1 +/* + * Versions: + * 1. Brian Paul, 24 Feb 2000 + * Intial Version + * 2. Brian Paul, 7 Mar 2000 + * Added GL_HP_occlusion_test, GL_EXT_texture_lod_bias + */ +#define GL_GLEXT_VERSION_EXT 2 /* @@ -1065,6 +1072,19 @@ typedef void (APIENTRY * PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +/* + * 137. GL_HP_occlusion_test + */ +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 + +#define GL_OCCLUSION_TEST_HP 0x? +#define GL_OCCLUSION_TEST_RESULT_HP 0x? + +#endif /* GL_HP_occlusion_test */ + + + /* * 141. GL_EXT_shared_texture_palette (req's GL_EXT_paletted_texture) */ @@ -1216,6 +1236,19 @@ typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLe +/* + * 186. GL_EXT_texture_lod_bias + */ +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 + +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 + +#endif /* GL_EXT_texture_lod_bias */ + + + /* * ??. GL_WIN_swap_hint */ -- cgit v1.2.3 From 9aafc4fd5d92ff0f81f20a3b0d4152ad0dc2f1f7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 11 Mar 2000 23:24:01 +0000 Subject: gave temp values to GL_HP_occlusion_test tokens --- include/GL/glext.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 9588692ac38..b88ddc02991 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -1078,8 +1078,8 @@ typedef void (APIENTRY * PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); #ifndef GL_HP_occlusion_test #define GL_HP_occlusion_test 1 -#define GL_OCCLUSION_TEST_HP 0x? -#define GL_OCCLUSION_TEST_RESULT_HP 0x? +#define GL_OCCLUSION_TEST_HP 0x1 +#define GL_OCCLUSION_TEST_RESULT_HP 0x2 #endif /* GL_HP_occlusion_test */ -- cgit v1.2.3 From 3cb112129998e8a4ae8499b47a7c5325ef08bc64 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 13 Mar 2000 15:48:51 +0000 Subject: added final GL_HP_occlusion_test values --- include/GL/glext.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index b88ddc02991..1365e9d05bf 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -1078,8 +1078,8 @@ typedef void (APIENTRY * PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); #ifndef GL_HP_occlusion_test #define GL_HP_occlusion_test 1 -#define GL_OCCLUSION_TEST_HP 0x1 -#define GL_OCCLUSION_TEST_RESULT_HP 0x2 +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 #endif /* GL_HP_occlusion_test */ -- cgit v1.2.3 From 66ae25078ef01bcfa2e9eb1ccdbbb5f038c71179 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 20 Mar 2000 19:26:01 +0000 Subject: patched for Cygwin (Sven Panne) --- include/GL/glut.h | 2 +- src/glut/glx/glut_input.c | 2 ++ src/glut/glx/glut_joy.c | 2 ++ src/glut/glx/glutint.h | 2 +- src/glut/glx/glutwin32.h | 48 ++++++++++++++++++++++++++++++++++++++++++++ src/glut/glx/win32_util.c | 6 ++---- src/glut/glx/win32_winproc.c | 6 +----- 7 files changed, 57 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/GL/glut.h b/include/GL/glut.h index 225bb87e525..20605cb358d 100644 --- a/include/GL/glut.h +++ b/include/GL/glut.h @@ -108,7 +108,7 @@ extern _CRTIMP void __cdecl exit(int); and redifinition of Windows system defs, also removes requirement of pretty much any standard windows header from this file */ -#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) +#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__) # define GLUTAPIENTRY __stdcall #else # define GLUTAPIENTRY diff --git a/src/glut/glx/glut_input.c b/src/glut/glx/glut_input.c index a8d3c61cfe4..eea96349eaf 100644 --- a/src/glut/glx/glut_input.c +++ b/src/glut/glx/glut_input.c @@ -20,7 +20,9 @@ #include #else #include +#ifndef __CYGWIN32__ #include /* Win32 Multimedia API header. */ +#endif #endif /* !_WIN32 */ #include "glutint.h" diff --git a/src/glut/glx/glut_joy.c b/src/glut/glx/glut_joy.c index a7db032f534..a6f54f4a6a1 100644 --- a/src/glut/glx/glut_joy.c +++ b/src/glut/glx/glut_joy.c @@ -7,8 +7,10 @@ #ifdef _WIN32 #include +#ifndef __CYGWIN32 #include /* Win32 Multimedia API header. */ #endif +#endif #include "glutint.h" diff --git a/src/glut/glx/glutint.h b/src/glut/glx/glutint.h index 554958ed013..6c825819c09 100644 --- a/src/glut/glx/glutint.h +++ b/src/glut/glx/glutint.h @@ -24,7 +24,7 @@ #define GLUT_BUILDING_LIB /* Building the GLUT library itself. */ #include -#if defined( MESA ) && defined( _WIN32 ) +#if defined(MESA) && defined(_WIN32) && !defined(__CYGWIN32__) #include #endif diff --git a/src/glut/glx/glutwin32.h b/src/glut/glx/glutwin32.h index 08523890192..304eeb20a22 100644 --- a/src/glut/glx/glutwin32.h +++ b/src/glut/glx/glutwin32.h @@ -40,9 +40,57 @@ #define XA_STRING 0 /* Private routines from win32_util.c */ +#ifndef __CYGWIN32__ extern int gettimeofday(struct timeval* tp, void* tzp); +#endif extern void *__glutFont(void *font); extern int __glutGetTransparentPixel(Display *dpy, XVisualInfo *vinfo); extern void __glutAdjustCoords(Window parent, int *x, int *y, int *width, int *height); + +/* Cygwin B20.1 misses the following definitions */ +#ifdef __CYGWIN32__ + +/* from winuser.h */ +#define CDS_FULLSCREEN 4 + +/* from mmsystem.h */ +#define WINMMAPI __declspec(dllimport) +typedef UINT MMRESULT; + +#define MM_JOY1MOVE 0x3A0 +#define MM_JOY1ZMOVE 0x3A2 +#define MM_JOY1BUTTONDOWN 0x3B5 +#define MM_JOY1BUTTONUP 0x3B7 + +#define JOYERR_NOERROR 0 +#define JOYERR_PARMS 165 + +#define JOY_RETURNALL 0x000000ffl + +#define JOYSTICKID1 0 + +typedef struct joyinfoex_tag { + DWORD dwSize; /* size of structure */ + DWORD dwFlags; /* flags to indicate what to return */ + DWORD dwXpos; /* x position */ + DWORD dwYpos; /* y position */ + DWORD dwZpos; /* z position */ + DWORD dwRpos; /* rudder/4th axis position */ + DWORD dwUpos; /* 5th axis position */ + DWORD dwVpos; /* 6th axis position */ + DWORD dwButtons; /* button states */ + DWORD dwButtonNumber; /* current button number pressed */ + DWORD dwPOV; /* point of view state */ + DWORD dwReserved1; /* reserved for communication between winmm & driver */ + DWORD dwReserved2; /* reserved for future expansion */ +} JOYINFOEX, *PJOYINFOEX, /* NEAR */ *NPJOYINFOEX, /* FAR */ *LPJOYINFOEX; + +WINMMAPI MMRESULT WINAPI joyGetPosEx( UINT uJoyID, LPJOYINFOEX pji); +WINMMAPI MMRESULT WINAPI joyReleaseCapture( UINT uJoyID); +WINMMAPI MMRESULT WINAPI joySetCapture( HWND hwnd, UINT uJoyID, UINT uPeriod, BOOL fChanged); +WINMMAPI MMRESULT WINAPI joySetThreshold( UINT uJoyID, UINT uThreshold); + +#endif + #endif /* __glutwin32_h__ */ diff --git a/src/glut/glx/win32_util.c b/src/glut/glx/win32_util.c index 8dc714c035d..d05d1d1e82b 100644 --- a/src/glut/glx/win32_util.c +++ b/src/glut/glx/win32_util.c @@ -11,11 +11,7 @@ #include "glutint.h" #include "glutstroke.h" #include "glutbitmap.h" -#if defined(__CYGWIN32__) -typedef MINMAXINFO* LPMINMAXINFO; -#else #include -#endif /* The following added by Paul Garceau */ #if defined(__MINGW32__) @@ -27,6 +23,7 @@ struct timeval; extern StrokeFontRec glutStrokeRoman, glutStrokeMonoRoman; extern BitmapFontRec glutBitmap8By13, glutBitmap9By15, glutBitmapTimesRoman10, glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12, glutBitmapHelvetica18; +#ifndef __CYGWIN32__ int gettimeofday(struct timeval* tp, void* tzp) { @@ -39,6 +36,7 @@ gettimeofday(struct timeval* tp, void* tzp) /* 0 indicates that the call succeeded. */ return 0; } +#endif /* To get around the fact that Microsoft DLLs only allow functions to be exported and now data addresses (as Unix DSOs support), the diff --git a/src/glut/glx/win32_winproc.c b/src/glut/glx/win32_winproc.c index 2607a205cd6..945b7eb9ca9 100644 --- a/src/glut/glx/win32_winproc.c +++ b/src/glut/glx/win32_winproc.c @@ -8,13 +8,9 @@ #include "glutint.h" -#if defined(__CYGWIN32__) -typedef MINMAXINFO* LPMINMAXINFO; -#else #include -#endif -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__CYGWIN32__) #include /* Win32 Multimedia API header. */ #endif -- cgit v1.2.3 From 1ea2d444fac993615c3329ce309066a4d07a8da9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 20 Mar 2000 19:26:51 +0000 Subject: Cygwin changes, removed two ARB extensions, now in glext.h --- include/GL/gl.h | 42 +++++------------------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 55cd9df9f1d..d575c9f2331 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.33 2000/02/25 21:01:41 brianp Exp $ */ +/* $Id: gl.h,v 1.34 2000/03/20 19:26:51 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -99,7 +99,7 @@ /* compatability guard so we don't need to change client code */ -#if defined(_WIN32) && !defined(_WINDEF_) && !defined(OPENSTEP) +#if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP) # define CALLBACK GLCALLBACK typedef int (GLAPIENTRY *PROC)(); typedef void *HGLRC; @@ -107,9 +107,10 @@ typedef void *HDC; typedef unsigned long COLORREF; #endif -#if defined(_WIN32) && !defined(_WINGDI_) && !defined(OPENSTEP) +#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) # define WGL_FONT_LINES 0 # define WGL_FONT_POLYGONS 1 +#ifndef _GNU_H_WINDOWS32_FUNCTIONS # ifdef UNICODE # define wglUseFontBitmaps wglUseFontBitmapsW # define wglUseFontOutlines wglUseFontOutlinesW @@ -117,6 +118,7 @@ typedef unsigned long COLORREF; # 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; @@ -2324,40 +2326,6 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); -/* - * GL_ARB_tranpose_matrix (ARB 2) - */ -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 - -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 - -GLAPI void GLAPIENTRY glLoadTransposeMatrixdARB( const GLdouble m[16] ); -GLAPI void GLAPIENTRY glLoadTransposeMatrixfARB( const GLfloat m[16] ); -GLAPI void GLAPIENTRY glMultTransposeMatrixdARB( const GLdouble m[16] ); -GLAPI void GLAPIENTRY glMultTransposeMatrixfARB( const GLfloat m[16] ); - -#endif /* GL_ARB_tranpose_matrix */ - - - -/* - * GL_ARB_multisample (ARB 4) - */ -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 - -GLAPI void GLAPIENTRY glSampleCoverageARB(GLclampf value, GLboolean invert); - -GLAPI void GLAPIENTRY glSamplePassARB(GLenum pass); - -#endif /* GL_ARB_multisample */ - - - #if defined(__BEOS__) || defined(__QUICKDRAW__) #pragma export off #endif -- cgit v1.2.3 From d94aa337bfb73822585d22e9ad1fae90d917fbff Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 20 Mar 2000 21:31:15 +0000 Subject: removed test for MESA symbol --- include/GL/glx.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index fcea293f9b9..bd44332bb4a 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.15 2000/03/06 12:59:24 joukj Exp $ */ +/* $Id: glx.h,v 1.16 2000/03/20 21:31:15 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -45,9 +45,6 @@ #endif #endif #include "GL/gl.h" -#ifdef MESA -#include "GL/xmesa.h" -#endif #if defined(USE_MGL_NAMESPACE) -- cgit v1.2.3 From d7c4f043feac75368a9a2ae2ef48ac6cca5c8de8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 20 Mar 2000 21:31:29 +0000 Subject: added more extensions, now at version 3 --- include/GL/glext.h | 816 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 801 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 1365e9d05bf..1d18735a680 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -38,8 +38,10 @@ extern "C" { * Intial Version * 2. Brian Paul, 7 Mar 2000 * Added GL_HP_occlusion_test, GL_EXT_texture_lod_bias + * 3. Brian Paul, 20 Mar 2000 + * Added all missing extensions up to number 137 */ -#define GL_GLEXT_VERSION_EXT 2 +#define GL_GLEXT_VERSION_EXT 3 /* @@ -92,6 +94,65 @@ typedef void (APIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bia +/* + * 4. GL_EXT_texture + */ +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 + +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 + +#endif /* GL_EXT_texture */ + + + +/* + * 5. unknown + */ + + + /* * 6. GL_EXT_texture3D */ @@ -140,6 +201,12 @@ typedef void (APIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filt +/* + * 8. unknown + */ + + + /* * 9. GL_EXT_subtexture */ @@ -392,16 +459,16 @@ typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum target, #ifndef GL_SGIS_texture4D #define GL_SGIS_texture4D 1 -#define GL_PACK_SKIP_VOLUMES_SGIS ? -#define GL_PACK_IMAGE_DEPTH_SGIS ? -#define GL_UNPACK_SKIP_VOLUMES_SGIS ? -#define GL_UNPACK_IMAGE_DEPTH_SGIS ? -#define GL_TEXTURE_4D_SGIS ? -#define GL_PROXY_TEXTURE_4D_SGIS ? -#define GL_TEXTURE_4DSIZE_SGIS ? -#define GL_TEXTURE_WRAP_Q_SGIS ? -#define GL_MAX_4D_TEXTURE_SIZE_SGIS ? -#define GL_TEXTURE_4D_BINDING_SGIS ? +#define GL_PACK_SKIP_VOLUMES_SGIS ? +#define GL_PACK_IMAGE_DEPTH_SGIS ? +#define GL_UNPACK_SKIP_VOLUMES_SGIS ? +#define GL_UNPACK_IMAGE_DEPTH_SGIS ? +#define GL_TEXTURE_4D_SGIS ? +#define GL_PROXY_TEXTURE_4D_SGIS ? +#define GL_TEXTURE_4DSIZE_SGIS ? +#define GL_TEXTURE_WRAP_Q_SGIS ? +#define GL_MAX_4D_TEXTURE_SIZE_SGIS ? +#define GL_TEXTURE_4D_BINDING_SGIS ? GLAPI void APIENTRY glTexImage4DSGIS(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); GLAPI void APIENTRY glTexSubImage4DSGIS(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels); @@ -413,6 +480,40 @@ typedef void (APIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level +/* + * 17. GL_SGI_texture_color_table + */ +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 + +#define GL_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD + +#endif /* GL_SGI_texture_color_table */ + + + +/* + * 18. GL_EXT_cmyka + */ +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 + +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F + +#endif /* GL_EXT_cmyka */ + + + +/* + * 19. unknown + */ + + + /* * 20. GL_EXT_texture_object */ @@ -503,6 +604,22 @@ typedef void (APIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, +/* + * 24. GL_SGIS_texture_lod + */ + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 + +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D + +#endif /* GL_SGIS_texture_lod */ + + + /* * 25. GL_SGIS_multisample */ @@ -538,6 +655,12 @@ typedef void (APIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +/* + * 26. unknown + */ + + + /* * 27. GL_EXT_rescale_normal */ @@ -550,6 +673,18 @@ typedef void (APIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +/* + * 28. GLX_EXT_visual_info + */ + + + +/* + * 29. unknown + */ + + + /* * 30. GL_EXT_vertex_array */ @@ -613,6 +748,66 @@ typedef void (APIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GL +/* + * 31. GL_EXT_misc_attribute + */ +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 + +#define MISC_BIT_EXT ? + +#endif /* GL_EXT_misc_attribute */ + + + +/* + * 32. GL_SGIS_generate_mipmap + */ +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 + +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 + +#endif /* GL_SGIS_generate_mipmap */ + + + +/* + * 33. GL_SGIX_clipmap + */ +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 + +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 + +#endif /* GL_SGIX_clipmap */ + + + +/* + * 34. GL_SGIX_shadow + */ +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 + +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D + +#endif /* GL_SGIX_shadow */ + + + /* * 35. GL_SGIS_texture_edge_clamp */ @@ -625,6 +820,18 @@ typedef void (APIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GL +/* + * 36. GL_SGIS_texture_border_clamp + */ +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_SGIS 0x812D + +#endif /* GL_SGIS_texture_border_clamp */ + + + /* * 37. GL_EXT_blend_minmax */ @@ -669,6 +876,70 @@ typedef void (APIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +/* + * 40. GLX_SGI_swap_control + * 41. GLX_SGI_video_sync + * 42. GLX_SGI_make_current_read + * 43. GLX_SGIX_video_source + * 44. GLX_EXT_visual_rating + */ + + + +/* + * 45. GL_SGIX_interlace + */ +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 + +#define GL_INTERLACE_SGIX 0x8094 + +#endif /* GL_SGIX_interlace */ + + + +/* + * 46. unknown + * 47. GLX_EXT_import_context + * 49. GLX_SGIX_fbconfig + * 50. GLX_SGIX_pbuffer + */ + + + +/* + * 51. GL_SGIS_texture_select + */ +#ifndef GL_SGIS_texture_select +#define GL_SGIS_texture_select 1 + +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS0 x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 + +#endif /* GL_SGIS_texture_select */ + + + /* * 52. GL_SGIX_sprite */ @@ -697,6 +968,12 @@ typedef void (APIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GL +/* + * 53. unknown + */ + + + /* * 54. GL_EXT_point_parameters */ @@ -744,6 +1021,22 @@ typedef void (APIENTRY * PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); #endif + +/* + * 56. GL_SGIX_texture_scale_bias + */ +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 + +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C + +#endif /* GL_SGIX_texture_scale_bias */ + + + /* * 57. GL_SGIX_framezoom */ @@ -776,6 +1069,12 @@ typedef void (APIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); +/* + * 59. unknown + */ + + + /* * 60. GL_SGIX_reference_plane */ @@ -808,9 +1107,139 @@ typedef void (APIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); /* - * 74. GL_EXT_color_subtable + * 62. GLX_SGI_cushion */ + + +/* + * 63. GL_SGIX_depth_texture + */ +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 + +#endif /* GL_SGIX_depth_texture */ + + + +/* + * 64. GL_SGIS_fog_function + */ +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 + +#define GL_FOG_FUNC_SGIS ? +#define GL_FOG_FUNC_POINTS_SGIS ? +#define GL_MAX_FOG_FUNC_POINTS_SGIS ? +#define GL_FOG_FUNC_SGIS ? +#define GL_FOG_FUNC_SGIS ? + +#endif /* GL_SGIS_fog_function */ + + + +/* + * 65. GL_SGIX_fog_offset + */ +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 + +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 + +#endif /* GL_SGIX_fog_offset */ + + + +/* + * 66. GL_HP_image_transform + */ +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 + +#define GL_IMAGE_SCALE_X_HP ? +#define GL_IMAGE_SCALE_Y_HP ? +#define GL_IMAGE_TRANSLATE_X_HP ? +#define GL_IMAGE_TRANSLATE_Y_HP ? +#define GL_IMAGE_ROTATE_ANGLE_HP ? +#define GL_IMAGE_ROTATE_ORIGIN_X_HP ? +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP ? +#define GL_IMAGE_MAG_FILTER_HP ? +#define GL_IMAGE_MIN_FILTER_HP ? +#define GL_IMAGE_CUBIC_WEIGHT_HP ? +#define GL_CUBIC_HP ? +#define GL_AVERAGE_HP ? +#define GL_IMAGE_TRANSFORM_2D_HP ? +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP ? +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP ? + +GLAPI void APIENTRY glImageTransformParameteriHP(GLenum target, GLenum pname, const GLint param); +GLAPI void APIENTRY glImageTransformParameterfHP(GLenum target, GLenum pname, const GLfloat param); +GLAPI void APIENTRY glImageTransformParameterivHP(GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glImageTransformParameterfvHP(GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY GetImageTransformParameterivHP(GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetImageTransformParameterfvHP(GLenum target, GLenum pname,const GLfloat* params); + +typedef void (APIENTRY *PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (APIENTRY *PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (APIENTRY *PFNGLIMAGETRANSFORMPARAMETERIVHPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY *PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY *PFNGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY *PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname,const GLfloat* params); + +#endif /* GL_HP_image_transform */ + + + +/* + * 67. GL_HP_convolution_border_modes + */ +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 + +#define GL_IGNORE_BORDER_HP ? +#define GL_CONSTANT_BORDER_HP ? +#define GL_REPLICATE_BORDER_HP ? +#define GL_CONVOLUTION_BORDER_COLOR_HP ? + +#endif /* GL_HP_convolution_border_modes */ + + + +/* + * 68. unknown + */ + + + +/* + * 69. GL_SGIX_texture_add_env + */ +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 + +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE + +#endif /* GL_SGIX_texture_add_env */ + + + +/* + * 70. unknown + * 71. unknown + * 72. unknown + * 73. unknown + */ + + + +/* + * 74. GL_EXT_color_subtable + */ #ifndef GL_EXT_color_subtable #define GL_EXT_color_subtable 1 @@ -823,6 +1252,46 @@ typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei #endif + +/* + * 75. GLU_EXT_object_space_tess + */ + + + +/* + * 76. GL_PGI_vertex_hints + */ +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 + +#define GL_VERTEX_DATA_HINT_PGI 107050 +#define GL_VERTEX_CONSISTENT_HINT_PGI 107051 +#define GL_VATERIAL_SIDE_HINT_PGI 107052 +#define GL_VAX_VERTEX_HINT_PGI 107053 +#define GL_VOLOR3_BIT_PGI 0x00010000 +#define GL_VOLOR4_BIT_PGI 0x00020000 +#define GL_VDGEFLAG_BIT_PGI 0x00040000 +#define GL_VNDEX_BIT_PGI 0x00080000 +#define GL_VAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_VAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_VAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_VAT_EMISSION_BIT_PGI 0x00800000 +#define GL_VAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_VAT_SHININESS_BIT_PGI 0x02000000 +#define GL_VAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_VORMAL_BIT_PGI 0x08000000 +#define GL_VEXCOORD1_BIT_PGI 0x10000000 +#define GL_VEXCOORD2_BIT_PGI 0x20000000 +#define GL_VEXCOORD3_BIT_PGI 0x40000000 +#define GL_VEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 + +#endif /* GL_PGI_vertex_hints */ + + + /* * 77. GL_PGI_misc_hints */ @@ -936,6 +1405,64 @@ typedef void (APIENTRY * PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum name +/* + * 81. GL_SGIX_ir_instrument1 + */ +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 + +#define GL_IR_INSTRUMENT1_SGIX 0x817F + +#endif /* GL_SGIX_ir_instrument1 */ + + + +/* + * 82. unknown + * 83. GLX_SGIX_video_resize + */ + + + +/* + * 84. GL_SGIX_texture_lod_bias + */ +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 + +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 + +#endif /* GL_SGIX_texture_lod_bias */ + + + +/* + * 85. GLU_SGI_filter4_parameters + * 86. GLX_SGIX_dm_buffer + * 87. unknown + * 88. unknown + * 89. unknown + * 90. unknown + * 91. GLX_SGIX_swap_group + * 92. GLX_SGIX_swap_barrier + */ + + + +/* + * 93. GL_EXT_index_texture + */ +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 + +/* No new tokens or functions */ + +#endif /* GL_EXT_index_texture */ + + + /* * 94. GL_EXT_index_material */ @@ -960,9 +1487,9 @@ typedef void (APIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); #ifndef GL_EXT_index_func #define GL_EXT_index_func 1 -#define GL_INDEX_TEST_EXT ? -#define GL_INDEX_TEST_FUNC_EXT ? -#define GL_INDEX_TEST_REF_EXT ? +#define GL_INDEX_TEST_EXT ? +#define GL_INDEX_TEST_FUNC_EXT ? +#define GL_INDEX_TEST_REF_EXT ? GLAPI void APIENTRY glIndexFuncEXT(GLenum func, GLfloat ref); @@ -972,6 +1499,25 @@ typedef void (APIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); +/* + * 96. GL_EXT_index_array_formats + */ +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 + +#define GL_IUI_V2F_EXT ? +#define GL_IUI_V3F_EXT ? +#define GL_IUI_N3F_V2F_EXT ? +#define GL_IUI_N3F_V3F_EXT ? +#define GL_T2F_IUI_V2F_EXT ? +#define GL_T2F_IUI_V3F_EXT ? +#define GL_T2F_IUI_N3F_V2F_EXT ? +#define GL_T2F_IUI_N3F_V3F_EXT ? + +#endif /* GL_EXT_index_array_formats */ + + + /* * 97. GL_EXT_compiled_vertex_array */ @@ -1011,6 +1557,31 @@ typedef void (APIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* pa +/* + * 99. unknown + */ + + + +/* + * 100. GLU_EXT_nurbs_tessellator + */ + + + +/* + * 101. GL_SGIX_ycrcb + */ +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 + +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC + +#endif /* GL_SGIX_ycrcb */ + + + /* * 102. GL_SGIX_fragment_lighting */ @@ -1059,6 +1630,164 @@ typedef void (APIENTRY * PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +/* + * 103. unknown + * 104. unknown + * 105. unknown + * 106. unknown + * 107. unknown + * 108. unknown + * 109. unknown + */ + + + +/* + * 110. GL_IBM_rasterpos_clip + */ +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 + +#endif /* GL_IBM_rasterpos_clip */ + + + +/* + * 111. GL_HP_texture_lighting + */ +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 + +#define GL_TEXTURE_LIGHTING_MODE_HP ? +#define GL_TEXTURE_POST_SPECULAR_HP ? +#define GL_TEXTURE_PRE_SPECULAR_HP ? + +#endif /* GL_HP_texture_lighting */ + + + +/* + * 112. GL_EXT_draw_range_elements + */ +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 + +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 + +GLAPI void APIENTRY glDrawRangeElementsEXT(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); + +typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); + +#endif /* GL_EXT_draw_range_elements */ + + + +/* + * 113. GL_WIN_phong_shading + */ +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 + +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB + +#endif /* GL_WIN_phong_shading */ + + + +/* + * 114. GL_WIN_specular_fog + */ +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 + +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC + +#endif /* GL_WIN_specular_fog */ + + + +/* + * 115. unknown + * 116. unknown + */ + + + +/* + * 117. GL_EXT_light_texture + */ +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 + +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +/* XXX this symbol collides with the same in GL_EXT_fog_coord and they +** have different values! We're disabling this one since it's the less +** common of the two extensions. +#define GL_FRAGMENT_DEPTH_EXT 0x834B +**/ +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 + +GLAPI void APIENTRY glApplyTextureEXT(GLenum mode); +GLAPI void APIENTRY glTextureLightEXT(GLenum pname); +GLAPI void APIENTRY glTextureMaterialEXT(GLenum face, GLenum mode); + +typedef void (APIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); + +#endif /* GL_EXT_light_texture */ + + + +/* + * 118. unknown + */ + + + +/* + * 119. GL_SGIX_blend_alpha_minmax + */ +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 + +#endif /* GL_SGIX_blend_alpha_minmax */ + + + +/* + * 120. GL_EXT_scene_marker + */ +#ifndef GL_EXT_scene_marker +#define GL_EXT_scene_marker 1 + +#endif /* GL_EXT_scene_marker */ + + + +/* + * 121. unknown + * 122. unknown + * 123. unknown + * 124. unknown + * 125. unknown + * 126. unknown + * 127. unknown + * 128. unknown + */ + + + /* * 129. GL_EXT_bgra */ @@ -1072,6 +1801,63 @@ typedef void (APIENTRY * PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +/* + * 130. unknown + * 131. unknown + * 132. unknown + * 133. unknown + * 134. unknown + */ + + + +/* + * 135. GL_INTEL_texture_scissor + */ +#ifndef GL_INTEL_texture_scissor +#define GL_INTEL_texture_scissor 1 + +#define TEXTURE_SCISSOR_INTEL ? +#define TEXTURE_SCISSOR_S_INTEL ? +#define TEXTURE_SCISSOR_T_INTEL ? +#define TEXTURE_SCISSOR_R_INTEL ? + +GLAPI void APIENTRY glTexScissorINTEL(GLenum target, GLclampf tlow, GLclampf thigh); +GLAPI void APIENTRY glTexScissorFuncINTEL(GLenum target, GLenum lfunc, GLenum hfunc); + +typedef void (APIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh); +typedef void (APIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc); + +#endif /* GL_INTEL_texture_scissor */ + + + +/* + * 136. GL_INTEL_parallel_arrays + */ +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 + +#define GL_PARALLEL_ARRAYS_INTEL ? +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL ? +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL ? +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL ? +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL ? + +GLAPI void APIENTRY glVertexPointervINTEL(GLint size, GLenum type, const void ** pointer); +GLAPI void APIENTRY glNormalPointervINTEL(GLenum type, const void** pointer); +GLAPI void APIENTRY glColorPointervINTEL(GLint size, GLenum type, const void** pointer); +GLAPI void APIENTRY glTexCoordPointervINTEL(GLint size, GLenum type, const void** pointer); + +typedef void (APIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void ** pointer); +typedef void (APIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer); +typedef void (APIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (APIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); + +#endif /* GL_INTEL_parallel_arrays */ + + + /* * 137. GL_HP_occlusion_test */ -- cgit v1.2.3 From 08627219583482c4d187016b4fb8bf8ffad3253d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 23 Mar 2000 16:54:50 +0000 Subject: removed some unpopular extensions (now in glext.h) --- include/GL/gl.h | 53 +---------------------------------------------------- 1 file changed, 1 insertion(+), 52 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index d575c9f2331..b211ebd88a9 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.34 2000/03/20 19:26:51 brianp Exp $ */ +/* $Id: gl.h,v 1.35 2000/03/23 16:54:50 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2032,40 +2032,6 @@ GLAPI void GLAPIENTRY glPointParameterfvEXT( GLenum pname, const GLfloat *params -/* - * GL_PGI_misc_hints (number 77) - */ -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 - -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 -#define GL_STRICT_LIGHTING_HINT_PGI 107031 -#define GL_STRICT_SCISSOR_HINT_PGI 107032 -#define GL_FULL_STIPPLE_HINT_PGI 107033 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 -#define GL_CONSERVE_MEMORY_HINT_PGI 107005 -#define GL_RECLAIM_MEMORY_HINT_PGI 107006 -#define GL_ALWAYS_FAST_HINT_PGI 107020 -#define GL_ALWAYS_SOFT_HINT_PGI 107021 -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 -#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 -#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 -#define GL_ALLOW_DRAW_SPN_HINT_PGI 107024 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 -#define GL_CLIP_NEAR_HINT_PGI 107040 -#define GL_CLIP_FAR_HINT_PGI 107041 -#define GL_WIDE_LINE_HINT_PGI 107042 -#define GL_BACK_NORMALS_HINT_PGI 107043 -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 - -GLAPI void GLAPIENTRY glHintPGI(GLenum target, GLint mode); - -#endif /* GL_PGI_misc_hints */ - - - /* * GL_EXT_paletted_texture (number 78) */ @@ -2156,23 +2122,6 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); -/* - * GL_EXT_blend_func_separate (EXT number 173) (aka GL_INGR_blend_func_separate) - */ -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 - -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB - -GLAPI void GLAPIENTRY glBlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha ); - -#endif /* GL_EXT_blend_func_separate */ - - - /* * GL_NV_texgen_reflection (number 179) */ -- cgit v1.2.3 From afb8c934703cc89c395a0efefed6edfa8ebc7a76 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 24 Mar 2000 19:16:19 +0000 Subject: version 4, all extensions up to 197, added some missing enum values --- include/GL/glext.h | 738 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 698 insertions(+), 40 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 1d18735a680..6a7a8c9a386 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -40,8 +40,10 @@ extern "C" { * Added GL_HP_occlusion_test, GL_EXT_texture_lod_bias * 3. Brian Paul, 20 Mar 2000 * Added all missing extensions up to number 137 + * 4. Brian Paul, 23 Mar 2000 + * Now have all extenions up to number 197 */ -#define GL_GLEXT_VERSION_EXT 3 +#define GL_GLEXT_VERSION_EXT 4 /* @@ -188,8 +190,8 @@ typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint le #ifndef GL_SGI_texture_filter4 #define GL_SGI_texture_filter4 1 -#define GL_FILTER4_SGIS ? -#define GL_TEXTURE_FILTER4_SIZE_SGIS ? +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 GLAPI void APIENTRY glGetTexFilterFuncSGIS(GLenum target, GLenum filter, GLfloat *weights); GLAPI void APIENTRY glTexFilterFuncSGIS(GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); @@ -416,6 +418,9 @@ typedef void (APIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum forma #ifndef GL_SGIX_pixel_texture #define GL_SGIX_pixel_texture 1 +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B + GLAPI void APIENTRY glPixelTexGenSGIX(GLenum mode); typedef void (APIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); @@ -459,16 +464,16 @@ typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum target, #ifndef GL_SGIS_texture4D #define GL_SGIS_texture4D 1 -#define GL_PACK_SKIP_VOLUMES_SGIS ? -#define GL_PACK_IMAGE_DEPTH_SGIS ? -#define GL_UNPACK_SKIP_VOLUMES_SGIS ? -#define GL_UNPACK_IMAGE_DEPTH_SGIS ? -#define GL_TEXTURE_4D_SGIS ? -#define GL_PROXY_TEXTURE_4D_SGIS ? -#define GL_TEXTURE_4DSIZE_SGIS ? -#define GL_TEXTURE_WRAP_Q_SGIS ? -#define GL_MAX_4D_TEXTURE_SIZE_SGIS ? -#define GL_TEXTURE_4D_BINDING_SGIS ? +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F GLAPI void APIENTRY glTexImage4DSGIS(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); GLAPI void APIENTRY glTexSubImage4DSGIS(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels); @@ -1132,11 +1137,9 @@ typedef void (APIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); #ifndef GL_SGIS_fog_function #define GL_SGIS_fog_function 1 -#define GL_FOG_FUNC_SGIS ? -#define GL_FOG_FUNC_POINTS_SGIS ? -#define GL_MAX_FOG_FUNC_POINTS_SGIS ? -#define GL_FOG_FUNC_SGIS ? -#define GL_FOG_FUNC_SGIS ? +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C #endif /* GL_SGIS_fog_function */ @@ -1184,12 +1187,12 @@ GLAPI void APIENTRY glImageTransformParameterfvHP(GLenum target, GLenum pname, c GLAPI void APIENTRY GetImageTransformParameterivHP(GLenum target, GLenum pname, const GLint *params); GLAPI void APIENTRY glGetImageTransformParameterfvHP(GLenum target, GLenum pname,const GLfloat* params); -typedef void (APIENTRY *PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); -typedef void (APIENTRY *PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); -typedef void (APIENTRY *PFNGLIMAGETRANSFORMPARAMETERIVHPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY *PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY *PFNGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY *PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname,const GLfloat* params); +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname,const GLfloat* params); #endif /* GL_HP_image_transform */ @@ -1559,11 +1562,6 @@ typedef void (APIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* pa /* * 99. unknown - */ - - - -/* * 100. GLU_EXT_nurbs_tessellator */ @@ -1871,6 +1869,52 @@ typedef void (APIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum typ +/* + * 138. GL_EXT_pixel_transform + */ +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 + +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 + +GLAPI void APIENTRY glPixelTransformParameteriEXT(GLenum target, GLenum pname, const GLint param); +GLAPI void APIENTRY glPixelTransformParameterfEXT(GLenum target, GLenum pname, const GLfloat param); +GLAPI void APIENTRY glPixelTransformParameterivEXT(GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glPixelTransformParameterfvEXT(GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetPixelTransformParameterivEXT(GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetPixelTransformParameterfvEXT(GLenum target, GLenum pname, const GLfloat *params); + +#endif /* #define GL_EXT_pixel_transform */ + + + +/* + * 139. GL_EXT_pixel_transform_color_table + */ +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 + +#define GL_PIXEL_TRANSFORM_COLOR_TABLE_EXT ? +#define GL_PROXY_PIXEL_TRANSFORM_COLOR_TABLE_EXT ? + +#endif + + + +/* + * 140. unknown + */ + + + /* * 141. GL_EXT_shared_texture_palette (req's GL_EXT_paletted_texture) */ @@ -1883,6 +1927,147 @@ typedef void (APIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum typ +/* + * 142. unknown + * 143. unknown + */ + + + +/* + * 144. GL_EXT_separate_specular_color + */ +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 + +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA + +#endif /* GL_EXT_separate_specular_color */ + + + +/* + * 145. GL_EXT_secondary_color + */ +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 + +#define GLCOLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E + +GLAPI void APIENTRY glSecondaryColor3bEXT(GLbyte red, GLbyte green, GLbyte blue); +GLAPI void APIENTRY glSecondaryColor3dEXT(GLdouble red, GLdouble green, GLdouble blue); +GLAPI void APIENTRY glSecondaryColor3fEXT(GLfloat red, GLfloat green, GLfloat blue); +GLAPI void APIENTRY glSecondaryColor3iEXT(GLint red, GLint green, GLint blue); +GLAPI void APIENTRY glSecondaryColor3sEXT(GLshort red, GLshort green, GLshort blue); +GLAPI void APIENTRY glSecondaryColor3ubEXT(GLubyte red, GLubyte green, GLubyte blue); +GLAPI void APIENTRY glSecondaryColor3uiEXT(GLuint red, GLuint green, GLuint blue); +GLAPI void APIENTRY glSecondaryColor3usEXT(GLushort red, GLushort green, GLushort blue); +GLAPI void APIENTRY glSecondaryColor4bEXT(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +GLAPI void APIENTRY glSecondaryColor4dEXT(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +GLAPI void APIENTRY glSecondaryColor4fEXT(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void APIENTRY glSecondaryColor4iEXT(GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void APIENTRY glSecondaryColor4sEXT(GLshort red, GLshort green, GLshort blue, GLshort alpha); +GLAPI void APIENTRY glSecondaryColor4ubEXT(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GLAPI void APIENTRY glSecondaryColor4uiEXT(GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLAPI void APIENTRY glSecondaryColor4usEXT(GLushort red, GLushort green, GLushort blue, GLushort alpha); +GLAPI void APIENTRY glSecondaryColor3bvEXT(const GLbyte *v); +GLAPI void APIENTRY glSecondaryColor3dvEXT(const GLdouble *v); +GLAPI void APIENTRY glSecondaryColor3fvEXT(const GLfloat *v); +GLAPI void APIENTRY glSecondaryColor3ivEXT(const GLint *v); +GLAPI void APIENTRY glSecondaryColor3svEXT(const GLshort *v); +GLAPI void APIENTRY glSecondaryColor3ubvEXT(const GLubyte *v); +GLAPI void APIENTRY glSecondaryColor3uivEXT(const GLuint *v); +GLAPI void APIENTRY glSecondaryColor3usvEXT(const GLushort *v); +GLAPI void APIENTRY glSecondaryColor4bvEXT(const GLbyte *v); +GLAPI void APIENTRY glSecondaryColor4dvEXT(const GLdouble *v); +GLAPI void APIENTRY glSecondaryColor4fvEXT(const GLfloat *v); +GLAPI void APIENTRY glSecondaryColor4ivEXT(const GLint *v); +GLAPI void APIENTRY glSecondaryColor4svEXT(const GLshort *v); +GLAPI void APIENTRY glSecondaryColor4ubvEXT(const GLubyte *v); +GLAPI void APIENTRY glSecondaryColor4uivEXT(const GLuint *v); +GLAPI void APIENTRY glSecondaryColor4usvEXT(const GLushort *v); +GLAPI void APIENTRY glSecondaryColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLvoid *pointer); + +#endif /* GL_EXT_secondary_color */ + + + +/* + * 146. GL_EXT_texture_env + */ +#ifndef GL_EXT_texture_env +#define GL_EXT_texture_env 1 + +#define GL_TEXTURE_ENV0_EXT 0x? +#define GL_TEXTURE_ENV1_EXT (GL_TEXTURE_ENV0_EXT+1) +#define GL_TEXTURE_ENV2_EXT (GL_TEXTURE_ENV0_EXT+2) +#define GL_TEXTURE_ENV3_EXT (GL_TEXTURE_ENV0_EXT+3) +#define GL_TEXTURE_ENV4_EXT (GL_TEXTURE_ENV0_EXT+4) +#define GL_TEXTURE_ENV5_EXT (GL_TEXTURE_ENV0_EXT+5) +#define GL_TEXTURE_ENV6_EXT (GL_TEXTURE_ENV0_EXT+6) +#define GL_TEXTURE_ENV7_EXT (GL_TEXTURE_ENV0_EXT+7) +#define GL_TEXTURE_ENV8_EXT (GL_TEXTURE_ENV0_EXT+8) +#define GL_TEXTURE_ENV9_EXT (GL_TEXTURE_ENV0_EXT+9) +#define GL_TEXTURE_ENV10_EXT (GL_TEXTURE_ENV0_EXT+10) +#define GL_TEXTURE_ENV11_EXT (GL_TEXTURE_ENV0_EXT+11) +#define GL_TEXTURE_ENV12_EXT (GL_TEXTURE_ENV0_EXT+12) +#define GL_TEXTURE_ENV13_EXT (GL_TEXTURE_ENV0_EXT+13) +#define GL_TEXTURE_ENV14_EXT (GL_TEXTURE_ENV0_EXT+14) +#define GL_TEXTURE_ENV15_EXT (GL_TEXTURE_ENV0_EXT+15) +#define GL_TEXTURE_ENV_MODE_ALPHA_EXT 0x? +#define GL_ENV_COPY_EXT 0x? +#define GL_ENV_REPLACE_EXT 0x? +#define GL_ENV_MODULATE_EXT 0x? +#define GL_ENV_ADD_EXT 0x? +#define GL_ENV_SUBTRACT_EXT 0x? +#define GL_ENV_REVERSE_SUBTRACT_EXT 0x? +#define GL_ENV_BLEND_EXT 0x? +#define GL_ENV_REVERSE_BLEND_EXT 0x? +#define GL_TEXTURE_ENV_SHIFT_EXT 0x? + +#endif /* GL_EXT_texture_env */ + + + +/* + * 147. GL_EXT_texture_perturb_normal + */ +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 + +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF + +GLAPI void APIENTRY glTextureNormalEXT(GLenum mode); + +typedef void (APIENTRY * PFNGLTEXTURENORMALEXT) (GLenum mode); + +#endif /* GL_EXT_texture_perturb_normal */ + + + +/* + * 148. GL_EXT_multi_draw_arrays + */ +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 + +GLAPI void APIENTRY glMultiDrawArraysEXT(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); + +typedef void (APIENTRY * PFNGLMULTIDRAWARRAYSEXT) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); + +#endif /* GL_EXT_multi_draw_arrays */ + + + /* * 149. GL_EXT_fog_coord */ @@ -1914,6 +2099,106 @@ typedef void (APIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stri +/* + * 150. unknown + * 151. unknown + * 152. unknown + * 153. unknown + * 154. unknown + */ + + + +/* + * 155. GL_REND_screen_coordinates + */ +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 + +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 + +#endif /* GL_REND_screen_coordinates */ + + + +/* + * 156. GL_EXT_coordinate_frame + */ +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 + +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 + +GLAPI void APIENTRY glTangent3bEXT(GLbyte x, GLbyte y, GLbyte z); +GLAPI void APIENTRY glTangent3dEXT(GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glTangent3fEXT(GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTangent3iEXT(GLint x, GLint y, GLint z); +GLAPI void APIENTRY glTangent3sEXT(GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glTangent3bvEXT(const GLbyte *v); +GLAPI void APIENTRY glTangent3dvEXT(const GLdouble *v); +GLAPI void APIENTRY glTangent3fvEXT(const GLfloat *v); +GLAPI void APIENTRY glTangent3ivEXT(const GLint *v); +GLAPI void APIENTRY glTangent3svEXT(const GLshort *v); +GLAPI void APIENTRY glBinormal3bEXT(GLbyte x, GLbyte y, GLbyte z); +GLAPI void APIENTRY glBinormal3dEXT(GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glBinormal3fEXT(GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glBinormal3iEXT(GLint x, GLint y, GLint z); +GLAPI void APIENTRY glBinormal3sEXT(GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glBinormal3bvEXT(const GLbyte *v); +GLAPI void APIENTRY glBinormal3dvEXT(const GLdouble *v); +GLAPI void APIENTRY glBinormal3fvEXT(const GLfloat *v); +GLAPI void APIENTRY glBinormal3ivEXT(const GLint *v); +GLAPI void APIENTRY glBinormal3svEXT(const GLshort *v); +GLAPI void APIENTRY glTangentPointerEXT(GLenum type, GLsizei stride, GLvoid *pointer); +GLAPI void APIENTRY glBinormalPointerEXT(GLenum type, GLsizei stride, GLvoid *pointer); + +typedef void (APIENTRY * PFNGLTANGENT3BEXT) (GLbyte x, GLbyte y, GLbyte z); +typedef void (APIENTRY * PFNGLTANGENT3DEXT) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY * PFNGLTANGENT3FEXT) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTANGENT3IEXT) (GLint x, GLint y, GLint z); +typedef void (APIENTRY * PFNGLTANGENT3SEXT) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * PFNGLTANGENT3BVEXT) (const GLbyte *v); +typedef void (APIENTRY * PFNGLTANGENT3DVEXT) (const GLdouble *v); +typedef void (APIENTRY * PFNGLTANGENT3FVEXT) (const GLfloat *v); +typedef void (APIENTRY * PFNGLTANGENT3IVEXT) (const GLint *v); +typedef void (APIENTRY * PFNGLTANGENT3SVEXT) (const GLshort *v); +typedef void (APIENTRY * PFNGLBINORMAL3BEXT) (GLbyte x, GLbyte y, GLbyte z); +typedef void (APIENTRY * PFNGLBINORMAL3DEXT) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY * PFNGLBINORMAL3FEXT) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLBINORMAL3IEXT) (GLint x, GLint y, GLint z); +typedef void (APIENTRY * PFNGLBINORMAL3SEXT) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * PFNGLBINORMAL3BVEXT) (const GLbyte *v); +typedef void (APIENTRY * PFNGLBINORMAL3DVEXT) (const GLdouble *v); +typedef void (APIENTRY * PFNGLBINORMAL3FVEXT) (const GLfloat *v); +typedef void (APIENTRY * PFNGLBINORMAL3IVEXT) (const GLint *v); +typedef void (APIENTRY * PFNGLBINORMAL3SVEXT) (const GLshort *v); +typedef void (APIENTRY * PFNGLTANGENTPOINTEREXT) (GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (APIENTRY * PFNGLBINORMALPOINTEREXT) (GLenum type, GLsizei stride, GLvoid *pointer); + +#endif /* GL_EXT_coordinate_frame */ + + + +/* + * 157. unknown + */ + + + /* * 158. GL_EXT_texture_env_combine */ @@ -1946,6 +2231,232 @@ typedef void (APIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stri +/* + * 159. GL_APPLE_specular_vector + */ +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 + +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 + +#endif /* GL_APPLE_specular_vector */ + + + +/* + * 160. GL_APPLE_transform_hint + */ +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 + +#define GL_TRANSFORM_HINT_APPLE 0x85B1 + +#endif /* GL_APPLE_transform_hint */ + + + +/* + * 161. unknown + * 162. unknown + */ + + + +/* + * 163. GL_SUNX_constant_data + */ +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 + +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 + +GLAPI void APIENTRY glFinishTextureSUNX(void); + +typedef void (APIENTRY * PFNGLFINISHTEXTURESUNX) (void); + +#endif /* GL_SUNX_constant_data */ + + + +/* + * 164. GL_SUN_global_alpha + */ +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 + +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA + +GLAPI void APIENTRY glGlobalAlphaFactorbSUN(GLbyte factor); +GLAPI void APIENTRY glGlobalAlphaFactorsSUN(GLshort factor); +GLAPI void APIENTRY glGlobalAlphaFactoriSUN(GLint factor); +GLAPI void APIENTRY glGlobalAlphaFactorfSUN(GLfloat factor); +GLAPI void APIENTRY glGlobalAlphaFactordSUN(GLdouble factor); +GLAPI void APIENTRY glGlobalAlphaFactorubSUN(GLubyte factor); +GLAPI void APIENTRY glGlobalAlphaFactorusSUN(GLushort factor); +GLAPI void APIENTRY glGlobalAlphaFactoruiSUN(GLuint factor); + +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORBSUN) (GLbyte factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORSSUN) (GLshort factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORISUN) (GLint factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORFSUN) (GLfloat factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORDSUN) (GLdouble factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUBSUN) (GLubyte factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUSSUN) (GLushort factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUISUN) (GLuint factor); + +#endif /* GL_SUN_global_alpha */ + + + +/* + * 165. GL_SUN_triangle_list + */ +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 + +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_RESTART_SUN 0x01 +#define GL_REPLACE_MIDDLE_SUN 0x02 +#define GL_REPLACE_OLDEST_SUN 0x03 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB + +GLAPI void APIENTRY glReplacementCodeuiSUN(GLuint code); +GLAPI void APIENTRY glReplacementCodeusSUN(GLushort code); +GLAPI void APIENTRY glReplacementCodeubSUN(GLubyte code); +GLAPI void APIENTRY glReplacementCodeuivSUN(const GLuint *code); +GLAPI void APIENTRY glReplacementCodeusvSUN(const GLushort *code); +GLAPI void APIENTRY glReplacementCodeubvSUN(const GLubyte *code); +GLAPI void APIENTRY glReplacementCodePointerSUN(GLenum type, GLsizei stride, const GLvoid *pointer); + +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUISUN) (GLuint code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSSUN) (GLushort code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBSUN) (GLubyte code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVSUN) (const GLuint *code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSVSUN) (const GLushort *code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBVSUN) (const GLubyte *code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEPOINTERSUN) (GLenum type, GLsizei stride, const GLvoid *pointer); + +#endif /* GL_SUN_triangle_list */ + + + +/* + * 166. GL_SUN_vertex + */ +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 + +GLAPI void APIENTRY glColor4ubVertex2fSUN(GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +GLAPI void APIENTRY glColor4ubVertex2fvSUN(const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glColor4ubVertex3fSUN(GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor4ubVertex3fvSUN(const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glColor3fVertex3fSUN(GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor3fVertex3fvSUN(const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glNormal3fVertex3fSUN(GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glNormal3fVertex3fvSUN(const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN(GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN(const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fVertex3fSUN(GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fVertex3fvSUN(const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glTexCoord4fVertex4fSUN(GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glTexCoord4fVertex4fvSUN(const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN(GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN(const GLfloat *tc, const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN(GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN(const GLfloat *tc, const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN(GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN(const GLfloat *tc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN(GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN(const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN(GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN(const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN(GLuint rc, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN(const GLuint *rc, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN(GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN(const GLuint *rc, const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN(GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN(const GLuint *rc, const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN(GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN(const GLuint *rc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN(GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN(const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN(GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN(const GLuint *rc, const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN(GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN(const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN(GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN(const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); + +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FSUN) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FVSUN) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FSUN) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FVSUN) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FSUN) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FVSUN) (const GLfloat *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FSUN) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FVSUN) (const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUN) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUN) (const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FSUN) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUN) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FSUN) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUN) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUN) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUN) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUN) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUN) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUN) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUN) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUN) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUN) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUN) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUN) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUN) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUN) (const GLuint *rc, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUN) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUN) (const GLuint *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUN) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUN) (const GLuint *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUN) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUN) (const GLuint *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUN) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUN) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUN) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUN) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUN) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUN) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUN) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUN) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); + +#endif /* GL_SUN_vertex */ + + + +/* + * 167. WGL_EXT_display_color_table + * 168. WGL_EXT_extensions_string + * 169. WGL_EXT_make_current_read + * 170. WGL_EXT_pixel_format + * 171. WGL_EXT_pbuffer + * 172. WGL_EXT_swap_control + */ + + + /* * 173. GL_EXT_blend_func_separate */ @@ -1984,6 +2495,45 @@ typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLe +/* + * 174. GL_INGR_color_clamp + */ +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 + +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 + +#endif /* GL_INGR_color_clamp */ + + + +/* + * 175. GL_INGR_interlace_read + */ +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 + +#define GL_INTERLACE_READ_INGR 0x8568 + +#endif /* GL_INGR_interlace_read */ + + + /* * 176. GL_EXT_stencil_wrap */ @@ -1997,6 +2547,27 @@ typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLe +/* + * 177. WGL_EXT_depth_float + */ + + + +/* + * 178. GL_EXT_422_pixels + */ +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 + +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF + +#endif /* GL_EXT_422_pixels */ + + + /* * 179. GL_NV_texgen_reflection */ @@ -2010,6 +2581,32 @@ typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLe +/* + * 180. unknown + * 181. unknown + */ + + + +/* + * 182. GL_SUN_convolution_border_modes + */ +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 + +#define GL_WRAP_BORDER_SUN 0x81D4 + +#endif /* GL_SUN_convolution_border_modes */ + + + +/* + * 183. GLX_SUN_transparent_index + * 184. unknown + */ + + + /* * 185. GL_EXT_texture_env_add */ @@ -2036,16 +2633,15 @@ typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLe /* - * ??. GL_WIN_swap_hint + * 187. GL_EXT_texture_filter_anisotropic */ -#ifndef GL_WIN_swap_hint -#define GL_WIN_swap_hint 1 +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 -GLAPI void APIENTRY glAddSwapHintRectWIN(GLint x, GLint y, GLsizei width, GLsizei height); +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84fe +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84ff -typedef void (APIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); - -#endif /* GL_WIN_swap_hint */ +#endif /* GL_EXT_texture_filter_anisotropic */ @@ -2104,6 +2700,7 @@ GLAPI void APIENTRY glFlushVertexArrayRangeNV(void); GLAPI void APIENTRY glVertexArrayRangeNV(GLsizei size, const GLvoid * pointer); typedef void (APIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRY * PFNGLVERTEXARRAYRANGENV) (GLsizei size, const GLvoid * pointer); #endif @@ -2172,6 +2769,12 @@ typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum va +/* + * 193. unknown + */ + + + /* * 194. GL_NV_blend_square */ @@ -2400,10 +3003,10 @@ typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLs #define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 #define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 -GLAPI void APIENTRY glLoadTransposeMatrixdARB( const GLdouble m[16] ); -GLAPI void APIENTRY glLoadTransposeMatrixfARB( const GLfloat m[16] ); -GLAPI void APIENTRY glMultTransposeMatrixdARB( const GLdouble m[16] ); -GLAPI void APIENTRY glMultTransposeMatrixfARB( const GLfloat m[16] ); +GLAPI void APIENTRY glLoadTransposeMatrixdARB(const GLdouble m[16]); +GLAPI void APIENTRY glLoadTransposeMatrixfARB(const GLfloat m[16]); +GLAPI void APIENTRY glMultTransposeMatrixdARB(const GLdouble m[16]); +GLAPI void APIENTRY glMultTransposeMatrixfARB(const GLfloat m[16]); typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) ( const GLdouble m[16] ); typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) ( const GLfloat m[16] ); @@ -2430,6 +3033,61 @@ typedef void (APIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean +/* + * ??. GL_WIN_swap_hint + */ +#ifndef GL_WIN_swap_hint +#define GL_WIN_swap_hint 1 + +GLAPI void APIENTRY glAddSwapHintRectWIN(GLint x, GLint y, GLsizei width, GLsizei height); + +typedef void (APIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); + +#endif /* GL_WIN_swap_hint */ + + + +/* + * ?. GL_IBM_cull_vertex + */ +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 + +#define GL_CULL_VERTEX_IBM 103050 + +#endif /* GL_IBM_cull_vertex */ + + + +/* + * ?. GL_IBM_static_data + */ +#ifndef GL_IBM_static_data +#define GL_IBM_static_data 1 + +#define GL_ALL_STATIC_DATA_IBM 103060 +#define GL_STATIC_VERTEX_ARRAY_IBM 103061 + +GLAPI void APIENTRY glFlushStaticDataIBM(GLenum target); + +typedef void (APIENTRY * PFNGLFLUSHSTATICDATAIBM) (GLenum target); + +#endif /* GL_IBM_static_data */ + + + +/* + * ?. GL_IBM_texture_mirrored_repeat + */ +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_IBM_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_IBM 0x8370 + +#endif /* GL_IBM_texture_mirrored_repeat */ + + + #ifdef __cplusplus } #endif -- cgit v1.2.3 From 23ee049401fdaaa77240a3eb02ca4dcce421a939 Mon Sep 17 00:00:00 2001 From: Randy Frank Date: Tue, 28 Mar 2000 16:59:39 +0000 Subject: Implemented support for the HP occlusion test extension (osmesa and X) --- include/GL/gl.h | 12 ++++- include/GL/osmesa.h | 35 ++++++------- progs/demos/gears.c | 54 ++++++++++++++++++-- progs/demos/osdemo.c | 22 ++++---- src/mesa/drivers/osmesa/osmesa.c | 108 +++++++++++++++++---------------------- src/mesa/main/enums.c | 5 +- src/mesa/main/extensions.c | 4 +- 7 files changed, 143 insertions(+), 97 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index b211ebd88a9..b22295ec339 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.35 2000/03/23 16:54:50 brianp Exp $ */ +/* $Id: gl.h,v 1.36 2000/03/28 16:59:39 rjfrank Exp $ */ /* * Mesa 3-D graphics library @@ -2095,6 +2095,16 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); #endif /* GL_EXT_compiled_vertex_array */ +/* + * 137. GL_HP_occlusion_test + */ +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 + +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 + +#endif /* GL_HP_occlusion_test */ /* diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h index ac66e77e854..9746d74f919 100644 --- a/include/GL/osmesa.h +++ b/include/GL/osmesa.h @@ -1,4 +1,4 @@ -/* $Id: osmesa.h,v 1.4 2000/01/18 17:29:18 brianp Exp $ */ +/* $Id: osmesa.h,v 1.5 2000/03/28 16:59:39 rjfrank Exp $ */ /* * Mesa 3-D graphics library @@ -96,15 +96,6 @@ extern "C" { #define OSMESA_TYPE 0x23 -/* - * Accepted by OSMesaGetBooleanv: - * New in version 3.3 - */ -/* This is based on the HP proposed extension */ -#define OSMESA_OCCLUSION_TEST_RESULT_HP 0x30 - - - typedef struct osmesa_context *OSMesaContext; @@ -211,16 +202,6 @@ GLAPI void GLAPIENTRY OSMesaGetIntegerv( GLint pname, GLint *value ); -/* - * Return a boolean value like glGetBooleanv. - * Input: pname - - * OSMESA_OCCLUSION_TEST_RESULT_HP return current test result - * value - pointer to boolean in which to return result. - */ -GLAPI void GLAPIENTRY OSMesaGetBooleanv( GLint pname, GLboolean *value ); - - - /* * Return the depth buffer associated with an OSMesa context. * Input: c - the OSMesa context @@ -237,6 +218,20 @@ GLAPI GLboolean GLAPIENTRY OSMesaGetDepthBuffer( OSMesaContext c, void **buffer ); +/* + * Return the color buffer associated with an OSMesa context. + * Input: c - the OSMesa context + * Output: width, height - size of buffer in pixels + * format - buffer format (OSMESA_FORMAT) + * buffer - pointer to depth buffer values + * Return: GL_TRUE or GL_FALSE to indicate success or failure. + * + * New in Mesa 3.3. + */ +GLAPI GLboolean GLAPIENTRY OSMesaGetColorBuffer( OSMesaContext c, + GLint *width, GLint *height, + GLint *format, + void **buffer ); #if defined(__BEOS__) || defined(__QUICKDRAW__) diff --git a/progs/demos/gears.c b/progs/demos/gears.c index 91f5eff024e..96e7de2a2b8 100644 --- a/progs/demos/gears.c +++ b/progs/demos/gears.c @@ -1,4 +1,4 @@ -/* $Id: gears.c,v 1.2 1999/10/21 16:39:06 brianp Exp $ */ +/* $Id: gears.c,v 1.3 2000/03/28 16:59:39 rjfrank Exp $ */ /* * 3-D gear wheels. This program is in the public domain. @@ -14,6 +14,9 @@ /* * $Log: gears.c,v $ + * Revision 1.3 2000/03/28 16:59:39 rjfrank + * Implemented support for the HP occlusion test extension (osmesa and X) + * * Revision 1.2 1999/10/21 16:39:06 brianp * added -info command line option * @@ -178,12 +181,14 @@ gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, } static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0; -static GLint gear1, gear2, gear3; +static GLint gear1, gear2, gear3, gear3box; static GLfloat angle = 0.0; static void draw(void) { + GLboolean bRet = GL_TRUE; + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); @@ -206,7 +211,20 @@ draw(void) glPushMatrix(); glTranslatef(-3.1, 4.2, 0.0); glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0); - glCallList(gear3); + +#ifdef GL_HP_occlusion_test + glDepthMask(GL_FALSE); + glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE); + glEnable(GL_OCCLUSION_TEST_HP); + glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet); + glCallList(gear3box); + glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet); + glDepthMask(GL_TRUE); + glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE); + glDisable(GL_OCCLUSION_TEST_HP); +#endif + + if (bRet) glCallList(gear3); glPopMatrix(); glPopMatrix(); @@ -305,6 +323,16 @@ init(int argc, char *argv[]) {0.0, 0.8, 0.2, 1.0}; static GLfloat blue[4] = {0.2, 0.2, 1.0, 1.0}; + static float cube[8][3] = { + {-2.35,-2.35,-0.5}, + { 2.35,-2.35,-0.5}, + { 2.35, 2.35,-0.5}, + {-2.35, 2.35,-0.5}, + {-2.35,-2.35, 0.5}, + { 2.35,-2.35, 0.5}, + { 2.35, 2.35, 0.5}, + {-2.35, 2.35, 0.5}, + }; glLightfv(GL_LIGHT0, GL_POSITION, pos); glEnable(GL_CULL_FACE); @@ -331,6 +359,26 @@ init(int argc, char *argv[]) gear(1.3, 2.0, 0.5, 10, 0.7); glEndList(); + gear3box = glGenLists(1); + glNewList(gear3box, GL_COMPILE); + glDisable(GL_LIGHTING); + glBegin(GL_QUADS); + glVertex3fv(cube[3]); glVertex3fv(cube[2]); + glVertex3fv(cube[1]); glVertex3fv(cube[0]); + glVertex3fv(cube[4]); glVertex3fv(cube[5]); + glVertex3fv(cube[6]); glVertex3fv(cube[7]); + glVertex3fv(cube[0]); glVertex3fv(cube[1]); + glVertex3fv(cube[5]); glVertex3fv(cube[4]); + glVertex3fv(cube[1]); glVertex3fv(cube[2]); + glVertex3fv(cube[6]); glVertex3fv(cube[5]); + glVertex3fv(cube[2]); glVertex3fv(cube[3]); + glVertex3fv(cube[7]); glVertex3fv(cube[6]); + glVertex3fv(cube[3]); glVertex3fv(cube[0]); + glVertex3fv(cube[4]); glVertex3fv(cube[7]); + glEnd(); + glEnable(GL_LIGHTING); + glEndList(); + glEnable(GL_NORMALIZE); if (argc > 1 && strcmp(argv[1], "-info")==0) { diff --git a/progs/demos/osdemo.c b/progs/demos/osdemo.c index 83f29af0703..7411d4ad4e0 100644 --- a/progs/demos/osdemo.c +++ b/progs/demos/osdemo.c @@ -1,4 +1,4 @@ -/* $Id: osdemo.c,v 1.3 2000/03/06 23:56:21 brianp Exp $ */ +/* $Id: osdemo.c,v 1.4 2000/03/28 16:59:39 rjfrank Exp $ */ /* * Demo of off-screen Mesa rendering @@ -75,24 +75,26 @@ static void render_image( void ) glutSolidCone(1.0, 2.0, 16, 1); glPopMatrix(); -#ifdef OSMESA_OCCLUSION_TEST_RESULT_HP +#ifdef GL_HP_occlusion_test { GLboolean bRet; - OSMesaGetBooleanv(OSMESA_OCCLUSION_TEST_RESULT_HP,&bRet); glDepthMask(GL_FALSE); glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE); + glEnable(GL_OCCLUSION_TEST_HP); + glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet); glPushMatrix(); - glTranslatef(0.75, 0.0, -1.0); + glTranslatef(0.75, 0.0, -1.0); glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat ); glutSolidSphere(1.0, 20, 20); glPopMatrix(); - OSMesaGetBooleanv(OSMESA_OCCLUSION_TEST_RESULT_HP,&bRet); + glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet); printf("Occlusion test 1 (result should be 1): %d\n",bRet); glDepthMask(GL_TRUE); glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE); + glDisable(GL_OCCLUSION_TEST_HP); } #endif @@ -102,26 +104,28 @@ static void render_image( void ) glutSolidSphere(1.0, 20, 20); glPopMatrix(); -#ifdef OSMESA_OCCLUSION_TEST_RESULT_HP +#ifdef GL_HP_occlusion_test { GLboolean bRet; - OSMesaGetBooleanv(OSMESA_OCCLUSION_TEST_RESULT_HP,&bRet); glDepthMask(GL_FALSE); glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE); + glEnable(GL_OCCLUSION_TEST_HP); + glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet); /* draw a sphere inside the previous sphere */ glPushMatrix(); - glTranslatef(0.75, 0.0, -1.0); + glTranslatef(0.75, 0.0, -1.0); glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat ); glutSolidSphere(0.5, 20, 20); glPopMatrix(); - OSMesaGetBooleanv(OSMESA_OCCLUSION_TEST_RESULT_HP,&bRet); + glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet); printf("Occlusion test 2 (result should be 0): %d\n",bRet); glDepthMask(GL_TRUE); glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE); + glDisable(GL_OCCLUSION_TEST_HP); } #endif diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 426154df562..3cbfcc453e7 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1,4 +1,4 @@ -/* $Id: osmesa.c,v 1.11 2000/03/17 15:32:29 brianp Exp $ */ +/* $Id: osmesa.c,v 1.12 2000/03/28 16:59:39 rjfrank Exp $ */ /* * Mesa 3-D graphics library @@ -47,6 +47,7 @@ #include "matrix.h" #include "types.h" #include "vb.h" +#include "extensions.h" #endif @@ -74,7 +75,6 @@ struct osmesa_context { void *rowaddr[MAX_HEIGHT]; /* address of first pixel in each image row */ GLboolean yup; /* TRUE -> Y increases upward */ /* FALSE -> Y increases downward */ - GLboolean bVisible; /* TRUE if geometry is visible */ }; @@ -224,7 +224,7 @@ OSMesaCreateContext( GLenum format, OSMesaContext sharelist ) FREE(osmesa); return NULL; } - + gl_extensions_enable(&(osmesa->gl_ctx),"GL_HP_occlusion_test"); osmesa->gl_buffer = gl_create_framebuffer( osmesa->gl_visual, osmesa->gl_visual->DepthBits > 0, @@ -254,7 +254,6 @@ OSMesaCreateContext( GLenum format, OSMesaContext sharelist ) osmesa->rind = rind; osmesa->gind = gind; osmesa->bind = bind; - osmesa->bVisible = GL_FALSE; } return osmesa; } @@ -466,21 +465,6 @@ void GLAPIENTRY OSMesaGetIntegerv( GLint pname, GLint *value ) } } -void GLAPIENTRY OSMesaGetBooleanv( GLint pname, GLboolean *value ) -{ - OSMesaContext ctx = OSMesaGetCurrentContext(); - - switch (pname) { - case OSMESA_OCCLUSION_TEST_RESULT_HP: - *value = ctx->bVisible; - ctx->bVisible = GL_FALSE; - return; - default: - gl_error(&ctx->gl_ctx, GL_INVALID_ENUM, "OSMesaGetBooleanv(pname)" ); - return; - } -} - /* * Return the depth buffer associated with an OSMesa context. * Input: c - the OSMesa context @@ -508,8 +492,31 @@ GLboolean GLAPIENTRY OSMesaGetDepthBuffer( OSMesaContext c, GLint *width, GLint } } - - +/* + * Return the color buffer associated with an OSMesa context. + * Input: c - the OSMesa context + * Output: width, height - size of buffer in pixels + * format - the pixel format (OSMESA_FORMAT) + * buffer - pointer to color buffer values + * Return: GL_TRUE or GL_FALSE to indicate success or failure. + */ +GLboolean GLAPIENTRY OSMesaGetColorBuffer( OSMesaContext c, GLint *width, + GLint *height, GLint *format, void **buffer ) +{ + if (!c->buffer) { + *width = 0; + *height = 0; + *format = 0; + *buffer = 0; + return GL_FALSE; + } else { + *width = c->width; + *height = c->height; + *format = c->format; + *buffer = c->buffer; + return GL_TRUE; + } +} /**********************************************************************/ /*** Device Driver Functions ***/ @@ -711,7 +718,6 @@ static void write_rgba_span( const GLcontext *ctx, GLint gshift = osmesa->gshift; GLint bshift = osmesa->bshift; GLint ashift = osmesa->ashift; - osmesa->bVisible = GL_TRUE; /* if here, the occlusion test is misused */ if (mask) { for (i=0;ibVisible = GL_TRUE; /* if here, the occlusion test is misused */ if (mask) { for (i=0;igshift; GLint bshift = osmesa->bshift; GLint ashift = osmesa->ashift; - osmesa->bVisible = GL_TRUE; /* if here, the occlusion test is misused */ if (mask) { for (i=0;ibVisible = GL_TRUE; /* if here, the occlusion test is misused */ for (i=0;ipixel; @@ -807,7 +810,6 @@ static void write_rgba_pixels( const GLcontext *ctx, GLint gshift = osmesa->gshift; GLint bshift = osmesa->bshift; GLint ashift = osmesa->ashift; - osmesa->bVisible = GL_TRUE; /* if here, the occlusion test is misused */ for (i=0;ibVisible = GL_TRUE; /* if here, the occlusion test is misused */ for (i=0;irind; GLint gind = osmesa->gind; GLint bind = osmesa->bind; - osmesa->bVisible = GL_TRUE; /* if here, the occlusion test is misused */ if (mask) { for (i=0;irind; GLint gind = osmesa->gind; GLint bind = osmesa->bind; - osmesa->bVisible = GL_TRUE; /* if here, the occlusion test is misused */ if (mask) { for (i=0;ibVisible = GL_TRUE; /* if here, the occlusion test is misused */ for (i=0;irind; GLint gind = osmesa->gind; GLint bind = osmesa->bind; - osmesa->bVisible = GL_TRUE; /* if here, the occlusion test is misused */ for (i=0;ipixel); GLubyte gval = UNPACK_GREEN(osmesa->pixel); GLubyte bval = UNPACK_BLUE(osmesa->pixel); - osmesa->bVisible = GL_TRUE; /* if here, the occlusion test is misused */ for (i=0;ibVisible = GL_TRUE; /* if here, the occlusion test is misused */ if (mask) { for (i=0;ibVisible = GL_TRUE; /* if here, the occlusion test is misused */ if (mask) { for (i=0;ibVisible = GL_TRUE; /* if here, the occlusion test is misused */ for (i=0;ipixel; @@ -1124,7 +1117,6 @@ static void write_index_pixels( const GLcontext *ctx, { OSMesaContext osmesa = (OSMesaContext) ctx; GLuint i; - osmesa->bVisible = GL_TRUE; /* if here, the occlusion test is misused */ for (i=0;ibVisible = GL_TRUE; /* if here, the occlusion test is misused */ for (i=0;iVB->ColorPtr->data[pvert]; unsigned long pixel = PACK_RGBA( color[0], color[1], color[2], color[3] ); - osmesa->bVisible = GL_TRUE; /* if here, the occlusion test is misused */ #define INTERP_XY 1 #define CLIP_HACK 1 @@ -1215,7 +1205,6 @@ static void flat_rgba_z_line( GLcontext *ctx, OSMesaContext osmesa = (OSMesaContext) ctx; GLubyte *color = ctx->VB->ColorPtr->data[pvert]; unsigned long pixel = PACK_RGBA( color[0], color[1], color[2], color[3] ); - osmesa->bVisible = GL_TRUE; /* if here, the occlusion test is misused */ #define INTERP_XY 1 #define INTERP_Z 1 @@ -1252,7 +1241,6 @@ static void flat_blend_rgba_line( GLcontext *ctx, GLint rvalue = VB->ColorPtr->data[pvert][0]*avalue; GLint gvalue = VB->ColorPtr->data[pvert][1]*avalue; GLint bvalue = VB->ColorPtr->data[pvert][2]*avalue; - osmesa->bVisible = GL_TRUE; /* if here, the occlusion test is misused */ #define INTERP_XY 1 #define CLIP_HACK 1 @@ -1289,7 +1277,6 @@ static void flat_blend_rgba_z_line( GLcontext *ctx, GLint rvalue = VB->ColorPtr->data[pvert][0]*avalue; GLint gvalue = VB->ColorPtr->data[pvert][1]*avalue; GLint bvalue = VB->ColorPtr->data[pvert][2]*avalue; - osmesa->bVisible = GL_TRUE; /* if here, the occlusion test is misused */ #define INTERP_XY 1 #define INTERP_Z 1 @@ -1329,7 +1316,6 @@ static void flat_blend_rgba_z_line_write( GLcontext *ctx, GLint rvalue = VB->ColorPtr->data[pvert][0]*avalue; GLint gvalue = VB->ColorPtr->data[pvert][1]*avalue; GLint bvalue = VB->ColorPtr->data[pvert][2]*avalue; - osmesa->bVisible = GL_TRUE; /* if here, the occlusion test is misused */ #define INTERP_XY 1 #define INTERP_Z 1 @@ -1470,7 +1456,7 @@ static void smooth_rgba_z_triangle( GLcontext *ctx, GLuint v0, GLuint v1, GLint bshift = osmesa->bshift; GLint ashift = osmesa->ashift; (void) pv; - osmesa->bVisible = GL_TRUE; /* if here, the occlusion test is misused */ + #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define INTERP_RGB 1 @@ -1573,16 +1559,15 @@ static triangle_func choose_triangle_function( GLcontext *ctx ) /**********************************************************************/ #define OCC_STD_MASK_TEST \ - OSMesaContext osmesa = (OSMesaContext) ctx->DriverCtx; \ - if (osmesa->bVisible) return; \ + if (ctx->OcclusionResult) return; \ if (mask) { \ GLuint i; \ for (i=0;ibVisible = GL_TRUE; \ + ((GLcontext *)ctx)->OcclusionResult = GL_TRUE; \ return; \ } \ } else { \ - osmesa->bVisible = GL_TRUE; \ + ((GLcontext *)ctx)->OcclusionResult = GL_TRUE; \ } \ return; @@ -1679,16 +1664,14 @@ static void write_monocolor_pixels_occ( const GLcontext *ctx, static void line_occ( GLcontext *ctx, GLuint vert0, GLuint vert1, GLuint pvert ) { - OSMesaContext osmesa = (OSMesaContext) ctx->DriverCtx; - osmesa->bVisible = GL_TRUE; + ctx->OcclusionResult = GL_TRUE; } static void line_z_occ( GLcontext *ctx, GLuint vert0, GLuint vert1, GLuint pvert ) { - OSMesaContext osmesa = (OSMesaContext) ctx->DriverCtx; - if (osmesa->bVisible) return; + if (ctx->OcclusionResult) return; #define INTERP_XY 1 #define INTERP_Z 1 @@ -1696,7 +1679,7 @@ static void line_z_occ( GLcontext *ctx, #define CLIP_HACK 1 #define PLOT(X,Y) \ if (Z < *zPtr) { \ - osmesa->bVisible = GL_TRUE; \ + ctx->OcclusionResult = GL_TRUE; \ return; \ } @@ -1714,16 +1697,15 @@ static void line_z_occ( GLcontext *ctx, static void triangle_occ( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv ) { - OSMesaContext osmesa = (OSMesaContext) ctx->DriverCtx; - osmesa->bVisible = GL_TRUE; + ctx->OcclusionResult = GL_TRUE; } static void triangle_z_occ( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv ) { - OSMesaContext osmesa = (OSMesaContext) ctx->DriverCtx; - if (osmesa->bVisible) return; + if (ctx->OcclusionResult) return; + #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define INNER_LOOP( LEFT, RIGHT, Y ) \ @@ -1732,7 +1714,7 @@ static void triangle_z_occ( GLcontext *ctx, GLuint v0, GLuint v1, for (i=0;ibVisible = GL_TRUE; \ + ctx->OcclusionResult = GL_TRUE; \ return; \ } \ ffz += fdzdx; \ @@ -1831,15 +1813,17 @@ static void osmesa_update_state( GLcontext *ctx ) * extension use will just cause unnecessary rasterization * to occur. The image will be correct in any case. */ - if ((ctx->Color.IndexMask == 0) && + if ((ctx->Depth.OcclusionTest) && + (((!ctx->Visual->RGBAflag) && + (ctx->Color.IndexMask == 0)) || + ((ctx->Visual->RGBAflag) && (ctx->Color.ColorMask[0] == 0) && (ctx->Color.ColorMask[1] == 0) && (ctx->Color.ColorMask[2] == 0) && - (ctx->Color.ColorMask[3] == 0) && + (ctx->Color.ColorMask[3] == 0))) && + (ctx->Depth.Func == GL_LESS) && (ctx->Stencil.Enabled == GL_FALSE)) { - /* XXX depth.func == GL_LESS ? */ - ctx->Driver.WriteCI32Span = write_index32_span_occ; ctx->Driver.WriteCI8Span = write_index8_span_occ; ctx->Driver.WriteMonoCISpan = write_monoindex_span_occ; @@ -1859,5 +1843,7 @@ static void osmesa_update_state( GLcontext *ctx ) ctx->Driver.LineFunc = line_occ; ctx->Driver.TriangleFunc = triangle_occ; } + } else { + ctx->OcclusionResult = GL_TRUE; } } diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 9c49a810bed..417a76bf3e8 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -1,4 +1,4 @@ -/* $Id: enums.c,v 1.7 2000/03/07 17:54:58 brianp Exp $ */ +/* $Id: enums.c,v 1.8 2000/03/28 16:59:39 rjfrank Exp $ */ /* * Mesa 3-D graphics library @@ -769,6 +769,9 @@ enum_elt all_enums[] = { "GL_CLIENT_ACTIVE_TEXTURE_ARB", 0x84E1 }, { "GL_MAX_TEXTURE_UNITS_ARB", 0x84E2 }, + { "GL_OCCLUSION_TEST_HP", 0x8165 }, + { "GL_OCCLUSION_TEST_RESULT_HP", 0x8166 }, + { "GL_TEXTURE_FILTER_CONTROL_EXT", 0x8500 }, { "GL_TEXTUER_LOD_BIAS_EXT", 0x8501 }, diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index f60ae01de9d..65495a48a09 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -1,4 +1,4 @@ -/* $Id: extensions.c,v 1.20 2000/03/11 23:23:26 brianp Exp $ */ +/* $Id: extensions.c,v 1.21 2000/03/28 16:59:39 rjfrank Exp $ */ /* * Mesa 3-D graphics library @@ -130,7 +130,7 @@ static int set_extension( GLcontext *ctx, const char *name, GLint state ) if (i == ctx->Extensions.ext_list) return 1; - if (i->enabled && !(i->enabled & ALWAYS_ENABLED)) { + if (!(i->enabled & ALWAYS_ENABLED)) { if (i->notify) i->notify( ctx, state ); i->enabled = state; } -- cgit v1.2.3 From a1cfd0f7a1cf661921cbc8e043b3baefde41ee84 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 29 Mar 2000 15:46:53 +0000 Subject: version 5: added texture compression extension --- include/GL/glext.h | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 6a7a8c9a386..9ad3426c741 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -42,8 +42,10 @@ extern "C" { * Added all missing extensions up to number 137 * 4. Brian Paul, 23 Mar 2000 * Now have all extenions up to number 197 + * 5. Brian Paul, 27 Mar 2000 + * Added GL_ARB_texture_compression */ -#define GL_GLEXT_VERSION_EXT 4 +#define GL_GLEXT_VERSION_EXT 5 /* @@ -3033,6 +3035,44 @@ typedef void (APIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean +/* + * ARB ?. GL_ARB_texture_compression + */ +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 + +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 + +GLAPI void APIENTRY glCompressedTexImage3DARB(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage2DARB(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage1DARB(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLsizei imageSize, GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, GLvoid *data); +GLAPI void APIENTRY glGetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img); + +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLsizei imageSize, GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, GLvoid *data); +typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLvoid *img); + +#endif /* GL_ARB_texture_compression */ + + + /* * ??. GL_WIN_swap_hint */ -- cgit v1.2.3 From bd2055cf7e740886e5fce1d814d17ca2662bc64d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 31 Mar 2000 01:03:41 +0000 Subject: added GLX_EXT_visual_rating --- include/GL/glx.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index bd44332bb4a..672a9b860e4 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.16 2000/03/20 21:31:15 brianp Exp $ */ +/* $Id: glx.h,v 1.17 2000/03/31 01:03:41 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -164,7 +164,7 @@ extern "C" { /* - * GLX_EXT_visual_info extension + * 28. GLX_EXT_visual_info extension */ #define GLX_X_VISUAL_TYPE_EXT 0x22 #define GLX_TRANSPARENT_TYPE_EXT 0x23 @@ -173,11 +173,6 @@ extern "C" { #define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 #define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 #define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 - - -/* - * GLX_visual_info extension - */ #define GLX_TRUE_COLOR_EXT 0x8002 #define GLX_DIRECT_COLOR_EXT 0x8003 #define GLX_PSEUDO_COLOR_EXT 0x8004 @@ -189,10 +184,20 @@ extern "C" { #define GLX_TRANSPARENT_INDEX_EXT 0x8009 +/* + * 42. GLX_EXT_visual_rating + */ +#define GLX_VISUAL_CAVEAT_EXT 0x20 +/*#define GLX_NONE_EXT 0x8000*/ +#define GLX_SLOW_VISUALEXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D + + /* * Compile-time extension tests */ #define GLX_EXT_visual_info 1 +#define GLX_EXT_visual_rating 1 #define GLX_MESA_pixmap_colormap 1 #define GLX_MESA_release_buffers 1 #define GLX_MESA_copy_sub_buffer 1 -- cgit v1.2.3 From a5724069f146e840795f1884e7230ff3882bcdb6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 31 Mar 2000 01:04:07 +0000 Subject: added XMesaCreateVisual2() --- include/GL/xmesa.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index 57d1efe549d..59c4a8636b6 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -1,4 +1,4 @@ -/* $Id: xmesa.h,v 1.5 2000/02/25 20:30:23 brianp Exp $ */ +/* $Id: xmesa.h,v 1.6 2000/03/31 01:04:07 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -160,6 +160,23 @@ extern XMesaVisual XMesaCreateVisual( XMesaDisplay *display, GLint accum_size, GLint level ); +extern XMesaVisual XMesaCreateVisual2( XMesaDisplay *display, + XMesaVisualInfo visinfo, + GLboolean rgb_flag, + GLboolean alpha_flag, + GLboolean db_flag, + GLboolean stereo_flag, + GLboolean ximage_flag, + GLint depth_size, + GLint stencil_size, + GLint accum_red_size, + GLint accum_green_size, + GLint accum_blue_size, + GLint accum_alpha_size, + GLint num_samples, + GLint level, + GLint visualCaveat ); + /* * Destroy an XMesaVisual, but not the associated XVisualInfo. */ -- cgit v1.2.3 From 37d34bc12f62c8dfa80364c8d63dc5fec847879f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 31 Mar 2000 14:48:28 +0000 Subject: fixed typo in GLX_SLOW_VISUAL_EXT --- include/GL/glx.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 672a9b860e4..16637efb403 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.17 2000/03/31 01:03:41 brianp Exp $ */ +/* $Id: glx.h,v 1.18 2000/03/31 14:48:28 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -189,7 +189,7 @@ extern "C" { */ #define GLX_VISUAL_CAVEAT_EXT 0x20 /*#define GLX_NONE_EXT 0x8000*/ -#define GLX_SLOW_VISUALEXT 0x8001 +#define GLX_SLOW_VISUAL_EXT 0x8001 #define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D -- cgit v1.2.3 From db5c2748515e401a203e69246c43c61a75c23cc0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 5 Apr 2000 15:33:44 +0000 Subject: updated to version 6 --- include/GL/glext.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 9ad3426c741..09787b97999 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -44,8 +44,10 @@ extern "C" { * Now have all extenions up to number 197 * 5. Brian Paul, 27 Mar 2000 * Added GL_ARB_texture_compression + * 6. Brian Paul, 5 Apr 2000 + * Added GL_ARB_multisample tokens, added GL_ARB_texture_env_add */ -#define GL_GLEXT_VERSION_EXT 5 +#define GL_GLEXT_VERSION_EXT 6 /* @@ -2879,7 +2881,7 @@ typedef void (APIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *p); /* - * ARB 0. GL_ARB_multitexture + * ARB 1. GL_ARB_multitexture */ #ifndef GL_ARB_multitexture #define GL_ARB_multitexture 1 @@ -2995,7 +2997,12 @@ typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLs /* - * ARB 2. GL_ARB_tranpose_matrix + * ARB 2. GLX_ARB_get_proc_address + */ + + +/* + * ARB 3. GL_ARB_tranpose_matrix */ #ifndef GL_ARB_transpose_matrix #define GL_ARB_transpose_matrix 1 @@ -3020,11 +3027,37 @@ typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) ( const GLfloat m[16] /* - * ARB 4. GL_ARB_multisample + * ARB 4. WGL_ARB_buffer_region + */ + + + +/* + * ARB 5. GL_ARB_multisample */ #ifndef GL_ARB_multisample #define GL_ARB_multisample 1 +#define GL_MULTISAMPLE_ARBfunda 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +#define GL_1PASS_ARB 0x80A1 +#define GL_2PASS_0_ARB 0x80A2 +#define GL_2PASS_1_ARB 0x80A3 +#define GL_4PASS_0_ARB 0x80A4 +#define GL_4PASS_1_ARB 0x80A5 +#define GL_4PASS_2_ARB 0x80A6 +#define GL_4PASS_3_ARB 0x80A7 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_MAX_PASSES_ARB 0x84E7 +#define GL_SAMPLE_PASS_ARB 0x84E8 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +/* Note: there are more tokens for GLX and WGL */ + GLAPI void APIENTRY glSamplePassARB(GLenum pass); GLAPI void APIENTRY glSampleCoverageARB(GLclampf value, GLboolean invert); @@ -3035,6 +3068,18 @@ typedef void (APIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean +/* + * ARB 6. GL_ARB_texture_env_add + */ +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 + +/* No new tokens or functions */ + +#endif /* GL_ARB_texture_env_add */ + + + /* * ARB ?. GL_ARB_texture_compression */ -- cgit v1.2.3 From d4a736d52cb2d6d82d2fbc56aa00f5cfea7ba54c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 5 Apr 2000 22:09:10 +0000 Subject: added some casts --- include/GL/xmesa_xf86.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/xmesa_xf86.h b/include/GL/xmesa_xf86.h index 2be3efe78d1..a07c7f48936 100644 --- a/include/GL/xmesa_xf86.h +++ b/include/GL/xmesa_xf86.h @@ -30,7 +30,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Authors: * Kevin E. Martin * - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/xmesa_xf86.h,v 1.4 2000/02/25 20:31:11 brianp Exp $ + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/xmesa_xf86.h,v 1.5 2000/04/05 22:09:10 brianp Exp $ */ #ifndef _XMESA_XF86_H_ @@ -128,12 +128,12 @@ do { \ do { \ xRectangle __r[1]; \ (void) __d; \ - ValidateGC(__b, __gc); \ + ValidateGC((DrawablePtr)__b, __gc); \ __r[0].x = __x; \ __r[0].y = __y; \ __r[0].width = __w; \ __r[0].height = __h; \ - (*__gc->ops->PolyFillRect)(__b, __gc, 1, __r); \ + (*__gc->ops->PolyFillRect)((DrawablePtr)__b, __gc, 1, __r); \ } while (0) #define XMesaPutImage(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h) \ -- cgit v1.2.3 From c8735e8f8299676e443e6ca0ffd339ab94e013f9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 5 Apr 2000 22:09:58 +0000 Subject: new arguments to XMesaCreateVisual() --- include/GL/xmesa.h | 56 +++++++++++++++++++----------------------- progs/xdemos/xdemo.c | 15 +++++++---- src/mesa/drivers/x11/fakeglx.c | 14 +++++------ 3 files changed, 42 insertions(+), 43 deletions(-) (limited to 'include') diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index 59c4a8636b6..663ccb85adf 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -1,4 +1,4 @@ -/* $Id: xmesa.h,v 1.6 2000/03/31 01:04:07 brianp Exp $ */ +/* $Id: xmesa.h,v 1.7 2000/04/05 22:09:58 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -141,41 +141,35 @@ extern void XMesaResetDriver( __DRIscreenPrivate *driScrnPriv ); * db_flag - GL_TRUE = double-buffered, * GL_FALSE = single buffered * stereo_flag - stereo visual? - * depth_size - requested bits/depth values, or zero - * stencil_size - requested bits/stencil values, or zero - * accum_size - requested bits/component values, or zero * ximage_flag - GL_TRUE = use an XImage for back buffer, * GL_FALSE = use an off-screen pixmap for back buffer + * depth_size - requested bits/depth values, or zero + * stencil_size - requested bits/stencil values, or zero + * accum_red_size - requested bits/red accum values, or zero + * accum_green_size - requested bits/green accum values, or zero + * accum_blue_size - requested bits/blue accum values, or zero + * accum_alpha_size - requested bits/alpha accum values, or zero + * num_samples - number of samples/pixel if multisampling, or zero + * level - visual level, usually 0 + * visualCaveat - ala the GLX extension, usually GLX_NONE_EXT * Return; a new XMesaVisual or 0 if error. */ extern XMesaVisual XMesaCreateVisual( XMesaDisplay *display, - XMesaVisualInfo visinfo, - GLboolean rgb_flag, - GLboolean alpha_flag, - GLboolean db_flag, - GLboolean stereo_flag, - GLboolean ximage_flag, - GLint depth_size, - GLint stencil_size, - GLint accum_size, - GLint level ); - -extern XMesaVisual XMesaCreateVisual2( XMesaDisplay *display, - XMesaVisualInfo visinfo, - GLboolean rgb_flag, - GLboolean alpha_flag, - GLboolean db_flag, - GLboolean stereo_flag, - GLboolean ximage_flag, - GLint depth_size, - GLint stencil_size, - GLint accum_red_size, - GLint accum_green_size, - GLint accum_blue_size, - GLint accum_alpha_size, - GLint num_samples, - GLint level, - GLint visualCaveat ); + XMesaVisualInfo visinfo, + GLboolean rgb_flag, + GLboolean alpha_flag, + GLboolean db_flag, + GLboolean stereo_flag, + GLboolean ximage_flag, + GLint depth_size, + GLint stencil_size, + GLint accum_red_size, + GLint accum_green_size, + GLint accum_blue_size, + GLint accum_alpha_size, + GLint num_samples, + GLint level, + GLint visualCaveat ); /* * Destroy an XMesaVisual, but not the associated XVisualInfo. diff --git a/progs/xdemos/xdemo.c b/progs/xdemos/xdemo.c index 13facba8395..28f945b27d8 100644 --- a/progs/xdemos/xdemo.c +++ b/progs/xdemos/xdemo.c @@ -1,4 +1,4 @@ -/* $Id: xdemo.c,v 1.1 1999/08/19 00:55:43 jtg Exp $ */ +/* $Id: xdemo.c,v 1.2 2000/04/05 22:09:58 brianp Exp $ */ /* @@ -14,8 +14,11 @@ /* * $Log: xdemo.c,v $ - * Revision 1.1 1999/08/19 00:55:43 jtg - * Initial revision + * Revision 1.2 2000/04/05 22:09:58 brianp + * new arguments to XMesaCreateVisual() + * + * Revision 1.1.1.1 1999/08/19 00:55:43 jtg + * Imported sources * * Revision 3.0 1998/02/21 02:16:54 brianp * initial rev @@ -184,8 +187,10 @@ static void make_window( char *title, int color_flag ) GL_FALSE, /* ximage_flag */ 0, /* depth size */ 0, /* stencil size */ - 0, /* accum_size */ - 0 /* level */ + 0,0,0,0, /* accum_size */ + 0, /* num samples */ + 0, /* level */ + 0 /* caveat */ ); if (!visual) { printf("Couldn't create Mesa/X visual!\n"); diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 8ffdd34458b..08a931a1827 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1,4 +1,4 @@ -/* $Id: fakeglx.c,v 1.30 2000/03/31 18:17:01 brianp Exp $ */ +/* $Id: fakeglx.c,v 1.31 2000/04/05 22:09:58 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -292,12 +292,12 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo, return NULL; } - xmvis = XMesaCreateVisual2( dpy, vinfo, rgbFlag, alphaFlag, dbFlag, - stereoFlag, ximageFlag, - depth_size, stencil_size, - accumRedSize, accumBlueSize, - accumBlueSize, accumAlphaSize, 0, level, - GLX_NONE_EXT ); + xmvis = XMesaCreateVisual( dpy, vinfo, rgbFlag, alphaFlag, dbFlag, + stereoFlag, ximageFlag, + depth_size, stencil_size, + accumRedSize, accumBlueSize, + accumBlueSize, accumAlphaSize, 0, level, + GLX_NONE_EXT ); if (xmvis) { VisualTable[NumVisuals] = xmvis; NumVisuals++; -- cgit v1.2.3 From 985d6b29878f55f61074879891813e9ff6e9f11f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 7 Apr 2000 16:21:16 +0000 Subject: version 7 check-in --- include/GL/glext.h | 60 +++++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 28 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 09787b97999..acb21766e74 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -3,7 +3,6 @@ /* - * XXX Many extensions need to be added yet. * XXX Some token values aren't known (grep for ?) * XXX This file may be automatically generated in the future. */ @@ -46,8 +45,10 @@ extern "C" { * Added GL_ARB_texture_compression * 6. Brian Paul, 5 Apr 2000 * Added GL_ARB_multisample tokens, added GL_ARB_texture_env_add + * 7. Brian Paul, 7 Apr 2000 + * Minor clean-ups, temporaty token values for GL_SGIS_pixel_texture */ -#define GL_GLEXT_VERSION_EXT 6 +#define GL_GLEXT_VERSION_EXT 7 /* @@ -379,22 +380,25 @@ typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum i #ifndef GL_SGI_color_table #define GL_SGI_color_table 1 -#define COLOR_TABLE_SGI 0x80D0 -#define POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define PROXY_COLOR_TABLE_SGI 0x80D3 -#define PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define COLOR_TABLE_SCALE_SGI 0x80D6 -#define COLOR_TABLE_BIAS_SGI 0x80D7 -#define COLOR_TABLE_FORMAT_SGI 0x80D8 -#define COLOR_TABLE_WIDTH_SGI 0x80D9 -#define COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +/* XXX this symbol collides with the same in GL_SGI_texture_color_tabled +** and they have different values! +#define GL_COLOR_TABLE_SGI 0x80D0 +**/ +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF GLAPI void APIENTRY glColorTableParameterfvSGI(GLenum target, GLenum pname, const GLfloat *params); GLAPI void APIENTRY glColorTableParameterivSGI(GLenum target, GLenum pname, const GLint *params); @@ -439,10 +443,10 @@ typedef void (APIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); #ifndef GL_SGIS_pixel_texture #define GL_SGIS_pixel_texture 1 -#define GL_PIXEL_TEXTURE_SGIS ? -#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS ? -#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS ? -#define GL_PIXEL_GROUP_COLOR_SGIS ? +#define GL_PIXEL_TEXTURE_SGIS 0x1000 /*?*/ +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x1001 /*?*/ +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x1002 /*?*/ +#define GL_PIXEL_GROUP_COLOR_SGIS 0x1003 /*?*/ GLAPI void APIENTRY glPixelTexGenParameterfSGIS(GLenum target, GLfloat value); GLAPI void APIENTRY glPixelTexGenParameterfvSGIS(GLenum target, const GLfloat *value); @@ -763,7 +767,7 @@ typedef void (APIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GL #ifndef GL_EXT_misc_attribute #define GL_EXT_misc_attribute 1 -#define MISC_BIT_EXT ? +#define GL_MISC_BIT_EXT ? #endif /* GL_EXT_misc_attribute */ @@ -1819,10 +1823,10 @@ typedef void (APIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode) #ifndef GL_INTEL_texture_scissor #define GL_INTEL_texture_scissor 1 -#define TEXTURE_SCISSOR_INTEL ? -#define TEXTURE_SCISSOR_S_INTEL ? -#define TEXTURE_SCISSOR_T_INTEL ? -#define TEXTURE_SCISSOR_R_INTEL ? +#define GL_TEXTURE_SCISSOR_INTEL ? +#define GL_TEXTURE_SCISSOR_S_INTEL ? +#define GL_TEXTURE_SCISSOR_T_INTEL ? +#define GL_TEXTURE_SCISSOR_R_INTEL ? GLAPI void APIENTRY glTexScissorINTEL(GLenum target, GLclampf tlow, GLclampf thigh); GLAPI void APIENTRY glTexScissorFuncINTEL(GLenum target, GLenum lfunc, GLenum hfunc); @@ -1958,7 +1962,7 @@ GLAPI void APIENTRY glGetPixelTransformParameterfvEXT(GLenum target, GLenum pnam #ifndef GL_EXT_secondary_color #define GL_EXT_secondary_color 1 -#define GLCOLOR_SUM_EXT 0x8458 +#define GL_COLOR_SUM_EXT 0x8458 #define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 #define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A #define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -- cgit v1.2.3 From ede4887b1650b18b3a2db3f175fcc33826bbab4d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 7 Apr 2000 16:22:37 +0000 Subject: fixed a typo --- include/GL/glext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index acb21766e74..a83a4495709 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -46,7 +46,7 @@ extern "C" { * 6. Brian Paul, 5 Apr 2000 * Added GL_ARB_multisample tokens, added GL_ARB_texture_env_add * 7. Brian Paul, 7 Apr 2000 - * Minor clean-ups, temporaty token values for GL_SGIS_pixel_texture + * Minor clean-ups, temporary token values for GL_SGIS_pixel_texture */ #define GL_GLEXT_VERSION_EXT 7 -- cgit v1.2.3 From 47e719fa44c784d60480a4096d35f9b14b70cc1f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 10 Apr 2000 21:12:20 +0000 Subject: added missing 1.3 token values, added glXGetFBConfigs(), fixed glXChooseFBConfig() --- include/GL/glx.h | 79 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 38 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 16637efb403..e9f8cbf50f5 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.18 2000/03/31 14:48:28 brianp Exp $ */ +/* $Id: glx.h,v 1.19 2000/04/10 21:12:20 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -111,10 +111,10 @@ extern "C" { * XXX don't know the values of some of these enums! * XXX some 1.3 enums may be missing! */ -#define GLX_CONFIG_CAVEAT ? -#define GLX_DONT_CARE ? -#define GLX_SLOW_CONFIG ? -#define GLX_NON_CONFORMANT_CONFIG ? +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_DONT_CARE 0xFFFFFFFF +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_NON_CONFORMANT_CONFIG 0x800D #define GLX_X_VISUAL_TYPE 0x22 #define GLX_TRANSPARENT_TYPE 0x23 #define GLX_TRANSPARENT_INDEX_VALUE 0x24 @@ -122,29 +122,29 @@ extern "C" { #define GLX_TRANSPARENT_GREEN_VALUE 0x26 #define GLX_TRANSPARENT_BLUE_VALUE 0x27 #define GLX_TRANSPARENT_ALPHA_VALUE 0x28 -#define GLX_MAX_PBUFFER_WIDTH ? -#define GLX_MAX_PBUFFER_HEIGHT ? -#define GLX_MAX_PBUFFER_PIXELS ? -#define GLX_PRESERVED_CONTENTS ? -#define GLX_LARGEST_BUFFER ? -#define GLX_DRAWABLE_TYPE ? -#define GLX_FBCONFIG_ID ? -#define GLX_VISUAL_ID ? -#define GLX_WINDOW_BIT ? -#define GLX_PIXMAP_BIT ? -#define GLX_PBUFFER_BIT ? -#define GLX_AUX_BUFFERS_BIT ? -#define GLX_FRONT_LEFT_BUFFER_BIT ? -#define GLX_FRONT_RIGHT_BUFFER_BIT ? -#define GLX_BACK_LEFT_BUFFER_BIT ? -#define GLX_BACK_RIGHT_BUFFER_BIT ? -#define GLX_AUX_BUFFERS_BIT ? -#define GLX_DEPTH_BUFFER_BIT ? -#define GLX_STENCIL_BUFFER_BIT ? -#define GLX_ACCUM_BUFFER_BIT ? -#define GLX_RENDER_TYPE ? -#define GLX_DRAWABLE_TYPE ? -#define GLX_X_RENDERABLE ? +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_BUFFER 0x801C +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_VISUAL_ID 0x800B +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 #define GLX_NONE 0x8000 #define GLX_TRUE_COLOR 0x8002 #define GLX_DIRECT_COLOR 0x8003 @@ -153,14 +153,14 @@ extern "C" { #define GLX_GRAY_SCALE 0x8006 #define GLX_STATIC_GRAY 0x8007 #define GLX_TRANSPARENT_INDEX 0x8009 -#define GLX_COLOR_INDEX_TYPE ? -#define GLX_COLOR_INDEX_BIT ? -#define GLX_SCREEN ? -#define GLX_PBUFFER_CLOBBER_MASK ? -#define GLX_DAMAGED ? -#define GLX_SAVED ? -#define GLX_WINDOW ? -#define GLX_PBUFFER ? +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_SCREEN 0x800C +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8033 /* @@ -281,12 +281,15 @@ extern Display *glXGetCurrentDisplay( void ); /* GLX 1.3 and later */ -extern GLXFBConfig glXChooseFBConfig( Display *dpy, int screen, - const int *attribList, int *nitems ); +extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen, + const int *attribList, int *nitems ); extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config, int attribute, int *value ); +extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen, + int *nelements ); + extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ); -- cgit v1.2.3 From a28a4f782087b3a6dcd4ea557e879396ba37f7f6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 10 Apr 2000 21:12:37 +0000 Subject: removed bogus GL_ALLOW_DRAW_SPN_HINT_PGI token --- include/GL/glext.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index a83a4495709..0d7c01e7ffe 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -1323,7 +1323,6 @@ typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei #define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 #define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 #define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 -#define GL_ALLOW_DRAW_SPN_HINT_PGI 107024 #define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 #define GL_CLIP_NEAR_HINT_PGI 107040 #define GL_CLIP_FAR_HINT_PGI 107041 -- cgit v1.2.3 From 76713fb0b05128a09995cd6b38cfadb288c542a7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 15 Apr 2000 19:18:06 +0000 Subject: version 8, added GL_EXT_texture_cube_map --- include/GL/glext.h | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 0d7c01e7ffe..3e4d10388a7 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -5,6 +5,8 @@ /* * XXX Some token values aren't known (grep for ?) * XXX This file may be automatically generated in the future. + * XXX There are some doubly-defined tokens with different values! Search + * for "DUPLICATE". */ @@ -47,8 +49,10 @@ extern "C" { * Added GL_ARB_multisample tokens, added GL_ARB_texture_env_add * 7. Brian Paul, 7 Apr 2000 * Minor clean-ups, temporary token values for GL_SGIS_pixel_texture + * 8. Brian Paul, 15 Apr 2000 + * Added GL_EXT_texture_cube_map, misc clean-up. */ -#define GL_GLEXT_VERSION_EXT 7 +#define GL_GLEXT_VERSION_EXT 8 /* @@ -380,10 +384,7 @@ typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum i #ifndef GL_SGI_color_table #define GL_SGI_color_table 1 -/* XXX this symbol collides with the same in GL_SGI_texture_color_tabled -** and they have different values! -#define GL_COLOR_TABLE_SGI 0x80D0 -**/ +#define GL_COLOR_TABLE_SGI 0x80D0 /* DUPLICATE! */ #define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 #define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 #define GL_PROXY_COLOR_TABLE_SGI 0x80D3 @@ -499,7 +500,7 @@ typedef void (APIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level #ifndef GL_SGI_texture_color_table #define GL_SGI_texture_color_table 1 -#define GL_COLOR_TABLE_SGI 0x80BC +#define GL_COLOR_TABLE_SGI_80BC 0x80BC /* DUPLICATE! */ #define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD #endif /* GL_SGI_texture_color_table */ @@ -1729,11 +1730,8 @@ typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint sta #define GL_FRAGMENT_MATERIAL_EXT 0x8349 #define GL_FRAGMENT_NORMAL_EXT 0x834A -/* XXX this symbol collides with the same in GL_EXT_fog_coord and they -** have different values! We're disabling this one since it's the less -** common of the two extensions. -#define GL_FRAGMENT_DEPTH_EXT 0x834B -**/ + +#define GL_FRAGMENT_DEPTH_EXT_834B 0x834B /* DUPLICATE! */ #define GL_FRAGMENT_COLOR_EXT 0x834C #define GL_ATTENUATION_EXT 0x834D #define GL_SHADOW_ATTENUATION_EXT 0x834E @@ -2083,7 +2081,7 @@ typedef void (APIENTRY * PFNGLMULTIDRAWARRAYSEXT) (GLenum mode, GLint *first, GL #define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 #define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 /* DUPLICATE! */ #define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 #define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 #define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 @@ -3121,6 +3119,29 @@ typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLin +/* + * ?. GL_EXT_texture_cube_map + */ +#ifndef GL_EXT_texture_cube_map +#define GL_EXT_texture_cube_map 1 + +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851a +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851b +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851c + +#endif + + + /* * ??. GL_WIN_swap_hint */ -- cgit v1.2.3 From eae28ca68c10c2f6fc6fb17df0dc9b0c28de9c56 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 15 Apr 2000 19:24:18 +0000 Subject: more clean-up --- include/GL/glext.h | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 3e4d10388a7..d931d3bc881 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -2643,8 +2643,8 @@ typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLe #ifndef GL_EXT_texture_filter_anisotropic #define GL_EXT_texture_filter_anisotropic 1 -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84fe -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84ff +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF #endif /* GL_EXT_texture_filter_anisotropic */ @@ -2658,12 +2658,12 @@ typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLe #define GL_VERTEX_WEIGHTING_EXT 0x8509 #define GL_MODELVIEW0_EXT 0x1700 -#define GL_MODELVIEW1_EXT 0x850a -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850b -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850c -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850d -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850e -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850f +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F #define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 #define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 #define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 @@ -2766,9 +2766,9 @@ typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum va #ifndef GL_NV_fog_distance #define GL_NV_fog_distance 1 -#define GL_FOG_DISTANCE_MODE_NV 0x855a -#define GL_EYE_RADIAL_NV 0x855b -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855c +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C #endif /* GL_NV_fog_distance*/ @@ -3125,20 +3125,20 @@ typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLin #ifndef GL_EXT_texture_cube_map #define GL_EXT_texture_cube_map 1 -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851a -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851b -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851c +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C -#endif +#endif /* GL_EXT_texture_cube_map */ @@ -3162,7 +3162,7 @@ typedef void (APIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei #ifndef GL_IBM_cull_vertex #define GL_IBM_cull_vertex 1 -#define GL_CULL_VERTEX_IBM 103050 +#define GL_CULL_VERTEX_IBM 0x1928A #endif /* GL_IBM_cull_vertex */ @@ -3174,8 +3174,8 @@ typedef void (APIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei #ifndef GL_IBM_static_data #define GL_IBM_static_data 1 -#define GL_ALL_STATIC_DATA_IBM 103060 -#define GL_STATIC_VERTEX_ARRAY_IBM 103061 +#define GL_ALL_STATIC_DATA_IBM 0x19294 +#define GL_STATIC_VERTEX_ARRAY_IBM 0x19295 GLAPI void APIENTRY glFlushStaticDataIBM(GLenum target); -- cgit v1.2.3 From e9cd76e23965fb95e57d47ae8670de2769a5d76b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 15 Apr 2000 19:44:47 +0000 Subject: added some missing NV token values --- include/GL/glext.h | 72 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 63 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index d931d3bc881..08d23a875a1 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -50,7 +50,7 @@ extern "C" { * 7. Brian Paul, 7 Apr 2000 * Minor clean-ups, temporary token values for GL_SGIS_pixel_texture * 8. Brian Paul, 15 Apr 2000 - * Added GL_EXT_texture_cube_map, misc clean-up. + * Added GL_EXT_texture_cube_map, adding some missing tokens values. */ #define GL_GLEXT_VERSION_EXT 8 @@ -1032,7 +1032,7 @@ typedef void (APIENTRY * PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); typedef void (APIENTRY * PFNGLSTARTINSTRUMENTSSGIXPROC) (void); typedef void (APIENTRY * PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); -#endif +#endif /* GL_SGIX_instruments */ @@ -1261,7 +1261,7 @@ GLAPI void APIENTRY glCopyColorSubTableEXT(GLenum target, GLsizei start, GLint x typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -#endif +#endif /* GL_EXT_color_subtable */ @@ -1910,7 +1910,7 @@ GLAPI void APIENTRY glGetPixelTransformParameterfvEXT(GLenum target, GLenum pnam #define GL_PIXEL_TRANSFORM_COLOR_TABLE_EXT ? #define GL_PROXY_PIXEL_TRANSFORM_COLOR_TABLE_EXT ? -#endif +#endif /* GL_EXT_pixel_transform_color_table */ @@ -2676,7 +2676,7 @@ typedef void (APIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); typedef void (APIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); typedef void (APIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif +#endif /* GL_EXT_vertex_weighting */ @@ -2689,7 +2689,7 @@ typedef void (APIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum ty #define GL_MAX_SHININESS_NV 0x8507 #define GL_MAX_SPOT_EXPONENT_NV 0x8508 -#endif +#endif /* GL_NV_light_max_exponent */ @@ -2699,7 +2699,11 @@ typedef void (APIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum ty #ifndef GL_NV_vertex_array_range #define GL_NV_vertex_array_range 1 -/* TOKENS? */ +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 GLAPI void APIENTRY glFlushVertexArrayRangeNV(void); GLAPI void APIENTRY glVertexArrayRangeNV(GLsizei size, const GLvoid * pointer); @@ -2707,7 +2711,7 @@ GLAPI void APIENTRY glVertexArrayRangeNV(GLsizei size, const GLvoid * pointer); typedef void (APIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); typedef void (APIENTRY * PFNGLVERTEXARRAYRANGENV) (GLsizei size, const GLvoid * pointer); -#endif +#endif /* GL_NV_vertex_array_range */ @@ -2717,7 +2721,57 @@ typedef void (APIENTRY * PFNGLVERTEXARRAYRANGENV) (GLsizei size, const GLvoid * #ifndef GL_NV_register_combiners #define GL_NV_register_combiners 1 -/* TOKENS? */ +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_DISCARD_NV 0x8530 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D #ifdef VMS /*VMS only allows externals of maximal 31 characters! */ -- cgit v1.2.3 From 825fb31e58c822b0c63cc478e8c503cad37f6ea1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 15 Apr 2000 19:50:44 +0000 Subject: added GL_NV_texgen_emboss --- include/GL/glext.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 08d23a875a1..b2df4e80640 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -50,7 +50,8 @@ extern "C" { * 7. Brian Paul, 7 Apr 2000 * Minor clean-ups, temporary token values for GL_SGIS_pixel_texture * 8. Brian Paul, 15 Apr 2000 - * Added GL_EXT_texture_cube_map, adding some missing tokens values. + * Added GL_EXT_texture_cube_map, GL_NV_texgen_emboss, adding some + * missing tokens values. */ #define GL_GLEXT_VERSION_EXT 8 @@ -3196,6 +3197,21 @@ typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLin +/* + * ? GL_NV_texgen_emboss + */ + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 + +#define GL_EMBOSS_MAP_NV 0x855F +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E + +#endif /* GL_NV_texgen_emboss */ + + + /* * ??. GL_WIN_swap_hint */ -- cgit v1.2.3 From 353479fa8a63aebc21825ad614115b7b5434fe0d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 19 Apr 2000 01:40:00 +0000 Subject: added GLX_EXT_import_context, 1.3 misc clean-up --- include/GL/glx.h | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index e9f8cbf50f5..ead38a91a05 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.19 2000/04/10 21:12:20 brianp Exp $ */ +/* $Id: glx.h,v 1.20 2000/04/19 01:40:00 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -108,8 +108,6 @@ extern "C" { /* * GLX 1.3 and later: - * XXX don't know the values of some of these enums! - * XXX some 1.3 enums may be missing! */ #define GLX_CONFIG_CAVEAT 0x20 #define GLX_DONT_CARE 0xFFFFFFFF @@ -193,11 +191,20 @@ extern "C" { #define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D +/* + * 47. GLX_EXT_import_context + */ +#define GLX_SHARE_CONTEXT_EXT 0x800A +#define GLX_VISUAL_ID_EXT 0x800B +#define GLX_SCREEN_EXT 0x800C + + /* * Compile-time extension tests */ #define GLX_EXT_visual_info 1 #define GLX_EXT_visual_rating 1 +#define GLX_EXT_import_context 1 #define GLX_MESA_pixmap_colormap 1 #define GLX_MESA_release_buffers 1 #define GLX_MESA_copy_sub_buffer 1 @@ -355,6 +362,21 @@ extern int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count); + +/* GLX_EXT_import_context */ +extern void glXFreeContextEXT(Display *dpy, GLXContext context); + +extern GLXContextID glXGetContextIDEXT(const GLXContext context); + +extern Display *glXGetCurrentDisplayEXT(void); + +extern GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID); + +extern int glXQueryContextInfoEXT(Display *dpy, GLXContext context, + int attribute,int *value); + + + /* GLX_ARB_get_proc_address */ extern void (*glXGetProcAddressARB(const GLubyte *procName))(); -- cgit v1.2.3 From ede979fcb5ba2c7dacb97535c7abcafdbd95af64 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 2 May 2000 02:30:01 +0000 Subject: removed all DRI-isms --- include/GL/xmesa.h | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) (limited to 'include') diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index 663ccb85adf..0c50b48c7cd 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -1,4 +1,4 @@ -/* $Id: xmesa.h,v 1.7 2000/04/05 22:09:58 brianp Exp $ */ +/* $Id: xmesa.h,v 1.8 2000/05/02 02:30:01 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -79,9 +79,6 @@ extern "C" { #include #include #include "xmesa_x.h" -#ifdef GLX_DIRECT_RENDERING -#include "dri_mesa.h" -#endif #endif #include "GL/gl.h" @@ -117,18 +114,6 @@ typedef struct xmesa_visual *XMesaVisual; typedef struct xmesa_buffer *XMesaBuffer; -#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server) -/* - * Initialize the XMesa driver. - */ -extern GLboolean XMesaInitDriver( __DRIscreenPrivate *driScrnPriv ); - -/* - * Reset the XMesa driver when the X server resets. - */ -extern void XMesaResetDriver( __DRIscreenPrivate *driScrnPriv ); -#endif - /* @@ -187,11 +172,7 @@ extern void XMesaDestroyVisual( XMesaVisual v ); * Return: an XMesaContext or NULL if error. */ extern XMesaContext XMesaCreateContext( XMesaVisual v, - XMesaContext share_list -#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server) - , __DRIcontextPrivate *driContextPriv -#endif - ); + XMesaContext share_list ); /* @@ -203,12 +184,7 @@ extern void XMesaDestroyContext( XMesaContext c ); /* * Create an XMesaBuffer from an X window. */ -extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v, - XMesaWindow w -#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server) - , __DRIdrawablePrivate *driDrawPriv -#endif - ); +extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v, XMesaWindow w ); /* @@ -216,11 +192,7 @@ extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v, */ extern XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v, XMesaPixmap p, - XMesaColormap cmap -#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server) - , __DRIdrawablePrivate *driDrawPriv -#endif - ); + XMesaColormap cmap ); /* -- cgit v1.2.3 From 474e2f4dbb29bd26106d899095ea4a9115e7bc93 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 May 2000 14:12:02 +0000 Subject: added a bunch of missing token values --- include/GL/glext.h | 170 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 99 insertions(+), 71 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index b2df4e80640..544b59e7f5d 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -52,8 +52,10 @@ extern "C" { * 8. Brian Paul, 15 Apr 2000 * Added GL_EXT_texture_cube_map, GL_NV_texgen_emboss, adding some * missing tokens values. + * 9. Brian Paul, 4 May 2000 + * Added a bunch of missing token values. */ -#define GL_GLEXT_VERSION_EXT 8 +#define GL_GLEXT_VERSION_EXT 9 /* @@ -445,10 +447,10 @@ typedef void (APIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); #ifndef GL_SGIS_pixel_texture #define GL_SGIS_pixel_texture 1 -#define GL_PIXEL_TEXTURE_SGIS 0x1000 /*?*/ -#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x1001 /*?*/ -#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x1002 /*?*/ -#define GL_PIXEL_GROUP_COLOR_SGIS 0x1003 /*?*/ +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 GLAPI void APIENTRY glPixelTexGenParameterfSGIS(GLenum target, GLfloat value); GLAPI void APIENTRY glPixelTexGenParameterfvSGIS(GLenum target, const GLfloat *value); @@ -1174,21 +1176,21 @@ typedef void (APIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); #ifndef GL_HP_image_transform #define GL_HP_image_transform 1 -#define GL_IMAGE_SCALE_X_HP ? -#define GL_IMAGE_SCALE_Y_HP ? -#define GL_IMAGE_TRANSLATE_X_HP ? -#define GL_IMAGE_TRANSLATE_Y_HP ? -#define GL_IMAGE_ROTATE_ANGLE_HP ? -#define GL_IMAGE_ROTATE_ORIGIN_X_HP ? -#define GL_IMAGE_ROTATE_ORIGIN_Y_HP ? -#define GL_IMAGE_MAG_FILTER_HP ? -#define GL_IMAGE_MIN_FILTER_HP ? -#define GL_IMAGE_CUBIC_WEIGHT_HP ? -#define GL_CUBIC_HP ? -#define GL_AVERAGE_HP ? -#define GL_IMAGE_TRANSFORM_2D_HP ? -#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP ? -#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP ? +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 GLAPI void APIENTRY glImageTransformParameteriHP(GLenum target, GLenum pname, const GLint param); GLAPI void APIENTRY glImageTransformParameterfHP(GLenum target, GLenum pname, const GLfloat param); @@ -1214,10 +1216,10 @@ typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target #ifndef GL_HP_convolution_border_modes #define GL_HP_convolution_border_modes 1 -#define GL_IGNORE_BORDER_HP ? -#define GL_CONSTANT_BORDER_HP ? -#define GL_REPLICATE_BORDER_HP ? -#define GL_CONVOLUTION_BORDER_COLOR_HP ? +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 #endif /* GL_HP_convolution_border_modes */ @@ -1481,9 +1483,9 @@ typedef void (APIENTRY * PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum name #ifndef GL_EXT_index_material #define GL_EXT_index_material 1 -#define GL_INDEX_MATERIAL_EXT ? -#define GL_INDEX_MATERIAL_PARAMETER_EXT ? -#define GL_INDEX_MATERIAL_FACE_EXT ? +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA GLAPI void APIENTRY glIndexMaterialEXT(GLenum face, GLenum mode); @@ -1499,9 +1501,9 @@ typedef void (APIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); #ifndef GL_EXT_index_func #define GL_EXT_index_func 1 -#define GL_INDEX_TEST_EXT ? -#define GL_INDEX_TEST_FUNC_EXT ? -#define GL_INDEX_TEST_REF_EXT ? +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 GLAPI void APIENTRY glIndexFuncEXT(GLenum func, GLfloat ref); @@ -1517,14 +1519,14 @@ typedef void (APIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); #ifndef GL_EXT_index_array_formats #define GL_EXT_index_array_formats 1 -#define GL_IUI_V2F_EXT ? -#define GL_IUI_V3F_EXT ? -#define GL_IUI_N3F_V2F_EXT ? -#define GL_IUI_N3F_V3F_EXT ? -#define GL_T2F_IUI_V2F_EXT ? -#define GL_T2F_IUI_V3F_EXT ? -#define GL_T2F_IUI_N3F_V2F_EXT ? -#define GL_T2F_IUI_N3F_V3F_EXT ? +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 #endif /* GL_EXT_index_array_formats */ @@ -1665,9 +1667,9 @@ typedef void (APIENTRY * PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); #ifndef GL_HP_texture_lighting #define GL_HP_texture_lighting 1 -#define GL_TEXTURE_LIGHTING_MODE_HP ? -#define GL_TEXTURE_POST_SPECULAR_HP ? -#define GL_TEXTURE_PRE_SPECULAR_HP ? +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 #endif /* GL_HP_texture_lighting */ @@ -1842,11 +1844,11 @@ typedef void (APIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lf #ifndef GL_INTEL_parallel_arrays #define GL_INTEL_parallel_arrays 1 -#define GL_PARALLEL_ARRAYS_INTEL ? -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL ? -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL ? -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL ? -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL ? +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 GLAPI void APIENTRY glVertexPointervINTEL(GLint size, GLenum type, const void ** pointer); GLAPI void APIENTRY glNormalPointervINTEL(GLenum type, const void** pointer); @@ -2935,6 +2937,23 @@ typedef void (APIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *p); #endif /* GL_MESA_window_pos */ +/* + * 198. GL_EXT_texture_compression_s3tc + * 199. GL_IBM_cull_vertex + * 200. GL_IBM_multimode_draw_arrays + * 201. GL_IBM_vertex_array_lists + * 202. ? + * 203. ? + * 204. ? + * 205. ? + * 206. GL_3DFX_texture_compression_FXT1 + * 207. GL_3DFX_multisample + * 208. GL_3DFX_tbuffer + * 209. WGL_EXT_multisample + * 210. GL_SGIX_vertex_preclip + * 212. GL_SGIX_resample + */ + /* * ARB 1. GL_ARB_multitexture @@ -3137,7 +3156,39 @@ typedef void (APIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean /* - * ARB ?. GL_ARB_texture_compression + * ARB 7. GL_ARB_texture_cube_map + */ +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 + +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C + +#endif /* GL_ARB_texture_cube_map */ + + + +/* + * ARB 8. WGL_ARB_extensions_string + * ARB 9. WGL_ARB_pixel_format + * ARB 10. WGL_ARB_make_current_read + * ARB 11. WGL_ARB_pbuffer + */ + + + +/* + * ARB 12. GL_ARB_texture_compression */ #ifndef GL_ARB_texture_compression #define GL_ARB_texture_compression 1 @@ -3174,29 +3225,6 @@ typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLin -/* - * ?. GL_EXT_texture_cube_map - */ -#ifndef GL_EXT_texture_cube_map -#define GL_EXT_texture_cube_map 1 - -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C - -#endif /* GL_EXT_texture_cube_map */ - - - /* * ? GL_NV_texgen_emboss */ @@ -3213,7 +3241,7 @@ typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLin /* - * ??. GL_WIN_swap_hint + * ?. GL_WIN_swap_hint */ #ifndef GL_WIN_swap_hint #define GL_WIN_swap_hint 1 -- cgit v1.2.3 From a14d28c2bd0e41e9153dc1ae13bdb2451191aafc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 May 2000 14:12:28 +0000 Subject: removed GL_HAS_GLEXT --- include/GL/gl.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index b22295ec339..5ec35248918 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.36 2000/03/28 16:59:39 rjfrank Exp $ */ +/* $Id: gl.h,v 1.37 2000/05/04 14:12:28 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -141,7 +141,6 @@ extern "C" { #define GL_VERSION_1_1 1 #define GL_VERSION_1_2 1 -#define GL_HAS_GLEXT 1 @@ -2075,7 +2074,7 @@ GLAPI void GLAPIENTRY glGetColorTableParameterivEXT( GLenum target, GLenum pname #ifndef GL_EXT_clip_volume_hint #define GL_EXT_clip_volume_hint 1 -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 #endif /* GL_EXT_clip_volume_hint */ -- cgit v1.2.3 From e2f66e40dfa67e4ce49781bcf4f4d2ca5bc5728d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 18 May 2000 18:09:38 +0000 Subject: added glPointParameterf[v]SGIS() --- include/GL/gl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 5ec35248918..9b338741714 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.37 2000/05/04 14:12:28 brianp Exp $ */ +/* $Id: gl.h,v 1.38 2000/05/18 18:09:38 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2026,6 +2026,8 @@ GLAPI void GLAPIENTRY glBlendEquationEXT( GLenum mode ); GLAPI void GLAPIENTRY glPointParameterfEXT( GLenum pname, GLfloat param ); GLAPI void GLAPIENTRY glPointParameterfvEXT( GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glPointParameterfSGIS(GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPointParameterfvSGIS(GLenum pname, const GLfloat *params); #endif /* GL_EXT_point_parameters */ -- cgit v1.2.3 From 0914fbaec1202bcd09ce5d8aeb7a30186a1b40f9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 18 May 2000 18:10:42 +0000 Subject: updated to version 10 --- include/GL/glext.h | 208 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 193 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 544b59e7f5d..abfd7b86f3c 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -54,8 +54,10 @@ extern "C" { * missing tokens values. * 9. Brian Paul, 4 May 2000 * Added a bunch of missing token values. + * 10. Brian Paul, 11 May 2000 + * Added extensions 198 .. 212. */ -#define GL_GLEXT_VERSION_EXT 9 +#define GL_GLEXT_VERSION_EXT 10 /* @@ -1004,9 +1006,13 @@ typedef void (APIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GL GLAPI void APIENTRY glPointParameterfEXT(GLenum pname, GLfloat param); GLAPI void APIENTRY glPointParameterfvEXT(GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glPointParameterfSGIS(GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvSGIS(GLenum pname, const GLfloat *params); typedef void (APIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); #endif /* GL_EXT_point_parameters */ @@ -1900,7 +1906,7 @@ GLAPI void APIENTRY glPixelTransformParameterfvEXT(GLenum target, GLenum pname, GLAPI void APIENTRY glGetPixelTransformParameterivEXT(GLenum target, GLenum pname, const GLint *params); GLAPI void APIENTRY glGetPixelTransformParameterfvEXT(GLenum target, GLenum pname, const GLfloat *params); -#endif /* #define GL_EXT_pixel_transform */ +#endif /* GL_EXT_pixel_transform */ @@ -2131,7 +2137,7 @@ typedef void (APIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stri /* - * 156. GL_EXT_coordinate_frame + * 156. GL_EXT_coordinate_frame */ #ifndef GL_EXT_coordinate_frame #define GL_EXT_coordinate_frame 1 @@ -2937,22 +2943,194 @@ typedef void (APIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *p); #endif /* GL_MESA_window_pos */ + /* * 198. GL_EXT_texture_compression_s3tc + */ +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 + +#endif /* GL_EXT_texture_compression_s3tc */ + + + +/* * 199. GL_IBM_cull_vertex + */ +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 + +#define GL_CULL_VERTEX_IBM 103050 + +#endif /* GL_IBM_cull_vertex */ + + +/* * 200. GL_IBM_multimode_draw_arrays + */ +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 + +GLAPI void APIENTRY glMultiModeDrawArraysIBM(GLenum *mode, GLint *first, GLsizei *count, GLsizei primcount, GLint modestride); +GLAPI void APIENTRY glMultiModeDrawElementsIBM(GLenum *mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount, GLint modestride); + +typedef void (APIENTRY * PFNGLGLMULTIMODEDRAWARRAYSIBMPROC) (GLenum *mode, GLint *first, GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (GLenum *mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount, GLint modestride); + +#endif /* GL_IBM_multimode_draw_arrays */ + + + +/* * 201. GL_IBM_vertex_array_lists + */ +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 + +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 + +GLAPI void APIENTRY glColorPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +GLAPI void APIENTRY glSecondaryColorPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +GLAPI void APIENTRY glEdgeFlagPointerListIBM(GLint stride, const GLboolean **pointer, GLint ptrstride); +GLAPI void APIENTRY glFogCoordPointerListIBM(GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +GLAPI void APIENTRY glIndexPointerListIBM(GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +GLAPI void APIENTRY glNormalPointerListIBM(GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +GLAPI void APIENTRY glTexCoordPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +GLAPI void APIENTRY glVertexPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); + +typedef void (APIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean **pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); + +#endif /* GL_IBM_multimode_draw_arrays */ + + + +/* * 202. ? * 203. ? * 204. ? * 205. ? + */ + + +/* * 206. GL_3DFX_texture_compression_FXT1 + */ +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 + +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 + +#endif /* GL_3DFX_texture_compression_FXT1 */ + + + +/* * 207. GL_3DFX_multisample + */ +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 + +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 + +#endif /* GL_3DFX_multisample */ + + + +/* * 208. GL_3DFX_tbuffer + */ +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 + +GLAPI void APIENTRY glTbufferMask3DFX(GLuint mask); + +typedef void (APIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask ); + +#endif /* GL_3DFX_tbuffer */ + + + +/* * 209. WGL_EXT_multisample + */ +#ifndef WGL_EXT_multisample +#define WGL_EXT_multisample 1 + +#define WGL_SAMPLE_BUFFERS_EXT 0x2041 +#define WGL_SAMPLES_EXT 0x2042 +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 + +GLAPI void APIENTRY glSampleMaskEXT(GLclampf value, GLboolean invert); +GLAPI void APIENTRY glSamplePatternEXT(GLenum pattern); + +typedef void (APIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); + +#endif /* WGL_EXT_multisample */ + + + +/* * 210. GL_SGIX_vertex_preclip + */ +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#endif /* GL_SGIX_vertex_preclip */ + + + +/* * 212. GL_SGIX_resample */ +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 + +#define GL_PACK_RESAMPLE_SGIX 0x842E +#define GL_UNPACK_RESAMPLE_SGIX 0x842F +#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 +#define GL_RESAMPLE_DECIMATE_SGIX 0x0 /*?*/ + +#endif /* GL_SGIX_resample */ + /* @@ -3205,20 +3383,20 @@ typedef void (APIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean #define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 #define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -GLAPI void APIENTRY glCompressedTexImage3DARB(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLvoid *data); -GLAPI void APIENTRY glCompressedTexImage2DARB(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLvoid *data); -GLAPI void APIENTRY glCompressedTexImage1DARB(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLsizei imageSize, GLvoid *data); -GLAPI void APIENTRY glCompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLvoid *data); -GLAPI void APIENTRY glCompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLvoid *data); -GLAPI void APIENTRY glCompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage3DARB(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage2DARB(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage1DARB(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); GLAPI void APIENTRY glGetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLsizei imageSize, GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLvoid *img); #endif /* GL_ARB_texture_compression */ -- cgit v1.2.3 From b1bc367ab31361a1637a98a2b516ade9ef661886 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 19 May 2000 15:41:09 +0000 Subject: protect PFNGLCOLORSUBTABLEEXTPROC from multi-defined --- include/GL/glext.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index abfd7b86f3c..60609391659 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -1378,7 +1378,9 @@ GLAPI void APIENTRY glGetColorTableParameterfvEXT(GLenum target, GLenum pname, G GLAPI void APIENTRY glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint *params); typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +#ifndef GL_EXT_color_subtable typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +#endif typedef void (APIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -- cgit v1.2.3 From cc2b08ddf0c6f522172f972526ce34f74a242141 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 19 May 2000 16:08:11 +0000 Subject: changed internalFormat to GLenum in TexImage4DSGI and all compressed textimage calls --- include/GL/glext.h | 16 ++++++++-------- src/mesa/glapi/glapitemp.h | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 60609391659..74a4448a9e8 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -489,10 +489,10 @@ typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum target, #define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 #define GL_TEXTURE_4D_BINDING_SGIS 0x814F -GLAPI void APIENTRY glTexImage4DSGIS(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTexImage4DSGIS(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); GLAPI void APIENTRY glTexSubImage4DSGIS(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (APIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels); #endif /* GL_SGIS_texture4D */ @@ -3385,17 +3385,17 @@ typedef void (APIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean #define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 #define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -GLAPI void APIENTRY glCompressedTexImage3DARB(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glCompressedTexImage2DARB(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glCompressedTexImage1DARB(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage3DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage2DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage1DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); GLAPI void APIENTRY glCompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); GLAPI void APIENTRY glCompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); GLAPI void APIENTRY glCompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); GLAPI void APIENTRY glGetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index 67fbc887a0c..9b6cdf92314 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -1,4 +1,4 @@ -/* $Id: glapitemp.h,v 1.20 2000/05/19 13:11:38 brianp Exp $ */ +/* $Id: glapitemp.h,v 1.21 2000/05/19 16:08:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2275,7 +2275,7 @@ KEYWORD1 void KEYWORD2 NAME(GetPixelTexGenParameterivSGIS)(GLenum target, GLint /* 16. GL_SGIS_texture4D */ -KEYWORD1 void KEYWORD2 NAME(TexImage4DSGIS)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels) +KEYWORD1 void KEYWORD2 NAME(TexImage4DSGIS)(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels) { DISPATCH(TexImage4DSGIS, (target, level, internalFormat, width, height, depth, extent, border, format, type, pixels), (F, ";")); } @@ -3374,17 +3374,17 @@ KEYWORD1 void KEYWORD2 NAME(SamplePassARB)(GLenum pass) /* ARB 12. GL_ARB_texture_compression */ -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3DARB)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) +KEYWORD1 void KEYWORD2 NAME(CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) { DISPATCH(CompressedTexImage3DARB, (target, level, internalformat, width, height, depth, border, imageSize, data), (F, "glCompressedTexImage3DARB();")); } -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2DARB)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) +KEYWORD1 void KEYWORD2 NAME(CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) { DISPATCH(CompressedTexImage2DARB, (target, level, internalformat, width, height, border, imageSize, data), (F, "glCompressedTexImage2DARB();")); } -KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1DARB)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) +KEYWORD1 void KEYWORD2 NAME(CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) { DISPATCH(CompressedTexImage1DARB, (target, level, internalformat, width, border, imageSize, data), (F, "glCompressedTexImage1DARB();")); } -- cgit v1.2.3 From 08f0374bfaccc41a497f18a6535fa0d13277abde Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 22 May 2000 16:21:27 +0000 Subject: moved a lot of Window-isms out of gl.h into other files --- include/GL/gl.h | 102 +++++++++++--------------------------------------- include/GL/glu.h | 13 ++++++- include/GL/mesa_wgl.h | 37 +++++++++++++++++- 3 files changed, 69 insertions(+), 83 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 9b338741714..d9c86304a14 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.38 2000/05/18 18:09:38 brianp Exp $ */ +/* $Id: gl.h,v 1.39 2000/05/22 16:21:27 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -33,108 +33,51 @@ #endif +/********************************************************************** + * Begin system-specific stuff. + */ #if defined(__BEOS__) #include /* to get some BeOS-isms */ #endif - #if !defined(OPENSTEP) && (defined(NeXT) || defined(NeXT_PDO)) #define OPENSTEP #endif - -/* - * XXX move as many of these pragma's and MS Windows-isms into - * the new src/glheader.h file. - */ - #if defined(_WIN32) && !defined(__WIN32__) -# define __WIN32__ +#define __WIN32__ #endif #if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__)) -# pragma warning( disable : 4068 ) /* unknown pragma */ -# pragma warning( disable : 4710 ) /* function 'foo' not inlined */ -# pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */ -# pragma warning( disable : 4127 ) /* conditional expression is constant */ -# if defined(MESA_MINWARN) -# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ -# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ -# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ -# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */ -# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ -# endif # if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ # define GLAPI __declspec(dllexport) -# define WGLAPI __declspec(dllexport) # elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ # define GLAPI __declspec(dllimport) -# define WGLAPI __declspec(dllimport) # else /* for use with static link lib build of Win32 edition only */ # define GLAPI extern -# define WGLAPI __declspec(dllimport) # endif /* _STATIC_MESA support */ # define GLAPIENTRY __stdcall -# define GLAPIENTRYP __stdcall * -# define GLCALLBACK __stdcall -# define GLCALLBACKP __stdcall * -# if defined(__CYGWIN32__) -# define GLCALLBACKPCAST * -# else -# define GLCALLBACKPCAST __stdcall * -# endif -# define GLWINAPI __stdcall -# define GLWINAPIV __cdecl #else /* non-Windows compilation */ # define GLAPI extern # define GLAPIENTRY -# define GLAPIENTRYP * -# define GLCALLBACK -# define GLCALLBACKP * -# define GLCALLBACKPCAST * -# define GLWINAPI -# define GLWINAPIV #endif /* WIN32 / CYGWIN32 bracket */ -/* compatability guard so we don't need to change client code */ - -#if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP) -# define CALLBACK GLCALLBACK -typedef int (GLAPIENTRY *PROC)(); -typedef void *HGLRC; -typedef void *HDC; -typedef unsigned long COLORREF; -#endif - #if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) -# define WGL_FONT_LINES 0 -# define WGL_FONT_POLYGONS 1 -#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; #include #endif -#ifdef __cplusplus -extern "C" { +#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED +#pragma import on #endif +/* + * End system-specific stuff. + **********************************************************************/ + -#ifdef macintosh - #pragma enumsalwaysint on - #if PRAGMA_IMPORT_SUPPORTED - #pragma import on - #endif +#ifdef __cplusplus +extern "C" { #endif @@ -1781,11 +1724,6 @@ GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, -/* - * XXX these extensions may eventually be moved into glext.h - */ - - /* * GL_EXT_abgr (number 1) */ @@ -2286,17 +2224,19 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); +/********************************************************************** + * Begin system-specific stuff + */ #if defined(__BEOS__) || defined(__QUICKDRAW__) #pragma export off #endif - -#ifdef macintosh - #pragma enumsalwaysint reset - #if PRAGMA_IMPORT_SUPPORTED - #pragma import off - #endif +#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED +#pragma import off #endif +/* + * End system-specific stuff + **********************************************************************/ #ifdef __cplusplus diff --git a/include/GL/glu.h b/include/GL/glu.h index 5acd0b73921..249e37d16c5 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.19 1999/11/24 13:06:48 brianp Exp $ */ +/* $Id: glu.h,v 1.20 2000/05/22 16:21:27 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -47,10 +47,21 @@ extern "C" { # else /* for use with static link lib build of Win32 edition only */ # define GLUAPI extern # endif /* _STATIC_MESA support */ +# define GLCALLBACK __stdcall +# define GLCALLBACKP __stdcall * #else # define GLUAPI extern +# define GLCALLBACK +# define GLCALLBACKP * #endif /* WIN32 / CYGWIN32 bracket */ +/* compatability guard so we don't need to change client code */ +#if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP) +# define CALLBACK GLCALLBACK +#endif + + + #ifdef macintosh #pragma enumsalwaysint on #if PRAGMA_IMPORT_SUPPORTED diff --git a/include/GL/mesa_wgl.h b/include/GL/mesa_wgl.h index 6e7d287d025..8a0a55dfe59 100644 --- a/include/GL/mesa_wgl.h +++ b/include/GL/mesa_wgl.h @@ -1,4 +1,4 @@ -/* $Id: mesa_wgl.h,v 1.4 1999/11/22 14:05:44 brianp Exp $ */ +/* $Id: mesa_wgl.h,v 1.5 2000/05/22 16:21:27 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -39,6 +39,41 @@ 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 ) -- cgit v1.2.3 From 0890ed3148ca1a6377f8124eb030a4ed3680c94b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 22 May 2000 16:22:47 +0000 Subject: include glext.h if GL_GLEXT_LEGACY not defined --- include/GL/gl.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index d9c86304a14..9ade786afd5 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.39 2000/05/22 16:21:27 brianp Exp $ */ +/* $Id: gl.h,v 1.40 2000/05/22 16:22:47 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1722,6 +1722,7 @@ GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); +#if defined(GL_GLEXT_LEGACY) /* @@ -2223,6 +2224,13 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); #endif /* GL_MESA_resize_bufffers */ +#else /* GL_GLEXT_LEGACY */ + +#include "glext.h" + +#endif /* GL_GLEXT_LEGACY */ + + /********************************************************************** * Begin system-specific stuff -- cgit v1.2.3 From 8da58f31846bd119070af78fac340a3e5da4f056 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 22 May 2000 19:40:43 +0000 Subject: replaced __CYGWIN32__ with __CYGWIN__ --- include/GL/gl.h | 6 +++--- include/GL/glext.h | 2 +- include/GL/glu.h | 6 +++--- src/glu/mesa/gluP.h | 11 +++++++---- 4 files changed, 14 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 9ade786afd5..63b1004bf1a 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.40 2000/05/22 16:22:47 brianp Exp $ */ +/* $Id: gl.h,v 1.41 2000/05/22 19:40:43 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -48,7 +48,7 @@ #define __WIN32__ #endif -#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__)) +#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__)) # if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ # define GLAPI __declspec(dllexport) # elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ @@ -61,7 +61,7 @@ /* non-Windows compilation */ # define GLAPI extern # define GLAPIENTRY -#endif /* WIN32 / CYGWIN32 bracket */ +#endif /* WIN32 / CYGWIN bracket */ #if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) #include diff --git a/include/GL/glext.h b/include/GL/glext.h index 74a4448a9e8..0eb4ca49a0b 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -15,7 +15,7 @@ extern "C" { #endif -#if defined(_WIN32) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN__) #define WIN32_LEAN_AND_MEAN 1 #include #endif diff --git a/include/GL/glu.h b/include/GL/glu.h index 249e37d16c5..c03f8cb9517 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,4 +1,4 @@ -/* $Id: glu.h,v 1.20 2000/05/22 16:21:27 brianp Exp $ */ +/* $Id: glu.h,v 1.21 2000/05/22 19:40:43 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -39,7 +39,7 @@ extern "C" { /* to facilitate clean DLL building ... */ -#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__)) +#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__)) # if defined(_MSC_VER) && defined(BUILD_GLU32) /* tag specify we're building mesa as a DLL */ # define GLUAPI __declspec(dllexport) # elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ @@ -53,7 +53,7 @@ extern "C" { # define GLUAPI extern # define GLCALLBACK # define GLCALLBACKP * -#endif /* WIN32 / CYGWIN32 bracket */ +#endif /* WIN32 / CYGWIN bracket */ /* compatability guard so we don't need to change client code */ #if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP) diff --git a/src/glu/mesa/gluP.h b/src/glu/mesa/gluP.h index 995dd4571fa..89bfa9c92cd 100644 --- a/src/glu/mesa/gluP.h +++ b/src/glu/mesa/gluP.h @@ -1,4 +1,4 @@ -/* $Id: gluP.h,v 1.3 2000/05/22 16:25:37 brianp Exp $ */ +/* $Id: gluP.h,v 1.4 2000/05/22 19:41:11 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -23,6 +23,9 @@ /* * $Log: gluP.h,v $ + * Revision 1.4 2000/05/22 19:41:11 brianp + * replaced __CYGWIN32__ with __CYGWIN__ + * * Revision 1.3 2000/05/22 16:25:37 brianp * added some Window-isms formerly in gl.h * @@ -75,7 +78,7 @@ # define __WIN32__ #endif -#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__)) +#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__)) # pragma warning( disable : 4068 ) /* unknown pragma */ # pragma warning( disable : 4710 ) /* function 'foo' not inlined */ # pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */ @@ -101,7 +104,7 @@ # define GLAPIENTRYP __stdcall * # define GLCALLBACK __stdcall # define GLCALLBACKP __stdcall * -# if defined(__CYGWIN32__) +# if defined(__CYGWIN__) # define GLCALLBACKPCAST * # else # define GLCALLBACKPCAST __stdcall * @@ -118,7 +121,7 @@ # define GLCALLBACKPCAST * # define GLWINAPI # define GLWINAPIV -#endif /* WIN32 / CYGWIN32 bracket */ +#endif /* WIN32 / CYGWIN bracket */ /* compatability guard so we don't need to change client code */ -- cgit v1.2.3 From 90fbef490e0f5b66705d0a407549a60d6840bbc6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 23 May 2000 22:41:51 +0000 Subject: changed glext.h include --- include/GL/gl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 63b1004bf1a..63bae14f24e 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.41 2000/05/22 19:40:43 brianp Exp $ */ +/* $Id: gl.h,v 1.42 2000/05/23 22:41:51 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2226,7 +2226,7 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); #else /* GL_GLEXT_LEGACY */ -#include "glext.h" +#include #endif /* GL_GLEXT_LEGACY */ -- cgit v1.2.3 From f658ab0e2e9c4f319c0e6e77e7d08031be74f93b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 May 2000 15:04:01 +0000 Subject: always define GL_ARB_multitexture (OpenGL 1.2.1 feature) --- include/GL/gl.h | 206 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 105 insertions(+), 101 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 63bae14f24e..8e9ce07bd57 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.42 2000/05/23 22:41:51 brianp Exp $ */ +/* $Id: gl.h,v 1.43 2000/05/24 15:04:01 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1722,11 +1722,94 @@ GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); + +/* + * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1) + */ +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 + +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + +GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture); +GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture); +GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s); +GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s); +GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s); +GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s); +GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); +GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); +GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); + +#endif /* GL_ARB_multitexture */ + + + + #if defined(GL_GLEXT_LEGACY) /* - * GL_EXT_abgr (number 1) + * 1. GL_EXT_abgr */ #ifndef GL_EXT_abgr #define GL_EXT_abgr 1 @@ -1738,7 +1821,7 @@ GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, /* - * GL_EXT_blend_color (number 2) + * 2. GL_EXT_blend_color */ #ifndef GL_EXT_blend_color #define GL_EXT_blend_color 1 @@ -1756,7 +1839,7 @@ GLAPI void GLAPIENTRY glBlendColorEXT( GLclampf red, GLclampf green, GLclampf bl /* - * GL_EXT_polygon_offset (number 3) + * 3. GL_EXT_polygon_offset */ #ifndef GL_EXT_polygon_offset #define GL_EXT_polygon_offset 1 @@ -1772,7 +1855,7 @@ GLAPI void GLAPIENTRY glPolygonOffsetEXT( GLfloat factor, GLfloat bias ); /* - * GL_EXT_texture3D (number 6) + * 6. GL_EXT_texture3D */ #ifndef GL_EXT_texture3D #define GL_EXT_texture3D 1 @@ -1799,7 +1882,7 @@ GLAPI void GLAPIENTRY glCopyTexSubImage3DEXT( GLenum target, GLint level, GLint /* - * GL_EXT_texture_object (number 20) + * 20. GL_EXT_texture_object */ #ifndef GL_EXT_texture_object #define GL_EXT_texture_object 1 @@ -1826,7 +1909,7 @@ GLAPI GLboolean GLAPIENTRY glIsTextureEXT( GLuint texture ); /* - * GL_EXT_rescale_normal (number 27) + * 27. GL_EXT_rescale_normal */ #ifndef GL_EXT_rescale_normal #define GL_EXT_rescale_normal 1 @@ -1838,7 +1921,7 @@ GLAPI GLboolean GLAPIENTRY glIsTextureEXT( GLuint texture ); /* - * GL_EXT_vertex_array (number 30) + * 30. GL_EXT_vertex_array */ #ifndef GL_EXT_vertex_array #define GL_EXT_vertex_array 1 @@ -1899,7 +1982,7 @@ GLAPI void GLAPIENTRY glDrawArraysEXT( GLenum mode, GLint first, GLsizei count ) /* - * GL_SGIS_texture_edge_clamp (number 35) + * 35. GL_SGIS_texture_edge_clamp */ #ifndef GL_SGIS_texture_edge_clamp #define GL_SGIS_texture_edge_clamp 1 @@ -1911,7 +1994,7 @@ GLAPI void GLAPIENTRY glDrawArraysEXT( GLenum mode, GLint first, GLsizei count ) /* - * GL_EXT_blend_minmax (number 37) + * 37. GL_EXT_blend_minmax */ #ifndef GL_EXT_blend_minmax #define GL_EXT_blend_minmax 1 @@ -1928,7 +2011,7 @@ GLAPI void GLAPIENTRY glBlendEquationEXT( GLenum mode ); /* - * GL_EXT_blend_subtract (number 38) (requires GL_EXT_blend_max ) + * 38. GL_EXT_blend_subtract (requires GL_EXT_blend_max ) */ #ifndef GL_EXT_blend_subtract #define GL_EXT_blend_subtract 1 @@ -1941,7 +2024,7 @@ GLAPI void GLAPIENTRY glBlendEquationEXT( GLenum mode ); /* - * GL_EXT_blend_logic_op (number 39) + * 39. GL_EXT_blend_logic_op */ #ifndef GL_EXT_blend_logic_op #define GL_EXT_blend_logic_op 1 @@ -1953,7 +2036,7 @@ GLAPI void GLAPIENTRY glBlendEquationEXT( GLenum mode ); /* - * GL_EXT_point_parameters (number 54) + * 54. GL_EXT_point_parameters */ #ifndef GL_EXT_point_parameters #define GL_EXT_point_parameters 1 @@ -1973,7 +2056,7 @@ GLAPI void GLAPIENTRY glPointParameterfvSGIS(GLenum pname, const GLfloat *params /* - * GL_EXT_paletted_texture (number 78) + * 78. GL_EXT_paletted_texture */ #ifndef GL_EXT_paletted_texture #define GL_EXT_paletted_texture 1 @@ -2010,7 +2093,7 @@ GLAPI void GLAPIENTRY glGetColorTableParameterivEXT( GLenum target, GLenum pname /* - * GL_EXT_clip_volume_hint (number 79) + * 79. GL_EXT_clip_volume_hint */ #ifndef GL_EXT_clip_volume_hint #define GL_EXT_clip_volume_hint 1 @@ -2022,7 +2105,7 @@ GLAPI void GLAPIENTRY glGetColorTableParameterivEXT( GLenum target, GLenum pname /* - * GL_EXT_compiled_vertex_array (number 97) + * 97. GL_EXT_compiled_vertex_array */ #ifndef GL_EXT_compiled_vertex_array #define GL_EXT_compiled_vertex_array 1 @@ -2048,7 +2131,7 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); /* - * GL_EXT_shared_texture_palette (number 141) (req's GL_EXT_paletted_texture) + * 141. GL_EXT_shared_texture_palette (req's GL_EXT_paletted_texture) */ #ifndef GL_EXT_shared_texture_palette #define GL_EXT_shared_texture_palette 1 @@ -2060,7 +2143,7 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); /* - * GL_EXT_stencil_wrap (number 176) + * 176. GL_EXT_stencil_wrap */ #ifndef GL_EXT_stencil_wrap #define GL_EXT_stencil_wrap 1 @@ -2073,7 +2156,7 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); /* - * GL_NV_texgen_reflection (number 179) + * 179. GL_NV_texgen_reflection */ #ifndef GL_NV_texgen_reflection #define GL_NV_texgen_reflection 1 @@ -2086,7 +2169,7 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); /* - * GL_EXT_texture_env_add (number 185) + * 185. GL_EXT_texture_env_add */ #ifndef GL_EXT_texture_env_add #define GL_EXT_texture_env_add 1 @@ -2097,89 +2180,10 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); -/* - * GL_ARB_multitexture (ARB 0) - */ -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 - -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 - -GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture); -GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture); -GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s); -GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s); -GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s); -GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s); -GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); -GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); -GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); -GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); -GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); -GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v); -GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v); -GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v); -GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); -GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); - -#endif /* GL_ARB_multitexture */ - /* - * GL_MESA_window_pos (197) + * 197. GL_MESA_window_pos */ #ifndef GL_MESA_window_pos #define GL_MESA_window_pos 1 @@ -2214,7 +2218,7 @@ GLAPI void GLAPIENTRY glWindowPos4dvMESA( const GLdouble *p ); /* - * GL_MESA_resize_bufffers (196) + * 196. GL_MESA_resize_bufffers */ #ifndef GL_MESA_resize_bufffers #define GL_MESA_resize_buffers 1 -- cgit v1.2.3 From 07b220ad46d5f30218210b5512c9037214a7ff89 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 8 Jun 2000 22:50:24 +0000 Subject: clean-up in anticipation of glxext.h --- include/GL/glx.h | 218 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 134 insertions(+), 84 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index ead38a91a05..5af05ed1709 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.20 2000/04/19 01:40:00 brianp Exp $ */ +/* $Id: glx.h,v 1.21 2000/06/08 22:50:24 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -25,7 +25,6 @@ */ - #ifndef GLX_H #define GLX_H @@ -59,6 +58,7 @@ extern "C" { #define GLX_VERSION_1_1 1 #define GLX_VERSION_1_2 1 +#define GLX_VERSION_1_3 1 #define GLX_EXTENSION_NAME "GLX" @@ -161,75 +161,16 @@ extern "C" { #define GLX_PBUFFER 0x8033 -/* - * 28. GLX_EXT_visual_info extension - */ -#define GLX_X_VISUAL_TYPE_EXT 0x22 -#define GLX_TRANSPARENT_TYPE_EXT 0x23 -#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 -#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 -#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 -#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 -#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 -#define GLX_TRUE_COLOR_EXT 0x8002 -#define GLX_DIRECT_COLOR_EXT 0x8003 -#define GLX_PSEUDO_COLOR_EXT 0x8004 -#define GLX_STATIC_COLOR_EXT 0x8005 -#define GLX_GRAY_SCALE_EXT 0x8006 -#define GLX_STATIC_GRAY_EXT 0x8007 -#define GLX_NONE_EXT 0x8000 -#define GLX_TRANSPARENT_RGB_EXT 0x8008 -#define GLX_TRANSPARENT_INDEX_EXT 0x8009 - - -/* - * 42. GLX_EXT_visual_rating - */ -#define GLX_VISUAL_CAVEAT_EXT 0x20 -/*#define GLX_NONE_EXT 0x8000*/ -#define GLX_SLOW_VISUAL_EXT 0x8001 -#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D - - -/* - * 47. GLX_EXT_import_context - */ -#define GLX_SHARE_CONTEXT_EXT 0x800A -#define GLX_VISUAL_ID_EXT 0x800B -#define GLX_SCREEN_EXT 0x800C - -/* - * Compile-time extension tests - */ -#define GLX_EXT_visual_info 1 -#define GLX_EXT_visual_rating 1 -#define GLX_EXT_import_context 1 -#define GLX_MESA_pixmap_colormap 1 -#define GLX_MESA_release_buffers 1 -#define GLX_MESA_copy_sub_buffer 1 -#define GLX_MESA_set_3dfx_mode 1 -#define GLX_SGI_video_sync 1 -#define GLX_ARB_get_proc_address 1 - - - -#ifdef MESA - typedef XMesaContext GLXContext; - typedef Pixmap GLXPixmap; - typedef Drawable GLXDrawable; -#else - typedef void * GLXContext; - typedef XID GLXPixmap; - typedef XID GLXDrawable; - /* GLX 1.3 and later */ - typedef XID GLXFBConfigID; - typedef XID GLXPfuffer; - typedef XID GLXWindow; - typedef XID GLXPbuffer; - typedef XID GLXFBConfig; -#endif +typedef void * GLXContext; +typedef XID GLXPixmap; +typedef XID GLXDrawable; +/* GLX 1.3 and later */ +typedef void * GLXFBConfig; +typedef XID GLXFBConfigID; typedef XID GLXContextID; +typedef XID GLXWindow; +typedef XID GLXPbuffer; @@ -338,32 +279,78 @@ extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable, -/* GLX_MESA_pixmap_colormap */ -extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual, - Pixmap pixmap, Colormap cmap ); +/*#ifndef GLX_GLXEXT_LEGACY*/ +/*#include */ -/* GLX_MESA_release_buffers */ -extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d ); +/*#else*/ -/* GLX_MESA_copy_sub_buffer */ -extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable, - int x, int y, int width, int height ); +/* + * 28. GLX_EXT_visual_info extension + */ +#ifndef GLX_EXT_visual_info +#define GLX_EXT_visual_info 1 +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 +#define GLX_TRUE_COLOR_EXT 0x8002 +#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_PSEUDO_COLOR_EXT 0x8004 +#define GLX_STATIC_COLOR_EXT 0x8005 +#define GLX_GRAY_SCALE_EXT 0x8006 +#define GLX_STATIC_GRAY_EXT 0x8007 +#define GLX_NONE_EXT 0x8000 +#define GLX_TRANSPARENT_RGB_EXT 0x8008 +#define GLX_TRANSPARENT_INDEX_EXT 0x8009 -/* GLX_MESA_set_3dfx_mode */ -extern GLboolean glXSet3DfxModeMESA( GLint mode ); +#endif /* 28. GLX_EXT_visual_info extension */ -/* GLX_SGI_video_sync */ + +/* + * 41. GLX_SGI_video_sync + */ +#ifndef GLX_SGI_video_sync +#define GLX_SGI_video_sync 1 + extern int glXGetVideoSyncSGI(unsigned int *count); -extern int glXWaitVideoSyncSGI(int divisor, int remainder, - unsigned int *count); +extern int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count); + +#endif /* GLX_SGI_video_sync */ + + + +/* + * 42. GLX_EXT_visual_rating + */ +#ifndef GLX_EXT_visual_rating +#define GLX_EXT_visual_rating 1 + +#define GLX_VISUAL_CAVEAT_EXT 0x20 +/*#define GLX_NONE_EXT 0x8000*/ +#define GLX_SLOW_VISUAL_EXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D + +#endif /* GLX_EXT_visual_rating */ -/* GLX_EXT_import_context */ +/* + * 47. GLX_EXT_import_context + */ +#ifndef GLX_EXT_import_context +#define GLX_EXT_import_context 1 + +#define GLX_SHARE_CONTEXT_EXT 0x800A +#define GLX_VISUAL_ID_EXT 0x800B +#define GLX_SCREEN_EXT 0x800C + extern void glXFreeContextEXT(Display *dpy, GLXContext context); extern GLXContextID glXGetContextIDEXT(const GLXContext context); @@ -375,11 +362,74 @@ extern GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID); extern int glXQueryContextInfoEXT(Display *dpy, GLXContext context, int attribute,int *value); +#endif /* GLX_EXT_import_context */ + -/* GLX_ARB_get_proc_address */ +/* + * ARB 2. GLX_ARB_get_proc_address + */ +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 + extern void (*glXGetProcAddressARB(const GLubyte *procName))(); +#endif /* GLX_ARB_get_proc_address */ + + + +/* + * GLX_MESA_pixmap_colormap + */ +#ifndef GLX_MESA_pixmap_colormap +#define GLX_MESA_pixmap_colormap 1 + +extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual, + Pixmap pixmap, Colormap cmap ); + +#endif /* GLX_MESA_pixmap_colormap */ + + + +/* + * GLX_MESA_release_buffers + */ +#ifndef GLX_MESA_release_buffers +#define GLX_MESA_release_buffers 1 + +extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d ); + +#endif /* GLX_MESA_release_buffers */ + + + +/* + * GLX_MESA_copy_sub_buffer + */ +#ifndef GLX_MESA_copy_sub_buffer +#define GLX_MESA_copy_sub_buffer 1 + +extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable, + int x, int y, int width, int height ); + +#endif + + + +/* + * GLX_MESA_set_3dfx_mode + */ +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_MESA_set_3dfx_mode 1 + +extern GLboolean glXSet3DfxModeMESA( GLint mode ); + +#endif /* GLX_MESA_set_3dfx_mode */ + + + +/*#endif*/ /* GLX_GLXEXT_LEGACY */ + #ifdef __cplusplus -- cgit v1.2.3 From e7268d83414cdefe93fb0974ff7d5122f2c41d4c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 13 Jun 2000 00:36:58 +0000 Subject: now using SGI's glext.h instead of original Mesa file --- include/GL/glext.h | 5609 +++++++++++++++++++++++----------------------------- 1 file changed, 2523 insertions(+), 3086 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 0eb4ca49a0b..3ee1cef05e1 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -1,758 +1,1910 @@ #ifndef __glext_h_ #define __glext_h_ - -/* - * XXX Some token values aren't known (grep for ?) - * XXX This file may be automatically generated in the future. - * XXX There are some doubly-defined tokens with different values! Search - * for "DUPLICATE". - */ - - #ifdef __cplusplus extern "C" { #endif - -#if defined(_WIN32) && !defined(__CYGWIN__) +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.1 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: This software was created using the +** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has +** not been independently verified as being compliant with the OpenGL(R) +** version 1.2.1 Specification. +*/ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) #define WIN32_LEAN_AND_MEAN 1 #include #endif -#ifndef GLAPI -#define GLAPI extern +#ifndef APIENTRY +#define APIENTRY #endif -#if defined(GLAPIENTRY) && !defined(APIENTRY) -#define APIENTRY GLAPIENTRY +/*************************************************************/ + +/* Header file version number, required by OpenGL ABI for Linux */ +#define GL_GLEXT_VERSION 6 + +#ifndef GL_VERSION_1_2 +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D #endif -#ifndef APIENTRY -#define APIENTRY +#ifndef GL_ARB_multitexture +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 #endif +#ifndef GL_ARB_transpose_matrix +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +#endif -/* - * Versions: - * 1. Brian Paul, 24 Feb 2000 - * Intial Version - * 2. Brian Paul, 7 Mar 2000 - * Added GL_HP_occlusion_test, GL_EXT_texture_lod_bias - * 3. Brian Paul, 20 Mar 2000 - * Added all missing extensions up to number 137 - * 4. Brian Paul, 23 Mar 2000 - * Now have all extenions up to number 197 - * 5. Brian Paul, 27 Mar 2000 - * Added GL_ARB_texture_compression - * 6. Brian Paul, 5 Apr 2000 - * Added GL_ARB_multisample tokens, added GL_ARB_texture_env_add - * 7. Brian Paul, 7 Apr 2000 - * Minor clean-ups, temporary token values for GL_SGIS_pixel_texture - * 8. Brian Paul, 15 Apr 2000 - * Added GL_EXT_texture_cube_map, GL_NV_texgen_emboss, adding some - * missing tokens values. - * 9. Brian Paul, 4 May 2000 - * Added a bunch of missing token values. - * 10. Brian Paul, 11 May 2000 - * Added extensions 198 .. 212. - */ -#define GL_GLEXT_VERSION_EXT 10 +#ifndef GL_ARB_multisample +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +#endif +#ifndef GL_ARB_texture_cube_map +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#endif -/* - * 1. GL_EXT_abgr - */ -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 +#ifndef GL_ARB_texture_compression +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +#endif -#define GL_ABGR_EXT 0x8000 +#ifndef GL_EXT_abgr +#define GL_ABGR_EXT 0x8000 +#endif -#endif /* GL_EXT_abgr */ +#ifndef GL_EXT_blend_color +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 +#endif +#ifndef GL_EXT_polygon_offset +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +#endif +#ifndef GL_EXT_texture +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#endif -/* - * 2. GL_EXT_blend_color - */ -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 +#ifndef GL_EXT_texture3D +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +#endif -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_COLOR_EXT 0x8005 +#ifndef GL_SGIS_texture_filter4 +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +#endif -GLAPI void APIENTRY glBlendColorEXT(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +#ifndef GL_EXT_subtexture +#endif -typedef void (APIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +#ifndef GL_EXT_copy_texture +#endif -#endif /* GL_EXT_blend_color */ +#ifndef GL_EXT_histogram +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#endif +#ifndef GL_EXT_convolution +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 +#endif +#ifndef GL_SGI_color_matrix +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#endif -/* - * 3. GL_EXT_polygon_offset - */ -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 +#ifndef GL_SGI_color_table +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +#endif -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +#ifndef GL_SGIS_pixel_texture +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +#endif -GLAPI void APIENTRY glPolygonOffsetEXT(GLfloat factor, GLfloat bias); +#ifndef GL_SGIX_pixel_texture +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +#endif -typedef void (APIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +#ifndef GL_SGIS_texture4D +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +#endif -#endif /* GL_EXT_polygon_offset */ +#ifndef GL_SGI_texture_color_table +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#endif +#ifndef GL_EXT_cmyka +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#endif +#ifndef GL_EXT_texture_object +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A +#endif -/* - * 4. GL_EXT_texture - */ -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 +#ifndef GL_SGIS_detail_texture +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +#endif -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 - -#endif /* GL_EXT_texture */ +#ifndef GL_SGIS_sharpen_texture +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +#endif +#ifndef GL_EXT_packed_pixels +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#endif +#ifndef GL_SGIS_texture_lod +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#endif -/* - * 5. unknown - */ +#ifndef GL_SGIS_multisample +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +#endif +#ifndef GL_EXT_rescale_normal +#define GL_RESCALE_NORMAL_EXT 0x803A +#endif +#ifndef GL_EXT_vertex_array +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +#endif -/* - * 6. GL_EXT_texture3D - */ -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 +#ifndef GL_EXT_misc_attribute +#endif -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A - -GLAPI void APIENTRY glTexImage3DEXT(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glCopyTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); - -typedef void (APIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#ifndef GL_SGIS_generate_mipmap +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#endif -#endif /* GL_EXT_texture3D */ +#ifndef GL_SGIX_clipmap +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#endif +#ifndef GL_SGIX_shadow +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D +#endif +#ifndef GL_SGIS_texture_edge_clamp +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#endif -/* - * 7. GL_SGI_texture_filter4 - */ -#ifndef GL_SGI_texture_filter4 -#define GL_SGI_texture_filter4 1 +#ifndef GL_SGIS_texture_border_clamp +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#endif -#define GL_FILTER4_SGIS 0x8146 -#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +#ifndef GL_EXT_blend_minmax +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 +#endif -GLAPI void APIENTRY glGetTexFilterFuncSGIS(GLenum target, GLenum filter, GLfloat *weights); -GLAPI void APIENTRY glTexFilterFuncSGIS(GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#ifndef GL_EXT_blend_subtract +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#endif -typedef void (APIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); -typedef void (APIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#ifndef GL_EXT_blend_logic_op +#endif -#endif /* GL_SGI_texture_filter4 */ +#ifndef GL_SGIX_interlace +#define GL_INTERLACE_SGIX 0x8094 +#endif +#ifndef GL_SGIX_pixel_tiles +#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E +#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F +#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 +#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 +#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 +#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 +#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 +#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 +#endif +#ifndef GL_SGIS_texture_select +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#endif -/* - * 8. unknown - */ +#ifndef GL_SGIX_sprite +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +#endif +#ifndef GL_SGIX_texture_multi_buffer +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#endif +#ifndef GL_SGIS_point_parameters +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +#endif -/* - * 9. GL_EXT_subtexture - */ -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 +#ifndef GL_SGIX_instruments +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +#endif -GLAPI void APIENTRY glCopyTexSubImage1DEXT(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glTexSubImage1DEXT(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -GLAPI void APIENTRY glTexSubImage2DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#ifndef GL_SGIX_texture_scale_bias +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C +#endif -typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#ifndef GL_SGIX_framezoom +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +#endif -#endif /* GL_EXT_subtexture */ +#ifndef GL_SGIX_tag_sample_buffer +#endif +#ifndef GL_SGIX_reference_plane +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +#endif +#ifndef GL_SGIX_flush_raster +#endif -/* - * 10. GL_EXT_copy_texture - */ -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 +#ifndef GL_SGIX_depth_texture +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#endif -GLAPI void APIENTRY glCopyTexImage1DEXT(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI void APIENTRY glCopyTexImage2DEXT(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI void APIENTRY glCopyTexSubImage2DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#ifndef GL_SGIS_fog_function +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +#endif -typedef void (APIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#ifndef GL_SGIX_fog_offset +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#endif -#endif /* GL_EXT_copy_texture */ +#ifndef GL_HP_image_transform +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +#endif +#ifndef GL_HP_convolution_border_modes +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#endif +#ifndef GL_INGR_palette_buffer +#endif -/* - * 11. GL_EXT_histogram - */ -#ifndef GL_EXT_histogram -#define GL_EXT_histogram 1 +#ifndef GL_SGIX_texture_add_env +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#endif -#define GL_HISTOGRAM_EXT 0x8024 -#define GL_PROXY_HISTOGRAM_EXT 0x8025 -#define GL_HISTOGRAM_WIDTH_EXT 0x8026 -#define GL_HISTOGRAM_FORMAT_EXT 0x8027 -#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C -#define GL_HISTOGRAM_SINK_EXT 0x802D - -GLAPI void APIENTRY glGetHistogramEXT(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -GLAPI void APIENTRY glGetHistogramParameterfvEXT(GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetHistogramParameterivEXT(GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMinmaxEXT(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); -GLAPI void APIENTRY glGetMinmaxParameterfvEXT(GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetMinmaxParameterivEXT(GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glHistogramEXT(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glMinmaxEXT(GLenum target, GLenum internalformat, GLboolean sink); -GLAPI void APIENTRY glResetHistogramEXT(GLenum target); -GLAPI void APIENTRY glResetMinmaxEXT(GLenum target); +#ifndef GL_EXT_color_subtable +#endif -typedef void (APIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); -typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); -typedef void (APIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); +#ifndef GL_PGI_vertex_hints +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#endif -#endif /* GL_EXT_histogram */ +#ifndef GL_PGI_misc_hints +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +#endif +#ifndef GL_EXT_paletted_texture +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#endif +#ifndef GL_EXT_clip_volume_hint +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#endif -/* - * 12. GL_EXT_convolution - */ -#ifndef GL_EXT_convolution -#define GL_EXT_convolution 1 +#ifndef GL_SGIX_list_priority +#define GL_LIST_PRIORITY_SGIX 0x8182 +#endif -#define GL_CONVOLUTION_1D_EXT 0x8010 -#define GL_CONVOLUTION_2D_EXT 0x8011 -#define GL_SEPARABLE_2D_EXT 0x8012 -#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 -#define GL_REDUCE_EXT 0x8016 -#define GL_CONVOLUTION_FORMAT_EXT 0x8017 -#define GL_CONVOLUTION_WIDTH_EXT 0x8018 -#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 - -GLAPI void APIENTRY glConvolutionFilter1DEXT(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -GLAPI void APIENTRY glConvolutionFilter2DEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -GLAPI void APIENTRY glConvolutionParameterfEXT(GLenum target, GLenum pname, GLfloat params); -GLAPI void APIENTRY glConvolutionParameterfvEXT(GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glConvolutionParameteriEXT(GLenum target, GLenum pname, GLint params); -GLAPI void APIENTRY glConvolutionParameterivEXT(GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glCopyConvolutionFilter1DEXT(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyConvolutionFilter2DEXT(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetConvolutionFilterEXT(GLenum target, GLenum format, GLenum type, GLvoid *image); -GLAPI void APIENTRY glGetConvolutionParameterfvEXT(GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetConvolutionParameterivEXT(GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSeparableFilterEXT(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -GLAPI void APIENTRY glSeparableFilter2DEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +#ifndef GL_SGIX_ir_instrument1 +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#endif -typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +#ifndef GL_SGIX_calligraphic_fragment +#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 +#endif -#endif /* GL_EXT_convolution */ +#ifndef GL_SGIX_texture_lod_bias +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#endif +#ifndef GL_SGIX_shadow_ambient +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#endif +#ifndef GL_EXT_index_texture +#endif -/* - * 13. GL_SGI_color_matrix - */ -#ifndef GL_SGI_color_matrix -#define GL_SGI_color_matrix 1 +#ifndef GL_EXT_index_material +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +#endif -#define GL_COLOR_MATRIX_SGI 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#ifndef GL_EXT_index_func +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +#endif -#endif /* GL_SGI_color_matrix */ +#ifndef GL_EXT_index_array_formats +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#endif +#ifndef GL_EXT_compiled_vertex_array +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +#endif +#ifndef GL_EXT_cull_vertex +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +#endif -/* - * 14. GL_SGI_color_table - */ -#ifndef GL_SGI_color_table -#define GL_SGI_color_table 1 +#ifndef GL_SGIX_ycrcb +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#endif -#define GL_COLOR_TABLE_SGI 0x80D0 /* DUPLICATE! */ -#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 -#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 -#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 -#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF - -GLAPI void APIENTRY glColorTableParameterfvSGI(GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glColorTableParameterivSGI(GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glColorTableSGI(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -GLAPI void APIENTRY glCopyColorTableSGI(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glGetColorTableParameterfvSGI(GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetColorTableParameterivSGI(GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetColorTableSGI(GLenum target, GLenum format, GLenum type, GLvoid *table); +#ifndef GL_SGIX_fragment_lighting +#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 +#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 +#define GL_LIGHT_ENV_MODE_SGIX 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B +#define GL_FRAGMENT_LIGHT0_SGIX 0x840C +#define GL_FRAGMENT_LIGHT1_SGIX 0x840D +#define GL_FRAGMENT_LIGHT2_SGIX 0x840E +#define GL_FRAGMENT_LIGHT3_SGIX 0x840F +#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 +#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 +#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 +#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 +#endif -typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +#ifndef GL_IBM_rasterpos_clip +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#endif -#endif /* GL_SGI_color_table */ +#ifndef GL_HP_texture_lighting +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#endif +#ifndef GL_EXT_draw_range_elements +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +#endif +#ifndef GL_WIN_phong_shading +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#endif -/* - * ?. GL_SGIX_pixel_texture - */ -#ifndef GL_SGIX_pixel_texture -#define GL_SGIX_pixel_texture 1 +#ifndef GL_WIN_specular_fog +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#endif -#define GL_PIXEL_TEX_GEN_SGIX 0x8139 -#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +#ifndef GL_EXT_light_texture +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +/* reuse GL_FRAGMENT_DEPTH_EXT */ +#endif -GLAPI void APIENTRY glPixelTexGenSGIX(GLenum mode); +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#endif -typedef void (APIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); +#ifndef GL_EXT_bgra +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif -#endif /* GL_SGIX_pixel_texture */ +#ifndef GL_INTEL_texture_scissor +#endif +#ifndef GL_INTEL_parallel_arrays +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 +#endif +#ifndef GL_HP_occlusion_test +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#endif -/* - * 15. GL_SGIS_pixel_texture - */ -#ifndef GL_SGIS_pixel_texture -#define GL_SGIS_pixel_texture 1 +#ifndef GL_EXT_pixel_transform +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 +#endif -#define GL_PIXEL_TEXTURE_SGIS 0x8353 -#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 -#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 -#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +#ifndef GL_EXT_pixel_transform_color_table +#endif -GLAPI void APIENTRY glPixelTexGenParameterfSGIS(GLenum target, GLfloat value); -GLAPI void APIENTRY glPixelTexGenParameterfvSGIS(GLenum target, const GLfloat *value); -GLAPI void APIENTRY glPixelTexGenParameteriSGIS(GLenum target, GLint value); -GLAPI void APIENTRY glPixelTexGenParameterivSGIS(GLenum target, const GLint *value); -GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS(GLenum target, GLfloat *value); -GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS(GLenum target, GLint *value); +#ifndef GL_EXT_shared_texture_palette +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#endif -typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum target, GLfloat value); -typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum target, const GLfloat *value); -typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum target, GLint value); -typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum target, const GLint *value); -typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum target, GLfloat *value); -typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum target, GLint *value); +#ifndef GL_EXT_separate_specular_color +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#endif -#endif /* GL_SGIS_pixel_texture */ +#ifndef GL_EXT_secondary_color +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +#endif +#ifndef GL_EXT_texture_perturb_normal +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +#endif +#ifndef GL_EXT_multi_draw_arrays +#endif -/* - * 16. GL_SGIS_texture4D - */ -#ifndef GL_SGIS_texture4D -#define GL_SGIS_texture4D 1 +#ifndef GL_EXT_fog_coord +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +#endif -#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 -#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 -#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 -#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 -#define GL_TEXTURE_4D_SGIS 0x8134 -#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 -#define GL_TEXTURE_4DSIZE_SGIS 0x8136 -#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 -#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 -#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +#ifndef GL_REND_screen_coordinates +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#endif -GLAPI void APIENTRY glTexImage4DSGIS(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTexSubImage4DSGIS(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels); +#ifndef GL_EXT_coordinate_frame +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 +#endif -typedef void (APIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels); +#ifndef GL_EXT_texture_env_combine +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE3_RGB_EXT 0x8583 +#define GL_SOURCE4_RGB_EXT 0x8584 +#define GL_SOURCE5_RGB_EXT 0x8585 +#define GL_SOURCE6_RGB_EXT 0x8586 +#define GL_SOURCE7_RGB_EXT 0x8587 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_SOURCE3_ALPHA_EXT 0x858B +#define GL_SOURCE4_ALPHA_EXT 0x858C +#define GL_SOURCE5_ALPHA_EXT 0x858D +#define GL_SOURCE6_ALPHA_EXT 0x858E +#define GL_SOURCE7_ALPHA_EXT 0x858F +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND3_RGB_EXT 0x8593 +#define GL_OPERAND4_RGB_EXT 0x8594 +#define GL_OPERAND5_RGB_EXT 0x8595 +#define GL_OPERAND6_RGB_EXT 0x8596 +#define GL_OPERAND7_RGB_EXT 0x8597 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#define GL_OPERAND3_ALPHA_EXT 0x859B +#define GL_OPERAND4_ALPHA_EXT 0x859C +#define GL_OPERAND5_ALPHA_EXT 0x859D +#define GL_OPERAND6_ALPHA_EXT 0x859E +#define GL_OPERAND7_ALPHA_EXT 0x859F +#endif -#endif /* GL_SGIS_texture4D */ +#ifndef GL_APPLE_specular_vector +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#endif +#ifndef GL_APPLE_transform_hint +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#endif +#ifndef GL_SGIX_fog_scale +#define GL_FOG_SCALE_SGIX 0x81FC +#define GL_FOG_SCALE_VALUE_SGIX 0x81FD +#endif -/* - * 17. GL_SGI_texture_color_table - */ -#ifndef GL_SGI_texture_color_table -#define GL_SGI_texture_color_table 1 +#ifndef GL_SUNX_constant_data +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +#endif -#define GL_COLOR_TABLE_SGI_80BC 0x80BC /* DUPLICATE! */ -#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#ifndef GL_SUN_global_alpha +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +#endif -#endif /* GL_SGI_texture_color_table */ +#ifndef GL_SUN_triangle_list +#define GL_RESTART_SUN 0x01 +#define GL_REPLACE_MIDDLE_SUN 0x02 +#define GL_REPLACE_OLDEST_SUN 0x03 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB +#endif +#ifndef GL_SUN_vertex +#endif +#ifndef GL_EXT_blend_func_separate +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +#endif -/* - * 18. GL_EXT_cmyka - */ -#ifndef GL_EXT_cmyka -#define GL_EXT_cmyka 1 +#ifndef GL_INGR_color_clamp +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#endif -#define GL_CMYK_EXT 0x800C -#define GL_CMYKA_EXT 0x800D -#define GL_PACK_CMYK_HINT_EXT 0x800E -#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#ifndef GL_INGR_interlace_read +#define GL_INTERLACE_READ_INGR 0x8568 +#endif -#endif /* GL_EXT_cmyka */ +#ifndef GL_EXT_stencil_wrap +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#endif +#ifndef GL_EXT_422_pixels +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#endif +#ifndef GL_NV_texgen_reflection +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#endif -/* - * 19. unknown - */ +#ifndef GL_EXT_texture_cube_map +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C +#endif +#ifndef GL_SUN_convolution_border_modes +#define GL_WRAP_BORDER_SUN 0x81D4 +#endif +#ifndef GL_EXT_texture_env_add +#endif -/* - * 20. GL_EXT_texture_object - */ -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 +#ifndef GL_EXT_texture_lod_bias +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif -GLAPI void APIENTRY glGenTexturesEXT(GLsizei n, GLuint *textures); -GLAPI void APIENTRY glDeleteTexturesEXT(GLsizei n, const GLuint *textures); -GLAPI void APIENTRY glBindTextureEXT(GLenum target, GLuint texture); -GLAPI void APIENTRY glPrioritizeTexturesEXT(GLsizei n, const GLuint *textures, const GLclampf *priorities); -GLAPI GLboolean APIENTRY glAreTexturesResidentEXT(GLsizei n, const GLuint *textures, GLboolean *residences); -GLAPI GLboolean APIENTRY glIsTextureEXT(GLuint texture); +#ifndef GL_EXT_vertex_weighting +#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX +#define GL_MODELVIEW_MATRIX1_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT GL_MODELVIEW +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 +#endif -typedef void (APIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); -typedef void (APIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); -typedef void (APIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); -typedef void (APIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); -typedef GLboolean (APIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); -typedef GLboolean (APIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); +#ifndef GL_NV_light_max_exponent +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#endif -#endif /* GL_EXT_texture_object */ +#ifndef GL_NV_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 +#endif +#ifndef GL_NV_register_combiners +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +/* reuse GL_TEXTURE0_ARB */ +/* reuse GL_TEXTURE1_ARB */ +/* reuse GL_ZERO */ +/* reuse GL_NONE */ +/* reuse GL_FOG */ +#endif +#ifndef GL_NV_fog_distance +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +/* reuse GL_EYE_PLANE */ +#endif -/* - * 21. GL_SGIS_detail_texture - */ -#ifndef GL_SGIS_detail_texture -#define GL_SGIS_detail_texture +#ifndef GL_NV_texgen_emboss +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#endif -#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 -#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 -#define GL_LINEAR_DETAIL_SGIS 0x8097 -#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 -#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 -#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A -#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#ifndef GL_NV_blend_square +#endif -GLAPI void APIENTRY glDetailTexFuncSGIS(GLenum target, GLsizei n, const GLfloat *points); -GLAPI void APIENTRY glGetDetailTexFuncSGIS(GLenum target, GLfloat *points); +#ifndef GL_NV_texture_env_combine4 +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B +#endif -typedef void (APIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#ifndef GL_MESA_resize_buffers +#endif -#endif /* GL_SGIS_detail_texture */ +#ifndef GL_MESA_window_pos +#endif +#ifndef GL_EXT_texture_compression_s3tc +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif +#ifndef GL_IBM_cull_vertex +#define GL_CULL_VERTEX_IBM 103050 +#endif -/* - * 22. GL_SGIS_sharpen_texture - */ -#ifndef GL_SGIS_sharpen_texture -#define GL_SGIS_sharpen_texture 1 +#ifndef GL_IBM_multimode_draw_arrays +#endif -#define GL_LINEAR_SHARPEN_SGIS 0x80AD -#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE -#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF -#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +#ifndef GL_IBM_vertex_array_lists +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 +#endif -GLAPI void APIENTRY glGetSharpenTexFuncSGIS(GLenum target, GLfloat *points); -GLAPI void APIENTRY glSharpenTexFuncSGIS(GLenum target, GLsizei n, const GLfloat *points); +#ifndef GL_SGIX_subsample +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#endif -typedef void (APIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -typedef void (APIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +#ifndef GL_SGIX_ycrcb_subsample +#endif -#endif /* GL_SGIS_sharpen_texture */ +#ifndef GL_SGIX_ycrcba +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 +#endif +#ifndef GL_SGI_depth_pass_instrument +#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 +#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 +#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 +#endif +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif -/* - * 23. GL_EXT_packed_pixels - */ -#ifndef GL_EXT_packed_pixels -#define GL_EXT_packed_pixels 1 +#ifndef GL_3DFX_multisample +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 +#endif -#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#ifndef GL_3DFX_tbuffer +#endif -#endif /* GL_EXT_packed_pixels */ +#ifndef GL_EXT_multisample +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#endif +#ifndef GL_SGIX_vertex_preclip +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#endif +#ifndef GL_SGIX_convolution_accuracy +#define GL_CONVOLUTION_HINT_SGIX 0x8316 +#endif -/* - * 24. GL_SGIS_texture_lod - */ +#ifndef GL_SGIX_resample +#define GL_PACK_RESAMPLE_SGIX 0x842C +#define GL_UNPACK_RESAMPLE_SGIX 0x842D +#define GL_RESAMPLE_REPLICATE_SGIX 0x842E +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#endif -#ifndef GL_SGIS_texture_lod -#define GL_SGIS_texture_lod 1 +#ifndef GL_SGIS_point_line_texgen +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 +#endif -#define GL_TEXTURE_MIN_LOD_SGIS 0x813A -#define GL_TEXTURE_MAX_LOD_SGIS 0x813B -#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C -#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#ifndef GL_SGIS_texture_color_mask +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +#endif -#endif /* GL_SGIS_texture_lod */ +/*************************************************************/ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); +extern void APIENTRY glBlendEquation (GLenum); +extern void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +extern void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +extern void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); +extern void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); +extern void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); +extern void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); +extern void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); +extern void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); +extern void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +extern void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); +extern void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +extern void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +extern void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); +extern void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); +extern void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); +extern void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); +extern void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); +extern void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +extern void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); +extern void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); +extern void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); +extern void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +extern void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +extern void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +extern void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); +extern void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); +extern void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +extern void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); +extern void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); +extern void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); +extern void APIENTRY glMinmax (GLenum, GLenum, GLboolean); +extern void APIENTRY glResetHistogram (GLenum); +extern void APIENTRY glResetMinmax (GLenum); +extern void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +extern void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +extern void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (APIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glActiveTextureARB (GLenum); +extern void APIENTRY glClientActiveTextureARB (GLenum); +extern void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); +extern void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); +extern void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); +extern void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); +extern void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); +extern void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); +extern void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); +extern void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); +extern void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); +extern void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); +extern void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); +extern void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); +extern void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); +extern void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); +extern void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); +extern void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); +extern void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); +extern void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); +extern void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); +extern void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); +extern void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); +extern void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); +extern void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); +extern void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +extern void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); +extern void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); +extern void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); +extern void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); +extern void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); +extern void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +#endif -/* - * 25. GL_SGIS_multisample - */ +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); +extern void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); +extern void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); +extern void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +#endif -#ifndef GL_SGIS_multisample -#define GL_SGIS_multisample 1 +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); +extern void APIENTRY glSamplePassARB (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRY * PFNGLSAMPLEPASSARBPROC) (GLenum pass); +#endif -#define GL_MULTISAMPLE_SGIS 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F -#define GL_SAMPLE_MASK_SGIS 0x80A0 -#define GL_MULTISAMPLE_BIT_EXT 0x20000000 -#define GL_1PASS_SGIS 0x80A1 -#define GL_2PASS_0_SGIS 0x80A2 -#define GL_2PASS_1_SGIS 0x80A3 -#define GL_4PASS_0_SGIS 0x80A4 -#define GL_4PASS_1_SGIS 0x80A5 -#define GL_4PASS_2_SGIS 0x80A6 -#define GL_4PASS_3_SGIS 0x80A7 -#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 -#define GL_SAMPLES_SGIS 0x80A9 -#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA -#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB -#define GL_SAMPLE_PATTERN_SGIS 0x80AC - -GLAPI void APIENTRY glSampleMaskSGIS(GLclampf value, GLboolean invert); -GLAPI void APIENTRY glSamplePatternSGIS(GLenum pattern); +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +#endif -typedef void (APIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +#endif -#endif /* GL_SGIS_multisample */ +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +extern void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +extern void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +extern void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +extern void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +extern void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +extern void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, void *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img); +#endif +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 +#endif +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +#endif -/* - * 26. unknown - */ +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +#endif +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +#endif +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +#endif -/* - * 27. GL_EXT_rescale_normal - */ -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 +#ifndef GL_EXT_subtexture +/*#define GL_EXT_subtexture 1*/ +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +#endif -#define GL_RESCALE_NORMAL_EXT 0x803A +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); +extern void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif -#endif /* GL_EXT_rescale_normal */ +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); +extern void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#endif +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); +extern void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); +extern void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); +extern void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +extern void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +extern void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); +extern void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); +extern void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +extern void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); +extern void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); +extern void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); +extern void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); +extern void APIENTRY glResetHistogramEXT (GLenum); +extern void APIENTRY glResetMinmaxEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); +#endif -/* - * 28. GLX_EXT_visual_info - */ +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +extern void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +extern void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); +extern void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); +extern void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); +extern void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); +extern void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); +extern void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +extern void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); +extern void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); +extern void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); +extern void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +extern void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +#endif +#ifndef GL_EXT_color_matrix +#define GL_EXT_color_matrix 1 +#endif + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +extern void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); +extern void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); +extern void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); +extern void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); +extern void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); +extern void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); +#endif +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glPixelTexGenSGIX (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); +#endif -/* - * 29. unknown - */ +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); +extern void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); +extern void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); +extern void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); +extern void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); +extern void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +extern void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); +#endif +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 +#endif +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 +#endif -/* - * 30. GL_EXT_vertex_array - */ -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +#ifdef GL_GLEXT_PROTOTYPES +extern GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); +extern void APIENTRY glBindTextureEXT (GLenum, GLuint); +extern void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); +extern void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); +extern GLboolean APIENTRY glIsTextureEXT (GLuint); +extern void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); +typedef void (APIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); +typedef void (APIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); +typedef GLboolean (APIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (APIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +extern void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +extern void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +#endif + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); +extern void APIENTRY glSamplePatternSGIS (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +#endif -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 - -GLAPI void APIENTRY glVertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr); -GLAPI void APIENTRY glNormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr); -GLAPI void APIENTRY glColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr); -GLAPI void APIENTRY glIndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr); -GLAPI void APIENTRY glTexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr); -GLAPI void APIENTRY glEdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *ptr); -GLAPI void APIENTRY glGetPointervEXT(GLenum pname, void **params); -GLAPI void APIENTRY glArrayElementEXT(GLint i); -GLAPI void APIENTRY glDrawArraysEXT(GLenum mode, GLint first, GLsizei count); +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +#endif +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glArrayElementEXT (GLint); +extern void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +extern void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); +extern void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); +extern void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); +extern void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +extern void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +extern void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +extern void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); typedef void (APIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); typedef void (APIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); @@ -762,2722 +1914,1007 @@ typedef void (APIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, typedef void (APIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); typedef void (APIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); typedef void (APIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +#endif -#endif /* GL_EXT_vertex_array */ - - - -/* - * 31. GL_EXT_misc_attribute - */ #ifndef GL_EXT_misc_attribute #define GL_EXT_misc_attribute 1 +#endif -#define GL_MISC_BIT_EXT ? - -#endif /* GL_EXT_misc_attribute */ - - - -/* - * 32. GL_SGIS_generate_mipmap - */ #ifndef GL_SGIS_generate_mipmap #define GL_SGIS_generate_mipmap 1 +#endif -#define GL_GENERATE_MIPMAP_SGIS 0x8191 -#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 - -#endif /* GL_SGIS_generate_mipmap */ - - - -/* - * 33. GL_SGIX_clipmap - */ #ifndef GL_SGIX_clipmap #define GL_SGIX_clipmap 1 +#endif -#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 -#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 -#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 -#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 -#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 -#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 -#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 -#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 -#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 - -#endif /* GL_SGIX_clipmap */ - - - -/* - * 34. GL_SGIX_shadow - */ #ifndef GL_SGIX_shadow #define GL_SGIX_shadow 1 +#endif -#define GL_TEXTURE_COMPARE_SGIX 0x819A -#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B -#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C -#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D - -#endif /* GL_SGIX_shadow */ - - - -/* - * 35. GL_SGIS_texture_edge_clamp - */ #ifndef GL_SGIS_texture_edge_clamp #define GL_SGIS_texture_edge_clamp 1 +#endif -#define GL_CLAMP_TO_EDGE_SGIS 0x812F - -#endif /* GL_SGIS_texture_edge_clamp */ - - - -/* - * 36. GL_SGIS_texture_border_clamp - */ #ifndef GL_SGIS_texture_border_clamp #define GL_SGIS_texture_border_clamp 1 +#endif -#define GL_CLAMP_TO_BORDER_SGIS 0x812D - -#endif /* GL_SGIS_texture_border_clamp */ - - - -/* - * 37. GL_EXT_blend_minmax - */ #ifndef GL_EXT_blend_minmax #define GL_EXT_blend_minmax 1 - -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_BLEND_EQUATION_EXT 0x8009 - -GLAPI void APIENTRY glBlendEquationEXT(GLenum mode); - +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glBlendEquationEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +#endif -#endif /* GL_EXT_blend_minmax */ - - - -/* - * 38. GL_EXT_blend_subtract (requires GL_EXT_blend_max) - */ #ifndef GL_EXT_blend_subtract #define GL_EXT_blend_subtract 1 +#endif -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B - -#endif /* GL_EXT_blend_subtract */ - - - -/* - * 39. GL_EXT_blend_logic_op - */ #ifndef GL_EXT_blend_logic_op #define GL_EXT_blend_logic_op 1 +#endif -/* No new tokens or functions */ - -#endif /* GL_EXT_blend_logic_op */ - - - -/* - * 40. GLX_SGI_swap_control - * 41. GLX_SGI_video_sync - * 42. GLX_SGI_make_current_read - * 43. GLX_SGIX_video_source - * 44. GLX_EXT_visual_rating - */ - - - -/* - * 45. GL_SGIX_interlace - */ #ifndef GL_SGIX_interlace #define GL_SGIX_interlace 1 +#endif -#define GL_INTERLACE_SGIX 0x8094 - -#endif /* GL_SGIX_interlace */ - - - -/* - * 46. unknown - * 47. GLX_EXT_import_context - * 49. GLX_SGIX_fbconfig - * 50. GLX_SGIX_pbuffer - */ - - - -/* - * 51. GL_SGIS_texture_select - */ -#ifndef GL_SGIS_texture_select -#define GL_SGIS_texture_select 1 - -#define GL_DUAL_ALPHA4_SGIS 0x8110 -#define GL_DUAL_ALPHA8_SGIS 0x8111 -#define GL_DUAL_ALPHA12_SGIS 0x8112 -#define GL_DUAL_ALPHA16_SGIS 0x8113 -#define GL_DUAL_LUMINANCE4_SGIS 0x8114 -#define GL_DUAL_LUMINANCE8_SGIS 0x8115 -#define GL_DUAL_LUMINANCE12_SGIS 0x8116 -#define GL_DUAL_LUMINANCE16_SGIS 0x8117 -#define GL_DUAL_INTENSITY4_SGIS 0x8118 -#define GL_DUAL_INTENSITY8_SGIS 0x8119 -#define GL_DUAL_INTENSITY12_SGIS 0x811A -#define GL_DUAL_INTENSITY16_SGIS 0x811B -#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C -#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D -#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 -#define GL_QUAD_ALPHA4_SGIS 0x811E -#define GL_QUAD_ALPHA8_SGIS 0x811F -#define GL_QUAD_LUMINANCE4_SGIS0 x8120 -#define GL_QUAD_LUMINANCE8_SGIS 0x8121 -#define GL_QUAD_INTENSITY4_SGIS 0x8122 -#define GL_QUAD_INTENSITY8_SGIS 0x8123 -#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 - -#endif /* GL_SGIS_texture_select */ - +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 +#endif +#ifndef GL_SGIX_texture_select +#define GL_SGIX_texture_select 1 +#endif -/* - * 52. GL_SGIX_sprite - */ #ifndef GL_SGIX_sprite #define GL_SGIX_sprite 1 - -#define GL_SPRITE_SGIX 0x8148 -#define GL_SPRITE_MODE_SGIX 0x8149 -#define GL_SPRITE_AXIS_SGIX 0x814A -#define GL_SPRITE_TRANSLATION_SGIX 0x814B -#define GL_SPRITE_AXIAL_SGIX 0x814C -#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D -#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E - -GLAPI void APIENTRY glSpriteParameterfSGIX(GLenum pname, GLfloat param); -GLAPI void APIENTRY glSpriteParameterfvSGIX(GLenum pname, const GLfloat *param); -GLAPI void APIENTRY glSpriteParameteriSGIX(GLenum pname, GLint param); -GLAPI void APIENTRY glSpriteParameterivSGIX(GLenum pname, const GLint *param); - +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); +extern void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); +extern void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); +extern void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *param); +typedef void (APIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); typedef void (APIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *param); - -#endif /* GL_SGIX_sprite */ - - - -/* - * 53. unknown - */ - +typedef void (APIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); +#endif +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 +#endif -/* - * 54. GL_EXT_point_parameters - */ #ifndef GL_EXT_point_parameters #define GL_EXT_point_parameters 1 - -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 - -GLAPI void APIENTRY glPointParameterfEXT(GLenum pname, GLfloat param); -GLAPI void APIENTRY glPointParameterfvEXT(GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glPointParameterfSGIS(GLenum pname, GLfloat param); -GLAPI void APIENTRY glPointParameterfvSGIS(GLenum pname, const GLfloat *params); - +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glPointParameterfEXT (GLenum, GLfloat); +extern void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); +extern void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); +extern void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); typedef void (APIENTRY * PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); typedef void (APIENTRY * PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +#endif -#endif /* GL_EXT_point_parameters */ - - - -/* - * 55. GL_SGIX_instruments - */ #ifndef GL_SGIX_instruments #define GL_SGIX_instruments 1 - -#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 -#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 - -GLAPI GLint APIENTRY glGetInstrumentsSGIX(void); -GLAPI void APIENTRY glInstrumentsBufferSGIX(GLsizei size, GLint *buf); -GLAPI GLint APIENTRY glPollInstrumentsSGIX(GLint *markerp); -GLAPI void APIENTRY glReadInstrumentsSGIX(GLint marker); -GLAPI void APIENTRY glStartInstrumentsSGIX(void); -GLAPI void APIENTRY glStopInstrumentsSGIX(GLint marker); - +#ifdef GL_GLEXT_PROTOTYPES +extern GLint APIENTRY glGetInstrumentsSGIX (void); +extern void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); +extern GLint APIENTRY glPollInstrumentsSGIX (GLint *); +extern void APIENTRY glReadInstrumentsSGIX (GLint); +extern void APIENTRY glStartInstrumentsSGIX (void); +extern void APIENTRY glStopInstrumentsSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ typedef GLint (APIENTRY * PFNGLGETINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRY * PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buf); -typedef GLint (APIENTRY * PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *markerp); +typedef void (APIENTRY * PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); +typedef GLint (APIENTRY * PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); typedef void (APIENTRY * PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); typedef void (APIENTRY * PFNGLSTARTINSTRUMENTSSGIXPROC) (void); typedef void (APIENTRY * PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); +#endif -#endif /* GL_SGIX_instruments */ - - - -/* - * 56. GL_SGIX_texture_scale_bias - */ #ifndef GL_SGIX_texture_scale_bias #define GL_SGIX_texture_scale_bias 1 +#endif -#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 -#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A -#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B -#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C - -#endif /* GL_SGIX_texture_scale_bias */ - - - -/* - * 57. GL_SGIX_framezoom - */ #ifndef GL_SGIX_framezoom #define GL_SGIX_framezoom 1 - -#define GL_FRAMEZOOM_SGIX 0x818B -#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C -#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D - -GLAPI void APIENTRY glFrameZoomSGIX(GLint factor); - +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glFrameZoomSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); +#endif -#endif /* GL_SGIX_framezoom */ - - - -/* - * 58. GL_SGIX_tag_sample_buffer - */ #ifndef GL_SGIX_tag_sample_buffer #define GL_SGIX_tag_sample_buffer 1 - -GLAPI void APIENTRY glTagSampleBufferSGIX(void); - +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glTagSampleBufferSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); +#endif -#endif /* GL_SGIX_tag_sample_buffer */ - - - -/* - * 59. unknown - */ - - - -/* - * 60. GL_SGIX_reference_plane - */ #ifndef GL_SGIX_reference_plane #define GL_SGIX_reference_plane 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glReferencePlaneSGIX (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); +#endif -#define GL_REFERENCE_PLANE_SGIX 0x817D -#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E - -GLAPI void APIENTRY glReferencePlaneSGIX(const GLdouble *plane); - -typedef void (APIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *plane); - -#endif /* GL_SGIX_reference_plane */ - - - -/* - * 61. GL_SGIX_flush_raster - */ #ifndef GL_SGIX_flush_raster #define GL_SGIX_flush_raster 1 - -GLAPI void APIENTRY glFlushRasterSGIX(void); - +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glFlushRasterSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); +#endif -#endif /* GL_SGIX_flush_raster */ - - - -/* - * 62. GLX_SGI_cushion - */ - - - -/* - * 63. GL_SGIX_depth_texture - */ #ifndef GL_SGIX_depth_texture #define GL_SGIX_depth_texture 1 +#endif -#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 -#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 -#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 - -#endif /* GL_SGIX_depth_texture */ - - - -/* - * 64. GL_SGIS_fog_function - */ #ifndef GL_SGIS_fog_function #define GL_SGIS_fog_function 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); +extern void APIENTRY glGetFogFuncSGIS (const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); +typedef void (APIENTRY * PFNGLGETFOGFUNCSGISPROC) (const GLfloat *points); +#endif -#define GL_FOG_FUNC_SGIS 0x812A -#define GL_FOG_FUNC_POINTS_SGIS 0x812B -#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C - -#endif /* GL_SGIS_fog_function */ - - - -/* - * 65. GL_SGIX_fog_offset - */ #ifndef GL_SGIX_fog_offset #define GL_SGIX_fog_offset 1 +#endif -#define GL_FOG_OFFSET_SGIX 0x8198 -#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); +extern void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); +extern void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); +extern void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); +extern void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); +extern void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif -#endif /* GL_SGIX_fog_offset */ - - - -/* - * 66. GL_HP_image_transform - */ -#ifndef GL_HP_image_transform -#define GL_HP_image_transform 1 - -#define GL_IMAGE_SCALE_X_HP 0x8155 -#define GL_IMAGE_SCALE_Y_HP 0x8156 -#define GL_IMAGE_TRANSLATE_X_HP 0x8157 -#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 -#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 -#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A -#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B -#define GL_IMAGE_MAG_FILTER_HP 0x815C -#define GL_IMAGE_MIN_FILTER_HP 0x815D -#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E -#define GL_CUBIC_HP 0x815F -#define GL_AVERAGE_HP 0x8160 -#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 -#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 -#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 - -GLAPI void APIENTRY glImageTransformParameteriHP(GLenum target, GLenum pname, const GLint param); -GLAPI void APIENTRY glImageTransformParameterfHP(GLenum target, GLenum pname, const GLfloat param); -GLAPI void APIENTRY glImageTransformParameterivHP(GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glImageTransformParameterfvHP(GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY GetImageTransformParameterivHP(GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glGetImageTransformParameterfvHP(GLenum target, GLenum pname,const GLfloat* params); - -typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); -typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); -typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname,const GLfloat* params); - -#endif /* GL_HP_image_transform */ - - - -/* - * 67. GL_HP_convolution_border_modes - */ #ifndef GL_HP_convolution_border_modes #define GL_HP_convolution_border_modes 1 +#endif -#define GL_IGNORE_BORDER_HP 0x8150 -#define GL_CONSTANT_BORDER_HP 0x8151 -#define GL_REPLICATE_BORDER_HP 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 - -#endif /* GL_HP_convolution_border_modes */ - - - -/* - * 68. unknown - */ - - - -/* - * 69. GL_SGIX_texture_add_env - */ #ifndef GL_SGIX_texture_add_env #define GL_SGIX_texture_add_env 1 +#endif -#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE - -#endif /* GL_SGIX_texture_add_env */ - - - -/* - * 70. unknown - * 71. unknown - * 72. unknown - * 73. unknown - */ - - - -/* - * 74. GL_EXT_color_subtable - */ #ifndef GL_EXT_color_subtable #define GL_EXT_color_subtable 1 - -GLAPI void APIENTRY glColorSubTableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glCopyColorSubTableEXT(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); - -typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +extern void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#endif -#endif /* GL_EXT_color_subtable */ - - - -/* - * 75. GLU_EXT_object_space_tess - */ - - - -/* - * 76. GL_PGI_vertex_hints - */ #ifndef GL_PGI_vertex_hints #define GL_PGI_vertex_hints 1 +#endif -#define GL_VERTEX_DATA_HINT_PGI 107050 -#define GL_VERTEX_CONSISTENT_HINT_PGI 107051 -#define GL_VATERIAL_SIDE_HINT_PGI 107052 -#define GL_VAX_VERTEX_HINT_PGI 107053 -#define GL_VOLOR3_BIT_PGI 0x00010000 -#define GL_VOLOR4_BIT_PGI 0x00020000 -#define GL_VDGEFLAG_BIT_PGI 0x00040000 -#define GL_VNDEX_BIT_PGI 0x00080000 -#define GL_VAT_AMBIENT_BIT_PGI 0x00100000 -#define GL_VAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 -#define GL_VAT_DIFFUSE_BIT_PGI 0x00400000 -#define GL_VAT_EMISSION_BIT_PGI 0x00800000 -#define GL_VAT_COLOR_INDEXES_BIT_PGI 0x01000000 -#define GL_VAT_SHININESS_BIT_PGI 0x02000000 -#define GL_VAT_SPECULAR_BIT_PGI 0x04000000 -#define GL_VORMAL_BIT_PGI 0x08000000 -#define GL_VEXCOORD1_BIT_PGI 0x10000000 -#define GL_VEXCOORD2_BIT_PGI 0x20000000 -#define GL_VEXCOORD3_BIT_PGI 0x40000000 -#define GL_VEXCOORD4_BIT_PGI 0x80000000 -#define GL_VERTEX23_BIT_PGI 0x00000004 -#define GL_VERTEX4_BIT_PGI 0x00000008 - -#endif /* GL_PGI_vertex_hints */ - - - -/* - * 77. GL_PGI_misc_hints - */ #ifndef GL_PGI_misc_hints #define GL_PGI_misc_hints 1 - -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 -#define GL_STRICT_LIGHTING_HINT_PGI 107031 -#define GL_STRICT_SCISSOR_HINT_PGI 107032 -#define GL_FULL_STIPPLE_HINT_PGI 107033 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 -#define GL_CONSERVE_MEMORY_HINT_PGI 107005 -#define GL_RECLAIM_MEMORY_HINT_PGI 107006 -#define GL_ALWAYS_FAST_HINT_PGI 107020 -#define GL_ALWAYS_SOFT_HINT_PGI 107021 -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 -#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 -#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 -#define GL_CLIP_NEAR_HINT_PGI 107040 -#define GL_CLIP_FAR_HINT_PGI 107041 -#define GL_WIDE_LINE_HINT_PGI 107042 -#define GL_BACK_NORMALS_HINT_PGI 107043 -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 - -GLAPI void APIENTRY glHintPGI(GLenum target, GLint mode); - +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glHintPGI (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLHINTPGIPROC) (GLenum target, GLint mode); +#endif -#endif /* GL_PGI_misc_hints */ - - - -/* - * 78. GL_EXT_paletted_texture - */ #ifndef GL_EXT_paletted_texture #define GL_EXT_paletted_texture 1 - -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 -#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 - -GLAPI void APIENTRY glColorTableEXT(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -GLAPI void APIENTRY glColorSubTableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -GLAPI void APIENTRY glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid *table); -GLAPI void APIENTRY glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint *params); - -typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -#ifndef GL_EXT_color_subtable -typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -#endif -typedef void (APIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +extern void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); +extern void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); +extern void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif -#endif /* GL_EXT_paletted_texture */ - - - -/* - * 79. GL_EXT_clip_volume_hint - */ #ifndef GL_EXT_clip_volume_hint #define GL_EXT_clip_volume_hint 1 +#endif -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F - -#endif /* GL_EXT_clip_volume_hint */ - - - -/* - * 80. GL_SGIX_list_priority - */ #ifndef GL_SGIX_list_priority #define GL_SGIX_list_priority 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); +extern void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); +extern void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); +extern void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); +extern void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); +extern void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); +#endif -#define GL_LIST_PRIORITY_SGIX 0x8182 - -GLAPI void APIENTRY glGetListParameterfvSGIX(GLuint list, GLenum name, GLfloat *param); -GLAPI void APIENTRY glGetListParameterivSGIX(GLuint list, GLenum name, GLint *param); -GLAPI void APIENTRY glListParameterfSGIX(GLuint list, GLenum name, GLfloat param); -GLAPI void APIENTRY glListParameterfvSGIX(GLuint list, GLenum name, const GLfloat *param); -GLAPI void APIENTRY glListParameteriSGIX(GLuint list, GLenum name, GLint param); -GLAPI void APIENTRY glListParameterivSGIX(GLuint list, GLenum name, const GLint *param); - -typedef void (APIENTRY * PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum name, GLfloat *param); -typedef void (APIENTRY * PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum name, GLint *param); -typedef void (APIENTRY * PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum name, GLfloat param); -typedef void (APIENTRY * PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum name, const GLfloat *param); -typedef void (APIENTRY * PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum name, GLint param); -typedef void (APIENTRY * PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum name, const GLint *param); - -#endif /* GL_SGIX_list_priority */ - - - -/* - * 81. GL_SGIX_ir_instrument1 - */ #ifndef GL_SGIX_ir_instrument1 #define GL_SGIX_ir_instrument1 1 +#endif -#define GL_IR_INSTRUMENT1_SGIX 0x817F - -#endif /* GL_SGIX_ir_instrument1 */ - - - -/* - * 82. unknown - * 83. GLX_SGIX_video_resize - */ - - +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 +#endif -/* - * 84. GL_SGIX_texture_lod_bias - */ #ifndef GL_SGIX_texture_lod_bias #define GL_SGIX_texture_lod_bias 1 +#endif -#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E -#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F -#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 - -#endif /* GL_SGIX_texture_lod_bias */ - - - -/* - * 85. GLU_SGI_filter4_parameters - * 86. GLX_SGIX_dm_buffer - * 87. unknown - * 88. unknown - * 89. unknown - * 90. unknown - * 91. GLX_SGIX_swap_group - * 92. GLX_SGIX_swap_barrier - */ - - +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 +#endif -/* - * 93. GL_EXT_index_texture - */ #ifndef GL_EXT_index_texture #define GL_EXT_index_texture 1 +#endif -/* No new tokens or functions */ - -#endif /* GL_EXT_index_texture */ - - - -/* - * 94. GL_EXT_index_material - */ #ifndef GL_EXT_index_material #define GL_EXT_index_material 1 - -#define GL_INDEX_MATERIAL_EXT 0x81B8 -#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 -#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA - -GLAPI void APIENTRY glIndexMaterialEXT(GLenum face, GLenum mode); - +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glIndexMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif -#endif /* GL_EXT_index_material */ - - - -/* - * 95. GL_EXT_index_func - */ #ifndef GL_EXT_index_func #define GL_EXT_index_func 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glIndexFuncEXT (GLenum, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); +#endif -#define GL_INDEX_TEST_EXT 0x81B5 -#define GL_INDEX_TEST_FUNC_EXT 0x81B6 -#define GL_INDEX_TEST_REF_EXT 0x81B7 - -GLAPI void APIENTRY glIndexFuncEXT(GLenum func, GLfloat ref); - -typedef void (APIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); - -#endif /* GL_EXT_index_func */ - - - -/* - * 96. GL_EXT_index_array_formats - */ -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 - -#define GL_IUI_V2F_EXT 0x81AD -#define GL_IUI_V3F_EXT 0x81AE -#define GL_IUI_N3F_V2F_EXT 0x81AF -#define GL_IUI_N3F_V3F_EXT 0x81B0 -#define GL_T2F_IUI_V2F_EXT 0x81B1 -#define GL_T2F_IUI_V3F_EXT 0x81B2 -#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 -#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 - -#endif /* GL_EXT_index_array_formats */ - - - -/* - * 97. GL_EXT_compiled_vertex_array - */ -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 - -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 - -GLAPI void APIENTRY glLockArraysEXT(GLint first, GLsizei count); -GLAPI void APIENTRY glUnlockArraysEXT(void); - -typedef void (APIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); -typedef void (APIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); - -#endif /* GL_EXT_compiled_vertex_array */ - - - -/* - * 98. GL_EXT_cull_vertex - */ -#ifndef GL_EXT_cull_vertex -#define GL_EXT_cull_vertex 1 - -#define GL_CULL_VERTEX_EXT 0x81AA -#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB -#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC - -GLAPI void APIENTRY glCullParameterdvEXT(GLenum pname, const GLdouble *params); -GLAPI void APIENTRY glCullParameterfvEXT(GLenum pname, const GLfloat *params); - -typedef void (APIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); -typedef void (APIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); - -#endif /* GL_EXT_cull_vertex */ - - - -/* - * 99. unknown - * 100. GLU_EXT_nurbs_tessellator - */ - - - -/* - * 101. GL_SGIX_ycrcb - */ -#ifndef GL_SGIX_ycrcb -#define GL_SGIX_ycrcb 1 - -#define GL_YCRCB_422_SGIX 0x81BB -#define GL_YCRCB_444_SGIX 0x81BC - -#endif /* GL_SGIX_ycrcb */ - - - -/* - * 102. GL_SGIX_fragment_lighting - */ -#ifndef GL_SGIX_fragment_lighting -#define GL_SGIX_fragment_lighting 1 - -GLAPI void APIENTRY glFragmentColorMaterialSGIX(GLenum face, GLenum mode); -GLAPI void APIENTRY glFragmentLightfSGIX(GLenum light, GLenum pname, GLfloat param); -GLAPI void APIENTRY glFragmentLightfvSGIX(GLenum light, GLenum pname, const GLfloat * params); -GLAPI void APIENTRY glFragmentLightiSGIX(GLenum light, GLenum pname, GLint param); -GLAPI void APIENTRY glFragmentLightivSGIX(GLenum light, GLenum pname, const GLint * params); -GLAPI void APIENTRY glFragmentLightModelfSGIX(GLenum pname, GLfloat param); -GLAPI void APIENTRY glFragmentLightModelfvSGIX(GLenum pname, const GLfloat * params); -GLAPI void APIENTRY glFragmentLightModeliSGIX(GLenum pname, GLint param); -GLAPI void APIENTRY glFragmentLightModelivSGIX(GLenum pname, const GLint * params); -GLAPI void APIENTRY glFragmentMaterialfSGIX(GLenum face, GLenum pname, GLfloat param); -GLAPI void APIENTRY glFragmentMaterialfvSGIX(GLenum face, GLenum pname, const GLfloat * params); -GLAPI void APIENTRY glFragmentMaterialiSGIX(GLenum face, GLenum pname, GLint param); -GLAPI void APIENTRY glFragmentMaterialivSGIX(GLenum face, GLenum pname, const GLint * params); -GLAPI void APIENTRY glGetFragmentLightfvSGIX(GLenum light, GLenum pname, GLfloat * params); -GLAPI void APIENTRY glGetFragmentLightivSGIX(GLenum light, GLenum pname, GLint * params); -GLAPI void APIENTRY glGetFragmentMaterialfvSGIX(GLenum face, GLenum pname, GLfloat * params); -GLAPI void APIENTRY glGetFragmentMaterialivSGIX(GLenum face, GLenum pname, GLint * params); -GLAPI void APIENTRY glLightEnviSGIX(GLenum pname, GLint param); - -typedef void (APIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat * params); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint * params); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat * params); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint * params); -typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat * params); -typedef void (APIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint * params); -typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat * params); -typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint * params); -typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat * params); -typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint * params); -typedef void (APIENTRY * PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); - -#endif /* GL_SGIX_fragment_lighting */ - - - -/* - * 103. unknown - * 104. unknown - * 105. unknown - * 106. unknown - * 107. unknown - * 108. unknown - * 109. unknown - */ - - - -/* - * 110. GL_IBM_rasterpos_clip - */ -#ifndef GL_IBM_rasterpos_clip -#define GL_IBM_rasterpos_clip 1 - -#endif /* GL_IBM_rasterpos_clip */ - - - -/* - * 111. GL_HP_texture_lighting - */ -#ifndef GL_HP_texture_lighting -#define GL_HP_texture_lighting 1 - -#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 -#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 -#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 - -#endif /* GL_HP_texture_lighting */ - - - -/* - * 112. GL_EXT_draw_range_elements - */ -#ifndef GL_EXT_draw_range_elements -#define GL_EXT_draw_range_elements 1 - -#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 -#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 - -GLAPI void APIENTRY glDrawRangeElementsEXT(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); - -typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); - -#endif /* GL_EXT_draw_range_elements */ - - - -/* - * 113. GL_WIN_phong_shading - */ -#ifndef GL_WIN_phong_shading -#define GL_WIN_phong_shading 1 - -#define GL_PHONG_WIN 0x80EA -#define GL_PHONG_HINT_WIN 0x80EB - -#endif /* GL_WIN_phong_shading */ - - - -/* - * 114. GL_WIN_specular_fog - */ -#ifndef GL_WIN_specular_fog -#define GL_WIN_specular_fog 1 - -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC - -#endif /* GL_WIN_specular_fog */ - - - -/* - * 115. unknown - * 116. unknown - */ - - - -/* - * 117. GL_EXT_light_texture - */ -#ifndef GL_EXT_light_texture -#define GL_EXT_light_texture 1 - -#define GL_FRAGMENT_MATERIAL_EXT 0x8349 -#define GL_FRAGMENT_NORMAL_EXT 0x834A - -#define GL_FRAGMENT_DEPTH_EXT_834B 0x834B /* DUPLICATE! */ -#define GL_FRAGMENT_COLOR_EXT 0x834C -#define GL_ATTENUATION_EXT 0x834D -#define GL_SHADOW_ATTENUATION_EXT 0x834E -#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F -#define GL_TEXTURE_LIGHT_EXT 0x8350 -#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 -#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 - -GLAPI void APIENTRY glApplyTextureEXT(GLenum mode); -GLAPI void APIENTRY glTextureLightEXT(GLenum pname); -GLAPI void APIENTRY glTextureMaterialEXT(GLenum face, GLenum mode); - -typedef void (APIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); -typedef void (APIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); -typedef void (APIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); - -#endif /* GL_EXT_light_texture */ - - - -/* - * 118. unknown - */ - - - -/* - * 119. GL_SGIX_blend_alpha_minmax - */ -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_SGIX_blend_alpha_minmax 1 - -#endif /* GL_SGIX_blend_alpha_minmax */ - - - -/* - * 120. GL_EXT_scene_marker - */ -#ifndef GL_EXT_scene_marker -#define GL_EXT_scene_marker 1 - -#endif /* GL_EXT_scene_marker */ - - - -/* - * 121. unknown - * 122. unknown - * 123. unknown - * 124. unknown - * 125. unknown - * 126. unknown - * 127. unknown - * 128. unknown - */ - - - -/* - * 129. GL_EXT_bgra - */ -#ifndef GL_EXT_bgra -#define GL_EXT_bgra 1 - -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 - -#endif /* GL_EXT_bgra */ - - - -/* - * 130. unknown - * 131. unknown - * 132. unknown - * 133. unknown - * 134. unknown - */ - - - -/* - * 135. GL_INTEL_texture_scissor - */ -#ifndef GL_INTEL_texture_scissor -#define GL_INTEL_texture_scissor 1 - -#define GL_TEXTURE_SCISSOR_INTEL ? -#define GL_TEXTURE_SCISSOR_S_INTEL ? -#define GL_TEXTURE_SCISSOR_T_INTEL ? -#define GL_TEXTURE_SCISSOR_R_INTEL ? - -GLAPI void APIENTRY glTexScissorINTEL(GLenum target, GLclampf tlow, GLclampf thigh); -GLAPI void APIENTRY glTexScissorFuncINTEL(GLenum target, GLenum lfunc, GLenum hfunc); - -typedef void (APIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh); -typedef void (APIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc); - -#endif /* GL_INTEL_texture_scissor */ - - - -/* - * 136. GL_INTEL_parallel_arrays - */ -#ifndef GL_INTEL_parallel_arrays -#define GL_INTEL_parallel_arrays 1 - -#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 - -GLAPI void APIENTRY glVertexPointervINTEL(GLint size, GLenum type, const void ** pointer); -GLAPI void APIENTRY glNormalPointervINTEL(GLenum type, const void** pointer); -GLAPI void APIENTRY glColorPointervINTEL(GLint size, GLenum type, const void** pointer); -GLAPI void APIENTRY glTexCoordPointervINTEL(GLint size, GLenum type, const void** pointer); - -typedef void (APIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void ** pointer); -typedef void (APIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer); -typedef void (APIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); -typedef void (APIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); - -#endif /* GL_INTEL_parallel_arrays */ - - - -/* - * 137. GL_HP_occlusion_test - */ -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 - -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 - -#endif /* GL_HP_occlusion_test */ - - - -/* - * 138. GL_EXT_pixel_transform - */ -#ifndef GL_EXT_pixel_transform -#define GL_EXT_pixel_transform 1 - -#define GL_PIXEL_MAG_FILTER_EXT 0x8331 -#define GL_PIXEL_MIN_FILTER_EXT 0x8332 -#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 -#define GL_CUBIC_EXT 0x8334 -#define GL_AVERAGE_EXT 0x8335 -#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 -#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 -#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 -#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 - -GLAPI void APIENTRY glPixelTransformParameteriEXT(GLenum target, GLenum pname, const GLint param); -GLAPI void APIENTRY glPixelTransformParameterfEXT(GLenum target, GLenum pname, const GLfloat param); -GLAPI void APIENTRY glPixelTransformParameterivEXT(GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glPixelTransformParameterfvEXT(GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetPixelTransformParameterivEXT(GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glGetPixelTransformParameterfvEXT(GLenum target, GLenum pname, const GLfloat *params); - -#endif /* GL_EXT_pixel_transform */ - - - -/* - * 139. GL_EXT_pixel_transform_color_table - */ -#ifndef GL_EXT_pixel_transform_color_table -#define GL_EXT_pixel_transform_color_table 1 - -#define GL_PIXEL_TRANSFORM_COLOR_TABLE_EXT ? -#define GL_PROXY_PIXEL_TRANSFORM_COLOR_TABLE_EXT ? - -#endif /* GL_EXT_pixel_transform_color_table */ - - - -/* - * 140. unknown - */ - - - -/* - * 141. GL_EXT_shared_texture_palette (req's GL_EXT_paletted_texture) - */ -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 - -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB - -#endif /* GL_EXT_shared_texture_palette */ - - - -/* - * 142. unknown - * 143. unknown - */ - - - -/* - * 144. GL_EXT_separate_specular_color - */ -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 - -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA - -#endif /* GL_EXT_separate_specular_color */ - - - -/* - * 145. GL_EXT_secondary_color - */ -#ifndef GL_EXT_secondary_color -#define GL_EXT_secondary_color 1 - -#define GL_COLOR_SUM_EXT 0x8458 -#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D -#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E - -GLAPI void APIENTRY glSecondaryColor3bEXT(GLbyte red, GLbyte green, GLbyte blue); -GLAPI void APIENTRY glSecondaryColor3dEXT(GLdouble red, GLdouble green, GLdouble blue); -GLAPI void APIENTRY glSecondaryColor3fEXT(GLfloat red, GLfloat green, GLfloat blue); -GLAPI void APIENTRY glSecondaryColor3iEXT(GLint red, GLint green, GLint blue); -GLAPI void APIENTRY glSecondaryColor3sEXT(GLshort red, GLshort green, GLshort blue); -GLAPI void APIENTRY glSecondaryColor3ubEXT(GLubyte red, GLubyte green, GLubyte blue); -GLAPI void APIENTRY glSecondaryColor3uiEXT(GLuint red, GLuint green, GLuint blue); -GLAPI void APIENTRY glSecondaryColor3usEXT(GLushort red, GLushort green, GLushort blue); -GLAPI void APIENTRY glSecondaryColor4bEXT(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); -GLAPI void APIENTRY glSecondaryColor4dEXT(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); -GLAPI void APIENTRY glSecondaryColor4fEXT(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLAPI void APIENTRY glSecondaryColor4iEXT(GLint red, GLint green, GLint blue, GLint alpha); -GLAPI void APIENTRY glSecondaryColor4sEXT(GLshort red, GLshort green, GLshort blue, GLshort alpha); -GLAPI void APIENTRY glSecondaryColor4ubEXT(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); -GLAPI void APIENTRY glSecondaryColor4uiEXT(GLuint red, GLuint green, GLuint blue, GLuint alpha); -GLAPI void APIENTRY glSecondaryColor4usEXT(GLushort red, GLushort green, GLushort blue, GLushort alpha); -GLAPI void APIENTRY glSecondaryColor3bvEXT(const GLbyte *v); -GLAPI void APIENTRY glSecondaryColor3dvEXT(const GLdouble *v); -GLAPI void APIENTRY glSecondaryColor3fvEXT(const GLfloat *v); -GLAPI void APIENTRY glSecondaryColor3ivEXT(const GLint *v); -GLAPI void APIENTRY glSecondaryColor3svEXT(const GLshort *v); -GLAPI void APIENTRY glSecondaryColor3ubvEXT(const GLubyte *v); -GLAPI void APIENTRY glSecondaryColor3uivEXT(const GLuint *v); -GLAPI void APIENTRY glSecondaryColor3usvEXT(const GLushort *v); -GLAPI void APIENTRY glSecondaryColor4bvEXT(const GLbyte *v); -GLAPI void APIENTRY glSecondaryColor4dvEXT(const GLdouble *v); -GLAPI void APIENTRY glSecondaryColor4fvEXT(const GLfloat *v); -GLAPI void APIENTRY glSecondaryColor4ivEXT(const GLint *v); -GLAPI void APIENTRY glSecondaryColor4svEXT(const GLshort *v); -GLAPI void APIENTRY glSecondaryColor4ubvEXT(const GLubyte *v); -GLAPI void APIENTRY glSecondaryColor4uivEXT(const GLuint *v); -GLAPI void APIENTRY glSecondaryColor4usvEXT(const GLushort *v); -GLAPI void APIENTRY glSecondaryColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLvoid *pointer); - -#endif /* GL_EXT_secondary_color */ - - - -/* - * 146. GL_EXT_texture_env - */ -#ifndef GL_EXT_texture_env -#define GL_EXT_texture_env 1 - -#define GL_TEXTURE_ENV0_EXT 0x? -#define GL_TEXTURE_ENV1_EXT (GL_TEXTURE_ENV0_EXT+1) -#define GL_TEXTURE_ENV2_EXT (GL_TEXTURE_ENV0_EXT+2) -#define GL_TEXTURE_ENV3_EXT (GL_TEXTURE_ENV0_EXT+3) -#define GL_TEXTURE_ENV4_EXT (GL_TEXTURE_ENV0_EXT+4) -#define GL_TEXTURE_ENV5_EXT (GL_TEXTURE_ENV0_EXT+5) -#define GL_TEXTURE_ENV6_EXT (GL_TEXTURE_ENV0_EXT+6) -#define GL_TEXTURE_ENV7_EXT (GL_TEXTURE_ENV0_EXT+7) -#define GL_TEXTURE_ENV8_EXT (GL_TEXTURE_ENV0_EXT+8) -#define GL_TEXTURE_ENV9_EXT (GL_TEXTURE_ENV0_EXT+9) -#define GL_TEXTURE_ENV10_EXT (GL_TEXTURE_ENV0_EXT+10) -#define GL_TEXTURE_ENV11_EXT (GL_TEXTURE_ENV0_EXT+11) -#define GL_TEXTURE_ENV12_EXT (GL_TEXTURE_ENV0_EXT+12) -#define GL_TEXTURE_ENV13_EXT (GL_TEXTURE_ENV0_EXT+13) -#define GL_TEXTURE_ENV14_EXT (GL_TEXTURE_ENV0_EXT+14) -#define GL_TEXTURE_ENV15_EXT (GL_TEXTURE_ENV0_EXT+15) -#define GL_TEXTURE_ENV_MODE_ALPHA_EXT 0x? -#define GL_ENV_COPY_EXT 0x? -#define GL_ENV_REPLACE_EXT 0x? -#define GL_ENV_MODULATE_EXT 0x? -#define GL_ENV_ADD_EXT 0x? -#define GL_ENV_SUBTRACT_EXT 0x? -#define GL_ENV_REVERSE_SUBTRACT_EXT 0x? -#define GL_ENV_BLEND_EXT 0x? -#define GL_ENV_REVERSE_BLEND_EXT 0x? -#define GL_TEXTURE_ENV_SHIFT_EXT 0x? - -#endif /* GL_EXT_texture_env */ - - - -/* - * 147. GL_EXT_texture_perturb_normal - */ -#ifndef GL_EXT_texture_perturb_normal -#define GL_EXT_texture_perturb_normal 1 - -#define GL_PERTURB_EXT 0x85AE -#define GL_TEXTURE_NORMAL_EXT 0x85AF - -GLAPI void APIENTRY glTextureNormalEXT(GLenum mode); - -typedef void (APIENTRY * PFNGLTEXTURENORMALEXT) (GLenum mode); - -#endif /* GL_EXT_texture_perturb_normal */ - - - -/* - * 148. GL_EXT_multi_draw_arrays - */ -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 - -GLAPI void APIENTRY glMultiDrawArraysEXT(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); - -typedef void (APIENTRY * PFNGLMULTIDRAWARRAYSEXT) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); - -#endif /* GL_EXT_multi_draw_arrays */ - - - -/* - * 149. GL_EXT_fog_coord - */ -#ifndef GL_EXT_fog_coord -#define GL_EXT_fog_coord 1 - -#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 -#define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 /* DUPLICATE! */ -#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 -#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 - -GLAPI void APIENTRY glFogCoordfEXT(GLfloat coord); -GLAPI void APIENTRY glFogCoordfvEXT(const GLfloat * coord); -GLAPI void APIENTRY glFogCoorddEXT(GLdouble coord); -GLAPI void APIENTRY glFogCoorddvEXT(const GLdouble * coord); -GLAPI void APIENTRY glFogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid * pointer); - -typedef void (APIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); -typedef void (APIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat * coord); -typedef void (APIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); -typedef void (APIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble * coord); -typedef void (APIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid * pointer); - -#endif - - - -/* - * 150. unknown - * 151. unknown - * 152. unknown - * 153. unknown - * 154. unknown - */ - - - -/* - * 155. GL_REND_screen_coordinates - */ -#ifndef GL_REND_screen_coordinates -#define GL_REND_screen_coordinates 1 - -#define GL_SCREEN_COORDINATES_REND 0x8490 -#define GL_INVERTED_SCREEN_W_REND 0x8491 - -#endif /* GL_REND_screen_coordinates */ - - - -/* - * 156. GL_EXT_coordinate_frame - */ -#ifndef GL_EXT_coordinate_frame -#define GL_EXT_coordinate_frame 1 - -#define GL_TANGENT_ARRAY_EXT 0x8439 -#define GL_BINORMAL_ARRAY_EXT 0x843A -#define GL_CURRENT_TANGENT_EXT 0x843B -#define GL_CURRENT_BINORMAL_EXT 0x843C -#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E -#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F -#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 -#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 -#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 -#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 -#define GL_MAP1_TANGENT_EXT 0x8444 -#define GL_MAP2_TANGENT_EXT 0x8445 -#define GL_MAP1_BINORMAL_EXT 0x8446 -#define GL_MAP2_BINORMAL_EXT 0x8447 - -GLAPI void APIENTRY glTangent3bEXT(GLbyte x, GLbyte y, GLbyte z); -GLAPI void APIENTRY glTangent3dEXT(GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glTangent3fEXT(GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTangent3iEXT(GLint x, GLint y, GLint z); -GLAPI void APIENTRY glTangent3sEXT(GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glTangent3bvEXT(const GLbyte *v); -GLAPI void APIENTRY glTangent3dvEXT(const GLdouble *v); -GLAPI void APIENTRY glTangent3fvEXT(const GLfloat *v); -GLAPI void APIENTRY glTangent3ivEXT(const GLint *v); -GLAPI void APIENTRY glTangent3svEXT(const GLshort *v); -GLAPI void APIENTRY glBinormal3bEXT(GLbyte x, GLbyte y, GLbyte z); -GLAPI void APIENTRY glBinormal3dEXT(GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glBinormal3fEXT(GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glBinormal3iEXT(GLint x, GLint y, GLint z); -GLAPI void APIENTRY glBinormal3sEXT(GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glBinormal3bvEXT(const GLbyte *v); -GLAPI void APIENTRY glBinormal3dvEXT(const GLdouble *v); -GLAPI void APIENTRY glBinormal3fvEXT(const GLfloat *v); -GLAPI void APIENTRY glBinormal3ivEXT(const GLint *v); -GLAPI void APIENTRY glBinormal3svEXT(const GLshort *v); -GLAPI void APIENTRY glTangentPointerEXT(GLenum type, GLsizei stride, GLvoid *pointer); -GLAPI void APIENTRY glBinormalPointerEXT(GLenum type, GLsizei stride, GLvoid *pointer); - -typedef void (APIENTRY * PFNGLTANGENT3BEXT) (GLbyte x, GLbyte y, GLbyte z); -typedef void (APIENTRY * PFNGLTANGENT3DEXT) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRY * PFNGLTANGENT3FEXT) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTANGENT3IEXT) (GLint x, GLint y, GLint z); -typedef void (APIENTRY * PFNGLTANGENT3SEXT) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRY * PFNGLTANGENT3BVEXT) (const GLbyte *v); -typedef void (APIENTRY * PFNGLTANGENT3DVEXT) (const GLdouble *v); -typedef void (APIENTRY * PFNGLTANGENT3FVEXT) (const GLfloat *v); -typedef void (APIENTRY * PFNGLTANGENT3IVEXT) (const GLint *v); -typedef void (APIENTRY * PFNGLTANGENT3SVEXT) (const GLshort *v); -typedef void (APIENTRY * PFNGLBINORMAL3BEXT) (GLbyte x, GLbyte y, GLbyte z); -typedef void (APIENTRY * PFNGLBINORMAL3DEXT) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRY * PFNGLBINORMAL3FEXT) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLBINORMAL3IEXT) (GLint x, GLint y, GLint z); -typedef void (APIENTRY * PFNGLBINORMAL3SEXT) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRY * PFNGLBINORMAL3BVEXT) (const GLbyte *v); -typedef void (APIENTRY * PFNGLBINORMAL3DVEXT) (const GLdouble *v); -typedef void (APIENTRY * PFNGLBINORMAL3FVEXT) (const GLfloat *v); -typedef void (APIENTRY * PFNGLBINORMAL3IVEXT) (const GLint *v); -typedef void (APIENTRY * PFNGLBINORMAL3SVEXT) (const GLshort *v); -typedef void (APIENTRY * PFNGLTANGENTPOINTEREXT) (GLenum type, GLsizei stride, GLvoid *pointer); -typedef void (APIENTRY * PFNGLBINORMALPOINTEREXT) (GLenum type, GLsizei stride, GLvoid *pointer); - -#endif /* GL_EXT_coordinate_frame */ - - - -/* - * 157. unknown - */ - - - -/* - * 158. GL_EXT_texture_env_combine - */ -#ifndef GL_EXT_texture_env_combine -#define GL_EXT_texture_env_combine 1 - -#define GL_COMBINE_EXT 0x8570 -#define GL_COMBINE_RGB_EXT 0x8571 -#define GL_COMBINE_ALPHA_EXT 0x8572 -#define GL_RGB_SCALE_EXT 0x8573 -#define GL_ADD_SIGNED_EXT 0x8574 -#define GL_INTERPOLATE_EXT 0x8575 -#define GL_CONSTANT_EXT 0x8576 -#define GL_PRIMARY_COLOR_EXT 0x8577 -#define GL_PREVIOUS_EXT 0x8578 -#define GL_SOURCE0_RGB_EXT 0x8580 -#define GL_SOURCE1_RGB_EXT 0x8581 -#define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE0_ALPHA_EXT 0x8588 -#define GL_SOURCE1_ALPHA_EXT 0x8589 -#define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_OPERAND0_RGB_EXT 0x8590 -#define GL_OPERAND1_RGB_EXT 0x8591 -#define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND0_ALPHA_EXT 0x8598 -#define GL_OPERAND1_ALPHA_EXT 0x8599 -#define GL_OPERAND2_ALPHA_EXT 0x859A - -#endif /* GL_EXT_texture_env_combine */ - - - -/* - * 159. GL_APPLE_specular_vector - */ -#ifndef GL_APPLE_specular_vector -#define GL_APPLE_specular_vector 1 - -#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 - -#endif /* GL_APPLE_specular_vector */ - - - -/* - * 160. GL_APPLE_transform_hint - */ -#ifndef GL_APPLE_transform_hint -#define GL_APPLE_transform_hint 1 - -#define GL_TRANSFORM_HINT_APPLE 0x85B1 - -#endif /* GL_APPLE_transform_hint */ - - - -/* - * 161. unknown - * 162. unknown - */ - - - -/* - * 163. GL_SUNX_constant_data - */ -#ifndef GL_SUNX_constant_data -#define GL_SUNX_constant_data 1 - -#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 -#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 - -GLAPI void APIENTRY glFinishTextureSUNX(void); - -typedef void (APIENTRY * PFNGLFINISHTEXTURESUNX) (void); - -#endif /* GL_SUNX_constant_data */ - - - -/* - * 164. GL_SUN_global_alpha - */ -#ifndef GL_SUN_global_alpha -#define GL_SUN_global_alpha 1 - -#define GL_GLOBAL_ALPHA_SUN 0x81D9 -#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA - -GLAPI void APIENTRY glGlobalAlphaFactorbSUN(GLbyte factor); -GLAPI void APIENTRY glGlobalAlphaFactorsSUN(GLshort factor); -GLAPI void APIENTRY glGlobalAlphaFactoriSUN(GLint factor); -GLAPI void APIENTRY glGlobalAlphaFactorfSUN(GLfloat factor); -GLAPI void APIENTRY glGlobalAlphaFactordSUN(GLdouble factor); -GLAPI void APIENTRY glGlobalAlphaFactorubSUN(GLubyte factor); -GLAPI void APIENTRY glGlobalAlphaFactorusSUN(GLushort factor); -GLAPI void APIENTRY glGlobalAlphaFactoruiSUN(GLuint factor); - -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORBSUN) (GLbyte factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORSSUN) (GLshort factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORISUN) (GLint factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORFSUN) (GLfloat factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORDSUN) (GLdouble factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUBSUN) (GLubyte factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUSSUN) (GLushort factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUISUN) (GLuint factor); - -#endif /* GL_SUN_global_alpha */ - - - -/* - * 165. GL_SUN_triangle_list - */ -#ifndef GL_SUN_triangle_list -#define GL_SUN_triangle_list 1 - -#define GL_TRIANGLE_LIST_SUN 0x81D7 -#define GL_REPLACEMENT_CODE_SUN 0x81D8 -#define GL_RESTART_SUN 0x01 -#define GL_REPLACE_MIDDLE_SUN 0x02 -#define GL_REPLACE_OLDEST_SUN 0x03 -#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 -#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 -#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 -#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 -#define GL_R1UI_V3F_SUN 0x85C4 -#define GL_R1UI_C4UB_V3F_SUN 0x85C5 -#define GL_R1UI_C3F_V3F_SUN 0x85C6 -#define GL_R1UI_N3F_V3F_SUN 0x85C7 -#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 -#define GL_R1UI_T2F_V3F_SUN 0x85C9 -#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA -#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB - -GLAPI void APIENTRY glReplacementCodeuiSUN(GLuint code); -GLAPI void APIENTRY glReplacementCodeusSUN(GLushort code); -GLAPI void APIENTRY glReplacementCodeubSUN(GLubyte code); -GLAPI void APIENTRY glReplacementCodeuivSUN(const GLuint *code); -GLAPI void APIENTRY glReplacementCodeusvSUN(const GLushort *code); -GLAPI void APIENTRY glReplacementCodeubvSUN(const GLubyte *code); -GLAPI void APIENTRY glReplacementCodePointerSUN(GLenum type, GLsizei stride, const GLvoid *pointer); - -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUISUN) (GLuint code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSSUN) (GLushort code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBSUN) (GLubyte code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVSUN) (const GLuint *code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSVSUN) (const GLushort *code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBVSUN) (const GLubyte *code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEPOINTERSUN) (GLenum type, GLsizei stride, const GLvoid *pointer); - -#endif /* GL_SUN_triangle_list */ - - - -/* - * 166. GL_SUN_vertex - */ -#ifndef GL_SUN_vertex -#define GL_SUN_vertex 1 - -GLAPI void APIENTRY glColor4ubVertex2fSUN(GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -GLAPI void APIENTRY glColor4ubVertex2fvSUN(const GLubyte *c, const GLfloat *v); -GLAPI void APIENTRY glColor4ubVertex3fSUN(GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glColor4ubVertex3fvSUN(const GLubyte *c, const GLfloat *v); -GLAPI void APIENTRY glColor3fVertex3fSUN(GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glColor3fVertex3fvSUN(const GLfloat *c, const GLfloat *v); -GLAPI void APIENTRY glNormal3fVertex3fSUN(GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glNormal3fVertex3fvSUN(const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN(GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN(const GLfloat *c, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fVertex3fSUN(GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fVertex3fvSUN(const GLfloat *tc, const GLfloat *v); -GLAPI void APIENTRY glTexCoord4fVertex4fSUN(GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glTexCoord4fVertex4fvSUN(const GLfloat *tc, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN(GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN(const GLfloat *tc, const GLubyte *c, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN(GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN(const GLfloat *tc, const GLfloat *c, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN(GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN(const GLfloat *tc, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN(GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN(const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN(GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN(const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN(GLuint rc, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN(const GLuint *rc, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN(GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN(const GLuint *rc, const GLubyte *c, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN(GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN(const GLuint *rc, const GLfloat *c, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN(GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN(const GLuint *rc, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN(GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN(const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN(GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN(const GLuint *rc, const GLfloat *tc, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN(GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN(const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN(GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN(const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); - -typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FSUN) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FVSUN) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FSUN) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FVSUN) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FSUN) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FVSUN) (const GLfloat *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FSUN) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FVSUN) (const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUN) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUN) (const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FSUN) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUN) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FSUN) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUN) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUN) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUN) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUN) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUN) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUN) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUN) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUN) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUN) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUN) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUN) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUN) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUN) (const GLuint *rc, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUN) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUN) (const GLuint *rc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUN) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUN) (const GLuint *rc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUN) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUN) (const GLuint *rc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUN) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUN) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUN) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUN) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUN) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUN) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUN) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUN) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); - -#endif /* GL_SUN_vertex */ - - - -/* - * 167. WGL_EXT_display_color_table - * 168. WGL_EXT_extensions_string - * 169. WGL_EXT_make_current_read - * 170. WGL_EXT_pixel_format - * 171. WGL_EXT_pbuffer - * 172. WGL_EXT_swap_control - */ - - - -/* - * 173. GL_EXT_blend_func_separate - */ -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 - -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB - -GLAPI void APIENTRY glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); - -typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); - -#endif /* GL_EXT_blend_func_separate */ - - - -/* - * 173. GL_INGR_blend_func_separate - */ -#ifndef GL_INGR_blend_func_separate -#define GL_INGR_blend_func_separate 1 - -#define GL_BLEND_DST_RGB_INGR 0x80C8 -#define GL_BLEND_SRC_RGB_INGR 0x80C9 -#define GL_BLEND_DST_ALPHA_INGR 0x80CA -#define GL_BLEND_SRC_ALPHA_INGR 0x80CB - -GLAPI void APIENTRY glBlendFuncSeparateINGR(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); - -typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); - -#endif /* GL_INGR_blend_func_separate */ - - - -/* - * 174. GL_INGR_color_clamp - */ -#ifndef GL_INGR_color_clamp -#define GL_INGR_color_clamp 1 - -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 - -#endif /* GL_INGR_color_clamp */ - - - -/* - * 175. GL_INGR_interlace_read - */ -#ifndef GL_INGR_interlace_read -#define GL_INGR_interlace_read 1 - -#define GL_INTERLACE_READ_INGR 0x8568 - -#endif /* GL_INGR_interlace_read */ - - - -/* - * 176. GL_EXT_stencil_wrap - */ -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 - -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 - -#endif /* GL_EXT_stencil_wrap */ - - - -/* - * 177. WGL_EXT_depth_float - */ - - - -/* - * 178. GL_EXT_422_pixels - */ -#ifndef GL_EXT_422_pixels -#define GL_EXT_422_pixels 1 - -#define GL_422_EXT 0x80CC -#define GL_422_REV_EXT 0x80CD -#define GL_422_AVERAGE_EXT 0x80CE -#define GL_422_REV_AVERAGE_EXT 0x80CF - -#endif /* GL_EXT_422_pixels */ - - - -/* - * 179. GL_NV_texgen_reflection - */ -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 - -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 - -#endif /* GL_NV_texgen_reflection */ - - - -/* - * 180. unknown - * 181. unknown - */ - - - -/* - * 182. GL_SUN_convolution_border_modes - */ -#ifndef GL_SUN_convolution_border_modes -#define GL_SUN_convolution_border_modes 1 - -#define GL_WRAP_BORDER_SUN 0x81D4 - -#endif /* GL_SUN_convolution_border_modes */ - - - -/* - * 183. GLX_SUN_transparent_index - * 184. unknown - */ - - - -/* - * 185. GL_EXT_texture_env_add - */ -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 - -/* No new tokens or functions */ - -#endif /* GL_EXT_texture_env_add */ - - - -/* - * 186. GL_EXT_texture_lod_bias - */ -#ifndef GL_EXT_texture_lod_bias -#define GL_EXT_texture_lod_bias 1 - -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 - -#endif /* GL_EXT_texture_lod_bias */ - - - -/* - * 187. GL_EXT_texture_filter_anisotropic - */ -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 - -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF - -#endif /* GL_EXT_texture_filter_anisotropic */ - - - -/* - * 188. GL_EXT_vertex_weighting - */ -#ifndef GL_EXT_vertex_weighting -#define GL_EXT_vertex_weighting 1 - -#define GL_VERTEX_WEIGHTING_EXT 0x8509 -#define GL_MODELVIEW0_EXT 0x1700 -#define GL_MODELVIEW1_EXT 0x850A -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F -#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 -#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 -#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 - -GLAPI void APIENTRY glVertexWeightfEXT(GLfloat weight); -GLAPI void APIENTRY glVertexWeightfvEXT(const GLfloat *weight); -GLAPI void APIENTRY glVertexWeightPointerEXT(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); - -typedef void (APIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); -typedef void (APIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); -typedef void (APIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); - -#endif /* GL_EXT_vertex_weighting */ - - - -/* - * 189. GL_NV_light_max_exponent - */ -#ifndef GL_NV_light_max_exponent -#define GL_NV_light_max_exponent 1 - -#define GL_MAX_SHININESS_NV 0x8507 -#define GL_MAX_SPOT_EXPONENT_NV 0x8508 - -#endif /* GL_NV_light_max_exponent */ - - - -/* - * 190. GL_NV_vertex_array_range - */ -#ifndef GL_NV_vertex_array_range -#define GL_NV_vertex_array_range 1 - -#define GL_VERTEX_ARRAY_RANGE_NV 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E -#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 - -GLAPI void APIENTRY glFlushVertexArrayRangeNV(void); -GLAPI void APIENTRY glVertexArrayRangeNV(GLsizei size, const GLvoid * pointer); - -typedef void (APIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (APIENTRY * PFNGLVERTEXARRAYRANGENV) (GLsizei size, const GLvoid * pointer); - -#endif /* GL_NV_vertex_array_range */ - - - -/* - * 191. GL_NV_register_combiners - */ -#ifndef GL_NV_register_combiners -#define GL_NV_register_combiners 1 - -#define GL_REGISTER_COMBINERS_NV 0x8522 -#define GL_COMBINER0_NV 0x8550 -#define GL_COMBINER1_NV 0x8551 -#define GL_COMBINER2_NV 0x8552 -#define GL_COMBINER3_NV 0x8553 -#define GL_COMBINER4_NV 0x8554 -#define GL_COMBINER5_NV 0x8555 -#define GL_COMBINER6_NV 0x8556 -#define GL_COMBINER7_NV 0x8557 -#define GL_VARIABLE_A_NV 0x8523 -#define GL_VARIABLE_B_NV 0x8524 -#define GL_VARIABLE_C_NV 0x8525 -#define GL_VARIABLE_D_NV 0x8526 -#define GL_VARIABLE_E_NV 0x8527 -#define GL_VARIABLE_F_NV 0x8528 -#define GL_VARIABLE_G_NV 0x8529 -#define GL_CONSTANT_COLOR0_NV 0x852A -#define GL_CONSTANT_COLOR1_NV 0x852B -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -#define GL_SPARE0_NV 0x852E -#define GL_SPARE1_NV 0x852F -#define GL_UNSIGNED_IDENTITY_NV 0x8536 -#define GL_UNSIGNED_INVERT_NV 0x8537 -#define GL_EXPAND_NORMAL_NV 0x8538 -#define GL_EXPAND_NEGATE_NV 0x8539 -#define GL_HALF_BIAS_NORMAL_NV 0x853A -#define GL_HALF_BIAS_NEGATE_NV 0x853B -#define GL_SIGNED_IDENTITY_NV 0x853C -#define GL_SIGNED_NEGATE_NV 0x853D -#define GL_E_TIMES_F_NV 0x8531 -#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 -#define GL_SCALE_BY_TWO_NV 0x853E -#define GL_SCALE_BY_FOUR_NV 0x853F -#define GL_SCALE_BY_ONE_HALF_NV 0x8540 -#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 -#define GL_DISCARD_NV 0x8530 -#define GL_COMBINER_INPUT_NV 0x8542 -#define GL_COMBINER_MAPPING_NV 0x8543 -#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 -#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 -#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 -#define GL_COMBINER_MUX_SUM_NV 0x8547 -#define GL_COMBINER_SCALE_NV 0x8548 -#define GL_COMBINER_BIAS_NV 0x8549 -#define GL_COMBINER_AB_OUTPUT_NV 0x854A -#define GL_COMBINER_CD_OUTPUT_NV 0x854B -#define GL_COMBINER_SUM_OUTPUT_NV 0x854C -#define GL_NUM_GENERAL_COMBINERS_NV 0x854E -#define GL_COLOR_SUM_CLAMP_NV 0x854F -#define GL_MAX_GENERAL_COMBINERS_NV 0x854D - -#ifdef VMS -/*VMS only allows externals of maximal 31 characters! */ -#define glGetCombinerOutputParameterfvNV glGetCombinerOutputParameterfvN -#define glGetCombinerOutputParameterivNV glGetCombinerOutputParameterivN -#define glGetFinalCombinerInputParameterfvNV glGetFnlCmbinerInpParameterfvNV -#define glGetFinalCombinerInputParameterivNV glGetFnlCmbinerInpParameterivNV -#endif - -GLAPI void APIENTRY glCombinerParameterfvNV(GLenum pname, const GLfloat * params); -GLAPI void APIENTRY glCombinerParameterfNV(GLenum pname, GLfloat param); -GLAPI void APIENTRY glCombinerParameterivNV(GLenum pname, const GLint * params); -GLAPI void APIENTRY glCombinerParameteriNV(GLenum pname, GLint param); -GLAPI void APIENTRY glCombinerInputNV(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -GLAPI void APIENTRY glCombinerOutputNV(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -GLAPI void APIENTRY glFinalCombinerInputNV(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -GLAPI void APIENTRY glGetCombinerInputParameterfvNV(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); -GLAPI void APIENTRY glGetCombinerInputParameterivNV(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); -GLAPI void APIENTRY glGetCombinerOutputParameterfvNV(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); -GLAPI void APIENTRY glGetCombinerOutputParameterivNV(GLenum stage, GLenum portion, GLenum pname, GLint * params); -GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV(GLenum variable, GLenum pname, GLfloat * params); -GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV(GLenum variable, GLenum pname, GLint * params); - -typedef void (APIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei size, const GLvoid * pointer); -typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat * params); -typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint * params); -typedef void (APIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -typedef void (APIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); -typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); -typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat * params); -typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint * params); -typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat * params); -typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint * params); - -#endif /* GL_NV_register_combiners */ - - - -/* - * 192. GL_NV_fog_distance - */ -#ifndef GL_NV_fog_distance -#define GL_NV_fog_distance 1 - -#define GL_FOG_DISTANCE_MODE_NV 0x855A -#define GL_EYE_RADIAL_NV 0x855B -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C - -#endif /* GL_NV_fog_distance*/ - - - -/* - * 193. unknown - */ - - - -/* - * 194. GL_NV_blend_square - */ -#ifndef GL_NV_blend_square -#define GL_NV_blend_square 1 - -/* no tokens or functions */ - -#endif /* GL_NV_blend_square */ - - - -/* - * 195. GL_NV_texture_env_combine4 - */ -#ifndef GL_NV_texture_env_combine4 -#define GL_NV_texture_env_combine4 1 - -#define GL_COMBINE4_NV 0x8503 -#define GL_SOURCE3_RGB_NV 0x8583 -#define GL_SOURCE3_ALPHA_NV 0x858B -#define GL_OPERAND3_RGB_NV 0x8593 -#define GL_OPERAND3_ALPHA_NV 0x859B - -#endif /* GL_NV_texture_env_combine4 */ - - - -/* - * 196. GL_MESA_resize_bufffers - */ -#ifndef GL_MESA_resize_buffers -#define GL_MESA_resize_buffers 1 - -GLAPI void APIENTRY glResizeBuffersMESA(void); - -typedef void (APIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); - -#endif /* GL_MESA_resize_bufffers */ - - - -/* - * 197. GL_MESA_window_pos - */ -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 - -GLAPI void APIENTRY glWindowPos2iMESA(GLint x, GLint y); -GLAPI void APIENTRY glWindowPos2sMESA(GLshort x, GLshort y); -GLAPI void APIENTRY glWindowPos2fMESA(GLfloat x, GLfloat y); -GLAPI void APIENTRY glWindowPos2dMESA(GLdouble x, GLdouble y); -GLAPI void APIENTRY glWindowPos2ivMESA(const GLint *p); -GLAPI void APIENTRY glWindowPos2svMESA(const GLshort *p); -GLAPI void APIENTRY glWindowPos2fvMESA(const GLfloat *p); -GLAPI void APIENTRY glWindowPos2dvMESA(const GLdouble *p); -GLAPI void APIENTRY glWindowPos3iMESA(GLint x, GLint y, GLint z); -GLAPI void APIENTRY glWindowPos3sMESA(GLshort x, GLshort y, GLshort z); -GLAPI void APIENTRY glWindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z); -GLAPI void APIENTRY glWindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z); -GLAPI void APIENTRY glWindowPos3ivMESA(const GLint *p); -GLAPI void APIENTRY glWindowPos3svMESA(const GLshort *p); -GLAPI void APIENTRY glWindowPos3fvMESA(const GLfloat *p); -GLAPI void APIENTRY glWindowPos3dvMESA(const GLdouble *p); -GLAPI void APIENTRY glWindowPos4iMESA(GLint x, GLint y, GLint z, GLint w); -GLAPI void APIENTRY glWindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void APIENTRY glWindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void APIENTRY glWindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void APIENTRY glWindowPos4ivMESA(const GLint *p); -GLAPI void APIENTRY glWindowPos4svMESA(const GLshort *p); -GLAPI void APIENTRY glWindowPos4fvMESA(const GLfloat *p); -GLAPI void APIENTRY glWindowPos4dvMESA(const GLdouble *p); - -typedef void (APIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); -typedef void (APIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); -typedef void (APIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint *p); -typedef void (APIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *p); -typedef void (APIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *p); -typedef void (APIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *p); -typedef void (APIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint *p); -typedef void (APIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *p); -typedef void (APIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *p); -typedef void (APIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *p); -typedef void (APIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint *p); -typedef void (APIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *p); -typedef void (APIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *p); -typedef void (APIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *p); - -#endif /* GL_MESA_window_pos */ - - - -/* - * 198. GL_EXT_texture_compression_s3tc - */ -#ifndef GL_EXT_texture_compression_s3tc -#define GL_EXT_texture_compression_s3tc 1 - -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 - -#endif /* GL_EXT_texture_compression_s3tc */ - - - -/* - * 199. GL_IBM_cull_vertex - */ -#ifndef GL_IBM_cull_vertex -#define GL_IBM_cull_vertex 1 - -#define GL_CULL_VERTEX_IBM 103050 - -#endif /* GL_IBM_cull_vertex */ - - -/* - * 200. GL_IBM_multimode_draw_arrays - */ -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 - -GLAPI void APIENTRY glMultiModeDrawArraysIBM(GLenum *mode, GLint *first, GLsizei *count, GLsizei primcount, GLint modestride); -GLAPI void APIENTRY glMultiModeDrawElementsIBM(GLenum *mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount, GLint modestride); - -typedef void (APIENTRY * PFNGLGLMULTIMODEDRAWARRAYSIBMPROC) (GLenum *mode, GLint *first, GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (APIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (GLenum *mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount, GLint modestride); - -#endif /* GL_IBM_multimode_draw_arrays */ - - - -/* - * 201. GL_IBM_vertex_array_lists - */ -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 - -#define GL_VERTEX_ARRAY_LIST_IBM 103070 -#define GL_NORMAL_ARRAY_LIST_IBM 103071 -#define GL_COLOR_ARRAY_LIST_IBM 103072 -#define GL_INDEX_ARRAY_LIST_IBM 103073 -#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 -#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 -#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 -#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 -#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 -#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 -#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 -#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 -#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 -#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 -#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 -#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 - -GLAPI void APIENTRY glColorPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); -GLAPI void APIENTRY glSecondaryColorPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); -GLAPI void APIENTRY glEdgeFlagPointerListIBM(GLint stride, const GLboolean **pointer, GLint ptrstride); -GLAPI void APIENTRY glFogCoordPointerListIBM(GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); -GLAPI void APIENTRY glIndexPointerListIBM(GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); -GLAPI void APIENTRY glNormalPointerListIBM(GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); -GLAPI void APIENTRY glTexCoordPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); -GLAPI void APIENTRY glVertexPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); - -typedef void (APIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean **pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); - -#endif /* GL_IBM_multimode_draw_arrays */ - - - -/* - * 202. ? - * 203. ? - * 204. ? - * 205. ? - */ - - -/* - * 206. GL_3DFX_texture_compression_FXT1 - */ -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_3DFX_texture_compression_FXT1 1 - -#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 - -#endif /* GL_3DFX_texture_compression_FXT1 */ - - - -/* - * 207. GL_3DFX_multisample - */ -#ifndef GL_3DFX_multisample -#define GL_3DFX_multisample 1 - -#define GL_MULTISAMPLE_3DFX 0x86B2 -#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 -#define GL_SAMPLES_3DFX 0x86B4 -#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 - -#endif /* GL_3DFX_multisample */ - - - -/* - * 208. GL_3DFX_tbuffer - */ -#ifndef GL_3DFX_tbuffer -#define GL_3DFX_tbuffer 1 - -GLAPI void APIENTRY glTbufferMask3DFX(GLuint mask); - -typedef void (APIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask ); - -#endif /* GL_3DFX_tbuffer */ - - - -/* - * 209. WGL_EXT_multisample - */ -#ifndef WGL_EXT_multisample -#define WGL_EXT_multisample 1 - -#define WGL_SAMPLE_BUFFERS_EXT 0x2041 -#define WGL_SAMPLES_EXT 0x2042 -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#define GL_SAMPLE_MASK_EXT 0x80A0 - -GLAPI void APIENTRY glSampleMaskEXT(GLclampf value, GLboolean invert); -GLAPI void APIENTRY glSamplePatternEXT(GLenum pattern); - -typedef void (APIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); - -#endif /* WGL_EXT_multisample */ - - - -/* - * 210. GL_SGIX_vertex_preclip - */ -#ifndef GL_SGIX_vertex_preclip -#define GL_SGIX_vertex_preclip 1 - -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF - -#endif /* GL_SGIX_vertex_preclip */ - - - -/* - * 212. GL_SGIX_resample - */ -#ifndef GL_SGIX_resample -#define GL_SGIX_resample 1 - -#define GL_PACK_RESAMPLE_SGIX 0x842E -#define GL_UNPACK_RESAMPLE_SGIX 0x842F -#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 -#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 -#define GL_RESAMPLE_DECIMATE_SGIX 0x0 /*?*/ - -#endif /* GL_SGIX_resample */ - - - -/* - * ARB 1. GL_ARB_multitexture - */ -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 - -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 - -GLAPI void APIENTRY glActiveTextureARB(GLenum texture); -GLAPI void APIENTRY glClientActiveTextureARB(GLenum texture); -GLAPI void APIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s); -GLAPI void APIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s); -GLAPI void APIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord1iARB(GLenum target, GLint s); -GLAPI void APIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s); -GLAPI void APIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); -GLAPI void APIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); -GLAPI void APIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); -GLAPI void APIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); -GLAPI void APIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); -GLAPI void APIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); -GLAPI void APIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); -GLAPI void APIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); -GLAPI void APIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v); -GLAPI void APIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void APIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v); -GLAPI void APIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void APIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v); -GLAPI void APIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); -GLAPI void APIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); -GLAPI void APIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void APIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); - -typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +#endif -#endif /* GL_ARB_multitexture */ +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glLockArraysEXT (GLint, GLsizei); +extern void APIENTRY glUnlockArraysEXT (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); +#endif +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); +extern void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); +typedef void (APIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); +#endif +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 +#endif -/* - * ARB 2. GLX_ARB_get_proc_address - */ +#ifndef GL_SGIX_fragment_lighting +#define GL_SGIX_fragment_lighting 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); +extern void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); +extern void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); +extern void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); +extern void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); +extern void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); +extern void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); +extern void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); +extern void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); +extern void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); +extern void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); +extern void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); +extern void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); +extern void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); +extern void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); +extern void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); +extern void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); +extern void APIENTRY glLightEnviSGIX (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +#endif +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 +#endif -/* - * ARB 3. GL_ARB_tranpose_matrix - */ -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 +#endif -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +#endif -GLAPI void APIENTRY glLoadTransposeMatrixdARB(const GLdouble m[16]); -GLAPI void APIENTRY glLoadTransposeMatrixfARB(const GLfloat m[16]); -GLAPI void APIENTRY glMultTransposeMatrixdARB(const GLdouble m[16]); -GLAPI void APIENTRY glMultTransposeMatrixfARB(const GLfloat m[16]); +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 +#endif -typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) ( const GLdouble m[16] ); -typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) ( const GLfloat m[16] ); -typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) ( const GLdouble m[16] ); -typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) ( const GLfloat m[16] ); +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 +#endif -#endif /* GL_ARB_tranpose_matrix */ +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glApplyTextureEXT (GLenum); +extern void APIENTRY glTextureLightEXT (GLenum); +extern void APIENTRY glTextureMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 +#endif +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +#endif -/* - * ARB 4. WGL_ARB_buffer_region - */ +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); +extern void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); +extern void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); +extern void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); +typedef void (APIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +#endif +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +#endif +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); +extern void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); +extern void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); +extern void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +#endif -/* - * ARB 5. GL_ARB_multisample - */ -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +#endif -#define GL_MULTISAMPLE_ARBfunda 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 -#define GL_1PASS_ARB 0x80A1 -#define GL_2PASS_0_ARB 0x80A2 -#define GL_2PASS_1_ARB 0x80A3 -#define GL_4PASS_0_ARB 0x80A4 -#define GL_4PASS_1_ARB 0x80A5 -#define GL_4PASS_2_ARB 0x80A6 -#define GL_4PASS_3_ARB 0x80A7 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLES_ARB 0x80A9 -#define GL_SAMPLE_MAX_PASSES_ARB 0x84E7 -#define GL_SAMPLE_PASS_ARB 0x84E8 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -/* Note: there are more tokens for GLX and WGL */ - -GLAPI void APIENTRY glSamplePassARB(GLenum pass); -GLAPI void APIENTRY glSampleCoverageARB(GLclampf value, GLboolean invert); +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#endif -typedef void (APIENTRY * PFNGLSAMPLEPASSARBPROC) (GLenum pass); -typedef void (APIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#endif -#endif /* GL_ARB_multisample */ +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); +extern void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); +extern void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); +extern void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); +extern void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); +extern void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); +extern void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); +extern void APIENTRY glSecondaryColor3ivEXT (const GLint *); +extern void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); +extern void APIENTRY glSecondaryColor3svEXT (const GLshort *); +extern void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); +extern void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); +extern void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); +extern void APIENTRY glSecondaryColor3uivEXT (const GLuint *); +extern void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); +extern void APIENTRY glSecondaryColor3usvEXT (const GLushort *); +extern void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +#endif +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glTextureNormalEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +#endif +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); +extern void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif -/* - * ARB 6. GL_ARB_texture_env_add - */ -#ifndef GL_ARB_texture_env_add -#define GL_ARB_texture_env_add 1 +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glFogCoordfEXT (GLfloat); +extern void APIENTRY glFogCoordfvEXT (const GLfloat *); +extern void APIENTRY glFogCoorddEXT (GLdouble); +extern void APIENTRY glFogCoorddvEXT (const GLdouble *); +extern void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); +typedef void (APIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (APIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif -/* No new tokens or functions */ +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 +#endif -#endif /* GL_ARB_texture_env_add */ +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); +extern void APIENTRY glTangent3bvEXT (const GLbyte *); +extern void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); +extern void APIENTRY glTangent3dvEXT (const GLdouble *); +extern void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); +extern void APIENTRY glTangent3fvEXT (const GLfloat *); +extern void APIENTRY glTangent3iEXT (GLint, GLint, GLint); +extern void APIENTRY glTangent3ivEXT (const GLint *); +extern void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); +extern void APIENTRY glTangent3svEXT (const GLshort *); +extern void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); +extern void APIENTRY glBinormal3bvEXT (const GLbyte *); +extern void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); +extern void APIENTRY glBinormal3dvEXT (const GLdouble *); +extern void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); +extern void APIENTRY glBinormal3fvEXT (const GLfloat *); +extern void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); +extern void APIENTRY glBinormal3ivEXT (const GLint *); +extern void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); +extern void APIENTRY glBinormal3svEXT (const GLshort *); +extern void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); +extern void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); +typedef void (APIENTRY * PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRY * PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); +typedef void (APIENTRY * PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); +typedef void (APIENTRY * PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); +typedef void (APIENTRY * PFNGLTANGENT3IVEXTPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); +typedef void (APIENTRY * PFNGLTANGENT3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); +typedef void (APIENTRY * PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRY * PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); +typedef void (APIENTRY * PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); +typedef void (APIENTRY * PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); +typedef void (APIENTRY * PFNGLBINORMAL3IVEXTPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); +typedef void (APIENTRY * PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +#endif +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 +#endif -/* - * ARB 7. GL_ARB_texture_cube_map - */ -#ifndef GL_ARB_texture_cube_map -#define GL_ARB_texture_cube_map 1 +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 +#endif -#define GL_NORMAL_MAP_ARB 0x8511 -#define GL_REFLECTION_MAP_ARB 0x8512 -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#ifndef GL_SGIX_fog_scale +#define GL_SGIX_fog_scale 1 +#endif -#endif /* GL_ARB_texture_cube_map */ +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glFinishTextureSUNX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); +#endif +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); +extern void APIENTRY glGlobalAlphaFactorsSUN (GLshort); +extern void APIENTRY glGlobalAlphaFactoriSUN (GLint); +extern void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); +extern void APIENTRY glGlobalAlphaFactordSUN (GLdouble); +extern void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); +extern void APIENTRY glGlobalAlphaFactorusSUN (GLushort); +extern void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +#endif +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glReplacementCodeuiSUN (GLuint); +extern void APIENTRY glReplacementCodeusSUN (GLushort); +extern void APIENTRY glReplacementCodeubSUN (GLubyte); +extern void APIENTRY glReplacementCodeuivSUN (const GLuint *); +extern void APIENTRY glReplacementCodeusvSUN (const GLushort *); +extern void APIENTRY glReplacementCodeubvSUN (const GLubyte *); +extern void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); +#endif -/* - * ARB 8. WGL_ARB_extensions_string - * ARB 9. WGL_ARB_pixel_format - * ARB 10. WGL_ARB_make_current_read - * ARB 11. WGL_ARB_pbuffer - */ +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); +extern void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); +extern void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); +extern void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); +extern void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); +extern void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +extern void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); +extern void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); +extern void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); +extern void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +extern void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +extern void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +extern void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +extern void APIENTRY glReplacementCodeuiVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLenum *, const GLfloat *); +extern void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLenum, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLenum *, const GLubyte *, const GLfloat *); +extern void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); +extern void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); +extern void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *); +extern void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); +extern void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *); +extern void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLenum rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLenum rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLenum *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLenum rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#endif +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 +#endif -/* - * ARB 12. GL_ARB_texture_compression - */ -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 +#endif -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 - -GLAPI void APIENTRY glCompressedTexImage3DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glCompressedTexImage2DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glCompressedTexImage1DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glCompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glCompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glCompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -GLAPI void APIENTRY glGetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img); +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +#endif -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLvoid *img); +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 +#endif -#endif /* GL_ARB_texture_compression */ +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +#endif +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 +#endif +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +#endif -/* - * ? GL_NV_texgen_emboss - */ +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#endif -#ifndef GL_NV_texgen_emboss -#define GL_NV_texgen_emboss 1 +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif -#define GL_EMBOSS_MAP_NV 0x855F -#define GL_EMBOSS_LIGHT_NV 0x855D -#define GL_EMBOSS_CONSTANT_NV 0x855E +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glVertexWeightfEXT (GLfloat); +extern void APIENTRY glVertexWeightfvEXT (const GLfloat *); +extern void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif -#endif /* GL_NV_texgen_emboss */ +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +#endif +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glFlushVertexArrayRangeNV (void); +extern void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei size, const GLvoid *pointer); +#endif +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); +extern void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); +extern void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); +extern void APIENTRY glCombinerParameteriNV (GLenum, GLint); +extern void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); +extern void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); +extern void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); +extern void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); +extern void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); +extern void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); +extern void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); +extern void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); +extern void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); +#endif -/* - * ?. GL_WIN_swap_hint - */ -#ifndef GL_WIN_swap_hint -#define GL_WIN_swap_hint 1 +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +#endif -GLAPI void APIENTRY glAddSwapHintRectWIN(GLint x, GLint y, GLsizei width, GLsizei height); +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +#endif -typedef void (APIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +#endif -#endif /* GL_WIN_swap_hint */ +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +#endif +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glResizeBuffersMESA (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); +#endif +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); +extern void APIENTRY glWindowPos2dvMESA (const GLdouble *); +extern void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); +extern void APIENTRY glWindowPos2fvMESA (const GLfloat *); +extern void APIENTRY glWindowPos2iMESA (GLint, GLint); +extern void APIENTRY glWindowPos2ivMESA (const GLint *); +extern void APIENTRY glWindowPos2sMESA (GLshort, GLshort); +extern void APIENTRY glWindowPos2svMESA (const GLshort *); +extern void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); +extern void APIENTRY glWindowPos3dvMESA (const GLdouble *); +extern void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); +extern void APIENTRY glWindowPos3fvMESA (const GLfloat *); +extern void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); +extern void APIENTRY glWindowPos3ivMESA (const GLint *); +extern void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); +extern void APIENTRY glWindowPos3svMESA (const GLshort *); +extern void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); +extern void APIENTRY glWindowPos4dvMESA (const GLdouble *); +extern void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); +extern void APIENTRY glWindowPos4fvMESA (const GLfloat *); +extern void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); +extern void APIENTRY glWindowPos4ivMESA (const GLint *); +extern void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); +extern void APIENTRY glWindowPos4svMESA (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); +#endif -/* - * ?. GL_IBM_cull_vertex - */ #ifndef GL_IBM_cull_vertex #define GL_IBM_cull_vertex 1 +#endif -#define GL_CULL_VERTEX_IBM 0x1928A +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glMultiModeDrawArraysIBM (GLenum, const GLint *, const GLsizei *, GLsizei, GLint); +extern void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* *, GLsizei, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, GLint modestride); +#endif -#endif /* GL_IBM_cull_vertex */ +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +extern void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +extern void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); +extern void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +extern void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +extern void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +extern void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +extern void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +#endif +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 +#endif +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 +#endif -/* - * ?. GL_IBM_static_data - */ -#ifndef GL_IBM_static_data -#define GL_IBM_static_data 1 +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 +#endif -#define GL_ALL_STATIC_DATA_IBM 0x19294 -#define GL_STATIC_VERTEX_ARRAY_IBM 0x19295 +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 +#endif -GLAPI void APIENTRY glFlushStaticDataIBM(GLenum target); +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 +#endif -typedef void (APIENTRY * PFNGLFLUSHSTATICDATAIBM) (GLenum target); +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 +#endif -#endif /* GL_IBM_static_data */ +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glTbufferMask3DFX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); +#endif +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); +extern void APIENTRY glSamplePatternEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); +#endif +#ifndef GL_SGI_vertex_preclip +#define GL_SGI_vertex_preclip 1 +#endif -/* - * ?. GL_IBM_texture_mirrored_repeat - */ -#ifndef GL_IBM_texture_mirrored_repeat -#define GL_IBM_texture_mirrored_repeat 1 +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 +#endif -#define GL_MIRRORED_REPEAT_IBM 0x8370 +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 +#endif -#endif /* GL_IBM_texture_mirrored_repeat */ +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 +#endif +#ifndef GL_SGIS_texture_color_mask +#define GL_SGIS_texture_color_mask 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#endif #ifdef __cplusplus } #endif - -#endif /* __glext_h_ */ +#endif -- cgit v1.2.3 From 55336ae09d422842a72d8795154fe30992a4f648 Mon Sep 17 00:00:00 2001 From: Jouk Jansen Date: Thu, 15 Jun 2000 07:33:48 +0000 Subject: ---------------------------------------------------------------------- Committing in . VMS : >31 character-external problem Modified Files: Mesa/include/GL/glext.h ---------------------------------------------------------------------- --- include/GL/glext.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 3ee1cef05e1..f721a9fd70a 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -2712,6 +2712,12 @@ extern void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, extern void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); extern void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); extern void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); +#ifdef VMS + #define glGetCombinerOutputParameterfvNV glGetCombinerOutputParameterfvN + #define glGetCombinerOutputParameterivNV glGetCombinerOutputParameterivN + #define glGetFinalCombinerInputParameterfvNV glGetFinalCombinerInputParafvNV + #define glGetFinalCombinerInputParameterivNV glGetFinalCombinerInputParaivNV +#endif extern void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); extern void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); extern void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); -- cgit v1.2.3 From 9f60fd21546f5dd3cb46c3ec32d9f084eda17c7e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 15 Jun 2000 15:11:40 +0000 Subject: removed non-windows exit() prototype --- include/GL/glut.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glut.h b/include/GL/glut.h index 20605cb358d..3b5cbb2f4cb 100644 --- a/include/GL/glut.h +++ b/include/GL/glut.h @@ -199,7 +199,7 @@ WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *); # define GLUTCALLBACK # define GLUTAPI extern /* Prototype exit for the non-Win32 case (see above). */ -extern void exit(int); +/*extern void exit(int); this screws up gcc -ansi -pedantic! */ #endif -- cgit v1.2.3 From 401fc936f1c368a34e285075efe4070017054a7f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Jun 2000 17:39:18 +0000 Subject: added extension numbers for Mesa extensions --- include/GL/glx.h | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 5af05ed1709..c2ae5d35b95 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.21 2000/06/08 22:50:24 brianp Exp $ */ +/* $Id: glx.h,v 1.22 2000/06/23 17:39:18 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -367,19 +367,20 @@ extern int glXQueryContextInfoEXT(Display *dpy, GLXContext context, /* - * ARB 2. GLX_ARB_get_proc_address + * 215. GLX_MESA_copy_sub_buffer */ -#ifndef GLX_ARB_get_proc_address -#define GLX_ARB_get_proc_address 1 +#ifndef GLX_MESA_copy_sub_buffer +#define GLX_MESA_copy_sub_buffer 1 -extern void (*glXGetProcAddressARB(const GLubyte *procName))(); +extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable, + int x, int y, int width, int height ); -#endif /* GLX_ARB_get_proc_address */ +#endif /* - * GLX_MESA_pixmap_colormap + * 216. GLX_MESA_pixmap_colormap */ #ifndef GLX_MESA_pixmap_colormap #define GLX_MESA_pixmap_colormap 1 @@ -392,7 +393,7 @@ extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual, /* - * GLX_MESA_release_buffers + * 217. GLX_MESA_release_buffers */ #ifndef GLX_MESA_release_buffers #define GLX_MESA_release_buffers 1 @@ -404,27 +405,29 @@ extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d ); /* - * GLX_MESA_copy_sub_buffer + * 218. GLX_MESA_set_3dfx_mode */ -#ifndef GLX_MESA_copy_sub_buffer -#define GLX_MESA_copy_sub_buffer 1 +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_MESA_set_3dfx_mode 1 -extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable, - int x, int y, int width, int height ); +#define GLX_3DFX_WINDOW_MODE_MESA 0x1 +#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 -#endif +extern GLboolean glXSet3DfxModeMESA( GLint mode ); + +#endif /* GLX_MESA_set_3dfx_mode */ /* - * GLX_MESA_set_3dfx_mode + * ARB 2. GLX_ARB_get_proc_address */ -#ifndef GLX_MESA_set_3dfx_mode -#define GLX_MESA_set_3dfx_mode 1 +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 -extern GLboolean glXSet3DfxModeMESA( GLint mode ); +extern void (*glXGetProcAddressARB(const GLubyte *procName))(); -#endif /* GLX_MESA_set_3dfx_mode */ +#endif /* GLX_ARB_get_proc_address */ -- cgit v1.2.3 From f88602394d7cc340cc850622308ce1cbbff332a5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 11 Jul 2000 14:11:04 +0000 Subject: reverted to old tessellator (GLU 1.1) --- include/GL/glu.h | 116 +- src/glu/mesa/Makefile.BeOS | 7 +- src/glu/mesa/Makefile.BeOS-R4 | 40 +- src/glu/mesa/Makefile.X11 | 11 +- src/glu/mesa/Makefile.m32 | 3 +- src/glu/mesa/all.h | 24 +- src/glu/mesa/glu.c | 294 ++--- src/glu/mesa/gluP.h | 51 +- src/glu/mesa/mipmap.c | 838 ++++++++------- src/glu/mesa/nurbs.c | 986 ++++++++--------- src/glu/mesa/nurbs.h | 374 +++---- src/glu/mesa/nurbscrv.c | 789 +++++++------- src/glu/mesa/nurbssrf.c | 2388 ++++++++++++++++++++--------------------- src/glu/mesa/nurbsutl.c | 2215 ++++++++++++++++++-------------------- src/glu/mesa/polytest.c | 938 ++++++++++++++++ src/glu/mesa/project.c | 525 +++++---- src/glu/mesa/quadric.c | 716 ++++++------ src/glu/mesa/tess.c | 1235 +++++---------------- src/glu/mesa/tess.h | 189 ++-- src/glu/mesa/tesselat.c | 407 +++++++ 20 files changed, 6206 insertions(+), 5940 deletions(-) create mode 100644 src/glu/mesa/polytest.c create mode 100644 src/glu/mesa/tesselat.c (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index c03f8cb9517..e2b92882768 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,10 +1,9 @@ -/* $Id: glu.h,v 1.21 2000/05/22 19:40:43 brianp Exp $ */ +/* $Id: glu.h,v 1.22 2000/07/11 14:11:44 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 3.3 - * - * Copyright (C) 1995-1999 Brian Paul + * Copyright (C) 1995-2000 Brian Paul * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -22,22 +21,23 @@ */ -#ifndef __glu_h__ -#define __glu_h__ +#ifndef GLU_H +#define GLU_H #if defined(USE_MGL_NAMESPACE) #include "glu_mangle.h" #endif -#include "GL/gl.h" - #ifdef __cplusplus extern "C" { #endif +#include + + /* to facilitate clean DLL building ... */ #if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__)) # if defined(_MSC_VER) && defined(BUILD_GLU32) /* tag specify we're building mesa as a DLL */ @@ -61,7 +61,6 @@ extern "C" { #endif - #ifdef macintosh #pragma enumsalwaysint on #if PRAGMA_IMPORT_SUPPORTED @@ -83,7 +82,7 @@ extern "C" { #define GLU_VERSION_1_1 1 -#define GLU_VERSION_1_2 1 + #define GLU_TRUE 1 @@ -215,8 +214,7 @@ extern "C" { #define GLU_EXTENSIONS 100801 - -/*** GLU 1.0 tessellation - obsolete! ***/ +/*** GLU 1.0 tessellation ***/ /* Contour types */ #define GLU_CW 100120 @@ -233,20 +231,26 @@ extern "C" { #define GLU_EDGE_FLAG GLU_TESS_EDGE_FLAG -/* - * These are the GLU 1.1 typedefs. GLU 1.3 has different ones! - */ + #if defined(__BEOS__) /* The BeOS does something funky and makes these typedefs in one * of its system headers. */ #else + +#if defined GLU_VERSION_1_2 typedef struct GLUquadric GLUquadricObj; typedef struct GLUnurbs GLUnurbsObj; - /* FIXME: We need to implement the other 1.3 typedefs - GH */ typedef struct GLUtesselator GLUtesselator; typedef GLUtesselator GLUtriangulatorObj; +#else + /* GLU 1.1 and older */ + typedef struct GLUquadric GLUquadricObj; + typedef struct GLUtriangulatorObj GLUtriangulatorObj; + typedef struct GLUnurbs GLUnurbsObj; +#endif + #endif @@ -306,17 +310,17 @@ GLUAPI const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode ); */ GLUAPI GLint GLAPIENTRY gluScaleImage( GLenum format, - GLint widthin, GLint heightin, + GLsizei widthin, GLsizei heightin, GLenum typein, const void *datain, - GLint widthout, GLint heightout, + GLsizei widthout, GLsizei heightout, GLenum typeout, void *dataout ); GLUAPI GLint GLAPIENTRY gluBuild1DMipmaps( GLenum target, GLint components, - GLint width, GLenum format, + GLsizei width, GLenum format, GLenum type, const void *data ); GLUAPI GLint GLAPIENTRY gluBuild2DMipmaps( GLenum target, GLint components, - GLint width, GLint height, + GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data ); @@ -355,14 +359,15 @@ GLUAPI void GLAPIENTRY gluCylinder( GLUquadricObj *qobj, GLint slices, GLint stacks ); GLUAPI void GLAPIENTRY gluSphere( GLUquadricObj *qobj, - GLdouble radius, GLint slices, - GLint stacks ); + GLdouble radius, + GLint slices, GLint stacks ); GLUAPI void GLAPIENTRY gluDisk( GLUquadricObj *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops ); -GLUAPI void GLAPIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius, +GLUAPI void GLAPIENTRY gluPartialDisk( GLUquadricObj *qobj, + GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops, GLdouble startAngle, GLdouble sweepAngle ); @@ -416,8 +421,8 @@ GLUAPI void GLAPIENTRY gluBeginTrim( GLUnurbsObj *nobj ); GLUAPI void GLAPIENTRY gluEndTrim( GLUnurbsObj *nobj ); GLUAPI void GLAPIENTRY gluPwlCurve( GLUnurbsObj *nobj, GLint count, - GLfloat *array, GLint stride, - GLenum type ); + GLfloat *array, + GLint stride, GLenum type ); GLUAPI void GLAPIENTRY gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, void (GLCALLBACK *fn)() ); @@ -430,6 +435,8 @@ GLUAPI void GLAPIENTRY gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, * */ +#ifdef GLU_VERSION_1_2 + GLUAPI GLUtesselator* GLAPIENTRY gluNewTess( void ); GLUAPI void GLAPIENTRY gluDeleteTess( GLUtesselator *tobj ); @@ -458,17 +465,26 @@ GLUAPI void GLAPIENTRY gluTessCallback( GLUtesselator *tobj, GLenum which, GLUAPI void GLAPIENTRY gluGetTessProperty( GLUtesselator *tobj, GLenum which, GLdouble *value ); -/* - * - * Obsolete 1.0 tessellation functions - * - */ +#else + +GLUAPI GLUtriangulatorObj* GLAPIENTRY gluNewTess( void ); -GLUAPI void GLAPIENTRY gluBeginPolygon( GLUtesselator *tobj ); +GLUAPI void GLAPIENTRY gluTessCallback( GLUtriangulatorObj *tobj, GLenum which, + void (GLCALLBACK *fn)() ); -GLUAPI void GLAPIENTRY gluNextContour( GLUtesselator *tobj, GLenum type ); +GLUAPI void GLAPIENTRY gluDeleteTess( GLUtriangulatorObj *tobj ); + +GLUAPI void GLAPIENTRY gluBeginPolygon( GLUtriangulatorObj *tobj ); + +GLUAPI void GLAPIENTRY gluEndPolygon( GLUtriangulatorObj *tobj ); + +GLUAPI void GLAPIENTRY gluNextContour( GLUtriangulatorObj *tobj, GLenum type ); + +GLUAPI void GLAPIENTRY gluTessVertex( GLUtriangulatorObj *tobj, GLdouble v[3], + void *data ); + +#endif -GLUAPI void GLAPIENTRY gluEndPolygon( GLUtesselator *tobj ); @@ -488,38 +504,12 @@ GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name ); * */ -GLUAPI GLboolean GLAPIENTRY -gluCheckExtension(const char *extName, const GLubyte *extString); - - -GLUAPI GLint GLAPIENTRY -gluBuild3DMipmaps( GLenum target, GLint internalFormat, GLsizei width, - GLsizei height, GLsizei depth, GLenum format, - GLenum type, const void *data ); - -GLUAPI GLint GLAPIENTRY -gluBuild1DMipmapLevels( GLenum target, GLint internalFormat, GLsizei width, - GLenum format, GLenum type, GLint level, GLint base, - GLint max, const void *data ); +#ifdef GLU_VERSION_1_3 -GLUAPI GLint GLAPIENTRY -gluBuild2DMipmapLevels( GLenum target, GLint internalFormat, GLsizei width, - GLsizei height, GLenum format, GLenum type, - GLint level, GLint base, GLint max, - const void *data ); - -GLUAPI GLint GLAPIENTRY -gluBuild3DMipmapLevels( GLenum target, GLint internalFormat, GLsizei width, - GLsizei height, GLsizei depth, GLenum format, - GLenum type, GLint level, GLint base, GLint max, - const void *data ); +GLUAPI GLboolean GLAPIENTRY +gluCheckExtension( const char *extName, const GLubyte *extString ); -GLUAPI GLint GLAPIENTRY -gluUnProject4( GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, - const GLdouble modelMatrix[16], const GLdouble projMatrix[16], - const GLint viewport[4], GLclampd zNear, GLclampd zFar, - GLdouble *objx, GLdouble *objy, GLdouble *objz, - GLdouble *objw ); +#endif @@ -541,4 +531,4 @@ gluUnProject4( GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, #endif -#endif /* __glu_h__ */ +#endif diff --git a/src/glu/mesa/Makefile.BeOS b/src/glu/mesa/Makefile.BeOS index e8851dea444..71624e392cb 100644 --- a/src/glu/mesa/Makefile.BeOS +++ b/src/glu/mesa/Makefile.BeOS @@ -2,8 +2,8 @@ # Tinic Uro <5uro@informatik.uni-hamburg.de> # Mesa 3-D graphics library -# Version: 2.6 -# Copyright (C) 1995-1997 Brian Paul +# Version: 3.3 +# Copyright (C) 1995-2000 Brian Paul # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -29,8 +29,7 @@ INCDIR = ../include LIBDIR = ../lib SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \ - project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c \ - tess_winding.c tess_clip.c + polytest.c project.c quadric.c tess.c tesselat.c OBJECTS = $(SOURCES:.c=.o) diff --git a/src/glu/mesa/Makefile.BeOS-R4 b/src/glu/mesa/Makefile.BeOS-R4 index ebe3a689d38..dcc58aaf540 100644 --- a/src/glu/mesa/Makefile.BeOS-R4 +++ b/src/glu/mesa/Makefile.BeOS-R4 @@ -1,8 +1,9 @@ +# $Id: Makefile.BeOS-R4,v 1.7 2000/07/11 14:11:04 brianp Exp $ # Makefile for GLU for BeOS R4 # Mesa 3-D graphics library -# Version: 3.1 -# Copyright (C) 1995-1999 Brian Paul +# Version: 3.3 +# Copyright (C) 1995-2000 Brian Paul # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -19,41 +20,11 @@ # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# $Id: Makefile.BeOS-R4,v 1.6 1999/12/06 09:39:34 gareth Exp $ - -# $Log: Makefile.BeOS-R4,v $ -# Revision 1.6 1999/12/06 09:39:34 gareth -# Merging in work from 3.1/3.2 branch. Tessellator is essentially fully -# functional now. -# -# Revision 1.5 1999/10/03 00:53:38 gareth -# Added tessellation winding rule files. -# -# Revision 1.4 1999/09/17 00:06:57 brianp -# version symbol changes -# -# Revision 1.3 1999/09/15 15:11:01 brianp -# added third, tiny version number to mklib scripts -# -# Revision 1.2 1999/09/10 02:03:31 gareth -# Added GLU 1.3 tessellation (except winding rule code). -# -# Revision 1.1.1.1 1999/08/19 00:55:42 jtg -# Imported sources -# -# Revision 1.2 1999/02/02 04:44:40 brianp -# fixed some problems -# -# Revision 1.1 1999/01/19 04:10:02 brianp -# Initial revision -# - - ##### MACROS ##### GLU_MAJOR = 1 -GLU_MINOR = 2 +GLU_MINOR = 1 GLU_TINY = $(MESA_MAJOR)$(MESA_MINOR)$(MESA_TINY) VPATH = RCS @@ -62,8 +33,7 @@ INCDIR = ../include LIBDIR = ../lib SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \ - project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c \ - tess_winding.c tess_clip.c + polytest.c project.c quadric.c tess.c tesselat.c OBJECTS = $(SOURCES:.c=.o) diff --git a/src/glu/mesa/Makefile.X11 b/src/glu/mesa/Makefile.X11 index 4373c8f2b4d..e8a4e18c428 100644 --- a/src/glu/mesa/Makefile.X11 +++ b/src/glu/mesa/Makefile.X11 @@ -1,8 +1,8 @@ -# $Id: Makefile.X11,v 1.7 1999/12/06 09:39:34 gareth Exp $ +# $Id: Makefile.X11,v 1.8 2000/07/11 14:11:04 brianp Exp $ # Mesa 3-D graphics library -# Version: 3.1 -# Copyright (C) 1995-1999 Brian Paul +# Version: 3.3 +# Copyright (C) 1995-2000 Brian Paul # Makefile for GLU library @@ -10,7 +10,7 @@ ##### MACROS ##### GLU_MAJOR = 1 -GLU_MINOR = 2 +GLU_MINOR = 1 GLU_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) VPATH = RCS @@ -19,8 +19,7 @@ INCDIR = ../include LIBDIR = ../lib SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \ - project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c \ - tess_winding.c tess_clip.c + polytest.c project.c quadric.c tess.c tesselat.c OBJECTS = $(SOURCES:.c=.o) diff --git a/src/glu/mesa/Makefile.m32 b/src/glu/mesa/Makefile.m32 index 6f1d8219a25..3e217ef5d52 100644 --- a/src/glu/mesa/Makefile.m32 +++ b/src/glu/mesa/Makefile.m32 @@ -43,8 +43,7 @@ INCDIR = ../include LIBDIR = ../lib SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \ - project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c \ - tess_winding.c tess_clip.c + polytest.c project.c quadric.c tess.c tesselat.c OBJECTS = $(SOURCES:.c=.o) diff --git a/src/glu/mesa/all.h b/src/glu/mesa/all.h index 3712ca884ab..427fc3898d5 100644 --- a/src/glu/mesa/all.h +++ b/src/glu/mesa/all.h @@ -1,9 +1,9 @@ -/* $Id: all.h,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ +/* $Id: all.h,v 1.2 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 2.3 - * Copyright (C) 1995-1997 Brian Paul + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -21,20 +21,6 @@ */ -/* - * $Log: all.h,v $ - * Revision 1.1 1999/08/19 00:55:42 jtg - * Initial revision - * - * Revision 1.2 1997/11/20 00:28:20 brianp - * changed PCH to PC_HEADER - * - * Revision 1.1 1997/05/28 02:29:14 brianp - * Initial revision - * - */ - - /* * This file includes all .h files needed for the GLU source code for * the purpose of precompiled headers. @@ -50,7 +36,7 @@ #ifndef PC_HEADER - This is an error. all.h should be included only if PCH is defined. +This is an error. all.h should be included only if PCH is defined. #endif @@ -66,4 +52,4 @@ #include "tess.h" -#endif /*GLU_ALL_H*/ +#endif /*GLU_ALL_H */ diff --git a/src/glu/mesa/glu.c b/src/glu/mesa/glu.c index 8ccacf5f7f1..11d1cd8675d 100644 --- a/src/glu/mesa/glu.c +++ b/src/glu/mesa/glu.c @@ -1,9 +1,9 @@ -/* $Id: glu.c,v 1.19 2000/01/07 07:22:48 brianp Exp $ */ +/* $Id: glu.c,v 1.20 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 3.3 - * Copyright (C) 1999-2000 Brian Paul + * Copyright (C) 1995-2000 Brian Paul * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -21,108 +21,6 @@ */ -/* - * $Log: glu.c,v $ - * Revision 1.19 2000/01/07 07:22:48 brianp - * updated version string - * - * Revision 1.18 1999/11/22 22:15:50 brianp - * removed GLU_EXT_get_proc_address from ext strings - * - * Revision 1.17 1999/11/19 21:23:37 brianp - * replace encounteed with encountered - * - * Revision 1.16 1999/10/27 09:47:41 brianp - * disabled gluGetProcAddressEXT - * - * Revision 1.15 1999/09/19 02:03:19 tjump - * More Win32 build compliance fixups - * - * Revision 1.14 1999/09/17 12:21:53 brianp - * glGetProcAddressEXT changes to accomodate Win32 and non-Win32 - * - * Revision 1.13 1999/09/17 03:17:18 tjump - * Patch error fixup - * - * Revision 1.12 1999/09/17 03:07:28 tjump - * Win32 build req't updates - * - * Revision 1.11 1999/09/17 01:00:38 brianp - * fixed typo - * - * Revision 1.10 1999/09/17 00:06:14 brianp - * gluGetProcAddressEXT change for C++ / BeOS - * - * Revision 1.9 1999/09/16 22:37:56 brianp - * added some casts in gluGetProcAddressEXT() - * - * Revision 1.8 1999/09/16 16:53:28 brianp - * clean-up of GLU_EXT_get_proc_address - * - * Revision 1.7 1999/09/14 00:11:40 brianp - * added gluCheckExtension() - * - * Revision 1.6 1999/09/13 14:31:32 joukj - * - * strcmp needs the string.h - * - * Revision 1.5 1999/09/11 12:04:54 brianp - * added 1.2 function to gluGetProcAddressEXT() - * - * Revision 1.4 1999/09/11 11:36:26 brianp - * added GLU_EXT_get_proc_address - * - * Revision 1.3 1999/09/10 04:32:10 gareth - * Fixed triangle output, recovery process termination. - * - * Revision 1.2 1999/09/10 02:03:31 gareth - * Added GLU 1.3 tessellation (except winding rule code). - * - * Revision 1.1.1.1 1999/08/19 00:55:42 jtg - * Imported sources - * - * Revision 1.13 1999/03/31 19:07:28 brianp - * added GL_EXT_abgr to extensions - * - * Revision 1.12 1999/02/06 06:12:41 brianp - * updated version string to 3.1 - * - * Revision 1.11 1999/01/03 03:23:15 brianp - * now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump) - * - * Revision 1.10 1998/04/22 00:35:50 brianp - * changed version to 3.0 - * - * Revision 1.9 1997/12/09 03:03:32 brianp - * changed version to 2.6 - * - * Revision 1.8 1997/10/04 01:30:20 brianp - * changed version to 2.5 - * - * Revision 1.7 1997/08/13 01:25:21 brianp - * changed version string to 2.4 - * - * Revision 1.6 1997/07/24 01:28:44 brianp - * changed precompiled header symbol from PCH to PC_HEADER - * - * Revision 1.5 1997/07/13 22:59:11 brianp - * added const to viewport parameter of gluPickMatrix() - * - * Revision 1.4 1997/05/28 02:29:38 brianp - * added support for precompiled headers (PCH), inserted APIENTRY keyword - * - * Revision 1.3 1997/04/12 16:19:02 brianp - * changed version to 2.3 - * - * Revision 1.2 1997/03/11 00:58:34 brianp - * changed version to 2.2 - * - * Revision 1.1 1996/09/27 01:19:39 brianp - * Initial revision - * - */ - - #ifdef PC_HEADER #include "all.h" #else @@ -148,9 +46,10 @@ -void GLAPIENTRY gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez, - GLdouble centerx, GLdouble centery, GLdouble centerz, - GLdouble upx, GLdouble upy, GLdouble upz ) +void GLAPIENTRY +gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, + GLdouble centerx, GLdouble centery, GLdouble centerz, + GLdouble upx, GLdouble upy, GLdouble upz) { GLdouble m[16]; GLdouble x[3], y[3], z[3]; @@ -162,8 +61,8 @@ void GLAPIENTRY gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez, z[0] = eyex - centerx; z[1] = eyey - centery; z[2] = eyez - centerz; - mag = sqrt( z[0]*z[0] + z[1]*z[1] + z[2]*z[2] ); - if (mag) { /* mpichler, 19950515 */ + mag = sqrt(z[0] * z[0] + z[1] * z[1] + z[2] * z[2]); + if (mag) { /* mpichler, 19950515 */ z[0] /= mag; z[1] /= mag; z[2] /= mag; @@ -175,28 +74,28 @@ void GLAPIENTRY gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez, y[2] = upz; /* X vector = Y cross Z */ - x[0] = y[1]*z[2] - y[2]*z[1]; - x[1] = -y[0]*z[2] + y[2]*z[0]; - x[2] = y[0]*z[1] - y[1]*z[0]; + x[0] = y[1] * z[2] - y[2] * z[1]; + x[1] = -y[0] * z[2] + y[2] * z[0]; + x[2] = y[0] * z[1] - y[1] * z[0]; /* Recompute Y = Z cross X */ - y[0] = z[1]*x[2] - z[2]*x[1]; - y[1] = -z[0]*x[2] + z[2]*x[0]; - y[2] = z[0]*x[1] - z[1]*x[0]; + y[0] = z[1] * x[2] - z[2] * x[1]; + y[1] = -z[0] * x[2] + z[2] * x[0]; + y[2] = z[0] * x[1] - z[1] * x[0]; /* mpichler, 19950515 */ /* cross product gives area of parallelogram, which is < 1.0 for * non-perpendicular unit-length vectors; so normalize x, y here */ - mag = sqrt( x[0]*x[0] + x[1]*x[1] + x[2]*x[2] ); + mag = sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]); if (mag) { x[0] /= mag; x[1] /= mag; x[2] /= mag; } - mag = sqrt( y[0]*y[0] + y[1]*y[1] + y[2]*y[2] ); + mag = sqrt(y[0] * y[0] + y[1] * y[1] + y[2] * y[2]); if (mag) { y[0] /= mag; y[1] /= mag; @@ -204,47 +103,59 @@ void GLAPIENTRY gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez, } #define M(row,col) m[col*4+row] - M(0,0) = x[0]; M(0,1) = x[1]; M(0,2) = x[2]; M(0,3) = 0.0; - M(1,0) = y[0]; M(1,1) = y[1]; M(1,2) = y[2]; M(1,3) = 0.0; - M(2,0) = z[0]; M(2,1) = z[1]; M(2,2) = z[2]; M(2,3) = 0.0; - M(3,0) = 0.0; M(3,1) = 0.0; M(3,2) = 0.0; M(3,3) = 1.0; + M(0, 0) = x[0]; + M(0, 1) = x[1]; + M(0, 2) = x[2]; + M(0, 3) = 0.0; + M(1, 0) = y[0]; + M(1, 1) = y[1]; + M(1, 2) = y[2]; + M(1, 3) = 0.0; + M(2, 0) = z[0]; + M(2, 1) = z[1]; + M(2, 2) = z[2]; + M(2, 3) = 0.0; + M(3, 0) = 0.0; + M(3, 1) = 0.0; + M(3, 2) = 0.0; + M(3, 3) = 1.0; #undef M - glMultMatrixd( m ); + glMultMatrixd(m); /* Translate Eye to Origin */ - glTranslated( -eyex, -eyey, -eyez ); + glTranslated(-eyex, -eyey, -eyez); } -void GLAPIENTRY gluOrtho2D( GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top ) +void GLAPIENTRY +gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top) { - glOrtho( left, right, bottom, top, -1.0, 1.0 ); + glOrtho(left, right, bottom, top, -1.0, 1.0); } -void GLAPIENTRY gluPerspective( GLdouble fovy, GLdouble aspect, - GLdouble zNear, GLdouble zFar ) +void GLAPIENTRY +gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar) { GLdouble xmin, xmax, ymin, ymax; - ymax = zNear * tan( fovy * M_PI / 360.0 ); + ymax = zNear * tan(fovy * M_PI / 360.0); ymin = -ymax; xmin = ymin * aspect; xmax = ymax * aspect; - glFrustum( xmin, xmax, ymin, ymax, zNear, zFar ); + glFrustum(xmin, xmax, ymin, ymax, zNear, zFar); } -void GLAPIENTRY gluPickMatrix( GLdouble x, GLdouble y, - GLdouble width, GLdouble height, - const GLint viewport[4] ) +void GLAPIENTRY +gluPickMatrix(GLdouble x, GLdouble y, + GLdouble width, GLdouble height, const GLint viewport[4]) { GLfloat m[16]; GLfloat sx, sy; @@ -256,18 +167,31 @@ void GLAPIENTRY gluPickMatrix( GLdouble x, GLdouble y, ty = (viewport[3] + 2.0 * (viewport[1] - y)) / height; #define M(row,col) m[col*4+row] - M(0,0) = sx; M(0,1) = 0.0; M(0,2) = 0.0; M(0,3) = tx; - M(1,0) = 0.0; M(1,1) = sy; M(1,2) = 0.0; M(1,3) = ty; - M(2,0) = 0.0; M(2,1) = 0.0; M(2,2) = 1.0; M(2,3) = 0.0; - M(3,0) = 0.0; M(3,1) = 0.0; M(3,2) = 0.0; M(3,3) = 1.0; + M(0, 0) = sx; + M(0, 1) = 0.0; + M(0, 2) = 0.0; + M(0, 3) = tx; + M(1, 0) = 0.0; + M(1, 1) = sy; + M(1, 2) = 0.0; + M(1, 3) = ty; + M(2, 0) = 0.0; + M(2, 1) = 0.0; + M(2, 2) = 1.0; + M(2, 3) = 0.0; + M(3, 0) = 0.0; + M(3, 1) = 0.0; + M(3, 2) = 0.0; + M(3, 3) = 1.0; #undef M - glMultMatrixf( m ); + glMultMatrixf(m); } -const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode ) +const GLubyte *GLAPIENTRY +gluErrorString(GLenum errorCode) { static char *tess_error[] = { "missing gluBeginPolygon", @@ -320,48 +244,48 @@ const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode ) }; /* GL Errors */ - if (errorCode==GL_NO_ERROR) { + if (errorCode == GL_NO_ERROR) { return (GLubyte *) "no error"; } - else if (errorCode==GL_INVALID_VALUE) { + else if (errorCode == GL_INVALID_VALUE) { return (GLubyte *) "invalid value"; } - else if (errorCode==GL_INVALID_ENUM) { + else if (errorCode == GL_INVALID_ENUM) { return (GLubyte *) "invalid enum"; } - else if (errorCode==GL_INVALID_OPERATION) { + else if (errorCode == GL_INVALID_OPERATION) { return (GLubyte *) "invalid operation"; } - else if (errorCode==GL_STACK_OVERFLOW) { + else if (errorCode == GL_STACK_OVERFLOW) { return (GLubyte *) "stack overflow"; } - else if (errorCode==GL_STACK_UNDERFLOW) { + else if (errorCode == GL_STACK_UNDERFLOW) { return (GLubyte *) "stack underflow"; } - else if (errorCode==GL_OUT_OF_MEMORY) { + else if (errorCode == GL_OUT_OF_MEMORY) { return (GLubyte *) "out of memory"; } /* GLU Errors */ - else if (errorCode==GLU_NO_ERROR) { + else if (errorCode == GLU_NO_ERROR) { return (GLubyte *) "no error"; } - else if (errorCode==GLU_INVALID_ENUM) { + else if (errorCode == GLU_INVALID_ENUM) { return (GLubyte *) "invalid enum"; } - else if (errorCode==GLU_INVALID_VALUE) { + else if (errorCode == GLU_INVALID_VALUE) { return (GLubyte *) "invalid value"; } - else if (errorCode==GLU_OUT_OF_MEMORY) { + else if (errorCode == GLU_OUT_OF_MEMORY) { return (GLubyte *) "out of memory"; } - else if (errorCode==GLU_INCOMPATIBLE_GL_VERSION) { + else if (errorCode == GLU_INCOMPATIBLE_GL_VERSION) { return (GLubyte *) "incompatible GL version"; } - else if (errorCode>=GLU_TESS_ERROR1 && errorCode<=GLU_TESS_ERROR8) { - return (GLubyte *) tess_error[errorCode-GLU_TESS_ERROR1]; + else if (errorCode >= GLU_TESS_ERROR1 && errorCode <= GLU_TESS_ERROR8) { + return (GLubyte *) tess_error[errorCode - GLU_TESS_ERROR1]; } - else if (errorCode>=GLU_NURBS_ERROR1 && errorCode<=GLU_NURBS_ERROR37) { - return (GLubyte *) nurbs_error[errorCode-GLU_NURBS_ERROR1]; + else if (errorCode >= GLU_NURBS_ERROR1 && errorCode <= GLU_NURBS_ERROR37) { + return (GLubyte *) nurbs_error[errorCode - GLU_NURBS_ERROR1]; } else { return NULL; @@ -374,58 +298,60 @@ const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode ) * New in GLU 1.1 */ -const GLubyte* GLAPIENTRY gluGetString( GLenum name ) +const GLubyte *GLAPIENTRY +gluGetString(GLenum name) { static char *extensions = "GL_EXT_abgr"; - static char *version = "1.2 Mesa 3.3 beta"; + static char *version = "1.1 Mesa 3.2.1"; switch (name) { - case GLU_EXTENSIONS: - return (GLubyte *) extensions; - case GLU_VERSION: - return (GLubyte *) version; - default: - return NULL; + case GLU_EXTENSIONS: + return (GLubyte *) extensions; + case GLU_VERSION: + return (GLubyte *) version; + default: + return NULL; } } -#if 0 /* gluGetProcAddressEXT not finalized yet! */ +#if 0 /* gluGetProcAddressEXT not finalized yet! */ #ifdef __cplusplus /* for BeOS R4.5 */ - void GLAPIENTRY (*gluGetProcAddressEXT(const GLubyte *procName))(...) +void GLAPIENTRY(*gluGetProcAddressEXT(const GLubyte * procName)) (...) #else - void (GLAPIENTRY *gluGetProcAddressEXT(const GLubyte *procName))() +void (GLAPIENTRY * gluGetProcAddressEXT(const GLubyte * procName)) () #endif { - struct proc { + struct proc + { const char *name; void *address; }; static struct proc procTable[] = { - { "gluGetProcAddressEXT", (void *) gluGetProcAddressEXT }, /* me! */ + {"gluGetProcAddressEXT", (void *) gluGetProcAddressEXT}, /* me! */ /* new 1.1 functions */ - { "gluGetString", (void *) gluGetString }, + {"gluGetString", (void *) gluGetString}, /* new 1.2 functions */ - { "gluTessBeginPolygon", (void *) gluTessBeginPolygon }, - { "gluTessBeginContour", (void *) gluTessBeginContour }, - { "gluTessEndContour", (void *) gluTessEndContour }, - { "gluTessEndPolygon", (void *) gluTessEndPolygon }, - { "gluGetTessProperty", (void *) gluGetTessProperty }, + {"gluTessBeginPolygon", (void *) gluTessBeginPolygon}, + {"gluTessBeginContour", (void *) gluTessBeginContour}, + {"gluTessEndContour", (void *) gluTessEndContour}, + {"gluTessEndPolygon", (void *) gluTessEndPolygon}, + {"gluGetTessProperty", (void *) gluGetTessProperty}, /* new 1.3 functions */ - { NULL, NULL } + {NULL, NULL} }; GLuint i; for (i = 0; procTable[i].address; i++) { if (strcmp((const char *) procName, procTable[i].name) == 0) - return (void (GLAPIENTRY *)()) procTable[i].address; + return (void (GLAPIENTRY *) ()) procTable[i].address; } return NULL; @@ -438,8 +364,9 @@ const GLubyte* GLAPIENTRY gluGetString( GLenum name ) /* * New in GLU 1.3 */ +#ifdef GLU_VERSION_1_3 GLboolean GLAPIENTRY -gluCheckExtension( const char *extName, const GLubyte *extString ) +gluCheckExtension(const char *extName, const GLubyte * extString) { assert(extName); assert(extString); @@ -448,14 +375,15 @@ gluCheckExtension( const char *extName, const GLubyte *extString ) const char *start = (const char *) extString; while (1) { - const char *c = strstr( start, extName ); - if (!c) - return GL_FALSE; + const char *c = strstr(start, extName); + if (!c) + return GL_FALSE; - if ((c == start || c[-1] == ' ') && (c[len] == ' ' || c[len] == 0)) - return GL_TRUE; + if ((c == start || c[-1] == ' ') && (c[len] == ' ' || c[len] == 0)) + return GL_TRUE; - start = c + len; + start = c + len; } } } +#endif diff --git a/src/glu/mesa/gluP.h b/src/glu/mesa/gluP.h index 89bfa9c92cd..7d0ec3c84d7 100644 --- a/src/glu/mesa/gluP.h +++ b/src/glu/mesa/gluP.h @@ -1,9 +1,9 @@ -/* $Id: gluP.h,v 1.4 2000/05/22 19:41:11 brianp Exp $ */ +/* $Id: gluP.h,v 1.5 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 - * Copyright (C) 1995-1999 Brian Paul + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -21,43 +21,6 @@ */ -/* - * $Log: gluP.h,v $ - * Revision 1.4 2000/05/22 19:41:11 brianp - * replaced __CYGWIN32__ with __CYGWIN__ - * - * Revision 1.3 2000/05/22 16:25:37 brianp - * added some Window-isms formerly in gl.h - * - * Revision 1.2 1999/12/07 09:02:12 joukj - * - * Committing in . - * - * Make supportupdate for VMS - * - * Modified Files: - * Mesa/src-glu/descrip.mms Mesa/src-glu/gluP.h - * ---------------------------------------------------------------------- - * - * Revision 1.1.1.1 1999/08/19 00:55:42 jtg - * Imported sources - * - * Revision 1.4 1999/01/03 03:23:15 brianp - * now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump) - * - * Revision 1.3 1997/08/01 22:25:27 brianp - * check for Cygnus Win32 (Stephen Rehel) - * - * Revision 1.2 1997/05/27 02:59:46 brianp - * added defines for APIENTRY and CALLBACK if not compiling on Win32 - * - * Revision 1.1 1996/09/27 01:19:39 brianp - * Initial revision - * - */ - - - /* * This file allows the GLU code to be compiled either with the Mesa * headers or with the real OpenGL headers. @@ -68,12 +31,11 @@ #define GLUP_H -#include "GL/gl.h" -#include "GL/glu.h" +#include +#include #include - #if defined(_WIN32) && !defined(__WIN32__) # define __WIN32__ #endif @@ -153,8 +115,7 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC - -#ifndef MESA +#ifndef GLU_TESS_ERROR9 /* If we're using the real OpenGL header files... */ # define GLU_TESS_ERROR9 100159 #endif diff --git a/src/glu/mesa/mipmap.c b/src/glu/mesa/mipmap.c index f1c6d9ce761..e5efc6240f5 100644 --- a/src/glu/mesa/mipmap.c +++ b/src/glu/mesa/mipmap.c @@ -1,4 +1,4 @@ -/* $Id: mipmap.c,v 1.6 2000/06/05 16:27:41 brianp Exp $ */ +/* $Id: mipmap.c,v 1.7 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -47,18 +47,21 @@ /* To work around optimizer bug in MSVC4.1 */ #if defined(__WIN32__) && !defined(OPENSTEP) -void dummy(GLuint j, GLuint k){ +void +dummy(GLuint j, GLuint k) +{ } #else #define dummy(J, K) #endif -GLint GLAPIENTRY gluScaleImage( GLenum format, - GLsizei widthin, GLsizei heightin, - GLenum typein, const void *datain, - GLsizei widthout, GLsizei heightout, - GLenum typeout, void *dataout ) +GLint GLAPIENTRY +gluScaleImage(GLenum format, + GLsizei widthin, GLsizei heightin, + GLenum typein, const void *datain, + GLsizei widthout, GLsizei heightout, + GLenum typeout, void *dataout) { GLint components, i, j, k; GLfloat *tempin, *tempout; @@ -71,84 +74,112 @@ GLint GLAPIENTRY gluScaleImage( GLenum format, /* Determine number of components per pixel */ switch (format) { - case GL_COLOR_INDEX: - case GL_STENCIL_INDEX: - case GL_DEPTH_COMPONENT: - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - components = 1; - break; - case GL_LUMINANCE_ALPHA: - components = 2; - break; - case GL_RGB: - case GL_BGR: - components = 3; - break; - case GL_RGBA: - case GL_BGRA: + case GL_COLOR_INDEX: + case GL_STENCIL_INDEX: + case GL_DEPTH_COMPONENT: + case GL_RED: + case GL_GREEN: + case GL_BLUE: + case GL_ALPHA: + case GL_LUMINANCE: + components = 1; + break; + case GL_LUMINANCE_ALPHA: + components = 2; + break; + case GL_RGB: + case GL_BGR: + components = 3; + break; + case GL_RGBA: + case GL_BGRA: #ifdef GL_EXT_abgr - case GL_ABGR_EXT: + case GL_ABGR_EXT: #endif - components = 4; - break; - default: - return GLU_INVALID_ENUM; + components = 4; + break; + default: + return GLU_INVALID_ENUM; } /* Determine bytes per input datum */ switch (typein) { - case GL_UNSIGNED_BYTE: sizein = sizeof(GLubyte); break; - case GL_BYTE: sizein = sizeof(GLbyte); break; - case GL_UNSIGNED_SHORT: sizein = sizeof(GLushort); break; - case GL_SHORT: sizein = sizeof(GLshort); break; - case GL_UNSIGNED_INT: sizein = sizeof(GLuint); break; - case GL_INT: sizein = sizeof(GLint); break; - case GL_FLOAT: sizein = sizeof(GLfloat); break; - case GL_BITMAP: - /* not implemented yet */ - default: - return GL_INVALID_ENUM; + case GL_UNSIGNED_BYTE: + sizein = sizeof(GLubyte); + break; + case GL_BYTE: + sizein = sizeof(GLbyte); + break; + case GL_UNSIGNED_SHORT: + sizein = sizeof(GLushort); + break; + case GL_SHORT: + sizein = sizeof(GLshort); + break; + case GL_UNSIGNED_INT: + sizein = sizeof(GLuint); + break; + case GL_INT: + sizein = sizeof(GLint); + break; + case GL_FLOAT: + sizein = sizeof(GLfloat); + break; + case GL_BITMAP: + /* not implemented yet */ + default: + return GL_INVALID_ENUM; } /* Determine bytes per output datum */ switch (typeout) { - case GL_UNSIGNED_BYTE: sizeout = sizeof(GLubyte); break; - case GL_BYTE: sizeout = sizeof(GLbyte); break; - case GL_UNSIGNED_SHORT: sizeout = sizeof(GLushort); break; - case GL_SHORT: sizeout = sizeof(GLshort); break; - case GL_UNSIGNED_INT: sizeout = sizeof(GLuint); break; - case GL_INT: sizeout = sizeof(GLint); break; - case GL_FLOAT: sizeout = sizeof(GLfloat); break; - case GL_BITMAP: - /* not implemented yet */ - default: - return GL_INVALID_ENUM; + case GL_UNSIGNED_BYTE: + sizeout = sizeof(GLubyte); + break; + case GL_BYTE: + sizeout = sizeof(GLbyte); + break; + case GL_UNSIGNED_SHORT: + sizeout = sizeof(GLushort); + break; + case GL_SHORT: + sizeout = sizeof(GLshort); + break; + case GL_UNSIGNED_INT: + sizeout = sizeof(GLuint); + break; + case GL_INT: + sizeout = sizeof(GLint); + break; + case GL_FLOAT: + sizeout = sizeof(GLfloat); + break; + case GL_BITMAP: + /* not implemented yet */ + default: + return GL_INVALID_ENUM; } /* Get glPixelStore state */ - glGetIntegerv( GL_UNPACK_ROW_LENGTH, &unpackrowlength ); - glGetIntegerv( GL_UNPACK_ALIGNMENT, &unpackalignment ); - glGetIntegerv( GL_UNPACK_SKIP_ROWS, &unpackskiprows ); - glGetIntegerv( GL_UNPACK_SKIP_PIXELS, &unpackskippixels ); - glGetIntegerv( GL_PACK_ROW_LENGTH, &packrowlength ); - glGetIntegerv( GL_PACK_ALIGNMENT, &packalignment ); - glGetIntegerv( GL_PACK_SKIP_ROWS, &packskiprows ); - glGetIntegerv( GL_PACK_SKIP_PIXELS, &packskippixels ); + glGetIntegerv(GL_UNPACK_ROW_LENGTH, &unpackrowlength); + glGetIntegerv(GL_UNPACK_ALIGNMENT, &unpackalignment); + glGetIntegerv(GL_UNPACK_SKIP_ROWS, &unpackskiprows); + glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &unpackskippixels); + glGetIntegerv(GL_PACK_ROW_LENGTH, &packrowlength); + glGetIntegerv(GL_PACK_ALIGNMENT, &packalignment); + glGetIntegerv(GL_PACK_SKIP_ROWS, &packskiprows); + glGetIntegerv(GL_PACK_SKIP_PIXELS, &packskippixels); /* Allocate storage for intermediate images */ - tempin = (GLfloat *) malloc( widthin * heightin - * components * sizeof(GLfloat) ); + tempin = (GLfloat *) malloc(widthin * heightin + * components * sizeof(GLfloat)); if (!tempin) { return GLU_OUT_OF_MEMORY; } - tempout = (GLfloat *) malloc( widthout * heightout - * components * sizeof(GLfloat) ); + tempout = (GLfloat *) malloc(widthout * heightout + * components * sizeof(GLfloat)); if (!tempout) { - free( tempin ); + free(tempin); return GLU_OUT_OF_MEMORY; } @@ -157,7 +188,7 @@ GLint GLAPIENTRY gluScaleImage( GLenum format, * Unpack the pixel data and convert to floating point */ - if (unpackrowlength>0) { + if (unpackrowlength > 0) { rowlen = unpackrowlength; } else { @@ -167,104 +198,97 @@ GLint GLAPIENTRY gluScaleImage( GLenum format, rowstride = components * rowlen; } else { - rowstride = unpackalignment/sizein - * CEILING( components * rowlen * sizein, unpackalignment ); + rowstride = unpackalignment / sizein + * CEILING(components * rowlen * sizein, unpackalignment); } switch (typein) { - case GL_UNSIGNED_BYTE: - k = 0; - for (i=0;i 1) - sx = (GLfloat) (widthin-1) / (GLfloat) (widthout-1); + sx = (GLfloat) (widthin - 1) / (GLfloat) (widthout - 1); else - sx = (GLfloat) (widthin-1); + sx = (GLfloat) (widthin - 1); if (heightout > 1) - sy = (GLfloat) (heightin-1) / (GLfloat) (heightout-1); + sy = (GLfloat) (heightin - 1) / (GLfloat) (heightout - 1); else - sy = (GLfloat) (heightin-1); + sy = (GLfloat) (heightin - 1); /*#define POINT_SAMPLE*/ #ifdef POINT_SAMPLE - for (i=0;i= heightin) i1 = heightin-1; + if (i1 >= heightin) + i1 = heightin - 1; /* i1 = (i+1) * sy - EPSILON;*/ - alpha = i*sy - i0; - for (j=0;j= widthin) j1 = widthin-1; + if (j1 >= widthin) + j1 = widthin - 1; /* j1 = (j+1) * sx - EPSILON; */ - beta = j*sx - j0; + beta = j * sx - j0; /* compute weighted average of pixels in rect (i0,j0)-(i1,j1) */ src00 = tempin + (i0 * widthin + j0) * components; @@ -326,10 +352,10 @@ GLint GLAPIENTRY gluScaleImage( GLenum format, dst = tempout + (i * widthout + j) * components; - for (k=0;k= heightin) i1 = heightin-1; + if (i1 >= heightin) + i1 = heightin - 1; /* i1 = (i+1) * sy - EPSILON; */ - for (j=0;j= widthin) j1 = widthin-1; + if (j1 >= widthin) + j1 = widthin - 1; /* j1 = (j+1) * sx - EPSILON; */ dst = tempout + (i * widthout + j) * components; /* compute average of pixels in the rectangle (i0,j0)-(i1,j1) */ - for (k=0;k0) { + if (packrowlength > 0) { rowlen = packrowlength; } else { @@ -385,110 +413,103 @@ GLint GLAPIENTRY gluScaleImage( GLenum format, rowstride = components * rowlen; } else { - rowstride = packalignment/sizeout - * CEILING( components * rowlen * sizeout, packalignment ); + rowstride = packalignment / sizeout + * CEILING(components * rowlen * sizeout, packalignment); } switch (typeout) { - case GL_UNSIGNED_BYTE: - k = 0; - for (i=0;i>=1; k++) ; + if (n <= 0) + return 0; + for (k = 0; n >>= 1; k++); return k; } @@ -512,19 +535,19 @@ static GLint ilog2( GLint n ) /* * Find the value nearest to n which is also a power of two. */ -static GLint round2( GLint n ) +static GLint +round2(GLint n) { GLint m; - for (m=1; m=n */ - if (m-n <= n-m/2) { + if (m - n <= n - m / 2) { return m; } else { - return m/2; + return m / 2; } } @@ -533,48 +556,66 @@ static GLint round2( GLint n ) * Given an pixel format and datatype, return the number of bytes to * store one pixel. */ -static GLint bytes_per_pixel( GLenum format, GLenum type ) +static GLint +bytes_per_pixel(GLenum format, GLenum type) { GLint n, m; switch (format) { - case GL_COLOR_INDEX: - case GL_STENCIL_INDEX: - case GL_DEPTH_COMPONENT: - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - n = 1; - break; - case GL_LUMINANCE_ALPHA: - n = 2; - break; - case GL_RGB: - n = 3; - break; - case GL_RGBA: - case GL_BGRA: + case GL_COLOR_INDEX: + case GL_STENCIL_INDEX: + case GL_DEPTH_COMPONENT: + case GL_RED: + case GL_GREEN: + case GL_BLUE: + case GL_ALPHA: + case GL_LUMINANCE: + n = 1; + break; + case GL_LUMINANCE_ALPHA: + n = 2; + break; + case GL_RGB: + n = 3; + break; + case GL_RGBA: + case GL_BGRA: #ifdef GL_EXT_abgr - case GL_ABGR_EXT: + case GL_ABGR_EXT: #endif - n = 4; - break; - default: - n = 0; + n = 4; + break; + default: + n = 0; } switch (type) { - case GL_UNSIGNED_BYTE: m = sizeof(GLubyte); break; - case GL_BYTE: m = sizeof(GLbyte); break; - case GL_BITMAP: m = 1; break; - case GL_UNSIGNED_SHORT: m = sizeof(GLushort); break; - case GL_SHORT: m = sizeof(GLshort); break; - case GL_UNSIGNED_INT: m = sizeof(GLuint); break; - case GL_INT: m = sizeof(GLint); break; - case GL_FLOAT: m = sizeof(GLfloat); break; - default: m = 0; + case GL_UNSIGNED_BYTE: + m = sizeof(GLubyte); + break; + case GL_BYTE: + m = sizeof(GLbyte); + break; + case GL_BITMAP: + m = 1; + break; + case GL_UNSIGNED_SHORT: + m = sizeof(GLushort); + break; + case GL_SHORT: + m = sizeof(GLshort); + break; + case GL_UNSIGNED_INT: + m = sizeof(GLuint); + break; + case GL_INT: + m = sizeof(GLint); + break; + case GL_FLOAT: + m = sizeof(GLfloat); + break; + default: + m = 0; } return n * m; @@ -585,9 +626,9 @@ static GLint bytes_per_pixel( GLenum format, GLenum type ) /* * WARNING: This function isn't finished and has never been tested!!!! */ -GLint GLAPIENTRY gluBuild1DMipmaps( GLenum target, GLint components, - GLsizei width, GLenum format, - GLenum type, const void *data ) +GLint GLAPIENTRY +gluBuild1DMipmaps(GLenum target, GLint components, + GLsizei width, GLenum format, GLenum type, const void *data) { GLubyte *texture; GLint levels, max_levels; @@ -597,18 +638,18 @@ GLint GLAPIENTRY gluBuild1DMipmaps( GLenum target, GLint components, if (width < 1) return GLU_INVALID_VALUE; - glGetIntegerv( GL_MAX_TEXTURE_SIZE, &max_width ); - max_levels = ilog2( max_width ) + 1; + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_width); + max_levels = ilog2(max_width) + 1; /* Compute how many mipmap images to make */ - levels = ilog2( width ) + 1; - if (levels>max_levels) { + levels = ilog2(width) + 1; + if (levels > max_levels) { levels = max_levels; } - new_width = 1 << (levels-1); + new_width = 1 << (levels - 1); - texture = (GLubyte *) malloc( new_width * components ); + texture = (GLubyte *) malloc(new_width * components); if (!texture) { return GLU_OUT_OF_MEMORY; } @@ -616,50 +657,51 @@ GLint GLAPIENTRY gluBuild1DMipmaps( GLenum target, GLint components, if (width != new_width) { /* initial rescaling */ switch (type) { - case GL_UNSIGNED_BYTE: - { - GLubyte *ub_data = (GLubyte *) data; - for (i=0;imaxsize) { + w = round2(width); + if (w > maxsize) { w = maxsize; } - h = round2( height ); - if (h>maxsize) { + h = round2(height); + if (h > maxsize) { h = maxsize; } - bpp = bytes_per_pixel( format, type ); - if (bpp==0) { + bpp = bytes_per_pixel(format, type); + if (bpp == 0) { /* probably a bad format or type enum */ return GLU_INVALID_ENUM; } /* Get current glPixelStore values */ - glGetIntegerv( GL_UNPACK_ROW_LENGTH, &unpackrowlength ); - glGetIntegerv( GL_UNPACK_ALIGNMENT, &unpackalignment ); - glGetIntegerv( GL_UNPACK_SKIP_ROWS, &unpackskiprows ); - glGetIntegerv( GL_UNPACK_SKIP_PIXELS, &unpackskippixels ); - glGetIntegerv( GL_PACK_ROW_LENGTH, &packrowlength ); - glGetIntegerv( GL_PACK_ALIGNMENT, &packalignment ); - glGetIntegerv( GL_PACK_SKIP_ROWS, &packskiprows ); - glGetIntegerv( GL_PACK_SKIP_PIXELS, &packskippixels ); + glGetIntegerv(GL_UNPACK_ROW_LENGTH, &unpackrowlength); + glGetIntegerv(GL_UNPACK_ALIGNMENT, &unpackalignment); + glGetIntegerv(GL_UNPACK_SKIP_ROWS, &unpackskiprows); + glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &unpackskippixels); + glGetIntegerv(GL_PACK_ROW_LENGTH, &packrowlength); + glGetIntegerv(GL_PACK_ALIGNMENT, &packalignment); + glGetIntegerv(GL_PACK_SKIP_ROWS, &packskiprows); + glGetIntegerv(GL_PACK_SKIP_PIXELS, &packskippixels); /* set pixel packing */ - glPixelStorei( GL_PACK_ROW_LENGTH, 0 ); - glPixelStorei( GL_PACK_ALIGNMENT, 1 ); - glPixelStorei( GL_PACK_SKIP_ROWS, 0 ); - glPixelStorei( GL_PACK_SKIP_PIXELS, 0 ); + glPixelStorei(GL_PACK_ROW_LENGTH, 0); + glPixelStorei(GL_PACK_ALIGNMENT, 1); + glPixelStorei(GL_PACK_SKIP_ROWS, 0); + glPixelStorei(GL_PACK_SKIP_PIXELS, 0); done = GL_FALSE; - if (w!=width || h!=height) { + if (w != width || h != height) { /* must rescale image to get "top" mipmap texture image */ - image = malloc( (w+4) * h * bpp ); + image = malloc((w + 4) * h * bpp); if (!image) { return GLU_OUT_OF_MEMORY; } - error = gluScaleImage( format, width, height, type, data, - w, h, type, image ); + error = gluScaleImage(format, width, height, type, data, + w, h, type, image); if (error) { - retval = error; - done = GL_TRUE; + retval = error; + done = GL_TRUE; } } else { @@ -728,33 +770,34 @@ GLint GLAPIENTRY gluBuild2DMipmaps( GLenum target, GLint components, level = 0; while (!done) { if (image != data) { - /* set pixel unpacking */ - glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 ); - glPixelStorei( GL_UNPACK_ALIGNMENT, 1 ); - glPixelStorei( GL_UNPACK_SKIP_ROWS, 0 ); - glPixelStorei( GL_UNPACK_SKIP_PIXELS, 0 ); + /* set pixel unpacking */ + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); } - glTexImage2D( target, level, components, w, h, 0, format, type, image ); + glTexImage2D(target, level, components, w, h, 0, format, type, image); - if (w==1 && h==1) break; + if (w == 1 && h == 1) + break; - neww = (w<2) ? 1 : w/2; - newh = (h<2) ? 1 : h/2; - newimage = malloc( (neww+4) * newh * bpp ); + neww = (w < 2) ? 1 : w / 2; + newh = (h < 2) ? 1 : h / 2; + newimage = malloc((neww + 4) * newh * bpp); if (!newimage) { return GLU_OUT_OF_MEMORY; } - error = gluScaleImage( format, w, h, type, image, - neww, newh, type, newimage ); + error = gluScaleImage(format, w, h, type, image, + neww, newh, type, newimage); if (error) { - retval = error; - done = GL_TRUE; + retval = error; + done = GL_TRUE; } - if (image!=data) { - free( image ); + if (image != data) { + free(image); } image = newimage; @@ -763,20 +806,19 @@ GLint GLAPIENTRY gluBuild2DMipmaps( GLenum target, GLint components, level++; } - if (image!=data) { - free( image ); + if (image != data) { + free(image); } /* Restore original glPixelStore state */ - glPixelStorei( GL_UNPACK_ROW_LENGTH, unpackrowlength ); - glPixelStorei( GL_UNPACK_ALIGNMENT, unpackalignment ); - glPixelStorei( GL_UNPACK_SKIP_ROWS, unpackskiprows ); - glPixelStorei( GL_UNPACK_SKIP_PIXELS, unpackskippixels ); - glPixelStorei( GL_PACK_ROW_LENGTH, packrowlength ); - glPixelStorei( GL_PACK_ALIGNMENT, packalignment ); - glPixelStorei( GL_PACK_SKIP_ROWS, packskiprows ); - glPixelStorei( GL_PACK_SKIP_PIXELS, packskippixels ); + glPixelStorei(GL_UNPACK_ROW_LENGTH, unpackrowlength); + glPixelStorei(GL_UNPACK_ALIGNMENT, unpackalignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, unpackskiprows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, unpackskippixels); + glPixelStorei(GL_PACK_ROW_LENGTH, packrowlength); + glPixelStorei(GL_PACK_ALIGNMENT, packalignment); + glPixelStorei(GL_PACK_SKIP_ROWS, packskiprows); + glPixelStorei(GL_PACK_SKIP_PIXELS, packskippixels); return retval; } - diff --git a/src/glu/mesa/nurbs.c b/src/glu/mesa/nurbs.c index fdf0991651e..c93dc3cae68 100644 --- a/src/glu/mesa/nurbs.c +++ b/src/glu/mesa/nurbs.c @@ -1,4 +1,4 @@ -/* $Id: nurbs.c,v 1.3 2000/02/10 17:45:52 brianp Exp $ */ +/* $Id: nurbs.c,v 1.4 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -26,6 +26,7 @@ * See README2 for more info. */ + #ifdef PC_HEADER #include "all.h" #else @@ -37,414 +38,398 @@ void -call_user_error( GLUnurbsObj *nobj, GLenum error ) +call_user_error(GLUnurbsObj * nobj, GLenum error) { - nobj->error=error; - if(nobj->error_callback != NULL) { - (*(nobj->error_callback))(error); - } - else { - printf("NURBS error %d %s\n", error, (char *) gluErrorString(error) ); - } + nobj->error = error; + if (nobj->error_callback != NULL) { + (*(nobj->error_callback)) (error); + } + else { + printf("NURBS error %d %s\n", error, (char *) gluErrorString(error)); + } } -GLUnurbsObj * GLAPIENTRY gluNewNurbsRenderer( void ) +GLUnurbsObj *GLAPIENTRY +gluNewNurbsRenderer(void) { GLUnurbsObj *n; GLfloat tmp_viewport[4]; - GLint i,j; + GLint i, j; - n = (GLUnurbsObj *) malloc( sizeof(GLUnurbsObj) ); + n = (GLUnurbsObj *) malloc(sizeof(GLUnurbsObj)); if (n) { /* init */ - n->culling=GL_FALSE; - n->nurbs_type=GLU_NURBS_NONE; - n->error=GLU_NO_ERROR; - n->error_callback=NULL; - n->auto_load_matrix=GL_TRUE; - n->sampling_tolerance=50.0; - n->parametric_tolerance=0.5; + n->culling = GL_FALSE; + n->nurbs_type = GLU_NURBS_NONE; + n->error = GLU_NO_ERROR; + n->error_callback = NULL; + n->auto_load_matrix = GL_TRUE; + n->sampling_tolerance = 50.0; + n->parametric_tolerance = 0.5; n->u_step = n->v_step = 100; n->sampling_method = GLU_PATH_LENGTH; - n->display_mode=GLU_FILL; + n->display_mode = GLU_FILL; /* in case the user doesn't supply the sampling matrices */ /* set projection and modelview to identity */ - for(i=0;i<4;i++) - for(j=0;j<4;j++) - if(i==j) - { - n->sampling_matrices.model[i*4+j]=1.0; - n->sampling_matrices.proj[i*4+j]=1.0; - } - else - { - n->sampling_matrices.model[i*4+j]=0.0; - n->sampling_matrices.proj[i*4+j]=0.0; - } + for (i = 0; i < 4; i++) + for (j = 0; j < 4; j++) + if (i == j) { + n->sampling_matrices.model[i * 4 + j] = 1.0; + n->sampling_matrices.proj[i * 4 + j] = 1.0; + } + else { + n->sampling_matrices.model[i * 4 + j] = 0.0; + n->sampling_matrices.proj[i * 4 + j] = 0.0; + } /* and set the viewport sampling matrix to current ciewport */ - glGetFloatv(GL_VIEWPORT,tmp_viewport); - for(i=0;i<4;i++) - n->sampling_matrices.viewport[i]=tmp_viewport[i]; - n->trim=NULL; + glGetFloatv(GL_VIEWPORT, tmp_viewport); + for (i = 0; i < 4; i++) + n->sampling_matrices.viewport[i] = tmp_viewport[i]; + n->trim = NULL; } return n; } -void GLAPIENTRY gluDeleteNurbsRenderer( GLUnurbsObj *nobj ) +void GLAPIENTRY +gluDeleteNurbsRenderer(GLUnurbsObj * nobj) { if (nobj) { - free( nobj ); + free(nobj); } } -void GLAPIENTRY gluLoadSamplingMatrices( GLUnurbsObj *nobj, - const GLfloat modelMatrix[16], - const GLfloat projMatrix[16], - const GLint viewport[4] ) +void GLAPIENTRY +gluLoadSamplingMatrices(GLUnurbsObj * nobj, + const GLfloat modelMatrix[16], + const GLfloat projMatrix[16], const GLint viewport[4]) { - GLint i; - - for(i=0;i<16;i++) - { - nobj->sampling_matrices.model[i]=modelMatrix[i]; - nobj->sampling_matrices.proj[i]=projMatrix[i]; - } - for(i=0;i<4;i++) - nobj->sampling_matrices.viewport[i]=viewport[i]; + GLint i; + + for (i = 0; i < 16; i++) { + nobj->sampling_matrices.model[i] = modelMatrix[i]; + nobj->sampling_matrices.proj[i] = projMatrix[i]; + } + for (i = 0; i < 4; i++) + nobj->sampling_matrices.viewport[i] = viewport[i]; } -void GLAPIENTRY gluNurbsProperty( GLUnurbsObj *nobj, GLenum property, GLfloat value ) +void GLAPIENTRY +gluNurbsProperty(GLUnurbsObj * nobj, GLenum property, GLfloat value) { GLenum val; switch (property) { - case GLU_SAMPLING_TOLERANCE: - if(value <= 0.0) - { - call_user_error(nobj,GLU_INVALID_VALUE); - return; - } - nobj->sampling_tolerance=value; - break; - case GLU_PARAMETRIC_TOLERANCE: - if(value <= 0.0) - { - call_user_error(nobj,GLU_INVALID_VALUE); - return; - } - nobj->parametric_tolerance=value; - break; - case GLU_U_STEP: - if(value <= 0.0) - { - call_user_error(nobj,GLU_INVALID_VALUE); - return; - } - nobj->u_step=(GLint)value; - break; - case GLU_V_STEP: - if(value <= 0.0) - { - call_user_error(nobj,GLU_INVALID_VALUE); - return; - } - nobj->v_step=(GLint)value; - break; - case GLU_SAMPLING_METHOD: - val = (GLenum)value; - if(val!=GLU_PATH_LENGTH && val!=GLU_PARAMETRIC_ERROR && val!=GLU_DOMAIN_DISTANCE) - { - call_user_error(nobj,GLU_INVALID_ENUM); - return; - } - nobj->sampling_method=val; - break; - case GLU_DISPLAY_MODE: - val=(GLenum)value; - if(val!=GLU_FILL && val!=GLU_OUTLINE_POLYGON && val!=GLU_OUTLINE_PATCH) - { - call_user_error(nobj,GLU_INVALID_ENUM); - return; - } - if(nobj->nurbs_type==GLU_NURBS_CURVE) - { - call_user_error(nobj,GLU_NURBS_ERROR26); - return; - } - nobj->display_mode=val; -if(val==GLU_OUTLINE_PATCH) - fprintf(stderr,"NURBS, for the moment, can display only in POLYGON mode\n"); - break; - case GLU_CULLING: - val=(GLenum)value; - if(val!=GL_TRUE && val!=GL_FALSE) - { - call_user_error(nobj,GLU_INVALID_ENUM); - return; - } - nobj->culling = (GLboolean) value; - break; - case GLU_AUTO_LOAD_MATRIX: - val=(GLenum)value; - if(val!=GL_TRUE && val!=GL_FALSE) - { - call_user_error(nobj,GLU_INVALID_ENUM); - return; - } - nobj->auto_load_matrix = (GLboolean) value; - break; - default: - call_user_error(nobj,GLU_NURBS_ERROR26); + case GLU_SAMPLING_TOLERANCE: + if (value <= 0.0) { + call_user_error(nobj, GLU_INVALID_VALUE); + return; + } + nobj->sampling_tolerance = value; + break; + case GLU_PARAMETRIC_TOLERANCE: + if (value <= 0.0) { + call_user_error(nobj, GLU_INVALID_VALUE); + return; + } + nobj->parametric_tolerance = value; + break; + case GLU_U_STEP: + if (value <= 0.0) { + call_user_error(nobj, GLU_INVALID_VALUE); + return; + } + nobj->u_step = (GLint) value; + break; + case GLU_V_STEP: + if (value <= 0.0) { + call_user_error(nobj, GLU_INVALID_VALUE); + return; + } + nobj->v_step = (GLint) value; + break; + case GLU_SAMPLING_METHOD: + val = (GLenum) value; + if (val != GLU_PATH_LENGTH && val != GLU_PARAMETRIC_ERROR + && val != GLU_DOMAIN_DISTANCE) { + call_user_error(nobj, GLU_INVALID_ENUM); + return; + } + nobj->sampling_method = val; + break; + case GLU_DISPLAY_MODE: + val = (GLenum) value; + if (val != GLU_FILL && val != GLU_OUTLINE_POLYGON + && val != GLU_OUTLINE_PATCH) { + call_user_error(nobj, GLU_INVALID_ENUM); + return; + } + if (nobj->nurbs_type == GLU_NURBS_CURVE) { + call_user_error(nobj, GLU_NURBS_ERROR26); + return; + } + nobj->display_mode = val; + if (val == GLU_OUTLINE_PATCH) + fprintf(stderr, + "NURBS, for the moment, can display only in POLYGON mode\n"); + break; + case GLU_CULLING: + val = (GLenum) value; + if (val != GL_TRUE && val != GL_FALSE) { + call_user_error(nobj, GLU_INVALID_ENUM); + return; + } + nobj->culling = (GLboolean) value; + break; + case GLU_AUTO_LOAD_MATRIX: + val = (GLenum) value; + if (val != GL_TRUE && val != GL_FALSE) { + call_user_error(nobj, GLU_INVALID_ENUM); + return; + } + nobj->auto_load_matrix = (GLboolean) value; + break; + default: + call_user_error(nobj, GLU_NURBS_ERROR26); } } -void GLAPIENTRY gluGetNurbsProperty( GLUnurbsObj *nobj, GLenum property, GLfloat *value ) +void GLAPIENTRY +gluGetNurbsProperty(GLUnurbsObj * nobj, GLenum property, GLfloat * value) { switch (property) { - case GLU_SAMPLING_TOLERANCE: - *value = nobj->sampling_tolerance; - break; - case GLU_DISPLAY_MODE: - *value = (GLfloat) (GLint) nobj->display_mode; - break; - case GLU_CULLING: - *value = nobj->culling ? 1.0 : 0.0; - break; - case GLU_AUTO_LOAD_MATRIX: - *value = nobj->auto_load_matrix ? 1.0 : 0.0; - break; - default: - call_user_error(nobj,GLU_INVALID_ENUM); + case GLU_SAMPLING_TOLERANCE: + *value = nobj->sampling_tolerance; + break; + case GLU_DISPLAY_MODE: + *value = (GLfloat) (GLint) nobj->display_mode; + break; + case GLU_CULLING: + *value = nobj->culling ? 1.0 : 0.0; + break; + case GLU_AUTO_LOAD_MATRIX: + *value = nobj->auto_load_matrix ? 1.0 : 0.0; + break; + default: + call_user_error(nobj, GLU_INVALID_ENUM); } } -void GLAPIENTRY gluBeginCurve( GLUnurbsObj *nobj ) +void GLAPIENTRY +gluBeginCurve(GLUnurbsObj * nobj) { - if(nobj->nurbs_type==GLU_NURBS_CURVE) - { - call_user_error(nobj,GLU_NURBS_ERROR6); - return; - } - nobj->nurbs_type=GLU_NURBS_CURVE; - nobj->curve.geom.type=GLU_INVALID_ENUM; - nobj->curve.color.type=GLU_INVALID_ENUM; - nobj->curve.texture.type=GLU_INVALID_ENUM; - nobj->curve.normal.type=GLU_INVALID_ENUM; + if (nobj->nurbs_type == GLU_NURBS_CURVE) { + call_user_error(nobj, GLU_NURBS_ERROR6); + return; + } + nobj->nurbs_type = GLU_NURBS_CURVE; + nobj->curve.geom.type = GLU_INVALID_ENUM; + nobj->curve.color.type = GLU_INVALID_ENUM; + nobj->curve.texture.type = GLU_INVALID_ENUM; + nobj->curve.normal.type = GLU_INVALID_ENUM; } -void GLAPIENTRY gluEndCurve( GLUnurbsObj * nobj ) +void GLAPIENTRY +gluEndCurve(GLUnurbsObj * nobj) { - if(nobj->nurbs_type==GLU_NURBS_NONE) - { - call_user_error(nobj,GLU_NURBS_ERROR7); - return; - } - if(nobj->curve.geom.type==GLU_INVALID_ENUM) - { - call_user_error(nobj,GLU_NURBS_ERROR8); - nobj->nurbs_type=GLU_NURBS_NONE; - return; - } - glPushAttrib( (GLbitfield) (GL_EVAL_BIT | GL_ENABLE_BIT) ); - glDisable(GL_MAP1_VERTEX_3); - glDisable(GL_MAP1_VERTEX_4); - glDisable(GL_MAP1_INDEX); - glDisable(GL_MAP1_COLOR_4); - glDisable(GL_MAP1_NORMAL); - glDisable(GL_MAP1_TEXTURE_COORD_1); - glDisable(GL_MAP1_TEXTURE_COORD_2); - glDisable(GL_MAP1_TEXTURE_COORD_3); - glDisable(GL_MAP1_TEXTURE_COORD_4); - glDisable(GL_MAP2_VERTEX_3); - glDisable(GL_MAP2_VERTEX_4); - glDisable(GL_MAP2_INDEX); - glDisable(GL_MAP2_COLOR_4); - glDisable(GL_MAP2_NORMAL); - glDisable(GL_MAP2_TEXTURE_COORD_1); - glDisable(GL_MAP2_TEXTURE_COORD_2); - glDisable(GL_MAP2_TEXTURE_COORD_3); - glDisable(GL_MAP2_TEXTURE_COORD_4); - do_nurbs_curve(nobj); - glPopAttrib(); - nobj->nurbs_type=GLU_NURBS_NONE; + if (nobj->nurbs_type == GLU_NURBS_NONE) { + call_user_error(nobj, GLU_NURBS_ERROR7); + return; + } + if (nobj->curve.geom.type == GLU_INVALID_ENUM) { + call_user_error(nobj, GLU_NURBS_ERROR8); + nobj->nurbs_type = GLU_NURBS_NONE; + return; + } + glPushAttrib((GLbitfield) (GL_EVAL_BIT | GL_ENABLE_BIT)); + glDisable(GL_MAP1_VERTEX_3); + glDisable(GL_MAP1_VERTEX_4); + glDisable(GL_MAP1_INDEX); + glDisable(GL_MAP1_COLOR_4); + glDisable(GL_MAP1_NORMAL); + glDisable(GL_MAP1_TEXTURE_COORD_1); + glDisable(GL_MAP1_TEXTURE_COORD_2); + glDisable(GL_MAP1_TEXTURE_COORD_3); + glDisable(GL_MAP1_TEXTURE_COORD_4); + glDisable(GL_MAP2_VERTEX_3); + glDisable(GL_MAP2_VERTEX_4); + glDisable(GL_MAP2_INDEX); + glDisable(GL_MAP2_COLOR_4); + glDisable(GL_MAP2_NORMAL); + glDisable(GL_MAP2_TEXTURE_COORD_1); + glDisable(GL_MAP2_TEXTURE_COORD_2); + glDisable(GL_MAP2_TEXTURE_COORD_3); + glDisable(GL_MAP2_TEXTURE_COORD_4); + do_nurbs_curve(nobj); + glPopAttrib(); + nobj->nurbs_type = GLU_NURBS_NONE; } -void GLAPIENTRY gluNurbsCurve( GLUnurbsObj *nobj, GLint nknots, GLfloat *knot, - GLint stride, GLfloat *ctlarray, GLint order, GLenum type ) +void GLAPIENTRY +gluNurbsCurve(GLUnurbsObj * nobj, GLint nknots, GLfloat * knot, + GLint stride, GLfloat * ctlarray, GLint order, GLenum type) { - if(nobj->nurbs_type==GLU_NURBS_TRIM) - { + if (nobj->nurbs_type == GLU_NURBS_TRIM) { #if 0 /* TODO: NOT IMPLEMENTED YET */ - nurbs_trim *ptr1; - trim_list *ptr2; - - if(type!=GLU_MAP1_TRIM_2 && type!=GLU_MAP1_TRIM_3) - { - call_user_error(nobj,GLU_NURBS_ERROR14); - return; - } - for(ptr1=nobj->trim;ptr1->next;ptr1=ptr1->next); - if(ptr1->trim_loop) - { - for(ptr2=ptr1->trim_loop;ptr2->next;ptr2=ptr2->next); - if((ptr2->next=(trim_list *)malloc(sizeof(trim_list)))==NULL) - { - call_user_error(nobj,GLU_OUT_OF_MEMORY); - return; - } - ptr2=ptr2->next; - } - else - { - if((ptr2=(trim_list *)malloc(sizeof(trim_list)))==NULL) - { - call_user_error(nobj,GLU_OUT_OF_MEMORY); - return; - } - ptr1->trim_loop=ptr2; - } - ptr2->trim_type=GLU_TRIM_NURBS; - ptr2->curve.nurbs_curve.knot_count=nknots; - ptr2->curve.nurbs_curve.knot=knot; - ptr2->curve.nurbs_curve.stride=stride; - ptr2->curve.nurbs_curve.ctrlarray=ctlarray; - ptr2->curve.nurbs_curve.order=order; - ptr2->curve.nurbs_curve.dim= (type==GLU_MAP1_TRIM_2 ? 2 : 3 ); - ptr2->curve.nurbs_curve.type=type; - ptr2->next=NULL; + nurbs_trim *ptr1; + trim_list *ptr2; + + if (type != GLU_MAP1_TRIM_2 && type != GLU_MAP1_TRIM_3) { + call_user_error(nobj, GLU_NURBS_ERROR14); + return; + } + for (ptr1 = nobj->trim; ptr1->next; ptr1 = ptr1->next); + if (ptr1->trim_loop) { + for (ptr2 = ptr1->trim_loop; ptr2->next; ptr2 = ptr2->next); + if ((ptr2->next = (trim_list *) malloc(sizeof(trim_list))) == NULL) { + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return; + } + ptr2 = ptr2->next; + } + else { + if ((ptr2 = (trim_list *) malloc(sizeof(trim_list))) == NULL) { + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return; + } + ptr1->trim_loop = ptr2; + } + ptr2->trim_type = GLU_TRIM_NURBS; + ptr2->curve.nurbs_curve.knot_count = nknots; + ptr2->curve.nurbs_curve.knot = knot; + ptr2->curve.nurbs_curve.stride = stride; + ptr2->curve.nurbs_curve.ctrlarray = ctlarray; + ptr2->curve.nurbs_curve.order = order; + ptr2->curve.nurbs_curve.dim = (type == GLU_MAP1_TRIM_2 ? 2 : 3); + ptr2->curve.nurbs_curve.type = type; + ptr2->next = NULL; #endif - } - else - { - if(type==GLU_MAP1_TRIM_2 || type==GLU_MAP1_TRIM_3) - { - call_user_error(nobj,GLU_NURBS_ERROR22); - return; - } - if(nobj->nurbs_type!=GLU_NURBS_CURVE) - { - call_user_error(nobj,GLU_NURBS_ERROR10); - return; - } - switch(type) - { - case GL_MAP1_VERTEX_3: - case GL_MAP1_VERTEX_4: - if(nobj->curve.geom.type!=GLU_INVALID_ENUM) - { - call_user_error(nobj,GLU_NURBS_ERROR8); - return; - } - nobj->curve.geom.type=type; - nobj->curve.geom.knot_count=nknots; - nobj->curve.geom.knot=knot; - nobj->curve.geom.stride=stride; - nobj->curve.geom.ctrlarray=ctlarray; - nobj->curve.geom.order=order; - break; - case GL_MAP1_INDEX: - case GL_MAP1_COLOR_4: - nobj->curve.color.type=type; - nobj->curve.color.knot_count=nknots; - nobj->curve.color.knot=knot; - nobj->curve.color.stride=stride; - nobj->curve.color.ctrlarray=ctlarray; - nobj->curve.color.order=order; - break; - case GL_MAP1_NORMAL: - nobj->curve.normal.type=type; - nobj->curve.normal.knot_count=nknots; - nobj->curve.normal.knot=knot; - nobj->curve.normal.stride=stride; - nobj->curve.normal.ctrlarray=ctlarray; - nobj->curve.normal.order=order; - break; - case GL_MAP1_TEXTURE_COORD_1: - case GL_MAP1_TEXTURE_COORD_2: - case GL_MAP1_TEXTURE_COORD_3: - case GL_MAP1_TEXTURE_COORD_4: - nobj->curve.texture.type=type; - nobj->curve.texture.knot_count=nknots; - nobj->curve.texture.knot=knot; - nobj->curve.texture.stride=stride; - nobj->curve.texture.ctrlarray=ctlarray; - nobj->curve.texture.order=order; - break; - default: - call_user_error(nobj,GLU_INVALID_ENUM); - } - } + } + else { + if (type == GLU_MAP1_TRIM_2 || type == GLU_MAP1_TRIM_3) { + call_user_error(nobj, GLU_NURBS_ERROR22); + return; + } + if (nobj->nurbs_type != GLU_NURBS_CURVE) { + call_user_error(nobj, GLU_NURBS_ERROR10); + return; + } + switch (type) { + case GL_MAP1_VERTEX_3: + case GL_MAP1_VERTEX_4: + if (nobj->curve.geom.type != GLU_INVALID_ENUM) { + call_user_error(nobj, GLU_NURBS_ERROR8); + return; + } + nobj->curve.geom.type = type; + nobj->curve.geom.knot_count = nknots; + nobj->curve.geom.knot = knot; + nobj->curve.geom.stride = stride; + nobj->curve.geom.ctrlarray = ctlarray; + nobj->curve.geom.order = order; + break; + case GL_MAP1_INDEX: + case GL_MAP1_COLOR_4: + nobj->curve.color.type = type; + nobj->curve.color.knot_count = nknots; + nobj->curve.color.knot = knot; + nobj->curve.color.stride = stride; + nobj->curve.color.ctrlarray = ctlarray; + nobj->curve.color.order = order; + break; + case GL_MAP1_NORMAL: + nobj->curve.normal.type = type; + nobj->curve.normal.knot_count = nknots; + nobj->curve.normal.knot = knot; + nobj->curve.normal.stride = stride; + nobj->curve.normal.ctrlarray = ctlarray; + nobj->curve.normal.order = order; + break; + case GL_MAP1_TEXTURE_COORD_1: + case GL_MAP1_TEXTURE_COORD_2: + case GL_MAP1_TEXTURE_COORD_3: + case GL_MAP1_TEXTURE_COORD_4: + nobj->curve.texture.type = type; + nobj->curve.texture.knot_count = nknots; + nobj->curve.texture.knot = knot; + nobj->curve.texture.stride = stride; + nobj->curve.texture.ctrlarray = ctlarray; + nobj->curve.texture.order = order; + break; + default: + call_user_error(nobj, GLU_INVALID_ENUM); + } + } } -void GLAPIENTRY gluBeginSurface( GLUnurbsObj *nobj ) +void GLAPIENTRY +gluBeginSurface(GLUnurbsObj * nobj) { - switch(nobj->nurbs_type) - { - case GLU_NURBS_NONE: - nobj->nurbs_type=GLU_NURBS_SURFACE; - nobj->surface.geom.type=GLU_INVALID_ENUM; - nobj->surface.color.type=GLU_INVALID_ENUM; - nobj->surface.texture.type=GLU_INVALID_ENUM; - nobj->surface.normal.type=GLU_INVALID_ENUM; - break; - case GLU_NURBS_TRIM: - call_user_error(nobj,GLU_NURBS_ERROR16); - break; - case GLU_NURBS_SURFACE: - case GLU_NURBS_NO_TRIM: - case GLU_NURBS_TRIM_DONE: - call_user_error(nobj,GLU_NURBS_ERROR27); - break; - case GLU_NURBS_CURVE: - call_user_error(nobj,GLU_NURBS_ERROR6); - break; - } + switch (nobj->nurbs_type) { + case GLU_NURBS_NONE: + nobj->nurbs_type = GLU_NURBS_SURFACE; + nobj->surface.geom.type = GLU_INVALID_ENUM; + nobj->surface.color.type = GLU_INVALID_ENUM; + nobj->surface.texture.type = GLU_INVALID_ENUM; + nobj->surface.normal.type = GLU_INVALID_ENUM; + break; + case GLU_NURBS_TRIM: + call_user_error(nobj, GLU_NURBS_ERROR16); + break; + case GLU_NURBS_SURFACE: + case GLU_NURBS_NO_TRIM: + case GLU_NURBS_TRIM_DONE: + call_user_error(nobj, GLU_NURBS_ERROR27); + break; + case GLU_NURBS_CURVE: + call_user_error(nobj, GLU_NURBS_ERROR6); + break; + } } -void GLAPIENTRY gluEndSurface( GLUnurbsObj * nobj ) +void GLAPIENTRY +gluEndSurface(GLUnurbsObj * nobj) { - switch(nobj->nurbs_type) - { - case GLU_NURBS_NONE: - call_user_error(nobj,GLU_NURBS_ERROR13); - break; - case GLU_NURBS_TRIM: - call_user_error(nobj,GLU_NURBS_ERROR12); - break; - case GLU_NURBS_TRIM_DONE: + switch (nobj->nurbs_type) { + case GLU_NURBS_NONE: + call_user_error(nobj, GLU_NURBS_ERROR13); + break; + case GLU_NURBS_TRIM: + call_user_error(nobj, GLU_NURBS_ERROR12); + break; + case GLU_NURBS_TRIM_DONE: /* if(nobj->trim->trim_loop==NULL) { call_user_error(nobj,GLU_NURBS_ERROR18); return; }*/ - /* no break - fallthrough */ - case GLU_NURBS_NO_TRIM: - glPushAttrib( (GLbitfield) - (GL_EVAL_BIT | GL_ENABLE_BIT | GL_POLYGON_BIT) ); - glDisable(GL_MAP2_VERTEX_3); - glDisable(GL_MAP2_VERTEX_4); - glDisable(GL_MAP2_INDEX); - glDisable(GL_MAP2_COLOR_4); - glDisable(GL_MAP2_NORMAL); - glDisable(GL_MAP2_TEXTURE_COORD_1); - glDisable(GL_MAP2_TEXTURE_COORD_2); - glDisable(GL_MAP2_TEXTURE_COORD_3); - glDisable(GL_MAP2_TEXTURE_COORD_4); + /* no break - fallthrough */ + case GLU_NURBS_NO_TRIM: + glPushAttrib((GLbitfield) + (GL_EVAL_BIT | GL_ENABLE_BIT | GL_POLYGON_BIT)); + glDisable(GL_MAP2_VERTEX_3); + glDisable(GL_MAP2_VERTEX_4); + glDisable(GL_MAP2_INDEX); + glDisable(GL_MAP2_COLOR_4); + glDisable(GL_MAP2_NORMAL); + glDisable(GL_MAP2_TEXTURE_COORD_1); + glDisable(GL_MAP2_TEXTURE_COORD_2); + glDisable(GL_MAP2_TEXTURE_COORD_3); + glDisable(GL_MAP2_TEXTURE_COORD_4); /* glDisable(GL_MAP1_VERTEX_3); glDisable(GL_MAP1_VERTEX_4); glDisable(GL_MAP1_INDEX); @@ -454,208 +439,191 @@ void GLAPIENTRY gluEndSurface( GLUnurbsObj * nobj ) glDisable(GL_MAP1_TEXTURE_COORD_2); glDisable(GL_MAP1_TEXTURE_COORD_3); glDisable(GL_MAP1_TEXTURE_COORD_4);*/ - do_nurbs_surface(nobj); - glPopAttrib(); - break; - default: - call_user_error(nobj,GLU_NURBS_ERROR8); - } - nobj->nurbs_type=GLU_NURBS_NONE; + do_nurbs_surface(nobj); + glPopAttrib(); + break; + default: + call_user_error(nobj, GLU_NURBS_ERROR8); + } + nobj->nurbs_type = GLU_NURBS_NONE; } -void GLAPIENTRY gluNurbsSurface( GLUnurbsObj *nobj, - GLint sknot_count, GLfloat *sknot, - GLint tknot_count, GLfloat *tknot, - GLint s_stride, GLint t_stride, - GLfloat *ctrlarray, - GLint sorder, GLint torder, - GLenum type ) +void GLAPIENTRY +gluNurbsSurface(GLUnurbsObj * nobj, + GLint sknot_count, GLfloat * sknot, + GLint tknot_count, GLfloat * tknot, + GLint s_stride, GLint t_stride, + GLfloat * ctrlarray, GLint sorder, GLint torder, GLenum type) { - if(nobj->nurbs_type==GLU_NURBS_NO_TRIM || nobj->nurbs_type==GLU_NURBS_TRIM || - nobj->nurbs_type==GLU_NURBS_TRIM_DONE) - { - if(type==GL_MAP2_VERTEX_3 || type==GL_MAP2_VERTEX_4) - { - call_user_error(nobj,GLU_NURBS_ERROR8); - return; - } - } - else - if(nobj->nurbs_type!=GLU_NURBS_SURFACE) - { - call_user_error(nobj,GLU_NURBS_ERROR11); - return; - } - switch(type) - { - case GL_MAP2_VERTEX_3: - case GL_MAP2_VERTEX_4: - nobj->surface.geom.sknot_count=sknot_count; - nobj->surface.geom.sknot=sknot; - nobj->surface.geom.tknot_count=tknot_count; - nobj->surface.geom.tknot=tknot; - nobj->surface.geom.s_stride=s_stride; - nobj->surface.geom.t_stride=t_stride; - nobj->surface.geom.ctrlarray=ctrlarray; - nobj->surface.geom.sorder=sorder; - nobj->surface.geom.torder=torder; - nobj->surface.geom.type=type; - nobj->nurbs_type=GLU_NURBS_NO_TRIM; - break; - case GL_MAP2_INDEX: - case GL_MAP2_COLOR_4: - nobj->surface.color.sknot_count=sknot_count; - nobj->surface.color.sknot=sknot; - nobj->surface.color.tknot_count=tknot_count; - nobj->surface.color.tknot=tknot; - nobj->surface.color.s_stride=s_stride; - nobj->surface.color.t_stride=t_stride; - nobj->surface.color.ctrlarray=ctrlarray; - nobj->surface.color.sorder=sorder; - nobj->surface.color.torder=torder; - nobj->surface.color.type=type; - break; - case GL_MAP2_NORMAL: - nobj->surface.normal.sknot_count=sknot_count; - nobj->surface.normal.sknot=sknot; - nobj->surface.normal.tknot_count=tknot_count; - nobj->surface.normal.tknot=tknot; - nobj->surface.normal.s_stride=s_stride; - nobj->surface.normal.t_stride=t_stride; - nobj->surface.normal.ctrlarray=ctrlarray; - nobj->surface.normal.sorder=sorder; - nobj->surface.normal.torder=torder; - nobj->surface.normal.type=type; - break; - case GL_MAP2_TEXTURE_COORD_1: - case GL_MAP2_TEXTURE_COORD_2: - case GL_MAP2_TEXTURE_COORD_3: - case GL_MAP2_TEXTURE_COORD_4: - nobj->surface.texture.sknot_count=sknot_count; - nobj->surface.texture.sknot=sknot; - nobj->surface.texture.tknot_count=tknot_count; - nobj->surface.texture.tknot=tknot; - nobj->surface.texture.s_stride=s_stride; - nobj->surface.texture.t_stride=t_stride; - nobj->surface.texture.ctrlarray=ctrlarray; - nobj->surface.texture.sorder=sorder; - nobj->surface.texture.torder=torder; - nobj->surface.texture.type=type; - break; - default: - call_user_error(nobj,GLU_INVALID_ENUM); - } + if (nobj->nurbs_type == GLU_NURBS_NO_TRIM + || nobj->nurbs_type == GLU_NURBS_TRIM + || nobj->nurbs_type == GLU_NURBS_TRIM_DONE) { + if (type == GL_MAP2_VERTEX_3 || type == GL_MAP2_VERTEX_4) { + call_user_error(nobj, GLU_NURBS_ERROR8); + return; + } + } + else if (nobj->nurbs_type != GLU_NURBS_SURFACE) { + call_user_error(nobj, GLU_NURBS_ERROR11); + return; + } + switch (type) { + case GL_MAP2_VERTEX_3: + case GL_MAP2_VERTEX_4: + nobj->surface.geom.sknot_count = sknot_count; + nobj->surface.geom.sknot = sknot; + nobj->surface.geom.tknot_count = tknot_count; + nobj->surface.geom.tknot = tknot; + nobj->surface.geom.s_stride = s_stride; + nobj->surface.geom.t_stride = t_stride; + nobj->surface.geom.ctrlarray = ctrlarray; + nobj->surface.geom.sorder = sorder; + nobj->surface.geom.torder = torder; + nobj->surface.geom.type = type; + nobj->nurbs_type = GLU_NURBS_NO_TRIM; + break; + case GL_MAP2_INDEX: + case GL_MAP2_COLOR_4: + nobj->surface.color.sknot_count = sknot_count; + nobj->surface.color.sknot = sknot; + nobj->surface.color.tknot_count = tknot_count; + nobj->surface.color.tknot = tknot; + nobj->surface.color.s_stride = s_stride; + nobj->surface.color.t_stride = t_stride; + nobj->surface.color.ctrlarray = ctrlarray; + nobj->surface.color.sorder = sorder; + nobj->surface.color.torder = torder; + nobj->surface.color.type = type; + break; + case GL_MAP2_NORMAL: + nobj->surface.normal.sknot_count = sknot_count; + nobj->surface.normal.sknot = sknot; + nobj->surface.normal.tknot_count = tknot_count; + nobj->surface.normal.tknot = tknot; + nobj->surface.normal.s_stride = s_stride; + nobj->surface.normal.t_stride = t_stride; + nobj->surface.normal.ctrlarray = ctrlarray; + nobj->surface.normal.sorder = sorder; + nobj->surface.normal.torder = torder; + nobj->surface.normal.type = type; + break; + case GL_MAP2_TEXTURE_COORD_1: + case GL_MAP2_TEXTURE_COORD_2: + case GL_MAP2_TEXTURE_COORD_3: + case GL_MAP2_TEXTURE_COORD_4: + nobj->surface.texture.sknot_count = sknot_count; + nobj->surface.texture.sknot = sknot; + nobj->surface.texture.tknot_count = tknot_count; + nobj->surface.texture.tknot = tknot; + nobj->surface.texture.s_stride = s_stride; + nobj->surface.texture.t_stride = t_stride; + nobj->surface.texture.ctrlarray = ctrlarray; + nobj->surface.texture.sorder = sorder; + nobj->surface.texture.torder = torder; + nobj->surface.texture.type = type; + break; + default: + call_user_error(nobj, GLU_INVALID_ENUM); + } } void GLAPIENTRY -gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, void (GLCALLBACKP fn)()) +gluNurbsCallback(GLUnurbsObj * nobj, GLenum which, void (GLCALLBACK * fn) ()) { - nobj->error_callback = (void(GLCALLBACKPCAST)(GLenum))fn; + nobj->error_callback = (void (GLCALLBACKPCAST) (GLenum)) fn; - if(which!=GLU_ERROR) - call_user_error(nobj,GLU_INVALID_ENUM); + if (which != GLU_ERROR) + call_user_error(nobj, GLU_INVALID_ENUM); } void GLAPIENTRY -gluBeginTrim( GLUnurbsObj *nobj ) +gluBeginTrim(GLUnurbsObj * nobj) { #if 0 - nurbs_trim *ptr; + nurbs_trim *ptr; #endif - if(nobj->nurbs_type!=GLU_NURBS_TRIM_DONE) - if(nobj->nurbs_type!=GLU_NURBS_NO_TRIM) - { - call_user_error(nobj,GLU_NURBS_ERROR15); - return; - } - nobj->nurbs_type=GLU_NURBS_TRIM; -fprintf(stderr,"NURBS - trimming not supported yet\n"); + if (nobj->nurbs_type != GLU_NURBS_TRIM_DONE) + if (nobj->nurbs_type != GLU_NURBS_NO_TRIM) { + call_user_error(nobj, GLU_NURBS_ERROR15); + return; + } + nobj->nurbs_type = GLU_NURBS_TRIM; + fprintf(stderr, "NURBS - trimming not supported yet\n"); #if 0 - if((ptr=(nurbs_trim *)malloc(sizeof(nurbs_trim)))==NULL) - { - call_user_error(nobj,GLU_OUT_OF_MEMORY); - return; - } - if(nobj->trim) - { - nurbs_trim *tmp_ptr; - - for(tmp_ptr=nobj->trim;tmp_ptr->next;tmp_ptr=tmp_ptr->next); - tmp_ptr->next=ptr; - } - else - nobj->trim=ptr; - ptr->trim_loop=NULL; - ptr->segments=NULL; - ptr->next=NULL; + if ((ptr = (nurbs_trim *) malloc(sizeof(nurbs_trim))) == NULL) { + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return; + } + if (nobj->trim) { + nurbs_trim *tmp_ptr; + + for (tmp_ptr = nobj->trim; tmp_ptr->next; tmp_ptr = tmp_ptr->next); + tmp_ptr->next = ptr; + } + else + nobj->trim = ptr; + ptr->trim_loop = NULL; + ptr->segments = NULL; + ptr->next = NULL; #endif } void GLAPIENTRY -gluPwlCurve( GLUnurbsObj *nobj, GLint count, GLfloat *array, GLint stride, - GLenum type) +gluPwlCurve(GLUnurbsObj * nobj, GLint count, GLfloat * array, GLint stride, + GLenum type) { #if 0 - nurbs_trim *ptr1; - trim_list *ptr2; + nurbs_trim *ptr1; + trim_list *ptr2; #endif - if(nobj->nurbs_type==GLU_NURBS_CURVE) - { - call_user_error(nobj,GLU_NURBS_ERROR9); - return; - } - if(nobj->nurbs_type==GLU_NURBS_NONE) - { - call_user_error(nobj,GLU_NURBS_ERROR19); - return; - } - if(type!=GLU_MAP1_TRIM_2 && type!=GLU_MAP1_TRIM_3) - { - call_user_error(nobj,GLU_NURBS_ERROR14); - return; - } + if (nobj->nurbs_type == GLU_NURBS_CURVE) { + call_user_error(nobj, GLU_NURBS_ERROR9); + return; + } + if (nobj->nurbs_type == GLU_NURBS_NONE) { + call_user_error(nobj, GLU_NURBS_ERROR19); + return; + } + if (type != GLU_MAP1_TRIM_2 && type != GLU_MAP1_TRIM_3) { + call_user_error(nobj, GLU_NURBS_ERROR14); + return; + } #if 0 - for(ptr1=nobj->trim;ptr1->next;ptr1=ptr1->next); - if(ptr1->trim_loop) - { - for(ptr2=ptr1->trim_loop;ptr2->next;ptr2=ptr2->next); - if((ptr2->next=(trim_list *)malloc(sizeof(trim_list)))==NULL) - { - call_user_error(nobj,GLU_OUT_OF_MEMORY); - return; - } - ptr2=ptr2->next; - } - else - { - if((ptr2=(trim_list *)malloc(sizeof(trim_list)))==NULL) - { - call_user_error(nobj,GLU_OUT_OF_MEMORY); - return; - } - ptr1->trim_loop=ptr2; - } - ptr2->trim_type=GLU_TRIM_PWL; - ptr2->curve.pwl_curve.pt_count=count; - ptr2->curve.pwl_curve.ctrlarray=array; - ptr2->curve.pwl_curve.stride=stride; - ptr2->curve.pwl_curve.dim= (type==GLU_MAP1_TRIM_2 ? 2 : 3 ); - ptr2->curve.pwl_curve.type=type; - ptr2->next=NULL; + for (ptr1 = nobj->trim; ptr1->next; ptr1 = ptr1->next); + if (ptr1->trim_loop) { + for (ptr2 = ptr1->trim_loop; ptr2->next; ptr2 = ptr2->next); + if ((ptr2->next = (trim_list *) malloc(sizeof(trim_list))) == NULL) { + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return; + } + ptr2 = ptr2->next; + } + else { + if ((ptr2 = (trim_list *) malloc(sizeof(trim_list))) == NULL) { + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return; + } + ptr1->trim_loop = ptr2; + } + ptr2->trim_type = GLU_TRIM_PWL; + ptr2->curve.pwl_curve.pt_count = count; + ptr2->curve.pwl_curve.ctrlarray = array; + ptr2->curve.pwl_curve.stride = stride; + ptr2->curve.pwl_curve.dim = (type == GLU_MAP1_TRIM_2 ? 2 : 3); + ptr2->curve.pwl_curve.type = type; + ptr2->next = NULL; #endif } void GLAPIENTRY -gluEndTrim( GLUnurbsObj *nobj ) +gluEndTrim(GLUnurbsObj * nobj) { - if(nobj->nurbs_type!=GLU_NURBS_TRIM) - { - call_user_error(nobj,GLU_NURBS_ERROR17); - return; - } - nobj->nurbs_type=GLU_NURBS_TRIM_DONE; + if (nobj->nurbs_type != GLU_NURBS_TRIM) { + call_user_error(nobj, GLU_NURBS_ERROR17); + return; + } + nobj->nurbs_type = GLU_NURBS_TRIM_DONE; } - diff --git a/src/glu/mesa/nurbs.h b/src/glu/mesa/nurbs.h index 3e38ea40068..c80cacf57af 100644 --- a/src/glu/mesa/nurbs.h +++ b/src/glu/mesa/nurbs.h @@ -1,9 +1,9 @@ -/* $Id: nurbs.h,v 1.2 1999/11/11 03:21:43 kendallb Exp $ */ +/* $Id: nurbs.h,v 1.3 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 - * Copyright (C) 1995-1999 Brian Paul + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -21,46 +21,6 @@ */ -/* - * $Log: nurbs.h,v $ - * Revision 1.2 1999/11/11 03:21:43 kendallb - * - * . Updated GL/gl.h with GLCALLACKP and GLAPIENTRYP macros for compatibility - * with the IBM VisualAge C++ compiler. Eventually some more code will be - * needed in the headers to enable the reversal of (__stdcall*) to (*__stdcall) - * for the IBM compilers, however we currently build using our own header files - * that already handle this. - * - * . Changed instances of (GLCALLBACK*) to GLCALLBACKP for compatibility - * with the IBM VisualAge C++ compiler in src-glu. - * - * . Misc cleanups for warnings generated with Watcom C++ in src-glu. Compiles - * with 0 warnings now. - * - * . tess_hash.c: line 244 - Why is this function stubbed out? I removed the - * code with a #if 0 to avoid a compiler warning, but it looks dangerous. - * - * Revision 1.1.1.1 1999/08/19 00:55:42 jtg - * Imported sources - * - * Revision 1.5 1999/02/27 13:55:31 brianp - * fixed BeOS-related GLU typedef problems - * - * Revision 1.4 1999/01/03 03:23:15 brianp - * now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump) - * - * Revision 1.3 1997/05/27 03:18:23 brianp - * minor clean-up - * - * Revision 1.2 1997/05/27 03:00:16 brianp - * incorporated Bogdan's new NURBS code - * - * Revision 1.1 1996/09/27 01:19:39 brianp - * Initial revision - * - */ - - /* * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) * See README2 for more info. @@ -71,198 +31,222 @@ #define NURBS_H -#define EPSILON 1e-06 /* epsilon for double precision compares */ +#define EPSILON 1e-06 /* epsilon for double precision compares */ typedef enum { - GLU_NURBS_CURVE, GLU_NURBS_SURFACE, GLU_NURBS_TRIM, GLU_NURBS_NO_TRIM, - GLU_NURBS_TRIM_DONE, GLU_NURBS_NONE -} GLU_nurbs_enum; + GLU_NURBS_CURVE, GLU_NURBS_SURFACE, GLU_NURBS_TRIM, GLU_NURBS_NO_TRIM, + GLU_NURBS_TRIM_DONE, GLU_NURBS_NONE +} +GLU_nurbs_enum; typedef enum { - GLU_TRIM_NURBS, GLU_TRIM_PWL -} GLU_trim_enum; + GLU_TRIM_NURBS, GLU_TRIM_PWL +} +GLU_trim_enum; typedef struct { - GLint sknot_count; - GLfloat *sknot; - GLint tknot_count; - GLfloat *tknot; - GLint s_stride; - GLint t_stride; - GLfloat *ctrlarray; - GLint sorder; - GLint torder; - GLint dim; - GLenum type; -} surface_attribs; + GLint sknot_count; + GLfloat *sknot; + GLint tknot_count; + GLfloat *tknot; + GLint s_stride; + GLint t_stride; + GLfloat *ctrlarray; + GLint sorder; + GLint torder; + GLint dim; + GLenum type; +} +surface_attribs; typedef struct { - surface_attribs geom; - surface_attribs color; - surface_attribs texture; - surface_attribs normal; -} nurbs_surface; + surface_attribs geom; + surface_attribs color; + surface_attribs texture; + surface_attribs normal; +} +nurbs_surface; typedef struct { - GLint knot_count; - GLfloat *knot; - GLint stride; - GLfloat *ctrlarray; - GLint order; - GLint dim; - GLenum type; -} curve_attribs; + GLint knot_count; + GLfloat *knot; + GLint stride; + GLfloat *ctrlarray; + GLint order; + GLint dim; + GLenum type; +} +curve_attribs; typedef struct { - GLint pt_count; - GLfloat *ctrlarray; - GLint stride; - GLint dim; - GLenum type; -} pwl_curve_attribs; + GLint pt_count; + GLfloat *ctrlarray; + GLint stride; + GLint dim; + GLenum type; +} +pwl_curve_attribs; typedef struct { - curve_attribs geom; - curve_attribs color; - curve_attribs texture; - curve_attribs normal; -} nurbs_curve; + curve_attribs geom; + curve_attribs color; + curve_attribs texture; + curve_attribs normal; +} +nurbs_curve; typedef struct trim_list_str { - GLU_trim_enum trim_type; - union - { - pwl_curve_attribs pwl_curve; - curve_attribs nurbs_curve; - } curve; - struct trim_list_str *next; -} trim_list; + GLU_trim_enum trim_type; + union + { + pwl_curve_attribs pwl_curve; + curve_attribs nurbs_curve; + } + curve; + struct trim_list_str *next; +} +trim_list; typedef struct seg_trim_str { - GLfloat *points; - GLint pt_cnt,seg_array_len; - struct seg_trim_str *next; -} trim_segments; + GLfloat *points; + GLint pt_cnt, seg_array_len; + struct seg_trim_str *next; +} +trim_segments; typedef struct nurbs_trim_str { - trim_list *trim_loop; - trim_segments *segments; - struct nurbs_trim_str *next; -} nurbs_trim; + trim_list *trim_loop; + trim_segments *segments; + struct nurbs_trim_str *next; +} +nurbs_trim; typedef struct { - GLfloat model[16],proj[16],viewport[4]; -} culling_and_sampling_str; - -struct GLUnurbs { - GLboolean culling; - GLenum error; - void (GLCALLBACKP error_callback)( GLenum err ); - GLenum display_mode; - GLU_nurbs_enum nurbs_type; - GLboolean auto_load_matrix; - culling_and_sampling_str - sampling_matrices; - GLenum sampling_method; - GLfloat sampling_tolerance; - GLfloat parametric_tolerance; - GLint u_step, v_step; - nurbs_surface surface; - nurbs_curve curve; - nurbs_trim *trim; + GLfloat model[16], proj[16], viewport[4]; +} +culling_and_sampling_str; + +struct GLUnurbs +{ + GLboolean culling; + GLenum error; + void (GLCALLBACK * error_callback) (GLenum err); + GLenum display_mode; + GLU_nurbs_enum nurbs_type; + GLboolean auto_load_matrix; + culling_and_sampling_str sampling_matrices; + GLenum sampling_method; + GLfloat sampling_tolerance; + GLfloat parametric_tolerance; + GLint u_step, v_step; + nurbs_surface surface; + nurbs_curve curve; + nurbs_trim *trim; }; typedef struct { - GLfloat *knot; - GLint nknots; - GLfloat *unified_knot; - GLint unified_nknots; - GLint order; - GLint t_min,t_max; - GLint delta_nknots; - GLboolean open_at_begin,open_at_end; - GLfloat *new_knot; - GLfloat *alpha; -} knot_str_type; + GLfloat *knot; + GLint nknots; + GLfloat *unified_knot; + GLint unified_nknots; + GLint order; + GLint t_min, t_max; + GLint delta_nknots; + GLboolean open_at_begin, open_at_end; + GLfloat *new_knot; + GLfloat *alpha; +} +knot_str_type; typedef struct { - GLfloat *geom_ctrl; - GLint geom_s_stride,geom_t_stride; - GLfloat **geom_offsets; - GLint geom_s_pt_cnt,geom_t_pt_cnt; - GLfloat *color_ctrl; - GLint color_s_stride,color_t_stride; - GLfloat **color_offsets; - GLint color_s_pt_cnt,color_t_pt_cnt; - GLfloat *normal_ctrl; - GLint normal_s_stride,normal_t_stride; - GLfloat **normal_offsets; - GLint normal_s_pt_cnt,normal_t_pt_cnt; - GLfloat *texture_ctrl; - GLint texture_s_stride,texture_t_stride; - GLfloat **texture_offsets; - GLint texture_s_pt_cnt,texture_t_pt_cnt; - GLint s_bezier_cnt,t_bezier_cnt; -} new_ctrl_type; - -extern void call_user_error( GLUnurbsObj *nobj, GLenum error ); - -extern GLenum test_knot(GLint nknots, GLfloat *knot, GLint order); - -extern GLenum explode_knot(knot_str_type *the_knot); - -extern GLenum calc_alphas(knot_str_type *the_knot); - -extern GLenum calc_new_ctrl_pts(GLfloat *ctrl,GLint stride,knot_str_type *the_knot, - GLint dim,GLfloat **new_ctrl,GLint *ncontrol); - -extern GLenum glu_do_sampling_crv(GLUnurbsObj *nobj, GLfloat *new_ctrl,GLint n_ctrl, - GLint order,GLint dim,GLint **factors); - -extern GLenum glu_do_sampling_3D(GLUnurbsObj *nobj, new_ctrl_type *new_ctrl, - int **sfactors, GLint **tfactors); - -extern GLenum glu_do_sampling_uv(GLUnurbsObj *nobj, new_ctrl_type *new_ctrl, - int **sfactors, GLint **tfactors); - -extern GLenum glu_do_sampling_param_3D(GLUnurbsObj *nobj, new_ctrl_type *new_ctrl, - int **sfactors, GLint **tfactors); - -extern GLboolean fine_culling_test_2D(GLUnurbsObj *nobj, GLfloat *ctrl, GLint n_ctrl, - GLint stride, GLint dim); - -extern GLboolean fine_culling_test_3D(GLUnurbsObj *nobj, GLfloat *ctrl, - GLint s_n_ctrl, GLint t_n_ctrl, GLint s_stride, GLint t_stride, GLint dim); - -extern void do_nurbs_curve( GLUnurbsObj *nobj); - -extern void do_nurbs_surface( GLUnurbsObj *nobj); - -extern GLenum patch_trimming(GLUnurbsObj *nobj,new_ctrl_type *new_ctrl, - GLint *sfactors, GLint *tfactors); - -extern void collect_unified_knot(knot_str_type *dest, knot_str_type *src, - GLfloat maximal_min_knot, GLfloat minimal_max_knot); - -extern GLenum select_knot_working_range(GLUnurbsObj *nobj,knot_str_type *geom_knot, - knot_str_type *color_knot, knot_str_type *normal_knot, - knot_str_type *texture_knot); - -extern void free_unified_knots(knot_str_type *geom_knot, knot_str_type *color_knot, - knot_str_type *normal_knot, knot_str_type *texture_knot); + GLfloat *geom_ctrl; + GLint geom_s_stride, geom_t_stride; + GLfloat **geom_offsets; + GLint geom_s_pt_cnt, geom_t_pt_cnt; + GLfloat *color_ctrl; + GLint color_s_stride, color_t_stride; + GLfloat **color_offsets; + GLint color_s_pt_cnt, color_t_pt_cnt; + GLfloat *normal_ctrl; + GLint normal_s_stride, normal_t_stride; + GLfloat **normal_offsets; + GLint normal_s_pt_cnt, normal_t_pt_cnt; + GLfloat *texture_ctrl; + GLint texture_s_stride, texture_t_stride; + GLfloat **texture_offsets; + GLint texture_s_pt_cnt, texture_t_pt_cnt; + GLint s_bezier_cnt, t_bezier_cnt; +} +new_ctrl_type; + +extern void call_user_error(GLUnurbsObj * nobj, GLenum error); + +extern GLenum test_knot(GLint nknots, GLfloat * knot, GLint order); + +extern GLenum explode_knot(knot_str_type * the_knot); + +extern GLenum calc_alphas(knot_str_type * the_knot); + +extern GLenum calc_new_ctrl_pts(GLfloat * ctrl, GLint stride, + knot_str_type * the_knot, GLint dim, + GLfloat ** new_ctrl, GLint * ncontrol); + +extern GLenum glu_do_sampling_crv(GLUnurbsObj * nobj, GLfloat * new_ctrl, + GLint n_ctrl, GLint order, GLint dim, + GLint ** factors); + +extern GLenum glu_do_sampling_3D(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, + int **sfactors, GLint ** tfactors); + +extern GLenum glu_do_sampling_uv(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, + int **sfactors, GLint ** tfactors); + +extern GLenum glu_do_sampling_param_3D(GLUnurbsObj * nobj, + new_ctrl_type * new_ctrl, + int **sfactors, GLint ** tfactors); + +extern GLboolean fine_culling_test_2D(GLUnurbsObj * nobj, GLfloat * ctrl, + GLint n_ctrl, GLint stride, GLint dim); + +extern GLboolean fine_culling_test_3D(GLUnurbsObj * nobj, GLfloat * ctrl, + GLint s_n_ctrl, GLint t_n_ctrl, + GLint s_stride, GLint t_stride, + GLint dim); + +extern void do_nurbs_curve(GLUnurbsObj * nobj); + +extern void do_nurbs_surface(GLUnurbsObj * nobj); + +extern GLenum patch_trimming(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, + GLint * sfactors, GLint * tfactors); + +extern void collect_unified_knot(knot_str_type * dest, knot_str_type * src, + GLfloat maximal_min_knot, + GLfloat minimal_max_knot); + +extern GLenum select_knot_working_range(GLUnurbsObj * nobj, + knot_str_type * geom_knot, + knot_str_type * color_knot, + knot_str_type * normal_knot, + knot_str_type * texture_knot); + +extern void free_unified_knots(knot_str_type * geom_knot, + knot_str_type * color_knot, + knot_str_type * normal_knot, + knot_str_type * texture_knot); diff --git a/src/glu/mesa/nurbscrv.c b/src/glu/mesa/nurbscrv.c index 022818b73ca..a9ff4f28671 100644 --- a/src/glu/mesa/nurbscrv.c +++ b/src/glu/mesa/nurbscrv.c @@ -1,9 +1,9 @@ -/* $Id: nurbscrv.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ +/* $Id: nurbscrv.c,v 1.2 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 2.4 - * Copyright (C) 1995-1997 Brian Paul + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -21,32 +21,6 @@ */ -/* - * $Log: nurbscrv.c,v $ - * Revision 1.1 1999/08/19 00:55:42 jtg - * Initial revision - * - * Revision 1.6 1997/07/24 01:28:44 brianp - * changed precompiled header symbol from PCH to PC_HEADER - * - * Revision 1.5 1997/05/28 02:29:38 brianp - * added support for precompiled headers (PCH), inserted APIENTRY keyword - * - * Revision 1.4 1997/05/27 03:21:22 brianp - * minor clean-up - * - * Revision 1.3 1997/05/27 03:00:16 brianp - * incorporated Bogdan's new NURBS code - * - * Revision 1.2 1996/09/27 23:12:22 brianp - * added return 0 to get_surface_dim() to silence warning - * - * Revision 1.1 1996/09/27 01:19:39 brianp - * Initial revision - * - */ - - /* * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) * See README2 for more info. @@ -66,435 +40,406 @@ static int get_curve_dim(GLenum type) { - switch(type) - { - case GL_MAP1_VERTEX_3: return 3; - case GL_MAP1_VERTEX_4: return 4; - case GL_MAP1_INDEX: return 1; - case GL_MAP1_COLOR_4: return 4; - case GL_MAP1_NORMAL: return 3; - case GL_MAP1_TEXTURE_COORD_1: return 1; - case GL_MAP1_TEXTURE_COORD_2: return 2; - case GL_MAP1_TEXTURE_COORD_3: return 3; - case GL_MAP1_TEXTURE_COORD_4: return 4; - default: abort(); /* TODO: is this OK? */ - } - return 0; /*never get here*/ + switch (type) { + case GL_MAP1_VERTEX_3: + return 3; + case GL_MAP1_VERTEX_4: + return 4; + case GL_MAP1_INDEX: + return 1; + case GL_MAP1_COLOR_4: + return 4; + case GL_MAP1_NORMAL: + return 3; + case GL_MAP1_TEXTURE_COORD_1: + return 1; + case GL_MAP1_TEXTURE_COORD_2: + return 2; + case GL_MAP1_TEXTURE_COORD_3: + return 3; + case GL_MAP1_TEXTURE_COORD_4: + return 4; + default: + abort(); /* TODO: is this OK? */ + } + return 0; /*never get here */ } static GLenum -test_nurbs_curve(GLUnurbsObj *nobj, curve_attribs *attribs) +test_nurbs_curve(GLUnurbsObj * nobj, curve_attribs * attribs) { - GLenum err; - GLint tmp_int; + GLenum err; + GLint tmp_int; - if(attribs->order < 0) - { - call_user_error(nobj,GLU_INVALID_VALUE); - return GLU_ERROR; - } - glGetIntegerv(GL_MAX_EVAL_ORDER,&tmp_int); - if(attribs->order > tmp_int || attribs->order < 2) - { - call_user_error(nobj,GLU_NURBS_ERROR1); - return GLU_ERROR; - } - if(attribs->knot_count < attribs->order +2) - { - call_user_error(nobj,GLU_NURBS_ERROR2); - return GLU_ERROR; - } - if(attribs->stride < 0) - { - call_user_error(nobj,GLU_NURBS_ERROR34); - return GLU_ERROR; - } - if(attribs->knot==NULL || attribs->ctrlarray==NULL) - { - call_user_error(nobj,GLU_NURBS_ERROR36); - return GLU_ERROR; - } - if((err=test_knot(attribs->knot_count,attribs->knot,attribs->order)) - !=GLU_NO_ERROR) - { - call_user_error(nobj,err); - return GLU_ERROR; - } - return GLU_NO_ERROR; + if (attribs->order < 0) { + call_user_error(nobj, GLU_INVALID_VALUE); + return GLU_ERROR; + } + glGetIntegerv(GL_MAX_EVAL_ORDER, &tmp_int); + if (attribs->order > tmp_int || attribs->order < 2) { + call_user_error(nobj, GLU_NURBS_ERROR1); + return GLU_ERROR; + } + if (attribs->knot_count < attribs->order + 2) { + call_user_error(nobj, GLU_NURBS_ERROR2); + return GLU_ERROR; + } + if (attribs->stride < 0) { + call_user_error(nobj, GLU_NURBS_ERROR34); + return GLU_ERROR; + } + if (attribs->knot == NULL || attribs->ctrlarray == NULL) { + call_user_error(nobj, GLU_NURBS_ERROR36); + return GLU_ERROR; + } + if ((err = test_knot(attribs->knot_count, attribs->knot, attribs->order)) + != GLU_NO_ERROR) { + call_user_error(nobj, err); + return GLU_ERROR; + } + return GLU_NO_ERROR; } static GLenum -test_nurbs_curves(GLUnurbsObj *nobj) +test_nurbs_curves(GLUnurbsObj * nobj) { - /* test the geometric data */ - if(test_nurbs_curve(nobj,&(nobj->curve.geom))!=GLU_NO_ERROR) - return GLU_ERROR; - /* now test the attributive data */ - /* color */ - if(nobj->curve.color.type!=GLU_INVALID_ENUM) - if(test_nurbs_curve(nobj,&(nobj->curve.color))!=GLU_NO_ERROR) - return GLU_ERROR; - /* normal */ - if(nobj->curve.normal.type!=GLU_INVALID_ENUM) - if(test_nurbs_curve(nobj,&(nobj->curve.normal))!=GLU_NO_ERROR) - return GLU_ERROR; - /* texture */ - if(nobj->curve.texture.type!=GLU_INVALID_ENUM) - if(test_nurbs_curve(nobj,&(nobj->curve.texture))!=GLU_NO_ERROR) - return GLU_ERROR; - return GLU_NO_ERROR; + /* test the geometric data */ + if (test_nurbs_curve(nobj, &(nobj->curve.geom)) != GLU_NO_ERROR) + return GLU_ERROR; + /* now test the attributive data */ + /* color */ + if (nobj->curve.color.type != GLU_INVALID_ENUM) + if (test_nurbs_curve(nobj, &(nobj->curve.color)) != GLU_NO_ERROR) + return GLU_ERROR; + /* normal */ + if (nobj->curve.normal.type != GLU_INVALID_ENUM) + if (test_nurbs_curve(nobj, &(nobj->curve.normal)) != GLU_NO_ERROR) + return GLU_ERROR; + /* texture */ + if (nobj->curve.texture.type != GLU_INVALID_ENUM) + if (test_nurbs_curve(nobj, &(nobj->curve.texture)) != GLU_NO_ERROR) + return GLU_ERROR; + return GLU_NO_ERROR; } /* prepare the knot information structures */ static GLenum -fill_knot_structures(GLUnurbsObj *nobj,knot_str_type *geom_knot, - knot_str_type *color_knot, knot_str_type *normal_knot, - knot_str_type *texture_knot) +fill_knot_structures(GLUnurbsObj * nobj, knot_str_type * geom_knot, + knot_str_type * color_knot, knot_str_type * normal_knot, + knot_str_type * texture_knot) { - GLint order; - GLfloat *knot; - GLint nknots; - GLint t_min,t_max; + GLint order; + GLfloat *knot; + GLint nknots; + GLint t_min, t_max; - geom_knot->unified_knot=NULL; - knot=geom_knot->knot=nobj->curve.geom.knot; - nknots=geom_knot->nknots=nobj->curve.geom.knot_count; - order=geom_knot->order=nobj->curve.geom.order; - geom_knot->delta_nknots=0; - t_min=geom_knot->t_min=order-1; - t_max=geom_knot->t_max=nknots-order; - if(fabs(knot[t_min]-knot[t_max])open_at_begin=GL_TRUE; - } - else - geom_knot->open_at_begin=GL_FALSE; - if(fabs(knot[t_max]-knot[nknots-1])open_at_end=GL_TRUE; - } - else - geom_knot->open_at_end=GL_FALSE; - if(nobj->curve.color.type!=GLU_INVALID_ENUM) - { - color_knot->unified_knot=(GLfloat *)1; - knot=color_knot->knot=nobj->curve.color.knot; - nknots=color_knot->nknots=nobj->curve.color.knot_count; - order=color_knot->order=nobj->curve.color.order; - color_knot->delta_nknots=0; - t_min=color_knot->t_min=order-1; - t_max=color_knot->t_max=nknots-order; - if(fabs(knot[t_min]-knot[t_max])open_at_begin=GL_TRUE; - } - else - color_knot->open_at_begin=GL_FALSE; - if(fabs(knot[t_max]-knot[nknots-1])open_at_end=GL_TRUE; - } - else - color_knot->open_at_end=GL_FALSE; - } - else - color_knot->unified_knot=NULL; - if(nobj->curve.normal.type!=GLU_INVALID_ENUM) - { - normal_knot->unified_knot=(GLfloat *)1; - knot=normal_knot->knot=nobj->curve.normal.knot; - nknots=normal_knot->nknots=nobj->curve.normal.knot_count; - order=normal_knot->order=nobj->curve.normal.order; - normal_knot->delta_nknots=0; - t_min=normal_knot->t_min=order-1; - t_max=normal_knot->t_max=nknots-order; - if(fabs(knot[t_min]-knot[t_max])open_at_begin=GL_TRUE; - } - else - normal_knot->open_at_begin=GL_FALSE; - if(fabs(knot[t_max]-knot[nknots-1])open_at_end=GL_TRUE; - } - else - normal_knot->open_at_end=GL_FALSE; - } - else - normal_knot->unified_knot=NULL; - if(nobj->curve.texture.type!=GLU_INVALID_ENUM) - { - texture_knot->unified_knot=(GLfloat *)1; - knot=texture_knot->knot=nobj->curve.texture.knot; - nknots=texture_knot->nknots=nobj->curve.texture.knot_count; - order=texture_knot->order=nobj->curve.texture.order; - texture_knot->delta_nknots=0; - t_min=texture_knot->t_min=order-1; - t_max=texture_knot->t_max=nknots-order; - if(fabs(knot[t_min]-knot[t_max])open_at_begin=GL_TRUE; - } - else - texture_knot->open_at_begin=GL_FALSE; - if(fabs(knot[t_max]-knot[nknots-1])open_at_end=GL_TRUE; - } - else - texture_knot->open_at_end=GL_FALSE; - } - else - texture_knot->unified_knot=NULL; - return GLU_NO_ERROR; + geom_knot->unified_knot = NULL; + knot = geom_knot->knot = nobj->curve.geom.knot; + nknots = geom_knot->nknots = nobj->curve.geom.knot_count; + order = geom_knot->order = nobj->curve.geom.order; + geom_knot->delta_nknots = 0; + t_min = geom_knot->t_min = order - 1; + t_max = geom_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + geom_knot->open_at_begin = GL_TRUE; + } + else + geom_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + geom_knot->open_at_end = GL_TRUE; + } + else + geom_knot->open_at_end = GL_FALSE; + if (nobj->curve.color.type != GLU_INVALID_ENUM) { + color_knot->unified_knot = (GLfloat *) 1; + knot = color_knot->knot = nobj->curve.color.knot; + nknots = color_knot->nknots = nobj->curve.color.knot_count; + order = color_knot->order = nobj->curve.color.order; + color_knot->delta_nknots = 0; + t_min = color_knot->t_min = order - 1; + t_max = color_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + color_knot->open_at_begin = GL_TRUE; + } + else + color_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + color_knot->open_at_end = GL_TRUE; + } + else + color_knot->open_at_end = GL_FALSE; + } + else + color_knot->unified_knot = NULL; + if (nobj->curve.normal.type != GLU_INVALID_ENUM) { + normal_knot->unified_knot = (GLfloat *) 1; + knot = normal_knot->knot = nobj->curve.normal.knot; + nknots = normal_knot->nknots = nobj->curve.normal.knot_count; + order = normal_knot->order = nobj->curve.normal.order; + normal_knot->delta_nknots = 0; + t_min = normal_knot->t_min = order - 1; + t_max = normal_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + normal_knot->open_at_begin = GL_TRUE; + } + else + normal_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + normal_knot->open_at_end = GL_TRUE; + } + else + normal_knot->open_at_end = GL_FALSE; + } + else + normal_knot->unified_knot = NULL; + if (nobj->curve.texture.type != GLU_INVALID_ENUM) { + texture_knot->unified_knot = (GLfloat *) 1; + knot = texture_knot->knot = nobj->curve.texture.knot; + nknots = texture_knot->nknots = nobj->curve.texture.knot_count; + order = texture_knot->order = nobj->curve.texture.order; + texture_knot->delta_nknots = 0; + t_min = texture_knot->t_min = order - 1; + t_max = texture_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + texture_knot->open_at_begin = GL_TRUE; + } + else + texture_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + texture_knot->open_at_end = GL_TRUE; + } + else + texture_knot->open_at_end = GL_FALSE; + } + else + texture_knot->unified_knot = NULL; + return GLU_NO_ERROR; } /* covert the NURBS curve into a series of adjacent Bezier curves */ static GLenum -convert_curve(knot_str_type *the_knot, curve_attribs *attrib, - GLfloat **new_ctrl,GLint *ncontrol) +convert_curve(knot_str_type * the_knot, curve_attribs * attrib, + GLfloat ** new_ctrl, GLint * ncontrol) { - GLenum err; + GLenum err; - if((err=explode_knot(the_knot))!=GLU_NO_ERROR) - { - if(the_knot->unified_knot) - { - free(the_knot->unified_knot); - the_knot->unified_knot=NULL; - } - return err; - } - if(the_knot->unified_knot) - { - free(the_knot->unified_knot); - the_knot->unified_knot=NULL; - } - if((err=calc_alphas(the_knot))!=GLU_NO_ERROR) - { - free(the_knot->new_knot); - return err; - } - free(the_knot->new_knot); - if((err=calc_new_ctrl_pts(attrib->ctrlarray,attrib->stride,the_knot, - attrib->dim,new_ctrl,ncontrol)) - !=GLU_NO_ERROR) - { - free(the_knot->alpha); - return err; - } - free(the_knot->alpha); - return GLU_NO_ERROR; + if ((err = explode_knot(the_knot)) != GLU_NO_ERROR) { + if (the_knot->unified_knot) { + free(the_knot->unified_knot); + the_knot->unified_knot = NULL; + } + return err; + } + if (the_knot->unified_knot) { + free(the_knot->unified_knot); + the_knot->unified_knot = NULL; + } + if ((err = calc_alphas(the_knot)) != GLU_NO_ERROR) { + free(the_knot->new_knot); + return err; + } + free(the_knot->new_knot); + if ((err = calc_new_ctrl_pts(attrib->ctrlarray, attrib->stride, the_knot, + attrib->dim, new_ctrl, ncontrol)) + != GLU_NO_ERROR) { + free(the_knot->alpha); + return err; + } + free(the_knot->alpha); + return GLU_NO_ERROR; } /* covert curves - geometry and possible attribute ones into equivalent */ /* sequence of adjacent Bezier curves */ static GLenum -convert_curves(GLUnurbsObj *nobj, GLfloat **new_geom_ctrl, - GLint *ncontrol, GLfloat **new_color_ctrl, GLfloat **new_normal_ctrl, - GLfloat **new_texture_ctrl) +convert_curves(GLUnurbsObj * nobj, GLfloat ** new_geom_ctrl, + GLint * ncontrol, GLfloat ** new_color_ctrl, + GLfloat ** new_normal_ctrl, GLfloat ** new_texture_ctrl) { - knot_str_type geom_knot,color_knot,normal_knot,texture_knot; - GLint junk; - GLenum err; + knot_str_type geom_knot, color_knot, normal_knot, texture_knot; + GLint junk; + GLenum err; - *new_color_ctrl=*new_normal_ctrl=*new_texture_ctrl=NULL; + *new_color_ctrl = *new_normal_ctrl = *new_texture_ctrl = NULL; - if(fill_knot_structures(nobj,&geom_knot,&color_knot,&normal_knot, - &texture_knot)!=GLU_NO_ERROR) - return GLU_ERROR; + if (fill_knot_structures(nobj, &geom_knot, &color_knot, &normal_knot, + &texture_knot) != GLU_NO_ERROR) + return GLU_ERROR; - /* unify knots - all knots should have the same number of working */ - /* ranges */ - if((err=select_knot_working_range(nobj,&geom_knot,&color_knot,&normal_knot, - &texture_knot))!=GLU_NO_ERROR) - { - return err; - } - /* convert the geometry curve */ - nobj->curve.geom.dim=get_curve_dim(nobj->curve.geom.type); - if((err=convert_curve(&geom_knot,&(nobj->curve.geom),new_geom_ctrl, - ncontrol))!=GLU_NO_ERROR) - { - free_unified_knots(&geom_knot,&color_knot,&normal_knot,&texture_knot); - call_user_error(nobj,err); - return err; - } - /* if additional attributive curves are given convert them as well */ - if(color_knot.unified_knot) - { - nobj->curve.color.dim=get_curve_dim(nobj->curve.color.type); - if((err=convert_curve(&color_knot,&(nobj->curve.color), - new_color_ctrl,&junk))!=GLU_NO_ERROR) - { - free_unified_knots(&geom_knot,&color_knot,&normal_knot,&texture_knot); - free(*new_geom_ctrl); - call_user_error(nobj,err); - return err; - } - } - if(normal_knot.unified_knot) - { - nobj->curve.normal.dim=get_curve_dim(nobj->curve.normal.type); - if((err=convert_curve(&normal_knot,&(nobj->curve.normal), - new_normal_ctrl,&junk))!=GLU_NO_ERROR) - { - free_unified_knots(&geom_knot,&color_knot,&normal_knot,&texture_knot); - free(*new_geom_ctrl); - if(*new_color_ctrl) - free(*new_color_ctrl); - call_user_error(nobj,err); - return err; - } - } - if(texture_knot.unified_knot) - { - nobj->curve.texture.dim=get_curve_dim(nobj->curve.texture.type); - if((err=convert_curve(&texture_knot,&(nobj->curve.texture), - new_texture_ctrl,&junk))!=GLU_NO_ERROR) - { - free_unified_knots(&geom_knot,&color_knot,&normal_knot,&texture_knot); - free(*new_geom_ctrl); - if(*new_color_ctrl) - free(*new_color_ctrl); - if(*new_normal_ctrl) - free(*new_normal_ctrl); - call_user_error(nobj,err); - return err; - } - } - return GLU_NO_ERROR; + /* unify knots - all knots should have the same number of working */ + /* ranges */ + if ( + (err = + select_knot_working_range(nobj, &geom_knot, &color_knot, &normal_knot, + &texture_knot)) != GLU_NO_ERROR) { + return err; + } + /* convert the geometry curve */ + nobj->curve.geom.dim = get_curve_dim(nobj->curve.geom.type); + if ((err = convert_curve(&geom_knot, &(nobj->curve.geom), new_geom_ctrl, + ncontrol)) != GLU_NO_ERROR) { + free_unified_knots(&geom_knot, &color_knot, &normal_knot, + &texture_knot); + call_user_error(nobj, err); + return err; + } + /* if additional attributive curves are given convert them as well */ + if (color_knot.unified_knot) { + nobj->curve.color.dim = get_curve_dim(nobj->curve.color.type); + if ((err = convert_curve(&color_knot, &(nobj->curve.color), + new_color_ctrl, &junk)) != GLU_NO_ERROR) { + free_unified_knots(&geom_knot, &color_knot, &normal_knot, + &texture_knot); + free(*new_geom_ctrl); + call_user_error(nobj, err); + return err; + } + } + if (normal_knot.unified_knot) { + nobj->curve.normal.dim = get_curve_dim(nobj->curve.normal.type); + if ((err = convert_curve(&normal_knot, &(nobj->curve.normal), + new_normal_ctrl, &junk)) != GLU_NO_ERROR) { + free_unified_knots(&geom_knot, &color_knot, &normal_knot, + &texture_knot); + free(*new_geom_ctrl); + if (*new_color_ctrl) + free(*new_color_ctrl); + call_user_error(nobj, err); + return err; + } + } + if (texture_knot.unified_knot) { + nobj->curve.texture.dim = get_curve_dim(nobj->curve.texture.type); + if ((err = convert_curve(&texture_knot, &(nobj->curve.texture), + new_texture_ctrl, &junk)) != GLU_NO_ERROR) { + free_unified_knots(&geom_knot, &color_knot, &normal_knot, + &texture_knot); + free(*new_geom_ctrl); + if (*new_color_ctrl) + free(*new_color_ctrl); + if (*new_normal_ctrl) + free(*new_normal_ctrl); + call_user_error(nobj, err); + return err; + } + } + return GLU_NO_ERROR; } /* main NURBS curve procedure */ -void do_nurbs_curve( GLUnurbsObj *nobj) +void +do_nurbs_curve(GLUnurbsObj * nobj) { - GLint geom_order,color_order=0,normal_order=0,texture_order=0; - GLenum geom_type; - GLint n_ctrl; - GLfloat *new_geom_ctrl,*new_color_ctrl,*new_normal_ctrl,*new_texture_ctrl; - GLfloat *geom_ctrl,*color_ctrl,*normal_ctrl,*texture_ctrl; - GLint *factors; - GLint i,j; - GLint geom_dim,color_dim=0,normal_dim=0,texture_dim=0; + GLint geom_order, color_order = 0, normal_order = 0, texture_order = 0; + GLenum geom_type; + GLint n_ctrl; + GLfloat *new_geom_ctrl, *new_color_ctrl, *new_normal_ctrl, + *new_texture_ctrl; + GLfloat *geom_ctrl, *color_ctrl, *normal_ctrl, *texture_ctrl; + GLint *factors; + GLint i, j; + GLint geom_dim, color_dim = 0, normal_dim = 0, texture_dim = 0; - /* test the user supplied data */ - if(test_nurbs_curves(nobj)!=GLU_NO_ERROR) - return; + /* test the user supplied data */ + if (test_nurbs_curves(nobj) != GLU_NO_ERROR) + return; - if(convert_curves(nobj,&new_geom_ctrl,&n_ctrl,&new_color_ctrl, - &new_normal_ctrl,&new_texture_ctrl)!=GLU_NO_ERROR) - return; + if (convert_curves(nobj, &new_geom_ctrl, &n_ctrl, &new_color_ctrl, + &new_normal_ctrl, &new_texture_ctrl) != GLU_NO_ERROR) + return; - geom_order=nobj->curve.geom.order; - geom_type=nobj->curve.geom.type; - geom_dim=nobj->curve.geom.dim; + geom_order = nobj->curve.geom.order; + geom_type = nobj->curve.geom.type; + geom_dim = nobj->curve.geom.dim; - if(glu_do_sampling_crv(nobj,new_geom_ctrl,n_ctrl,geom_order,geom_dim, - &factors) - !=GLU_NO_ERROR) - { - free(new_geom_ctrl); - if(new_color_ctrl) - free(new_color_ctrl); - if(new_normal_ctrl) - free(new_normal_ctrl); - if(new_texture_ctrl) - free(new_texture_ctrl); - return; - } - glEnable(geom_type); - if(new_color_ctrl) - { - glEnable(nobj->curve.color.type); - color_dim=nobj->curve.color.dim; - color_ctrl=new_color_ctrl; - color_order=nobj->curve.color.order; - } - if(new_normal_ctrl) - { - glEnable(nobj->curve.normal.type); - normal_dim=nobj->curve.normal.dim; - normal_ctrl=new_normal_ctrl; - normal_order=nobj->curve.normal.order; - } - if(new_texture_ctrl) - { - glEnable(nobj->curve.texture.type); - texture_dim=nobj->curve.texture.dim; - texture_ctrl=new_texture_ctrl; - texture_order=nobj->curve.texture.order; - } - for(i=0 , j=0, geom_ctrl=new_geom_ctrl; - icurve.color.type, 0.0, 1.0, color_dim, - color_order,color_ctrl); - color_ctrl+=color_order*color_dim; - } - if(new_normal_ctrl) - { - glMap1f(nobj->curve.normal.type, 0.0, 1.0, normal_dim, - normal_order,normal_ctrl); - normal_ctrl+=normal_order*normal_dim; - } - if(new_texture_ctrl) - { - glMap1f(nobj->curve.texture.type, 0.0, 1.0, texture_dim, - texture_order,texture_ctrl); - texture_ctrl+=texture_order*texture_dim; - } - glMapGrid1f(factors[j],0.0,1.0); - glEvalMesh1(GL_LINE,0,factors[j]); - } - free(new_geom_ctrl); - free(factors); - if(new_color_ctrl) - free(new_color_ctrl); - if(new_normal_ctrl) - free(new_normal_ctrl); - if(new_texture_ctrl) - free(new_texture_ctrl); + if (glu_do_sampling_crv(nobj, new_geom_ctrl, n_ctrl, geom_order, geom_dim, + &factors) != GLU_NO_ERROR) { + free(new_geom_ctrl); + if (new_color_ctrl) + free(new_color_ctrl); + if (new_normal_ctrl) + free(new_normal_ctrl); + if (new_texture_ctrl) + free(new_texture_ctrl); + return; + } + glEnable(geom_type); + if (new_color_ctrl) { + glEnable(nobj->curve.color.type); + color_dim = nobj->curve.color.dim; + color_ctrl = new_color_ctrl; + color_order = nobj->curve.color.order; + } + if (new_normal_ctrl) { + glEnable(nobj->curve.normal.type); + normal_dim = nobj->curve.normal.dim; + normal_ctrl = new_normal_ctrl; + normal_order = nobj->curve.normal.order; + } + if (new_texture_ctrl) { + glEnable(nobj->curve.texture.type); + texture_dim = nobj->curve.texture.dim; + texture_ctrl = new_texture_ctrl; + texture_order = nobj->curve.texture.order; + } + for (i = 0, j = 0, geom_ctrl = new_geom_ctrl; + i < n_ctrl; i += geom_order, j++, geom_ctrl += geom_order * geom_dim) { + if (fine_culling_test_2D + (nobj, geom_ctrl, geom_order, geom_dim, geom_dim)) { + color_ctrl += color_order * color_dim; + normal_ctrl += normal_order * normal_dim; + texture_ctrl += texture_order * texture_dim; + continue; + } + glMap1f(geom_type, 0.0, 1.0, geom_dim, geom_order, geom_ctrl); + if (new_color_ctrl) { + glMap1f(nobj->curve.color.type, 0.0, 1.0, color_dim, + color_order, color_ctrl); + color_ctrl += color_order * color_dim; + } + if (new_normal_ctrl) { + glMap1f(nobj->curve.normal.type, 0.0, 1.0, normal_dim, + normal_order, normal_ctrl); + normal_ctrl += normal_order * normal_dim; + } + if (new_texture_ctrl) { + glMap1f(nobj->curve.texture.type, 0.0, 1.0, texture_dim, + texture_order, texture_ctrl); + texture_ctrl += texture_order * texture_dim; + } + glMapGrid1f(factors[j], 0.0, 1.0); + glEvalMesh1(GL_LINE, 0, factors[j]); + } + free(new_geom_ctrl); + free(factors); + if (new_color_ctrl) + free(new_color_ctrl); + if (new_normal_ctrl) + free(new_normal_ctrl); + if (new_texture_ctrl) + free(new_texture_ctrl); } - - diff --git a/src/glu/mesa/nurbssrf.c b/src/glu/mesa/nurbssrf.c index 57eb9569862..c8d44bec0df 100644 --- a/src/glu/mesa/nurbssrf.c +++ b/src/glu/mesa/nurbssrf.c @@ -1,9 +1,9 @@ -/* $Id: nurbssrf.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ +/* $Id: nurbssrf.c,v 1.2 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 2.4 - * Copyright (C) 1995-1997 Brian Paul + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -21,35 +21,6 @@ */ -/* - * $Log: nurbssrf.c,v $ - * Revision 1.1 1999/08/19 00:55:42 jtg - * Initial revision - * - * Revision 1.7 1997/07/24 01:28:44 brianp - * changed precompiled header symbol from PCH to PC_HEADER - * - * Revision 1.6 1997/06/23 00:22:07 brianp - * include - * - * Revision 1.5 1997/05/28 02:29:38 brianp - * added support for precompiled headers (PCH), inserted APIENTRY keyword - * - * Revision 1.4 1997/05/27 03:20:35 brianp - * minor clean-up - * - * Revision 1.3 1997/05/27 03:00:16 brianp - * incorporated Bogdan's new NURBS code - * - * Revision 1.2 1996/09/27 23:13:02 brianp - * added return 0 to get_surface_dim() to silence warning - * - * Revision 1.1 1996/09/27 01:19:39 brianp - * Initial revision - * - */ - - /* * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) * See README2 for more info. @@ -70,1119 +41,1048 @@ static int get_surface_dim(GLenum type) { - switch(type) - { - case GL_MAP2_VERTEX_3: return 3; - case GL_MAP2_VERTEX_4: return 4; - case GL_MAP2_INDEX: return 1; - case GL_MAP2_COLOR_4: return 4; - case GL_MAP2_NORMAL: return 3; - case GL_MAP2_TEXTURE_COORD_1: return 1; - case GL_MAP2_TEXTURE_COORD_2: return 2; - case GL_MAP2_TEXTURE_COORD_3: return 3; - case GL_MAP2_TEXTURE_COORD_4: return 4; - default: abort(); /* TODO: is this OK? */ - } - return 0; /*never get here*/ + switch (type) { + case GL_MAP2_VERTEX_3: + return 3; + case GL_MAP2_VERTEX_4: + return 4; + case GL_MAP2_INDEX: + return 1; + case GL_MAP2_COLOR_4: + return 4; + case GL_MAP2_NORMAL: + return 3; + case GL_MAP2_TEXTURE_COORD_1: + return 1; + case GL_MAP2_TEXTURE_COORD_2: + return 2; + case GL_MAP2_TEXTURE_COORD_3: + return 3; + case GL_MAP2_TEXTURE_COORD_4: + return 4; + default: + abort(); /* TODO: is this OK? */ + } + return 0; /*never get here */ } static GLenum -test_nurbs_surface(GLUnurbsObj *nobj, surface_attribs *attrib) +test_nurbs_surface(GLUnurbsObj * nobj, surface_attribs * attrib) { - GLenum err; - GLint tmp_int; + GLenum err; + GLint tmp_int; - if(attrib->sorder < 0 || attrib->torder < 0) - { - call_user_error(nobj,GLU_INVALID_VALUE); - return GLU_ERROR; - } - glGetIntegerv(GL_MAX_EVAL_ORDER,&tmp_int); - if(attrib->sorder > tmp_int || attrib->sorder < 2) - { - call_user_error(nobj,GLU_NURBS_ERROR1); - return GLU_ERROR; - } - if(attrib->torder > tmp_int || attrib->torder < 2) - { - call_user_error(nobj,GLU_NURBS_ERROR1); - return GLU_ERROR; - } - if(attrib->sknot_count < attrib->sorder +2) - { - call_user_error(nobj,GLU_NURBS_ERROR2); - return GLU_ERROR; - } - if(attrib->tknot_count < attrib->torder +2) - { - call_user_error(nobj,GLU_NURBS_ERROR2); - return GLU_ERROR; - } - if(attrib->s_stride < 0 || attrib->t_stride < 0) - { - call_user_error(nobj,GLU_NURBS_ERROR34); - return GLU_ERROR; - } - if(attrib->sknot==NULL || attrib->tknot==NULL || attrib->ctrlarray==NULL) - { - call_user_error(nobj,GLU_NURBS_ERROR36); - return GLU_ERROR; - } - if((err=test_knot(attrib->tknot_count,attrib->tknot,attrib->torder)) - !=GLU_NO_ERROR) - { - call_user_error(nobj,err); - return GLU_ERROR; - } - if((err=test_knot(attrib->sknot_count,attrib->sknot,attrib->sorder)) - !=GLU_NO_ERROR) - { - call_user_error(nobj,err); - return GLU_ERROR; - } - return GLU_NO_ERROR; + if (attrib->sorder < 0 || attrib->torder < 0) { + call_user_error(nobj, GLU_INVALID_VALUE); + return GLU_ERROR; + } + glGetIntegerv(GL_MAX_EVAL_ORDER, &tmp_int); + if (attrib->sorder > tmp_int || attrib->sorder < 2) { + call_user_error(nobj, GLU_NURBS_ERROR1); + return GLU_ERROR; + } + if (attrib->torder > tmp_int || attrib->torder < 2) { + call_user_error(nobj, GLU_NURBS_ERROR1); + return GLU_ERROR; + } + if (attrib->sknot_count < attrib->sorder + 2) { + call_user_error(nobj, GLU_NURBS_ERROR2); + return GLU_ERROR; + } + if (attrib->tknot_count < attrib->torder + 2) { + call_user_error(nobj, GLU_NURBS_ERROR2); + return GLU_ERROR; + } + if (attrib->s_stride < 0 || attrib->t_stride < 0) { + call_user_error(nobj, GLU_NURBS_ERROR34); + return GLU_ERROR; + } + if (attrib->sknot == NULL || attrib->tknot == NULL + || attrib->ctrlarray == NULL) { + call_user_error(nobj, GLU_NURBS_ERROR36); + return GLU_ERROR; + } + if ((err = test_knot(attrib->tknot_count, attrib->tknot, attrib->torder)) + != GLU_NO_ERROR) { + call_user_error(nobj, err); + return GLU_ERROR; + } + if ((err = test_knot(attrib->sknot_count, attrib->sknot, attrib->sorder)) + != GLU_NO_ERROR) { + call_user_error(nobj, err); + return GLU_ERROR; + } + return GLU_NO_ERROR; } static GLenum -test_nurbs_surfaces(GLUnurbsObj *nobj) +test_nurbs_surfaces(GLUnurbsObj * nobj) { - /* test the geometric data */ - if(test_nurbs_surface(nobj,&(nobj->surface.geom))!=GLU_NO_ERROR) - return GLU_ERROR; - /* now test the attributive data */ - /* color */ - if(nobj->surface.color.type!=GLU_INVALID_ENUM) - if(test_nurbs_surface(nobj,&(nobj->surface.color))!=GLU_NO_ERROR) - return GLU_ERROR; - /* normal */ - if(nobj->surface.normal.type!=GLU_INVALID_ENUM) - if(test_nurbs_surface(nobj,&(nobj->surface.normal))!=GLU_NO_ERROR) - return GLU_ERROR; - /* texture */ - if(nobj->surface.texture.type!=GLU_INVALID_ENUM) - if(test_nurbs_surface(nobj,&(nobj->surface.texture))!=GLU_NO_ERROR) - return GLU_ERROR; - return GLU_NO_ERROR; + /* test the geometric data */ + if (test_nurbs_surface(nobj, &(nobj->surface.geom)) != GLU_NO_ERROR) + return GLU_ERROR; + /* now test the attributive data */ + /* color */ + if (nobj->surface.color.type != GLU_INVALID_ENUM) + if (test_nurbs_surface(nobj, &(nobj->surface.color)) != GLU_NO_ERROR) + return GLU_ERROR; + /* normal */ + if (nobj->surface.normal.type != GLU_INVALID_ENUM) + if (test_nurbs_surface(nobj, &(nobj->surface.normal)) != GLU_NO_ERROR) + return GLU_ERROR; + /* texture */ + if (nobj->surface.texture.type != GLU_INVALID_ENUM) + if (test_nurbs_surface(nobj, &(nobj->surface.texture)) != GLU_NO_ERROR) + return GLU_ERROR; + return GLU_NO_ERROR; } static GLenum -convert_surf(knot_str_type *s_knot, knot_str_type *t_knot, - surface_attribs *attrib, GLfloat **new_ctrl, - GLint *s_n_ctrl, GLint *t_n_ctrl) +convert_surf(knot_str_type * s_knot, knot_str_type * t_knot, + surface_attribs * attrib, GLfloat ** new_ctrl, + GLint * s_n_ctrl, GLint * t_n_ctrl) { - GLfloat **tmp_ctrl; - GLfloat *ctrl_offset; - GLint tmp_n_control; - GLint i,j,t_cnt,s_cnt; - GLint tmp_stride; - GLint dim; - GLenum err; + GLfloat **tmp_ctrl; + GLfloat *ctrl_offset; + GLint tmp_n_control; + GLint i, j, t_cnt, s_cnt; + GLint tmp_stride; + GLint dim; + GLenum err; - /* valid range is empty? */ - if((s_knot->unified_knot !=NULL && s_knot->unified_nknots==0) || - (t_knot->unified_knot !=NULL && t_knot->unified_nknots==0)) - { - if(s_knot->unified_knot) - { - free(s_knot->unified_knot); - s_knot->unified_knot=NULL; - } - if(t_knot->unified_knot) - { - free(t_knot->unified_knot); - t_knot->unified_knot=NULL; - } - *s_n_ctrl=0; - *t_n_ctrl=0; - return GLU_NO_ERROR; - } - t_cnt=attrib->tknot_count-attrib->torder; - s_cnt=attrib->sknot_count-attrib->sorder; - if((tmp_ctrl=(GLfloat **)malloc(sizeof(GLfloat *)*t_cnt))==NULL) - return GLU_OUT_OF_MEMORY; - if((err=explode_knot(s_knot))!=GLU_NO_ERROR) - { - free(tmp_ctrl); - if(s_knot->unified_knot) - { - free(s_knot->unified_knot); - s_knot->unified_knot=NULL; - } - return err; - } - if(s_knot->unified_knot) - { - free(s_knot->unified_knot); - s_knot->unified_knot=NULL; - } - if((err=calc_alphas(s_knot))!=GLU_NO_ERROR) - { - free(tmp_ctrl); - free(s_knot->new_knot); - return err; - } - free(s_knot->new_knot); - ctrl_offset=attrib->ctrlarray; - dim=attrib->dim; - for(i=0;is_stride,s_knot, - dim,&(tmp_ctrl[i]),&tmp_n_control))!=GLU_NO_ERROR) - { - for(--i;i<=0;i--) - free(tmp_ctrl[i]); - free(tmp_ctrl); - free(s_knot->alpha); - return err; - } - ctrl_offset+=attrib->t_stride; - } - free(s_knot->alpha); - tmp_stride=dim*tmp_n_control; - if((*new_ctrl=(GLfloat *)malloc(sizeof(GLfloat)*tmp_stride*t_cnt)) - ==NULL) - { - for(i=0;iunified_knot) - { - free(t_knot->unified_knot); - t_knot->unified_knot=NULL; - } - return err; - } - if(t_knot->unified_knot) - { - free(t_knot->unified_knot); - t_knot->unified_knot=NULL; - } - if((err=calc_alphas(t_knot))!=GLU_NO_ERROR) - { - free(tmp_ctrl); - free(t_knot->new_knot); - return err; - } - free(t_knot->new_knot); - ctrl_offset=*new_ctrl; - for(i=0;i<(*s_n_ctrl);i++) - { - if((err=calc_new_ctrl_pts(ctrl_offset,dim,t_knot, - dim,&(tmp_ctrl[i]),&tmp_n_control))!=GLU_NO_ERROR) - { - for(--i;i<=0;i--) - free(tmp_ctrl[i]); - free(tmp_ctrl); - free(t_knot->alpha); - return err; - } - ctrl_offset+=dim*t_cnt; - } - free(t_knot->alpha); - free(*new_ctrl); - tmp_stride=dim*tmp_n_control; - if((*new_ctrl=(GLfloat *)malloc(sizeof(GLfloat)*tmp_stride*(*s_n_ctrl))) - ==NULL) - { - for(i=0;i<(*s_n_ctrl);i++) - free(tmp_ctrl[i]); - free(tmp_ctrl); - return GLU_OUT_OF_MEMORY; - } - for(i=0;i<(*s_n_ctrl);i++) - { - MEMCPY(*new_ctrl+i*tmp_stride,tmp_ctrl[i],sizeof(GLfloat)*tmp_stride); - free(tmp_ctrl[i]); - } - free(tmp_ctrl); - *t_n_ctrl=tmp_n_control; - return GLU_NO_ERROR; + /* valid range is empty? */ + if ((s_knot->unified_knot != NULL && s_knot->unified_nknots == 0) || + (t_knot->unified_knot != NULL && t_knot->unified_nknots == 0)) { + if (s_knot->unified_knot) { + free(s_knot->unified_knot); + s_knot->unified_knot = NULL; + } + if (t_knot->unified_knot) { + free(t_knot->unified_knot); + t_knot->unified_knot = NULL; + } + *s_n_ctrl = 0; + *t_n_ctrl = 0; + return GLU_NO_ERROR; + } + t_cnt = attrib->tknot_count - attrib->torder; + s_cnt = attrib->sknot_count - attrib->sorder; + if ((tmp_ctrl = (GLfloat **) malloc(sizeof(GLfloat *) * t_cnt)) == NULL) + return GLU_OUT_OF_MEMORY; + if ((err = explode_knot(s_knot)) != GLU_NO_ERROR) { + free(tmp_ctrl); + if (s_knot->unified_knot) { + free(s_knot->unified_knot); + s_knot->unified_knot = NULL; + } + return err; + } + if (s_knot->unified_knot) { + free(s_knot->unified_knot); + s_knot->unified_knot = NULL; + } + if ((err = calc_alphas(s_knot)) != GLU_NO_ERROR) { + free(tmp_ctrl); + free(s_knot->new_knot); + return err; + } + free(s_knot->new_knot); + ctrl_offset = attrib->ctrlarray; + dim = attrib->dim; + for (i = 0; i < t_cnt; i++) { + if ((err = calc_new_ctrl_pts(ctrl_offset, attrib->s_stride, s_knot, + dim, &(tmp_ctrl[i]), + &tmp_n_control)) != GLU_NO_ERROR) { + for (--i; i <= 0; i--) + free(tmp_ctrl[i]); + free(tmp_ctrl); + free(s_knot->alpha); + return err; + } + ctrl_offset += attrib->t_stride; + } + free(s_knot->alpha); + tmp_stride = dim * tmp_n_control; + if ((*new_ctrl = (GLfloat *) malloc(sizeof(GLfloat) * tmp_stride * t_cnt)) + == NULL) { + for (i = 0; i < t_cnt; i++) + free(tmp_ctrl[i]); + free(tmp_ctrl); + return GLU_OUT_OF_MEMORY; + } + for (i = 0; i < tmp_n_control; i++) + for (j = 0; j < t_cnt; j++) + MEMCPY(*new_ctrl + j * dim + i * dim * t_cnt, tmp_ctrl[j] + dim * i, + sizeof(GLfloat) * dim); + for (i = 0; i < t_cnt; i++) + free(tmp_ctrl[i]); + free(tmp_ctrl); + *s_n_ctrl = tmp_n_control; + + if ((tmp_ctrl = (GLfloat **) malloc(sizeof(GLfloat *) * (*s_n_ctrl))) == + NULL) { + return GLU_OUT_OF_MEMORY; + } + if ((err = explode_knot(t_knot)) != GLU_NO_ERROR) { + free(tmp_ctrl); + if (t_knot->unified_knot) { + free(t_knot->unified_knot); + t_knot->unified_knot = NULL; + } + return err; + } + if (t_knot->unified_knot) { + free(t_knot->unified_knot); + t_knot->unified_knot = NULL; + } + if ((err = calc_alphas(t_knot)) != GLU_NO_ERROR) { + free(tmp_ctrl); + free(t_knot->new_knot); + return err; + } + free(t_knot->new_knot); + ctrl_offset = *new_ctrl; + for (i = 0; i < (*s_n_ctrl); i++) { + if ((err = calc_new_ctrl_pts(ctrl_offset, dim, t_knot, + dim, &(tmp_ctrl[i]), + &tmp_n_control)) != GLU_NO_ERROR) { + for (--i; i <= 0; i--) + free(tmp_ctrl[i]); + free(tmp_ctrl); + free(t_knot->alpha); + return err; + } + ctrl_offset += dim * t_cnt; + } + free(t_knot->alpha); + free(*new_ctrl); + tmp_stride = dim * tmp_n_control; + if ( + (*new_ctrl = + (GLfloat *) malloc(sizeof(GLfloat) * tmp_stride * (*s_n_ctrl))) == + NULL) { + for (i = 0; i < (*s_n_ctrl); i++) + free(tmp_ctrl[i]); + free(tmp_ctrl); + return GLU_OUT_OF_MEMORY; + } + for (i = 0; i < (*s_n_ctrl); i++) { + MEMCPY(*new_ctrl + i * tmp_stride, tmp_ctrl[i], + sizeof(GLfloat) * tmp_stride); + free(tmp_ctrl[i]); + } + free(tmp_ctrl); + *t_n_ctrl = tmp_n_control; + return GLU_NO_ERROR; } /* prepare the knot information structures */ static GLenum -fill_knot_structures(GLUnurbsObj *nobj, - knot_str_type *geom_s_knot, knot_str_type *geom_t_knot, - knot_str_type *color_s_knot, knot_str_type *color_t_knot, - knot_str_type *normal_s_knot, knot_str_type *normal_t_knot, - knot_str_type *texture_s_knot, knot_str_type *texture_t_knot) +fill_knot_structures(GLUnurbsObj * nobj, + knot_str_type * geom_s_knot, knot_str_type * geom_t_knot, + knot_str_type * color_s_knot, + knot_str_type * color_t_knot, + knot_str_type * normal_s_knot, + knot_str_type * normal_t_knot, + knot_str_type * texture_s_knot, + knot_str_type * texture_t_knot) { - GLint order; - GLfloat *knot; - GLint nknots; - GLint t_min,t_max; + GLint order; + GLfloat *knot; + GLint nknots; + GLint t_min, t_max; - geom_s_knot->unified_knot=NULL; - knot=geom_s_knot->knot=nobj->surface.geom.sknot; - nknots=geom_s_knot->nknots=nobj->surface.geom.sknot_count; - order=geom_s_knot->order=nobj->surface.geom.sorder; - geom_s_knot->delta_nknots=0; - t_min=geom_s_knot->t_min=order-1; - t_max=geom_s_knot->t_max=nknots-order; - if(fabs(knot[t_min]-knot[t_max])open_at_begin=GL_TRUE; - } - else - geom_s_knot->open_at_begin=GL_FALSE; - if(fabs(knot[t_max]-knot[nknots-1])open_at_end=GL_TRUE; - } - else - geom_s_knot->open_at_end=GL_FALSE; - geom_t_knot->unified_knot=NULL; - knot=geom_t_knot->knot=nobj->surface.geom.tknot; - nknots=geom_t_knot->nknots=nobj->surface.geom.tknot_count; - order=geom_t_knot->order=nobj->surface.geom.torder; - geom_t_knot->delta_nknots=0; - t_min=geom_t_knot->t_min=order-1; - t_max=geom_t_knot->t_max=nknots-order; - if(fabs(knot[t_min]-knot[t_max])open_at_begin=GL_TRUE; - } - else - geom_t_knot->open_at_begin=GL_FALSE; - if(fabs(knot[t_max]-knot[nknots-1])open_at_end=GL_TRUE; - } - else - geom_t_knot->open_at_end=GL_FALSE; + geom_s_knot->unified_knot = NULL; + knot = geom_s_knot->knot = nobj->surface.geom.sknot; + nknots = geom_s_knot->nknots = nobj->surface.geom.sknot_count; + order = geom_s_knot->order = nobj->surface.geom.sorder; + geom_s_knot->delta_nknots = 0; + t_min = geom_s_knot->t_min = order - 1; + t_max = geom_s_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + geom_s_knot->open_at_begin = GL_TRUE; + } + else + geom_s_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + geom_s_knot->open_at_end = GL_TRUE; + } + else + geom_s_knot->open_at_end = GL_FALSE; + geom_t_knot->unified_knot = NULL; + knot = geom_t_knot->knot = nobj->surface.geom.tknot; + nknots = geom_t_knot->nknots = nobj->surface.geom.tknot_count; + order = geom_t_knot->order = nobj->surface.geom.torder; + geom_t_knot->delta_nknots = 0; + t_min = geom_t_knot->t_min = order - 1; + t_max = geom_t_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + geom_t_knot->open_at_begin = GL_TRUE; + } + else + geom_t_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + geom_t_knot->open_at_end = GL_TRUE; + } + else + geom_t_knot->open_at_end = GL_FALSE; - if(nobj->surface.color.type!=GLU_INVALID_ENUM) - { - color_s_knot->unified_knot=(GLfloat *)1; - knot=color_s_knot->knot=nobj->surface.color.sknot; - nknots=color_s_knot->nknots=nobj->surface.color.sknot_count; - order=color_s_knot->order=nobj->surface.color.sorder; - color_s_knot->delta_nknots=0; - t_min=color_s_knot->t_min=order-1; - t_max=color_s_knot->t_max=nknots-order; - if(fabs(knot[t_min]-knot[t_max])open_at_begin=GL_TRUE; - } - else - color_s_knot->open_at_begin=GL_FALSE; - if(fabs(knot[t_max]-knot[nknots-1])open_at_end=GL_TRUE; - } - else - color_s_knot->open_at_end=GL_FALSE; - color_t_knot->unified_knot=(GLfloat *)1; - knot=color_t_knot->knot=nobj->surface.color.tknot; - nknots=color_t_knot->nknots=nobj->surface.color.tknot_count; - order=color_t_knot->order=nobj->surface.color.torder; - color_t_knot->delta_nknots=0; - t_min=color_t_knot->t_min=order-1; - t_max=color_t_knot->t_max=nknots-order; - if(fabs(knot[t_min]-knot[t_max])open_at_begin=GL_TRUE; - } - else - color_t_knot->open_at_begin=GL_FALSE; - if(fabs(knot[t_max]-knot[nknots-1])open_at_end=GL_TRUE; - } - else - color_t_knot->open_at_end=GL_FALSE; - } - else - { - color_s_knot->unified_knot=NULL; - color_t_knot->unified_knot=NULL; - } + if (nobj->surface.color.type != GLU_INVALID_ENUM) { + color_s_knot->unified_knot = (GLfloat *) 1; + knot = color_s_knot->knot = nobj->surface.color.sknot; + nknots = color_s_knot->nknots = nobj->surface.color.sknot_count; + order = color_s_knot->order = nobj->surface.color.sorder; + color_s_knot->delta_nknots = 0; + t_min = color_s_knot->t_min = order - 1; + t_max = color_s_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + color_s_knot->open_at_begin = GL_TRUE; + } + else + color_s_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + color_s_knot->open_at_end = GL_TRUE; + } + else + color_s_knot->open_at_end = GL_FALSE; + color_t_knot->unified_knot = (GLfloat *) 1; + knot = color_t_knot->knot = nobj->surface.color.tknot; + nknots = color_t_knot->nknots = nobj->surface.color.tknot_count; + order = color_t_knot->order = nobj->surface.color.torder; + color_t_knot->delta_nknots = 0; + t_min = color_t_knot->t_min = order - 1; + t_max = color_t_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + color_t_knot->open_at_begin = GL_TRUE; + } + else + color_t_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + color_t_knot->open_at_end = GL_TRUE; + } + else + color_t_knot->open_at_end = GL_FALSE; + } + else { + color_s_knot->unified_knot = NULL; + color_t_knot->unified_knot = NULL; + } - if(nobj->surface.normal.type!=GLU_INVALID_ENUM) - { - normal_s_knot->unified_knot=(GLfloat *)1; - knot=normal_s_knot->knot=nobj->surface.normal.sknot; - nknots=normal_s_knot->nknots=nobj->surface.normal.sknot_count; - order=normal_s_knot->order=nobj->surface.normal.sorder; - normal_s_knot->delta_nknots=0; - t_min=normal_s_knot->t_min=order-1; - t_max=normal_s_knot->t_max=nknots-order; - if(fabs(knot[t_min]-knot[t_max])open_at_begin=GL_TRUE; - } - else - normal_s_knot->open_at_begin=GL_FALSE; - if(fabs(knot[t_max]-knot[nknots-1])open_at_end=GL_TRUE; - } - else - normal_s_knot->open_at_end=GL_FALSE; - normal_t_knot->unified_knot=(GLfloat *)1; - knot=normal_t_knot->knot=nobj->surface.normal.tknot; - nknots=normal_t_knot->nknots=nobj->surface.normal.tknot_count; - order=normal_t_knot->order=nobj->surface.normal.torder; - normal_t_knot->delta_nknots=0; - t_min=normal_t_knot->t_min=order-1; - t_max=normal_t_knot->t_max=nknots-order; - if(fabs(knot[t_min]-knot[t_max])open_at_begin=GL_TRUE; - } - else - normal_t_knot->open_at_begin=GL_FALSE; - if(fabs(knot[t_max]-knot[nknots-1])open_at_end=GL_TRUE; - } - else - normal_t_knot->open_at_end=GL_FALSE; - } - else - { - normal_s_knot->unified_knot=NULL; - normal_t_knot->unified_knot=NULL; - } + if (nobj->surface.normal.type != GLU_INVALID_ENUM) { + normal_s_knot->unified_knot = (GLfloat *) 1; + knot = normal_s_knot->knot = nobj->surface.normal.sknot; + nknots = normal_s_knot->nknots = nobj->surface.normal.sknot_count; + order = normal_s_knot->order = nobj->surface.normal.sorder; + normal_s_knot->delta_nknots = 0; + t_min = normal_s_knot->t_min = order - 1; + t_max = normal_s_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + normal_s_knot->open_at_begin = GL_TRUE; + } + else + normal_s_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + normal_s_knot->open_at_end = GL_TRUE; + } + else + normal_s_knot->open_at_end = GL_FALSE; + normal_t_knot->unified_knot = (GLfloat *) 1; + knot = normal_t_knot->knot = nobj->surface.normal.tknot; + nknots = normal_t_knot->nknots = nobj->surface.normal.tknot_count; + order = normal_t_knot->order = nobj->surface.normal.torder; + normal_t_knot->delta_nknots = 0; + t_min = normal_t_knot->t_min = order - 1; + t_max = normal_t_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + normal_t_knot->open_at_begin = GL_TRUE; + } + else + normal_t_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + normal_t_knot->open_at_end = GL_TRUE; + } + else + normal_t_knot->open_at_end = GL_FALSE; + } + else { + normal_s_knot->unified_knot = NULL; + normal_t_knot->unified_knot = NULL; + } - if(nobj->surface.texture.type!=GLU_INVALID_ENUM) - { - texture_s_knot->unified_knot=(GLfloat *)1; - knot=texture_s_knot->knot=nobj->surface.texture.sknot; - nknots=texture_s_knot->nknots=nobj->surface.texture.sknot_count; - order=texture_s_knot->order=nobj->surface.texture.sorder; - texture_s_knot->delta_nknots=0; - t_min=texture_s_knot->t_min=order-1; - t_max=texture_s_knot->t_max=nknots-order; - if(fabs(knot[t_min]-knot[t_max])open_at_begin=GL_TRUE; - } - else - texture_s_knot->open_at_begin=GL_FALSE; - if(fabs(knot[t_max]-knot[nknots-1])open_at_end=GL_TRUE; - } - else - texture_s_knot->open_at_end=GL_FALSE; - texture_t_knot->unified_knot=(GLfloat *)1; - knot=texture_t_knot->knot=nobj->surface.texture.tknot; - nknots=texture_t_knot->nknots=nobj->surface.texture.tknot_count; - order=texture_t_knot->order=nobj->surface.texture.torder; - texture_t_knot->delta_nknots=0; - t_min=texture_t_knot->t_min=order-1; - t_max=texture_t_knot->t_max=nknots-order; - if(fabs(knot[t_min]-knot[t_max])open_at_begin=GL_TRUE; - } - else - texture_t_knot->open_at_begin=GL_FALSE; - if(fabs(knot[t_max]-knot[nknots-1])open_at_end=GL_TRUE; - } - else - texture_t_knot->open_at_end=GL_FALSE; - } - else - { - texture_s_knot->unified_knot=NULL; - texture_t_knot->unified_knot=NULL; - } - return GLU_NO_ERROR; + if (nobj->surface.texture.type != GLU_INVALID_ENUM) { + texture_s_knot->unified_knot = (GLfloat *) 1; + knot = texture_s_knot->knot = nobj->surface.texture.sknot; + nknots = texture_s_knot->nknots = nobj->surface.texture.sknot_count; + order = texture_s_knot->order = nobj->surface.texture.sorder; + texture_s_knot->delta_nknots = 0; + t_min = texture_s_knot->t_min = order - 1; + t_max = texture_s_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + texture_s_knot->open_at_begin = GL_TRUE; + } + else + texture_s_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + texture_s_knot->open_at_end = GL_TRUE; + } + else + texture_s_knot->open_at_end = GL_FALSE; + texture_t_knot->unified_knot = (GLfloat *) 1; + knot = texture_t_knot->knot = nobj->surface.texture.tknot; + nknots = texture_t_knot->nknots = nobj->surface.texture.tknot_count; + order = texture_t_knot->order = nobj->surface.texture.torder; + texture_t_knot->delta_nknots = 0; + t_min = texture_t_knot->t_min = order - 1; + t_max = texture_t_knot->t_max = nknots - order; + if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { + call_user_error(nobj, GLU_NURBS_ERROR3); + return GLU_ERROR; + } + if (fabs(knot[0] - knot[t_min]) < EPSILON) { + /* knot open at beggining */ + texture_t_knot->open_at_begin = GL_TRUE; + } + else + texture_t_knot->open_at_begin = GL_FALSE; + if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { + /* knot open at end */ + texture_t_knot->open_at_end = GL_TRUE; + } + else + texture_t_knot->open_at_end = GL_FALSE; + } + else { + texture_s_knot->unified_knot = NULL; + texture_t_knot->unified_knot = NULL; + } + return GLU_NO_ERROR; } -void -free_new_ctrl(new_ctrl_type *p) + +static void +free_new_ctrl(new_ctrl_type * p) { - if(p->geom_ctrl) - free(p->geom_ctrl); - if(p->geom_offsets) - free(p->geom_offsets); - if(p->color_ctrl) - { - free(p->color_ctrl); - if(p->color_offsets) - free(p->color_offsets); - } - if(p->normal_ctrl) - { - free(p->normal_ctrl); - if(p->normal_offsets) - free(p->normal_offsets); - } - if(p->texture_ctrl) - { - free(p->texture_ctrl); - if(p->texture_offsets) - free(p->texture_offsets); - } + if (p->geom_ctrl) + free(p->geom_ctrl); + if (p->geom_offsets) + free(p->geom_offsets); + if (p->color_ctrl) { + free(p->color_ctrl); + if (p->color_offsets) + free(p->color_offsets); + } + if (p->normal_ctrl) { + free(p->normal_ctrl); + if (p->normal_offsets) + free(p->normal_offsets); + } + if (p->texture_ctrl) { + free(p->texture_ctrl); + if (p->texture_offsets) + free(p->texture_offsets); + } } /* convert surfaces - geometry and possible attribute ones into equivalent */ /* sequence of adjacent Bezier patches */ static GLenum -convert_surfs(GLUnurbsObj *nobj, new_ctrl_type *new_ctrl) +convert_surfs(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl) { - knot_str_type geom_s_knot,color_s_knot,normal_s_knot,texture_s_knot; - knot_str_type geom_t_knot,color_t_knot,normal_t_knot,texture_t_knot; - GLenum err; + knot_str_type geom_s_knot, color_s_knot, normal_s_knot, texture_s_knot; + knot_str_type geom_t_knot, color_t_knot, normal_t_knot, texture_t_knot; + GLenum err; - if((err=fill_knot_structures(nobj,&geom_s_knot,&geom_t_knot, - &color_s_knot,&color_t_knot,&normal_s_knot,&normal_t_knot, - &texture_s_knot,&texture_t_knot)) !=GLU_NO_ERROR) - { - return err; - } - /* unify knots - all knots should have the same working range */ - if((err=select_knot_working_range(nobj,&geom_s_knot,&color_s_knot, - &normal_s_knot,&texture_s_knot)) !=GLU_NO_ERROR) - { - call_user_error(nobj,err); - return err; - } - if((err=select_knot_working_range(nobj,&geom_t_knot,&color_t_knot, - &normal_t_knot,&texture_t_knot)) !=GLU_NO_ERROR) - { - free_unified_knots(&geom_s_knot,&color_s_knot,&normal_s_knot, - &texture_s_knot); - call_user_error(nobj,err); - return err; - } + if ((err = fill_knot_structures(nobj, &geom_s_knot, &geom_t_knot, + &color_s_knot, &color_t_knot, + &normal_s_knot, &normal_t_knot, + &texture_s_knot, + &texture_t_knot)) != GLU_NO_ERROR) { + return err; + } + /* unify knots - all knots should have the same working range */ + if ((err = select_knot_working_range(nobj, &geom_s_knot, &color_s_knot, + &normal_s_knot, + &texture_s_knot)) != GLU_NO_ERROR) { + call_user_error(nobj, err); + return err; + } + if ((err = select_knot_working_range(nobj, &geom_t_knot, &color_t_knot, + &normal_t_knot, + &texture_t_knot)) != GLU_NO_ERROR) { + free_unified_knots(&geom_s_knot, &color_s_knot, &normal_s_knot, + &texture_s_knot); + call_user_error(nobj, err); + return err; + } - /* convert the geometry surface */ - nobj->surface.geom.dim=get_surface_dim(nobj->surface.geom.type); - if((err=convert_surf(&geom_s_knot,&geom_t_knot,&(nobj->surface.geom), - &(new_ctrl->geom_ctrl),&(new_ctrl->geom_s_pt_cnt), - &(new_ctrl->geom_t_pt_cnt)))!=GLU_NO_ERROR) - { - free_unified_knots(&geom_s_knot,&color_s_knot,&normal_s_knot, - &texture_s_knot); - free_unified_knots(&geom_t_knot,&color_t_knot,&normal_t_knot, - &texture_t_knot); - call_user_error(nobj,err); - return err; - } - /* if additional attributive surfaces are given convert them as well */ - if(color_s_knot.unified_knot) - { - nobj->surface.color.dim=get_surface_dim(nobj->surface.color.type); - if((err=convert_surf(&color_s_knot,&color_t_knot,&(nobj->surface.color), - &(new_ctrl->color_ctrl),&(new_ctrl->color_s_pt_cnt), - &(new_ctrl->color_t_pt_cnt)))!=GLU_NO_ERROR) - { - free_unified_knots(&color_s_knot,&color_s_knot,&normal_s_knot, - &texture_s_knot); - free_unified_knots(&color_t_knot,&color_t_knot,&normal_t_knot, - &texture_t_knot); - free_new_ctrl(new_ctrl); - call_user_error(nobj,err); - return err; - } - } - if(normal_s_knot.unified_knot) - { - nobj->surface.normal.dim=get_surface_dim(nobj->surface.normal.type); - if((err=convert_surf(&normal_s_knot,&normal_t_knot, - &(nobj->surface.normal), - &(new_ctrl->normal_ctrl),&(new_ctrl->normal_s_pt_cnt), - &(new_ctrl->normal_t_pt_cnt)))!=GLU_NO_ERROR) - { - free_unified_knots(&normal_s_knot,&normal_s_knot,&normal_s_knot, - &texture_s_knot); - free_unified_knots(&normal_t_knot,&normal_t_knot,&normal_t_knot, - &texture_t_knot); - free_new_ctrl(new_ctrl); - call_user_error(nobj,err); - return err; - } - } - if(texture_s_knot.unified_knot) - { - nobj->surface.texture.dim=get_surface_dim(nobj->surface.texture.type); - if((err=convert_surf(&texture_s_knot,&texture_t_knot, - &(nobj->surface.texture), - &(new_ctrl->texture_ctrl),&(new_ctrl->texture_s_pt_cnt), - &(new_ctrl->texture_t_pt_cnt)))!=GLU_NO_ERROR) - { - free_unified_knots(&texture_s_knot,&texture_s_knot,&texture_s_knot, - &texture_s_knot); - free_unified_knots(&texture_t_knot,&texture_t_knot,&texture_t_knot, - &texture_t_knot); - free_new_ctrl(new_ctrl); - call_user_error(nobj,err); - return err; - } - } - return GLU_NO_ERROR; + /* convert the geometry surface */ + nobj->surface.geom.dim = get_surface_dim(nobj->surface.geom.type); + if ((err = convert_surf(&geom_s_knot, &geom_t_knot, &(nobj->surface.geom), + &(new_ctrl->geom_ctrl), &(new_ctrl->geom_s_pt_cnt), + &(new_ctrl->geom_t_pt_cnt))) != GLU_NO_ERROR) { + free_unified_knots(&geom_s_knot, &color_s_knot, &normal_s_knot, + &texture_s_knot); + free_unified_knots(&geom_t_knot, &color_t_knot, &normal_t_knot, + &texture_t_knot); + call_user_error(nobj, err); + return err; + } + /* if additional attributive surfaces are given convert them as well */ + if (color_s_knot.unified_knot) { + nobj->surface.color.dim = get_surface_dim(nobj->surface.color.type); + if ( + (err = + convert_surf(&color_s_knot, &color_t_knot, &(nobj->surface.color), + &(new_ctrl->color_ctrl), &(new_ctrl->color_s_pt_cnt), + &(new_ctrl->color_t_pt_cnt))) != GLU_NO_ERROR) { + free_unified_knots(&color_s_knot, &color_s_knot, &normal_s_knot, + &texture_s_knot); + free_unified_knots(&color_t_knot, &color_t_knot, &normal_t_knot, + &texture_t_knot); + free_new_ctrl(new_ctrl); + call_user_error(nobj, err); + return err; + } + } + if (normal_s_knot.unified_knot) { + nobj->surface.normal.dim = get_surface_dim(nobj->surface.normal.type); + if ((err = convert_surf(&normal_s_knot, &normal_t_knot, + &(nobj->surface.normal), + &(new_ctrl->normal_ctrl), + &(new_ctrl->normal_s_pt_cnt), + &(new_ctrl->normal_t_pt_cnt))) != + GLU_NO_ERROR) { + free_unified_knots(&normal_s_knot, &normal_s_knot, &normal_s_knot, + &texture_s_knot); + free_unified_knots(&normal_t_knot, &normal_t_knot, &normal_t_knot, + &texture_t_knot); + free_new_ctrl(new_ctrl); + call_user_error(nobj, err); + return err; + } + } + if (texture_s_knot.unified_knot) { + nobj->surface.texture.dim = get_surface_dim(nobj->surface.texture.type); + if ((err = convert_surf(&texture_s_knot, &texture_t_knot, + &(nobj->surface.texture), + &(new_ctrl->texture_ctrl), + &(new_ctrl->texture_s_pt_cnt), + &(new_ctrl->texture_t_pt_cnt))) != + GLU_NO_ERROR) { + free_unified_knots(&texture_s_knot, &texture_s_knot, &texture_s_knot, + &texture_s_knot); + free_unified_knots(&texture_t_knot, &texture_t_knot, &texture_t_knot, + &texture_t_knot); + free_new_ctrl(new_ctrl); + call_user_error(nobj, err); + return err; + } + } + return GLU_NO_ERROR; } /* tesselate the "boundary" Bezier edge strips */ -void -tesselate_strip_t_line(GLint top_start,GLint top_end,GLint top_z, - GLint bottom_start,GLint bottom_end,GLint bottom_z,GLint bottom_domain) +static void +tesselate_strip_t_line(GLint top_start, GLint top_end, GLint top_z, + GLint bottom_start, GLint bottom_end, GLint bottom_z, + GLint bottom_domain) { - GLint top_cnt,bottom_cnt,tri_cnt,k; - GLint direction; + GLint top_cnt, bottom_cnt, tri_cnt, k; + GLint direction; - top_cnt=top_end-top_start; - direction= (top_cnt>=0 ? 1: -1); - bottom_cnt=bottom_end-bottom_start; - glBegin(GL_LINES); - while(top_cnt) - { - if(bottom_cnt) - tri_cnt=top_cnt/bottom_cnt; - else - tri_cnt=abs(top_cnt); - for(k=0;k<=tri_cnt;k++ , top_start+=direction) - { - glEvalCoord2f((GLfloat)bottom_z/bottom_domain, - (GLfloat)bottom_start/bottom_domain); - glEvalPoint2(top_z,top_start); - } - if(bottom_cnt) - { - glEvalCoord2f((GLfloat)bottom_z/bottom_domain, - (GLfloat)bottom_start/bottom_domain); - bottom_start+=direction; - top_start-=direction; - glEvalCoord2f((GLfloat)bottom_z/bottom_domain, - (GLfloat)bottom_start/bottom_domain); - glEvalCoord2f((GLfloat)bottom_z/bottom_domain, - (GLfloat)bottom_start/bottom_domain); - glEvalPoint2(top_z,top_start); - } - top_cnt-=direction*tri_cnt; - bottom_cnt-=direction; - } - glEnd(); + top_cnt = top_end - top_start; + direction = (top_cnt >= 0 ? 1 : -1); + bottom_cnt = bottom_end - bottom_start; + glBegin(GL_LINES); + while (top_cnt) { + if (bottom_cnt) + tri_cnt = top_cnt / bottom_cnt; + else + tri_cnt = abs(top_cnt); + for (k = 0; k <= tri_cnt; k++, top_start += direction) { + glEvalCoord2f((GLfloat) bottom_z / bottom_domain, + (GLfloat) bottom_start / bottom_domain); + glEvalPoint2(top_z, top_start); + } + if (bottom_cnt) { + glEvalCoord2f((GLfloat) bottom_z / bottom_domain, + (GLfloat) bottom_start / bottom_domain); + bottom_start += direction; + top_start -= direction; + glEvalCoord2f((GLfloat) bottom_z / bottom_domain, + (GLfloat) bottom_start / bottom_domain); + glEvalCoord2f((GLfloat) bottom_z / bottom_domain, + (GLfloat) bottom_start / bottom_domain); + glEvalPoint2(top_z, top_start); + } + top_cnt -= direction * tri_cnt; + bottom_cnt -= direction; + } + glEnd(); } -void -tesselate_strip_t_fill(GLint top_start,GLint top_end,GLint top_z, - GLint bottom_start,GLint bottom_end,GLint bottom_z,GLint bottom_domain) + +static void +tesselate_strip_t_fill(GLint top_start, GLint top_end, GLint top_z, + GLint bottom_start, GLint bottom_end, GLint bottom_z, + GLint bottom_domain) { - GLint top_cnt,bottom_cnt,tri_cnt,k; - GLint direction; + GLint top_cnt, bottom_cnt, tri_cnt, k; + GLint direction; - top_cnt=top_end-top_start; - direction= (top_cnt>=0 ? 1: -1); - bottom_cnt=bottom_end-bottom_start; - while(top_cnt) - { - if(bottom_cnt) - tri_cnt=top_cnt/bottom_cnt; - else - tri_cnt=abs(top_cnt); - glBegin(GL_TRIANGLE_FAN); - glEvalCoord2f((GLfloat)bottom_z/bottom_domain, - (GLfloat)bottom_start/bottom_domain); - for(k=0;k<=tri_cnt;k++ , top_start+=direction) - glEvalPoint2(top_z,top_start); - if(bottom_cnt) - { - bottom_start+=direction; - top_start-=direction; - glEvalCoord2f((GLfloat)bottom_z/bottom_domain, - (GLfloat)bottom_start/bottom_domain); - } - glEnd(); - top_cnt-=direction*tri_cnt; - bottom_cnt-=direction; - } + top_cnt = top_end - top_start; + direction = (top_cnt >= 0 ? 1 : -1); + bottom_cnt = bottom_end - bottom_start; + while (top_cnt) { + if (bottom_cnt) + tri_cnt = top_cnt / bottom_cnt; + else + tri_cnt = abs(top_cnt); + glBegin(GL_TRIANGLE_FAN); + glEvalCoord2f((GLfloat) bottom_z / bottom_domain, + (GLfloat) bottom_start / bottom_domain); + for (k = 0; k <= tri_cnt; k++, top_start += direction) + glEvalPoint2(top_z, top_start); + if (bottom_cnt) { + bottom_start += direction; + top_start -= direction; + glEvalCoord2f((GLfloat) bottom_z / bottom_domain, + (GLfloat) bottom_start / bottom_domain); + } + glEnd(); + top_cnt -= direction * tri_cnt; + bottom_cnt -= direction; + } } -void -tesselate_strip_t(GLenum display_mode, GLint top_start, GLint top_end, - GLint top_z, GLint bottom_start, GLint bottom_end, GLint bottom_z, - GLint bottom_domain) + +static void +tesselate_strip_t(GLenum display_mode, GLint top_start, GLint top_end, + GLint top_z, GLint bottom_start, GLint bottom_end, + GLint bottom_z, GLint bottom_domain) { - if(display_mode==GL_FILL) - tesselate_strip_t_fill(top_start,top_end,top_z,bottom_start, - bottom_end,bottom_z,bottom_domain); - else - tesselate_strip_t_line(top_start,top_end,top_z,bottom_start, - bottom_end,bottom_z,bottom_domain); + if (display_mode == GL_FILL) + tesselate_strip_t_fill(top_start, top_end, top_z, bottom_start, + bottom_end, bottom_z, bottom_domain); + else + tesselate_strip_t_line(top_start, top_end, top_z, bottom_start, + bottom_end, bottom_z, bottom_domain); } - -void + +static void tesselate_strip_s_fill(GLint top_start, GLint top_end, GLint top_z, - GLint bottom_start, GLint bottom_end, GLint bottom_z, GLfloat bottom_domain) + GLint bottom_start, GLint bottom_end, GLint bottom_z, + GLfloat bottom_domain) { - GLint top_cnt,bottom_cnt,tri_cnt,k; - GLint direction; + GLint top_cnt, bottom_cnt, tri_cnt, k; + GLint direction; - top_cnt=top_end-top_start; - direction= (top_cnt>=0 ? 1: -1); - bottom_cnt=bottom_end-bottom_start; - while(top_cnt) - { - if(bottom_cnt) - tri_cnt=top_cnt/bottom_cnt; - else - tri_cnt=abs(top_cnt); - glBegin(GL_TRIANGLE_FAN); - glEvalCoord2f((GLfloat)bottom_start/bottom_domain, - (GLfloat)bottom_z/bottom_domain); - for(k=0;k<=tri_cnt;k++ , top_start+=direction) - glEvalPoint2(top_start,top_z); - if(bottom_cnt) - { - bottom_start+=direction; - top_start-=direction; - glEvalCoord2f((GLfloat)bottom_start/bottom_domain, - (GLfloat)bottom_z/bottom_domain); - } - glEnd(); - top_cnt-=direction*tri_cnt; - bottom_cnt-=direction; - } + top_cnt = top_end - top_start; + direction = (top_cnt >= 0 ? 1 : -1); + bottom_cnt = bottom_end - bottom_start; + while (top_cnt) { + if (bottom_cnt) + tri_cnt = top_cnt / bottom_cnt; + else + tri_cnt = abs(top_cnt); + glBegin(GL_TRIANGLE_FAN); + glEvalCoord2f((GLfloat) bottom_start / bottom_domain, + (GLfloat) bottom_z / bottom_domain); + for (k = 0; k <= tri_cnt; k++, top_start += direction) + glEvalPoint2(top_start, top_z); + if (bottom_cnt) { + bottom_start += direction; + top_start -= direction; + glEvalCoord2f((GLfloat) bottom_start / bottom_domain, + (GLfloat) bottom_z / bottom_domain); + } + glEnd(); + top_cnt -= direction * tri_cnt; + bottom_cnt -= direction; + } } -void + +static void tesselate_strip_s_line(GLint top_start, GLint top_end, GLint top_z, - GLint bottom_start, GLint bottom_end, GLint bottom_z, GLfloat bottom_domain) + GLint bottom_start, GLint bottom_end, GLint bottom_z, + GLfloat bottom_domain) { - GLint top_cnt,bottom_cnt,tri_cnt,k; - GLint direction; + GLint top_cnt, bottom_cnt, tri_cnt, k; + GLint direction; - top_cnt=top_end-top_start; - direction= (top_cnt>=0 ? 1: -1); - bottom_cnt=bottom_end-bottom_start; - glBegin(GL_LINES); - while(top_cnt) - { - if(bottom_cnt) - tri_cnt=top_cnt/bottom_cnt; - else - tri_cnt=abs(top_cnt); - for(k=0;k<=tri_cnt;k++ , top_start+=direction) - { - glEvalCoord2f((GLfloat)bottom_start/bottom_domain, - (GLfloat)bottom_z/bottom_domain); - glEvalPoint2(top_start,top_z); - } - if(bottom_cnt) - { - glEvalCoord2f((GLfloat)bottom_start/bottom_domain, - (GLfloat)bottom_z/bottom_domain); - bottom_start+=direction; - top_start-=direction; - glEvalCoord2f((GLfloat)bottom_start/bottom_domain, - (GLfloat)bottom_z/bottom_domain); - glEvalPoint2(top_start,top_z); - glEvalCoord2f((GLfloat)bottom_start/bottom_domain, - (GLfloat)bottom_z/bottom_domain); - } - top_cnt-=direction*tri_cnt; - bottom_cnt-=direction; - } - glEnd(); + top_cnt = top_end - top_start; + direction = (top_cnt >= 0 ? 1 : -1); + bottom_cnt = bottom_end - bottom_start; + glBegin(GL_LINES); + while (top_cnt) { + if (bottom_cnt) + tri_cnt = top_cnt / bottom_cnt; + else + tri_cnt = abs(top_cnt); + for (k = 0; k <= tri_cnt; k++, top_start += direction) { + glEvalCoord2f((GLfloat) bottom_start / bottom_domain, + (GLfloat) bottom_z / bottom_domain); + glEvalPoint2(top_start, top_z); + } + if (bottom_cnt) { + glEvalCoord2f((GLfloat) bottom_start / bottom_domain, + (GLfloat) bottom_z / bottom_domain); + bottom_start += direction; + top_start -= direction; + glEvalCoord2f((GLfloat) bottom_start / bottom_domain, + (GLfloat) bottom_z / bottom_domain); + glEvalPoint2(top_start, top_z); + glEvalCoord2f((GLfloat) bottom_start / bottom_domain, + (GLfloat) bottom_z / bottom_domain); + } + top_cnt -= direction * tri_cnt; + bottom_cnt -= direction; + } + glEnd(); } -void + +static void tesselate_strip_s(GLenum display_mode, GLint top_start, GLint top_end, - GLint top_z, GLint bottom_start, GLint bottom_end, GLint bottom_z, - GLfloat bottom_domain) + GLint top_z, GLint bottom_start, GLint bottom_end, + GLint bottom_z, GLfloat bottom_domain) { - if(display_mode==GL_FILL) - tesselate_strip_s_fill(top_start,top_end,top_z,bottom_start, - bottom_end,bottom_z,bottom_domain); - else - tesselate_strip_s_line(top_start,top_end,top_z,bottom_start, - bottom_end,bottom_z,bottom_domain); + if (display_mode == GL_FILL) + tesselate_strip_s_fill(top_start, top_end, top_z, bottom_start, + bottom_end, bottom_z, bottom_domain); + else + tesselate_strip_s_line(top_start, top_end, top_z, bottom_start, + bottom_end, bottom_z, bottom_domain); } -void +static void tesselate_bottom_left_corner(GLenum display_mode, GLfloat s_1, GLfloat t_1) { - if(display_mode==GL_FILL) - { - glBegin(GL_TRIANGLE_FAN); - glEvalPoint2(1,1); - glEvalCoord2f(s_1,0.0); - glEvalCoord2f(0.0,0.0); - glEvalCoord2f(0.0,t_1); - } - else - { - glBegin(GL_LINES); - glEvalCoord2f(0.0,0.0); - glEvalCoord2f(0.0,t_1); - glEvalCoord2f(0.0,0.0); - glEvalPoint2(1,1); - glEvalCoord2f(0.0,0.0); - glEvalCoord2f(s_1,0.0); - } - glEnd(); + if (display_mode == GL_FILL) { + glBegin(GL_TRIANGLE_FAN); + glEvalPoint2(1, 1); + glEvalCoord2f(s_1, 0.0); + glEvalCoord2f(0.0, 0.0); + glEvalCoord2f(0.0, t_1); + } + else { + glBegin(GL_LINES); + glEvalCoord2f(0.0, 0.0); + glEvalCoord2f(0.0, t_1); + glEvalCoord2f(0.0, 0.0); + glEvalPoint2(1, 1); + glEvalCoord2f(0.0, 0.0); + glEvalCoord2f(s_1, 0.0); + } + glEnd(); } -void -tesselate_bottom_right_corner(GLenum display_mode, GLint v_top,GLint v_bottom, - GLfloat s_1, GLfloat t_1) +static void +tesselate_bottom_right_corner(GLenum display_mode, GLint v_top, + GLint v_bottom, GLfloat s_1, GLfloat t_1) { - if(display_mode==GL_FILL) - { - glBegin(GL_TRIANGLE_FAN); - glEvalPoint2(1,v_top); - glEvalCoord2f(0.0,v_bottom*t_1); - glEvalCoord2f(0.0,(v_bottom+1)*t_1); - glEvalCoord2f(s_1,(v_bottom+1)*t_1); - } - else - { - glBegin(GL_LINES); - glEvalCoord2f(0.0,(v_bottom+1)*t_1); - glEvalPoint2(1,v_top); - glEvalCoord2f(0.0,(v_bottom+1)*t_1); - glEvalCoord2f(0.0,v_bottom*t_1); - glEvalCoord2f(0.0,(v_bottom+1)*t_1); - glEvalCoord2f(s_1,(v_bottom+1)*t_1); - } - glEnd(); + if (display_mode == GL_FILL) { + glBegin(GL_TRIANGLE_FAN); + glEvalPoint2(1, v_top); + glEvalCoord2f(0.0, v_bottom * t_1); + glEvalCoord2f(0.0, (v_bottom + 1) * t_1); + glEvalCoord2f(s_1, (v_bottom + 1) * t_1); + } + else { + glBegin(GL_LINES); + glEvalCoord2f(0.0, (v_bottom + 1) * t_1); + glEvalPoint2(1, v_top); + glEvalCoord2f(0.0, (v_bottom + 1) * t_1); + glEvalCoord2f(0.0, v_bottom * t_1); + glEvalCoord2f(0.0, (v_bottom + 1) * t_1); + glEvalCoord2f(s_1, (v_bottom + 1) * t_1); + } + glEnd(); } -void +static void tesselate_top_left_corner(GLenum display_mode, GLint u_right, GLint u_left, - GLfloat s_1, GLfloat t_1) + GLfloat s_1, GLfloat t_1) { - if(display_mode==GL_FILL) - { - glBegin(GL_TRIANGLE_FAN); - glEvalPoint2(u_right,1); - glEvalCoord2f((u_left+1)*s_1,t_1); - glEvalCoord2f((u_left+1)*s_1,0.0); - glEvalCoord2f(u_left*s_1,0.0); - } - else - { - glBegin(GL_LINES); - glEvalCoord2f((u_left+1)*s_1,0.0); - glEvalPoint2(u_right,1); - glEvalCoord2f((u_left+1)*s_1,0.0); - glEvalCoord2f(u_left*s_1,0.0); - glEvalCoord2f((u_left+1)*s_1,0.0); - glEvalCoord2f((u_left+1)*s_1,t_1); - } - glEnd(); + if (display_mode == GL_FILL) { + glBegin(GL_TRIANGLE_FAN); + glEvalPoint2(u_right, 1); + glEvalCoord2f((u_left + 1) * s_1, t_1); + glEvalCoord2f((u_left + 1) * s_1, 0.0); + glEvalCoord2f(u_left * s_1, 0.0); + } + else { + glBegin(GL_LINES); + glEvalCoord2f((u_left + 1) * s_1, 0.0); + glEvalPoint2(u_right, 1); + glEvalCoord2f((u_left + 1) * s_1, 0.0); + glEvalCoord2f(u_left * s_1, 0.0); + glEvalCoord2f((u_left + 1) * s_1, 0.0); + glEvalCoord2f((u_left + 1) * s_1, t_1); + } + glEnd(); } -void +static void tesselate_top_right_corner(GLenum display_mode, GLint u_left, GLint v_bottom, - GLint u_right, GLint v_top, GLfloat s_1, GLfloat t_1) + GLint u_right, GLint v_top, GLfloat s_1, + GLfloat t_1) { - if(display_mode==GL_FILL) - { - glBegin(GL_TRIANGLE_FAN); - glEvalPoint2(u_left,v_bottom); - glEvalCoord2f((u_right-1)*s_1,v_top*t_1); - glEvalCoord2f(u_right*s_1,v_top*t_1); - glEvalCoord2f(u_right*s_1,(v_top-1)*t_1); - } - else - { - glBegin(GL_LINES); - glEvalCoord2f(u_right*s_1,v_top*t_1); - glEvalPoint2(u_left,v_bottom); - glEvalCoord2f(u_right*s_1,v_top*t_1); - glEvalCoord2f(u_right*s_1,(v_top-1)*t_1); - glEvalCoord2f(u_right*s_1,v_top*t_1); - glEvalCoord2f((u_right-1)*s_1,v_top*t_1); - } - glEnd(); + if (display_mode == GL_FILL) { + glBegin(GL_TRIANGLE_FAN); + glEvalPoint2(u_left, v_bottom); + glEvalCoord2f((u_right - 1) * s_1, v_top * t_1); + glEvalCoord2f(u_right * s_1, v_top * t_1); + glEvalCoord2f(u_right * s_1, (v_top - 1) * t_1); + } + else { + glBegin(GL_LINES); + glEvalCoord2f(u_right * s_1, v_top * t_1); + glEvalPoint2(u_left, v_bottom); + glEvalCoord2f(u_right * s_1, v_top * t_1); + glEvalCoord2f(u_right * s_1, (v_top - 1) * t_1); + glEvalCoord2f(u_right * s_1, v_top * t_1); + glEvalCoord2f((u_right - 1) * s_1, v_top * t_1); + } + glEnd(); } /* do mesh mapping of Bezier */ static void -nurbs_map_bezier(GLenum display_mode,GLint *sfactors,GLint *tfactors, - GLint s_bezier_cnt, GLint t_bezier_cnt, GLint s, GLint t) +nurbs_map_bezier(GLenum display_mode, GLint * sfactors, GLint * tfactors, + GLint s_bezier_cnt, GLint t_bezier_cnt, GLint s, GLint t) { - GLint top,bottom,right,left; + GLint top, bottom, right, left; - if(s==0) - { - top=*(tfactors+t*3); - bottom=*(tfactors+t*3+1); - } - else - if(s==s_bezier_cnt-1) - { - top=*(tfactors+t*3+2); - bottom=*(tfactors+t*3); - } - else - { - top=bottom=*(tfactors+t*3); - } - if(t==0) - { - left=*(sfactors+s*3+1); - right=*(sfactors+s*3); - } - else - if(t==t_bezier_cnt-1) - { - left=*(sfactors+s*3); - right=*(sfactors+s*3+2); - } - else - { - left=right=*(sfactors+s*3); - } + if (s == 0) { + top = *(tfactors + t * 3); + bottom = *(tfactors + t * 3 + 1); + } + else if (s == s_bezier_cnt - 1) { + top = *(tfactors + t * 3 + 2); + bottom = *(tfactors + t * 3); + } + else { + top = bottom = *(tfactors + t * 3); + } + if (t == 0) { + left = *(sfactors + s * 3 + 1); + right = *(sfactors + s * 3); + } + else if (t == t_bezier_cnt - 1) { + left = *(sfactors + s * 3); + right = *(sfactors + s * 3 + 2); + } + else { + left = right = *(sfactors + s * 3); + } - if(top>bottom) - { - if(left bottom) { + if (left < right) { + glMapGrid2f(right, 0.0, 1.0, top, 0.0, 1.0); + glEvalMesh2(display_mode, 1, right, 1, top); + tesselate_strip_s(display_mode, 1, right, 1, 1, left, 0, + (GLfloat) left); + tesselate_bottom_left_corner(display_mode, (GLfloat) (1.0 / left), + (GLfloat) (1.0 / bottom)); /* tesselate_strip_t(display_mode,1,top,1,1,bottom,0,(GLfloat)bottom);*/ - tesselate_strip_t(display_mode,top,1,1,bottom,1,0,(GLfloat)bottom); - } - else - if(left==right) - { - glMapGrid2f(right, 0.0, 1.0, top, 0.0, 1.0); - glEvalMesh2(display_mode,1,right, 0, top); + tesselate_strip_t(display_mode, top, 1, 1, bottom, 1, 0, + (GLfloat) bottom); + } + else if (left == right) { + glMapGrid2f(right, 0.0, 1.0, top, 0.0, 1.0); + glEvalMesh2(display_mode, 1, right, 0, top); /* tesselate_strip_t(display_mode,0,top,1,0,bottom,0,(GLfloat)bottom);*/ - tesselate_strip_t(display_mode,top,0,1,bottom,0,0,(GLfloat)bottom); - } - else - { - glMapGrid2f(left, 0.0, 1.0, top, 0.0, 1.0); - glEvalMesh2(display_mode,1,left, 0, top-1); + tesselate_strip_t(display_mode, top, 0, 1, bottom, 0, 0, + (GLfloat) bottom); + } + else { + glMapGrid2f(left, 0.0, 1.0, top, 0.0, 1.0); + glEvalMesh2(display_mode, 1, left, 0, top - 1); /* tesselate_strip_t(display_mode,0,top-1,1,0,bottom-1,0, (GLfloat)bottom);*/ - tesselate_strip_t(display_mode,top-1,0,1,bottom-1,0,0, - (GLfloat)bottom); - tesselate_bottom_right_corner(display_mode,top-1,bottom-1, - (GLfloat)(1.0/right),(GLfloat)(1.0/bottom)); + tesselate_strip_t(display_mode, top - 1, 0, 1, bottom - 1, 0, 0, + (GLfloat) bottom); + tesselate_bottom_right_corner(display_mode, top - 1, bottom - 1, + (GLfloat) (1.0 / right), + (GLfloat) (1.0 / bottom)); /* tesselate_strip_s(display_mode,1,left,top-1,1,right,right, (GLfloat)right);*/ - tesselate_strip_s(display_mode,left,1,top-1,right,1,right, - (GLfloat)right); - } - } - else - if(top==bottom) - { - if(leftt_bezier_cnt; - s_bezier_cnt=new_ctrl->s_bezier_cnt; - glEnable(nobj->surface.geom.type); - if(new_ctrl->color_ctrl) - { - glEnable(nobj->surface.color.type); - do_color=GL_TRUE; - } - else - do_color=GL_FALSE; - if(new_ctrl->normal_ctrl) - { - glEnable(nobj->surface.normal.type); - do_normal=GL_TRUE; - } - else - do_normal=GL_FALSE; - if(new_ctrl->texture_ctrl) - { - glEnable(nobj->surface.texture.type); - do_texture=GL_TRUE; - } - else - do_texture=GL_FALSE; - for(j=0; jgeom_offsets + offset), - nobj->surface.geom.sorder,nobj->surface.geom.torder, - new_ctrl->geom_s_stride,new_ctrl->geom_t_stride, - nobj->surface.geom.dim)) - continue; - glMap2f(nobj->surface.geom.type,0.0,1.0,new_ctrl->geom_s_stride, - nobj->surface.geom.sorder,0.0,1.0,new_ctrl->geom_t_stride, - nobj->surface.geom.torder,*(new_ctrl->geom_offsets + offset)); - if(do_color) - { - glMap2f(nobj->surface.color.type,0.0,1.0, - new_ctrl->color_s_stride,nobj->surface.color.sorder, - 0.0,1.0,new_ctrl->color_t_stride,nobj->surface.color.torder, - *(new_ctrl->color_offsets + offset)); - } - if(do_normal) - { - glMap2f(nobj->surface.normal.type,0.0,1.0, - new_ctrl->normal_s_stride,nobj->surface.normal.sorder, - 0.0,1.0,new_ctrl->normal_t_stride, - nobj->surface.normal.torder, - *(new_ctrl->normal_offsets+offset)); - } - if(do_texture) - { - glMap2f(nobj->surface.texture.type,0.0,1.0, - new_ctrl->texture_s_stride,nobj->surface.texture.sorder, - 0.0,1.0,new_ctrl->texture_t_stride, - nobj->surface.texture.torder, - *(new_ctrl->texture_offsets+offset)); - } + t_bezier_cnt = new_ctrl->t_bezier_cnt; + s_bezier_cnt = new_ctrl->s_bezier_cnt; + glEnable(nobj->surface.geom.type); + if (new_ctrl->color_ctrl) { + glEnable(nobj->surface.color.type); + do_color = GL_TRUE; + } + else + do_color = GL_FALSE; + if (new_ctrl->normal_ctrl) { + glEnable(nobj->surface.normal.type); + do_normal = GL_TRUE; + } + else + do_normal = GL_FALSE; + if (new_ctrl->texture_ctrl) { + glEnable(nobj->surface.texture.type); + do_texture = GL_TRUE; + } + else + do_texture = GL_FALSE; + for (j = 0; j < s_bezier_cnt; j++) { + for (i = 0; i < t_bezier_cnt; i++) { + offset = j * t_bezier_cnt + i; + if (fine_culling_test_3D(nobj, *(new_ctrl->geom_offsets + offset), + nobj->surface.geom.sorder, + nobj->surface.geom.torder, + new_ctrl->geom_s_stride, + new_ctrl->geom_t_stride, + nobj->surface.geom.dim)) continue; + glMap2f(nobj->surface.geom.type, 0.0, 1.0, new_ctrl->geom_s_stride, + nobj->surface.geom.sorder, 0.0, 1.0, new_ctrl->geom_t_stride, + nobj->surface.geom.torder, + *(new_ctrl->geom_offsets + offset)); + if (do_color) { + glMap2f(nobj->surface.color.type, 0.0, 1.0, + new_ctrl->color_s_stride, nobj->surface.color.sorder, + 0.0, 1.0, new_ctrl->color_t_stride, + nobj->surface.color.torder, + *(new_ctrl->color_offsets + offset)); + } + if (do_normal) { + glMap2f(nobj->surface.normal.type, 0.0, 1.0, + new_ctrl->normal_s_stride, nobj->surface.normal.sorder, + 0.0, 1.0, new_ctrl->normal_t_stride, + nobj->surface.normal.torder, + *(new_ctrl->normal_offsets + offset)); + } + if (do_texture) { + glMap2f(nobj->surface.texture.type, 0.0, 1.0, + new_ctrl->texture_s_stride, nobj->surface.texture.sorder, + 0.0, 1.0, new_ctrl->texture_t_stride, + nobj->surface.texture.torder, + *(new_ctrl->texture_offsets + offset)); + } /* glMapGrid2f(sfactors[j*3+0],0.0,1.0,tfactors[i*3+0],0.0,1.0); glEvalMesh2(display_mode,0,sfactors[j*3+0],0,tfactors[i*3+0]);*/ - nurbs_map_bezier(display_mode,sfactors,tfactors,s_bezier_cnt, - t_bezier_cnt,j,i); - } - } + nurbs_map_bezier(display_mode, sfactors, tfactors, s_bezier_cnt, + t_bezier_cnt, j, i); + } + } } @@ -1190,233 +1090,229 @@ draw_polygon_mode( GLenum display_mode, GLUnurbsObj *nobj, /* draw NURBS surface in OUTLINE POLYGON mode */ #if 0 static void -draw_patch_mode( GLenum display_mode, GLUnurbsObj *nobj, - new_ctrl_type *new_ctrl, GLint *sfactors, GLint *tfactors ) +draw_patch_mode(GLenum display_mode, GLUnurbsObj * nobj, + new_ctrl_type * new_ctrl, GLint * sfactors, GLint * tfactors) { - GLsizei offset; - GLint t_bezier_cnt,s_bezier_cnt; - GLboolean do_color,do_normal,do_texture; - GLint i,j; + GLsizei offset; + GLint t_bezier_cnt, s_bezier_cnt; + GLboolean do_color, do_normal, do_texture; + GLint i, j; - t_bezier_cnt=new_ctrl->t_bezier_cnt; - s_bezier_cnt=new_ctrl->s_bezier_cnt; - glEnable(nobj->surface.geom.type); - if(new_ctrl->color_ctrl) - { - glEnable(nobj->surface.color.type); - do_color=GL_TRUE; - } - else - do_color=GL_FALSE; - if(new_ctrl->normal_ctrl) - { - glEnable(nobj->surface.normal.type); - do_normal=GL_TRUE; - } - else - do_normal=GL_FALSE; - if(new_ctrl->texture_ctrl) - { - glEnable(nobj->surface.texture.type); - do_texture=GL_TRUE; - } - else - do_texture=GL_FALSE; - for(j=0; jgeom_offsets + offset), - nobj->surface.geom.sorder,nobj->surface.geom.torder, - new_ctrl->geom_s_stride,new_ctrl->geom_t_stride, - nobj->surface.geom.dim)) - continue; - glMap2f(nobj->surface.geom.type,0.0,1.0,new_ctrl->geom_s_stride, - nobj->surface.geom.sorder,0.0,1.0,new_ctrl->geom_t_stride, - nobj->surface.geom.torder,*(new_ctrl->geom_offsets + offset)); - if(do_color) - { - glMap2f(nobj->surface.color.type,0.0,1.0, - new_ctrl->color_s_stride,nobj->surface.color.sorder, - 0.0,1.0,new_ctrl->color_t_stride,nobj->surface.color.torder, - *(new_ctrl->color_offsets + offset)); - } - if(do_normal) - { - glMap2f(nobj->surface.normal.type,0.0,1.0, - new_ctrl->normal_s_stride,nobj->surface.normal.sorder, - 0.0,1.0,new_ctrl->normal_t_stride, - nobj->surface.normal.torder, - *(new_ctrl->normal_offsets+offset)); - } - if(do_texture) - { - glMap2f(nobj->surface.texture.type,0.0,1.0, - new_ctrl->texture_s_stride,nobj->surface.texture.sorder, - 0.0,1.0,new_ctrl->texture_t_stride, - nobj->surface.texture.torder, - *(new_ctrl->texture_offsets+offset)); - } - nurbs_map_bezier(display_mode,sfactors,tfactors,s_bezier_cnt, - t_bezier_cnt,i,j); + t_bezier_cnt = new_ctrl->t_bezier_cnt; + s_bezier_cnt = new_ctrl->s_bezier_cnt; + glEnable(nobj->surface.geom.type); + if (new_ctrl->color_ctrl) { + glEnable(nobj->surface.color.type); + do_color = GL_TRUE; + } + else + do_color = GL_FALSE; + if (new_ctrl->normal_ctrl) { + glEnable(nobj->surface.normal.type); + do_normal = GL_TRUE; + } + else + do_normal = GL_FALSE; + if (new_ctrl->texture_ctrl) { + glEnable(nobj->surface.texture.type); + do_texture = GL_TRUE; + } + else + do_texture = GL_FALSE; + for (j = 0; j < s_bezier_cnt; j++) { + for (i = 0; i < t_bezier_cnt; i++) { + offset = j * t_bezier_cnt + i; + if (fine_culling_test_3D(nobj, *(new_ctrl->geom_offsets + offset), + nobj->surface.geom.sorder, + nobj->surface.geom.torder, + new_ctrl->geom_s_stride, + new_ctrl->geom_t_stride, + nobj->surface.geom.dim)) continue; + glMap2f(nobj->surface.geom.type, 0.0, 1.0, new_ctrl->geom_s_stride, + nobj->surface.geom.sorder, 0.0, 1.0, new_ctrl->geom_t_stride, + nobj->surface.geom.torder, + *(new_ctrl->geom_offsets + offset)); + if (do_color) { + glMap2f(nobj->surface.color.type, 0.0, 1.0, + new_ctrl->color_s_stride, nobj->surface.color.sorder, + 0.0, 1.0, new_ctrl->color_t_stride, + nobj->surface.color.torder, + *(new_ctrl->color_offsets + offset)); + } + if (do_normal) { + glMap2f(nobj->surface.normal.type, 0.0, 1.0, + new_ctrl->normal_s_stride, nobj->surface.normal.sorder, + 0.0, 1.0, new_ctrl->normal_t_stride, + nobj->surface.normal.torder, + *(new_ctrl->normal_offsets + offset)); + } + if (do_texture) { + glMap2f(nobj->surface.texture.type, 0.0, 1.0, + new_ctrl->texture_s_stride, nobj->surface.texture.sorder, + 0.0, 1.0, new_ctrl->texture_t_stride, + nobj->surface.texture.torder, + *(new_ctrl->texture_offsets + offset)); + } + nurbs_map_bezier(display_mode, sfactors, tfactors, s_bezier_cnt, + t_bezier_cnt, i, j); /* glMapGrid2f(sfactors[j],0.0,1.0,tfactors[i],0.0,1.0); glEvalMesh2(display_mode,0,sfactors[j],0,tfactors[i]);*/ - } - } + } + } } #endif -void -init_new_ctrl(new_ctrl_type *p) +static void +init_new_ctrl(new_ctrl_type * p) { - p->geom_ctrl=p->color_ctrl=p->normal_ctrl=p->texture_ctrl=NULL; - p->geom_offsets=p->color_offsets=p->normal_offsets=p->texture_offsets=NULL; - p->s_bezier_cnt=p->t_bezier_cnt=0; + p->geom_ctrl = p->color_ctrl = p->normal_ctrl = p->texture_ctrl = NULL; + p->geom_offsets = p->color_offsets = p->normal_offsets = + p->texture_offsets = NULL; + p->s_bezier_cnt = p->t_bezier_cnt = 0; } -GLenum -augment_new_ctrl(GLUnurbsObj *nobj, new_ctrl_type *p) + +static GLenum +augment_new_ctrl(GLUnurbsObj * nobj, new_ctrl_type * p) { - GLsizei offset_size; - GLint i,j; + GLsizei offset_size; + GLint i, j; - p->s_bezier_cnt=(p->geom_s_pt_cnt)/(nobj->surface.geom.sorder); - p->t_bezier_cnt=(p->geom_t_pt_cnt)/(nobj->surface.geom.torder); - offset_size=(p->s_bezier_cnt)*(p->t_bezier_cnt); - p->geom_t_stride=nobj->surface.geom.dim; - p->geom_s_stride=(p->geom_t_pt_cnt)*(nobj->surface.geom.dim); - p->color_t_stride=nobj->surface.color.dim; - p->color_s_stride=(p->color_t_pt_cnt)*(nobj->surface.color.dim); - p->normal_t_stride=nobj->surface.normal.dim; - p->normal_s_stride=(p->normal_t_pt_cnt)*(nobj->surface.normal.dim); - p->texture_t_stride=nobj->surface.texture.dim; - p->texture_s_stride=(p->texture_t_pt_cnt)*(nobj->surface.texture.dim); - if((p->geom_offsets=(GLfloat **)malloc(sizeof(GLfloat *)*offset_size))==NULL) - { - call_user_error(nobj,GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - if(p->color_ctrl) - if((p->color_offsets=(GLfloat **)malloc(sizeof(GLfloat *)*offset_size))==NULL) - { - free_new_ctrl(p); - call_user_error(nobj,GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - if(p->normal_ctrl) - if((p->normal_offsets=(GLfloat **)malloc(sizeof(GLfloat *)*offset_size))==NULL) - { - free_new_ctrl(p); - call_user_error(nobj,GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - if(p->texture_ctrl) - if((p->texture_offsets=(GLfloat **)malloc(sizeof(GLfloat *)*offset_size))==NULL) - { - free_new_ctrl(p); - call_user_error(nobj,GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - for(i=0;is_bezier_cnt;i++) - for(j=0;jt_bezier_cnt;j++) - *(p->geom_offsets + i*(p->t_bezier_cnt) + j) = - p->geom_ctrl + i*(nobj->surface.geom.sorder)* - (nobj->surface.geom.dim)*(p->geom_t_pt_cnt) + - j*(nobj->surface.geom.dim)*(nobj->surface.geom.torder); - if(p->color_ctrl) - for(i=0;is_bezier_cnt;i++) - for(j=0;jt_bezier_cnt;j++) - *(p->color_offsets + i*(p->t_bezier_cnt) + j) = - p->color_ctrl + i*(nobj->surface.color.sorder)* - (nobj->surface.color.dim)*(p->color_t_pt_cnt) + - j*(nobj->surface.color.dim)*(nobj->surface.color.torder); - if(p->normal_ctrl) - for(i=0;is_bezier_cnt;i++) - for(j=0;jt_bezier_cnt;j++) - *(p->normal_offsets + i*(p->t_bezier_cnt) + j) = - p->normal_ctrl + i*(nobj->surface.normal.sorder)* - (nobj->surface.normal.dim)*(p->normal_t_pt_cnt) + - j*(nobj->surface.normal.dim)*(nobj->surface.normal.torder); - if(p->texture_ctrl) - for(i=0;is_bezier_cnt;i++) - for(j=0;jt_bezier_cnt;j++) - *(p->texture_offsets + i*(p->t_bezier_cnt) + j) = - p->texture_ctrl + i*(nobj->surface.texture.sorder)* - (nobj->surface.texture.dim)*(p->texture_t_pt_cnt) + - j*(nobj->surface.texture.dim)*(nobj->surface.texture.torder); - return GLU_NO_ERROR; + p->s_bezier_cnt = (p->geom_s_pt_cnt) / (nobj->surface.geom.sorder); + p->t_bezier_cnt = (p->geom_t_pt_cnt) / (nobj->surface.geom.torder); + offset_size = (p->s_bezier_cnt) * (p->t_bezier_cnt); + p->geom_t_stride = nobj->surface.geom.dim; + p->geom_s_stride = (p->geom_t_pt_cnt) * (nobj->surface.geom.dim); + p->color_t_stride = nobj->surface.color.dim; + p->color_s_stride = (p->color_t_pt_cnt) * (nobj->surface.color.dim); + p->normal_t_stride = nobj->surface.normal.dim; + p->normal_s_stride = (p->normal_t_pt_cnt) * (nobj->surface.normal.dim); + p->texture_t_stride = nobj->surface.texture.dim; + p->texture_s_stride = (p->texture_t_pt_cnt) * (nobj->surface.texture.dim); + if ( + (p->geom_offsets = + (GLfloat **) malloc(sizeof(GLfloat *) * offset_size)) == NULL) { + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + if (p->color_ctrl) + if ( + (p->color_offsets = + (GLfloat **) malloc(sizeof(GLfloat *) * offset_size)) == NULL) { + free_new_ctrl(p); + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + if (p->normal_ctrl) + if ( + (p->normal_offsets = + (GLfloat **) malloc(sizeof(GLfloat *) * offset_size)) == NULL) { + free_new_ctrl(p); + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + if (p->texture_ctrl) + if ( + (p->texture_offsets = + (GLfloat **) malloc(sizeof(GLfloat *) * offset_size)) == NULL) { + free_new_ctrl(p); + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + for (i = 0; i < p->s_bezier_cnt; i++) + for (j = 0; j < p->t_bezier_cnt; j++) + *(p->geom_offsets + i * (p->t_bezier_cnt) + j) = + p->geom_ctrl + i * (nobj->surface.geom.sorder) * + (nobj->surface.geom.dim) * (p->geom_t_pt_cnt) + + j * (nobj->surface.geom.dim) * (nobj->surface.geom.torder); + if (p->color_ctrl) + for (i = 0; i < p->s_bezier_cnt; i++) + for (j = 0; j < p->t_bezier_cnt; j++) + *(p->color_offsets + i * (p->t_bezier_cnt) + j) = + p->color_ctrl + i * (nobj->surface.color.sorder) * + (nobj->surface.color.dim) * (p->color_t_pt_cnt) + + j * (nobj->surface.color.dim) * (nobj->surface.color.torder); + if (p->normal_ctrl) + for (i = 0; i < p->s_bezier_cnt; i++) + for (j = 0; j < p->t_bezier_cnt; j++) + *(p->normal_offsets + i * (p->t_bezier_cnt) + j) = + p->normal_ctrl + i * (nobj->surface.normal.sorder) * + (nobj->surface.normal.dim) * (p->normal_t_pt_cnt) + + j * (nobj->surface.normal.dim) * (nobj->surface.normal.torder); + if (p->texture_ctrl) + for (i = 0; i < p->s_bezier_cnt; i++) + for (j = 0; j < p->t_bezier_cnt; j++) + *(p->texture_offsets + i * (p->t_bezier_cnt) + j) = + p->texture_ctrl + i * (nobj->surface.texture.sorder) * + (nobj->surface.texture.dim) * (p->texture_t_pt_cnt) + + j * (nobj->surface.texture.dim) * + (nobj->surface.texture.torder); + return GLU_NO_ERROR; } /* main NURBS surface procedure */ void -do_nurbs_surface( GLUnurbsObj *nobj ) +do_nurbs_surface(GLUnurbsObj * nobj) { - GLint *sfactors,*tfactors; - new_ctrl_type new_ctrl; + GLint *sfactors, *tfactors; + new_ctrl_type new_ctrl; - /* test user supplied data */ - if(test_nurbs_surfaces(nobj)!=GLU_NO_ERROR) - return; + /* test user supplied data */ + if (test_nurbs_surfaces(nobj) != GLU_NO_ERROR) + return; - init_new_ctrl(&new_ctrl); + init_new_ctrl(&new_ctrl); - if(convert_surfs(nobj,&new_ctrl)!=GLU_NO_ERROR) - return; - if(augment_new_ctrl(nobj,&new_ctrl)!=GLU_NO_ERROR) - return; - switch(nobj->sampling_method) - { - case GLU_PATH_LENGTH: - if(glu_do_sampling_3D(nobj,&new_ctrl,&sfactors,&tfactors)!= - GLU_NO_ERROR) - { - free_new_ctrl(&new_ctrl); - return; - } - break; - case GLU_DOMAIN_DISTANCE: - if(glu_do_sampling_uv(nobj,&new_ctrl,&sfactors,&tfactors)!= - GLU_NO_ERROR) - { - free_new_ctrl(&new_ctrl); - return; - } - break; - case GLU_PARAMETRIC_ERROR: - if(glu_do_sampling_param_3D(nobj,&new_ctrl,&sfactors,&tfactors)!= - GLU_NO_ERROR) - { - free_new_ctrl(&new_ctrl); - return; - } - break; - default: - abort(); - } - glFrontFace(GL_CW); - switch(nobj->display_mode) - { - case GLU_FILL: + if (convert_surfs(nobj, &new_ctrl) != GLU_NO_ERROR) + return; + if (augment_new_ctrl(nobj, &new_ctrl) != GLU_NO_ERROR) + return; + switch (nobj->sampling_method) { + case GLU_PATH_LENGTH: + if (glu_do_sampling_3D(nobj, &new_ctrl, &sfactors, &tfactors) != + GLU_NO_ERROR) { + free_new_ctrl(&new_ctrl); + return; + } + break; + case GLU_DOMAIN_DISTANCE: + if (glu_do_sampling_uv(nobj, &new_ctrl, &sfactors, &tfactors) != + GLU_NO_ERROR) { + free_new_ctrl(&new_ctrl); + return; + } + break; + case GLU_PARAMETRIC_ERROR: + if (glu_do_sampling_param_3D(nobj, &new_ctrl, &sfactors, &tfactors) != + GLU_NO_ERROR) { + free_new_ctrl(&new_ctrl); + return; + } + break; + default: + abort(); + } + glFrontFace(GL_CW); + switch (nobj->display_mode) { + case GLU_FILL: /* if(polygon_trimming(nobj,&new_ctrl,sfactors,tfactors)==GLU_NO_ERROR)*/ - draw_polygon_mode(GL_FILL,nobj,&new_ctrl,sfactors,tfactors); - break; - case GLU_OUTLINE_POLYGON: - /* TODO - missing trimming handeling */ + draw_polygon_mode(GL_FILL, nobj, &new_ctrl, sfactors, tfactors); + break; + case GLU_OUTLINE_POLYGON: + /* TODO - missing trimming handeling */ /* just for now - no OUTLINE_PATCH mode draw_patch_mode(GL_LINE,nobj,&new_ctrl,sfactors,tfactors); break; */ - case GLU_OUTLINE_PATCH: + case GLU_OUTLINE_PATCH: /* if(polygon_trimming(nobj,&new_ctrl,sfactors,tfactors)==GLU_NO_ERROR)*/ - draw_polygon_mode(GL_LINE,nobj,&new_ctrl,sfactors,tfactors); - break; - default: - abort(); /* TODO: is this OK? */ - } - free(sfactors); - free(tfactors); - free_new_ctrl(&new_ctrl); + draw_polygon_mode(GL_LINE, nobj, &new_ctrl, sfactors, tfactors); + break; + default: + abort(); /* TODO: is this OK? */ + } + free(sfactors); + free(tfactors); + free_new_ctrl(&new_ctrl); } - diff --git a/src/glu/mesa/nurbsutl.c b/src/glu/mesa/nurbsutl.c index f0f166cb647..b28825858e7 100644 --- a/src/glu/mesa/nurbsutl.c +++ b/src/glu/mesa/nurbsutl.c @@ -1,9 +1,9 @@ -/* $Id: nurbsutl.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */ +/* $Id: nurbsutl.c,v 1.2 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 2.4 - * Copyright (C) 1995-1997 Brian Paul + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -21,38 +21,6 @@ */ -/* - * $Log: nurbsutl.c,v $ - * Revision 1.1 1999/08/19 00:55:42 jtg - * Initial revision - * - * Revision 1.8 1999/06/08 00:44:51 brianp - * OpenStep updates (pete@ohm.york.ac.uk) - * - * Revision 1.7 1998/07/26 02:07:59 brianp - * updated for Windows compilation per Ted Jump - * - * Revision 1.6 1997/10/29 02:02:20 brianp - * various MS Windows compiler changes (David Bucciarelli, v20 3dfx driver) - * - * Revision 1.5 1997/07/24 01:28:44 brianp - * changed precompiled header symbol from PCH to PC_HEADER - * - * Revision 1.4 1997/05/28 02:29:38 brianp - * added support for precompiled headers (PCH), inserted APIENTRY keyword - * - * Revision 1.3 1997/05/27 03:19:54 brianp - * minor clean-up - * - * Revision 1.2 1997/05/27 03:00:16 brianp - * incorporated Bogdan's new NURBS code - * - * Revision 1.1 1996/09/27 01:19:39 brianp - * Initial revision - * - */ - - /* * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) * See README2 for more info. @@ -69,562 +37,516 @@ #endif -GLenum -test_knot(GLint nknots, GLfloat *knot, GLint order) +GLenum test_knot(GLint nknots, GLfloat * knot, GLint order) { - GLsizei i; - GLint knot_mult; - GLfloat tmp_knot; - - tmp_knot=knot[0]; - knot_mult=1; - for(i=1;i EPSILON) - { - if(knot_mult>order) - return GLU_NURBS_ERROR5; - knot_mult=1; - tmp_knot=knot[i]; - } - else - ++knot_mult; - } - return GLU_NO_ERROR; + GLsizei i; + GLint knot_mult; + GLfloat tmp_knot; + + tmp_knot = knot[0]; + knot_mult = 1; + for (i = 1; i < nknots; i++) { + if (knot[i] < tmp_knot) + return GLU_NURBS_ERROR4; + if (fabs(tmp_knot - knot[i]) > EPSILON) { + if (knot_mult > order) + return GLU_NURBS_ERROR5; + knot_mult = 1; + tmp_knot = knot[i]; + } + else + ++knot_mult; + } + return GLU_NO_ERROR; } static int /* qsort function */ #if defined(WIN32) && !defined(OPENSTEP) -__cdecl + __cdecl #endif knot_sort(const void *a, const void *b) { - GLfloat x,y; - - x=*((GLfloat *)a); - y=*((GLfloat *)b); - if(fabs(x-y) < EPSILON) - return 0; - if(x > y) - return 1; - return -1; + GLfloat x, y; + + x = *((GLfloat *) a); + y = *((GLfloat *) b); + if (fabs(x - y) < EPSILON) + return 0; + if (x > y) + return 1; + return -1; } /* insert into dest knot all values within the valid range from src knot */ /* that do not appear in dest */ void -collect_unified_knot(knot_str_type *dest, knot_str_type *src, - GLfloat maximal_min_knot, GLfloat minimal_max_knot) +collect_unified_knot(knot_str_type * dest, knot_str_type * src, + GLfloat maximal_min_knot, GLfloat minimal_max_knot) { - GLfloat *src_knot,*dest_knot; - GLint src_t_min,src_t_max,dest_t_min,dest_t_max; - GLint src_nknots,dest_nknots; - GLint i,j,k,new_cnt; - GLboolean not_found_flag; - - src_knot=src->unified_knot; - dest_knot=dest->unified_knot; - src_t_min=src->t_min; - src_t_max=src->t_max; - dest_t_min=dest->t_min; - dest_t_max=dest->t_max; - src_nknots=src->unified_nknots; - dest_nknots=dest->unified_nknots; - - k=new_cnt=dest_nknots; - for(i=src_t_min;i<=src_t_max;i++) - if(src_knot[i] - maximal_min_knot > -EPSILON && - src_knot[i] - minimal_max_knot < EPSILON) - { - not_found_flag=GL_TRUE; - for(j=dest_t_min;j<=dest_t_max;j++) - if(fabs(dest_knot[j]-src_knot[i]) < EPSILON) - { - not_found_flag=GL_FALSE; - break; - } - if(not_found_flag) - { - /* knot from src is not in dest - add this knot to dest */ - dest_knot[k++]=src_knot[i]; - ++new_cnt; - ++(dest->t_max); /* the valid range widens */ - ++(dest->delta_nknots); /* increment the extra knot value counter */ - } - } - dest->unified_nknots=new_cnt; - qsort((void *)dest_knot,(size_t)new_cnt,(size_t)sizeof(GLfloat), - &knot_sort); + GLfloat *src_knot, *dest_knot; + GLint src_t_min, src_t_max, dest_t_min, dest_t_max; + GLint src_nknots, dest_nknots; + GLint i, j, k, new_cnt; + GLboolean not_found_flag; + + src_knot = src->unified_knot; + dest_knot = dest->unified_knot; + src_t_min = src->t_min; + src_t_max = src->t_max; + dest_t_min = dest->t_min; + dest_t_max = dest->t_max; + src_nknots = src->unified_nknots; + dest_nknots = dest->unified_nknots; + + k = new_cnt = dest_nknots; + for (i = src_t_min; i <= src_t_max; i++) + if (src_knot[i] - maximal_min_knot > -EPSILON && + src_knot[i] - minimal_max_knot < EPSILON) { + not_found_flag = GL_TRUE; + for (j = dest_t_min; j <= dest_t_max; j++) + if (fabs(dest_knot[j] - src_knot[i]) < EPSILON) { + not_found_flag = GL_FALSE; + break; + } + if (not_found_flag) { + /* knot from src is not in dest - add this knot to dest */ + dest_knot[k++] = src_knot[i]; + ++new_cnt; + ++(dest->t_max); /* the valid range widens */ + ++(dest->delta_nknots); /* increment the extra knot value counter */ + } + } + dest->unified_nknots = new_cnt; + qsort((void *) dest_knot, (size_t) new_cnt, (size_t) sizeof(GLfloat), + &knot_sort); } /* basing on the new common knot range for all attributes set */ /* t_min and t_max values for each knot - they will be used later on */ /* by explode_knot() and calc_new_ctrl_pts */ static void -set_new_t_min_t_max(knot_str_type *geom_knot, knot_str_type *color_knot, - knot_str_type *normal_knot, knot_str_type *texture_knot, - GLfloat maximal_min_knot, GLfloat minimal_max_knot) +set_new_t_min_t_max(knot_str_type * geom_knot, knot_str_type * color_knot, + knot_str_type * normal_knot, knot_str_type * texture_knot, + GLfloat maximal_min_knot, GLfloat minimal_max_knot) { - GLuint t_min,t_max,cnt; - - if(minimal_max_knot-maximal_min_knot < EPSILON) - { - /* knot common range empty */ - geom_knot->t_min=geom_knot->t_max=0; - color_knot->t_min=color_knot->t_max=0; - normal_knot->t_min=normal_knot->t_max=0; - texture_knot->t_min=texture_knot->t_max=0; - } - else - { - if(geom_knot->unified_knot!=NULL) - { - cnt=geom_knot->unified_nknots; - for(t_min=0;t_minunified_knot)[t_min] - maximal_min_knot) < - EPSILON) - break; - for(t_max=cnt-1;t_max;t_max--) - if(fabs((geom_knot->unified_knot)[t_max] - minimal_max_knot) < - EPSILON) - break; - } - else - if(geom_knot->nknots) - { - cnt=geom_knot->nknots; - for(t_min=0;t_minknot)[t_min] - maximal_min_knot) < EPSILON) - break; - for(t_max=cnt-1;t_max;t_max--) - if(fabs((geom_knot->knot)[t_max] - minimal_max_knot) < EPSILON) - break; - } - geom_knot->t_min=t_min; - geom_knot->t_max=t_max; - if(color_knot->unified_knot!=NULL) - { - cnt=color_knot->unified_nknots; - for(t_min=0;t_minunified_knot)[t_min] - maximal_min_knot) < - EPSILON) - break; - for(t_max=cnt-1;t_max;t_max--) - if(fabs((color_knot->unified_knot)[t_max] - minimal_max_knot) < - EPSILON) - break; - color_knot->t_min=t_min; - color_knot->t_max=t_max; - } - if(normal_knot->unified_knot!=NULL) - { - cnt=normal_knot->unified_nknots; - for(t_min=0;t_minunified_knot)[t_min] - maximal_min_knot) < - EPSILON) - break; - for(t_max=cnt-1;t_max;t_max--) - if(fabs((normal_knot->unified_knot)[t_max] - minimal_max_knot) < - EPSILON) - break; - normal_knot->t_min=t_min; - normal_knot->t_max=t_max; - } - if(texture_knot->unified_knot!=NULL) - { - cnt=texture_knot->unified_nknots; - for(t_min=0;t_minunified_knot)[t_min] - maximal_min_knot) - < EPSILON) - break; - for(t_max=cnt-1;t_max;t_max--) - if(fabs((texture_knot->unified_knot)[t_max] - minimal_max_knot) - < EPSILON) - break; - texture_knot->t_min=t_min; - texture_knot->t_max=t_max; - } - } + GLuint t_min, t_max, cnt; + + if (minimal_max_knot - maximal_min_knot < EPSILON) { + /* knot common range empty */ + geom_knot->t_min = geom_knot->t_max = 0; + color_knot->t_min = color_knot->t_max = 0; + normal_knot->t_min = normal_knot->t_max = 0; + texture_knot->t_min = texture_knot->t_max = 0; + } + else { + if (geom_knot->unified_knot != NULL) { + cnt = geom_knot->unified_nknots; + for (t_min = 0; t_min < cnt; t_min++) + if (fabs((geom_knot->unified_knot)[t_min] - maximal_min_knot) < + EPSILON) break; + for (t_max = cnt - 1; t_max; t_max--) + if (fabs((geom_knot->unified_knot)[t_max] - minimal_max_knot) < + EPSILON) break; + } + else if (geom_knot->nknots) { + cnt = geom_knot->nknots; + for (t_min = 0; t_min < cnt; t_min++) + if (fabs((geom_knot->knot)[t_min] - maximal_min_knot) < EPSILON) + break; + for (t_max = cnt - 1; t_max; t_max--) + if (fabs((geom_knot->knot)[t_max] - minimal_max_knot) < EPSILON) + break; + } + geom_knot->t_min = t_min; + geom_knot->t_max = t_max; + if (color_knot->unified_knot != NULL) { + cnt = color_knot->unified_nknots; + for (t_min = 0; t_min < cnt; t_min++) + if (fabs((color_knot->unified_knot)[t_min] - maximal_min_knot) < + EPSILON) break; + for (t_max = cnt - 1; t_max; t_max--) + if (fabs((color_knot->unified_knot)[t_max] - minimal_max_knot) < + EPSILON) break; + color_knot->t_min = t_min; + color_knot->t_max = t_max; + } + if (normal_knot->unified_knot != NULL) { + cnt = normal_knot->unified_nknots; + for (t_min = 0; t_min < cnt; t_min++) + if (fabs((normal_knot->unified_knot)[t_min] - maximal_min_knot) < + EPSILON) break; + for (t_max = cnt - 1; t_max; t_max--) + if (fabs((normal_knot->unified_knot)[t_max] - minimal_max_knot) < + EPSILON) break; + normal_knot->t_min = t_min; + normal_knot->t_max = t_max; + } + if (texture_knot->unified_knot != NULL) { + cnt = texture_knot->unified_nknots; + for (t_min = 0; t_min < cnt; t_min++) + if (fabs((texture_knot->unified_knot)[t_min] - maximal_min_knot) + < EPSILON) + break; + for (t_max = cnt - 1; t_max; t_max--) + if (fabs((texture_knot->unified_knot)[t_max] - minimal_max_knot) + < EPSILON) + break; + texture_knot->t_min = t_min; + texture_knot->t_max = t_max; + } + } } /* modify all knot valid ranges in such a way that all have the same */ /* range, common to all knots */ /* do this by knot insertion */ GLenum -select_knot_working_range(GLUnurbsObj *nobj,knot_str_type *geom_knot, - knot_str_type *color_knot, knot_str_type *normal_knot, - knot_str_type *texture_knot) +select_knot_working_range(GLUnurbsObj * nobj, knot_str_type * geom_knot, + knot_str_type * color_knot, + knot_str_type * normal_knot, + knot_str_type * texture_knot) { - GLint max_nknots; - GLfloat maximal_min_knot,minimal_max_knot; - GLint i; - - /* find the maximum modified knot length */ - max_nknots=geom_knot->nknots; - if(color_knot->unified_knot) - max_nknots+=color_knot->nknots; - if(normal_knot->unified_knot) - max_nknots+=normal_knot->nknots; - if(texture_knot->unified_knot) - max_nknots+=texture_knot->nknots; - maximal_min_knot=(geom_knot->knot)[geom_knot->t_min]; - minimal_max_knot=(geom_knot->knot)[geom_knot->t_max]; - /* any attirb data ? */ - if(max_nknots!=geom_knot->nknots) - { - /* allocate space for the unified knots */ - if((geom_knot->unified_knot= - (GLfloat *)malloc(sizeof(GLfloat)*max_nknots))==NULL) - { - call_user_error(nobj,GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - /* copy the original knot to the unified one */ - geom_knot->unified_nknots=geom_knot->nknots; - for(i=0;inknots;i++) - (geom_knot->unified_knot)[i]=(geom_knot->knot)[i]; - if(color_knot->unified_knot) - { - if((color_knot->knot)[color_knot->t_min] - maximal_min_knot > - EPSILON) - maximal_min_knot=(color_knot->knot)[color_knot->t_min]; - if(minimal_max_knot - (color_knot->knot)[color_knot->t_max] > - EPSILON) - minimal_max_knot=(color_knot->knot)[color_knot->t_max]; - if((color_knot->unified_knot= - (GLfloat *)malloc(sizeof(GLfloat)*max_nknots))==NULL) - { - free(geom_knot->unified_knot); - call_user_error(nobj,GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - /* copy the original knot to the unified one */ - color_knot->unified_nknots=color_knot->nknots; - for(i=0;inknots;i++) - (color_knot->unified_knot)[i]=(color_knot->knot)[i]; - } - if(normal_knot->unified_knot) - { - if((normal_knot->knot)[normal_knot->t_min] - maximal_min_knot > - EPSILON) - maximal_min_knot=(normal_knot->knot)[normal_knot->t_min]; - if(minimal_max_knot - (normal_knot->knot)[normal_knot->t_max] > - EPSILON) - minimal_max_knot=(normal_knot->knot)[normal_knot->t_max]; - if((normal_knot->unified_knot= - (GLfloat *)malloc(sizeof(GLfloat)*max_nknots))==NULL) - { - free(geom_knot->unified_knot); - free(color_knot->unified_knot); - call_user_error(nobj,GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - /* copy the original knot to the unified one */ - normal_knot->unified_nknots=normal_knot->nknots; - for(i=0;inknots;i++) - (normal_knot->unified_knot)[i]=(normal_knot->knot)[i]; - } - if(texture_knot->unified_knot) - { - if((texture_knot->knot)[texture_knot->t_min] - maximal_min_knot > - EPSILON) - maximal_min_knot=(texture_knot->knot)[texture_knot->t_min]; - if(minimal_max_knot - (texture_knot->knot)[texture_knot->t_max] > - EPSILON) - minimal_max_knot=(texture_knot->knot)[texture_knot->t_max]; - if((texture_knot->unified_knot= - (GLfloat *)malloc(sizeof(GLfloat)*max_nknots))==NULL) - { - free(geom_knot->unified_knot); - free(color_knot->unified_knot); - free(normal_knot->unified_knot); - call_user_error(nobj,GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - /* copy the original knot to the unified one */ - texture_knot->unified_nknots=texture_knot->nknots; - for(i=0;inknots;i++) - (texture_knot->unified_knot)[i]=(texture_knot->knot)[i]; - } - /* work on the geometry knot with all additional knot values */ - /* appearing in attirbutive knots */ - if(minimal_max_knot-maximal_min_knot < EPSILON) - { - /* empty working range */ - geom_knot->unified_nknots=0; - color_knot->unified_nknots=0; - normal_knot->unified_nknots=0; - texture_knot->unified_nknots=0; - } - else - { - if(color_knot->unified_knot) - collect_unified_knot(geom_knot,color_knot,maximal_min_knot, - minimal_max_knot); - if(normal_knot->unified_knot) - collect_unified_knot(geom_knot,normal_knot,maximal_min_knot, - minimal_max_knot); - if(texture_knot->unified_knot) - collect_unified_knot(geom_knot,texture_knot,maximal_min_knot, - minimal_max_knot); - /* since we have now built the "unified" geometry knot */ - /* add same knot values to all attributive knots */ - if(color_knot->unified_knot) - collect_unified_knot(color_knot,geom_knot,maximal_min_knot, - minimal_max_knot); - if(normal_knot->unified_knot) - collect_unified_knot(normal_knot,geom_knot,maximal_min_knot, - minimal_max_knot); - if(texture_knot->unified_knot) - collect_unified_knot(texture_knot,geom_knot,maximal_min_knot, - minimal_max_knot); - } - } - set_new_t_min_t_max(geom_knot,color_knot,normal_knot,texture_knot, - maximal_min_knot,minimal_max_knot); - return GLU_NO_ERROR; + GLint max_nknots; + GLfloat maximal_min_knot, minimal_max_knot; + GLint i; + + /* find the maximum modified knot length */ + max_nknots = geom_knot->nknots; + if (color_knot->unified_knot) + max_nknots += color_knot->nknots; + if (normal_knot->unified_knot) + max_nknots += normal_knot->nknots; + if (texture_knot->unified_knot) + max_nknots += texture_knot->nknots; + maximal_min_knot = (geom_knot->knot)[geom_knot->t_min]; + minimal_max_knot = (geom_knot->knot)[geom_knot->t_max]; + /* any attirb data ? */ + if (max_nknots != geom_knot->nknots) { + /* allocate space for the unified knots */ + if ((geom_knot->unified_knot = + (GLfloat *) malloc(sizeof(GLfloat) * max_nknots)) == NULL) { + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + /* copy the original knot to the unified one */ + geom_knot->unified_nknots = geom_knot->nknots; + for (i = 0; i < geom_knot->nknots; i++) + (geom_knot->unified_knot)[i] = (geom_knot->knot)[i]; + if (color_knot->unified_knot) { + if ((color_knot->knot)[color_knot->t_min] - maximal_min_knot > + EPSILON) + maximal_min_knot = (color_knot->knot)[color_knot->t_min]; + if (minimal_max_knot - (color_knot->knot)[color_knot->t_max] > + EPSILON) + minimal_max_knot = (color_knot->knot)[color_knot->t_max]; + if ((color_knot->unified_knot = + (GLfloat *) malloc(sizeof(GLfloat) * max_nknots)) == NULL) { + free(geom_knot->unified_knot); + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + /* copy the original knot to the unified one */ + color_knot->unified_nknots = color_knot->nknots; + for (i = 0; i < color_knot->nknots; i++) + (color_knot->unified_knot)[i] = (color_knot->knot)[i]; + } + if (normal_knot->unified_knot) { + if ((normal_knot->knot)[normal_knot->t_min] - maximal_min_knot > + EPSILON) + maximal_min_knot = (normal_knot->knot)[normal_knot->t_min]; + if (minimal_max_knot - (normal_knot->knot)[normal_knot->t_max] > + EPSILON) + minimal_max_knot = (normal_knot->knot)[normal_knot->t_max]; + if ((normal_knot->unified_knot = + (GLfloat *) malloc(sizeof(GLfloat) * max_nknots)) == NULL) { + free(geom_knot->unified_knot); + free(color_knot->unified_knot); + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + /* copy the original knot to the unified one */ + normal_knot->unified_nknots = normal_knot->nknots; + for (i = 0; i < normal_knot->nknots; i++) + (normal_knot->unified_knot)[i] = (normal_knot->knot)[i]; + } + if (texture_knot->unified_knot) { + if ((texture_knot->knot)[texture_knot->t_min] - maximal_min_knot > + EPSILON) + maximal_min_knot = (texture_knot->knot)[texture_knot->t_min]; + if (minimal_max_knot - (texture_knot->knot)[texture_knot->t_max] > + EPSILON) + minimal_max_knot = (texture_knot->knot)[texture_knot->t_max]; + if ((texture_knot->unified_knot = + (GLfloat *) malloc(sizeof(GLfloat) * max_nknots)) == NULL) { + free(geom_knot->unified_knot); + free(color_knot->unified_knot); + free(normal_knot->unified_knot); + call_user_error(nobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + /* copy the original knot to the unified one */ + texture_knot->unified_nknots = texture_knot->nknots; + for (i = 0; i < texture_knot->nknots; i++) + (texture_knot->unified_knot)[i] = (texture_knot->knot)[i]; + } + /* work on the geometry knot with all additional knot values */ + /* appearing in attirbutive knots */ + if (minimal_max_knot - maximal_min_knot < EPSILON) { + /* empty working range */ + geom_knot->unified_nknots = 0; + color_knot->unified_nknots = 0; + normal_knot->unified_nknots = 0; + texture_knot->unified_nknots = 0; + } + else { + if (color_knot->unified_knot) + collect_unified_knot(geom_knot, color_knot, maximal_min_knot, + minimal_max_knot); + if (normal_knot->unified_knot) + collect_unified_knot(geom_knot, normal_knot, maximal_min_knot, + minimal_max_knot); + if (texture_knot->unified_knot) + collect_unified_knot(geom_knot, texture_knot, maximal_min_knot, + minimal_max_knot); + /* since we have now built the "unified" geometry knot */ + /* add same knot values to all attributive knots */ + if (color_knot->unified_knot) + collect_unified_knot(color_knot, geom_knot, maximal_min_knot, + minimal_max_knot); + if (normal_knot->unified_knot) + collect_unified_knot(normal_knot, geom_knot, maximal_min_knot, + minimal_max_knot); + if (texture_knot->unified_knot) + collect_unified_knot(texture_knot, geom_knot, maximal_min_knot, + minimal_max_knot); + } + } + set_new_t_min_t_max(geom_knot, color_knot, normal_knot, texture_knot, + maximal_min_knot, minimal_max_knot); + return GLU_NO_ERROR; } void -free_unified_knots(knot_str_type *geom_knot, knot_str_type *color_knot, - knot_str_type *normal_knot, knot_str_type *texture_knot) +free_unified_knots(knot_str_type * geom_knot, knot_str_type * color_knot, + knot_str_type * normal_knot, knot_str_type * texture_knot) { - if(geom_knot->unified_knot) - free(geom_knot->unified_knot); - if(color_knot->unified_knot) - free(color_knot->unified_knot); - if(normal_knot->unified_knot) - free(normal_knot->unified_knot); - if(texture_knot->unified_knot) - free(texture_knot->unified_knot); + if (geom_knot->unified_knot) + free(geom_knot->unified_knot); + if (color_knot->unified_knot) + free(color_knot->unified_knot); + if (normal_knot->unified_knot) + free(normal_knot->unified_knot); + if (texture_knot->unified_knot) + free(texture_knot->unified_knot); } -GLenum -explode_knot(knot_str_type *the_knot) +GLenum explode_knot(knot_str_type * the_knot) { - GLfloat *knot,*new_knot; - GLint nknots,n_new_knots=0; - GLint t_min,t_max; - GLint ord; - GLsizei i,j,k; - GLfloat tmp_float; - - if(the_knot->unified_knot) - { - knot=the_knot->unified_knot; - nknots=the_knot->unified_nknots; - } - else - { - knot=the_knot->knot; - nknots=the_knot->nknots; - } - ord=the_knot->order; - t_min=the_knot->t_min; - t_max=the_knot->t_max; - - for(i=t_min;i<=t_max;) - { - tmp_float=knot[i]; - for(j=0;jEPSILON) - break; - n_new_knots+=ord-j; - i+=j; - } - /* alloc space for new_knot */ - if((new_knot=(GLfloat *)malloc(sizeof(GLfloat)*(nknots+n_new_knots)))==NULL) - { - return GLU_OUT_OF_MEMORY; - } - /* fill in new knot */ - for(j=0;jnew_knot=new_knot; - the_knot->delta_nknots+=n_new_knots; - the_knot->t_max+=n_new_knots; - return GLU_NO_ERROR; + GLfloat *knot, *new_knot; + GLint nknots, n_new_knots = 0; + GLint t_min, t_max; + GLint ord; + GLsizei i, j, k; + GLfloat tmp_float; + + if (the_knot->unified_knot) { + knot = the_knot->unified_knot; + nknots = the_knot->unified_nknots; + } + else { + knot = the_knot->knot; + nknots = the_knot->nknots; + } + ord = the_knot->order; + t_min = the_knot->t_min; + t_max = the_knot->t_max; + + for (i = t_min; i <= t_max;) { + tmp_float = knot[i]; + for (j = 0; j < ord && (i + j) <= t_max; j++) + if (fabs(tmp_float - knot[i + j]) > EPSILON) + break; + n_new_knots += ord - j; + i += j; + } + /* alloc space for new_knot */ + if ( + (new_knot = + (GLfloat *) malloc(sizeof(GLfloat) * (nknots + n_new_knots))) == NULL) { + return GLU_OUT_OF_MEMORY; + } + /* fill in new knot */ + for (j = 0; j < t_min; j++) + new_knot[j] = knot[j]; + for (i = j; i <= t_max; i++) { + tmp_float = knot[i]; + for (k = 0; k < ord; k++) { + new_knot[j++] = knot[i]; + if (tmp_float == knot[i + 1]) + i++; + } + } + for (i = t_max + 1; i < (int) nknots; i++) + new_knot[j++] = knot[i]; + /* fill in the knot structure */ + the_knot->new_knot = new_knot; + the_knot->delta_nknots += n_new_knots; + the_knot->t_max += n_new_knots; + return GLU_NO_ERROR; } -GLenum -calc_alphas(knot_str_type *the_knot) +GLenum calc_alphas(knot_str_type * the_knot) { - GLfloat tmp_float; - int i,j,k,m,n; - int order; - GLfloat *alpha,*alpha_new,*tmp_alpha; - GLfloat denom; - GLfloat *knot,*new_knot; - - - knot=the_knot->knot; - order=the_knot->order; - new_knot=the_knot->new_knot; - n=the_knot->nknots-the_knot->order; - m=n+the_knot->delta_nknots; - if((alpha=(GLfloat *)malloc(sizeof(GLfloat)*n*m))==NULL) - { - return GLU_OUT_OF_MEMORY; - } - if((alpha_new=(GLfloat *)malloc(sizeof(GLfloat)*n*m))==NULL) - { - free(alpha); - return GLU_OUT_OF_MEMORY; - } - for(j=0;jEPSILON) - tmp_float+=(knot[i+k+1]-new_knot[j+k])/denom* - alpha[(i+1)+j*n]; - alpha_new[i+j*n]=tmp_float; - } - tmp_alpha=alpha_new; - alpha_new=alpha; - alpha=tmp_alpha; - } - the_knot->alpha=alpha; - free(alpha_new); - return GLU_NO_ERROR; + GLfloat tmp_float; + int i, j, k, m, n; + int order; + GLfloat *alpha, *alpha_new, *tmp_alpha; + GLfloat denom; + GLfloat *knot, *new_knot; + + + knot = the_knot->knot; + order = the_knot->order; + new_knot = the_knot->new_knot; + n = the_knot->nknots - the_knot->order; + m = n + the_knot->delta_nknots; + if ((alpha = (GLfloat *) malloc(sizeof(GLfloat) * n * m)) == NULL) { + return GLU_OUT_OF_MEMORY; + } + if ((alpha_new = (GLfloat *) malloc(sizeof(GLfloat) * n * m)) == NULL) { + free(alpha); + return GLU_OUT_OF_MEMORY; + } + for (j = 0; j < m; j++) { + for (i = 0; i < n; i++) { + if ((knot[i] <= new_knot[j]) && (new_knot[j] < knot[i + 1])) + tmp_float = 1.0; + else + tmp_float = 0.0; + alpha[i + j * n] = tmp_float; + } + } + for (k = 1; k < order; k++) { + for (j = 0; j < m; j++) + for (i = 0; i < n; i++) { + denom = knot[i + k] - knot[i]; + if (fabs(denom) < EPSILON) + tmp_float = 0.0; + else + tmp_float = (new_knot[j + k] - knot[i]) / denom * + alpha[i + j * n]; + denom = knot[i + k + 1] - knot[i + 1]; + if (fabs(denom) > EPSILON) + tmp_float += (knot[i + k + 1] - new_knot[j + k]) / denom * + alpha[(i + 1) + j * n]; + alpha_new[i + j * n] = tmp_float; + } + tmp_alpha = alpha_new; + alpha_new = alpha; + alpha = tmp_alpha; + } + the_knot->alpha = alpha; + free(alpha_new); + return GLU_NO_ERROR; } GLenum -calc_new_ctrl_pts(GLfloat *ctrl,GLint stride,knot_str_type *the_knot, - GLint dim,GLfloat **new_ctrl,GLint *ncontrol) +calc_new_ctrl_pts(GLfloat * ctrl, GLint stride, knot_str_type * the_knot, + GLint dim, GLfloat ** new_ctrl, GLint * ncontrol) { - GLsizei i,j,k,l,m,n; - GLsizei index1,index2; - GLfloat *alpha; - GLfloat *new_knot; - - new_knot=the_knot->new_knot; - n=the_knot->nknots-the_knot->order; - alpha=the_knot->alpha; - - m=the_knot->t_max+1-the_knot->t_min-the_knot->order; - k=the_knot->t_min; - /* allocate space for new control points */ - if((*new_ctrl=(GLfloat *)malloc(sizeof(GLfloat)*dim*m))==NULL) - { - return GLU_OUT_OF_MEMORY; - } - for(j=0;jnew_knot; + n = the_knot->nknots - the_knot->order; + alpha = the_knot->alpha; + + m = the_knot->t_max + 1 - the_knot->t_min - the_knot->order; + k = the_knot->t_min; + /* allocate space for new control points */ + if ((*new_ctrl = (GLfloat *) malloc(sizeof(GLfloat) * dim * m)) == NULL) { + return GLU_OUT_OF_MEMORY; + } + for (j = 0; j < m; j++) { + for (l = 0; l < dim; l++) + (*new_ctrl)[j * dim + l] = 0.0; + for (i = 0; i < n; i++) { + index1 = i + (j + k) * n; + index2 = i * stride; + for (l = 0; l < dim; l++) + (*new_ctrl)[j * dim + l] += alpha[index1] * ctrl[index2 + l]; + } + } + *ncontrol = (GLint) m; + return GLU_NO_ERROR; } static GLint -calc_factor(GLfloat *pts,GLint order,GLint indx,GLint stride,GLfloat tolerance, - GLint dim) +calc_factor(GLfloat * pts, GLint order, GLint indx, GLint stride, + GLfloat tolerance, GLint dim) { - GLdouble model[16],proj[16]; - GLint viewport[4]; - GLdouble x,y,z,w,winx1,winy1,winz,winx2,winy2; - GLint i; - GLdouble len,dx,dy; - - glGetDoublev(GL_MODELVIEW_MATRIX,model); - glGetDoublev(GL_PROJECTION_MATRIX,proj); - glGetIntegerv(GL_VIEWPORT,viewport); - if(dim==4) - { - w=(GLdouble)pts[indx+3]; - x=(GLdouble)pts[indx]/w; - y=(GLdouble)pts[indx+1]/w; - z=(GLdouble)pts[indx+2]/w; - gluProject(x,y,z,model,proj,viewport,&winx1,&winy1,&winz); - len=0.0; - for(i=1;i= 2) - { - bincoeff = order-1; - s = 1.0-t; - - for(k=0; k constant curve */ - { - for(k=0; k= 2) { + bincoeff = order - 1; + s = 1.0 - t; + + for (k = 0; k < dim; k++) + out[k] = s * cp[k] + bincoeff * t * cp[offset + k]; + + for (i = 2, cp += 2 * offset, powert = t * t; i < order; + i++, powert *= t, cp += offset) { + bincoeff *= order - i; + bincoeff /= i; + + for (k = 0; k < dim; k++) + out[k] = s * out[k] + bincoeff * powert * cp[k]; + } + } + else { /* order=1 -> constant curve */ + + for (k = 0; k < dim; k++) + out[k] = cp[k]; + } } static GLint -calc_parametric_factor(GLfloat *pts,GLint order,GLint indx,GLint stride, - GLfloat tolerance,GLint dim) +calc_parametric_factor(GLfloat * pts, GLint order, GLint indx, GLint stride, + GLfloat tolerance, GLint dim) { - GLdouble model[16],proj[16]; - GLint viewport[4]; - GLdouble x,y,z,w,x1,y1,z1,x2,y2,z2,x3,y3,z3; - GLint i; - GLint P; - GLfloat bez_pt[4]; - GLdouble len=0.0,tmp,z_med; - - P = 2*(order+2); - glGetDoublev(GL_MODELVIEW_MATRIX,model); - glGetDoublev(GL_PROJECTION_MATRIX,proj); - glGetIntegerv(GL_VIEWPORT,viewport); - z_med = (viewport[2] + viewport[3]) * 0.5; - switch(dim) - { - case 4: - for(i=1;i */ - x = x2-x1; - y = y2-y1; - z = z2-z1; - tmp = sqrt(x*x+y*y+z*z); - x /= tmp; - y /= tmp; - z /= tmp; - tmp = x3*x+y3*y+z3*z-x1*x-y1*y-z1*z; - x = x1+x*tmp-x3; - y = y1+y*tmp-y3; - z = z1+z*tmp-z3; - tmp = sqrt(x*x+y*y+z*z); - if(tmp > len) - len = tmp; - } - break; - case 3: - for(i=1;i */ - x = x2-x1; - y = y2-y1; - z = z2-z1; - tmp = sqrt(x*x+y*y+z*z); - x /= tmp; - y /= tmp; - z /= tmp; - tmp = x3*x+y3*y+z3*z-x1*x-y1*y-z1*z; - x = x1+x*tmp-x3; - y = y1+y*tmp-y3; - z = z1+z*tmp-z3; - tmp = sqrt(x*x+y*y+z*z); - if(tmp > len) - len = tmp; - } - break; - case 2: - for(i=1;i */ - x = x2-x1; - y = y2-y1; - z = z2-z1; - tmp = sqrt(x*x+y*y+z*z); - x /= tmp; - y /= tmp; - z /= tmp; - tmp = x3*x+y3*y+z3*z-x1*x-y1*y-z1*z; - x = x1+x*tmp-x3; - y = y1+y*tmp-y3; - z = z1+z*tmp-z3; - tmp = sqrt(x*x+y*y+z*z); - if(tmp > len) - len = tmp; - } - break; - - } - if(len < tolerance) - return (order); - else - return (GLint)(sqrt(len/tolerance)*(order+2)+1); + GLdouble model[16], proj[16]; + GLint viewport[4]; + GLdouble x, y, z, w, x1, y1, z1, x2, y2, z2, x3, y3, z3; + GLint i; + GLint P; + GLfloat bez_pt[4]; + GLdouble len = 0.0, tmp, z_med; + + P = 2 * (order + 2); + glGetDoublev(GL_MODELVIEW_MATRIX, model); + glGetDoublev(GL_PROJECTION_MATRIX, proj); + glGetIntegerv(GL_VIEWPORT, viewport); + z_med = (viewport[2] + viewport[3]) * 0.5; + switch (dim) { + case 4: + for (i = 1; i < P; i++) { + bezier_curve(pts + indx, bez_pt, (GLfloat) i / (GLfloat) P, 4, + order, stride); + w = (GLdouble) bez_pt[3]; + x = (GLdouble) bez_pt[0] / w; + y = (GLdouble) bez_pt[1] / w; + z = (GLdouble) bez_pt[2] / w; + gluProject(x, y, z, model, proj, viewport, &x3, &y3, &z3); + z3 *= z_med; + bezier_curve(pts + indx, bez_pt, (GLfloat) (i - 1) / (GLfloat) P, 4, + order, stride); + w = (GLdouble) bez_pt[3]; + x = (GLdouble) bez_pt[0] / w; + y = (GLdouble) bez_pt[1] / w; + z = (GLdouble) bez_pt[2] / w; + gluProject(x, y, z, model, proj, viewport, &x1, &y1, &z1); + z1 *= z_med; + bezier_curve(pts + indx, bez_pt, (GLfloat) (i + 1) / (GLfloat) P, 4, + order, stride); + w = (GLdouble) bez_pt[3]; + x = (GLdouble) bez_pt[0] / w; + y = (GLdouble) bez_pt[1] / w; + z = (GLdouble) bez_pt[2] / w; + gluProject(x, y, z, model, proj, viewport, &x2, &y2, &z2); + z2 *= z_med; + /* calc distance between point (x3,y3,z3) and line segment */ + /* */ + x = x2 - x1; + y = y2 - y1; + z = z2 - z1; + tmp = sqrt(x * x + y * y + z * z); + x /= tmp; + y /= tmp; + z /= tmp; + tmp = x3 * x + y3 * y + z3 * z - x1 * x - y1 * y - z1 * z; + x = x1 + x * tmp - x3; + y = y1 + y * tmp - y3; + z = z1 + z * tmp - z3; + tmp = sqrt(x * x + y * y + z * z); + if (tmp > len) + len = tmp; + } + break; + case 3: + for (i = 1; i < P; i++) { + bezier_curve(pts + indx, bez_pt, (GLfloat) i / (GLfloat) P, 3, + order, stride); + x = (GLdouble) bez_pt[0]; + y = (GLdouble) bez_pt[1]; + z = (GLdouble) bez_pt[2]; + gluProject(x, y, z, model, proj, viewport, &x3, &y3, &z3); + z3 *= z_med; + bezier_curve(pts + indx, bez_pt, (GLfloat) (i - 1) / (GLfloat) P, 3, + order, stride); + x = (GLdouble) bez_pt[0]; + y = (GLdouble) bez_pt[1]; + z = (GLdouble) bez_pt[2]; + gluProject(x, y, z, model, proj, viewport, &x1, &y1, &z1); + z1 *= z_med; + bezier_curve(pts + indx, bez_pt, (GLfloat) (i + 1) / (GLfloat) P, 3, + order, stride); + x = (GLdouble) bez_pt[0]; + y = (GLdouble) bez_pt[1]; + z = (GLdouble) bez_pt[2]; + gluProject(x, y, z, model, proj, viewport, &x2, &y2, &z2); + z2 *= z_med; + /* calc distance between point (x3,y3,z3) and line segment */ + /* */ + x = x2 - x1; + y = y2 - y1; + z = z2 - z1; + tmp = sqrt(x * x + y * y + z * z); + x /= tmp; + y /= tmp; + z /= tmp; + tmp = x3 * x + y3 * y + z3 * z - x1 * x - y1 * y - z1 * z; + x = x1 + x * tmp - x3; + y = y1 + y * tmp - y3; + z = z1 + z * tmp - z3; + tmp = sqrt(x * x + y * y + z * z); + if (tmp > len) + len = tmp; + } + break; + case 2: + for (i = 1; i < P; i++) { + bezier_curve(pts + indx, bez_pt, (GLfloat) i / (GLfloat) P, 2, + order, stride); + x = (GLdouble) bez_pt[0]; + y = (GLdouble) bez_pt[1]; + z = 0.0; + gluProject(x, y, z, model, proj, viewport, &x3, &y3, &z3); + z3 *= z_med; + bezier_curve(pts + indx, bez_pt, (GLfloat) (i - 1) / (GLfloat) P, 2, + order, stride); + x = (GLdouble) bez_pt[0]; + y = (GLdouble) bez_pt[1]; + z = 0.0; + gluProject(x, y, z, model, proj, viewport, &x1, &y1, &z1); + z1 *= z_med; + bezier_curve(pts + indx, bez_pt, (GLfloat) (i + 1) / (GLfloat) P, 2, + order, stride); + x = (GLdouble) bez_pt[0]; + y = (GLdouble) bez_pt[1]; + z = 0.0; + gluProject(x, y, z, model, proj, viewport, &x2, &y2, &z2); + z2 *= z_med; + /* calc distance between point (x3,y3,z3) and line segment */ + /* */ + x = x2 - x1; + y = y2 - y1; + z = z2 - z1; + tmp = sqrt(x * x + y * y + z * z); + x /= tmp; + y /= tmp; + z /= tmp; + tmp = x3 * x + y3 * y + z3 * z - x1 * x - y1 * y - z1 * z; + x = x1 + x * tmp - x3; + y = y1 + y * tmp - y3; + z = z1 + z * tmp - z3; + tmp = sqrt(x * x + y * y + z * z); + if (tmp > len) + len = tmp; + } + break; + + } + if (len < tolerance) + return (order); + else + return (GLint) (sqrt(len / tolerance) * (order + 2) + 1); } static GLenum -calc_sampling_3D(new_ctrl_type *new_ctrl, GLfloat tolerance, GLint dim, - GLint uorder, GLint vorder, GLint **ufactors, GLint **vfactors) +calc_sampling_3D(new_ctrl_type * new_ctrl, GLfloat tolerance, GLint dim, + GLint uorder, GLint vorder, GLint ** ufactors, + GLint ** vfactors) { - GLfloat *ctrl; - GLint tmp_factor1,tmp_factor2; - GLint ufactor_cnt,vfactor_cnt; - GLint offset1,offset2,offset3; - GLint i,j; - - ufactor_cnt=new_ctrl->s_bezier_cnt; - vfactor_cnt=new_ctrl->t_bezier_cnt; - if((*ufactors=(GLint *)malloc(sizeof(GLint)*ufactor_cnt*3)) - ==NULL) - { - return GLU_OUT_OF_MEMORY; - } - if((*vfactors=(GLint *)malloc(sizeof(GLint)*vfactor_cnt*3)) - ==NULL) - { - free(*ufactors); - return GLU_OUT_OF_MEMORY; - } - ctrl=new_ctrl->geom_ctrl; - offset1=new_ctrl->geom_t_stride*vorder; - offset2=new_ctrl->geom_s_stride*uorder; - for(j=0;jtmp_factor1) - tmp_factor1=tmp_factor2; - } - /* last time for the opposite edge */ - *(*vfactors+j*3+2)=tmp_factor2=calc_factor(ctrl,vorder, - j*offset1+i*offset2-new_ctrl->geom_s_stride, - dim,tolerance,dim); - if(tmp_factor2>tmp_factor1) - *(*vfactors+j*3)=tmp_factor2; - else - *(*vfactors+j*3)=tmp_factor1; - } - offset3=new_ctrl->geom_s_stride; - offset2=new_ctrl->geom_s_stride*uorder; - for(j=0;jtmp_factor1) - tmp_factor1=tmp_factor2; - } - /* last time for the opposite edge */ - *(*ufactors+j*3+2)=tmp_factor2=calc_factor(ctrl,uorder, - j*offset2+i*offset1-new_ctrl->geom_t_stride, - offset3,tolerance,dim); - if(tmp_factor2>tmp_factor1) - *(*ufactors+j*3)=tmp_factor2; - else - *(*ufactors+j*3)=tmp_factor1; - } - return GL_NO_ERROR; + GLfloat *ctrl; + GLint tmp_factor1, tmp_factor2; + GLint ufactor_cnt, vfactor_cnt; + GLint offset1, offset2, offset3; + GLint i, j; + + ufactor_cnt = new_ctrl->s_bezier_cnt; + vfactor_cnt = new_ctrl->t_bezier_cnt; + if ((*ufactors = (GLint *) malloc(sizeof(GLint) * ufactor_cnt * 3)) + == NULL) { + return GLU_OUT_OF_MEMORY; + } + if ((*vfactors = (GLint *) malloc(sizeof(GLint) * vfactor_cnt * 3)) + == NULL) { + free(*ufactors); + return GLU_OUT_OF_MEMORY; + } + ctrl = new_ctrl->geom_ctrl; + offset1 = new_ctrl->geom_t_stride * vorder; + offset2 = new_ctrl->geom_s_stride * uorder; + for (j = 0; j < vfactor_cnt; j++) { + *(*vfactors + j * 3 + 1) = tmp_factor1 = calc_factor(ctrl, vorder, + j * offset1, dim, + tolerance, dim); + /* loop ufactor_cnt-1 times */ + for (i = 1; i < ufactor_cnt; i++) { + tmp_factor2 = calc_factor(ctrl, vorder, + j * offset1 + i * offset2, dim, tolerance, + dim); + if (tmp_factor2 > tmp_factor1) + tmp_factor1 = tmp_factor2; + } + /* last time for the opposite edge */ + *(*vfactors + j * 3 + 2) = tmp_factor2 = calc_factor(ctrl, vorder, + j * offset1 + + i * offset2 - + new_ctrl-> + geom_s_stride, dim, + tolerance, dim); + if (tmp_factor2 > tmp_factor1) + *(*vfactors + j * 3) = tmp_factor2; + else + *(*vfactors + j * 3) = tmp_factor1; + } + offset3 = new_ctrl->geom_s_stride; + offset2 = new_ctrl->geom_s_stride * uorder; + for (j = 0; j < ufactor_cnt; j++) { + *(*ufactors + j * 3 + 1) = tmp_factor1 = calc_factor(ctrl, uorder, + j * offset2, + offset3, tolerance, + dim); + /* loop vfactor_cnt-1 times */ + for (i = 1; i < vfactor_cnt; i++) { + tmp_factor2 = calc_factor(ctrl, uorder, + j * offset2 + i * offset1, offset3, + tolerance, dim); + if (tmp_factor2 > tmp_factor1) + tmp_factor1 = tmp_factor2; + } + /* last time for the opposite edge */ + *(*ufactors + j * 3 + 2) = tmp_factor2 = calc_factor(ctrl, uorder, + j * offset2 + + i * offset1 - + new_ctrl-> + geom_t_stride, + offset3, tolerance, + dim); + if (tmp_factor2 > tmp_factor1) + *(*ufactors + j * 3) = tmp_factor2; + else + *(*ufactors + j * 3) = tmp_factor1; + } + return GL_NO_ERROR; } static GLenum -calc_sampling_param_3D(new_ctrl_type *new_ctrl, GLfloat tolerance, GLint dim, - GLint uorder, GLint vorder, GLint **ufactors, GLint **vfactors) +calc_sampling_param_3D(new_ctrl_type * new_ctrl, GLfloat tolerance, GLint dim, + GLint uorder, GLint vorder, GLint ** ufactors, + GLint ** vfactors) { - GLfloat *ctrl; - GLint tmp_factor1,tmp_factor2; - GLint ufactor_cnt,vfactor_cnt; - GLint offset1,offset2,offset3; - GLint i,j; - - ufactor_cnt=new_ctrl->s_bezier_cnt; - vfactor_cnt=new_ctrl->t_bezier_cnt; - if((*ufactors=(GLint *)malloc(sizeof(GLint)*ufactor_cnt*3)) - ==NULL) - { - return GLU_OUT_OF_MEMORY; - } - if((*vfactors=(GLint *)malloc(sizeof(GLint)*vfactor_cnt*3)) - ==NULL) - { - free(*ufactors); - return GLU_OUT_OF_MEMORY; - } - ctrl=new_ctrl->geom_ctrl; - offset1=new_ctrl->geom_t_stride*vorder; - offset2=new_ctrl->geom_s_stride*uorder; - for(j=0;jtmp_factor1) - tmp_factor1=tmp_factor2; - } - /* last time for the opposite edge */ - *(*vfactors+j*3+2)=tmp_factor2=calc_parametric_factor(ctrl,vorder, - j*offset1+i*offset2-new_ctrl->geom_s_stride, - dim,tolerance,dim); - if(tmp_factor2>tmp_factor1) - *(*vfactors+j*3)=tmp_factor2; - else - *(*vfactors+j*3)=tmp_factor1; - } - offset3=new_ctrl->geom_s_stride; - offset2=new_ctrl->geom_s_stride*uorder; - for(j=0;jtmp_factor1) - tmp_factor1=tmp_factor2; - } - /* last time for the opposite edge */ - *(*ufactors+j*3+2)=tmp_factor2=calc_parametric_factor(ctrl,uorder, - j*offset2+i*offset1-new_ctrl->geom_t_stride, - offset3,tolerance,dim); - if(tmp_factor2>tmp_factor1) - *(*ufactors+j*3)=tmp_factor2; - else - *(*ufactors+j*3)=tmp_factor1; - } - return GL_NO_ERROR; + GLfloat *ctrl; + GLint tmp_factor1, tmp_factor2; + GLint ufactor_cnt, vfactor_cnt; + GLint offset1, offset2, offset3; + GLint i, j; + + ufactor_cnt = new_ctrl->s_bezier_cnt; + vfactor_cnt = new_ctrl->t_bezier_cnt; + if ((*ufactors = (GLint *) malloc(sizeof(GLint) * ufactor_cnt * 3)) + == NULL) { + return GLU_OUT_OF_MEMORY; + } + if ((*vfactors = (GLint *) malloc(sizeof(GLint) * vfactor_cnt * 3)) + == NULL) { + free(*ufactors); + return GLU_OUT_OF_MEMORY; + } + ctrl = new_ctrl->geom_ctrl; + offset1 = new_ctrl->geom_t_stride * vorder; + offset2 = new_ctrl->geom_s_stride * uorder; + for (j = 0; j < vfactor_cnt; j++) { + *(*vfactors + j * 3 + 1) = tmp_factor1 = + calc_parametric_factor(ctrl, vorder, j * offset1, dim, tolerance, + dim); + /* loop ufactor_cnt-1 times */ + for (i = 1; i < ufactor_cnt; i++) { + tmp_factor2 = calc_parametric_factor(ctrl, vorder, + j * offset1 + i * offset2, dim, + tolerance, dim); + if (tmp_factor2 > tmp_factor1) + tmp_factor1 = tmp_factor2; + } + /* last time for the opposite edge */ + *(*vfactors + j * 3 + 2) = tmp_factor2 = + calc_parametric_factor(ctrl, vorder, + j * offset1 + i * offset2 - + new_ctrl->geom_s_stride, dim, tolerance, dim); + if (tmp_factor2 > tmp_factor1) + *(*vfactors + j * 3) = tmp_factor2; + else + *(*vfactors + j * 3) = tmp_factor1; + } + offset3 = new_ctrl->geom_s_stride; + offset2 = new_ctrl->geom_s_stride * uorder; + for (j = 0; j < ufactor_cnt; j++) { + *(*ufactors + j * 3 + 1) = tmp_factor1 = + calc_parametric_factor(ctrl, uorder, j * offset2, offset3, tolerance, + dim); + /* loop vfactor_cnt-1 times */ + for (i = 1; i < vfactor_cnt; i++) { + tmp_factor2 = calc_parametric_factor(ctrl, uorder, + j * offset2 + i * offset1, + offset3, tolerance, dim); + if (tmp_factor2 > tmp_factor1) + tmp_factor1 = tmp_factor2; + } + /* last time for the opposite edge */ + *(*ufactors + j * 3 + 2) = tmp_factor2 = + calc_parametric_factor(ctrl, uorder, + j * offset2 + i * offset1 - + new_ctrl->geom_t_stride, offset3, tolerance, + dim); + if (tmp_factor2 > tmp_factor1) + *(*ufactors + j * 3) = tmp_factor2; + else + *(*ufactors + j * 3) = tmp_factor1; + } + return GL_NO_ERROR; } static GLenum -calc_sampling_2D(GLfloat *ctrl, GLint cnt, GLint order, - GLfloat tolerance, GLint dim, GLint **factors) +calc_sampling_2D(GLfloat * ctrl, GLint cnt, GLint order, + GLfloat tolerance, GLint dim, GLint ** factors) { - GLint factor_cnt; - GLint tmp_factor; - GLint offset; - GLint i; - - factor_cnt=cnt/order; - if((*factors=(GLint *)malloc(sizeof(GLint)*factor_cnt))==NULL) - { - return GLU_OUT_OF_MEMORY; - } - offset=order*dim; - for(i=0;iauto_load_matrix==GL_FALSE) - { - GLint i; - GLfloat m[4]; - - glPushAttrib( (GLbitfield) (GL_VIEWPORT_BIT | GL_TRANSFORM_BIT)); - for(i=0;i<4;i++) - m[i]=nobj->sampling_matrices.viewport[i]; - glViewport(m[0],m[1],m[2],m[3]); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadMatrixf(nobj->sampling_matrices.proj); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadMatrixf(nobj->sampling_matrices.model); - } + if (nobj->auto_load_matrix == GL_FALSE) { + GLint i; + GLfloat m[4]; + + glPushAttrib((GLbitfield) (GL_VIEWPORT_BIT | GL_TRANSFORM_BIT)); + for (i = 0; i < 4; i++) + m[i] = nobj->sampling_matrices.viewport[i]; + glViewport(m[0], m[1], m[2], m[3]); + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadMatrixf(nobj->sampling_matrices.proj); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadMatrixf(nobj->sampling_matrices.model); + } } static void -revert_sampling_and_culling( GLUnurbsObj *nobj ) +revert_sampling_and_culling(GLUnurbsObj * nobj) { - if(nobj->auto_load_matrix==GL_FALSE) - { - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glPopAttrib(); - } + if (nobj->auto_load_matrix == GL_FALSE) { + glMatrixMode(GL_MODELVIEW); + glPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glPopAttrib(); + } } GLenum -glu_do_sampling_3D( GLUnurbsObj *nobj, new_ctrl_type *new_ctrl, - GLint **sfactors, GLint **tfactors) +glu_do_sampling_3D(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, + GLint ** sfactors, GLint ** tfactors) { - GLint dim; - GLenum err; - - *sfactors=NULL; - *tfactors=NULL; - dim=nobj->surface.geom.dim; - set_sampling_and_culling(nobj); - if((err=calc_sampling_3D(new_ctrl,nobj->sampling_tolerance,dim, - nobj->surface.geom.sorder,nobj->surface.geom.torder, - sfactors,tfactors))==GLU_ERROR) - { - revert_sampling_and_culling(nobj); - call_user_error(nobj,err); - return GLU_ERROR; - } - revert_sampling_and_culling(nobj); - return GLU_NO_ERROR; + GLint dim; + GLenum err; + + *sfactors = NULL; + *tfactors = NULL; + dim = nobj->surface.geom.dim; + set_sampling_and_culling(nobj); + if ((err = calc_sampling_3D(new_ctrl, nobj->sampling_tolerance, dim, + nobj->surface.geom.sorder, + nobj->surface.geom.torder, sfactors, + tfactors)) == GLU_ERROR) { + revert_sampling_and_culling(nobj); + call_user_error(nobj, err); + return GLU_ERROR; + } + revert_sampling_and_culling(nobj); + return GLU_NO_ERROR; } GLenum -glu_do_sampling_uv( GLUnurbsObj *nobj, new_ctrl_type *new_ctrl, - GLint **sfactors, GLint **tfactors) +glu_do_sampling_uv(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, + GLint ** sfactors, GLint ** tfactors) { - GLint s_cnt, t_cnt, i; - GLint u_steps, v_steps; - - s_cnt = new_ctrl->s_bezier_cnt; - t_cnt = new_ctrl->t_bezier_cnt; - *sfactors=NULL; - *tfactors=NULL; - if((*sfactors=(GLint *)malloc(sizeof(GLint)*s_cnt*3)) - ==NULL) - { - return GLU_OUT_OF_MEMORY; - } - if((*tfactors=(GLint *)malloc(sizeof(GLint)*t_cnt*3)) - ==NULL) - { - free(*sfactors); - return GLU_OUT_OF_MEMORY; - } - u_steps = nobj->u_step; - v_steps = nobj->v_step; - for(i=0; is_bezier_cnt; + t_cnt = new_ctrl->t_bezier_cnt; + *sfactors = NULL; + *tfactors = NULL; + if ((*sfactors = (GLint *) malloc(sizeof(GLint) * s_cnt * 3)) + == NULL) { + return GLU_OUT_OF_MEMORY; + } + if ((*tfactors = (GLint *) malloc(sizeof(GLint) * t_cnt * 3)) + == NULL) { + free(*sfactors); + return GLU_OUT_OF_MEMORY; + } + u_steps = nobj->u_step; + v_steps = nobj->v_step; + for (i = 0; i < s_cnt; i++) { + *(*sfactors + i * 3) = u_steps; + *(*sfactors + i * 3 + 1) = u_steps; + *(*sfactors + i * 3 + 2) = u_steps; + } + for (i = 0; i < t_cnt; i++) { + *(*tfactors + i * 3) = v_steps; + *(*tfactors + i * 3 + 1) = v_steps; + *(*tfactors + i * 3 + 2) = v_steps; + } + return GLU_NO_ERROR; } -GLenum -glu_do_sampling_param_3D( GLUnurbsObj *nobj, new_ctrl_type *new_ctrl, - GLint **sfactors, GLint **tfactors) -{ - GLint dim; - GLenum err; - - *sfactors=NULL; - *tfactors=NULL; - dim=nobj->surface.geom.dim; - set_sampling_and_culling(nobj); - if((err=calc_sampling_param_3D(new_ctrl,nobj->parametric_tolerance,dim, - nobj->surface.geom.sorder,nobj->surface.geom.torder, - sfactors,tfactors))==GLU_ERROR) - { - revert_sampling_and_culling(nobj); - call_user_error(nobj,err); - return GLU_ERROR; - } - revert_sampling_and_culling(nobj); - return GLU_NO_ERROR; -} GLenum -glu_do_sampling_2D( GLUnurbsObj *nobj, GLfloat *ctrl, GLint cnt, GLint order, - GLint dim, GLint **factors) +glu_do_sampling_param_3D(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, + GLint ** sfactors, GLint ** tfactors) { - GLenum err; - - set_sampling_and_culling(nobj); - err=calc_sampling_2D(ctrl,cnt,order,nobj->sampling_tolerance,dim, - factors); - revert_sampling_and_culling(nobj); - return err; + GLint dim; + GLenum err; + + *sfactors = NULL; + *tfactors = NULL; + dim = nobj->surface.geom.dim; + set_sampling_and_culling(nobj); + if ( + (err = + calc_sampling_param_3D(new_ctrl, nobj->parametric_tolerance, dim, + nobj->surface.geom.sorder, + nobj->surface.geom.torder, sfactors, + tfactors)) == GLU_ERROR) { + revert_sampling_and_culling(nobj); + call_user_error(nobj, err); + return GLU_ERROR; + } + revert_sampling_and_culling(nobj); + return GLU_NO_ERROR; } -GLenum -glu_do_sampling_u( GLUnurbsObj *nobj, GLfloat *ctrl, GLint cnt, GLint order, - GLint dim, GLint **factors) +static GLenum +glu_do_sampling_2D(GLUnurbsObj * nobj, GLfloat * ctrl, GLint cnt, GLint order, + GLint dim, GLint ** factors) { - GLint i; - GLint u_steps; + GLenum err; - cnt /= order; - if((*factors=(GLint *)malloc(sizeof(GLint)*cnt)) - ==NULL) - { - return GLU_OUT_OF_MEMORY; - } - u_steps = nobj->u_step; - for(i=0; isampling_tolerance, dim, + factors); + revert_sampling_and_culling(nobj); + return err; } -GLenum -glu_do_sampling_param_2D( GLUnurbsObj *nobj, GLfloat *ctrl, GLint cnt, - GLint order, GLint dim, GLint **factors) + +static GLenum +glu_do_sampling_u(GLUnurbsObj * nobj, GLfloat * ctrl, GLint cnt, GLint order, + GLint dim, GLint ** factors) { - GLint i; - GLint u_steps; - GLfloat tolerance; + GLint i; + GLint u_steps; + + cnt /= order; + if ((*factors = (GLint *) malloc(sizeof(GLint) * cnt)) + == NULL) { + return GLU_OUT_OF_MEMORY; + } + u_steps = nobj->u_step; + for (i = 0; i < cnt; i++) + (*factors)[i] = u_steps; + return GLU_NO_ERROR; +} - set_sampling_and_culling(nobj); - tolerance = nobj->parametric_tolerance; - cnt /= order; - if((*factors=(GLint *)malloc(sizeof(GLint)*cnt)) - ==NULL) - { - revert_sampling_and_culling(nobj); - return GLU_OUT_OF_MEMORY; - } - u_steps = nobj->u_step; - for(i=0; iparametric_tolerance; + cnt /= order; + if ((*factors = (GLint *) malloc(sizeof(GLint) * cnt)) + == NULL) { + revert_sampling_and_culling(nobj); + return GLU_OUT_OF_MEMORY; + } + u_steps = nobj->u_step; + for (i = 0; i < cnt; i++) { + (*factors)[i] = calc_parametric_factor(ctrl, order, 0, + dim, tolerance, dim); + + } + revert_sampling_and_culling(nobj); + return GLU_NO_ERROR; } GLenum -glu_do_sampling_crv( GLUnurbsObj *nobj, GLfloat *ctrl, GLint cnt, GLint order, - GLint dim, GLint **factors) +glu_do_sampling_crv(GLUnurbsObj * nobj, GLfloat * ctrl, GLint cnt, + GLint order, GLint dim, GLint ** factors) { - GLenum err; - - *factors=NULL; - switch(nobj->sampling_method) - { - case GLU_PATH_LENGTH: - if((err=glu_do_sampling_2D(nobj,ctrl,cnt,order,dim,factors))!= - GLU_NO_ERROR) - { - call_user_error(nobj,err); - return GLU_ERROR; - } - break; - case GLU_DOMAIN_DISTANCE: - if((err=glu_do_sampling_u(nobj,ctrl,cnt,order,dim,factors))!= - GLU_NO_ERROR) - { - call_user_error(nobj,err); - return GLU_ERROR; - } - break; - case GLU_PARAMETRIC_ERROR: - if((err=glu_do_sampling_param_2D(nobj,ctrl,cnt,order,dim,factors))!= - GLU_NO_ERROR) - { - call_user_error(nobj,err); - return GLU_ERROR; - } - break; - default: - abort(); - } - - return GLU_NO_ERROR; + GLenum err; + + *factors = NULL; + switch (nobj->sampling_method) { + case GLU_PATH_LENGTH: + if ((err = glu_do_sampling_2D(nobj, ctrl, cnt, order, dim, factors)) != + GLU_NO_ERROR) { + call_user_error(nobj, err); + return GLU_ERROR; + } + break; + case GLU_DOMAIN_DISTANCE: + if ((err = glu_do_sampling_u(nobj, ctrl, cnt, order, dim, factors)) != + GLU_NO_ERROR) { + call_user_error(nobj, err); + return GLU_ERROR; + } + break; + case GLU_PARAMETRIC_ERROR: + if ( + (err = + glu_do_sampling_param_2D(nobj, ctrl, cnt, order, dim, + factors)) != GLU_NO_ERROR) { + call_user_error(nobj, err); + return GLU_ERROR; + } + break; + default: + abort(); + } + + return GLU_NO_ERROR; } /* TODO - i don't like this culling - this one just tests if at least one */ @@ -1215,68 +1133,62 @@ glu_do_sampling_crv( GLUnurbsObj *nobj, GLfloat *ctrl, GLint cnt, GLint order, /* should be included in the fnctions for efficiency reasons */ static GLboolean -point_in_viewport(GLfloat *pt, GLint dim) +point_in_viewport(GLfloat * pt, GLint dim) { - GLdouble model[16],proj[16]; - GLint viewport[4]; - GLdouble x,y,z,w,winx,winy,winz; - - glGetDoublev(GL_MODELVIEW_MATRIX,model); - glGetDoublev(GL_PROJECTION_MATRIX,proj); - glGetIntegerv(GL_VIEWPORT,viewport); - if(dim==3) - { - x=(GLdouble)pt[0]; - y=(GLdouble)pt[1]; - z=(GLdouble)pt[2]; - gluProject(x,y,z,model,proj,viewport,&winx,&winy,&winz); - } - else - { - w=(GLdouble)pt[3]; - x=(GLdouble)pt[0]/w; - y=(GLdouble)pt[1]/w; - z=(GLdouble)pt[2]/w; - gluProject(x,y,z,model,proj,viewport,&winx,&winy,&winz); - } - if((GLint)winx >= viewport[0] && (GLint)winx < viewport[2] && - (GLint)winy >= viewport[1] && (GLint)winy < viewport[3]) - return GL_TRUE; - return GL_FALSE; + GLdouble model[16], proj[16]; + GLint viewport[4]; + GLdouble x, y, z, w, winx, winy, winz; + + glGetDoublev(GL_MODELVIEW_MATRIX, model); + glGetDoublev(GL_PROJECTION_MATRIX, proj); + glGetIntegerv(GL_VIEWPORT, viewport); + if (dim == 3) { + x = (GLdouble) pt[0]; + y = (GLdouble) pt[1]; + z = (GLdouble) pt[2]; + gluProject(x, y, z, model, proj, viewport, &winx, &winy, &winz); + } + else { + w = (GLdouble) pt[3]; + x = (GLdouble) pt[0] / w; + y = (GLdouble) pt[1] / w; + z = (GLdouble) pt[2] / w; + gluProject(x, y, z, model, proj, viewport, &winx, &winy, &winz); + } + if ((GLint) winx >= viewport[0] && (GLint) winx < viewport[2] && + (GLint) winy >= viewport[1] && (GLint) winy < viewport[3]) + return GL_TRUE; + return GL_FALSE; } GLboolean -fine_culling_test_3D(GLUnurbsObj *nobj,GLfloat *pts,GLint s_cnt,GLint t_cnt, - GLint s_stride,GLint t_stride, GLint dim) +fine_culling_test_3D(GLUnurbsObj * nobj, GLfloat * pts, GLint s_cnt, + GLint t_cnt, GLint s_stride, GLint t_stride, GLint dim) { - GLint i,j; - - if(nobj->culling==GL_FALSE) - return GL_FALSE; - set_sampling_and_culling(nobj); - - if(dim==3) - { - for(i=0;iculling == GL_FALSE) + return GL_FALSE; + set_sampling_and_culling(nobj); + + if (dim == 3) { + for (i = 0; i < s_cnt; i++) + for (j = 0; j < t_cnt; j++) + if (point_in_viewport(pts + i * s_stride + j * t_stride, dim)) { + revert_sampling_and_culling(nobj); + return GL_FALSE; + } + } + else { + for (i = 0; i < s_cnt; i++) + for (j = 0; j < t_cnt; j++) + if (point_in_viewport(pts + i * s_stride + j * t_stride, dim)) { + revert_sampling_and_culling(nobj); + return GL_FALSE; + } + } + revert_sampling_and_culling(nobj); + return GL_TRUE; } /*GLboolean @@ -1336,35 +1248,31 @@ fine_culling_test_3D(GLUnurbsObj *nobj,GLfloat *pts,GLint s_cnt,GLint t_cnt, }*/ GLboolean -fine_culling_test_2D(GLUnurbsObj *nobj,GLfloat *pts,GLint cnt, - GLint stride, GLint dim) +fine_culling_test_2D(GLUnurbsObj * nobj, GLfloat * pts, GLint cnt, + GLint stride, GLint dim) { - GLint i; - - if(nobj->culling==GL_FALSE) - return GL_FALSE; - set_sampling_and_culling(nobj); - - if(dim==3) - { - for(i=0;iculling == GL_FALSE) + return GL_FALSE; + set_sampling_and_culling(nobj); + + if (dim == 3) { + for (i = 0; i < cnt; i++) + if (point_in_viewport(pts + i * stride, dim)) { + revert_sampling_and_culling(nobj); + return GL_FALSE; + } + } + else { + for (i = 0; i < cnt; i++) + if (point_in_viewport(pts + i * stride, dim)) { + revert_sampling_and_culling(nobj); + return GL_FALSE; + } + } + revert_sampling_and_culling(nobj); + return GL_TRUE; } /*GLboolean @@ -1400,4 +1308,3 @@ fine_culling_test_2D(GLUnurbsObj *nobj,GLfloat *pts,GLint cnt, revert_sampling_and_culling(nobj); return (GLboolean)(visible_cnt==0); }*/ - diff --git a/src/glu/mesa/polytest.c b/src/glu/mesa/polytest.c new file mode 100644 index 00000000000..0995cb032f0 --- /dev/null +++ b/src/glu/mesa/polytest.c @@ -0,0 +1,938 @@ +/* $Id: polytest.c,v 1.3 2000/07/11 14:11:04 brianp Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * This file is part of the polygon tesselation code contributed by + * Bogdan Sikorski + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include "gluP.h" +#include "tess.h" +#endif + + + +static GLenum store_polygon_as_contour(GLUtriangulatorObj *); +static void free_current_polygon(tess_polygon *); +static void prepare_projection_info(GLUtriangulatorObj *); +static GLdouble twice_the_polygon_area(tess_vertex *, tess_vertex *); +static GLenum verify_edge_vertex_intersections(GLUtriangulatorObj *); +void tess_find_contour_hierarchies(GLUtriangulatorObj *); +static GLenum test_for_overlapping_contours(GLUtriangulatorObj *); +static GLenum contours_overlap(tess_contour *, tess_polygon *); +static GLenum is_contour_contained_in(tess_contour *, tess_contour *); +static void add_new_exterior(GLUtriangulatorObj *, tess_contour *); +static void add_new_interior(GLUtriangulatorObj *, tess_contour *, + tess_contour *); +static void add_interior_with_hierarchy_check(GLUtriangulatorObj *, + tess_contour *, tess_contour *); +static void reverse_hierarchy_and_add_exterior(GLUtriangulatorObj *, + tess_contour *, + tess_contour *); +static GLboolean point_in_polygon(tess_contour *, GLdouble, GLdouble); +static void shift_interior_to_exterior(GLUtriangulatorObj *, tess_contour *); +static void add_exterior_with_check(GLUtriangulatorObj *, tess_contour *, + tess_contour *); +static GLenum cut_out_hole(GLUtriangulatorObj *, tess_contour *, + tess_contour *); +static GLenum merge_hole_with_contour(GLUtriangulatorObj *, + tess_contour *, tess_contour *, + tess_vertex *, tess_vertex *); + +static GLenum +find_normal(GLUtriangulatorObj * tobj) +{ + tess_polygon *polygon = tobj->current_polygon; + tess_vertex *va, *vb, *vc; + GLdouble A, B, C; + GLdouble A0, A1, A2, B0, B1, B2; + + va = polygon->vertices; + vb = va->next; + A0 = vb->location[0] - va->location[0]; + A1 = vb->location[1] - va->location[1]; + A2 = vb->location[2] - va->location[2]; + for (vc = vb->next; vc != va; vc = vc->next) { + B0 = vc->location[0] - va->location[0]; + B1 = vc->location[1] - va->location[1]; + B2 = vc->location[2] - va->location[2]; + A = A1 * B2 - A2 * B1; + B = A2 * B0 - A0 * B2; + C = A0 * B1 - A1 * B0; + if (fabs(A) > EPSILON || fabs(B) > EPSILON || fabs(C) > EPSILON) { + polygon->A = A; + polygon->B = B; + polygon->C = C; + polygon->D = + -A * va->location[0] - B * va->location[1] - C * va->location[2]; + return GLU_NO_ERROR; + } + } + tess_call_user_error(tobj, GLU_TESS_ERROR7); + return GLU_ERROR; +} + +void +tess_test_polygon(GLUtriangulatorObj * tobj) +{ + tess_polygon *polygon = tobj->current_polygon; + + /* any vertices defined? */ + if (polygon->vertex_cnt < 3) { + free_current_polygon(polygon); + return; + } + /* wrap pointers */ + polygon->last_vertex->next = polygon->vertices; + polygon->vertices->previous = polygon->last_vertex; + /* determine the normal */ + if (find_normal(tobj) == GLU_ERROR) + return; + /* compare the normals of previously defined contours and this one */ + /* first contour define ? */ + if (tobj->contours == NULL) { + tobj->A = polygon->A; + tobj->B = polygon->B; + tobj->C = polygon->C; + tobj->D = polygon->D; + /* determine the best projection to use */ + if (fabs(polygon->A) > fabs(polygon->B)) + if (fabs(polygon->A) > fabs(polygon->C)) + tobj->projection = OYZ; + else + tobj->projection = OXY; + else if (fabs(polygon->B) > fabs(polygon->C)) + tobj->projection = OXZ; + else + tobj->projection = OXY; + } + else { + GLdouble a[3], b[3]; + tess_vertex *vertex = polygon->vertices; + + a[0] = tobj->A; + a[1] = tobj->B; + a[2] = tobj->C; + b[0] = polygon->A; + b[1] = polygon->B; + b[2] = polygon->C; + + /* compare the normals */ + if (fabs(a[1] * b[2] - a[2] * b[1]) > EPSILON || + fabs(a[2] * b[0] - a[0] * b[2]) > EPSILON || + fabs(a[0] * b[1] - a[1] * b[0]) > EPSILON) { + /* not coplanar */ + tess_call_user_error(tobj, GLU_TESS_ERROR9); + return; + } + /* the normals are parallel - test for plane equation */ + if (fabs(a[0] * vertex->location[0] + a[1] * vertex->location[1] + + a[2] * vertex->location[2] + tobj->D) > EPSILON) { + /* not the same plane */ + tess_call_user_error(tobj, GLU_TESS_ERROR9); + return; + } + } + prepare_projection_info(tobj); + if (verify_edge_vertex_intersections(tobj) == GLU_ERROR) + return; + if (test_for_overlapping_contours(tobj) == GLU_ERROR) + return; + if (store_polygon_as_contour(tobj) == GLU_ERROR) + return; +} + +static GLenum +test_for_overlapping_contours(GLUtriangulatorObj * tobj) +{ + tess_contour *contour; + tess_polygon *polygon; + + polygon = tobj->current_polygon; + for (contour = tobj->contours; contour != NULL; contour = contour->next) + if (contours_overlap(contour, polygon) != GLU_NO_ERROR) { + tess_call_user_error(tobj, GLU_TESS_ERROR5); + return GLU_ERROR; + } + return GLU_NO_ERROR; +} + +static GLenum +store_polygon_as_contour(GLUtriangulatorObj * tobj) +{ + tess_polygon *polygon = tobj->current_polygon; + tess_contour *contour = tobj->contours; + + /* the first contour defined */ + if (contour == NULL) { + if ((contour = (tess_contour *) malloc(sizeof(tess_contour))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + free_current_polygon(polygon); + return GLU_ERROR; + } + tobj->contours = tobj->last_contour = contour; + contour->next = contour->previous = NULL; + } + else { + if ((contour = (tess_contour *) malloc(sizeof(tess_contour))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + free_current_polygon(polygon); + return GLU_ERROR; + } + contour->previous = tobj->last_contour; + tobj->last_contour->next = contour; + tobj->last_contour = contour; + contour->next = NULL; + } + /* mark all vertices in new contour as not special */ + /* and all are boundary edges */ + { + tess_vertex *vertex; + GLuint vertex_cnt, i; + + for (vertex = polygon->vertices, i = 0, vertex_cnt = + polygon->vertex_cnt; i < vertex_cnt; vertex = vertex->next, i++) { + vertex->shadow_vertex = NULL; + vertex->edge_flag = GL_TRUE; + } + } + contour->vertex_cnt = polygon->vertex_cnt; + contour->area = polygon->area; + contour->orientation = polygon->orientation; + contour->type = GLU_UNKNOWN; + contour->vertices = polygon->vertices; + contour->last_vertex = polygon->last_vertex; + polygon->vertices = polygon->last_vertex = NULL; + polygon->vertex_cnt = 0; + ++(tobj->contour_cnt); + return GLU_NO_ERROR; +} + +static void +free_current_polygon(tess_polygon * polygon) +{ + tess_vertex *vertex, *vertex_tmp; + GLuint i; + + /* free current_polygon structures */ + for (vertex = polygon->vertices, i = 0; i < polygon->vertex_cnt; i++) { + vertex_tmp = vertex->next; + free(vertex); + vertex = vertex_tmp; + } + polygon->vertices = polygon->last_vertex = NULL; + polygon->vertex_cnt = 0; +} + +static void +prepare_projection_info(GLUtriangulatorObj * tobj) +{ + tess_polygon *polygon = tobj->current_polygon; + tess_vertex *vertex, *last_vertex_ptr; + GLdouble area; + + last_vertex_ptr = polygon->last_vertex; + switch (tobj->projection) { + case OXY: + for (vertex = polygon->vertices; vertex != last_vertex_ptr; + vertex = vertex->next) { + vertex->x = vertex->location[0]; + vertex->y = vertex->location[1]; + } + last_vertex_ptr->x = last_vertex_ptr->location[0]; + last_vertex_ptr->y = last_vertex_ptr->location[1]; + break; + case OXZ: + for (vertex = polygon->vertices; vertex != last_vertex_ptr; + vertex = vertex->next) { + vertex->x = vertex->location[0]; + vertex->y = vertex->location[2]; + } + last_vertex_ptr->x = last_vertex_ptr->location[0]; + last_vertex_ptr->y = last_vertex_ptr->location[2]; + break; + case OYZ: + for (vertex = polygon->vertices; vertex != last_vertex_ptr; + vertex = vertex->next) { + vertex->x = vertex->location[1]; + vertex->y = vertex->location[2]; + } + last_vertex_ptr->x = last_vertex_ptr->location[1]; + last_vertex_ptr->y = last_vertex_ptr->location[2]; + break; + } + area = twice_the_polygon_area(polygon->vertices, polygon->last_vertex); + if (area >= 0.0) { + polygon->orientation = GLU_CCW; + polygon->area = area; + } + else { + polygon->orientation = GLU_CW; + polygon->area = -area; + } +} + +static GLdouble +twice_the_polygon_area(tess_vertex * vertex, tess_vertex * last_vertex) +{ + tess_vertex *next; + GLdouble area, x, y; + + area = 0.0; + x = vertex->x; + y = vertex->y; + vertex = vertex->next; + for (; vertex != last_vertex; vertex = vertex->next) { + next = vertex->next; + area += + (vertex->x - x) * (next->y - y) - (vertex->y - y) * (next->x - x); + } + return area; +} + +/* test if edges ab and cd intersect */ +/* if not return GLU_NO_ERROR, else if cross return GLU_TESS_ERROR8, */ +/* else if adjacent return GLU_TESS_ERROR4 */ +static GLenum +edge_edge_intersect(tess_vertex * a, + tess_vertex * b, tess_vertex * c, tess_vertex * d) +{ + GLdouble denom, r, s; + GLdouble xba, ydc, yba, xdc, yac, xac; + + xba = b->x - a->x; + yba = b->y - a->y; + xdc = d->x - c->x; + ydc = d->y - c->y; + xac = a->x - c->x; + yac = a->y - c->y; + denom = xba * ydc - yba * xdc; + r = yac * xdc - xac * ydc; + /* parallel? */ + if (fabs(denom) < EPSILON) { + if (fabs(r) < EPSILON) { + /* colinear */ + if (fabs(xba) < EPSILON) { + /* compare the Y coordinate */ + if (yba > 0.0) { + if ( + (fabs(a->y - c->y) < EPSILON + && fabs(c->y - b->y) < EPSILON) + || (fabs(a->y - d->y) < EPSILON + && fabs(d->y - b->y) < + EPSILON)) return GLU_TESS_ERROR4; + + } + else { + if ( + (fabs(b->y - c->y) < EPSILON + && fabs(c->y - a->y) < EPSILON) + || (fabs(b->y - d->y) < EPSILON + && fabs(d->y - a->y) < + EPSILON)) return GLU_TESS_ERROR4; + } + } + else { + /* compare the X coordinate */ + if (xba > 0.0) { + if ( + (fabs(a->x - c->x) < EPSILON + && fabs(c->x - b->x) < EPSILON) + || (fabs(a->x - d->x) < EPSILON + && fabs(d->x - b->x) < + EPSILON)) return GLU_TESS_ERROR4; + } + else { + if ( + (fabs(b->x - c->x) < EPSILON + && fabs(c->x - a->x) < EPSILON) + || (fabs(b->x - d->x) < EPSILON + && fabs(d->x - a->x) < + EPSILON)) return GLU_TESS_ERROR4; + } + } + } + return GLU_NO_ERROR; + } + r /= denom; + s = (yac * xba - xac * yba) / denom; + /* test if one vertex lies on other edge */ + if (((fabs(r) < EPSILON || (r < 1.0 + EPSILON && r > 1.0 - EPSILON)) && + s > -EPSILON && s < 1.0 + EPSILON) || + ((fabs(s) < EPSILON || (s < 1.0 + EPSILON && s > 1.0 - EPSILON)) && + r > -EPSILON && r < 1.0 + EPSILON)) { + return GLU_TESS_ERROR4; + } + /* test for crossing */ + if (r > -EPSILON && r < 1.0 + EPSILON && s > -EPSILON && s < 1.0 + EPSILON) { + return GLU_TESS_ERROR8; + } + return GLU_NO_ERROR; +} + +static GLenum +verify_edge_vertex_intersections(GLUtriangulatorObj * tobj) +{ + tess_polygon *polygon = tobj->current_polygon; + tess_vertex *vertex1, *last_vertex, *vertex2; + GLenum test; + + last_vertex = polygon->last_vertex; + vertex1 = last_vertex; + for (vertex2 = vertex1->next->next; + vertex2->next != last_vertex; vertex2 = vertex2->next) { + test = edge_edge_intersect(vertex1, vertex1->next, vertex2, + vertex2->next); + if (test != GLU_NO_ERROR) { + tess_call_user_error(tobj, test); + return GLU_ERROR; + } + } + for (vertex1 = polygon->vertices; + vertex1->next->next != last_vertex; vertex1 = vertex1->next) { + for (vertex2 = vertex1->next->next; + vertex2 != last_vertex; vertex2 = vertex2->next) { + test = edge_edge_intersect(vertex1, vertex1->next, vertex2, + vertex2->next); + if (test != GLU_NO_ERROR) { + tess_call_user_error(tobj, test); + return GLU_ERROR; + } + } + } + return GLU_NO_ERROR; +} + +static int +#ifdef WIN32 + __cdecl +#endif +area_compare(const void *a, const void *b) +{ + GLdouble area1, area2; + + area1 = (*((tess_contour **) a))->area; + area2 = (*((tess_contour **) b))->area; + if (area1 < area2) + return 1; + if (area1 > area2) + return -1; + return 0; +} + +void +tess_find_contour_hierarchies(GLUtriangulatorObj * tobj) +{ + tess_contour **contours; /* dinamic array of pointers */ + tess_contour *tmp_contour_ptr = tobj->contours; + GLuint cnt, i; + GLenum result; + GLboolean hierarchy_changed; + + /* any contours? */ + if (tobj->contour_cnt < 2) { + tobj->contours->type = GLU_EXTERIOR; + return; + } + if ((contours = (tess_contour **) + malloc(sizeof(tess_contour *) * (tobj->contour_cnt))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return; + } + for (tmp_contour_ptr = tobj->contours, cnt = 0; + tmp_contour_ptr != NULL; tmp_contour_ptr = tmp_contour_ptr->next) + contours[cnt++] = tmp_contour_ptr; + /* now sort the contours in decreasing area size order */ + qsort((void *) contours, (size_t) cnt, (size_t) sizeof(tess_contour *), + area_compare); + /* we leave just the first contour - remove others from list */ + tobj->contours = contours[0]; + tobj->contours->next = tobj->contours->previous = NULL; + tobj->last_contour = tobj->contours; + tobj->contour_cnt = 1; + /* first contour is the one with greatest area */ + /* must be EXTERIOR */ + tobj->contours->type = GLU_EXTERIOR; + tmp_contour_ptr = tobj->contours; + /* now we play! */ + for (i = 1; i < cnt; i++) { + hierarchy_changed = GL_FALSE; + for (tmp_contour_ptr = tobj->contours; + tmp_contour_ptr != NULL; tmp_contour_ptr = tmp_contour_ptr->next) { + if (tmp_contour_ptr->type == GLU_EXTERIOR) { + /* check if contour completely contained in EXTERIOR */ + result = is_contour_contained_in(tmp_contour_ptr, contours[i]); + switch (result) { + case GLU_INTERIOR: + /* now we have to check if contour is inside interiors */ + /* or not */ + /* any interiors? */ + if (tmp_contour_ptr->next != NULL && + tmp_contour_ptr->next->type == GLU_INTERIOR) { + /* for all interior, check if inside any of them */ + /* if not inside any of interiors, its another */ + /* interior */ + /* or it may contain some interiors, then change */ + /* the contained interiors to exterior ones */ + add_interior_with_hierarchy_check(tobj, + tmp_contour_ptr, + contours[i]); + } + else { + /* not in interior, add as new interior contour */ + add_new_interior(tobj, tmp_contour_ptr, contours[i]); + } + hierarchy_changed = GL_TRUE; + break; + case GLU_EXTERIOR: + /* ooops, the marked as EXTERIOR (contours[i]) is */ + /* actually an interior of tmp_contour_ptr */ + /* reverse the local hierarchy */ + reverse_hierarchy_and_add_exterior(tobj, tmp_contour_ptr, + contours[i]); + hierarchy_changed = GL_TRUE; + break; + case GLU_NO_ERROR: + break; + default: + abort(); + } + } + if (hierarchy_changed) + break; /* break from for loop */ + } + if (hierarchy_changed == GL_FALSE) { + /* disjoint with all contours, add to contour list */ + add_new_exterior(tobj, contours[i]); + } + } + free(contours); +} + +/* returns GLU_INTERIOR if inner is completey enclosed within outer */ +/* returns GLU_EXTERIOR if outer is completely enclosed within inner */ +/* returns GLU_NO_ERROR if contours are disjoint */ +static GLenum +is_contour_contained_in(tess_contour * outer, tess_contour * inner) +{ + GLenum relation_flag; + + /* set relation_flag to relation of containment of first inner vertex */ + /* regarding outer contour */ + if (point_in_polygon(outer, inner->vertices->x, inner->vertices->y)) + relation_flag = GLU_INTERIOR; + else + relation_flag = GLU_EXTERIOR; + if (relation_flag == GLU_INTERIOR) + return GLU_INTERIOR; + if (point_in_polygon(inner, outer->vertices->x, outer->vertices->y)) + return GLU_EXTERIOR; + return GLU_NO_ERROR; +} + +static GLboolean +point_in_polygon(tess_contour * contour, GLdouble x, GLdouble y) +{ + tess_vertex *v1, *v2; + GLuint i, vertex_cnt; + GLdouble xp1, yp1, xp2, yp2; + GLboolean tst; + + tst = GL_FALSE; + v1 = contour->vertices; + v2 = contour->vertices->previous; + for (i = 0, vertex_cnt = contour->vertex_cnt; i < vertex_cnt; i++) { + xp1 = v1->x; + yp1 = v1->y; + xp2 = v2->x; + yp2 = v2->y; + if ((((yp1 <= y) && (y < yp2)) || ((yp2 <= y) && (y < yp1))) && + (x < (xp2 - xp1) * (y - yp1) / (yp2 - yp1) + xp1)) + tst = (tst == GL_FALSE ? GL_TRUE : GL_FALSE); + v2 = v1; + v1 = v1->next; + } + return tst; +} + +static GLenum +contours_overlap(tess_contour * contour, tess_polygon * polygon) +{ + tess_vertex *vertex1, *vertex2; + GLuint vertex1_cnt, vertex2_cnt, i, j; + GLenum test; + + vertex1 = contour->vertices; + vertex2 = polygon->vertices; + vertex1_cnt = contour->vertex_cnt; + vertex2_cnt = polygon->vertex_cnt; + for (i = 0; i < vertex1_cnt; vertex1 = vertex1->next, i++) { + for (j = 0; j < vertex2_cnt; vertex2 = vertex2->next, j++) + if ((test = edge_edge_intersect(vertex1, vertex1->next, vertex2, + vertex2->next)) != GLU_NO_ERROR) + return test; + } + return GLU_NO_ERROR; +} + +static void +add_new_exterior(GLUtriangulatorObj * tobj, tess_contour * contour) +{ + contour->type = GLU_EXTERIOR; + contour->next = NULL; + contour->previous = tobj->last_contour; + tobj->last_contour->next = contour; + tobj->last_contour = contour; +} + +static void +add_new_interior(GLUtriangulatorObj * tobj, + tess_contour * outer, tess_contour * contour) +{ + contour->type = GLU_INTERIOR; + contour->next = outer->next; + contour->previous = outer; + if (outer->next != NULL) + outer->next->previous = contour; + outer->next = contour; + if (tobj->last_contour == outer) + tobj->last_contour = contour; +} + +static void +add_interior_with_hierarchy_check(GLUtriangulatorObj * tobj, + tess_contour * outer, + tess_contour * contour) +{ + tess_contour *ptr; + + /* for all interiors of outer check if they are interior of contour */ + /* if so, change that interior to exterior and move it of of the */ + /* interior sequence */ + if (outer->next != NULL && outer->next->type == GLU_INTERIOR) { + GLenum test; + + for (ptr = outer->next; ptr != NULL && ptr->type == GLU_INTERIOR; + ptr = ptr->next) { + test = is_contour_contained_in(ptr, contour); + switch (test) { + case GLU_INTERIOR: + /* contour is contained in one of the interiors */ + /* check if possibly contained in other exteriors */ + /* move ptr to first EXTERIOR */ + for (; ptr != NULL && ptr->type == GLU_INTERIOR; ptr = ptr->next); + if (ptr == NULL) + /* another exterior */ + add_new_exterior(tobj, contour); + else + add_exterior_with_check(tobj, ptr, contour); + return; + case GLU_EXTERIOR: + /* one of the interiors is contained in the contour */ + /* change it to EXTERIOR, and shift it away from the */ + /* interior sequence */ + shift_interior_to_exterior(tobj, ptr); + break; + case GLU_NO_ERROR: + /* disjoint */ + break; + default: + abort(); + } + } + } + /* add contour to the interior sequence */ + add_new_interior(tobj, outer, contour); +} + +static void +reverse_hierarchy_and_add_exterior(GLUtriangulatorObj * tobj, + tess_contour * outer, + tess_contour * contour) +{ + tess_contour *ptr; + + /* reverse INTERIORS to EXTERIORS */ + /* any INTERIORS? */ + if (outer->next != NULL && outer->next->type == GLU_INTERIOR) + for (ptr = outer->next; ptr != NULL && ptr->type == GLU_INTERIOR; + ptr = ptr->next) ptr->type = GLU_EXTERIOR; + /* the outer now becomes inner */ + outer->type = GLU_INTERIOR; + /* contour is the EXTERIOR */ + contour->next = outer; + if (tobj->contours == outer) { + /* first contour beeing reversed */ + contour->previous = NULL; + tobj->contours = contour; + } + else { + outer->previous->next = contour; + contour->previous = outer->previous; + } + outer->previous = contour; +} + +static void +shift_interior_to_exterior(GLUtriangulatorObj * tobj, tess_contour * contour) +{ + contour->previous->next = contour->next; + if (contour->next != NULL) + contour->next->previous = contour->previous; + else + tobj->last_contour = contour->previous; +} + +static void +add_exterior_with_check(GLUtriangulatorObj * tobj, + tess_contour * outer, tess_contour * contour) +{ + GLenum test; + + /* this contour might be interior to further exteriors - check */ + /* if not, just add as a new exterior */ + for (; outer != NULL && outer->type == GLU_EXTERIOR; outer = outer->next) { + test = is_contour_contained_in(outer, contour); + switch (test) { + case GLU_INTERIOR: + /* now we have to check if contour is inside interiors */ + /* or not */ + /* any interiors? */ + if (outer->next != NULL && outer->next->type == GLU_INTERIOR) { + /* for all interior, check if inside any of them */ + /* if not inside any of interiors, its another */ + /* interior */ + /* or it may contain some interiors, then change */ + /* the contained interiors to exterior ones */ + add_interior_with_hierarchy_check(tobj, outer, contour); + } + else { + /* not in interior, add as new interior contour */ + add_new_interior(tobj, outer, contour); + } + return; + case GLU_NO_ERROR: + /* disjoint */ + break; + default: + abort(); + } + } + /* add contour to the exterior sequence */ + add_new_exterior(tobj, contour); +} + +void +tess_handle_holes(GLUtriangulatorObj * tobj) +{ + tess_contour *contour, *hole; + GLenum exterior_orientation; + + /* verify hole orientation */ + for (contour = tobj->contours; contour != NULL;) { + exterior_orientation = contour->orientation; + for (contour = contour->next; + contour != NULL && contour->type == GLU_INTERIOR; + contour = contour->next) { + if (contour->orientation == exterior_orientation) { + tess_call_user_error(tobj, GLU_TESS_ERROR5); + return; + } + } + } + /* now cut-out holes */ + for (contour = tobj->contours; contour != NULL;) { + hole = contour->next; + while (hole != NULL && hole->type == GLU_INTERIOR) { + if (cut_out_hole(tobj, contour, hole) == GLU_ERROR) + return; + hole = contour->next; + } + contour = contour->next; + } +} + +static GLenum +cut_out_hole(GLUtriangulatorObj * tobj, + tess_contour * contour, tess_contour * hole) +{ + tess_contour *tmp_hole; + tess_vertex *v1, *v2, *tmp_vertex; + GLuint vertex1_cnt, vertex2_cnt, tmp_vertex_cnt; + GLuint i, j, k; + GLenum test; + + /* find an edge connecting contour and hole not intersecting any other */ + /* edge belonging to either the contour or any of the other holes */ + for (v1 = contour->vertices, vertex1_cnt = contour->vertex_cnt, i = 0; + i < vertex1_cnt; i++, v1 = v1->next) { + for (v2 = hole->vertices, vertex2_cnt = hole->vertex_cnt, j = 0; + j < vertex2_cnt; j++, v2 = v2->next) { + /* does edge (v1,v2) intersect any edge of contour */ + for (tmp_vertex = contour->vertices, tmp_vertex_cnt = + contour->vertex_cnt, k = 0; k < tmp_vertex_cnt; + tmp_vertex = tmp_vertex->next, k++) { + /* skip edge tests for edges directly connected */ + if (v1 == tmp_vertex || v1 == tmp_vertex->next) + continue; + test = edge_edge_intersect(v1, v2, tmp_vertex, tmp_vertex->next); + if (test != GLU_NO_ERROR) + break; + } + if (test == GLU_NO_ERROR) { + /* does edge (v1,v2) intersect any edge of hole */ + for (tmp_vertex = hole->vertices, + tmp_vertex_cnt = hole->vertex_cnt, k = 0; + k < tmp_vertex_cnt; tmp_vertex = tmp_vertex->next, k++) { + /* skip edge tests for edges directly connected */ + if (v2 == tmp_vertex || v2 == tmp_vertex->next) + continue; + test = + edge_edge_intersect(v1, v2, tmp_vertex, tmp_vertex->next); + if (test != GLU_NO_ERROR) + break; + } + if (test == GLU_NO_ERROR) { + /* does edge (v1,v2) intersect any other hole? */ + for (tmp_hole = hole->next; + tmp_hole != NULL && tmp_hole->type == GLU_INTERIOR; + tmp_hole = tmp_hole->next) { + /* does edge (v1,v2) intersect any edge of hole */ + for (tmp_vertex = tmp_hole->vertices, + tmp_vertex_cnt = tmp_hole->vertex_cnt, k = 0; + k < tmp_vertex_cnt; tmp_vertex = tmp_vertex->next, k++) { + test = edge_edge_intersect(v1, v2, tmp_vertex, + tmp_vertex->next); + if (test != GLU_NO_ERROR) + break; + } + if (test != GLU_NO_ERROR) + break; + } + } + } + if (test == GLU_NO_ERROR) { + /* edge (v1,v2) is good for eliminating the hole */ + if (merge_hole_with_contour(tobj, contour, hole, v1, v2) + == GLU_NO_ERROR) + return GLU_NO_ERROR; + else + return GLU_ERROR; + } + } + } + /* other holes are blocking all possible connections of hole */ + /* with contour, we shift this hole as the last hole and retry */ + for (tmp_hole = hole; + tmp_hole != NULL && tmp_hole->type == GLU_INTERIOR; + tmp_hole = tmp_hole->next); + contour->next = hole->next; + hole->next->previous = contour; + if (tmp_hole == NULL) { + /* last EXTERIOR contour, shift hole as last contour */ + hole->next = NULL; + hole->previous = tobj->last_contour; + tobj->last_contour->next = hole; + tobj->last_contour = hole; + } + else { + tmp_hole->previous->next = hole; + hole->previous = tmp_hole->previous; + tmp_hole->previous = hole; + hole->next = tmp_hole; + } + hole = contour->next; + /* try once again - recurse */ + return cut_out_hole(tobj, contour, hole); +} + +static GLenum +merge_hole_with_contour(GLUtriangulatorObj * tobj, + tess_contour * contour, + tess_contour * hole, + tess_vertex * v1, tess_vertex * v2) +{ + tess_vertex *v1_new, *v2_new; + + /* make copies of v1 and v2, place them respectively after their originals */ + if ((v1_new = (tess_vertex *) malloc(sizeof(tess_vertex))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + if ((v2_new = (tess_vertex *) malloc(sizeof(tess_vertex))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return GLU_ERROR; + } + v1_new->edge_flag = GL_TRUE; + v1_new->data = v1->data; + v1_new->location[0] = v1->location[0]; + v1_new->location[1] = v1->location[1]; + v1_new->location[2] = v1->location[2]; + v1_new->x = v1->x; + v1_new->y = v1->y; + v1_new->shadow_vertex = v1; + v1->shadow_vertex = v1_new; + v1_new->next = v1->next; + v1_new->previous = v1; + v1->next->previous = v1_new; + v1->next = v1_new; + v2_new->edge_flag = GL_TRUE; + v2_new->data = v2->data; + v2_new->location[0] = v2->location[0]; + v2_new->location[1] = v2->location[1]; + v2_new->location[2] = v2->location[2]; + v2_new->x = v2->x; + v2_new->y = v2->y; + v2_new->shadow_vertex = v2; + v2->shadow_vertex = v2_new; + v2_new->next = v2->next; + v2_new->previous = v2; + v2->next->previous = v2_new; + v2->next = v2_new; + /* link together the two lists */ + v1->next = v2_new; + v2_new->previous = v1; + v2->next = v1_new; + v1_new->previous = v2; + /* update the vertex count of the contour */ + contour->vertex_cnt += hole->vertex_cnt + 2; + /* remove the INTERIOR contour */ + contour->next = hole->next; + if (hole->next != NULL) + hole->next->previous = contour; + free(hole); + /* update tobj structure */ + --(tobj->contour_cnt); + if (contour->last_vertex == v1) + contour->last_vertex = v1_new; + /* mark two vertices with edge_flag */ + v2->edge_flag = GL_FALSE; + v1->edge_flag = GL_FALSE; + return GLU_NO_ERROR; +} diff --git a/src/glu/mesa/project.c b/src/glu/mesa/project.c index 6aa75a5d572..c8ab95992af 100644 --- a/src/glu/mesa/project.c +++ b/src/glu/mesa/project.c @@ -1,9 +1,9 @@ -/* $Id: project.c,v 1.2 1999/09/14 00:10:31 brianp Exp $ */ +/* $Id: project.c,v 1.3 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 - * Copyright (C) 1995-1999 Brian Paul + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -21,38 +21,6 @@ */ -/* - * $Log: project.c,v $ - * Revision 1.2 1999/09/14 00:10:31 brianp - * added gluUnProject4() - * - * Revision 1.1.1.1 1999/08/19 00:55:42 jtg - * Imported sources - * - * Revision 1.7 1999/01/03 03:23:15 brianp - * now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump) - * - * Revision 1.6 1998/07/08 01:43:43 brianp - * new version of invert_matrix() (also in src/matrix.c) - * - * Revision 1.5 1997/07/24 01:28:44 brianp - * changed precompiled header symbol from PCH to PC_HEADER - * - * Revision 1.4 1997/05/28 02:29:38 brianp - * added support for precompiled headers (PCH), inserted APIENTRY keyword - * - * Revision 1.3 1997/04/11 23:22:42 brianp - * added divide by zero checks to gluProject() and gluUnproject() - * - * Revision 1.2 1997/01/29 19:05:29 brianp - * faster invert_matrix() function from Stephane Rehel - * - * Revision 1.1 1996/09/27 01:19:39 brianp - * Initial revision - * - */ - - #ifdef PC_HEADER #include "all.h" #else @@ -81,14 +49,18 @@ * in - the 4x1 vector * Output: out - the resulting 4x1 vector. */ -static void transform_point( GLdouble out[4], const GLdouble m[16], - const GLdouble in[4] ) +static void +transform_point(GLdouble out[4], const GLdouble m[16], const GLdouble in[4]) { #define M(row,col) m[col*4+row] - out[0] = M(0,0) * in[0] + M(0,1) * in[1] + M(0,2) * in[2] + M(0,3) * in[3]; - out[1] = M(1,0) * in[0] + M(1,1) * in[1] + M(1,2) * in[2] + M(1,3) * in[3]; - out[2] = M(2,0) * in[0] + M(2,1) * in[1] + M(2,2) * in[2] + M(2,3) * in[3]; - out[3] = M(3,0) * in[0] + M(3,1) * in[1] + M(3,2) * in[2] + M(3,3) * in[3]; + out[0] = + M(0, 0) * in[0] + M(0, 1) * in[1] + M(0, 2) * in[2] + M(0, 3) * in[3]; + out[1] = + M(1, 0) * in[0] + M(1, 1) * in[1] + M(1, 2) * in[2] + M(1, 3) * in[3]; + out[2] = + M(2, 0) * in[0] + M(2, 1) * in[1] + M(2, 2) * in[2] + M(2, 3) * in[3]; + out[3] = + M(3, 0) * in[0] + M(3, 1) * in[1] + M(3, 2) * in[2] + M(3, 3) * in[3]; #undef M } @@ -100,7 +72,8 @@ static void transform_point( GLdouble out[4], const GLdouble m[16], * Input: a, b - matrices to multiply * Output: product - product of a and b */ -static void matmul( GLdouble *product, const GLdouble *a, const GLdouble *b ) +static void +matmul(GLdouble * product, const GLdouble * a, const GLdouble * b) { /* This matmul was contributed by Thomas Malik */ GLdouble temp[16]; @@ -111,18 +84,29 @@ static void matmul( GLdouble *product, const GLdouble *a, const GLdouble *b ) #define T(row,col) temp[(col<<2)+row] /* i-te Zeile */ - for (i = 0; i < 4; i++) - { - T(i, 0) = A(i, 0) * B(0, 0) + A(i, 1) * B(1, 0) + A(i, 2) * B(2, 0) + A(i, 3) * B(3, 0); - T(i, 1) = A(i, 0) * B(0, 1) + A(i, 1) * B(1, 1) + A(i, 2) * B(2, 1) + A(i, 3) * B(3, 1); - T(i, 2) = A(i, 0) * B(0, 2) + A(i, 1) * B(1, 2) + A(i, 2) * B(2, 2) + A(i, 3) * B(3, 2); - T(i, 3) = A(i, 0) * B(0, 3) + A(i, 1) * B(1, 3) + A(i, 2) * B(2, 3) + A(i, 3) * B(3, 3); - } + for (i = 0; i < 4; i++) { + T(i, 0) = + A(i, 0) * B(0, 0) + A(i, 1) * B(1, 0) + A(i, 2) * B(2, 0) + A(i, + 3) * + B(3, 0); + T(i, 1) = + A(i, 0) * B(0, 1) + A(i, 1) * B(1, 1) + A(i, 2) * B(2, 1) + A(i, + 3) * + B(3, 1); + T(i, 2) = + A(i, 0) * B(0, 2) + A(i, 1) * B(1, 2) + A(i, 2) * B(2, 2) + A(i, + 3) * + B(3, 2); + T(i, 3) = + A(i, 0) * B(0, 3) + A(i, 1) * B(1, 3) + A(i, 2) * B(2, 3) + A(i, + 3) * + B(3, 3); + } #undef A #undef B #undef T - MEMCPY( product, temp, 16*sizeof(GLdouble) ); + MEMCPY(product, temp, 16 * sizeof(GLdouble)); } @@ -132,118 +116,175 @@ static void matmul( GLdouble *product, const GLdouble *a, const GLdouble *b ) * Code contributed by Jacques Leroy jle@star.be * Return GL_TRUE for success, GL_FALSE for failure (singular matrix) */ -static GLboolean invert_matrix( const GLdouble *m, GLdouble *out ) +static GLboolean +invert_matrix(const GLdouble * m, GLdouble * out) { /* NB. OpenGL Matrices are COLUMN major. */ #define SWAP_ROWS(a, b) { GLdouble *_tmp = a; (a)=(b); (b)=_tmp; } #define MAT(m,r,c) (m)[(c)*4+(r)] - GLdouble wtmp[4][8]; - GLdouble m0, m1, m2, m3, s; - GLdouble *r0, *r1, *r2, *r3; - - r0 = wtmp[0], r1 = wtmp[1], r2 = wtmp[2], r3 = wtmp[3]; - - r0[0] = MAT(m,0,0), r0[1] = MAT(m,0,1), - r0[2] = MAT(m,0,2), r0[3] = MAT(m,0,3), - r0[4] = 1.0, r0[5] = r0[6] = r0[7] = 0.0, - - r1[0] = MAT(m,1,0), r1[1] = MAT(m,1,1), - r1[2] = MAT(m,1,2), r1[3] = MAT(m,1,3), - r1[5] = 1.0, r1[4] = r1[6] = r1[7] = 0.0, - - r2[0] = MAT(m,2,0), r2[1] = MAT(m,2,1), - r2[2] = MAT(m,2,2), r2[3] = MAT(m,2,3), - r2[6] = 1.0, r2[4] = r2[5] = r2[7] = 0.0, - - r3[0] = MAT(m,3,0), r3[1] = MAT(m,3,1), - r3[2] = MAT(m,3,2), r3[3] = MAT(m,3,3), - r3[7] = 1.0, r3[4] = r3[5] = r3[6] = 0.0; - - /* choose pivot - or die */ - if (fabs(r3[0])>fabs(r2[0])) SWAP_ROWS(r3, r2); - if (fabs(r2[0])>fabs(r1[0])) SWAP_ROWS(r2, r1); - if (fabs(r1[0])>fabs(r0[0])) SWAP_ROWS(r1, r0); - if (0.0 == r0[0]) return GL_FALSE; - - /* eliminate first variable */ - m1 = r1[0]/r0[0]; m2 = r2[0]/r0[0]; m3 = r3[0]/r0[0]; - s = r0[1]; r1[1] -= m1 * s; r2[1] -= m2 * s; r3[1] -= m3 * s; - s = r0[2]; r1[2] -= m1 * s; r2[2] -= m2 * s; r3[2] -= m3 * s; - s = r0[3]; r1[3] -= m1 * s; r2[3] -= m2 * s; r3[3] -= m3 * s; - s = r0[4]; - if (s != 0.0) { r1[4] -= m1 * s; r2[4] -= m2 * s; r3[4] -= m3 * s; } - s = r0[5]; - if (s != 0.0) { r1[5] -= m1 * s; r2[5] -= m2 * s; r3[5] -= m3 * s; } - s = r0[6]; - if (s != 0.0) { r1[6] -= m1 * s; r2[6] -= m2 * s; r3[6] -= m3 * s; } - s = r0[7]; - if (s != 0.0) { r1[7] -= m1 * s; r2[7] -= m2 * s; r3[7] -= m3 * s; } - - /* choose pivot - or die */ - if (fabs(r3[1])>fabs(r2[1])) SWAP_ROWS(r3, r2); - if (fabs(r2[1])>fabs(r1[1])) SWAP_ROWS(r2, r1); - if (0.0 == r1[1]) return GL_FALSE; - - /* eliminate second variable */ - m2 = r2[1]/r1[1]; m3 = r3[1]/r1[1]; - r2[2] -= m2 * r1[2]; r3[2] -= m3 * r1[2]; - r2[3] -= m2 * r1[3]; r3[3] -= m3 * r1[3]; - s = r1[4]; if (0.0 != s) { r2[4] -= m2 * s; r3[4] -= m3 * s; } - s = r1[5]; if (0.0 != s) { r2[5] -= m2 * s; r3[5] -= m3 * s; } - s = r1[6]; if (0.0 != s) { r2[6] -= m2 * s; r3[6] -= m3 * s; } - s = r1[7]; if (0.0 != s) { r2[7] -= m2 * s; r3[7] -= m3 * s; } - - /* choose pivot - or die */ - if (fabs(r3[2])>fabs(r2[2])) SWAP_ROWS(r3, r2); - if (0.0 == r2[2]) return GL_FALSE; - - /* eliminate third variable */ - m3 = r3[2]/r2[2]; - r3[3] -= m3 * r2[3], r3[4] -= m3 * r2[4], - r3[5] -= m3 * r2[5], r3[6] -= m3 * r2[6], - r3[7] -= m3 * r2[7]; - - /* last check */ - if (0.0 == r3[3]) return GL_FALSE; - - s = 1.0/r3[3]; /* now back substitute row 3 */ - r3[4] *= s; r3[5] *= s; r3[6] *= s; r3[7] *= s; - - m2 = r2[3]; /* now back substitute row 2 */ - s = 1.0/r2[2]; - r2[4] = s * (r2[4] - r3[4] * m2), r2[5] = s * (r2[5] - r3[5] * m2), - r2[6] = s * (r2[6] - r3[6] * m2), r2[7] = s * (r2[7] - r3[7] * m2); - m1 = r1[3]; - r1[4] -= r3[4] * m1, r1[5] -= r3[5] * m1, - r1[6] -= r3[6] * m1, r1[7] -= r3[7] * m1; - m0 = r0[3]; - r0[4] -= r3[4] * m0, r0[5] -= r3[5] * m0, - r0[6] -= r3[6] * m0, r0[7] -= r3[7] * m0; - - m1 = r1[2]; /* now back substitute row 1 */ - s = 1.0/r1[1]; - r1[4] = s * (r1[4] - r2[4] * m1), r1[5] = s * (r1[5] - r2[5] * m1), - r1[6] = s * (r1[6] - r2[6] * m1), r1[7] = s * (r1[7] - r2[7] * m1); - m0 = r0[2]; - r0[4] -= r2[4] * m0, r0[5] -= r2[5] * m0, - r0[6] -= r2[6] * m0, r0[7] -= r2[7] * m0; - - m0 = r0[1]; /* now back substitute row 0 */ - s = 1.0/r0[0]; - r0[4] = s * (r0[4] - r1[4] * m0), r0[5] = s * (r0[5] - r1[5] * m0), - r0[6] = s * (r0[6] - r1[6] * m0), r0[7] = s * (r0[7] - r1[7] * m0); - - MAT(out,0,0) = r0[4]; MAT(out,0,1) = r0[5], - MAT(out,0,2) = r0[6]; MAT(out,0,3) = r0[7], - MAT(out,1,0) = r1[4]; MAT(out,1,1) = r1[5], - MAT(out,1,2) = r1[6]; MAT(out,1,3) = r1[7], - MAT(out,2,0) = r2[4]; MAT(out,2,1) = r2[5], - MAT(out,2,2) = r2[6]; MAT(out,2,3) = r2[7], - MAT(out,3,0) = r3[4]; MAT(out,3,1) = r3[5], - MAT(out,3,2) = r3[6]; MAT(out,3,3) = r3[7]; - - return GL_TRUE; + GLdouble wtmp[4][8]; + GLdouble m0, m1, m2, m3, s; + GLdouble *r0, *r1, *r2, *r3; + + r0 = wtmp[0], r1 = wtmp[1], r2 = wtmp[2], r3 = wtmp[3]; + + r0[0] = MAT(m, 0, 0), r0[1] = MAT(m, 0, 1), + r0[2] = MAT(m, 0, 2), r0[3] = MAT(m, 0, 3), + r0[4] = 1.0, r0[5] = r0[6] = r0[7] = 0.0, + r1[0] = MAT(m, 1, 0), r1[1] = MAT(m, 1, 1), + r1[2] = MAT(m, 1, 2), r1[3] = MAT(m, 1, 3), + r1[5] = 1.0, r1[4] = r1[6] = r1[7] = 0.0, + r2[0] = MAT(m, 2, 0), r2[1] = MAT(m, 2, 1), + r2[2] = MAT(m, 2, 2), r2[3] = MAT(m, 2, 3), + r2[6] = 1.0, r2[4] = r2[5] = r2[7] = 0.0, + r3[0] = MAT(m, 3, 0), r3[1] = MAT(m, 3, 1), + r3[2] = MAT(m, 3, 2), r3[3] = MAT(m, 3, 3), + r3[7] = 1.0, r3[4] = r3[5] = r3[6] = 0.0; + + /* choose pivot - or die */ + if (fabs(r3[0]) > fabs(r2[0])) + SWAP_ROWS(r3, r2); + if (fabs(r2[0]) > fabs(r1[0])) + SWAP_ROWS(r2, r1); + if (fabs(r1[0]) > fabs(r0[0])) + SWAP_ROWS(r1, r0); + if (0.0 == r0[0]) + return GL_FALSE; + + /* eliminate first variable */ + m1 = r1[0] / r0[0]; + m2 = r2[0] / r0[0]; + m3 = r3[0] / r0[0]; + s = r0[1]; + r1[1] -= m1 * s; + r2[1] -= m2 * s; + r3[1] -= m3 * s; + s = r0[2]; + r1[2] -= m1 * s; + r2[2] -= m2 * s; + r3[2] -= m3 * s; + s = r0[3]; + r1[3] -= m1 * s; + r2[3] -= m2 * s; + r3[3] -= m3 * s; + s = r0[4]; + if (s != 0.0) { + r1[4] -= m1 * s; + r2[4] -= m2 * s; + r3[4] -= m3 * s; + } + s = r0[5]; + if (s != 0.0) { + r1[5] -= m1 * s; + r2[5] -= m2 * s; + r3[5] -= m3 * s; + } + s = r0[6]; + if (s != 0.0) { + r1[6] -= m1 * s; + r2[6] -= m2 * s; + r3[6] -= m3 * s; + } + s = r0[7]; + if (s != 0.0) { + r1[7] -= m1 * s; + r2[7] -= m2 * s; + r3[7] -= m3 * s; + } + + /* choose pivot - or die */ + if (fabs(r3[1]) > fabs(r2[1])) + SWAP_ROWS(r3, r2); + if (fabs(r2[1]) > fabs(r1[1])) + SWAP_ROWS(r2, r1); + if (0.0 == r1[1]) + return GL_FALSE; + + /* eliminate second variable */ + m2 = r2[1] / r1[1]; + m3 = r3[1] / r1[1]; + r2[2] -= m2 * r1[2]; + r3[2] -= m3 * r1[2]; + r2[3] -= m2 * r1[3]; + r3[3] -= m3 * r1[3]; + s = r1[4]; + if (0.0 != s) { + r2[4] -= m2 * s; + r3[4] -= m3 * s; + } + s = r1[5]; + if (0.0 != s) { + r2[5] -= m2 * s; + r3[5] -= m3 * s; + } + s = r1[6]; + if (0.0 != s) { + r2[6] -= m2 * s; + r3[6] -= m3 * s; + } + s = r1[7]; + if (0.0 != s) { + r2[7] -= m2 * s; + r3[7] -= m3 * s; + } + + /* choose pivot - or die */ + if (fabs(r3[2]) > fabs(r2[2])) + SWAP_ROWS(r3, r2); + if (0.0 == r2[2]) + return GL_FALSE; + + /* eliminate third variable */ + m3 = r3[2] / r2[2]; + r3[3] -= m3 * r2[3], r3[4] -= m3 * r2[4], + r3[5] -= m3 * r2[5], r3[6] -= m3 * r2[6], r3[7] -= m3 * r2[7]; + + /* last check */ + if (0.0 == r3[3]) + return GL_FALSE; + + s = 1.0 / r3[3]; /* now back substitute row 3 */ + r3[4] *= s; + r3[5] *= s; + r3[6] *= s; + r3[7] *= s; + + m2 = r2[3]; /* now back substitute row 2 */ + s = 1.0 / r2[2]; + r2[4] = s * (r2[4] - r3[4] * m2), r2[5] = s * (r2[5] - r3[5] * m2), + r2[6] = s * (r2[6] - r3[6] * m2), r2[7] = s * (r2[7] - r3[7] * m2); + m1 = r1[3]; + r1[4] -= r3[4] * m1, r1[5] -= r3[5] * m1, + r1[6] -= r3[6] * m1, r1[7] -= r3[7] * m1; + m0 = r0[3]; + r0[4] -= r3[4] * m0, r0[5] -= r3[5] * m0, + r0[6] -= r3[6] * m0, r0[7] -= r3[7] * m0; + + m1 = r1[2]; /* now back substitute row 1 */ + s = 1.0 / r1[1]; + r1[4] = s * (r1[4] - r2[4] * m1), r1[5] = s * (r1[5] - r2[5] * m1), + r1[6] = s * (r1[6] - r2[6] * m1), r1[7] = s * (r1[7] - r2[7] * m1); + m0 = r0[2]; + r0[4] -= r2[4] * m0, r0[5] -= r2[5] * m0, + r0[6] -= r2[6] * m0, r0[7] -= r2[7] * m0; + + m0 = r0[1]; /* now back substitute row 0 */ + s = 1.0 / r0[0]; + r0[4] = s * (r0[4] - r1[4] * m0), r0[5] = s * (r0[5] - r1[5] * m0), + r0[6] = s * (r0[6] - r1[6] * m0), r0[7] = s * (r0[7] - r1[7] * m0); + + MAT(out, 0, 0) = r0[4]; + MAT(out, 0, 1) = r0[5], MAT(out, 0, 2) = r0[6]; + MAT(out, 0, 3) = r0[7], MAT(out, 1, 0) = r1[4]; + MAT(out, 1, 1) = r1[5], MAT(out, 1, 2) = r1[6]; + MAT(out, 1, 3) = r1[7], MAT(out, 2, 0) = r2[4]; + MAT(out, 2, 1) = r2[5], MAT(out, 2, 2) = r2[6]; + MAT(out, 2, 3) = r2[7], MAT(out, 3, 0) = r3[4]; + MAT(out, 3, 1) = r3[5], MAT(out, 3, 2) = r3[6]; + MAT(out, 3, 3) = r3[7]; + + return GL_TRUE; #undef MAT #undef SWAP_ROWS @@ -252,63 +293,70 @@ static GLboolean invert_matrix( const GLdouble *m, GLdouble *out ) /* projection du point (objx,objy,obz) sur l'ecran (winx,winy,winz) */ -GLint GLAPIENTRY gluProject(GLdouble objx,GLdouble objy,GLdouble objz, - const GLdouble model[16],const GLdouble proj[16], - const GLint viewport[4], - GLdouble *winx,GLdouble *winy,GLdouble *winz) +GLint GLAPIENTRY +gluProject(GLdouble objx, GLdouble objy, GLdouble objz, + const GLdouble model[16], const GLdouble proj[16], + const GLint viewport[4], + GLdouble * winx, GLdouble * winy, GLdouble * winz) { - /* matrice de transformation */ - GLdouble in[4],out[4]; - - /* initilise la matrice et le vecteur a transformer */ - in[0]=objx; in[1]=objy; in[2]=objz; in[3]=1.0; - transform_point(out,model,in); - transform_point(in,proj,out); - - /* d'ou le resultat normalise entre -1 et 1*/ - if (in[3]==0.0) - return GL_FALSE; - - in[0]/=in[3]; in[1]/=in[3]; in[2]/=in[3]; - - /* en coordonnees ecran */ - *winx = viewport[0]+(1+in[0])*viewport[2]/2; - *winy = viewport[1]+(1+in[1])*viewport[3]/2; - /* entre 0 et 1 suivant z */ - *winz = (1+in[2])/2; - return GL_TRUE; + /* matrice de transformation */ + GLdouble in[4], out[4]; + + /* initilise la matrice et le vecteur a transformer */ + in[0] = objx; + in[1] = objy; + in[2] = objz; + in[3] = 1.0; + transform_point(out, model, in); + transform_point(in, proj, out); + + /* d'ou le resultat normalise entre -1 et 1 */ + if (in[3] == 0.0) + return GL_FALSE; + + in[0] /= in[3]; + in[1] /= in[3]; + in[2] /= in[3]; + + /* en coordonnees ecran */ + *winx = viewport[0] + (1 + in[0]) * viewport[2] / 2; + *winy = viewport[1] + (1 + in[1]) * viewport[3] / 2; + /* entre 0 et 1 suivant z */ + *winz = (1 + in[2]) / 2; + return GL_TRUE; } /* transformation du point ecran (winx,winy,winz) en point objet */ -GLint GLAPIENTRY gluUnProject(GLdouble winx,GLdouble winy,GLdouble winz, - const GLdouble model[16],const GLdouble proj[16], - const GLint viewport[4], - GLdouble *objx,GLdouble *objy,GLdouble *objz) +GLint GLAPIENTRY +gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, + const GLdouble model[16], const GLdouble proj[16], + const GLint viewport[4], + GLdouble * objx, GLdouble * objy, GLdouble * objz) { - /* matrice de transformation */ - GLdouble m[16], A[16]; - GLdouble in[4],out[4]; - - /* transformation coordonnees normalisees entre -1 et 1 */ - in[0]=(winx-viewport[0])*2/viewport[2] - 1.0; - in[1]=(winy-viewport[1])*2/viewport[3] - 1.0; - in[2]=2*winz - 1.0; - in[3]=1.0; - - /* calcul transformation inverse */ - matmul(A,proj,model); - invert_matrix(A,m); - - /* d'ou les coordonnees objets */ - transform_point(out,m,in); - if (out[3]==0.0) - return GL_FALSE; - *objx=out[0]/out[3]; - *objy=out[1]/out[3]; - *objz=out[2]/out[3]; - return GL_TRUE; + /* matrice de transformation */ + GLdouble m[16], A[16]; + GLdouble in[4], out[4]; + + /* transformation coordonnees normalisees entre -1 et 1 */ + in[0] = (winx - viewport[0]) * 2 / viewport[2] - 1.0; + in[1] = (winy - viewport[1]) * 2 / viewport[3] - 1.0; + in[2] = 2 * winz - 1.0; + in[3] = 1.0; + + /* calcul transformation inverse */ + matmul(A, proj, model); + invert_matrix(A, m); + + /* d'ou les coordonnees objets */ + transform_point(out, m, in); + if (out[3] == 0.0) + return GL_FALSE; + *objx = out[0] / out[3]; + *objy = out[1] / out[3]; + *objz = out[2] / out[3]; + return GL_TRUE; } @@ -316,36 +364,39 @@ GLint GLAPIENTRY gluUnProject(GLdouble winx,GLdouble winy,GLdouble winz, * New in GLU 1.3 * This is like gluUnProject but also takes near and far DepthRange values. */ +#ifdef GLU_VERSION_1_3 GLint GLAPIENTRY -gluUnProject4( GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, - const GLdouble modelMatrix[16], - const GLdouble projMatrix[16], - const GLint viewport[4], - GLclampd nearZ, GLclampd farZ, - GLdouble *objx, GLdouble *objy, GLdouble *objz, GLdouble *objw ) +gluUnProject4(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, + const GLdouble modelMatrix[16], + const GLdouble projMatrix[16], + const GLint viewport[4], + GLclampd nearZ, GLclampd farZ, + GLdouble * objx, GLdouble * objy, GLdouble * objz, + GLdouble * objw) { - /* matrice de transformation */ - GLdouble m[16], A[16]; - GLdouble in[4],out[4]; - GLdouble z = nearZ + winz * (farZ - nearZ); - - /* transformation coordonnees normalisees entre -1 et 1 */ - in[0] = (winx-viewport[0])*2/viewport[2] - 1.0; - in[1] = (winy-viewport[1])*2/viewport[3] - 1.0; - in[2] = 2.0 * z - 1.0; - in[3] = clipw; - - /* calcul transformation inverse */ - matmul(A,projMatrix,modelMatrix); - invert_matrix(A,m); - - /* d'ou les coordonnees objets */ - transform_point(out,m,in); - if (out[3]==0.0) - return GL_FALSE; - *objx=out[0]/out[3]; - *objy=out[1]/out[3]; - *objz=out[2]/out[3]; - *objw=out[3]; - return GL_TRUE; + /* matrice de transformation */ + GLdouble m[16], A[16]; + GLdouble in[4], out[4]; + GLdouble z = nearZ + winz * (farZ - nearZ); + + /* transformation coordonnees normalisees entre -1 et 1 */ + in[0] = (winx - viewport[0]) * 2 / viewport[2] - 1.0; + in[1] = (winy - viewport[1]) * 2 / viewport[3] - 1.0; + in[2] = 2.0 * z - 1.0; + in[3] = clipw; + + /* calcul transformation inverse */ + matmul(A, projMatrix, modelMatrix); + invert_matrix(A, m); + + /* d'ou les coordonnees objets */ + transform_point(out, m, in); + if (out[3] == 0.0) + return GL_FALSE; + *objx = out[0] / out[3]; + *objy = out[1] / out[3]; + *objz = out[2] / out[3]; + *objw = out[3]; + return GL_TRUE; } +#endif diff --git a/src/glu/mesa/quadric.c b/src/glu/mesa/quadric.c index 943c885a598..5d7bc8f5c61 100644 --- a/src/glu/mesa/quadric.c +++ b/src/glu/mesa/quadric.c @@ -1,4 +1,4 @@ -/* $Id: quadric.c,v 1.7 2000/02/10 17:45:52 brianp Exp $ */ +/* $Id: quadric.c,v 1.8 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -36,11 +36,21 @@ #include #include #include "gluP.h" -#include "tess_macros.h" #endif +#ifndef M_PI +# define M_PI (3.1415926) +#endif + + +/* + * Convert degrees to radians: + */ +#define DEG_TO_RAD(A) ((A)*(M_PI/180.0)) + + /* * Sin and Cos for degree angles: */ @@ -55,12 +65,13 @@ -struct GLUquadric { - GLenum DrawStyle; /* GLU_FILL, LINE, SILHOUETTE, or POINT */ - GLenum Orientation; /* GLU_INSIDE or GLU_OUTSIDE */ - GLboolean TextureFlag; /* Generate texture coords? */ - GLenum Normals; /* GLU_NONE, GLU_FLAT, or GLU_SMOOTH */ - void (GLCALLBACKP ErrorFunc)(GLenum err); /* Error handler callback function */ +struct GLUquadric +{ + GLenum DrawStyle; /* GLU_FILL, LINE, SILHOUETTE, or POINT */ + GLenum Orientation; /* GLU_INSIDE or GLU_OUTSIDE */ + GLboolean TextureFlag; /* Generate texture coords? */ + GLenum Normals; /* GLU_NONE, GLU_FLAT, or GLU_SMOOTH */ + void (GLCALLBACK * ErrorFunc) (GLenum err); /* Error handler callback function */ }; @@ -68,26 +79,29 @@ struct GLUquadric { /* * Process a GLU error. */ -static void quadric_error( GLUquadricObj *qobj, GLenum error, const char *msg ) +static void +quadric_error(GLUquadricObj * qobj, GLenum error, const char *msg) { /* Call the error call back function if any */ if (qobj->ErrorFunc) { - (*qobj->ErrorFunc)( error ); + (*qobj->ErrorFunc) (error); } /* Print a message to stdout if MESA_DEBUG variable is defined */ if (getenv("MESA_DEBUG")) { - fprintf(stderr,"GLUError: %s: %s\n", (char*) gluErrorString(error), msg); + fprintf(stderr, "GLUError: %s: %s\n", (char *) gluErrorString(error), + msg); } } -GLUquadricObj * GLAPIENTRY gluNewQuadric( void ) +GLUquadricObj *GLAPIENTRY +gluNewQuadric(void) { GLUquadricObj *q; - q = (GLUquadricObj *) malloc( sizeof(struct GLUquadric) ); + q = (GLUquadricObj *) malloc(sizeof(struct GLUquadric)); if (q) { q->DrawStyle = GLU_FILL; q->Orientation = GLU_OUTSIDE; @@ -100,10 +114,11 @@ GLUquadricObj * GLAPIENTRY gluNewQuadric( void ) -void GLAPIENTRY gluDeleteQuadric( GLUquadricObj *state ) +void GLAPIENTRY +gluDeleteQuadric(GLUquadricObj * state) { if (state) { - free( (void *) state ); + free((void *) state); } } @@ -113,14 +128,16 @@ void GLAPIENTRY gluDeleteQuadric( GLUquadricObj *state ) * Set the drawing style to be GLU_FILL, GLU_LINE, GLU_SILHOUETTE, * or GLU_POINT. */ -void GLAPIENTRY gluQuadricDrawStyle( GLUquadricObj *quadObject, GLenum drawStyle ) +void GLAPIENTRY +gluQuadricDrawStyle(GLUquadricObj * quadObject, GLenum drawStyle) { - if (quadObject && (drawStyle==GLU_FILL || drawStyle==GLU_LINE - || drawStyle==GLU_SILHOUETTE || drawStyle==GLU_POINT)) { + if (quadObject && (drawStyle == GLU_FILL || drawStyle == GLU_LINE + || drawStyle == GLU_SILHOUETTE + || drawStyle == GLU_POINT)) { quadObject->DrawStyle = drawStyle; } else { - quadric_error( quadObject, GLU_INVALID_ENUM, "qluQuadricDrawStyle" ); + quadric_error(quadObject, GLU_INVALID_ENUM, "qluQuadricDrawStyle"); } } @@ -129,14 +146,15 @@ void GLAPIENTRY gluQuadricDrawStyle( GLUquadricObj *quadObject, GLenum drawStyle /* * Set the orientation to GLU_INSIDE or GLU_OUTSIDE. */ -void GLAPIENTRY gluQuadricOrientation( GLUquadricObj *quadObject, - GLenum orientation ) +void GLAPIENTRY +gluQuadricOrientation(GLUquadricObj * quadObject, GLenum orientation) { - if (quadObject && (orientation==GLU_INSIDE || orientation==GLU_OUTSIDE)) { + if (quadObject + && (orientation == GLU_INSIDE || orientation == GLU_OUTSIDE)) { quadObject->Orientation = orientation; } else { - quadric_error( quadObject, GLU_INVALID_ENUM, "qluQuadricOrientation" ); + quadric_error(quadObject, GLU_INVALID_ENUM, "qluQuadricOrientation"); } } @@ -145,41 +163,44 @@ void GLAPIENTRY gluQuadricOrientation( GLUquadricObj *quadObject, /* * Set the error handler callback function. */ -void GLAPIENTRY gluQuadricCallback( GLUquadricObj *qobj, - GLenum which, void (GLCALLBACKP fn)() ) +void GLAPIENTRY +gluQuadricCallback(GLUquadricObj * qobj, + GLenum which, void (GLCALLBACK * fn) ()) { /* * UGH, this is a mess! I thought ANSI was a standard. */ - if (qobj && which==GLU_ERROR) { + if (qobj && which == GLU_ERROR) { #ifdef __CYGWIN32__ - qobj->ErrorFunc = (void(GLCALLBACKPCAST)(GLenum))fn; + qobj->ErrorFunc = (void (GLCALLBACKPCAST) (GLenum)) fn; #elif defined(OPENSTEP) - qobj->ErrorFunc = (void(*)(GLenum))fn; + qobj->ErrorFunc = (void (*)(GLenum)) fn; #elif defined(_WIN32) - qobj->ErrorFunc = (void(GLCALLBACKP)(int))fn; + qobj->ErrorFunc = (void (GLCALLBACK *) (int)) fn; #elif defined(__STORM__) - qobj->ErrorFunc = (void(GLCALLBACKP)(GLenum))fn; + qobj->ErrorFunc = (void (GLCALLBACK *) (GLenum)) fn; #elif defined(__BEOS__) - qobj->ErrorFunc = (void(*)(GLenum))fn; + qobj->ErrorFunc = (void (*)(GLenum)) fn; #else - qobj->ErrorFunc = (void(GLCALLBACKP)())fn; + qobj->ErrorFunc = (void (GLCALLBACK *) ()) fn; #endif } } -void GLAPIENTRY gluQuadricNormals( GLUquadricObj *quadObject, GLenum normals ) +void GLAPIENTRY +gluQuadricNormals(GLUquadricObj * quadObject, GLenum normals) { if (quadObject - && (normals==GLU_NONE || normals==GLU_FLAT || normals==GLU_SMOOTH)) { + && (normals == GLU_NONE || normals == GLU_FLAT + || normals == GLU_SMOOTH)) { quadObject->Normals = normals; } } -void GLAPIENTRY gluQuadricTexture( GLUquadricObj *quadObject, - GLboolean textureCoords ) +void GLAPIENTRY +gluQuadricTexture(GLUquadricObj * quadObject, GLboolean textureCoords) { if (quadObject) { quadObject->TextureFlag = textureCoords; @@ -192,70 +213,72 @@ void GLAPIENTRY gluQuadricTexture( GLUquadricObj *quadObject, /* * Call glNormal3f after scaling normal to unit length. */ -static void normal3f( GLfloat x, GLfloat y, GLfloat z ) +static void +normal3f(GLfloat x, GLfloat y, GLfloat z) { GLdouble mag; - mag = sqrt( x*x + y*y + z*z ); - if (mag>0.00001F) { + mag = sqrt(x * x + y * y + z * z); + if (mag > 0.00001F) { x /= mag; y /= mag; z /= mag; } - glNormal3f( x, y, z ); + glNormal3f(x, y, z); } -void GLAPIENTRY gluCylinder( GLUquadricObj *qobj, - GLdouble baseRadius, GLdouble topRadius, - GLdouble height, GLint slices, GLint stacks ) +void GLAPIENTRY +gluCylinder(GLUquadricObj * qobj, + GLdouble baseRadius, GLdouble topRadius, + GLdouble height, GLint slices, GLint stacks) { GLdouble da, r, dr, dz; GLfloat x, y, z, nz, nsign; GLint i, j; - if (qobj->Orientation==GLU_INSIDE) { + if (qobj->Orientation == GLU_INSIDE) { nsign = -1.0; } else { nsign = 1.0; } - da = 2.0*M_PI / slices; - dr = (topRadius-baseRadius) / stacks; + da = 2.0 * M_PI / slices; + dr = (topRadius - baseRadius) / stacks; dz = height / stacks; - nz = (baseRadius-topRadius) / height; /* Z component of normal vectors */ + nz = (baseRadius - topRadius) / height; /* Z component of normal vectors */ - if (qobj->DrawStyle==GLU_POINT) { - glBegin( GL_POINTS ); - for (i=0;iDrawStyle == GLU_POINT) { + glBegin(GL_POINTS); + for (i = 0; i < slices; i++) { + x = cos(i * da); + y = sin(i * da); + normal3f(x * nsign, y * nsign, nz * nsign); z = 0.0; r = baseRadius; - for (j=0;j<=stacks;j++) { - glVertex3f( x*r, y*r, z ); + for (j = 0; j <= stacks; j++) { + glVertex3f(x * r, y * r, z); z += dz; r += dr; } } glEnd(); } - else if (qobj->DrawStyle==GLU_LINE || qobj->DrawStyle==GLU_SILHOUETTE) { + else if (qobj->DrawStyle == GLU_LINE || qobj->DrawStyle == GLU_SILHOUETTE) { /* Draw rings */ - if (qobj->DrawStyle==GLU_LINE) { + if (qobj->DrawStyle == GLU_LINE) { z = 0.0; r = baseRadius; - for (j=0;j<=stacks;j++) { - glBegin( GL_LINE_LOOP ); - for (i=0;iDrawStyle==GLU_FILL) { + else if (qobj->DrawStyle == GLU_FILL) { GLfloat ds = 1.0 / slices; GLfloat dt = 1.0 / stacks; GLfloat t = 0.0; z = 0.0; r = baseRadius; - for (j=0;jNormals==GLU_NONE) { + if (qobj->Normals == GLU_NONE) { normals = GL_FALSE; } else { normals = GL_TRUE; } - if (qobj->Orientation==GLU_INSIDE) { + if (qobj->Orientation == GLU_INSIDE) { nsign = -1.0; } else { @@ -373,131 +396,140 @@ void GLAPIENTRY gluSphere( GLUquadricObj *qobj, /* t goes from -1.0/+1.0 at z = -radius/+radius (linear along longitudes) */ /* cannot use triangle fan on texturing (s coord. at top/bottom tip varies) */ - if (qobj->DrawStyle==GLU_FILL) { - if (!qobj->TextureFlag) { - /* draw +Z end as a triangle fan */ - glBegin( GL_TRIANGLE_FAN ); - glNormal3f( 0.0, 0.0, 1.0 ); - TXTR_COORD(0.5,1.0); - glVertex3f( 0.0, 0.0, nsign * radius ); - for (j=0;j<=slices;j++) { - theta = (j==slices) ? 0.0 : j * dtheta; - x = -sin(theta) * sin(drho); - y = cos(theta) * sin(drho); - z = nsign * cos(drho); - if (normals) glNormal3f( x*nsign, y*nsign, z*nsign ); - glVertex3f( x*radius, y*radius, z*radius ); + if (qobj->DrawStyle == GLU_FILL) { + if (!qobj->TextureFlag) { + /* draw +Z end as a triangle fan */ + glBegin(GL_TRIANGLE_FAN); + glNormal3f(0.0, 0.0, 1.0); + TXTR_COORD(0.5, 1.0); + glVertex3f(0.0, 0.0, nsign * radius); + for (j = 0; j <= slices; j++) { + theta = (j == slices) ? 0.0 : j * dtheta; + x = -sin(theta) * sin(drho); + y = cos(theta) * sin(drho); + z = nsign * cos(drho); + if (normals) + glNormal3f(x * nsign, y * nsign, z * nsign); + glVertex3f(x * radius, y * radius, z * radius); + } + glEnd(); } - glEnd(); - } ds = 1.0 / slices; dt = 1.0 / stacks; - t = 1.0; /* because loop now runs from 0 */ + t = 1.0; /* because loop now runs from 0 */ if (qobj->TextureFlag) { - imin = 0; - imax = stacks; + imin = 0; + imax = stacks; } else { - imin = 1; - imax = stacks-1; + imin = 1; + imax = stacks - 1; } /* draw intermediate stacks as quad strips */ - for (i=imin;iTextureFlag) { - /* draw -Z end as a triangle fan */ - glBegin( GL_TRIANGLE_FAN ); - glNormal3f( 0.0, 0.0, -1.0 ); - TXTR_COORD(0.5,0.0); - glVertex3f( 0.0, 0.0, -radius*nsign ); - rho = M_PI - drho; - s = 1.0; - t = dt; - for (j=slices;j>=0;j--) { - theta = (j==slices) ? 0.0 : j * dtheta; - x = -sin(theta) * sin(rho); - y = cos(theta) * sin(rho); - z = nsign * cos(rho); - if (normals) glNormal3f( x*nsign, y*nsign, z*nsign ); - TXTR_COORD(s,t); - s -= ds; - glVertex3f( x*radius, y*radius, z*radius ); + if (!qobj->TextureFlag) { + /* draw -Z end as a triangle fan */ + glBegin(GL_TRIANGLE_FAN); + glNormal3f(0.0, 0.0, -1.0); + TXTR_COORD(0.5, 0.0); + glVertex3f(0.0, 0.0, -radius * nsign); + rho = M_PI - drho; + s = 1.0; + t = dt; + for (j = slices; j >= 0; j--) { + theta = (j == slices) ? 0.0 : j * dtheta; + x = -sin(theta) * sin(rho); + y = cos(theta) * sin(rho); + z = nsign * cos(rho); + if (normals) + glNormal3f(x * nsign, y * nsign, z * nsign); + TXTR_COORD(s, t); + s -= ds; + glVertex3f(x * radius, y * radius, z * radius); + } + glEnd(); } - glEnd(); - } } - else if (qobj->DrawStyle==GLU_LINE || qobj->DrawStyle==GLU_SILHOUETTE) { + else if (qobj->DrawStyle == GLU_LINE || qobj->DrawStyle == GLU_SILHOUETTE) { /* draw stack lines */ - for (i=1;iDrawStyle==GLU_POINT) { + else if (qobj->DrawStyle == GLU_POINT) { /* top and bottom-most points */ - glBegin( GL_POINTS ); - if (normals) glNormal3f( 0.0, 0.0, nsign ); - glVertex3d( 0.0, 0.0, radius ); - if (normals) glNormal3f( 0.0, 0.0, -nsign ); - glVertex3d( 0.0, 0.0, -radius ); + glBegin(GL_POINTS); + if (normals) + glNormal3f(0.0, 0.0, nsign); + glVertex3d(0.0, 0.0, radius); + if (normals) + glNormal3f(0.0, 0.0, -nsign); + glVertex3d(0.0, 0.0, -radius); /* loop over stacks */ - for (i=1;iNormals!=GLU_NONE) { - if (qobj->Orientation==GLU_OUTSIDE) { - glNormal3f( 0.0, 0.0, +1.0 ); + if (qobj->Normals != GLU_NONE) { + if (qobj->Orientation == GLU_OUTSIDE) { + glNormal3f(0.0, 0.0, +1.0); } else { - glNormal3f( 0.0, 0.0, -1.0 ); + glNormal3f(0.0, 0.0, -1.0); } } - da = 2.0*M_PI / slices; - dr = (outerRadius-innerRadius) / (GLfloat) loops; + da = 2.0 * M_PI / slices; + dr = (outerRadius - innerRadius) / (GLfloat) loops; switch (qobj->DrawStyle) { - case GLU_FILL: + case GLU_FILL: { - /* texture of a gluDisk is a cut out of the texture unit square - * x, y in [-outerRadius, +outerRadius]; s, t in [0, 1] - * (linear mapping) - */ - GLfloat dtc = 2.0f * outerRadius; - GLfloat sa,ca; - GLfloat r1 = innerRadius; - GLint l; - for (l=0; lOrientation==GLU_OUTSIDE) { - GLint s; - glBegin( GL_QUAD_STRIP ); - for (s=0;s<=slices;s++) { - GLfloat a; - if (s==slices) a = 0.0; - else a = s * da; - sa = sin(a); ca = cos(a); - TXTR_COORD(0.5+sa*r2/dtc,0.5+ca*r2/dtc); - glVertex2f( r2*sa, r2*ca ); - TXTR_COORD(0.5+sa*r1/dtc,0.5+ca*r1/dtc); - glVertex2f( r1*sa, r1*ca ); + if (qobj->Orientation == GLU_OUTSIDE) { + GLint s; + glBegin(GL_QUAD_STRIP); + for (s = 0; s <= slices; s++) { + GLfloat a; + if (s == slices) + a = 0.0; + else + a = s * da; + sa = sin(a); + ca = cos(a); + TXTR_COORD(0.5 + sa * r2 / dtc, 0.5 + ca * r2 / dtc); + glVertex2f(r2 * sa, r2 * ca); + TXTR_COORD(0.5 + sa * r1 / dtc, 0.5 + ca * r1 / dtc); + glVertex2f(r1 * sa, r1 * ca); } glEnd(); } else { - GLint s; - glBegin( GL_QUAD_STRIP ); - for (s=slices;s>=0;s--) { - GLfloat a; - if (s==slices) a = 0.0; - else a = s * da; - sa = sin(a); ca = cos(a); - TXTR_COORD(0.5-sa*r2/dtc,0.5+ca*r2/dtc); - glVertex2f( r2*sa, r2*ca ); - TXTR_COORD(0.5-sa*r1/dtc,0.5+ca*r1/dtc); - glVertex2f( r1*sa, r1*ca ); + GLint s; + glBegin(GL_QUAD_STRIP); + for (s = slices; s >= 0; s--) { + GLfloat a; + if (s == slices) + a = 0.0; + else + a = s * da; + sa = sin(a); + ca = cos(a); + TXTR_COORD(0.5 - sa * r2 / dtc, 0.5 + ca * r2 / dtc); + glVertex2f(r2 * sa, r2 * ca); + TXTR_COORD(0.5 - sa * r1 / dtc, 0.5 + ca * r1 / dtc); + glVertex2f(r1 * sa, r1 * ca); } glEnd(); } r1 = r2; } - break; + break; } - case GLU_LINE: + case GLU_LINE: { - GLint l, s; + GLint l, s; /* draw loops */ - for (l=0; l<=loops; l++) { - GLfloat r = innerRadius + l * dr; - glBegin( GL_LINE_LOOP ); - for (s=0; sNormals!=GLU_NONE) { - if (qobj->Orientation==GLU_OUTSIDE) { - glNormal3f( 0.0, 0.0, +1.0 ); + if (qobj->Normals != GLU_NONE) { + if (qobj->Orientation == GLU_OUTSIDE) { + glNormal3f(0.0, 0.0, +1.0); } else { - glNormal3f( 0.0, 0.0, -1.0 ); + glNormal3f(0.0, 0.0, -1.0); } } - if (qobj->DrawStyle==GLU_POINT) { + if (qobj->DrawStyle == GLU_POINT) { GLint loop, slice; GLdouble radius, delta_radius; GLdouble angle, delta_angle; - delta_radius = (outerRadius - innerRadius) / (loops-1); - delta_angle = DEG_TO_RAD((sweepAngle) / (slices-1)); - glBegin( GL_POINTS ); + delta_radius = (outerRadius - innerRadius) / (loops - 1); + delta_angle = DEG_TO_RAD((sweepAngle) / (slices - 1)); + glBegin(GL_POINTS); radius = innerRadius; - for (loop=0; loopDrawStyle==GLU_LINE) { + else if (qobj->DrawStyle == GLU_LINE) { GLint loop, slice; GLdouble radius, delta_radius; GLdouble angle, delta_angle; @@ -694,11 +733,11 @@ void GLAPIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius, delta_angle = DEG_TO_RAD(sweepAngle / slices); /* draw rings */ radius = innerRadius; - for (loop=0; loopDrawStyle==GLU_SILHOUETTE) { + else if (qobj->DrawStyle == GLU_SILHOUETTE) { GLint slice; GLdouble angle, delta_angle; delta_angle = DEG_TO_RAD(sweepAngle / slices); /* draw outer ring */ - glBegin( GL_LINE_STRIP ); + glBegin(GL_LINE_STRIP); angle = DEG_TO_RAD(startAngle); - for (slice=0; slice<=slices; slice++) { - glVertex2d( outerRadius * sin(angle), outerRadius * cos(angle) ); + for (slice = 0; slice <= slices; slice++) { + glVertex2d(outerRadius * sin(angle), outerRadius * cos(angle)); angle += delta_angle; } glEnd(); /* draw inner ring */ - if (innerRadius>0.0) { - glBegin( GL_LINE_STRIP ); + if (innerRadius > 0.0) { + glBegin(GL_LINE_STRIP); angle = DEG_TO_RAD(startAngle); - for (slice=0; sliceDrawStyle==GLU_FILL) { + else if (qobj->DrawStyle == GLU_FILL) { GLint loop, slice; GLdouble radius, delta_radius; GLdouble angle, delta_angle; delta_radius = (outerRadius - innerRadius) / loops; delta_angle = DEG_TO_RAD(sweepAngle / slices); radius = innerRadius; - for (loop=0; loopOrientation==GLU_OUTSIDE) { - glVertex2d( (radius+delta_radius)*sin(angle), - (radius+delta_radius)*cos(angle) ); - glVertex2d( radius * sin(angle), radius * cos(angle) ); + for (slice = 0; slice <= slices; slice++) { + if (qobj->Orientation == GLU_OUTSIDE) { + glVertex2d((radius + delta_radius) * sin(angle), + (radius + delta_radius) * cos(angle)); + glVertex2d(radius * sin(angle), radius * cos(angle)); } else { - glVertex2d( radius * sin(angle), radius * cos(angle) ); - glVertex2d( (radius+delta_radius)*sin(angle), - (radius+delta_radius)*cos(angle) ); + glVertex2d(radius * sin(angle), radius * cos(angle)); + glVertex2d((radius + delta_radius) * sin(angle), + (radius + delta_radius) * cos(angle)); } angle += delta_angle; } @@ -778,6 +821,3 @@ void GLAPIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius, } } } - - - diff --git a/src/glu/mesa/tess.c b/src/glu/mesa/tess.c index 919643cb8e2..7e05dbb0d08 100644 --- a/src/glu/mesa/tess.c +++ b/src/glu/mesa/tess.c @@ -1,1038 +1,317 @@ -/* $Id: tess.c,v 1.24 2000/02/10 17:45:52 brianp Exp $ */ +/* $Id: tess.c,v 1.25 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul * - * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * 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: + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * 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. + * 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. */ -/***************************************************************************** - * - * GLU 1.3 Polygon Tessellation by Gareth Hughes - * - *****************************************************************************/ -#include -#include -#include -#include +/* + * This file is part of the polygon tesselation code contributed by + * Bogdan Sikorski + */ -#include "gluP.h" +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include #include "tess.h" -#include "tess_macros.h" -#include "tess_fist.h" -#if 0 -#include "tess_grid.h" #endif -#define TESS_CHECK_ERRORS(t) if ( (t)->error != GLU_NO_ERROR ) goto cleanup - -#ifdef DEBUG -GLint tess_dbg_level; -#endif - - -/***************************************************************************** - * tess_error_callback - * - * Internal error handler. Call the user-registered error callback. - * - * 2nd arg changed from 'errno' to 'errnum' since MSVC defines errnum as - * a macro (of all things) and thus breaks the build -tjump - *****************************************************************************/ -void tess_error_callback( GLUtesselator *tobj, GLenum errnum ) -{ - if ( tobj->error == GLU_NO_ERROR ) - { - tobj->error = errnum; - } - - if ( tobj->callbacks.errorData != NULL ) - { - ( tobj->callbacks.errorData )( errnum, tobj->data ); - } - else if ( tobj->callbacks.error != NULL ) - { - ( tobj->callbacks.error )( errnum ); - } -} - - -/***************************************************************************** - * init_callbacks - *****************************************************************************/ -static void init_callbacks( tess_callbacks_t *callbacks ) -{ - callbacks->begin = ( void (GLCALLBACKPCAST)(GLenum) ) NULL; - callbacks->beginData = ( void (GLCALLBACKPCAST)(GLenum, void *) ) NULL; - callbacks->edgeFlag = ( void (GLCALLBACKPCAST)(GLboolean) ) NULL; - callbacks->edgeFlagData = ( void (GLCALLBACKPCAST)(GLboolean, void *) ) NULL; - callbacks->vertex = ( void (GLCALLBACKPCAST)(void *) ) NULL; - callbacks->vertexData = ( void (GLCALLBACKPCAST)(void *, void *) ) NULL; - callbacks->end = ( void (GLCALLBACKPCAST)(void) ) NULL; - callbacks->endData = ( void (GLCALLBACKPCAST)(void *) ) NULL; - callbacks->error = ( void (GLCALLBACKPCAST)(GLenum) ) NULL; - callbacks->errorData = ( void (GLCALLBACKPCAST)(GLenum, void *) ) NULL; - callbacks->combine = ( void (GLCALLBACKPCAST)(GLdouble [3], void *[4], - GLfloat [4], void **) ) NULL; - callbacks->combineData = ( void (GLCALLBACKPCAST)(GLdouble [3], void *[4], - GLfloat [4], void **, - void *) ) NULL; -} - - -/***************************************************************************** - * find_normal - *****************************************************************************/ -static GLenum find_normal( GLUtesselator *tobj ) -{ - tess_contour_t *contour = tobj->current_contour; - tess_vertex_t *va, *vb, *vc; - GLdouble a[3], b[3], c[3]; - - MSG( 15, " --> find_normal( tobj:%p )\n", tobj ); - - if ( contour == NULL ) { return GLU_ERROR; } - - va = contour->vertices; - vb = va->next; - - /* If va and vb are the same point, keep looking for a different vertex. */ - - while ( IS_EQUAL_3DV( va->coords, vb->coords ) && ( vb != va ) ) { - vb = vb->next; - } - - if ( vb == va ) { - /* FIXME: What error is this? */ - tess_error_callback( tobj, GLU_TESS_ERROR7 ); - } - - SUB_3V( a, vb->coords, va->coords ); - - for ( vc = vb->next; vc != va; vc = vc->next ) - { - SUB_3V( b, vc->coords, va->coords ); - - CROSS_3V( c, a, b ); - - if ( ! IS_ZERO_3DV( c ) ) - { - MSG( 15, " using (%.2f,%.2f) -> (%.2f,%.2f) -> (%.2f,%.2f)\n", - va->coords[X], va->coords[Y], - vb->coords[X], vb->coords[Y], - vc->coords[X], vc->coords[Y] ); - - COPY_3V( contour->plane.normal, c ); - NORMALIZE_3DV( contour->plane.normal ); - - contour->plane.dist = - DOT_3V( contour->plane.normal, - va->coords ); - - MSG( 15, " <-- find_normal( tobj:%p ) n: (%.2f, %.2f, %.2f)\n", tobj, contour->plane.normal[X], contour->plane.normal[Y], contour->plane.normal[Z] ); - return GLU_NO_ERROR; - } - } - /* FIXME: What error is this? */ - tess_error_callback( tobj, GLU_TESS_ERROR7 ); - - return GLU_ERROR; -} - -/***************************************************************************** - * twice_contour_area - * - * Calculate the twice the signed area of the given contour. Used to - * determine the contour's orientation amongst other things. - *****************************************************************************/ -GLdouble twice_contour_area( tess_contour_t *contour ) -{ - tess_vertex_t *vertex = contour->vertices; - GLdouble area, x, y; - - area = 0.0; - - x = vertex->v[X]; - y = vertex->v[Y]; - - vertex = vertex->next; - - do - { - area += ( (vertex->v[X] - x) * (vertex->next->v[Y] - y) - - (vertex->v[Y] - y) * (vertex->next->v[X] - x) ); - vertex = vertex->next; - } - while ( vertex != contour->vertices ); - - return area; -} - -/***************************************************************************** - * project_current_contour - * - * Project the contour's vertices onto the tessellation plane. We perform - * a complex rotation here to allow non-axis-aligned tessellation normals. - *****************************************************************************/ -static void project_current_contour( GLUtesselator *tobj ) -{ - tess_contour_t *current = tobj->current_contour; - tess_vertex_t *vertex; - GLdouble zaxis[3] = { 0.0, 0.0, 1.0 }, znormal[3], xnormal[3]; - GLdouble dot, rotx, roty; - GLint i; - - MSG( 15, " --> project_current_contour( tobj:%p )\n", tobj ); - - if ( current == NULL ) { return; } - - /* Rotate the plane normal around the y-axis. */ - - znormal[X] = current->plane.normal[X]; - znormal[Y] = 0.0; - znormal[Z] = current->plane.normal[Z]; - - dot = DOT_3V( znormal, zaxis ); - current->roty = roty = acos( dot ); - - /* Rotate the plane normal around the x-axis. */ - - xnormal[X] = cos( roty ) * znormal[X] - sin( roty ) * znormal[Z]; - xnormal[Y] = znormal[Y]; - xnormal[Z] = sin( roty ) * znormal[X] + cos( roty ) * znormal[Z]; - - dot = DOT_3V( xnormal, zaxis ); - current->rotx = rotx = acos( dot ); - - for ( vertex = current->vertices, i = 0; - i < current->num_vertices; vertex = vertex->next, i++ ) - { - tess_plane_t *plane = ¤t->plane; - GLdouble proj[3], yrot[3], xrot[3]; - - /* FIXME: This needs a cleanup, 'cos I'm sure it's inefficient. */ - - proj[X] = vertex->coords[X] - plane->dist * plane->normal[X]; - proj[Y] = vertex->coords[Y] - plane->dist * plane->normal[Y]; - proj[Z] = vertex->coords[Z] - plane->dist * plane->normal[Z]; - - yrot[X] = cos( roty ) * proj[X] - sin( roty ) * proj[Z]; - yrot[Y] = proj[Y]; - yrot[Z] = sin( roty ) * proj[X] + cos( roty ) * proj[Z]; - - xrot[X] = yrot[X]; - xrot[Y] = cos( rotx ) * yrot[Y] - sin( rotx ) * yrot[Z]; - xrot[Z] = sin( rotx ) * yrot[Y] + cos( rotx ) * yrot[Z]; - - vertex->v[X] = xrot[X]; - vertex->v[Y] = xrot[Y]; - - ACC_BBOX_2V( vertex->v, tobj->mins, tobj->maxs ); - ACC_BBOX_2V( vertex->v, current->mins, current->maxs ); - } - - current->area = twice_contour_area( current ); - current->orientation = ( current->area >= 0.0 ) ? GLU_CCW : GLU_CW; - - MSG( 15, " area: %.2f orientation: %s\n", - current->area, ( current->orientation == GLU_CCW ) ? "CCW" : "CW" ); - - MSG( 15, " <-- project_current_contour( tobj:%p )\n", tobj ); -} - -/***************************************************************************** - * save_current_contour - *****************************************************************************/ -static GLenum save_current_contour( GLUtesselator *tobj ) -{ - tess_contour_t *current = tobj->current_contour; - tess_vertex_t *vertex; - GLint i; - - if ( current == NULL ) { return GLU_ERROR; } - - if ( tobj->contours == NULL ) - { - tobj->contours = tobj->last_contour = current; - current->next = current->prev = NULL; - - tobj->orientation = current->orientation; - } - else - { - current->prev = tobj->last_contour; - - tobj->last_contour->next = current; - tobj->last_contour = current; - - current->next = NULL; - } - - for ( vertex = current->vertices, i = 0; - i < current->num_vertices; vertex = vertex->next, i++ ) - { - vertex->edge_flag = GL_TRUE; - } - - current->type = GLU_UNKNOWN; - - tobj->num_contours++; - tobj->current_contour = NULL; - - return GLU_NO_ERROR; -} - -/***************************************************************************** - * inspect_current_contour - *****************************************************************************/ -static void inspect_current_contour( GLUtesselator *tobj ) -{ - tess_contour_t *current = tobj->current_contour; - GLdouble origin[3] = { 0.0, 0.0, 0.0 }; - GLboolean calc_normal = GL_FALSE; - - MSG( 15, " --> inspect_current_contour( tobj:%p )\n", tobj ); - - if ( current->num_vertices < 3 ) - { - MSG( 15, " count %d < 3, deleting\n", current->num_vertices ); - delete_contour( &tobj->current_contour ); - return; - } - - current->last_vertex->next = current->vertices; - current->vertices->prev = current->last_vertex; - - MSG( 15, " current normal: (%.2f, %.2f, %.2f)\n", current->plane.normal[X], current->plane.normal[Y], current->plane.normal[Z] ); - - if ( IS_EQUAL_3DV( current->plane.normal, origin ) ) - { - /* We haven't been given a normal, so let's take a guess. */ - if ( find_normal( tobj ) == GLU_ERROR ) { - return; - } - - COPY_3V( tobj->plane.normal, current->plane.normal ); - tobj->plane.dist = current->plane.dist; - - calc_normal = GL_TRUE; - } - - project_current_contour( tobj ); - - if ( calc_normal && ( tobj->current_contour->orientation == GLU_CW ) ) - { - MSG( 15, " oops, let's try that again...\n" ); - - /* - * FIXME: We've used a reflex angle to calculate the normal. At - * the moment, we simply reverse the normal and re-project the - * contour, but this is sloooow... - */ - NEG_3V( tobj->plane.normal ); - NEG_3V( tobj->current_contour->plane.normal ); - - project_current_contour( tobj ); - } - - if ( save_current_contour( tobj ) == GLU_ERROR ) { - return; - } - - MSG( 15, " <-- inspect_current_contour( tobj:%p )\n", tobj ); -} - -/***************************************************************************** - * reverse_contour - *****************************************************************************/ -void reverse_contour( tess_contour_t *contour ) -{ - tess_vertex_t *current = contour->vertices; - GLint i; - - for ( i = 0 ; i < contour->num_vertices ; i++ ) - { - tess_vertex_t *next = current->next; - tess_vertex_t *prev = current->prev; - - current->next = prev; - current->prev = next; - - current = next; - } - - contour->orientation = - ( contour->orientation == GLU_CCW ) ? GLU_CW : GLU_CCW; - - contour->last_vertex = contour->vertices->prev; -} - -/***************************************************************************** - * orient_contours - * - * Sum the signed areas of the contours, and orient the contours such that - * this sum is nonnegative. - *****************************************************************************/ -static void orient_contours( GLUtesselator *tobj ) -{ - tess_contour_t *contour = tobj->contours; - GLdouble sum = 0.0; - GLint i; - - MSG( 15, " --> orient_contours( tobj:%p )\n", tobj ); - - /* Sum the signed areas of all contours */ - for ( i = 0 ; i < tobj->num_contours ; i++ ) - { - sum += contour->area; - contour = contour->next; - } - - MSG( 15, " signed area: %.2f\n", sum ); - - if ( sum < -GLU_TESS_EPSILON ) - { - for ( i = 0 ; i < tobj->num_contours ; i++ ) - { - contour->area = ABSD( contour->area ); - reverse_contour( contour ); - - contour = contour->next; - } - } - else - { - for ( i = 0 ; i < tobj->num_contours ; i++ ) - { - contour->area = ABSD( contour->area ); - - contour = contour->next; - } - } - - tobj->orientation = tobj->contours->orientation; - - MSG( 15, " <-- orient_contours( tobj:%p ) orient: %s\n", - tobj, ( tobj->orientation == GLU_CCW ) ? "GLU_CCW" : "GLU_CW" ); -} - - -/***************************************************************************** - * delete_contour - * - * Delete the given contour and set the pointer to NULL. - *****************************************************************************/ -void delete_contour( tess_contour_t **contour ) -{ - tess_vertex_t *vertex, *next; - GLint i; - - if ( *contour == NULL ) { return; } - - vertex = (*contour)->vertices; - - for ( i = 0 ; i < (*contour)->num_vertices ; i++ ) - { - next = vertex->next; - free( vertex ); - vertex = next; - } - - free( *contour ); - *contour = NULL; -} - -/***************************************************************************** - * delete_all_contours - *****************************************************************************/ -static void delete_all_contours( GLUtesselator *tobj ) -{ - tess_contour_t *current, *next_contour; - GLint i; - - if ( tobj->current_contour != NULL ) { - delete_contour( &tobj->current_contour ); - } - - for ( current = tobj->contours, i = 0 ; i < tobj->num_contours ; i++ ) - { - tess_vertex_t *vertex = current->vertices, *next_vertex; - GLint j; - - for ( j = 0 ; j < current->num_vertices ; j ++ ) - { - next_vertex = vertex->next; - free( vertex ); - vertex = next_vertex; - } - next_contour = current->next; - - free( current ); - current = next_contour; - } - - tobj->num_contours = tobj->num_vertices = 0; - tobj->contours = tobj->last_contour = NULL; - - CLEAR_BBOX_2DV( tobj->mins, tobj->maxs ); -} - - -/***************************************************************************** - * tess_cleanup - *****************************************************************************/ -static void tess_cleanup( GLUtesselator *tobj ) -{ - MSG( 15, " -> tess_cleanup( tobj:%p )\n", tobj ); - - if ( tobj->current_contour != NULL ) { - delete_contour( &tobj->current_contour ); - } - if ( tobj->contours != NULL ) { - delete_all_contours( tobj ); - } - - MSG( 15, " <- tess_cleanup( tobj:%p )\n", tobj ); -} - - -/***************************************************************************** - * tess_msg - *****************************************************************************/ -INLINE void tess_msg( GLint level, char *format, ... ) -{ -#ifdef DEBUG - va_list ap; - va_start( ap, format ); - - if ( level <= tess_dbg_level ) { - vfprintf( DBG_STREAM, format, ap ); - fflush( DBG_STREAM ); - } - - va_end( ap ); -#endif -} - -INLINE void tess_info( char *file, GLint line ) -{ -#ifdef DEBUG - fprintf( DBG_STREAM, "%9.9s:%d:\t ", file, line ); -#endif -} - - - -/***************************************************************************** - * - * GLU TESSELLATION FUNCTIONS - * - *****************************************************************************/ - - -/***************************************************************************** - * gluNewTess - *****************************************************************************/ -GLUtesselator* GLAPIENTRY gluNewTess( void ) -{ - GLUtesselator *tobj; - -#ifdef DEBUG - if ( getenv( "MESA_TESS_DBG_LEVEL" ) ) { - tess_dbg_level = atoi( getenv( "MESA_TESS_DBG_LEVEL" ) ); - } else { - tess_dbg_level = DBG_LEVEL_BASE; - } +/* + * This is ugly, but seems the easiest way to do things to make the + * code work under YellowBox for Windows + */ +#if defined(OPENSTEP) && defined(CALLBACK) +#undef CALLBACK +#define CALLBACK #endif - MSG( 15, "-> gluNewTess()\n" ); - - tobj = malloc( sizeof(GLUtesselator) ); - if ( tobj == NULL ) { - return NULL; - } - - init_callbacks( &tobj->callbacks ); - - tobj->winding_rule = GLU_TESS_WINDING_ODD; - tobj->boundary_only = GL_FALSE; - tobj->tolerance = GLU_TESS_EPSILON; - tobj->orientation = GLU_UNKNOWN; - - tobj->data = NULL; - tobj->num_contours = 0; - tobj->contours = tobj->last_contour = NULL; - tobj->current_contour = NULL; +static void delete_contours(GLUtriangulatorObj *); - CLEAR_BBOX_2DV( tobj->mins, tobj->maxs ); - - tobj->num_vertices = 0; - tobj->sorted_vertices = NULL; -#if 0 - tobj->grid = NULL; +#ifdef __CYGWIN32__ +#define _CALLBACK +#else +#define _CALLBACK GLCALLBACK #endif - tobj->edge_flag = GL_FALSE; - tobj->label = 0; - - ZERO_3V( tobj->plane.normal ); - tobj->plane.dist = 0.0; - - tobj->error = GLU_NO_ERROR; - - MSG( 15, "<- gluNewTess() tobj:%p\n", tobj ); - return tobj; -} - - -/***************************************************************************** - * gluDeleteTess - *****************************************************************************/ -void GLAPIENTRY gluDeleteTess( GLUtesselator *tobj ) -{ - MSG( 15, "-> gluDeleteTess( tobj:%p )\n", tobj ); - if ( ( tobj->error == GLU_NO_ERROR ) && ( tobj->num_contours > 0 ) ) - { - /* gluEndPolygon was not called. */ - tess_error_callback( tobj, GLU_TESS_ERROR3 ); - } - /* Delete all internal structures. */ - tess_cleanup( tobj ); - free( tobj ); - - MSG( 15, "<- gluDeleteTess()\n" ); -} - - -/***************************************************************************** - * gluTessBeginPolygon - *****************************************************************************/ -void GLAPIENTRY gluTessBeginPolygon( GLUtesselator *tobj, void *polygon_data ) +static void +init_callbacks(tess_callbacks * callbacks) { - MSG( 15, "-> gluTessBeginPolygon( tobj:%p data:%p )\n", tobj, polygon_data ); - - tobj->error = GLU_NO_ERROR; - - if ( tobj->current_contour != NULL ) - { - /* gluEndPolygon was not called. */ - tess_error_callback( tobj, GLU_TESS_ERROR3 ); - tess_cleanup( tobj ); - } - - tobj->data = polygon_data; - tobj->num_vertices = 0; - tobj->edge_flag = GL_FALSE; - tobj->label = 0; - - MSG( 15, "<- gluTessBeginPolygon( tobj:%p data:%p )\n", tobj, polygon_data ); + callbacks->begin = (void (_CALLBACK *) (GLenum)) 0; + callbacks->edgeFlag = (void (_CALLBACK *) (GLboolean)) 0; + callbacks->vertex = (void (_CALLBACK *) (void *)) 0; + callbacks->end = (void (_CALLBACK *) (void)) 0; + callbacks->error = (void (_CALLBACK *) (GLenum)) 0; } - -/***************************************************************************** - * gluTessBeginContour - *****************************************************************************/ -void GLAPIENTRY gluTessBeginContour( GLUtesselator *tobj ) +void +tess_call_user_error(GLUtriangulatorObj * tobj, GLenum gluerr) { - MSG( 15, " -> gluTessBeginContour( tobj:%p )\n", tobj ); - TESS_CHECK_ERRORS( tobj ); - - if ( tobj->current_contour != NULL ) - { - /* gluTessEndContour was not called. */ - tess_error_callback( tobj, GLU_TESS_ERROR4 ); - return; - } - - tobj->current_contour = malloc( sizeof(tess_contour_t) ); - if ( tobj->current_contour == NULL ) { - tess_error_callback( tobj, GLU_OUT_OF_MEMORY ); - return; - } - - COPY_3V( tobj->current_contour->plane.normal, tobj->plane.normal ); - tobj->current_contour->plane.dist = tobj->plane.dist; - - tobj->current_contour->area = 0.0; - tobj->current_contour->orientation = GLU_UNKNOWN; - - tobj->current_contour->label = 0; - tobj->current_contour->winding = 0; - - /*tobj->current_contour->rotx = tobj->current_contour->roty = 0.0;*/ - - CLEAR_BBOX_2DV( tobj->current_contour->mins, - tobj->current_contour->maxs ); - - tobj->current_contour->num_vertices = 0; - tobj->current_contour->vertices = - tobj->current_contour->last_vertex = NULL; - - tobj->current_contour->reflex_vertices = NULL; - - cleanup: - MSG( 15, " <- gluTessBeginContour( tobj:%p )\n", tobj ); - return; + if (tobj->error == GLU_NO_ERROR) + tobj->error = gluerr; + if (tobj->callbacks.error != NULL) + (tobj->callbacks.error) (gluerr); } - -/***************************************************************************** - * gluTessVertex - *****************************************************************************/ -void GLAPIENTRY gluTessVertex( GLUtesselator *tobj, GLdouble coords[3], - void *vertex_data ) +GLUtriangulatorObj *GLAPIENTRY +gluNewTess(void) { - tess_contour_t *current = tobj->current_contour; - tess_vertex_t *last_vertex; - - MSG( 15, " -> gluTessVertex( tobj:%p coords:(%.2f,%.2f,%.2f) )\n", tobj, coords[0], coords[1], coords[2] ); - TESS_CHECK_ERRORS( tobj ); - - if ( current == NULL ) - { - /* gluTessBeginContour was not called. */ - tess_error_callback( tobj, GLU_TESS_ERROR2 ); - return; - } - - tobj->num_vertices++; - - last_vertex = current->last_vertex; - - if ( last_vertex == NULL ) - { - last_vertex = malloc( sizeof(tess_vertex_t) ); - if ( last_vertex == NULL ) { - tess_error_callback( tobj, GLU_OUT_OF_MEMORY ); - return; - } - - current->vertices = last_vertex; - current->last_vertex = last_vertex; - - last_vertex->index = -1; - last_vertex->data = vertex_data; - - last_vertex->coords[X] = coords[X]; - last_vertex->coords[Y] = coords[Y]; - last_vertex->coords[Z] = coords[Z]; - - last_vertex->v[X] = 0.0; - last_vertex->v[Y] = 0.0; - - last_vertex->edge_flag = GL_TRUE; - - last_vertex->side = 0.0; - - last_vertex->next = NULL; - last_vertex->prev = NULL; - - current->num_vertices++; - } - else - { - tess_vertex_t *vertex; - - vertex = malloc( sizeof(tess_vertex_t) ); - if ( vertex == NULL ) { - tess_error_callback( tobj, GLU_OUT_OF_MEMORY ); - return; - } - - vertex->index = -1; - vertex->data = vertex_data; - - vertex->coords[X] = coords[X]; - vertex->coords[Y] = coords[Y]; - vertex->coords[Z] = coords[Z]; - - vertex->v[X] = 0.0; - vertex->v[Y] = 0.0; - - vertex->edge_flag = GL_TRUE; - - vertex->side = 0.0; - - vertex->next = NULL; - vertex->prev = last_vertex; - - current->num_vertices++; - - last_vertex->next = vertex; - current->last_vertex = vertex; - } - - cleanup: - MSG( 15, " <- gluTessVertex( tobj:%p )\n", tobj ); - return; + GLUtriangulatorObj *tobj; + + if ((tobj = (GLUtriangulatorObj *) + malloc(sizeof(struct GLUtriangulatorObj))) == NULL) + return NULL; + tobj->contours = tobj->last_contour = NULL; + init_callbacks(&tobj->callbacks); + tobj->error = GLU_NO_ERROR; + tobj->current_polygon = NULL; + tobj->contour_cnt = 0; + return tobj; } -/***************************************************************************** - * gluTessEndContour - *****************************************************************************/ -void GLAPIENTRY gluTessEndContour( GLUtesselator *tobj ) +void GLAPIENTRY +gluTessCallback(GLUtriangulatorObj * tobj, GLenum which, + void (GLCALLBACK * fn) ()) { - MSG( 15, " -> gluTessEndContour( tobj:%p )\n", tobj ); - TESS_CHECK_ERRORS( tobj ); - - if ( tobj->current_contour == NULL ) - { - /* gluTessBeginContour was not called. */ - tess_error_callback( tobj, GLU_TESS_ERROR2 ); - return; - } - - if ( tobj->current_contour->num_vertices > 0 ) { - inspect_current_contour( tobj ); - } else { - delete_contour( &tobj->current_contour ); - } - - cleanup: - MSG( 15, " <- gluTessEndContour( tobj:%p )\n", tobj ); - return; + switch (which) { + case GLU_BEGIN: + tobj->callbacks.begin = (void (_CALLBACK *) (GLenum)) fn; + break; + case GLU_EDGE_FLAG: + tobj->callbacks.edgeFlag = (void (_CALLBACK *) (GLboolean)) fn; + break; + case GLU_VERTEX: + tobj->callbacks.vertex = (void (_CALLBACK *) (void *)) fn; + break; + case GLU_END: + tobj->callbacks.end = (void (_CALLBACK *) (void)) fn; + break; + case GLU_ERROR: + tobj->callbacks.error = (void (_CALLBACK *) (GLenum)) fn; + break; + default: + tobj->error = GLU_INVALID_ENUM; + break; + } } -/***************************************************************************** - * gluTessEndPolygon - *****************************************************************************/ -void GLAPIENTRY gluTessEndPolygon( GLUtesselator *tobj ) -{ - MSG( 15, "-> gluTessEndPolygon( tobj:%p )\n", tobj ); - TESS_CHECK_ERRORS( tobj ); - - if ( tobj->current_contour != NULL ) - { - /* gluTessBeginPolygon was not called. */ - tess_error_callback( tobj, GLU_TESS_ERROR1 ); - return; - } - TESS_CHECK_ERRORS( tobj ); - - /* - * Ensure we have at least one contour to tessellate. If we have none, - * clean up and exit gracefully. - */ - if ( tobj->num_contours == 0 ) { - tess_cleanup( tobj ); - return; - } - - /* Wrap the contour list. */ - - tobj->last_contour->next = tobj->contours; - tobj->contours->prev = tobj->last_contour; - - TESS_CHECK_ERRORS( tobj ); - - /* Orient the contours correctly */ - orient_contours( tobj ); - - /* - * Before we tessellate the contours, ensure we have the appropriate - * callbacks registered. We at least need the begin, vertex and end - * callbacks to do any meaningful work. - */ - if ( ( ( tobj->callbacks.begin != NULL ) || - ( tobj->callbacks.beginData != NULL ) ) && - ( ( tobj->callbacks.vertex != NULL ) || - ( tobj->callbacks.vertexData != NULL ) ) && - ( ( tobj->callbacks.end != NULL ) || - ( tobj->callbacks.endData != NULL ) ) ) - { - fist_tessellation( tobj ); - } - - cleanup: - delete_all_contours( tobj ); - MSG( 15, "<- gluTessEndPolygon( tobj:%p )\n", tobj ); -} - -/***************************************************************************** - * gluTessCallback - *****************************************************************************/ -void GLAPIENTRY gluTessCallback( GLUtesselator *tobj, GLenum which, - void (GLCALLBACKP fn)() ) +void GLAPIENTRY +gluDeleteTess(GLUtriangulatorObj * tobj) { - switch ( which ) - { - /* Register the begin callbacks. */ - case GLU_TESS_BEGIN: - tobj->callbacks.begin = (void (GLCALLBACKPCAST)(GLenum)) fn; - break; - case GLU_TESS_BEGIN_DATA: - tobj->callbacks.beginData = (void (GLCALLBACKPCAST)(GLenum, void *)) fn; - break; - - /* Register the edge flag callbacks. */ - case GLU_TESS_EDGE_FLAG: - tobj->callbacks.edgeFlag = (void (GLCALLBACKPCAST)(GLboolean)) fn; - break; - case GLU_TESS_EDGE_FLAG_DATA: - tobj->callbacks.edgeFlagData = (void (GLCALLBACKPCAST)(GLboolean, void *)) fn; - break; - - /* Register the vertex callbacks. */ - case GLU_TESS_VERTEX: - tobj->callbacks.vertex = (void (GLCALLBACKPCAST)(void *)) fn; - break; - case GLU_TESS_VERTEX_DATA: - tobj->callbacks.vertexData = (void (GLCALLBACKPCAST)(void *, void *)) fn; - break; - - /* Register the end callbacks. */ - case GLU_TESS_END: - tobj->callbacks.end = (void (GLCALLBACKPCAST)(void)) fn; - break; - case GLU_TESS_END_DATA: - tobj->callbacks.endData = (void (GLCALLBACKPCAST)(void *)) fn; - break; - - /* Register the error callbacks. */ - case GLU_TESS_ERROR: - tobj->callbacks.error = (void (GLCALLBACKPCAST)(GLenum)) fn; - break; - case GLU_TESS_ERROR_DATA: - tobj->callbacks.errorData = (void (GLCALLBACKPCAST)(GLenum, void *)) fn; - break; - - /* Register the combine callbacks. */ - case GLU_TESS_COMBINE: - tobj->callbacks.combine = (void (GLCALLBACKPCAST)(GLdouble[3], void *[4], GLfloat [4], void **)) fn; - break; - case GLU_TESS_COMBINE_DATA: - tobj->callbacks.combineData = (void (GLCALLBACKPCAST)(GLdouble[3], void *[4], GLfloat [4], void **, void *)) fn; - break; - - default: - MSG( 1, " gluTessCallback( tobj:%p which:%d ) invalid enum\n", tobj, which ); - tobj->error = GLU_INVALID_ENUM; - break; - } + if (tobj->error == GLU_NO_ERROR && tobj->contour_cnt) + /* was gluEndPolygon called? */ + tess_call_user_error(tobj, GLU_TESS_ERROR1); + /* delete all internal structures */ + delete_contours(tobj); + free(tobj); } -/***************************************************************************** - * gluTessProperty - * - * Set the current value of the given property. - *****************************************************************************/ -void GLAPIENTRY gluTessProperty( GLUtesselator *tobj, GLenum which, - GLdouble value ) +void GLAPIENTRY +gluBeginPolygon(GLUtriangulatorObj * tobj) { - switch ( which ) - { - case GLU_TESS_BOUNDARY_ONLY: - tobj->boundary_only = (GLboolean) value; - break; - - case GLU_TESS_TOLERANCE: - MSG( 15, " gluTessProperty( tobj:%p ) tolerance: %0.9f\n", tobj, value ); - tobj->tolerance = value; - break; - - case GLU_TESS_WINDING_RULE: - tobj->winding_rule = (GLenum) value; - break; - - default: - MSG( 1, " gluTessProperty( tobj:%p which:%d ) invalid enum\n", tobj, which ); - tobj->error = GLU_INVALID_ENUM; - break; - } +/* + if(tobj->error!=GLU_NO_ERROR) + return; +*/ + tobj->error = GLU_NO_ERROR; + if (tobj->current_polygon != NULL) { + /* gluEndPolygon was not called */ + tess_call_user_error(tobj, GLU_TESS_ERROR1); + /* delete all internal structures */ + delete_contours(tobj); + } + else { + if ((tobj->current_polygon = + (tess_polygon *) malloc(sizeof(tess_polygon))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return; + } + tobj->current_polygon->vertex_cnt = 0; + tobj->current_polygon->vertices = + tobj->current_polygon->last_vertex = NULL; + } } -/***************************************************************************** - * gluGetTessProperty - * - * Return the current value of the given property. - *****************************************************************************/ -void GLAPIENTRY gluGetTessProperty( GLUtesselator *tobj, GLenum which, - GLdouble *value ) +void GLAPIENTRY +gluEndPolygon(GLUtriangulatorObj * tobj) { - switch ( which ) - { - case GLU_TESS_BOUNDARY_ONLY: - *value = tobj->boundary_only; - break; - - case GLU_TESS_TOLERANCE: - *value = tobj->tolerance; - break; - - case GLU_TESS_WINDING_RULE: - *value = tobj->winding_rule; - break; - - default: - MSG( 1, " gluGetTessProperty( tobj:%p which:%d ) invalid enum\n", tobj, which ); - tobj->error = GLU_INVALID_ENUM; - break; - } + /*tess_contour *contour_ptr; */ + + /* there was an error */ + if (tobj->error != GLU_NO_ERROR) + goto end; + + /* check if gluBeginPolygon was called */ + if (tobj->current_polygon == NULL) { + tess_call_user_error(tobj, GLU_TESS_ERROR2); + return; + } + tess_test_polygon(tobj); + /* there was an error */ + if (tobj->error != GLU_NO_ERROR) + goto end; + + /* any real contours? */ + if (tobj->contour_cnt == 0) { + /* delete all internal structures */ + delete_contours(tobj); + return; + } + tess_find_contour_hierarchies(tobj); + /* there was an error */ + if (tobj->error != GLU_NO_ERROR) + goto end; + + tess_handle_holes(tobj); + /* there was an error */ + if (tobj->error != GLU_NO_ERROR) + goto end; + + /* if no callbacks, nothing to do */ + if (tobj->callbacks.begin != NULL && tobj->callbacks.vertex != NULL && + tobj->callbacks.end != NULL) { + if (tobj->callbacks.edgeFlag == NULL) + tess_tesselate(tobj); + else + tess_tesselate_with_edge_flag(tobj); + } + + end: + /* delete all internal structures */ + delete_contours(tobj); } -/***************************************************************************** - * gluTessNormal - * - * Set the current tessellation normal. - *****************************************************************************/ -void GLAPIENTRY gluTessNormal( GLUtesselator *tobj, GLdouble x, - GLdouble y, GLdouble z ) +void GLAPIENTRY +gluNextContour(GLUtriangulatorObj * tobj, GLenum type) { - MSG( 15, " gluTessNormal( tobj:%p n:(%.2f,%.2f,%.2f) )\n", tobj, x, y, z ); - - ASSIGN_3V( tobj->plane.normal, x, y, z ); + if (tobj->error != GLU_NO_ERROR) + return; + if (tobj->current_polygon == NULL) { + tess_call_user_error(tobj, GLU_TESS_ERROR2); + return; + } + /* first contour? */ + if (tobj->current_polygon->vertex_cnt) + tess_test_polygon(tobj); } - -/***************************************************************************** - * - * OBSOLETE TESSELLATION FUNCTIONS - * - *****************************************************************************/ - -void GLAPIENTRY gluBeginPolygon( GLUtesselator *tobj ) +void GLAPIENTRY +gluTessVertex(GLUtriangulatorObj * tobj, GLdouble v[3], void *data) { - gluTessBeginPolygon( tobj, NULL ); - gluTessBeginContour( tobj ); + tess_polygon *polygon = tobj->current_polygon; + tess_vertex *last_vertex_ptr; + + if (tobj->error != GLU_NO_ERROR) + return; + if (polygon == NULL) { + tess_call_user_error(tobj, GLU_TESS_ERROR2); + return; + } + last_vertex_ptr = polygon->last_vertex; + if (last_vertex_ptr == NULL) { + if ((last_vertex_ptr = (tess_vertex *) + malloc(sizeof(tess_vertex))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return; + } + polygon->vertices = last_vertex_ptr; + polygon->last_vertex = last_vertex_ptr; + last_vertex_ptr->data = data; + last_vertex_ptr->location[0] = v[0]; + last_vertex_ptr->location[1] = v[1]; + last_vertex_ptr->location[2] = v[2]; + last_vertex_ptr->next = NULL; + last_vertex_ptr->previous = NULL; + ++(polygon->vertex_cnt); + } + else { + tess_vertex *vertex_ptr; + + /* same point twice? */ + if (fabs(last_vertex_ptr->location[0] - v[0]) < EPSILON && + fabs(last_vertex_ptr->location[1] - v[1]) < EPSILON && + fabs(last_vertex_ptr->location[2] - v[2]) < EPSILON) { + tess_call_user_error(tobj, GLU_TESS_ERROR6); + return; + } + if ((vertex_ptr = (tess_vertex *) + malloc(sizeof(tess_vertex))) == NULL) { + tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); + return; + } + vertex_ptr->data = data; + vertex_ptr->location[0] = v[0]; + vertex_ptr->location[1] = v[1]; + vertex_ptr->location[2] = v[2]; + vertex_ptr->next = NULL; + vertex_ptr->previous = last_vertex_ptr; + ++(polygon->vertex_cnt); + last_vertex_ptr->next = vertex_ptr; + polygon->last_vertex = vertex_ptr; + } } -void GLAPIENTRY gluNextContour( GLUtesselator *tobj, GLenum type ) -{ - gluTessEndContour( tobj ); - gluTessBeginContour( tobj ); -} -void GLAPIENTRY gluEndPolygon( GLUtesselator *tobj ) +static void +delete_contours(GLUtriangulatorObj * tobj) { - gluTessEndContour( tobj ); - gluTessEndPolygon( tobj ); + tess_polygon *polygon = tobj->current_polygon; + tess_contour *contour, *contour_tmp; + tess_vertex *vertex, *vertex_tmp; + + /* remove current_polygon list - if exists due to detected error */ + if (polygon != NULL) { + if (polygon->vertices) { + for (vertex = polygon->vertices; vertex != polygon->last_vertex;) { + vertex_tmp = vertex->next; + free(vertex); + vertex = vertex_tmp; + } + free(vertex); + } + free(polygon); + tobj->current_polygon = NULL; + } + /* remove all contour data */ + for (contour = tobj->contours; contour != NULL;) { + for (vertex = contour->vertices; vertex != contour->last_vertex;) { + vertex_tmp = vertex->next; + free(vertex); + vertex = vertex_tmp; + } + free(vertex); + contour_tmp = contour->next; + free(contour); + contour = contour_tmp; + } + tobj->contours = tobj->last_contour = NULL; + tobj->contour_cnt = 0; } diff --git a/src/glu/mesa/tess.h b/src/glu/mesa/tess.h index 55681830735..ddb9b30cb20 100644 --- a/src/glu/mesa/tess.h +++ b/src/glu/mesa/tess.h @@ -1,131 +1,108 @@ -/* $Id: tess.h,v 1.16 1999/12/06 09:39:34 gareth Exp $ */ +/* $Id: tess.h,v 1.17 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul * - * Copyright (C) 1999 Brian Paul All Rights Reserved. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. * - * 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: + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. * - * 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. + * 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. */ -/***************************************************************************** - * - * GLU 1.3 Polygon Tessellation by Gareth Hughes - * - *****************************************************************************/ -#ifndef __GLU_TESS_H__ -#define __GLU_TESS_H__ +/* + * This file is part of the polygon tesselation code contributed by + * Bogdan Sikorski + */ -#include -#include -#include "gluP.h" +#ifndef TESS_H +#define TESS_H -#include "tess_typedefs.h" -#include "tess_macros.h" -#include "tess_hash.h" -#include "tess_heap.h" -#if 0 -#include "tess_grid.h" -#endif -#ifdef __cplusplus -extern "C" { -#endif +#include "gluP.h" + +#define EPSILON 1e-06 /* epsilon for double precision compares */ -/***************************************************************************** - * The GLUtesselator structure: - *****************************************************************************/ -struct GLUtesselator +typedef enum { - tess_callbacks_t callbacks; - GLenum winding_rule; - GLboolean boundary_only; - GLdouble tolerance; - GLenum orientation; - void *data; - GLint num_contours; - tess_contour_t *contours, *last_contour; - tess_contour_t *current_contour; - GLdouble mins[2], maxs[2]; - GLint num_vertices; - tess_vertex_t **sorted_vertices; -#if 0 - tess_grid_t *grid; /* Not currently used... */ -#endif - heap_t *ears; - GLboolean edge_flag; - GLuint label; - tess_plane_t plane; - GLenum error; -}; + OXY, + OYZ, + OXZ +} +projection_type; +typedef struct callbacks_str +{ + void (GLCALLBACK * begin) (GLenum mode); + void (GLCALLBACK * edgeFlag) (GLboolean flag); + void (GLCALLBACK * vertex) (GLvoid * v); + void (GLCALLBACK * end) (void); + void (GLCALLBACK * error) (GLenum err); +} +tess_callbacks; -/***************************************************************************** - * Common tessellation functions: - *****************************************************************************/ -extern void tess_error_callback( GLUtesselator *, GLenum ); +typedef struct vertex_str +{ + void *data; + GLdouble location[3]; + GLdouble x, y; + GLboolean edge_flag; + struct vertex_str *shadow_vertex; + struct vertex_str *next, *previous; +} +tess_vertex; -extern GLdouble twice_contour_area( tess_contour_t *contour ); -extern void reverse_contour( tess_contour_t *contour ); -extern void delete_contour( tess_contour_t **contour ); +typedef struct contour_str +{ + GLenum type; + GLuint vertex_cnt; + GLdouble area; + GLenum orientation; + struct vertex_str *vertices, *last_vertex; + struct contour_str *next, *previous; +} +tess_contour; -extern void contour_dump( tess_contour_t *contour ); +typedef struct polygon_str +{ + GLuint vertex_cnt; + GLdouble A, B, C, D; + GLdouble area; + GLenum orientation; + struct vertex_str *vertices, *last_vertex; +} +tess_polygon; +struct GLUtriangulatorObj +{ + tess_contour *contours, *last_contour; + GLuint contour_cnt; + tess_callbacks callbacks; + tess_polygon *current_polygon; + GLenum error; + GLdouble A, B, C, D; + projection_type projection; +}; -/***************************************************************************** - * Debugging output: - *****************************************************************************/ -#ifdef DEBUG -extern int tess_dbg_level; -#define DBG_LEVEL_BASE 1 -#define DBG_LEVEL_VERBOSE 10 -#define DBG_LEVEL_ENTEREXIT 20 +extern void tess_call_user_error(GLUtriangulatorObj *, GLenum); +extern void tess_test_polygon(GLUtriangulatorObj *); +extern void tess_find_contour_hierarchies(GLUtriangulatorObj *); +extern void tess_handle_holes(GLUtriangulatorObj *); +extern void tess_tesselate(GLUtriangulatorObj *); +extern void tess_tesselate_with_edge_flag(GLUtriangulatorObj *); -#ifdef _WIN32 -#define DBG_STREAM stdout -#else -#define DBG_STREAM stderr -#endif -#ifdef __GNUC__ -#define MSG( level, format, args... ) \ - if ( level <= tess_dbg_level ) { \ - fprintf( DBG_STREAM, "%9.9s:%d:\t ", __FILE__, __LINE__ ); \ - fprintf( DBG_STREAM, format, ## args ); \ - fflush( DBG_STREAM ); \ - } -#else -#define MSG tess_msg -#endif /* __GNUC__ */ - -#else -#define MSG tess_msg -#endif /* DEBUG */ - -extern INLINE void tess_msg( GLint level, char *format, ... ); -extern INLINE void tess_info( char *file, GLint line ); - -#ifdef __cplusplus -} #endif - -#endif /* __GLU_TESS_H__ */ diff --git a/src/glu/mesa/tesselat.c b/src/glu/mesa/tesselat.c new file mode 100644 index 00000000000..60754d7f174 --- /dev/null +++ b/src/glu/mesa/tesselat.c @@ -0,0 +1,407 @@ +/* $Id: tesselat.c,v 1.3 2000/07/11 14:11:04 brianp Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * Copyright (C) 1995-2000 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * This file is part of the polygon tesselation code contributed by + * Bogdan Sikorski + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include +#include +#include "tess.h" +#endif + + + +static GLboolean edge_flag; + +static void emit_triangle(GLUtriangulatorObj *, tess_vertex *, + tess_vertex *, tess_vertex *); + +static void emit_triangle_with_edge_flag(GLUtriangulatorObj *, + tess_vertex *, GLboolean, + tess_vertex *, GLboolean, + tess_vertex *, GLboolean); + +static GLdouble +twice_the_triangle_area(tess_vertex * va, tess_vertex * vb, tess_vertex * vc) +{ + return (vb->x - va->x) * (vc->y - va->y) - (vb->y - va->y) * (vc->x - + va->x); +} + +static GLboolean +left(GLdouble A, GLdouble B, GLdouble C, GLdouble x, GLdouble y) +{ + if (A * x + B * y + C > -EPSILON) + return GL_TRUE; + else + return GL_FALSE; +} + +static GLboolean +right(GLdouble A, GLdouble B, GLdouble C, GLdouble x, GLdouble y) +{ + if (A * x + B * y + C < EPSILON) + return GL_TRUE; + else + return GL_FALSE; +} + +static GLint +convex_ccw(tess_vertex * va, + tess_vertex * vb, tess_vertex * vc, GLUtriangulatorObj * tobj) +{ + GLdouble d; + + d = twice_the_triangle_area(va, vb, vc); + + if (d > EPSILON) { + return 1; + } + else if (d < -EPSILON) { + return 0; + } + else { + return -1; + } +} + +static GLint +convex_cw(tess_vertex * va, + tess_vertex * vb, tess_vertex * vc, GLUtriangulatorObj * tobj) +{ + GLdouble d; + + d = twice_the_triangle_area(va, vb, vc); + + if (d < -EPSILON) { + return 1; + } + else if (d > EPSILON) { + return 0; + } + else { + return -1; + } +} + +static GLboolean +diagonal_ccw(tess_vertex * va, + tess_vertex * vb, + GLUtriangulatorObj * tobj, tess_contour * contour) +{ + tess_vertex *vc = va->next, *vertex, *shadow_vertex; + struct + { + GLdouble A, B, C; + } + ac, cb, ba; + GLdouble x, y; + + GLint res = convex_ccw(va, vc, vb, tobj); + if (res == 0) + return GL_FALSE; + if (res == -1) + return GL_TRUE; + + ba.A = vb->y - va->y; + ba.B = va->x - vb->x; + ba.C = -ba.A * va->x - ba.B * va->y; + ac.A = va->y - vc->y; + ac.B = vc->x - va->x; + ac.C = -ac.A * vc->x - ac.B * vc->y; + cb.A = vc->y - vb->y; + cb.B = vb->x - vc->x; + cb.C = -cb.A * vb->x - cb.B * vb->y; + for (vertex = vb->next; vertex != va; vertex = vertex->next) { + shadow_vertex = vertex->shadow_vertex; + if (shadow_vertex != NULL && + (shadow_vertex == va || shadow_vertex == vb || shadow_vertex == vc)) + continue; + x = vertex->x; + y = vertex->y; + if (left(ba.A, ba.B, ba.C, x, y) && + left(ac.A, ac.B, ac.C, x, y) && left(cb.A, cb.B, cb.C, x, y)) + return GL_FALSE; + } + return GL_TRUE; +} + +static GLboolean +diagonal_cw(tess_vertex * va, + tess_vertex * vb, + GLUtriangulatorObj * tobj, tess_contour * contour) +{ + tess_vertex *vc = va->next, *vertex, *shadow_vertex; + struct + { + GLdouble A, B, C; + } + ac, cb, ba; + GLdouble x, y; + + GLint res = convex_cw(va, vc, vb, tobj); + if (res == 0) + return GL_FALSE; + if (res == -1) + return GL_TRUE; + + ba.A = vb->y - va->y; + ba.B = va->x - vb->x; + ba.C = -ba.A * va->x - ba.B * va->y; + ac.A = va->y - vc->y; + ac.B = vc->x - va->x; + ac.C = -ac.A * vc->x - ac.B * vc->y; + cb.A = vc->y - vb->y; + cb.B = vb->x - vc->x; + cb.C = -cb.A * vb->x - cb.B * vb->y; + for (vertex = vb->next; vertex != va; vertex = vertex->next) { + shadow_vertex = vertex->shadow_vertex; + if (shadow_vertex != NULL && + (shadow_vertex == va || shadow_vertex == vb || shadow_vertex == vc)) + continue; + x = vertex->x; + y = vertex->y; + if (right(ba.A, ba.B, ba.C, x, y) && + right(ac.A, ac.B, ac.C, x, y) && right(cb.A, cb.B, cb.C, x, y)) + return GL_FALSE; + } + return GL_TRUE; +} + +static void +clip_ear(GLUtriangulatorObj * tobj, tess_vertex * v, tess_contour * contour) +{ + emit_triangle(tobj, v->previous, v, v->next); + /* the first in the list */ + if (contour->vertices == v) { + contour->vertices = v->next; + contour->last_vertex->next = v->next; + v->next->previous = contour->last_vertex; + } + else + /* the last ? */ + if (contour->last_vertex == v) { + contour->vertices->previous = v->previous; + v->previous->next = v->next; + contour->last_vertex = v->previous; + } + else { + v->next->previous = v->previous; + v->previous->next = v->next; + } + free(v); + --(contour->vertex_cnt); +} + +static void +clip_ear_with_edge_flag(GLUtriangulatorObj * tobj, + tess_vertex * v, tess_contour * contour) +{ + emit_triangle_with_edge_flag(tobj, v->previous, v->previous->edge_flag, + v, v->edge_flag, v->next, GL_FALSE); + v->previous->edge_flag = GL_FALSE; + /* the first in the list */ + if (contour->vertices == v) { + contour->vertices = v->next; + contour->last_vertex->next = v->next; + v->next->previous = contour->last_vertex; + } + else + /* the last ? */ + if (contour->last_vertex == v) { + contour->vertices->previous = v->previous; + v->previous->next = v->next; + contour->last_vertex = v->previous; + } + else { + v->next->previous = v->previous; + v->previous->next = v->next; + } + free(v); + --(contour->vertex_cnt); +} + +static void +triangulate_ccw(GLUtriangulatorObj * tobj, tess_contour * contour) +{ + tess_vertex *vertex; + GLuint vertex_cnt = contour->vertex_cnt; + + while (vertex_cnt > 3) { + vertex = contour->vertices; + while (diagonal_ccw(vertex, vertex->next->next, tobj, contour) == + GL_FALSE && tobj->error == GLU_NO_ERROR) + vertex = vertex->next; + if (tobj->error != GLU_NO_ERROR) + return; + clip_ear(tobj, vertex->next, contour); + --vertex_cnt; + } +} + +static void +triangulate_cw(GLUtriangulatorObj * tobj, tess_contour * contour) +{ + tess_vertex *vertex; + GLuint vertex_cnt = contour->vertex_cnt; + + while (vertex_cnt > 3) { + vertex = contour->vertices; + while (diagonal_cw(vertex, vertex->next->next, tobj, contour) == + GL_FALSE && tobj->error == GLU_NO_ERROR) + vertex = vertex->next; + if (tobj->error != GLU_NO_ERROR) + return; + clip_ear(tobj, vertex->next, contour); + --vertex_cnt; + } +} + +static void +triangulate_ccw_with_edge_flag(GLUtriangulatorObj * tobj, + tess_contour * contour) +{ + tess_vertex *vertex; + GLuint vertex_cnt = contour->vertex_cnt; + + while (vertex_cnt > 3) { + vertex = contour->vertices; + while (diagonal_ccw(vertex, vertex->next->next, tobj, contour) == + GL_FALSE && tobj->error == GLU_NO_ERROR) + vertex = vertex->next; + if (tobj->error != GLU_NO_ERROR) + return; + clip_ear_with_edge_flag(tobj, vertex->next, contour); + --vertex_cnt; + } +} + +static void +triangulate_cw_with_edge_flag(GLUtriangulatorObj * tobj, + tess_contour * contour) +{ + tess_vertex *vertex; + GLuint vertex_cnt = contour->vertex_cnt; + + while (vertex_cnt > 3) { + vertex = contour->vertices; + while (diagonal_cw(vertex, vertex->next->next, tobj, contour) == + GL_FALSE && tobj->error == GLU_NO_ERROR) + vertex = vertex->next; + if (tobj->error != GLU_NO_ERROR) + return; + clip_ear_with_edge_flag(tobj, vertex->next, contour); + --vertex_cnt; + } +} + +void +tess_tesselate(GLUtriangulatorObj * tobj) +{ + tess_contour *contour; + + for (contour = tobj->contours; contour != NULL; contour = contour->next) { + if (contour->orientation == GLU_CCW) { + triangulate_ccw(tobj, contour); + } + else { + triangulate_cw(tobj, contour); + } + if (tobj->error != GLU_NO_ERROR) + return; + + /* emit the last triangle */ + emit_triangle(tobj, contour->vertices, contour->vertices->next, + contour->vertices->next->next); + } +} + +void +tess_tesselate_with_edge_flag(GLUtriangulatorObj * tobj) +{ + tess_contour *contour; + + edge_flag = GL_TRUE; + /* first callback with edgeFlag set to GL_TRUE */ + (tobj->callbacks.edgeFlag) (GL_TRUE); + + for (contour = tobj->contours; contour != NULL; contour = contour->next) { + if (contour->orientation == GLU_CCW) + triangulate_ccw_with_edge_flag(tobj, contour); + else + triangulate_cw_with_edge_flag(tobj, contour); + if (tobj->error != GLU_NO_ERROR) + return; + /* emit the last triangle */ + emit_triangle_with_edge_flag(tobj, contour->vertices, + contour->vertices->edge_flag, + contour->vertices->next, + contour->vertices->next->edge_flag, + contour->vertices->next->next, + contour->vertices->next->next->edge_flag); + } +} + +static void +emit_triangle(GLUtriangulatorObj * tobj, + tess_vertex * v1, tess_vertex * v2, tess_vertex * v3) +{ + (tobj->callbacks.begin) (GL_TRIANGLES); + (tobj->callbacks.vertex) (v1->data); + (tobj->callbacks.vertex) (v2->data); + (tobj->callbacks.vertex) (v3->data); + (tobj->callbacks.end) (); +} + +static void +emit_triangle_with_edge_flag(GLUtriangulatorObj * tobj, + tess_vertex * v1, + GLboolean edge_flag1, + tess_vertex * v2, + GLboolean edge_flag2, + tess_vertex * v3, GLboolean edge_flag3) +{ + (tobj->callbacks.begin) (GL_TRIANGLES); + if (edge_flag1 != edge_flag) { + edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE); + (tobj->callbacks.edgeFlag) (edge_flag); + } + (tobj->callbacks.vertex) (v1->data); + if (edge_flag2 != edge_flag) { + edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE); + (tobj->callbacks.edgeFlag) (edge_flag); + } + (tobj->callbacks.vertex) (v2->data); + if (edge_flag3 != edge_flag) { + edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE); + (tobj->callbacks.edgeFlag) (edge_flag); + } + (tobj->callbacks.vertex) (v3->data); + (tobj->callbacks.end) (); +} -- cgit v1.2.3 From 4bb651306c322f7be075a863684c205d8319a362 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 13 Jul 2000 17:45:13 +0000 Subject: replaced GL_CLIENT_ALL_ATTRIB_BITS with GL_ALL_CLIENT_ATTRIB_BITS --- include/GL/gl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 8e9ce07bd57..f0c9810ba78 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.43 2000/05/24 15:04:01 brianp Exp $ */ +/* $Id: gl.h,v 1.44 2000/07/13 17:45:13 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -851,7 +851,7 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 #define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 -#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF +#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF -- cgit v1.2.3 From 974e468e6d7773cd99d0299bf1616260a68a7386 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 31 Jul 2000 15:27:11 +0000 Subject: install glext.h too --- include/GL/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/Makefile.am b/include/GL/Makefile.am index 16b4913e470..58aded1d538 100644 --- a/include/GL/Makefile.am +++ b/include/GL/Makefile.am @@ -29,6 +29,6 @@ endif EXTRA_DIST = fxmesa.h ggimesa.h osmesa.h svgamesa.h \ glx.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h -GLinclude_HEADERS = gl.h gl_mangle.h glu.h glu_mangle.h \ +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) -- cgit v1.2.3 From b5b5c52034840dbfcd3f76a9e7cde8b379e7d517 Mon Sep 17 00:00:00 2001 From: Jouk Jansen Date: Tue, 22 Aug 2000 13:31:00 +0000 Subject: Committing in . Modified Files: Mesa/include/GL/glx.h Mesa/include/GL/xmesa.h Mesa/src/descrip.mms Mesa/src/X/glxheader.h Mesa/src/X/xfonts.c Mesa/src/X/xfonts.h Mesa/src-glu/descrip.mms Mesa/src-glut/capturexfont.c Mesa/src-glut/descrip.mms Mesa/src-glut/glut_cmap.c Mesa/src-glut/glut_event.c Mesa/src-glut/glut_fullscrn.c Mesa/src-glut/glut_gamemode.c Mesa/src-glut/glut_init.c Mesa/src-glut/glut_input.c Mesa/src-glut/glut_menu.c Mesa/src-glut/glut_menu2.c Mesa/src-glut/glut_overlay.c Mesa/src-glut/glut_win.c Mesa/src-glut/glut_winmisc.c Mesa/src-glut/glutint.h Mesa/src-glut/layerutil.h Mesa/vms/analyze_map.com Added Files: Mesa/include/GL/vms_x_fix.h Patches effective on VMS only. This allows for compiling with /name=(as_is,short). This breaks the binary compatibility with previous versions for VMS, but is the only way to combine Mesa with GTK for VMS. Jouk ---------------------------------------------------------------------- --- include/GL/glx.h | 3 ++- include/GL/vms_x_fix.h | 43 ++++++++++++++++++++++++++++++++++++++++ include/GL/xmesa.h | 6 ++++-- src/glu/mesa/descrip.mms | 2 +- src/glut/glx/capturexfont.c | 4 ++++ src/glut/glx/descrip.mms | 2 +- src/glut/glx/glut_cmap.c | 4 ++++ src/glut/glx/glut_event.c | 4 ++++ src/glut/glx/glut_fullscrn.c | 4 ++++ src/glut/glx/glut_gamemode.c | 4 ++++ src/glut/glx/glut_init.c | 4 ++++ src/glut/glx/glut_input.c | 4 ++++ src/glut/glx/glut_menu.c | 4 ++++ src/glut/glx/glut_menu2.c | 4 ++++ src/glut/glx/glut_overlay.c | 4 ++++ src/glut/glx/glut_win.c | 4 ++++ src/glut/glx/glut_winmisc.c | 4 ++++ src/glut/glx/glutint.h | 4 ++++ src/glut/glx/layerutil.h | 4 ++++ src/mesa/drivers/x11/glxheader.h | 5 ++++- src/mesa/drivers/x11/xfonts.c | 5 ++++- src/mesa/drivers/x11/xfonts.h | 5 ++++- src/mesa/main/descrip.mms | 8 ++++---- 23 files changed, 123 insertions(+), 12 deletions(-) create mode 100644 include/GL/vms_x_fix.h (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index c2ae5d35b95..9082c3dcd10 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.22 2000/06/23 17:39:18 brianp Exp $ */ +/* $Id: glx.h,v 1.23 2000/08/22 13:31:00 joukj Exp $ */ /* * Mesa 3-D graphics library @@ -30,6 +30,7 @@ #ifdef __VMS +#include # ifdef __cplusplus /* VMS Xlib.h gives problems with C++. * this avoids a bunch of trivial warnings */ diff --git a/include/GL/vms_x_fix.h b/include/GL/vms_x_fix.h new file mode 100644 index 00000000000..6e4fb6806b9 --- /dev/null +++ b/include/GL/vms_x_fix.h @@ -0,0 +1,43 @@ +/*************************************************************************** + * * + * Repair definitions of Xlib when compileing with /name=(as_is) on VMS * + * You'll need the PORTING_LIBRARY (get it from Compaq) installed * + * * + * Author : Jouk Jansen (joukj@hrem.stm.tudelft.nl) * + * * + * Last revision : 22 August 2000 * + * * + ***************************************************************************/ + +#ifndef VMS_X_FIX +#define VMS_X_FIX + +#ifdef __cplusplus +#define VMS_BEGIN_C_PLUS_PLUS extern "C" { +#define VMS_END_C_PLUS_PLUS } +#else +#define VMS_BEGIN_C_PLUS_PLUS +#define VMS_END_C_PLUS_PLUS +#endif + +#include + +#define XQueryFont XQUERYFONT +#define XSetPlaneMask XSETPLANEMASK +#define XChangeKeyboardControl XCHANGEKEYBOARDCONTROL +#define XDestroySubwindows XDESTROYSUBWINDOWS +#define XFreeDeviceList XFREEDEVICELIST +#define XFreeDeviceState XFREEDEVICESTATE +#define XGetExtensionVersion XGETEXTENSIONVERSION +#define XGetRGBColormaps XGETRGBCOLORMAPS +#define XIconifyWindow XICONIFYWINDOW +#define XInstallColormap XINSTALLCOLORMAP +#define XListInputDevices XLISTINPUTDEVICES +#define XLookupKeysym XLOOKUPKEYSYM +#define XOpenDevice XOPENDEVICE +#define XQueryDeviceState XQUERYDEVICESTATE +#define XSelectExtensionEvent XSELECTEXTENSIONEVENT +#define XWarpPointer XWARPPOINTER +#define XmuLookupStandardColormap XMULOOKUPSTANDARDCOLORMAP + +#endif diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index 0c50b48c7cd..273b83508c7 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -1,4 +1,4 @@ -/* $Id: xmesa.h,v 1.8 2000/05/02 02:30:01 brianp Exp $ */ +/* $Id: xmesa.h,v 1.9 2000/08/22 13:31:01 joukj Exp $ */ /* * Mesa 3-D graphics library @@ -67,12 +67,14 @@ See the demos/xdemo.c and xmesa1.c files for examples. #ifndef XMESA_H #define XMESA_H +#ifdef __VMS +#include +#endif #ifdef __cplusplus extern "C" { #endif - #ifdef XFree86Server #include "xmesa_xf86.h" #else diff --git a/src/glu/mesa/descrip.mms b/src/glu/mesa/descrip.mms index 5f5334c7419..16a1e615362 100644 --- a/src/glu/mesa/descrip.mms +++ b/src/glu/mesa/descrip.mms @@ -12,7 +12,7 @@ VPATH = RCS INCDIR = $disk2:[-.include] LIBDIR = [-.lib] -CFLAGS = /include=$(INCDIR)/define=(FBIND=1) +CFLAGS = /include=$(INCDIR)/define=(FBIND=1)/name=(as_is,short) SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \ polytest.c project.c quadric.c tess.c tesselat.c diff --git a/src/glut/glx/capturexfont.c b/src/glut/glx/capturexfont.c index 3bed13c9beb..b99e7930564 100644 --- a/src/glut/glx/capturexfont.c +++ b/src/glut/glx/capturexfont.c @@ -10,6 +10,10 @@ encoding the font for GLUT's use. Example usage: capturexfont.c 9x15 glutBitmap9By15 > glut_9x15.c */ +#ifdef __VMS +#include +#endif + #include #include #include diff --git a/src/glut/glx/descrip.mms b/src/glut/glx/descrip.mms index e6aeb8352e6..5d59c42db48 100644 --- a/src/glut/glx/descrip.mms +++ b/src/glut/glx/descrip.mms @@ -14,7 +14,7 @@ VPATH = RCS INCDIR = [-.include] LIBDIR = [-.lib] -CFLAGS = /nowarn/include=$(INCDIR)/prefix=all +CFLAGS = /nowarn/include=$(INCDIR)/prefix=all/name=(as_is,short) SOURCES = \ glut_8x13.c \ diff --git a/src/glut/glx/glut_cmap.c b/src/glut/glx/glut_cmap.c index a9d004003f6..1c496ad66da 100644 --- a/src/glut/glx/glut_cmap.c +++ b/src/glut/glx/glut_cmap.c @@ -5,6 +5,10 @@ and is provided without guarantee or warrantee expressed or implied. This program is -not- in the public domain. */ +#ifdef __VMS +#include +#endif + #include #include #include /* SunOS multithreaded assert() needs . Lame. */ diff --git a/src/glut/glx/glut_event.c b/src/glut/glx/glut_event.c index 6d928af2ea3..f4463dee0b6 100644 --- a/src/glut/glx/glut_event.c +++ b/src/glut/glx/glut_event.c @@ -5,6 +5,10 @@ and is provided without guarantee or warrantee expressed or implied. This program is -not- in the public domain. */ +#ifdef __VMS +#include +#endif + #include #include #include diff --git a/src/glut/glx/glut_fullscrn.c b/src/glut/glx/glut_fullscrn.c index 8d58f1743c9..0f1ea10b1be 100644 --- a/src/glut/glx/glut_fullscrn.c +++ b/src/glut/glx/glut_fullscrn.c @@ -5,6 +5,10 @@ and is provided without guarantee or warrantee expressed or implied. This program is -not- in the public domain. */ +#ifdef __VMS +#include +#endif + #include /* SunOS multithreaded assert() needs . Lame. */ #include diff --git a/src/glut/glx/glut_gamemode.c b/src/glut/glx/glut_gamemode.c index b685ce33e2a..004f325a061 100644 --- a/src/glut/glx/glut_gamemode.c +++ b/src/glut/glx/glut_gamemode.c @@ -5,6 +5,10 @@ and is provided without guarantee or warrantee expressed or implied. This program is -not- in the public domain. */ +#ifdef __VMS +#include +#endif + #include #include #include diff --git a/src/glut/glx/glut_init.c b/src/glut/glx/glut_init.c index b9d2fde3f34..d4d0e8a9783 100644 --- a/src/glut/glx/glut_init.c +++ b/src/glut/glx/glut_init.c @@ -5,6 +5,10 @@ and is provided without guarantee or warrantee expressed or implied. This program is -not- in the public domain. */ +#ifdef __VMS +#include +#endif + #include #include #include diff --git a/src/glut/glx/glut_input.c b/src/glut/glx/glut_input.c index bc93d5e5151..d012c5ee16a 100644 --- a/src/glut/glx/glut_input.c +++ b/src/glut/glx/glut_input.c @@ -5,6 +5,10 @@ and is provided without guarantee or warrantee expressed or implied. This program is -not- in the public domain. */ +#ifdef __VMS +#include +#endif + #include #include #include diff --git a/src/glut/glx/glut_menu.c b/src/glut/glx/glut_menu.c index 2af3482afc0..0c36d348f46 100644 --- a/src/glut/glx/glut_menu.c +++ b/src/glut/glx/glut_menu.c @@ -9,6 +9,10 @@ the menuing functionality implemented. This file is used only by the X Window System version of GLUT. */ +#ifdef __VMS +#include +#endif + #include #include #include diff --git a/src/glut/glx/glut_menu2.c b/src/glut/glx/glut_menu2.c index 93119b540e3..d02cee4ac15 100644 --- a/src/glut/glx/glut_menu2.c +++ b/src/glut/glx/glut_menu2.c @@ -12,6 +12,10 @@ the menuing functionality implemented. This file is used only by the X Window System version of GLUT. */ +#ifdef __VMS +#include +#endif + #include #include #include diff --git a/src/glut/glx/glut_overlay.c b/src/glut/glx/glut_overlay.c index 13ece12a159..cc3c8ced641 100644 --- a/src/glut/glx/glut_overlay.c +++ b/src/glut/glx/glut_overlay.c @@ -5,6 +5,10 @@ and is provided without guarantee or warrantee expressed or implied. This program is -not- in the public domain. */ +#ifdef __VMS +#include +#endif + #include #include #include diff --git a/src/glut/glx/glut_win.c b/src/glut/glx/glut_win.c index 883bacb0871..934144f633e 100644 --- a/src/glut/glx/glut_win.c +++ b/src/glut/glx/glut_win.c @@ -5,6 +5,10 @@ and is provided without guarantee or warrantee expressed or implied. This program is -not- in the public domain. */ +#ifdef __VMS +#include +#endif + #include #include #include diff --git a/src/glut/glx/glut_winmisc.c b/src/glut/glx/glut_winmisc.c index 5a9d199a56e..60d5a073a89 100644 --- a/src/glut/glx/glut_winmisc.c +++ b/src/glut/glx/glut_winmisc.c @@ -5,6 +5,10 @@ and is provided without guarantee or warrantee expressed or implied. This program is -not- in the public domain. */ +#ifdef __VMS +#include +#endif + #include #include #include diff --git a/src/glut/glx/glutint.h b/src/glut/glx/glutint.h index 71dceeceeee..f54ca0bd164 100644 --- a/src/glut/glx/glutint.h +++ b/src/glut/glx/glutint.h @@ -7,6 +7,10 @@ and is provided without guarantee or warrantee expressed or implied. This program is -not- in the public domain. */ +#ifdef __VMS +#include +#endif + #if defined(__CYGWIN32__) #include #endif diff --git a/src/glut/glx/layerutil.h b/src/glut/glx/layerutil.h index 34610774090..8f580afe3b7 100644 --- a/src/glut/glx/layerutil.h +++ b/src/glut/glx/layerutil.h @@ -9,6 +9,10 @@ /* Based on XLayerUtil.h: Revision: 1.3 */ +#ifdef __VMS +#include +#endif + #if !defined(_WIN32) #include #include diff --git a/src/mesa/drivers/x11/glxheader.h b/src/mesa/drivers/x11/glxheader.h index 28e53659f00..99a6400aad4 100644 --- a/src/mesa/drivers/x11/glxheader.h +++ b/src/mesa/drivers/x11/glxheader.h @@ -1,4 +1,4 @@ -/* $Id: glxheader.h,v 1.1 1999/11/11 01:29:28 brianp Exp $ */ +/* $Id: glxheader.h,v 1.2 2000/08/22 13:31:04 joukj Exp $ */ /* * Mesa 3-D graphics library @@ -28,6 +28,9 @@ #ifndef GLX_HEADER_H #define GLX_HEADER_H +#ifdef __VMS +#include +#endif #ifdef HAVE_CONFIG_H #include "conf.h" diff --git a/src/mesa/drivers/x11/xfonts.c b/src/mesa/drivers/x11/xfonts.c index 27b877dbabe..e0f457a354f 100644 --- a/src/mesa/drivers/x11/xfonts.c +++ b/src/mesa/drivers/x11/xfonts.c @@ -1,4 +1,4 @@ -/* $Id: xfonts.c,v 1.8 2000/08/13 03:57:21 brianp Exp $ */ +/* $Id: xfonts.c,v 1.9 2000/08/22 13:31:04 joukj Exp $ */ /* * Mesa 3-D graphics library @@ -29,6 +29,9 @@ * Copyright (C) 1995 Thorsten.Ohl @ Physik.TH-Darmstadt.de */ +#ifdef __VMS +#include +#endif #ifdef HAVE_CONFIG_H #include "conf.h" diff --git a/src/mesa/drivers/x11/xfonts.h b/src/mesa/drivers/x11/xfonts.h index 9cbe11f7bb2..712c9d4c321 100644 --- a/src/mesa/drivers/x11/xfonts.h +++ b/src/mesa/drivers/x11/xfonts.h @@ -1,4 +1,4 @@ -/* $Id: xfonts.h,v 1.1 2000/04/19 01:44:02 brianp Exp $ */ +/* $Id: xfonts.h,v 1.2 2000/08/22 13:31:04 joukj Exp $ */ /* * Mesa 3-D graphics library @@ -28,6 +28,9 @@ #ifndef XFONTS_H #define XFONTS_H +#ifdef __VMS +#include +#endif #include diff --git a/src/mesa/main/descrip.mms b/src/mesa/main/descrip.mms index 78c3b434808..e532df4c528 100644 --- a/src/mesa/main/descrip.mms +++ b/src/mesa/main/descrip.mms @@ -1,6 +1,6 @@ # Makefile for core library for VMS # contributed by Jouk Jansen joukj@crys.chem.uva.nl -# Last revision : 3 May 1999 +# Last revision : 22 August 2000 .first define gl [-.include.gl] @@ -13,11 +13,11 @@ VPATH = RCS INCDIR = [-.include] LIBDIR = [-.lib] -CFLAGS = /include=($(INCDIR),[])/define=(FBIND=1) +CFLAGS = /include=($(INCDIR),[])/define=(FBIND=1)/name=(as_is,short) 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 \ +dispatch.c convolve.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 \ @@ -51,7 +51,7 @@ 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 +pixeltex.obj,convolve.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 -- cgit v1.2.3 From 2bf5d9470d3232763cb49b5589209940d4d5398d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 8 Sep 2000 16:41:38 +0000 Subject: added OSMesaCreateContextExt() --- include/GL/osmesa.h | 58 ++++++++++++++++++++++++-------------- src/mesa/drivers/osmesa/osmesa.c | 60 ++++++++++++++++++++++++++++++++-------- 2 files changed, 86 insertions(+), 32 deletions(-) (limited to 'include') diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h index 9746d74f919..4af2c69c4e3 100644 --- a/include/GL/osmesa.h +++ b/include/GL/osmesa.h @@ -1,8 +1,8 @@ -/* $Id: osmesa.h,v 1.5 2000/03/28 16:59:39 rjfrank Exp $ */ +/* $Id: osmesa.h,v 1.6 2000/09/08 16:41:38 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.3 + * Version: 3.5 * * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. * @@ -59,11 +59,11 @@ extern "C" { #endif -#include "GL/gl.h" +#include #define OSMESA_MAJOR_VERSION 3 -#define OSMESA_MINOR_VERSION 3 +#define OSMESA_MINOR_VERSION 5 @@ -114,18 +114,31 @@ typedef struct osmesa_context *OSMesaContext; * display lists. NULL indicates no sharing. * Return: an OSMesaContext or 0 if error */ -GLAPI OSMesaContext GLAPIENTRY OSMesaCreateContext( GLenum format, - OSMesaContext sharelist ); +GLAPI OSMesaContext GLAPIENTRY +OSMesaCreateContext( GLenum format, OSMesaContext sharelist ); +/* + * Create an Off-Screen Mesa rendering context and specify desired + * size of depth buffer, stencil buffer and accumulation buffer. + * If you specify zero for depthBits, stencilBits, accumBits you + * can save some memory. + * + * New in Mesa 3.5 + */ +GLAPI OSMesaContext GLAPIENTRY +OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, + GLint accumBits, OSMesaContext sharelist); + /* * Destroy an Off-Screen Mesa rendering context. * * Input: ctx - the context to destroy */ -GLAPI void GLAPIENTRY OSMesaDestroyContext( OSMesaContext ctx ); +GLAPI void GLAPIENTRY +OSMesaDestroyContext( OSMesaContext ctx ); @@ -156,9 +169,9 @@ GLAPI void GLAPIENTRY OSMesaDestroyContext( OSMesaContext ctx ); * invalid buffer address, type!=GL_UNSIGNED_BYTE, width<1, height<1, * width>internal limit or height>internal limit. */ -GLAPI GLboolean GLAPIENTRY OSMesaMakeCurrent( OSMesaContext ctx, - void *buffer, GLenum type, - GLsizei width, GLsizei height ); +GLAPI GLboolean GLAPIENTRY +OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type, + GLsizei width, GLsizei height ); @@ -166,7 +179,8 @@ GLAPI GLboolean GLAPIENTRY OSMesaMakeCurrent( OSMesaContext ctx, /* * Return the current Off-Screen Mesa rendering context handle. */ -GLAPI OSMesaContext GLAPIENTRY OSMesaGetCurrentContext( void ); +GLAPI OSMesaContext GLAPIENTRY +OSMesaGetCurrentContext( void ); @@ -183,7 +197,8 @@ GLAPI OSMesaContext GLAPIENTRY OSMesaGetCurrentContext( void ); * * New in version 2.0. */ -GLAPI void GLAPIENTRY OSMesaPixelStore( GLint pname, GLint value ); +GLAPI void GLAPIENTRY +OSMesaPixelStore( GLint pname, GLint value ); @@ -198,7 +213,8 @@ GLAPI void GLAPIENTRY OSMesaPixelStore( GLint pname, GLint value ); * OSMESA_Y_UP returns 1 or 0 to indicate Y axis direction * value - pointer to integer in which to return result. */ -GLAPI void GLAPIENTRY OSMesaGetIntegerv( GLint pname, GLint *value ); +GLAPI void GLAPIENTRY +OSMesaGetIntegerv( GLint pname, GLint *value ); @@ -212,10 +228,10 @@ GLAPI void GLAPIENTRY OSMesaGetIntegerv( GLint pname, GLint *value ); * * New in Mesa 2.4. */ -GLAPI GLboolean GLAPIENTRY OSMesaGetDepthBuffer( OSMesaContext c, - GLint *width, GLint *height, - GLint *bytesPerValue, - void **buffer ); +GLAPI GLboolean GLAPIENTRY +OSMesaGetDepthBuffer( OSMesaContext c, GLint *width, GLint *height, + GLint *bytesPerValue, void **buffer ); + /* @@ -228,10 +244,10 @@ GLAPI GLboolean GLAPIENTRY OSMesaGetDepthBuffer( OSMesaContext c, * * New in Mesa 3.3. */ -GLAPI GLboolean GLAPIENTRY OSMesaGetColorBuffer( OSMesaContext c, - GLint *width, GLint *height, - GLint *format, - void **buffer ); +GLAPI GLboolean GLAPIENTRY +OSMesaGetColorBuffer( OSMesaContext c, GLint *width, GLint *height, + GLint *format, void **buffer ); + #if defined(__BEOS__) || defined(__QUICKDRAW__) diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 56059607118..7f79a1f272e 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1,4 +1,4 @@ -/* $Id: osmesa.c,v 1.19 2000/06/27 21:42:14 brianp Exp $ */ +/* $Id: osmesa.c,v 1.20 2000/09/08 16:41:39 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -99,11 +99,26 @@ static void osmesa_update_state( GLcontext *ctx ); */ OSMesaContext GLAPIENTRY OSMesaCreateContext( GLenum format, OSMesaContext sharelist ) +{ + return OSMesaCreateContextExt(format, DEFAULT_SOFTWARE_DEPTH_BITS, + 8, 16, sharelist); +} + + + +/* + * New in Mesa 3.5 + * + * Create context and specify size of ancillary buffers. + */ +OSMesaContext GLAPIENTRY +OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, + GLint accumBits, OSMesaContext sharelist ) { OSMesaContext osmesa; GLint rshift, gshift, bshift, ashift; GLint rind, gind, bind; - GLint indexBits, alphaBits; + GLint indexBits, redBits, greenBits, blueBits, alphaBits; GLboolean rgbmode; GLboolean swalpha; GLuint i4 = 1; @@ -119,6 +134,9 @@ OSMesaCreateContext( GLenum format, OSMesaContext sharelist ) } else if (format==OSMESA_RGBA) { indexBits = 0; + redBits = 8; + greenBits = 8; + blueBits = 8; alphaBits = 8; if (little_endian) { rshift = 0; @@ -136,6 +154,9 @@ OSMesaCreateContext( GLenum format, OSMesaContext sharelist ) } else if (format==OSMESA_BGRA) { indexBits = 0; + redBits = 8; + greenBits = 8; + blueBits = 8; alphaBits = 8; if (little_endian) { ashift = 0; @@ -153,6 +174,9 @@ OSMesaCreateContext( GLenum format, OSMesaContext sharelist ) } else if (format==OSMESA_ARGB) { indexBits = 0; + redBits = 8; + greenBits = 8; + blueBits = 8; alphaBits = 8; if (little_endian) { bshift = 0; @@ -170,6 +194,9 @@ OSMesaCreateContext( GLenum format, OSMesaContext sharelist ) } else if (format==OSMESA_RGB) { indexBits = 0; + redBits = 8; + greenBits = 8; + blueBits = 8; alphaBits = 0; bshift = 0; gshift = 8; @@ -183,6 +210,9 @@ OSMesaCreateContext( GLenum format, OSMesaContext sharelist ) } else if (format==OSMESA_BGR) { indexBits = 0; + redBits = 8; + greenBits = 8; + blueBits = 8; alphaBits = 0; bshift = 0; gshift = 8; @@ -201,15 +231,22 @@ OSMesaCreateContext( GLenum format, OSMesaContext sharelist ) osmesa = (OSMesaContext) CALLOC_STRUCT(osmesa_context); if (osmesa) { - osmesa->gl_visual = gl_create_visual( rgbmode, - swalpha, /* software alpha */ - GL_FALSE, /* double buffer */ - GL_FALSE, /* stereo */ - DEFAULT_SOFTWARE_DEPTH_BITS, - STENCIL_BITS, - rgbmode ? ACCUM_BITS : 0, - indexBits, - 8, 8, 8, alphaBits ); + osmesa->gl_visual = _mesa_create_visual( rgbmode, + GL_FALSE, /* double buffer */ + GL_FALSE, /* stereo */ + redBits, + greenBits, + blueBits, + alphaBits, + indexBits, + depthBits, + stencilBits, + accumBits, + accumBits, + accumBits, + alphaBits ? accumBits : 0, + 1 /* num samples */ + ); if (!osmesa->gl_visual) { FREE(osmesa); return NULL; @@ -262,6 +299,7 @@ OSMesaCreateContext( GLenum format, OSMesaContext sharelist ) + /* * Destroy an Off-Screen Mesa rendering context. * -- cgit v1.2.3 From 98b3dd40f7969ace61654a5b57366db923502dcb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 15 Sep 2000 19:45:00 +0000 Subject: Added GL_MESA_trace extension (Loki) --- include/GL/gl.h | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index f0c9810ba78..bdb40a254ab 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.44 2000/07/13 17:45:13 brianp Exp $ */ +/* $Id: gl.h,v 1.45 2000/09/15 19:45:00 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2236,6 +2236,36 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); +/* + * ???. GL_MESA_trace + * XXX this should go into glext.h at some point + */ +#ifndef GL_MESA_trace +#define GL_MESA_trace 1 + +#define GL_TRACE_ALL_BIT_MESA 0x0001 +#define GL_TRACE_OPERATIONS_BIT_MESA 0x0002 +#define GL_TRACE_PRIMITIVES_BIT_MESA 0x0004 +#define GL_TRACE_ARRAYS_BIT_MESA 0x0008 +#define GL_TRACE_TEXTURES_BIT_MESA 0x0010 +#define GL_TRACE_PIXELS_BIT_MESA 0x0020 + +GLAPI void GLAPIENTRY glEnableTrace( GLbitfield mask ); +GLAPI void GLAPIENTRY glDisableTrace( GLbitfield mask ); +GLAPI void GLAPIENTRY glNewTrace( GLbitfield mask, GLubyte * traceName ); +GLAPI void GLAPIENTRY glEndTrace( void ); +GLAPI void GLAPIENTRY glTraceAssertAttrib( GLbitfield attribMask ); +GLAPI void GLAPIENTRY glTraceComment( const GLubyte * comment ); +GLAPI void GLAPIENTRY glTraceTexture( GLuint name, const GLubyte* comment ); +GLAPI void GLAPIENTRY glTraceList( GLuint name, const GLubyte* comment ); +GLAPI void GLAPIENTRY glTracePointer( GLvoid* pointer, const GLubyte* comment ); +GLAPI void GLAPIENTRY glTracePointerRange( const GLvoid* first, const GLvoid* last, const GLubyte* comment ); + +#endif /* GL_MESA_trace */ + + + + /********************************************************************** * Begin system-specific stuff */ -- cgit v1.2.3 From 7ceffd0e0d52da8b0396b795e7e1395a7a8e3424 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 26 Oct 2000 15:32:54 +0000 Subject: fixed value for GLU_NURBS_MODE --- include/GL/glu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index e2b92882768..c0ed06414ab 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,8 +1,8 @@ -/* $Id: glu.h,v 1.22 2000/07/11 14:11:44 brianp Exp $ */ +/* $Id: glu.h,v 1.23 2000/10/26 15:32:54 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.3 + * Version: 3.5 * Copyright (C) 1995-2000 Brian Paul * * This library is free software; you can redistribute it and/or @@ -200,7 +200,7 @@ extern "C" { #define GLU_NURBS_ERROR37 100287 /* duplicate point on pwlcurve */ /* GLU 1.3 and later */ -#define GLU_NURBS_MODE ? +#define GLU_NURBS_MODE 100160 /* Errors */ -- cgit v1.2.3 From 44bd53f2599b5045133a185091fbf9d8c7696905 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 3 Nov 2000 15:01:38 +0000 Subject: added GL_MESA_packed_depth_stencil extension --- include/GL/gl.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index bdb40a254ab..ce8821266d4 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,8 +1,8 @@ -/* $Id: gl.h,v 1.45 2000/09/15 19:45:00 brianp Exp $ */ +/* $Id: gl.h,v 1.46 2000/11/03 15:01:38 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.3 + * Version: 3.5 * * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. * @@ -2264,6 +2264,21 @@ GLAPI void GLAPIENTRY glTracePointerRange( const GLvoid* first, const GLvoid* la #endif /* GL_MESA_trace */ +/* + * ???. GL_MESA_packed_depth_stencil + * XXX this will be in glext.h someday + */ +#ifndef GL_MESA_packed_depth_stencil +#define GL_MESA_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_MESA 0x8750 +#define GL_UNSIGNED_INT_24_8_MESA 0x8751 +#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752 +#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753 +#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754 + +#endif /* GL_MESA_packed_depth_stencil */ + /********************************************************************** -- cgit v1.2.3 From a190221f70000a4be97a1a3f81fc125f88d3e7cb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 3 Nov 2000 15:14:18 +0000 Subject: update to GL_MESA_trace extension enums --- include/GL/gl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index ce8821266d4..00feace6354 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.46 2000/11/03 15:01:38 brianp Exp $ */ +/* $Id: gl.h,v 1.47 2000/11/03 15:14:18 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2249,6 +2249,8 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); #define GL_TRACE_ARRAYS_BIT_MESA 0x0008 #define GL_TRACE_TEXTURES_BIT_MESA 0x0010 #define GL_TRACE_PIXELS_BIT_MESA 0x0020 +#define GL_TRACE_MASK_MESA 0x8755 +#define GL_TRACE_NAME_MESA 0x8756 GLAPI void GLAPIENTRY glEnableTrace( GLbitfield mask ); GLAPI void GLAPIENTRY glDisableTrace( GLbitfield mask ); -- cgit v1.2.3 From 9e83e8c790d8b612a7256c630f6ff7e063faaccb Mon Sep 17 00:00:00 2001 From: Jouk Jansen Date: Fri, 17 Nov 2000 11:00:55 +0000 Subject: Committing in . Patches to compile Mesa on VMS. -Updated for new directory tree -Now compile with PTHREADS on The patch in glthread.h is temporarily. The include file src/types.h conflicts with the system defined types.h. In future the mesa supplied one should be renamed. Modified Files: Mesa/include/GL/vms_x_fix.h Mesa/src/descrip.mms Mesa/src/glthread.h Mesa/src/mms_depend ---------------------------------------------------------------------- --- include/GL/vms_x_fix.h | 859 +++++++++++++++++++++++++++++++++++++++++++++- src/mesa/glapi/glthread.h | 11 +- src/mesa/main/descrip.mms | 307 ++++++++++++++--- 3 files changed, 1114 insertions(+), 63 deletions(-) (limited to 'include') diff --git a/include/GL/vms_x_fix.h b/include/GL/vms_x_fix.h index 6e4fb6806b9..db754f65563 100644 --- a/include/GL/vms_x_fix.h +++ b/include/GL/vms_x_fix.h @@ -1,7 +1,6 @@ /*************************************************************************** * * * Repair definitions of Xlib when compileing with /name=(as_is) on VMS * - * You'll need the PORTING_LIBRARY (get it from Compaq) installed * * * * Author : Jouk Jansen (joukj@hrem.stm.tudelft.nl) * * * @@ -12,16 +11,623 @@ #ifndef VMS_X_FIX #define VMS_X_FIX -#ifdef __cplusplus -#define VMS_BEGIN_C_PLUS_PLUS extern "C" { -#define VMS_END_C_PLUS_PLUS } -#else -#define VMS_BEGIN_C_PLUS_PLUS -#define VMS_END_C_PLUS_PLUS -#endif - -#include - +#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE +#define XAllocClassHint XALLOCCLASSHINT +#define XAllocColor XALLOCCOLOR +#define XAllocColorCells XALLOCCOLORCELLS +#define XAllocSizeHints XALLOCSIZEHINTS +#define XAllocWMHints XALLOCWMHINTS +#define XAutoRepeatOff XAUTOREPEATOFF +#define XAutoRepeatOn XAUTOREPEATON +#define XBaseFontNameListOfFontSet XBASEFONTNAMELISTOFFONTSET +#define XBell XBELL +#define XBitmapPad XBITMAPPAD +#define XChangeActivePointerGrab XCHANGEACTIVEPOINTERGRAB +#define XChangeGC XCHANGEGC +#define XChangeProperty XCHANGEPROPERTY +#define XChangeWindowAttributes XCHANGEWINDOWATTRIBUTES +#define XCheckIfEvent XCHECKIFEVENT +#define XCheckMaskEvent XCHECKMASKEVENT +#define XCheckTypedWindowEvent XCHECKTYPEDWINDOWEVENT +#define XCheckWindowEvent XCHECKWINDOWEVENT +#define XClearArea XCLEARAREA +#define XClearWindow XCLEARWINDOW +#define XClipBox XCLIPBOX +#define XCloseDisplay XCLOSEDISPLAY +#define XCloseIM XCLOSEIM +#define XConfigureWindow XCONFIGUREWINDOW +#define XConvertSelection XCONVERTSELECTION +#define XCopyArea XCOPYAREA +#define XCopyGC XCOPYGC +#define XCopyPlane XCOPYPLANE +#define XCreateBitmapFromData XCREATEBITMAPFROMDATA +#define XCreateColormap XCREATECOLORMAP +#define XCreateFontCursor XCREATEFONTCURSOR +#define XCreateFontSet XCREATEFONTSET +#define XCreateGC XCREATEGC +#define XCreateIC XCREATEIC +#define XCreateImage XCREATEIMAGE +#define XCreatePixmap XCREATEPIXMAP +#define XCreatePixmapCursor XCREATEPIXMAPCURSOR +#define XCreatePixmapFromBitmapData XCREATEPIXMAPFROMBITMAPDATA +#define XCreateRegion XCREATEREGION +#define XCreateSimpleWindow XCREATESIMPLEWINDOW +#define XCreateWindow XCREATEWINDOW +#define XDefaultScreenOfDisplay XDEFAULTSCREENOFDISPLAY +#define XDefineCursor XDEFINECURSOR +#define XDeleteProperty XDELETEPROPERTY +#define XDestroyIC XDESTROYIC +#define XDestroyRegion XDESTROYREGION +#define XDestroyWindow XDESTROYWINDOW +#define XDisplayName XDISPLAYNAME +#define XDisplayOfScreen XDISPLAYOFSCREEN +#define XDrawArc XDRAWARC +#define XDrawImageString XDRAWIMAGESTRING +#define XDrawImageString16 XDRAWIMAGESTRING16 +#define XDrawLine XDRAWLINE +#define XDrawLines XDRAWLINES +#define XDrawPoint XDRAWPOINT +#define XDrawPoints XDRAWPOINTS +#define XDrawRectangle XDRAWRECTANGLE +#define XDrawSegments XDRAWSEGMENTS +#define XDrawString XDRAWSTRING +#define XDrawString16 XDRAWSTRING16 +#define XEmptyRegion XEMPTYREGION +#define XEqualRegion XEQUALREGION +#define XEventsQueued XEVENTSQUEUED +#define XExtentsOfFontSet XEXTENTSOFFONTSET +#define XFillArc XFILLARC +#define XFillPolygon XFILLPOLYGON +#define XFillRectangle XFILLRECTANGLE +#define XFillRectangles XFILLRECTANGLES +#define XFilterEvent XFILTEREVENT +#define XFlush XFLUSH +#define XFontsOfFontSet XFONTSOFFONTSET +#define XFree XFREE +#define XFreeColormap XFREECOLORMAP +#define XFreeColors XFREECOLORS +#define XFreeCursor XFREECURSOR +#define XFreeFont XFREEFONT +#define XFreeFontInfo XFREEFONTINFO +#define XFreeFontNames XFREEFONTNAMES +#define XFreeFontSet XFREEFONTSET +#define XFreeGC XFREEGC +#define XFreeModifiermap XFREEMODIFIERMAP +#define XFreePixmap XFREEPIXMAP +#define XFreeStringList XFREESTRINGLIST +#define XGetAtomName XGETATOMNAME +#define XGetDefault XGETDEFAULT +#define XGetErrorDatabaseText XGETERRORDATABASETEXT +#define XGetErrorText XGETERRORTEXT +#define XGetFontProperty XGETFONTPROPERTY +#define XGetGCValues XGETGCVALUES +#define XGetGeometry XGETGEOMETRY +#define XGetICValues XGETICVALUES +#define XGetIMValues XGETIMVALUES +#define XGetImage XGETIMAGE +#define XGetKeyboardControl XGETKEYBOARDCONTROL +#define XGetModifierMapping XGETMODIFIERMAPPING +#define XGetMotionEvents XGETMOTIONEVENTS +#define XGetNormalHints XGETNORMALHINTS +#define XGetSelectionOwner XGETSELECTIONOWNER +#define XGetSubImage XGETSUBIMAGE +#define XGetVisualInfo XGETVISUALINFO +#define XGetWMColormapWindows XGETWMCOLORMAPWINDOWS +#define XGetWMHints XGETWMHINTS +#define XGetWMName XGETWMNAME +#define XGetWMNormalHints XGETWMNORMALHINTS +#define XGetWindowAttributes XGETWINDOWATTRIBUTES +#define XGetWindowProperty XGETWINDOWPROPERTY +#define XGrabKeyboard XGRABKEYBOARD +#define XGrabPointer XGRABPOINTER +#define XGrabServer XGRABSERVER +#define XHeightOfScreen XHEIGHTOFSCREEN +#define XIfEvent XIFEVENT +#define XInternAtom XINTERNATOM +#define XIntersectRegion XINTERSECTREGION +#define XKeycodeToKeysym XKEYCODETOKEYSYM +#define XKeysymToKeycode XKEYSYMTOKEYCODE +#define XKeysymToString XKEYSYMTOSTRING +#define XListFonts XLISTFONTS +#define XListFontsWithInfo XLISTFONTSWITHINFO +#define XListPixmapFormats XLISTPIXMAPFORMATS +#define XListProperties XLISTPROPERTIES +#define XLoadQueryFont XLOADQUERYFONT +#define XLookupString XLOOKUPSTRING +#define XLowerWindow XLOWERWINDOW +#define XMapRaised XMAPRAISED +#define XMapWindow XMAPWINDOW +#define XMatchVisualInfo XMATCHVISUALINFO +#define XMoveResizeWindow XMOVERESIZEWINDOW +#define XMoveWindow XMOVEWINDOW +#define XNextEvent XNEXTEVENT +#define XOffsetRegion XOFFSETREGION +#define XOpenDisplay XOPENDISPLAY +#define XOpenIM XOPENIM +#define XParseColor XPARSECOLOR +#define XParseGeometry XPARSEGEOMETRY +#define XPeekEvent XPEEKEVENT +#define XPending XPENDING +#define XPointInRegion XPOINTINREGION +#define XPolygonRegion XPOLYGONREGION +#define XPutBackEvent XPUTBACKEVENT +#define XPutImage XPUTIMAGE +#define XQueryColor XQUERYCOLOR +#define XQueryColors XQUERYCOLORS +#define XQueryExtension XQUERYEXTENSION +#define XQueryPointer XQUERYPOINTER +#define XQueryTree XQUERYTREE +#define XRaiseWindow XRAISEWINDOW +#define XReconfigureWMWindow XRECONFIGUREWMWINDOW +#define XRectInRegion XRECTINREGION +#define XRefreshKeyboardMapping XREFRESHKEYBOARDMAPPING +#define XReparentWindow XREPARENTWINDOW +#define XResizeWindow XRESIZEWINDOW +#define XRestackWindows XRESTACKWINDOWS +#define XRootWindowOfScreen XROOTWINDOWOFSCREEN +#define XScreenNumberOfScreen XSCREENNUMBEROFSCREEN +#define XSelectAsyncEvent XSELECTASYNCEVENT +#define XSelectAsyncInput XSELECTASYNCINPUT +#define XSelectInput XSELECTINPUT +#define XSendEvent XSENDEVENT +#define XServerVendor XSERVERVENDOR +#define XSetBackground XSETBACKGROUND +#define XSetClassHint XSETCLASSHINT +#define XSetClipMask XSETCLIPMASK +#define XSetClipOrigin XSETCLIPORIGIN +#define XSetClipRectangles XSETCLIPRECTANGLES +#define XSetCloseDownMode XSETCLOSEDOWNMODE +#define XSetCommand XSETCOMMAND +#define XSetDashes XSETDASHES +#define XSetErrorHandler XSETERRORHANDLER +#define XSetFillStyle XSETFILLSTYLE +#define XSetFont XSETFONT +#define XSetForeground XSETFOREGROUND +#define XSetFunction XSETFUNCTION +#define XSetGraphicsExposures XSETGRAPHICSEXPOSURES +#define XSetICFocus XSETICFOCUS +#define XSetICValues XSETICVALUES +#define XSetIOErrorHandler XSETIOERRORHANDLER +#define XSetInputFocus XSETINPUTFOCUS +#define XSetLineAttributes XSETLINEATTRIBUTES +#define XSetLocaleModifiers XSETLOCALEMODIFIERS +#define XSetNormalHints XSETNORMALHINTS +#define XSetRegion XSETREGION +#define XSetSelectionOwner XSETSELECTIONOWNER +#define XSetStipple XSETSTIPPLE +#define XSetSubwindowMode XSETSUBWINDOWMODE +#define XSetTSOrigin XSETTSORIGIN +#define XSetTile XSETTILE +#define XSetTransientForHint XSETTRANSIENTFORHINT +#define XSetWMColormapWindows XSETWMCOLORMAPWINDOWS +#define XSetWMHints XSETWMHINTS +#define XSetWMIconName XSETWMICONNAME +#define XSetWMName XSETWMNAME +#define XSetWMNormalHints XSETWMNORMALHINTS +#define XSetWMProperties XSETWMPROPERTIES +#define XSetWMProtocols XSETWMPROTOCOLS +#define XSetWindowBackground XSETWINDOWBACKGROUND +#define XSetWindowBackgroundPixmap XSETWINDOWBACKGROUNDPIXMAP +#define XSetWindowColormap XSETWINDOWCOLORMAP +#define XShapeCombineMask XSHAPECOMBINEMASK +#define XShapeCombineRectangles XSHAPECOMBINERECTANGLES +#define XShapeGetRectangles XSHAPEGETRECTANGLES +#define XShrinkRegion XSHRINKREGION +#define XStoreColor XSTORECOLOR +#define XStoreColors XSTORECOLORS +#define XStoreName XSTORENAME +#define XStringToKeysym XSTRINGTOKEYSYM +#define XSubtractRegion XSUBTRACTREGION +#define XSupportsLocale XSUPPORTSLOCALE +#define XSync XSYNC +#define XSynchronize XSYNCHRONIZE +#define XTextExtents XTEXTEXTENTS +#define XTextExtents16 XTEXTEXTENTS16 +#define XTextWidth XTEXTWIDTH +#define XTextWidth16 XTEXTWIDTH16 +#define XTranslateCoordinates XTRANSLATECOORDINATES +#define XUndefineCursor XUNDEFINECURSOR +#define XUngrabKeyboard XUNGRABKEYBOARD +#define XUngrabPointer XUNGRABPOINTER +#define XUngrabServer XUNGRABSERVER +#define XUnionRectWithRegion XUNIONRECTWITHREGION +#define XUnionRegion XUNIONREGION +#define XUnmapWindow XUNMAPWINDOW +#define _XUnregisterFilter _XUNREGISTERFILTER +#define XUnsetICFocus XUNSETICFOCUS +#define XVaCreateNestedList XVACREATENESTEDLIST +#define XVisualIDFromVisual XVISUALIDFROMVISUAL +#define XWidthOfScreen XWIDTHOFSCREEN +#define XWindowEvent XWINDOWEVENT +#define XWithdrawWindow XWITHDRAWWINDOW +#define XXorRegion XXORREGION +#define XmAddProtocolCallback XMADDPROTOCOLCALLBACK +#define XmAddProtocols XMADDPROTOCOLS +#define XmChangeColor XMCHANGECOLOR +#define XmClipboardCopy XMCLIPBOARDCOPY +#define XmClipboardEndCopy XMCLIPBOARDENDCOPY +#define XmClipboardInquireLength XMCLIPBOARDINQUIRELENGTH +#define XmClipboardLock XMCLIPBOARDLOCK +#define XmClipboardRetrieve XMCLIPBOARDRETRIEVE +#define XmClipboardStartCopy XMCLIPBOARDSTARTCOPY +#define XmClipboardUnlock XMCLIPBOARDUNLOCK +#define XmCreateArrowButton XMCREATEARROWBUTTON +#define XmCreateArrowButtonGadget XMCREATEARROWBUTTONGADGET +#define XmCreateCascadeButton XMCREATECASCADEBUTTON +#define XmCreateDialogShell XMCREATEDIALOGSHELL +#define XmCreateDragIcon XMCREATEDRAGICON +#define XmCreateDrawingArea XMCREATEDRAWINGAREA +#define XmCreateDrawnButton XMCREATEDRAWNBUTTON +#define XmCreateFileSelectionBox XMCREATEFILESELECTIONBOX +#define XmCreateFileSelectionDialog XMCREATEFILESELECTIONDIALOG +#define XmCreateForm XMCREATEFORM +#define XmCreateFormDialog XMCREATEFORMDIALOG +#define XmCreateFrame XMCREATEFRAME +#define XmCreateInformationDialog XMCREATEINFORMATIONDIALOG +#define XmCreateLabelGadget XMCREATELABELGADGET +#define XmCreateMainWindow XMCREATEMAINWINDOW +#define XmCreateMenuBar XMCREATEMENUBAR +#define XmCreateMessageBox XMCREATEMESSAGEBOX +#define XmCreateMessageDialog XMCREATEMESSAGEDIALOG +#define XmCreateOptionMenu XMCREATEOPTIONMENU +#define XmCreatePanedWindow XMCREATEPANEDWINDOW +#define XmCreatePopupMenu XMCREATEPOPUPMENU +#define XmCreatePromptDialog XMCREATEPROMPTDIALOG +#define XmCreatePulldownMenu XMCREATEPULLDOWNMENU +#define XmCreatePushButton XMCREATEPUSHBUTTON +#define XmCreatePushButtonGadget XMCREATEPUSHBUTTONGADGET +#define XmCreateQuestionDialog XMCREATEQUESTIONDIALOG +#define XmCreateRadioBox XMCREATERADIOBOX +#define XmCreateRowColumn XMCREATEROWCOLUMN +#define XmCreateScale XMCREATESCALE +#define XmCreateScrollBar XMCREATESCROLLBAR +#define XmCreateScrolledList XMCREATESCROLLEDLIST +#define XmCreateScrolledText XMCREATESCROLLEDTEXT +#define XmCreateScrolledWindow XMCREATESCROLLEDWINDOW +#define XmCreateSelectionDialog XMCREATESELECTIONDIALOG +#define XmCreateSeparator XMCREATESEPARATOR +#define XmCreateSeparatorGadget XMCREATESEPARATORGADGET +#define XmCreateTemplateDialog XMCREATETEMPLATEDIALOG +#define XmCreateText XMCREATETEXT +#define XmCreateTextField XMCREATETEXTFIELD +#define XmCreateToggleButton XMCREATETOGGLEBUTTON +#define XmCreateToggleButtonGadget XMCREATETOGGLEBUTTONGADGET +#define XmDragStart XMDRAGSTART +#define XmDropSiteRegister XMDROPSITEREGISTER +#define XmDropSiteUnregister XMDROPSITEUNREGISTER +#define XmDropSiteUpdate XMDROPSITEUPDATE +#define XmDropTransferStart XMDROPTRANSFERSTART +#define XmFileSelectionBoxGetChild XMFILESELECTIONBOXGETCHILD +#define XmFileSelectionDoSearch XMFILESELECTIONDOSEARCH +#define XmFontListAppendEntry XMFONTLISTAPPENDENTRY +#define XmFontListCopy XMFONTLISTCOPY +#define XmFontListCreate XMFONTLISTCREATE +#define XmFontListEntryCreate XMFONTLISTENTRYCREATE +#define XmFontListEntryFree XMFONTLISTENTRYFREE +#define XmFontListEntryGetFont XMFONTLISTENTRYGETFONT +#define XmFontListEntryGetTag XMFONTLISTENTRYGETTAG +#define XmFontListEntryLoad XMFONTLISTENTRYLOAD +#define XmFontListFree XMFONTLISTFREE +#define XmFontListFreeFontContext XMFONTLISTFREEFONTCONTEXT +#define XmFontListGetNextFont XMFONTLISTGETNEXTFONT +#define XmFontListInitFontContext XMFONTLISTINITFONTCONTEXT +#define XmFontListNextEntry XMFONTLISTNEXTENTRY +#define XmGetColors XMGETCOLORS +#define XmGetFocusWidget XMGETFOCUSWIDGET +#define XmGetMenuCursor XMGETMENUCURSOR +#define XmGetPixmapByDepth XMGETPIXMAPBYDEPTH +#define XmGetTearOffControl XMGETTEAROFFCONTROL +#define XmGetXmDisplay XMGETXMDISPLAY +#define XmImMbLookupString XMIMMBLOOKUPSTRING +#define XmImRegister XMIMREGISTER +#define XmImSetFocusValues XMIMSETFOCUSVALUES +#define XmImSetValues XMIMSETVALUES +#define XmImUnregister XMIMUNREGISTER +#define XmImUnsetFocus XMIMUNSETFOCUS +#define XmInternAtom XMINTERNATOM +#define XmIsMotifWMRunning XMISMOTIFWMRUNNING +#define XmListAddItem XMLISTADDITEM +#define XmListAddItemUnselected XMLISTADDITEMUNSELECTED +#define XmListAddItemsUnselected XMLISTADDITEMSUNSELECTED +#define XmListDeleteAllItems XMLISTDELETEALLITEMS +#define XmListDeleteItemsPos XMLISTDELETEITEMSPOS +#define XmListDeletePos XMLISTDELETEPOS +#define XmListDeselectAllItems XMLISTDESELECTALLITEMS +#define XmListDeselectPos XMLISTDESELECTPOS +#define XmListGetKbdItemPos XMLISTGETKBDITEMPOS +#define XmListGetMatchPos XMLISTGETMATCHPOS +#define XmListGetSelectedPos XMLISTGETSELECTEDPOS +#define XmListPosSelected XMLISTPOSSELECTED +#define XmListSelectItem XMLISTSELECTITEM +#define XmListSelectPos XMLISTSELECTPOS +#define XmListSetBottomPos XMLISTSETBOTTOMPOS +#define XmListSetItem XMLISTSETITEM +#define XmListSetKbdItemPos XMLISTSETKBDITEMPOS +#define XmListSetPos XMLISTSETPOS +#define XmMainWindowSetAreas XMMAINWINDOWSETAREAS +#define XmMenuPosition XMMENUPOSITION +#define XmMessageBoxGetChild XMMESSAGEBOXGETCHILD +#define XmOptionButtonGadget XMOPTIONBUTTONGADGET +#define XmOptionLabelGadget XMOPTIONLABELGADGET +#define XmProcessTraversal XMPROCESSTRAVERSAL +#define XmQmotif XMQMOTIF +#define XmRemoveProtocolCallback XMREMOVEPROTOCOLCALLBACK +#define XmRepTypeGetId XMREPTYPEGETID +#define XmRepTypeGetRecord XMREPTYPEGETRECORD +#define XmRepTypeRegister XMREPTYPEREGISTER +#define XmRepTypeValidValue XMREPTYPEVALIDVALUE +#define XmScrollBarSetValues XMSCROLLBARSETVALUES +#define XmScrolledWindowSetAreas XMSCROLLEDWINDOWSETAREAS +#define XmSelectionBoxGetChild XMSELECTIONBOXGETCHILD +#define XmStringByteCompare XMSTRINGBYTECOMPARE +#define XmStringCompare XMSTRINGCOMPARE +#define XmStringConcat XMSTRINGCONCAT +#define XmStringCopy XMSTRINGCOPY +#define XmStringCreate XMSTRINGCREATE +#define XmStringCreateLocalized XMSTRINGCREATELOCALIZED +#define XmStringCreateLtoR XMSTRINGCREATELTOR +#define XmStringCreateSimple XMSTRINGCREATESIMPLE +#define XmStringDraw XMSTRINGDRAW +#define XmStringDrawUnderline XMSTRINGDRAWUNDERLINE +#define XmStringExtent XMSTRINGEXTENT +#define XmStringFree XMSTRINGFREE +#define XmStringFreeContext XMSTRINGFREECONTEXT +#define XmStringGetLtoR XMSTRINGGETLTOR +#define XmStringGetNextComponent XMSTRINGGETNEXTCOMPONENT +#define XmStringGetNextSegment XMSTRINGGETNEXTSEGMENT +#define XmStringInitContext XMSTRINGINITCONTEXT +#define XmStringLength XMSTRINGLENGTH +#define XmStringLtoRCreate XMSTRINGLTORCREATE +#define XmStringNConcat XMSTRINGNCONCAT +#define XmStringSegmentCreate XMSTRINGSEGMENTCREATE +#define XmStringWidth XMSTRINGWIDTH +#define XmTextClearSelection XMTEXTCLEARSELECTION +#define XmTextFieldGetEditable XMTEXTFIELDGETEDITABLE +#define XmTextFieldGetInsertionPosition XMTEXTFIELDGETINSERTIONPOSITION +#define XmTextFieldGetLastPosition XMTEXTFIELDGETLASTPOSITION +#define XmTextFieldGetSelection XMTEXTFIELDGETSELECTION +#define XmTextFieldGetString XMTEXTFIELDGETSTRING +#define XmTextFieldInsert XMTEXTFIELDINSERT +#define XmTextFieldRemove XMTEXTFIELDREMOVE +#define XmTextFieldSetSelection XMTEXTFIELDSETSELECTION +#define XmTextFieldSetString XMTEXTFIELDSETSTRING +#define XmTextGetCursorPosition XMTEXTGETCURSORPOSITION +#define XmTextGetInsertionPosition XMTEXTGETINSERTIONPOSITION +#define XmTextGetLastPosition XMTEXTGETLASTPOSITION +#define XmTextGetMaxLength XMTEXTGETMAXLENGTH +#define XmTextGetSelection XMTEXTGETSELECTION +#define XmTextGetSelectionPosition XMTEXTGETSELECTIONPOSITION +#define XmTextGetString XMTEXTGETSTRING +#define XmTextInsert XMTEXTINSERT +#define XmTextRemove XMTEXTREMOVE +#define XmTextReplace XMTEXTREPLACE +#define XmTextSetCursorPosition XMTEXTSETCURSORPOSITION +#define XmTextSetHighlight XMTEXTSETHIGHLIGHT +#define XmTextSetInsertionPosition XMTEXTSETINSERTIONPOSITION +#define XmTextSetSelection XMTEXTSETSELECTION +#define XmTextSetString XMTEXTSETSTRING +#define XmToggleButtonGadgetGetState XMTOGGLEBUTTONGADGETGETSTATE +#define XmToggleButtonGadgetSetState XMTOGGLEBUTTONGADGETSETSTATE +#define XmToggleButtonGetState XMTOGGLEBUTTONGETSTATE +#define XmToggleButtonSetState XMTOGGLEBUTTONSETSTATE +#define XmUpdateDisplay XMUPDATEDISPLAY +#define XmVaCreateSimpleRadioBox XMVACREATESIMPLERADIOBOX +#define XmbDrawString XMBDRAWSTRING +#define XmbLookupString XMBLOOKUPSTRING +#define XmbResetIC XMBRESETIC +#define XmbSetWMProperties XMBSETWMPROPERTIES +#define XmbTextEscapement XMBTEXTESCAPEMENT +#define XmbTextExtents XMBTEXTEXTENTS +#define XmbTextListToTextProperty XMBTEXTLISTTOTEXTPROPERTY +#define XmbTextPropertyToTextList XMBTEXTPROPERTYTOTEXTLIST +#define XmuClientWindow XMUCLIENTWINDOW +#define XmuPrintDefaultErrorMessage XMUPRINTDEFAULTERRORMESSAGE +#define XrmGetDatabase XRMGETDATABASE +#define XrmGetResource XRMGETRESOURCE +#define XrmPutStringResource XRMPUTSTRINGRESOURCE +#define XrmQuarkToString XRMQUARKTOSTRING +#define XrmStringToQuark XRMSTRINGTOQUARK +#define XtAddCallback XTADDCALLBACK +#define XtAddCallbacks XTADDCALLBACKS +#define XtAddEventHandler XTADDEVENTHANDLER +#define XtAddGrab XTADDGRAB +#define XtAllocateGC XTALLOCATEGC +#define XtAppAddActions XTAPPADDACTIONS +#define XtAppAddInput XTAPPADDINPUT +#define XtAppAddTimeOut XTAPPADDTIMEOUT +#define XtAppCreateShell XTAPPCREATESHELL +#define XtAppInitialize XTAPPINITIALIZE +#define XtAppNextEvent XTAPPNEXTEVENT +#define XtAppPeekEvent XTAPPPEEKEVENT +#define XtAppPending XTAPPPENDING +#define XtAppProcessEvent XTAPPPROCESSEVENT +#define XtAppSetErrorHandler XTAPPSETERRORHANDLER +#define XtAppSetFallbackResources XTAPPSETFALLBACKRESOURCES +#define XtAppSetWarningHandler XTAPPSETWARNINGHANDLER +#define XtAppSetWarningMsgHandler XTAPPSETWARNINGMSGHANDLER +#define XtAppWarning XTAPPWARNING +#define XtCallActionProc XTCALLACTIONPROC +#define XtCallCallbackList XTCALLCALLBACKLIST +#define XtCallCallbacks XTCALLCALLBACKS +#define XtConfigureWidget XTCONFIGUREWIDGET +#define XtConvertAndStore XTCONVERTANDSTORE +#define XtCreateApplicationContext XTCREATEAPPLICATIONCONTEXT +#define XtCreateManagedWidget XTCREATEMANAGEDWIDGET +#define XtCreatePopupShell XTCREATEPOPUPSHELL +#define XtCreateWidget XTCREATEWIDGET +#define XtDatabase XTDATABASE +#define XtDestroyWidget XTDESTROYWIDGET +#define XtDisownSelection XTDISOWNSELECTION +#define XtDispatchEvent XTDISPATCHEVENT +#define XtDisplayOfObject XTDISPLAYOFOBJECT +#define XtDisplayStringConvWarning XTDISPLAYSTRINGCONVWARNING +#define XtDisplayToApplicationContext XTDISPLAYTOAPPLICATIONCONTEXT +#define XtAppAddWorkProc XTAPPADDWORKPROC +#define XtRemoveWorkProc XTREMOVEWORKPROC +#define XtFree XTFREE +#define XtGetActionKeysym XTGETACTIONKEYSYM +#define XtGetActionList XTGETACTIONLIST +#define XtGetApplicationNameAndClass XTGETAPPLICATIONNAMEANDCLASS +#define XtGetApplicationResources XTGETAPPLICATIONRESOURCES +#define XtGetGC XTGETGC +#define XtGetMultiClickTime XTGETMULTICLICKTIME +#define XtGetSelectionValue XTGETSELECTIONVALUE +#define XtGetSelectionValues XTGETSELECTIONVALUES +#define XtGetSubresources XTGETSUBRESOURCES +#define XtGetValues XTGETVALUES +#define XtGrabKeyboard XTGRABKEYBOARD +#define XtGrabPointer XTGRABPOINTER +#define XtHasCallbacks XTHASCALLBACKS +#define XtInitializeWidgetClass XTINITIALIZEWIDGETCLASS +#define XtInsertEventHandler XTINSERTEVENTHANDLER +#define XtIsManaged XTISMANAGED +#define XtIsObject XTISOBJECT +#define XtIsSensitive XTISSENSITIVE +#define XtIsSubclass XTISSUBCLASS +#define XtLastTimestampProcessed XTLASTTIMESTAMPPROCESSED +#define XtMakeGeometryRequest XTMAKEGEOMETRYREQUEST +#define XtMakeResizeRequest XTMAKERESIZEREQUEST +#define XtMalloc XTMALLOC +#define XtManageChild XTMANAGECHILD +#define XtManageChildren XTMANAGECHILDREN +#define XtMergeArgLists XTMERGEARGLISTS +#define XtMoveWidget XTMOVEWIDGET +#define XtName XTNAME +#define XtNameToWidget XTNAMETOWIDGET +#define XtOpenDisplay XTOPENDISPLAY +#define XtOverrideTranslations XTOVERRIDETRANSLATIONS +#define XtOwnSelection XTOWNSELECTION +#define XtParseTranslationTable XTPARSETRANSLATIONTABLE +#define XtPopdown XTPOPDOWN +#define XtPopup XTPOPUP +#define XtQueryGeometry XTQUERYGEOMETRY +#define XtRealizeWidget XTREALIZEWIDGET +#define XtRealloc XTREALLOC +#define XtReleaseGC XTRELEASEGC +#define XtRemoveAllCallbacks XTREMOVEALLCALLBACKS +#define XtRemoveCallback XTREMOVECALLBACK +#define XtRemoveEventHandler XTREMOVEEVENTHANDLER +#define XtRemoveGrab XTREMOVEGRAB +#define XtRemoveInput XTREMOVEINPUT +#define XtRemoveTimeOut XTREMOVETIMEOUT +#define XtResizeWidget XTRESIZEWIDGET +#define XtResolvePathname XTRESOLVEPATHNAME +#define XtSetKeyboardFocus XTSETKEYBOARDFOCUS +#define XtSetMappedWhenManaged XTSETMAPPEDWHENMANAGED +#define XtSetSensitive XTSETSENSITIVE +#define XtSetTypeConverter XTSETTYPECONVERTER +#define XtSetValues XTSETVALUES +#define XtShellStrings XTSHELLSTRINGS +#define XtStrings XTSTRINGS +#define XtToolkitInitialize XTTOOLKITINITIALIZE +#define XtTranslateCoords XTTRANSLATECOORDS +#define XtTranslateKeycode XTTRANSLATEKEYCODE +#define XtUngrabKeyboard XTUNGRABKEYBOARD +#define XtUngrabPointer XTUNGRABPOINTER +#define XtUnmanageChild XTUNMANAGECHILD +#define XtUnmanageChildren XTUNMANAGECHILDREN +#define XtUnrealizeWidget XTUNREALIZEWIDGET +#define XtVaCreateManagedWidget XTVACREATEMANAGEDWIDGET +#define XtVaCreateWidget XTVACREATEWIDGET +#define XtVaGetValues XTVAGETVALUES +#define XtVaSetValues XTVASETVALUES +#define XtWarning XTWARNING +#define XtWidgetToApplicationContext XTWIDGETTOAPPLICATIONCONTEXT +#define XtWindowOfObject XTWINDOWOFOBJECT +#define XtWindowToWidget XTWINDOWTOWIDGET +#define XwcDrawString XWCDRAWSTRING +#define XwcFreeStringList XWCFREESTRINGLIST +#define XwcTextEscapement XWCTEXTESCAPEMENT +#define XwcTextExtents XWCTEXTEXTENTS +#define XwcTextListToTextProperty XWCTEXTLISTTOTEXTPROPERTY +#define XwcTextPropertyToTextList XWCTEXTPROPERTYTOTEXTLIST +#define _XmBottomShadowColorDefault _XMBOTTOMSHADOWCOLORDEFAULT +#define _XmClearBorder _XMCLEARBORDER +#define _XmConfigureObject _XMCONFIGUREOBJECT +#define _XmDestroyParentCallback _XMDESTROYPARENTCALLBACK +#define _XmDrawArrow _XMDRAWARROW +#define _XmDrawShadows _XMDRAWSHADOWS +#define _XmFontListGetDefaultFont _XMFONTLISTGETDEFAULTFONT +#define _XmFromHorizontalPixels _XMFROMHORIZONTALPIXELS +#define _XmFromVerticalPixels _XMFROMVERTICALPIXELS +#define _XmGetClassExtensionPtr _XMGETCLASSEXTENSIONPTR +#define _XmGetDefaultFontList _XMGETDEFAULTFONTLIST +#define _XmGetTextualDragIcon _XMGETTEXTUALDRAGICON +#define _XmGetWidgetExtData _XMGETWIDGETEXTDATA +#define _XmGrabKeyboard _XMGRABKEYBOARD +#define _XmGrabPointer _XMGRABPOINTER +#define _XmInheritClass _XMINHERITCLASS +#define _XmInputInGadget _XMINPUTINGADGET +#define _XmMakeGeometryRequest _XMMAKEGEOMETRYREQUEST +#define _XmMenuPopDown _XMMENUPOPDOWN +#define _XmMoveObject _XMMOVEOBJECT +#define _XmNavigChangeManaged _XMNAVIGCHANGEMANAGED +#define _XmOSBuildFileList _XMOSBUILDFILELIST +#define _XmOSFileCompare _XMOSFILECOMPARE +#define _XmOSFindPatternPart _XMOSFINDPATTERNPART +#define _XmOSQualifyFileSpec _XMOSQUALIFYFILESPEC +#define _XmPostPopupMenu _XMPOSTPOPUPMENU +#define _XmPrimitiveEnter _XMPRIMITIVEENTER +#define _XmPrimitiveLeave _XMPRIMITIVELEAVE +#define _XmRedisplayGadgets _XMREDISPLAYGADGETS +#define _XmShellIsExclusive _XMSHELLISEXCLUSIVE +#define _XmStringDraw _XMSTRINGDRAW +#define _XmStringGetTextConcat _XMSTRINGGETTEXTCONCAT +#define _XmStrings _XMSTRINGS +#define _XmToHorizontalPixels _XMTOHORIZONTALPIXELS +#define _XmToVerticalPixels _XMTOVERTICALPIXELS +#define _XmTopShadowColorDefault _XMTOPSHADOWCOLORDEFAULT +#define _Xm_fastPtr _XM_FASTPTR +#define _XtCheckSubclassFlag _XTCHECKSUBCLASSFLAG +#define _XtInherit _XTINHERIT +#define _XtInheritTranslations _XTINHERITTRANSLATIONS +#define applicationShellWidgetClass APPLICATIONSHELLWIDGETCLASS +#define compositeWidgetClass COMPOSITEWIDGETCLASS +#define overrideShellWidgetClass OVERRIDESHELLWIDGETCLASS +#define shellWidgetClass SHELLWIDGETCLASS +#define topLevelShellClassRec TOPLEVELSHELLCLASSREC +#define topLevelShellWidgetClass TOPLEVELSHELLWIDGETCLASS +#define transientShellWidgetClass TRANSIENTSHELLWIDGETCLASS +#define vendorShellClassRec VENDORSHELLCLASSREC +#define vendorShellWidgetClass VENDORSHELLWIDGETCLASS +#define wmShellWidgetClass WMSHELLWIDGETCLASS +#define xmArrowButtonWidgetClass XMARROWBUTTONWIDGETCLASS +#define xmCascadeButtonClassRec XMCASCADEBUTTONCLASSREC +#define xmCascadeButtonGadgetClass XMCASCADEBUTTONGADGETCLASS +#define xmCascadeButtonWidgetClass XMCASCADEBUTTONWIDGETCLASS +#define xmDialogShellWidgetClass XMDIALOGSHELLWIDGETCLASS +#define xmDrawingAreaWidgetClass XMDRAWINGAREAWIDGETCLASS +#define xmDrawnButtonWidgetClass XMDRAWNBUTTONWIDGETCLASS +#define xmFileSelectionBoxWidgetClass XMFILESELECTIONBOXWIDGETCLASS +#define xmFormWidgetClass XMFORMWIDGETCLASS +#define xmFrameWidgetClass XMFRAMEWIDGETCLASS +#define xmGadgetClass XMGADGETCLASS +#define xmLabelGadgetClass XMLABELGADGETCLASS +#define xmLabelWidgetClass XMLABELWIDGETCLASS +#define xmListWidgetClass XMLISTWIDGETCLASS +#define xmMainWindowWidgetClass XMMAINWINDOWWIDGETCLASS +#define xmManagerClassRec XMMANAGERCLASSREC +#define xmManagerWidgetClass XMMANAGERWIDGETCLASS +#define xmMenuShellWidgetClass XMMENUSHELLWIDGETCLASS +#define xmMessageBoxWidgetClass XMMESSAGEBOXWIDGETCLASS +#define xmPrimitiveClassRec XMPRIMITIVECLASSREC +#define xmPrimitiveWidgetClass XMPRIMITIVEWIDGETCLASS +#define xmPushButtonClassRec XMPUSHBUTTONCLASSREC +#define xmPushButtonGadgetClass XMPUSHBUTTONGADGETCLASS +#define xmPushButtonWidgetClass XMPUSHBUTTONWIDGETCLASS +#define xmRowColumnWidgetClass XMROWCOLUMNWIDGETCLASS +#define xmSashWidgetClass XMSASHWIDGETCLASS +#define xmScrollBarWidgetClass XMSCROLLBARWIDGETCLASS +#define xmScrolledWindowClassRec XMSCROLLEDWINDOWCLASSREC +#define xmScrolledWindowWidgetClass XMSCROLLEDWINDOWWIDGETCLASS +#define xmSeparatorGadgetClass XMSEPARATORGADGETCLASS +#define xmSeparatorWidgetClass XMSEPARATORWIDGETCLASS +#define xmTextFieldWidgetClass XMTEXTFIELDWIDGETCLASS +#define xmTextWidgetClass XMTEXTWIDGETCLASS +#define xmToggleButtonGadgetClass XMTOGGLEBUTTONGADGETCLASS +#define xmToggleButtonWidgetClass XMTOGGLEBUTTONWIDGETCLASS +#define XtRegisterDrawable _XTREGISTERWINDOW +#define XtUnregisterDrawable _XTUNREGISTERWINDOW #define XQueryFont XQUERYFONT #define XSetPlaneMask XSETPLANEMASK #define XChangeKeyboardControl XCHANGEKEYBOARDCONTROL @@ -39,5 +645,236 @@ #define XSelectExtensionEvent XSELECTEXTENSIONEVENT #define XWarpPointer XWARPPOINTER #define XmuLookupStandardColormap XMULOOKUPSTANDARDCOLORMAP +#define XAllocNamedColor XALLOCNAMEDCOLOR +#define XBlackPixelOfScreen XBLACKPIXELOFSCREEN +#define XDefaultColormap XDEFAULTCOLORMAP +#define XDefaultColormapOfScreen XDEFAULTCOLORMAPOFSCREEN +#define XDefaultDepth XDEFAULTDEPTH +#define XDefaultScreen XDEFAULTSCREEN +#define XDefaultVisual XDEFAULTVISUAL +#define XSetIconName XSETICONNAME +#define XtInitialize XTINITIALIZE +#define XtMainLoop XTMAINLOOP +#define DtSaverGetWindows DTSAVERGETWINDOWS +#define XAddHosts XADDHOSTS +#define XDisableAccessControl XDISABLEACCESSCONTROL +#define XEnableAccessControl XENABLEACCESSCONTROL +#define XFillArcs XFILLARCS +#define XForceScreenSaver XFORCESCREENSAVER +#define XGetScreenSaver XGETSCREENSAVER +#define XListHosts XLISTHOSTS +#define XReadBitmapFile XREADBITMAPFILE +#define XRemoveHosts XREMOVEHOSTS +#define XResetScreenSaver XRESETSCREENSAVER +#define XResourceManagerString XRESOURCEMANAGERSTRING +#define XSetScreenSaver XSETSCREENSAVER +#define XStringListToTextProperty XSTRINGLISTTOTEXTPROPERTY +#define XrmDestroyDatabase XRMDESTROYDATABASE +#define XrmGetFileDatabase XRMGETFILEDATABASE +#define XrmGetStringDatabase XRMGETSTRINGDATABASE +#define XrmInitialize XRMINITIALIZE +#define XrmMergeDatabases XRMMERGEDATABASES +#define XrmParseCommand XRMPARSECOMMAND +#define XrmPutLineResource XRMPUTLINERESOURCE +#define XrmQPutStringResource XRMQPUTSTRINGRESOURCE +#define XrmStringToBindingQuarkList XRMSTRINGTOBINDINGQUARKLIST +#define XrmStringToQuark XRMSTRINGTOQUARK +#define XmCreateLabel XMCREATELABEL + +#ifdef __cplusplus +extern "C" { +#endif +extern void XtFree(char*); +#ifdef __cplusplus +} +#endif +#define pthread_attr_create PTHREAD_ATTR_CREATE +#define pthread_attr_delete PTHREAD_ATTR_DELETE +#define pthread_attr_destroy PTHREAD_ATTR_DESTROY +#define pthread_attr_getdetach_np PTHREAD_ATTR_GETDETACH_NP +#define pthread_attr_getguardsize_np PTHREAD_ATTR_GETGUARDSIZE_NP +#define pthread_attr_getinheritsched PTHREAD_ATTR_GETINHERITSCHED +#define pthread_attr_getprio PTHREAD_ATTR_GETPRIO +#define pthread_attr_getsched PTHREAD_ATTR_GETSCHED +#define pthread_attr_getschedparam PTHREAD_ATTR_GETSCHEDPARAM +#define pthread_attr_getstacksize PTHREAD_ATTR_GETSTACKSIZE +#define pthread_attr_init PTHREAD_ATTR_INIT +#define pthread_attr_setdetach_np PTHREAD_ATTR_SETDETACH_NP +#define pthread_attr_setdetachstate PTHREAD_ATTR_SETDETACHSTATE +#define pthread_attr_setguardsize_np PTHREAD_ATTR_SETGUARDSIZE_NP +#define pthread_attr_setinheritsched PTHREAD_ATTR_SETINHERITSCHED +#define pthread_attr_setprio PTHREAD_ATTR_SETPRIO +#define pthread_attr_setsched PTHREAD_ATTR_SETSCHED +#define pthread_attr_setschedparam PTHREAD_ATTR_SETSCHEDPARAM +#define pthread_attr_setschedpolicy PTHREAD_ATTR_SETSCHEDPOLICY +#define pthread_attr_setstacksize PTHREAD_ATTR_SETSTACKSIZE +#define pthread_cancel PTHREAD_CANCEL +#define pthread_cancel_e PTHREAD_CANCEL_E +#define pthread_cond_broadcast PTHREAD_COND_BROADCAST +#define pthread_cond_destroy PTHREAD_COND_DESTROY +#define pthread_cond_init PTHREAD_COND_INIT +#define pthread_cond_sig_preempt_int_np PTHREAD_COND_SIG_PREEMPT_INT_NP +#define pthread_cond_signal PTHREAD_COND_SIGNAL +#define pthread_cond_signal_int_np PTHREAD_COND_SIGNAL_INT_NP +#define pthread_cond_timedwait PTHREAD_COND_TIMEDWAIT +#define pthread_cond_wait PTHREAD_COND_WAIT +#define pthread_condattr_create PTHREAD_CONDATTR_CREATE +#define pthread_condattr_delete PTHREAD_CONDATTR_DELETE +#define pthread_condattr_init PTHREAD_CONDATTR_INIT +#define pthread_create PTHREAD_CREATE +#define pthread_delay_np PTHREAD_DELAY_NP +#define pthread_detach PTHREAD_DETACH +#define pthread_equal PTHREAD_EQUAL +#define pthread_exc_fetch_fp_np PTHREAD_EXC_FETCH_FP_NP +#define pthread_exc_handler_np PTHREAD_EXC_HANDLER_NP +#define pthread_exc_pop_ctx_np PTHREAD_EXC_POP_CTX_NP +#define pthread_exc_push_ctx_np PTHREAD_EXC_PUSH_CTX_NP +#define pthread_exc_savecontext_np PTHREAD_EXC_SAVECONTEXT_NP +#define pthread_exit PTHREAD_EXIT +#define pthread_get_expiration_np PTHREAD_GET_EXPIRATION_NP +#define pthread_getprio PTHREAD_GETPRIO +#define pthread_getschedparam PTHREAD_GETSCHEDPARAM +#define pthread_getscheduler PTHREAD_GETSCHEDULER +#define pthread_getspecific PTHREAD_GETSPECIFIC +#define pthread_getunique_np PTHREAD_GETUNIQUE_NP +#define pthread_join PTHREAD_JOIN +#define pthread_join32 PTHREAD_JOIN32 +#define pthread_keycreate PTHREAD_KEYCREATE +#define pthread_key_create PTHREAD_KEY_CREATE +#define pthread_kill PTHREAD_KILL +#define pthread_lock_global_np PTHREAD_LOCK_GLOBAL_NP +#define pthread_mutex_destroy PTHREAD_MUTEX_DESTROY +#define pthread_mutex_init PTHREAD_MUTEX_INIT +#define pthread_mutex_lock PTHREAD_MUTEX_LOCK +#define pthread_mutex_trylock PTHREAD_MUTEX_TRYLOCK +#define pthread_mutex_unlock PTHREAD_MUTEX_UNLOCK +#define pthread_mutexattr_create PTHREAD_MUTEXATTR_CREATE +#define pthread_mutexattr_delete PTHREAD_MUTEXATTR_DELETE +#define pthread_mutexattr_destroy PTHREAD_MUTEXATTR_DESTROY +#define pthread_mutexattr_getkind_np PTHREAD_MUTEXATTR_GETKIND_NP +#define pthread_mutexattr_init PTHREAD_MUTEXATTR_INIT +#define pthread_mutexattr_setkind_np PTHREAD_MUTEXATTR_SETKIND_NP +#define pthread_mutexattr_settype_np PTHREAD_MUTEXATTR_SETTYPE_NP +#define pthread_once PTHREAD_ONCE +#define pthread_resume_np PTHREAD_RESUME_NP +#define pthread_self PTHREAD_SELF +#define pthread_setasynccancel PTHREAD_SETASYNCCANCEL +#define pthread_setcancel PTHREAD_SETCANCEL +#define pthread_setcancelstate PTHREAD_SETCANCELSTATE +#define pthread_setprio PTHREAD_SETPRIO +#define pthread_setschedparam PTHREAD_SETSCHEDPARAM +#define pthread_setscheduler PTHREAD_SETSCHEDULER +#define pthread_setspecific PTHREAD_SETSPECIFIC +#define pthread_suspend_np PTHREAD_SUSPEND_NP +#define pthread_testcancel PTHREAD_TESTCANCEL +#define pthread_unlock_global_np PTHREAD_UNLOCK_GLOBAL_NP +#define pthread_yield PTHREAD_YIELD +#define pthread_yield_np PTHREAD_YIELD_NP +#define XDefaultRootWindow XDEFAULTROOTWINDOW +#define XDisplayCells XDISPLAYCELLS +#define XMaxRequestSize XMAXREQUESTSIZE +#define XScreenOfDisplay XSCREENOFDISPLAY +#define XSetFillRule XSETFILLRULE +#define XmActivateProtocol XMACTIVATEPROTOCOL +#define XmCreateBulletinBoardDialog XMCREATEBULLETINBOARDDIALOG +#define XmCreateErrorDialog XMCREATEERRORDIALOG +#define XmCreateWarningDialog XMCREATEWARNINGDIALOG +#define XmCvtCTToXmString XMCVTCTTOXMSTRING +#define XmDestroyPixmap XMDESTROYPIXMAP +#define XmGetPixmap XMGETPIXMAP +#define XmInstallImage XMINSTALLIMAGE +#define XmListAddItems XMLISTADDITEMS +#define XmListDeleteItem XMLISTDELETEITEM +#define XmListItemExists XMLISTITEMEXISTS +#define XmListItemPos XMLISTITEMPOS +#define XmListReplaceItems XMLISTREPLACEITEMS +#define XmListReplaceItemsPos XMLISTREPLACEITEMSPOS +#define XmRemoveProtocols XMREMOVEPROTOCOLS +#define XmRemoveTabGroup XMREMOVETABGROUP +#define XmSetColorCalculation XMSETCOLORCALCULATION +#define XmTextCopy XMTEXTCOPY +#define XmTextCut XMTEXTCUT +#define XmTextFieldClearSelection XMTEXTFIELDCLEARSELECTION +#define XmTextFieldCopy XMTEXTFIELDCOPY +#define XmTextFieldCut XMTEXTFIELDCUT +#define XmTextFieldGetMaxLength XMTEXTFIELDGETMAXLENGTH +#define XmTextFieldGetSelectionPosition XMTEXTFIELDGETSELECTIONPOSITION +#define XmTextFieldPaste XMTEXTFIELDPASTE +#define XmTextFieldReplace XMTEXTFIELDREPLACE +#define XmTextFieldSetAddMode XMTEXTFIELDSETADDMODE +#define XmTextFieldSetHighlight XMTEXTFIELDSETHIGHLIGHT +#define XmTextFieldSetInsertionPosition XMTEXTFIELDSETINSERTIONPOSITION +#define XmTextFieldSetMaxLength XMTEXTFIELDSETMAXLENGTH +#define XmTextFieldShowPosition XMTEXTFIELDSHOWPOSITION +#define XmTextGetEditable XMTEXTGETEDITABLE +#define XmTextPaste XMTEXTPASTE +#define XmTextPosToXY XMTEXTPOSTOXY +#define XmTextSetEditable XMTEXTSETEDITABLE +#define XmTextShowPosition XMTEXTSHOWPOSITION +#define XmUninstallImage XMUNINSTALLIMAGE +#define XmuCvtStringToBitmap XMUCVTSTRINGTOBITMAP +#define XrmPutFileDatabase XRMPUTFILEDATABASE +#define XtAddConverter XTADDCONVERTER +#define XtError XTERROR +#define XtVaCreatePopupShell XTVACREATEPOPUPSHELL +#define pthread_attr_getschedpolicy PTHREAD_ATTR_GETSCHEDPOLICY +#define pthread_key_delete PTHREAD_KEY_DELETE +#define xmBulletinBoardWidgetClass XMBULLETINBOARDWIDGETCLASS +#define xmScaleWidgetClass XMSCALEWIDGETCLASS +#define XtDisplay XTDISPLAY +#define XtScreen XTSCREEN +#define XAllocIconSize XALLOCICONSIZE +#define XAllocStandardColormap XALLOCSTANDARDCOLORMAP +#define XAllowEvents XALLOWEVENTS +#define XBlackPixel XBLACKPIXEL +#define XCopyColormapAndFree XCOPYCOLORMAPANDFREE +#define XDefaultGC XDEFAULTGC +#define XDisplayHeight XDISPLAYHEIGHT +#define XDisplayWidth XDISPLAYWIDTH +#define XGetCommand XGETCOMMAND +#define XGetIconSizes XGETICONSIZES +#define XKillClient XKILLCLIENT +#define XListInstalledColormaps XLISTINSTALLEDCOLORMAPS +#define XRootWindow XROOTWINDOW +#define XWMGeometry XWMGEOMETRY +#define XWhitePixel XWHITEPIXEL +#define XrmCombineDatabase XRMCOMBINEDATABASE +#define XrmCombineFileDatabase XRMCOMBINEFILEDATABASE +#define XSetStandardProperties XSETSTANDARDPROPERTIES +#define XSetState XSETSTATE +#define XDrawRectangles XDRAWRECTANGLES +#define XGrabButton XGRABBUTTON +#define XLookupColor XLOOKUPCOLOR +#define XMapSubwindows XMAPSUBWINDOWS +#define XRecolorCursor XRECOLORCURSOR +#define XStoreBytes XSTOREBYTES +#define XUngrabButton XUNGRABBUTTON +#define XUninstallColormap XUNINSTALLCOLORMAP +#define lib$wait LIB$WAIT +#define lib$find_file LIB$FIND_FILE +#define lib$find_file_end LIB$FIND_FILE_END +#define lib$set_symbol LIB$SET_SYMBOL +#define lib$sfree1_dd LIB$SFREE1_DD +#define lib$spawn LIB$SPAWN +#define sys$assign SYS$ASSIGN +#define sys$crembx SYS$CREMBX +#define sys$dassgn SYS$DASSGN +#define sys$dclexh SYS$DCLEXH +#define sys$getdviw SYS$GETDVIW +#define sys$getsyiw SYS$GETSYIW +#define sys$qio SYS$QIO +#define sys$qiow SYS$QIOW +#define sys$setef SYS$SETEF +#define sys$synch SYS$SYNCH +#define XDrawText XDRAWTEXT +#define XtCloseDisplay XTCLOSEDISPLAY +#define XtDestroyApplicationContext XTDESTROYAPPLICATIONCONTEXT +#define lib$ediv LIB$EDIV +#define lib$subx LIB$SUBX +#define sys$bintim SYS$BINTIM +#define sys$gettim SYS$GETTIM +#define XFetchName XFETCHNAME +#define XPeekIfEvent XPEEKIFEVENT +#define XQueryKeymap XQUERYKEYMAP #endif diff --git a/src/mesa/glapi/glthread.h b/src/mesa/glapi/glthread.h index b31b5794059..726811f696b 100644 --- a/src/mesa/glapi/glthread.h +++ b/src/mesa/glapi/glthread.h @@ -1,4 +1,4 @@ -/* $Id: glthread.h,v 1.5 2000/02/11 21:38:33 brianp Exp $ */ +/* $Id: glthread.h,v 1.6 2000/11/17 11:00:56 joukj Exp $ */ /* * Mesa 3-D graphics library @@ -62,6 +62,11 @@ * In general, it should only be included when needed however. */ +#ifdef VMS +# if defined(PTHREADS) +#include "types.h" +#endif +#endif #ifndef GLTHREAD_H #define GLTHREAD_H @@ -71,7 +76,9 @@ #define THREADS #endif - +#ifdef VMS +#include +#endif /* * POSIX threads. This should be your choice in the Unix world diff --git a/src/mesa/main/descrip.mms b/src/mesa/main/descrip.mms index 0533a26b115..d38160848d1 100644 --- a/src/mesa/main/descrip.mms +++ b/src/mesa/main/descrip.mms @@ -1,6 +1,6 @@ # Makefile for core library for VMS # contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl -# Last revision : 1 November 2000 +# Last revision : 17 November 2000 .first define gl [-.include.gl] @@ -13,21 +13,67 @@ VPATH = RCS INCDIR = [-.include] LIBDIR = [-.lib] -CFLAGS = /include=($(INCDIR),[])/define=(FBIND=1)/name=(as_is,short) - -CORE_SOURCES = accum.c alpha.c attrib.c \ -bitmap.c blend.c buffers.c clip.c colortab.c context.c copypix.c depth.c \ -dispatch.c convolve.c \ -dlist.c drawpix.c enable.c eval.c feedback.c fog.c \ -get.c hash.c highpc.c hint.c image.c histogram.c light.c lines.c logic.c\ -lowpc.c masking.c matrix.c \ -mem.c glapi.c glapinoop.c imports.c\ -mmath.c pixel.c points.c polygon.c \ -rastpos.c readpix.c rect.c scissor.c shade.c \ -stencil.c teximage.c texobj.c texstate.c texture.c translate.c \ -varray.c winpos.c vb.c vbcull.c vbfill.c vbrender.c vbxform.c xform.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 +CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short) + +CORE_SOURCES =accum.c \ + alpha.c \ + attrib.c \ + bitmap.c \ + blend.c \ + buffers.c \ + clip.c \ + colortab.c \ + config.c \ + context.c \ + convolve.c \ + copypix.c \ + debug.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 \ + highpc.c \ + hint.c \ + histogram.c \ + image.c \ + imports.c \ + light.c \ + lines.c \ + logic.c \ + lowpc.c \ + masking.c \ + matrix.c \ + mem.c \ + mmath.c \ + pixel.c \ + pixeltex.c \ + points.c \ + polygon.c \ + rastpos.c \ + readpix.c \ + rect.c \ + scissor.c \ + state.c \ + stencil.c \ + teximage.c \ + texobj.c \ + texstate.c \ + texture.c \ + texutil.c \ + varray.c \ + winpos.c \ + [.x86]x86.c DRIVER_SOURCES = [.x]glxapi.c [.x]fakeglx.c [.x]xfonts.c \ [.x]xm_api.c [.x]xm_dd.c [.x]xm_line.c [.x]xm_span.c [.x]xm_tri.c \ @@ -73,28 +119,99 @@ RASTER_SOURCES = [.swrast]s_aatriangle.c \ ASM_SOURCES = -OBJECTS =\ -accum.obj,alpha.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 - +TNL_SOURCES=[.tnl]t_bbox.c \ +[.tnl]t_clip.c \ +[.tnl]t_context.c \ +[.tnl]t_cva.c \ +[.tnl]t_debug.c \ +[.tnl]t_dlist.c \ +[.tnl]t_eval.c \ +[.tnl]t_fog.c \ +[.tnl]t_light.c \ +[.tnl]t_pipeline.c \ +[.tnl]t_rect.c \ +[.tnl]t_shade.c \ +[.tnl]t_stages.c \ +[.tnl]t_texture.c \ +[.tnl]t_trans_elt.c \ +[.tnl]t_varray.c \ +[.tnl]t_vb.c \ +[.tnl]t_vbcull.c \ +[.tnl]t_vbfill.c \ +[.tnl]t_vbindirect.c \ +[.tnl]t_vbrender.c \ +[.tnl]t_vbxform.c -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,highpc.obj,histogram.obj,mem.obj,\ -mmath.obj,pixel.obj,points.obj +MATH_SOURCES=[.math]m_debug_xform.c \ +[.math]m_matrix.c \ +[.math]m_translate.c \ +[.math]m_vector.c \ +[.math]m_vertices.c \ +[.math]m_xform.c -OBJECTS7=polygon.obj,imports.obj,\ -rastpos.obj,readpix.obj,rect.obj,scissor.obj,shade.obj,\ -pixeltex.obj,convolve.obj,lowpc.obj +OBJECTS1=accum.obj,\ +alpha.obj,\ +attrib.obj,\ +bitmap.obj,\ +blend.obj,\ +buffers.obj,\ +clip.obj,\ +colortab.obj,\ +config.obj,\ +context.obj,\ +convolve.obj,\ +copypix.obj,\ +debug.obj,\ +depth.obj,\ +dispatch.obj,\ +dlist.obj,\ +drawpix.obj,\ +enable.obj,\ +enums.obj -OBJECTS4=stencil.obj,teximage.obj,texobj.obj,texstate.obj,texture.obj,translate.obj,\ -varray.obj,winpos.obj,vb.obj,vbcull.obj,vbfill.obj,vbrender.obj +OBJECTS2=eval.obj,\ +extensions.obj,\ +feedback.obj,\ +fog.obj,\ +get.obj,\ +glapi.obj,\ +glapinoop.obj,\ +glthread.obj,\ +hash.obj,\ +highpc.obj,\ +hint.obj,\ +histogram.obj,\ +image.obj,\ +imports.obj,\ +light.obj,\ +lines.obj,\ +logic.obj,\ +lowpc.obj,\ +masking.obj,\ +matrix.obj,\ +mem.obj,\ +mmath.obj -OBJECTS6=vbxform.obj,xform.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 +OBJECTS3=pixel.obj,\ +pixeltex.obj,\ +points.obj,\ +polygon.obj,\ +rastpos.obj,\ +readpix.obj,\ +rect.obj,\ +scissor.obj,\ +state.obj,\ +stencil.obj,\ +teximage.obj,\ +texobj.obj,\ +texstate.obj,\ +texture.obj,\ +texutil.obj,\ +varray.obj,\ +winpos.obj,\ +[.x86]x86.obj -OBJECTS2=[.x]glxapi.obj,[.x]fakeglx.obj,[.x]xfonts.obj,\ +OBJECTS4=[.x]glxapi.obj,[.x]fakeglx.obj,[.x]xfonts.obj,\ [.x]xm_api.obj,[.x]xm_dd.obj,[.x]xm_line.obj,[.x]xm_span.obj,[.x]xm_tri.obj,\ [.osmesa]osmesa.obj,\ [.svga]svgamesa.obj @@ -102,10 +219,10 @@ OBJECTS2=[.x]glxapi.obj,[.x]fakeglx.obj,[.x]xfonts.obj,\ OBJECTS5=[.fx]fxapi.obj,[.fx]fxdd.obj,[.fx]fxddtex.obj,[.fx]fxvsetup.obj,\ [.fx]fxsetup.obj,[.fx]fxfastpath.obj,[.fx]fxpipeline.obj -OBJECTS8=[.fx]fxtrifuncs.obj,[.fx]fxglidew.obj,\ +OBJECTS6=[.fx]fxtrifuncs.obj,[.fx]fxglidew.obj,\ [.fx]fxtexman.obj,[.fx]fxddspan.obj -OBJECTS9=[.swrast]s_aatriangle.obj,\ +OBJECTS7=[.swrast]s_aatriangle.obj,\ [.swrast]s_accum.obj,\ [.swrast]s_alpha.obj,\ [.swrast]s_alphabuf.obj,\ @@ -116,7 +233,7 @@ OBJECTS9=[.swrast]s_aatriangle.obj,\ [.swrast]s_context.obj,\ [.swrast]s_depth.obj -OBJECTS10=[.swrast]s_drawpix.obj,\ +OBJECTS8=[.swrast]s_drawpix.obj,\ [.swrast]s_fog.obj,\ [.swrast]s_histogram.obj,\ [.swrast]s_lines.obj,\ @@ -127,7 +244,7 @@ OBJECTS10=[.swrast]s_drawpix.obj,\ [.swrast]s_points.obj,\ [.swrast]s_quads.obj -OBJECTS11=[.swrast]s_readpix.obj,\ +OBJECTS9=[.swrast]s_readpix.obj,\ [.swrast]s_aaline.obj,\ [.swrast]s_scissor.obj,\ [.swrast]s_span.obj,\ @@ -137,19 +254,50 @@ OBJECTS11=[.swrast]s_readpix.obj,\ [.swrast]s_feedback.obj,\ [.swrast]s_zoom.obj -OBJECTS12=[.swrast_setup]ss_context.obj,\ +OBJECTS10=[.swrast_setup]ss_context.obj,\ [.swrast_setup]ss_triangle.obj,\ [.swrast_setup]ss_vb.obj +OBJECTS11=[.tnl]t_bbox.obj,\ +[.tnl]t_clip.obj,\ +[.tnl]t_context.obj,\ +[.tnl]t_cva.obj,\ +[.tnl]t_debug.obj,\ +[.tnl]t_dlist.obj,\ +[.tnl]t_eval.obj,\ +[.tnl]t_fog.obj,\ +[.tnl]t_light.obj,\ +[.tnl]t_pipeline.obj,\ +[.tnl]t_rect.obj + +OBJECTS12=[.tnl]t_shade.obj,\ +[.tnl]t_stages.obj,\ +[.tnl]t_texture.obj,\ +[.tnl]t_trans_elt.obj,\ +[.tnl]t_varray.obj,\ +[.tnl]t_vb.obj,\ +[.tnl]t_vbcull.obj,\ +[.tnl]t_vbfill.obj,\ +[.tnl]t_vbindirect.obj,\ +[.tnl]t_vbrender.obj,\ +[.tnl]t_vbxform.obj + +OBJECTS13=[.math]m_debug_xform.obj,\ +[.math]m_matrix.obj,\ +[.math]m_translate.obj,\ +[.math]m_vector.obj,\ +[.math]m_vertices.obj,\ +[.math]m_xform.obj + ##### RULES ##### VERSION=Mesa V3.4 ##### TARGETS ##### # Make the library -$(LIBDIR)$(GL_LIB) : $(OBJECTS),$(OBJECTS2) $(OBJECTS3) $(OBJECTS4)\ - $(OBJECTS5) $(OBJECTS8) $(OBJECTS7) $(OBJECTS6) $(OBJECTS9)\ - $(OBJECTS10) $(OBJECTS11) $(OBJECTS12) +$(LIBDIR)$(GL_LIB) : $(OBJECTS1),$(OBJECTS2) $(OBJECTS3) $(OBJECTS4)\ + $(OBJECTS5) $(OBJECTS6) $(OBJECTS7) $(OBJECTS8) $(OBJECTS9)\ + $(OBJECTS10) $(OBJECTS11) $(OBJECTS12) $(OBJECTS13) .ifdef SHARE @ WRITE_ SYS$OUTPUT " generating mesagl1.opt" @ OPEN_/WRITE FILE mesagl1.opt @@ -158,20 +306,22 @@ $(LIBDIR)$(GL_LIB) : $(OBJECTS),$(OBJECTS2) $(OBJECTS3) $(OBJECTS4)\ @ WRITE_ FILE "!" @ WRITE_ FILE "IDENTIFICATION=""$(VERSION)""" @ WRITE_ FILE "GSMATCH=LEQUAL,3,4 - @ WRITE_ FILE "$(OBJECTS)" + @ WRITE_ FILE "$(OBJECTS1)" + @ WRITE_ FILE "$(OBJECTS2)" @ WRITE_ FILE "$(OBJECTS3)" @ WRITE_ FILE "$(OBJECTS4)" - @ WRITE_ FILE "$(OBJECTS7)" - @ WRITE_ FILE "$(OBJECTS6)" - @ WRITE_ FILE "$(OBJECTS2)" @ WRITE_ FILE "$(OBJECTS5)" + @ WRITE_ FILE "$(OBJECTS6)" + @ WRITE_ FILE "$(OBJECTS7)" @ WRITE_ FILE "$(OBJECTS8)" @ WRITE_ FILE "$(OBJECTS9)" @ WRITE_ FILE "$(OBJECTS10)" @ WRITE_ FILE "$(OBJECTS11)" @ WRITE_ FILE "$(OBJECTS12)" - @ WRITE_ FILE "SYS$SHARE:DECW$XEXTLIBSHR/SHARE" - @ WRITE_ FILE "SYS$SHARE:DECW$XLIBSHR/SHARE" + @ WRITE_ FILE "$(OBJECTS13)" + @ write_ file "sys$share:decw$xextlibshr/share" + @ write_ file "sys$share:decw$xlibshr/share" + @ write_ file "sys$share:pthread$rtl/share" @ CLOSE_ FILE @ WRITE_ SYS$OUTPUT " generating mesagl.map ..." @ LINK_/NODEB/NOSHARE/NOEXE/MAP=mesagl.map/FULL mesagl1.opt/OPT @@ -180,18 +330,19 @@ $(LIBDIR)$(GL_LIB) : $(OBJECTS),$(OBJECTS2) $(OBJECTS3) $(OBJECTS4)\ @ 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) + @ $(MAKELIB) $(GL_LIB) $(OBJECTS1) @ 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) + @ library $(GL_LIB) $(OBJECTS7) + @ library $(GL_LIB) $(OBJECTS8) @ library $(GL_LIB) $(OBJECTS9) @ library $(GL_LIB) $(OBJECTS10) @ library $(GL_LIB) $(OBJECTS11) @ library $(GL_LIB) $(OBJECTS12) + @ library $(GL_LIB) $(OBJECTS13) .endif @ rename $(GL_LIB)* $(LIBDIR) @@ -312,5 +463,61 @@ imports.obj : imports.c $(CC) $(CFLAGS) /obj=[.swrast_setup]ss_triangle.obj [.swrast_setup]ss_triangle.c [.swrast_setup]ss_vb.obj : [.swrast_setup]ss_vb.c $(CC) $(CFLAGS) /obj=[.swrast_setup]ss_vb.obj [.swrast_setup]ss_vb.c +[.tnl]t_bbox.obj : [.tnl]t_bbox.c + $(CC) $(CFLAGS) /obj=[.tnl]t_bbox.obj [.tnl]t_bbox.c +[.tnl]t_clip.obj : [.tnl]t_clip.c + $(CC) $(CFLAGS) /obj=[.tnl]t_clip.obj [.tnl]t_clip.c +[.tnl]t_context.obj : [.tnl]t_context.c + $(CC) $(CFLAGS) /obj=[.tnl]t_context.obj [.tnl]t_context.c +[.tnl]t_cva.obj : [.tnl]t_cva.c + $(CC) $(CFLAGS) /obj=[.tnl]t_cva.obj [.tnl]t_cva.c +[.tnl]t_debug.obj : [.tnl]t_debug.c + $(CC) $(CFLAGS) /obj=[.tnl]t_debug.obj [.tnl]t_debug.c +[.tnl]t_dlist.obj : [.tnl]t_dlist.c + $(CC) $(CFLAGS) /obj=[.tnl]t_dlist.obj [.tnl]t_dlist.c +[.tnl]t_eval.obj : [.tnl]t_eval.c + $(CC) $(CFLAGS) /obj=[.tnl]t_eval.obj [.tnl]t_eval.c +[.tnl]t_fog.obj : [.tnl]t_fog.c + $(CC) $(CFLAGS) /obj=[.tnl]t_fog.obj [.tnl]t_fog.c +[.tnl]t_light.obj : [.tnl]t_light.c + $(CC) $(CFLAGS) /obj=[.tnl]t_light.obj [.tnl]t_light.c +[.tnl]t_pipeline.obj : [.tnl]t_pipeline.c + $(CC) $(CFLAGS) /obj=[.tnl]t_pipeline.obj [.tnl]t_pipeline.c +[.tnl]t_rect.obj : [.tnl]t_rect.c + $(CC) $(CFLAGS) /obj=[.tnl]t_rect.obj [.tnl]t_rect.c +[.tnl]t_shade.obj : [.tnl]t_shade.c + $(CC) $(CFLAGS) /obj=[.tnl]t_shade.obj [.tnl]t_shade.c +[.tnl]t_stages.obj : [.tnl]t_stages.c + $(CC) $(CFLAGS) /obj=[.tnl]t_stages.obj [.tnl]t_stages.c +[.tnl]t_texture.obj : [.tnl]t_texture.c + $(CC) $(CFLAGS) /obj=[.tnl]t_texture.obj [.tnl]t_texture.c +[.tnl]t_trans_elt.obj : [.tnl]t_trans_elt.c + $(CC) $(CFLAGS) /obj=[.tnl]t_trans_elt.obj [.tnl]t_trans_elt.c +[.tnl]t_varray.obj : [.tnl]t_varray.c + $(CC) $(CFLAGS) /obj=[.tnl]t_varray.obj [.tnl]t_varray.c +[.tnl]t_vb.obj : [.tnl]t_vb.c + $(CC) $(CFLAGS) /obj=[.tnl]t_vb.obj [.tnl]t_vb.c +[.tnl]t_vbcull.obj : [.tnl]t_vbcull.c + $(CC) $(CFLAGS) /obj=[.tnl]t_vbcull.obj [.tnl]t_vbcull.c +[.tnl]t_vbfill.obj : [.tnl]t_vbfill.c + $(CC) $(CFLAGS) /obj=[.tnl]t_vbfill.obj [.tnl]t_vbfill.c +[.tnl]t_vbindirect.obj : [.tnl]t_vbindirect.c + $(CC) $(CFLAGS) /obj=[.tnl]t_vbindirect.obj [.tnl]t_vbindirect.c +[.tnl]t_vbrender.obj : [.tnl]t_vbrender.c + $(CC) $(CFLAGS) /obj=[.tnl]t_vbrender.obj [.tnl]t_vbrender.c +[.tnl]t_vbxform.obj : [.tnl]t_vbxform.c + $(CC) $(CFLAGS) /obj=[.tnl]t_vbxform.obj [.tnl]t_vbxform.c +[.math]m_debug_xform.obj : [.math]m_debug_xform.c + $(CC) $(CFLAGS) /obj=[.math]m_debug_xform.obj [.math]m_debug_xform.c +[.math]m_matrix.obj : [.math]m_matrix.c + $(CC) $(CFLAGS) /obj=[.math]m_matrix.obj [.math]m_matrix.c +[.math]m_translate.obj : [.math]m_translate.c + $(CC) $(CFLAGS) /obj=[.math]m_translate.obj [.math]m_translate.c +[.math]m_vector.obj : [.math]m_vector.c + $(CC) $(CFLAGS) /obj=[.math]m_vector.obj [.math]m_vector.c +[.math]m_vertices.obj : [.math]m_vertices.c + $(CC) $(CFLAGS) /obj=[.math]m_vertices.obj [.math]m_vertices.c +[.math]m_xform.obj : [.math]m_xform.c + $(CC) $(CFLAGS) /obj=[.math]m_xform.obj [.math]m_xform.c .include mms_depend. -- cgit v1.2.3 From 68656667b2f63c285ccd75fb16a17a8a04a9f552 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 25 Nov 2000 18:52:58 +0000 Subject: fixed GLX_PBUFFER value --- include/GL/glx.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 9082c3dcd10..70574426e13 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,8 +1,8 @@ -/* $Id: glx.h,v 1.23 2000/08/22 13:31:00 joukj Exp $ */ +/* $Id: glx.h,v 1.24 2000/11/25 18:52:58 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.3 + * Version: 3.5 * * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. * @@ -159,7 +159,7 @@ extern "C" { #define GLX_DAMAGED 0x8020 #define GLX_SAVED 0x8021 #define GLX_WINDOW 0x8022 -#define GLX_PBUFFER 0x8033 +#define GLX_PBUFFER 0x8023 -- cgit v1.2.3 From 1c6701e1e19a7d104ea8e2db560e4abef4be4ad0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 8 Dec 2000 00:28:59 +0000 Subject: added LL_MESA_sprite_point extension --- include/GL/gl.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 00feace6354..9cde02279a6 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.47 2000/11/03 15:14:18 brianp Exp $ */ +/* $Id: gl.h,v 1.48 2000/12/08 00:28:59 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2282,6 +2282,16 @@ GLAPI void GLAPIENTRY glTracePointerRange( const GLvoid* first, const GLvoid* la #endif /* GL_MESA_packed_depth_stencil */ +/* + * ??. GL_MESA_sprite_point + */ +#ifndef GL_MESA_sprite_point +#define GL_MESA_sprite_point 1 + +#define GL_SPRITE_POINT_MESA 0x8757 /* XXX not finalized! */ + +#endif + /********************************************************************** * Begin system-specific stuff -- cgit v1.2.3 From fed386cdc02d1f49f68e490f316f2533451e4616 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 8 Dec 2000 18:06:35 +0000 Subject: standardized GLX extensions header --- include/GL/glxext.h | 527 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 527 insertions(+) create mode 100644 include/GL/glxext.h (limited to 'include') diff --git a/include/GL/glxext.h b/include/GL/glxext.h new file mode 100644 index 00000000000..63971921c38 --- /dev/null +++ b/include/GL/glxext.h @@ -0,0 +1,527 @@ +#ifndef __glxext_h_ +#define __glxext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.1 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: This software was created using the +** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has +** not been independently verified as being compliant with the OpenGL(R) +** version 1.2.1 Specification. +*/ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif + +/*************************************************************/ + +/* Header file version number, required by OpenGL ABI for Linux */ +#define GLX_GLXEXT_VERSION 2 + +#ifndef GLX_VERSION_1_3 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_RGBA_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_DONT_CARE 0xFFFFFFFF +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 +#endif + +#ifndef GLX_EXT_visual_info +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 +#define GLX_NONE_EXT 0x8000 +#define GLX_TRUE_COLOR_EXT 0x8002 +#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_PSEUDO_COLOR_EXT 0x8004 +#define GLX_STATIC_COLOR_EXT 0x8005 +#define GLX_GRAY_SCALE_EXT 0x8006 +#define GLX_STATIC_GRAY_EXT 0x8007 +#define GLX_TRANSPARENT_RGB_EXT 0x8008 +#define GLX_TRANSPARENT_INDEX_EXT 0x8009 +#endif + +#ifndef GLX_SGI_swap_control +#endif + +#ifndef GLX_SGI_video_sync +#endif + +#ifndef GLX_SGI_make_current_read +#endif + +#ifndef GLX_SGIX_video_source +#endif + +#ifndef GLX_EXT_visual_rating +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#define GLX_SLOW_VISUAL_EXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D +/* reuse GLX_NONE_EXT */ +#endif + +#ifndef GLX_EXT_import_context +#define GLX_SHARE_CONTEXT_EXT 0x800A +#define GLX_VISUAL_ID_EXT 0x800B +#define GLX_SCREEN_EXT 0x800C +#endif + +#ifndef GLX_SGIX_fbconfig +#define GLX_WINDOW_BIT_SGIX 0x00000001 +#define GLX_PIXMAP_BIT_SGIX 0x00000002 +#define GLX_RGBA_BIT_SGIX 0x00000001 +#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 +#define GLX_DRAWABLE_TYPE_SGIX 0x8010 +#define GLX_RENDER_TYPE_SGIX 0x8011 +#define GLX_X_RENDERABLE_SGIX 0x8012 +#define GLX_FBCONFIG_ID_SGIX 0x8013 +#define GLX_RGBA_TYPE_SGIX 0x8014 +#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 +/* reuse GLX_SCREEN_EXT */ +#endif + +#ifndef GLX_SGIX_pbuffer +#define GLX_PBUFFER_BIT_SGIX 0x00000004 +#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 +#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 +#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 +#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 +#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 +#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 +#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 +#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 +#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 +#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 +#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A +#define GLX_PRESERVED_CONTENTS_SGIX 0x801B +#define GLX_LARGEST_PBUFFER_SGIX 0x801C +#define GLX_WIDTH_SGIX 0x801D +#define GLX_HEIGHT_SGIX 0x801E +#define GLX_EVENT_MASK_SGIX 0x801F +#define GLX_DAMAGED_SGIX 0x8020 +#define GLX_SAVED_SGIX 0x8021 +#define GLX_WINDOW_SGIX 0x8022 +#define GLX_PBUFFER_SGIX 0x8023 +#endif + +#ifndef GLX_SGI_cushion +#endif + +#ifndef GLX_SGIX_video_resize +#define GLX_SYNC_FRAME_SGIX 0x00000000 +#define GLX_SYNC_SWAP_SGIX 0x00000001 +#endif + +#ifndef GLX_SGIX_dmbuffer +#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024 +#endif + +#ifndef GLX_SGIX_swap_group +#endif + +#ifndef GLX_SGIX_swap_barrier +#endif + +#ifndef GLX_SGIS_blended_overlay +#define GLX_BLENDED_RGBA_SGIS 0x8025 +#endif + +#ifndef GLX_SGIS_shared_multisample +#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 +#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 +#endif + +#ifndef GLX_SUN_get_transparent_index +#endif + +#ifndef GLX_3DFX_multisample +#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 +#define GLX_SAMPLES_3DFX 0x8051 +#endif + +#ifndef GLX_MESA_copy_sub_buffer +#endif + +#ifndef GLX_MESA_pixmap_colormap +#endif + +#ifndef GLX_MESA_release_buffers +#endif + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_3DFX_WINDOW_MODE_MESA 0x1 +#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 +#endif + + +/*************************************************************/ + +#ifndef GLX_ARB_get_proc_address +typedef void (*__GLXextFuncPtr)(); +#endif + +#ifndef GLX_SGIX_video_source +typedef XID GLXVideoSourceSGIX; +#endif + +#ifndef GLX_SGIX_fbconfig +typedef XID GLXFBConfigIDSGIX; +typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; +#endif + +#ifndef GLX_SGIX_pbuffer +typedef XID GLXPbufferSGIX; +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came for SendEvent request */ + Display *display; /* display the event was read from */ + GLXDrawable drawable; /* i.d. of Drawable */ + int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */ + int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */ + unsigned int mask; /* mask indicating which buffers are affected*/ + int x, y; + int width, height; + int count; /* if nonzero, at least this many more */ +} GLXBufferClobberEventSGIX; +#endif + +#ifndef GLX_VERSION_1_3 +#define GLX_VERSION_1_3 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXFBConfig * glXGetFBConfigs (Display *, int, int *); +extern GLXFBConfig * glXChooseFBConfig (Display *, int, const int *, int *); +extern int glXGetFBConfigAttrib (Display *, GLXFBConfig, int, int *); +extern XVisualInfo * glXGetVisualFromFBConfig (Display *, GLXFBConfig); +extern GLXWindow glXCreateWindow (Display *, GLXFBConfig, Window, const int *); +extern void glXDestroyWindow (Display *, GLXWindow); +extern GLXPixmap glXCreatePixmap (Display *, GLXFBConfig, Pixmap, const int *); +extern void glXDestroyPixmap (Display *, GLXPixmap); +extern GLXPbuffer glXCreatePbuffer (Display *, GLXFBConfig, const int *); +extern void glXDestroyPbuffer (Display *, GLXPbuffer); +extern void glXQueryDrawable (Display *, GLXDrawable, int, unsigned int *); +extern GLXContext glXCreateNewContext (Display *, GLXFBConfig, int, GLXContext, Bool); +extern Bool glXMakeContextCurrent (Display *, GLXDrawable, GLXDrawable, GLXContext); +extern GLXDrawable glXGetCurrentReadDrawable (void); +extern Display * glXGetCurrentDisplay (void); +extern int glXQueryContext (Display *, GLXContext, int, int *); +extern void glXSelectEvent (Display *, GLXDrawable, unsigned long); +extern void glXGetSelectedEvent (Display *, GLXDrawable, unsigned long *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); +typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); +typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); +typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); +typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); +typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); +typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); +typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void); +typedef Display * ( * PFNGLXGETCURRENTDISPLAYPROC) (void); +typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); +typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); +typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); +#endif + +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName); +#endif + +#ifndef GLX_SGIS_multisample +#define GLX_SGIS_multisample 1 +#endif + +#ifndef GLX_EXT_visual_info +#define GLX_EXT_visual_info 1 +#endif + +#ifndef GLX_SGI_swap_control +#define GLX_SGI_swap_control 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXSwapIntervalSGI (int); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); +#endif + +#ifndef GLX_SGI_video_sync +#define GLX_SGI_video_sync 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXGetVideoSyncSGI (unsigned int *); +extern int glXWaitVideoSyncSGI (int, int, unsigned int *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count); +typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count); +#endif + +#ifndef GLX_SGI_make_current_read +#define GLX_SGI_make_current_read 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXMakeCurrentReadSGI (Display *, GLXDrawable, GLXDrawable, GLXContext); +extern GLXDrawable glXGetCurrentReadDrawableSGI (void); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); +#endif + +#ifdef _VL_H +#ifndef GLX_SGIX_video_source +#define GLX_SGIX_video_source 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *, int, VLServer, VLPath, int, VLNode); +extern void glXDestroyGLXVideoSourceSGIX (Display *, GLXVideoSourceSGIX); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode); +typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource); +#endif + +#endif /* _VL_H */ +#ifndef GLX_EXT_visual_rating +#define GLX_EXT_visual_rating 1 +#endif + +#ifndef GLX_EXT_import_context +#define GLX_EXT_import_context 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Display * glXGetCurrentDisplayEXT (void); +extern int glXQueryContextInfoEXT (Display *, GLXContext, int, int *); +extern GLXContextID glXGetContextIDEXT (GLXContext); +extern GLXContext glXImportContextEXT (Display *, GLXContextID); +extern void glXFreeContextEXT (Display *, GLXContext); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void); +typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value); +typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (GLXContext context); +typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID); +typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context); +#endif + +#ifndef GLX_SGIX_fbconfig +#define GLX_SGIX_fbconfig 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXGetFBConfigAttribSGIX (Display *, GLXFBConfigSGIX, int, int *); +extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *, int, int *, int *); +extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *, GLXFBConfigSGIX, Pixmap); +extern GLXContext glXCreateContextWithConfigSGIX (Display *, GLXFBConfigSGIX, int, GLXContext, Bool); +extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *, GLXFBConfigSGIX); +extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *, XVisualInfo *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value); +typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements); +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap); +typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct); +typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config); +typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis); +#endif + +#ifndef GLX_SGIX_pbuffer +#define GLX_SGIX_pbuffer 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *); +extern void glXDestroyGLXPbufferSGIX (Display *, GLXPbufferSGIX); +extern int glXQueryGLXPbufferSGIX (Display *, GLXPbufferSGIX, int, unsigned int *); +extern void glXSelectEventSGIX (Display *, GLXDrawable, unsigned long); +extern void glXGetSelectedEventSGIX (Display *, GLXDrawable, unsigned long *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list); +typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf); +typedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask); +typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask); +#endif + +#ifndef GLX_SGI_cushion +#define GLX_SGI_cushion 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXCushionSGI (Display *, Window, float); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion); +#endif + +#ifndef GLX_SGIX_video_resize +#define GLX_SGIX_video_resize 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern int glXBindChannelToWindowSGIX (Display *, int, int, Window); +extern int glXChannelRectSGIX (Display *, int, int, int, int, int, int); +extern int glXQueryChannelRectSGIX (Display *, int, int, int *, int *, int *, int *); +extern int glXQueryChannelDeltasSGIX (Display *, int, int, int *, int *, int *, int *); +extern int glXChannelRectSyncSGIX (Display *, int, int, GLenum); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window); +typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h); +typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); +typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h); +typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype); +#endif + +#ifdef _DM_BUFFER_H_ +#ifndef GLX_SGIX_dmbuffer +#define GLX_SGIX_dmbuffer 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXAssociateDMPbufferSGIX (Display *, GLXPbufferSGIX, DMparams *, DMbuffer); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer); +#endif + +#endif /* _DM_BUFFER_H_ */ +#ifndef GLX_SGIX_swap_group +#define GLX_SGIX_swap_group 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXJoinSwapGroupSGIX (Display *, GLXDrawable, GLXDrawable); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); +#endif + +#ifndef GLX_SGIX_swap_barrier +#define GLX_SGIX_swap_barrier 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXBindSwapBarrierSGIX (Display *, GLXDrawable, int); +extern Bool glXQueryMaxSwapBarriersSGIX (Display *, int, int *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier); +typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max); +#endif + +#ifndef GLX_SUN_get_transparent_index +#define GLX_SUN_get_transparent_index 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Status glXGetTransparentIndexSUN (Display *, Window, Window, long *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex); +#endif + +#ifndef GLX_MESA_copy_sub_buffer +#define GLX_MESA_copy_sub_buffer 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern void glXCopySubBufferMESA (Display *, GLXDrawable, int, int, int, int); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height); +#endif + +#ifndef GLX_MESA_pixmap_colormap +#define GLX_MESA_pixmap_colormap 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXPixmap glXCreateGLXPixmapMESA (Display *, XVisualInfo *, Pixmap, Colormap); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); +#endif + +#ifndef GLX_MESA_release_buffers +#define GLX_MESA_release_buffers 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXReleaseBuffersMESA (Display *, GLXDrawable); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable); +#endif + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_MESA_set_3dfx_mode 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXSet3DfxModeMESA (int); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode); +#endif + + +#ifdef __cplusplus +} +#endif + +#endif -- cgit v1.2.3 From 23b1503d79bc148521f8cff3c7b5f5faa146d1ac Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 8 Dec 2000 18:08:15 +0000 Subject: include glxext.h unless GLX_GLXEXT_LEGACY is defined --- include/GL/glx.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 70574426e13..5624a95e55b 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.24 2000/11/25 18:52:58 brianp Exp $ */ +/* $Id: glx.h,v 1.25 2000/12/08 18:08:15 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -44,11 +44,11 @@ #pragma message enable nosimpint #endif #endif -#include "GL/gl.h" +#include #if defined(USE_MGL_NAMESPACE) -#include "glx_mangle.h" +#include #endif @@ -280,11 +280,11 @@ extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable, -/*#ifndef GLX_GLXEXT_LEGACY*/ +#ifndef GLX_GLXEXT_LEGACY -/*#include */ +#include -/*#else*/ +#else /* @@ -432,7 +432,7 @@ extern void (*glXGetProcAddressARB(const GLubyte *procName))(); -/*#endif*/ /* GLX_GLXEXT_LEGACY */ +#endif /* GLX_GLXEXT_LEGACY */ -- cgit v1.2.3 From 2f911cdf17e98e8ba7f0f7559f3a21708d366769 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 9 Dec 2000 20:36:18 +0000 Subject: define GL_ARB_imaging --- include/GL/gl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 9cde02279a6..11a16dfc925 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.48 2000/12/08 00:28:59 brianp Exp $ */ +/* $Id: gl.h,v 1.49 2000/12/09 20:36:18 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -84,7 +84,7 @@ extern "C" { #define GL_VERSION_1_1 1 #define GL_VERSION_1_2 1 - +#define GL_ARB_imaging 1 /* -- cgit v1.2.3 From 14586916b9b888bec0b08b9646f90e74c0833183 Mon Sep 17 00:00:00 2001 From: Jon Taylor Date: Mon, 11 Dec 2000 05:22:11 +0000 Subject: Added a new configure.in flag, --enable-glut-build. This defaults to "off", so GLUT is not built by default. --- include/GL/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/Makefile.am b/include/GL/Makefile.am index 58aded1d538..9c14afc97c3 100644 --- a/include/GL/Makefile.am +++ b/include/GL/Makefile.am @@ -22,7 +22,7 @@ if HAVE_X11 INC_X11 = glx.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h endif -if NEED_GLUT +if ENABLE_GLUT_BUILD INC_GLUT = glut.h endif -- cgit v1.2.3 From 3afb7a0f7098bb51e539c8e62261df0815ea44d3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 11 Dec 2000 15:42:53 +0000 Subject: disabled GLX_SGIS_multisample (temporarily) since its tokens aren't defined --- include/GL/glxext.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/GL/glxext.h b/include/GL/glxext.h index 63971921c38..a2b3d1e0ef6 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -325,9 +325,12 @@ extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *); typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName); #endif +#if 0 +/* XXX the enums for this extension are missing */ #ifndef GLX_SGIS_multisample #define GLX_SGIS_multisample 1 #endif +#endif #ifndef GLX_EXT_visual_info #define GLX_EXT_visual_info 1 -- cgit v1.2.3 From daabce72db97dc10fce5928169a4b29334b76e5f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 14 Dec 2000 17:44:42 +0000 Subject: updated glXSet3DfxModeMESA() prototype types --- include/GL/glx.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 5624a95e55b..b55c0a100bc 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.25 2000/12/08 18:08:15 brianp Exp $ */ +/* $Id: glx.h,v 1.26 2000/12/14 17:44:42 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -414,7 +414,7 @@ extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d ); #define GLX_3DFX_WINDOW_MODE_MESA 0x1 #define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 -extern GLboolean glXSet3DfxModeMESA( GLint mode ); +extern Bool glXSet3DfxModeMESA( int mode ); #endif /* GLX_MESA_set_3dfx_mode */ -- cgit v1.2.3 From 05ecec6f49732d8804982cdb350798a9fc7b81d9 Mon Sep 17 00:00:00 2001 From: pesco Date: Thu, 21 Dec 2000 20:04:14 +0000 Subject: * include/GL/Makefile.am: ENABLE_GLUT_BUILD -> NEED_GLUT * bootstrap: Fixed stupid mistakes. * configure.in (LIBGL_VERSION): Include Mesa version as tiny number. (LIBGLU_VERSION): Likewise. --- include/GL/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/Makefile.am b/include/GL/Makefile.am index 9c14afc97c3..58aded1d538 100644 --- a/include/GL/Makefile.am +++ b/include/GL/Makefile.am @@ -22,7 +22,7 @@ if HAVE_X11 INC_X11 = glx.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h endif -if ENABLE_GLUT_BUILD +if NEED_GLUT INC_GLUT = glut.h endif -- cgit v1.2.3 From d1ff1f6798b003a820f5de9fad835ff352f31afe Mon Sep 17 00:00:00 2001 From: pesco Date: Sun, 24 Dec 2000 22:53:54 +0000 Subject: * demos/Makefile.am (INCLUDES): Added -I$(top_srcdir)/util. * demos/Makefile.X11, demos/Makefile.BeOS-R4, demos/Makefile.cygnus: Essentially the same. Program files updated to include "readtex.c", not "../util/readtex.c". * demos/reflect.c: Likewise for "showbuffer.c". * Makefile.am (EXTRA_DIST): Added top-level regular files. * include/GL/Makefile.am (INC_X11): Added glxext.h. * src/GGI/include/ggi/mesa/Makefile.am (EXTRA_HEADERS): Include Mesa GGI headers in dist even if HAVE_GGI is not given. * configure.in: Look for GLUT and demo source dirs in $srcdir. * src/swrast/Makefile.am (libMesaSwrast_la_SOURCES): Set to *.[ch]. More source list updates in various Makefile.am's. * Makefile.am (dist-hook): Remove CVS directory from distribution. (DIST_SUBDIRS): List all possible subdirs here. (SUBDIRS): Only list subdirs selected for build again. The above two applied to all subdir Makefile.am's also. --- include/GL/Makefile.am | 28 ++++++++++++++++++---------- progs/demos/Makefile.BeOS-R4 | 4 ++-- progs/demos/Makefile.X11 | 4 ++-- progs/demos/Makefile.cygnus | 4 ++-- progs/demos/drawpix.c | 30 ++++++++++++++++++++++++++++-- progs/demos/fire.c | 2 +- progs/demos/gloss.c | 4 ++-- progs/demos/ipers.c | 2 +- progs/demos/isosurf.c | 4 ++-- progs/demos/lodbias.c | 2 +- progs/demos/multiarb.c | 30 ++++++++++++++++++++++++++++-- progs/demos/pixeltex.c | 2 +- progs/demos/reflect.c | 6 +++--- progs/demos/teapot.c | 2 +- progs/demos/texcyl.c | 30 ++++++++++++++++++++++++++++-- progs/demos/tunnel.c | 2 +- progs/demos/tunnel2.c | 2 +- progs/demos/winpos.c | 30 ++++++++++++++++++++++++++++-- 18 files changed, 150 insertions(+), 38 deletions(-) (limited to 'include') diff --git a/include/GL/Makefile.am b/include/GL/Makefile.am index 58aded1d538..328357031b5 100644 --- a/include/GL/Makefile.am +++ b/include/GL/Makefile.am @@ -2,33 +2,41 @@ GLincludedir = $(includedir)/GL -if HAVE_FX INC_FX = fxmesa.h +INC_GGI = ggimesa.h +INC_OSMESA = osmesa.h +INC_SVGA = svgamesa.h +INC_X11 = glx.h glxext.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h +INC_GLUT = glut.h glutf90.h + +if HAVE_FX +sel_inc_fx = $(INC_FX) endif if HAVE_GGI -INC_GGI = ggimesa.h +sel_inc_ggi = $(INC_GGI) endif if HAVE_OSMESA -INC_OSMESA = osmesa.h +sel_inc_osmesa = $(INC_OSMESA) endif if HAVE_SVGA -INC_SVGA = svgamesa.h +sel_inc_svga = $(INC_SVGA) endif if HAVE_X11 -INC_X11 = glx.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h +sel_inc_x11 = $(INC_X11) endif if NEED_GLUT -INC_GLUT = glut.h +sel_inc_glut = $(INC_GLUT) 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 \ +EXTRA_HEADERS = amesa.h dosmesa.h foomesa.h glut_h.dja mesa_wgl.h mglmesa.h \ + vms_x_fix.h wmesa.h \ $(INC_FX) $(INC_GGI) $(INC_OSMESA) $(INC_SVGA) $(INC_X11) $(INC_GLUT) +GLinclude_HEADERS = gl.h glext.h gl_mangle.h glu.h glu_mangle.h \ + $(sel_inc_fx) $(sel_inc_ggi) $(sel_inc_osmesa) $(sel_inc_svga) \ + $(sel_inc_x11) $(sel_inc_glut) diff --git a/progs/demos/Makefile.BeOS-R4 b/progs/demos/Makefile.BeOS-R4 index ff3c675369e..dc8156bd237 100644 --- a/progs/demos/Makefile.BeOS-R4 +++ b/progs/demos/Makefile.BeOS-R4 @@ -1,4 +1,4 @@ -# $Id: Makefile.BeOS-R4,v 1.12 2000/06/27 16:54:18 brianp Exp $ +# $Id: Makefile.BeOS-R4,v 1.13 2000/12/24 22:53:54 pesco Exp $ # Mesa 3-D graphics library # Version: 3.3 @@ -64,7 +64,7 @@ PROGS = bounce \ .SUFFIXES: .c .c: $(LIB_DEP) - $(CC) -I$(INCDIR) $(CFLAGS) $< $(GL_LIBS) -o $@ + $(CC) -I$(INCDIR) -I../util $(CFLAGS) $< $(GL_LIBS) -o $@ diff --git a/progs/demos/Makefile.X11 b/progs/demos/Makefile.X11 index 395d102f4a1..41175a1c574 100644 --- a/progs/demos/Makefile.X11 +++ b/progs/demos/Makefile.X11 @@ -1,4 +1,4 @@ -# $Id: Makefile.X11,v 1.15 2000/11/01 16:02:52 brianp Exp $ +# $Id: Makefile.X11,v 1.16 2000/12/24 22:53:54 pesco Exp $ # Mesa 3-D graphics library # Version: 3.5 @@ -67,7 +67,7 @@ PROGS = bounce \ # make executable from .c file: .c: $(LIB_DEP) - $(CC) -I$(INCDIR) $(CFLAGS) $< $(GL_LIBS) -o $@ + $(CC) -I$(INCDIR) -I../util $(CFLAGS) $< $(GL_LIBS) -o $@ # special case: need the -lOSMesa library: osdemo: osdemo.c diff --git a/progs/demos/Makefile.cygnus b/progs/demos/Makefile.cygnus index 1e5ab0f0ec8..c41c4a60281 100644 --- a/progs/demos/Makefile.cygnus +++ b/progs/demos/Makefile.cygnus @@ -1,4 +1,4 @@ -# $Id: Makefile.cygnus,v 1.11 2000/06/27 16:54:18 brianp Exp $ +# $Id: Makefile.cygnus,v 1.12 2000/12/24 22:53:54 pesco Exp $ # Mesa 3-D graphics library # Version: 3.3 @@ -66,7 +66,7 @@ PROGS = bounce \ .SUFFIXES: .c .c: $(LIB_DEP) - $(CC) -I$(INCDIR) $(CFLAGS) $< $(GL_LIBS) -o $@ + $(CC) -I$(INCDIR) -I../util $(CFLAGS) $< $(GL_LIBS) -o $@ ##### TARGETS ##### diff --git a/progs/demos/drawpix.c b/progs/demos/drawpix.c index f86b1386b2a..b0496c5c6ba 100644 --- a/progs/demos/drawpix.c +++ b/progs/demos/drawpix.c @@ -1,4 +1,4 @@ -/* $Id: drawpix.c,v 1.4 2000/09/08 21:45:21 brianp Exp $ */ +/* $Id: drawpix.c,v 1.5 2000/12/24 22:53:54 pesco Exp $ */ /* * glDrawPixels demo/test/benchmark @@ -8,6 +8,32 @@ /* * $Log: drawpix.c,v $ + * Revision 1.5 2000/12/24 22:53:54 pesco + * * demos/Makefile.am (INCLUDES): Added -I$(top_srcdir)/util. + * * demos/Makefile.X11, demos/Makefile.BeOS-R4, demos/Makefile.cygnus: + * Essentially the same. + * Program files updated to include "readtex.c", not "../util/readtex.c". + * * demos/reflect.c: Likewise for "showbuffer.c". + * + * + * * Makefile.am (EXTRA_DIST): Added top-level regular files. + * + * * include/GL/Makefile.am (INC_X11): Added glxext.h. + * + * + * * src/GGI/include/ggi/mesa/Makefile.am (EXTRA_HEADERS): Include + * Mesa GGI headers in dist even if HAVE_GGI is not given. + * + * * configure.in: Look for GLUT and demo source dirs in $srcdir. + * + * * src/swrast/Makefile.am (libMesaSwrast_la_SOURCES): Set to *.[ch]. + * More source list updates in various Makefile.am's. + * + * * Makefile.am (dist-hook): Remove CVS directory from distribution. + * (DIST_SUBDIRS): List all possible subdirs here. + * (SUBDIRS): Only list subdirs selected for build again. + * The above two applied to all subdir Makefile.am's also. + * * Revision 1.4 2000/09/08 21:45:21 brianp * added dither key option * @@ -40,7 +66,7 @@ #include #include -#include "../util/readtex.c" /* a hack, I know */ +#include "readtex.c" #define IMAGE_FILE "../images/girl.rgb" diff --git a/progs/demos/fire.c b/progs/demos/fire.c index 100df815651..6fa335cef80 100644 --- a/progs/demos/fire.c +++ b/progs/demos/fire.c @@ -17,7 +17,7 @@ #endif #include -#include "../util/readtex.c" +#include "readtex.c" #ifdef XMESA #include "GL/xmesa.h" diff --git a/progs/demos/gloss.c b/progs/demos/gloss.c index 228e448594b..f39d8d16092 100644 --- a/progs/demos/gloss.c +++ b/progs/demos/gloss.c @@ -1,4 +1,4 @@ -/* $Id: gloss.c,v 1.5 2000/08/29 21:17:38 brianp Exp $ */ +/* $Id: gloss.c,v 1.6 2000/12/24 22:53:54 pesco Exp $ */ /* * Specular reflection demo. The specular highlight is modulated by @@ -24,7 +24,7 @@ #include #include -#include "../util/readtex.c" /* I know, this is a hack. */ +#include "readtex.c" /* I know, this is a hack. */ #define SPECULAR_TEXTURE_FILE "../images/reflect.rgb" #define BASE_TEXTURE_FILE "../images/tile.rgb" diff --git a/progs/demos/ipers.c b/progs/demos/ipers.c index aa15d67b534..d38c4d1ae88 100644 --- a/progs/demos/ipers.c +++ b/progs/demos/ipers.c @@ -18,7 +18,7 @@ #include -#include "../util/readtex.c" +#include "readtex.c" #ifdef XMESA #include "GL/xmesa.h" diff --git a/progs/demos/isosurf.c b/progs/demos/isosurf.c index a25848d50b1..d5b0ceb500a 100644 --- a/progs/demos/isosurf.c +++ b/progs/demos/isosurf.c @@ -1,4 +1,4 @@ -/* $Id: isosurf.c,v 1.6 2000/06/27 17:04:43 brianp Exp $ */ +/* $Id: isosurf.c,v 1.7 2000/12/24 22:53:54 pesco Exp $ */ /* * Display an isosurface of 3-D wind speed volume. @@ -33,7 +33,7 @@ #define GL_GLEXT_LEGACY #include "GL/glut.h" -#include "../util/readtex.c" /* I know, this is a hack. KW: me too. */ +#include "readtex.c" /* I know, this is a hack. KW: me too. */ #define TEXTURE_FILE "../images/reflect.rgb" #define LIT 0x1 diff --git a/progs/demos/lodbias.c b/progs/demos/lodbias.c index 1d01502d97d..b2fab0b4eb7 100644 --- a/progs/demos/lodbias.c +++ b/progs/demos/lodbias.c @@ -33,7 +33,7 @@ #include #include -#include "../util/readtex.c" /* I know, this is a hack. */ +#include "readtex.c" /* I know, this is a hack. */ #define TEXTURE_FILE "../images/girl.rgb" diff --git a/progs/demos/multiarb.c b/progs/demos/multiarb.c index aa0beb9bc75..2d730988a12 100644 --- a/progs/demos/multiarb.c +++ b/progs/demos/multiarb.c @@ -1,4 +1,4 @@ -/* $Id: multiarb.c,v 1.7 2000/11/01 16:02:01 brianp Exp $ */ +/* $Id: multiarb.c,v 1.8 2000/12/24 22:53:54 pesco Exp $ */ /* * GL_ARB_multitexture demo @@ -12,6 +12,32 @@ /* * $Log: multiarb.c,v $ + * Revision 1.8 2000/12/24 22:53:54 pesco + * * demos/Makefile.am (INCLUDES): Added -I$(top_srcdir)/util. + * * demos/Makefile.X11, demos/Makefile.BeOS-R4, demos/Makefile.cygnus: + * Essentially the same. + * Program files updated to include "readtex.c", not "../util/readtex.c". + * * demos/reflect.c: Likewise for "showbuffer.c". + * + * + * * Makefile.am (EXTRA_DIST): Added top-level regular files. + * + * * include/GL/Makefile.am (INC_X11): Added glxext.h. + * + * + * * src/GGI/include/ggi/mesa/Makefile.am (EXTRA_HEADERS): Include + * Mesa GGI headers in dist even if HAVE_GGI is not given. + * + * * configure.in: Look for GLUT and demo source dirs in $srcdir. + * + * * src/swrast/Makefile.am (libMesaSwrast_la_SOURCES): Set to *.[ch]. + * More source list updates in various Makefile.am's. + * + * * Makefile.am (dist-hook): Remove CVS directory from distribution. + * (DIST_SUBDIRS): List all possible subdirs here. + * (SUBDIRS): Only list subdirs selected for build again. + * The above two applied to all subdir Makefile.am's also. + * * Revision 1.7 2000/11/01 16:02:01 brianp * print number of texture units * @@ -51,7 +77,7 @@ #include #include -#include "../util/readtex.c" /* I know, this is a hack. */ +#include "readtex.c" /* I know, this is a hack. */ #define TEXTURE_1_FILE "../images/girl.rgb" #define TEXTURE_2_FILE "../images/reflect.rgb" diff --git a/progs/demos/pixeltex.c b/progs/demos/pixeltex.c index 4516b3f8631..96e46ef9294 100644 --- a/progs/demos/pixeltex.c +++ b/progs/demos/pixeltex.c @@ -56,7 +56,7 @@ #include #include #include -#include "../util/readtex.c" /* I know, this is a hack. */ +#include "readtex.c" /* I know, this is a hack. */ #define TEXTURE_FILE "../images/girl.rgb" diff --git a/progs/demos/reflect.c b/progs/demos/reflect.c index 6713e042f60..0d72c9d8d67 100644 --- a/progs/demos/reflect.c +++ b/progs/demos/reflect.c @@ -1,4 +1,4 @@ -/* $Id: reflect.c,v 1.4 2000/09/15 16:43:57 brianp Exp $ */ +/* $Id: reflect.c,v 1.5 2000/12/24 22:53:54 pesco Exp $ */ /* * Demo of a reflective, texture-mapped surface with OpenGL. @@ -32,8 +32,8 @@ #include #include #include "GL/glut.h" -#include "../util/showbuffer.c" -#include "../util/readtex.c" +#include "showbuffer.c" +#include "readtex.c" #define DEG2RAD (3.14159/180.0) diff --git a/progs/demos/teapot.c b/progs/demos/teapot.c index 93d1fcba5f7..cb1ba4b8272 100644 --- a/progs/demos/teapot.c +++ b/progs/demos/teapot.c @@ -16,7 +16,7 @@ #endif #include -#include "../util/readtex.c" +#include "readtex.c" #include "shadow.c" #ifdef XMESA diff --git a/progs/demos/texcyl.c b/progs/demos/texcyl.c index a0e6224999e..30aded2b3ed 100644 --- a/progs/demos/texcyl.c +++ b/progs/demos/texcyl.c @@ -1,4 +1,4 @@ -/* $Id: texcyl.c,v 1.3 2000/09/29 23:09:39 brianp Exp $ */ +/* $Id: texcyl.c,v 1.4 2000/12/24 22:53:54 pesco Exp $ */ /* * Textured cylinder demo: lighting, texturing, reflection mapping. @@ -12,6 +12,32 @@ /* * $Log: texcyl.c,v $ + * Revision 1.4 2000/12/24 22:53:54 pesco + * * demos/Makefile.am (INCLUDES): Added -I$(top_srcdir)/util. + * * demos/Makefile.X11, demos/Makefile.BeOS-R4, demos/Makefile.cygnus: + * Essentially the same. + * Program files updated to include "readtex.c", not "../util/readtex.c". + * * demos/reflect.c: Likewise for "showbuffer.c". + * + * + * * Makefile.am (EXTRA_DIST): Added top-level regular files. + * + * * include/GL/Makefile.am (INC_X11): Added glxext.h. + * + * + * * src/GGI/include/ggi/mesa/Makefile.am (EXTRA_HEADERS): Include + * Mesa GGI headers in dist even if HAVE_GGI is not given. + * + * * configure.in: Look for GLUT and demo source dirs in $srcdir. + * + * * src/swrast/Makefile.am (libMesaSwrast_la_SOURCES): Set to *.[ch]. + * More source list updates in various Makefile.am's. + * + * * Makefile.am (dist-hook): Remove CVS directory from distribution. + * (DIST_SUBDIRS): List all possible subdirs here. + * (SUBDIRS): Only list subdirs selected for build again. + * The above two applied to all subdir Makefile.am's also. + * * Revision 1.3 2000/09/29 23:09:39 brianp * added fps output * @@ -41,7 +67,7 @@ #include #include -#include "../util/readtex.c" /* I know, this is a hack. */ +#include "readtex.c" /* I know, this is a hack. */ #define TEXTURE_FILE "../images/reflect.rgb" diff --git a/progs/demos/tunnel.c b/progs/demos/tunnel.c index 431d2866030..2244024aaa3 100644 --- a/progs/demos/tunnel.c +++ b/progs/demos/tunnel.c @@ -16,7 +16,7 @@ #endif #include -#include "../util/readtex.c" +#include "readtex.c" #include "tunneldat.c" #ifdef XMESA diff --git a/progs/demos/tunnel2.c b/progs/demos/tunnel2.c index e82c2c604dc..3a6e9f88434 100644 --- a/progs/demos/tunnel2.c +++ b/progs/demos/tunnel2.c @@ -19,7 +19,7 @@ #endif #include -#include "../util/readtex.c" +#include "readtex.c" #include "tunneldat.c" #ifdef FX diff --git a/progs/demos/winpos.c b/progs/demos/winpos.c index 7001165deef..b799657b8e9 100644 --- a/progs/demos/winpos.c +++ b/progs/demos/winpos.c @@ -1,4 +1,4 @@ -/* $Id: winpos.c,v 1.2 2000/06/27 17:04:43 brianp Exp $ */ +/* $Id: winpos.c,v 1.3 2000/12/24 22:53:54 pesco Exp $ */ /* * Example of how to use the GL_MESA_window_pos extension. @@ -8,6 +8,32 @@ /* * $Log: winpos.c,v $ + * Revision 1.3 2000/12/24 22:53:54 pesco + * * demos/Makefile.am (INCLUDES): Added -I$(top_srcdir)/util. + * * demos/Makefile.X11, demos/Makefile.BeOS-R4, demos/Makefile.cygnus: + * Essentially the same. + * Program files updated to include "readtex.c", not "../util/readtex.c". + * * demos/reflect.c: Likewise for "showbuffer.c". + * + * + * * Makefile.am (EXTRA_DIST): Added top-level regular files. + * + * * include/GL/Makefile.am (INC_X11): Added glxext.h. + * + * + * * src/GGI/include/ggi/mesa/Makefile.am (EXTRA_HEADERS): Include + * Mesa GGI headers in dist even if HAVE_GGI is not given. + * + * * configure.in: Look for GLUT and demo source dirs in $srcdir. + * + * * src/swrast/Makefile.am (libMesaSwrast_la_SOURCES): Set to *.[ch]. + * More source list updates in various Makefile.am's. + * + * * Makefile.am (dist-hook): Remove CVS directory from distribution. + * (DIST_SUBDIRS): List all possible subdirs here. + * (SUBDIRS): Only list subdirs selected for build again. + * The above two applied to all subdir Makefile.am's also. + * * Revision 1.2 2000/06/27 17:04:43 brianp * fixed compiler warnings * @@ -36,7 +62,7 @@ #define GL_GLEXT_LEGACY #include "GL/glut.h" -#include "../util/readtex.c" /* a hack, I know */ +#include "readtex.c" /* a hack, I know */ #define IMAGE_FILE "../images/girl.rgb" -- cgit v1.2.3 From ba8f6172bdfb44594537a304225b54152584d701 Mon Sep 17 00:00:00 2001 From: Gareth Hughes Date: Sat, 6 Jan 2001 22:46:13 +0000 Subject: Implementation of GL_EXT_texture_env_dot3. --- include/GL/gl.h | 15 ++++++++++++- include/GL/glext.h | 13 +++++++---- src/mesa/main/enums.c | 44 +++++++++++++++++++----------------- src/mesa/main/extensions.c | 4 +++- src/mesa/main/mtypes.h | 55 +++++++++++++++++++++++---------------------- src/mesa/main/texstate.c | 21 +++++++++++------ src/mesa/swrast/s_texture.c | 47 +++++++++++++++++++++++++++++++------- 7 files changed, 131 insertions(+), 68 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 11a16dfc925..f261a672b44 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.49 2000/12/09 20:36:18 brianp Exp $ */ +/* $Id: gl.h,v 1.50 2001/01/06 22:46:13 gareth Exp $ */ /* * Mesa 3-D graphics library @@ -2228,6 +2228,19 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); #endif /* GL_MESA_resize_bufffers */ + +/* + * 220. GL_EXT_texture_env_dot3 + */ +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 + +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 + +#endif /* GL_EXT_texture_env_dot3 */ + + #else /* GL_GLEXT_LEGACY */ #include diff --git a/include/GL/glext.h b/include/GL/glext.h index f721a9fd70a..aa69c184c28 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -13,21 +13,21 @@ extern "C" { ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: This software was created using the ** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has ** not been independently verified as being compliant with the OpenGL(R) @@ -1419,6 +1419,11 @@ extern "C" { #define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF #endif +#ifndef GL_EXT_texture_env_dot3 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#endif + /*************************************************************/ diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index bdf247fecf9..67087536d44 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -1,21 +1,21 @@ -/* $Id: enums.c,v 1.9 2000/06/27 21:42:13 brianp Exp $ */ +/* $Id: enums.c,v 1.10 2001/01/06 22:46:13 gareth 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 @@ -34,12 +34,12 @@ #endif -typedef struct { - const char *c; - int n; +typedef struct { + const char *c; + int n; } enum_elt; -enum_elt all_enums[] = +enum_elt all_enums[] = { /* Boolean values */ { "GL_FALSE", 0 }, @@ -828,7 +828,11 @@ enum_elt all_enums[] = { "GL_INTERPOLATE_EXT", 0x8575 }, { "GL_CONSTANT_EXT", 0x8576 }, { "GL_PRIMARY_COLOR_EXT", 0x8577 }, - { "GL_PREVIOUS_EXT", 0x8578 } + { "GL_PREVIOUS_EXT", 0x8578 }, + + /* GL_EXT_texture_env_dot3 */ + { "GL_DOT3_RGB_EXT", 0x8740 }, + { "GL_DOT3_RGBA_EXT", 0x8741 }, }; @@ -839,7 +843,7 @@ typedef int (GLWINAPIV *cfunc)(const void *, const void *); static enum_elt **index1 = 0; static int sorted = 0; -static int compar_name( const enum_elt *a, const enum_elt *b ) +static int compar_name( const enum_elt *a, const enum_elt *b ) { return strcmp(a->c, b->c); } @@ -847,7 +851,7 @@ static int compar_name( const enum_elt *a, const enum_elt *b ) /* note the extra level of indirection */ -static int compar_nr( const enum_elt **a, const enum_elt **b ) +static int compar_nr( const enum_elt **a, const enum_elt **b ) { return (*a)->n - (*b)->n; } @@ -859,10 +863,10 @@ static void sort_enums( void ) index1 = (enum_elt **)MALLOC( Elements(all_enums) * sizeof(enum_elt *) ); sorted = 1; - qsort( all_enums, Elements(all_enums), sizeof(*all_enums), + qsort( all_enums, Elements(all_enums), sizeof(*all_enums), (cfunc) compar_name ); - for (i = 0 ; i < Elements(all_enums) ; i++) + for (i = 0 ; i < Elements(all_enums) ; i++) index1[i] = &all_enums[i]; qsort( index1, Elements(all_enums), sizeof(*index1), (cfunc) compar_nr ); @@ -875,14 +879,14 @@ int gl_lookup_enum_by_name( const char *symbol ) enum_elt tmp; enum_elt *e; - if (!sorted) + if (!sorted) sort_enums(); - if (!symbol) + if (!symbol) return 0; tmp.c = symbol; - e = (enum_elt *)bsearch( &tmp, all_enums, Elements(all_enums), + e = (enum_elt *)bsearch( &tmp, all_enums, Elements(all_enums), sizeof(*all_enums), (cfunc) compar_name ); return e ? e->n : -1; @@ -893,13 +897,13 @@ const char *gl_lookup_enum_by_nr( int nr ) { enum_elt tmp, *e, **f; - if (!sorted) + if (!sorted) sort_enums(); tmp.n = nr; e = &tmp; - f = (enum_elt **)bsearch( &e, index1, Elements(all_enums), + f = (enum_elt **)bsearch( &e, index1, Elements(all_enums), sizeof(*index1), (cfunc) compar_nr ); return f ? (*f)->c : "(unknown)"; @@ -920,6 +924,6 @@ int main() for (i = 0 ; i < Elements(test) ; i++) { int d = gl_lookup_enum_by_name( test[i] ); printf("%s --> %d --> %s\n", test[i], d, gl_lookup_enum_by_nr( d )); - } + } } #endif diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 6c0645b84b8..d414c0f31f8 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -1,4 +1,4 @@ -/* $Id: extensions.c,v 1.43 2000/12/08 00:20:15 brianp Exp $ */ +/* $Id: extensions.c,v 1.44 2001/01/06 22:46:13 gareth Exp $ */ /* * Mesa 3-D graphics library @@ -87,6 +87,7 @@ static struct { { OFF, "GL_EXT_texture_compression_s3tc", F(EXT_texture_compression_s3tc) }, { ON, "GL_EXT_texture_env_add", F(EXT_texture_env_add) }, { OFF, "GL_EXT_texture_env_combine", F(EXT_texture_env_combine) }, + { OFF, "GL_EXT_texture_env_dot3", F(EXT_texture_env_dot3) }, { ON, "GL_EXT_texture_object", F(EXT_texture_object) }, { ON, "GL_EXT_texture_lod_bias", F(EXT_texture_lod_bias) }, { ON, "GL_EXT_vertex_array", 0 }, @@ -120,6 +121,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) gl_extensions_enable(ctx, "GL_ARB_texture_cube_map"); gl_extensions_enable(ctx, "GL_EXT_bgra"); gl_extensions_enable(ctx, "GL_EXT_texture_env_combine"); + gl_extensions_enable(ctx, "GL_EXT_texture_env_dot3"); gl_extensions_enable(ctx, "GL_HP_occlusion_test"); gl_extensions_enable(ctx, "GL_NV_blend_square"); gl_extensions_enable(ctx, "GL_MESA_sprite_point"); diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 913c2f2fb5b..ee46c6d8889 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1,21 +1,21 @@ -/* $Id: mtypes.h,v 1.10 2001/01/05 02:26:48 keithw Exp $ */ +/* $Id: mtypes.h,v 1.11 2001/01/06 22:46:13 gareth Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 - * + * * 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 @@ -27,7 +27,7 @@ #ifndef TYPES_H #define TYPES_H - + #include "glheader.h" #include "config.h" /* Hardwired parameters */ @@ -211,7 +211,7 @@ struct gl_light { GLfloat _VP_inf_norm[3]; /* Norm direction to infinite light */ GLfloat _h_inf_norm[3]; /* Norm( _VP_inf_norm + <0,0,1> ) */ GLfloat _NormDirection[4]; /* normalized spotlight direction */ - GLfloat _VP_inf_spot_attenuation; + GLfloat _VP_inf_spot_attenuation; GLfloat _SpotExpTable[EXP_TABLE_SIZE][2]; /* to replace a pow() call */ GLfloat _MatAmbient[2][3]; /* material ambient * light ambient */ @@ -231,7 +231,7 @@ struct gl_lightmodel { }; -struct gl_material +struct gl_material { GLfloat Ambient[4]; GLfloat Diffuse[4]; @@ -308,7 +308,7 @@ struct gl_current_attrib { GLuint Index; /* Current color index */ GLboolean EdgeFlag; /* Current edge flag */ GLfloat Texcoord[MAX_TEXTURE_UNITS][4]; /* Current texture coords */ - + /* These values are always valid. */ GLfloat RasterPos[4]; /* Current raster position */ @@ -744,7 +744,7 @@ struct gl_stencil_attrib { #define ENABLE_TEXMAT1 0x200 #define ENABLE_TEXMAT2 0x400 #define ENABLE_TEXMAT3 0x800 -#define ENABLE_TEXMAT4 0x1000 +#define ENABLE_TEXMAT4 0x1000 #define ENABLE_TEXMAT5 0x2000 #define ENABLE_TEXMAT6 0x4000 #define ENABLE_TEXMAT7 0x8000 @@ -910,7 +910,7 @@ struct gl_texture_attrib { GLuint _GenFlags; /* for texgen */ struct gl_texture_unit Unit[MAX_TEXTURE_UNITS]; - + struct gl_texture_object *Proxy1D; struct gl_texture_object *Proxy2D; struct gl_texture_object *Proxy3D; @@ -1033,7 +1033,7 @@ struct gl_1d_map { GLfloat u1, u2, du; /* u1, u2, 1.0/(u2-u1) */ GLfloat *Points; /* Points to contiguous control points */ }; - + /* * 2-D Evaluator control points @@ -1231,6 +1231,7 @@ struct gl_extensions { GLboolean EXT_texture_compression_s3tc; GLboolean EXT_texture_env_add; GLboolean EXT_texture_env_combine; + GLboolean EXT_texture_env_dot3; GLboolean EXT_texture_object; GLboolean EXT_texture_lod_bias; GLboolean EXT_vertex_array_set; @@ -1321,18 +1322,18 @@ struct gl_extensions { /* Bits to track array state changes (also used to summarize array enabled) */ -#define _NEW_ARRAY_VERTEX 0x1 -#define _NEW_ARRAY_COLOR 0x2 -#define _NEW_ARRAY_NORMAL 0x4 -#define _NEW_ARRAY_INDEX 0x8 +#define _NEW_ARRAY_VERTEX 0x1 +#define _NEW_ARRAY_COLOR 0x2 +#define _NEW_ARRAY_NORMAL 0x4 +#define _NEW_ARRAY_INDEX 0x8 #define _NEW_ARRAY_EDGEFLAG 0x10 #define _NEW_ARRAY_SECONDARYCOLOR 0x20 #define _NEW_ARRAY_FOGCOORD 0x40 -#define _NEW_ARRAY_TEXCOORD_0 0x80 +#define _NEW_ARRAY_TEXCOORD_0 0x80 #define _NEW_ARRAY_TEXCOORD_1 0x100 #define _NEW_ARRAY_TEXCOORD_2 0x200 #define _NEW_ARRAY_TEXCOORD_3 0x400 -#define _NEW_ARRAY_TEXCOORD_4 0x800 +#define _NEW_ARRAY_TEXCOORD_4 0x800 #define _NEW_ARRAY_TEXCOORD_5 0x1000 #define _NEW_ARRAY_TEXCOORD_6 0x2000 #define _NEW_ARRAY_TEXCOORD_7 0x4000 @@ -1359,7 +1360,7 @@ struct gl_extensions { #define DD_POINT_ATTEN 0x10000 #define DD_TRI_CULL_FRONT_BACK 0x400000 /* special case on some hw */ #define DD_Z_NEVER 0x800000 /* special case on some hw */ -#define DD_STENCIL 0x1000000 +#define DD_STENCIL 0x1000000 /* Define the state changes under which each of these bits might change */ @@ -1380,7 +1381,7 @@ struct gl_extensions { #define _DD_NEW_POINT_SIZE _NEW_POINT #define _DD_NEW_POINT_ATTEN _NEW_POINT #define _DD_NEW_LIGHTING_CULL _NEW_LIGHT -#define _DD_NEW_TRI_CULL_FRONT_BACK _NEW_POLYGON +#define _DD_NEW_TRI_CULL_FRONT_BACK _NEW_POLYGON #define _DD_NEW_Z_NEVER _NEW_DEPTH #define _DD_NEW_STENCIL _NEW_STENCIL @@ -1388,7 +1389,7 @@ struct gl_extensions { #define _MESA_NEW_NEED_EYE_COORDS (_NEW_LIGHT| \ _NEW_TEXTURE| \ _NEW_POINT| \ - _NEW_MODELVIEW) + _NEW_MODELVIEW) #define _MESA_NEW_NEED_NORMALS (_NEW_LIGHT| \ _NEW_TEXTURE) @@ -1420,7 +1421,7 @@ typedef union node Node; /* - * The library context: + * The library context: */ struct __GLcontextRec { /* @@ -1438,7 +1439,7 @@ struct __GLcontextRec { struct _glapi_table *Save; /* Display list save funcs */ struct _glapi_table *Exec; /* Execute funcs */ struct _glapi_table *CurrentDispatch; /* == Save or Exec !! */ - + GLboolean ExecPrefersFloat; /* What preference for color conversion? */ GLboolean SavePrefersFloat; @@ -1566,7 +1567,7 @@ struct __GLcontextRec { /* Should 3Dfx Glide driver catch signals? */ GLboolean CatchSignals; - + /* For debugging/development only */ GLboolean NoRaster; GLboolean FirstTimeCurrent; @@ -1601,7 +1602,7 @@ extern GLenum gl_reduce_prim[]; #ifdef MESA_DEBUG -extern int MESA_VERBOSE; +extern int MESA_VERBOSE; extern int MESA_DEBUG_FLAGS; #else # define MESA_VERBOSE 0 @@ -1622,12 +1623,12 @@ enum _verbose { VERBOSE_API = 0x40, VERBOSE_DISPLAY_LIST = 0x200, VERBOSE_LIGHTING = 0x400 -}; +}; enum _debug { DEBUG_ALWAYS_FLUSH = 0x1 -}; +}; diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index a34d60653df..9bf4bbb3c87 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1,4 +1,4 @@ -/* $Id: texstate.c,v 1.26 2000/12/26 05:09:29 keithw Exp $ */ +/* $Id: texstate.c,v 1.27 2001/01/06 22:46:13 gareth Exp $ */ /* * Mesa 3-D graphics library @@ -100,7 +100,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) } if (texUnit->EnvMode == mode) - return; + return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); texUnit->EnvMode = mode; break; @@ -117,7 +117,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) COPY_4FV(texUnit->EnvColor, tmp); break; } - case GL_COMBINE_RGB_EXT: + case GL_COMBINE_RGB_EXT: if (ctx->Extensions.EXT_texture_env_combine) { GLenum mode = (GLenum) (GLint) *param; switch (mode) { @@ -127,12 +127,19 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) case GL_ADD_SIGNED_EXT: case GL_INTERPOLATE_EXT: break; + case GL_DOT3_RGB_EXT: + case GL_DOT3_RGBA_EXT: + if (!ctx->Extensions.EXT_texture_env_dot3) { + gl_error(ctx, GL_INVALID_ENUM, "glTexEnv(param)"); + return; + } + break; default: gl_error( ctx, GL_INVALID_ENUM, "glTexEnv(param)" ); return; } if (texUnit->CombineModeRGB == mode) - return; + return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); texUnit->CombineModeRGB = mode; } @@ -140,7 +147,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) gl_error(ctx, GL_INVALID_ENUM, "glTexEnv(pname)"); return; } - case GL_COMBINE_ALPHA_EXT: + case GL_COMBINE_ALPHA_EXT: if (ctx->Extensions.EXT_texture_env_combine) { GLenum mode = (GLenum) (GLint) *param; switch (mode) { @@ -150,7 +157,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) case GL_ADD_SIGNED_EXT: case GL_INTERPOLATE_EXT: if (texUnit->CombineModeA == mode) - return; + return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); texUnit->CombineModeA = mode; break; @@ -1326,7 +1333,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) gl_error( ctx, GL_INVALID_ENUM, "glTexGenfv(coord)" ); return; } - + if (ctx->Driver.TexGen) ctx->Driver.TexGen( ctx, coord, pname, params ); } diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index b4c81fad02e..1123cdcdafa 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -1,21 +1,21 @@ -/* $Id: s_texture.c,v 1.7 2001/01/05 21:28:31 brianp Exp $ */ +/* $Id: s_texture.c,v 1.8 2001/01/06 22:46:13 gareth Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 - * + * * 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 @@ -197,7 +197,7 @@ palette_sample(const struct gl_texture_object *tObj, } - + /* * Bitflags for texture border color sampling. @@ -1830,6 +1830,7 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, GLuint texUnit, #define PROD(A,B) ( (GLuint)(A) * ((GLuint)(B)+1) ) +#define S_PROD(A,B) ( (GLint)(A) * ((GLint)(B)+1) ) static INLINE void _mesa_texture_combine(const GLcontext *ctx, @@ -2044,6 +2045,28 @@ _mesa_texture_combine(const GLcontext *ctx, } } break; + case GL_DOT3_RGB_EXT: + case GL_DOT3_RGBA_EXT: + { + const GLubyte (*arg0)[4] = (const GLubyte (*)[4]) argRGB[0]; + const GLubyte (*arg1)[4] = (const GLubyte (*)[4]) argRGB[1]; + /* ATI's EXT extension has a constant scale by 4. The ARB + * one will likely remove this restriction, and we should + * drop the EXT extension in favour of the ARB one. + */ + for (i = 0; i < n; i++) { + GLint dot = (S_PROD((GLint)arg0[i][RCOMP] - 128, + (GLint)arg1[i][RCOMP] - 128) + + S_PROD((GLint)arg0[i][GCOMP] - 128, + (GLint)arg1[i][GCOMP] - 128) + + S_PROD((GLint)arg0[i][BCOMP] - 128, + (GLint)arg1[i][BCOMP] - 128)) >> 6; + rgba[i][RCOMP] = (GLubyte) CLAMP(dot, 0, 255); + rgba[i][GCOMP] = (GLubyte) CLAMP(dot, 0, 255); + rgba[i][BCOMP] = (GLubyte) CLAMP(dot, 0, 255); + } + } + break; default: gl_problem(NULL, "invalid combine mode"); } @@ -2114,6 +2137,14 @@ _mesa_texture_combine(const GLcontext *ctx, default: gl_problem(NULL, "invalid combine mode"); } + + /* Fix the alpha component for GL_DOT3_RGBA_EXT combining. + */ + if (textureUnit->CombineModeRGB == GL_DOT3_RGBA_EXT) { + for (i = 0; i < n; i++) { + rgba[i][ACOMP] = rgba[i][RCOMP]; + } + } } #undef PROD @@ -2563,8 +2594,8 @@ _swrast_texture_fragments( GLcontext *ctx, GLuint texUnit, GLuint n, /* Sample the texture. */ SWRAST_CONTEXT(ctx)->TextureSample[texUnit]( ctx, texUnit, - textureUnit->_Current, - n, s, t, r, + textureUnit->_Current, + n, s, t, r, lambda, texel ); apply_texture( ctx, textureUnit, n, primary_rgba, texel, rgba ); -- cgit v1.2.3 From 78477947de9c8a69bd4beec2ef24abd0d142d080 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 8 Jan 2001 03:56:53 +0000 Subject: Moved glcore.h to a location prefixed by 'GL/internal', for compatibility with XFree86 and the SI code there. --- include/GL/internal/glcore-new.h | 424 +++++++++++++++++++++++++++++++++++++++ include/GL/internal/glcore.h | 397 ++++++++++++++++++++++++++++++++++++ 2 files changed, 821 insertions(+) create mode 100644 include/GL/internal/glcore-new.h create mode 100644 include/GL/internal/glcore.h (limited to 'include') diff --git a/include/GL/internal/glcore-new.h b/include/GL/internal/glcore-new.h new file mode 100644 index 00000000000..cd65286bc7a --- /dev/null +++ b/include/GL/internal/glcore-new.h @@ -0,0 +1,424 @@ +#ifndef __gl_core_h_ +#define __gl_core_h_ + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.1 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. This software +** was created using the OpenGL(R) version 1.2.1 Sample Implementation +** published by SGI, but has not been independently verified as being +** compliant with the OpenGL(R) version 1.2.1 Specification. +** +** $Date: 2001/01/08 03:56:53 $ $Revision: 1.1 $ +** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/internal/Attic/glcore-new.h,v 1.1 2001/01/08 03:56:53 keithw Exp $ +*/ + +#ifdef XFree86LOADER +#include "xf86_ansic.h" +#else +#include +#endif + +typedef struct __GLcontextRec __GLcontext; +typedef struct __GLinterfaceRec __GLinterface; + +/* +** This file defines the interface between the GL core and the surrounding +** "operating system" that supports it (currently the GLX or WGL extensions). +** +** Members (data and function pointers) are documented as imported or +** exported according to how they are used by the core rendering functions. +** Imported members are initialized by the "operating system" and used by +** the core functions. Exported members are initialized by the core functions +** and used by the "operating system". +*/ + +/* +** Mode and limit information for a context. This information is +** kept around in the context so that values can be used during +** command execution, and for returning information about the +** context to the application. +*/ +typedef struct __GLcontextModesRec { + GLboolean rgbMode; + GLboolean colorIndexMode; + GLboolean doubleBufferMode; + GLboolean stereoMode; + + GLboolean haveAccumBuffer; + GLboolean haveDepthBuffer; + GLboolean haveStencilBuffer; + + GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */ + GLuint redMask, greenMask, blueMask, alphaMask; + GLint rgbBits; /* total bits for rgb */ + GLint indexBits; /* total bits for colorindex */ + + GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits; + GLint depthBits; + GLint stencilBits; + + GLint numAuxBuffers; + + GLint level; + + GLint pixmapMode; +} __GLcontextModes; + +/************************************************************************/ + +/* +** Structure used for allocating and freeing drawable private memory. +** (like software buffers, for example). +** +** The memory allocation routines are provided by the surrounding +** "operating system" code, and they are to be used for allocating +** software buffers and things which are associated with the drawable, +** and used by any context which draws to that drawable. There are +** separate memory allocation functions for drawables and contexts +** since drawables and contexts can be created and destroyed independently +** of one another, and the "operating system" may want to use separate +** allocation arenas for each. +** +** The freePrivate function is filled in by the core routines when they +** allocates software buffers, and stick them in "private". The freePrivate +** function will destroy anything allocated to this drawable (to be called +** when the drawable is destroyed). +*/ +typedef struct __GLdrawableRegionRec __GLdrawableRegion; +typedef struct __GLdrawableBufferRec __GLdrawableBuffer; +typedef struct __GLdrawablePrivateRec __GLdrawablePrivate; + +typedef struct __GLregionRectRec { + /* lower left (inside the rectangle) */ + GLint x0, y0; + /* upper right (outside the rectangle) */ + GLint x1, y1; +} __GLregionRect; + +struct __GLdrawableRegionRec { + GLint numRects; + __GLregionRect *rects; + __GLregionRect boundingRect; +}; + +/************************************************************************/ + +/* masks for the buffers */ +#define __GL_FRONT_BUFFER_MASK 0x00000001 +#define __GL_FRONT_LEFT_BUFFER_MASK 0x00000001 +#define __GL_FRONT_RIGHT_BUFFER_MASK 0x00000002 +#define __GL_BACK_BUFFER_MASK 0x00000004 +#define __GL_BACK_LEFT_BUFFER_MASK 0x00000004 +#define __GL_BACK_RIGHT_BUFFER_MASK 0x00000008 +#define __GL_ACCUM_BUFFER_MASK 0x00000010 +#define __GL_DEPTH_BUFFER_MASK 0x00000020 +#define __GL_STENCIL_BUFFER_MASK 0x00000040 +#define __GL_AUX_BUFFER_MASK(i) (0x0000080 << (i)) + +#define __GL_ALL_BUFFER_MASK 0xffffffff + +/* what Resize routines return if resize resorted to fallback case */ +#define __GL_BUFFER_FALLBACK 0x10 + +typedef void (*__GLbufFallbackInitFn)(__GLdrawableBuffer *buf, + __GLdrawablePrivate *glPriv, GLint bits); +typedef void (*__GLbufMainInitFn)(__GLdrawableBuffer *buf, + __GLdrawablePrivate *glPriv, GLint bits, + __GLbufFallbackInitFn back); + +/* +** A drawable buffer +** +** This data structure describes the context side of a drawable. +** +** According to the spec there could be multiple contexts bound to the same +** drawable at the same time (from different threads). In order to avoid +** multiple-access conflicts, locks are used to serialize access. When a +** thread needs to access (read or write) a member of the drawable, it takes +** a lock first. Some of the entries in the drawable are treated "mostly +** constant", so we take the freedom of allowing access to them without +** taking a lock (for optimization reasons). +** +** For more details regarding locking, see buffers.h in the GL core +*/ +struct __GLdrawableBufferRec { + /* + ** Buffer dimensions + */ + GLint width, height, depth; + + /* + ** Framebuffer base address + */ + void *base; + + /* + ** Framebuffer size (in bytes) + */ + GLuint size; + + /* + ** Size (in bytes) of each element in the framebuffer + */ + GLuint elementSize; + GLuint elementSizeLog2; + + /* + ** Element skip from one scanline to the next. + ** If the buffer is part of another buffer (for example, fullscreen + ** front buffer), outerWidth is the width of that buffer. + */ + GLint outerWidth; + + /* + ** outerWidth * elementSize + */ + GLint byteWidth; + + /* + ** Allocation/deallocation is done based on this handle. A handle + ** is conceptually different from the framebuffer 'base'. + */ + void *handle; + + /* imported */ + GLboolean (*resize)(__GLdrawableBuffer *buf, + GLint x, GLint y, GLuint width, GLuint height, + __GLdrawablePrivate *glPriv, GLuint bufferMask); + void (*lock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); + void (*unlock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); + void (*fill)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, + GLuint val, GLint x, GLint y, GLint w, GLint h); + void (*free)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); + + /* exported */ + void (*freePrivate)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); +#ifdef __cplusplus + void *privatePtr; +#else + void *private; +#endif + + /* private */ + void *other; /* implementation private data */ + __GLbufMainInitFn mainInit; + __GLbufFallbackInitFn fallbackInit; +}; + +/* +** The context side of the drawable private +*/ +struct __GLdrawablePrivateRec { + /* + ** Drawable Modes + */ + __GLcontextModes *modes; + + /* + ** Drawable size + */ + GLuint width, height; + + /* + ** Origin in screen coordinates of the drawable + */ + GLint xOrigin, yOrigin; +#ifdef __GL_ALIGNED_BUFFERS + /* + ** Drawable offset from screen origin + */ + GLint xOffset, yOffset; + + /* + ** Alignment restriction + */ + GLint xAlignment, yAlignment; +#endif + /* + ** Should we invert the y axis? + */ + GLint yInverted; + + /* + ** Mask specifying which buffers are renderable by the hw + */ + GLuint accelBufferMask; + + /* + ** the buffers themselves + */ + __GLdrawableBuffer frontBuffer; + __GLdrawableBuffer backBuffer; + __GLdrawableBuffer accumBuffer; + __GLdrawableBuffer depthBuffer; + __GLdrawableBuffer stencilBuffer; +#if __GL_NUMBER_OF_AUX_BUFFERS > 0 + __GLdrawableBuffer *auxBuffer; +#endif + + __GLdrawableRegion ownershipRegion; + + /* + ** Lock for the drawable private structure + */ + void *lock; +#ifdef DEBUG + /* lock debugging info */ + int lockRefCount; + int lockLine[10]; + char *lockFile[10]; +#endif + + /* imported */ + void *(*malloc)(size_t size); + void *(*calloc)(size_t numElem, size_t elemSize); + void *(*realloc)(void *oldAddr, size_t newSize); + void (*free)(void *addr); + + GLboolean (*addSwapRect)(__GLdrawablePrivate *glPriv, + GLint x, GLint y, GLsizei width, GLsizei height); + void (*setClipRect)(__GLdrawablePrivate *glPriv, + GLint x, GLint y, GLsizei width, GLsizei height); + void (*updateClipRegion)(__GLdrawablePrivate *glPriv); + GLboolean (*resize)(__GLdrawablePrivate *glPriv); + void (*getDrawableSize)(__GLdrawablePrivate *glPriv, + GLint *x, GLint *y, GLuint *width, GLuint *height); + + void (*lockDP)(__GLdrawablePrivate *glPriv, __GLcontext *gc); + void (*unlockDP)(__GLdrawablePrivate *glPriv); + + /* exported */ + void *wsPriv; /* pointer to the window system DrawablePrivate */ +#ifdef __cplusplus + void *privatePtr; +#else + void *private; +#endif + void (*freePrivate)(__GLdrawablePrivate *); + + /* client data */ + void *other; +}; + +/* +** Macros to lock/unlock the drawable private +*/ +#if defined(DEBUG) +#define __GL_LOCK_DP(glPriv,gc) \ + (*(glPriv)->lockDP)(glPriv,gc); \ + (glPriv)->lockLine[(glPriv)->lockRefCount] = __LINE__; \ + (glPriv)->lockFile[(glPriv)->lockRefCount] = __FILE__; \ + (glPriv)->lockRefCount++ +#define __GL_UNLOCK_DP(glPriv) \ + (glPriv)->lockRefCount--; \ + (glPriv)->lockLine[(glPriv)->lockRefCount] = 0; \ + (glPriv)->lockFile[(glPriv)->lockRefCount] = NULL; \ + (*(glPriv)->unlockDP)(glPriv) +#else /* DEBUG */ +#define __GL_LOCK_DP(glPriv,gc) (*(glPriv)->lockDP)(glPriv,gc) +#define __GL_UNLOCK_DP(glPriv) (*(glPriv)->unlockDP)(glPriv) +#endif /* DEBUG */ + + +/* +** Procedures which are imported by the GL from the surrounding +** "operating system". Math functions are not considered part of the +** "operating system". +*/ +typedef struct __GLimportsRec { + /* Memory management */ + void * (*malloc)(__GLcontext *gc, size_t size); + void *(*calloc)(__GLcontext *gc, size_t numElem, size_t elemSize); + void *(*realloc)(__GLcontext *gc, void *oldAddr, size_t newSize); + void (*free)(__GLcontext *gc, void *addr); + + /* Error handling */ + void (*warning)(__GLcontext *gc, char *fmt); + void (*fatal)(__GLcontext *gc, char *fmt); + + /* other system calls */ + char *(CAPI *getenv)(__GLcontext *gc, const char *var); + int (CAPI *atoi)(__GLcontext *gc, const char *str); + int (CAPI *sprintf)(__GLcontext *gc, char *str, const char *fmt, ...); + void *(CAPI *fopen)(__GLcontext *gc, const char *path, const char *mode); + int (CAPI *fclose)(__GLcontext *gc, void *stream); + int (CAPI *fprintf)(__GLcontext *gc, void *stream, const char *fmt, ...); + + /* Drawing surface management */ + __GLdrawablePrivate *(*getDrawablePrivate)(__GLcontext *gc); + + /* Pointer to the window system context */ + void *wscx; + + /* Operating system dependent data goes here */ + void *other; +} __GLimports; + +/************************************************************************/ + +/* +** Procedures which are exported by the GL to the surrounding "operating +** system" so that it can manage multiple GL context's. +*/ +typedef struct __GLexportsRec { + /* Context management (return GL_FALSE on failure) */ + GLboolean (*destroyContext)(__GLcontext *gc); + GLboolean (*loseCurrent)(__GLcontext *gc); + GLboolean (*makeCurrent)(__GLcontext *gc); + GLboolean (*shareContext)(__GLcontext *gc, __GLcontext *gcShare); + GLboolean (*copyContext)(__GLcontext *dst, const __GLcontext *src, GLuint mask); + GLboolean (*forceCurrent)(__GLcontext *gc); + + /* Drawing surface notification callbacks */ + GLboolean (*notifyResize)(__GLcontext *gc); + void (*notifyDestroy)(__GLcontext *gc); + void (*notifySwapBuffers)(__GLcontext *gc); + + /* Dispatch table override control for external agents like libGLS */ + struct __GLdispatchStateRec* (*dispatchExec)(__GLcontext *gc); + void (*beginDispatchOverride)(__GLcontext *gc); + void (*endDispatchOverride)(__GLcontext *gc); +} __GLexports; + +/************************************************************************/ + +/* +** This must be the first member of a __GLcontext structure. This is the +** only part of a context that is exposed to the outside world; everything +** else is opaque. +*/ +struct __GLinterfaceRec { + __GLimports imports; + __GLexports exports; +}; + +extern __GLcontext *__glCoreCreateContext(__GLimports *, __GLcontextModes *); +extern void __glCoreNopDispatch(void); + +#endif /* __gl_core_h_ */ diff --git a/include/GL/internal/glcore.h b/include/GL/internal/glcore.h new file mode 100644 index 00000000000..08de6721954 --- /dev/null +++ b/include/GL/internal/glcore.h @@ -0,0 +1,397 @@ +#ifndef __gl_core_h_ +#define __gl_core_h_ + +/* $XFree86: xc/lib/GL/include/GL/internal/glcore.h,v 1.5 1999/06/14 07:23:42 dawes Exp $ */ +/* +** The contents of this file are subject to the GLX Public License Version 1.0 +** (the "License"). You may not use this file except in compliance with the +** License. You may obtain a copy of the License at Silicon Graphics, Inc., +** attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043 +** or at http://www.sgi.com/software/opensource/glx/license.html. +** +** Software distributed under the License is distributed on an "AS IS" +** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY +** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR +** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific +** language governing rights and limitations under the License. +** +** The Original Software is GLX version 1.2 source code, released February, +** 1999. The developer of the Original Software is Silicon Graphics, Inc. +** Those portions of the Subject Software created by Silicon Graphics, Inc. +** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved. +** +** $SGI$ +*/ + +#ifndef XFree86LOADER +#include +#endif + +#define GL_CORE_SGI 1 +#define GL_CORE_MESA 2 + +typedef struct __GLcontextRec __GLcontext; +typedef struct __GLinterfaceRec __GLinterface; + +/* +** This file defines the interface between the GL core and the surrounding +** "operating system" that supports it (currently the GLX or WGL extensions). +** +** Members (data and function pointers) are documented as imported or +** exported according to how they are used by the core rendering functions. +** Imported members are initialized by the "operating system" and used by +** the core functions. Exported members are initialized by the core functions +** and used by the "operating system". +*/ + +/* +** Mode and limit information for a context. This information is +** kept around in the context so that values can be used during +** command execution, and for returning information about the +** context to the application. +*/ +typedef struct __GLcontextModesRec { + GLboolean rgbMode; + GLboolean colorIndexMode; + GLboolean doubleBufferMode; + GLboolean stereoMode; + + GLboolean haveAccumBuffer; + GLboolean haveDepthBuffer; + GLboolean haveStencilBuffer; + + GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */ + GLuint redMask, greenMask, blueMask, alphaMask; + GLint rgbBits; /* total bits for rgb */ + GLint indexBits; /* total bits for colorindex */ + + GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits; + GLint depthBits; + GLint stencilBits; + + GLint numAuxBuffers; + + GLint level; + + GLint pixmapMode; +} __GLcontextModes; + +/************************************************************************/ + +/* +** Structure used for allocating and freeing drawable private memory. +** (like software buffers, for example). +** +** The memory allocation routines are provided by the surrounding +** "operating system" code, and they are to be used for allocating +** software buffers and things which are associated with the drawable, +** and used by any context which draws to that drawable. There are +** separate memory allocation functions for drawables and contexts +** since drawables and contexts can be created and destroyed independently +** of one another, and the "operating system" may want to use separate +** allocation arenas for each. +** +** The freePrivate function is filled in by the core routines when they +** allocates software buffers, and stick them in "private". The freePrivate +** function will destroy anything allocated to this drawable (to be called +** when the drawable is destroyed). +*/ +typedef struct __GLdrawableRegionRec __GLdrawableRegion; +typedef struct __GLdrawableBufferRec __GLdrawableBuffer; +typedef struct __GLdrawablePrivateRec __GLdrawablePrivate; + +typedef struct __GLregionRectRec { + /* lower left (inside the rectangle) */ + GLint x0, y0; + /* upper right (outside the rectangle) */ + GLint x1, y1; +} __GLregionRect; + +struct __GLdrawableRegionRec { + GLint numRects; + __GLregionRect *rects; + __GLregionRect boundingRect; +}; + +/************************************************************************/ + +/* masks for the buffers */ +#define __GL_FRONT_BUFFER_MASK 0x00000001 +#define __GL_FRONT_LEFT_BUFFER_MASK 0x00000001 +#define __GL_FRONT_RIGHT_BUFFER_MASK 0x00000002 +#define __GL_BACK_BUFFER_MASK 0x00000004 +#define __GL_BACK_LEFT_BUFFER_MASK 0x00000004 +#define __GL_BACK_RIGHT_BUFFER_MASK 0x00000008 +#define __GL_ACCUM_BUFFER_MASK 0x00000010 +#define __GL_DEPTH_BUFFER_MASK 0x00000020 +#define __GL_STENCIL_BUFFER_MASK 0x00000040 +#define __GL_AUX_BUFFER_MASK(i) (0x0000080 << (i)) + +#define __GL_ALL_BUFFER_MASK 0xffffffff + +/* what Resize routines return if resize resorted to fallback case */ +#define __GL_BUFFER_FALLBACK 0x10 + +typedef void (*__GLbufFallbackInitFn)(__GLdrawableBuffer *buf, + __GLdrawablePrivate *glPriv, GLint bits); +typedef void (*__GLbufMainInitFn)(__GLdrawableBuffer *buf, + __GLdrawablePrivate *glPriv, GLint bits, + __GLbufFallbackInitFn back); + +/* +** A drawable buffer +** +** This data structure describes the context side of a drawable. +** +** According to the spec there could be multiple contexts bound to the same +** drawable at the same time (from different threads). In order to avoid +** multiple-access conflicts, locks are used to serialize access. When a +** thread needs to access (read or write) a member of the drawable, it takes +** a lock first. Some of the entries in the drawable are treated "mostly +** constant", so we take the freedom of allowing access to them without +** taking a lock (for optimization reasons). +** +** For more details regarding locking, see buffers.h in the GL core +*/ +struct __GLdrawableBufferRec { + /* + ** Buffer dimensions + */ + GLint width, height, depth; + + /* + ** Framebuffer base address + */ + void *base; + + /* + ** Framebuffer size (in bytes) + */ + GLuint size; + + /* + ** Size (in bytes) of each element in the framebuffer + */ + GLuint elementSize; + GLuint elementSizeLog2; + + /* + ** Element skip from one scanline to the next. + ** If the buffer is part of another buffer (for example, fullscreen + ** front buffer), outerWidth is the width of that buffer. + */ + GLint outerWidth; + + /* + ** outerWidth * elementSize + */ + GLint byteWidth; + + /* + ** Allocation/deallocation is done based on this handle. A handle + ** is conceptually different from the framebuffer 'base'. + */ + void *handle; + + /* imported */ + GLboolean (*resize)(__GLdrawableBuffer *buf, + GLint x, GLint y, GLuint width, GLuint height, + __GLdrawablePrivate *glPriv, GLuint bufferMask); + void (*lock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); + void (*unlock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); + void (*fill)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, + GLuint val, GLint x, GLint y, GLint w, GLint h); + void (*free)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); + void *other; + + /* exported */ + void (*freePrivate)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); + void *private; + + /* private */ + __GLbufMainInitFn mainInit; + __GLbufFallbackInitFn fallbackInit; +}; + +/* +** The context side of the drawable private +*/ +struct __GLdrawablePrivateRec { + /* + ** Drawable Modes + */ + __GLcontextModes *modes; + + /* + ** Drawable size + */ + GLuint width, height; + + /* + ** Origin in screen coordinates of the drawable + */ + GLint xOrigin, yOrigin; +#ifdef __GL_ALIGNED_BUFFERS + /* + ** Drawable offset from screen origin + */ + GLint xOffset, yOffset; + + /* + ** Alignment restriction + */ + GLint xAlignment, yAlignment; +#endif + /* + ** Should we invert the y axis? + */ + GLint yInverted; + + /* + ** Mask specifying which buffers are renderable by the hw + */ + GLuint accelBufferMask; + + /* + ** the buffers themselves + */ + __GLdrawableBuffer frontBuffer; + __GLdrawableBuffer backBuffer; + __GLdrawableBuffer accumBuffer; + __GLdrawableBuffer depthBuffer; + __GLdrawableBuffer stencilBuffer; +#if defined(__GL_NUMBER_OF_AUX_BUFFERS) && (__GL_NUMBER_OF_AUX_BUFFERS > 0) + __GLdrawableBuffer *auxBuffer; +#endif + + __GLdrawableRegion ownershipRegion; + + /* + ** Lock for the drawable private structure + */ + void *lock; +#ifdef DEBUG + /* lock debugging info */ + int lockRefCount; + int lockLine[10]; + char *lockFile[10]; +#endif + + /* imported */ + void *(*malloc)(size_t size); + void *(*calloc)(size_t numElem, size_t elemSize); + void *(*realloc)(void *oldAddr, size_t newSize); + void (*free)(void *addr); + + GLboolean (*addSwapRect)(__GLdrawablePrivate *glPriv, + GLint x, GLint y, GLsizei width, GLsizei height); + void (*setClipRect)(__GLdrawablePrivate *glPriv, + GLint x, GLint y, GLsizei width, GLsizei height); + void (*updateClipRegion)(__GLdrawablePrivate *glPriv); + GLboolean (*resize)(__GLdrawablePrivate *glPriv); + void (*getDrawableSize)(__GLdrawablePrivate *glPriv, + GLint *x, GLint *y, GLuint *width, GLuint *height); + + void (*lockDP)(__GLdrawablePrivate *glPriv, __GLcontext *gc); + void (*unlockDP)(__GLdrawablePrivate *glPriv); + + + void *other; + + /* exported */ + void (*freePrivate)(__GLdrawablePrivate *); + void *private; +}; + +/* +** Macros to lock/unlock the drawable private +*/ +#if defined(DEBUG) +#define __GL_LOCK_DP(glPriv,gc) \ + (*(glPriv)->lockDP)(glPriv,gc); \ + (glPriv)->lockLine[(glPriv)->lockRefCount] = __LINE__; \ + (glPriv)->lockFile[(glPriv)->lockRefCount] = __FILE__; \ + (glPriv)->lockRefCount++ +#define __GL_UNLOCK_DP(glPriv) \ + (glPriv)->lockRefCount--; \ + (glPriv)->lockLine[(glPriv)->lockRefCount] = 0; \ + (glPriv)->lockFile[(glPriv)->lockRefCount] = NULL; \ + (*(glPriv)->unlockDP)(glPriv) +#else /* DEBUG */ +#define __GL_LOCK_DP(glPriv,gc) (*(glPriv)->lockDP)(glPriv,gc) +#define __GL_UNLOCK_DP(glPriv) (*(glPriv)->unlockDP)(glPriv) +#endif /* DEBUG */ + + +/* +** Procedures which are imported by the GL from the surrounding +** "operating system". Math functions are not considered part of the +** "operating system". +*/ +typedef struct __GLimportsRec { + /* Memory management */ + void *(*malloc)(__GLcontext *gc, size_t size); + void *(*calloc)(__GLcontext *gc, size_t numElem, size_t elemSize); + void *(*realloc)(__GLcontext *gc, void *oldAddr, size_t newSize); + void (*free)(__GLcontext *gc, void *addr); + + /* Error handling */ + void (*warning)(__GLcontext *gc, char *fmt); + void (*fatal)(__GLcontext *gc, char *fmt); + + /* other system calls */ + char *(*getenv)(__GLcontext *gc, const char *var); + int (*sprintf)(__GLcontext *gc, char *str, const char *fmt, ...); + void *(*fopen)(__GLcontext *gc, const char *path, const char *mode); + int (*fclose)(__GLcontext *gc, void *stream); + int (*fprintf)(__GLcontext *gc, void *stream, const char *fmt, ...); + + /* Drawing surface management */ + __GLdrawablePrivate *(*getDrawablePrivate)(__GLcontext *gc); + + /* Operating system dependent data goes here */ + void *other; +} __GLimports; + +/************************************************************************/ + +/* +** Procedures which are exported by the GL to the surrounding "operating +** system" so that it can manage multiple GL context's. +*/ +typedef struct __GLexportsRec { + /* Context management (return GL_FALSE on failure) */ + GLboolean (*destroyContext)(__GLcontext *gc); + GLboolean (*loseCurrent)(__GLcontext *gc); + GLboolean (*makeCurrent)(__GLcontext *gc, __GLdrawablePrivate *glPriv); + GLboolean (*shareContext)(__GLcontext *gc, __GLcontext *gcShare); + GLboolean (*copyContext)(__GLcontext *dst, const __GLcontext *src, GLuint mask); + GLboolean (*forceCurrent)(__GLcontext *gc); + + /* Drawing surface notification callbacks */ + GLboolean (*notifyResize)(__GLcontext *gc); + void (*notifyDestroy)(__GLcontext *gc); + void (*notifySwapBuffers)(__GLcontext *gc); + + /* Dispatch table override control for external agents like libGLS */ + struct __GLdispatchStateRec* (*dispatchExec)(__GLcontext *gc); + void (*beginDispatchOverride)(__GLcontext *gc); + void (*endDispatchOverride)(__GLcontext *gc); +} __GLexports; + +/************************************************************************/ + +/* +** This must be the first member of a __GLcontext structure. This is the +** only part of a context that is exposed to the outside world; everything +** else is opaque. +*/ +struct __GLinterfaceRec { + __GLimports imports; + __GLexports exports; +}; + +extern __GLcontext *__glCoreCreateContext(__GLimports *, __GLcontextModes *); +extern void __glCoreNopDispatch(void); + +#endif /* __gl_core_h_ */ -- cgit v1.2.3 From a087c7421bef25747e1d692f62062393d849c501 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Sat, 13 Jan 2001 05:47:06 +0000 Subject: Resync with new XFree version of this file --- include/GL/internal/glcore.h | 81 ++++++++++++++++++++++++++++---------------- 1 file changed, 51 insertions(+), 30 deletions(-) (limited to 'include') diff --git a/include/GL/internal/glcore.h b/include/GL/internal/glcore.h index 08de6721954..70b75727988 100644 --- a/include/GL/internal/glcore.h +++ b/include/GL/internal/glcore.h @@ -1,32 +1,52 @@ #ifndef __gl_core_h_ #define __gl_core_h_ -/* $XFree86: xc/lib/GL/include/GL/internal/glcore.h,v 1.5 1999/06/14 07:23:42 dawes Exp $ */ /* -** The contents of this file are subject to the GLX Public License Version 1.0 -** (the "License"). You may not use this file except in compliance with the -** License. You may obtain a copy of the License at Silicon Graphics, Inc., -** attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043 -** or at http://www.sgi.com/software/opensource/glx/license.html. +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.1 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. This software +** was created using the OpenGL(R) version 1.2.1 Sample Implementation +** published by SGI, but has not been independently verified as being +** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** Software distributed under the License is distributed on an "AS IS" -** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY -** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR -** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific -** language governing rights and limitations under the License. -** -** The Original Software is GLX version 1.2 source code, released February, -** 1999. The developer of the Original Software is Silicon Graphics, Inc. -** Those portions of the Subject Software created by Silicon Graphics, Inc. -** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved. -** -** $SGI$ +** $Date: 2001/01/13 05:47:06 $ $Revision: 1.2 $ +** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/internal/glcore.h,v 1.2 2001/01/13 05:47:06 keithw Exp $ */ #ifndef XFree86LOADER #include #endif +#ifdef CAPI +#undef CAPI +#endif +#define CAPI + #define GL_CORE_SGI 1 #define GL_CORE_MESA 2 @@ -202,13 +222,13 @@ struct __GLdrawableBufferRec { void (*fill)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, GLuint val, GLint x, GLint y, GLint w, GLint h); void (*free)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); - void *other; /* exported */ void (*freePrivate)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); void *private; /* private */ + void *other; /* implementation private data */ __GLbufMainInitFn mainInit; __GLbufFallbackInitFn fallbackInit; }; @@ -260,7 +280,7 @@ struct __GLdrawablePrivateRec { __GLdrawableBuffer accumBuffer; __GLdrawableBuffer depthBuffer; __GLdrawableBuffer stencilBuffer; -#if defined(__GL_NUMBER_OF_AUX_BUFFERS) && (__GL_NUMBER_OF_AUX_BUFFERS > 0) +#if __GL_NUMBER_OF_AUX_BUFFERS > 0 __GLdrawableBuffer *auxBuffer; #endif @@ -295,12 +315,12 @@ struct __GLdrawablePrivateRec { void (*lockDP)(__GLdrawablePrivate *glPriv, __GLcontext *gc); void (*unlockDP)(__GLdrawablePrivate *glPriv); - - void *other; - /* exported */ - void (*freePrivate)(__GLdrawablePrivate *); void *private; + void (*freePrivate)(__GLdrawablePrivate *); + + /* client data */ + void *other; }; /* @@ -330,7 +350,7 @@ struct __GLdrawablePrivateRec { */ typedef struct __GLimportsRec { /* Memory management */ - void *(*malloc)(__GLcontext *gc, size_t size); + void * (*malloc)(__GLcontext *gc, size_t size); void *(*calloc)(__GLcontext *gc, size_t numElem, size_t elemSize); void *(*realloc)(__GLcontext *gc, void *oldAddr, size_t newSize); void (*free)(__GLcontext *gc, void *addr); @@ -340,11 +360,12 @@ typedef struct __GLimportsRec { void (*fatal)(__GLcontext *gc, char *fmt); /* other system calls */ - char *(*getenv)(__GLcontext *gc, const char *var); - int (*sprintf)(__GLcontext *gc, char *str, const char *fmt, ...); - void *(*fopen)(__GLcontext *gc, const char *path, const char *mode); - int (*fclose)(__GLcontext *gc, void *stream); - int (*fprintf)(__GLcontext *gc, void *stream, const char *fmt, ...); + char *(CAPI *getenv)(__GLcontext *gc, const char *var); + int (CAPI *atoi)(__GLcontext *gc, const char *str); + int (CAPI *sprintf)(__GLcontext *gc, char *str, const char *fmt, ...); + void *(CAPI *fopen)(__GLcontext *gc, const char *path, const char *mode); + int (CAPI *fclose)(__GLcontext *gc, void *stream); + int (CAPI *fprintf)(__GLcontext *gc, void *stream, const char *fmt, ...); /* Drawing surface management */ __GLdrawablePrivate *(*getDrawablePrivate)(__GLcontext *gc); -- cgit v1.2.3 From 9533fd18420b8ce5f229b43cf16408e64a10adaf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Jan 2001 00:07:01 +0000 Subject: minor tweaks --- include/GL/xmesa.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index 273b83508c7..52e8db279e5 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -1,8 +1,8 @@ -/* $Id: xmesa.h,v 1.9 2000/08/22 13:31:01 joukj Exp $ */ +/* $Id: xmesa.h,v 1.10 2001/01/24 00:07:01 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.3 + * Version: 3.5 * * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. * @@ -58,7 +58,6 @@ and create a window, you must do the following to use the X/Mesa interface: 8. Before exiting, call XMesaDestroyVisual and XMesaDestroyContext. -See the demos/xdemo.c and xmesa1.c files for examples. */ -- cgit v1.2.3 From e5dfe384ad74c68529cca02388802996b14421fa Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 29 Jan 2001 16:18:37 +0000 Subject: updates to the trace extension --- include/GL/gl.h | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index f261a672b44..ae03a8b9ec0 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.50 2001/01/06 22:46:13 gareth Exp $ */ +/* $Id: gl.h,v 1.51 2001/01/29 16:18:37 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2256,25 +2256,26 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); #ifndef GL_MESA_trace #define GL_MESA_trace 1 -#define GL_TRACE_ALL_BIT_MESA 0x0001 -#define GL_TRACE_OPERATIONS_BIT_MESA 0x0002 -#define GL_TRACE_PRIMITIVES_BIT_MESA 0x0004 -#define GL_TRACE_ARRAYS_BIT_MESA 0x0008 -#define GL_TRACE_TEXTURES_BIT_MESA 0x0010 -#define GL_TRACE_PIXELS_BIT_MESA 0x0020 +#define GL_TRACE_ALL_BITS_MESA 0xFFFF +#define GL_TRACE_OPERATIONS_BIT_MESA 0x0001 +#define GL_TRACE_PRIMITIVES_BIT_MESA 0x0002 +#define GL_TRACE_ARRAYS_BIT_MESA 0x0004 +#define GL_TRACE_TEXTURES_BIT_MESA 0x0008 +#define GL_TRACE_PIXELS_BIT_MESA 0x0010 +#define GL_TRACE_ERRORS_BIT_MESA 0x0020 #define GL_TRACE_MASK_MESA 0x8755 #define GL_TRACE_NAME_MESA 0x8756 -GLAPI void GLAPIENTRY glEnableTrace( GLbitfield mask ); -GLAPI void GLAPIENTRY glDisableTrace( GLbitfield mask ); -GLAPI void GLAPIENTRY glNewTrace( GLbitfield mask, GLubyte * traceName ); -GLAPI void GLAPIENTRY glEndTrace( void ); -GLAPI void GLAPIENTRY glTraceAssertAttrib( GLbitfield attribMask ); -GLAPI void GLAPIENTRY glTraceComment( const GLubyte * comment ); -GLAPI void GLAPIENTRY glTraceTexture( GLuint name, const GLubyte* comment ); -GLAPI void GLAPIENTRY glTraceList( GLuint name, const GLubyte* comment ); -GLAPI void GLAPIENTRY glTracePointer( GLvoid* pointer, const GLubyte* comment ); -GLAPI void GLAPIENTRY glTracePointerRange( const GLvoid* first, const GLvoid* last, const GLubyte* comment ); +GLAPI void GLAPIENTRY glEnableTraceMESA( GLbitfield mask ); +GLAPI void GLAPIENTRY glDisableTraceMESA( GLbitfield mask ); +GLAPI void GLAPIENTRY glNewTraceMESA( GLbitfield mask, const GLubyte * traceName ); +GLAPI void GLAPIENTRY glEndTraceMESA( void ); +GLAPI void GLAPIENTRY glTraceAssertAttribMESA( GLbitfield attribMask ); +GLAPI void GLAPIENTRY glTraceCommentMESA( const GLubyte * comment ); +GLAPI void GLAPIENTRY glTraceTextureMESA( GLuint name, const GLubyte* comment ); +GLAPI void GLAPIENTRY glTraceListMESA( GLuint name, const GLubyte* comment ); +GLAPI void GLAPIENTRY glTracePointerMESA( GLvoid* pointer, const GLubyte* comment ); +GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid* last, const GLubyte* comment ); #endif /* GL_MESA_trace */ -- cgit v1.2.3 From f2515fa83eea42d0c5abe168b873ddd5026d5f83 Mon Sep 17 00:00:00 2001 From: Gareth Hughes Date: Tue, 30 Jan 2001 15:02:34 +0000 Subject: Upgrade to (patched) version 7 of glext.h --- include/GL/glext.h | 153 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 138 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index aa69c184c28..774d57284c1 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -46,7 +46,7 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -#define GL_GLEXT_VERSION 6 +#define GL_GLEXT_VERSION 7 #ifndef GL_VERSION_1_2 #define GL_CONSTANT_COLOR 0x8001 @@ -220,12 +220,57 @@ extern "C" { #define GL_COMPRESSED_RGB_ARB 0x84ED #define GL_COMPRESSED_RGBA_ARB 0x84EE #define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 #define GL_TEXTURE_COMPRESSED_ARB 0x86A1 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 #define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 #endif +#ifndef GL_ARB_vertex_blend +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +#endif + #ifndef GL_EXT_abgr #define GL_ABGR_EXT 0x8000 #endif @@ -670,6 +715,18 @@ extern "C" { #ifndef GL_SGIX_tag_sample_buffer #endif +#ifndef GL_FfdMaskSGIX +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 +#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 +#define GL_DEFORMATIONS_MASK_SGIX 0x8196 +#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 +#endif + #ifndef GL_SGIX_reference_plane #define GL_REFERENCE_PLANE_SGIX 0x817D #define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E @@ -785,6 +842,14 @@ extern "C" { #define GL_COLOR_INDEX8_EXT 0x80E5 #define GL_COLOR_INDEX12_EXT 0x80E6 #define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 +#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF #define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED #endif @@ -926,6 +991,24 @@ extern "C" { #define GL_BGRA_EXT 0x80E1 #endif +#ifndef GL_SGIX_async +#define GL_ASYNC_MARKER_SGIX 0x8329 +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D +#endif + #ifndef GL_INTEL_texture_scissor #endif @@ -1663,15 +1746,9 @@ typedef void (APIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bia #define GL_EXT_texture3D 1 #ifdef GL_GLEXT_PROTOTYPES extern void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_EXT_subtexture -/*#define GL_EXT_subtexture 1*/ -#ifdef GL_GLEXT_PROTOTYPES extern void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); #endif @@ -2043,6 +2120,20 @@ extern void APIENTRY glTagSampleBufferSGIX (void); typedef void (APIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); #endif +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); +extern void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); +extern void APIENTRY glDeformSGIX (GLbitfield); +extern void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +typedef void (APIENTRY * PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +typedef void (APIENTRY * PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (APIENTRY * PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); +#endif + #ifndef GL_SGIX_reference_plane #define GL_SGIX_reference_plane 1 #ifdef GL_GLEXT_PROTOTYPES @@ -2311,6 +2402,32 @@ typedef void (APIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode) #define GL_EXT_bgra 1 #endif +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glAsyncMarkerSGIX (GLuint); +extern GLint APIENTRY glFinishAsyncSGIX (GLuint *); +extern GLint APIENTRY glPollAsyncSGIX (GLuint *); +extern GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); +extern void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); +extern GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (APIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); +typedef GLint (APIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); +typedef GLuint (APIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef void (APIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLboolean (APIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 +#endif + #ifndef GL_INTEL_parallel_arrays #define GL_INTEL_parallel_arrays 1 #ifdef GL_GLEXT_PROTOTYPES @@ -2717,12 +2834,6 @@ extern void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, extern void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); extern void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); extern void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); -#ifdef VMS - #define glGetCombinerOutputParameterfvNV glGetCombinerOutputParameterfvN - #define glGetCombinerOutputParameterivNV glGetCombinerOutputParameterivN - #define glGetFinalCombinerInputParameterfvNV glGetFinalCombinerInputParafvNV - #define glGetFinalCombinerInputParameterivNV glGetFinalCombinerInputParaivNV -#endif extern void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); extern void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); extern void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); @@ -2923,6 +3034,18 @@ extern void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GL typedef void (APIENTRY * PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); #endif +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 +#ifdef GL_GLEXT_PROTOTYPES +extern void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +#endif + #ifdef __cplusplus } -- cgit v1.2.3 From aaf5a9bb08a596a6bd5cc1150dcd50cb710db919 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 19 Feb 2001 18:28:59 +0000 Subject: added a bunch of extensions (Ray Tice) --- include/GL/gl_mangle.h | 129 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 126 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 2c709e8b655..27fac2cd57c 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -1,10 +1,10 @@ -/* $Id: gl_mangle.h,v 1.4 2000/01/04 08:07:09 brianp Exp $ */ +/* $Id: gl_mangle.h,v 1.5 2001/02/19 18:28:59 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.3 + * Version: 3.5 * - * Copyright (C) 1999 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 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"), @@ -535,5 +535,128 @@ #define glCopyColorTable mglCopyColorTable #define glLockArraysEXT mglLockArraysEXT #define glUnlockArraysEXT mglUnlockArraysEXT +#define glGetFinalCombinerInputParameterivNV mglGetFinalCombinerInputParameterivNV +#define glGetFinalCombinerInputParameterfvNV mglGetFinalCombinerInputParameterfvNV +#define glGetCombinerOutputParameterivNV mglGetCombinerOutputParameterivNV +#define glGetCombinerOutputParameterfvNV mglGetCombinerOutputParameterfvNV +#define glGetCombinerInputParameterivNV mglGetCombinerInputParameterivNV +#define glGetCombinerInputParameterfvNV mglGetCombinerInputParameterfvNV +#define glFinalCombinerInputNV mglFinalCombinerInputNV +#define glCombinerOutputNV mglCombinerOutputNV +#define glCombinerInputNV mglCombinerInputNV +#define glCombinerParameteriNV mglCombinerParameteriNV +#define glCombinerParameterivNV mglCombinerParameterivNV +#define glCombinerParameterfNV mglCombinerParameterfNV +#define glCombinerParameterfvNV mglCombinerParameterfvNV +#define glVertexArrayRangeNV mglVertexArrayRangeNV +#define glFlushVertexArrayRangeNV mglFlushVertexArrayRangeNV +#define glVertexWeightPointerEXT mglVertexWeightPointerEXT +#define glVertexWeightfvEXT mglVertexWeightfvEXT +#define glVertexWeightfEXT mglVertexWeightfEXT +#define glBlendFuncSeparateEXT mglBlendFuncSeparateEXT +#define glFogCoordPointerEXT mglFogCoordPointerEXT +#define glFogCoorddEXT mglFogCoorddEXT +#define glFogCoordfvEXT mglFogCoordfvEXT +#define glFogCoordfEXT mglFogCoordfEXT +#define glLightEnviSGIX mglLightEnviSGIX +#define glGetFragmentMaterialivSGIX mglGetFragmentMaterialivSGIX +#define glGetFragmentMaterialfvSGIX mglGetFragmentMaterialfvSGIX +#define glGetFragmentLightivSGIX mglGetFragmentLightivSGIX +#define glGetFragmentLightfvSGIX mglGetFragmentLightfvSGIX +#define glFragmentMaterialivSGIX mglFragmentMaterialivSGIX +#define glFragmentMaterialiSGIX mglFragmentMaterialiSGIX +#define glFragmentMaterialfvSGIX mglFragmentMaterialfvSGIX +#define glFragmentMaterialfSGIX mglFragmentMaterialfSGIX +#define glFragmentLightModelivSGIX mglFragmentLightModelivSGIX +#define glFragmentLightModeliSGIX mglFragmentLightModeliSGIX +#define glFragmentLightModelfvSGIX mglFragmentLightModelfvSGIX +#define glFragmentLightModelfSGIX mglFragmentLightModelfSGIX +#define glFragmentLightivSGIX mglFragmentLightivSGIX +#define glFragmentLightiSGIX mglFragmentLightiSGIX +#define glFragmentLightfvSGIX mglFragmentLightfvSGIX +#define glFragmentLightfSGIX mglFragmentLightfSGIX +#define glFragmentColorMaterialSGIX mglFragmentColorMaterialSGIX +#define glCullParameterdvEXT mglCullParameterdvEXT +#define glCullParameterfvEXT mglCullParameterfvEXT +#define glIndexFuncEXT mglIndexFuncEXT +#define glIndexMaterialEXT mglIndexMaterialEXT +#define glListParameterivSGIX mglListParameterivSGIX +#define glListParameteriSGIX mglListParameteriSGIX +#define glListParameterfvSGIX mglListParameterfvSGIX +#define glListParameterfSGIX mglListParameterfSGIX +#define glGetListParameterivSGIX mglGetListParameterivSGIX +#define glGetListParameterfvSGIX mglGetListParameterfvSGIX +#define glHintPGI mglHintPGI +#define glCopyColorSubTableEXT mglCopyColorSubTableEXT +#define glFlushRasterSGIX mglFlushRasterSGIX +#define glReferencePlaneSGIX mglReferencePlaneSGIX +#define glTagSampleBufferSGIX mglTagSampleBufferSGIX +#define glFrameZoomSGIX mglFrameZoomSGIX +#define glGetInstrumentsSGIX mglGetInstrumentsSGIX +#define glPollInstrumentsSGIX mglPollInstrumentsSGIX +#define glReadInstrumentsSGIX mglReadInstrumentsSGIX +#define glStopInstrumentsSGIX mglStopInstrumentsSGIX +#define glStartInstrumentsSGIX mglStartInstrumentsSGIX +#define glInstrumentsBufferSGIX mglInstrumentsBufferSGIX +#define glPointParameterfvSGIS mglPointParameterfvSGIS +#define glPointParameterfSGIS mglPointParameterfSGIS +#define glSpriteParameterivSGIX mglSpriteParameterivSGIX +#define glSpriteParameteriSGIX mglSpriteParameteriSGIX +#define glSpriteParameterfvSGIX mglSpriteParameterfvSGIX +#define glSpriteParameterfSGIX mglSpriteParameterfSGIX +#define glSamplePatternSGIS mglSamplePatternSGIS +#define glSampleMaskSGIS mglSampleMaskSGIS +#define glSharpenTexFuncSGIS mglSharpenTexFuncSGIS +#define glGetSharpenTexFuncSGIS mglGetSharpenTexFuncSGIS +#define glGetDetailTexFuncSGIS mglGetDetailTexFuncSGIS +#define glDetailTexFuncSGIS mglDetailTexFuncSGIS +#define glTexSubImage4DSGIS mglTexSubImage4DSGIS +#define glTexImage4DSGIS mglTexImage4DSGIS +#define glGetPixelTexGenParameterivSGIS mglGetPixelTexGenParameterivSGIS +#define glGetPixelTexGenParameterfvSGIS mglGetPixelTexGenParameterfvSGIS +#define glPixelTexGenParameteriSGIS mglPixelTexGenParameteriSGIS +#define glPixelTexGenParameterfSGIS mglPixelTexGenParameterfSGIS +#define glGetColorTableParameterivSGI mglGetColorTableParameterivSGI +#define glGetColorTableParameterfvSGI mglGetColorTableParameterfvSGI +#define glGetColorTableSGI mglGetColorTableSGI +#define glCopyColorTableSGI mglCopyColorTableSGI +#define glColorTableParameterivSGI mglColorTableParameterivSGI +#define glColorTableParameterfvSGI mglColorTableParameterfvSGI +#define glColorTableSGI mglColorTableSGI +#define glSeparableFilter2DEXT mglSeparableFilter2DEXT +#define glGetSeparableFilterEXT mglGetSeparableFilterEXT +#define glGetConvolutionParameterfvEXT mglGetConvolutionParameterfvEXT +#define glGetConvolutionParameterivEXT mglGetConvolutionParameterivEXT +#define glGetConvolutionFilterEXT mglGetConvolutionFilterEXT +#define glCopyConvolutionFilter2DEXT mglCopyConvolutionFilter2DEXT +#define glCopyConvolutionFilter1DEXT mglCopyConvolutionFilter1DEXT +#define glConvolutionParameterivEXT mglConvolutionParameterivEXT +#define glConvolutionParameteriEXT mglConvolutionParameteriEXT +#define glConvolutionParameterfvEXT mglConvolutionParameterfvEXT +#define glConvolutionParameterfEXT mglConvolutionParameterfEXT +#define glConvolutionFilter2DEXT mglConvolutionFilter2DEXT +#define glConvolutionFilter1DEXT mglConvolutionFilter1DEXT +#define glResetMinmaxEXT mglResetMinmaxEXT +#define glResetHistogramEXT mglResetHistogramEXT +#define glMinmaxEXT mglMinmaxEXT +#define glHistogramEXT mglHistogramEXT +#define glGetMinmaxParameterivEXT mglGetMinmaxParameterivEXT +#define glGetMinmaxParameterfvEXT mglGetMinmaxParameterfvEXT +#define glGetMinmaxEXT mglGetMinmaxEXT +#define glGetHistogramParameterivEXT mglGetHistogramParameterivEXT +#define glGetHistogramParameterfvEXT mglGetHistogramParameterfvEXT +#define glGetHistogramEXT mglGetHistogramEXT +#define glCopyTexSubImage2DEXT mglCopyTexSubImage2DEXT +#define glCopyTexSubImage1DEXT mglCopyTexSubImage1DEXT +#define glCopyTexImage2DEXT mglCopyTexImage2DEXT +#define glCopyTexImage1DEXT mglCopyTexImage1DEXT +#define glTexSubImage2DEXT mglTexSubImage2DEXT +#define glTexSubImage1DEXT mglTexSubImage1DEXT +#define glSampleCoverageARB mglSampleCoverageARB +#define glSamplePassARB mglSamplePassARB +#define glMultTransposeMatrixfARB mglMultTransposeMatrixfARB +#define glMultTransposeMatrixdARB mglMultTransposeMatrixdARB +#define glLoadTransposeMatrixfARB mglLoadTransposeMatrixfARB +#define glLoadTransposeMatrixdARB mglLoadTransposeMatrixdARB #endif -- cgit v1.2.3 From 1bb327ebdb2e68bfbd653abe91f351fb7ec82ab3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 17 Mar 2001 00:29:47 +0000 Subject: SGI SI GLU 1.3 header --- include/GL/glu.h | 823 +++++++++++++++++++++---------------------------------- 1 file changed, 306 insertions(+), 517 deletions(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index c0ed06414ab..65df77b3614 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -1,534 +1,323 @@ -/* $Id: glu.h,v 1.23 2000/10/26 15:32:54 brianp Exp $ */ - /* - * Mesa 3-D graphics library - * Version: 3.5 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -#ifndef GLU_H -#define GLU_H - - -#if defined(USE_MGL_NAMESPACE) -#include "glu_mangle.h" -#endif +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.1 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: This software was created using the +** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has +** not been independently verified as being compliant with the OpenGL(R) +** version 1.2.1 Specification. +*/ + +#ifndef __glu_h__ +#define __glu_h__ +#include #ifdef __cplusplus extern "C" { #endif - -#include - - - /* to facilitate clean DLL building ... */ -#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__)) -# if defined(_MSC_VER) && defined(BUILD_GLU32) /* tag specify we're building mesa as a DLL */ -# define GLUAPI __declspec(dllexport) -# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ -# define GLUAPI __declspec(dllimport) -# else /* for use with static link lib build of Win32 edition only */ -# define GLUAPI extern -# endif /* _STATIC_MESA support */ -# define GLCALLBACK __stdcall -# define GLCALLBACKP __stdcall * -#else -# define GLUAPI extern -# define GLCALLBACK -# define GLCALLBACKP * -#endif /* WIN32 / CYGWIN bracket */ - -/* compatability guard so we don't need to change client code */ -#if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP) -# define CALLBACK GLCALLBACK -#endif - - -#ifdef macintosh - #pragma enumsalwaysint on - #if PRAGMA_IMPORT_SUPPORTED - #pragma import on - #endif -#endif - -#ifndef GLUAPI -#define GLUAPI -#endif - -#ifndef GLAPIENTRY -#define GLAPIENTRY -#endif - -#ifndef GLCALLBACK -#define GLCALLBACK -#endif - - -#define GLU_VERSION_1_1 1 - - - -#define GLU_TRUE 1 -#define GLU_FALSE 0 - - -/* Normal vectors */ -#define GLU_SMOOTH 100000 -#define GLU_FLAT 100001 -#define GLU_NONE 100002 - -/* Quadric draw styles */ -#define GLU_POINT 100010 -#define GLU_LINE 100011 -#define GLU_FILL 100012 -#define GLU_SILHOUETTE 100013 - -/* Quadric orientation */ -#define GLU_OUTSIDE 100020 -#define GLU_INSIDE 100021 - -/* Tessellator */ -#define GLU_TESS_BEGIN 100100 -#define GLU_TESS_VERTEX 100101 -#define GLU_TESS_END 100102 -#define GLU_TESS_ERROR 100103 -#define GLU_TESS_EDGE_FLAG 100104 -#define GLU_TESS_COMBINE 100105 - -#define GLU_TESS_BEGIN_DATA 100106 -#define GLU_TESS_VERTEX_DATA 100107 -#define GLU_TESS_END_DATA 100108 -#define GLU_TESS_ERROR_DATA 100109 -#define GLU_TESS_EDGE_FLAG_DATA 100110 -#define GLU_TESS_COMBINE_DATA 100111 - -/* Winding rules */ -#define GLU_TESS_WINDING_ODD 100130 -#define GLU_TESS_WINDING_NONZERO 100131 -#define GLU_TESS_WINDING_POSITIVE 100132 -#define GLU_TESS_WINDING_NEGATIVE 100133 -#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134 - -/* Tessellation properties */ -#define GLU_TESS_WINDING_RULE 100140 -#define GLU_TESS_BOUNDARY_ONLY 100141 -#define GLU_TESS_TOLERANCE 100142 - -/* Tessellation errors */ -#define GLU_TESS_ERROR1 100151 /* Missing gluBeginPolygon */ -#define GLU_TESS_ERROR2 100152 /* Missing gluBeginContour */ -#define GLU_TESS_ERROR3 100153 /* Missing gluEndPolygon */ -#define GLU_TESS_ERROR4 100154 /* Missing gluEndContour */ -#define GLU_TESS_ERROR5 100155 /* */ -#define GLU_TESS_ERROR6 100156 /* */ -#define GLU_TESS_ERROR7 100157 /* */ -#define GLU_TESS_ERROR8 100158 /* */ - -/* NURBS */ -#define GLU_AUTO_LOAD_MATRIX 100200 -#define GLU_CULLING 100201 -#define GLU_PARAMETRIC_TOLERANCE 100202 -#define GLU_SAMPLING_TOLERANCE 100203 -#define GLU_DISPLAY_MODE 100204 -#define GLU_SAMPLING_METHOD 100205 -#define GLU_U_STEP 100206 -#define GLU_V_STEP 100207 - -#define GLU_PATH_LENGTH 100215 -#define GLU_PARAMETRIC_ERROR 100216 -#define GLU_DOMAIN_DISTANCE 100217 - -#define GLU_MAP1_TRIM_2 100210 -#define GLU_MAP1_TRIM_3 100211 - -#define GLU_OUTLINE_POLYGON 100240 -#define GLU_OUTLINE_PATCH 100241 - -#define GLU_NURBS_ERROR1 100251 /* spline order un-supported */ -#define GLU_NURBS_ERROR2 100252 /* too few knots */ -#define GLU_NURBS_ERROR3 100253 /* valid knot range is empty */ -#define GLU_NURBS_ERROR4 100254 /* decreasing knot sequence */ -#define GLU_NURBS_ERROR5 100255 /* knot multiplicity > spline order */ -#define GLU_NURBS_ERROR6 100256 /* endcurve() must follow bgncurve() */ -#define GLU_NURBS_ERROR7 100257 /* bgncurve() must precede endcurve() */ -#define GLU_NURBS_ERROR8 100258 /* ctrlarray or knot vector is NULL */ -#define GLU_NURBS_ERROR9 100259 /* can't draw pwlcurves */ -#define GLU_NURBS_ERROR10 100260 /* missing gluNurbsCurve() */ -#define GLU_NURBS_ERROR11 100261 /* missing gluNurbsSurface() */ -#define GLU_NURBS_ERROR12 100262 /* endtrim() must precede endsurface() */ -#define GLU_NURBS_ERROR13 100263 /* bgnsurface() must precede endsurface() */ -#define GLU_NURBS_ERROR14 100264 /* curve of improper type passed as trim curve */ -#define GLU_NURBS_ERROR15 100265 /* bgnsurface() must precede bgntrim() */ -#define GLU_NURBS_ERROR16 100266 /* endtrim() must follow bgntrim() */ -#define GLU_NURBS_ERROR17 100267 /* bgntrim() must precede endtrim()*/ -#define GLU_NURBS_ERROR18 100268 /* invalid or missing trim curve*/ -#define GLU_NURBS_ERROR19 100269 /* bgntrim() must precede pwlcurve() */ -#define GLU_NURBS_ERROR20 100270 /* pwlcurve referenced twice*/ -#define GLU_NURBS_ERROR21 100271 /* pwlcurve and nurbscurve mixed */ -#define GLU_NURBS_ERROR22 100272 /* improper usage of trim data type */ -#define GLU_NURBS_ERROR23 100273 /* nurbscurve referenced twice */ -#define GLU_NURBS_ERROR24 100274 /* nurbscurve and pwlcurve mixed */ -#define GLU_NURBS_ERROR25 100275 /* nurbssurface referenced twice */ -#define GLU_NURBS_ERROR26 100276 /* invalid property */ -#define GLU_NURBS_ERROR27 100277 /* endsurface() must follow bgnsurface() */ -#define GLU_NURBS_ERROR28 100278 /* intersecting or misoriented trim curves */ -#define GLU_NURBS_ERROR29 100279 /* intersecting trim curves */ -#define GLU_NURBS_ERROR30 100280 /* UNUSED */ -#define GLU_NURBS_ERROR31 100281 /* unconnected trim curves */ -#define GLU_NURBS_ERROR32 100282 /* unknown knot error */ -#define GLU_NURBS_ERROR33 100283 /* negative vertex count encountered */ -#define GLU_NURBS_ERROR34 100284 /* negative byte-stride */ -#define GLU_NURBS_ERROR35 100285 /* unknown type descriptor */ -#define GLU_NURBS_ERROR36 100286 /* null control point reference */ -#define GLU_NURBS_ERROR37 100287 /* duplicate point on pwlcurve */ - -/* GLU 1.3 and later */ -#define GLU_NURBS_MODE 100160 - - -/* Errors */ -#define GLU_INVALID_ENUM 100900 -#define GLU_INVALID_VALUE 100901 -#define GLU_OUT_OF_MEMORY 100902 -#define GLU_INCOMPATIBLE_GL_VERSION 100903 - -/* GLU 1.1 and later */ -#define GLU_VERSION 100800 -#define GLU_EXTENSIONS 100801 - - -/*** GLU 1.0 tessellation ***/ - -/* Contour types */ -#define GLU_CW 100120 -#define GLU_CCW 100121 -#define GLU_INTERIOR 100122 -#define GLU_EXTERIOR 100123 -#define GLU_UNKNOWN 100124 - -/* Tessellator */ -#define GLU_BEGIN GLU_TESS_BEGIN -#define GLU_VERTEX GLU_TESS_VERTEX -#define GLU_END GLU_TESS_END -#define GLU_ERROR GLU_TESS_ERROR -#define GLU_EDGE_FLAG GLU_TESS_EDGE_FLAG - - - -#if defined(__BEOS__) - /* The BeOS does something funky and makes these typedefs in one - * of its system headers. - */ -#else - -#if defined GLU_VERSION_1_2 - typedef struct GLUquadric GLUquadricObj; - typedef struct GLUnurbs GLUnurbsObj; - /* FIXME: We need to implement the other 1.3 typedefs - GH */ - typedef struct GLUtesselator GLUtesselator; - typedef GLUtesselator GLUtriangulatorObj; -#else - /* GLU 1.1 and older */ - typedef struct GLUquadric GLUquadricObj; - typedef struct GLUtriangulatorObj GLUtriangulatorObj; - typedef struct GLUnurbs GLUnurbsObj; -#endif - -#endif - - - -#if defined(__BEOS__) || defined(__QUICKDRAW__) -#pragma export on -#endif - - -/* - * - * Miscellaneous functions - * - */ - -GLUAPI void GLAPIENTRY gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez, - GLdouble centerx, GLdouble centery, - GLdouble centerz, - GLdouble upx, GLdouble upy, GLdouble upz ); - - -GLUAPI void GLAPIENTRY gluOrtho2D( GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top ); - - -GLUAPI void GLAPIENTRY gluPerspective( GLdouble fovy, GLdouble aspect, - GLdouble zNear, GLdouble zFar ); - - -GLUAPI void GLAPIENTRY gluPickMatrix( GLdouble x, GLdouble y, - GLdouble width, GLdouble height, - const GLint viewport[4] ); - -GLUAPI GLint GLAPIENTRY gluProject( GLdouble objx, GLdouble objy, GLdouble objz, - const GLdouble modelMatrix[16], - const GLdouble projMatrix[16], - const GLint viewport[4], - GLdouble *winx, GLdouble *winy, - GLdouble *winz ); - -GLUAPI GLint GLAPIENTRY gluUnProject( GLdouble winx, GLdouble winy, - GLdouble winz, - const GLdouble modelMatrix[16], - const GLdouble projMatrix[16], - const GLint viewport[4], - GLdouble *objx, GLdouble *objy, - GLdouble *objz ); - -GLUAPI const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode ); - - - -/* - * - * Mipmapping and image scaling - * - */ - -GLUAPI GLint GLAPIENTRY gluScaleImage( GLenum format, - GLsizei widthin, GLsizei heightin, - GLenum typein, const void *datain, - GLsizei widthout, GLsizei heightout, - GLenum typeout, void *dataout ); - -GLUAPI GLint GLAPIENTRY gluBuild1DMipmaps( GLenum target, GLint components, - GLsizei width, GLenum format, - GLenum type, const void *data ); - -GLUAPI GLint GLAPIENTRY gluBuild2DMipmaps( GLenum target, GLint components, - GLsizei width, GLsizei height, - GLenum format, - GLenum type, const void *data ); - - - -/* - * - * Quadrics - * - */ - -GLUAPI GLUquadricObj* GLAPIENTRY gluNewQuadric( void ); - -GLUAPI void GLAPIENTRY gluDeleteQuadric( GLUquadricObj *state ); - -GLUAPI void GLAPIENTRY gluQuadricDrawStyle( GLUquadricObj *quadObject, - GLenum drawStyle ); - -GLUAPI void GLAPIENTRY gluQuadricOrientation( GLUquadricObj *quadObject, - GLenum orientation ); - -GLUAPI void GLAPIENTRY gluQuadricNormals( GLUquadricObj *quadObject, - GLenum normals ); - -GLUAPI void GLAPIENTRY gluQuadricTexture( GLUquadricObj *quadObject, - GLboolean textureCoords ); - -GLUAPI void GLAPIENTRY gluQuadricCallback( GLUquadricObj *qobj, - GLenum which, - void (GLCALLBACK *fn)() ); - -GLUAPI void GLAPIENTRY gluCylinder( GLUquadricObj *qobj, - GLdouble baseRadius, - GLdouble topRadius, - GLdouble height, - GLint slices, GLint stacks ); - -GLUAPI void GLAPIENTRY gluSphere( GLUquadricObj *qobj, - GLdouble radius, - GLint slices, GLint stacks ); - -GLUAPI void GLAPIENTRY gluDisk( GLUquadricObj *qobj, - GLdouble innerRadius, GLdouble outerRadius, - GLint slices, GLint loops ); - -GLUAPI void GLAPIENTRY gluPartialDisk( GLUquadricObj *qobj, - GLdouble innerRadius, - GLdouble outerRadius, GLint slices, - GLint loops, GLdouble startAngle, - GLdouble sweepAngle ); - +/*************************************************************/ + +/* Extensions */ +#define GLU_EXT_object_space_tess 1 +#define GLU_EXT_nurbs_tessellator 1 + +/* Boolean */ +#define GLU_FALSE 0 +#define GLU_TRUE 1 + +/* Version */ +#define GLU_VERSION_1_1 1 +#define GLU_VERSION_1_2 1 +#define GLU_VERSION_1_3 1 + +/* StringName */ +#define GLU_VERSION 100800 +#define GLU_EXTENSIONS 100801 + +/* ErrorCode */ +#define GLU_INVALID_ENUM 100900 +#define GLU_INVALID_VALUE 100901 +#define GLU_OUT_OF_MEMORY 100902 +#define GLU_INVALID_OPERATION 100904 + +/* NurbsDisplay */ +/* GLU_FILL */ +#define GLU_OUTLINE_POLYGON 100240 +#define GLU_OUTLINE_PATCH 100241 + +/* NurbsCallback */ +#define GLU_NURBS_ERROR 100103 +#define GLU_ERROR 100103 +#define GLU_NURBS_BEGIN 100164 +#define GLU_NURBS_BEGIN_EXT 100164 +#define GLU_NURBS_VERTEX 100165 +#define GLU_NURBS_VERTEX_EXT 100165 +#define GLU_NURBS_NORMAL 100166 +#define GLU_NURBS_NORMAL_EXT 100166 +#define GLU_NURBS_COLOR 100167 +#define GLU_NURBS_COLOR_EXT 100167 +#define GLU_NURBS_TEXTURE_COORD 100168 +#define GLU_NURBS_TEX_COORD_EXT 100168 +#define GLU_NURBS_END 100169 +#define GLU_NURBS_END_EXT 100169 +#define GLU_NURBS_BEGIN_DATA 100170 +#define GLU_NURBS_BEGIN_DATA_EXT 100170 +#define GLU_NURBS_VERTEX_DATA 100171 +#define GLU_NURBS_VERTEX_DATA_EXT 100171 +#define GLU_NURBS_NORMAL_DATA 100172 +#define GLU_NURBS_NORMAL_DATA_EXT 100172 +#define GLU_NURBS_COLOR_DATA 100173 +#define GLU_NURBS_COLOR_DATA_EXT 100173 +#define GLU_NURBS_TEXTURE_COORD_DATA 100174 +#define GLU_NURBS_TEX_COORD_DATA_EXT 100174 +#define GLU_NURBS_END_DATA 100175 +#define GLU_NURBS_END_DATA_EXT 100175 + +/* NurbsError */ +#define GLU_NURBS_ERROR1 100251 +#define GLU_NURBS_ERROR2 100252 +#define GLU_NURBS_ERROR3 100253 +#define GLU_NURBS_ERROR4 100254 +#define GLU_NURBS_ERROR5 100255 +#define GLU_NURBS_ERROR6 100256 +#define GLU_NURBS_ERROR7 100257 +#define GLU_NURBS_ERROR8 100258 +#define GLU_NURBS_ERROR9 100259 +#define GLU_NURBS_ERROR10 100260 +#define GLU_NURBS_ERROR11 100261 +#define GLU_NURBS_ERROR12 100262 +#define GLU_NURBS_ERROR13 100263 +#define GLU_NURBS_ERROR14 100264 +#define GLU_NURBS_ERROR15 100265 +#define GLU_NURBS_ERROR16 100266 +#define GLU_NURBS_ERROR17 100267 +#define GLU_NURBS_ERROR18 100268 +#define GLU_NURBS_ERROR19 100269 +#define GLU_NURBS_ERROR20 100270 +#define GLU_NURBS_ERROR21 100271 +#define GLU_NURBS_ERROR22 100272 +#define GLU_NURBS_ERROR23 100273 +#define GLU_NURBS_ERROR24 100274 +#define GLU_NURBS_ERROR25 100275 +#define GLU_NURBS_ERROR26 100276 +#define GLU_NURBS_ERROR27 100277 +#define GLU_NURBS_ERROR28 100278 +#define GLU_NURBS_ERROR29 100279 +#define GLU_NURBS_ERROR30 100280 +#define GLU_NURBS_ERROR31 100281 +#define GLU_NURBS_ERROR32 100282 +#define GLU_NURBS_ERROR33 100283 +#define GLU_NURBS_ERROR34 100284 +#define GLU_NURBS_ERROR35 100285 +#define GLU_NURBS_ERROR36 100286 +#define GLU_NURBS_ERROR37 100287 + +/* NurbsProperty */ +#define GLU_AUTO_LOAD_MATRIX 100200 +#define GLU_CULLING 100201 +#define GLU_SAMPLING_TOLERANCE 100203 +#define GLU_DISPLAY_MODE 100204 +#define GLU_PARAMETRIC_TOLERANCE 100202 +#define GLU_SAMPLING_METHOD 100205 +#define GLU_U_STEP 100206 +#define GLU_V_STEP 100207 +#define GLU_NURBS_MODE 100160 +#define GLU_NURBS_MODE_EXT 100160 +#define GLU_NURBS_TESSELLATOR 100161 +#define GLU_NURBS_TESSELLATOR_EXT 100161 +#define GLU_NURBS_RENDERER 100162 +#define GLU_NURBS_RENDERER_EXT 100162 + +/* NurbsSampling */ +#define GLU_OBJECT_PARAMETRIC_ERROR 100208 +#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208 +#define GLU_OBJECT_PATH_LENGTH 100209 +#define GLU_OBJECT_PATH_LENGTH_EXT 100209 +#define GLU_PATH_LENGTH 100215 +#define GLU_PARAMETRIC_ERROR 100216 +#define GLU_DOMAIN_DISTANCE 100217 + +/* NurbsTrim */ +#define GLU_MAP1_TRIM_2 100210 +#define GLU_MAP1_TRIM_3 100211 + +/* QuadricDrawStyle */ +#define GLU_POINT 100010 +#define GLU_LINE 100011 +#define GLU_FILL 100012 +#define GLU_SILHOUETTE 100013 + +/* QuadricCallback */ +/* GLU_ERROR */ + +/* QuadricNormal */ +#define GLU_SMOOTH 100000 +#define GLU_FLAT 100001 +#define GLU_NONE 100002 + +/* QuadricOrientation */ +#define GLU_OUTSIDE 100020 +#define GLU_INSIDE 100021 + +/* TessCallback */ +#define GLU_TESS_BEGIN 100100 +#define GLU_BEGIN 100100 +#define GLU_TESS_VERTEX 100101 +#define GLU_VERTEX 100101 +#define GLU_TESS_END 100102 +#define GLU_END 100102 +#define GLU_TESS_ERROR 100103 +#define GLU_TESS_EDGE_FLAG 100104 +#define GLU_EDGE_FLAG 100104 +#define GLU_TESS_COMBINE 100105 +#define GLU_TESS_BEGIN_DATA 100106 +#define GLU_TESS_VERTEX_DATA 100107 +#define GLU_TESS_END_DATA 100108 +#define GLU_TESS_ERROR_DATA 100109 +#define GLU_TESS_EDGE_FLAG_DATA 100110 +#define GLU_TESS_COMBINE_DATA 100111 + +/* TessContour */ +#define GLU_CW 100120 +#define GLU_CCW 100121 +#define GLU_INTERIOR 100122 +#define GLU_EXTERIOR 100123 +#define GLU_UNKNOWN 100124 + +/* TessProperty */ +#define GLU_TESS_WINDING_RULE 100140 +#define GLU_TESS_BOUNDARY_ONLY 100141 +#define GLU_TESS_TOLERANCE 100142 + +/* TessError */ +#define GLU_TESS_ERROR1 100151 +#define GLU_TESS_ERROR2 100152 +#define GLU_TESS_ERROR3 100153 +#define GLU_TESS_ERROR4 100154 +#define GLU_TESS_ERROR5 100155 +#define GLU_TESS_ERROR6 100156 +#define GLU_TESS_ERROR7 100157 +#define GLU_TESS_ERROR8 100158 +#define GLU_TESS_MISSING_BEGIN_POLYGON 100151 +#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152 +#define GLU_TESS_MISSING_END_POLYGON 100153 +#define GLU_TESS_MISSING_END_CONTOUR 100154 +#define GLU_TESS_COORD_TOO_LARGE 100155 +#define GLU_TESS_NEED_COMBINE_CALLBACK 100156 + +/* TessWinding */ +#define GLU_TESS_WINDING_ODD 100130 +#define GLU_TESS_WINDING_NONZERO 100131 +#define GLU_TESS_WINDING_POSITIVE 100132 +#define GLU_TESS_WINDING_NEGATIVE 100133 +#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134 + +/*************************************************************/ -/* - * - * Nurbs - * - */ - -GLUAPI GLUnurbsObj* GLAPIENTRY gluNewNurbsRenderer( void ); - -GLUAPI void GLAPIENTRY gluDeleteNurbsRenderer( GLUnurbsObj *nobj ); - -GLUAPI void GLAPIENTRY gluLoadSamplingMatrices( GLUnurbsObj *nobj, - const GLfloat modelMatrix[16], - const GLfloat projMatrix[16], - const GLint viewport[4] ); - -GLUAPI void GLAPIENTRY gluNurbsProperty( GLUnurbsObj *nobj, GLenum property, - GLfloat value ); - -GLUAPI void GLAPIENTRY gluGetNurbsProperty( GLUnurbsObj *nobj, GLenum property, - GLfloat *value ); - -GLUAPI void GLAPIENTRY gluBeginCurve( GLUnurbsObj *nobj ); - -GLUAPI void GLAPIENTRY gluEndCurve( GLUnurbsObj * nobj ); - -GLUAPI void GLAPIENTRY gluNurbsCurve( GLUnurbsObj *nobj, GLint nknots, - GLfloat *knot, GLint stride, - GLfloat *ctlarray, GLint order, - GLenum type ); - -GLUAPI void GLAPIENTRY gluBeginSurface( GLUnurbsObj *nobj ); - -GLUAPI void GLAPIENTRY gluEndSurface( GLUnurbsObj * nobj ); - -GLUAPI void GLAPIENTRY gluNurbsSurface( GLUnurbsObj *nobj, - GLint sknot_count, GLfloat *sknot, - GLint tknot_count, GLfloat *tknot, - GLint s_stride, GLint t_stride, - GLfloat *ctlarray, - GLint sorder, GLint torder, - GLenum type ); - -GLUAPI void GLAPIENTRY gluBeginTrim( GLUnurbsObj *nobj ); - -GLUAPI void GLAPIENTRY gluEndTrim( GLUnurbsObj *nobj ); - -GLUAPI void GLAPIENTRY gluPwlCurve( GLUnurbsObj *nobj, GLint count, - GLfloat *array, - GLint stride, GLenum type ); - -GLUAPI void GLAPIENTRY gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, - void (GLCALLBACK *fn)() ); - - - -/* - * - * Polygon tessellation - * - */ - -#ifdef GLU_VERSION_1_2 - -GLUAPI GLUtesselator* GLAPIENTRY gluNewTess( void ); - -GLUAPI void GLAPIENTRY gluDeleteTess( GLUtesselator *tobj ); - -GLUAPI void GLAPIENTRY gluTessBeginPolygon( GLUtesselator *tobj, - void *polygon_data ); - -GLUAPI void GLAPIENTRY gluTessBeginContour( GLUtesselator *tobj ); - -GLUAPI void GLAPIENTRY gluTessVertex( GLUtesselator *tobj, GLdouble coords[3], - void *vertex_data ); - -GLUAPI void GLAPIENTRY gluTessEndContour( GLUtesselator *tobj ); - -GLUAPI void GLAPIENTRY gluTessEndPolygon( GLUtesselator *tobj ); - -GLUAPI void GLAPIENTRY gluTessProperty( GLUtesselator *tobj, GLenum which, - GLdouble value ); - -GLUAPI void GLAPIENTRY gluTessNormal( GLUtesselator *tobj, GLdouble x, - GLdouble y, GLdouble z ); - -GLUAPI void GLAPIENTRY gluTessCallback( GLUtesselator *tobj, GLenum which, - void (GLCALLBACK *fn)() ); - -GLUAPI void GLAPIENTRY gluGetTessProperty( GLUtesselator *tobj, GLenum which, - GLdouble *value ); - +#ifdef __cplusplus +class GLUnurbs; +class GLUquadric; +class GLUtesselator; #else - -GLUAPI GLUtriangulatorObj* GLAPIENTRY gluNewTess( void ); - -GLUAPI void GLAPIENTRY gluTessCallback( GLUtriangulatorObj *tobj, GLenum which, - void (GLCALLBACK *fn)() ); - -GLUAPI void GLAPIENTRY gluDeleteTess( GLUtriangulatorObj *tobj ); - -GLUAPI void GLAPIENTRY gluBeginPolygon( GLUtriangulatorObj *tobj ); - -GLUAPI void GLAPIENTRY gluEndPolygon( GLUtriangulatorObj *tobj ); - -GLUAPI void GLAPIENTRY gluNextContour( GLUtriangulatorObj *tobj, GLenum type ); - -GLUAPI void GLAPIENTRY gluTessVertex( GLUtriangulatorObj *tobj, GLdouble v[3], - void *data ); - -#endif - - - - -/* - * - * New functions in GLU 1.1 - * - */ - -GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name ); - - - -/* - * - * GLU 1.3 functions - * - */ - -#ifdef GLU_VERSION_1_3 - -GLUAPI GLboolean GLAPIENTRY -gluCheckExtension( const char *extName, const GLubyte *extString ); - -#endif - - - -#if defined(__BEOS__) || defined(__QUICKDRAW__) -#pragma export off -#endif - - -#ifdef macintosh - #pragma enumsalwaysint reset - #if PRAGMA_IMPORT_SUPPORTED - #pragma import off - #endif +typedef struct GLUnurbs GLUnurbs; +typedef struct GLUquadric GLUquadric; +typedef struct GLUtesselator GLUtesselator; #endif +typedef struct GLUnurbs GLUnurbsObj; +typedef struct GLUquadric GLUquadricObj; +typedef struct GLUtesselator GLUtesselatorObj; +typedef struct GLUtesselator GLUtriangulatorObj; + +#define GLU_TESS_MAX_COORD 1.0e150 + +/* Internal convenience typedefs */ +typedef void (*_GLUfuncptr)(); + +extern void gluBeginCurve (GLUnurbs* nurb); +extern void gluBeginPolygon (GLUtesselator* tess); +extern void gluBeginSurface (GLUnurbs* nurb); +extern void gluBeginTrim (GLUnurbs* nurb); +extern GLint gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); +extern GLint gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data); +extern GLint gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); +extern GLint gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data); +extern GLint gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); +extern GLint gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); +extern GLboolean gluCheckExtension (const GLubyte *extName, const GLubyte *extString); +extern void gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks); +extern void gluDeleteNurbsRenderer (GLUnurbs* nurb); +extern void gluDeleteQuadric (GLUquadric* quad); +extern void gluDeleteTess (GLUtesselator* tess); +extern void gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops); +extern void gluEndCurve (GLUnurbs* nurb); +extern void gluEndPolygon (GLUtesselator* tess); +extern void gluEndSurface (GLUnurbs* nurb); +extern void gluEndTrim (GLUnurbs* nurb); +extern const GLubyte * gluErrorString (GLenum error); +extern void gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data); +extern const GLubyte * gluGetString (GLenum name); +extern void gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data); +extern void gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view); +extern void gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ); +extern GLUnurbs* gluNewNurbsRenderer (void); +extern GLUquadric* gluNewQuadric (void); +extern GLUtesselator* gluNewTess (void); +extern void gluNextContour (GLUtesselator* tess, GLenum type); +extern void gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc); +extern void gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData); +extern void gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData); +extern void gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type); +extern void gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value); +extern void gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type); +extern void gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top); +extern void gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep); +extern void gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); +extern void gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport); +extern GLint gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ); +extern void gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type); +extern void gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc); +extern void gluQuadricDrawStyle (GLUquadric* quad, GLenum draw); +extern void gluQuadricNormals (GLUquadric* quad, GLenum normal); +extern void gluQuadricOrientation (GLUquadric* quad, GLenum orientation); +extern void gluQuadricTexture (GLUquadric* quad, GLboolean texture); +extern GLint gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut); +extern void gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks); +extern void gluTessBeginContour (GLUtesselator* tess); +extern void gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data); +extern void gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc); +extern void gluTessEndContour (GLUtesselator* tess); +extern void gluTessEndPolygon (GLUtesselator* tess); +extern void gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ); +extern void gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data); +extern void gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data); +extern GLint gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ); +extern GLint gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble near, GLdouble far, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW); #ifdef __cplusplus } #endif - -#endif +#endif /* __glu_h__ */ -- cgit v1.2.3 From 68af9a0773d506aa04c79a178922464aa0c64ad5 Mon Sep 17 00:00:00 2001 From: pesco Date: Tue, 20 Mar 2001 00:33:18 +0000 Subject: * common_rules.make: Created to hold the conditional build rule override. All Makefile.am's updated. --- include/GL/Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/GL/Makefile.am b/include/GL/Makefile.am index 328357031b5..199bd5c8f3c 100644 --- a/include/GL/Makefile.am +++ b/include/GL/Makefile.am @@ -40,3 +40,4 @@ EXTRA_HEADERS = amesa.h dosmesa.h foomesa.h glut_h.dja mesa_wgl.h mglmesa.h \ GLinclude_HEADERS = gl.h glext.h gl_mangle.h glu.h glu_mangle.h \ $(sel_inc_fx) $(sel_inc_ggi) $(sel_inc_osmesa) $(sel_inc_svga) \ $(sel_inc_x11) $(sel_inc_glut) +include $(top_srcdir)/common_rules.make -- cgit v1.2.3 From 2743def830bc1dc3bedb302f13db3d65dc4705d7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Mar 2001 16:00:17 +0000 Subject: sync'd with the latest changes in XFree86 (cygwin stuff) --- include/GL/gl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index ae03a8b9ec0..46ff10f6f14 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.51 2001/01/29 16:18:37 brianp Exp $ */ +/* $Id: gl.h,v 1.52 2001/03/21 16:00:17 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -44,11 +44,11 @@ #define OPENSTEP #endif -#if defined(_WIN32) && !defined(__WIN32__) +#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) #define __WIN32__ #endif -#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__)) +#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) # if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ # define GLAPI __declspec(dllexport) # elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ @@ -63,7 +63,7 @@ # define GLAPIENTRY #endif /* WIN32 / CYGWIN bracket */ -#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) +#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__) #include #endif -- cgit v1.2.3 From a13df148df3b663fe5ccd9a2dce1925a9cf84093 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Mar 2001 04:56:50 +0000 Subject: minor comment update --- include/GL/gl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 46ff10f6f14..5d95b912a45 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.52 2001/03/21 16:00:17 brianp Exp $ */ +/* $Id: gl.h,v 1.53 2001/03/22 04:56:50 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -745,7 +745,7 @@ typedef double GLclampd; /* double precision float in [0,1] */ /* - * OpenGL 1.2 imaging subset (NOT IMPLEMENTED BY MESA) + * OpenGL 1.2 imaging subset */ /* GL_EXT_color_table */ #define GL_COLOR_TABLE 0x80D0 -- cgit v1.2.3 From 5535aca5dffdfb8ad9a1970a062e6109227aa17f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Mar 2001 20:02:38 +0000 Subject: change glTexImage3D() internalFormat to GLenum to match other OpenGLs --- include/GL/gl.h | 4 ++-- src/mesa/glapi/glapitable.h | 2 +- src/mesa/glapi/glapitemp.h | 4 ++-- src/mesa/main/teximage.c | 13 +++++++------ src/mesa/main/teximage.h | 4 ++-- 5 files changed, 14 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 5d95b912a45..888d13d403c 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.53 2001/03/22 04:56:50 brianp Exp $ */ +/* $Id: gl.h,v 1.54 2001/03/26 20:02:38 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1591,7 +1591,7 @@ GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ); GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level, - GLint internalFormat, + GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, diff --git a/src/mesa/glapi/glapitable.h b/src/mesa/glapi/glapitable.h index 248b936149b..b20ca8c5844 100644 --- a/src/mesa/glapi/glapitable.h +++ b/src/mesa/glapi/glapitable.h @@ -377,7 +377,7 @@ struct _glapi_table void (*Minmax)(GLenum target, GLenum internalformat, GLboolean sink); /* 368 */ void (*ResetHistogram)(GLenum target); /* 369 */ void (*ResetMinmax)(GLenum target); /* 370 */ - void (*TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 371 */ + void (*TexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 371 */ void (*TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); /* 372 */ void (*CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 373 */ void (*ActiveTextureARB)(GLenum texture); /* 374 */ diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index 62038f54a9b..b4e8273eca1 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -1,4 +1,4 @@ -/* $Id: glapitemp.h,v 1.25 2001/03/12 00:48:38 gareth Exp $ */ +/* $Id: glapitemp.h,v 1.26 2001/03/26 20:02:38 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1155,7 +1155,7 @@ KEYWORD1 void KEYWORD2 NAME(DrawRangeElements)(GLenum mode, GLuint start, GLuint DISPATCH(DrawRangeElements, (mode, start, end, count, type, indices), (F, ";")); } -KEYWORD1 void KEYWORD2 NAME(TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) +KEYWORD1 void KEYWORD2 NAME(TexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) { DISPATCH(TexImage3D, (target, level, internalformat, width, height, depth, border, format, type, pixels), (F, ";")); } diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index cb7447769c7..a92172a39b2 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1,4 +1,4 @@ -/* $Id: teximage.c,v 1.86 2001/03/19 02:25:35 keithw Exp $ */ +/* $Id: teximage.c,v 1.87 2001/03/26 20:02:38 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1511,7 +1511,7 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, * Note that width and height include the border. */ void -_mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, +_mesa_TexImage3D( GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) @@ -1524,7 +1524,7 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, struct gl_texture_object *texObj; struct gl_texture_image *texImage; - if (texture_error_check(ctx, target, level, internalFormat, + if (texture_error_check(ctx, target, level, (GLint) internalFormat, format, type, 3, width, height, depth, border)) { return; /* error was recorded */ } @@ -1554,7 +1554,7 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, ASSERT(ctx->Driver.TexImage3D); if (pixels) { - (*ctx->Driver.TexImage3D)(ctx, target, level, internalFormat, + (*ctx->Driver.TexImage3D)(ctx, target, level, (GLint) internalFormat, width, height, depth, border, format, type, pixels, &ctx->Unpack, texObj, texImage); @@ -1562,7 +1562,8 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, else { GLubyte *dummy = make_null_texture(width, height, depth, format); if (dummy) { - (*ctx->Driver.TexImage3D)(ctx, target, level, internalFormat, + (*ctx->Driver.TexImage3D)(ctx, target, level, + (GLint) internalFormat, width, height, depth, border, format, GL_UNSIGNED_BYTE, dummy, &_mesa_native_packing, texObj, texImage); @@ -1618,7 +1619,7 @@ _mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalFormat, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) { - _mesa_TexImage3D(target, level, (GLint) internalFormat, width, height, + _mesa_TexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels); } diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h index a19f806118c..b5664e4efaa 100644 --- a/src/mesa/main/teximage.h +++ b/src/mesa/main/teximage.h @@ -1,4 +1,4 @@ -/* $Id: teximage.h,v 1.17 2001/03/12 00:48:38 gareth Exp $ */ +/* $Id: teximage.h,v 1.18 2001/03/26 20:02:39 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -74,7 +74,7 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalformat, extern void -_mesa_TexImage3D( GLenum target, GLint level, GLint internalformat, +_mesa_TexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ); -- cgit v1.2.3 From 54207dfde64f976ea2c00d3a3fcd0bf6d0b05b36 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Apr 2001 22:33:03 +0000 Subject: added SecondaryColor functions --- include/GL/gl_mangle.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 27fac2cd57c..f801b716c54 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -1,4 +1,4 @@ -/* $Id: gl_mangle.h,v 1.5 2001/02/19 18:28:59 brianp Exp $ */ +/* $Id: gl_mangle.h,v 1.6 2001/04/19 22:33:03 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -658,5 +658,22 @@ #define glMultTransposeMatrixdARB mglMultTransposeMatrixdARB #define glLoadTransposeMatrixfARB mglLoadTransposeMatrixfARB #define glLoadTransposeMatrixdARB mglLoadTransposeMatrixdARB +#define glSecondaryColor3fEXT mglSecondaryColor3fEXT +#define glSecondaryColor3ubEXT mglSecondaryColor3ubEXT +#define glSecondaryColor3uivEXT mglSecondaryColor3uivEXT +#define glSecondaryColor3ubvEXT mglSecondaryColor3ubvEXT +#define glSecondaryColor3svEXT mglSecondaryColor3svEXT +#define glSecondaryColor3ivEXT mglSecondaryColor3ivEXT +#define glSecondaryColor3fvEXT mglSecondaryColor3fvEXT +#define glSecondaryColor3dvEXT mglSecondaryColor3dvEXT +#define glSecondaryColor3bvEXT mglSecondaryColor3bvEXT +#define glSecondaryColor3usvEXT mglSecondaryColor3usvEXT +#define glSecondaryColorPointerEXT mglSecondaryColorPointerEXT +#define glSecondaryColor3iEXT mglSecondaryColor3iEXT +#define glSecondaryColor3dEXT mglSecondaryColor3dEXT +#define glSecondaryColor3bEXT mglSecondaryColor3bEXT +#define glSecondaryColor3uiEXT mglSecondaryColor3uiEXT +#define glSecondaryColor3usEXT mglSecondaryColor3usEXT +#define glSecondaryColor3sEXT mglSecondaryColor3sEXT #endif -- cgit v1.2.3 From 4c00e30ef0190a0d22a3035fb27a66a5e74af6a6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Apr 2001 22:34:05 +0000 Subject: added GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_ARB_texture_border_clamp (temporary until SGI updates this file) --- include/GL/glext.h | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 774d57284c1..66fad470f0e 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -271,6 +271,40 @@ extern "C" { #define GL_MODELVIEW31_ARB 0x873F #endif +#ifndef GL_ARB_texture_env_combine +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif + #ifndef GL_EXT_abgr #define GL_ABGR_EXT 0x8000 #endif @@ -1718,8 +1752,16 @@ typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GL typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img); #endif -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 #endif #ifndef GL_EXT_blend_color -- cgit v1.2.3 From df4fd765d5244cc09f18f6b0371909e7bf13be87 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 24 Apr 2001 16:12:48 +0000 Subject: reordered a few blend enums --- include/GL/gl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 888d13d403c..6b6fcf4295a 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.54 2001/03/26 20:02:38 brianp Exp $ */ +/* $Id: gl.h,v 1.55 2001/04/24 16:12:48 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -325,12 +325,12 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_ONE 0x1 #define GL_SRC_COLOR 0x0300 #define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_DST_COLOR 0x0306 -#define GL_ONE_MINUS_DST_COLOR 0x0307 #define GL_SRC_ALPHA 0x0302 #define GL_ONE_MINUS_SRC_ALPHA 0x0303 #define GL_DST_ALPHA 0x0304 #define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 #define GL_SRC_ALPHA_SATURATE 0x0308 #define GL_CONSTANT_COLOR 0x8001 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -- cgit v1.2.3 From ac4a41d198111fb1b0f564cbd2b82217dd6fc265 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 29 Apr 2001 19:31:45 +0000 Subject: sync with XFree86/DRI glcore.h, now identical --- include/GL/internal/glcore.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/GL/internal/glcore.h b/include/GL/internal/glcore.h index 70b75727988..8bb73e6543d 100644 --- a/include/GL/internal/glcore.h +++ b/include/GL/internal/glcore.h @@ -1,3 +1,4 @@ +/* $XFree86: xc/lib/GL/include/GL/internal/glcore.h,v 1.7 2001/03/25 05:32:00 tsi Exp $ */ #ifndef __gl_core_h_ #define __gl_core_h_ @@ -34,19 +35,12 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/01/13 05:47:06 $ $Revision: 1.2 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/internal/glcore.h,v 1.2 2001/01/13 05:47:06 keithw Exp $ */ #ifndef XFree86LOADER #include #endif -#ifdef CAPI -#undef CAPI -#endif -#define CAPI - #define GL_CORE_SGI 1 #define GL_CORE_MESA 2 @@ -225,7 +219,11 @@ struct __GLdrawableBufferRec { /* exported */ void (*freePrivate)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); +#ifdef __cplusplus + void *privatePtr; +#else void *private; +#endif /* private */ void *other; /* implementation private data */ @@ -280,7 +278,7 @@ struct __GLdrawablePrivateRec { __GLdrawableBuffer accumBuffer; __GLdrawableBuffer depthBuffer; __GLdrawableBuffer stencilBuffer; -#if __GL_NUMBER_OF_AUX_BUFFERS > 0 +#if defined(__GL_NUMBER_OF_AUX_BUFFERS) && (__GL_NUMBER_OF_AUX_BUFFERS > 0) __GLdrawableBuffer *auxBuffer; #endif @@ -316,7 +314,12 @@ struct __GLdrawablePrivateRec { void (*unlockDP)(__GLdrawablePrivate *glPriv); /* exported */ + void *wsPriv; /* pointer to the window system DrawablePrivate */ +#ifdef __cplusplus + void *privatePtr; +#else void *private; +#endif void (*freePrivate)(__GLdrawablePrivate *); /* client data */ @@ -370,6 +373,9 @@ typedef struct __GLimportsRec { /* Drawing surface management */ __GLdrawablePrivate *(*getDrawablePrivate)(__GLcontext *gc); + /* Pointer to the window system context */ + void *wscx; + /* Operating system dependent data goes here */ void *other; } __GLimports; @@ -384,7 +390,7 @@ typedef struct __GLexportsRec { /* Context management (return GL_FALSE on failure) */ GLboolean (*destroyContext)(__GLcontext *gc); GLboolean (*loseCurrent)(__GLcontext *gc); - GLboolean (*makeCurrent)(__GLcontext *gc, __GLdrawablePrivate *glPriv); + GLboolean (*makeCurrent)(__GLcontext *gc); GLboolean (*shareContext)(__GLcontext *gc, __GLcontext *gcShare); GLboolean (*copyContext)(__GLcontext *dst, const __GLcontext *src, GLuint mask); GLboolean (*forceCurrent)(__GLcontext *gc); -- cgit v1.2.3 From c329f0824caf6756041516cfee843fc6f6cd3f8a Mon Sep 17 00:00:00 2001 From: Gareth Hughes Date: Mon, 7 May 2001 13:58:00 +0000 Subject: Initial new Win32 build support. More to come. --- include/GL/mesa_wgl.h | 248 +++++++++++++-------------- src/mesa/main/Makefile.win | 182 ++++++++++++++++++++ src/mesa/main/mesa.def | 405 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 712 insertions(+), 123 deletions(-) create mode 100644 src/mesa/main/Makefile.win create mode 100644 src/mesa/main/mesa.def (limited to 'include') diff --git a/include/GL/mesa_wgl.h b/include/GL/mesa_wgl.h index 8a0a55dfe59..8a7b746857d 100644 --- a/include/GL/mesa_wgl.h +++ b/include/GL/mesa_wgl.h @@ -1,123 +1,125 @@ -/* $Id: mesa_wgl.h,v 1.5 2000/05/22 16:21:27 brianp Exp $ */ - -/* - * Mesa 3-D graphics library - * Version: 3.1 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -/* prototypes for the Mesa WGL functions */ -/* relocated here so that I could make GLUT get them properly */ - -#ifndef _mesa_wgl_h_ -#define _mesa_wgl_h_ - - -#include - -#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_ */ +/* $Id: mesa_wgl.h,v 1.6 2001/05/07 13:58:00 gareth 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 */ + +#define _mesa_wgl_h_ + +#ifndef _mesa_wgl_h_ +#define _mesa_wgl_h_ + + +#include + +#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/src/mesa/main/Makefile.win b/src/mesa/main/Makefile.win new file mode 100644 index 00000000000..3b3710a6c29 --- /dev/null +++ b/src/mesa/main/Makefile.win @@ -0,0 +1,182 @@ +# Makefile for Win32 + +!include + +TOP = .. + +CORE_SRCS = \ + tnl\t_array_api.c \ + tnl\t_array_import.c \ + tnl\t_context.c \ + tnl\t_eval_api.c \ + tnl\t_imm_alloc.c \ + tnl\t_imm_api.c \ + tnl\t_imm_debug.c \ + tnl\t_imm_dlist.c \ + tnl\t_imm_elt.c \ + tnl\t_imm_eval.c \ + tnl\t_imm_exec.c \ + tnl\t_imm_fixup.c \ + tnl\t_pipeline.c \ + tnl\t_vb_fog.c \ + tnl\t_vb_light.c \ + tnl\t_vb_normals.c \ + tnl\t_vb_points.c \ + tnl\t_vb_render.c \ + tnl\t_vb_texgen.c \ + tnl\t_vb_texmat.c \ + tnl\t_vb_vertex.c \ + swrast_setup\ss_context.c \ + swrast_setup\ss_triangle.c \ + swrast_setup\ss_vb.c \ + swrast_setup\ss_interp.c \ + api_loopback.c \ + api_noop.c \ + api_validate.c \ + accum.c \ + alpha.c \ + attrib.c \ + bitmap.c \ + blend.c \ + buffers.c \ + clip.c \ + colortab.c \ + config.c \ + context.c \ + convolve.c \ + copypix.c \ + debug.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 \ + glthread.c \ + hash.c \ + highpc.c \ + hint.c \ + histogram.c \ + image.c \ + imports.c \ + light.c \ + lines.c \ + logic.c \ + lowpc.c \ + masking.c \ + matrix.c \ + mem.c \ + mmath.c \ + pixel.c \ + pixeltex.c \ + points.c \ + polygon.c \ + rastpos.c \ + readpix.c \ + scissor.c \ + state.c \ + stencil.c \ + teximage.c \ + texobj.c \ + texstate.c \ + texstore.c \ + texutil.c \ + varray.c \ + vtxfmt.c \ + winpos.c \ + X86\x86.c \ + X86\common_x86.c \ + X86\3dnow.c \ + X86\sse.c \ + math\m_debug_norm.c \ + math\m_debug_vertex.c \ + math\m_debug_xform.c \ + math\m_eval.c \ + math\m_matrix.c \ + math\m_translate.c \ + math\m_vector.c \ + math\m_vertices.c \ + math\m_xform.c \ + array_cache\ac_context.c \ + array_cache\ac_import.c \ + swrast\s_aaline.c \ + swrast\s_aatriangle.c \ + swrast\s_accum.c \ + swrast\s_alpha.c \ + swrast\s_alphabuf.c \ + swrast\s_bitmap.c \ + swrast\s_blend.c \ + swrast\s_buffers.c \ + swrast\s_copypix.c \ + swrast\s_context.c \ + swrast\s_depth.c \ + swrast\s_drawpix.c \ + swrast\s_feedback.c \ + swrast\s_fog.c \ + swrast\s_histogram.c \ + swrast\s_lines.c \ + swrast\s_logic.c \ + swrast\s_masking.c \ + swrast\s_pb.c \ + swrast\s_pixeltex.c \ + swrast\s_points.c \ + swrast\s_readpix.c \ + swrast\s_scissor.c \ + swrast\s_span.c \ + swrast\s_stencil.c \ + swrast\s_texture.c \ + swrast\s_triangle.c \ + swrast\s_zoom.c + +DRIVER_SRCS = \ + Trace\tr_context.c \ + Trace\tr_control.c \ + Trace\tr_error.c \ + Trace\tr_support.c \ + Trace\tr_wrapper.c \ + Trace\tr_write.c + +ASM_SRCS = + +SRCS = $(CORE_SRCS) $(DRIVER_SRCS) + +OSMESA_SRCS = OSmesa\osmesa.c +OSMESA_OBJS = OSmesa\osmesa.obj + +all : mesadll install + +!include "$(TOP)/mesawin32.mak" + +mesadll : $(MESADLL) + +CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ +LFLAGS = $(dlllflags) $(LFLAGS) + +OBJS = $(ASM_SRCS:.S=.obj) $(CORE_SRCS:.c=.obj) $(DRIVER_SRCS:.c=.obj) +LIBS = $(OPENGL) $(GLU) winmm.lib $(guilibsdll) + +$(MESADLL) : $(OBJS) mesa.def + $(link) $(LFLAGS) -out:$(MESADLL) -def:mesa.def $(OBJS) $(LIBS) + +#install : $(MESADLL) +# @echo "copying Mesa dynamic link library to system directory..." +# -copy $(MESADLL) $(DLLINSTALL) +# @echo "copying Mesa header files to include directory..." +# -copy ..\..\include\GL\gl.h $(INCLUDEINSTALL) +# -copy ..\..\include\GL\glext.h $(INCLUDEINSTALL) +# @echo "copying Mesa import library to library directory..." +# -copy $(MESALIB) $(LIBINSTALL) +install : $(MESADLL) + @echo "copying Mesa dynamic link library to system directory..." + -copy $(MESADLL) $(TOP)\lib + @echo "copying Mesa import library to library directory..." + -copy $(MESALIB) $(TOP)\lib + +.c.obj : + $(cc) $(CFLAGS) -I. $< diff --git a/src/mesa/main/mesa.def b/src/mesa/main/mesa.def new file mode 100644 index 00000000000..5848dc90ea4 --- /dev/null +++ b/src/mesa/main/mesa.def @@ -0,0 +1,405 @@ +DESCRIPTION 'Mesa (OpenGL work-alike) for Win32' +VERSION 3.5 + +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 -- cgit v1.2.3 From e203c9cdd8ef0b0b053923e630e291f5671a9ab4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 24 May 2001 19:07:14 +0000 Subject: change GLXContext and GLXFBConfig typedefs --- include/GL/glx.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index b55c0a100bc..a4dfe2e97e2 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.26 2000/12/14 17:44:42 brianp Exp $ */ +/* $Id: glx.h,v 1.27 2001/05/24 19:07:14 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -163,11 +163,11 @@ extern "C" { -typedef void * GLXContext; +typedef struct __GLXcontextRec *GLXContext; typedef XID GLXPixmap; typedef XID GLXDrawable; /* GLX 1.3 and later */ -typedef void * GLXFBConfig; +typedef struct __GLXFBConfigRec *GLXFBConfig; typedef XID GLXFBConfigID; typedef XID GLXContextID; typedef XID GLXWindow; -- cgit v1.2.3 From 2a3cc7d90742bc173666b7b32153bce944c019e0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 25 May 2001 15:41:29 +0000 Subject: added missing GLX_SGIS_multisample tokens --- include/GL/glxext.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/glxext.h b/include/GL/glxext.h index a2b3d1e0ef6..a08967bb413 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -107,6 +107,12 @@ extern "C" { #define GLX_PBUFFER_WIDTH 0x8041 #endif +/* XXX Added by BrianP */ +#ifndef GLX_SGIS_multisample +#define GLX_SAMPLE_BUFFERS_SGIS 100000 +#define GLX_SAMPLES_SGIS 100001 +#endif + #ifndef GLX_EXT_visual_info #define GLX_X_VISUAL_TYPE_EXT 0x22 #define GLX_TRANSPARENT_TYPE_EXT 0x23 @@ -325,12 +331,9 @@ extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *); typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName); #endif -#if 0 -/* XXX the enums for this extension are missing */ #ifndef GLX_SGIS_multisample #define GLX_SGIS_multisample 1 #endif -#endif #ifndef GLX_EXT_visual_info #define GLX_EXT_visual_info 1 -- cgit v1.2.3 From b95884c53de33bdd6ec843a8ddd7243cfb93a208 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 25 May 2001 15:44:06 +0000 Subject: added void to __GLXextFuncPtr --- include/GL/glxext.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glxext.h b/include/GL/glxext.h index a08967bb413..93c2c9d4bdb 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -252,7 +252,8 @@ extern "C" { /*************************************************************/ #ifndef GLX_ARB_get_proc_address -typedef void (*__GLXextFuncPtr)(); +/* XXX Added void parameter to silence many, many warnings (BrianP) */ +typedef void (*__GLXextFuncPtr)(void); #endif #ifndef GLX_SGIX_video_source -- cgit v1.2.3 From 645c1cef13475db0db6433574807ee01ff0ceb28 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 29 May 2001 15:44:06 +0000 Subject: s/void */GLvoid */ --- include/GL/gl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 6b6fcf4295a..fc1fe5b99db 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.55 2001/04/24 16:12:48 brianp Exp $ */ +/* $Id: gl.h,v 1.56 2001/05/29 15:44:06 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1270,7 +1270,7 @@ GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type, GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr ); -GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, void **params ); +GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params ); GLAPI void GLAPIENTRY glArrayElement( GLint i ); @@ -1971,7 +1971,7 @@ GLAPI void GLAPIENTRY glTexCoordPointerEXT( GLint size, GLenum type, GLsizei str GLAPI void GLAPIENTRY glEdgeFlagPointerEXT( GLsizei stride, GLsizei count, const GLboolean *ptr ); -GLAPI void GLAPIENTRY glGetPointervEXT( GLenum pname, void **params ); +GLAPI void GLAPIENTRY glGetPointervEXT( GLenum pname, GLvoid **params ); GLAPI void GLAPIENTRY glArrayElementEXT( GLint i ); -- cgit v1.2.3 From 03d6c4c2db21774a40c748f139e37e00b956b482 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 14 Jun 2001 21:37:43 +0000 Subject: define both GL_ALL_CLIENT_ATTRIB_BITS and GL_CLIENT_ALL_ATTRIB_BITS (spec and SI don't agree) --- include/GL/gl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index fc1fe5b99db..7ebee339cab 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.56 2001/05/29 15:44:06 brianp Exp $ */ +/* $Id: gl.h,v 1.57 2001/06/14 21:37:43 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -852,7 +852,7 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 #define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 #define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF - +#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF -- cgit v1.2.3 From 9e5e5e35a0081211e3e108984bf18d7f4f31f7ea Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 20 Jun 2001 19:52:11 +0000 Subject: bumped version numbers --- include/GL/fxmesa.h | 6 +++--- include/GL/svgamesa.h | 8 ++++---- include/GL/xmesa.h | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/GL/fxmesa.h b/include/GL/fxmesa.h index be1bb7570e4..329c20bbfc4 100644 --- a/include/GL/fxmesa.h +++ b/include/GL/fxmesa.h @@ -1,9 +1,9 @@ -/* $Id: fxmesa.h,v 1.2 1999/11/24 18:44:53 brianp Exp $ */ +/* $Id: fxmesa.h,v 1.3 2001/06/20 19:52:11 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 3.3 - * Copyright (C) 1995-1999 Brian Paul + * Copyright (C) 1995-2001 Brian Paul * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -41,7 +41,7 @@ extern "C" { #define FXMESA_MAJOR_VERSION 3 -#define FXMESA_MINOR_VERSION 3 +#define FXMESA_MINOR_VERSION 5 /* diff --git a/include/GL/svgamesa.h b/include/GL/svgamesa.h index 5084a2133d6..40a9951bce5 100644 --- a/include/GL/svgamesa.h +++ b/include/GL/svgamesa.h @@ -1,9 +1,9 @@ -/* $Id: svgamesa.h,v 1.4 2000/02/09 19:03:28 brianp Exp $ */ +/* $Id: svgamesa.h,v 1.5 2001/06/20 19:52:11 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul + * Version: 3.5 + * Copyright (C) 1995-2001 Brian Paul * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -53,7 +53,7 @@ #define SVGAMESA_MAJOR_VERSION 3 -#define SVGAMESA_MINOR_VERSION 3 +#define SVGAMESA_MINOR_VERSION 5 #ifdef __cplusplus diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index 52e8db279e5..b5aa6034734 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -1,10 +1,10 @@ -/* $Id: xmesa.h,v 1.10 2001/01/24 00:07:01 brianp Exp $ */ +/* $Id: xmesa.h,v 1.11 2001/06/20 19:52:11 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 * - * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 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"), @@ -90,7 +90,7 @@ extern struct Library *XLibBase; #define XMESA_MAJOR_VERSION 3 -#define XMESA_MINOR_VERSION 3 +#define XMESA_MINOR_VERSION 5 -- cgit v1.2.3 From 657323bf03a575bf40cff83119f201a9dcd1478e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 25 Jun 2001 15:29:11 +0000 Subject: added missing GLX_PBUFFER_WIDTH/HEIGHT tokens --- include/GL/glx.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index a4dfe2e97e2..ab8f5f60885 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.27 2001/05/24 19:07:14 brianp Exp $ */ +/* $Id: glx.h,v 1.28 2001/06/25 15:29:11 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -160,6 +160,8 @@ extern "C" { #define GLX_SAVED 0x8021 #define GLX_WINDOW 0x8022 #define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 -- cgit v1.2.3 From 206eda8b69ab3c63e9597015189f49d1bda9356f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 27 Jun 2001 13:56:17 +0000 Subject: support for RGB_565 pixels (Lars Andersson), untested --- include/GL/osmesa.h | 3 +- src/mesa/drivers/osmesa/osmesa.c | 215 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 214 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h index 4af2c69c4e3..0e4a10b2f8b 100644 --- a/include/GL/osmesa.h +++ b/include/GL/osmesa.h @@ -1,4 +1,4 @@ -/* $Id: osmesa.h,v 1.6 2000/09/08 16:41:38 brianp Exp $ */ +/* $Id: osmesa.h,v 1.7 2001/06/27 13:56:17 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -77,6 +77,7 @@ extern "C" { #define OSMESA_ARGB 0x2 #define OSMESA_RGB GL_RGB #define OSMESA_BGR 0x4 +#define OSMESA_RGB_565 0x5 /* diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 6cea55f78ea..b93683ae2a7 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1,4 +1,4 @@ -/* $Id: osmesa.c,v 1.58 2001/06/15 13:41:12 brianp Exp $ */ +/* $Id: osmesa.c,v 1.59 2001/06/27 13:56:17 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -251,6 +251,22 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, rgbmode = GL_TRUE; swalpha = GL_TRUE; } + else if (format==OSMESA_RGB_565) { + indexBits = 0; + redBits = 5; + greenBits = 6; + blueBits = 5; + alphaBits = 0; + rshift = 11; + gshift = 5; + bshift = 0; + ashift = 0; + rind = 0; /* not used */ + gind = 0; + bind = 0; + rgbmode = GL_TRUE; + swalpha = GL_FALSE; + } else { return NULL; } @@ -377,6 +393,10 @@ static void compute_row_addresses( OSMesaContext ctx ) /* RGB mode */ bytesPerPixel = 3 * sizeof(GLchan); } + else if (ctx->format == OSMESA_RGB_565) { + /* 5/6/5 RGB pixel in 16 bits */ + bytesPerPixel = 2; + } else { /* RGBA mode */ bytesPerPixel = 4 * sizeof(GLchan); @@ -421,7 +441,7 @@ static void compute_row_addresses( OSMesaContext ctx ) * Input: ctx - the rendering context * buffer - the image buffer memory * type - data type for pixel components, only GL_UNSIGNED_BYTE - * supported now + * and GL_UNSIGNED_SHORT_5_6_5 supported now. * width, height - size of image buffer in pixels, at least 1 * Return: GL_TRUE if success, GL_FALSE if error because of invalid ctx, * invalid buffer address, type!=GL_UNSIGNED_BYTE, width<1, height<1, @@ -431,12 +451,19 @@ GLboolean GLAPIENTRY OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type, GLsizei width, GLsizei height ) { - if (!ctx || !buffer || type != CHAN_TYPE || + if (!ctx || !buffer || width < 1 || height < 1 || width > MAX_WIDTH || height > MAX_HEIGHT) { return GL_FALSE; } + if (ctx->format == OSMESA_RGB_565 && type != GL_UNSIGNED_SHORT_5_6_5) { + return GL_FALSE; + } + else if (type != CHAN_TYPE) { + return GL_FALSE; + } + osmesa_update_state( &ctx->gl_ctx, 0 ); _mesa_make_current( &ctx->gl_ctx, ctx->gl_buffer ); @@ -619,6 +646,11 @@ do { \ (DST)[2] = R; \ } while (0) +#define PACK_RGB_565(DST, R, G, B) \ +do { \ + (DST) = (((R) << 8) & 0xf800) | (((G) << 3) & 0x7e0) | ((B) >> 3);\ +} while (0) + #define UNPACK_RED(P) ( (P)[osmesa->rInd] ) #define UNPACK_GREEN(P) ( (P)[osmesa->gInd] ) @@ -627,6 +659,7 @@ do { \ #define PIXELADDR1(X,Y) (osmesa->rowaddr[Y] + (X)) +#define PIXELADDR2(X,Y) (osmesa->rowaddr[Y] + 2 * (X)) #define PIXELADDR3(X,Y) (osmesa->rowaddr[Y] + 3 * (X)) #define PIXELADDR4(X,Y) (osmesa->rowaddr[Y] + 4 * (X)) @@ -741,6 +774,34 @@ static void clear( GLcontext *ctx, GLbitfield mask, GLboolean all, } } } + else if (osmesa->format == OSMESA_RGB_565) { + const GLchan r = ctx->Color.ClearColor[0]; + const GLchan g = ctx->Color.ClearColor[1]; + const GLchan b = ctx->Color.ClearColor[2]; + GLushort clearPixel; + PACK_RGB_565(clearPixel, r, g, b); + if (all) { + /* Clear whole RGB buffer */ + const GLint n = osmesa->rowlength * osmesa->height; + GLushort *ptr2 = (GLushort *) osmesa->buffer; + GLuint i; + for (i = 0; i < n; i++) { + *ptr2 = clearPixel; + ptr2++; + } + } + else { + /* clear scissored region */ + GLint i, j; + for (i = 0; i < height; i++) { + GLushort *ptr2 = (GLushort *) PIXELADDR2(x, (y + i)); + for (j = 0; j < width; j++) { + *ptr2 = clearPixel; + ptr2++; + } + } + } + } else { #if CHAN_TYPE == GL_UNSIGNED_BYTE /* 4-byte pixel value */ @@ -1207,6 +1268,145 @@ read_rgba_pixels3( const GLcontext *ctx, } +/**********************************************************************/ +/***** 2 byte RGB pixel support funcs *****/ +/**********************************************************************/ + +/* Write RGBA pixels to an RGB_565 buffer. */ +static void +write_rgba_span2( const GLcontext *ctx, + GLuint n, GLint x, GLint y, + CONST GLubyte rgba[][4], const GLubyte mask[] ) +{ + OSMesaContext osmesa = OSMESA_CONTEXT(ctx); + GLushort *ptr2 = (GLushort *) PIXELADDR2(x, y); + GLuint i; + if (mask) { + for (i = 0; i < n; i++, ptr2++) { + if (mask[i]) { + PACK_RGB_565(*ptr2, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]); + } + } + } + else { + for (i = 0; i < n; i++, ptr2++) { + PACK_RGB_565(*ptr2, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]); + } + } +} + + +/* Write RGB pixels to an RGB_565 buffer. */ +static void +write_rgb_span2( const GLcontext *ctx, + GLuint n, GLint x, GLint y, + CONST GLubyte rgb[][3], const GLubyte mask[] ) +{ + OSMesaContext osmesa = OSMESA_CONTEXT(ctx); + GLushort *ptr2 = (GLushort *) PIXELADDR2(x, y); + GLuint i; + if (mask) { + for (i = 0; i < n; i++, ptr2++) { + if (mask[i]) { + PACK_RGB_565(*ptr2, rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP]); + } + } + } + else { + for (i = 0; i < n; i++, ptr2++) { + PACK_RGB_565(*ptr2, rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP]); + } + } +} + + +static void +write_monocolor_span2( const GLcontext *ctx, GLuint n, GLint x, GLint y, + const GLchan color[4], const GLubyte mask[] ) +{ + OSMesaContext osmesa = OSMESA_CONTEXT(ctx); + GLushort pixel; + GLushort *ptr2 = (GLushort *) PIXELADDR2(x, y); + GLuint i; + PACK_RGB_565(pixel, color[RCOMP], color[GCOMP], color[BCOMP]); + for (i = 0; i < n; i++, ptr2++) { + if (mask[i]) { + *ptr2 = pixel; + } + } +} + + +static void +write_rgba_pixels2( const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + CONST GLubyte rgba[][4], const GLubyte mask[] ) +{ + OSMesaContext osmesa = OSMESA_CONTEXT(ctx); + GLuint i; + for (i = 0; i < n; i++) { + if (mask[i]) { + GLushort *ptr2 = (GLushort *) PIXELADDR2(x[i],y[i]); + PACK_RGB_565(*ptr2, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]); + } + } +} + +static void +write_monocolor_pixels2( const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + const GLchan color[4], const GLubyte mask[] ) +{ + OSMesaContext osmesa = OSMESA_CONTEXT(ctx); + GLuint i; + GLushort pixel; + PACK_RGB_565(pixel, color[RCOMP], color[GCOMP], color[BCOMP]); + for (i = 0; i < n; i++) { + if (mask[i]) { + GLushort *ptr2 = (GLushort *) PIXELADDR2(x[i],y[i]); + *ptr2 = pixel; + } + } +} + +static void +read_rgba_span2( const GLcontext *ctx, + GLuint n, GLint x, GLint y, + GLubyte rgba[][4] ) +{ + OSMesaContext osmesa = OSMESA_CONTEXT(ctx); + GLuint i; + const GLushort *ptr2 = (const GLushort *) PIXELADDR2(x, y); + for (i = 0; i < n; i++, ptr2++) { + /* This should be fixed to get the low bits right */ + rgba[i][RCOMP] = (*ptr2 >> 8) & 0xFe; + rgba[i][GCOMP] = (*ptr2 >> 3) & 0xFc; + rgba[i][BCOMP] = (*ptr2 << 3) & 0xFe; + rgba[i][ACOMP] = 0; + } +} + +static void +read_rgba_pixels2( const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLubyte rgba[][4], const GLubyte mask[] ) +{ + OSMesaContext osmesa = OSMESA_CONTEXT(ctx); + GLuint i; + for (i = 0; i < n; i++) { + if (mask[i]) { + /* This should be fixed to get the low bits right */ + const GLushort *ptr2 = (const GLushort *) PIXELADDR2(x[i],y[i]); + rgba[i][RCOMP] = (*ptr2 >> 8) & 0xFE; + rgba[i][GCOMP] = (*ptr2 >> 3) & 0xFC; + rgba[i][BCOMP] = (*ptr2 << 3) & 0xFE; + rgba[i][ACOMP] = 0; + } + } +} + + + /**********************************************************************/ /***** Read/write spans/arrays of CI pixels *****/ /**********************************************************************/ @@ -1830,6 +2030,15 @@ static void osmesa_update_state( GLcontext *ctx, GLuint new_state ) swdd->ReadRGBASpan = read_rgba_span3; swdd->ReadRGBAPixels = read_rgba_pixels3; } + else if (osmesa->format == OSMESA_RGB_565) { + swdd->WriteRGBASpan = write_rgba_span2; + swdd->WriteRGBSpan = write_rgb_span2; + swdd->WriteMonoRGBASpan = write_monocolor_span2; + swdd->WriteRGBAPixels = write_rgba_pixels2; + swdd->WriteMonoRGBAPixels = write_monocolor_pixels2; + swdd->ReadRGBASpan = read_rgba_span2; + swdd->ReadRGBAPixels = read_rgba_pixels2; + } else { /* 4 GLchan / pixel in frame buffer */ swdd->WriteRGBSpan = write_rgb_span; -- cgit v1.2.3 From 086f1b8428dc9108d7186225c31ac1a13fe90c70 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 27 Jul 2001 14:26:27 +0000 Subject: added four missing GLX 1.3 tokens --- include/GL/glx.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index ab8f5f60885..1b5d78b806b 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.28 2001/06/25 15:29:11 brianp Exp $ */ +/* $Id: glx.h,v 1.29 2001/07/27 14:26:27 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -126,6 +126,9 @@ extern "C" { #define GLX_MAX_PBUFFER_PIXELS 0x8018 #define GLX_PRESERVED_CONTENTS 0x801B #define GLX_LARGEST_BUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F #define GLX_DRAWABLE_TYPE 0x8010 #define GLX_FBCONFIG_ID 0x8013 #define GLX_VISUAL_ID 0x800B @@ -154,6 +157,7 @@ extern "C" { #define GLX_TRANSPARENT_INDEX 0x8009 #define GLX_COLOR_INDEX_TYPE 0x8015 #define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_RGBA_BIT 0x00000001 #define GLX_SCREEN 0x800C #define GLX_PBUFFER_CLOBBER_MASK 0x08000000 #define GLX_DAMAGED 0x8020 -- cgit v1.2.3 From 976c26ca34f2ae8cc6f8b9f9b091efeba1311a94 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 20 Aug 2001 16:07:10 +0000 Subject: WindML driver (Stephane Raimbault) --- docs/README.WINDML | 144 ++++++++++++++ include/GL/uglglutshapes.h | 45 +++++ include/GL/uglmesa.h | 322 ++++++++++++++++++++++++++++++ progs/windml/Makefile.ugl | 68 +++++++ progs/windml/readtex.c | 365 ++++++++++++++++++++++++++++++++++ progs/windml/uglaccum.c | 240 +++++++++++++++++++++++ progs/windml/uglalldemos.c | 98 ++++++++++ progs/windml/uglbounce.c | 268 +++++++++++++++++++++++++ progs/windml/uglcube.c | 253 ++++++++++++++++++++++++ progs/windml/ugldrawpix.c | 429 ++++++++++++++++++++++++++++++++++++++++ progs/windml/uglflip.c | 219 +++++++++++++++++++++ progs/windml/uglgears.c | 422 ++++++++++++++++++++++++++++++++++++++++ progs/windml/uglicotorus.c | 311 +++++++++++++++++++++++++++++ progs/windml/uglline.c | 270 ++++++++++++++++++++++++++ progs/windml/uglolympic.c | 474 +++++++++++++++++++++++++++++++++++++++++++++ progs/windml/uglpoint.c | 266 +++++++++++++++++++++++++ progs/windml/uglstencil.c | 233 ++++++++++++++++++++++ progs/windml/uglteapot.c | 290 +++++++++++++++++++++++++++ progs/windml/ugltexcube.c | 460 +++++++++++++++++++++++++++++++++++++++++++ progs/windml/ugltexcyl.c | 399 ++++++++++++++++++++++++++++++++++++++ progs/windml/wrs_logo.bmp | Bin 0 -> 196662 bytes src/glu/mesa/Makefile.ugl | 96 +++++++++ src/mesa/main/Makefile.ugl | 367 +++++++++++++++++++++++++++++++++++ 23 files changed, 6039 insertions(+) create mode 100644 docs/README.WINDML create mode 100644 include/GL/uglglutshapes.h create mode 100644 include/GL/uglmesa.h create mode 100644 progs/windml/Makefile.ugl create mode 100644 progs/windml/readtex.c create mode 100644 progs/windml/uglaccum.c create mode 100644 progs/windml/uglalldemos.c create mode 100644 progs/windml/uglbounce.c create mode 100644 progs/windml/uglcube.c create mode 100644 progs/windml/ugldrawpix.c create mode 100644 progs/windml/uglflip.c create mode 100644 progs/windml/uglgears.c create mode 100644 progs/windml/uglicotorus.c create mode 100644 progs/windml/uglline.c create mode 100644 progs/windml/uglolympic.c create mode 100644 progs/windml/uglpoint.c create mode 100644 progs/windml/uglstencil.c create mode 100644 progs/windml/uglteapot.c create mode 100644 progs/windml/ugltexcube.c create mode 100644 progs/windml/ugltexcyl.c create mode 100644 progs/windml/wrs_logo.bmp create mode 100644 src/glu/mesa/Makefile.ugl create mode 100644 src/mesa/main/Makefile.ugl (limited to 'include') diff --git a/docs/README.WINDML b/docs/README.WINDML new file mode 100644 index 00000000000..a227d42b4db --- /dev/null +++ b/docs/README.WINDML @@ -0,0 +1,144 @@ + + WindML Driver for Mesa 3.5 + + +Requirements +------------ + +Tornado 2 + WindML, Cumulative Patchs are recommended. + +I suppose you have a valid WindML installation. Double buffer hardware +gives better performance than double buffer software so if you can +compile your WindML driver with this option, just do it. I/O +redirection is adviced in target server. + +Tested on +--------- + +During the development, my main target was a CoolMonster: +- Video card: CT69000 +- CPU: PENTIUM 266MHz + +and my host a Windows NT + Tornado 2. + + +Installation +------------ + +1. Mesa sources must be in root directory (C:\) + +2. Add the following line to your torVars.bat: +set MESA_BASE=C:\Mesa + +OR copy the new torVars.bat in your bin path: +c:/Mesa/src/ugl/tornado/torVars.sample -> +/mnt/nt/Tornado/host/x86-win32/bin/torVars (for example) + +3. In a command prompt: +$ torVars +$ cd c:\Mesa +$ make -f Makefile.ugl CPU=PENTIUM + +Take a long while... + +5. Include all the files from ugldemos folder to build some downloadable + application modules + +4. Download UGL/Mesa object files on target + +For example via the WindShell: +ld < c:\Tornado\target\lib\objMesaGL.o +ld < c:\Tornado\target\lib\objMesaUGL.o +ld < c:\Tornado\target\lib\objMesaGLU.o +ld < c:\Tornado\target\lib\objGLUTshapes.o +ld < c:\Tornado\target\lib\objMesaOS.o + +6. Download the application modules. + +7. In WindShell, run: +-> uglalldemos + +During the show some messages will appear, it provides some useful +information on key management. + + +Coding +------ + +Sample Usage: + +In addition to the usual ugl calls to initialize UGL, (may be find an +input driver), you must do the following to use the UGL/Mesa interface: + +1. Call uglMesaCreateContext() to create a UGL/Mesa rendering context, + given the display format. + +2. Call uglMesaMakeCurrent() to bind the UGL/Mesa buffers to an + UGL/Mesa Context and to make the context the current one. + +3. Make gl* calls to render your graphics. + +4. Use uglMesaSwapBuffers() when double buffering to swap front/back buffers. + +5. Before the UGL is destroyed, call MesaDestroyContext(). + +6. Before exiting, call if required uglEventQDestroy and then uglDeinitialize(); + +Limitations +----------- + +I found the following limitations in my driver : + - Color Indexed management is only in 8 bits + - The front and the back buffer must have the structure (mode and + size). A structure umc->buffer is requisite if the front and back + buffers are different. + - It isn't possible to mix UGL/OpenGL application with a software + double buffer (to fix) + +Modifications +------------ + +New files in Mesa: +- Makefile.ugl +- rules.windmlmesa +- docs/README.UGL +- include/GL/uglmesa.h +- si-glu/Makefile.ugl +- src/Makefile.ugl +- src/ugl/torGLUTShapesInit.c +- src/ugl/torMesaUGLInit.c +- src/ugl/ugl_api.c +- src/ugl/ugl_dd.c +- src/ugl/ugl_glutshapes.c +- src/ugl/ugl_line.c +- src/ugl/ugl_span.c +- src/ugl/ugl_tri.c +- src/ugl/uglmesaP.h +- ugldemos/* + +Modified files in Tornado 2.0: +- c:\Tornado\host\x86-win32\bin\torVars.bat +rem Command line build environments +set WIND_HOST_TYPE=x86-win32 +set WIND_BASE=C:\Tornado +set MESA_BASE=C:\Mesa +set PATH=%WIND_BASE%\host\%WIND_HOST_TYPE%\bin;%PATH% +- c:\Tornado\target\config\comps\VxWorks\01uglmesa.cdf +- c:\Tornado\target\h\GL\* + +Todo +---- +- GCC 2.96, ASM compilation + +Thanks to: +---------- + +Precision Insight team for their great job around Mesa, XFree, and DRI. +Wind River Systems to take me as an intern. + + +Stephane Raimbault + + + +July 24, 2001 diff --git a/include/GL/uglglutshapes.h b/include/GL/uglglutshapes.h new file mode 100644 index 00000000000..28192de2d52 --- /dev/null +++ b/include/GL/uglglutshapes.h @@ -0,0 +1,45 @@ +/* uglglutshapes.h - Public header GLUT Shapes */ + +/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */ + +/* This program is freely distributable without licensing fees and is + provided without guarantee or warrantee expressed or implied. This + program is -not- in the public domain. */ + +#ifndef GLUTSHAPES_H +#define GLUTSHAPES_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +void glutWireSphere (GLdouble radius, GLint slices, GLint stacks); +void glutSolidSphere (GLdouble radius, GLint slices, GLint stacks); +void glutWireCone (GLdouble base, GLdouble height, + GLint slices, GLint stacks); +void glutSolidCone (GLdouble base, GLdouble height, + GLint slices, GLint stacks); +void glutWireCube (GLdouble size); +void glutSolidCube (GLdouble size); +void glutWireTorus (GLdouble innerRadius, GLdouble outerRadius, + GLint sides, GLint rings); +void glutSolidTorus (GLdouble innerRadius, GLdouble outerRadius, + GLint sides, GLint rings); +void glutWireDodecahedron (void); +void glutSolidDodecahedron (void); +void glutWireOctahedron (void); +void glutSolidOctahedron (void); +void glutWireTetrahedron (void); +void glutSolidTetrahedron (void); +void glutWireIcosahedron (void); +void glutSolidIcosahedron (void); +void glutWireTeapot (GLdouble size); +void glutSolidTeapot (GLdouble size); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/GL/uglmesa.h b/include/GL/uglmesa.h new file mode 100644 index 00000000000..44f8fc035ee --- /dev/null +++ b/include/GL/uglmesa.h @@ -0,0 +1,322 @@ +/* uglmesa.h - Public header UGL/Mesa */ + +/* Copyright (C) 2001 by Wind River Systems, Inc */ + +/* + * Mesa 3-D graphics library + * Version: 3.5 + * + * The MIT License + * 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 + * THE AUTHORS OR COPYRIGHT 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. + */ + +/* + * Author: + * Stephane Raimbault + */ + +#ifndef UGLMESA_H +#define UGLMESA_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define UGL_MESA_MAJOR_VERSION 1 +#define UGL_MESA_MINOR_VERSION 0 + +#include +#include + +/* + * Values for display mode of uglMesaCreateContext () + */ + +#define UGL_MESA_SINGLE 0x00 +#define UGL_MESA_DOUBLE 0x01 +#define UGL_MESA_DOUBLE_SW 0x02 +#define UGL_MESA_DOUBLE_HW 0x03 + +#define UGL_MESA_FULLSCREEN_WIDTH 0x0 +#define UGL_MESA_FULLSCREEN_HEIGHT 0x0 + +/* + * Pixel format + */ +#define UGL_MESA_ARGB8888 0x01 +#define UGL_MESA_RGB565 0x02 +#define UGL_MESA_RGB888 0x03 +#define UGL_MESA_ARGB4444 0x04 +#define UGL_MESA_CI 0x05 +#define UGL_MESA_DITHER_RGB 0x10 + +/* + * uglMesaPixelStore() parameters: + */ + +#define UGL_MESA_ROW_LENGTH 0x10 +#define UGL_MESA_Y_UP 0x11 + +/* + * Accepted by uglMesaGetIntegerv: + */ + +#define UGL_MESA_LEFT_X 0x18 +#define UGL_MESA_TOP_Y 0x19 +#define UGL_MESA_WIDTH 0x20 +#define UGL_MESA_HEIGHT 0x21 +#define UGL_MESA_DISPLAY_WIDTH 0x22 +#define UGL_MESA_DISPLAY_HEIGHT 0x23 +#define UGL_MESA_COLOR_FORMAT 0x24 +#define UGL_MESA_COLOR_MODEL 0x25 +#define UGL_MESA_PIXEL_FORMAT 0x26 +#define UGL_MESA_TYPE 0x27 +#define UGL_MESA_RGB 0x28 +#define UGL_MESA_COLOR_INDEXED 0x29 + +/* + * typedefs + */ + +typedef struct uglMesaContext * UGL_MESA_CONTEXT; + +/* + * Create an Mesa/UGL rendering context. The attributes needed are + * double buffer flag and a context sharelist. + * + * It's necessary to first call this function before use uglMakeCurrentContext. + * This function provides neither stencil nor accumulation buffer only + * a depth buffer to reduce memory footprint. + * + * Input: db_mode - UGL_MESA_SINGLE = single buffer mode + * UGL_MESA_DOUBLE = double buffer mode (HW fallback -> SW) + * UGL_MESA_DOUBLE_SW = double buffer software + * UGL_MESA_DOUBLE_HW = double buffer hardware + * share_list - specifies another UGL_MESA_CONTEXT with which to share + * display lists. NULL indicates no sharing. + * + * Return: a UGL_MESA_CONTEXT, or zero if error + */ + +UGL_MESA_CONTEXT uglMesaCreateNewContext (GLenum db_mode, + UGL_MESA_CONTEXT share_list); + +/* + * Create an UGL/Mesa rendering context and specify desired + * size of depth buffer, stencil buffer and accumulation buffer. + * If you specify zero for depth_bits, stencil_bits, + * accum_[red|gren|blue]_bits, you can save some memory. + * + * INPUT: db_mode - double buffer mode + * depth_bits - depth buffer size + * stencil_bits - stencil buffer size + * accum_red_bits - accumulation red buffer size + * accum_green_bits - accumulation green buffer size + * accum_blue_bits -accumulation blue buffer size + * accum_alpha_bits -accumulation alpha buffer size + * share_list - specifies another UGL_MESA_CONTEXT with which to share + * display lists. NULL indicates no sharing. + */ +UGL_MESA_CONTEXT uglMesaCreateNewContextExt (GLenum db_flag, + GLint depth_bits, + GLint stencil_bits, + GLint accum_red_bits, + GLint accum_green_bits, + GLint accum_blue_bits, + GLint accum_alpha_bits, + UGL_MESA_CONTEXT share_list); + +/* + * Bind an UGL_MESA_CONTEXT to an image buffer. The image buffer is + * just a block of memory which the client provides. Its size must be + * at least as large as width*height*sizeof(type). Its address should + * be a multiple of 4 if using RGBA mode. + * + * Image data is stored in the order of glDrawPixels: row-major order + * with the lower-left image pixel stored in the first array position + * (ie. bottom-to-top). + * + * Since the only type initially supported is GL_UNSIGNED_BYTE, if the + * context is in RGBA mode, each pixel will be stored as a 4-byte RGBA + * value. If the context is in color indexed mode, each pixel will be + * stored as a 1-byte value. + * + * If the context's viewport hasn't been initialized yet, it will now be + * initialized to (0, 0, width, height). + * + * Input: umc - a rendering context + * left, top - coordinates in pixels of (left,top) pixel + * (0,0) in fullscreen mode. + * width, height - size of image buffer in pixels, at least 1 + * else fullscreen dimensions are used (UGL_MESA_DISPLAY_WIDTH + * and UGL_MESA_DISPLAY_HEIGHT). + * + * Return: GL_TRUE if success, GL_FALSE if error because of invalid umc, + * width<1, height<1, width>internal limit or height>internal limit. + */ + +GLboolean uglMesaMakeCurrentContext (UGL_MESA_CONTEXT umc, + GLsizei left, GLsizei top, + GLsizei width, GLsizei height); + +/* + * Move an OpenGL window by a delta value + * + * Input: dx, dy - delta values in pixels + * + * Return: GL_TRUE if success, GL_FALSE if error because of invalid + * coordinates. + */ +GLboolean uglMesaMoveWindow (GLsizei dx, GLsizei dy); + +/* + * Move an OpenGL window to an absolute position + * + * Input: left, top - new coordinates in pixels + * + * Return: GL_TRUE if success, GL_FALSE if error because of invalid + * coordinates. + */ +GLboolean uglMesaMoveToWindow (GLsizei left, GLsizei top); + +/* + * Resize an OpenGL window by a delta value + * + * Input: dw, dh - delta values in pixels + * + * Return: GL_TRUE if success, GL_FALSE if error because of invalid + * coordinates. + */ +GLboolean uglMesaResizeWindow (GLsizei dw, GLsizei dh); + +/* + * Resize an OpenGL window to an absolute size + * + * Input: width, height - new dimensions in pixels + * + * Return: GL_TRUE if success, GL_FALSE if error because of invalid + * coordinates. + */ +GLboolean uglMesaResizeToWindow (GLsizei width, GLsizei height); + +/* + * Destroy the current UGL/Mesa rendering context + * + */ +void uglMesaDestroyContext (void); + +/* + * Return the current UGL/Mesa context + * + * Return: a UGL/Mesa context, or NULL if error + * + */ +UGL_MESA_CONTEXT uglMesaGetCurrentContext (void); + +/* + * Swap front and back buffers in double buffering mode. This + * function is a no-op if there's no back buffer. In case of software + * double buffering a copy occurs from off-screen buffer to front + * buffer. Works faster with an hardware support. + */ + +void uglMesaSwapBuffers (void); + +/* + * Set pixel store/packing parameters for the current context. This + * is similar to glPixelStore. UGL uses Y coordinates increase + * downward. + * + * Input: pname - UGL_MESA_ROW_LENGTH + * zero, same as image width (default). + * value specify actual pixels per row in image buffer + * UGL_MESA_Y_UP: + * zero = Y coordinates increase downward (default) + * non-zero = Y coordinates increase upward + * value - value for the parameter pname + */ + +void uglMesaPixelStore (GLint pname, GLint value); + +/* + * Return an integer value like glGetIntegerv. + * + * Input: pname - UGL_MESA_LEFT_X return the x axis value + * of the most left pixel + * UGL_MESA_TOP_Y return the y axis value + * of the topper pixel + * UGL_MESA_WIDTH return current image width + * UGL_MESA_HEIGHT return current image height + * UGL_MESA_COLOR_FORMAT return image color format + * UGL_MESA_COLOR_MODEL return image color model + * UGL_MESA_PIXEL_FORMAT return pixel format + * UGL_MESA_ROW_LENGTH return row length in pixels + * UGL_MESA_RGB return true if RGB + * UGL_MESA_COLOR_INDEXED return true if color indexed + * value - pointer to integer in which to return result. + */ +void uglMesaGetIntegerv (GLint pname, GLint *value); + +/* + * Return the depth buffer associated with an UGL/Mesa context. + * + * Output: width, height - size of buffer in pixels + * bytesPerValue - bytes per depth value (2 or 4) + * buffer - pointer to depth buffer values + * Return: GL_TRUE or GL_FALSE to indicate success or failure. + * + */ +GLboolean uglMesaGetDepthBuffer (GLint *width, GLint *height, + GLint *bytesPerValue, void **buffer); + +/* + * Return the color buffer associated with an UGL/Mesa context. + * Input: c - the UGL/Mesa context + * Output: width, height - size of buffer in pixels + * format - buffer format (UGLMESA_FORMAT) + * buffer - pointer to color buffer values + * Return: GL_TRUE or GL_FALSE to indicate success or failure. + * + */ +GLboolean uglMesaGetColorBuffer (GLint *width, GLint *height, + GLint *format, void **buffer); + +/* + * Color allocation in indexed mode. + * This function does nothing in RGB mode. + * + * Input: index - Value for the current color index + * red - Red component (between 0 and 1) + * green - Green component (between 0 and 1) + * blue - Blue component (between 0 and 1) + * + * Return: GL_TRUE if success, or GL_FALSE if index<0 or * clutSize>$@ +endif +else +Makefile + @ $(RM) $@ + @ $(ECHO) "Creating depend.$(CPU)$(TOOL)" +ifneq ($(SOURCES),) + @ for FILE in $(filter-out $(NODEPENDOBJS), $(SOURCES)); \ + do \ + $(CC) -MM $(CFLAGS) $$FILE \ + | $(TCL) $(BIN_DIR)/depend.tcl $(TGT_DIR) >>$@; \ + done +endif +endif + +.PHONY = clean + +clean: + $(RM) $(DEMO_OBJECTS) + $(RM) depend.$(CPU)$(TOOL) diff --git a/progs/windml/readtex.c b/progs/windml/readtex.c new file mode 100644 index 00000000000..659c49de8de --- /dev/null +++ b/progs/windml/readtex.c @@ -0,0 +1,365 @@ +/* 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 +#include +#include +#include +#include +#include "../util/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/progs/windml/uglaccum.c b/progs/windml/uglaccum.c new file mode 100644 index 00000000000..4748618d624 --- /dev/null +++ b/progs/windml/uglaccum.c @@ -0,0 +1,240 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* + * (c) Copyright 1993, Silicon Graphics, Inc. + * ALL RIGHTS RESERVED + * Permission to use, copy, modify, and distribute this software for + * any purpose and without fee is hereby granted, provided that the above + * copyright notice appear in all copies and that both the copyright notice + * and this permission notice appear in supporting documentation, and that + * the name of Silicon Graphics, Inc. not be used in advertising + * or publicity pertaining to distribution of the software without specific, + * written prior permission. + * + * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" + * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR + * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, + * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY + * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, + * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF + * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN + * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. + * + * US Government Users Restricted Rights + * Use, duplication, or disclosure by the Government is subject to + * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph + * (c)(1)(ii) of the Rights in Technical Data and Computer Software + * clause at DFARS 252.227-7013 and/or in similar or successor + * clauses in the FAR or the DOD or NASA FAR Supplement. + * Unpublished-- rights reserved under the copyright laws of the + * United States. Contractor/manufacturer is Silicon Graphics, + * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. + * + * OpenGL(TM) is a trademark of Silicon Graphics, Inc. + */ + +/* Original name: accanti.c + * + * Conversion to UGL/Mesa by Stephane Raimbault + */ + +#include +#include + +#include +#include +#include + +#include +#include + +#include "../book/jitter.h" + +UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; +UGL_LOCAL UGL_EVENT_Q_ID qId; +UGL_LOCAL UGL_MESA_CONTEXT umc; + +/* Initialize lighting and other values. + */ +UGL_LOCAL void initGL(GLsizei w, GLsizei h) + { + GLfloat mat_ambient[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat light_position[] = { 0.0, 0.0, 10.0, 1.0 }; + GLfloat lm_ambient[] = { 0.2, 0.2, 0.2, 1.0 }; + + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialf(GL_FRONT, GL_SHININESS, 50.0); + glLightfv(GL_LIGHT0, GL_POSITION, light_position); + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lm_ambient); + + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glDepthFunc(GL_LESS); + glEnable(GL_DEPTH_TEST); + glShadeModel (GL_FLAT); + + glClearColor(0.0, 0.0, 0.0, 0.0); + glClearAccum(0.0, 0.0, 0.0, 0.0); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= h) + glOrtho (-2.25, 2.25, -2.25*h/w, 2.25*h/w, -10.0, 10.0); + else + glOrtho (-2.25*w/h, 2.25*w/h, -2.25, 2.25, -10.0, 10.0); + glMatrixMode(GL_MODELVIEW); + } + +UGL_LOCAL void displayObjects(void) + { + GLfloat torus_diffuse[] = { 0.7, 0.7, 0.0, 1.0 }; + GLfloat cube_diffuse[] = { 0.0, 0.7, 0.7, 1.0 }; + GLfloat sphere_diffuse[] = { 0.7, 0.0, 0.7, 1.0 }; + GLfloat octa_diffuse[] = { 0.7, 0.4, 0.4, 1.0 }; + + glPushMatrix (); + glRotatef (30.0, 1.0, 0.0, 0.0); + + glPushMatrix (); + glTranslatef (-0.80, 0.35, 0.0); + glRotatef (100.0, 1.0, 0.0, 0.0); + glMaterialfv(GL_FRONT, GL_DIFFUSE, torus_diffuse); + glutSolidTorus (0.275, 0.85, 16, 16); + glPopMatrix (); + + glPushMatrix (); + glTranslatef (-0.75, -0.50, 0.0); + glRotatef (45.0, 0.0, 0.0, 1.0); + glRotatef (45.0, 1.0, 0.0, 0.0); + glMaterialfv(GL_FRONT, GL_DIFFUSE, cube_diffuse); + glutSolidCube (1.5); + glPopMatrix (); + + glPushMatrix (); + glTranslatef (0.75, 0.60, 0.0); + glRotatef (30.0, 1.0, 0.0, 0.0); + glMaterialfv(GL_FRONT, GL_DIFFUSE, sphere_diffuse); + glutSolidSphere (1.0, 16, 16); + glPopMatrix (); + + glPushMatrix (); + glTranslatef (0.70, -0.90, 0.25); + glMaterialfv(GL_FRONT, GL_DIFFUSE, octa_diffuse); + glutSolidOctahedron (); + glPopMatrix (); + + glPopMatrix (); + } + +#define ACSIZE 8 + +UGL_LOCAL void drawGL(void) + { + GLint viewport[4]; + int jitter; + + glGetIntegerv (GL_VIEWPORT, viewport); + + glClear(GL_ACCUM_BUFFER_BIT); + for (jitter = 0; jitter < ACSIZE; jitter++) + { + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glPushMatrix (); +/* Note that 4.5 is the distance in world space between + * left and right and bottom and top. + * This formula converts fractional pixel movement to + * world coordinates. + */ + glTranslatef (j8[jitter].x*4.5/viewport[2], + j8[jitter].y*4.5/viewport[3], 0.0); + displayObjects (); + glPopMatrix (); + glAccum(GL_ACCUM, 1.0/ACSIZE); + } + glAccum (GL_RETURN, 1.0); + glFlush(); + + uglMesaSwapBuffers(); + } + +UGL_LOCAL int getEvent(void) + { + UGL_EVENT event; + UGL_STATUS status; + int retVal = 0; + + status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); + + while (status != UGL_STATUS_Q_EMPTY) + { + UGL_INPUT_EVENT * pInputEvent = (UGL_INPUT_EVENT *)&event; + + if (pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) + retVal = 1; + + status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); + } + + return(retVal); + } + +void windMLAccum (void); + +void uglaccum (void) + { + taskSpawn("tAccum", 210, VX_FP_TASK, 100000, + (FUNCPTR)windMLAccum, 0,1,2,3,4,5,6,7,8,9); + } + +void windMLAccum(void) + { + UGL_INPUT_DEVICE_ID keyboardDevId; + GLsizei width, height; + + uglInitialize(); + + uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); + + uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); + + qId = uglEventQCreate (eventServiceId, 100); + + umc = uglMesaCreateNewContextExt(GL_TRUE, + 16, + 0, + 8,8,8,0, + NULL); + if (umc == NULL) + { + uglDeinitialize(); + return; + } + + /* Fullscreen */ + + uglMesaMakeCurrentContext(umc, 0, 0, + UGL_MESA_FULLSCREEN_WIDTH, + UGL_MESA_FULLSCREEN_HEIGHT); + + uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); + uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); + + initGL(width, height); + + while (!getEvent()) + drawGL(); + + uglEventQDestroy (eventServiceId, qId); + + uglMesaDestroyContext(); + uglDeinitialize(); + + return; + } diff --git a/progs/windml/uglalldemos.c b/progs/windml/uglalldemos.c new file mode 100644 index 00000000000..ebb2f27378a --- /dev/null +++ b/progs/windml/uglalldemos.c @@ -0,0 +1,98 @@ + +/* uglalldemos.c - WindML/Mesa example program */ + +/* Copyright (C) 2001 by Wind River Systems, Inc */ + +/* + * Mesa 3-D graphics library + * Version: 3.5 + * + * The MIT License + * 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 + * THE AUTHORS OR COPYRIGHT 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. + */ + +/* +modification history +-------------------- +01a,17jul01,sra written +*/ + +/* +DESCRIPTION +Show all the UGL/Mesa demos +*/ + +#include +#include + +void windMLPoint (void); +void windMLLine (void); +void windMLFlip (void); +void windMLCube (void); +void windMLBounce (void); +void windMLGears (void); +void windMLIcoTorus (void); +void windMLOlympic (void); +void windMLTexCube (void); +void windMLTexCyl (void); +void windMLTeapot (void); +void windMLStencil (void); +void windMLDrawPix (void); +void windMLAccum (void); +void windMLAllDemos (void); + +void uglalldemos (void) + { + taskSpawn("tAllDemos", 210, VX_FP_TASK, 200000, + (FUNCPTR)windMLAllDemos, 0,1,2,3,4,5,6,7,8,9); + } + +void windMLAllDemos(void) + { + + windMLPoint(); + + windMLLine(); + + windMLFlip(); + + windMLCube(); + + windMLBounce(); + + windMLGears(); + + windMLIcoTorus(); + + windMLOlympic(); + + windMLTexCube(); + + windMLTexCyl(); + + windMLTeapot(); + + windMLStencil(); + + windMLDrawPix(); + + windMLAccum(); + + return; + } diff --git a/progs/windml/uglbounce.c b/progs/windml/uglbounce.c new file mode 100644 index 00000000000..bcabf449632 --- /dev/null +++ b/progs/windml/uglbounce.c @@ -0,0 +1,268 @@ +/* + * Bouncing ball demo. + * + * This program is in the public domain + * + * Brian Paul + * + * Conversion to GLUT by Mark J. Kilgard + * + * Conversion to UGL/Mesa by Stephane Raimbault + */ + +#include +#include +#include + +#include +#include +#include + +#include + +#define COS(X) cos( (X) * 3.14159/180.0 ) +#define SIN(X) sin( (X) * 3.14159/180.0 ) + +#define RED 1 +#define WHITE 2 +#define CYAN 3 + +UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; +UGL_LOCAL UGL_EVENT_Q_ID qId; +UGL_LOCAL UGL_MESA_CONTEXT umc; + +UGL_LOCAL GLuint Ball; +UGL_LOCAL GLfloat Zrot, Zstep; +UGL_LOCAL GLfloat Xpos, Ypos; +UGL_LOCAL GLfloat Xvel, Yvel; +UGL_LOCAL GLfloat Xmin, Xmax; +UGL_LOCAL GLfloat Ymin; +/* UGL_LOCAL GLfloat Ymax = 4.0; */ +UGL_LOCAL GLfloat G; + +UGL_LOCAL GLuint make_ball(void) + { + GLuint list; + GLfloat a, b; + GLfloat da = 18.0, db = 18.0; + GLfloat radius = 1.0; + GLuint color; + GLfloat x, y, z; + + list = glGenLists(1); + + glNewList(list, GL_COMPILE); + + color = 0; + for (a = -90.0; a + da <= 90.0; a += da) + { + glBegin(GL_QUAD_STRIP); + for (b = 0.0; b <= 360.0; b += db) + { + if (color) + { + glIndexi(RED); + glColor3f(1, 0, 0); + } + else + { + glIndexi(WHITE); + glColor3f(1, 1, 1); + } + + x = radius * COS(b) * COS(a); + y = radius * SIN(b) * COS(a); + z = radius * SIN(a); + glVertex3f(x, y, z); + + x = radius * COS(b) * COS(a + da); + y = radius * SIN(b) * COS(a + da); + z = radius * SIN(a + da); + glVertex3f(x, y, z); + + color = 1 - color; + } + glEnd(); + + } + + glEndList(); + + return list; + } + +UGL_LOCAL void initGL(GLsizei width, GLsizei height) + { + float aspect = (float) width / (float) height; + glViewport(0, 0, (GLint) width, (GLint) height); + + uglMesaSetColor(RED, 1.0, 0.0, 0.0); + uglMesaSetColor(WHITE, 1.0, 1.0, 1.0); + uglMesaSetColor(CYAN, 0.0, 1.0, 1.0); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(-6.0 * aspect, 6.0 * aspect, -6.0, 6.0, -6.0, 6.0); + glMatrixMode(GL_MODELVIEW); + + } + +UGL_LOCAL void drawGL(void) + { + GLint i; + static float vel0 = -100.0; + + glClear(GL_COLOR_BUFFER_BIT); + + glIndexi(CYAN); + glColor3f(0, 1, 1); + glBegin(GL_LINES); + for (i = -5; i <= 5; i++) + { + glVertex2i(i, -5); + glVertex2i(i, 5); + } + for (i = -5; i <= 5; i++) + { + glVertex2i(-5, i); + glVertex2i(5, i); + } + for (i = -5; i <= 5; i++) + { + glVertex2i(i, -5); + glVertex2f(i * 1.15, -5.9); + } + glVertex2f(-5.3, -5.35); + glVertex2f(5.3, -5.35); + glVertex2f(-5.75, -5.9); + glVertex2f(5.75, -5.9); + glEnd(); + + glPushMatrix(); + glTranslatef(Xpos, Ypos, 0.0); + glScalef(2.0, 2.0, 2.0); + glRotatef(8.0, 0.0, 0.0, 1.0); + glRotatef(90.0, 1.0, 0.0, 0.0); + glRotatef(Zrot, 0.0, 0.0, 1.0); + + glCallList(Ball); + + glPopMatrix(); + + glFlush(); + + uglMesaSwapBuffers(); + + Zrot += Zstep; + + Xpos += Xvel; + if (Xpos >= Xmax) + { + Xpos = Xmax; + Xvel = -Xvel; + Zstep = -Zstep; + } + if (Xpos <= Xmin) + { + Xpos = Xmin; + Xvel = -Xvel; + Zstep = -Zstep; + } + Ypos += Yvel; + Yvel += G; + if (Ypos < Ymin) + { + Ypos = Ymin; + if (vel0 == -100.0) + vel0 = fabs(Yvel); + Yvel = vel0; + } + } + +UGL_LOCAL int getEvent(void) + { + UGL_EVENT event; + UGL_STATUS status; + int retVal = 0; + + status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); + + while (status != UGL_STATUS_Q_EMPTY) + { + UGL_INPUT_EVENT * pInputEvent = (UGL_INPUT_EVENT *)&event; + + if (pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) + retVal = 1; + + status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); + } + + return(retVal); + } + +void windMLBounce (void); + +void uglbounce (void) + { + taskSpawn("tBounce", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLBounce, + 0,1,2,3,4,5,6,7,8,9); + } + +void windMLBounce(void) + { + GLsizei width, height; + UGL_INPUT_DEVICE_ID keyboardDevId; + + Zrot = 0.0; + Zstep = 6.0; + Xpos = 0.0; + Ypos = 1.0; + Xvel = 0.2; + Yvel = 0.0; + Xmin = -4.0; + Xmax = 4.0; + Ymin = -3.8; + G = -0.1; + + uglInitialize(); + + uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); + + uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); + + qId = uglEventQCreate (eventServiceId, 100); + + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); + + if (umc == NULL) + { + uglDeinitialize(); + return; + } + + /* Fullscreen */ + + uglMesaMakeCurrentContext(umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, + UGL_MESA_FULLSCREEN_HEIGHT); + + Ball = make_ball(); + glCullFace(GL_BACK); + glEnable(GL_CULL_FACE); + glDisable(GL_DITHER); + glShadeModel(GL_FLAT); + + uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); + uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); + + initGL(width, height); + + while(!getEvent()) + drawGL(); + + uglEventQDestroy (eventServiceId, qId); + + uglMesaDestroyContext(); + uglDeinitialize (); + + return; + } diff --git a/progs/windml/uglcube.c b/progs/windml/uglcube.c new file mode 100644 index 00000000000..9080ba1fb98 --- /dev/null +++ b/progs/windml/uglcube.c @@ -0,0 +1,253 @@ +/* uglcube.c - WindML/Mesa example program */ + +/* Copyright (C) 2001 by Wind River Systems, Inc */ + +/* + * Mesa 3-D graphics library + * Version: 3.5 + * + * The MIT License + * 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 + * THE AUTHORS OR COPYRIGHT 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. + */ + +/* +DESCRIPTION +Draw a smooth cube. +*/ + +#include +#include + +#include +#include + +#include +#include + +UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; +UGL_LOCAL UGL_EVENT_Q_ID qId; +UGL_LOCAL UGL_MESA_CONTEXT umc; +UGL_LOCAL GLfloat rotx; +UGL_LOCAL GLfloat roty; +UGL_LOCAL GLuint theCube; + +UGL_LOCAL void cube() + { + + /* Front */ + glBegin(GL_QUADS); + glColor3f(0.0f, 0.0f, 1.0f); + glVertex3f(-1.0f, 1.0f, 1.0f); + glColor3f(0.0f, 1.0f, 0.0f); + glVertex3f(1.0f, 1.0f, 1.0f); + glColor3f(1.0f, 0.0f, 0.0f); + glVertex3f(1.0f, -1.0f, 1.0f); + glColor3f(1.0f, 1.0f, 0.0f); + glVertex3f(-1.0f, -1.0f, 1.0f); + glEnd(); + + + /* Back */ + glBegin(GL_QUADS); + glColor3f(0.0f, 0.0f, 1.0f); + glVertex3f(-1.0f, 1.0f, -1.0f); + glColor3f(0.0f, 1.0f, 0.0f); + glVertex3f(1.0f, 1.0f, -1.0f); + glColor3f(1.0f, 0.0f, 0.0f); + glVertex3f(1.0f, -1.0f, -1.0f); + glColor3f(1.0f, 1.0f, 0.0f); + glVertex3f(-1.0f, -1.0f, -1.0f); + glEnd(); + + + /* Right */ + glBegin(GL_QUADS); + glColor3f(0.0f, 1.0f, 0.0f); + glVertex3f(1.0f, 1.0f, 1.0f); + glColor3f(0.0f, 1.0f, 0.0f); + glVertex3f(1.0f, 1.0f, -1.0f); + glColor3f(1.0f, 0.0f, 0.0f); + glVertex3f(1.0f, -1.0f, -1.0f); + glColor3f(1.0f, 0.0f, 0.0f); + glVertex3f(1.0f, -1.0f, 1.0f); + glEnd(); + + /* Left */ + glBegin(GL_QUADS); + glColor3f(0.0f, 0.0f, 1.0f); + glVertex3f(-1.0f, 1.0f, 1.0f); + glColor3f(0.0f, 0.0f, 1.0f); + glVertex3f(-1.0f, 1.0f, -1.0f); + glColor3f(1.0f, 1.0f, 0.0f); + glVertex3f(-1.0f, -1.0f, -1.0f); + glColor3f(1.0f, 1.0f, 0.0f); + glVertex3f(-1.0f, -1.0f, 1.0f); + glEnd(); + + /* Top */ + glBegin(GL_QUADS); + glColor3f(0.0f, 0.0f, 1.0f); + glVertex3f(-1.0f, 1.0f, -1.0f); + glColor3f(0.0f, 1.0f, 0.0f); + glVertex3f(1.0f, 1.0f, -1.0f); + glColor3f(0.0f, 1.0f, 0.0f); + glVertex3f(1.0f, 1.0f, 1.0f); + glColor3f(0.0f, 0.0f, 1.0f); + glVertex3f(-1.0f, 1.0f, 1.0f); + glEnd(); + + + /* Bottom */ + glBegin(GL_QUADS); + glColor3f(1.0f, 1.0f, 0.0f); + glVertex3f(-1.0f, -1.0f, -1.0f); + glColor3f(1.0f, 0.0f, 0.0f); + glVertex3f(1.0f, -1.0f, -1.0f); + glColor3f(1.0f, 0.0f, 0.0f); + glVertex3f(1.0f, -1.0f, 1.0f); + glColor3f(1.0f, 1.0f, 0.0f); + glVertex3f(-1.0f, -1.0f, 1.0f); + glEnd(); + } + +UGL_LOCAL void initGL + ( + int Width, + int Height + ) + { + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + glDepthFunc(GL_LESS); + glEnable(GL_DEPTH_TEST); + glShadeModel(GL_SMOOTH); + + theCube = glGenLists(1); + glNewList(theCube, GL_COMPILE); + cube(); + glEndList(); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(45.0f, (GLfloat) Width / (GLfloat) Height, 0.1f, 100.0f); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0f, 0.0f, -6.0f); + } + + +/* The main drawing function. */ + +UGL_LOCAL void drawGL() + { + + /* Clear The Screen And The Depth Buffer */ + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + /* Rotate the cube */ + + glRotatef(rotx, 1.0f, 0.0f, 0.0f); + glRotatef(roty, 0.0f, 1.0f, 0.0f); + + glCallList(theCube); + + glFlush(); + + uglMesaSwapBuffers(); + } + + +/* The function called whenever a key is pressed. */ + +UGL_LOCAL int getEvent(void) + { + UGL_EVENT event; + UGL_STATUS status; + int retVal = 0; + + status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); + + while (status != UGL_STATUS_Q_EMPTY) + { + UGL_INPUT_EVENT * pInputEvent = (UGL_INPUT_EVENT *)&event; + + if (pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) + retVal = 1; + + status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); + } + + return(retVal); + } + +void windMLCube (void); + +void uglcube (void) + { + taskSpawn("tCube", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLCube, + 0,1,2,3,4,5,6,7,8,9); + } + +void windMLCube (void) + { + GLsizei width, height; + UGL_INPUT_DEVICE_ID keyboardDevId; + + rotx = 2.5f; + roty = 1.0f; + + uglInitialize(); + + uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); + + if (uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, + (UGL_UINT32 *)&eventServiceId) == UGL_STATUS_OK) + { + qId = uglEventQCreate (eventServiceId, 100); + } + else + { + eventServiceId = UGL_NULL; + } + + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); + + /* Fullscreen */ + + uglMesaMakeCurrentContext(umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, + UGL_MESA_FULLSCREEN_HEIGHT); + + uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); + uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); + + /* Initialize our window. */ + + initGL(width, height); + + while (!getEvent()) + drawGL(); + + if (eventServiceId != UGL_NULL) + uglEventQDestroy (eventServiceId, qId); + + uglMesaDestroyContext(); + uglDeinitialize(); + + return; + } diff --git a/progs/windml/ugldrawpix.c b/progs/windml/ugldrawpix.c new file mode 100644 index 00000000000..678f423d2e3 --- /dev/null +++ b/progs/windml/ugldrawpix.c @@ -0,0 +1,429 @@ +/* + * glDrawPixels demo/test/benchmark + * + * Brian Paul September 25, 1997 This file is in the public domain. + * + * Conversion to UGL/Mesa by Stephane Raimbault july, 2001 + */ + +/* + * $Log: ugldrawpix.c,v $ + * Revision 1.1 2001/08/20 16:07:11 brianp + * WindML driver (Stephane Raimbault) + * + * Revision 1.5 2000/12/24 22:53:54 pesco + * * demos/Makefile.am (INCLUDES): Added -I$(top_srcdir)/util. + * * demos/Makefile.X11, demos/Makefile.BeOS-R4, demos/Makefile.cygnus: + * Essentially the same. + * Program files updated to include "readtex.c", not "../util/readtex.c". + * * demos/reflect.c: Likewise for "showbuffer.c". + * + * + * * Makefile.am (EXTRA_DIST): Added top-level regular files. + * + * * include/GL/Makefile.am (INC_X11): Added glxext.h. + * + * + * * src/GGI/include/ggi/mesa/Makefile.am (EXTRA_HEADERS): Include + * Mesa GGI headers in dist even if HAVE_GGI is not given. + * + * * configure.in: Look for GLUT and demo source dirs in $srcdir. + * + * * src/swrast/Makefile.am (libMesaSwrast_la_SOURCES): Set to *.[ch]. + * More source list updates in various Makefile.am's. + * + * * Makefile.am (dist-hook): Remove CVS directory from distribution. + * (DIST_SUBDIRS): List all possible subdirs here. + * (SUBDIRS): Only list subdirs selected for build again. + * The above two applied to all subdir Makefile.am's also. + * + * Revision 1.4 2000/09/08 21:45:21 brianp + * added dither key option + * + * Revision 1.3 1999/10/28 18:23:29 brianp + * minor changes to Usage() function + * + * Revision 1.2 1999/10/21 22:13:58 brianp + * added f key to toggle front/back drawing + * + * Revision 1.1.1.1 1999/08/19 00:55:40 jtg + * Imported sources + * + * Revision 3.3 1999/03/28 18:18:33 brianp + * minor clean-up + * + * Revision 3.2 1998/11/05 04:34:04 brianp + * moved image files to ../images/ directory + * + * Revision 3.1 1998/02/22 16:43:17 brianp + * added a few casts to silence compiler warnings + * + * Revision 3.0 1998/02/14 18:42:29 brianp + * initial rev + * + */ + + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include "../util/readtex.h" + +#define IMAGE_FILE "Mesa/images/girl.rgb" + +UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; +UGL_LOCAL UGL_EVENT_Q_ID qId; +UGL_LOCAL volatile UGL_BOOL stopWex; +UGL_LOCAL UGL_MESA_CONTEXT umc; + +UGL_LOCAL int ImgWidth, ImgHeight; +UGL_LOCAL GLenum ImgFormat; +UGL_LOCAL GLubyte *Image; + +UGL_LOCAL int Xpos, Ypos; +UGL_LOCAL int SkipPixels, SkipRows; +UGL_LOCAL int DrawWidth, DrawHeight; +UGL_LOCAL float Xzoom, Yzoom; +UGL_LOCAL GLboolean Scissor; +UGL_LOCAL GLboolean DrawFront; +UGL_LOCAL GLboolean Dither; + +UGL_LOCAL void cleanUp (void); + +UGL_LOCAL void reset(void) + { + Xpos = Ypos = 20; + DrawWidth = ImgWidth; + DrawHeight = ImgHeight; + SkipPixels = SkipRows = 0; + Scissor = GL_FALSE; + Xzoom = Yzoom = 1.0; + } + +UGL_LOCAL void initGL(GLboolean ciMode, GLsizei width, GLsizei height) + { + printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); + printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); + printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); + + Image = LoadRGBImage(IMAGE_FILE, &ImgWidth, &ImgHeight, &ImgFormat); + if (!Image) + { + printf("Couldn't read %s\n", IMAGE_FILE); + cleanUp(); + exit(1); + } + + glScissor(width/4, height/4, width/2, height/2); + + if (ciMode) + { + /* Convert RGB image to grayscale */ + GLubyte *indexImage = malloc( ImgWidth * ImgHeight ); + GLint i; + for (i=0; i 0) + DrawWidth--; + break; + case 'W': + DrawWidth++; + break; + case 'h': + if (DrawHeight > 0) + DrawHeight--; + break; + case 'H': + DrawHeight++; + break; + case 'p': + if (SkipPixels > 0) + SkipPixels--; + break; + case 'P': + SkipPixels++; + break; + case 'r': + if (SkipRows > 0) + SkipRows--; + break; + case 'R': + SkipRows++; + break; + case 's': + Scissor = !Scissor; + break; + case 'x': + Xzoom -= 0.1; + break; + case 'X': + Xzoom += 0.1; + break; + case 'y': + Yzoom -= 0.1; + break; + case 'Y': + Yzoom += 0.1; + break; + case 'b': + benchmark(); + break; + case 'f': + DrawFront = !DrawFront; + if (DrawFront) + glDrawBuffer(GL_FRONT); + else + glDrawBuffer(GL_BACK); + printf("glDrawBuffer(%s)\n", DrawFront ? "GL_FRONT" : "GL_BACK"); + break; + case UGL_UNI_UP_ARROW: + Ypos += 1; + break; + case UGL_UNI_DOWN_ARROW: + Ypos -= 1; + break; + case UGL_UNI_LEFT_ARROW: + Xpos -= 1; + break; + case UGL_UNI_RIGHT_ARROW: + Xpos += 1; + break; + case UGL_UNI_ESCAPE: + stopWex = UGL_TRUE; + break; + } + } + +UGL_LOCAL void loopEvent(void) + { + UGL_EVENT event; + UGL_INPUT_EVENT * pInputEvent; + + UGL_FOREVER + { + if (uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT) + != UGL_STATUS_Q_EMPTY) + { + pInputEvent = (UGL_INPUT_EVENT *)&event; + + if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && + pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) + readKey(pInputEvent->type.keyboard.key); + } + + drawGL(); + if (stopWex) + break; + } + } + +UGL_LOCAL void cleanUp (void) + { + uglEventQDestroy (eventServiceId, qId); + + uglMesaDestroyContext(); + uglDeinitialize (); + } + +void windMLDrawPix (void); + +void ugldrawpix (void) + { + taskSpawn ("tDrawPix", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLDrawPix, + 0,1,2,3,4,5,6,7,8,9); + } + +void windMLDrawPix (void) + { + UGL_INPUT_DEVICE_ID keyboardDevId; + GLuint ciMode; + GLsizei width, height; + + Image = NULL; + Scissor = GL_FALSE; + DrawFront = GL_FALSE; + Dither = GL_TRUE; + + uglInitialize (); + + uglDriverFind (UGL_KEYBOARD_TYPE, 0, + (UGL_UINT32 *)&keyboardDevId); + + uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); + + qId = uglEventQCreate (eventServiceId, 100); + + /* Double buffering */ + umc = uglMesaCreateNewContext (UGL_MESA_DOUBLE, NULL); + if (umc == NULL) + { + uglDeinitialize (); + return; + } + + uglMesaMakeCurrentContext(umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, + UGL_MESA_FULLSCREEN_HEIGHT); + + uglMesaGetIntegerv(UGL_MESA_COLOR_INDEXED, &ciMode); + uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); + uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); + + initGL(ciMode, width, height); + + echoUse(); + + stopWex = UGL_FALSE; + loopEvent(); + + cleanUp(); + + return; + } diff --git a/progs/windml/uglflip.c b/progs/windml/uglflip.c new file mode 100644 index 00000000000..ffc6ece2db1 --- /dev/null +++ b/progs/windml/uglflip.c @@ -0,0 +1,219 @@ + +/* uglflip.c - WindML/Mesa example program */ + +/* Copyright (C) 2001 by Wind River Systems, Inc */ + +/* + * Mesa 3-D graphics library + * Version: 3.5 + * + * The MIT License + * 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 + * THE AUTHORS OR COPYRIGHT 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. + */ + +/* + * Authors: + * Stephane Raimbault + */ + +/* +DESCRIPTION +Draw a triangle and flip the screen +*/ + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#define BLACK (0) +#define RED (1) +#define GREEN (2) +#define BLUE (3) +#define CI_OFFSET 4 + +UGL_LOCAL GLuint rgb; +UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; +UGL_LOCAL UGL_EVENT_Q_ID qId; +UGL_LOCAL volatile UGL_BOOL stopWex; + +UGL_LOCAL UGL_MESA_CONTEXT umc; + +UGL_LOCAL void initGL (void) + { + uglMesaSetColor(BLACK, 0.0, 0.0, 0.0); + uglMesaSetColor(RED, 1.0, 0.3, 0.3); + uglMesaSetColor(GREEN, 0.3, 1.0, 0.3); + uglMesaSetColor(BLUE, 0.3, 0.3, 1.0); + + glClearColor(0.0, 0.0, 0.0, 0.0); + glClearIndex(BLACK); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); + } + +UGL_LOCAL void drawGL (void) + { + glClear(GL_COLOR_BUFFER_BIT); + + glBegin(GL_TRIANGLES); + (rgb) ? glColor3f(1.0, 0.3, 0.3) : glIndexi(RED); + glVertex2f(0.75, -0.50); + (rgb) ? glColor3f(0.3, 1.0, 0.3) : glIndexi(GREEN); + glVertex2f(0.0, 0.75); + (rgb) ? glColor3f(0.3, 0.3, 1.0) : glIndexi(BLUE); + glVertex2f(-0.75, -0.50); + glEnd(); + + glBegin(GL_LINES); + (rgb) ? glColor3f(1.0, 0.3, 0.3) : glIndexi(RED); + glVertex2f(-1.0, 1.0); + (rgb) ? glColor3f(0.3, 0.3, 1.0) : glIndexi(BLUE); + glVertex2f(1.0, -1.0); + glEnd(); + + glFlush(); + + uglMesaSwapBuffers(); + } + +UGL_LOCAL void echoUse(void) + { + printf("tFlip keys:\n"); + printf(" d Toggle dithering\n"); + printf(" up Reduce the window\n"); + printf(" down Enlarge the window\n"); + printf(" page up Y==0 is the bottom line and increases upward\n"); + printf(" page down Y==0 is the bottom line and increases downward\n"); + printf(" ESC Exit\n"); + } + +UGL_LOCAL void readKey (UGL_WCHAR key) + { + + switch(key) + { + case UGL_UNI_UP_ARROW: + uglMesaResizeWindow(8, 8); + break; + case UGL_UNI_DOWN_ARROW: + glDrawBuffer(GL_FRONT_LEFT); + glClear(GL_COLOR_BUFFER_BIT); + glDrawBuffer(GL_BACK_LEFT); + uglMesaResizeWindow(-8, -8); + break; + case UGL_UNI_PAGE_UP: + uglMesaPixelStore(UGL_MESA_Y_UP, GL_TRUE); + break; + case UGL_UNI_PAGE_DOWN: + uglMesaPixelStore(UGL_MESA_Y_UP, GL_FALSE); + break; + case UGL_UNI_ESCAPE: + stopWex = UGL_TRUE; + break; + case 'd': + if (glIsEnabled(GL_DITHER)) + glDisable(GL_DITHER); + else + glEnable(GL_DITHER); + break; + } + } + +UGL_LOCAL void loopEvent(void) + { + UGL_EVENT event; + UGL_INPUT_EVENT * pInputEvent; + + drawGL(); + + UGL_FOREVER + { + if (uglEventGet (qId, &event, sizeof (event), UGL_WAIT_FOREVER) + != UGL_STATUS_Q_EMPTY) + { + pInputEvent = (UGL_INPUT_EVENT *)&event; + + if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && + pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) + { + readKey(pInputEvent->type.keyboard.key); + drawGL(); + } + } + + if (stopWex) + break; + } + } + +void windMLFlip (void); + +void uglflip (void) + { + taskSpawn("tFlip", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLFlip, + 0,1,2,3,4,5,6,7,8,9); + } + +void windMLFlip(void) + { + + UGL_INPUT_DEVICE_ID keyboardDevId; + + uglInitialize(); + + uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); + + uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); + + qId = uglEventQCreate (eventServiceId, 100); + + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE_SW, NULL); + + if (umc == NULL) + { + uglDeinitialize(); + return; + } + uglMesaMakeCurrentContext(umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, + UGL_MESA_FULLSCREEN_HEIGHT); + + uglMesaGetIntegerv(UGL_MESA_RGB, &rgb); + + initGL(); + + echoUse(); + stopWex = UGL_FALSE; + loopEvent(); + + uglEventQDestroy (eventServiceId, qId); + + uglMesaDestroyContext(); + uglDeinitialize(); + + return; + } diff --git a/progs/windml/uglgears.c b/progs/windml/uglgears.c new file mode 100644 index 00000000000..fe750a57d8d --- /dev/null +++ b/progs/windml/uglgears.c @@ -0,0 +1,422 @@ + +/* uglgears.c - WindML/Mesa example program */ + +/* + * 3-D gear wheels. This program is in the public domain. + * + * Brian Paul + * + * Conversion to GLUT by Mark J. Kilgard + * Conversion to UGL/Mesa from GLUT by Stephane Raimbault + */ + +/* +DESCRIPTION +Spinning gears demo +*/ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +#define COUNT_FRAMES + +UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; +UGL_LOCAL UGL_EVENT_Q_ID qId; +UGL_LOCAL volatile UGL_BOOL stopWex; +UGL_LOCAL UGL_MESA_CONTEXT umc; + +UGL_LOCAL GLfloat view_rotx, view_roty, view_rotz; +UGL_LOCAL GLint gear1, gear2, gear3; +UGL_LOCAL GLfloat angle; + +UGL_LOCAL GLuint limit; +UGL_LOCAL GLuint count; +UGL_LOCAL GLuint tickStart, tickStop, tickBySec; + + +/* +* Draw a gear wheel. You'll probably want to call this function when +* building a display list since we do a lot of trig here. +* +* Input: inner_radius - radius of hole at center +* outer_radius - radius at center of teeth +* width - width of gear +* teeth - number of teeth +* tooth_depth - depth of tooth +*/ + +UGL_LOCAL void gear + ( + GLfloat inner_radius, + GLfloat outer_radius, + GLfloat width, + GLint teeth, + GLfloat tooth_depth + ) + { + GLint i; + GLfloat r0, r1, r2; + GLfloat angle, da; + GLfloat u, v, len; + + r0 = inner_radius; + r1 = outer_radius - tooth_depth/2.0; + r2 = outer_radius + tooth_depth/2.0; + + da = 2.0*M_PI / teeth / 4.0; + + glShadeModel (GL_FLAT); + + glNormal3f (0.0, 0.0, 1.0); + + /* draw front face */ + glBegin (GL_QUAD_STRIP); + for (i=0;i<=teeth;i++) + { + angle = i * 2.0*M_PI / teeth; + glVertex3f (r0*cos (angle), r0*sin (angle), width*0.5); + glVertex3f (r1*cos (angle), r1*sin (angle), width*0.5); + glVertex3f (r0*cos (angle), r0*sin (angle), width*0.5); + glVertex3f (r1*cos (angle+3*da), r1*sin (angle+3*da), width*0.5); + } + glEnd (); + + /* draw front sides of teeth */ + glBegin (GL_QUADS); + da = 2.0*M_PI / teeth / 4.0; + for (i=0; i limit) + { + tickStop = tickGet (); + time = (tickStop-tickStart)/tickBySec; + printf (" %i fps\n", count/time); + tickStart = tickStop; + count = 0; + } + else + count++; +#endif +} + + +UGL_LOCAL void initGL (GLsizei width, GLsizei height) + { + UGL_LOCAL GLfloat pos[4] = {5.0, 5.0, 10.0, 1.0 }; + UGL_LOCAL GLfloat red[4] = {0.8, 0.1, 0.0, 1.0 }; + UGL_LOCAL GLfloat green[4] = {0.0, 0.8, 0.2, 1.0 }; + UGL_LOCAL GLfloat blue[4] = {0.2, 0.2, 1.0, 1.0 }; + + glLightfv (GL_LIGHT0, GL_POSITION, pos); + glEnable (GL_CULL_FACE); + glEnable (GL_LIGHTING); + glEnable (GL_LIGHT0); + glEnable (GL_DEPTH_TEST); + + /* make the gears */ + gear1 = glGenLists (1); + glNewList (gear1, GL_COMPILE); + glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red); + gear (1.0, 4.0, 1.0, 20, 0.7); + glEndList (); + + gear2 = glGenLists (1); + glNewList (gear2, GL_COMPILE); + glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green); + gear (0.5, 2.0, 2.0, 10, 0.7); + glEndList (); + + gear3 = glGenLists (1); + glNewList (gear3, GL_COMPILE); + glMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue); + gear (1.3, 2.0, 0.5, 10, 0.7); + glEndList (); + + glEnable (GL_NORMALIZE); + + glViewport (0, 0, width, height); + + glMatrixMode (GL_PROJECTION); + glLoadIdentity (); + if (width>height) + { + GLfloat w = (GLfloat) width / (GLfloat) height; + glFrustum (-w, w, -1.0, 1.0, 5.0, 60.0); + } + else + { + GLfloat h = (GLfloat) height / (GLfloat) width; + glFrustum (-1.0, 1.0, -h, h, 5.0, 60.0); + } + + glMatrixMode (GL_MODELVIEW); + glLoadIdentity (); + glTranslatef (0.0, 0.0, -40.0); + +#ifdef COUNT_FRAMES + tickStart = tickGet (); + tickBySec = sysClkRateGet (); +#endif +} + +UGL_LOCAL void echoUse(void) + { + printf("tGears keys:\n"); + printf(" z Counter clockwise rotation (z-axis)\n"); + printf(" Z Clockwise rotation (z-axis)\n"); + printf(" Up Counter clockwise rotation (x-axis)\n"); + printf(" Down Clockwise rotation (x-axis)\n"); + printf(" Left Counter clockwise rotation (y-axis)\n"); + printf(" Right Clockwise rotation (y-axis)\n"); + printf(" ESC Exit\n"); + } + + +UGL_LOCAL void readKey (UGL_WCHAR key) + { + + switch(key) + { + case 'z': + view_rotz += 5.0; + break; + case 'Z': + view_rotz -= 5.0; + break; + case UGL_UNI_UP_ARROW: + view_rotx += 5.0; + break; + case UGL_UNI_DOWN_ARROW: + view_rotx -= 5.0; + break; + case UGL_UNI_LEFT_ARROW: + view_roty += 5.0; + break; + case UGL_UNI_RIGHT_ARROW: + view_roty -= 5.0; + break; + case UGL_UNI_ESCAPE: + stopWex = UGL_TRUE; + break; + } + } + +UGL_LOCAL void loopEvent(void) + { + UGL_EVENT event; + UGL_INPUT_EVENT * pInputEvent; + + UGL_FOREVER + { + if (uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT) + != UGL_STATUS_Q_EMPTY) + { + pInputEvent = (UGL_INPUT_EVENT *)&event; + + if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && + pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) + readKey(pInputEvent->type.keyboard.key); + } + + drawGL(); + if (stopWex) + break; + } + } + +void windMLGears (void); + +void uglgears (void) + { + taskSpawn ("tGears", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLGears, + 0,1,2,3,4,5,6,7,8,9); + } + +void windMLGears (void) + { + GLsizei width, height; + UGL_INPUT_DEVICE_ID keyboardDevId; + + view_rotx=20.0; + view_roty=30.0; + view_rotz=0.0; + angle = 0.0; + limit = 100; + count = 1; + + uglInitialize (); + + uglDriverFind (UGL_KEYBOARD_TYPE, 0, + (UGL_UINT32 *)&keyboardDevId); + + uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); + + qId = uglEventQCreate (eventServiceId, 100); + + /* Double buffering */ + + umc = uglMesaCreateNewContext (UGL_MESA_DOUBLE, NULL); + if (umc == NULL) + { + uglDeinitialize (); + return; + } + + /* Fullscreen */ + + uglMesaMakeCurrentContext (umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, + UGL_MESA_FULLSCREEN_HEIGHT); + + uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); + uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); + + initGL (width, height); + + echoUse(); + + stopWex = UGL_FALSE; + loopEvent(); + + uglEventQDestroy (eventServiceId, qId); + + uglMesaDestroyContext(); + uglDeinitialize (); + + return; + } diff --git a/progs/windml/uglicotorus.c b/progs/windml/uglicotorus.c new file mode 100644 index 00000000000..46226f1e82c --- /dev/null +++ b/progs/windml/uglicotorus.c @@ -0,0 +1,311 @@ +/* uglicotorus.c - WindML/Mesa example program */ + +/* Copyright (C) 2001 by Wind River Systems, Inc */ + +/* + * Mesa 3-D graphics library + * Version: 3.5 + * + * The MIT License + * 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 + * THE AUTHORS OR COPYRIGHT 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. + */ + +/* +modification history +-------------------- +01a,jun01,sra +*/ + +#include +#include + +#include +#include +#include + +#include +#include + +/* Need GLUT_SHAPES */ + +#include + +UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; +UGL_LOCAL UGL_EVENT_Q_ID qId; +UGL_LOCAL UGL_MESA_CONTEXT umc; +UGL_LOCAL volatile UGL_BOOL stopWex; + +UGL_LOCAL GLfloat angle; +UGL_LOCAL GLboolean chaos_on; +UGL_LOCAL GLboolean color_on; + +UGL_LOCAL GLuint theIco, theTorus, theSphere, theCube; + +UGL_LOCAL void initGL + ( + int w, + int h + ) + { + glViewport(0,0,(GLsizei)w,(GLsizei)h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(60.0,(GLfloat)w/(GLfloat)h,1.0,60.0); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + gluLookAt(0.0,0.0,25.0,0.0,0.0,0.0,0.0,1.0,0.0); + + glClearColor(0.0,0.0,0.0,0.0); + + glEnable(GL_DEPTH_TEST); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + + glEnable(GL_COLOR_MATERIAL); + + theIco = glGenLists(1); + glNewList(theIco, GL_COMPILE); + glutSolidIcosahedron(); + glEndList(); + + theTorus = glGenLists(1); + glNewList(theTorus, GL_COMPILE); + glutSolidTorus(0.2,1.0,10,10); + glEndList(); + + theSphere = glGenLists(1); + glNewList(theSphere, GL_COMPILE); + glutSolidSphere(2.5,20,20); + glEndList(); + + theCube = glGenLists(1); + glNewList(theCube, GL_COMPILE); + glutSolidCube(4.0); + glEndList(); + + } + +UGL_LOCAL void createIcoToruses + ( + int i + ) + { + glPushMatrix(); + glRotatef(angle,1.0,1.0,1.0); + glCallList(theIco); + + switch (i) + { + case 9 : + glColor3f(1.0,0.0,0.0); + break; + case 0 : + glColor3f(1.0,0.1,0.7); + break; + case 1 : + glColor3f(1.0,0.0,1.0); + break; + case 2 : + glColor3f(0.0,0.0,1.0); + break; + case 3 : + glColor3f(0.0,0.5,1.0); + break; + case 4 : + glColor3f(0.0,1.0,0.7); + break; + case 5 : + glColor3f(0.0,1.0,0.0); + break; + case 6 : + glColor3f(0.5,1.0,0.0); + break; + case 7 : + glColor3f(1.0,1.0,0.0); + break; + case 8 : + glColor3f(1.0,0.5,0.0); + break; + } + + glRotatef(angle,1.0,1.0,1.0); + glCallList(theTorus); + glRotatef(-2*angle,1.0,1.0,1.0); + glCallList(theTorus); + glPopMatrix(); + } + +UGL_LOCAL void drawGL (void) + { + int i; + + if (color_on) + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + else + glClear(GL_DEPTH_BUFFER_BIT); + + glPushMatrix(); + + if (chaos_on) + glRotatef(angle,1.0,1.0,1.0); + + glPushMatrix(); + glRotatef(angle,1.0,1.0,1.0); + glColor3f(1.0,0.5,0.0); + glCallList(theSphere); + glColor3f(1.0,0.0,0.0); + glCallList(theCube); + glPopMatrix(); + + glRotatef(-angle,0.0,0.0,1.0); + glPushMatrix(); + /* draw ten icosahedrons */ + for (i = 0; i < 10; i++) + { + glPushMatrix(); + glRotatef(36*i,0.0,0.0,1.0); + glTranslatef(10.0,0.0,0.0); + glRotatef(2*angle,0.0,1.0,0.0); + glTranslatef(0.0,0.0,2.0); + + createIcoToruses(i); + glPopMatrix(); + } + glPopMatrix(); + + glPopMatrix(); + + uglMesaSwapBuffers(); + + angle += 1.0; + + } + +UGL_LOCAL void echoUse(void) + { + printf("tIcoTorus keys:\n"); + printf(" c Toggle color buffer clear\n"); + printf(" SPACE Toggle chaos mode\n"); + printf(" ESC Exit\n"); + } + +UGL_LOCAL void readKey (UGL_WCHAR key) + { + + switch(key) + { + case 'c': + color_on = !color_on; + break; + case UGL_UNI_SPACE: + chaos_on = !chaos_on; + break; + case UGL_UNI_ESCAPE: + stopWex = UGL_TRUE; + break; + } + } + +UGL_LOCAL void loopEvent(void) + { + UGL_EVENT event; + UGL_INPUT_EVENT * pInputEvent; + + UGL_FOREVER + { + if (uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT) + != UGL_STATUS_Q_EMPTY) + { + pInputEvent = (UGL_INPUT_EVENT *)&event; + + if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && + pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) + readKey(pInputEvent->type.keyboard.key); + } + + drawGL(); + if (stopWex) + break; + } + } + +void windMLIcoTorus (void); + +void uglicotorus (void) + { + taskSpawn ("tIcoTorus", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLIcoTorus, + 0,1,2,3,4,5,6,7,8,9); + } + +void windMLIcoTorus (void) + { + GLsizei width, height; + UGL_INPUT_DEVICE_ID keyboardDevId; + + angle = 0.0; + chaos_on = GL_TRUE; + color_on = GL_TRUE; + + uglInitialize (); + + uglDriverFind (UGL_KEYBOARD_TYPE, 0, + (UGL_UINT32 *)&keyboardDevId); + + if (uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, + (UGL_UINT32 *)&eventServiceId) == UGL_STATUS_OK) + { + qId = uglEventQCreate (eventServiceId, 100); + } + else + { + eventServiceId = UGL_NULL; + } + + /* Double buffering */ + umc = uglMesaCreateNewContext (UGL_MESA_DOUBLE, NULL); + + if (umc == NULL) + { + uglDeinitialize (); + return; + } + + uglMesaMakeCurrentContext (umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, + UGL_MESA_FULLSCREEN_HEIGHT); + + uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); + uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); + + initGL (width, height); + + echoUse(); + + stopWex = UGL_FALSE; + loopEvent(); + + if (eventServiceId != UGL_NULL) + uglEventQDestroy (eventServiceId, qId); + + uglMesaDestroyContext (); + uglDeinitialize (); + + return; + } + diff --git a/progs/windml/uglline.c b/progs/windml/uglline.c new file mode 100644 index 00000000000..fd100fff4b4 --- /dev/null +++ b/progs/windml/uglline.c @@ -0,0 +1,270 @@ + +/* uglline.c - WindML/Mesa example program */ + +/* + * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the name of + * Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* +modification history +-------------------- +01a,jun01,sra Ported to UGL/Mesa and modifications +*/ + +/* +DESCRIPTION +Draw circular lines +*/ + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#define BLACK (0) +#define YELLOW (1) +#define GREEN (2) +#define BLUE (3) +#define CI_OFFSET 4 + +UGL_LOCAL GLuint rgb; +UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; +UGL_LOCAL UGL_EVENT_Q_ID qId; +UGL_LOCAL volatile UGL_BOOL stopWex; +UGL_LOCAL UGL_MESA_CONTEXT umc; + +UGL_LOCAL GLboolean mode1, mode2; +UGL_LOCAL GLint size; + +UGL_LOCAL GLfloat pntA[3] = { + -10.0, 0.0, 0.0 +}; +UGL_LOCAL GLfloat pntB[3] = { + -5.0, 0.0, 0.0 +}; + +UGL_LOCAL GLint angleA; + +UGL_LOCAL void initGL (void) + { + GLint i; + + uglMesaSetColor(BLACK, 0.0, 0.0, 0.0); + uglMesaSetColor(YELLOW, 1.0, 1.0, 0.0); + uglMesaSetColor(GREEN, 0.0, 1.0, 0.0); + uglMesaSetColor(BLUE, 0.0, 0.0, 1.0); + + for (i = 0; i < 16; i++) + { + uglMesaSetColor(CI_OFFSET+i, i/15.0, i/15.0, 0.0); + } + + glClearColor(0.0, 0.0, 0.0, 0.0); + glClearIndex(BLACK); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(-10, 10, -10, 10, -10.0, 10.0); + + glMatrixMode(GL_MODELVIEW); + + glLineStipple(1, 0xF0E0); + glBlendFunc(GL_SRC_ALPHA, GL_ONE); + + mode1 = GL_FALSE; + mode2 = GL_FALSE; + size = 1; + } + +UGL_LOCAL void drawGL (void) + { + + GLint ci, i; + + glClear(GL_COLOR_BUFFER_BIT); + + glLineWidth(size); + + if (mode1) { + glEnable(GL_LINE_STIPPLE); + } else { + glDisable(GL_LINE_STIPPLE); + } + + if (mode2) { + ci = CI_OFFSET; + glEnable(GL_LINE_SMOOTH); + glEnable(GL_BLEND); + } else { + ci = YELLOW; + glDisable(GL_LINE_SMOOTH); + glDisable(GL_BLEND); + } + + glPushMatrix(); + + glRotatef(angleA, 1, 0, 1); + angleA = angleA++ % 360; + + for (i = 0; i < 360; i += 5) { + glRotatef(5.0, 0, 0, 1); + + glColor3f(1.0, 1.0, 0.0); + glBegin(GL_LINE_STRIP); + glVertex3fv(pntA); + glVertex3fv(pntB); + glEnd(); + + glPointSize(1); + + glColor3f(0.0, 1.0, 0.0); + glBegin(GL_POINTS); + glVertex3fv(pntA); + glVertex3fv(pntB); + glEnd(); + } + + glPopMatrix(); + + glFlush(); + + uglMesaSwapBuffers(); + + } + +UGL_LOCAL void echoUse(void) + { + printf("tLine keys:\n"); + printf(" b Blending/antialiasing\n"); + printf(" n Line stipple\n"); + printf(" Up/Down Pixel size\n"); + printf(" ESC Exit\n"); + } + +UGL_LOCAL void readKey (UGL_WCHAR key) + { + switch(key) + { + case 'n': + mode1 = (mode1) ? GL_FALSE: GL_TRUE; + break; + case 'b': + mode2 = (mode2) ? GL_FALSE: GL_TRUE; + break; + case UGL_UNI_DOWN_ARROW: + if(size>0) + size--; + break; + case UGL_UNI_UP_ARROW: + size++; + break; + case UGL_UNI_ESCAPE: + stopWex = UGL_TRUE; + break; + } + } + +UGL_LOCAL void loopEvent(void) + { + UGL_EVENT event; + UGL_INPUT_EVENT * pInputEvent; + + UGL_FOREVER + { + if (uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT) + != UGL_STATUS_Q_EMPTY) + { + pInputEvent = (UGL_INPUT_EVENT *)&event; + + if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && + pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) + readKey(pInputEvent->type.keyboard.key); + } + + drawGL(); + if (stopWex) + break; + } + } + +void windMLLine (void); + +void uglline (void) + { + taskSpawn("tLine", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLLine, + 0,1,2,3,4,5,6,7,8,9); + } + + +void windMLLine(void) + { + + UGL_INPUT_DEVICE_ID keyboardDevId; + + angleA = 0; + + uglInitialize(); + + uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); + + uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); + + qId = uglEventQCreate (eventServiceId, 100); + + /* Double buffer */ + + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); + + if (umc == NULL) + { + uglDeinitialize(); + return; + } + + /* Fullscreen */ + + uglMesaMakeCurrentContext(umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, + UGL_MESA_FULLSCREEN_HEIGHT); + + uglMesaGetIntegerv(UGL_MESA_RGB, &rgb); + + initGL(); + + echoUse(); + + stopWex = UGL_FALSE; + loopEvent(); + + uglEventQDestroy(eventServiceId, qId); + + uglMesaDestroyContext(); + uglDeinitialize(); + + return; + } diff --git a/progs/windml/uglolympic.c b/progs/windml/uglolympic.c new file mode 100644 index 00000000000..de7c278b1a7 --- /dev/null +++ b/progs/windml/uglolympic.c @@ -0,0 +1,474 @@ +/* + * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that (i) the above copyright notices and this permission notice appear in + * all copies of the software and related documentation, and (ii) the name of + * Silicon Graphics may not be used in any advertising or + * publicity relating to the software without the specific, prior written + * permission of Silicon Graphics. + * + * THE SOFTWARE IS PROVIDED "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 BE LIABLE FOR + * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF + * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * Nov 20, 1995 use stdlib's rand()/srand() instead of random()/srand48(), etc. + */ + +/* + * Modified by Stephane Raimbault to be able to run in VxWorks 07/18/01 + * + * Modified by Li Wei(liwei@aiar.xjtu.edu.cn) to be able to run in Windows + * 6/13 + * + * Modified by Brian Paul to compile with Windows OR Unix. 7/23/97 + */ + + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#ifndef RAND_MAX +# define RAND_MAX 32767 +#endif + +#define XSIZE 100 +#define YSIZE 75 + +#define RINGS 5 +#define BLUERING 0 +#define BLACKRING 1 +#define REDRING 2 +#define YELLOWRING 3 +#define GREENRING 4 + +#define BACKGROUND 8 + +UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; +UGL_LOCAL UGL_EVENT_Q_ID qId; +UGL_LOCAL UGL_MESA_CONTEXT umc; +UGL_LOCAL volatile UGL_BOOL stopWex; + +UGL_LOCAL int rgb; +UGL_LOCAL unsigned char rgb_colors[RINGS][3]; +UGL_LOCAL int mapped_colors[RINGS]; +UGL_LOCAL float dests[RINGS][3]; +UGL_LOCAL float offsets[RINGS][3]; +UGL_LOCAL float angs[RINGS]; +UGL_LOCAL float rotAxis[RINGS][3]; +UGL_LOCAL int iters[RINGS]; +UGL_LOCAL GLuint theTorus; + +enum { + COLOR_BLACK = 0, + COLOR_RED, + COLOR_GREEN, + COLOR_YELLOW, + COLOR_BLUE, + COLOR_MAGENTA, + COLOR_CYAN, + COLOR_WHITE +}; + +/* +UGL_LOCAL float RGBMap[9][3] = { + {0, 0, 0}, + {1, 0, 0}, + {0, 1, 0}, + {1, 1, 0}, + {0, 0, 1}, + {1, 0, 1}, + {0, 1, 1}, + {1, 1, 1}, + {0.5, 0.5, 0.5} +}; + +UGL_LOCAL void SetColor(int c) + { + (rgb) ? glColor3fv(RGBMap[c]): glIndexf(c); + } + +UGL_LOCAL void InitMap(void) + { + int i; + + if (rgb) + return; + + for (i = 0; i < 9; i++) + uglMesaSetColor(i, RGBMap[i][0], RGBMap[i][1], RGBMap[i][2]); + } + +UGL_LOCAL void SetFogRamp(int density, int startIndex) + { + int fogValues, colorValues; + int i, j, k; + float intensity; + + fogValues = 1 << density; + colorValues = 1 << startIndex; + for (i = 0; i < colorValues; i++) + { + for (j = 0; j < fogValues; j++) + { + k = i * fogValues + j; + intensity = (i * fogValues + j * colorValues) / 255.0; + uglMesaSetColor(k, intensity, intensity, intensity); + } + } + } + +UGL_LOCAL void SetGreyRamp(void) + { + int i; + float intensity; + + for (i = 0; i < 255; i++) + { + intensity = i / 255.0; + uglMesaSetColor(i, intensity, intensity, intensity); + } + } +*/ + +UGL_LOCAL void FillTorus(float rc, int numc, float rt, int numt) + { + int i, j, k; + double s, t; + double x, y, z; + double pi, twopi; + + pi = 3.14159265358979323846; + twopi = 2 * pi; + + for (i = 0; i < numc; i++) + { + glBegin(GL_QUAD_STRIP); + for (j = 0; j <= numt; j++) + { + for (k = 1; k >= 0; k--) + { + s = (i + k) % numc + 0.5; + t = j % numt; + + x = cos(t*twopi/numt) * cos(s*twopi/numc); + y = sin(t*twopi/numt) * cos(s*twopi/numc); + z = sin(s*twopi/numc); + glNormal3f(x, y, z); + + x = (rt + rc * cos(s*twopi/numc)) * cos(t*twopi/numt); + y = (rt + rc * cos(s*twopi/numc)) * sin(t*twopi/numt); + z = rc * sin(s*twopi/numc); + glVertex3f(x, y, z); + } + } + glEnd(); + } + } + +UGL_LOCAL float Clamp(int iters_left, float t) + { + if (iters_left < 3) + { + return 0.0; + } + return (iters_left-2)*t/iters_left; + } + +UGL_LOCAL void drawGL(void) + { + int i, j; + + for (i = 0; i < RINGS; i++) + { + if (iters[i]) { + for (j = 0; j < 3; j++) + { + offsets[i][j] = Clamp(iters[i], offsets[i][j]); + } + angs[i] = Clamp(iters[i], angs[i]); + iters[i]--; + } + } + + glPushMatrix(); + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + gluLookAt(0,0,10, 0,0,0, 0,1,0); + + for (i = 0; i < RINGS; i++) + { + if (rgb) + { + glColor3ubv(rgb_colors[i]); + } + else + { + glIndexi(mapped_colors[i]); + } + glPushMatrix(); + glTranslatef(dests[i][0]+offsets[i][0], dests[i][1]+offsets[i][1], + dests[i][2]+offsets[i][2]); + glRotatef(angs[i], rotAxis[i][0], rotAxis[i][1], rotAxis[i][2]); + glCallList(theTorus); + glPopMatrix(); + } + + glPopMatrix(); + + glFlush(); + + uglMesaSwapBuffers(); + } + +UGL_LOCAL float MyRand(void) + { + return 10.0 * ( (float) rand() / (float) RAND_MAX - 0.5 ); + } + +UGL_LOCAL void ReInit(void) + { + int i; + float deviation; + + deviation = MyRand() / 2; + deviation = deviation * deviation; + for (i = 0; i < RINGS; i++) + { + offsets[i][0] = MyRand(); + offsets[i][1] = MyRand(); + offsets[i][2] = MyRand(); + angs[i] = 260.0 * MyRand(); + rotAxis[i][0] = MyRand(); + rotAxis[i][1] = MyRand(); + rotAxis[i][2] = MyRand(); + iters[i] = (deviation * MyRand() + 60.0); + } + } + +UGL_LOCAL void initGL(void) + { + float base, height; + float aspect, x, y; + int i; + + float top_y = 1.0; + float bottom_y = 0.0; + float top_z = 0.15; + float bottom_z = 0.69; + float spacing = 2.5; + static float lmodel_ambient[] = {0.0, 0.0, 0.0, 0.0}; + static float lmodel_twoside[] = {GL_FALSE}; + static float lmodel_local[] = {GL_FALSE}; + static float light0_ambient[] = {0.1, 0.1, 0.1, 1.0}; + static float light0_diffuse[] = {1.0, 1.0, 1.0, 0.0}; + static float light0_position[] = {0.8660254, 0.5, 1, 0}; + static float light0_specular[] = {1.0, 1.0, 1.0, 0.0}; + static float bevel_mat_ambient[] = {0.0, 0.0, 0.0, 1.0}; + static float bevel_mat_shininess[] = {40.0}; + static float bevel_mat_specular[] = {1.0, 1.0, 1.0, 0.0}; + static float bevel_mat_diffuse[] = {1.0, 0.0, 0.0, 0.0}; + + ReInit(); + + for (i = 0; i < RINGS; i++) + { + rgb_colors[i][0] = rgb_colors[i][1] = rgb_colors[i][2] = 0; + } + rgb_colors[BLUERING][2] = 255; + rgb_colors[REDRING][0] = 255; + rgb_colors[GREENRING][1] = 255; + rgb_colors[YELLOWRING][0] = 255; + rgb_colors[YELLOWRING][1] = 255; + mapped_colors[BLUERING] = COLOR_BLUE; + mapped_colors[REDRING] = COLOR_RED; + mapped_colors[GREENRING] = COLOR_GREEN; + mapped_colors[YELLOWRING] = COLOR_YELLOW; + mapped_colors[BLACKRING] = COLOR_BLACK; + + dests[BLUERING][0] = -spacing; + dests[BLUERING][1] = top_y; + dests[BLUERING][2] = top_z; + + dests[BLACKRING][0] = 0.0; + dests[BLACKRING][1] = top_y; + dests[BLACKRING][2] = top_z; + + dests[REDRING][0] = spacing; + dests[REDRING][1] = top_y; + dests[REDRING][2] = top_z; + + dests[YELLOWRING][0] = -spacing / 2.0; + dests[YELLOWRING][1] = bottom_y; + dests[YELLOWRING][2] = bottom_z; + + dests[GREENRING][0] = spacing / 2.0; + dests[GREENRING][1] = bottom_y; + dests[GREENRING][2] = bottom_z; + + base = 2.0; + height = 2.0; + theTorus = glGenLists(1); + glNewList(theTorus, GL_COMPILE); + FillTorus(0.1, 8, 1.0, 25); + glEndList(); + + x = (float)XSIZE; + y = (float)YSIZE; + aspect = x / y; + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + glEnable(GL_DEPTH_TEST); + glClearDepth(1.0); + + if (rgb) + { + glClearColor(0.5, 0.5, 0.5, 0.0); + glLightfv(GL_LIGHT0, GL_AMBIENT, light0_ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_diffuse); + glLightfv(GL_LIGHT0, GL_SPECULAR, light0_specular); + glLightfv(GL_LIGHT0, GL_POSITION, light0_position); + glEnable(GL_LIGHT0); + + glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, lmodel_local); + glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside); + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); + glEnable(GL_LIGHTING); + + glMaterialfv(GL_FRONT, GL_AMBIENT, bevel_mat_ambient); + glMaterialfv(GL_FRONT, GL_SHININESS, bevel_mat_shininess); + glMaterialfv(GL_FRONT, GL_SPECULAR, bevel_mat_specular); + glMaterialfv(GL_FRONT, GL_DIFFUSE, bevel_mat_diffuse); + + glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); + glEnable(GL_COLOR_MATERIAL); + glShadeModel(GL_SMOOTH); + } + else + { + glClearIndex(BACKGROUND); + glShadeModel(GL_FLAT); + } + + glMatrixMode(GL_PROJECTION); + gluPerspective(45, 1.33, 0.1, 100.0); + glMatrixMode(GL_MODELVIEW); + } + +UGL_LOCAL void echoUse(void) + { + printf("tOlympic keys:\n"); + printf(" SPACE Reinitialize\n"); + printf(" ESC Exit\n"); + } + +UGL_LOCAL void readKey (UGL_WCHAR key) + { + switch(key) + { + case UGL_UNI_SPACE: + ReInit(); + break; + case UGL_UNI_ESCAPE: + stopWex = 1; + break; + } + } + +UGL_LOCAL void loopEvent(void) + { + UGL_EVENT event; + UGL_INPUT_EVENT * pInputEvent; + + UGL_FOREVER + { + if (uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT) + != UGL_STATUS_Q_EMPTY) + { + pInputEvent = (UGL_INPUT_EVENT *)&event; + + if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && + pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) + readKey(pInputEvent->type.keyboard.key); + } + + drawGL(); + if (stopWex) + break; + } + } + +void windMLOlympic (void); + +void uglolympic (void) + { + taskSpawn("tOlympic", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLOlympic, + 0,1,2,3,4,5,6,7,8,9); + } + +void windMLOlympic(void) + { + UGL_INPUT_DEVICE_ID keyboardDevId; + + uglInitialize(); + + uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); + + if (uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, + (UGL_UINT32 *)&eventServiceId) == UGL_STATUS_OK) + { + qId = uglEventQCreate (eventServiceId, 100); + } + else + { + eventServiceId = UGL_NULL; + } + + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); + if (umc == NULL) + { + uglDeinitialize(); + return; + } + + uglMesaMakeCurrentContext(umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, + UGL_MESA_FULLSCREEN_HEIGHT); + + uglMesaGetIntegerv(UGL_MESA_RGB, &rgb); + + initGL(); + + echoUse(); + + stopWex = 0; + loopEvent(); + + if (eventServiceId != UGL_NULL) + uglEventQDestroy (eventServiceId, qId); + + uglMesaDestroyContext(); + uglDeinitialize(); + + return; + } diff --git a/progs/windml/uglpoint.c b/progs/windml/uglpoint.c new file mode 100644 index 00000000000..e184eaa7550 --- /dev/null +++ b/progs/windml/uglpoint.c @@ -0,0 +1,266 @@ + +/* uglpoint.c - WindML/Mesa example program */ + +/* Copyright (C) 2001 by Wind River Systems, Inc */ + +/* + * Mesa 3-D graphics library + * Version: 3.5 + * + * The MIT License + * 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 + * THE AUTHORS OR COPYRIGHT 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. + */ + +/* + * Authors: + * Stephane Raimbault + */ + +/* +DESCRIPTION +Draw a single point. +*/ + +#include +#include + +#include +#include +#include + +#include + +#define DOUBLE_BUFFER GL_TRUE + +enum { + BLACK = 0, + RED, + GREEN, + BLUE, + WHITE +}; + +UGL_LOCAL GLuint rgb; +UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; +UGL_LOCAL UGL_EVENT_Q_ID qId; +UGL_LOCAL UGL_MESA_CONTEXT umc; +UGL_LOCAL GLint angleT; + +UGL_LOCAL void initGL (void) + { + /* By passed in RGB mode */ + uglMesaSetColor(BLACK, 0.0, 0.0, 0.0); + uglMesaSetColor(RED, 1.0, 0.0, 0.0); + uglMesaSetColor(GREEN, 0.0, 1.0, 0.0); + uglMesaSetColor(BLUE, 0.0, 0.0, 1.0); + uglMesaSetColor(WHITE, 1.0, 1.0, 1.0); + + glOrtho(0.0, 1.0, 0.0, 1.0, -20.0, 20.0); + + glClearColor(0.0, 0.0, 0.0, 0.0); + glClearIndex(BLACK); + } + +UGL_LOCAL void drawGL (void) + { + GLint i; + GLfloat x, y; + + /* Avoid blinking in single buffer */ + + if (DOUBLE_BUFFER) + glClear(GL_COLOR_BUFFER_BIT); + + /* Random points */ + + glBegin(GL_POINTS); + (rgb) ? glColor3f(1.0, 0.0, 0.0): glIndexi(RED); + + for (i=0; i<150; i++) + { + x = rand() / (RAND_MAX+1.0); + y = rand() / (RAND_MAX+1.0); + glVertex2f(x, y); + } + + (rgb) ? glColor3f(0.0, 1.0, 0.0): glIndexi(GREEN); + + for (i=0; i<150; i++) + { + x = (rand() / (RAND_MAX+1.0)); + y = (rand() / (RAND_MAX+1.0)); + glVertex2f(x, y); + } + + (rgb) ? glColor3f(0.0, 0.0, 1.0): glIndexi(BLUE); + glVertex2f(0.5,0.5); + + for (i=0; i<150; i++) + { + x = rand() / (RAND_MAX+1.0); + y = rand() / (RAND_MAX+1.0); + glVertex2f(x, y); + } + + glEnd(); + + /* Smooth triangle */ + + glPushMatrix(); + glTranslatef(0.5, 0.5, 0); + glRotatef(angleT, 1.0, -1.0, 0.0); + angleT = angleT++ % 360; + glBegin(GL_TRIANGLES); + (rgb) ? glColor3f(1.0, 0.0, 0.0): glIndexi(RED); + glVertex2f(0.75, 0.25); + (rgb) ? glColor3f(0.0, 1.0, 0.0): glIndexi(GREEN); + glVertex2f(0.75, 0.75); + (rgb) ? glColor3f(0.0, 0.0, 1.0): glIndexi(BLUE); + glVertex2f(0.25, 0.75); + glEnd(); + glPopMatrix(); + + /* Flush and swap */ + + glFlush(); + + if(DOUBLE_BUFFER) + uglMesaSwapBuffers(); + } + +/************************************************************************ +* +* getEvent +* +* RETURNS: true or false +* +* NOMANUAL +* +*/ + +UGL_LOCAL int getEvent(void) + { + UGL_EVENT event; + UGL_STATUS status; + int retVal = 0; + + status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); + + while (status != UGL_STATUS_Q_EMPTY) + { + UGL_INPUT_EVENT * pInputEvent = (UGL_INPUT_EVENT *)&event; + + if (pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) + retVal = 1; + + status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); + } + + return(retVal); + } + +void windMLPoint (void); + +void uglpoint (void) + { + taskSpawn("tPoint", 210, VX_FP_TASK, 100000, + (FUNCPTR)windMLPoint, 0,1,2,3,4,5,6,7,8,9); + } + +void windMLPoint(void) + { + GLubyte pPixels[4]; + GLsizei width, height; + UGL_INPUT_DEVICE_ID keyboardDevId; + + angleT = 0; + + uglInitialize(); + + uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); + + if (uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, + (UGL_UINT32 *)&eventServiceId) == UGL_STATUS_OK) + { + qId = uglEventQCreate (eventServiceId, 100); + } + else + { + eventServiceId = UGL_NULL; + } + + if (DOUBLE_BUFFER) + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); + else + umc = uglMesaCreateNewContext(UGL_MESA_SINGLE, NULL); + + if (umc == NULL) + { + uglDeinitialize(); + return; + } + + /* Fullscreen */ + + uglMesaMakeCurrentContext(umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, + UGL_MESA_FULLSCREEN_HEIGHT); + + /* RGB or CI ? */ + + uglMesaGetIntegerv(UGL_MESA_RGB, &rgb); + + initGL(); + + while (!getEvent()) + drawGL(); + + uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); + uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); + + printf ("glReadPixel return "); + if (rgb) + { + glReadPixels(width/2, height/2, + 1, 1, GL_RGB, + GL_UNSIGNED_BYTE, pPixels); + glFlush(); + printf ("R:%i G:%i B:%i (RGB)", pPixels[0], pPixels[1], pPixels[2]); + } + else + { + glReadPixels(width/2, height/2, + 1, 1, GL_COLOR_INDEX, + GL_UNSIGNED_BYTE, pPixels); + glFlush(); + if (pPixels[0] == BLUE) + printf ("BLUE (CI)"); + else + printf ("%i (CI))", pPixels[0]); + } + + printf(" for %ix%i\n", width/2, height/2); + + if (eventServiceId != UGL_NULL) + uglEventQDestroy (eventServiceId, qId); + + uglMesaDestroyContext(); + uglDeinitialize(); + + return; + } diff --git a/progs/windml/uglstencil.c b/progs/windml/uglstencil.c new file mode 100644 index 00000000000..94e9f502596 --- /dev/null +++ b/progs/windml/uglstencil.c @@ -0,0 +1,233 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* + * (c) Copyright 1993, Silicon Graphics, Inc. + * ALL RIGHTS RESERVED + * Permission to use, copy, modify, and distribute this software for + * any purpose and without fee is hereby granted, provided that the above + * copyright notice appear in all copies and that both the copyright notice + * and this permission notice appear in supporting documentation, and that + * the name of Silicon Graphics, Inc. not be used in advertising + * or publicity pertaining to distribution of the software without specific, + * written prior permission. + * + * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" + * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR + * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON + * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, + * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY + * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, + * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF + * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN + * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE + * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE. + * + * US Government Users Restricted Rights + * Use, duplication, or disclosure by the Government is subject to + * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph + * (c)(1)(ii) of the Rights in Technical Data and Computer Software + * clause at DFARS 252.227-7013 and/or in similar or successor + * clauses in the FAR or the DOD or NASA FAR Supplement. + * Unpublished-- rights reserved under the copyright laws of the + * United States. Contractor/manufacturer is Silicon Graphics, + * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311. + * + * OpenGL(TM) is a trademark of Silicon Graphics, Inc. + */ +/* stencil.c + * This program draws two rotated tori in a window. + * A diamond in the center of the window masks out part + * of the scene. Within this mask, a different model + * (a sphere) is drawn in a different color. + */ + +/* + * Conversion to UGL/Mesa by Stephane Raimbault, 2001 + */ + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#define YELLOWMAT 1 +#define BLUEMAT 2 + +UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; +UGL_LOCAL UGL_EVENT_Q_ID qId; +UGL_LOCAL UGL_MESA_CONTEXT umc; + +UGL_LOCAL void initGL (GLsizei w, GLsizei h) + { + GLfloat yellow_diffuse[] = { 0.7, 0.7, 0.0, 1.0 }; + GLfloat yellow_specular[] = { 1.0, 1.0, 1.0, 1.0 }; + + GLfloat blue_diffuse[] = { 0.1, 0.1, 0.7, 1.0 }; + GLfloat blue_specular[] = { 0.1, 1.0, 1.0, 1.0 }; + + GLfloat position_one[] = { 1.0, 1.0, 1.0, 0.0 }; + + glNewList(YELLOWMAT, GL_COMPILE); + glMaterialfv(GL_FRONT, GL_DIFFUSE, yellow_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, yellow_specular); + glMaterialf(GL_FRONT, GL_SHININESS, 64.0); + glEndList(); + + glNewList(BLUEMAT, GL_COMPILE); + glMaterialfv(GL_FRONT, GL_DIFFUSE, blue_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, blue_specular); + glMaterialf(GL_FRONT, GL_SHININESS, 45.0); + glEndList(); + + glLightfv(GL_LIGHT0, GL_POSITION, position_one); + + glEnable(GL_LIGHT0); + glEnable(GL_LIGHTING); + glDepthFunc(GL_LESS); + glEnable(GL_DEPTH_TEST); + + glClearStencil(0x0); + glEnable(GL_STENCIL_TEST); + + glClear(GL_STENCIL_BUFFER_BIT); + +/* create a diamond shaped stencil area */ + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(-3.0, 3.0, -3.0, 3.0, -1.0, 1.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + glStencilFunc (GL_ALWAYS, 0x1, 0x1); + glStencilOp (GL_REPLACE, GL_REPLACE, GL_REPLACE); + glBegin(GL_QUADS); + glVertex3f (-1.0, 0.0, 0.0); + glVertex3f (0.0, 1.0, 0.0); + glVertex3f (1.0, 0.0, 0.0); + glVertex3f (0.0, -1.0, 0.0); + glEnd(); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(45.0, (GLfloat) w/(GLfloat) h, 3.0, 7.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0, 0.0, -5.0); + } + +/* Draw a sphere in a diamond-shaped section in the + * middle of a window with 2 tori. + */ +UGL_LOCAL void drawGL(void) + { + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glStencilOp (GL_KEEP, GL_KEEP, GL_KEEP); + +/* draw blue sphere where the stencil is 1 */ + glStencilFunc (GL_EQUAL, 0x1, 0x1); + glCallList (BLUEMAT); + glutSolidSphere (0.5, 15, 15); + +/* draw the tori where the stencil is not 1 */ + glStencilFunc (GL_NOTEQUAL, 0x1, 0x1); + glPushMatrix(); + glRotatef (45.0, 0.0, 0.0, 1.0); + glRotatef (45.0, 0.0, 1.0, 0.0); + glCallList (YELLOWMAT); + glutSolidTorus (0.275, 0.85, 15, 15); + glPushMatrix(); + glRotatef (90.0, 1.0, 0.0, 0.0); + glutSolidTorus (0.275, 0.85, 15, 15); + glPopMatrix(); + glPopMatrix(); + + glFlush(); + + uglMesaSwapBuffers(); + } + +UGL_LOCAL int getEvent(void) + { + UGL_EVENT event; + UGL_STATUS status; + int retVal = 0; + + status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); + + while (status != UGL_STATUS_Q_EMPTY) + { + UGL_INPUT_EVENT * pInputEvent = (UGL_INPUT_EVENT *)&event; + + if (pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) + retVal = 1; + + status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); + } + + return(retVal); + } + +void windMLStencil (void); + +void uglstencil (void) + { + taskSpawn("tStencil", 210, VX_FP_TASK, 100000, + (FUNCPTR)windMLStencil, 0,1,2,3,4,5,6,7,8,9); + } + +void windMLStencil(void) + { + UGL_INPUT_DEVICE_ID keyboardDevId; + GLsizei width, height; + + uglInitialize(); + + uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); + + uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); + + qId = uglEventQCreate (eventServiceId, 100); + + umc = uglMesaCreateNewContextExt(GL_FALSE, + 16, + 8, + 0,0,0,0, + NULL); + if (umc == NULL) + { + uglDeinitialize(); + return; + } + + /* Fullscreen */ + + uglMesaMakeCurrentContext(umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, + UGL_MESA_FULLSCREEN_HEIGHT); + + uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); + uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); + + initGL(width, height); + + drawGL(); + + while (!getEvent()); + + uglEventQDestroy (eventServiceId, qId); + + uglMesaDestroyContext(); + uglDeinitialize(); + + return; + } + diff --git a/progs/windml/uglteapot.c b/progs/windml/uglteapot.c new file mode 100644 index 00000000000..26c766d8346 --- /dev/null +++ b/progs/windml/uglteapot.c @@ -0,0 +1,290 @@ +/* + * Mesa 3-D graphics library + * Version: 3.5 + * + * The MIT License + * 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 + * THE AUTHORS OR COPYRIGHT 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. + */ + +/* + * Linux Magazine July 2001 + * Conversion to UGL/Mesa from GLUT by Stephane Raimbault, 2001 + */ + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +/* Need GLUT_SHAPES */ + +#include + +#ifndef PI +#define PI 3.14159265 +#endif + +UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; +UGL_LOCAL UGL_EVENT_Q_ID qId; +UGL_LOCAL UGL_MESA_CONTEXT umc; +UGL_LOCAL volatile UGL_BOOL stopWex; + +UGL_LOCAL GLint angle; +UGL_LOCAL GLfloat Sin[360], Cos[360]; +UGL_LOCAL GLfloat L0pos[]={0.0, 2.0, -1.0}; +UGL_LOCAL GLfloat L0dif[]={0.3, 0.3, 0.8}; +UGL_LOCAL GLfloat L1pos[]={2.0, 2.0, 2.0}; +UGL_LOCAL GLfloat L1dif[]={0.5, 0.5, 0.5}; +UGL_LOCAL GLfloat Mspec[3]; +UGL_LOCAL GLfloat Mshiny; +UGL_LOCAL GLuint theTeapot; + +UGL_LOCAL void calcTableCosSin() +{ + int i; + for(i=0;i<360;i++) { + Cos[i] = cos(((float)i)/180.0*PI); + Sin[i] = sin(((float)i)/180.0*PI); + } +} + +UGL_LOCAL void initGL(void) + { + glClearColor(0.0, 0.0, 0.0, 0.0); + glColor3f(1.0, 0.0, 0.0); + glEnable(GL_DEPTH_TEST); + + glShadeModel(GL_SMOOTH); + glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_LIGHT1); + glLightfv(GL_LIGHT0, GL_DIFFUSE, L0dif); + glLightfv(GL_LIGHT0, GL_SPECULAR, L0dif); + glLightfv(GL_LIGHT1, GL_DIFFUSE, L1dif); + glLightfv(GL_LIGHT1, GL_SPECULAR, L1dif); + + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, Mspec); + glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, Mshiny); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(45.0, 1.0, 0.1, 10.0); + glMatrixMode(GL_MODELVIEW); + + theTeapot = glGenLists(1); + glNewList(theTeapot, GL_COMPILE); + glutSolidTeapot(1.0); + glEndList(); + + } + +UGL_LOCAL void drawGL() + { + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glLoadIdentity(); + + gluLookAt(4.5*Cos[angle], 2.0,4.5*Sin[angle],0.0,0.0,0.0,0.0, + 1.0,0.0); + glLightfv(GL_LIGHT0, GL_POSITION, L0pos); + glLightfv(GL_LIGHT1, GL_POSITION, L1pos); + + glCallList(theTeapot); + + glFlush(); + + uglMesaSwapBuffers(); + } + +UGL_LOCAL void echoUse(void) + { + printf("tTeapot keys:\n"); + printf(" Left Counter clockwise rotation (y-axis)\n"); + printf(" Right Clockwise rotation (y-axis)\n"); + printf(" j Enable/disable Light0\n"); + printf(" k Enable/disable Light1\n"); + printf(" m Add specular\n"); + printf(" l Remove specular\n"); + printf(" o Add shininess\n"); + printf(" p Remove shininess\n"); + printf(" ESC Exit\n"); + } + + +UGL_LOCAL void readKey (UGL_WCHAR key) + { + switch(key) + { + case UGL_UNI_RIGHT_ARROW: + angle +=2; + if (angle>= 360) + angle-=360; + break; + case UGL_UNI_LEFT_ARROW: + angle -=2; + if (angle<0) + angle+=360; + break; + case 'j': + glIsEnabled(GL_LIGHT0) ? + glDisable(GL_LIGHT0) : glEnable(GL_LIGHT0); + break; + case 'k': + glIsEnabled(GL_LIGHT1) ? + glDisable(GL_LIGHT1) : glEnable(GL_LIGHT1); + break; + case 'm': + Mspec[0]+=0.1; + if(Mspec[0]>1) + Mspec[0]=1; + Mspec[1]+=0.1; + if(Mspec[1]>1) + Mspec[1]=1; + Mspec[2]+=0.1; + if(Mspec[2]>1) + Mspec[2]=1; + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, Mspec); + break; + case 'l': + Mspec[0]-=0.1; + if(Mspec[0]>1) + Mspec[0]=1; + Mspec[1]-=0.1; + if(Mspec[1]>1) + Mspec[1]=1; + Mspec[2]-=0.1; + if(Mspec[2]>1) + Mspec[2]=1; + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, Mspec); + break; + case 'o': + Mshiny -= 1; + if (Mshiny<0) + Mshiny=0; + glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, Mshiny); + break; + case 'p': + Mshiny += 1; + if (Mshiny>128) + Mshiny=128; + glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, Mshiny); + break; + case UGL_UNI_ESCAPE: + stopWex = UGL_TRUE; + break; + } + } + +UGL_LOCAL void loopEvent(void) + { + UGL_EVENT event; + UGL_INPUT_EVENT * pInputEvent; + + UGL_FOREVER + { + if (uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT) + != UGL_STATUS_Q_EMPTY) + { + pInputEvent = (UGL_INPUT_EVENT *)&event; + + if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && + pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) + readKey(pInputEvent->type.keyboard.key); + } + + drawGL(); + if (stopWex) + break; + } + } + +void windMLTeapot (void); + +void uglteapot (void) + { + taskSpawn ("tTeapot", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLTeapot, + 0,1,2,3,4,5,6,7,8,9); + } + +void windMLTeapot (void) + { + UGL_INPUT_DEVICE_ID keyboardDevId; + GLsizei displayWidth, displayHeight; + GLsizei x, y, w, h; + + angle = 45; + Mspec[0] = 0.5; + Mspec[1] = 0.5; + Mspec[2] = 0.5; + Mshiny = 50; + + uglInitialize (); + + uglDriverFind (UGL_KEYBOARD_TYPE, 0, + (UGL_UINT32 *)&keyboardDevId); + + uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); + + qId = uglEventQCreate (eventServiceId, 100); + + /* Double buffering */ + umc = uglMesaCreateNewContext (UGL_MESA_DOUBLE, NULL); + if (umc == NULL) + { + uglDeinitialize (); + return; + } + + uglMesaMakeCurrentContext (umc, 0, 0, 1, 1); + + uglMesaGetIntegerv(UGL_MESA_DISPLAY_WIDTH, &displayWidth); + uglMesaGetIntegerv(UGL_MESA_DISPLAY_HEIGHT, &displayHeight); + + h = (displayHeight*2)/3; + w = h; + x = (displayWidth-w)/2; + y = (displayHeight-h)/2; + + uglMesaMoveToWindow(x, y); + uglMesaResizeToWindow(w, h); + + calcTableCosSin(); + + initGL (); + + echoUse(); + + stopWex = UGL_FALSE; + loopEvent(); + + uglEventQDestroy (eventServiceId, qId); + + uglMesaDestroyContext(); + uglDeinitialize (); + + return; + } diff --git a/progs/windml/ugltexcube.c b/progs/windml/ugltexcube.c new file mode 100644 index 00000000000..1ce6666b65a --- /dev/null +++ b/progs/windml/ugltexcube.c @@ -0,0 +1,460 @@ + +/* ugltexcube.c - WindML/Mesa example program */ + +/* Copyright (C) 2001 by Wind River Systems, Inc */ + +/* + * Mesa 3-D graphics library + * Version: 3.5 + * + * The MIT License + * 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 + * THE AUTHORS OR COPYRIGHT 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. + */ + +/* + * Authors: + * Stephane Raimbault + */ + +/* +DESCRIPTION +Draw a textured cube +*/ + +#include +#include +#include + +#include +#include +#include +#include +#include + +#define IMAGE_FILE "Mesa/windmldemos/wrs_logo.bmp" + +UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; +UGL_LOCAL UGL_EVENT_Q_ID qId; +UGL_LOCAL UGL_MESA_CONTEXT umc; + +UGL_LOCAL GLfloat xrot, yrot, zrot; +UGL_LOCAL GLuint texture[1]; +UGL_LOCAL GLuint theTexCube; + +typedef struct { + unsigned long sizeX; + unsigned long sizeY; + char *data; + } TEX_IMAGE; + +UGL_LOCAL void cleanUp (void); + +UGL_LOCAL GLboolean imageLoad(char *filename, TEX_IMAGE * texImage) + { + FILE * file = NULL; + unsigned long size; + unsigned long i; + unsigned short int planes; + unsigned short int bpp; + char temp; + + if ((file = fopen(filename, "rb")) == NULL) + { + printf("File Not Found : %s\n", filename); + return GL_FALSE; + } + + fseek(file, 18, SEEK_CUR); + + if ((i = fread(&texImage->sizeX, 4, 1, file)) != 1) + { + printf("Error reading width from %s.\n", filename); + return GL_FALSE; + } + + printf("Width of %s: %lu\n", filename, texImage->sizeX); + + if ((i = fread(&texImage->sizeY, 4, 1, file)) != 1) + { + printf("Error reading height from %s.\n", filename); + return GL_FALSE; + } + + printf("Height of %s: %lu\n", filename, texImage->sizeY); + size = texImage->sizeX * texImage->sizeY * 3; + + if ((fread(&planes, 2, 1, file)) != 1) + { + printf("Error reading planes from %s.\n", filename); + return GL_FALSE; + } + + if (planes != 1) + { + printf("Planes from %s is not 1: %u\n", filename, planes); + return GL_FALSE; + } + + if ((i = fread(&bpp, 2, 1, file)) != 1) + { + printf("Error reading bpp from %s.\n", filename); + return GL_FALSE; + } + + if (bpp != 24) + { + printf("Bpp from %s is not 24: %u\n", filename, bpp); + return GL_FALSE; + } + + fseek(file, 24, SEEK_CUR); + + texImage->data = (char *) malloc(size); + + if (texImage->data == NULL) + { + printf("Error allocating memory for color-corrected texImage data"); + return GL_FALSE; + } + + if ((i = fread(texImage->data, size, 1, file)) != 1) + { + printf("Error reading texImage data from %s.\n", filename); + free(texImage->data); + return GL_FALSE; + } + + /* bgr -> rgb */ + + for (i=0; idata[i]; + texImage->data[i] = texImage->data[i + 2]; + texImage->data[i + 2] = temp; + } + + fclose(file); + + return GL_TRUE; + } + + +UGL_LOCAL void loadGLTexture() + { + TEX_IMAGE * texImage=NULL; + + texImage = (TEX_IMAGE *) malloc(sizeof(TEX_IMAGE)); + + if (texImage == NULL) + { + printf("Error allocating space for image"); + cleanUp(); + exit(1); + } + + if (!imageLoad(IMAGE_FILE, texImage)) + { + printf("Error allocating space for image data"); + free(texImage); + cleanUp(); + exit(1); + } + + /* Create Texture */ + glGenTextures(1, &texture[0]); + glBindTexture(GL_TEXTURE_2D, texture[0]); + glTexImage2D(GL_TEXTURE_2D, 0, 3, + texImage->sizeX, texImage->sizeY, + 0, GL_RGB, GL_UNSIGNED_BYTE, texImage->data); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + + free(texImage->data); + free(texImage); + } + +UGL_LOCAL void initGL(int width, int height) + { + + /* Load the texture(s) */ + loadGLTexture(); + + /* Enable texture mapping */ + glEnable(GL_TEXTURE_2D); + + /* Clear the background color to black */ + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + + glEnable(GL_CULL_FACE); + + /* Enables smooth color shading */ + glShadeModel(GL_SMOOTH); + +/* glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); */ +/* glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); */ + + theTexCube = glGenLists(1); + glNewList(theTexCube, GL_COMPILE); + + /* Choose the texture to use */ + glBindTexture(GL_TEXTURE_2D, texture[0]); + + /* Begin drawing a cube */ + glBegin(GL_QUADS); + + /* Front face (note that the texture's corners have to match the + quad's corners) */ + + /* Bottom left of the texture and quad */ + glTexCoord2f(0.0f, 0.0f); + glVertex3f(-1.0f, -1.0f, 1.0f); + + /* Bottom Right Of The Texture and Quad */ + glTexCoord2f(1.0f, 0.0f); + glVertex3f(1.0f, -1.0f, 1.0f); + + /* Top Right Of The Texture and Quad */ + glTexCoord2f(1.0f, 1.0f); + glVertex3f(1.0f, 1.0f, 1.0f); + /* Top Left Of The Texture and Quad */ + glTexCoord2f(0.0f, 1.0f); + glVertex3f(-1.0f, 1.0f, 1.0f); + + /* Back Face */ + + /* Bottom Right Of The Texture and Quad */ + glTexCoord2f(1.0f, 0.0f); + glVertex3f(-1.0f, -1.0f, -1.0f); + + /* Top Right Of The Texture and Quad */ + glTexCoord2f(1.0f, 1.0f); + glVertex3f(-1.0f, 1.0f, -1.0f); + + /* Top Left Of The Texture and Quad */ + glTexCoord2f(0.0f, 1.0f); + glVertex3f(1.0f, 1.0f, -1.0f); + + /* Bottom Left Of The Texture and Quad */ + glTexCoord2f(0.0f, 0.0f); + glVertex3f(1.0f, -1.0f, -1.0f); + + + /* Top Face */ + + /* Top Left Of The Texture and Quad */ + glTexCoord2f(0.0f, 1.0f); + glVertex3f(-1.0f, 1.0f, -1.0f); + + /* Bottom Left Of The Texture and Quad */ + glTexCoord2f(0.0f, 0.0f); + glVertex3f(-1.0f, 1.0f, 1.0f); + + /* Bottom Right Of The Texture and Quad */ + glTexCoord2f(1.0f, 0.0f); + glVertex3f(1.0f, 1.0f, 1.0f); + + /* Top Right Of The Texture and Quad */ + glTexCoord2f(1.0f, 1.0f); + glVertex3f(1.0f, 1.0f, -1.0f); + + /* Bottom Face */ + + /* Top Right Of The Texture and Quad */ + glTexCoord2f(1.0f, 1.0f); + glVertex3f(-1.0f, -1.0f, -1.0f); + + /* Top Left Of The Texture and Quad */ + glTexCoord2f(0.0f, 1.0f); + glVertex3f(1.0f, -1.0f, -1.0f); + + /* Bottom Left Of The Texture and Quad */ + glTexCoord2f(0.0f, 0.0f); + glVertex3f(1.0f, -1.0f, 1.0f); + + /* Bottom Right Of The Texture and Quad */ + glTexCoord2f(1.0f, 0.0f); + glVertex3f(-1.0f, -1.0f, 1.0f); + + + /* Right face */ + /* Bottom Right Of The Texture and Quad */ + glTexCoord2f(1.0f, 0.0f); + glVertex3f(1.0f, -1.0f, -1.0f); + + /* Top Right Of The Texture and Quad */ + glTexCoord2f(1.0f, 1.0f); + glVertex3f(1.0f, 1.0f, -1.0f); + + /* Top Left Of The Texture and Quad */ + glTexCoord2f(0.0f, 1.0f); + glVertex3f(1.0f, 1.0f, 1.0f); + + /* Bottom Left Of The Texture and Quad */ + glTexCoord2f(0.0f, 0.0f); + glVertex3f(1.0f, -1.0f, 1.0f); + + + /* Left Face */ + /* Bottom Left Of The Texture and Quad */ + glTexCoord2f(0.0f, 0.0f); + glVertex3f(-1.0f, -1.0f, -1.0f); + + /* Bottom Right Of The Texture and Quad */ + glTexCoord2f(1.0f, 0.0f); + glVertex3f(-1.0f, -1.0f, 1.0f); + + /* Top Right Of The Texture and Quad */ + glTexCoord2f(1.0f, 1.0f); + glVertex3f(-1.0f, 1.0f, 1.0f); + + /* Top Left Of The Texture and Quad */ + glTexCoord2f(0.0f, 1.0f); + glVertex3f(-1.0f, 1.0f, -1.0f); + + glEnd(); /* done with the polygon */ + glEndList(); + + glMatrixMode(GL_PROJECTION); + /* Reset the projection matrix */ + glLoadIdentity(); + /* Calculate the aspect ratio of the window */ + gluPerspective(45.0f, (GLfloat) width / (GLfloat) height, 0.1f, 100.0f); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + } + +UGL_LOCAL void drawGL() + { + glClear(GL_COLOR_BUFFER_BIT); + + /* Reset The View */ + glPushMatrix(); + + /* Move 8 units into the screen */ + glTranslatef(0.0f, 0.0f, -8.0f); + + /* Rotate on the X axis */ + glRotatef(xrot, 1.0f, 0.0f, 0.0f); + + /* Rotate on the Y axis */ + glRotatef(yrot, 0.0f, 1.0f, 0.0f); + + /* Rotate On The Z Axis */ + glRotatef(zrot, 0.0f, 0.0f, 1.0f); + + glCallList(theTexCube); + + glFlush(); + + uglMesaSwapBuffers(); + + glPopMatrix(); + + xrot += 1.6f; + yrot += 1.6f; + zrot += 1.6f; +} + +UGL_LOCAL int getEvent(void) + { + UGL_EVENT event; + UGL_STATUS status; + int retVal = 0; + + status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); + + while (status != UGL_STATUS_Q_EMPTY) + { + UGL_INPUT_EVENT * pInputEvent = (UGL_INPUT_EVENT *)&event; + + if (pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) + retVal = 1; + + status = uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT); + } + + return(retVal); + } + +UGL_LOCAL void cleanUp (void) + { + if (eventServiceId != UGL_NULL) + uglEventQDestroy (eventServiceId, qId); + + uglMesaDestroyContext(); + uglDeinitialize(); + } + +void windMLTexCube (void); + +void ugltexcube (void) + { + taskSpawn("tTexCube", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLTexCube, + 0,1,2,3,4,5,6,7,8,9); + } + + +void windMLTexCube(void) + { + GLuint width, height; + UGL_INPUT_DEVICE_ID keyboardDevId; + + uglInitialize(); + + uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); + + if (uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, + (UGL_UINT32 *)&eventServiceId) == UGL_STATUS_OK) + { + qId = uglEventQCreate (eventServiceId, 100); + } + else + { + eventServiceId = UGL_NULL; + } + + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); + + if (umc == NULL) + { + uglDeinitialize(); + return; + } + + uglMesaMakeCurrentContext(umc, 0, 0, + UGL_MESA_FULLSCREEN_WIDTH, + UGL_MESA_FULLSCREEN_HEIGHT); + + + uglMesaGetIntegerv(UGL_MESA_WIDTH, &width); + uglMesaGetIntegerv(UGL_MESA_HEIGHT, &height); + + initGL(width, height); + + while(!getEvent()) + drawGL(); + + cleanUp(); + + return; + } + + diff --git a/progs/windml/ugltexcyl.c b/progs/windml/ugltexcyl.c new file mode 100644 index 00000000000..d83c20b2f38 --- /dev/null +++ b/progs/windml/ugltexcyl.c @@ -0,0 +1,399 @@ +/* + * Textured cylinder demo: lighting, texturing, reflection mapping. + * + * Brian Paul May 1997 This program is in the public domain. + * + * Conversion to UGL/Mesa by Stephane Raimbault + */ + +/* + * $Log: ugltexcyl.c,v $ + * Revision 1.1 2001/08/20 16:07:11 brianp + * WindML driver (Stephane Raimbault) + * + * Revision 1.5 2001/03/27 17:35:26 brianp + * set initial window pos + * + * Revision 1.4 2000/12/24 22:53:54 pesco + * * demos/Makefile.am (INCLUDES): Added -I$(top_srcdir)/util. + * * demos/Makefile.X11, demos/Makefile.BeOS-R4, demos/Makefile.cygnus: + * Essentially the same. + * Program files updated to include "readtex.c", not "../util/readtex.c". + * * demos/reflect.c: Likewise for "showbuffer.c". + * + * + * * Makefile.am (EXTRA_DIST): Added top-level regular files. + * + * * include/GL/Makefile.am (INC_X11): Added glxext.h. + * + * + * * src/GGI/include/ggi/mesa/Makefile.am (EXTRA_HEADERS): Include + * Mesa GGI headers in dist even if HAVE_GGI is not given. + * + * * configure.in: Look for GLUT and demo source dirs in $srcdir. + * + * * src/swrast/Makefile.am (libMesaSwrast_la_SOURCES): Set to *.[ch]. + * More source list updates in various Makefile.am's. + * + * * Makefile.am (dist-hook): Remove CVS directory from distribution. + * (DIST_SUBDIRS): List all possible subdirs here. + * (SUBDIRS): Only list subdirs selected for build again. + * The above two applied to all subdir Makefile.am's also. + * + * Revision 1.3 2000/09/29 23:09:39 brianp + * added fps output + * + * Revision 1.2 1999/10/21 16:39:06 brianp + * added -info command line option + * + * Revision 1.1.1.1 1999/08/19 00:55:40 jtg + * Imported sources + * + * Revision 3.3 1999/03/28 18:24:37 brianp + * minor clean-up + * + * Revision 3.2 1998/11/05 04:34:04 brianp + * moved image files to ../images/ directory + * + * Revision 3.1 1998/06/23 03:16:51 brianp + * added Point/Linear sampling menu items + * + * Revision 3.0 1998/02/14 18:42:29 brianp + * initial rev + * + */ + + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include "../util/readtex.h" + +#define TEXTURE_FILE "Mesa/images/reflect.rgb" + +#define LIT 1 +#define TEXTURED 2 +#define REFLECT 3 +#define ANIMATE 10 +#define POINT_FILTER 20 +#define LINEAR_FILTER 21 +#define QUIT 100 +#define COUNT_FRAMES + +UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; +UGL_LOCAL UGL_EVENT_Q_ID qId; +UGL_LOCAL volatile UGL_BOOL stopWex; +UGL_LOCAL UGL_MESA_CONTEXT umc; + +UGL_LOCAL GLuint CylinderObj; +UGL_LOCAL GLboolean Animate; +UGL_LOCAL GLboolean linearFilter; + +UGL_LOCAL GLfloat Xrot, Yrot, Zrot; +UGL_LOCAL GLfloat DXrot, DYrot; + +UGL_LOCAL GLuint limit; +UGL_LOCAL GLuint count; +UGL_LOCAL GLuint tickStart, tickStop, tickBySec; + +UGL_LOCAL void cleanUp (void); + +UGL_LOCAL void drawGL(void) + { +#ifdef COUNT_FRAMES + int time; +#endif + + glClear( GL_COLOR_BUFFER_BIT ); + + glPushMatrix(); + glRotatef(Xrot, 1.0, 0.0, 0.0); + glRotatef(Yrot, 0.0, 1.0, 0.0); + glRotatef(Zrot, 0.0, 0.0, 1.0); + glScalef(5.0, 5.0, 5.0); + glCallList(CylinderObj); + + glPopMatrix(); + + uglMesaSwapBuffers(); + + if (Animate) + { + Xrot += DXrot; + Yrot += DYrot; + } + +#ifdef COUNT_FRAMES + if (count > limit) + { + tickStop = tickGet (); + time = (tickStop-tickStart)/tickBySec; + printf (" %i fps\n", count/time); + tickStart = tickStop; + count = 0; + } + else + count++; +#endif + + } + +UGL_LOCAL void echoUse(void) + { + printf("Keys:\n"); + printf(" Up/Down Rotate on Y\n"); + printf(" Left/Right Rotate on X\n"); + printf(" a Toggle animation\n"); + printf(" f Toggle point/linear filtered\n"); + printf(" l Lit\n"); + printf(" t Textured\n"); + printf(" r Reflect\n"); + printf(" ESC Exit\n"); + } + +UGL_LOCAL void readKey(UGL_WCHAR key) + { + float step = 3.0; + switch (key) + { + case 'a': + Animate = !Animate; + break; + case 'f': + if(linearFilter) + { + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, + GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, + GL_NEAREST); + } + else + { + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, + GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, + GL_LINEAR); + } + linearFilter = !linearFilter; + break; + case 'l': + glEnable(GL_LIGHTING); + glDisable(GL_TEXTURE_2D); + glDisable(GL_TEXTURE_GEN_S); + glDisable(GL_TEXTURE_GEN_T); + break; + case 't': + glDisable(GL_LIGHTING); + glEnable(GL_TEXTURE_2D); + glDisable(GL_TEXTURE_GEN_S); + glDisable(GL_TEXTURE_GEN_T); + break; + case 'r': + glDisable(GL_LIGHTING); + glEnable(GL_TEXTURE_2D); + glEnable(GL_TEXTURE_GEN_S); + glEnable(GL_TEXTURE_GEN_T); + break; + case UGL_UNI_UP_ARROW: + Xrot += step; + break; + case UGL_UNI_DOWN_ARROW: + Xrot -= step; + break; + case UGL_UNI_LEFT_ARROW: + Yrot += step; + break; + case UGL_UNI_RIGHT_ARROW: + Yrot -= step; + break; + case UGL_UNI_ESCAPE: + stopWex = UGL_TRUE; + break; + } + } + +UGL_LOCAL void loopEvent(void) + { + UGL_EVENT event; + UGL_INPUT_EVENT * pInputEvent; + + UGL_FOREVER + { + if (uglEventGet (qId, &event, sizeof (event), UGL_NO_WAIT) + != UGL_STATUS_Q_EMPTY) + { + pInputEvent = (UGL_INPUT_EVENT *)&event; + + if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && + pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) + readKey(pInputEvent->type.keyboard.key); + } + + drawGL(); + if (stopWex) + break; + } + } + +UGL_LOCAL void initGL(void) + { + GLUquadricObj *q = gluNewQuadric(); + CylinderObj = glGenLists(1); + glNewList(CylinderObj, GL_COMPILE); + + glTranslatef(0.0, 0.0, -1.0); + + /* cylinder */ + gluQuadricNormals(q, GL_SMOOTH); + gluQuadricTexture(q, GL_TRUE); + gluCylinder(q, 0.6, 0.6, 2.0, 24, 1); + + /* end cap */ + glTranslatef(0.0, 0.0, 2.0); + gluDisk(q, 0.0, 0.6, 24, 1); + + /* other end cap */ + glTranslatef(0.0, 0.0, -2.0); + gluQuadricOrientation(q, GLU_INSIDE); + gluDisk(q, 0.0, 0.6, 24, 1); + + glEndList(); + gluDeleteQuadric(q); + + /* lighting */ + glEnable(GL_LIGHTING); + { + GLfloat gray[4] = {0.2, 0.2, 0.2, 1.0}; + GLfloat white[4] = {1.0, 1.0, 1.0, 1.0}; + GLfloat teal[4] = { 0.0, 1.0, 0.8, 1.0 }; + glMaterialfv(GL_FRONT, GL_DIFFUSE, teal); + glLightfv(GL_LIGHT0, GL_AMBIENT, gray); + glLightfv(GL_LIGHT0, GL_DIFFUSE, white); + glEnable(GL_LIGHT0); + } + + /* fitering = nearest, initially */ + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); + + glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); + glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); + + if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) + { + printf("Error: couldn't load texture image\n"); + cleanUp(); + exit(1); + } + + glEnable(GL_CULL_FACE); /* don't need Z testing for convex objects */ + + glEnable(GL_LIGHTING); + + glMatrixMode( GL_PROJECTION ); + glLoadIdentity(); + glFrustum( -1.0, 1.0, -1.0, 1.0, 10.0, 100.0 ); + glMatrixMode( GL_MODELVIEW ); + glLoadIdentity(); + glTranslatef( 0.0, 0.0, -70.0 ); + + printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); + printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); + printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); + printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS)); + +#ifdef COUNT_FRAMES + tickStart = tickGet (); + tickBySec = sysClkRateGet (); +#endif + + } + +UGL_LOCAL void cleanUp (void) + { + uglEventQDestroy (eventServiceId, qId); + + uglMesaDestroyContext(); + uglDeinitialize (); + } + +void windMLTexCyl (void); + +void ugltexcyl (void) + { + taskSpawn ("tTexCyl", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLTexCyl, + 0,1,2,3,4,5,6,7,8,9); + } + +void windMLTexCyl (void) + { + UGL_INPUT_DEVICE_ID keyboardDevId; + GLsizei displayWidth, displayHeight; + GLsizei x, y, w, h; + + CylinderObj = 0; + Animate = GL_TRUE; + linearFilter = GL_FALSE; + Xrot = 0.0; + Yrot = 0.0; + Zrot = 0.0; + DXrot = 1.0; + DYrot = 2.5; + limit = 100; + count = 1; + + uglInitialize (); + + uglDriverFind (UGL_KEYBOARD_TYPE, 0, + (UGL_UINT32 *)&keyboardDevId); + + uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); + + qId = uglEventQCreate (eventServiceId, 100); + + /* Double buffering */ + umc = uglMesaCreateNewContext (UGL_MESA_DOUBLE, NULL); + if (umc == NULL) + { + uglDeinitialize (); + return; + } + + uglMesaMakeCurrentContext (umc, 0, 0, 1, 1); + + uglMesaGetIntegerv(UGL_MESA_DISPLAY_WIDTH, &displayWidth); + uglMesaGetIntegerv(UGL_MESA_DISPLAY_HEIGHT, &displayHeight); + + h = (displayHeight*3)/4; + w = h; + x = (displayWidth-w)/2; + y = (displayHeight-h)/2; + + uglMesaMoveToWindow(x, y); + uglMesaResizeToWindow(w, h); + + initGL (); + + echoUse(); + + stopWex = UGL_FALSE; + loopEvent(); + + cleanUp(); + + return; + } + diff --git a/progs/windml/wrs_logo.bmp b/progs/windml/wrs_logo.bmp new file mode 100644 index 00000000000..9a9f04255be Binary files /dev/null and b/progs/windml/wrs_logo.bmp differ diff --git a/src/glu/mesa/Makefile.ugl b/src/glu/mesa/Makefile.ugl new file mode 100644 index 00000000000..fc189bd8047 --- /dev/null +++ b/src/glu/mesa/Makefile.ugl @@ -0,0 +1,96 @@ +# Mesa 3-D graphics library +# Version: 3.5 +# +# Copyright (C) 2001 Wind River Systems, Inc + +# The MIT License +# 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 +# THE AUTHORS OR COPYRIGHT HOLDERS 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 GLU library + +##### MACROS ##### +GLU_MAJOR = 1 +GLU_MINOR = 3 +GLU_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) + +##### RULES ##### + +include ../rules.windml + +GLU_SOURCES = \ + glu.c \ + mipmap.c \ + nurbs.c \ + nurbscrv.c \ + nurbssrf.c \ + nurbsutl.c \ + polytest.c \ + project.c \ + quadric.c \ + tess.c \ + tesselat.c \ + ../src/windml/tornado/torMesaGLUInit.c + +GLU_OBJECTS = $(GLU_SOURCES:.c=.o) +GLU_OBJNAME = $(MESA_LIBDIR)/objMesaGLU.o + +SOURCES = $(GLU_SOURCES) + +##### TARGETS ##### + +all: depend.$(CPU)$(TOOL) $(GLU_OBJNAME) + +# Make the GLU library +$(GLU_OBJNAME): $(GLU_OBJECTS) +# $(LD) -r $(GLU_OBJECTS) -o $(MESA_OBJNAME) + $(LD) -r $(GLU_OBJECTS) -o $(GLU_OBJNAME) +# $(AR) rus $(MESA_LIBNAME) $(GLU_OBJNAME) +# $(AR) rus $(VX_LIBNAME) $(GLU_OBJNAME) + +depend.$(CPU)$(TOOL): +ifeq ($(WIND_HOST_TYPE),x86-win32) + @ $(RM) $@ + @ $(ECHO) Creating depend.$(CPU)$(TOOL) +ifneq ($(SOURCES),) + @ for %f in ($(SOURCES)) do \ + $(CC) -MM $(CFLAGS) %f >>$@ +endif +else +Makefile + @ $(RM) $@ + @ $(ECHO) "Creating depend.$(CPU)$(TOOL)" +ifneq ($(SOURCES),) + @ for FILE in $(filter-out $(NODEPENDOBJS), $(SOURCES)); \ + do \ + $(CC) -MM $(CFLAGS) $$FILE \ + | $(TCL) $(BIN_DIR)/depend.tcl $(TGT_DIR) >>$@; \ + done +endif +endif + +.PHONY = clean + +clean: +# $(AR) d $(MESA_LIBNAME) $(GLU_OBJNAME) +# $(AR) d $(VX_LIBNAME) $(GLU_OBJNAME) + $(RM) $(GLU_OBJNAME) + $(RM) $(GLU_OBJECTS) + $(RM) depend.$(CPU)$(TOOL) + +include depend.$(CPU)$(TOOL) diff --git a/src/mesa/main/Makefile.ugl b/src/mesa/main/Makefile.ugl new file mode 100644 index 00000000000..2dcca3c2155 --- /dev/null +++ b/src/mesa/main/Makefile.ugl @@ -0,0 +1,367 @@ +# Mesa 3-D graphics library +# Version: 3.5 +# +# Copyright (C) 2001 Wind River Systems, Inc + +# The MIT License +# 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 +# THE AUTHORS OR COPYRIGHT HOLDERS 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 core library + +# This makefile can moved all objects files in MESA_OBJ for use with +# ld in windShell or create a library from objects files in their +# associated .c folder. +# +# For an easy inclusion of lib$(CPU)$(TOOL)GL.a in vxworks image, this +# makefile collects together all .o in an only file +# (obj$(CPU)$(TOOL)GL.o). This operation is unnecessary for +# lib$(CPU)$(TOOL)OSMesa.a and lib$(CPU)$(TOOL)UglMesa.a because they +# already contain only one file. +# +##### MACROS ##### +MESA_MAJOR=3 +MESA_MINOR=5 +MESA_TINY=0 +VERSION=$(MESA_MAJOR).$(MESA_MINOR) + +GL_MAJOR = 1 +GL_MINOR = 2 +GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) + +##### RULES ##### + +include ..\rules.windml + +#### GL ##### + +GL_SOURCES = \ + api_arrayelt.c \ + api_loopback.c \ + api_noop.c \ + api_validate.c \ + accum.c \ + attrib.c \ + blend.c \ + buffers.c \ + clip.c \ + colortab.c \ + config.c \ + context.c \ + convolve.c \ + debug.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 \ + glthread.c \ + hash.c \ + hint.c \ + histogram.c \ + image.c \ + imports.c \ + light.c \ + lines.c \ + matrix.c \ + mem.c \ + mmath.c \ + pixel.c \ + points.c \ + polygon.c \ + rastpos.c \ + state.c \ + stencil.c \ + texformat.c \ + teximage.c \ + texobj.c \ + texstate.c \ + texstore.c \ + texutil.c \ + varray.c \ + vtxfmt.c \ + X86/x86.c \ + X86/common_x86.c \ + X86/3dnow.c \ + X86/sse.c \ + math/m_debug_clip.c \ + math/m_debug_norm.c \ + math/m_debug_vertex.c \ + math/m_debug_xform.c \ + math/m_eval.c \ + math/m_matrix.c \ + math/m_translate.c \ + math/m_vector.c \ + math/m_vertices.c \ + math/m_xform.c \ + array_cache/ac_context.c \ + array_cache/ac_import.c \ + swrast/s_aaline.c \ + swrast/s_aatriangle.c \ + swrast/s_accum.c \ + swrast/s_alpha.c \ + swrast/s_alphabuf.c \ + swrast/s_bitmap.c \ + swrast/s_blend.c \ + swrast/s_buffers.c \ + swrast/s_copypix.c \ + swrast/s_context.c \ + swrast/s_depth.c \ + swrast/s_drawpix.c \ + swrast/s_feedback.c \ + swrast/s_fog.c \ + swrast/s_histogram.c \ + swrast/s_imaging.c \ + swrast/s_lines.c \ + swrast/s_logic.c \ + swrast/s_masking.c \ + swrast/s_pb.c \ + swrast/s_pixeltex.c \ + swrast/s_points.c \ + swrast/s_readpix.c \ + swrast/s_scissor.c \ + swrast/s_span.c \ + swrast/s_stencil.c \ + swrast/s_texture.c \ + swrast/s_texstore.c \ + swrast/s_triangle.c \ + swrast/s_zoom.c \ + swrast_setup/ss_context.c \ + swrast_setup/ss_triangle.c \ + swrast_setup/ss_vb.c \ + tnl/t_array_api.c \ + tnl/t_array_import.c \ + tnl/t_context.c \ + tnl/t_eval_api.c \ + tnl/t_imm_alloc.c \ + tnl/t_imm_api.c \ + tnl/t_imm_debug.c \ + tnl/t_imm_dlist.c \ + tnl/t_imm_elt.c \ + tnl/t_imm_eval.c \ + tnl/t_imm_exec.c \ + tnl/t_imm_fixup.c \ + tnl/t_pipeline.c \ + tnl/t_vb_fog.c \ + tnl/t_vb_light.c \ + tnl/t_vb_normals.c \ + tnl/t_vb_points.c \ + tnl/t_vb_render.c \ + tnl/t_vb_texgen.c \ + tnl/t_vb_texmat.c \ + tnl/t_vb_vertex.c + +GL_OBJECTS = $(GL_SOURCES:.c=.o) +GL_OBJNAME = $(MESA_LIBDIR)/objMesaGL.o + +#### X86 ##### + +x86_files = \ + X86/common_x86_asm.S \ + X86/glapi_x86.S \ + X86/x86_cliptest.S \ + X86/x86_vertex.S \ + X86/x86_xform2.S \ + X86/x86_xform3.S \ + X86/x86_xform4.S \ + +x3dnow_files = \ + X86/3dnow_normal.S \ + X86/3dnow_vertex.S \ + X86/3dnow_xform1.S \ + X86/3dnow_xform2.S \ + X86/3dnow_xform3.S \ + X86/3dnow_xform4.S + +sse_files = \ + X86/sse_normal.S \ + X86/sse_vertex.S \ + X86/sse_xform1.S \ + X86/sse_xform2.S \ + X86/sse_xform3.S \ + X86/sse_xform4.S + +mmx_files = X86/mmx_blend.S + +X86_OBJNAME = $(MESA_LIBDIR)/objMesaX86.o + +##### UGL ##### + +UGL_SOURCES = \ + windml/ugl_api.c \ + windml/ugl_dd.c \ + windml/ugl_span.c \ + windml/ugl_line.c \ + windml/ugl_tri.c \ + windml/tornado/torMesaUGLInit.c + +UGL_OBJECTS = $(UGL_SOURCES:.c=.o) +UGL_OBJNAME = $(MESA_LIBDIR)/objMesaUGL.o + +##### OS ##### + +OS_SOURCES = OSmesa/osmesa.c windml/tornado/torMesaOSInit.c +OS_OBJECTS = $(OS_SOURCES:.c=.o) +OS_OBJNAME = $(MESA_LIBDIR)/objMesaOS.o + +##### GLUTSHAPES ##### + +GLUTSHAPES_SOURCES = \ + windml/ugl_glutshapes.c \ + windml/tornado/torGLUTShapesInit.c + +GLUTSHAPES_OBJECTS = $(GLUTSHAPES_SOURCES:.c=.o) +GLUTSHAPES_OBJNAME = $(MESA_LIBDIR)/objGLUTShapes.o + +SOURCES = $(GL_SOURCES) $(UGL_SOURCES) $(OS_SOURCES) \ + $(GLUTSHAPES_SOURCES) + +##### TARGETS ##### + +all: depend.$(CPU)$(TOOL) cfgX86 $(X86_OBJNAME) $(GL_OBJNAME)\ +$(UGL_OBJNAME) $(OS_OBJNAME) $(GLUTSHAPES_OBJNAME) + +#histogram.o: +# $(CC) $(CFLAGS) -O1 $(OPTION_OBJECT_ONLY) $(OPTION_OBJECT_NAME)$@ $< + +#image.o: +# $(CC) $(CFLAGS) -O1 $(OPTION_OBJECT_ONLY) $(OPTION_OBJECT_NAME)$@ $< + +cfgX86: +ifdef HAVE_3DNOW +x3dnow_sources = $(x3dnow_files) +CFLAGS_3DNOW = -DUSE_3DNOW_ASM +HAVE_X86 = 1 +endif +ifdef HAVE_SSE +sse_sources = $(sse_files) +CFLAGS_SSE = -DUSE_SSE_ASM +HAVE_X86 = 1 +endif +ifdef HAVE_MMX +mmx_sources = $(mmx_files) +CFLAGS_MMX = -DUSE_MMX_ASM +HAVE_X86 = 1 +endif +ifdef HAVE_X86 +x86_sources = $(x86_files) +CFLAGS_X86 = -DUSE_X86_ASM +endif +X86_SOURCES = $(x86_sources) $(mmx_sources) \ + $(x3dnow_sources) $(sse_sources) +X86_OBJECTS = $(X86_SOURCES:.S=.o) +CFLAGS_USE_X86 = $(CFLAGS_3DNOW) $(CFLAGS_SSE) $(CFLAGS_MMX) $(CFLAGS_X86) + +#X86/matypes.h: mtypes.h tnl/t_context.h X86/gen_matypes.c +# $(CC) -I ./ X86/gen_matypes.c -o X86/gen_matypes +# ./X86/gen_matypes > X86/matypes.h +# $(RM) X86/gen_matypes +# $(RM) X86/gen_matypes.o + +# Make the Mesax86 library +$(X86_OBJNAME): $(X86_OBJECTS) +ifdef HAVE_X86 +# $(LD) -r $(X86_OBJECTS) -o $(MESA_OBJNAME) + $(LD) -r $(X86_OBJECTS) -o $(X86_OBJNAME) +# $(AR) rus $(MESA_LIBNAME) $(X86_OBJNAME) +# $(RM) $(X86_OBJNAME) +endif + +# Make the GL library +$(GL_OBJNAME): $(GL_OBJECTS) +# $(LD) -r $(GL_OBJECTS) -o $(MESA_OBJNAME) + $(LD) -r $(GL_OBJECTS) -o $(GL_OBJNAME) +# $(AR) rus $(MESA_LIBNAME) $(GL_OBJNAME) +# $(AR) rus $(VX_LIBNAME) $(GL_OBJNAME) +# $(RM) $(GL_OBJNAME) + +# Make the UGLMesa library +$(UGL_OBJNAME): $(UGL_OBJECTS) +# $(LD) -r $(UGL_OBJECTS) -o $(MESA_OBJNAME) + $(LD) -r $(UGL_OBJECTS) -o $(UGL_OBJNAME) +# $(AR) rus $(MESA_LIBNAME) $(UGL_OBJNAME) +# $(AR) rus $(VX_LIBNAME) $(UGL_OBJNAME) +# $(RM) $(UGL_OBJNAME) + +# Make the OSMesa library +$(OS_OBJNAME): $(OS_OBJECTS) +# $(LD) -r $(OS_OBJECTS) -o $(MESA_OBJNAME) + $(LD) -r $(OS_OBJECTS) -o $(OS_OBJNAME) +# $(AR) rus $(MESA_LIBNAME) $(OS_OBJNAME) +# $(AR) rus $(VX_LIBNAME) $(OS_OBJNAME) +# $(RM) $(OS_OBJNAME) + +# Make the GLUT Shapes library +$(GLUTSHAPES_OBJNAME): $(GLUTSHAPES_OBJECTS) +# $(LD) -r $(GLUTSHAPES_OBJECTS) -o $(MESA_OBJNAME) + $(LD) -r $(GLUTSHAPES_OBJECTS) -o $(GLUTSHAPES_OBJNAME) +# $(AR) rus $(MESA_LIBNAME) $(GLUTSHAPES_OBJNAME) +# $(AR) rus $(VX_LIBNAME) $(GLUTSHAPES_OBJNAME) +# $(RM) $(GLUTSHAPES_OBJNAME) + +depend.$(CPU)$(TOOL): +ifeq ($(WIND_HOST_TYPE),x86-win32) + @ $(RM) $@ + @ $(ECHO) Creating depend.$(CPU)$(TOOL) +ifneq ($(SOURCES),) + @ for %f in ($(SOURCES)) do \ + $(CC) -MM $(CFLAGS) %f >>$@ +endif +else +Makefile + @ $(RM) $@ + @ $(ECHO) "Creating depend.$(CPU)$(TOOL)" +ifneq ($(SOURCES),) + @ for FILE in $(filter-out $(NODEPENDOBJS), $(SOURCES)); \ + do \ + $(CC) -MM $(CFLAGS) $$FILE \ + | $(TCL) $(BIN_DIR)/depend.tcl $(TGT_DIR) >>$@; \ + done +endif +endif + +.PHONY = clean + +clean: +# $(AR) d $(MESA_LIBNAME) $(GL_OBJNAME) +# $(AR) d $(MESA_LIBNAME) $(UGL_OBJNAME) +# $(AR) d $(MESA_LIBNAME) $(OS_OBJNAME) +# $(AR) d $(MESA_LIBNAME) $(GLUTSHAPES_OBJNAME) +# $(AR) d $(VX_LIBNAME) $(GL_OBJNAME) +# $(AR) d $(VX_LIBNAME) $(UGL_OBJNAME) +# $(AR) d $(VX_LIBNAME) $(OS_OBJNAME) +# $(AR) d $(VX_LIBNAME) $(GLUTSHAPES_OBJNAME) + $(RM) $(GL_OBJECTS) + $(RM) $(UGL_OBJECTS) + $(RM) $(OS_OBJECTS) + $(RM) $(GLUTSHAPES_OBJECTS) + $(RM) $(GL_OBJNAME) + $(RM) $(UGL_OBJNAME) + $(RM) $(OS_OBJNAME) + $(RM) $(GLUTSHAPES_OBJNAME) + $(RM) depend.$(CPU)$(TOOL) + +include depend.$(CPU)$(TOOL) + -- cgit v1.2.3 From a8b07a539b42b04111f48aa145bc3b2633fd5387 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 28 Aug 2001 22:49:32 +0000 Subject: added OpenGL 1.3 tokens and prototypes --- include/GL/gl.h | 344 +++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 268 insertions(+), 76 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 7ebee339cab..19a0c313b3c 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,10 +1,10 @@ -/* $Id: gl.h,v 1.57 2001/06/14 21:37:43 brianp Exp $ */ +/* $Id: gl.h,v 1.58 2001/08/28 22:49:32 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 3.5.1 * - * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -84,6 +84,7 @@ extern "C" { #define GL_VERSION_1_1 1 #define GL_VERSION_1_2 1 +/*#define GL_VERSION_1_3 1 not yet */ #define GL_ARB_imaging 1 @@ -637,7 +638,46 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_TEXTURE_GEN_R 0x0C62 #define GL_TEXTURE_GEN_Q 0x0C63 -/* GL 1.1 texturing */ +/* Utility */ +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 + +/* Errors */ +#define GL_NO_ERROR 0x0 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 + +/* glPush/PopAttrib bits */ +#define GL_CURRENT_BIT 0x00000001 +#define GL_POINT_BIT 0x00000002 +#define GL_LINE_BIT 0x00000004 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_HINT_BIT 0x00008000 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000FFFFF + + +/* OpenGL 1.1 */ #define GL_PROXY_TEXTURE_1D 0x8063 #define GL_PROXY_TEXTURE_2D 0x8064 #define GL_TEXTURE_PRIORITY 0x8066 @@ -645,20 +685,6 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_TEXTURE_BINDING_1D 0x8068 #define GL_TEXTURE_BINDING_2D 0x8069 #define GL_TEXTURE_INTERNAL_FORMAT 0x1003 - -/* GL 1.2 texturing */ -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_TEXTURE_BINDING_3D 0x806A - -/* Internal texture formats (GL 1.1) */ #define GL_ALPHA4 0x803B #define GL_ALPHA8 0x803C #define GL_ALPHA12 0x803D @@ -692,21 +718,10 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_RGB10_A2 0x8059 #define GL_RGBA12 0x805A #define GL_RGBA16 0x805B - -/* Utility */ -#define GL_VENDOR 0x1F00 -#define GL_RENDERER 0x1F01 -#define GL_VERSION 0x1F02 -#define GL_EXTENSIONS 0x1F03 - -/* Errors */ -#define GL_NO_ERROR 0x0 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_OPERATION 0x0502 -#define GL_STACK_OVERFLOW 0x0503 -#define GL_STACK_UNDERFLOW 0x0504 -#define GL_OUT_OF_MEMORY 0x0505 +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF +#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF /* OpenGL 1.2 */ @@ -741,7 +756,16 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 #define GL_ALIASED_POINT_SIZE_RANGE 0x846D #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E - +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_TEXTURE_BINDING_3D 0x806A /* @@ -822,38 +846,114 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_FUNC_ADD 0x8006 #define GL_FUNC_SUBTRACT 0x800A #define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_BLEND_COLOR 0x8005 - - -/* glPush/PopAttrib bits */ -#define GL_CURRENT_BIT 0x00000001 -#define GL_POINT_BIT 0x00000002 -#define GL_LINE_BIT 0x00000004 -#define GL_POLYGON_BIT 0x00000008 -#define GL_POLYGON_STIPPLE_BIT 0x00000010 -#define GL_PIXEL_MODE_BIT 0x00000020 -#define GL_LIGHTING_BIT 0x00000040 -#define GL_FOG_BIT 0x00000080 -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_ACCUM_BUFFER_BIT 0x00000200 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_VIEWPORT_BIT 0x00000800 -#define GL_TRANSFORM_BIT 0x00001000 -#define GL_ENABLE_BIT 0x00002000 -#define GL_COLOR_BUFFER_BIT 0x00004000 -#define GL_HINT_BIT 0x00008000 -#define GL_EVAL_BIT 0x00010000 -#define GL_LIST_BIT 0x00020000 -#define GL_TEXTURE_BIT 0x00040000 -#define GL_SCISSOR_BIT 0x00080000 -#define GL_ALL_ATTRIB_BITS 0x000FFFFF - - -#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 -#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 -#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF -#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF - +#define GL_BLEND_COLOR 0x8005 + + +/* OpenGL 1.3 */ +/* multitexture */ +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +/* texture_cube_map */ +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +/* texture_compression */ +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +/* multisample */ +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_MULTISAMPLE_BIT 0x20000000 +/* transpose_matrix */ +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +/* texture_env_combine */ +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +/* texture_env_dot3 */ +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +/* texture_border_clamp */ +#define GL_CLAMP_TO_BORDER 0x812D @@ -868,17 +968,13 @@ typedef double GLclampd; /* double precision float in [0,1] */ GLAPI void GLAPIENTRY glClearIndex( GLfloat c ); -GLAPI void GLAPIENTRY glClearColor( GLclampf red, - GLclampf green, - GLclampf blue, - GLclampf alpha ); +GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); GLAPI void GLAPIENTRY glClear( GLbitfield mask ); GLAPI void GLAPIENTRY glIndexMask( GLuint mask ); -GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, - GLboolean blue, GLboolean alpha ); +GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref ); @@ -908,8 +1004,7 @@ GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag ); GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag ); -GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, - GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height); GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation ); @@ -981,8 +1076,7 @@ GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val ); * Accumulation Buffer */ -GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, - GLfloat blue, GLfloat alpha ); +GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value ); @@ -1723,6 +1817,104 @@ GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, +/* 1.3 functions */ + +GLAPI void GLAPIENTRY glActiveTexture( GLenum texture ); + +GLAPI void GLAPIENTRY glClientActiveTexture( GLenum texture ); + +GLAPI void GLAPIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img ); + +GLAPI void GLAPIENTRY glMultiTexCoord1d( GLenum target, GLdouble s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord1f( GLenum target, GLfloat s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord1i( GLenum target, GLint s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord1s( GLenum target, GLshort s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v ); + + +GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] ); + +GLAPI void GLAPIENTRY glLoadTransposeMatrixf( const GLfloat m[16] ); + +GLAPI void GLAPIENTRY glMultTransposeMatrixd( const GLdouble m[16] ); + +GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] ); + +GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert ); + +GLAPI void GLAPIENTRY glSamplePass( GLenum pass ); + + /* * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1) */ -- cgit v1.2.3 From a0037ad8b38e25bdb16e64e4da6e5c75cc66a9cd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 28 Aug 2001 23:12:37 +0000 Subject: added OSMESA_MAX_WIDTH/HEIGHT queries --- docs/VERSIONS | 4 +++- include/GL/osmesa.h | 9 ++++++--- src/mesa/drivers/osmesa/osmesa.c | 8 +++++++- 3 files changed, 16 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/docs/VERSIONS b/docs/VERSIONS index 7befd67d37e..2b4ab627366 100644 --- a/docs/VERSIONS +++ b/docs/VERSIONS @@ -1,4 +1,4 @@ -$Id: VERSIONS,v 1.69 2001/08/28 22:53:44 brianp Exp $ +$Id: VERSIONS,v 1.70 2001/08/28 23:12:37 brianp Exp $ Mesa Version History @@ -875,6 +875,8 @@ Mesa Version History - GL_EXT_texture_edge_clamp extension (aka GL_SGIS_texture_edge_clamp) - WindML UGL driver (Stephane Raimbault) - initial support for OpenGL 1.3 + - added OSMESA_MAX_WIDTH/HEIGHT queries + - attempted compiliation fixes for Solaris 5, 7 and 8 Bug fixes: - added some missing GLX 1.3 tokens to include/GL/glx.h - GL_COLOR_MATRIX changes weren't recognized by teximage functions diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h index 0e4a10b2f8b..a002dcdacba 100644 --- a/include/GL/osmesa.h +++ b/include/GL/osmesa.h @@ -1,10 +1,10 @@ -/* $Id: osmesa.h,v 1.7 2001/06/27 13:56:17 brianp Exp $ */ +/* $Id: osmesa.h,v 1.8 2001/08/28 23:12:37 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 3.5.1 * - * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 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"), @@ -64,6 +64,7 @@ extern "C" { #define OSMESA_MAJOR_VERSION 3 #define OSMESA_MINOR_VERSION 5 +#define OSMESA_PATCH_VERSION 1 @@ -95,6 +96,8 @@ extern "C" { #define OSMESA_HEIGHT 0x21 #define OSMESA_FORMAT 0x22 #define OSMESA_TYPE 0x23 +#define OSMESA_MAX_WIDTH 0x24 /* new in 3.5.1 */ +#define OSMESA_MAX_HEIGHT 0x25 /* new in 3.5.1 */ typedef struct osmesa_context *OSMesaContext; diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 42de21641ac..1ca21486be6 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1,4 +1,4 @@ -/* $Id: osmesa.c,v 1.64 2001/08/28 22:46:22 brianp Exp $ */ +/* $Id: osmesa.c,v 1.65 2001/08/28 23:12:37 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -553,6 +553,12 @@ void GLAPIENTRY OSMesaGetIntegerv( GLint pname, GLint *value ) case OSMESA_Y_UP: *value = ctx->yup; return; + case OSMESA_MAX_WIDTH: + *value = MAX_WIDTH; + return; + case OSMESA_MAX_HEIGHT: + *value = MAX_HEIGHT; + return; default: _mesa_error(&ctx->gl_ctx, GL_INVALID_ENUM, "OSMesaGetIntergerv(pname)"); return; -- cgit v1.2.3 From 7e975ba3aa103df12c2069264e755b73e2fabf05 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 1 Sep 2001 20:17:16 +0000 Subject: added GLX_RGBA_TYPE, fixed GLX_LARGEST_PBUFFER typo --- include/GL/glx.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 1b5d78b806b..ee97844a512 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.29 2001/07/27 14:26:27 brianp Exp $ */ +/* $Id: glx.h,v 1.30 2001/09/01 20:17:16 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -125,7 +125,7 @@ extern "C" { #define GLX_MAX_PBUFFER_HEIGHT 0x8017 #define GLX_MAX_PBUFFER_PIXELS 0x8018 #define GLX_PRESERVED_CONTENTS 0x801B -#define GLX_LARGEST_BUFFER 0x801C +#define GLX_LARGEST_PBUFFER 0x801C #define GLX_WIDTH 0x801D #define GLX_HEIGHT 0x801E #define GLX_EVENT_MASK 0x801F @@ -155,6 +155,7 @@ extern "C" { #define GLX_GRAY_SCALE 0x8006 #define GLX_STATIC_GRAY 0x8007 #define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_RGBA_TYPE 0x8014 #define GLX_COLOR_INDEX_TYPE 0x8015 #define GLX_COLOR_INDEX_BIT 0x00000002 #define GLX_RGBA_BIT 0x00000001 -- cgit v1.2.3 From 306933046cdc70e20af7facea8bc8a975812787e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 10 Sep 2001 19:21:13 +0000 Subject: WindML updates (Stephane Raimbault) --- docs/README.WINDML | 14 +-- include/GL/uglmesa.h | 245 ++++++++------------------------------------- progs/images/wrs_logo.rgb | Bin 0 -> 37574 bytes progs/windml/uglaccum.c | 30 ++++-- progs/windml/uglalldemos.c | 156 +++++++++++++++++++++++------ progs/windml/uglbounce.c | 14 ++- progs/windml/uglcube.c | 12 ++- progs/windml/ugldrawpix.c | 21 ++-- progs/windml/uglflip.c | 15 ++- progs/windml/uglgears.c | 14 ++- progs/windml/uglicotorus.c | 14 ++- progs/windml/uglline.c | 12 ++- progs/windml/uglolympic.c | 11 +- progs/windml/uglpoint.c | 39 +++++--- progs/windml/uglstencil.c | 27 +++-- progs/windml/uglteapot.c | 13 ++- progs/windml/ugltexcube.c | 129 +++++------------------- progs/windml/ugltexcyl.c | 18 +++- 18 files changed, 361 insertions(+), 423 deletions(-) create mode 100644 progs/images/wrs_logo.rgb (limited to 'include') diff --git a/docs/README.WINDML b/docs/README.WINDML index a227d42b4db..e42d48dd3fc 100644 --- a/docs/README.WINDML +++ b/docs/README.WINDML @@ -12,6 +12,7 @@ gives better performance than double buffer software so if you can compile your WindML driver with this option, just do it. I/O redirection is adviced in target server. + Tested on --------- @@ -53,6 +54,9 @@ ld < c:\Tornado\target\lib\objMesaGLU.o ld < c:\Tornado\target\lib\objGLUTshapes.o ld < c:\Tornado\target\lib\objMesaOS.o +You can put the previous lines in a file and use: +< filename + 6. Download the application modules. 7. In WindShell, run: @@ -82,18 +86,16 @@ input driver), you must do the following to use the UGL/Mesa interface: 5. Before the UGL is destroyed, call MesaDestroyContext(). -6. Before exiting, call if required uglEventQDestroy and then uglDeinitialize(); +6. Before exiting, call if required uglEventQDestroy and then + uglDeinitialize(); Limitations ----------- I found the following limitations in my driver : - Color Indexed management is only in 8 bits - - The front and the back buffer must have the structure (mode and - size). A structure umc->buffer is requisite if the front and back - buffers are different. - - It isn't possible to mix UGL/OpenGL application with a software - double buffer (to fix) + - It's possible to mix UGL/OpenGL application with a software + double buffer Modifications ------------ diff --git a/include/GL/uglmesa.h b/include/GL/uglmesa.h index 44f8fc035ee..a70a0ae9129 100644 --- a/include/GL/uglmesa.h +++ b/include/GL/uglmesa.h @@ -48,92 +48,66 @@ extern "C" { * Values for display mode of uglMesaCreateContext () */ -#define UGL_MESA_SINGLE 0x00 -#define UGL_MESA_DOUBLE 0x01 -#define UGL_MESA_DOUBLE_SW 0x02 -#define UGL_MESA_DOUBLE_HW 0x03 +/* + * With these mask values, it's possible to test double buffer mode + * with UGL_MESA_DOUBLE mask + * + * SINGLE 0000 0001 + * DOUBLE 0000 0110 + * - SOFT 0000 0010 + * - HARD 0000 0100 + * WINDML 0001 0000 + * + * + */ +#define UGL_MESA_SINGLE 0x01 +#define UGL_MESA_DOUBLE 0x06 +#define UGL_MESA_DOUBLE_SOFTWARE 0x02 +#define UGL_MESA_DOUBLE_HARDWARE 0x04 +#define UGL_MESA_WINDML_EXCLUSIVE 0x10 + #define UGL_MESA_FULLSCREEN_WIDTH 0x0 #define UGL_MESA_FULLSCREEN_HEIGHT 0x0 -/* - * Pixel format - */ -#define UGL_MESA_ARGB8888 0x01 -#define UGL_MESA_RGB565 0x02 -#define UGL_MESA_RGB888 0x03 -#define UGL_MESA_ARGB4444 0x04 -#define UGL_MESA_CI 0x05 -#define UGL_MESA_DITHER_RGB 0x10 - /* * uglMesaPixelStore() parameters: */ -#define UGL_MESA_ROW_LENGTH 0x10 -#define UGL_MESA_Y_UP 0x11 +#define UGL_MESA_ROW_LENGTH 0x20 +#define UGL_MESA_Y_UP 0x21 /* * Accepted by uglMesaGetIntegerv: */ -#define UGL_MESA_LEFT_X 0x18 -#define UGL_MESA_TOP_Y 0x19 -#define UGL_MESA_WIDTH 0x20 -#define UGL_MESA_HEIGHT 0x21 -#define UGL_MESA_DISPLAY_WIDTH 0x22 -#define UGL_MESA_DISPLAY_HEIGHT 0x23 -#define UGL_MESA_COLOR_FORMAT 0x24 -#define UGL_MESA_COLOR_MODEL 0x25 -#define UGL_MESA_PIXEL_FORMAT 0x26 -#define UGL_MESA_TYPE 0x27 -#define UGL_MESA_RGB 0x28 -#define UGL_MESA_COLOR_INDEXED 0x29 - +#define UGL_MESA_LEFT_X 0x01 +#define UGL_MESA_TOP_Y 0x02 +#define UGL_MESA_WIDTH 0x03 +#define UGL_MESA_HEIGHT 0x04 +#define UGL_MESA_DISPLAY_WIDTH 0x05 +#define UGL_MESA_DISPLAY_HEIGHT 0x06 +#define UGL_MESA_COLOR_FORMAT 0x07 +#define UGL_MESA_COLOR_MODEL 0x08 +#define UGL_MESA_PIXEL_FORMAT 0x09 +#define UGL_MESA_TYPE 0x0A +#define UGL_MESA_RGB 0x0B +#define UGL_MESA_COLOR_INDEXED 0x0C +#define UGL_MESA_SINGLE_BUFFER 0x0D +#define UGL_MESA_DOUBLE_BUFFER 0x0E +#define UGL_MESA_DOUBLE_BUFFER_SOFTWARE 0x0F +#define UGL_MESA_DOUBLE_BUFFER_HARDWARE 0x10 + /* * typedefs */ typedef struct uglMesaContext * UGL_MESA_CONTEXT; -/* - * Create an Mesa/UGL rendering context. The attributes needed are - * double buffer flag and a context sharelist. - * - * It's necessary to first call this function before use uglMakeCurrentContext. - * This function provides neither stencil nor accumulation buffer only - * a depth buffer to reduce memory footprint. - * - * Input: db_mode - UGL_MESA_SINGLE = single buffer mode - * UGL_MESA_DOUBLE = double buffer mode (HW fallback -> SW) - * UGL_MESA_DOUBLE_SW = double buffer software - * UGL_MESA_DOUBLE_HW = double buffer hardware - * share_list - specifies another UGL_MESA_CONTEXT with which to share - * display lists. NULL indicates no sharing. - * - * Return: a UGL_MESA_CONTEXT, or zero if error - */ - -UGL_MESA_CONTEXT uglMesaCreateNewContext (GLenum db_mode, +UGL_MESA_CONTEXT uglMesaCreateNewContext (GLenum mode, UGL_MESA_CONTEXT share_list); -/* - * Create an UGL/Mesa rendering context and specify desired - * size of depth buffer, stencil buffer and accumulation buffer. - * If you specify zero for depth_bits, stencil_bits, - * accum_[red|gren|blue]_bits, you can save some memory. - * - * INPUT: db_mode - double buffer mode - * depth_bits - depth buffer size - * stencil_bits - stencil buffer size - * accum_red_bits - accumulation red buffer size - * accum_green_bits - accumulation green buffer size - * accum_blue_bits -accumulation blue buffer size - * accum_alpha_bits -accumulation alpha buffer size - * share_list - specifies another UGL_MESA_CONTEXT with which to share - * display lists. NULL indicates no sharing. - */ -UGL_MESA_CONTEXT uglMesaCreateNewContextExt (GLenum db_flag, +UGL_MESA_CONTEXT uglMesaCreateNewContextExt (GLenum mode, GLint depth_bits, GLint stencil_bits, GLint accum_red_bits, @@ -142,175 +116,34 @@ UGL_MESA_CONTEXT uglMesaCreateNewContextExt (GLenum db_flag, GLint accum_alpha_bits, UGL_MESA_CONTEXT share_list); -/* - * Bind an UGL_MESA_CONTEXT to an image buffer. The image buffer is - * just a block of memory which the client provides. Its size must be - * at least as large as width*height*sizeof(type). Its address should - * be a multiple of 4 if using RGBA mode. - * - * Image data is stored in the order of glDrawPixels: row-major order - * with the lower-left image pixel stored in the first array position - * (ie. bottom-to-top). - * - * Since the only type initially supported is GL_UNSIGNED_BYTE, if the - * context is in RGBA mode, each pixel will be stored as a 4-byte RGBA - * value. If the context is in color indexed mode, each pixel will be - * stored as a 1-byte value. - * - * If the context's viewport hasn't been initialized yet, it will now be - * initialized to (0, 0, width, height). - * - * Input: umc - a rendering context - * left, top - coordinates in pixels of (left,top) pixel - * (0,0) in fullscreen mode. - * width, height - size of image buffer in pixels, at least 1 - * else fullscreen dimensions are used (UGL_MESA_DISPLAY_WIDTH - * and UGL_MESA_DISPLAY_HEIGHT). - * - * Return: GL_TRUE if success, GL_FALSE if error because of invalid umc, - * width<1, height<1, width>internal limit or height>internal limit. - */ - GLboolean uglMesaMakeCurrentContext (UGL_MESA_CONTEXT umc, GLsizei left, GLsizei top, GLsizei width, GLsizei height); -/* - * Move an OpenGL window by a delta value - * - * Input: dx, dy - delta values in pixels - * - * Return: GL_TRUE if success, GL_FALSE if error because of invalid - * coordinates. - */ GLboolean uglMesaMoveWindow (GLsizei dx, GLsizei dy); -/* - * Move an OpenGL window to an absolute position - * - * Input: left, top - new coordinates in pixels - * - * Return: GL_TRUE if success, GL_FALSE if error because of invalid - * coordinates. - */ GLboolean uglMesaMoveToWindow (GLsizei left, GLsizei top); -/* - * Resize an OpenGL window by a delta value - * - * Input: dw, dh - delta values in pixels - * - * Return: GL_TRUE if success, GL_FALSE if error because of invalid - * coordinates. - */ GLboolean uglMesaResizeWindow (GLsizei dw, GLsizei dh); -/* - * Resize an OpenGL window to an absolute size - * - * Input: width, height - new dimensions in pixels - * - * Return: GL_TRUE if success, GL_FALSE if error because of invalid - * coordinates. - */ GLboolean uglMesaResizeToWindow (GLsizei width, GLsizei height); -/* - * Destroy the current UGL/Mesa rendering context - * - */ void uglMesaDestroyContext (void); -/* - * Return the current UGL/Mesa context - * - * Return: a UGL/Mesa context, or NULL if error - * - */ UGL_MESA_CONTEXT uglMesaGetCurrentContext (void); -/* - * Swap front and back buffers in double buffering mode. This - * function is a no-op if there's no back buffer. In case of software - * double buffering a copy occurs from off-screen buffer to front - * buffer. Works faster with an hardware support. - */ - void uglMesaSwapBuffers (void); -/* - * Set pixel store/packing parameters for the current context. This - * is similar to glPixelStore. UGL uses Y coordinates increase - * downward. - * - * Input: pname - UGL_MESA_ROW_LENGTH - * zero, same as image width (default). - * value specify actual pixels per row in image buffer - * UGL_MESA_Y_UP: - * zero = Y coordinates increase downward (default) - * non-zero = Y coordinates increase upward - * value - value for the parameter pname - */ - void uglMesaPixelStore (GLint pname, GLint value); -/* - * Return an integer value like glGetIntegerv. - * - * Input: pname - UGL_MESA_LEFT_X return the x axis value - * of the most left pixel - * UGL_MESA_TOP_Y return the y axis value - * of the topper pixel - * UGL_MESA_WIDTH return current image width - * UGL_MESA_HEIGHT return current image height - * UGL_MESA_COLOR_FORMAT return image color format - * UGL_MESA_COLOR_MODEL return image color model - * UGL_MESA_PIXEL_FORMAT return pixel format - * UGL_MESA_ROW_LENGTH return row length in pixels - * UGL_MESA_RGB return true if RGB - * UGL_MESA_COLOR_INDEXED return true if color indexed - * value - pointer to integer in which to return result. - */ void uglMesaGetIntegerv (GLint pname, GLint *value); -/* - * Return the depth buffer associated with an UGL/Mesa context. - * - * Output: width, height - size of buffer in pixels - * bytesPerValue - bytes per depth value (2 or 4) - * buffer - pointer to depth buffer values - * Return: GL_TRUE or GL_FALSE to indicate success or failure. - * - */ GLboolean uglMesaGetDepthBuffer (GLint *width, GLint *height, GLint *bytesPerValue, void **buffer); -/* - * Return the color buffer associated with an UGL/Mesa context. - * Input: c - the UGL/Mesa context - * Output: width, height - size of buffer in pixels - * format - buffer format (UGLMESA_FORMAT) - * buffer - pointer to color buffer values - * Return: GL_TRUE or GL_FALSE to indicate success or failure. - * - */ GLboolean uglMesaGetColorBuffer (GLint *width, GLint *height, GLint *format, void **buffer); -/* - * Color allocation in indexed mode. - * This function does nothing in RGB mode. - * - * Input: index - Value for the current color index - * red - Red component (between 0 and 1) - * green - Green component (between 0 and 1) - * blue - Blue component (between 0 and 1) - * - * Return: GL_TRUE if success, or GL_FALSE if index<0 or * clutSize #include #include +#include +#include +#include +#include -void windMLPoint (void); -void windMLLine (void); -void windMLFlip (void); -void windMLCube (void); -void windMLBounce (void); -void windMLGears (void); -void windMLIcoTorus (void); -void windMLOlympic (void); -void windMLTexCube (void); -void windMLTexCyl (void); -void windMLTeapot (void); -void windMLStencil (void); -void windMLDrawPix (void); -void windMLAccum (void); +#define BLACK 0 +#define RED 1 + +struct _colorStruct + { + UGL_RGB rgbColor; + UGL_COLOR uglColor; + } +colorTable[] = + { + { UGL_MAKE_RGB(0, 0, 0), 0}, + { UGL_MAKE_RGB(255, 0, 0), 0}, + }; + +void windMLPoint (UGL_BOOL windMLMode); +void windMLLine (UGL_BOOL windMLMode); +void windMLFlip (UGL_BOOL windMLMode); +void windMLCube (UGL_BOOL windMLMode); +void windMLBounce (UGL_BOOL windMLMode); +void windMLGears (UGL_BOOL windMLMode); +void windMLIcoTorus (UGL_BOOL windMLMode); +void windMLOlympic (UGL_BOOL windMLMode); +void windMLTexCube (UGL_BOOL windMLMode); +void windMLTexCyl (UGL_BOOL windMLMode); +void windMLTeapot (UGL_BOOL windMLMode); +void windMLStencil (UGL_BOOL windMLMode); +void windMLDrawPix (UGL_BOOL windMLMode); +void windMLAccum (UGL_BOOL windMLMode); void windMLAllDemos (void); void uglalldemos (void) @@ -65,34 +85,114 @@ void uglalldemos (void) void windMLAllDemos(void) { + UGL_BOOL windMLFlag = UGL_FALSE; + UGL_FB_INFO fbInfo; + UGL_EVENT event; + UGL_EVENT_SERVICE_ID eventServiceId; + UGL_EVENT_Q_ID qId; + UGL_INPUT_EVENT * pInputEvent; + UGL_INPUT_DEVICE_ID keyboardDevId; + UGL_DEVICE_ID devId; + UGL_GC_ID gc; + UGL_FONT_ID fontId; + UGL_FONT_DEF fontDef; + UGL_FONT_DRIVER_ID fontDrvId; + UGL_ORD textOrigin = UGL_FONT_TEXT_UPPER_LEFT; + int displayHeight, displayWidth; + int textWidth, textHeight; + static UGL_CHAR * message = + "Do you want to use WindML exclusively ? (y/n) "; + + uglInitialize(); + + uglDriverFind (UGL_DISPLAY_TYPE, 0, (UGL_UINT32 *)&devId); + uglDriverFind (UGL_KEYBOARD_TYPE, 0, (UGL_UINT32 *)&keyboardDevId); + uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); + qId = uglEventQCreate (eventServiceId, 100); + + gc = uglGcCreate(devId); + + uglDriverFind (UGL_FONT_ENGINE_TYPE, 0, (UGL_UINT32 *)&fontDrvId); + uglFontDriverInfo(fontDrvId, UGL_FONT_TEXT_ORIGIN, &textOrigin); + + uglFontFindString(fontDrvId, "familyName=Helvetica; pixelSize = 18", + &fontDef); - windMLPoint(); + if ((fontId = uglFontCreate(fontDrvId, &fontDef)) == UGL_NULL) + { + printf("Font not found. Exiting.\n"); + return; + } - windMLLine(); + uglInfo(devId, UGL_FB_INFO_REQ, &fbInfo); + displayWidth = fbInfo.width; + displayHeight = fbInfo.height; + + uglColorAlloc (devId, &colorTable[BLACK].rgbColor, UGL_NULL, + &colorTable[BLACK].uglColor, 1); + uglColorAlloc(devId, &colorTable[RED].rgbColor, UGL_NULL, + &colorTable[RED].uglColor, 1); + + uglBackgroundColorSet(gc, colorTable[BLACK].uglColor); + uglForegroundColorSet(gc, colorTable[RED].uglColor); + uglFontSet(gc, fontId); + uglTextSizeGet(fontId, &textWidth, &textHeight, -1, message); + uglTextDraw(gc, (displayWidth - textWidth) / 2, + (displayHeight - textHeight) / 2 - textHeight, -1, message); +/* flushQ(); + */ + if (uglEventGet (qId, &event, sizeof (event), UGL_WAIT_FOREVER) + != UGL_STATUS_Q_EMPTY) + { + pInputEvent = (UGL_INPUT_EVENT *)&event; + + if (pInputEvent->header.type == UGL_EVENT_TYPE_KEYBOARD && + pInputEvent->modifiers & UGL_KEYBOARD_KEYDOWN) + { + switch(pInputEvent->type.keyboard.key) + { + case 'Y': + case 'y': + windMLFlag = UGL_TRUE; + break; + default: + windMLFlag = UGL_FALSE; + } + } + } + + uglFontDestroy (fontId); + uglGcDestroy (gc); + uglEventQDestroy (eventServiceId, qId); + uglDeinitialize(); + + windMLPoint(windMLFlag); + + windMLLine(windMLFlag); - windMLFlip(); + windMLFlip(windMLFlag); - windMLCube(); + windMLCube(windMLFlag); - windMLBounce(); + windMLBounce(windMLFlag); - windMLGears(); + windMLGears(windMLFlag); - windMLIcoTorus(); + windMLIcoTorus(windMLFlag); - windMLOlympic(); + windMLOlympic(windMLFlag); - windMLTexCube(); + windMLTexCube(windMLFlag); - windMLTexCyl(); + windMLTexCyl(windMLFlag); - windMLTeapot(); + windMLTeapot(windMLFlag); - windMLStencil(); + windMLStencil(windMLFlag); - windMLDrawPix(); + windMLDrawPix(windMLFlag); - windMLAccum(); + windMLAccum(windMLFlag); return; } diff --git a/progs/windml/uglbounce.c b/progs/windml/uglbounce.c index bcabf449632..287015a4131 100644 --- a/progs/windml/uglbounce.c +++ b/progs/windml/uglbounce.c @@ -200,15 +200,15 @@ UGL_LOCAL int getEvent(void) return(retVal); } -void windMLBounce (void); +void windMLBounce (UGL_BOOL windMLMode); void uglbounce (void) { taskSpawn("tBounce", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLBounce, - 0,1,2,3,4,5,6,7,8,9); + UGL_FALSE,1,2,3,4,5,6,7,8,9); } -void windMLBounce(void) +void windMLBounce(UGL_BOOL windMLMode) { GLsizei width, height; UGL_INPUT_DEVICE_ID keyboardDevId; @@ -231,8 +231,12 @@ void windMLBounce(void) uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); qId = uglEventQCreate (eventServiceId, 100); - - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); + + if (windMLMode) + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE + | UGL_MESA_WINDML_EXCLUSIVE, NULL); + else + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); if (umc == NULL) { diff --git a/progs/windml/uglcube.c b/progs/windml/uglcube.c index 9080ba1fb98..e701d8db462 100644 --- a/progs/windml/uglcube.c +++ b/progs/windml/uglcube.c @@ -196,15 +196,15 @@ UGL_LOCAL int getEvent(void) return(retVal); } -void windMLCube (void); +void windMLCube (UGL_BOOL windMLMode); void uglcube (void) { taskSpawn("tCube", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLCube, - 0,1,2,3,4,5,6,7,8,9); + UGL_FALSE,1,2,3,4,5,6,7,8,9); } -void windMLCube (void) +void windMLCube (UGL_BOOL windMLMode) { GLsizei width, height; UGL_INPUT_DEVICE_ID keyboardDevId; @@ -226,7 +226,11 @@ void windMLCube (void) eventServiceId = UGL_NULL; } - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); + if (windMLMode) + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE + | UGL_MESA_WINDML_EXCLUSIVE, NULL); + else + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); /* Fullscreen */ diff --git a/progs/windml/ugldrawpix.c b/progs/windml/ugldrawpix.c index 678f423d2e3..b33be2c6aee 100644 --- a/progs/windml/ugldrawpix.c +++ b/progs/windml/ugldrawpix.c @@ -8,6 +8,9 @@ /* * $Log: ugldrawpix.c,v $ + * Revision 1.2 2001/09/10 19:21:13 brianp + * WindML updates (Stephane Raimbault) + * * Revision 1.1 2001/08/20 16:07:11 brianp * WindML driver (Stephane Raimbault) * @@ -79,7 +82,7 @@ #include "../util/readtex.h" -#define IMAGE_FILE "Mesa/images/girl.rgb" +#define IMAGE_FILE "Mesa/images/wrs_logo.rgb" UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; UGL_LOCAL UGL_EVENT_Q_ID qId; @@ -373,15 +376,15 @@ UGL_LOCAL void cleanUp (void) uglDeinitialize (); } -void windMLDrawPix (void); +void windMLDrawPix (UGL_BOOL windMLMode); void ugldrawpix (void) { taskSpawn ("tDrawPix", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLDrawPix, - 0,1,2,3,4,5,6,7,8,9); + UGL_FALSE,1,2,3,4,5,6,7,8,9); } -void windMLDrawPix (void) +void windMLDrawPix (UGL_BOOL windMLMode) { UGL_INPUT_DEVICE_ID keyboardDevId; GLuint ciMode; @@ -402,7 +405,12 @@ void windMLDrawPix (void) qId = uglEventQCreate (eventServiceId, 100); /* Double buffering */ - umc = uglMesaCreateNewContext (UGL_MESA_DOUBLE, NULL); + if (windMLMode) + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE + | UGL_MESA_WINDML_EXCLUSIVE, NULL); + else + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); + if (umc == NULL) { uglDeinitialize (); @@ -424,6 +432,7 @@ void windMLDrawPix (void) loopEvent(); cleanUp(); - + free(Image); + return; } diff --git a/progs/windml/uglflip.c b/progs/windml/uglflip.c index ffc6ece2db1..0ca068f417d 100644 --- a/progs/windml/uglflip.c +++ b/progs/windml/uglflip.c @@ -171,15 +171,15 @@ UGL_LOCAL void loopEvent(void) } } -void windMLFlip (void); +void windMLFlip (UGL_BOOL windMLMode); void uglflip (void) { - taskSpawn("tFlip", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLFlip, - 0,1,2,3,4,5,6,7,8,9); + taskSpawn ("tFlip", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLFlip, + UGL_FALSE,1,2,3,4,5,6,7,8,9); } -void windMLFlip(void) +void windMLFlip (UGL_BOOL windMLMode) { UGL_INPUT_DEVICE_ID keyboardDevId; @@ -192,13 +192,18 @@ void windMLFlip(void) qId = uglEventQCreate (eventServiceId, 100); - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE_SW, NULL); + if (windMLMode) + umc = uglMesaCreateNewContext(UGL_MESA_SINGLE + | UGL_MESA_WINDML_EXCLUSIVE, NULL); + else + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE_SOFTWARE, NULL); if (umc == NULL) { uglDeinitialize(); return; } + uglMesaMakeCurrentContext(umc, 0, 0, UGL_MESA_FULLSCREEN_WIDTH, UGL_MESA_FULLSCREEN_HEIGHT); diff --git a/progs/windml/uglgears.c b/progs/windml/uglgears.c index fe750a57d8d..468fe899806 100644 --- a/progs/windml/uglgears.c +++ b/progs/windml/uglgears.c @@ -219,6 +219,8 @@ UGL_LOCAL void drawGL (void) glPopMatrix (); + glFlush(); + uglMesaSwapBuffers (); #ifdef COUNT_FRAMES @@ -360,15 +362,15 @@ UGL_LOCAL void loopEvent(void) } } -void windMLGears (void); +void windMLGears (UGL_BOOL windMLMode); void uglgears (void) { taskSpawn ("tGears", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLGears, - 0,1,2,3,4,5,6,7,8,9); + UGL_FALSE,1,2,3,4,5,6,7,8,9); } -void windMLGears (void) +void windMLGears (UGL_BOOL windMLMode) { GLsizei width, height; UGL_INPUT_DEVICE_ID keyboardDevId; @@ -390,8 +392,12 @@ void windMLGears (void) qId = uglEventQCreate (eventServiceId, 100); /* Double buffering */ + if (windMLMode) + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE + | UGL_MESA_WINDML_EXCLUSIVE, NULL); + else + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); - umc = uglMesaCreateNewContext (UGL_MESA_DOUBLE, NULL); if (umc == NULL) { uglDeinitialize (); diff --git a/progs/windml/uglicotorus.c b/progs/windml/uglicotorus.c index 46226f1e82c..c09b6d1b520 100644 --- a/progs/windml/uglicotorus.c +++ b/progs/windml/uglicotorus.c @@ -246,15 +246,15 @@ UGL_LOCAL void loopEvent(void) } } -void windMLIcoTorus (void); +void windMLIcoTorus (UGL_BOOL windMLMode); void uglicotorus (void) { taskSpawn ("tIcoTorus", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLIcoTorus, - 0,1,2,3,4,5,6,7,8,9); + UGL_FALSE,1,2,3,4,5,6,7,8,9); } -void windMLIcoTorus (void) +void windMLIcoTorus (UGL_BOOL windMLMode) { GLsizei width, height; UGL_INPUT_DEVICE_ID keyboardDevId; @@ -279,8 +279,12 @@ void windMLIcoTorus (void) } /* Double buffering */ - umc = uglMesaCreateNewContext (UGL_MESA_DOUBLE, NULL); - + if (windMLMode) + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE + | UGL_MESA_WINDML_EXCLUSIVE, NULL); + else + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); + if (umc == NULL) { uglDeinitialize (); diff --git a/progs/windml/uglline.c b/progs/windml/uglline.c index fd100fff4b4..e58f071ea4b 100644 --- a/progs/windml/uglline.c +++ b/progs/windml/uglline.c @@ -213,16 +213,16 @@ UGL_LOCAL void loopEvent(void) } } -void windMLLine (void); +void windMLLine (UGL_BOOL windMLMode); void uglline (void) { taskSpawn("tLine", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLLine, - 0,1,2,3,4,5,6,7,8,9); + UGL_FALSE,1,2,3,4,5,6,7,8,9); } -void windMLLine(void) +void windMLLine(UGL_BOOL windMLMode) { UGL_INPUT_DEVICE_ID keyboardDevId; @@ -239,7 +239,11 @@ void windMLLine(void) /* Double buffer */ - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); + if (windMLMode) + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE + | UGL_MESA_WINDML_EXCLUSIVE, NULL); + else + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); if (umc == NULL) { diff --git a/progs/windml/uglolympic.c b/progs/windml/uglolympic.c index de7c278b1a7..282558dacbd 100644 --- a/progs/windml/uglolympic.c +++ b/progs/windml/uglolympic.c @@ -419,7 +419,7 @@ UGL_LOCAL void loopEvent(void) } } -void windMLOlympic (void); +void windMLOlympic (UGL_BOOL windMLMode); void uglolympic (void) { @@ -427,7 +427,7 @@ void uglolympic (void) 0,1,2,3,4,5,6,7,8,9); } -void windMLOlympic(void) +void windMLOlympic(UGL_BOOL windMLMode) { UGL_INPUT_DEVICE_ID keyboardDevId; @@ -444,8 +444,13 @@ void windMLOlympic(void) { eventServiceId = UGL_NULL; } + + if (windMLMode) + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE + | UGL_MESA_WINDML_EXCLUSIVE, NULL); + else + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); if (umc == NULL) { uglDeinitialize(); diff --git a/progs/windml/uglpoint.c b/progs/windml/uglpoint.c index e184eaa7550..49c432c3a41 100644 --- a/progs/windml/uglpoint.c +++ b/progs/windml/uglpoint.c @@ -127,12 +127,12 @@ UGL_LOCAL void drawGL (void) glRotatef(angleT, 1.0, -1.0, 0.0); angleT = angleT++ % 360; glBegin(GL_TRIANGLES); - (rgb) ? glColor3f(1.0, 0.0, 0.0): glIndexi(RED); - glVertex2f(0.75, 0.25); - (rgb) ? glColor3f(0.0, 1.0, 0.0): glIndexi(GREEN); - glVertex2f(0.75, 0.75); - (rgb) ? glColor3f(0.0, 0.0, 1.0): glIndexi(BLUE); - glVertex2f(0.25, 0.75); + (rgb) ? glColor3f(1.0, 0.0, 0.0): glIndexi(RED); + glVertex2f(0.75, 0.25); + (rgb) ? glColor3f(0.0, 1.0, 0.0): glIndexi(GREEN); + glVertex2f(0.75, 0.75); + (rgb) ? glColor3f(0.0, 0.0, 1.0): glIndexi(BLUE); + glVertex2f(0.25, 0.75); glEnd(); glPopMatrix(); @@ -140,8 +140,7 @@ UGL_LOCAL void drawGL (void) glFlush(); - if(DOUBLE_BUFFER) - uglMesaSwapBuffers(); + uglMesaSwapBuffers(); } /************************************************************************ @@ -175,15 +174,15 @@ UGL_LOCAL int getEvent(void) return(retVal); } -void windMLPoint (void); +void windMLPoint (UGL_BOOL windMLMode); void uglpoint (void) { - taskSpawn("tPoint", 210, VX_FP_TASK, 100000, - (FUNCPTR)windMLPoint, 0,1,2,3,4,5,6,7,8,9); + taskSpawn ("tPoint", 210, VX_FP_TASK, 100000, + (FUNCPTR)windMLPoint, UGL_FALSE,1,2,3,4,5,6,7,8,9); } -void windMLPoint(void) +void windMLPoint (UGL_BOOL windMLMode) { GLubyte pPixels[4]; GLsizei width, height; @@ -206,9 +205,21 @@ void windMLPoint(void) } if (DOUBLE_BUFFER) - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); + { + if (windMLMode) + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE + | UGL_MESA_WINDML_EXCLUSIVE, NULL); + else + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); + } else - umc = uglMesaCreateNewContext(UGL_MESA_SINGLE, NULL); + { + if (windMLMode) + umc = uglMesaCreateNewContext(UGL_MESA_SINGLE + | UGL_MESA_WINDML_EXCLUSIVE, NULL); + else + umc = uglMesaCreateNewContext(UGL_MESA_SINGLE, NULL); + } if (umc == NULL) { diff --git a/progs/windml/uglstencil.c b/progs/windml/uglstencil.c index 94e9f502596..07e8fc626f3 100644 --- a/progs/windml/uglstencil.c +++ b/progs/windml/uglstencil.c @@ -177,15 +177,15 @@ UGL_LOCAL int getEvent(void) return(retVal); } -void windMLStencil (void); +void windMLStencil (UGL_BOOL windMLMode); void uglstencil (void) { taskSpawn("tStencil", 210, VX_FP_TASK, 100000, - (FUNCPTR)windMLStencil, 0,1,2,3,4,5,6,7,8,9); + (FUNCPTR)windMLStencil,UGL_FALSE,1,2,3,4,5,6,7,8,9); } -void windMLStencil(void) +void windMLStencil(UGL_BOOL windMLMode) { UGL_INPUT_DEVICE_ID keyboardDevId; GLsizei width, height; @@ -197,12 +197,21 @@ void windMLStencil(void) uglDriverFind (UGL_EVENT_SERVICE_TYPE, 0, (UGL_UINT32 *)&eventServiceId); qId = uglEventQCreate (eventServiceId, 100); - - umc = uglMesaCreateNewContextExt(GL_FALSE, - 16, - 8, - 0,0,0,0, - NULL); + + if (windMLMode) + umc = uglMesaCreateNewContextExt(UGL_MESA_SINGLE + | UGL_MESA_WINDML_EXCLUSIVE, + 16, + 8, + 0,0,0,0, + NULL); + else + umc = uglMesaCreateNewContextExt(UGL_MESA_SINGLE, + 16, + 8, + 0,0,0,0, + NULL); + if (umc == NULL) { uglDeinitialize(); diff --git a/progs/windml/uglteapot.c b/progs/windml/uglteapot.c index 26c766d8346..651fe0990e1 100644 --- a/progs/windml/uglteapot.c +++ b/progs/windml/uglteapot.c @@ -222,15 +222,15 @@ UGL_LOCAL void loopEvent(void) } } -void windMLTeapot (void); +void windMLTeapot (UGL_BOOL windMLMode); void uglteapot (void) { taskSpawn ("tTeapot", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLTeapot, - 0,1,2,3,4,5,6,7,8,9); + UGL_FALSE,1,2,3,4,5,6,7,8,9); } -void windMLTeapot (void) +void windMLTeapot (UGL_BOOL windMLMode) { UGL_INPUT_DEVICE_ID keyboardDevId; GLsizei displayWidth, displayHeight; @@ -252,7 +252,12 @@ void windMLTeapot (void) qId = uglEventQCreate (eventServiceId, 100); /* Double buffering */ - umc = uglMesaCreateNewContext (UGL_MESA_DOUBLE, NULL); + if (windMLMode) + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE + | UGL_MESA_WINDML_EXCLUSIVE, NULL); + else + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); + if (umc == NULL) { uglDeinitialize (); diff --git a/progs/windml/ugltexcube.c b/progs/windml/ugltexcube.c index 1ce6666b65a..62b0306e647 100644 --- a/progs/windml/ugltexcube.c +++ b/progs/windml/ugltexcube.c @@ -47,7 +47,9 @@ Draw a textured cube #include #include -#define IMAGE_FILE "Mesa/windmldemos/wrs_logo.bmp" +#include "../util/readtex.h" + +#define IMAGE_FILE "Mesa/images/wrs_logo.rgb" UGL_LOCAL UGL_EVENT_SERVICE_ID eventServiceId; UGL_LOCAL UGL_EVENT_Q_ID qId; @@ -58,103 +60,13 @@ UGL_LOCAL GLuint texture[1]; UGL_LOCAL GLuint theTexCube; typedef struct { - unsigned long sizeX; - unsigned long sizeY; - char *data; - } TEX_IMAGE; + GLubyte *data; + int width, height; + GLenum format; + } TEX_IMAGE; UGL_LOCAL void cleanUp (void); -UGL_LOCAL GLboolean imageLoad(char *filename, TEX_IMAGE * texImage) - { - FILE * file = NULL; - unsigned long size; - unsigned long i; - unsigned short int planes; - unsigned short int bpp; - char temp; - - if ((file = fopen(filename, "rb")) == NULL) - { - printf("File Not Found : %s\n", filename); - return GL_FALSE; - } - - fseek(file, 18, SEEK_CUR); - - if ((i = fread(&texImage->sizeX, 4, 1, file)) != 1) - { - printf("Error reading width from %s.\n", filename); - return GL_FALSE; - } - - printf("Width of %s: %lu\n", filename, texImage->sizeX); - - if ((i = fread(&texImage->sizeY, 4, 1, file)) != 1) - { - printf("Error reading height from %s.\n", filename); - return GL_FALSE; - } - - printf("Height of %s: %lu\n", filename, texImage->sizeY); - size = texImage->sizeX * texImage->sizeY * 3; - - if ((fread(&planes, 2, 1, file)) != 1) - { - printf("Error reading planes from %s.\n", filename); - return GL_FALSE; - } - - if (planes != 1) - { - printf("Planes from %s is not 1: %u\n", filename, planes); - return GL_FALSE; - } - - if ((i = fread(&bpp, 2, 1, file)) != 1) - { - printf("Error reading bpp from %s.\n", filename); - return GL_FALSE; - } - - if (bpp != 24) - { - printf("Bpp from %s is not 24: %u\n", filename, bpp); - return GL_FALSE; - } - - fseek(file, 24, SEEK_CUR); - - texImage->data = (char *) malloc(size); - - if (texImage->data == NULL) - { - printf("Error allocating memory for color-corrected texImage data"); - return GL_FALSE; - } - - if ((i = fread(texImage->data, size, 1, file)) != 1) - { - printf("Error reading texImage data from %s.\n", filename); - free(texImage->data); - return GL_FALSE; - } - - /* bgr -> rgb */ - - for (i=0; idata[i]; - texImage->data[i] = texImage->data[i + 2]; - texImage->data[i + 2] = temp; - } - - fclose(file); - - return GL_TRUE; - } - - UGL_LOCAL void loadGLTexture() { TEX_IMAGE * texImage=NULL; @@ -167,10 +79,12 @@ UGL_LOCAL void loadGLTexture() cleanUp(); exit(1); } - - if (!imageLoad(IMAGE_FILE, texImage)) + + texImage->data = LoadRGBImage(IMAGE_FILE, &texImage->width, + &texImage->height, &texImage->format); + if (!texImage->data) { - printf("Error allocating space for image data"); + printf("Couldn't read %s\n", IMAGE_FILE); free(texImage); cleanUp(); exit(1); @@ -180,7 +94,7 @@ UGL_LOCAL void loadGLTexture() glGenTextures(1, &texture[0]); glBindTexture(GL_TEXTURE_2D, texture[0]); glTexImage2D(GL_TEXTURE_2D, 0, 3, - texImage->sizeX, texImage->sizeY, + texImage->width, texImage->height, 0, GL_RGB, GL_UNSIGNED_BYTE, texImage->data); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); @@ -330,7 +244,8 @@ UGL_LOCAL void initGL(int width, int height) glEnd(); /* done with the polygon */ glEndList(); - + + glDisable(GL_DITHER); glMatrixMode(GL_PROJECTION); /* Reset the projection matrix */ glLoadIdentity(); @@ -403,16 +318,16 @@ UGL_LOCAL void cleanUp (void) uglDeinitialize(); } -void windMLTexCube (void); +void windMLTexCube (UGL_BOOL windMLMode); void ugltexcube (void) { taskSpawn("tTexCube", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLTexCube, - 0,1,2,3,4,5,6,7,8,9); + UGL_FALSE,1,2,3,4,5,6,7,8,9); } -void windMLTexCube(void) +void windMLTexCube(UGL_BOOL windMLMode) { GLuint width, height; UGL_INPUT_DEVICE_ID keyboardDevId; @@ -430,8 +345,12 @@ void windMLTexCube(void) { eventServiceId = UGL_NULL; } - - umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); + + if (windMLMode) + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE + | UGL_MESA_WINDML_EXCLUSIVE, NULL); + else + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); if (umc == NULL) { diff --git a/progs/windml/ugltexcyl.c b/progs/windml/ugltexcyl.c index d83c20b2f38..d2fe687b926 100644 --- a/progs/windml/ugltexcyl.c +++ b/progs/windml/ugltexcyl.c @@ -8,6 +8,9 @@ /* * $Log: ugltexcyl.c,v $ + * Revision 1.2 2001/09/10 19:21:13 brianp + * WindML updates (Stephane Raimbault) + * * Revision 1.1 2001/08/20 16:07:11 brianp * WindML driver (Stephane Raimbault) * @@ -309,7 +312,7 @@ UGL_LOCAL void initGL(void) glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); glTranslatef( 0.0, 0.0, -70.0 ); - + printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); @@ -330,15 +333,15 @@ UGL_LOCAL void cleanUp (void) uglDeinitialize (); } -void windMLTexCyl (void); +void windMLTexCyl (UGL_BOOL windMLMode); void ugltexcyl (void) { taskSpawn ("tTexCyl", 210, VX_FP_TASK, 100000, (FUNCPTR)windMLTexCyl, - 0,1,2,3,4,5,6,7,8,9); + UGL_FALSE,1,2,3,4,5,6,7,8,9); } -void windMLTexCyl (void) +void windMLTexCyl (UGL_BOOL windMLMode) { UGL_INPUT_DEVICE_ID keyboardDevId; GLsizei displayWidth, displayHeight; @@ -365,7 +368,12 @@ void windMLTexCyl (void) qId = uglEventQCreate (eventServiceId, 100); /* Double buffering */ - umc = uglMesaCreateNewContext (UGL_MESA_DOUBLE, NULL); + if (windMLMode) + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE + | UGL_MESA_WINDML_EXCLUSIVE, NULL); + else + umc = uglMesaCreateNewContext(UGL_MESA_DOUBLE, NULL); + if (umc == NULL) { uglDeinitialize (); -- cgit v1.2.3 From ba57e5297d60eef37e43dd4d7f10d1e62f5e97ce Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 14 Sep 2001 02:43:03 +0000 Subject: more GL 1.3 and GLX 1.4 updates --- include/GL/glx.h | 14 +++++++++++++- src/mesa/Makefile.X11 | 6 +++--- src/mesa/drivers/x11/fakeglx.c | 8 ++++---- src/mesa/drivers/x11/glxapi.c | 12 +++++++++++- src/mesa/main/Makefile.X11 | 6 +++--- 5 files changed, 34 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index ee97844a512..9d0b60fceaa 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.30 2001/09/01 20:17:16 brianp Exp $ */ +/* $Id: glx.h,v 1.31 2001/09/14 02:43:04 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -60,6 +60,7 @@ extern "C" { #define GLX_VERSION_1_1 1 #define GLX_VERSION_1_2 1 #define GLX_VERSION_1_3 1 +#define GLX_VERSION_1_4 1 #define GLX_EXTENSION_NAME "GLX" @@ -169,6 +170,13 @@ extern "C" { #define GLX_PBUFFER_WIDTH 0x8041 +/* + * GLX 1.4 and later: + */ +#define GLX_SAMPLE_BUFFERS_SGIS 100000 +#define GLX_SAMPLES_SGIS 100001 + + typedef struct __GLXcontextRec *GLXContext; typedef XID GLXPixmap; @@ -286,6 +294,10 @@ extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable, unsigned long *mask ); +/* GLX 1.4 and later */ +extern void (*glXGetProcAddress(const GLubyte *procname))(); + + #ifndef GLX_GLXEXT_LEGACY diff --git a/src/mesa/Makefile.X11 b/src/mesa/Makefile.X11 index 28980575a53..b5cc095a532 100644 --- a/src/mesa/Makefile.X11 +++ b/src/mesa/Makefile.X11 @@ -1,7 +1,7 @@ -# $Id: Makefile.X11,v 1.56 2001/07/12 22:09:21 keithw Exp $ +# $Id: Makefile.X11,v 1.57 2001/09/14 02:43:03 brianp Exp $ # Mesa 3-D graphics library -# Version: 3.5 +# Version: 3.5.1 # Copyright (C) 1995-2001 Brian Paul # Makefile for core library @@ -10,7 +10,7 @@ ##### MACROS ##### GL_MAJOR = 1 -GL_MINOR = 2 +GL_MINOR = 3 GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) VPATH = RCS diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 78bc14880e9..7309fb8ad83 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1,4 +1,4 @@ -/* $Id: fakeglx.c,v 1.56 2001/09/01 20:23:25 brianp Exp $ */ +/* $Id: fakeglx.c,v 1.57 2001/09/14 02:43:04 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -57,13 +57,13 @@ /* This indicates the client-side GLX API and GLX encoder version. */ #define CLIENT_MAJOR_VERSION 1 -#define CLIENT_MINOR_VERSION 2 +#define CLIENT_MINOR_VERSION 2 /* don't have 1.3's pbuffers, etc yet */ /* This indicates the server-side GLX decoder version. - * GLX 1.3 indicates OpenGL 1.2 support + * GLX 1.4 indicates OpenGL 1.3 support */ #define SERVER_MAJOR_VERSION 1 -#define SERVER_MINOR_VERSION 3 +#define SERVER_MINOR_VERSION 4 /* This is appended onto the glXGetClient/ServerString version strings. */ #define MESA_GLX_VERSION "Mesa 3.5.1" diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index 53246f64f40..f0fd85333c1 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -1,4 +1,4 @@ -/* $Id: glxapi.c,v 1.27 2001/05/29 23:15:07 brianp Exp $ */ +/* $Id: glxapi.c,v 1.28 2001/09/14 02:43:03 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1253,6 +1253,9 @@ static struct name_address_pair GLX_functions[] = { { "glXQueryDrawable", (GLvoid *) glXQueryDrawable }, { "glXSelectEvent", (GLvoid *) glXSelectEvent }, + /*** GLX_VERSION_1_4 ***/ + { "glXGetProcAddress", (GLvoid *) glXGetProcAddress }, + /*** GLX_SGI_swap_control ***/ { "glXSwapIntervalSGI", (GLvoid *) glXSwapIntervalSGI }, @@ -1370,3 +1373,10 @@ void (*glXGetProcAddressARB(const GLubyte *procName))() f = (gl_function) _glapi_get_proc_address((const char *) procName); return f; } + + +/* GLX 1.4 */ +void (*glXGetProcAddress(const GLubyte *procName))() +{ + return glXGetProcAddressARB(procName); +} diff --git a/src/mesa/main/Makefile.X11 b/src/mesa/main/Makefile.X11 index 28980575a53..b5cc095a532 100644 --- a/src/mesa/main/Makefile.X11 +++ b/src/mesa/main/Makefile.X11 @@ -1,7 +1,7 @@ -# $Id: Makefile.X11,v 1.56 2001/07/12 22:09:21 keithw Exp $ +# $Id: Makefile.X11,v 1.57 2001/09/14 02:43:03 brianp Exp $ # Mesa 3-D graphics library -# Version: 3.5 +# Version: 3.5.1 # Copyright (C) 1995-2001 Brian Paul # Makefile for core library @@ -10,7 +10,7 @@ ##### MACROS ##### GL_MAJOR = 1 -GL_MINOR = 2 +GL_MINOR = 3 GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) VPATH = RCS -- cgit v1.2.3 From 04120f6cce0aa9e3604a64c740c25b99ca3999dc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 14 Sep 2001 22:19:18 +0000 Subject: Win32 updates (Karl Schultz) --- include/GL/glext.h | 6192 +++++++++++++++++----------------- include/GL/glu.h | 118 +- include/GL/glutf90.h | 162 +- progs/demos/Makefile.win | 86 + src/glu/sgi/Makefile.win | 156 + src/glu/sgi/glu.def | 46 + src/glu/sgi/libutil/project.c | 762 ++--- src/glut/glx/Makefile.win | 107 +- src/glut/glx/glut.def | 126 + src/glut/glx/win32_x11.h | 645 ++-- src/mesa/drivers/osmesa/Makefile.win | 37 + src/mesa/drivers/windows/wgl.c | 1290 +++---- src/mesa/drivers/windows/wmesa.c | 5926 ++++++++++++++++---------------- src/mesa/main/Makefile.win | 370 +- src/mesa/main/dispatch.c | 8 +- src/mesa/main/mesa.def | 878 ++--- 16 files changed, 8744 insertions(+), 8165 deletions(-) create mode 100644 progs/demos/Makefile.win create mode 100644 src/glu/sgi/Makefile.win create mode 100644 src/glu/sgi/glu.def create mode 100644 src/glut/glx/glut.def create mode 100644 src/mesa/drivers/osmesa/Makefile.win (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 66fad470f0e..76946953d65 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -1,3096 +1,3096 @@ -#ifndef __glext_h_ -#define __glext_h_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: This software was created using the -** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has -** not been independently verified as being compliant with the OpenGL(R) -** version 1.2.1 Specification. -*/ - -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) -#define WIN32_LEAN_AND_MEAN 1 -#include -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif - -/*************************************************************/ - -/* Header file version number, required by OpenGL ABI for Linux */ -#define GL_GLEXT_VERSION 7 - -#ifndef GL_VERSION_1_2 -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BLEND_COLOR 0x8005 -#define GL_FUNC_ADD 0x8006 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_BLEND_EQUATION 0x8009 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_RESCALE_NORMAL 0x803A -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#endif - -#ifndef GL_ARB_multitexture -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 -#endif - -#ifndef GL_ARB_transpose_matrix -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 -#endif - -#ifndef GL_ARB_multisample -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLES_ARB 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 -#endif - -#ifndef GL_ARB_texture_cube_map -#define GL_NORMAL_MAP_ARB 0x8511 -#define GL_REFLECTION_MAP_ARB 0x8512 -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C -#endif - -#ifndef GL_ARB_texture_compression -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -#endif - -#ifndef GL_ARB_vertex_blend -#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 -#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 -#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 -#define GL_VERTEX_BLEND_ARB 0x86A7 -#define GL_CURRENT_WEIGHT_ARB 0x86A8 -#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 -#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA -#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB -#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC -#define GL_WEIGHT_ARRAY_ARB 0x86AD -#define GL_MODELVIEW0_ARB 0x1700 -#define GL_MODELVIEW1_ARB 0x850A -#define GL_MODELVIEW2_ARB 0x8722 -#define GL_MODELVIEW3_ARB 0x8723 -#define GL_MODELVIEW4_ARB 0x8724 -#define GL_MODELVIEW5_ARB 0x8725 -#define GL_MODELVIEW6_ARB 0x8726 -#define GL_MODELVIEW7_ARB 0x8727 -#define GL_MODELVIEW8_ARB 0x8728 -#define GL_MODELVIEW9_ARB 0x8729 -#define GL_MODELVIEW10_ARB 0x872A -#define GL_MODELVIEW11_ARB 0x872B -#define GL_MODELVIEW12_ARB 0x872C -#define GL_MODELVIEW13_ARB 0x872D -#define GL_MODELVIEW14_ARB 0x872E -#define GL_MODELVIEW15_ARB 0x872F -#define GL_MODELVIEW16_ARB 0x8730 -#define GL_MODELVIEW17_ARB 0x8731 -#define GL_MODELVIEW18_ARB 0x8732 -#define GL_MODELVIEW19_ARB 0x8733 -#define GL_MODELVIEW20_ARB 0x8734 -#define GL_MODELVIEW21_ARB 0x8735 -#define GL_MODELVIEW22_ARB 0x8736 -#define GL_MODELVIEW23_ARB 0x8737 -#define GL_MODELVIEW24_ARB 0x8738 -#define GL_MODELVIEW25_ARB 0x8739 -#define GL_MODELVIEW26_ARB 0x873A -#define GL_MODELVIEW27_ARB 0x873B -#define GL_MODELVIEW28_ARB 0x873C -#define GL_MODELVIEW29_ARB 0x873D -#define GL_MODELVIEW30_ARB 0x873E -#define GL_MODELVIEW31_ARB 0x873F -#endif - -#ifndef GL_ARB_texture_env_combine -#define GL_COMBINE_ARB 0x8570 -#define GL_COMBINE_RGB_ARB 0x8571 -#define GL_COMBINE_ALPHA_ARB 0x8572 -#define GL_SOURCE0_RGB_ARB 0x8580 -#define GL_SOURCE1_RGB_ARB 0x8581 -#define GL_SOURCE2_RGB_ARB 0x8582 -#define GL_SOURCE0_ALPHA_ARB 0x8588 -#define GL_SOURCE1_ALPHA_ARB 0x8589 -#define GL_SOURCE2_ALPHA_ARB 0x858A -#define GL_OPERAND0_RGB_ARB 0x8590 -#define GL_OPERAND1_RGB_ARB 0x8591 -#define GL_OPERAND2_RGB_ARB 0x8592 -#define GL_OPERAND0_ALPHA_ARB 0x8598 -#define GL_OPERAND1_ALPHA_ARB 0x8599 -#define GL_OPERAND2_ALPHA_ARB 0x859A -#define GL_RGB_SCALE_ARB 0x8573 -#define GL_ADD_SIGNED_ARB 0x8574 -#define GL_INTERPOLATE_ARB 0x8575 -#define GL_SUBTRACT_ARB 0x84E7 -#define GL_CONSTANT_ARB 0x8576 -#define GL_PRIMARY_COLOR_ARB 0x8577 -#define GL_PREVIOUS_ARB 0x8578 -#endif - -#ifndef GL_ARB_texture_env_dot3 -#define GL_DOT3_RGB_ARB 0x86AE -#define GL_DOT3_RGBA_ARB 0x86AF -#endif - -#ifndef GL_ARB_texture_border_clamp -#define GL_CLAMP_TO_BORDER_ARB 0x812D -#endif - -#ifndef GL_EXT_abgr -#define GL_ABGR_EXT 0x8000 -#endif - -#ifndef GL_EXT_blend_color -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_COLOR_EXT 0x8005 -#endif - -#ifndef GL_EXT_polygon_offset -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 -#endif - -#ifndef GL_EXT_texture -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 -#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 -#endif - -#ifndef GL_EXT_texture3D -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -#endif - -#ifndef GL_SGIS_texture_filter4 -#define GL_FILTER4_SGIS 0x8146 -#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 -#endif - -#ifndef GL_EXT_subtexture -#endif - -#ifndef GL_EXT_copy_texture -#endif - -#ifndef GL_EXT_histogram -#define GL_HISTOGRAM_EXT 0x8024 -#define GL_PROXY_HISTOGRAM_EXT 0x8025 -#define GL_HISTOGRAM_WIDTH_EXT 0x8026 -#define GL_HISTOGRAM_FORMAT_EXT 0x8027 -#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C -#define GL_HISTOGRAM_SINK_EXT 0x802D -#define GL_MINMAX_EXT 0x802E -#define GL_MINMAX_FORMAT_EXT 0x802F -#define GL_MINMAX_SINK_EXT 0x8030 -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -#endif - -#ifndef GL_EXT_convolution -#define GL_CONVOLUTION_1D_EXT 0x8010 -#define GL_CONVOLUTION_2D_EXT 0x8011 -#define GL_SEPARABLE_2D_EXT 0x8012 -#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 -#define GL_REDUCE_EXT 0x8016 -#define GL_CONVOLUTION_FORMAT_EXT 0x8017 -#define GL_CONVOLUTION_WIDTH_EXT 0x8018 -#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 -#endif - -#ifndef GL_SGI_color_matrix -#define GL_COLOR_MATRIX_SGI 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB -#endif - -#ifndef GL_SGI_color_table -#define GL_COLOR_TABLE_SGI 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 -#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 -#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 -#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF -#endif - -#ifndef GL_SGIS_pixel_texture -#define GL_PIXEL_TEXTURE_SGIS 0x8353 -#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 -#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 -#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 -#endif - -#ifndef GL_SGIX_pixel_texture -#define GL_PIXEL_TEX_GEN_SGIX 0x8139 -#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B -#endif - -#ifndef GL_SGIS_texture4D -#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 -#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 -#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 -#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 -#define GL_TEXTURE_4D_SGIS 0x8134 -#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 -#define GL_TEXTURE_4DSIZE_SGIS 0x8136 -#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 -#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 -#define GL_TEXTURE_4D_BINDING_SGIS 0x814F -#endif - -#ifndef GL_SGI_texture_color_table -#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC -#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD -#endif - -#ifndef GL_EXT_cmyka -#define GL_CMYK_EXT 0x800C -#define GL_CMYKA_EXT 0x800D -#define GL_PACK_CMYK_HINT_EXT 0x800E -#define GL_UNPACK_CMYK_HINT_EXT 0x800F -#endif - -#ifndef GL_EXT_texture_object -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A -#endif - -#ifndef GL_SGIS_detail_texture -#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 -#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 -#define GL_LINEAR_DETAIL_SGIS 0x8097 -#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 -#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 -#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A -#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B -#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C -#endif - -#ifndef GL_SGIS_sharpen_texture -#define GL_LINEAR_SHARPEN_SGIS 0x80AD -#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE -#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF -#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 -#endif - -#ifndef GL_EXT_packed_pixels -#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 -#endif - -#ifndef GL_SGIS_texture_lod -#define GL_TEXTURE_MIN_LOD_SGIS 0x813A -#define GL_TEXTURE_MAX_LOD_SGIS 0x813B -#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C -#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D -#endif - -#ifndef GL_SGIS_multisample -#define GL_MULTISAMPLE_SGIS 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F -#define GL_SAMPLE_MASK_SGIS 0x80A0 -#define GL_1PASS_SGIS 0x80A1 -#define GL_2PASS_0_SGIS 0x80A2 -#define GL_2PASS_1_SGIS 0x80A3 -#define GL_4PASS_0_SGIS 0x80A4 -#define GL_4PASS_1_SGIS 0x80A5 -#define GL_4PASS_2_SGIS 0x80A6 -#define GL_4PASS_3_SGIS 0x80A7 -#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 -#define GL_SAMPLES_SGIS 0x80A9 -#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA -#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB -#define GL_SAMPLE_PATTERN_SGIS 0x80AC -#endif - -#ifndef GL_EXT_rescale_normal -#define GL_RESCALE_NORMAL_EXT 0x803A -#endif - -#ifndef GL_EXT_vertex_array -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 -#endif - -#ifndef GL_EXT_misc_attribute -#endif - -#ifndef GL_SGIS_generate_mipmap -#define GL_GENERATE_MIPMAP_SGIS 0x8191 -#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 -#endif - -#ifndef GL_SGIX_clipmap -#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 -#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 -#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 -#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 -#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 -#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 -#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 -#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 -#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 -#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D -#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E -#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F -#endif - -#ifndef GL_SGIX_shadow -#define GL_TEXTURE_COMPARE_SGIX 0x819A -#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B -#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C -#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D -#endif - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_CLAMP_TO_EDGE_SGIS 0x812F -#endif - -#ifndef GL_SGIS_texture_border_clamp -#define GL_CLAMP_TO_BORDER_SGIS 0x812D -#endif - -#ifndef GL_EXT_blend_minmax -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_BLEND_EQUATION_EXT 0x8009 -#endif - -#ifndef GL_EXT_blend_subtract -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B -#endif - -#ifndef GL_EXT_blend_logic_op -#endif - -#ifndef GL_SGIX_interlace -#define GL_INTERLACE_SGIX 0x8094 -#endif - -#ifndef GL_SGIX_pixel_tiles -#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E -#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F -#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 -#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 -#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 -#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 -#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 -#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 -#endif - -#ifndef GL_SGIS_texture_select -#define GL_DUAL_ALPHA4_SGIS 0x8110 -#define GL_DUAL_ALPHA8_SGIS 0x8111 -#define GL_DUAL_ALPHA12_SGIS 0x8112 -#define GL_DUAL_ALPHA16_SGIS 0x8113 -#define GL_DUAL_LUMINANCE4_SGIS 0x8114 -#define GL_DUAL_LUMINANCE8_SGIS 0x8115 -#define GL_DUAL_LUMINANCE12_SGIS 0x8116 -#define GL_DUAL_LUMINANCE16_SGIS 0x8117 -#define GL_DUAL_INTENSITY4_SGIS 0x8118 -#define GL_DUAL_INTENSITY8_SGIS 0x8119 -#define GL_DUAL_INTENSITY12_SGIS 0x811A -#define GL_DUAL_INTENSITY16_SGIS 0x811B -#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C -#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D -#define GL_QUAD_ALPHA4_SGIS 0x811E -#define GL_QUAD_ALPHA8_SGIS 0x811F -#define GL_QUAD_LUMINANCE4_SGIS 0x8120 -#define GL_QUAD_LUMINANCE8_SGIS 0x8121 -#define GL_QUAD_INTENSITY4_SGIS 0x8122 -#define GL_QUAD_INTENSITY8_SGIS 0x8123 -#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 -#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 -#endif - -#ifndef GL_SGIX_sprite -#define GL_SPRITE_SGIX 0x8148 -#define GL_SPRITE_MODE_SGIX 0x8149 -#define GL_SPRITE_AXIS_SGIX 0x814A -#define GL_SPRITE_TRANSLATION_SGIX 0x814B -#define GL_SPRITE_AXIAL_SGIX 0x814C -#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D -#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E -#endif - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E -#endif - -#ifndef GL_SGIS_point_parameters -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MIN_SGIS 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_SIZE_MAX_SGIS 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 -#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 -#endif - -#ifndef GL_SGIX_instruments -#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 -#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 -#endif - -#ifndef GL_SGIX_texture_scale_bias -#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 -#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A -#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B -#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C -#endif - -#ifndef GL_SGIX_framezoom -#define GL_FRAMEZOOM_SGIX 0x818B -#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C -#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D -#endif - -#ifndef GL_SGIX_tag_sample_buffer -#endif - -#ifndef GL_FfdMaskSGIX -#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 -#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 -#endif - -#ifndef GL_SGIX_polynomial_ffd -#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 -#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 -#define GL_DEFORMATIONS_MASK_SGIX 0x8196 -#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 -#endif - -#ifndef GL_SGIX_reference_plane -#define GL_REFERENCE_PLANE_SGIX 0x817D -#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E -#endif - -#ifndef GL_SGIX_flush_raster -#endif - -#ifndef GL_SGIX_depth_texture -#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 -#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 -#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 -#endif - -#ifndef GL_SGIS_fog_function -#define GL_FOG_FUNC_SGIS 0x812A -#define GL_FOG_FUNC_POINTS_SGIS 0x812B -#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C -#endif - -#ifndef GL_SGIX_fog_offset -#define GL_FOG_OFFSET_SGIX 0x8198 -#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 -#endif - -#ifndef GL_HP_image_transform -#define GL_IMAGE_SCALE_X_HP 0x8155 -#define GL_IMAGE_SCALE_Y_HP 0x8156 -#define GL_IMAGE_TRANSLATE_X_HP 0x8157 -#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 -#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 -#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A -#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B -#define GL_IMAGE_MAG_FILTER_HP 0x815C -#define GL_IMAGE_MIN_FILTER_HP 0x815D -#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E -#define GL_CUBIC_HP 0x815F -#define GL_AVERAGE_HP 0x8160 -#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 -#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 -#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 -#endif - -#ifndef GL_HP_convolution_border_modes -#define GL_IGNORE_BORDER_HP 0x8150 -#define GL_CONSTANT_BORDER_HP 0x8151 -#define GL_REPLICATE_BORDER_HP 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 -#endif - -#ifndef GL_INGR_palette_buffer -#endif - -#ifndef GL_SGIX_texture_add_env -#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE -#endif - -#ifndef GL_EXT_color_subtable -#endif - -#ifndef GL_PGI_vertex_hints -#define GL_VERTEX_DATA_HINT_PGI 0x1A22A -#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B -#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C -#define GL_MAX_VERTEX_HINT_PGI 0x1A22D -#define GL_COLOR3_BIT_PGI 0x00010000 -#define GL_COLOR4_BIT_PGI 0x00020000 -#define GL_EDGEFLAG_BIT_PGI 0x00040000 -#define GL_INDEX_BIT_PGI 0x00080000 -#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 -#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 -#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 -#define GL_MAT_EMISSION_BIT_PGI 0x00800000 -#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 -#define GL_MAT_SHININESS_BIT_PGI 0x02000000 -#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 -#define GL_NORMAL_BIT_PGI 0x08000000 -#define GL_TEXCOORD1_BIT_PGI 0x10000000 -#define GL_TEXCOORD2_BIT_PGI 0x20000000 -#define GL_TEXCOORD3_BIT_PGI 0x40000000 -#define GL_TEXCOORD4_BIT_PGI 0x80000000 -#define GL_VERTEX23_BIT_PGI 0x00000004 -#define GL_VERTEX4_BIT_PGI 0x00000008 -#endif - -#ifndef GL_PGI_misc_hints -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 -#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD -#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 -#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C -#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E -#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F -#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 -#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 -#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 -#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 -#define GL_CLIP_NEAR_HINT_PGI 0x1A220 -#define GL_CLIP_FAR_HINT_PGI 0x1A221 -#define GL_WIDE_LINE_HINT_PGI 0x1A222 -#define GL_BACK_NORMALS_HINT_PGI 0x1A223 -#endif - -#ifndef GL_EXT_paletted_texture -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 -#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -#endif - -#ifndef GL_EXT_clip_volume_hint -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 -#endif - -#ifndef GL_SGIX_list_priority -#define GL_LIST_PRIORITY_SGIX 0x8182 -#endif - -#ifndef GL_SGIX_ir_instrument1 -#define GL_IR_INSTRUMENT1_SGIX 0x817F -#endif - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 -#endif - -#ifndef GL_SGIX_texture_lod_bias -#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E -#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F -#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 -#endif - -#ifndef GL_SGIX_shadow_ambient -#define GL_SHADOW_AMBIENT_SGIX 0x80BF -#endif - -#ifndef GL_EXT_index_texture -#endif - -#ifndef GL_EXT_index_material -#define GL_INDEX_MATERIAL_EXT 0x81B8 -#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 -#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA -#endif - -#ifndef GL_EXT_index_func -#define GL_INDEX_TEST_EXT 0x81B5 -#define GL_INDEX_TEST_FUNC_EXT 0x81B6 -#define GL_INDEX_TEST_REF_EXT 0x81B7 -#endif - -#ifndef GL_EXT_index_array_formats -#define GL_IUI_V2F_EXT 0x81AD -#define GL_IUI_V3F_EXT 0x81AE -#define GL_IUI_N3F_V2F_EXT 0x81AF -#define GL_IUI_N3F_V3F_EXT 0x81B0 -#define GL_T2F_IUI_V2F_EXT 0x81B1 -#define GL_T2F_IUI_V3F_EXT 0x81B2 -#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 -#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 -#endif - -#ifndef GL_EXT_compiled_vertex_array -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 -#endif - -#ifndef GL_EXT_cull_vertex -#define GL_CULL_VERTEX_EXT 0x81AA -#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB -#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC -#endif - -#ifndef GL_SGIX_ycrcb -#define GL_YCRCB_422_SGIX 0x81BB -#define GL_YCRCB_444_SGIX 0x81BC -#endif - -#ifndef GL_SGIX_fragment_lighting -#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 -#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 -#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 -#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 -#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 -#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 -#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 -#define GL_LIGHT_ENV_MODE_SGIX 0x8407 -#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 -#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 -#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A -#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B -#define GL_FRAGMENT_LIGHT0_SGIX 0x840C -#define GL_FRAGMENT_LIGHT1_SGIX 0x840D -#define GL_FRAGMENT_LIGHT2_SGIX 0x840E -#define GL_FRAGMENT_LIGHT3_SGIX 0x840F -#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 -#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 -#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 -#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 -#endif - -#ifndef GL_IBM_rasterpos_clip -#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 -#endif - -#ifndef GL_HP_texture_lighting -#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 -#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 -#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 -#endif - -#ifndef GL_EXT_draw_range_elements -#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 -#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 -#endif - -#ifndef GL_WIN_phong_shading -#define GL_PHONG_WIN 0x80EA -#define GL_PHONG_HINT_WIN 0x80EB -#endif - -#ifndef GL_WIN_specular_fog -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC -#endif - -#ifndef GL_EXT_light_texture -#define GL_FRAGMENT_MATERIAL_EXT 0x8349 -#define GL_FRAGMENT_NORMAL_EXT 0x834A -#define GL_FRAGMENT_COLOR_EXT 0x834C -#define GL_ATTENUATION_EXT 0x834D -#define GL_SHADOW_ATTENUATION_EXT 0x834E -#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F -#define GL_TEXTURE_LIGHT_EXT 0x8350 -#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 -#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 -/* reuse GL_FRAGMENT_DEPTH_EXT */ -#endif - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_ALPHA_MIN_SGIX 0x8320 -#define GL_ALPHA_MAX_SGIX 0x8321 -#endif - -#ifndef GL_EXT_bgra -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 -#endif - -#ifndef GL_SGIX_async -#define GL_ASYNC_MARKER_SGIX 0x8329 -#endif - -#ifndef GL_SGIX_async_pixel -#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C -#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D -#define GL_ASYNC_READ_PIXELS_SGIX 0x835E -#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F -#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 -#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 -#endif - -#ifndef GL_SGIX_async_histogram -#define GL_ASYNC_HISTOGRAM_SGIX 0x832C -#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D -#endif - -#ifndef GL_INTEL_texture_scissor -#endif - -#ifndef GL_INTEL_parallel_arrays -#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 -#endif - -#ifndef GL_HP_occlusion_test -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 -#endif - -#ifndef GL_EXT_pixel_transform -#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 -#define GL_PIXEL_MAG_FILTER_EXT 0x8331 -#define GL_PIXEL_MIN_FILTER_EXT 0x8332 -#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 -#define GL_CUBIC_EXT 0x8334 -#define GL_AVERAGE_EXT 0x8335 -#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 -#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 -#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 -#endif - -#ifndef GL_EXT_pixel_transform_color_table -#endif - -#ifndef GL_EXT_shared_texture_palette -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB -#endif - -#ifndef GL_EXT_separate_specular_color -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#endif - -#ifndef GL_EXT_secondary_color -#define GL_COLOR_SUM_EXT 0x8458 -#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D -#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E -#endif - -#ifndef GL_EXT_texture_perturb_normal -#define GL_PERTURB_EXT 0x85AE -#define GL_TEXTURE_NORMAL_EXT 0x85AF -#endif - -#ifndef GL_EXT_multi_draw_arrays -#endif - -#ifndef GL_EXT_fog_coord -#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 -#define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 -#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 -#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 -#endif - -#ifndef GL_REND_screen_coordinates -#define GL_SCREEN_COORDINATES_REND 0x8490 -#define GL_INVERTED_SCREEN_W_REND 0x8491 -#endif - -#ifndef GL_EXT_coordinate_frame -#define GL_TANGENT_ARRAY_EXT 0x8439 -#define GL_BINORMAL_ARRAY_EXT 0x843A -#define GL_CURRENT_TANGENT_EXT 0x843B -#define GL_CURRENT_BINORMAL_EXT 0x843C -#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E -#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F -#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 -#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 -#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 -#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 -#define GL_MAP1_TANGENT_EXT 0x8444 -#define GL_MAP2_TANGENT_EXT 0x8445 -#define GL_MAP1_BINORMAL_EXT 0x8446 -#define GL_MAP2_BINORMAL_EXT 0x8447 -#endif - -#ifndef GL_EXT_texture_env_combine -#define GL_COMBINE_EXT 0x8570 -#define GL_COMBINE_RGB_EXT 0x8571 -#define GL_COMBINE_ALPHA_EXT 0x8572 -#define GL_RGB_SCALE_EXT 0x8573 -#define GL_ADD_SIGNED_EXT 0x8574 -#define GL_INTERPOLATE_EXT 0x8575 -#define GL_CONSTANT_EXT 0x8576 -#define GL_PRIMARY_COLOR_EXT 0x8577 -#define GL_PREVIOUS_EXT 0x8578 -#define GL_SOURCE0_RGB_EXT 0x8580 -#define GL_SOURCE1_RGB_EXT 0x8581 -#define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE3_RGB_EXT 0x8583 -#define GL_SOURCE4_RGB_EXT 0x8584 -#define GL_SOURCE5_RGB_EXT 0x8585 -#define GL_SOURCE6_RGB_EXT 0x8586 -#define GL_SOURCE7_RGB_EXT 0x8587 -#define GL_SOURCE0_ALPHA_EXT 0x8588 -#define GL_SOURCE1_ALPHA_EXT 0x8589 -#define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_SOURCE3_ALPHA_EXT 0x858B -#define GL_SOURCE4_ALPHA_EXT 0x858C -#define GL_SOURCE5_ALPHA_EXT 0x858D -#define GL_SOURCE6_ALPHA_EXT 0x858E -#define GL_SOURCE7_ALPHA_EXT 0x858F -#define GL_OPERAND0_RGB_EXT 0x8590 -#define GL_OPERAND1_RGB_EXT 0x8591 -#define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND3_RGB_EXT 0x8593 -#define GL_OPERAND4_RGB_EXT 0x8594 -#define GL_OPERAND5_RGB_EXT 0x8595 -#define GL_OPERAND6_RGB_EXT 0x8596 -#define GL_OPERAND7_RGB_EXT 0x8597 -#define GL_OPERAND0_ALPHA_EXT 0x8598 -#define GL_OPERAND1_ALPHA_EXT 0x8599 -#define GL_OPERAND2_ALPHA_EXT 0x859A -#define GL_OPERAND3_ALPHA_EXT 0x859B -#define GL_OPERAND4_ALPHA_EXT 0x859C -#define GL_OPERAND5_ALPHA_EXT 0x859D -#define GL_OPERAND6_ALPHA_EXT 0x859E -#define GL_OPERAND7_ALPHA_EXT 0x859F -#endif - -#ifndef GL_APPLE_specular_vector -#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 -#endif - -#ifndef GL_APPLE_transform_hint -#define GL_TRANSFORM_HINT_APPLE 0x85B1 -#endif - -#ifndef GL_SGIX_fog_scale -#define GL_FOG_SCALE_SGIX 0x81FC -#define GL_FOG_SCALE_VALUE_SGIX 0x81FD -#endif - -#ifndef GL_SUNX_constant_data -#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 -#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 -#endif - -#ifndef GL_SUN_global_alpha -#define GL_GLOBAL_ALPHA_SUN 0x81D9 -#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA -#endif - -#ifndef GL_SUN_triangle_list -#define GL_RESTART_SUN 0x01 -#define GL_REPLACE_MIDDLE_SUN 0x02 -#define GL_REPLACE_OLDEST_SUN 0x03 -#define GL_TRIANGLE_LIST_SUN 0x81D7 -#define GL_REPLACEMENT_CODE_SUN 0x81D8 -#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 -#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 -#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 -#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 -#define GL_R1UI_V3F_SUN 0x85C4 -#define GL_R1UI_C4UB_V3F_SUN 0x85C5 -#define GL_R1UI_C3F_V3F_SUN 0x85C6 -#define GL_R1UI_N3F_V3F_SUN 0x85C7 -#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 -#define GL_R1UI_T2F_V3F_SUN 0x85C9 -#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA -#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB -#endif - -#ifndef GL_SUN_vertex -#endif - -#ifndef GL_EXT_blend_func_separate -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB -#endif - -#ifndef GL_INGR_color_clamp -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 -#endif - -#ifndef GL_INGR_interlace_read -#define GL_INTERLACE_READ_INGR 0x8568 -#endif - -#ifndef GL_EXT_stencil_wrap -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 -#endif - -#ifndef GL_EXT_422_pixels -#define GL_422_EXT 0x80CC -#define GL_422_REV_EXT 0x80CD -#define GL_422_AVERAGE_EXT 0x80CE -#define GL_422_REV_AVERAGE_EXT 0x80CF -#endif - -#ifndef GL_NV_texgen_reflection -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 -#endif - -#ifndef GL_EXT_texture_cube_map -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C -#endif - -#ifndef GL_SUN_convolution_border_modes -#define GL_WRAP_BORDER_SUN 0x81D4 -#endif - -#ifndef GL_EXT_texture_env_add -#endif - -#ifndef GL_EXT_texture_lod_bias -#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 -#endif - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif - -#ifndef GL_EXT_vertex_weighting -#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH -#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 -#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX -#define GL_MODELVIEW_MATRIX1_EXT 0x8506 -#define GL_VERTEX_WEIGHTING_EXT 0x8509 -#define GL_MODELVIEW0_EXT GL_MODELVIEW -#define GL_MODELVIEW1_EXT 0x850A -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F -#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 -#endif - -#ifndef GL_NV_light_max_exponent -#define GL_MAX_SHININESS_NV 0x8504 -#define GL_MAX_SPOT_EXPONENT_NV 0x8505 -#endif - -#ifndef GL_NV_vertex_array_range -#define GL_VERTEX_ARRAY_RANGE_NV 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E -#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 -#endif - -#ifndef GL_NV_register_combiners -#define GL_REGISTER_COMBINERS_NV 0x8522 -#define GL_VARIABLE_A_NV 0x8523 -#define GL_VARIABLE_B_NV 0x8524 -#define GL_VARIABLE_C_NV 0x8525 -#define GL_VARIABLE_D_NV 0x8526 -#define GL_VARIABLE_E_NV 0x8527 -#define GL_VARIABLE_F_NV 0x8528 -#define GL_VARIABLE_G_NV 0x8529 -#define GL_CONSTANT_COLOR0_NV 0x852A -#define GL_CONSTANT_COLOR1_NV 0x852B -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -#define GL_SPARE0_NV 0x852E -#define GL_SPARE1_NV 0x852F -#define GL_DISCARD_NV 0x8530 -#define GL_E_TIMES_F_NV 0x8531 -#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 -#define GL_UNSIGNED_IDENTITY_NV 0x8536 -#define GL_UNSIGNED_INVERT_NV 0x8537 -#define GL_EXPAND_NORMAL_NV 0x8538 -#define GL_EXPAND_NEGATE_NV 0x8539 -#define GL_HALF_BIAS_NORMAL_NV 0x853A -#define GL_HALF_BIAS_NEGATE_NV 0x853B -#define GL_SIGNED_IDENTITY_NV 0x853C -#define GL_SIGNED_NEGATE_NV 0x853D -#define GL_SCALE_BY_TWO_NV 0x853E -#define GL_SCALE_BY_FOUR_NV 0x853F -#define GL_SCALE_BY_ONE_HALF_NV 0x8540 -#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 -#define GL_COMBINER_INPUT_NV 0x8542 -#define GL_COMBINER_MAPPING_NV 0x8543 -#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 -#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 -#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 -#define GL_COMBINER_MUX_SUM_NV 0x8547 -#define GL_COMBINER_SCALE_NV 0x8548 -#define GL_COMBINER_BIAS_NV 0x8549 -#define GL_COMBINER_AB_OUTPUT_NV 0x854A -#define GL_COMBINER_CD_OUTPUT_NV 0x854B -#define GL_COMBINER_SUM_OUTPUT_NV 0x854C -#define GL_MAX_GENERAL_COMBINERS_NV 0x854D -#define GL_NUM_GENERAL_COMBINERS_NV 0x854E -#define GL_COLOR_SUM_CLAMP_NV 0x854F -#define GL_COMBINER0_NV 0x8550 -#define GL_COMBINER1_NV 0x8551 -#define GL_COMBINER2_NV 0x8552 -#define GL_COMBINER3_NV 0x8553 -#define GL_COMBINER4_NV 0x8554 -#define GL_COMBINER5_NV 0x8555 -#define GL_COMBINER6_NV 0x8556 -#define GL_COMBINER7_NV 0x8557 -/* reuse GL_TEXTURE0_ARB */ -/* reuse GL_TEXTURE1_ARB */ -/* reuse GL_ZERO */ -/* reuse GL_NONE */ -/* reuse GL_FOG */ -#endif - -#ifndef GL_NV_fog_distance -#define GL_FOG_DISTANCE_MODE_NV 0x855A -#define GL_EYE_RADIAL_NV 0x855B -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C -/* reuse GL_EYE_PLANE */ -#endif - -#ifndef GL_NV_texgen_emboss -#define GL_EMBOSS_LIGHT_NV 0x855D -#define GL_EMBOSS_CONSTANT_NV 0x855E -#define GL_EMBOSS_MAP_NV 0x855F -#endif - -#ifndef GL_NV_blend_square -#endif - -#ifndef GL_NV_texture_env_combine4 -#define GL_COMBINE4_NV 0x8503 -#define GL_SOURCE3_RGB_NV 0x8583 -#define GL_SOURCE3_ALPHA_NV 0x858B -#define GL_OPERAND3_RGB_NV 0x8593 -#define GL_OPERAND3_ALPHA_NV 0x859B -#endif - -#ifndef GL_MESA_resize_buffers -#endif - -#ifndef GL_MESA_window_pos -#endif - -#ifndef GL_EXT_texture_compression_s3tc -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#endif - -#ifndef GL_IBM_cull_vertex -#define GL_CULL_VERTEX_IBM 103050 -#endif - -#ifndef GL_IBM_multimode_draw_arrays -#endif - -#ifndef GL_IBM_vertex_array_lists -#define GL_VERTEX_ARRAY_LIST_IBM 103070 -#define GL_NORMAL_ARRAY_LIST_IBM 103071 -#define GL_COLOR_ARRAY_LIST_IBM 103072 -#define GL_INDEX_ARRAY_LIST_IBM 103073 -#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 -#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 -#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 -#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 -#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 -#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 -#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 -#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 -#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 -#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 -#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 -#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 -#endif - -#ifndef GL_SGIX_subsample -#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 -#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 -#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 -#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 -#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 -#endif - -#ifndef GL_SGIX_ycrcb_subsample -#endif - -#ifndef GL_SGIX_ycrcba -#define GL_YCRCB_SGIX 0x8318 -#define GL_YCRCBA_SGIX 0x8319 -#endif - -#ifndef GL_SGI_depth_pass_instrument -#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 -#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 -#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 -#endif - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 -#endif - -#ifndef GL_3DFX_multisample -#define GL_MULTISAMPLE_3DFX 0x86B2 -#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 -#define GL_SAMPLES_3DFX 0x86B4 -#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 -#endif - -#ifndef GL_3DFX_tbuffer -#endif - -#ifndef GL_EXT_multisample -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#define GL_SAMPLE_MASK_EXT 0x80A0 -#define GL_1PASS_EXT 0x80A1 -#define GL_2PASS_0_EXT 0x80A2 -#define GL_2PASS_1_EXT 0x80A3 -#define GL_4PASS_0_EXT 0x80A4 -#define GL_4PASS_1_EXT 0x80A5 -#define GL_4PASS_2_EXT 0x80A6 -#define GL_4PASS_3_EXT 0x80A7 -#define GL_SAMPLE_BUFFERS_EXT 0x80A8 -#define GL_SAMPLES_EXT 0x80A9 -#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA -#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB -#define GL_SAMPLE_PATTERN_EXT 0x80AC -#endif - -#ifndef GL_SGIX_vertex_preclip -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF -#endif - -#ifndef GL_SGIX_convolution_accuracy -#define GL_CONVOLUTION_HINT_SGIX 0x8316 -#endif - -#ifndef GL_SGIX_resample -#define GL_PACK_RESAMPLE_SGIX 0x842C -#define GL_UNPACK_RESAMPLE_SGIX 0x842D -#define GL_RESAMPLE_REPLICATE_SGIX 0x842E -#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F -#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 -#endif - -#ifndef GL_SGIS_point_line_texgen -#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 -#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 -#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 -#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 -#define GL_EYE_POINT_SGIS 0x81F4 -#define GL_OBJECT_POINT_SGIS 0x81F5 -#define GL_EYE_LINE_SGIS 0x81F6 -#define GL_OBJECT_LINE_SGIS 0x81F7 -#endif - -#ifndef GL_SGIS_texture_color_mask -#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF -#endif - -#ifndef GL_EXT_texture_env_dot3 -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 -#endif - - -/*************************************************************/ - -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); -extern void APIENTRY glBlendEquation (GLenum); -extern void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); -extern void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -extern void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); -extern void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); -extern void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); -extern void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); -extern void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); -extern void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); -extern void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -extern void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); -extern void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -extern void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -extern void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); -extern void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); -extern void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); -extern void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); -extern void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); -extern void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -extern void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); -extern void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); -extern void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); -extern void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -extern void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); -extern void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -extern void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); -extern void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); -extern void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -extern void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); -extern void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); -extern void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); -extern void APIENTRY glMinmax (GLenum, GLenum, GLboolean); -extern void APIENTRY glResetHistogram (GLenum); -extern void APIENTRY glResetMinmax (GLenum); -extern void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -extern void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -extern void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -typedef void (APIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); -typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (APIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); -typedef void (APIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); -typedef void (APIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif - -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glActiveTextureARB (GLenum); -extern void APIENTRY glClientActiveTextureARB (GLenum); -extern void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); -extern void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); -extern void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); -extern void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); -extern void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); -extern void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); -extern void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); -extern void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); -extern void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); -extern void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); -extern void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); -extern void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); -extern void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); -extern void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); -extern void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); -extern void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); -extern void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); -extern void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); -extern void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); -extern void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); -extern void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); -extern void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); -extern void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); -extern void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -extern void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); -extern void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); -extern void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); -extern void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); -extern void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); -extern void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); -#endif - -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); -extern void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); -extern void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); -extern void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -#endif - -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); -extern void APIENTRY glSamplePassARB (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRY * PFNGLSAMPLEPASSARBPROC) (GLenum pass); -#endif - -#ifndef GL_ARB_texture_env_add -#define GL_ARB_texture_env_add 1 -#endif - -#ifndef GL_ARB_texture_cube_map -#define GL_ARB_texture_cube_map 1 -#endif - -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -extern void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -extern void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -extern void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -extern void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -extern void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -extern void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, void *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img); -#endif - -#ifndef GL_ARB_texture_env_combine -#define GL_ARB_texture_env_combine 1 -#endif - -#ifndef GL_ARB_texture_env_dot3 -#define GL_ARB_texture_env_dot3 1 -#endif - -#ifndef GL_ARB_texture_border_clamp -#define GL_ARB_texture_border_clamp 1 -#endif - -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -#endif - -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); -#endif - -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 -#endif - -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -extern void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_SGIS_texture_filter4 -#define GL_SGIS_texture_filter4 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); -extern void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); -typedef void (APIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); -#endif - -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); -extern void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); -extern void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); -extern void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); -extern void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -extern void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif - -#ifndef GL_EXT_histogram -#define GL_EXT_histogram 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -extern void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); -extern void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); -extern void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -extern void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); -extern void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); -extern void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); -extern void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); -extern void APIENTRY glResetHistogramEXT (GLenum); -extern void APIENTRY glResetMinmaxEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); -typedef void (APIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); -#endif - -#ifndef GL_EXT_convolution -#define GL_EXT_convolution 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -extern void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -extern void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); -extern void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); -extern void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); -extern void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); -extern void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); -extern void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -extern void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); -extern void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); -extern void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); -extern void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -extern void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -#endif - -#ifndef GL_EXT_color_matrix -#define GL_EXT_color_matrix 1 -#endif - -#ifndef GL_SGI_color_table -#define GL_SGI_color_table 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -extern void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); -extern void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); -extern void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); -extern void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); -extern void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); -extern void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); -#endif - -#ifndef GL_SGIX_pixel_texture -#define GL_SGIX_pixel_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glPixelTexGenSGIX (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); -#endif - -#ifndef GL_SGIS_pixel_texture -#define GL_SGIS_pixel_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); -extern void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); -extern void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); -extern void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); -extern void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); -extern void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); -#endif - -#ifndef GL_SGIS_texture4D -#define GL_SGIS_texture4D 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -extern void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_SGI_texture_color_table -#define GL_SGI_texture_color_table 1 -#endif - -#ifndef GL_EXT_cmyka -#define GL_EXT_cmyka 1 -#endif - -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 -#ifdef GL_GLEXT_PROTOTYPES -extern GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); -extern void APIENTRY glBindTextureEXT (GLenum, GLuint); -extern void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); -extern void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); -extern GLboolean APIENTRY glIsTextureEXT (GLuint); -extern void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); -typedef void (APIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); -typedef void (APIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); -typedef void (APIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); -typedef GLboolean (APIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); -typedef void (APIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); -#endif - -#ifndef GL_SGIS_detail_texture -#define GL_SGIS_detail_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -extern void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#endif - -#ifndef GL_SGIS_sharpen_texture -#define GL_SGIS_sharpen_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -extern void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#endif - -#ifndef GL_EXT_packed_pixels -#define GL_EXT_packed_pixels 1 -#endif - -#ifndef GL_SGIS_texture_lod -#define GL_SGIS_texture_lod 1 -#endif - -#ifndef GL_SGIS_multisample -#define GL_SGIS_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); -extern void APIENTRY glSamplePatternSGIS (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); -#endif - -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 -#endif - -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glArrayElementEXT (GLint); -extern void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -extern void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); -extern void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); -extern void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); -extern void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -extern void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -extern void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -extern void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (APIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); -typedef void (APIENTRY * PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); -typedef void (APIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_misc_attribute -#define GL_EXT_misc_attribute 1 -#endif - -#ifndef GL_SGIS_generate_mipmap -#define GL_SGIS_generate_mipmap 1 -#endif - -#ifndef GL_SGIX_clipmap -#define GL_SGIX_clipmap 1 -#endif - -#ifndef GL_SGIX_shadow -#define GL_SGIX_shadow 1 -#endif - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 -#endif - -#ifndef GL_SGIS_texture_border_clamp -#define GL_SGIS_texture_border_clamp 1 -#endif - -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glBlendEquationEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 -#endif - -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 -#endif - -#ifndef GL_SGIX_interlace -#define GL_SGIX_interlace 1 -#endif - -#ifndef GL_SGIX_pixel_tiles -#define GL_SGIX_pixel_tiles 1 -#endif - -#ifndef GL_SGIX_texture_select -#define GL_SGIX_texture_select 1 -#endif - -#ifndef GL_SGIX_sprite -#define GL_SGIX_sprite 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); -extern void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); -extern void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); -extern void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); -#endif - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_SGIX_texture_multi_buffer 1 -#endif - -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glPointParameterfEXT (GLenum, GLfloat); -extern void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); -extern void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); -extern void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_SGIX_instruments -#define GL_SGIX_instruments 1 -#ifdef GL_GLEXT_PROTOTYPES -extern GLint APIENTRY glGetInstrumentsSGIX (void); -extern void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); -extern GLint APIENTRY glPollInstrumentsSGIX (GLint *); -extern void APIENTRY glReadInstrumentsSGIX (GLint); -extern void APIENTRY glStartInstrumentsSGIX (void); -extern void APIENTRY glStopInstrumentsSGIX (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLint (APIENTRY * PFNGLGETINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRY * PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); -typedef GLint (APIENTRY * PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); -typedef void (APIENTRY * PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); -typedef void (APIENTRY * PFNGLSTARTINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRY * PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); -#endif - -#ifndef GL_SGIX_texture_scale_bias -#define GL_SGIX_texture_scale_bias 1 -#endif - -#ifndef GL_SGIX_framezoom -#define GL_SGIX_framezoom 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glFrameZoomSGIX (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); -#endif - -#ifndef GL_SGIX_tag_sample_buffer -#define GL_SGIX_tag_sample_buffer 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glTagSampleBufferSGIX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); -#endif - -#ifndef GL_SGIX_polynomial_ffd -#define GL_SGIX_polynomial_ffd 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); -extern void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); -extern void APIENTRY glDeformSGIX (GLbitfield); -extern void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); -typedef void (APIENTRY * PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); -typedef void (APIENTRY * PFNGLDEFORMSGIXPROC) (GLbitfield mask); -typedef void (APIENTRY * PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); -#endif - -#ifndef GL_SGIX_reference_plane -#define GL_SGIX_reference_plane 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glReferencePlaneSGIX (const GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); -#endif - -#ifndef GL_SGIX_flush_raster -#define GL_SGIX_flush_raster 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glFlushRasterSGIX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); -#endif - -#ifndef GL_SGIX_depth_texture -#define GL_SGIX_depth_texture 1 -#endif - -#ifndef GL_SGIS_fog_function -#define GL_SGIS_fog_function 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); -extern void APIENTRY glGetFogFuncSGIS (const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); -typedef void (APIENTRY * PFNGLGETFOGFUNCSGISPROC) (const GLfloat *points); -#endif - -#ifndef GL_SGIX_fog_offset -#define GL_SGIX_fog_offset 1 -#endif - -#ifndef GL_HP_image_transform -#define GL_HP_image_transform 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); -extern void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); -extern void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); -extern void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); -extern void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); -extern void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_HP_convolution_border_modes -#define GL_HP_convolution_border_modes 1 -#endif - -#ifndef GL_SGIX_texture_add_env -#define GL_SGIX_texture_add_env 1 -#endif - -#ifndef GL_EXT_color_subtable -#define GL_EXT_color_subtable 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -extern void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -#endif - -#ifndef GL_PGI_vertex_hints -#define GL_PGI_vertex_hints 1 -#endif - -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glHintPGI (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLHINTPGIPROC) (GLenum target, GLint mode); -#endif - -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -extern void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); -extern void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); -extern void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 -#endif - -#ifndef GL_SGIX_list_priority -#define GL_SGIX_list_priority 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); -extern void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); -extern void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); -extern void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); -extern void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); -extern void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); -#endif - -#ifndef GL_SGIX_ir_instrument1 -#define GL_SGIX_ir_instrument1 1 -#endif - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_SGIX_calligraphic_fragment 1 -#endif - -#ifndef GL_SGIX_texture_lod_bias -#define GL_SGIX_texture_lod_bias 1 -#endif - -#ifndef GL_SGIX_shadow_ambient -#define GL_SGIX_shadow_ambient 1 -#endif - -#ifndef GL_EXT_index_texture -#define GL_EXT_index_texture 1 -#endif - -#ifndef GL_EXT_index_material -#define GL_EXT_index_material 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glIndexMaterialEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); -#endif - -#ifndef GL_EXT_index_func -#define GL_EXT_index_func 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glIndexFuncEXT (GLenum, GLclampf); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); -#endif - -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 -#endif - -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glLockArraysEXT (GLint, GLsizei); -extern void APIENTRY glUnlockArraysEXT (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); -typedef void (APIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); -#endif - -#ifndef GL_EXT_cull_vertex -#define GL_EXT_cull_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); -extern void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); -typedef void (APIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); -#endif - -#ifndef GL_SGIX_ycrcb -#define GL_SGIX_ycrcb 1 -#endif - -#ifndef GL_SGIX_fragment_lighting -#define GL_SGIX_fragment_lighting 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); -extern void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); -extern void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); -extern void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); -extern void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); -extern void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); -extern void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); -extern void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); -extern void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); -extern void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); -extern void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); -extern void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); -extern void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); -extern void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); -extern void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); -extern void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); -extern void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); -extern void APIENTRY glLightEnviSGIX (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); -#endif - -#ifndef GL_IBM_rasterpos_clip -#define GL_IBM_rasterpos_clip 1 -#endif - -#ifndef GL_HP_texture_lighting -#define GL_HP_texture_lighting 1 -#endif - -#ifndef GL_EXT_draw_range_elements -#define GL_EXT_draw_range_elements 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -#endif - -#ifndef GL_WIN_phong_shading -#define GL_WIN_phong_shading 1 -#endif - -#ifndef GL_WIN_specular_fog -#define GL_WIN_specular_fog 1 -#endif - -#ifndef GL_EXT_light_texture -#define GL_EXT_light_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glApplyTextureEXT (GLenum); -extern void APIENTRY glTextureLightEXT (GLenum); -extern void APIENTRY glTextureMaterialEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); -typedef void (APIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); -typedef void (APIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); -#endif - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_SGIX_blend_alpha_minmax 1 -#endif - -#ifndef GL_EXT_bgra -#define GL_EXT_bgra 1 -#endif - -#ifndef GL_SGIX_async -#define GL_SGIX_async 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glAsyncMarkerSGIX (GLuint); -extern GLint APIENTRY glFinishAsyncSGIX (GLuint *); -extern GLint APIENTRY glPollAsyncSGIX (GLuint *); -extern GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); -extern void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); -extern GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); -typedef GLint (APIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); -typedef GLint (APIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); -typedef GLuint (APIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); -typedef void (APIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); -typedef GLboolean (APIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); -#endif - -#ifndef GL_SGIX_async_pixel -#define GL_SGIX_async_pixel 1 -#endif - -#ifndef GL_SGIX_async_histogram -#define GL_SGIX_async_histogram 1 -#endif - -#ifndef GL_INTEL_parallel_arrays -#define GL_INTEL_parallel_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); -extern void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); -extern void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); -extern void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); -typedef void (APIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -#endif - -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 -#endif - -#ifndef GL_EXT_pixel_transform -#define GL_EXT_pixel_transform 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); -extern void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); -extern void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); -extern void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_EXT_pixel_transform_color_table -#define GL_EXT_pixel_transform_color_table 1 -#endif - -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 -#endif - -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 -#endif - -#ifndef GL_EXT_secondary_color -#define GL_EXT_secondary_color 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); -extern void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); -extern void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); -extern void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); -extern void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); -extern void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); -extern void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); -extern void APIENTRY glSecondaryColor3ivEXT (const GLint *); -extern void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); -extern void APIENTRY glSecondaryColor3svEXT (const GLshort *); -extern void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); -extern void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); -extern void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); -extern void APIENTRY glSecondaryColor3uivEXT (const GLuint *); -extern void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); -extern void APIENTRY glSecondaryColor3usvEXT (const GLushort *); -extern void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); -#endif - -#ifndef GL_EXT_texture_perturb_normal -#define GL_EXT_texture_perturb_normal 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glTextureNormalEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); -extern void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); -typedef void (APIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); -#endif - -#ifndef GL_EXT_fog_coord -#define GL_EXT_fog_coord 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glFogCoordfEXT (GLfloat); -extern void APIENTRY glFogCoordfvEXT (const GLfloat *); -extern void APIENTRY glFogCoorddEXT (GLdouble); -extern void APIENTRY glFogCoorddvEXT (const GLdouble *); -extern void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); -typedef void (APIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); -typedef void (APIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); -typedef void (APIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); -typedef void (APIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_REND_screen_coordinates -#define GL_REND_screen_coordinates 1 -#endif - -#ifndef GL_EXT_coordinate_frame -#define GL_EXT_coordinate_frame 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); -extern void APIENTRY glTangent3bvEXT (const GLbyte *); -extern void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); -extern void APIENTRY glTangent3dvEXT (const GLdouble *); -extern void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); -extern void APIENTRY glTangent3fvEXT (const GLfloat *); -extern void APIENTRY glTangent3iEXT (GLint, GLint, GLint); -extern void APIENTRY glTangent3ivEXT (const GLint *); -extern void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); -extern void APIENTRY glTangent3svEXT (const GLshort *); -extern void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); -extern void APIENTRY glBinormal3bvEXT (const GLbyte *); -extern void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); -extern void APIENTRY glBinormal3dvEXT (const GLdouble *); -extern void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); -extern void APIENTRY glBinormal3fvEXT (const GLfloat *); -extern void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); -extern void APIENTRY glBinormal3ivEXT (const GLint *); -extern void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); -extern void APIENTRY glBinormal3svEXT (const GLshort *); -extern void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); -extern void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); -typedef void (APIENTRY * PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRY * PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); -typedef void (APIENTRY * PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); -typedef void (APIENTRY * PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); -typedef void (APIENTRY * PFNGLTANGENT3IVEXTPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); -typedef void (APIENTRY * PFNGLTANGENT3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); -typedef void (APIENTRY * PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRY * PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); -typedef void (APIENTRY * PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); -typedef void (APIENTRY * PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); -typedef void (APIENTRY * PFNGLBINORMAL3IVEXTPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); -typedef void (APIENTRY * PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_texture_env_combine -#define GL_EXT_texture_env_combine 1 -#endif - -#ifndef GL_APPLE_specular_vector -#define GL_APPLE_specular_vector 1 -#endif - -#ifndef GL_APPLE_transform_hint -#define GL_APPLE_transform_hint 1 -#endif - -#ifndef GL_SGIX_fog_scale -#define GL_SGIX_fog_scale 1 -#endif - -#ifndef GL_SUNX_constant_data -#define GL_SUNX_constant_data 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glFinishTextureSUNX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); -#endif - -#ifndef GL_SUN_global_alpha -#define GL_SUN_global_alpha 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); -extern void APIENTRY glGlobalAlphaFactorsSUN (GLshort); -extern void APIENTRY glGlobalAlphaFactoriSUN (GLint); -extern void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); -extern void APIENTRY glGlobalAlphaFactordSUN (GLdouble); -extern void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); -extern void APIENTRY glGlobalAlphaFactorusSUN (GLushort); -extern void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); -#endif - -#ifndef GL_SUN_triangle_list -#define GL_SUN_triangle_list 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glReplacementCodeuiSUN (GLuint); -extern void APIENTRY glReplacementCodeusSUN (GLushort); -extern void APIENTRY glReplacementCodeubSUN (GLubyte); -extern void APIENTRY glReplacementCodeuivSUN (const GLuint *); -extern void APIENTRY glReplacementCodeusvSUN (const GLushort *); -extern void APIENTRY glReplacementCodeubvSUN (const GLubyte *); -extern void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); -#endif - -#ifndef GL_SUN_vertex -#define GL_SUN_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); -extern void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); -extern void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); -extern void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); -extern void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); -extern void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -extern void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); -extern void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); -extern void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); -extern void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -extern void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -extern void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -extern void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -extern void APIENTRY glReplacementCodeuiVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLenum *, const GLfloat *); -extern void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLenum, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLenum *, const GLubyte *, const GLfloat *); -extern void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); -extern void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); -extern void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *); -extern void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); -extern void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *); -extern void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLenum rc, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLenum rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLenum *rc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLenum rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -#endif - -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif - -#ifndef GL_INGR_color_clamp -#define GL_INGR_color_clamp 1 -#endif - -#ifndef GL_INGR_interlace_read -#define GL_INGR_interlace_read 1 -#endif - -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 -#endif - -#ifndef GL_EXT_422_pixels -#define GL_EXT_422_pixels 1 -#endif - -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 -#endif - -#ifndef GL_SUN_convolution_border_modes -#define GL_SUN_convolution_border_modes 1 -#endif - -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 -#endif - -#ifndef GL_EXT_texture_lod_bias -#define GL_EXT_texture_lod_bias 1 -#endif - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -#endif - -#ifndef GL_EXT_vertex_weighting -#define GL_EXT_vertex_weighting 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glVertexWeightfEXT (GLfloat); -extern void APIENTRY glVertexWeightfvEXT (const GLfloat *); -extern void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); -typedef void (APIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); -typedef void (APIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_NV_light_max_exponent -#define GL_NV_light_max_exponent 1 -#endif - -#ifndef GL_NV_vertex_array_range -#define GL_NV_vertex_array_range 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glFlushVertexArrayRangeNV (void); -extern void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (APIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei size, const GLvoid *pointer); -#endif - -#ifndef GL_NV_register_combiners -#define GL_NV_register_combiners 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); -extern void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); -extern void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); -extern void APIENTRY glCombinerParameteriNV (GLenum, GLint); -extern void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); -extern void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); -extern void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); -extern void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); -extern void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); -extern void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); -extern void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); -extern void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); -extern void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -typedef void (APIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); -#endif - -#ifndef GL_NV_fog_distance -#define GL_NV_fog_distance 1 -#endif - -#ifndef GL_NV_texgen_emboss -#define GL_NV_texgen_emboss 1 -#endif - -#ifndef GL_NV_blend_square -#define GL_NV_blend_square 1 -#endif - -#ifndef GL_NV_texture_env_combine4 -#define GL_NV_texture_env_combine4 1 -#endif - -#ifndef GL_MESA_resize_buffers -#define GL_MESA_resize_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glResizeBuffersMESA (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); -#endif - -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); -extern void APIENTRY glWindowPos2dvMESA (const GLdouble *); -extern void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); -extern void APIENTRY glWindowPos2fvMESA (const GLfloat *); -extern void APIENTRY glWindowPos2iMESA (GLint, GLint); -extern void APIENTRY glWindowPos2ivMESA (const GLint *); -extern void APIENTRY glWindowPos2sMESA (GLshort, GLshort); -extern void APIENTRY glWindowPos2svMESA (const GLshort *); -extern void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); -extern void APIENTRY glWindowPos3dvMESA (const GLdouble *); -extern void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); -extern void APIENTRY glWindowPos3fvMESA (const GLfloat *); -extern void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); -extern void APIENTRY glWindowPos3ivMESA (const GLint *); -extern void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); -extern void APIENTRY glWindowPos3svMESA (const GLshort *); -extern void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); -extern void APIENTRY glWindowPos4dvMESA (const GLdouble *); -extern void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); -extern void APIENTRY glWindowPos4fvMESA (const GLfloat *); -extern void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); -extern void APIENTRY glWindowPos4ivMESA (const GLint *); -extern void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); -extern void APIENTRY glWindowPos4svMESA (const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); -typedef void (APIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); -typedef void (APIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); -#endif - -#ifndef GL_IBM_cull_vertex -#define GL_IBM_cull_vertex 1 -#endif - -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glMultiModeDrawArraysIBM (GLenum, const GLint *, const GLsizei *, GLsizei, GLint); -extern void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* *, GLsizei, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (APIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, GLint modestride); -#endif - -#ifndef GL_IBM_vertex_array_lists -#define GL_IBM_vertex_array_lists 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -extern void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -extern void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); -extern void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -extern void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -extern void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -extern void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -extern void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -#endif - -#ifndef GL_SGIX_subsample -#define GL_SGIX_subsample 1 -#endif - -#ifndef GL_SGIX_ycrcba -#define GL_SGIX_ycrcba 1 -#endif - -#ifndef GL_SGIX_ycrcb_subsample -#define GL_SGIX_ycrcb_subsample 1 -#endif - -#ifndef GL_SGIX_depth_pass_instrument -#define GL_SGIX_depth_pass_instrument 1 -#endif - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_3DFX_texture_compression_FXT1 1 -#endif - -#ifndef GL_3DFX_multisample -#define GL_3DFX_multisample 1 -#endif - -#ifndef GL_3DFX_tbuffer -#define GL_3DFX_tbuffer 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glTbufferMask3DFX (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); -#endif - -#ifndef GL_EXT_multisample -#define GL_EXT_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); -extern void APIENTRY glSamplePatternEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); -#endif - -#ifndef GL_SGI_vertex_preclip -#define GL_SGI_vertex_preclip 1 -#endif - -#ifndef GL_SGIX_convolution_accuracy -#define GL_SGIX_convolution_accuracy 1 -#endif - -#ifndef GL_SGIX_resample -#define GL_SGIX_resample 1 -#endif - -#ifndef GL_SGIS_point_line_texgen -#define GL_SGIS_point_line_texgen 1 -#endif - -#ifndef GL_SGIS_texture_color_mask -#define GL_SGIS_texture_color_mask 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -#endif - -#ifndef GL_SGIX_igloo_interface -#define GL_SGIX_igloo_interface 1 -#ifdef GL_GLEXT_PROTOTYPES -extern void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); -#endif - -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 -#endif - - -#ifdef __cplusplus -} -#endif - -#endif +#ifndef __glext_h_ +#define __glext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.1 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: This software was created using the +** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has +** not been independently verified as being compliant with the OpenGL(R) +** version 1.2.1 Specification. +*/ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif + +/*************************************************************/ + +/* Header file version number, required by OpenGL ABI for Linux */ +#define GL_GLEXT_VERSION 7 + +#ifndef GL_VERSION_1_2 +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#endif + +#ifndef GL_ARB_multitexture +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +#endif + +#ifndef GL_ARB_multisample +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#endif + +#ifndef GL_ARB_texture_compression +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif + +#ifndef GL_EXT_abgr +#define GL_ABGR_EXT 0x8000 +#endif + +#ifndef GL_EXT_blend_color +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +#endif + +#ifndef GL_EXT_texture +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#endif + +#ifndef GL_EXT_texture3D +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +#endif + +#ifndef GL_EXT_subtexture +#endif + +#ifndef GL_EXT_copy_texture +#endif + +#ifndef GL_EXT_histogram +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#endif + +#ifndef GL_EXT_convolution +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 +#endif + +#ifndef GL_SGI_color_matrix +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#endif + +#ifndef GL_SGI_color_table +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +#endif + +#ifndef GL_SGIS_texture4D +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#endif + +#ifndef GL_EXT_cmyka +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#endif + +#ifndef GL_EXT_texture_object +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#endif + +#ifndef GL_SGIS_multisample +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_RESCALE_NORMAL_EXT 0x803A +#endif + +#ifndef GL_EXT_vertex_array +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +#endif + +#ifndef GL_EXT_misc_attribute +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#endif + +#ifndef GL_SGIX_shadow +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#endif + +#ifndef GL_EXT_blend_logic_op +#endif + +#ifndef GL_SGIX_interlace +#define GL_INTERLACE_SGIX 0x8094 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E +#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F +#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 +#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 +#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 +#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 +#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 +#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 +#endif + +#ifndef GL_SGIS_texture_select +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +#endif + +#ifndef GL_SGIX_instruments +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C +#endif + +#ifndef GL_SGIX_framezoom +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#endif + +#ifndef GL_FfdMaskSGIX +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 +#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 +#define GL_DEFORMATIONS_MASK_SGIX 0x8196 +#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +#endif + +#ifndef GL_SGIX_flush_raster +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#endif + +#ifndef GL_HP_image_transform +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#endif + +#ifndef GL_INGR_palette_buffer +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#endif + +#ifndef GL_EXT_color_subtable +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 +#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_LIST_PRIORITY_SGIX 0x8182 +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#endif + +#ifndef GL_EXT_index_texture +#endif + +#ifndef GL_EXT_index_material +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +#endif + +#ifndef GL_EXT_index_func +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 +#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 +#define GL_LIGHT_ENV_MODE_SGIX 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B +#define GL_FRAGMENT_LIGHT0_SGIX 0x840C +#define GL_FRAGMENT_LIGHT1_SGIX 0x840D +#define GL_FRAGMENT_LIGHT2_SGIX 0x840E +#define GL_FRAGMENT_LIGHT3_SGIX 0x840F +#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 +#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 +#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 +#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +#endif + +#ifndef GL_WIN_phong_shading +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#endif + +#ifndef GL_WIN_specular_fog +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#endif + +#ifndef GL_EXT_light_texture +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +/* reuse GL_FRAGMENT_DEPTH_EXT */ +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#endif + +#ifndef GL_EXT_bgra +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif + +#ifndef GL_SGIX_async +#define GL_ASYNC_MARKER_SGIX 0x8329 +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D +#endif + +#ifndef GL_INTEL_texture_scissor +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 +#endif + +#ifndef GL_HP_occlusion_test +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#endif + +#ifndef GL_EXT_secondary_color +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +#endif + +#ifndef GL_EXT_multi_draw_arrays +#endif + +#ifndef GL_EXT_fog_coord +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE3_RGB_EXT 0x8583 +#define GL_SOURCE4_RGB_EXT 0x8584 +#define GL_SOURCE5_RGB_EXT 0x8585 +#define GL_SOURCE6_RGB_EXT 0x8586 +#define GL_SOURCE7_RGB_EXT 0x8587 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_SOURCE3_ALPHA_EXT 0x858B +#define GL_SOURCE4_ALPHA_EXT 0x858C +#define GL_SOURCE5_ALPHA_EXT 0x858D +#define GL_SOURCE6_ALPHA_EXT 0x858E +#define GL_SOURCE7_ALPHA_EXT 0x858F +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND3_RGB_EXT 0x8593 +#define GL_OPERAND4_RGB_EXT 0x8594 +#define GL_OPERAND5_RGB_EXT 0x8595 +#define GL_OPERAND6_RGB_EXT 0x8596 +#define GL_OPERAND7_RGB_EXT 0x8597 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#define GL_OPERAND3_ALPHA_EXT 0x859B +#define GL_OPERAND4_ALPHA_EXT 0x859C +#define GL_OPERAND5_ALPHA_EXT 0x859D +#define GL_OPERAND6_ALPHA_EXT 0x859E +#define GL_OPERAND7_ALPHA_EXT 0x859F +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_FOG_SCALE_SGIX 0x81FC +#define GL_FOG_SCALE_VALUE_SGIX 0x81FD +#endif + +#ifndef GL_SUNX_constant_data +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +#endif + +#ifndef GL_SUN_global_alpha +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +#endif + +#ifndef GL_SUN_triangle_list +#define GL_RESTART_SUN 0x01 +#define GL_REPLACE_MIDDLE_SUN 0x02 +#define GL_REPLACE_OLDEST_SUN 0x03 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB +#endif + +#ifndef GL_SUN_vertex +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +#endif + +#ifndef GL_INGR_color_clamp +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INTERLACE_READ_INGR 0x8568 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#endif + +#ifndef GL_EXT_texture_cube_map +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_WRAP_BORDER_SUN 0x81D4 +#endif + +#ifndef GL_EXT_texture_env_add +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX +#define GL_MODELVIEW_MATRIX1_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT GL_MODELVIEW +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 +#endif + +#ifndef GL_NV_register_combiners +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +/* reuse GL_TEXTURE0_ARB */ +/* reuse GL_TEXTURE1_ARB */ +/* reuse GL_ZERO */ +/* reuse GL_NONE */ +/* reuse GL_FOG */ +#endif + +#ifndef GL_NV_fog_distance +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +/* reuse GL_EYE_PLANE */ +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#endif + +#ifndef GL_NV_blend_square +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B +#endif + +#ifndef GL_MESA_resize_buffers +#endif + +#ifndef GL_MESA_window_pos +#endif + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_CULL_VERTEX_IBM 103050 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 +#endif + +#ifndef GL_SGIX_subsample +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 +#endif + +#ifndef GL_SGI_depth_pass_instrument +#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 +#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 +#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 +#endif + +#ifndef GL_3DFX_tbuffer +#endif + +#ifndef GL_EXT_multisample +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_CONVOLUTION_HINT_SGIX 0x8316 +#endif + +#ifndef GL_SGIX_resample +#define GL_PACK_RESAMPLE_SGIX 0x842C +#define GL_UNPACK_RESAMPLE_SGIX 0x842D +#define GL_RESAMPLE_REPLICATE_SGIX 0x842E +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#endif + + +/*************************************************************/ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); +GLAPI void APIENTRY glBlendEquation (GLenum); +GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); +GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogram (GLenum); +GLAPI void APIENTRY glResetMinmax (GLenum); +GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (APIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTextureARB (GLenum); +GLAPI void APIENTRY glClientActiveTextureARB (GLenum); +GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); +GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); +GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); +GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +#endif + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePassARB (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRY * PFNGLSAMPLEPASSARBPROC) (GLenum pass); +#endif + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +#endif + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, void *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img); +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +#endif + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +#endif + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +#endif + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogramEXT (GLenum); +GLAPI void APIENTRY glResetMinmaxEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); +#endif + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +#endif + +#ifndef GL_EXT_color_matrix +#define GL_EXT_color_matrix 1 +#endif + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); +GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); +GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); +GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); +GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 +#endif + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 +#endif + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); +GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); +GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); +typedef void (APIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); +typedef void (APIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); +typedef GLboolean (APIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (APIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +#endif + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternSGIS (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +#endif + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glArrayElementEXT (GLint); +GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); +GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); +GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); +GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (APIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); +typedef void (APIENTRY * PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); +typedef void (APIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 +#endif + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 +#endif + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 +#endif + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 +#endif + +#ifndef GL_SGIX_texture_select +#define GL_SGIX_texture_select 1 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); +GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 +#endif + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); +GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIX_instruments +#define GL_SGIX_instruments 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); +GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); +GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *); +GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); +GLAPI void APIENTRY glStartInstrumentsSGIX (void); +GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLint (APIENTRY * PFNGLGETINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRY * PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); +typedef GLint (APIENTRY * PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); +typedef void (APIENTRY * PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); +typedef void (APIENTRY * PFNGLSTARTINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRY * PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 +#endif + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameZoomSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTagSampleBufferSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); +GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); +GLAPI void APIENTRY glDeformSGIX (GLbitfield); +GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +typedef void (APIENTRY * PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +typedef void (APIENTRY * PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (APIENTRY * PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); +#endif + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushRasterSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetFogFuncSGIS (const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); +typedef void (APIENTRY * PFNGLGETFOGFUNCSGISPROC) (const GLfloat *points); +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 +#endif + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); +GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 +#endif + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glHintPGI (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLHINTPGIPROC) (GLenum target, GLint mode); +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); +GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); +GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); +GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 +#endif + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 +#endif + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); +GLAPI void APIENTRY glUnlockArraysEXT (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); +GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); +typedef void (APIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_SGIX_fragment_lighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); +GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); +GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); +GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +#endif + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 +#endif + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 +#endif + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glApplyTextureEXT (GLenum); +GLAPI void APIENTRY glTextureLightEXT (GLenum); +GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 +#endif + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +#endif + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint); +GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *); +GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *); +GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); +GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); +GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (APIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); +typedef GLint (APIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); +typedef GLuint (APIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef void (APIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLboolean (APIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); +GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); +typedef void (APIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +#endif + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#endif + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); +GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); +GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); +GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *); +GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *); +GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); +GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); +GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); +GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureNormalEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogCoordfEXT (GLfloat); +GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *); +GLAPI void APIENTRY glFogCoorddEXT (GLdouble); +GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); +GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); +typedef void (APIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (APIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *); +GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *); +GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *); +GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glTangent3ivEXT (const GLint *); +GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glTangent3svEXT (const GLshort *); +GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *); +GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *); +GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *); +GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glBinormal3ivEXT (const GLint *); +GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); +GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); +typedef void (APIENTRY * PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRY * PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); +typedef void (APIENTRY * PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); +typedef void (APIENTRY * PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); +typedef void (APIENTRY * PFNGLTANGENT3IVEXTPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); +typedef void (APIENTRY * PFNGLTANGENT3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); +typedef void (APIENTRY * PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRY * PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); +typedef void (APIENTRY * PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); +typedef void (APIENTRY * PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); +typedef void (APIENTRY * PFNGLBINORMAL3IVEXTPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); +typedef void (APIENTRY * PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_SGIX_fog_scale 1 +#endif + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFinishTextureSUNX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); +#endif + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); +GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort); +GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint); +GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); +GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble); +GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); +GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); +GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +#endif + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint); +GLAPI void APIENTRY glReplacementCodeusSUN (GLushort); +GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte); +GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *); +GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); +GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); +GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); +#endif + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLenum *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLenum, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLenum *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLenum rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLenum rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLenum *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLenum rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 +#endif + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); +GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei size, const GLvoid *pointer); +#endif + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); +GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); +GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); +GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint); +GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); +GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); +#endif + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +#endif + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +#endif + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glResizeBuffersMESA (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); +#endif + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint); +GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiModeDrawArraysIBM (GLenum, const GLint *, const GLsizei *, GLsizei, GLint); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* *, GLsizei, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, GLint modestride); +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); +GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +#endif + +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 +#endif + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 +#endif + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTbufferMask3DFX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); +#endif + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); +#endif + +#ifndef GL_SGI_vertex_preclip +#define GL_SGI_vertex_preclip 1 +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 +#endif + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_SGIS_texture_color_mask 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#endif + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/GL/glu.h b/include/GL/glu.h index 65df77b3614..4049eed22aa 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -256,65 +256,65 @@ typedef struct GLUtesselator GLUtriangulatorObj; /* Internal convenience typedefs */ typedef void (*_GLUfuncptr)(); -extern void gluBeginCurve (GLUnurbs* nurb); -extern void gluBeginPolygon (GLUtesselator* tess); -extern void gluBeginSurface (GLUnurbs* nurb); -extern void gluBeginTrim (GLUnurbs* nurb); -extern GLint gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); -extern GLint gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data); -extern GLint gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); -extern GLint gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data); -extern GLint gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); -extern GLint gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); -extern GLboolean gluCheckExtension (const GLubyte *extName, const GLubyte *extString); -extern void gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks); -extern void gluDeleteNurbsRenderer (GLUnurbs* nurb); -extern void gluDeleteQuadric (GLUquadric* quad); -extern void gluDeleteTess (GLUtesselator* tess); -extern void gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops); -extern void gluEndCurve (GLUnurbs* nurb); -extern void gluEndPolygon (GLUtesselator* tess); -extern void gluEndSurface (GLUnurbs* nurb); -extern void gluEndTrim (GLUnurbs* nurb); -extern const GLubyte * gluErrorString (GLenum error); -extern void gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data); -extern const GLubyte * gluGetString (GLenum name); -extern void gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data); -extern void gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view); -extern void gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ); -extern GLUnurbs* gluNewNurbsRenderer (void); -extern GLUquadric* gluNewQuadric (void); -extern GLUtesselator* gluNewTess (void); -extern void gluNextContour (GLUtesselator* tess, GLenum type); -extern void gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc); -extern void gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData); -extern void gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData); -extern void gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type); -extern void gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value); -extern void gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type); -extern void gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top); -extern void gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep); -extern void gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); -extern void gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport); -extern GLint gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ); -extern void gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type); -extern void gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc); -extern void gluQuadricDrawStyle (GLUquadric* quad, GLenum draw); -extern void gluQuadricNormals (GLUquadric* quad, GLenum normal); -extern void gluQuadricOrientation (GLUquadric* quad, GLenum orientation); -extern void gluQuadricTexture (GLUquadric* quad, GLboolean texture); -extern GLint gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut); -extern void gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks); -extern void gluTessBeginContour (GLUtesselator* tess); -extern void gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data); -extern void gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc); -extern void gluTessEndContour (GLUtesselator* tess); -extern void gluTessEndPolygon (GLUtesselator* tess); -extern void gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ); -extern void gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data); -extern void gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data); -extern GLint gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ); -extern GLint gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble near, GLdouble far, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW); +GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb); +GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); +GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data); +GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); +GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data); +GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); +GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); +GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString); +GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks); +GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad); +GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops); +GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb); +GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error); +GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data); +GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name); +GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data); +GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view); +GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ); +GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void); +GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void); +GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void); +GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type); +GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc); +GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData); +GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData); +GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type); +GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value); +GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type); +GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top); +GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep); +GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); +GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport); +GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ); +GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type); +GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc); +GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw); +GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal); +GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation); +GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture); +GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut); +GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks); +GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data); +GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc); +GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ); +GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data); +GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data); +GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ); +GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble near, GLdouble far, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW); #ifdef __cplusplus } diff --git a/include/GL/glutf90.h b/include/GL/glutf90.h index 46f19796a7b..7dc1d6772a5 100644 --- a/include/GL/glutf90.h +++ b/include/GL/glutf90.h @@ -1,81 +1,81 @@ -#ifndef __glutf90_h__ -#define __glutf90_h__ - -/* Copyright (c) Mark J. Kilgard & Willam F. Mitchell, 1998. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -/* This header provides the binding interface for William Mitchell's - f90gl Fortran 90 GLUT binding. Other GLUT language bindings - can and should use this interace. */ - -/* I appreciate the guidance from William Mitchell - (mitchell@cam.nist.gov) in developing this friend interface - for use by the f90gl package. See ../../README.fortran */ - -#include - -/* Which callback enumerants for the __glutSetFCB/__glutGetFCB routines. */ -/* NOTE These values are part of a binary interface for the f90gl Fortran - 90 binding and so must NOT changes (additions are allowed). */ - -/* GLUTwindow callbacks. */ -#define GLUT_FCB_DISPLAY 0 /* GLUTdisplayFCB */ -#define GLUT_FCB_RESHAPE 1 /* GLUTreshapeFCB */ -#define GLUT_FCB_MOUSE 2 /* GLUTmouseFCB */ -#define GLUT_FCB_MOTION 3 /* GLUTmotionFCB */ -#define GLUT_FCB_PASSIVE 4 /* GLUTpassiveFCB */ -#define GLUT_FCB_ENTRY 5 /* GLUTentryFCB */ -#define GLUT_FCB_KEYBOARD 6 /* GLUTkeyboardFCB */ -#define GLUT_FCB_KEYBOARD_UP 7 /* GLUTkeyboardFCB */ -#define GLUT_FCB_WINDOW_STATUS 8 /* GLUTwindowStatusFCB */ -#define GLUT_FCB_VISIBILITY 9 /* GLUTvisibilityFCB */ -#define GLUT_FCB_SPECIAL 10 /* GLUTspecialFCB */ -#define GLUT_FCB_SPECIAL_UP 11 /* GLUTspecialFCB */ -#define GLUT_FCB_BUTTON_BOX 12 /* GLUTbuttonBoxFCB */ -#define GLUT_FCB_DIALS 13 /* GLUTdialsFCB */ -#define GLUT_FCB_SPACE_MOTION 14 /* GLUTspaceMotionFCB */ -#define GLUT_FCB_SPACE_ROTATE 15 /* GLUTspaceRotateFCB */ -#define GLUT_FCB_SPACE_BUTTON 16 /* GLUTspaceButtonFCB */ -#define GLUT_FCB_TABLET_MOTION 17 /* GLUTtabletMotionFCB */ -#define GLUT_FCB_TABLET_BUTTON 18 /* GLUTtabletButtonFCB */ -#define GLUT_FCB_JOYSTICK 19 /* GLUTjoystickFCB */ -/* Non-GLUTwindow callbacks. */ -#define GLUT_FCB_OVERLAY_DISPLAY 100 /* GLUTdisplayFCB */ -#define GLUT_FCB_SELECT 101 /* GLUTselectFCB */ -#define GLUT_FCB_TIMER 102 /* GLUTtimerFCB */ - -/* GLUT Fortran callback function types. */ -typedef void (GLUTCALLBACK *GLUTdisplayFCB) (void); -typedef void (GLUTCALLBACK *GLUTreshapeFCB) (int *, int *); -/* NOTE the pressed key is int, not unsigned char for Fortran! */ -typedef void (GLUTCALLBACK *GLUTkeyboardFCB) (int *, int *, int *); -typedef void (GLUTCALLBACK *GLUTmouseFCB) (int *, int *, int *, int *); -typedef void (GLUTCALLBACK *GLUTmotionFCB) (int *, int *); -typedef void (GLUTCALLBACK *GLUTpassiveFCB) (int *, int *); -typedef void (GLUTCALLBACK *GLUTentryFCB) (int *); -typedef void (GLUTCALLBACK *GLUTwindowStatusFCB) (int *); -typedef void (GLUTCALLBACK *GLUTvisibilityFCB) (int *); -typedef void (GLUTCALLBACK *GLUTspecialFCB) (int *, int *, int *); -typedef void (GLUTCALLBACK *GLUTbuttonBoxFCB) (int *, int *); -typedef void (GLUTCALLBACK *GLUTdialsFCB) (int *, int *); -typedef void (GLUTCALLBACK *GLUTspaceMotionFCB) (int *, int *, int *); -typedef void (GLUTCALLBACK *GLUTspaceRotateFCB) (int *, int *, int *); -typedef void (GLUTCALLBACK *GLUTspaceButtonFCB) (int *, int *); -typedef void (GLUTCALLBACK *GLUTtabletMotionFCB) (int *, int *); -typedef void (GLUTCALLBACK *GLUTtabletButtonFCB) (int *, int *, int *, int *); -typedef void (GLUTCALLBACK *GLUTjoystickFCB) (unsigned int *buttonMask, int *x, int *y, int *z); - -typedef void (GLUTCALLBACK *GLUTselectFCB) (int *); -typedef void (GLUTCALLBACK *GLUTtimerFCB) (int *); -typedef void (GLUTCALLBACK *GLUTmenuStateFCB) (int *); /* DEPRICATED. */ -typedef void (GLUTCALLBACK *GLUTmenuStatusFCB) (int *, int *, int *); -typedef void (GLUTCALLBACK *GLUTidleFCB) (void); - -/* Functions that set and return Fortran callback functions. */ -extern void* GLUTAPIENTRY __glutGetFCB(int which); -extern void GLUTAPIENTRY __glutSetFCB(int which, void *func); - -#endif /* __glutf90_h__ */ +#ifndef __glutf90_h__ +#define __glutf90_h__ + +/* Copyright (c) Mark J. Kilgard & Willam F. Mitchell, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +/* This header provides the binding interface for William Mitchell's + f90gl Fortran 90 GLUT binding. Other GLUT language bindings + can and should use this interace. */ + +/* I appreciate the guidance from William Mitchell + (mitchell@cam.nist.gov) in developing this friend interface + for use by the f90gl package. See ../../README.fortran */ + +#include + +/* Which callback enumerants for the __glutSetFCB/__glutGetFCB routines. */ +/* NOTE These values are part of a binary interface for the f90gl Fortran + 90 binding and so must NOT changes (additions are allowed). */ + +/* GLUTwindow callbacks. */ +#define GLUT_FCB_DISPLAY 0 /* GLUTdisplayFCB */ +#define GLUT_FCB_RESHAPE 1 /* GLUTreshapeFCB */ +#define GLUT_FCB_MOUSE 2 /* GLUTmouseFCB */ +#define GLUT_FCB_MOTION 3 /* GLUTmotionFCB */ +#define GLUT_FCB_PASSIVE 4 /* GLUTpassiveFCB */ +#define GLUT_FCB_ENTRY 5 /* GLUTentryFCB */ +#define GLUT_FCB_KEYBOARD 6 /* GLUTkeyboardFCB */ +#define GLUT_FCB_KEYBOARD_UP 7 /* GLUTkeyboardFCB */ +#define GLUT_FCB_WINDOW_STATUS 8 /* GLUTwindowStatusFCB */ +#define GLUT_FCB_VISIBILITY 9 /* GLUTvisibilityFCB */ +#define GLUT_FCB_SPECIAL 10 /* GLUTspecialFCB */ +#define GLUT_FCB_SPECIAL_UP 11 /* GLUTspecialFCB */ +#define GLUT_FCB_BUTTON_BOX 12 /* GLUTbuttonBoxFCB */ +#define GLUT_FCB_DIALS 13 /* GLUTdialsFCB */ +#define GLUT_FCB_SPACE_MOTION 14 /* GLUTspaceMotionFCB */ +#define GLUT_FCB_SPACE_ROTATE 15 /* GLUTspaceRotateFCB */ +#define GLUT_FCB_SPACE_BUTTON 16 /* GLUTspaceButtonFCB */ +#define GLUT_FCB_TABLET_MOTION 17 /* GLUTtabletMotionFCB */ +#define GLUT_FCB_TABLET_BUTTON 18 /* GLUTtabletButtonFCB */ +#define GLUT_FCB_JOYSTICK 19 /* GLUTjoystickFCB */ +/* Non-GLUTwindow callbacks. */ +#define GLUT_FCB_OVERLAY_DISPLAY 100 /* GLUTdisplayFCB */ +#define GLUT_FCB_SELECT 101 /* GLUTselectFCB */ +#define GLUT_FCB_TIMER 102 /* GLUTtimerFCB */ + +/* GLUT Fortran callback function types. */ +typedef void (GLUTCALLBACK *GLUTdisplayFCB) (void); +typedef void (GLUTCALLBACK *GLUTreshapeFCB) (int *, int *); +/* NOTE the pressed key is int, not unsigned char for Fortran! */ +typedef void (GLUTCALLBACK *GLUTkeyboardFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTmouseFCB) (int *, int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTmotionFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTpassiveFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTentryFCB) (int *); +typedef void (GLUTCALLBACK *GLUTwindowStatusFCB) (int *); +typedef void (GLUTCALLBACK *GLUTvisibilityFCB) (int *); +typedef void (GLUTCALLBACK *GLUTspecialFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTbuttonBoxFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTdialsFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTspaceMotionFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTspaceRotateFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTspaceButtonFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTtabletMotionFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTtabletButtonFCB) (int *, int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTjoystickFCB) (unsigned int *buttonMask, int *x, int *y, int *z); + +typedef void (GLUTCALLBACK *GLUTselectFCB) (int *); +typedef void (GLUTCALLBACK *GLUTtimerFCB) (int *); +typedef void (GLUTCALLBACK *GLUTmenuStateFCB) (int *); /* DEPRICATED. */ +typedef void (GLUTCALLBACK *GLUTmenuStatusFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTidleFCB) (void); + +/* Functions that set and return Fortran callback functions. */ +GLUTAPI void* APIENTRY __glutGetFCB(int which); +GLUTAPI void APIENTRY __glutSetFCB(int which, void *func); + +#endif /* __glutf90_h__ */ diff --git a/progs/demos/Makefile.win b/progs/demos/Makefile.win new file mode 100644 index 00000000000..9cb089e6211 --- /dev/null +++ b/progs/demos/Makefile.win @@ -0,0 +1,86 @@ +# $Id: Makefile.win,v 1.1 2001/09/14 22:19:18 brianp Exp $ + +# Mesa 3-D graphics library +# Version: 3.5 +# Copyright (C) 1995-2001 Brian Paul + +# Makefile for GLUT-based demo programs for Windows + +!include + +##### MACROS ##### + +TOP = .. +INCDIR = ..\include +LIBDIR = ..\lib + +PROGS = anisotropic \ + bounce \ + clearspd \ + cubemap \ + drawpix \ + fire \ + gamma \ + gears \ + geartrain \ + glinfo \ + gloss \ + gltestperf \ + glutfx \ + isosurf \ + ipers \ + lodbias \ + morph3d \ + multiarb \ + occlude \ + osdemo \ + paltex \ + pixeltex \ + pointblast \ + ray \ + readpix \ + reflect \ + renormal \ + shadowtex \ + spectex \ + stex3d \ + teapot \ + terrain \ + tessdemo \ + texcyl \ + texdown \ + texenv \ + texobj \ + trispd \ + tunnel \ + tunnel2 \ + winpos + +SRCS = +OSMESASRCS = osdemo.c + +!include "../mesawin32.mak" + +##### TARGETS ##### + +clean:: + +realclean:: + +targets: readtex.c readtex.h $(PROGS) + +# remove comments when we get non-osmesa pgm working +#$(EXES) : $*.obj $(DEPLIBS) +# echo $@ +# $(link) -out:$@ $** $(LIBS) + +$(OSMESAEXES) : $*.obj $(DEPLIBS) + echo $@ + $(link) -out:$@ $** $(LIBS) $(EXTRALIBS) + +readtex.c: + @copy ../util/readtex.c . + +readtex.h: + @copy ../util/readtex.c . + diff --git a/src/glu/sgi/Makefile.win b/src/glu/sgi/Makefile.win new file mode 100644 index 00000000000..1d239e7dfdf --- /dev/null +++ b/src/glu/sgi/Makefile.win @@ -0,0 +1,156 @@ +# Makefile for Win32 + +# +# Sept 12, 2001 +# Note: The nurbs code is not being built at this time. +# If you want to work on it, uncomment the definitions +# noted below to try to compile the sources. +# There are numerous problems, some of which may be solved +# by setting some #defines. +# + +!include + +.SUFFIXES : .cc + +TOP = .. + +GLU_SRCS_CC = \ + libnurbs\interface\bezierEval.cc \ + libnurbs\interface\bezierPatch.cc \ + libnurbs\interface\bezierPatchMesh.cc \ + libnurbs\interface\glcurveval.cc \ + libnurbs\interface\glinterface.cc \ + libnurbs\interface\glrenderer.cc \ + libnurbs\interface\glsurfeval.cc \ + libnurbs\interface\incurveeval.cc \ + libnurbs\interface\insurfeval.cc \ + libnurbs\internals\arc.cc \ + libnurbs\internals\arcsorter.cc \ + libnurbs\internals\arctess.cc \ + libnurbs\internals\backend.cc \ + libnurbs\internals\basiccrveval.cc \ + libnurbs\internals\basicsurfeval.cc \ + libnurbs\internals\bin.cc \ + libnurbs\internals\bufpool.cc \ + libnurbs\internals\cachingeval.cc \ + libnurbs\internals\ccw.cc \ + libnurbs\internals\coveandtiler.cc \ + libnurbs\internals\curve.cc \ + libnurbs\internals\curvelist.cc \ + libnurbs\internals\curvesub.cc \ + libnurbs\internals\dataTransform.cc \ + libnurbs\internals\displaylist.cc \ + libnurbs\internals\flist.cc \ + libnurbs\internals\flistsorter.cc \ + libnurbs\internals\hull.cc \ + libnurbs\internals\intersect.cc \ + libnurbs\internals\knotvector.cc \ + libnurbs\internals\mapdesc.cc \ + libnurbs\internals\mapdescv.cc \ + libnurbs\internals\maplist.cc \ + libnurbs\internals\mesher.cc \ + libnurbs\internals\monoTriangulationBackend.cc \ + libnurbs\internals\monotonizer.cc \ + libnurbs\internals\mycode.cc \ + libnurbs\internals\nurbsinterfac.cc \ + libnurbs\internals\nurbstess.cc \ + libnurbs\internals\patch.cc \ + libnurbs\internals\patchlist.cc \ + libnurbs\internals\quilt.cc \ + libnurbs\internals\reader.cc \ + libnurbs\internals\renderhints.cc \ + libnurbs\internals\slicer.cc \ + libnurbs\internals\sorter.cc \ + libnurbs\internals\splitarcs.cc \ + libnurbs\internals\subdivider.cc \ + libnurbs\internals\tobezier.cc \ + libnurbs\internals\trimline.cc \ + libnurbs\internals\trimregion.cc \ + libnurbs\internals\trimvertpool.cc \ + libnurbs\internals\uarray.cc \ + libnurbs\internals\varray.cc \ + libnurbs\nurbtess\directedLine.cc \ + libnurbs\nurbtess\gridWrap.cc \ + libnurbs\nurbtess\monoChain.cc \ + libnurbs\nurbtess\monoPolyPart.cc \ + libnurbs\nurbtess\monoTriangulation.cc \ + libnurbs\nurbtess\partitionX.cc \ + libnurbs\nurbtess\partitionY.cc \ + libnurbs\nurbtess\polyDBG.cc \ + libnurbs\nurbtess\polyUtil.cc \ + libnurbs\nurbtess\primitiveStream.cc \ + libnurbs\nurbtess\quicksort.cc \ + libnurbs\nurbtess\rectBlock.cc \ + libnurbs\nurbtess\sampleComp.cc \ + libnurbs\nurbtess\sampleCompBot.cc \ + libnurbs\nurbtess\sampleCompRight.cc \ + libnurbs\nurbtess\sampleCompTop.cc \ + libnurbs\nurbtess\sampleMonoPoly.cc \ + libnurbs\nurbtess\sampledLine.cc \ + libnurbs\nurbtess\searchTree.cc + +GLU_SRCS = \ + libtess\dict.c \ + libtess\geom.c \ + libtess\memalloc.c \ + libtess\mesh.c \ + libtess\normal.c \ + libtess\priorityq.c \ + libtess\render.c \ + libtess\sweep.c \ + libtess\tess.c \ + libtess\tessmono.c \ + libutil\error.c \ + libutil\glue.c \ + libutil\mipmap.c \ + libutil\project.c \ + libutil\quad.c \ + libutil\registry.c + +SRCS = $(GLU_SRCS) + +GLUDLL = glu32.dll + +all : gludll install + +!include "$(TOP)/mesawin32.mak" + +gludll : $(GLUDLL) + +CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -Iinclude -DBUILD_GL32 +LFLAGS = $(dlllflags) $(LFLAGS) + +OBJS = $(GLU_SRCS:.c=.obj) +LIBS = ../lib/opengl32.lib winmm.lib $(guilibsdll) + +# Uncomment these definitions to try to compile the NURBS code. +#OBJS = $(GLU_SRCS_CC:.cc=.obj) $(GLU_SRCS:.c=.obj) +#NURBSINC = -Ilibnurbs\interface -Ilibnurbs\internals -Ilibnurbs\nurbtess +#CFLAGS = $(CFLAGS) $(NURBSINC) + +$(GLUDLL) : $(OBJS) glu.def + $(link) $(LFLAGS) -out:$(GLUDLL) -def:glu.def $(OBJS) $(LIBS) + +install : $(GLUDLL) + @echo "copying Mesa GLU dynamic link library to system directory..." + -copy $(GLUDLL) $(TOP)\lib + @echo "copying Mesa GLU import library to library directory..." + -copy $(GLU) $(TOP)\lib + +clean :: + @del /f libtess\*.obj libutil\*.obj + @del /f libnurbs\interface\*.obj libnurbs\internals\*.obj + @del /f libnurbs\nurbtess\*.obj + +# override default inference rule with one that writes the object to +# the correct subdir. + +.c.obj : + $(cc) $(CFLAGS) -I. $< /Fo$*.obj + +# /TP is needed for C++ files because MS compiler +# does not recognize .cc as a C++ file. + +.cc.obj : + $(cc) $(CFLAGS) -I. $< /TP /Fo$*.obj diff --git a/src/glu/sgi/glu.def b/src/glu/sgi/glu.def new file mode 100644 index 00000000000..19da640d247 --- /dev/null +++ b/src/glu/sgi/glu.def @@ -0,0 +1,46 @@ +DESCRIPTION 'Mesa GLU (OpenGL work-alike) for Win32' +VERSION 3.5 + +EXPORTS + gluBeginPolygon + gluBuild1DMipmapLevels + gluBuild1DMipmaps + gluBuild2DMipmapLevels + gluBuild2DMipmaps + gluBuild3DMipmapLevels + gluBuild3DMipmaps + gluCheckExtension + gluCylinder + gluDeleteQuadric + gluDeleteTess + gluDisk + gluEndPolygon + gluErrorString + gluGetString + gluGetTessProperty + gluLookAt + gluNewQuadric + gluNewTess + gluNextContour + gluOrtho2D + gluPartialDisk + gluPerspective + gluPickMatrix + gluProject + gluQuadricCallback + gluQuadricDrawStyle + gluQuadricNormals + gluQuadricOrientation + gluQuadricTexture + gluScaleImage + gluSphere + gluTessBeginContour + gluTessBeginPolygon + gluTessCallback + gluTessEndContour + gluTessEndPolygon + gluTessNormal + gluTessProperty + gluTessVertex + gluUnProject + gluUnProject4 diff --git a/src/glu/sgi/libutil/project.c b/src/glu/sgi/libutil/project.c index f67c8782f8b..4d9819471b6 100644 --- a/src/glu/sgi/libutil/project.c +++ b/src/glu/sgi/libutil/project.c @@ -1,381 +1,381 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/07/16 15:46:42 $ $Revision: 1.2 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libutil/project.c,v 1.2 2001/07/16 15:46:42 brianp Exp $ -*/ - -#include "gluos.h" -#include -#include -#include -#include "gluint.h" - -/* -** Make m an identity matrix -*/ -static void __gluMakeIdentityd(GLdouble m[16]) -{ - m[0+4*0] = 1; m[0+4*1] = 0; m[0+4*2] = 0; m[0+4*3] = 0; - m[1+4*0] = 0; m[1+4*1] = 1; m[1+4*2] = 0; m[1+4*3] = 0; - m[2+4*0] = 0; m[2+4*1] = 0; m[2+4*2] = 1; m[2+4*3] = 0; - m[3+4*0] = 0; m[3+4*1] = 0; m[3+4*2] = 0; m[3+4*3] = 1; -} - -static void __gluMakeIdentityf(GLfloat m[16]) -{ - m[0+4*0] = 1; m[0+4*1] = 0; m[0+4*2] = 0; m[0+4*3] = 0; - m[1+4*0] = 0; m[1+4*1] = 1; m[1+4*2] = 0; m[1+4*3] = 0; - m[2+4*0] = 0; m[2+4*1] = 0; m[2+4*2] = 1; m[2+4*3] = 0; - m[3+4*0] = 0; m[3+4*1] = 0; m[3+4*2] = 0; m[3+4*3] = 1; -} - -void GLAPIENTRY -gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top) -{ - glOrtho(left, right, bottom, top, -1, 1); -} - -#define __glPi 3.14159265358979323846 - -void GLAPIENTRY -gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar) -{ - GLdouble m[4][4]; - double sine, cotangent, deltaZ; - double radians = fovy / 2 * __glPi / 180; - - deltaZ = zFar - zNear; - sine = sin(radians); - if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) { - return; - } - cotangent = COS(radians) / sine; - - __gluMakeIdentityd(&m[0][0]); - m[0][0] = cotangent / aspect; - m[1][1] = cotangent; - m[2][2] = -(zFar + zNear) / deltaZ; - m[2][3] = -1; - m[3][2] = -2 * zNear * zFar / deltaZ; - m[3][3] = 0; - glMultMatrixd(&m[0][0]); -} - -static void normalize(float v[3]) -{ - float r; - - r = sqrt( v[0]*v[0] + v[1]*v[1] + v[2]*v[2] ); - if (r == 0.0) return; - - v[0] /= r; - v[1] /= r; - v[2] /= r; -} - -static void cross(float v1[3], float v2[3], float result[3]) -{ - result[0] = v1[1]*v2[2] - v1[2]*v2[1]; - result[1] = v1[2]*v2[0] - v1[0]*v2[2]; - result[2] = v1[0]*v2[1] - v1[1]*v2[0]; -} - -void GLAPIENTRY -gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, - GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, - GLdouble upz) -{ - int i; - float forward[3], side[3], up[3]; - GLfloat m[4][4]; - - forward[0] = centerx - eyex; - forward[1] = centery - eyey; - forward[2] = centerz - eyez; - - up[0] = upx; - up[1] = upy; - up[2] = upz; - - normalize(forward); - - /* Side = forward x up */ - cross(forward, up, side); - normalize(side); - - /* Recompute up as: up = side x forward */ - cross(side, forward, up); - - __gluMakeIdentityf(&m[0][0]); - m[0][0] = side[0]; - m[1][0] = side[1]; - m[2][0] = side[2]; - - m[0][1] = up[0]; - m[1][1] = up[1]; - m[2][1] = up[2]; - - m[0][2] = -forward[0]; - m[1][2] = -forward[1]; - m[2][2] = -forward[2]; - - glMultMatrixf(&m[0][0]); - glTranslated(-eyex, -eyey, -eyez); -} - -static void __gluMultMatrixVecd(const GLdouble matrix[16], const GLdouble in[4], - GLdouble out[4]) -{ - int i; - - for (i=0; i<4; i++) { - out[i] = - in[0] * matrix[0*4+i] + - in[1] * matrix[1*4+i] + - in[2] * matrix[2*4+i] + - in[3] * matrix[3*4+i]; - } -} - -/* -** inverse = invert(src) -*/ -static int __gluInvertMatrixd(const GLdouble src[16], GLdouble inverse[16]) -{ - int i, j, k, swap; - double t; - GLdouble temp[4][4]; - - for (i=0; i<4; i++) { - for (j=0; j<4; j++) { - temp[i][j] = src[i*4+j]; - } - } - __gluMakeIdentityd(inverse); - - for (i = 0; i < 4; i++) { - /* - ** Look for largest element in column - */ - swap = i; - for (j = i + 1; j < 4; j++) { - if (fabs(temp[j][i]) > fabs(temp[i][i])) { - swap = j; - } - } - - if (swap != i) { - /* - ** Swap rows. - */ - for (k = 0; k < 4; k++) { - t = temp[i][k]; - temp[i][k] = temp[swap][k]; - temp[swap][k] = t; - - t = inverse[i*4+k]; - inverse[i*4+k] = inverse[swap*4+k]; - inverse[swap*4+k] = t; - } - } - - if (temp[i][i] == 0) { - /* - ** No non-zero pivot. The matrix is singular, which shouldn't - ** happen. This means the user gave us a bad matrix. - */ - return GL_FALSE; - } - - t = temp[i][i]; - for (k = 0; k < 4; k++) { - temp[i][k] /= t; - inverse[i*4+k] /= t; - } - for (j = 0; j < 4; j++) { - if (j != i) { - t = temp[j][i]; - for (k = 0; k < 4; k++) { - temp[j][k] -= temp[i][k]*t; - inverse[j*4+k] -= inverse[i*4+k]*t; - } - } - } - } - return GL_TRUE; -} - -static void __gluMultMatricesd(const GLdouble a[16], const GLdouble b[16], - GLdouble r[16]) -{ - int i, j; - - for (i = 0; i < 4; i++) { - for (j = 0; j < 4; j++) { - r[i*4+j] = - a[i*4+0]*b[0*4+j] + - a[i*4+1]*b[1*4+j] + - a[i*4+2]*b[2*4+j] + - a[i*4+3]*b[3*4+j]; - } - } -} - -GLint GLAPIENTRY -gluProject(GLdouble objx, GLdouble objy, GLdouble objz, - const GLdouble modelMatrix[16], - const GLdouble projMatrix[16], - const GLint viewport[4], - GLdouble *winx, GLdouble *winy, GLdouble *winz) -{ - double in[4]; - double out[4]; - - in[0]=objx; - in[1]=objy; - in[2]=objz; - in[3]=1.0; - __gluMultMatrixVecd(modelMatrix, in, out); - __gluMultMatrixVecd(projMatrix, out, in); - if (in[3] == 0.0) return(GL_FALSE); - in[0] /= in[3]; - in[1] /= in[3]; - in[2] /= in[3]; - /* Map x, y and z to range 0-1 */ - in[0] = in[0] * 0.5 + 0.5; - in[1] = in[1] * 0.5 + 0.5; - in[2] = in[2] * 0.5 + 0.5; - - /* Map x,y to viewport */ - in[0] = in[0] * viewport[2] + viewport[0]; - in[1] = in[1] * viewport[3] + viewport[1]; - - *winx=in[0]; - *winy=in[1]; - *winz=in[2]; - return(GL_TRUE); -} - -GLint GLAPIENTRY -gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, - const GLdouble modelMatrix[16], - const GLdouble projMatrix[16], - const GLint viewport[4], - GLdouble *objx, GLdouble *objy, GLdouble *objz) -{ - double finalMatrix[16]; - double in[4]; - double out[4]; - - __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix); - if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) return(GL_FALSE); - - in[0]=winx; - in[1]=winy; - in[2]=winz; - in[3]=1.0; - - /* Map x and y from window coordinates */ - in[0] = (in[0] - viewport[0]) / viewport[2]; - in[1] = (in[1] - viewport[1]) / viewport[3]; - - /* Map to range -1 to 1 */ - in[0] = in[0] * 2 - 1; - in[1] = in[1] * 2 - 1; - in[2] = in[2] * 2 - 1; - - __gluMultMatrixVecd(finalMatrix, in, out); - if (out[3] == 0.0) return(GL_FALSE); - out[0] /= out[3]; - out[1] /= out[3]; - out[2] /= out[3]; - *objx = out[0]; - *objy = out[1]; - *objz = out[2]; - return(GL_TRUE); -} - -GLint GLAPIENTRY -gluUnProject4(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, - const GLdouble modelMatrix[16], - const GLdouble projMatrix[16], - const GLint viewport[4], - GLclampd near, GLclampd farVal, - GLdouble *objx, GLdouble *objy, GLdouble *objz, - GLdouble *objw) -{ - double finalMatrix[16]; - double in[4]; - double out[4]; - - __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix); - if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) return(GL_FALSE); - - in[0]=winx; - in[1]=winy; - in[2]=winz; - in[3]=clipw; - - /* Map x and y from window coordinates */ - in[0] = (in[0] - viewport[0]) / viewport[2]; - in[1] = (in[1] - viewport[1]) / viewport[3]; - in[2] = (in[2] - near) / (farVal - near); - - /* Map to range -1 to 1 */ - in[0] = in[0] * 2 - 1; - in[1] = in[1] * 2 - 1; - in[2] = in[2] * 2 - 1; - - __gluMultMatrixVecd(finalMatrix, in, out); - if (out[3] == 0.0) return(GL_FALSE); - *objx = out[0]; - *objy = out[1]; - *objz = out[2]; - *objw = out[3]; - return(GL_TRUE); -} - -void GLAPIENTRY -gluPickMatrix(GLdouble x, GLdouble y, GLdouble deltax, GLdouble deltay, - GLint viewport[4]) -{ - if (deltax <= 0 || deltay <= 0) { - return; - } - - /* Translate and scale the picked region to the entire window */ - glTranslatef((viewport[2] - 2 * (x - viewport[0])) / deltax, - (viewport[3] - 2 * (y - viewport[1])) / deltay, 0); - glScalef(viewport[2] / deltax, viewport[3] / deltay, 1.0); -} +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.1 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. This software +** was created using the OpenGL(R) version 1.2.1 Sample Implementation +** published by SGI, but has not been independently verified as being +** compliant with the OpenGL(R) version 1.2.1 Specification. +** +** $Date: 2001/09/14 22:19:19 $ $Revision: 1.3 $ +** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libutil/project.c,v 1.3 2001/09/14 22:19:19 brianp Exp $ +*/ + +#include "gluos.h" +#include +#include +#include +#include "gluint.h" + +/* +** Make m an identity matrix +*/ +static void __gluMakeIdentityd(GLdouble m[16]) +{ + m[0+4*0] = 1; m[0+4*1] = 0; m[0+4*2] = 0; m[0+4*3] = 0; + m[1+4*0] = 0; m[1+4*1] = 1; m[1+4*2] = 0; m[1+4*3] = 0; + m[2+4*0] = 0; m[2+4*1] = 0; m[2+4*2] = 1; m[2+4*3] = 0; + m[3+4*0] = 0; m[3+4*1] = 0; m[3+4*2] = 0; m[3+4*3] = 1; +} + +static void __gluMakeIdentityf(GLfloat m[16]) +{ + m[0+4*0] = 1; m[0+4*1] = 0; m[0+4*2] = 0; m[0+4*3] = 0; + m[1+4*0] = 0; m[1+4*1] = 1; m[1+4*2] = 0; m[1+4*3] = 0; + m[2+4*0] = 0; m[2+4*1] = 0; m[2+4*2] = 1; m[2+4*3] = 0; + m[3+4*0] = 0; m[3+4*1] = 0; m[3+4*2] = 0; m[3+4*3] = 1; +} + +void GLAPIENTRY +gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top) +{ + glOrtho(left, right, bottom, top, -1, 1); +} + +#define __glPi 3.14159265358979323846 + +void GLAPIENTRY +gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar) +{ + GLdouble m[4][4]; + double sine, cotangent, deltaZ; + double radians = fovy / 2 * __glPi / 180; + + deltaZ = zFar - zNear; + sine = sin(radians); + if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) { + return; + } + cotangent = COS(radians) / sine; + + __gluMakeIdentityd(&m[0][0]); + m[0][0] = cotangent / aspect; + m[1][1] = cotangent; + m[2][2] = -(zFar + zNear) / deltaZ; + m[2][3] = -1; + m[3][2] = -2 * zNear * zFar / deltaZ; + m[3][3] = 0; + glMultMatrixd(&m[0][0]); +} + +static void normalize(float v[3]) +{ + float r; + + r = sqrt( v[0]*v[0] + v[1]*v[1] + v[2]*v[2] ); + if (r == 0.0) return; + + v[0] /= r; + v[1] /= r; + v[2] /= r; +} + +static void cross(float v1[3], float v2[3], float result[3]) +{ + result[0] = v1[1]*v2[2] - v1[2]*v2[1]; + result[1] = v1[2]*v2[0] - v1[0]*v2[2]; + result[2] = v1[0]*v2[1] - v1[1]*v2[0]; +} + +void GLAPIENTRY +gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, + GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, + GLdouble upz) +{ + int i; + float forward[3], side[3], up[3]; + GLfloat m[4][4]; + + forward[0] = centerx - eyex; + forward[1] = centery - eyey; + forward[2] = centerz - eyez; + + up[0] = upx; + up[1] = upy; + up[2] = upz; + + normalize(forward); + + /* Side = forward x up */ + cross(forward, up, side); + normalize(side); + + /* Recompute up as: up = side x forward */ + cross(side, forward, up); + + __gluMakeIdentityf(&m[0][0]); + m[0][0] = side[0]; + m[1][0] = side[1]; + m[2][0] = side[2]; + + m[0][1] = up[0]; + m[1][1] = up[1]; + m[2][1] = up[2]; + + m[0][2] = -forward[0]; + m[1][2] = -forward[1]; + m[2][2] = -forward[2]; + + glMultMatrixf(&m[0][0]); + glTranslated(-eyex, -eyey, -eyez); +} + +static void __gluMultMatrixVecd(const GLdouble matrix[16], const GLdouble in[4], + GLdouble out[4]) +{ + int i; + + for (i=0; i<4; i++) { + out[i] = + in[0] * matrix[0*4+i] + + in[1] * matrix[1*4+i] + + in[2] * matrix[2*4+i] + + in[3] * matrix[3*4+i]; + } +} + +/* +** inverse = invert(src) +*/ +static int __gluInvertMatrixd(const GLdouble src[16], GLdouble inverse[16]) +{ + int i, j, k, swap; + double t; + GLdouble temp[4][4]; + + for (i=0; i<4; i++) { + for (j=0; j<4; j++) { + temp[i][j] = src[i*4+j]; + } + } + __gluMakeIdentityd(inverse); + + for (i = 0; i < 4; i++) { + /* + ** Look for largest element in column + */ + swap = i; + for (j = i + 1; j < 4; j++) { + if (fabs(temp[j][i]) > fabs(temp[i][i])) { + swap = j; + } + } + + if (swap != i) { + /* + ** Swap rows. + */ + for (k = 0; k < 4; k++) { + t = temp[i][k]; + temp[i][k] = temp[swap][k]; + temp[swap][k] = t; + + t = inverse[i*4+k]; + inverse[i*4+k] = inverse[swap*4+k]; + inverse[swap*4+k] = t; + } + } + + if (temp[i][i] == 0) { + /* + ** No non-zero pivot. The matrix is singular, which shouldn't + ** happen. This means the user gave us a bad matrix. + */ + return GL_FALSE; + } + + t = temp[i][i]; + for (k = 0; k < 4; k++) { + temp[i][k] /= t; + inverse[i*4+k] /= t; + } + for (j = 0; j < 4; j++) { + if (j != i) { + t = temp[j][i]; + for (k = 0; k < 4; k++) { + temp[j][k] -= temp[i][k]*t; + inverse[j*4+k] -= inverse[i*4+k]*t; + } + } + } + } + return GL_TRUE; +} + +static void __gluMultMatricesd(const GLdouble a[16], const GLdouble b[16], + GLdouble r[16]) +{ + int i, j; + + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + r[i*4+j] = + a[i*4+0]*b[0*4+j] + + a[i*4+1]*b[1*4+j] + + a[i*4+2]*b[2*4+j] + + a[i*4+3]*b[3*4+j]; + } + } +} + +GLint GLAPIENTRY +gluProject(GLdouble objx, GLdouble objy, GLdouble objz, + const GLdouble modelMatrix[16], + const GLdouble projMatrix[16], + const GLint viewport[4], + GLdouble *winx, GLdouble *winy, GLdouble *winz) +{ + double in[4]; + double out[4]; + + in[0]=objx; + in[1]=objy; + in[2]=objz; + in[3]=1.0; + __gluMultMatrixVecd(modelMatrix, in, out); + __gluMultMatrixVecd(projMatrix, out, in); + if (in[3] == 0.0) return(GL_FALSE); + in[0] /= in[3]; + in[1] /= in[3]; + in[2] /= in[3]; + /* Map x, y and z to range 0-1 */ + in[0] = in[0] * 0.5 + 0.5; + in[1] = in[1] * 0.5 + 0.5; + in[2] = in[2] * 0.5 + 0.5; + + /* Map x,y to viewport */ + in[0] = in[0] * viewport[2] + viewport[0]; + in[1] = in[1] * viewport[3] + viewport[1]; + + *winx=in[0]; + *winy=in[1]; + *winz=in[2]; + return(GL_TRUE); +} + +GLint GLAPIENTRY +gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, + const GLdouble modelMatrix[16], + const GLdouble projMatrix[16], + const GLint viewport[4], + GLdouble *objx, GLdouble *objy, GLdouble *objz) +{ + double finalMatrix[16]; + double in[4]; + double out[4]; + + __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix); + if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) return(GL_FALSE); + + in[0]=winx; + in[1]=winy; + in[2]=winz; + in[3]=1.0; + + /* Map x and y from window coordinates */ + in[0] = (in[0] - viewport[0]) / viewport[2]; + in[1] = (in[1] - viewport[1]) / viewport[3]; + + /* Map to range -1 to 1 */ + in[0] = in[0] * 2 - 1; + in[1] = in[1] * 2 - 1; + in[2] = in[2] * 2 - 1; + + __gluMultMatrixVecd(finalMatrix, in, out); + if (out[3] == 0.0) return(GL_FALSE); + out[0] /= out[3]; + out[1] /= out[3]; + out[2] /= out[3]; + *objx = out[0]; + *objy = out[1]; + *objz = out[2]; + return(GL_TRUE); +} + +GLint GLAPIENTRY +gluUnProject4(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, + const GLdouble modelMatrix[16], + const GLdouble projMatrix[16], + const GLint viewport[4], + GLclampd nearVal, GLclampd farVal, + GLdouble *objx, GLdouble *objy, GLdouble *objz, + GLdouble *objw) +{ + double finalMatrix[16]; + double in[4]; + double out[4]; + + __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix); + if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) return(GL_FALSE); + + in[0]=winx; + in[1]=winy; + in[2]=winz; + in[3]=clipw; + + /* Map x and y from window coordinates */ + in[0] = (in[0] - viewport[0]) / viewport[2]; + in[1] = (in[1] - viewport[1]) / viewport[3]; + in[2] = (in[2] - nearVal) / (farVal - nearVal); + + /* Map to range -1 to 1 */ + in[0] = in[0] * 2 - 1; + in[1] = in[1] * 2 - 1; + in[2] = in[2] * 2 - 1; + + __gluMultMatrixVecd(finalMatrix, in, out); + if (out[3] == 0.0) return(GL_FALSE); + *objx = out[0]; + *objy = out[1]; + *objz = out[2]; + *objw = out[3]; + return(GL_TRUE); +} + +void GLAPIENTRY +gluPickMatrix(GLdouble x, GLdouble y, GLdouble deltax, GLdouble deltay, + GLint viewport[4]) +{ + if (deltax <= 0 || deltay <= 0) { + return; + } + + /* Translate and scale the picked region to the entire window */ + glTranslatef((viewport[2] - 2 * (x - viewport[0])) / deltax, + (viewport[3] - 2 * (y - viewport[1])) / deltay, 0); + glScalef(viewport[2] / deltax, viewport[3] / deltay, 1.0); +} diff --git a/src/glut/glx/Makefile.win b/src/glut/glx/Makefile.win index 4d809f11906..c3f9614099a 100644 --- a/src/glut/glx/Makefile.win +++ b/src/glut/glx/Makefile.win @@ -2,15 +2,15 @@ !include -TOP = ../.. +TOP = .. # NOTE: glut_menu.c and glut_glxext.c are NOT compiled into Win32 GLUT SRCS = 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_fbc.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_joy.c glut_key.c glut_keyctrl.c glut_keyup.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 -all : glutdll install +all : glutdll -!include "$(TOP)/glutwin32.mak" +!include "$(TOP)/mesawin32.mak" glutdll : $(GLUTDLL) @@ -18,15 +18,20 @@ glutdll : $(GLUTDLL) OPTIMIZE_CFLAGS = -DNDEBUG !ENDIF -CFLAGS = $(cvarsdll) $(CFLAGS) $(OPTIMIZE_CFLAGS) +CFLAGS = $(cvarsdll) $(CFLAGS) $(OPTIMIZE_CFLAGS) -DMESA -DBUILD_GL32 LFLAGS = $(dlllflags) $(LFLAGS) OBJS = $(SRCS:.c=.obj) MS_LIBS = $(MS_OPENGL) $(MS_GLU) winmm.lib $(guilibsdll) +MS_LIBS = ../lib/opengl32.lib ../lib/glu32.lib winmm.lib $(guilibsdll) SGI_LIBS = $(SGI_OPENGL) $(SGI_GLU) winmm.lib $(guilibsdll) glut32.dll : $(OBJS) glut.def $(link) $(LFLAGS) -out:glut32.dll -def:glut.def $(OBJS) $(MS_LIBS) + @echo "copying GLUT dynamic link library to lib directory..." + -copy $(GLUTDLL) ..\lib + @echo "copying GLUT import library to lib directory..." + -copy $(GLUTLIB) ..\lib glut.dll : $(OBJS) glut.def $(link) $(LFLAGS) -out:glut.dll -def:glut.def $(OBJS) $(SGI_LIBS) @@ -35,7 +40,7 @@ install : $(GLUTDLL) @echo "copying GLUT dynamic link library to system directory..." -copy $(GLUTDLL) $(DLLINSTALL) @echo "copying GLUT header file to include directory..." - -copy ..\..\include\GL\glut.h $(INCLUDEINSTALL) + -copy ..\include\GL\glut.h $(INCLUDEINSTALL) @echo "copying GLUT import library to library directory..." -copy $(GLUTLIB) $(LIBINSTALL) @@ -46,50 +51,50 @@ install : $(GLUTDLL) win32_glx.obj: win32_glx.c win32_glx.h win32_x11.obj: win32_x11.c win32_x11.h -win32_menu.obj: win32_menu.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h -win32_util.obj: win32_util.c glutint.h ..\..\include\GL\glutf90.h -win32_winproc.obj: win32_winproc.c glutint.h ..\..\include\GL\glutf90.h - -glut_mroman.obj: glut_mroman.c glutstroke.h glutint.h ..\..\include\GL\glutf90.h -glut_roman.obj: glut_roman.c glutstroke.h glutint.h ..\..\include\GL\glutf90.h -glut_hel12.obj: glut_hel12.c glutbitmap.h glutint.h ..\..\include\GL\glutf90.h -glut_8x13.obj: glut_8x13.c glutbitmap.h glutint.h ..\..\include\GL\glutf90.h -glut_hel18.obj: glut_hel18.c glutbitmap.h glutint.h ..\..\include\GL\glutf90.h -glut_9x15.obj: glut_9x15.c glutbitmap.h glutint.h ..\..\include\GL\glutf90.h -glut_tr10.obj: glut_tr10.c glutbitmap.h glutint.h ..\..\include\GL\glutf90.h -glut_hel10.obj: glut_hel10.c glutbitmap.h glutint.h ..\..\include\GL\glutf90.h -glut_tr24.obj: glut_tr24.c glutbitmap.h glutint.h ..\..\include\GL\glutf90.h - -glut_bitmap.obj: glut_bitmap.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_bwidth.obj: glut_bwidth.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_cindex.obj: glut_cindex.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_cmap.obj: glut_cmap.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_cursor.obj: glut_cursor.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_dials.obj: glut_dials.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_dstr.obj: glut_dstr.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_event.obj: glut_event.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_ext.obj: glut_ext.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_fullscrn.obj: glut_fullscrn.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_gamemode.obj: glut_gamemode.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_get.obj: glut_get.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_init.obj: glut_init.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_input.obj: glut_input.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_joy.obj: glut_joy.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_key.obj: glut_key.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_keyctrl.obj: glut_keyctrl.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_keyup.obj: glut_keyup.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_mesa.obj: glut_mesa.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_modifier.obj: glut_modifier.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_overlay.obj: glut_overlay.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_shapes.obj: glut_shapes.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_space.obj: glut_space.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_swap.obj: glut_swap.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_swidth.obj: glut_swidth.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_tablet.obj: glut_tablet.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_teapot.obj: glut_teapot.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_util.obj: glut_util.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_vidresize.obj: glut_vidresize.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_warp.obj: glut_warp.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_win.obj: glut_win.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h -glut_winmisc.obj: glut_winmisc.c glutint.h ..\..\include\GL\glutf90.h ..\..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +win32_menu.obj: win32_menu.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h +win32_util.obj: win32_util.c glutint.h ..\include\GL\glutf90.h +win32_winproc.obj: win32_winproc.c glutint.h ..\include\GL\glutf90.h + +glut_mroman.obj: glut_mroman.c glutstroke.h glutint.h ..\include\GL\glutf90.h +glut_roman.obj: glut_roman.c glutstroke.h glutint.h ..\include\GL\glutf90.h +glut_hel12.obj: glut_hel12.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_8x13.obj: glut_8x13.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_hel18.obj: glut_hel18.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_9x15.obj: glut_9x15.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_tr10.obj: glut_tr10.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_hel10.obj: glut_hel10.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_tr24.obj: glut_tr24.c glutbitmap.h glutint.h ..\include\GL\glutf90.h + +glut_bitmap.obj: glut_bitmap.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_bwidth.obj: glut_bwidth.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_cindex.obj: glut_cindex.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_cmap.obj: glut_cmap.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_cursor.obj: glut_cursor.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_dials.obj: glut_dials.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_dstr.obj: glut_dstr.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_event.obj: glut_event.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_ext.obj: glut_ext.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_fullscrn.obj: glut_fullscrn.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_gamemode.obj: glut_gamemode.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_get.obj: glut_get.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_init.obj: glut_init.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_input.obj: glut_input.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_joy.obj: glut_joy.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_key.obj: glut_key.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_keyctrl.obj: glut_keyctrl.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_keyup.obj: glut_keyup.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_mesa.obj: glut_mesa.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_modifier.obj: glut_modifier.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_overlay.obj: glut_overlay.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_shapes.obj: glut_shapes.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_space.obj: glut_space.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_swap.obj: glut_swap.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_swidth.obj: glut_swidth.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_tablet.obj: glut_tablet.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_teapot.obj: glut_teapot.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_util.obj: glut_util.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_vidresize.obj: glut_vidresize.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_warp.obj: glut_warp.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_win.obj: glut_win.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h +glut_winmisc.obj: glut_winmisc.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h diff --git a/src/glut/glx/glut.def b/src/glut/glx/glut.def new file mode 100644 index 00000000000..94da6ab852e --- /dev/null +++ b/src/glut/glx/glut.def @@ -0,0 +1,126 @@ +DESCRIPTION 'OpenGL Utility Toolkit for Win32' + +VERSION 3.7 + +EXPORTS + + glutAddMenuEntry + glutAddSubMenu + glutAttachMenu + glutBitmapCharacter + glutBitmapLength + glutBitmapWidth + glutButtonBoxFunc + glutChangeToMenuEntry + glutChangeToSubMenu + glutCopyColormap + glutCreateMenu + __glutCreateMenuWithExit + glutCreateSubWindow + glutCreateWindow + __glutCreateWindowWithExit + glutDestroyMenu + glutDestroyWindow + glutDetachMenu + glutDeviceGet + glutDialsFunc + glutDisplayFunc + glutEnterGameMode + glutEntryFunc + glutEstablishOverlay + glutExtensionSupported + glutForceJoystickFunc + glutFullScreen + glutGameModeGet + glutGameModeString + glutGet + glutGetColor + glutGetMenu + glutGetModifiers + glutGetWindow + glutHideOverlay + glutHideWindow + glutIconifyWindow + glutIdleFunc + glutIgnoreKeyRepeat + glutInit + __glutInitWithExit + glutInitDisplayMode + glutInitDisplayString + glutInitWindowPosition + glutInitWindowSize + glutJoystickFunc + glutKeyboardFunc + glutKeyboardUpFunc + glutLayerGet + glutLeaveGameMode + glutMainLoop + glutMenuStateFunc + glutMenuStatusFunc + glutMotionFunc + glutMouseFunc + glutOverlayDisplayFunc + glutPassiveMotionFunc + glutPopWindow + glutPositionWindow + glutPostOverlayRedisplay + glutPostRedisplay + glutPostWindowOverlayRedisplay + glutPostWindowRedisplay + glutPushWindow + glutRemoveMenuItem + glutRemoveOverlay + glutReportErrors + glutReshapeFunc + glutReshapeWindow + glutSetColor + glutSetCursor + glutSetIconTitle + glutSetKeyRepeat + glutSetMenu + glutSetWindow + glutSetWindowTitle + glutSetupVideoResizing + glutShowOverlay + glutShowWindow + glutSolidCone + glutSolidCube + glutSolidDodecahedron + glutSolidIcosahedron + glutSolidOctahedron + glutSolidSphere + glutSolidTeapot + glutSolidTetrahedron + glutSolidTorus + glutSpaceballButtonFunc + glutSpaceballMotionFunc + glutSpaceballRotateFunc + glutSpecialFunc + glutSpecialUpFunc + glutStopVideoResizing + glutStrokeCharacter + glutStrokeLength + glutStrokeWidth + glutSwapBuffers + glutTabletButtonFunc + glutTabletMotionFunc + glutTimerFunc + glutUseLayer + glutVideoPan + glutVideoResize + glutVideoResizeGet + glutVisibilityFunc + glutWarpPointer + glutWindowStatusFunc + glutWireCone + glutWireCube + glutWireDodecahedron + glutWireIcosahedron + glutWireOctahedron + glutWireSphere + glutWireTeapot + glutWireTetrahedron + glutWireTorus +; __glutSetFCB +; __glutGetFCB + diff --git a/src/glut/glx/win32_x11.h b/src/glut/glx/win32_x11.h index bb499773169..70de9060919 100644 --- a/src/glut/glx/win32_x11.h +++ b/src/glut/glx/win32_x11.h @@ -1,319 +1,326 @@ -#ifndef __win32_x11_h__ -#define __win32_x11_h__ - -/* Copyright (c) Nate Robins, 1997. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include -#include - -/* Type definitions (conversions) */ -typedef int Visual; /* Win32 equivalent of X11 type */ -typedef HWND Window; -typedef HPALETTE Colormap; -typedef PIXELFORMATDESCRIPTOR XVisualInfo; -typedef BOOL Bool; -typedef MSG XEvent; -typedef HDC Display; -typedef HCURSOR Cursor; - -typedef int Atom; /* dummies */ -typedef int XDevice; -typedef int Status; - -#define True TRUE /* Win32 equivalents of X11 booleans */ -#define False FALSE - -#define None 0L /* universal null resource or null atom */ - -/* Input Event Masks. Used as event-mask window attribute and as arguments - to Grab requests. Not to be confused with event names. */ - -#define NoEventMask 0L -#define KeyPressMask (1L<<0) -#define KeyReleaseMask (1L<<1) -#define ButtonPressMask (1L<<2) -#define ButtonReleaseMask (1L<<3) -#define EnterWindowMask (1L<<4) -#define LeaveWindowMask (1L<<5) -#define PointerMotionMask (1L<<6) -#define PointerMotionHintMask (1L<<7) -#define Button1MotionMask (1L<<8) -#define Button2MotionMask (1L<<9) -#define Button3MotionMask (1L<<10) -#define Button4MotionMask (1L<<11) -#define Button5MotionMask (1L<<12) -#define ButtonMotionMask (1L<<13) -#define KeymapStateMask (1L<<14) -#define ExposureMask (1L<<15) -#define VisibilityChangeMask (1L<<16) -#define StructureNotifyMask (1L<<17) -#define ResizeRedirectMask (1L<<18) -#define SubstructureNotifyMask (1L<<19) -#define SubstructureRedirectMask (1L<<20) -#define FocusChangeMask (1L<<21) -#define PropertyChangeMask (1L<<22) -#define ColormapChangeMask (1L<<23) -#define OwnerGrabButtonMask (1L<<24) - -/* Key masks. Used as modifiers to GrabButton and GrabKey, results of - QueryPointer, state in various key-, mouse-, and button-related - events. */ - -#define ShiftMask (1<<0) -#define LockMask (1<<1) -#define ControlMask (1<<2) -#define Mod1Mask (1<<3) -#define Mod2Mask (1<<4) -#define Mod3Mask (1<<5) -#define Mod4Mask (1<<6) -#define Mod5Mask (1<<7) - -/* Window classes used by CreateWindow */ -/* Note that CopyFromParent is already defined as 0 above */ - -#define InputOutput 1 -#define InputOnly 2 - -/* Window attributes for CreateWindow and ChangeWindowAttributes */ - -#define CWBackPixmap (1L<<0) -#define CWBackPixel (1L<<1) -#define CWBorderPixmap (1L<<2) -#define CWBorderPixel (1L<<3) -#define CWBitGravity (1L<<4) -#define CWWinGravity (1L<<5) -#define CWBackingStore (1L<<6) -#define CWBackingPlanes (1L<<7) -#define CWBackingPixel (1L<<8) -#define CWOverrideRedirect (1L<<9) -#define CWSaveUnder (1L<<10) -#define CWEventMask (1L<<11) -#define CWDontPropagate (1L<<12) -#define CWColormap (1L<<13) -#define CWCursor (1L<<14) - -/* ConfigureWindow structure */ - -#define CWX (1<<0) -#define CWY (1<<1) -#define CWWidth (1<<2) -#define CWHeight (1<<3) -#define CWBorderWidth (1<<4) -#define CWSibling (1<<5) -#define CWStackMode (1<<6) - - -/* Used in GetWindowAttributes reply */ - -#define IsUnmapped 0 -#define IsUnviewable 1 -#define IsViewable 2 - -/* Window stacking method (in configureWindow) */ - -#define Above 0 -#define Below 1 -#define TopIf 2 -#define BottomIf 3 -#define Opposite 4 - -/* For CreateColormap */ - -#define AllocNone 0 /* create map with no entries */ -#define AllocAll 1 /* allocate entire map writeable */ - - -/* Flags used in StoreNamedColor, StoreColors */ - -#define DoRed (1<<0) -#define DoGreen (1<<1) -#define DoBlue (1<<2) - -/* - * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding - * value (x, y, width, height) was found in the parsed string. - */ -#define NoValue 0x0000 -#define XValue 0x0001 -#define YValue 0x0002 -#define WidthValue 0x0004 -#define HeightValue 0x0008 -#define AllValues 0x000F -#define XNegative 0x0010 -#define YNegative 0x0020 - -/* flags argument in size hints */ -#define USPosition (1L << 0) /* user specified x, y */ -#define USSize (1L << 1) /* user specified width, height */ - -/* definitions for initial window state */ -#define WithdrawnState 0 /* for windows that are not mapped */ -#define NormalState 1 /* most applications want to start this way */ -#define IconicState 3 /* application wants to start as an icon */ -#define GameModeState 4 /* Win32 GLUT only (not in Xlib!). */ - -/* Type definitions */ - -typedef struct { - unsigned int background_pixmap; /* background pixmap */ - unsigned long background_pixel; /* background pixel */ - unsigned long border_pixel; /* border pixel value */ - long event_mask; /* set of events that should be saved */ - long do_not_propagate_mask; /* set of events that should not propagate */ - Bool override_redirect; /* boolean value for override-redirect */ - Colormap colormap; /* color map to be associated with window */ -} XSetWindowAttributes; - -typedef struct { - unsigned long pixel; - unsigned short red, green, blue; - char flags; /* do_red, do_green, do_blue */ -} XColor; - -typedef struct { - unsigned char *value; /* same as Property routines */ - Atom encoding; /* prop type */ - int format; /* prop data format: 8, 16, or 32 */ - unsigned long nitems; /* number of data items in value */ -} XTextProperty; - -typedef struct { - long flags; /* marks which fields in this structure are defined */ - int x, y; /* obsolete for new window mgrs, but clients */ - int width, height; /* should set so old wm's don't mess up */ -} XSizeHints; - -/* Functions emulated by macros. */ - -#define XFreeColormap(display, colormap) \ - DeleteObject(colormap) - -#define XCreateFontCursor(display, shape) \ - LoadCursor(NULL, shape) - -#define XDefineCursor(display, window, cursor) \ - SetCursor(cursor) - -#define XFlush(display) \ - /* Nothing. */ - -#define DisplayWidth(display, screen) \ - GetSystemMetrics(SM_CXSCREEN) - -#define DisplayHeight(display, screen) \ - GetSystemMetrics(SM_CYSCREEN) - -#define XMapWindow(display, window) \ - ShowWindow(window, SW_SHOWNORMAL) - -#define XUnmapWindow(display, window) \ - ShowWindow(window, SW_HIDE) - -#define XIconifyWindow(display, window, screen) \ - ShowWindow(window, SW_MINIMIZE) - -#define XWithdrawWindow(display, window, screen) \ - ShowWindow(window, SW_HIDE) - -#define XLowerWindow(display, window) \ - SetWindowPos(window, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE) - -#define XSetWMName(display, window, tp) \ - SetWindowText(window, (tp)->value) - -/* There really isn't a way to set the icon name separate from the - windows name in Win32, so, just set the windows name. */ -#define XSetWMIconName(display, window, tp) \ - XSetWMName(display, window, tp) - -#define XDestroyWindow(display, window) \ - DestroyWindow(window) - -/* Anything that needs to be freed was allocated with malloc in our - fake X windows library for Win32, so free it with plain old - free(). */ -#define XFree(data) \ - free(data) - -/* Nothing to be done for this...the pointer is always 'ungrabbed' - in Win32. */ -#define XUngrabPointer(display, time) \ - /* Nothing. */ - -/* Function prototypes. */ - -extern XVisualInfo* XGetVisualInfo( - Display* display, - long mask, - XVisualInfo* ttemplate, /* Avoid class with C++ keyword. */ - int*nitems); - -extern Colormap XCreateColormap( - Display* display, - Window root, - Visual* visual, - int alloc); - -extern void XAllocColorCells( - Display* display, - Colormap colormap, - Bool contig, - unsigned long plane_masks_return[], - unsigned int nplanes, - unsigned long pixels_return[], - unsigned int npixels); - -extern void XStoreColor( - Display* display, - Colormap colormap, - XColor* color); - -extern void XSetWindowColormap( - Display* display, - Window window, - Colormap colormap); - -extern Bool XTranslateCoordinates( - Display *display, - Window src, Window dst, - int src_x, int src_y, - int* dest_x_return, int* dest_y_return, - Window* child_return); - -extern Status XGetGeometry( - Display* display, - Window window, - Window* root_return, - int* x_return, int* y_return, - unsigned int* width_return, unsigned int* height_return, - unsigned int *border_width_return, - unsigned int* depth_return); - -extern int DisplayWidthMM( - Display* display, - int screen); - -extern int DisplayHeightMM( - Display* display, - int screen); - -extern void XWarpPointer( - Display* display, - Window src, Window dst, - int src_x, int src_y, - int src_width, int src_height, - int dst_x, int dst_y); - -extern int XParseGeometry( - char* string, - int* x, int* y, - unsigned int* width, unsigned int* height); - -extern int XPending( - Display* display); - -#endif /* __win32_x11_h__ */ +#ifndef __win32_x11_h__ +#define __win32_x11_h__ + +/* Copyright (c) Nate Robins, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include + +/* These definitions are missing from windows.h */ +WINGDIAPI int WINAPI wglChoosePixelFormat(HDC, PIXELFORMATDESCRIPTOR *); +WINGDIAPI int WINAPI wglDescribePixelFormat(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR); +WINGDIAPI int WINAPI wglGetPixelFormat(HDC); +WINGDIAPI BOOL WINAPI wglSetPixelFormat(HDC, int, PIXELFORMATDESCRIPTOR *); +WINGDIAPI BOOL WINAPI wglSwapBuffers(HDC); + +/* Type definitions (conversions) */ +typedef int Visual; /* Win32 equivalent of X11 type */ +typedef HWND Window; +typedef HPALETTE Colormap; +typedef PIXELFORMATDESCRIPTOR XVisualInfo; +typedef BOOL Bool; +typedef MSG XEvent; +typedef HDC Display; +typedef HCURSOR Cursor; + +typedef int Atom; /* dummies */ +typedef int XDevice; +typedef int Status; + +#define True TRUE /* Win32 equivalents of X11 booleans */ +#define False FALSE + +#define None 0L /* universal null resource or null atom */ + +/* Input Event Masks. Used as event-mask window attribute and as arguments + to Grab requests. Not to be confused with event names. */ + +#define NoEventMask 0L +#define KeyPressMask (1L<<0) +#define KeyReleaseMask (1L<<1) +#define ButtonPressMask (1L<<2) +#define ButtonReleaseMask (1L<<3) +#define EnterWindowMask (1L<<4) +#define LeaveWindowMask (1L<<5) +#define PointerMotionMask (1L<<6) +#define PointerMotionHintMask (1L<<7) +#define Button1MotionMask (1L<<8) +#define Button2MotionMask (1L<<9) +#define Button3MotionMask (1L<<10) +#define Button4MotionMask (1L<<11) +#define Button5MotionMask (1L<<12) +#define ButtonMotionMask (1L<<13) +#define KeymapStateMask (1L<<14) +#define ExposureMask (1L<<15) +#define VisibilityChangeMask (1L<<16) +#define StructureNotifyMask (1L<<17) +#define ResizeRedirectMask (1L<<18) +#define SubstructureNotifyMask (1L<<19) +#define SubstructureRedirectMask (1L<<20) +#define FocusChangeMask (1L<<21) +#define PropertyChangeMask (1L<<22) +#define ColormapChangeMask (1L<<23) +#define OwnerGrabButtonMask (1L<<24) + +/* Key masks. Used as modifiers to GrabButton and GrabKey, results of + QueryPointer, state in various key-, mouse-, and button-related + events. */ + +#define ShiftMask (1<<0) +#define LockMask (1<<1) +#define ControlMask (1<<2) +#define Mod1Mask (1<<3) +#define Mod2Mask (1<<4) +#define Mod3Mask (1<<5) +#define Mod4Mask (1<<6) +#define Mod5Mask (1<<7) + +/* Window classes used by CreateWindow */ +/* Note that CopyFromParent is already defined as 0 above */ + +#define InputOutput 1 +#define InputOnly 2 + +/* Window attributes for CreateWindow and ChangeWindowAttributes */ + +#define CWBackPixmap (1L<<0) +#define CWBackPixel (1L<<1) +#define CWBorderPixmap (1L<<2) +#define CWBorderPixel (1L<<3) +#define CWBitGravity (1L<<4) +#define CWWinGravity (1L<<5) +#define CWBackingStore (1L<<6) +#define CWBackingPlanes (1L<<7) +#define CWBackingPixel (1L<<8) +#define CWOverrideRedirect (1L<<9) +#define CWSaveUnder (1L<<10) +#define CWEventMask (1L<<11) +#define CWDontPropagate (1L<<12) +#define CWColormap (1L<<13) +#define CWCursor (1L<<14) + +/* ConfigureWindow structure */ + +#define CWX (1<<0) +#define CWY (1<<1) +#define CWWidth (1<<2) +#define CWHeight (1<<3) +#define CWBorderWidth (1<<4) +#define CWSibling (1<<5) +#define CWStackMode (1<<6) + + +/* Used in GetWindowAttributes reply */ + +#define IsUnmapped 0 +#define IsUnviewable 1 +#define IsViewable 2 + +/* Window stacking method (in configureWindow) */ + +#define Above 0 +#define Below 1 +#define TopIf 2 +#define BottomIf 3 +#define Opposite 4 + +/* For CreateColormap */ + +#define AllocNone 0 /* create map with no entries */ +#define AllocAll 1 /* allocate entire map writeable */ + + +/* Flags used in StoreNamedColor, StoreColors */ + +#define DoRed (1<<0) +#define DoGreen (1<<1) +#define DoBlue (1<<2) + +/* + * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding + * value (x, y, width, height) was found in the parsed string. + */ +#define NoValue 0x0000 +#define XValue 0x0001 +#define YValue 0x0002 +#define WidthValue 0x0004 +#define HeightValue 0x0008 +#define AllValues 0x000F +#define XNegative 0x0010 +#define YNegative 0x0020 + +/* flags argument in size hints */ +#define USPosition (1L << 0) /* user specified x, y */ +#define USSize (1L << 1) /* user specified width, height */ + +/* definitions for initial window state */ +#define WithdrawnState 0 /* for windows that are not mapped */ +#define NormalState 1 /* most applications want to start this way */ +#define IconicState 3 /* application wants to start as an icon */ +#define GameModeState 4 /* Win32 GLUT only (not in Xlib!). */ + +/* Type definitions */ + +typedef struct { + unsigned int background_pixmap; /* background pixmap */ + unsigned long background_pixel; /* background pixel */ + unsigned long border_pixel; /* border pixel value */ + long event_mask; /* set of events that should be saved */ + long do_not_propagate_mask; /* set of events that should not propagate */ + Bool override_redirect; /* boolean value for override-redirect */ + Colormap colormap; /* color map to be associated with window */ +} XSetWindowAttributes; + +typedef struct { + unsigned long pixel; + unsigned short red, green, blue; + char flags; /* do_red, do_green, do_blue */ +} XColor; + +typedef struct { + unsigned char *value; /* same as Property routines */ + Atom encoding; /* prop type */ + int format; /* prop data format: 8, 16, or 32 */ + unsigned long nitems; /* number of data items in value */ +} XTextProperty; + +typedef struct { + long flags; /* marks which fields in this structure are defined */ + int x, y; /* obsolete for new window mgrs, but clients */ + int width, height; /* should set so old wm's don't mess up */ +} XSizeHints; + +/* Functions emulated by macros. */ + +#define XFreeColormap(display, colormap) \ + DeleteObject(colormap) + +#define XCreateFontCursor(display, shape) \ + LoadCursor(NULL, shape) + +#define XDefineCursor(display, window, cursor) \ + SetCursor(cursor) + +#define XFlush(display) \ + /* Nothing. */ + +#define DisplayWidth(display, screen) \ + GetSystemMetrics(SM_CXSCREEN) + +#define DisplayHeight(display, screen) \ + GetSystemMetrics(SM_CYSCREEN) + +#define XMapWindow(display, window) \ + ShowWindow(window, SW_SHOWNORMAL) + +#define XUnmapWindow(display, window) \ + ShowWindow(window, SW_HIDE) + +#define XIconifyWindow(display, window, screen) \ + ShowWindow(window, SW_MINIMIZE) + +#define XWithdrawWindow(display, window, screen) \ + ShowWindow(window, SW_HIDE) + +#define XLowerWindow(display, window) \ + SetWindowPos(window, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE) + +#define XSetWMName(display, window, tp) \ + SetWindowText(window, (tp)->value) + +/* There really isn't a way to set the icon name separate from the + windows name in Win32, so, just set the windows name. */ +#define XSetWMIconName(display, window, tp) \ + XSetWMName(display, window, tp) + +#define XDestroyWindow(display, window) \ + DestroyWindow(window) + +/* Anything that needs to be freed was allocated with malloc in our + fake X windows library for Win32, so free it with plain old + free(). */ +#define XFree(data) \ + free(data) + +/* Nothing to be done for this...the pointer is always 'ungrabbed' + in Win32. */ +#define XUngrabPointer(display, time) \ + /* Nothing. */ + +/* Function prototypes. */ + +extern XVisualInfo* XGetVisualInfo( + Display* display, + long mask, + XVisualInfo* ttemplate, /* Avoid class with C++ keyword. */ + int*nitems); + +extern Colormap XCreateColormap( + Display* display, + Window root, + Visual* visual, + int alloc); + +extern void XAllocColorCells( + Display* display, + Colormap colormap, + Bool contig, + unsigned long plane_masks_return[], + unsigned int nplanes, + unsigned long pixels_return[], + unsigned int npixels); + +extern void XStoreColor( + Display* display, + Colormap colormap, + XColor* color); + +extern void XSetWindowColormap( + Display* display, + Window window, + Colormap colormap); + +extern Bool XTranslateCoordinates( + Display *display, + Window src, Window dst, + int src_x, int src_y, + int* dest_x_return, int* dest_y_return, + Window* child_return); + +extern Status XGetGeometry( + Display* display, + Window window, + Window* root_return, + int* x_return, int* y_return, + unsigned int* width_return, unsigned int* height_return, + unsigned int *border_width_return, + unsigned int* depth_return); + +extern int DisplayWidthMM( + Display* display, + int screen); + +extern int DisplayHeightMM( + Display* display, + int screen); + +extern void XWarpPointer( + Display* display, + Window src, Window dst, + int src_x, int src_y, + int src_width, int src_height, + int dst_x, int dst_y); + +extern int XParseGeometry( + char* string, + int* x, int* y, + unsigned int* width, unsigned int* height); + +extern int XPending( + Display* display); + +#endif /* __win32_x11_h__ */ diff --git a/src/mesa/drivers/osmesa/Makefile.win b/src/mesa/drivers/osmesa/Makefile.win new file mode 100644 index 00000000000..1d2f0aac4d4 --- /dev/null +++ b/src/mesa/drivers/osmesa/Makefile.win @@ -0,0 +1,37 @@ +# Makefile for Win32 + +!include + +TOP = ..\.. + +OSMESA_SRCS = osmesa.c +OSMESA_OBJS = osmesa.obj +OSMESALIB = OSmesa.lib + +ASM_SRCS = +CORE_SRCS = $(OSMESA_SRCS) +DRIVER_SRCS = + +SRCS = $(OSMESA_SRCS) + +all : osmesalib install + +!include "$(TOP)/mesawin32.mak" + +osmesalib : $(OSMESALIB) + +CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -I$(TOP)/src +LFLAGS = /LIB + +OBJS = $(ASM_SRCS:.S=.obj) $(CORE_SRCS:.c=.obj) $(DRIVER_SRCS:.c=.obj) +LIBS = $(TOP)/lib/OpenGL32.lib $(TOP)/src/opengl32.exp + +$(OSMESALIB) : $(OBJS) + $(link) $(LFLAGS) -out:$(OSMESALIB) $(OBJS) $(LIBS) + +install : $(OSMESALIB) + @echo "copying OSMesa library to library directory..." + -copy $(OSMESALIB) $(TOP)\lib + +clean :: + @del /f osmesa.obj diff --git a/src/mesa/drivers/windows/wgl.c b/src/mesa/drivers/windows/wgl.c index c9b6f649ea3..f7bf6820169 100644 --- a/src/mesa/drivers/windows/wgl.c +++ b/src/mesa/drivers/windows/wgl.c @@ -1,645 +1,645 @@ -/* $Id: wgl.c,v 1.7 2001/07/27 14:03:55 brianp Exp $ */ - -/* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Library General Public -* License as published by the Free Software Foundation; either -* version 2 of the License, or (at your option) any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Library General Public License for more details. -* -* You should have received a copy of the GNU Library General Public -* License along with this library; if not, write to the Free -* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -* -*/ - -/* -* File name : wgl.c -* WGL stuff. Added by Oleg Letsinsky, ajl@ultersys.ru -* Some things originated from the 3Dfx WGL functions -*/ - -#ifdef WIN32 - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#define GL_GLEXT_PROTOTYPES -#include -#include -//#include - -#ifdef __cplusplus -} -#endif - -#include -#include -#include "wmesadef.h" -#include "GL/wmesa.h" -#include "mtypes.h" - -#define MAX_MESA_ATTRS 20 - -struct __extensions__ -{ - PROC proc; - char *name; -}; - -struct __pixelformat__ -{ - PIXELFORMATDESCRIPTOR pfd; - GLboolean doubleBuffered; -}; - -struct __extensions__ ext[] = { - -#ifdef GL_EXT_polygon_offset - { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" }, -#endif - { (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" }, - { (PROC)glColorTableEXT, "glColorTableEXT" }, - { (PROC)glColorSubTableEXT, "glColorSubTableEXT" }, - { (PROC)glGetColorTableEXT, "glGetColorTableEXT" }, - { (PROC)glGetColorTableParameterfvEXT, "glGetColorTableParameterfvEXT" }, - { (PROC)glGetColorTableParameterivEXT, "glGetColorTableParameterivEXT" }, - { (PROC)glPointParameterfEXT, "glPointParameterfEXT" }, - { (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" }, - { (PROC)glBlendFuncSeparateEXT, "glBlendFuncSeparateEXT" }, - { (PROC)glLockArraysEXT, "glLockArraysEXT" }, - { (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" } -}; - -int qt_ext = sizeof(ext) / sizeof(ext[0]); - -struct __pixelformat__ pix[] = -{ - { { sizeof(PIXELFORMATDESCRIPTOR), 1, - PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_GENERIC_FORMAT|PFD_DOUBLEBUFFER|PFD_SWAP_COPY, - PFD_TYPE_RGBA, - 24, 8, 0, 8, 8, 8, 16, 8, 24, - 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 }, - GL_TRUE - }, - { { sizeof(PIXELFORMATDESCRIPTOR), 1, - PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_GENERIC_FORMAT, - PFD_TYPE_RGBA, - 24, 8, 0, 8, 8, 8, 16, 8, 24, - 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 }, - GL_FALSE - }, -}; - -int qt_pix = sizeof(pix) / sizeof(pix[0]); - -typedef struct { - WMesaContext ctx; - HDC hdc; -} MesaWglCtx; - -#define MESAWGL_CTX_MAX_COUNT 20 - -static MesaWglCtx wgl_ctx[MESAWGL_CTX_MAX_COUNT]; - -static unsigned ctx_count = 0; -static unsigned ctx_current = -1; -static unsigned curPFD = 0; - -GLAPI BOOL GLWINAPI wglCopyContext(HGLRC hglrcSrc,HGLRC hglrcDst,UINT mask) -{ - return(FALSE); -} - -GLAPI HGLRC GLWINAPI wglCreateContext(HDC hdc) -{ - HWND hWnd; - int i = 0; - if(!(hWnd = WindowFromDC(hdc))) - { - SetLastError(0); - return(NULL); - } - if (!ctx_count) - { - for(i=0;ibmiHeader.biSize = sizeof(BITMAPINFOHEADER); - dibInfo->bmiHeader.biPlanes = 1; - dibInfo->bmiHeader.biBitCount = 1; - dibInfo->bmiHeader.biCompression = BI_RGB; - - bitDevice = CreateCompatibleDC(fontDevice); - // HDC bitDevice = CreateDC("DISPLAY", NULL, NULL, NULL); - // VERIFY(bitDevice); - - // Swap fore and back colors so the bitmap has the right polarity - tempColor = GetBkColor(bitDevice); - SetBkColor(bitDevice, GetTextColor(bitDevice)); - SetTextColor(bitDevice, tempColor); - - // Place chars based on base line - VERIFY(SetTextAlign(bitDevice, TA_BASELINE) >= 0 ? 1 : 0); - - for(i = 0; i < numChars; i++) { - SIZE size; - char curChar; - int charWidth,charHeight,bmapWidth,bmapHeight,numBytes,res; - HBITMAP bitObject; - HGDIOBJ origBmap; - unsigned char *bmap; - - curChar = i + firstChar; - - // Find how high/wide this character is - VERIFY(GetTextExtentPoint32(bitDevice, &curChar, 1, &size)); - - // Create the output bitmap - charWidth = size.cx; - charHeight = size.cy; - bmapWidth = ((charWidth + 31) / 32) * 32; // Round up to the next multiple of 32 bits - bmapHeight = charHeight; - bitObject = CreateCompatibleBitmap(bitDevice, - bmapWidth, - bmapHeight); - //VERIFY(bitObject); - - // Assign the output bitmap to the device - origBmap = SelectObject(bitDevice, bitObject); - VERIFY(origBmap); - - VERIFY( PatBlt( bitDevice, 0, 0, bmapWidth, bmapHeight,BLACKNESS ) ); - - // Use our source font on the device - VERIFY(SelectObject(bitDevice, GetCurrentObject(fontDevice,OBJ_FONT))); - - // Draw the character - VERIFY(TextOut(bitDevice, 0, metric.tmAscent, &curChar, 1)); - - // Unselect our bmap object - VERIFY(SelectObject(bitDevice, origBmap)); - - // Convert the display dependant representation to a 1 bit deep DIB - numBytes = (bmapWidth * bmapHeight) / 8; - bmap = malloc(numBytes); - dibInfo->bmiHeader.biWidth = bmapWidth; - dibInfo->bmiHeader.biHeight = bmapHeight; - res = GetDIBits(bitDevice, bitObject, 0, bmapHeight, bmap, - dibInfo, - DIB_RGB_COLORS); - //VERIFY(res); - - // Create the GL object - glNewList(i + listBase, GL_COMPILE); - glBitmap(bmapWidth, bmapHeight, 0.0, metric.tmDescent, - charWidth, 0.0, - bmap); - glEndList(); - // CheckGL(); - - // Destroy the bmap object - DeleteObject(bitObject); - - // Deallocate the bitmap data - free(bmap); - } - - // Destroy the DC - VERIFY(DeleteDC(bitDevice)); - - free(dibInfo); - - return TRUE; -#undef VERIFY -} - -GLAPI BOOL GLWINAPI wglUseFontBitmapsA(HDC hdc, DWORD first, - DWORD count, DWORD listBase) -{ - int i; - GLuint font_list; - DWORD size; - GLYPHMETRICS gm; - HANDLE hBits; - LPSTR lpBits; - MAT2 mat; - int success = TRUE; - - if (first<0) - return FALSE; - if (count<0) - return FALSE; - if (listBase<0) - return FALSE; - - font_list = listBase; - - mat.eM11 = FixedFromDouble(1); - mat.eM12 = FixedFromDouble(0); - mat.eM21 = FixedFromDouble(0); - mat.eM22 = FixedFromDouble(-1); - - memset(&gm,0,sizeof(gm)); - - /* - ** If we can't get the glyph outline, it may be because this is a fixed - ** font. Try processing it that way. - */ - if( GetGlyphOutline(hdc, first, GGO_BITMAP, &gm, 0, NULL, &mat) - == GDI_ERROR ) - { - return wglUseFontBitmaps_FX( hdc, first, count, listBase ); - } - - /* - ** Otherwise process all desired characters. - */ - for (i = 0; i < count; i++) - { - DWORD err; - - glNewList( font_list+i, GL_COMPILE ); - - /* allocate space for the bitmap/outline */ - size = GetGlyphOutline(hdc, first + i, GGO_BITMAP, &gm, 0, NULL, &mat); - if (size == GDI_ERROR) - { - glEndList( ); - err = GetLastError(); - success = FALSE; - continue; - } - - hBits = GlobalAlloc(GHND, size+1); - lpBits = GlobalLock(hBits); - - err = - GetGlyphOutline(hdc, /* handle to device context */ - first + i, /* character to query */ - GGO_BITMAP, /* format of data to return */ - &gm, /* pointer to structure for metrics*/ - size, /* size of buffer for data */ - lpBits, /* pointer to buffer for data */ - &mat /* pointer to transformation */ - /* matrix structure */ - ); - - if (err == GDI_ERROR) - { - GlobalUnlock(hBits); - GlobalFree(hBits); - - glEndList( ); - err = GetLastError(); - success = FALSE; - continue; - } - - glBitmap(gm.gmBlackBoxX,gm.gmBlackBoxY, - -gm.gmptGlyphOrigin.x, - gm.gmptGlyphOrigin.y, - gm.gmCellIncX,gm.gmCellIncY, - (const GLubyte * )lpBits); - - GlobalUnlock(hBits); - GlobalFree(hBits); - - glEndList( ); - } - - return success; -} - - -GLAPI BOOL GLWINAPI wglUseFontBitmapsW(HDC hdc,DWORD first,DWORD count,DWORD listBase) -{ - return FALSE; -} - -GLAPI BOOL GLWINAPI wglUseFontOutlinesA(HDC hdc,DWORD first,DWORD count, - DWORD listBase,FLOAT deviation, - FLOAT extrusion,int format, - LPGLYPHMETRICSFLOAT lpgmf) -{ - SetLastError(0); - return(FALSE); -} - -GLAPI BOOL GLWINAPI wglUseFontOutlinesW(HDC hdc,DWORD first,DWORD count, - DWORD listBase,FLOAT deviation, - FLOAT extrusion,int format, - LPGLYPHMETRICSFLOAT lpgmf) -{ - SetLastError(0); - return(FALSE); -} - -GLAPI BOOL GLWINAPI wglDescribeLayerPlane(HDC hdc,int iPixelFormat, - int iLayerPlane,UINT nBytes, - LPLAYERPLANEDESCRIPTOR plpd) -{ - SetLastError(0); - return(FALSE); -} - -GLAPI int GLWINAPI wglSetLayerPaletteEntries(HDC hdc,int iLayerPlane, - int iStart,int cEntries, - CONST COLORREF *pcr) -{ - SetLastError(0); - return(0); -} - -GLAPI int GLWINAPI wglGetLayerPaletteEntries(HDC hdc,int iLayerPlane, - int iStart,int cEntries, - COLORREF *pcr) -{ - SetLastError(0); - return(0); -} - -GLAPI BOOL GLWINAPI wglRealizeLayerPalette(HDC hdc,int iLayerPlane,BOOL bRealize) -{ - SetLastError(0); - return(FALSE); -} - -GLAPI BOOL GLWINAPI wglSwapLayerBuffers(HDC hdc,UINT fuPlanes) -{ - if( !hdc ) - { - WMesaSwapBuffers(); - return(TRUE); - } - SetLastError(0); - return(FALSE); -} - -GLAPI int GLWINAPI wglChoosePixelFormat(HDC hdc, - CONST PIXELFORMATDESCRIPTOR *ppfd) -{ - int i,best = -1,bestdelta = 0x7FFFFFFF,delta,qt_valid_pix; - - qt_valid_pix = qt_pix; - if(ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR) || ppfd->nVersion != 1) - { - SetLastError(0); - return(0); - } - for(i = 0;i < qt_valid_pix;i++) - { - delta = 0; - if( - (ppfd->dwFlags & PFD_DRAW_TO_WINDOW) && - !(pix[i].pfd.dwFlags & PFD_DRAW_TO_WINDOW)) - continue; - if( - (ppfd->dwFlags & PFD_DRAW_TO_BITMAP) && - !(pix[i].pfd.dwFlags & PFD_DRAW_TO_BITMAP)) - continue; - if( - (ppfd->dwFlags & PFD_SUPPORT_GDI) && - !(pix[i].pfd.dwFlags & PFD_SUPPORT_GDI)) - continue; - if( - (ppfd->dwFlags & PFD_SUPPORT_OPENGL) && - !(pix[i].pfd.dwFlags & PFD_SUPPORT_OPENGL)) - continue; - if( - !(ppfd->dwFlags & PFD_DOUBLEBUFFER_DONTCARE) && - ((ppfd->dwFlags & PFD_DOUBLEBUFFER) != (pix[i].pfd.dwFlags & PFD_DOUBLEBUFFER))) - continue; - if( - !(ppfd->dwFlags & PFD_STEREO_DONTCARE) && - ((ppfd->dwFlags & PFD_STEREO) != (pix[i].pfd.dwFlags & PFD_STEREO))) - continue; - if(ppfd->iPixelType != pix[i].pfd.iPixelType) - delta++; - if(delta < bestdelta) - { - best = i + 1; - bestdelta = delta; - if(bestdelta == 0) - break; - } - } - if(best == -1) - { - SetLastError(0); - return(0); - } - return(best); -} - -GLAPI int GLWINAPI wglDescribePixelFormat(HDC hdc,int iPixelFormat,UINT nBytes, - LPPIXELFORMATDESCRIPTOR ppfd) -{ - int qt_valid_pix; - - qt_valid_pix = qt_pix; - if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix || nBytes != sizeof(PIXELFORMATDESCRIPTOR)) - { - SetLastError(0); - return(0); - } - *ppfd = pix[iPixelFormat - 1].pfd; - return(qt_valid_pix); -} - -/* -* GetProcAddress - return the address of an appropriate extension -*/ -GLAPI PROC GLWINAPI wglGetProcAddress(LPCSTR lpszProc) -{ - int i; - for(i = 0;i < qt_ext;i++) - if(!strcmp(lpszProc,ext[i].name)) - return(ext[i].proc); - - SetLastError(0); - return(NULL); -} - -GLAPI int GLWINAPI wglGetPixelFormat(HDC hdc) -{ - if(curPFD == 0) - { - SetLastError(0); - return(0); - } - return(curPFD); -} - -GLAPI BOOL GLWINAPI wglSetPixelFormat(HDC hdc,int iPixelFormat, - PIXELFORMATDESCRIPTOR *ppfd) -{ - int qt_valid_pix; - - qt_valid_pix = qt_pix; - if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix || ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR)) - { - SetLastError(0); - return(FALSE); - } - curPFD = iPixelFormat; - return(TRUE); -} - -GLAPI BOOL GLWINAPI wglSwapBuffers(HDC hdc) -{ - if (ctx_current < 0) - return FALSE; - - if(wgl_ctx[ctx_current].ctx == NULL) { - SetLastError(0); - return(FALSE); - } - WMesaSwapBuffers(); - return(TRUE); -} - -#endif /* WIN32 */ +/* $Id: wgl.c,v 1.8 2001/09/14 22:19:19 brianp Exp $ */ + +/* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Library General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Library General Public License for more details. +* +* You should have received a copy of the GNU Library General Public +* License along with this library; if not, write to the Free +* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +* +*/ + +/* +* File name : wgl.c +* WGL stuff. Added by Oleg Letsinsky, ajl@ultersys.ru +* Some things originated from the 3Dfx WGL functions +*/ + +#ifdef WIN32 + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#define GL_GLEXT_PROTOTYPES +#include +#include +//#include + +#ifdef __cplusplus +} +#endif + +#include +#include +#include "wmesadef.h" +#include "GL/wmesa.h" +#include "mtypes.h" + +#define MAX_MESA_ATTRS 20 + +struct __extensions__ +{ + PROC proc; + char *name; +}; + +struct __pixelformat__ +{ + PIXELFORMATDESCRIPTOR pfd; + GLboolean doubleBuffered; +}; + +struct __extensions__ ext[] = { + +#ifdef GL_EXT_polygon_offset + { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" }, +#endif + { (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" }, + { (PROC)glColorTableEXT, "glColorTableEXT" }, + { (PROC)glColorSubTableEXT, "glColorSubTableEXT" }, + { (PROC)glGetColorTableEXT, "glGetColorTableEXT" }, + { (PROC)glGetColorTableParameterfvEXT, "glGetColorTableParameterfvEXT" }, + { (PROC)glGetColorTableParameterivEXT, "glGetColorTableParameterivEXT" }, + { (PROC)glPointParameterfEXT, "glPointParameterfEXT" }, + { (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" }, + { (PROC)glBlendFuncSeparateEXT, "glBlendFuncSeparateEXT" }, + { (PROC)glLockArraysEXT, "glLockArraysEXT" }, + { (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" } +}; + +int qt_ext = sizeof(ext) / sizeof(ext[0]); + +struct __pixelformat__ pix[] = +{ + { { sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_GENERIC_FORMAT|PFD_DOUBLEBUFFER|PFD_SWAP_COPY, + PFD_TYPE_RGBA, + 24, 8, 0, 8, 8, 8, 16, 8, 24, + 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 }, + GL_TRUE + }, + { { sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_GENERIC_FORMAT, + PFD_TYPE_RGBA, + 24, 8, 0, 8, 8, 8, 16, 8, 24, + 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 }, + GL_FALSE + }, +}; + +int qt_pix = sizeof(pix) / sizeof(pix[0]); + +typedef struct { + WMesaContext ctx; + HDC hdc; +} MesaWglCtx; + +#define MESAWGL_CTX_MAX_COUNT 20 + +static MesaWglCtx wgl_ctx[MESAWGL_CTX_MAX_COUNT]; + +static unsigned ctx_count = 0; +static unsigned ctx_current = -1; +static unsigned curPFD = 0; + +WGLAPI BOOL GLAPIENTRY wglCopyContext(HGLRC hglrcSrc,HGLRC hglrcDst,UINT mask) +{ + return(FALSE); +} + +WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC hdc) +{ + HWND hWnd; + int i = 0; + if(!(hWnd = WindowFromDC(hdc))) + { + SetLastError(0); + return(NULL); + } + if (!ctx_count) + { + for(i=0;ibmiHeader.biSize = sizeof(BITMAPINFOHEADER); + dibInfo->bmiHeader.biPlanes = 1; + dibInfo->bmiHeader.biBitCount = 1; + dibInfo->bmiHeader.biCompression = BI_RGB; + + bitDevice = CreateCompatibleDC(fontDevice); + // HDC bitDevice = CreateDC("DISPLAY", NULL, NULL, NULL); + // VERIFY(bitDevice); + + // Swap fore and back colors so the bitmap has the right polarity + tempColor = GetBkColor(bitDevice); + SetBkColor(bitDevice, GetTextColor(bitDevice)); + SetTextColor(bitDevice, tempColor); + + // Place chars based on base line + VERIFY(SetTextAlign(bitDevice, TA_BASELINE) >= 0 ? 1 : 0); + + for(i = 0; i < numChars; i++) { + SIZE size; + char curChar; + int charWidth,charHeight,bmapWidth,bmapHeight,numBytes,res; + HBITMAP bitObject; + HGDIOBJ origBmap; + unsigned char *bmap; + + curChar = i + firstChar; + + // Find how high/wide this character is + VERIFY(GetTextExtentPoint32(bitDevice, &curChar, 1, &size)); + + // Create the output bitmap + charWidth = size.cx; + charHeight = size.cy; + bmapWidth = ((charWidth + 31) / 32) * 32; // Round up to the next multiple of 32 bits + bmapHeight = charHeight; + bitObject = CreateCompatibleBitmap(bitDevice, + bmapWidth, + bmapHeight); + //VERIFY(bitObject); + + // Assign the output bitmap to the device + origBmap = SelectObject(bitDevice, bitObject); + VERIFY(origBmap); + + VERIFY( PatBlt( bitDevice, 0, 0, bmapWidth, bmapHeight,BLACKNESS ) ); + + // Use our source font on the device + VERIFY(SelectObject(bitDevice, GetCurrentObject(fontDevice,OBJ_FONT))); + + // Draw the character + VERIFY(TextOut(bitDevice, 0, metric.tmAscent, &curChar, 1)); + + // Unselect our bmap object + VERIFY(SelectObject(bitDevice, origBmap)); + + // Convert the display dependant representation to a 1 bit deep DIB + numBytes = (bmapWidth * bmapHeight) / 8; + bmap = malloc(numBytes); + dibInfo->bmiHeader.biWidth = bmapWidth; + dibInfo->bmiHeader.biHeight = bmapHeight; + res = GetDIBits(bitDevice, bitObject, 0, bmapHeight, bmap, + dibInfo, + DIB_RGB_COLORS); + //VERIFY(res); + + // Create the GL object + glNewList(i + listBase, GL_COMPILE); + glBitmap(bmapWidth, bmapHeight, 0.0, metric.tmDescent, + charWidth, 0.0, + bmap); + glEndList(); + // CheckGL(); + + // Destroy the bmap object + DeleteObject(bitObject); + + // Deallocate the bitmap data + free(bmap); + } + + // Destroy the DC + VERIFY(DeleteDC(bitDevice)); + + free(dibInfo); + + return TRUE; +#undef VERIFY +} + +WGLAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first, + DWORD count, DWORD listBase) +{ + int i; + GLuint font_list; + DWORD size; + GLYPHMETRICS gm; + HANDLE hBits; + LPSTR lpBits; + MAT2 mat; + int success = TRUE; + + if (first<0) + return FALSE; + if (count<0) + return FALSE; + if (listBase<0) + return FALSE; + + font_list = listBase; + + mat.eM11 = FixedFromDouble(1); + mat.eM12 = FixedFromDouble(0); + mat.eM21 = FixedFromDouble(0); + mat.eM22 = FixedFromDouble(-1); + + memset(&gm,0,sizeof(gm)); + + /* + ** If we can't get the glyph outline, it may be because this is a fixed + ** font. Try processing it that way. + */ + if( GetGlyphOutline(hdc, first, GGO_BITMAP, &gm, 0, NULL, &mat) + == GDI_ERROR ) + { + return wglUseFontBitmaps_FX( hdc, first, count, listBase ); + } + + /* + ** Otherwise process all desired characters. + */ + for (i = 0; i < count; i++) + { + DWORD err; + + glNewList( font_list+i, GL_COMPILE ); + + /* allocate space for the bitmap/outline */ + size = GetGlyphOutline(hdc, first + i, GGO_BITMAP, &gm, 0, NULL, &mat); + if (size == GDI_ERROR) + { + glEndList( ); + err = GetLastError(); + success = FALSE; + continue; + } + + hBits = GlobalAlloc(GHND, size+1); + lpBits = GlobalLock(hBits); + + err = + GetGlyphOutline(hdc, /* handle to device context */ + first + i, /* character to query */ + GGO_BITMAP, /* format of data to return */ + &gm, /* pointer to structure for metrics*/ + size, /* size of buffer for data */ + lpBits, /* pointer to buffer for data */ + &mat /* pointer to transformation */ + /* matrix structure */ + ); + + if (err == GDI_ERROR) + { + GlobalUnlock(hBits); + GlobalFree(hBits); + + glEndList( ); + err = GetLastError(); + success = FALSE; + continue; + } + + glBitmap(gm.gmBlackBoxX,gm.gmBlackBoxY, + -gm.gmptGlyphOrigin.x, + gm.gmptGlyphOrigin.y, + gm.gmCellIncX,gm.gmCellIncY, + (const GLubyte * )lpBits); + + GlobalUnlock(hBits); + GlobalFree(hBits); + + glEndList( ); + } + + return success; +} + + +WGLAPI BOOL GLAPIENTRY wglUseFontBitmapsW(HDC hdc,DWORD first,DWORD count,DWORD listBase) +{ + return FALSE; +} + +WGLAPI BOOL GLAPIENTRY wglUseFontOutlinesA(HDC hdc,DWORD first,DWORD count, + DWORD listBase,FLOAT deviation, + FLOAT extrusion,int format, + LPGLYPHMETRICSFLOAT lpgmf) +{ + SetLastError(0); + return(FALSE); +} + +WGLAPI BOOL GLAPIENTRY wglUseFontOutlinesW(HDC hdc,DWORD first,DWORD count, + DWORD listBase,FLOAT deviation, + FLOAT extrusion,int format, + LPGLYPHMETRICSFLOAT lpgmf) +{ + SetLastError(0); + return(FALSE); +} + +WGLAPI BOOL GLAPIENTRY wglDescribeLayerPlane(HDC hdc,int iPixelFormat, + int iLayerPlane,UINT nBytes, + LPLAYERPLANEDESCRIPTOR plpd) +{ + SetLastError(0); + return(FALSE); +} + +WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC hdc,int iLayerPlane, + int iStart,int cEntries, + CONST COLORREF *pcr) +{ + SetLastError(0); + return(0); +} + +WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC hdc,int iLayerPlane, + int iStart,int cEntries, + COLORREF *pcr) +{ + SetLastError(0); + return(0); +} + +WGLAPI BOOL GLAPIENTRY wglRealizeLayerPalette(HDC hdc,int iLayerPlane,BOOL bRealize) +{ + SetLastError(0); + return(FALSE); +} + +WGLAPI BOOL GLAPIENTRY wglSwapLayerBuffers(HDC hdc,UINT fuPlanes) +{ + if( !hdc ) + { + WMesaSwapBuffers(); + return(TRUE); + } + SetLastError(0); + return(FALSE); +} + +WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC hdc, + CONST PIXELFORMATDESCRIPTOR *ppfd) +{ + int i,best = -1,bestdelta = 0x7FFFFFFF,delta,qt_valid_pix; + + qt_valid_pix = qt_pix; + if(ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR) || ppfd->nVersion != 1) + { + SetLastError(0); + return(0); + } + for(i = 0;i < qt_valid_pix;i++) + { + delta = 0; + if( + (ppfd->dwFlags & PFD_DRAW_TO_WINDOW) && + !(pix[i].pfd.dwFlags & PFD_DRAW_TO_WINDOW)) + continue; + if( + (ppfd->dwFlags & PFD_DRAW_TO_BITMAP) && + !(pix[i].pfd.dwFlags & PFD_DRAW_TO_BITMAP)) + continue; + if( + (ppfd->dwFlags & PFD_SUPPORT_GDI) && + !(pix[i].pfd.dwFlags & PFD_SUPPORT_GDI)) + continue; + if( + (ppfd->dwFlags & PFD_SUPPORT_OPENGL) && + !(pix[i].pfd.dwFlags & PFD_SUPPORT_OPENGL)) + continue; + if( + !(ppfd->dwFlags & PFD_DOUBLEBUFFER_DONTCARE) && + ((ppfd->dwFlags & PFD_DOUBLEBUFFER) != (pix[i].pfd.dwFlags & PFD_DOUBLEBUFFER))) + continue; + if( + !(ppfd->dwFlags & PFD_STEREO_DONTCARE) && + ((ppfd->dwFlags & PFD_STEREO) != (pix[i].pfd.dwFlags & PFD_STEREO))) + continue; + if(ppfd->iPixelType != pix[i].pfd.iPixelType) + delta++; + if(delta < bestdelta) + { + best = i + 1; + bestdelta = delta; + if(bestdelta == 0) + break; + } + } + if(best == -1) + { + SetLastError(0); + return(0); + } + return(best); +} + +WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC hdc,int iPixelFormat,UINT nBytes, + LPPIXELFORMATDESCRIPTOR ppfd) +{ + int qt_valid_pix; + + qt_valid_pix = qt_pix; + if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix || nBytes != sizeof(PIXELFORMATDESCRIPTOR)) + { + SetLastError(0); + return(0); + } + *ppfd = pix[iPixelFormat - 1].pfd; + return(qt_valid_pix); +} + +/* +* GetProcAddress - return the address of an appropriate extension +*/ +WGLAPI PROC GLAPIENTRY wglGetProcAddress(LPCSTR lpszProc) +{ + int i; + for(i = 0;i < qt_ext;i++) + if(!strcmp(lpszProc,ext[i].name)) + return(ext[i].proc); + + SetLastError(0); + return(NULL); +} + +WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc) +{ + if(curPFD == 0) + { + SetLastError(0); + return(0); + } + return(curPFD); +} + +WGLAPI BOOL GLAPIENTRY wglSetPixelFormat(HDC hdc,int iPixelFormat, + PIXELFORMATDESCRIPTOR *ppfd) +{ + int qt_valid_pix; + + qt_valid_pix = qt_pix; + if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix || ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR)) + { + SetLastError(0); + return(FALSE); + } + curPFD = iPixelFormat; + return(TRUE); +} + +WGLAPI BOOL GLAPIENTRY wglSwapBuffers(HDC hdc) +{ + if (ctx_current < 0) + return FALSE; + + if(wgl_ctx[ctx_current].ctx == NULL) { + SetLastError(0); + return(FALSE); + } + WMesaSwapBuffers(); + return(TRUE); +} + +#endif /* WIN32 */ diff --git a/src/mesa/drivers/windows/wmesa.c b/src/mesa/drivers/windows/wmesa.c index 43f99f30f46..7eb13cab098 100644 --- a/src/mesa/drivers/windows/wmesa.c +++ b/src/mesa/drivers/windows/wmesa.c @@ -1,2955 +1,2971 @@ -/* $Id: wmesa.c,v 1.17 2001/05/21 14:46:33 brianp Exp $ */ - -/* - * Windows (Win32) device driver for Mesa 3.4 - * - * Original author: - * - * Copyright (C) 1996- Li Wei - * Address : Institute of Artificial Intelligence - * : & Robotics - * : Xi'an Jiaotong University - * Email : liwei@aiar.xjtu.edu.cn - * Web page : http://sun.aiar.xjtu.edu.cn - * - * This file and its associations are partially borrowed from the - * Windows NT driver for Mesa 1.8 , written by Mark Leaming - * (mark@rsinc.com). - */ - - -#define WMESA_STEREO_C - -#include -#include -#include -#include -#include "mesa_extend.h" -#include "colors.h" -#include "macros.h" -#include "context.h" -#include "dd.h" -#include "xform.h" -#include "vb.h" -#include "matrix.h" -#include "depth.h" -#include "wmesadef.h" - -#pragma warning ( disable : 4100 4133 4761 ) - -#ifdef PROFILE -// #include "profile.h" -#endif - -#ifdef DITHER -#include -#endif - -#ifdef __CYGWIN32__ -#include "macros.h" -#include -#define CopyMemory memcpy -#endif - -#if !defined(NO_STEREO) - -#include "gl\glu.h" -#include "stereo.h" - -#endif -#if !defined(NO_PARALLEL) -// #include "parallel.h" -#endif - -struct DISPLAY_OPTIONS displayOptions; - -GLenum stereoCompile = GL_FALSE ; -GLenum stereoShowing = GL_FALSE ; -GLenum stereoBuffer = GL_FALSE; -#if !defined(NO_STEREO) -GLint displayList = MAXIMUM_DISPLAY_LIST ; -#endif -GLint stereo_flag = 0 ; - -/* end of added code*/ - -static PWMC Current = NULL; -WMesaContext WC = NULL; - -#ifdef NDEBUG -#define assert(ignore) ((void) 0) -#else -void Mesa_Assert(void *Cond,void *File,unsigned Line) -{ - char Msg[512]; - sprintf(Msg,"%s %s %d",Cond,File,Line); - MessageBox(NULL,Msg,"Assertion failed.",MB_OK); - exit(1); -} -#define assert(e) if (!e) Mesa_Assert(#e,__FILE__,__LINE__); -#endif - -//#define DD_GETDC (Current->hDC ) -#define DD_GETDC ((Current->db_flag) ? Current->dib.hDC : Current->hDC ) -//#define DD_GETDC ((Current->db_flag) ? Current->hDCPrimary : Current->hDCBack ) -#define DD_RELEASEDC - -//#define BEGINGDICALL if(Current->rgb_flag)wmFlushBits(Current); -#define BEGINGDICALL -//#define ENDGDICALL if(Current->rgb_flag)wmGetBits(Current); -#define ENDGDICALL - -//#define FLIP(Y) (Current->dither_flag? Y : Current->height-(Y)-1) -//#define FLIP(Y) (Current->height-(Y)-1) -//#define FLIP(Y) Y -/* - * XXX Why only flip Y coord if single buffered??? - */ -#define FLIP(Y) (Current->db_flag? Y: Current->height-(Y)-1) -#define STARTPROFILE -#define ENDPROFILE(PARA) - -#define DITHER_RGB_TO_8BIT_SETUP \ -GLubyte pixelDithered; - -#define DITHER_RGB_TO_8BIT(red, green, blue, pixel, scanline) \ -{ \ - char unsigned redtemp, greentemp, bluetemp, paletteindex; \ - redtemp = aDividedBy51[red] \ - + (aModulo51[red] > aHalftone8x8[(pixel%8)*8 \ - + scanline%8]); \ - greentemp = aDividedBy51[(char unsigned)green] \ - + (aModulo51[green] > aHalftone8x8[ \ - (pixel%8)*8 + scanline%8]); \ - bluetemp = aDividedBy51[(char unsigned)blue] \ - + (aModulo51[blue] > aHalftone8x8[ \ - (pixel%8)*8 +scanline%8]); \ - paletteindex = redtemp + aTimes6[greentemp] + aTimes36[bluetemp]; \ - pixelDithered = aWinGHalftoneTranslation[paletteindex]; \ -} - - -#ifdef DDRAW -static BOOL DDInit( WMesaContext wc, HWND hwnd); -static void DDFree( WMesaContext wc); -static HRESULT DDRestoreAll( WMesaContext wc ); -static void DDDeleteOffScreen(WMesaContext wc); -static BOOL DDCreateOffScreen(WMesaContext wc); -#endif - -static void FlushToFile(PWMC pwc, PSTR szFile); - -BOOL wmCreateBackingStore(PWMC pwc, long lxSize, long lySize); -BOOL wmDeleteBackingStore(PWMC pwc); -void wmCreatePalette( PWMC pwdc ); -BOOL wmSetDibColors(PWMC pwc); -void wmSetPixel(PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b); - -void wmCreateDIBSection( - HDC hDC, - PWMC pwc, // handle of device context - CONST BITMAPINFO *pbmi, // address of structure containing bitmap size, format, and color data - UINT iUsage // color data type indicator: RGB values or palette indices - ); - - -void WMesaViewport( GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height ); - - -static triangle_func choose_triangle_function( GLcontext *ctx ); - - -static void wmSetPixelFormat( PWMC wc, HDC hDC) -{ - if(wc->rgb_flag) - wc->cColorBits = GetDeviceCaps(hDC, BITSPIXEL); - else - wc->cColorBits = 8; - switch(wc->cColorBits){ - case 8: - if(wc->dither_flag != GL_TRUE) - wc->pixelformat = PF_INDEX8; - else - wc->pixelformat = PF_DITHER8; - break; - case 16: - wc->pixelformat = PF_5R6G5B; - break; - case 32: - wc->pixelformat = PF_8R8G8B; - break; - default: - wc->pixelformat = PF_BADFORMAT; - } -} - -// -// This function sets the color table of a DIB section -// to match that of the destination DC -// -BOOL /*WINAPI*/ wmSetDibColors(PWMC pwc) -{ - RGBQUAD *pColTab, *pRGB; - PALETTEENTRY *pPal, *pPE; - int i, nColors; - BOOL bRet=TRUE; - DWORD dwErr=0; - - /* Build a color table in the DIB that maps to the - selected palette in the DC. - */ - nColors = 1 << pwc->cColorBits; - pPal = (PALETTEENTRY *)malloc( nColors * sizeof(PALETTEENTRY)); - memset( pPal, 0, nColors * sizeof(PALETTEENTRY) ); - GetPaletteEntries( pwc->hGLPalette, 0, nColors, pPal ); - pColTab = (RGBQUAD *)malloc( nColors * sizeof(RGBQUAD)); - for (i = 0, pRGB = pColTab, pPE = pPal; i < nColors; i++, pRGB++, pPE++) { - pRGB->rgbRed = pPE->peRed; - pRGB->rgbGreen = pPE->peGreen; - pRGB->rgbBlue = pPE->peBlue; - } - if(pwc->db_flag) - bRet = SetDIBColorTable(pwc->dib.hDC, 0, nColors, pColTab ); - - if(!bRet) - dwErr = GetLastError(); - - free( pColTab ); - free( pPal ); - - return(bRet); -} - - -// -// Free up the dib section that was created -// -BOOL wmDeleteBackingStore(PWMC pwc) -{ - SelectObject(pwc->dib.hDC, pwc->hOldBitmap); - DeleteDC(pwc->dib.hDC); - DeleteObject(pwc->hbmDIB); - UnmapViewOfFile(pwc->dib.base); - CloseHandle(pwc->dib.hFileMap); - return TRUE; -} - - -// -// This function creates the DIB section that is used for combined -// GL and GDI calls -// -BOOL /*WINAPI*/ wmCreateBackingStore(PWMC pwc, long lxSize, long lySize) -{ - HDC hdc = pwc->hDC; - LPBITMAPINFO pbmi = &(pwc->bmi); - int iUsage; - - pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pbmi->bmiHeader.biWidth = lxSize; - pbmi->bmiHeader.biHeight= -lySize; - pbmi->bmiHeader.biPlanes = 1; - if(pwc->rgb_flag) - pbmi->bmiHeader.biBitCount = GetDeviceCaps(pwc->hDC, BITSPIXEL); - else - pbmi->bmiHeader.biBitCount = 8; - pbmi->bmiHeader.biCompression = BI_RGB; - pbmi->bmiHeader.biSizeImage = 0; - pbmi->bmiHeader.biXPelsPerMeter = 0; - pbmi->bmiHeader.biYPelsPerMeter = 0; - pbmi->bmiHeader.biClrUsed = 0; - pbmi->bmiHeader.biClrImportant = 0; - - iUsage = (pbmi->bmiHeader.biBitCount <= 8) ? DIB_PAL_COLORS : DIB_RGB_COLORS; - - pwc->cColorBits = pbmi->bmiHeader.biBitCount; - pwc->ScanWidth = pwc->pitch = lxSize; - - wmCreateDIBSection(hdc, pwc, pbmi, iUsage); - - if ((iUsage == DIB_PAL_COLORS) && !(pwc->hGLPalette)) { - wmCreatePalette( pwc ); - wmSetDibColors( pwc ); - } - wmSetPixelFormat(pwc, pwc->hDC); - return(TRUE); - -} - - -// -// This function copies one scan line in a DIB section to another -// -BOOL WINAPI wmSetDIBits(PWMC pwc, UINT uiScanWidth, UINT uiNumScans, UINT nBypp, UINT uiNewWidth, LPBYTE pBits) -{ - UINT uiScans = 0; - LPBYTE pDest = pwc->pbPixels; - DWORD dwNextScan = uiScanWidth; - DWORD dwNewScan = uiNewWidth; - DWORD dwScanWidth = (uiScanWidth * nBypp); - - // - // We need to round up to the nearest DWORD - // and multiply by the number of bytes per - // pixel - // - dwNextScan = (((dwNextScan * nBypp)+ 3) & ~3); - dwNewScan = (((dwNewScan * nBypp)+ 3) & ~3); - - for(uiScans = 0; uiScans < uiNumScans; uiScans++){ - CopyMemory(pDest, pBits, dwScanWidth); - pBits += dwNextScan; - pDest += dwNewScan; - } - - return(TRUE); - -} - - -BOOL wmFlush(PWMC pwc); - -/* -* Useful macros: -Modified from file osmesa.c -*/ - - -#define PIXELADDR(X,Y) ((GLubyte *)Current->pbPixels + (Current->height-Y-1)* Current->ScanWidth + (X)*nBypp) -#define PIXELADDR1( X, Y ) \ -((GLubyte *)wmesa->pbPixels + (wmesa->height-Y-1)* wmesa->ScanWidth + (X)) -#define PIXELADDR2( X, Y ) \ -((GLubyte *)wmesa->pbPixels + (wmesa->height-Y-1)* wmesa->ScanWidth + (X)*2) -#define PIXELADDR4( X, Y ) \ -((GLubyte *)wmesa->pbPixels + (wmesa->height-Y-1)* wmesa->ScanWidth + (X)*4) - - -BYTE DITHER_RGB_2_8BIT( int r, int g, int b, int x, int y); - -/* Finish all pending operations and synchronize. */ -static void finish(GLcontext* ctx) -{ - /* No op */ -} - - -// -// We cache all gl draw routines until a flush is made -// -static void flush(GLcontext* ctx) -{ - STARTPROFILE - if((Current->rgb_flag /*&& !(Current->dib.fFlushed)*/&&!(Current->db_flag)) - ||(!Current->rgb_flag)) - { - wmFlush(Current); - } - ENDPROFILE(flush) - -} - - - -/* -* Set the color index used to clear the color buffer. -*/ -static void clear_index(GLcontext* ctx, GLuint index) -{ - STARTPROFILE - Current->clearpixel = index; - ENDPROFILE(clear_index) -} - - - -/* -* Set the color used to clear the color buffer. -*/ -static void clear_color( GLcontext* ctx, const GLchan color[4] ) -{ - STARTPROFILE - Current->clearpixel = RGB(color[0], color[1], color[2]); - ENDPROFILE(clear_color) -} - - - -/* -* Clear the specified region of the color buffer using the clear color -* or index as specified by one of the two functions above. -*/ -//static void clear(GLcontext* ctx, -// GLboolean all,GLint x, GLint y, GLint width, GLint height ) -// TODO: I modified this function to match the prototype in -// dd.h. (swansma@geocities.com) - -static GLbitfield clear(GLcontext* ctx, GLbitfield mask, - GLboolean all, GLint x, GLint y, GLint width, GLint height) -{ - DWORD dwColor; - WORD wColor; - BYTE bColor; - LPDWORD lpdw = (LPDWORD)Current->pbPixels; - LPWORD lpw = (LPWORD)Current->pbPixels; - LPBYTE lpb = Current->pbPixels; - int lines; - - STARTPROFILE - - if (all){ - x=y=0; - width=Current->width; - height=Current->height; - } - if(Current->db_flag==GL_TRUE){ - UINT nBypp = Current->cColorBits / 8; - int i = 0; - int iSize = 0; - - if(nBypp ==1 ){ - /* Need rectification */ - iSize = Current->width/4; - bColor = BGR8(GetRValue(Current->clearpixel), - GetGValue(Current->clearpixel), - GetBValue(Current->clearpixel)); - wColor = MAKEWORD(bColor,bColor); - dwColor = MAKELONG(wColor, wColor); - } - if(nBypp == 2){ - iSize = Current->width / 2; - wColor = BGR16(GetRValue(Current->clearpixel), - GetGValue(Current->clearpixel), - GetBValue(Current->clearpixel)); - dwColor = MAKELONG(wColor, wColor); - } - else if(nBypp == 4){ - iSize = Current->width; - dwColor = BGR32(GetRValue(Current->clearpixel), - GetGValue(Current->clearpixel), - GetBValue(Current->clearpixel)); - } - - while(i < iSize){ - *lpdw = dwColor; - lpdw++; - i++; - } - - // - // This is the 24bit case - // - if (nBypp == 3) { - iSize = Current->width *3/4; - dwColor = BGR24(GetRValue(Current->clearpixel), - GetGValue(Current->clearpixel), - GetBValue(Current->clearpixel)); - while(i < iSize){ - *lpdw = dwColor; - lpb += nBypp; - lpdw = (LPDWORD)lpb; - i++; - } - } - - i = 0; - if (stereo_flag) - lines = height /2; - else - lines = height; - do { - memcpy(lpb, Current->pbPixels, iSize*4); - lpb += Current->ScanWidth; - i++; - } - while (iclearpixel); - HBRUSH Brush=CreateSolidBrush(Current->clearpixel); - HPEN Old_Pen=SelectObject(DC,Pen); - HBRUSH Old_Brush=SelectObject(DC,Brush); - Rectangle(DC,x,y,x+width,y+height); - SelectObject(DC,Old_Pen); - SelectObject(DC,Old_Brush); - DeleteObject(Pen); - DeleteObject(Brush); - DD_RELEASEDC; - } - - - - ENDPROFILE(clear) - - return mask; // TODO: I doubt this is correct. dd.h doesn't explain what this should - // be... -} - - - -static void enable( GLcontext* ctx, GLenum pname, GLboolean enable ) -{ - if (!Current) - return; - - if (pname == GL_DITHER) { - if(enable == GL_FALSE){ - Current->dither_flag = GL_FALSE; - if(Current->cColorBits == 8) - Current->pixelformat = PF_INDEX8; - } - else{ - if (Current->rgb_flag && Current->cColorBits == 8){ - Current->pixelformat = PF_DITHER8; - Current->dither_flag = GL_TRUE; - } - else - Current->dither_flag = GL_FALSE; - } - } -} - - - -static GLboolean set_draw_buffer( GLcontext* ctx, GLenum mode ) -{ - STARTPROFILE - /* TODO: this could be better */ - if (mode==GL_FRONT_LEFT || mode==GL_BACK_LEFT) { - return GL_TRUE; - } - else { - return GL_FALSE; - } - ENDPROFILE(set_draw_buffer) -} - - -static void set_read_buffer(GLcontext *ctx, GLframebuffer *colorBuffer, - GLenum buffer ) -{ - /* XXX todo */ - return; -} - - - -/* Return characteristics of the output buffer. */ -static void buffer_size( GLcontext* ctx, GLuint *width, GLuint *height ) -{ - int New_Size; - RECT CR; - - STARTPROFILE - GetClientRect(Current->Window,&CR); - - *width=CR.right; - *height=CR.bottom; - - New_Size=((*width)!=Current->width) || ((*height)!=Current->height); - - if (New_Size){ - Current->width=*width; - Current->height=*height; - Current->ScanWidth=Current->width; - if ((Current->ScanWidth%sizeof(long))!=0) - Current->ScanWidth+=(sizeof(long)-(Current->ScanWidth%sizeof(long))); - - if (Current->db_flag){ -#ifdef DDRAW - DDDeleteOffScreen(Current); - DDCreateOffScreen(Current); -#else - if (Current->rgb_flag==GL_TRUE && Current->dither_flag!=GL_TRUE){ - wmDeleteBackingStore(Current); - wmCreateBackingStore(Current, Current->width, Current->height); - } -#endif - } - - // Resize OsmesaBuffer if in Parallel mode -#if !defined(NO_PARALLEL) - if(parallelFlag) - PRSizeRenderBuffer(Current->width, Current->height,Current->ScanWidth, - Current->rgb_flag == GL_TRUE ? Current->pbPixels: Current->ScreenMem); -#endif - } - ENDPROFILE(buffer_size) -} - - - -/**********************************************************************/ -/***** Accelerated point, line, polygon rendering *****/ -/**********************************************************************/ - - -static void fast_rgb_points( GLcontext* ctx, GLuint first, GLuint last ) -{ - GLuint i; - // HDC DC=DD_GETDC; - PWMC pwc = Current; - - STARTPROFILE - - if (0 /*Current->gl_ctx->VB->MonoColor*/) { - /* all drawn with current color */ - for (i=first;i<=last;i++) { - if (!Current->gl_ctx->VB->ClipMask[i]) { - int x, y; - x = (GLint) Current->gl_ctx->VB->Win.data[i][0]; - y = FLIP( (GLint) Current->gl_ctx->VB->Win.data[i][1] ); - wmSetPixel(pwc, y,x,GetRValue(Current->pixel), - GetGValue(Current->pixel), GetBValue(Current->pixel)); - } - } - } - else { - /* draw points of different colors */ - for (i=first;i<=last;i++) { - if (!Current->gl_ctx->VB->ClipMask[i]) { - int x, y; - unsigned long pixel=RGB(Current->gl_ctx->VB->ColorPtr->data[i][0]*255.0, - Current->gl_ctx->VB->ColorPtr->data[i][1]*255.0, - Current->gl_ctx->VB->ColorPtr->data[i][2]*255.0); - x = (GLint) Current->gl_ctx->VB->Win.data[i][0]; - y = FLIP( (GLint) Current->gl_ctx->VB->Win.data[i][1] ); - wmSetPixel(pwc, y,x,Current->gl_ctx->VB->ColorPtr->data[i][0]*255.0, - Current->gl_ctx->VB->ColorPtr->data[i][1]*255.0, - Current->gl_ctx->VB->ColorPtr->data[i][2]*255.0); - } - } - } - // DD_RELEASEDC; - ENDPROFILE(fast_rgb_points) -} - - - -/* Return pointer to accerated points function */ -extern points_func choose_points_function( GLcontext* ctx ) -{ - STARTPROFILE - if (ctx->Point.Size==1.0 && !ctx->Point.SmoothFlag && ctx->_RasterMask==0 - && !ctx->Texture._ReallyEnabled && ctx->Visual->RGBAflag) { - ENDPROFILE(choose_points_function) - return fast_rgb_points; - } - else { - ENDPROFILE(choose_points_function) - return NULL; - } -} - - - -/* Draw a line using the color specified by Current->gl_ctx->VB->ColorPtr->data[pv] */ -static void fast_flat_rgb_line( GLcontext* ctx, GLuint v0, GLuint v1, GLuint pv ) -{ - STARTPROFILE - int x0, y0, x1, y1; - unsigned long pixel; - HDC DC=DD_GETDC; - HPEN Pen; - HPEN Old_Pen; - - if (0 /*Current->gl_ctx->VB->MonoColor*/) { - pixel = Current->pixel; /* use current color */ - } - else { - pixel = RGB(Current->gl_ctx->VB->ColorPtr->data[pv][0]*255.0, Current->gl_ctx->VB->ColorPtr->data[pv][1]*255.0, Current->gl_ctx->VB->ColorPtr->data[pv][2]*255.0); - } - - x0 = (int) Current->gl_ctx->VB->Win.data[v0][0]; - y0 = FLIP( (int) Current->gl_ctx->VB->Win.data[v0][1] ); - x1 = (int) Current->gl_ctx->VB->Win.data[v1][0]; - y1 = FLIP( (int) Current->gl_ctx->VB->Win.data[v1][1] ); - - - BEGINGDICALL - - Pen=CreatePen(PS_SOLID,1,pixel); - Old_Pen=SelectObject(DC,Pen); - MoveToEx(DC,x0,y0,NULL); - LineTo(DC,x1,y1); - SelectObject(DC,Old_Pen); - DeleteObject(Pen); - DD_RELEASEDC; - - ENDGDICALL - - ENDPROFILE(fast_flat_rgb_line) -} - - - -/* Return pointer to accerated line function */ -static line_func choose_line_function( GLcontext* ctx ) -{ - STARTPROFILE - if (ctx->Line.Width==1.0 && !ctx->Line.SmoothFlag && !ctx->Line.StippleFlag - && ctx->Light.ShadeModel==GL_FLAT && ctx->_RasterMask==0 - && !ctx->Texture._ReallyEnabled && Current->rgb_flag) { - ENDPROFILE(choose_line_function) - return fast_flat_rgb_line; - } - else { - ENDPROFILE(choose_line_function) - return NULL; - } -} - - -/**********************************************************************/ -/***** Span-based pixel drawing *****/ -/**********************************************************************/ - - -/* Write a horizontal span of 32-bit color-index pixels with a boolean mask. */ -static void write_ci32_span( const GLcontext* ctx, - GLuint n, GLint x, GLint y, - const GLuint index[], - const GLubyte mask[] ) -{ - STARTPROFILE - GLuint i; - PBYTE Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x; - assert(Current->rgb_flag==GL_FALSE); - for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; - assert(Current->rgb_flag==GL_FALSE); - for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; - assert(Current->rgb_flag==GL_FALSE); - for (i=0; irgb_flag==GL_TRUE) - { - GLuint i; - HDC DC=DD_GETDC; - y=FLIP(y); - if (mask) { - for (i=0; iScreenMem+y*Current->ScanWidth+x; - y = FLIP(y); - if (mask) { - for (i=0; ihPal,RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP])); - } - else { - for (i=0; ihPal,RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP])); - } - } - ENDPROFILE(write_rgba_span) - -} - -/* Write a horizontal span of RGB color pixels with a boolean mask. */ -static void write_rgb_span( const GLcontext* ctx, - GLuint n, GLint x, GLint y, - const GLubyte rgb[][3], const GLubyte mask[] ) -{ - STARTPROFILE - PWMC pwc = Current; - - if (pwc->rgb_flag==GL_TRUE) - { - GLuint i; - HDC DC=DD_GETDC; - y=FLIP(y); - if (mask) { - for (i=0; iScreenMem+y*Current->ScanWidth+x; - y = FLIP(y); - if (mask) { - for (i=0; ihPal,RGB(rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP])); - } - else { - for (i=0; ihPal,RGB(rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP])); - } - } - ENDPROFILE(write_rgb_span) - -} - -/* -* Write a horizontal span of pixels with a boolean mask. The current color -* is used for all pixels. -*/ -static void write_mono_rgba_span( const GLcontext* ctx, - GLuint n, GLint x, GLint y, - const GLchan color[4], const GLubyte mask[]) -{ - ULONG pixel = RGB( color[RCOMP], color[GCOMP], color[BCOMP] ); - STARTPROFILE - GLuint i; - HDC DC=DD_GETDC; - PWMC pwc = Current; - assert(Current->rgb_flag==GL_TRUE); - y=FLIP(y); - if(Current->rgb_flag==GL_TRUE){ - for (i=0; irgb_flag==GL_FALSE); - for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]; - *Mem = index[i]; - } - } - ENDPROFILE(write_ci32_pixels) -} - - - -/* -* Write an array of pixels with a boolean mask. The current color -* index is used for all pixels. -*/ -static void write_mono_ci_pixels( const GLcontext* ctx, - GLuint n, - const GLint x[], const GLint y[], - GLuint colorIndex, const GLubyte mask[] ) -{ - STARTPROFILE - GLuint i; - assert(Current->rgb_flag==GL_FALSE); - for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]; - *Mem = colorIndex; - } - } - ENDPROFILE(write_mono_ci_pixels) -} - - - -/* Write an array of RGBA pixels with a boolean mask. */ -static void write_rgba_pixels( const GLcontext* ctx, - GLuint n, const GLint x[], const GLint y[], - const GLubyte rgba[][4], const GLubyte mask[] ) -{ - STARTPROFILE - GLuint i; - PWMC pwc = Current; - HDC DC=DD_GETDC; - assert(Current->rgb_flag==GL_TRUE); - for (i=0; irgb_flag==GL_TRUE); - for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; - assert(Current->rgb_flag==GL_FALSE); - for (i=0; irgb_flag==GL_FALSE); - for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]); - } - } - ENDPROFILE(read_ci32_pixels) -} - - - -/* Read a horizontal span of color pixels. */ -static void read_rgba_span( const GLcontext* ctx, - GLuint n, GLint x, GLint y, - GLubyte rgba[][4] ) -{ - STARTPROFILE - UINT i; - COLORREF Color; - HDC DC=DD_GETDC; - assert(Current->rgb_flag==GL_TRUE); - /* y=FLIP(y);*/ - y = Current->height - y - 1; - for (i=0; irgb_flag==GL_TRUE); - for (i=0; iheight - y[i] - 1; - Color=GetPixel(DC,x[i],y2); - rgba[i][RCOMP] = GetRValue(Color); - rgba[i][GCOMP] = GetGValue(Color); - rgba[i][BCOMP] = GetBValue(Color); - rgba[i][ACOMP] = 255; - } - } - DD_RELEASEDC; -// Brian P. has mentioned to comment this out. -// memset(alpha,0,n*sizeof(GLint)); - ENDPROFILE(read_rgba_pixels) -} - - - -/**********************************************************************/ -/**********************************************************************/ - - -static const GLubyte *get_string(GLcontext *ctx, GLenum name) -{ - if (name == GL_RENDERER) { - return (GLubyte *) "Mesa Windows"; - } - else { - return NULL; - } -} - - - -void setup_DD_pointers( GLcontext* ctx ) -{ - ctx->Driver.GetString = get_string; - ctx->Driver.UpdateState = setup_DD_pointers; - ctx->Driver.GetBufferSize = buffer_size; - ctx->Driver.Finish = finish; - ctx->Driver.Flush = flush; - - ctx->Driver.ClearIndex = clear_index; - ctx->Driver.ClearColor = clear_color; - ctx->Driver.Clear = clear; - - ctx->Driver.Enable = enable; - - ctx->Driver.SetDrawBuffer = set_draw_buffer; - ctx->Driver.SetReadBuffer = set_read_buffer; - ctx->Driver.GetBufferSize = buffer_size; - - ctx->Driver.PointsFunc = choose_points_function(ctx); - ctx->Driver.LineFunc = choose_line_function(ctx); - ctx->Driver.TriangleFunc = choose_triangle_function( ctx ); - - /* Pixel/span writing functions: */ - ctx->Driver.WriteRGBASpan = write_rgba_span; - ctx->Driver.WriteRGBSpan = write_rgb_span; - ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span; - ctx->Driver.WriteRGBAPixels = write_rgba_pixels; - ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels; - ctx->Driver.WriteCI32Span = write_ci32_span; - ctx->Driver.WriteCI8Span = write_ci8_span; - ctx->Driver.WriteMonoCISpan = write_mono_ci_span; - ctx->Driver.WriteCI32Pixels = write_ci32_pixels; - ctx->Driver.WriteMonoCIPixels = write_mono_ci_pixels; - - ctx->Driver.ReadCI32Span = read_ci32_span; - ctx->Driver.ReadRGBASpan = read_rgba_span; - ctx->Driver.ReadCI32Pixels = read_ci32_pixels; - ctx->Driver.ReadRGBAPixels = read_rgba_pixels; -} - - -/**********************************************************************/ -/***** WMesa API Functions *****/ -/**********************************************************************/ - - - -#define PAL_SIZE 256 -static void GetPalette(HPALETTE Pal,RGBQUAD *aRGB) -{ - STARTPROFILE - int i; - HDC hdc; - struct - { - WORD Version; - WORD NumberOfEntries; - PALETTEENTRY aEntries[PAL_SIZE]; - } Palette = - { - 0x300, - PAL_SIZE - }; - hdc=GetDC(NULL); - if (Pal!=NULL) - GetPaletteEntries(Pal,0,PAL_SIZE,Palette.aEntries); - else - GetSystemPaletteEntries(hdc,0,PAL_SIZE,Palette.aEntries); - if (GetSystemPaletteUse(hdc) == SYSPAL_NOSTATIC) - { - for(i = 0; i Window=hWnd; - c->hDC = GetDC(hWnd); - true_color_flag = GetDeviceCaps(c->hDC, BITSPIXEL) > 8; -#ifdef DDRAW - if(true_color_flag) c->rgb_flag = rgb_flag = GL_TRUE; -#endif - - -#ifdef DITHER - if ((true_color_flag==GL_FALSE) && (rgb_flag == GL_TRUE)){ - c->dither_flag = GL_TRUE; - c->hPalHalfTone = WinGCreateHalftonePalette(); - } - else - c->dither_flag = GL_FALSE; -#else - c->dither_flag = GL_FALSE; -#endif - - - if (rgb_flag==GL_FALSE) - { - c->rgb_flag = GL_FALSE; - // c->pixel = 1; - c->db_flag = db_flag =GL_TRUE; // WinG requires double buffering - printf("Single buffer is not supported in color index mode, setting to double buffer.\n"); - } - else - { - c->rgb_flag = GL_TRUE; - // c->pixel = 0; - } - GetClientRect(c->Window,&CR); - c->width=CR.right; - c->height=CR.bottom; - if (db_flag) - { - c->db_flag = 1; - /* Double buffered */ -#ifndef DDRAW - // if (c->rgb_flag==GL_TRUE && c->dither_flag != GL_TRUE ) - { - wmCreateBackingStore(c, c->width, c->height); - - } -#endif - } - else - { - /* Single Buffered */ - if (c->rgb_flag) - c->db_flag = 0; - } -#ifdef DDRAW - if (DDInit(c,hWnd) == GL_FALSE) { - free( (void *) c ); - exit(1); - } -#endif - - - c->gl_visual = _mesa_create_visual(rgb_flag, - db_flag, /* db_flag */ - GL_FALSE, /* stereo */ - 8,8,8,8, /* r, g, b, a bits */ - 0, /* index bits */ - 16, /* depth_bits */ - 8, /* stencil_bits */ - 16,16,16,16,/* accum_bits */ - 1); - - if (!c->gl_visual) { - return NULL; - } - - /* allocate a new Mesa context */ - c->gl_ctx = _mesa_create_context( c->gl_visual, NULL, c, GL_TRUE); - - if (!c->gl_ctx) { - _mesa_destroy_visual( c->gl_visual ); - free(c); - return NULL; - } - - _mesa_enable_sw_extensions(c->gl_ctx); - - c->gl_buffer = _mesa_create_framebuffer( c->gl_visual, - c->gl_visual->DepthBits > 0, - c->gl_visual->StencilBits > 0, - c->gl_visual->AccumRedBits > 0, - c->gl_visual->AlphaBits > 0 ); - if (!c->gl_buffer) { - _mesa_destroy_visual( c->gl_visual ); - _mesa_destroy_context( c->gl_ctx ); - free(c); - return NULL; - } - - c->gl_ctx->Driver.UpdateState = setup_DD_pointers; - - // setup_DD_pointers(c->gl_ctx); - - return c; -} - -void WMesaDestroyContext( void ) -{ - WMesaContext c = Current; - ReleaseDC(c->Window,c->hDC); - WC = c; - if(c->hPalHalfTone != NULL) - DeleteObject(c->hPalHalfTone); - _mesa_destroy_visual( c->gl_visual ); - _mesa_destroy_framebuffer( c->gl_buffer ); - _mesa_destroy_context( c->gl_ctx ); - - if (c->db_flag) -#ifdef DDRAW - DDFree(c); -#else - wmDeleteBackingStore(c); -#endif - free( (void *) c ); - //Following code is added to enable parallel render - // Parallel render only work in double buffer mode -#if !defined(NO_PARALLEL) - if(parallelMachine) - PRDestroyRenderBuffer(); -#endif - // End modification -} - - - -void /*APIENTRY*/ WMesaMakeCurrent( WMesaContext c ) -{ - if(!c){ - Current = c; - return; - } - - // - // A little optimization - // If it already is current, - // don't set it again - // - if(Current == c) - return; - - //gl_set_context( c->gl_ctx ); - _mesa_make_current(c->gl_ctx, c->gl_buffer); - setup_DD_pointers(c->gl_ctx); - Current = c; - if (Current->gl_ctx->Viewport.Width==0) { - /* initialize viewport to window size */ - _mesa_set_viewport( Current->gl_ctx, - 0, 0, Current->width, Current->height ); - } - if ((c->cColorBits <= 8 ) && (c->rgb_flag == GL_TRUE)){ - WMesaPaletteChange(c->hPalHalfTone); - } -} - - - -void /*APIENTRY*/ WMesaSwapBuffers( void ) -{ - HDC DC = Current->hDC; - GET_CURRENT_CONTEXT(ctx); - - /* If we're swapping the buffer associated with the current context - * we have to flush any pending rendering commands first. - */ - if (Current && Current->gl_ctx == ctx) - _mesa_swapbuffers(ctx); - - if (Current->db_flag) - wmFlush(Current); -} - - - -void /*APIENTRY*/ WMesaPaletteChange(HPALETTE Pal) -{ - int vRet; - LPPALETTEENTRY pPal; - if (Current && (Current->rgb_flag==GL_FALSE || Current->dither_flag == GL_TRUE)) - { - pPal = (PALETTEENTRY *)malloc( 256 * sizeof(PALETTEENTRY)); - Current->hPal=Pal; - // GetPaletteEntries( Pal, 0, 256, pPal ); - GetPalette( Pal, pPal ); -#ifdef DDRAW - Current->lpDD->lpVtbl->CreatePalette(Current->lpDD,DDPCAPS_8BIT, - pPal, &(Current->lpDDPal), NULL); - if (Current->lpDDPal) - Current->lpDDSPrimary->lpVtbl->SetPalette(Current->lpDDSPrimary,Current->lpDDPal); -#else - vRet = SetDIBColorTable(Current->dib.hDC,0,256,pPal); -#endif - free( pPal ); - } - -} - - - - -static unsigned char threeto8[8] = { - 0, 0111>>1, 0222>>1, 0333>>1, 0444>>1, 0555>>1, 0666>>1, 0377 -}; - -static unsigned char twoto8[4] = { - 0, 0x55, 0xaa, 0xff -}; - -static unsigned char oneto8[2] = { - 0, 255 -}; - -static unsigned char componentFromIndex(UCHAR i, UINT nbits, UINT shift) -{ - unsigned char val; - - val = i >> shift; - switch (nbits) { - - case 1: - val &= 0x1; - return oneto8[val]; - - case 2: - val &= 0x3; - return twoto8[val]; - - case 3: - val &= 0x7; - return threeto8[val]; - - default: - return 0; - } -} - -void /*WINAPI*/ wmCreatePalette( PWMC pwdc ) -{ - /* Create a compressed and re-expanded 3:3:2 palette */ - int i; - LOGPALETTE *pPal; - BYTE rb, rs, gb, gs, bb, bs; - - pwdc->nColors = 0x100; - - pPal = (PLOGPALETTE)malloc(sizeof(LOGPALETTE) + pwdc->nColors * sizeof(PALETTEENTRY)); - memset( pPal, 0, sizeof(LOGPALETTE) + pwdc->nColors * sizeof(PALETTEENTRY) ); - - pPal->palVersion = 0x300; - - rb = REDBITS; - rs = REDSHIFT; - gb = GREENBITS; - gs = GREENSHIFT; - bb = BLUEBITS; - bs = BLUESHIFT; - - if (pwdc->db_flag) { - - /* Need to make two palettes: one for the screen DC and one for the DIB. */ - pPal->palNumEntries = pwdc->nColors; - for (i = 0; i < pwdc->nColors; i++) { - pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs ); - pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs ); - pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs ); - pPal->palPalEntry[i].peFlags = 0; - } - pwdc->hGLPalette = CreatePalette( pPal ); - pwdc->hPalette = CreatePalette( pPal ); - } - - else { - pPal->palNumEntries = pwdc->nColors; - for (i = 0; i < pwdc->nColors; i++) { - pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs ); - pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs ); - pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs ); - pPal->palPalEntry[i].peFlags = 0; - } - pwdc->hGLPalette = CreatePalette( pPal ); - } - - free(pPal); - -} - -void /*WINAPI*/ wmSetPixel(PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b) -{ - if (Current->db_flag) { - LPBYTE lpb = pwc->pbPixels; - LPDWORD lpdw; - LPWORD lpw; - UINT nBypp = pwc->cColorBits >> 3; - UINT nOffset = iPixel % nBypp; - - // Move the pixel buffer pointer to the scanline that we - // want to access - - // pwc->dib.fFlushed = FALSE; - - lpb += pwc->ScanWidth * iScanLine; - // Now move to the desired pixel - lpb += iPixel * nBypp; - lpb = PIXELADDR(iPixel, iScanLine); - lpdw = (LPDWORD)lpb; - lpw = (LPWORD)lpb; - - if(nBypp == 1){ - if(pwc->dither_flag) - *lpb = DITHER_RGB_2_8BIT(r,g,b,iScanLine,iPixel); - else - *lpb = BGR8(r,g,b); - } - else if(nBypp == 2) - *lpw = BGR16(r,g,b); - else if (nBypp == 3){ - *lpdw = BGR24(r,g,b); - } - else if (nBypp == 4) - *lpdw = BGR32(r,g,b); - } - else{ - SetPixel(Current->hDC, iPixel, iScanLine, RGB(r,g,b)); - DD_RELEASEDC; - } -} - -void /*WINAPI*/ wmCreateDIBSection( - HDC hDC, - PWMC pwc, // handle of device context - CONST BITMAPINFO *pbmi, // address of structure containing bitmap size, format, and color data - UINT iUsage // color data type indicator: RGB values or palette indices - ) -{ - DWORD dwSize = 0; - DWORD dwScanWidth; - UINT nBypp = pwc->cColorBits / 8; - HDC hic; - - dwScanWidth = (((pwc->ScanWidth * nBypp)+ 3) & ~3); - - pwc->ScanWidth =pwc->pitch = dwScanWidth; - - if (stereo_flag) - pwc->ScanWidth = 2* pwc->pitch; - - dwSize = sizeof(BITMAPINFO) + (dwScanWidth * pwc->height); - - pwc->dib.hFileMap = CreateFileMapping((HANDLE)PAGE_FILE, - NULL, - PAGE_READWRITE | SEC_COMMIT, - 0, - dwSize, - NULL); - - if (!pwc->dib.hFileMap) - return; - - pwc->dib.base = MapViewOfFile(pwc->dib.hFileMap, - FILE_MAP_ALL_ACCESS, - 0, - 0, - 0); - - if(!pwc->dib.base){ - CloseHandle(pwc->dib.hFileMap); - return; - } - - // pwc->pbPixels = pwc->addrOffScreen = ((LPBYTE)pwc->dib.base) + sizeof(BITMAPINFO); - - // pwc->dib.hDC = CreateCompatibleDC(hDC); - - CopyMemory(pwc->dib.base, pbmi, sizeof(BITMAPINFO)); - - hic = CreateIC("display", NULL, NULL, NULL); - pwc->dib.hDC = CreateCompatibleDC(hic); - - - /* pwc->hbmDIB = CreateDIBitmap(hic, - &(pwc->bmi.bmiHeader), - CBM_INIT, - pwc->pbPixels, - &(pwc->bmi), - DIB_RGB_COLORS); - */ - pwc->hbmDIB = CreateDIBSection(hic, - &(pwc->bmi), - (iUsage ? DIB_PAL_COLORS : DIB_RGB_COLORS), - &(pwc->pbPixels), - pwc->dib.hFileMap, - 0); - /* - pwc->hbmDIB = CreateDIBSection(hic, - &(pwc->bmi), - DIB_RGB_COLORS, - &(pwc->pbPixels), - pwc->dib.hFileMap, - 0); - */ - pwc->ScreenMem = pwc->addrOffScreen = pwc->pbPixels; - pwc->hOldBitmap = SelectObject(pwc->dib.hDC, pwc->hbmDIB); - - DeleteDC(hic); - - return; - -} - -// -// Blit memory DC to screen DC -// -BOOL /*WINAPI*/ wmFlush(PWMC pwc) -{ - BOOL bRet = 0; - DWORD dwErr = 0; -#ifdef DDRAW - HRESULT ddrval; -#endif - - // Now search through the torus frames and mark used colors - if(pwc->db_flag){ -#ifdef DDRAW - if (pwc->lpDDSOffScreen == NULL) - if(DDCreateOffScreen(pwc) == GL_FALSE) - return; - - pwc->lpDDSOffScreen->lpVtbl->Unlock(pwc->lpDDSOffScreen, NULL); - - while( 1 ) - { - ddrval = pwc->lpDDSPrimary->lpVtbl->Blt( pwc->lpDDSPrimary, - &(pwc->rectSurface), pwc->lpDDSOffScreen, &(pwc->rectOffScreen), 0, NULL ); - - if( ddrval == DD_OK ) - { - break; - } - if( ddrval == DDERR_SURFACELOST ) - { - if(!DDRestoreAll(pwc)) - { - break; - } - } - if( ddrval != DDERR_WASSTILLDRAWING ) - { - break; - } - } - - while (pwc->lpDDSOffScreen->lpVtbl->Lock(pwc->lpDDSOffScreen, - NULL, &(pwc->ddsd), 0, NULL) == DDERR_WASSTILLDRAWING) - ; - - if(ddrval != DD_OK) - dwErr = GetLastError(); -#else - bRet = BitBlt(pwc->hDC, 0, 0, pwc->width, pwc->height, - pwc->dib.hDC, 0, 0, SRCCOPY); -#endif - } - - return(TRUE); - -} - - -// The following code is added by Li Wei to enable stereo display - -#if !defined(NO_STEREO) - -void WMesaShowStereo(GLuint list) -{ - - GLbitfield mask = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT; - GLfloat cm[16]; - GLint matrix_mode; - // Must use double Buffer - if( ! Current-> db_flag ) - return; - - - glGetIntegerv(GL_MATRIX_MODE,&matrix_mode); - - // glPushMatrix(); //**** - WMesaViewport(Current->gl_ctx,0,Current->height/2,Current->width,Current->height/2); - // Current->gl_ctx->NewState = 0; - - // glViewport(0,0,Current->width,Current->height/2); - if(matrix_mode!=GL_MODELVIEW) - glMatrixMode(GL_MODELVIEW); - - glGetFloatv(GL_MODELVIEW_MATRIX,cm); - glLoadIdentity(); - gluLookAt(viewDistance/2,0.0,0.0 , - viewDistance/2,0.0,-1.0, - 0.0,1.0,0.0 ); - // glTranslatef(viewDistance/2.0,0.,0.); - glMultMatrixf( cm ); - - Current->ScreenMem = Current->pbPixels = Current->addrOffScreen; - //glPushMatrix(); - glCallList( list ); - //glPopMatrix(); - - glGetFloatv(GL_MODELVIEW_MATRIX,cm); - glLoadIdentity(); - gluLookAt(-viewDistance/2,0.0,0.0 , - -viewDistance/2,0.0,-1.0, - 0.0,1.0,0.0 ); - // glTranslatef(-viewDistance/2.0,0.,0.); - glMultMatrixf(cm); - - Current->ScreenMem = Current->pbPixels = Current->addrOffScreen + Current->pitch; - glCallList(list); - if(matrix_mode!=GL_MODELVIEW) - glMatrixMode(matrix_mode); - - // glPopMatrix(); - glFlush(); - - WMesaViewport(Current->gl_ctx,0,0,Current->width,Current->height); - // Current->gl_ctx->NewState = 0; - WMesaSwapBuffers(); - -} - -void toggleStereoMode() -{ - if(!Current->db_flag) - return; - if(!stereo_flag){ - stereo_flag = 1; - if(stereoBuffer==GL_FALSE) -#if !defined(NO_PARALLEL) - if(!parallelFlag) -#endif - { - Current->ScanWidth = Current->pitch*2; - } - } - else { - stereo_flag = 0; -#if !defined(NO_PARALLEL) - if(!parallelFlag) -#endif - Current->ScanWidth = Current->pitch; - Current->pbPixels = Current->addrOffScreen; - } -} - -/* if in stereo mode, the following function is called */ -void glShowStereo(GLuint list) -{ - WMesaShowStereo(list); -} - -#endif // End if NO_STEREO not defined - -#if !defined(NO_PARALLEL) - -void toggleParallelMode(void) -{ - if(!parallelFlag){ - parallelFlag = GL_TRUE; - if(parallelMachine==GL_FALSE){ - PRCreateRenderBuffer( Current->rgb_flag? GL_RGBA :GL_COLOR_INDEX, - Current->cColorBits/8, - Current->width ,Current->height, - Current->ScanWidth, - Current->rgb_flag? Current->pbPixels: Current->ScreenMem); - parallelMachine = GL_TRUE; - } - } - else { - parallelFlag = GL_FALSE; - if(parallelMachine==GL_TRUE){ - PRDestroyRenderBuffer(); - parallelMachine=GL_FALSE; - ReadyForNextFrame = GL_TRUE; - } - - /*********************************************** - // Seems something wrong!!!! - ************************************************/ - - WMesaMakeCurrent(Current); -#if !defined(NO_STEREO) - stereo_flag = GL_FALSE ; -#endif - } -} - -void PRShowRenderResult(void) -{ - int flag = 0; - if(!glImageRendered()) - return; - - if (parallelFlag) - { - WMesaSwapBuffers(); - } - -} -#endif //End if NO_PARALLEL not defined - -//end modification - -BYTE DITHER_RGB_2_8BIT( int red, int green, int blue, int pixel, int scanline) -{ - char unsigned redtemp, greentemp, bluetemp, paletteindex; - - //*** now, look up each value in the halftone matrix - //*** using an 8x8 ordered dither. - redtemp = aDividedBy51[red] - + (aModulo51[red] > aHalftone8x8[(pixel%8)*8 - + scanline%8]); - greentemp = aDividedBy51[(char unsigned)green] - + (aModulo51[green] > aHalftone8x8[ - (pixel%8)*8 + scanline%8]); - bluetemp = aDividedBy51[(char unsigned)blue] - + (aModulo51[blue] > aHalftone8x8[ - (pixel%8)*8 +scanline%8]); - - //*** recombine the halftoned rgb values into a palette index - paletteindex = - redtemp + aTimes6[greentemp] + aTimes36[bluetemp]; - - //*** and translate through the wing halftone palette - //*** translation vector to give the correct value. - return aWinGHalftoneTranslation[paletteindex]; -} - -#ifdef DDRAW -/* -* restoreAll -* -* restore all lost objects -*/ -HRESULT DDRestoreAll( WMesaContext wc ) -{ - HRESULT ddrval; - - ddrval = wc->lpDDSPrimary->lpVtbl->Restore(wc->lpDDSPrimary); - if( ddrval == DD_OK ) - { - ddrval = wc->lpDDSOffScreen->lpVtbl->Restore(wc->lpDDSOffScreen); - } - return ddrval; - -} /* restoreAll */ - - - /* - * This function is called if the initialization function fails -*/ -BOOL initFail( HWND hwnd, WMesaContext wc ) -{ - DDFree(wc); - MessageBox( hwnd, "DirectDraw Init FAILED", "", MB_OK ); - return FALSE; - -} /* initFail */ - - -static void DDDeleteOffScreen(WMesaContext wc) -{ - if( wc->lpDDSOffScreen != NULL ) - { - wc->lpDDSOffScreen->lpVtbl->Unlock(wc->lpDDSOffScreen,NULL); - wc->lpDDSOffScreen->lpVtbl->Release(wc->lpDDSOffScreen); - wc->lpDDSOffScreen = NULL; - } - -} - -static void DDFreePrimarySurface(WMesaContext wc) -{ - if( wc->lpDDSPrimary != NULL ) - { - if(wc->db_flag == GL_FALSE) - wc->lpDDSPrimary->lpVtbl->ReleaseDC(wc->lpDDSPrimary, wc->hDC); - wc->lpDDSPrimary->lpVtbl->Release(wc->lpDDSPrimary); - wc->lpDDSPrimary = NULL; - } -} - -static BOOL DDCreatePrimarySurface(WMesaContext wc) -{ - HRESULT ddrval; - DDSCAPS ddscaps; - wc->ddsd.dwSize = sizeof( wc->ddsd ); - wc->ddsd.dwFlags = DDSD_CAPS; - wc->ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - - ddrval = wc->lpDD->lpVtbl->CreateSurface( wc->lpDD,&(wc->ddsd), &(wc->lpDDSPrimary), NULL ); - if( ddrval != DD_OK ) - { - return initFail(wc->hwnd , wc); - } - if(wc->db_flag == GL_FALSE) - wc->lpDDSPrimary->lpVtbl->GetDC(wc->lpDDSPrimary, wc->hDC); - return TRUE; -} - -static BOOL DDCreateOffScreen(WMesaContext wc) -{ - POINT pt; - HRESULT ddrval; - if(wc->lpDD == NULL) - return FALSE; - GetClientRect( wc->hwnd, &(wc->rectOffScreen) ); - wc->ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; - wc->ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; - wc->ddsd.dwHeight = wc->rectOffScreen.bottom - wc->rectOffScreen.top; - wc->ddsd.dwWidth = wc->rectOffScreen.right - wc->rectOffScreen.left; - - ddrval = wc->lpDD->lpVtbl->CreateSurface( wc->lpDD, &(wc->ddsd), &(wc->lpDDSOffScreen), NULL ); - if( ddrval != DD_OK ) - { - return FALSE; - } - - while (wc->lpDDSOffScreen->lpVtbl->Lock(wc->lpDDSOffScreen,NULL, &(wc->ddsd), 0, NULL) == DDERR_WASSTILLDRAWING) - ; - // while ((ddrval = wc->lpDDSOffScreen->lpVtbl->Lock(wc->lpDDSOffScreen,NULL, &(wc->ddsd), DDLOCK_SURFACEMEMORYPTR , NULL)) != DD_OK) - ; - if(wc->ddsd.lpSurface==NULL) - return initFail(wc->hwnd, wc); - - wc->ScreenMem = wc->pbPixels = wc->addrOffScreen = (PBYTE)(wc->ddsd.lpSurface); - wc->ScanWidth = wc->pitch = wc->ddsd.lPitch; - if (stereo_flag) - wc->ScanWidth = wc->ddsd.lPitch*2; - - GetClientRect( wc->hwnd, &(wc->rectSurface) ); - pt.x = pt.y = 0; - ClientToScreen( wc->hwnd, &pt ); - OffsetRect(&(wc->rectSurface), pt.x, pt.y); - wmSetPixelFormat(wc, wc->hDC); - return TRUE; -} - -/* -* doInit - do work required for every instance of the application: -* create the window, initialize data -*/ -static BOOL DDInit( WMesaContext wc, HWND hwnd) -{ - HRESULT ddrval; - DWORD dwFrequency; - - LPDIRECTDRAW lpDD; // DirectDraw object - LPDIRECTDRAW2 lpDD2; - - - wc->fullScreen = displayOptions.fullScreen; - wc->gMode = displayOptions.mode; - wc->hwnd = hwnd; - stereo_flag = displayOptions.stereo; - if(wc->db_flag!= GL_TRUE) - stereo_flag = GL_FALSE; - /* - * create the main DirectDraw object - */ - ddrval = DirectDrawCreate( NULL, &(wc->lpDD), NULL ); - if( ddrval != DD_OK ) - { - return initFail(hwnd,wc); - } - - // Get exclusive mode if requested - if(wc->fullScreen) - { - ddrval = wc->lpDD->lpVtbl->SetCooperativeLevel( wc->lpDD, hwnd, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN ); - } - else - { - ddrval = wc->lpDD->lpVtbl->SetCooperativeLevel( wc->lpDD, hwnd, DDSCL_NORMAL ); - } - if( ddrval != DD_OK ) - { - return initFail(hwnd , wc); - } - - - /* ddrval = wc->lpDD->lpVtbl->QueryInterface(wc->lpDD, IID_IDirectDraw2, - (LPVOID *)((wc->lpDD2))); - - */ - if(ddrval != DD_OK) - return initFail(hwnd , wc); - - - //ddrval = wc->lpDD->lpVtbl->GetDisplayMode( wc->lpDD, &(wc->ddsd)); - // wc->lpDD2->lpVtbl->GetMonitorFrequency(wc->lpDD, &dwFrequency); - switch( wc->gMode ) - { - case 1: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 640, 480, displayOptions.bpp); break; - case 2: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 800, 600, displayOptions.bpp); break; - case 3: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 1024, 768, displayOptions.bpp); break; - case 4: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 1152, 864, displayOptions.bpp); break; - case 5: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 1280, 1024, displayOptions.bpp); break; - } - - if( ddrval != DD_OK ) - { - printf("Can't modify display mode, current mode used\n"); - // return initFail(hwnd , wc); - } - //ddrval = wc->lpDD->lpVtbl->GetDisplayMode( wc->lpDD, &(wc->ddsd)); - switch(ddrval){ - case DDERR_INVALIDOBJECT: - break; - case DDERR_INVALIDPARAMS: - break; - case DDERR_UNSUPPORTEDMODE: - ; - } - - if(DDCreatePrimarySurface(wc) == GL_FALSE) - return initFail(hwnd, wc); - - if(wc->db_flag) - return DDCreateOffScreen(wc); -} /* DDInit */ - -static void DDFree( WMesaContext wc) -{ - if( wc->lpDD != NULL ) - { - DDFreePrimarySurface(wc); - DDDeleteOffScreen(wc); - wc->lpDD->lpVtbl->Release(wc->lpDD); - wc->lpDD = NULL; - } - // Clean up the screen on exit - RedrawWindow( NULL, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | - RDW_ALLCHILDREN ); - -} -#endif - -void WMesaMove(void) -{ - WMesaContext wc = Current; - POINT pt; - if (Current != NULL){ - GetClientRect( wc->hwnd, &(wc->rectSurface) ); - pt.x = pt.y = 0; - ClientToScreen( wc->hwnd, &pt ); - OffsetRect(&(wc->rectSurface), pt.x, pt.y); - } -} - - - -/* -* Like PACK_8A8B8G8R() but don't use alpha. This is usually an acceptable -* shortcut. -*/ -#define PACK_8B8G8R( R, G, B ) ( ((B) << 16) | ((G) << 8) | (R) ) - - -/**********************************************************************/ -/*** Triangle rendering ***/ -/**********************************************************************/ - -/* - * XImage, smooth, depth-buffered, PF_8A8B8G8R triangle. - */ -static void smooth_8A8B8G8R_z_triangle( GLcontext *ctx, - GLuint v0, GLuint v1, GLuint v2, - GLuint pv ) -{ - WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; -#define INTERP_Z 1 -#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) -#define PIXEL_TYPE GLuint - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; -#define INTERP_Z 1 -#define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) -#define PIXEL_TYPE GLuint - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; -#define INTERP_Z 1 -#define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y) -#define PIXEL_TYPE GLushort - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; -#define INTERP_Z 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) -#define PIXEL_TYPE GLuint - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define SETUP_CODE \ - unsigned long p = PACK_8B8G8R( VB->ColorPtr->data[pv][0], \ - VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; -#define INTERP_Z 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) -#define PIXEL_TYPE GLuint - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define SETUP_CODE \ - unsigned long p = PACK_8R8G8B( VB->ColorPtr->data[pv][0], \ - VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; -#define INTERP_Z 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y) -#define PIXEL_TYPE GLushort - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define SETUP_CODE \ - unsigned long p = PACK_5R6G5B( VB->ColorPtr->data[pv][0], \ - VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; -#define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) -#define PIXEL_TYPE GLuint - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx; \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxDriverCtx; -#define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) -#define PIXEL_TYPE GLuint - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx; \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxDriverCtx; -#define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y) -#define PIXEL_TYPE GLushort - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx; \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxDriverCtx; -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) -#define PIXEL_TYPE GLuint - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define SETUP_CODE \ - unsigned long p = PACK_8B8G8R( VB->ColorPtr->data[pv][0], \ - VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx; \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxDriverCtx; -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) -#define PIXEL_TYPE GLuint - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define SETUP_CODE \ - unsigned long p = PACK_8R8G8B( VB->ColorPtr->data[pv][0], \ - VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx; \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxDriverCtx; -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y) -#define PIXEL_TYPE GLushort - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define SETUP_CODE \ - unsigned long p = PACK_5R6G5B( VB->ColorPtr->data[pv][0], \ - VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx; \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxDriverCtx; -#define INTERP_Z 1 -#define INTERP_INDEX 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) -#define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; -#define INTERP_Z 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) -#define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define SETUP_CODE \ - GLuint index = VB->IndexPtr->data[pv]; \ - (*ctx->Driver.Index)( ctx, index ); -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; -#define INTERP_Z 1 -#define INTERP_INDEX 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) -#define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx; \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxDriverCtx; -#define INTERP_Z 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) -#define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define SETUP_CODE \ - GLuint index = VB->IndexPtr->data[pv]; \ - (*ctx->Driver.Index)( ctx, index ); -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx; \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxDriverCtx; - DITHER_RGB_TO_8BIT_SETUP -#define INTERP_Z 1 -#define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) -#define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, xx = LEFT, yy = FLIP(Y), len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; - DITHER_RGB_TO_8BIT_SETUP -#define INTERP_Z 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) -#define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (wmesa->ScanWidth) - -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, xx = LEFT, yy = FLIP(Y), len = RIGHT-LEFT; \ - for (i=0;iColorPtr->data[pv][0], \ - VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2], xx, yy); \ - pRow[i] = pixelDithered; \ - zRow[i] = z; \ - } \ - ffz += fdzdx; \ - } \ - } -#ifdef __MINGW32__ - #include "tritemp.h" -#else - - #ifdef WIN32 - #include "..\tritemp.h" - #else - #include "tritemp.h" - #endif -#endif -} - -/* -* XImage, smooth, NON-depth-buffered, 8-bit PF_DITHER triangle. -*/ -static void smooth_DITHER8_triangle( GLcontext *ctx, GLuint v0, GLuint v1, - GLuint v2, GLuint pv ) -{ - WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; - DITHER_RGB_TO_8BIT_SETUP -#define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) -#define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx, yy = FLIP(Y); \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxColorPtr->data[pv][0], VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2], xx, yy);\ - *pixel = pixelDithered; \ - ffr += fdrdx; ffg += fdgdx; ffb += fdbdx; \ - } \ - } -#ifdef __MINGW32__ - #include "tritemp.h" -#else - - #ifdef WIN32 - #include "..\tritemp.h" - #else - #include "tritemp.h" - #endif -#endif -} - -/* -* XImage, flat, NON-depth-buffered, 8-bit PF_DITHER triangle. -*/ - -static void flat_DITHER8_triangle( GLcontext *ctx, GLuint v0, GLuint v1, - GLuint v2, GLuint pv ) -{ - WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; - DITHER_RGB_TO_8BIT_SETUP -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) -#define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (wmesa->ScanWidth) - -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx, yy = FLIP(Y); \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxColorPtr->data[pv][0], \ - VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2], xx, yy); \ - *pixel = pixelDithered; \ - } \ - } -#ifdef __MINGW32__ - #include "tritemp.h" -#else - - #ifdef WIN32 - #include "..\tritemp.h" - #else - #include "tritemp.h" - #endif -#endif -} - - - - -static triangle_func choose_triangle_function( GLcontext *ctx ) -{ - WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; - int depth = wmesa->cColorBits; - - if (ctx->Polygon.SmoothFlag) return NULL; - if (ctx->Texture._ReallyEnabled) return NULL; - if (!wmesa->db_flag) return NULL; - /*if (wmesa->xm_buffer->buffer==XIMAGE)*/ { - if ( ctx->Light.ShadeModel==GL_SMOOTH - && ctx->_RasterMask==DEPTH_BIT - && ctx->Depth.Func==GL_LESS - && ctx->Depth.Mask==GL_TRUE - && ctx->Polygon.StippleFlag==GL_FALSE) { - switch (wmesa->pixelformat) { - case PF_8A8B8G8R: - return smooth_8A8B8G8R_z_triangle; - case PF_8R8G8B: - return smooth_8R8G8B_z_triangle; - case PF_5R6G5B: - return smooth_5R6G5B_z_triangle; - case PF_DITHER8: - return smooth_DITHER8_z_triangle; - case PF_INDEX8: - return smooth_ci_z_triangle; - default: - return NULL; - } - } - if ( ctx->Light.ShadeModel==GL_FLAT - && ctx->_RasterMask==DEPTH_BIT - && ctx->Depth.Func==GL_LESS - && ctx->Depth.Mask==GL_TRUE - && ctx->Polygon.StippleFlag==GL_FALSE) { - switch (wmesa->pixelformat) { - case PF_8A8B8G8R: - return flat_8A8B8G8R_z_triangle; - case PF_8R8G8B: - return flat_8R8G8B_z_triangle; - case PF_5R6G5B: - return flat_5R6G5B_z_triangle; - case PF_DITHER8: - return flat_DITHER8_z_triangle; - case PF_INDEX8: - return flat_ci_z_triangle; - default: - return NULL; - } - } - if ( ctx->_RasterMask==0 /* no depth test */ - && ctx->Light.ShadeModel==GL_SMOOTH - && ctx->Polygon.StippleFlag==GL_FALSE) { - switch (wmesa->pixelformat) { - case PF_8A8B8G8R: - return smooth_8A8B8G8R_triangle; - case PF_8R8G8B: - return smooth_8R8G8B_triangle; - case PF_5R6G5B: - return smooth_5R6G5B_triangle; - case PF_DITHER8: - return smooth_DITHER8_triangle; - case PF_INDEX8: - return smooth_ci_triangle; - default: - return NULL; - } - } - - if ( ctx->_RasterMask==0 /* no depth test */ - && ctx->Light.ShadeModel==GL_FLAT - && ctx->Polygon.StippleFlag==GL_FALSE) { - switch (wmesa->pixelformat) { - case PF_8A8B8G8R: - return flat_8A8B8G8R_triangle; - case PF_8R8G8B: - return flat_8R8G8B_triangle; - case PF_5R6G5B: - return flat_5R6G5B_triangle; - case PF_DITHER8: - return flat_DITHER8_triangle; - case PF_INDEX8: - return flat_ci_triangle; - default: - return NULL; - } - } - - return NULL; - } -} - -/* -* Define a new viewport and reallocate auxillary buffers if the size of -* the window (color buffer) has changed. -*/ -void WMesaViewport( GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height ) -{ - /* Save viewport */ - ctx->Viewport.X = x; - ctx->Viewport.Width = width; - ctx->Viewport.Y = y; - ctx->Viewport.Height = height; - - /* compute scale and bias values */ -/* Pre-Keith 3.1 changes - ctx->Viewport.Map.m[Sx] = (GLfloat) width / 2.0F; - ctx->Viewport.Map.m[Tx] = ctx->Viewport.Sx + x; - ctx->Viewport.Map.m[Sy] = (GLfloat) height / 2.0F; - ctx->Viewport.Map.m[Ty] = ctx->Viewport.Sy + y; -*/ - ctx->Viewport.WindowMap.m[MAT_SX] = (GLfloat) width / 2.0F; - ctx->Viewport.WindowMap.m[MAT_TX] = ctx->Viewport.WindowMap.m[MAT_SX] + x; - ctx->Viewport.WindowMap.m[MAT_SY] = (GLfloat) height / 2.0F; - ctx->Viewport.WindowMap.m[MAT_TY] = ctx->Viewport.WindowMap.m[MAT_SY] + y; -} +/* $Id: wmesa.c,v 1.18 2001/09/14 22:19:19 brianp Exp $ */ + +/* + * Windows (Win32) device driver for Mesa 3.4 + * + * Original author: + * + * Copyright (C) 1996- Li Wei + * Address : Institute of Artificial Intelligence + * : & Robotics + * : Xi'an Jiaotong University + * Email : liwei@aiar.xjtu.edu.cn + * Web page : http://sun.aiar.xjtu.edu.cn + * + * This file and its associations are partially borrowed from the + * Windows NT driver for Mesa 1.8 , written by Mark Leaming + * (mark@rsinc.com). + */ + + +#define WMESA_STEREO_C + +#include +#include +#include +#include +#include "mesa_extend.h" +#include "colors.h" +#include "macros.h" +#include "context.h" +#include "dd.h" +//#include "xform.h" +//#include "vb.h" +#include "matrix.h" +#include "depth.h" +#include "wmesadef.h" + +#pragma warning ( disable : 4100 4133 4761 ) + +#ifdef PROFILE +// #include "profile.h" +#endif + +#ifdef DITHER +#include +#endif + +#ifdef __CYGWIN32__ +#include "macros.h" +#include +#define CopyMemory memcpy +#endif + +#if !defined(NO_STEREO) + +#include "gl\glu.h" +#include "stereo.h" + +#endif +#if !defined(NO_PARALLEL) + #include "parallel.h" +#endif + +struct DISPLAY_OPTIONS displayOptions; + +GLenum stereoCompile = GL_FALSE ; +GLenum stereoShowing = GL_FALSE ; +GLenum stereoBuffer = GL_FALSE; +#if !defined(NO_STEREO) +GLint displayList = MAXIMUM_DISPLAY_LIST ; +#endif +GLint stereo_flag = 0 ; + +/* end of added code*/ + +static PWMC Current = NULL; +WMesaContext WC = NULL; + +#ifdef NDEBUG +#define assert(ignore) ((void) 0) +#else +void Mesa_Assert(void *Cond,void *File,unsigned Line) +{ + char Msg[512]; + sprintf(Msg,"%s %s %d",Cond,File,Line); + MessageBox(NULL,Msg,"Assertion failed.",MB_OK); + exit(1); +} +#define assert(e) if (!e) Mesa_Assert(#e,__FILE__,__LINE__); +#endif + +//#define DD_GETDC (Current->hDC ) +#define DD_GETDC ((Current->db_flag) ? Current->dib.hDC : Current->hDC ) +//#define DD_GETDC ((Current->db_flag) ? Current->hDCPrimary : Current->hDCBack ) +#define DD_RELEASEDC + +//#define BEGINGDICALL if(Current->rgb_flag)wmFlushBits(Current); +#define BEGINGDICALL +//#define ENDGDICALL if(Current->rgb_flag)wmGetBits(Current); +#define ENDGDICALL + +//#define FLIP(Y) (Current->dither_flag? Y : Current->height-(Y)-1) +//#define FLIP(Y) (Current->height-(Y)-1) +//#define FLIP(Y) Y +/* + * XXX Why only flip Y coord if single buffered??? + */ +#define FLIP(Y) (Current->db_flag? Y: Current->height-(Y)-1) +#define STARTPROFILE +#define ENDPROFILE(PARA) + +#define DITHER_RGB_TO_8BIT_SETUP \ +GLubyte pixelDithered; + +#define DITHER_RGB_TO_8BIT(red, green, blue, pixel, scanline) \ +{ \ + char unsigned redtemp, greentemp, bluetemp, paletteindex; \ + redtemp = aDividedBy51[red] \ + + (aModulo51[red] > aHalftone8x8[(pixel%8)*8 \ + + scanline%8]); \ + greentemp = aDividedBy51[(char unsigned)green] \ + + (aModulo51[green] > aHalftone8x8[ \ + (pixel%8)*8 + scanline%8]); \ + bluetemp = aDividedBy51[(char unsigned)blue] \ + + (aModulo51[blue] > aHalftone8x8[ \ + (pixel%8)*8 +scanline%8]); \ + paletteindex = redtemp + aTimes6[greentemp] + aTimes36[bluetemp]; \ + pixelDithered = aWinGHalftoneTranslation[paletteindex]; \ +} + + +#ifdef DDRAW +static BOOL DDInit( WMesaContext wc, HWND hwnd); +static void DDFree( WMesaContext wc); +static HRESULT DDRestoreAll( WMesaContext wc ); +static void DDDeleteOffScreen(WMesaContext wc); +static BOOL DDCreateOffScreen(WMesaContext wc); +#endif + +static void FlushToFile(PWMC pwc, PSTR szFile); + +BOOL wmCreateBackingStore(PWMC pwc, long lxSize, long lySize); +BOOL wmDeleteBackingStore(PWMC pwc); +void wmCreatePalette( PWMC pwdc ); +BOOL wmSetDibColors(PWMC pwc); +void wmSetPixel(PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b); + +void wmCreateDIBSection( + HDC hDC, + PWMC pwc, // handle of device context + CONST BITMAPINFO *pbmi, // address of structure containing bitmap size, format, and color data + UINT iUsage // color data type indicator: RGB values or palette indices + ); + + +void WMesaViewport( GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height ); + + +//static triangle_func choose_triangle_function( GLcontext *ctx ); + + +static void wmSetPixelFormat( PWMC wc, HDC hDC) +{ + if(wc->rgb_flag) + wc->cColorBits = GetDeviceCaps(hDC, BITSPIXEL); + else + wc->cColorBits = 8; + switch(wc->cColorBits){ + case 8: + if(wc->dither_flag != GL_TRUE) + wc->pixelformat = PF_INDEX8; + else + wc->pixelformat = PF_DITHER8; + break; + case 16: + wc->pixelformat = PF_5R6G5B; + break; + case 32: + wc->pixelformat = PF_8R8G8B; + break; + default: + wc->pixelformat = PF_BADFORMAT; + } +} + +// +// This function sets the color table of a DIB section +// to match that of the destination DC +// +BOOL /*WINAPI*/ wmSetDibColors(PWMC pwc) +{ + RGBQUAD *pColTab, *pRGB; + PALETTEENTRY *pPal, *pPE; + int i, nColors; + BOOL bRet=TRUE; + DWORD dwErr=0; + + /* Build a color table in the DIB that maps to the + selected palette in the DC. + */ + nColors = 1 << pwc->cColorBits; + pPal = (PALETTEENTRY *)malloc( nColors * sizeof(PALETTEENTRY)); + memset( pPal, 0, nColors * sizeof(PALETTEENTRY) ); + GetPaletteEntries( pwc->hGLPalette, 0, nColors, pPal ); + pColTab = (RGBQUAD *)malloc( nColors * sizeof(RGBQUAD)); + for (i = 0, pRGB = pColTab, pPE = pPal; i < nColors; i++, pRGB++, pPE++) { + pRGB->rgbRed = pPE->peRed; + pRGB->rgbGreen = pPE->peGreen; + pRGB->rgbBlue = pPE->peBlue; + } + if(pwc->db_flag) + bRet = SetDIBColorTable(pwc->dib.hDC, 0, nColors, pColTab ); + + if(!bRet) + dwErr = GetLastError(); + + free( pColTab ); + free( pPal ); + + return(bRet); +} + + +// +// Free up the dib section that was created +// +BOOL wmDeleteBackingStore(PWMC pwc) +{ + SelectObject(pwc->dib.hDC, pwc->hOldBitmap); + DeleteDC(pwc->dib.hDC); + DeleteObject(pwc->hbmDIB); + UnmapViewOfFile(pwc->dib.base); + CloseHandle(pwc->dib.hFileMap); + return TRUE; +} + + +// +// This function creates the DIB section that is used for combined +// GL and GDI calls +// +BOOL /*WINAPI*/ wmCreateBackingStore(PWMC pwc, long lxSize, long lySize) +{ + HDC hdc = pwc->hDC; + LPBITMAPINFO pbmi = &(pwc->bmi); + int iUsage; + + pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbmi->bmiHeader.biWidth = lxSize; + pbmi->bmiHeader.biHeight= -lySize; + pbmi->bmiHeader.biPlanes = 1; + if(pwc->rgb_flag) + pbmi->bmiHeader.biBitCount = GetDeviceCaps(pwc->hDC, BITSPIXEL); + else + pbmi->bmiHeader.biBitCount = 8; + pbmi->bmiHeader.biCompression = BI_RGB; + pbmi->bmiHeader.biSizeImage = 0; + pbmi->bmiHeader.biXPelsPerMeter = 0; + pbmi->bmiHeader.biYPelsPerMeter = 0; + pbmi->bmiHeader.biClrUsed = 0; + pbmi->bmiHeader.biClrImportant = 0; + + iUsage = (pbmi->bmiHeader.biBitCount <= 8) ? DIB_PAL_COLORS : DIB_RGB_COLORS; + + pwc->cColorBits = pbmi->bmiHeader.biBitCount; + pwc->ScanWidth = pwc->pitch = lxSize; + + wmCreateDIBSection(hdc, pwc, pbmi, iUsage); + + if ((iUsage == DIB_PAL_COLORS) && !(pwc->hGLPalette)) { + wmCreatePalette( pwc ); + wmSetDibColors( pwc ); + } + wmSetPixelFormat(pwc, pwc->hDC); + return(TRUE); + +} + + +// +// This function copies one scan line in a DIB section to another +// +BOOL WINAPI wmSetDIBits(PWMC pwc, UINT uiScanWidth, UINT uiNumScans, UINT nBypp, UINT uiNewWidth, LPBYTE pBits) +{ + UINT uiScans = 0; + LPBYTE pDest = pwc->pbPixels; + DWORD dwNextScan = uiScanWidth; + DWORD dwNewScan = uiNewWidth; + DWORD dwScanWidth = (uiScanWidth * nBypp); + + // + // We need to round up to the nearest DWORD + // and multiply by the number of bytes per + // pixel + // + dwNextScan = (((dwNextScan * nBypp)+ 3) & ~3); + dwNewScan = (((dwNewScan * nBypp)+ 3) & ~3); + + for(uiScans = 0; uiScans < uiNumScans; uiScans++){ + CopyMemory(pDest, pBits, dwScanWidth); + pBits += dwNextScan; + pDest += dwNewScan; + } + + return(TRUE); + +} + + +BOOL wmFlush(PWMC pwc); + +/* +* Useful macros: +Modified from file osmesa.c +*/ + + +#define PIXELADDR(X,Y) ((GLubyte *)Current->pbPixels + (Current->height-Y-1)* Current->ScanWidth + (X)*nBypp) +#define PIXELADDR1( X, Y ) \ +((GLubyte *)wmesa->pbPixels + (wmesa->height-Y-1)* wmesa->ScanWidth + (X)) +#define PIXELADDR2( X, Y ) \ +((GLubyte *)wmesa->pbPixels + (wmesa->height-Y-1)* wmesa->ScanWidth + (X)*2) +#define PIXELADDR4( X, Y ) \ +((GLubyte *)wmesa->pbPixels + (wmesa->height-Y-1)* wmesa->ScanWidth + (X)*4) + + +BYTE DITHER_RGB_2_8BIT( int r, int g, int b, int x, int y); + +/* Finish all pending operations and synchronize. */ +static void finish(GLcontext* ctx) +{ + /* No op */ +} + + +// +// We cache all gl draw routines until a flush is made +// +static void flush(GLcontext* ctx) +{ + STARTPROFILE + if((Current->rgb_flag /*&& !(Current->dib.fFlushed)*/&&!(Current->db_flag)) + ||(!Current->rgb_flag)) + { + wmFlush(Current); + } + ENDPROFILE(flush) + +} + + + +/* +* Set the color index used to clear the color buffer. +*/ +static void clear_index(GLcontext* ctx, GLuint index) +{ + STARTPROFILE + Current->clearpixel = index; + ENDPROFILE(clear_index) +} + + + +/* +* Set the color used to clear the color buffer. +*/ +static void clear_color( GLcontext* ctx, const GLchan color[4] ) +{ + STARTPROFILE + Current->clearpixel = RGB(color[0], color[1], color[2]); + ENDPROFILE(clear_color) +} + + + +/* +* Clear the specified region of the color buffer using the clear color +* or index as specified by one of the two functions above. +*/ +//static void clear(GLcontext* ctx, +// GLboolean all,GLint x, GLint y, GLint width, GLint height ) +// TODO: I modified this function to match the prototype in +// dd.h. (swansma@geocities.com) + +static GLbitfield clear(GLcontext* ctx, GLbitfield mask, + GLboolean all, GLint x, GLint y, GLint width, GLint height) +{ + DWORD dwColor; + WORD wColor; + BYTE bColor; + LPDWORD lpdw = (LPDWORD)Current->pbPixels; + LPWORD lpw = (LPWORD)Current->pbPixels; + LPBYTE lpb = Current->pbPixels; + int lines; + + STARTPROFILE + + if (all){ + x=y=0; + width=Current->width; + height=Current->height; + } + if(Current->db_flag==GL_TRUE){ + UINT nBypp = Current->cColorBits / 8; + int i = 0; + int iSize = 0; + + if(nBypp ==1 ){ + /* Need rectification */ + iSize = Current->width/4; + bColor = BGR8(GetRValue(Current->clearpixel), + GetGValue(Current->clearpixel), + GetBValue(Current->clearpixel)); + wColor = MAKEWORD(bColor,bColor); + dwColor = MAKELONG(wColor, wColor); + } + if(nBypp == 2){ + iSize = Current->width / 2; + wColor = BGR16(GetRValue(Current->clearpixel), + GetGValue(Current->clearpixel), + GetBValue(Current->clearpixel)); + dwColor = MAKELONG(wColor, wColor); + } + else if(nBypp == 4){ + iSize = Current->width; + dwColor = BGR32(GetRValue(Current->clearpixel), + GetGValue(Current->clearpixel), + GetBValue(Current->clearpixel)); + } + + while(i < iSize){ + *lpdw = dwColor; + lpdw++; + i++; + } + + // + // This is the 24bit case + // + if (nBypp == 3) { + iSize = Current->width *3/4; + dwColor = BGR24(GetRValue(Current->clearpixel), + GetGValue(Current->clearpixel), + GetBValue(Current->clearpixel)); + while(i < iSize){ + *lpdw = dwColor; + lpb += nBypp; + lpdw = (LPDWORD)lpb; + i++; + } + } + + i = 0; + if (stereo_flag) + lines = height /2; + else + lines = height; + do { + memcpy(lpb, Current->pbPixels, iSize*4); + lpb += Current->ScanWidth; + i++; + } + while (iclearpixel); + HBRUSH Brush=CreateSolidBrush(Current->clearpixel); + HPEN Old_Pen=SelectObject(DC,Pen); + HBRUSH Old_Brush=SelectObject(DC,Brush); + Rectangle(DC,x,y,x+width,y+height); + SelectObject(DC,Old_Pen); + SelectObject(DC,Old_Brush); + DeleteObject(Pen); + DeleteObject(Brush); + DD_RELEASEDC; + } + + + + ENDPROFILE(clear) + + return mask; // TODO: I doubt this is correct. dd.h doesn't explain what this should + // be... +} + + + +static void enable( GLcontext* ctx, GLenum pname, GLboolean enable ) +{ + if (!Current) + return; + + if (pname == GL_DITHER) { + if(enable == GL_FALSE){ + Current->dither_flag = GL_FALSE; + if(Current->cColorBits == 8) + Current->pixelformat = PF_INDEX8; + } + else{ + if (Current->rgb_flag && Current->cColorBits == 8){ + Current->pixelformat = PF_DITHER8; + Current->dither_flag = GL_TRUE; + } + else + Current->dither_flag = GL_FALSE; + } + } +} + + + +static GLboolean set_draw_buffer( GLcontext* ctx, GLenum mode ) +{ + STARTPROFILE + /* TODO: this could be better */ + if (mode==GL_FRONT_LEFT || mode==GL_BACK_LEFT) { + return GL_TRUE; + } + else { + return GL_FALSE; + } + ENDPROFILE(set_draw_buffer) +} + + +static void set_read_buffer(GLcontext *ctx, GLframebuffer *colorBuffer, + GLenum buffer ) +{ + /* XXX todo */ + return; +} + + + +/* Return characteristics of the output buffer. */ +static void buffer_size( GLcontext* ctx, GLuint *width, GLuint *height ) +{ + int New_Size; + RECT CR; + + STARTPROFILE + GetClientRect(Current->Window,&CR); + + *width=CR.right; + *height=CR.bottom; + + New_Size=((*width)!=Current->width) || ((*height)!=Current->height); + + if (New_Size){ + Current->width=*width; + Current->height=*height; + Current->ScanWidth=Current->width; + if ((Current->ScanWidth%sizeof(long))!=0) + Current->ScanWidth+=(sizeof(long)-(Current->ScanWidth%sizeof(long))); + + if (Current->db_flag){ +#ifdef DDRAW + DDDeleteOffScreen(Current); + DDCreateOffScreen(Current); +#else + if (Current->rgb_flag==GL_TRUE && Current->dither_flag!=GL_TRUE){ + wmDeleteBackingStore(Current); + wmCreateBackingStore(Current, Current->width, Current->height); + } +#endif + } + + // Resize OsmesaBuffer if in Parallel mode +#if !defined(NO_PARALLEL) + if(parallelFlag) + PRSizeRenderBuffer(Current->width, Current->height,Current->ScanWidth, + Current->rgb_flag == GL_TRUE ? Current->pbPixels: Current->ScreenMem); +#endif + } + ENDPROFILE(buffer_size) +} + + + +/**********************************************************************/ +/***** Accelerated point, line, polygon rendering *****/ +/**********************************************************************/ + + +static void fast_rgb_points( GLcontext* ctx, GLuint first, GLuint last ) +{ +#if 0 + GLuint i; + // HDC DC=DD_GETDC; + PWMC pwc = Current; + + STARTPROFILE + + if (0 /*Current->gl_ctx->VB->MonoColor*/) { + /* all drawn with current color */ + for (i=first;i<=last;i++) { + if (!Current->gl_ctx->VB->ClipMask[i]) { + int x, y; + x = (GLint) Current->gl_ctx->VB->Win.data[i][0]; + y = FLIP( (GLint) Current->gl_ctx->VB->Win.data[i][1] ); + wmSetPixel(pwc, y,x,GetRValue(Current->pixel), + GetGValue(Current->pixel), GetBValue(Current->pixel)); + } + } + } + else { + /* draw points of different colors */ + for (i=first;i<=last;i++) { + if (!Current->gl_ctx->VB->ClipMask[i]) { + int x, y; + unsigned long pixel=RGB(Current->gl_ctx->VB->ColorPtr->data[i][0]*255.0, + Current->gl_ctx->VB->ColorPtr->data[i][1]*255.0, + Current->gl_ctx->VB->ColorPtr->data[i][2]*255.0); + x = (GLint) Current->gl_ctx->VB->Win.data[i][0]; + y = FLIP( (GLint) Current->gl_ctx->VB->Win.data[i][1] ); + wmSetPixel(pwc, y,x,Current->gl_ctx->VB->ColorPtr->data[i][0]*255.0, + Current->gl_ctx->VB->ColorPtr->data[i][1]*255.0, + Current->gl_ctx->VB->ColorPtr->data[i][2]*255.0); + } + } + } + // DD_RELEASEDC; + ENDPROFILE(fast_rgb_points) +#endif +} + + + +/* Return pointer to accerated points function */ +extern /*points_func*/ choose_points_function( GLcontext* ctx ) +{ +#if 0 + STARTPROFILE + if (ctx->Point.Size==1.0 && !ctx->Point.SmoothFlag && ctx->_RasterMask==0 + && !ctx->Texture._ReallyEnabled && ctx->Visual->RGBAflag) { + ENDPROFILE(choose_points_function) + return fast_rgb_points; + } + else { + ENDPROFILE(choose_points_function) + return NULL; + } +#endif +} + + + +/* Draw a line using the color specified by Current->gl_ctx->VB->ColorPtr->data[pv] */ +static void fast_flat_rgb_line( GLcontext* ctx, GLuint v0, GLuint v1, GLuint pv ) +{ +#if 0 + STARTPROFILE + int x0, y0, x1, y1; + unsigned long pixel; + HDC DC=DD_GETDC; + HPEN Pen; + HPEN Old_Pen; + + if (0 /*Current->gl_ctx->VB->MonoColor*/) { + pixel = Current->pixel; /* use current color */ + } + else { + pixel = RGB(Current->gl_ctx->VB->ColorPtr->data[pv][0]*255.0, Current->gl_ctx->VB->ColorPtr->data[pv][1]*255.0, Current->gl_ctx->VB->ColorPtr->data[pv][2]*255.0); + } + + x0 = (int) Current->gl_ctx->VB->Win.data[v0][0]; + y0 = FLIP( (int) Current->gl_ctx->VB->Win.data[v0][1] ); + x1 = (int) Current->gl_ctx->VB->Win.data[v1][0]; + y1 = FLIP( (int) Current->gl_ctx->VB->Win.data[v1][1] ); + + + BEGINGDICALL + + Pen=CreatePen(PS_SOLID,1,pixel); + Old_Pen=SelectObject(DC,Pen); + MoveToEx(DC,x0,y0,NULL); + LineTo(DC,x1,y1); + SelectObject(DC,Old_Pen); + DeleteObject(Pen); + DD_RELEASEDC; + + ENDGDICALL + + ENDPROFILE(fast_flat_rgb_line) +#endif +} + + + +/* Return pointer to accerated line function */ +static /*line_func*/ choose_line_function( GLcontext* ctx ) +{ +#if 0 + STARTPROFILE + if (ctx->Line.Width==1.0 && !ctx->Line.SmoothFlag && !ctx->Line.StippleFlag + && ctx->Light.ShadeModel==GL_FLAT && ctx->_RasterMask==0 + && !ctx->Texture._ReallyEnabled && Current->rgb_flag) { + ENDPROFILE(choose_line_function) + return fast_flat_rgb_line; + } + else { + ENDPROFILE(choose_line_function) + return NULL; + } +#endif +} + + +/**********************************************************************/ +/***** Span-based pixel drawing *****/ +/**********************************************************************/ + + +/* Write a horizontal span of 32-bit color-index pixels with a boolean mask. */ +static void write_ci32_span( const GLcontext* ctx, + GLuint n, GLint x, GLint y, + const GLuint index[], + const GLubyte mask[] ) +{ + STARTPROFILE + GLuint i; + PBYTE Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; irgb_flag==GL_TRUE) + { + GLuint i; + HDC DC=DD_GETDC; + y=FLIP(y); + if (mask) { + for (i=0; iScreenMem+y*Current->ScanWidth+x; + y = FLIP(y); + if (mask) { + for (i=0; ihPal,RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP])); + } + else { + for (i=0; ihPal,RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP])); + } + } + ENDPROFILE(write_rgba_span) + +} + +/* Write a horizontal span of RGB color pixels with a boolean mask. */ +static void write_rgb_span( const GLcontext* ctx, + GLuint n, GLint x, GLint y, + const GLubyte rgb[][3], const GLubyte mask[] ) +{ + STARTPROFILE + PWMC pwc = Current; + + if (pwc->rgb_flag==GL_TRUE) + { + GLuint i; + HDC DC=DD_GETDC; + y=FLIP(y); + if (mask) { + for (i=0; iScreenMem+y*Current->ScanWidth+x; + y = FLIP(y); + if (mask) { + for (i=0; ihPal,RGB(rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP])); + } + else { + for (i=0; ihPal,RGB(rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP])); + } + } + ENDPROFILE(write_rgb_span) + +} + +/* +* Write a horizontal span of pixels with a boolean mask. The current color +* is used for all pixels. +*/ +static void write_mono_rgba_span( const GLcontext* ctx, + GLuint n, GLint x, GLint y, + const GLchan color[4], const GLubyte mask[]) +{ + ULONG pixel = RGB( color[RCOMP], color[GCOMP], color[BCOMP] ); + STARTPROFILE + GLuint i; + HDC DC=DD_GETDC; + PWMC pwc = Current; + assert(Current->rgb_flag==GL_TRUE); + y=FLIP(y); + if(Current->rgb_flag==GL_TRUE){ + for (i=0; irgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]; + *Mem = index[i]; + } + } + ENDPROFILE(write_ci32_pixels) +} + + + +/* +* Write an array of pixels with a boolean mask. The current color +* index is used for all pixels. +*/ +static void write_mono_ci_pixels( const GLcontext* ctx, + GLuint n, + const GLint x[], const GLint y[], + GLuint colorIndex, const GLubyte mask[] ) +{ + STARTPROFILE + GLuint i; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]; + *Mem = colorIndex; + } + } + ENDPROFILE(write_mono_ci_pixels) +} + + + +/* Write an array of RGBA pixels with a boolean mask. */ +static void write_rgba_pixels( const GLcontext* ctx, + GLuint n, const GLint x[], const GLint y[], + const GLubyte rgba[][4], const GLubyte mask[] ) +{ + STARTPROFILE + GLuint i; + PWMC pwc = Current; + HDC DC=DD_GETDC; + assert(Current->rgb_flag==GL_TRUE); + for (i=0; irgb_flag==GL_TRUE); + for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; irgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]); + } + } + ENDPROFILE(read_ci32_pixels) +} + + + +/* Read a horizontal span of color pixels. */ +static void read_rgba_span( const GLcontext* ctx, + GLuint n, GLint x, GLint y, + GLubyte rgba[][4] ) +{ + STARTPROFILE + UINT i; + COLORREF Color; + HDC DC=DD_GETDC; + assert(Current->rgb_flag==GL_TRUE); + /* y=FLIP(y);*/ + y = Current->height - y - 1; + for (i=0; irgb_flag==GL_TRUE); + for (i=0; iheight - y[i] - 1; + Color=GetPixel(DC,x[i],y2); + rgba[i][RCOMP] = GetRValue(Color); + rgba[i][GCOMP] = GetGValue(Color); + rgba[i][BCOMP] = GetBValue(Color); + rgba[i][ACOMP] = 255; + } + } + DD_RELEASEDC; +// Brian P. has mentioned to comment this out. +// memset(alpha,0,n*sizeof(GLint)); + ENDPROFILE(read_rgba_pixels) +} + + + +/**********************************************************************/ +/**********************************************************************/ + + +static const GLubyte *get_string(GLcontext *ctx, GLenum name) +{ + if (name == GL_RENDERER) { + return (GLubyte *) "Mesa Windows"; + } + else { + return NULL; + } +} + + + +void setup_DD_pointers( GLcontext* ctx ) +{ +#if 0 + ctx->Driver.GetString = get_string; + ctx->Driver.UpdateState = setup_DD_pointers; + ctx->Driver.GetBufferSize = buffer_size; + ctx->Driver.Finish = finish; + ctx->Driver.Flush = flush; + + ctx->Driver.ClearIndex = clear_index; + ctx->Driver.ClearColor = clear_color; + ctx->Driver.Clear = clear; + + ctx->Driver.Enable = enable; + + ctx->Driver.SetDrawBuffer = set_draw_buffer; + ctx->Driver.SetReadBuffer = set_read_buffer; + ctx->Driver.GetBufferSize = buffer_size; + + ctx->Driver.PointsFunc = choose_points_function(ctx); + ctx->Driver.LineFunc = choose_line_function(ctx); + ctx->Driver.TriangleFunc = choose_triangle_function( ctx ); + + /* Pixel/span writing functions: */ + ctx->Driver.WriteRGBASpan = write_rgba_span; + ctx->Driver.WriteRGBSpan = write_rgb_span; + ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span; + ctx->Driver.WriteRGBAPixels = write_rgba_pixels; + ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels; + ctx->Driver.WriteCI32Span = write_ci32_span; + ctx->Driver.WriteCI8Span = write_ci8_span; + ctx->Driver.WriteMonoCISpan = write_mono_ci_span; + ctx->Driver.WriteCI32Pixels = write_ci32_pixels; + ctx->Driver.WriteMonoCIPixels = write_mono_ci_pixels; + + ctx->Driver.ReadCI32Span = read_ci32_span; + ctx->Driver.ReadRGBASpan = read_rgba_span; + ctx->Driver.ReadCI32Pixels = read_ci32_pixels; + ctx->Driver.ReadRGBAPixels = read_rgba_pixels; +#endif +} + + +/**********************************************************************/ +/***** WMesa API Functions *****/ +/**********************************************************************/ + + + +#define PAL_SIZE 256 +static void GetPalette(HPALETTE Pal,RGBQUAD *aRGB) +{ + STARTPROFILE + int i; + HDC hdc; + struct + { + WORD Version; + WORD NumberOfEntries; + PALETTEENTRY aEntries[PAL_SIZE]; + } Palette = + { + 0x300, + PAL_SIZE + }; + hdc=GetDC(NULL); + if (Pal!=NULL) + GetPaletteEntries(Pal,0,PAL_SIZE,Palette.aEntries); + else + GetSystemPaletteEntries(hdc,0,PAL_SIZE,Palette.aEntries); + if (GetSystemPaletteUse(hdc) == SYSPAL_NOSTATIC) + { + for(i = 0; i Window=hWnd; + c->hDC = GetDC(hWnd); + true_color_flag = GetDeviceCaps(c->hDC, BITSPIXEL) > 8; +#ifdef DDRAW + if(true_color_flag) c->rgb_flag = rgb_flag = GL_TRUE; +#endif + + +#ifdef DITHER + if ((true_color_flag==GL_FALSE) && (rgb_flag == GL_TRUE)){ + c->dither_flag = GL_TRUE; + c->hPalHalfTone = WinGCreateHalftonePalette(); + } + else + c->dither_flag = GL_FALSE; +#else + c->dither_flag = GL_FALSE; +#endif + + + if (rgb_flag==GL_FALSE) + { + c->rgb_flag = GL_FALSE; + // c->pixel = 1; + c->db_flag = db_flag =GL_TRUE; // WinG requires double buffering + printf("Single buffer is not supported in color index mode, setting to double buffer.\n"); + } + else + { + c->rgb_flag = GL_TRUE; + // c->pixel = 0; + } + GetClientRect(c->Window,&CR); + c->width=CR.right; + c->height=CR.bottom; + if (db_flag) + { + c->db_flag = 1; + /* Double buffered */ +#ifndef DDRAW + // if (c->rgb_flag==GL_TRUE && c->dither_flag != GL_TRUE ) + { + wmCreateBackingStore(c, c->width, c->height); + + } +#endif + } + else + { + /* Single Buffered */ + if (c->rgb_flag) + c->db_flag = 0; + } +#ifdef DDRAW + if (DDInit(c,hWnd) == GL_FALSE) { + free( (void *) c ); + exit(1); + } +#endif + + + c->gl_visual = _mesa_create_visual(rgb_flag, + db_flag, /* db_flag */ + GL_FALSE, /* stereo */ + 8,8,8,8, /* r, g, b, a bits */ + 0, /* index bits */ + 16, /* depth_bits */ + 8, /* stencil_bits */ + 16,16,16,16,/* accum_bits */ + 1); + + if (!c->gl_visual) { + return NULL; + } + + /* allocate a new Mesa context */ + c->gl_ctx = _mesa_create_context( c->gl_visual, NULL, c, GL_TRUE); + + if (!c->gl_ctx) { + _mesa_destroy_visual( c->gl_visual ); + free(c); + return NULL; + } + + _mesa_enable_sw_extensions(c->gl_ctx); +#if 0 + c->gl_buffer = _mesa_create_framebuffer( c->gl_visual, + c->gl_visual->DepthBits > 0, + c->gl_visual->StencilBits > 0, + c->gl_visual->AccumRedBits > 0, + c->gl_visual->AlphaBits > 0 ); +#endif + c->gl_buffer = NULL; /* TEMP */ + if (!c->gl_buffer) { + _mesa_destroy_visual( c->gl_visual ); + _mesa_destroy_context( c->gl_ctx ); + free(c); + return NULL; + } + + c->gl_ctx->Driver.UpdateState = setup_DD_pointers; + + // setup_DD_pointers(c->gl_ctx); + + return c; +} + +void WMesaDestroyContext( void ) +{ + WMesaContext c = Current; + ReleaseDC(c->Window,c->hDC); + WC = c; + if(c->hPalHalfTone != NULL) + DeleteObject(c->hPalHalfTone); + _mesa_destroy_visual( c->gl_visual ); + _mesa_destroy_framebuffer( c->gl_buffer ); + _mesa_destroy_context( c->gl_ctx ); + + if (c->db_flag) +#ifdef DDRAW + DDFree(c); +#else + wmDeleteBackingStore(c); +#endif + free( (void *) c ); + //Following code is added to enable parallel render + // Parallel render only work in double buffer mode +#if !defined(NO_PARALLEL) + if(parallelMachine) + PRDestroyRenderBuffer(); +#endif + // End modification +} + + + +void /*APIENTRY*/ WMesaMakeCurrent( WMesaContext c ) +{ + if(!c){ + Current = c; + return; + } + + // + // A little optimization + // If it already is current, + // don't set it again + // + if(Current == c) + return; + + //gl_set_context( c->gl_ctx ); + _mesa_make_current(c->gl_ctx, c->gl_buffer); + setup_DD_pointers(c->gl_ctx); + Current = c; + if (Current->gl_ctx->Viewport.Width==0) { + /* initialize viewport to window size */ + _mesa_set_viewport( Current->gl_ctx, + 0, 0, Current->width, Current->height ); + } + if ((c->cColorBits <= 8 ) && (c->rgb_flag == GL_TRUE)){ + WMesaPaletteChange(c->hPalHalfTone); + } +} + + + +void /*APIENTRY*/ WMesaSwapBuffers( void ) +{ + HDC DC = Current->hDC; + GET_CURRENT_CONTEXT(ctx); + + /* If we're swapping the buffer associated with the current context + * we have to flush any pending rendering commands first. + */ + if (Current && Current->gl_ctx == ctx) + _mesa_swapbuffers(ctx); + + if (Current->db_flag) + wmFlush(Current); +} + + + +void /*APIENTRY*/ WMesaPaletteChange(HPALETTE Pal) +{ + int vRet; + LPPALETTEENTRY pPal; + if (Current && (Current->rgb_flag==GL_FALSE || Current->dither_flag == GL_TRUE)) + { + pPal = (PALETTEENTRY *)malloc( 256 * sizeof(PALETTEENTRY)); + Current->hPal=Pal; + // GetPaletteEntries( Pal, 0, 256, pPal ); + GetPalette( Pal, pPal ); +#ifdef DDRAW + Current->lpDD->lpVtbl->CreatePalette(Current->lpDD,DDPCAPS_8BIT, + pPal, &(Current->lpDDPal), NULL); + if (Current->lpDDPal) + Current->lpDDSPrimary->lpVtbl->SetPalette(Current->lpDDSPrimary,Current->lpDDPal); +#else + vRet = SetDIBColorTable(Current->dib.hDC,0,256,pPal); +#endif + free( pPal ); + } + +} + + + + +static unsigned char threeto8[8] = { + 0, 0111>>1, 0222>>1, 0333>>1, 0444>>1, 0555>>1, 0666>>1, 0377 +}; + +static unsigned char twoto8[4] = { + 0, 0x55, 0xaa, 0xff +}; + +static unsigned char oneto8[2] = { + 0, 255 +}; + +static unsigned char componentFromIndex(UCHAR i, UINT nbits, UINT shift) +{ + unsigned char val; + + val = i >> shift; + switch (nbits) { + + case 1: + val &= 0x1; + return oneto8[val]; + + case 2: + val &= 0x3; + return twoto8[val]; + + case 3: + val &= 0x7; + return threeto8[val]; + + default: + return 0; + } +} + +void /*WINAPI*/ wmCreatePalette( PWMC pwdc ) +{ + /* Create a compressed and re-expanded 3:3:2 palette */ + int i; + LOGPALETTE *pPal; + BYTE rb, rs, gb, gs, bb, bs; + + pwdc->nColors = 0x100; + + pPal = (PLOGPALETTE)malloc(sizeof(LOGPALETTE) + pwdc->nColors * sizeof(PALETTEENTRY)); + memset( pPal, 0, sizeof(LOGPALETTE) + pwdc->nColors * sizeof(PALETTEENTRY) ); + + pPal->palVersion = 0x300; + + rb = REDBITS; + rs = REDSHIFT; + gb = GREENBITS; + gs = GREENSHIFT; + bb = BLUEBITS; + bs = BLUESHIFT; + + if (pwdc->db_flag) { + + /* Need to make two palettes: one for the screen DC and one for the DIB. */ + pPal->palNumEntries = pwdc->nColors; + for (i = 0; i < pwdc->nColors; i++) { + pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs ); + pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs ); + pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs ); + pPal->palPalEntry[i].peFlags = 0; + } + pwdc->hGLPalette = CreatePalette( pPal ); + pwdc->hPalette = CreatePalette( pPal ); + } + + else { + pPal->palNumEntries = pwdc->nColors; + for (i = 0; i < pwdc->nColors; i++) { + pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs ); + pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs ); + pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs ); + pPal->palPalEntry[i].peFlags = 0; + } + pwdc->hGLPalette = CreatePalette( pPal ); + } + + free(pPal); + +} + +void /*WINAPI*/ wmSetPixel(PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b) +{ + if (Current->db_flag) { + LPBYTE lpb = pwc->pbPixels; + LPDWORD lpdw; + LPWORD lpw; + UINT nBypp = pwc->cColorBits >> 3; + UINT nOffset = iPixel % nBypp; + + // Move the pixel buffer pointer to the scanline that we + // want to access + + // pwc->dib.fFlushed = FALSE; + + lpb += pwc->ScanWidth * iScanLine; + // Now move to the desired pixel + lpb += iPixel * nBypp; + lpb = PIXELADDR(iPixel, iScanLine); + lpdw = (LPDWORD)lpb; + lpw = (LPWORD)lpb; + + if(nBypp == 1){ + if(pwc->dither_flag) + *lpb = DITHER_RGB_2_8BIT(r,g,b,iScanLine,iPixel); + else + *lpb = BGR8(r,g,b); + } + else if(nBypp == 2) + *lpw = BGR16(r,g,b); + else if (nBypp == 3){ + *lpdw = BGR24(r,g,b); + } + else if (nBypp == 4) + *lpdw = BGR32(r,g,b); + } + else{ + SetPixel(Current->hDC, iPixel, iScanLine, RGB(r,g,b)); + DD_RELEASEDC; + } +} + +void /*WINAPI*/ wmCreateDIBSection( + HDC hDC, + PWMC pwc, // handle of device context + CONST BITMAPINFO *pbmi, // address of structure containing bitmap size, format, and color data + UINT iUsage // color data type indicator: RGB values or palette indices + ) +{ + DWORD dwSize = 0; + DWORD dwScanWidth; + UINT nBypp = pwc->cColorBits / 8; + HDC hic; + + dwScanWidth = (((pwc->ScanWidth * nBypp)+ 3) & ~3); + + pwc->ScanWidth =pwc->pitch = dwScanWidth; + + if (stereo_flag) + pwc->ScanWidth = 2* pwc->pitch; + + dwSize = sizeof(BITMAPINFO) + (dwScanWidth * pwc->height); + + pwc->dib.hFileMap = CreateFileMapping((HANDLE)PAGE_FILE, + NULL, + PAGE_READWRITE | SEC_COMMIT, + 0, + dwSize, + NULL); + + if (!pwc->dib.hFileMap) + return; + + pwc->dib.base = MapViewOfFile(pwc->dib.hFileMap, + FILE_MAP_ALL_ACCESS, + 0, + 0, + 0); + + if(!pwc->dib.base){ + CloseHandle(pwc->dib.hFileMap); + return; + } + + // pwc->pbPixels = pwc->addrOffScreen = ((LPBYTE)pwc->dib.base) + sizeof(BITMAPINFO); + + // pwc->dib.hDC = CreateCompatibleDC(hDC); + + CopyMemory(pwc->dib.base, pbmi, sizeof(BITMAPINFO)); + + hic = CreateIC("display", NULL, NULL, NULL); + pwc->dib.hDC = CreateCompatibleDC(hic); + + + /* pwc->hbmDIB = CreateDIBitmap(hic, + &(pwc->bmi.bmiHeader), + CBM_INIT, + pwc->pbPixels, + &(pwc->bmi), + DIB_RGB_COLORS); + */ + pwc->hbmDIB = CreateDIBSection(hic, + &(pwc->bmi), + (iUsage ? DIB_PAL_COLORS : DIB_RGB_COLORS), + &(pwc->pbPixels), + pwc->dib.hFileMap, + 0); + /* + pwc->hbmDIB = CreateDIBSection(hic, + &(pwc->bmi), + DIB_RGB_COLORS, + &(pwc->pbPixels), + pwc->dib.hFileMap, + 0); + */ + pwc->ScreenMem = pwc->addrOffScreen = pwc->pbPixels; + pwc->hOldBitmap = SelectObject(pwc->dib.hDC, pwc->hbmDIB); + + DeleteDC(hic); + + return; + +} + +// +// Blit memory DC to screen DC +// +BOOL /*WINAPI*/ wmFlush(PWMC pwc) +{ + BOOL bRet = 0; + DWORD dwErr = 0; +#ifdef DDRAW + HRESULT ddrval; +#endif + + // Now search through the torus frames and mark used colors + if(pwc->db_flag){ +#ifdef DDRAW + if (pwc->lpDDSOffScreen == NULL) + if(DDCreateOffScreen(pwc) == GL_FALSE) + return; + + pwc->lpDDSOffScreen->lpVtbl->Unlock(pwc->lpDDSOffScreen, NULL); + + while( 1 ) + { + ddrval = pwc->lpDDSPrimary->lpVtbl->Blt( pwc->lpDDSPrimary, + &(pwc->rectSurface), pwc->lpDDSOffScreen, &(pwc->rectOffScreen), 0, NULL ); + + if( ddrval == DD_OK ) + { + break; + } + if( ddrval == DDERR_SURFACELOST ) + { + if(!DDRestoreAll(pwc)) + { + break; + } + } + if( ddrval != DDERR_WASSTILLDRAWING ) + { + break; + } + } + + while (pwc->lpDDSOffScreen->lpVtbl->Lock(pwc->lpDDSOffScreen, + NULL, &(pwc->ddsd), 0, NULL) == DDERR_WASSTILLDRAWING) + ; + + if(ddrval != DD_OK) + dwErr = GetLastError(); +#else + bRet = BitBlt(pwc->hDC, 0, 0, pwc->width, pwc->height, + pwc->dib.hDC, 0, 0, SRCCOPY); +#endif + } + + return(TRUE); + +} + + +// The following code is added by Li Wei to enable stereo display + +#if !defined(NO_STEREO) + +void WMesaShowStereo(GLuint list) +{ + + GLbitfield mask = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT; + GLfloat cm[16]; + GLint matrix_mode; + // Must use double Buffer + if( ! Current-> db_flag ) + return; + + + glGetIntegerv(GL_MATRIX_MODE,&matrix_mode); + + // glPushMatrix(); //**** + WMesaViewport(Current->gl_ctx,0,Current->height/2,Current->width,Current->height/2); + // Current->gl_ctx->NewState = 0; + + // glViewport(0,0,Current->width,Current->height/2); + if(matrix_mode!=GL_MODELVIEW) + glMatrixMode(GL_MODELVIEW); + + glGetFloatv(GL_MODELVIEW_MATRIX,cm); + glLoadIdentity(); + gluLookAt(viewDistance/2,0.0,0.0 , + viewDistance/2,0.0,-1.0, + 0.0,1.0,0.0 ); + // glTranslatef(viewDistance/2.0,0.,0.); + glMultMatrixf( cm ); + + Current->ScreenMem = Current->pbPixels = Current->addrOffScreen; + //glPushMatrix(); + glCallList( list ); + //glPopMatrix(); + + glGetFloatv(GL_MODELVIEW_MATRIX,cm); + glLoadIdentity(); + gluLookAt(-viewDistance/2,0.0,0.0 , + -viewDistance/2,0.0,-1.0, + 0.0,1.0,0.0 ); + // glTranslatef(-viewDistance/2.0,0.,0.); + glMultMatrixf(cm); + + Current->ScreenMem = Current->pbPixels = Current->addrOffScreen + Current->pitch; + glCallList(list); + if(matrix_mode!=GL_MODELVIEW) + glMatrixMode(matrix_mode); + + // glPopMatrix(); + glFlush(); + + WMesaViewport(Current->gl_ctx,0,0,Current->width,Current->height); + // Current->gl_ctx->NewState = 0; + WMesaSwapBuffers(); + +} + +void toggleStereoMode() +{ + if(!Current->db_flag) + return; + if(!stereo_flag){ + stereo_flag = 1; + if(stereoBuffer==GL_FALSE) +#if !defined(NO_PARALLEL) + if(!parallelFlag) +#endif + { + Current->ScanWidth = Current->pitch*2; + } + } + else { + stereo_flag = 0; +#if !defined(NO_PARALLEL) + if(!parallelFlag) +#endif + Current->ScanWidth = Current->pitch; + Current->pbPixels = Current->addrOffScreen; + } +} + +/* if in stereo mode, the following function is called */ +void glShowStereo(GLuint list) +{ + WMesaShowStereo(list); +} + +#endif // End if NO_STEREO not defined + +#if !defined(NO_PARALLEL) + +void toggleParallelMode(void) +{ + if(!parallelFlag){ + parallelFlag = GL_TRUE; + if(parallelMachine==GL_FALSE){ + PRCreateRenderBuffer( Current->rgb_flag? GL_RGBA :GL_COLOR_INDEX, + Current->cColorBits/8, + Current->width ,Current->height, + Current->ScanWidth, + Current->rgb_flag? Current->pbPixels: Current->ScreenMem); + parallelMachine = GL_TRUE; + } + } + else { + parallelFlag = GL_FALSE; + if(parallelMachine==GL_TRUE){ + PRDestroyRenderBuffer(); + parallelMachine=GL_FALSE; + ReadyForNextFrame = GL_TRUE; + } + + /*********************************************** + // Seems something wrong!!!! + ************************************************/ + + WMesaMakeCurrent(Current); +#if !defined(NO_STEREO) + stereo_flag = GL_FALSE ; +#endif + } +} + +void PRShowRenderResult(void) +{ + int flag = 0; + if(!glImageRendered()) + return; + + if (parallelFlag) + { + WMesaSwapBuffers(); + } + +} +#endif //End if NO_PARALLEL not defined + +//end modification + +BYTE DITHER_RGB_2_8BIT( int red, int green, int blue, int pixel, int scanline) +{ + char unsigned redtemp, greentemp, bluetemp, paletteindex; + + //*** now, look up each value in the halftone matrix + //*** using an 8x8 ordered dither. + redtemp = aDividedBy51[red] + + (aModulo51[red] > aHalftone8x8[(pixel%8)*8 + + scanline%8]); + greentemp = aDividedBy51[(char unsigned)green] + + (aModulo51[green] > aHalftone8x8[ + (pixel%8)*8 + scanline%8]); + bluetemp = aDividedBy51[(char unsigned)blue] + + (aModulo51[blue] > aHalftone8x8[ + (pixel%8)*8 +scanline%8]); + + //*** recombine the halftoned rgb values into a palette index + paletteindex = + redtemp + aTimes6[greentemp] + aTimes36[bluetemp]; + + //*** and translate through the wing halftone palette + //*** translation vector to give the correct value. + return aWinGHalftoneTranslation[paletteindex]; +} + +#ifdef DDRAW +/* +* restoreAll +* +* restore all lost objects +*/ +HRESULT DDRestoreAll( WMesaContext wc ) +{ + HRESULT ddrval; + + ddrval = wc->lpDDSPrimary->lpVtbl->Restore(wc->lpDDSPrimary); + if( ddrval == DD_OK ) + { + ddrval = wc->lpDDSOffScreen->lpVtbl->Restore(wc->lpDDSOffScreen); + } + return ddrval; + +} /* restoreAll */ + + + /* + * This function is called if the initialization function fails +*/ +BOOL initFail( HWND hwnd, WMesaContext wc ) +{ + DDFree(wc); + MessageBox( hwnd, "DirectDraw Init FAILED", "", MB_OK ); + return FALSE; + +} /* initFail */ + + +static void DDDeleteOffScreen(WMesaContext wc) +{ + if( wc->lpDDSOffScreen != NULL ) + { + wc->lpDDSOffScreen->lpVtbl->Unlock(wc->lpDDSOffScreen,NULL); + wc->lpDDSOffScreen->lpVtbl->Release(wc->lpDDSOffScreen); + wc->lpDDSOffScreen = NULL; + } + +} + +static void DDFreePrimarySurface(WMesaContext wc) +{ + if( wc->lpDDSPrimary != NULL ) + { + if(wc->db_flag == GL_FALSE) + wc->lpDDSPrimary->lpVtbl->ReleaseDC(wc->lpDDSPrimary, wc->hDC); + wc->lpDDSPrimary->lpVtbl->Release(wc->lpDDSPrimary); + wc->lpDDSPrimary = NULL; + } +} + +static BOOL DDCreatePrimarySurface(WMesaContext wc) +{ + HRESULT ddrval; + DDSCAPS ddscaps; + wc->ddsd.dwSize = sizeof( wc->ddsd ); + wc->ddsd.dwFlags = DDSD_CAPS; + wc->ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + + ddrval = wc->lpDD->lpVtbl->CreateSurface( wc->lpDD,&(wc->ddsd), &(wc->lpDDSPrimary), NULL ); + if( ddrval != DD_OK ) + { + return initFail(wc->hwnd , wc); + } + if(wc->db_flag == GL_FALSE) + wc->lpDDSPrimary->lpVtbl->GetDC(wc->lpDDSPrimary, wc->hDC); + return TRUE; +} + +static BOOL DDCreateOffScreen(WMesaContext wc) +{ + POINT pt; + HRESULT ddrval; + if(wc->lpDD == NULL) + return FALSE; + GetClientRect( wc->hwnd, &(wc->rectOffScreen) ); + wc->ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; + wc->ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + wc->ddsd.dwHeight = wc->rectOffScreen.bottom - wc->rectOffScreen.top; + wc->ddsd.dwWidth = wc->rectOffScreen.right - wc->rectOffScreen.left; + + ddrval = wc->lpDD->lpVtbl->CreateSurface( wc->lpDD, &(wc->ddsd), &(wc->lpDDSOffScreen), NULL ); + if( ddrval != DD_OK ) + { + return FALSE; + } + + while (wc->lpDDSOffScreen->lpVtbl->Lock(wc->lpDDSOffScreen,NULL, &(wc->ddsd), 0, NULL) == DDERR_WASSTILLDRAWING) + ; + // while ((ddrval = wc->lpDDSOffScreen->lpVtbl->Lock(wc->lpDDSOffScreen,NULL, &(wc->ddsd), DDLOCK_SURFACEMEMORYPTR , NULL)) != DD_OK) + ; + if(wc->ddsd.lpSurface==NULL) + return initFail(wc->hwnd, wc); + + wc->ScreenMem = wc->pbPixels = wc->addrOffScreen = (PBYTE)(wc->ddsd.lpSurface); + wc->ScanWidth = wc->pitch = wc->ddsd.lPitch; + if (stereo_flag) + wc->ScanWidth = wc->ddsd.lPitch*2; + + GetClientRect( wc->hwnd, &(wc->rectSurface) ); + pt.x = pt.y = 0; + ClientToScreen( wc->hwnd, &pt ); + OffsetRect(&(wc->rectSurface), pt.x, pt.y); + wmSetPixelFormat(wc, wc->hDC); + return TRUE; +} + +/* +* doInit - do work required for every instance of the application: +* create the window, initialize data +*/ +static BOOL DDInit( WMesaContext wc, HWND hwnd) +{ + HRESULT ddrval; + DWORD dwFrequency; + + LPDIRECTDRAW lpDD; // DirectDraw object + LPDIRECTDRAW2 lpDD2; + + + wc->fullScreen = displayOptions.fullScreen; + wc->gMode = displayOptions.mode; + wc->hwnd = hwnd; + stereo_flag = displayOptions.stereo; + if(wc->db_flag!= GL_TRUE) + stereo_flag = GL_FALSE; + /* + * create the main DirectDraw object + */ + ddrval = DirectDrawCreate( NULL, &(wc->lpDD), NULL ); + if( ddrval != DD_OK ) + { + return initFail(hwnd,wc); + } + + // Get exclusive mode if requested + if(wc->fullScreen) + { + ddrval = wc->lpDD->lpVtbl->SetCooperativeLevel( wc->lpDD, hwnd, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN ); + } + else + { + ddrval = wc->lpDD->lpVtbl->SetCooperativeLevel( wc->lpDD, hwnd, DDSCL_NORMAL ); + } + if( ddrval != DD_OK ) + { + return initFail(hwnd , wc); + } + + + /* ddrval = wc->lpDD->lpVtbl->QueryInterface(wc->lpDD, IID_IDirectDraw2, + (LPVOID *)((wc->lpDD2))); + + */ + if(ddrval != DD_OK) + return initFail(hwnd , wc); + + + //ddrval = wc->lpDD->lpVtbl->GetDisplayMode( wc->lpDD, &(wc->ddsd)); + // wc->lpDD2->lpVtbl->GetMonitorFrequency(wc->lpDD, &dwFrequency); + switch( wc->gMode ) + { + case 1: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 640, 480, displayOptions.bpp); break; + case 2: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 800, 600, displayOptions.bpp); break; + case 3: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 1024, 768, displayOptions.bpp); break; + case 4: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 1152, 864, displayOptions.bpp); break; + case 5: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 1280, 1024, displayOptions.bpp); break; + } + + if( ddrval != DD_OK ) + { + printf("Can't modify display mode, current mode used\n"); + // return initFail(hwnd , wc); + } + //ddrval = wc->lpDD->lpVtbl->GetDisplayMode( wc->lpDD, &(wc->ddsd)); + switch(ddrval){ + case DDERR_INVALIDOBJECT: + break; + case DDERR_INVALIDPARAMS: + break; + case DDERR_UNSUPPORTEDMODE: + ; + } + + if(DDCreatePrimarySurface(wc) == GL_FALSE) + return initFail(hwnd, wc); + + if(wc->db_flag) + return DDCreateOffScreen(wc); +} /* DDInit */ + +static void DDFree( WMesaContext wc) +{ + if( wc->lpDD != NULL ) + { + DDFreePrimarySurface(wc); + DDDeleteOffScreen(wc); + wc->lpDD->lpVtbl->Release(wc->lpDD); + wc->lpDD = NULL; + } + // Clean up the screen on exit + RedrawWindow( NULL, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | + RDW_ALLCHILDREN ); + +} +#endif + +void WMesaMove(void) +{ + WMesaContext wc = Current; + POINT pt; + if (Current != NULL){ + GetClientRect( wc->hwnd, &(wc->rectSurface) ); + pt.x = pt.y = 0; + ClientToScreen( wc->hwnd, &pt ); + OffsetRect(&(wc->rectSurface), pt.x, pt.y); + } +} + + + +/* +* Like PACK_8A8B8G8R() but don't use alpha. This is usually an acceptable +* shortcut. +*/ +#define PACK_8B8G8R( R, G, B ) ( ((B) << 16) | ((G) << 8) | (R) ) + + +/**********************************************************************/ +/*** Triangle rendering ***/ +/**********************************************************************/ + +/* + * XImage, smooth, depth-buffered, PF_8A8B8G8R triangle. + */ +static void smooth_8A8B8G8R_z_triangle( GLcontext *ctx, + GLuint v0, GLuint v1, GLuint v2, + GLuint pv ) +{ + WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; +#define INTERP_Z 1 +#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE +#define INTERP_RGB 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) +#define PIXEL_TYPE GLuint + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; +#define INTERP_Z 1 +#define INTERP_RGB 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) +#define PIXEL_TYPE GLuint + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; +#define INTERP_Z 1 +#define INTERP_RGB 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y) +#define PIXEL_TYPE GLushort + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; +#define INTERP_Z 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) +#define PIXEL_TYPE GLuint + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define SETUP_CODE \ + unsigned long p = PACK_8B8G8R( VB->ColorPtr->data[pv][0], \ + VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; +#define INTERP_Z 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) +#define PIXEL_TYPE GLuint + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define SETUP_CODE \ + unsigned long p = PACK_8R8G8B( VB->ColorPtr->data[pv][0], \ + VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; +#define INTERP_Z 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y) +#define PIXEL_TYPE GLushort + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define SETUP_CODE \ + unsigned long p = PACK_5R6G5B( VB->ColorPtr->data[pv][0], \ + VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; +#define INTERP_RGB 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) +#define PIXEL_TYPE GLuint + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx; \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxDriverCtx; +#define INTERP_RGB 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) +#define PIXEL_TYPE GLuint + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx; \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxDriverCtx; +#define INTERP_RGB 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y) +#define PIXEL_TYPE GLushort + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx; \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxDriverCtx; +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) +#define PIXEL_TYPE GLuint + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define SETUP_CODE \ + unsigned long p = PACK_8B8G8R( VB->ColorPtr->data[pv][0], \ + VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx; \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxDriverCtx; +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) +#define PIXEL_TYPE GLuint + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define SETUP_CODE \ + unsigned long p = PACK_8R8G8B( VB->ColorPtr->data[pv][0], \ + VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx; \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxDriverCtx; +#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y) +#define PIXEL_TYPE GLushort + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define SETUP_CODE \ + unsigned long p = PACK_5R6G5B( VB->ColorPtr->data[pv][0], \ + VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx; \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxDriverCtx; +#define INTERP_Z 1 +#define INTERP_INDEX 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) +#define PIXEL_TYPE GLubyte +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; +#define INTERP_Z 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) +#define PIXEL_TYPE GLubyte +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define SETUP_CODE \ + GLuint index = VB->IndexPtr->data[pv]; \ + (*ctx->Driver.Index)( ctx, index ); +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; +#define INTERP_Z 1 +#define INTERP_INDEX 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) +#define PIXEL_TYPE GLubyte +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx; \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxDriverCtx; +#define INTERP_Z 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) +#define PIXEL_TYPE GLubyte +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define SETUP_CODE \ + GLuint index = VB->IndexPtr->data[pv]; \ + (*ctx->Driver.Index)( ctx, index ); +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx; \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxDriverCtx; + DITHER_RGB_TO_8BIT_SETUP +#define INTERP_Z 1 +#define INTERP_RGB 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) +#define PIXEL_TYPE GLubyte +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, xx = LEFT, yy = FLIP(Y), len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; + DITHER_RGB_TO_8BIT_SETUP +#define INTERP_Z 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) +#define PIXEL_TYPE GLubyte +#define BYTES_PER_ROW (wmesa->ScanWidth) + +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, xx = LEFT, yy = FLIP(Y), len = RIGHT-LEFT; \ + for (i=0;iColorPtr->data[pv][0], \ + VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2], xx, yy); \ + pRow[i] = pixelDithered; \ + zRow[i] = z; \ + } \ + ffz += fdzdx; \ + } \ + } +#ifdef __MINGW32__ + #include "tritemp.h" +#else + + #ifdef WIN32 +// #include "..\tritemp.h" + #else + #include "tritemp.h" + #endif +#endif +} + +/* +* XImage, smooth, NON-depth-buffered, 8-bit PF_DITHER triangle. +*/ +static void smooth_DITHER8_triangle( GLcontext *ctx, GLuint v0, GLuint v1, + GLuint v2, GLuint pv ) +{ + WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; + DITHER_RGB_TO_8BIT_SETUP +#define INTERP_RGB 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) +#define PIXEL_TYPE GLubyte +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx, yy = FLIP(Y); \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxColorPtr->data[pv][0], VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2], xx, yy);\ + *pixel = pixelDithered; \ + ffr += fdrdx; ffg += fdgdx; ffb += fdbdx; \ + } \ + } +#ifdef __MINGW32__ + #include "tritemp.h" +#else + + #ifdef WIN32 +// #include "..\tritemp.h" + #else + #include "tritemp.h" + #endif +#endif +} + +/* +* XImage, flat, NON-depth-buffered, 8-bit PF_DITHER triangle. +*/ + +static void flat_DITHER8_triangle( GLcontext *ctx, GLuint v0, GLuint v1, + GLuint v2, GLuint pv ) +{ + WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; + DITHER_RGB_TO_8BIT_SETUP +#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) +#define PIXEL_TYPE GLubyte +#define BYTES_PER_ROW (wmesa->ScanWidth) + +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx, yy = FLIP(Y); \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxColorPtr->data[pv][0], \ + VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2], xx, yy); \ + *pixel = pixelDithered; \ + } \ + } +#ifdef __MINGW32__ + #include "tritemp.h" +#else + + #ifdef WIN32 +// #include "..\tritemp.h" + #else + #include "tritemp.h" + #endif +#endif +} + + + + +static /*triangle_func*/ choose_triangle_function( GLcontext *ctx ) +{ +#if 0 + WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; + int depth = wmesa->cColorBits; + + if (ctx->Polygon.SmoothFlag) return NULL; + if (ctx->Texture._ReallyEnabled) return NULL; + if (!wmesa->db_flag) return NULL; + /*if (wmesa->xm_buffer->buffer==XIMAGE)*/ { + if ( ctx->Light.ShadeModel==GL_SMOOTH + && ctx->_RasterMask==DEPTH_BIT + && ctx->Depth.Func==GL_LESS + && ctx->Depth.Mask==GL_TRUE + && ctx->Polygon.StippleFlag==GL_FALSE) { + switch (wmesa->pixelformat) { + case PF_8A8B8G8R: + return smooth_8A8B8G8R_z_triangle; + case PF_8R8G8B: + return smooth_8R8G8B_z_triangle; + case PF_5R6G5B: + return smooth_5R6G5B_z_triangle; + case PF_DITHER8: + return smooth_DITHER8_z_triangle; + case PF_INDEX8: + return smooth_ci_z_triangle; + default: + return NULL; + } + } + if ( ctx->Light.ShadeModel==GL_FLAT + && ctx->_RasterMask==DEPTH_BIT + && ctx->Depth.Func==GL_LESS + && ctx->Depth.Mask==GL_TRUE + && ctx->Polygon.StippleFlag==GL_FALSE) { + switch (wmesa->pixelformat) { + case PF_8A8B8G8R: + return flat_8A8B8G8R_z_triangle; + case PF_8R8G8B: + return flat_8R8G8B_z_triangle; + case PF_5R6G5B: + return flat_5R6G5B_z_triangle; + case PF_DITHER8: + return flat_DITHER8_z_triangle; + case PF_INDEX8: + return flat_ci_z_triangle; + default: + return NULL; + } + } + if ( ctx->_RasterMask==0 /* no depth test */ + && ctx->Light.ShadeModel==GL_SMOOTH + && ctx->Polygon.StippleFlag==GL_FALSE) { + switch (wmesa->pixelformat) { + case PF_8A8B8G8R: + return smooth_8A8B8G8R_triangle; + case PF_8R8G8B: + return smooth_8R8G8B_triangle; + case PF_5R6G5B: + return smooth_5R6G5B_triangle; + case PF_DITHER8: + return smooth_DITHER8_triangle; + case PF_INDEX8: + return smooth_ci_triangle; + default: + return NULL; + } + } + + if ( ctx->_RasterMask==0 /* no depth test */ + && ctx->Light.ShadeModel==GL_FLAT + && ctx->Polygon.StippleFlag==GL_FALSE) { + switch (wmesa->pixelformat) { + case PF_8A8B8G8R: + return flat_8A8B8G8R_triangle; + case PF_8R8G8B: + return flat_8R8G8B_triangle; + case PF_5R6G5B: + return flat_5R6G5B_triangle; + case PF_DITHER8: + return flat_DITHER8_triangle; + case PF_INDEX8: + return flat_ci_triangle; + default: + return NULL; + } + } + + return NULL; + } +#endif +} + +/* +* Define a new viewport and reallocate auxillary buffers if the size of +* the window (color buffer) has changed. +*/ +void WMesaViewport( GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height ) +{ +#if 0 + /* Save viewport */ + ctx->Viewport.X = x; + ctx->Viewport.Width = width; + ctx->Viewport.Y = y; + ctx->Viewport.Height = height; + + /* compute scale and bias values */ +/* Pre-Keith 3.1 changes + ctx->Viewport.Map.m[Sx] = (GLfloat) width / 2.0F; + ctx->Viewport.Map.m[Tx] = ctx->Viewport.Sx + x; + ctx->Viewport.Map.m[Sy] = (GLfloat) height / 2.0F; + ctx->Viewport.Map.m[Ty] = ctx->Viewport.Sy + y; +*/ + ctx->Viewport.WindowMap.m[MAT_SX] = (GLfloat) width / 2.0F; + ctx->Viewport.WindowMap.m[MAT_TX] = ctx->Viewport.WindowMap.m[MAT_SX] + x; + ctx->Viewport.WindowMap.m[MAT_SY] = (GLfloat) height / 2.0F; + ctx->Viewport.WindowMap.m[MAT_TY] = ctx->Viewport.WindowMap.m[MAT_SY] + y; +#endif +} diff --git a/src/mesa/main/Makefile.win b/src/mesa/main/Makefile.win index 3c448e7767a..284a9cb49ea 100644 --- a/src/mesa/main/Makefile.win +++ b/src/mesa/main/Makefile.win @@ -1,172 +1,198 @@ -# Makefile for Win32 - -!include - -TOP = .. - -CORE_SRCS = \ - tnl\t_array_api.c \ - tnl\t_array_import.c \ - tnl\t_context.c \ - tnl\t_eval_api.c \ - tnl\t_imm_alloc.c \ - tnl\t_imm_api.c \ - tnl\t_imm_debug.c \ - tnl\t_imm_dlist.c \ - tnl\t_imm_elt.c \ - tnl\t_imm_eval.c \ - tnl\t_imm_exec.c \ - tnl\t_imm_fixup.c \ - tnl\t_pipeline.c \ - tnl\t_vb_fog.c \ - tnl\t_vb_light.c \ - tnl\t_vb_normals.c \ - tnl\t_vb_points.c \ - tnl\t_vb_render.c \ - tnl\t_vb_texgen.c \ - tnl\t_vb_texmat.c \ - tnl\t_vb_vertex.c \ - swrast_setup\ss_context.c \ - swrast_setup\ss_triangle.c \ - swrast_setup\ss_vb.c \ - api_loopback.c \ - api_noop.c \ - api_validate.c \ - accum.c \ - attrib.c \ - blend.c \ - buffers.c \ - clip.c \ - colortab.c \ - config.c \ - context.c \ - convolve.c \ - debug.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 \ - glthread.c \ - hash.c \ - highpc.c \ - hint.c \ - histogram.c \ - image.c \ - imports.c \ - light.c \ - lines.c \ - lowpc.c \ - matrix.c \ - mem.c \ - mmath.c \ - pixel.c \ - points.c \ - polygon.c \ - rastpos.c \ - state.c \ - stencil.c \ - teximage.c \ - texobj.c \ - texstate.c \ - texstore.c \ - texutil.c \ - varray.c \ - vtxfmt.c \ - X86\x86.c \ - X86\common_x86.c \ - X86\3dnow.c \ - X86\sse.c \ - math\m_debug_norm.c \ - math\m_debug_vertex.c \ - math\m_debug_xform.c \ - math\m_eval.c \ - math\m_matrix.c \ - math\m_translate.c \ - math\m_vector.c \ - math\m_vertices.c \ - math\m_xform.c \ - array_cache\ac_context.c \ - array_cache\ac_import.c \ - swrast\s_aaline.c \ - swrast\s_aatriangle.c \ - swrast\s_accum.c \ - swrast\s_alpha.c \ - swrast\s_alphabuf.c \ - swrast\s_bitmap.c \ - swrast\s_blend.c \ - swrast\s_buffers.c \ - swrast\s_copypix.c \ - swrast\s_context.c \ - swrast\s_depth.c \ - swrast\s_drawpix.c \ - swrast\s_feedback.c \ - swrast\s_fog.c \ - swrast\s_histogram.c \ - swrast\s_lines.c \ - swrast\s_logic.c \ - swrast\s_masking.c \ - swrast\s_pb.c \ - swrast\s_pixeltex.c \ - swrast\s_points.c \ - swrast\s_readpix.c \ - swrast\s_scissor.c \ - swrast\s_span.c \ - swrast\s_stencil.c \ - swrast\s_texture.c \ - swrast\s_triangle.c \ - swrast\s_zoom.c - -DRIVER_SRCS = \ - Trace\tr_context.c \ - Trace\tr_control.c \ - Trace\tr_error.c \ - Trace\tr_support.c \ - Trace\tr_wrapper.c \ - Trace\tr_write.c - -ASM_SRCS = - -SRCS = $(CORE_SRCS) $(DRIVER_SRCS) - -OSMESA_SRCS = OSmesa\osmesa.c -OSMESA_OBJS = OSmesa\osmesa.obj - -all : mesadll install - -!include "$(TOP)/mesawin32.mak" - -mesadll : $(MESADLL) - -CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -LFLAGS = $(dlllflags) $(LFLAGS) - -OBJS = $(ASM_SRCS:.S=.obj) $(CORE_SRCS:.c=.obj) $(DRIVER_SRCS:.c=.obj) -LIBS = $(OPENGL) $(GLU) winmm.lib $(guilibsdll) - -$(MESADLL) : $(OBJS) mesa.def - $(link) $(LFLAGS) -out:$(MESADLL) -def:mesa.def $(OBJS) $(LIBS) - -#install : $(MESADLL) -# @echo "copying Mesa dynamic link library to system directory..." -# -copy $(MESADLL) $(DLLINSTALL) -# @echo "copying Mesa header files to include directory..." -# -copy ..\..\include\GL\gl.h $(INCLUDEINSTALL) -# -copy ..\..\include\GL\glext.h $(INCLUDEINSTALL) -# @echo "copying Mesa import library to library directory..." -# -copy $(MESALIB) $(LIBINSTALL) -install : $(MESADLL) - @echo "copying Mesa dynamic link library to system directory..." - -copy $(MESADLL) $(TOP)\lib - @echo "copying Mesa import library to library directory..." - -copy $(MESALIB) $(TOP)\lib - -.c.obj : - $(cc) $(CFLAGS) -I. $< +# Makefile for Win32 +# +# NOTE: the install target may overwrite important files in the system dir +# Sept 12, 2001 +# Windows driver not working. OSMesa driver works. +# + +!include + +TOP = .. +SUBDIRS = osmesa.dir + +CORE_SRCS = \ + tnl\t_array_api.c \ + tnl\t_array_import.c \ + tnl\t_context.c \ + tnl\t_eval_api.c \ + tnl\t_imm_alloc.c \ + tnl\t_imm_api.c \ + tnl\t_imm_debug.c \ + tnl\t_imm_dlist.c \ + tnl\t_imm_elt.c \ + tnl\t_imm_eval.c \ + tnl\t_imm_exec.c \ + tnl\t_imm_fixup.c \ + tnl\t_pipeline.c \ + tnl\t_vb_fog.c \ + tnl\t_vb_light.c \ + tnl\t_vb_normals.c \ + tnl\t_vb_points.c \ + tnl\t_vb_render.c \ + tnl\t_vb_texgen.c \ + tnl\t_vb_texmat.c \ + tnl\t_vb_vertex.c \ + swrast_setup\ss_context.c \ + swrast_setup\ss_triangle.c \ + swrast_setup\ss_vb.c \ + api_loopback.c \ + api_noop.c \ + api_validate.c \ + accum.c \ + attrib.c \ + blend.c \ + buffers.c \ + clip.c \ + colortab.c \ + config.c \ + context.c \ + convolve.c \ + debug.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 \ + glthread.c \ + hash.c \ + highpc.c \ + hint.c \ + histogram.c \ + image.c \ + imports.c \ + light.c \ + lines.c \ + lowpc.c \ + matrix.c \ + mem.c \ + mmath.c \ + pixel.c \ + points.c \ + polygon.c \ + rastpos.c \ + state.c \ + stencil.c \ + teximage.c \ + texformat.c \ + texobj.c \ + texstate.c \ + texstore.c \ + texutil.c \ + varray.c \ + vtxfmt.c \ +# X86\x86.c \ +# X86\common_x86.c \ +# X86\3dnow.c \ +# X86\sse.c \ + math\m_debug_norm.c \ + math\m_debug_vertex.c \ + math\m_debug_xform.c \ + math\m_eval.c \ + math\m_matrix.c \ + math\m_translate.c \ + math\m_vector.c \ + math\m_vertices.c \ + math\m_xform.c \ + array_cache\ac_context.c \ + array_cache\ac_import.c \ + swrast\s_aaline.c \ + swrast\s_aatriangle.c \ + swrast\s_accum.c \ + swrast\s_alpha.c \ + swrast\s_alphabuf.c \ + swrast\s_bitmap.c \ + swrast\s_blend.c \ + swrast\s_buffers.c \ + swrast\s_copypix.c \ + swrast\s_context.c \ + swrast\s_depth.c \ + swrast\s_drawpix.c \ + swrast\s_feedback.c \ + swrast\s_fog.c \ + swrast\s_histogram.c \ + swrast\s_imaging.c \ + swrast\s_lines.c \ + swrast\s_logic.c \ + swrast\s_masking.c \ + swrast\s_pb.c \ + swrast\s_pixeltex.c \ + swrast\s_points.c \ + swrast\s_readpix.c \ + swrast\s_scissor.c \ + swrast\s_span.c \ + swrast\s_stencil.c \ + swrast\s_texstore.c \ + swrast\s_texture.c \ + swrast\s_triangle.c \ + swrast\s_zoom.c + +DRIVER_SRCS = \ + Trace\tr_context.c \ + Trace\tr_control.c \ + Trace\tr_error.c \ + Trace\tr_support.c \ + Trace\tr_wrapper.c \ + Trace\tr_write.c \ + Windows\wgl.c \ + Windows\wmesa.c + +ASM_SRCS = + +SRCS = $(CORE_SRCS) $(DRIVER_SRCS) + +all : mesadll $(SUBDIRS) + +!include "$(TOP)/mesawin32.mak" + +mesadll : $(MESADLL) + +CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -DBUILD_GL32 -DNO_PARALLEL -DNO_STEREO +LFLAGS = $(dlllflags) $(LFLAGS) + +OBJS = $(ASM_SRCS:.S=.obj) $(CORE_SRCS:.c=.obj) $(DRIVER_SRCS:.c=.obj) +LIBS = $(GLU) winmm.lib $(guilibsdll) + +$(MESADLL) : $(OBJS) mesa.def + $(link) $(LFLAGS) -out:$(MESADLL) -def:mesa.def $(OBJS) $(LIBS) + @echo "copying Mesa dynamic link library to lib directory..." + -copy $(MESADLL) ..\lib + @echo "copying Mesa import library to lib directory..." + -copy $(MESALIB) ..\lib + +$(SUBDIRS) : + @echo. + @echo Making in $* directory + @cd $* + @nmake -f Makefile.win -nologo + @cd .. + +install : $(MESADLL) + @echo "copying Mesa dynamic link library to system directory..." + -copy $(MESADLL) $(DLLINSTALL) + @echo "copying Mesa header files to include directory..." + -copy ..\..\include\GL\gl.h $(INCLUDEINSTALL) + -copy ..\..\include\GL\glext.h $(INCLUDEINSTALL) + @echo "copying Mesa import library to library directory..." + -copy $(MESALIB) $(LIBINSTALL) + +clean :: + @del /f tnl\*.obj + @del /f swrast_setup\*.obj + @del /f math\*.obj + @del /f array_cache\*.obj + @del /f swrast\*.obj + @del /f Trace\*.obj + @del /f osmesa\*.obj + @del /f Windows\*.obj + +# override default inference rule with one that writes the object to +# the correct subdir +.c.obj : + $(cc) $(CFLAGS) -I. $< /Fo$*.obj diff --git a/src/mesa/main/dispatch.c b/src/mesa/main/dispatch.c index 078f7bc73fb..647ee481f7c 100644 --- a/src/mesa/main/dispatch.c +++ b/src/mesa/main/dispatch.c @@ -1,4 +1,4 @@ -/* $Id: dispatch.c,v 1.23 2001/06/05 23:54:00 davem69 Exp $ */ +/* $Id: dispatch.c,v 1.24 2001/09/14 22:19:19 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -50,8 +50,14 @@ #if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM)) +#if defined(WIN32) +#define KEYWORD1 GLAPI +#else #define KEYWORD1 +#endif + #define KEYWORD2 GLAPIENTRY + #if defined(USE_MGL_NAMESPACE) #define NAME(func) mgl##func #else diff --git a/src/mesa/main/mesa.def b/src/mesa/main/mesa.def index 5848dc90ea4..0c384210b32 100644 --- a/src/mesa/main/mesa.def +++ b/src/mesa/main/mesa.def @@ -1,405 +1,473 @@ -DESCRIPTION 'Mesa (OpenGL work-alike) for Win32' -VERSION 3.5 - -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 +DESCRIPTION 'Mesa (OpenGL work-alike) for Win32' +VERSION 3.5 + +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 + _swsetup_Wakeup + _swsetup_CreateContext + _tnl_CreateContext + _ac_CreateContext + _swrast_CreateContext + _mesa_free_context_data + _mesa_create_framebuffer + _mesa_enable_1_3_extensions + _mesa_enable_sw_extensions + _mesa_destroy_visual + _mesa_initialize_context + _mesa_create_visual + _mesa_destroy_framebuffer + _swrast_DestroyContext + _ac_DestroyContext + _tnl_DestroyContext + _swsetup_DestroyContext + _mesa_Viewport + _mesa_make_current + _mesa_get_current_context + _mesa_error + _swrast_choose_triangle + _mesa_zbuffer_address + _swrast_choose_line + _tnl_InvalidateState + _ac_InvalidateState + _swsetup_InvalidateState + _swrast_InvalidateState + _tnl_run_pipeline + _swrast_CopyConvolutionFilter2D + _swrast_CopyConvolutionFilter1D + _swrast_CopyColorSubTable + _swrast_CopyColorTable + _swrast_copy_texsubimage3d + _swrast_copy_texsubimage2d + _swrast_copy_texsubimage1d + _swrast_copy_teximage2d + _swrast_copy_teximage1d + _mesa_test_proxy_teximage + _mesa_store_texsubimage3d + _mesa_store_texsubimage2d + _mesa_store_texsubimage1d + _mesa_store_teximage3d + _mesa_store_teximage2d + _mesa_store_teximage1d + _mesa_choose_tex_format + _mesa_base_compressed_texformat + _mesa_compressed_texture_size + _mesa_get_compressed_teximage + _swrast_ReadPixels + _swrast_DrawPixels + _swrast_CopyPixels + _swrast_Bitmap + _swrast_Accum + _swrast_alloc_buffers + _swrast_GetDeviceDriverReference + _swrast_Clear + wglCopyContext + wglCreateContext + wglDeleteContext + wglCreateLayerContext + wglGetCurrentContext + wglGetCurrentDC + wglMakeCurrent + wglShareLists + wglUseFontBitmapsA + wglUseFontBitmapsW + wglUseFontOutlinesA + wglUseFontOutlinesW + wglDescribeLayerPlane + wglSetLayerPaletteEntries + wglGetLayerPaletteEntries + wglRealizeLayerPalette + wglSwapLayerBuffers + wglChoosePixelFormat + wglDescribePixelFormat + wglGetProcAddress + wglGetPixelFormat + wglSetPixelFormat + wglSwapBuffers -- cgit v1.2.3 From 1f20952a92aa8b8fe000222a9c71086df8fc63d8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 15 Sep 2001 18:00:28 +0000 Subject: removed carriage return chars --- include/GL/glext.h | 6192 ++++++++++++++++++++++++++-------------------------- 1 file changed, 3096 insertions(+), 3096 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 76946953d65..14a1de1c2f3 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -1,3096 +1,3096 @@ -#ifndef __glext_h_ -#define __glext_h_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: This software was created using the -** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has -** not been independently verified as being compliant with the OpenGL(R) -** version 1.2.1 Specification. -*/ - -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) -#define WIN32_LEAN_AND_MEAN 1 -#include -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif - -/*************************************************************/ - -/* Header file version number, required by OpenGL ABI for Linux */ -#define GL_GLEXT_VERSION 7 - -#ifndef GL_VERSION_1_2 -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BLEND_COLOR 0x8005 -#define GL_FUNC_ADD 0x8006 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_BLEND_EQUATION 0x8009 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_RESCALE_NORMAL 0x803A -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#endif - -#ifndef GL_ARB_multitexture -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 -#endif - -#ifndef GL_ARB_transpose_matrix -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 -#endif - -#ifndef GL_ARB_multisample -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLES_ARB 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 -#endif - -#ifndef GL_ARB_texture_cube_map -#define GL_NORMAL_MAP_ARB 0x8511 -#define GL_REFLECTION_MAP_ARB 0x8512 -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C -#endif - -#ifndef GL_ARB_texture_compression -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -#endif - -#ifndef GL_ARB_vertex_blend -#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 -#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 -#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 -#define GL_VERTEX_BLEND_ARB 0x86A7 -#define GL_CURRENT_WEIGHT_ARB 0x86A8 -#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 -#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA -#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB -#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC -#define GL_WEIGHT_ARRAY_ARB 0x86AD -#define GL_MODELVIEW0_ARB 0x1700 -#define GL_MODELVIEW1_ARB 0x850A -#define GL_MODELVIEW2_ARB 0x8722 -#define GL_MODELVIEW3_ARB 0x8723 -#define GL_MODELVIEW4_ARB 0x8724 -#define GL_MODELVIEW5_ARB 0x8725 -#define GL_MODELVIEW6_ARB 0x8726 -#define GL_MODELVIEW7_ARB 0x8727 -#define GL_MODELVIEW8_ARB 0x8728 -#define GL_MODELVIEW9_ARB 0x8729 -#define GL_MODELVIEW10_ARB 0x872A -#define GL_MODELVIEW11_ARB 0x872B -#define GL_MODELVIEW12_ARB 0x872C -#define GL_MODELVIEW13_ARB 0x872D -#define GL_MODELVIEW14_ARB 0x872E -#define GL_MODELVIEW15_ARB 0x872F -#define GL_MODELVIEW16_ARB 0x8730 -#define GL_MODELVIEW17_ARB 0x8731 -#define GL_MODELVIEW18_ARB 0x8732 -#define GL_MODELVIEW19_ARB 0x8733 -#define GL_MODELVIEW20_ARB 0x8734 -#define GL_MODELVIEW21_ARB 0x8735 -#define GL_MODELVIEW22_ARB 0x8736 -#define GL_MODELVIEW23_ARB 0x8737 -#define GL_MODELVIEW24_ARB 0x8738 -#define GL_MODELVIEW25_ARB 0x8739 -#define GL_MODELVIEW26_ARB 0x873A -#define GL_MODELVIEW27_ARB 0x873B -#define GL_MODELVIEW28_ARB 0x873C -#define GL_MODELVIEW29_ARB 0x873D -#define GL_MODELVIEW30_ARB 0x873E -#define GL_MODELVIEW31_ARB 0x873F -#endif - -#ifndef GL_ARB_texture_env_combine -#define GL_COMBINE_ARB 0x8570 -#define GL_COMBINE_RGB_ARB 0x8571 -#define GL_COMBINE_ALPHA_ARB 0x8572 -#define GL_SOURCE0_RGB_ARB 0x8580 -#define GL_SOURCE1_RGB_ARB 0x8581 -#define GL_SOURCE2_RGB_ARB 0x8582 -#define GL_SOURCE0_ALPHA_ARB 0x8588 -#define GL_SOURCE1_ALPHA_ARB 0x8589 -#define GL_SOURCE2_ALPHA_ARB 0x858A -#define GL_OPERAND0_RGB_ARB 0x8590 -#define GL_OPERAND1_RGB_ARB 0x8591 -#define GL_OPERAND2_RGB_ARB 0x8592 -#define GL_OPERAND0_ALPHA_ARB 0x8598 -#define GL_OPERAND1_ALPHA_ARB 0x8599 -#define GL_OPERAND2_ALPHA_ARB 0x859A -#define GL_RGB_SCALE_ARB 0x8573 -#define GL_ADD_SIGNED_ARB 0x8574 -#define GL_INTERPOLATE_ARB 0x8575 -#define GL_SUBTRACT_ARB 0x84E7 -#define GL_CONSTANT_ARB 0x8576 -#define GL_PRIMARY_COLOR_ARB 0x8577 -#define GL_PREVIOUS_ARB 0x8578 -#endif - -#ifndef GL_ARB_texture_env_dot3 -#define GL_DOT3_RGB_ARB 0x86AE -#define GL_DOT3_RGBA_ARB 0x86AF -#endif - -#ifndef GL_ARB_texture_border_clamp -#define GL_CLAMP_TO_BORDER_ARB 0x812D -#endif - -#ifndef GL_EXT_abgr -#define GL_ABGR_EXT 0x8000 -#endif - -#ifndef GL_EXT_blend_color -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_COLOR_EXT 0x8005 -#endif - -#ifndef GL_EXT_polygon_offset -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 -#endif - -#ifndef GL_EXT_texture -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 -#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 -#endif - -#ifndef GL_EXT_texture3D -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -#endif - -#ifndef GL_SGIS_texture_filter4 -#define GL_FILTER4_SGIS 0x8146 -#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 -#endif - -#ifndef GL_EXT_subtexture -#endif - -#ifndef GL_EXT_copy_texture -#endif - -#ifndef GL_EXT_histogram -#define GL_HISTOGRAM_EXT 0x8024 -#define GL_PROXY_HISTOGRAM_EXT 0x8025 -#define GL_HISTOGRAM_WIDTH_EXT 0x8026 -#define GL_HISTOGRAM_FORMAT_EXT 0x8027 -#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C -#define GL_HISTOGRAM_SINK_EXT 0x802D -#define GL_MINMAX_EXT 0x802E -#define GL_MINMAX_FORMAT_EXT 0x802F -#define GL_MINMAX_SINK_EXT 0x8030 -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -#endif - -#ifndef GL_EXT_convolution -#define GL_CONVOLUTION_1D_EXT 0x8010 -#define GL_CONVOLUTION_2D_EXT 0x8011 -#define GL_SEPARABLE_2D_EXT 0x8012 -#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 -#define GL_REDUCE_EXT 0x8016 -#define GL_CONVOLUTION_FORMAT_EXT 0x8017 -#define GL_CONVOLUTION_WIDTH_EXT 0x8018 -#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 -#endif - -#ifndef GL_SGI_color_matrix -#define GL_COLOR_MATRIX_SGI 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB -#endif - -#ifndef GL_SGI_color_table -#define GL_COLOR_TABLE_SGI 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 -#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 -#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 -#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF -#endif - -#ifndef GL_SGIS_pixel_texture -#define GL_PIXEL_TEXTURE_SGIS 0x8353 -#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 -#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 -#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 -#endif - -#ifndef GL_SGIX_pixel_texture -#define GL_PIXEL_TEX_GEN_SGIX 0x8139 -#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B -#endif - -#ifndef GL_SGIS_texture4D -#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 -#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 -#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 -#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 -#define GL_TEXTURE_4D_SGIS 0x8134 -#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 -#define GL_TEXTURE_4DSIZE_SGIS 0x8136 -#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 -#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 -#define GL_TEXTURE_4D_BINDING_SGIS 0x814F -#endif - -#ifndef GL_SGI_texture_color_table -#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC -#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD -#endif - -#ifndef GL_EXT_cmyka -#define GL_CMYK_EXT 0x800C -#define GL_CMYKA_EXT 0x800D -#define GL_PACK_CMYK_HINT_EXT 0x800E -#define GL_UNPACK_CMYK_HINT_EXT 0x800F -#endif - -#ifndef GL_EXT_texture_object -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A -#endif - -#ifndef GL_SGIS_detail_texture -#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 -#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 -#define GL_LINEAR_DETAIL_SGIS 0x8097 -#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 -#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 -#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A -#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B -#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C -#endif - -#ifndef GL_SGIS_sharpen_texture -#define GL_LINEAR_SHARPEN_SGIS 0x80AD -#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE -#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF -#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 -#endif - -#ifndef GL_EXT_packed_pixels -#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 -#endif - -#ifndef GL_SGIS_texture_lod -#define GL_TEXTURE_MIN_LOD_SGIS 0x813A -#define GL_TEXTURE_MAX_LOD_SGIS 0x813B -#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C -#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D -#endif - -#ifndef GL_SGIS_multisample -#define GL_MULTISAMPLE_SGIS 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F -#define GL_SAMPLE_MASK_SGIS 0x80A0 -#define GL_1PASS_SGIS 0x80A1 -#define GL_2PASS_0_SGIS 0x80A2 -#define GL_2PASS_1_SGIS 0x80A3 -#define GL_4PASS_0_SGIS 0x80A4 -#define GL_4PASS_1_SGIS 0x80A5 -#define GL_4PASS_2_SGIS 0x80A6 -#define GL_4PASS_3_SGIS 0x80A7 -#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 -#define GL_SAMPLES_SGIS 0x80A9 -#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA -#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB -#define GL_SAMPLE_PATTERN_SGIS 0x80AC -#endif - -#ifndef GL_EXT_rescale_normal -#define GL_RESCALE_NORMAL_EXT 0x803A -#endif - -#ifndef GL_EXT_vertex_array -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 -#endif - -#ifndef GL_EXT_misc_attribute -#endif - -#ifndef GL_SGIS_generate_mipmap -#define GL_GENERATE_MIPMAP_SGIS 0x8191 -#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 -#endif - -#ifndef GL_SGIX_clipmap -#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 -#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 -#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 -#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 -#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 -#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 -#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 -#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 -#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 -#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D -#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E -#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F -#endif - -#ifndef GL_SGIX_shadow -#define GL_TEXTURE_COMPARE_SGIX 0x819A -#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B -#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C -#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D -#endif - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_CLAMP_TO_EDGE_SGIS 0x812F -#endif - -#ifndef GL_SGIS_texture_border_clamp -#define GL_CLAMP_TO_BORDER_SGIS 0x812D -#endif - -#ifndef GL_EXT_blend_minmax -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_BLEND_EQUATION_EXT 0x8009 -#endif - -#ifndef GL_EXT_blend_subtract -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B -#endif - -#ifndef GL_EXT_blend_logic_op -#endif - -#ifndef GL_SGIX_interlace -#define GL_INTERLACE_SGIX 0x8094 -#endif - -#ifndef GL_SGIX_pixel_tiles -#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E -#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F -#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 -#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 -#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 -#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 -#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 -#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 -#endif - -#ifndef GL_SGIS_texture_select -#define GL_DUAL_ALPHA4_SGIS 0x8110 -#define GL_DUAL_ALPHA8_SGIS 0x8111 -#define GL_DUAL_ALPHA12_SGIS 0x8112 -#define GL_DUAL_ALPHA16_SGIS 0x8113 -#define GL_DUAL_LUMINANCE4_SGIS 0x8114 -#define GL_DUAL_LUMINANCE8_SGIS 0x8115 -#define GL_DUAL_LUMINANCE12_SGIS 0x8116 -#define GL_DUAL_LUMINANCE16_SGIS 0x8117 -#define GL_DUAL_INTENSITY4_SGIS 0x8118 -#define GL_DUAL_INTENSITY8_SGIS 0x8119 -#define GL_DUAL_INTENSITY12_SGIS 0x811A -#define GL_DUAL_INTENSITY16_SGIS 0x811B -#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C -#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D -#define GL_QUAD_ALPHA4_SGIS 0x811E -#define GL_QUAD_ALPHA8_SGIS 0x811F -#define GL_QUAD_LUMINANCE4_SGIS 0x8120 -#define GL_QUAD_LUMINANCE8_SGIS 0x8121 -#define GL_QUAD_INTENSITY4_SGIS 0x8122 -#define GL_QUAD_INTENSITY8_SGIS 0x8123 -#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 -#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 -#endif - -#ifndef GL_SGIX_sprite -#define GL_SPRITE_SGIX 0x8148 -#define GL_SPRITE_MODE_SGIX 0x8149 -#define GL_SPRITE_AXIS_SGIX 0x814A -#define GL_SPRITE_TRANSLATION_SGIX 0x814B -#define GL_SPRITE_AXIAL_SGIX 0x814C -#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D -#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E -#endif - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E -#endif - -#ifndef GL_SGIS_point_parameters -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MIN_SGIS 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_SIZE_MAX_SGIS 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 -#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 -#endif - -#ifndef GL_SGIX_instruments -#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 -#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 -#endif - -#ifndef GL_SGIX_texture_scale_bias -#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 -#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A -#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B -#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C -#endif - -#ifndef GL_SGIX_framezoom -#define GL_FRAMEZOOM_SGIX 0x818B -#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C -#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D -#endif - -#ifndef GL_SGIX_tag_sample_buffer -#endif - -#ifndef GL_FfdMaskSGIX -#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 -#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 -#endif - -#ifndef GL_SGIX_polynomial_ffd -#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 -#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 -#define GL_DEFORMATIONS_MASK_SGIX 0x8196 -#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 -#endif - -#ifndef GL_SGIX_reference_plane -#define GL_REFERENCE_PLANE_SGIX 0x817D -#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E -#endif - -#ifndef GL_SGIX_flush_raster -#endif - -#ifndef GL_SGIX_depth_texture -#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 -#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 -#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 -#endif - -#ifndef GL_SGIS_fog_function -#define GL_FOG_FUNC_SGIS 0x812A -#define GL_FOG_FUNC_POINTS_SGIS 0x812B -#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C -#endif - -#ifndef GL_SGIX_fog_offset -#define GL_FOG_OFFSET_SGIX 0x8198 -#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 -#endif - -#ifndef GL_HP_image_transform -#define GL_IMAGE_SCALE_X_HP 0x8155 -#define GL_IMAGE_SCALE_Y_HP 0x8156 -#define GL_IMAGE_TRANSLATE_X_HP 0x8157 -#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 -#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 -#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A -#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B -#define GL_IMAGE_MAG_FILTER_HP 0x815C -#define GL_IMAGE_MIN_FILTER_HP 0x815D -#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E -#define GL_CUBIC_HP 0x815F -#define GL_AVERAGE_HP 0x8160 -#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 -#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 -#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 -#endif - -#ifndef GL_HP_convolution_border_modes -#define GL_IGNORE_BORDER_HP 0x8150 -#define GL_CONSTANT_BORDER_HP 0x8151 -#define GL_REPLICATE_BORDER_HP 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 -#endif - -#ifndef GL_INGR_palette_buffer -#endif - -#ifndef GL_SGIX_texture_add_env -#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE -#endif - -#ifndef GL_EXT_color_subtable -#endif - -#ifndef GL_PGI_vertex_hints -#define GL_VERTEX_DATA_HINT_PGI 0x1A22A -#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B -#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C -#define GL_MAX_VERTEX_HINT_PGI 0x1A22D -#define GL_COLOR3_BIT_PGI 0x00010000 -#define GL_COLOR4_BIT_PGI 0x00020000 -#define GL_EDGEFLAG_BIT_PGI 0x00040000 -#define GL_INDEX_BIT_PGI 0x00080000 -#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 -#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 -#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 -#define GL_MAT_EMISSION_BIT_PGI 0x00800000 -#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 -#define GL_MAT_SHININESS_BIT_PGI 0x02000000 -#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 -#define GL_NORMAL_BIT_PGI 0x08000000 -#define GL_TEXCOORD1_BIT_PGI 0x10000000 -#define GL_TEXCOORD2_BIT_PGI 0x20000000 -#define GL_TEXCOORD3_BIT_PGI 0x40000000 -#define GL_TEXCOORD4_BIT_PGI 0x80000000 -#define GL_VERTEX23_BIT_PGI 0x00000004 -#define GL_VERTEX4_BIT_PGI 0x00000008 -#endif - -#ifndef GL_PGI_misc_hints -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 -#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD -#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 -#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C -#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E -#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F -#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 -#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 -#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 -#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 -#define GL_CLIP_NEAR_HINT_PGI 0x1A220 -#define GL_CLIP_FAR_HINT_PGI 0x1A221 -#define GL_WIDE_LINE_HINT_PGI 0x1A222 -#define GL_BACK_NORMALS_HINT_PGI 0x1A223 -#endif - -#ifndef GL_EXT_paletted_texture -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 -#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -#endif - -#ifndef GL_EXT_clip_volume_hint -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 -#endif - -#ifndef GL_SGIX_list_priority -#define GL_LIST_PRIORITY_SGIX 0x8182 -#endif - -#ifndef GL_SGIX_ir_instrument1 -#define GL_IR_INSTRUMENT1_SGIX 0x817F -#endif - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 -#endif - -#ifndef GL_SGIX_texture_lod_bias -#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E -#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F -#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 -#endif - -#ifndef GL_SGIX_shadow_ambient -#define GL_SHADOW_AMBIENT_SGIX 0x80BF -#endif - -#ifndef GL_EXT_index_texture -#endif - -#ifndef GL_EXT_index_material -#define GL_INDEX_MATERIAL_EXT 0x81B8 -#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 -#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA -#endif - -#ifndef GL_EXT_index_func -#define GL_INDEX_TEST_EXT 0x81B5 -#define GL_INDEX_TEST_FUNC_EXT 0x81B6 -#define GL_INDEX_TEST_REF_EXT 0x81B7 -#endif - -#ifndef GL_EXT_index_array_formats -#define GL_IUI_V2F_EXT 0x81AD -#define GL_IUI_V3F_EXT 0x81AE -#define GL_IUI_N3F_V2F_EXT 0x81AF -#define GL_IUI_N3F_V3F_EXT 0x81B0 -#define GL_T2F_IUI_V2F_EXT 0x81B1 -#define GL_T2F_IUI_V3F_EXT 0x81B2 -#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 -#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 -#endif - -#ifndef GL_EXT_compiled_vertex_array -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 -#endif - -#ifndef GL_EXT_cull_vertex -#define GL_CULL_VERTEX_EXT 0x81AA -#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB -#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC -#endif - -#ifndef GL_SGIX_ycrcb -#define GL_YCRCB_422_SGIX 0x81BB -#define GL_YCRCB_444_SGIX 0x81BC -#endif - -#ifndef GL_SGIX_fragment_lighting -#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 -#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 -#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 -#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 -#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 -#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 -#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 -#define GL_LIGHT_ENV_MODE_SGIX 0x8407 -#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 -#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 -#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A -#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B -#define GL_FRAGMENT_LIGHT0_SGIX 0x840C -#define GL_FRAGMENT_LIGHT1_SGIX 0x840D -#define GL_FRAGMENT_LIGHT2_SGIX 0x840E -#define GL_FRAGMENT_LIGHT3_SGIX 0x840F -#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 -#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 -#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 -#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 -#endif - -#ifndef GL_IBM_rasterpos_clip -#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 -#endif - -#ifndef GL_HP_texture_lighting -#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 -#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 -#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 -#endif - -#ifndef GL_EXT_draw_range_elements -#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 -#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 -#endif - -#ifndef GL_WIN_phong_shading -#define GL_PHONG_WIN 0x80EA -#define GL_PHONG_HINT_WIN 0x80EB -#endif - -#ifndef GL_WIN_specular_fog -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC -#endif - -#ifndef GL_EXT_light_texture -#define GL_FRAGMENT_MATERIAL_EXT 0x8349 -#define GL_FRAGMENT_NORMAL_EXT 0x834A -#define GL_FRAGMENT_COLOR_EXT 0x834C -#define GL_ATTENUATION_EXT 0x834D -#define GL_SHADOW_ATTENUATION_EXT 0x834E -#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F -#define GL_TEXTURE_LIGHT_EXT 0x8350 -#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 -#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 -/* reuse GL_FRAGMENT_DEPTH_EXT */ -#endif - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_ALPHA_MIN_SGIX 0x8320 -#define GL_ALPHA_MAX_SGIX 0x8321 -#endif - -#ifndef GL_EXT_bgra -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 -#endif - -#ifndef GL_SGIX_async -#define GL_ASYNC_MARKER_SGIX 0x8329 -#endif - -#ifndef GL_SGIX_async_pixel -#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C -#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D -#define GL_ASYNC_READ_PIXELS_SGIX 0x835E -#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F -#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 -#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 -#endif - -#ifndef GL_SGIX_async_histogram -#define GL_ASYNC_HISTOGRAM_SGIX 0x832C -#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D -#endif - -#ifndef GL_INTEL_texture_scissor -#endif - -#ifndef GL_INTEL_parallel_arrays -#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 -#endif - -#ifndef GL_HP_occlusion_test -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 -#endif - -#ifndef GL_EXT_pixel_transform -#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 -#define GL_PIXEL_MAG_FILTER_EXT 0x8331 -#define GL_PIXEL_MIN_FILTER_EXT 0x8332 -#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 -#define GL_CUBIC_EXT 0x8334 -#define GL_AVERAGE_EXT 0x8335 -#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 -#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 -#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 -#endif - -#ifndef GL_EXT_pixel_transform_color_table -#endif - -#ifndef GL_EXT_shared_texture_palette -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB -#endif - -#ifndef GL_EXT_separate_specular_color -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#endif - -#ifndef GL_EXT_secondary_color -#define GL_COLOR_SUM_EXT 0x8458 -#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D -#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E -#endif - -#ifndef GL_EXT_texture_perturb_normal -#define GL_PERTURB_EXT 0x85AE -#define GL_TEXTURE_NORMAL_EXT 0x85AF -#endif - -#ifndef GL_EXT_multi_draw_arrays -#endif - -#ifndef GL_EXT_fog_coord -#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 -#define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 -#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 -#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 -#endif - -#ifndef GL_REND_screen_coordinates -#define GL_SCREEN_COORDINATES_REND 0x8490 -#define GL_INVERTED_SCREEN_W_REND 0x8491 -#endif - -#ifndef GL_EXT_coordinate_frame -#define GL_TANGENT_ARRAY_EXT 0x8439 -#define GL_BINORMAL_ARRAY_EXT 0x843A -#define GL_CURRENT_TANGENT_EXT 0x843B -#define GL_CURRENT_BINORMAL_EXT 0x843C -#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E -#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F -#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 -#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 -#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 -#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 -#define GL_MAP1_TANGENT_EXT 0x8444 -#define GL_MAP2_TANGENT_EXT 0x8445 -#define GL_MAP1_BINORMAL_EXT 0x8446 -#define GL_MAP2_BINORMAL_EXT 0x8447 -#endif - -#ifndef GL_EXT_texture_env_combine -#define GL_COMBINE_EXT 0x8570 -#define GL_COMBINE_RGB_EXT 0x8571 -#define GL_COMBINE_ALPHA_EXT 0x8572 -#define GL_RGB_SCALE_EXT 0x8573 -#define GL_ADD_SIGNED_EXT 0x8574 -#define GL_INTERPOLATE_EXT 0x8575 -#define GL_CONSTANT_EXT 0x8576 -#define GL_PRIMARY_COLOR_EXT 0x8577 -#define GL_PREVIOUS_EXT 0x8578 -#define GL_SOURCE0_RGB_EXT 0x8580 -#define GL_SOURCE1_RGB_EXT 0x8581 -#define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE3_RGB_EXT 0x8583 -#define GL_SOURCE4_RGB_EXT 0x8584 -#define GL_SOURCE5_RGB_EXT 0x8585 -#define GL_SOURCE6_RGB_EXT 0x8586 -#define GL_SOURCE7_RGB_EXT 0x8587 -#define GL_SOURCE0_ALPHA_EXT 0x8588 -#define GL_SOURCE1_ALPHA_EXT 0x8589 -#define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_SOURCE3_ALPHA_EXT 0x858B -#define GL_SOURCE4_ALPHA_EXT 0x858C -#define GL_SOURCE5_ALPHA_EXT 0x858D -#define GL_SOURCE6_ALPHA_EXT 0x858E -#define GL_SOURCE7_ALPHA_EXT 0x858F -#define GL_OPERAND0_RGB_EXT 0x8590 -#define GL_OPERAND1_RGB_EXT 0x8591 -#define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND3_RGB_EXT 0x8593 -#define GL_OPERAND4_RGB_EXT 0x8594 -#define GL_OPERAND5_RGB_EXT 0x8595 -#define GL_OPERAND6_RGB_EXT 0x8596 -#define GL_OPERAND7_RGB_EXT 0x8597 -#define GL_OPERAND0_ALPHA_EXT 0x8598 -#define GL_OPERAND1_ALPHA_EXT 0x8599 -#define GL_OPERAND2_ALPHA_EXT 0x859A -#define GL_OPERAND3_ALPHA_EXT 0x859B -#define GL_OPERAND4_ALPHA_EXT 0x859C -#define GL_OPERAND5_ALPHA_EXT 0x859D -#define GL_OPERAND6_ALPHA_EXT 0x859E -#define GL_OPERAND7_ALPHA_EXT 0x859F -#endif - -#ifndef GL_APPLE_specular_vector -#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 -#endif - -#ifndef GL_APPLE_transform_hint -#define GL_TRANSFORM_HINT_APPLE 0x85B1 -#endif - -#ifndef GL_SGIX_fog_scale -#define GL_FOG_SCALE_SGIX 0x81FC -#define GL_FOG_SCALE_VALUE_SGIX 0x81FD -#endif - -#ifndef GL_SUNX_constant_data -#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 -#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 -#endif - -#ifndef GL_SUN_global_alpha -#define GL_GLOBAL_ALPHA_SUN 0x81D9 -#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA -#endif - -#ifndef GL_SUN_triangle_list -#define GL_RESTART_SUN 0x01 -#define GL_REPLACE_MIDDLE_SUN 0x02 -#define GL_REPLACE_OLDEST_SUN 0x03 -#define GL_TRIANGLE_LIST_SUN 0x81D7 -#define GL_REPLACEMENT_CODE_SUN 0x81D8 -#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 -#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 -#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 -#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 -#define GL_R1UI_V3F_SUN 0x85C4 -#define GL_R1UI_C4UB_V3F_SUN 0x85C5 -#define GL_R1UI_C3F_V3F_SUN 0x85C6 -#define GL_R1UI_N3F_V3F_SUN 0x85C7 -#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 -#define GL_R1UI_T2F_V3F_SUN 0x85C9 -#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA -#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB -#endif - -#ifndef GL_SUN_vertex -#endif - -#ifndef GL_EXT_blend_func_separate -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB -#endif - -#ifndef GL_INGR_color_clamp -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 -#endif - -#ifndef GL_INGR_interlace_read -#define GL_INTERLACE_READ_INGR 0x8568 -#endif - -#ifndef GL_EXT_stencil_wrap -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 -#endif - -#ifndef GL_EXT_422_pixels -#define GL_422_EXT 0x80CC -#define GL_422_REV_EXT 0x80CD -#define GL_422_AVERAGE_EXT 0x80CE -#define GL_422_REV_AVERAGE_EXT 0x80CF -#endif - -#ifndef GL_NV_texgen_reflection -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 -#endif - -#ifndef GL_EXT_texture_cube_map -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C -#endif - -#ifndef GL_SUN_convolution_border_modes -#define GL_WRAP_BORDER_SUN 0x81D4 -#endif - -#ifndef GL_EXT_texture_env_add -#endif - -#ifndef GL_EXT_texture_lod_bias -#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 -#endif - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif - -#ifndef GL_EXT_vertex_weighting -#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH -#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 -#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX -#define GL_MODELVIEW_MATRIX1_EXT 0x8506 -#define GL_VERTEX_WEIGHTING_EXT 0x8509 -#define GL_MODELVIEW0_EXT GL_MODELVIEW -#define GL_MODELVIEW1_EXT 0x850A -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F -#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 -#endif - -#ifndef GL_NV_light_max_exponent -#define GL_MAX_SHININESS_NV 0x8504 -#define GL_MAX_SPOT_EXPONENT_NV 0x8505 -#endif - -#ifndef GL_NV_vertex_array_range -#define GL_VERTEX_ARRAY_RANGE_NV 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E -#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 -#endif - -#ifndef GL_NV_register_combiners -#define GL_REGISTER_COMBINERS_NV 0x8522 -#define GL_VARIABLE_A_NV 0x8523 -#define GL_VARIABLE_B_NV 0x8524 -#define GL_VARIABLE_C_NV 0x8525 -#define GL_VARIABLE_D_NV 0x8526 -#define GL_VARIABLE_E_NV 0x8527 -#define GL_VARIABLE_F_NV 0x8528 -#define GL_VARIABLE_G_NV 0x8529 -#define GL_CONSTANT_COLOR0_NV 0x852A -#define GL_CONSTANT_COLOR1_NV 0x852B -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -#define GL_SPARE0_NV 0x852E -#define GL_SPARE1_NV 0x852F -#define GL_DISCARD_NV 0x8530 -#define GL_E_TIMES_F_NV 0x8531 -#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 -#define GL_UNSIGNED_IDENTITY_NV 0x8536 -#define GL_UNSIGNED_INVERT_NV 0x8537 -#define GL_EXPAND_NORMAL_NV 0x8538 -#define GL_EXPAND_NEGATE_NV 0x8539 -#define GL_HALF_BIAS_NORMAL_NV 0x853A -#define GL_HALF_BIAS_NEGATE_NV 0x853B -#define GL_SIGNED_IDENTITY_NV 0x853C -#define GL_SIGNED_NEGATE_NV 0x853D -#define GL_SCALE_BY_TWO_NV 0x853E -#define GL_SCALE_BY_FOUR_NV 0x853F -#define GL_SCALE_BY_ONE_HALF_NV 0x8540 -#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 -#define GL_COMBINER_INPUT_NV 0x8542 -#define GL_COMBINER_MAPPING_NV 0x8543 -#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 -#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 -#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 -#define GL_COMBINER_MUX_SUM_NV 0x8547 -#define GL_COMBINER_SCALE_NV 0x8548 -#define GL_COMBINER_BIAS_NV 0x8549 -#define GL_COMBINER_AB_OUTPUT_NV 0x854A -#define GL_COMBINER_CD_OUTPUT_NV 0x854B -#define GL_COMBINER_SUM_OUTPUT_NV 0x854C -#define GL_MAX_GENERAL_COMBINERS_NV 0x854D -#define GL_NUM_GENERAL_COMBINERS_NV 0x854E -#define GL_COLOR_SUM_CLAMP_NV 0x854F -#define GL_COMBINER0_NV 0x8550 -#define GL_COMBINER1_NV 0x8551 -#define GL_COMBINER2_NV 0x8552 -#define GL_COMBINER3_NV 0x8553 -#define GL_COMBINER4_NV 0x8554 -#define GL_COMBINER5_NV 0x8555 -#define GL_COMBINER6_NV 0x8556 -#define GL_COMBINER7_NV 0x8557 -/* reuse GL_TEXTURE0_ARB */ -/* reuse GL_TEXTURE1_ARB */ -/* reuse GL_ZERO */ -/* reuse GL_NONE */ -/* reuse GL_FOG */ -#endif - -#ifndef GL_NV_fog_distance -#define GL_FOG_DISTANCE_MODE_NV 0x855A -#define GL_EYE_RADIAL_NV 0x855B -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C -/* reuse GL_EYE_PLANE */ -#endif - -#ifndef GL_NV_texgen_emboss -#define GL_EMBOSS_LIGHT_NV 0x855D -#define GL_EMBOSS_CONSTANT_NV 0x855E -#define GL_EMBOSS_MAP_NV 0x855F -#endif - -#ifndef GL_NV_blend_square -#endif - -#ifndef GL_NV_texture_env_combine4 -#define GL_COMBINE4_NV 0x8503 -#define GL_SOURCE3_RGB_NV 0x8583 -#define GL_SOURCE3_ALPHA_NV 0x858B -#define GL_OPERAND3_RGB_NV 0x8593 -#define GL_OPERAND3_ALPHA_NV 0x859B -#endif - -#ifndef GL_MESA_resize_buffers -#endif - -#ifndef GL_MESA_window_pos -#endif - -#ifndef GL_EXT_texture_compression_s3tc -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#endif - -#ifndef GL_IBM_cull_vertex -#define GL_CULL_VERTEX_IBM 103050 -#endif - -#ifndef GL_IBM_multimode_draw_arrays -#endif - -#ifndef GL_IBM_vertex_array_lists -#define GL_VERTEX_ARRAY_LIST_IBM 103070 -#define GL_NORMAL_ARRAY_LIST_IBM 103071 -#define GL_COLOR_ARRAY_LIST_IBM 103072 -#define GL_INDEX_ARRAY_LIST_IBM 103073 -#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 -#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 -#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 -#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 -#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 -#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 -#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 -#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 -#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 -#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 -#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 -#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 -#endif - -#ifndef GL_SGIX_subsample -#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 -#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 -#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 -#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 -#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 -#endif - -#ifndef GL_SGIX_ycrcb_subsample -#endif - -#ifndef GL_SGIX_ycrcba -#define GL_YCRCB_SGIX 0x8318 -#define GL_YCRCBA_SGIX 0x8319 -#endif - -#ifndef GL_SGI_depth_pass_instrument -#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 -#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 -#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 -#endif - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 -#endif - -#ifndef GL_3DFX_multisample -#define GL_MULTISAMPLE_3DFX 0x86B2 -#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 -#define GL_SAMPLES_3DFX 0x86B4 -#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 -#endif - -#ifndef GL_3DFX_tbuffer -#endif - -#ifndef GL_EXT_multisample -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#define GL_SAMPLE_MASK_EXT 0x80A0 -#define GL_1PASS_EXT 0x80A1 -#define GL_2PASS_0_EXT 0x80A2 -#define GL_2PASS_1_EXT 0x80A3 -#define GL_4PASS_0_EXT 0x80A4 -#define GL_4PASS_1_EXT 0x80A5 -#define GL_4PASS_2_EXT 0x80A6 -#define GL_4PASS_3_EXT 0x80A7 -#define GL_SAMPLE_BUFFERS_EXT 0x80A8 -#define GL_SAMPLES_EXT 0x80A9 -#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA -#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB -#define GL_SAMPLE_PATTERN_EXT 0x80AC -#endif - -#ifndef GL_SGIX_vertex_preclip -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF -#endif - -#ifndef GL_SGIX_convolution_accuracy -#define GL_CONVOLUTION_HINT_SGIX 0x8316 -#endif - -#ifndef GL_SGIX_resample -#define GL_PACK_RESAMPLE_SGIX 0x842C -#define GL_UNPACK_RESAMPLE_SGIX 0x842D -#define GL_RESAMPLE_REPLICATE_SGIX 0x842E -#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F -#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 -#endif - -#ifndef GL_SGIS_point_line_texgen -#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 -#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 -#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 -#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 -#define GL_EYE_POINT_SGIS 0x81F4 -#define GL_OBJECT_POINT_SGIS 0x81F5 -#define GL_EYE_LINE_SGIS 0x81F6 -#define GL_OBJECT_LINE_SGIS 0x81F7 -#endif - -#ifndef GL_SGIS_texture_color_mask -#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF -#endif - -#ifndef GL_EXT_texture_env_dot3 -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 -#endif - - -/*************************************************************/ - -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); -GLAPI void APIENTRY glBlendEquation (GLenum); -GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); -GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); -GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); -GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); -GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean); -GLAPI void APIENTRY glResetHistogram (GLenum); -GLAPI void APIENTRY glResetMinmax (GLenum); -GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -typedef void (APIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); -typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (APIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); -typedef void (APIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); -typedef void (APIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif - -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTextureARB (GLenum); -GLAPI void APIENTRY glClientActiveTextureARB (GLenum); -GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); -GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); -GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); -#endif - -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); -GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); -GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); -GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -#endif - -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePassARB (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRY * PFNGLSAMPLEPASSARBPROC) (GLenum pass); -#endif - -#ifndef GL_ARB_texture_env_add -#define GL_ARB_texture_env_add 1 -#endif - -#ifndef GL_ARB_texture_cube_map -#define GL_ARB_texture_cube_map 1 -#endif - -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, void *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img); -#endif - -#ifndef GL_ARB_texture_env_combine -#define GL_ARB_texture_env_combine 1 -#endif - -#ifndef GL_ARB_texture_env_dot3 -#define GL_ARB_texture_env_dot3 1 -#endif - -#ifndef GL_ARB_texture_border_clamp -#define GL_ARB_texture_border_clamp 1 -#endif - -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -#endif - -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); -#endif - -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 -#endif - -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_SGIS_texture_filter4 -#define GL_SGIS_texture_filter4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); -typedef void (APIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); -#endif - -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); -GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); -GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif - -#ifndef GL_EXT_histogram -#define GL_EXT_histogram 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); -GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); -GLAPI void APIENTRY glResetHistogramEXT (GLenum); -GLAPI void APIENTRY glResetMinmaxEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); -typedef void (APIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); -#endif - -#ifndef GL_EXT_convolution -#define GL_EXT_convolution 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); -GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -#endif - -#ifndef GL_EXT_color_matrix -#define GL_EXT_color_matrix 1 -#endif - -#ifndef GL_SGI_color_table -#define GL_SGI_color_table 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); -#endif - -#ifndef GL_SGIX_pixel_texture -#define GL_SGIX_pixel_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); -#endif - -#ifndef GL_SGIS_pixel_texture -#define GL_SGIS_pixel_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); -GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); -GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); -GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); -GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); -GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); -#endif - -#ifndef GL_SGIS_texture4D -#define GL_SGIS_texture4D 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_SGI_texture_color_table -#define GL_SGI_texture_color_table 1 -#endif - -#ifndef GL_EXT_cmyka -#define GL_EXT_cmyka 1 -#endif - -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); -GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); -GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); -typedef void (APIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); -typedef void (APIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); -typedef void (APIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); -typedef GLboolean (APIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); -typedef void (APIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); -#endif - -#ifndef GL_SGIS_detail_texture -#define GL_SGIS_detail_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#endif - -#ifndef GL_SGIS_sharpen_texture -#define GL_SGIS_sharpen_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#endif - -#ifndef GL_EXT_packed_pixels -#define GL_EXT_packed_pixels 1 -#endif - -#ifndef GL_SGIS_texture_lod -#define GL_SGIS_texture_lod 1 -#endif - -#ifndef GL_SGIS_multisample -#define GL_SGIS_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePatternSGIS (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); -#endif - -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 -#endif - -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glArrayElementEXT (GLint); -GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); -GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); -GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); -GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (APIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); -typedef void (APIENTRY * PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); -typedef void (APIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_misc_attribute -#define GL_EXT_misc_attribute 1 -#endif - -#ifndef GL_SGIS_generate_mipmap -#define GL_SGIS_generate_mipmap 1 -#endif - -#ifndef GL_SGIX_clipmap -#define GL_SGIX_clipmap 1 -#endif - -#ifndef GL_SGIX_shadow -#define GL_SGIX_shadow 1 -#endif - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 -#endif - -#ifndef GL_SGIS_texture_border_clamp -#define GL_SGIS_texture_border_clamp 1 -#endif - -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 -#endif - -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 -#endif - -#ifndef GL_SGIX_interlace -#define GL_SGIX_interlace 1 -#endif - -#ifndef GL_SGIX_pixel_tiles -#define GL_SGIX_pixel_tiles 1 -#endif - -#ifndef GL_SGIX_texture_select -#define GL_SGIX_texture_select 1 -#endif - -#ifndef GL_SGIX_sprite -#define GL_SGIX_sprite 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); -GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); -GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); -GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); -#endif - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_SGIX_texture_multi_buffer 1 -#endif - -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); -GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_SGIX_instruments -#define GL_SGIX_instruments 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); -GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); -GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *); -GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); -GLAPI void APIENTRY glStartInstrumentsSGIX (void); -GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLint (APIENTRY * PFNGLGETINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRY * PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); -typedef GLint (APIENTRY * PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); -typedef void (APIENTRY * PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); -typedef void (APIENTRY * PFNGLSTARTINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRY * PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); -#endif - -#ifndef GL_SGIX_texture_scale_bias -#define GL_SGIX_texture_scale_bias 1 -#endif - -#ifndef GL_SGIX_framezoom -#define GL_SGIX_framezoom 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameZoomSGIX (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); -#endif - -#ifndef GL_SGIX_tag_sample_buffer -#define GL_SGIX_tag_sample_buffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTagSampleBufferSGIX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); -#endif - -#ifndef GL_SGIX_polynomial_ffd -#define GL_SGIX_polynomial_ffd 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); -GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); -GLAPI void APIENTRY glDeformSGIX (GLbitfield); -GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); -typedef void (APIENTRY * PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); -typedef void (APIENTRY * PFNGLDEFORMSGIXPROC) (GLbitfield mask); -typedef void (APIENTRY * PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); -#endif - -#ifndef GL_SGIX_reference_plane -#define GL_SGIX_reference_plane 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); -#endif - -#ifndef GL_SGIX_flush_raster -#define GL_SGIX_flush_raster 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushRasterSGIX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); -#endif - -#ifndef GL_SGIX_depth_texture -#define GL_SGIX_depth_texture 1 -#endif - -#ifndef GL_SGIS_fog_function -#define GL_SGIS_fog_function 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetFogFuncSGIS (const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); -typedef void (APIENTRY * PFNGLGETFOGFUNCSGISPROC) (const GLfloat *points); -#endif - -#ifndef GL_SGIX_fog_offset -#define GL_SGIX_fog_offset 1 -#endif - -#ifndef GL_HP_image_transform -#define GL_HP_image_transform 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); -GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_HP_convolution_border_modes -#define GL_HP_convolution_border_modes 1 -#endif - -#ifndef GL_SGIX_texture_add_env -#define GL_SGIX_texture_add_env 1 -#endif - -#ifndef GL_EXT_color_subtable -#define GL_EXT_color_subtable 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -#endif - -#ifndef GL_PGI_vertex_hints -#define GL_PGI_vertex_hints 1 -#endif - -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glHintPGI (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLHINTPGIPROC) (GLenum target, GLint mode); -#endif - -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 -#endif - -#ifndef GL_SGIX_list_priority -#define GL_SGIX_list_priority 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); -GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); -GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); -GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); -#endif - -#ifndef GL_SGIX_ir_instrument1 -#define GL_SGIX_ir_instrument1 1 -#endif - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_SGIX_calligraphic_fragment 1 -#endif - -#ifndef GL_SGIX_texture_lod_bias -#define GL_SGIX_texture_lod_bias 1 -#endif - -#ifndef GL_SGIX_shadow_ambient -#define GL_SGIX_shadow_ambient 1 -#endif - -#ifndef GL_EXT_index_texture -#define GL_EXT_index_texture 1 -#endif - -#ifndef GL_EXT_index_material -#define GL_EXT_index_material 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); -#endif - -#ifndef GL_EXT_index_func -#define GL_EXT_index_func 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); -#endif - -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 -#endif - -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); -GLAPI void APIENTRY glUnlockArraysEXT (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); -typedef void (APIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); -#endif - -#ifndef GL_EXT_cull_vertex -#define GL_EXT_cull_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); -GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); -typedef void (APIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); -#endif - -#ifndef GL_SGIX_ycrcb -#define GL_SGIX_ycrcb 1 -#endif - -#ifndef GL_SGIX_fragment_lighting -#define GL_SGIX_fragment_lighting 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); -GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); -GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); -GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); -GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); -#endif - -#ifndef GL_IBM_rasterpos_clip -#define GL_IBM_rasterpos_clip 1 -#endif - -#ifndef GL_HP_texture_lighting -#define GL_HP_texture_lighting 1 -#endif - -#ifndef GL_EXT_draw_range_elements -#define GL_EXT_draw_range_elements 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -#endif - -#ifndef GL_WIN_phong_shading -#define GL_WIN_phong_shading 1 -#endif - -#ifndef GL_WIN_specular_fog -#define GL_WIN_specular_fog 1 -#endif - -#ifndef GL_EXT_light_texture -#define GL_EXT_light_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glApplyTextureEXT (GLenum); -GLAPI void APIENTRY glTextureLightEXT (GLenum); -GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); -typedef void (APIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); -typedef void (APIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); -#endif - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_SGIX_blend_alpha_minmax 1 -#endif - -#ifndef GL_EXT_bgra -#define GL_EXT_bgra 1 -#endif - -#ifndef GL_SGIX_async -#define GL_SGIX_async 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint); -GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *); -GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *); -GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); -GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); -GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); -typedef GLint (APIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); -typedef GLint (APIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); -typedef GLuint (APIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); -typedef void (APIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); -typedef GLboolean (APIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); -#endif - -#ifndef GL_SGIX_async_pixel -#define GL_SGIX_async_pixel 1 -#endif - -#ifndef GL_SGIX_async_histogram -#define GL_SGIX_async_histogram 1 -#endif - -#ifndef GL_INTEL_parallel_arrays -#define GL_INTEL_parallel_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); -GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); -GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); -GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); -typedef void (APIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -#endif - -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 -#endif - -#ifndef GL_EXT_pixel_transform -#define GL_EXT_pixel_transform 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); -GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_EXT_pixel_transform_color_table -#define GL_EXT_pixel_transform_color_table 1 -#endif - -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 -#endif - -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 -#endif - -#ifndef GL_EXT_secondary_color -#define GL_EXT_secondary_color 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); -GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); -GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); -GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *); -GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *); -GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); -GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); -GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); -GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); -GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); -#endif - -#ifndef GL_EXT_texture_perturb_normal -#define GL_EXT_texture_perturb_normal 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureNormalEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); -typedef void (APIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); -#endif - -#ifndef GL_EXT_fog_coord -#define GL_EXT_fog_coord 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogCoordfEXT (GLfloat); -GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *); -GLAPI void APIENTRY glFogCoorddEXT (GLdouble); -GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); -GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); -typedef void (APIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); -typedef void (APIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); -typedef void (APIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); -typedef void (APIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_REND_screen_coordinates -#define GL_REND_screen_coordinates 1 -#endif - -#ifndef GL_EXT_coordinate_frame -#define GL_EXT_coordinate_frame 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *); -GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *); -GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *); -GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glTangent3ivEXT (const GLint *); -GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glTangent3svEXT (const GLshort *); -GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *); -GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *); -GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *); -GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glBinormal3ivEXT (const GLint *); -GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); -GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); -typedef void (APIENTRY * PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRY * PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); -typedef void (APIENTRY * PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); -typedef void (APIENTRY * PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); -typedef void (APIENTRY * PFNGLTANGENT3IVEXTPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); -typedef void (APIENTRY * PFNGLTANGENT3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); -typedef void (APIENTRY * PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRY * PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); -typedef void (APIENTRY * PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); -typedef void (APIENTRY * PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); -typedef void (APIENTRY * PFNGLBINORMAL3IVEXTPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); -typedef void (APIENTRY * PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_texture_env_combine -#define GL_EXT_texture_env_combine 1 -#endif - -#ifndef GL_APPLE_specular_vector -#define GL_APPLE_specular_vector 1 -#endif - -#ifndef GL_APPLE_transform_hint -#define GL_APPLE_transform_hint 1 -#endif - -#ifndef GL_SGIX_fog_scale -#define GL_SGIX_fog_scale 1 -#endif - -#ifndef GL_SUNX_constant_data -#define GL_SUNX_constant_data 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFinishTextureSUNX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); -#endif - -#ifndef GL_SUN_global_alpha -#define GL_SUN_global_alpha 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); -GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort); -GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint); -GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); -GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble); -GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); -GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); -GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); -#endif - -#ifndef GL_SUN_triangle_list -#define GL_SUN_triangle_list 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint); -GLAPI void APIENTRY glReplacementCodeusSUN (GLushort); -GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte); -GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *); -GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); -GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); -GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); -#endif - -#ifndef GL_SUN_vertex -#define GL_SUN_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLenum *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLenum, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLenum *, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLenum rc, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLenum rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLenum *rc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLenum rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -#endif - -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif - -#ifndef GL_INGR_color_clamp -#define GL_INGR_color_clamp 1 -#endif - -#ifndef GL_INGR_interlace_read -#define GL_INGR_interlace_read 1 -#endif - -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 -#endif - -#ifndef GL_EXT_422_pixels -#define GL_EXT_422_pixels 1 -#endif - -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 -#endif - -#ifndef GL_SUN_convolution_border_modes -#define GL_SUN_convolution_border_modes 1 -#endif - -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 -#endif - -#ifndef GL_EXT_texture_lod_bias -#define GL_EXT_texture_lod_bias 1 -#endif - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -#endif - -#ifndef GL_EXT_vertex_weighting -#define GL_EXT_vertex_weighting 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); -GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); -GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); -typedef void (APIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); -typedef void (APIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_NV_light_max_exponent -#define GL_NV_light_max_exponent 1 -#endif - -#ifndef GL_NV_vertex_array_range -#define GL_NV_vertex_array_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); -GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (APIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei size, const GLvoid *pointer); -#endif - -#ifndef GL_NV_register_combiners -#define GL_NV_register_combiners 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); -GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); -GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); -GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint); -GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); -GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -typedef void (APIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); -#endif - -#ifndef GL_NV_fog_distance -#define GL_NV_fog_distance 1 -#endif - -#ifndef GL_NV_texgen_emboss -#define GL_NV_texgen_emboss 1 -#endif - -#ifndef GL_NV_blend_square -#define GL_NV_blend_square 1 -#endif - -#ifndef GL_NV_texture_env_combine4 -#define GL_NV_texture_env_combine4 1 -#endif - -#ifndef GL_MESA_resize_buffers -#define GL_MESA_resize_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glResizeBuffersMESA (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); -#endif - -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint); -GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *); -GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *); -GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); -typedef void (APIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); -typedef void (APIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); -#endif - -#ifndef GL_IBM_cull_vertex -#define GL_IBM_cull_vertex 1 -#endif - -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiModeDrawArraysIBM (GLenum, const GLint *, const GLsizei *, GLsizei, GLint); -GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* *, GLsizei, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (APIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, GLint modestride); -#endif - -#ifndef GL_IBM_vertex_array_lists -#define GL_IBM_vertex_array_lists 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); -GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -#endif - -#ifndef GL_SGIX_subsample -#define GL_SGIX_subsample 1 -#endif - -#ifndef GL_SGIX_ycrcba -#define GL_SGIX_ycrcba 1 -#endif - -#ifndef GL_SGIX_ycrcb_subsample -#define GL_SGIX_ycrcb_subsample 1 -#endif - -#ifndef GL_SGIX_depth_pass_instrument -#define GL_SGIX_depth_pass_instrument 1 -#endif - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_3DFX_texture_compression_FXT1 1 -#endif - -#ifndef GL_3DFX_multisample -#define GL_3DFX_multisample 1 -#endif - -#ifndef GL_3DFX_tbuffer -#define GL_3DFX_tbuffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTbufferMask3DFX (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); -#endif - -#ifndef GL_EXT_multisample -#define GL_EXT_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePatternEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); -#endif - -#ifndef GL_SGI_vertex_preclip -#define GL_SGI_vertex_preclip 1 -#endif - -#ifndef GL_SGIX_convolution_accuracy -#define GL_SGIX_convolution_accuracy 1 -#endif - -#ifndef GL_SGIX_resample -#define GL_SGIX_resample 1 -#endif - -#ifndef GL_SGIS_point_line_texgen -#define GL_SGIS_point_line_texgen 1 -#endif - -#ifndef GL_SGIS_texture_color_mask -#define GL_SGIS_texture_color_mask 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -#endif - -#ifndef GL_SGIX_igloo_interface -#define GL_SGIX_igloo_interface 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); -#endif - -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 -#endif - - -#ifdef __cplusplus -} -#endif - -#endif +#ifndef __glext_h_ +#define __glext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.1 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: This software was created using the +** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has +** not been independently verified as being compliant with the OpenGL(R) +** version 1.2.1 Specification. +*/ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif + +/*************************************************************/ + +/* Header file version number, required by OpenGL ABI for Linux */ +#define GL_GLEXT_VERSION 7 + +#ifndef GL_VERSION_1_2 +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#endif + +#ifndef GL_ARB_multitexture +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +#endif + +#ifndef GL_ARB_multisample +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#endif + +#ifndef GL_ARB_texture_compression +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif + +#ifndef GL_EXT_abgr +#define GL_ABGR_EXT 0x8000 +#endif + +#ifndef GL_EXT_blend_color +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +#endif + +#ifndef GL_EXT_texture +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#endif + +#ifndef GL_EXT_texture3D +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +#endif + +#ifndef GL_EXT_subtexture +#endif + +#ifndef GL_EXT_copy_texture +#endif + +#ifndef GL_EXT_histogram +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#endif + +#ifndef GL_EXT_convolution +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 +#endif + +#ifndef GL_SGI_color_matrix +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#endif + +#ifndef GL_SGI_color_table +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +#endif + +#ifndef GL_SGIS_texture4D +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#endif + +#ifndef GL_EXT_cmyka +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#endif + +#ifndef GL_EXT_texture_object +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#endif + +#ifndef GL_SGIS_multisample +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_RESCALE_NORMAL_EXT 0x803A +#endif + +#ifndef GL_EXT_vertex_array +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +#endif + +#ifndef GL_EXT_misc_attribute +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#endif + +#ifndef GL_SGIX_shadow +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#endif + +#ifndef GL_EXT_blend_logic_op +#endif + +#ifndef GL_SGIX_interlace +#define GL_INTERLACE_SGIX 0x8094 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E +#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F +#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 +#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 +#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 +#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 +#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 +#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 +#endif + +#ifndef GL_SGIS_texture_select +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +#endif + +#ifndef GL_SGIX_instruments +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C +#endif + +#ifndef GL_SGIX_framezoom +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#endif + +#ifndef GL_FfdMaskSGIX +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 +#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 +#define GL_DEFORMATIONS_MASK_SGIX 0x8196 +#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +#endif + +#ifndef GL_SGIX_flush_raster +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#endif + +#ifndef GL_HP_image_transform +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#endif + +#ifndef GL_INGR_palette_buffer +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#endif + +#ifndef GL_EXT_color_subtable +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 +#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_LIST_PRIORITY_SGIX 0x8182 +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#endif + +#ifndef GL_EXT_index_texture +#endif + +#ifndef GL_EXT_index_material +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +#endif + +#ifndef GL_EXT_index_func +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 +#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 +#define GL_LIGHT_ENV_MODE_SGIX 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B +#define GL_FRAGMENT_LIGHT0_SGIX 0x840C +#define GL_FRAGMENT_LIGHT1_SGIX 0x840D +#define GL_FRAGMENT_LIGHT2_SGIX 0x840E +#define GL_FRAGMENT_LIGHT3_SGIX 0x840F +#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 +#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 +#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 +#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +#endif + +#ifndef GL_WIN_phong_shading +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#endif + +#ifndef GL_WIN_specular_fog +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#endif + +#ifndef GL_EXT_light_texture +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +/* reuse GL_FRAGMENT_DEPTH_EXT */ +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#endif + +#ifndef GL_EXT_bgra +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif + +#ifndef GL_SGIX_async +#define GL_ASYNC_MARKER_SGIX 0x8329 +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D +#endif + +#ifndef GL_INTEL_texture_scissor +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 +#endif + +#ifndef GL_HP_occlusion_test +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#endif + +#ifndef GL_EXT_secondary_color +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +#endif + +#ifndef GL_EXT_multi_draw_arrays +#endif + +#ifndef GL_EXT_fog_coord +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE3_RGB_EXT 0x8583 +#define GL_SOURCE4_RGB_EXT 0x8584 +#define GL_SOURCE5_RGB_EXT 0x8585 +#define GL_SOURCE6_RGB_EXT 0x8586 +#define GL_SOURCE7_RGB_EXT 0x8587 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_SOURCE3_ALPHA_EXT 0x858B +#define GL_SOURCE4_ALPHA_EXT 0x858C +#define GL_SOURCE5_ALPHA_EXT 0x858D +#define GL_SOURCE6_ALPHA_EXT 0x858E +#define GL_SOURCE7_ALPHA_EXT 0x858F +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND3_RGB_EXT 0x8593 +#define GL_OPERAND4_RGB_EXT 0x8594 +#define GL_OPERAND5_RGB_EXT 0x8595 +#define GL_OPERAND6_RGB_EXT 0x8596 +#define GL_OPERAND7_RGB_EXT 0x8597 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#define GL_OPERAND3_ALPHA_EXT 0x859B +#define GL_OPERAND4_ALPHA_EXT 0x859C +#define GL_OPERAND5_ALPHA_EXT 0x859D +#define GL_OPERAND6_ALPHA_EXT 0x859E +#define GL_OPERAND7_ALPHA_EXT 0x859F +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_FOG_SCALE_SGIX 0x81FC +#define GL_FOG_SCALE_VALUE_SGIX 0x81FD +#endif + +#ifndef GL_SUNX_constant_data +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +#endif + +#ifndef GL_SUN_global_alpha +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +#endif + +#ifndef GL_SUN_triangle_list +#define GL_RESTART_SUN 0x01 +#define GL_REPLACE_MIDDLE_SUN 0x02 +#define GL_REPLACE_OLDEST_SUN 0x03 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB +#endif + +#ifndef GL_SUN_vertex +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +#endif + +#ifndef GL_INGR_color_clamp +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INTERLACE_READ_INGR 0x8568 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#endif + +#ifndef GL_EXT_texture_cube_map +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_WRAP_BORDER_SUN 0x81D4 +#endif + +#ifndef GL_EXT_texture_env_add +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX +#define GL_MODELVIEW_MATRIX1_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT GL_MODELVIEW +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 +#endif + +#ifndef GL_NV_register_combiners +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +/* reuse GL_TEXTURE0_ARB */ +/* reuse GL_TEXTURE1_ARB */ +/* reuse GL_ZERO */ +/* reuse GL_NONE */ +/* reuse GL_FOG */ +#endif + +#ifndef GL_NV_fog_distance +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +/* reuse GL_EYE_PLANE */ +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#endif + +#ifndef GL_NV_blend_square +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B +#endif + +#ifndef GL_MESA_resize_buffers +#endif + +#ifndef GL_MESA_window_pos +#endif + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_CULL_VERTEX_IBM 103050 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 +#endif + +#ifndef GL_SGIX_subsample +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 +#endif + +#ifndef GL_SGI_depth_pass_instrument +#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 +#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 +#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 +#endif + +#ifndef GL_3DFX_tbuffer +#endif + +#ifndef GL_EXT_multisample +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_CONVOLUTION_HINT_SGIX 0x8316 +#endif + +#ifndef GL_SGIX_resample +#define GL_PACK_RESAMPLE_SGIX 0x842C +#define GL_UNPACK_RESAMPLE_SGIX 0x842D +#define GL_RESAMPLE_REPLICATE_SGIX 0x842E +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#endif + + +/*************************************************************/ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); +GLAPI void APIENTRY glBlendEquation (GLenum); +GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); +GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogram (GLenum); +GLAPI void APIENTRY glResetMinmax (GLenum); +GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (APIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTextureARB (GLenum); +GLAPI void APIENTRY glClientActiveTextureARB (GLenum); +GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); +GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); +GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); +GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +#endif + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePassARB (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRY * PFNGLSAMPLEPASSARBPROC) (GLenum pass); +#endif + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +#endif + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, void *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img); +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +#endif + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +#endif + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +#endif + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogramEXT (GLenum); +GLAPI void APIENTRY glResetMinmaxEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); +#endif + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +#endif + +#ifndef GL_EXT_color_matrix +#define GL_EXT_color_matrix 1 +#endif + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); +GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); +GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); +GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); +GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 +#endif + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 +#endif + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); +GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); +GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); +typedef void (APIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); +typedef void (APIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); +typedef GLboolean (APIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (APIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +#endif + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternSGIS (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +#endif + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glArrayElementEXT (GLint); +GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); +GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); +GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); +GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (APIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); +typedef void (APIENTRY * PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); +typedef void (APIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 +#endif + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 +#endif + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 +#endif + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 +#endif + +#ifndef GL_SGIX_texture_select +#define GL_SGIX_texture_select 1 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); +GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 +#endif + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); +GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIX_instruments +#define GL_SGIX_instruments 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); +GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); +GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *); +GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); +GLAPI void APIENTRY glStartInstrumentsSGIX (void); +GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLint (APIENTRY * PFNGLGETINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRY * PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); +typedef GLint (APIENTRY * PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); +typedef void (APIENTRY * PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); +typedef void (APIENTRY * PFNGLSTARTINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRY * PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 +#endif + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameZoomSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTagSampleBufferSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); +GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); +GLAPI void APIENTRY glDeformSGIX (GLbitfield); +GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +typedef void (APIENTRY * PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +typedef void (APIENTRY * PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (APIENTRY * PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); +#endif + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushRasterSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetFogFuncSGIS (const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); +typedef void (APIENTRY * PFNGLGETFOGFUNCSGISPROC) (const GLfloat *points); +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 +#endif + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); +GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 +#endif + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glHintPGI (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLHINTPGIPROC) (GLenum target, GLint mode); +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); +GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); +GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); +GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 +#endif + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 +#endif + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); +GLAPI void APIENTRY glUnlockArraysEXT (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); +GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); +typedef void (APIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_SGIX_fragment_lighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); +GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); +GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); +GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +#endif + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 +#endif + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 +#endif + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glApplyTextureEXT (GLenum); +GLAPI void APIENTRY glTextureLightEXT (GLenum); +GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 +#endif + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +#endif + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint); +GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *); +GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *); +GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); +GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); +GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (APIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); +typedef GLint (APIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); +typedef GLuint (APIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef void (APIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLboolean (APIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); +GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); +typedef void (APIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +#endif + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#endif + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); +GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); +GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); +GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *); +GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *); +GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); +GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); +GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); +GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureNormalEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogCoordfEXT (GLfloat); +GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *); +GLAPI void APIENTRY glFogCoorddEXT (GLdouble); +GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); +GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); +typedef void (APIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (APIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *); +GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *); +GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *); +GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glTangent3ivEXT (const GLint *); +GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glTangent3svEXT (const GLshort *); +GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *); +GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *); +GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *); +GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glBinormal3ivEXT (const GLint *); +GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); +GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); +typedef void (APIENTRY * PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRY * PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); +typedef void (APIENTRY * PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); +typedef void (APIENTRY * PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); +typedef void (APIENTRY * PFNGLTANGENT3IVEXTPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); +typedef void (APIENTRY * PFNGLTANGENT3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); +typedef void (APIENTRY * PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRY * PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); +typedef void (APIENTRY * PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); +typedef void (APIENTRY * PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); +typedef void (APIENTRY * PFNGLBINORMAL3IVEXTPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); +typedef void (APIENTRY * PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_SGIX_fog_scale 1 +#endif + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFinishTextureSUNX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); +#endif + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); +GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort); +GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint); +GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); +GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble); +GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); +GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); +GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); +typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +#endif + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint); +GLAPI void APIENTRY glReplacementCodeusSUN (GLushort); +GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte); +GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *); +GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); +GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); +GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); +#endif + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLenum *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLenum, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLenum *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLenum rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLenum rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLenum *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLenum rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 +#endif + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); +GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei size, const GLvoid *pointer); +#endif + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); +GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); +GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); +GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint); +GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); +GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); +#endif + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +#endif + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +#endif + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glResizeBuffersMESA (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); +#endif + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint); +GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiModeDrawArraysIBM (GLenum, const GLint *, const GLsizei *, GLsizei, GLint); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* *, GLsizei, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, GLint modestride); +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); +GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +#endif + +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 +#endif + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 +#endif + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTbufferMask3DFX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); +#endif + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); +#endif + +#ifndef GL_SGI_vertex_preclip +#define GL_SGI_vertex_preclip 1 +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 +#endif + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_SGIS_texture_color_mask 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#endif + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +#endif + + +#ifdef __cplusplus +} +#endif + +#endif -- cgit v1.2.3 From b14dcea4184f5b0a283e5a0d05ce203c9feee759 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Tue, 18 Sep 2001 16:39:38 +0000 Subject: remove carriage return chars --- include/GL/glutf90.h | 162 +- progs/demos/Makefile.win | 172 +- src/glu/sgi/Makefile.win | 312 +- src/glu/sgi/libutil/project.c | 762 ++--- src/glut/glx/Makefile.win | 200 +- src/glut/glx/glut.def | 10 +- src/glut/glx/win32_x11.h | 652 ++-- src/mesa/drivers/osmesa/Makefile.win | 74 +- src/mesa/drivers/windows/wgl.c | 1290 ++++---- src/mesa/drivers/windows/wmesa.c | 5942 +++++++++++++++++----------------- src/mesa/main/Makefile.win | 396 +-- src/mesa/main/mesa.def | 946 +++--- 12 files changed, 5459 insertions(+), 5459 deletions(-) (limited to 'include') diff --git a/include/GL/glutf90.h b/include/GL/glutf90.h index 7dc1d6772a5..7ba3e19ef9e 100644 --- a/include/GL/glutf90.h +++ b/include/GL/glutf90.h @@ -1,81 +1,81 @@ -#ifndef __glutf90_h__ -#define __glutf90_h__ - -/* Copyright (c) Mark J. Kilgard & Willam F. Mitchell, 1998. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -/* This header provides the binding interface for William Mitchell's - f90gl Fortran 90 GLUT binding. Other GLUT language bindings - can and should use this interace. */ - -/* I appreciate the guidance from William Mitchell - (mitchell@cam.nist.gov) in developing this friend interface - for use by the f90gl package. See ../../README.fortran */ - -#include - -/* Which callback enumerants for the __glutSetFCB/__glutGetFCB routines. */ -/* NOTE These values are part of a binary interface for the f90gl Fortran - 90 binding and so must NOT changes (additions are allowed). */ - -/* GLUTwindow callbacks. */ -#define GLUT_FCB_DISPLAY 0 /* GLUTdisplayFCB */ -#define GLUT_FCB_RESHAPE 1 /* GLUTreshapeFCB */ -#define GLUT_FCB_MOUSE 2 /* GLUTmouseFCB */ -#define GLUT_FCB_MOTION 3 /* GLUTmotionFCB */ -#define GLUT_FCB_PASSIVE 4 /* GLUTpassiveFCB */ -#define GLUT_FCB_ENTRY 5 /* GLUTentryFCB */ -#define GLUT_FCB_KEYBOARD 6 /* GLUTkeyboardFCB */ -#define GLUT_FCB_KEYBOARD_UP 7 /* GLUTkeyboardFCB */ -#define GLUT_FCB_WINDOW_STATUS 8 /* GLUTwindowStatusFCB */ -#define GLUT_FCB_VISIBILITY 9 /* GLUTvisibilityFCB */ -#define GLUT_FCB_SPECIAL 10 /* GLUTspecialFCB */ -#define GLUT_FCB_SPECIAL_UP 11 /* GLUTspecialFCB */ -#define GLUT_FCB_BUTTON_BOX 12 /* GLUTbuttonBoxFCB */ -#define GLUT_FCB_DIALS 13 /* GLUTdialsFCB */ -#define GLUT_FCB_SPACE_MOTION 14 /* GLUTspaceMotionFCB */ -#define GLUT_FCB_SPACE_ROTATE 15 /* GLUTspaceRotateFCB */ -#define GLUT_FCB_SPACE_BUTTON 16 /* GLUTspaceButtonFCB */ -#define GLUT_FCB_TABLET_MOTION 17 /* GLUTtabletMotionFCB */ -#define GLUT_FCB_TABLET_BUTTON 18 /* GLUTtabletButtonFCB */ -#define GLUT_FCB_JOYSTICK 19 /* GLUTjoystickFCB */ -/* Non-GLUTwindow callbacks. */ -#define GLUT_FCB_OVERLAY_DISPLAY 100 /* GLUTdisplayFCB */ -#define GLUT_FCB_SELECT 101 /* GLUTselectFCB */ -#define GLUT_FCB_TIMER 102 /* GLUTtimerFCB */ - -/* GLUT Fortran callback function types. */ -typedef void (GLUTCALLBACK *GLUTdisplayFCB) (void); -typedef void (GLUTCALLBACK *GLUTreshapeFCB) (int *, int *); -/* NOTE the pressed key is int, not unsigned char for Fortran! */ -typedef void (GLUTCALLBACK *GLUTkeyboardFCB) (int *, int *, int *); -typedef void (GLUTCALLBACK *GLUTmouseFCB) (int *, int *, int *, int *); -typedef void (GLUTCALLBACK *GLUTmotionFCB) (int *, int *); -typedef void (GLUTCALLBACK *GLUTpassiveFCB) (int *, int *); -typedef void (GLUTCALLBACK *GLUTentryFCB) (int *); -typedef void (GLUTCALLBACK *GLUTwindowStatusFCB) (int *); -typedef void (GLUTCALLBACK *GLUTvisibilityFCB) (int *); -typedef void (GLUTCALLBACK *GLUTspecialFCB) (int *, int *, int *); -typedef void (GLUTCALLBACK *GLUTbuttonBoxFCB) (int *, int *); -typedef void (GLUTCALLBACK *GLUTdialsFCB) (int *, int *); -typedef void (GLUTCALLBACK *GLUTspaceMotionFCB) (int *, int *, int *); -typedef void (GLUTCALLBACK *GLUTspaceRotateFCB) (int *, int *, int *); -typedef void (GLUTCALLBACK *GLUTspaceButtonFCB) (int *, int *); -typedef void (GLUTCALLBACK *GLUTtabletMotionFCB) (int *, int *); -typedef void (GLUTCALLBACK *GLUTtabletButtonFCB) (int *, int *, int *, int *); -typedef void (GLUTCALLBACK *GLUTjoystickFCB) (unsigned int *buttonMask, int *x, int *y, int *z); - -typedef void (GLUTCALLBACK *GLUTselectFCB) (int *); -typedef void (GLUTCALLBACK *GLUTtimerFCB) (int *); -typedef void (GLUTCALLBACK *GLUTmenuStateFCB) (int *); /* DEPRICATED. */ -typedef void (GLUTCALLBACK *GLUTmenuStatusFCB) (int *, int *, int *); -typedef void (GLUTCALLBACK *GLUTidleFCB) (void); - -/* Functions that set and return Fortran callback functions. */ -GLUTAPI void* APIENTRY __glutGetFCB(int which); -GLUTAPI void APIENTRY __glutSetFCB(int which, void *func); - -#endif /* __glutf90_h__ */ +#ifndef __glutf90_h__ +#define __glutf90_h__ + +/* Copyright (c) Mark J. Kilgard & Willam F. Mitchell, 1998. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +/* This header provides the binding interface for William Mitchell's + f90gl Fortran 90 GLUT binding. Other GLUT language bindings + can and should use this interace. */ + +/* I appreciate the guidance from William Mitchell + (mitchell@cam.nist.gov) in developing this friend interface + for use by the f90gl package. See ../../README.fortran */ + +#include + +/* Which callback enumerants for the __glutSetFCB/__glutGetFCB routines. */ +/* NOTE These values are part of a binary interface for the f90gl Fortran + 90 binding and so must NOT changes (additions are allowed). */ + +/* GLUTwindow callbacks. */ +#define GLUT_FCB_DISPLAY 0 /* GLUTdisplayFCB */ +#define GLUT_FCB_RESHAPE 1 /* GLUTreshapeFCB */ +#define GLUT_FCB_MOUSE 2 /* GLUTmouseFCB */ +#define GLUT_FCB_MOTION 3 /* GLUTmotionFCB */ +#define GLUT_FCB_PASSIVE 4 /* GLUTpassiveFCB */ +#define GLUT_FCB_ENTRY 5 /* GLUTentryFCB */ +#define GLUT_FCB_KEYBOARD 6 /* GLUTkeyboardFCB */ +#define GLUT_FCB_KEYBOARD_UP 7 /* GLUTkeyboardFCB */ +#define GLUT_FCB_WINDOW_STATUS 8 /* GLUTwindowStatusFCB */ +#define GLUT_FCB_VISIBILITY 9 /* GLUTvisibilityFCB */ +#define GLUT_FCB_SPECIAL 10 /* GLUTspecialFCB */ +#define GLUT_FCB_SPECIAL_UP 11 /* GLUTspecialFCB */ +#define GLUT_FCB_BUTTON_BOX 12 /* GLUTbuttonBoxFCB */ +#define GLUT_FCB_DIALS 13 /* GLUTdialsFCB */ +#define GLUT_FCB_SPACE_MOTION 14 /* GLUTspaceMotionFCB */ +#define GLUT_FCB_SPACE_ROTATE 15 /* GLUTspaceRotateFCB */ +#define GLUT_FCB_SPACE_BUTTON 16 /* GLUTspaceButtonFCB */ +#define GLUT_FCB_TABLET_MOTION 17 /* GLUTtabletMotionFCB */ +#define GLUT_FCB_TABLET_BUTTON 18 /* GLUTtabletButtonFCB */ +#define GLUT_FCB_JOYSTICK 19 /* GLUTjoystickFCB */ +/* Non-GLUTwindow callbacks. */ +#define GLUT_FCB_OVERLAY_DISPLAY 100 /* GLUTdisplayFCB */ +#define GLUT_FCB_SELECT 101 /* GLUTselectFCB */ +#define GLUT_FCB_TIMER 102 /* GLUTtimerFCB */ + +/* GLUT Fortran callback function types. */ +typedef void (GLUTCALLBACK *GLUTdisplayFCB) (void); +typedef void (GLUTCALLBACK *GLUTreshapeFCB) (int *, int *); +/* NOTE the pressed key is int, not unsigned char for Fortran! */ +typedef void (GLUTCALLBACK *GLUTkeyboardFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTmouseFCB) (int *, int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTmotionFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTpassiveFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTentryFCB) (int *); +typedef void (GLUTCALLBACK *GLUTwindowStatusFCB) (int *); +typedef void (GLUTCALLBACK *GLUTvisibilityFCB) (int *); +typedef void (GLUTCALLBACK *GLUTspecialFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTbuttonBoxFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTdialsFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTspaceMotionFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTspaceRotateFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTspaceButtonFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTtabletMotionFCB) (int *, int *); +typedef void (GLUTCALLBACK *GLUTtabletButtonFCB) (int *, int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTjoystickFCB) (unsigned int *buttonMask, int *x, int *y, int *z); + +typedef void (GLUTCALLBACK *GLUTselectFCB) (int *); +typedef void (GLUTCALLBACK *GLUTtimerFCB) (int *); +typedef void (GLUTCALLBACK *GLUTmenuStateFCB) (int *); /* DEPRICATED. */ +typedef void (GLUTCALLBACK *GLUTmenuStatusFCB) (int *, int *, int *); +typedef void (GLUTCALLBACK *GLUTidleFCB) (void); + +/* Functions that set and return Fortran callback functions. */ +GLUTAPI void* APIENTRY __glutGetFCB(int which); +GLUTAPI void APIENTRY __glutSetFCB(int which, void *func); + +#endif /* __glutf90_h__ */ diff --git a/progs/demos/Makefile.win b/progs/demos/Makefile.win index 9cb089e6211..65cc44163e3 100644 --- a/progs/demos/Makefile.win +++ b/progs/demos/Makefile.win @@ -1,86 +1,86 @@ -# $Id: Makefile.win,v 1.1 2001/09/14 22:19:18 brianp Exp $ - -# Mesa 3-D graphics library -# Version: 3.5 -# Copyright (C) 1995-2001 Brian Paul - -# Makefile for GLUT-based demo programs for Windows - -!include - -##### MACROS ##### - -TOP = .. -INCDIR = ..\include -LIBDIR = ..\lib - -PROGS = anisotropic \ - bounce \ - clearspd \ - cubemap \ - drawpix \ - fire \ - gamma \ - gears \ - geartrain \ - glinfo \ - gloss \ - gltestperf \ - glutfx \ - isosurf \ - ipers \ - lodbias \ - morph3d \ - multiarb \ - occlude \ - osdemo \ - paltex \ - pixeltex \ - pointblast \ - ray \ - readpix \ - reflect \ - renormal \ - shadowtex \ - spectex \ - stex3d \ - teapot \ - terrain \ - tessdemo \ - texcyl \ - texdown \ - texenv \ - texobj \ - trispd \ - tunnel \ - tunnel2 \ - winpos - -SRCS = -OSMESASRCS = osdemo.c - -!include "../mesawin32.mak" - -##### TARGETS ##### - -clean:: - -realclean:: - -targets: readtex.c readtex.h $(PROGS) - -# remove comments when we get non-osmesa pgm working -#$(EXES) : $*.obj $(DEPLIBS) -# echo $@ -# $(link) -out:$@ $** $(LIBS) - -$(OSMESAEXES) : $*.obj $(DEPLIBS) - echo $@ - $(link) -out:$@ $** $(LIBS) $(EXTRALIBS) - -readtex.c: - @copy ../util/readtex.c . - -readtex.h: - @copy ../util/readtex.c . - +# $Id: Makefile.win,v 1.2 2001/09/18 16:39:38 kschultz Exp $ + +# Mesa 3-D graphics library +# Version: 3.5 +# Copyright (C) 1995-2001 Brian Paul + +# Makefile for GLUT-based demo programs for Windows + +!include + +##### MACROS ##### + +TOP = .. +INCDIR = ..\include +LIBDIR = ..\lib + +PROGS = anisotropic \ + bounce \ + clearspd \ + cubemap \ + drawpix \ + fire \ + gamma \ + gears \ + geartrain \ + glinfo \ + gloss \ + gltestperf \ + glutfx \ + isosurf \ + ipers \ + lodbias \ + morph3d \ + multiarb \ + occlude \ + osdemo \ + paltex \ + pixeltex \ + pointblast \ + ray \ + readpix \ + reflect \ + renormal \ + shadowtex \ + spectex \ + stex3d \ + teapot \ + terrain \ + tessdemo \ + texcyl \ + texdown \ + texenv \ + texobj \ + trispd \ + tunnel \ + tunnel2 \ + winpos + +SRCS = +OSMESASRCS = osdemo.c + +!include "../mesawin32.mak" + +##### TARGETS ##### + +clean:: + +realclean:: + +targets: readtex.c readtex.h $(PROGS) + +# remove comments when we get non-osmesa pgm working +#$(EXES) : $*.obj $(DEPLIBS) +# echo $@ +# $(link) -out:$@ $** $(LIBS) + +$(OSMESAEXES) : $*.obj $(DEPLIBS) + echo $@ + $(link) -out:$@ $** $(LIBS) $(EXTRALIBS) + +readtex.c: + @copy ../util/readtex.c . + +readtex.h: + @copy ../util/readtex.c . + diff --git a/src/glu/sgi/Makefile.win b/src/glu/sgi/Makefile.win index 1d239e7dfdf..3d0067ef017 100644 --- a/src/glu/sgi/Makefile.win +++ b/src/glu/sgi/Makefile.win @@ -1,156 +1,156 @@ -# Makefile for Win32 - -# -# Sept 12, 2001 -# Note: The nurbs code is not being built at this time. -# If you want to work on it, uncomment the definitions -# noted below to try to compile the sources. -# There are numerous problems, some of which may be solved -# by setting some #defines. -# - -!include - -.SUFFIXES : .cc - -TOP = .. - -GLU_SRCS_CC = \ - libnurbs\interface\bezierEval.cc \ - libnurbs\interface\bezierPatch.cc \ - libnurbs\interface\bezierPatchMesh.cc \ - libnurbs\interface\glcurveval.cc \ - libnurbs\interface\glinterface.cc \ - libnurbs\interface\glrenderer.cc \ - libnurbs\interface\glsurfeval.cc \ - libnurbs\interface\incurveeval.cc \ - libnurbs\interface\insurfeval.cc \ - libnurbs\internals\arc.cc \ - libnurbs\internals\arcsorter.cc \ - libnurbs\internals\arctess.cc \ - libnurbs\internals\backend.cc \ - libnurbs\internals\basiccrveval.cc \ - libnurbs\internals\basicsurfeval.cc \ - libnurbs\internals\bin.cc \ - libnurbs\internals\bufpool.cc \ - libnurbs\internals\cachingeval.cc \ - libnurbs\internals\ccw.cc \ - libnurbs\internals\coveandtiler.cc \ - libnurbs\internals\curve.cc \ - libnurbs\internals\curvelist.cc \ - libnurbs\internals\curvesub.cc \ - libnurbs\internals\dataTransform.cc \ - libnurbs\internals\displaylist.cc \ - libnurbs\internals\flist.cc \ - libnurbs\internals\flistsorter.cc \ - libnurbs\internals\hull.cc \ - libnurbs\internals\intersect.cc \ - libnurbs\internals\knotvector.cc \ - libnurbs\internals\mapdesc.cc \ - libnurbs\internals\mapdescv.cc \ - libnurbs\internals\maplist.cc \ - libnurbs\internals\mesher.cc \ - libnurbs\internals\monoTriangulationBackend.cc \ - libnurbs\internals\monotonizer.cc \ - libnurbs\internals\mycode.cc \ - libnurbs\internals\nurbsinterfac.cc \ - libnurbs\internals\nurbstess.cc \ - libnurbs\internals\patch.cc \ - libnurbs\internals\patchlist.cc \ - libnurbs\internals\quilt.cc \ - libnurbs\internals\reader.cc \ - libnurbs\internals\renderhints.cc \ - libnurbs\internals\slicer.cc \ - libnurbs\internals\sorter.cc \ - libnurbs\internals\splitarcs.cc \ - libnurbs\internals\subdivider.cc \ - libnurbs\internals\tobezier.cc \ - libnurbs\internals\trimline.cc \ - libnurbs\internals\trimregion.cc \ - libnurbs\internals\trimvertpool.cc \ - libnurbs\internals\uarray.cc \ - libnurbs\internals\varray.cc \ - libnurbs\nurbtess\directedLine.cc \ - libnurbs\nurbtess\gridWrap.cc \ - libnurbs\nurbtess\monoChain.cc \ - libnurbs\nurbtess\monoPolyPart.cc \ - libnurbs\nurbtess\monoTriangulation.cc \ - libnurbs\nurbtess\partitionX.cc \ - libnurbs\nurbtess\partitionY.cc \ - libnurbs\nurbtess\polyDBG.cc \ - libnurbs\nurbtess\polyUtil.cc \ - libnurbs\nurbtess\primitiveStream.cc \ - libnurbs\nurbtess\quicksort.cc \ - libnurbs\nurbtess\rectBlock.cc \ - libnurbs\nurbtess\sampleComp.cc \ - libnurbs\nurbtess\sampleCompBot.cc \ - libnurbs\nurbtess\sampleCompRight.cc \ - libnurbs\nurbtess\sampleCompTop.cc \ - libnurbs\nurbtess\sampleMonoPoly.cc \ - libnurbs\nurbtess\sampledLine.cc \ - libnurbs\nurbtess\searchTree.cc - -GLU_SRCS = \ - libtess\dict.c \ - libtess\geom.c \ - libtess\memalloc.c \ - libtess\mesh.c \ - libtess\normal.c \ - libtess\priorityq.c \ - libtess\render.c \ - libtess\sweep.c \ - libtess\tess.c \ - libtess\tessmono.c \ - libutil\error.c \ - libutil\glue.c \ - libutil\mipmap.c \ - libutil\project.c \ - libutil\quad.c \ - libutil\registry.c - -SRCS = $(GLU_SRCS) - -GLUDLL = glu32.dll - -all : gludll install - -!include "$(TOP)/mesawin32.mak" - -gludll : $(GLUDLL) - -CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -Iinclude -DBUILD_GL32 -LFLAGS = $(dlllflags) $(LFLAGS) - -OBJS = $(GLU_SRCS:.c=.obj) -LIBS = ../lib/opengl32.lib winmm.lib $(guilibsdll) - -# Uncomment these definitions to try to compile the NURBS code. -#OBJS = $(GLU_SRCS_CC:.cc=.obj) $(GLU_SRCS:.c=.obj) -#NURBSINC = -Ilibnurbs\interface -Ilibnurbs\internals -Ilibnurbs\nurbtess -#CFLAGS = $(CFLAGS) $(NURBSINC) - -$(GLUDLL) : $(OBJS) glu.def - $(link) $(LFLAGS) -out:$(GLUDLL) -def:glu.def $(OBJS) $(LIBS) - -install : $(GLUDLL) - @echo "copying Mesa GLU dynamic link library to system directory..." - -copy $(GLUDLL) $(TOP)\lib - @echo "copying Mesa GLU import library to library directory..." - -copy $(GLU) $(TOP)\lib - -clean :: - @del /f libtess\*.obj libutil\*.obj - @del /f libnurbs\interface\*.obj libnurbs\internals\*.obj - @del /f libnurbs\nurbtess\*.obj - -# override default inference rule with one that writes the object to -# the correct subdir. - -.c.obj : - $(cc) $(CFLAGS) -I. $< /Fo$*.obj - -# /TP is needed for C++ files because MS compiler -# does not recognize .cc as a C++ file. - -.cc.obj : - $(cc) $(CFLAGS) -I. $< /TP /Fo$*.obj +# Makefile for Win32 + +# +# Sept 12, 2001 +# Note: The nurbs code is not being built at this time. +# If you want to work on it, uncomment the definitions +# noted below to try to compile the sources. +# There are numerous problems, some of which may be solved +# by setting some #defines. +# + +!include + +.SUFFIXES : .cc + +TOP = .. + +GLU_SRCS_CC = \ + libnurbs\interface\bezierEval.cc \ + libnurbs\interface\bezierPatch.cc \ + libnurbs\interface\bezierPatchMesh.cc \ + libnurbs\interface\glcurveval.cc \ + libnurbs\interface\glinterface.cc \ + libnurbs\interface\glrenderer.cc \ + libnurbs\interface\glsurfeval.cc \ + libnurbs\interface\incurveeval.cc \ + libnurbs\interface\insurfeval.cc \ + libnurbs\internals\arc.cc \ + libnurbs\internals\arcsorter.cc \ + libnurbs\internals\arctess.cc \ + libnurbs\internals\backend.cc \ + libnurbs\internals\basiccrveval.cc \ + libnurbs\internals\basicsurfeval.cc \ + libnurbs\internals\bin.cc \ + libnurbs\internals\bufpool.cc \ + libnurbs\internals\cachingeval.cc \ + libnurbs\internals\ccw.cc \ + libnurbs\internals\coveandtiler.cc \ + libnurbs\internals\curve.cc \ + libnurbs\internals\curvelist.cc \ + libnurbs\internals\curvesub.cc \ + libnurbs\internals\dataTransform.cc \ + libnurbs\internals\displaylist.cc \ + libnurbs\internals\flist.cc \ + libnurbs\internals\flistsorter.cc \ + libnurbs\internals\hull.cc \ + libnurbs\internals\intersect.cc \ + libnurbs\internals\knotvector.cc \ + libnurbs\internals\mapdesc.cc \ + libnurbs\internals\mapdescv.cc \ + libnurbs\internals\maplist.cc \ + libnurbs\internals\mesher.cc \ + libnurbs\internals\monoTriangulationBackend.cc \ + libnurbs\internals\monotonizer.cc \ + libnurbs\internals\mycode.cc \ + libnurbs\internals\nurbsinterfac.cc \ + libnurbs\internals\nurbstess.cc \ + libnurbs\internals\patch.cc \ + libnurbs\internals\patchlist.cc \ + libnurbs\internals\quilt.cc \ + libnurbs\internals\reader.cc \ + libnurbs\internals\renderhints.cc \ + libnurbs\internals\slicer.cc \ + libnurbs\internals\sorter.cc \ + libnurbs\internals\splitarcs.cc \ + libnurbs\internals\subdivider.cc \ + libnurbs\internals\tobezier.cc \ + libnurbs\internals\trimline.cc \ + libnurbs\internals\trimregion.cc \ + libnurbs\internals\trimvertpool.cc \ + libnurbs\internals\uarray.cc \ + libnurbs\internals\varray.cc \ + libnurbs\nurbtess\directedLine.cc \ + libnurbs\nurbtess\gridWrap.cc \ + libnurbs\nurbtess\monoChain.cc \ + libnurbs\nurbtess\monoPolyPart.cc \ + libnurbs\nurbtess\monoTriangulation.cc \ + libnurbs\nurbtess\partitionX.cc \ + libnurbs\nurbtess\partitionY.cc \ + libnurbs\nurbtess\polyDBG.cc \ + libnurbs\nurbtess\polyUtil.cc \ + libnurbs\nurbtess\primitiveStream.cc \ + libnurbs\nurbtess\quicksort.cc \ + libnurbs\nurbtess\rectBlock.cc \ + libnurbs\nurbtess\sampleComp.cc \ + libnurbs\nurbtess\sampleCompBot.cc \ + libnurbs\nurbtess\sampleCompRight.cc \ + libnurbs\nurbtess\sampleCompTop.cc \ + libnurbs\nurbtess\sampleMonoPoly.cc \ + libnurbs\nurbtess\sampledLine.cc \ + libnurbs\nurbtess\searchTree.cc + +GLU_SRCS = \ + libtess\dict.c \ + libtess\geom.c \ + libtess\memalloc.c \ + libtess\mesh.c \ + libtess\normal.c \ + libtess\priorityq.c \ + libtess\render.c \ + libtess\sweep.c \ + libtess\tess.c \ + libtess\tessmono.c \ + libutil\error.c \ + libutil\glue.c \ + libutil\mipmap.c \ + libutil\project.c \ + libutil\quad.c \ + libutil\registry.c + +SRCS = $(GLU_SRCS) + +GLUDLL = glu32.dll + +all : gludll install + +!include "$(TOP)/mesawin32.mak" + +gludll : $(GLUDLL) + +CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -Iinclude -DBUILD_GL32 +LFLAGS = $(dlllflags) $(LFLAGS) + +OBJS = $(GLU_SRCS:.c=.obj) +LIBS = ../lib/opengl32.lib winmm.lib $(guilibsdll) + +# Uncomment these definitions to try to compile the NURBS code. +#OBJS = $(GLU_SRCS_CC:.cc=.obj) $(GLU_SRCS:.c=.obj) +#NURBSINC = -Ilibnurbs\interface -Ilibnurbs\internals -Ilibnurbs\nurbtess +#CFLAGS = $(CFLAGS) $(NURBSINC) + +$(GLUDLL) : $(OBJS) glu.def + $(link) $(LFLAGS) -out:$(GLUDLL) -def:glu.def $(OBJS) $(LIBS) + +install : $(GLUDLL) + @echo "copying Mesa GLU dynamic link library to system directory..." + -copy $(GLUDLL) $(TOP)\lib + @echo "copying Mesa GLU import library to library directory..." + -copy $(GLU) $(TOP)\lib + +clean :: + @del /f libtess\*.obj libutil\*.obj + @del /f libnurbs\interface\*.obj libnurbs\internals\*.obj + @del /f libnurbs\nurbtess\*.obj + +# override default inference rule with one that writes the object to +# the correct subdir. + +.c.obj : + $(cc) $(CFLAGS) -I. $< /Fo$*.obj + +# /TP is needed for C++ files because MS compiler +# does not recognize .cc as a C++ file. + +.cc.obj : + $(cc) $(CFLAGS) -I. $< /TP /Fo$*.obj diff --git a/src/glu/sgi/libutil/project.c b/src/glu/sgi/libutil/project.c index 4d9819471b6..348bd7e40cc 100644 --- a/src/glu/sgi/libutil/project.c +++ b/src/glu/sgi/libutil/project.c @@ -1,381 +1,381 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/09/14 22:19:19 $ $Revision: 1.3 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libutil/project.c,v 1.3 2001/09/14 22:19:19 brianp Exp $ -*/ - -#include "gluos.h" -#include -#include -#include -#include "gluint.h" - -/* -** Make m an identity matrix -*/ -static void __gluMakeIdentityd(GLdouble m[16]) -{ - m[0+4*0] = 1; m[0+4*1] = 0; m[0+4*2] = 0; m[0+4*3] = 0; - m[1+4*0] = 0; m[1+4*1] = 1; m[1+4*2] = 0; m[1+4*3] = 0; - m[2+4*0] = 0; m[2+4*1] = 0; m[2+4*2] = 1; m[2+4*3] = 0; - m[3+4*0] = 0; m[3+4*1] = 0; m[3+4*2] = 0; m[3+4*3] = 1; -} - -static void __gluMakeIdentityf(GLfloat m[16]) -{ - m[0+4*0] = 1; m[0+4*1] = 0; m[0+4*2] = 0; m[0+4*3] = 0; - m[1+4*0] = 0; m[1+4*1] = 1; m[1+4*2] = 0; m[1+4*3] = 0; - m[2+4*0] = 0; m[2+4*1] = 0; m[2+4*2] = 1; m[2+4*3] = 0; - m[3+4*0] = 0; m[3+4*1] = 0; m[3+4*2] = 0; m[3+4*3] = 1; -} - -void GLAPIENTRY -gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top) -{ - glOrtho(left, right, bottom, top, -1, 1); -} - -#define __glPi 3.14159265358979323846 - -void GLAPIENTRY -gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar) -{ - GLdouble m[4][4]; - double sine, cotangent, deltaZ; - double radians = fovy / 2 * __glPi / 180; - - deltaZ = zFar - zNear; - sine = sin(radians); - if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) { - return; - } - cotangent = COS(radians) / sine; - - __gluMakeIdentityd(&m[0][0]); - m[0][0] = cotangent / aspect; - m[1][1] = cotangent; - m[2][2] = -(zFar + zNear) / deltaZ; - m[2][3] = -1; - m[3][2] = -2 * zNear * zFar / deltaZ; - m[3][3] = 0; - glMultMatrixd(&m[0][0]); -} - -static void normalize(float v[3]) -{ - float r; - - r = sqrt( v[0]*v[0] + v[1]*v[1] + v[2]*v[2] ); - if (r == 0.0) return; - - v[0] /= r; - v[1] /= r; - v[2] /= r; -} - -static void cross(float v1[3], float v2[3], float result[3]) -{ - result[0] = v1[1]*v2[2] - v1[2]*v2[1]; - result[1] = v1[2]*v2[0] - v1[0]*v2[2]; - result[2] = v1[0]*v2[1] - v1[1]*v2[0]; -} - -void GLAPIENTRY -gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, - GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, - GLdouble upz) -{ - int i; - float forward[3], side[3], up[3]; - GLfloat m[4][4]; - - forward[0] = centerx - eyex; - forward[1] = centery - eyey; - forward[2] = centerz - eyez; - - up[0] = upx; - up[1] = upy; - up[2] = upz; - - normalize(forward); - - /* Side = forward x up */ - cross(forward, up, side); - normalize(side); - - /* Recompute up as: up = side x forward */ - cross(side, forward, up); - - __gluMakeIdentityf(&m[0][0]); - m[0][0] = side[0]; - m[1][0] = side[1]; - m[2][0] = side[2]; - - m[0][1] = up[0]; - m[1][1] = up[1]; - m[2][1] = up[2]; - - m[0][2] = -forward[0]; - m[1][2] = -forward[1]; - m[2][2] = -forward[2]; - - glMultMatrixf(&m[0][0]); - glTranslated(-eyex, -eyey, -eyez); -} - -static void __gluMultMatrixVecd(const GLdouble matrix[16], const GLdouble in[4], - GLdouble out[4]) -{ - int i; - - for (i=0; i<4; i++) { - out[i] = - in[0] * matrix[0*4+i] + - in[1] * matrix[1*4+i] + - in[2] * matrix[2*4+i] + - in[3] * matrix[3*4+i]; - } -} - -/* -** inverse = invert(src) -*/ -static int __gluInvertMatrixd(const GLdouble src[16], GLdouble inverse[16]) -{ - int i, j, k, swap; - double t; - GLdouble temp[4][4]; - - for (i=0; i<4; i++) { - for (j=0; j<4; j++) { - temp[i][j] = src[i*4+j]; - } - } - __gluMakeIdentityd(inverse); - - for (i = 0; i < 4; i++) { - /* - ** Look for largest element in column - */ - swap = i; - for (j = i + 1; j < 4; j++) { - if (fabs(temp[j][i]) > fabs(temp[i][i])) { - swap = j; - } - } - - if (swap != i) { - /* - ** Swap rows. - */ - for (k = 0; k < 4; k++) { - t = temp[i][k]; - temp[i][k] = temp[swap][k]; - temp[swap][k] = t; - - t = inverse[i*4+k]; - inverse[i*4+k] = inverse[swap*4+k]; - inverse[swap*4+k] = t; - } - } - - if (temp[i][i] == 0) { - /* - ** No non-zero pivot. The matrix is singular, which shouldn't - ** happen. This means the user gave us a bad matrix. - */ - return GL_FALSE; - } - - t = temp[i][i]; - for (k = 0; k < 4; k++) { - temp[i][k] /= t; - inverse[i*4+k] /= t; - } - for (j = 0; j < 4; j++) { - if (j != i) { - t = temp[j][i]; - for (k = 0; k < 4; k++) { - temp[j][k] -= temp[i][k]*t; - inverse[j*4+k] -= inverse[i*4+k]*t; - } - } - } - } - return GL_TRUE; -} - -static void __gluMultMatricesd(const GLdouble a[16], const GLdouble b[16], - GLdouble r[16]) -{ - int i, j; - - for (i = 0; i < 4; i++) { - for (j = 0; j < 4; j++) { - r[i*4+j] = - a[i*4+0]*b[0*4+j] + - a[i*4+1]*b[1*4+j] + - a[i*4+2]*b[2*4+j] + - a[i*4+3]*b[3*4+j]; - } - } -} - -GLint GLAPIENTRY -gluProject(GLdouble objx, GLdouble objy, GLdouble objz, - const GLdouble modelMatrix[16], - const GLdouble projMatrix[16], - const GLint viewport[4], - GLdouble *winx, GLdouble *winy, GLdouble *winz) -{ - double in[4]; - double out[4]; - - in[0]=objx; - in[1]=objy; - in[2]=objz; - in[3]=1.0; - __gluMultMatrixVecd(modelMatrix, in, out); - __gluMultMatrixVecd(projMatrix, out, in); - if (in[3] == 0.0) return(GL_FALSE); - in[0] /= in[3]; - in[1] /= in[3]; - in[2] /= in[3]; - /* Map x, y and z to range 0-1 */ - in[0] = in[0] * 0.5 + 0.5; - in[1] = in[1] * 0.5 + 0.5; - in[2] = in[2] * 0.5 + 0.5; - - /* Map x,y to viewport */ - in[0] = in[0] * viewport[2] + viewport[0]; - in[1] = in[1] * viewport[3] + viewport[1]; - - *winx=in[0]; - *winy=in[1]; - *winz=in[2]; - return(GL_TRUE); -} - -GLint GLAPIENTRY -gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, - const GLdouble modelMatrix[16], - const GLdouble projMatrix[16], - const GLint viewport[4], - GLdouble *objx, GLdouble *objy, GLdouble *objz) -{ - double finalMatrix[16]; - double in[4]; - double out[4]; - - __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix); - if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) return(GL_FALSE); - - in[0]=winx; - in[1]=winy; - in[2]=winz; - in[3]=1.0; - - /* Map x and y from window coordinates */ - in[0] = (in[0] - viewport[0]) / viewport[2]; - in[1] = (in[1] - viewport[1]) / viewport[3]; - - /* Map to range -1 to 1 */ - in[0] = in[0] * 2 - 1; - in[1] = in[1] * 2 - 1; - in[2] = in[2] * 2 - 1; - - __gluMultMatrixVecd(finalMatrix, in, out); - if (out[3] == 0.0) return(GL_FALSE); - out[0] /= out[3]; - out[1] /= out[3]; - out[2] /= out[3]; - *objx = out[0]; - *objy = out[1]; - *objz = out[2]; - return(GL_TRUE); -} - -GLint GLAPIENTRY -gluUnProject4(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, - const GLdouble modelMatrix[16], - const GLdouble projMatrix[16], - const GLint viewport[4], - GLclampd nearVal, GLclampd farVal, - GLdouble *objx, GLdouble *objy, GLdouble *objz, - GLdouble *objw) -{ - double finalMatrix[16]; - double in[4]; - double out[4]; - - __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix); - if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) return(GL_FALSE); - - in[0]=winx; - in[1]=winy; - in[2]=winz; - in[3]=clipw; - - /* Map x and y from window coordinates */ - in[0] = (in[0] - viewport[0]) / viewport[2]; - in[1] = (in[1] - viewport[1]) / viewport[3]; - in[2] = (in[2] - nearVal) / (farVal - nearVal); - - /* Map to range -1 to 1 */ - in[0] = in[0] * 2 - 1; - in[1] = in[1] * 2 - 1; - in[2] = in[2] * 2 - 1; - - __gluMultMatrixVecd(finalMatrix, in, out); - if (out[3] == 0.0) return(GL_FALSE); - *objx = out[0]; - *objy = out[1]; - *objz = out[2]; - *objw = out[3]; - return(GL_TRUE); -} - -void GLAPIENTRY -gluPickMatrix(GLdouble x, GLdouble y, GLdouble deltax, GLdouble deltay, - GLint viewport[4]) -{ - if (deltax <= 0 || deltay <= 0) { - return; - } - - /* Translate and scale the picked region to the entire window */ - glTranslatef((viewport[2] - 2 * (x - viewport[0])) / deltax, - (viewport[3] - 2 * (y - viewport[1])) / deltay, 0); - glScalef(viewport[2] / deltax, viewport[3] / deltay, 1.0); -} +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.1 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. This software +** was created using the OpenGL(R) version 1.2.1 Sample Implementation +** published by SGI, but has not been independently verified as being +** compliant with the OpenGL(R) version 1.2.1 Specification. +** +** $Date: 2001/09/18 16:39:38 $ $Revision: 1.4 $ +** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libutil/project.c,v 1.4 2001/09/18 16:39:38 kschultz Exp $ +*/ + +#include "gluos.h" +#include +#include +#include +#include "gluint.h" + +/* +** Make m an identity matrix +*/ +static void __gluMakeIdentityd(GLdouble m[16]) +{ + m[0+4*0] = 1; m[0+4*1] = 0; m[0+4*2] = 0; m[0+4*3] = 0; + m[1+4*0] = 0; m[1+4*1] = 1; m[1+4*2] = 0; m[1+4*3] = 0; + m[2+4*0] = 0; m[2+4*1] = 0; m[2+4*2] = 1; m[2+4*3] = 0; + m[3+4*0] = 0; m[3+4*1] = 0; m[3+4*2] = 0; m[3+4*3] = 1; +} + +static void __gluMakeIdentityf(GLfloat m[16]) +{ + m[0+4*0] = 1; m[0+4*1] = 0; m[0+4*2] = 0; m[0+4*3] = 0; + m[1+4*0] = 0; m[1+4*1] = 1; m[1+4*2] = 0; m[1+4*3] = 0; + m[2+4*0] = 0; m[2+4*1] = 0; m[2+4*2] = 1; m[2+4*3] = 0; + m[3+4*0] = 0; m[3+4*1] = 0; m[3+4*2] = 0; m[3+4*3] = 1; +} + +void GLAPIENTRY +gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top) +{ + glOrtho(left, right, bottom, top, -1, 1); +} + +#define __glPi 3.14159265358979323846 + +void GLAPIENTRY +gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar) +{ + GLdouble m[4][4]; + double sine, cotangent, deltaZ; + double radians = fovy / 2 * __glPi / 180; + + deltaZ = zFar - zNear; + sine = sin(radians); + if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) { + return; + } + cotangent = COS(radians) / sine; + + __gluMakeIdentityd(&m[0][0]); + m[0][0] = cotangent / aspect; + m[1][1] = cotangent; + m[2][2] = -(zFar + zNear) / deltaZ; + m[2][3] = -1; + m[3][2] = -2 * zNear * zFar / deltaZ; + m[3][3] = 0; + glMultMatrixd(&m[0][0]); +} + +static void normalize(float v[3]) +{ + float r; + + r = sqrt( v[0]*v[0] + v[1]*v[1] + v[2]*v[2] ); + if (r == 0.0) return; + + v[0] /= r; + v[1] /= r; + v[2] /= r; +} + +static void cross(float v1[3], float v2[3], float result[3]) +{ + result[0] = v1[1]*v2[2] - v1[2]*v2[1]; + result[1] = v1[2]*v2[0] - v1[0]*v2[2]; + result[2] = v1[0]*v2[1] - v1[1]*v2[0]; +} + +void GLAPIENTRY +gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, + GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, + GLdouble upz) +{ + int i; + float forward[3], side[3], up[3]; + GLfloat m[4][4]; + + forward[0] = centerx - eyex; + forward[1] = centery - eyey; + forward[2] = centerz - eyez; + + up[0] = upx; + up[1] = upy; + up[2] = upz; + + normalize(forward); + + /* Side = forward x up */ + cross(forward, up, side); + normalize(side); + + /* Recompute up as: up = side x forward */ + cross(side, forward, up); + + __gluMakeIdentityf(&m[0][0]); + m[0][0] = side[0]; + m[1][0] = side[1]; + m[2][0] = side[2]; + + m[0][1] = up[0]; + m[1][1] = up[1]; + m[2][1] = up[2]; + + m[0][2] = -forward[0]; + m[1][2] = -forward[1]; + m[2][2] = -forward[2]; + + glMultMatrixf(&m[0][0]); + glTranslated(-eyex, -eyey, -eyez); +} + +static void __gluMultMatrixVecd(const GLdouble matrix[16], const GLdouble in[4], + GLdouble out[4]) +{ + int i; + + for (i=0; i<4; i++) { + out[i] = + in[0] * matrix[0*4+i] + + in[1] * matrix[1*4+i] + + in[2] * matrix[2*4+i] + + in[3] * matrix[3*4+i]; + } +} + +/* +** inverse = invert(src) +*/ +static int __gluInvertMatrixd(const GLdouble src[16], GLdouble inverse[16]) +{ + int i, j, k, swap; + double t; + GLdouble temp[4][4]; + + for (i=0; i<4; i++) { + for (j=0; j<4; j++) { + temp[i][j] = src[i*4+j]; + } + } + __gluMakeIdentityd(inverse); + + for (i = 0; i < 4; i++) { + /* + ** Look for largest element in column + */ + swap = i; + for (j = i + 1; j < 4; j++) { + if (fabs(temp[j][i]) > fabs(temp[i][i])) { + swap = j; + } + } + + if (swap != i) { + /* + ** Swap rows. + */ + for (k = 0; k < 4; k++) { + t = temp[i][k]; + temp[i][k] = temp[swap][k]; + temp[swap][k] = t; + + t = inverse[i*4+k]; + inverse[i*4+k] = inverse[swap*4+k]; + inverse[swap*4+k] = t; + } + } + + if (temp[i][i] == 0) { + /* + ** No non-zero pivot. The matrix is singular, which shouldn't + ** happen. This means the user gave us a bad matrix. + */ + return GL_FALSE; + } + + t = temp[i][i]; + for (k = 0; k < 4; k++) { + temp[i][k] /= t; + inverse[i*4+k] /= t; + } + for (j = 0; j < 4; j++) { + if (j != i) { + t = temp[j][i]; + for (k = 0; k < 4; k++) { + temp[j][k] -= temp[i][k]*t; + inverse[j*4+k] -= inverse[i*4+k]*t; + } + } + } + } + return GL_TRUE; +} + +static void __gluMultMatricesd(const GLdouble a[16], const GLdouble b[16], + GLdouble r[16]) +{ + int i, j; + + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + r[i*4+j] = + a[i*4+0]*b[0*4+j] + + a[i*4+1]*b[1*4+j] + + a[i*4+2]*b[2*4+j] + + a[i*4+3]*b[3*4+j]; + } + } +} + +GLint GLAPIENTRY +gluProject(GLdouble objx, GLdouble objy, GLdouble objz, + const GLdouble modelMatrix[16], + const GLdouble projMatrix[16], + const GLint viewport[4], + GLdouble *winx, GLdouble *winy, GLdouble *winz) +{ + double in[4]; + double out[4]; + + in[0]=objx; + in[1]=objy; + in[2]=objz; + in[3]=1.0; + __gluMultMatrixVecd(modelMatrix, in, out); + __gluMultMatrixVecd(projMatrix, out, in); + if (in[3] == 0.0) return(GL_FALSE); + in[0] /= in[3]; + in[1] /= in[3]; + in[2] /= in[3]; + /* Map x, y and z to range 0-1 */ + in[0] = in[0] * 0.5 + 0.5; + in[1] = in[1] * 0.5 + 0.5; + in[2] = in[2] * 0.5 + 0.5; + + /* Map x,y to viewport */ + in[0] = in[0] * viewport[2] + viewport[0]; + in[1] = in[1] * viewport[3] + viewport[1]; + + *winx=in[0]; + *winy=in[1]; + *winz=in[2]; + return(GL_TRUE); +} + +GLint GLAPIENTRY +gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, + const GLdouble modelMatrix[16], + const GLdouble projMatrix[16], + const GLint viewport[4], + GLdouble *objx, GLdouble *objy, GLdouble *objz) +{ + double finalMatrix[16]; + double in[4]; + double out[4]; + + __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix); + if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) return(GL_FALSE); + + in[0]=winx; + in[1]=winy; + in[2]=winz; + in[3]=1.0; + + /* Map x and y from window coordinates */ + in[0] = (in[0] - viewport[0]) / viewport[2]; + in[1] = (in[1] - viewport[1]) / viewport[3]; + + /* Map to range -1 to 1 */ + in[0] = in[0] * 2 - 1; + in[1] = in[1] * 2 - 1; + in[2] = in[2] * 2 - 1; + + __gluMultMatrixVecd(finalMatrix, in, out); + if (out[3] == 0.0) return(GL_FALSE); + out[0] /= out[3]; + out[1] /= out[3]; + out[2] /= out[3]; + *objx = out[0]; + *objy = out[1]; + *objz = out[2]; + return(GL_TRUE); +} + +GLint GLAPIENTRY +gluUnProject4(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, + const GLdouble modelMatrix[16], + const GLdouble projMatrix[16], + const GLint viewport[4], + GLclampd nearVal, GLclampd farVal, + GLdouble *objx, GLdouble *objy, GLdouble *objz, + GLdouble *objw) +{ + double finalMatrix[16]; + double in[4]; + double out[4]; + + __gluMultMatricesd(modelMatrix, projMatrix, finalMatrix); + if (!__gluInvertMatrixd(finalMatrix, finalMatrix)) return(GL_FALSE); + + in[0]=winx; + in[1]=winy; + in[2]=winz; + in[3]=clipw; + + /* Map x and y from window coordinates */ + in[0] = (in[0] - viewport[0]) / viewport[2]; + in[1] = (in[1] - viewport[1]) / viewport[3]; + in[2] = (in[2] - nearVal) / (farVal - nearVal); + + /* Map to range -1 to 1 */ + in[0] = in[0] * 2 - 1; + in[1] = in[1] * 2 - 1; + in[2] = in[2] * 2 - 1; + + __gluMultMatrixVecd(finalMatrix, in, out); + if (out[3] == 0.0) return(GL_FALSE); + *objx = out[0]; + *objy = out[1]; + *objz = out[2]; + *objw = out[3]; + return(GL_TRUE); +} + +void GLAPIENTRY +gluPickMatrix(GLdouble x, GLdouble y, GLdouble deltax, GLdouble deltay, + GLint viewport[4]) +{ + if (deltax <= 0 || deltay <= 0) { + return; + } + + /* Translate and scale the picked region to the entire window */ + glTranslatef((viewport[2] - 2 * (x - viewport[0])) / deltax, + (viewport[3] - 2 * (y - viewport[1])) / deltay, 0); + glScalef(viewport[2] / deltax, viewport[3] / deltay, 1.0); +} diff --git a/src/glut/glx/Makefile.win b/src/glut/glx/Makefile.win index c3f9614099a..2823a009006 100644 --- a/src/glut/glx/Makefile.win +++ b/src/glut/glx/Makefile.win @@ -1,100 +1,100 @@ -# Makefile for Win32 - -!include - -TOP = .. - -# NOTE: glut_menu.c and glut_glxext.c are NOT compiled into Win32 GLUT - -SRCS = 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_fbc.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_joy.c glut_key.c glut_keyctrl.c glut_keyup.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 - -all : glutdll - -!include "$(TOP)/mesawin32.mak" - -glutdll : $(GLUTDLL) - -!IFDEF NODEBUG -OPTIMIZE_CFLAGS = -DNDEBUG -!ENDIF - -CFLAGS = $(cvarsdll) $(CFLAGS) $(OPTIMIZE_CFLAGS) -DMESA -DBUILD_GL32 -LFLAGS = $(dlllflags) $(LFLAGS) - -OBJS = $(SRCS:.c=.obj) -MS_LIBS = $(MS_OPENGL) $(MS_GLU) winmm.lib $(guilibsdll) -MS_LIBS = ../lib/opengl32.lib ../lib/glu32.lib winmm.lib $(guilibsdll) -SGI_LIBS = $(SGI_OPENGL) $(SGI_GLU) winmm.lib $(guilibsdll) - -glut32.dll : $(OBJS) glut.def - $(link) $(LFLAGS) -out:glut32.dll -def:glut.def $(OBJS) $(MS_LIBS) - @echo "copying GLUT dynamic link library to lib directory..." - -copy $(GLUTDLL) ..\lib - @echo "copying GLUT import library to lib directory..." - -copy $(GLUTLIB) ..\lib - -glut.dll : $(OBJS) glut.def - $(link) $(LFLAGS) -out:glut.dll -def:glut.def $(OBJS) $(SGI_LIBS) - -install : $(GLUTDLL) - @echo "copying GLUT dynamic link library to system directory..." - -copy $(GLUTDLL) $(DLLINSTALL) - @echo "copying GLUT header file to include directory..." - -copy ..\include\GL\glut.h $(INCLUDEINSTALL) - @echo "copying GLUT import library to library directory..." - -copy $(GLUTLIB) $(LIBINSTALL) - -.c.obj : - $(cc) $(CFLAGS) -I . $*.c - -# explicit object dependencies for all source files - -win32_glx.obj: win32_glx.c win32_glx.h -win32_x11.obj: win32_x11.c win32_x11.h -win32_menu.obj: win32_menu.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h -win32_util.obj: win32_util.c glutint.h ..\include\GL\glutf90.h -win32_winproc.obj: win32_winproc.c glutint.h ..\include\GL\glutf90.h - -glut_mroman.obj: glut_mroman.c glutstroke.h glutint.h ..\include\GL\glutf90.h -glut_roman.obj: glut_roman.c glutstroke.h glutint.h ..\include\GL\glutf90.h -glut_hel12.obj: glut_hel12.c glutbitmap.h glutint.h ..\include\GL\glutf90.h -glut_8x13.obj: glut_8x13.c glutbitmap.h glutint.h ..\include\GL\glutf90.h -glut_hel18.obj: glut_hel18.c glutbitmap.h glutint.h ..\include\GL\glutf90.h -glut_9x15.obj: glut_9x15.c glutbitmap.h glutint.h ..\include\GL\glutf90.h -glut_tr10.obj: glut_tr10.c glutbitmap.h glutint.h ..\include\GL\glutf90.h -glut_hel10.obj: glut_hel10.c glutbitmap.h glutint.h ..\include\GL\glutf90.h -glut_tr24.obj: glut_tr24.c glutbitmap.h glutint.h ..\include\GL\glutf90.h - -glut_bitmap.obj: glut_bitmap.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_bwidth.obj: glut_bwidth.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_cindex.obj: glut_cindex.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_cmap.obj: glut_cmap.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_cursor.obj: glut_cursor.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_dials.obj: glut_dials.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_dstr.obj: glut_dstr.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_event.obj: glut_event.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_ext.obj: glut_ext.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_fullscrn.obj: glut_fullscrn.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_gamemode.obj: glut_gamemode.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_get.obj: glut_get.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_init.obj: glut_init.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_input.obj: glut_input.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_joy.obj: glut_joy.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_key.obj: glut_key.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_keyctrl.obj: glut_keyctrl.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_keyup.obj: glut_keyup.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_mesa.obj: glut_mesa.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_modifier.obj: glut_modifier.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_overlay.obj: glut_overlay.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_shapes.obj: glut_shapes.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_space.obj: glut_space.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_swap.obj: glut_swap.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_swidth.obj: glut_swidth.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_tablet.obj: glut_tablet.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_teapot.obj: glut_teapot.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_util.obj: glut_util.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_vidresize.obj: glut_vidresize.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_warp.obj: glut_warp.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h -glut_win.obj: glut_win.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h -glut_winmisc.obj: glut_winmisc.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h - +# Makefile for Win32 + +!include + +TOP = .. + +# NOTE: glut_menu.c and glut_glxext.c are NOT compiled into Win32 GLUT + +SRCS = 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_fbc.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_joy.c glut_key.c glut_keyctrl.c glut_keyup.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 + +all : glutdll + +!include "$(TOP)/mesawin32.mak" + +glutdll : $(GLUTDLL) + +!IFDEF NODEBUG +OPTIMIZE_CFLAGS = -DNDEBUG +!ENDIF + +CFLAGS = $(cvarsdll) $(CFLAGS) $(OPTIMIZE_CFLAGS) -DMESA -DBUILD_GL32 +LFLAGS = $(dlllflags) $(LFLAGS) + +OBJS = $(SRCS:.c=.obj) +MS_LIBS = $(MS_OPENGL) $(MS_GLU) winmm.lib $(guilibsdll) +MS_LIBS = ../lib/opengl32.lib ../lib/glu32.lib winmm.lib $(guilibsdll) +SGI_LIBS = $(SGI_OPENGL) $(SGI_GLU) winmm.lib $(guilibsdll) + +glut32.dll : $(OBJS) glut.def + $(link) $(LFLAGS) -out:glut32.dll -def:glut.def $(OBJS) $(MS_LIBS) + @echo "copying GLUT dynamic link library to lib directory..." + -copy $(GLUTDLL) ..\lib + @echo "copying GLUT import library to lib directory..." + -copy $(GLUTLIB) ..\lib + +glut.dll : $(OBJS) glut.def + $(link) $(LFLAGS) -out:glut.dll -def:glut.def $(OBJS) $(SGI_LIBS) + +install : $(GLUTDLL) + @echo "copying GLUT dynamic link library to system directory..." + -copy $(GLUTDLL) $(DLLINSTALL) + @echo "copying GLUT header file to include directory..." + -copy ..\include\GL\glut.h $(INCLUDEINSTALL) + @echo "copying GLUT import library to library directory..." + -copy $(GLUTLIB) $(LIBINSTALL) + +.c.obj : + $(cc) $(CFLAGS) -I . $*.c + +# explicit object dependencies for all source files + +win32_glx.obj: win32_glx.c win32_glx.h +win32_x11.obj: win32_x11.c win32_x11.h +win32_menu.obj: win32_menu.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h +win32_util.obj: win32_util.c glutint.h ..\include\GL\glutf90.h +win32_winproc.obj: win32_winproc.c glutint.h ..\include\GL\glutf90.h + +glut_mroman.obj: glut_mroman.c glutstroke.h glutint.h ..\include\GL\glutf90.h +glut_roman.obj: glut_roman.c glutstroke.h glutint.h ..\include\GL\glutf90.h +glut_hel12.obj: glut_hel12.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_8x13.obj: glut_8x13.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_hel18.obj: glut_hel18.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_9x15.obj: glut_9x15.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_tr10.obj: glut_tr10.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_hel10.obj: glut_hel10.c glutbitmap.h glutint.h ..\include\GL\glutf90.h +glut_tr24.obj: glut_tr24.c glutbitmap.h glutint.h ..\include\GL\glutf90.h + +glut_bitmap.obj: glut_bitmap.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_bwidth.obj: glut_bwidth.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_cindex.obj: glut_cindex.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_cmap.obj: glut_cmap.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_cursor.obj: glut_cursor.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_dials.obj: glut_dials.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_dstr.obj: glut_dstr.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_event.obj: glut_event.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_ext.obj: glut_ext.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_fullscrn.obj: glut_fullscrn.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_gamemode.obj: glut_gamemode.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_get.obj: glut_get.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_init.obj: glut_init.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_input.obj: glut_input.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_joy.obj: glut_joy.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_key.obj: glut_key.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_keyctrl.obj: glut_keyctrl.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_keyup.obj: glut_keyup.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_mesa.obj: glut_mesa.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_modifier.obj: glut_modifier.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_overlay.obj: glut_overlay.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_shapes.obj: glut_shapes.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_space.obj: glut_space.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_swap.obj: glut_swap.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_swidth.obj: glut_swidth.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_tablet.obj: glut_tablet.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_teapot.obj: glut_teapot.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_util.obj: glut_util.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_vidresize.obj: glut_vidresize.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_warp.obj: glut_warp.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h +glut_win.obj: glut_win.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h +glut_winmisc.obj: glut_winmisc.c glutint.h ..\include\GL\glutf90.h ..\include\GL\glut.h glutwin32.h win32_glx.h win32_x11.h + diff --git a/src/glut/glx/glut.def b/src/glut/glx/glut.def index 94da6ab852e..d7d0240fca0 100644 --- a/src/glut/glx/glut.def +++ b/src/glut/glx/glut.def @@ -1,9 +1,9 @@ DESCRIPTION 'OpenGL Utility Toolkit for Win32' - -VERSION 3.7 - + +VERSION 3.7 + EXPORTS - + glutAddMenuEntry glutAddSubMenu glutAttachMenu @@ -123,4 +123,4 @@ EXPORTS glutWireTorus ; __glutSetFCB ; __glutGetFCB - + diff --git a/src/glut/glx/win32_x11.h b/src/glut/glx/win32_x11.h index 70de9060919..1d8d048b2e0 100644 --- a/src/glut/glx/win32_x11.h +++ b/src/glut/glx/win32_x11.h @@ -1,326 +1,326 @@ -#ifndef __win32_x11_h__ -#define __win32_x11_h__ - -/* Copyright (c) Nate Robins, 1997. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include -#include - -/* These definitions are missing from windows.h */ -WINGDIAPI int WINAPI wglChoosePixelFormat(HDC, PIXELFORMATDESCRIPTOR *); -WINGDIAPI int WINAPI wglDescribePixelFormat(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR); -WINGDIAPI int WINAPI wglGetPixelFormat(HDC); -WINGDIAPI BOOL WINAPI wglSetPixelFormat(HDC, int, PIXELFORMATDESCRIPTOR *); -WINGDIAPI BOOL WINAPI wglSwapBuffers(HDC); - -/* Type definitions (conversions) */ -typedef int Visual; /* Win32 equivalent of X11 type */ -typedef HWND Window; -typedef HPALETTE Colormap; -typedef PIXELFORMATDESCRIPTOR XVisualInfo; -typedef BOOL Bool; -typedef MSG XEvent; -typedef HDC Display; -typedef HCURSOR Cursor; - -typedef int Atom; /* dummies */ -typedef int XDevice; -typedef int Status; - -#define True TRUE /* Win32 equivalents of X11 booleans */ -#define False FALSE - -#define None 0L /* universal null resource or null atom */ - -/* Input Event Masks. Used as event-mask window attribute and as arguments - to Grab requests. Not to be confused with event names. */ - -#define NoEventMask 0L -#define KeyPressMask (1L<<0) -#define KeyReleaseMask (1L<<1) -#define ButtonPressMask (1L<<2) -#define ButtonReleaseMask (1L<<3) -#define EnterWindowMask (1L<<4) -#define LeaveWindowMask (1L<<5) -#define PointerMotionMask (1L<<6) -#define PointerMotionHintMask (1L<<7) -#define Button1MotionMask (1L<<8) -#define Button2MotionMask (1L<<9) -#define Button3MotionMask (1L<<10) -#define Button4MotionMask (1L<<11) -#define Button5MotionMask (1L<<12) -#define ButtonMotionMask (1L<<13) -#define KeymapStateMask (1L<<14) -#define ExposureMask (1L<<15) -#define VisibilityChangeMask (1L<<16) -#define StructureNotifyMask (1L<<17) -#define ResizeRedirectMask (1L<<18) -#define SubstructureNotifyMask (1L<<19) -#define SubstructureRedirectMask (1L<<20) -#define FocusChangeMask (1L<<21) -#define PropertyChangeMask (1L<<22) -#define ColormapChangeMask (1L<<23) -#define OwnerGrabButtonMask (1L<<24) - -/* Key masks. Used as modifiers to GrabButton and GrabKey, results of - QueryPointer, state in various key-, mouse-, and button-related - events. */ - -#define ShiftMask (1<<0) -#define LockMask (1<<1) -#define ControlMask (1<<2) -#define Mod1Mask (1<<3) -#define Mod2Mask (1<<4) -#define Mod3Mask (1<<5) -#define Mod4Mask (1<<6) -#define Mod5Mask (1<<7) - -/* Window classes used by CreateWindow */ -/* Note that CopyFromParent is already defined as 0 above */ - -#define InputOutput 1 -#define InputOnly 2 - -/* Window attributes for CreateWindow and ChangeWindowAttributes */ - -#define CWBackPixmap (1L<<0) -#define CWBackPixel (1L<<1) -#define CWBorderPixmap (1L<<2) -#define CWBorderPixel (1L<<3) -#define CWBitGravity (1L<<4) -#define CWWinGravity (1L<<5) -#define CWBackingStore (1L<<6) -#define CWBackingPlanes (1L<<7) -#define CWBackingPixel (1L<<8) -#define CWOverrideRedirect (1L<<9) -#define CWSaveUnder (1L<<10) -#define CWEventMask (1L<<11) -#define CWDontPropagate (1L<<12) -#define CWColormap (1L<<13) -#define CWCursor (1L<<14) - -/* ConfigureWindow structure */ - -#define CWX (1<<0) -#define CWY (1<<1) -#define CWWidth (1<<2) -#define CWHeight (1<<3) -#define CWBorderWidth (1<<4) -#define CWSibling (1<<5) -#define CWStackMode (1<<6) - - -/* Used in GetWindowAttributes reply */ - -#define IsUnmapped 0 -#define IsUnviewable 1 -#define IsViewable 2 - -/* Window stacking method (in configureWindow) */ - -#define Above 0 -#define Below 1 -#define TopIf 2 -#define BottomIf 3 -#define Opposite 4 - -/* For CreateColormap */ - -#define AllocNone 0 /* create map with no entries */ -#define AllocAll 1 /* allocate entire map writeable */ - - -/* Flags used in StoreNamedColor, StoreColors */ - -#define DoRed (1<<0) -#define DoGreen (1<<1) -#define DoBlue (1<<2) - -/* - * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding - * value (x, y, width, height) was found in the parsed string. - */ -#define NoValue 0x0000 -#define XValue 0x0001 -#define YValue 0x0002 -#define WidthValue 0x0004 -#define HeightValue 0x0008 -#define AllValues 0x000F -#define XNegative 0x0010 -#define YNegative 0x0020 - -/* flags argument in size hints */ -#define USPosition (1L << 0) /* user specified x, y */ -#define USSize (1L << 1) /* user specified width, height */ - -/* definitions for initial window state */ -#define WithdrawnState 0 /* for windows that are not mapped */ -#define NormalState 1 /* most applications want to start this way */ -#define IconicState 3 /* application wants to start as an icon */ -#define GameModeState 4 /* Win32 GLUT only (not in Xlib!). */ - -/* Type definitions */ - -typedef struct { - unsigned int background_pixmap; /* background pixmap */ - unsigned long background_pixel; /* background pixel */ - unsigned long border_pixel; /* border pixel value */ - long event_mask; /* set of events that should be saved */ - long do_not_propagate_mask; /* set of events that should not propagate */ - Bool override_redirect; /* boolean value for override-redirect */ - Colormap colormap; /* color map to be associated with window */ -} XSetWindowAttributes; - -typedef struct { - unsigned long pixel; - unsigned short red, green, blue; - char flags; /* do_red, do_green, do_blue */ -} XColor; - -typedef struct { - unsigned char *value; /* same as Property routines */ - Atom encoding; /* prop type */ - int format; /* prop data format: 8, 16, or 32 */ - unsigned long nitems; /* number of data items in value */ -} XTextProperty; - -typedef struct { - long flags; /* marks which fields in this structure are defined */ - int x, y; /* obsolete for new window mgrs, but clients */ - int width, height; /* should set so old wm's don't mess up */ -} XSizeHints; - -/* Functions emulated by macros. */ - -#define XFreeColormap(display, colormap) \ - DeleteObject(colormap) - -#define XCreateFontCursor(display, shape) \ - LoadCursor(NULL, shape) - -#define XDefineCursor(display, window, cursor) \ - SetCursor(cursor) - -#define XFlush(display) \ - /* Nothing. */ - -#define DisplayWidth(display, screen) \ - GetSystemMetrics(SM_CXSCREEN) - -#define DisplayHeight(display, screen) \ - GetSystemMetrics(SM_CYSCREEN) - -#define XMapWindow(display, window) \ - ShowWindow(window, SW_SHOWNORMAL) - -#define XUnmapWindow(display, window) \ - ShowWindow(window, SW_HIDE) - -#define XIconifyWindow(display, window, screen) \ - ShowWindow(window, SW_MINIMIZE) - -#define XWithdrawWindow(display, window, screen) \ - ShowWindow(window, SW_HIDE) - -#define XLowerWindow(display, window) \ - SetWindowPos(window, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE) - -#define XSetWMName(display, window, tp) \ - SetWindowText(window, (tp)->value) - -/* There really isn't a way to set the icon name separate from the - windows name in Win32, so, just set the windows name. */ -#define XSetWMIconName(display, window, tp) \ - XSetWMName(display, window, tp) - -#define XDestroyWindow(display, window) \ - DestroyWindow(window) - -/* Anything that needs to be freed was allocated with malloc in our - fake X windows library for Win32, so free it with plain old - free(). */ -#define XFree(data) \ - free(data) - -/* Nothing to be done for this...the pointer is always 'ungrabbed' - in Win32. */ -#define XUngrabPointer(display, time) \ - /* Nothing. */ - -/* Function prototypes. */ - -extern XVisualInfo* XGetVisualInfo( - Display* display, - long mask, - XVisualInfo* ttemplate, /* Avoid class with C++ keyword. */ - int*nitems); - -extern Colormap XCreateColormap( - Display* display, - Window root, - Visual* visual, - int alloc); - -extern void XAllocColorCells( - Display* display, - Colormap colormap, - Bool contig, - unsigned long plane_masks_return[], - unsigned int nplanes, - unsigned long pixels_return[], - unsigned int npixels); - -extern void XStoreColor( - Display* display, - Colormap colormap, - XColor* color); - -extern void XSetWindowColormap( - Display* display, - Window window, - Colormap colormap); - -extern Bool XTranslateCoordinates( - Display *display, - Window src, Window dst, - int src_x, int src_y, - int* dest_x_return, int* dest_y_return, - Window* child_return); - -extern Status XGetGeometry( - Display* display, - Window window, - Window* root_return, - int* x_return, int* y_return, - unsigned int* width_return, unsigned int* height_return, - unsigned int *border_width_return, - unsigned int* depth_return); - -extern int DisplayWidthMM( - Display* display, - int screen); - -extern int DisplayHeightMM( - Display* display, - int screen); - -extern void XWarpPointer( - Display* display, - Window src, Window dst, - int src_x, int src_y, - int src_width, int src_height, - int dst_x, int dst_y); - -extern int XParseGeometry( - char* string, - int* x, int* y, - unsigned int* width, unsigned int* height); - -extern int XPending( - Display* display); - -#endif /* __win32_x11_h__ */ +#ifndef __win32_x11_h__ +#define __win32_x11_h__ + +/* Copyright (c) Nate Robins, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include + +/* These definitions are missing from windows.h */ +WINGDIAPI int WINAPI wglChoosePixelFormat(HDC, PIXELFORMATDESCRIPTOR *); +WINGDIAPI int WINAPI wglDescribePixelFormat(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR); +WINGDIAPI int WINAPI wglGetPixelFormat(HDC); +WINGDIAPI BOOL WINAPI wglSetPixelFormat(HDC, int, PIXELFORMATDESCRIPTOR *); +WINGDIAPI BOOL WINAPI wglSwapBuffers(HDC); + +/* Type definitions (conversions) */ +typedef int Visual; /* Win32 equivalent of X11 type */ +typedef HWND Window; +typedef HPALETTE Colormap; +typedef PIXELFORMATDESCRIPTOR XVisualInfo; +typedef BOOL Bool; +typedef MSG XEvent; +typedef HDC Display; +typedef HCURSOR Cursor; + +typedef int Atom; /* dummies */ +typedef int XDevice; +typedef int Status; + +#define True TRUE /* Win32 equivalents of X11 booleans */ +#define False FALSE + +#define None 0L /* universal null resource or null atom */ + +/* Input Event Masks. Used as event-mask window attribute and as arguments + to Grab requests. Not to be confused with event names. */ + +#define NoEventMask 0L +#define KeyPressMask (1L<<0) +#define KeyReleaseMask (1L<<1) +#define ButtonPressMask (1L<<2) +#define ButtonReleaseMask (1L<<3) +#define EnterWindowMask (1L<<4) +#define LeaveWindowMask (1L<<5) +#define PointerMotionMask (1L<<6) +#define PointerMotionHintMask (1L<<7) +#define Button1MotionMask (1L<<8) +#define Button2MotionMask (1L<<9) +#define Button3MotionMask (1L<<10) +#define Button4MotionMask (1L<<11) +#define Button5MotionMask (1L<<12) +#define ButtonMotionMask (1L<<13) +#define KeymapStateMask (1L<<14) +#define ExposureMask (1L<<15) +#define VisibilityChangeMask (1L<<16) +#define StructureNotifyMask (1L<<17) +#define ResizeRedirectMask (1L<<18) +#define SubstructureNotifyMask (1L<<19) +#define SubstructureRedirectMask (1L<<20) +#define FocusChangeMask (1L<<21) +#define PropertyChangeMask (1L<<22) +#define ColormapChangeMask (1L<<23) +#define OwnerGrabButtonMask (1L<<24) + +/* Key masks. Used as modifiers to GrabButton and GrabKey, results of + QueryPointer, state in various key-, mouse-, and button-related + events. */ + +#define ShiftMask (1<<0) +#define LockMask (1<<1) +#define ControlMask (1<<2) +#define Mod1Mask (1<<3) +#define Mod2Mask (1<<4) +#define Mod3Mask (1<<5) +#define Mod4Mask (1<<6) +#define Mod5Mask (1<<7) + +/* Window classes used by CreateWindow */ +/* Note that CopyFromParent is already defined as 0 above */ + +#define InputOutput 1 +#define InputOnly 2 + +/* Window attributes for CreateWindow and ChangeWindowAttributes */ + +#define CWBackPixmap (1L<<0) +#define CWBackPixel (1L<<1) +#define CWBorderPixmap (1L<<2) +#define CWBorderPixel (1L<<3) +#define CWBitGravity (1L<<4) +#define CWWinGravity (1L<<5) +#define CWBackingStore (1L<<6) +#define CWBackingPlanes (1L<<7) +#define CWBackingPixel (1L<<8) +#define CWOverrideRedirect (1L<<9) +#define CWSaveUnder (1L<<10) +#define CWEventMask (1L<<11) +#define CWDontPropagate (1L<<12) +#define CWColormap (1L<<13) +#define CWCursor (1L<<14) + +/* ConfigureWindow structure */ + +#define CWX (1<<0) +#define CWY (1<<1) +#define CWWidth (1<<2) +#define CWHeight (1<<3) +#define CWBorderWidth (1<<4) +#define CWSibling (1<<5) +#define CWStackMode (1<<6) + + +/* Used in GetWindowAttributes reply */ + +#define IsUnmapped 0 +#define IsUnviewable 1 +#define IsViewable 2 + +/* Window stacking method (in configureWindow) */ + +#define Above 0 +#define Below 1 +#define TopIf 2 +#define BottomIf 3 +#define Opposite 4 + +/* For CreateColormap */ + +#define AllocNone 0 /* create map with no entries */ +#define AllocAll 1 /* allocate entire map writeable */ + + +/* Flags used in StoreNamedColor, StoreColors */ + +#define DoRed (1<<0) +#define DoGreen (1<<1) +#define DoBlue (1<<2) + +/* + * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding + * value (x, y, width, height) was found in the parsed string. + */ +#define NoValue 0x0000 +#define XValue 0x0001 +#define YValue 0x0002 +#define WidthValue 0x0004 +#define HeightValue 0x0008 +#define AllValues 0x000F +#define XNegative 0x0010 +#define YNegative 0x0020 + +/* flags argument in size hints */ +#define USPosition (1L << 0) /* user specified x, y */ +#define USSize (1L << 1) /* user specified width, height */ + +/* definitions for initial window state */ +#define WithdrawnState 0 /* for windows that are not mapped */ +#define NormalState 1 /* most applications want to start this way */ +#define IconicState 3 /* application wants to start as an icon */ +#define GameModeState 4 /* Win32 GLUT only (not in Xlib!). */ + +/* Type definitions */ + +typedef struct { + unsigned int background_pixmap; /* background pixmap */ + unsigned long background_pixel; /* background pixel */ + unsigned long border_pixel; /* border pixel value */ + long event_mask; /* set of events that should be saved */ + long do_not_propagate_mask; /* set of events that should not propagate */ + Bool override_redirect; /* boolean value for override-redirect */ + Colormap colormap; /* color map to be associated with window */ +} XSetWindowAttributes; + +typedef struct { + unsigned long pixel; + unsigned short red, green, blue; + char flags; /* do_red, do_green, do_blue */ +} XColor; + +typedef struct { + unsigned char *value; /* same as Property routines */ + Atom encoding; /* prop type */ + int format; /* prop data format: 8, 16, or 32 */ + unsigned long nitems; /* number of data items in value */ +} XTextProperty; + +typedef struct { + long flags; /* marks which fields in this structure are defined */ + int x, y; /* obsolete for new window mgrs, but clients */ + int width, height; /* should set so old wm's don't mess up */ +} XSizeHints; + +/* Functions emulated by macros. */ + +#define XFreeColormap(display, colormap) \ + DeleteObject(colormap) + +#define XCreateFontCursor(display, shape) \ + LoadCursor(NULL, shape) + +#define XDefineCursor(display, window, cursor) \ + SetCursor(cursor) + +#define XFlush(display) \ + /* Nothing. */ + +#define DisplayWidth(display, screen) \ + GetSystemMetrics(SM_CXSCREEN) + +#define DisplayHeight(display, screen) \ + GetSystemMetrics(SM_CYSCREEN) + +#define XMapWindow(display, window) \ + ShowWindow(window, SW_SHOWNORMAL) + +#define XUnmapWindow(display, window) \ + ShowWindow(window, SW_HIDE) + +#define XIconifyWindow(display, window, screen) \ + ShowWindow(window, SW_MINIMIZE) + +#define XWithdrawWindow(display, window, screen) \ + ShowWindow(window, SW_HIDE) + +#define XLowerWindow(display, window) \ + SetWindowPos(window, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE) + +#define XSetWMName(display, window, tp) \ + SetWindowText(window, (tp)->value) + +/* There really isn't a way to set the icon name separate from the + windows name in Win32, so, just set the windows name. */ +#define XSetWMIconName(display, window, tp) \ + XSetWMName(display, window, tp) + +#define XDestroyWindow(display, window) \ + DestroyWindow(window) + +/* Anything that needs to be freed was allocated with malloc in our + fake X windows library for Win32, so free it with plain old + free(). */ +#define XFree(data) \ + free(data) + +/* Nothing to be done for this...the pointer is always 'ungrabbed' + in Win32. */ +#define XUngrabPointer(display, time) \ + /* Nothing. */ + +/* Function prototypes. */ + +extern XVisualInfo* XGetVisualInfo( + Display* display, + long mask, + XVisualInfo* ttemplate, /* Avoid class with C++ keyword. */ + int*nitems); + +extern Colormap XCreateColormap( + Display* display, + Window root, + Visual* visual, + int alloc); + +extern void XAllocColorCells( + Display* display, + Colormap colormap, + Bool contig, + unsigned long plane_masks_return[], + unsigned int nplanes, + unsigned long pixels_return[], + unsigned int npixels); + +extern void XStoreColor( + Display* display, + Colormap colormap, + XColor* color); + +extern void XSetWindowColormap( + Display* display, + Window window, + Colormap colormap); + +extern Bool XTranslateCoordinates( + Display *display, + Window src, Window dst, + int src_x, int src_y, + int* dest_x_return, int* dest_y_return, + Window* child_return); + +extern Status XGetGeometry( + Display* display, + Window window, + Window* root_return, + int* x_return, int* y_return, + unsigned int* width_return, unsigned int* height_return, + unsigned int *border_width_return, + unsigned int* depth_return); + +extern int DisplayWidthMM( + Display* display, + int screen); + +extern int DisplayHeightMM( + Display* display, + int screen); + +extern void XWarpPointer( + Display* display, + Window src, Window dst, + int src_x, int src_y, + int src_width, int src_height, + int dst_x, int dst_y); + +extern int XParseGeometry( + char* string, + int* x, int* y, + unsigned int* width, unsigned int* height); + +extern int XPending( + Display* display); + +#endif /* __win32_x11_h__ */ diff --git a/src/mesa/drivers/osmesa/Makefile.win b/src/mesa/drivers/osmesa/Makefile.win index 1d2f0aac4d4..a9597c2714a 100644 --- a/src/mesa/drivers/osmesa/Makefile.win +++ b/src/mesa/drivers/osmesa/Makefile.win @@ -1,37 +1,37 @@ -# Makefile for Win32 - -!include - -TOP = ..\.. - -OSMESA_SRCS = osmesa.c -OSMESA_OBJS = osmesa.obj -OSMESALIB = OSmesa.lib - -ASM_SRCS = -CORE_SRCS = $(OSMESA_SRCS) -DRIVER_SRCS = - -SRCS = $(OSMESA_SRCS) - -all : osmesalib install - -!include "$(TOP)/mesawin32.mak" - -osmesalib : $(OSMESALIB) - -CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -I$(TOP)/src -LFLAGS = /LIB - -OBJS = $(ASM_SRCS:.S=.obj) $(CORE_SRCS:.c=.obj) $(DRIVER_SRCS:.c=.obj) -LIBS = $(TOP)/lib/OpenGL32.lib $(TOP)/src/opengl32.exp - -$(OSMESALIB) : $(OBJS) - $(link) $(LFLAGS) -out:$(OSMESALIB) $(OBJS) $(LIBS) - -install : $(OSMESALIB) - @echo "copying OSMesa library to library directory..." - -copy $(OSMESALIB) $(TOP)\lib - -clean :: - @del /f osmesa.obj +# Makefile for Win32 + +!include + +TOP = ..\.. + +OSMESA_SRCS = osmesa.c +OSMESA_OBJS = osmesa.obj +OSMESALIB = OSmesa.lib + +ASM_SRCS = +CORE_SRCS = $(OSMESA_SRCS) +DRIVER_SRCS = + +SRCS = $(OSMESA_SRCS) + +all : osmesalib install + +!include "$(TOP)/mesawin32.mak" + +osmesalib : $(OSMESALIB) + +CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -I$(TOP)/src +LFLAGS = /LIB + +OBJS = $(ASM_SRCS:.S=.obj) $(CORE_SRCS:.c=.obj) $(DRIVER_SRCS:.c=.obj) +LIBS = $(TOP)/lib/OpenGL32.lib $(TOP)/src/opengl32.exp + +$(OSMESALIB) : $(OBJS) + $(link) $(LFLAGS) -out:$(OSMESALIB) $(OBJS) $(LIBS) + +install : $(OSMESALIB) + @echo "copying OSMesa library to library directory..." + -copy $(OSMESALIB) $(TOP)\lib + +clean :: + @del /f osmesa.obj diff --git a/src/mesa/drivers/windows/wgl.c b/src/mesa/drivers/windows/wgl.c index f7bf6820169..0db57641fe1 100644 --- a/src/mesa/drivers/windows/wgl.c +++ b/src/mesa/drivers/windows/wgl.c @@ -1,645 +1,645 @@ -/* $Id: wgl.c,v 1.8 2001/09/14 22:19:19 brianp Exp $ */ - -/* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Library General Public -* License as published by the Free Software Foundation; either -* version 2 of the License, or (at your option) any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Library General Public License for more details. -* -* You should have received a copy of the GNU Library General Public -* License along with this library; if not, write to the Free -* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -* -*/ - -/* -* File name : wgl.c -* WGL stuff. Added by Oleg Letsinsky, ajl@ultersys.ru -* Some things originated from the 3Dfx WGL functions -*/ - -#ifdef WIN32 - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#define GL_GLEXT_PROTOTYPES -#include -#include -//#include - -#ifdef __cplusplus -} -#endif - -#include -#include -#include "wmesadef.h" -#include "GL/wmesa.h" -#include "mtypes.h" - -#define MAX_MESA_ATTRS 20 - -struct __extensions__ -{ - PROC proc; - char *name; -}; - -struct __pixelformat__ -{ - PIXELFORMATDESCRIPTOR pfd; - GLboolean doubleBuffered; -}; - -struct __extensions__ ext[] = { - -#ifdef GL_EXT_polygon_offset - { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" }, -#endif - { (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" }, - { (PROC)glColorTableEXT, "glColorTableEXT" }, - { (PROC)glColorSubTableEXT, "glColorSubTableEXT" }, - { (PROC)glGetColorTableEXT, "glGetColorTableEXT" }, - { (PROC)glGetColorTableParameterfvEXT, "glGetColorTableParameterfvEXT" }, - { (PROC)glGetColorTableParameterivEXT, "glGetColorTableParameterivEXT" }, - { (PROC)glPointParameterfEXT, "glPointParameterfEXT" }, - { (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" }, - { (PROC)glBlendFuncSeparateEXT, "glBlendFuncSeparateEXT" }, - { (PROC)glLockArraysEXT, "glLockArraysEXT" }, - { (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" } -}; - -int qt_ext = sizeof(ext) / sizeof(ext[0]); - -struct __pixelformat__ pix[] = -{ - { { sizeof(PIXELFORMATDESCRIPTOR), 1, - PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_GENERIC_FORMAT|PFD_DOUBLEBUFFER|PFD_SWAP_COPY, - PFD_TYPE_RGBA, - 24, 8, 0, 8, 8, 8, 16, 8, 24, - 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 }, - GL_TRUE - }, - { { sizeof(PIXELFORMATDESCRIPTOR), 1, - PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_GENERIC_FORMAT, - PFD_TYPE_RGBA, - 24, 8, 0, 8, 8, 8, 16, 8, 24, - 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 }, - GL_FALSE - }, -}; - -int qt_pix = sizeof(pix) / sizeof(pix[0]); - -typedef struct { - WMesaContext ctx; - HDC hdc; -} MesaWglCtx; - -#define MESAWGL_CTX_MAX_COUNT 20 - -static MesaWglCtx wgl_ctx[MESAWGL_CTX_MAX_COUNT]; - -static unsigned ctx_count = 0; -static unsigned ctx_current = -1; -static unsigned curPFD = 0; - -WGLAPI BOOL GLAPIENTRY wglCopyContext(HGLRC hglrcSrc,HGLRC hglrcDst,UINT mask) -{ - return(FALSE); -} - -WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC hdc) -{ - HWND hWnd; - int i = 0; - if(!(hWnd = WindowFromDC(hdc))) - { - SetLastError(0); - return(NULL); - } - if (!ctx_count) - { - for(i=0;ibmiHeader.biSize = sizeof(BITMAPINFOHEADER); - dibInfo->bmiHeader.biPlanes = 1; - dibInfo->bmiHeader.biBitCount = 1; - dibInfo->bmiHeader.biCompression = BI_RGB; - - bitDevice = CreateCompatibleDC(fontDevice); - // HDC bitDevice = CreateDC("DISPLAY", NULL, NULL, NULL); - // VERIFY(bitDevice); - - // Swap fore and back colors so the bitmap has the right polarity - tempColor = GetBkColor(bitDevice); - SetBkColor(bitDevice, GetTextColor(bitDevice)); - SetTextColor(bitDevice, tempColor); - - // Place chars based on base line - VERIFY(SetTextAlign(bitDevice, TA_BASELINE) >= 0 ? 1 : 0); - - for(i = 0; i < numChars; i++) { - SIZE size; - char curChar; - int charWidth,charHeight,bmapWidth,bmapHeight,numBytes,res; - HBITMAP bitObject; - HGDIOBJ origBmap; - unsigned char *bmap; - - curChar = i + firstChar; - - // Find how high/wide this character is - VERIFY(GetTextExtentPoint32(bitDevice, &curChar, 1, &size)); - - // Create the output bitmap - charWidth = size.cx; - charHeight = size.cy; - bmapWidth = ((charWidth + 31) / 32) * 32; // Round up to the next multiple of 32 bits - bmapHeight = charHeight; - bitObject = CreateCompatibleBitmap(bitDevice, - bmapWidth, - bmapHeight); - //VERIFY(bitObject); - - // Assign the output bitmap to the device - origBmap = SelectObject(bitDevice, bitObject); - VERIFY(origBmap); - - VERIFY( PatBlt( bitDevice, 0, 0, bmapWidth, bmapHeight,BLACKNESS ) ); - - // Use our source font on the device - VERIFY(SelectObject(bitDevice, GetCurrentObject(fontDevice,OBJ_FONT))); - - // Draw the character - VERIFY(TextOut(bitDevice, 0, metric.tmAscent, &curChar, 1)); - - // Unselect our bmap object - VERIFY(SelectObject(bitDevice, origBmap)); - - // Convert the display dependant representation to a 1 bit deep DIB - numBytes = (bmapWidth * bmapHeight) / 8; - bmap = malloc(numBytes); - dibInfo->bmiHeader.biWidth = bmapWidth; - dibInfo->bmiHeader.biHeight = bmapHeight; - res = GetDIBits(bitDevice, bitObject, 0, bmapHeight, bmap, - dibInfo, - DIB_RGB_COLORS); - //VERIFY(res); - - // Create the GL object - glNewList(i + listBase, GL_COMPILE); - glBitmap(bmapWidth, bmapHeight, 0.0, metric.tmDescent, - charWidth, 0.0, - bmap); - glEndList(); - // CheckGL(); - - // Destroy the bmap object - DeleteObject(bitObject); - - // Deallocate the bitmap data - free(bmap); - } - - // Destroy the DC - VERIFY(DeleteDC(bitDevice)); - - free(dibInfo); - - return TRUE; -#undef VERIFY -} - -WGLAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first, - DWORD count, DWORD listBase) -{ - int i; - GLuint font_list; - DWORD size; - GLYPHMETRICS gm; - HANDLE hBits; - LPSTR lpBits; - MAT2 mat; - int success = TRUE; - - if (first<0) - return FALSE; - if (count<0) - return FALSE; - if (listBase<0) - return FALSE; - - font_list = listBase; - - mat.eM11 = FixedFromDouble(1); - mat.eM12 = FixedFromDouble(0); - mat.eM21 = FixedFromDouble(0); - mat.eM22 = FixedFromDouble(-1); - - memset(&gm,0,sizeof(gm)); - - /* - ** If we can't get the glyph outline, it may be because this is a fixed - ** font. Try processing it that way. - */ - if( GetGlyphOutline(hdc, first, GGO_BITMAP, &gm, 0, NULL, &mat) - == GDI_ERROR ) - { - return wglUseFontBitmaps_FX( hdc, first, count, listBase ); - } - - /* - ** Otherwise process all desired characters. - */ - for (i = 0; i < count; i++) - { - DWORD err; - - glNewList( font_list+i, GL_COMPILE ); - - /* allocate space for the bitmap/outline */ - size = GetGlyphOutline(hdc, first + i, GGO_BITMAP, &gm, 0, NULL, &mat); - if (size == GDI_ERROR) - { - glEndList( ); - err = GetLastError(); - success = FALSE; - continue; - } - - hBits = GlobalAlloc(GHND, size+1); - lpBits = GlobalLock(hBits); - - err = - GetGlyphOutline(hdc, /* handle to device context */ - first + i, /* character to query */ - GGO_BITMAP, /* format of data to return */ - &gm, /* pointer to structure for metrics*/ - size, /* size of buffer for data */ - lpBits, /* pointer to buffer for data */ - &mat /* pointer to transformation */ - /* matrix structure */ - ); - - if (err == GDI_ERROR) - { - GlobalUnlock(hBits); - GlobalFree(hBits); - - glEndList( ); - err = GetLastError(); - success = FALSE; - continue; - } - - glBitmap(gm.gmBlackBoxX,gm.gmBlackBoxY, - -gm.gmptGlyphOrigin.x, - gm.gmptGlyphOrigin.y, - gm.gmCellIncX,gm.gmCellIncY, - (const GLubyte * )lpBits); - - GlobalUnlock(hBits); - GlobalFree(hBits); - - glEndList( ); - } - - return success; -} - - -WGLAPI BOOL GLAPIENTRY wglUseFontBitmapsW(HDC hdc,DWORD first,DWORD count,DWORD listBase) -{ - return FALSE; -} - -WGLAPI BOOL GLAPIENTRY wglUseFontOutlinesA(HDC hdc,DWORD first,DWORD count, - DWORD listBase,FLOAT deviation, - FLOAT extrusion,int format, - LPGLYPHMETRICSFLOAT lpgmf) -{ - SetLastError(0); - return(FALSE); -} - -WGLAPI BOOL GLAPIENTRY wglUseFontOutlinesW(HDC hdc,DWORD first,DWORD count, - DWORD listBase,FLOAT deviation, - FLOAT extrusion,int format, - LPGLYPHMETRICSFLOAT lpgmf) -{ - SetLastError(0); - return(FALSE); -} - -WGLAPI BOOL GLAPIENTRY wglDescribeLayerPlane(HDC hdc,int iPixelFormat, - int iLayerPlane,UINT nBytes, - LPLAYERPLANEDESCRIPTOR plpd) -{ - SetLastError(0); - return(FALSE); -} - -WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC hdc,int iLayerPlane, - int iStart,int cEntries, - CONST COLORREF *pcr) -{ - SetLastError(0); - return(0); -} - -WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC hdc,int iLayerPlane, - int iStart,int cEntries, - COLORREF *pcr) -{ - SetLastError(0); - return(0); -} - -WGLAPI BOOL GLAPIENTRY wglRealizeLayerPalette(HDC hdc,int iLayerPlane,BOOL bRealize) -{ - SetLastError(0); - return(FALSE); -} - -WGLAPI BOOL GLAPIENTRY wglSwapLayerBuffers(HDC hdc,UINT fuPlanes) -{ - if( !hdc ) - { - WMesaSwapBuffers(); - return(TRUE); - } - SetLastError(0); - return(FALSE); -} - -WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC hdc, - CONST PIXELFORMATDESCRIPTOR *ppfd) -{ - int i,best = -1,bestdelta = 0x7FFFFFFF,delta,qt_valid_pix; - - qt_valid_pix = qt_pix; - if(ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR) || ppfd->nVersion != 1) - { - SetLastError(0); - return(0); - } - for(i = 0;i < qt_valid_pix;i++) - { - delta = 0; - if( - (ppfd->dwFlags & PFD_DRAW_TO_WINDOW) && - !(pix[i].pfd.dwFlags & PFD_DRAW_TO_WINDOW)) - continue; - if( - (ppfd->dwFlags & PFD_DRAW_TO_BITMAP) && - !(pix[i].pfd.dwFlags & PFD_DRAW_TO_BITMAP)) - continue; - if( - (ppfd->dwFlags & PFD_SUPPORT_GDI) && - !(pix[i].pfd.dwFlags & PFD_SUPPORT_GDI)) - continue; - if( - (ppfd->dwFlags & PFD_SUPPORT_OPENGL) && - !(pix[i].pfd.dwFlags & PFD_SUPPORT_OPENGL)) - continue; - if( - !(ppfd->dwFlags & PFD_DOUBLEBUFFER_DONTCARE) && - ((ppfd->dwFlags & PFD_DOUBLEBUFFER) != (pix[i].pfd.dwFlags & PFD_DOUBLEBUFFER))) - continue; - if( - !(ppfd->dwFlags & PFD_STEREO_DONTCARE) && - ((ppfd->dwFlags & PFD_STEREO) != (pix[i].pfd.dwFlags & PFD_STEREO))) - continue; - if(ppfd->iPixelType != pix[i].pfd.iPixelType) - delta++; - if(delta < bestdelta) - { - best = i + 1; - bestdelta = delta; - if(bestdelta == 0) - break; - } - } - if(best == -1) - { - SetLastError(0); - return(0); - } - return(best); -} - -WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC hdc,int iPixelFormat,UINT nBytes, - LPPIXELFORMATDESCRIPTOR ppfd) -{ - int qt_valid_pix; - - qt_valid_pix = qt_pix; - if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix || nBytes != sizeof(PIXELFORMATDESCRIPTOR)) - { - SetLastError(0); - return(0); - } - *ppfd = pix[iPixelFormat - 1].pfd; - return(qt_valid_pix); -} - -/* -* GetProcAddress - return the address of an appropriate extension -*/ -WGLAPI PROC GLAPIENTRY wglGetProcAddress(LPCSTR lpszProc) -{ - int i; - for(i = 0;i < qt_ext;i++) - if(!strcmp(lpszProc,ext[i].name)) - return(ext[i].proc); - - SetLastError(0); - return(NULL); -} - -WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc) -{ - if(curPFD == 0) - { - SetLastError(0); - return(0); - } - return(curPFD); -} - -WGLAPI BOOL GLAPIENTRY wglSetPixelFormat(HDC hdc,int iPixelFormat, - PIXELFORMATDESCRIPTOR *ppfd) -{ - int qt_valid_pix; - - qt_valid_pix = qt_pix; - if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix || ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR)) - { - SetLastError(0); - return(FALSE); - } - curPFD = iPixelFormat; - return(TRUE); -} - -WGLAPI BOOL GLAPIENTRY wglSwapBuffers(HDC hdc) -{ - if (ctx_current < 0) - return FALSE; - - if(wgl_ctx[ctx_current].ctx == NULL) { - SetLastError(0); - return(FALSE); - } - WMesaSwapBuffers(); - return(TRUE); -} - -#endif /* WIN32 */ +/* $Id: wgl.c,v 1.9 2001/09/18 16:39:38 kschultz Exp $ */ + +/* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Library General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Library General Public License for more details. +* +* You should have received a copy of the GNU Library General Public +* License along with this library; if not, write to the Free +* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +* +*/ + +/* +* File name : wgl.c +* WGL stuff. Added by Oleg Letsinsky, ajl@ultersys.ru +* Some things originated from the 3Dfx WGL functions +*/ + +#ifdef WIN32 + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#define GL_GLEXT_PROTOTYPES +#include +#include +//#include + +#ifdef __cplusplus +} +#endif + +#include +#include +#include "wmesadef.h" +#include "GL/wmesa.h" +#include "mtypes.h" + +#define MAX_MESA_ATTRS 20 + +struct __extensions__ +{ + PROC proc; + char *name; +}; + +struct __pixelformat__ +{ + PIXELFORMATDESCRIPTOR pfd; + GLboolean doubleBuffered; +}; + +struct __extensions__ ext[] = { + +#ifdef GL_EXT_polygon_offset + { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" }, +#endif + { (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" }, + { (PROC)glColorTableEXT, "glColorTableEXT" }, + { (PROC)glColorSubTableEXT, "glColorSubTableEXT" }, + { (PROC)glGetColorTableEXT, "glGetColorTableEXT" }, + { (PROC)glGetColorTableParameterfvEXT, "glGetColorTableParameterfvEXT" }, + { (PROC)glGetColorTableParameterivEXT, "glGetColorTableParameterivEXT" }, + { (PROC)glPointParameterfEXT, "glPointParameterfEXT" }, + { (PROC)glPointParameterfvEXT, "glPointParameterfvEXT" }, + { (PROC)glBlendFuncSeparateEXT, "glBlendFuncSeparateEXT" }, + { (PROC)glLockArraysEXT, "glLockArraysEXT" }, + { (PROC)glUnlockArraysEXT, "glUnlockArraysEXT" } +}; + +int qt_ext = sizeof(ext) / sizeof(ext[0]); + +struct __pixelformat__ pix[] = +{ + { { sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_GENERIC_FORMAT|PFD_DOUBLEBUFFER|PFD_SWAP_COPY, + PFD_TYPE_RGBA, + 24, 8, 0, 8, 8, 8, 16, 8, 24, + 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 }, + GL_TRUE + }, + { { sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_GENERIC_FORMAT, + PFD_TYPE_RGBA, + 24, 8, 0, 8, 8, 8, 16, 8, 24, + 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 }, + GL_FALSE + }, +}; + +int qt_pix = sizeof(pix) / sizeof(pix[0]); + +typedef struct { + WMesaContext ctx; + HDC hdc; +} MesaWglCtx; + +#define MESAWGL_CTX_MAX_COUNT 20 + +static MesaWglCtx wgl_ctx[MESAWGL_CTX_MAX_COUNT]; + +static unsigned ctx_count = 0; +static unsigned ctx_current = -1; +static unsigned curPFD = 0; + +WGLAPI BOOL GLAPIENTRY wglCopyContext(HGLRC hglrcSrc,HGLRC hglrcDst,UINT mask) +{ + return(FALSE); +} + +WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC hdc) +{ + HWND hWnd; + int i = 0; + if(!(hWnd = WindowFromDC(hdc))) + { + SetLastError(0); + return(NULL); + } + if (!ctx_count) + { + for(i=0;ibmiHeader.biSize = sizeof(BITMAPINFOHEADER); + dibInfo->bmiHeader.biPlanes = 1; + dibInfo->bmiHeader.biBitCount = 1; + dibInfo->bmiHeader.biCompression = BI_RGB; + + bitDevice = CreateCompatibleDC(fontDevice); + // HDC bitDevice = CreateDC("DISPLAY", NULL, NULL, NULL); + // VERIFY(bitDevice); + + // Swap fore and back colors so the bitmap has the right polarity + tempColor = GetBkColor(bitDevice); + SetBkColor(bitDevice, GetTextColor(bitDevice)); + SetTextColor(bitDevice, tempColor); + + // Place chars based on base line + VERIFY(SetTextAlign(bitDevice, TA_BASELINE) >= 0 ? 1 : 0); + + for(i = 0; i < numChars; i++) { + SIZE size; + char curChar; + int charWidth,charHeight,bmapWidth,bmapHeight,numBytes,res; + HBITMAP bitObject; + HGDIOBJ origBmap; + unsigned char *bmap; + + curChar = i + firstChar; + + // Find how high/wide this character is + VERIFY(GetTextExtentPoint32(bitDevice, &curChar, 1, &size)); + + // Create the output bitmap + charWidth = size.cx; + charHeight = size.cy; + bmapWidth = ((charWidth + 31) / 32) * 32; // Round up to the next multiple of 32 bits + bmapHeight = charHeight; + bitObject = CreateCompatibleBitmap(bitDevice, + bmapWidth, + bmapHeight); + //VERIFY(bitObject); + + // Assign the output bitmap to the device + origBmap = SelectObject(bitDevice, bitObject); + VERIFY(origBmap); + + VERIFY( PatBlt( bitDevice, 0, 0, bmapWidth, bmapHeight,BLACKNESS ) ); + + // Use our source font on the device + VERIFY(SelectObject(bitDevice, GetCurrentObject(fontDevice,OBJ_FONT))); + + // Draw the character + VERIFY(TextOut(bitDevice, 0, metric.tmAscent, &curChar, 1)); + + // Unselect our bmap object + VERIFY(SelectObject(bitDevice, origBmap)); + + // Convert the display dependant representation to a 1 bit deep DIB + numBytes = (bmapWidth * bmapHeight) / 8; + bmap = malloc(numBytes); + dibInfo->bmiHeader.biWidth = bmapWidth; + dibInfo->bmiHeader.biHeight = bmapHeight; + res = GetDIBits(bitDevice, bitObject, 0, bmapHeight, bmap, + dibInfo, + DIB_RGB_COLORS); + //VERIFY(res); + + // Create the GL object + glNewList(i + listBase, GL_COMPILE); + glBitmap(bmapWidth, bmapHeight, 0.0, metric.tmDescent, + charWidth, 0.0, + bmap); + glEndList(); + // CheckGL(); + + // Destroy the bmap object + DeleteObject(bitObject); + + // Deallocate the bitmap data + free(bmap); + } + + // Destroy the DC + VERIFY(DeleteDC(bitDevice)); + + free(dibInfo); + + return TRUE; +#undef VERIFY +} + +WGLAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first, + DWORD count, DWORD listBase) +{ + int i; + GLuint font_list; + DWORD size; + GLYPHMETRICS gm; + HANDLE hBits; + LPSTR lpBits; + MAT2 mat; + int success = TRUE; + + if (first<0) + return FALSE; + if (count<0) + return FALSE; + if (listBase<0) + return FALSE; + + font_list = listBase; + + mat.eM11 = FixedFromDouble(1); + mat.eM12 = FixedFromDouble(0); + mat.eM21 = FixedFromDouble(0); + mat.eM22 = FixedFromDouble(-1); + + memset(&gm,0,sizeof(gm)); + + /* + ** If we can't get the glyph outline, it may be because this is a fixed + ** font. Try processing it that way. + */ + if( GetGlyphOutline(hdc, first, GGO_BITMAP, &gm, 0, NULL, &mat) + == GDI_ERROR ) + { + return wglUseFontBitmaps_FX( hdc, first, count, listBase ); + } + + /* + ** Otherwise process all desired characters. + */ + for (i = 0; i < count; i++) + { + DWORD err; + + glNewList( font_list+i, GL_COMPILE ); + + /* allocate space for the bitmap/outline */ + size = GetGlyphOutline(hdc, first + i, GGO_BITMAP, &gm, 0, NULL, &mat); + if (size == GDI_ERROR) + { + glEndList( ); + err = GetLastError(); + success = FALSE; + continue; + } + + hBits = GlobalAlloc(GHND, size+1); + lpBits = GlobalLock(hBits); + + err = + GetGlyphOutline(hdc, /* handle to device context */ + first + i, /* character to query */ + GGO_BITMAP, /* format of data to return */ + &gm, /* pointer to structure for metrics*/ + size, /* size of buffer for data */ + lpBits, /* pointer to buffer for data */ + &mat /* pointer to transformation */ + /* matrix structure */ + ); + + if (err == GDI_ERROR) + { + GlobalUnlock(hBits); + GlobalFree(hBits); + + glEndList( ); + err = GetLastError(); + success = FALSE; + continue; + } + + glBitmap(gm.gmBlackBoxX,gm.gmBlackBoxY, + -gm.gmptGlyphOrigin.x, + gm.gmptGlyphOrigin.y, + gm.gmCellIncX,gm.gmCellIncY, + (const GLubyte * )lpBits); + + GlobalUnlock(hBits); + GlobalFree(hBits); + + glEndList( ); + } + + return success; +} + + +WGLAPI BOOL GLAPIENTRY wglUseFontBitmapsW(HDC hdc,DWORD first,DWORD count,DWORD listBase) +{ + return FALSE; +} + +WGLAPI BOOL GLAPIENTRY wglUseFontOutlinesA(HDC hdc,DWORD first,DWORD count, + DWORD listBase,FLOAT deviation, + FLOAT extrusion,int format, + LPGLYPHMETRICSFLOAT lpgmf) +{ + SetLastError(0); + return(FALSE); +} + +WGLAPI BOOL GLAPIENTRY wglUseFontOutlinesW(HDC hdc,DWORD first,DWORD count, + DWORD listBase,FLOAT deviation, + FLOAT extrusion,int format, + LPGLYPHMETRICSFLOAT lpgmf) +{ + SetLastError(0); + return(FALSE); +} + +WGLAPI BOOL GLAPIENTRY wglDescribeLayerPlane(HDC hdc,int iPixelFormat, + int iLayerPlane,UINT nBytes, + LPLAYERPLANEDESCRIPTOR plpd) +{ + SetLastError(0); + return(FALSE); +} + +WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC hdc,int iLayerPlane, + int iStart,int cEntries, + CONST COLORREF *pcr) +{ + SetLastError(0); + return(0); +} + +WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC hdc,int iLayerPlane, + int iStart,int cEntries, + COLORREF *pcr) +{ + SetLastError(0); + return(0); +} + +WGLAPI BOOL GLAPIENTRY wglRealizeLayerPalette(HDC hdc,int iLayerPlane,BOOL bRealize) +{ + SetLastError(0); + return(FALSE); +} + +WGLAPI BOOL GLAPIENTRY wglSwapLayerBuffers(HDC hdc,UINT fuPlanes) +{ + if( !hdc ) + { + WMesaSwapBuffers(); + return(TRUE); + } + SetLastError(0); + return(FALSE); +} + +WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC hdc, + CONST PIXELFORMATDESCRIPTOR *ppfd) +{ + int i,best = -1,bestdelta = 0x7FFFFFFF,delta,qt_valid_pix; + + qt_valid_pix = qt_pix; + if(ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR) || ppfd->nVersion != 1) + { + SetLastError(0); + return(0); + } + for(i = 0;i < qt_valid_pix;i++) + { + delta = 0; + if( + (ppfd->dwFlags & PFD_DRAW_TO_WINDOW) && + !(pix[i].pfd.dwFlags & PFD_DRAW_TO_WINDOW)) + continue; + if( + (ppfd->dwFlags & PFD_DRAW_TO_BITMAP) && + !(pix[i].pfd.dwFlags & PFD_DRAW_TO_BITMAP)) + continue; + if( + (ppfd->dwFlags & PFD_SUPPORT_GDI) && + !(pix[i].pfd.dwFlags & PFD_SUPPORT_GDI)) + continue; + if( + (ppfd->dwFlags & PFD_SUPPORT_OPENGL) && + !(pix[i].pfd.dwFlags & PFD_SUPPORT_OPENGL)) + continue; + if( + !(ppfd->dwFlags & PFD_DOUBLEBUFFER_DONTCARE) && + ((ppfd->dwFlags & PFD_DOUBLEBUFFER) != (pix[i].pfd.dwFlags & PFD_DOUBLEBUFFER))) + continue; + if( + !(ppfd->dwFlags & PFD_STEREO_DONTCARE) && + ((ppfd->dwFlags & PFD_STEREO) != (pix[i].pfd.dwFlags & PFD_STEREO))) + continue; + if(ppfd->iPixelType != pix[i].pfd.iPixelType) + delta++; + if(delta < bestdelta) + { + best = i + 1; + bestdelta = delta; + if(bestdelta == 0) + break; + } + } + if(best == -1) + { + SetLastError(0); + return(0); + } + return(best); +} + +WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC hdc,int iPixelFormat,UINT nBytes, + LPPIXELFORMATDESCRIPTOR ppfd) +{ + int qt_valid_pix; + + qt_valid_pix = qt_pix; + if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix || nBytes != sizeof(PIXELFORMATDESCRIPTOR)) + { + SetLastError(0); + return(0); + } + *ppfd = pix[iPixelFormat - 1].pfd; + return(qt_valid_pix); +} + +/* +* GetProcAddress - return the address of an appropriate extension +*/ +WGLAPI PROC GLAPIENTRY wglGetProcAddress(LPCSTR lpszProc) +{ + int i; + for(i = 0;i < qt_ext;i++) + if(!strcmp(lpszProc,ext[i].name)) + return(ext[i].proc); + + SetLastError(0); + return(NULL); +} + +WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc) +{ + if(curPFD == 0) + { + SetLastError(0); + return(0); + } + return(curPFD); +} + +WGLAPI BOOL GLAPIENTRY wglSetPixelFormat(HDC hdc,int iPixelFormat, + PIXELFORMATDESCRIPTOR *ppfd) +{ + int qt_valid_pix; + + qt_valid_pix = qt_pix; + if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix || ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR)) + { + SetLastError(0); + return(FALSE); + } + curPFD = iPixelFormat; + return(TRUE); +} + +WGLAPI BOOL GLAPIENTRY wglSwapBuffers(HDC hdc) +{ + if (ctx_current < 0) + return FALSE; + + if(wgl_ctx[ctx_current].ctx == NULL) { + SetLastError(0); + return(FALSE); + } + WMesaSwapBuffers(); + return(TRUE); +} + +#endif /* WIN32 */ diff --git a/src/mesa/drivers/windows/wmesa.c b/src/mesa/drivers/windows/wmesa.c index 7eb13cab098..38174a2e9ff 100644 --- a/src/mesa/drivers/windows/wmesa.c +++ b/src/mesa/drivers/windows/wmesa.c @@ -1,2971 +1,2971 @@ -/* $Id: wmesa.c,v 1.18 2001/09/14 22:19:19 brianp Exp $ */ - -/* - * Windows (Win32) device driver for Mesa 3.4 - * - * Original author: - * - * Copyright (C) 1996- Li Wei - * Address : Institute of Artificial Intelligence - * : & Robotics - * : Xi'an Jiaotong University - * Email : liwei@aiar.xjtu.edu.cn - * Web page : http://sun.aiar.xjtu.edu.cn - * - * This file and its associations are partially borrowed from the - * Windows NT driver for Mesa 1.8 , written by Mark Leaming - * (mark@rsinc.com). - */ - - -#define WMESA_STEREO_C - -#include -#include -#include -#include -#include "mesa_extend.h" -#include "colors.h" -#include "macros.h" -#include "context.h" -#include "dd.h" -//#include "xform.h" -//#include "vb.h" -#include "matrix.h" -#include "depth.h" -#include "wmesadef.h" - -#pragma warning ( disable : 4100 4133 4761 ) - -#ifdef PROFILE -// #include "profile.h" -#endif - -#ifdef DITHER -#include -#endif - -#ifdef __CYGWIN32__ -#include "macros.h" -#include -#define CopyMemory memcpy -#endif - -#if !defined(NO_STEREO) - -#include "gl\glu.h" -#include "stereo.h" - -#endif -#if !defined(NO_PARALLEL) - #include "parallel.h" -#endif - -struct DISPLAY_OPTIONS displayOptions; - -GLenum stereoCompile = GL_FALSE ; -GLenum stereoShowing = GL_FALSE ; -GLenum stereoBuffer = GL_FALSE; -#if !defined(NO_STEREO) -GLint displayList = MAXIMUM_DISPLAY_LIST ; -#endif -GLint stereo_flag = 0 ; - -/* end of added code*/ - -static PWMC Current = NULL; -WMesaContext WC = NULL; - -#ifdef NDEBUG -#define assert(ignore) ((void) 0) -#else -void Mesa_Assert(void *Cond,void *File,unsigned Line) -{ - char Msg[512]; - sprintf(Msg,"%s %s %d",Cond,File,Line); - MessageBox(NULL,Msg,"Assertion failed.",MB_OK); - exit(1); -} -#define assert(e) if (!e) Mesa_Assert(#e,__FILE__,__LINE__); -#endif - -//#define DD_GETDC (Current->hDC ) -#define DD_GETDC ((Current->db_flag) ? Current->dib.hDC : Current->hDC ) -//#define DD_GETDC ((Current->db_flag) ? Current->hDCPrimary : Current->hDCBack ) -#define DD_RELEASEDC - -//#define BEGINGDICALL if(Current->rgb_flag)wmFlushBits(Current); -#define BEGINGDICALL -//#define ENDGDICALL if(Current->rgb_flag)wmGetBits(Current); -#define ENDGDICALL - -//#define FLIP(Y) (Current->dither_flag? Y : Current->height-(Y)-1) -//#define FLIP(Y) (Current->height-(Y)-1) -//#define FLIP(Y) Y -/* - * XXX Why only flip Y coord if single buffered??? - */ -#define FLIP(Y) (Current->db_flag? Y: Current->height-(Y)-1) -#define STARTPROFILE -#define ENDPROFILE(PARA) - -#define DITHER_RGB_TO_8BIT_SETUP \ -GLubyte pixelDithered; - -#define DITHER_RGB_TO_8BIT(red, green, blue, pixel, scanline) \ -{ \ - char unsigned redtemp, greentemp, bluetemp, paletteindex; \ - redtemp = aDividedBy51[red] \ - + (aModulo51[red] > aHalftone8x8[(pixel%8)*8 \ - + scanline%8]); \ - greentemp = aDividedBy51[(char unsigned)green] \ - + (aModulo51[green] > aHalftone8x8[ \ - (pixel%8)*8 + scanline%8]); \ - bluetemp = aDividedBy51[(char unsigned)blue] \ - + (aModulo51[blue] > aHalftone8x8[ \ - (pixel%8)*8 +scanline%8]); \ - paletteindex = redtemp + aTimes6[greentemp] + aTimes36[bluetemp]; \ - pixelDithered = aWinGHalftoneTranslation[paletteindex]; \ -} - - -#ifdef DDRAW -static BOOL DDInit( WMesaContext wc, HWND hwnd); -static void DDFree( WMesaContext wc); -static HRESULT DDRestoreAll( WMesaContext wc ); -static void DDDeleteOffScreen(WMesaContext wc); -static BOOL DDCreateOffScreen(WMesaContext wc); -#endif - -static void FlushToFile(PWMC pwc, PSTR szFile); - -BOOL wmCreateBackingStore(PWMC pwc, long lxSize, long lySize); -BOOL wmDeleteBackingStore(PWMC pwc); -void wmCreatePalette( PWMC pwdc ); -BOOL wmSetDibColors(PWMC pwc); -void wmSetPixel(PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b); - -void wmCreateDIBSection( - HDC hDC, - PWMC pwc, // handle of device context - CONST BITMAPINFO *pbmi, // address of structure containing bitmap size, format, and color data - UINT iUsage // color data type indicator: RGB values or palette indices - ); - - -void WMesaViewport( GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height ); - - -//static triangle_func choose_triangle_function( GLcontext *ctx ); - - -static void wmSetPixelFormat( PWMC wc, HDC hDC) -{ - if(wc->rgb_flag) - wc->cColorBits = GetDeviceCaps(hDC, BITSPIXEL); - else - wc->cColorBits = 8; - switch(wc->cColorBits){ - case 8: - if(wc->dither_flag != GL_TRUE) - wc->pixelformat = PF_INDEX8; - else - wc->pixelformat = PF_DITHER8; - break; - case 16: - wc->pixelformat = PF_5R6G5B; - break; - case 32: - wc->pixelformat = PF_8R8G8B; - break; - default: - wc->pixelformat = PF_BADFORMAT; - } -} - -// -// This function sets the color table of a DIB section -// to match that of the destination DC -// -BOOL /*WINAPI*/ wmSetDibColors(PWMC pwc) -{ - RGBQUAD *pColTab, *pRGB; - PALETTEENTRY *pPal, *pPE; - int i, nColors; - BOOL bRet=TRUE; - DWORD dwErr=0; - - /* Build a color table in the DIB that maps to the - selected palette in the DC. - */ - nColors = 1 << pwc->cColorBits; - pPal = (PALETTEENTRY *)malloc( nColors * sizeof(PALETTEENTRY)); - memset( pPal, 0, nColors * sizeof(PALETTEENTRY) ); - GetPaletteEntries( pwc->hGLPalette, 0, nColors, pPal ); - pColTab = (RGBQUAD *)malloc( nColors * sizeof(RGBQUAD)); - for (i = 0, pRGB = pColTab, pPE = pPal; i < nColors; i++, pRGB++, pPE++) { - pRGB->rgbRed = pPE->peRed; - pRGB->rgbGreen = pPE->peGreen; - pRGB->rgbBlue = pPE->peBlue; - } - if(pwc->db_flag) - bRet = SetDIBColorTable(pwc->dib.hDC, 0, nColors, pColTab ); - - if(!bRet) - dwErr = GetLastError(); - - free( pColTab ); - free( pPal ); - - return(bRet); -} - - -// -// Free up the dib section that was created -// -BOOL wmDeleteBackingStore(PWMC pwc) -{ - SelectObject(pwc->dib.hDC, pwc->hOldBitmap); - DeleteDC(pwc->dib.hDC); - DeleteObject(pwc->hbmDIB); - UnmapViewOfFile(pwc->dib.base); - CloseHandle(pwc->dib.hFileMap); - return TRUE; -} - - -// -// This function creates the DIB section that is used for combined -// GL and GDI calls -// -BOOL /*WINAPI*/ wmCreateBackingStore(PWMC pwc, long lxSize, long lySize) -{ - HDC hdc = pwc->hDC; - LPBITMAPINFO pbmi = &(pwc->bmi); - int iUsage; - - pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pbmi->bmiHeader.biWidth = lxSize; - pbmi->bmiHeader.biHeight= -lySize; - pbmi->bmiHeader.biPlanes = 1; - if(pwc->rgb_flag) - pbmi->bmiHeader.biBitCount = GetDeviceCaps(pwc->hDC, BITSPIXEL); - else - pbmi->bmiHeader.biBitCount = 8; - pbmi->bmiHeader.biCompression = BI_RGB; - pbmi->bmiHeader.biSizeImage = 0; - pbmi->bmiHeader.biXPelsPerMeter = 0; - pbmi->bmiHeader.biYPelsPerMeter = 0; - pbmi->bmiHeader.biClrUsed = 0; - pbmi->bmiHeader.biClrImportant = 0; - - iUsage = (pbmi->bmiHeader.biBitCount <= 8) ? DIB_PAL_COLORS : DIB_RGB_COLORS; - - pwc->cColorBits = pbmi->bmiHeader.biBitCount; - pwc->ScanWidth = pwc->pitch = lxSize; - - wmCreateDIBSection(hdc, pwc, pbmi, iUsage); - - if ((iUsage == DIB_PAL_COLORS) && !(pwc->hGLPalette)) { - wmCreatePalette( pwc ); - wmSetDibColors( pwc ); - } - wmSetPixelFormat(pwc, pwc->hDC); - return(TRUE); - -} - - -// -// This function copies one scan line in a DIB section to another -// -BOOL WINAPI wmSetDIBits(PWMC pwc, UINT uiScanWidth, UINT uiNumScans, UINT nBypp, UINT uiNewWidth, LPBYTE pBits) -{ - UINT uiScans = 0; - LPBYTE pDest = pwc->pbPixels; - DWORD dwNextScan = uiScanWidth; - DWORD dwNewScan = uiNewWidth; - DWORD dwScanWidth = (uiScanWidth * nBypp); - - // - // We need to round up to the nearest DWORD - // and multiply by the number of bytes per - // pixel - // - dwNextScan = (((dwNextScan * nBypp)+ 3) & ~3); - dwNewScan = (((dwNewScan * nBypp)+ 3) & ~3); - - for(uiScans = 0; uiScans < uiNumScans; uiScans++){ - CopyMemory(pDest, pBits, dwScanWidth); - pBits += dwNextScan; - pDest += dwNewScan; - } - - return(TRUE); - -} - - -BOOL wmFlush(PWMC pwc); - -/* -* Useful macros: -Modified from file osmesa.c -*/ - - -#define PIXELADDR(X,Y) ((GLubyte *)Current->pbPixels + (Current->height-Y-1)* Current->ScanWidth + (X)*nBypp) -#define PIXELADDR1( X, Y ) \ -((GLubyte *)wmesa->pbPixels + (wmesa->height-Y-1)* wmesa->ScanWidth + (X)) -#define PIXELADDR2( X, Y ) \ -((GLubyte *)wmesa->pbPixels + (wmesa->height-Y-1)* wmesa->ScanWidth + (X)*2) -#define PIXELADDR4( X, Y ) \ -((GLubyte *)wmesa->pbPixels + (wmesa->height-Y-1)* wmesa->ScanWidth + (X)*4) - - -BYTE DITHER_RGB_2_8BIT( int r, int g, int b, int x, int y); - -/* Finish all pending operations and synchronize. */ -static void finish(GLcontext* ctx) -{ - /* No op */ -} - - -// -// We cache all gl draw routines until a flush is made -// -static void flush(GLcontext* ctx) -{ - STARTPROFILE - if((Current->rgb_flag /*&& !(Current->dib.fFlushed)*/&&!(Current->db_flag)) - ||(!Current->rgb_flag)) - { - wmFlush(Current); - } - ENDPROFILE(flush) - -} - - - -/* -* Set the color index used to clear the color buffer. -*/ -static void clear_index(GLcontext* ctx, GLuint index) -{ - STARTPROFILE - Current->clearpixel = index; - ENDPROFILE(clear_index) -} - - - -/* -* Set the color used to clear the color buffer. -*/ -static void clear_color( GLcontext* ctx, const GLchan color[4] ) -{ - STARTPROFILE - Current->clearpixel = RGB(color[0], color[1], color[2]); - ENDPROFILE(clear_color) -} - - - -/* -* Clear the specified region of the color buffer using the clear color -* or index as specified by one of the two functions above. -*/ -//static void clear(GLcontext* ctx, -// GLboolean all,GLint x, GLint y, GLint width, GLint height ) -// TODO: I modified this function to match the prototype in -// dd.h. (swansma@geocities.com) - -static GLbitfield clear(GLcontext* ctx, GLbitfield mask, - GLboolean all, GLint x, GLint y, GLint width, GLint height) -{ - DWORD dwColor; - WORD wColor; - BYTE bColor; - LPDWORD lpdw = (LPDWORD)Current->pbPixels; - LPWORD lpw = (LPWORD)Current->pbPixels; - LPBYTE lpb = Current->pbPixels; - int lines; - - STARTPROFILE - - if (all){ - x=y=0; - width=Current->width; - height=Current->height; - } - if(Current->db_flag==GL_TRUE){ - UINT nBypp = Current->cColorBits / 8; - int i = 0; - int iSize = 0; - - if(nBypp ==1 ){ - /* Need rectification */ - iSize = Current->width/4; - bColor = BGR8(GetRValue(Current->clearpixel), - GetGValue(Current->clearpixel), - GetBValue(Current->clearpixel)); - wColor = MAKEWORD(bColor,bColor); - dwColor = MAKELONG(wColor, wColor); - } - if(nBypp == 2){ - iSize = Current->width / 2; - wColor = BGR16(GetRValue(Current->clearpixel), - GetGValue(Current->clearpixel), - GetBValue(Current->clearpixel)); - dwColor = MAKELONG(wColor, wColor); - } - else if(nBypp == 4){ - iSize = Current->width; - dwColor = BGR32(GetRValue(Current->clearpixel), - GetGValue(Current->clearpixel), - GetBValue(Current->clearpixel)); - } - - while(i < iSize){ - *lpdw = dwColor; - lpdw++; - i++; - } - - // - // This is the 24bit case - // - if (nBypp == 3) { - iSize = Current->width *3/4; - dwColor = BGR24(GetRValue(Current->clearpixel), - GetGValue(Current->clearpixel), - GetBValue(Current->clearpixel)); - while(i < iSize){ - *lpdw = dwColor; - lpb += nBypp; - lpdw = (LPDWORD)lpb; - i++; - } - } - - i = 0; - if (stereo_flag) - lines = height /2; - else - lines = height; - do { - memcpy(lpb, Current->pbPixels, iSize*4); - lpb += Current->ScanWidth; - i++; - } - while (iclearpixel); - HBRUSH Brush=CreateSolidBrush(Current->clearpixel); - HPEN Old_Pen=SelectObject(DC,Pen); - HBRUSH Old_Brush=SelectObject(DC,Brush); - Rectangle(DC,x,y,x+width,y+height); - SelectObject(DC,Old_Pen); - SelectObject(DC,Old_Brush); - DeleteObject(Pen); - DeleteObject(Brush); - DD_RELEASEDC; - } - - - - ENDPROFILE(clear) - - return mask; // TODO: I doubt this is correct. dd.h doesn't explain what this should - // be... -} - - - -static void enable( GLcontext* ctx, GLenum pname, GLboolean enable ) -{ - if (!Current) - return; - - if (pname == GL_DITHER) { - if(enable == GL_FALSE){ - Current->dither_flag = GL_FALSE; - if(Current->cColorBits == 8) - Current->pixelformat = PF_INDEX8; - } - else{ - if (Current->rgb_flag && Current->cColorBits == 8){ - Current->pixelformat = PF_DITHER8; - Current->dither_flag = GL_TRUE; - } - else - Current->dither_flag = GL_FALSE; - } - } -} - - - -static GLboolean set_draw_buffer( GLcontext* ctx, GLenum mode ) -{ - STARTPROFILE - /* TODO: this could be better */ - if (mode==GL_FRONT_LEFT || mode==GL_BACK_LEFT) { - return GL_TRUE; - } - else { - return GL_FALSE; - } - ENDPROFILE(set_draw_buffer) -} - - -static void set_read_buffer(GLcontext *ctx, GLframebuffer *colorBuffer, - GLenum buffer ) -{ - /* XXX todo */ - return; -} - - - -/* Return characteristics of the output buffer. */ -static void buffer_size( GLcontext* ctx, GLuint *width, GLuint *height ) -{ - int New_Size; - RECT CR; - - STARTPROFILE - GetClientRect(Current->Window,&CR); - - *width=CR.right; - *height=CR.bottom; - - New_Size=((*width)!=Current->width) || ((*height)!=Current->height); - - if (New_Size){ - Current->width=*width; - Current->height=*height; - Current->ScanWidth=Current->width; - if ((Current->ScanWidth%sizeof(long))!=0) - Current->ScanWidth+=(sizeof(long)-(Current->ScanWidth%sizeof(long))); - - if (Current->db_flag){ -#ifdef DDRAW - DDDeleteOffScreen(Current); - DDCreateOffScreen(Current); -#else - if (Current->rgb_flag==GL_TRUE && Current->dither_flag!=GL_TRUE){ - wmDeleteBackingStore(Current); - wmCreateBackingStore(Current, Current->width, Current->height); - } -#endif - } - - // Resize OsmesaBuffer if in Parallel mode -#if !defined(NO_PARALLEL) - if(parallelFlag) - PRSizeRenderBuffer(Current->width, Current->height,Current->ScanWidth, - Current->rgb_flag == GL_TRUE ? Current->pbPixels: Current->ScreenMem); -#endif - } - ENDPROFILE(buffer_size) -} - - - -/**********************************************************************/ -/***** Accelerated point, line, polygon rendering *****/ -/**********************************************************************/ - - -static void fast_rgb_points( GLcontext* ctx, GLuint first, GLuint last ) -{ -#if 0 - GLuint i; - // HDC DC=DD_GETDC; - PWMC pwc = Current; - - STARTPROFILE - - if (0 /*Current->gl_ctx->VB->MonoColor*/) { - /* all drawn with current color */ - for (i=first;i<=last;i++) { - if (!Current->gl_ctx->VB->ClipMask[i]) { - int x, y; - x = (GLint) Current->gl_ctx->VB->Win.data[i][0]; - y = FLIP( (GLint) Current->gl_ctx->VB->Win.data[i][1] ); - wmSetPixel(pwc, y,x,GetRValue(Current->pixel), - GetGValue(Current->pixel), GetBValue(Current->pixel)); - } - } - } - else { - /* draw points of different colors */ - for (i=first;i<=last;i++) { - if (!Current->gl_ctx->VB->ClipMask[i]) { - int x, y; - unsigned long pixel=RGB(Current->gl_ctx->VB->ColorPtr->data[i][0]*255.0, - Current->gl_ctx->VB->ColorPtr->data[i][1]*255.0, - Current->gl_ctx->VB->ColorPtr->data[i][2]*255.0); - x = (GLint) Current->gl_ctx->VB->Win.data[i][0]; - y = FLIP( (GLint) Current->gl_ctx->VB->Win.data[i][1] ); - wmSetPixel(pwc, y,x,Current->gl_ctx->VB->ColorPtr->data[i][0]*255.0, - Current->gl_ctx->VB->ColorPtr->data[i][1]*255.0, - Current->gl_ctx->VB->ColorPtr->data[i][2]*255.0); - } - } - } - // DD_RELEASEDC; - ENDPROFILE(fast_rgb_points) -#endif -} - - - -/* Return pointer to accerated points function */ -extern /*points_func*/ choose_points_function( GLcontext* ctx ) -{ -#if 0 - STARTPROFILE - if (ctx->Point.Size==1.0 && !ctx->Point.SmoothFlag && ctx->_RasterMask==0 - && !ctx->Texture._ReallyEnabled && ctx->Visual->RGBAflag) { - ENDPROFILE(choose_points_function) - return fast_rgb_points; - } - else { - ENDPROFILE(choose_points_function) - return NULL; - } -#endif -} - - - -/* Draw a line using the color specified by Current->gl_ctx->VB->ColorPtr->data[pv] */ -static void fast_flat_rgb_line( GLcontext* ctx, GLuint v0, GLuint v1, GLuint pv ) -{ -#if 0 - STARTPROFILE - int x0, y0, x1, y1; - unsigned long pixel; - HDC DC=DD_GETDC; - HPEN Pen; - HPEN Old_Pen; - - if (0 /*Current->gl_ctx->VB->MonoColor*/) { - pixel = Current->pixel; /* use current color */ - } - else { - pixel = RGB(Current->gl_ctx->VB->ColorPtr->data[pv][0]*255.0, Current->gl_ctx->VB->ColorPtr->data[pv][1]*255.0, Current->gl_ctx->VB->ColorPtr->data[pv][2]*255.0); - } - - x0 = (int) Current->gl_ctx->VB->Win.data[v0][0]; - y0 = FLIP( (int) Current->gl_ctx->VB->Win.data[v0][1] ); - x1 = (int) Current->gl_ctx->VB->Win.data[v1][0]; - y1 = FLIP( (int) Current->gl_ctx->VB->Win.data[v1][1] ); - - - BEGINGDICALL - - Pen=CreatePen(PS_SOLID,1,pixel); - Old_Pen=SelectObject(DC,Pen); - MoveToEx(DC,x0,y0,NULL); - LineTo(DC,x1,y1); - SelectObject(DC,Old_Pen); - DeleteObject(Pen); - DD_RELEASEDC; - - ENDGDICALL - - ENDPROFILE(fast_flat_rgb_line) -#endif -} - - - -/* Return pointer to accerated line function */ -static /*line_func*/ choose_line_function( GLcontext* ctx ) -{ -#if 0 - STARTPROFILE - if (ctx->Line.Width==1.0 && !ctx->Line.SmoothFlag && !ctx->Line.StippleFlag - && ctx->Light.ShadeModel==GL_FLAT && ctx->_RasterMask==0 - && !ctx->Texture._ReallyEnabled && Current->rgb_flag) { - ENDPROFILE(choose_line_function) - return fast_flat_rgb_line; - } - else { - ENDPROFILE(choose_line_function) - return NULL; - } -#endif -} - - -/**********************************************************************/ -/***** Span-based pixel drawing *****/ -/**********************************************************************/ - - -/* Write a horizontal span of 32-bit color-index pixels with a boolean mask. */ -static void write_ci32_span( const GLcontext* ctx, - GLuint n, GLint x, GLint y, - const GLuint index[], - const GLubyte mask[] ) -{ - STARTPROFILE - GLuint i; - PBYTE Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x; - assert(Current->rgb_flag==GL_FALSE); - for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; - assert(Current->rgb_flag==GL_FALSE); - for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; - assert(Current->rgb_flag==GL_FALSE); - for (i=0; irgb_flag==GL_TRUE) - { - GLuint i; - HDC DC=DD_GETDC; - y=FLIP(y); - if (mask) { - for (i=0; iScreenMem+y*Current->ScanWidth+x; - y = FLIP(y); - if (mask) { - for (i=0; ihPal,RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP])); - } - else { - for (i=0; ihPal,RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP])); - } - } - ENDPROFILE(write_rgba_span) - -} - -/* Write a horizontal span of RGB color pixels with a boolean mask. */ -static void write_rgb_span( const GLcontext* ctx, - GLuint n, GLint x, GLint y, - const GLubyte rgb[][3], const GLubyte mask[] ) -{ - STARTPROFILE - PWMC pwc = Current; - - if (pwc->rgb_flag==GL_TRUE) - { - GLuint i; - HDC DC=DD_GETDC; - y=FLIP(y); - if (mask) { - for (i=0; iScreenMem+y*Current->ScanWidth+x; - y = FLIP(y); - if (mask) { - for (i=0; ihPal,RGB(rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP])); - } - else { - for (i=0; ihPal,RGB(rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP])); - } - } - ENDPROFILE(write_rgb_span) - -} - -/* -* Write a horizontal span of pixels with a boolean mask. The current color -* is used for all pixels. -*/ -static void write_mono_rgba_span( const GLcontext* ctx, - GLuint n, GLint x, GLint y, - const GLchan color[4], const GLubyte mask[]) -{ - ULONG pixel = RGB( color[RCOMP], color[GCOMP], color[BCOMP] ); - STARTPROFILE - GLuint i; - HDC DC=DD_GETDC; - PWMC pwc = Current; - assert(Current->rgb_flag==GL_TRUE); - y=FLIP(y); - if(Current->rgb_flag==GL_TRUE){ - for (i=0; irgb_flag==GL_FALSE); - for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]; - *Mem = index[i]; - } - } - ENDPROFILE(write_ci32_pixels) -} - - - -/* -* Write an array of pixels with a boolean mask. The current color -* index is used for all pixels. -*/ -static void write_mono_ci_pixels( const GLcontext* ctx, - GLuint n, - const GLint x[], const GLint y[], - GLuint colorIndex, const GLubyte mask[] ) -{ - STARTPROFILE - GLuint i; - assert(Current->rgb_flag==GL_FALSE); - for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]; - *Mem = colorIndex; - } - } - ENDPROFILE(write_mono_ci_pixels) -} - - - -/* Write an array of RGBA pixels with a boolean mask. */ -static void write_rgba_pixels( const GLcontext* ctx, - GLuint n, const GLint x[], const GLint y[], - const GLubyte rgba[][4], const GLubyte mask[] ) -{ - STARTPROFILE - GLuint i; - PWMC pwc = Current; - HDC DC=DD_GETDC; - assert(Current->rgb_flag==GL_TRUE); - for (i=0; irgb_flag==GL_TRUE); - for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; - assert(Current->rgb_flag==GL_FALSE); - for (i=0; irgb_flag==GL_FALSE); - for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]); - } - } - ENDPROFILE(read_ci32_pixels) -} - - - -/* Read a horizontal span of color pixels. */ -static void read_rgba_span( const GLcontext* ctx, - GLuint n, GLint x, GLint y, - GLubyte rgba[][4] ) -{ - STARTPROFILE - UINT i; - COLORREF Color; - HDC DC=DD_GETDC; - assert(Current->rgb_flag==GL_TRUE); - /* y=FLIP(y);*/ - y = Current->height - y - 1; - for (i=0; irgb_flag==GL_TRUE); - for (i=0; iheight - y[i] - 1; - Color=GetPixel(DC,x[i],y2); - rgba[i][RCOMP] = GetRValue(Color); - rgba[i][GCOMP] = GetGValue(Color); - rgba[i][BCOMP] = GetBValue(Color); - rgba[i][ACOMP] = 255; - } - } - DD_RELEASEDC; -// Brian P. has mentioned to comment this out. -// memset(alpha,0,n*sizeof(GLint)); - ENDPROFILE(read_rgba_pixels) -} - - - -/**********************************************************************/ -/**********************************************************************/ - - -static const GLubyte *get_string(GLcontext *ctx, GLenum name) -{ - if (name == GL_RENDERER) { - return (GLubyte *) "Mesa Windows"; - } - else { - return NULL; - } -} - - - -void setup_DD_pointers( GLcontext* ctx ) -{ -#if 0 - ctx->Driver.GetString = get_string; - ctx->Driver.UpdateState = setup_DD_pointers; - ctx->Driver.GetBufferSize = buffer_size; - ctx->Driver.Finish = finish; - ctx->Driver.Flush = flush; - - ctx->Driver.ClearIndex = clear_index; - ctx->Driver.ClearColor = clear_color; - ctx->Driver.Clear = clear; - - ctx->Driver.Enable = enable; - - ctx->Driver.SetDrawBuffer = set_draw_buffer; - ctx->Driver.SetReadBuffer = set_read_buffer; - ctx->Driver.GetBufferSize = buffer_size; - - ctx->Driver.PointsFunc = choose_points_function(ctx); - ctx->Driver.LineFunc = choose_line_function(ctx); - ctx->Driver.TriangleFunc = choose_triangle_function( ctx ); - - /* Pixel/span writing functions: */ - ctx->Driver.WriteRGBASpan = write_rgba_span; - ctx->Driver.WriteRGBSpan = write_rgb_span; - ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span; - ctx->Driver.WriteRGBAPixels = write_rgba_pixels; - ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels; - ctx->Driver.WriteCI32Span = write_ci32_span; - ctx->Driver.WriteCI8Span = write_ci8_span; - ctx->Driver.WriteMonoCISpan = write_mono_ci_span; - ctx->Driver.WriteCI32Pixels = write_ci32_pixels; - ctx->Driver.WriteMonoCIPixels = write_mono_ci_pixels; - - ctx->Driver.ReadCI32Span = read_ci32_span; - ctx->Driver.ReadRGBASpan = read_rgba_span; - ctx->Driver.ReadCI32Pixels = read_ci32_pixels; - ctx->Driver.ReadRGBAPixels = read_rgba_pixels; -#endif -} - - -/**********************************************************************/ -/***** WMesa API Functions *****/ -/**********************************************************************/ - - - -#define PAL_SIZE 256 -static void GetPalette(HPALETTE Pal,RGBQUAD *aRGB) -{ - STARTPROFILE - int i; - HDC hdc; - struct - { - WORD Version; - WORD NumberOfEntries; - PALETTEENTRY aEntries[PAL_SIZE]; - } Palette = - { - 0x300, - PAL_SIZE - }; - hdc=GetDC(NULL); - if (Pal!=NULL) - GetPaletteEntries(Pal,0,PAL_SIZE,Palette.aEntries); - else - GetSystemPaletteEntries(hdc,0,PAL_SIZE,Palette.aEntries); - if (GetSystemPaletteUse(hdc) == SYSPAL_NOSTATIC) - { - for(i = 0; i Window=hWnd; - c->hDC = GetDC(hWnd); - true_color_flag = GetDeviceCaps(c->hDC, BITSPIXEL) > 8; -#ifdef DDRAW - if(true_color_flag) c->rgb_flag = rgb_flag = GL_TRUE; -#endif - - -#ifdef DITHER - if ((true_color_flag==GL_FALSE) && (rgb_flag == GL_TRUE)){ - c->dither_flag = GL_TRUE; - c->hPalHalfTone = WinGCreateHalftonePalette(); - } - else - c->dither_flag = GL_FALSE; -#else - c->dither_flag = GL_FALSE; -#endif - - - if (rgb_flag==GL_FALSE) - { - c->rgb_flag = GL_FALSE; - // c->pixel = 1; - c->db_flag = db_flag =GL_TRUE; // WinG requires double buffering - printf("Single buffer is not supported in color index mode, setting to double buffer.\n"); - } - else - { - c->rgb_flag = GL_TRUE; - // c->pixel = 0; - } - GetClientRect(c->Window,&CR); - c->width=CR.right; - c->height=CR.bottom; - if (db_flag) - { - c->db_flag = 1; - /* Double buffered */ -#ifndef DDRAW - // if (c->rgb_flag==GL_TRUE && c->dither_flag != GL_TRUE ) - { - wmCreateBackingStore(c, c->width, c->height); - - } -#endif - } - else - { - /* Single Buffered */ - if (c->rgb_flag) - c->db_flag = 0; - } -#ifdef DDRAW - if (DDInit(c,hWnd) == GL_FALSE) { - free( (void *) c ); - exit(1); - } -#endif - - - c->gl_visual = _mesa_create_visual(rgb_flag, - db_flag, /* db_flag */ - GL_FALSE, /* stereo */ - 8,8,8,8, /* r, g, b, a bits */ - 0, /* index bits */ - 16, /* depth_bits */ - 8, /* stencil_bits */ - 16,16,16,16,/* accum_bits */ - 1); - - if (!c->gl_visual) { - return NULL; - } - - /* allocate a new Mesa context */ - c->gl_ctx = _mesa_create_context( c->gl_visual, NULL, c, GL_TRUE); - - if (!c->gl_ctx) { - _mesa_destroy_visual( c->gl_visual ); - free(c); - return NULL; - } - - _mesa_enable_sw_extensions(c->gl_ctx); -#if 0 - c->gl_buffer = _mesa_create_framebuffer( c->gl_visual, - c->gl_visual->DepthBits > 0, - c->gl_visual->StencilBits > 0, - c->gl_visual->AccumRedBits > 0, - c->gl_visual->AlphaBits > 0 ); -#endif - c->gl_buffer = NULL; /* TEMP */ - if (!c->gl_buffer) { - _mesa_destroy_visual( c->gl_visual ); - _mesa_destroy_context( c->gl_ctx ); - free(c); - return NULL; - } - - c->gl_ctx->Driver.UpdateState = setup_DD_pointers; - - // setup_DD_pointers(c->gl_ctx); - - return c; -} - -void WMesaDestroyContext( void ) -{ - WMesaContext c = Current; - ReleaseDC(c->Window,c->hDC); - WC = c; - if(c->hPalHalfTone != NULL) - DeleteObject(c->hPalHalfTone); - _mesa_destroy_visual( c->gl_visual ); - _mesa_destroy_framebuffer( c->gl_buffer ); - _mesa_destroy_context( c->gl_ctx ); - - if (c->db_flag) -#ifdef DDRAW - DDFree(c); -#else - wmDeleteBackingStore(c); -#endif - free( (void *) c ); - //Following code is added to enable parallel render - // Parallel render only work in double buffer mode -#if !defined(NO_PARALLEL) - if(parallelMachine) - PRDestroyRenderBuffer(); -#endif - // End modification -} - - - -void /*APIENTRY*/ WMesaMakeCurrent( WMesaContext c ) -{ - if(!c){ - Current = c; - return; - } - - // - // A little optimization - // If it already is current, - // don't set it again - // - if(Current == c) - return; - - //gl_set_context( c->gl_ctx ); - _mesa_make_current(c->gl_ctx, c->gl_buffer); - setup_DD_pointers(c->gl_ctx); - Current = c; - if (Current->gl_ctx->Viewport.Width==0) { - /* initialize viewport to window size */ - _mesa_set_viewport( Current->gl_ctx, - 0, 0, Current->width, Current->height ); - } - if ((c->cColorBits <= 8 ) && (c->rgb_flag == GL_TRUE)){ - WMesaPaletteChange(c->hPalHalfTone); - } -} - - - -void /*APIENTRY*/ WMesaSwapBuffers( void ) -{ - HDC DC = Current->hDC; - GET_CURRENT_CONTEXT(ctx); - - /* If we're swapping the buffer associated with the current context - * we have to flush any pending rendering commands first. - */ - if (Current && Current->gl_ctx == ctx) - _mesa_swapbuffers(ctx); - - if (Current->db_flag) - wmFlush(Current); -} - - - -void /*APIENTRY*/ WMesaPaletteChange(HPALETTE Pal) -{ - int vRet; - LPPALETTEENTRY pPal; - if (Current && (Current->rgb_flag==GL_FALSE || Current->dither_flag == GL_TRUE)) - { - pPal = (PALETTEENTRY *)malloc( 256 * sizeof(PALETTEENTRY)); - Current->hPal=Pal; - // GetPaletteEntries( Pal, 0, 256, pPal ); - GetPalette( Pal, pPal ); -#ifdef DDRAW - Current->lpDD->lpVtbl->CreatePalette(Current->lpDD,DDPCAPS_8BIT, - pPal, &(Current->lpDDPal), NULL); - if (Current->lpDDPal) - Current->lpDDSPrimary->lpVtbl->SetPalette(Current->lpDDSPrimary,Current->lpDDPal); -#else - vRet = SetDIBColorTable(Current->dib.hDC,0,256,pPal); -#endif - free( pPal ); - } - -} - - - - -static unsigned char threeto8[8] = { - 0, 0111>>1, 0222>>1, 0333>>1, 0444>>1, 0555>>1, 0666>>1, 0377 -}; - -static unsigned char twoto8[4] = { - 0, 0x55, 0xaa, 0xff -}; - -static unsigned char oneto8[2] = { - 0, 255 -}; - -static unsigned char componentFromIndex(UCHAR i, UINT nbits, UINT shift) -{ - unsigned char val; - - val = i >> shift; - switch (nbits) { - - case 1: - val &= 0x1; - return oneto8[val]; - - case 2: - val &= 0x3; - return twoto8[val]; - - case 3: - val &= 0x7; - return threeto8[val]; - - default: - return 0; - } -} - -void /*WINAPI*/ wmCreatePalette( PWMC pwdc ) -{ - /* Create a compressed and re-expanded 3:3:2 palette */ - int i; - LOGPALETTE *pPal; - BYTE rb, rs, gb, gs, bb, bs; - - pwdc->nColors = 0x100; - - pPal = (PLOGPALETTE)malloc(sizeof(LOGPALETTE) + pwdc->nColors * sizeof(PALETTEENTRY)); - memset( pPal, 0, sizeof(LOGPALETTE) + pwdc->nColors * sizeof(PALETTEENTRY) ); - - pPal->palVersion = 0x300; - - rb = REDBITS; - rs = REDSHIFT; - gb = GREENBITS; - gs = GREENSHIFT; - bb = BLUEBITS; - bs = BLUESHIFT; - - if (pwdc->db_flag) { - - /* Need to make two palettes: one for the screen DC and one for the DIB. */ - pPal->palNumEntries = pwdc->nColors; - for (i = 0; i < pwdc->nColors; i++) { - pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs ); - pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs ); - pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs ); - pPal->palPalEntry[i].peFlags = 0; - } - pwdc->hGLPalette = CreatePalette( pPal ); - pwdc->hPalette = CreatePalette( pPal ); - } - - else { - pPal->palNumEntries = pwdc->nColors; - for (i = 0; i < pwdc->nColors; i++) { - pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs ); - pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs ); - pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs ); - pPal->palPalEntry[i].peFlags = 0; - } - pwdc->hGLPalette = CreatePalette( pPal ); - } - - free(pPal); - -} - -void /*WINAPI*/ wmSetPixel(PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b) -{ - if (Current->db_flag) { - LPBYTE lpb = pwc->pbPixels; - LPDWORD lpdw; - LPWORD lpw; - UINT nBypp = pwc->cColorBits >> 3; - UINT nOffset = iPixel % nBypp; - - // Move the pixel buffer pointer to the scanline that we - // want to access - - // pwc->dib.fFlushed = FALSE; - - lpb += pwc->ScanWidth * iScanLine; - // Now move to the desired pixel - lpb += iPixel * nBypp; - lpb = PIXELADDR(iPixel, iScanLine); - lpdw = (LPDWORD)lpb; - lpw = (LPWORD)lpb; - - if(nBypp == 1){ - if(pwc->dither_flag) - *lpb = DITHER_RGB_2_8BIT(r,g,b,iScanLine,iPixel); - else - *lpb = BGR8(r,g,b); - } - else if(nBypp == 2) - *lpw = BGR16(r,g,b); - else if (nBypp == 3){ - *lpdw = BGR24(r,g,b); - } - else if (nBypp == 4) - *lpdw = BGR32(r,g,b); - } - else{ - SetPixel(Current->hDC, iPixel, iScanLine, RGB(r,g,b)); - DD_RELEASEDC; - } -} - -void /*WINAPI*/ wmCreateDIBSection( - HDC hDC, - PWMC pwc, // handle of device context - CONST BITMAPINFO *pbmi, // address of structure containing bitmap size, format, and color data - UINT iUsage // color data type indicator: RGB values or palette indices - ) -{ - DWORD dwSize = 0; - DWORD dwScanWidth; - UINT nBypp = pwc->cColorBits / 8; - HDC hic; - - dwScanWidth = (((pwc->ScanWidth * nBypp)+ 3) & ~3); - - pwc->ScanWidth =pwc->pitch = dwScanWidth; - - if (stereo_flag) - pwc->ScanWidth = 2* pwc->pitch; - - dwSize = sizeof(BITMAPINFO) + (dwScanWidth * pwc->height); - - pwc->dib.hFileMap = CreateFileMapping((HANDLE)PAGE_FILE, - NULL, - PAGE_READWRITE | SEC_COMMIT, - 0, - dwSize, - NULL); - - if (!pwc->dib.hFileMap) - return; - - pwc->dib.base = MapViewOfFile(pwc->dib.hFileMap, - FILE_MAP_ALL_ACCESS, - 0, - 0, - 0); - - if(!pwc->dib.base){ - CloseHandle(pwc->dib.hFileMap); - return; - } - - // pwc->pbPixels = pwc->addrOffScreen = ((LPBYTE)pwc->dib.base) + sizeof(BITMAPINFO); - - // pwc->dib.hDC = CreateCompatibleDC(hDC); - - CopyMemory(pwc->dib.base, pbmi, sizeof(BITMAPINFO)); - - hic = CreateIC("display", NULL, NULL, NULL); - pwc->dib.hDC = CreateCompatibleDC(hic); - - - /* pwc->hbmDIB = CreateDIBitmap(hic, - &(pwc->bmi.bmiHeader), - CBM_INIT, - pwc->pbPixels, - &(pwc->bmi), - DIB_RGB_COLORS); - */ - pwc->hbmDIB = CreateDIBSection(hic, - &(pwc->bmi), - (iUsage ? DIB_PAL_COLORS : DIB_RGB_COLORS), - &(pwc->pbPixels), - pwc->dib.hFileMap, - 0); - /* - pwc->hbmDIB = CreateDIBSection(hic, - &(pwc->bmi), - DIB_RGB_COLORS, - &(pwc->pbPixels), - pwc->dib.hFileMap, - 0); - */ - pwc->ScreenMem = pwc->addrOffScreen = pwc->pbPixels; - pwc->hOldBitmap = SelectObject(pwc->dib.hDC, pwc->hbmDIB); - - DeleteDC(hic); - - return; - -} - -// -// Blit memory DC to screen DC -// -BOOL /*WINAPI*/ wmFlush(PWMC pwc) -{ - BOOL bRet = 0; - DWORD dwErr = 0; -#ifdef DDRAW - HRESULT ddrval; -#endif - - // Now search through the torus frames and mark used colors - if(pwc->db_flag){ -#ifdef DDRAW - if (pwc->lpDDSOffScreen == NULL) - if(DDCreateOffScreen(pwc) == GL_FALSE) - return; - - pwc->lpDDSOffScreen->lpVtbl->Unlock(pwc->lpDDSOffScreen, NULL); - - while( 1 ) - { - ddrval = pwc->lpDDSPrimary->lpVtbl->Blt( pwc->lpDDSPrimary, - &(pwc->rectSurface), pwc->lpDDSOffScreen, &(pwc->rectOffScreen), 0, NULL ); - - if( ddrval == DD_OK ) - { - break; - } - if( ddrval == DDERR_SURFACELOST ) - { - if(!DDRestoreAll(pwc)) - { - break; - } - } - if( ddrval != DDERR_WASSTILLDRAWING ) - { - break; - } - } - - while (pwc->lpDDSOffScreen->lpVtbl->Lock(pwc->lpDDSOffScreen, - NULL, &(pwc->ddsd), 0, NULL) == DDERR_WASSTILLDRAWING) - ; - - if(ddrval != DD_OK) - dwErr = GetLastError(); -#else - bRet = BitBlt(pwc->hDC, 0, 0, pwc->width, pwc->height, - pwc->dib.hDC, 0, 0, SRCCOPY); -#endif - } - - return(TRUE); - -} - - -// The following code is added by Li Wei to enable stereo display - -#if !defined(NO_STEREO) - -void WMesaShowStereo(GLuint list) -{ - - GLbitfield mask = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT; - GLfloat cm[16]; - GLint matrix_mode; - // Must use double Buffer - if( ! Current-> db_flag ) - return; - - - glGetIntegerv(GL_MATRIX_MODE,&matrix_mode); - - // glPushMatrix(); //**** - WMesaViewport(Current->gl_ctx,0,Current->height/2,Current->width,Current->height/2); - // Current->gl_ctx->NewState = 0; - - // glViewport(0,0,Current->width,Current->height/2); - if(matrix_mode!=GL_MODELVIEW) - glMatrixMode(GL_MODELVIEW); - - glGetFloatv(GL_MODELVIEW_MATRIX,cm); - glLoadIdentity(); - gluLookAt(viewDistance/2,0.0,0.0 , - viewDistance/2,0.0,-1.0, - 0.0,1.0,0.0 ); - // glTranslatef(viewDistance/2.0,0.,0.); - glMultMatrixf( cm ); - - Current->ScreenMem = Current->pbPixels = Current->addrOffScreen; - //glPushMatrix(); - glCallList( list ); - //glPopMatrix(); - - glGetFloatv(GL_MODELVIEW_MATRIX,cm); - glLoadIdentity(); - gluLookAt(-viewDistance/2,0.0,0.0 , - -viewDistance/2,0.0,-1.0, - 0.0,1.0,0.0 ); - // glTranslatef(-viewDistance/2.0,0.,0.); - glMultMatrixf(cm); - - Current->ScreenMem = Current->pbPixels = Current->addrOffScreen + Current->pitch; - glCallList(list); - if(matrix_mode!=GL_MODELVIEW) - glMatrixMode(matrix_mode); - - // glPopMatrix(); - glFlush(); - - WMesaViewport(Current->gl_ctx,0,0,Current->width,Current->height); - // Current->gl_ctx->NewState = 0; - WMesaSwapBuffers(); - -} - -void toggleStereoMode() -{ - if(!Current->db_flag) - return; - if(!stereo_flag){ - stereo_flag = 1; - if(stereoBuffer==GL_FALSE) -#if !defined(NO_PARALLEL) - if(!parallelFlag) -#endif - { - Current->ScanWidth = Current->pitch*2; - } - } - else { - stereo_flag = 0; -#if !defined(NO_PARALLEL) - if(!parallelFlag) -#endif - Current->ScanWidth = Current->pitch; - Current->pbPixels = Current->addrOffScreen; - } -} - -/* if in stereo mode, the following function is called */ -void glShowStereo(GLuint list) -{ - WMesaShowStereo(list); -} - -#endif // End if NO_STEREO not defined - -#if !defined(NO_PARALLEL) - -void toggleParallelMode(void) -{ - if(!parallelFlag){ - parallelFlag = GL_TRUE; - if(parallelMachine==GL_FALSE){ - PRCreateRenderBuffer( Current->rgb_flag? GL_RGBA :GL_COLOR_INDEX, - Current->cColorBits/8, - Current->width ,Current->height, - Current->ScanWidth, - Current->rgb_flag? Current->pbPixels: Current->ScreenMem); - parallelMachine = GL_TRUE; - } - } - else { - parallelFlag = GL_FALSE; - if(parallelMachine==GL_TRUE){ - PRDestroyRenderBuffer(); - parallelMachine=GL_FALSE; - ReadyForNextFrame = GL_TRUE; - } - - /*********************************************** - // Seems something wrong!!!! - ************************************************/ - - WMesaMakeCurrent(Current); -#if !defined(NO_STEREO) - stereo_flag = GL_FALSE ; -#endif - } -} - -void PRShowRenderResult(void) -{ - int flag = 0; - if(!glImageRendered()) - return; - - if (parallelFlag) - { - WMesaSwapBuffers(); - } - -} -#endif //End if NO_PARALLEL not defined - -//end modification - -BYTE DITHER_RGB_2_8BIT( int red, int green, int blue, int pixel, int scanline) -{ - char unsigned redtemp, greentemp, bluetemp, paletteindex; - - //*** now, look up each value in the halftone matrix - //*** using an 8x8 ordered dither. - redtemp = aDividedBy51[red] - + (aModulo51[red] > aHalftone8x8[(pixel%8)*8 - + scanline%8]); - greentemp = aDividedBy51[(char unsigned)green] - + (aModulo51[green] > aHalftone8x8[ - (pixel%8)*8 + scanline%8]); - bluetemp = aDividedBy51[(char unsigned)blue] - + (aModulo51[blue] > aHalftone8x8[ - (pixel%8)*8 +scanline%8]); - - //*** recombine the halftoned rgb values into a palette index - paletteindex = - redtemp + aTimes6[greentemp] + aTimes36[bluetemp]; - - //*** and translate through the wing halftone palette - //*** translation vector to give the correct value. - return aWinGHalftoneTranslation[paletteindex]; -} - -#ifdef DDRAW -/* -* restoreAll -* -* restore all lost objects -*/ -HRESULT DDRestoreAll( WMesaContext wc ) -{ - HRESULT ddrval; - - ddrval = wc->lpDDSPrimary->lpVtbl->Restore(wc->lpDDSPrimary); - if( ddrval == DD_OK ) - { - ddrval = wc->lpDDSOffScreen->lpVtbl->Restore(wc->lpDDSOffScreen); - } - return ddrval; - -} /* restoreAll */ - - - /* - * This function is called if the initialization function fails -*/ -BOOL initFail( HWND hwnd, WMesaContext wc ) -{ - DDFree(wc); - MessageBox( hwnd, "DirectDraw Init FAILED", "", MB_OK ); - return FALSE; - -} /* initFail */ - - -static void DDDeleteOffScreen(WMesaContext wc) -{ - if( wc->lpDDSOffScreen != NULL ) - { - wc->lpDDSOffScreen->lpVtbl->Unlock(wc->lpDDSOffScreen,NULL); - wc->lpDDSOffScreen->lpVtbl->Release(wc->lpDDSOffScreen); - wc->lpDDSOffScreen = NULL; - } - -} - -static void DDFreePrimarySurface(WMesaContext wc) -{ - if( wc->lpDDSPrimary != NULL ) - { - if(wc->db_flag == GL_FALSE) - wc->lpDDSPrimary->lpVtbl->ReleaseDC(wc->lpDDSPrimary, wc->hDC); - wc->lpDDSPrimary->lpVtbl->Release(wc->lpDDSPrimary); - wc->lpDDSPrimary = NULL; - } -} - -static BOOL DDCreatePrimarySurface(WMesaContext wc) -{ - HRESULT ddrval; - DDSCAPS ddscaps; - wc->ddsd.dwSize = sizeof( wc->ddsd ); - wc->ddsd.dwFlags = DDSD_CAPS; - wc->ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - - ddrval = wc->lpDD->lpVtbl->CreateSurface( wc->lpDD,&(wc->ddsd), &(wc->lpDDSPrimary), NULL ); - if( ddrval != DD_OK ) - { - return initFail(wc->hwnd , wc); - } - if(wc->db_flag == GL_FALSE) - wc->lpDDSPrimary->lpVtbl->GetDC(wc->lpDDSPrimary, wc->hDC); - return TRUE; -} - -static BOOL DDCreateOffScreen(WMesaContext wc) -{ - POINT pt; - HRESULT ddrval; - if(wc->lpDD == NULL) - return FALSE; - GetClientRect( wc->hwnd, &(wc->rectOffScreen) ); - wc->ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; - wc->ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; - wc->ddsd.dwHeight = wc->rectOffScreen.bottom - wc->rectOffScreen.top; - wc->ddsd.dwWidth = wc->rectOffScreen.right - wc->rectOffScreen.left; - - ddrval = wc->lpDD->lpVtbl->CreateSurface( wc->lpDD, &(wc->ddsd), &(wc->lpDDSOffScreen), NULL ); - if( ddrval != DD_OK ) - { - return FALSE; - } - - while (wc->lpDDSOffScreen->lpVtbl->Lock(wc->lpDDSOffScreen,NULL, &(wc->ddsd), 0, NULL) == DDERR_WASSTILLDRAWING) - ; - // while ((ddrval = wc->lpDDSOffScreen->lpVtbl->Lock(wc->lpDDSOffScreen,NULL, &(wc->ddsd), DDLOCK_SURFACEMEMORYPTR , NULL)) != DD_OK) - ; - if(wc->ddsd.lpSurface==NULL) - return initFail(wc->hwnd, wc); - - wc->ScreenMem = wc->pbPixels = wc->addrOffScreen = (PBYTE)(wc->ddsd.lpSurface); - wc->ScanWidth = wc->pitch = wc->ddsd.lPitch; - if (stereo_flag) - wc->ScanWidth = wc->ddsd.lPitch*2; - - GetClientRect( wc->hwnd, &(wc->rectSurface) ); - pt.x = pt.y = 0; - ClientToScreen( wc->hwnd, &pt ); - OffsetRect(&(wc->rectSurface), pt.x, pt.y); - wmSetPixelFormat(wc, wc->hDC); - return TRUE; -} - -/* -* doInit - do work required for every instance of the application: -* create the window, initialize data -*/ -static BOOL DDInit( WMesaContext wc, HWND hwnd) -{ - HRESULT ddrval; - DWORD dwFrequency; - - LPDIRECTDRAW lpDD; // DirectDraw object - LPDIRECTDRAW2 lpDD2; - - - wc->fullScreen = displayOptions.fullScreen; - wc->gMode = displayOptions.mode; - wc->hwnd = hwnd; - stereo_flag = displayOptions.stereo; - if(wc->db_flag!= GL_TRUE) - stereo_flag = GL_FALSE; - /* - * create the main DirectDraw object - */ - ddrval = DirectDrawCreate( NULL, &(wc->lpDD), NULL ); - if( ddrval != DD_OK ) - { - return initFail(hwnd,wc); - } - - // Get exclusive mode if requested - if(wc->fullScreen) - { - ddrval = wc->lpDD->lpVtbl->SetCooperativeLevel( wc->lpDD, hwnd, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN ); - } - else - { - ddrval = wc->lpDD->lpVtbl->SetCooperativeLevel( wc->lpDD, hwnd, DDSCL_NORMAL ); - } - if( ddrval != DD_OK ) - { - return initFail(hwnd , wc); - } - - - /* ddrval = wc->lpDD->lpVtbl->QueryInterface(wc->lpDD, IID_IDirectDraw2, - (LPVOID *)((wc->lpDD2))); - - */ - if(ddrval != DD_OK) - return initFail(hwnd , wc); - - - //ddrval = wc->lpDD->lpVtbl->GetDisplayMode( wc->lpDD, &(wc->ddsd)); - // wc->lpDD2->lpVtbl->GetMonitorFrequency(wc->lpDD, &dwFrequency); - switch( wc->gMode ) - { - case 1: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 640, 480, displayOptions.bpp); break; - case 2: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 800, 600, displayOptions.bpp); break; - case 3: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 1024, 768, displayOptions.bpp); break; - case 4: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 1152, 864, displayOptions.bpp); break; - case 5: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 1280, 1024, displayOptions.bpp); break; - } - - if( ddrval != DD_OK ) - { - printf("Can't modify display mode, current mode used\n"); - // return initFail(hwnd , wc); - } - //ddrval = wc->lpDD->lpVtbl->GetDisplayMode( wc->lpDD, &(wc->ddsd)); - switch(ddrval){ - case DDERR_INVALIDOBJECT: - break; - case DDERR_INVALIDPARAMS: - break; - case DDERR_UNSUPPORTEDMODE: - ; - } - - if(DDCreatePrimarySurface(wc) == GL_FALSE) - return initFail(hwnd, wc); - - if(wc->db_flag) - return DDCreateOffScreen(wc); -} /* DDInit */ - -static void DDFree( WMesaContext wc) -{ - if( wc->lpDD != NULL ) - { - DDFreePrimarySurface(wc); - DDDeleteOffScreen(wc); - wc->lpDD->lpVtbl->Release(wc->lpDD); - wc->lpDD = NULL; - } - // Clean up the screen on exit - RedrawWindow( NULL, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | - RDW_ALLCHILDREN ); - -} -#endif - -void WMesaMove(void) -{ - WMesaContext wc = Current; - POINT pt; - if (Current != NULL){ - GetClientRect( wc->hwnd, &(wc->rectSurface) ); - pt.x = pt.y = 0; - ClientToScreen( wc->hwnd, &pt ); - OffsetRect(&(wc->rectSurface), pt.x, pt.y); - } -} - - - -/* -* Like PACK_8A8B8G8R() but don't use alpha. This is usually an acceptable -* shortcut. -*/ -#define PACK_8B8G8R( R, G, B ) ( ((B) << 16) | ((G) << 8) | (R) ) - - -/**********************************************************************/ -/*** Triangle rendering ***/ -/**********************************************************************/ - -/* - * XImage, smooth, depth-buffered, PF_8A8B8G8R triangle. - */ -static void smooth_8A8B8G8R_z_triangle( GLcontext *ctx, - GLuint v0, GLuint v1, GLuint v2, - GLuint pv ) -{ - WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; -#define INTERP_Z 1 -#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) -#define PIXEL_TYPE GLuint - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; -#define INTERP_Z 1 -#define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) -#define PIXEL_TYPE GLuint - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; -#define INTERP_Z 1 -#define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y) -#define PIXEL_TYPE GLushort - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; -#define INTERP_Z 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) -#define PIXEL_TYPE GLuint - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define SETUP_CODE \ - unsigned long p = PACK_8B8G8R( VB->ColorPtr->data[pv][0], \ - VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; -#define INTERP_Z 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) -#define PIXEL_TYPE GLuint - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define SETUP_CODE \ - unsigned long p = PACK_8R8G8B( VB->ColorPtr->data[pv][0], \ - VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; -#define INTERP_Z 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y) -#define PIXEL_TYPE GLushort - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define SETUP_CODE \ - unsigned long p = PACK_5R6G5B( VB->ColorPtr->data[pv][0], \ - VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; -#define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) -#define PIXEL_TYPE GLuint - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx; \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxDriverCtx; -#define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) -#define PIXEL_TYPE GLuint - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx; \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxDriverCtx; -#define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y) -#define PIXEL_TYPE GLushort - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx; \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxDriverCtx; -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) -#define PIXEL_TYPE GLuint - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define SETUP_CODE \ - unsigned long p = PACK_8B8G8R( VB->ColorPtr->data[pv][0], \ - VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx; \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxDriverCtx; -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) -#define PIXEL_TYPE GLuint - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define SETUP_CODE \ - unsigned long p = PACK_8R8G8B( VB->ColorPtr->data[pv][0], \ - VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx; \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxDriverCtx; -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y) -#define PIXEL_TYPE GLushort - //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define SETUP_CODE \ - unsigned long p = PACK_5R6G5B( VB->ColorPtr->data[pv][0], \ - VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx; \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxDriverCtx; -#define INTERP_Z 1 -#define INTERP_INDEX 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) -#define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; -#define INTERP_Z 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) -#define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define SETUP_CODE \ - GLuint index = VB->IndexPtr->data[pv]; \ - (*ctx->Driver.Index)( ctx, index ); -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; -#define INTERP_Z 1 -#define INTERP_INDEX 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) -#define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx; \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxDriverCtx; -#define INTERP_Z 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) -#define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define SETUP_CODE \ - GLuint index = VB->IndexPtr->data[pv]; \ - (*ctx->Driver.Index)( ctx, index ); -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx; \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxDriverCtx; - DITHER_RGB_TO_8BIT_SETUP -#define INTERP_Z 1 -#define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) -#define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, xx = LEFT, yy = FLIP(Y), len = RIGHT-LEFT; \ - for (i=0;iDriverCtx; - DITHER_RGB_TO_8BIT_SETUP -#define INTERP_Z 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) -#define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (wmesa->ScanWidth) - -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint i, xx = LEFT, yy = FLIP(Y), len = RIGHT-LEFT; \ - for (i=0;iColorPtr->data[pv][0], \ - VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2], xx, yy); \ - pRow[i] = pixelDithered; \ - zRow[i] = z; \ - } \ - ffz += fdzdx; \ - } \ - } -#ifdef __MINGW32__ - #include "tritemp.h" -#else - - #ifdef WIN32 -// #include "..\tritemp.h" - #else - #include "tritemp.h" - #endif -#endif -} - -/* -* XImage, smooth, NON-depth-buffered, 8-bit PF_DITHER triangle. -*/ -static void smooth_DITHER8_triangle( GLcontext *ctx, GLuint v0, GLuint v1, - GLuint v2, GLuint pv ) -{ - WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; - DITHER_RGB_TO_8BIT_SETUP -#define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) -#define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (wmesa->ScanWidth) -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx, yy = FLIP(Y); \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxColorPtr->data[pv][0], VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2], xx, yy);\ - *pixel = pixelDithered; \ - ffr += fdrdx; ffg += fdgdx; ffb += fdbdx; \ - } \ - } -#ifdef __MINGW32__ - #include "tritemp.h" -#else - - #ifdef WIN32 -// #include "..\tritemp.h" - #else - #include "tritemp.h" - #endif -#endif -} - -/* -* XImage, flat, NON-depth-buffered, 8-bit PF_DITHER triangle. -*/ - -static void flat_DITHER8_triangle( GLcontext *ctx, GLuint v0, GLuint v1, - GLuint v2, GLuint pv ) -{ - WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; - DITHER_RGB_TO_8BIT_SETUP -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) -#define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (wmesa->ScanWidth) - -#define INNER_LOOP( LEFT, RIGHT, Y ) \ - { \ - GLint xx, yy = FLIP(Y); \ - PIXEL_TYPE *pixel = pRow; \ - for (xx=LEFT;xxColorPtr->data[pv][0], \ - VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2], xx, yy); \ - *pixel = pixelDithered; \ - } \ - } -#ifdef __MINGW32__ - #include "tritemp.h" -#else - - #ifdef WIN32 -// #include "..\tritemp.h" - #else - #include "tritemp.h" - #endif -#endif -} - - - - -static /*triangle_func*/ choose_triangle_function( GLcontext *ctx ) -{ -#if 0 - WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; - int depth = wmesa->cColorBits; - - if (ctx->Polygon.SmoothFlag) return NULL; - if (ctx->Texture._ReallyEnabled) return NULL; - if (!wmesa->db_flag) return NULL; - /*if (wmesa->xm_buffer->buffer==XIMAGE)*/ { - if ( ctx->Light.ShadeModel==GL_SMOOTH - && ctx->_RasterMask==DEPTH_BIT - && ctx->Depth.Func==GL_LESS - && ctx->Depth.Mask==GL_TRUE - && ctx->Polygon.StippleFlag==GL_FALSE) { - switch (wmesa->pixelformat) { - case PF_8A8B8G8R: - return smooth_8A8B8G8R_z_triangle; - case PF_8R8G8B: - return smooth_8R8G8B_z_triangle; - case PF_5R6G5B: - return smooth_5R6G5B_z_triangle; - case PF_DITHER8: - return smooth_DITHER8_z_triangle; - case PF_INDEX8: - return smooth_ci_z_triangle; - default: - return NULL; - } - } - if ( ctx->Light.ShadeModel==GL_FLAT - && ctx->_RasterMask==DEPTH_BIT - && ctx->Depth.Func==GL_LESS - && ctx->Depth.Mask==GL_TRUE - && ctx->Polygon.StippleFlag==GL_FALSE) { - switch (wmesa->pixelformat) { - case PF_8A8B8G8R: - return flat_8A8B8G8R_z_triangle; - case PF_8R8G8B: - return flat_8R8G8B_z_triangle; - case PF_5R6G5B: - return flat_5R6G5B_z_triangle; - case PF_DITHER8: - return flat_DITHER8_z_triangle; - case PF_INDEX8: - return flat_ci_z_triangle; - default: - return NULL; - } - } - if ( ctx->_RasterMask==0 /* no depth test */ - && ctx->Light.ShadeModel==GL_SMOOTH - && ctx->Polygon.StippleFlag==GL_FALSE) { - switch (wmesa->pixelformat) { - case PF_8A8B8G8R: - return smooth_8A8B8G8R_triangle; - case PF_8R8G8B: - return smooth_8R8G8B_triangle; - case PF_5R6G5B: - return smooth_5R6G5B_triangle; - case PF_DITHER8: - return smooth_DITHER8_triangle; - case PF_INDEX8: - return smooth_ci_triangle; - default: - return NULL; - } - } - - if ( ctx->_RasterMask==0 /* no depth test */ - && ctx->Light.ShadeModel==GL_FLAT - && ctx->Polygon.StippleFlag==GL_FALSE) { - switch (wmesa->pixelformat) { - case PF_8A8B8G8R: - return flat_8A8B8G8R_triangle; - case PF_8R8G8B: - return flat_8R8G8B_triangle; - case PF_5R6G5B: - return flat_5R6G5B_triangle; - case PF_DITHER8: - return flat_DITHER8_triangle; - case PF_INDEX8: - return flat_ci_triangle; - default: - return NULL; - } - } - - return NULL; - } -#endif -} - -/* -* Define a new viewport and reallocate auxillary buffers if the size of -* the window (color buffer) has changed. -*/ -void WMesaViewport( GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height ) -{ -#if 0 - /* Save viewport */ - ctx->Viewport.X = x; - ctx->Viewport.Width = width; - ctx->Viewport.Y = y; - ctx->Viewport.Height = height; - - /* compute scale and bias values */ -/* Pre-Keith 3.1 changes - ctx->Viewport.Map.m[Sx] = (GLfloat) width / 2.0F; - ctx->Viewport.Map.m[Tx] = ctx->Viewport.Sx + x; - ctx->Viewport.Map.m[Sy] = (GLfloat) height / 2.0F; - ctx->Viewport.Map.m[Ty] = ctx->Viewport.Sy + y; -*/ - ctx->Viewport.WindowMap.m[MAT_SX] = (GLfloat) width / 2.0F; - ctx->Viewport.WindowMap.m[MAT_TX] = ctx->Viewport.WindowMap.m[MAT_SX] + x; - ctx->Viewport.WindowMap.m[MAT_SY] = (GLfloat) height / 2.0F; - ctx->Viewport.WindowMap.m[MAT_TY] = ctx->Viewport.WindowMap.m[MAT_SY] + y; -#endif -} +/* $Id: wmesa.c,v 1.19 2001/09/18 16:39:38 kschultz Exp $ */ + +/* + * Windows (Win32) device driver for Mesa 3.4 + * + * Original author: + * + * Copyright (C) 1996- Li Wei + * Address : Institute of Artificial Intelligence + * : & Robotics + * : Xi'an Jiaotong University + * Email : liwei@aiar.xjtu.edu.cn + * Web page : http://sun.aiar.xjtu.edu.cn + * + * This file and its associations are partially borrowed from the + * Windows NT driver for Mesa 1.8 , written by Mark Leaming + * (mark@rsinc.com). + */ + + +#define WMESA_STEREO_C + +#include +#include +#include +#include +#include "mesa_extend.h" +#include "colors.h" +#include "macros.h" +#include "context.h" +#include "dd.h" +//#include "xform.h" +//#include "vb.h" +#include "matrix.h" +#include "depth.h" +#include "wmesadef.h" + +#pragma warning ( disable : 4100 4133 4761 ) + +#ifdef PROFILE +// #include "profile.h" +#endif + +#ifdef DITHER +#include +#endif + +#ifdef __CYGWIN32__ +#include "macros.h" +#include +#define CopyMemory memcpy +#endif + +#if !defined(NO_STEREO) + +#include "gl\glu.h" +#include "stereo.h" + +#endif +#if !defined(NO_PARALLEL) + #include "parallel.h" +#endif + +struct DISPLAY_OPTIONS displayOptions; + +GLenum stereoCompile = GL_FALSE ; +GLenum stereoShowing = GL_FALSE ; +GLenum stereoBuffer = GL_FALSE; +#if !defined(NO_STEREO) +GLint displayList = MAXIMUM_DISPLAY_LIST ; +#endif +GLint stereo_flag = 0 ; + +/* end of added code*/ + +static PWMC Current = NULL; +WMesaContext WC = NULL; + +#ifdef NDEBUG +#define assert(ignore) ((void) 0) +#else +void Mesa_Assert(void *Cond,void *File,unsigned Line) +{ + char Msg[512]; + sprintf(Msg,"%s %s %d",Cond,File,Line); + MessageBox(NULL,Msg,"Assertion failed.",MB_OK); + exit(1); +} +#define assert(e) if (!e) Mesa_Assert(#e,__FILE__,__LINE__); +#endif + +//#define DD_GETDC (Current->hDC ) +#define DD_GETDC ((Current->db_flag) ? Current->dib.hDC : Current->hDC ) +//#define DD_GETDC ((Current->db_flag) ? Current->hDCPrimary : Current->hDCBack ) +#define DD_RELEASEDC + +//#define BEGINGDICALL if(Current->rgb_flag)wmFlushBits(Current); +#define BEGINGDICALL +//#define ENDGDICALL if(Current->rgb_flag)wmGetBits(Current); +#define ENDGDICALL + +//#define FLIP(Y) (Current->dither_flag? Y : Current->height-(Y)-1) +//#define FLIP(Y) (Current->height-(Y)-1) +//#define FLIP(Y) Y +/* + * XXX Why only flip Y coord if single buffered??? + */ +#define FLIP(Y) (Current->db_flag? Y: Current->height-(Y)-1) +#define STARTPROFILE +#define ENDPROFILE(PARA) + +#define DITHER_RGB_TO_8BIT_SETUP \ +GLubyte pixelDithered; + +#define DITHER_RGB_TO_8BIT(red, green, blue, pixel, scanline) \ +{ \ + char unsigned redtemp, greentemp, bluetemp, paletteindex; \ + redtemp = aDividedBy51[red] \ + + (aModulo51[red] > aHalftone8x8[(pixel%8)*8 \ + + scanline%8]); \ + greentemp = aDividedBy51[(char unsigned)green] \ + + (aModulo51[green] > aHalftone8x8[ \ + (pixel%8)*8 + scanline%8]); \ + bluetemp = aDividedBy51[(char unsigned)blue] \ + + (aModulo51[blue] > aHalftone8x8[ \ + (pixel%8)*8 +scanline%8]); \ + paletteindex = redtemp + aTimes6[greentemp] + aTimes36[bluetemp]; \ + pixelDithered = aWinGHalftoneTranslation[paletteindex]; \ +} + + +#ifdef DDRAW +static BOOL DDInit( WMesaContext wc, HWND hwnd); +static void DDFree( WMesaContext wc); +static HRESULT DDRestoreAll( WMesaContext wc ); +static void DDDeleteOffScreen(WMesaContext wc); +static BOOL DDCreateOffScreen(WMesaContext wc); +#endif + +static void FlushToFile(PWMC pwc, PSTR szFile); + +BOOL wmCreateBackingStore(PWMC pwc, long lxSize, long lySize); +BOOL wmDeleteBackingStore(PWMC pwc); +void wmCreatePalette( PWMC pwdc ); +BOOL wmSetDibColors(PWMC pwc); +void wmSetPixel(PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b); + +void wmCreateDIBSection( + HDC hDC, + PWMC pwc, // handle of device context + CONST BITMAPINFO *pbmi, // address of structure containing bitmap size, format, and color data + UINT iUsage // color data type indicator: RGB values or palette indices + ); + + +void WMesaViewport( GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height ); + + +//static triangle_func choose_triangle_function( GLcontext *ctx ); + + +static void wmSetPixelFormat( PWMC wc, HDC hDC) +{ + if(wc->rgb_flag) + wc->cColorBits = GetDeviceCaps(hDC, BITSPIXEL); + else + wc->cColorBits = 8; + switch(wc->cColorBits){ + case 8: + if(wc->dither_flag != GL_TRUE) + wc->pixelformat = PF_INDEX8; + else + wc->pixelformat = PF_DITHER8; + break; + case 16: + wc->pixelformat = PF_5R6G5B; + break; + case 32: + wc->pixelformat = PF_8R8G8B; + break; + default: + wc->pixelformat = PF_BADFORMAT; + } +} + +// +// This function sets the color table of a DIB section +// to match that of the destination DC +// +BOOL /*WINAPI*/ wmSetDibColors(PWMC pwc) +{ + RGBQUAD *pColTab, *pRGB; + PALETTEENTRY *pPal, *pPE; + int i, nColors; + BOOL bRet=TRUE; + DWORD dwErr=0; + + /* Build a color table in the DIB that maps to the + selected palette in the DC. + */ + nColors = 1 << pwc->cColorBits; + pPal = (PALETTEENTRY *)malloc( nColors * sizeof(PALETTEENTRY)); + memset( pPal, 0, nColors * sizeof(PALETTEENTRY) ); + GetPaletteEntries( pwc->hGLPalette, 0, nColors, pPal ); + pColTab = (RGBQUAD *)malloc( nColors * sizeof(RGBQUAD)); + for (i = 0, pRGB = pColTab, pPE = pPal; i < nColors; i++, pRGB++, pPE++) { + pRGB->rgbRed = pPE->peRed; + pRGB->rgbGreen = pPE->peGreen; + pRGB->rgbBlue = pPE->peBlue; + } + if(pwc->db_flag) + bRet = SetDIBColorTable(pwc->dib.hDC, 0, nColors, pColTab ); + + if(!bRet) + dwErr = GetLastError(); + + free( pColTab ); + free( pPal ); + + return(bRet); +} + + +// +// Free up the dib section that was created +// +BOOL wmDeleteBackingStore(PWMC pwc) +{ + SelectObject(pwc->dib.hDC, pwc->hOldBitmap); + DeleteDC(pwc->dib.hDC); + DeleteObject(pwc->hbmDIB); + UnmapViewOfFile(pwc->dib.base); + CloseHandle(pwc->dib.hFileMap); + return TRUE; +} + + +// +// This function creates the DIB section that is used for combined +// GL and GDI calls +// +BOOL /*WINAPI*/ wmCreateBackingStore(PWMC pwc, long lxSize, long lySize) +{ + HDC hdc = pwc->hDC; + LPBITMAPINFO pbmi = &(pwc->bmi); + int iUsage; + + pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbmi->bmiHeader.biWidth = lxSize; + pbmi->bmiHeader.biHeight= -lySize; + pbmi->bmiHeader.biPlanes = 1; + if(pwc->rgb_flag) + pbmi->bmiHeader.biBitCount = GetDeviceCaps(pwc->hDC, BITSPIXEL); + else + pbmi->bmiHeader.biBitCount = 8; + pbmi->bmiHeader.biCompression = BI_RGB; + pbmi->bmiHeader.biSizeImage = 0; + pbmi->bmiHeader.biXPelsPerMeter = 0; + pbmi->bmiHeader.biYPelsPerMeter = 0; + pbmi->bmiHeader.biClrUsed = 0; + pbmi->bmiHeader.biClrImportant = 0; + + iUsage = (pbmi->bmiHeader.biBitCount <= 8) ? DIB_PAL_COLORS : DIB_RGB_COLORS; + + pwc->cColorBits = pbmi->bmiHeader.biBitCount; + pwc->ScanWidth = pwc->pitch = lxSize; + + wmCreateDIBSection(hdc, pwc, pbmi, iUsage); + + if ((iUsage == DIB_PAL_COLORS) && !(pwc->hGLPalette)) { + wmCreatePalette( pwc ); + wmSetDibColors( pwc ); + } + wmSetPixelFormat(pwc, pwc->hDC); + return(TRUE); + +} + + +// +// This function copies one scan line in a DIB section to another +// +BOOL WINAPI wmSetDIBits(PWMC pwc, UINT uiScanWidth, UINT uiNumScans, UINT nBypp, UINT uiNewWidth, LPBYTE pBits) +{ + UINT uiScans = 0; + LPBYTE pDest = pwc->pbPixels; + DWORD dwNextScan = uiScanWidth; + DWORD dwNewScan = uiNewWidth; + DWORD dwScanWidth = (uiScanWidth * nBypp); + + // + // We need to round up to the nearest DWORD + // and multiply by the number of bytes per + // pixel + // + dwNextScan = (((dwNextScan * nBypp)+ 3) & ~3); + dwNewScan = (((dwNewScan * nBypp)+ 3) & ~3); + + for(uiScans = 0; uiScans < uiNumScans; uiScans++){ + CopyMemory(pDest, pBits, dwScanWidth); + pBits += dwNextScan; + pDest += dwNewScan; + } + + return(TRUE); + +} + + +BOOL wmFlush(PWMC pwc); + +/* +* Useful macros: +Modified from file osmesa.c +*/ + + +#define PIXELADDR(X,Y) ((GLubyte *)Current->pbPixels + (Current->height-Y-1)* Current->ScanWidth + (X)*nBypp) +#define PIXELADDR1( X, Y ) \ +((GLubyte *)wmesa->pbPixels + (wmesa->height-Y-1)* wmesa->ScanWidth + (X)) +#define PIXELADDR2( X, Y ) \ +((GLubyte *)wmesa->pbPixels + (wmesa->height-Y-1)* wmesa->ScanWidth + (X)*2) +#define PIXELADDR4( X, Y ) \ +((GLubyte *)wmesa->pbPixels + (wmesa->height-Y-1)* wmesa->ScanWidth + (X)*4) + + +BYTE DITHER_RGB_2_8BIT( int r, int g, int b, int x, int y); + +/* Finish all pending operations and synchronize. */ +static void finish(GLcontext* ctx) +{ + /* No op */ +} + + +// +// We cache all gl draw routines until a flush is made +// +static void flush(GLcontext* ctx) +{ + STARTPROFILE + if((Current->rgb_flag /*&& !(Current->dib.fFlushed)*/&&!(Current->db_flag)) + ||(!Current->rgb_flag)) + { + wmFlush(Current); + } + ENDPROFILE(flush) + +} + + + +/* +* Set the color index used to clear the color buffer. +*/ +static void clear_index(GLcontext* ctx, GLuint index) +{ + STARTPROFILE + Current->clearpixel = index; + ENDPROFILE(clear_index) +} + + + +/* +* Set the color used to clear the color buffer. +*/ +static void clear_color( GLcontext* ctx, const GLchan color[4] ) +{ + STARTPROFILE + Current->clearpixel = RGB(color[0], color[1], color[2]); + ENDPROFILE(clear_color) +} + + + +/* +* Clear the specified region of the color buffer using the clear color +* or index as specified by one of the two functions above. +*/ +//static void clear(GLcontext* ctx, +// GLboolean all,GLint x, GLint y, GLint width, GLint height ) +// TODO: I modified this function to match the prototype in +// dd.h. (swansma@geocities.com) + +static GLbitfield clear(GLcontext* ctx, GLbitfield mask, + GLboolean all, GLint x, GLint y, GLint width, GLint height) +{ + DWORD dwColor; + WORD wColor; + BYTE bColor; + LPDWORD lpdw = (LPDWORD)Current->pbPixels; + LPWORD lpw = (LPWORD)Current->pbPixels; + LPBYTE lpb = Current->pbPixels; + int lines; + + STARTPROFILE + + if (all){ + x=y=0; + width=Current->width; + height=Current->height; + } + if(Current->db_flag==GL_TRUE){ + UINT nBypp = Current->cColorBits / 8; + int i = 0; + int iSize = 0; + + if(nBypp ==1 ){ + /* Need rectification */ + iSize = Current->width/4; + bColor = BGR8(GetRValue(Current->clearpixel), + GetGValue(Current->clearpixel), + GetBValue(Current->clearpixel)); + wColor = MAKEWORD(bColor,bColor); + dwColor = MAKELONG(wColor, wColor); + } + if(nBypp == 2){ + iSize = Current->width / 2; + wColor = BGR16(GetRValue(Current->clearpixel), + GetGValue(Current->clearpixel), + GetBValue(Current->clearpixel)); + dwColor = MAKELONG(wColor, wColor); + } + else if(nBypp == 4){ + iSize = Current->width; + dwColor = BGR32(GetRValue(Current->clearpixel), + GetGValue(Current->clearpixel), + GetBValue(Current->clearpixel)); + } + + while(i < iSize){ + *lpdw = dwColor; + lpdw++; + i++; + } + + // + // This is the 24bit case + // + if (nBypp == 3) { + iSize = Current->width *3/4; + dwColor = BGR24(GetRValue(Current->clearpixel), + GetGValue(Current->clearpixel), + GetBValue(Current->clearpixel)); + while(i < iSize){ + *lpdw = dwColor; + lpb += nBypp; + lpdw = (LPDWORD)lpb; + i++; + } + } + + i = 0; + if (stereo_flag) + lines = height /2; + else + lines = height; + do { + memcpy(lpb, Current->pbPixels, iSize*4); + lpb += Current->ScanWidth; + i++; + } + while (iclearpixel); + HBRUSH Brush=CreateSolidBrush(Current->clearpixel); + HPEN Old_Pen=SelectObject(DC,Pen); + HBRUSH Old_Brush=SelectObject(DC,Brush); + Rectangle(DC,x,y,x+width,y+height); + SelectObject(DC,Old_Pen); + SelectObject(DC,Old_Brush); + DeleteObject(Pen); + DeleteObject(Brush); + DD_RELEASEDC; + } + + + + ENDPROFILE(clear) + + return mask; // TODO: I doubt this is correct. dd.h doesn't explain what this should + // be... +} + + + +static void enable( GLcontext* ctx, GLenum pname, GLboolean enable ) +{ + if (!Current) + return; + + if (pname == GL_DITHER) { + if(enable == GL_FALSE){ + Current->dither_flag = GL_FALSE; + if(Current->cColorBits == 8) + Current->pixelformat = PF_INDEX8; + } + else{ + if (Current->rgb_flag && Current->cColorBits == 8){ + Current->pixelformat = PF_DITHER8; + Current->dither_flag = GL_TRUE; + } + else + Current->dither_flag = GL_FALSE; + } + } +} + + + +static GLboolean set_draw_buffer( GLcontext* ctx, GLenum mode ) +{ + STARTPROFILE + /* TODO: this could be better */ + if (mode==GL_FRONT_LEFT || mode==GL_BACK_LEFT) { + return GL_TRUE; + } + else { + return GL_FALSE; + } + ENDPROFILE(set_draw_buffer) +} + + +static void set_read_buffer(GLcontext *ctx, GLframebuffer *colorBuffer, + GLenum buffer ) +{ + /* XXX todo */ + return; +} + + + +/* Return characteristics of the output buffer. */ +static void buffer_size( GLcontext* ctx, GLuint *width, GLuint *height ) +{ + int New_Size; + RECT CR; + + STARTPROFILE + GetClientRect(Current->Window,&CR); + + *width=CR.right; + *height=CR.bottom; + + New_Size=((*width)!=Current->width) || ((*height)!=Current->height); + + if (New_Size){ + Current->width=*width; + Current->height=*height; + Current->ScanWidth=Current->width; + if ((Current->ScanWidth%sizeof(long))!=0) + Current->ScanWidth+=(sizeof(long)-(Current->ScanWidth%sizeof(long))); + + if (Current->db_flag){ +#ifdef DDRAW + DDDeleteOffScreen(Current); + DDCreateOffScreen(Current); +#else + if (Current->rgb_flag==GL_TRUE && Current->dither_flag!=GL_TRUE){ + wmDeleteBackingStore(Current); + wmCreateBackingStore(Current, Current->width, Current->height); + } +#endif + } + + // Resize OsmesaBuffer if in Parallel mode +#if !defined(NO_PARALLEL) + if(parallelFlag) + PRSizeRenderBuffer(Current->width, Current->height,Current->ScanWidth, + Current->rgb_flag == GL_TRUE ? Current->pbPixels: Current->ScreenMem); +#endif + } + ENDPROFILE(buffer_size) +} + + + +/**********************************************************************/ +/***** Accelerated point, line, polygon rendering *****/ +/**********************************************************************/ + + +static void fast_rgb_points( GLcontext* ctx, GLuint first, GLuint last ) +{ +#if 0 + GLuint i; + // HDC DC=DD_GETDC; + PWMC pwc = Current; + + STARTPROFILE + + if (0 /*Current->gl_ctx->VB->MonoColor*/) { + /* all drawn with current color */ + for (i=first;i<=last;i++) { + if (!Current->gl_ctx->VB->ClipMask[i]) { + int x, y; + x = (GLint) Current->gl_ctx->VB->Win.data[i][0]; + y = FLIP( (GLint) Current->gl_ctx->VB->Win.data[i][1] ); + wmSetPixel(pwc, y,x,GetRValue(Current->pixel), + GetGValue(Current->pixel), GetBValue(Current->pixel)); + } + } + } + else { + /* draw points of different colors */ + for (i=first;i<=last;i++) { + if (!Current->gl_ctx->VB->ClipMask[i]) { + int x, y; + unsigned long pixel=RGB(Current->gl_ctx->VB->ColorPtr->data[i][0]*255.0, + Current->gl_ctx->VB->ColorPtr->data[i][1]*255.0, + Current->gl_ctx->VB->ColorPtr->data[i][2]*255.0); + x = (GLint) Current->gl_ctx->VB->Win.data[i][0]; + y = FLIP( (GLint) Current->gl_ctx->VB->Win.data[i][1] ); + wmSetPixel(pwc, y,x,Current->gl_ctx->VB->ColorPtr->data[i][0]*255.0, + Current->gl_ctx->VB->ColorPtr->data[i][1]*255.0, + Current->gl_ctx->VB->ColorPtr->data[i][2]*255.0); + } + } + } + // DD_RELEASEDC; + ENDPROFILE(fast_rgb_points) +#endif +} + + + +/* Return pointer to accerated points function */ +extern /*points_func*/ choose_points_function( GLcontext* ctx ) +{ +#if 0 + STARTPROFILE + if (ctx->Point.Size==1.0 && !ctx->Point.SmoothFlag && ctx->_RasterMask==0 + && !ctx->Texture._ReallyEnabled && ctx->Visual->RGBAflag) { + ENDPROFILE(choose_points_function) + return fast_rgb_points; + } + else { + ENDPROFILE(choose_points_function) + return NULL; + } +#endif +} + + + +/* Draw a line using the color specified by Current->gl_ctx->VB->ColorPtr->data[pv] */ +static void fast_flat_rgb_line( GLcontext* ctx, GLuint v0, GLuint v1, GLuint pv ) +{ +#if 0 + STARTPROFILE + int x0, y0, x1, y1; + unsigned long pixel; + HDC DC=DD_GETDC; + HPEN Pen; + HPEN Old_Pen; + + if (0 /*Current->gl_ctx->VB->MonoColor*/) { + pixel = Current->pixel; /* use current color */ + } + else { + pixel = RGB(Current->gl_ctx->VB->ColorPtr->data[pv][0]*255.0, Current->gl_ctx->VB->ColorPtr->data[pv][1]*255.0, Current->gl_ctx->VB->ColorPtr->data[pv][2]*255.0); + } + + x0 = (int) Current->gl_ctx->VB->Win.data[v0][0]; + y0 = FLIP( (int) Current->gl_ctx->VB->Win.data[v0][1] ); + x1 = (int) Current->gl_ctx->VB->Win.data[v1][0]; + y1 = FLIP( (int) Current->gl_ctx->VB->Win.data[v1][1] ); + + + BEGINGDICALL + + Pen=CreatePen(PS_SOLID,1,pixel); + Old_Pen=SelectObject(DC,Pen); + MoveToEx(DC,x0,y0,NULL); + LineTo(DC,x1,y1); + SelectObject(DC,Old_Pen); + DeleteObject(Pen); + DD_RELEASEDC; + + ENDGDICALL + + ENDPROFILE(fast_flat_rgb_line) +#endif +} + + + +/* Return pointer to accerated line function */ +static /*line_func*/ choose_line_function( GLcontext* ctx ) +{ +#if 0 + STARTPROFILE + if (ctx->Line.Width==1.0 && !ctx->Line.SmoothFlag && !ctx->Line.StippleFlag + && ctx->Light.ShadeModel==GL_FLAT && ctx->_RasterMask==0 + && !ctx->Texture._ReallyEnabled && Current->rgb_flag) { + ENDPROFILE(choose_line_function) + return fast_flat_rgb_line; + } + else { + ENDPROFILE(choose_line_function) + return NULL; + } +#endif +} + + +/**********************************************************************/ +/***** Span-based pixel drawing *****/ +/**********************************************************************/ + + +/* Write a horizontal span of 32-bit color-index pixels with a boolean mask. */ +static void write_ci32_span( const GLcontext* ctx, + GLuint n, GLint x, GLint y, + const GLuint index[], + const GLubyte mask[] ) +{ + STARTPROFILE + GLuint i; + PBYTE Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; irgb_flag==GL_TRUE) + { + GLuint i; + HDC DC=DD_GETDC; + y=FLIP(y); + if (mask) { + for (i=0; iScreenMem+y*Current->ScanWidth+x; + y = FLIP(y); + if (mask) { + for (i=0; ihPal,RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP])); + } + else { + for (i=0; ihPal,RGB(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP])); + } + } + ENDPROFILE(write_rgba_span) + +} + +/* Write a horizontal span of RGB color pixels with a boolean mask. */ +static void write_rgb_span( const GLcontext* ctx, + GLuint n, GLint x, GLint y, + const GLubyte rgb[][3], const GLubyte mask[] ) +{ + STARTPROFILE + PWMC pwc = Current; + + if (pwc->rgb_flag==GL_TRUE) + { + GLuint i; + HDC DC=DD_GETDC; + y=FLIP(y); + if (mask) { + for (i=0; iScreenMem+y*Current->ScanWidth+x; + y = FLIP(y); + if (mask) { + for (i=0; ihPal,RGB(rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP])); + } + else { + for (i=0; ihPal,RGB(rgb[i][RCOMP], rgb[i][GCOMP], rgb[i][BCOMP])); + } + } + ENDPROFILE(write_rgb_span) + +} + +/* +* Write a horizontal span of pixels with a boolean mask. The current color +* is used for all pixels. +*/ +static void write_mono_rgba_span( const GLcontext* ctx, + GLuint n, GLint x, GLint y, + const GLchan color[4], const GLubyte mask[]) +{ + ULONG pixel = RGB( color[RCOMP], color[GCOMP], color[BCOMP] ); + STARTPROFILE + GLuint i; + HDC DC=DD_GETDC; + PWMC pwc = Current; + assert(Current->rgb_flag==GL_TRUE); + y=FLIP(y); + if(Current->rgb_flag==GL_TRUE){ + for (i=0; irgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]; + *Mem = index[i]; + } + } + ENDPROFILE(write_ci32_pixels) +} + + + +/* +* Write an array of pixels with a boolean mask. The current color +* index is used for all pixels. +*/ +static void write_mono_ci_pixels( const GLcontext* ctx, + GLuint n, + const GLint x[], const GLint y[], + GLuint colorIndex, const GLubyte mask[] ) +{ + STARTPROFILE + GLuint i; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]; + *Mem = colorIndex; + } + } + ENDPROFILE(write_mono_ci_pixels) +} + + + +/* Write an array of RGBA pixels with a boolean mask. */ +static void write_rgba_pixels( const GLcontext* ctx, + GLuint n, const GLint x[], const GLint y[], + const GLubyte rgba[][4], const GLubyte mask[] ) +{ + STARTPROFILE + GLuint i; + PWMC pwc = Current; + HDC DC=DD_GETDC; + assert(Current->rgb_flag==GL_TRUE); + for (i=0; irgb_flag==GL_TRUE); + for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; + assert(Current->rgb_flag==GL_FALSE); + for (i=0; irgb_flag==GL_FALSE); + for (i=0; iScreenMem+FLIP(y[i])*Current->ScanWidth+x[i]); + } + } + ENDPROFILE(read_ci32_pixels) +} + + + +/* Read a horizontal span of color pixels. */ +static void read_rgba_span( const GLcontext* ctx, + GLuint n, GLint x, GLint y, + GLubyte rgba[][4] ) +{ + STARTPROFILE + UINT i; + COLORREF Color; + HDC DC=DD_GETDC; + assert(Current->rgb_flag==GL_TRUE); + /* y=FLIP(y);*/ + y = Current->height - y - 1; + for (i=0; irgb_flag==GL_TRUE); + for (i=0; iheight - y[i] - 1; + Color=GetPixel(DC,x[i],y2); + rgba[i][RCOMP] = GetRValue(Color); + rgba[i][GCOMP] = GetGValue(Color); + rgba[i][BCOMP] = GetBValue(Color); + rgba[i][ACOMP] = 255; + } + } + DD_RELEASEDC; +// Brian P. has mentioned to comment this out. +// memset(alpha,0,n*sizeof(GLint)); + ENDPROFILE(read_rgba_pixels) +} + + + +/**********************************************************************/ +/**********************************************************************/ + + +static const GLubyte *get_string(GLcontext *ctx, GLenum name) +{ + if (name == GL_RENDERER) { + return (GLubyte *) "Mesa Windows"; + } + else { + return NULL; + } +} + + + +void setup_DD_pointers( GLcontext* ctx ) +{ +#if 0 + ctx->Driver.GetString = get_string; + ctx->Driver.UpdateState = setup_DD_pointers; + ctx->Driver.GetBufferSize = buffer_size; + ctx->Driver.Finish = finish; + ctx->Driver.Flush = flush; + + ctx->Driver.ClearIndex = clear_index; + ctx->Driver.ClearColor = clear_color; + ctx->Driver.Clear = clear; + + ctx->Driver.Enable = enable; + + ctx->Driver.SetDrawBuffer = set_draw_buffer; + ctx->Driver.SetReadBuffer = set_read_buffer; + ctx->Driver.GetBufferSize = buffer_size; + + ctx->Driver.PointsFunc = choose_points_function(ctx); + ctx->Driver.LineFunc = choose_line_function(ctx); + ctx->Driver.TriangleFunc = choose_triangle_function( ctx ); + + /* Pixel/span writing functions: */ + ctx->Driver.WriteRGBASpan = write_rgba_span; + ctx->Driver.WriteRGBSpan = write_rgb_span; + ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span; + ctx->Driver.WriteRGBAPixels = write_rgba_pixels; + ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels; + ctx->Driver.WriteCI32Span = write_ci32_span; + ctx->Driver.WriteCI8Span = write_ci8_span; + ctx->Driver.WriteMonoCISpan = write_mono_ci_span; + ctx->Driver.WriteCI32Pixels = write_ci32_pixels; + ctx->Driver.WriteMonoCIPixels = write_mono_ci_pixels; + + ctx->Driver.ReadCI32Span = read_ci32_span; + ctx->Driver.ReadRGBASpan = read_rgba_span; + ctx->Driver.ReadCI32Pixels = read_ci32_pixels; + ctx->Driver.ReadRGBAPixels = read_rgba_pixels; +#endif +} + + +/**********************************************************************/ +/***** WMesa API Functions *****/ +/**********************************************************************/ + + + +#define PAL_SIZE 256 +static void GetPalette(HPALETTE Pal,RGBQUAD *aRGB) +{ + STARTPROFILE + int i; + HDC hdc; + struct + { + WORD Version; + WORD NumberOfEntries; + PALETTEENTRY aEntries[PAL_SIZE]; + } Palette = + { + 0x300, + PAL_SIZE + }; + hdc=GetDC(NULL); + if (Pal!=NULL) + GetPaletteEntries(Pal,0,PAL_SIZE,Palette.aEntries); + else + GetSystemPaletteEntries(hdc,0,PAL_SIZE,Palette.aEntries); + if (GetSystemPaletteUse(hdc) == SYSPAL_NOSTATIC) + { + for(i = 0; i Window=hWnd; + c->hDC = GetDC(hWnd); + true_color_flag = GetDeviceCaps(c->hDC, BITSPIXEL) > 8; +#ifdef DDRAW + if(true_color_flag) c->rgb_flag = rgb_flag = GL_TRUE; +#endif + + +#ifdef DITHER + if ((true_color_flag==GL_FALSE) && (rgb_flag == GL_TRUE)){ + c->dither_flag = GL_TRUE; + c->hPalHalfTone = WinGCreateHalftonePalette(); + } + else + c->dither_flag = GL_FALSE; +#else + c->dither_flag = GL_FALSE; +#endif + + + if (rgb_flag==GL_FALSE) + { + c->rgb_flag = GL_FALSE; + // c->pixel = 1; + c->db_flag = db_flag =GL_TRUE; // WinG requires double buffering + printf("Single buffer is not supported in color index mode, setting to double buffer.\n"); + } + else + { + c->rgb_flag = GL_TRUE; + // c->pixel = 0; + } + GetClientRect(c->Window,&CR); + c->width=CR.right; + c->height=CR.bottom; + if (db_flag) + { + c->db_flag = 1; + /* Double buffered */ +#ifndef DDRAW + // if (c->rgb_flag==GL_TRUE && c->dither_flag != GL_TRUE ) + { + wmCreateBackingStore(c, c->width, c->height); + + } +#endif + } + else + { + /* Single Buffered */ + if (c->rgb_flag) + c->db_flag = 0; + } +#ifdef DDRAW + if (DDInit(c,hWnd) == GL_FALSE) { + free( (void *) c ); + exit(1); + } +#endif + + + c->gl_visual = _mesa_create_visual(rgb_flag, + db_flag, /* db_flag */ + GL_FALSE, /* stereo */ + 8,8,8,8, /* r, g, b, a bits */ + 0, /* index bits */ + 16, /* depth_bits */ + 8, /* stencil_bits */ + 16,16,16,16,/* accum_bits */ + 1); + + if (!c->gl_visual) { + return NULL; + } + + /* allocate a new Mesa context */ + c->gl_ctx = _mesa_create_context( c->gl_visual, NULL, c, GL_TRUE); + + if (!c->gl_ctx) { + _mesa_destroy_visual( c->gl_visual ); + free(c); + return NULL; + } + + _mesa_enable_sw_extensions(c->gl_ctx); +#if 0 + c->gl_buffer = _mesa_create_framebuffer( c->gl_visual, + c->gl_visual->DepthBits > 0, + c->gl_visual->StencilBits > 0, + c->gl_visual->AccumRedBits > 0, + c->gl_visual->AlphaBits > 0 ); +#endif + c->gl_buffer = NULL; /* TEMP */ + if (!c->gl_buffer) { + _mesa_destroy_visual( c->gl_visual ); + _mesa_destroy_context( c->gl_ctx ); + free(c); + return NULL; + } + + c->gl_ctx->Driver.UpdateState = setup_DD_pointers; + + // setup_DD_pointers(c->gl_ctx); + + return c; +} + +void WMesaDestroyContext( void ) +{ + WMesaContext c = Current; + ReleaseDC(c->Window,c->hDC); + WC = c; + if(c->hPalHalfTone != NULL) + DeleteObject(c->hPalHalfTone); + _mesa_destroy_visual( c->gl_visual ); + _mesa_destroy_framebuffer( c->gl_buffer ); + _mesa_destroy_context( c->gl_ctx ); + + if (c->db_flag) +#ifdef DDRAW + DDFree(c); +#else + wmDeleteBackingStore(c); +#endif + free( (void *) c ); + //Following code is added to enable parallel render + // Parallel render only work in double buffer mode +#if !defined(NO_PARALLEL) + if(parallelMachine) + PRDestroyRenderBuffer(); +#endif + // End modification +} + + + +void /*APIENTRY*/ WMesaMakeCurrent( WMesaContext c ) +{ + if(!c){ + Current = c; + return; + } + + // + // A little optimization + // If it already is current, + // don't set it again + // + if(Current == c) + return; + + //gl_set_context( c->gl_ctx ); + _mesa_make_current(c->gl_ctx, c->gl_buffer); + setup_DD_pointers(c->gl_ctx); + Current = c; + if (Current->gl_ctx->Viewport.Width==0) { + /* initialize viewport to window size */ + _mesa_set_viewport( Current->gl_ctx, + 0, 0, Current->width, Current->height ); + } + if ((c->cColorBits <= 8 ) && (c->rgb_flag == GL_TRUE)){ + WMesaPaletteChange(c->hPalHalfTone); + } +} + + + +void /*APIENTRY*/ WMesaSwapBuffers( void ) +{ + HDC DC = Current->hDC; + GET_CURRENT_CONTEXT(ctx); + + /* If we're swapping the buffer associated with the current context + * we have to flush any pending rendering commands first. + */ + if (Current && Current->gl_ctx == ctx) + _mesa_swapbuffers(ctx); + + if (Current->db_flag) + wmFlush(Current); +} + + + +void /*APIENTRY*/ WMesaPaletteChange(HPALETTE Pal) +{ + int vRet; + LPPALETTEENTRY pPal; + if (Current && (Current->rgb_flag==GL_FALSE || Current->dither_flag == GL_TRUE)) + { + pPal = (PALETTEENTRY *)malloc( 256 * sizeof(PALETTEENTRY)); + Current->hPal=Pal; + // GetPaletteEntries( Pal, 0, 256, pPal ); + GetPalette( Pal, pPal ); +#ifdef DDRAW + Current->lpDD->lpVtbl->CreatePalette(Current->lpDD,DDPCAPS_8BIT, + pPal, &(Current->lpDDPal), NULL); + if (Current->lpDDPal) + Current->lpDDSPrimary->lpVtbl->SetPalette(Current->lpDDSPrimary,Current->lpDDPal); +#else + vRet = SetDIBColorTable(Current->dib.hDC,0,256,pPal); +#endif + free( pPal ); + } + +} + + + + +static unsigned char threeto8[8] = { + 0, 0111>>1, 0222>>1, 0333>>1, 0444>>1, 0555>>1, 0666>>1, 0377 +}; + +static unsigned char twoto8[4] = { + 0, 0x55, 0xaa, 0xff +}; + +static unsigned char oneto8[2] = { + 0, 255 +}; + +static unsigned char componentFromIndex(UCHAR i, UINT nbits, UINT shift) +{ + unsigned char val; + + val = i >> shift; + switch (nbits) { + + case 1: + val &= 0x1; + return oneto8[val]; + + case 2: + val &= 0x3; + return twoto8[val]; + + case 3: + val &= 0x7; + return threeto8[val]; + + default: + return 0; + } +} + +void /*WINAPI*/ wmCreatePalette( PWMC pwdc ) +{ + /* Create a compressed and re-expanded 3:3:2 palette */ + int i; + LOGPALETTE *pPal; + BYTE rb, rs, gb, gs, bb, bs; + + pwdc->nColors = 0x100; + + pPal = (PLOGPALETTE)malloc(sizeof(LOGPALETTE) + pwdc->nColors * sizeof(PALETTEENTRY)); + memset( pPal, 0, sizeof(LOGPALETTE) + pwdc->nColors * sizeof(PALETTEENTRY) ); + + pPal->palVersion = 0x300; + + rb = REDBITS; + rs = REDSHIFT; + gb = GREENBITS; + gs = GREENSHIFT; + bb = BLUEBITS; + bs = BLUESHIFT; + + if (pwdc->db_flag) { + + /* Need to make two palettes: one for the screen DC and one for the DIB. */ + pPal->palNumEntries = pwdc->nColors; + for (i = 0; i < pwdc->nColors; i++) { + pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs ); + pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs ); + pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs ); + pPal->palPalEntry[i].peFlags = 0; + } + pwdc->hGLPalette = CreatePalette( pPal ); + pwdc->hPalette = CreatePalette( pPal ); + } + + else { + pPal->palNumEntries = pwdc->nColors; + for (i = 0; i < pwdc->nColors; i++) { + pPal->palPalEntry[i].peRed = componentFromIndex( i, rb, rs ); + pPal->palPalEntry[i].peGreen = componentFromIndex( i, gb, gs ); + pPal->palPalEntry[i].peBlue = componentFromIndex( i, bb, bs ); + pPal->palPalEntry[i].peFlags = 0; + } + pwdc->hGLPalette = CreatePalette( pPal ); + } + + free(pPal); + +} + +void /*WINAPI*/ wmSetPixel(PWMC pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b) +{ + if (Current->db_flag) { + LPBYTE lpb = pwc->pbPixels; + LPDWORD lpdw; + LPWORD lpw; + UINT nBypp = pwc->cColorBits >> 3; + UINT nOffset = iPixel % nBypp; + + // Move the pixel buffer pointer to the scanline that we + // want to access + + // pwc->dib.fFlushed = FALSE; + + lpb += pwc->ScanWidth * iScanLine; + // Now move to the desired pixel + lpb += iPixel * nBypp; + lpb = PIXELADDR(iPixel, iScanLine); + lpdw = (LPDWORD)lpb; + lpw = (LPWORD)lpb; + + if(nBypp == 1){ + if(pwc->dither_flag) + *lpb = DITHER_RGB_2_8BIT(r,g,b,iScanLine,iPixel); + else + *lpb = BGR8(r,g,b); + } + else if(nBypp == 2) + *lpw = BGR16(r,g,b); + else if (nBypp == 3){ + *lpdw = BGR24(r,g,b); + } + else if (nBypp == 4) + *lpdw = BGR32(r,g,b); + } + else{ + SetPixel(Current->hDC, iPixel, iScanLine, RGB(r,g,b)); + DD_RELEASEDC; + } +} + +void /*WINAPI*/ wmCreateDIBSection( + HDC hDC, + PWMC pwc, // handle of device context + CONST BITMAPINFO *pbmi, // address of structure containing bitmap size, format, and color data + UINT iUsage // color data type indicator: RGB values or palette indices + ) +{ + DWORD dwSize = 0; + DWORD dwScanWidth; + UINT nBypp = pwc->cColorBits / 8; + HDC hic; + + dwScanWidth = (((pwc->ScanWidth * nBypp)+ 3) & ~3); + + pwc->ScanWidth =pwc->pitch = dwScanWidth; + + if (stereo_flag) + pwc->ScanWidth = 2* pwc->pitch; + + dwSize = sizeof(BITMAPINFO) + (dwScanWidth * pwc->height); + + pwc->dib.hFileMap = CreateFileMapping((HANDLE)PAGE_FILE, + NULL, + PAGE_READWRITE | SEC_COMMIT, + 0, + dwSize, + NULL); + + if (!pwc->dib.hFileMap) + return; + + pwc->dib.base = MapViewOfFile(pwc->dib.hFileMap, + FILE_MAP_ALL_ACCESS, + 0, + 0, + 0); + + if(!pwc->dib.base){ + CloseHandle(pwc->dib.hFileMap); + return; + } + + // pwc->pbPixels = pwc->addrOffScreen = ((LPBYTE)pwc->dib.base) + sizeof(BITMAPINFO); + + // pwc->dib.hDC = CreateCompatibleDC(hDC); + + CopyMemory(pwc->dib.base, pbmi, sizeof(BITMAPINFO)); + + hic = CreateIC("display", NULL, NULL, NULL); + pwc->dib.hDC = CreateCompatibleDC(hic); + + + /* pwc->hbmDIB = CreateDIBitmap(hic, + &(pwc->bmi.bmiHeader), + CBM_INIT, + pwc->pbPixels, + &(pwc->bmi), + DIB_RGB_COLORS); + */ + pwc->hbmDIB = CreateDIBSection(hic, + &(pwc->bmi), + (iUsage ? DIB_PAL_COLORS : DIB_RGB_COLORS), + &(pwc->pbPixels), + pwc->dib.hFileMap, + 0); + /* + pwc->hbmDIB = CreateDIBSection(hic, + &(pwc->bmi), + DIB_RGB_COLORS, + &(pwc->pbPixels), + pwc->dib.hFileMap, + 0); + */ + pwc->ScreenMem = pwc->addrOffScreen = pwc->pbPixels; + pwc->hOldBitmap = SelectObject(pwc->dib.hDC, pwc->hbmDIB); + + DeleteDC(hic); + + return; + +} + +// +// Blit memory DC to screen DC +// +BOOL /*WINAPI*/ wmFlush(PWMC pwc) +{ + BOOL bRet = 0; + DWORD dwErr = 0; +#ifdef DDRAW + HRESULT ddrval; +#endif + + // Now search through the torus frames and mark used colors + if(pwc->db_flag){ +#ifdef DDRAW + if (pwc->lpDDSOffScreen == NULL) + if(DDCreateOffScreen(pwc) == GL_FALSE) + return; + + pwc->lpDDSOffScreen->lpVtbl->Unlock(pwc->lpDDSOffScreen, NULL); + + while( 1 ) + { + ddrval = pwc->lpDDSPrimary->lpVtbl->Blt( pwc->lpDDSPrimary, + &(pwc->rectSurface), pwc->lpDDSOffScreen, &(pwc->rectOffScreen), 0, NULL ); + + if( ddrval == DD_OK ) + { + break; + } + if( ddrval == DDERR_SURFACELOST ) + { + if(!DDRestoreAll(pwc)) + { + break; + } + } + if( ddrval != DDERR_WASSTILLDRAWING ) + { + break; + } + } + + while (pwc->lpDDSOffScreen->lpVtbl->Lock(pwc->lpDDSOffScreen, + NULL, &(pwc->ddsd), 0, NULL) == DDERR_WASSTILLDRAWING) + ; + + if(ddrval != DD_OK) + dwErr = GetLastError(); +#else + bRet = BitBlt(pwc->hDC, 0, 0, pwc->width, pwc->height, + pwc->dib.hDC, 0, 0, SRCCOPY); +#endif + } + + return(TRUE); + +} + + +// The following code is added by Li Wei to enable stereo display + +#if !defined(NO_STEREO) + +void WMesaShowStereo(GLuint list) +{ + + GLbitfield mask = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT; + GLfloat cm[16]; + GLint matrix_mode; + // Must use double Buffer + if( ! Current-> db_flag ) + return; + + + glGetIntegerv(GL_MATRIX_MODE,&matrix_mode); + + // glPushMatrix(); //**** + WMesaViewport(Current->gl_ctx,0,Current->height/2,Current->width,Current->height/2); + // Current->gl_ctx->NewState = 0; + + // glViewport(0,0,Current->width,Current->height/2); + if(matrix_mode!=GL_MODELVIEW) + glMatrixMode(GL_MODELVIEW); + + glGetFloatv(GL_MODELVIEW_MATRIX,cm); + glLoadIdentity(); + gluLookAt(viewDistance/2,0.0,0.0 , + viewDistance/2,0.0,-1.0, + 0.0,1.0,0.0 ); + // glTranslatef(viewDistance/2.0,0.,0.); + glMultMatrixf( cm ); + + Current->ScreenMem = Current->pbPixels = Current->addrOffScreen; + //glPushMatrix(); + glCallList( list ); + //glPopMatrix(); + + glGetFloatv(GL_MODELVIEW_MATRIX,cm); + glLoadIdentity(); + gluLookAt(-viewDistance/2,0.0,0.0 , + -viewDistance/2,0.0,-1.0, + 0.0,1.0,0.0 ); + // glTranslatef(-viewDistance/2.0,0.,0.); + glMultMatrixf(cm); + + Current->ScreenMem = Current->pbPixels = Current->addrOffScreen + Current->pitch; + glCallList(list); + if(matrix_mode!=GL_MODELVIEW) + glMatrixMode(matrix_mode); + + // glPopMatrix(); + glFlush(); + + WMesaViewport(Current->gl_ctx,0,0,Current->width,Current->height); + // Current->gl_ctx->NewState = 0; + WMesaSwapBuffers(); + +} + +void toggleStereoMode() +{ + if(!Current->db_flag) + return; + if(!stereo_flag){ + stereo_flag = 1; + if(stereoBuffer==GL_FALSE) +#if !defined(NO_PARALLEL) + if(!parallelFlag) +#endif + { + Current->ScanWidth = Current->pitch*2; + } + } + else { + stereo_flag = 0; +#if !defined(NO_PARALLEL) + if(!parallelFlag) +#endif + Current->ScanWidth = Current->pitch; + Current->pbPixels = Current->addrOffScreen; + } +} + +/* if in stereo mode, the following function is called */ +void glShowStereo(GLuint list) +{ + WMesaShowStereo(list); +} + +#endif // End if NO_STEREO not defined + +#if !defined(NO_PARALLEL) + +void toggleParallelMode(void) +{ + if(!parallelFlag){ + parallelFlag = GL_TRUE; + if(parallelMachine==GL_FALSE){ + PRCreateRenderBuffer( Current->rgb_flag? GL_RGBA :GL_COLOR_INDEX, + Current->cColorBits/8, + Current->width ,Current->height, + Current->ScanWidth, + Current->rgb_flag? Current->pbPixels: Current->ScreenMem); + parallelMachine = GL_TRUE; + } + } + else { + parallelFlag = GL_FALSE; + if(parallelMachine==GL_TRUE){ + PRDestroyRenderBuffer(); + parallelMachine=GL_FALSE; + ReadyForNextFrame = GL_TRUE; + } + + /*********************************************** + // Seems something wrong!!!! + ************************************************/ + + WMesaMakeCurrent(Current); +#if !defined(NO_STEREO) + stereo_flag = GL_FALSE ; +#endif + } +} + +void PRShowRenderResult(void) +{ + int flag = 0; + if(!glImageRendered()) + return; + + if (parallelFlag) + { + WMesaSwapBuffers(); + } + +} +#endif //End if NO_PARALLEL not defined + +//end modification + +BYTE DITHER_RGB_2_8BIT( int red, int green, int blue, int pixel, int scanline) +{ + char unsigned redtemp, greentemp, bluetemp, paletteindex; + + //*** now, look up each value in the halftone matrix + //*** using an 8x8 ordered dither. + redtemp = aDividedBy51[red] + + (aModulo51[red] > aHalftone8x8[(pixel%8)*8 + + scanline%8]); + greentemp = aDividedBy51[(char unsigned)green] + + (aModulo51[green] > aHalftone8x8[ + (pixel%8)*8 + scanline%8]); + bluetemp = aDividedBy51[(char unsigned)blue] + + (aModulo51[blue] > aHalftone8x8[ + (pixel%8)*8 +scanline%8]); + + //*** recombine the halftoned rgb values into a palette index + paletteindex = + redtemp + aTimes6[greentemp] + aTimes36[bluetemp]; + + //*** and translate through the wing halftone palette + //*** translation vector to give the correct value. + return aWinGHalftoneTranslation[paletteindex]; +} + +#ifdef DDRAW +/* +* restoreAll +* +* restore all lost objects +*/ +HRESULT DDRestoreAll( WMesaContext wc ) +{ + HRESULT ddrval; + + ddrval = wc->lpDDSPrimary->lpVtbl->Restore(wc->lpDDSPrimary); + if( ddrval == DD_OK ) + { + ddrval = wc->lpDDSOffScreen->lpVtbl->Restore(wc->lpDDSOffScreen); + } + return ddrval; + +} /* restoreAll */ + + + /* + * This function is called if the initialization function fails +*/ +BOOL initFail( HWND hwnd, WMesaContext wc ) +{ + DDFree(wc); + MessageBox( hwnd, "DirectDraw Init FAILED", "", MB_OK ); + return FALSE; + +} /* initFail */ + + +static void DDDeleteOffScreen(WMesaContext wc) +{ + if( wc->lpDDSOffScreen != NULL ) + { + wc->lpDDSOffScreen->lpVtbl->Unlock(wc->lpDDSOffScreen,NULL); + wc->lpDDSOffScreen->lpVtbl->Release(wc->lpDDSOffScreen); + wc->lpDDSOffScreen = NULL; + } + +} + +static void DDFreePrimarySurface(WMesaContext wc) +{ + if( wc->lpDDSPrimary != NULL ) + { + if(wc->db_flag == GL_FALSE) + wc->lpDDSPrimary->lpVtbl->ReleaseDC(wc->lpDDSPrimary, wc->hDC); + wc->lpDDSPrimary->lpVtbl->Release(wc->lpDDSPrimary); + wc->lpDDSPrimary = NULL; + } +} + +static BOOL DDCreatePrimarySurface(WMesaContext wc) +{ + HRESULT ddrval; + DDSCAPS ddscaps; + wc->ddsd.dwSize = sizeof( wc->ddsd ); + wc->ddsd.dwFlags = DDSD_CAPS; + wc->ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + + ddrval = wc->lpDD->lpVtbl->CreateSurface( wc->lpDD,&(wc->ddsd), &(wc->lpDDSPrimary), NULL ); + if( ddrval != DD_OK ) + { + return initFail(wc->hwnd , wc); + } + if(wc->db_flag == GL_FALSE) + wc->lpDDSPrimary->lpVtbl->GetDC(wc->lpDDSPrimary, wc->hDC); + return TRUE; +} + +static BOOL DDCreateOffScreen(WMesaContext wc) +{ + POINT pt; + HRESULT ddrval; + if(wc->lpDD == NULL) + return FALSE; + GetClientRect( wc->hwnd, &(wc->rectOffScreen) ); + wc->ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; + wc->ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + wc->ddsd.dwHeight = wc->rectOffScreen.bottom - wc->rectOffScreen.top; + wc->ddsd.dwWidth = wc->rectOffScreen.right - wc->rectOffScreen.left; + + ddrval = wc->lpDD->lpVtbl->CreateSurface( wc->lpDD, &(wc->ddsd), &(wc->lpDDSOffScreen), NULL ); + if( ddrval != DD_OK ) + { + return FALSE; + } + + while (wc->lpDDSOffScreen->lpVtbl->Lock(wc->lpDDSOffScreen,NULL, &(wc->ddsd), 0, NULL) == DDERR_WASSTILLDRAWING) + ; + // while ((ddrval = wc->lpDDSOffScreen->lpVtbl->Lock(wc->lpDDSOffScreen,NULL, &(wc->ddsd), DDLOCK_SURFACEMEMORYPTR , NULL)) != DD_OK) + ; + if(wc->ddsd.lpSurface==NULL) + return initFail(wc->hwnd, wc); + + wc->ScreenMem = wc->pbPixels = wc->addrOffScreen = (PBYTE)(wc->ddsd.lpSurface); + wc->ScanWidth = wc->pitch = wc->ddsd.lPitch; + if (stereo_flag) + wc->ScanWidth = wc->ddsd.lPitch*2; + + GetClientRect( wc->hwnd, &(wc->rectSurface) ); + pt.x = pt.y = 0; + ClientToScreen( wc->hwnd, &pt ); + OffsetRect(&(wc->rectSurface), pt.x, pt.y); + wmSetPixelFormat(wc, wc->hDC); + return TRUE; +} + +/* +* doInit - do work required for every instance of the application: +* create the window, initialize data +*/ +static BOOL DDInit( WMesaContext wc, HWND hwnd) +{ + HRESULT ddrval; + DWORD dwFrequency; + + LPDIRECTDRAW lpDD; // DirectDraw object + LPDIRECTDRAW2 lpDD2; + + + wc->fullScreen = displayOptions.fullScreen; + wc->gMode = displayOptions.mode; + wc->hwnd = hwnd; + stereo_flag = displayOptions.stereo; + if(wc->db_flag!= GL_TRUE) + stereo_flag = GL_FALSE; + /* + * create the main DirectDraw object + */ + ddrval = DirectDrawCreate( NULL, &(wc->lpDD), NULL ); + if( ddrval != DD_OK ) + { + return initFail(hwnd,wc); + } + + // Get exclusive mode if requested + if(wc->fullScreen) + { + ddrval = wc->lpDD->lpVtbl->SetCooperativeLevel( wc->lpDD, hwnd, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN ); + } + else + { + ddrval = wc->lpDD->lpVtbl->SetCooperativeLevel( wc->lpDD, hwnd, DDSCL_NORMAL ); + } + if( ddrval != DD_OK ) + { + return initFail(hwnd , wc); + } + + + /* ddrval = wc->lpDD->lpVtbl->QueryInterface(wc->lpDD, IID_IDirectDraw2, + (LPVOID *)((wc->lpDD2))); + + */ + if(ddrval != DD_OK) + return initFail(hwnd , wc); + + + //ddrval = wc->lpDD->lpVtbl->GetDisplayMode( wc->lpDD, &(wc->ddsd)); + // wc->lpDD2->lpVtbl->GetMonitorFrequency(wc->lpDD, &dwFrequency); + switch( wc->gMode ) + { + case 1: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 640, 480, displayOptions.bpp); break; + case 2: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 800, 600, displayOptions.bpp); break; + case 3: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 1024, 768, displayOptions.bpp); break; + case 4: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 1152, 864, displayOptions.bpp); break; + case 5: ddrval = wc->lpDD->lpVtbl->SetDisplayMode( wc->lpDD, 1280, 1024, displayOptions.bpp); break; + } + + if( ddrval != DD_OK ) + { + printf("Can't modify display mode, current mode used\n"); + // return initFail(hwnd , wc); + } + //ddrval = wc->lpDD->lpVtbl->GetDisplayMode( wc->lpDD, &(wc->ddsd)); + switch(ddrval){ + case DDERR_INVALIDOBJECT: + break; + case DDERR_INVALIDPARAMS: + break; + case DDERR_UNSUPPORTEDMODE: + ; + } + + if(DDCreatePrimarySurface(wc) == GL_FALSE) + return initFail(hwnd, wc); + + if(wc->db_flag) + return DDCreateOffScreen(wc); +} /* DDInit */ + +static void DDFree( WMesaContext wc) +{ + if( wc->lpDD != NULL ) + { + DDFreePrimarySurface(wc); + DDDeleteOffScreen(wc); + wc->lpDD->lpVtbl->Release(wc->lpDD); + wc->lpDD = NULL; + } + // Clean up the screen on exit + RedrawWindow( NULL, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | + RDW_ALLCHILDREN ); + +} +#endif + +void WMesaMove(void) +{ + WMesaContext wc = Current; + POINT pt; + if (Current != NULL){ + GetClientRect( wc->hwnd, &(wc->rectSurface) ); + pt.x = pt.y = 0; + ClientToScreen( wc->hwnd, &pt ); + OffsetRect(&(wc->rectSurface), pt.x, pt.y); + } +} + + + +/* +* Like PACK_8A8B8G8R() but don't use alpha. This is usually an acceptable +* shortcut. +*/ +#define PACK_8B8G8R( R, G, B ) ( ((B) << 16) | ((G) << 8) | (R) ) + + +/**********************************************************************/ +/*** Triangle rendering ***/ +/**********************************************************************/ + +/* + * XImage, smooth, depth-buffered, PF_8A8B8G8R triangle. + */ +static void smooth_8A8B8G8R_z_triangle( GLcontext *ctx, + GLuint v0, GLuint v1, GLuint v2, + GLuint pv ) +{ + WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; +#define INTERP_Z 1 +#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE +#define INTERP_RGB 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) +#define PIXEL_TYPE GLuint + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; +#define INTERP_Z 1 +#define INTERP_RGB 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) +#define PIXEL_TYPE GLuint + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; +#define INTERP_Z 1 +#define INTERP_RGB 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y) +#define PIXEL_TYPE GLushort + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; +#define INTERP_Z 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) +#define PIXEL_TYPE GLuint + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define SETUP_CODE \ + unsigned long p = PACK_8B8G8R( VB->ColorPtr->data[pv][0], \ + VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; +#define INTERP_Z 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) +#define PIXEL_TYPE GLuint + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define SETUP_CODE \ + unsigned long p = PACK_8R8G8B( VB->ColorPtr->data[pv][0], \ + VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; +#define INTERP_Z 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y) +#define PIXEL_TYPE GLushort + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define SETUP_CODE \ + unsigned long p = PACK_5R6G5B( VB->ColorPtr->data[pv][0], \ + VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; +#define INTERP_RGB 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) +#define PIXEL_TYPE GLuint + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx; \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxDriverCtx; +#define INTERP_RGB 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) +#define PIXEL_TYPE GLuint + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx; \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxDriverCtx; +#define INTERP_RGB 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y) +#define PIXEL_TYPE GLushort + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx; \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxDriverCtx; +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) +#define PIXEL_TYPE GLuint + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define SETUP_CODE \ + unsigned long p = PACK_8B8G8R( VB->ColorPtr->data[pv][0], \ + VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx; \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxDriverCtx; +#define PIXEL_ADDRESS(X,Y) PIXELADDR4(X,Y) +#define PIXEL_TYPE GLuint + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define SETUP_CODE \ + unsigned long p = PACK_8R8G8B( VB->ColorPtr->data[pv][0], \ + VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx; \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxDriverCtx; +#define PIXEL_ADDRESS(X,Y) PIXELADDR2(X,Y) +#define PIXEL_TYPE GLushort + //#define BYTES_PER_ROW (wmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define SETUP_CODE \ + unsigned long p = PACK_5R6G5B( VB->ColorPtr->data[pv][0], \ + VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2] ); +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx; \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxDriverCtx; +#define INTERP_Z 1 +#define INTERP_INDEX 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) +#define PIXEL_TYPE GLubyte +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; +#define INTERP_Z 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) +#define PIXEL_TYPE GLubyte +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define SETUP_CODE \ + GLuint index = VB->IndexPtr->data[pv]; \ + (*ctx->Driver.Index)( ctx, index ); +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; +#define INTERP_Z 1 +#define INTERP_INDEX 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) +#define PIXEL_TYPE GLubyte +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx; \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxDriverCtx; +#define INTERP_Z 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) +#define PIXEL_TYPE GLubyte +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define SETUP_CODE \ + GLuint index = VB->IndexPtr->data[pv]; \ + (*ctx->Driver.Index)( ctx, index ); +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx; \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxDriverCtx; + DITHER_RGB_TO_8BIT_SETUP +#define INTERP_Z 1 +#define INTERP_RGB 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) +#define PIXEL_TYPE GLubyte +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, xx = LEFT, yy = FLIP(Y), len = RIGHT-LEFT; \ + for (i=0;iDriverCtx; + DITHER_RGB_TO_8BIT_SETUP +#define INTERP_Z 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) +#define PIXEL_TYPE GLubyte +#define BYTES_PER_ROW (wmesa->ScanWidth) + +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint i, xx = LEFT, yy = FLIP(Y), len = RIGHT-LEFT; \ + for (i=0;iColorPtr->data[pv][0], \ + VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2], xx, yy); \ + pRow[i] = pixelDithered; \ + zRow[i] = z; \ + } \ + ffz += fdzdx; \ + } \ + } +#ifdef __MINGW32__ + #include "tritemp.h" +#else + + #ifdef WIN32 +// #include "..\tritemp.h" + #else + #include "tritemp.h" + #endif +#endif +} + +/* +* XImage, smooth, NON-depth-buffered, 8-bit PF_DITHER triangle. +*/ +static void smooth_DITHER8_triangle( GLcontext *ctx, GLuint v0, GLuint v1, + GLuint v2, GLuint pv ) +{ + WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; + DITHER_RGB_TO_8BIT_SETUP +#define INTERP_RGB 1 +#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) +#define PIXEL_TYPE GLubyte +#define BYTES_PER_ROW (wmesa->ScanWidth) +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx, yy = FLIP(Y); \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxColorPtr->data[pv][0], VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2], xx, yy);\ + *pixel = pixelDithered; \ + ffr += fdrdx; ffg += fdgdx; ffb += fdbdx; \ + } \ + } +#ifdef __MINGW32__ + #include "tritemp.h" +#else + + #ifdef WIN32 +// #include "..\tritemp.h" + #else + #include "tritemp.h" + #endif +#endif +} + +/* +* XImage, flat, NON-depth-buffered, 8-bit PF_DITHER triangle. +*/ + +static void flat_DITHER8_triangle( GLcontext *ctx, GLuint v0, GLuint v1, + GLuint v2, GLuint pv ) +{ + WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; + DITHER_RGB_TO_8BIT_SETUP +#define PIXEL_ADDRESS(X,Y) PIXELADDR1(X,Y) +#define PIXEL_TYPE GLubyte +#define BYTES_PER_ROW (wmesa->ScanWidth) + +#define INNER_LOOP( LEFT, RIGHT, Y ) \ + { \ + GLint xx, yy = FLIP(Y); \ + PIXEL_TYPE *pixel = pRow; \ + for (xx=LEFT;xxColorPtr->data[pv][0], \ + VB->ColorPtr->data[pv][1], VB->ColorPtr->data[pv][2], xx, yy); \ + *pixel = pixelDithered; \ + } \ + } +#ifdef __MINGW32__ + #include "tritemp.h" +#else + + #ifdef WIN32 +// #include "..\tritemp.h" + #else + #include "tritemp.h" + #endif +#endif +} + + + + +static /*triangle_func*/ choose_triangle_function( GLcontext *ctx ) +{ +#if 0 + WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; + int depth = wmesa->cColorBits; + + if (ctx->Polygon.SmoothFlag) return NULL; + if (ctx->Texture._ReallyEnabled) return NULL; + if (!wmesa->db_flag) return NULL; + /*if (wmesa->xm_buffer->buffer==XIMAGE)*/ { + if ( ctx->Light.ShadeModel==GL_SMOOTH + && ctx->_RasterMask==DEPTH_BIT + && ctx->Depth.Func==GL_LESS + && ctx->Depth.Mask==GL_TRUE + && ctx->Polygon.StippleFlag==GL_FALSE) { + switch (wmesa->pixelformat) { + case PF_8A8B8G8R: + return smooth_8A8B8G8R_z_triangle; + case PF_8R8G8B: + return smooth_8R8G8B_z_triangle; + case PF_5R6G5B: + return smooth_5R6G5B_z_triangle; + case PF_DITHER8: + return smooth_DITHER8_z_triangle; + case PF_INDEX8: + return smooth_ci_z_triangle; + default: + return NULL; + } + } + if ( ctx->Light.ShadeModel==GL_FLAT + && ctx->_RasterMask==DEPTH_BIT + && ctx->Depth.Func==GL_LESS + && ctx->Depth.Mask==GL_TRUE + && ctx->Polygon.StippleFlag==GL_FALSE) { + switch (wmesa->pixelformat) { + case PF_8A8B8G8R: + return flat_8A8B8G8R_z_triangle; + case PF_8R8G8B: + return flat_8R8G8B_z_triangle; + case PF_5R6G5B: + return flat_5R6G5B_z_triangle; + case PF_DITHER8: + return flat_DITHER8_z_triangle; + case PF_INDEX8: + return flat_ci_z_triangle; + default: + return NULL; + } + } + if ( ctx->_RasterMask==0 /* no depth test */ + && ctx->Light.ShadeModel==GL_SMOOTH + && ctx->Polygon.StippleFlag==GL_FALSE) { + switch (wmesa->pixelformat) { + case PF_8A8B8G8R: + return smooth_8A8B8G8R_triangle; + case PF_8R8G8B: + return smooth_8R8G8B_triangle; + case PF_5R6G5B: + return smooth_5R6G5B_triangle; + case PF_DITHER8: + return smooth_DITHER8_triangle; + case PF_INDEX8: + return smooth_ci_triangle; + default: + return NULL; + } + } + + if ( ctx->_RasterMask==0 /* no depth test */ + && ctx->Light.ShadeModel==GL_FLAT + && ctx->Polygon.StippleFlag==GL_FALSE) { + switch (wmesa->pixelformat) { + case PF_8A8B8G8R: + return flat_8A8B8G8R_triangle; + case PF_8R8G8B: + return flat_8R8G8B_triangle; + case PF_5R6G5B: + return flat_5R6G5B_triangle; + case PF_DITHER8: + return flat_DITHER8_triangle; + case PF_INDEX8: + return flat_ci_triangle; + default: + return NULL; + } + } + + return NULL; + } +#endif +} + +/* +* Define a new viewport and reallocate auxillary buffers if the size of +* the window (color buffer) has changed. +*/ +void WMesaViewport( GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height ) +{ +#if 0 + /* Save viewport */ + ctx->Viewport.X = x; + ctx->Viewport.Width = width; + ctx->Viewport.Y = y; + ctx->Viewport.Height = height; + + /* compute scale and bias values */ +/* Pre-Keith 3.1 changes + ctx->Viewport.Map.m[Sx] = (GLfloat) width / 2.0F; + ctx->Viewport.Map.m[Tx] = ctx->Viewport.Sx + x; + ctx->Viewport.Map.m[Sy] = (GLfloat) height / 2.0F; + ctx->Viewport.Map.m[Ty] = ctx->Viewport.Sy + y; +*/ + ctx->Viewport.WindowMap.m[MAT_SX] = (GLfloat) width / 2.0F; + ctx->Viewport.WindowMap.m[MAT_TX] = ctx->Viewport.WindowMap.m[MAT_SX] + x; + ctx->Viewport.WindowMap.m[MAT_SY] = (GLfloat) height / 2.0F; + ctx->Viewport.WindowMap.m[MAT_TY] = ctx->Viewport.WindowMap.m[MAT_SY] + y; +#endif +} diff --git a/src/mesa/main/Makefile.win b/src/mesa/main/Makefile.win index 284a9cb49ea..3b78249ea97 100644 --- a/src/mesa/main/Makefile.win +++ b/src/mesa/main/Makefile.win @@ -1,198 +1,198 @@ -# Makefile for Win32 -# -# NOTE: the install target may overwrite important files in the system dir -# Sept 12, 2001 -# Windows driver not working. OSMesa driver works. -# - -!include - -TOP = .. -SUBDIRS = osmesa.dir - -CORE_SRCS = \ - tnl\t_array_api.c \ - tnl\t_array_import.c \ - tnl\t_context.c \ - tnl\t_eval_api.c \ - tnl\t_imm_alloc.c \ - tnl\t_imm_api.c \ - tnl\t_imm_debug.c \ - tnl\t_imm_dlist.c \ - tnl\t_imm_elt.c \ - tnl\t_imm_eval.c \ - tnl\t_imm_exec.c \ - tnl\t_imm_fixup.c \ - tnl\t_pipeline.c \ - tnl\t_vb_fog.c \ - tnl\t_vb_light.c \ - tnl\t_vb_normals.c \ - tnl\t_vb_points.c \ - tnl\t_vb_render.c \ - tnl\t_vb_texgen.c \ - tnl\t_vb_texmat.c \ - tnl\t_vb_vertex.c \ - swrast_setup\ss_context.c \ - swrast_setup\ss_triangle.c \ - swrast_setup\ss_vb.c \ - api_loopback.c \ - api_noop.c \ - api_validate.c \ - accum.c \ - attrib.c \ - blend.c \ - buffers.c \ - clip.c \ - colortab.c \ - config.c \ - context.c \ - convolve.c \ - debug.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 \ - glthread.c \ - hash.c \ - highpc.c \ - hint.c \ - histogram.c \ - image.c \ - imports.c \ - light.c \ - lines.c \ - lowpc.c \ - matrix.c \ - mem.c \ - mmath.c \ - pixel.c \ - points.c \ - polygon.c \ - rastpos.c \ - state.c \ - stencil.c \ - teximage.c \ - texformat.c \ - texobj.c \ - texstate.c \ - texstore.c \ - texutil.c \ - varray.c \ - vtxfmt.c \ -# X86\x86.c \ -# X86\common_x86.c \ -# X86\3dnow.c \ -# X86\sse.c \ - math\m_debug_norm.c \ - math\m_debug_vertex.c \ - math\m_debug_xform.c \ - math\m_eval.c \ - math\m_matrix.c \ - math\m_translate.c \ - math\m_vector.c \ - math\m_vertices.c \ - math\m_xform.c \ - array_cache\ac_context.c \ - array_cache\ac_import.c \ - swrast\s_aaline.c \ - swrast\s_aatriangle.c \ - swrast\s_accum.c \ - swrast\s_alpha.c \ - swrast\s_alphabuf.c \ - swrast\s_bitmap.c \ - swrast\s_blend.c \ - swrast\s_buffers.c \ - swrast\s_copypix.c \ - swrast\s_context.c \ - swrast\s_depth.c \ - swrast\s_drawpix.c \ - swrast\s_feedback.c \ - swrast\s_fog.c \ - swrast\s_histogram.c \ - swrast\s_imaging.c \ - swrast\s_lines.c \ - swrast\s_logic.c \ - swrast\s_masking.c \ - swrast\s_pb.c \ - swrast\s_pixeltex.c \ - swrast\s_points.c \ - swrast\s_readpix.c \ - swrast\s_scissor.c \ - swrast\s_span.c \ - swrast\s_stencil.c \ - swrast\s_texstore.c \ - swrast\s_texture.c \ - swrast\s_triangle.c \ - swrast\s_zoom.c - -DRIVER_SRCS = \ - Trace\tr_context.c \ - Trace\tr_control.c \ - Trace\tr_error.c \ - Trace\tr_support.c \ - Trace\tr_wrapper.c \ - Trace\tr_write.c \ - Windows\wgl.c \ - Windows\wmesa.c - -ASM_SRCS = - -SRCS = $(CORE_SRCS) $(DRIVER_SRCS) - -all : mesadll $(SUBDIRS) - -!include "$(TOP)/mesawin32.mak" - -mesadll : $(MESADLL) - -CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -DBUILD_GL32 -DNO_PARALLEL -DNO_STEREO -LFLAGS = $(dlllflags) $(LFLAGS) - -OBJS = $(ASM_SRCS:.S=.obj) $(CORE_SRCS:.c=.obj) $(DRIVER_SRCS:.c=.obj) -LIBS = $(GLU) winmm.lib $(guilibsdll) - -$(MESADLL) : $(OBJS) mesa.def - $(link) $(LFLAGS) -out:$(MESADLL) -def:mesa.def $(OBJS) $(LIBS) - @echo "copying Mesa dynamic link library to lib directory..." - -copy $(MESADLL) ..\lib - @echo "copying Mesa import library to lib directory..." - -copy $(MESALIB) ..\lib - -$(SUBDIRS) : - @echo. - @echo Making in $* directory - @cd $* - @nmake -f Makefile.win -nologo - @cd .. - -install : $(MESADLL) - @echo "copying Mesa dynamic link library to system directory..." - -copy $(MESADLL) $(DLLINSTALL) - @echo "copying Mesa header files to include directory..." - -copy ..\..\include\GL\gl.h $(INCLUDEINSTALL) - -copy ..\..\include\GL\glext.h $(INCLUDEINSTALL) - @echo "copying Mesa import library to library directory..." - -copy $(MESALIB) $(LIBINSTALL) - -clean :: - @del /f tnl\*.obj - @del /f swrast_setup\*.obj - @del /f math\*.obj - @del /f array_cache\*.obj - @del /f swrast\*.obj - @del /f Trace\*.obj - @del /f osmesa\*.obj - @del /f Windows\*.obj - -# override default inference rule with one that writes the object to -# the correct subdir -.c.obj : - $(cc) $(CFLAGS) -I. $< /Fo$*.obj +# Makefile for Win32 +# +# NOTE: the install target may overwrite important files in the system dir +# Sept 12, 2001 +# Windows driver not working. OSMesa driver works. +# + +!include + +TOP = .. +SUBDIRS = osmesa.dir + +CORE_SRCS = \ + tnl\t_array_api.c \ + tnl\t_array_import.c \ + tnl\t_context.c \ + tnl\t_eval_api.c \ + tnl\t_imm_alloc.c \ + tnl\t_imm_api.c \ + tnl\t_imm_debug.c \ + tnl\t_imm_dlist.c \ + tnl\t_imm_elt.c \ + tnl\t_imm_eval.c \ + tnl\t_imm_exec.c \ + tnl\t_imm_fixup.c \ + tnl\t_pipeline.c \ + tnl\t_vb_fog.c \ + tnl\t_vb_light.c \ + tnl\t_vb_normals.c \ + tnl\t_vb_points.c \ + tnl\t_vb_render.c \ + tnl\t_vb_texgen.c \ + tnl\t_vb_texmat.c \ + tnl\t_vb_vertex.c \ + swrast_setup\ss_context.c \ + swrast_setup\ss_triangle.c \ + swrast_setup\ss_vb.c \ + api_loopback.c \ + api_noop.c \ + api_validate.c \ + accum.c \ + attrib.c \ + blend.c \ + buffers.c \ + clip.c \ + colortab.c \ + config.c \ + context.c \ + convolve.c \ + debug.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 \ + glthread.c \ + hash.c \ + highpc.c \ + hint.c \ + histogram.c \ + image.c \ + imports.c \ + light.c \ + lines.c \ + lowpc.c \ + matrix.c \ + mem.c \ + mmath.c \ + pixel.c \ + points.c \ + polygon.c \ + rastpos.c \ + state.c \ + stencil.c \ + teximage.c \ + texformat.c \ + texobj.c \ + texstate.c \ + texstore.c \ + texutil.c \ + varray.c \ + vtxfmt.c \ +# X86\x86.c \ +# X86\common_x86.c \ +# X86\3dnow.c \ +# X86\sse.c \ + math\m_debug_norm.c \ + math\m_debug_vertex.c \ + math\m_debug_xform.c \ + math\m_eval.c \ + math\m_matrix.c \ + math\m_translate.c \ + math\m_vector.c \ + math\m_vertices.c \ + math\m_xform.c \ + array_cache\ac_context.c \ + array_cache\ac_import.c \ + swrast\s_aaline.c \ + swrast\s_aatriangle.c \ + swrast\s_accum.c \ + swrast\s_alpha.c \ + swrast\s_alphabuf.c \ + swrast\s_bitmap.c \ + swrast\s_blend.c \ + swrast\s_buffers.c \ + swrast\s_copypix.c \ + swrast\s_context.c \ + swrast\s_depth.c \ + swrast\s_drawpix.c \ + swrast\s_feedback.c \ + swrast\s_fog.c \ + swrast\s_histogram.c \ + swrast\s_imaging.c \ + swrast\s_lines.c \ + swrast\s_logic.c \ + swrast\s_masking.c \ + swrast\s_pb.c \ + swrast\s_pixeltex.c \ + swrast\s_points.c \ + swrast\s_readpix.c \ + swrast\s_scissor.c \ + swrast\s_span.c \ + swrast\s_stencil.c \ + swrast\s_texstore.c \ + swrast\s_texture.c \ + swrast\s_triangle.c \ + swrast\s_zoom.c + +DRIVER_SRCS = \ + Trace\tr_context.c \ + Trace\tr_control.c \ + Trace\tr_error.c \ + Trace\tr_support.c \ + Trace\tr_wrapper.c \ + Trace\tr_write.c \ + Windows\wgl.c \ + Windows\wmesa.c + +ASM_SRCS = + +SRCS = $(CORE_SRCS) $(DRIVER_SRCS) + +all : mesadll $(SUBDIRS) + +!include "$(TOP)/mesawin32.mak" + +mesadll : $(MESADLL) + +CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -DBUILD_GL32 -DNO_PARALLEL -DNO_STEREO +LFLAGS = $(dlllflags) $(LFLAGS) + +OBJS = $(ASM_SRCS:.S=.obj) $(CORE_SRCS:.c=.obj) $(DRIVER_SRCS:.c=.obj) +LIBS = $(GLU) winmm.lib $(guilibsdll) + +$(MESADLL) : $(OBJS) mesa.def + $(link) $(LFLAGS) -out:$(MESADLL) -def:mesa.def $(OBJS) $(LIBS) + @echo "copying Mesa dynamic link library to lib directory..." + -copy $(MESADLL) ..\lib + @echo "copying Mesa import library to lib directory..." + -copy $(MESALIB) ..\lib + +$(SUBDIRS) : + @echo. + @echo Making in $* directory + @cd $* + @nmake -f Makefile.win -nologo + @cd .. + +install : $(MESADLL) + @echo "copying Mesa dynamic link library to system directory..." + -copy $(MESADLL) $(DLLINSTALL) + @echo "copying Mesa header files to include directory..." + -copy ..\..\include\GL\gl.h $(INCLUDEINSTALL) + -copy ..\..\include\GL\glext.h $(INCLUDEINSTALL) + @echo "copying Mesa import library to library directory..." + -copy $(MESALIB) $(LIBINSTALL) + +clean :: + @del /f tnl\*.obj + @del /f swrast_setup\*.obj + @del /f math\*.obj + @del /f array_cache\*.obj + @del /f swrast\*.obj + @del /f Trace\*.obj + @del /f osmesa\*.obj + @del /f Windows\*.obj + +# override default inference rule with one that writes the object to +# the correct subdir +.c.obj : + $(cc) $(CFLAGS) -I. $< /Fo$*.obj diff --git a/src/mesa/main/mesa.def b/src/mesa/main/mesa.def index 0c384210b32..6a5e420734f 100644 --- a/src/mesa/main/mesa.def +++ b/src/mesa/main/mesa.def @@ -1,473 +1,473 @@ -DESCRIPTION 'Mesa (OpenGL work-alike) for Win32' -VERSION 3.5 - -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 - _swsetup_Wakeup - _swsetup_CreateContext - _tnl_CreateContext - _ac_CreateContext - _swrast_CreateContext - _mesa_free_context_data - _mesa_create_framebuffer - _mesa_enable_1_3_extensions - _mesa_enable_sw_extensions - _mesa_destroy_visual - _mesa_initialize_context - _mesa_create_visual - _mesa_destroy_framebuffer - _swrast_DestroyContext - _ac_DestroyContext - _tnl_DestroyContext - _swsetup_DestroyContext - _mesa_Viewport - _mesa_make_current - _mesa_get_current_context - _mesa_error - _swrast_choose_triangle - _mesa_zbuffer_address - _swrast_choose_line - _tnl_InvalidateState - _ac_InvalidateState - _swsetup_InvalidateState - _swrast_InvalidateState - _tnl_run_pipeline - _swrast_CopyConvolutionFilter2D - _swrast_CopyConvolutionFilter1D - _swrast_CopyColorSubTable - _swrast_CopyColorTable - _swrast_copy_texsubimage3d - _swrast_copy_texsubimage2d - _swrast_copy_texsubimage1d - _swrast_copy_teximage2d - _swrast_copy_teximage1d - _mesa_test_proxy_teximage - _mesa_store_texsubimage3d - _mesa_store_texsubimage2d - _mesa_store_texsubimage1d - _mesa_store_teximage3d - _mesa_store_teximage2d - _mesa_store_teximage1d - _mesa_choose_tex_format - _mesa_base_compressed_texformat - _mesa_compressed_texture_size - _mesa_get_compressed_teximage - _swrast_ReadPixels - _swrast_DrawPixels - _swrast_CopyPixels - _swrast_Bitmap - _swrast_Accum - _swrast_alloc_buffers - _swrast_GetDeviceDriverReference - _swrast_Clear - wglCopyContext - wglCreateContext - wglDeleteContext - wglCreateLayerContext - wglGetCurrentContext - wglGetCurrentDC - wglMakeCurrent - wglShareLists - wglUseFontBitmapsA - wglUseFontBitmapsW - wglUseFontOutlinesA - wglUseFontOutlinesW - wglDescribeLayerPlane - wglSetLayerPaletteEntries - wglGetLayerPaletteEntries - wglRealizeLayerPalette - wglSwapLayerBuffers - wglChoosePixelFormat - wglDescribePixelFormat - wglGetProcAddress - wglGetPixelFormat - wglSetPixelFormat - wglSwapBuffers +DESCRIPTION 'Mesa (OpenGL work-alike) for Win32' +VERSION 3.5 + +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 + _swsetup_Wakeup + _swsetup_CreateContext + _tnl_CreateContext + _ac_CreateContext + _swrast_CreateContext + _mesa_free_context_data + _mesa_create_framebuffer + _mesa_enable_1_3_extensions + _mesa_enable_sw_extensions + _mesa_destroy_visual + _mesa_initialize_context + _mesa_create_visual + _mesa_destroy_framebuffer + _swrast_DestroyContext + _ac_DestroyContext + _tnl_DestroyContext + _swsetup_DestroyContext + _mesa_Viewport + _mesa_make_current + _mesa_get_current_context + _mesa_error + _swrast_choose_triangle + _mesa_zbuffer_address + _swrast_choose_line + _tnl_InvalidateState + _ac_InvalidateState + _swsetup_InvalidateState + _swrast_InvalidateState + _tnl_run_pipeline + _swrast_CopyConvolutionFilter2D + _swrast_CopyConvolutionFilter1D + _swrast_CopyColorSubTable + _swrast_CopyColorTable + _swrast_copy_texsubimage3d + _swrast_copy_texsubimage2d + _swrast_copy_texsubimage1d + _swrast_copy_teximage2d + _swrast_copy_teximage1d + _mesa_test_proxy_teximage + _mesa_store_texsubimage3d + _mesa_store_texsubimage2d + _mesa_store_texsubimage1d + _mesa_store_teximage3d + _mesa_store_teximage2d + _mesa_store_teximage1d + _mesa_choose_tex_format + _mesa_base_compressed_texformat + _mesa_compressed_texture_size + _mesa_get_compressed_teximage + _swrast_ReadPixels + _swrast_DrawPixels + _swrast_CopyPixels + _swrast_Bitmap + _swrast_Accum + _swrast_alloc_buffers + _swrast_GetDeviceDriverReference + _swrast_Clear + wglCopyContext + wglCreateContext + wglDeleteContext + wglCreateLayerContext + wglGetCurrentContext + wglGetCurrentDC + wglMakeCurrent + wglShareLists + wglUseFontBitmapsA + wglUseFontBitmapsW + wglUseFontOutlinesA + wglUseFontOutlinesW + wglDescribeLayerPlane + wglSetLayerPaletteEntries + wglGetLayerPaletteEntries + wglRealizeLayerPalette + wglSwapLayerBuffers + wglChoosePixelFormat + wglDescribePixelFormat + wglGetProcAddress + wglGetPixelFormat + wglSetPixelFormat + wglSwapBuffers -- cgit v1.2.3 From 8674e709ee401e0fd69b2108e02af0c9d60c4367 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Thu, 20 Sep 2001 20:47:26 +0000 Subject: Change UnProject4 prototype to use nearVal and farVal instead of near and far because Windows compiler can get confused over these old keywords. --- include/GL/glu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index 4049eed22aa..4de6965c702 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -314,7 +314,7 @@ GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdou GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data); GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data); GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ); -GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble near, GLdouble far, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW); +GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW); #ifdef __cplusplus } -- cgit v1.2.3 From 448b88bb8025f01a497f929d9f077e1ccb6f9836 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Thu, 20 Sep 2001 22:18:47 +0000 Subject: add mangling for new entry points --- include/GL/glu_mangle.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glu_mangle.h b/include/GL/glu_mangle.h index a52b19617cb..6f92f221a5c 100644 --- a/include/GL/glu_mangle.h +++ b/include/GL/glu_mangle.h @@ -1,4 +1,4 @@ -/* $Id: glu_mangle.h,v 1.2 1999/09/10 02:08:19 gareth Exp $ */ +/* $Id: glu_mangle.h,v 1.3 2001/09/20 22:18:47 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -23,6 +23,9 @@ /* * $Log: glu_mangle.h,v $ + * Revision 1.3 2001/09/20 22:18:47 kschultz + * add mangling for new entry points + * * Revision 1.2 1999/09/10 02:08:19 gareth * Added GLU 1.3 tessellation (except winding rule code). * @@ -92,5 +95,11 @@ #define gluNextContour mgluNextContour #define gluEndPolygon mgluEndPolygon #define gluGetString mgluGetString +#define gluBuild1DMipmapLevels mgluBuild1DMipmapLevels +#define gluBuild2DMipmapLevels mgluBuild2DMipmapLevels +#define gluBuild3DMipmapLevels mgluBuild3DMipmapLevels +#define gluBuild3DMipmaps mgluBuild3DMipmaps +#define gluCheckExtension mgluCheckExtension +#define gluUnProject4 mgluUnProject4 #endif -- cgit v1.2.3 From 80d58556922d466620facd5917ada4d3cad612b2 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Thu, 20 Sep 2001 22:19:41 +0000 Subject: add the same conditional mangling stuff that gl.h has. --- include/GL/glu.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index 4de6965c702..54eb836d53c 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -30,6 +30,10 @@ #ifndef __glu_h__ #define __glu_h__ +#if defined(USE_MGL_NAMESPACE) +#include "glu_mangle.h" +#endif + #include #ifdef __cplusplus -- cgit v1.2.3 From 38112f5b60e50cf8ba4cae18034c5ddc90bb2c12 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 21 Sep 2001 17:23:30 +0000 Subject: added __glCoreCreateContext and __glCoreNopDispatch --- include/GL/gl_mangle.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index f801b716c54..e867f49df02 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -1,4 +1,4 @@ -/* $Id: gl_mangle.h,v 1.6 2001/04/19 22:33:03 brianp Exp $ */ +/* $Id: gl_mangle.h,v 1.7 2001/09/21 17:23:30 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -676,4 +676,10 @@ #define glSecondaryColor3usEXT mglSecondaryColor3usEXT #define glSecondaryColor3sEXT mglSecondaryColor3sEXT + +/* Internal symbols which may collide with other OpenGL implementations. */ +#define __glCoreCreateContext __mglCoreCreateContext +#define __glCoreNopDispatch __mglCoreNopDispatch + + #endif -- cgit v1.2.3 From 445e3cbd0dd2a526cb6628975f5351cbab3956a8 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Fri, 21 Sep 2001 20:39:03 +0000 Subject: Add GLAPIENTRY to typedef for callback functions (used by tessellator). This is important now that we're using __stdcall instead of the (default) __cdecl on WIN32. This gets apps using the tessellator working again on Windows. --- include/GL/glu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index 54eb836d53c..0327ac2333d 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -258,7 +258,7 @@ typedef struct GLUtesselator GLUtriangulatorObj; #define GLU_TESS_MAX_COORD 1.0e150 /* Internal convenience typedefs */ -typedef void (*_GLUfuncptr)(); +typedef void (GLAPIENTRY *_GLUfuncptr)(); GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb); GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess); -- cgit v1.2.3 From 78a03d3c455fec1ce5c26edec6016a6806d437b8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 23 Sep 2001 16:06:13 +0000 Subject: bump versions to 4.0 --- include/GL/fxmesa.h | 8 ++++---- include/GL/gl.h | 4 ++-- include/GL/glx.h | 6 +++--- include/GL/osmesa.h | 14 +++++++------- include/GL/svgamesa.h | 8 ++++---- include/GL/uglmesa.h | 4 ++-- include/GL/xmesa.h | 8 ++++---- 7 files changed, 26 insertions(+), 26 deletions(-) (limited to 'include') diff --git a/include/GL/fxmesa.h b/include/GL/fxmesa.h index 329c20bbfc4..60a9b5f99e6 100644 --- a/include/GL/fxmesa.h +++ b/include/GL/fxmesa.h @@ -1,8 +1,8 @@ -/* $Id: fxmesa.h,v 1.3 2001/06/20 19:52:11 brianp Exp $ */ +/* $Id: fxmesa.h,v 1.4 2001/09/23 16:06:13 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.3 + * Version: 4.0 * Copyright (C) 1995-2001 Brian Paul * * This library is free software; you can redistribute it and/or @@ -40,8 +40,8 @@ extern "C" { #endif -#define FXMESA_MAJOR_VERSION 3 -#define FXMESA_MINOR_VERSION 5 +#define FXMESA_MAJOR_VERSION 4 +#define FXMESA_MINOR_VERSION 0 /* diff --git a/include/GL/gl.h b/include/GL/gl.h index 19a0c313b3c..f4cc2a80fa1 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,8 +1,8 @@ -/* $Id: gl.h,v 1.58 2001/08/28 22:49:32 brianp Exp $ */ +/* $Id: gl.h,v 1.59 2001/09/23 16:06:13 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5.1 + * Version: 4.0 * * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * diff --git a/include/GL/glx.h b/include/GL/glx.h index 9d0b60fceaa..9ec15805908 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,10 +1,10 @@ -/* $Id: glx.h,v 1.31 2001/09/14 02:43:04 brianp Exp $ */ +/* $Id: glx.h,v 1.32 2001/09/23 16:06:13 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.0 * - * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 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"), diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h index a002dcdacba..63ce843b682 100644 --- a/include/GL/osmesa.h +++ b/include/GL/osmesa.h @@ -1,8 +1,8 @@ -/* $Id: osmesa.h,v 1.8 2001/08/28 23:12:37 brianp Exp $ */ +/* $Id: osmesa.h,v 1.9 2001/09/23 16:06:13 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5.1 + * Version: 4.0 * * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * @@ -62,9 +62,9 @@ extern "C" { #include -#define OSMESA_MAJOR_VERSION 3 -#define OSMESA_MINOR_VERSION 5 -#define OSMESA_PATCH_VERSION 1 +#define OSMESA_MAJOR_VERSION 4 +#define OSMESA_MINOR_VERSION 0 +#define OSMESA_PATCH_VERSION 0 @@ -96,8 +96,8 @@ extern "C" { #define OSMESA_HEIGHT 0x21 #define OSMESA_FORMAT 0x22 #define OSMESA_TYPE 0x23 -#define OSMESA_MAX_WIDTH 0x24 /* new in 3.5.1 */ -#define OSMESA_MAX_HEIGHT 0x25 /* new in 3.5.1 */ +#define OSMESA_MAX_WIDTH 0x24 /* new in 4.0 */ +#define OSMESA_MAX_HEIGHT 0x25 /* new in 4.0 */ typedef struct osmesa_context *OSMesaContext; diff --git a/include/GL/svgamesa.h b/include/GL/svgamesa.h index 40a9951bce5..775251a05b4 100644 --- a/include/GL/svgamesa.h +++ b/include/GL/svgamesa.h @@ -1,8 +1,8 @@ -/* $Id: svgamesa.h,v 1.5 2001/06/20 19:52:11 brianp Exp $ */ +/* $Id: svgamesa.h,v 1.6 2001/09/23 16:06:13 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.0 * Copyright (C) 1995-2001 Brian Paul * * This library is free software; you can redistribute it and/or @@ -52,8 +52,8 @@ #define SVGAMESA_H -#define SVGAMESA_MAJOR_VERSION 3 -#define SVGAMESA_MINOR_VERSION 5 +#define SVGAMESA_MAJOR_VERSION 4 +#define SVGAMESA_MINOR_VERSION 0 #ifdef __cplusplus diff --git a/include/GL/uglmesa.h b/include/GL/uglmesa.h index a70a0ae9129..7ef5843504e 100644 --- a/include/GL/uglmesa.h +++ b/include/GL/uglmesa.h @@ -4,7 +4,7 @@ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.0 * * The MIT License * Permission is hereby granted, free of charge, to any person obtaining a @@ -38,7 +38,7 @@ extern "C" { #endif -#define UGL_MESA_MAJOR_VERSION 1 +#define UGL_MESA_MAJOR_VERSION 4 #define UGL_MESA_MINOR_VERSION 0 #include diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index b5aa6034734..7e32d0cde8d 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -1,8 +1,8 @@ -/* $Id: xmesa.h,v 1.11 2001/06/20 19:52:11 brianp Exp $ */ +/* $Id: xmesa.h,v 1.12 2001/09/23 16:06:13 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.0 * * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * @@ -89,8 +89,8 @@ extern struct Library *XLibBase; #endif -#define XMESA_MAJOR_VERSION 3 -#define XMESA_MINOR_VERSION 5 +#define XMESA_MAJOR_VERSION 4 +#define XMESA_MINOR_VERSION 0 -- cgit v1.2.3 From 0e94067d0dc4a8d17bfe12e9714d730829d88169 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 24 Sep 2001 14:15:58 +0000 Subject: removed duplicate GLX_AUX_BUFFERS_BIT definition --- include/GL/glx.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 9ec15805908..74e3cc01ab8 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.32 2001/09/23 16:06:13 brianp Exp $ */ +/* $Id: glx.h,v 1.33 2001/09/24 14:15:58 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -141,7 +141,6 @@ extern "C" { #define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 #define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 #define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 -#define GLX_AUX_BUFFERS_BIT 0x00000010 #define GLX_DEPTH_BUFFER_BIT 0x00000020 #define GLX_STENCIL_BUFFER_BIT 0x00000040 #define GLX_ACCUM_BUFFER_BIT 0x00000080 -- cgit v1.2.3 From 3d16c369d9ab3b1f5c7c64b052fc939a3b39e2a0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 17 Oct 2001 13:28:14 +0000 Subject: updated extensions --- include/GL/glext.h | 1498 +++++++++++++++++++++++++++++++++++++++++++++++---- include/GL/glxext.h | 40 +- 2 files changed, 1440 insertions(+), 98 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 14a1de1c2f3..5dbdc1e5fe2 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -13,21 +13,21 @@ extern "C" { ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: This software was created using the ** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has ** not been independently verified as being compliant with the OpenGL(R) @@ -43,10 +43,16 @@ extern "C" { #define APIENTRY #endif +#ifndef GLAPI +#define GLAPI extern +#endif + + /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -#define GL_GLEXT_VERSION 7 +/* glext.h last updated 2001/09/26 */ +#define GL_GLEXT_VERSION 9 #ifndef GL_VERSION_1_2 #define GL_CONSTANT_COLOR 0x8001 @@ -133,11 +139,129 @@ extern "C" { #define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD #define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE #define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 #define GL_CLAMP_TO_EDGE 0x812F #define GL_TEXTURE_MIN_LOD 0x813A #define GL_TEXTURE_MAX_LOD 0x813B #define GL_TEXTURE_BASE_LEVEL 0x813C #define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_IGNORE_BORDER 0x8150 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_WRAP_BORDER 0x8152 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#endif + +#ifndef GL_VERSION_1_3 +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF #endif #ifndef GL_ARB_multitexture @@ -197,6 +321,9 @@ extern "C" { #define GL_MULTISAMPLE_BIT_ARB 0x20000000 #endif +#ifndef GL_ARB_texture_env_add +#endif + #ifndef GL_ARB_texture_cube_map #define GL_NORMAL_MAP_ARB 0x8511 #define GL_REFLECTION_MAP_ARB 0x8512 @@ -226,6 +353,25 @@ extern "C" { #define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 #endif +#ifndef GL_ARB_texture_border_clamp +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif + +#ifndef GL_ARB_point_parameters +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +#endif + #ifndef GL_ARB_vertex_blend #define GL_MAX_VERTEX_UNITS_ARB 0x86A4 #define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 @@ -271,38 +417,52 @@ extern "C" { #define GL_MODELVIEW31_ARB 0x873F #endif +#ifndef GL_ARB_matrix_palette +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 +#endif + #ifndef GL_ARB_texture_env_combine -#define GL_COMBINE_ARB 0x8570 -#define GL_COMBINE_RGB_ARB 0x8571 -#define GL_COMBINE_ALPHA_ARB 0x8572 -#define GL_SOURCE0_RGB_ARB 0x8580 -#define GL_SOURCE1_RGB_ARB 0x8581 -#define GL_SOURCE2_RGB_ARB 0x8582 -#define GL_SOURCE0_ALPHA_ARB 0x8588 -#define GL_SOURCE1_ALPHA_ARB 0x8589 -#define GL_SOURCE2_ALPHA_ARB 0x858A -#define GL_OPERAND0_RGB_ARB 0x8590 -#define GL_OPERAND1_RGB_ARB 0x8591 -#define GL_OPERAND2_RGB_ARB 0x8592 -#define GL_OPERAND0_ALPHA_ARB 0x8598 -#define GL_OPERAND1_ALPHA_ARB 0x8599 -#define GL_OPERAND2_ALPHA_ARB 0x859A -#define GL_RGB_SCALE_ARB 0x8573 -#define GL_ADD_SIGNED_ARB 0x8574 -#define GL_INTERPOLATE_ARB 0x8575 -#define GL_SUBTRACT_ARB 0x84E7 -#define GL_CONSTANT_ARB 0x8576 -#define GL_PRIMARY_COLOR_ARB 0x8577 -#define GL_PREVIOUS_ARB 0x8578 +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif + +#ifndef GL_ARB_texture_env_crossbar #endif #ifndef GL_ARB_texture_env_dot3 #define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGB_EXT 0x86AE #define GL_DOT3_RGBA_ARB 0x86AF -#endif - -#ifndef GL_ARB_texture_border_clamp -#define GL_CLAMP_TO_BORDER_ARB 0x812D +#define GL_DOT3_RGBA_EXT 0x86AF #endif #ifndef GL_EXT_abgr @@ -644,10 +804,6 @@ extern "C" { #define GL_CLAMP_TO_EDGE_SGIS 0x812F #endif -#ifndef GL_SGIS_texture_border_clamp -#define GL_CLAMP_TO_BORDER_SGIS 0x812D -#endif - #ifndef GL_EXT_blend_minmax #define GL_FUNC_ADD_EXT 0x8006 #define GL_MIN_EXT 0x8007 @@ -717,17 +873,6 @@ extern "C" { #define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E #endif -#ifndef GL_SGIS_point_parameters -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MIN_SGIS 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_SIZE_MAX_SGIS 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 -#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 -#endif - #ifndef GL_SGIX_instruments #define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 #define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 @@ -876,14 +1021,6 @@ extern "C" { #define GL_COLOR_INDEX8_EXT 0x80E5 #define GL_COLOR_INDEX12_EXT 0x80E6 #define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 -#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF #define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED #endif @@ -1020,6 +1157,16 @@ extern "C" { #define GL_ALPHA_MAX_SGIX 0x8321 #endif +#ifndef GL_SGIX_impact_pixel_texture +#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 +#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 +#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 +#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 +#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 +#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 +#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A +#endif + #ifndef GL_EXT_bgra #define GL_BGR_EXT 0x80E0 #define GL_BGRA_EXT 0x80E1 @@ -1148,35 +1295,15 @@ extern "C" { #define GL_SOURCE0_RGB_EXT 0x8580 #define GL_SOURCE1_RGB_EXT 0x8581 #define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE3_RGB_EXT 0x8583 -#define GL_SOURCE4_RGB_EXT 0x8584 -#define GL_SOURCE5_RGB_EXT 0x8585 -#define GL_SOURCE6_RGB_EXT 0x8586 -#define GL_SOURCE7_RGB_EXT 0x8587 #define GL_SOURCE0_ALPHA_EXT 0x8588 #define GL_SOURCE1_ALPHA_EXT 0x8589 #define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_SOURCE3_ALPHA_EXT 0x858B -#define GL_SOURCE4_ALPHA_EXT 0x858C -#define GL_SOURCE5_ALPHA_EXT 0x858D -#define GL_SOURCE6_ALPHA_EXT 0x858E -#define GL_SOURCE7_ALPHA_EXT 0x858F #define GL_OPERAND0_RGB_EXT 0x8590 #define GL_OPERAND1_RGB_EXT 0x8591 #define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND3_RGB_EXT 0x8593 -#define GL_OPERAND4_RGB_EXT 0x8594 -#define GL_OPERAND5_RGB_EXT 0x8595 -#define GL_OPERAND6_RGB_EXT 0x8596 -#define GL_OPERAND7_RGB_EXT 0x8597 #define GL_OPERAND0_ALPHA_EXT 0x8598 #define GL_OPERAND1_ALPHA_EXT 0x8599 #define GL_OPERAND2_ALPHA_EXT 0x859A -#define GL_OPERAND3_ALPHA_EXT 0x859B -#define GL_OPERAND4_ALPHA_EXT 0x859C -#define GL_OPERAND5_ALPHA_EXT 0x859D -#define GL_OPERAND6_ALPHA_EXT 0x859E -#define GL_OPERAND7_ALPHA_EXT 0x859F #endif #ifndef GL_APPLE_specular_vector @@ -1203,9 +1330,9 @@ extern "C" { #endif #ifndef GL_SUN_triangle_list -#define GL_RESTART_SUN 0x01 -#define GL_REPLACE_MIDDLE_SUN 0x02 -#define GL_REPLACE_OLDEST_SUN 0x03 +#define GL_RESTART_SUN 0x0001 +#define GL_REPLACE_MIDDLE_SUN 0x0002 +#define GL_REPLACE_OLDEST_SUN 0x0003 #define GL_TRIANGLE_LIST_SUN 0x81D7 #define GL_REPLACEMENT_CODE_SUN 0x81D8 #define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 @@ -1301,7 +1428,7 @@ extern "C" { #define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH #define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 #define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX -#define GL_MODELVIEW_MATRIX1_EXT 0x8506 +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 #define GL_VERTEX_WEIGHTING_EXT 0x8509 #define GL_MODELVIEW0_EXT GL_MODELVIEW #define GL_MODELVIEW1_EXT 0x850A @@ -1502,6 +1629,7 @@ extern "C" { #define GL_SAMPLE_MASK_VALUE_EXT 0x80AA #define GL_SAMPLE_MASK_INVERT_EXT 0x80AB #define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 #endif #ifndef GL_SGIX_vertex_preclip @@ -1536,9 +1664,529 @@ extern "C" { #define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF #endif -#ifndef GL_EXT_texture_env_dot3 -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 +#ifndef GL_NV_fence +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +#endif + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_IBM 0x8370 +#endif + +#ifndef GL_NV_evaluators +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 +#endif + +#ifndef GL_NV_texture_compression_vtc +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_TEXTURE_RECTANGLE_SIZE_NV 0x84F8 +#endif + +#ifndef GL_NV_texture_shader +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 +#endif + +#ifndef GL_NV_vertex_program +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SCALEBIAS_HINT_SGIX 0x8322 +#endif + +#ifndef GL_OML_interlace +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 +#endif + +#ifndef GL_OML_subsample +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 +#endif + +#ifndef GL_OML_resample +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_REG_6_ATI 0x8927 +#define GL_REG_7_ATI 0x8928 +#define GL_REG_8_ATI 0x8929 +#define GL_REG_9_ATI 0x892A +#define GL_REG_10_ATI 0x892B +#define GL_REG_11_ATI 0x892C +#define GL_REG_12_ATI 0x892D +#define GL_REG_13_ATI 0x892E +#define GL_REG_14_ATI 0x892F +#define GL_REG_15_ATI 0x8930 +#define GL_REG_16_ATI 0x8931 +#define GL_REG_17_ATI 0x8932 +#define GL_REG_18_ATI 0x8933 +#define GL_REG_19_ATI 0x8934 +#define GL_REG_20_ATI 0x8935 +#define GL_REG_21_ATI 0x8936 +#define GL_REG_22_ATI 0x8937 +#define GL_REG_23_ATI 0x8938 +#define GL_REG_24_ATI 0x8939 +#define GL_REG_25_ATI 0x893A +#define GL_REG_26_ATI 0x893B +#define GL_REG_27_ATI 0x893C +#define GL_REG_28_ATI 0x893D +#define GL_REG_29_ATI 0x893E +#define GL_REG_30_ATI 0x893F +#define GL_REG_31_ATI 0x8940 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_CON_8_ATI 0x8949 +#define GL_CON_9_ATI 0x894A +#define GL_CON_10_ATI 0x894B +#define GL_CON_11_ATI 0x894C +#define GL_CON_12_ATI 0x894D +#define GL_CON_13_ATI 0x894E +#define GL_CON_14_ATI 0x894F +#define GL_CON_15_ATI 0x8950 +#define GL_CON_16_ATI 0x8951 +#define GL_CON_17_ATI 0x8952 +#define GL_CON_18_ATI 0x8953 +#define GL_CON_19_ATI 0x8954 +#define GL_CON_20_ATI 0x8955 +#define GL_CON_21_ATI 0x8956 +#define GL_CON_22_ATI 0x8957 +#define GL_CON_23_ATI 0x8958 +#define GL_CON_24_ATI 0x8959 +#define GL_CON_25_ATI 0x895A +#define GL_CON_26_ATI 0x895B +#define GL_CON_27_ATI 0x895C +#define GL_CON_28_ATI 0x895D +#define GL_CON_29_ATI 0x895E +#define GL_CON_30_ATI 0x895F +#define GL_CON_31_ATI 0x8960 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B +#define GL_RED_BIT_ATI 0x00000001 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INARIANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGEXTVE_X_EXT 0x87D9 +#define GL_NEGEXTVE_Y_EXT 0x87DA +#define GL_NEGEXTVE_Z_EXT 0x87DB +#define GL_NEGEXTVE_W_EXT 0x87DC +#define GL_NEGEXTVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_STREAM0_ATI 0x876C +#define GL_VERTEX_STREAM1_ATI 0x876D +#define GL_VERTEX_STREAM2_ATI 0x876E +#define GL_VERTEX_STREAM3_ATI 0x876F +#define GL_VERTEX_STREAM4_ATI 0x8770 +#define GL_VERTEX_STREAM5_ATI 0x8771 +#define GL_VERTEX_STREAM6_ATI 0x8772 +#define GL_VERTEX_STREAM7_ATI 0x8773 +#define GL_VERTEX_SOURCE_ATI 0x8774 #endif @@ -1626,6 +2274,104 @@ typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GL typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); #endif +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTexture (GLenum); +GLAPI void APIENTRY glClientActiveTexture (GLenum); +GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint); +GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort); +GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *); +GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *); +GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *); +GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *); +GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *); +GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean); +GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, void *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img); +#endif + #ifndef GL_ARB_multitexture #define GL_ARB_multitexture 1 #ifdef GL_GLEXT_PROTOTYPES @@ -1718,10 +2464,8 @@ typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); #define GL_ARB_multisample 1 #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePassARB (GLenum); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRY * PFNGLSAMPLEPASSARBPROC) (GLenum pass); #endif #ifndef GL_ARB_texture_env_add @@ -1752,16 +2496,66 @@ typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GL typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img); #endif +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *); +GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *); +GLAPI void APIENTRY glWeightivARB (GLint, const GLint *); +GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *); +GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *); +GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *); +GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *); +GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *); +GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexBlendARB (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); +typedef void (APIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); +typedef void (APIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); +typedef void (APIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); +typedef void (APIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); +typedef void (APIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); +typedef void (APIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); +typedef void (APIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); +typedef void (APIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint); +GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *); +GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *); +GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *); +GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (APIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); +typedef void (APIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); +typedef void (APIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); +typedef void (APIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + #ifndef GL_ARB_texture_env_combine #define GL_ARB_texture_env_combine 1 #endif +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 +#endif + #ifndef GL_ARB_texture_env_dot3 #define GL_ARB_texture_env_dot3 1 #endif -#ifndef GL_ARB_texture_border_clamp -#define GL_ARB_texture_border_clamp 1 +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 #endif #ifndef GL_EXT_blend_color @@ -2110,14 +2904,18 @@ typedef void (APIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GL #define GL_SGIX_texture_multi_buffer 1 #endif -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 #ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); typedef void (APIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); typedef void (APIENTRY * PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); @@ -2200,10 +2998,10 @@ typedef void (APIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); #define GL_SGIS_fog_function 1 #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetFogFuncSGIS (const GLfloat *); +GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); -typedef void (APIENTRY * PFNGLGETFOGFUNCSGISPROC) (const GLfloat *points); +typedef void (APIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); #endif #ifndef GL_SGIX_fog_offset @@ -2533,7 +3331,7 @@ GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); -GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, GLvoid *); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); @@ -2551,7 +3349,7 @@ typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint gree typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); #endif #ifndef GL_EXT_texture_perturb_normal @@ -2798,8 +3596,10 @@ typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3F #define GL_EXT_blend_func_separate 1 #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); #endif #ifndef GL_INGR_color_clamp @@ -2861,7 +3661,7 @@ GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (APIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei size, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); #endif #ifndef GL_NV_register_combiners @@ -3052,8 +3852,8 @@ typedef void (APIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean inve typedef void (APIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); #endif -#ifndef GL_SGI_vertex_preclip -#define GL_SGI_vertex_preclip 1 +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 #endif #ifndef GL_SGIX_convolution_accuracy @@ -3084,8 +3884,514 @@ GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); typedef void (APIENTRY * PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); #endif -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); +GLAPI GLboolean APIENTRY glTestFenceNV (GLuint); +GLAPI void APIENTRY glFinishFenceNV (GLuint); +GLAPI GLboolean APIENTRY glIsFenceNV (GLuint); +GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef void (APIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +typedef GLboolean (APIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (APIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef GLboolean (APIENTRY * PFNGLISFENCENVPROC) (GLuint fence); +typedef void (APIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +#endif + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *); +GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *); +GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +typedef void (APIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +typedef void (APIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 +#endif + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 +#endif + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint); +GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *); +GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *); +GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgramNV (GLuint); +GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *); +GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *); +GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum); +GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); +typedef void (APIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *ids); +typedef GLboolean (APIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *ids, GLboolean *residences); +typedef void (APIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); +typedef void (APIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (APIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint num, const GLdouble *params); +typedef void (APIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint num, const GLfloat *params); +typedef void (APIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (APIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte *v); +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 +#endif + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 +#endif + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 +#endif + +#ifndef GL_OML_resample +#define GL_OML_resample 1 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *); +GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *); +GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); +typedef void (APIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); +typedef void (APIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (APIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint); +GLAPI void APIENTRY glBindFragmentShaderATI (GLuint); +GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint); +GLAPI void APIENTRY glBeginFragmentShaderATI (void); +GLAPI void APIENTRY glEndFragmentShaderATI (void); +GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum); +GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum); +GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (APIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (APIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (APIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRY * PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRY * PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint); +GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum); +GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint); +GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum); +GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glDeleteObjectBufferATI (GLuint); +GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); +typedef GLboolean (APIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +typedef void (APIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLDELETEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVertexShaderEXT (void); +GLAPI void APIENTRY glEndVertexShaderEXT (void); +GLAPI void APIENTRY glBindVertexShaderEXT (GLuint); +GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint); +GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint); +GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint); +GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint); +GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const void *); +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const void *); +GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *); +GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *); +GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *); +GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *); +GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *); +GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *); +GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const void *); +GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint); +GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint); +GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum); +GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindParameterEXT (GLenum); +GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum); +GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *); +GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef GLuint (APIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (APIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (APIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (APIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (APIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (APIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef void (APIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (APIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +typedef void (APIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const void *addr); +typedef void (APIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const void *addr); +typedef void (APIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); +typedef void (APIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); +typedef void (APIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); +typedef void (APIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); +typedef void (APIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); +typedef void (APIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); +typedef void (APIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); +typedef void (APIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); +typedef void (APIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const void *addr); +typedef void (APIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (APIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef GLuint (APIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (APIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (APIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (APIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef GLuint (APIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLboolean (APIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (APIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); +typedef void (APIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexStream1s (GLenum, GLshort); +GLAPI void APIENTRY glVertexStream1sv (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream1i (GLenum, GLint); +GLAPI void APIENTRY glVertexStream1iv (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream1f (GLenum, GLfloat); +GLAPI void APIENTRY glVertexStream1fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream1d (GLenum, GLdouble); +GLAPI void APIENTRY glVertexStream1dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream2s (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream2sv (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream2i (GLenum, GLint, GLint); +GLAPI void APIENTRY glVertexStream2iv (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream2f (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream2fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream2d (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream2dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream3s (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream3sv (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream3i (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream3iv (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream3f (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream3fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream3d (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream3dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream4s (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream4sv (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream4i (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream4iv (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream4fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream4dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glNormalStream3b (GLenum, GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glNormalStream3bv (GLenum, const GLbyte *); +GLAPI void APIENTRY glNormalStream3s (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glNormalStream3sv (GLenum, const GLshort *); +GLAPI void APIENTRY glNormalStream3i (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glNormalStream3iv (GLenum, const GLint *); +GLAPI void APIENTRY glNormalStream3f (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormalStream3fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glNormalStream3d (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glNormalStream3dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glClientActiveVertexStream (GLenum); +GLAPI void APIENTRY glVertexBlendEnvi (GLenum, GLint); +GLAPI void APIENTRY glVertexBlendEnvf (GLenum, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLVERTEXSTREAM1SPROC) (GLenum stream, GLshort x); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1SVPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1IPROC) (GLenum stream, GLint x); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1IVPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1FPROC) (GLenum stream, GLfloat x); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1FVPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1DPROC) (GLenum stream, GLdouble x); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1DVPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2SPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2SVPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2IPROC) (GLenum stream, GLint x, GLint y); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2IVPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2FPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2FVPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2DPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2DVPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3SPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3SVPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3IPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3IVPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3FPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3FVPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3DPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3DVPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4SPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4SVPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4IPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4IVPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4FPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4FVPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4DPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4DVPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRY * PFNGLNORMALSTREAM3BPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +typedef void (APIENTRY * PFNGLNORMALSTREAM3BVPROC) (GLenum stream, const GLbyte *coords); +typedef void (APIENTRY * PFNGLNORMALSTREAM3SPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +typedef void (APIENTRY * PFNGLNORMALSTREAM3SVPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRY * PFNGLNORMALSTREAM3IPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); +typedef void (APIENTRY * PFNGLNORMALSTREAM3IVPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRY * PFNGLNORMALSTREAM3FPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +typedef void (APIENTRY * PFNGLNORMALSTREAM3FVPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRY * PFNGLNORMALSTREAM3DPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +typedef void (APIENTRY * PFNGLNORMALSTREAM3DVPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMPROC) (GLenum stream); +typedef void (APIENTRY * PFNGLVERTEXBLENDENVIPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLVERTEXBLENDENVFPROC) (GLenum pname, GLfloat param); #endif diff --git a/include/GL/glxext.h b/include/GL/glxext.h index 93c2c9d4bdb..33bbc441d77 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -46,7 +46,8 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -#define GLX_GLXEXT_VERSION 2 +/* glxext.h last updated 2001/09/26 */ +#define GLX_GLXEXT_VERSION 3 #ifndef GLX_VERSION_1_3 #define GLX_WINDOW_BIT 0x00000001 @@ -107,7 +108,16 @@ extern "C" { #define GLX_PBUFFER_WIDTH 0x8041 #endif -/* XXX Added by BrianP */ +#ifndef GLX_VERSION_1_4 +#define GLX_SAMPLE_BUFFERS 100000 +#define GLX_SAMPLES 100001 +#endif + +#ifndef GLX_ARB_multisample +#define GLX_SAMPLE_BUFFERS_ARB 100000 +#define GLX_SAMPLES_ARB 100001 +#endif + #ifndef GLX_SGIS_multisample #define GLX_SAMPLE_BUFFERS_SGIS 100000 #define GLX_SAMPLES_SGIS 100001 @@ -248,6 +258,20 @@ extern "C" { #define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 #endif +#ifndef GLX_SGIX_visual_select_group +#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 +#endif + +#ifndef GLX_OML_swap_method +#define GLX_SWAP_METHOD_OML 0x8060 +#define GLX_SWAP_EXCHANGE_OML 0x8061 +#define GLX_SWAP_COPY_OML 0x8062 +#define GLX_SWAP_UNDEFINED_OML 0x8063 +#endif + +#ifndef GLX_OML_sync_control +#endif + /*************************************************************/ @@ -526,6 +550,18 @@ extern Bool glXSet3DfxModeMESA (int); typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode); #endif +#ifndef GLX_SGIX_visual_select_group +#define GLX_SGIX_visual_select_group 1 +#endif + +#ifndef GLX_GLX_OML_swap_method +#define GLX_GLX_OML_swap_method 1 +#endif + +#ifndef GLX_GLX_OML_sync_control +#define GLX_GLX_OML_sync_control 1 +#endif + #ifdef __cplusplus } -- cgit v1.2.3 From fe9b705a2c420d921e2acdd0f581fe4d71aeb593 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 9 Nov 2001 21:54:30 +0000 Subject: define GL_VERSION_1_3 (doh!) --- include/GL/gl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index f4cc2a80fa1..93c3dc44317 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.59 2001/09/23 16:06:13 brianp Exp $ */ +/* $Id: gl.h,v 1.60 2001/11/09 21:54:30 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -84,7 +84,7 @@ extern "C" { #define GL_VERSION_1_1 1 #define GL_VERSION_1_2 1 -/*#define GL_VERSION_1_3 1 not yet */ +#define GL_VERSION_1_3 1 #define GL_ARB_imaging 1 -- cgit v1.2.3 From 853a4abab2c1fa16c5bdacdb9b904588f6b0173b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 9 Nov 2001 22:00:53 +0000 Subject: added 1.3 function manglers --- include/GL/gl_mangle.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index e867f49df02..07e148689f9 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -1,8 +1,8 @@ -/* $Id: gl_mangle.h,v 1.7 2001/09/21 17:23:30 brianp Exp $ */ +/* $Id: gl_mangle.h,v 1.8 2001/11/09 22:00:53 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 4.0.1 * * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * @@ -676,6 +676,54 @@ #define glSecondaryColor3usEXT mglSecondaryColor3usEXT #define glSecondaryColor3sEXT mglSecondaryColor3sEXT +/* 1.3 */ +#define glActiveTexture mglActiveTexture +#define glClientActiveTexture mglClientActiveTexture +#define glSampleCoverage mglSampleCoverage +#define glSamplePass mglSamplePass +#define glMultTransposeMatrixf mglMultTransposeMatrixf +#define glMultTransposeMatrixd mglMultTransposeMatrixd +#define glLoadTransposeMatrixf mglLoadTransposeMatrixf +#define glLoadTransposeMatrixd mglLoadTransposeMatrixd +#define glGetCompressedTexImage mglGetCompressedTexImage +#define glCompressedTexSubImage3D mglCompressedTexSubImage3D +#define glCompressedTexSubImage2D mglCompressedTexSubImage2D +#define glCompressedTexSubImage1D mglCompressedTexSubImage1D +#define glCompressedTexImage3D mglCompressedTexImage3D +#define glCompressedTexImage2D mglCompressedTexImage2D +#define glMultiTexCoord1d mglMultiTexCoord1d +#define glMultiTexCoord1dv mglMultiTexCoord1dv +#define glMultiTexCoord1f mglMultiTexCoord1f +#define glMultiTexCoord1fv mglMultiTexCoord1fv +#define glMultiTexCoord1i mglMultiTexCoord1i +#define glMultiTexCoord1iv mglMultiTexCoord1iv +#define glMultiTexCoord1s mglMultiTexCoord1s +#define glMultiTexCoord1sv mglMultiTexCoord1sv +#define glMultiTexCoord2d mglMultiTexCoord2d +#define glMultiTexCoord2dv mglMultiTexCoord2dv +#define glMultiTexCoord2f mglMultiTexCoord2f +#define glMultiTexCoord2fv mglMultiTexCoord2fv +#define glMultiTexCoord2i mglMultiTexCoord2i +#define glMultiTexCoord2iv mglMultiTexCoord2iv +#define glMultiTexCoord2s mglMultiTexCoord2s +#define glMultiTexCoord2sv mglMultiTexCoord2sv +#define glMultiTexCoord3d mglMultiTexCoord3d +#define glMultiTexCoord3dv mglMultiTexCoord3dv +#define glMultiTexCoord3f mglMultiTexCoord3f +#define glMultiTexCoord3fv mglMultiTexCoord3fv +#define glMultiTexCoord3i mglMultiTexCoord3i +#define glMultiTexCoord3iv mglMultiTexCoord3iv +#define glMultiTexCoord3s mglMultiTexCoord3s +#define glMultiTexCoord3sv mglMultiTexCoord3sv +#define glMultiTexCoord4d mglMultiTexCoord4d +#define glMultiTexCoord4dv mglMultiTexCoord4dv +#define glMultiTexCoord4f mglMultiTexCoord4f +#define glMultiTexCoord4fv mglMultiTexCoord4fv +#define glMultiTexCoord4i mglMultiTexCoord4i +#define glMultiTexCoord4iv mglMultiTexCoord4iv +#define glMultiTexCoord4s mglMultiTexCoord4s +#define glMultiTexCoord4sv mglMultiTexCoord4sv + /* Internal symbols which may collide with other OpenGL implementations. */ #define __glCoreCreateContext __mglCoreCreateContext -- cgit v1.2.3 From c32fe22168f9879d8f91e3bb65750821639f5bc7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 9 Nov 2001 22:01:02 +0000 Subject: added GLX 1.4 function manglers --- include/GL/glx_mangle.h | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'include') diff --git a/include/GL/glx_mangle.h b/include/GL/glx_mangle.h index e246801f78c..da96d2003fe 100644 --- a/include/GL/glx_mangle.h +++ b/include/GL/glx_mangle.h @@ -1,8 +1,8 @@ -/* $Id: glx_mangle.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ +/* $Id: glx_mangle.h,v 1.2 2001/11/09 22:01:02 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.0 + * Version: 4.1 * Copyright (C) 1995-1998 Brian Paul * * This library is free software; you can redistribute it and/or @@ -21,25 +21,6 @@ */ -/* - * $Log: glx_mangle.h,v $ - * Revision 1.1 1999/08/19 00:55:40 jtg - * Initial revision - * - * Revision 3.3 1999/06/21 22:01:00 brianp - * added #ifndef GLX_MANGLE_H stuff, video sync extension functions - * - * Revision 3.2 1998/03/26 02:44:53 brianp - * removed ^M characters - * - * Revision 3.1 1998/03/17 02:41:19 brianp - * updated by Randy Frank - * - * Revision 3.0 1998/02/20 05:04:45 brianp - * initial rev - * - */ - #ifndef GLX_MANGLE_H #define GLX_MANGLE_H @@ -69,4 +50,8 @@ #define glXGetVideoSyncSGI mglXGetVideoSyncSGI #define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI +/* GLX 1.4 */ +#define glXGetProcAddress mglXGetProcAddress + + #endif -- cgit v1.2.3 From cd060fc3b44fb41629b5da640f10c3aa3e3c8cfd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 9 Nov 2001 22:04:24 +0000 Subject: fix typedef problem found with MSDev 6.0 --- include/GL/glu.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index 0327ac2333d..36bd7c1398f 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -250,10 +250,10 @@ typedef struct GLUquadric GLUquadric; typedef struct GLUtesselator GLUtesselator; #endif -typedef struct GLUnurbs GLUnurbsObj; -typedef struct GLUquadric GLUquadricObj; -typedef struct GLUtesselator GLUtesselatorObj; -typedef struct GLUtesselator GLUtriangulatorObj; +typedef GLUnurbs GLUnurbsObj; +typedef GLUquadric GLUquadricObj; +typedef GLUtesselator GLUtesselatorObj; +typedef GLUtesselator GLUtriangulatorObj; #define GLU_TESS_MAX_COORD 1.0e150 -- cgit v1.2.3 From 199b931c071dfeb03a036765ae0f316dd7236a33 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 18 Nov 2001 22:16:07 +0000 Subject: added missing const to glXGetContextIDEXT() prototype --- include/GL/glxext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glxext.h b/include/GL/glxext.h index 33bbc441d77..e61ad526f74 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -413,7 +413,7 @@ typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSou #ifdef GLX_GLXEXT_PROTOTYPES extern Display * glXGetCurrentDisplayEXT (void); extern int glXQueryContextInfoEXT (Display *, GLXContext, int, int *); -extern GLXContextID glXGetContextIDEXT (GLXContext); +extern GLXContextID glXGetContextIDEXT (const GLXContext); extern GLXContext glXImportContextEXT (Display *, GLXContextID); extern void glXFreeContextEXT (Display *, GLXContext); #endif /* GLX_GLXEXT_PROTOTYPES */ -- cgit v1.2.3 From 50c31d6861369400d5ebcdcc19ca44e4579cd70b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 19 Nov 2001 00:13:45 +0000 Subject: added test implementation of GL_ARB_window_pos --- include/GL/gl.h | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 93c3dc44317..d3fc223cbf6 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.60 2001/11/09 21:54:30 brianp Exp $ */ +/* $Id: gl.h,v 1.61 2001/11/19 00:13:45 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1685,7 +1685,7 @@ GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ); GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level, - GLenum internalFormat, + GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, @@ -2499,6 +2499,45 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid #endif +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 + +/* XXX not finalized yet - just testing */ +GLAPI void GLAPIENTRY glWindowPos2dARB(GLdouble x, GLdouble y); + +GLAPI void GLAPIENTRY glWindowPos2fARB(GLfloat x, GLfloat y); + +GLAPI void GLAPIENTRY glWindowPos2iARB(GLint x, GLint y); + +GLAPI void GLAPIENTRY glWindowPos2sARB(GLshort x, GLshort y); + +GLAPI void GLAPIENTRY glWindowPos2dvARB(const GLdouble *p); + +GLAPI void GLAPIENTRY glWindowPos2fvARB(const GLfloat *p); + +GLAPI void GLAPIENTRY glWindowPos2ivARB(const GLint *p); + +GLAPI void GLAPIENTRY glWindowPos2svARB(const GLshort *p); + +GLAPI void GLAPIENTRY glWindowPos3dARB(GLdouble x, GLdouble y, GLdouble z); + +GLAPI void GLAPIENTRY glWindowPos3fARB(GLfloat x, GLfloat y, GLfloat z); + +GLAPI void GLAPIENTRY glWindowPos3iARB(GLint x, GLint y, GLint z); + +GLAPI void GLAPIENTRY glWindowPos3sARB(GLshort x, GLshort y, GLshort z); + +GLAPI void GLAPIENTRY glWindowPos3dvARB(const GLdouble *p); + +GLAPI void GLAPIENTRY glWindowPos3fvARB(const GLfloat *p); + +GLAPI void GLAPIENTRY glWindowPos3ivARB(const GLint *p); + +GLAPI void GLAPIENTRY glWindowPos3svARB(const GLshort *p); + +#endif /* GL_ARB_window_pos */ + + /********************************************************************** * Begin system-specific stuff */ -- cgit v1.2.3 From 74df2ef732abba668ca784190617023419c0b965 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 5 Dec 2001 22:01:13 +0000 Subject: added enums for GL_ARB_depth_texture/shadow/shadow_ambient (temporary) --- include/GL/gl.h | 58 +++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 20 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index d3fc223cbf6..9c3a9768629 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.61 2001/11/19 00:13:45 brianp Exp $ */ +/* $Id: gl.h,v 1.62 2001/12/05 22:01:13 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -504,8 +504,6 @@ typedef double GLclampd; /* double precision float in [0,1] */ /* Evaluators */ #define GL_AUTO_NORMAL 0x0D80 #define GL_MAP1_COLOR_4 0x0D90 -#define GL_MAP1_GRID_DOMAIN 0x0DD0 -#define GL_MAP1_GRID_SEGMENTS 0x0DD1 #define GL_MAP1_INDEX 0x0D91 #define GL_MAP1_NORMAL 0x0D92 #define GL_MAP1_TEXTURE_COORD_1 0x0D93 @@ -515,8 +513,6 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_MAP1_VERTEX_3 0x0D97 #define GL_MAP1_VERTEX_4 0x0D98 #define GL_MAP2_COLOR_4 0x0DB0 -#define GL_MAP2_GRID_DOMAIN 0x0DD2 -#define GL_MAP2_GRID_SEGMENTS 0x0DD3 #define GL_MAP2_INDEX 0x0DB1 #define GL_MAP2_NORMAL 0x0DB2 #define GL_MAP2_TEXTURE_COORD_1 0x0DB3 @@ -525,6 +521,10 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_MAP2_TEXTURE_COORD_4 0x0DB6 #define GL_MAP2_VERTEX_3 0x0DB7 #define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 #define GL_COEFF 0x0A00 #define GL_DOMAIN 0x0A02 #define GL_ORDER 0x0A01 @@ -2504,40 +2504,58 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid /* XXX not finalized yet - just testing */ GLAPI void GLAPIENTRY glWindowPos2dARB(GLdouble x, GLdouble y); - GLAPI void GLAPIENTRY glWindowPos2fARB(GLfloat x, GLfloat y); - GLAPI void GLAPIENTRY glWindowPos2iARB(GLint x, GLint y); - GLAPI void GLAPIENTRY glWindowPos2sARB(GLshort x, GLshort y); - GLAPI void GLAPIENTRY glWindowPos2dvARB(const GLdouble *p); - GLAPI void GLAPIENTRY glWindowPos2fvARB(const GLfloat *p); - GLAPI void GLAPIENTRY glWindowPos2ivARB(const GLint *p); - GLAPI void GLAPIENTRY glWindowPos2svARB(const GLshort *p); - GLAPI void GLAPIENTRY glWindowPos3dARB(GLdouble x, GLdouble y, GLdouble z); - GLAPI void GLAPIENTRY glWindowPos3fARB(GLfloat x, GLfloat y, GLfloat z); - GLAPI void GLAPIENTRY glWindowPos3iARB(GLint x, GLint y, GLint z); - GLAPI void GLAPIENTRY glWindowPos3sARB(GLshort x, GLshort y, GLshort z); - GLAPI void GLAPIENTRY glWindowPos3dvARB(const GLdouble *p); - GLAPI void GLAPIENTRY glWindowPos3fvARB(const GLfloat *p); - GLAPI void GLAPIENTRY glWindowPos3ivARB(const GLint *p); - GLAPI void GLAPIENTRY glWindowPos3svARB(const GLshort *p); #endif /* GL_ARB_window_pos */ +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 + +/* XXX not finalized yet - just testing */ +#define GL_TEXTURE_COMPARE_MODE_ARB 0x9990 +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x9991 +#define GL_TEXTURE_COMPARE_RESULT_ARB 0x9992 +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x9993 + +#endif + + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 + +/* XXX not finalized yet - just testing */ +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF + +#endif + + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 + +/* XXX not finalized yet - just testing */ +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 + +#endif + + + /********************************************************************** * Begin system-specific stuff */ -- cgit v1.2.3 From d313068dc8b655b0e992a1f1c3e259b034d11269 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Thu, 13 Dec 2001 19:15:58 +0000 Subject: Added missing entry points --- include/GL/gl_mangle.h | 78 +++++++++++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 33 deletions(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 07e148689f9..4347f495c6a 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -1,4 +1,4 @@ -/* $Id: gl_mangle.h,v 1.8 2001/11/09 22:00:53 brianp Exp $ */ +/* $Id: gl_mangle.h,v 1.9 2001/12/13 19:15:58 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -557,6 +557,7 @@ #define glFogCoordPointerEXT mglFogCoordPointerEXT #define glFogCoorddEXT mglFogCoorddEXT #define glFogCoordfvEXT mglFogCoordfvEXT +#define glFogCoorddvEXT mglFogCoorddvEXT #define glFogCoordfEXT mglFogCoordfEXT #define glLightEnviSGIX mglLightEnviSGIX #define glGetFragmentMaterialivSGIX mglGetFragmentMaterialivSGIX @@ -616,6 +617,9 @@ #define glGetPixelTexGenParameterfvSGIS mglGetPixelTexGenParameterfvSGIS #define glPixelTexGenParameteriSGIS mglPixelTexGenParameteriSGIS #define glPixelTexGenParameterfSGIS mglPixelTexGenParameterfSGIS +#define glPixelTexGenParameterivSGIS mglPixelTexGenParameterivSGIS +#define glPixelTexGenParameterfvSGIS mglPixelTexGenParameterfvSGIS +#define glPixelTexGenSGIX mglPixelTexGenSGIX #define glGetColorTableParameterivSGI mglGetColorTableParameterivSGI #define glGetColorTableParameterfvSGI mglGetColorTableParameterfvSGI #define glGetColorTableSGI mglGetColorTableSGI @@ -686,43 +690,51 @@ #define glLoadTransposeMatrixf mglLoadTransposeMatrixf #define glLoadTransposeMatrixd mglLoadTransposeMatrixd #define glGetCompressedTexImage mglGetCompressedTexImage +#define glGetCompressedTexImageARB mglGetCompressedTexImageARB #define glCompressedTexSubImage3D mglCompressedTexSubImage3D #define glCompressedTexSubImage2D mglCompressedTexSubImage2D #define glCompressedTexSubImage1D mglCompressedTexSubImage1D #define glCompressedTexImage3D mglCompressedTexImage3D #define glCompressedTexImage2D mglCompressedTexImage2D -#define glMultiTexCoord1d mglMultiTexCoord1d -#define glMultiTexCoord1dv mglMultiTexCoord1dv -#define glMultiTexCoord1f mglMultiTexCoord1f -#define glMultiTexCoord1fv mglMultiTexCoord1fv -#define glMultiTexCoord1i mglMultiTexCoord1i -#define glMultiTexCoord1iv mglMultiTexCoord1iv -#define glMultiTexCoord1s mglMultiTexCoord1s -#define glMultiTexCoord1sv mglMultiTexCoord1sv -#define glMultiTexCoord2d mglMultiTexCoord2d -#define glMultiTexCoord2dv mglMultiTexCoord2dv -#define glMultiTexCoord2f mglMultiTexCoord2f -#define glMultiTexCoord2fv mglMultiTexCoord2fv -#define glMultiTexCoord2i mglMultiTexCoord2i -#define glMultiTexCoord2iv mglMultiTexCoord2iv -#define glMultiTexCoord2s mglMultiTexCoord2s -#define glMultiTexCoord2sv mglMultiTexCoord2sv -#define glMultiTexCoord3d mglMultiTexCoord3d -#define glMultiTexCoord3dv mglMultiTexCoord3dv -#define glMultiTexCoord3f mglMultiTexCoord3f -#define glMultiTexCoord3fv mglMultiTexCoord3fv -#define glMultiTexCoord3i mglMultiTexCoord3i -#define glMultiTexCoord3iv mglMultiTexCoord3iv -#define glMultiTexCoord3s mglMultiTexCoord3s -#define glMultiTexCoord3sv mglMultiTexCoord3sv -#define glMultiTexCoord4d mglMultiTexCoord4d -#define glMultiTexCoord4dv mglMultiTexCoord4dv -#define glMultiTexCoord4f mglMultiTexCoord4f -#define glMultiTexCoord4fv mglMultiTexCoord4fv -#define glMultiTexCoord4i mglMultiTexCoord4i -#define glMultiTexCoord4iv mglMultiTexCoord4iv -#define glMultiTexCoord4s mglMultiTexCoord4s -#define glMultiTexCoord4sv mglMultiTexCoord4sv +#define glCompressedTexImage1D mglCompressedTexImage1D +#define glCompressedTexSubImage3DARB mglCompressedTexSubImage3DARB +#define glCompressedTexSubImage2DARB mglCompressedTexSubImage2DARB +#define glCompressedTexSubImage1DARB mglCompressedTexSubImage1DARB +#define glCompressedTexImage3DARB mglCompressedTexImage3DARB +#define glCompressedTexImage2DARB mglCompressedTexImage2DARB +#define glCompressedTexImage1DARB mglCompressedTexImage1DARB +#define glMultiTexCoord1d mglMultiTexCoord1d +#define glMultiTexCoord1dv mglMultiTexCoord1dv +#define glMultiTexCoord1f mglMultiTexCoord1f +#define glMultiTexCoord1fv mglMultiTexCoord1fv +#define glMultiTexCoord1i mglMultiTexCoord1i +#define glMultiTexCoord1iv mglMultiTexCoord1iv +#define glMultiTexCoord1s mglMultiTexCoord1s +#define glMultiTexCoord1sv mglMultiTexCoord1sv +#define glMultiTexCoord2d mglMultiTexCoord2d +#define glMultiTexCoord2dv mglMultiTexCoord2dv +#define glMultiTexCoord2f mglMultiTexCoord2f +#define glMultiTexCoord2fv mglMultiTexCoord2fv +#define glMultiTexCoord2i mglMultiTexCoord2i +#define glMultiTexCoord2iv mglMultiTexCoord2iv +#define glMultiTexCoord2s mglMultiTexCoord2s +#define glMultiTexCoord2sv mglMultiTexCoord2sv +#define glMultiTexCoord3d mglMultiTexCoord3d +#define glMultiTexCoord3dv mglMultiTexCoord3dv +#define glMultiTexCoord3f mglMultiTexCoord3f +#define glMultiTexCoord3fv mglMultiTexCoord3fv +#define glMultiTexCoord3i mglMultiTexCoord3i +#define glMultiTexCoord3iv mglMultiTexCoord3iv +#define glMultiTexCoord3s mglMultiTexCoord3s +#define glMultiTexCoord3sv mglMultiTexCoord3sv +#define glMultiTexCoord4d mglMultiTexCoord4d +#define glMultiTexCoord4dv mglMultiTexCoord4dv +#define glMultiTexCoord4f mglMultiTexCoord4f +#define glMultiTexCoord4fv mglMultiTexCoord4fv +#define glMultiTexCoord4i mglMultiTexCoord4i +#define glMultiTexCoord4iv mglMultiTexCoord4iv +#define glMultiTexCoord4s mglMultiTexCoord4s +#define glMultiTexCoord4sv mglMultiTexCoord4sv /* Internal symbols which may collide with other OpenGL implementations. */ -- cgit v1.2.3 From b70f5c21e713d9df0a1fcd4c6871f80caabdaace Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 14 Dec 2001 03:18:08 +0000 Subject: added GLX_SAMPLE_BUFFERS, GLX_SAMPLES --- include/GL/glx.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 74e3cc01ab8..89c474d4abd 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,8 +1,8 @@ -/* $Id: glx.h,v 1.33 2001/09/24 14:15:58 brianp Exp $ */ +/* $Id: glx.h,v 1.34 2001/12/14 03:18:08 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 4.0 + * Version: 4.1 * * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * @@ -172,8 +172,8 @@ extern "C" { /* * GLX 1.4 and later: */ -#define GLX_SAMPLE_BUFFERS_SGIS 100000 -#define GLX_SAMPLES_SGIS 100001 +#define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/ +#define GLX_SAMPLES 0x816a1 /*100001*/ -- cgit v1.2.3 From eaf0eac7d327468a617a64820e1f41279eef1a8d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 14 Dec 2001 03:19:06 +0000 Subject: oops, wrong value for GLX_SAMPLES --- include/GL/glx.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 89c474d4abd..e19937f8bb3 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.34 2001/12/14 03:18:08 brianp Exp $ */ +/* $Id: glx.h,v 1.35 2001/12/14 03:19:06 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -173,7 +173,7 @@ extern "C" { * GLX 1.4 and later: */ #define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/ -#define GLX_SAMPLES 0x816a1 /*100001*/ +#define GLX_SAMPLES 0x186a1 /*100001*/ -- cgit v1.2.3 From 9958ace40144f01b2428d87610789422b7c7f029 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 16 Jan 2002 23:51:09 +0000 Subject: new gl_mangle.h with korn shell script to regenerate itself from gl.h and glext.h (Ray Tice) --- include/GL/gl_mangle.h | 1771 ++++++++++++++++++++++++++++-------------------- 1 file changed, 1043 insertions(+), 728 deletions(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 4347f495c6a..42f36dcbe43 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -1,745 +1,1060 @@ -/* $Id: gl_mangle.h,v 1.9 2001/12/13 19:15:58 kschultz Exp $ */ +#if 0 /* $Id: gl_mangle.h,v 1.10 2002/01/16 23:51:09 brianp Exp $ */ + # DO NOT EDIT!!! - TO REGENERATE from gl.h, EXECUTE THIS FILE IN KORN SHELL and save the output + # $Id: gl_mangle.h,v 1.10 2002/01/16 23:51:09 brianp Exp $ + # This file is used to create GL function protypes and aliases for the function names -/* - * Mesa 3-D graphics library - * Version: 4.0.1 - * - * Copyright (C) 1999-2001 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. - */ + files="gl.h glext.h" + #get regeneration header - everything in this file above the "REGENERATE_TO_END" line + awk 'BEGIN {copy=1} + copy==1 + /^\/\*REGENERATE_TO_END/ {copy=0} + ' $0 + echo "\n" + #get aliases + grep '^GLAPI' $files | sed -e 's/.*ENTRY gl\([^( ]*\).*$/#define gl\1 MANGLE(\1)/' | sort | uniq + echo "\n#endif /* GL_MANGLE_H */" + exit +#endif /* REGENERATION */ /* * 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) + * Mgl contributed by Randy Frank (rfrank@rsinc.com) + * Regneration code contributed by Ray Tice (rayt@ma.ultra.net) */ #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 -#define glGetFinalCombinerInputParameterivNV mglGetFinalCombinerInputParameterivNV -#define glGetFinalCombinerInputParameterfvNV mglGetFinalCombinerInputParameterfvNV -#define glGetCombinerOutputParameterivNV mglGetCombinerOutputParameterivNV -#define glGetCombinerOutputParameterfvNV mglGetCombinerOutputParameterfvNV -#define glGetCombinerInputParameterivNV mglGetCombinerInputParameterivNV -#define glGetCombinerInputParameterfvNV mglGetCombinerInputParameterfvNV -#define glFinalCombinerInputNV mglFinalCombinerInputNV -#define glCombinerOutputNV mglCombinerOutputNV -#define glCombinerInputNV mglCombinerInputNV -#define glCombinerParameteriNV mglCombinerParameteriNV -#define glCombinerParameterivNV mglCombinerParameterivNV -#define glCombinerParameterfNV mglCombinerParameterfNV -#define glCombinerParameterfvNV mglCombinerParameterfvNV -#define glVertexArrayRangeNV mglVertexArrayRangeNV -#define glFlushVertexArrayRangeNV mglFlushVertexArrayRangeNV -#define glVertexWeightPointerEXT mglVertexWeightPointerEXT -#define glVertexWeightfvEXT mglVertexWeightfvEXT -#define glVertexWeightfEXT mglVertexWeightfEXT -#define glBlendFuncSeparateEXT mglBlendFuncSeparateEXT -#define glFogCoordPointerEXT mglFogCoordPointerEXT -#define glFogCoorddEXT mglFogCoorddEXT -#define glFogCoordfvEXT mglFogCoordfvEXT -#define glFogCoorddvEXT mglFogCoorddvEXT -#define glFogCoordfEXT mglFogCoordfEXT -#define glLightEnviSGIX mglLightEnviSGIX -#define glGetFragmentMaterialivSGIX mglGetFragmentMaterialivSGIX -#define glGetFragmentMaterialfvSGIX mglGetFragmentMaterialfvSGIX -#define glGetFragmentLightivSGIX mglGetFragmentLightivSGIX -#define glGetFragmentLightfvSGIX mglGetFragmentLightfvSGIX -#define glFragmentMaterialivSGIX mglFragmentMaterialivSGIX -#define glFragmentMaterialiSGIX mglFragmentMaterialiSGIX -#define glFragmentMaterialfvSGIX mglFragmentMaterialfvSGIX -#define glFragmentMaterialfSGIX mglFragmentMaterialfSGIX -#define glFragmentLightModelivSGIX mglFragmentLightModelivSGIX -#define glFragmentLightModeliSGIX mglFragmentLightModeliSGIX -#define glFragmentLightModelfvSGIX mglFragmentLightModelfvSGIX -#define glFragmentLightModelfSGIX mglFragmentLightModelfSGIX -#define glFragmentLightivSGIX mglFragmentLightivSGIX -#define glFragmentLightiSGIX mglFragmentLightiSGIX -#define glFragmentLightfvSGIX mglFragmentLightfvSGIX -#define glFragmentLightfSGIX mglFragmentLightfSGIX -#define glFragmentColorMaterialSGIX mglFragmentColorMaterialSGIX -#define glCullParameterdvEXT mglCullParameterdvEXT -#define glCullParameterfvEXT mglCullParameterfvEXT -#define glIndexFuncEXT mglIndexFuncEXT -#define glIndexMaterialEXT mglIndexMaterialEXT -#define glListParameterivSGIX mglListParameterivSGIX -#define glListParameteriSGIX mglListParameteriSGIX -#define glListParameterfvSGIX mglListParameterfvSGIX -#define glListParameterfSGIX mglListParameterfSGIX -#define glGetListParameterivSGIX mglGetListParameterivSGIX -#define glGetListParameterfvSGIX mglGetListParameterfvSGIX -#define glHintPGI mglHintPGI -#define glCopyColorSubTableEXT mglCopyColorSubTableEXT -#define glFlushRasterSGIX mglFlushRasterSGIX -#define glReferencePlaneSGIX mglReferencePlaneSGIX -#define glTagSampleBufferSGIX mglTagSampleBufferSGIX -#define glFrameZoomSGIX mglFrameZoomSGIX -#define glGetInstrumentsSGIX mglGetInstrumentsSGIX -#define glPollInstrumentsSGIX mglPollInstrumentsSGIX -#define glReadInstrumentsSGIX mglReadInstrumentsSGIX -#define glStopInstrumentsSGIX mglStopInstrumentsSGIX -#define glStartInstrumentsSGIX mglStartInstrumentsSGIX -#define glInstrumentsBufferSGIX mglInstrumentsBufferSGIX -#define glPointParameterfvSGIS mglPointParameterfvSGIS -#define glPointParameterfSGIS mglPointParameterfSGIS -#define glSpriteParameterivSGIX mglSpriteParameterivSGIX -#define glSpriteParameteriSGIX mglSpriteParameteriSGIX -#define glSpriteParameterfvSGIX mglSpriteParameterfvSGIX -#define glSpriteParameterfSGIX mglSpriteParameterfSGIX -#define glSamplePatternSGIS mglSamplePatternSGIS -#define glSampleMaskSGIS mglSampleMaskSGIS -#define glSharpenTexFuncSGIS mglSharpenTexFuncSGIS -#define glGetSharpenTexFuncSGIS mglGetSharpenTexFuncSGIS -#define glGetDetailTexFuncSGIS mglGetDetailTexFuncSGIS -#define glDetailTexFuncSGIS mglDetailTexFuncSGIS -#define glTexSubImage4DSGIS mglTexSubImage4DSGIS -#define glTexImage4DSGIS mglTexImage4DSGIS -#define glGetPixelTexGenParameterivSGIS mglGetPixelTexGenParameterivSGIS -#define glGetPixelTexGenParameterfvSGIS mglGetPixelTexGenParameterfvSGIS -#define glPixelTexGenParameteriSGIS mglPixelTexGenParameteriSGIS -#define glPixelTexGenParameterfSGIS mglPixelTexGenParameterfSGIS -#define glPixelTexGenParameterivSGIS mglPixelTexGenParameterivSGIS -#define glPixelTexGenParameterfvSGIS mglPixelTexGenParameterfvSGIS -#define glPixelTexGenSGIX mglPixelTexGenSGIX -#define glGetColorTableParameterivSGI mglGetColorTableParameterivSGI -#define glGetColorTableParameterfvSGI mglGetColorTableParameterfvSGI -#define glGetColorTableSGI mglGetColorTableSGI -#define glCopyColorTableSGI mglCopyColorTableSGI -#define glColorTableParameterivSGI mglColorTableParameterivSGI -#define glColorTableParameterfvSGI mglColorTableParameterfvSGI -#define glColorTableSGI mglColorTableSGI -#define glSeparableFilter2DEXT mglSeparableFilter2DEXT -#define glGetSeparableFilterEXT mglGetSeparableFilterEXT -#define glGetConvolutionParameterfvEXT mglGetConvolutionParameterfvEXT -#define glGetConvolutionParameterivEXT mglGetConvolutionParameterivEXT -#define glGetConvolutionFilterEXT mglGetConvolutionFilterEXT -#define glCopyConvolutionFilter2DEXT mglCopyConvolutionFilter2DEXT -#define glCopyConvolutionFilter1DEXT mglCopyConvolutionFilter1DEXT -#define glConvolutionParameterivEXT mglConvolutionParameterivEXT -#define glConvolutionParameteriEXT mglConvolutionParameteriEXT -#define glConvolutionParameterfvEXT mglConvolutionParameterfvEXT -#define glConvolutionParameterfEXT mglConvolutionParameterfEXT -#define glConvolutionFilter2DEXT mglConvolutionFilter2DEXT -#define glConvolutionFilter1DEXT mglConvolutionFilter1DEXT -#define glResetMinmaxEXT mglResetMinmaxEXT -#define glResetHistogramEXT mglResetHistogramEXT -#define glMinmaxEXT mglMinmaxEXT -#define glHistogramEXT mglHistogramEXT -#define glGetMinmaxParameterivEXT mglGetMinmaxParameterivEXT -#define glGetMinmaxParameterfvEXT mglGetMinmaxParameterfvEXT -#define glGetMinmaxEXT mglGetMinmaxEXT -#define glGetHistogramParameterivEXT mglGetHistogramParameterivEXT -#define glGetHistogramParameterfvEXT mglGetHistogramParameterfvEXT -#define glGetHistogramEXT mglGetHistogramEXT -#define glCopyTexSubImage2DEXT mglCopyTexSubImage2DEXT -#define glCopyTexSubImage1DEXT mglCopyTexSubImage1DEXT -#define glCopyTexImage2DEXT mglCopyTexImage2DEXT -#define glCopyTexImage1DEXT mglCopyTexImage1DEXT -#define glTexSubImage2DEXT mglTexSubImage2DEXT -#define glTexSubImage1DEXT mglTexSubImage1DEXT -#define glSampleCoverageARB mglSampleCoverageARB -#define glSamplePassARB mglSamplePassARB -#define glMultTransposeMatrixfARB mglMultTransposeMatrixfARB -#define glMultTransposeMatrixdARB mglMultTransposeMatrixdARB -#define glLoadTransposeMatrixfARB mglLoadTransposeMatrixfARB -#define glLoadTransposeMatrixdARB mglLoadTransposeMatrixdARB -#define glSecondaryColor3fEXT mglSecondaryColor3fEXT -#define glSecondaryColor3ubEXT mglSecondaryColor3ubEXT -#define glSecondaryColor3uivEXT mglSecondaryColor3uivEXT -#define glSecondaryColor3ubvEXT mglSecondaryColor3ubvEXT -#define glSecondaryColor3svEXT mglSecondaryColor3svEXT -#define glSecondaryColor3ivEXT mglSecondaryColor3ivEXT -#define glSecondaryColor3fvEXT mglSecondaryColor3fvEXT -#define glSecondaryColor3dvEXT mglSecondaryColor3dvEXT -#define glSecondaryColor3bvEXT mglSecondaryColor3bvEXT -#define glSecondaryColor3usvEXT mglSecondaryColor3usvEXT -#define glSecondaryColorPointerEXT mglSecondaryColorPointerEXT -#define glSecondaryColor3iEXT mglSecondaryColor3iEXT -#define glSecondaryColor3dEXT mglSecondaryColor3dEXT -#define glSecondaryColor3bEXT mglSecondaryColor3bEXT -#define glSecondaryColor3uiEXT mglSecondaryColor3uiEXT -#define glSecondaryColor3usEXT mglSecondaryColor3usEXT -#define glSecondaryColor3sEXT mglSecondaryColor3sEXT - -/* 1.3 */ -#define glActiveTexture mglActiveTexture -#define glClientActiveTexture mglClientActiveTexture -#define glSampleCoverage mglSampleCoverage -#define glSamplePass mglSamplePass -#define glMultTransposeMatrixf mglMultTransposeMatrixf -#define glMultTransposeMatrixd mglMultTransposeMatrixd -#define glLoadTransposeMatrixf mglLoadTransposeMatrixf -#define glLoadTransposeMatrixd mglLoadTransposeMatrixd -#define glGetCompressedTexImage mglGetCompressedTexImage -#define glGetCompressedTexImageARB mglGetCompressedTexImageARB -#define glCompressedTexSubImage3D mglCompressedTexSubImage3D -#define glCompressedTexSubImage2D mglCompressedTexSubImage2D -#define glCompressedTexSubImage1D mglCompressedTexSubImage1D -#define glCompressedTexImage3D mglCompressedTexImage3D -#define glCompressedTexImage2D mglCompressedTexImage2D -#define glCompressedTexImage1D mglCompressedTexImage1D -#define glCompressedTexSubImage3DARB mglCompressedTexSubImage3DARB -#define glCompressedTexSubImage2DARB mglCompressedTexSubImage2DARB -#define glCompressedTexSubImage1DARB mglCompressedTexSubImage1DARB -#define glCompressedTexImage3DARB mglCompressedTexImage3DARB -#define glCompressedTexImage2DARB mglCompressedTexImage2DARB -#define glCompressedTexImage1DARB mglCompressedTexImage1DARB -#define glMultiTexCoord1d mglMultiTexCoord1d -#define glMultiTexCoord1dv mglMultiTexCoord1dv -#define glMultiTexCoord1f mglMultiTexCoord1f -#define glMultiTexCoord1fv mglMultiTexCoord1fv -#define glMultiTexCoord1i mglMultiTexCoord1i -#define glMultiTexCoord1iv mglMultiTexCoord1iv -#define glMultiTexCoord1s mglMultiTexCoord1s -#define glMultiTexCoord1sv mglMultiTexCoord1sv -#define glMultiTexCoord2d mglMultiTexCoord2d -#define glMultiTexCoord2dv mglMultiTexCoord2dv -#define glMultiTexCoord2f mglMultiTexCoord2f -#define glMultiTexCoord2fv mglMultiTexCoord2fv -#define glMultiTexCoord2i mglMultiTexCoord2i -#define glMultiTexCoord2iv mglMultiTexCoord2iv -#define glMultiTexCoord2s mglMultiTexCoord2s -#define glMultiTexCoord2sv mglMultiTexCoord2sv -#define glMultiTexCoord3d mglMultiTexCoord3d -#define glMultiTexCoord3dv mglMultiTexCoord3dv -#define glMultiTexCoord3f mglMultiTexCoord3f -#define glMultiTexCoord3fv mglMultiTexCoord3fv -#define glMultiTexCoord3i mglMultiTexCoord3i -#define glMultiTexCoord3iv mglMultiTexCoord3iv -#define glMultiTexCoord3s mglMultiTexCoord3s -#define glMultiTexCoord3sv mglMultiTexCoord3sv -#define glMultiTexCoord4d mglMultiTexCoord4d -#define glMultiTexCoord4dv mglMultiTexCoord4dv -#define glMultiTexCoord4f mglMultiTexCoord4f -#define glMultiTexCoord4fv mglMultiTexCoord4fv -#define glMultiTexCoord4i mglMultiTexCoord4i -#define glMultiTexCoord4iv mglMultiTexCoord4iv -#define glMultiTexCoord4s mglMultiTexCoord4s -#define glMultiTexCoord4sv mglMultiTexCoord4sv - +#ifndef MANGLE +#define MANGLE(x) mgl##x +#endif /*MANGLE*/ /* Internal symbols which may collide with other OpenGL implementations. */ #define __glCoreCreateContext __mglCoreCreateContext -#define __glCoreNopDispatch __mglCoreNopDispatch +#define __glCoreNopDispatch __mglCoreNopDispatch + +/*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */ + +#define glAccum MANGLE(Accum) +#define glActiveTexture MANGLE(ActiveTexture) +#define glActiveTextureARB MANGLE(ActiveTextureARB) +#define glAlphaFragmentOp1ATI MANGLE(AlphaFragmentOp1ATI) +#define glAlphaFragmentOp2ATI MANGLE(AlphaFragmentOp2ATI) +#define glAlphaFragmentOp3ATI MANGLE(AlphaFragmentOp3ATI) +#define glAlphaFunc MANGLE(AlphaFunc) +#define glApplyTextureEXT MANGLE(ApplyTextureEXT) +#define glAreProgramsResidentNV MANGLE(AreProgramsResidentNV) +#define glAreTexturesResident MANGLE(AreTexturesResident) +#define glAreTexturesResidentEXT MANGLE(AreTexturesResidentEXT) +#define glArrayElement MANGLE(ArrayElement) +#define glArrayElementEXT MANGLE(ArrayElementEXT) +#define glArrayObjectATI MANGLE(ArrayObjectATI) +#define glAsyncMarkerSGIX MANGLE(AsyncMarkerSGIX) +#define glBegin MANGLE(Begin) +#define glBeginFragmentShaderATI MANGLE(BeginFragmentShaderATI) +#define glBeginVertexShaderEXT MANGLE(BeginVertexShaderEXT) +#define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI) +#define glBindLightParameterEXT MANGLE(BindLightParameterEXT) +#define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT) +#define glBindParameterEXT MANGLE(BindParameterEXT) +#define glBindProgramNV MANGLE(BindProgramNV) +#define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT) +#define glBindTexture MANGLE(BindTexture) +#define glBindTextureEXT MANGLE(BindTextureEXT) +#define glBindTextureUnitParameterEXT MANGLE(BindTextureUnitParameterEXT) +#define glBindVertexShaderEXT MANGLE(BindVertexShaderEXT) +#define glBinormal3bEXT MANGLE(Binormal3bEXT) +#define glBinormal3bvEXT MANGLE(Binormal3bvEXT) +#define glBinormal3dEXT MANGLE(Binormal3dEXT) +#define glBinormal3dvEXT MANGLE(Binormal3dvEXT) +#define glBinormal3fEXT MANGLE(Binormal3fEXT) +#define glBinormal3fvEXT MANGLE(Binormal3fvEXT) +#define glBinormal3iEXT MANGLE(Binormal3iEXT) +#define glBinormal3ivEXT MANGLE(Binormal3ivEXT) +#define glBinormal3sEXT MANGLE(Binormal3sEXT) +#define glBinormal3svEXT MANGLE(Binormal3svEXT) +#define glBinormalPointerEXT MANGLE(BinormalPointerEXT) +#define glBitmap MANGLE(Bitmap) +#define glBlendColor MANGLE(BlendColor) +#define glBlendColorEXT MANGLE(BlendColorEXT) +#define glBlendEquation MANGLE(BlendEquation) +#define glBlendEquationEXT MANGLE(BlendEquationEXT) +#define glBlendFunc MANGLE(BlendFunc) +#define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT) +#define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR) +#define glCallList MANGLE(CallList) +#define glCallLists MANGLE(CallLists) +#define glClear MANGLE(Clear) +#define glClearAccum MANGLE(ClearAccum) +#define glClearColor MANGLE(ClearColor) +#define glClearDepth MANGLE(ClearDepth) +#define glClearIndex MANGLE(ClearIndex) +#define glClearStencil MANGLE(ClearStencil) +#define glClientActiveTexture MANGLE(ClientActiveTexture) +#define glClientActiveTextureARB MANGLE(ClientActiveTextureARB) +#define glClientActiveVertexStream MANGLE(ClientActiveVertexStream) +#define glClipPlane MANGLE(ClipPlane) +#define glColor3b MANGLE(Color3b) +#define glColor3bv MANGLE(Color3bv) +#define glColor3d MANGLE(Color3d) +#define glColor3dv MANGLE(Color3dv) +#define glColor3f MANGLE(Color3f) +#define glColor3fVertex3fSUN MANGLE(Color3fVertex3fSUN) +#define glColor3fVertex3fvSUN MANGLE(Color3fVertex3fvSUN) +#define glColor3fv MANGLE(Color3fv) +#define glColor3i MANGLE(Color3i) +#define glColor3iv MANGLE(Color3iv) +#define glColor3s MANGLE(Color3s) +#define glColor3sv MANGLE(Color3sv) +#define glColor3ub MANGLE(Color3ub) +#define glColor3ubv MANGLE(Color3ubv) +#define glColor3ui MANGLE(Color3ui) +#define glColor3uiv MANGLE(Color3uiv) +#define glColor3us MANGLE(Color3us) +#define glColor3usv MANGLE(Color3usv) +#define glColor4b MANGLE(Color4b) +#define glColor4bv MANGLE(Color4bv) +#define glColor4d MANGLE(Color4d) +#define glColor4dv MANGLE(Color4dv) +#define glColor4f MANGLE(Color4f) +#define glColor4fNormal3fVertex3fSUN MANGLE(Color4fNormal3fVertex3fSUN) +#define glColor4fNormal3fVertex3fvSUN MANGLE(Color4fNormal3fVertex3fvSUN) +#define glColor4fv MANGLE(Color4fv) +#define glColor4i MANGLE(Color4i) +#define glColor4iv MANGLE(Color4iv) +#define glColor4s MANGLE(Color4s) +#define glColor4sv MANGLE(Color4sv) +#define glColor4ub MANGLE(Color4ub) +#define glColor4ubVertex2fSUN MANGLE(Color4ubVertex2fSUN) +#define glColor4ubVertex2fvSUN MANGLE(Color4ubVertex2fvSUN) +#define glColor4ubVertex3fSUN MANGLE(Color4ubVertex3fSUN) +#define glColor4ubVertex3fvSUN MANGLE(Color4ubVertex3fvSUN) +#define glColor4ubv MANGLE(Color4ubv) +#define glColor4ui MANGLE(Color4ui) +#define glColor4uiv MANGLE(Color4uiv) +#define glColor4us MANGLE(Color4us) +#define glColor4usv MANGLE(Color4usv) +#define glColorFragmentOp1ATI MANGLE(ColorFragmentOp1ATI) +#define glColorFragmentOp2ATI MANGLE(ColorFragmentOp2ATI) +#define glColorFragmentOp3ATI MANGLE(ColorFragmentOp3ATI) +#define glColorMask MANGLE(ColorMask) +#define glColorMaterial MANGLE(ColorMaterial) +#define glColorPointer MANGLE(ColorPointer) +#define glColorPointerEXT MANGLE(ColorPointerEXT) +#define glColorPointerListIBM MANGLE(ColorPointerListIBM) +#define glColorPointervINTEL MANGLE(ColorPointervINTEL) +#define glColorSubTable MANGLE(ColorSubTable) +#define glColorSubTableEXT MANGLE(ColorSubTableEXT) +#define glColorTable MANGLE(ColorTable) +#define glColorTableEXT MANGLE(ColorTableEXT) +#define glColorTableParameterfv MANGLE(ColorTableParameterfv) +#define glColorTableParameterfvSGI MANGLE(ColorTableParameterfvSGI) +#define glColorTableParameteriv MANGLE(ColorTableParameteriv) +#define glColorTableParameterivSGI MANGLE(ColorTableParameterivSGI) +#define glColorTableSGI MANGLE(ColorTableSGI) +#define glCombinerInputNV MANGLE(CombinerInputNV) +#define glCombinerOutputNV MANGLE(CombinerOutputNV) +#define glCombinerParameterfNV MANGLE(CombinerParameterfNV) +#define glCombinerParameterfvNV MANGLE(CombinerParameterfvNV) +#define glCombinerParameteriNV MANGLE(CombinerParameteriNV) +#define glCombinerParameterivNV MANGLE(CombinerParameterivNV) +#define glCombinerStageParameterfvNV MANGLE(CombinerStageParameterfvNV) +#define glCompressedTexImage1D MANGLE(CompressedTexImage1D) +#define glCompressedTexImage1DARB MANGLE(CompressedTexImage1DARB) +#define glCompressedTexImage2D MANGLE(CompressedTexImage2D) +#define glCompressedTexImage2DARB MANGLE(CompressedTexImage2DARB) +#define glCompressedTexImage3D MANGLE(CompressedTexImage3D) +#define glCompressedTexImage3DARB MANGLE(CompressedTexImage3DARB) +#define glCompressedTexSubImage1D MANGLE(CompressedTexSubImage1D) +#define glCompressedTexSubImage1DARB MANGLE(CompressedTexSubImage1DARB) +#define glCompressedTexSubImage2D MANGLE(CompressedTexSubImage2D) +#define glCompressedTexSubImage2DARB MANGLE(CompressedTexSubImage2DARB) +#define glCompressedTexSubImage3D MANGLE(CompressedTexSubImage3D) +#define glCompressedTexSubImage3DARB MANGLE(CompressedTexSubImage3DARB) +#define glConvolutionFilter1D MANGLE(ConvolutionFilter1D) +#define glConvolutionFilter1DEXT MANGLE(ConvolutionFilter1DEXT) +#define glConvolutionFilter2D MANGLE(ConvolutionFilter2D) +#define glConvolutionFilter2DEXT MANGLE(ConvolutionFilter2DEXT) +#define glConvolutionParameterf MANGLE(ConvolutionParameterf) +#define glConvolutionParameterfEXT MANGLE(ConvolutionParameterfEXT) +#define glConvolutionParameterfv MANGLE(ConvolutionParameterfv) +#define glConvolutionParameterfvEXT MANGLE(ConvolutionParameterfvEXT) +#define glConvolutionParameteri MANGLE(ConvolutionParameteri) +#define glConvolutionParameteriEXT MANGLE(ConvolutionParameteriEXT) +#define glConvolutionParameteriv MANGLE(ConvolutionParameteriv) +#define glConvolutionParameterivEXT MANGLE(ConvolutionParameterivEXT) +#define glCopyColorSubTable MANGLE(CopyColorSubTable) +#define glCopyColorSubTableEXT MANGLE(CopyColorSubTableEXT) +#define glCopyColorTable MANGLE(CopyColorTable) +#define glCopyColorTableSGI MANGLE(CopyColorTableSGI) +#define glCopyConvolutionFilter1D MANGLE(CopyConvolutionFilter1D) +#define glCopyConvolutionFilter1DEXT MANGLE(CopyConvolutionFilter1DEXT) +#define glCopyConvolutionFilter2D MANGLE(CopyConvolutionFilter2D) +#define glCopyConvolutionFilter2DEXT MANGLE(CopyConvolutionFilter2DEXT) +#define glCopyPixels MANGLE(CopyPixels) +#define glCopyTexImage1D MANGLE(CopyTexImage1D) +#define glCopyTexImage1DEXT MANGLE(CopyTexImage1DEXT) +#define glCopyTexImage2D MANGLE(CopyTexImage2D) +#define glCopyTexImage2DEXT MANGLE(CopyTexImage2DEXT) +#define glCopyTexSubImage1D MANGLE(CopyTexSubImage1D) +#define glCopyTexSubImage1DEXT MANGLE(CopyTexSubImage1DEXT) +#define glCopyTexSubImage2D MANGLE(CopyTexSubImage2D) +#define glCopyTexSubImage2DEXT MANGLE(CopyTexSubImage2DEXT) +#define glCopyTexSubImage3D MANGLE(CopyTexSubImage3D) +#define glCopyTexSubImage3DEXT MANGLE(CopyTexSubImage3DEXT) +#define glCullFace MANGLE(CullFace) +#define glCullParameterdvEXT MANGLE(CullParameterdvEXT) +#define glCullParameterfvEXT MANGLE(CullParameterfvEXT) +#define glCurrentPaletteMatrixARB MANGLE(CurrentPaletteMatrixARB) +#define glDeformSGIX MANGLE(DeformSGIX) +#define glDeformationMap3dSGIX MANGLE(DeformationMap3dSGIX) +#define glDeformationMap3fSGIX MANGLE(DeformationMap3fSGIX) +#define glDeleteAsyncMarkersSGIX MANGLE(DeleteAsyncMarkersSGIX) +#define glDeleteFencesNV MANGLE(DeleteFencesNV) +#define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI) +#define glDeleteLists MANGLE(DeleteLists) +#define glDeleteObjectBufferATI MANGLE(DeleteObjectBufferATI) +#define glDeleteProgramsNV MANGLE(DeleteProgramsNV) +#define glDeleteTextures MANGLE(DeleteTextures) +#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT) +#define glDeleteVertexShaderEXT MANGLE(DeleteVertexShaderEXT) +#define glDepthFunc MANGLE(DepthFunc) +#define glDepthMask MANGLE(DepthMask) +#define glDepthRange MANGLE(DepthRange) +#define glDetailTexFuncSGIS MANGLE(DetailTexFuncSGIS) +#define glDisable MANGLE(Disable) +#define glDisableClientState MANGLE(DisableClientState) +#define glDisableTraceMESA MANGLE(DisableTraceMESA) +#define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT) +#define glDrawArrays MANGLE(DrawArrays) +#define glDrawArraysEXT MANGLE(DrawArraysEXT) +#define glDrawBuffer MANGLE(DrawBuffer) +#define glDrawElements MANGLE(DrawElements) +#define glDrawPixels MANGLE(DrawPixels) +#define glDrawRangeElements MANGLE(DrawRangeElements) +#define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT) +#define glEdgeFlag MANGLE(EdgeFlag) +#define glEdgeFlagPointer MANGLE(EdgeFlagPointer) +#define glEdgeFlagPointerEXT MANGLE(EdgeFlagPointerEXT) +#define glEdgeFlagPointerListIBM MANGLE(EdgeFlagPointerListIBM) +#define glEdgeFlagv MANGLE(EdgeFlagv) +#define glEnable MANGLE(Enable) +#define glEnableClientState MANGLE(EnableClientState) +#define glEnableTraceMESA MANGLE(EnableTraceMESA) +#define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT) +#define glEnd MANGLE(End) +#define glEndFragmentShaderATI MANGLE(EndFragmentShaderATI) +#define glEndList MANGLE(EndList) +#define glEndTraceMESA MANGLE(EndTraceMESA) +#define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT) +#define glEvalCoord1d MANGLE(EvalCoord1d) +#define glEvalCoord1dv MANGLE(EvalCoord1dv) +#define glEvalCoord1f MANGLE(EvalCoord1f) +#define glEvalCoord1fv MANGLE(EvalCoord1fv) +#define glEvalCoord2d MANGLE(EvalCoord2d) +#define glEvalCoord2dv MANGLE(EvalCoord2dv) +#define glEvalCoord2f MANGLE(EvalCoord2f) +#define glEvalCoord2fv MANGLE(EvalCoord2fv) +#define glEvalMapsNV MANGLE(EvalMapsNV) +#define glEvalMesh1 MANGLE(EvalMesh1) +#define glEvalMesh2 MANGLE(EvalMesh2) +#define glEvalPoint1 MANGLE(EvalPoint1) +#define glEvalPoint2 MANGLE(EvalPoint2) +#define glExecuteProgramNV MANGLE(ExecuteProgramNV) +#define glExtractComponentEXT MANGLE(ExtractComponentEXT) +#define glFeedbackBuffer MANGLE(FeedbackBuffer) +#define glFinalCombinerInputNV MANGLE(FinalCombinerInputNV) +#define glFinish MANGLE(Finish) +#define glFinishAsyncSGIX MANGLE(FinishAsyncSGIX) +#define glFinishFenceNV MANGLE(FinishFenceNV) +#define glFinishTextureSUNX MANGLE(FinishTextureSUNX) +#define glFlush MANGLE(Flush) +#define glFlushRasterSGIX MANGLE(FlushRasterSGIX) +#define glFlushVertexArrayRangeNV MANGLE(FlushVertexArrayRangeNV) +#define glFogCoordPointerEXT MANGLE(FogCoordPointerEXT) +#define glFogCoordPointerListIBM MANGLE(FogCoordPointerListIBM) +#define glFogCoorddEXT MANGLE(FogCoorddEXT) +#define glFogCoorddvEXT MANGLE(FogCoorddvEXT) +#define glFogCoordfEXT MANGLE(FogCoordfEXT) +#define glFogCoordfvEXT MANGLE(FogCoordfvEXT) +#define glFogFuncSGIS MANGLE(FogFuncSGIS) +#define glFogf MANGLE(Fogf) +#define glFogfv MANGLE(Fogfv) +#define glFogi MANGLE(Fogi) +#define glFogiv MANGLE(Fogiv) +#define glFragmentColorMaterialSGIX MANGLE(FragmentColorMaterialSGIX) +#define glFragmentLightModelfSGIX MANGLE(FragmentLightModelfSGIX) +#define glFragmentLightModelfvSGIX MANGLE(FragmentLightModelfvSGIX) +#define glFragmentLightModeliSGIX MANGLE(FragmentLightModeliSGIX) +#define glFragmentLightModelivSGIX MANGLE(FragmentLightModelivSGIX) +#define glFragmentLightfSGIX MANGLE(FragmentLightfSGIX) +#define glFragmentLightfvSGIX MANGLE(FragmentLightfvSGIX) +#define glFragmentLightiSGIX MANGLE(FragmentLightiSGIX) +#define glFragmentLightivSGIX MANGLE(FragmentLightivSGIX) +#define glFragmentMaterialfSGIX MANGLE(FragmentMaterialfSGIX) +#define glFragmentMaterialfvSGIX MANGLE(FragmentMaterialfvSGIX) +#define glFragmentMaterialiSGIX MANGLE(FragmentMaterialiSGIX) +#define glFragmentMaterialivSGIX MANGLE(FragmentMaterialivSGIX) +#define glFrameZoomSGIX MANGLE(FrameZoomSGIX) +#define glFrontFace MANGLE(FrontFace) +#define glFrustum MANGLE(Frustum) +#define glGenAsyncMarkersSGIX MANGLE(GenAsyncMarkersSGIX) +#define glGenFencesNV MANGLE(GenFencesNV) +#define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI) +#define glGenLists MANGLE(GenLists) +#define glGenProgramsNV MANGLE(GenProgramsNV) +#define glGenSymbolsEXT MANGLE(GenSymbolsEXT) +#define glGenTextures MANGLE(GenTextures) +#define glGenTexturesEXT MANGLE(GenTexturesEXT) +#define glGenVertexShadersEXT MANGLE(GenVertexShadersEXT) +#define glGetArrayObjectfvATI MANGLE(GetArrayObjectfvATI) +#define glGetArrayObjectivATI MANGLE(GetArrayObjectivATI) +#define glGetBooleanv MANGLE(GetBooleanv) +#define glGetClipPlane MANGLE(GetClipPlane) +#define glGetColorTable MANGLE(GetColorTable) +#define glGetColorTableEXT MANGLE(GetColorTableEXT) +#define glGetColorTableParameterfv MANGLE(GetColorTableParameterfv) +#define glGetColorTableParameterfvEXT MANGLE(GetColorTableParameterfvEXT) +#define glGetColorTableParameterfvSGI MANGLE(GetColorTableParameterfvSGI) +#define glGetColorTableParameteriv MANGLE(GetColorTableParameteriv) +#define glGetColorTableParameterivEXT MANGLE(GetColorTableParameterivEXT) +#define glGetColorTableParameterivSGI MANGLE(GetColorTableParameterivSGI) +#define glGetColorTableSGI MANGLE(GetColorTableSGI) +#define glGetCombinerInputParameterfvNV MANGLE(GetCombinerInputParameterfvNV) +#define glGetCombinerInputParameterivNV MANGLE(GetCombinerInputParameterivNV) +#define glGetCombinerOutputParameterfvNV MANGLE(GetCombinerOutputParameterfvNV) +#define glGetCombinerOutputParameterivNV MANGLE(GetCombinerOutputParameterivNV) +#define glGetCombinerStageParameterfvNV MANGLE(GetCombinerStageParameterfvNV) +#define glGetCompressedTexImage MANGLE(GetCompressedTexImage) +#define glGetCompressedTexImageARB MANGLE(GetCompressedTexImageARB) +#define glGetConvolutionFilter MANGLE(GetConvolutionFilter) +#define glGetConvolutionFilterEXT MANGLE(GetConvolutionFilterEXT) +#define glGetConvolutionParameterfv MANGLE(GetConvolutionParameterfv) +#define glGetConvolutionParameterfvEXT MANGLE(GetConvolutionParameterfvEXT) +#define glGetConvolutionParameteriv MANGLE(GetConvolutionParameteriv) +#define glGetConvolutionParameterivEXT MANGLE(GetConvolutionParameterivEXT) +#define glGetDetailTexFuncSGIS MANGLE(GetDetailTexFuncSGIS) +#define glGetDoublev MANGLE(GetDoublev) +#define glGetError MANGLE(GetError) +#define glGetFenceivNV MANGLE(GetFenceivNV) +#define glGetFinalCombinerInputParameterfvNV MANGLE(GetFinalCombinerInputParameterfvNV) +#define glGetFinalCombinerInputParameterivNV MANGLE(GetFinalCombinerInputParameterivNV) +#define glGetFloatv MANGLE(GetFloatv) +#define glGetFogFuncSGIS MANGLE(GetFogFuncSGIS) +#define glGetFragmentLightfvSGIX MANGLE(GetFragmentLightfvSGIX) +#define glGetFragmentLightivSGIX MANGLE(GetFragmentLightivSGIX) +#define glGetFragmentMaterialfvSGIX MANGLE(GetFragmentMaterialfvSGIX) +#define glGetFragmentMaterialivSGIX MANGLE(GetFragmentMaterialivSGIX) +#define glGetHistogram MANGLE(GetHistogram) +#define glGetHistogramEXT MANGLE(GetHistogramEXT) +#define glGetHistogramParameterfv MANGLE(GetHistogramParameterfv) +#define glGetHistogramParameterfvEXT MANGLE(GetHistogramParameterfvEXT) +#define glGetHistogramParameteriv MANGLE(GetHistogramParameteriv) +#define glGetHistogramParameterivEXT MANGLE(GetHistogramParameterivEXT) +#define glGetImageTransformParameterfvHP MANGLE(GetImageTransformParameterfvHP) +#define glGetImageTransformParameterivHP MANGLE(GetImageTransformParameterivHP) +#define glGetInstrumentsSGIX MANGLE(GetInstrumentsSGIX) +#define glGetIntegerv MANGLE(GetIntegerv) +#define glGetInvariantBooleanvEXT MANGLE(GetInvariantBooleanvEXT) +#define glGetInvariantFloatvEXT MANGLE(GetInvariantFloatvEXT) +#define glGetInvariantIntegervEXT MANGLE(GetInvariantIntegervEXT) +#define glGetLightfv MANGLE(GetLightfv) +#define glGetLightiv MANGLE(GetLightiv) +#define glGetListParameterfvSGIX MANGLE(GetListParameterfvSGIX) +#define glGetListParameterivSGIX MANGLE(GetListParameterivSGIX) +#define glGetLocalConstantBooleanvEXT MANGLE(GetLocalConstantBooleanvEXT) +#define glGetLocalConstantFloatvEXT MANGLE(GetLocalConstantFloatvEXT) +#define glGetLocalConstantIntegervEXT MANGLE(GetLocalConstantIntegervEXT) +#define glGetMapAttribParameterfvNV MANGLE(GetMapAttribParameterfvNV) +#define glGetMapAttribParameterivNV MANGLE(GetMapAttribParameterivNV) +#define glGetMapControlPointsNV MANGLE(GetMapControlPointsNV) +#define glGetMapParameterfvNV MANGLE(GetMapParameterfvNV) +#define glGetMapParameterivNV MANGLE(GetMapParameterivNV) +#define glGetMapdv MANGLE(GetMapdv) +#define glGetMapfv MANGLE(GetMapfv) +#define glGetMapiv MANGLE(GetMapiv) +#define glGetMaterialfv MANGLE(GetMaterialfv) +#define glGetMaterialiv MANGLE(GetMaterialiv) +#define glGetMinmax MANGLE(GetMinmax) +#define glGetMinmaxEXT MANGLE(GetMinmaxEXT) +#define glGetMinmaxParameterfv MANGLE(GetMinmaxParameterfv) +#define glGetMinmaxParameterfvEXT MANGLE(GetMinmaxParameterfvEXT) +#define glGetMinmaxParameteriv MANGLE(GetMinmaxParameteriv) +#define glGetMinmaxParameterivEXT MANGLE(GetMinmaxParameterivEXT) +#define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI) +#define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI) +#define glGetPixelMapfv MANGLE(GetPixelMapfv) +#define glGetPixelMapuiv MANGLE(GetPixelMapuiv) +#define glGetPixelMapusv MANGLE(GetPixelMapusv) +#define glGetPixelTexGenParameterfvSGIS MANGLE(GetPixelTexGenParameterfvSGIS) +#define glGetPixelTexGenParameterivSGIS MANGLE(GetPixelTexGenParameterivSGIS) +#define glGetPointerv MANGLE(GetPointerv) +#define glGetPointervEXT MANGLE(GetPointervEXT) +#define glGetPolygonStipple MANGLE(GetPolygonStipple) +#define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV) +#define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV) +#define glGetProgramStringNV MANGLE(GetProgramStringNV) +#define glGetProgramivNV MANGLE(GetProgramivNV) +#define glGetSeparableFilter MANGLE(GetSeparableFilter) +#define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT) +#define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS) +#define glGetString MANGLE(GetString) +#define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI) +#define glGetTexBumpParameterivATI MANGLE(GetTexBumpParameterivATI) +#define glGetTexEnvfv MANGLE(GetTexEnvfv) +#define glGetTexEnviv MANGLE(GetTexEnviv) +#define glGetTexFilterFuncSGIS MANGLE(GetTexFilterFuncSGIS) +#define glGetTexGendv MANGLE(GetTexGendv) +#define glGetTexGenfv MANGLE(GetTexGenfv) +#define glGetTexGeniv MANGLE(GetTexGeniv) +#define glGetTexImage MANGLE(GetTexImage) +#define glGetTexLevelParameterfv MANGLE(GetTexLevelParameterfv) +#define glGetTexLevelParameteriv MANGLE(GetTexLevelParameteriv) +#define glGetTexParameterfv MANGLE(GetTexParameterfv) +#define glGetTexParameteriv MANGLE(GetTexParameteriv) +#define glGetTrackMatrixivNV MANGLE(GetTrackMatrixivNV) +#define glGetVariantArrayObjectfvATI MANGLE(GetVariantArrayObjectfvATI) +#define glGetVariantArrayObjectivATI MANGLE(GetVariantArrayObjectivATI) +#define glGetVariantBooleanvEXT MANGLE(GetVariantBooleanvEXT) +#define glGetVariantFloatvEXT MANGLE(GetVariantFloatvEXT) +#define glGetVariantIntegervEXT MANGLE(GetVariantIntegervEXT) +#define glGetVariantPointervEXT MANGLE(GetVariantPointervEXT) +#define glGetVertexAttribPointervNV MANGLE(GetVertexAttribPointervNV) +#define glGetVertexAttribdvNV MANGLE(GetVertexAttribdvNV) +#define glGetVertexAttribfvNV MANGLE(GetVertexAttribfvNV) +#define glGetVertexAttribivNV MANGLE(GetVertexAttribivNV) +#define glGlobalAlphaFactorbSUN MANGLE(GlobalAlphaFactorbSUN) +#define glGlobalAlphaFactordSUN MANGLE(GlobalAlphaFactordSUN) +#define glGlobalAlphaFactorfSUN MANGLE(GlobalAlphaFactorfSUN) +#define glGlobalAlphaFactoriSUN MANGLE(GlobalAlphaFactoriSUN) +#define glGlobalAlphaFactorsSUN MANGLE(GlobalAlphaFactorsSUN) +#define glGlobalAlphaFactorubSUN MANGLE(GlobalAlphaFactorubSUN) +#define glGlobalAlphaFactoruiSUN MANGLE(GlobalAlphaFactoruiSUN) +#define glGlobalAlphaFactorusSUN MANGLE(GlobalAlphaFactorusSUN) +#define glHint MANGLE(Hint) +#define glHintPGI MANGLE(HintPGI) +#define glHistogram MANGLE(Histogram) +#define glHistogramEXT MANGLE(HistogramEXT) +#define glIglooInterfaceSGIX MANGLE(IglooInterfaceSGIX) +#define glImageTransformParameterfHP MANGLE(ImageTransformParameterfHP) +#define glImageTransformParameterfvHP MANGLE(ImageTransformParameterfvHP) +#define glImageTransformParameteriHP MANGLE(ImageTransformParameteriHP) +#define glImageTransformParameterivHP MANGLE(ImageTransformParameterivHP) +#define glIndexFuncEXT MANGLE(IndexFuncEXT) +#define glIndexMask MANGLE(IndexMask) +#define glIndexMaterialEXT MANGLE(IndexMaterialEXT) +#define glIndexPointer MANGLE(IndexPointer) +#define glIndexPointerEXT MANGLE(IndexPointerEXT) +#define glIndexPointerListIBM MANGLE(IndexPointerListIBM) +#define glIndexd MANGLE(Indexd) +#define glIndexdv MANGLE(Indexdv) +#define glIndexf MANGLE(Indexf) +#define glIndexfv MANGLE(Indexfv) +#define glIndexi MANGLE(Indexi) +#define glIndexiv MANGLE(Indexiv) +#define glIndexs MANGLE(Indexs) +#define glIndexsv MANGLE(Indexsv) +#define glIndexub MANGLE(Indexub) +#define glIndexubv MANGLE(Indexubv) +#define glInitNames MANGLE(InitNames) +#define glInsertComponentEXT MANGLE(InsertComponentEXT) +#define glInstrumentsBufferSGIX MANGLE(InstrumentsBufferSGIX) +#define glInterleavedArrays MANGLE(InterleavedArrays) +#define glIsAsyncMarkerSGIX MANGLE(IsAsyncMarkerSGIX) +#define glIsEnabled MANGLE(IsEnabled) +#define glIsFenceNV MANGLE(IsFenceNV) +#define glIsList MANGLE(IsList) +#define glIsObjectBufferATI MANGLE(IsObjectBufferATI) +#define glIsProgramNV MANGLE(IsProgramNV) +#define glIsTexture MANGLE(IsTexture) +#define glIsTextureEXT MANGLE(IsTextureEXT) +#define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT) +#define glLightEnviSGIX MANGLE(LightEnviSGIX) +#define glLightModelf MANGLE(LightModelf) +#define glLightModelfv MANGLE(LightModelfv) +#define glLightModeli MANGLE(LightModeli) +#define glLightModeliv MANGLE(LightModeliv) +#define glLightf MANGLE(Lightf) +#define glLightfv MANGLE(Lightfv) +#define glLighti MANGLE(Lighti) +#define glLightiv MANGLE(Lightiv) +#define glLineStipple MANGLE(LineStipple) +#define glLineWidth MANGLE(LineWidth) +#define glListBase MANGLE(ListBase) +#define glListParameterfSGIX MANGLE(ListParameterfSGIX) +#define glListParameterfvSGIX MANGLE(ListParameterfvSGIX) +#define glListParameteriSGIX MANGLE(ListParameteriSGIX) +#define glListParameterivSGIX MANGLE(ListParameterivSGIX) +#define glLoadIdentity MANGLE(LoadIdentity) +#define glLoadIdentityDeformationMapSGIX MANGLE(LoadIdentityDeformationMapSGIX) +#define glLoadMatrixd MANGLE(LoadMatrixd) +#define glLoadMatrixf MANGLE(LoadMatrixf) +#define glLoadName MANGLE(LoadName) +#define glLoadProgramNV MANGLE(LoadProgramNV) +#define glLoadTransposeMatrixd MANGLE(LoadTransposeMatrixd) +#define glLoadTransposeMatrixdARB MANGLE(LoadTransposeMatrixdARB) +#define glLoadTransposeMatrixf MANGLE(LoadTransposeMatrixf) +#define glLoadTransposeMatrixfARB MANGLE(LoadTransposeMatrixfARB) +#define glLockArraysEXT MANGLE(LockArraysEXT) +#define glLogicOp MANGLE(LogicOp) +#define glMap1d MANGLE(Map1d) +#define glMap1f MANGLE(Map1f) +#define glMap2d MANGLE(Map2d) +#define glMap2f MANGLE(Map2f) +#define glMapControlPointsNV MANGLE(MapControlPointsNV) +#define glMapGrid1d MANGLE(MapGrid1d) +#define glMapGrid1f MANGLE(MapGrid1f) +#define glMapGrid2d MANGLE(MapGrid2d) +#define glMapGrid2f MANGLE(MapGrid2f) +#define glMapParameterfvNV MANGLE(MapParameterfvNV) +#define glMapParameterivNV MANGLE(MapParameterivNV) +#define glMaterialf MANGLE(Materialf) +#define glMaterialfv MANGLE(Materialfv) +#define glMateriali MANGLE(Materiali) +#define glMaterialiv MANGLE(Materialiv) +#define glMatrixIndexPointerARB MANGLE(MatrixIndexPointerARB) +#define glMatrixIndexubvARB MANGLE(MatrixIndexubvARB) +#define glMatrixIndexuivARB MANGLE(MatrixIndexuivARB) +#define glMatrixIndexusvARB MANGLE(MatrixIndexusvARB) +#define glMatrixMode MANGLE(MatrixMode) +#define glMinmax MANGLE(Minmax) +#define glMinmaxEXT MANGLE(MinmaxEXT) +#define glMultMatrixd MANGLE(MultMatrixd) +#define glMultMatrixf MANGLE(MultMatrixf) +#define glMultTransposeMatrixd MANGLE(MultTransposeMatrixd) +#define glMultTransposeMatrixdARB MANGLE(MultTransposeMatrixdARB) +#define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf) +#define glMultTransposeMatrixfARB MANGLE(MultTransposeMatrixfARB) +#define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT) +#define glMultiDrawElementsEXT MANGLE(MultiDrawElementsEXT) +#define glMultiModeDrawArraysIBM MANGLE(MultiModeDrawArraysIBM) +#define glMultiModeDrawElementsIBM MANGLE(MultiModeDrawElementsIBM) +#define glMultiTexCoord1d MANGLE(MultiTexCoord1d) +#define glMultiTexCoord1dARB MANGLE(MultiTexCoord1dARB) +#define glMultiTexCoord1dv MANGLE(MultiTexCoord1dv) +#define glMultiTexCoord1dvARB MANGLE(MultiTexCoord1dvARB) +#define glMultiTexCoord1f MANGLE(MultiTexCoord1f) +#define glMultiTexCoord1fARB MANGLE(MultiTexCoord1fARB) +#define glMultiTexCoord1fv MANGLE(MultiTexCoord1fv) +#define glMultiTexCoord1fvARB MANGLE(MultiTexCoord1fvARB) +#define glMultiTexCoord1i MANGLE(MultiTexCoord1i) +#define glMultiTexCoord1iARB MANGLE(MultiTexCoord1iARB) +#define glMultiTexCoord1iv MANGLE(MultiTexCoord1iv) +#define glMultiTexCoord1ivARB MANGLE(MultiTexCoord1ivARB) +#define glMultiTexCoord1s MANGLE(MultiTexCoord1s) +#define glMultiTexCoord1sARB MANGLE(MultiTexCoord1sARB) +#define glMultiTexCoord1sv MANGLE(MultiTexCoord1sv) +#define glMultiTexCoord1svARB MANGLE(MultiTexCoord1svARB) +#define glMultiTexCoord2d MANGLE(MultiTexCoord2d) +#define glMultiTexCoord2dARB MANGLE(MultiTexCoord2dARB) +#define glMultiTexCoord2dv MANGLE(MultiTexCoord2dv) +#define glMultiTexCoord2dvARB MANGLE(MultiTexCoord2dvARB) +#define glMultiTexCoord2f MANGLE(MultiTexCoord2f) +#define glMultiTexCoord2fARB MANGLE(MultiTexCoord2fARB) +#define glMultiTexCoord2fv MANGLE(MultiTexCoord2fv) +#define glMultiTexCoord2fvARB MANGLE(MultiTexCoord2fvARB) +#define glMultiTexCoord2i MANGLE(MultiTexCoord2i) +#define glMultiTexCoord2iARB MANGLE(MultiTexCoord2iARB) +#define glMultiTexCoord2iv MANGLE(MultiTexCoord2iv) +#define glMultiTexCoord2ivARB MANGLE(MultiTexCoord2ivARB) +#define glMultiTexCoord2s MANGLE(MultiTexCoord2s) +#define glMultiTexCoord2sARB MANGLE(MultiTexCoord2sARB) +#define glMultiTexCoord2sv MANGLE(MultiTexCoord2sv) +#define glMultiTexCoord2svARB MANGLE(MultiTexCoord2svARB) +#define glMultiTexCoord3d MANGLE(MultiTexCoord3d) +#define glMultiTexCoord3dARB MANGLE(MultiTexCoord3dARB) +#define glMultiTexCoord3dv MANGLE(MultiTexCoord3dv) +#define glMultiTexCoord3dvARB MANGLE(MultiTexCoord3dvARB) +#define glMultiTexCoord3f MANGLE(MultiTexCoord3f) +#define glMultiTexCoord3fARB MANGLE(MultiTexCoord3fARB) +#define glMultiTexCoord3fv MANGLE(MultiTexCoord3fv) +#define glMultiTexCoord3fvARB MANGLE(MultiTexCoord3fvARB) +#define glMultiTexCoord3i MANGLE(MultiTexCoord3i) +#define glMultiTexCoord3iARB MANGLE(MultiTexCoord3iARB) +#define glMultiTexCoord3iv MANGLE(MultiTexCoord3iv) +#define glMultiTexCoord3ivARB MANGLE(MultiTexCoord3ivARB) +#define glMultiTexCoord3s MANGLE(MultiTexCoord3s) +#define glMultiTexCoord3sARB MANGLE(MultiTexCoord3sARB) +#define glMultiTexCoord3sv MANGLE(MultiTexCoord3sv) +#define glMultiTexCoord3svARB MANGLE(MultiTexCoord3svARB) +#define glMultiTexCoord4d MANGLE(MultiTexCoord4d) +#define glMultiTexCoord4dARB MANGLE(MultiTexCoord4dARB) +#define glMultiTexCoord4dv MANGLE(MultiTexCoord4dv) +#define glMultiTexCoord4dvARB MANGLE(MultiTexCoord4dvARB) +#define glMultiTexCoord4f MANGLE(MultiTexCoord4f) +#define glMultiTexCoord4fARB MANGLE(MultiTexCoord4fARB) +#define glMultiTexCoord4fv MANGLE(MultiTexCoord4fv) +#define glMultiTexCoord4fvARB MANGLE(MultiTexCoord4fvARB) +#define glMultiTexCoord4i MANGLE(MultiTexCoord4i) +#define glMultiTexCoord4iARB MANGLE(MultiTexCoord4iARB) +#define glMultiTexCoord4iv MANGLE(MultiTexCoord4iv) +#define glMultiTexCoord4ivARB MANGLE(MultiTexCoord4ivARB) +#define glMultiTexCoord4s MANGLE(MultiTexCoord4s) +#define glMultiTexCoord4sARB MANGLE(MultiTexCoord4sARB) +#define glMultiTexCoord4sv MANGLE(MultiTexCoord4sv) +#define glMultiTexCoord4svARB MANGLE(MultiTexCoord4svARB) +#define glNewList MANGLE(NewList) +#define glNewObjectBufferATI MANGLE(NewObjectBufferATI) +#define glNewTraceMESA MANGLE(NewTraceMESA) +#define glNormal3b MANGLE(Normal3b) +#define glNormal3bv MANGLE(Normal3bv) +#define glNormal3d MANGLE(Normal3d) +#define glNormal3dv MANGLE(Normal3dv) +#define glNormal3f MANGLE(Normal3f) +#define glNormal3fVertex3fSUN MANGLE(Normal3fVertex3fSUN) +#define glNormal3fVertex3fvSUN MANGLE(Normal3fVertex3fvSUN) +#define glNormal3fv MANGLE(Normal3fv) +#define glNormal3i MANGLE(Normal3i) +#define glNormal3iv MANGLE(Normal3iv) +#define glNormal3s MANGLE(Normal3s) +#define glNormal3sv MANGLE(Normal3sv) +#define glNormalPointer MANGLE(NormalPointer) +#define glNormalPointerEXT MANGLE(NormalPointerEXT) +#define glNormalPointerListIBM MANGLE(NormalPointerListIBM) +#define glNormalPointervINTEL MANGLE(NormalPointervINTEL) +#define glNormalStream3b MANGLE(NormalStream3b) +#define glNormalStream3bv MANGLE(NormalStream3bv) +#define glNormalStream3d MANGLE(NormalStream3d) +#define glNormalStream3dv MANGLE(NormalStream3dv) +#define glNormalStream3f MANGLE(NormalStream3f) +#define glNormalStream3fv MANGLE(NormalStream3fv) +#define glNormalStream3i MANGLE(NormalStream3i) +#define glNormalStream3iv MANGLE(NormalStream3iv) +#define glNormalStream3s MANGLE(NormalStream3s) +#define glNormalStream3sv MANGLE(NormalStream3sv) +#define glOrtho MANGLE(Ortho) +#define glPNTrianglesfATI MANGLE(PNTrianglesfATI) +#define glPNTrianglesiATI MANGLE(PNTrianglesiATI) +#define glPassTexCoordATI MANGLE(PassTexCoordATI) +#define glPassThrough MANGLE(PassThrough) +#define glPixelMapfv MANGLE(PixelMapfv) +#define glPixelMapuiv MANGLE(PixelMapuiv) +#define glPixelMapusv MANGLE(PixelMapusv) +#define glPixelStoref MANGLE(PixelStoref) +#define glPixelStorei MANGLE(PixelStorei) +#define glPixelTexGenParameterfSGIS MANGLE(PixelTexGenParameterfSGIS) +#define glPixelTexGenParameterfvSGIS MANGLE(PixelTexGenParameterfvSGIS) +#define glPixelTexGenParameteriSGIS MANGLE(PixelTexGenParameteriSGIS) +#define glPixelTexGenParameterivSGIS MANGLE(PixelTexGenParameterivSGIS) +#define glPixelTexGenSGIX MANGLE(PixelTexGenSGIX) +#define glPixelTransferf MANGLE(PixelTransferf) +#define glPixelTransferi MANGLE(PixelTransferi) +#define glPixelTransformParameterfEXT MANGLE(PixelTransformParameterfEXT) +#define glPixelTransformParameterfvEXT MANGLE(PixelTransformParameterfvEXT) +#define glPixelTransformParameteriEXT MANGLE(PixelTransformParameteriEXT) +#define glPixelTransformParameterivEXT MANGLE(PixelTransformParameterivEXT) +#define glPixelZoom MANGLE(PixelZoom) +#define glPointParameterfARB MANGLE(PointParameterfARB) +#define glPointParameterfEXT MANGLE(PointParameterfEXT) +#define glPointParameterfSGIS MANGLE(PointParameterfSGIS) +#define glPointParameterfvARB MANGLE(PointParameterfvARB) +#define glPointParameterfvEXT MANGLE(PointParameterfvEXT) +#define glPointParameterfvSGIS MANGLE(PointParameterfvSGIS) +#define glPointSize MANGLE(PointSize) +#define glPollAsyncSGIX MANGLE(PollAsyncSGIX) +#define glPollInstrumentsSGIX MANGLE(PollInstrumentsSGIX) +#define glPolygonMode MANGLE(PolygonMode) +#define glPolygonOffset MANGLE(PolygonOffset) +#define glPolygonOffsetEXT MANGLE(PolygonOffsetEXT) +#define glPolygonStipple MANGLE(PolygonStipple) +#define glPopAttrib MANGLE(PopAttrib) +#define glPopClientAttrib MANGLE(PopClientAttrib) +#define glPopMatrix MANGLE(PopMatrix) +#define glPopName MANGLE(PopName) +#define glPrioritizeTextures MANGLE(PrioritizeTextures) +#define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT) +#define glProgramParameter4dNV MANGLE(ProgramParameter4dNV) +#define glProgramParameter4dvNV MANGLE(ProgramParameter4dvNV) +#define glProgramParameter4fNV MANGLE(ProgramParameter4fNV) +#define glProgramParameter4fvNV MANGLE(ProgramParameter4fvNV) +#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV) +#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV) +#define glPushAttrib MANGLE(PushAttrib) +#define glPushClientAttrib MANGLE(PushClientAttrib) +#define glPushMatrix MANGLE(PushMatrix) +#define glPushName MANGLE(PushName) +#define glRasterPos2d MANGLE(RasterPos2d) +#define glRasterPos2dv MANGLE(RasterPos2dv) +#define glRasterPos2f MANGLE(RasterPos2f) +#define glRasterPos2fv MANGLE(RasterPos2fv) +#define glRasterPos2i MANGLE(RasterPos2i) +#define glRasterPos2iv MANGLE(RasterPos2iv) +#define glRasterPos2s MANGLE(RasterPos2s) +#define glRasterPos2sv MANGLE(RasterPos2sv) +#define glRasterPos3d MANGLE(RasterPos3d) +#define glRasterPos3dv MANGLE(RasterPos3dv) +#define glRasterPos3f MANGLE(RasterPos3f) +#define glRasterPos3fv MANGLE(RasterPos3fv) +#define glRasterPos3i MANGLE(RasterPos3i) +#define glRasterPos3iv MANGLE(RasterPos3iv) +#define glRasterPos3s MANGLE(RasterPos3s) +#define glRasterPos3sv MANGLE(RasterPos3sv) +#define glRasterPos4d MANGLE(RasterPos4d) +#define glRasterPos4dv MANGLE(RasterPos4dv) +#define glRasterPos4f MANGLE(RasterPos4f) +#define glRasterPos4fv MANGLE(RasterPos4fv) +#define glRasterPos4i MANGLE(RasterPos4i) +#define glRasterPos4iv MANGLE(RasterPos4iv) +#define glRasterPos4s MANGLE(RasterPos4s) +#define glRasterPos4sv MANGLE(RasterPos4sv) +#define glReadBuffer MANGLE(ReadBuffer) +#define glReadInstrumentsSGIX MANGLE(ReadInstrumentsSGIX) +#define glReadPixels MANGLE(ReadPixels) +#define glRectd MANGLE(Rectd) +#define glRectdv MANGLE(Rectdv) +#define glRectf MANGLE(Rectf) +#define glRectfv MANGLE(Rectfv) +#define glRecti MANGLE(Recti) +#define glRectiv MANGLE(Rectiv) +#define glRects MANGLE(Rects) +#define glRectsv MANGLE(Rectsv) +#define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX) +#define glRenderMode MANGLE(RenderMode) +#define glReplacementCodePointerSUN MANGLE(ReplacementCodePointerSUN) +#define glReplacementCodeubSUN MANGLE(ReplacementCodeubSUN) +#define glReplacementCodeubvSUN MANGLE(ReplacementCodeubvSUN) +#define glReplacementCodeuiColor3fVertex3fSUN MANGLE(ReplacementCodeuiColor3fVertex3fSUN) +#define glReplacementCodeuiColor3fVertex3fvSUN MANGLE(ReplacementCodeuiColor3fVertex3fvSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor4ubVertex3fSUN MANGLE(ReplacementCodeuiColor4ubVertex3fSUN) +#define glReplacementCodeuiColor4ubVertex3fvSUN MANGLE(ReplacementCodeuiColor4ubVertex3fvSUN) +#define glReplacementCodeuiNormal3fVertex3fSUN MANGLE(ReplacementCodeuiNormal3fVertex3fSUN) +#define glReplacementCodeuiNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiNormal3fVertex3fvSUN) +#define glReplacementCodeuiSUN MANGLE(ReplacementCodeuiSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fVertex3fSUN MANGLE(ReplacementCodeuiTexCoord2fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fVertex3fvSUN MANGLE(ReplacementCodeuiTexCoord2fVertex3fvSUN) +#define glReplacementCodeuiVertex3fSUN MANGLE(ReplacementCodeuiVertex3fSUN) +#define glReplacementCodeuiVertex3fvSUN MANGLE(ReplacementCodeuiVertex3fvSUN) +#define glReplacementCodeuivSUN MANGLE(ReplacementCodeuivSUN) +#define glReplacementCodeusSUN MANGLE(ReplacementCodeusSUN) +#define glReplacementCodeusvSUN MANGLE(ReplacementCodeusvSUN) +#define glRequestResidentProgramsNV MANGLE(RequestResidentProgramsNV) +#define glResetHistogram MANGLE(ResetHistogram) +#define glResetHistogramEXT MANGLE(ResetHistogramEXT) +#define glResetMinmax MANGLE(ResetMinmax) +#define glResetMinmaxEXT MANGLE(ResetMinmaxEXT) +#define glResizeBuffersMESA MANGLE(ResizeBuffersMESA) +#define glRotated MANGLE(Rotated) +#define glRotatef MANGLE(Rotatef) +#define glSampleCoverage MANGLE(SampleCoverage) +#define glSampleCoverageARB MANGLE(SampleCoverageARB) +#define glSampleMapATI MANGLE(SampleMapATI) +#define glSampleMaskEXT MANGLE(SampleMaskEXT) +#define glSampleMaskSGIS MANGLE(SampleMaskSGIS) +#define glSamplePass MANGLE(SamplePass) +#define glSamplePatternEXT MANGLE(SamplePatternEXT) +#define glSamplePatternSGIS MANGLE(SamplePatternSGIS) +#define glScaled MANGLE(Scaled) +#define glScalef MANGLE(Scalef) +#define glScissor MANGLE(Scissor) +#define glSecondaryColor3bEXT MANGLE(SecondaryColor3bEXT) +#define glSecondaryColor3bvEXT MANGLE(SecondaryColor3bvEXT) +#define glSecondaryColor3dEXT MANGLE(SecondaryColor3dEXT) +#define glSecondaryColor3dvEXT MANGLE(SecondaryColor3dvEXT) +#define glSecondaryColor3fEXT MANGLE(SecondaryColor3fEXT) +#define glSecondaryColor3fvEXT MANGLE(SecondaryColor3fvEXT) +#define glSecondaryColor3iEXT MANGLE(SecondaryColor3iEXT) +#define glSecondaryColor3ivEXT MANGLE(SecondaryColor3ivEXT) +#define glSecondaryColor3sEXT MANGLE(SecondaryColor3sEXT) +#define glSecondaryColor3svEXT MANGLE(SecondaryColor3svEXT) +#define glSecondaryColor3ubEXT MANGLE(SecondaryColor3ubEXT) +#define glSecondaryColor3ubvEXT MANGLE(SecondaryColor3ubvEXT) +#define glSecondaryColor3uiEXT MANGLE(SecondaryColor3uiEXT) +#define glSecondaryColor3uivEXT MANGLE(SecondaryColor3uivEXT) +#define glSecondaryColor3usEXT MANGLE(SecondaryColor3usEXT) +#define glSecondaryColor3usvEXT MANGLE(SecondaryColor3usvEXT) +#define glSecondaryColorPointerEXT MANGLE(SecondaryColorPointerEXT) +#define glSecondaryColorPointerListIBM MANGLE(SecondaryColorPointerListIBM) +#define glSelectBuffer MANGLE(SelectBuffer) +#define glSeparableFilter2D MANGLE(SeparableFilter2D) +#define glSeparableFilter2DEXT MANGLE(SeparableFilter2DEXT) +#define glSetFenceNV MANGLE(SetFenceNV) +#define glSetFragmentShaderConstantATI MANGLE(SetFragmentShaderConstantATI) +#define glSetInvariantEXT MANGLE(SetInvariantEXT) +#define glSetLocalConstantEXT MANGLE(SetLocalConstantEXT) +#define glShadeModel MANGLE(ShadeModel) +#define glShaderOp1EXT MANGLE(ShaderOp1EXT) +#define glShaderOp2EXT MANGLE(ShaderOp2EXT) +#define glShaderOp3EXT MANGLE(ShaderOp3EXT) +#define glSharpenTexFuncSGIS MANGLE(SharpenTexFuncSGIS) +#define glSpriteParameterfSGIX MANGLE(SpriteParameterfSGIX) +#define glSpriteParameterfvSGIX MANGLE(SpriteParameterfvSGIX) +#define glSpriteParameteriSGIX MANGLE(SpriteParameteriSGIX) +#define glSpriteParameterivSGIX MANGLE(SpriteParameterivSGIX) +#define glStartInstrumentsSGIX MANGLE(StartInstrumentsSGIX) +#define glStencilFunc MANGLE(StencilFunc) +#define glStencilMask MANGLE(StencilMask) +#define glStencilOp MANGLE(StencilOp) +#define glStopInstrumentsSGIX MANGLE(StopInstrumentsSGIX) +#define glSwizzleEXT MANGLE(SwizzleEXT) +#define glTagSampleBufferSGIX MANGLE(TagSampleBufferSGIX) +#define glTangent3bEXT MANGLE(Tangent3bEXT) +#define glTangent3bvEXT MANGLE(Tangent3bvEXT) +#define glTangent3dEXT MANGLE(Tangent3dEXT) +#define glTangent3dvEXT MANGLE(Tangent3dvEXT) +#define glTangent3fEXT MANGLE(Tangent3fEXT) +#define glTangent3fvEXT MANGLE(Tangent3fvEXT) +#define glTangent3iEXT MANGLE(Tangent3iEXT) +#define glTangent3ivEXT MANGLE(Tangent3ivEXT) +#define glTangent3sEXT MANGLE(Tangent3sEXT) +#define glTangent3svEXT MANGLE(Tangent3svEXT) +#define glTangentPointerEXT MANGLE(TangentPointerEXT) +#define glTbufferMask3DFX MANGLE(TbufferMask3DFX) +#define glTestFenceNV MANGLE(TestFenceNV) +#define glTexBumpParameterfvATI MANGLE(TexBumpParameterfvATI) +#define glTexBumpParameterivATI MANGLE(TexBumpParameterivATI) +#define glTexCoord1d MANGLE(TexCoord1d) +#define glTexCoord1dv MANGLE(TexCoord1dv) +#define glTexCoord1f MANGLE(TexCoord1f) +#define glTexCoord1fv MANGLE(TexCoord1fv) +#define glTexCoord1i MANGLE(TexCoord1i) +#define glTexCoord1iv MANGLE(TexCoord1iv) +#define glTexCoord1s MANGLE(TexCoord1s) +#define glTexCoord1sv MANGLE(TexCoord1sv) +#define glTexCoord2d MANGLE(TexCoord2d) +#define glTexCoord2dv MANGLE(TexCoord2dv) +#define glTexCoord2f MANGLE(TexCoord2f) +#define glTexCoord2fColor3fVertex3fSUN MANGLE(TexCoord2fColor3fVertex3fSUN) +#define glTexCoord2fColor3fVertex3fvSUN MANGLE(TexCoord2fColor3fVertex3fvSUN) +#define glTexCoord2fColor4fNormal3fVertex3fSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fSUN) +#define glTexCoord2fColor4fNormal3fVertex3fvSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fvSUN) +#define glTexCoord2fColor4ubVertex3fSUN MANGLE(TexCoord2fColor4ubVertex3fSUN) +#define glTexCoord2fColor4ubVertex3fvSUN MANGLE(TexCoord2fColor4ubVertex3fvSUN) +#define glTexCoord2fNormal3fVertex3fSUN MANGLE(TexCoord2fNormal3fVertex3fSUN) +#define glTexCoord2fNormal3fVertex3fvSUN MANGLE(TexCoord2fNormal3fVertex3fvSUN) +#define glTexCoord2fVertex3fSUN MANGLE(TexCoord2fVertex3fSUN) +#define glTexCoord2fVertex3fvSUN MANGLE(TexCoord2fVertex3fvSUN) +#define glTexCoord2fv MANGLE(TexCoord2fv) +#define glTexCoord2i MANGLE(TexCoord2i) +#define glTexCoord2iv MANGLE(TexCoord2iv) +#define glTexCoord2s MANGLE(TexCoord2s) +#define glTexCoord2sv MANGLE(TexCoord2sv) +#define glTexCoord3d MANGLE(TexCoord3d) +#define glTexCoord3dv MANGLE(TexCoord3dv) +#define glTexCoord3f MANGLE(TexCoord3f) +#define glTexCoord3fv MANGLE(TexCoord3fv) +#define glTexCoord3i MANGLE(TexCoord3i) +#define glTexCoord3iv MANGLE(TexCoord3iv) +#define glTexCoord3s MANGLE(TexCoord3s) +#define glTexCoord3sv MANGLE(TexCoord3sv) +#define glTexCoord4d MANGLE(TexCoord4d) +#define glTexCoord4dv MANGLE(TexCoord4dv) +#define glTexCoord4f MANGLE(TexCoord4f) +#define glTexCoord4fColor4fNormal3fVertex4fSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fSUN) +#define glTexCoord4fColor4fNormal3fVertex4fvSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fvSUN) +#define glTexCoord4fVertex4fSUN MANGLE(TexCoord4fVertex4fSUN) +#define glTexCoord4fVertex4fvSUN MANGLE(TexCoord4fVertex4fvSUN) +#define glTexCoord4fv MANGLE(TexCoord4fv) +#define glTexCoord4i MANGLE(TexCoord4i) +#define glTexCoord4iv MANGLE(TexCoord4iv) +#define glTexCoord4s MANGLE(TexCoord4s) +#define glTexCoord4sv MANGLE(TexCoord4sv) +#define glTexCoordPointer MANGLE(TexCoordPointer) +#define glTexCoordPointerEXT MANGLE(TexCoordPointerEXT) +#define glTexCoordPointerListIBM MANGLE(TexCoordPointerListIBM) +#define glTexCoordPointervINTEL MANGLE(TexCoordPointervINTEL) +#define glTexEnvf MANGLE(TexEnvf) +#define glTexEnvfv MANGLE(TexEnvfv) +#define glTexEnvi MANGLE(TexEnvi) +#define glTexEnviv MANGLE(TexEnviv) +#define glTexFilterFuncSGIS MANGLE(TexFilterFuncSGIS) +#define glTexGend MANGLE(TexGend) +#define glTexGendv MANGLE(TexGendv) +#define glTexGenf MANGLE(TexGenf) +#define glTexGenfv MANGLE(TexGenfv) +#define glTexGeni MANGLE(TexGeni) +#define glTexGeniv MANGLE(TexGeniv) +#define glTexImage1D MANGLE(TexImage1D) +#define glTexImage2D MANGLE(TexImage2D) +#define glTexImage3D MANGLE(TexImage3D) +#define glTexImage3DEXT MANGLE(TexImage3DEXT) +#define glTexImage4DSGIS MANGLE(TexImage4DSGIS) +#define glTexParameterf MANGLE(TexParameterf) +#define glTexParameterfv MANGLE(TexParameterfv) +#define glTexParameteri MANGLE(TexParameteri) +#define glTexParameteriv MANGLE(TexParameteriv) +#define glTexSubImage1D MANGLE(TexSubImage1D) +#define glTexSubImage1DEXT MANGLE(TexSubImage1DEXT) +#define glTexSubImage2D MANGLE(TexSubImage2D) +#define glTexSubImage2DEXT MANGLE(TexSubImage2DEXT) +#define glTexSubImage3D MANGLE(TexSubImage3D) +#define glTexSubImage3DEXT MANGLE(TexSubImage3DEXT) +#define glTexSubImage4DSGIS MANGLE(TexSubImage4DSGIS) +#define glTextureColorMaskSGIS MANGLE(TextureColorMaskSGIS) +#define glTextureLightEXT MANGLE(TextureLightEXT) +#define glTextureMaterialEXT MANGLE(TextureMaterialEXT) +#define glTextureNormalEXT MANGLE(TextureNormalEXT) +#define glTraceAssertAttribMESA MANGLE(TraceAssertAttribMESA) +#define glTraceCommentMESA MANGLE(TraceCommentMESA) +#define glTraceListMESA MANGLE(TraceListMESA) +#define glTracePointerMESA MANGLE(TracePointerMESA) +#define glTracePointerRangeMESA MANGLE(TracePointerRangeMESA) +#define glTraceTextureMESA MANGLE(TraceTextureMESA) +#define glTrackMatrixNV MANGLE(TrackMatrixNV) +#define glTranslated MANGLE(Translated) +#define glTranslatef MANGLE(Translatef) +#define glUnlockArraysEXT MANGLE(UnlockArraysEXT) +#define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI) +#define glVariantArrayObjectATI MANGLE(VariantArrayObjectATI) +#define glVariantPointerEXT MANGLE(VariantPointerEXT) +#define glVariantbvEXT MANGLE(VariantbvEXT) +#define glVariantdvEXT MANGLE(VariantdvEXT) +#define glVariantfvEXT MANGLE(VariantfvEXT) +#define glVariantivEXT MANGLE(VariantivEXT) +#define glVariantsvEXT MANGLE(VariantsvEXT) +#define glVariantubvEXT MANGLE(VariantubvEXT) +#define glVariantuivEXT MANGLE(VariantuivEXT) +#define glVariantusvEXT MANGLE(VariantusvEXT) +#define glVertex2d MANGLE(Vertex2d) +#define glVertex2dv MANGLE(Vertex2dv) +#define glVertex2f MANGLE(Vertex2f) +#define glVertex2fv MANGLE(Vertex2fv) +#define glVertex2i MANGLE(Vertex2i) +#define glVertex2iv MANGLE(Vertex2iv) +#define glVertex2s MANGLE(Vertex2s) +#define glVertex2sv MANGLE(Vertex2sv) +#define glVertex3d MANGLE(Vertex3d) +#define glVertex3dv MANGLE(Vertex3dv) +#define glVertex3f MANGLE(Vertex3f) +#define glVertex3fv MANGLE(Vertex3fv) +#define glVertex3i MANGLE(Vertex3i) +#define glVertex3iv MANGLE(Vertex3iv) +#define glVertex3s MANGLE(Vertex3s) +#define glVertex3sv MANGLE(Vertex3sv) +#define glVertex4d MANGLE(Vertex4d) +#define glVertex4dv MANGLE(Vertex4dv) +#define glVertex4f MANGLE(Vertex4f) +#define glVertex4fv MANGLE(Vertex4fv) +#define glVertex4i MANGLE(Vertex4i) +#define glVertex4iv MANGLE(Vertex4iv) +#define glVertex4s MANGLE(Vertex4s) +#define glVertex4sv MANGLE(Vertex4sv) +#define glVertexArrayRangeNV MANGLE(VertexArrayRangeNV) +#define glVertexAttrib1dNV MANGLE(VertexAttrib1dNV) +#define glVertexAttrib1dvNV MANGLE(VertexAttrib1dvNV) +#define glVertexAttrib1fNV MANGLE(VertexAttrib1fNV) +#define glVertexAttrib1fvNV MANGLE(VertexAttrib1fvNV) +#define glVertexAttrib1sNV MANGLE(VertexAttrib1sNV) +#define glVertexAttrib1svNV MANGLE(VertexAttrib1svNV) +#define glVertexAttrib2dNV MANGLE(VertexAttrib2dNV) +#define glVertexAttrib2dvNV MANGLE(VertexAttrib2dvNV) +#define glVertexAttrib2fNV MANGLE(VertexAttrib2fNV) +#define glVertexAttrib2fvNV MANGLE(VertexAttrib2fvNV) +#define glVertexAttrib2sNV MANGLE(VertexAttrib2sNV) +#define glVertexAttrib2svNV MANGLE(VertexAttrib2svNV) +#define glVertexAttrib3dNV MANGLE(VertexAttrib3dNV) +#define glVertexAttrib3dvNV MANGLE(VertexAttrib3dvNV) +#define glVertexAttrib3fNV MANGLE(VertexAttrib3fNV) +#define glVertexAttrib3fvNV MANGLE(VertexAttrib3fvNV) +#define glVertexAttrib3sNV MANGLE(VertexAttrib3sNV) +#define glVertexAttrib3svNV MANGLE(VertexAttrib3svNV) +#define glVertexAttrib4dNV MANGLE(VertexAttrib4dNV) +#define glVertexAttrib4dvNV MANGLE(VertexAttrib4dvNV) +#define glVertexAttrib4fNV MANGLE(VertexAttrib4fNV) +#define glVertexAttrib4fvNV MANGLE(VertexAttrib4fvNV) +#define glVertexAttrib4sNV MANGLE(VertexAttrib4sNV) +#define glVertexAttrib4svNV MANGLE(VertexAttrib4svNV) +#define glVertexAttrib4ubNV MANGLE(VertexAttrib4ubNV) +#define glVertexAttrib4ubvNV MANGLE(VertexAttrib4ubvNV) +#define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV) +#define glVertexAttribs1dvNV MANGLE(VertexAttribs1dvNV) +#define glVertexAttribs1fvNV MANGLE(VertexAttribs1fvNV) +#define glVertexAttribs1svNV MANGLE(VertexAttribs1svNV) +#define glVertexAttribs2dvNV MANGLE(VertexAttribs2dvNV) +#define glVertexAttribs2fvNV MANGLE(VertexAttribs2fvNV) +#define glVertexAttribs2svNV MANGLE(VertexAttribs2svNV) +#define glVertexAttribs3dvNV MANGLE(VertexAttribs3dvNV) +#define glVertexAttribs3fvNV MANGLE(VertexAttribs3fvNV) +#define glVertexAttribs3svNV MANGLE(VertexAttribs3svNV) +#define glVertexAttribs4dvNV MANGLE(VertexAttribs4dvNV) +#define glVertexAttribs4fvNV MANGLE(VertexAttribs4fvNV) +#define glVertexAttribs4svNV MANGLE(VertexAttribs4svNV) +#define glVertexAttribs4ubvNV MANGLE(VertexAttribs4ubvNV) +#define glVertexBlendARB MANGLE(VertexBlendARB) +#define glVertexBlendEnvf MANGLE(VertexBlendEnvf) +#define glVertexBlendEnvi MANGLE(VertexBlendEnvi) +#define glVertexPointer MANGLE(VertexPointer) +#define glVertexPointerEXT MANGLE(VertexPointerEXT) +#define glVertexPointerListIBM MANGLE(VertexPointerListIBM) +#define glVertexPointervINTEL MANGLE(VertexPointervINTEL) +#define glVertexStream1d MANGLE(VertexStream1d) +#define glVertexStream1dv MANGLE(VertexStream1dv) +#define glVertexStream1f MANGLE(VertexStream1f) +#define glVertexStream1fv MANGLE(VertexStream1fv) +#define glVertexStream1i MANGLE(VertexStream1i) +#define glVertexStream1iv MANGLE(VertexStream1iv) +#define glVertexStream1s MANGLE(VertexStream1s) +#define glVertexStream1sv MANGLE(VertexStream1sv) +#define glVertexStream2d MANGLE(VertexStream2d) +#define glVertexStream2dv MANGLE(VertexStream2dv) +#define glVertexStream2f MANGLE(VertexStream2f) +#define glVertexStream2fv MANGLE(VertexStream2fv) +#define glVertexStream2i MANGLE(VertexStream2i) +#define glVertexStream2iv MANGLE(VertexStream2iv) +#define glVertexStream2s MANGLE(VertexStream2s) +#define glVertexStream2sv MANGLE(VertexStream2sv) +#define glVertexStream3d MANGLE(VertexStream3d) +#define glVertexStream3dv MANGLE(VertexStream3dv) +#define glVertexStream3f MANGLE(VertexStream3f) +#define glVertexStream3fv MANGLE(VertexStream3fv) +#define glVertexStream3i MANGLE(VertexStream3i) +#define glVertexStream3iv MANGLE(VertexStream3iv) +#define glVertexStream3s MANGLE(VertexStream3s) +#define glVertexStream3sv MANGLE(VertexStream3sv) +#define glVertexStream4d MANGLE(VertexStream4d) +#define glVertexStream4dv MANGLE(VertexStream4dv) +#define glVertexStream4f MANGLE(VertexStream4f) +#define glVertexStream4fv MANGLE(VertexStream4fv) +#define glVertexStream4i MANGLE(VertexStream4i) +#define glVertexStream4iv MANGLE(VertexStream4iv) +#define glVertexStream4s MANGLE(VertexStream4s) +#define glVertexStream4sv MANGLE(VertexStream4sv) +#define glVertexWeightPointerEXT MANGLE(VertexWeightPointerEXT) +#define glVertexWeightfEXT MANGLE(VertexWeightfEXT) +#define glVertexWeightfvEXT MANGLE(VertexWeightfvEXT) +#define glViewport MANGLE(Viewport) +#define glWeightPointerARB MANGLE(WeightPointerARB) +#define glWeightbvARB MANGLE(WeightbvARB) +#define glWeightdvARB MANGLE(WeightdvARB) +#define glWeightfvARB MANGLE(WeightfvARB) +#define glWeightivARB MANGLE(WeightivARB) +#define glWeightsvARB MANGLE(WeightsvARB) +#define glWeightubvARB MANGLE(WeightubvARB) +#define glWeightuivARB MANGLE(WeightuivARB) +#define glWeightusvARB MANGLE(WeightusvARB) +#define glWindowPos2dMESA MANGLE(WindowPos2dMESA) +#define glWindowPos2dvMESA MANGLE(WindowPos2dvMESA) +#define glWindowPos2fMESA MANGLE(WindowPos2fMESA) +#define glWindowPos2fvMESA MANGLE(WindowPos2fvMESA) +#define glWindowPos2iMESA MANGLE(WindowPos2iMESA) +#define glWindowPos2ivMESA MANGLE(WindowPos2ivMESA) +#define glWindowPos2sMESA MANGLE(WindowPos2sMESA) +#define glWindowPos2svMESA MANGLE(WindowPos2svMESA) +#define glWindowPos3dMESA MANGLE(WindowPos3dMESA) +#define glWindowPos3dvMESA MANGLE(WindowPos3dvMESA) +#define glWindowPos3fMESA MANGLE(WindowPos3fMESA) +#define glWindowPos3fvMESA MANGLE(WindowPos3fvMESA) +#define glWindowPos3iMESA MANGLE(WindowPos3iMESA) +#define glWindowPos3ivMESA MANGLE(WindowPos3ivMESA) +#define glWindowPos3sMESA MANGLE(WindowPos3sMESA) +#define glWindowPos3svMESA MANGLE(WindowPos3svMESA) +#define glWindowPos4dMESA MANGLE(WindowPos4dMESA) +#define glWindowPos4dvMESA MANGLE(WindowPos4dvMESA) +#define glWindowPos4fMESA MANGLE(WindowPos4fMESA) +#define glWindowPos4fvMESA MANGLE(WindowPos4fvMESA) +#define glWindowPos4iMESA MANGLE(WindowPos4iMESA) +#define glWindowPos4ivMESA MANGLE(WindowPos4ivMESA) +#define glWindowPos4sMESA MANGLE(WindowPos4sMESA) +#define glWindowPos4svMESA MANGLE(WindowPos4svMESA) +#define glWriteMaskEXT MANGLE(WriteMaskEXT) -#endif +#endif /* GL_MANGLE_H */ -- cgit v1.2.3 From 674012f083dde5a58742a74a6b4adf266ea17ed7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 18 Jan 2002 14:55:40 +0000 Subject: updated gl_mangle.h (Ray Tice) --- include/GL/gl_mangle.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 42f36dcbe43..6aa29592162 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -1,14 +1,10 @@ -#if 0 /* $Id: gl_mangle.h,v 1.10 2002/01/16 23:51:09 brianp Exp $ */ +#if 0 /* $Id: gl_mangle.h,v 1.11 2002/01/18 14:55:40 brianp Exp $ */ # DO NOT EDIT!!! - TO REGENERATE from gl.h, EXECUTE THIS FILE IN KORN SHELL and save the output - # $Id: gl_mangle.h,v 1.10 2002/01/16 23:51:09 brianp Exp $ # This file is used to create GL function protypes and aliases for the function names files="gl.h glext.h" - #get regeneration header - everything in this file above the "REGENERATE_TO_END" line - awk 'BEGIN {copy=1} - copy==1 - /^\/\*REGENERATE_TO_END/ {copy=0} - ' $0 + #get regeneration header - copy everything in this file above the "REGENERATE_TO_END" line + awk '!done; /^\/\*REGENERATE_TO_END/ {done=1}' $0 echo "\n" #get aliases -- cgit v1.2.3 From db41d2ea8c8b6ceddf54f87268085a83d8f342ba Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 12 Feb 2002 03:24:56 +0000 Subject: Daniel Borca's new DOS/DJGPP driver. --- docs/README.DJ | 130 +++++++++ include/GL/dmesa.h | 73 +++++ src/glu/mesa/Makefile.DJ | 69 +++++ src/mesa/drivers/dos/dmesa.c | 592 ++++++++++++++++++++++++++++++++++++++++ src/mesa/drivers/dos/dmesaint.h | 231 ++++++++++++++++ src/mesa/drivers/dos/dvesa.c | 549 +++++++++++++++++++++++++++++++++++++ src/mesa/drivers/dos/dvesa.h | 127 +++++++++ src/mesa/main/Makefile.DJ | 163 +++++++++++ 8 files changed, 1934 insertions(+) create mode 100644 docs/README.DJ create mode 100644 include/GL/dmesa.h create mode 100644 src/glu/mesa/Makefile.DJ create mode 100644 src/mesa/drivers/dos/dmesa.c create mode 100644 src/mesa/drivers/dos/dmesaint.h create mode 100644 src/mesa/drivers/dos/dvesa.c create mode 100644 src/mesa/drivers/dos/dvesa.h create mode 100644 src/mesa/main/Makefile.DJ (limited to 'include') diff --git a/docs/README.DJ b/docs/README.DJ new file mode 100644 index 00000000000..c4a274cedf0 --- /dev/null +++ b/docs/README.DJ @@ -0,0 +1,130 @@ + Mesa 4.0.1 DOS/DJGPP Port version 0.1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + +First of all... +~~~~~~~~~~~~~~~ + +This is a DOS port for MESA 4.0.1. I didn't bother to consider any DOS C +compiler other than gcc, so this port was written using DJGPP v2. To be more +precise: + djdev 2.03 + gcc v3.0.3 + make v3.79 + +Almost all demos were compiled and ran succesfully on my system: + CPU: Intel Pentium w/ MMX @166 MHz + Mainboard: ViA Apollo VP2 w/ 128 MB SDRAM + Video card: Matrox Millenium I w/ 4096 kB WRAM, Matrox BIOS v3.0 + +Since I don't have access to any accelerated video hardware, this port is +entirely based on VESA/SuperVGA. My little attempt to use FreeBE/AF ended in +a failure, but that's another story: it seemed to work fine with my older +Matrox Millenium w/ 2MB, and then I got another Matrox Millenium w/ 4MB. The +problem with latter was it had a dead BIOS; I hot-flashed it and made it work +in all environments (Windows 95, VESA, etc) but FreeBE/AF. + + + +Legal: +~~~~~~ + +This software is distributed under the terms of the GNU Lesser General Public +License. + +Source code written by others is subject to its respective copyright. + + + +libGL (the core): +~~~~~~~~~~~~~~~~~ + +Of course, MESA 4.0.1 core sources are required. It will probably work with +MESA 3.5, but not a chance with earlier versions due to major changes to the +MESA driver interface and the directory tree. All should compile succesfully. + +The driver has its origins in ddsample.c, written by Brian Paul and found by +me in MESA 3.4.2. I touched almost all the functions, changing the coding +style ;-( Sorry! + +Pitfalls: +1. The current version supports only RGB[A] modes, for it made no sense to me + to endorse color-index (aka palette) modes. +2. Only double-buffered is allowed because it was simpler to implement at + that moment. Single-buffered will appear soon, especially if I can find a + way to use hardware acceleration. +3. Another weird "feature" is that buffer width & height must be multiple of + 4 (I'm a lazy programmer and I found that the easiest way to keep buffer + handling at peak performance ;-). +4. The video mode selector is tricky: it searches for the smallest mode which + will entirely contain the buffer at its current position. If you want a + small buffer in a high-res mode, try to position it very far to the right + (or down). I'd really use some ideas here!!! + + + +libGLU: +~~~~~~~ + +Mesa GLU sources are required. Everything should run smooth. + + + +libGLUT (the toolkit): +~~~~~~~~~~~~~~~~~~~~~~ + +Well, this "skeletal" GLUT implementation is not mine. Thanks should go to +Bernhard Tschirren, Mark Kilgard, Brian Paul and probably others (or probably +not ;-). I only changed it to be self-standing (Allegro-free). The keyboard, +mouse and timer drivers were inspired from an old project of mine (D3Xl) and +fixed with some Allegro "infusions"; my deeply thanks to Shawn Hargreaves and +co. + +My keyboard driver used only scancodes, but since GLUT requires ASCII values +for keys, I borrowed the translation tables (and maybe more) from Allegro. +Ctrl-Alt-Del (plus Ctrl-Alt-End, for Windows users) will shut down the GLUT +engine unconditionally: it will raise SIGINT, which in turn will call the +destructors (let's hope), thus cleaning up your/my mess ;-) + +The mouse driver is far from complete (lack of positioning, drawing, etc), +but is enough to make almost all the demos work. + +The timer is pretty versatile for it supports multiple timers with different +frequencies. It may not be the most accurate timer in the known universe, but +I think it's OK. Take this example: you have timer A with a very high rate, +and then you have timer B with very low rate compared to A; now, A ticks OK, +but timer B will probably loose precision! + +As an addition, stdout and stderr are redirected and dumped upon exit. This +means that printf can be safely called during graphics, but all messages come +in bulk! A bit of a hack, I know, but I think it's better than to miss them +at all. + +Window creating defaults: 640x480x16 at (0,0), 8-bit stencil, 16-bit accum. + + + +Installation: +~~~~~~~~~~~~~ + +Unzip into the MESA directory, and type "make -f Makefile.DJ" to compile all +libraries. Long filename support is required during compilation. The examples +are not built automagically (see Pitfalls above). + + + +History: +~~~~~~~~ + +v0.1 feb-2002 initial release +v0.2 ..soon.. + + + +Contact: +~~~~~~~~ + +Name: Borca Daniel +E-mail: dborca@yahoo.com +WWW: http://www.geocities.com/dborca/ diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h new file mode 100644 index 00000000000..bd5a34cfcb8 --- /dev/null +++ b/include/GL/dmesa.h @@ -0,0 +1,73 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v0.1 for Mesa 4.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef DMESA_included +#define DMESA_included + +#define DMESA_MAJOR_VERSION 4 +#define DMESA_MINOR_VERSION 0 + +typedef struct dmesa_context *DMesaContext; +typedef struct dmesa_visual *DMesaVisual; +typedef struct dmesa_buffer *DMesaBuffer; + +#ifdef __cplusplus +extern "C" { +#endif + +DMesaVisual DMesaCreateVisual (GLint colDepth, GLboolean dbFlag, + GLint depthSize, GLint stencilSize, + GLint accumSize); + +void DMesaDestroyVisual (DMesaVisual v); + +DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, + GLint width, GLint height, + GLint xpos, GLint ypos); + +void DMesaDestroyBuffer (DMesaBuffer b); + +DMesaContext DMesaCreateContext (DMesaVisual visual, + DMesaContext share); + +void DMesaDestroyContext (DMesaContext c); + +GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b); + +void DMesaSwapBuffers (DMesaBuffer b); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/glu/mesa/Makefile.DJ b/src/glu/mesa/Makefile.DJ new file mode 100644 index 00000000000..e09780626ba --- /dev/null +++ b/src/glu/mesa/Makefile.DJ @@ -0,0 +1,69 @@ +# Mesa 3-D graphics library +# Version: 4.0 +# +# Copyright (C) 1999 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# DOS/DJGPP glu makefile v0.1 for Mesa 4.0 +# +# Copyright (C) 2002 - Borca Daniel +# Email : dborca@yahoo.com +# Web : http://www.geocities.com/dborca + + +.PHONY: all clean + +TOP = .. +CC = gcc +CFLAGS = -I$(TOP)/include -Wall -W -Wno-unused -mcpu=pentium -ffast-math -O2 +AR = ar +ARFLAGS = ruv +LIBDIR = $(TOP)/lib + +GLU_LIB = libglu.a + +CORE_SOURCES = \ + glu.c \ + mipmap.c \ + nurbs.c \ + nurbscrv.c \ + nurbssrf.c \ + nurbsutl.c \ + polytest.c \ + project.c \ + quadric.c \ + tess.c \ + tesselat.c + +SOURCES = $(CORE_SOURCES) + +OBJECTS = $(SOURCES:.c=.o) + +.c.o: + gcc -o $@ -c $(CFLAGS) $< + +all: $(LIBDIR)/$(GLU_LIB) + +$(LIBDIR)/$(GLU_LIB): $(OBJECTS) + $(AR) $(ARFLAGS) $(LIBDIR)/$(GLU_LIB) $(OBJECTS) + +clean: + -$(RM) *.o + +include depend diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c new file mode 100644 index 00000000000..01be3012242 --- /dev/null +++ b/src/mesa/drivers/dos/dmesa.c @@ -0,0 +1,592 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v0.1 for Mesa 4.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include "glheader.h" +#include "context.h" +#include "GL/dmesa.h" +#include "matrix.h" +#include "texformat.h" +#include "texstore.h" +#include "array_cache/acache.h" +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" +#include "tnl/tnl.h" +#include "tnl/t_context.h" +#include "tnl/t_pipeline.h" +#endif + +#include "dvesa.h" +#include "dmesaint.h" + + + +/* + * In C++ terms, this class derives from the GLvisual class. + * Add system-specific fields to it. + */ +struct dmesa_visual { + GLvisual *gl_visual; + GLboolean db_flag; /* double buffered? */ + GLboolean rgb_flag; /* RGB mode? */ + GLuint depth; /* bits per pixel (1, 8, 24, etc) */ +}; + +/* + * In C++ terms, this class derives from the GLframebuffer class. + * Add system-specific fields to it. + */ +struct dmesa_buffer { + GLframebuffer *gl_buffer; /* The depth, stencil, accum, etc buffers */ + void *the_window; /* your window handle, etc */ + + int width, height; /* size in pixels */ + int xpos, ypos; /* buffer position */ + int xsize, len; /* number of bytes in a line, then total */ + int delta; /* used to wrap around */ + int offset; /* offset in video */ + struct dvmode *video; +}; + +/* + * In C++ terms, this class derives from the GLcontext class. + * Add system-specific fields to it. + */ +struct dmesa_context { + GLcontext *gl_ctx; /* the core library context */ + DMesaVisual visual; + DMesaBuffer Buffer; + GLuint ClearColor; + /* etc... */ +}; + + + +static void dmesa_update_state (GLcontext *ctx, GLuint new_state); + + + +/**********************************************************************/ +/***** Read/Write pixels *****/ +/**********************************************************************/ + + + +WRITE_RGBA_SPAN(15) +WRITE_RGBA_SPAN(16) +WRITE_RGBA_SPAN(24) +WRITE_RGBA_SPAN(32) + +WRITE_RGB_SPAN(15) +WRITE_RGB_SPAN(16) +WRITE_RGB_SPAN(24) +WRITE_RGB_SPAN(32) + +WRITE_MONO_RGBA_SPAN(15) +WRITE_MONO_RGBA_SPAN(16) +WRITE_MONO_RGBA_SPAN(24) +WRITE_MONO_RGBA_SPAN(32) + +READ_RGBA_SPAN(15) +READ_RGBA_SPAN(16) +READ_RGBA_SPAN(24) +READ_RGBA_SPAN(32) + +WRITE_RGBA_PIXELS(15) +WRITE_RGBA_PIXELS(16) +WRITE_RGBA_PIXELS(24) +WRITE_RGBA_PIXELS(32) + +WRITE_MONO_RGBA_PIXELS(15) +WRITE_MONO_RGBA_PIXELS(16) +WRITE_MONO_RGBA_PIXELS(24) +WRITE_MONO_RGBA_PIXELS(32) + +READ_RGBA_PIXELS(15) +READ_RGBA_PIXELS(16) +READ_RGBA_PIXELS(24) +READ_RGBA_PIXELS(32) + + + +/**********************************************************************/ +/***** Miscellaneous device driver funcs *****/ +/**********************************************************************/ + + + +static void clear_color (GLcontext *ctx, const GLchan color[4]) +{ + DMesaContext c = (DMesaContext)ctx->DriverCtx; + c->ClearColor = dv_color(color); +} + + + +static void clear (GLcontext *ctx, GLbitfield mask, GLboolean all, + GLint x, GLint y, GLint width, GLint height) +{ + DMesaContext c = (DMesaContext)ctx->DriverCtx; + const GLuint *colorMask = (GLuint *)&ctx->Color.ColorMask; + DMesaBuffer b = c->Buffer; + +/* + * Clear the specified region of the buffers indicated by 'mask' + * using the clear color or index as specified by one of the two + * functions above. + * If all==GL_TRUE, clear whole buffer, else just clear region defined + * by x,y,width,height + */ + + /* we can't handle color or index masking */ + if (*colorMask==0xffffffff && ctx->Color.IndexMask==0xffffffff) { + if (mask&DD_BACK_LEFT_BIT) { + if (all) { + dv_clear_virtual(b->the_window, b->len, c->ClearColor); + } else { + dv_fillrect(b->the_window, b->width, x, y, width, height, c->ClearColor); + } + mask &= ~DD_BACK_LEFT_BIT; + } + } + + if (mask) { + _swrast_Clear(ctx, mask, all, x, y, width, height); + } +} + + + +/* + * Set the current reading buffer. + */ +static void set_read_buffer (GLcontext *ctx, GLframebuffer *buffer, + GLenum mode) +{ +/* + DMesaContext c = (DMesaContext)ctx->DriverCtx; + dmesa_update_state(ctx); +*/ +} + + + +/* + * Set the destination/draw buffer. + */ +static GLboolean set_draw_buffer (GLcontext *ctx, GLenum mode) +{ + if (mode==GL_BACK_LEFT) { + return GL_TRUE; + } else { + return GL_FALSE; + } +} + + + +/* + * Return the width and height of the current buffer. + * If anything special has to been done when the buffer/window is + * resized, do it now. + */ +static void get_buffer_size (GLcontext *ctx, GLuint *width, GLuint *height) +{ + DMesaContext c = (DMesaContext)ctx->DriverCtx; + + *width = c->Buffer->width; + *height = c->Buffer->height; +} + + + +static const GLubyte* get_string (GLcontext *ctx, GLenum name) +{ + switch (name) { + case GL_RENDERER: + return (const GLubyte *)"DOS Mesa"; + default: + return NULL; + } +} + + + +/**********************************************************************/ +/***** Miscellaneous device driver funcs *****/ +/***** Note that these functions are mandatory *****/ +/**********************************************************************/ + + + +/* OPTIONAL FUNCTION: implements glFinish if possible */ +static void finish (GLcontext *ctx) +{ +/* + DMesaContext c = (DMesaContext)ctx->DriverCtx; +*/ +} + + + +/* OPTIONAL FUNCTION: implements glFlush if possible */ +static void flush (GLcontext *ctx) +{ +/* + DMesaContext c = (DMesaContext)ctx->DriverCtx; +*/ +} + + + +/**********************************************************************/ +/**********************************************************************/ + + + +/* Setup pointers and other driver state that is constant for the life + * of a context. + */ +void dmesa_init_pointers (GLcontext *ctx) +{ + TNLcontext *tnl; + + ctx->Driver.UpdateState = dmesa_update_state; + + ctx->Driver.GetString = get_string; + ctx->Driver.GetBufferSize = get_buffer_size; + ctx->Driver.Flush = flush; + ctx->Driver.Finish = finish; + + /* Software rasterizer pixel paths: + */ + ctx->Driver.Accum = _swrast_Accum; + ctx->Driver.Bitmap = _swrast_Bitmap; + ctx->Driver.Clear = clear; + ctx->Driver.ResizeBuffersMESA = _swrast_alloc_buffers; + ctx->Driver.CopyPixels = _swrast_CopyPixels; + ctx->Driver.DrawPixels = _swrast_DrawPixels; + ctx->Driver.ReadPixels = _swrast_ReadPixels; + + /* Software texture functions: + */ + ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format; + ctx->Driver.TexImage1D = _mesa_store_teximage1d; + ctx->Driver.TexImage2D = _mesa_store_teximage2d; + ctx->Driver.TexImage3D = _mesa_store_teximage3d; + ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; + ctx->Driver.TexSubImage2D = _mesa_store_texsubimage2d; + ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; + ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; + + ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; + ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; + ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; + ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; + ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; + + ctx->Driver.BaseCompressedTexFormat = _mesa_base_compressed_texformat; + ctx->Driver.CompressedTextureSize = _mesa_compressed_texture_size; + ctx->Driver.GetCompressedTexImage = _mesa_get_compressed_teximage; + + /* Swrast hooks for imaging extensions: + */ + ctx->Driver.CopyColorTable = _swrast_CopyColorTable; + ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; + ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; + ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; + + /* Statechange callbacks: + */ + ctx->Driver.SetDrawBuffer = set_draw_buffer; + ctx->Driver.ClearColor = clear_color; + + /* Initialize the TNL driver interface: + */ + tnl = TNL_CONTEXT(ctx); + tnl->Driver.RunPipeline = _tnl_run_pipeline; + + /* Install swsetup for tnl->Driver.Render.*: + */ + _swsetup_Wakeup(ctx); +} + + + +static void dmesa_update_state (GLcontext *ctx, GLuint new_state) +{ + DMesaContext c = (DMesaContext)ctx->DriverCtx; + struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); + + /* Initialize all the pointers in the DD struct. Do this whenever */ + /* a new context is made current or we change buffers via set_buffer! */ + + _swrast_InvalidateState(ctx, new_state); + _swsetup_InvalidateState(ctx, new_state); + _ac_InvalidateState(ctx, new_state); + _tnl_InvalidateState(ctx, new_state); + + swdd->SetReadBuffer = set_read_buffer; + + /* RGB(A) span/pixel functions */ + switch (c->visual->depth) { + case 15: + swdd->WriteRGBASpan = write_rgba_span_15; + swdd->WriteRGBSpan = write_rgb_span_15; + swdd->WriteMonoRGBASpan = write_mono_rgba_span_15; + swdd->WriteRGBAPixels = write_rgba_pixels_15; + swdd->WriteMonoRGBAPixels = write_mono_rgba_pixels_15; + swdd->ReadRGBASpan = read_rgba_span_15; + swdd->ReadRGBAPixels = read_rgba_pixels_15; + break; + case 16: + swdd->WriteRGBASpan = write_rgba_span_16; + swdd->WriteRGBSpan = write_rgb_span_16; + swdd->WriteMonoRGBASpan = write_mono_rgba_span_16; + swdd->WriteRGBAPixels = write_rgba_pixels_16; + swdd->WriteMonoRGBAPixels = write_mono_rgba_pixels_16; + swdd->ReadRGBASpan = read_rgba_span_16; + swdd->ReadRGBAPixels = read_rgba_pixels_16; + break; + case 24: + swdd->WriteRGBASpan = write_rgba_span_24; + swdd->WriteRGBSpan = write_rgb_span_24; + swdd->WriteMonoRGBASpan = write_mono_rgba_span_24; + swdd->WriteRGBAPixels = write_rgba_pixels_24; + swdd->WriteMonoRGBAPixels = write_mono_rgba_pixels_24; + swdd->ReadRGBASpan = read_rgba_span_24; + swdd->ReadRGBAPixels = read_rgba_pixels_24; + break; + case 32: + swdd->WriteRGBASpan = write_rgba_span_32; + swdd->WriteRGBSpan = write_rgb_span_32; + swdd->WriteMonoRGBASpan = write_mono_rgba_span_32; + swdd->WriteRGBAPixels = write_rgba_pixels_32; + swdd->WriteMonoRGBAPixels = write_mono_rgba_pixels_32; + swdd->ReadRGBASpan = read_rgba_span_32; + swdd->ReadRGBAPixels = read_rgba_pixels_32; + break; + } +} + + + +/**********************************************************************/ +/***** DMesa Public API Functions *****/ +/**********************************************************************/ + + + +/* + * The exact arguments to this function will depend on your window system + */ +DMesaVisual DMesaCreateVisual (GLint colDepth, GLboolean dbFlag, + GLint depthSize, GLint stencilSize, + GLint accumSize) +{ + DMesaVisual v; + GLint redBits, greenBits, blueBits, alphaBits; + + if (!dbFlag) { + return NULL; + } + switch (colDepth) { + case 15: + redBits = 5; + greenBits = 5; + blueBits = 5; + break; + case 16: + redBits = 5; + greenBits = 6; + blueBits = 5; + break; + case 24: + case 32: + redBits = 8; + greenBits = 8; + blueBits = 8; + break; + default: + return NULL; + } + alphaBits = 8; + + if ((v=(DMesaVisual)calloc(1, sizeof(struct dmesa_visual)))!=NULL) { + /* Create core visual */ + v->gl_visual = _mesa_create_visual(colDepth>8, /* rgb */ + dbFlag, + GL_FALSE, /* stereo */ + redBits, + greenBits, + blueBits, + alphaBits, + 0, /* indexBits */ + depthSize, + stencilSize, + accumSize, /* accumRed */ + accumSize, /* accumGreen */ + accumSize, /* accumBlue */ + alphaBits?accumSize:0, /* accumAlpha */ + 1); /* numSamples */ + + v->depth = colDepth; + v->db_flag = dbFlag; + } + + return v; +} + + + +void DMesaDestroyVisual (DMesaVisual v) +{ + _mesa_destroy_visual(v->gl_visual); + free(v); +} + + + +DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, + GLint width, GLint height, + GLint xpos, GLint ypos) +{ + DMesaBuffer b; + + if ((b=(DMesaBuffer)calloc(1, sizeof(struct dmesa_buffer)))!=NULL) { + if (visual->db_flag) { + if ((b->the_window=calloc(1, width*height*((visual->depth+7)/8)))==NULL) { + return NULL; + } + } + + b->gl_buffer = _mesa_create_framebuffer(visual->gl_visual, + visual->gl_visual->depthBits > 0, + visual->gl_visual->stencilBits > 0, + visual->gl_visual->accumRedBits > 0, + visual->gl_visual->alphaBits > 0); + b->width = width; + b->height = height; + b->xpos = xpos; + b->ypos = ypos; + } + + return b; +} + + + +void DMesaDestroyBuffer (DMesaBuffer b) +{ + free(b->the_window); + _mesa_destroy_framebuffer(b->gl_buffer); + free(b); +} + + + +DMesaContext DMesaCreateContext (DMesaVisual visual, + DMesaContext share) +{ + DMesaContext c; + GLboolean direct = GL_FALSE; + + if ((c=(DMesaContext)calloc(1, sizeof(struct dmesa_context)))!=NULL) { + c->gl_ctx = _mesa_create_context(visual->gl_visual, + share ? share->gl_ctx : NULL, + (void *)c, direct); + + /* you probably have to do a bunch of other initializations here. */ + c->visual = visual; + + /* Initialize the software rasterizer and helper modules. + */ + _swrast_CreateContext(c->gl_ctx); + _ac_CreateContext(c->gl_ctx); + _tnl_CreateContext(c->gl_ctx); + _swsetup_CreateContext(c->gl_ctx); + dmesa_init_pointers(c->gl_ctx); + } + + return c; +} + + + +void DMesaDestroyContext (DMesaContext c) +{ + _mesa_destroy_context(c->gl_ctx); + free(c); +} + + + +/* + * Make the specified context and buffer the current one. + */ +GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b) +{ + if (c&&b) { + c->Buffer = b; + if ((b->video=dv_select_mode(b->xpos, b->ypos, b->width, b->height, c->visual->depth, &b->delta, &b->offset))==NULL) { + return GL_FALSE; + } + + b->xsize = b->width*((c->visual->depth+7)/8); + b->len = b->xsize*b->height; + + dmesa_update_state(c->gl_ctx, 0); + _mesa_make_current(c->gl_ctx, b->gl_buffer); + if (c->gl_ctx->Viewport.Width==0) { + /* initialize viewport to window size */ + _mesa_Viewport(0, 0, c->Buffer->width, c->Buffer->height); + } + } else { + /* Detach */ + _mesa_make_current(NULL, NULL); + } + + return GL_TRUE; +} + + + +void DMesaSwapBuffers (DMesaBuffer b) +{ + /* copy/swap back buffer to front if applicable */ + if (b->the_window) { + dv_dump_virtual(b->the_window, b->xsize, b->height, b->offset, b->delta); + } +} diff --git a/src/mesa/drivers/dos/dmesaint.h b/src/mesa/drivers/dos/dmesaint.h new file mode 100644 index 00000000000..b8aa7064d57 --- /dev/null +++ b/src/mesa/drivers/dos/dmesaint.h @@ -0,0 +1,231 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v0.1 for Mesa 4.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef DMESAINT_H_included +#define DMESAINT_H_included + + + +#define FLIP(y) (c->Buffer->height - (y) - 1) +#define FLIP2(y) (h - (y) - 1) + + + +/**********************************************************************/ +/***** Write spans of pixels *****/ +/**********************************************************************/ +#define WRITE_RGBA_SPAN(bpp) \ +static void write_rgba_span_##bpp (const GLcontext *ctx, GLuint n, GLint x, GLint y, \ + const GLubyte rgba[][4], const GLubyte mask[]) \ +{ \ + DMesaContext c = (DMesaContext)ctx->DriverCtx; \ + void *b = c->Buffer->the_window; \ + GLuint i, offset; \ + \ + offset = c->Buffer->width * FLIP(y) + x; \ + if (mask) { \ + /* draw some pixels */ \ + for (i=0; iDriverCtx; \ + void *b = c->Buffer->the_window; \ + GLuint i, offset; \ + \ + offset = c->Buffer->width * FLIP(y) + x; \ + if (mask) { \ + /* draw some pixels */ \ + for (i=0; iDriverCtx; \ + void *b = c->Buffer->the_window; \ + GLuint i, offset, rgba = dv_color##bpp(color); \ + \ + offset = c->Buffer->width * FLIP(y) + x; \ + if (mask) { \ + /* draw some pixels */ \ + for (i=0; iDriverCtx; \ + void *b = c->Buffer->the_window; \ + GLuint i, offset; \ + \ + offset = c->Buffer->width * FLIP(y) + x; \ + /* read all pixels */ \ + for (i=0; iDriverCtx; \ + void *b = c->Buffer->the_window; \ + GLuint i, w = c->Buffer->width, h = c->Buffer->height; \ + \ + if (mask) { \ + /* draw some pixels */ \ + for (i=0; iDriverCtx; \ + void *b = c->Buffer->the_window; \ + GLuint i, w = c->Buffer->width, h = c->Buffer->height, rgba = dv_color##bpp(color); \ + \ + if (mask) { \ + /* draw some pixels */ \ + for (i=0; iDriverCtx; \ + void *b = c->Buffer->the_window; \ + GLuint i, w = c->Buffer->width, h = c->Buffer->height; \ + \ + if (mask) { \ + /* read some pixels */ \ + for (i=0; i +#include +#include +#include +#include +#include + +#include "dvesa.h" + + + +typedef struct dvmode { + int mode; + int xres, yres; + int scanlen; + int bpp; + word32 opaque; +} dvmode; + +#define _16_ *(word16 *)& +#define _32_ *(word32 *)& + +static int init; +static int selector = -1; +static int granularity; +static dvmode modes[128]; +static void (*dv_putpixel) (void *buffer, int offset, int color); +int (*dv_color) (const unsigned char rgba[]); +void (*dv_dump_virtual) (void *buffer, int width, int height, int offset, int delta); +void (*dv_clear_virtual) (void *buffer, int len, int color); + +extern void dv_dump_virtual_linear (void *buffer, int width, int height, int offset, int delta); +extern void dv_dump_virtual_banked (void *buffer, int width, int height, int offset, int delta); + +extern void dv_clear_virtual16 (void *buffer, int len, int color); +extern void dv_clear_virtual24 (void *buffer, int len, int color); +extern void dv_clear_virtual32 (void *buffer, int len, int color); + +/* lookup table for scaling 5 bit colors up to 8 bits */ +int _rgb_scale_5[32] = +{ + 0, 8, 16, 24, 32, 41, 49, 57, + 65, 74, 82, 90, 98, 106, 115, 123, + 131, 139, 148, 156, 164, 172, 180, 189, + 197, 205, 213, 222, 230, 238, 246, 255 +}; + +/* lookup table for scaling 6 bit colors up to 8 bits */ +int _rgb_scale_6[64] = +{ + 0, 4, 8, 12, 16, 20, 24, 28, + 32, 36, 40, 44, 48, 52, 56, 60, + 64, 68, 72, 76, 80, 85, 89, 93, + 97, 101, 105, 109, 113, 117, 121, 125, + 129, 133, 137, 141, 145, 149, 153, 157, + 161, 165, 170, 174, 178, 182, 186, 190, + 194, 198, 202, 206, 210, 214, 218, 222, + 226, 230, 234, 238, 242, 246, 250, 255 +}; + + + +/* + * colors + */ +int dv_color15 (const unsigned char rgba[]) +{ + return ((rgba[0]>>3)<<10)|((rgba[1]>>3)<<5)|(rgba[2]>>3); +} +int dv_color16 (const unsigned char rgba[]) +{ + return ((rgba[0]>>3)<<11)|((rgba[1]>>2)<<5)|(rgba[2]>>3); +} +int dv_color32 (const unsigned char rgba[]) +{ + return (rgba[0]<<16)|(rgba[1]<<8)|(rgba[2]); +} + + + +/* + * getpixel + decompose + */ +void dv_getrgba15 (void *buffer, int offset, unsigned char rgba[4]) +{ + int c = ((word16 *)buffer)[offset]; + rgba[0] = _rgb_scale_5[(c >> 10) & 0x1F]; + rgba[1] = _rgb_scale_5[(c >> 5) & 0x1F]; + rgba[2] = _rgb_scale_5[c & 0x1F]; + rgba[3] = 255; +} +void dv_getrgba16 (void *buffer, int offset, unsigned char rgba[4]) +{ + int c = ((word16 *)buffer)[offset]; + rgba[0] = _rgb_scale_5[(c >> 11) & 0x1F]; + rgba[1] = _rgb_scale_6[(c >> 5) & 0x3F]; + rgba[2] = _rgb_scale_5[c & 0x1F]; + rgba[3] = 255; +} +void dv_getrgba24 (void *buffer, int offset, unsigned char rgba[4]) +{ + int c = *(word32 *)(buffer+offset*3); + rgba[0] = c >> 16; + rgba[1] = c >> 8; + rgba[2] = c; + rgba[3] = 255; +} +void dv_getrgba32 (void *buffer, int offset, unsigned char rgba[4]) +{ + int c = ((word32 *)buffer)[offset]; + rgba[0] = c >> 16; + rgba[1] = c >> 8; + rgba[2] = c; + rgba[3] = 255; +} + + + +/* + * request mapping from DPMI + */ +static word32 _map_linear (word32 phys, word32 len) +{ + __dpmi_meminfo meminfo; + + if (phys >= 0x100000) { + /* map into linear memory */ + meminfo.address = (long)phys; + meminfo.size = len; + if (__dpmi_physical_address_mapping(&meminfo)) { + return 0; + } + return meminfo.address; + } else { + /* exploit 1 -> 1 physical to linear mapping in low megabyte */ + return phys; + } +} + + + +/* + * attempts to detect VESA and video modes + */ +static word16 dv_get_vesa (void) +{ + __dpmi_regs r; + unsigned short *p; + dvmode *q; + char vesa_info[512], tmp[512]; + + _farpokel(_stubinfo->ds_selector, 0, 0x32454256); + r.x.ax = 0x4f00; + r.x.di = 0; + r.x.es = _stubinfo->ds_segment; + __dpmi_int(0x10, &r); + if (r.x.ax==0x004f) { + movedata(_stubinfo->ds_selector, 0, _my_ds(), (unsigned)vesa_info, 512); + if ((_32_ vesa_info[0])==0x41534556) { + p = (unsigned short *)(((_16_ vesa_info[0x10])<<4) + (_16_ vesa_info[0x0e])); + q = modes; + do { + if ((q->mode=_farpeekw(__djgpp_dos_sel, (unsigned long)(p++)))==0xffff) { + break; + } + + r.x.ax = 0x4f01; + r.x.cx = q->mode; + r.x.di = 512; + r.x.es = _stubinfo->ds_segment; + __dpmi_int(0x10, &r); + movedata(_stubinfo->ds_selector, 512, _my_ds(), (unsigned)tmp, 256); + switch (tmp[0x19]) { + case 16: + q->bpp = tmp[0x1f] + tmp[0x21] + tmp[0x23]; + break; + case 15: + case 24: + case 32: + q->bpp = tmp[0x19]; + break; + default: + q->bpp = 0; + } + if ((r.x.ax==0x004f)&&((tmp[0]&0x11)==0x11)&&q->bpp) { + q->xres = _16_ tmp[0x12]; + q->yres = _16_ tmp[0x14]; + q->scanlen = _16_ tmp[0x10]; + q->opaque = (_16_ tmp[4])<<10; + if (tmp[0]&0x80) { + *(q+1) = *q++; + q->opaque = _32_ tmp[0x28]; + q->mode |= 0x4000; + } + q++; + } + } while (!0); + + return _16_ vesa_info[4]; + } + } + + return 0; +} + + + +/* + * select a mode + */ +dvmode *dv_select_mode (int x, int y, int width, int height, int depth, int *delta, int *offset) +{ + dvmode *p, *q; + unsigned int min; + + if ((width&3)||(height&3)||(depth<=8)) { + return NULL; + } + + if (!init) { + init = !init; + if (!dv_get_vesa()) { + return NULL; + } + } + + for (min=-1, p=NULL, q=modes; q->mode!=0xffff; q++) { + if ((q->xres>=(x+width))&&(q->yres>=(y+height))&&(q->bpp==depth)) { + if (min>(unsigned)(q->xres*q->yres)) { + min = q->xres*q->yres; + p = q; + } + } + } + + if (p) { + int sel = -1; + unsigned base, limit; + + if ((p->mode|0x4000)==(p+1)->mode) { + p++; + } + + if (selector==-1) { + if ((selector=sel=__dpmi_allocate_ldt_descriptors(1))==-1) { + return NULL; + } + } + if (p->mode&0x4000) { + limit = ((p->scanlen*p->yres+0xfffUL)&~0xfffUL) - 1; + if ((base=_map_linear(p->opaque, limit))==NULL) { + if (sel!=-1) { + selector = -1; + __dpmi_free_ldt_descriptor(sel); + } + return NULL; + } + dv_dump_virtual = dv_dump_virtual_linear; + } else { + limit = granularity = p->opaque; + base = 0xa0000; + dv_dump_virtual = dv_dump_virtual_banked; + } + __dpmi_set_segment_base_address(selector, base); + __dpmi_set_descriptor_access_rights(selector, ((_my_ds()&3)<<5)|0x4092); + __dpmi_set_segment_limit(selector, limit); + + switch (p->bpp) { + case 15: + dv_clear_virtual = dv_clear_virtual16; + dv_putpixel = dv_putpixel16; + dv_color = dv_color15; + break; + case 16: + dv_clear_virtual = dv_clear_virtual16; + dv_putpixel = dv_putpixel16; + dv_color = dv_color16; + break; + case 24: + dv_clear_virtual = dv_clear_virtual24; + dv_putpixel = dv_putpixel24; + dv_color = dv_color32; + break; + case 32: + dv_clear_virtual = dv_clear_virtual32; + dv_putpixel = dv_putpixel32; + dv_color = dv_color32; + break; + default: + dv_clear_virtual = NULL; + dv_putpixel = NULL; + } + + *delta = p->scanlen - ((depth+7)/8) * width; + *offset = p->scanlen*y + ((depth+7)/8) * x; + + __asm__("movw $0x4f02, %%ax; int $0x10"::"b"(p->mode):"%eax"); + } + + return p; +} + + + +/* + * fill rectangle + */ +void dv_fillrect (void *buffer, int bwidth, int x, int y, int width, int height, int color) +{ + int i, offset; + + offset = y*bwidth + x; + bwidth -= width; + for (height+=y; y>16); +} +extern __inline__ void dv_putpixel32 (void *buffer, int offset, int color) +{ + ((word32 *)buffer)[offset] = color; +} + +/* + * dv_color inlines + */ +extern __inline__ int dv_color15 (const unsigned char rgba[]) +{ + return ((rgba[0]>>3)<<10)|((rgba[1]>>3)<<5)|(rgba[2]>>3); +} +extern __inline__ int dv_color16 (const unsigned char rgba[]) +{ + return ((rgba[0]>>3)<<11)|((rgba[1]>>2)<<5)|(rgba[2]>>3); +} +#define dv_color24 dv_color32 +extern __inline__ int dv_color32 (const unsigned char rgba[]) +{ + return (rgba[0]<<16)|(rgba[1]<<8)|(rgba[2]); +} + +/* + * dv_getrgba inlines + */ +extern __inline__ void dv_getrgba15 (void *buffer, int offset, unsigned char rgba[4]) +{ + int c = ((word16 *)buffer)[offset]; + rgba[0] = _rgb_scale_5[(c >> 10) & 0x1F]; + rgba[1] = _rgb_scale_5[(c >> 5) & 0x1F]; + rgba[2] = _rgb_scale_5[c & 0x1F]; + rgba[3] = 255; +} +extern __inline__ void dv_getrgba16 (void *buffer, int offset, unsigned char rgba[4]) +{ + int c = ((word16 *)buffer)[offset]; + rgba[0] = _rgb_scale_5[(c >> 11) & 0x1F]; + rgba[1] = _rgb_scale_6[(c >> 5) & 0x3F]; + rgba[2] = _rgb_scale_5[c & 0x1F]; + rgba[3] = 255; +} +extern __inline__ void dv_getrgba24 (void *buffer, int offset, unsigned char rgba[4]) +{ + int c = *(word32 *)(buffer+offset*3); + rgba[0] = c >> 16; + rgba[1] = c >> 8; + rgba[2] = c; + rgba[3] = 255; +} +extern __inline__ void dv_getrgba32 (void *buffer, int offset, unsigned char rgba[4]) +{ + int c = ((word32 *)buffer)[offset]; + rgba[0] = c >> 16; + rgba[1] = c >> 8; + rgba[2] = c; + rgba[3] = 255; +} + +#endif diff --git a/src/mesa/main/Makefile.DJ b/src/mesa/main/Makefile.DJ new file mode 100644 index 00000000000..4895cc30088 --- /dev/null +++ b/src/mesa/main/Makefile.DJ @@ -0,0 +1,163 @@ +# DOS/DJGPP core makefile v0.1 for Mesa 4.0.x +# +# Copyright (C) 2002 - Borca Daniel +# Email : dborca@yahoo.com +# Web : http://www.geocities.com/dborca + + +.PHONY: all clean + +TOP = .. +CC = gcc +CFLAGS = -I$(TOP)/include -I. -Wall -W -Wno-unused -mcpu=pentium -ffast-math -O2 +AR = ar +ARFLAGS = ruv +LIBDIR = $(TOP)/lib + +GL_LIB = libgl.a + +CORE_SOURCES = \ + accum.c \ + api_arrayelt.c \ + api_loopback.c \ + api_noop.c \ + api_validate.c \ + array_cache/ac_context.c \ + array_cache/ac_import.c \ + attrib.c \ + blend.c \ + buffers.c \ + clip.c \ + colortab.c \ + config.c \ + context.c \ + convolve.c \ + debug.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 \ + glthread.c \ + hash.c \ + hint.c \ + histogram.c \ + image.c \ + imports.c \ + light.c \ + lines.c \ + math/m_debug_clip.c \ + math/m_debug_norm.c \ + math/m_debug_vertex.c \ + math/m_debug_xform.c \ + math/m_eval.c \ + math/m_matrix.c \ + math/m_translate.c \ + math/m_vector.c \ + math/m_vertices.c \ + math/m_xform.c \ + matrix.c \ + mem.c \ + mmath.c \ + pixel.c \ + points.c \ + polygon.c \ + rastpos.c \ + state.c \ + stencil.c \ + swrast/s_aaline.c \ + swrast/s_aatriangle.c \ + swrast/s_accum.c \ + swrast/s_alpha.c \ + swrast/s_alphabuf.c \ + swrast/s_bitmap.c \ + swrast/s_blend.c \ + swrast/s_buffers.c \ + swrast/s_context.c \ + swrast/s_copypix.c \ + swrast/s_depth.c \ + swrast/s_drawpix.c \ + swrast/s_feedback.c \ + swrast/s_fog.c \ + swrast/s_histogram.c \ + swrast/s_imaging.c \ + swrast/s_lines.c \ + swrast/s_logic.c \ + swrast/s_masking.c \ + swrast/s_pb.c \ + swrast/s_pixeltex.c \ + swrast/s_points.c \ + swrast/s_readpix.c \ + swrast/s_scissor.c \ + swrast/s_span.c \ + swrast/s_stencil.c \ + swrast/s_texstore.c \ + swrast/s_texture.c \ + swrast/s_triangle.c \ + swrast/s_zoom.c \ + swrast_setup/ss_context.c \ + swrast_setup/ss_triangle.c \ + swrast_setup/ss_vb.c \ + texformat.c \ + teximage.c \ + texobj.c \ + texstate.c \ + texstore.c \ + texutil.c \ + tnl/t_array_api.c \ + tnl/t_array_import.c \ + tnl/t_context.c \ + tnl/t_eval_api.c \ + tnl/t_imm_alloc.c \ + tnl/t_imm_api.c \ + tnl/t_imm_debug.c \ + tnl/t_imm_dlist.c \ + tnl/t_imm_elt.c \ + tnl/t_imm_eval.c \ + tnl/t_imm_exec.c \ + tnl/t_imm_fixup.c \ + tnl/t_pipeline.c \ + tnl/t_vb_fog.c \ + tnl/t_vb_light.c \ + tnl/t_vb_normals.c \ + tnl/t_vb_points.c \ + tnl/t_vb_render.c \ + tnl/t_vb_texgen.c \ + tnl/t_vb_texmat.c \ + tnl/t_vb_vertex.c \ + varray.c \ + vtxfmt.c + +DRIVER_SOURCES = DOS/dmesa.c DOS/dvesa.c + +SOURCES = $(CORE_SOURCES) $(DRIVER_SOURCES) + +OBJECTS = $(SOURCES:.c=.o) + +.c.o: + gcc -o $@ -c $(CFLAGS) $< + +all: $(LIBDIR)/$(GL_LIB) + +$(LIBDIR)/$(GL_LIB): $(OBJECTS) + $(AR) $(ARFLAGS) $(LIBDIR)/$(GL_LIB) $(OBJECTS) + +clean: + -$(RM) *.o + -$(RM) DOS\*.o + +include depend + +DOS/dmesa.o: DOS/dmesa.c glheader.h ../include/GL/gl.h context.h glapi.h \ + mtypes.h config.h glapitable.h glthread.h math/m_matrix.h dd.h \ + ../include/GL/dmesa.h matrix.h texformat.h texstore.h array_cache/acache.h \ + swrast/swrast.h swrast_setup/swrast_setup.h tnl/tnl.h tnl/t_context.h \ + math/m_vector.h math/m_xform.h tnl/t_pipeline.h DOS/dvesa.h DOS/dmesaint.h +DOS/dvesa.o: DOS/dvesa.c DOS/dvesa.h -- cgit v1.2.3 From 78a21f96b5664b813c0d7b19db5cebd60c644deb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 15 Feb 2002 16:41:36 +0000 Subject: added new depth_texture/shadow tokens (temporary) --- include/GL/gl.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 9c3a9768629..c0ce01fff72 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.62 2001/12/05 22:01:13 brianp Exp $ */ +/* $Id: gl.h,v 1.63 2002/02/15 16:41:36 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2529,7 +2529,6 @@ GLAPI void GLAPIENTRY glWindowPos3svARB(const GLshort *p); /* XXX not finalized yet - just testing */ #define GL_TEXTURE_COMPARE_MODE_ARB 0x9990 #define GL_TEXTURE_COMPARE_FUNC_ARB 0x9991 -#define GL_TEXTURE_COMPARE_RESULT_ARB 0x9992 #define GL_COMPARE_R_TO_TEXTURE_ARB 0x9993 #endif @@ -2551,6 +2550,8 @@ GLAPI void GLAPIENTRY glWindowPos3svARB(const GLshort *p); #define GL_DEPTH_COMPONENT16_ARB 0x81A5 #define GL_DEPTH_COMPONENT24_ARB 0x81A6 #define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x7776 +#define GL_DEPTH_TEXTURE_MODE_ARB 0x7777 #endif -- cgit v1.2.3 From e0193a9425807cc61779c3b8680c5b551685ba65 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 23 Feb 2002 17:11:27 +0000 Subject: DOS updates from Daniel Borca --- docs/README.DJ | 102 ++++---- include/GL/dmesa.h | 14 +- src/glut/dos/Makefile.DJ | 21 +- src/glut/dos/PC_HW/pc_irq.S | 6 +- src/glut/dos/PC_HW/pc_mouse.c | 10 +- src/glut/dos/init.c | 3 +- src/glut/dos/internal.h | 6 +- src/glut/dos/state.c | 25 +- src/glut/dos/window.c | 106 +++++--- src/mesa/drivers/dos/dmesa.c | 563 ++++++++++++++++++++++++++++++++++-------- src/mesa/main/Makefile.DJ | 90 ++++--- 11 files changed, 711 insertions(+), 235 deletions(-) (limited to 'include') diff --git a/docs/README.DJ b/docs/README.DJ index c4a274cedf0..e20454a3d2e 100644 --- a/docs/README.DJ +++ b/docs/README.DJ @@ -1,73 +1,77 @@ - Mesa 4.0.1 DOS/DJGPP Port version 0.1 + Mesa 4.0.1 DOS/DJGPP Port version 0.2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -First of all... -~~~~~~~~~~~~~~~ +Description: +~~~~~~~~~~~~ -This is a DOS port for MESA 4.0.1. I didn't bother to consider any DOS C -compiler other than gcc, so this port was written using DJGPP v2. To be more -precise: - djdev 2.03 - gcc v3.0.3 - make v3.79 - -Almost all demos were compiled and ran succesfully on my system: - CPU: Intel Pentium w/ MMX @166 MHz - Mainboard: ViA Apollo VP2 w/ 128 MB SDRAM - Video card: Matrox Millenium I w/ 4096 kB WRAM, Matrox BIOS v3.0 - -Since I don't have access to any accelerated video hardware, this port is -entirely based on VESA/SuperVGA. My little attempt to use FreeBE/AF ended in -a failure, but that's another story: it seemed to work fine with my older -Matrox Millenium w/ 2MB, and then I got another Matrox Millenium w/ 4MB. The -problem with latter was it had a dead BIOS; I hot-flashed it and made it work -in all environments (Windows 95, VESA, etc) but FreeBE/AF. +This is the DOS port of MESA 4.0, for DJGPP programmers... It features some +sort of hardware acceleration, but it's pretty thin: it is entirely based on +VBEAF.DRV from the FreeBE/AF project (http://www.talula.demon.co.uk/freebe/). +Note that SciTech's driver isn't supported because I hate the `nearptr' hack. +Anyway, these drivers don't provide ANY 3D function :-( Moreover, it seems to +me the FreeBE/AF project is not really up to date... Well, it's not much, my +intention was to open the door ;-) Legal: ~~~~~~ -This software is distributed under the terms of the GNU Lesser General Public -License. +MESA copyright applies. + + + +Installation: +~~~~~~~~~~~~~ + +Type "make -f Makefile.DJ" to compile the libraries. Long filename support is +required during compilation. The examples are not built automagically (see +Pitfalls below). -Source code written by others is subject to its respective copyright. +Tested on: + CPU: Intel Pentium w/ MMX @166 MHz + Mainboard: ViA Apollo VP2 w/ 128 MB SDRAM + Video card: Matrox Millenium 2064W w/ 2048 kB WRAM, BIOS v3.0 + DJGPP: djdev 2.03 + gcc v3.0.3 + make v3.79 libGL (the core): ~~~~~~~~~~~~~~~~~ -Of course, MESA 4.0.1 core sources are required. It will probably work with +Of course, MESA 4.0 core sources are required. It will probably work with MESA 3.5, but not a chance with earlier versions due to major changes to the MESA driver interface and the directory tree. All should compile succesfully. The driver has its origins in ddsample.c, written by Brian Paul and found by me in MESA 3.4.2. I touched almost all the functions, changing the coding -style ;-( Sorry! +style :-( Sorry! Pitfalls: 1. The current version supports only RGB[A] modes, for it made no sense to me to endorse color-index (aka palette) modes. -2. Only double-buffered is allowed because it was simpler to implement at - that moment. Single-buffered will appear soon, especially if I can find a - way to use hardware acceleration. -3. Another weird "feature" is that buffer width & height must be multiple of - 4 (I'm a lazy programmer and I found that the easiest way to keep buffer - handling at peak performance ;-). -4. The video mode selector is tricky: it searches for the smallest mode which - will entirely contain the buffer at its current position. If you want a - small buffer in a high-res mode, try to position it very far to the right - (or down). I'd really use some ideas here!!! +2. Double-buffered uses page flipping if acceleration is available, else falls + back to virtual buffer. +3. Single-buffered is not allowed with 24-bit modes, because direct access was + wrong and fixing it would mean to slow down the other routines; until this + is really, really necessary, it won't get reimplemented. +4. Another weird "feature" is that buffer width must be multiple of 4 (I'm a + lazy programmer and I found that the easiest way to keep buffer handling at + peak performance ;-). +5. The FreeBE/AF driver is searched in the current directory only; therefore, + to disable hardware acceleration, make sure you don't have VBEAF.DRV where + your application resides. libGLU: ~~~~~~~ -Mesa GLU sources are required. Everything should run smooth. +Mesa GLU sources are required. No comment! @@ -78,8 +82,7 @@ Well, this "skeletal" GLUT implementation is not mine. Thanks should go to Bernhard Tschirren, Mark Kilgard, Brian Paul and probably others (or probably not ;-). I only changed it to be self-standing (Allegro-free). The keyboard, mouse and timer drivers were inspired from an old project of mine (D3Xl) and -fixed with some Allegro "infusions"; my deeply thanks to Shawn Hargreaves and -co. +fixed with some Allegro "infusions"; I deeply thank to Shawn Hargreaves et co. My keyboard driver used only scancodes, but since GLUT requires ASCII values for keys, I borrowed the translation tables (and maybe more) from Allegro. @@ -102,15 +105,7 @@ in bulk! A bit of a hack, I know, but I think it's better than to miss them at all. Window creating defaults: 640x480x16 at (0,0), 8-bit stencil, 16-bit accum. - - - -Installation: -~~~~~~~~~~~~~ - -Unzip into the MESA directory, and type "make -f Makefile.DJ" to compile all -libraries. Long filename support is required during compilation. The examples -are not built automagically (see Pitfalls above). +However, the video mode is chosen in such a way that first window will fit. @@ -118,7 +113,16 @@ History: ~~~~~~~~ v0.1 feb-2002 initial release -v0.2 ..soon.. +v0.2 feb-2002 + fast triangle rasterizers + + enabled sw and 1.3 extensions + + hardware acceleration: FreeBE/AF + + single-buffer modes (15-, 16-, and 32-bit) + * video mode is set by CreateVisual, not MakeCurrent + * internal changes to support multi-buf (unfinished) + ! fixed some alpha issues... (thanks, Brian) + + glut has now an internal timer + * glut changed to support multi-window (unfinished) + ! minor PC_HW corrections diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h index bd5a34cfcb8..eaf0ecafc07 100644 --- a/include/GL/dmesa.h +++ b/include/GL/dmesa.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v0.1 for Mesa 4.0 + * DOS/DJGPP device driver v0.2 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -45,20 +45,20 @@ typedef struct dmesa_buffer *DMesaBuffer; extern "C" { #endif -DMesaVisual DMesaCreateVisual (GLint colDepth, GLboolean dbFlag, - GLint depthSize, GLint stencilSize, +DMesaVisual DMesaCreateVisual (GLint width, GLint height, GLint colDepth, + GLboolean dbFlag, GLint depthSize, + GLint stencilSize, GLint accumSize); void DMesaDestroyVisual (DMesaVisual v); DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, - GLint width, GLint height, - GLint xpos, GLint ypos); + GLint xpos, GLint ypos, + GLint width, GLint height); void DMesaDestroyBuffer (DMesaBuffer b); -DMesaContext DMesaCreateContext (DMesaVisual visual, - DMesaContext share); +DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share); void DMesaDestroyContext (DMesaContext c); diff --git a/src/glut/dos/Makefile.DJ b/src/glut/dos/Makefile.DJ index a8d176cbf4a..7cacd8d0090 100644 --- a/src/glut/dos/Makefile.DJ +++ b/src/glut/dos/Makefile.DJ @@ -20,7 +20,7 @@ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# DOS/DJGPP glut makefile v0.1 for Mesa 4.0 +# DOS/DJGPP glut makefile v0.2 for Mesa 4.0 # # Copyright (C) 2002 - Borca Daniel # Email : dborca@yahoo.com @@ -78,4 +78,21 @@ clean: -$(RM) *.o -$(RM) PC_HW\*.o -include depend +callback.o: callback.c ../include/GL/glut.h internal.h PC_HW/pc_hw.h +color.o: color.c ../include/GL/glut.h +font.o: font.c ../include/GL/glut.h +globals.o: globals.c ../include/GL/glut.h internal.h PC_HW/pc_hw.h +init.o: init.c ../include/GL/glut.h internal.h PC_HW/pc_hw.h +menu.o: menu.c ../include/GL/glut.h +models.o: models.c ../include/GL/glut.h +overlay.o: overlay.c ../include/GL/glut.h +state.o: state.c ../include/GL/glut.h internal.h pc_hw/pc_hw.h +teapot.o: teapot.c ../include/GL/glut.h +window.o: window.c ../include/GL/glut.h ../include/GL/dmesa.h internal.h \ + PC_HW/pc_hw.h + +PC_HW/pc_hw.o: PC_HW/pc_hw.c PC_HW/pc_hw.h +PC_HW/pc_keyb.o: PC_HW/pc_keyb.c PC_HW/pc_hw.h +PC_HW/pc_mouse.o: PC_HW/pc_mouse.c PC_HW/pc_hw.h +PC_HW/pc_timer.o: PC_HW/pc_timer.c PC_HW/pc_hw.h +PC_HW/pc_irq.o: PC_HW/pc_irq.S diff --git a/src/glut/dos/PC_HW/pc_irq.S b/src/glut/dos/PC_HW/pc_irq.S index 2a6302f71a2..8f19f8eb9f4 100644 --- a/src/glut/dos/PC_HW/pc_irq.S +++ b/src/glut/dos/PC_HW/pc_irq.S @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v0.1 for DOS/DJGPP + * PC/HW routine collection v0.2 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -129,7 +129,7 @@ __irq_wrapper_##x: ; \ pushl %es ; \ pushl %fs ; \ pushl %gs ; \ - movw %ss, %bx ; \ + movl %ss, %ebx ; \ movl %esp, %esi ; \ movl %cs:___djgpp_ds_alias, %ss ; \ movl %cs:__irq_stack_##x, %esp ; \ @@ -141,7 +141,7 @@ __irq_wrapper_##x: ; \ pushl %fs ; \ popl %gs ; \ call *__irq_hook_##x ; \ - movw %bx, %ss ; \ + movl %ebx, %ss ; \ movl %esi, %esp ; \ testl %eax, %eax ; \ popl %gs ; \ diff --git a/src/glut/dos/PC_HW/pc_mouse.c b/src/glut/dos/PC_HW/pc_mouse.c index cc3396cb213..2a692eceb66 100644 --- a/src/glut/dos/PC_HW/pc_mouse.c +++ b/src/glut/dos/PC_HW/pc_mouse.c @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v0.1 for DOS/DJGPP + * PC/HW routine collection v0.2 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -15,6 +15,12 @@ #define MOUSE_STACK_SIZE 16384 +#define CLEAR_MICKEYS() \ + do { \ + __asm__ __volatile__ ("movw $0xb, %%ax; int $0x33":::"%eax", "%ecx", "%edx"); \ + ox = oy = 0; \ + } while (0) + extern void mouse_wrapper (void); extern void mouse_wrapper_end (void); @@ -161,6 +167,8 @@ int pc_install_mouse (void) mouse_regs.x.es = mouse_callback>>16; __dpmi_int(0x33, &mouse_regs); + CLEAR_MICKEYS(); + emulat3 = buttons<3; pc_atexit(pc_remove_mouse); return buttons; diff --git a/src/glut/dos/init.c b/src/glut/dos/init.c index d3f45821701..41170e37c92 100644 --- a/src/glut/dos/init.c +++ b/src/glut/dos/init.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v0.1 for Mesa 4.0 + * DOS/DJGPP glut driver v0.2 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -45,6 +45,7 @@ static void signal_handler (int num) void APIENTRY glutInit (int *argcp, char **argv) { + glutGet(GLUT_ELAPSED_TIME); /* Hack alert: only SIGINT (but not Ctrl-Break) calls the destructors and will safely clean up diff --git a/src/glut/dos/internal.h b/src/glut/dos/internal.h index f6c2c4d00c4..2822c2c5ab0 100644 --- a/src/glut/dos/internal.h +++ b/src/glut/dos/internal.h @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v0.1 for Mesa 4.0 + * DOS/DJGPP glut driver v0.2 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -35,9 +35,11 @@ #include "pc_hw/pc_hw.h" +#define MAX_WINDOWS 4 + #define DEFAULT_WIDTH 640 #define DEFAULT_HEIGHT 480 -#define COLOR_DEPTH 16 +#define DEFAULT_BPP 16 #define DEPTH_SIZE 16 #define STENCIL_SIZE 8 diff --git a/src/glut/dos/state.c b/src/glut/dos/state.c index 9e5624deb4c..94ef0cac795 100644 --- a/src/glut/dos/state.c +++ b/src/glut/dos/state.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v0.1 for Mesa 4.0 + * DOS/DJGPP glut driver v0.2 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -28,6 +28,21 @@ #include "GL/glut.h" +#include "internal.h" + + +#define FREQUENCY 100 + + +static int timer_installed; +static volatile int ticks; + +static void ticks_timer (void *p) +{ + (void)p; + ticks++; +} ENDOFUNC(ticks_timer) + int APIENTRY glutGet (GLenum type) @@ -35,6 +50,14 @@ int APIENTRY glutGet (GLenum type) switch (type) { case GLUT_WINDOW_RGBA: return 1; + case GLUT_ELAPSED_TIME: + if (!timer_installed) { + timer_installed = !timer_installed; + LOCKDATA(ticks); + LOCKFUNC(ticks_timer); + pc_install_int(ticks_timer, NULL, FREQUENCY); + } + return ticks*1000/FREQUENCY; default: return 0; } diff --git a/src/glut/dos/window.c b/src/glut/dos/window.c index 6d52524dfbd..c110715ebb3 100644 --- a/src/glut/dos/window.c +++ b/src/glut/dos/window.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v0.1 for Mesa 4.0 + * DOS/DJGPP glut driver v0.2 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -32,50 +32,89 @@ #include "internal.h" + +static int window; + static DMesaVisual visual = NULL; static DMesaContext context = NULL; -static DMesaBuffer buffer = NULL; +static DMesaBuffer buffer[MAX_WINDOWS]; + static void clean (void) { - __asm__("movw $3, %%ax; int $0x10":::"%eax"); + int i; + + for (i=0; iBuffer->height - (y) - 1) +#define FLIP2(y) (h - (y) - 1) + + + +static void write_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, + const GLubyte rgba[][4], const GLubyte mask[]) +{ + DMesaContext c = (DMesaContext)ctx->DriverCtx; + void *b = c->Buffer->the_window; + GLuint i, offset; + + offset = c->Buffer->cwidth * FLIP(y) + x; + if (mask) { + /* draw some pixels */ + for (i=0; iDriverCtx; + void *b = c->Buffer->the_window; + GLuint i, offset; -WRITE_RGB_SPAN(15) -WRITE_RGB_SPAN(16) -WRITE_RGB_SPAN(24) -WRITE_RGB_SPAN(32) + offset = c->Buffer->cwidth * FLIP(y) + x; + if (mask) { + /* draw some pixels */ + for (i=0; iDriverCtx; + void *b = c->Buffer->the_window; + GLuint i, offset, rgba = vl_mixrgba(color); + + offset = c->Buffer->cwidth * FLIP(y) + x; + if (mask) { + /* draw some pixels */ + for (i=0; iDriverCtx; + void *b = c->Buffer->the_window; + GLuint i, offset; + + offset = c->Buffer->cwidth * FLIP(y) + x; + /* read all pixels */ + for (i=0; iDriverCtx; + void *b = c->Buffer->the_window; + GLuint i, w = c->Buffer->cwidth, h = c->Buffer->height; -WRITE_MONO_RGBA_SPAN(15) -WRITE_MONO_RGBA_SPAN(16) -WRITE_MONO_RGBA_SPAN(24) -WRITE_MONO_RGBA_SPAN(32) + if (mask) { + /* draw some pixels */ + for (i=0; iDriverCtx; + void *b = c->Buffer->the_window; + GLuint i, w = c->Buffer->cwidth, h = c->Buffer->height, rgba = vl_mixrgba(color); -WRITE_RGBA_PIXELS(15) -WRITE_RGBA_PIXELS(16) -WRITE_RGBA_PIXELS(24) -WRITE_RGBA_PIXELS(32) + if (mask) { + /* draw some pixels */ + for (i=0; iDriverCtx; + void *b = c->Buffer->the_window; + GLuint i, w = c->Buffer->cwidth, h = c->Buffer->height; -READ_RGBA_PIXELS(15) -READ_RGBA_PIXELS(16) -READ_RGBA_PIXELS(24) -READ_RGBA_PIXELS(32) + if (mask) { + /* read some pixels */ + for (i=0; iDriverCtx; + void *b = c->Buffer->the_window; + GLuint w = c->Buffer->cwidth, h = c->Buffer->height; + + if (c->Buffer->tri_rgb_flat) { + c->Buffer->tri_rgb_flat(IROUND(v0->win[0]), IROUND(FLIP2(v0->win[1])), + IROUND(v1->win[0]), IROUND(FLIP2(v1->win[1])), + IROUND(v2->win[0]), IROUND(FLIP2(v2->win[1])), + vl_mixrgb(v2->color)); + } else { +#define SETUP_CODE GLuint rgb = vl_mixrgb(v2->color); + +#define RENDER_SPAN(span) \ + GLuint i, offset = FLIP2(span.y)*w + span.x; \ + for (i = 0; i < span.count; i++, offset++) { \ + vl_putpixel(b, offset, rgb); \ + } + +#include "swrast/s_tritemp.h" + } +} + + + +/* + * flat, depth-buffered, triangle. + */ +static void tri_rgb_flat_z (GLcontext *ctx, + const SWvertex *v0, + const SWvertex *v1, + const SWvertex *v2) +{ + DMesaContext c = (DMesaContext)ctx->DriverCtx; + void *b = c->Buffer->the_window; + GLuint w = c->Buffer->cwidth, h = c->Buffer->height; + +#define INTERP_Z 1 +#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE +#define SETUP_CODE GLuint rgb = vl_mixrgb(v2->color); + +#define RENDER_SPAN(span) \ + GLuint i, offset = FLIP2(span.y)*w + span.x; \ + for (i = 0; i < span.count; i++, offset++) { \ + const DEPTH_TYPE z = FixedToDepth(span.z); \ + if (z < zRow[i]) { \ + vl_putpixel(b, offset, rgb); \ + zRow[i] = z; \ + } \ + span.z += span.zStep; \ + } + +#include "swrast/s_tritemp.h" +} + + + +/* + * smooth, NON-depth-buffered, triangle. + */ +static void tri_rgb_smooth (GLcontext *ctx, + const SWvertex *v0, + const SWvertex *v1, + const SWvertex *v2) +{ + DMesaContext c = (DMesaContext)ctx->DriverCtx; + void *b = c->Buffer->the_window; + GLuint w = c->Buffer->cwidth, h = c->Buffer->height; + +#define INTERP_RGB 1 +#define RENDER_SPAN(span) \ + GLuint i, offset = FLIP2(span.y)*w + span.x; \ + for (i = 0; i < span.count; i++, offset++) { \ + unsigned char rgb[3]; \ + rgb[0] = FixedToInt(span.red); \ + rgb[1] = FixedToInt(span.green); \ + rgb[2] = FixedToInt(span.blue); \ + vl_putpixel(b, offset, vl_mixrgb(rgb)); \ + span.red += span.redStep; \ + span.green += span.greenStep; \ + span.blue += span.blueStep; \ + } + +#include "swrast/s_tritemp.h" +} + + + +/* + * smooth, depth-buffered, triangle. + */ +static void tri_rgb_smooth_z (GLcontext *ctx, + const SWvertex *v0, + const SWvertex *v1, + const SWvertex *v2) +{ + DMesaContext c = (DMesaContext)ctx->DriverCtx; + void *b = c->Buffer->the_window; + GLuint w = c->Buffer->cwidth, h = c->Buffer->height; + +#define INTERP_Z 1 +#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE +#define INTERP_RGB 1 + +#define RENDER_SPAN(span) \ + GLuint i, offset = FLIP2(span.y)*w + span.x; \ + for (i = 0; i < span.count; i++, offset++) { \ + const DEPTH_TYPE z = FixedToDepth(span.z); \ + if (z < zRow[i]) { \ + unsigned char rgb[3]; \ + rgb[0] = FixedToInt(span.red); \ + rgb[1] = FixedToInt(span.green); \ + rgb[2] = FixedToInt(span.blue); \ + vl_putpixel(b, offset, vl_mixrgb(rgb)); \ + zRow[i] = z; \ + } \ + span.red += span.redStep; \ + span.green += span.greenStep; \ + span.blue += span.blueStep; \ + span.z += span.zStep; \ + } + +#include "swrast/s_tritemp.h" +} + + + +/* + * Analyze context state to see if we can provide a fast triangle function + * Otherwise, return NULL. + */ +static swrast_tri_func dmesa_choose_tri_function (GLcontext *ctx) +{ + const SWcontext *swrast = SWRAST_CONTEXT(ctx); + + if (ctx->RenderMode != GL_RENDER) return (swrast_tri_func) NULL; + if (ctx->Polygon.SmoothFlag) return (swrast_tri_func) NULL; + if (ctx->Texture._ReallyEnabled) return (swrast_tri_func) NULL; + + if (ctx->Light.ShadeModel==GL_SMOOTH + && swrast->_RasterMask==DEPTH_BIT + && ctx->Depth.Func==GL_LESS + && ctx->Depth.Mask==GL_TRUE + && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS + && ctx->Polygon.StippleFlag==GL_FALSE) { + return tri_rgb_smooth_z; + } + if (ctx->Light.ShadeModel==GL_FLAT + && swrast->_RasterMask==DEPTH_BIT + && ctx->Depth.Func==GL_LESS + && ctx->Depth.Mask==GL_TRUE + && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS + && ctx->Polygon.StippleFlag==GL_FALSE) { + return tri_rgb_flat_z; + } + if (swrast->_RasterMask==0 /* no depth test */ + && ctx->Light.ShadeModel==GL_SMOOTH + && ctx->Polygon.StippleFlag==GL_FALSE) { + return tri_rgb_smooth; + } + if (swrast->_RasterMask==0 /* no depth test */ + && ctx->Light.ShadeModel==GL_FLAT + && ctx->Polygon.StippleFlag==GL_FALSE) { + return tri_rgb_flat; + } + + return (swrast_tri_func)NULL; +} + + + +/* Override for the swrast triangle-selection function. Try to use one + * of our internal line functions, otherwise fall back to the + * standard swrast functions. + */ +static void dmesa_choose_tri (GLcontext *ctx) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + + if (!(swrast->Triangle=dmesa_choose_tri_function(ctx))) + _swrast_choose_triangle(ctx); +} @@ -150,7 +481,7 @@ READ_RGBA_PIXELS(32) static void clear_color (GLcontext *ctx, const GLchan color[4]) { DMesaContext c = (DMesaContext)ctx->DriverCtx; - c->ClearColor = dv_color(color); + c->ClearColor = vl_mixrgba(color); } @@ -171,15 +502,29 @@ static void clear (GLcontext *ctx, GLbitfield mask, GLboolean all, */ /* we can't handle color or index masking */ - if (*colorMask==0xffffffff && ctx->Color.IndexMask==0xffffffff) { - if (mask&DD_BACK_LEFT_BIT) { + if (*colorMask==0xffffffff) { + if (mask & DD_BACK_LEFT_BIT) { if (all) { - dv_clear_virtual(b->the_window, b->len, c->ClearColor); + if CHECK_SOFTDB(b->caps) { + vl_clear_virtual(b->the_window, b->len, c->ClearColor); + } else { + vl_clear(b->the_window, 0, 0, b->width, b->height, c->ClearColor); + } } else { - dv_fillrect(b->the_window, b->width, x, y, width, height, c->ClearColor); + vl_clear(b->the_window, x, y, width, height, c->ClearColor); } mask &= ~DD_BACK_LEFT_BIT; } + if (mask & DD_FRONT_LEFT_BIT) { + if (all) { + x = 0; + y = 0; + width = b->width; + height = b->height; + } + vl_clear(b->the_window, x, y, width, height, c->ClearColor); + mask &= ~DD_FRONT_LEFT_BIT; + } } if (mask) { @@ -208,7 +553,7 @@ static void set_read_buffer (GLcontext *ctx, GLframebuffer *buffer, */ static GLboolean set_draw_buffer (GLcontext *ctx, GLenum mode) { - if (mode==GL_BACK_LEFT) { + if (mode==GL_BACK_LEFT || mode==GL_FRONT_LEFT) { return GL_TRUE; } else { return GL_FALSE; @@ -276,6 +621,29 @@ static void flush (GLcontext *ctx) +#define DMESA_NEW_TRIANGLE (_NEW_POLYGON | \ + _NEW_TEXTURE | \ + _NEW_LIGHT | \ + _NEW_DEPTH | \ + _NEW_RENDERMODE | \ + _SWRAST_NEW_RASTERMASK) + + + +/* Extend the software rasterizer with our line and triangle + * functions. + */ +static void dmesa_register_swrast_functions (GLcontext *ctx) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + + swrast->choose_triangle = dmesa_choose_tri; + + swrast->invalidate_triangle |= DMESA_NEW_TRIANGLE; +} + + + /* Setup pointers and other driver state that is constant for the life * of a context. */ @@ -361,44 +729,13 @@ static void dmesa_update_state (GLcontext *ctx, GLuint new_state) swdd->SetReadBuffer = set_read_buffer; /* RGB(A) span/pixel functions */ - switch (c->visual->depth) { - case 15: - swdd->WriteRGBASpan = write_rgba_span_15; - swdd->WriteRGBSpan = write_rgb_span_15; - swdd->WriteMonoRGBASpan = write_mono_rgba_span_15; - swdd->WriteRGBAPixels = write_rgba_pixels_15; - swdd->WriteMonoRGBAPixels = write_mono_rgba_pixels_15; - swdd->ReadRGBASpan = read_rgba_span_15; - swdd->ReadRGBAPixels = read_rgba_pixels_15; - break; - case 16: - swdd->WriteRGBASpan = write_rgba_span_16; - swdd->WriteRGBSpan = write_rgb_span_16; - swdd->WriteMonoRGBASpan = write_mono_rgba_span_16; - swdd->WriteRGBAPixels = write_rgba_pixels_16; - swdd->WriteMonoRGBAPixels = write_mono_rgba_pixels_16; - swdd->ReadRGBASpan = read_rgba_span_16; - swdd->ReadRGBAPixels = read_rgba_pixels_16; - break; - case 24: - swdd->WriteRGBASpan = write_rgba_span_24; - swdd->WriteRGBSpan = write_rgb_span_24; - swdd->WriteMonoRGBASpan = write_mono_rgba_span_24; - swdd->WriteRGBAPixels = write_rgba_pixels_24; - swdd->WriteMonoRGBAPixels = write_mono_rgba_pixels_24; - swdd->ReadRGBASpan = read_rgba_span_24; - swdd->ReadRGBAPixels = read_rgba_pixels_24; - break; - case 32: - swdd->WriteRGBASpan = write_rgba_span_32; - swdd->WriteRGBSpan = write_rgb_span_32; - swdd->WriteMonoRGBASpan = write_mono_rgba_span_32; - swdd->WriteRGBAPixels = write_rgba_pixels_32; - swdd->WriteMonoRGBAPixels = write_mono_rgba_pixels_32; - swdd->ReadRGBASpan = read_rgba_span_32; - swdd->ReadRGBAPixels = read_rgba_pixels_32; - break; - } + swdd->WriteRGBASpan = write_rgba_span; + swdd->WriteRGBSpan = write_rgb_span; + swdd->WriteMonoRGBASpan = write_mono_rgba_span; + swdd->WriteRGBAPixels = write_rgba_pixels; + swdd->WriteMonoRGBAPixels = write_mono_rgba_pixels; + swdd->ReadRGBASpan = read_rgba_span; + swdd->ReadRGBAPixels = read_rgba_pixels; } @@ -412,16 +749,16 @@ static void dmesa_update_state (GLcontext *ctx, GLuint new_state) /* * The exact arguments to this function will depend on your window system */ -DMesaVisual DMesaCreateVisual (GLint colDepth, GLboolean dbFlag, - GLint depthSize, GLint stencilSize, +DMesaVisual DMesaCreateVisual (GLint width, GLint height, GLint colDepth, + GLboolean dbFlag, GLint depthSize, + GLint stencilSize, GLint accumSize) { DMesaVisual v; GLint redBits, greenBits, blueBits, alphaBits; + GLint caps; - if (!dbFlag) { - return NULL; - } + alphaBits = 0; switch (colDepth) { case 15: redBits = 5; @@ -433,8 +770,9 @@ DMesaVisual DMesaCreateVisual (GLint colDepth, GLboolean dbFlag, greenBits = 6; blueBits = 5; break; - case 24: case 32: + alphaBits = 8; + case 24: redBits = 8; greenBits = 8; blueBits = 8; @@ -442,7 +780,14 @@ DMesaVisual DMesaCreateVisual (GLint colDepth, GLboolean dbFlag, default: return NULL; } - alphaBits = 8; + + caps = 0; + if (!dbFlag) { + caps |= VL_SINGLE; + } + if (vl_video_init(width, height, colDepth, &caps)!=0) { + return NULL; + } if ((v=(DMesaVisual)calloc(1, sizeof(struct dmesa_visual)))!=NULL) { /* Create core visual */ @@ -463,7 +808,7 @@ DMesaVisual DMesaCreateVisual (GLint colDepth, GLboolean dbFlag, 1); /* numSamples */ v->depth = colDepth; - v->db_flag = dbFlag; + v->caps = caps; } return v; @@ -473,6 +818,7 @@ DMesaVisual DMesaCreateVisual (GLint colDepth, GLboolean dbFlag, void DMesaDestroyVisual (DMesaVisual v) { + vl_video_exit(); _mesa_destroy_visual(v->gl_visual); free(v); } @@ -480,27 +826,27 @@ void DMesaDestroyVisual (DMesaVisual v) DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, - GLint width, GLint height, - GLint xpos, GLint ypos) + GLint xpos, GLint ypos, + GLint width, GLint height) { DMesaBuffer b; if ((b=(DMesaBuffer)calloc(1, sizeof(struct dmesa_buffer)))!=NULL) { - if (visual->db_flag) { - if ((b->the_window=calloc(1, width*height*((visual->depth+7)/8)))==NULL) { - return NULL; - } - } b->gl_buffer = _mesa_create_framebuffer(visual->gl_visual, visual->gl_visual->depthBits > 0, visual->gl_visual->stencilBits > 0, visual->gl_visual->accumRedBits > 0, visual->gl_visual->alphaBits > 0); - b->width = width; - b->height = height; b->xpos = xpos; b->ypos = ypos; + b->width = width; + b->height = height; + b->caps = visual->caps; + b->pitch = b->width*((visual->depth+7)/8); + b->len = b->pitch*b->height; + + b->tri_rgb_flat = vl_getprim(TRI_RGB_FLAT); } return b; @@ -510,7 +856,9 @@ DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, void DMesaDestroyBuffer (DMesaBuffer b) { - free(b->the_window); + if CHECK_SOFTDB(b->caps) { + free(b->the_window); + } _mesa_destroy_framebuffer(b->gl_buffer); free(b); } @@ -528,6 +876,9 @@ DMesaContext DMesaCreateContext (DMesaVisual visual, share ? share->gl_ctx : NULL, (void *)c, direct); + _mesa_enable_sw_extensions(c->gl_ctx); + _mesa_enable_1_3_extensions(c->gl_ctx); + /* you probably have to do a bunch of other initializations here. */ c->visual = visual; @@ -538,6 +889,7 @@ DMesaContext DMesaCreateContext (DMesaVisual visual, _tnl_CreateContext(c->gl_ctx); _swsetup_CreateContext(c->gl_ctx); dmesa_init_pointers(c->gl_ctx); + dmesa_register_swrast_functions(c->gl_ctx); } return c; @@ -559,13 +911,14 @@ void DMesaDestroyContext (DMesaContext c) GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b) { if (c&&b) { - c->Buffer = b; - if ((b->video=dv_select_mode(b->xpos, b->ypos, b->width, b->height, c->visual->depth, &b->delta, &b->offset))==NULL) { + void *ptr = vl_sync_buffer(b->the_window, b->xpos, b->ypos, b->width, b->height, &b->cwidth); + + if (b->cwidth==-1) { return GL_FALSE; } - b->xsize = b->width*((c->visual->depth+7)/8); - b->len = b->xsize*b->height; + b->the_window = ptr; + c->Buffer = b; dmesa_update_state(c->gl_ctx, 0); _mesa_make_current(c->gl_ctx, b->gl_buffer); @@ -586,7 +939,5 @@ GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b) void DMesaSwapBuffers (DMesaBuffer b) { /* copy/swap back buffer to front if applicable */ - if (b->the_window) { - dv_dump_virtual(b->the_window, b->xsize, b->height, b->offset, b->delta); - } + b->the_window = vl_flip(b->the_window, b->width, b->height, b->pitch); } diff --git a/src/mesa/main/Makefile.DJ b/src/mesa/main/Makefile.DJ index 4895cc30088..e6be4205d6a 100644 --- a/src/mesa/main/Makefile.DJ +++ b/src/mesa/main/Makefile.DJ @@ -1,4 +1,26 @@ -# DOS/DJGPP core makefile v0.1 for Mesa 4.0.x +# Mesa 3-D graphics library +# Version: 4.0 +# +# Copyright (C) 1999 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# DOS/DJGPP core makefile v0.2 for Mesa 4.0 # # Copyright (C) 2002 - Borca Daniel # Email : dborca@yahoo.com @@ -17,13 +39,14 @@ LIBDIR = $(TOP)/lib GL_LIB = libgl.a CORE_SOURCES = \ - accum.c \ + swrast_setup/ss_context.c \ + swrast_setup/ss_triangle.c \ + swrast_setup/ss_vb.c \ api_arrayelt.c \ api_loopback.c \ api_noop.c \ api_validate.c \ - array_cache/ac_context.c \ - array_cache/ac_import.c \ + accum.c \ attrib.c \ blend.c \ buffers.c \ @@ -53,6 +76,23 @@ CORE_SOURCES = \ imports.c \ light.c \ lines.c \ + matrix.c \ + mem.c \ + mmath.c \ + pixel.c \ + points.c \ + polygon.c \ + rastpos.c \ + state.c \ + stencil.c \ + texformat.c \ + teximage.c \ + texobj.c \ + texstate.c \ + texstore.c \ + texutil.c \ + varray.c \ + vtxfmt.c \ math/m_debug_clip.c \ math/m_debug_norm.c \ math/m_debug_vertex.c \ @@ -63,15 +103,8 @@ CORE_SOURCES = \ math/m_vector.c \ math/m_vertices.c \ math/m_xform.c \ - matrix.c \ - mem.c \ - mmath.c \ - pixel.c \ - points.c \ - polygon.c \ - rastpos.c \ - state.c \ - stencil.c \ + array_cache/ac_context.c \ + array_cache/ac_import.c \ swrast/s_aaline.c \ swrast/s_aatriangle.c \ swrast/s_accum.c \ @@ -80,8 +113,8 @@ CORE_SOURCES = \ swrast/s_bitmap.c \ swrast/s_blend.c \ swrast/s_buffers.c \ - swrast/s_context.c \ swrast/s_copypix.c \ + swrast/s_context.c \ swrast/s_depth.c \ swrast/s_drawpix.c \ swrast/s_feedback.c \ @@ -98,19 +131,10 @@ CORE_SOURCES = \ swrast/s_scissor.c \ swrast/s_span.c \ swrast/s_stencil.c \ - swrast/s_texstore.c \ swrast/s_texture.c \ + swrast/s_texstore.c \ swrast/s_triangle.c \ swrast/s_zoom.c \ - swrast_setup/ss_context.c \ - swrast_setup/ss_triangle.c \ - swrast_setup/ss_vb.c \ - texformat.c \ - teximage.c \ - texobj.c \ - texstate.c \ - texstore.c \ - texutil.c \ tnl/t_array_api.c \ tnl/t_array_import.c \ tnl/t_context.c \ @@ -131,11 +155,9 @@ CORE_SOURCES = \ tnl/t_vb_render.c \ tnl/t_vb_texgen.c \ tnl/t_vb_texmat.c \ - tnl/t_vb_vertex.c \ - varray.c \ - vtxfmt.c + tnl/t_vb_vertex.c -DRIVER_SOURCES = DOS/dmesa.c DOS/dvesa.c +DRIVER_SOURCES = DOS/dmesa.c DOS/video.c DOS/vbeaf.c DOS/dpmi.c SOURCES = $(CORE_SOURCES) $(DRIVER_SOURCES) @@ -157,7 +179,11 @@ include depend DOS/dmesa.o: DOS/dmesa.c glheader.h ../include/GL/gl.h context.h glapi.h \ mtypes.h config.h glapitable.h glthread.h math/m_matrix.h dd.h \ - ../include/GL/dmesa.h matrix.h texformat.h texstore.h array_cache/acache.h \ - swrast/swrast.h swrast_setup/swrast_setup.h tnl/tnl.h tnl/t_context.h \ - math/m_vector.h math/m_xform.h tnl/t_pipeline.h DOS/dvesa.h DOS/dmesaint.h -DOS/dvesa.o: DOS/dvesa.c DOS/dvesa.h + ../include/GL/dmesa.h extensions.h macros.h matrix.h mmath.h texformat.h \ + texstore.h array_cache/acache.h swrast/s_context.h swrast/swrast.h \ + swrast/s_depth.h swrast/s_lines.h swrast/s_triangle.h swrast/s_trispan.h \ + swrast_setup/swrast_setup.h tnl/tnl.h tnl/t_context.h math/m_vector.h \ + math/m_xform.h tnl/t_pipeline.h DOS/video.h swrast/s_tritemp.h +DOS/dpmi.o: DOS/dpmi.c DOS/vbeaf.h DOS/dpmiint.h +DOS/vbeaf.o: DOS/vbeaf.c DOS/dpmiint.h DOS/vbeaf.h DOS/video.h +DOS/video.o: DOS/video.c DOS/video.h DOS/dpmiint.h DOS/vbeafint.h DOS/vbeaf.h -- cgit v1.2.3 From aa24e9171aa6279de40a11835d84ba431b7ed48c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 25 Feb 2002 22:18:14 +0000 Subject: use official enum values for GL_ARB_depth_texture and GL_ARB_shadow --- include/GL/gl.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index c0ce01fff72..6ffda175802 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,10 +1,10 @@ -/* $Id: gl.h,v 1.63 2002/02/15 16:41:36 brianp Exp $ */ +/* $Id: gl.h,v 1.64 2002/02/25 22:18:14 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 4.0 + * Version: 4.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -2526,10 +2526,10 @@ GLAPI void GLAPIENTRY glWindowPos3svARB(const GLshort *p); #ifndef GL_ARB_shadow #define GL_ARB_shadow 1 -/* XXX not finalized yet - just testing */ -#define GL_TEXTURE_COMPARE_MODE_ARB 0x9990 -#define GL_TEXTURE_COMPARE_FUNC_ARB 0x9991 -#define GL_COMPARE_R_TO_TEXTURE_ARB 0x9993 +/* XXX move to glext.h */ +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E #endif @@ -2537,7 +2537,7 @@ GLAPI void GLAPIENTRY glWindowPos3svARB(const GLshort *p); #ifndef GL_ARB_shadow_ambient #define GL_ARB_shadow_ambient 1 -/* XXX not finalized yet - just testing */ +/* XXX move to glext.h */ #define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF #endif @@ -2546,12 +2546,12 @@ GLAPI void GLAPIENTRY glWindowPos3svARB(const GLshort *p); #ifndef GL_ARB_depth_texture #define GL_ARB_depth_texture 1 -/* XXX not finalized yet - just testing */ +/* XXX move to glext.h */ #define GL_DEPTH_COMPONENT16_ARB 0x81A5 #define GL_DEPTH_COMPONENT24_ARB 0x81A6 #define GL_DEPTH_COMPONENT32_ARB 0x81A7 -#define GL_TEXTURE_DEPTH_SIZE_ARB 0x7776 -#define GL_DEPTH_TEXTURE_MODE_ARB 0x7777 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B #endif -- cgit v1.2.3 From 93c132a058eb44e824615f10cf53f30f2326d807 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 16 Mar 2002 00:53:48 +0000 Subject: added XMesaResizeBuffers() --- include/GL/xmesa.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index 7e32d0cde8d..c157eb09839 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -1,10 +1,10 @@ -/* $Id: xmesa.h,v 1.12 2001/09/23 16:06:13 brianp Exp $ */ +/* $Id: xmesa.h,v 1.13 2002/03/16 00:53:48 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 4.0 + * Version: 4.0.2 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -365,6 +365,15 @@ extern GLboolean XMesaSetFXmode( GLint mode ); +/* + * Reallocate the back/depth/stencil/accum/etc/ buffers associated with + * buffer if its size has changed. + * + * New in Mesa 4.0.2 + */ +extern void XMesaResizeBuffers( XMesaBuffer b ); + + #ifdef __cplusplus } #endif -- cgit v1.2.3 From 491e573c38ae5e0910e9690cd188e0eee9a922c8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 20 Mar 2002 22:07:17 +0000 Subject: removed glSamplePass() --- include/GL/gl.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 6ffda175802..675b97499d0 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.64 2002/02/25 22:18:14 brianp Exp $ */ +/* $Id: gl.h,v 1.65 2002/03/20 22:07:17 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1912,8 +1912,6 @@ GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] ); GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert ); -GLAPI void GLAPIENTRY glSamplePass( GLenum pass ); - /* * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1) -- cgit v1.2.3 From e3af5354a6090666a03586693865fd0d51d994d0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 23 Mar 2002 01:47:27 +0000 Subject: latest extension headers from SGI --- include/GL/glext.h | 669 ++++++++++++++++++++++++++++++++++------------------ include/GL/glxext.h | 53 ++++- 2 files changed, 490 insertions(+), 232 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 5dbdc1e5fe2..c4b4baa0930 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -42,17 +42,16 @@ extern "C" { #ifndef APIENTRY #define APIENTRY #endif - #ifndef GLAPI #define GLAPI extern #endif - /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2001/09/26 */ -#define GL_GLEXT_VERSION 9 +/* glext.h last updated 2002/03/22 */ +/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ +#define GL_GLEXT_VERSION 11 #ifndef GL_VERSION_1_2 #define GL_CONSTANT_COLOR 0x8001 @@ -465,6 +464,31 @@ extern "C" { #define GL_DOT3_RGBA_EXT 0x86AF #endif +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_ARB 0x8370 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#endif + +#ifndef GL_ARB_shadow +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF +#endif + +#ifndef GL_ARB_window_pos +#endif + #ifndef GL_EXT_abgr #define GL_ABGR_EXT 0x8000 #endif @@ -1721,30 +1745,33 @@ extern "C" { #endif #ifndef GL_NV_texture_shader -#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E #define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE #define GL_SHADER_OPERATION_NV 0x86DF #define GL_CULL_MODES_NV 0x86E0 #define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 #define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 #define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 -#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV +#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV +#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV #define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 #define GL_CONST_EYE_NV 0x86E5 -#define GL_SHADER_CONSISTENT_NV 0x86DD #define GL_PASS_THROUGH_NV 0x86E6 #define GL_CULL_FRAGMENT_NV 0x86E7 #define GL_OFFSET_TEXTURE_2D_NV 0x86E8 -#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C -#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D #define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 #define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA #define GL_DOT_PRODUCT_NV 0x86EC #define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED #define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE -#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E #define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 #define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 #define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 @@ -1753,8 +1780,9 @@ extern "C" { #define GL_DSDT_NV 0x86F5 #define GL_DSDT_MAG_NV 0x86F6 #define GL_DSDT_MAG_VIB_NV 0x86F7 -#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA -#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA #define GL_SIGNED_RGBA_NV 0x86FB #define GL_SIGNED_RGBA8_NV 0x86FC #define GL_SIGNED_RGB_NV 0x86FE @@ -1767,15 +1795,11 @@ extern "C" { #define GL_SIGNED_ALPHA8_NV 0x8706 #define GL_SIGNED_INTENSITY_NV 0x8707 #define GL_SIGNED_INTENSITY8_NV 0x8708 -#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C -#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D -#define GL_HILO16_NV 0x86F8 -#define GL_SIGNED_HILO_NV 0x86F9 -#define GL_SIGNED_HILO16_NV 0x86FA #define GL_DSDT8_NV 0x8709 #define GL_DSDT8_MAG8_NV 0x870A -#define GL_DSDT_MAG_INTENSITY_NV 0x86DC #define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D #define GL_HI_SCALE_NV 0x870E #define GL_LO_SCALE_NV 0x870F #define GL_DS_SCALE_NV 0x8710 @@ -1806,28 +1830,20 @@ extern "C" { #ifndef GL_NV_vertex_program #define GL_VERTEX_PROGRAM_NV 0x8620 -#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 #define GL_VERTEX_STATE_PROGRAM_NV 0x8621 #define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 #define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 #define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 #define GL_CURRENT_ATTRIB_NV 0x8626 -#define GL_PROGRAM_PARAMETER_NV 0x8644 -#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 -#define GL_PROGRAM_TARGET_NV 0x8646 #define GL_PROGRAM_LENGTH_NV 0x8627 -#define GL_PROGRAM_RESIDENT_NV 0x8647 #define GL_PROGRAM_STRING_NV 0x8628 -#define GL_TRACK_MATRIX_NV 0x8648 -#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D #define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E #define GL_MAX_TRACK_MATRICES_NV 0x862F -#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 -#define GL_CURRENT_MATRIX_NV 0x8641 -#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A -#define GL_PROGRAM_ERROR_POSITION_NV 0x864B -#define GL_MODELVIEW_PROJECTION_NV 0x8629 #define GL_MATRIX0_NV 0x8630 #define GL_MATRIX1_NV 0x8631 #define GL_MATRIX2_NV 0x8632 @@ -1836,10 +1852,18 @@ extern "C" { #define GL_MATRIX5_NV 0x8635 #define GL_MATRIX6_NV 0x8636 #define GL_MATRIX7_NV 0x8637 -#define GL_IDENTITY_NV 0x862A -#define GL_INVERSE_NV 0x862B -#define GL_TRANSPOSE_NV 0x862C -#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B #define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 #define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 #define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 @@ -2155,11 +2179,13 @@ extern "C" { #define GL_Y_EXT 0x87D6 #define GL_Z_EXT 0x87D7 #define GL_W_EXT 0x87D8 -#define GL_NEGEXTVE_X_EXT 0x87D9 -#define GL_NEGEXTVE_Y_EXT 0x87DA -#define GL_NEGEXTVE_Z_EXT 0x87DB -#define GL_NEGEXTVE_W_EXT 0x87DC -#define GL_NEGEXTVE_ONE_EXT 0x87DF +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF #define GL_NORMALIZED_RANGE_EXT 0x87E0 #define GL_FULL_RANGE_EXT 0x87E1 #define GL_CURRENT_VERTEX_EXT 0x87E2 @@ -2189,6 +2215,65 @@ extern "C" { #define GL_VERTEX_SOURCE_ATI 0x8774 #endif +#ifndef GL_ATI_element_array +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A +#endif + +#ifndef GL_SUN_mesh_array +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SLICE_ACCUM_SUN 0x85CC +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_DEPTH_CLAMP_NV 0x864F +#endif + +#ifndef GL_NV_occlusion_query +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 +#endif + +#ifndef GL_NV_point_sprite +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 +#endif + +#ifndef GL_NV_vertex_program1_1 +#endif + /*************************************************************/ @@ -2500,6 +2585,16 @@ typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLin #define GL_ARB_texture_border_clamp 1 #endif +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); +#endif + #ifndef GL_ARB_vertex_blend #define GL_ARB_vertex_blend 1 #ifdef GL_GLEXT_PROTOTYPES @@ -2554,6 +2649,60 @@ typedef void (APIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum typ #define GL_ARB_texture_env_dot3 1 #endif +#ifndef GL_ARB_texture_mirror_repeat +#define GL_ARB_texture_mirror_repeat 1 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 +#endif + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 +#endif + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *); +GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *); +GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint); +GLAPI void APIENTRY glWindowPos2ivARB (const GLint *); +GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2svARB (const GLshort *); +GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *); +GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *); +GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3ivARB (const GLint *); +GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3svARB (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (APIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (APIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); +#endif + #ifndef GL_EXT_abgr #define GL_EXT_abgr 1 #endif @@ -2904,20 +3053,22 @@ typedef void (APIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GL #define GL_SGIX_texture_multi_buffer 1 #endif -#ifndef GL_ARB_point_parameters -#define GL_ARB_point_parameters 1 +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); -GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); typedef void (APIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_SGIS_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); typedef void (APIENTRY * PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); #endif @@ -3887,21 +4038,21 @@ typedef void (APIENTRY * PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoi #ifndef GL_NV_fence #define GL_NV_fence 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *); GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); -GLAPI GLboolean APIENTRY glTestFenceNV (GLuint); -GLAPI void APIENTRY glFinishFenceNV (GLuint); +GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *); GLAPI GLboolean APIENTRY glIsFenceNV (GLuint); +GLAPI GLboolean APIENTRY glTestFenceNV (GLuint); GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glFinishFenceNV (GLuint); +GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); typedef void (APIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); -typedef GLboolean (APIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); -typedef void (APIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (APIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); typedef GLboolean (APIENTRY * PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (APIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); typedef void (APIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (APIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); #endif #ifndef GL_NV_evaluators @@ -3965,14 +4116,13 @@ typedef void (APIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, #ifndef GL_NV_vertex_program #define GL_NV_vertex_program 1 #ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *); GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint); GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *); GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *); GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *); -GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *); GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *); GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *); @@ -3982,62 +4132,62 @@ GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *); GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *); GLAPI GLboolean APIENTRY glIsProgramNV (GLuint); GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *); -GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *); GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *); GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *); +GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *); GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum); GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat); GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *); GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble); GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble); GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *); GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *); GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *); GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *); GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *); #endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); typedef void (APIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); typedef void (APIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); -typedef void (APIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *ids); -typedef GLboolean (APIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *ids, GLboolean *residences); -typedef void (APIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *ids); -typedef void (APIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); typedef void (APIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); typedef void (APIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); typedef void (APIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); typedef void (APIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); @@ -4047,53 +4197,54 @@ typedef void (APIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pna typedef void (APIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); typedef GLboolean (APIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); typedef void (APIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint num, const GLdouble *params); -typedef void (APIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint num, const GLfloat *params); +typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); +typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v); +typedef void (APIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v); +typedef void (APIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); typedef void (APIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); -typedef void (APIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); -typedef void (APIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); typedef void (APIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); typedef void (APIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); typedef void (APIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (APIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); typedef void (APIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); #endif #ifndef GL_SGIX_texture_coordinate_clamp @@ -4301,97 +4452,167 @@ typedef void (APIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum #ifndef GL_ATI_vertex_streams #define GL_ATI_vertex_streams 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexStream1s (GLenum, GLshort); -GLAPI void APIENTRY glVertexStream1sv (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream1i (GLenum, GLint); -GLAPI void APIENTRY glVertexStream1iv (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream1f (GLenum, GLfloat); -GLAPI void APIENTRY glVertexStream1fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream1d (GLenum, GLdouble); -GLAPI void APIENTRY glVertexStream1dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream2s (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream2sv (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream2i (GLenum, GLint, GLint); -GLAPI void APIENTRY glVertexStream2iv (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream2f (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream2fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream2d (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream2dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream3s (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream3sv (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream3i (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexStream3iv (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream3f (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream3fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream3d (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream3dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream4s (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream4sv (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream4i (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexStream4iv (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream4fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream4dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glNormalStream3b (GLenum, GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glNormalStream3bv (GLenum, const GLbyte *); -GLAPI void APIENTRY glNormalStream3s (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glNormalStream3sv (GLenum, const GLshort *); -GLAPI void APIENTRY glNormalStream3i (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glNormalStream3iv (GLenum, const GLint *); -GLAPI void APIENTRY glNormalStream3f (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNormalStream3fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glNormalStream3d (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glNormalStream3dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glClientActiveVertexStream (GLenum); -GLAPI void APIENTRY glVertexBlendEnvi (GLenum, GLint); -GLAPI void APIENTRY glVertexBlendEnvf (GLenum, GLfloat); +GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort); +GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint); +GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat); +GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble); +GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint); +GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *); +GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum); +GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint); +GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (APIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (APIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +typedef void (APIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (APIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +typedef void (APIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); +typedef void (APIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +typedef void (APIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +typedef void (APIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (APIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *); +GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei); +GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +#endif + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 +#endif + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glEndOcclusionQueryNV (void); +GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLVERTEXSTREAM1SPROC) (GLenum stream, GLshort x); -typedef void (APIENTRY * PFNGLVERTEXSTREAM1SVPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM1IPROC) (GLenum stream, GLint x); -typedef void (APIENTRY * PFNGLVERTEXSTREAM1IVPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM1FPROC) (GLenum stream, GLfloat x); -typedef void (APIENTRY * PFNGLVERTEXSTREAM1FVPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM1DPROC) (GLenum stream, GLdouble x); -typedef void (APIENTRY * PFNGLVERTEXSTREAM1DVPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM2SPROC) (GLenum stream, GLshort x, GLshort y); -typedef void (APIENTRY * PFNGLVERTEXSTREAM2SVPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM2IPROC) (GLenum stream, GLint x, GLint y); -typedef void (APIENTRY * PFNGLVERTEXSTREAM2IVPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM2FPROC) (GLenum stream, GLfloat x, GLfloat y); -typedef void (APIENTRY * PFNGLVERTEXSTREAM2FVPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM2DPROC) (GLenum stream, GLdouble x, GLdouble y); -typedef void (APIENTRY * PFNGLVERTEXSTREAM2DVPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM3SPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRY * PFNGLVERTEXSTREAM3SVPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM3IPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (APIENTRY * PFNGLVERTEXSTREAM3IVPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM3FPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLVERTEXSTREAM3FVPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM3DPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRY * PFNGLVERTEXSTREAM3DVPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM4SPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRY * PFNGLVERTEXSTREAM4SVPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM4IPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRY * PFNGLVERTEXSTREAM4IVPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM4FPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLVERTEXSTREAM4FVPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM4DPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRY * PFNGLVERTEXSTREAM4DVPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRY * PFNGLNORMALSTREAM3BPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -typedef void (APIENTRY * PFNGLNORMALSTREAM3BVPROC) (GLenum stream, const GLbyte *coords); -typedef void (APIENTRY * PFNGLNORMALSTREAM3SPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); -typedef void (APIENTRY * PFNGLNORMALSTREAM3SVPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRY * PFNGLNORMALSTREAM3IPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); -typedef void (APIENTRY * PFNGLNORMALSTREAM3IVPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRY * PFNGLNORMALSTREAM3FPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -typedef void (APIENTRY * PFNGLNORMALSTREAM3FVPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRY * PFNGLNORMALSTREAM3DPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -typedef void (APIENTRY * PFNGLNORMALSTREAM3DVPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMPROC) (GLenum stream); -typedef void (APIENTRY * PFNGLVERTEXBLENDENVIPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLVERTEXBLENDENVFPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (APIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint); +GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 +#endif + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 #endif diff --git a/include/GL/glxext.h b/include/GL/glxext.h index e61ad526f74..54620bd4e17 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -42,12 +42,16 @@ extern "C" { #ifndef APIENTRY #define APIENTRY #endif +#ifndef GLAPI +#define GLAPI extern +#endif /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glxext.h last updated 2001/09/26 */ -#define GLX_GLXEXT_VERSION 3 +/* glxext.h last updated 2002/03/22 */ +/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ +#define GLX_GLXEXT_VERSION 5 #ifndef GLX_VERSION_1_3 #define GLX_WINDOW_BIT 0x00000001 @@ -113,6 +117,9 @@ extern "C" { #define GLX_SAMPLES 100001 #endif +#ifndef GLX_ARB_get_proc_address +#endif + #ifndef GLX_ARB_multisample #define GLX_SAMPLE_BUFFERS_ARB 100000 #define GLX_SAMPLES_ARB 100001 @@ -276,7 +283,6 @@ extern "C" { /*************************************************************/ #ifndef GLX_ARB_get_proc_address -/* XXX Added void parameter to silence many, many warnings (BrianP) */ typedef void (*__GLXextFuncPtr)(void); #endif @@ -348,6 +354,14 @@ typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigne typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); #endif +#ifndef GLX_VERSION_1_4 +#define GLX_VERSION_1_4 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName); +#endif + #ifndef GLX_ARB_get_proc_address #define GLX_ARB_get_proc_address 1 #ifdef GLX_GLXEXT_PROTOTYPES @@ -356,6 +370,10 @@ extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *); typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName); #endif +#ifndef GLX_ARB_multisample +#define GLX_ARB_multisample 1 +#endif + #ifndef GLX_SGIS_multisample #define GLX_SGIS_multisample 1 #endif @@ -419,7 +437,7 @@ extern void glXFreeContextEXT (Display *, GLXContext); #endif /* GLX_GLXEXT_PROTOTYPES */ typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void); typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value); -typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (GLXContext context); +typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID); typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context); #endif @@ -554,14 +572,33 @@ typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode); #define GLX_SGIX_visual_select_group 1 #endif -#ifndef GLX_GLX_OML_swap_method -#define GLX_GLX_OML_swap_method 1 +#ifndef GLX_OML_swap_method +#define GLX_OML_swap_method 1 #endif -#ifndef GLX_GLX_OML_sync_control -#define GLX_GLX_OML_sync_control 1 +#if defined(__STDC_VERSION__) +#if __STDC_VERSION__ >= 199901L +/* Include ISO C99 integer types for OML_sync_control; need a better test */ +#include + +#ifndef GLX_OML_sync_control +#define GLX_OML_sync_control 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *); +extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *); +extern int64_t glXSwapBuffersMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t); +extern Bool glXWaitForMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t, int64_t *, int64_t *, int64_t *); +extern Bool glXWaitForSbcOML (Display *, GLXDrawable, int64_t, int64_t *, int64_t *, int64_t *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc); +typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator); +typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); +typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc); +typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc); #endif +#endif /* C99 version test */ +#endif /* STDC test */ #ifdef __cplusplus } -- cgit v1.2.3 From 6c921af034525fc28f006e447f62a31e00649f2c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 1 Apr 2002 17:01:33 +0000 Subject: DOS driver update --- docs/README.DJ | 33 +++++++------------ include/GL/dmesa.h | 6 +++- src/glu/mesa/Makefile.DJ | 10 +++--- src/glut/dos/Makefile.DJ | 32 +++++++++---------- src/glut/dos/PC_HW/pc_hw.c | 2 +- src/glut/dos/PC_HW/pc_hw.h | 8 ++--- src/glut/dos/PC_HW/pc_irq.S | 2 +- src/glut/dos/PC_HW/pc_keyb.c | 2 +- src/glut/dos/PC_HW/pc_mouse.c | 2 +- src/glut/dos/PC_HW/pc_timer.c | 2 +- src/glut/dos/callback.c | 2 +- src/glut/dos/color.c | 2 +- src/glut/dos/font.c | 2 +- src/glut/dos/globals.c | 2 +- src/glut/dos/init.c | 2 +- src/glut/dos/internal.h | 2 +- src/glut/dos/menu.c | 2 +- src/glut/dos/overlay.c | 2 +- src/glut/dos/state.c | 2 +- src/glut/dos/window.c | 15 ++++++++- src/mesa/drivers/dos/dmesa.c | 61 ++++++++++++++++++++++++----------- src/mesa/drivers/dos/dpmi.c | 2 +- src/mesa/drivers/dos/dpmiint.h | 2 +- src/mesa/drivers/dos/video.c | 8 ++--- src/mesa/drivers/dos/video.h | 2 +- src/mesa/main/Makefile.DJ | 72 ++++++++++++++++++++++++++++++++++++------ 26 files changed, 179 insertions(+), 100 deletions(-) (limited to 'include') diff --git a/docs/README.DJ b/docs/README.DJ index 8b4e6dc5a38..e92d36cf4c0 100644 --- a/docs/README.DJ +++ b/docs/README.DJ @@ -1,5 +1,5 @@ - Mesa 4.0 DOS/DJGPP Port version 0.4 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Mesa 4.0 DOS/DJGPP Port v1.0 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -20,11 +20,13 @@ MESA copyright applies. Installation: ~~~~~~~~~~~~~ -Type "make -f Makefile.DJ" to compile the libraries. Long filename support is -required during compilation. Also, you must have the DXE2 package (available -on SimTel.Net, courtesy of Andrew Zabolotny) installed in order to build the -dynamic modules; if you encounter errors, you can fetch a patched version from -my web page. +Type "make -f Makefile.DJ" to compile the libraries. Make accepts some options +which are passed to compiler: the target cpu (CPU=..., default=`pentium') and +X86 specific options (HAVE_X86=1, HAVE_MMX=1, HAVE_SSE=1, HAVE_3DNOW=1). The +core library (libGL) requires LFN support during compilation. Also, you must +have the DXE2 package (available on SimTel.Net, courtesy of Andrew Zabolotny) +installed in order to build the dynamic modules; if you encounter errors, you +can fetch a patched version from my web page. The demos are not built automagically (see Pitfalls below). To make them, use one of the following rules: Static: @@ -72,7 +74,7 @@ Pitfalls: libGLU: ~~~~~~~ -Mesa GLU sources are required. No comment! +Mesa GLU sources are required. @@ -118,20 +120,7 @@ However, the video mode is chosen in such a way that first window will fit. History: ~~~~~~~~ -v0.1 feb-2002 initial release -v0.2 feb-2002 + fast triangle rasterizers - + enabled sw and 1.3 extensions - + hardware acceleration: FreeBE/AF - + single-buffer modes (15-, 16-, and 32-bit) - * video mode is set by CreateVisual, not MakeCurrent - * internal changes to support multi-buf (unfinished) - ! fixed some alpha issues... (thanks, Brian) - + glut has now an internal timer - * glut changed to support multi-window (unfinished) - ! minor PC_HW corrections -v0.3 mar-2002 - removed FreeBE/AF code - - removed single-buffer modes -v0.4 mar-2002 + dynamic module support +v1.0 mar-2002 initial release diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h index eaf0ecafc07..ab91bac67d5 100644 --- a/include/GL/dmesa.h +++ b/include/GL/dmesa.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v0.2 for Mesa 4.0 + * DOS/DJGPP device driver v1.0 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -62,6 +62,10 @@ DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share); void DMesaDestroyContext (DMesaContext c); +GLboolean DMesaViewport (DMesaBuffer b, + GLint xpos, GLint ypos, + GLint width, GLint height); + GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b); void DMesaSwapBuffers (DMesaBuffer b); diff --git a/src/glu/mesa/Makefile.DJ b/src/glu/mesa/Makefile.DJ index 0232fe55922..5b9ae7b6f08 100644 --- a/src/glu/mesa/Makefile.DJ +++ b/src/glu/mesa/Makefile.DJ @@ -20,7 +20,7 @@ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# DOS/DJGPP glu makefile v0.4 for Mesa 4.0 +# DOS/DJGPP glu makefile v1.0 for Mesa 4.0 # # Copyright (C) 2002 - Borca Daniel # Email : dborca@yahoo.com @@ -31,7 +31,7 @@ TOP = .. CC = gcc -CFLAGS = -I$(TOP)/include -Wall -W -Wno-unused -mcpu=pentium -ffast-math -O2 +CFLAGS = -I$(TOP)/include -Wall -W -Wno-unused -mcpu=$(CPU) -ffast-math -O2 AR = ar ARFLAGS = ruv LIBDIR = $(TOP)/lib @@ -73,10 +73,10 @@ $(LIBDIR)/$(GLU_LIB): $(OBJECTS) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS) ifeq ($(DXE2GEN),) - @echo Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN - @echo somewhere in PATH, and DXE2.LD in DJGPP/LIB directory. + $(warning Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN) + $(warning somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.) else - dxe2gen -o $(LIBDIR)/$(GLU_DXE) -I $(LIBDIR)/$(GLU_IMP) $(OBJECTS) -D "Glu" -U + dxe2gen -o $(LIBDIR)/$(GLU_DXE) -I $(LIBDIR)/$(GLU_IMP) $(OBJECTS) -D "Mesa DOS GLU" -U endif clean: diff --git a/src/glut/dos/Makefile.DJ b/src/glut/dos/Makefile.DJ index 7a26eb2d0c9..02bc31b10ce 100644 --- a/src/glut/dos/Makefile.DJ +++ b/src/glut/dos/Makefile.DJ @@ -20,7 +20,7 @@ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# DOS/DJGPP glut makefile v0.4 for Mesa 4.0 +# DOS/DJGPP glut makefile v1.0 for Mesa 4.0 # # Copyright (C) 2002 - Borca Daniel # Email : dborca@yahoo.com @@ -31,7 +31,7 @@ TOP = .. CC = gcc -CFLAGS = -I$(TOP)/include -Wall -W -Wno-unused -mcpu=pentium -ffast-math -O2 +CFLAGS = -I$(TOP)/include -Wall -W -Wno-unused -mcpu=$(CPU) -ffast-math -O2 AR = ar ARFLAGS = ruv LIBDIR = $(TOP)/lib @@ -59,23 +59,23 @@ CORE_SOURCES = \ teapot.c \ window.c -PC_HW_OBJECTS = \ - PC_HW/pc_hw.o \ - PC_HW/pc_keyb.o \ - PC_HW/pc_mouse.o \ - PC_HW/pc_timer.o \ - PC_HW/pc_irq.o +PC_HW_SOURCES = \ + PC_HW/pc_hw.c \ + PC_HW/pc_keyb.c \ + PC_HW/pc_mouse.c \ + PC_HW/pc_timer.c \ + PC_HW/pc_irq.S -SOURCES = $(CORE_SOURCES) +SOURCES = $(CORE_SOURCES) $(PC_HW_SOURCES) -OBJECTS = $(SOURCES:.c=.o) $(PC_HW_OBJECTS) +OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) +.c.o: + gcc -o $@ -c $(CFLAGS) $< .S.o: gcc -o $@ -c $(CFLAGS) $< .s.o: gcc -o $@ -c $(CFLAGS) $(<:.s=.S) -.c.o: - gcc -o $@ -c $(CFLAGS) $< all: $(LIBDIR)/$(GLUT_LIB) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP) @@ -84,10 +84,10 @@ $(LIBDIR)/$(GLUT_LIB): $(OBJECTS) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS) ifeq ($(DXE2GEN),) - @echo Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN - @echo somewhere in PATH, and DXE2.LD in DJGPP/LIB directory. + $(warning Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN) + $(warning somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.) else - dxe2gen -o $(LIBDIR)/$(GLUT_DXE) -I $(LIBDIR)/$(GLUT_IMP) $(OBJECTS) -D "DOS Glut" -U + dxe2gen -o $(LIBDIR)/$(GLUT_DXE) -I $(LIBDIR)/$(GLUT_IMP) $(OBJECTS) -D "Mesa DOS GLUT" -U endif clean: @@ -102,7 +102,7 @@ init.o: init.c ../include/GL/glut.h internal.h PC_HW/pc_hw.h menu.o: menu.c ../include/GL/glut.h models.o: models.c ../include/GL/glut.h overlay.o: overlay.c ../include/GL/glut.h -state.o: state.c ../include/GL/glut.h internal.h pc_hw/pc_hw.h +state.o: state.c ../include/GL/glut.h internal.h PC_HW/pc_hw.h teapot.o: teapot.c ../include/GL/glut.h window.o: window.c ../include/GL/glut.h ../include/GL/dmesa.h internal.h \ PC_HW/pc_hw.h diff --git a/src/glut/dos/PC_HW/pc_hw.c b/src/glut/dos/PC_HW/pc_hw.c index d6ffd5650f5..09ab4614049 100644 --- a/src/glut/dos/PC_HW/pc_hw.c +++ b/src/glut/dos/PC_HW/pc_hw.c @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v0.1 for DOS/DJGPP + * PC/HW routine collection v1.0 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/PC_HW/pc_hw.h b/src/glut/dos/PC_HW/pc_hw.h index 09fe8051bb4..47fcf78d0c8 100644 --- a/src/glut/dos/PC_HW/pc_hw.h +++ b/src/glut/dos/PC_HW/pc_hw.h @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v0.1 for DOS/DJGPP + * PC/HW routine collection v1.0 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -189,12 +189,11 @@ extern int pc_remove_irq (int i); #define KEY_MAX 115 -extern volatile char pc_key[KEY_MAX]; - int pc_install_keyb (void); void pc_remove_keyb (void); int pc_keypressed (void); int pc_readkey (void); +int pc_keydown (int code); /* * timer @@ -205,13 +204,12 @@ void pc_remove_timer (void); /* * mouse */ -extern volatile int pc_mouse_x, pc_mouse_y, pc_mouse_b; - int pc_install_mouse (void); void pc_remove_mouse (void); MFUNC pc_install_mouse_handler (MFUNC handler); void pc_mouse_area (int x1, int y1, int x2, int y2); void pc_mouse_speed (int xspeed, int yspeed); +int pc_query_mouse (int *x, int *y); void pc_show_mouse (void); void pc_scare_mouse (void); void pc_unscare_mouse (void); diff --git a/src/glut/dos/PC_HW/pc_irq.S b/src/glut/dos/PC_HW/pc_irq.S index 8f19f8eb9f4..196546072cc 100644 --- a/src/glut/dos/PC_HW/pc_irq.S +++ b/src/glut/dos/PC_HW/pc_irq.S @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v0.2 for DOS/DJGPP + * PC/HW routine collection v1.0 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/PC_HW/pc_keyb.c b/src/glut/dos/PC_HW/pc_keyb.c index d3987d8e340..50ef94b797b 100644 --- a/src/glut/dos/PC_HW/pc_keyb.c +++ b/src/glut/dos/PC_HW/pc_keyb.c @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v0.4 for DOS/DJGPP + * PC/HW routine collection v1.0 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/PC_HW/pc_mouse.c b/src/glut/dos/PC_HW/pc_mouse.c index aa1fbe4da73..72d3886d5ce 100644 --- a/src/glut/dos/PC_HW/pc_mouse.c +++ b/src/glut/dos/PC_HW/pc_mouse.c @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v0.4 for DOS/DJGPP + * PC/HW routine collection v1.0 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/PC_HW/pc_timer.c b/src/glut/dos/PC_HW/pc_timer.c index a8c58f67418..ec348e278b5 100644 --- a/src/glut/dos/PC_HW/pc_timer.c +++ b/src/glut/dos/PC_HW/pc_timer.c @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v0.1 for DOS/DJGPP + * PC/HW routine collection v1.0 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/callback.c b/src/glut/dos/callback.c index 0e49c3adfed..a9260cbe7c1 100644 --- a/src/glut/dos/callback.c +++ b/src/glut/dos/callback.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v0.1 for Mesa 4.0 + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/color.c b/src/glut/dos/color.c index b755459a3b4..9a7754514c8 100644 --- a/src/glut/dos/color.c +++ b/src/glut/dos/color.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v0.1 for Mesa 4.0 + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/font.c b/src/glut/dos/font.c index c1303ff6f44..1c31c15813a 100644 --- a/src/glut/dos/font.c +++ b/src/glut/dos/font.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v0.1 for Mesa 4.0 + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/globals.c b/src/glut/dos/globals.c index 9bdfe8e0ce0..342cf3d08f6 100644 --- a/src/glut/dos/globals.c +++ b/src/glut/dos/globals.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v0.1 for Mesa 4.0 + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/init.c b/src/glut/dos/init.c index 9cda3a8b5b5..a6d7e830b0c 100644 --- a/src/glut/dos/init.c +++ b/src/glut/dos/init.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v0.4 for Mesa 4.0 + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/internal.h b/src/glut/dos/internal.h index 2822c2c5ab0..e23d485b2e0 100644 --- a/src/glut/dos/internal.h +++ b/src/glut/dos/internal.h @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v0.2 for Mesa 4.0 + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/menu.c b/src/glut/dos/menu.c index 48354edfe7c..eccc51d2ea2 100644 --- a/src/glut/dos/menu.c +++ b/src/glut/dos/menu.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v0.1 for Mesa 4.0 + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/overlay.c b/src/glut/dos/overlay.c index b2c392fcd49..ab4f561849c 100644 --- a/src/glut/dos/overlay.c +++ b/src/glut/dos/overlay.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v0.1 for Mesa 4.0 + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/state.c b/src/glut/dos/state.c index 94ef0cac795..b463f4a1093 100644 --- a/src/glut/dos/state.c +++ b/src/glut/dos/state.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v0.2 for Mesa 4.0 + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/window.c b/src/glut/dos/window.c index c110715ebb3..f43533ce5f8 100644 --- a/src/glut/dos/window.c +++ b/src/glut/dos/window.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v0.2 for Mesa 4.0 + * DOS/DJGPP glut driver v1.0 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -171,11 +171,24 @@ void APIENTRY glutSetIconTitle (const char *title) void APIENTRY glutPositionWindow (int x, int y) { + if (DMesaViewport(buffer[window], x, y, g_width, g_height)) { + g_xpos = x; + g_ypos = y; + } } void APIENTRY glutReshapeWindow (int width, int height) { + if (DMesaViewport(buffer[window], g_xpos, g_ypos, width, height)) { + g_width = width; + g_height = height; + if (reshape_func) { + reshape_func(width, height); + } else { + glViewport(0, 0, width, height); + } + } } diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index 454b891c08b..559204fc53d 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v0.3 for Mesa 4.0 + * DOS/DJGPP device driver v1.0 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -76,9 +76,10 @@ struct dmesa_visual { * Add system-specific fields to it. */ struct dmesa_buffer { - GLframebuffer *gl_buffer; /* The depth, stencil, accum, etc buffers */ + GLframebuffer gl_buffer; /* The depth, stencil, accum, etc buffers */ void *the_window; /* your window handle, etc */ + int bypp; /* bytes per pixel */ int xpos, ypos; /* position */ int width, height; /* size in pixels */ int bwidth, len; /* bytes in a line, then total */ @@ -540,12 +541,12 @@ static GLboolean set_draw_buffer (GLcontext *ctx, GLenum mode) * If anything special has to been done when the buffer/window is * resized, do it now. */ -static void get_buffer_size (GLcontext *ctx, GLuint *width, GLuint *height) +static void get_buffer_size (GLframebuffer *buffer, GLuint *width, GLuint *height) { - DMesaContext c = (DMesaContext)ctx->DriverCtx; + DMesaBuffer b = (DMesaBuffer)buffer; - *width = c->Buffer->width; - *height = c->Buffer->height; + *width = b->width; + *height = b->height; } @@ -554,7 +555,7 @@ static const GLubyte* get_string (GLcontext *ctx, GLenum name) { switch (name) { case GL_RENDERER: - return (const GLubyte *)"DOS Mesa"; + return (const GLubyte *)"Mesa DOS\0DJGPP port (c) Borca Daniel 31-mar-2002"; default: return NULL; } @@ -636,7 +637,7 @@ void dmesa_init_pointers (GLcontext *ctx) ctx->Driver.Accum = _swrast_Accum; ctx->Driver.Bitmap = _swrast_Bitmap; ctx->Driver.Clear = clear; - ctx->Driver.ResizeBuffersMESA = _swrast_alloc_buffers; + ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; ctx->Driver.CopyPixels = _swrast_CopyPixels; ctx->Driver.DrawPixels = _swrast_DrawPixels; ctx->Driver.ReadPixels = _swrast_ReadPixels; @@ -804,17 +805,17 @@ DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, if ((b=(DMesaBuffer)calloc(1, sizeof(struct dmesa_buffer)))!=NULL) { - b->gl_buffer = _mesa_create_framebuffer(visual->gl_visual, - visual->gl_visual->depthBits > 0, - visual->gl_visual->stencilBits > 0, - visual->gl_visual->accumRedBits > 0, - visual->gl_visual->alphaBits > 0); + _mesa_initialize_framebuffer(&b->gl_buffer, + visual->gl_visual, + visual->gl_visual->depthBits > 0, + visual->gl_visual->stencilBits > 0, + visual->gl_visual->accumRedBits > 0, + visual->gl_visual->alphaBits > 0); b->xpos = xpos; b->ypos = ypos; b->width = width; - b->bwidth = width * ((visual->depth+7)/8); b->height = height; - b->len = b->bwidth * b->height; + b->bypp = (visual->depth+7)/8; } return b; @@ -825,7 +826,7 @@ DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, void DMesaDestroyBuffer (DMesaBuffer b) { free(b->the_window); - _mesa_destroy_framebuffer(b->gl_buffer); + _mesa_free_framebuffer_data(&b->gl_buffer); free(b); } @@ -871,23 +872,45 @@ void DMesaDestroyContext (DMesaContext c) +GLboolean DMesaViewport (DMesaBuffer b, + GLint xpos, GLint ypos, + GLint width, GLint height) +{ + void *new_window; + + if ((new_window=vl_sync_buffer(b->the_window, xpos, ypos, width, height))==NULL) { + return GL_FALSE; + } else { + b->the_window = new_window; + b->xpos = xpos; + b->ypos = ypos; + b->width = width; + b->height = height; + b->bwidth = width * b->bypp; + b->len = b->bwidth * height; + return GL_TRUE; + } +} + + + /* * Make the specified context and buffer the current one. */ GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b) { if (c&&b) { - if ((b->the_window=vl_sync_buffer(b->the_window, b->xpos, b->ypos, b->width, b->height))==NULL) { + if (!DMesaViewport(b, b->xpos, b->ypos, b->width, b->height)) { return GL_FALSE; } c->Buffer = b; dmesa_update_state(c->gl_ctx, 0); - _mesa_make_current(c->gl_ctx, b->gl_buffer); + _mesa_make_current(c->gl_ctx, &b->gl_buffer); if (c->gl_ctx->Viewport.Width==0) { /* initialize viewport to window size */ - _mesa_Viewport(0, 0, c->Buffer->width, c->Buffer->height); + _mesa_Viewport(0, 0, b->width, b->height); } } else { /* Detach */ diff --git a/src/mesa/drivers/dos/dpmi.c b/src/mesa/drivers/dos/dpmi.c index 26400ac3af3..0cc0a89e64e 100644 --- a/src/mesa/drivers/dos/dpmi.c +++ b/src/mesa/drivers/dos/dpmi.c @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v0.3 for Mesa 4.0 + * DOS/DJGPP device driver v1.0 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/dpmiint.h b/src/mesa/drivers/dos/dpmiint.h index 8494ee6bb27..d0171fb1009 100644 --- a/src/mesa/drivers/dos/dpmiint.h +++ b/src/mesa/drivers/dos/dpmiint.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v0.3 for Mesa 4.0 + * DOS/DJGPP device driver v1.0 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/video.c b/src/mesa/drivers/dos/video.c index 9d50952c527..d31037de616 100644 --- a/src/mesa/drivers/dos/video.c +++ b/src/mesa/drivers/dos/video.c @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v0.4 for Mesa 4.0 + * DOS/DJGPP device driver v1.0 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -416,14 +416,12 @@ void *vl_sync_buffer (void *buffer, int x, int y, int width, int height) if (width&3) { return NULL; } else { - current_offset = video_scanlen * y + video_bypp * x; if ((newbuf=realloc(buffer, width*height*video_bypp))!=NULL) { + current_offset = video_scanlen * y + video_bypp * x; current_width = width; current_delta = video_scanlen - video_bypp * width; - return newbuf; - } else { - return NULL; } + return newbuf; } } diff --git a/src/mesa/drivers/dos/video.h b/src/mesa/drivers/dos/video.h index c806aa7c885..46a1e22d30d 100644 --- a/src/mesa/drivers/dos/video.h +++ b/src/mesa/drivers/dos/video.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v0.4 for Mesa 4.0 + * DOS/DJGPP device driver v1.0 for Mesa 4.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/main/Makefile.DJ b/src/mesa/main/Makefile.DJ index fc540dc60bb..afe95f0c367 100644 --- a/src/mesa/main/Makefile.DJ +++ b/src/mesa/main/Makefile.DJ @@ -20,7 +20,7 @@ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# DOS/DJGPP core makefile v0.4 for Mesa 4.0 +# DOS/DJGPP core makefile v1.0 for Mesa 4.0 # # Copyright (C) 2002 - Borca Daniel # Email : dborca@yahoo.com @@ -31,7 +31,7 @@ TOP = .. CC = gcc -CFLAGS = -I$(TOP)/include -I. -Wall -W -Wno-unused -mcpu=pentium -ffast-math -O2 +CFLAGS = -I$(TOP)/include -I. -Wall -W -Wno-unused -mcpu=$(CPU) -ffast-math -O2 AR = ar ARFLAGS = ruv LIBDIR = $(TOP)/lib @@ -165,14 +165,65 @@ CORE_SOURCES = \ tnl/t_vb_texmat.c \ tnl/t_vb_vertex.c +X86_SOURCES = \ + X86/x86.c \ + X86/glapi_x86.S \ + X86/common_x86.c \ + X86/common_x86_asm.S \ + X86/x86_xform2.S \ + X86/x86_xform3.S \ + X86/x86_xform4.S \ + X86/x86_vertex.S \ + X86/x86_cliptest.S + +MMX_SOURCES = + +SSE_SOURCES = \ + X86/sse.c \ + X86/sse_xform2.S \ + X86/sse_xform3.S \ + X86/sse_xform4.S \ + X86/sse_vertex.S \ + X86/sse_normal.S + +D3NOW_SOURCES = \ + X86/3dnow.c \ + X86/3dnow_xform2.S \ + X86/3dnow_xform3.S \ + X86/3dnow_xform4.S \ + X86/3dnow_vertex.S + +ifdef HAVE_MMX +X86_SOURCES += $(MMX_SOURCES) +CFLAGS += -DUSE_MMX_ASM +HAVE_X86 = 1 +endif +ifdef HAVE_SSE +X86_SOURCES += $(SSE_SOURCES) +CFLAGS += -DUSE_SSE_ASM +HAVE_X86 = 1 +endif +ifdef HAVE_3DNOW +X86_SOURCES += $(D3NOW_SOURCES) +CFLAGS += -DUSE_3DNOW_ASM +HAVE_X86 = 1 +endif +ifdef HAVE_X86 +CFLAGS += -DUSE_X86_ASM +else +X86_SOURCES = +endif + DRIVER_SOURCES = DOS/dmesa.c DOS/video.c DOS/dpmi.c -SOURCES = $(CORE_SOURCES) $(DRIVER_SOURCES) +SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(DRIVER_SOURCES) -OBJECTS = $(SOURCES:.c=.o) +OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) .c.o: gcc -o $@ -c $(CFLAGS) $< +.S.o: + gcc -o $@ -c $(CFLAGS) $< all: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP) @@ -181,21 +232,24 @@ $(LIBDIR)/$(GL_LIB): $(OBJECTS) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP): $(OBJECTS) ifeq ($(DXE2GEN),) - @echo Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN - @echo somewhere in PATH, and DXE2.LD in DJGPP/LIB directory. + $(warning Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN) + $(warning somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.) else - dxe2gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) $(OBJECTS) -D "DOS Mesa" -U + dxe2gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) $(OBJECTS) -D "Mesa DOS GL" -U endif clean: -$(RM) *.o +ifdef HAVE_X86 + -$(RM) X86\*.o +endif -$(RM) DOS\*.o include depend DOS/dmesa.o: DOS/dmesa.c glheader.h ../include/GL/gl.h context.h glapi.h \ - mtypes.h config.h glapitable.h glthread.h math/m_matrix.h dd.h \ - ../include/GL/dmesa.h extensions.h macros.h matrix.h mmath.h texformat.h \ + mtypes.h config.h glapitable.h glthread.h math/m_matrix.h dd.h macros.h \ + ../include/GL/dmesa.h extensions.h matrix.h mmath.h texformat.h \ texstore.h array_cache/acache.h swrast/s_context.h swrast/swrast.h \ swrast/s_depth.h swrast/s_lines.h swrast/s_triangle.h swrast/s_trispan.h \ swrast_setup/swrast_setup.h tnl/tnl.h tnl/t_context.h math/m_vector.h \ -- cgit v1.2.3 From 01dc182ee86922845ba0b17a2cda9af19150c93a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 Apr 2002 16:58:04 +0000 Subject: added OSMesaGetProcAddress() --- include/GL/osmesa.h | 17 +++++++++++++---- src/mesa/drivers/osmesa/osmesa.c | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h index 63ce843b682..d9412378121 100644 --- a/include/GL/osmesa.h +++ b/include/GL/osmesa.h @@ -1,10 +1,10 @@ -/* $Id: osmesa.h,v 1.9 2001/09/23 16:06:13 brianp Exp $ */ +/* $Id: osmesa.h,v 1.10 2002/04/04 16:58:04 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 4.0 + * Version: 4.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -63,7 +63,7 @@ extern "C" { #define OSMESA_MAJOR_VERSION 4 -#define OSMESA_MINOR_VERSION 0 +#define OSMESA_MINOR_VERSION 1 #define OSMESA_PATCH_VERSION 0 @@ -254,6 +254,15 @@ OSMesaGetColorBuffer( OSMesaContext c, GLint *width, GLint *height, +/* + * Return pointer to the named function. + * + * New in Mesa 4.1 + */ +GLAPI void * GLAPIENTRY +OSMesaGetProcAddress( const char *funcName ); + + #if defined(__BEOS__) || defined(__QUICKDRAW__) #pragma export off #endif diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index b7b667dd739..4fdf290383f 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1,4 +1,4 @@ -/* $Id: osmesa.c,v 1.77 2002/04/04 00:54:02 brianp Exp $ */ +/* $Id: osmesa.c,v 1.78 2002/04/04 16:58:04 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -621,6 +621,39 @@ OSMesaGetColorBuffer( OSMesaContext c, GLint *width, } } + + +struct name_address { + const char *Name; + GLvoid *Address; +}; + +static struct name_address functions[] = { + { "OSMesaCreateContext", (void *) OSMesaCreateContext }, + { "OSMesaCreateContextExt", (void *) OSMesaCreateContextExt }, + { "OSMesaDestroyContext", (void *) OSMesaDestroyContext }, + { "OSMesaMakeCurrent", (void *) OSMesaMakeCurrent }, + { "OSMesaGetCurrentContext", (void *) OSMesaGetCurrentContext }, + { "OSMesaPixelsStore", (void *) OSMesaPixelStore }, + { "OSMesaGetIntegerv", (void *) OSMesaGetIntegerv }, + { "OSMesaGetDepthBuffer", (void *) OSMesaGetDepthBuffer }, + { "OSMesaGetColorBuffer", (void *) OSMesaGetColorBuffer }, + { "OSMesaGetProcAddress", (void *) OSMesaGetProcAddress }, + { NULL, NULL } +}; + +GLAPI void * GLAPIENTRY +OSMesaGetProcAddress( const char *funcName ) +{ + int i; + for (i = 0; functions[i].Name; i++) { + if (strcmp(functions[i].Name, funcName) == 0) + return (void *) functions[i].Address; + } + return (void *) _glapi_get_proc_address(funcName); +} + + /**********************************************************************/ /*** Device Driver Functions ***/ /**********************************************************************/ -- cgit v1.2.3 From cb445412fc57a9622d75cb3bf09c3477f9e2c1b0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 12 Apr 2002 21:09:12 +0000 Subject: version 13 of glext.h - fixes GL_EXT_texture_env_dot3 token values --- include/GL/glext.h | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index c4b4baa0930..7d7080048f4 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -49,9 +49,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2002/03/22 */ +/* glext.h last updated 2002/04/12 */ /* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 11 +#define GL_GLEXT_VERSION 13 #ifndef GL_VERSION_1_2 #define GL_CONSTANT_COLOR 0x8001 @@ -459,9 +459,7 @@ extern "C" { #ifndef GL_ARB_texture_env_dot3 #define GL_DOT3_RGB_ARB 0x86AE -#define GL_DOT3_RGB_EXT 0x86AE #define GL_DOT3_RGBA_ARB 0x86AF -#define GL_DOT3_RGBA_EXT 0x86AF #endif #ifndef GL_ARB_texture_mirrored_repeat @@ -1688,6 +1686,16 @@ extern "C" { #define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF #endif +#ifndef GL_EXT_texture_env_dot3 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 +#endif + #ifndef GL_NV_fence #define GL_ALL_COMPLETED_NV 0x84F2 #define GL_FENCE_STATUS_NV 0x84F3 @@ -2274,6 +2282,9 @@ extern "C" { #ifndef GL_NV_vertex_program1_1 #endif +#ifndef GL_EXT_shadow_funcs +#endif + /*************************************************************/ @@ -4035,6 +4046,14 @@ GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); typedef void (APIENTRY * PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); #endif +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 +#endif + #ifndef GL_NV_fence #define GL_NV_fence 1 #ifdef GL_GLEXT_PROTOTYPES @@ -4615,6 +4634,10 @@ typedef void (APIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint #define GL_NV_vertex_program1_1 1 #endif +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 +#endif + #ifdef __cplusplus } -- cgit v1.2.3 From e694a8765a2406838354e39d5c40dab5fbb744e9 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Tue, 23 Apr 2002 18:23:32 +0000 Subject: Fix up alpha buffer handling for Windows. - add two new Pixel Format Descriptors that do not have alpha bits to mirror the two that do. - add logic to wglChoosePixelFormat to match PFD's with respect to alpha. - Create/clear software alpha buffer as required. Now a wgl or GLUT program can control the creation of a software alpha buffer via the PFD or GLUT parms, respectively. --- include/GL/wmesa.h | 21 +++++++++++++++++---- src/mesa/drivers/windows/wgl.c | 25 +++++++++++++++++++++++-- src/mesa/drivers/windows/wmesa.c | 17 +++++++++++++---- 3 files changed, 53 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/GL/wmesa.h b/include/GL/wmesa.h index 94b61974c37..67ca17f7a4a 100644 --- a/include/GL/wmesa.h +++ b/include/GL/wmesa.h @@ -1,4 +1,4 @@ -/* $Id: wmesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ +/* $Id: wmesa.h,v 1.2 2002/04/23 18:23:32 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -24,8 +24,17 @@ /* * $Log: wmesa.h,v $ - * Revision 1.1 1999/08/19 00:55:40 jtg - * Initial revision + * Revision 1.2 2002/04/23 18:23:32 kschultz + * Fix up alpha buffer handling for Windows. + * - add two new Pixel Format Descriptors that do not have alpha bits to + * mirror the two that do. + * - add logic to wglChoosePixelFormat to match PFD's with respect to alpha. + * - Create/clear software alpha buffer as required. + * Now a wgl or GLUT program can control the creation of a software alpha + * buffer via the PFD or GLUT parms, respectively. + * + * Revision 1.1.1.1 1999/08/19 00:55:40 jtg + * Imported sources * * Revision 3.2 1999/01/03 02:54:45 brianp * updated per Ted Jump @@ -101,13 +110,17 @@ typedef struct wmesa_context *WMesaContext; * GL_FALSE = color index mode * db_flag - GL_TRUE = double-buffered, * GL_FALSE = single buffered + * alpha_flag - GL_TRUE = create software alpha buffer, + * GL_FALSE = no software alpha buffer * * Note: Indexed mode requires double buffering under Windows. * * Return: a WMesa_context or NULL if error. */ extern WMesaContext WMesaCreateContext(HWND hWnd,HPALETTE* pPal, - GLboolean rgb_flag,GLboolean db_flag); + GLboolean rgb_flag, + GLboolean db_flag, + GLboolean alpha_flag); /* diff --git a/src/mesa/drivers/windows/wgl.c b/src/mesa/drivers/windows/wgl.c index 0db57641fe1..62a4c1704ce 100644 --- a/src/mesa/drivers/windows/wgl.c +++ b/src/mesa/drivers/windows/wgl.c @@ -1,4 +1,4 @@ -/* $Id: wgl.c,v 1.9 2001/09/18 16:39:38 kschultz Exp $ */ +/* $Id: wgl.c,v 1.10 2002/04/23 18:23:33 kschultz Exp $ */ /* * This library is free software; you can redistribute it and/or @@ -100,6 +100,7 @@ int qt_ext = sizeof(ext) / sizeof(ext[0]); struct __pixelformat__ pix[] = { + /* Double Buffer, alpha */ { { sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_GENERIC_FORMAT|PFD_DOUBLEBUFFER|PFD_SWAP_COPY, PFD_TYPE_RGBA, @@ -107,6 +108,7 @@ struct __pixelformat__ pix[] = 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 }, GL_TRUE }, + /* Single Buffer, alpha */ { { sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_GENERIC_FORMAT, PFD_TYPE_RGBA, @@ -114,6 +116,22 @@ struct __pixelformat__ pix[] = 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 }, GL_FALSE }, + /* Double Buffer, no alpha */ + { { sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_GENERIC_FORMAT|PFD_DOUBLEBUFFER|PFD_SWAP_COPY, + PFD_TYPE_RGBA, + 24, 8, 0, 8, 8, 8, 16, 0, 0, + 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 }, + GL_TRUE + }, + /* Single Buffer, no alpha */ + { { sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_GENERIC_FORMAT, + PFD_TYPE_RGBA, + 24, 8, 0, 8, 8, 8, 16, 0, 0, + 0, 0, 0, 0, 0, 16, 8, 0, 0, 0, 0, 0, 0 }, + GL_FALSE + }, }; int qt_pix = sizeof(pix) / sizeof(pix[0]); @@ -158,7 +176,8 @@ WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC hdc) if ( wgl_ctx[i].ctx == NULL ) { wgl_ctx[i].ctx = WMesaCreateContext( hWnd, NULL, GL_TRUE, - pix[curPFD-1].doubleBuffered ); + pix[curPFD-1].doubleBuffered, + pix[curPFD-1].pfd.cAlphaBits ? GL_TRUE : GL_FALSE); if (wgl_ctx[i].ctx == NULL) break; wgl_ctx[i].hdc = hdc; @@ -559,6 +578,8 @@ WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC hdc, continue; if(ppfd->iPixelType != pix[i].pfd.iPixelType) delta++; + if(ppfd->cAlphaBits != pix[i].pfd.cAlphaBits) + delta++; if(delta < bestdelta) { best = i + 1; diff --git a/src/mesa/drivers/windows/wmesa.c b/src/mesa/drivers/windows/wmesa.c index 4f057bfad73..73037b7d05c 100644 --- a/src/mesa/drivers/windows/wmesa.c +++ b/src/mesa/drivers/windows/wmesa.c @@ -1,4 +1,4 @@ -/* $Id: wmesa.c,v 1.26 2002/03/16 00:53:15 brianp Exp $ */ +/* $Id: wmesa.c,v 1.27 2002/04/23 18:23:33 kschultz Exp $ */ /* * Windows (Win32) device driver for Mesa 3.4 @@ -396,6 +396,13 @@ static clear(GLcontext* ctx, GLbitfield mask, /* sanity check - can't have right(stereo) buffers */ assert((mask & (DD_FRONT_RIGHT_BIT | DD_BACK_RIGHT_BIT)) == 0); + /* clear alpha */ + if ((mask & (DD_FRONT_LEFT_BIT | DD_BACK_RIGHT_BIT)) && + ctx->DrawBuffer->UseSoftwareAlphaBuffers && + ctx->Color.ColorMask[ACOMP]) { + _mesa_clear_alpha_buffers( ctx ); + } + if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) { if (mask & DD_BACK_LEFT_BIT) { #if defined(USE_GDI_TO_CLEAR) @@ -1240,7 +1247,8 @@ static void GetPalette(HPALETTE Pal,RGBQUAD *aRGB) WMesaContext WMesaCreateContext( HWND hWnd, HPALETTE* Pal, GLboolean rgb_flag, - GLboolean db_flag ) + GLboolean db_flag, + GLboolean alpha_flag ) { RECT CR; WMesaContext c; @@ -1318,7 +1326,8 @@ WMesaContext WMesaCreateContext( HWND hWnd, HPALETTE* Pal, c->gl_visual = _mesa_create_visual(rgb_flag, db_flag, /* db_flag */ GL_FALSE, /* stereo */ - 8,8,8,8, /* r, g, b, a bits */ + 8,8,8, /* r, g, b bits */ + alpha_flag ? 8 : 0, /* alpha bits */ 0, /* index bits */ 16, /* depth_bits */ 8, /* stencil_bits */ @@ -1355,7 +1364,7 @@ WMesaContext WMesaCreateContext( HWND hWnd, HPALETTE* Pal, c->gl_visual->depthBits > 0, c->gl_visual->stencilBits > 0, c->gl_visual->accumRedBits > 0, - GL_FALSE /* s/w alpha */ ); + alpha_flag /* s/w alpha */ ); if (!c->gl_buffer) { _mesa_destroy_visual( c->gl_visual ); _mesa_free_context_data( c->gl_ctx ); -- cgit v1.2.3 From f105bc409511ecd4d9bdb91c10963123cdf999fa Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 27 May 2002 17:05:19 +0000 Subject: removed experiemental GL_MESA_sprite_point extension --- include/GL/gl.h | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 675b97499d0..fcc5bdd3273 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.65 2002/03/20 22:07:17 brianp Exp $ */ +/* $Id: gl.h,v 1.66 2002/05/27 17:05:19 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2486,17 +2486,6 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid #endif /* GL_MESA_packed_depth_stencil */ -/* - * ??. GL_MESA_sprite_point - */ -#ifndef GL_MESA_sprite_point -#define GL_MESA_sprite_point 1 - -#define GL_SPRITE_POINT_MESA 0x8757 /* XXX not finalized! */ - -#endif - - #ifndef GL_ARB_window_pos #define GL_ARB_window_pos 1 -- cgit v1.2.3 From 9800adaed223035e90e53de4c31d59fd04237833 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 7 Jun 2002 19:29:49 +0000 Subject: s/GL_MAX_TEXTURE_RECTANGLE_SIZE_NV/GL_MAX_RECTANGLE_TEXTURE_SIZE_NV/ --- include/GL/glext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 7d7080048f4..0f5fd07de46 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -1749,7 +1749,7 @@ extern "C" { #define GL_TEXTURE_RECTANGLE_NV 0x84F5 #define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 #define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 -#define GL_MAX_TEXTURE_RECTANGLE_SIZE_NV 0x84F8 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 #endif #ifndef GL_NV_texture_shader -- cgit v1.2.3 From 3f058cd2c5a7e71eaff6adb011a78d797231e470 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 7 Jun 2002 20:21:12 +0000 Subject: version 15 of glext.h --- include/GL/glext.h | 134 +++++++++++++++++++++++++++-------------------------- 1 file changed, 69 insertions(+), 65 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 0f5fd07de46..fc9cb3c176d 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -49,11 +49,45 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2002/04/12 */ +/* glext.h last updated 2002/05/30 */ /* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 13 +#define GL_GLEXT_VERSION 15 #ifndef GL_VERSION_1_2 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#endif + +#ifndef GL_ARB_imaging #define GL_CONSTANT_COLOR 0x8001 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 #define GL_CONSTANT_ALPHA 0x8003 @@ -99,19 +133,6 @@ extern "C" { #define GL_MINMAX_FORMAT 0x802F #define GL_MINMAX_SINK 0x8030 #define GL_TABLE_TOO_LARGE 0x8031 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_RESCALE_NORMAL 0x803A -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 #define GL_COLOR_MATRIX 0x80B1 #define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 #define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 @@ -122,6 +143,7 @@ extern "C" { #define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 #define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 #define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATIX_ALPHA_BIAS 0x80BB #define GL_COLOR_TABLE 0x80D0 #define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 #define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 @@ -138,29 +160,11 @@ extern "C" { #define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD #define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE #define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D #define GL_IGNORE_BORDER 0x8150 #define GL_CONSTANT_BORDER 0x8151 #define GL_WRAP_BORDER 0x8152 #define GL_REPLICATE_BORDER 0x8153 #define GL_CONVOLUTION_BORDER_COLOR 0x8154 -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E #endif #ifndef GL_VERSION_1_3 @@ -3695,22 +3699,22 @@ GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GL GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLenum *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLenum, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLenum *, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLenum, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLenum *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); @@ -3736,22 +3740,22 @@ typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLenum rc, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLenum rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLenum *rc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLenum rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLenum rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLenum *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); #endif #ifndef GL_EXT_blend_func_separate -- cgit v1.2.3 From b58c5ad7b0a2c3ed3ecf189f284e23118091fa68 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 10 Jun 2002 15:16:44 +0000 Subject: GGI driver updates (Filip Spacek) --- include/GL/ggimesa.h | 62 +- progs/ggi/gears2.c | 59 +- src/glut/ggi/ggiglut.c | 20 +- src/mesa/drivers/ggi/default/linear.c | 347 ++++++---- src/mesa/drivers/ggi/default/stubs.c | 265 +++++--- src/mesa/drivers/ggi/ggimesa.c | 741 ++++++++++----------- src/mesa/drivers/ggi/include/ggi/mesa/ggimesa.h | 58 +- .../drivers/ggi/include/ggi/mesa/ggimesa_int.h | 31 +- 8 files changed, 897 insertions(+), 686 deletions(-) (limited to 'include') diff --git a/include/GL/ggimesa.h b/include/GL/ggimesa.h index f88ecffc5e2..1e8eb52b6a9 100644 --- a/include/GL/ggimesa.h +++ b/include/GL/ggimesa.h @@ -1,10 +1,11 @@ -/* $Id: ggimesa.h,v 1.3 2000/02/09 19:03:28 brianp Exp $ */ +/* $Id: ggimesa.h,v 1.4 2002/06/10 15:16:44 brianp Exp $ */ /* - * Mesa 3-D graphics library - * Version: 3.3 + * Mesa 3-D graphics library GGI bindings (GGIGL [giggle]) + * Version: 4.0 * Copyright (C) 1995-2000 Brian Paul * Copyright (C) 1998 Uwe Maurer + * Copyrigth (C) 2001 Filip Spacek * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -25,34 +26,59 @@ #ifndef GGIMESA_H #define GGIMESA_H - -#define GGIMESA_MAJOR_VERSION 3 -#define GGIMESA_MINOR_VERSION 3 - +#define GGIMESA_MAJOR_VERSION 4 +#define GGIMESA_MINOR_VERSION 0 #ifdef __cplusplus extern "C" { #endif +#include #include "GL/gl.h" + +typedef struct ggi_mesa_context *ggi_mesa_context_t; +/* + * Initialize Mesa GGI extension + */ +int ggiMesaInit(void); +/* + * Clean up Mesa GGI exension + */ +int ggiMesaExit(void); -typedef struct ggi_mesa_context *GGIMesaContext; - -#include - -extern GGIMesaContext GGIMesaCreateContext(void); +/* + * Attach Mesa GGI extension to the visual 'vis' + */ +int ggiMesaAttach(ggi_visual_t vis); +/* + * Detach Mesa GGI extension from the visual 'vis' + */ +int ggiMesaDetach(ggi_visual_t vis); -extern void GGIMesaDestroyContext(GGIMesaContext ctx); +int ggiMesaExtendVisual(ggi_visual_t vis, GLboolean alpha_flag, + GLboolean stereo_flag, GLint depth_size, + GLint stencil_size, GLint accum_red_size, + GLint accum_green_size, GLint accum_blue_size, + GLint accum_alpha_size, GLint num_samples); -extern void GGIMesaMakeCurrent(GGIMesaContext ctx); +/* + * Create a new context capable of displaying on the visual vis. + */ +ggi_mesa_context_t ggiMesaCreateContext(ggi_visual_t vis); +/* + * Destroy the context 'ctx' + */ +void ggiMesaDestroyContext(ggi_mesa_context_t ctx); -extern GGIMesaContext GGIMesaGetCurrentContext(void); +/* + * Make context 'ctx' the current context and bind it to visual 'vis'. + * Note that the context must have been created with respect to that visual. + */ +void ggiMesaMakeCurrent(ggi_mesa_context_t ctx, ggi_visual_t vis); -extern void GGIMesaSwapBuffers(void); +void ggiMesaSwapBuffers(void); -extern int GGIMesaSetVisual(GGIMesaContext ctx, ggi_visual_t vis, - GLboolean rgb_flag, GLboolean db_flag); #ifdef __cplusplus } diff --git a/progs/ggi/gears2.c b/progs/ggi/gears2.c index 1d1e10db545..9468c031777 100644 --- a/progs/ggi/gears2.c +++ b/progs/ggi/gears2.c @@ -19,6 +19,7 @@ ggi_visual_t vis; char text[100]; +int db_flag,vis_x, vis_y, vir_x, vir_y, gt; /* * Draw a gear wheel. You'll probably want to call this function when @@ -157,6 +158,7 @@ static GLuint count = 1; static void draw( void ) { + static int n = 0; glClearColor(0,0,0,0); glClearIndex(0); glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); @@ -197,12 +199,25 @@ static void draw( void ) ggiPuts(vis,0,ggiGetInfo(vis)->mode->visible.y+16,text); #endif - GGIMesaSwapBuffers(); + if(db_flag) + ggiMesaSwapBuffers(); count++; if (count==limit) { exit(1); } + ++n; + /* + if (!(n%10)){ + ggi_color rgb = { 10000, 10000, 10000 }; + ggiSetSimpleMode(vis,vis_x+(n/10),vis_y+(n/10),db_flag?2:1, gt); + glViewport(0, 0,vis_x+(n/10),vis_y+(n/10)); + ggiSetGCForeground(vis, ggiMapColor(vis, &rgb)); + ggiDrawBox(vis, 20, 20, 100, 100); + if(db_flag) + ggiSetWriteFrame(vis, 1); + } + */ } static void idle( void ) @@ -216,6 +231,10 @@ static void reshape( int width, int height ) { GLfloat h = (GLfloat) height / (GLfloat) width; + if(db_flag) + glDrawBuffer(GL_BACK); + else + glDrawBuffer(GL_FRONT); glViewport(0, 0, (GLint)width, (GLint)height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -231,8 +250,8 @@ static void reshape( int width, int height ) static void init( void ) { static GLfloat pos[4] = {5.0, 5.0, 10.0, 0.0 }; - static GLfloat red[4] = {0.8, 0.1, 0.0, 1.0 }; - static GLfloat green[4] = {0.0, 0.8, 0.2, 1.0 }; + static GLfloat red[4] = {0.9, 0.9, 0.9, 1.0 }; + static GLfloat green[4] = {0.0, 0.8, 0.9, 1.0 }; static GLfloat blue[4] = {0.2, 0.2, 1.0, 1.0 }; glLightfv( GL_LIGHT0, GL_POSITION, pos ); @@ -276,9 +295,9 @@ static void usage(char *s) int main( int argc, char *argv[] ) { - GGIMesaContext ctx; - int vis_x,vis_y,vir_x,vir_y,bpp,db_flag,gt; + ggi_mesa_context_t ctx; ggi_mode mode; + int bpp; limit=0; @@ -313,13 +332,12 @@ int main( int argc, char *argv[] ) exit(1); } - ctx=GGIMesaCreateContext(); - if (ctx==NULL) + if (ggiMesaInit() < 0) { - printf("GGIMesaCreateContext() failed\n"); + printf("ggiMesaInit failed\n"); exit(1); } - + vis=ggiOpen(NULL); if (vis==NULL) { @@ -327,29 +345,42 @@ int main( int argc, char *argv[] ) exit(1); } - if (ggiSetGraphMode(vis,vis_x,vis_y,vir_x,vir_y,gt)<0) + if (ggiSetSimpleMode(vis,vis_x,vis_y,db_flag ? 2 : 1,gt)<0) { printf("%s: can't set graphmode (%i %i %i %i) %i BPP\n", argv[0],vis_x,vis_y,vir_x,vir_y,bpp); exit(1); } - if (GGIMesaSetVisual(ctx,vis,GL_TRUE,db_flag)<0) + if (ggiMesaAttach(vis) < 0) + { + printf("ggiMesaAttach failed\n"); + exit(1); + } + if (ggiMesaExtendVisual(vis, GL_FALSE, GL_FALSE, 16, + 0, 0, 0, 0, 0, 1) < 0) { printf ("GGIMesaSetVisual() failed\n"); exit(1); } - GGIMesaMakeCurrent(ctx); + ctx = ggiMesaCreateContext(vis); + if (ctx==NULL) + { + printf("GGIMesaCreateContext() failed\n"); + exit(1); + } + + ggiMesaMakeCurrent(ctx, vis); ggiGetMode(vis,&mode); reshape(mode.visible.x,mode.visible.y); init(); - while (!ggiKbhit(vis)) idle(); + while (!ggiKbhit(vis)) { /*sleep(1);*/ idle(); } - GGIMesaDestroyContext(ctx); + ggiMesaDestroyContext(ctx); ggiClose(vis); printf("%s\n",text); diff --git a/src/glut/ggi/ggiglut.c b/src/glut/ggi/ggiglut.c index d66a9d706b8..140f576002a 100644 --- a/src/glut/ggi/ggiglut.c +++ b/src/glut/ggi/ggiglut.c @@ -238,11 +238,6 @@ int glutCreateWindow(const char *title) gt = (rgb) ? __glut_gt_rgb : __glut_gt_index; - __glut_ctx = GGIMesaCreateContext(); - - if (__glut_ctx == NULL) - ggiPanic("Can't create mesa-context\n"); - __glut_vis = ggiOpen(NULL); if (__glut_vis == NULL) { @@ -261,20 +256,27 @@ int glutCreateWindow(const char *title) /* return GL_FALSE; */ } - ggiGetMode(__glut_vis, &mode); - - if (GGIMesaSetVisual(__glut_ctx, __glut_vis, rgb, frames > 1) < 0) + if (ggiMesaExtendVisual(__glut_vis, GL_FALSE, GL_FALSE, + 16, 0, 0, 0, 0, 0, 1) < 0) { ggiPanic("GGIMesaSetVisual failed!\n"); } + __glut_ctx = ggiMesaCreateContext(__glut_vis); + + if (__glut_ctx == NULL) + ggiPanic("Can't create mesa-context\n"); + + ggiGetMode(__glut_vis, &mode); + + __glut_width = mode.visible.x; __glut_height = mode.visible.y; mousex = mode.visible.x / 2; mousey = mode.visible.y / 2; - GGIMesaMakeCurrent(__glut_ctx); + ggiMesaMakeCurrent(__glut_ctx, __glut_vis); if (__glut_reshape) __glut_reshape(__glut_width, __glut_height); diff --git a/src/mesa/drivers/ggi/default/linear.c b/src/mesa/drivers/ggi/default/linear.c index e105cd0e592..4c74497e009 100644 --- a/src/mesa/drivers/ggi/default/linear.c +++ b/src/mesa/drivers/ggi/default/linear.c @@ -24,6 +24,8 @@ #include #include +#include +#include "swrast/swrast.h" #define RMASK ((1<>RS) << (G+B)) | \ + ((color[GCOMP]>>GS) << B) | \ + ((color[BCOMP]>>BS))) + +#define FLIP(coord) (LIBGGI_MODE(ggi_ctx->ggi_visual)->visible.y-(coord) - 1) + /**********************************************************************/ /***** Write spans of pixels *****/ /**********************************************************************/ -void GGIwrite_ci32_span(const GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLuint ci[], - const GLubyte mask[]) +void GGIwrite_ci32_span(const GLcontext *ctx, GLuint n, GLint x, GLint y, + const GLuint ci[], const GLubyte mask[]) { - FB_TYPE *fb=LFB(FB_TYPE,x,FLIP(y)); + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + FB_TYPE *fb; + fb = (FB_TYPE *)(LIBGGI_CURWRITE(ggi_ctx->ggi_visual) + + FLIP(y)*LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual)) + x; + if (mask) { while (n--) { - if (*mask++) *fb=*ci; + if (*mask++) + *fb = *ci; fb++; ci++; } @@ -58,17 +69,19 @@ void GGIwrite_ci32_span(const GLcontext *ctx, } } -void GGIwrite_ci8_span(const GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLubyte ci[], - const GLubyte mask[] ) +void GGIwrite_ci8_span(const GLcontext *ctx, GLuint n, GLint x, GLint y, + const GLubyte ci[], const GLubyte mask[]) { - FB_TYPE *fb=LFB(FB_TYPE,x,FLIP(y)); + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + FB_TYPE *fb; + fb = (FB_TYPE *)(LIBGGI_CURWRITE(ggi_ctx->ggi_visual) + + FLIP(y)*LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual)) + x; if (mask) { while (n--) { - if (*mask++) *fb=*ci; + if (*mask++) + *fb = *ci; fb++; ci++; } @@ -80,21 +93,19 @@ void GGIwrite_ci8_span(const GLcontext *ctx, } -void GGIwrite_rgba_span(const GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLubyte rgba[][4], - const GLubyte mask[]) +void GGIwrite_rgba_span(const GLcontext *ctx, GLuint n, GLint x, GLint y, + const GLchan rgba[][4], const GLubyte mask[]) { - FB_TYPE *fb=LFB(FB_TYPE,x,FLIP(y)); + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + FB_TYPE *fb; + fb = (FB_TYPE *)(LIBGGI_CURWRITE(ggi_ctx->ggi_visual) + + FLIP(y)*LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual)) + x; if (mask) { while (n--) { - if (*mask++) { - *fb= ((rgba[0][RCOMP]>>RS) << (G+B)) | - ((rgba[0][GCOMP]>>GS) << B) | - ((rgba[0][BCOMP]>>BS)); - } + if (*mask++) + *fb = PACK(rgba[0]); fb++; rgba++; } @@ -102,28 +113,25 @@ void GGIwrite_rgba_span(const GLcontext *ctx, else { while (n--) { - *fb++= ((rgba[0][RCOMP]>>RS) << (G+B)) | - ((rgba[0][GCOMP]>>GS) << B)| - ((rgba[0][BCOMP]>>BS)); + *fb++ = PACK(rgba[0]); rgba++; } } } -void GGIwrite_rgb_span( const GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLubyte rgba[][3], - const GLubyte mask[] ) +void GGIwrite_rgb_span(const GLcontext *ctx, GLuint n, GLint x, GLint y, + const GLchan rgba[][3], const GLubyte mask[]) { - FB_TYPE *fb=LFB(FB_TYPE,x,FLIP(y)); + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + FB_TYPE *fb; + fb = (FB_TYPE *)(LIBGGI_CURWRITE(ggi_ctx->ggi_visual) + + FLIP(y)*LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual)) + x; + if (mask) { while (n--) { - if (*mask++) { - *fb= ((rgba[0][RCOMP]>>RS) << (G+B)) | - ((rgba[0][GCOMP]>>GS) << B) | - ((rgba[0][BCOMP]>>BS)); - } + if (*mask++) + *fb = PACK(rgba[0]); fb++; rgba++; } @@ -131,36 +139,62 @@ void GGIwrite_rgb_span( const GLcontext *ctx, else { while (n--) { - *fb++= ((rgba[0][RCOMP]>>RS) << (G+B)) | - ((rgba[0][GCOMP]>>GS) << B) | - ((rgba[0][BCOMP]>>BS)); + *fb++ = PACK(rgba[0]); rgba++; } } } -void GGIwrite_mono_span( const GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLubyte mask[]) +void GGIwrite_mono_rgba_span(const GLcontext *ctx, GLuint n, GLint x, GLint y, + const GLchan color[4], const GLubyte mask[]) { + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; FB_TYPE *fb; - FB_TYPE color; + fb = (FB_TYPE *)(LIBGGI_CURWRITE(ggi_ctx->ggi_visual) + + FLIP(y)*LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual)) + x; + + if (mask){ + while (n--){ + if (*mask++) + *fb = PACK(color); + ++fb; + } + } + else { + while (n--) + *fb++ = PACK(color); - if (mask) - { - fb=LFB(FB_TYPE,x,FLIP(y)); - color=(FB_TYPE) GGICTX->color; + /* Alternatively we could write a potentialy faster HLine + ggiSetGCForeground(ggi_ctx->ggi_visual, color); + ggiDrawHLine(ggi_ctx->ggi_visual,x,FLIP(y),n); + */ + } +} - while (n--) - { - if (*mask++) *fb=color; - fb++; +void GGIwrite_mono_ci_span(const GLcontext *ctx, GLuint n, GLint x, GLint y, + const GLuint ci, const GLubyte mask[]) +{ + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + FB_TYPE *fb; + fb = (FB_TYPE *)(LIBGGI_CURWRITE(ggi_ctx->ggi_visual) + + FLIP(y)*LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual)) + x; + + if (mask){ + while (n--){ + if (*mask++) + *fb = ci; + ++fb; } } - else - { - ggiDrawHLine(VIS,x,FLIP(y),n); + else { + while (n--) + *fb++ = ci; + + /* Alternatively we could write a potentialy faster HLine + ggiSetGCForeground(ggi_ctx->ggi_visual, ci); + ggiDrawHLine(ggi_ctx->ggi_visual, x, FLIP(y), n); + */ } } @@ -171,27 +205,33 @@ void GGIwrite_mono_span( const GLcontext *ctx, void GGIread_ci32_span(const GLcontext *ctx, - GLuint n, GLint x, GLint y, GLuint ci[]) + GLuint n, GLint x, GLint y, GLuint ci[]) { - FB_TYPE *fb=LFB(FB_TYPE,x,FLIP(y)); + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + FB_TYPE *fb; + fb = (FB_TYPE *)(LIBGGI_CURWRITE(ggi_ctx->ggi_visual) + + FLIP(y)*LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual)) + x; + while (n--) - *ci++=(GLuint)*fb++; + *ci++ = (GLuint)*fb++; } void GGIread_rgba_span(const GLcontext *ctx, - GLuint n, GLint x, GLint y, - GLubyte rgba[][4]) + GLuint n, GLint x, GLint y, GLchan rgba[][4]) { - FB_TYPE *fb=LFB(FB_TYPE,x,FLIP(y)); + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; FB_TYPE color; - + FB_TYPE *fb; + fb = (FB_TYPE *)(LIBGGI_CURWRITE(ggi_ctx->ggi_visual) + + FLIP(y)*LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual)) + x; + while (n--) { - color=*fb++; + color = *fb++; rgba[0][RCOMP] = (GLubyte) (color>>(G+B))<>B)& ((1<DriverCtx; + int stride = LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual); + void *fb = LIBGGI_CURWRITE(ggi_ctx->ggi_visual); while (n--) { - if (*mask++) *(fb+ *x + FLIP(*y)*GGICTX->width)=*ci; + if (*mask++){ + FB_TYPE *dst = (FB_TYPE*)(fb + FLIP(*y)*stride) + *x; + *dst = *ci; + } ci++; x++; y++; } } -void GGIwrite_mono_pixels(const GLcontext *ctx, - GLuint n, - const GLint x[], const GLint y[], - const GLubyte mask[] ) +void GGIwrite_mono_ci_pixels(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLuint ci, const GLubyte mask[]) { - FB_TYPE *fb=LFB(FB_TYPE,0,0); - FB_TYPE color=(FB_TYPE) GGICTX->color; + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + int stride = LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual); + void *fb = LIBGGI_CURWRITE(ggi_ctx->ggi_visual); while (n--) { - if (*mask++) *(fb+ *x + FLIP(*y)*GGICTX->width)=color; + if (*mask++){ + FB_TYPE *dst = (FB_TYPE*)(fb + FLIP(*y)*stride) + *x; + *dst = ci; + } x++; y++; } } void GGIwrite_rgba_pixels(const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - const GLubyte rgba[][4], - const GLubyte mask[] ) + GLuint n, const GLint x[], const GLint y[], + const GLchan rgba[][4], const GLubyte mask[]) { - FB_TYPE *fb=LFB(FB_TYPE,0,0); - FB_TYPE color; + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + int stride = LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual); + void *fb = LIBGGI_CURWRITE(ggi_ctx->ggi_visual); while (n--) { - if (*mask++) { - color= ((rgba[0][RCOMP]>>RS) << (G+B)) | - ((rgba[0][GCOMP]>>GS) << B) | - ((rgba[0][BCOMP]>>BS)); - *(fb+ *x + FLIP(*y)*GGICTX->width)=color; + if (*mask++){ + FB_TYPE *dst = (FB_TYPE*)(fb + FLIP(*y)*stride) + *x; + *dst = PACK(rgba[0]); } - x++;y++; + x++; + y++; rgba++; } } +void GGIwrite_mono_rgba_pixels(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + const GLchan rgba[4], const GLubyte mask[]) +{ + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + int stride = LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual); + void *fb = LIBGGI_CURWRITE(ggi_ctx->ggi_visual); + + while (n--) { + if (*mask++){ + FB_TYPE *dst = (FB_TYPE*)(fb + FLIP(*y)*stride) + *x; + *dst = PACK(rgba); + } + + x++; + y++; + } +} /**********************************************************************/ /***** Read arrays of pixels *****/ /**********************************************************************/ void GGIread_ci32_pixels(const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - GLuint ci[], const GLubyte mask[]) + GLuint n, const GLint x[], const GLint y[], + GLuint ci[], const GLubyte mask[]) { - FB_TYPE *fb=LFB(FB_TYPE,0,0); + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + int stride = LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual); + void *fb = LIBGGI_CURWRITE(ggi_ctx->ggi_visual); while (n--) { - if (*mask++) - *ci=*(fb+ *x + FLIP(*y)*GGICTX->width); + if (*mask++){ + FB_TYPE *src = (FB_TYPE*)(fb + FLIP(*y)*stride) + *x; + *ci = *src; + } ci++; x++; y++; @@ -270,60 +339,70 @@ void GGIread_ci32_pixels(const GLcontext *ctx, } void GGIread_rgba_pixels(const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - GLubyte rgba[][4], - const GLubyte mask[] ) + GLuint n, const GLint x[], const GLint y[], + GLubyte rgba[][4], const GLubyte mask[]) { - FB_TYPE *fb=LFB(FB_TYPE,0,0); + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + int stride = LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual); + void *fb = LIBGGI_CURWRITE(ggi_ctx->ggi_visual); FB_TYPE color; while (n--) { if (*mask++) - { - color=*(fb+ *x + FLIP(*y)*GGICTX->width); - rgba[0][RCOMP] =(GLubyte)(color>>(G+B))<>B)& ((1<>(G+B))<>B)& ((1<gl_ctx; - - ctx->Driver.WriteRGBASpan = GGIwrite_rgba_span; - ctx->Driver.WriteRGBSpan = GGIwrite_rgb_span; -// ctx->Driver.WriteMonoRGBASpan = GGIwrite_mono_span; - ctx->Driver.WriteRGBAPixels = GGIwrite_rgba_pixels; -// ctx->Driver.WriteMonoRGBAPixels = GGIwrite_mono_pixels; - - ctx->Driver.WriteCI32Span = GGIwrite_ci32_span; - ctx->Driver.WriteCI8Span = GGIwrite_ci8_span; -// ctx->Driver.WriteMonoCISpan = GGIwrite_mono_span; - ctx->Driver.WriteCI32Pixels = GGIwrite_ci32_pixels; -// ctx->Driver.WriteMonoCIPixels = GGIwrite_mono_pixels; - - ctx->Driver.ReadCI32Span = GGIread_ci32_span; - ctx->Driver.ReadRGBASpan = GGIread_rgba_span; - ctx->Driver.ReadCI32Pixels = GGIread_ci32_pixels; - ctx->Driver.ReadRGBAPixels = GGIread_rgba_pixels; +} - info->red_bits = R; - info->green_bits =G; - info->blue_bits = B; +int GGIsetup_driver(ggi_mesa_context_t ggi_ctx) +{ + struct swrast_device_driver *swdd = + _swrast_GetDeviceDriverReference(ggi_ctx->gl_ctx); + + GGIMESADPRINT_LIBS("linear_%d: GGIsetup_driver\n", sizeof(FB_TYPE)*8); + + swdd->WriteRGBASpan = GGIwrite_rgba_span; + swdd->WriteRGBSpan = GGIwrite_rgb_span; + swdd->WriteMonoRGBASpan = GGIwrite_mono_rgba_span; + swdd->WriteRGBAPixels = GGIwrite_rgba_pixels; + swdd->WriteMonoRGBAPixels = GGIwrite_mono_rgba_pixels; + + swdd->WriteCI32Span = GGIwrite_ci32_span; + swdd->WriteCI8Span = GGIwrite_ci8_span; + swdd->WriteMonoCISpan = GGIwrite_mono_ci_span; + swdd->WriteCI32Pixels = GGIwrite_ci32_pixels; + swdd->WriteMonoCIPixels = GGIwrite_mono_ci_pixels; + + swdd->ReadCI32Span = GGIread_ci32_span; + swdd->ReadRGBASpan = GGIread_rgba_span; + swdd->ReadCI32Pixels = GGIread_ci32_pixels; + swdd->ReadRGBAPixels = GGIread_rgba_pixels; + + swdd->SetReadBuffer = GGIset_read_buffer; return 0; } static int GGIopen(ggi_visual_t vis,struct ggi_dlhandle *dlh, - const char *args,void *argptr, uint32 *dlret) -{ - LIBGGI_MESAEXT(vis)->setup_driver=GGIsetup_driver; + const char *args,void *argptr, uint32 *dlret) +{ + GGIMESADPRINT_CORE("linear_%d: GGIOpen\n", sizeof(FB_TYPE)*8); + LIBGGI_MESAEXT(vis)->setup_driver = GGIsetup_driver; *dlret = GGI_DL_OPDRAW; return 0; @@ -332,15 +411,15 @@ static int GGIopen(ggi_visual_t vis,struct ggi_dlhandle *dlh, int DLOPENFUNC(int func, void **funcptr) { switch (func) { - case GGIFUNC_open: - *funcptr = GGIopen; - return 0; - case GGIFUNC_exit: - case GGIFUNC_close: - *funcptr = NULL; - return 0; - default: - *funcptr = NULL; + case GGIFUNC_open: + *funcptr = GGIopen; + return 0; + case GGIFUNC_exit: + case GGIFUNC_close: + *funcptr = NULL; + return 0; + default: + *funcptr = NULL; } return GGI_ENOTFOUND; } diff --git a/src/mesa/drivers/ggi/default/stubs.c b/src/mesa/drivers/ggi/default/stubs.c index 07999276fbf..27eb363627d 100644 --- a/src/mesa/drivers/ggi/default/stubs.c +++ b/src/mesa/drivers/ggi/default/stubs.c @@ -26,13 +26,16 @@ #include #include +#include #include "mmath.h" #include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "swrast/s_context.h" -#include "swrast/s_depth.h" -#include "swrast/s_triangle.h" +//#include "swrast_setup/swrast_setup.h" +//#include "swrast/s_context.h" +//#include "swrast/s_depth.h" +//#include "swrast/s_triangle.h" + +#define FLIP(coord) (LIBGGI_MODE(ggi_ctx->ggi_visual)->visible.y-(coord)-1) /**********************************************************************/ /***** Write spans of pixels *****/ @@ -43,18 +46,21 @@ void GGIwrite_ci32_span(const GLcontext *ctx, const GLuint ci[], const GLubyte mask[] ) { - y=FLIP(y); + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + y = FLIP(y); if (mask) { while (n--) { - if (*mask++) ggiPutPixel(VIS,x,y,*ci); + if (*mask++) + ggiPutPixel(ggi_ctx->ggi_visual, x, y, *ci); x++; ci++; } } else { - while (n--) ggiPutPixel(VIS,x++,y,*ci++); + while (n--) + ggiPutPixel(ggi_ctx->ggi_visual, x++, y, *ci++); } } @@ -63,36 +69,69 @@ void GGIwrite_ci8_span(const GLcontext *ctx, const GLubyte ci[], const GLubyte mask[] ) { - y=FLIP(y); + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + y = FLIP(y); if (mask) { while (n--) { - if (*mask++) ggiPutPixel(VIS,x,y,*ci); + if (*mask++) + ggiPutPixel(ggi_ctx->ggi_visual, x, y, *ci); x++; ci++; } } else { - while (n--) ggiPutPixel(VIS,x++,y,*ci++); + while (n--) + ggiPutPixel(ggi_ctx->ggi_visual, x++, y, *ci++); } } -void GGIwrite_mono_span( const GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLubyte mask[] ) +void GGIwrite_mono_ci_span(const GLcontext *ctx, GLuint n, GLint x, GLint y, + const GLuint ci, const GLubyte mask[]) { - y=FLIP(y); + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + y = FLIP(y); if (mask) { while (n--) { - if (*mask++) ggiDrawPixel(VIS,x,y); + if (*mask++) + ggiPutPixel(ggi_ctx->ggi_visual, x, y, ci); x++; } } else { - ggiDrawHLine(VIS,x,y,n); + while (n--) + ggiPutPixel(ggi_ctx->ggi_visual, x++, y, ci); + } +} + +void GGIwrite_mono_rgba_span(const GLcontext *ctx, GLuint n, GLint x, GLint y, + const GLchan rgba[4], const GLubyte mask[]) +{ + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + ggi_color rgb; + ggi_pixel col; + + y = FLIP(y); + + rgb.r = (uint16)(rgba[RCOMP]) << SHIFT; + rgb.g = (uint16)(rgba[GCOMP]) << SHIFT; + rgb.b = (uint16)(rgba[BCOMP]) << SHIFT; + col = ggiMapColor(ggi_ctx->ggi_visual, &rgb); + + if (mask) + { + while (n--) { + if (*mask++) + ggiPutPixel(ggi_ctx->ggi_visual, x, y, col); + x++; + } + } + else + { + ggiDrawHLine(ggi_ctx->ggi_visual, x, y, n); } } @@ -101,20 +140,21 @@ void GGIwrite_rgba_span( const GLcontext *ctx, const GLubyte rgba[][4], const GLubyte mask[]) { + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; ggi_color rgb; ggi_pixel col; - y=FLIP(y); + y = FLIP(y); if (mask) { while (n--) { if (*mask++) { - rgb.r=(uint16)(rgba[0][RCOMP]) << SHIFT; - rgb.g=(uint16)(rgba[0][GCOMP]) << SHIFT; - rgb.b=(uint16)(rgba[0][BCOMP]) << SHIFT; - col=ggiMapColor(VIS,&rgb); - ggiPutPixel(VIS,x,y,col); + rgb.r = (uint16)(rgba[0][RCOMP]) << SHIFT; + rgb.g = (uint16)(rgba[0][GCOMP]) << SHIFT; + rgb.b = (uint16)(rgba[0][BCOMP]) << SHIFT; + col = ggiMapColor(ggi_ctx->ggi_visual, &rgb); + ggiPutPixel(ggi_ctx->ggi_visual, x, y, col); } x++; rgba++; @@ -124,34 +164,36 @@ void GGIwrite_rgba_span( const GLcontext *ctx, { while (n--) { - rgb.r=(uint16)(rgba[0][RCOMP]) << SHIFT; - rgb.g=(uint16)(rgba[0][GCOMP]) << SHIFT; - rgb.b=(uint16)(rgba[0][BCOMP]) << SHIFT; - col=ggiMapColor(VIS,&rgb); - ggiPutPixel(VIS,x++,y,col); + rgb.r = (uint16)(rgba[0][RCOMP]) << SHIFT; + rgb.g = (uint16)(rgba[0][GCOMP]) << SHIFT; + rgb.b = (uint16)(rgba[0][BCOMP]) << SHIFT; + col = ggiMapColor(ggi_ctx->ggi_visual, &rgb); + ggiPutPixel(ggi_ctx->ggi_visual, x++, y, col); rgba++; } } } + void GGIwrite_rgb_span( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][3], const GLubyte mask[] ) { + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; ggi_color rgb; ggi_pixel col; - y=FLIP(y); + y = FLIP(y); if (mask) { while (n--) { if (*mask++) { - rgb.r=(uint16)(rgba[0][RCOMP]) << SHIFT; - rgb.g=(uint16)(rgba[0][GCOMP]) << SHIFT; - rgb.b=(uint16)(rgba[0][BCOMP]) << SHIFT; - col=ggiMapColor(VIS,&rgb); - ggiPutPixel(VIS,x,y,col); + rgb.r = (uint16)(rgba[0][RCOMP]) << SHIFT; + rgb.g = (uint16)(rgba[0][GCOMP]) << SHIFT; + rgb.b = (uint16)(rgba[0][BCOMP]) << SHIFT; + col = ggiMapColor(ggi_ctx->ggi_visual, &rgb); + ggiPutPixel(ggi_ctx->ggi_visual, x, y, col); } x++; rgba++; @@ -161,11 +203,11 @@ void GGIwrite_rgb_span( const GLcontext *ctx, { while (n--) { - rgb.r=(uint16)(rgba[0][RCOMP]) << SHIFT; - rgb.g=(uint16)(rgba[0][GCOMP]) << SHIFT; - rgb.b=(uint16)(rgba[0][BCOMP]) << SHIFT; - col=ggiMapColor(VIS,&rgb); - ggiPutPixel(VIS,x++,y,col); + rgb.r = (uint16)(rgba[0][RCOMP]) << SHIFT; + rgb.g = (uint16)(rgba[0][GCOMP]) << SHIFT; + rgb.b = (uint16)(rgba[0][BCOMP]) << SHIFT; + col = ggiMapColor(ggi_ctx->ggi_visual, &rgb); + ggiPutPixel(ggi_ctx->ggi_visual, x++, y, col); rgba++; } } @@ -181,24 +223,26 @@ void GGIwrite_rgb_span( const GLcontext *ctx, void GGIread_ci32_span( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint ci[]) { + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; y = FLIP(y); while (n--) - ggiGetPixel(VIS, x++, y,ci++); + ggiGetPixel(ggi_ctx->ggi_visual, x++, y, ci++); } void GGIread_rgba_span( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4]) { + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; ggi_color rgb; ggi_pixel col; - y=FLIP(y); + y = FLIP(y); while (n--) { - ggiGetPixel(VIS,x++,y,&col); - ggiUnmapPixel(VIS,col,&rgb); + ggiGetPixel(ggi_ctx->ggi_visual, x++, y, &col); + ggiUnmapPixel(ggi_ctx->ggi_visual, col, &rgb); rgba[0][RCOMP] = (GLubyte) (rgb.r >> SHIFT); rgba[0][GCOMP] = (GLubyte) (rgb.g >> SHIFT); rgba[0][BCOMP] = (GLubyte) (rgb.b >> SHIFT); @@ -215,21 +259,24 @@ void GGIwrite_ci32_pixels( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLuint ci[], const GLubyte mask[] ) { + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; while (n--) { - if (*mask++) ggiPutPixel(VIS,*x, FLIP(*y),*ci); + if (*mask++) + ggiPutPixel(ggi_ctx->ggi_visual, *x, FLIP(*y), *ci); ci++; x++; y++; } } -void GGIwrite_mono_pixels( const GLcontext *ctx, - GLuint n, - const GLint x[], const GLint y[], - const GLubyte mask[] ) +void GGIwrite_mono_ci_pixels(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLuint ci, const GLubyte mask[]) { + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; while (n--) { - if (*mask++) ggiDrawPixel(VIS,*x,FLIP(*y)); + if (*mask++) + ggiPutPixel(ggi_ctx->ggi_visual, *x, FLIP(*y), ci); x++; y++; } @@ -240,21 +287,43 @@ void GGIwrite_rgba_pixels( const GLcontext *ctx, const GLubyte rgba[][4], const GLubyte mask[] ) { + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; ggi_pixel col; ggi_color rgb; while (n--) { if (*mask++) { - rgb.r=(uint16)(rgba[0][RCOMP]) << SHIFT; - rgb.g=(uint16)(rgba[0][GCOMP]) << SHIFT; - rgb.b=(uint16)(rgba[0][BCOMP]) << SHIFT; - col=ggiMapColor(VIS,&rgb); - ggiPutPixel(VIS,*x,FLIP(*y),col); + rgb.r = (uint16)(rgba[0][RCOMP]) << SHIFT; + rgb.g = (uint16)(rgba[0][GCOMP]) << SHIFT; + rgb.b = (uint16)(rgba[0][BCOMP]) << SHIFT; + col = ggiMapColor(ggi_ctx->ggi_visual, &rgb); + ggiPutPixel(ggi_ctx->ggi_visual, *x, FLIP(*y), col); } - x++;y++; + x++; + y++; rgba++; } } +void GGIwrite_mono_rgba_pixels(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + const GLchan rgba[4], const GLubyte mask[]) +{ + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + ggi_color rgb; + ggi_pixel col; + + rgb.r = (uint16)(rgba[RCOMP]) << SHIFT; + rgb.g = (uint16)(rgba[GCOMP]) << SHIFT; + rgb.b = (uint16)(rgba[BCOMP]) << SHIFT; + col = ggiMapColor(ggi_ctx->ggi_visual, &rgb); + + while (n--) { + if (*mask++) + ggiPutPixel(ggi_ctx->ggi_visual, *x, FLIP(*y), col); + x++; + y++; + } +} /**********************************************************************/ /***** Read arrays of pixels *****/ @@ -264,9 +333,10 @@ void GGIread_ci32_pixels( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLuint ci[], const GLubyte mask[]) { + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; while (n--) { if (*mask++) - ggiGetPixel(VIS, *x, FLIP(*y) ,ci); + ggiGetPixel(ggi_ctx->ggi_visual, *x, FLIP(*y), ci); ci++; x++; y++; @@ -278,6 +348,7 @@ void GGIread_rgba_pixels( const GLcontext *ctx, GLubyte rgba[][4], const GLubyte mask[] ) { + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; ggi_color rgb; ggi_pixel col; @@ -285,47 +356,59 @@ void GGIread_rgba_pixels( const GLcontext *ctx, { if (*mask++) { - ggiGetPixel(VIS,*x,FLIP(*y),&col); - ggiUnmapPixel(VIS,col,&rgb); - rgba[0][RCOMP]= rgb.r >> SHIFT; - rgba[0][GCOMP]= rgb.g >> SHIFT; - rgba[0][BCOMP]= rgb.b >> SHIFT; - rgba[0][ACOMP]=0; + ggiGetPixel(ggi_ctx->ggi_visual, *x, FLIP(*y), &col); + ggiUnmapPixel(ggi_ctx->ggi_visual, col, &rgb); + rgba[0][RCOMP] = rgb.r >> SHIFT; + rgba[0][GCOMP] = rgb.g >> SHIFT; + rgba[0][BCOMP] = rgb.b >> SHIFT; + rgba[0][ACOMP] = 0; } - x++; y++; + x++; + y++; rgba++; } } - -static swrast_tri_func ggimesa_stubs_get_triangle_func(GLcontext *ctx); - -int GGIsetup_driver(GGIMesaContext ggictx, struct ggi_mesa_info *info) +int GGIextend_visual(ggi_visual_t vis) { - GLcontext *ctx = ggictx->gl_ctx; + return 0; +} - ctx->Driver.WriteRGBASpan = GGIwrite_rgba_span; - ctx->Driver.WriteRGBSpan = GGIwrite_rgb_span; - ctx->Driver.WriteRGBAPixels = GGIwrite_rgba_pixels; +//static swrast_tri_func ggimesa_stubs_get_triangle_func(GLcontext *ctx); - ctx->Driver.WriteCI32Span = GGIwrite_ci32_span; - ctx->Driver.WriteCI8Span = GGIwrite_ci8_span; - ctx->Driver.WriteCI32Pixels = GGIwrite_ci32_pixels; +int GGIsetup_driver(ggi_mesa_context_t ggi_ctx) +{ + struct swrast_device_driver *swdd = + _swrast_GetDeviceDriverReference(ggi_ctx->gl_ctx); - ctx->Driver.ReadCI32Span = GGIread_ci32_span; - ctx->Driver.ReadRGBASpan = GGIread_rgba_span; - ctx->Driver.ReadCI32Pixels = GGIread_ci32_pixels; - ctx->Driver.ReadRGBAPixels = GGIread_rgba_pixels; + GGIMESADPRINT_CORE("stubs: setup_driver\n"); + + swdd->WriteRGBASpan = GGIwrite_rgba_span; + swdd->WriteRGBSpan = GGIwrite_rgb_span; + swdd->WriteMonoRGBASpan = GGIwrite_mono_rgba_span; + swdd->WriteRGBAPixels = GGIwrite_rgba_pixels; + swdd->WriteMonoRGBAPixels = GGIwrite_mono_rgba_pixels; + + swdd->WriteCI32Span = GGIwrite_ci32_span; + swdd->WriteCI8Span = GGIwrite_ci8_span; + swdd->WriteMonoCISpan = GGIwrite_mono_ci_span; + swdd->WriteCI32Pixels = GGIwrite_ci32_pixels; + swdd->WriteMonoCIPixels = GGIwrite_mono_ci_pixels; + + swdd->ReadCI32Span = GGIread_ci32_span; + swdd->ReadRGBASpan = GGIread_rgba_span; + swdd->ReadCI32Pixels = GGIread_ci32_pixels; + swdd->ReadRGBAPixels = GGIread_rgba_pixels; return 0; } -void GGIupdate_state(GLcontext *ctx) +void GGIupdate_state(ggi_mesa_context_t *ctx) { - ctx->Driver.TriangleFunc = _swsetup_Triangle; + //ctx->Driver.TriangleFunc = _swsetup_Triangle; } - +/* void GGItriangle_flat(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1, const SWvertex *v2) { //#define INTERP_Z 1 @@ -402,10 +485,10 @@ static swrast_tri_func ggimesa_stubs_get_triangle_func(GLcontext *ctx) return GGItriangle_flat; } - +*/ static int GGIopen(ggi_visual_t vis, struct ggi_dlhandle *dlh, const char *args, void *argptr, uint32 *dlret) -{ +{ LIBGGI_MESAEXT(vis)->update_state = GGIupdate_state; LIBGGI_MESAEXT(vis)->setup_driver = GGIsetup_driver; @@ -416,15 +499,15 @@ static int GGIopen(ggi_visual_t vis, struct ggi_dlhandle *dlh, int MesaGGIdl_stubs(int func, void **funcptr) { switch (func) { - case GGIFUNC_open: - *funcptr = GGIopen; - return 0; - case GGIFUNC_exit: - case GGIFUNC_close: - *funcptr = NULL; - return 0; - default: - *funcptr = NULL; + case GGIFUNC_open: + *funcptr = GGIopen; + return 0; + case GGIFUNC_exit: + case GGIFUNC_close: + *funcptr = NULL; + return 0; + default: + *funcptr = NULL; } return GGI_ENOTFOUND; } diff --git a/src/mesa/drivers/ggi/ggimesa.c b/src/mesa/drivers/ggi/ggimesa.c index 2674fee3b15..a4621bb2889 100644 --- a/src/mesa/drivers/ggi/ggimesa.c +++ b/src/mesa/drivers/ggi/ggimesa.c @@ -1,6 +1,7 @@ /* GGI-Driver for MESA * * Copyright (C) 1997-1998 Uwe Maurer - uwe_maurer@t-online.de + * 2002 Filip Spacek * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -33,23 +34,17 @@ #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" - -#undef VIS -#undef FLIP -#define VIS (GGIMesa->ggi_vis) -#define FLIP(y) (GGIMesa->flip_y-(y)) - -GGIMesaContext GGIMesa = NULL; /* the current context */ +#include "tnl/t_context.h" +#include "tnl/t_pipeline.h" +#include "array_cache/acache.h" +#include "texformat.h" +#include "texstore.h" ggi_extid ggiMesaID = -1; static int _ggimesaLibIsUp = 0; static void *_ggimesaConfigHandle; -/* FIXME: These should really be defined in the make system using -Dxxx */ -#define GGIMESACONFFILE "/usr/local/etc/ggi/ggimesa.conf" -#define GGIMESATAGLEN 0 -static char ggimesaconfstub[512] = GGIMESACONFFILE; -static char *ggimesaconffile = ggimesaconfstub + GGIMESATAGLEN; +static char ggimesaconffile[] = GGIMESACONFFILE; int _ggimesaDebugSync = 0; uint32 _ggimesaDebugState = 0; @@ -57,48 +52,52 @@ uint32 _ggimesaDebugState = 0; static void gl_ggiUpdateState(GLcontext *ctx, GLuint new_state); static int changed(ggi_visual_t vis, int whatchanged); -static void gl_ggiGetSize(GLcontext *ctx, GLuint *width, GLuint *height) + +static int _ggi_error(void) { - GGIMESADPRINT_CORE("gl_ggiGetSize() called\n"); + GGIMESADPRINT_CORE("_ggi_error() called\n"); - *width = GGIMesa->width; - *height = GGIMesa->height; + return -1; } -static void gl_ggiSetIndex(GLcontext *ctx, GLuint ci) +static void gl_ggiGetSize(GLframebuffer *fb, GLuint *width, GLuint *height) { - GGIMESADPRINT_CORE("gl_ggiSetIndex() called\n"); + /* FIXME: this is a hack to work around the new interface */ + GLcontext *ctx; + ggi_mesa_context_t ggi_ctx; + ctx = _mesa_get_current_context(); + ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + + GGIMESADPRINT_CORE("gl_ggiGetSize() called\n"); - ggiSetGCForeground(VIS, ci); - GGICTX->color = (ggi_pixel)ci; + *width = LIBGGI_MODE(ggi_ctx->ggi_visual)->visible.x; + *height = LIBGGI_MODE(ggi_ctx->ggi_visual)->visible.y; + printf("returning %d, %d\n", *width, *height); } -static void gl_ggiSetClearIndex(GLcontext *ctx, GLuint ci) +static void gl_ggiSetIndex(GLcontext *ctx, GLuint ci) { - GGIMESADPRINT_CORE("gl_ggiSetClearIndex() called\n"); + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + + GGIMESADPRINT_CORE("gl_ggiSetIndex() called\n"); - ggiSetGCForeground(VIS, ci); - GGICTX->clearcolor = (ggi_pixel)ci; + ggiSetGCForeground(ggi_ctx->ggi_visual, ci); + ggi_ctx->color = (ggi_pixel)ci; } -static void gl_ggiSetColor(GLcontext *ctx, GLubyte red, GLubyte green, - GLubyte blue, GLubyte alpha) -{ - ggi_color rgb; - ggi_pixel col; +static void gl_ggiSetClearIndex(GLcontext *ctx, GLuint ci) +{ + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - GGIMESADPRINT_CORE("gl_ggiSetColor() called\n"); + GGIMESADPRINT_CORE("gl_ggiSetClearIndex() called\n"); - rgb.r = (uint16)red << SHIFT; - rgb.g = (uint16)green << SHIFT; - rgb.b = (uint16)blue << SHIFT; - col = ggiMapColor(VIS, &rgb); - ggiSetGCForeground(VIS, col); - GGICTX->color = col; + ggiSetGCForeground(ggi_ctx->ggi_visual, ci); + ggi_ctx->clearcolor = (ggi_pixel)ci; } static void gl_ggiSetClearColor(GLcontext *ctx, const GLchan color[4]) { + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; ggi_color rgb; ggi_pixel col; @@ -107,48 +106,60 @@ static void gl_ggiSetClearColor(GLcontext *ctx, const GLchan color[4]) rgb.r = (uint16)color[0] << SHIFT; rgb.g = (uint16)color[1] << SHIFT; rgb.b = (uint16)color[2] << SHIFT; - col = ggiMapColor(VIS, &rgb); - ggiSetGCForeground(VIS, col); - GGICTX->clearcolor = col; + col = ggiMapColor(ggi_ctx->ggi_visual, &rgb); + ggiSetGCForeground(ggi_ctx->ggi_visual, col); + ggi_ctx->clearcolor = col; } -static GLbitfield gl_ggiClear(GLcontext *ctx,GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height) +static void gl_ggiClear(GLcontext *ctx, GLbitfield mask, GLboolean all, + GLint x, GLint y, GLint width, GLint height) { + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + GGIMESADPRINT_CORE("gl_ggiClear() called\n"); - if (mask & GL_COLOR_BUFFER_BIT) + if (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) { - ggiSetGCForeground(VIS, GGICTX->clearcolor); + ggiSetGCForeground(ggi_ctx->ggi_visual, ggi_ctx->clearcolor); if (all) { - ggiDrawBox(VIS, 0, GGIMesa->origin.y, - GGIMesa->width, GGIMesa->height); + int w, h; + w = LIBGGI_MODE(ggi_ctx->ggi_visual)->visible.x; + h = LIBGGI_MODE(ggi_ctx->ggi_visual)->visible.y; + ggiDrawBox(ggi_ctx->ggi_visual, 0, 0, w, h); } else { - ggiDrawBox(VIS, x, FLIP(y), width, height); + ggiDrawBox(ggi_ctx->ggi_visual, x, y, //FLIP(y), + width, height); } + ggiSetGCForeground(ggi_ctx->ggi_visual, ggi_ctx->color); - ggiSetGCForeground(VIS, GGICTX->color); + mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT); } - return mask & (~GL_COLOR_BUFFER_BIT); + _swrast_Clear(ctx, mask, all, x, y, width, height); + } /* Set the buffer used for drawing */ static GLboolean gl_ggiSetDrawBuffer(GLcontext *ctx, GLenum mode) { + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + + printf("set draw %d\n", mode); GGIMESADPRINT_CORE("gl_ggiSetDrawBuffer() called\n"); if (mode == GL_FRONT_LEFT) { - GGICTX->active_buffer = 1; + ggiSetWriteFrame(ggi_ctx->ggi_visual, + ggiGetDisplayFrame(ggi_ctx->ggi_visual)); return GL_TRUE; } else if (mode == GL_BACK_LEFT) { - GGICTX->active_buffer = 0; + ggiSetWriteFrame(ggi_ctx->ggi_visual, + ggiGetDisplayFrame(ggi_ctx->ggi_visual)?0 : 1); return GL_TRUE; } else @@ -160,18 +171,27 @@ static GLboolean gl_ggiSetDrawBuffer(GLcontext *ctx, GLenum mode) /* Set the buffer used for reading */ /* XXX support for separate read/draw buffers hasn't been tested */ -static void gl_ggiSetReadBuffer(GLcontext *ctx, GLframebuffer *buffer, GLenum mode) +static GLboolean gl_ggiSetReadBuffer(GLcontext *ctx, GLframebuffer *buffer, GLenum mode) { - GGIMESADPRINT_CORE("gl_ggiSetReadBuffer() called\n"); + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + printf("set read %d\n", mode); + GGIMESADPRINT_CORE("gl_ggiSetReadBuffer() called\n"); + if (mode == GL_FRONT_LEFT) { - GGICTX->active_buffer = 1; + ggiSetReadFrame(ggi_ctx->ggi_visual, + ggiGetDisplayFrame(ggi_ctx->ggi_visual)); + return GL_TRUE; } else if (mode == GL_BACK_LEFT) { - GGICTX->active_buffer = 0; + ggiSetReadFrame(ggi_ctx->ggi_visual, + ggiGetDisplayFrame(ggi_ctx->ggi_visual)?0 : 1); + return GL_TRUE; } + else + return GL_FALSE; } @@ -187,9 +207,11 @@ static const GLubyte * gl_ggiGetString(GLcontext *ctx, GLenum name) static void gl_ggiFlush(GLcontext *ctx) { + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + GGIMESADPRINT_CORE("gl_ggiFlush() called\n"); - ggiFlush(VIS); + ggiFlush(ggi_ctx->ggi_visual); } static void gl_ggiIndexMask(GLcontext *ctx, GLuint mask) @@ -197,7 +219,8 @@ static void gl_ggiIndexMask(GLcontext *ctx, GLuint mask) GGIMESADPRINT_CORE("gl_ggiIndexMask() called\n"); } -static void gl_ggiColorMask(GLcontext *ctx, GLboolean rmask, GLboolean gmask, GLboolean bmask, GLboolean amask) +static void gl_ggiColorMask(GLcontext *ctx, GLboolean rmask, GLboolean gmask, + GLboolean bmask, GLboolean amask) { GGIMESADPRINT_CORE("gl_ggiColorMask() called\n"); } @@ -209,75 +232,95 @@ static void gl_ggiEnable(GLcontext *ctx, GLenum pname, GLboolean state) static void gl_ggiSetupPointers(GLcontext *ctx) { + TNLcontext *tnl; + GGIMESADPRINT_CORE("gl_ggiSetupPointers() called\n"); - - /* Initialize all the pointers in the DD struct. Do this whenever */ - /* a new context is made current or we change buffers via set_buffer! */ + /* General information */ ctx->Driver.GetString = gl_ggiGetString; - ctx->Driver.UpdateState = gl_ggiUpdateState; - + ctx->Driver.GetBufferSize = gl_ggiGetSize; + ctx->Driver.Finish = gl_ggiFlush; + ctx->Driver.Flush = gl_ggiFlush; + + /* Software rasterizer pixel paths */ + ctx->Driver.Accum = _swrast_Accum; + ctx->Driver.Bitmap = _swrast_Bitmap; + ctx->Driver.Clear = gl_ggiClear; + ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; + ctx->Driver.CopyPixels = _swrast_CopyPixels; + ctx->Driver.DrawPixels = _swrast_DrawPixels; + ctx->Driver.ReadPixels = _swrast_ReadPixels; + + /* Software texturing */ + ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format; + ctx->Driver.TexImage1D = _mesa_store_teximage1d; + ctx->Driver.TexImage2D = _mesa_store_teximage2d; + ctx->Driver.TexImage3D = _mesa_store_teximage3d; + ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; + ctx->Driver.TexSubImage2D = _mesa_store_texsubimage2d; + ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; + ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; + + ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; + ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; + ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; + ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; + ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; + + ctx->Driver.BaseCompressedTexFormat = _mesa_base_compressed_texformat; + ctx->Driver.CompressedTextureSize = _mesa_compressed_texture_size; + ctx->Driver.GetCompressedTexImage = _mesa_get_compressed_teximage; + + /* Imaging extensions */ + ctx->Driver.CopyColorTable = _swrast_CopyColorTable; + ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; + ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; + ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; + + /* State change callbacks */ + ctx->Driver.SetDrawBuffer = gl_ggiSetDrawBuffer; ctx->Driver.ClearIndex = gl_ggiSetClearIndex; ctx->Driver.ClearColor = gl_ggiSetClearColor; -// ctx->Driver.Clear = gl_ggiClear; ctx->Driver.IndexMask = gl_ggiIndexMask; ctx->Driver.ColorMask = gl_ggiColorMask; ctx->Driver.Enable = gl_ggiEnable; - ctx->Driver.SetDrawBuffer = gl_ggiSetDrawBuffer; - ctx->Driver.SetReadBuffer = gl_ggiSetReadBuffer; - - ctx->Driver.GetBufferSize = gl_ggiGetSize; - - ctx->Driver.Finish = gl_ggiFlush; - ctx->Driver.Flush = gl_ggiFlush; + ctx->Driver.UpdateState = gl_ggiUpdateState; - ctx->Driver.RenderStart = 0; - ctx->Driver.RenderFinish = _swrast_flush; - - ctx->Driver.PointsFunc = _swsetup_Points; - ctx->Driver.LineFunc = _swsetup_Line; - ctx->Driver.TriangleFunc = _swsetup_Triangle; - ctx->Driver.QuadFunc = _swsetup_Quad; + /* Initialize TNL driver interface */ + tnl = TNL_CONTEXT(ctx); + tnl->Driver.RunPipeline = _tnl_run_pipeline; + /* Install setup for tnl */ + _swsetup_Wakeup(ctx); } -static int gl_ggiInitInfo(GGIMesaContext ctx, struct ggi_mesa_info *info) +static void get_mode_info(ggi_visual_t vis, int *r, int *g, int *b, + GLboolean *rgb, GLboolean *db, int *ci) { - ggi_mode mode; - - GGIMESADPRINT_CORE("gl_ggiInitInfo() called\n"); - - ggiGetMode(ctx->ggi_vis, &mode); + int i; - info->depth_bits = DEFAULT_SOFTWARE_DEPTH_BITS; - info->stencil_bits = STENCIL_BITS; - info->accum_bits = ACCUM_BITS; - - if (info->rgb_flag) - { - info->rgb_flag = GL_TRUE; - info->alpha_flag = GL_FALSE; - info->index_bits = 0; - - info->red_bits = 8; - info->green_bits = 8; - info->blue_bits = 8; - - info->alpha_bits = 0; + *r = 0; + *g = 0; + *b = 0; + + for(i = 0; i < sizeof(ggi_pixel)*8; ++i){ + int mask = 1 << i; + if(LIBGGI_PIXFMT(vis)->red_mask & mask) + ++(*r); + if(LIBGGI_PIXFMT(vis)->green_mask & mask) + ++(*g); + if(LIBGGI_PIXFMT(vis)->blue_mask & mask) + ++(*b); } - else - { - info->alpha_flag = GL_FALSE; - info->index_bits = GT_SIZE(mode.graphtype); - info->red_bits = info->green_bits = - info->blue_bits = info->alpha_bits = 0; - } - - return 0; -} + *rgb = GT_SCHEME(LIBGGI_MODE(vis)->graphtype) == GT_TRUECOLOR; + *db = LIBGGI_MODE(vis)->frames > 1; + *ci = GT_SIZE(LIBGGI_MODE(vis)->graphtype); + printf("rgb (%d, %d, %d) db %d, rgb %d ci %d\n",*r,*g,*b,*db,*rgb,*ci); +} + int ggiMesaInit() { int err; @@ -300,17 +343,19 @@ int ggiMesaInit() _ggimesaLibIsUp++; if (_ggimesaLibIsUp > 1) - return 0; /* Initialize only at first call */ + return 0; /* Initialize only at first call */ err = ggLoadConfig(ggimesaconffile, &_ggimesaConfigHandle); if (err != GGI_OK) { - GGIMESADPRINT_CORE("GGIMesa: Couldn't open %s\n", ggimesaconffile); + GGIMESADPRINT_CORE("GGIMesa: Couldn't open %s\n", + ggimesaconffile); _ggimesaLibIsUp--; return err; } - ggiMesaID = ggiExtensionRegister("GGIMesa", sizeof(struct mesa_ext), changed); + ggiMesaID = ggiExtensionRegister("GGIMesa", + sizeof(struct ggi_mesa_ext), changed); if (ggiMesaID < 0) { @@ -323,254 +368,224 @@ int ggiMesaInit() return 0; } - -GGIMesaContext GGIMesaCreateContext(void) +int ggiMesaExit(void) { - GGIMesaContext ctx; - char *str; - - GGIMESADPRINT_CORE("ggiMesaCreateContext() called\n"); + int rc; + + GGIMESADPRINT_CORE("ggiMesaExit() called\n"); - if (ggiMesaInit() < 0) /* register extensions*/ + if (!_ggimesaLibIsUp) + return -1; + + if (_ggimesaLibIsUp > 1) { - return NULL; + /* Exit only at last call */ + _ggimesaLibIsUp--; + return 0; } - - ctx = (GGIMesaContext)calloc(1, sizeof(struct ggi_mesa_context)); - if (!ctx) - return NULL; - - ctx->gl_vis = (GLvisual *)calloc(1, sizeof(GLvisual)); - if (!ctx->gl_vis) - return NULL; - - ctx->viewport_init = GL_FALSE; -// ctx->gl_vis->DBflag = GL_FALSE; - - ctx->gl_ctx = _mesa_create_context(ctx->gl_vis, NULL, (void *)ctx, GL_TRUE); - if (!ctx->gl_ctx) - return NULL; - _mesa_enable_sw_extensions(ctx->gl_ctx); + rc = ggiExtensionUnregister(ggiMesaID); + ggFreeConfig(_ggimesaConfigHandle); - _swrast_CreateContext(ctx->gl_ctx); - _swsetup_CreateContext(ctx->gl_ctx); - _tnl_CreateContext(ctx->gl_ctx); + _ggimesaLibIsUp = 0; - return ctx; + return rc; } -void GGIMesaDestroyContext(GGIMesaContext ctx) +int ggiMesaAttach(ggi_visual_t vis) { - GGIMESADPRINT_CORE("ggiMesaDestroyContext() called\n"); + int rc; + + GGIMESADPRINT_CORE("ggiMesaAttach() called\n"); - if (ctx) + rc = ggiExtensionAttach(vis, ggiMesaID); + if (rc == 0) { - _mesa_destroy_visual(ctx->gl_vis); - _mesa_destroy_context(ctx->gl_ctx); - _mesa_destroy_framebuffer(ctx->gl_buffer); - if (ctx == GGIMesa) - GGIMesa = NULL; - if (ctx->ggi_vis) - ggiExtensionDetach(ctx->ggi_vis, ggiMesaID); - ggiExtensionUnregister(ggiMesaID); - free(ctx); + int r, g, b, ci; + GLboolean rgb, db; + GLvisual *gl_visual; + GLframebuffer *gl_fb; + + /* We are creating the primary instance */ + memset(LIBGGI_MESAEXT(vis), 0, sizeof(struct ggi_mesa_ext)); + LIBGGI_MESAEXT(vis)->update_state = (void *)_ggi_error; + LIBGGI_MESAEXT(vis)->setup_driver = (void *)_ggi_error; + + /* Initialize default mesa visual */ + get_mode_info(vis, &r, &g, &b, &rgb, &db, &ci); + gl_visual = &(LIBGGI_MESAEXT(vis)->mesa_visual.gl_visual); + _mesa_initialize_visual(gl_visual, + rgb, db, 0 /* No stereo */, + r, g, b, 0 /* No alpha */, ci, + 0 /* No depth */, 0 /* No stencil */, + 0, 0, 0, 0 /* No accum */, 0); + + /* Now fake an "API change" so the right libs get loaded */ + changed(vis, GGI_CHG_APILIST); } + + return rc; } -int GGIMesaSetVisual(GGIMesaContext ctx, ggi_visual_t vis, - GLboolean rgb_flag, GLboolean db_flag) +int ggiMesaDetach(ggi_visual_t vis) +{ + GGIMESADPRINT_CORE("ggiMesaDetach() called\n"); + + return ggiExtensionDetach(vis, ggiMesaID); +} + +int ggiMesaExtendVisual(ggi_visual_t vis, GLboolean alpha_flag, + GLboolean stereo_flag, GLint depth_size, + GLint stencil_size, GLint accum_red_size, + GLint accum_green_size, GLint accum_blue_size, + GLint accum_alpha_size, GLint num_samples) { - struct ggi_mesa_info info; + GLvisual *gl_vis = &(LIBGGI_MESAEXT(vis)->mesa_visual.gl_visual); + int r, g, b, ci; + GLboolean db, rgb; + + get_mode_info(vis, &r, &g, &b, &rgb, &db, &ci); + + /* Initialize the visual with the provided information */ + _mesa_initialize_visual(&(LIBGGI_MESAEXT(vis)->mesa_visual.gl_visual), + rgb, db, stereo_flag, + r, g, b, 0 /* FIXME */, ci, + depth_size, stencil_size, + accum_red_size, accum_green_size, + accum_blue_size, accum_alpha_size, 0); + + /* Now fake an "API change" so the right libs get loaded. After all, + extending the visual by all these new buffers could be considered + a "mode change" which requires an "API change". + */ + changed(vis, GGI_CHG_APILIST); + + return 0; +} + + +ggi_mesa_context_t ggiMesaCreateContext(ggi_visual_t vis) +{ + ggi_mesa_context_t ctx; int err; - uint16 r,g,b; ggi_color pal[256]; int i; - void *func; - ggi_mode mode; - int num_buf; - GGIMESADPRINT_CORE("ggiMesaSetVisual() called\n"); + GGIMESADPRINT_CORE("ggiMesaCreateContext() called\n"); - if (!ctx) return -1; - if (!vis) return -1; + ctx = (ggi_mesa_context_t)malloc(sizeof(struct ggi_mesa_context)); + if (!ctx) + return NULL; - if (ctx->ggi_vis) - ggiExtensionDetach(ctx->ggi_vis, ggiMesaID); - - ctx->ggi_vis=vis; + ctx->ggi_visual = vis; + ctx->color = 0; - err = ggiExtensionAttach(vis, ggiMesaID); - if (err < 0) - return -1; - if (err == 0) - changed(vis, GGI_CHG_APILIST); + ctx->gl_ctx = + _mesa_create_context(&(LIBGGI_MESAEXT(vis)->mesa_visual.gl_visual), + NULL, (void *)ctx, GL_TRUE); + if (!ctx->gl_ctx) + goto free_context; + + _mesa_enable_sw_extensions(ctx->gl_ctx); + + _swrast_CreateContext(ctx->gl_ctx); + _ac_CreateContext(ctx->gl_ctx); + _tnl_CreateContext(ctx->gl_ctx); + _swsetup_CreateContext(ctx->gl_ctx); - if (ctx->gl_vis) - _mesa_destroy_visual(ctx->gl_vis); - - if (ctx->gl_buffer) - _mesa_destroy_framebuffer(ctx->gl_buffer); - - info.rgb_flag = rgb_flag; - info.db_flag = db_flag; - - err = gl_ggiInitInfo(ctx, &info); - if (err) - return -1; - gl_ggiSetupPointers(ctx->gl_ctx); - func = (void *)LIBGGI_MESAEXT(ctx->ggi_vis)->setup_driver; - - if (!func) - { + /* Make sure that an appropriate sublib has been loaded */ + if (!LIBGGI_MESAEXT(ctx->ggi_visual)->setup_driver){ GGIMESADPRINT_CORE("setup_driver==NULL!\n"); GGIMESADPRINT_CORE("Please check your config files!\n"); - return -1; + goto free_context; } - err = LIBGGI_MESAEXT(ctx->ggi_vis)->setup_driver(ctx, &info); - if (err) - return -1; - - ctx->gl_vis = _mesa_create_visual(info.rgb_flag, - info.db_flag, - GL_FALSE, /*stereo*/ - info.red_bits, info.green_bits, - info.blue_bits, info.alpha_bits, - info.index_bits, - info.depth_bits, - info.stencil_bits, - info.accum_bits, - info.accum_bits, - info.accum_bits, - info.accum_bits, - 1); - if (!ctx->gl_vis) - { - GGIMESADPRINT_CORE("Can't create gl_visual!\n"); - return -1; - } - - ctx->gl_buffer = _mesa_create_framebuffer(ctx->gl_vis, -// ctx->gl_vis->DepthBits > 0, -// ctx->gl_vis->StencilBits > 0, -// ctx->gl_vis->AccumRedBits > 0, -// ctx->gl_vis->AlphaBits > 0); - info.depth_bits > 0, - info.stencil_bits > 0, - info.accum_bits > 0, - info.alpha_bits > 0); - - - if (!ctx->gl_buffer) - { - GGIMESADPRINT_CORE("Can't create gl_buffer!\n"); - return -1; + /* Set up the sublib driver */ + err = LIBGGI_MESAEXT(ctx->ggi_visual)->setup_driver(ctx); + if (err){ + GGIMESADPRINT_CORE("setup_driver failed (err = %d)", err); + goto free_gl_context; } - - ggiGetMode(ctx->ggi_vis, &mode); - ctx->width = mode.visible.x; - ctx->height = mode.visible.y; - ctx->stride = mode.virt.x; - ctx->origin.x = 0; - ctx->origin.y = 0; - ctx->flip_y = ctx->origin.y + ctx->height - 1; - ctx->color = 0; - - ctx->lfb[0] = ctx->lfb[1] = NULL; - num_buf = ggiDBGetNumBuffers(ctx->ggi_vis); - - for (i = 0; i < num_buf; i++) - { - if (ggiDBGetBuffer(ctx->ggi_vis,i)->layout == blPixelLinearBuffer) - { - ctx->stride = ggiDBGetBuffer(ctx->ggi_vis, i)->buffer.plb.stride / - (ggiDBGetBuffer(ctx->ggi_vis, i)->buffer.plb.pixelformat->size / 8); - ctx->lfb[0] = ggiDBGetBuffer(ctx->ggi_vis, i)->write; - } - } - - if (ctx->lfb[0] == NULL) - { - GGIMESADPRINT_CORE("No linear frame buffer!\n"); - return -1; - } + _mesa_read_config_file(ctx->gl_ctx); + + return ctx; - /* FIXME: Use separate buffers */ - ctx->lfb[1] = malloc(ctx->stride * ctx->height); - ctx->bufsize = (ctx->stride * ctx->height); +free_gl_context: + _mesa_destroy_context(ctx->gl_ctx); +free_context: + free(ctx); - ctx->gl_ctx->Visual = *ctx->gl_vis; - ctx->gl_ctx->Pixel.ReadBuffer = - ctx->gl_ctx->Color.DrawBuffer = (db_flag) ? GL_BACK : GL_FRONT; - - if (GGIMesa == ctx) - _mesa_make_current(ctx->gl_ctx, ctx->gl_buffer); + return NULL; +} - if (rgb_flag && mode.graphtype==GT_8BIT) - { - for (i = r = 0; r < 8; r++) - for (g = 0; g < 8; g++) - for (b = 0; b < 4; b++, i++) - { - pal[i].r = r << (GGI_COLOR_PRECISION - 3); - pal[i].g = g << (GGI_COLOR_PRECISION - 3); - pal[i].b = b << (GGI_COLOR_PRECISION - 2); - } - ggiSetPalette(ctx->ggi_vis, 0, 256, pal); - } +void ggiMesaDestroyContext(ggi_mesa_context_t ctx) +{ + GGIMESADPRINT_CORE("ggiMesaDestroyContext() called\n"); + + if(!ctx) + return; - return 0; + _mesa_destroy_context(ctx->gl_ctx); + free(ctx); } -void GGIMesaMakeCurrent(GGIMesaContext ctx) +void ggiMesaMakeCurrent(ggi_mesa_context_t ctx, ggi_visual_t vis) { GGIMESADPRINT_CORE("ggiMesaMakeCurrent(ctx = %p) called\n", ctx); + + /* FIXME: clean up where are ggi_vis */ + if (ctx->ggi_visual != vis) { + GGIMESADPRINT_CORE("Cannot migrate GL contexts\n"); + return; + } - if (!ctx->ggi_vis) - return; - - GGIMesa = ctx; - _mesa_make_current(ctx->gl_ctx, ctx->gl_buffer); + _mesa_make_current(ctx->gl_ctx, &LIBGGI_MESAEXT(vis)->mesa_buffer); - if (!ctx->viewport_init) + if (ctx->gl_ctx->Viewport.Width == 0) { - _mesa_set_viewport(ctx->gl_ctx, 0, 0, ctx->width, ctx->height); - ctx->viewport_init = GL_TRUE; + _mesa_Viewport(0, 0, + LIBGGI_MODE(vis)->visible.x, + LIBGGI_MODE(vis)->visible.y); + ctx->gl_ctx->Scissor.Width = LIBGGI_MODE(vis)->visible.x; + ctx->gl_ctx->Scissor.Height = LIBGGI_MODE(vis)->visible.y; } } -GGIMesaContext GGIMesaGetCurrentContext(void) -{ - GGIMESADPRINT_CORE("ggiMesaGetCurrentContext() called\n"); - - return GGIMesa; -} - /* * Swap front/back buffers for current context if double buffered. */ -void GGIMesaSwapBuffers(void) +void ggiMesaSwapBuffers(void) { - GGIMESADPRINT_CORE("ggiMesaSwapBuffers() called\n"); + GLcontext *ctx; + ggi_mesa_context_t ggi_ctx; + ctx = _mesa_get_current_context(); + ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - _mesa_swapbuffers( GGIMesa->gl_ctx ); - gl_ggiFlush(GGIMesa->gl_ctx); + GGIMESADPRINT_CORE("ggiMesaSwapBuffers() called\n"); -// if (GGIMesa->gl_vis->DBflag) -// { - memcpy(GGIMesa->lfb[0], GGIMesa->lfb[1], GGIMesa->bufsize); -// } + _mesa_swapbuffers(ctx); + gl_ggiFlush(ctx); + + ggiSetDisplayFrame(ggi_ctx->ggi_visual, + !ggiGetDisplayFrame(ggi_ctx->ggi_visual)); + ggiSetWriteFrame(ggi_ctx->ggi_visual, + !ggiGetWriteFrame(ggi_ctx->ggi_visual)); + ggiSetReadFrame(ggi_ctx->ggi_visual, + !ggiGetReadFrame(ggi_ctx->ggi_visual)); + + GGIMESADPRINT_CORE("swap disp: %d, write %d\n", + ggiGetDisplayFrame(ggi_ctx->ggi_visual), + ggiGetWriteFrame(ggi_ctx->ggi_visual)); } static void gl_ggiUpdateState(GLcontext *ctx, GLuint new_state) { - void *func; - + ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; + GGIMESADPRINT_CORE("gl_ggiUpdateState() called\n"); /* Propogate statechange information to swrast and swrast_setup @@ -580,104 +595,68 @@ static void gl_ggiUpdateState(GLcontext *ctx, GLuint new_state) _swsetup_InvalidateState(ctx, new_state); _tnl_InvalidateState(ctx, new_state); - func = (void *)CTX_OPMESA(ctx)->update_state; - - if (!func) { + if (!LIBGGI_MESAEXT(ggi_ctx->ggi_visual)->update_state) { GGIMESADPRINT_CORE("update_state == NULL!\n"); GGIMESADPRINT_CORE("Please check your config files!\n"); ggiPanic(""); } - CTX_OPMESA(ctx)->update_state(ctx); + LIBGGI_MESAEXT(ggi_ctx->ggi_visual)->update_state(ggi_ctx); } static int changed(ggi_visual_t vis, int whatchanged) { + GLcontext *ctx; + ctx = _mesa_get_current_context(); + GGIMESADPRINT_CORE("changed() called\n"); switch (whatchanged) { - case GGI_CHG_APILIST: + case GGI_CHG_APILIST: + { + char api[256]; + char args[256]; + int i; + const char *fname; + ggi_dlhandle *lib; + GLvisual *gl_vis=&(LIBGGI_MESAEXT(vis)->mesa_visual.gl_visual); + GLframebuffer *gl_fb = &(LIBGGI_MESAEXT(vis)->mesa_buffer); + + /* Initialize the framebuffer to provide all necessary + buffers in software. The target libraries that are loaded + next are free to modify this according to their + capabilities. + */ + /* FIXME: if the target changes capabilities we'll leak + swrast's memory !!! Need to deallocate first */ + _mesa_initialize_framebuffer(gl_fb, gl_vis, + gl_vis->depthBits > 0, + gl_vis->stencilBits > 0, + gl_vis->accumRedBits > 0, + gl_vis->alphaBits > 0); + + for (i = 0; ggiGetAPI(vis, i, api, args) == 0; i++) { - char api[256]; - char args[256]; - int i; - const char *fname; - ggi_dlhandle *lib; - - for (i = 0; ggiGetAPI(vis, i, api, args) == 0; i++) + strcat(api, "-mesa"); + fname = ggMatchConfig(_ggimesaConfigHandle, api, NULL); + if (fname == NULL) { - strcat(api, "-mesa"); - fname = ggMatchConfig(_ggimesaConfigHandle, api, NULL); - if (fname == NULL) - { - /* No special implementation for this sublib */ - continue; - } - lib = ggiExtensionLoadDL(vis, fname, args, NULL, GGI_SYMNAME_PREFIX); + /* No special implementation for this sublib */ + continue; } - } - break; - } - return 0; -} - - -int ggiMesaExit(void) -{ - int rc; - - GGIMESADPRINT_CORE("ggiMesaExit() called\n"); - - if (!_ggimesaLibIsUp) - return -1; - - if (_ggimesaLibIsUp > 1) - { - /* Exit only at last call */ - _ggimesaLibIsUp--; - return 0; - } - - rc = ggiExtensionUnregister(ggiMesaID); - ggFreeConfig(_ggimesaConfigHandle); - - _ggimesaLibIsUp = 0; - - return rc; -} - -static int _ggi_error(void) -{ - GGIMESADPRINT_CORE("_ggi_error() called\n"); - - return -1; -} + lib = ggiExtensionLoadDL(vis, fname, args, NULL, + GGI_SYMNAME_PREFIX); + } -int ggiMesaAttach(ggi_visual_t vis) -{ - int rc; - - GGIMESADPRINT_CORE("ggiMesaAttach() called\n"); - - rc = ggiExtensionAttach(vis, ggiMesaID); - if (rc == 0) - { - /* We are creating the primary instance */ - memset(LIBGGI_MESAEXT(vis), 0, sizeof(mesaext)); - LIBGGI_MESAEXT(vis)->update_state = (void *)_ggi_error; - LIBGGI_MESAEXT(vis)->setup_driver = (void *)_ggi_error; + /* The targets have cleared everything they can do from + the framebuffer structure so we provide the rest in sw + */ + _swrast_alloc_buffers(gl_fb); - /* Now fake an "API change" so the right libs get loaded */ - changed(vis, GGI_CHG_APILIST); + break; + } } - - return rc; + return 0; } -int ggiMesaDetach(ggi_visual_t vis) -{ - GGIMESADPRINT_CORE("ggiMesaDetach() called\n"); - - return ggiExtensionDetach(vis, ggiMesaID); -} diff --git a/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa.h b/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa.h index a1e67fcbbff..5596e765d42 100644 --- a/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa.h +++ b/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa.h @@ -45,50 +45,40 @@ #include #include "GL/ggimesa.h" -struct ggi_mesa_info; +/* + * GGIMesa visual configuration. + * + * This structure "derives" from Mesa's GLvisual and extends it by + * GGI's visual. Combination of these two structures is enough to fully + * describe the mode the application is currently running in. GGI + * visual provides information about color configuration and buffering + * method, GLvisual fills the rest. + */ +struct ggi_mesa_visual { + GLvisual gl_visual; + ggi_visual_t ggi_visual; +}; +/* + * GGIMesa context. + * + * GGIMesa context expands the Mesa's context (it doesn't actualy derive + * from it, but this ability isn't needed, and it is best if GL context + * creation is left up to Mesa). It also contains a reference to the GGI + * visual it is attached to, which is very useful for all Mesa callbacks. + */ struct ggi_mesa_context { GLcontext *gl_ctx; - GLvisual *gl_vis; - GLframebuffer *gl_buffer; + ggi_visual_t ggi_visual; - ggi_visual_t ggi_vis; - ggi_coord origin; - int flip_y; - int width, height, stride; /* Stride is in pixels */ ggi_pixel color; /* Current color or index*/ ggi_pixel clearcolor; - void *lfb[2]; /* Linear frame buffers */ - int active_buffer; - int bufsize; - int viewport_init; -}; - -struct ggi_mesa_info -{ - GLboolean rgb_flag; - GLboolean db_flag; - GLboolean alpha_flag; - GLint index_bits; - GLint red_bits, green_bits, blue_bits, alpha_bits; - GLint depth_bits, stencil_bits, accum_bits; + + void *private; }; -extern GGIMesaContext GGIMesa; /* The current context */ - #define SHIFT (GGI_COLOR_PRECISION - 8) -#define GGICTX ((GGIMesaContext)ctx->DriverCtx) -#define VIS (GGICTX->ggi_vis) -#define FLIP(y) (GGICTX->flip_y-(y)) - -#define LFB(type,x,y) ((type *)GGICTX->lfb[0] + (x) + (y) * GGICTX->stride) - -#define CTX_OPMESA(ctx) \ -((struct mesa_ext *)LIBGGI_EXT(((GGIMesaContext)ctx->DriverCtx)->ggi_vis, \ - ggiMesaID)) - - #endif diff --git a/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa_int.h b/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa_int.h index ae4a3c5825a..da8b10f2ff9 100644 --- a/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa_int.h +++ b/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa_int.h @@ -11,14 +11,35 @@ extern ggi_extid ggiMesaID; ggifunc_setmode GGIMesa_setmode; ggifunc_getapi GGIMesa_getapi; -typedef struct mesa_ext +typedef struct ggi_mesa_ext { - void (*update_state)(GLcontext *ctx); - int (*setup_driver)(GGIMesaContext ctx, struct ggi_mesa_info *info); + /* + * How mesa extends this visual; i.e., size of the depth buffer etc. + * + * By default (upon attaching) this structure is initialized to what + * libggi is guaranteed to handle without any help: single buffered + * visual without any ancilary buffers. + */ + struct ggi_mesa_visual mesa_visual; + + /* + * Mesa framebuffer is a collection of all ancilary buffers required. + * + * This structure contains the ancilary buffers provided in in + * software. On each mode change it is loaded with the list of + * required buffers and the target is expected to clear the ones + * it can provide in hw. The remaining ones are then provided in sw. + * + */ + GLframebuffer mesa_buffer; + + void (*update_state)(ggi_mesa_context_t ctx); + int (*setup_driver)(ggi_mesa_context_t ctx); + void *private; -} mesaext; +} ggi_mesa_ext_t; -#define LIBGGI_MESAEXT(vis) ((mesaext *)LIBGGI_EXT(vis,ggiMesaID)) +#define LIBGGI_MESAEXT(vis) ((ggi_mesa_ext_t *)LIBGGI_EXT(vis,ggiMesaID)) #define GGIMESA_PRIVATE(vis) ((LIBGGI_MESAEXT(vis)->private)) #endif /* _GGI_MISC_INT_H */ -- cgit v1.2.3 From 7ae671446a64fde913474de4e3c6314b5ecd195f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 17 Aug 2002 00:12:48 +0000 Subject: added glutGetProcAddress() --- include/GL/glut.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glut.h b/include/GL/glut.h index 3b5cbb2f4cb..87fd6cee6c9 100644 --- a/include/GL/glut.h +++ b/include/GL/glut.h @@ -223,9 +223,11 @@ WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *); video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc, glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat, glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!). + + GLUT_API_VERSION=5 glutGetProcAddress (added by BrianP) **/ #ifndef GLUT_API_VERSION /* allow this to be overriden */ -#define GLUT_API_VERSION 3 +#define GLUT_API_VERSION 5 #endif /** @@ -661,6 +663,9 @@ GLUTAPI int GLUTAPIENTRY glutExtensionSupported(const char *name); GLUTAPI int GLUTAPIENTRY glutGetModifiers(void); GLUTAPI int GLUTAPIENTRY glutLayerGet(GLenum type); #endif +#if (GLUT_API_VERSION >= 5) +GLUTAPI void * GLUTAPIENTRY glutGetProcAddress(const char *procName); +#endif /* GLUT font sub-API */ GLUTAPI void GLUTAPIENTRY glutBitmapCharacter(void *font, int character); -- cgit v1.2.3 From fb657ef91da29120ff65580f0b27914752273025 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Aug 2002 21:10:37 +0000 Subject: added glXAllocate/FreeMemoryNV() --- include/GL/gl.h | 598 ++++++++++++++++++++++++----------------------------- include/GL/glext.h | 17 +- include/GL/glx.h | 11 +- 3 files changed, 293 insertions(+), 333 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index fcc5bdd3273..0701d593d6c 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.66 2002/05/27 17:05:19 brianp Exp $ */ +/* $Id: gl.h,v 1.67 2002/08/22 21:10:37 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -83,9 +83,6 @@ extern "C" { #define GL_VERSION_1_1 1 -#define GL_VERSION_1_2 1 -#define GL_VERSION_1_3 1 -#define GL_ARB_imaging 1 /* @@ -333,10 +330,6 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_DST_COLOR 0x0306 #define GL_ONE_MINUS_DST_COLOR 0x0307 #define GL_SRC_ALPHA_SATURATE 0x0308 -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 /* Render Mode */ #define GL_FEEDBACK 0x1C01 @@ -724,238 +717,6 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF -/* OpenGL 1.2 */ -#define GL_RESCALE_NORMAL 0x803A -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_TEXTURE_BINDING_3D 0x806A - - -/* - * OpenGL 1.2 imaging subset - */ -/* GL_EXT_color_table */ -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -/* GL_EXT_convolution and GL_HP_convolution_border_modes */ -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -/* GL_SGI_color_matrix */ -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -/* GL_EXT_histogram */ -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -/* GL_EXT_blend_color, GL_EXT_blend_minmax */ -#define GL_BLEND_EQUATION 0x8009 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_FUNC_ADD 0x8006 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_BLEND_COLOR 0x8005 - - -/* OpenGL 1.3 */ -/* multitexture */ -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -/* texture_cube_map */ -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -/* texture_compression */ -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -/* multisample */ -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_MULTISAMPLE_BIT 0x20000000 -/* transpose_matrix */ -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -/* texture_env_combine */ -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_SUBTRACT 0x84E7 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -/* texture_env_dot3 */ -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -/* texture_border_clamp */ -#define GL_CLAMP_TO_BORDER 0x812D - - #if defined(__BEOS__) || defined(__QUICKDRAW__) #pragma export on @@ -1058,7 +819,6 @@ GLAPI void GLAPIENTRY glFlush( void ); GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode ); - /* * Depth Buffer */ @@ -1081,7 +841,6 @@ GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GL GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value ); - /* * Transformation */ @@ -1123,7 +882,6 @@ GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z ); GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z ); - /* * Display Lists */ @@ -1146,7 +904,6 @@ GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type, GLAPI void GLAPIENTRY glListBase( GLuint base ); - /* * Drawing Functions */ @@ -1342,7 +1099,6 @@ GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 ); GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 ); - /* * Vertex Arrays (1.1) */ @@ -1376,7 +1132,6 @@ GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count, GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride, const GLvoid *pointer ); - /* * Lighting */ @@ -1411,8 +1166,6 @@ GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode ); - - /* * Raster functions */ @@ -1454,8 +1207,6 @@ GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum type ); - - /* * Stenciling */ @@ -1533,7 +1284,6 @@ GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level, GLvoid *pixels ); - /* 1.1 functions */ GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures ); @@ -1590,8 +1340,6 @@ GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level, GLsizei width, GLsizei height ); - - /* * Evaluators */ @@ -1645,7 +1393,6 @@ GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 ); GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); - /* * Fog */ @@ -1659,7 +1406,6 @@ GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params ); GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params ); - /* * Selection and Feedback */ @@ -1679,17 +1425,63 @@ GLAPI void GLAPIENTRY glPushName( GLuint name ); GLAPI void GLAPIENTRY glPopName( void ); +#if defined(GL_GLEXT_LEGACY) -/* 1.2 functions */ -GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start, - GLuint end, GLsizei count, GLenum type, const GLvoid *indices ); -GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level, - GLint internalFormat, - GLsizei width, GLsizei height, - GLsizei depth, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ); +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 + +#define GL_RESCALE_NORMAL 0x803A +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_TEXTURE_BINDING_3D 0x806A + +GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start, + GLuint end, GLsizei count, GLenum type, const GLvoid *indices ); + +GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLsizei height, + GLsizei depth, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ); GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, @@ -1815,9 +1607,199 @@ GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target, GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); +#endif /* GL_VERSION_1_2 */ + + +#ifndef GL_ARB_imaging +#define GL_ARB_imaging 1 + +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_BLEND_EQUATION 0x8009 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_FUNC_ADD 0x8006 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_BLEND_COLOR 0x8005 + +#endif /* GL_ARB_imaging */ -/* 1.3 functions */ +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 + +/* OpenGL 1.3 */ +/* multitexture */ +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +/* texture_cube_map */ +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +/* texture_compression */ +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +/* multisample */ +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_MULTISAMPLE_BIT 0x20000000 +/* transpose_matrix */ +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +/* texture_env_combine */ +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +/* texture_env_dot3 */ +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +/* texture_border_clamp */ +#define GL_CLAMP_TO_BORDER 0x812D GLAPI void GLAPIENTRY glActiveTexture( GLenum texture ); @@ -1912,6 +1894,9 @@ GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] ); GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert ); +#endif /* GL_VERSION_1_3 */ + + /* * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1) @@ -1994,10 +1979,6 @@ GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); - -#if defined(GL_GLEXT_LEGACY) - - /* * 1. GL_EXT_abgr */ @@ -2370,8 +2351,6 @@ GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); - - /* * 197. GL_MESA_window_pos */ @@ -2433,15 +2412,31 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); #else /* GL_GLEXT_LEGACY */ + #include +/* fix-up known errors in glext.h */ +#ifndef GL_TEXTURE_BINDING_3D +#define GL_TEXTURE_BINDING_3D 0x806A +#endif +#ifdef GL_IGNORE_BORDER +#undef GL_IGNORE_BORDER /* invalid! */ +#endif +#ifdef GL_WRAP_BORDER +#undef GL_WRAP_BORDER /* invalid! */ +#endif +#ifndef GL_POST_COLOR_MATRIX_ALPHA_BIAS +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#endif + + #endif /* GL_GLEXT_LEGACY */ /* * ???. GL_MESA_trace - * XXX this should go into glext.h at some point + * XXX obsolete */ #ifndef GL_MESA_trace #define GL_MESA_trace 1 @@ -2472,7 +2467,7 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid /* * ???. GL_MESA_packed_depth_stencil - * XXX this will be in glext.h someday + * XXX obsolete */ #ifndef GL_MESA_packed_depth_stencil #define GL_MESA_packed_depth_stencil 1 @@ -2486,63 +2481,6 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid #endif /* GL_MESA_packed_depth_stencil */ -#ifndef GL_ARB_window_pos -#define GL_ARB_window_pos 1 - -/* XXX not finalized yet - just testing */ -GLAPI void GLAPIENTRY glWindowPos2dARB(GLdouble x, GLdouble y); -GLAPI void GLAPIENTRY glWindowPos2fARB(GLfloat x, GLfloat y); -GLAPI void GLAPIENTRY glWindowPos2iARB(GLint x, GLint y); -GLAPI void GLAPIENTRY glWindowPos2sARB(GLshort x, GLshort y); -GLAPI void GLAPIENTRY glWindowPos2dvARB(const GLdouble *p); -GLAPI void GLAPIENTRY glWindowPos2fvARB(const GLfloat *p); -GLAPI void GLAPIENTRY glWindowPos2ivARB(const GLint *p); -GLAPI void GLAPIENTRY glWindowPos2svARB(const GLshort *p); -GLAPI void GLAPIENTRY glWindowPos3dARB(GLdouble x, GLdouble y, GLdouble z); -GLAPI void GLAPIENTRY glWindowPos3fARB(GLfloat x, GLfloat y, GLfloat z); -GLAPI void GLAPIENTRY glWindowPos3iARB(GLint x, GLint y, GLint z); -GLAPI void GLAPIENTRY glWindowPos3sARB(GLshort x, GLshort y, GLshort z); -GLAPI void GLAPIENTRY glWindowPos3dvARB(const GLdouble *p); -GLAPI void GLAPIENTRY glWindowPos3fvARB(const GLfloat *p); -GLAPI void GLAPIENTRY glWindowPos3ivARB(const GLint *p); -GLAPI void GLAPIENTRY glWindowPos3svARB(const GLshort *p); - -#endif /* GL_ARB_window_pos */ - - -#ifndef GL_ARB_shadow -#define GL_ARB_shadow 1 - -/* XXX move to glext.h */ -#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C -#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D -#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E - -#endif - - -#ifndef GL_ARB_shadow_ambient -#define GL_ARB_shadow_ambient 1 - -/* XXX move to glext.h */ -#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF - -#endif - - -#ifndef GL_ARB_depth_texture -#define GL_ARB_depth_texture 1 - -/* XXX move to glext.h */ -#define GL_DEPTH_COMPONENT16_ARB 0x81A5 -#define GL_DEPTH_COMPONENT24_ARB 0x81A6 -#define GL_DEPTH_COMPONENT32_ARB 0x81A7 -#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A -#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B - -#endif - - /********************************************************************** * Begin system-specific stuff diff --git a/include/GL/glext.h b/include/GL/glext.h index fc9cb3c176d..f842f69de3b 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -49,9 +49,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2002/05/30 */ +/* glext.h last updated 2002/07/18 */ /* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 15 +#define GL_GLEXT_VERSION 16 #ifndef GL_VERSION_1_2 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 @@ -2289,6 +2289,11 @@ extern "C" { #ifndef GL_EXT_shadow_funcs #endif +#ifndef GL_EXT_stencil_two_side +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 +#endif + /*************************************************************/ @@ -4642,6 +4647,14 @@ typedef void (APIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint #define GL_EXT_shadow_funcs 1 #endif +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); +#endif + #ifdef __cplusplus } diff --git a/include/GL/glx.h b/include/GL/glx.h index e19937f8bb3..1f6f0c9cc08 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.35 2001/12/14 03:19:06 brianp Exp $ */ +/* $Id: glx.h,v 1.36 2002/08/22 21:10:38 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -297,6 +297,15 @@ extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable, extern void (*glXGetProcAddress(const GLubyte *procname))(); +/* + * AGP memory allocator. + */ +extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +extern void glXFreeMemoryNV(GLvoid *pointer); +typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer); + + #ifndef GLX_GLXEXT_LEGACY -- cgit v1.2.3 From 41771982c4e85e5a37d8ddac6b83de46391af478 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Aug 2002 21:47:31 +0000 Subject: define GLAPIENTRY and GLAPI if not defined in gl.h --- include/GL/glu.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index 36bd7c1398f..5eaa5547482 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -36,6 +36,14 @@ #include +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef GLAPI +#define GLAPI +#endif + #ifdef __cplusplus extern "C" { #endif -- cgit v1.2.3 From 391876e5e6a710ba99b0752bbcc1b3b8af0469b6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Aug 2002 14:02:27 +0000 Subject: fix up stuff accidentaly checked in a few days ago --- include/GL/gl.h | 338 ++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 231 insertions(+), 107 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 0701d593d6c..8b3adfd40a6 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.67 2002/08/22 21:10:37 brianp Exp $ */ +/* $Id: gl.h,v 1.68 2002/08/29 14:02:27 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -70,6 +70,19 @@ #if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED #pragma import on #endif + +#ifndef APIENTRY +#define APIENTRY GLAPIENTRY +#endif + +#ifdef CENTERLINE_CLPP +#define signed +#endif + + +#if defined(__BEOS__) || defined(__QUICKDRAW__) +#pragma export on +#endif /* * End system-specific stuff. **********************************************************************/ @@ -83,16 +96,14 @@ extern "C" { #define GL_VERSION_1_1 1 +#define GL_VERSION_1_2 1 +#define GL_VERSION_1_3 1 +#define GL_ARB_imaging 1 /* - * * Datatypes - * */ -#ifdef CENTERLINE_CLPP -#define signed -#endif typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef unsigned int GLbitfield; @@ -112,9 +123,7 @@ typedef double GLclampd; /* double precision float in [0,1] */ /* - * * Constants - * */ /* Boolean values */ @@ -717,12 +726,6 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF - -#if defined(__BEOS__) || defined(__QUICKDRAW__) -#pragma export on -#endif - - /* * Miscellaneous */ @@ -1425,11 +1428,10 @@ GLAPI void GLAPIENTRY glPushName( GLuint name ); GLAPI void GLAPIENTRY glPopName( void ); -#if defined(GL_GLEXT_LEGACY) - -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 +/* + * OpenGL 1.2 + */ #define GL_RESCALE_NORMAL 0x803A #define GL_CLAMP_TO_EDGE 0x812F @@ -1496,8 +1498,92 @@ GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level, GLint y, GLsizei width, GLsizei height ); +typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + + +/* + * GL_ARB_imaging + */ + +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_BLEND_EQUATION 0x8009 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_FUNC_ADD 0x8006 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_BLEND_COLOR 0x8005 -/* 1.2 imaging extension functions */ GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat, GLsizei width, GLenum format, @@ -1607,95 +1693,47 @@ GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target, GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); -#endif /* GL_VERSION_1_2 */ +typedef void (APIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); -#ifndef GL_ARB_imaging -#define GL_ARB_imaging 1 -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_BLEND_EQUATION 0x8009 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_FUNC_ADD 0x8006 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_BLEND_COLOR 0x8005 - -#endif /* GL_ARB_imaging */ - - -#ifndef GL_VERSION_1_3 -#define GL_VERSION_1_3 1 +/* + * OpenGL 1.3 + */ -/* OpenGL 1.3 */ /* multitexture */ #define GL_TEXTURE0 0x84C0 #define GL_TEXTURE1 0x84C1 @@ -1894,8 +1932,52 @@ GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] ); GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert ); -#endif /* GL_VERSION_1_3 */ - +typedef void (APIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img); /* @@ -1975,10 +2057,52 @@ GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); + #endif /* GL_ARB_multitexture */ +/* + * Define this token if you want "old-style" header file behaviour (extensions + * defined in gl.h). Otherwise, extensions will be included from glext.h. + */ +#if defined(GL_GLEXT_LEGACY) + + /* * 1. GL_EXT_abgr */ @@ -2417,7 +2541,7 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); /* fix-up known errors in glext.h */ #ifndef GL_TEXTURE_BINDING_3D -#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_TEXTURE_BINDING_3D 0x806A #endif #ifdef GL_IGNORE_BORDER #undef GL_IGNORE_BORDER /* invalid! */ -- cgit v1.2.3 From e14c151f0ac26ff662c3933f7fe3b7e90c7d3768 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 6 Sep 2002 02:48:09 +0000 Subject: version 17 --- include/GL/glext.h | 409 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 385 insertions(+), 24 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index f842f69de3b..245f100c706 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -24,7 +24,7 @@ extern "C" { ** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Inc. The Original Code is Copyright (c) 1991-2002 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. ** @@ -49,9 +49,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2002/07/18 */ +/* glext.h last updated 2002/08/21 */ /* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 16 +#define GL_GLEXT_VERSION 17 #ifndef GL_VERSION_1_2 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 @@ -60,6 +60,16 @@ extern "C" { #define GL_UNSIGNED_INT_8_8_8_8 0x8035 #define GL_UNSIGNED_INT_10_10_10_2 0x8036 #define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 #define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 #define GL_UNSIGNED_SHORT_5_6_5 0x8363 #define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 @@ -143,7 +153,7 @@ extern "C" { #define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 #define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 #define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATIX_ALPHA_BIAS 0x80BB +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB #define GL_COLOR_TABLE 0x80D0 #define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 #define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 @@ -160,9 +170,7 @@ extern "C" { #define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD #define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE #define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_IGNORE_BORDER 0x8150 #define GL_CONSTANT_BORDER 0x8151 -#define GL_WRAP_BORDER 0x8152 #define GL_REPLICATE_BORDER 0x8153 #define GL_CONVOLUTION_BORDER_COLOR 0x8154 #endif @@ -267,6 +275,48 @@ extern "C" { #define GL_DOT3_RGBA 0x86AF #endif +#ifndef GL_VERSION_1_4 +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_COMPARE_R_TO_TEXTURE 0x884E +#endif + #ifndef GL_ARB_multitexture #define GL_TEXTURE0_ARB 0x84C0 #define GL_TEXTURE1_ARB 0x84C1 @@ -362,17 +412,9 @@ extern "C" { #ifndef GL_ARB_point_parameters #define GL_POINT_SIZE_MIN_ARB 0x8126 -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MIN_SGIS 0x8126 #define GL_POINT_SIZE_MAX_ARB 0x8127 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_SIZE_MAX_SGIS 0x8127 #define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 #define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 -#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 #endif #ifndef GL_ARB_vertex_blend @@ -491,6 +533,88 @@ extern "C" { #ifndef GL_ARB_window_pos #endif +#ifndef GL_ARB_vertex_program +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF +#endif + #ifndef GL_EXT_abgr #define GL_ABGR_EXT 0x8000 #endif @@ -556,23 +680,14 @@ extern "C" { #endif #ifndef GL_EXT_texture3D -#define GL_PACK_SKIP_IMAGES 0x806B #define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C #define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D #define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E #define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D 0x806F #define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 #define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 #define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 #define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 #define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 #endif @@ -899,6 +1014,20 @@ extern "C" { #define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E #endif +#ifndef GL_EXT_point_parameters +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +#endif + #ifndef GL_SGIX_instruments #define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 #define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 @@ -2477,6 +2606,102 @@ typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img); #endif +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glFogCoordf (GLfloat); +GLAPI void APIENTRY glFogCoordfv (const GLfloat *); +GLAPI void APIENTRY glFogCoordd (GLdouble); +GLAPI void APIENTRY glFogCoorddv (const GLdouble *); +GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *); +GLAPI void APIENTRY glPointParameteri (GLenum, GLint); +GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *); +GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *); +GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *); +GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *); +GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint); +GLAPI void APIENTRY glSecondaryColor3iv (const GLint *); +GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *); +GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *); +GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *); +GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort); +GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *); +GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dv (const GLdouble *); +GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fv (const GLfloat *); +GLAPI void APIENTRY glWindowPos2i (GLint, GLint); +GLAPI void APIENTRY glWindowPos2iv (const GLint *); +GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2sv (const GLshort *); +GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dv (const GLdouble *); +GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fv (const GLfloat *); +GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3iv (const GLint *); +GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3sv (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (APIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (APIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (APIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (APIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +typedef void (APIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (APIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (APIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (APIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *v); +typedef void (APIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *v); +#endif + #ifndef GL_ARB_multitexture #define GL_ARB_multitexture 1 #ifdef GL_GLEXT_PROTOTYPES @@ -2723,6 +2948,136 @@ typedef void (APIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort typedef void (APIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); #endif +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); +GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint); +GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint); +GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint); +GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *); +GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgramARB (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (APIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (APIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); +typedef void (APIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program); +#endif + #ifndef GL_EXT_abgr #define GL_EXT_abgr 1 #endif @@ -3767,9 +4122,15 @@ typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3F #define GL_EXT_blend_func_separate 1 #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_blend_func_separate +#define GL_INGR_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); #endif -- cgit v1.2.3 From a2ae6faf1a853655ac6c58b80a7dc3b1811a8740 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 6 Sep 2002 02:52:23 +0000 Subject: removed glext.h fix-ups corrected in glext.h version 17 --- include/GL/gl.h | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 8b3adfd40a6..5808d5088fd 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.68 2002/08/29 14:02:27 brianp Exp $ */ +/* $Id: gl.h,v 1.69 2002/09/06 02:52:23 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2536,24 +2536,8 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); #else /* GL_GLEXT_LEGACY */ - #include -/* fix-up known errors in glext.h */ -#ifndef GL_TEXTURE_BINDING_3D -#define GL_TEXTURE_BINDING_3D 0x806A -#endif -#ifdef GL_IGNORE_BORDER -#undef GL_IGNORE_BORDER /* invalid! */ -#endif -#ifdef GL_WRAP_BORDER -#undef GL_WRAP_BORDER /* invalid! */ -#endif -#ifndef GL_POST_COLOR_MATRIX_ALPHA_BIAS -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#endif - - #endif /* GL_GLEXT_LEGACY */ -- cgit v1.2.3 From 473e51f2fbfb003717bb88616ea585fc8d76f75e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Sep 2002 16:19:43 +0000 Subject: Updated BeOS support (Philippe Houdoin) --- docs/README.BEOS | 60 +- include/GL/gl.h | 13 +- progs/beos/sample.cpp | 45 +- src/mesa/drivers/beos/GLView.cpp | 1725 +++++++++++++++++++++----------------- src/mesa/main/Makefile.BeOS-R5 | 452 ++++++++++ src/mesa/x86/gen_matypes.c | 12 +- 6 files changed, 1494 insertions(+), 813 deletions(-) create mode 100644 src/mesa/main/Makefile.BeOS-R5 (limited to 'include') diff --git a/docs/README.BEOS b/docs/README.BEOS index 92849ef7aa4..6d1e1f0e41b 100644 --- a/docs/README.BEOS +++ b/docs/README.BEOS @@ -3,61 +3,71 @@ -Introduction +* Introduction -Mesa 3.1 features a new driver for the BeOS. The new driver implements +Mesa 4.1 features a driver for the BeOS. The driver implements a clone of the BGLView class. This class, derived from BView, allows OpenGL rendering into a BeOS window. +The 4.1 BeOS driver is an update of Brian Paul's BeOS driver released in Mesa 3.1. 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 +Since Be's OpenGL implementation (as of R5) is basically just the SGI sample implementation, it's pretty slow. You'll see that Mesa is considerably faster. -Source Code +* Source Code -The source code for the driver is in Mesa-3.1/src/BeOS/GLView.cpp +The source code for the driver is in Mesa-4.1/src/BeOS/ directory. It's not 100% finished at this time but many GLUT-based demos are working. No optimizations have been made at this time. -Compiling +* 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. +Requirements: + - gcc version 2.95.3 for BeOS + You can find it here: http://www.bebits.com/app/2157 +Move to the Mesa-4.x src sub-directory and then type "make -f Makefile.BeOS-R5". +When it finishes the Mesa based libGL.so library for +BeOS will be in the Mesa-4.x/src/obj.{x86|ppc}/ directory. +To install it as Be's default libGL.so replacement, put it in your +/boot/home/config/lib/ directory. All your GL/GLUTapps will use +the Mesa based then. -Example Programs +By default, it build a non-debug version library. +The x86 (MMX, SSE and 3DNOW) optimizations are also supported for x86 target. +Sorry, Mesa don't have ppc (Altivec) optimizations yet. -Look in the Mesa-3.x/BeOS/ directory for one or two BGLView demo + +* Example Programs + +Look in the Mesa-4.x/BeOS/ directory for one or two BGLView demo programs. They should have been compiled along with the Mesa library. +* GLUT -GLUT - -A version of GLUT 2.5 for BeOS can be found in src-glut.beos/. +A beta version of GLUT 3.7 port for BeOS can be found at +http://anobject.com/jehamby/Code/Glut-3.7-x86.zip. + +There's is a 2.5 version in src-glut.beos/, too. 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 +They are 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 +* Special Features Mesa's implementation of the BGLView class has an extra member function: CopySubBufferMESA(). It basically works like SwapBuffers() @@ -69,7 +79,9 @@ cause a fatal error when running with Be's OpenGL. -Work Left To Do +* Work Left To Do + +BDirectWindow single buffering support is not implemented yet. Color index mode is not implemented yet. @@ -80,7 +92,7 @@ rendering. This should also be implemented for Mesa. -Old BeOS Driver +* 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 @@ -88,7 +100,7 @@ driver you should get Mesa 2.6. -BeOS and Glide +* 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 @@ -99,4 +111,4 @@ of February, 1999. ---------------------------------------------------------------------- -$Id: README.BEOS,v 1.6 1999/11/27 01:40:40 brianp Exp $ +$Id: README.BEOS,v 1.7 2002/09/19 16:19:44 brianp Exp $ diff --git a/include/GL/gl.h b/include/GL/gl.h index 5808d5088fd..4b3a411909e 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.69 2002/09/06 02:52:23 brianp Exp $ */ +/* $Id: gl.h,v 1.70 2002/09/19 16:19:45 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -63,6 +63,10 @@ # define GLAPIENTRY #endif /* WIN32 / CYGWIN bracket */ +#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__) +# define PRAGMA_EXPORT_SUPPORTED 1 +#endif + #if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__) #include #endif @@ -79,10 +83,10 @@ #define signed #endif - -#if defined(__BEOS__) || defined(__QUICKDRAW__) +#if defined(PRAGMA_EXPORT_SUPPORTED) #pragma export on #endif + /* * End system-specific stuff. **********************************************************************/ @@ -726,6 +730,7 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF + /* * Miscellaneous */ @@ -2593,7 +2598,7 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid /********************************************************************** * Begin system-specific stuff */ -#if defined(__BEOS__) || defined(__QUICKDRAW__) +#if defined(PRAGMA_EXPORT_SUPPORTED) #pragma export off #endif diff --git a/progs/beos/sample.cpp b/progs/beos/sample.cpp index 2310b33882d..7b8515b275c 100644 --- a/progs/beos/sample.cpp +++ b/progs/beos/sample.cpp @@ -32,7 +32,7 @@ class SampleGLWindow : public BWindow { public: SampleGLWindow(BRect frame, uint32 type); - virtual bool QuitRequested() { return true; } + virtual bool QuitRequested() { be_app->PostMessage(B_QUIT_REQUESTED); return true; } private: SampleGLView *theView; @@ -135,7 +135,7 @@ void SampleGLView::gInit(void) use_stipple_mode = GL_FALSE; use_smooth_mode = GL_TRUE; linesize = 2; - pointsize = 4; + pointsize = 6; } @@ -147,35 +147,46 @@ void SampleGLView::gDraw(void) 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); - } - +*/ + + glDisable(GL_POINT_SMOOTH); + + glPushMatrix(); + glPointSize(pointsize); // Set size for point + for (i = 0; i < 360; i += 5) { glRotatef(5.0, 0,0,1); // Rotate right 5 degrees + + if (use_smooth_mode) { + glEnable(GL_LINE_SMOOTH); + glEnable(GL_BLEND); + } else { + glDisable(GL_LINE_SMOOTH); + glDisable(GL_BLEND); + } + glColor3f(1.0, 1.0, 0.0); // Set color for line glBegin(GL_LINE_STRIP); // And create the line - glVertex3fv(pntA); - glVertex3fv(pntB); + glVertex3fv(pntA); + glVertex3fv(pntB); glEnd(); - - glPointSize(pointsize); // Set size for point + + glDisable(GL_POINT_SMOOTH); + glDisable(GL_BLEND); + 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 + glVertex3fv(pntA); // Draw point at one end + glVertex3fv(pntB); // Draw point at other end glEnd(); } diff --git a/src/mesa/drivers/beos/GLView.cpp b/src/mesa/drivers/beos/GLView.cpp index 56c1b7773b9..b96b4e82893 100644 --- a/src/mesa/drivers/beos/GLView.cpp +++ b/src/mesa/drivers/beos/GLView.cpp @@ -1,4 +1,4 @@ -/* $Id: GLView.cpp,v 1.5 2000/11/17 21:01:26 brianp Exp $ */ +/* $Id: GLView.cpp,v 1.6 2002/09/19 16:19:45 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -27,6 +27,9 @@ /* * $Log: GLView.cpp,v $ + * Revision 1.6 2002/09/19 16:19:45 brianp + * Updated BeOS support (Philippe Houdoin) + * * Revision 1.5 2000/11/17 21:01:26 brianp * Minor header file changes to silence warnings. * Added _mesa_enable_sw_extensions(), called by software-only drivers @@ -70,14 +73,39 @@ * Initial revision */ - +#include "glheader.h" #include #include -#include -#include "../src/context.h" + +extern "C" { + +#include "context.h" +#include "colormac.h" +#include "depth.h" #include "extensions.h" +#include "macros.h" +#include "matrix.h" +#include "mem.h" +#include "mmath.h" +#include "mtypes.h" +#include "texformat.h" +#include "texstore.h" +#include "array_cache/acache.h" +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" +#include "swrast/s_context.h" +#include "swrast/s_depth.h" +#include "swrast/s_lines.h" +#include "swrast/s_triangle.h" +#include "swrast/s_trispan.h" +#include "tnl/tnl.h" +#include "tnl/t_context.h" +#include "tnl/t_pipeline.h" + +} // extern "C" +#include // BeOS component ordering for B_RGBA32 bitmap format #define BE_RCOMP 2 @@ -85,6 +113,13 @@ #define BE_BCOMP 0 #define BE_ACOMP 3 +#define PACK_B_RGBA32(color) (color[BCOMP] | (color[GCOMP] << 8) | \ + (color[RCOMP] << 16) | (color[ACOMP] << 24)) + +#define PACK_B_RGB32(color) (color[BCOMP] | (color[GCOMP] << 8) | \ + (color[RCOMP] << 16) | 0xFF000000) + +#define FLIP(coord) (LIBGGI_MODE(ggi_ctx->ggi_visual)->visible.y-(coord) - 1) // // This object hangs off of the BGLView object. We have to use @@ -92,460 +127,846 @@ // 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 +class MesaDriver { public: - AuxInfo(); - ~AuxInfo(); - void Init(BGLView *bglView, GLcontext *c, GLvisual *v, GLframebuffer *b); + MesaDriver(); + ~MesaDriver(); + 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; + void LockGL(); + void UnlockGL(); + void SwapBuffers() const; + void CopySubBuffer(GLint x, GLint y, GLuint width, GLuint height) const; + void Draw(BRect updateRect) 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 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, + MesaDriver(const MesaDriver &rhs); // copy constructor illegal + MesaDriver &operator=(const MesaDriver &rhs); // assignment oper. illegal + + GLcontext * m_glcontext; + GLvisual * m_glvisual; + GLframebuffer * m_glframebuffer; + + BGLView * m_bglview; + BBitmap * m_bitmap; + + GLubyte m_clear_color[4]; // buffer clear color + GLuint m_clear_index; // buffer clear color index + GLint m_bottom; // used for flipping Y coords + GLuint m_width; + GLuint m_height; + + // Mesa Device Driver functions + static void UpdateState(GLcontext *ctx, GLuint new_state); + static void ClearIndex(GLcontext *ctx, GLuint index); + static void ClearColor(GLcontext *ctx, const GLchan color[4]); + static void 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, + 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, + 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, + 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, + static void SetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, GLenum mode); - static void GetBufferSize(GLcontext *ctgx, GLuint *width, + static void GetBufferSize(GLframebuffer * framebuffer, GLuint *width, GLuint *height); - static const GLubyte *GetString(GLcontext *ctx, GLenum name); + static const GLubyte * GetString(GLcontext *ctx, GLenum name); // Front-buffer functions - static void WriteRGBASpanFront(const GLcontext *ctx, GLuint n, + 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, + 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, + static void WriteMonoRGBASpanFront(const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLchan color[4], const GLubyte mask[]); - static void WriteRGBAPixelsFront(const GLcontext *ctx, GLuint n, + 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, + static void WriteMonoRGBAPixelsFront(const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLchan color[4], const GLubyte mask[]); - static void WriteCI32SpanFront(const GLcontext *ctx, GLuint n, + 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, + 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, + static void WriteMonoCISpanFront(const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint colorIndex, const GLubyte mask[]); - static void WriteCI32PixelsFront(const GLcontext *ctx, + 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, + static void WriteMonoCIPixelsFront(const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLuint colorIndex, const GLubyte mask[]); - static void ReadCI32SpanFront(const GLcontext *ctx, + static void ReadCI32SpanFront(const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint index[]); - static void ReadRGBASpanFront(const GLcontext *ctx, GLuint n, + static void ReadRGBASpanFront(const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4]); - static void ReadCI32PixelsFront(const GLcontext *ctx, + 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, + 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, + 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, + 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, + static void WriteMonoRGBASpanBack(const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLchan color[4], const GLubyte mask[]); - static void WriteRGBAPixelsBack(const GLcontext *ctx, GLuint n, + 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, + static void WriteMonoRGBAPixelsBack(const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLchan color[4], const GLubyte mask[]); - static void WriteCI32SpanBack(const GLcontext *ctx, GLuint n, + 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, + 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, + static void WriteMonoCISpanBack(const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint colorIndex, const GLubyte mask[]); - static void WriteCI32PixelsBack(const GLcontext *ctx, + 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, + static void WriteMonoCIPixelsBack(const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLuint colorIndex, const GLubyte mask[]); - static void ReadCI32SpanBack(const GLcontext *ctx, + static void ReadCI32SpanBack(const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint index[]); - static void ReadRGBASpanBack(const GLcontext *ctx, GLuint n, + static void ReadRGBASpanBack(const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4]); - static void ReadCI32PixelsBack(const GLcontext *ctx, + 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, + static void ReadRGBAPixelsBack(const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[]); }; +//------------------------------------------------------------------ +// Public interface methods +//------------------------------------------------------------------ -AuxInfo::AuxInfo() +// +// 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 | B_WILL_DRAW | B_FRAME_EVENTS) // | B_FULL_UPDATE_ON_RESIZE) { - 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; -} + 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 + MesaDriver * md = new MesaDriver; -AuxInfo::~AuxInfo() -{ + // examine option flags and create gl_context struct + GLvisual * visual = _mesa_create_visual( rgbFlag, + dblFlag, + stereoFlag, + red, green, blue, alpha, + index, + depth, + stencil, + accum, accum, accum, accum, + 1 + ); + + // create core context + __GLimports imports; + _mesa_init_default_imports(&imports, md); + GLcontext * ctx = _mesa_create_context( visual, NULL, &imports); + + + // create core framebuffer + GLframebuffer * buffer = _mesa_create_framebuffer(visual, + depth > 0 ? GL_TRUE : GL_FALSE, + stencil > 0 ? GL_TRUE: GL_FALSE, + accum > 0 ? GL_TRUE : GL_FALSE, + alphaFlag + ); + + _mesa_enable_sw_extensions(ctx); + _mesa_enable_1_3_extensions(ctx); + + /* Initialize the software rasterizer and helper modules. + */ + + _swrast_CreateContext(ctx); + _ac_CreateContext(ctx); + _tnl_CreateContext(ctx); + _swsetup_CreateContext(ctx); + + _swsetup_Wakeup(ctx); + + md->Init(this, ctx, visual, buffer ); - _mesa_destroy_visual(mVisual); - _mesa_destroy_framebuffer(mBuffer); - _mesa_destroy_context(mContext); + // Hook aux data into BGLView object + m_gc = md; } -void AuxInfo::Init(BGLView *bglView, GLcontext *c, GLvisual *v, GLframebuffer *b) +BGLView::~BGLView() { - mBGLView = bglView; - mContext = c; - mVisual = v; - mBuffer = b; + printf("BGLView destructor\n"); + MesaDriver * md = (MesaDriver *) m_gc; + assert(md); + delete md; } - -void AuxInfo::MakeCurrent() +void BGLView::LockGL() { - UpdateState(mContext); - _mesa_make_current(mContext, mBuffer); + MesaDriver * md = (MesaDriver *) m_gc; + assert(md); + md->LockGL(); } +void BGLView::UnlockGL() +{ + MesaDriver * md = (MesaDriver *) m_gc; + assert(md); + md->UnlockGL(); +} -void AuxInfo::SwapBuffers() const +void BGLView::SwapBuffers() { - if (mBitmap) { - mBGLView->DrawBitmap(mBitmap, BPoint(0, 0)); - } + MesaDriver * md = (MesaDriver *) m_gc; + assert(md); + md->SwapBuffers(); } -void AuxInfo::CopySubBuffer(GLint x, GLint y, GLuint width, GLuint height) const +void BGLView::CopySubBufferMESA(GLint x, GLint y, GLuint width, GLuint height) { - 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); - } + MesaDriver * md = (MesaDriver *) m_gc; + assert(md); + md->CopySubBuffer(x, y, width, height); } -void AuxInfo::UpdateState( GLcontext *ctx ) +BView * BGLView::EmbeddedView() { - AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + // XXX to do + return NULL; +} - assert(aux->mContext == ctx ); +status_t BGLView::CopyPixelsOut(BPoint source, BBitmap *dest) +{ + // XXX to do + printf("BGLView::CopyPixelsOut() not implemented yet!\n"); + return B_UNSUPPORTED; +} - ctx->Driver.UpdateState = AuxInfo::UpdateState; - ctx->Driver.SetDrawBuffer = AuxInfo::SetDrawBuffer; - ctx->Driver.SetReadBuffer = AuxInfo::SetReadBuffer; - 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; - } +status_t BGLView::CopyPixelsIn(BBitmap *source, BPoint dest) +{ + // XXX to do + printf("BGLView::CopyPixelsIn() not implemented yet!\n"); + return B_UNSUPPORTED; } +void BGLView::ErrorCallback(unsigned long errorCode) // GLenum errorCode) +{ + // XXX to do + printf("BGLView::ErrorCallback() not implemented yet!\n"); + return; +} -void AuxInfo::ClearIndex(GLcontext *ctx, GLuint index) +void BGLView::Draw(BRect updateRect) { - AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; - aux->mClearIndex = index; + // printf("BGLView::Draw()\n"); + MesaDriver * md = (MesaDriver *) m_gc; + assert(md); + md->Draw(updateRect); } +void BGLView::AttachedToWindow() +{ + BView::AttachedToWindow(); + + // don't paint window background white when resized + SetViewColor(B_TRANSPARENT_32_BIT); +} -void AuxInfo::ClearColor(GLcontext *ctx, GLubyte r, GLubyte g, - GLubyte b, GLubyte a) +void BGLView::AllAttached() { - 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); + BView::AllAttached(); +// printf("BGLView AllAttached\n"); } +void BGLView::DetachedFromWindow() +{ + BView::DetachedFromWindow(); +} -GLbitfield AuxInfo::Clear(GLcontext *ctx, GLbitfield mask, - GLboolean all, GLint x, GLint y, - GLint width, GLint height) +void BGLView::AllDetached() { - 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); + BView::AllDetached(); +// printf("BGLView AllDetached"); } +void BGLView::FrameResized(float width, float height) +{ + return BView::FrameResized(width, height); +} -void AuxInfo::ClearFront(GLcontext *ctx, - GLboolean all, GLint x, GLint y, - GLint width, GLint height) +status_t BGLView::Perform(perform_code d, void *arg) { - AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; - BGLView *bglview = aux->mBGLView; - assert(bglview); + return BView::Perform(d, arg); +} - 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 -#if 0 - 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]); -#endif +status_t BGLView::Archive(BMessage *data, bool deep) const +{ + return BView::Archive(data, deep); } - -void AuxInfo::ClearBack(GLcontext *ctx, - GLboolean all, GLint x, GLint y, - GLint width, GLint height) +void BGLView::MessageReceived(BMessage *msg) { - 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; + BView::MessageReceived(msg); +} - 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 BGLView::SetResizingMode(uint32 mode) +{ + BView::SetResizingMode(mode); } +void BGLView::Show() +{ +// printf("BGLView Show\n"); + BView::Show(); +} -GLboolean AuxInfo::SetDrawBuffer(GLcontext *ctx, GLenum buffer) +void BGLView::Hide() { - if (buffer == GL_FRONT_LEFT) - return GL_TRUE; - else if (buffer == GL_BACK_LEFT) - return GL_TRUE; - else - return GL_FALSE; +// printf("BGLView Hide\n"); + BView::Hide(); } -void AuxInfo::SetReadBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, - GLenum buffer) +BHandler *BGLView::ResolveSpecifier(BMessage *msg, int32 index, + BMessage *specifier, int32 form, + const char *property) { - /* XXX to do */ + return BView::ResolveSpecifier(msg, index, specifier, form, property); } -void AuxInfo::GetBufferSize(GLcontext *ctx, GLuint *width, - GLuint *height) +status_t BGLView::GetSupportedSuites(BMessage *data) { - 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; + return BView::GetSupportedSuites(data); +} - 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; - } +void BGLView::DirectConnected( direct_buffer_info *info ) +{ + // XXX to do +} - aux->mWidth = *width; - aux->mHeight = *height; +void BGLView::EnableDirectMode( bool enabled ) +{ + // XXX to do } -const GLubyte *AuxInfo::GetString(GLcontext *ctx, GLenum name) + +//---- 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) { - switch (name) { - case GL_RENDERER: - return (const GLubyte *) "Mesa BeOS"; - default: - // Let core library handle all other cases - return NULL; - } + // XXX not sure how this should work + printf("Warning BGLView::copy constructor not implemented\n"); } +#endif -// 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) +BGLView &BGLView::operator=(const BGLView &v) { - // XXX There's got to be a better way! - BPoint p(x, y), q(x+1, y); - bglview->StrokeLine(p, q); + printf("Warning BGLView::operator= not implemented\n"); + return *this; } +void BGLView::dither_front() +{ + // no-op +} -void AuxInfo::WriteRGBASpanFront(const GLcontext *ctx, GLuint n, - GLint x, GLint y, - CONST GLubyte rgba[][4], - const GLubyte mask[]) +bool BGLView::confirm_dither() { - AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; - BGLView *bglview = aux->mBGLView; - assert(bglview); - int flippedY = aux->mBottom - y; - if (mask) { + // 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; +} + +// #pragma mark - + +MesaDriver::MesaDriver() +{ + m_glcontext = NULL; + m_glvisual = NULL; + m_glframebuffer = NULL; + m_bglview = NULL; + m_bitmap = NULL; + + m_clear_color[BE_RCOMP] = 0; + m_clear_color[BE_GCOMP] = 0; + m_clear_color[BE_BCOMP] = 0; + m_clear_color[BE_ACOMP] = 0; + + m_clear_index = 0; +} + + +MesaDriver::~MesaDriver() +{ + _mesa_destroy_visual(m_glvisual); + _mesa_destroy_framebuffer(m_glframebuffer); + _mesa_destroy_context(m_glcontext); + +} + + +void MesaDriver::Init(BGLView * bglview, GLcontext * ctx, GLvisual * visual, GLframebuffer * framebuffer) +{ + m_bglview = bglview; + m_glcontext = ctx; + m_glvisual = visual; + m_glframebuffer = framebuffer; + + MesaDriver * md = (MesaDriver *) ctx->DriverCtx; + struct swrast_device_driver * swdd = _swrast_GetDeviceDriverReference( ctx ); + TNLcontext * tnl = TNL_CONTEXT(ctx); + + assert(md->m_glcontext == ctx ); + + ctx->Driver.GetString = MesaDriver::GetString; + ctx->Driver.UpdateState = MesaDriver::UpdateState; + ctx->Driver.GetBufferSize = MesaDriver::GetBufferSize; + ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; + + ctx->Driver.Accum = _swrast_Accum; + ctx->Driver.Bitmap = _swrast_Bitmap; + ctx->Driver.ClearIndex = MesaDriver::ClearIndex; + ctx->Driver.ClearColor = MesaDriver::ClearColor; + ctx->Driver.Clear = MesaDriver::Clear; + ctx->Driver.CopyPixels = _swrast_CopyPixels; + ctx->Driver.DrawPixels = _swrast_DrawPixels; + ctx->Driver.ReadPixels = _swrast_ReadPixels; + + ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format; + ctx->Driver.TexImage1D = _mesa_store_teximage1d; + ctx->Driver.TexImage2D = _mesa_store_teximage2d; + ctx->Driver.TexImage3D = _mesa_store_teximage3d; + ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; + ctx->Driver.TexSubImage2D = _mesa_store_texsubimage2d; + ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; + ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; + + ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; + ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; + ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; + ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; + ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; + ctx->Driver.CopyColorTable = _swrast_CopyColorTable; + ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; + ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; + ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; + + ctx->Driver.BaseCompressedTexFormat = _mesa_base_compressed_texformat; + ctx->Driver.CompressedTextureSize = _mesa_compressed_texture_size; + ctx->Driver.GetCompressedTexImage = _mesa_get_compressed_teximage; + + swdd->SetBuffer = MesaDriver::SetBuffer; + + tnl->Driver.RunPipeline = _tnl_run_pipeline; + + _swsetup_Wakeup(ctx); +} + + +void MesaDriver::LockGL() +{ + m_bglview->LockLooper(); + + UpdateState(m_glcontext, 0); + _mesa_make_current(m_glcontext, m_glframebuffer); +} + + +void MesaDriver::UnlockGL() +{ + m_bglview->UnlockLooper(); + // Could call _mesa_make_current(NULL, NULL) but it would just + // hinder performance +} + + +void MesaDriver::SwapBuffers() const +{ + // _mesa_swap_buffers(); + + if (m_bitmap) { + m_bglview->LockLooper(); + m_bglview->DrawBitmap(m_bitmap, BPoint(0, 0)); + m_bglview->UnlockLooper(); + }; +} + + +void MesaDriver::CopySubBuffer(GLint x, GLint y, GLuint width, GLuint height) const +{ + if (m_bitmap) { + // 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 = m_bottom - y; + srcAndDest.top = srcAndDest.bottom - height + 1; + m_bglview->DrawBitmap(m_bitmap, srcAndDest, srcAndDest); + } +} + + +void MesaDriver::Draw(BRect updateRect) const +{ + if (m_bitmap) + m_bglview->DrawBitmap(m_bitmap, updateRect, updateRect); +} + + +void MesaDriver::UpdateState( GLcontext *ctx, GLuint new_state ) +{ + struct swrast_device_driver * swdd = _swrast_GetDeviceDriverReference( ctx ); + + _swrast_InvalidateState( ctx, new_state ); + _swsetup_InvalidateState( ctx, new_state ); + _ac_InvalidateState( ctx, new_state ); + _tnl_InvalidateState( ctx, new_state ); + + if (ctx->Color.DrawBuffer == GL_FRONT) { + /* read/write front buffer */ + swdd->WriteRGBASpan = MesaDriver::WriteRGBASpanFront; + swdd->WriteRGBSpan = MesaDriver::WriteRGBSpanFront; + swdd->WriteRGBAPixels = MesaDriver::WriteRGBAPixelsFront; + swdd->WriteMonoRGBASpan = MesaDriver::WriteMonoRGBASpanFront; + swdd->WriteMonoRGBAPixels = MesaDriver::WriteMonoRGBAPixelsFront; + swdd->WriteCI32Span = MesaDriver::WriteCI32SpanFront; + swdd->WriteCI8Span = MesaDriver::WriteCI8SpanFront; + swdd->WriteMonoCISpan = MesaDriver::WriteMonoCISpanFront; + swdd->WriteCI32Pixels = MesaDriver::WriteCI32PixelsFront; + swdd->WriteMonoCIPixels = MesaDriver::WriteMonoCIPixelsFront; + swdd->ReadRGBASpan = MesaDriver::ReadRGBASpanFront; + swdd->ReadRGBAPixels = MesaDriver::ReadRGBAPixelsFront; + swdd->ReadCI32Span = MesaDriver::ReadCI32SpanFront; + swdd->ReadCI32Pixels = MesaDriver::ReadCI32PixelsFront; + } + else { + /* read/write back buffer */ + swdd->WriteRGBASpan = MesaDriver::WriteRGBASpanBack; + swdd->WriteRGBSpan = MesaDriver::WriteRGBSpanBack; + swdd->WriteRGBAPixels = MesaDriver::WriteRGBAPixelsBack; + swdd->WriteMonoRGBASpan = MesaDriver::WriteMonoRGBASpanBack; + swdd->WriteMonoRGBAPixels = MesaDriver::WriteMonoRGBAPixelsBack; + swdd->WriteCI32Span = MesaDriver::WriteCI32SpanBack; + swdd->WriteCI8Span = MesaDriver::WriteCI8SpanBack; + swdd->WriteMonoCISpan = MesaDriver::WriteMonoCISpanBack; + swdd->WriteCI32Pixels = MesaDriver::WriteCI32PixelsBack; + swdd->WriteMonoCIPixels = MesaDriver::WriteMonoCIPixelsBack; + swdd->ReadRGBASpan = MesaDriver::ReadRGBASpanBack; + swdd->ReadRGBAPixels = MesaDriver::ReadRGBAPixelsBack; + swdd->ReadCI32Span = MesaDriver::ReadCI32SpanBack; + swdd->ReadCI32Pixels = MesaDriver::ReadCI32PixelsBack; + } +} + + +void MesaDriver::ClearIndex(GLcontext *ctx, GLuint index) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + md->m_clear_index = index; +} + + +void MesaDriver::ClearColor(GLcontext *ctx, const GLchan color[4]) + // GLubyte r, GLubyte g, + // GLubyte b, GLubyte a) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + md->m_clear_color[BE_RCOMP] = color[0]; + md->m_clear_color[BE_GCOMP] = color[1]; + md->m_clear_color[BE_BCOMP] = color[2]; + md->m_clear_color[BE_ACOMP] = color[3]; + assert(md->m_bglview); +} + + +void MesaDriver::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); + + mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT); + if (mask) + _swrast_Clear( ctx, mask, all, x, y, width, height ); + + return; +} + + +void MesaDriver::ClearFront(GLcontext *ctx, + GLboolean all, GLint x, GLint y, + GLint width, GLint height) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BGLView *bglview = md->m_bglview; + assert(bglview); + + bglview->SetHighColor(md->m_clear_color[BE_RCOMP], + md->m_clear_color[BE_GCOMP], + md->m_clear_color[BE_BCOMP], + md->m_clear_color[BE_ACOMP]); + bglview->SetLowColor(md->m_clear_color[BE_RCOMP], + md->m_clear_color[BE_GCOMP], + md->m_clear_color[BE_BCOMP], + md->m_clear_color[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 = md->m_height - y - 1; + b.top = b.bottom - height; + bglview->FillRect(b); + } + + // restore drawing color +#if 0 + bglview->SetHighColor(md->mColor[BE_RCOMP], + md->mColor[BE_GCOMP], + md->mColor[BE_BCOMP], + md->mColor[BE_ACOMP]); + bglview->SetLowColor(md->mColor[BE_RCOMP], + md->mColor[BE_GCOMP], + md->mColor[BE_BCOMP], + md->mColor[BE_ACOMP]); +#endif +} + + +void MesaDriver::ClearBack(GLcontext *ctx, + GLboolean all, GLint x, GLint y, + GLint width, GLint height) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BGLView *bglview = md->m_bglview; + assert(bglview); + BBitmap *bitmap = md->m_bitmap; + assert(bitmap); + GLuint *start = (GLuint *) bitmap->Bits(); + const GLuint *clearPixelPtr = (const GLuint *) md->m_clear_color; + const GLuint clearPixel = *clearPixelPtr; + + if (all) { + const int numPixels = md->m_width * md->m_height; + if (clearPixel == 0) { + memset(start, 0, numPixels * 4); + } + else { + for (int i = 0; i < numPixels; i++) { + start[i] = clearPixel; + } + } + } + else { + // XXX untested + start += y * md->m_width + x; + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { + start[j] = clearPixel; + } + start += md->m_width; + } + } +} + + +void MesaDriver::SetBuffer(GLcontext *ctx, GLframebuffer *buffer, + GLenum mode) +{ + /* TODO */ + (void) ctx; + (void) buffer; + (void) mode; +} + +void MesaDriver::GetBufferSize(GLframebuffer * framebuffer, GLuint *width, + GLuint *height) +{ + GET_CURRENT_CONTEXT(ctx); + if (!ctx) + return; + + MesaDriver * md = (MesaDriver *) ctx->DriverCtx; + BGLView *bglview = md->m_bglview; + assert(bglview); + + BRect b = bglview->Bounds(); + *width = (GLuint) b.IntegerWidth() + 1; // (b.right - b.left + 1); + *height = (GLuint) b.IntegerHeight() + 1; // (b.bottom - b.top + 1); + md->m_bottom = (GLint) b.bottom; + + if (ctx->Visual.doubleBufferMode) { + if (*width != md->m_width || *height != md->m_height) { + // allocate new size of back buffer bitmap + if (md->m_bitmap) + delete md->m_bitmap; + BRect rect(0.0, 0.0, *width - 1, *height - 1); + md->m_bitmap = new BBitmap(rect, B_RGBA32); + } + } + else + { + md->m_bitmap = NULL; + } + + md->m_width = *width; + md->m_height = *height; +} + + +const GLubyte *MesaDriver::GetString(GLcontext *ctx, GLenum name) +{ + switch (name) { + case GL_RENDERER: + return (const GLubyte *) "Mesa BGLView (software)"; + 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 MesaDriver::WriteRGBASpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgba[][4], + const GLubyte mask[]) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BGLView *bglview = md->m_bglview; + assert(bglview); + int flippedY = md->m_bottom - 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]); @@ -561,15 +982,15 @@ void AuxInfo::WriteRGBASpanFront(const GLcontext *ctx, GLuint n, } } -void AuxInfo::WriteRGBSpanFront(const GLcontext *ctx, GLuint n, +void MesaDriver::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; + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BGLView *bglview = md->m_bglview; assert(bglview); - int flippedY = aux->mBottom - y; + int flippedY = md->m_bottom - y; if (mask) { for (GLuint i = 0; i < n; i++) { if (mask[i]) { @@ -586,15 +1007,15 @@ void AuxInfo::WriteRGBSpanFront(const GLcontext *ctx, GLuint n, } } -void AuxInfo::WriteMonoRGBASpanFront(const GLcontext *ctx, GLuint n, +void MesaDriver::WriteMonoRGBASpanFront(const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLchan color[4], const GLubyte mask[]) { - AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; - BGLView *bglview = aux->mBGLView; + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BGLView *bglview = md->m_bglview; assert(bglview); - int flippedY = aux->mBottom - y; + int flippedY = md->m_bottom - y; bglview->SetHighColor(color[RCOMP], color[GCOMP], color[BCOMP]); if (mask) { for (GLuint i = 0; i < n; i++) { @@ -610,69 +1031,69 @@ void AuxInfo::WriteMonoRGBASpanFront(const GLcontext *ctx, GLuint n, } } -void AuxInfo::WriteRGBAPixelsFront(const GLcontext *ctx, +void MesaDriver::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; + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BGLView *bglview = md->m_bglview; 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]); + Plot(bglview, x[i], md->m_bottom - 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]); + Plot(bglview, x[i], md->m_bottom - y[i]); } } } -void AuxInfo::WriteMonoRGBAPixelsFront(const GLcontext *ctx, GLuint n, +void MesaDriver::WriteMonoRGBAPixelsFront(const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLchan color[4], const GLubyte mask[]) { - AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; - BGLView *bglview = aux->mBGLView; + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BGLView *bglview = md->m_bglview; assert(bglview); // plot points using current color bglview->SetHighColor(color[RCOMP], color[GCOMP], color[BCOMP]); if (mask) { for (GLuint i = 0; i < n; i++) { if (mask[i]) { - Plot(bglview, x[i], aux->mBottom - y[i]); + Plot(bglview, x[i], md->m_bottom - y[i]); } } } else { for (GLuint i = 0; i < n; i++) { - Plot(bglview, x[i], aux->mBottom - y[i]); + Plot(bglview, x[i], md->m_bottom - y[i]); } } } -void AuxInfo::WriteCI32SpanFront( const GLcontext *ctx, GLuint n, GLint x, GLint y, +void MesaDriver::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, +void MesaDriver::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, +void MesaDriver::WriteMonoCISpanFront( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint colorIndex, const GLubyte mask[] ) { @@ -680,14 +1101,14 @@ void AuxInfo::WriteMonoCISpanFront( const GLcontext *ctx, GLuint n, } -void AuxInfo::WriteCI32PixelsFront( const GLcontext *ctx, GLuint n, +void MesaDriver::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, +void MesaDriver::WriteMonoCIPixelsFront( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLuint colorIndex, const GLubyte mask[] ) { @@ -695,215 +1116,267 @@ void AuxInfo::WriteMonoCIPixelsFront( const GLcontext *ctx, GLuint n, } -void AuxInfo::ReadCI32SpanFront( const GLcontext *ctx, +void MesaDriver::ReadCI32SpanFront( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint index[] ) { - // XXX to do + printf("ReadCI32SpanFront() not implemented yet!\n"); + // XXX to do } -void AuxInfo::ReadRGBASpanFront( const GLcontext *ctx, GLuint n, +void MesaDriver::ReadRGBASpanFront( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ) { + printf("ReadRGBASpanFront() not implemented yet!\n"); // XXX to do } -void AuxInfo::ReadCI32PixelsFront( const GLcontext *ctx, +void MesaDriver::ReadCI32PixelsFront( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLuint indx[], const GLubyte mask[] ) { + printf("ReadCI32PixelsFront() not implemented yet!\n"); // XXX to do } -void AuxInfo::ReadRGBAPixelsFront( const GLcontext *ctx, +void MesaDriver::ReadRGBAPixelsFront( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] ) { + printf("ReadRGBAPixelsFront() not implemented yet!\n"); // XXX to do } -void AuxInfo::WriteRGBASpanBack(const GLcontext *ctx, GLuint n, +void MesaDriver::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; + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BBitmap *bitmap = md->m_bitmap; + + static bool already_called = false; + if (! already_called) { + printf("WriteRGBASpanBack() called.\n"); + already_called = true; + } + + assert(bitmap); + + int row = md->m_bottom - y; + uint8 * ptr = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + x * 4; + uint32 * pixel = (uint32 *) ptr; + + if (mask) { + while(n--) { + if (*mask++) + *pixel = PACK_B_RGBA32(rgba[0]); + pixel++; + rgba++; + }; + } else { + while(n--) { + *pixel++ = PACK_B_RGBA32(rgba[0]); + rgba++; + }; + }; + } + + +void MesaDriver::WriteRGBSpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgb[][3], + const GLubyte mask[]) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BBitmap *bitmap = md->m_bitmap; + + static bool already_called = false; + if (! already_called) { + printf("WriteRGBSpanBack() called.\n"); + already_called = true; + } + + assert(bitmap); + + int row = md->m_bottom - y; + uint8 * ptr = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + x * 4; + uint32 * pixel = (uint32 *) ptr; + + if (mask) { + while(n--) { + if (*mask++) + *pixel = PACK_B_RGB32(rgb[0]); + pixel++; + rgb++; + }; + } else { + while(n--) { + *pixel++ = PACK_B_RGB32(rgb[0]); + rgb++; + }; + }; +} + + + + +void MesaDriver::WriteMonoRGBASpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + const GLchan color[4], const GLubyte mask[]) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BBitmap *bitmap = md->m_bitmap; + + static bool already_called = false; + if (! already_called) { + printf("WriteMonoRGBASpanBack() called.\n"); + already_called = true; + } + + assert(bitmap); + + int row = md->m_bottom - y; + uint8 * ptr = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + x * 4; + uint32 * pixel = (uint32 *) ptr; + uint32 pixel_color = PACK_B_RGBA32(color); + + if (mask) { + while(n--) { + if (*mask++) + *pixel = pixel_color; + pixel++; + }; + } else { + while(n--) { + *pixel++ = pixel_color; + }; + }; +} + + +void MesaDriver::WriteRGBAPixelsBack(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + CONST GLubyte rgba[][4], + const GLubyte mask[] ) +{ + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BBitmap *bitmap = md->m_bitmap; + + static bool already_called = false; + if (! already_called) { + printf("WriteRGBAPixelsBack() called.\n"); + already_called = true; + } + + assert(bitmap); +#if 0 + while(n--) { + if (*mask++) { + int row = md->m_bottom - *y; + uint8 * pixel = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + *x * 4; + *((uint32 *) pixel) = PACK_B_RGBA32(rgba[0]); + }; + x++; + y++; + rgba++; + }; +#else if (mask) { for (GLuint i = 0; i < n; i++) { if (mask[i]) { + GLubyte *pixel = (GLubyte *) bitmap->Bits() + + ((md->m_bottom - 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]; } - pixel += 4; } } else { for (GLuint i = 0; i < n; i++) { + GLubyte *pixel = (GLubyte *) bitmap->Bits() + + ((md->m_bottom - 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]; - pixel += 4; } } +#endif } -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 GLchan color[4], 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; - GLuint pixel; - GLubyte *mColor= (GLubyte *) &pixel; - mColor[BE_RCOMP] = color[RCOMP]; - mColor[BE_GCOMP] = color[GCOMP]; - mColor[BE_BCOMP] = color[BCOMP]; - mColor[BE_ACOMP] = color[ACOMP]; - 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, +void MesaDriver::WriteMonoRGBAPixelsBack(const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLchan color[4], const GLubyte mask[]) { - AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; - BBitmap *bitmap = aux->mBitmap; - GLuint pixel; - GLubyte *mColor= (GLubyte *) &pixel; - mColor[BE_RCOMP] = color[RCOMP]; - mColor[BE_GCOMP] = color[GCOMP]; - mColor[BE_BCOMP] = color[BCOMP]; - mColor[BE_ACOMP] = color[ACOMP]; - assert(bitmap); + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + BBitmap *bitmap = md->m_bitmap; + + static bool already_called = false; + if (! already_called) { + printf("WriteMonoRGBAPixelsBack() called.\n"); + already_called = true; + } + + assert(bitmap); + + uint32 pixel_color = PACK_B_RGBA32(color); +#if 0 + while(n--) { + if (*mask++) { + int row = md->m_bottom - *y; + uint8 * pixel = (uint8 *) bitmap->Bits() + (row * bitmap->BytesPerRow()) + *x * 4; + + *((uint32 *) pixel) = pixel_color; + }; + x++; + y++; + }; +#else 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; + GLubyte * ptr = (GLubyte *) bitmap->Bits() + + ((md->m_bottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; + *((uint32 *) ptr) = pixel_color; } } } else { - for (GLuint i = 0; i < n; i++) { - GLuint *pixelPtr = (GLuint *) bitmap->Bits() - + (aux->mBottom - y[i]) * aux->mWidth + x[i]; - *pixelPtr = pixel; + for (GLuint i = 0; i < n; i++) { + GLubyte * ptr = (GLubyte *) bitmap->Bits() + + ((md->m_bottom - y[i]) * bitmap->BytesPerRow()) + x[i] * 4; + *((uint32 *) ptr) = pixel_color; } } +#endif } -void AuxInfo::WriteCI32SpanBack( const GLcontext *ctx, GLuint n, +void MesaDriver::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, +void MesaDriver::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, +void MesaDriver::WriteMonoCISpanBack( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint colorIndex, const GLubyte mask[] ) { @@ -911,14 +1384,14 @@ void AuxInfo::WriteMonoCISpanBack( const GLcontext *ctx, GLuint n, } -void AuxInfo::WriteCI32PixelsBack( const GLcontext *ctx, GLuint n, +void MesaDriver::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, +void MesaDriver::WriteMonoCIPixelsBack( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLuint colorIndex, const GLubyte mask[] ) { @@ -926,22 +1399,23 @@ void AuxInfo::WriteMonoCIPixelsBack( const GLcontext *ctx, GLuint n, } -void AuxInfo::ReadCI32SpanBack( const GLcontext *ctx, +void MesaDriver::ReadCI32SpanBack( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint index[] ) { // XXX to do } -void AuxInfo::ReadRGBASpanBack( const GLcontext *ctx, GLuint n, +void MesaDriver::ReadRGBASpanBack( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ) { - AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; - const BBitmap *bitmap = aux->mBitmap; + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + const BBitmap *bitmap = md->m_bitmap; assert(bitmap); - int row = aux->mBottom - y; + int row = md->m_bottom - y; const GLubyte *pixel = (GLubyte *) bitmap->Bits() - + row * bitmap->BytesPerRow() + x * 4; + + (row * bitmap->BytesPerRow()) + x * 4; + for (GLuint i = 0; i < n; i++) { rgba[i][RCOMP] = pixel[BE_RCOMP]; rgba[i][GCOMP] = pixel[BE_GCOMP]; @@ -952,7 +1426,7 @@ void AuxInfo::ReadRGBASpanBack( const GLcontext *ctx, GLuint n, } -void AuxInfo::ReadCI32PixelsBack( const GLcontext *ctx, +void MesaDriver::ReadCI32PixelsBack( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLuint indx[], const GLubyte mask[] ) { @@ -960,319 +1434,36 @@ void AuxInfo::ReadCI32PixelsBack( const GLcontext *ctx, } -void AuxInfo::ReadRGBAPixelsBack( const GLcontext *ctx, +void MesaDriver::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; + MesaDriver *md = (MesaDriver *) ctx->DriverCtx; + const BBitmap *bitmap = md->m_bitmap; 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; + + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + GLubyte *pixel = (GLubyte *) bitmap->Bits() + + ((md->m_bottom - y[i]) * bitmap->BytesPerRow()) + 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]; + }; + }; + } else { + for (GLuint i = 0; i < n; i++) { + GLubyte *pixel = (GLubyte *) bitmap->Bits() + + ((md->m_bottom - y[i]) * bitmap->BytesPerRow()) + 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 = _mesa__create_visual( rgbFlag, - dblFlag, - stereoFlag, - red, green, blue, alpha, - index, - depth, - stencil, - accum, accum, accum, accum, - 1 - ); - - // create core framebuffer - GLframebuffer *buffer = _mesa_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 = _mesa_create_context( visual, NULL, aux, direct ); - - _mesa_enable_sw_extensions(ctx); - - 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 _mesa_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/src/mesa/main/Makefile.BeOS-R5 b/src/mesa/main/Makefile.BeOS-R5 new file mode 100644 index 00000000000..65303863a23 --- /dev/null +++ b/src/mesa/main/Makefile.BeOS-R5 @@ -0,0 +1,452 @@ +# Mesa 3-D graphics library +# Version: 4.1 +# +# Copyright (C) 1995-2002 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# 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. +# +# BeOS driver makefile v1.0 for Mesa 4.1 +# +# Copyright (C) 2002 - Philippe Houdoin +# Email : philippe.houdoin@free.fr +# Web : http://philippe.houdoin.free.fr/phil/beos/index-en.html +# +# ------------------------------------------------------------------- + +## BeOS Generic Makefile v2.0 ## + +## Fill in this file to specify the project being created, and the referenced +## makefile-engine will do all of the hard work for you. This handles both +## Intel and PowerPC builds of the BeOS. + +## Application Specific Settings --------------------------------------------- + +# specify the name of the binary +NAME= libGL.so + +# specify the type of binary +# APP: Application +# SHARED: Shared library or add-on +# STATIC: Static library archive +# DRIVER: Kernel Driver +TYPE= SHARED + +# specify the source files to use +# full paths or paths relative to the makefile can be included +# all files, regardless of directory, will have their object +# files created in the common object directory. +# Note that this means this makefile will not work correctly +# if two source files with the same name (source.c or source.cpp) +# are included from different directories. Also note that spaces +# in folder names do not work well with this makefile. + +MESA_CORE_SRCS = \ + api_arrayelt.c \ + api_loopback.c \ + api_noop.c \ + api_validate.c \ + accum.c \ + attrib.c \ + blend.c \ + buffers.c \ + clip.c \ + colortab.c \ + context.c \ + convolve.c \ + debug.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 \ + glthread.c \ + hash.c \ + hint.c \ + histogram.c \ + image.c \ + imports.c \ + light.c \ + lines.c \ + matrix.c \ + mem.c \ + mmath.c \ + pixel.c \ + points.c \ + polygon.c \ + rastpos.c \ + state.c \ + stencil.c \ + texformat.c \ + teximage.c \ + texobj.c \ + texstate.c \ + texstore.c \ + texutil.c \ + varray.c \ + vpexec.c \ + vpparse.c \ + vpstate.c \ + vtxfmt.c \ + math/m_debug_clip.c \ + math/m_debug_norm.c \ + math/m_debug_xform.c \ + math/m_eval.c \ + math/m_matrix.c \ + math/m_translate.c \ + math/m_vector.c \ + math/m_xform.c \ + array_cache/ac_context.c \ + array_cache/ac_import.c \ + swrast/s_aaline.c \ + swrast/s_aatriangle.c \ + swrast/s_accum.c \ + swrast/s_alpha.c \ + swrast/s_alphabuf.c \ + swrast/s_bitmap.c \ + swrast/s_blend.c \ + swrast/s_buffers.c \ + swrast/s_copypix.c \ + swrast/s_context.c \ + swrast/s_depth.c \ + swrast/s_drawpix.c \ + swrast/s_feedback.c \ + swrast/s_fog.c \ + swrast/s_histogram.c \ + swrast/s_imaging.c \ + swrast/s_lines.c \ + swrast/s_logic.c \ + swrast/s_masking.c \ + swrast/s_pixeltex.c \ + swrast/s_points.c \ + swrast/s_readpix.c \ + swrast/s_span.c \ + swrast/s_stencil.c \ + swrast/s_texture.c \ + swrast/s_texstore.c \ + swrast/s_triangle.c \ + swrast/s_zoom.c \ + swrast_setup/ss_context.c \ + swrast_setup/ss_triangle.c \ + swrast_setup/ss_vb.c \ + tnl/t_array_api.c \ + tnl/t_array_import.c \ + tnl/t_context.c \ + tnl/t_eval_api.c \ + tnl/t_imm_alloc.c \ + tnl/t_imm_api.c \ + tnl/t_imm_debug.c \ + tnl/t_imm_dlist.c \ + tnl/t_imm_elt.c \ + tnl/t_imm_eval.c \ + tnl/t_imm_exec.c \ + tnl/t_imm_fixup.c \ + tnl/t_pipeline.c \ + tnl/t_vb_fog.c \ + tnl/t_vb_light.c \ + tnl/t_vb_normals.c \ + tnl/t_vb_points.c \ + tnl/t_vb_program.c \ + tnl/t_vb_render.c \ + tnl/t_vb_texgen.c \ + tnl/t_vb_texmat.c \ + tnl/t_vb_vertex.c + +MESA_BEOS_DRIVER_SRCS = \ + BeOS/GLView.cpp + +MESA_X86_SRCS = \ + X86/x86.c \ + X86/glapi_x86.S \ + X86/common_x86.c \ + X86/common_x86_asm.S \ + X86/x86_xform2.S \ + X86/x86_xform3.S \ + X86/x86_xform4.S \ + X86/x86_cliptest.S + +MESA_MMX_SRCS = \ + X86/mmx_blend.S + +MESA_SSE_SRCS = \ + X86/sse.c \ + X86/sse_xform2.S \ + X86/sse_xform3.S \ + X86/sse_xform4.S \ + X86/sse_normal.S + +MESA_3DNOW_SRCS = \ + X86/3dnow.c \ + X86/3dnow_normal.S \ + X86/3dnow_xform1.S \ + X86/3dnow_xform2.S \ + X86/3dnow_xform3.S \ + X86/3dnow_xform4.S + +MESA_DEFINES = +# To use GAS assembler, uncomment this line instead: +MESA_DEFINES += GNU_ASSEMBLER +# To use NASM assembler, uncomment this line instead: +# MESA_DEFINES += NASM_ASSEMBLER +# To build a DEBUG version of Mesa, uncomment this line instead: +# MESA_DEFINES += DEBUG + +# x86-optimized code +MACHINE=$(shell uname -m) +ifeq ($(MACHINE), BePC) + HAVE_MMX = 1 + HAVE_SSE = 1 + HAVE_3DNOW = 1 +else + # No assembly optimization for PowerPC... + # HAVE_ALTIVEC=1 +endif + +ifdef HAVE_MMX + MESA_X86_SRCS += $(MESA_MMX_SRCS) + MESA_DEFINES += USE_MMX_ASM + HAVE_X86 = 1 +endif +ifdef HAVE_SSE + MESA_X86_SRCS += $(MESA_SSE_SRCS) + MESA_DEFINES += USE_SSE_ASM + HAVE_X86 = 1 +endif +ifdef HAVE_3DNOW + MESA_X86_SRCS += $(MESA_3DNOW_SRCS) + MESA_DEFINES += USE_3DNOW_ASM + HAVE_X86 = 1 +endif +ifdef HAVE_X86 + MESA_DEFINES += USE_X86_ASM +else + MESA_X86_SRCS = +endif + +# FIXME: SI-GLU version support currently broken +# USE_SI_GLU=1 +ifdef USE_SI_GLU + GLU_SRCS = \ + ../si-glu/libutil/error.c \ + ../si-glu/libutil/glue.c \ + ../si-glu/libutil/mipmap.c \ + ../si-glu/libutil/project.c \ + ../si-glu/libutil/quad.c \ + ../si-glu/libutil/registry.c \ + ../si-glu/libtess/dict.c \ + ../si-glu/libtess/geom.c \ + ../si-glu/libtess/memalloc.c \ + ../si-glu/libtess/mesh.c \ + ../si-glu/libtess/normal.c \ + ../si-glu/libtess/priorityq.c \ + ../si-glu/libtess/render.c \ + ../si-glu/libtess/sweep.c \ + ../si-glu/libtess/tess.c \ + ../si-glu/libtess/tessmono.c \ + ../si-glu/libnurbs/interface/bezierEval.cc \ + ../si-glu/libnurbs/interface/bezierPatch.cc \ + ../si-glu/libnurbs/interface/bezierPatchMesh.cc \ + ../si-glu/libnurbs/interface/glcurveval.cc \ + ../si-glu/libnurbs/interface/glinterface.cc \ + ../si-glu/libnurbs/interface/glrenderer.cc \ + ../si-glu/libnurbs/interface/glsurfeval.cc \ + ../si-glu/libnurbs/interface/incurveeval.cc \ + ../si-glu/libnurbs/interface/insurfeval.cc \ + ../si-glu/libnurbs/internals/arc.cc \ + ../si-glu/libnurbs/internals/arcsorter.cc \ + ../si-glu/libnurbs/internals/arctess.cc \ + ../si-glu/libnurbs/internals/backend.cc \ + ../si-glu/libnurbs/internals/basiccrveval.cc \ + ../si-glu/libnurbs/internals/basicsurfeval.cc \ + ../si-glu/libnurbs/internals/bin.cc \ + ../si-glu/libnurbs/internals/bufpool.cc \ + ../si-glu/libnurbs/internals/cachingeval.cc \ + ../si-glu/libnurbs/internals/ccw.cc \ + ../si-glu/libnurbs/internals/coveandtiler.cc \ + ../si-glu/libnurbs/internals/curve.cc \ + ../si-glu/libnurbs/internals/curvelist.cc \ + ../si-glu/libnurbs/internals/curvesub.cc \ + ../si-glu/libnurbs/internals/dataTransform.cc \ + ../si-glu/libnurbs/internals/displaylist.cc \ + ../si-glu/libnurbs/internals/flist.cc \ + ../si-glu/libnurbs/internals/flistsorter.cc \ + ../si-glu/libnurbs/internals/hull.cc \ + ../si-glu/libnurbs/internals/intersect.cc \ + ../si-glu/libnurbs/internals/knotvector.cc \ + ../si-glu/libnurbs/internals/mapdesc.cc \ + ../si-glu/libnurbs/internals/mapdescv.cc \ + ../si-glu/libnurbs/internals/maplist.cc \ + ../si-glu/libnurbs/internals/mesher.cc \ + ../si-glu/libnurbs/internals/monoTriangulationBackend.cc \ + ../si-glu/libnurbs/internals/monotonizer.cc \ + ../si-glu/libnurbs/internals/mycode.cc \ + ../si-glu/libnurbs/internals/nurbsinterfac.cc \ + ../si-glu/libnurbs/internals/nurbstess.cc \ + ../si-glu/libnurbs/internals/patch.cc \ + ../si-glu/libnurbs/internals/patchlist.cc \ + ../si-glu/libnurbs/internals/quilt.cc \ + ../si-glu/libnurbs/internals/reader.cc \ + ../si-glu/libnurbs/internals/renderhints.cc \ + ../si-glu/libnurbs/internals/slicer.cc \ + ../si-glu/libnurbs/internals/sorter.cc \ + ../si-glu/libnurbs/internals/splitarcs.cc \ + ../si-glu/libnurbs/internals/subdivider.cc \ + ../si-glu/libnurbs/internals/tobezier.cc \ + ../si-glu/libnurbs/internals/trimline.cc \ + ../si-glu/libnurbs/internals/trimregion.cc \ + ../si-glu/libnurbs/internals/trimvertpool.cc \ + ../si-glu/libnurbs/internals/uarray.cc \ + ../si-glu/libnurbs/internals/varray.cc \ + ../si-glu/libnurbs/nurbtess/directedLine.cc \ + ../si-glu/libnurbs/nurbtess/gridWrap.cc \ + ../si-glu/libnurbs/nurbtess/monoChain.cc \ + ../si-glu/libnurbs/nurbtess/monoPolyPart.cc \ + ../si-glu/libnurbs/nurbtess/monoTriangulation.cc \ + ../si-glu/libnurbs/nurbtess/partitionX.cc \ + ../si-glu/libnurbs/nurbtess/partitionY.cc \ + ../si-glu/libnurbs/nurbtess/polyDBG.cc \ + ../si-glu/libnurbs/nurbtess/polyUtil.cc \ + ../si-glu/libnurbs/nurbtess/primitiveStream.cc \ + ../si-glu/libnurbs/nurbtess/quicksort.cc \ + ../si-glu/libnurbs/nurbtess/rectBlock.cc \ + ../si-glu/libnurbs/nurbtess/sampleComp.cc \ + ../si-glu/libnurbs/nurbtess/sampleCompBot.cc \ + ../si-glu/libnurbs/nurbtess/sampleCompRight.cc \ + ../si-glu/libnurbs/nurbtess/sampleCompTop.cc \ + ../si-glu/libnurbs/nurbtess/sampleMonoPoly.cc \ + ../si-glu/libnurbs/nurbtess/sampledLine.cc \ + ../si-glu/libnurbs/nurbtess/searchTree.cc +else + GLU_SRCS = \ + ../src-glu/glu.c \ + ../src-glu/mipmap.c \ + ../src-glu/project.c \ + ../src-glu/quadric.c \ + ../src-glu/tess.c \ + ../src-glu/tesselat.c \ + ../src-glu/polytest.c \ + ../src-glu/nurbs.c \ + ../src-glu/nurbscrv.c \ + ../src-glu/nurbssrf.c \ + ../src-glu/nurbsutl.c +endif + +SRCS = $(MESA_CORE_SRCS) $(MESA_X86_SRCS) $(GLU_SRCS) $(MESA_BEOS_DRIVER_SRCS) + +# specify the resource files to use +# full path or a relative path to the resource file can be used. +RSRCS = + +# specify additional libraries to link against +# there are two acceptable forms of library specifications +# - if your library follows the naming pattern of: +# libXXX.so or libXXX.a you can simply specify XXX +# library: libbe.so entry: be +# +# - if your library does not follow the standard library +# naming scheme you need to specify the path to the library +# and it's name +# library: my_lib.a entry: my_lib.a or path/my_lib.a +LIBS = be + +# specify additional paths to directories following the standard +# libXXX.so or libXXX.a naming scheme. You can specify full paths +# or paths relative to the makefile. The paths included may not +# be recursive, so include all of the paths where libraries can +# be found. Directories where source files are found are +# automatically included. +LIBPATHS = + +# additional paths to look for system headers +# thes use the form: #include
+# source file directories are NOT auto-included here +SYSTEM_INCLUDE_PATHS = ../include +ifdef USE_SI_GLU + SYSTEM_INCLUDE_PATHS += ../si-glu/include +endif + +# additional paths to look for local headers +# thes use the form: #include "header" +# source file directories are automatically included +LOCAL_INCLUDE_PATHS = + +# specify the level of optimization that you desire +# NONE, SOME, FULL +OPTIMIZE = FULL + +# specify any preprocessor symbols to be defined. The symbols +# will be set to a value of 1. For example specify DEBUG if you want +# DEBUG=1 to be set when compiling. +DEFINES = $(MESA_DEFINES) + +# specify special warning levels +# if unspecified default warnings will be used +# NONE = suppress all warnings +# ALL = enable all warnings +WARNINGS = ALL + +# specify whether image symbols will be created +# so that stack crawls in the debugger are meaningful +# if TRUE symbols will be created +SYMBOLS = TRUE + +# specify debug settings +# if TRUE will allow application to be run from +# a source-level debugger +# DEBUGGER = TRUE +DEBUGGER = FALSE + +# specify additional compiler flags for all files +COMPILER_FLAGS = + +# specify additional linker flags +LINKER_FLAGS = + + + +## include the makefile-engine +include /boot/develop/etc/makefile-engine + + + +# X86/matypes.h include file is *generated*! +# Rules to (re)generate it as needed: + +X86/common_x86_asm.S : X86/matypes.h + +X86/matypes.h : X86/gen_matypes.c + @echo "(Re-)Generating $@ ..." + $(CC) $< $(INCLUDES) $(CFLAGS) -o X86/gen_matypes + X86/gen_matypes > $@ + rm -f X86/gen_matypes + +## Add NASM support for assembly code compilation... +# $(OBJ_DIR)/%.o : %.nasm +# nasm -f elf $(MESA_DEFINES) -o $@ $< + +$(OBJ_DIR)/%.o : %.S + gcc -c $< $(INCLUDES) $(CFLAGS) -o $@ +# gcc $(INCLUDES) $(CFLAGS) -E $< | grep -v '^$$' > $(addsuffix .nasm, $(basename $<)) +# nasm -f elf $(MESA_DEFINES) -o $@ $(addsuffix .nasm, $(basename $<)) + diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c index 8a86d696948..b97a70528c6 100644 --- a/src/mesa/x86/gen_matypes.c +++ b/src/mesa/x86/gen_matypes.c @@ -1,4 +1,4 @@ -/* $Id: gen_matypes.c,v 1.7 2002/02/15 16:32:36 brianp Exp $ */ +/* $Id: gen_matypes.c,v 1.8 2002/09/19 16:19:45 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -66,11 +66,21 @@ do { \ printf( "\n" ); \ } while (0) +#if defined(__BEOS__) +#define OFFSET( s, t, m ) \ + printf( "#define %s\t%ld\n", s, offsetof( t, m ) ); +#else #define OFFSET( s, t, m ) \ printf( "#define %s\t%d\n", s, offsetof( t, m ) ); +#endif +#if defined(__BEOS__) +#define SIZEOF( s, t ) \ + printf( "#define %s\t%ld\n", s, sizeof(t) ); +#else #define SIZEOF( s, t ) \ printf( "#define %s\t%d\n", s, sizeof(t) ); +#endif #define DEFINE( s, d ) \ printf( "#define %s\t0x%x\n", s, d ); -- cgit v1.2.3 From c62aeed003cc20b189d71bc53256419e0d630aaf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 21 Sep 2002 16:47:09 +0000 Subject: merge updates from 4.0.4 --- include/GL/gl.h | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 4b3a411909e..bced617f158 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.70 2002/09/19 16:19:45 brianp Exp $ */ +/* $Id: gl.h,v 1.71 2002/09/21 16:47:09 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2594,6 +2594,45 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid #endif /* GL_MESA_packed_depth_stencil */ +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 + +#define GL_YCBCR_MESA 0x8757 +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA /* same as Apple */ +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB /* same as Apple */ + +#endif /* GL_MESA_texture_ycbcr */ + + + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 + +#define GL_PACK_INVERT_MESA 0x8758 + +#endif /* GL_MESA_pack_invert */ + + + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 + +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 + +#endif /* GL_APPLE_client_storage */ + + + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 + +#define GL_YCBCR_422_APPLE 0x85B9 +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB + +#endif /* GL_APPLE_ycbcr_422 */ + + /********************************************************************** * Begin system-specific stuff -- cgit v1.2.3 From fa647e8336767654e1f67729b7eca61fbf76ff41 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 5 Oct 2002 03:03:37 +0000 Subject: added XMesaCreatePBuffer() --- include/GL/xmesa.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index c157eb09839..d5a08f9d5f2 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -1,8 +1,8 @@ -/* $Id: xmesa.h,v 1.13 2002/03/16 00:53:48 brianp Exp $ */ +/* $Id: xmesa.h,v 1.14 2002/10/05 03:03:37 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 4.0.2 + * Version: 4.1 * * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * @@ -90,7 +90,7 @@ extern struct Library *XLibBase; #define XMESA_MAJOR_VERSION 4 -#define XMESA_MINOR_VERSION 0 +#define XMESA_MINOR_VERSION 1 @@ -374,6 +374,16 @@ extern GLboolean XMesaSetFXmode( GLint mode ); extern void XMesaResizeBuffers( XMesaBuffer b ); + +/* + * Create a pbuffer. + * New in Mesa 4.1 + */ +extern XMesaBuffer XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap, + unsigned int width, unsigned int height); + + + #ifdef __cplusplus } #endif -- cgit v1.2.3 From 8455203bc7231f4ad4ee517faef3df024bf38070 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 8 Oct 2002 22:47:53 +0000 Subject: GLX_NV_vertex_array_range and GLX_MESA_agp_offset extensions --- include/GL/glx.h | 44 +++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 1f6f0c9cc08..f0b479c2796 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.36 2002/08/22 21:10:38 brianp Exp $ */ +/* $Id: glx.h,v 1.37 2002/10/08 22:47:53 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -297,16 +297,6 @@ extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable, extern void (*glXGetProcAddress(const GLubyte *procname))(); -/* - * AGP memory allocator. - */ -extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); -extern void glXFreeMemoryNV(GLvoid *pointer); -typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); -typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer); - - - #ifndef GLX_GLXEXT_LEGACY #include @@ -462,6 +452,38 @@ extern void (*glXGetProcAddressARB(const GLubyte *procName))(); #endif /* GLX_GLXEXT_LEGACY */ +/** + ** The following aren't in glxext.h yet. + **/ + + +/* + * ???. GLX_NV_vertex_array_range + */ +#ifndef GLX_NV_vertex_array_range +#define GLX_NV_vertex_array_range + +extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +extern void glXFreeMemoryNV(GLvoid *pointer); +typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer); + +#endif /* GLX_NV_vertex_array_range */ + + + +/* + * ???. GLX_MESA_agp_offset + */ +#ifndef GLX_MESA_agp_offset +#define GLX_MESA_agp_offset 1 + +extern GLuint glXGetAGPOffsetMESA(const GLvoid *pointer); +typedef GLuint (* PFNGLXGETAGPOFFSETMESAPROC) (const GLvoid *pointer); + +#endif /* GLX_MESA_agp_offset */ + + #ifdef __cplusplus } -- cgit v1.2.3 From 85678e0399eef682aa283fc1f952afa258af92a7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 9 Oct 2002 19:37:32 +0000 Subject: disable wscx field in __GLimportsRec to be consistant with XFree86 --- include/GL/internal/glcore.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/GL/internal/glcore.h b/include/GL/internal/glcore.h index 8bb73e6543d..057ad0837ef 100644 --- a/include/GL/internal/glcore.h +++ b/include/GL/internal/glcore.h @@ -373,8 +373,13 @@ typedef struct __GLimportsRec { /* Drawing surface management */ __GLdrawablePrivate *(*getDrawablePrivate)(__GLcontext *gc); +#if 0 + /* At some point, this field got removed from the XFree86 glcore.h file. + * we're removing it here to prevent interop problems. (Brian) + */ /* Pointer to the window system context */ void *wscx; +#endif /* Operating system dependent data goes here */ void *other; -- cgit v1.2.3 From cb4253a546ce65d22c277ba34acebb49f301b0be Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 14 Oct 2002 13:52:27 +0000 Subject: added missing GLX_TRANSPARENT_RGB --- include/GL/glx.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index f0b479c2796..4236ece75af 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,10 +1,10 @@ -/* $Id: glx.h,v 1.37 2002/10/08 22:47:53 brianp Exp $ */ +/* $Id: glx.h,v 1.38 2002/10/14 13:52:27 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 4.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -154,6 +154,7 @@ extern "C" { #define GLX_STATIC_COLOR 0x8005 #define GLX_GRAY_SCALE 0x8006 #define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 #define GLX_TRANSPARENT_INDEX 0x8009 #define GLX_RGBA_TYPE 0x8014 #define GLX_COLOR_INDEX_TYPE 0x8015 -- cgit v1.2.3 From 11fd2d75580d907247b93869ba83b52b2d5a3a7d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 14 Oct 2002 17:12:01 +0000 Subject: disable wsPriv field in __GLdrawablePrivateRec to match XFree86/DRI --- include/GL/internal/glcore.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/GL/internal/glcore.h b/include/GL/internal/glcore.h index 057ad0837ef..f3b180c165c 100644 --- a/include/GL/internal/glcore.h +++ b/include/GL/internal/glcore.h @@ -314,7 +314,9 @@ struct __GLdrawablePrivateRec { void (*unlockDP)(__GLdrawablePrivate *glPriv); /* exported */ +#if 0 /* disable, just like in __GLimportsRec */ void *wsPriv; /* pointer to the window system DrawablePrivate */ +#endif #ifdef __cplusplus void *privatePtr; #else -- cgit v1.2.3 From 3e2fa3fd5cafdc641138844276c4260e028684ac Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Thu, 17 Oct 2002 19:39:31 +0000 Subject: Change for Windows only: Make demos and examples build again. Move the inclusion of windows.h from glext.h to gl.h. There are a few good reasons for this: - Including it in gl.h is more strightforward and makes it easier to troubleshoot include file problems. It was sometimes hard to find it in glext.h. - Needed to define APIENTRY correctly. APIENTRY is used in gl.h. - glut.h needs windows.h but does not include it, expecting the app to include it. Including it in gl.h if not already included by the app makes glut.h happy. This allows one to write a gl/glut app without explictly including windows.h, which may only be really important for toy apps like our samples and demos. But a "real" app can still include windows.h if it wants. --- include/GL/gl.h | 15 ++++++++++++++- include/GL/glext.h | 5 ----- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index bced617f158..44254a77ff6 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.71 2002/09/21 16:47:09 brianp Exp $ */ +/* $Id: gl.h,v 1.72 2002/10/17 19:39:31 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -67,6 +67,19 @@ # define PRAGMA_EXPORT_SUPPORTED 1 #endif +/* + * WINDOWS: Include windows.h here to define APIENTRY. + * It is also useful when applications include this file by + * including only glut.h, since glut.h depends on windows.h. + * Applications needing to include windows.h with parms other + * than "WIN32_LEAN_AND_MEAN" may include windows.h before + * glut.h or gl.h. + */ +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + #if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__) #include #endif diff --git a/include/GL/glext.h b/include/GL/glext.h index 245f100c706..f88d7e79b3a 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -34,11 +34,6 @@ extern "C" { ** version 1.2.1 Specification. */ -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) -#define WIN32_LEAN_AND_MEAN 1 -#include -#endif - #ifndef APIENTRY #define APIENTRY #endif -- cgit v1.2.3 From 6afdc0bec2e75374875578375772aa7776774851 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Thu, 17 Oct 2002 21:03:22 +0000 Subject: Put back the include of windows.h so we are back to version 17 of the file. --- include/GL/glext.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index f88d7e79b3a..245f100c706 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -34,6 +34,11 @@ extern "C" { ** version 1.2.1 Specification. */ +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + #ifndef APIENTRY #define APIENTRY #endif -- cgit v1.2.3 From aa3029bce1bc5bb59e91373d15035653f75d6818 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 5 Nov 2002 20:52:07 +0000 Subject: Updates for DOS driver from Daniel Borca. --- docs/README.DJ | 40 +++---- include/GL/dmesa.h | 18 +-- src/glut/dos/PC_HW/pc_hw.c | 97 ++++++++-------- src/glut/dos/PC_HW/pc_hw.h | 6 +- src/glut/dos/PC_HW/pc_mouse.c | 4 +- src/glut/dos/window.c | 5 +- src/mesa/drivers/dos/dmesa.c | 241 ++++++++++++++++++--------------------- src/mesa/drivers/dos/vesa/vesa.c | 6 +- src/mesa/main/Makefile.DJ | 32 ++++-- 9 files changed, 225 insertions(+), 224 deletions(-) (limited to 'include') diff --git a/docs/README.DJ b/docs/README.DJ index d13779eeaa8..41633b673e9 100644 --- a/docs/README.DJ +++ b/docs/README.DJ @@ -1,4 +1,4 @@ - Mesa 4.0 DOS/DJGPP Port v1.1 + Mesa 4.1 DOS/DJGPP Port v1.2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -6,7 +6,7 @@ Description: ~~~~~~~~~~~~ -Well, guess what... this is the DOS port of Mesa 4.0.4, for DJGPP fans... Whoa! +Well, guess what... this is the DOS port of Mesa 4.1, for DJGPP fans... Whoa! The driver has its origins in ddsample.c, written by Brian Paul and found by me in Mesa 3.4.2. @@ -66,7 +66,7 @@ Tested on: CPU: K6-2 (CXT) @500(412.5) MHz Mainboard: ViA Apollo VP2/97 w/ 128 MB SDRAM Video card: PowerColor Evil King3 (Voodoo3 3000) w/ 16384 kB SDRAM - DJGPP: djdev 2.03 + gcc v3.1 + make v3.79.1 + DJGPP: djdev 2.04 + gcc v3.2 + make v3.79.1 @@ -86,33 +86,27 @@ FAQ: A) You must have the DXE2 package (available on SimTel.Net, courtesy of Andrew Zabolotny) installed in order to build the dynamic modules. - Q) I have DXE2, but I couln'd build the `dxe2gen.exe'. + Q) I have DXE2, but I couldn't build the `dxe2gen.exe'. Q) I built `dxe2gen.exe', but it doesn't do the job right. A) There is a patched version on my web page. Q) DXE2 modules give me headaches... A) The DXE2 modules are not compulsory. The static libraries are still built - and you can use them in the old-fashioned, classic way. For example: + and you can use them in the old-fashioned, classic way... and learn to + live with your ~2MB executable size. For example: gcc -o OUT.exe IN.c -lglut -lglu -lgl Q) Okay, DXE2 modules are built. How can I use them? - A) Usage of the dynamic modules requires three things: - - include DMESADXE.H in one of the sources, so references inside - dynamic modules will get resolved (or use `-include' directive). - - link against import libraries (libI*.a) and LIBDL.A, which will do - the dynamic linkage job for you - - put the DXEs somewhere along the library path (LD_LIBRARY_PATH) or - in the current directory + A) Build your export object file; then link it with your application. For example: - gcc -o OUT.exe -include dmesadxe.h IN.c -ligl -liglu -liglut -ldl + dxe2res -o dmesadxe.c gl.dxe glu.dxe glut.dxe + gcc -o dmesadxe.o dmesadxe.c + gcc -o OUT.exe dmesadxe.o IN.c -liglut -liglu -ligl -ldl - Q) The application dies with "Abort!" due to unresolved symbols. - A) This is bad! Extract the unresolved symbol list from this module. For - example: - dxe2gen --show-unres gl.dxe > u - Check DMESADXE.H; the symbols in `u' must either be present here or be - exported from another module that has to be loaded before your faulting - one. Then recompile. + Q) What is that `dxe2res.exe' thing? + A) That is an utility that generates the export file for a given set of + modules. If you can't find it in the DXE2 package, you must be looking at + the wrong archive :) 3. Using Mesa for DJGPP @@ -138,7 +132,7 @@ FAQ: GLUT took this into account for _WIN32 DLL's only; I don't want to modify his headers. The only workaround is to link GLUT the old way :-( - Q) The DJGPP port of Mesa is so SLOOOW! The Win32 OpenGL performs so much + Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better... A) Is that a question? If you have a Voodoo3/Banshee card, you're lucky. The Glide port is on my web page. If you haven't, sorry; everything is done @@ -196,11 +190,15 @@ History: ~~~~~~~~ v1.0 mar-2002 initial release + v1.1 sep-2002 + added 3dfx Glide3 support + added refresh rate control + added fonts in glut * lots of minor changes +v1.2 nov-2002 * synced w/ Mesa-4.1 + - removed dmesadxe.h + Contact: diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h index ab91bac67d5..d624bb6c828 100644 --- a/include/GL/dmesa.h +++ b/include/GL/dmesa.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 4.0 + * Version: 5.0 * - * Copyright (C) 1999 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.0 for Mesa 4.0 + * DOS/DJGPP device driver v1.2 for Mesa 4.1 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -31,10 +31,10 @@ */ -#ifndef DMESA_included -#define DMESA_included +#ifndef DMESA_H_included +#define DMESA_H_included -#define DMESA_MAJOR_VERSION 4 +#define DMESA_MAJOR_VERSION 5 #define DMESA_MINOR_VERSION 0 typedef struct dmesa_context *DMesaContext; @@ -45,8 +45,10 @@ typedef struct dmesa_buffer *DMesaBuffer; extern "C" { #endif -DMesaVisual DMesaCreateVisual (GLint width, GLint height, GLint colDepth, - GLboolean dbFlag, GLint depthSize, +DMesaVisual DMesaCreateVisual (GLint width, GLint height, + GLint colDepth, + GLboolean dbFlag, + GLint depthSize, GLint stencilSize, GLint accumSize); diff --git a/src/glut/dos/PC_HW/pc_hw.c b/src/glut/dos/PC_HW/pc_hw.c index 09ab4614049..9b30c5808c1 100644 --- a/src/glut/dos/PC_HW/pc_hw.c +++ b/src/glut/dos/PC_HW/pc_hw.c @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v1.0 for DOS/DJGPP + * PC/HW routine collection v1.2 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -12,7 +12,6 @@ #include /* for mode definitions */ #include #include -#include #include #include "pc_hw.h" @@ -74,68 +73,76 @@ void *pc_malloc (size_t size) /* * standard redirection */ -static char errname[L_tmpnam]; -static char outname[L_tmpnam]; +static int h_out, h_outbak, h_err, h_errbak; -static int h_out, h_outbak; -static int h_err, h_errbak; - -void pc_open_stderr (void) +int pc_open_stdout (void) { - if (tmpnam(errname)) { - h_err = open(errname, O_WRONLY |/* O_BINARY |*/ O_CREAT | O_TRUNC, - S_IREAD | S_IWRITE); - h_errbak = dup(2); - fflush(stderr); - dup2(h_err, 2); + if ((h_out=open(tmpnam(NULL), O_WRONLY | O_CREAT | O_TRUNC | O_TEXT | O_TEMPORARY, S_IRUSR | S_IWUSR)) >= 0) { + if ((h_outbak=dup(1)) != -1) { + fflush(stdout); + if (dup2(h_out, 1) != -1) { + return 0; + } + close(h_outbak); + } + close(h_out); } + return (h_out = -1); } -void pc_close_stderr (void) +void pc_close_stdout (void) { FILE *f; char *line = alloca(512); - - dup2(h_errbak, 2); - close(h_err); - close(h_errbak); - - if ((f=fopen(errname, "r"))!=NULL) { - while (fgets(line, 512, f)) { - fputs(line, stderr); + + if (h_out >= 0) { + dup2(h_outbak, 1); + close(h_outbak); + + if ((f=fdopen(h_out, "r")) != NULL) { + fseek(f, 0, SEEK_SET); + while (fgets(line, 512, f)) { + fputs(line, stdout); + } + fclose(f); + } else { + close(h_out); } - fclose(f); } - - remove(errname); } -void pc_open_stdout (void) +int pc_open_stderr (void) { - if (tmpnam(outname)) { - h_out = open(outname, O_WRONLY |/* O_BINARY |*/ O_CREAT | O_TRUNC, - S_IREAD | S_IWRITE); - h_outbak = dup(1); - fflush(stdout); - dup2(h_out, 1); + if ((h_err=open(tmpnam(NULL), O_WRONLY | O_CREAT | O_TRUNC | O_TEXT | O_TEMPORARY, S_IRUSR | S_IWUSR)) >= 0) { + if ((h_errbak=dup(2)) != -1) { + fflush(stderr); + if (dup2(h_err, 2) != -1) { + return 0; + } + close(h_errbak); + } + close(h_err); } + return (h_err = -1); } -void pc_close_stdout (void) +void pc_close_stderr (void) { FILE *f; char *line = alloca(512); - - dup2(h_outbak, 1); - close(h_out); - close(h_outbak); - - if ((f=fopen(outname, "r"))!=NULL) { - while (fgets(line, 512, f)) { - fputs(line, stdout); + + if (h_err >= 0) { + dup2(h_errbak, 2); + close(h_errbak); + + if ((f=fdopen(h_err, "r")) != NULL) { + fseek(f, 0, SEEK_SET); + while (fgets(line, 512, f)) { + fputs(line, stderr); + } + fclose(f); + } else { + close(h_err); } - fclose(f); } - - remove(outname); } diff --git a/src/glut/dos/PC_HW/pc_hw.h b/src/glut/dos/PC_HW/pc_hw.h index fd0e777953d..77572e64414 100644 --- a/src/glut/dos/PC_HW/pc_hw.h +++ b/src/glut/dos/PC_HW/pc_hw.h @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v1.1 for DOS/DJGPP + * PC/HW routine collection v1.2 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -217,8 +217,8 @@ void pc_unscare_mouse (void); /* * standard redirection */ -void pc_open_stdout (void); -void pc_open_stderr (void); +int pc_open_stdout (void); +int pc_open_stderr (void); void pc_close_stdout (void); void pc_close_stderr (void); diff --git a/src/glut/dos/PC_HW/pc_mouse.c b/src/glut/dos/PC_HW/pc_mouse.c index 5a04cf21913..01e9502dd0c 100644 --- a/src/glut/dos/PC_HW/pc_mouse.c +++ b/src/glut/dos/PC_HW/pc_mouse.c @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v1.1 for DOS/DJGPP + * PC/HW routine collection v1.2 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -226,6 +226,7 @@ void pc_unscare_mouse (void) } __asm("\n\ + .text \n\ .balign 4 \n\ .global _mouse_wrapper \n\ _mouse_wrapper: \n\ @@ -252,7 +253,6 @@ _mouse_wrapper: \n\ movl %esi, %esp \n\ popl %es \n\ iret \n\ - \n\ .balign 4 \n\ .global _mouse_wrapper_end \n\ _mouse_wrapper_end:"); diff --git a/src/glut/dos/window.c b/src/glut/dos/window.c index 384e10a03b8..ba0f5acee5c 100644 --- a/src/glut/dos/window.c +++ b/src/glut/dos/window.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 4.0 + * Version: 4.1 * Copyright (C) 1995-1998 Brian Paul * * This library is free software; you can redistribute it and/or @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.1 for Mesa 4.0 + * DOS/DJGPP glut driver v1.2 for Mesa 4.1 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -113,6 +113,7 @@ int APIENTRY glutCreateWindow (const char *title) if ((context=fxMesaCreateBestContext(-1, screen_w, screen_h, fx_attrib))==NULL) { return 0; } + visual = context; #endif pc_open_stdout(); diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index 474d1336e3d..77c9a3a1b85 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 4.0 + * Version: 4.1 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.1 for Mesa 4.0 + * DOS/DJGPP device driver v1.2 for Mesa 4.1 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -94,25 +94,16 @@ struct dmesa_context { -static void dmesa_update_state (GLcontext *ctx, GLuint new_state); - - - -/**********************************************************************/ -/***** Read/Write pixels *****/ -/**********************************************************************/ - - - +/**************************************************************************** + * Read/Write pixels + ***************************************************************************/ #define FLIP(y) (c->Buffer->height - (y) - 1) #define FLIP2(y) (h - (y) - 1) - - static void write_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[]) { - DMesaContext c = (DMesaContext)ctx->DriverCtx; + const DMesaContext c = (DMesaContext)ctx->DriverCtx; void *b = c->Buffer->the_window; GLuint i, offset; @@ -132,10 +123,12 @@ static void write_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, } } + + static void write_rgb_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgb[][3], const GLubyte mask[]) { - DMesaContext c = (DMesaContext)ctx->DriverCtx; + const DMesaContext c = (DMesaContext)ctx->DriverCtx; void *b = c->Buffer->the_window; GLuint i, offset; @@ -155,11 +148,13 @@ static void write_rgb_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, } } + + static void write_mono_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLchan color[4], const GLubyte mask[]) { - DMesaContext c = (DMesaContext)ctx->DriverCtx; + const DMesaContext c = (DMesaContext)ctx->DriverCtx; void *b = c->Buffer->the_window; GLuint i, offset, rgba = vl_mixrgba(color); @@ -179,10 +174,12 @@ static void write_mono_rgba_span (const GLcontext *ctx, } } + + static void read_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4]) { - DMesaContext c = (DMesaContext)ctx->DriverCtx; + const DMesaContext c = (DMesaContext)ctx->DriverCtx; void *b = c->Buffer->the_window; GLuint i, offset; @@ -193,11 +190,13 @@ static void read_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, } } + + static void write_rgba_pixels (const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[]) { - DMesaContext c = (DMesaContext)ctx->DriverCtx; + const DMesaContext c = (DMesaContext)ctx->DriverCtx; void *b = c->Buffer->the_window; GLuint i, w = c->Buffer->width, h = c->Buffer->height; @@ -216,11 +215,13 @@ static void write_rgba_pixels (const GLcontext *ctx, } } + + static void write_mono_rgba_pixels (const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLchan color[4], const GLubyte mask[]) { - DMesaContext c = (DMesaContext)ctx->DriverCtx; + const DMesaContext c = (DMesaContext)ctx->DriverCtx; void *b = c->Buffer->the_window; GLuint i, w = c->Buffer->width, h = c->Buffer->height, rgba = vl_mixrgba(color); @@ -239,11 +240,13 @@ static void write_mono_rgba_pixels (const GLcontext *ctx, } } + + static void read_rgba_pixels (const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[]) { - DMesaContext c = (DMesaContext)ctx->DriverCtx; + const DMesaContext c = (DMesaContext)ctx->DriverCtx; void *b = c->Buffer->the_window; GLuint i, w = c->Buffer->width, h = c->Buffer->height; @@ -264,11 +267,9 @@ static void read_rgba_pixels (const GLcontext *ctx, -/**********************************************************************/ -/***** Optimized triangle rendering *****/ -/**********************************************************************/ - - +/**************************************************************************** + * Optimized triangle rendering + ***************************************************************************/ /* * flat, NON-depth-buffered, triangle. @@ -278,7 +279,7 @@ static void tri_rgb_flat (GLcontext *ctx, const SWvertex *v1, const SWvertex *v2) { - DMesaContext c = (DMesaContext)ctx->DriverCtx; + const DMesaContext c = (DMesaContext)ctx->DriverCtx; void *b = c->Buffer->the_window; GLuint w = c->Buffer->width, h = c->Buffer->height; @@ -286,7 +287,7 @@ static void tri_rgb_flat (GLcontext *ctx, #define RENDER_SPAN(span) \ GLuint i, offset = FLIP2(span.y)*w + span.x; \ - for (i = 0; i < span.count; i++, offset++) { \ + for (i = 0; i < span.end; i++, offset++) { \ vl_putpixel(b, offset, rgb); \ } @@ -303,7 +304,7 @@ static void tri_rgb_flat_z (GLcontext *ctx, const SWvertex *v1, const SWvertex *v2) { - DMesaContext c = (DMesaContext)ctx->DriverCtx; + const DMesaContext c = (DMesaContext)ctx->DriverCtx; void *b = c->Buffer->the_window; GLuint w = c->Buffer->width, h = c->Buffer->height; @@ -313,7 +314,7 @@ static void tri_rgb_flat_z (GLcontext *ctx, #define RENDER_SPAN(span) \ GLuint i, offset = FLIP2(span.y)*w + span.x; \ - for (i = 0; i < span.count; i++, offset++) { \ + for (i = 0; i < span.end; i++, offset++) { \ const DEPTH_TYPE z = FixedToDepth(span.z); \ if (z < zRow[i]) { \ vl_putpixel(b, offset, rgb); \ @@ -335,14 +336,14 @@ static void tri_rgb_smooth (GLcontext *ctx, const SWvertex *v1, const SWvertex *v2) { - DMesaContext c = (DMesaContext)ctx->DriverCtx; + const DMesaContext c = (DMesaContext)ctx->DriverCtx; void *b = c->Buffer->the_window; GLuint w = c->Buffer->width, h = c->Buffer->height; #define INTERP_RGB 1 #define RENDER_SPAN(span) \ GLuint i, offset = FLIP2(span.y)*w + span.x; \ - for (i = 0; i < span.count; i++, offset++) { \ + for (i = 0; i < span.end; i++, offset++) { \ unsigned char rgb[3]; \ rgb[0] = FixedToInt(span.red); \ rgb[1] = FixedToInt(span.green); \ @@ -366,7 +367,7 @@ static void tri_rgb_smooth_z (GLcontext *ctx, const SWvertex *v1, const SWvertex *v2) { - DMesaContext c = (DMesaContext)ctx->DriverCtx; + const DMesaContext c = (DMesaContext)ctx->DriverCtx; void *b = c->Buffer->the_window; GLuint w = c->Buffer->width, h = c->Buffer->height; @@ -376,7 +377,7 @@ static void tri_rgb_smooth_z (GLcontext *ctx, #define RENDER_SPAN(span) \ GLuint i, offset = FLIP2(span.y)*w + span.x; \ - for (i = 0; i < span.count; i++, offset++) { \ + for (i = 0; i < span.end; i++, offset++) { \ const DEPTH_TYPE z = FixedToDepth(span.z); \ if (z < zRow[i]) { \ unsigned char rgb[3]; \ @@ -455,15 +456,13 @@ static void dmesa_choose_tri (GLcontext *ctx) -/**********************************************************************/ -/***** Miscellaneous device driver funcs *****/ -/**********************************************************************/ +/**************************************************************************** + * Miscellaneous device driver funcs + ***************************************************************************/ - - -static void clear_color (GLcontext *ctx, const GLchan color[4]) +static void clear_color (GLcontext *ctx, const GLfloat color[4]) { - const GLubyte col[4]; + GLubyte col[4]; DMesaContext c = (DMesaContext)ctx->DriverCtx; CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); @@ -477,7 +476,7 @@ static void clear_color (GLcontext *ctx, const GLchan color[4]) static void clear (GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height) { - DMesaContext c = (DMesaContext)ctx->DriverCtx; + const DMesaContext c = (DMesaContext)ctx->DriverCtx; const GLuint *colorMask = (GLuint *)&ctx->Color.ColorMask; DMesaBuffer b = c->Buffer; @@ -508,27 +507,29 @@ static void clear (GLcontext *ctx, GLbitfield mask, GLboolean all, -/* - * Set the current reading buffer. - */ -static void set_read_buffer (GLcontext *ctx, GLframebuffer *buffer, - GLenum mode) +static void color_mask (GLcontext *ctx, GLboolean rmask, GLboolean gmask, GLboolean bmask, GLboolean amask) { - /* - XXX this has to be fixed - */ + /* + * XXX todo - Implements glColorMask() + */ } -/* - * Set the destination/draw buffer. - */ -static void set_draw_buffer (GLcontext *ctx, GLenum mode) +static void set_buffer (GLcontext *ctx, GLframebuffer *colorBuffer, GLuint bufferBit) { - /* - XXX this has to be fixed - */ + /* + * XXX todo - examine bufferBit and set read/write pointers + */ +} + + + +static void enable (GLcontext *ctx, GLenum pname, GLboolean state) +{ + /* + * XXX todo - + */ } @@ -552,7 +553,7 @@ static const GLubyte* get_string (GLcontext *ctx, GLenum name) { switch (name) { case GL_RENDERER: - return (const GLubyte *)"Mesa DJGPP\0port (c) Borca Daniel 3-sep-2002"; + return (const GLubyte *)"Mesa DJGPP\0port (c) Borca Daniel nov-2002"; default: return NULL; } @@ -560,38 +561,27 @@ static const GLubyte* get_string (GLcontext *ctx, GLenum name) -/**********************************************************************/ -/***** Miscellaneous device driver funcs *****/ -/***** Note that these functions are mandatory *****/ -/**********************************************************************/ - - - -/* OPTIONAL FUNCTION: implements glFinish if possible */ static void finish (GLcontext *ctx) { -/* - DMesaContext c = (DMesaContext)ctx->DriverCtx; -*/ + /* + * XXX todo - OPTIONAL FUNCTION: implements glFinish if possible + */ } -/* OPTIONAL FUNCTION: implements glFlush if possible */ static void flush (GLcontext *ctx) { -/* - DMesaContext c = (DMesaContext)ctx->DriverCtx; -*/ + /* + * XXX todo - OPTIONAL FUNCTION: implements glFlush if possible + */ } -/**********************************************************************/ -/**********************************************************************/ - - - +/**************************************************************************** + * State + ***************************************************************************/ #define DMESA_NEW_TRIANGLE (_NEW_POLYGON | \ _NEW_TEXTURE | \ _NEW_LIGHT | \ @@ -599,8 +589,6 @@ static void flush (GLcontext *ctx) _NEW_RENDERMODE | \ _SWRAST_NEW_RASTERMASK) - - /* Extend the software rasterizer with our line and triangle * functions. */ @@ -618,11 +606,10 @@ static void dmesa_register_swrast_functions (GLcontext *ctx) /* Setup pointers and other driver state that is constant for the life * of a context. */ -void dmesa_init_pointers (GLcontext *ctx) +static void dmesa_init_pointers (GLcontext *ctx) { TNLcontext *tnl; - - ctx->Driver.UpdateState = dmesa_update_state; + struct swrast_device_driver *dd = _swrast_GetDeviceDriverReference(ctx); ctx->Driver.GetString = get_string; ctx->Driver.GetBufferSize = get_buffer_size; @@ -638,6 +625,7 @@ void dmesa_init_pointers (GLcontext *ctx) ctx->Driver.CopyPixels = _swrast_CopyPixels; ctx->Driver.DrawPixels = _swrast_DrawPixels; ctx->Driver.ReadPixels = _swrast_ReadPixels; + ctx->Driver.DrawBuffer = _swrast_DrawBuffer; /* Software texture functions: */ @@ -650,6 +638,12 @@ void dmesa_init_pointers (GLcontext *ctx) ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; + ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; + ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; + ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; + ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; + ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; + ctx->Driver.CompressedTexImage1D = _mesa_store_compressed_teximage1d; ctx->Driver.CompressedTexImage2D = _mesa_store_compressed_teximage2d; ctx->Driver.CompressedTexImage3D = _mesa_store_compressed_teximage3d; @@ -657,12 +651,6 @@ void dmesa_init_pointers (GLcontext *ctx) ctx->Driver.CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d; ctx->Driver.CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d; - ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; - ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; - ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; - ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; - ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; - /* Swrast hooks for imaging extensions: */ ctx->Driver.CopyColorTable = _swrast_CopyColorTable; @@ -672,13 +660,16 @@ void dmesa_init_pointers (GLcontext *ctx) /* Statechange callbacks: */ - ctx->Driver.SetDrawBuffer = set_draw_buffer; ctx->Driver.ClearColor = clear_color; + ctx->Driver.ColorMask = color_mask; + ctx->Driver.Enable = enable; /* Initialize the TNL driver interface: */ tnl = TNL_CONTEXT(ctx); tnl->Driver.RunPipeline = _tnl_run_pipeline; + + dd->SetBuffer = set_buffer; /* Install swsetup for tnl->Driver.Render.*: */ @@ -689,36 +680,31 @@ void dmesa_init_pointers (GLcontext *ctx) static void dmesa_update_state (GLcontext *ctx, GLuint new_state) { - DMesaContext c = (DMesaContext)ctx->DriverCtx; - struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); + struct swrast_device_driver *dd = _swrast_GetDeviceDriverReference(ctx); - /* Initialize all the pointers in the DD struct. Do this whenever */ - /* a new context is made current or we change buffers via set_buffer! */ - - _swrast_InvalidateState(ctx, new_state); - _swsetup_InvalidateState(ctx, new_state); - _ac_InvalidateState(ctx, new_state); - _tnl_InvalidateState(ctx, new_state); - - swdd->SetReadBuffer = set_read_buffer; + /* Propogate statechange information to swrast and swrast_setup + * modules. The DMesa driver has no internal GL-dependent state. + */ + _swrast_InvalidateState( ctx, new_state ); + _ac_InvalidateState( ctx, new_state ); + _tnl_InvalidateState( ctx, new_state ); + _swsetup_InvalidateState( ctx, new_state ); /* RGB(A) span/pixel functions */ - swdd->WriteRGBASpan = write_rgba_span; - swdd->WriteRGBSpan = write_rgb_span; - swdd->WriteMonoRGBASpan = write_mono_rgba_span; - swdd->WriteRGBAPixels = write_rgba_pixels; - swdd->WriteMonoRGBAPixels = write_mono_rgba_pixels; - swdd->ReadRGBASpan = read_rgba_span; - swdd->ReadRGBAPixels = read_rgba_pixels; + dd->WriteRGBASpan = write_rgba_span; + dd->WriteRGBSpan = write_rgb_span; + dd->WriteMonoRGBASpan = write_mono_rgba_span; + dd->WriteRGBAPixels = write_rgba_pixels; + dd->WriteMonoRGBAPixels = write_mono_rgba_pixels; + dd->ReadRGBASpan = read_rgba_span; + dd->ReadRGBAPixels = read_rgba_pixels; } -/**********************************************************************/ -/***** DMesa Public API Functions *****/ -/**********************************************************************/ - - +/**************************************************************************** + * DMesa Public API Functions + ***************************************************************************/ /* * The exact arguments to this function will depend on your window system @@ -731,15 +717,13 @@ DMesaVisual DMesaCreateVisual (GLint width, GLint height, GLint colDepth, DMesaVisual v; GLint redBits, greenBits, blueBits, alphaBits; - int refresh; char *var = getenv("DMESA_REFRESH"); - if ((var == NULL) || ((refresh=atoi(var)) == 0)) { - refresh = 60; - } + int refresh = (var != NULL) ? atoi(var) : 0; if (!dbFlag) { return NULL; } + alphaBits = 0; switch (colDepth) { case 15: @@ -767,7 +751,7 @@ DMesaVisual DMesaCreateVisual (GLint width, GLint height, GLint colDepth, return NULL; } - if ((v=(DMesaVisual)calloc(1, sizeof(struct dmesa_visual)))!=NULL) { + if ((v=(DMesaVisual)calloc(1, sizeof(struct dmesa_visual))) != NULL) { /* Create core visual */ v->gl_visual = _mesa_create_visual(colDepth>8, /* rgb */ dbFlag, @@ -809,7 +793,7 @@ DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, { DMesaBuffer b; - if ((b=(DMesaBuffer)calloc(1, sizeof(struct dmesa_buffer)))!=NULL) { + if ((b=(DMesaBuffer)calloc(1, sizeof(struct dmesa_buffer))) != NULL) { _mesa_initialize_framebuffer(&b->gl_buffer, visual->gl_visual, @@ -844,7 +828,7 @@ DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext c; GLboolean direct = GL_FALSE; - if ((c=(DMesaContext)calloc(1, sizeof(struct dmesa_context)))!=NULL) { + if ((c=(DMesaContext)calloc(1, sizeof(struct dmesa_context))) != NULL) { c->gl_ctx = _mesa_create_context(visual->gl_visual, share ? share->gl_ctx : NULL, (void *)c, direct); @@ -852,17 +836,19 @@ DMesaContext DMesaCreateContext (DMesaVisual visual, _mesa_enable_sw_extensions(c->gl_ctx); _mesa_enable_1_3_extensions(c->gl_ctx); - /* you probably have to do a bunch of other initializations here. */ + /* you probably have to do a bunch of other initializations here. */ c->visual = visual; - /* Initialize the software rasterizer and helper modules. - */ + c->gl_ctx->Driver.UpdateState = dmesa_update_state; + + /* Initialize the software rasterizer and helper modules. + */ _swrast_CreateContext(c->gl_ctx); _ac_CreateContext(c->gl_ctx); _tnl_CreateContext(c->gl_ctx); _swsetup_CreateContext(c->gl_ctx); - dmesa_init_pointers(c->gl_ctx); dmesa_register_swrast_functions(c->gl_ctx); + dmesa_init_pointers(c->gl_ctx); } return c; @@ -884,7 +870,7 @@ GLboolean DMesaViewport (DMesaBuffer b, { void *new_window; - if ((new_window=vl_sync_buffer(b->the_window, xpos, ypos, width, height))==NULL) { + if ((new_window=vl_sync_buffer(b->the_window, xpos, ypos, width, height)) == NULL) { return GL_FALSE; } else { b->the_window = new_window; @@ -905,16 +891,15 @@ GLboolean DMesaViewport (DMesaBuffer b, */ GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b) { - if (c&&b) { + if ((c != NULL) && (b != NULL)) { if (!DMesaViewport(b, b->xpos, b->ypos, b->width, b->height)) { return GL_FALSE; } c->Buffer = b; - dmesa_update_state(c->gl_ctx, 0); _mesa_make_current(c->gl_ctx, &b->gl_buffer); - if (c->gl_ctx->Viewport.Width==0) { + if (c->gl_ctx->Viewport.Width == 0) { /* initialize viewport to window size */ _mesa_Viewport(0, 0, b->width, b->height); } diff --git a/src/mesa/drivers/dos/vesa/vesa.c b/src/mesa/drivers/dos/vesa/vesa.c index c43b6ec4284..8dbeb9e52c4 100644 --- a/src/mesa/drivers/dos/vesa/vesa.c +++ b/src/mesa/drivers/dos/vesa/vesa.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 4.0 + * Version: 4.1 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.1 for Mesa 4.0 + * DOS/DJGPP device driver v1.2 for Mesa 4.1 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -337,7 +337,7 @@ static int vesa_entermode (vl_mode *p, int refresh) r.x.ax = 0x4f02; r.x.bx = p->mode; - if ((vesa_ver>>8) >= 3) { + if (refresh && ((vesa_ver>>8) >= 3)) { /* VESA 3.0 stuff for controlling the refresh rate */ CRTCInfoBlock crtc; unsigned long vclk; diff --git a/src/mesa/main/Makefile.DJ b/src/mesa/main/Makefile.DJ index 528c71dd5a8..b9e0024ad73 100644 --- a/src/mesa/main/Makefile.DJ +++ b/src/mesa/main/Makefile.DJ @@ -20,7 +20,7 @@ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# DOS/DJGPP core makefile v1.1 for Mesa 4.0 +# DOS/DJGPP core makefile v1.2 for Mesa 4.1 # # Copyright (C) 2002 - Borca Daniel # Email : dborca@yahoo.com @@ -59,6 +59,7 @@ .PHONY: all clean +.INTERMEDIATE: X86/gen_matypes.exe TOP = .. GLIDE ?= $(TOP)/include/glide3 @@ -83,9 +84,6 @@ endif RM = del CORE_SOURCES = \ - swrast_setup/ss_context.c \ - swrast_setup/ss_triangle.c \ - swrast_setup/ss_vb.c \ api_arrayelt.c \ api_loopback.c \ api_noop.c \ @@ -96,7 +94,6 @@ CORE_SOURCES = \ buffers.c \ clip.c \ colortab.c \ - config.c \ context.c \ convolve.c \ debug.c \ @@ -136,16 +133,17 @@ CORE_SOURCES = \ texstore.c \ texutil.c \ varray.c \ + vpexec.c \ + vpparse.c \ + vpstate.c \ vtxfmt.c \ math/m_debug_clip.c \ math/m_debug_norm.c \ - math/m_debug_vertex.c \ math/m_debug_xform.c \ math/m_eval.c \ math/m_matrix.c \ math/m_translate.c \ math/m_vector.c \ - math/m_vertices.c \ math/m_xform.c \ array_cache/ac_context.c \ array_cache/ac_import.c \ @@ -168,17 +166,18 @@ CORE_SOURCES = \ swrast/s_lines.c \ swrast/s_logic.c \ swrast/s_masking.c \ - swrast/s_pb.c \ swrast/s_pixeltex.c \ swrast/s_points.c \ swrast/s_readpix.c \ - swrast/s_scissor.c \ swrast/s_span.c \ swrast/s_stencil.c \ swrast/s_texture.c \ swrast/s_texstore.c \ swrast/s_triangle.c \ swrast/s_zoom.c \ + swrast_setup/ss_context.c \ + swrast_setup/ss_triangle.c \ + swrast_setup/ss_vb.c \ tnl/t_array_api.c \ tnl/t_array_import.c \ tnl/t_context.c \ @@ -196,6 +195,7 @@ CORE_SOURCES = \ tnl/t_vb_light.c \ tnl/t_vb_normals.c \ tnl/t_vb_points.c \ + tnl/t_vb_program.c \ tnl/t_vb_render.c \ tnl/t_vb_texgen.c \ tnl/t_vb_texmat.c \ @@ -209,7 +209,6 @@ X86_SOURCES = \ X86/x86_xform2.S \ X86/x86_xform3.S \ X86/x86_xform4.S \ - X86/x86_vertex.S \ X86/x86_cliptest.S MMX_SOURCES = \ @@ -220,7 +219,6 @@ SSE_SOURCES = \ X86/sse_xform2.S \ X86/sse_xform3.S \ X86/sse_xform4.S \ - X86/sse_vertex.S \ X86/sse_normal.S K3D_SOURCES = \ @@ -228,7 +226,7 @@ K3D_SOURCES = \ X86/3dnow_xform2.S \ X86/3dnow_xform3.S \ X86/3dnow_xform4.S \ - X86/3dnow_vertex.S + X86/3dnow_normal.S ifdef HAVE_MMX X86_SOURCES += $(MMX_SOURCES) @@ -275,6 +273,8 @@ SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(DRIVER_SOURCES) OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) +X86_OBJECTS = $(addsuffix .o,$(basename $(X86_SOURCES))) + .c.o: $(CC) -o $@ -c $(CFLAGS) $< .S.o: @@ -295,6 +295,14 @@ else -dxe2gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) $(OBJECTS) -E djgpp_ -E gl -E DMesa -E fxMesa -D "Mesa DJGPP GL" -U endif +$(X86_OBJECTS): X86/matypes.h + +X86/matypes.h: X86/gen_matypes.exe + $< > $@ + +X86/gen_matypes.exe: X86/gen_matypes.c + $(CC) -o $@ $(CFLAGS) -s $< + clean: -$(RM) $(subst /,\,*.o) -$(RM) $(subst /,\,array_cache/*.o) -- cgit v1.2.3 From 03516d9efa76720be2b0b8677573a5f93845c2da Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 18 Dec 2002 15:06:36 +0000 Subject: DOS updates from Daniel Borca. --- docs/README.DJ | 150 +++++----- include/GL/dmesa.h | 82 +++++- src/glu/mesa/Makefile.DJ | 18 +- src/glu/sgi/Makefile.DJ | 187 ++++++++++++ src/glut/dos/Makefile.DJ | 56 ++-- src/glut/dos/PC_HW/pc_hw.c | 84 +++--- src/glut/dos/color.c | 14 +- src/glut/dos/globals.c | 8 +- src/glut/dos/init.c | 11 +- src/glut/dos/internal.h | 6 +- src/glut/dos/state.c | 6 +- src/glut/dos/window.c | 63 +---- src/mesa/drivers/dos/dmesa.c | 593 ++++++++++++++++++++++++++++----------- src/mesa/drivers/dos/dpmi.c | 4 +- src/mesa/drivers/dos/internal.h | 127 +++++++++ src/mesa/drivers/dos/vesa/vesa.c | 201 ++++++++++--- src/mesa/drivers/dos/vesa/vesa.h | 8 +- src/mesa/drivers/dos/video.c | 350 ++++++++++++++++++----- src/mesa/drivers/dos/video.h | 27 +- src/mesa/drivers/dos/virtual.S | 469 ++++++++++++++++++++++++------- src/mesa/main/Makefile.DJ | 36 ++- 21 files changed, 1846 insertions(+), 654 deletions(-) create mode 100644 src/glu/sgi/Makefile.DJ create mode 100644 src/mesa/drivers/dos/internal.h (limited to 'include') diff --git a/docs/README.DJ b/docs/README.DJ index 41633b673e9..580228234ab 100644 --- a/docs/README.DJ +++ b/docs/README.DJ @@ -1,4 +1,4 @@ - Mesa 4.1 DOS/DJGPP Port v1.2 + Mesa 5.0 DOS/DJGPP Port v1.3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -6,7 +6,7 @@ Description: ~~~~~~~~~~~~ -Well, guess what... this is the DOS port of Mesa 4.1, for DJGPP fans... Whoa! +Well, guess what... this is the DOS port of Mesa 5.0, for DJGPP fans... Whoa! The driver has its origins in ddsample.c, written by Brian Paul and found by me in Mesa 3.4.2. @@ -34,6 +34,8 @@ Available options: default = k6 BIG_OPT=1 crazy optimizations; not very useful, though... default = no + SGI_GLU=1 build SGI's GLU instead of Mesa's. + default = no GLIDE absolute path to Glide library; used with FX. default = $(TOP)/include/glide3 FX=1 build for 3dfx Glide3; use it if you have the Glide @@ -65,8 +67,9 @@ Available options: Tested on: CPU: K6-2 (CXT) @500(412.5) MHz Mainboard: ViA Apollo VP2/97 w/ 128 MB SDRAM - Video card: PowerColor Evil King3 (Voodoo3 3000) w/ 16384 kB SDRAM + Video card: PowerColor EvilKing3 (Voodoo3 3000 PCI) w/ 16 MB SDRAM DJGPP: djdev 2.04 + gcc v3.2 + make v3.79.1 + OS: DOS and Win9x @@ -83,46 +86,34 @@ FAQ: 2. Dynamic modules Q) What are you mumbling about dynamic modules? - A) You must have the DXE2 package (available on SimTel.Net, courtesy of - Andrew Zabolotny) installed in order to build the dynamic modules. - - Q) I have DXE2, but I couldn't build the `dxe2gen.exe'. - Q) I built `dxe2gen.exe', but it doesn't do the job right. - A) There is a patched version on my web page. + A) You must have the DXE3 package (available on my site) installed in order + to build the dynamic modules. - Q) DXE2 modules give me headaches... - A) The DXE2 modules are not compulsory. The static libraries are still built + Q) DXE3 modules give me headaches... + A) The DXE3 modules are not compulsory. The static libraries are still built and you can use them in the old-fashioned, classic way... and learn to - live with your ~2MB executable size. For example: + live with your huge executable size. For example: gcc -o OUT.exe IN.c -lglut -lglu -lgl - Q) Okay, DXE2 modules are built. How can I use them? + Q) Okay, DXE3 modules are built. How can I use them? A) Build your export object file; then link it with your application. For example: - dxe2res -o dmesadxe.c gl.dxe glu.dxe glut.dxe - gcc -o dmesadxe.o dmesadxe.c + dxe3res -o dmesadxe.c gl.dxe glu.dxe glut.dxe + gcc -o dmesadxe.o -c -fno-builtin dmesadxe.c gcc -o OUT.exe dmesadxe.o IN.c -liglut -liglu -ligl -ldl - Q) What is that `dxe2res.exe' thing? - A) That is an utility that generates the export file for a given set of - modules. If you can't find it in the DXE2 package, you must be looking at - the wrong archive :) - 3. Using Mesa for DJGPP - Q) Does this build work in Win9x? - A) Yes. - - Q) Does it work under NT (W2k, XP) core? - A) Uh... probably not! + Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better... + A) Is that a question? If you have a Voodoo3/Banshee card, you're lucky. The + Glide port is on my web page. If you haven't, sorry; everything is done + in software. Suggestions? Q) I made a simple application and it does nothing. It exits right away. Not even a blank screen. - A) The current version supports only RGB[A] modes, for it made no sense to - me to endorse color-index (aka palette) modes. A) Single-buffered is not allowed at all. Until I can find a way to use *REAL* hardware acceleration, it won't get implemented. - A) Another weird "feature" is that buffer width must be multiple of 4 (I'm a + A) Another weird "feature" is that buffer width must be multiple of 8 (I'm a lazy programmer and I found that the easiest way to keep buffer handling at peak performance ;-). @@ -132,18 +123,12 @@ FAQ: GLUT took this into account for _WIN32 DLL's only; I don't want to modify his headers. The only workaround is to link GLUT the old way :-( - Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much - better... - A) Is that a question? If you have a Voodoo3/Banshee card, you're lucky. The - Glide port is on my web page. If you haven't, sorry; everything is done - in software. Suggestions? + Q) I tried to set refresh rate w/ DMesa, but without success. + A) Refresh rate control works only for VESA 3.0. If you were compiling for + Glide, see Glide info. If not, sorry! - Q) I have a super/mega/ultra monitor and all you can do is 60Hz? My eyes are - leaking from the orbits... - A) If you were compiling for Glide, see Glide info. If not, be aware that - refresh rate control works only for VESA 3.0. The environment variable - DMESA_REFRESH sets the default screen refresh. For example: - set DMESA_REFRESH=75 + Q) The GLUT is incomplete. + A) See below. @@ -152,52 +137,71 @@ libGLUT (the toolkit): Well, this "skeletal" GLUT implementation is not mine. Thanks should go to Bernhard Tschirren, Mark Kilgard, Brian Paul and probably others (or probably -not ;-). I only changed it to be self-standing (Allegro-free). The keyboard, -mouse and timer drivers were inspired from an old project of mine (D3Xl) and -fixed with many Allegro "infusions"; I deeply thank to Shawn Hargreaves et co. - -My keyboard driver used only scancodes, but since GLUT requires ASCII values -for keys, I borrowed the translation tables (and maybe more) from Allegro. -Ctrl-Alt-Del (plus Ctrl-Alt-End, for Windows users) will shut down the GLUT -engine unconditionally: it will raise SIGINT, which in turn will call the -destructors (let's hope), thus cleaning up your/my mess ;-) NB: since the -DJGPP guys ensured signal handlers won't go beyond program's space (and since -dynamic modules shall) the SIGINT can't be hooked (well, it can, but it is -useless), therefore you must live with the 'Exiting due to signal SIGINT' -message... - -The mouse driver is far from complete (lack of positioning, drawing, etc), -but is enough to make almost all the demos work. +not ;-). GLUT functionality will be extended only on an "as needed" basis. + +My keyboard driver used only scancodes; as GLUT requires ASCII values for keys, +I borrowed the translation tables (and maybe more) from Allegro -- many thanks +to Shawn Hargreaves et co. Ctrl-Alt-Del (plus Ctrl-Alt-End, for Windows users) +will shut down the GLUT engine unconditionally: it will raise SIGINT, which in +turn will (hopefully) call the destructors, thus cleaning up your/my mess ;-) +NB: since the DJGPP guys ensured signal handlers won't go beyond program's +space (and since dynamic modules shall) the SIGINT can't be hooked (well, it +can, but it is useless), therefore you must live with the 'Exiting due to +signal SIGINT' message... + +The mouse driver is far from complete (lack of positioning, drawing, etc), but +is enough to make almost all the demos work. The timer is pretty versatile for it supports multiple timers with different -frequencies. It may not be the most accurate timer in the known universe, but -I think it's OK. Take this example: you have timer A with a very high rate, -and then you have timer B with very low rate compared to A; now, A ticks OK, -but timer B will probably loose precision! +frequencies. While not being the most accurate timer in the known universe, I +think it's OK. Take this example: you have timer A with a very high rate, and +then you have timer B with very low rate compared to A; now, A ticks OK, but +timer B will probably loose precision! As an addition, stdout and stderr are redirected and dumped upon exit. This -means that printf can be safely called during graphics, but all messages come -in bulk! A bit of a hack, I know, but I think it's better than to miss them -at all. "Borrowed" from RHIDE (Robert Hoehne) or SETEDIT (Salvador Eduardo -Tropea)... I'm not sure. +means that `printf' can be safely called during graphics. A bit of a hack, I +know, because all messages come in bulk, but I think it's better than nothing. +"Borrowed" from LIBRHUTI (Robert Hoehne). Window creating defaults: 640x480x16 at (0,0), 8-bit stencil, 16-bit accum. -However, the video mode is chosen in such a way that first window will fit. +However, the video mode is chosen in such a way that first window will fit. If +you need high resolution with small windows, try to place them far to the right +(or way down). + +The following environment variables can customize GLUT behaviour: + DMESA_GLUT_REFRESH - set vertical screen refresh rate + DMESA_GLUT_BPP - set default bits per pixel History: ~~~~~~~~ -v1.0 mar-2002 initial release - -v1.1 sep-2002 + added 3dfx Glide3 support - + added refresh rate control - + added fonts in glut - * lots of minor changes - -v1.2 nov-2002 * synced w/ Mesa-4.1 - - removed dmesadxe.h +v1.0 (mar-2002) + initial release + +v1.1 (sep-2002) + + added 3dfx Glide3 support + + added refresh rate control + + added fonts in GLUT + * lots of minor changes + +v1.2 (nov-2002) + * synced w/ Mesa-4.1 + - removed dmesadxe.h + +v1.3 (dec-2002) + + enabled OpenGL 1.4 support + + added MMX clear/blit routines + + enabled SGI's GLU compilation + + added color-index modes + + added 8bit FakeColor (thanks to Neil Funk) + + added VGA support (to keep Ben Decker happy) + * fixed GLUT compilation error (reported by Chan Kar Heng) + * overhauled virtual buffer and internal video drivers + * better fxMesa integration + * extended GLUT functionality + * switched to DXE3 diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h index d624bb6c828..7e46ff2e2f9 100644 --- a/include/GL/dmesa.h +++ b/include/GL/dmesa.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.2 for Mesa 4.1 + * DOS/DJGPP device driver v1.3 for Mesa 5.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -37,6 +37,17 @@ #define DMESA_MAJOR_VERSION 5 #define DMESA_MINOR_VERSION 0 +/* Sample Usage: + * + * 1. Call DMesaCreateVisual() to initialize graphics. + * 2. Call DMesaCreateContext() to create a DMesa rendering context. + * 3. Call DMesaCreateBuffer() to define the window. + * 4. Call DMesaMakeCurrent() to bind the DMesaBuffer to a DMesaContext. + * 5. Make gl* calls to render your graphics. + * 6. Use DMesaSwapBuffers() when double buffering to swap front/back buffers. + * 7. Before exiting, destroy DMesaBuffer, DMesaContext and DMesaVisual. + */ + typedef struct dmesa_context *DMesaContext; typedef struct dmesa_visual *DMesaVisual; typedef struct dmesa_buffer *DMesaBuffer; @@ -45,32 +56,79 @@ typedef struct dmesa_buffer *DMesaBuffer; extern "C" { #endif -DMesaVisual DMesaCreateVisual (GLint width, GLint height, - GLint colDepth, - GLboolean dbFlag, - GLint depthSize, - GLint stencilSize, - GLint accumSize); +/* + * Create a new Visual and set graphics mode. + */ +DMesaVisual DMesaCreateVisual (GLint width, /* X res */ + GLint height, /* Y res */ + GLint colDepth, /* BPP */ + GLint refresh, /* refresh rate: 0=default */ + GLboolean dbFlag, /* double-buffered */ + GLboolean rgbFlag, /* RGB mode */ + GLboolean alphaFlag,/* alpha buffer requested */ + GLint depthSize, /* requested bits/depth */ + GLint stencilSize, /* requested bits/stencil */ + GLint accumSize); /* requested bits/accum */ +/* + * Destroy Visual and restore screen. + */ void DMesaDestroyVisual (DMesaVisual v); + + +/* + * Create a new Context for rendering. + */ +DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share); + +/* + * Destroy Context. + */ +void DMesaDestroyContext (DMesaContext c); + + + +/* + * Create a new Buffer (window). + */ DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, GLint xpos, GLint ypos, GLint width, GLint height); +/* + * Destroy Buffer. + */ void DMesaDestroyBuffer (DMesaBuffer b); -DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share); -void DMesaDestroyContext (DMesaContext c); +/* + * Bind Buffer to Context and make the Context the current one. + */ +GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b); + + + +/* + * Swap the front and back buffers for the given Buffer. + * No action is taken if the buffer is not double buffered. + */ +void DMesaSwapBuffers (DMesaBuffer b); + + + +/* + * Move/Resize Buffer. + */ GLboolean DMesaViewport (DMesaBuffer b, GLint xpos, GLint ypos, GLint width, GLint height); -GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b); - -void DMesaSwapBuffers (DMesaBuffer b); +/* + * Set CI color using normalized values. + */ +void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue); #ifdef __cplusplus } diff --git a/src/glu/mesa/Makefile.DJ b/src/glu/mesa/Makefile.DJ index f05eca14c81..e720beb1b07 100644 --- a/src/glu/mesa/Makefile.DJ +++ b/src/glu/mesa/Makefile.DJ @@ -20,7 +20,7 @@ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# DOS/DJGPP glu makefile v1.1 for Mesa 4.0 +# DOS/DJGPP glu makefile v1.3 for Mesa 5.0 # # Copyright (C) 2002 - Borca Daniel # Email : dborca@yahoo.com @@ -52,10 +52,10 @@ CC = gcc CFLAGS += -I$(TOP)/include AR = ar -ARFLAGS = ru +ARFLAGS = rus -ifneq ($(wildcard $(DJDIR)/lib/dxe2.ld),) -DXE2GEN = $(wildcard $(addsuffix /dxe2gen.exe,$(subst ;, ,$(PATH)))) +ifneq ($(wildcard $(DJDIR)/lib/dxe3.ld),) +DXE3GEN = $(wildcard $(addsuffix /dxe3gen.exe,$(subst ;, ,$(PATH)))) endif RM = del @@ -78,7 +78,7 @@ SOURCES = $(CORE_SOURCES) OBJECTS = $(SOURCES:.c=.o) .c.o: - $(CC) -o $@ -c $(CFLAGS) $< + $(CC) -o $@ $(CFLAGS) -c $< all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP) @@ -86,11 +86,11 @@ $(LIBDIR)/$(GLU_LIB): $(OBJECTS) $(AR) $(ARFLAGS) $(LIBDIR)/$(GLU_LIB) $(OBJECTS) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS) -ifeq ($(DXE2GEN),) - $(warning Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN) - $(warning somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.) +ifeq ($(DXE3GEN),) + $(warning Missing DXE3GEN and/or DXE3.LD! You must have DXE3GEN) + $(warning somewhere in PATH, and DXE3.LD in DJGPP/LIB directory.) else - -dxe2gen -o $(LIBDIR)/$(GLU_DXE) -I $(LIBDIR)/$(GLU_IMP) $(OBJECTS) -E djgpp_ -E glu -D "Mesa DJGPP GLU" -U + -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -I $(LIBDIR)/$(GLU_IMP) -D "MesaGLU DJGPP" -E glu -X -P gl.dxe -U $(OBJECTS) endif clean: diff --git a/src/glu/sgi/Makefile.DJ b/src/glu/sgi/Makefile.DJ new file mode 100644 index 00000000000..32f05770c06 --- /dev/null +++ b/src/glu/sgi/Makefile.DJ @@ -0,0 +1,187 @@ +# Mesa 3-D graphics library +# Version: 4.0 +# +# Copyright (C) 1999 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# DOS/DJGPP glu makefile v1.3 for Mesa 5.0 +# +# Copyright (C) 2002 - Borca Daniel +# Email : dborca@yahoo.com +# Web : http://www.geocities.com/dborca + + +# +# Available options: +# +# Environment variables: +# CFLAGS +# +# Targets: +# all: build GLU +# clean: remove object files +# + + + +.PHONY: all clean + +TOP = .. +LIBDIR = $(TOP)/lib +GLU_LIB = libglu.a +GLU_DXE = glu.dxe +GLU_IMP = libiglu.a + +CC = gcc +CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include -Iinclude +CXX = gxx +CXXFLAGS = $(CFLAGS) -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess + +AR = ar +ARFLAGS = rus + +ifneq ($(wildcard $(DJDIR)/lib/dxe3.ld),) +DXE3GEN = $(wildcard $(addsuffix /dxe3gen.exe,$(subst ;, ,$(PATH)))) +endif + +RM = del + +C_SOURCES = \ + libutil/error.c \ + libutil/glue.c \ + libutil/mipmap.c \ + libutil/project.c \ + libutil/quad.c \ + libutil/registry.c \ + libtess/dict.c \ + libtess/geom.c \ + libtess/memalloc.c \ + libtess/mesh.c \ + libtess/normal.c \ + libtess/priorityq.c \ + libtess/render.c \ + libtess/sweep.c \ + libtess/tess.c \ + libtess/tessmono.c + +CC_SOURCES = \ + libnurbs/interface/bezierEval.cc \ + libnurbs/interface/bezierPatch.cc \ + libnurbs/interface/bezierPatchMesh.cc \ + libnurbs/interface/glcurveval.cc \ + libnurbs/interface/glinterface.cc \ + libnurbs/interface/glrenderer.cc \ + libnurbs/interface/glsurfeval.cc \ + libnurbs/interface/incurveeval.cc \ + libnurbs/interface/insurfeval.cc \ + libnurbs/internals/arc.cc \ + libnurbs/internals/arcsorter.cc \ + libnurbs/internals/arctess.cc \ + libnurbs/internals/backend.cc \ + libnurbs/internals/basiccrveval.cc \ + libnurbs/internals/basicsurfeval.cc \ + libnurbs/internals/bin.cc \ + libnurbs/internals/bufpool.cc \ + libnurbs/internals/cachingeval.cc \ + libnurbs/internals/ccw.cc \ + libnurbs/internals/coveandtiler.cc \ + libnurbs/internals/curve.cc \ + libnurbs/internals/curvelist.cc \ + libnurbs/internals/curvesub.cc \ + libnurbs/internals/dataTransform.cc \ + libnurbs/internals/displaylist.cc \ + libnurbs/internals/flist.cc \ + libnurbs/internals/flistsorter.cc \ + libnurbs/internals/hull.cc \ + libnurbs/internals/intersect.cc \ + libnurbs/internals/knotvector.cc \ + libnurbs/internals/mapdesc.cc \ + libnurbs/internals/mapdescv.cc \ + libnurbs/internals/maplist.cc \ + libnurbs/internals/mesher.cc \ + libnurbs/internals/monoTriangulationBackend.cc \ + libnurbs/internals/monotonizer.cc \ + libnurbs/internals/mycode.cc \ + libnurbs/internals/nurbsinterfac.cc \ + libnurbs/internals/nurbstess.cc \ + libnurbs/internals/patch.cc \ + libnurbs/internals/patchlist.cc \ + libnurbs/internals/quilt.cc \ + libnurbs/internals/reader.cc \ + libnurbs/internals/renderhints.cc \ + libnurbs/internals/slicer.cc \ + libnurbs/internals/sorter.cc \ + libnurbs/internals/splitarcs.cc \ + libnurbs/internals/subdivider.cc \ + libnurbs/internals/tobezier.cc \ + libnurbs/internals/trimline.cc \ + libnurbs/internals/trimregion.cc \ + libnurbs/internals/trimvertpool.cc \ + libnurbs/internals/uarray.cc \ + libnurbs/internals/varray.cc \ + libnurbs/nurbtess/directedLine.cc \ + libnurbs/nurbtess/gridWrap.cc \ + libnurbs/nurbtess/monoChain.cc \ + libnurbs/nurbtess/monoPolyPart.cc \ + libnurbs/nurbtess/monoTriangulation.cc \ + libnurbs/nurbtess/partitionX.cc \ + libnurbs/nurbtess/partitionY.cc \ + libnurbs/nurbtess/polyDBG.cc \ + libnurbs/nurbtess/polyUtil.cc \ + libnurbs/nurbtess/primitiveStream.cc \ + libnurbs/nurbtess/quicksort.cc \ + libnurbs/nurbtess/rectBlock.cc \ + libnurbs/nurbtess/sampleComp.cc \ + libnurbs/nurbtess/sampleCompBot.cc \ + libnurbs/nurbtess/sampleCompRight.cc \ + libnurbs/nurbtess/sampleCompTop.cc \ + libnurbs/nurbtess/sampleMonoPoly.cc \ + libnurbs/nurbtess/sampledLine.cc \ + libnurbs/nurbtess/searchTree.cc + +SOURCES = $(C_SOURCES) $(CC_SOURCES) + +OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) + +.c.o: + $(CC) -o $@ $(CFLAGS) -c $< +.cc.o: + $(CXX) -o $@ $(CXXFLAGS) -c $< + +all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP) + +$(LIBDIR)/$(GLU_LIB): $(OBJECTS) + $(AR) $(ARFLAGS) $(LIBDIR)/$(GLU_LIB) $(OBJECTS) + +$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS) +ifeq ($(DXE3GEN),) + $(warning Missing DXE3GEN and/or DXE3.LD! You must have DXE3GEN) + $(warning somewhere in PATH, and DXE3.LD in DJGPP/LIB directory.) +else + -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -I $(LIBDIR)/$(GLU_IMP) -D "MesaGLU/SGI DJGPP" -E glu -X -P gl.dxe -U $(OBJECTS) +endif + +clean: + -$(RM) $(subst /,\,libutil/*.o) + -$(RM) $(subst /,\,libtess/*.o) + -$(RM) $(subst /,\,libnurbs/interface/*.o) + -$(RM) $(subst /,\,libnurbs/internals/*.o) + -$(RM) $(subst /,\,libnurbs/nurbtess/*.o) + +-include depend diff --git a/src/glut/dos/Makefile.DJ b/src/glut/dos/Makefile.DJ index 698c80ce3c0..fed1f42e8cc 100644 --- a/src/glut/dos/Makefile.DJ +++ b/src/glut/dos/Makefile.DJ @@ -20,7 +20,7 @@ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# DOS/DJGPP glut makefile v1.1 for Mesa 4.0 +# DOS/DJGPP glut makefile v1.3 for Mesa 5.0 # # Copyright (C) 2002 - Borca Daniel # Email : dborca@yahoo.com @@ -33,14 +33,7 @@ # Environment variables: # CFLAGS # -# GLIDE absolute path to Glide SDK; used with FX. -# default = $(TOP)/include/glide3 -# FX=1 build for 3dfx Glide3; use it if you have the glide -# SDK (designed for your platform), and, of course, a -# 3dfx card... Note that this disables compilation of -# actual DMesa code, as Glide does all the stuff! -# default = no -# MARK absolute path to original GLUT. +# MKGLUT absolute path to original GLUT. # default = $(TOP)/src-glut # # Targets: @@ -54,23 +47,20 @@ TOP = .. GLIDE ?= $(TOP)/include/glide3 -MARK ?= $(TOP)/src-glut +MKGLUT ?= $(TOP)/src-glut LIBDIR = $(TOP)/lib GLUT_LIB = libglut.a GLUT_DXE = glut.dxe GLUT_IMP = libiglut.a CC = gcc -CFLAGS += -I$(TOP)/include -I$(MARK) -ifdef FX -CFLAGS += -D__DOS__ -I$(GLIDE) -DFX -DFX_GLIDE3 -DFXMESA_USE_ARGB -endif +CFLAGS += -I$(TOP)/include -I$(MKGLUT) AR = ar ARFLAGS = ru -ifneq ($(wildcard $(DJDIR)/lib/dxe2.ld),) -DXE2GEN = $(wildcard $(addsuffix /dxe2gen.exe,$(subst ;, ,$(PATH)))) +ifneq ($(wildcard $(DJDIR)/lib/dxe3.ld),) +DXE3GEN = $(wildcard $(addsuffix /dxe3gen.exe,$(subst ;, ,$(PATH)))) endif RM = del @@ -95,25 +85,25 @@ PC_HW_SOURCES = \ PC_HW/pc_timer.c \ PC_HW/pc_irq.S -MARK_SOURCES = \ - $(MARK)/glut_8x13.c \ - $(MARK)/glut_9x15.c \ - $(MARK)/glut_hel10.c \ - $(MARK)/glut_hel12.c \ - $(MARK)/glut_hel18.c \ - $(MARK)/glut_tr10.c \ - $(MARK)/glut_tr24.c +MKGLUT_SOURCES = \ + $(MKGLUT)/glut_8x13.c \ + $(MKGLUT)/glut_9x15.c \ + $(MKGLUT)/glut_hel10.c \ + $(MKGLUT)/glut_hel12.c \ + $(MKGLUT)/glut_hel18.c \ + $(MKGLUT)/glut_tr10.c \ + $(MKGLUT)/glut_tr24.c -SOURCES = $(CORE_SOURCES) $(PC_HW_SOURCES) $(MARK_SOURCES) +SOURCES = $(CORE_SOURCES) $(PC_HW_SOURCES) $(MKGLUT_SOURCES) OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) .c.o: - $(CC) -o $@ -c $(CFLAGS) $< + $(CC) -o $@ $(CFLAGS) -c $< .S.o: - $(CC) -o $@ -c $(CFLAGS) $< + $(CC) -o $@ $(CFLAGS) -c $< .s.o: - $(CC) -o $@ -c $(CFLAGS) -x assembler-with-cpp $< + $(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $< all: $(LIBDIR)/$(GLUT_LIB) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP) @@ -121,16 +111,16 @@ $(LIBDIR)/$(GLUT_LIB): $(OBJECTS) $(AR) $(ARFLAGS) $(LIBDIR)/$(GLUT_LIB) $(OBJECTS) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS) -ifeq ($(DXE2GEN),) - $(warning Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN) - $(warning somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.) +ifeq ($(DXE3GEN),) + $(warning Missing DXE3GEN and/or DXE3.LD! You must have DXE3GEN) + $(warning somewhere in PATH, and DXE3.LD in DJGPP/LIB directory.) else - -dxe2gen -o $(LIBDIR)/$(GLUT_DXE) -I $(LIBDIR)/$(GLUT_IMP) $(OBJECTS) -E djgpp_ -E glut -D "Mesa DJGPP GLUT" -U + -dxe3gen -o $(LIBDIR)/$(GLUT_DXE) -I $(LIBDIR)/$(GLUT_IMP) -D "MesaGLUT DJGPP" -E glut -X -P gl.dxe -P glu.dxe -U $(OBJECTS) endif clean: -$(RM) $(subst /,\,*.o) -$(RM) $(subst /,\,PC_HW/*.o) - -$(RM) $(subst /,\,$(MARK)/*.o) + -$(RM) $(subst /,\,$(MKGLUT)/*.o) -include depend diff --git a/src/glut/dos/PC_HW/pc_hw.c b/src/glut/dos/PC_HW/pc_hw.c index 9b30c5808c1..867daf89b07 100644 --- a/src/glut/dos/PC_HW/pc_hw.c +++ b/src/glut/dos/PC_HW/pc_hw.c @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v1.2 for DOS/DJGPP + * PC/HW routine collection v1.3 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -73,21 +73,25 @@ void *pc_malloc (size_t size) /* * standard redirection */ -static int h_out, h_outbak, h_err, h_errbak; +#define STDOUT 1 +#define STDERR 2 + +static char outname[L_tmpnam]; +static int h_out, h_outbak; +static char errname[L_tmpnam]; +static int h_err, h_errbak; int pc_open_stdout (void) { - if ((h_out=open(tmpnam(NULL), O_WRONLY | O_CREAT | O_TRUNC | O_TEXT | O_TEMPORARY, S_IRUSR | S_IWUSR)) >= 0) { - if ((h_outbak=dup(1)) != -1) { - fflush(stdout); - if (dup2(h_out, 1) != -1) { - return 0; - } - close(h_outbak); - } - close(h_out); + tmpnam(outname); + + if ((h_out=open(outname, O_WRONLY | O_CREAT | O_TEXT | O_TRUNC, S_IREAD | S_IWRITE)) > 0) { + h_outbak = dup(STDOUT); + fflush(stdout); + dup2(h_out, STDOUT); } - return (h_out = -1); + + return h_out; } void pc_close_stdout (void) @@ -95,35 +99,32 @@ void pc_close_stdout (void) FILE *f; char *line = alloca(512); - if (h_out >= 0) { - dup2(h_outbak, 1); + if (h_out > 0) { + dup2(h_outbak, STDOUT); + close(h_out); close(h_outbak); - if ((f=fdopen(h_out, "r")) != NULL) { - fseek(f, 0, SEEK_SET); - while (fgets(line, 512, f)) { - fputs(line, stdout); - } - fclose(f); - } else { - close(h_out); + f = fopen(outname, "rt"); + while (fgets(line, 512, f)) { + fputs(line, stdout); } + fclose(f); + + remove(outname); } } int pc_open_stderr (void) { - if ((h_err=open(tmpnam(NULL), O_WRONLY | O_CREAT | O_TRUNC | O_TEXT | O_TEMPORARY, S_IRUSR | S_IWUSR)) >= 0) { - if ((h_errbak=dup(2)) != -1) { - fflush(stderr); - if (dup2(h_err, 2) != -1) { - return 0; - } - close(h_errbak); - } - close(h_err); + tmpnam(errname); + + if ((h_err=open(errname, O_WRONLY | O_CREAT | O_TEXT | O_TRUNC, S_IREAD | S_IWRITE)) > 0) { + h_errbak = dup(STDERR); + fflush(stderr); + dup2(h_err, STDERR); } - return (h_err = -1); + + return h_err; } void pc_close_stderr (void) @@ -131,18 +132,17 @@ void pc_close_stderr (void) FILE *f; char *line = alloca(512); - if (h_err >= 0) { - dup2(h_errbak, 2); + if (h_err > 0) { + dup2(h_errbak, STDERR); + close(h_err); close(h_errbak); - if ((f=fdopen(h_err, "r")) != NULL) { - fseek(f, 0, SEEK_SET); - while (fgets(line, 512, f)) { - fputs(line, stderr); - } - fclose(f); - } else { - close(h_err); + f = fopen(errname, "rt"); + while (fgets(line, 512, f)) { + fputs(line, stderr); } + fclose(f); + + remove(errname); } } diff --git a/src/glut/dos/color.c b/src/glut/dos/color.c index 9a7754514c8..f1f529521d6 100644 --- a/src/glut/dos/color.c +++ b/src/glut/dos/color.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.0 for Mesa 4.0 + * DOS/DJGPP glut driver v1.3 for Mesa 5.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -28,19 +28,31 @@ #include "GL/glut.h" +#include "GL/dmesa.h" +#include "internal.h" + + + +#define CLAMP(i) ((i) > 1.0 ? 1.0 : ((i) < 0.0 ? 0.0 : (i))) + void APIENTRY glutSetColor (int ndx, GLfloat red, GLfloat green, GLfloat blue) { + if (g_display_mode & GLUT_INDEX) { + DMesaSetCI(ndx, CLAMP(red), CLAMP(green), CLAMP(blue)); + } } + GLfloat APIENTRY glutGetColor (int ndx, int component) { return 0.0; } + void APIENTRY glutCopyColormap (int win) { } diff --git a/src/glut/dos/globals.c b/src/glut/dos/globals.c index 342cf3d08f6..c264992cc75 100644 --- a/src/glut/dos/globals.c +++ b/src/glut/dos/globals.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.0 for Mesa 4.0 + * DOS/DJGPP glut driver v1.3 for Mesa 5.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -30,10 +30,12 @@ #include "GL/glut.h" #include "internal.h" -GLenum g_display_mode = 0; +GLuint g_display_mode = 0; GLuint g_width = DEFAULT_WIDTH; GLuint g_height = DEFAULT_HEIGHT; -GLint g_mouse = GL_FALSE; +GLuint g_bpp = DEFAULT_BPP; +GLuint g_refresh = 0; +GLuint g_mouse = 0; GLboolean g_redisplay = GL_FALSE; GLint g_xpos = 0; GLint g_ypos = 0; diff --git a/src/glut/dos/init.c b/src/glut/dos/init.c index a6d7e830b0c..4ee939b4871 100644 --- a/src/glut/dos/init.c +++ b/src/glut/dos/init.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.0 for Mesa 4.0 + * DOS/DJGPP glut driver v1.3 for Mesa 5.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -33,6 +33,15 @@ void APIENTRY glutInit (int *argcp, char **argv) { + const char *env; + + if ((env = getenv("DMESA_GLUT_BPP")) != NULL) { + g_bpp = atoi(env); + } + if ((env = getenv("DMESA_GLUT_REFRESH")) != NULL) { + g_refresh = atoi(env); + } + glutGet(GLUT_ELAPSED_TIME); } diff --git a/src/glut/dos/internal.h b/src/glut/dos/internal.h index e23d485b2e0..ac9e58b2dfa 100644 --- a/src/glut/dos/internal.h +++ b/src/glut/dos/internal.h @@ -45,10 +45,12 @@ #define STENCIL_SIZE 8 #define ACCUM_SIZE 16 -extern GLenum g_display_mode; +extern GLuint g_display_mode; extern GLuint g_width; extern GLuint g_height; -extern GLint g_mouse; +extern GLuint g_bpp; +extern GLuint g_refresh; +extern GLuint g_mouse; extern GLboolean g_redisplay; extern GLint g_xpos; extern GLint g_ypos; diff --git a/src/glut/dos/state.c b/src/glut/dos/state.c index b463f4a1093..b26307d9cb6 100644 --- a/src/glut/dos/state.c +++ b/src/glut/dos/state.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.0 for Mesa 4.0 + * DOS/DJGPP glut driver v1.3 for Mesa 5.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -48,8 +48,10 @@ static void ticks_timer (void *p) int APIENTRY glutGet (GLenum type) { switch (type) { + case GLUT_WINDOW_COLORMAP_SIZE: + return (g_display_mode & GLUT_INDEX) ? 256 : 0; case GLUT_WINDOW_RGBA: - return 1; + return !(g_display_mode & GLUT_INDEX); case GLUT_ELAPSED_TIME: if (!timer_installed) { timer_installed = !timer_installed; diff --git a/src/glut/dos/window.c b/src/glut/dos/window.c index ba0f5acee5c..cce1a1f7779 100644 --- a/src/glut/dos/window.c +++ b/src/glut/dos/window.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.2 for Mesa 4.1 + * DOS/DJGPP glut driver v1.3 for Mesa 5.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -28,26 +28,16 @@ #include "GL/glut.h" -#ifndef FX #include "GL/dmesa.h" -#else -#include "GL/fxmesa.h" -#endif #include "internal.h" static int window; -#ifndef FX static DMesaVisual visual = NULL; static DMesaContext context = NULL; static DMesaBuffer buffer[MAX_WINDOWS]; -#else -static void *visual = NULL; -static fxMesaContext context = NULL; -static int fx_attrib[32]; -#endif @@ -58,12 +48,8 @@ static void clean (void) for (i=0; iBuffer->height - (y) - 1) -#define FLIP2(y) (h - (y) - 1) +#define FLIP2(y) (b - (y)) +/**************************************************************************** + * RGB[A] + ***************************************************************************/ static void write_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[]) { const DMesaContext c = (DMesaContext)ctx->DriverCtx; - void *b = c->Buffer->the_window; GLuint i, offset; offset = c->Buffer->width * FLIP(y) + x; @@ -112,13 +124,13 @@ static void write_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, /* draw some pixels */ for (i=0; iDriverCtx; - void *b = c->Buffer->the_window; GLuint i, offset; offset = c->Buffer->width * FLIP(y) + x; @@ -137,13 +148,13 @@ static void write_rgb_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, /* draw some pixels */ for (i=0; iDriverCtx; - void *b = c->Buffer->the_window; GLuint i, offset, rgba = vl_mixrgba(color); offset = c->Buffer->width * FLIP(y) + x; @@ -163,13 +173,13 @@ static void write_mono_rgba_span (const GLcontext *ctx, /* draw some pixels */ for (i=0; iDriverCtx; - void *b = c->Buffer->the_window; GLuint i, offset; offset = c->Buffer->width * FLIP(y) + x; /* read all pixels */ for (i=0; iDriverCtx; - void *b = c->Buffer->the_window; - GLuint i, w = c->Buffer->width, h = c->Buffer->height; + GLuint i, w = c->Buffer->width, b = c->Buffer->height - 1; if (mask) { /* draw some pixels */ for (i=0; iDriverCtx; - void *b = c->Buffer->the_window; - GLuint i, w = c->Buffer->width, h = c->Buffer->height, rgba = vl_mixrgba(color); + GLuint i, w = c->Buffer->width, b = c->Buffer->height - 1, rgba = vl_mixrgba(color); if (mask) { /* draw some pixels */ for (i=0; iDriverCtx; - void *b = c->Buffer->the_window; - GLuint i, w = c->Buffer->width, h = c->Buffer->height; + GLuint i, w = c->Buffer->width, b = c->Buffer->height - 1; if (mask) { /* read some pixels */ for (i=0; iDriverCtx; + GLuint i, offset; + + offset = c->Buffer->width * FLIP(y) + x; + if (mask) { + /* draw some pixels */ + for (i=0; iDriverCtx; + GLuint i, offset; + + offset = c->Buffer->width * FLIP(y) + x; + if (mask) { + /* draw some pixels */ + for (i=0; iDriverCtx; + GLuint i, offset; + + offset = c->Buffer->width * FLIP(y) + x; + if (mask) { + /* draw some pixels */ + for (i=0; iDriverCtx; + GLuint i, offset; + + offset = c->Buffer->width * FLIP(y) + x; + /* read all pixels */ + for (i=0; iDriverCtx; + GLuint i, w = c->Buffer->width, b = c->Buffer->height - 1; + + if (mask) { + /* draw some pixels */ + for (i=0; iDriverCtx; + GLuint i, w = c->Buffer->width, b = c->Buffer->height - 1; + + if (mask) { + /* draw some pixels */ + for (i=0; iDriverCtx; + GLuint i, w = c->Buffer->width, b = c->Buffer->height - 1; + + if (mask) { + /* read some pixels */ + for (i=0; icolor); \ - const DMesaContext c = (DMesaContext)ctx->DriverCtx; \ - void *b = c->Buffer->the_window; \ - GLuint w = c->Buffer->width, h = c->Buffer->height; +static void tri_rgb_flat (GLcontext *ctx, + const SWvertex *v0, + const SWvertex *v1, + const SWvertex *v2) +{ + const DMesaContext c = (DMesaContext)ctx->DriverCtx; + GLuint w = c->Buffer->width, b = c->Buffer->height - 1; + +#define SETUP_CODE GLuint rgb = vl_mixrgb(v2->color); #define RENDER_SPAN(span) \ GLuint i, offset = FLIP2(span.y)*w + span.x; \ for (i = 0; i < span.end; i++, offset++) { \ - vl_putpixel(b, offset, rgb); \ + vl_putpixel(offset, rgb); \ } -#include "swrast/s_tritemp.h" +#include "swrast/s_tritemp.h" +} /* * flat, depth-buffered, triangle. */ -#define NAME tri_rgb_flat_z +static void tri_rgb_flat_z (GLcontext *ctx, + const SWvertex *v0, + const SWvertex *v1, + const SWvertex *v2) +{ + const DMesaContext c = (DMesaContext)ctx->DriverCtx; + GLuint w = c->Buffer->width, b = c->Buffer->height - 1; + #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define SETUP_CODE \ - const DMesaContext c = (DMesaContext)ctx->DriverCtx; \ - void *b = c->Buffer->the_window; \ - GLuint w = c->Buffer->width, h = c->Buffer->height; \ - GLuint rgb = vl_mixrgb(v2->color); +#define SETUP_CODE GLuint rgb = vl_mixrgb(v2->color); #define RENDER_SPAN(span) \ GLuint i, offset = FLIP2(span.y)*w + span.x; \ for (i = 0; i < span.end; i++, offset++) { \ const DEPTH_TYPE z = FixedToDepth(span.z); \ if (z < zRow[i]) { \ - vl_putpixel(b, offset, rgb); \ + vl_putpixel(offset, rgb); \ zRow[i] = z; \ } \ span.z += span.zStep; \ } -#include "swrast/s_tritemp.h" +#include "swrast/s_tritemp.h" +} /* * smooth, NON-depth-buffered, triangle. */ -#define NAME tri_rgb_smooth +static void tri_rgb_smooth (GLcontext *ctx, + const SWvertex *v0, + const SWvertex *v1, + const SWvertex *v2) +{ + const DMesaContext c = (DMesaContext)ctx->DriverCtx; + GLuint w = c->Buffer->width, b = c->Buffer->height - 1; + #define INTERP_RGB 1 -#define SETUP_CODE \ - const DMesaContext c = (DMesaContext)ctx->DriverCtx; \ - void *b = c->Buffer->the_window; \ - GLuint w = c->Buffer->width, h = c->Buffer->height; -#define RENDER_SPAN(span) \ - GLuint i, offset = FLIP2(span.y)*w + span.x; \ - for (i = 0; i < span.end; i++, offset++) { \ - unsigned char rgb[3]; \ - rgb[0] = FixedToInt(span.red); \ - rgb[1] = FixedToInt(span.green); \ - rgb[2] = FixedToInt(span.blue); \ - vl_putpixel(b, offset, vl_mixrgb(rgb)); \ - span.red += span.redStep; \ - span.green += span.greenStep; \ - span.blue += span.blueStep; \ +#define RENDER_SPAN(span) \ + GLuint i, offset = FLIP2(span.y)*w + span.x; \ + for (i = 0; i < span.end; i++, offset++) { \ + vl_putpixel(offset, vl_mixfix(span.red, span.green, span.blue)); \ + span.red += span.redStep; \ + span.green += span.greenStep; \ + span.blue += span.blueStep; \ } + #include "swrast/s_tritemp.h" +} /* * smooth, depth-buffered, triangle. */ -#define NAME tri_rgb_smooth_z +static void tri_rgb_smooth_z (GLcontext *ctx, + const SWvertex *v0, + const SWvertex *v1, + const SWvertex *v2) +{ + const DMesaContext c = (DMesaContext)ctx->DriverCtx; + GLuint w = c->Buffer->width, b = c->Buffer->height - 1; + #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define INTERP_RGB 1 -#define SETUP_CODE \ - const DMesaContext c = (DMesaContext)ctx->DriverCtx; \ - void *b = c->Buffer->the_window; \ - GLuint w = c->Buffer->width, h = c->Buffer->height; -#define RENDER_SPAN(span) \ - GLuint i, offset = FLIP2(span.y)*w + span.x; \ - for (i = 0; i < span.end; i++, offset++) { \ - const DEPTH_TYPE z = FixedToDepth(span.z); \ - if (z < zRow[i]) { \ - unsigned char rgb[3]; \ - rgb[0] = FixedToInt(span.red); \ - rgb[1] = FixedToInt(span.green); \ - rgb[2] = FixedToInt(span.blue); \ - vl_putpixel(b, offset, vl_mixrgb(rgb)); \ - zRow[i] = z; \ - } \ - span.red += span.redStep; \ - span.green += span.greenStep; \ - span.blue += span.blueStep; \ - span.z += span.zStep; \ + +#define RENDER_SPAN(span) \ + GLuint i, offset = FLIP2(span.y)*w + span.x; \ + for (i = 0; i < span.end; i++, offset++) { \ + const DEPTH_TYPE z = FixedToDepth(span.z); \ + if (z < zRow[i]) { \ + vl_putpixel(offset, vl_mixfix(span.red, span.green, span.blue));\ + zRow[i] = z; \ + } \ + span.red += span.redStep; \ + span.green += span.greenStep; \ + span.blue += span.blueStep; \ + span.z += span.zStep; \ } -#include "swrast/s_tritemp.h" +#include "swrast/s_tritemp.h" +} @@ -384,35 +561,24 @@ static swrast_tri_func dmesa_choose_tri_function (GLcontext *ctx) { const SWcontext *swrast = SWRAST_CONTEXT(ctx); - if (ctx->RenderMode != GL_RENDER) return (swrast_tri_func) NULL; - if (ctx->Polygon.SmoothFlag) return (swrast_tri_func) NULL; - if (ctx->Texture._EnabledUnits) return (swrast_tri_func) NULL; - - if (ctx->Light.ShadeModel==GL_SMOOTH - && swrast->_RasterMask==DEPTH_BIT - && ctx->Depth.Func==GL_LESS - && ctx->Depth.Mask==GL_TRUE - && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS - && ctx->Polygon.StippleFlag==GL_FALSE) { - return tri_rgb_smooth_z; + if ((ctx->RenderMode != GL_RENDER) + || (ctx->Polygon.SmoothFlag) + || (ctx->Polygon.StippleFlag) + || (ctx->Texture._EnabledUnits) + || (swrast->_RasterMask & MULTI_DRAW_BIT) + || ((ctx->Polygon.CullFlag && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK))) { + return (swrast_tri_func)NULL; } - if (ctx->Light.ShadeModel==GL_FLAT - && swrast->_RasterMask==DEPTH_BIT + + if (swrast->_RasterMask==DEPTH_BIT && ctx->Depth.Func==GL_LESS && ctx->Depth.Mask==GL_TRUE - && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS - && ctx->Polygon.StippleFlag==GL_FALSE) { - return tri_rgb_flat_z; + && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS) { + return (ctx->Light.ShadeModel==GL_SMOOTH) ? tri_rgb_smooth_z : tri_rgb_flat_z; } - if (swrast->_RasterMask==0 /* no depth test */ - && ctx->Light.ShadeModel==GL_SMOOTH - && ctx->Polygon.StippleFlag==GL_FALSE) { - return tri_rgb_smooth; - } - if (swrast->_RasterMask==0 /* no depth test */ - && ctx->Light.ShadeModel==GL_FLAT - && ctx->Polygon.StippleFlag==GL_FALSE) { - return tri_rgb_flat; + + if (swrast->_RasterMask==0) { /* no depth test */ + return (ctx->Light.ShadeModel==GL_SMOOTH) ? tri_rgb_smooth : tri_rgb_flat; } return (swrast_tri_func)NULL; @@ -421,7 +587,7 @@ static swrast_tri_func dmesa_choose_tri_function (GLcontext *ctx) /* Override for the swrast triangle-selection function. Try to use one - * of our internal line functions, otherwise fall back to the + * of our internal triangle functions, otherwise fall back to the * standard swrast functions. */ static void dmesa_choose_tri (GLcontext *ctx) @@ -438,6 +604,13 @@ static void dmesa_choose_tri (GLcontext *ctx) * Miscellaneous device driver funcs ***************************************************************************/ +static void clear_index (GLcontext *ctx, GLuint index) +{ + DMesaContext c = (DMesaContext)ctx->DriverCtx; + + c->ClearIndex = index; +} + static void clear_color (GLcontext *ctx, const GLfloat color[4]) { GLubyte col[4]; @@ -456,7 +629,6 @@ static void clear (GLcontext *ctx, GLbitfield mask, GLboolean all, { const DMesaContext c = (DMesaContext)ctx->DriverCtx; const GLuint *colorMask = (GLuint *)&ctx->Color.ColorMask; - DMesaBuffer b = c->Buffer; /* * Clear the specified region of the buffers indicated by 'mask' @@ -467,13 +639,16 @@ static void clear (GLcontext *ctx, GLbitfield mask, GLboolean all, */ /* we can't handle color or index masking */ - if (*colorMask==0xffffffff) { + if ((*colorMask == 0xffffffff) && (ctx->Color.IndexMask == 0xffffffff)) { if (mask & DD_BACK_LEFT_BIT) { + int color = c->visual->rgb_flag ? c->ClearColor : c->ClearIndex; + if (all) { - vl_clear(b->the_window, b->bytes, c->ClearColor); + vl_clear(color); } else { - vl_rect(b->the_window, x, y, width, height, c->ClearColor); + vl_rect(x, y, width, height, color); } + mask &= ~DD_BACK_LEFT_BIT; } } @@ -485,15 +660,6 @@ static void clear (GLcontext *ctx, GLbitfield mask, GLboolean all, -static void color_mask (GLcontext *ctx, GLboolean rmask, GLboolean gmask, GLboolean bmask, GLboolean amask) -{ - /* - * XXX todo - Implements glColorMask() - */ -} - - - static void set_buffer (GLcontext *ctx, GLframebuffer *colorBuffer, GLuint bufferBit) { /* @@ -503,15 +669,6 @@ static void set_buffer (GLcontext *ctx, GLframebuffer *colorBuffer, GLuint buffe -static void enable (GLcontext *ctx, GLenum pname, GLboolean state) -{ - /* - * XXX todo - - */ -} - - - /* * Return the width and height of the current buffer. * If anything special has to been done when the buffer/window is @@ -531,7 +688,7 @@ static const GLubyte* get_string (GLcontext *ctx, GLenum name) { switch (name) { case GL_RENDERER: - return (const GLubyte *)"Mesa DJGPP\0port (c) Borca Daniel nov-2002"; + return (const GLubyte *)"Mesa DJGPP\0port (c) Borca Daniel dec-2002"; default: return NULL; } @@ -639,8 +796,7 @@ static void dmesa_init_pointers (GLcontext *ctx) /* Statechange callbacks: */ ctx->Driver.ClearColor = clear_color; - ctx->Driver.ColorMask = color_mask; - ctx->Driver.Enable = enable; + ctx->Driver.ClearIndex = clear_index; /* Initialize the TNL driver interface: */ @@ -668,6 +824,15 @@ static void dmesa_update_state (GLcontext *ctx, GLuint new_state) _tnl_InvalidateState( ctx, new_state ); _swsetup_InvalidateState( ctx, new_state ); + /* Index span/pixel functions */ + dd->WriteCI32Span = write_index_span; + dd->WriteCI8Span = write_index8_span; + dd->WriteMonoCISpan = write_mono_index_span; + dd->WriteCI32Pixels = write_index_pixels; + dd->WriteMonoCIPixels = write_mono_index_pixels; + dd->ReadCI32Span = read_index_span; + dd->ReadCI32Pixels = read_index_pixels; + /* RGB(A) span/pixel functions */ dd->WriteRGBASpan = write_rgba_span; dd->WriteRGBSpan = write_rgb_span; @@ -677,6 +842,7 @@ static void dmesa_update_state (GLcontext *ctx, GLuint new_state) dd->ReadRGBASpan = read_rgba_span; dd->ReadRGBAPixels = read_rgba_pixels; } +#endif @@ -687,80 +853,126 @@ static void dmesa_update_state (GLcontext *ctx, GLuint new_state) /* * The exact arguments to this function will depend on your window system */ -DMesaVisual DMesaCreateVisual (GLint width, GLint height, GLint colDepth, - GLboolean dbFlag, GLint depthSize, +DMesaVisual DMesaCreateVisual (GLint width, + GLint height, + GLint colDepth, + GLint refresh, + GLboolean dbFlag, + GLboolean rgbFlag, + GLboolean alphaFlag, + GLint depthSize, GLint stencilSize, GLint accumSize) { +#ifndef FX DMesaVisual v; - GLint redBits, greenBits, blueBits, alphaBits; - - char *var = getenv("DMESA_REFRESH"); - int refresh = (var != NULL) ? atoi(var) : 0; + GLint redBits, greenBits, blueBits, alphaBits, indexBits; if (!dbFlag) { return NULL; } alphaBits = 0; - switch (colDepth) { - case 15: - redBits = 5; - greenBits = 5; - blueBits = 5; - break; - case 16: - redBits = 5; - greenBits = 6; - blueBits = 5; - break; - case 32: - alphaBits = 8; - case 24: - redBits = 8; - greenBits = 8; - blueBits = 8; - break; - default: - return NULL; + + if (!rgbFlag) { + indexBits = 8; + redBits = 0; + greenBits = 0; + blueBits = 0; + } else { + indexBits = 0; + switch (colDepth) { + case 8: + redBits = 8; + greenBits = 8; + blueBits = 8; + break; + case 15: + redBits = 5; + greenBits = 5; + blueBits = 5; + break; + case 16: + redBits = 5; + greenBits = 6; + blueBits = 5; + break; + case 32: + alphaBits = 8; + case 24: + redBits = 8; + greenBits = 8; + blueBits = 8; + break; + default: + return NULL; + } } - if (vl_video_init(width, height, colDepth, refresh) != 0) { + if ((colDepth=vl_video_init(width, height, colDepth, rgbFlag, refresh)) <= 0) { return NULL; } + if (alphaFlag && (alphaBits==0)) { + alphaBits = 8; + } + if ((v=(DMesaVisual)calloc(1, sizeof(struct dmesa_visual))) != NULL) { /* Create core visual */ - v->gl_visual = _mesa_create_visual(colDepth>8, /* rgb */ + v->gl_visual = _mesa_create_visual(rgbFlag, /* rgb */ dbFlag, GL_FALSE, /* stereo */ redBits, greenBits, blueBits, alphaBits, - 0, /* indexBits */ + indexBits, /* indexBits */ depthSize, stencilSize, accumSize, /* accumRed */ accumSize, /* accumGreen */ accumSize, /* accumBlue */ - alphaBits?accumSize:0, /* accumAlpha */ + alphaFlag?accumSize:0, /* accumAlpha */ 1); /* numSamples */ v->depth = colDepth; v->db_flag = dbFlag; + v->rgb_flag = rgbFlag; } return v; + +#else + + int i = 0, fx_attrib[32]; + + if (!rgbFlag) { + return NULL; + } + + if (dbFlag) fx_attrib[i++] = FXMESA_DOUBLEBUFFER; + if (depthSize > 0) { fx_attrib[i++] = FXMESA_DEPTH_SIZE; fx_attrib[i++] = depthSize; } + if (stencilSize > 0) { fx_attrib[i++] = FXMESA_STENCIL_SIZE; fx_attrib[i++] = stencilSize; } + if (accumSize > 0) { fx_attrib[i++] = FXMESA_ACCUM_SIZE; fx_attrib[i++] = accumSize; } + if (alphaFlag) { fx_attrib[i++] = FXMESA_ALPHA_SIZE; fx_attrib[i++] = 1; } + fx_attrib[i] = FXMESA_NONE; + + return (DMesaVisual)fxMesaCreateBestContext(-1, width, height, fx_attrib); +#endif } void DMesaDestroyVisual (DMesaVisual v) { - vl_video_exit(); +#ifndef FX _mesa_destroy_visual(v->gl_visual); free(v); + + vl_video_exit(); +#else + fxMesaDestroyContext((fxMesaContext)v); +#endif } @@ -769,6 +981,7 @@ DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, GLint xpos, GLint ypos, GLint width, GLint height) { +#ifndef FX DMesaBuffer b; if ((b=(DMesaBuffer)calloc(1, sizeof(struct dmesa_buffer))) != NULL) { @@ -783,19 +996,23 @@ DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, b->ypos = ypos; b->width = width; b->height = height; - b->bypp = (visual->depth+7)/8; } return b; +#else + return (DMesaBuffer)visual; +#endif } void DMesaDestroyBuffer (DMesaBuffer b) { +#ifndef FX free(b->the_window); _mesa_free_framebuffer_data(&b->gl_buffer); free(b); +#endif } @@ -803,6 +1020,7 @@ void DMesaDestroyBuffer (DMesaBuffer b) DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share) { +#ifndef FX DMesaContext c; GLboolean direct = GL_FALSE; @@ -812,6 +1030,7 @@ DMesaContext DMesaCreateContext (DMesaVisual visual, (void *)c, direct); _mesa_enable_sw_extensions(c->gl_ctx); + _mesa_enable_1_3_extensions(c->gl_ctx); _mesa_enable_1_4_extensions(c->gl_ctx); /* you probably have to do a bunch of other initializations here. */ @@ -825,19 +1044,32 @@ DMesaContext DMesaCreateContext (DMesaVisual visual, _ac_CreateContext(c->gl_ctx); _tnl_CreateContext(c->gl_ctx); _swsetup_CreateContext(c->gl_ctx); - dmesa_register_swrast_functions(c->gl_ctx); + if (visual->rgb_flag) dmesa_register_swrast_functions(c->gl_ctx); dmesa_init_pointers(c->gl_ctx); } return c; + +#else + + return (DMesaContext)visual; +#endif } void DMesaDestroyContext (DMesaContext c) { - _mesa_destroy_context(c->gl_ctx); +#ifndef FX + if (c->gl_ctx) { + _swsetup_DestroyContext(c->gl_ctx); + _swrast_DestroyContext(c->gl_ctx); + _tnl_DestroyContext(c->gl_ctx); + _ac_DestroyContext(c->gl_ctx); + _mesa_destroy_context(c->gl_ctx); + } free(c); +#endif } @@ -846,6 +1078,7 @@ GLboolean DMesaViewport (DMesaBuffer b, GLint xpos, GLint ypos, GLint width, GLint height) { +#ifndef FX void *new_window; if ((new_window=vl_sync_buffer(b->the_window, xpos, ypos, width, height)) == NULL) { @@ -856,10 +1089,13 @@ GLboolean DMesaViewport (DMesaBuffer b, b->ypos = ypos; b->width = width; b->height = height; - b->stride = width * b->bypp; - b->bytes = b->stride * height; return GL_TRUE; } + +#else + + return GL_FALSE; +#endif } @@ -869,6 +1105,7 @@ GLboolean DMesaViewport (DMesaBuffer b, */ GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b) { +#ifndef FX if ((c != NULL) && (b != NULL)) { if (!DMesaViewport(b, b->xpos, b->ypos, b->width, b->height)) { return GL_FALSE; @@ -886,6 +1123,11 @@ GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b) _mesa_make_current(NULL, NULL); } +#else + + fxMesaMakeCurrent((fxMesaContext)c); +#endif + return GL_TRUE; } @@ -894,7 +1136,20 @@ GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b) void DMesaSwapBuffers (DMesaBuffer b) { /* copy/swap back buffer to front if applicable */ +#ifndef FX GET_CURRENT_CONTEXT(ctx); _mesa_notifySwapBuffers(ctx); - vl_flip(b->the_window, b->stride, b->height); + vl_flip(); +#else + fxMesaSwapBuffers(); +#endif +} + + + +void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue) +{ +#ifndef FX + vl_setCI(ndx, red, green, blue); +#endif } diff --git a/src/mesa/drivers/dos/dpmi.c b/src/mesa/drivers/dos/dpmi.c index 60610acddf2..882cda390a4 100644 --- a/src/mesa/drivers/dos/dpmi.c +++ b/src/mesa/drivers/dos/dpmi.c @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.1 for Mesa 4.0 + * DOS/DJGPP device driver v1.3 for Mesa 5.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -33,7 +33,7 @@ #include -#include "dpmiint.h" +#include "internal.h" diff --git a/src/mesa/drivers/dos/internal.h b/src/mesa/drivers/dos/internal.h new file mode 100644 index 00000000000..824d963d360 --- /dev/null +++ b/src/mesa/drivers/dos/internal.h @@ -0,0 +1,127 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef INTERNAL_H_included +#define INTERNAL_H_included + +#include "../mmath.h" + +/* + * general purpose defines, etc. + */ +#ifndef FALSE +#define FALSE 0 +#define TRUE !FALSE +#endif + +#define __PACKED__ __attribute__((packed)) + +typedef unsigned char word8; +typedef unsigned short word16; +typedef unsigned long word32; + +#define _16_ *(word16 *)& +#define _32_ *(word32 *)& + + + +/* + * video mode structure + */ +typedef struct vl_mode { + int mode; + int xres, yres; + int scanlen; + int bpp; + + int sel; + int gran; +} vl_mode; + + + +/* + * video driver structure + */ +typedef struct { + vl_mode *(*init) (void); + int (*entermode) (vl_mode *p, int refresh); + void (*blit) (void); + void (*setCI_f) (int index, float red, float green, float blue); + void (*setCI_i) (int index, int red, int green, int blue); + int (*getCIprec) (void); + void (*restore) (void); + void (*finit) (void); +} vl_driver; + + + +/* + * memory mapping + */ +int _create_selector (int *segment, unsigned long base, int size); +void _remove_selector (int *segment); + +/* + * system routines + */ +int vl_can_mmx (void); + +/* + * asm routines to deal with virtual buffering + */ +extern void v_clear8 (int color); +#define v_clear15 v_clear16 +extern void v_clear16 (int color); +extern void v_clear24 (int color); +extern void v_clear32 (int color); + +extern void v_clear8_mmx (int color); +#define v_clear15_mmx v_clear16_mmx +extern void v_clear16_mmx (int color); +extern void v_clear24_mmx (int color); +extern void v_clear32_mmx (int color); + +extern void v_rect8 (int x, int y, int width, int height, int color); +#define v_rect15 v_rect16 +extern void v_rect16 (int x, int y, int width, int height, int color); +extern void v_rect24 (int x, int y, int width, int height, int color); +extern void v_rect32 (int x, int y, int width, int height, int color); + +extern void v_putpixel8 (unsigned int offset, int color); +#define v_putpixel15 v_putpixel16 +extern void v_putpixel16 (unsigned int offset, int color); +extern void v_putpixel24 (unsigned int offset, int color); +extern void v_putpixel32 (unsigned int offset, int color); + +#endif diff --git a/src/mesa/drivers/dos/vesa/vesa.c b/src/mesa/drivers/dos/vesa/vesa.c index 8dbeb9e52c4..26c474317fe 100644 --- a/src/mesa/drivers/dos/vesa/vesa.c +++ b/src/mesa/drivers/dos/vesa/vesa.c @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.2 for Mesa 4.1 + * DOS/DJGPP device driver v1.3 for Mesa 5.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -32,7 +32,7 @@ #include -#include +#include #include #include #include @@ -40,7 +40,6 @@ #include #include "vesa.h" -#include "../dpmiint.h" @@ -50,6 +49,11 @@ static word16 vesa_ver; static int banked_selector, linear_selector; static int oldmode = -1; +static int vesa_color_precision = 6; + +static void *vesa_pmcode; +unsigned int vesa_gran_mask, vesa_gran_shift; + /* @@ -100,11 +104,14 @@ typedef struct CRTCInfoBlock { -/* vesa_init: - * Attempts to detect VESA, check video modes and create selectors. - * Returns 0 if error. +/* Desc: Attempts to detect VESA, check video modes and create selectors. + * + * In : - + * Out : mode array + * + * Note: - */ -static word16 vesa_init (void) +static vl_mode *vesa_init (void) { __dpmi_regs r; word16 *p; @@ -114,7 +121,7 @@ static word16 vesa_init (void) word32 linearfb = 0; if (vesa_ver) { - return vesa_ver; + return modes; } _farpokel(_stubinfo->ds_selector, 0, 0x32454256); @@ -124,7 +131,7 @@ static word16 vesa_init (void) __dpmi_int(0x10, &r); movedata(_stubinfo->ds_selector, 0, _my_ds(), (unsigned)vesa_info, 512); if ((r.x.ax!=0x004f) || ((_32_ vesa_info[V_SIGN])!=0x41534556)) { - return 0; + return NULL; } p = (word16 *)(((_16_ vesa_info[V_MODE_SEG])<<4) + (_16_ vesa_info[V_MODE_OFS])); @@ -144,6 +151,7 @@ static word16 vesa_init (void) case 16: q->bpp = tmp[M_RED] + tmp[M_GREEN] + tmp[M_BLUE]; break; + case 8: case 15: case 24: case 32: @@ -175,54 +183,74 @@ static word16 vesa_init (void) } while (TRUE); if (q==modes) { - return 0; + return NULL; } if (linearfb) { maxsize = ((maxsize+0xfffUL)&~0xfffUL); if (_create_selector(&linear_selector, linearfb, maxsize)) { - return 0; + return NULL; } } if (_create_selector(&banked_selector, 0xa0000, modes[0].gran)) { _remove_selector(&linear_selector); - return 0; + return NULL; } for (q=modes; q->mode!=0xffff; q++) { q->sel = (q->mode&0x4000) ? linear_selector : banked_selector; } - return (vesa_ver = _16_ vesa_info[V_MINOR]); + if (vesa_info[V_MAJOR] >= 2) { + r.x.ax = 0x4f0a; + r.h.bl = 0; + __dpmi_int(0x10, &r); + if (r.x.ax == 0x004f) { + vesa_pmcode = malloc(r.x.cx); + movedata(__djgpp_dos_sel, (r.x.es << 4) + r.x.di, _my_ds(), (unsigned)vesa_pmcode, r.x.cx); + p = (word16 *)((long)vesa_pmcode + ((word16 *)vesa_pmcode)[3]); + while (*p++ != 0xffff) ; + if (*p != 0xffff) { + free(vesa_pmcode); + vesa_pmcode = NULL; + } else { + vesa_swbank = (char *)vesa_pmcode + ((word16 *)vesa_pmcode)[0]; + } + } + } + + vesa_ver = _16_ vesa_info[V_MINOR]; + return modes; } -/* vesa_finit: - * Frees all resources allocated by VESA init code. +/* Desc: Frees all resources allocated by VESA init code. + * + * In : - + * Out : - + * + * Note: - */ static void vesa_finit (void) { if (vesa_ver) { _remove_selector(&linear_selector); _remove_selector(&banked_selector); + if (vesa_pmcode != NULL) { + free(vesa_pmcode); + vesa_pmcode = NULL; + } } } -/* vesa_getmodes: - * Returns ptr to mode array. - */ -static vl_mode *vesa_getmodes (void) -{ - return (vesa_init() == 0) ? NULL : modes; -} - - - -/* _closest_pixclk: - * Uses VESA 3.0 function 0x4F0B to find the closest pixel clock to the - * requested value. +/* Desc: Uses VESA 3.0 function 0x4F0B to find the closest pixel clock to the requested value. + * + * In : mode, clock + * Out : desired clock + * + * Note: - */ static unsigned long _closest_pixclk (int mode_no, unsigned long vclk) { @@ -239,8 +267,12 @@ static unsigned long _closest_pixclk (int mode_no, unsigned long vclk) -/* _crtc_timing: - * Calculates CRTC mode timings. +/* Desc: Calculates CRTC mode timings. + * + * In : crtc block, geometry, adjust + * Out : + * + * Note: */ static void _crtc_timing (CRTCInfoBlock *crtc, int xres, int yres, int xadjust, int yadjust) { @@ -318,16 +350,28 @@ static void _crtc_timing (CRTCInfoBlock *crtc, int xres, int yres, int xadjust, -/* vesa_entermode: - * Attempts to enter specified video mode. +/* Desc: Attempts to enter specified video mode. + * + * In : ptr to mode structure, refresh rate + * Out : 0 if success * - * success: 0 - * failure: !0 + * Note: - */ static int vesa_entermode (vl_mode *p, int refresh) { __dpmi_regs r; + if (p->mode & 0x4000) { + VESA.blit = vl_can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual; + } else { + VESA.blit = vesa_b_dump_virtual; + { int n; for (vesa_gran_shift=0, n=p->gran; n; vesa_gran_shift++, n>>=1) ; } + vesa_gran_mask = (1<<(--vesa_gran_shift)) - 1; + if ((unsigned)p->gran != (vesa_gran_mask+1)) { + return !0; + } + } + if (oldmode == -1) { r.x.ax = 0x4f03; __dpmi_int(0x10, &r); @@ -364,14 +408,33 @@ static int vesa_entermode (vl_mode *p, int refresh) } __dpmi_int(0x10, &r); + if (r.x.ax != 0x004f) { + return !0; + } - return (r.x.ax != 0x004f); + if (p->bpp == 8) { + r.x.ax = 0x4f08; + r.x.bx = 0x0800; + __dpmi_int(0x10, &r); + if (r.x.ax == 0x004f) { + r.x.ax = 0x4f08; + r.h.bl = 0x01; + __dpmi_int(0x10, &r); + vesa_color_precision = r.h.bh; + } + } + + return 0; } -/* vesa_restore: - * Restores to the mode prior to first call to vesa_entermode. +/* Desc: Restores to the mode prior to first call to vesa_entermode. + * + * In : - + * Out : - + * + * Note: - */ static void vesa_restore (void) { @@ -386,12 +449,74 @@ static void vesa_restore (void) +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses normalized values + */ +static void vesa_setCI_f (int index, float red, float green, float blue) +{ + float max = (1 << vesa_color_precision) - 1; + + int _red = red * max; + int _green = green * max; + int _blue = blue * max; + + __asm("\n\ + movw $0x1010, %%ax \n\ + movb %1, %%dh \n\ + movb %2, %%ch \n\ + int $0x10 \n\ +"::"b"(index), "m"(_red), "m"(_green), "c"(_blue):"%eax", "%edx"); +} + + + +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses integer values + */ +static void vesa_setCI_i (int index, int red, int green, int blue) +{ + __asm("\n\ + movw $0x1010, %%ax \n\ + movb %1, %%dh \n\ + movb %2, %%ch \n\ + int $0x10 \n\ +"::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); +} + + + +/* Desc: retrieve CI precision + * + * In : - + * Out : precision in bits + * + * Note: - + */ +static int vesa_getCIprec (void) +{ + return vesa_color_precision; +} + + + /* * the driver */ vl_driver VESA = { - vesa_getmodes, + vesa_init, vesa_entermode, + NULL, + vesa_setCI_f, + vesa_setCI_i, + vesa_getCIprec, vesa_restore, vesa_finit }; diff --git a/src/mesa/drivers/dos/vesa/vesa.h b/src/mesa/drivers/dos/vesa/vesa.h index 22ecbd538ab..eb914e16c13 100644 --- a/src/mesa/drivers/dos/vesa/vesa.h +++ b/src/mesa/drivers/dos/vesa/vesa.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.1 for Mesa 4.0 + * DOS/DJGPP device driver v1.3 for Mesa 5.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -34,9 +34,13 @@ #ifndef VESA_H_included #define VESA_H_included -#include "../videoint.h" +#include "../internal.h" +extern void *vesa_swbank; +extern void vesa_b_dump_virtual (void); +extern void vesa_l_dump_virtual (void); +extern void vesa_l_dump_virtual_mmx (void); extern vl_driver VESA; diff --git a/src/mesa/drivers/dos/video.c b/src/mesa/drivers/dos/video.c index 16e72cf5810..5f4d9d5bedb 100644 --- a/src/mesa/drivers/dos/video.c +++ b/src/mesa/drivers/dos/video.c @@ -23,32 +23,33 @@ */ /* - * DOS/DJGPP device driver v1.1 for Mesa 4.0 + * DOS/DJGPP device driver v1.3 for Mesa 5.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com * Web : http://www.geocities.com/dborca + * + * Thanks to CrazyPyro (Neil Funk) for FakeColor */ #include #include "video.h" -#include "videoint.h" +#include "internal.h" #include "vesa/vesa.h" +#include "vga/vga.h" -static vl_driver *drv = &VESA; -/* card specific: valid forever */ -word32 vl_hw_granularity; -static unsigned int gran_shift, gran_mask; +static vl_driver *drv; /* based upon mode specific data: valid entire session */ int vl_video_selector; static int video_scanlen, video_bypp; /* valid until next buffer */ +void *vl_current_draw_buffer, *vl_current_read_buffer; +int vl_current_stride, vl_current_width, vl_current_height, vl_current_bytes; int vl_current_offset, vl_current_delta; -static int current_width; @@ -72,38 +73,77 @@ static int _rgb_scale_6[64] = { 226, 230, 234, 238, 242, 246, 250, 255 }; +/* FakeColor data */ +#define R_CNT 6 +#define G_CNT 6 +#define B_CNT 6 +#define R_BIAS 7 +#define G_BIAS 7 +#define B_BIAS 7 -void (*vl_clear) (void *buffer, int bytes, int color); -void (*vl_flip) (void *buffer, int stride, int height); -int (*vl_mixrgba) (const unsigned char rgba[]); +static word32 VGAPalette[256]; +static word8 array_r[256]; +static word8 array_g[256]; +static word8 array_b[256]; + + + +int (*vl_mixfix) (fixed r, fixed g, fixed b); int (*vl_mixrgb) (const unsigned char rgb[]); -void (*vl_putpixel) (void *buffer, int offset, int color); -void (*vl_getrgba) (void *buffer, int offset, unsigned char rgba[4]); +int (*vl_mixrgba) (const unsigned char rgba[]); +void (*vl_getrgba) (unsigned int offset, unsigned char rgba[4]); +void (*vl_clear) (int color); +void (*vl_rect) (int x, int y, int width, int height, int color); +void (*vl_flip) (void); +void (*vl_putpixel) (unsigned int offset, int color); -/* vl_rect: - * Clears a rectange with specified color. +/* Desc: color composition (w/o ALPHA) + * + * In : R, G, B + * Out : color + * + * Note: - */ -void vl_rect (void *buffer, int x, int y, int width, int height, int color) +static int vl_mixfix8fake (fixed r, fixed g, fixed b) { - int offset = y*current_width + x; - int delta = current_width - width; - - for (y=0; y>FIXED_SHIFT]*G_CNT*R_CNT + + array_g[g>>FIXED_SHIFT]*R_CNT + + array_r[r>>FIXED_SHIFT]; +} +#define vl_mixfix8 vl_mixfix8fake +static int vl_mixfix15 (fixed r, fixed g, fixed b) +{ + return ((r>>(3+FIXED_SHIFT))<<10) + |((g>>(3+FIXED_SHIFT))<<5) + |(b>>(3+FIXED_SHIFT)); +} +static int vl_mixfix16 (fixed r, fixed g, fixed b) +{ + return ((r>>(3+FIXED_SHIFT))<<11) + |((g>>(2+FIXED_SHIFT))<<5) + |(b>>(3+FIXED_SHIFT)); +} +#define vl_mixfix24 vl_mixfix32 +static int vl_mixfix32 (fixed r, fixed g, fixed b) +{ + return ((r>>FIXED_SHIFT)<<16) + |((g>>FIXED_SHIFT)<<8) + |(b>>FIXED_SHIFT); } -/* vl_mixrgba*: - * Color composition (w/ ALPHA). +/* Desc: color composition (w/ ALPHA) + * + * In : array of integers (R, G, B, A) + * Out : color + * + * Note: - */ +#define vl_mixrgba8 vl_mixrgb8fake #define vl_mixrgba15 vl_mixrgb15 #define vl_mixrgba16 vl_mixrgb16 #define vl_mixrgba24 vl_mixrgb24 @@ -114,9 +154,20 @@ static int vl_mixrgba32 (const unsigned char rgba[]) -/* vl_mixrgb*: - * Color composition (w/o ALPHA). +/* Desc: color composition (w/o ALPHA) + * + * In : array of integers (R, G, B) + * Out : color + * + * Note: - */ +static int vl_mixrgb8fake (const unsigned char rgba[]) +{ + return array_b[rgba[2]]*G_CNT*R_CNT + + array_g[rgba[1]]*R_CNT + + array_r[rgba[0]]; +} +#define vl_mixrgb8 vl_mixrgb8fake static int vl_mixrgb15 (const unsigned char rgb[]) { return ((rgb[0]>>3)<<10)|((rgb[1]>>3)<<5)|(rgb[2]>>3); @@ -133,36 +184,57 @@ static int vl_mixrgb32 (const unsigned char rgb[]) -/* v_getrgba*: - * Color decomposition. +/* Desc: color decomposition + * + * In : pixel offset, array of integers to hold color components (R, G, B, A) + * Out : - + * + * Note: uses current read buffer */ -static void v_getrgba15 (void *buffer, int offset, unsigned char rgba[4]) +static void v_getrgba8fake6 (unsigned int offset, unsigned char rgba[]) { - int c = ((word16 *)buffer)[offset]; + word32 c = VGAPalette[((word8 *)vl_current_read_buffer)[offset]]; + rgba[0] = _rgb_scale_6[(c >> 16) & 0x3F]; + rgba[1] = _rgb_scale_6[(c >> 8) & 0x3F]; + rgba[2] = _rgb_scale_6[c & 0x3F]; + rgba[3] = c >> 24; +} +static void v_getrgba8fake8 (unsigned int offset, unsigned char rgba[]) +{ + word32 c = VGAPalette[((word8 *)vl_current_read_buffer)[offset]]; + rgba[0] = c >> 16; + rgba[1] = c >> 8; + rgba[2] = c; + rgba[3] = c >> 24; +} +#define v_getrgba8 v_getrgba8fake6 +static void v_getrgba15 (unsigned int offset, unsigned char rgba[4]) +{ + word32 c = ((word16 *)vl_current_read_buffer)[offset]; rgba[0] = _rgb_scale_5[(c >> 10) & 0x1F]; rgba[1] = _rgb_scale_5[(c >> 5) & 0x1F]; rgba[2] = _rgb_scale_5[c & 0x1F]; rgba[3] = 255; } -static void v_getrgba16 (void *buffer, int offset, unsigned char rgba[4]) +static void v_getrgba16 (unsigned int offset, unsigned char rgba[4]) { - int c = ((word16 *)buffer)[offset]; + word32 c = ((word16 *)vl_current_read_buffer)[offset]; rgba[0] = _rgb_scale_5[(c >> 11) & 0x1F]; rgba[1] = _rgb_scale_6[(c >> 5) & 0x3F]; rgba[2] = _rgb_scale_5[c & 0x1F]; rgba[3] = 255; } -static void v_getrgba24 (void *buffer, int offset, unsigned char rgba[4]) +static void v_getrgba24 (unsigned int offset, unsigned char rgba[4]) { - int c = *(word32 *)((long)buffer+offset*3); + word32 c = *(word32 *)((long)vl_current_read_buffer+offset*3); rgba[0] = c >> 16; rgba[1] = c >> 8; rgba[2] = c; rgba[3] = 255; } -static void v_getrgba32 (void *buffer, int offset, unsigned char rgba[4]) +static void v_getrgba32 (unsigned int offset, unsigned char rgba[4]) { - int c = ((word32 *)buffer)[offset]; + word32 c = ((word32 *)vl_current_read_buffer)[offset]; rgba[0] = c >> 16; rgba[1] = c >> 8; rgba[2] = c; @@ -171,54 +243,158 @@ static void v_getrgba32 (void *buffer, int offset, unsigned char rgba[4]) -/* vl_sync_buffer: - * Syncs buffer with video hardware. Returns NULL in case of failure. +/* Desc: set one palette entry + * + * In : index, R, G, B + * Out : - + * + * Note: color components are in range [0.0 .. 1.0] + */ +void vl_setCI (int index, float red, float green, float blue) +{ + drv->setCI_f(index, red, green, blue); +} + + + +/* Desc: read pixel from 8bit buffer + * + * In : pixel offset + * Out : pixel read + * + * Note: used only for CI modes + */ +int vl_getCIpixel (unsigned int offset) +{ + return ((word8 *)vl_current_read_buffer)[offset]; +} + + + +/* Desc: set one palette entry + * + * In : color, R, G, B + * Out : - + * + * Note: color components are in range [0 .. 63] + */ +static void fake_setcolor (int c, int r, int g, int b) +{ + VGAPalette[c] = 0xff000000 | (r<<16) | (g<<8) | b; + + drv->setCI_i(c, r, g, b); +} + + + +/* Desc: build FakeColor palette + * + * In : CI precision in bits + * Out : - + * + * Note: - + */ +static void fake_buildpalette (int bits) +{ + double c_r, c_g, c_b; + int r, g, b, color = 0; + + double max = (1 << bits) - 1; + + for (b=0; bmode&0x4000) { - vl_flip = l_dump_virtual; - } else { - { int n; for (gran_shift=0, n=p->gran; n; gran_shift++, n>>=1) ; } - gran_mask = (1<<(--gran_shift)) - 1; - if ((unsigned)p->gran != (gran_mask+1)) { - return -1; - } - vl_hw_granularity = p->gran; - vl_flip = b_dump_virtual; - } +#ifdef USE_MMX_ASM + extern int _mesa_identify_x86_cpu_features (void); + int _mesa_x86_cpu_features = _mesa_identify_x86_cpu_features(); + return (_mesa_x86_cpu_features & 0x00800000); +#else + return 0; +#endif +} + + +/* Desc: setup mode + * + * In : ptr to mode definition + * Out : 0 if success + * + * Note: - + */ +static int vl_setup_mode (vl_mode *p) +{ #define INITPTR(bpp) \ vl_putpixel = v_putpixel##bpp; \ vl_getrgba = v_getrgba##bpp; \ - vl_clear = v_clear##bpp; \ + vl_rect = v_rect##bpp; \ + vl_mixfix = vl_mixfix##bpp; \ vl_mixrgb = vl_mixrgb##bpp; \ - vl_mixrgba = vl_mixrgba##bpp; - + vl_mixrgba = vl_mixrgba##bpp; \ + vl_clear = vl_can_mmx() ? v_clear##bpp##_mmx : v_clear##bpp + switch (p->bpp) { + case 8: + INITPTR(8); + break; case 15: INITPTR(15); break; @@ -246,9 +422,12 @@ static int vl_setup_mode (vl_mode *p) -/* vl_video_exit: - * Shutdown the video engine. - * Restores to the mode prior to first call to `vl_video_init'. +/* Desc: restore to the mode prior to first call to `vl_video_init'. + * + * In : - + * Out : - + * + * Note: - */ void vl_video_exit (void) { @@ -258,20 +437,33 @@ void vl_video_exit (void) -/* vl_video_init: - * Enter mode. +/* Desc: enter mode * - * success: 0 - * failure: -1 + * In : xres, yres, bits/pixel, RGB, refresh rate + * Out : pixel width in bits if success + * + * Note: - */ -int vl_video_init (int width, int height, int bpp, int refresh) +int vl_video_init (int width, int height, int bpp, int rgb, int refresh) { + int fake; vl_mode *p, *q; unsigned int min; + fake = 0; + if (!rgb) { + bpp = 8; + } else if (bpp == 8) { + fake = 1; + } + /* initialize hardware */ - if ((q=drv->getmodes()) == NULL) { - return -1; + drv = &VESA; + if ((q=drv->init()) == NULL) { + drv = &VGA; + if ((q=drv->init()) == NULL) { + return 0; + } } /* search for a mode that fits our request */ @@ -286,9 +478,17 @@ int vl_video_init (int width, int height, int bpp, int refresh) /* check, setup and enter mode */ if ((p!=NULL) && (vl_setup_mode(p) == 0) && (drv->entermode(p, refresh) == 0)) { - return 0; + vl_flip = drv->blit; + if (fake) { + min = drv->getCIprec(); + fake_buildpalette(min); + if (min == 8) { + vl_getrgba = v_getrgba8fake8; + } + } + return bpp; } /* abort */ - return -1; + return 0; } diff --git a/src/mesa/drivers/dos/video.h b/src/mesa/drivers/dos/video.h index 868007f6fac..3197338e632 100644 --- a/src/mesa/drivers/dos/video.h +++ b/src/mesa/drivers/dos/video.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.1 for Mesa 4.0 + * DOS/DJGPP device driver v1.3 for Mesa 5.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -34,19 +34,24 @@ #ifndef VIDEO_H_included #define VIDEO_H_included -int vl_video_init (int width, int height, int bpp, int refresh); -void vl_video_exit (void); +typedef int fixed; -void *vl_sync_buffer (void *buffer, int x, int y, int width, int height); +extern int (*vl_mixfix) (fixed r, fixed g, fixed b); +extern int (*vl_mixrgb) (const unsigned char rgb[]); +extern int (*vl_mixrgba) (const unsigned char rgba[]); +extern void (*vl_getrgba) (unsigned int offset, unsigned char rgba[4]); -extern void (*vl_clear) (void *buffer, int bytes, int color); -void vl_rect (void *buffer, int x, int y, int width, int height, int color); +extern void (*vl_clear) (int color); +extern void (*vl_rect) (int x, int y, int width, int height, int color); +extern void (*vl_flip) (void); +extern void (*vl_putpixel) (unsigned int offset, int color); -void (*vl_flip) (void *buffer, int stride, int height); +void vl_setCI (int index, float red, float green, float blue); +int vl_getCIpixel (unsigned int offset); -extern int (*vl_mixrgba) (const unsigned char rgba[]); -extern int (*vl_mixrgb) (const unsigned char rgb[]); -extern void (*vl_putpixel) (void *buffer, int offset, int color); -extern void (*vl_getrgba) (void *buffer, int offset, unsigned char rgba[4]); +void *vl_sync_buffer (void *buffer, int x, int y, int width, int height); + +void vl_video_exit (void); +int vl_video_init (int width, int height, int bpp, int rgb, int refresh); #endif diff --git a/src/mesa/drivers/dos/virtual.S b/src/mesa/drivers/dos/virtual.S index 3633161c982..4dbbbb3e3f8 100644 --- a/src/mesa/drivers/dos/virtual.S +++ b/src/mesa/drivers/dos/virtual.S @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.1 for Mesa 4.0 + * DOS/DJGPP device driver v1.3 for Mesa 5.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -34,60 +34,153 @@ .file "virtual.S" /* - * extern word32 vl_hw_granularity; - * extern int vl_video_selector; - * extern int vl_current_offset, vl_current_delta; + * extern void *vl_current_draw_buffer; + * extern int vl_current_width, vl_current_bytes; */ .text -/* - * void v_clear16 (void *buffer, int bytes, int color); +/* Desc: void v_clear8 (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer */ - .balign 4 + .p2align 5,,31 + .global _v_clear8 +_v_clear8: + movl 4(%esp), %eax + movb %al, %ah + pushw %ax + pushw %ax + popl %eax + jmp _v_clear_common + +/* Desc: void v_clear16 (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 .global _v_clear16 _v_clear16: - movl 12(%esp), %eax + movl 4(%esp), %eax pushw %ax pushw %ax popl %eax jmp _v_clear_common -/* - * void v_clear32 (void *buffer, int bytes, int color); +/* Desc: void v_clear32 (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer */ - .balign 4 + .p2align 5,,31 .global _v_clear32 _v_clear32: - movl 12(%esp), %eax + movl 4(%esp), %eax .balign 4 _v_clear_common: - movl 8(%esp), %ecx - movl 4(%esp), %edx + movl _vl_current_bytes, %ecx + movl _vl_current_draw_buffer, %edx shrl $2, %ecx - 0: .balign 4 + 0: movl %eax, (%edx) addl $4, %edx decl %ecx jnz 0b ret -/* - * void v_clear24 (void *buffer, int bytes, int color); +/* Desc: void v_clear8_mmx (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_clear8_mmx +_v_clear8_mmx: + movl 4(%esp), %eax + movb %al, %ah + pushw %ax + pushw %ax + pushw %ax + pushw %ax + jmp _v_clear_common_mmx + +/* Desc: void v_clear16_mmx (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer */ + .p2align 5,,31 + .global _v_clear16_mmx +_v_clear16_mmx: + movl 4(%esp), %eax + pushw %ax + pushw %ax + pushw %ax + pushw %ax + jmp _v_clear_common_mmx + +/* Desc: void v_clear32_mmx (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_clear32_mmx +_v_clear32_mmx: + movl 4(%esp), %eax + pushl %eax + pushl %eax .balign 4 +_v_clear_common_mmx: +#ifdef USE_MMX_ASM + movl _vl_current_bytes, %ecx + movl _vl_current_draw_buffer, %edx + movq (%esp), %mm0 + shrl $3, %ecx + .balign 4 + 0: + movq %mm0, (%edx) + addl $8, %edx + decl %ecx + jnz 0b + emms +#endif + addl $8, %esp + ret + +/* Desc: void v_clear24 (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 .global _v_clear24 _v_clear24: - movl 8(%esp), %edx movl $0xaaaaaaab, %eax - mull %edx - movl 12(%esp), %eax + mull _vl_current_bytes + movl 4(%esp), %eax movl %edx, %ecx - movl 4(%esp), %edx pushl %ebx + movl _vl_current_draw_buffer, %edx shrl %ecx - movb 18(%esp), %bl + movb 10(%esp), %bl .balign 4 0: movw %ax, (%edx) @@ -98,140 +191,304 @@ _v_clear24: popl %ebx ret -/* - * void b_dump_virtual (void *buffer, int stride, int height); +/* Desc: void v_clear24_mmx (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer */ + .p2align 5,,31 + .global _v_clear24_mmx +_v_clear24_mmx: +#ifdef USE_MMX_ASM + movl 4(%esp), %eax + movl %eax, %edx + movl %eax, %ecx + shll $16, %edx + rorl $8, %ecx + movw %cx, %dx + rorl $16, %ecx + movb %dh, %cl + shll $8, %eax + movb %ch, %al + rorl $8, %eax + + pushl %edx + pushl %eax + movq (%esp), %mm0 + pushl %ecx + movq (%esp), %mm1 + pushl %edx + movq (%esp), %mm2 + + movl $0xaaaaaaab, %eax + mull _vl_current_bytes + movl %edx, %ecx + movl _vl_current_draw_buffer, %edx + shrl $4, %ecx .balign 4 - .global _b_dump_virtual -_b_dump_virtual: - pushl %ebx + 0: + movq %mm0, (%edx) + movq %mm1, 8(%edx) + movq %mm2, 16(%edx) + addl $24, %edx + decl %ecx + jnz 0b + emms + addl $16, %esp +#endif + ret + +/* Desc: void v_rect8 (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_rect8 +_v_rect8: + cld pushl %esi pushl %edi - pushl %ebp - movl _vl_video_selector, %fs - movl 4*4+4+0(%esp), %esi - movl _vl_hw_granularity, %ebp - xorl %edx, %edx - movl _vl_current_offset, %eax - divl %ebp - movl %edx, %edi - pushl %eax - movl %eax, %edx - xorl %ebx, %ebx - movw $0x4f05, %ax - int $0x10 - movl _vl_current_delta, %ebx - movl 5*4+4+4(%esp), %ecx - movl 5*4+4+8(%esp), %edx - shrl $2, %ecx + movl 28(%esp), %eax + movl _vl_current_width, %esi + movl 16(%esp), %edi + movb %al, %ah + movl 20(%esp), %ecx + imull %esi, %edi + movl 24(%esp), %edx + subl %ecx, %esi + addl 12(%esp), %edi + pushw %ax + pushw %ax + pushl %ds + popl %es + addl _vl_current_draw_buffer, %edi + popl %eax + pushl %ebx + movl %ecx, %ebx + andl $3, %ebx .balign 4 0: pushl %ecx .balign 4 1: - cmpl %ebp, %edi - jb 2f - pushl %ebx - pushl %edx - incl 12(%esp) - movw $0x4f05, %ax - movl 12(%esp), %edx - xorl %ebx, %ebx - int $0x10 - popl %edx + shrl $2, %ecx + rep; stosl + testl %ebx, %ebx + jz 2f + movl %ebx, %ecx + rep; stosb + .balign 4 + 2: + popl %ecx + addl %esi, %edi + decl %edx + jnz 0b popl %ebx - subl %ebp, %edi + popl %edi + popl %esi + ret + +/* Desc: void v_rect16 (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_rect16 +_v_rect16: + cld + pushl %esi + pushl %edi + movl 28(%esp), %eax + movl _vl_current_width, %esi + movl 16(%esp), %edi + movl 20(%esp), %ecx + imull %esi, %edi + movl 24(%esp), %edx + subl %ecx, %esi + addl 12(%esp), %edi + pushw %ax + shll %esi + pushw %ax + shll %edi + pushl %ds + popl %es + addl _vl_current_draw_buffer, %edi + popl %eax + .balign 4 + 0: + pushl %ecx + .balign 4 + 1: + shrl %ecx + rep; stosl + jnc 2f + stosw + .balign 4 2: - movl (%esi), %eax - addl $4, %esi - movl %eax, %fs:(%edi) - addl $4, %edi + popl %ecx + addl %esi, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + ret + +/* Desc: void v_rect24 (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_rect24 +_v_rect24: + pushl %esi + pushl %edi + movl 28(%esp), %eax + movl _vl_current_width, %esi + movl 16(%esp), %edi + movl 20(%esp), %ecx + imull %esi, %edi + movl 24(%esp), %edx + subl %ecx, %esi + addl 12(%esp), %edi + leal (%esi, %esi, 2), %esi + pushl %ebx + leal (%edi, %edi, 2), %edi + movl %eax, %ebx + addl _vl_current_draw_buffer, %edi + shrl $16, %ebx + .balign 4 + 0: + pushl %ecx + .balign 4 + 1: + movw %ax, (%edi) + movb %bl, 2(%edi) + addl $3, %edi decl %ecx jnz 1b popl %ecx - addl %ebx, %edi + addl %esi, %edi decl %edx jnz 0b - popl %eax - popl %ebp + popl %ebx popl %edi popl %esi - popl %ebx ret -/* - * void l_dump_virtual (void *buffer, int stride, int height); +/* Desc: void v_rect32 (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer */ - .balign 4 - .global _l_dump_virtual -_l_dump_virtual: - pushl %ebx + .p2align 5,,31 + .global _v_rect32 +_v_rect32: pushl %esi pushl %edi - movl _vl_video_selector, %fs - movl 3*4+4+0(%esp), %esi - movl _vl_current_offset, %edi - movl 3*4+4+4(%esp), %ecx - movl 3*4+4+8(%esp), %edx - movl _vl_current_delta, %ebx - shrl $2, %ecx + movl _vl_current_width, %esi + movl 16(%esp), %edi + movl 20(%esp), %ecx + imull %esi, %edi + movl 24(%esp), %edx + subl %ecx, %esi + addl 12(%esp), %edi + shll $2, %esi + shll $2, %edi + movl 28(%esp), %eax + addl _vl_current_draw_buffer, %edi .balign 4 0: pushl %ecx .balign 4 1: - movl (%esi), %eax - addl $4, %esi - movl %eax, %fs:(%edi) + movl %eax, (%edi) addl $4, %edi decl %ecx jnz 1b popl %ecx - addl %ebx, %edi + addl %esi, %edi decl %edx jnz 0b popl %edi popl %esi - popl %ebx ret -/* - * void v_putpixel16 (void *buffer, int offset, int color); +/* Desc: void v_putpixel8 (unsigned int offset, int color); + * + * In : offset within buffer, color + * Out : - + * + * Note: uses current draw buffer */ - .balign 4 + .p2align 5,,31 + .global _v_putpixel8 +_v_putpixel8: + movl 8(%esp), %ecx + movl 4(%esp), %edx + movl _vl_current_draw_buffer, %eax + movb %cl, (%eax,%edx) + ret + +/* Desc: void v_putpixel16 (unsigned int offset, int color); + * + * In : offset within buffer, color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 .global _v_putpixel16 _v_putpixel16: - movl 8(%esp), %edx - shll %edx - movl 12(%esp), %eax - addl 4(%esp), %edx - movw %ax, (%edx) + movl 8(%esp), %ecx + movl 4(%esp), %edx + movl _vl_current_draw_buffer, %eax + movw %cx, (%eax,%edx,2) ret -/* - * void v_putpixel24 (void *buffer, int offset, int color); +/* Desc: void v_putpixel24 (unsigned int offset, int color); + * + * In : offset within buffer, color + * Out : - + * + * Note: uses current draw buffer */ - .balign 4 + .p2align 5,,31 .global _v_putpixel24 _v_putpixel24: + movl 4(%esp), %eax movl 8(%esp), %edx - leal (%edx, %edx, 2), %edx - movl 12(%esp), %eax - addl 4(%esp), %edx - movw %ax, (%edx) - shrl $16, %eax - movb %al, 2(%edx) + movl _vl_current_draw_buffer, %ecx + leal (%eax,%eax,2), %eax + movw %dx, (%ecx,%eax) + shrl $16, %edx + movb %dl, 2(%ecx,%eax) ret -/* - * void v_putpixel32 (void *buffer, int offset, int color); +/* Desc: void v_putpixel32 (unsigned int offset, int color); + * + * In : offset within buffer, color + * Out : - + * + * Note: uses current draw buffer */ - .balign 4 + .p2align 5,,31 .global _v_putpixel32 _v_putpixel32: - movl 8(%esp), %edx - shll $2, %edx - movl 12(%esp), %eax - addl 4(%esp), %edx - movl %eax, (%edx) + movl 8(%esp), %ecx + movl 4(%esp), %edx + movl _vl_current_draw_buffer, %eax + movl %ecx, (%eax,%edx,4) ret diff --git a/src/mesa/main/Makefile.DJ b/src/mesa/main/Makefile.DJ index b9e0024ad73..5301eea352a 100644 --- a/src/mesa/main/Makefile.DJ +++ b/src/mesa/main/Makefile.DJ @@ -20,7 +20,7 @@ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# DOS/DJGPP core makefile v1.2 for Mesa 4.1 +# DOS/DJGPP core makefile v1.3 for Mesa 5.0 # # Copyright (C) 2002 - Borca Daniel # Email : dborca@yahoo.com @@ -75,10 +75,10 @@ CFLAGS += -D__DOS__ -I$(GLIDE) -DFX -DFX_GLIDE3 -DFXMESA_USE_ARGB endif AR = ar -ARFLAGS = ru +ARFLAGS = rus -ifneq ($(wildcard $(DJDIR)/lib/dxe2.ld),) -DXE2GEN = $(wildcard $(addsuffix /dxe2gen.exe,$(subst ;, ,$(PATH)))) +ifneq ($(wildcard $(DJDIR)/lib/dxe3.ld),) +DXE3GEN = $(wildcard $(addsuffix /dxe3gen.exe,$(subst ;, ,$(PATH)))) endif RM = del @@ -249,15 +249,18 @@ else X86_SOURCES = endif -ifndef FX DRIVER_SOURCES = \ - DOS/dmesa.c \ + DOS/dmesa.c +ifndef FX +DRIVER_SOURCES += \ DOS/video.c \ DOS/virtual.S \ DOS/vesa/vesa.c \ + DOS/vesa/blit.S \ + DOS/vga/vga.c \ DOS/dpmi.c else -DRIVER_SOURCES = \ +DRIVER_SOURCES += \ FX/fxapi.c \ FX/fxdd.c \ FX/fxddspan.c \ @@ -276,11 +279,11 @@ OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) X86_OBJECTS = $(addsuffix .o,$(basename $(X86_SOURCES))) .c.o: - $(CC) -o $@ -c $(CFLAGS) $< + $(CC) -o $@ $(CFLAGS) -c $< .S.o: - $(CC) -o $@ -c $(CFLAGS) $< + $(CC) -o $@ $(CFLAGS) -c $< .s.o: - $(CC) -o $@ -c $(CFLAGS) -x assembler-with-cpp $< + $(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $< all: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP) @@ -288,11 +291,15 @@ $(LIBDIR)/$(GL_LIB): $(OBJECTS) $(AR) $(ARFLAGS) $(LIBDIR)/$(GL_LIB) $(OBJECTS) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP): $(OBJECTS) -ifeq ($(DXE2GEN),) - $(warning Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN) - $(warning somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.) +ifeq ($(DXE3GEN),) + $(warning Missing DXE3GEN and/or DXE3.LD! You must have DXE3GEN) + $(warning somewhere in PATH, and DXE3.LD in DJGPP/LIB directory.) else - -dxe2gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) $(OBJECTS) -E djgpp_ -E gl -E DMesa -E fxMesa -D "Mesa DJGPP GL" -U +ifdef FX + -dxe3gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) -D "MesaGL/FX DJGPP" -E gl -E DMesa -X -P glid3.dxe -U $(OBJECTS) +else + -dxe3gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) -D "MesaGL DJGPP" -E gl -E DMesa -X -U $(OBJECTS) +endif endif $(X86_OBJECTS): X86/matypes.h @@ -313,6 +320,7 @@ clean: -$(RM) $(subst /,\,X86/*.o) -$(RM) $(subst /,\,DOS/*.o) -$(RM) $(subst /,\,DOS/vesa/*.o) + -$(RM) $(subst /,\,DOS/vga/*.o) -$(RM) $(subst /,\,FX/*.o) -include depend -- cgit v1.2.3 From e58286ccb6e47a91ea5bc06e7dc54a17b674c9c3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 14 Jan 2003 04:49:31 +0000 Subject: prototype render-to-texture --- include/GL/glx.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 4236ece75af..88fa0f571c9 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,4 +1,4 @@ -/* $Id: glx.h,v 1.38 2002/10/14 13:52:27 brianp Exp $ */ +/* $Id: glx.h,v 1.39 2003/01/14 04:49:31 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -485,6 +485,19 @@ typedef GLuint (* PFNGLXGETAGPOFFSETMESAPROC) (const GLvoid *pointer); #endif /* GLX_MESA_agp_offset */ +/* + * ARB ?. GLX_ARB_render_texture + */ +#ifndef GLX_ARB_render_texture +#define GLX_ARB_render_texture 1 + +extern Bool glXBindTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer); +extern Bool glXReleaseTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer); +extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attribList); + +#endif /* GLX_ARB_render_texture */ + + #ifdef __cplusplus } -- cgit v1.2.3 From cf01d97dc3e23af067dd9633a2bfa61a6a794ce6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 14 Jan 2003 04:50:14 +0000 Subject: GL_NV_fragment_program --- include/GL/gl.h | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 44254a77ff6..e1799523693 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.72 2002/10/17 19:39:31 kschultz Exp $ */ +/* $Id: gl.h,v 1.73 2003/01/14 04:50:14 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2647,6 +2647,69 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 + +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 + + +extern void +glProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, + GLfloat x, GLfloat y, GLfloat z, GLfloat w); + +extern void +glProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte *name, + GLdouble x, GLdouble y, GLdouble z, GLdouble w); + +extern void +glProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte *name, + const float v[]); + +extern void +glProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte *name, + const double v[]); + +extern void +glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name, + GLfloat *params); + +extern void +glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, + GLdouble *params); + +extern void +glProgramLocalParameter4dARB(GLenum target, GLuint index, + GLdouble x, GLdouble y, GLdouble z, GLdouble w); + +extern void +glProgramLocalParameter4dvARB(GLenum target, GLuint index, + const GLdouble *params); + +extern void +glProgramLocalParameter4fARB(GLenum target, GLuint index, + GLfloat x, GLfloat y, GLfloat z, GLfloat w); + +extern void +glProgramLocalParameter4fvARB(GLenum target, GLuint index, + const GLfloat *params); + +extern void +glGetProgramLocalParameterdvARB(GLenum target, GLuint index, GLdouble *params); + +extern void +glGetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat *params); + + +#endif /* GL_NV_fragment_program */ + + + + /********************************************************************** * Begin system-specific stuff */ -- cgit v1.2.3 From 943f0c6a41aa66705ffba90a55cf75296b0bde1d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 21 Jan 2003 15:49:06 +0000 Subject: GL_ATI_texture_env_combine3 extension --- docs/RELNOTES-5.1 | 5 +- docs/VERSIONS | 5 +- include/GL/glext.h | 8 + src/mesa/main/enums.c | 11 +- src/mesa/main/extensions.c | 4 +- src/mesa/main/mtypes.h | 3 +- src/mesa/main/texstate.c | 256 ++++++++++++++++-------------- src/mesa/swrast/s_texture.c | 374 ++++++++++++++++++++++++++++++++++---------- 8 files changed, 462 insertions(+), 204 deletions(-) (limited to 'include') diff --git a/docs/RELNOTES-5.1 b/docs/RELNOTES-5.1 index 09786e0214b..a1ad9478025 100644 --- a/docs/RELNOTES-5.1 +++ b/docs/RELNOTES-5.1 @@ -18,6 +18,9 @@ Odd-numbered versions (such as 5.1) designate new developmental releases. New Features in Mesa 5.1 ------------------------ +GL_ATI_texture_env_combine3 extension + This adds a few new texture combine modes. + Contributed by Ian Romanick. @@ -49,4 +52,4 @@ driver call the _mesa_enable_1_4_extensions() function. ---------------------------------------------------------------------- -$Id: RELNOTES-5.1,v 1.1 2002/12/18 14:57:34 brianp Exp $ +$Id: RELNOTES-5.1,v 1.2 2003/01/21 15:50:24 brianp Exp $ diff --git a/docs/VERSIONS b/docs/VERSIONS index e1a8399b1f8..953485d254c 100644 --- a/docs/VERSIONS +++ b/docs/VERSIONS @@ -1,4 +1,4 @@ -$Id: VERSIONS,v 1.120 2002/12/18 14:56:59 brianp Exp $ +$Id: VERSIONS,v 1.121 2003/01/21 15:50:24 brianp Exp $ Mesa Version History @@ -1084,10 +1084,11 @@ Mesa Version History 5.1 Month day, 2003 New: - - + - GL_ATI_texture_env_combine3 extension (Ian Romanick) Bug fixes: - really enable OpenGL 1.4 features in DOS driver. - glAreProgramsResidentNV was slightly incorrect + - fixed issues in glDrawPixels and glCopyPixels for very wide images Changes: - dropped API trace feature (src/Trace/) diff --git a/include/GL/glext.h b/include/GL/glext.h index 245f100c706..7d1f396bbd4 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -2423,6 +2423,11 @@ extern "C" { #define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 #endif +#ifndef GL_ATI_texture_env_combine3 +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 +#endif /*************************************************************/ @@ -5016,6 +5021,9 @@ GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum); typedef void (APIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); #endif +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 +#endif #ifdef __cplusplus } diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 7a080e9592f..1f95dec15cc 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -1,4 +1,4 @@ -/* $Id: enums.c,v 1.24 2002/10/29 20:28:45 brianp Exp $ */ +/* $Id: enums.c,v 1.25 2003/01/21 15:49:13 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -837,11 +837,16 @@ enum_elt all_enums[] = { "GL_DOT3_RGBA_EXT", 0x8741 }, /* GL_ARB_texture_env_dot3 */ - { "GL_DOT3_RGB_EXT", 0x86ae }, - { "GL_DOT3_RGBA_EXT", 0x86af }, + { "GL_DOT3_RGB_ARB", 0x86ae }, + { "GL_DOT3_RGBA_ARB", 0x86af }, /* GL_ARB_texture_border_clamp */ { "GL_CLAMP_TO_BORDER_ARB", 0x812D }, + + /* GL_ATI_texture_env_combine3 */ + { "GL_MODULATE_ADD_ATI", 0x8744 }, + { "GL_MODULATE_SIGNED_ADD_ATI", 0x8745 }, + { "GL_MODULATE_SUBTRACT_ATI", 0x8746 }, }; #define Elements(x) sizeof(x)/sizeof(*x) diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 836216436cb..296308c4370 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -1,4 +1,4 @@ -/* $Id: extensions.c,v 1.86 2003/01/14 04:55:45 brianp Exp $ */ +/* $Id: extensions.c,v 1.87 2003/01/21 15:49:14 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -69,6 +69,7 @@ static struct { { ON, "GL_ARB_transpose_matrix", 0 }, { ON, "GL_ARB_window_pos", F(ARB_window_pos) }, { OFF, "GL_ATI_texture_mirror_once", F(ATI_texture_mirror_once)}, + { OFF, "GL_ATI_texture_env_combine3", F(ATI_texture_env_combine3)}, { ON, "GL_EXT_abgr", 0 }, { ON, "GL_EXT_bgra", 0 }, { OFF, "GL_EXT_blend_color", F(EXT_blend_color) }, @@ -157,6 +158,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) "GL_ARB_texture_env_crossbar", "GL_ARB_texture_env_dot3", "GL_ARB_texture_mirrored_repeat", + "GL_ATI_texture_env_combine3", "GL_ATI_texture_mirror_once", "GL_EXT_blend_color", "GL_EXT_blend_func_separate", diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index dfb3f1255eb..353dc0d471b 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1,4 +1,4 @@ -/* $Id: mtypes.h,v 1.98 2003/01/14 04:55:45 brianp Exp $ */ +/* $Id: mtypes.h,v 1.99 2003/01/21 15:49:15 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1348,6 +1348,7 @@ struct gl_extensions { GLboolean ARB_texture_mirrored_repeat; GLboolean ARB_window_pos; GLboolean ATI_texture_mirror_once; + GLboolean ATI_texture_env_combine3; GLboolean EXT_blend_color; GLboolean EXT_blend_func_separate; GLboolean EXT_blend_logic_op; diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index b511b1a8d36..6762ee9ea91 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1,4 +1,4 @@ -/* $Id: texstate.c,v 1.91 2003/01/16 15:22:13 brianp Exp $ */ +/* $Id: texstate.c,v 1.92 2003/01/21 15:49:17 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -171,7 +171,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) mode == GL_DECAL || mode == GL_REPLACE || (mode == GL_ADD && ctx->Extensions.EXT_texture_env_add) || - (mode == GL_COMBINE_EXT && + (mode == GL_COMBINE && (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine))) { /* legal */ @@ -199,7 +199,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) COPY_4FV(texUnit->EnvColor, tmp); } break; - case GL_COMBINE_RGB_EXT: + case GL_COMBINE_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { const GLenum mode = (GLenum) (GLint) *param; @@ -207,11 +207,11 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) case GL_REPLACE: case GL_MODULATE: case GL_ADD: - case GL_ADD_SIGNED_EXT: - case GL_INTERPOLATE_EXT: + case GL_ADD_SIGNED: + case GL_INTERPOLATE: /* OK */ break; - case GL_SUBTRACT_ARB: + case GL_SUBTRACT: if (!ctx->Extensions.ARB_texture_env_combine) { TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); return; @@ -224,13 +224,21 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } break; - case GL_DOT3_RGB_ARB: - case GL_DOT3_RGBA_ARB: + case GL_DOT3_RGB: + case GL_DOT3_RGBA: if (!ctx->Extensions.ARB_texture_env_dot3) { TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); return; } break; + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: + if (!ctx->Extensions.ATI_texture_env_combine3) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + return; + } + break; default: TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); return; @@ -245,47 +253,63 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } break; - case GL_COMBINE_ALPHA_EXT: + case GL_COMBINE_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { const GLenum mode = (GLenum) (GLint) *param; - if (mode == GL_REPLACE || - mode == GL_MODULATE || - mode == GL_ADD || - mode == GL_ADD_SIGNED_EXT || - mode == GL_INTERPOLATE_EXT || - (mode == GL_SUBTRACT_ARB && - ctx->Extensions.ARB_texture_env_combine)) { - /* legal */ - if (texUnit->CombineModeA == mode) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->CombineModeA = mode; - } - else { - TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + switch (mode) { + case GL_REPLACE: + case GL_MODULATE: + case GL_ADD: + case GL_ADD_SIGNED: + case GL_INTERPOLATE: + /* OK */ + break; + case GL_SUBTRACT: + if (!ctx->Extensions.ARB_texture_env_combine) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + return; + } + break; + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: + if (!ctx->Extensions.ATI_texture_env_combine3) { + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); + return; + } + break; + default: + TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", mode); return; } + + if (texUnit->CombineModeA == mode) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->CombineModeA = mode; } else { TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname); return; } break; - case GL_SOURCE0_RGB_EXT: - case GL_SOURCE1_RGB_EXT: - case GL_SOURCE2_RGB_EXT: + case GL_SOURCE0_RGB: + case GL_SOURCE1_RGB: + case GL_SOURCE2_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { const GLenum source = (GLenum) (GLint) *param; - const GLuint s = pname - GL_SOURCE0_RGB_EXT; + const GLuint s = pname - GL_SOURCE0_RGB; if (source == GL_TEXTURE || - source == GL_CONSTANT_EXT || - source == GL_PRIMARY_COLOR_EXT || - source == GL_PREVIOUS_EXT || + source == GL_CONSTANT || + source == GL_PRIMARY_COLOR || + source == GL_PREVIOUS || (ctx->Extensions.ARB_texture_env_crossbar && - source >= GL_TEXTURE0_ARB && - source < GL_TEXTURE0_ARB + ctx->Const.MaxTextureUnits)) { + source >= GL_TEXTURE0 && + source < GL_TEXTURE0 + ctx->Const.MaxTextureUnits) || + (ctx->Extensions.ATI_texture_env_combine3 && + (source == GL_ZERO || source == GL_ONE))) { /* legal */ if (texUnit->CombineSourceRGB[s] == source) return; @@ -302,20 +326,22 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } break; - case GL_SOURCE0_ALPHA_EXT: - case GL_SOURCE1_ALPHA_EXT: - case GL_SOURCE2_ALPHA_EXT: + case GL_SOURCE0_ALPHA: + case GL_SOURCE1_ALPHA: + case GL_SOURCE2_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { const GLenum source = (GLenum) (GLint) *param; - const GLuint s = pname - GL_SOURCE0_ALPHA_EXT; + const GLuint s = pname - GL_SOURCE0_ALPHA; if (source == GL_TEXTURE || - source == GL_CONSTANT_EXT || - source == GL_PRIMARY_COLOR_EXT || - source == GL_PREVIOUS_EXT || + source == GL_CONSTANT || + source == GL_PRIMARY_COLOR || + source == GL_PREVIOUS || (ctx->Extensions.ARB_texture_env_crossbar && - source >= GL_TEXTURE0_ARB && - source < GL_TEXTURE0_ARB + ctx->Const.MaxTextureUnits)) { + source >= GL_TEXTURE0 && + source < GL_TEXTURE0 + ctx->Const.MaxTextureUnits) || + (ctx->Extensions.ATI_texture_env_combine3 && + (source == GL_ZERO || source == GL_ONE))) { /* legal */ if (texUnit->CombineSourceA[s] == source) return; @@ -332,12 +358,12 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } break; - case GL_OPERAND0_RGB_EXT: - case GL_OPERAND1_RGB_EXT: + case GL_OPERAND0_RGB: + case GL_OPERAND1_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { const GLenum operand = (GLenum) (GLint) *param; - const GLuint s = pname - GL_OPERAND0_RGB_EXT; + const GLuint s = pname - GL_OPERAND0_RGB; switch (operand) { case GL_SRC_COLOR: case GL_ONE_MINUS_SRC_COLOR: @@ -358,19 +384,19 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } break; - case GL_OPERAND0_ALPHA_EXT: - case GL_OPERAND1_ALPHA_EXT: + case GL_OPERAND0_ALPHA: + case GL_OPERAND1_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { const GLenum operand = (GLenum) (GLint) *param; switch (operand) { case GL_SRC_ALPHA: case GL_ONE_MINUS_SRC_ALPHA: - if (texUnit->CombineOperandA[pname-GL_OPERAND0_ALPHA_EXT] == + if (texUnit->CombineOperandA[pname-GL_OPERAND0_ALPHA] == operand) return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->CombineOperandA[pname-GL_OPERAND0_ALPHA_EXT] = operand; + texUnit->CombineOperandA[pname-GL_OPERAND0_ALPHA] = operand; break; default: TE_ERROR(GL_INVALID_ENUM, "glTexEnv(param=%s)", operand); @@ -382,7 +408,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } break; - case GL_OPERAND2_RGB_EXT: + case GL_OPERAND2_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { const GLenum operand = (GLenum) (GLint) *param; @@ -405,7 +431,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } break; - case GL_OPERAND2_ALPHA_EXT: + case GL_OPERAND2_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { const GLenum operand = (GLenum) (GLint) *param; @@ -427,7 +453,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) return; } break; - case GL_RGB_SCALE_EXT: + case GL_RGB_SCALE: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { GLuint newshift; @@ -604,7 +630,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) case GL_TEXTURE_ENV_COLOR: COPY_4FV( params, texUnit->EnvColor ); break; - case GL_COMBINE_RGB_EXT: + case GL_COMBINE_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineModeRGB; @@ -613,7 +639,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_COMBINE_ALPHA_EXT: + case GL_COMBINE_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineModeA; @@ -622,7 +648,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_SOURCE0_RGB_EXT: + case GL_SOURCE0_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineSourceRGB[0]; @@ -631,7 +657,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_SOURCE1_RGB_EXT: + case GL_SOURCE1_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineSourceRGB[1]; @@ -640,7 +666,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_SOURCE2_RGB_EXT: + case GL_SOURCE2_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineSourceRGB[2]; @@ -649,7 +675,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_SOURCE0_ALPHA_EXT: + case GL_SOURCE0_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineSourceA[0]; @@ -658,7 +684,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_SOURCE1_ALPHA_EXT: + case GL_SOURCE1_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineSourceA[1]; @@ -667,7 +693,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_SOURCE2_ALPHA_EXT: + case GL_SOURCE2_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineSourceA[2]; @@ -676,7 +702,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_OPERAND0_RGB_EXT: + case GL_OPERAND0_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineOperandRGB[0]; @@ -685,7 +711,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_OPERAND1_RGB_EXT: + case GL_OPERAND1_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineOperandRGB[1]; @@ -694,7 +720,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_OPERAND2_RGB_EXT: + case GL_OPERAND2_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineOperandRGB[2]; @@ -703,7 +729,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_OPERAND0_ALPHA_EXT: + case GL_OPERAND0_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineOperandA[0]; @@ -712,7 +738,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_OPERAND1_ALPHA_EXT: + case GL_OPERAND1_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineOperandA[1]; @@ -721,7 +747,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_OPERAND2_ALPHA_EXT: + case GL_OPERAND2_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLfloat) texUnit->CombineOperandA[2]; @@ -730,7 +756,7 @@ _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnvfv(pname)"); } break; - case GL_RGB_SCALE_EXT: + case GL_RGB_SCALE: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { if (texUnit->CombineScaleShiftRGB == 0) @@ -817,7 +843,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) params[2] = FLOAT_TO_INT( texUnit->EnvColor[2] ); params[3] = FLOAT_TO_INT( texUnit->EnvColor[3] ); break; - case GL_COMBINE_RGB_EXT: + case GL_COMBINE_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineModeRGB; @@ -826,7 +852,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_COMBINE_ALPHA_EXT: + case GL_COMBINE_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineModeA; @@ -835,7 +861,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_SOURCE0_RGB_EXT: + case GL_SOURCE0_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineSourceRGB[0]; @@ -844,7 +870,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_SOURCE1_RGB_EXT: + case GL_SOURCE1_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineSourceRGB[1]; @@ -853,7 +879,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_SOURCE2_RGB_EXT: + case GL_SOURCE2_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineSourceRGB[2]; @@ -862,7 +888,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_SOURCE0_ALPHA_EXT: + case GL_SOURCE0_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineSourceA[0]; @@ -871,7 +897,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_SOURCE1_ALPHA_EXT: + case GL_SOURCE1_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineSourceA[1]; @@ -880,7 +906,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_SOURCE2_ALPHA_EXT: + case GL_SOURCE2_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineSourceA[2]; @@ -889,7 +915,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_OPERAND0_RGB_EXT: + case GL_OPERAND0_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineOperandRGB[0]; @@ -898,7 +924,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_OPERAND1_RGB_EXT: + case GL_OPERAND1_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineOperandRGB[1]; @@ -907,7 +933,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_OPERAND2_RGB_EXT: + case GL_OPERAND2_RGB: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineOperandRGB[2]; @@ -916,7 +942,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_OPERAND0_ALPHA_EXT: + case GL_OPERAND0_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineOperandA[0]; @@ -925,7 +951,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_OPERAND1_ALPHA_EXT: + case GL_OPERAND1_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineOperandA[1]; @@ -934,7 +960,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_OPERAND2_ALPHA_EXT: + case GL_OPERAND2_ALPHA: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { *params = (GLint) texUnit->CombineOperandA[2]; @@ -943,7 +969,7 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexEnviv(pname)"); } break; - case GL_RGB_SCALE_EXT: + case GL_RGB_SCALE: if (ctx->Extensions.EXT_texture_env_combine || ctx->Extensions.ARB_texture_env_combine) { if (texUnit->CombineScaleShiftRGB == 0) @@ -1049,10 +1075,10 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) case GL_TEXTURE_2D: texObj = texUnit->Current2D; break; - case GL_TEXTURE_3D_EXT: + case GL_TEXTURE_3D: texObj = texUnit->Current3D; break; - case GL_TEXTURE_CUBE_MAP_ARB: + case GL_TEXTURE_CUBE_MAP: if (!ctx->Extensions.ARB_texture_cube_map) { _mesa_error( ctx, GL_INVALID_ENUM, "glTexParameter(target)" ); return; @@ -1111,7 +1137,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) if (texObj->WrapS == eparam) return; if (eparam == GL_CLAMP || eparam == GL_CLAMP_TO_EDGE || - (eparam == GL_CLAMP_TO_BORDER_ARB && + (eparam == GL_CLAMP_TO_BORDER && ctx->Extensions.ARB_texture_border_clamp)) { /* any texture target */ FLUSH_VERTICES(ctx, _NEW_TEXTURE); @@ -1119,7 +1145,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) } else if (texObj->Target != GL_TEXTURE_RECTANGLE_NV && (eparam == GL_REPEAT || - (eparam == GL_MIRRORED_REPEAT_ARB && + (eparam == GL_MIRRORED_REPEAT && ctx->Extensions.ARB_texture_mirrored_repeat) || (eparam == GL_MIRROR_CLAMP_ATI && ctx->Extensions.ATI_texture_mirror_once) || @@ -1138,7 +1164,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) if (texObj->WrapT == eparam) return; if (eparam == GL_CLAMP || eparam == GL_CLAMP_TO_EDGE || - (eparam == GL_CLAMP_TO_BORDER_ARB && + (eparam == GL_CLAMP_TO_BORDER && ctx->Extensions.ARB_texture_border_clamp)) { /* any texture target */ FLUSH_VERTICES(ctx, _NEW_TEXTURE); @@ -1146,7 +1172,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) } else if (texObj->Target != GL_TEXTURE_RECTANGLE_NV && (eparam == GL_REPEAT || - (eparam == GL_MIRRORED_REPEAT_ARB && + (eparam == GL_MIRRORED_REPEAT && ctx->Extensions.ARB_texture_mirrored_repeat) || (eparam == GL_MIRROR_CLAMP_ATI && ctx->Extensions.ATI_texture_mirror_once) || @@ -1161,11 +1187,11 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) return; } break; - case GL_TEXTURE_WRAP_R_EXT: + case GL_TEXTURE_WRAP_R: if (texObj->WrapR == eparam) return; if (eparam == GL_CLAMP || eparam == GL_CLAMP_TO_EDGE || - (eparam == GL_CLAMP_TO_BORDER_ARB && + (eparam == GL_CLAMP_TO_BORDER && ctx->Extensions.ARB_texture_border_clamp)) { /* any texture target */ FLUSH_VERTICES(ctx, _NEW_TEXTURE); @@ -1173,7 +1199,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) } else if (texObj->Target != GL_TEXTURE_RECTANGLE_NV && (eparam == GL_REPEAT || - (eparam == GL_MIRRORED_REPEAT_ARB && + (eparam == GL_MIRRORED_REPEAT && ctx->Extensions.ARB_texture_mirrored_repeat) || (eparam == GL_MIRROR_CLAMP_ATI && ctx->Extensions.ATI_texture_mirror_once) || @@ -1433,14 +1459,14 @@ tex_image_dimensions(GLcontext *ctx, GLenum target) case GL_TEXTURE_3D: case GL_PROXY_TEXTURE_3D: return 3; - case GL_TEXTURE_CUBE_MAP_ARB: - case GL_PROXY_TEXTURE_CUBE_MAP_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: + case GL_TEXTURE_CUBE_MAP: + case GL_PROXY_TEXTURE_CUBE_MAP: + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: return ctx->Extensions.ARB_texture_cube_map ? 2 : 0; case GL_TEXTURE_RECTANGLE_NV: case GL_PROXY_TEXTURE_RECTANGLE_NV: @@ -1482,13 +1508,13 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, case GL_PROXY_TEXTURE_3D: maxLevels = ctx->Const.Max3DTextureLevels; break; - case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: - case GL_PROXY_TEXTURE_CUBE_MAP_ARB: + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + case GL_PROXY_TEXTURE_CUBE_MAP: maxLevels = ctx->Const.MaxCubeTextureLevels; break; case GL_TEXTURE_RECTANGLE_NV: @@ -1518,7 +1544,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, isProxy = (target == GL_PROXY_TEXTURE_1D) || (target == GL_PROXY_TEXTURE_2D) || (target == GL_PROXY_TEXTURE_3D) || - (target == GL_PROXY_TEXTURE_CUBE_MAP_ARB) || + (target == GL_PROXY_TEXTURE_CUBE_MAP) || (target == GL_PROXY_TEXTURE_RECTANGLE_NV); switch (pname) { @@ -1597,7 +1623,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, return; /* GL_ARB_texture_compression */ - case GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB: + case GL_TEXTURE_COMPRESSED_IMAGE_SIZE: if (ctx->Extensions.ARB_texture_compression) { if (img->IsCompressed && !isProxy) *params = img->CompressedSize; @@ -1610,7 +1636,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, "glGetTexLevelParameter[if]v(pname)"); } return; - case GL_TEXTURE_COMPRESSED_ARB: + case GL_TEXTURE_COMPRESSED: if (ctx->Extensions.ARB_texture_compression) { *params = (GLint) img->IsCompressed; } @@ -1655,7 +1681,7 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) case GL_TEXTURE_WRAP_T: *params = ENUM_TO_FLOAT(obj->WrapT); return; - case GL_TEXTURE_WRAP_R_EXT: + case GL_TEXTURE_WRAP_R: *params = ENUM_TO_FLOAT(obj->WrapR); return; case GL_TEXTURE_BORDER_COLOR: @@ -1772,7 +1798,7 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) case GL_TEXTURE_WRAP_T: *params = (GLint) obj->WrapT; return; - case GL_TEXTURE_WRAP_R_EXT: + case GL_TEXTURE_WRAP_R: *params = (GLint) obj->WrapR; return; case GL_TEXTURE_BORDER_COLOR: @@ -2420,7 +2446,7 @@ void _mesa_ActiveTextureARB( GLenum target ) { GET_CURRENT_CONTEXT(ctx); - GLuint texUnit = target - GL_TEXTURE0_ARB; + GLuint texUnit = target - GL_TEXTURE0; ASSERT_OUTSIDE_BEGIN_END(ctx); if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) @@ -2429,7 +2455,7 @@ _mesa_ActiveTextureARB( GLenum target ) /* Cater for texture unit 0 is first, therefore use >= */ if (texUnit >= ctx->Const.MaxTextureUnits) { - _mesa_error(ctx, GL_INVALID_ENUM, "glActiveTextureARB(target)"); + _mesa_error(ctx, GL_INVALID_ENUM, "glActiveTexture(target)"); return; } @@ -2452,11 +2478,11 @@ void _mesa_ClientActiveTextureARB( GLenum target ) { GET_CURRENT_CONTEXT(ctx); - GLuint texUnit = target - GL_TEXTURE0_ARB; + GLuint texUnit = target - GL_TEXTURE0; ASSERT_OUTSIDE_BEGIN_END(ctx); if (texUnit > ctx->Const.MaxTextureUnits) { - _mesa_error(ctx, GL_INVALID_ENUM, "glClientActiveTextureARB(target)"); + _mesa_error(ctx, GL_INVALID_ENUM, "glClientActiveTexture(target)"); return; } diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index 60091e3743e..cd86c76bd3d 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -1,4 +1,4 @@ -/* $Id: s_texture.c,v 1.75 2002/11/12 19:27:24 brianp Exp $ */ +/* $Id: s_texture.c,v 1.76 2003/01/21 15:49:19 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -49,7 +49,7 @@ /* * Used to compute texel locations for linear sampling. * Input: - * wrapMode = GL_REPEAT, GL_CLAMP, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_BORDER_ARB + * wrapMode = GL_REPEAT, GL_CLAMP, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_BORDER * S = texcoord in [0,1] * SIZE = width (or height or depth) of texture * Output: @@ -78,7 +78,7 @@ if (I1 >= (GLint) SIZE) \ I1 = SIZE - 1; \ } \ - else if (wrapMode == GL_CLAMP_TO_BORDER_ARB) { \ + else if (wrapMode == GL_CLAMP_TO_BORDER) { \ const GLfloat min = -1.0F / (2.0F * SIZE); \ const GLfloat max = 1.0F - min; \ if (S <= min) \ @@ -91,7 +91,7 @@ I0 = IFLOOR(U); \ I1 = I0 + 1; \ } \ - else if (wrapMode == GL_MIRRORED_REPEAT_ARB) { \ + else if (wrapMode == GL_MIRRORED_REPEAT) { \ const GLint flr = IFLOOR(S); \ if (flr & 1) \ U = 1.0F - (S - (GLfloat) flr); /* flr is odd */ \ @@ -167,7 +167,7 @@ else \ I = IFLOOR(S * SIZE); \ } \ - else if (wrapMode == GL_CLAMP_TO_BORDER_ARB) { \ + else if (wrapMode == GL_CLAMP_TO_BORDER) { \ /* s limited to [min,max] */ \ /* i limited to [-1, size] */ \ const GLfloat min = -1.0F / (2.0F * SIZE); \ @@ -179,7 +179,7 @@ else \ I = IFLOOR(S * SIZE); \ } \ - else if (wrapMode == GL_MIRRORED_REPEAT_ARB) { \ + else if (wrapMode == GL_MIRRORED_REPEAT) { \ const GLfloat min = 1.0F / (2.0F * SIZE); \ const GLfloat max = 1.0F - min; \ const GLint flr = IFLOOR(S); \ @@ -465,7 +465,7 @@ sample_1d_nearest(GLcontext *ctx, i += img->Border; if (i < 0 || i >= (GLint) img->Width) { - /* Need this test for GL_CLAMP_TO_BORDER_ARB mode */ + /* Need this test for GL_CLAMP_TO_BORDER mode */ COPY_CHAN4(rgba, tObj->_BorderChan); } else { @@ -794,7 +794,7 @@ sample_2d_nearest(GLcontext *ctx, j += img->Border; if (i < 0 || i >= (GLint) img->Width || j < 0 || j >= (GLint) img->Height) { - /* Need this test for GL_CLAMP_TO_BORDER_ARB mode */ + /* Need this test for GL_CLAMP_TO_BORDER mode */ COPY_CHAN4(rgba, tObj->_BorderChan); } else { @@ -1382,7 +1382,7 @@ sample_3d_nearest(GLcontext *ctx, if (i < 0 || i >= (GLint) img->Width || j < 0 || j >= (GLint) img->Height || k < 0 || k >= (GLint) img->Depth) { - /* Need this test for GL_CLAMP_TO_BORDER_ARB mode */ + /* Need this test for GL_CLAMP_TO_BORDER mode */ COPY_CHAN4(rgba, tObj->_BorderChan); } else { @@ -2089,10 +2089,10 @@ sample_nearest_rect(GLcontext *ctx, GLuint texUnit, ASSERT(tObj->WrapS == GL_CLAMP || tObj->WrapS == GL_CLAMP_TO_EDGE || - tObj->WrapS == GL_CLAMP_TO_BORDER_ARB); + tObj->WrapS == GL_CLAMP_TO_BORDER); ASSERT(tObj->WrapT == GL_CLAMP || tObj->WrapT == GL_CLAMP_TO_EDGE || - tObj->WrapT == GL_CLAMP_TO_BORDER_ARB); + tObj->WrapT == GL_CLAMP_TO_BORDER); ASSERT(img->Format != GL_COLOR_INDEX); /* XXX move Wrap mode tests outside of loops for common cases */ @@ -2144,10 +2144,10 @@ sample_linear_rect(GLcontext *ctx, GLuint texUnit, ASSERT(tObj->WrapS == GL_CLAMP || tObj->WrapS == GL_CLAMP_TO_EDGE || - tObj->WrapS == GL_CLAMP_TO_BORDER_ARB); + tObj->WrapS == GL_CLAMP_TO_BORDER); ASSERT(tObj->WrapT == GL_CLAMP || tObj->WrapT == GL_CLAMP_TO_EDGE || - tObj->WrapT == GL_CLAMP_TO_BORDER_ARB); + tObj->WrapT == GL_CLAMP_TO_BORDER); ASSERT(img->Format != GL_COLOR_INDEX); /* XXX lots of opportunity for optimization in this loop */ @@ -2736,7 +2736,7 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, GLuint texUnit, swrast->TextureSample[texUnit] = sample_nearest_3d; } break; - case GL_TEXTURE_CUBE_MAP_ARB: + case GL_TEXTURE_CUBE_MAP: if (needLambda) { swrast->TextureSample[texUnit] = sample_lambda_cube; } @@ -2773,14 +2773,16 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, GLuint texUnit, /** * Do texture application for GL_ARB/EXT_texture_env_combine. - * Input: - * ctx - rendering context - * textureUnit - the texture unit to apply - * n - number of fragments to process (span width) - * primary_rgba - incoming fragment color array - * texelBuffer - pointer to texel colors for all texture units - * Input/Output: - * rgba - incoming colors, which get modified here + * This function also supports GL_{EXT,ARB}_texture_env_dot3 and + * GL_ATI_texture_env_combine3 + * + * \param ctx rendering context + * \param textureUnit the texture unit to apply + * \param n number of fragments to process (span width) + * \param primary_rgba incoming fragment color array + * \param texelBuffer pointer to texel colors for all texture units + * + * \param rgba incoming colors, which get modified here */ static INLINE void texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, @@ -2796,10 +2798,16 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, #if CHAN_TYPE == GL_FLOAT const GLchan RGBmult = (GLfloat) (1 << RGBshift); const GLchan Amult = (GLfloat) (1 << Ashift); + static const GLchan one[4] = { 1.0, 1.0, 1.0, 1.0 }; + static const GLchan zero[4] = { 0.0, 0.0, 0.0, 0.0 }; #else const GLint half = (CHAN_MAX + 1) / 2; + static const GLchan one[4] = { CHAN_MAX, CHAN_MAX, CHAN_MAX, CHAN_MAX }; + static const GLchan zero[4] = { 0, 0, 0, 0 }; #endif GLuint i, j; + GLuint numColorArgs; + GLuint numAlphaArgs; /* GLchan ccolor[3][4]; */ DEFMNARRAY(GLchan, ccolor, 3, 3 * MAX_WIDTH, 4); /* mac 32k limitation */ @@ -2823,54 +2831,70 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, /* * Do operand setup for up to 3 operands. Loop over the terms. */ - for (j = 0; j < 3; j++) { - const GLenum srcA = textureUnit->CombineSourceA[j]; + switch (textureUnit->CombineModeRGB) { + case GL_REPLACE: + numColorArgs = 1; + break; + case GL_MODULATE: + case GL_ADD: + case GL_ADD_SIGNED: + case GL_SUBTRACT: + case GL_DOT3_RGB: + case GL_DOT3_RGBA: + case GL_DOT3_RGB_EXT: + case GL_DOT3_RGBA_EXT: + numColorArgs = 2; + break; + case GL_INTERPOLATE: + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: + numColorArgs = 3; + break; + default: + numColorArgs = 0; + ASSERT(0); + break; + } + + switch (textureUnit->CombineModeA) { + case GL_REPLACE: + numAlphaArgs = 1; + break; + case GL_MODULATE: + case GL_ADD: + case GL_ADD_SIGNED: + case GL_SUBTRACT: + numAlphaArgs = 2; + break; + case GL_INTERPOLATE: + case GL_MODULATE_ADD_ATI: + case GL_MODULATE_SIGNED_ADD_ATI: + case GL_MODULATE_SUBTRACT_ATI: + numAlphaArgs = 3; + break; + default: + numAlphaArgs = 0; + ASSERT(0); + break; + } + + for (j = 0; j < numColorArgs; j++) { const GLenum srcRGB = textureUnit->CombineSourceRGB[j]; - switch (srcA) { - case GL_TEXTURE: - argA[j] = (const GLchan (*)[4]) - (texelBuffer + unit * (n * 4 * sizeof(GLchan))); - break; - case GL_PRIMARY_COLOR_EXT: - argA[j] = primary_rgba; - break; - case GL_PREVIOUS_EXT: - argA[j] = (const GLchan (*)[4]) rgba; - break; - case GL_CONSTANT_EXT: - { - GLchan alpha, (*c)[4] = ccolor[j]; - UNCLAMPED_FLOAT_TO_CHAN(alpha, textureUnit->EnvColor[3]); - for (i = 0; i < n; i++) - c[i][ACOMP] = alpha; - argA[j] = (const GLchan (*)[4]) ccolor[j]; - } - break; - default: - /* ARB_texture_env_crossbar source */ - { - const GLuint srcUnit = srcA - GL_TEXTURE0_ARB; - ASSERT(srcUnit < ctx->Const.MaxTextureUnits); - if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled) - return; - argA[j] = (const GLchan (*)[4]) - (texelBuffer + srcUnit * (n * 4 * sizeof(GLchan))); - } - } switch (srcRGB) { case GL_TEXTURE: argRGB[j] = (const GLchan (*)[4]) (texelBuffer + unit * (n * 4 * sizeof(GLchan))); break; - case GL_PRIMARY_COLOR_EXT: + case GL_PRIMARY_COLOR: argRGB[j] = primary_rgba; break; - case GL_PREVIOUS_EXT: + case GL_PREVIOUS: argRGB[j] = (const GLchan (*)[4]) rgba; break; - case GL_CONSTANT_EXT: + case GL_CONSTANT: { GLchan (*c)[4] = ccolor[j]; GLchan red, green, blue, alpha; @@ -2887,10 +2911,18 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, argRGB[j] = (const GLchan (*)[4]) ccolor[j]; } break; + /* GL_ATI_texture_env_combine3 allows GL_ZERO & GL_ONE as sources. + */ + case GL_ZERO: + argRGB[j] = & zero; + break; + case GL_ONE: + argRGB[j] = & one; + break; default: /* ARB_texture_env_crossbar source */ { - const GLuint srcUnit = srcRGB - GL_TEXTURE0_ARB; + const GLuint srcUnit = srcRGB - GL_TEXTURE0; ASSERT(srcUnit < ctx->Const.MaxTextureUnits); if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled) return; @@ -2929,6 +2961,51 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, } } } + } + + + for (j = 0; j < numAlphaArgs; j++) { + const GLenum srcA = textureUnit->CombineSourceA[j]; + + switch (srcA) { + case GL_TEXTURE: + argA[j] = (const GLchan (*)[4]) + (texelBuffer + unit * (n * 4 * sizeof(GLchan))); + break; + case GL_PRIMARY_COLOR: + argA[j] = primary_rgba; + break; + case GL_PREVIOUS: + argA[j] = (const GLchan (*)[4]) rgba; + break; + case GL_CONSTANT: + { + GLchan alpha, (*c)[4] = ccolor[j]; + UNCLAMPED_FLOAT_TO_CHAN(alpha, textureUnit->EnvColor[3]); + for (i = 0; i < n; i++) + c[i][ACOMP] = alpha; + argA[j] = (const GLchan (*)[4]) ccolor[j]; + } + break; + /* GL_ATI_texture_env_combine3 allows GL_ZERO & GL_ONE as sources. + */ + case GL_ZERO: + argA[j] = & zero; + break; + case GL_ONE: + argA[j] = & one; + break; + default: + /* ARB_texture_env_crossbar source */ + { + const GLuint srcUnit = srcA - GL_TEXTURE0; + ASSERT(srcUnit < ctx->Const.MaxTextureUnits); + if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled) + return; + argA[j] = (const GLchan (*)[4]) + (texelBuffer + srcUnit * (n * 4 * sizeof(GLchan))); + } + } if (textureUnit->CombineOperandA[j] == GL_ONE_MINUS_SRC_ALPHA) { const GLchan (*src)[4] = argA[j]; @@ -2938,17 +3015,6 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, dst[i][ACOMP] = CHAN_MAX - src[i][ACOMP]; } } - - if (textureUnit->CombineModeRGB == GL_REPLACE && - textureUnit->CombineModeA == GL_REPLACE) { - break; /* done, we need only arg0 */ - } - - if (j == 1 && - textureUnit->CombineModeRGB != GL_INTERPOLATE_EXT && - textureUnit->CombineModeA != GL_INTERPOLATE_EXT) { - break; /* arg0 and arg1 are done. we don't need arg2. */ - } } /* @@ -3026,7 +3092,7 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, } } break; - case GL_ADD_SIGNED_EXT: + case GL_ADD_SIGNED: { const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; @@ -3049,7 +3115,7 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, } } break; - case GL_INTERPOLATE_EXT: + case GL_INTERPOLATE: { const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; @@ -3082,7 +3148,7 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, } } break; - case GL_SUBTRACT_ARB: + case GL_SUBTRACT: { const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; @@ -3128,8 +3194,8 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, } } break; - case GL_DOT3_RGB_ARB: - case GL_DOT3_RGBA_ARB: + case GL_DOT3_RGB: + case GL_DOT3_RGBA: { /* DO scale the result by 1 2 or 4 */ const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; @@ -3155,6 +3221,93 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, } } break; + case GL_MODULATE_ADD_ATI: + { + const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; + const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; + const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; +#if CHAN_TYPE != GL_FLOAT + const GLint shift = CHAN_BITS - RGBshift; +#endif + for (i = 0; i < n; i++) { +#if CHAN_TYPE == GL_FLOAT + rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) + arg1[i][RCOMP]) * RGBmult; + rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) + arg1[i][GCOMP]) * RGBmult; + rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) + arg1[i][BCOMP]) * RGBmult; +#else + GLuint r = (PROD(arg0[i][RCOMP], arg2[i][RCOMP]) + + ((GLuint) arg1[i][RCOMP] << CHAN_BITS)) >> shift; + GLuint g = (PROD(arg0[i][GCOMP], arg2[i][GCOMP]) + + ((GLuint) arg1[i][GCOMP] << CHAN_BITS)) >> shift; + GLuint b = (PROD(arg0[i][BCOMP], arg2[i][BCOMP]) + + ((GLuint) arg1[i][BCOMP] << CHAN_BITS)) >> shift; + rgba[i][RCOMP] = (GLchan) MIN2(r, CHAN_MAX); + rgba[i][GCOMP] = (GLchan) MIN2(g, CHAN_MAX); + rgba[i][BCOMP] = (GLchan) MIN2(b, CHAN_MAX); +#endif + } + } + break; + case GL_MODULATE_SIGNED_ADD_ATI: + { + const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; + const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; + const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; +#if CHAN_TYPE != GL_FLOAT + const GLint shift = CHAN_BITS - RGBshift; +#endif + for (i = 0; i < n; i++) { +#if CHAN_TYPE == GL_FLOAT + rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) + arg1[i][RCOMP] - 0.5) * RGBmult; + rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) + arg1[i][GCOMP] - 0.5) * RGBmult; + rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) + arg1[i][BCOMP] - 0.5) * RGBmult; +#else + GLint r = (S_PROD(arg0[i][RCOMP], arg2[i][RCOMP]) + + (((GLint) arg1[i][RCOMP] - half) << CHAN_BITS)) + >> shift; + GLint g = (S_PROD(arg0[i][GCOMP], arg2[i][GCOMP]) + + (((GLint) arg1[i][GCOMP] - half) << CHAN_BITS)) + >> shift; + GLint b = (S_PROD(arg0[i][BCOMP], arg2[i][BCOMP]) + + (((GLint) arg1[i][BCOMP] - half) << CHAN_BITS)) + >> shift; + rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX); + rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX); + rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX); +#endif + } + } + break; + case GL_MODULATE_SUBTRACT_ATI: + { + const GLchan (*arg0)[4] = (const GLchan (*)[4]) argRGB[0]; + const GLchan (*arg1)[4] = (const GLchan (*)[4]) argRGB[1]; + const GLchan (*arg2)[4] = (const GLchan (*)[4]) argRGB[2]; +#if CHAN_TYPE != GL_FLOAT + const GLint shift = CHAN_BITS - RGBshift; +#endif + for (i = 0; i < n; i++) { +#if CHAN_TYPE == GL_FLOAT + rgba[i][RCOMP] = ((arg0[i][RCOMP] * arg2[i][RCOMP]) - arg1[i][RCOMP]) * RGBmult; + rgba[i][GCOMP] = ((arg0[i][GCOMP] * arg2[i][GCOMP]) - arg1[i][GCOMP]) * RGBmult; + rgba[i][BCOMP] = ((arg0[i][BCOMP] * arg2[i][BCOMP]) - arg1[i][BCOMP]) * RGBmult; +#else + GLint r = (S_PROD(arg0[i][RCOMP], arg2[i][RCOMP]) + - ((GLint) arg1[i][RCOMP] << CHAN_BITS)) + >> shift; + GLint g = (S_PROD(arg0[i][GCOMP], arg2[i][GCOMP]) + - ((GLint) arg1[i][GCOMP] << CHAN_BITS)) + >> shift; + GLint b = (S_PROD(arg0[i][BCOMP], arg2[i][BCOMP]) + - ((GLint) arg1[i][BCOMP] << CHAN_BITS)) + >> shift; + rgba[i][RCOMP] = (GLchan) CLAMP(r, 0, CHAN_MAX); + rgba[i][GCOMP] = (GLchan) CLAMP(g, 0, CHAN_MAX); + rgba[i][BCOMP] = (GLchan) CLAMP(b, 0, CHAN_MAX); +#endif + } + } + break; default: _mesa_problem(ctx, "invalid combine mode"); } @@ -3211,7 +3364,7 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, } } break; - case GL_ADD_SIGNED_EXT: + case GL_ADD_SIGNED: { const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; @@ -3226,7 +3379,7 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, } } break; - case GL_INTERPOLATE_EXT: + case GL_INTERPOLATE: { const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; @@ -3248,7 +3401,7 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, } } break; - case GL_SUBTRACT_ARB: + case GL_SUBTRACT: { const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; @@ -3262,7 +3415,66 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, } } break; - + case GL_MODULATE_ADD_ATI: + { + const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; + const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; + const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; +#if CHAN_TYPE != GL_FLOAT + const GLint shift = CHAN_BITS - Ashift; +#endif + for (i = 0; i < n; i++) { +#if CHAN_TYPE == GL_FLOAT + rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) + arg1[i][ACOMP]) * Amult; +#else + GLuint a = (PROD(arg0[i][ACOMP], arg2[i][ACOMP]) + + ((GLuint) arg1[i][ACOMP] << CHAN_BITS)) + >> shift; + rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); +#endif + } + } + break; + case GL_MODULATE_SIGNED_ADD_ATI: + { + const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; + const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; + const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; +#if CHAN_TYPE != GL_FLOAT + const GLint shift = CHAN_BITS - Ashift; +#endif + for (i = 0; i < n; i++) { +#if CHAN_TYPE == GL_FLOAT + rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) + arg1[i][ACOMP] - 0.5F) * Amult; +#else + GLint a = (S_PROD(arg0[i][ACOMP], arg2[i][ACOMP]) + + (((GLint) arg1[i][ACOMP] - half) << CHAN_BITS)) + >> shift; + rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); +#endif + } + } + break; + case GL_MODULATE_SUBTRACT_ATI: + { + const GLchan (*arg0)[4] = (const GLchan (*)[4]) argA[0]; + const GLchan (*arg1)[4] = (const GLchan (*)[4]) argA[1]; + const GLchan (*arg2)[4] = (const GLchan (*)[4]) argA[2]; +#if CHAN_TYPE != GL_FLOAT + const GLint shift = CHAN_BITS - Ashift; +#endif + for (i = 0; i < n; i++) { +#if CHAN_TYPE == GL_FLOAT + rgba[i][ACOMP] = ((arg0[i][ACOMP] * arg2[i][ACOMP]) - arg1[i][ACOMP]) * Amult; +#else + GLint a = (S_PROD(arg0[i][ACOMP], arg2[i][ACOMP]) + - ((GLint) arg1[i][ACOMP] << CHAN_BITS)) + >> shift; + rgba[i][ACOMP] = (GLchan) CLAMP(a, 0, CHAN_MAX); +#endif + } + } + break; default: _mesa_problem(ctx, "invalid combine mode"); } @@ -3273,7 +3485,7 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n, * GL_DOT3. */ if (textureUnit->CombineModeRGB == GL_DOT3_RGBA_EXT || - textureUnit->CombineModeRGB == GL_DOT3_RGBA_ARB) { + textureUnit->CombineModeRGB == GL_DOT3_RGBA) { for (i = 0; i < n; i++) { rgba[i][ACOMP] = rgba[i][RCOMP]; } @@ -3715,7 +3927,7 @@ _swrast_texture_span( GLcontext *ctx, struct sw_span *span ) for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) { if (ctx->Texture.Unit[unit]._ReallyEnabled) { const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - if (texUnit->EnvMode == GL_COMBINE_EXT) { + if (texUnit->EnvMode == GL_COMBINE) { /* GL_ARB/EXT_texture_env_combine */ texture_combine( ctx, unit, span->end, (CONST GLchan (*)[4]) primary_rgba, -- cgit v1.2.3 From 3d7071b8a50e9e5aef6013cfe95cd935b8688688 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 4 Feb 2003 02:29:21 +0000 Subject: updated with new functions (Bill Hoffman) --- include/GL/gl_mangle.h | 247 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 190 insertions(+), 57 deletions(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 6aa29592162..f3559902634 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -1,15 +1,14 @@ -#if 0 /* $Id: gl_mangle.h,v 1.11 2002/01/18 14:55:40 brianp Exp $ */ - # DO NOT EDIT!!! - TO REGENERATE from gl.h, EXECUTE THIS FILE IN KORN SHELL and save the output - # This file is used to create GL function protypes and aliases for the function names - +#if 0 /* $Id: gl_mangle.h,v 1.12 2003/02/04 02:29:21 brianp Exp $ */ +#define GL_MANGLE_C1 "DO NOT EDIT!!! - TO REGENERATE from gl.h, EXECUTE THIS FILE IN SHELL (/bin/sh) and save the output" +#define GL_MANGLE_C2 "This file is used to create GL function protypes and aliases for the function names" files="gl.h glext.h" - #get regeneration header - copy everything in this file above the "REGENERATE_TO_END" line +#define GL_MANGLE_C3 "get regeneration header - copy everything in this file above the 'REGENERATE_TO_END' line" awk '!done; /^\/\*REGENERATE_TO_END/ {done=1}' $0 - echo "\n" - - #get aliases + echo "" +#define GL_MANGLE_C4 get aliases grep '^GLAPI' $files | sed -e 's/.*ENTRY gl\([^( ]*\).*$/#define gl\1 MANGLE(\1)/' | sort | uniq - echo "\n#endif /* GL_MANGLE_H */" + echo "" + echo "#endif /* GL_MANGLE_H */" exit #endif /* REGENERATION */ @@ -34,8 +33,8 @@ /*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */ - #define glAccum MANGLE(Accum) +#define glActiveStencilFaceEXT MANGLE(ActiveStencilFaceEXT) #define glActiveTexture MANGLE(ActiveTexture) #define glActiveTextureARB MANGLE(ActiveTextureARB) #define glAlphaFragmentOp1ATI MANGLE(AlphaFragmentOp1ATI) @@ -52,11 +51,13 @@ #define glAsyncMarkerSGIX MANGLE(AsyncMarkerSGIX) #define glBegin MANGLE(Begin) #define glBeginFragmentShaderATI MANGLE(BeginFragmentShaderATI) +#define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV) #define glBeginVertexShaderEXT MANGLE(BeginVertexShaderEXT) #define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI) #define glBindLightParameterEXT MANGLE(BindLightParameterEXT) #define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT) #define glBindParameterEXT MANGLE(BindParameterEXT) +#define glBindProgramARB MANGLE(BindProgramARB) #define glBindProgramNV MANGLE(BindProgramNV) #define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT) #define glBindTexture MANGLE(BindTexture) @@ -80,6 +81,7 @@ #define glBlendEquation MANGLE(BlendEquation) #define glBlendEquationEXT MANGLE(BlendEquationEXT) #define glBlendFunc MANGLE(BlendFunc) +#define glBlendFuncSeparate MANGLE(BlendFuncSeparate) #define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT) #define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR) #define glCallList MANGLE(CallList) @@ -92,7 +94,7 @@ #define glClearStencil MANGLE(ClearStencil) #define glClientActiveTexture MANGLE(ClientActiveTexture) #define glClientActiveTextureARB MANGLE(ClientActiveTextureARB) -#define glClientActiveVertexStream MANGLE(ClientActiveVertexStream) +#define glClientActiveVertexStreamATI MANGLE(ClientActiveVertexStreamATI) #define glClipPlane MANGLE(ClipPlane) #define glColor3b MANGLE(Color3b) #define glColor3bv MANGLE(Color3bv) @@ -214,6 +216,8 @@ #define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI) #define glDeleteLists MANGLE(DeleteLists) #define glDeleteObjectBufferATI MANGLE(DeleteObjectBufferATI) +#define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV) +#define glDeleteProgramsARB MANGLE(DeleteProgramsARB) #define glDeleteProgramsNV MANGLE(DeleteProgramsNV) #define glDeleteTextures MANGLE(DeleteTextures) #define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT) @@ -226,11 +230,15 @@ #define glDisableClientState MANGLE(DisableClientState) #define glDisableTraceMESA MANGLE(DisableTraceMESA) #define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT) +#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB) #define glDrawArrays MANGLE(DrawArrays) #define glDrawArraysEXT MANGLE(DrawArraysEXT) #define glDrawBuffer MANGLE(DrawBuffer) +#define glDrawElementArrayATI MANGLE(DrawElementArrayATI) #define glDrawElements MANGLE(DrawElements) +#define glDrawMeshArraysSUN MANGLE(DrawMeshArraysSUN) #define glDrawPixels MANGLE(DrawPixels) +#define glDrawRangeElementArrayATI MANGLE(DrawRangeElementArrayATI) #define glDrawRangeElements MANGLE(DrawRangeElements) #define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT) #define glEdgeFlag MANGLE(EdgeFlag) @@ -238,13 +246,16 @@ #define glEdgeFlagPointerEXT MANGLE(EdgeFlagPointerEXT) #define glEdgeFlagPointerListIBM MANGLE(EdgeFlagPointerListIBM) #define glEdgeFlagv MANGLE(EdgeFlagv) +#define glElementPointerATI MANGLE(ElementPointerATI) #define glEnable MANGLE(Enable) #define glEnableClientState MANGLE(EnableClientState) #define glEnableTraceMESA MANGLE(EnableTraceMESA) #define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT) +#define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB) #define glEnd MANGLE(End) #define glEndFragmentShaderATI MANGLE(EndFragmentShaderATI) #define glEndList MANGLE(EndList) +#define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV) #define glEndTraceMESA MANGLE(EndTraceMESA) #define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT) #define glEvalCoord1d MANGLE(EvalCoord1d) @@ -271,11 +282,16 @@ #define glFlush MANGLE(Flush) #define glFlushRasterSGIX MANGLE(FlushRasterSGIX) #define glFlushVertexArrayRangeNV MANGLE(FlushVertexArrayRangeNV) +#define glFogCoordPointer MANGLE(FogCoordPointer) #define glFogCoordPointerEXT MANGLE(FogCoordPointerEXT) #define glFogCoordPointerListIBM MANGLE(FogCoordPointerListIBM) +#define glFogCoordd MANGLE(FogCoordd) #define glFogCoorddEXT MANGLE(FogCoorddEXT) +#define glFogCoorddv MANGLE(FogCoorddv) #define glFogCoorddvEXT MANGLE(FogCoorddvEXT) +#define glFogCoordf MANGLE(FogCoordf) #define glFogCoordfEXT MANGLE(FogCoordfEXT) +#define glFogCoordfv MANGLE(FogCoordfv) #define glFogCoordfvEXT MANGLE(FogCoordfvEXT) #define glFogFuncSGIS MANGLE(FogFuncSGIS) #define glFogf MANGLE(Fogf) @@ -302,6 +318,8 @@ #define glGenFencesNV MANGLE(GenFencesNV) #define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI) #define glGenLists MANGLE(GenLists) +#define glGenOcclusionQueriesNV MANGLE(GenOcclusionQueriesNV) +#define glGenProgramsARB MANGLE(GenProgramsARB) #define glGenProgramsNV MANGLE(GenProgramsNV) #define glGenSymbolsEXT MANGLE(GenSymbolsEXT) #define glGenTextures MANGLE(GenTextures) @@ -383,6 +401,8 @@ #define glGetMinmaxParameterivEXT MANGLE(GetMinmaxParameterivEXT) #define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI) #define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI) +#define glGetOcclusionQueryivNV MANGLE(GetOcclusionQueryivNV) +#define glGetOcclusionQueryuivNV MANGLE(GetOcclusionQueryuivNV) #define glGetPixelMapfv MANGLE(GetPixelMapfv) #define glGetPixelMapuiv MANGLE(GetPixelMapuiv) #define glGetPixelMapusv MANGLE(GetPixelMapusv) @@ -391,9 +411,15 @@ #define glGetPointerv MANGLE(GetPointerv) #define glGetPointervEXT MANGLE(GetPointervEXT) #define glGetPolygonStipple MANGLE(GetPolygonStipple) +#define glGetProgramEnvParameterdvARB MANGLE(GetProgramEnvParameterdvARB) +#define glGetProgramEnvParameterfvARB MANGLE(GetProgramEnvParameterfvARB) +#define glGetProgramLocalParameterdvARB MANGLE(GetProgramLocalParameterdvARB) +#define glGetProgramLocalParameterfvARB MANGLE(GetProgramLocalParameterfvARB) #define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV) #define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV) +#define glGetProgramStringARB MANGLE(GetProgramStringARB) #define glGetProgramStringNV MANGLE(GetProgramStringNV) +#define glGetProgramivARB MANGLE(GetProgramivARB) #define glGetProgramivNV MANGLE(GetProgramivNV) #define glGetSeparableFilter MANGLE(GetSeparableFilter) #define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT) @@ -419,9 +445,13 @@ #define glGetVariantFloatvEXT MANGLE(GetVariantFloatvEXT) #define glGetVariantIntegervEXT MANGLE(GetVariantIntegervEXT) #define glGetVariantPointervEXT MANGLE(GetVariantPointervEXT) +#define glGetVertexAttribPointervARB MANGLE(GetVertexAttribPointervARB) #define glGetVertexAttribPointervNV MANGLE(GetVertexAttribPointervNV) +#define glGetVertexAttribdvARB MANGLE(GetVertexAttribdvARB) #define glGetVertexAttribdvNV MANGLE(GetVertexAttribdvNV) +#define glGetVertexAttribfvARB MANGLE(GetVertexAttribfvARB) #define glGetVertexAttribfvNV MANGLE(GetVertexAttribfvNV) +#define glGetVertexAttribivARB MANGLE(GetVertexAttribivARB) #define glGetVertexAttribivNV MANGLE(GetVertexAttribivNV) #define glGlobalAlphaFactorbSUN MANGLE(GlobalAlphaFactorbSUN) #define glGlobalAlphaFactordSUN MANGLE(GlobalAlphaFactordSUN) @@ -465,6 +495,8 @@ #define glIsFenceNV MANGLE(IsFenceNV) #define glIsList MANGLE(IsList) #define glIsObjectBufferATI MANGLE(IsObjectBufferATI) +#define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV) +#define glIsProgramARB MANGLE(IsProgramARB) #define glIsProgramNV MANGLE(IsProgramNV) #define glIsTexture MANGLE(IsTexture) #define glIsTextureEXT MANGLE(IsTextureEXT) @@ -525,7 +557,9 @@ #define glMultTransposeMatrixdARB MANGLE(MultTransposeMatrixdARB) #define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf) #define glMultTransposeMatrixfARB MANGLE(MultTransposeMatrixfARB) +#define glMultiDrawArrays MANGLE(MultiDrawArrays) #define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT) +#define glMultiDrawElements MANGLE(MultiDrawElements) #define glMultiDrawElementsEXT MANGLE(MultiDrawElementsEXT) #define glMultiModeDrawArraysIBM MANGLE(MultiModeDrawArraysIBM) #define glMultiModeDrawElementsIBM MANGLE(MultiModeDrawElementsIBM) @@ -612,16 +646,16 @@ #define glNormalPointerEXT MANGLE(NormalPointerEXT) #define glNormalPointerListIBM MANGLE(NormalPointerListIBM) #define glNormalPointervINTEL MANGLE(NormalPointervINTEL) -#define glNormalStream3b MANGLE(NormalStream3b) -#define glNormalStream3bv MANGLE(NormalStream3bv) -#define glNormalStream3d MANGLE(NormalStream3d) -#define glNormalStream3dv MANGLE(NormalStream3dv) -#define glNormalStream3f MANGLE(NormalStream3f) -#define glNormalStream3fv MANGLE(NormalStream3fv) -#define glNormalStream3i MANGLE(NormalStream3i) -#define glNormalStream3iv MANGLE(NormalStream3iv) -#define glNormalStream3s MANGLE(NormalStream3s) -#define glNormalStream3sv MANGLE(NormalStream3sv) +#define glNormalStream3bATI MANGLE(NormalStream3bATI) +#define glNormalStream3bvATI MANGLE(NormalStream3bvATI) +#define glNormalStream3dATI MANGLE(NormalStream3dATI) +#define glNormalStream3dvATI MANGLE(NormalStream3dvATI) +#define glNormalStream3fATI MANGLE(NormalStream3fATI) +#define glNormalStream3fvATI MANGLE(NormalStream3fvATI) +#define glNormalStream3iATI MANGLE(NormalStream3iATI) +#define glNormalStream3ivATI MANGLE(NormalStream3ivATI) +#define glNormalStream3sATI MANGLE(NormalStream3sATI) +#define glNormalStream3svATI MANGLE(NormalStream3svATI) #define glOrtho MANGLE(Ortho) #define glPNTrianglesfATI MANGLE(PNTrianglesfATI) #define glPNTrianglesiATI MANGLE(PNTrianglesiATI) @@ -644,12 +678,18 @@ #define glPixelTransformParameteriEXT MANGLE(PixelTransformParameteriEXT) #define glPixelTransformParameterivEXT MANGLE(PixelTransformParameterivEXT) #define glPixelZoom MANGLE(PixelZoom) +#define glPointParameterf MANGLE(PointParameterf) #define glPointParameterfARB MANGLE(PointParameterfARB) #define glPointParameterfEXT MANGLE(PointParameterfEXT) #define glPointParameterfSGIS MANGLE(PointParameterfSGIS) +#define glPointParameterfv MANGLE(PointParameterfv) #define glPointParameterfvARB MANGLE(PointParameterfvARB) #define glPointParameterfvEXT MANGLE(PointParameterfvEXT) #define glPointParameterfvSGIS MANGLE(PointParameterfvSGIS) +#define glPointParameteri MANGLE(PointParameteri) +#define glPointParameteriNV MANGLE(PointParameteriNV) +#define glPointParameteriv MANGLE(PointParameteriv) +#define glPointParameterivNV MANGLE(PointParameterivNV) #define glPointSize MANGLE(PointSize) #define glPollAsyncSGIX MANGLE(PollAsyncSGIX) #define glPollInstrumentsSGIX MANGLE(PollInstrumentsSGIX) @@ -663,12 +703,21 @@ #define glPopName MANGLE(PopName) #define glPrioritizeTextures MANGLE(PrioritizeTextures) #define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT) +#define glProgramEnvParameter4dARB MANGLE(ProgramEnvParameter4dARB) +#define glProgramEnvParameter4dvARB MANGLE(ProgramEnvParameter4dvARB) +#define glProgramEnvParameter4fARB MANGLE(ProgramEnvParameter4fARB) +#define glProgramEnvParameter4fvARB MANGLE(ProgramEnvParameter4fvARB) +#define glProgramLocalParameter4dARB MANGLE(ProgramLocalParameter4dARB) +#define glProgramLocalParameter4dvARB MANGLE(ProgramLocalParameter4dvARB) +#define glProgramLocalParameter4fARB MANGLE(ProgramLocalParameter4fARB) +#define glProgramLocalParameter4fvARB MANGLE(ProgramLocalParameter4fvARB) #define glProgramParameter4dNV MANGLE(ProgramParameter4dNV) #define glProgramParameter4dvNV MANGLE(ProgramParameter4dvNV) #define glProgramParameter4fNV MANGLE(ProgramParameter4fNV) #define glProgramParameter4fvNV MANGLE(ProgramParameter4fvNV) #define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV) #define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV) +#define glProgramStringARB MANGLE(ProgramStringARB) #define glPushAttrib MANGLE(PushAttrib) #define glPushClientAttrib MANGLE(PushClientAttrib) #define glPushMatrix MANGLE(PushMatrix) @@ -746,28 +795,44 @@ #define glSampleMapATI MANGLE(SampleMapATI) #define glSampleMaskEXT MANGLE(SampleMaskEXT) #define glSampleMaskSGIS MANGLE(SampleMaskSGIS) -#define glSamplePass MANGLE(SamplePass) #define glSamplePatternEXT MANGLE(SamplePatternEXT) #define glSamplePatternSGIS MANGLE(SamplePatternSGIS) #define glScaled MANGLE(Scaled) #define glScalef MANGLE(Scalef) #define glScissor MANGLE(Scissor) +#define glSecondaryColor3b MANGLE(SecondaryColor3b) #define glSecondaryColor3bEXT MANGLE(SecondaryColor3bEXT) +#define glSecondaryColor3bv MANGLE(SecondaryColor3bv) #define glSecondaryColor3bvEXT MANGLE(SecondaryColor3bvEXT) +#define glSecondaryColor3d MANGLE(SecondaryColor3d) #define glSecondaryColor3dEXT MANGLE(SecondaryColor3dEXT) +#define glSecondaryColor3dv MANGLE(SecondaryColor3dv) #define glSecondaryColor3dvEXT MANGLE(SecondaryColor3dvEXT) +#define glSecondaryColor3f MANGLE(SecondaryColor3f) #define glSecondaryColor3fEXT MANGLE(SecondaryColor3fEXT) +#define glSecondaryColor3fv MANGLE(SecondaryColor3fv) #define glSecondaryColor3fvEXT MANGLE(SecondaryColor3fvEXT) +#define glSecondaryColor3i MANGLE(SecondaryColor3i) #define glSecondaryColor3iEXT MANGLE(SecondaryColor3iEXT) +#define glSecondaryColor3iv MANGLE(SecondaryColor3iv) #define glSecondaryColor3ivEXT MANGLE(SecondaryColor3ivEXT) +#define glSecondaryColor3s MANGLE(SecondaryColor3s) #define glSecondaryColor3sEXT MANGLE(SecondaryColor3sEXT) +#define glSecondaryColor3sv MANGLE(SecondaryColor3sv) #define glSecondaryColor3svEXT MANGLE(SecondaryColor3svEXT) +#define glSecondaryColor3ub MANGLE(SecondaryColor3ub) #define glSecondaryColor3ubEXT MANGLE(SecondaryColor3ubEXT) +#define glSecondaryColor3ubv MANGLE(SecondaryColor3ubv) #define glSecondaryColor3ubvEXT MANGLE(SecondaryColor3ubvEXT) +#define glSecondaryColor3ui MANGLE(SecondaryColor3ui) #define glSecondaryColor3uiEXT MANGLE(SecondaryColor3uiEXT) +#define glSecondaryColor3uiv MANGLE(SecondaryColor3uiv) #define glSecondaryColor3uivEXT MANGLE(SecondaryColor3uivEXT) +#define glSecondaryColor3us MANGLE(SecondaryColor3us) #define glSecondaryColor3usEXT MANGLE(SecondaryColor3usEXT) +#define glSecondaryColor3usv MANGLE(SecondaryColor3usv) #define glSecondaryColor3usvEXT MANGLE(SecondaryColor3usvEXT) +#define glSecondaryColorPointer MANGLE(SecondaryColorPointer) #define glSecondaryColorPointerEXT MANGLE(SecondaryColorPointerEXT) #define glSecondaryColorPointerListIBM MANGLE(SecondaryColorPointerListIBM) #define glSelectBuffer MANGLE(SelectBuffer) @@ -935,32 +1000,69 @@ #define glVertex4s MANGLE(Vertex4s) #define glVertex4sv MANGLE(Vertex4sv) #define glVertexArrayRangeNV MANGLE(VertexArrayRangeNV) +#define glVertexAttrib1dARB MANGLE(VertexAttrib1dARB) #define glVertexAttrib1dNV MANGLE(VertexAttrib1dNV) +#define glVertexAttrib1dvARB MANGLE(VertexAttrib1dvARB) #define glVertexAttrib1dvNV MANGLE(VertexAttrib1dvNV) +#define glVertexAttrib1fARB MANGLE(VertexAttrib1fARB) #define glVertexAttrib1fNV MANGLE(VertexAttrib1fNV) +#define glVertexAttrib1fvARB MANGLE(VertexAttrib1fvARB) #define glVertexAttrib1fvNV MANGLE(VertexAttrib1fvNV) +#define glVertexAttrib1sARB MANGLE(VertexAttrib1sARB) #define glVertexAttrib1sNV MANGLE(VertexAttrib1sNV) +#define glVertexAttrib1svARB MANGLE(VertexAttrib1svARB) #define glVertexAttrib1svNV MANGLE(VertexAttrib1svNV) +#define glVertexAttrib2dARB MANGLE(VertexAttrib2dARB) #define glVertexAttrib2dNV MANGLE(VertexAttrib2dNV) +#define glVertexAttrib2dvARB MANGLE(VertexAttrib2dvARB) #define glVertexAttrib2dvNV MANGLE(VertexAttrib2dvNV) +#define glVertexAttrib2fARB MANGLE(VertexAttrib2fARB) #define glVertexAttrib2fNV MANGLE(VertexAttrib2fNV) +#define glVertexAttrib2fvARB MANGLE(VertexAttrib2fvARB) #define glVertexAttrib2fvNV MANGLE(VertexAttrib2fvNV) +#define glVertexAttrib2sARB MANGLE(VertexAttrib2sARB) #define glVertexAttrib2sNV MANGLE(VertexAttrib2sNV) +#define glVertexAttrib2svARB MANGLE(VertexAttrib2svARB) #define glVertexAttrib2svNV MANGLE(VertexAttrib2svNV) +#define glVertexAttrib3dARB MANGLE(VertexAttrib3dARB) #define glVertexAttrib3dNV MANGLE(VertexAttrib3dNV) +#define glVertexAttrib3dvARB MANGLE(VertexAttrib3dvARB) #define glVertexAttrib3dvNV MANGLE(VertexAttrib3dvNV) +#define glVertexAttrib3fARB MANGLE(VertexAttrib3fARB) #define glVertexAttrib3fNV MANGLE(VertexAttrib3fNV) +#define glVertexAttrib3fvARB MANGLE(VertexAttrib3fvARB) #define glVertexAttrib3fvNV MANGLE(VertexAttrib3fvNV) +#define glVertexAttrib3sARB MANGLE(VertexAttrib3sARB) #define glVertexAttrib3sNV MANGLE(VertexAttrib3sNV) +#define glVertexAttrib3svARB MANGLE(VertexAttrib3svARB) #define glVertexAttrib3svNV MANGLE(VertexAttrib3svNV) +#define glVertexAttrib4NbvARB MANGLE(VertexAttrib4NbvARB) +#define glVertexAttrib4NivARB MANGLE(VertexAttrib4NivARB) +#define glVertexAttrib4NsvARB MANGLE(VertexAttrib4NsvARB) +#define glVertexAttrib4NubARB MANGLE(VertexAttrib4NubARB) +#define glVertexAttrib4NubvARB MANGLE(VertexAttrib4NubvARB) +#define glVertexAttrib4NuivARB MANGLE(VertexAttrib4NuivARB) +#define glVertexAttrib4NusvARB MANGLE(VertexAttrib4NusvARB) +#define glVertexAttrib4bvARB MANGLE(VertexAttrib4bvARB) +#define glVertexAttrib4dARB MANGLE(VertexAttrib4dARB) #define glVertexAttrib4dNV MANGLE(VertexAttrib4dNV) +#define glVertexAttrib4dvARB MANGLE(VertexAttrib4dvARB) #define glVertexAttrib4dvNV MANGLE(VertexAttrib4dvNV) +#define glVertexAttrib4fARB MANGLE(VertexAttrib4fARB) #define glVertexAttrib4fNV MANGLE(VertexAttrib4fNV) +#define glVertexAttrib4fvARB MANGLE(VertexAttrib4fvARB) #define glVertexAttrib4fvNV MANGLE(VertexAttrib4fvNV) +#define glVertexAttrib4ivARB MANGLE(VertexAttrib4ivARB) +#define glVertexAttrib4sARB MANGLE(VertexAttrib4sARB) #define glVertexAttrib4sNV MANGLE(VertexAttrib4sNV) +#define glVertexAttrib4svARB MANGLE(VertexAttrib4svARB) #define glVertexAttrib4svNV MANGLE(VertexAttrib4svNV) #define glVertexAttrib4ubNV MANGLE(VertexAttrib4ubNV) +#define glVertexAttrib4ubvARB MANGLE(VertexAttrib4ubvARB) #define glVertexAttrib4ubvNV MANGLE(VertexAttrib4ubvNV) +#define glVertexAttrib4uivARB MANGLE(VertexAttrib4uivARB) +#define glVertexAttrib4usvARB MANGLE(VertexAttrib4usvARB) +#define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB) #define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV) #define glVertexAttribs1dvNV MANGLE(VertexAttribs1dvNV) #define glVertexAttribs1fvNV MANGLE(VertexAttribs1fvNV) @@ -976,44 +1078,44 @@ #define glVertexAttribs4svNV MANGLE(VertexAttribs4svNV) #define glVertexAttribs4ubvNV MANGLE(VertexAttribs4ubvNV) #define glVertexBlendARB MANGLE(VertexBlendARB) -#define glVertexBlendEnvf MANGLE(VertexBlendEnvf) -#define glVertexBlendEnvi MANGLE(VertexBlendEnvi) +#define glVertexBlendEnvfATI MANGLE(VertexBlendEnvfATI) +#define glVertexBlendEnviATI MANGLE(VertexBlendEnviATI) #define glVertexPointer MANGLE(VertexPointer) #define glVertexPointerEXT MANGLE(VertexPointerEXT) #define glVertexPointerListIBM MANGLE(VertexPointerListIBM) #define glVertexPointervINTEL MANGLE(VertexPointervINTEL) -#define glVertexStream1d MANGLE(VertexStream1d) -#define glVertexStream1dv MANGLE(VertexStream1dv) -#define glVertexStream1f MANGLE(VertexStream1f) -#define glVertexStream1fv MANGLE(VertexStream1fv) -#define glVertexStream1i MANGLE(VertexStream1i) -#define glVertexStream1iv MANGLE(VertexStream1iv) -#define glVertexStream1s MANGLE(VertexStream1s) -#define glVertexStream1sv MANGLE(VertexStream1sv) -#define glVertexStream2d MANGLE(VertexStream2d) -#define glVertexStream2dv MANGLE(VertexStream2dv) -#define glVertexStream2f MANGLE(VertexStream2f) -#define glVertexStream2fv MANGLE(VertexStream2fv) -#define glVertexStream2i MANGLE(VertexStream2i) -#define glVertexStream2iv MANGLE(VertexStream2iv) -#define glVertexStream2s MANGLE(VertexStream2s) -#define glVertexStream2sv MANGLE(VertexStream2sv) -#define glVertexStream3d MANGLE(VertexStream3d) -#define glVertexStream3dv MANGLE(VertexStream3dv) -#define glVertexStream3f MANGLE(VertexStream3f) -#define glVertexStream3fv MANGLE(VertexStream3fv) -#define glVertexStream3i MANGLE(VertexStream3i) -#define glVertexStream3iv MANGLE(VertexStream3iv) -#define glVertexStream3s MANGLE(VertexStream3s) -#define glVertexStream3sv MANGLE(VertexStream3sv) -#define glVertexStream4d MANGLE(VertexStream4d) -#define glVertexStream4dv MANGLE(VertexStream4dv) -#define glVertexStream4f MANGLE(VertexStream4f) -#define glVertexStream4fv MANGLE(VertexStream4fv) -#define glVertexStream4i MANGLE(VertexStream4i) -#define glVertexStream4iv MANGLE(VertexStream4iv) -#define glVertexStream4s MANGLE(VertexStream4s) -#define glVertexStream4sv MANGLE(VertexStream4sv) +#define glVertexStream1dATI MANGLE(VertexStream1dATI) +#define glVertexStream1dvATI MANGLE(VertexStream1dvATI) +#define glVertexStream1fATI MANGLE(VertexStream1fATI) +#define glVertexStream1fvATI MANGLE(VertexStream1fvATI) +#define glVertexStream1iATI MANGLE(VertexStream1iATI) +#define glVertexStream1ivATI MANGLE(VertexStream1ivATI) +#define glVertexStream1sATI MANGLE(VertexStream1sATI) +#define glVertexStream1svATI MANGLE(VertexStream1svATI) +#define glVertexStream2dATI MANGLE(VertexStream2dATI) +#define glVertexStream2dvATI MANGLE(VertexStream2dvATI) +#define glVertexStream2fATI MANGLE(VertexStream2fATI) +#define glVertexStream2fvATI MANGLE(VertexStream2fvATI) +#define glVertexStream2iATI MANGLE(VertexStream2iATI) +#define glVertexStream2ivATI MANGLE(VertexStream2ivATI) +#define glVertexStream2sATI MANGLE(VertexStream2sATI) +#define glVertexStream2svATI MANGLE(VertexStream2svATI) +#define glVertexStream3dATI MANGLE(VertexStream3dATI) +#define glVertexStream3dvATI MANGLE(VertexStream3dvATI) +#define glVertexStream3fATI MANGLE(VertexStream3fATI) +#define glVertexStream3fvATI MANGLE(VertexStream3fvATI) +#define glVertexStream3iATI MANGLE(VertexStream3iATI) +#define glVertexStream3ivATI MANGLE(VertexStream3ivATI) +#define glVertexStream3sATI MANGLE(VertexStream3sATI) +#define glVertexStream3svATI MANGLE(VertexStream3svATI) +#define glVertexStream4dATI MANGLE(VertexStream4dATI) +#define glVertexStream4dvATI MANGLE(VertexStream4dvATI) +#define glVertexStream4fATI MANGLE(VertexStream4fATI) +#define glVertexStream4fvATI MANGLE(VertexStream4fvATI) +#define glVertexStream4iATI MANGLE(VertexStream4iATI) +#define glVertexStream4ivATI MANGLE(VertexStream4ivATI) +#define glVertexStream4sATI MANGLE(VertexStream4sATI) +#define glVertexStream4svATI MANGLE(VertexStream4svATI) #define glVertexWeightPointerEXT MANGLE(VertexWeightPointerEXT) #define glVertexWeightfEXT MANGLE(VertexWeightfEXT) #define glVertexWeightfvEXT MANGLE(VertexWeightfvEXT) @@ -1027,21 +1129,53 @@ #define glWeightubvARB MANGLE(WeightubvARB) #define glWeightuivARB MANGLE(WeightuivARB) #define glWeightusvARB MANGLE(WeightusvARB) +#define glWindowPos2d MANGLE(WindowPos2d) +#define glWindowPos2dARB MANGLE(WindowPos2dARB) #define glWindowPos2dMESA MANGLE(WindowPos2dMESA) +#define glWindowPos2dv MANGLE(WindowPos2dv) +#define glWindowPos2dvARB MANGLE(WindowPos2dvARB) #define glWindowPos2dvMESA MANGLE(WindowPos2dvMESA) +#define glWindowPos2f MANGLE(WindowPos2f) +#define glWindowPos2fARB MANGLE(WindowPos2fARB) #define glWindowPos2fMESA MANGLE(WindowPos2fMESA) +#define glWindowPos2fv MANGLE(WindowPos2fv) +#define glWindowPos2fvARB MANGLE(WindowPos2fvARB) #define glWindowPos2fvMESA MANGLE(WindowPos2fvMESA) +#define glWindowPos2i MANGLE(WindowPos2i) +#define glWindowPos2iARB MANGLE(WindowPos2iARB) #define glWindowPos2iMESA MANGLE(WindowPos2iMESA) +#define glWindowPos2iv MANGLE(WindowPos2iv) +#define glWindowPos2ivARB MANGLE(WindowPos2ivARB) #define glWindowPos2ivMESA MANGLE(WindowPos2ivMESA) +#define glWindowPos2s MANGLE(WindowPos2s) +#define glWindowPos2sARB MANGLE(WindowPos2sARB) #define glWindowPos2sMESA MANGLE(WindowPos2sMESA) +#define glWindowPos2sv MANGLE(WindowPos2sv) +#define glWindowPos2svARB MANGLE(WindowPos2svARB) #define glWindowPos2svMESA MANGLE(WindowPos2svMESA) +#define glWindowPos3d MANGLE(WindowPos3d) +#define glWindowPos3dARB MANGLE(WindowPos3dARB) #define glWindowPos3dMESA MANGLE(WindowPos3dMESA) +#define glWindowPos3dv MANGLE(WindowPos3dv) +#define glWindowPos3dvARB MANGLE(WindowPos3dvARB) #define glWindowPos3dvMESA MANGLE(WindowPos3dvMESA) +#define glWindowPos3f MANGLE(WindowPos3f) +#define glWindowPos3fARB MANGLE(WindowPos3fARB) #define glWindowPos3fMESA MANGLE(WindowPos3fMESA) +#define glWindowPos3fv MANGLE(WindowPos3fv) +#define glWindowPos3fvARB MANGLE(WindowPos3fvARB) #define glWindowPos3fvMESA MANGLE(WindowPos3fvMESA) +#define glWindowPos3i MANGLE(WindowPos3i) +#define glWindowPos3iARB MANGLE(WindowPos3iARB) #define glWindowPos3iMESA MANGLE(WindowPos3iMESA) +#define glWindowPos3iv MANGLE(WindowPos3iv) +#define glWindowPos3ivARB MANGLE(WindowPos3ivARB) #define glWindowPos3ivMESA MANGLE(WindowPos3ivMESA) +#define glWindowPos3s MANGLE(WindowPos3s) +#define glWindowPos3sARB MANGLE(WindowPos3sARB) #define glWindowPos3sMESA MANGLE(WindowPos3sMESA) +#define glWindowPos3sv MANGLE(WindowPos3sv) +#define glWindowPos3svARB MANGLE(WindowPos3svARB) #define glWindowPos3svMESA MANGLE(WindowPos3svMESA) #define glWindowPos4dMESA MANGLE(WindowPos4dMESA) #define glWindowPos4dvMESA MANGLE(WindowPos4dvMESA) @@ -1052,5 +1186,4 @@ #define glWindowPos4sMESA MANGLE(WindowPos4sMESA) #define glWindowPos4svMESA MANGLE(WindowPos4svMESA) #define glWriteMaskEXT MANGLE(WriteMaskEXT) - #endif /* GL_MANGLE_H */ -- cgit v1.2.3 From 398c6b7980ac52ba15af78f45e71f49f33ded1aa Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 4 Feb 2003 02:43:27 +0000 Subject: DOS updates (Daniel Borca) --- docs/README.DJ | 65 +++++++----- include/GL/dmesa.h | 17 ++- progs/samples/Makefile.DJ | 125 +++++++++++++++------- src/glu/mesa/Makefile.DJ | 2 +- src/glu/sgi/Makefile.DJ | 4 +- src/glut/dos/Makefile.DJ | 23 ++-- src/glut/dos/PC_HW/pc_hw.c | 15 ++- src/glut/dos/PC_HW/pc_hw.h | 7 +- src/glut/dos/PC_HW/pc_keyb.c | 7 +- src/glut/dos/PC_HW/pc_mouse.c | 17 +-- src/glut/dos/PC_HW/pc_timer.c | 4 +- src/glut/dos/callback.c | 92 +++++++++------- src/glut/dos/color.c | 7 +- src/glut/dos/extens.c | 63 +++++++++++ src/glut/dos/glutint.h | 147 ++++++++++++++++++++++++++ src/glut/dos/init.c | 223 ++++++++++++++++++++++++++------------- src/glut/dos/menu.c | 36 ++++++- src/glut/dos/mouse.c | 58 ++++++++++ src/glut/dos/overlay.c | 35 +++++- src/glut/dos/state.c | 84 +++++++++++++-- src/glut/dos/window.c | 107 +++++++++++++------ src/mesa/drivers/dos/dmesa.c | 81 ++++++++++++-- src/mesa/drivers/dos/vesa/vesa.c | 33 +++--- src/mesa/drivers/dos/vga/vga.c | 33 +++--- src/mesa/drivers/dos/video.c | 109 +++++++++++++------ src/mesa/drivers/dos/video.h | 5 +- src/mesa/drivers/dos/virtual.S | 29 +++-- src/mesa/main/Makefile.DJ | 35 +++--- 28 files changed, 1073 insertions(+), 390 deletions(-) create mode 100644 src/glut/dos/extens.c create mode 100644 src/glut/dos/glutint.h create mode 100644 src/glut/dos/mouse.c (limited to 'include') diff --git a/docs/README.DJ b/docs/README.DJ index 580228234ab..6589f52a2ed 100644 --- a/docs/README.DJ +++ b/docs/README.DJ @@ -32,22 +32,20 @@ Available options: Environment variables: CPU optimize for the given processor. default = k6 - BIG_OPT=1 crazy optimizations; not very useful, though... - default = no SGI_GLU=1 build SGI's GLU instead of Mesa's. default = no - GLIDE absolute path to Glide library; used with FX. + GLIDE path to Glide3 SDK include files; used with FX. default = $(TOP)/include/glide3 - FX=1 build for 3dfx Glide3; use it if you have the Glide - SDK (designed for your platform), and, of course, a - 3dfx card... Note that this disables compilation of - actual DMesa code, as Glide does all the stuff! + FX=1 build for 3dfx Glide3. Note that this disables + compilation of most DMesa code and requires fxMesa. + As a consequence, you'll need the DJGPP Glide3 + library to build any application. default = no HAVE_X86=1 optimize for i386. default = no - HAVE_MMX=1 MMX instructions; use only if you assembler/compiler - supports MMX instruction set; backwards compatibility - with older processors is still preserved. + HAVE_MMX=1 allow MMX specializations, provided your assembler + supports MMX instruction set. However, the true CPU + capabilities are checked at run-time to avoid crashes. default = no HAVE_SSE=1 (see HAVE_MMX) default = no @@ -68,7 +66,7 @@ Tested on: CPU: K6-2 (CXT) @500(412.5) MHz Mainboard: ViA Apollo VP2/97 w/ 128 MB SDRAM Video card: PowerColor EvilKing3 (Voodoo3 3000 PCI) w/ 16 MB SDRAM - DJGPP: djdev 2.04 + gcc v3.2 + make v3.79.1 + DJGPP: djdev 2.04 + gcc v3.2.1 + make v3.79.1 OS: DOS and Win9x @@ -99,7 +97,7 @@ FAQ: A) Build your export object file; then link it with your application. For example: dxe3res -o dmesadxe.c gl.dxe glu.dxe glut.dxe - gcc -o dmesadxe.o -c -fno-builtin dmesadxe.c + gcc -o dmesadxe.o -c dmesadxe.c gcc -o OUT.exe dmesadxe.o IN.c -liglut -liglu -ligl -ldl 3. Using Mesa for DJGPP @@ -109,10 +107,16 @@ FAQ: Glide port is on my web page. If you haven't, sorry; everything is done in software. Suggestions? + Q) I tried to set refresh rate w/ DMesa, but without success. + A) Refresh rate control works only for VESA 3.0. If you were compiling for + Glide, see Glide info. If not, sorry! + Q) I made a simple application and it does nothing. It exits right away. Not even a blank screen. - A) Single-buffered is not allowed at all. Until I can find a way to use - *REAL* hardware acceleration, it won't get implemented. + A) Only DMesa+FX supports single-buffered. The standard VESA/VGA drivers + will always work in double-buffered modes. If/When I will find a way to + use *REAL* hardware acceleration for a specific card, it might or might + not support single-buffered modes. A) Another weird "feature" is that buffer width must be multiple of 8 (I'm a lazy programmer and I found that the easiest way to keep buffer handling at peak performance ;-). @@ -123,10 +127,6 @@ FAQ: GLUT took this into account for _WIN32 DLL's only; I don't want to modify his headers. The only workaround is to link GLUT the old way :-( - Q) I tried to set refresh rate w/ DMesa, but without success. - A) Refresh rate control works only for VESA 3.0. If you were compiling for - Glide, see Glide info. If not, sorry! - Q) The GLUT is incomplete. A) See below. @@ -135,9 +135,14 @@ FAQ: libGLUT (the toolkit): ~~~~~~~~~~~~~~~~~~~~~~ -Well, this "skeletal" GLUT implementation is not mine. Thanks should go to -Bernhard Tschirren, Mark Kilgard, Brian Paul and probably others (or probably -not ;-). GLUT functionality will be extended only on an "as needed" basis. +Well, this "skeletal" GLUT implementation was taken from AllegGL project and +heavily changed. Thanks should go to Bernhard Tschirren, Mark Kilgard, Brian +Paul and probably others (or probably not ;-). GLUT functionality will be +extended only on an "as needed" basis. + +GLUT talks to hardware via PC_HW package which was put together from various +pieces I wrote long time ago. It consists from the keyboard, mouse and timer +drivers. My keyboard driver used only scancodes; as GLUT requires ASCII values for keys, I borrowed the translation tables (and maybe more) from Allegro -- many thanks @@ -163,14 +168,15 @@ means that `printf' can be safely called during graphics. A bit of a hack, I know, because all messages come in bulk, but I think it's better than nothing. "Borrowed" from LIBRHUTI (Robert Hoehne). -Window creating defaults: 640x480x16 at (0,0), 8-bit stencil, 16-bit accum. -However, the video mode is chosen in such a way that first window will fit. If -you need high resolution with small windows, try to place them far to the right -(or way down). +Window creating defaults: 300x300x16 at (0,0), 16-bit depth, 16-bit accum, +8-bit stencil. However, the video mode is chosen in such a way that first +window will fit. If you need high resolution with small windows, set initial +position far to the right (or way down); then you can move them back to any +position right before the main loop. The following environment variables can customize GLUT behaviour: - DMESA_GLUT_REFRESH - set vertical screen refresh rate - DMESA_GLUT_BPP - set default bits per pixel + DMESA_GLUT_REFRESH - set vertical screen refresh rate (VESA3) + DMESA_GLUT_BPP - set default bits per pixel (VGA needs 8) @@ -190,17 +196,18 @@ v1.2 (nov-2002) * synced w/ Mesa-4.1 - removed dmesadxe.h -v1.3 (dec-2002) +v1.3 (jan-2003) + enabled OpenGL 1.4 support + added MMX clear/blit routines + enabled SGI's GLU compilation + + added new GLUT functions + added color-index modes + added 8bit FakeColor (thanks to Neil Funk) + added VGA support (to keep Ben Decker happy) * fixed GLUT compilation error (reported by Chan Kar Heng) * overhauled virtual buffer and internal video drivers * better fxMesa integration - * extended GLUT functionality + * revamped GLUT * switched to DXE3 diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h index 7e46ff2e2f9..16f6bff88c1 100644 --- a/include/GL/dmesa.h +++ b/include/GL/dmesa.h @@ -119,17 +119,24 @@ void DMesaSwapBuffers (DMesaBuffer b); /* - * Move/Resize Buffer. + * Move/Resize current Buffer. */ -GLboolean DMesaViewport (DMesaBuffer b, - GLint xpos, GLint ypos, - GLint width, GLint height); +GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos); +GLboolean DMesaResizeBuffer (GLint width, GLint height); /* - * Set CI color using normalized values. + * Set palette index, using normalized values. */ void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue); +/* + * DMesa state retrieval. + */ +#define DMESA_Y_ORIGIN 0x0100 +#define DMESA_SCREEN_SIZE 0x0101 +#define DMESA_ARGB_ORDER 0x0200 +void DMesaGetIntegerv (GLenum pname, GLint *params); + #ifdef __cplusplus } #endif diff --git a/progs/samples/Makefile.DJ b/progs/samples/Makefile.DJ index 5c43b7db685..b5724f432a0 100644 --- a/progs/samples/Makefile.DJ +++ b/progs/samples/Makefile.DJ @@ -1,36 +1,89 @@ -# $Id: Makefile.DJ,v 1.1 1999/08/19 00:55:41 jtg Exp $ - -# Makefile for sample programs for MS-DOS with DJGPP - -##### MACROS ##### - -INCDIR = ../include - -GL_LIBS = ../lib/dosglut.a ../lib/dosglub.a ../lib/dosmesa.a - -LIB_DEP = $(GL_LIBS) - -PROGS = accum bitmap1 bitmap2 blendeq blendxor copy depth \ - eval fog font line logo nurb olympic \ - point prim quad select shape \ - sphere star stencil stretch texture \ - tri wave - -##### RULES ##### - -.c: $(LIB_DEP) - gcc -I$(INCDIR) $(CFLAGS) $< $(LIB_DEP) -o $@ - - -##### TARGETS ##### - -default: $(PROGS) - -clean: - del *. - -realclean: clean - del *.exe - - - +# Mesa 3-D graphics library +# Version: 4.0 +# +# Copyright (C) 1999 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# DOS/DJGPP samples makefile v1.3 for Mesa 5.0 +# +# Copyright (C) 2002 - Borca Daniel +# Email : dborca@yahoo.com +# Web : http://www.geocities.com/dborca + + +# +# Available options: +# +# Environment variables: +# CPU optimize for the given processor. +# default = k6 +# GLIDE path to Glide3 SDK library files; used with FX. +# default = $(TOP)/lib/glide3 +# FX=1 build for 3dfx Glide3. Note that this disables +# compilation of most DMesa code and requires fxMesa. +# As a consequence, you'll need the DJGPP Glide3 +# library to build any application. +# default = no +# DXE=1 use DXE modules. The resolution object file must be +# present in the `lib' directory in order to use this +# option (see README.DJ for details). +# default = no +# +# Targets: +# build a specific file +# + + + +.PHONY : all +.SUFFIXES : .c .o .exe + +TOP = .. +CPU ?= k6 +GLIDE ?= $(TOP)/lib/glide3 + +CC = gcc +CFLAGS = -Wall -W -pedantic +CFLAGS += -O2 -ffast-math -mcpu=$(CPU) +CFLAGS += -I$(TOP)/include + +LDFLAGS = -s -L$(TOP)/lib + +ifdef DXE +DMESADXE = $(TOP)/lib/dmesadxe.o +LDLIBS += -liglut -liglu -ligl +ifdef FX +LDFLAGS += -L$(GLIDE) +endif +LDLIBS += -ldl +else +LDLIBS = -lglut -lglu -lgl +ifdef FX +LDFLAGS += -L$(GLIDE) +LDLIBS += -lglid3 +endif +endif + +.c.o: + $(CC) -o $@ $(CFLAGS) -c $< +.o.exe: + $(CC) -o $@ $(LDFLAGS) $(DMESADXE) $< $(LDLIBS) + +all: + $(error Must specify to build) diff --git a/src/glu/mesa/Makefile.DJ b/src/glu/mesa/Makefile.DJ index e720beb1b07..6c8ec1bd5d4 100644 --- a/src/glu/mesa/Makefile.DJ +++ b/src/glu/mesa/Makefile.DJ @@ -90,7 +90,7 @@ ifeq ($(DXE3GEN),) $(warning Missing DXE3GEN and/or DXE3.LD! You must have DXE3GEN) $(warning somewhere in PATH, and DXE3.LD in DJGPP/LIB directory.) else - -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -I $(LIBDIR)/$(GLU_IMP) -D "MesaGLU DJGPP" -E glu -X -P gl.dxe -U $(OBJECTS) + -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -I $(LIBDIR)/$(GLU_IMP) -D "MesaGLU DJGPP" -E _glu -P gl.dxe -U $(OBJECTS) endif clean: diff --git a/src/glu/sgi/Makefile.DJ b/src/glu/sgi/Makefile.DJ index 32f05770c06..6f4bcd81c09 100644 --- a/src/glu/sgi/Makefile.DJ +++ b/src/glu/sgi/Makefile.DJ @@ -50,7 +50,7 @@ GLU_IMP = libiglu.a CC = gcc CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include -Iinclude -CXX = gxx +CXX = gpp CXXFLAGS = $(CFLAGS) -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess AR = ar @@ -174,7 +174,7 @@ ifeq ($(DXE3GEN),) $(warning Missing DXE3GEN and/or DXE3.LD! You must have DXE3GEN) $(warning somewhere in PATH, and DXE3.LD in DJGPP/LIB directory.) else - -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -I $(LIBDIR)/$(GLU_IMP) -D "MesaGLU/SGI DJGPP" -E glu -X -P gl.dxe -U $(OBJECTS) + -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -I $(LIBDIR)/$(GLU_IMP) -D "MesaGLU/SGI DJGPP" -E _glu -P gl.dxe -U $(OBJECTS) endif clean: diff --git a/src/glut/dos/Makefile.DJ b/src/glut/dos/Makefile.DJ index fed1f42e8cc..2fb1bee27d7 100644 --- a/src/glut/dos/Makefile.DJ +++ b/src/glut/dos/Makefile.DJ @@ -54,10 +54,10 @@ GLUT_DXE = glut.dxe GLUT_IMP = libiglut.a CC = gcc -CFLAGS += -I$(TOP)/include -I$(MKGLUT) +CFLAGS += -I- -I$(TOP)/include -I. -I$(MKGLUT) -IPC_HW AR = ar -ARFLAGS = ru +ARFLAGS = rus ifneq ($(wildcard $(DJDIR)/lib/dxe3.ld),) DXE3GEN = $(wildcard $(addsuffix /dxe3gen.exe,$(subst ;, ,$(PATH)))) @@ -66,16 +66,14 @@ endif RM = del CORE_SOURCES = \ - bitmap.c \ callback.c \ color.c \ - globals.c \ + extens.c \ init.c \ menu.c \ - models.c \ + mouse.c \ overlay.c \ state.c \ - teapot.c \ window.c PC_HW_SOURCES = \ @@ -86,13 +84,22 @@ PC_HW_SOURCES = \ PC_HW/pc_irq.S MKGLUT_SOURCES = \ + $(MKGLUT)/glut_bitmap.c \ + $(MKGLUT)/glut_bwidth.c \ + $(MKGLUT)/glut_stroke.c \ + $(MKGLUT)/glut_swidth.c \ + $(MKGLUT)/glut_shapes.c \ + $(MKGLUT)/glut_teapot.c \ $(MKGLUT)/glut_8x13.c \ $(MKGLUT)/glut_9x15.c \ $(MKGLUT)/glut_hel10.c \ $(MKGLUT)/glut_hel12.c \ $(MKGLUT)/glut_hel18.c \ $(MKGLUT)/glut_tr10.c \ - $(MKGLUT)/glut_tr24.c + $(MKGLUT)/glut_tr24.c \ + $(MKGLUT)/glut_roman.c \ + $(MKGLUT)/glut_mroman.c \ + $(MKGLUT)/glut_util.c SOURCES = $(CORE_SOURCES) $(PC_HW_SOURCES) $(MKGLUT_SOURCES) @@ -115,7 +122,7 @@ ifeq ($(DXE3GEN),) $(warning Missing DXE3GEN and/or DXE3.LD! You must have DXE3GEN) $(warning somewhere in PATH, and DXE3.LD in DJGPP/LIB directory.) else - -dxe3gen -o $(LIBDIR)/$(GLUT_DXE) -I $(LIBDIR)/$(GLUT_IMP) -D "MesaGLUT DJGPP" -E glut -X -P gl.dxe -P glu.dxe -U $(OBJECTS) + -dxe3gen -o $(LIBDIR)/$(GLUT_DXE) -I $(LIBDIR)/$(GLUT_IMP) -D "MesaGLUT DJGPP" -E _glut -P gl.dxe -P glu.dxe -U $(OBJECTS) endif clean: diff --git a/src/glut/dos/PC_HW/pc_hw.c b/src/glut/dos/PC_HW/pc_hw.c index 867daf89b07..f08286d4c49 100644 --- a/src/glut/dos/PC_HW/pc_hw.c +++ b/src/glut/dos/PC_HW/pc_hw.c @@ -73,9 +73,6 @@ void *pc_malloc (size_t size) /* * standard redirection */ -#define STDOUT 1 -#define STDERR 2 - static char outname[L_tmpnam]; static int h_out, h_outbak; static char errname[L_tmpnam]; @@ -86,9 +83,9 @@ int pc_open_stdout (void) tmpnam(outname); if ((h_out=open(outname, O_WRONLY | O_CREAT | O_TEXT | O_TRUNC, S_IREAD | S_IWRITE)) > 0) { - h_outbak = dup(STDOUT); + h_outbak = dup(STDOUT_FILENO); fflush(stdout); - dup2(h_out, STDOUT); + dup2(h_out, STDOUT_FILENO); } return h_out; @@ -100,7 +97,7 @@ void pc_close_stdout (void) char *line = alloca(512); if (h_out > 0) { - dup2(h_outbak, STDOUT); + dup2(h_outbak, STDOUT_FILENO); close(h_out); close(h_outbak); @@ -119,9 +116,9 @@ int pc_open_stderr (void) tmpnam(errname); if ((h_err=open(errname, O_WRONLY | O_CREAT | O_TEXT | O_TRUNC, S_IREAD | S_IWRITE)) > 0) { - h_errbak = dup(STDERR); + h_errbak = dup(STDERR_FILENO); fflush(stderr); - dup2(h_err, STDERR); + dup2(h_err, STDERR_FILENO); } return h_err; @@ -133,7 +130,7 @@ void pc_close_stderr (void) char *line = alloca(512); if (h_err > 0) { - dup2(h_errbak, STDERR); + dup2(h_errbak, STDERR_FILENO); close(h_err); close(h_errbak); diff --git a/src/glut/dos/PC_HW/pc_hw.h b/src/glut/dos/PC_HW/pc_hw.h index 77572e64414..c38c8959b6c 100644 --- a/src/glut/dos/PC_HW/pc_hw.h +++ b/src/glut/dos/PC_HW/pc_hw.h @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v1.2 for DOS/DJGPP + * PC/HW routine collection v1.3 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -39,6 +39,7 @@ int pc_clexit (VFUNC f); #define ENDOFUNC(x) static void x##_end() { } #define LOCKFUNC(x) _go32_dpmi_lock_code((void *)x, (long)x##_end - (long)x) #define LOCKDATA(x) _go32_dpmi_lock_data((void *)&x, sizeof(x)) +#define LOCKBUFF(x, l) _go32_dpmi_lock_data((void *)x, l) void *pc_malloc (size_t size); @@ -194,6 +195,7 @@ void pc_remove_keyb (void); int pc_keypressed (void); int pc_readkey (void); int pc_keydown (int code); +int pc_keyshifts (void); /* * timer @@ -210,9 +212,6 @@ MFUNC pc_install_mouse_handler (MFUNC handler); void pc_mouse_area (int x1, int y1, int x2, int y2); void pc_mouse_speed (int xspeed, int yspeed); int pc_query_mouse (int *x, int *y); -void pc_show_mouse (void); -void pc_scare_mouse (void); -void pc_unscare_mouse (void); /* * standard redirection diff --git a/src/glut/dos/PC_HW/pc_keyb.c b/src/glut/dos/PC_HW/pc_keyb.c index fb22923d63f..333ca757f50 100644 --- a/src/glut/dos/PC_HW/pc_keyb.c +++ b/src/glut/dos/PC_HW/pc_keyb.c @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v1.1 for DOS/DJGPP + * PC/HW routine collection v1.3 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -445,6 +445,11 @@ int pc_keydown (int code) return pc_key[code]; } +int pc_keyshifts (void) +{ + return key_shifts; +} + void pc_remove_keyb (void) { if (keyboard_installed) { diff --git a/src/glut/dos/PC_HW/pc_mouse.c b/src/glut/dos/PC_HW/pc_mouse.c index 01e9502dd0c..3ed76509067 100644 --- a/src/glut/dos/PC_HW/pc_mouse.c +++ b/src/glut/dos/PC_HW/pc_mouse.c @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v1.2 for DOS/DJGPP + * PC/HW routine collection v1.3 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -212,22 +212,9 @@ int pc_query_mouse (int *x, int *y) return pc_mouse_b; } -void pc_show_mouse (void) -{ - /* not implemented */ -} -void pc_scare_mouse (void) -{ - /* not implemented */ -} -void pc_unscare_mouse (void) -{ - /* not implemented */ -} - __asm("\n\ .text \n\ - .balign 4 \n\ + .p2align 5,,31 \n\ .global _mouse_wrapper \n\ _mouse_wrapper: \n\ cld \n\ diff --git a/src/glut/dos/PC_HW/pc_timer.c b/src/glut/dos/PC_HW/pc_timer.c index ec348e278b5..36c02910a3e 100644 --- a/src/glut/dos/PC_HW/pc_timer.c +++ b/src/glut/dos/PC_HW/pc_timer.c @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v1.0 for DOS/DJGPP + * PC/HW routine collection v1.3 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -27,7 +27,7 @@ typedef struct { volatile void *parm; } TIMER; -TIMER timer_main, timer_func[MAX_TIMERS]; +static TIMER timer_main, timer_func[MAX_TIMERS]; static int timer () { diff --git a/src/glut/dos/callback.c b/src/glut/dos/callback.c index a9260cbe7c1..6e3f5a77c78 100644 --- a/src/glut/dos/callback.c +++ b/src/glut/dos/callback.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.0 for Mesa 4.0 + * DOS/DJGPP glut driver v1.3 for Mesa 5.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -27,126 +27,138 @@ */ -#include "GL/glut.h" -#include "internal.h" +#include "glutint.h" -void APIENTRY glutDisplayFunc (void (GLUTCALLBACK *func) (void)) -{ - display_func = func; -} +GLUTidleCB g_idle_func = NULL; -void APIENTRY glutReshapeFunc (void (GLUTCALLBACK *func) (int width, int height)) -{ - reshape_func = func; -} -void APIENTRY glutKeyboardFunc (void (GLUTCALLBACK *func) (unsigned char key, int x, int y)) +void APIENTRY glutDisplayFunc (GLUTdisplayCB func) { - keyboard_func = func; + g_curwin->display = func; } -void APIENTRY glutMouseFunc (void (GLUTCALLBACK *func) (int button, int state, int x, int y)) + +void APIENTRY glutReshapeFunc (GLUTreshapeCB func) { - mouse_func = func; + g_curwin->reshape = func; } -void APIENTRY glutMotionFunc (void (GLUTCALLBACK *func) (int x, int y)) + +void APIENTRY glutKeyboardFunc (GLUTkeyboardCB func) { - motion_func = func; + g_curwin->keyboard = func; } -void APIENTRY glutPassiveMotionFunc (void (GLUTCALLBACK *func) (int x, int y)) + +void APIENTRY glutMouseFunc (GLUTmouseCB func) { - passive_motion_func = func; + g_curwin->mouse = func; } -void APIENTRY glutEntryFunc (void (GLUTCALLBACK *func) (int state)) + +void APIENTRY glutMotionFunc (GLUTmotionCB func) { - entry_func = func; + g_curwin->motion = func; } -void APIENTRY glutVisibilityFunc (void (GLUTCALLBACK *func) (int state)) + +void APIENTRY glutPassiveMotionFunc (GLUTpassiveCB func) { - visibility_func = func; + g_curwin->passive = func; } -void APIENTRY glutIdleFunc (void (GLUTCALLBACK *func) (void)) + +void APIENTRY glutEntryFunc (GLUTentryCB func) { - idle_func = func; + g_curwin->entry = func; } -void APIENTRY glutTimerFunc (unsigned int millis, void (GLUTCALLBACK *func) (int value), int value) + +void APIENTRY glutVisibilityFunc (GLUTvisibilityCB func) { + g_curwin->visibility = func; } -void APIENTRY glutMenuStateFunc (void (GLUTCALLBACK *func) (int state)) + +void APIENTRY glutWindowStatusFunc (GLUTwindowStatusCB func) { - menu_state_func = func; } -void APIENTRY glutSpecialFunc (void (GLUTCALLBACK *func) (int key, int x, int y)) + +void APIENTRY glutIdleFunc (GLUTidleCB func) { - special_func = func; + g_idle_func = func; } -void APIENTRY glutSpaceballMotionFunc (void (GLUTCALLBACK *func) (int x, int y, int z)) + +void APIENTRY glutTimerFunc (unsigned int millis, GLUTtimerCB func, int value) { } -void APIENTRY glutSpaceballRotateFunc (void (GLUTCALLBACK *func) (int x, int y, int z)) + +void APIENTRY glutSpecialFunc (GLUTspecialCB func) { + g_curwin->special = func; } -void APIENTRY glutSpaceballButtonFunc (void (GLUTCALLBACK *func) (int button, int state)) + +void APIENTRY glutSpaceballMotionFunc (GLUTspaceMotionCB func) { } -void APIENTRY glutButtonBoxFunc (void (GLUTCALLBACK *func) (int button, int state)) + +void APIENTRY glutSpaceballRotateFunc (GLUTspaceRotateCB func) { } -void APIENTRY glutDialsFunc (void (GLUTCALLBACK *func) (int dial, int value)) + +void APIENTRY glutSpaceballButtonFunc (GLUTspaceButtonCB func) { } -void APIENTRY glutTabletMotionFunc (void (GLUTCALLBACK *func) (int x, int y)) + +void APIENTRY glutDialsFunc (GLUTdialsCB func) { } -void APIENTRY glutTabletButtonFunc (void (GLUTCALLBACK *func) (int button, int state, int x, int y)) + +void APIENTRY glutButtonBoxFunc (GLUTbuttonBoxCB func) { } -void APIENTRY glutMenuStatusFunc (void (GLUTCALLBACK *func) (int status, int x, int y)) + +void APIENTRY glutTabletMotionFunc (GLUTtabletMotionCB func) { } -void APIENTRY glutOverlayDisplayFunc (void (GLUTCALLBACK *func) (void)) + +void APIENTRY glutTabletButtonFunc (GLUTtabletButtonCB func) { } -void APIENTRY glutWindowStatusFunc (void (GLUTCALLBACK *func) (int state)) + +void APIENTRY glutJoystickFunc (GLUTjoystickCB func, int interval) { } diff --git a/src/glut/dos/color.c b/src/glut/dos/color.c index f1f529521d6..2e8ed3f95bf 100644 --- a/src/glut/dos/color.c +++ b/src/glut/dos/color.c @@ -27,9 +27,8 @@ */ -#include "GL/glut.h" +#include "glutint.h" #include "GL/dmesa.h" -#include "internal.h" @@ -40,7 +39,9 @@ void APIENTRY glutSetColor (int ndx, GLfloat red, GLfloat green, GLfloat blue) { if (g_display_mode & GLUT_INDEX) { - DMesaSetCI(ndx, CLAMP(red), CLAMP(green), CLAMP(blue)); + if ((ndx >= 0) && (ndx < (256 - RESERVED_COLORS))) { + DMesaSetCI(ndx, CLAMP(red), CLAMP(green), CLAMP(blue)); + } } } diff --git a/src/glut/dos/extens.c b/src/glut/dos/extens.c new file mode 100644 index 00000000000..ae8e44f4088 --- /dev/null +++ b/src/glut/dos/extens.c @@ -0,0 +1,63 @@ +/* + * Mesa 3-D graphics library + * Version: 3.4 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.3 for Mesa 5.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include + +#include "GL/glut.h" + + + +int APIENTRY glutExtensionSupported (const char *extension) +{ + static const GLubyte *extensions = NULL; + const GLubyte *last, *where; + + /* Extension names should not have spaces. */ + if (strchr(extension, ' ') || *extension == '\0') { + return GL_FALSE; + } + + /* Not my problem if you don't have a valid OpenGL context */ + if (!extensions) { + extensions = glGetString(GL_EXTENSIONS); + } + + /* Take care of sub-strings etc. */ + for (last = extensions;;) { + if ((where = (GLubyte *)strstr((const char *)last, extension)) == NULL) { + return GL_FALSE; + } + last = where + strlen(extension); + if (where == extensions || *(where - 1) == ' ') { + if (*last == ' ' || *last == '\0') { + return GL_TRUE; + } + } + } +} diff --git a/src/glut/dos/glutint.h b/src/glut/dos/glutint.h new file mode 100644 index 00000000000..77a8322c442 --- /dev/null +++ b/src/glut/dos/glutint.h @@ -0,0 +1,147 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.3 for Mesa 5.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef __glutint_h__ +#define __glutint_h__ + +#include + +#include "GL/dmesa.h" + + + +/* GLUT function types */ +typedef void (GLUTCALLBACK *GLUTdisplayCB) (void); +typedef void (GLUTCALLBACK *GLUTreshapeCB) (int, int); +typedef void (GLUTCALLBACK *GLUTkeyboardCB) (unsigned char, int, int); +typedef void (GLUTCALLBACK *GLUTmouseCB) (int, int, int, int); +typedef void (GLUTCALLBACK *GLUTmotionCB) (int, int); +typedef void (GLUTCALLBACK *GLUTpassiveCB) (int, int); +typedef void (GLUTCALLBACK *GLUTentryCB) (int); +typedef void (GLUTCALLBACK *GLUTvisibilityCB) (int); +typedef void (GLUTCALLBACK *GLUTwindowStatusCB) (int); +typedef void (GLUTCALLBACK *GLUTidleCB) (void); +typedef void (GLUTCALLBACK *GLUTtimerCB) (int); +typedef void (GLUTCALLBACK *GLUTmenuStateCB) (int); /* DEPRECATED. */ +typedef void (GLUTCALLBACK *GLUTmenuStatusCB) (int, int, int); +typedef void (GLUTCALLBACK *GLUTselectCB) (int); +typedef void (GLUTCALLBACK *GLUTspecialCB) (int, int, int); +typedef void (GLUTCALLBACK *GLUTspaceMotionCB) (int, int, int); +typedef void (GLUTCALLBACK *GLUTspaceRotateCB) (int, int, int); +typedef void (GLUTCALLBACK *GLUTspaceButtonCB) (int, int); +typedef void (GLUTCALLBACK *GLUTdialsCB) (int, int); +typedef void (GLUTCALLBACK *GLUTbuttonBoxCB) (int, int); +typedef void (GLUTCALLBACK *GLUTtabletMotionCB) (int, int); +typedef void (GLUTCALLBACK *GLUTtabletButtonCB) (int, int, int, int); +typedef void (GLUTCALLBACK *GLUTjoystickCB) (unsigned int, int, int, int); + +typedef struct GLUTwindow { + int num; /* window id */ + + DMesaBuffer buffer; + + int show_mouse; + + /* GLUT settable or visible window state. */ + int xpos; + int ypos; + int width; /* window width in pixels */ + int height; /* window height in pixels */ + + /* Per-window callbacks. */ + GLUTdisplayCB display; /* redraw */ + GLUTreshapeCB reshape; /* resize (width,height) */ + GLUTmouseCB mouse; /* mouse (button,state,x,y) */ + GLUTmotionCB motion; /* motion (x,y) */ + GLUTpassiveCB passive; /* passive motion (x,y) */ + GLUTentryCB entry; /* window entry/exit (state) */ + GLUTkeyboardCB keyboard; /* keyboard (ASCII,x,y) */ + GLUTkeyboardCB keyboardUp; /* keyboard up (ASCII,x,y) */ + GLUTwindowStatusCB windowStatus; /* window status */ + GLUTvisibilityCB visibility; /* visibility */ + GLUTspecialCB special; /* special key */ + GLUTspecialCB specialUp; /* special up key */ + GLUTbuttonBoxCB buttonBox; /* button box */ + GLUTdialsCB dials; /* dials */ + GLUTspaceMotionCB spaceMotion; /* Spaceball motion */ + GLUTspaceRotateCB spaceRotate; /* Spaceball rotate */ + GLUTspaceButtonCB spaceButton; /* Spaceball button */ + GLUTtabletMotionCB tabletMotion; /* tablet motion */ + GLUTtabletButtonCB tabletButton; /* tablet button */ + GLUTjoystickCB joystick; /* joystick */ +} GLUTwindow; + +extern GLUTidleCB g_idle_func; +extern GLUTmenuStatusCB g_menu_status_func; + +extern GLboolean g_redisplay; + +extern GLuint g_bpp; /* HW: bits per pixel */ +extern GLuint g_refresh; /* HW: vertical refresh rate */ +extern GLuint g_screen_w, g_screen_h; /* HW: physical screen size */ + +extern GLuint g_display_mode; /* display bits */ +extern int g_init_x, g_init_y; /* initial window position */ +extern GLuint g_init_w, g_init_h; /* initial window size */ + +extern int g_mouse; /* non-zero if mouse installed */ +extern int g_mouse_x, g_mouse_y; /* mouse coords, relative to current win */ + +extern GLUTwindow *g_curwin; /* current window */ + +extern char *__glutProgramName; /* program name */ + +extern void __glutInitMouse (void); + +/* private routines from glut_util.c */ +extern char * __glutStrdup(const char *string); +extern void __glutWarning(char *format,...); +extern void __glutFatalError(char *format,...); +extern void __glutFatalUsage(char *format,...); + + + +/* hmmm... */ +#include "pc_hw/pc_hw.h" + + + +#define MAX_WINDOWS 2 + +#define DEFAULT_WIDTH 300 +#define DEFAULT_HEIGHT 300 +#define DEFAULT_BPP 16 + +#define DEPTH_SIZE 16 +#define STENCIL_SIZE 8 +#define ACCUM_SIZE 16 + +#define RESERVED_COLORS 0 + +#endif /* __glutint_h__ */ diff --git a/src/glut/dos/init.c b/src/glut/dos/init.c index 4ee939b4871..0f848f6f360 100644 --- a/src/glut/dos/init.c +++ b/src/glut/dos/init.c @@ -27,12 +27,29 @@ */ -#include "GL/glut.h" -#include "internal.h" +#include +#include "glutint.h" -void APIENTRY glutInit (int *argcp, char **argv) + + +GLboolean g_redisplay = GL_FALSE; + +GLuint g_bpp = DEFAULT_BPP; +GLuint g_refresh = 0; +GLuint g_screen_w, g_screen_h; + +GLuint g_display_mode = 0; +int g_init_x = 0, g_init_y = 0; +GLuint g_init_w = DEFAULT_WIDTH, g_init_h = DEFAULT_HEIGHT; + +char *__glutProgramName = NULL; + + + +void APIENTRY glutInit (int *argc, char **argv) { + char *str; const char *env; if ((env = getenv("DMESA_GLUT_BPP")) != NULL) { @@ -42,33 +59,44 @@ void APIENTRY glutInit (int *argcp, char **argv) g_refresh = atoi(env); } + /* Determine program name. */ + str = strrchr(argv[0], '/'); + if (str == NULL) { + str = argv[0]; + } else { + str++; + } + __glutProgramName = __glutStrdup(str); + + /* Initialize timer */ glutGet(GLUT_ELAPSED_TIME); } + void APIENTRY glutInitDisplayMode (unsigned int mode) { g_display_mode = mode; - - pc_install_keyb(); - g_mouse = pc_install_mouse(); } + void APIENTRY glutInitWindowPosition (int x, int y) { - g_xpos = x; - g_ypos = y; + g_init_x = x; + g_init_y = y; } + void APIENTRY glutInitWindowSize (int width, int height) { - g_width = width; - g_height = height; + g_init_w = width; + g_init_h = height; } + void APIENTRY glutMainLoop (void) { GLboolean idle; @@ -76,52 +104,37 @@ void APIENTRY glutMainLoop (void) static int old_mouse_y = 0; static int old_mouse_b = 0; + { + GLint screen_size[2]; + DMesaGetIntegerv(DMESA_SCREEN_SIZE, screen_size); + g_screen_w = screen_size[0]; + g_screen_h = screen_size[1]; + } + + pc_install_keyb(); + __glutInitMouse(); + glutPostRedisplay(); - if (reshape_func) reshape_func(g_width, g_height); - if (visibility_func) visibility_func(GLUT_VISIBLE); - if (g_mouse) pc_show_mouse(); + if (g_curwin->reshape) { + g_curwin->reshape(g_curwin->width, g_curwin->height); + } + if (g_curwin->visibility) { + g_curwin->visibility(GLUT_VISIBLE); + } while (GL_TRUE) { idle = GL_TRUE; - if (g_redisplay && display_func) { + if (g_redisplay && g_curwin->display) { idle = GL_FALSE; g_redisplay = GL_FALSE; - if (g_mouse && !(g_display_mode & GLUT_DOUBLE)) pc_scare_mouse(); - display_func(); - if (g_mouse && !(g_display_mode & GLUT_DOUBLE)) pc_unscare_mouse(); - } - - if (pc_keypressed()) { - int key; - - idle = GL_FALSE; - key = pc_readkey(); - - switch (key>>16) { - case KEY_F1: if (special_func) special_func(GLUT_KEY_F1, 0, 0); break; - case KEY_F2: if (special_func) special_func(GLUT_KEY_F2, 0, 0); break; - case KEY_F3: if (special_func) special_func(GLUT_KEY_F3, 0, 0); break; - case KEY_F4: if (special_func) special_func(GLUT_KEY_F4, 0, 0); break; - case KEY_F5: if (special_func) special_func(GLUT_KEY_F5, 0, 0); break; - case KEY_F6: if (special_func) special_func(GLUT_KEY_F6, 0, 0); break; - case KEY_F7: if (special_func) special_func(GLUT_KEY_F7, 0, 0); break; - case KEY_F8: if (special_func) special_func(GLUT_KEY_F8, 0, 0); break; - case KEY_F9: if (special_func) special_func(GLUT_KEY_F9, 0, 0); break; - case KEY_F10: if (special_func) special_func(GLUT_KEY_F10, 0, 0); break; - case KEY_F11: if (special_func) special_func(GLUT_KEY_F11, 0, 0); break; - case KEY_F12: if (special_func) special_func(GLUT_KEY_F12, 0, 0); break; - case KEY_LEFT: if (special_func) special_func(GLUT_KEY_LEFT, 0, 0); break; - case KEY_UP: if (special_func) special_func(GLUT_KEY_UP, 0, 0); break; - case KEY_RIGHT: if (special_func) special_func(GLUT_KEY_RIGHT, 0, 0); break; - case KEY_DOWN: if (special_func) special_func(GLUT_KEY_DOWN, 0, 0); break; - case KEY_PGUP: if (special_func) special_func(GLUT_KEY_PAGE_UP, 0, 0); break; - case KEY_PGDN: if (special_func) special_func(GLUT_KEY_PAGE_DOWN, 0, 0); break; - case KEY_HOME: if (special_func) special_func(GLUT_KEY_HOME, 0, 0); break; - case KEY_END: if (special_func) special_func(GLUT_KEY_END, 0, 0); break; - case KEY_INSERT: if (special_func) special_func(GLUT_KEY_INSERT, 0, 0); break; - default: if (keyboard_func) keyboard_func(key & 0xFF, 0, 0); + if (g_curwin->show_mouse && !(g_display_mode & GLUT_DOUBLE)) { + /* XXX scare mouse */ + g_curwin->display(); + /* XXX unscare mouse */ + } else { + g_curwin->display(); } } @@ -129,41 +142,101 @@ void APIENTRY glutMainLoop (void) int mouse_x; int mouse_y; int mouse_b; - + + /* query mouse */ mouse_b = pc_query_mouse(&mouse_x, &mouse_y); - - if (motion_func && ((mouse_x != old_mouse_x) || (mouse_y != old_mouse_y))) { + + /* relative to window coordinates */ + g_mouse_x = mouse_x - g_curwin->xpos; + g_mouse_y = mouse_y - g_curwin->ypos; + + /* mouse was moved? */ + if ((mouse_x != old_mouse_x) || (mouse_y != old_mouse_y)) { idle = GL_FALSE; old_mouse_x = mouse_x; old_mouse_y = mouse_y; - - motion_func(old_mouse_x, old_mouse_y); + + if (mouse_b) { + /* any button pressed */ + if (g_curwin->motion) { + g_curwin->motion(g_mouse_x, g_mouse_y); + } + } else { + /* no button pressed */ + if (g_curwin->passive) { + g_curwin->passive(g_mouse_x, g_mouse_y); + } + } } - - if (mouse_func && (mouse_b != old_mouse_b)) { - int new_mouse_b = mouse_b; - - if ((old_mouse_b & 1) && !(new_mouse_b & 1)) - mouse_func(GLUT_LEFT_BUTTON, GLUT_UP, mouse_x, mouse_y); - else if (!(old_mouse_b & 1) && (new_mouse_b & 1)) - mouse_func(GLUT_LEFT_BUTTON, GLUT_DOWN, mouse_x, mouse_y); - - if ((old_mouse_b & 2) && !(new_mouse_b & 2)) - mouse_func(GLUT_RIGHT_BUTTON, GLUT_UP, mouse_x, mouse_y); - else if (!(old_mouse_b & 2) && (new_mouse_b & 2)) - mouse_func(GLUT_RIGHT_BUTTON, GLUT_DOWN, mouse_x, mouse_y); - - if ((old_mouse_b & 4) && !(new_mouse_b & 4)) - mouse_func(GLUT_MIDDLE_BUTTON, GLUT_UP, mouse_x, mouse_y); - else if (!(old_mouse_b & 3) && (new_mouse_b & 4)) - mouse_func(GLUT_MIDDLE_BUTTON, GLUT_DOWN, mouse_x, mouse_y); - + + /* button state changed? */ + if (mouse_b != old_mouse_b) { + GLUTmouseCB mouse_func; + + if ((mouse_func = g_curwin->mouse)) { + if ((old_mouse_b & 1) && !(mouse_b & 1)) + mouse_func(GLUT_LEFT_BUTTON, GLUT_UP, g_mouse_x, g_mouse_y); + else if (!(old_mouse_b & 1) && (mouse_b & 1)) + mouse_func(GLUT_LEFT_BUTTON, GLUT_DOWN, g_mouse_x, g_mouse_y); + + if ((old_mouse_b & 2) && !(mouse_b & 2)) + mouse_func(GLUT_RIGHT_BUTTON, GLUT_UP, g_mouse_x, g_mouse_y); + else if (!(old_mouse_b & 2) && (mouse_b & 2)) + mouse_func(GLUT_RIGHT_BUTTON, GLUT_DOWN, g_mouse_x, g_mouse_y); + + if ((old_mouse_b & 4) && !(mouse_b & 4)) + mouse_func(GLUT_MIDDLE_BUTTON, GLUT_UP, g_mouse_x, g_mouse_y); + else if (!(old_mouse_b & 3) && (mouse_b & 4)) + mouse_func(GLUT_MIDDLE_BUTTON, GLUT_DOWN, g_mouse_x, g_mouse_y); + } + idle = GL_FALSE; - old_mouse_b = new_mouse_b; + old_mouse_b = mouse_b; + } + } + + if (pc_keypressed()) { + int key; + int glut_key; + + idle = GL_FALSE; + key = pc_readkey(); + + switch (key>>16) { + case KEY_F1: glut_key = GLUT_KEY_F1; goto special; + case KEY_F2: glut_key = GLUT_KEY_F2; goto special; + case KEY_F3: glut_key = GLUT_KEY_F3; goto special; + case KEY_F4: glut_key = GLUT_KEY_F4; goto special; + case KEY_F5: glut_key = GLUT_KEY_F5; goto special; + case KEY_F6: glut_key = GLUT_KEY_F6; goto special; + case KEY_F7: glut_key = GLUT_KEY_F7; goto special; + case KEY_F8: glut_key = GLUT_KEY_F8; goto special; + case KEY_F9: glut_key = GLUT_KEY_F9; goto special; + case KEY_F10: glut_key = GLUT_KEY_F10; goto special; + case KEY_F11: glut_key = GLUT_KEY_F11; goto special; + case KEY_F12: glut_key = GLUT_KEY_F12; goto special; + case KEY_LEFT: glut_key = GLUT_KEY_LEFT; goto special; + case KEY_UP: glut_key = GLUT_KEY_UP; goto special; + case KEY_RIGHT: glut_key = GLUT_KEY_RIGHT; goto special; + case KEY_DOWN: glut_key = GLUT_KEY_DOWN; goto special; + case KEY_PGUP: glut_key = GLUT_KEY_PAGE_UP; goto special; + case KEY_PGDN: glut_key = GLUT_KEY_PAGE_DOWN; goto special; + case KEY_HOME: glut_key = GLUT_KEY_HOME; goto special; + case KEY_END: glut_key = GLUT_KEY_END; goto special; + case KEY_INSERT: glut_key = GLUT_KEY_INSERT; goto special; + special: + if (g_curwin->special) { + g_curwin->special(glut_key, g_mouse_x, g_mouse_y); + } + break; + default: + if (g_curwin->keyboard) { + g_curwin->keyboard(key & 0xFF, g_mouse_x, g_mouse_y); + } } } - if (idle && idle_func) - idle_func(); + if (idle && g_idle_func) + g_idle_func(); } } diff --git a/src/glut/dos/menu.c b/src/glut/dos/menu.c index eccc51d2ea2..9a3841b12b6 100644 --- a/src/glut/dos/menu.c +++ b/src/glut/dos/menu.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.0 for Mesa 4.0 + * DOS/DJGPP glut driver v1.3 for Mesa 5.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -27,60 +27,90 @@ */ -#include "GL/glut.h" +#include "glutint.h" -int APIENTRY glutCreateMenu (void (GLUTCALLBACK *func) (int)) + +GLUTmenuStatusCB g_menu_status_func = NULL; + + + +void APIENTRY glutMenuStateFunc (GLUTmenuStateCB func) +{ + g_menu_status_func = (GLUTmenuStatusCB)func; +} + + + +void APIENTRY glutMenuStatusFunc (GLUTmenuStatusCB func) +{ + g_menu_status_func = func; +} + + + +int APIENTRY glutCreateMenu (GLUTselectCB func) { return 0; } + + void APIENTRY glutDestroyMenu (int menu) { } + int APIENTRY glutGetMenu (void) { return 0; } + void APIENTRY glutSetMenu (int menu) { } + void APIENTRY glutAddMenuEntry (const char *label, int value) { } + void APIENTRY glutAddSubMenu (const char *label, int submenu) { } + void APIENTRY glutChangeToMenuEntry (int item, const char *label, int value) { } + void APIENTRY glutChangeToSubMenu (int item, const char *label, int submenu) { } + void APIENTRY glutRemoveMenuItem (int item) { } + void APIENTRY glutAttachMenu (int button) { } + void APIENTRY glutDetachMenu (int button) { } diff --git a/src/glut/dos/mouse.c b/src/glut/dos/mouse.c new file mode 100644 index 00000000000..c67f8093b14 --- /dev/null +++ b/src/glut/dos/mouse.c @@ -0,0 +1,58 @@ +/* + * Mesa 3-D graphics library + * Version: 3.4 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.3 for Mesa 5.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include "glutint.h" + + + +int g_mouse; +int g_mouse_x = 0, g_mouse_y = 0; + + + +void __glutInitMouse (void) +{ + if ((g_mouse = pc_install_mouse())) { + GLint yorg; + GLint rect[4]; + + DMesaGetIntegerv(DMESA_Y_ORIGIN, &yorg); + if (yorg) { + rect[1] = g_screen_h - g_curwin->height; + } else { + rect[1] = g_curwin->ypos; + } + rect[0] = g_curwin->xpos; + rect[2] = rect[0] + g_curwin->width - 1; + rect[3] = rect[1] + g_curwin->height - 1; + pc_mouse_area(rect[0], rect[1], rect[2], rect[3]); + + g_curwin->show_mouse = (g_curwin->mouse || g_curwin->motion || g_curwin->passive); + } +} diff --git a/src/glut/dos/overlay.c b/src/glut/dos/overlay.c index ab4f561849c..f1f72cf1f83 100644 --- a/src/glut/dos/overlay.c +++ b/src/glut/dos/overlay.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.0 for Mesa 4.0 + * DOS/DJGPP glut driver v1.3 for Mesa 5.0 * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -27,7 +27,33 @@ */ -#include "GL/glut.h" +#include "glutint.h" + + + +int APIENTRY glutLayerGet (GLenum info) +{ + switch (info) { + case GLUT_OVERLAY_POSSIBLE: + case GLUT_HAS_OVERLAY: + return GL_FALSE; + case GLUT_LAYER_IN_USE: + return GLUT_NORMAL; + case GLUT_NORMAL_DAMAGED: + return GL_FALSE; + case GLUT_OVERLAY_DAMAGED: + case GLUT_TRANSPARENT_INDEX: + default: + return -1; + } +} + + + +void APIENTRY glutOverlayDisplayFunc (GLUTdisplayCB func) +{ +} + void APIENTRY glutEstablishOverlay (void) @@ -35,26 +61,31 @@ void APIENTRY glutEstablishOverlay (void) } + void APIENTRY glutRemoveOverlay (void) { } + void APIENTRY glutUseLayer (GLenum layer) { } + void APIENTRY glutPostOverlayRedisplay (void) { } + void APIENTRY glutShowOverlay (void) { } + void APIENTRY glutHideOverlay (void) { } diff --git a/src/glut/dos/state.c b/src/glut/dos/state.c index b26307d9cb6..e9735a06a2a 100644 --- a/src/glut/dos/state.c +++ b/src/glut/dos/state.c @@ -27,16 +27,19 @@ */ -#include "GL/glut.h" -#include "internal.h" +#include "glutint.h" + #define FREQUENCY 100 + static int timer_installed; static volatile int ticks; + + static void ticks_timer (void *p) { (void)p; @@ -48,25 +51,92 @@ static void ticks_timer (void *p) int APIENTRY glutGet (GLenum type) { switch (type) { - case GLUT_WINDOW_COLORMAP_SIZE: - return (g_display_mode & GLUT_INDEX) ? 256 : 0; + case GLUT_WINDOW_X: + return g_curwin->xpos; + case GLUT_WINDOW_Y: + return g_curwin->ypos; + case GLUT_WINDOW_WIDTH: + return g_curwin->width; + case GLUT_WINDOW_HEIGHT: + return g_curwin->height; + case GLUT_WINDOW_STENCIL_SIZE: + return STENCIL_SIZE; + case GLUT_WINDOW_DEPTH_SIZE: + return DEPTH_SIZE; case GLUT_WINDOW_RGBA: return !(g_display_mode & GLUT_INDEX); + case GLUT_WINDOW_COLORMAP_SIZE: + return (g_display_mode & GLUT_INDEX) ? (256 - RESERVED_COLORS) : 0; + case GLUT_SCREEN_WIDTH: + return g_screen_w; + case GLUT_SCREEN_HEIGHT: + return g_screen_h; + case GLUT_INIT_WINDOW_X: + return g_init_x; + case GLUT_INIT_WINDOW_Y: + return g_init_y; + case GLUT_INIT_WINDOW_WIDTH: + return g_init_w; + case GLUT_INIT_WINDOW_HEIGHT: + return g_init_h; + case GLUT_INIT_DISPLAY_MODE: + return g_display_mode; case GLUT_ELAPSED_TIME: if (!timer_installed) { - timer_installed = !timer_installed; + timer_installed = GL_TRUE; LOCKDATA(ticks); LOCKFUNC(ticks_timer); pc_install_int(ticks_timer, NULL, FREQUENCY); } return ticks*1000/FREQUENCY; default: - return 0; + return -1; } } + int APIENTRY glutDeviceGet (GLenum type) { - return 0; + switch (type) { + case GLUT_HAS_KEYBOARD: + return GL_TRUE; + case GLUT_HAS_MOUSE: + return (g_mouse != 0); + case GLUT_NUM_MOUSE_BUTTONS: + return g_mouse; + case GLUT_HAS_SPACEBALL: + case GLUT_HAS_DIAL_AND_BUTTON_BOX: + case GLUT_HAS_TABLET: + return GL_FALSE; + case GLUT_NUM_SPACEBALL_BUTTONS: + case GLUT_NUM_BUTTON_BOX_BUTTONS: + case GLUT_NUM_DIALS: + case GLUT_NUM_TABLET_BUTTONS: + return 0; + default: + return -1; + } +} + + + +int APIENTRY glutGetModifiers (void) +{ + int mod = 0; + int shifts = pc_keyshifts(); + + if (shifts & (KB_SHIFT_FLAG | KB_CAPSLOCK_FLAG)) { + mod |= GLUT_ACTIVE_SHIFT; + } + + if (shifts & KB_ALT_FLAG) { + mod |= GLUT_ACTIVE_ALT; + } + + if (shifts & KB_CTRL_FLAG) { + mod |= GLUT_ACTIVE_CTRL; + } + + return mod; } diff --git a/src/glut/dos/window.c b/src/glut/dos/window.c index cce1a1f7779..a7a7d9ca59b 100644 --- a/src/glut/dos/window.c +++ b/src/glut/dos/window.c @@ -27,17 +27,16 @@ */ -#include "GL/glut.h" +#include "glutint.h" #include "GL/dmesa.h" -#include "internal.h" -static int window; +GLUTwindow *g_curwin; static DMesaVisual visual = NULL; static DMesaContext context = NULL; -static DMesaBuffer buffer[MAX_WINDOWS]; +static GLUTwindow *windows[MAX_WINDOWS]; @@ -45,8 +44,8 @@ static void clean (void) { int i; - for (i=0; inum = ++i; + w->xpos = g_init_x; + w->ypos = g_init_y; + w->width = m8width; + w->height = g_init_h; + w->buffer = b; + + return i; } } @@ -106,73 +119,88 @@ int APIENTRY glutCreateWindow (const char *title) } + int APIENTRY glutCreateSubWindow (int win, int x, int y, int width, int height) { return GL_FALSE; } + void APIENTRY glutDestroyWindow (int win) { - if (buffer[win-1]) { - DMesaDestroyBuffer(buffer[win-1]); - buffer[win-1] = NULL; + if (windows[--win]) { + DMesaDestroyBuffer(windows[win]->buffer); + free(windows[win]); + windows[win] = NULL; } } + void APIENTRY glutPostRedisplay (void) { g_redisplay = GL_TRUE; } + void APIENTRY glutSwapBuffers (void) { - if (g_mouse) pc_scare_mouse(); - DMesaSwapBuffers(buffer[window]); - if (g_mouse) pc_unscare_mouse(); + if (g_curwin->show_mouse) { + /* XXX scare mouse */ + DMesaSwapBuffers(g_curwin->buffer); + /* XXX unscare mouse */ + } else { + DMesaSwapBuffers(g_curwin->buffer); + } } + int APIENTRY glutGetWindow (void) { - return window + 1; + return g_curwin->num; } + void APIENTRY glutSetWindow (int win) { - window = win - 1; + g_curwin = windows[win - 1]; } + void APIENTRY glutSetWindowTitle (const char *title) { } + void APIENTRY glutSetIconTitle (const char *title) { } + void APIENTRY glutPositionWindow (int x, int y) { - if (DMesaViewport(buffer[window], x, y, g_width, g_height)) { - g_xpos = x; - g_ypos = y; + if (DMesaMoveBuffer(x, y)) { + g_curwin->xpos = x; + g_curwin->ypos = y; } } + void APIENTRY glutReshapeWindow (int width, int height) -{ - if (DMesaViewport(buffer[window], g_xpos, g_ypos, width, height)) { - g_width = width; - g_height = height; - if (reshape_func) { - reshape_func(width, height); +{ + if (DMesaResizeBuffer(width, height)) { + g_curwin->width = width; + g_curwin->height = height; + if (g_curwin->reshape) { + g_curwin->reshape(width, height); } else { glViewport(0, 0, width, height); } @@ -180,26 +208,37 @@ void APIENTRY glutReshapeWindow (int width, int height) } + +void APIENTRY glutFullScreen (void) +{ +} + + + void APIENTRY glutPopWindow (void) { } + void APIENTRY glutPushWindow (void) { } + void APIENTRY glutIconifyWindow (void) { } + void APIENTRY glutShowWindow (void) { } + void APIENTRY glutHideWindow (void) { } diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index 4541559e2ca..ec9f3b22242 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -356,7 +356,7 @@ static void read_index_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, offset = c->Buffer->width * FLIP(y) + x; /* read all pixels */ for (i=0; iDriverCtx)->Buffer; - if ((new_window=vl_sync_buffer(b->the_window, xpos, ypos, width, height)) == NULL) { + if (vl_sync_buffer(&b->the_window, xpos, ypos, b->width, b->height) != 0) { return GL_FALSE; } else { - b->the_window = new_window; b->xpos = xpos; b->ypos = ypos; + return GL_TRUE; + } + +#else + + return GL_FALSE; +#endif +} + + + +GLboolean DMesaResizeBuffer (GLint width, GLint height) +{ +#ifndef FX + GET_CURRENT_CONTEXT(ctx); + DMesaBuffer b = ((DMesaContext)ctx->DriverCtx)->Buffer; + + if (vl_sync_buffer(&b->the_window, b->xpos, b->ypos, width, height) != 0) { + return GL_FALSE; + } else { b->width = width; b->height = height; return GL_TRUE; @@ -1107,7 +1125,7 @@ GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b) { #ifndef FX if ((c != NULL) && (b != NULL)) { - if (!DMesaViewport(b, b->xpos, b->ypos, b->width, b->height)) { + if (vl_sync_buffer(&b->the_window, b->xpos, b->ypos, b->width, b->height) != 0) { return GL_FALSE; } @@ -1153,3 +1171,46 @@ void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue) vl_setCI(ndx, red, green, blue); #endif } + + + +void DMesaGetIntegerv (GLenum pname, GLint *params) +{ +#ifndef FX + GET_CURRENT_CONTEXT(ctx); + const DMesaContext c = (ctx == NULL) ? NULL : (DMesaContext)ctx->DriverCtx; +#else + const fxMesaContext c = fxMesaGetCurrentContext(); +#endif + + if (c == NULL) { + return; + } + + switch (pname) { + case DMESA_Y_ORIGIN: + #ifndef FX + params[0] = GL_FALSE; + #else + params[0] = GL_TRUE; + #endif + break; + case DMESA_SCREEN_SIZE: + #ifndef FX + vl_get_screen_size(¶ms[0], ¶ms[1]); + #else + params[0] = c->screen_width; + params[1] = c->screen_height; + #endif + break; + case DMESA_ARGB_ORDER: + #ifndef FX + params[0] = GL_FALSE; + #else + params[0] = !c->bgrOrder; + #endif + break; + default: + break; + } +} diff --git a/src/mesa/drivers/dos/vesa/vesa.c b/src/mesa/drivers/dos/vesa/vesa.c index 26c474317fe..1f3de844d7d 100644 --- a/src/mesa/drivers/dos/vesa/vesa.c +++ b/src/mesa/drivers/dos/vesa/vesa.c @@ -32,6 +32,7 @@ #include +#include #include #include #include @@ -454,22 +455,23 @@ static void vesa_restore (void) * In : color index, R, G, B * Out : - * - * Note: uses normalized values + * Note: uses integer values */ -static void vesa_setCI_f (int index, float red, float green, float blue) +static void vesa_setCI_i (int index, int red, int green, int blue) { - float max = (1 << vesa_color_precision) - 1; - - int _red = red * max; - int _green = green * max; - int _blue = blue * max; - +#if 0 __asm("\n\ movw $0x1010, %%ax \n\ movb %1, %%dh \n\ movb %2, %%ch \n\ int $0x10 \n\ -"::"b"(index), "m"(_red), "m"(_green), "c"(_blue):"%eax", "%edx"); + "::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); +#else + outportb(0x03C8, index); + outportb(0x03C9, red); + outportb(0x03C9, green); + outportb(0x03C9, blue); +#endif } @@ -479,16 +481,13 @@ static void vesa_setCI_f (int index, float red, float green, float blue) * In : color index, R, G, B * Out : - * - * Note: uses integer values + * Note: uses normalized values */ -static void vesa_setCI_i (int index, int red, int green, int blue) +static void vesa_setCI_f (int index, float red, float green, float blue) { - __asm("\n\ - movw $0x1010, %%ax \n\ - movb %1, %%dh \n\ - movb %2, %%ch \n\ - int $0x10 \n\ -"::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); + float max = (1 << vesa_color_precision) - 1; + + vesa_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); } diff --git a/src/mesa/drivers/dos/vga/vga.c b/src/mesa/drivers/dos/vga/vga.c index 1888d989475..d1d2db51b5e 100644 --- a/src/mesa/drivers/dos/vga/vga.c +++ b/src/mesa/drivers/dos/vga/vga.c @@ -31,6 +31,7 @@ */ +#include #include #include "vga.h" @@ -158,22 +159,23 @@ static void vga_restore (void) * In : color index, R, G, B * Out : - * - * Note: uses normalized values + * Note: uses integer values */ -static void vga_setCI_f (int index, float red, float green, float blue) +static void vga_setCI_i (int index, int red, int green, int blue) { - float max = (1 << vga_color_precision) - 1; - - int _red = red * max; - int _green = green * max; - int _blue = blue * max; - +#if 0 __asm("\n\ movw $0x1010, %%ax \n\ movb %1, %%dh \n\ movb %2, %%ch \n\ int $0x10 \n\ - "::"b"(index), "m"(_red), "m"(_green), "c"(_blue):"%eax", "%edx"); + "::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); +#else + outportb(0x03C8, index); + outportb(0x03C9, red); + outportb(0x03C9, green); + outportb(0x03C9, blue); +#endif } @@ -183,16 +185,13 @@ static void vga_setCI_f (int index, float red, float green, float blue) * In : color index, R, G, B * Out : - * - * Note: uses integer values + * Note: uses normalized values */ -static void vga_setCI_i (int index, int red, int green, int blue) +static void vga_setCI_f (int index, float red, float green, float blue) { - __asm("\n\ - movw $0x1010, %%ax \n\ - movb %1, %%dh \n\ - movb %2, %%ch \n\ - int $0x10 \n\ -"::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); + float max = (1 << vga_color_precision) - 1; + + vga_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); } diff --git a/src/mesa/drivers/dos/video.c b/src/mesa/drivers/dos/video.c index 5f4d9d5bedb..aba99ac5428 100644 --- a/src/mesa/drivers/dos/video.c +++ b/src/mesa/drivers/dos/video.c @@ -45,6 +45,7 @@ static vl_driver *drv; /* based upon mode specific data: valid entire session */ int vl_video_selector; +static vl_mode *video_mode; static int video_scanlen, video_bypp; /* valid until next buffer */ void *vl_current_draw_buffer, *vl_current_read_buffer; @@ -93,6 +94,7 @@ int (*vl_mixfix) (fixed r, fixed g, fixed b); int (*vl_mixrgb) (const unsigned char rgb[]); int (*vl_mixrgba) (const unsigned char rgba[]); void (*vl_getrgba) (unsigned int offset, unsigned char rgba[4]); +int (*vl_getpixel) (unsigned int offset); void (*vl_clear) (int color); void (*vl_rect) (int x, int y, int width, int height, int color); void (*vl_flip) (void); @@ -243,30 +245,43 @@ static void v_getrgba32 (unsigned int offset, unsigned char rgba[4]) -/* Desc: set one palette entry +/* Desc: pixel retrieval * - * In : index, R, G, B - * Out : - + * In : pixel offset + * Out : pixel value * - * Note: color components are in range [0.0 .. 1.0] + * Note: uses current read buffer */ -void vl_setCI (int index, float red, float green, float blue) +static int v_getpixel8 (unsigned int offset) { - drv->setCI_f(index, red, green, blue); + return ((word8 *)vl_current_read_buffer)[offset]; +} +#define v_getpixel15 v_getpixel16 +static int v_getpixel16 (unsigned int offset) +{ + return ((word16 *)vl_current_read_buffer)[offset]; +} +static int v_getpixel24 (unsigned int offset) +{ + return *(word32 *)((long)vl_current_read_buffer+offset*3); +} +static int v_getpixel32 (unsigned int offset) +{ + return ((word32 *)vl_current_read_buffer)[offset]; } -/* Desc: read pixel from 8bit buffer +/* Desc: set one palette entry * - * In : pixel offset - * Out : pixel read + * In : index, R, G, B + * Out : - * - * Note: used only for CI modes + * Note: color components are in range [0.0 .. 1.0] */ -int vl_getCIpixel (unsigned int offset) +void vl_setCI (int index, float red, float green, float blue) { - return ((word8 *)vl_current_read_buffer)[offset]; + drv->setCI_f(index, red, green, blue); } @@ -276,7 +291,7 @@ int vl_getCIpixel (unsigned int offset) * In : color, R, G, B * Out : - * - * Note: color components are in range [0 .. 63] + * Note: - */ static void fake_setcolor (int c, int r, int g, int b) { @@ -326,33 +341,56 @@ static void fake_buildpalette (int bits) /* Desc: sync buffer with video hardware * - * In : old buffer, position, size - * Out : new buffer + * In : ptr to old buffer, position, size + * Out : 0 if success * * Note: - */ -void *vl_sync_buffer (void *buffer, int x, int y, int width, int height) +int vl_sync_buffer (void **buffer, int x, int y, int width, int height) { - void *newbuf; - - if (width&7) { - return NULL; + if ((width & 7) || (x < 0) || (y < 0) || (x+width > video_mode->xres) || (y+height > video_mode->yres)) { + return -1; } else { - if ((newbuf=realloc(buffer, width * height * video_bypp)) != NULL) { - vl_current_width = width; - vl_current_height = height; - vl_current_stride = vl_current_width * video_bypp; - vl_current_bytes = vl_current_stride * height; - - vl_current_offset = video_scanlen * y + video_bypp * x; - vl_current_delta = video_scanlen - vl_current_stride; + void *newbuf = *buffer; + + if ((newbuf == NULL) || (vl_current_width != width) || (vl_current_height != height)) { + newbuf = realloc(newbuf, width * height * video_bypp); } - return vl_current_draw_buffer = vl_current_read_buffer = newbuf; + + if (newbuf == NULL) { + return -2; + } + + vl_current_width = width; + vl_current_height = height; + vl_current_stride = vl_current_width * video_bypp; + vl_current_bytes = vl_current_stride * height; + + vl_current_offset = video_scanlen * y + video_bypp * x; + vl_current_delta = video_scanlen - vl_current_stride; + + vl_current_draw_buffer = vl_current_read_buffer = *buffer = newbuf; + return 0; } } +/* Desc: get screen geometry + * + * In : ptr to WIDTH, ptr to HEIGHT + * Out : - + * + * Note: - + */ +void vl_get_screen_size (int *width, int *height) +{ + *width = video_mode->xres; + *height = video_mode->yres; +} + + + /* Desc: retrieve CPU MMX capability * * In : - @@ -364,8 +402,7 @@ int vl_can_mmx (void) { #ifdef USE_MMX_ASM extern int _mesa_identify_x86_cpu_features (void); - int _mesa_x86_cpu_features = _mesa_identify_x86_cpu_features(); - return (_mesa_x86_cpu_features & 0x00800000); + return (_mesa_identify_x86_cpu_features() & 0x00800000); #else return 0; #endif @@ -382,9 +419,14 @@ int vl_can_mmx (void) */ static int vl_setup_mode (vl_mode *p) { + if (p == NULL) { + return -1; + } + #define INITPTR(bpp) \ vl_putpixel = v_putpixel##bpp; \ vl_getrgba = v_getrgba##bpp; \ + vl_getpixel = v_getpixel##bpp; \ vl_rect = v_rect##bpp; \ vl_mixfix = vl_mixfix##bpp; \ vl_mixrgb = vl_mixrgb##bpp; \ @@ -413,6 +455,7 @@ static int vl_setup_mode (vl_mode *p) #undef INITPTR + video_mode = p; video_bypp = (p->bpp+7)/8; video_scanlen = p->scanlen; vl_video_selector = p->sel; @@ -476,8 +519,8 @@ int vl_video_init (int width, int height, int bpp, int rgb, int refresh) } } - /* check, setup and enter mode */ - if ((p!=NULL) && (vl_setup_mode(p) == 0) && (drv->entermode(p, refresh) == 0)) { + /* setup and enter mode */ + if ((vl_setup_mode(p) == 0) && (drv->entermode(p, refresh) == 0)) { vl_flip = drv->blit; if (fake) { min = drv->getCIprec(); diff --git a/src/mesa/drivers/dos/video.h b/src/mesa/drivers/dos/video.h index 3197338e632..8dfb9a91766 100644 --- a/src/mesa/drivers/dos/video.h +++ b/src/mesa/drivers/dos/video.h @@ -45,11 +45,12 @@ extern void (*vl_clear) (int color); extern void (*vl_rect) (int x, int y, int width, int height, int color); extern void (*vl_flip) (void); extern void (*vl_putpixel) (unsigned int offset, int color); +extern int (*vl_getpixel) (unsigned int offset); void vl_setCI (int index, float red, float green, float blue); -int vl_getCIpixel (unsigned int offset); -void *vl_sync_buffer (void *buffer, int x, int y, int width, int height); +int vl_sync_buffer (void **buffer, int x, int y, int width, int height); +void vl_get_screen_size (int *width, int *height); void vl_video_exit (void); int vl_video_init (int width, int height, int bpp, int rgb, int refresh); diff --git a/src/mesa/drivers/dos/virtual.S b/src/mesa/drivers/dos/virtual.S index 4dbbbb3e3f8..c5a72975feb 100644 --- a/src/mesa/drivers/dos/virtual.S +++ b/src/mesa/drivers/dos/virtual.S @@ -107,13 +107,12 @@ _v_clear_common: .p2align 5,,31 .global _v_clear8_mmx _v_clear8_mmx: - movl 4(%esp), %eax - movb %al, %ah - pushw %ax - pushw %ax - pushw %ax - pushw %ax +#ifdef USE_MMX_ASM + movq 4(%esp), %mm0 + punpcklbw %mm0, %mm0 + punpcklwd %mm0, %mm0 jmp _v_clear_common_mmx +#endif /* Desc: void v_clear16_mmx (int color); * @@ -125,12 +124,11 @@ _v_clear8_mmx: .p2align 5,,31 .global _v_clear16_mmx _v_clear16_mmx: - movl 4(%esp), %eax - pushw %ax - pushw %ax - pushw %ax - pushw %ax +#ifdef USE_MMX_ASM + movq 4(%esp), %mm0 + punpcklwd %mm0, %mm0 jmp _v_clear_common_mmx +#endif /* Desc: void v_clear32_mmx (int color); * @@ -142,15 +140,13 @@ _v_clear16_mmx: .p2align 5,,31 .global _v_clear32_mmx _v_clear32_mmx: - movl 4(%esp), %eax - pushl %eax - pushl %eax +#ifdef USE_MMX_ASM + movq 4(%esp), %mm0 .balign 4 _v_clear_common_mmx: -#ifdef USE_MMX_ASM + punpckldq %mm0, %mm0 movl _vl_current_bytes, %ecx movl _vl_current_draw_buffer, %edx - movq (%esp), %mm0 shrl $3, %ecx .balign 4 0: @@ -160,7 +156,6 @@ _v_clear_common_mmx: jnz 0b emms #endif - addl $8, %esp ret /* Desc: void v_clear24 (int color); diff --git a/src/mesa/main/Makefile.DJ b/src/mesa/main/Makefile.DJ index 9bbbec6bb2a..cabeff10362 100644 --- a/src/mesa/main/Makefile.DJ +++ b/src/mesa/main/Makefile.DJ @@ -1,7 +1,7 @@ # Mesa 3-D graphics library -# Version: 5.1 +# Version: 4.1 # -# Copyright (C) 1999-2003 Brian Paul All Rights Reserved. +# Copyright (C) 1999-2002 Brian Paul All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -20,7 +20,7 @@ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# DOS/DJGPP core makefile v1.3 for Mesa 5.1 +# DOS/DJGPP core makefile v1.3 for Mesa 5.0 # # Copyright (C) 2002 - Borca Daniel # Email : dborca@yahoo.com @@ -33,18 +33,18 @@ # Environment variables: # CFLAGS # -# GLIDE absolute path to Glide SDK; used with FX. +# GLIDE path to Glide3 SDK include files; used with FX. # default = $(TOP)/include/glide3 -# FX=1 build for 3dfx Glide3; use it if you have the glide -# SDK (designed for your platform), and, of course, a -# 3dfx card... Note that this disables compilation of -# actual DMesa code, as Glide does all the stuff! +# FX=1 build for 3dfx Glide3. Note that this disables +# compilation of most DMesa code and requires fxMesa. +# As a consequence, you'll need the DJGPP Glide3 +# library to build any application. # default = no # HAVE_X86=1 optimize for i386. # default = no -# HAVE_MMX=1 MMX instructions; use only if you assembler/compiler -# supports MMX instruction set; backwards compatibility -# with older processors is still preserved. +# HAVE_MMX=1 allow MMX specializations, provided your assembler +# supports MMX instruction set. However, the true CPU +# capabilities are checked at run-time to avoid crashes. # default = no # HAVE_SSE=1 (see HAVE_MMX) # default = no @@ -119,10 +119,6 @@ CORE_SOURCES = \ lines.c \ matrix.c \ mmath.c \ - nvprogram.c \ - nvfragparse.c \ - nvvertexec.c \ - nvvertparse.c \ pixel.c \ points.c \ polygon.c \ @@ -136,6 +132,10 @@ CORE_SOURCES = \ texstate.c \ texstore.c \ texutil.c \ + varray.c \ + vpexec.c \ + vpparse.c \ + vpstate.c \ vtxfmt.c \ math/m_debug_clip.c \ math/m_debug_norm.c \ @@ -166,7 +166,6 @@ CORE_SOURCES = \ swrast/s_lines.c \ swrast/s_logic.c \ swrast/s_masking.c \ - swrast/s_nvfragprog.c \ swrast/s_pixeltex.c \ swrast/s_points.c \ swrast/s_readpix.c \ @@ -297,9 +296,9 @@ ifeq ($(DXE3GEN),) $(warning somewhere in PATH, and DXE3.LD in DJGPP/LIB directory.) else ifdef FX - -dxe3gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) -D "MesaGL/FX DJGPP" -E gl -E DMesa -X -P glid3.dxe -U $(OBJECTS) + -dxe3gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) -D "MesaGL/FX DJGPP" -E _gl -E _DMesa -P glid3.dxe -U $(OBJECTS) else - -dxe3gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) -D "MesaGL DJGPP" -E gl -E DMesa -X -U $(OBJECTS) + -dxe3gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) -D "MesaGL DJGPP" -E _gl -E _DMesa -U $(OBJECTS) endif endif -- cgit v1.2.3 From 615991ac660346edfd2309fcc81baa04bfe1bbec Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Mon, 10 Feb 2003 20:22:08 +0000 Subject: fix fragment_program for Windows --- include/GL/gl.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index e1799523693..b4fc69af39e 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,4 +1,4 @@ -/* $Id: gl.h,v 1.73 2003/01/14 04:50:14 brianp Exp $ */ +/* $Id: gl.h,v 1.74 2003/02/10 20:22:08 alanh Exp $ */ /* * Mesa 3-D graphics library @@ -2658,50 +2658,50 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid #define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 -extern void +GLAPI void GLAPIENTRY glProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -extern void +GLAPI void GLAPIENTRY glProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -extern void +GLAPI void GLAPIENTRY glProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte *name, const float v[]); -extern void +GLAPI void GLAPIENTRY glProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte *name, const double v[]); -extern void +GLAPI void GLAPIENTRY glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); -extern void +GLAPI void GLAPIENTRY glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); -extern void +GLAPI void GLAPIENTRY glProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -extern void +GLAPI void GLAPIENTRY glProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble *params); -extern void +GLAPI void GLAPIENTRY glProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -extern void +GLAPI void GLAPIENTRY glProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat *params); -extern void +GLAPI void GLAPIENTRY glGetProgramLocalParameterdvARB(GLenum target, GLuint index, GLdouble *params); -extern void +GLAPI void GLAPIENTRY glGetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat *params); -- cgit v1.2.3 From 60f84fcc91c5fb86843c528416399303da113a2f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 20 Feb 2003 15:43:52 +0000 Subject: latest DOS updates (Daniel Borca) --- docs/README.DJ | 37 +- include/GL/dmesa.h | 29 +- progs/samples/Makefile.DJ | 10 +- src/glut/dos/glutint.h | 5 +- src/glut/dos/init.c | 13 +- src/glut/dos/mouse.c | 14 +- src/glut/dos/window.c | 18 +- src/mesa/drivers/dos/blit.S | 199 +++++ src/mesa/drivers/dos/dmesa.c | 746 ++++++++++++++--- src/mesa/drivers/dos/dpmi.c | 23 +- src/mesa/drivers/dos/internal.h | 8 +- src/mesa/drivers/dos/mga/m_ttemp.h | 377 +++++++++ src/mesa/drivers/dos/mga/m_ttemp2.h | 375 +++++++++ src/mesa/drivers/dos/mga/mga.c | 1536 +++++++++++++++++++++++++++++++++++ src/mesa/drivers/dos/mga/mga.h | 91 +++ src/mesa/drivers/dos/mga/mga_hw.c | 416 ++++++++++ src/mesa/drivers/dos/mga/mga_hw.h | 113 +++ src/mesa/drivers/dos/mga/mga_mode.c | 231 ++++++ src/mesa/drivers/dos/mga/mga_mode.h | 47 ++ src/mesa/drivers/dos/mga/mga_reg.h | 207 +++++ src/mesa/drivers/dos/vesa.c | 533 ++++++++++++ src/mesa/drivers/dos/vesa.h | 47 ++ src/mesa/drivers/dos/vesa/blit.S | 199 ----- src/mesa/drivers/dos/vesa/vesa.c | 521 ------------ src/mesa/drivers/dos/vesa/vesa.h | 47 -- src/mesa/drivers/dos/vga.c | 235 ++++++ src/mesa/drivers/dos/vga.h | 42 + src/mesa/drivers/dos/vga/vga.c | 225 ----- src/mesa/drivers/dos/vga/vga.h | 42 - src/mesa/drivers/dos/video.c | 66 +- src/mesa/drivers/dos/video.h | 8 +- src/mesa/drivers/dos/virtual.S | 6 +- src/mesa/main/Makefile.DJ | 59 +- 33 files changed, 5242 insertions(+), 1283 deletions(-) create mode 100644 src/mesa/drivers/dos/blit.S create mode 100644 src/mesa/drivers/dos/mga/m_ttemp.h create mode 100644 src/mesa/drivers/dos/mga/m_ttemp2.h create mode 100644 src/mesa/drivers/dos/mga/mga.c create mode 100644 src/mesa/drivers/dos/mga/mga.h create mode 100644 src/mesa/drivers/dos/mga/mga_hw.c create mode 100644 src/mesa/drivers/dos/mga/mga_hw.h create mode 100644 src/mesa/drivers/dos/mga/mga_mode.c create mode 100644 src/mesa/drivers/dos/mga/mga_mode.h create mode 100644 src/mesa/drivers/dos/mga/mga_reg.h create mode 100644 src/mesa/drivers/dos/vesa.c create mode 100644 src/mesa/drivers/dos/vesa.h delete mode 100644 src/mesa/drivers/dos/vesa/blit.S delete mode 100644 src/mesa/drivers/dos/vesa/vesa.c delete mode 100644 src/mesa/drivers/dos/vesa/vesa.h create mode 100644 src/mesa/drivers/dos/vga.c create mode 100644 src/mesa/drivers/dos/vga.h delete mode 100644 src/mesa/drivers/dos/vga/vga.c delete mode 100644 src/mesa/drivers/dos/vga/vga.h (limited to 'include') diff --git a/docs/README.DJ b/docs/README.DJ index 6589f52a2ed..13167611ba0 100644 --- a/docs/README.DJ +++ b/docs/README.DJ @@ -32,8 +32,9 @@ Available options: Environment variables: CPU optimize for the given processor. default = k6 - SGI_GLU=1 build SGI's GLU instead of Mesa's. - default = no + GLU=[src|si] specify GLU directory; can be `src' (src-glu = Mesa) + or `si' (si-glu = SGI's GLU -- requires GNU/C++). + default = src GLIDE path to Glide3 SDK include files; used with FX. default = $(TOP)/include/glide3 FX=1 build for 3dfx Glide3. Note that this disables @@ -41,6 +42,9 @@ Available options: As a consequence, you'll need the DJGPP Glide3 library to build any application. default = no + MATROX=1 build for Matrox Millennium I (MGA2064W) cards. + This is experimental and not intensively tested. + default = no HAVE_X86=1 optimize for i386. default = no HAVE_MMX=1 allow MMX specializations, provided your assembler @@ -81,6 +85,15 @@ FAQ: A) You need LFN support. A) When compiling for Glide (FX=1), pay attention to Glide path. + Q) Libraries built OK, but linker complains about `vsnprintf' every time I + compile some demo. + A) Upgrade to DJGPP 2.04. + A) Add `vsnprintf.c' to the CORE_SOURCES in `src/Makefile.DJ' (untested!). + A) The following hack should be safe in 90% of the cases, but if anything + goes wrong, don't come back to me crying. Anyway, patch `src/imports.c' + with the following line: + #define vsnprintf(buf, max, fmt, arg) vsprintf(buf, fmt, arg) + 2. Dynamic modules Q) What are you mumbling about dynamic modules? @@ -103,9 +116,10 @@ FAQ: 3. Using Mesa for DJGPP Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better... - A) Is that a question? If you have a Voodoo3/Banshee card, you're lucky. The - Glide port is on my web page. If you haven't, sorry; everything is done - in software. Suggestions? + A) Is that a question? If you have a Voodoo3/Banshee card, you're lucky (the + Glide port is on my web page). If you have a Matrox Millennium I card, + you just MIGHT be lucky... If you haven't, sorry; everything is done in + software. Suggestions? Q) I tried to set refresh rate w/ DMesa, but without success. A) Refresh rate control works only for VESA 3.0. If you were compiling for @@ -113,15 +127,12 @@ FAQ: Q) I made a simple application and it does nothing. It exits right away. Not even a blank screen. - A) Only DMesa+FX supports single-buffered. The standard VESA/VGA drivers - will always work in double-buffered modes. If/When I will find a way to - use *REAL* hardware acceleration for a specific card, it might or might - not support single-buffered modes. + A) The pure software drivers (VESA/VGA) support only double-buffered modes. A) Another weird "feature" is that buffer width must be multiple of 8 (I'm a lazy programmer and I found that the easiest way to keep buffer handling at peak performance ;-). - Q) My demo doesn't display text. I know I used the glut font routines! + Q) My demo doesn't display text. I know I used the GLUT font routines! A) Then you probably use GLUT as a DXE. Well, there is no direct access to variables due to the way DXE works. Read the documentation. The author of GLUT took this into account for _WIN32 DLL's only; I don't want to modify @@ -196,15 +207,17 @@ v1.2 (nov-2002) * synced w/ Mesa-4.1 - removed dmesadxe.h -v1.3 (jan-2003) +v1.3 (feb-2003) + enabled OpenGL 1.4 support + added MMX clear/blit routines + enabled SGI's GLU compilation + + added samples makefile + added new GLUT functions + added color-index modes + + added Matrox Millennium MGA2064W driver + added 8bit FakeColor (thanks to Neil Funk) + added VGA support (to keep Ben Decker happy) - * fixed GLUT compilation error (reported by Chan Kar Heng) + ! fixed GLUT compilation error (reported by Chan Kar Heng) * overhauled virtual buffer and internal video drivers * better fxMesa integration * revamped GLUT diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h index 16f6bff88c1..2c0ef81abe2 100644 --- a/include/GL/dmesa.h +++ b/include/GL/dmesa.h @@ -87,6 +87,11 @@ DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share); */ void DMesaDestroyContext (DMesaContext c); +/* + * Return a handle to the current context. + */ +DMesaContext DMesaGetCurrentContext (void); + /* @@ -101,21 +106,17 @@ DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, */ void DMesaDestroyBuffer (DMesaBuffer b); - - -/* - * Bind Buffer to Context and make the Context the current one. - */ -GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b); - - - /* * Swap the front and back buffers for the given Buffer. * No action is taken if the buffer is not double buffered. */ void DMesaSwapBuffers (DMesaBuffer b); +/* + * Bind Buffer to Context and make the Context the current one. + */ +GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b); + /* @@ -132,10 +133,12 @@ void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue); /* * DMesa state retrieval. */ -#define DMESA_Y_ORIGIN 0x0100 -#define DMESA_SCREEN_SIZE 0x0101 -#define DMESA_ARGB_ORDER 0x0200 -void DMesaGetIntegerv (GLenum pname, GLint *params); +#define DMESA_GET_SCREEN_SIZE 0x0100 +#define DMESA_GET_DRIVER_CAPS 0x0200 + +#define DMESA_DRIVER_SWDB_BIT 0x1 /* software double-buffered */ +#define DMESA_DRIVER_LLWO_BIT 0x2 /* lower-left window origin */ +int DMesaGetIntegerv (GLenum pname, GLint *params); #ifdef __cplusplus } diff --git a/progs/samples/Makefile.DJ b/progs/samples/Makefile.DJ index b5724f432a0..3d679ebe7c6 100644 --- a/progs/samples/Makefile.DJ +++ b/progs/samples/Makefile.DJ @@ -65,16 +65,12 @@ CFLAGS += -I$(TOP)/include LDFLAGS = -s -L$(TOP)/lib -ifdef DXE +ifeq ($(DXE),1) DMESADXE = $(TOP)/lib/dmesadxe.o -LDLIBS += -liglut -liglu -ligl -ifdef FX -LDFLAGS += -L$(GLIDE) -endif -LDLIBS += -ldl +LDLIBS += -liglut -liglu -ligl -ldl else LDLIBS = -lglut -lglu -lgl -ifdef FX +ifeq ($(FX),1) LDFLAGS += -L$(GLIDE) LDLIBS += -lglid3 endif diff --git a/src/glut/dos/glutint.h b/src/glut/dos/glutint.h index 77a8322c442..bbabf0fdb2c 100644 --- a/src/glut/dos/glutint.h +++ b/src/glut/dos/glutint.h @@ -105,6 +105,9 @@ extern GLboolean g_redisplay; extern GLuint g_bpp; /* HW: bits per pixel */ extern GLuint g_refresh; /* HW: vertical refresh rate */ extern GLuint g_screen_w, g_screen_h; /* HW: physical screen size */ +extern GLint g_driver_caps; + +extern GLuint g_fps; extern GLuint g_display_mode; /* display bits */ extern int g_init_x, g_init_y; /* initial window position */ @@ -132,7 +135,7 @@ extern void __glutFatalUsage(char *format,...); -#define MAX_WINDOWS 2 +#define MAX_WINDOWS 2 #define DEFAULT_WIDTH 300 #define DEFAULT_HEIGHT 300 diff --git a/src/glut/dos/init.c b/src/glut/dos/init.c index 0f848f6f360..6c034ff5e2b 100644 --- a/src/glut/dos/init.c +++ b/src/glut/dos/init.c @@ -38,6 +38,9 @@ GLboolean g_redisplay = GL_FALSE; GLuint g_bpp = DEFAULT_BPP; GLuint g_refresh = 0; GLuint g_screen_w, g_screen_h; +GLint g_driver_caps; + +GLuint g_fps = 0; GLuint g_display_mode = 0; int g_init_x = 0, g_init_y = 0; @@ -68,6 +71,13 @@ void APIENTRY glutInit (int *argc, char **argv) } __glutProgramName = __glutStrdup(str); + /* check if GLUT_FPS env var is set */ + if ((env = getenv("GLUT_FPS")) != NULL) { + if ((g_fps = atoi(env)) <= 0) { + g_fps = 5000; /* 5000 milliseconds */ + } + } + /* Initialize timer */ glutGet(GLUT_ELAPSED_TIME); } @@ -106,9 +116,10 @@ void APIENTRY glutMainLoop (void) { GLint screen_size[2]; - DMesaGetIntegerv(DMESA_SCREEN_SIZE, screen_size); + DMesaGetIntegerv(DMESA_GET_SCREEN_SIZE, screen_size); g_screen_w = screen_size[0]; g_screen_h = screen_size[1]; + DMesaGetIntegerv(DMESA_GET_DRIVER_CAPS, &g_driver_caps); } pc_install_keyb(); diff --git a/src/glut/dos/mouse.c b/src/glut/dos/mouse.c index c67f8093b14..d82f5e8a8c8 100644 --- a/src/glut/dos/mouse.c +++ b/src/glut/dos/mouse.c @@ -39,19 +39,7 @@ int g_mouse_x = 0, g_mouse_y = 0; void __glutInitMouse (void) { if ((g_mouse = pc_install_mouse())) { - GLint yorg; - GLint rect[4]; - - DMesaGetIntegerv(DMESA_Y_ORIGIN, &yorg); - if (yorg) { - rect[1] = g_screen_h - g_curwin->height; - } else { - rect[1] = g_curwin->ypos; - } - rect[0] = g_curwin->xpos; - rect[2] = rect[0] + g_curwin->width - 1; - rect[3] = rect[1] + g_curwin->height - 1; - pc_mouse_area(rect[0], rect[1], rect[2], rect[3]); + pc_mouse_area(g_curwin->xpos, g_curwin->ypos, g_curwin->xpos + g_curwin->width - 1, g_curwin->ypos + g_curwin->height - 1); g_curwin->show_mouse = (g_curwin->mouse || g_curwin->motion || g_curwin->passive); } diff --git a/src/glut/dos/window.c b/src/glut/dos/window.c index a7a7d9ca59b..cad4726936f 100644 --- a/src/glut/dos/window.c +++ b/src/glut/dos/window.c @@ -27,12 +27,15 @@ */ +#include + #include "glutint.h" #include "GL/dmesa.h" GLUTwindow *g_curwin; +static GLuint swaptime, swapcount; static DMesaVisual visual = NULL; static DMesaContext context = NULL; @@ -59,7 +62,6 @@ static void clean (void) int APIENTRY glutCreateWindow (const char *title) { int i; - GLint screen_size[2]; int m8width = (g_init_w + 7) & ~7; if (!visual) { @@ -154,6 +156,20 @@ void APIENTRY glutSwapBuffers (void) } else { DMesaSwapBuffers(g_curwin->buffer); } + + if (g_fps) { + GLint t = glutGet(GLUT_ELAPSED_TIME); + swapcount++; + if (swaptime == 0) + swaptime = t; + else if (t - swaptime > g_fps) { + double time = 0.001 * (t - swaptime); + double fps = (double)swapcount / time; + fprintf(stderr, "GLUT: %d frames in %.2f seconds = %.2f FPS\n", swapcount, time, fps); + swaptime = t; + swapcount = 0; + } + } } diff --git a/src/mesa/drivers/dos/blit.S b/src/mesa/drivers/dos/blit.S new file mode 100644 index 00000000000..3598614c9f1 --- /dev/null +++ b/src/mesa/drivers/dos/blit.S @@ -0,0 +1,199 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + + .file "blit.S" + +/* + * extern unsigned int vesa_gran_mask, vesa_gran_shift; + * extern int vl_video_selector; + + * extern void *vl_current_draw_buffer; + * extern int vl_current_stride, vl_current_height; + * extern int vl_current_offset, vl_current_delta; + */ + + .text + +/* Desc: VESA bank switching routine (BIOS) + * + * In : EBX=0, EDX = bank number + * Out : - + * + * Note: thrashes EAX + */ + .p2align 5,,31 +_vesa_swbankBIOS: + movw $0x4f05, %ax + int $0x10 + ret + + .p2align 2,,3 + .global _vesa_swbank +_vesa_swbank: .long _vesa_swbankBIOS + +/* Desc: void vesa_b_dump_virtual (void); + * + * In : - + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _vesa_b_dump_virtual +_vesa_b_dump_virtual: + cld + pushl %es + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %es + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + movl _vl_current_delta, %ebx + shrl $2, %ecx + .balign 4 + 0: + pushl %ecx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + pushl %eax + pushl %ebx + incl %edx + xorl %ebx, %ebx + call *_vesa_swbank + popl %ebx + popl %eax + subl %ebp, %edi + .balign 4 + 2: + movsl + decl %ecx + jnz 1b + popl %ecx + addl %ebx, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + popl %es + ret + +/* Desc: void vesa_l_dump_virtual (void); + * + * In : - + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _vesa_l_dump_virtual +_vesa_l_dump_virtual: + cld + pushl %es + pushl %esi + pushl %edi + movl _vl_video_selector, %es + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %eax + shrl $2, %ecx + .balign 4 + 0: + pushl %ecx + rep; movsl + popl %ecx + addl %eax, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %es + ret + +/* Desc: void vesa_l_dump_virtual_mmx (void); + * + * In : - + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _vesa_l_dump_virtual_mmx +_vesa_l_dump_virtual_mmx: +#ifdef USE_MMX_ASM + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %eax + shrl $3, %ecx + .balign 4 + 0: + pushl %ecx + .balign 4 + 1: + movq (%esi), %mm0 + addl $8, %esi + movq %mm0, %fs:(%edi) + addl $8, %edi + decl %ecx + jnz 1b + popl %ecx + addl %eax, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + emms +#endif + ret diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index ec9f3b22242..a72973832a4 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -54,14 +54,22 @@ #include "tnl/t_context.h" #include "tnl/t_pipeline.h" +#ifndef MATROX + #include "video.h" -#else +#else /* MATROX */ + +#include "mga/mga.h" + +#endif /* MATROX */ + +#else /* FX */ #include "../FX/fxdrv.h" #include "GL/dmesa.h" -#endif +#endif /* FX */ @@ -74,6 +82,10 @@ struct dmesa_visual { GLboolean db_flag; /* double buffered? */ GLboolean rgb_flag; /* RGB mode? */ GLuint depth; /* bits per pixel (1, 8, 24, etc) */ +#ifdef MATROX + int stride_in_pixels; +#endif + int zbuffer; /* Z=buffer: 0=no, 1=SW, -1=HW */ }; /* @@ -107,8 +119,21 @@ struct dmesa_context { /**************************************************************************** * Read/Write pixels ***************************************************************************/ -#define FLIP(y) (c->Buffer->height - (y) - 1) -#define FLIP2(y) (b - (y)) +#define FLIP(y) (dmesa->Buffer->height - (y) - 1) +#define FLIP2(y) (_b_ - (y)) + + +#ifndef MATROX +#define DSTRIDE dmesa->Buffer->width +#else +#define DSTRIDE dmesa->visual->stride_in_pixels +#define vl_putpixel mga_putpixel +#define vl_mixrgba mga_mixrgb +#define vl_mixrgb mga_mixrgb +#define vl_getrgba mga_getrgba +#define vl_setz mga_setz +#define vl_getz mga_getz +#endif /**************************************************************************** * RGB[A] @@ -116,10 +141,11 @@ struct dmesa_context { static void write_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[]) { - const DMesaContext c = (DMesaContext)ctx->DriverCtx; + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; GLuint i, offset; - offset = c->Buffer->width * FLIP(y) + x; +#ifndef MATROX + offset = DSTRIDE * FLIP(y) + x; if (mask) { /* draw some pixels */ for (i=0; iDriverCtx; + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; GLuint i, offset; - offset = c->Buffer->width * FLIP(y) + x; + offset = DSTRIDE * FLIP(y) + x; if (mask) { /* draw some pixels */ for (i=0; iDriverCtx; + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; GLuint i, offset, rgba = vl_mixrgba(color); - offset = c->Buffer->width * FLIP(y) + x; + offset = DSTRIDE * FLIP(y) + x; if (mask) { /* draw some pixels */ for (i=0; iDriverCtx; + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; GLuint i, offset; - offset = c->Buffer->width * FLIP(y) + x; + offset = DSTRIDE * FLIP(y) + x; /* read all pixels */ for (i=0; iDriverCtx; - GLuint i, w = c->Buffer->width, b = c->Buffer->height - 1; + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; + GLuint i, _w_ = DSTRIDE, _b_ = dmesa->Buffer->height - 1; if (mask) { /* draw some pixels */ for (i=0; iDriverCtx; - GLuint i, w = c->Buffer->width, b = c->Buffer->height - 1, rgba = vl_mixrgba(color); + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; + GLuint i, _w_ = DSTRIDE, _b_ = dmesa->Buffer->height - 1, rgba = vl_mixrgba(color); if (mask) { /* draw some pixels */ for (i=0; iDriverCtx; - GLuint i, w = c->Buffer->width, b = c->Buffer->height - 1; + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; + GLuint i, _w_ = DSTRIDE, _b_ = dmesa->Buffer->height - 1; if (mask) { /* read some pixels */ for (i=0; iDriverCtx; + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; GLuint i, offset; - offset = c->Buffer->width * FLIP(y) + x; + offset = DSTRIDE * FLIP(y) + x; if (mask) { /* draw some pixels */ for (i=0; iDriverCtx; + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; GLuint i, offset; - offset = c->Buffer->width * FLIP(y) + x; + offset = DSTRIDE * FLIP(y) + x; if (mask) { /* draw some pixels */ for (i=0; iDriverCtx; + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; GLuint i, offset; - offset = c->Buffer->width * FLIP(y) + x; + offset = DSTRIDE * FLIP(y) + x; if (mask) { /* draw some pixels */ for (i=0; iDriverCtx; + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; GLuint i, offset; - offset = c->Buffer->width * FLIP(y) + x; + offset = DSTRIDE * FLIP(y) + x; /* read all pixels */ for (i=0; iDriverCtx; - GLuint i, w = c->Buffer->width, b = c->Buffer->height - 1; + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; + GLuint i, _w_ = DSTRIDE, _b_ = dmesa->Buffer->height - 1; if (mask) { /* draw some pixels */ for (i=0; iDriverCtx; - GLuint i, w = c->Buffer->width, b = c->Buffer->height - 1; + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; + GLuint i, _w_ = DSTRIDE, _b_ = dmesa->Buffer->height - 1; if (mask) { /* draw some pixels */ for (i=0; iDriverCtx; - GLuint i, w = c->Buffer->width, b = c->Buffer->height - 1; + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; + GLuint i, _w_ = DSTRIDE, _b_ = dmesa->Buffer->height - 1; if (mask) { /* read some pixels */ for (i=0; iDriverCtx; + GLuint i, offset; + + offset = DSTRIDE * FLIP(y) + x; + if (mask) { + /* draw some values */ + for (i=0; iDriverCtx; + GLuint i, offset; + + offset = DSTRIDE * FLIP(y) + x; + /* read all values */ + for (i=0; iDriverCtx; + GLuint i, _w_ = DSTRIDE, _b_ = dmesa->Buffer->height - 1; + + if (mask) { + /* draw some values */ + for (i=0; iDriverCtx; + GLuint i, _w_ = DSTRIDE, _b_ = dmesa->Buffer->height - 1; + + /* read all values */ + for (i=0; iDriverCtx; - GLuint w = c->Buffer->width, b = c->Buffer->height - 1; + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; + GLuint _b_ = dmesa->Buffer->height - 1; +#ifndef MATROX + GLuint _w_ = dmesa->Buffer->width; #define SETUP_CODE GLuint rgb = vl_mixrgb(v2->color); -#define RENDER_SPAN(span) \ - GLuint i, offset = FLIP2(span.y)*w + span.x; \ - for (i = 0; i < span.end; i++, offset++) { \ - vl_putpixel(offset, rgb); \ +#define RENDER_SPAN(span) \ + GLuint i, offset = FLIP2(span.y)*_w_ + span.x; \ + for (i = 0; i < span.end; i++, offset++) { \ + vl_putpixel(offset, rgb); \ } #include "swrast/s_tritemp.h" +#else /* MATROX */ + MGAvertex m0, m1, m2; + m0.win[0] = v0->win[0]; + m0.win[1] = FLIP2(v0->win[1]); + m1.win[0] = v1->win[0]; + m1.win[1] = FLIP2(v1->win[1]); + m2.win[0] = v2->win[0]; + m2.win[1] = FLIP2(v2->win[1]); + *(unsigned long *)m2.color = *(unsigned long *)v2->color; + mga_draw_tri_rgb_flat((int)SWRAST_CONTEXT(ctx)->_backface_sign, &m0, &m1, &m2); +#endif /* MATROX */ } /* - * flat, depth-buffered, triangle. + * Z-less flat triangle. */ -static void tri_rgb_flat_z (GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2) +static void tri_rgb_flat_zless (GLcontext *ctx, + const SWvertex *v0, + const SWvertex *v1, + const SWvertex *v2) { - const DMesaContext c = (DMesaContext)ctx->DriverCtx; - GLuint w = c->Buffer->width, b = c->Buffer->height - 1; + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; + GLuint _b_ = dmesa->Buffer->height - 1; +#ifndef MATROX + GLuint _w_ = dmesa->Buffer->width; #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define SETUP_CODE GLuint rgb = vl_mixrgb(v2->color); -#define RENDER_SPAN(span) \ - GLuint i, offset = FLIP2(span.y)*w + span.x; \ - for (i = 0; i < span.end; i++, offset++) { \ - const DEPTH_TYPE z = FixedToDepth(span.z); \ - if (z < zRow[i]) { \ - vl_putpixel(offset, rgb); \ - zRow[i] = z; \ - } \ - span.z += span.zStep; \ +#define RENDER_SPAN(span) \ + GLuint i, offset = FLIP2(span.y)*_w_ + span.x; \ + for (i = 0; i < span.end; i++, offset++) { \ + const DEPTH_TYPE z = FixedToDepth(span.z); \ + if (z < zRow[i]) { \ + vl_putpixel(offset, rgb); \ + zRow[i] = z; \ + } \ + span.z += span.zStep; \ } #include "swrast/s_tritemp.h" +#else /* MATROX */ + MGAvertex m0, m1, m2; + m0.win[0] = v0->win[0]; + m0.win[1] = FLIP2(v0->win[1]); + m0.win[2] = v0->win[2]; + m1.win[0] = v1->win[0]; + m1.win[1] = FLIP2(v1->win[1]); + m1.win[2] = v1->win[2]; + m2.win[0] = v2->win[0]; + m2.win[1] = FLIP2(v2->win[1]); + m2.win[2] = v2->win[2]; + *(unsigned long *)m2.color = *(unsigned long *)v2->color; + mga_draw_tri_rgb_flat_zless((int)SWRAST_CONTEXT(ctx)->_backface_sign, &m0, &m1, &m2); +#endif /* MATROX */ } /* - * smooth, NON-depth-buffered, triangle. + * NON-depth-buffered iterated triangle. */ -static void tri_rgb_smooth (GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2) +static void tri_rgb_iter (GLcontext *ctx, + const SWvertex *v0, + const SWvertex *v1, + const SWvertex *v2) { - const DMesaContext c = (DMesaContext)ctx->DriverCtx; - GLuint w = c->Buffer->width, b = c->Buffer->height - 1; + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; + GLuint _b_ = dmesa->Buffer->height - 1; +#ifndef MATROX + GLuint _w_ = dmesa->Buffer->width; #define INTERP_RGB 1 -#define RENDER_SPAN(span) \ - GLuint i, offset = FLIP2(span.y)*w + span.x; \ +#define RENDER_SPAN(span) \ + GLuint i, offset = FLIP2(span.y)*_w_ + span.x; \ for (i = 0; i < span.end; i++, offset++) { \ vl_putpixel(offset, vl_mixfix(span.red, span.green, span.blue)); \ span.red += span.redStep; \ @@ -515,27 +682,42 @@ static void tri_rgb_smooth (GLcontext *ctx, } #include "swrast/s_tritemp.h" +#else /* MATROX */ + MGAvertex m0, m1, m2; + m0.win[0] = v0->win[0]; + m0.win[1] = FLIP2(v0->win[1]); + m1.win[0] = v1->win[0]; + m1.win[1] = FLIP2(v1->win[1]); + m2.win[0] = v2->win[0]; + m2.win[1] = FLIP2(v2->win[1]); + *(unsigned long *)m0.color = *(unsigned long *)v0->color; + *(unsigned long *)m1.color = *(unsigned long *)v1->color; + *(unsigned long *)m2.color = *(unsigned long *)v2->color; + mga_draw_tri_rgb_iter((int)SWRAST_CONTEXT(ctx)->_backface_sign, &m0, &m1, &m2); +#endif /* MATROX */ } /* - * smooth, depth-buffered, triangle. + * Z-less iterated triangle. */ -static void tri_rgb_smooth_z (GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2) +static void tri_rgb_iter_zless (GLcontext *ctx, + const SWvertex *v0, + const SWvertex *v1, + const SWvertex *v2) { - const DMesaContext c = (DMesaContext)ctx->DriverCtx; - GLuint w = c->Buffer->width, b = c->Buffer->height - 1; + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; + GLuint _b_ = dmesa->Buffer->height - 1; +#ifndef MATROX + GLuint _w_ = dmesa->Buffer->width; #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define INTERP_RGB 1 -#define RENDER_SPAN(span) \ - GLuint i, offset = FLIP2(span.y)*w + span.x; \ +#define RENDER_SPAN(span) \ + GLuint i, offset = FLIP2(span.y)*_w_ + span.x; \ for (i = 0; i < span.end; i++, offset++) { \ const DEPTH_TYPE z = FixedToDepth(span.z); \ if (z < zRow[i]) { \ @@ -549,6 +731,22 @@ static void tri_rgb_smooth_z (GLcontext *ctx, } #include "swrast/s_tritemp.h" +#else /* MATROX */ + MGAvertex m0, m1, m2; + m0.win[0] = v0->win[0]; + m0.win[1] = FLIP2(v0->win[1]); + m0.win[2] = v0->win[2]; + m1.win[0] = v1->win[0]; + m1.win[1] = FLIP2(v1->win[1]); + m1.win[2] = v1->win[2]; + m2.win[0] = v2->win[0]; + m2.win[1] = FLIP2(v2->win[1]); + m2.win[2] = v2->win[2]; + *(unsigned long *)m0.color = *(unsigned long *)v0->color; + *(unsigned long *)m1.color = *(unsigned long *)v1->color; + *(unsigned long *)m2.color = *(unsigned long *)v2->color; + mga_draw_tri_rgb_iter_zless((int)SWRAST_CONTEXT(ctx)->_backface_sign, &m0, &m1, &m2); +#endif /* MATROX */ } @@ -566,7 +764,7 @@ static swrast_tri_func dmesa_choose_tri_function (GLcontext *ctx) || (ctx->Polygon.StippleFlag) || (ctx->Texture._EnabledUnits) || (swrast->_RasterMask & MULTI_DRAW_BIT) - || ((ctx->Polygon.CullFlag && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK))) { + || (ctx->Polygon.CullFlag && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)) { return (swrast_tri_func)NULL; } @@ -574,11 +772,11 @@ static swrast_tri_func dmesa_choose_tri_function (GLcontext *ctx) && ctx->Depth.Func==GL_LESS && ctx->Depth.Mask==GL_TRUE && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS) { - return (ctx->Light.ShadeModel==GL_SMOOTH) ? tri_rgb_smooth_z : tri_rgb_flat_z; + return (ctx->Light.ShadeModel==GL_SMOOTH) ? tri_rgb_iter_zless : tri_rgb_flat_zless; } if (swrast->_RasterMask==0) { /* no depth test */ - return (ctx->Light.ShadeModel==GL_SMOOTH) ? tri_rgb_smooth : tri_rgb_flat; + return (ctx->Light.ShadeModel==GL_SMOOTH) ? tri_rgb_iter : tri_rgb_flat; } return (swrast_tri_func)NULL; @@ -600,26 +798,211 @@ static void dmesa_choose_tri (GLcontext *ctx) +/**************************************************************************** + * Optimized line rendering + ***************************************************************************/ + +#ifdef MATROX +static __inline void matrox_line_clip_hack (GLcontext *ctx, int _b_, MGAvertex *m0, const SWvertex *vert0, MGAvertex *m1, const SWvertex *vert1) +{ + int x0 = vert0->win[0]; + int y0 = vert0->win[1]; + int x1 = vert1->win[0]; + int y1 = vert1->win[1]; + /* s_linetemp.h { */ + GLint w = ctx->DrawBuffer->Width; + GLint h = ctx->DrawBuffer->Height; + if ((x0==w) | (x1==w)) { + if ((x0==w) & (x1==w)) + return; + x0 -= x0==w; + x1 -= x1==w; + } + if ((y0==h) | (y1==h)) { + if ((y0==h) & (y1==h)) + return; + y0 -= y0==h; + y1 -= y1==h; + } + /* } s_linetemp.h */ + m0->win[0] = x0; + m0->win[1] = FLIP2(y0); + m1->win[0] = x1; + m1->win[1] = FLIP2(y1); +} +#endif + +/* + * NON-depth-buffered flat line. + */ +static void line_rgb_flat (GLcontext *ctx, + const SWvertex *vert0, + const SWvertex *vert1) +{ + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; + GLuint _b_ = dmesa->Buffer->height - 1; +#ifndef MATROX + GLuint _w_ = dmesa->Buffer->width; + GLuint rgb = vl_mixrgb(vert1->color); + +#define INTERP_XY 1 +#define CLIP_HACK 1 +#define PLOT(X,Y) vl_putpixel(FLIP2(Y) * _w_ + X, rgb); + +#include "swrast/s_linetemp.h" +#else + MGAvertex m0, m1; + matrox_line_clip_hack(ctx, _b_, &m0, vert0, &m1, vert1); + *(unsigned long *)m1.color = *(unsigned long *)vert1->color; + mga_draw_line_rgb_flat(&m0, &m1); +#endif +} + + + +/* + * Z-less flat line. + */ +static void line_rgb_flat_zless (GLcontext *ctx, + const SWvertex *vert0, + const SWvertex *vert1) +{ + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; + GLuint _b_ = dmesa->Buffer->height - 1; +#ifndef MATROX + GLuint _w_ = dmesa->Buffer->width; + GLuint rgb = vl_mixrgb(vert1->color); + +#define INTERP_XY 1 +#define INTERP_Z 1 +#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE +#define CLIP_HACK 1 +#define PLOT(X,Y) \ + if (Z < *zPtr) { \ + *zPtr = Z; \ + vl_putpixel(FLIP2(Y) * _w_ + X, rgb); \ + } + +#include "swrast/s_linetemp.h" +#else + MGAvertex m0, m1; + matrox_line_clip_hack(ctx, _b_, &m0, vert0, &m1, vert1); + m0.win[2] = vert0->win[2]; + m1.win[2] = vert1->win[2]; + *(unsigned long *)m1.color = *(unsigned long *)vert1->color; + mga_draw_line_rgb_flat_zless(&m0, &m1); +#endif +} + + + +#ifndef MATROX +#define line_rgb_iter NULL +#define line_rgb_iter_zless NULL +#else /* MATROX */ +/* + * NON-depth-buffered iterated line. + */ +static void line_rgb_iter (GLcontext *ctx, + const SWvertex *vert0, + const SWvertex *vert1) +{ + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; + GLuint _b_ = dmesa->Buffer->height - 1; + MGAvertex m0, m1; + matrox_line_clip_hack(ctx, _b_, &m0, vert0, &m1, vert1); + *(unsigned long *)m0.color = *(unsigned long *)vert0->color; + *(unsigned long *)m1.color = *(unsigned long *)vert1->color; + mga_draw_line_rgb_iter(&m0, &m1); +} + + + +/* + * Z-less iterated line. + */ +static void line_rgb_iter_zless (GLcontext *ctx, + const SWvertex *vert0, + const SWvertex *vert1) +{ + const DMesaContext dmesa = (DMesaContext)ctx->DriverCtx; + GLuint _b_ = dmesa->Buffer->height - 1; + MGAvertex m0, m1; + matrox_line_clip_hack(ctx, _b_, &m0, vert0, &m1, vert1); + m0.win[2] = vert0->win[2]; + m1.win[2] = vert1->win[2]; + *(unsigned long *)m0.color = *(unsigned long *)vert0->color; + *(unsigned long *)m1.color = *(unsigned long *)vert1->color; + mga_draw_line_rgb_iter_zless(&m0, &m1); +} +#endif /* MATROX */ + + + +/* + * Analyze context state to see if we can provide a fast line function + * Otherwise, return NULL. + */ +static swrast_line_func dmesa_choose_line_function (GLcontext *ctx) +{ + const SWcontext *swrast = SWRAST_CONTEXT(ctx); + + if ((ctx->RenderMode != GL_RENDER) + || (ctx->Line.SmoothFlag) + || (ctx->Texture._EnabledUnits) + || (ctx->Line.StippleFlag) + || (swrast->_RasterMask & MULTI_DRAW_BIT) + || (ctx->Line.Width!=1.0F)) { + return (swrast_line_func)NULL; + } + + if (swrast->_RasterMask==DEPTH_BIT + && ctx->Depth.Func==GL_LESS + && ctx->Depth.Mask==GL_TRUE + && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS) { + return (ctx->Light.ShadeModel==GL_SMOOTH) ? line_rgb_iter_zless : line_rgb_flat_zless; + } + + if (swrast->_RasterMask==0) { /* no depth test */ + return (ctx->Light.ShadeModel==GL_SMOOTH) ? line_rgb_iter : line_rgb_flat; + } + + return (swrast_line_func)NULL; +} + + + +/* Override for the swrast line-selection function. Try to use one + * of our internal line functions, otherwise fall back to the + * standard swrast functions. + */ +static void dmesa_choose_line (GLcontext *ctx) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + + if (!(swrast->Line=dmesa_choose_line_function(ctx))) + _swrast_choose_line(ctx); +} + + + /**************************************************************************** * Miscellaneous device driver funcs ***************************************************************************/ static void clear_index (GLcontext *ctx, GLuint index) { - DMesaContext c = (DMesaContext)ctx->DriverCtx; - - c->ClearIndex = index; + ((DMesaContext)ctx->DriverCtx)->ClearIndex = index; } static void clear_color (GLcontext *ctx, const GLfloat color[4]) { GLubyte col[4]; - DMesaContext c = (DMesaContext)ctx->DriverCtx; CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]); CLAMPED_FLOAT_TO_UBYTE(col[3], color[3]); - c->ClearColor = vl_mixrgba(col); + ((DMesaContext)ctx->DriverCtx)->ClearColor = vl_mixrgba(col); } @@ -640,6 +1023,7 @@ static void clear (GLcontext *ctx, GLbitfield mask, GLboolean all, /* we can't handle color or index masking */ if ((*colorMask == 0xffffffff) && (ctx->Color.IndexMask == 0xffffffff)) { +#ifndef MATROX if (mask & DD_BACK_LEFT_BIT) { int color = c->visual->rgb_flag ? c->ClearColor : c->ClearIndex; @@ -651,6 +1035,27 @@ static void clear (GLcontext *ctx, GLbitfield mask, GLboolean all, mask &= ~DD_BACK_LEFT_BIT; } +#else /* MATROX */ + unsigned short z = -1; + int color = c->ClearColor; + if (mask & DD_DEPTH_BIT) { + z = ctx->Depth.Clear * 0xffff; + } + if (all) { + mga_clear(mask & DD_FRONT_LEFT_BIT, + mask & DD_BACK_LEFT_BIT, + mask & DD_DEPTH_BIT, + 0, 0, c->Buffer->width, c->Buffer->height, + color, z); + } else { + mga_clear(mask & DD_FRONT_LEFT_BIT, + mask & DD_BACK_LEFT_BIT, + mask & DD_DEPTH_BIT, + x, y, width, height, + color, z); + } + mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT | DD_DEPTH_BIT); +#endif /* MATROX */ } if (mask) { @@ -688,7 +1093,14 @@ static const GLubyte* get_string (GLcontext *ctx, GLenum name) { switch (name) { case GL_RENDERER: - return (const GLubyte *)"Mesa DJGPP\0port (c) Borca Daniel dec-2002"; + return (const GLubyte *)"Mesa DJGPP" + #ifdef FX + " (FX)" + #endif + #ifdef MATROX + " (MGA)" + #endif + "\0port (c) Borca Daniel feb-2003"; default: return NULL; } @@ -717,6 +1129,13 @@ static void flush (GLcontext *ctx) /**************************************************************************** * State ***************************************************************************/ +#define DMESA_NEW_LINE (_NEW_LINE | \ + _NEW_TEXTURE | \ + _NEW_LIGHT | \ + _NEW_DEPTH | \ + _NEW_RENDERMODE | \ + _SWRAST_NEW_RASTERMASK) + #define DMESA_NEW_TRIANGLE (_NEW_POLYGON | \ _NEW_TEXTURE | \ _NEW_LIGHT | \ @@ -731,8 +1150,10 @@ static void dmesa_register_swrast_functions (GLcontext *ctx) { SWcontext *swrast = SWRAST_CONTEXT(ctx); + swrast->choose_line = dmesa_choose_line; swrast->choose_triangle = dmesa_choose_tri; + swrast->invalidate_line |= DMESA_NEW_LINE; swrast->invalidate_triangle |= DMESA_NEW_TRIANGLE; } @@ -808,22 +1229,21 @@ static void dmesa_init_pointers (GLcontext *ctx) /* Install swsetup for tnl->Driver.Render.*: */ _swsetup_Wakeup(ctx); -} - - -static void dmesa_update_state (GLcontext *ctx, GLuint new_state) -{ - struct swrast_device_driver *dd = _swrast_GetDeviceDriverReference(ctx); - - /* Propogate statechange information to swrast and swrast_setup - * modules. The DMesa driver has no internal GL-dependent state. + /* The span functions should be in `dmesa_update_state', but I'm + * pretty sure they will never change during the life of the Visual */ - _swrast_InvalidateState( ctx, new_state ); - _ac_InvalidateState( ctx, new_state ); - _tnl_InvalidateState( ctx, new_state ); - _swsetup_InvalidateState( ctx, new_state ); +#ifdef MATROX + if (((DMesaContext)ctx->DriverCtx)->visual->zbuffer == -1) { + /* Depth span/pixel functions */ + dd->WriteDepthSpan = write_depth_span; + dd->WriteDepthPixels = write_depth_pixels; + dd->ReadDepthSpan = read_depth_span; + dd->ReadDepthPixels = read_depth_pixels; + } +#endif +#ifndef MATROX /* Index span/pixel functions */ dd->WriteCI32Span = write_index_span; dd->WriteCI8Span = write_index8_span; @@ -832,6 +1252,7 @@ static void dmesa_update_state (GLcontext *ctx, GLuint new_state) dd->WriteMonoCIPixels = write_mono_index_pixels; dd->ReadCI32Span = read_index_span; dd->ReadCI32Pixels = read_index_pixels; +#endif /* RGB(A) span/pixel functions */ dd->WriteRGBASpan = write_rgba_span; @@ -842,7 +1263,20 @@ static void dmesa_update_state (GLcontext *ctx, GLuint new_state) dd->ReadRGBASpan = read_rgba_span; dd->ReadRGBAPixels = read_rgba_pixels; } -#endif + + + +static void dmesa_update_state (GLcontext *ctx, GLuint new_state) +{ + /* Propogate statechange information to swrast and swrast_setup + * modules. The DMesa driver has no internal GL-dependent state. + */ + _swrast_InvalidateState( ctx, new_state ); + _ac_InvalidateState( ctx, new_state ); + _tnl_InvalidateState( ctx, new_state ); + _swsetup_InvalidateState( ctx, new_state ); +} +#endif /* FX */ @@ -868,9 +1302,15 @@ DMesaVisual DMesaCreateVisual (GLint width, DMesaVisual v; GLint redBits, greenBits, blueBits, alphaBits, indexBits; +#ifndef MATROX if (!dbFlag) { return NULL; } +#else + if (!rgbFlag) { + return NULL; + } +#endif alphaBits = 0; @@ -909,9 +1349,15 @@ DMesaVisual DMesaCreateVisual (GLint width, } } +#ifndef MATROX if ((colDepth=vl_video_init(width, height, colDepth, rgbFlag, refresh)) <= 0) { return NULL; } +#else + if (mga_open(width, height, colDepth, dbFlag ? 2 : 1, depthSize == 16, refresh) < 0) { + return NULL; + } +#endif if (alphaFlag && (alphaBits==0)) { alphaBits = 8; @@ -938,11 +1384,19 @@ DMesaVisual DMesaCreateVisual (GLint width, v->depth = colDepth; v->db_flag = dbFlag; v->rgb_flag = rgbFlag; + + v->zbuffer = (depthSize > 0) ? 1 : 0; +#ifdef MATROX + mga_get(MGA_GET_HPIXELS, &v->stride_in_pixels); + if (depthSize == 16) { + v->zbuffer = -1; + } +#endif } return v; -#else +#else /* FX */ int i = 0, fx_attrib[32]; @@ -958,7 +1412,7 @@ DMesaVisual DMesaCreateVisual (GLint width, fx_attrib[i] = FXMESA_NONE; return (DMesaVisual)fxMesaCreateBestContext(-1, width, height, fx_attrib); -#endif +#endif /* FX */ } @@ -969,7 +1423,12 @@ void DMesaDestroyVisual (DMesaVisual v) _mesa_destroy_visual(v->gl_visual); free(v); +#ifndef MATROX vl_video_exit(); +#else + mga_close(1, 1); +#endif + #else fxMesaDestroyContext((fxMesaContext)v); #endif @@ -988,7 +1447,7 @@ DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, _mesa_initialize_framebuffer(&b->gl_buffer, visual->gl_visual, - visual->gl_visual->depthBits > 0, + visual->zbuffer == 1, visual->gl_visual->stencilBits > 0, visual->gl_visual->accumRedBits > 0, visual->gl_visual->alphaBits > 0); @@ -1009,7 +1468,9 @@ DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, void DMesaDestroyBuffer (DMesaBuffer b) { #ifndef FX +#ifndef MATROX free(b->the_window); +#endif _mesa_free_framebuffer_data(&b->gl_buffer); free(b); #endif @@ -1050,10 +1511,9 @@ DMesaContext DMesaCreateContext (DMesaVisual visual, return c; -#else - +#else /* FX */ return (DMesaContext)visual; -#endif +#endif /* FX */ } @@ -1076,7 +1536,7 @@ void DMesaDestroyContext (DMesaContext c) GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos) { -#ifndef FX +#if !defined(FX) && !defined(MATROX) GET_CURRENT_CONTEXT(ctx); DMesaBuffer b = ((DMesaContext)ctx->DriverCtx)->Buffer; @@ -1089,7 +1549,6 @@ GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos) } #else - return GL_FALSE; #endif } @@ -1098,7 +1557,7 @@ GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos) GLboolean DMesaResizeBuffer (GLint width, GLint height) { -#ifndef FX +#if !defined(FX) && !defined(MATROX) GET_CURRENT_CONTEXT(ctx); DMesaBuffer b = ((DMesaContext)ctx->DriverCtx)->Buffer; @@ -1111,7 +1570,6 @@ GLboolean DMesaResizeBuffer (GLint width, GLint height) } #else - return GL_FALSE; #endif } @@ -1125,9 +1583,11 @@ GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b) { #ifndef FX if ((c != NULL) && (b != NULL)) { +#ifndef MATROX if (vl_sync_buffer(&b->the_window, b->xpos, b->ypos, b->width, b->height) != 0) { return GL_FALSE; } +#endif c->Buffer = b; @@ -1142,7 +1602,6 @@ GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b) } #else - fxMesaMakeCurrent((fxMesaContext)c); #endif @@ -1157,7 +1616,13 @@ void DMesaSwapBuffers (DMesaBuffer b) #ifndef FX GET_CURRENT_CONTEXT(ctx); _mesa_notifySwapBuffers(ctx); +#ifndef MATROX vl_flip(); +#else + if (((DMesaContext)ctx->DriverCtx)->visual->db_flag) { + mga_swapbuffers(1); + } +#endif #else fxMesaSwapBuffers(); #endif @@ -1167,14 +1632,26 @@ void DMesaSwapBuffers (DMesaBuffer b) void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue) { -#ifndef FX +#if !defined(FX) && !defined(MATROX) vl_setCI(ndx, red, green, blue); #endif } -void DMesaGetIntegerv (GLenum pname, GLint *params) +DMesaContext DMesaGetCurrentContext (void) +{ +#ifndef FX + GET_CURRENT_CONTEXT(ctx); + return (ctx == NULL) ? NULL : (DMesaContext)ctx->DriverCtx; +#else + return (DMesaContext)fxMesaGetCurrentContext(); +#endif +} + + + +int DMesaGetIntegerv (GLenum pname, GLint *params) { #ifndef FX GET_CURRENT_CONTEXT(ctx); @@ -1184,33 +1661,36 @@ void DMesaGetIntegerv (GLenum pname, GLint *params) #endif if (c == NULL) { - return; + return -1; } switch (pname) { - case DMESA_Y_ORIGIN: + case DMESA_GET_SCREEN_SIZE: #ifndef FX - params[0] = GL_FALSE; + #ifndef MATROX + vl_get(VL_GET_SCREEN_SIZE, params); #else - params[0] = GL_TRUE; + mga_get(MGA_GET_SCREEN_SIZE, params); #endif - break; - case DMESA_SCREEN_SIZE: - #ifndef FX - vl_get_screen_size(¶ms[0], ¶ms[1]); #else params[0] = c->screen_width; params[1] = c->screen_height; #endif break; - case DMESA_ARGB_ORDER: + case DMESA_GET_DRIVER_CAPS: #ifndef FX - params[0] = GL_FALSE; + #ifndef MATROX + params[0] = DMESA_DRIVER_SWDB_BIT; #else - params[0] = !c->bgrOrder; + params[0] = 0; + #endif + #else + params[0] = DMESA_DRIVER_LLWO_BIT; #endif break; default: - break; + return -1; } + + return 0; } diff --git a/src/mesa/drivers/dos/dpmi.c b/src/mesa/drivers/dos/dpmi.c index 882cda390a4..db6a3063390 100644 --- a/src/mesa/drivers/dos/dpmi.c +++ b/src/mesa/drivers/dos/dpmi.c @@ -46,7 +46,7 @@ /* _create_linear_mapping: * Maps a physical address range into linear memory. */ -static int _create_linear_mapping (unsigned long *linear, unsigned long physaddr, int size) +int _create_linear_mapping (unsigned long *linear, unsigned long physaddr, int size) { __dpmi_meminfo meminfo; @@ -71,7 +71,7 @@ static int _create_linear_mapping (unsigned long *linear, unsigned long physaddr /* _remove_linear_mapping: * Frees the DPMI resources being used to map a linear address range. */ -static void _remove_linear_mapping (unsigned long *linear) +void _remove_linear_mapping (unsigned long *linear) { __dpmi_meminfo meminfo; @@ -127,3 +127,22 @@ void _remove_selector (int *segment) *segment = 0; } } + + + +/* Desc: retrieve CPU MMX capability + * + * In : - + * Out : FALSE if CPU cannot do MMX + * + * Note: - + */ +int _can_mmx (void) +{ +#ifdef USE_MMX_ASM + extern int _mesa_identify_x86_cpu_features (void); + return (_mesa_identify_x86_cpu_features() & 0x00800000); +#else + return 0; +#endif +} diff --git a/src/mesa/drivers/dos/internal.h b/src/mesa/drivers/dos/internal.h index 824d963d360..304a7377baa 100644 --- a/src/mesa/drivers/dos/internal.h +++ b/src/mesa/drivers/dos/internal.h @@ -79,9 +79,9 @@ typedef struct { void (*blit) (void); void (*setCI_f) (int index, float red, float green, float blue); void (*setCI_i) (int index, int red, int green, int blue); - int (*getCIprec) (void); + int (*get) (int pname, int *params); void (*restore) (void); - void (*finit) (void); + void (*fini) (void); } vl_driver; @@ -89,13 +89,15 @@ typedef struct { /* * memory mapping */ +int _create_linear_mapping (unsigned long *linear, unsigned long physaddr, int size); +void _remove_linear_mapping (unsigned long *linear); int _create_selector (int *segment, unsigned long base, int size); void _remove_selector (int *segment); /* * system routines */ -int vl_can_mmx (void); +int _can_mmx (void); /* * asm routines to deal with virtual buffering diff --git a/src/mesa/drivers/dos/mga/m_ttemp.h b/src/mesa/drivers/dos/mga/m_ttemp.h new file mode 100644 index 00000000000..d3de69a825a --- /dev/null +++ b/src/mesa/drivers/dos/mga/m_ttemp.h @@ -0,0 +1,377 @@ +/* + * Mesa 3-D graphics library + * Version: 5.0 + * + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa 5.0 -- MGA2064W triangle template + * + * Copyright (c) 2003 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +/* + * Triangle Rasterizer Template + * + * This file is #include'd to generate custom triangle rasterizers. + * + * The following macros may be defined to indicate what auxillary information + * must be interplated across the triangle: + * INTERP_Z - if defined, interpolate Z values + * INTERP_RGB - if defined, interpolate RGB values + * + * TAG - function name + * CULL - enable culling for: 0=no, 1=back, -1=front + * + * SETUP_CODE - to be executed once per triangle (usually HW init) + * + * For flatshaded primitives, the provoking vertex is the final one. + * This code was designed for the origin to be in the upper-left corner. + * + * Inspired by triangle rasterizer code written by Brian Paul. + */ + + + +#define TRI_SWAP(a, b) \ +do { \ + const MGAvertex *tmp = a; \ + a = b; \ + b = tmp; \ +} while (0) + +void TAG (int cull, const MGAvertex *v1, const MGAvertex *v2, const MGAvertex *v3) +{ + int area; + int x1, y1, x2, y2, x3, y3; + int eMaj_dx, eMaj_dy, eBot_dx, eBot_dy, eTop_dx, eTop_dy; +#ifdef INTERP_RGB +#define FIFO_CNT_RGB 3 + int eMaj_dr, eBot_dr, eMaj_dg, eBot_dg, eMaj_db, eBot_db; + int drdx, drdy, dgdx, dgdy, dbdx, dbdy; +#else +#define FIFO_CNT_RGB 0 +#endif +#ifdef INTERP_Z +#define FIFO_CNT_Z 1 + int dzdx, dzdy; + int eMaj_dz, eBot_dz; + int z1, z2, z3; +#else +#define FIFO_CNT_Z 0 +#endif + +#if defined(INTERP_Z) || defined(INTERP_RGB) + double one_area; +#ifndef INTERP_RGB + int red = v3->color[0]; + int green = v3->color[1]; + int blue = v3->color[2]; +#endif +#else + unsigned long color = mga_mixrgb_full(v3->color); +#endif + + int sgn = 0; + + /* sort along the vertical axis */ + if (v2->win[1] < v1->win[1]) { + TRI_SWAP(v1, v2); +#ifdef CULL + cull = -cull; +#endif + } + + if (v3->win[1] < v1->win[1]) { + TRI_SWAP(v1, v3); + TRI_SWAP(v2, v3); + } else if (v3->win[1] < v2->win[1]) { + TRI_SWAP(v2, v3); +#ifdef CULL + cull = -cull; +#endif + } + + x1 = v1->win[0]; + y1 = v1->win[1]; + x2 = v2->win[0]; + y2 = v2->win[1]; + x3 = v3->win[0]; + y3 = v3->win[1]; + + /* compute deltas for each edge */ + eMaj_dx = x3 - x1; + eMaj_dy = y3 - y1; + eBot_dx = x2 - x1; + eBot_dy = y2 - y1; + eTop_dx = x3 - x2; + eTop_dy = y3 - y2; + + /* compute area */ + if ((area = eMaj_dx * eBot_dy - eBot_dx * eMaj_dy) == 0) { + return; + } +#ifdef CULL + if ((area * cull) > 0) { + return; + } +#endif + + mga_select(); + + /* set engine state */ +#ifdef SETUP_CODE + SETUP_CODE +#endif + + /* draw lower triangle */ +#if defined(INTERP_Z) || defined(INTERP_RGB) + one_area = (double)(1<<15) / (double)area; + mga_fifo(1); +#else + mga_fifo(2); + mga_outl(M_FCOL, color); +#endif + mga_outl(M_YDST, y1); + +#ifdef INTERP_Z + z1 = v1->win[2]; + z2 = v2->win[2]; + z3 = v3->win[2]; + + /* compute d?/dx and d?/dy derivatives */ + eMaj_dz = z3 - z1; + eBot_dz = z2 - z1; + dzdx = (eMaj_dz * eBot_dy - eMaj_dy * eBot_dz) * one_area; + dzdy = (eMaj_dx * eBot_dz - eMaj_dz * eBot_dx) * one_area; + +#ifndef INTERP_RGB + mga_fifo(11); + mga_outl(M_DR2, dzdx); + mga_outl(M_DR3, dzdy); + mga_outl(M_DR4, red<<15); + mga_outl(M_DR6, 0); + mga_outl(M_DR7, 0); + mga_outl(M_DR8, green<<15); + mga_outl(M_DR10, 0); + mga_outl(M_DR11, 0); + mga_outl(M_DR12, blue<<15); + mga_outl(M_DR14, 0); + mga_outl(M_DR15, 0); +#else + mga_fifo(2); + mga_outl(M_DR2, dzdx); + mga_outl(M_DR3, dzdy); +#endif +#endif + +#ifdef INTERP_RGB + /* compute color deltas */ + eMaj_dr = v3->color[0] - v1->color[0]; + eBot_dr = v2->color[0] - v1->color[0]; + eMaj_dg = v3->color[1] - v1->color[1]; + eBot_dg = v2->color[1] - v1->color[1]; + eMaj_db = v3->color[2] - v1->color[2]; + eBot_db = v2->color[2] - v1->color[2]; + + /* compute color increments */ + drdx = (eMaj_dr * eBot_dy - eMaj_dy * eBot_dr) * one_area; + drdy = (eMaj_dx * eBot_dr - eMaj_dr * eBot_dx) * one_area; + dgdx = (eMaj_dg * eBot_dy - eMaj_dy * eBot_dg) * one_area; + dgdy = (eMaj_dx * eBot_dg - eMaj_dg * eBot_dx) * one_area; + dbdx = (eMaj_db * eBot_dy - eMaj_dy * eBot_db) * one_area; + dbdy = (eMaj_dx * eBot_db - eMaj_db * eBot_dx) * one_area; + + mga_fifo(6); + mga_outl(M_DR6, drdx); + mga_outl(M_DR7, drdy); + mga_outl(M_DR10, dgdx); + mga_outl(M_DR11, dgdy); + mga_outl(M_DR14, dbdx); + mga_outl(M_DR15, dbdy); +#endif + + if (area > 0) { /* major edge on the right */ + if (eBot_dy) { /* have lower triangle */ + mga_fifo(9 + FIFO_CNT_Z + FIFO_CNT_RGB); + + mga_outl(M_AR0, eBot_dy); + if (x2 < x1) { + mga_outl(M_AR1, eBot_dx + eBot_dy - 1); + mga_outl(M_AR2, eBot_dx); + sgn |= M_SDXL; + } else { + mga_outl(M_AR1, -eBot_dx); + mga_outl(M_AR2, -eBot_dx); + } + + mga_outl(M_AR6, eMaj_dy); + if (x3 < x1) { + mga_outl(M_AR4, eMaj_dx + eMaj_dy - 1); + mga_outl(M_AR5, eMaj_dx); + sgn |= M_SDXR; + } else { + mga_outl(M_AR4, -eMaj_dx); + mga_outl(M_AR5, -eMaj_dx); + } + + mga_outl(M_FXBNDRY, (x1<<16) | x1); +#ifdef INTERP_Z + mga_outl(M_DR0, z1<<15); +#endif +#ifdef INTERP_RGB + mga_outl(M_DR4, v1->color[0]<<15); + mga_outl(M_DR8, v1->color[1]<<15); + mga_outl(M_DR12, v1->color[2]<<15); +#endif + mga_outl(M_SGN, sgn); + mga_outl(M_LEN | M_EXEC, eBot_dy); + } else { /* no lower triangle */ + mga_fifo(4 + FIFO_CNT_Z + FIFO_CNT_RGB); + + mga_outl(M_AR6, eMaj_dy); + if (x3 < x1) { + mga_outl(M_AR4, eMaj_dx + eMaj_dy - 1); + mga_outl(M_AR5, eMaj_dx); + sgn |= M_SDXR; + } else { + mga_outl(M_AR4, -eMaj_dx); + mga_outl(M_AR5, -eMaj_dx); + } + + mga_outl(M_FXBNDRY, (x1<<16) | x2); +#ifdef INTERP_Z + mga_outl(M_DR0, z2<<15); +#endif +#ifdef INTERP_RGB + mga_outl(M_DR4, v2->color[0]<<15); + mga_outl(M_DR8, v2->color[1]<<15); + mga_outl(M_DR12, v2->color[2]<<15); +#endif + } + + /* draw upper triangle */ + if (eTop_dy) { + mga_fifo(5); + mga_outl(M_AR0, eTop_dy); + if (x3 < x2) { + mga_outl(M_AR1, eTop_dx + eTop_dy - 1); + mga_outl(M_AR2, eTop_dx); + sgn |= M_SDXL; + } else { + mga_outl(M_AR1, -eTop_dx); + mga_outl(M_AR2, -eTop_dx); + sgn &= ~M_SDXL; + } + mga_outl(M_SGN, sgn); + mga_outl(M_LEN | M_EXEC, eTop_dy); + } + } else { /* major edge on the left */ + if (eBot_dy) { /* have lower triangle */ + mga_fifo(9 + FIFO_CNT_Z + FIFO_CNT_RGB); + + mga_outl(M_AR0, eMaj_dy); + if (x3 < x1) { + mga_outl(M_AR1, eMaj_dx + eMaj_dy - 1); + mga_outl(M_AR2, eMaj_dx); + sgn |= M_SDXL; + } else { + mga_outl(M_AR1, -eMaj_dx); + mga_outl(M_AR2, -eMaj_dx); + } + + mga_outl(M_AR6, eBot_dy); + if (x2 < x1) { + mga_outl(M_AR4, eBot_dx + eBot_dy - 1); + mga_outl(M_AR5, eBot_dx); + sgn |= M_SDXR; + } else { + mga_outl(M_AR4, -eBot_dx); + mga_outl(M_AR5, -eBot_dx); + } + + mga_outl(M_FXBNDRY, (x1<<16) | x1); +#ifdef INTERP_Z + mga_outl(M_DR0, z1<<15); +#endif +#ifdef INTERP_RGB + mga_outl(M_DR4, v1->color[0]<<15); + mga_outl(M_DR8, v1->color[1]<<15); + mga_outl(M_DR12, v1->color[2]<<15); +#endif + mga_outl(M_SGN, sgn); + mga_outl(M_LEN | M_EXEC, eBot_dy); + } else { /* no lower triangle */ + mga_fifo(4 + FIFO_CNT_Z + FIFO_CNT_RGB); + + mga_outl(M_AR0, eMaj_dy); + if (x3 < x1) { + mga_outl(M_AR1, eMaj_dx + eMaj_dy - 1); + mga_outl(M_AR2, eMaj_dx); + sgn |= M_SDXL; + } else { + mga_outl(M_AR1, -eMaj_dx); + mga_outl(M_AR2, -eMaj_dx); + } + + mga_outl(M_FXBNDRY, (x2<<16) | x1); +#ifdef INTERP_Z + mga_outl(M_DR0, z1<<15); +#endif +#ifdef INTERP_RGB + mga_outl(M_DR4, v1->color[0]<<15); + mga_outl(M_DR8, v1->color[1]<<15); + mga_outl(M_DR12, v1->color[2]<<15); +#endif + } + + /* draw upper triangle */ + if (eTop_dy) { + mga_fifo(5); + mga_outl(M_AR6, eTop_dy); + if (x3 < x2) { + mga_outl(M_AR4, eTop_dx + eTop_dy - 1); + mga_outl(M_AR5, eTop_dx); + sgn |= M_SDXR; + } else { + mga_outl(M_AR4, -eTop_dx); + mga_outl(M_AR5, -eTop_dx); + sgn &= ~M_SDXR; + } + mga_outl(M_SGN, sgn); + mga_outl(M_LEN | M_EXEC, eTop_dy); + } + } +} + +#undef FIFO_CNT_RGB +#undef FIFO_CNT_Z + +#undef TRI_SWAP + +#undef SETUP_CODE +#undef INTERP_RGB +#undef INTERP_Z +#undef CULL +#undef TAG diff --git a/src/mesa/drivers/dos/mga/m_ttemp2.h b/src/mesa/drivers/dos/mga/m_ttemp2.h new file mode 100644 index 00000000000..27a1c8ba037 --- /dev/null +++ b/src/mesa/drivers/dos/mga/m_ttemp2.h @@ -0,0 +1,375 @@ +/* + * Mesa 3-D graphics library + * Version: 5.0 + * + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa 5.0 -- MGA2064W triangle template + * + * Copyright (c) 2003 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +/* + * Triangle Rasterizer Template + * + * This file is #include'd to generate custom triangle rasterizers. + * + * The following macros may be defined to indicate what auxillary information + * must be interplated across the triangle: + * INTERP_Z - if defined, interpolate Z values + * INTERP_RGB - if defined, interpolate RGB values + * + * TAG - function name + * CULL - enable culling for: 0=no, 1=back, -1=front + * + * SETUP_CODE - to be executed once per triangle (usually HW init) + * + * For flatshaded primitives, the provoking vertex is the final one. + * This code was designed for the origin to be in the upper-left corner. + * + * Inspired by triangle rasterizer code written by Brian Paul. + */ + + + +#define TRI_SWAP(a, b) \ +do { \ + const MGAvertex *tmp = a; \ + a = b; \ + b = tmp; \ +} while (0) + +void TAG (int cull, const MGAvertex *v1, const MGAvertex *v2, const MGAvertex *v3) +{ + int area; + int x1, y1, x2, y2, x3, y3; + int eMaj_dx, eMaj_dy, eBot_dx, eBot_dy, eTop_dx, eTop_dy; +#ifdef INTERP_RGB +#define FIFO_CNT_RGB 3 + int eMaj_dr, eBot_dr, eMaj_dg, eBot_dg, eMaj_db, eBot_db; + int drdx, drdy, dgdx, dgdy, dbdx, dbdy; +#else +#define FIFO_CNT_RGB 0 +#endif +#ifdef INTERP_Z +#define FIFO_CNT_Z 1 + int dzdx, dzdy; + int eMaj_dz, eBot_dz; + int z1, z2, z3; +#else +#define FIFO_CNT_Z 0 +#endif + +#if defined(INTERP_Z) || defined(INTERP_RGB) +#ifndef INTERP_RGB + int red = v3->color[0]; + int green = v3->color[1]; + int blue = v3->color[2]; +#endif +#else + unsigned long color = mga_mixrgb_full(v3->color); +#endif + + int sgn = 0; + + /* sort along the vertical axis */ + if (v2->win[1] < v1->win[1]) { + TRI_SWAP(v1, v2); +#ifdef CULL + cull = -cull; +#endif + } + + if (v3->win[1] < v1->win[1]) { + TRI_SWAP(v1, v3); + TRI_SWAP(v2, v3); + } else if (v3->win[1] < v2->win[1]) { + TRI_SWAP(v2, v3); +#ifdef CULL + cull = -cull; +#endif + } + + x1 = v1->win[0]; + y1 = v1->win[1]; + x2 = v2->win[0]; + y2 = v2->win[1]; + x3 = v3->win[0]; + y3 = v3->win[1]; + + /* compute deltas for each edge */ + eMaj_dx = x3 - x1; + eMaj_dy = y3 - y1; + eBot_dx = x2 - x1; + eBot_dy = y2 - y1; + eTop_dx = x3 - x2; + eTop_dy = y3 - y2; + + /* compute area */ + if ((area = eMaj_dx * eBot_dy - eBot_dx * eMaj_dy) == 0) { + return; + } +#ifdef CULL + if ((area * cull) > 0) { + return; + } +#endif + + mga_select(); + + /* set engine state */ +#ifdef SETUP_CODE + SETUP_CODE +#endif + + /* draw lower triangle */ +#if defined(INTERP_Z) || defined(INTERP_RGB) + mga_fifo(1); +#else + mga_fifo(2); + mga_outl(M_FCOL, color); +#endif + mga_outl(M_YDST, y1); + +#ifdef INTERP_Z + z1 = v1->win[2]; + z2 = v2->win[2]; + z3 = v3->win[2]; + + /* compute d?/dx and d?/dy derivatives */ + eMaj_dz = z3 - z1; + eBot_dz = z2 - z1; + dzdx = ((long long)(eMaj_dz * eBot_dy - eMaj_dy * eBot_dz)<<15) / area; + dzdy = ((long long)(eMaj_dx * eBot_dz - eMaj_dz * eBot_dx)<<15) / area; + +#ifndef INTERP_RGB + mga_fifo(11); + mga_outl(M_DR2, dzdx); + mga_outl(M_DR3, dzdy); + mga_outl(M_DR4, red<<15); + mga_outl(M_DR6, 0); + mga_outl(M_DR7, 0); + mga_outl(M_DR8, green<<15); + mga_outl(M_DR10, 0); + mga_outl(M_DR11, 0); + mga_outl(M_DR12, blue<<15); + mga_outl(M_DR14, 0); + mga_outl(M_DR15, 0); +#else + mga_fifo(2); + mga_outl(M_DR2, dzdx); + mga_outl(M_DR3, dzdy); +#endif +#endif + +#ifdef INTERP_RGB + /* compute color deltas */ + eMaj_dr = v3->color[0] - v1->color[0]; + eBot_dr = v2->color[0] - v1->color[0]; + eMaj_dg = v3->color[1] - v1->color[1]; + eBot_dg = v2->color[1] - v1->color[1]; + eMaj_db = v3->color[2] - v1->color[2]; + eBot_db = v2->color[2] - v1->color[2]; + + /* compute color increments */ + drdx = ((long long)(eMaj_dr * eBot_dy - eMaj_dy * eBot_dr)<<15) / area; + drdy = ((long long)(eMaj_dx * eBot_dr - eMaj_dr * eBot_dx)<<15) / area; + dgdx = ((long long)(eMaj_dg * eBot_dy - eMaj_dy * eBot_dg)<<15) / area; + dgdy = ((long long)(eMaj_dx * eBot_dg - eMaj_dg * eBot_dx)<<15) / area; + dbdx = ((long long)(eMaj_db * eBot_dy - eMaj_dy * eBot_db)<<15) / area; + dbdy = ((long long)(eMaj_dx * eBot_db - eMaj_db * eBot_dx)<<15) / area; + + mga_fifo(6); + mga_outl(M_DR6, drdx); + mga_outl(M_DR7, drdy); + mga_outl(M_DR10, dgdx); + mga_outl(M_DR11, dgdy); + mga_outl(M_DR14, dbdx); + mga_outl(M_DR15, dbdy); +#endif + + if (area > 0) { /* major edge on the right */ + if (eBot_dy) { /* have lower triangle */ + mga_fifo(9 + FIFO_CNT_Z + FIFO_CNT_RGB); + + mga_outl(M_AR0, eBot_dy); + if (x2 < x1) { + mga_outl(M_AR1, eBot_dx + eBot_dy - 1); + mga_outl(M_AR2, eBot_dx); + sgn |= M_SDXL; + } else { + mga_outl(M_AR1, -eBot_dx); + mga_outl(M_AR2, -eBot_dx); + } + + mga_outl(M_AR6, eMaj_dy); + if (x3 < x1) { + mga_outl(M_AR4, eMaj_dx + eMaj_dy - 1); + mga_outl(M_AR5, eMaj_dx); + sgn |= M_SDXR; + } else { + mga_outl(M_AR4, -eMaj_dx); + mga_outl(M_AR5, -eMaj_dx); + } + + mga_outl(M_FXBNDRY, (x1<<16) | x1); +#ifdef INTERP_Z + mga_outl(M_DR0, z1<<15); +#endif +#ifdef INTERP_RGB + mga_outl(M_DR4, v1->color[0]<<15); + mga_outl(M_DR8, v1->color[1]<<15); + mga_outl(M_DR12, v1->color[2]<<15); +#endif + mga_outl(M_SGN, sgn); + mga_outl(M_LEN | M_EXEC, eBot_dy); + } else { /* no lower triangle */ + mga_fifo(4 + FIFO_CNT_Z + FIFO_CNT_RGB); + + mga_outl(M_AR6, eMaj_dy); + if (x3 < x1) { + mga_outl(M_AR4, eMaj_dx + eMaj_dy - 1); + mga_outl(M_AR5, eMaj_dx); + sgn |= M_SDXR; + } else { + mga_outl(M_AR4, -eMaj_dx); + mga_outl(M_AR5, -eMaj_dx); + } + + mga_outl(M_FXBNDRY, (x1<<16) | x2); +#ifdef INTERP_Z + mga_outl(M_DR0, z2<<15); +#endif +#ifdef INTERP_RGB + mga_outl(M_DR4, v2->color[0]<<15); + mga_outl(M_DR8, v2->color[1]<<15); + mga_outl(M_DR12, v2->color[2]<<15); +#endif + } + + /* draw upper triangle */ + if (eTop_dy) { + mga_fifo(5); + mga_outl(M_AR0, eTop_dy); + if (x3 < x2) { + mga_outl(M_AR1, eTop_dx + eTop_dy - 1); + mga_outl(M_AR2, eTop_dx); + sgn |= M_SDXL; + } else { + mga_outl(M_AR1, -eTop_dx); + mga_outl(M_AR2, -eTop_dx); + sgn &= ~M_SDXL; + } + mga_outl(M_SGN, sgn); + mga_outl(M_LEN | M_EXEC, eTop_dy); + } + } else { /* major edge on the left */ + if (eBot_dy) { /* have lower triangle */ + mga_fifo(9 + FIFO_CNT_Z + FIFO_CNT_RGB); + + mga_outl(M_AR0, eMaj_dy); + if (x3 < x1) { + mga_outl(M_AR1, eMaj_dx + eMaj_dy - 1); + mga_outl(M_AR2, eMaj_dx); + sgn |= M_SDXL; + } else { + mga_outl(M_AR1, -eMaj_dx); + mga_outl(M_AR2, -eMaj_dx); + } + + mga_outl(M_AR6, eBot_dy); + if (x2 < x1) { + mga_outl(M_AR4, eBot_dx + eBot_dy - 1); + mga_outl(M_AR5, eBot_dx); + sgn |= M_SDXR; + } else { + mga_outl(M_AR4, -eBot_dx); + mga_outl(M_AR5, -eBot_dx); + } + + mga_outl(M_FXBNDRY, (x1<<16) | x1); +#ifdef INTERP_Z + mga_outl(M_DR0, z1<<15); +#endif +#ifdef INTERP_RGB + mga_outl(M_DR4, v1->color[0]<<15); + mga_outl(M_DR8, v1->color[1]<<15); + mga_outl(M_DR12, v1->color[2]<<15); +#endif + mga_outl(M_SGN, sgn); + mga_outl(M_LEN | M_EXEC, eBot_dy); + } else { /* no lower triangle */ + mga_fifo(4 + FIFO_CNT_Z + FIFO_CNT_RGB); + + mga_outl(M_AR0, eMaj_dy); + if (x3 < x1) { + mga_outl(M_AR1, eMaj_dx + eMaj_dy - 1); + mga_outl(M_AR2, eMaj_dx); + sgn |= M_SDXL; + } else { + mga_outl(M_AR1, -eMaj_dx); + mga_outl(M_AR2, -eMaj_dx); + } + + mga_outl(M_FXBNDRY, (x2<<16) | x1); +#ifdef INTERP_Z + mga_outl(M_DR0, z1<<15); +#endif +#ifdef INTERP_RGB + mga_outl(M_DR4, v1->color[0]<<15); + mga_outl(M_DR8, v1->color[1]<<15); + mga_outl(M_DR12, v1->color[2]<<15); +#endif + } + + /* draw upper triangle */ + if (eTop_dy) { + mga_fifo(5); + mga_outl(M_AR6, eTop_dy); + if (x3 < x2) { + mga_outl(M_AR4, eTop_dx + eTop_dy - 1); + mga_outl(M_AR5, eTop_dx); + sgn |= M_SDXR; + } else { + mga_outl(M_AR4, -eTop_dx); + mga_outl(M_AR5, -eTop_dx); + sgn &= ~M_SDXR; + } + mga_outl(M_SGN, sgn); + mga_outl(M_LEN | M_EXEC, eTop_dy); + } + } +} + +#undef FIFO_CNT_RGB +#undef FIFO_CNT_Z + +#undef TRI_SWAP + +#undef SETUP_CODE +#undef INTERP_RGB +#undef INTERP_Z +#undef CULL +#undef TAG diff --git a/src/mesa/drivers/dos/mga/mga.c b/src/mesa/drivers/dos/mga/mga.c new file mode 100644 index 00000000000..59bb09c9d3d --- /dev/null +++ b/src/mesa/drivers/dos/mga/mga.c @@ -0,0 +1,1536 @@ +/* + * Mesa 3-D graphics library + * Version: 5.0 + * + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa 5.0 -- MGA2064W + * + * Copyright (c) 2003 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + * + * Thanks to Shawn Hargreaves for FreeBE/AF + */ + + +#include +#include +#include + +#include "../internal.h" +#include "mga_reg.h" +#include "mga_hw.h" +#include "mga_mode.h" +#include "mga.h" + + + +/* cached drawing engine state */ +#define OP_NONE 0 + +#define OP_DRAWRECT (\ + M_DWG_TRAP | /* opcod */ \ + M_DWG_BLK | /* atype */ \ + /* linear */ \ + M_DWG_NOZCMP | /* zmode */ \ + M_DWG_SOLID | /* solid */ \ + M_DWG_ARZERO | /* arzero */ \ + M_DWG_SGNZERO | /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC /* bop */ \ + /* trans */ \ + /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_DRAWRECT_TX32BGR (\ + M_DWG_TEXTURE_TRAP | /* opcod */ \ + M_DWG_I | /* atype */ \ + /* linear */ \ + M_DWG_NOZCMP | /* zmode */ \ + /* solid */ \ + M_DWG_ARZERO | /* arzero */ \ + M_DWG_SGNZERO | /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC | /* bop */ \ + /* trans */ \ + M_DWG_BU32BGR /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_DRAWRECT_TX24BGR (\ + M_DWG_TEXTURE_TRAP | /* opcod */ \ + M_DWG_I | /* atype */ \ + /* linear */ \ + M_DWG_NOZCMP | /* zmode */ \ + /* solid */ \ + M_DWG_ARZERO | /* arzero */ \ + M_DWG_SGNZERO | /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC | /* bop */ \ + /* trans */ \ + M_DWG_BU24BGR /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_DRAWLINE (\ + M_DWG_AUTOLINE_CLOSE | /* opcod */ \ + M_DWG_RPL | /* atype */ \ + /* linear */ \ + M_DWG_NOZCMP | /* zmode */ \ + M_DWG_SOLID | /* solid */ \ + /* arzero */ \ + /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC | /* bop */ \ + /* trans */ \ + M_DWG_BFCOL /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_DRAWLINE_I (\ + M_DWG_AUTOLINE_CLOSE | /* opcod */ \ + M_DWG_I | /* atype */ \ + /* linear */ \ + M_DWG_NOZCMP | /* zmode */ \ + /* solid */ \ + /* arzero */ \ + /* sgnzero */ \ + /* shftzero */ \ + M_DWG_BOP_SRC | /* bop */ \ + /* trans */ \ + M_DWG_BFCOL /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_DRAWLINE_ZI (\ + M_DWG_AUTOLINE_CLOSE | /* opcod */ \ + M_DWG_ZI | /* atype */ \ + /* linear */ \ + M_DWG_ZLT | /* zmode */ \ + /* solid */ \ + /* arzero */ \ + /* sgnzero */ \ + /* shftzero */ \ + M_DWG_BOP_SRC | /* bop */ \ + /* trans */ \ + M_DWG_BFCOL /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_DRAWTRAP (\ + M_DWG_TRAP | /* opcod */ \ + M_DWG_BLK | /* atype */ \ + /* linear */ \ + M_DWG_NOZCMP | /* zmode */ \ + M_DWG_SOLID | /* solid */ \ + /* arzero */ \ + /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC /* bop */ \ + /* trans */ \ + /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_DRAWTRAP_I (\ + M_DWG_TRAP | /* opcod */ \ + M_DWG_I | /* atype */ \ + /* linear */ \ + M_DWG_NOZCMP | /* zmode */ \ + /* solid */ \ + /* arzero */ \ + /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC /* bop */ \ + /* trans */ \ + /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_DRAWTRAP_ZI (\ + M_DWG_TRAP | /* opcod */ \ + M_DWG_ZI | /* atype */ \ + /* linear */ \ + M_DWG_ZLT | /* zmode */ \ + /* solid */ \ + /* arzero */ \ + /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC /* bop */ \ + /* trans */ \ + /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_ILOAD_32BGR (\ + M_DWG_ILOAD | /* opcod */ \ + M_DWG_RPL | /* atype */ \ + /* linear */ \ + /* zmode */ \ + /* solid */ \ + /* arzero */ \ + M_DWG_SGNZERO | /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC | /* bop */ \ + /* trans */ \ + M_DWG_BU32BGR /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_ILOAD_24BGR (\ + M_DWG_ILOAD | /* opcod */ \ + M_DWG_RPL | /* atype */ \ + /* linear */ \ + /* zmode */ \ + /* solid */ \ + /* arzero */ \ + M_DWG_SGNZERO | /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC | /* bop */ \ + /* trans */ \ + M_DWG_BU24BGR /* bltmod */ \ + /* pattern */ \ + /* transc */ ) + + + +/* internal hardware data structures */ +static int interleave; +static unsigned long zorg; +static unsigned long vram; +static char card_name[80]; + + + +/* some info about current mode */ +static int __bpp, __bypp; +static int __pixwidth, __bytwidth, __pagewidth, __width, __height, __zheight; +static int __operation; +static int __scrollx, __scrolly; + + + +/* buffers */ +static int mga_readbuffer, mga_writebuffer; +static long mga_readbuffer_ptr, mga_writebuffer_ptr; +static long mga_backbuffer_ptr, mga_frontbuffer_ptr; + + + +/* lookup table for scaling 2 bit colors up to 8 bits */ +static int _rgb_scale_2[4] = { + 0, 85, 170, 255 +}; + +/* lookup table for scaling 3 bit colors up to 8 bits */ +static int _rgb_scale_3[8] = { + 0, 36, 73, 109, 146, 182, 219, 255 +}; + +/* lookup table for scaling 5 bit colors up to 8 bits */ +static int _rgb_scale_5[32] = { + 0, 8, 16, 25, 33, 41, 49, 58, + 66, 74, 82, 90, 99, 107, 115, 123, + 132, 140, 148, 156, 165, 173, 181, 189, + 197, 206, 214, 222, 230, 239, 247, 255 +}; + +/* lookup table for scaling 6 bit colors up to 8 bits */ +static int _rgb_scale_6[64] = { + 0, 4, 8, 12, 16, 20, 24, 28, + 32, 36, 40, 45, 49, 53, 57, 61, + 65, 69, 73, 77, 81, 85, 89, 93, + 97, 101, 105, 109, 113, 117, 121, 125, + 130, 134, 138, 142, 146, 150, 154, 158, + 162, 166, 170, 174, 178, 182, 186, 190, + 194, 198, 202, 206, 210, 215, 219, 223, + 227, 231, 235, 239, 243, 247, 251, 255 +}; + + + +/* + * pixel/color routines + */ +void (*mga_putpixel) (unsigned int offset, int color); +int (*mga_getpixel) (unsigned int offset); +void (*mga_getrgba) (unsigned int offset, unsigned char rgba[4]); +int (*mga_mixrgb) (const unsigned char rgb[]); +static int (*mga_mixrgb_full) (const unsigned char rgb[]); + + + +/* mga_fifo: + * Waits until there are at least free slots in the FIFO buffer. + */ +#define mga_fifo(n) do { } while (mga_inb(M_FIFOSTATUS) < (n)) + + + +static int _mga_rread (int port, int index) +{ + mga_select(); + mga_outb(port, index); + return mga_inb(port+1); +} + + + +static void _mga_rwrite (int port, int index, int v) +{ + mga_select(); + mga_outb(port, index); + mga_outb(port+1, v); +} + + + +static void _mga_ralter (int port, int index, int mask, int v) +{ + int temp; + temp = _mga_rread(port, index); + temp &= (~mask); + temp |= (v & mask); + _mga_rwrite(port, index, temp); +} + + + +/* WaitTillIdle: + * Delay until the hardware controller has finished drawing. + */ +void mga_wait_idle (void) +{ + int tries = 2; + + /*hwptr_unselect(oldptr);*/ + + mga_select(); + + while (tries--) { + do { + } while (!(mga_inl(M_FIFOSTATUS) & 0x200)); + + do { + } while (mga_inl(M_STATUS) & 0x10000); + + mga_outb(M_CRTC_INDEX, 0); + } + + /*hwptr_select(oldptr);*/ +} + + + +/* Desc: Waits for the next vertical sync period. + * + * In : + * Out : + * + * Note: + */ +static void _mga_wait_retrace (void) +{ + int t1 = 0; + int t2 = 0; + + do { + t1 = t2; + t2 = mga_inl(M_VCOUNT); + } while (t2 >= t1); +} + + + +/* Desc: fix scan lines + * + * In : + * Out : + * + * Note: + */ +static unsigned long _mga_fix_scans (unsigned long l) +{ + unsigned long m = 0; + + switch (__bpp) { + case 8: + m = interleave?128:64; + break; + case 15: + case 16: + m = interleave?64:32; + break; + case 24: + m = interleave?128:64; + break; + case 32: + m = 32; + break; + } + + m -= 1; + return (l + m) & ~m; +} + + + +/* Desc: HW scrolling function + * + * In : + * Out : + * + * Note: view Z-buffer in 16bit modes: _mga_display_start(0, 0, __height, 1) + */ +void mga_display_start (long boffset, long x, long y, long waitVRT) +{ + long addr; + + mga_select(); + + if (waitVRT >= 0) { + + addr = __bytwidth * y + (boffset + x) * __bypp; + + if (interleave) { + addr /= 8; + } else { + addr /= 4; + } + + _mga_rwrite(M_CRTC_INDEX, 0x0D, (addr)&0xFF); + _mga_rwrite(M_CRTC_INDEX, 0x0C, (addr>>8)&0xFF); + _mga_ralter(M_CRTC_EXT_INDEX, 0, 0x0F, (addr>>16)&0x0F); + + while (waitVRT--) { + _mga_wait_retrace(); + } + } + + __scrollx = x; + __scrolly = y; +} + + + +/* Desc: set READ buffer + * + * In : either FRONT or BACK buffer + * Out : + * + * Note: + */ +void mga_set_readbuffer (int buffer) +{ + mga_readbuffer = buffer; + + mga_readbuffer_ptr = (mga_readbuffer == MGA_FRONTBUFFER) ? mga_frontbuffer_ptr : mga_backbuffer_ptr; +} + + + +/* Desc: set WRITE buffer + * + * In : either FRONT or BACK buffer + * Out : + * + * Note: + */ +void mga_set_writebuffer (int buffer) +{ + mga_writebuffer = buffer; + + mga_writebuffer_ptr = (mga_writebuffer == MGA_FRONTBUFFER) ? mga_frontbuffer_ptr : mga_backbuffer_ptr; + + mga_select(); + mga_fifo(1); + mga_outl(M_YDSTORG, mga_writebuffer_ptr); + + __operation = OP_NONE; +} + + + +/* Desc: swap buffers + * + * In : number of vertical retraces to wait + * Out : + * + * Note: + */ +void mga_swapbuffers (int swapinterval) +{ + /* flip the buffers */ + mga_backbuffer_ptr ^= __pagewidth; + mga_frontbuffer_ptr ^= __pagewidth; + + /* update READ/WRITE pointers */ + mga_set_readbuffer(mga_readbuffer); + mga_set_writebuffer(mga_writebuffer); + + /* make sure we always see the FRONT buffer */ + mga_display_start(mga_frontbuffer_ptr, __scrollx, __scrolly, swapinterval); +} + + + +/* Desc: color composition (w/o ALPHA) + * + * In : array of integers (R, G, B) + * Out : color + * + * Note: - + */ +static __inline int _mga_mixrgb8 (const unsigned char rgb[]) +{ + return (rgb[0]&0xe0)|((rgb[1]>>5)<<2)|(rgb[2]>>6); +} +static __inline int _mga_mixrgb15 (const unsigned char rgb[]) +{ + return ((rgb[0]>>3)<<10)|((rgb[1]>>3)<<5)|(rgb[2]>>3); +} +static __inline int _mga_mixrgb16 (const unsigned char rgb[]) +{ + return ((rgb[0]>>3)<<11)|((rgb[1]>>2)<<5)|(rgb[2]>>3); +} +static __inline int _mga_mixrgb32 (const unsigned char rgb[]) +{ + return (rgb[0]<<16)|(rgb[1]<<8)|(rgb[2]); +} + + + +/* Desc: color composition (w/o ALPHA) + replication + * + * In : array of integers (R, G, B) + * Out : color + * + * Note: - + */ +static int _mga_mixrgb8_full (const unsigned char rgb[]) +{ + int color = _mga_mixrgb8(rgb); + color |= color<<8; + return (color<<16) | color; +} +static int _mga_mixrgb15_full (const unsigned char rgb[]) +{ + int color = _mga_mixrgb15(rgb); + return (color<<16) | color; +} +static int _mga_mixrgb16_full (const unsigned char rgb[]) +{ + int color = _mga_mixrgb16(rgb); + return (color<<16) | color; +} +#define _mga_mixrgb32_full _mga_mixrgb32 + + + +/* Desc: putpixel + * + * In : pixel offset, pixel value + * Out : - + * + * Note: uses current write buffer + */ +static void _mga_putpixel8 (unsigned int offset, int color) +{ + hwptr_pokeb(mgaptr.linear_map, mga_writebuffer_ptr + offset, color); +} +#define _mga_putpixel15 _mga_putpixel16 +static void _mga_putpixel16 (unsigned int offset, int color) +{ + hwptr_pokew(mgaptr.linear_map, (mga_writebuffer_ptr + offset) * 2, color); +} +static void _mga_putpixel32 (unsigned int offset, int color) +{ + hwptr_pokel(mgaptr.linear_map, (mga_writebuffer_ptr + offset) * 4, color); +} + + + +/* Desc: pixel retrieval + * + * In : pixel offset + * Out : pixel value + * + * Note: uses current read buffer + */ +static __inline int _mga_getpixel8 (unsigned int offset) +{ + return hwptr_peekb(mgaptr.linear_map, mga_readbuffer_ptr + offset); +} +#define _mga_getpixel15 _mga_getpixel16 +static __inline int _mga_getpixel16 (unsigned int offset) +{ + return hwptr_peekw(mgaptr.linear_map, (mga_readbuffer_ptr + offset) * 2); +} +static __inline int _mga_getpixel32 (unsigned int offset) +{ + return hwptr_peekl(mgaptr.linear_map, (mga_readbuffer_ptr + offset) * 4); +} + + + +/* Desc: color decomposition + * + * In : pixel offset, array of integers to hold color components (R, G, B, A) + * Out : - + * + * Note: uses current read buffer + */ +static void _mga_getrgba8 (unsigned int offset, unsigned char rgba[4]) +{ + int c = _mga_getpixel8(offset); + rgba[0] = _rgb_scale_3[(c >> 5) & 0x7]; + rgba[1] = _rgb_scale_3[(c >> 2) & 0x7]; + rgba[2] = _rgb_scale_2[c & 0x3]; + rgba[3] = 255; +} +static void _mga_getrgba15 (unsigned int offset, unsigned char rgba[4]) +{ + int c = _mga_getpixel15(offset); + rgba[0] = _rgb_scale_5[(c >> 10) & 0x1F]; + rgba[1] = _rgb_scale_5[(c >> 5) & 0x1F]; + rgba[2] = _rgb_scale_5[c & 0x1F]; + rgba[3] = 255; +} +static void _mga_getrgba16 (unsigned int offset, unsigned char rgba[4]) +{ + int c = _mga_getpixel16(offset); + rgba[0] = _rgb_scale_5[(c >> 11) & 0x1F]; + rgba[1] = _rgb_scale_6[(c >> 5) & 0x3F]; + rgba[2] = _rgb_scale_5[c & 0x1F]; + rgba[3] = 255; +} +static void _mga_getrgba32 (unsigned int offset, unsigned char rgba[4]) +{ + int c = _mga_getpixel32(offset); + rgba[0] = c >> 16; + rgba[1] = c >> 8; + rgba[2] = c; + rgba[3] = c >> 24; +} + + + +/* Desc: RGB flat line + * + * In : + * Out : + * + * Note: + */ +void mga_draw_line_rgb_flat (const MGAvertex *v1, const MGAvertex *v2) +{ + unsigned long color; + int x1 = v1->win[0]; + int y1 = v1->win[1]; + int x2 = v2->win[0]; + int y2 = v2->win[1]; + + if ((x1 == x2) && (y1 == y2)) { + return; + } + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWLINE) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWLINE); + __operation = OP_DRAWLINE; + } + + color = mga_mixrgb_full(v2->color); + + /* draw the line */ + mga_fifo(3); + mga_outl(M_FCOL, color); + mga_outl(M_XYSTRT, (y1<<16) | x1); + mga_outl(M_XYEND | M_EXEC, (y2<<16) | x2); +} + + + +/* Desc: RGB flat Z-less line + * + * In : + * Out : + * + * Note: I never figured out "diagonal increments" + */ +void mga_draw_line_rgb_flat_zless (const MGAvertex *v1, const MGAvertex *v2) +{ + int z1, dz; + int x1 = v1->win[0]; + int y1 = v1->win[1]; + int x2 = v2->win[0]; + int y2 = v2->win[1]; + int dx = abs(x2 - x1); + int dy = abs(y2 - y1); + + if ((dx == 0) && (dy == 0)) { + return; + } + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWLINE_ZI) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWLINE_ZI); + __operation = OP_DRAWLINE_ZI; + } + + if (dx < dy) { + dx = dy; + } + + z1 = v1->win[2] << 15; + dz = ((v2->win[2] << 15) - z1) / dx; + + /* draw the line */ + mga_fifo(14); + mga_outl(M_DR0, z1); + mga_outl(M_DR2, dz); + mga_outl(M_DR3, dz); + mga_outl(M_DR4, v2->color[0] << 15); + mga_outl(M_DR6, 0); + mga_outl(M_DR7, 0); + mga_outl(M_DR8, v2->color[1] << 15); + mga_outl(M_DR10, 0); + mga_outl(M_DR11, 0); + mga_outl(M_DR12, v2->color[2] << 15); + mga_outl(M_DR14, 0); + mga_outl(M_DR15, 0); + mga_outl(M_XYSTRT, (y1<<16) | x1); + mga_outl(M_XYEND | M_EXEC, (y2<<16) | x2); +} + + + +/* Desc: RGB iterated line + * + * In : + * Out : + * + * Note: I never figured out "diagonal increments" + */ +void mga_draw_line_rgb_iter (const MGAvertex *v1, const MGAvertex *v2) +{ + int r1, g1, b1; + int dr, dg, db; + int x1 = v1->win[0]; + int y1 = v1->win[1]; + int x2 = v2->win[0]; + int y2 = v2->win[1]; + int dx = abs(x2 - x1); + int dy = abs(y2 - y1); + + if ((dx == 0) && (dy == 0)) { + return; + } + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWLINE_I) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWLINE_I); + __operation = OP_DRAWLINE_I; + } + + if (dx < dy) { + dx = dy; + } + + r1 = v1->color[0] << 15; + g1 = v1->color[1] << 15; + b1 = v1->color[2] << 15; + dr = ((v2->color[0] << 15) - r1) / dx; + dg = ((v2->color[1] << 15) - g1) / dx; + db = ((v2->color[2] << 15) - b1) / dx; + + /* draw the line */ + mga_fifo(11); + mga_outl(M_DR4, r1); + mga_outl(M_DR6, dr); + mga_outl(M_DR7, dr); + mga_outl(M_DR8, g1); + mga_outl(M_DR10, dg); + mga_outl(M_DR11, dg); + mga_outl(M_DR12, b1); + mga_outl(M_DR14, db); + mga_outl(M_DR15, db); + mga_outl(M_XYSTRT, (y1<<16) | x1); + mga_outl(M_XYEND | M_EXEC, (y2<<16) | x2); +} + + + +/* Desc: RGB iterated Z-less line + * + * In : + * Out : + * + * Note: I never figured out "diagonal increments" + */ +void mga_draw_line_rgb_iter_zless (const MGAvertex *v1, const MGAvertex *v2) +{ + int z1, dz; + int r1, g1, b1; + int dr, dg, db; + int x1 = v1->win[0]; + int y1 = v1->win[1]; + int x2 = v2->win[0]; + int y2 = v2->win[1]; + int dx = abs(x2 - x1); + int dy = abs(y2 - y1); + + if ((dx == 0) && (dy == 0)) { + return; + } + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWLINE_ZI) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWLINE_ZI); + __operation = OP_DRAWLINE_ZI; + } + + if (dx < dy) { + dx = dy; + } + + z1 = v1->win[2] << 15; + dz = ((v2->win[2] << 15) - z1) / dx; + + r1 = v1->color[0] << 15; + g1 = v1->color[1] << 15; + b1 = v1->color[2] << 15; + dr = ((v2->color[0] << 15) - r1) / dx; + dg = ((v2->color[1] << 15) - g1) / dx; + db = ((v2->color[2] << 15) - b1) / dx; + + /* draw the line */ + mga_fifo(14); + mga_outl(M_DR0, z1); + mga_outl(M_DR2, dz); + mga_outl(M_DR3, dz); + mga_outl(M_DR4, r1); + mga_outl(M_DR6, dr); + mga_outl(M_DR7, dr); + mga_outl(M_DR8, g1); + mga_outl(M_DR10, dg); + mga_outl(M_DR11, dg); + mga_outl(M_DR12, b1); + mga_outl(M_DR14, db); + mga_outl(M_DR15, db); + mga_outl(M_XYSTRT, (y1<<16) | x1); + mga_outl(M_XYEND | M_EXEC, (y2<<16) | x2); +} + + + +/* Desc: RGB flat triangle + * + * In : + * Out : + * + * Note: + */ +#define TAG mga_draw_tri_rgb_flat +#define CULL +#define SETUP_CODE \ + if (__operation != OP_DRAWTRAP) { \ + mga_fifo(1); \ + mga_outl(M_DWGCTL, OP_DRAWTRAP); \ + __operation = OP_DRAWTRAP; \ + } +#include "m_ttemp.h" + + + +/* Desc: RGB flat Z-less triangle + * + * In : + * Out : + * + * Note: + */ +#define TAG mga_draw_tri_rgb_flat_zless +#define CULL +#define INTERP_Z +#define SETUP_CODE \ + if (__operation != OP_DRAWTRAP_ZI) { \ + mga_fifo(1); \ + mga_outl(M_DWGCTL, OP_DRAWTRAP_ZI); \ + __operation = OP_DRAWTRAP_ZI; \ + } +#include "m_ttemp.h" + + + +/* Desc: RGB iterated triangle + * + * In : + * Out : + * + * Note: + */ +#define TAG mga_draw_tri_rgb_iter +#define CULL +#define INTERP_RGB +#define SETUP_CODE \ + if (__operation != OP_DRAWTRAP_I) { \ + mga_fifo(1); \ + mga_outl(M_DWGCTL, OP_DRAWTRAP_I); \ + __operation = OP_DRAWTRAP_I; \ + } +#include "m_ttemp.h" + + + +/* Desc: RGB iterated Z-less triangle + * + * In : + * Out : + * + * Note: + */ +#define TAG mga_draw_tri_rgb_iter_zless +#define CULL +#define INTERP_Z +#define INTERP_RGB +#define SETUP_CODE \ + if (__operation != OP_DRAWTRAP_ZI) { \ + mga_fifo(1); \ + mga_outl(M_DWGCTL, OP_DRAWTRAP_ZI); \ + __operation = OP_DRAWTRAP_ZI; \ + } +#include "m_ttemp.h" + + + +/* Desc: RGB flat rectangle + * + * In : + * Out : + * + * Note: + */ +void mga_draw_rect_rgb_flat (int left, int top, int width, int height, int color) +{ + if (__bpp == 8) { + color |= color << 8; + } + if (__bpp <= 16) { + color |= color << 16; + } + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWRECT) { + + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWRECT); + __operation = OP_DRAWRECT; + } + + /* draw the rectangle */ + mga_fifo(3); + mga_outl(M_FCOL, color); + mga_outl(M_FXBNDRY, ((left+width)<<16) | left); + mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | height); +} + + + +/* Desc: 32RGB textured span + * + * In : + * Out : + * + * Note: 0 <= width <= 7*1024 + */ +void mga_draw_span_rgb_tx32 (int left, int top, int width, const unsigned long *bitmap) +{ + int i; + + if (!width) { + return; + } + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWRECT_TX32BGR) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWRECT_TX32BGR); + __operation = OP_DRAWRECT_TX32BGR; + } + + /* draw the rectangle */ + mga_fifo(2); + mga_outl(M_FXBNDRY, ((left+width)<<16) | left); + mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | 1); + + /* copy data to the pseudo-dma window */ + i = 0; + do { + mga_outl(i, *bitmap); + bitmap++; + i += 4; + } while (--width); +} + + + +/* Desc: 24RGB textured span + * + * In : + * Out : + * + * Note: 0 <= width <= 7*1024 + */ +void mga_draw_span_rgb_tx24 (int left, int top, int width, const unsigned long *bitmap) +{ + int i; + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWRECT_TX24BGR) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWRECT_TX24BGR); + __operation = OP_DRAWRECT_TX24BGR; + } + + /* draw the rectangle */ + mga_fifo(2); + mga_outl(M_FXBNDRY, ((left+width)<<16) | left); + mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | 1); + + /* copy data to the pseudo-dma window */ + i = 0; + width = (width * 3 + 3) / 4; + while (width) { + mga_outl(i & (7 * 1024 - 1), *bitmap); + bitmap++; + i += 4; + width--; + } +} + + + +/* Desc: 32RGB textured rectangle + * + * In : + * Out : + * + * Note: + */ +void mga_draw_rect_rgb_tx32 (int left, int top, int width, int height, const unsigned long *bitmap) +{ + int i; + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWRECT_TX32BGR) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWRECT_TX32BGR); + __operation = OP_DRAWRECT_TX32BGR; + } + + /* draw the rectangle */ + mga_fifo(2); + mga_outl(M_FXBNDRY, ((left+width)<<16) | left); + mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | height); + + /* copy data to the pseudo-dma window */ + i = 0; + width *= height; + while (width) { + mga_outl(i & (7 * 1024 - 1), *bitmap); + bitmap++; + i += 4; + width--; + } +} + + + +/* Desc: 24RGB textured rectangle + * + * In : + * Out : + * + * Note: + */ +void mga_draw_rect_rgb_tx24 (int left, int top, int width, int height, const unsigned long *bitmap) +{ + int i; + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWRECT_TX24BGR) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWRECT_TX24BGR); + __operation = OP_DRAWRECT_TX24BGR; + } + + /* draw the rectangle */ + mga_fifo(2); + mga_outl(M_FXBNDRY, ((left+width)<<16) | left); + mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | height); + + /* copy data to the pseudo-dma window */ + i = 0; + width = (width * height * 3 + 3) / 4; + while (width) { + mga_outl(i & (7 * 1024 - 1), *bitmap); + bitmap++; + i += 4; + width--; + } +} + + + +/* Desc: copy 32RGB image to screen + * + * In : + * Out : + * + * Note: + */ +void mga_iload_32RGB (int left, int top, int width, int height, const unsigned long *bitmap) +{ + int i; + + mga_select(); + + /* set engine state */ + if (__operation != OP_ILOAD_32BGR) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_ILOAD_32BGR); + __operation = OP_ILOAD_32BGR; + } + + /* draw the bitmap */ + mga_fifo(5); + mga_outl(M_AR0, width-1); + mga_outl(M_AR3, 0); + mga_outl(M_AR5, 0); + mga_outl(M_FXBNDRY, ((left+width-1)<<16) | left); + mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | height); + + /* copy data to the pseudo-dma window */ + i = 0; + width *= height; + while (width) { + mga_outl(i & (7 * 1024 - 1), *bitmap); + bitmap++; + i += 4; + width--; + } +} + + + +/* Desc: copy 24RGB image to screen + * + * In : + * Out : + * + * Note: + */ +void mga_iload_24RGB (int left, int top, int width, int height, const unsigned long *bitmap) +{ + int i; + + mga_select(); + + /* set engine state */ + if (__operation != OP_ILOAD_24BGR) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_ILOAD_24BGR); + __operation = OP_ILOAD_24BGR; + } + + /* draw the bitmap */ + mga_fifo(5); + mga_outl(M_AR0, width-1); + mga_outl(M_AR3, 0); + mga_outl(M_AR5, 0); + mga_outl(M_FXBNDRY, ((left+width-1)<<16) | left); + mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | height); + + /* copy data to the pseudo-dma window */ + i = 0; + width = (width * height * 3 + 3) / 4; + while (width) { + mga_outl(i & (7 * 1024 - 1), *bitmap); + bitmap++; + i += 4; + width--; + } +} + + + +/* Desc: get Z-buffer value + * + * In : + * Out : + * + * Note: + */ +unsigned short mga_getz (int offset) +{ + return hwptr_peekw(mgaptr.linear_map, zorg + (mga_readbuffer_ptr + offset) * 2); +} + + + +/* Desc: put Z-buffer value + * + * In : + * Out : + * + * Note: + */ +void mga_setz (int offset, unsigned short z) +{ + hwptr_pokew(mgaptr.linear_map, zorg + (mga_writebuffer_ptr + offset) * 2, z); +} + + + +/* Desc: clear Z-buffer + * + * In : + * Out : + * + * Note: uses current write buffer + */ +static void _mga_clear_zed (int left, int top, int width, int height, unsigned short z) +{ + if (__bpp == 16) { + /* GPU store (high bandwidth) + * Hack alert: + * can cause problems with concurrent FB accesses + */ + mga_select(); + mga_fifo(1); + mga_outl(M_YDSTORG, mga_writebuffer_ptr + zorg/2); + mga_draw_rect_rgb_flat(left, top, width, height, z); + mga_fifo(1); + mga_outl(M_YDSTORG, mga_writebuffer_ptr); + } else { + /* CPU store */ + unsigned long i, zz = (z<<16) | z; + unsigned long ofs = zorg + (top * __pixwidth + left + mga_writebuffer_ptr) * 2; + hwptr_select(mgaptr.linear_map); + while (height--) { + i = width/2; + while (i--) { + hwptr_nspokel(mgaptr.linear_map, ofs, zz); + ofs += 4; + } + if (width & 1) { + hwptr_nspokew(mgaptr.linear_map, ofs, z); + ofs += 2; + } + ofs += (__pixwidth - width) * 2; + } + } +} + + + +/* Desc: clear color- and Z-buffer + * + * In : front = clear front buffer + * back = clear back buffer + * zed = clear depth buffer + * left = leftmost pixel to be cleared + * top = starting line + * width = number of pixels + * height = number of lines + * color = color to clear to + * z = z value (ignored if zed==0) + * Out : + * + * Note: + */ +void mga_clear (int front, int back, int zed, int left, int top, int width, int height, int color, unsigned short z) +{ + if (front) { + if (mga_writebuffer == MGA_FRONTBUFFER) { + mga_draw_rect_rgb_flat(left, top, width, height, color); + if (zed) { + _mga_clear_zed(left, top, width, height, z); + } + front = 0; + } + } + if (back) { + if (mga_writebuffer == MGA_BACKBUFFER) { + mga_draw_rect_rgb_flat(left, top, width, height, color); + if (zed) { + _mga_clear_zed(left, top, width, height, z); + } + back = 0; + } + } + if (front) { + int old = mga_writebuffer; + mga_set_writebuffer(MGA_FRONTBUFFER); + mga_draw_rect_rgb_flat(left, top, width, height, color); + if (zed) { + _mga_clear_zed(left, top, width, height, z); + } + mga_set_writebuffer(old); + front = 0; + } + if (back) { + int old = mga_writebuffer; + mga_set_writebuffer(MGA_BACKBUFFER); + mga_draw_rect_rgb_flat(left, top, width, height, color); + if (zed) { + _mga_clear_zed(left, top, width, height, z); + } + mga_set_writebuffer(old); + back = 0; + } +} + + + +/* Desc: Attempts to enter specified video mode. + * + * In : ptr to mode structure, number of pages, Z-buffer request, refresh rate + * Out : 0 if success + * + * Note: also set up the accelerator engine + */ +int mga_open (int width, int height, int bpp, int buffers, int zbuffer, int refresh) +{ + static int mill_strides[] = { 640, 768, 800, 960, 1024, 1152, 1280, 1600, 1920, 2048, 0 }; + unsigned int i, used; + MGA_MODE *p; + + if (mga_hw_init(&vram, &interleave, card_name) == 0) { + return -1; + } + + if ((p = mga_mode_find(width, height, bpp)) == NULL) { + return -1; + } + + __bpp = p->bpp; + __width = __pagewidth = p->xres; + __height = p->yres; + + if (buffers > 1) { + __pagewidth = _mga_fix_scans(__pagewidth); + __pixwidth = __pagewidth * buffers; + } else { + __pixwidth = __pagewidth; + __pixwidth = _mga_fix_scans(__pixwidth); + } + + for (i=0; mill_strides[i]; i++) { + if (__pixwidth <= mill_strides[i]) { + __pixwidth = mill_strides[i]; + break; + } + } + + __bypp = (__bpp+7)/8; + __bytwidth = __pixwidth * __bypp; + + /* compute used memory: framebuffer + zbuffer */ + used = __bytwidth * __height; + if (zbuffer) { + zorg = (used + 511) & ~511; + /* Hack alert: + * a 16-bit Z-buffer size is (stride_in_pixels * number_of_lines * 2) + * We cannot mess with the Z-buffer width, but we might decrease the + * number of lines, if the user requests less than (screen_height). For + * example with a 2MB card, one can have 640x480x16 display with 2 color + * buffers and Z-buffer if the maximum requested height is 339: + * Total = (640*480 * 2 + 640*339 * 2) * 2 + * However, this means the user must not write beyond the window's height + * and if we'll ever implement moveable windows, we'll have to reconsider + * this hack. + */ +#if 1 + __zheight = height; /* smaller */ + used = zorg + __pixwidth * 2 * __zheight; +#else + __zheight = __height; + used = zorg + __pixwidth * 2 * __zheight; +#endif + } + + if (mill_strides[i] && (vram>=used)) { + /* enter mode */ + mga_mode_switch(p, refresh); + /* change the scan line length */ + _mga_ralter(M_CRTC_INDEX, 0x14, 0x40, 0); /* disable DWORD */ + _mga_ralter(M_CRTC_INDEX, 0x17, 0x40, 0x40); /* wbmode = BYTE */ + if (interleave) { + _mga_rwrite(M_CRTC_INDEX, 0x13, __bytwidth/16); + _mga_ralter(M_CRTC_EXT_INDEX, 0, 0x30, ((__bytwidth/16)>>4)&0x30); + } else { + _mga_rwrite(M_CRTC_INDEX, 0x13, __bytwidth/8); + _mga_ralter(M_CRTC_EXT_INDEX, 0, 0x30, ((__bytwidth/8)>>4)&0x30); + } + } else { + return -1; + } + + /* setup buffers */ + mga_frontbuffer_ptr = 0; + if (buffers > 1) { + mga_backbuffer_ptr = __pagewidth; + mga_set_readbuffer(MGA_BACKBUFFER); + mga_set_writebuffer(MGA_BACKBUFFER); + } else { + mga_backbuffer_ptr = 0; + mga_set_readbuffer(MGA_FRONTBUFFER); + mga_set_writebuffer(MGA_FRONTBUFFER); + } + mga_display_start(mga_frontbuffer_ptr, __scrollx = 0, __scrolly = 0, 1); + + /* set up the accelerator engine */ + mga_select(); + + mga_fifo(8); + mga_outl(M_PITCH, __pixwidth); + mga_outl(M_PLNWT, 0xFFFFFFFF); + mga_outl(M_OPMODE, M_DMA_BLIT); + mga_outl(M_CXBNDRY, 0xFFFF0000); + mga_outl(M_YTOP, 0x00000000); + mga_outl(M_YBOT, 0x007FFFFF); + mga_outl(M_ZORG, zorg); + +#define INITPTR(bpp) \ + mga_putpixel = _mga_putpixel##bpp; \ + mga_getrgba = _mga_getrgba##bpp; \ + mga_getpixel = _mga_getpixel##bpp; \ + mga_mixrgb = _mga_mixrgb##bpp; \ + mga_mixrgb_full = _mga_mixrgb##bpp##_full + + switch (__bpp) { + case 8: + mga_outl(M_MACCESS, 0); + INITPTR(8); + break; + case 15: + mga_outl(M_MACCESS, 0x80000001); + INITPTR(15); + break; + case 16: + mga_outl(M_MACCESS, 1); + INITPTR(16); + break; + case 32: + mga_outl(M_MACCESS, 2); + INITPTR(32); + break; + } + +#undef INITPTR + + /* disable VGA aperture */ + i = mga_inb(M_MISC_R); + mga_outb(M_MISC_W, i & ~2); + + /* clear Z-buffer (if any) */ + if (zbuffer) { + unsigned long ofs = zorg; + unsigned long len = zorg + __pixwidth * 2 * __zheight; + + hwptr_select(mgaptr.linear_map); + for (; ofs +#include +#include +#include +#include +#include + +#include "../internal.h" +#include "mga_reg.h" +#include "mga_hw.h" + + + +/* Hack alert: + * these should really be externs + */ +/* PCI access routines */ +static int pci_find_device (int deviceID, int vendorID, int deviceIndex, int *handle); +static unsigned long pci_read_long (int handle, int index); +static void pci_write_long (int handle, int index, unsigned long value); + + + +/* PCI device identifiers */ +#define MATROX_VENDOR_ID 0x102B + +typedef enum { + MATROX_MILL_ID = 0x0519 +} MATROX_ID; + +static MATROX_ID matrox_id_list[] = { + MATROX_MILL_ID, + 0 +}; + + + +/* internal hardware data structures */ +#if !MGA_FARPTR +static int dirty; +#endif +static int bus_id; +static unsigned long reg40; +static unsigned long io_mem_base[4], linear_base; +static unsigned long io_mem_size[4], linear_size; +static MATROX_ID matrox_id; + + + +/* interface structures containing hardware pointer data */ +MGA_HWPTR mgaptr; + + + +/* Desc: create MMAP + * + * In : + * Out : + * + * Note: + */ +static int _create_mmap (__dpmi_paddr *m, unsigned long base, unsigned long size) +{ +#if MGA_FARPTR + int sel; + if (_create_selector(&sel, base, size)) { + return -1; + } + m->selector = sel; + m->offset32 = 0; +#else + m->selector = _my_ds(); + if (_create_linear_mapping(&m->offset32, base, size)) { + return -1; + } + m->offset32 -= __djgpp_base_address; +#endif + return 0; +} + + + +/* Desc: destroy MMAP + * + * In : + * Out : + * + * Note: + */ +static void _destroy_mmap (__dpmi_paddr *m) +{ +#if MGA_FARPTR + int sel = m->selector; + _remove_selector(&sel); +#else + m->offset32 += __djgpp_base_address; + _remove_linear_mapping(&m->offset32); +#endif + m->selector = 0; + m->offset32 = 0; +} + + + +/* Desc: Counts amount of installed RAM + * + * In : + * Out : + * + * Note: + */ +static int _mga_get_vram (MATROX_ID chip, unsigned long base) +{ + int ProbeSize = 8; + int SizeFound = 2; + unsigned char tmp; + int i; + __dpmi_paddr fb; + + switch (chip) { + case MATROX_MILL_ID: + ProbeSize = 8; + break; + } + + if (_create_mmap(&fb, base, ProbeSize*1024*1024)) { + return 0; + } + + /* turn MGA mode on - enable linear frame buffer (CRTCEXT3) */ + mga_select(); + mga_outb(M_CRTC_EXT_INDEX, 3); + tmp = mga_inb(M_CRTC_EXT_DATA); + mga_outb(M_CRTC_EXT_DATA, tmp | M_MGAMODE); + + /* write, read and compare method */ + for (i=ProbeSize; i>2; i-= 2) { + hwptr_pokeb(fb, i*1024*1024 - 1, 0xAA); + mga_select(); + mga_outb(M_CRTC_INDEX, 0); /* flush the cache */ + mga_inl(M_STATUS); /* delay */ + mga_inl(M_STATUS); /* delay */ + mga_inl(M_STATUS); /* delay */ + if (hwptr_peekb(fb, i*1024*1024 - 1) == 0xAA) { + SizeFound = i; + break; + } + } + + /* restore CRTCEXT3 state */ + mga_select(); + mga_outb(M_CRTC_EXT_INDEX, 3); + mga_outb(M_CRTC_EXT_DATA, tmp); + + _destroy_mmap(&fb); + + return SizeFound*1024*1024; +} + + + +/* Desc: Frees all resources allocated by MGA init code. + * + * In : + * Out : + * + * Note: + */ +void mga_hw_fini (void) +{ + int i; + + pci_write_long(bus_id, 0x40, reg40); + + for (i=0; i<4; i++) { + _destroy_mmap(&mgaptr.io_mem_map[i]); + } + + _destroy_mmap(&mgaptr.linear_map); + +#if !MGA_FARPTR + if (dirty) { + __djgpp_nearptr_disable(); + dirty = FALSE; + } +#endif + + matrox_id = 0; +} + + + +/* Desc: Attempts to detect MGA. + * + * In : + * Out : + * + * Note: The first thing ever to be called. This is in charge of filling in + * the driver header with all the required information and function + * pointers. We do not yet have access to the video memory, so we can't + * talk directly to the card. + */ +int mga_hw_init (unsigned long *vram, int *interleave, char *name) +{ + int i; + unsigned long pci_base[2]; + + if (matrox_id) { + return matrox_id; + } + +#if !MGA_FARPTR + /* enable nearptr access */ + if (_crt0_startup_flags & _CRT0_FLAG_NEARPTR) { + dirty = FALSE; + } else { + if (__djgpp_nearptr_enable() == 0) + return NULL; + + dirty = TRUE; + } +#endif + + /* find PCI device */ + matrox_id = 0; + + for (bus_id=0, i=0; matrox_id_list[i]; i++) { + if (pci_find_device(matrox_id_list[i], MATROX_VENDOR_ID, 0, &bus_id)) { + matrox_id = matrox_id_list[i]; + break; + } + } + + /* set up the card name */ + switch (matrox_id) { + case MATROX_MILL_ID: + if (name) strcpy(name, "Millennium"); + break; + default: + matrox_id = 0; + return -1; + } + + reg40 = pci_read_long(bus_id, 0x40); +#if 0 /* overclock a little :) */ + { + int rfhcnt = (reg40 >> 16) & 0xF; + if ((reg40 & 0x200000) && (rfhcnt < 0xC)) { + pci_write_long(bus_id, 0x40, (reg40 & 0xFFF0FFFF) | 0x000C0000); + } + } +#endif + + /* read hardware configuration data */ + for (i=0; i<2; i++) + pci_base[i] = pci_read_long(bus_id, 16+i*4); + + /* work out the linear framebuffer and MMIO addresses */ + if (matrox_id == MATROX_MILL_ID) { + if (pci_base[0]) + io_mem_base[0] = pci_base[0] & 0xFFFFC000; + + if (pci_base[1]) + linear_base = pci_base[1] & 0xFF800000; + } + + if (!linear_base || !io_mem_base[0]) + return NULL; + + /* deal with the memory mapping crap */ + io_mem_size[0] = 0x4000; + + for (i=0; i<4; i++) { + if (io_mem_base[i]) { + if (_create_mmap(&mgaptr.io_mem_map[i], io_mem_base[i], io_mem_size[i])) { + mga_hw_fini(); + return NULL; + } + } + } + + *vram = linear_size = _mga_get_vram(matrox_id, linear_base); + + if (_create_mmap(&mgaptr.linear_map, linear_base, linear_size)) { + mga_hw_fini(); + return NULL; + } + + /* fill in user data */ + *interleave = linear_size > 2*1024*1024; + + return matrox_id; +} + + + +/* PCI routines added by SET */ +#define PCIAddr 0xCF8 +#define PCIData 0xCFC +#define PCIEnable 0x80000000 + + + +/* FindPCIDevice: + * Replacement for the INT 1A - PCI BIOS v2.0c+ - FIND PCI DEVICE, AX = B102h + * + * Note: deviceIndex is because a card can hold more than one PCI chip. + * + * Searches the board of the vendor supplied in vendorID with + * identification number deviceID and index deviceIndex (normally 0). + * The value returned in handle can be used to access the PCI registers + * of this board. + * + * Return: 1 if found 0 if not found. + */ +static int pci_find_device (int deviceID, int vendorID, int deviceIndex, int *handle) +{ + int model, vendor, card, device; + unsigned value, full_id, bus, busMax; + + deviceIndex <<= 8; + + /* for each PCI bus */ + for (bus=0, busMax=0x10000; bus> 16; + + if (vendor != 0xFFFF) { + /* is this the one we want? */ + if ((deviceID == model) && (vendorID == vendor)) { + *handle = value; + return 1; + } + + /* is it a bridge to a secondary bus? */ + outportl(PCIAddr, value | 8); + + if (((inportl(PCIData) >> 16) == 0x0600) || (full_id==0x00011011)) + busMax += 0x10000; + } + } + } + + return 0; +} + + + +/* Desc: + * + * In : + * Out : + * + * Note: + */ +static unsigned long pci_read_long (int handle, int index) +{ + outportl(PCIAddr, PCIEnable | handle | index); + return inportl(PCIData); +} + + + +/* Desc: + * + * In : + * Out : + * + * Note: + */ +static void pci_write_long (int handle, int index, unsigned long value) +{ + outportl(PCIAddr, PCIEnable | handle | index); + outportl(PCIData, value); +} diff --git a/src/mesa/drivers/dos/mga/mga_hw.h b/src/mesa/drivers/dos/mga/mga_hw.h new file mode 100644 index 00000000000..246ed9c6ad7 --- /dev/null +++ b/src/mesa/drivers/dos/mga/mga_hw.h @@ -0,0 +1,113 @@ +/* + * Mesa 3-D graphics library + * Version: 5.0 + * + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa 5.0 -- MGA2064W HW mapping + * + * Copyright (c) 2003 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef MGA_HW_included +#define MGA_HW_included + + + +/* set this to zero to use near pointers */ +#define MGA_FARPTR 1 + + + +/* access macros */ +#if MGA_FARPTR + +#include + +#define hwptr_pokeb(ptr, off, val) _farpokeb((ptr).selector, (ptr).offset32+(off), (val)) +#define hwptr_pokew(ptr, off, val) _farpokew((ptr).selector, (ptr).offset32+(off), (val)) +#define hwptr_pokel(ptr, off, val) _farpokel((ptr).selector, (ptr).offset32+(off), (val)) + +#define hwptr_peekb(ptr, off) _farpeekb((ptr).selector, (ptr).offset32+(off)) +#define hwptr_peekw(ptr, off) _farpeekw((ptr).selector, (ptr).offset32+(off)) +#define hwptr_peekl(ptr, off) _farpeekl((ptr).selector, (ptr).offset32+(off)) + +#define hwptr_select(ptr) _farsetsel((ptr).selector) +#define hwptr_unselect(ptr) (ptr).selector = _fargetsel() + +#define hwptr_nspokeb(ptr, off, val) _farnspokeb((ptr).offset32+(off), (val)) +#define hwptr_nspokew(ptr, off, val) _farnspokew((ptr).offset32+(off), (val)) +#define hwptr_nspokel(ptr, off, val) _farnspokel((ptr).offset32+(off), (val)) + +#define hwptr_nspeekb(ptr, off) _farnspeekb((ptr).offset32+(off)) +#define hwptr_nspeekw(ptr, off) _farnspeekw((ptr).offset32+(off)) +#define hwptr_nspeekl(ptr, off) _farnspeekl((ptr).offset32+(off)) + +#else + +#define hwptr_pokeb(ptr, off, val) *((volatile unsigned char *)((ptr).offset32+(off))) = (val) +#define hwptr_pokew(ptr, off, val) *((volatile unsigned short *)((ptr).offset32+(off))) = (val) +#define hwptr_pokel(ptr, off, val) *((volatile unsigned long *)((ptr).offset32+(off))) = (val) + +#define hwptr_peekb(ptr, off) (*((volatile unsigned char *)((ptr).offset32+(off)))) +#define hwptr_peekw(ptr, off) (*((volatile unsigned short *)((ptr).offset32+(off)))) +#define hwptr_peekl(ptr, off) (*((volatile unsigned long *)((ptr).offset32+(off)))) + +#define hwptr_select(ptr) +#define hwptr_unselect(ptr) + +#define hwptr_nspokeb(ptr, off, val) *((volatile unsigned char *)((ptr).offset32+(off))) = (val) +#define hwptr_nspokew(ptr, off, val) *((volatile unsigned short *)((ptr).offset32+(off))) = (val) +#define hwptr_nspokel(ptr, off, val) *((volatile unsigned long *)((ptr).offset32+(off))) = (val) + +#define hwptr_nspeekb(ptr, off) (*((volatile unsigned char *)((ptr).offset32+(off)))) +#define hwptr_nspeekw(ptr, off) (*((volatile unsigned short *)((ptr).offset32+(off)))) +#define hwptr_nspeekl(ptr, off) (*((volatile unsigned long *)((ptr).offset32+(off)))) + +#endif + + + +/* helpers for accessing the Matrox registers */ +#define mga_select() hwptr_select(mgaptr.io_mem_map[0]) +#define mga_inb(addr) hwptr_nspeekb(mgaptr.io_mem_map[0], addr) +#define mga_inw(addr) hwptr_nspeekw(mgaptr.io_mem_map[0], addr) +#define mga_inl(addr) hwptr_nspeekl(mgaptr.io_mem_map[0], addr) +#define mga_outb(addr, val) hwptr_nspokeb(mgaptr.io_mem_map[0], addr, val) +#define mga_outw(addr, val) hwptr_nspokew(mgaptr.io_mem_map[0], addr, val) +#define mga_outl(addr, val) hwptr_nspokel(mgaptr.io_mem_map[0], addr, val) + + + +typedef struct MGA_HWPTR { + __dpmi_paddr io_mem_map[4], linear_map; +} MGA_HWPTR; + +extern MGA_HWPTR mgaptr; + +void mga_hw_fini (void); +int mga_hw_init (unsigned long *vram, int *interleave, char *name); + +#endif diff --git a/src/mesa/drivers/dos/mga/mga_mode.c b/src/mesa/drivers/dos/mga/mga_mode.c new file mode 100644 index 00000000000..33f47a6486e --- /dev/null +++ b/src/mesa/drivers/dos/mga/mga_mode.c @@ -0,0 +1,231 @@ +/* + * Mesa 3-D graphics library + * Version: 5.0 + * + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa 5.0 -- MGA2064W mode switching + * + * Copyright (c) 2003 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include +#include +#include +#include +#include +#include +#include + +#include "../internal.h" +#include "mga_mode.h" + + + +static MGA_MODE oldmode; +static MGA_MODE modes[64]; + + + +/* + * VESA info + */ +#define V_SIGN 0 +#define V_MINOR 4 +#define V_MAJOR 5 +#define V_OEM_OFS 6 +#define V_OEM_SEG 8 +#define V_MODE_OFS 14 +#define V_MODE_SEG 16 +#define V_MEMORY 18 + +/* + * mode info + */ +#define M_ATTR 0 +#define M_GRAN 4 +#define M_SCANLEN 16 +#define M_XRES 18 +#define M_YRES 20 +#define M_BPP 25 +#define M_RED 31 +#define M_GREEN 33 +#define M_BLUE 35 +#define M_PHYS_PTR 40 + + + +/* Desc: get available modes + * + * In : - + * Out : linear modes list ptr + * + * Note: shouldn't use VESA... + */ +static MGA_MODE *_mga_mode_check (void) +{ + __dpmi_regs r; + word16 *p; + MGA_MODE *q; + char vesa_info[512], tmp[512]; + + _farpokel(_stubinfo->ds_selector, 0, 0x32454256); + r.x.ax = 0x4f00; + r.x.di = 0; + r.x.es = _stubinfo->ds_segment; + __dpmi_int(0x10, &r); + movedata(_stubinfo->ds_selector, 0, _my_ds(), (unsigned)vesa_info, 512); + if ((r.x.ax!=0x004f) || ((_32_ vesa_info[V_SIGN])!=0x41534556)) { + return NULL; + } + + p = (word16 *)(((_16_ vesa_info[V_MODE_SEG])<<4) + (_16_ vesa_info[V_MODE_OFS])); + q = modes; + do { + if ((q->mode=_farpeekw(__djgpp_dos_sel, (unsigned long)(p++)))==0xffff) { + break; + } + + r.x.ax = 0x4f01; + r.x.cx = q->mode; + r.x.di = 512; + r.x.es = _stubinfo->ds_segment; + __dpmi_int(0x10, &r); + movedata(_stubinfo->ds_selector, 512, _my_ds(), (unsigned)tmp, 256); + switch (tmp[M_BPP]) { + case 16: + q->bpp = tmp[M_RED] + tmp[M_GREEN] + tmp[M_BLUE]; + break; + case 8: + case 15: + case 24: + case 32: + q->bpp = tmp[M_BPP]; + break; + default: + q->bpp = 0; + } + if ((r.x.ax==0x004f) && ((tmp[M_ATTR]&0x11)==0x11) && q->bpp && (tmp[M_ATTR]&0x80)) { + q->xres = _16_ tmp[M_XRES]; + q->yres = _16_ tmp[M_YRES]; + q->mode |= 0x4000; + q++; + } + } while (TRUE); + + return modes; +} + + + +/* Desc: save current mode + * + * In : ptr to mode structure + * Out : 0 if success + * + * Note: shouldn't use VESA... + */ +static int _mga_mode_save (MGA_MODE *p) +{ + __asm("\n\ + movw $0x4f03, %%ax \n\ + int $0x10 \n\ + movl %%ebx, %0 \n\ + ":"=g"(p->mode)::"%eax", "%ebx"); + return 0; +} + + + +/* Desc: switch to specified mode + * + * In : ptr to mode structure, refresh rate + * Out : 0 if success + * + * Note: shouldn't use VESA... + */ +int mga_mode_switch (MGA_MODE *p, int refresh) +{ + if (oldmode.mode == 0) { + _mga_mode_save(&oldmode); + } + __asm("movw $0x4f02, %%ax; int $0x10"::"b"(p->mode):"%eax"); + return 0; + + (void)refresh; /* silence compiler warning */ +} + + + +/* Desc: restore to the mode prior to first call to `mga_switch' + * + * In : - + * Out : 0 if success + * + * Note: shouldn't use VESA... + */ +int mga_mode_restore (void) +{ + if (oldmode.mode != 0) { + __asm("movw $0x4f02, %%ax; int $0x10"::"b"(oldmode.mode):"%eax"); + oldmode.mode = 0; + } + return 0; +} + + + +/* Desc: return suitable mode + * + * In : width, height, bpp + * Out : ptr to mode structure + * + * Note: - + */ +MGA_MODE *mga_mode_find (int width, int height, int bpp) +{ + static MGA_MODE *q = NULL; + + MGA_MODE *p; + unsigned int min; + + if (q == NULL) { + if ((q = _mga_mode_check()) == NULL) { + return NULL; + } + } + + /* search for a mode that fits our request */ + for (min=-1, p=NULL; q->mode!=0xffff; q++) { + if ((q->xres>=width) && (q->yres>=height) && (q->bpp==bpp)) { + if (min>=(unsigned)(q->xres*q->yres)) { + min = q->xres*q->yres; + p = q; + } + } + } + + return p; +} diff --git a/src/mesa/drivers/dos/mga/mga_mode.h b/src/mesa/drivers/dos/mga/mga_mode.h new file mode 100644 index 00000000000..4049bd8fd2d --- /dev/null +++ b/src/mesa/drivers/dos/mga/mga_mode.h @@ -0,0 +1,47 @@ +/* + * Mesa 3-D graphics library + * Version: 5.0 + * + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa 5.0 -- MGA2064W mode switching + * + * Copyright (c) 2003 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef MGA_MODE_included +#define MGA_MODE_included + +typedef struct MGA_MODE { + int mode; + int xres, yres; + int bpp; +} MGA_MODE; + +int mga_mode_switch (MGA_MODE *p, int refresh); +int mga_mode_restore (void); +MGA_MODE *mga_mode_find (int width, int height, int bpp); + +#endif diff --git a/src/mesa/drivers/dos/mga/mga_reg.h b/src/mesa/drivers/dos/mga/mga_reg.h new file mode 100644 index 00000000000..73d22de2b87 --- /dev/null +++ b/src/mesa/drivers/dos/mga/mga_reg.h @@ -0,0 +1,207 @@ +/* + * Mesa 3-D graphics library + * Version: 5.0 + * + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa 5.0 -- MGA2064W register mnemonics + * + * Copyright (c) 2003 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef MGA_REG_H_included +#define MGA_REG_H_included + +/* Matrox hardware registers: */ +#define M_AR0 0x1C60 +#define M_AR1 0x1C64 +#define M_AR2 0x1C68 +#define M_AR3 0x1C6C +#define M_AR4 0x1C70 +#define M_AR5 0x1C74 +#define M_AR6 0x1C78 +#define M_BCOL 0x1C20 +#define M_CXBNDRY 0x1C80 +#define M_CXLEFT 0x1CA0 +#define M_CXRIGHT 0x1CA4 +#define M_DR0 0x1CC0 +#define M_DR2 0x1CC8 +#define M_DR3 0x1CCC +#define M_DR4 0x1CD0 +#define M_DR6 0x1CD8 +#define M_DR7 0x1CDC +#define M_DR8 0x1CE0 +#define M_DR10 0x1CE8 +#define M_DR11 0x1CEC +#define M_DR12 0x1CF0 +#define M_DR14 0x1CF8 +#define M_DR15 0x1CFC +#define M_DWGCTL 0x1C00 +#define M_FCOL 0x1C24 +#define M_FIFOSTATUS 0x1E10 +#define M_FXBNDRY 0x1C84 +#define M_FXLEFT 0x1CA8 +#define M_FXRIGHT 0x1CAC +#define M_ICLEAR 0x1E18 +#define M_IEN 0x1E1C +#define M_LEN 0x1C5C +#define M_MACCESS 0x1C04 +#define M_OPMODE 0x1E54 +#define M_PAT0 0x1C10 +#define M_PAT1 0x1C14 +#define M_PITCH 0x1C8C +#define M_PLNWT 0x1C1C +#define M_RESET 0x1E40 +#define M_SGN 0x1C58 +#define M_SHIFT 0x1C50 +#define M_SRC0 0x1C30 +#define M_SRC1 0x1C34 +#define M_SRC2 0x1C38 +#define M_SRC3 0x1C3C +#define M_STATUS 0x1E14 +#define M_VCOUNT 0x1E20 +#define M_XDST 0x1CB0 +#define M_XYEND 0x1C44 +#define M_XYSTRT 0x1C40 +#define M_YBOT 0x1C9C +#define M_YDST 0x1C90 +#define M_YDSTLEN 0x1C88 +#define M_YDSTORG 0x1C94 +#define M_YTOP 0x1C98 +#define M_ZORG 0x1C0C + +#define M_EXEC 0x0100 + +/* DWGCTL: opcod */ +#define M_DWG_LINE_OPEN 0x0 +#define M_DWG_AUTOLINE_OPEN 0x1 +#define M_DWG_LINE_CLOSE 0x2 +#define M_DWG_AUTOLINE_CLOSE 0x3 +#define M_DWG_TRAP 0x4 +#define M_DWG_TEXTURE_TRAP 0x5 +#define M_DWG_BITBLT 0x8 +#define M_DWG_FBITBLT 0xC +#define M_DWG_ILOAD 0x9 +#define M_DWG_ILOAD_SCALE 0xD +#define M_DWG_ILOAD_FILTER 0xF +#define M_DWG_IDUMP 0xA + +/* DWGCTL: atype */ +#define M_DWG_RPL (0x0 << 4) +#define M_DWG_RSTR (0x1 << 4) +#define M_DWG_ZI (0x3 << 4) +#define M_DWG_BLK (0x4 << 4) +#define M_DWG_I (0x7 << 4) + +/* DWGCTL: linear */ +#define M_DWG_LINEAR (0x1 << 7) + +/* DWGCTL: zmode */ +#define M_DWG_NOZCMP (0x0 << 8) +#define M_DWG_ZE (0x2 << 8) +#define M_DWG_ZNE (0x3 << 8) +#define M_DWG_ZLT (0x4 << 8) +#define M_DWG_ZLTE (0x5 << 8) +#define M_DWG_ZGT (0x6 << 8) +#define M_DWG_ZGTE (0x7 << 8) + +/* DWGCTL: solid */ +#define M_DWG_SOLID (0x1 << 11) + +/* DWGCTL: arzero */ +#define M_DWG_ARZERO (0x1 << 12) + +/* DWGCTL: sgnzero */ +#define M_DWG_SGNZERO (0x1 << 13) + +/* DWGCTL: shiftzero */ +#define M_DWG_SHFTZERO (0x1 << 14) + +/* DWGCTL: bop */ +#define M_DWG_BOP_XOR (0x6 << 16) +#define M_DWG_BOP_AND (0x8 << 16) +#define M_DWG_BOP_SRC (0xC << 16) +#define M_DWG_BOP_OR (0xE << 16) + +/* DWGCTL: trans */ +#define M_DWG_TRANS_0 (0x0 << 20) +#define M_DWG_TRANS_1 (0x1 << 20) +#define M_DWG_TRANS_2 (0x2 << 20) +#define M_DWG_TRANS_3 (0x3 << 20) +#define M_DWG_TRANS_4 (0x4 << 20) +#define M_DWG_TRANS_5 (0x5 << 20) +#define M_DWG_TRANS_6 (0x6 << 20) +#define M_DWG_TRANS_7 (0x7 << 20) +#define M_DWG_TRANS_8 (0x8 << 20) +#define M_DWG_TRANS_9 (0x9 << 20) +#define M_DWG_TRANS_A (0xA << 20) +#define M_DWG_TRANS_B (0xB << 20) +#define M_DWG_TRANS_C (0xC << 20) +#define M_DWG_TRANS_D (0xD << 20) +#define M_DWG_TRANS_E (0xE << 20) +#define M_DWG_TRANS_F (0xF << 20) + +/* DWGCTL: bltmod */ +#define M_DWG_BMONOLEF (0x0 << 25) +#define M_DWG_BMONOWF (0x4 << 25) +#define M_DWG_BPLAN (0x1 << 25) +#define M_DWG_BFCOL (0x2 << 25) +#define M_DWG_BUYUV (0xE << 25) +#define M_DWG_BU32BGR (0x3 << 25) +#define M_DWG_BU32RGB (0x7 << 25) +#define M_DWG_BU24BGR (0xB << 25) +#define M_DWG_BU24RGB (0xF << 25) + +/* DWGCTL: pattern */ +#define M_DWG_PATTERN (0x1 << 29) + +/* DWGCTL: transc */ +#define M_DWG_TRANSC (0x1 << 30) + +/* OPMODE: */ +#define M_DMA_GENERAL (0x0 << 2) +#define M_DMA_BLIT (0x1 << 2) +#define M_DMA_VECTOR (0x2 << 2) + +/* SGN: */ +#define M_SDXL (0x1 << 1) +#define M_SDXR (0x1 << 5) + + + +/* VGAREG */ +#define M_CRTC_INDEX 0x1FD4 +#define M_CRTC_DATA 0x1FD5 + +#define M_CRTC_EXT_INDEX 0x1FDE +#define M_CRTC_EXT_DATA 0x1FDF + +#define M_MISC_R 0x1FCC +#define M_MISC_W 0x1FC2 + +/* CRTCEXT3: */ +#define M_MGAMODE (0x1 << 7) + +#endif diff --git a/src/mesa/drivers/dos/vesa.c b/src/mesa/drivers/dos/vesa.c new file mode 100644 index 00000000000..eebaa5006b9 --- /dev/null +++ b/src/mesa/drivers/dos/vesa.c @@ -0,0 +1,533 @@ +/* + * Mesa 3-D graphics library + * Version: 4.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. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "video.h" +#include "vesa.h" + + + +static vl_mode modes[128]; + +static word16 vesa_ver; +static int banked_selector, linear_selector; +static int oldmode = -1; + +static int vesa_color_precision = 6; + +static word16 *vesa_pmcode; +unsigned int vesa_gran_mask, vesa_gran_shift; + + + +/* + * VESA info + */ +#define V_SIGN 0 +#define V_MINOR 4 +#define V_MAJOR 5 +#define V_OEM_OFS 6 +#define V_OEM_SEG 8 +#define V_MODE_OFS 14 +#define V_MODE_SEG 16 +#define V_MEMORY 18 + +/* + * mode info + */ +#define M_ATTR 0 +#define M_GRAN 4 +#define M_SCANLEN 16 +#define M_XRES 18 +#define M_YRES 20 +#define M_BPP 25 +#define M_RED 31 +#define M_GREEN 33 +#define M_BLUE 35 +#define M_PHYS_PTR 40 + +/* + * VESA 3.0 CRTC timings structure + */ +typedef struct CRTCInfoBlock { + unsigned short HorizontalTotal; + unsigned short HorizontalSyncStart; + unsigned short HorizontalSyncEnd; + unsigned short VerticalTotal; + unsigned short VerticalSyncStart; + unsigned short VerticalSyncEnd; + unsigned char Flags; + unsigned long PixelClock; /* units of Hz */ + unsigned short RefreshRate; /* units of 0.01 Hz */ + unsigned char reserved[40]; +} __PACKED__ CRTCInfoBlock; + +#define HNEG (1 << 2) +#define VNEG (1 << 3) +#define DOUBLESCAN (1 << 0) + + + +/* Desc: Attempts to detect VESA, check video modes and create selectors. + * + * In : - + * Out : mode array + * + * Note: - + */ +static vl_mode *vesa_init (void) +{ + __dpmi_regs r; + word16 *p; + vl_mode *q; + char vesa_info[512], tmp[512]; + int maxsize = 0; + word32 linearfb = 0; + + if (vesa_ver) { + return modes; + } + + _farpokel(_stubinfo->ds_selector, 0, 0x32454256); + r.x.ax = 0x4f00; + r.x.di = 0; + r.x.es = _stubinfo->ds_segment; + __dpmi_int(0x10, &r); + movedata(_stubinfo->ds_selector, 0, _my_ds(), (unsigned)vesa_info, 512); + if ((r.x.ax!=0x004f) || ((_32_ vesa_info[V_SIGN])!=0x41534556)) { + return NULL; + } + + p = (word16 *)(((_16_ vesa_info[V_MODE_SEG])<<4) + (_16_ vesa_info[V_MODE_OFS])); + q = modes; + do { + if ((q->mode=_farpeekw(__djgpp_dos_sel, (unsigned long)(p++)))==0xffff) { + break; + } + + r.x.ax = 0x4f01; + r.x.cx = q->mode; + r.x.di = 512; + r.x.es = _stubinfo->ds_segment; + __dpmi_int(0x10, &r); + movedata(_stubinfo->ds_selector, 512, _my_ds(), (unsigned)tmp, 256); + switch (tmp[M_BPP]) { + case 16: + q->bpp = tmp[M_RED] + tmp[M_GREEN] + tmp[M_BLUE]; + break; + case 8: + case 15: + case 24: + case 32: + q->bpp = tmp[M_BPP]; + break; + default: + q->bpp = 0; + } + if ((r.x.ax==0x004f) && ((tmp[M_ATTR]&0x11)==0x11) && q->bpp) { + q->xres = _16_ tmp[M_XRES]; + q->yres = _16_ tmp[M_YRES]; + q->scanlen = _16_ tmp[M_SCANLEN]; + q->gran = (_16_ tmp[M_GRAN])<<10; + if (tmp[M_ATTR]&0x80) { +#if 0 + *(q+1) = *q++; +#else + vl_mode *q1 = q + 1; + *q1 = *q++; +#endif + linearfb = _32_ tmp[M_PHYS_PTR]; + q->mode |= 0x4000; + } + if (maxsize<(q->scanlen*q->yres)) { + maxsize = q->scanlen*q->yres; + } + q++; + } + } while (TRUE); + + if (q==modes) { + return NULL; + } + if (linearfb) { + maxsize = ((maxsize+0xfffUL)&~0xfffUL); + if (_create_selector(&linear_selector, linearfb, maxsize)) { + return NULL; + } + } + if (_create_selector(&banked_selector, 0xa0000, modes[0].gran)) { + _remove_selector(&linear_selector); + return NULL; + } + + for (q=modes; q->mode!=0xffff; q++) { + q->sel = (q->mode&0x4000) ? linear_selector : banked_selector; + } + + if (vesa_info[V_MAJOR] >= 2) { + r.x.ax = 0x4f0a; + r.x.bx = 0; + __dpmi_int(0x10, &r); + if (r.x.ax == 0x004f) { + vesa_pmcode = (word16 *)malloc(r.x.cx); + movedata(__djgpp_dos_sel, (r.x.es << 4) + r.x.di, _my_ds(), (unsigned)vesa_pmcode, r.x.cx); + if (vesa_pmcode[3]) { + p = (word16 *)((long)vesa_pmcode + vesa_pmcode[3]); + while (*p++ != 0xffff) ; + } else { + p = NULL; + } + if (p && (*p != 0xffff)) { + free(vesa_pmcode); + vesa_pmcode = NULL; + } else { + vesa_swbank = (void *)((long)vesa_pmcode + vesa_pmcode[0]); + } + } + } + + vesa_ver = _16_ vesa_info[V_MINOR]; + return modes; +} + + + +/* Desc: Frees all resources allocated by VESA init code. + * + * In : - + * Out : - + * + * Note: - + */ +static void vesa_fini (void) +{ + if (vesa_ver) { + _remove_selector(&linear_selector); + _remove_selector(&banked_selector); + if (vesa_pmcode != NULL) { + free(vesa_pmcode); + vesa_pmcode = NULL; + } + } +} + + + +/* Desc: Uses VESA 3.0 function 0x4F0B to find the closest pixel clock to the requested value. + * + * In : mode, clock + * Out : desired clock + * + * Note: - + */ +static unsigned long _closest_pixclk (int mode_no, unsigned long vclk) +{ + __dpmi_regs r; + + r.x.ax = 0x4F0B; + r.h.bl = 0; + r.d.ecx = vclk; + r.x.dx = mode_no; + __dpmi_int(0x10, &r); + + return (r.x.ax==0x004f) ? r.d.ecx : 0; +} + + + +/* Desc: Calculates CRTC mode timings. + * + * In : crtc block, geometry, adjust + * Out : + * + * Note: + */ +static void _crtc_timing (CRTCInfoBlock *crtc, int xres, int yres, int xadjust, int yadjust) +{ + int HTotal, VTotal; + int HDisp, VDisp; + int HSS, VSS; + int HSE, VSE; + int HSWidth, VSWidth; + int SS, SE; + int doublescan = FALSE; + + if (yres < 400) { + doublescan = TRUE; + yres *= 2; + } + + HDisp = xres; + HTotal = (int)(HDisp * 1.27) & ~0x7; + HSWidth = (int)((HTotal - HDisp) / 5) & ~0x7; + HSS = HDisp + 16; + HSE = HSS + HSWidth; + VDisp = yres; + VTotal = VDisp * 1.07; + VSWidth = (VTotal / 100) + 1; + VSS = VDisp + ((int)(VTotal - VDisp) / 5) + 1; + VSE = VSS + VSWidth; + + SS = HSS + xadjust; + SE = HSE + xadjust; + + if (xadjust < 0) { + if (SS < (HDisp + 8)) { + SS = HDisp + 8; + SE = SS + HSWidth; + } + } else { + if ((HTotal - 24) < SE) { + SE = HTotal - 24; + SS = SE - HSWidth; + } + } + + HSS = SS; + HSE = SE; + + SS = VSS + yadjust; + SE = VSE + yadjust; + + if (yadjust < 0) { + if (SS < (VDisp + 3)) { + SS = VDisp + 3; + SE = SS + VSWidth; + } + } else { + if ((VTotal - 4) < SE) { + SE = VTotal - 4; + SS = SE - VSWidth; + } + } + + VSS = SS; + VSE = SE; + + crtc->HorizontalTotal = HTotal; + crtc->HorizontalSyncStart = HSS; + crtc->HorizontalSyncEnd = HSE; + crtc->VerticalTotal = VTotal; + crtc->VerticalSyncStart = VSS; + crtc->VerticalSyncEnd = VSE; + crtc->Flags = HNEG | VNEG; + + if (doublescan) + crtc->Flags |= DOUBLESCAN; +} + + + +/* Desc: Attempts to enter specified video mode. + * + * In : ptr to mode structure, refresh rate + * Out : 0 if success + * + * Note: - + */ +static int vesa_entermode (vl_mode *p, int refresh) +{ + __dpmi_regs r; + + if (p->mode & 0x4000) { + VESA.blit = _can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual; + } else { + VESA.blit = vesa_b_dump_virtual; + { int n; for (vesa_gran_shift=0, n=p->gran; n; vesa_gran_shift++, n>>=1) ; } + vesa_gran_mask = (1<<(--vesa_gran_shift)) - 1; + if ((unsigned)p->gran != (vesa_gran_mask+1)) { + return !0; + } + } + + if (oldmode == -1) { + r.x.ax = 0x4f03; + __dpmi_int(0x10, &r); + oldmode = r.x.bx; + } + + r.x.ax = 0x4f02; + r.x.bx = p->mode; + + if (refresh && ((vesa_ver>>8) >= 3)) { + /* VESA 3.0 stuff for controlling the refresh rate */ + CRTCInfoBlock crtc; + unsigned long vclk; + double f0; + + _crtc_timing(&crtc, p->xres, p->yres, 0, 0); + + vclk = (double)crtc.HorizontalTotal * crtc.VerticalTotal * refresh; + vclk = _closest_pixclk(p->mode, vclk); + + if (vclk != 0) { + f0 = (double)vclk / (crtc.HorizontalTotal * crtc.VerticalTotal); + /*_current_refresh_rate = (int)(f0 + 0.5);*/ + + crtc.PixelClock = vclk; + crtc.RefreshRate = refresh * 100; + + movedata(_my_ds(), (unsigned)&crtc, _stubinfo->ds_selector, 0, sizeof(crtc)); + + r.x.di = 0; + r.x.es = _stubinfo->ds_segment; + r.x.bx |= 0x0800; + } + } + + __dpmi_int(0x10, &r); + if (r.x.ax != 0x004f) { + return !0; + } + + if (p->bpp == 8) { + r.x.ax = 0x4f08; + r.x.bx = 0x0800; + __dpmi_int(0x10, &r); + if (r.x.ax == 0x004f) { + r.x.ax = 0x4f08; + r.h.bl = 0x01; + __dpmi_int(0x10, &r); + vesa_color_precision = r.h.bh; + } + } + + return 0; +} + + + +/* Desc: Restores to the mode prior to first call to vesa_entermode. + * + * In : - + * Out : - + * + * Note: - + */ +static void vesa_restore (void) +{ + __dpmi_regs r; + + if (oldmode != -1) { + r.x.ax = 0x4f02; + r.x.bx = oldmode; + __dpmi_int(0x10, &r); + } +} + + + +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses integer values + */ +static void vesa_setCI_i (int index, int red, int green, int blue) +{ +#if 0 + __asm("\n\ + movw $0x1010, %%ax \n\ + movb %1, %%dh \n\ + movb %2, %%ch \n\ + int $0x10 \n\ + "::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); +#else + outportb(0x03C8, index); + outportb(0x03C9, red); + outportb(0x03C9, green); + outportb(0x03C9, blue); +#endif +} + + + +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses normalized values + */ +static void vesa_setCI_f (int index, float red, float green, float blue) +{ + float max = (1 << vesa_color_precision) - 1; + + vesa_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); +} + + + +/* Desc: state retrieval + * + * In : parameter name, ptr to storage + * Out : 0 if request successfully processed + * + * Note: - + */ +static int vesa_get (int pname, int *params) +{ + switch (pname) { + case VL_GET_CI_PREC: + params[0] = vesa_color_precision; + break; + default: + return -1; + } + return 0; +} + + + +/* + * the driver + */ +vl_driver VESA = { + vesa_init, + vesa_entermode, + NULL, + vesa_setCI_f, + vesa_setCI_i, + vesa_get, + vesa_restore, + vesa_fini +}; diff --git a/src/mesa/drivers/dos/vesa.h b/src/mesa/drivers/dos/vesa.h new file mode 100644 index 00000000000..369196f1443 --- /dev/null +++ b/src/mesa/drivers/dos/vesa.h @@ -0,0 +1,47 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef VESA_H_included +#define VESA_H_included + +#include "internal.h" + +extern void *vesa_swbank; + +extern void vesa_b_dump_virtual (void); +extern void vesa_l_dump_virtual (void); +extern void vesa_l_dump_virtual_mmx (void); + +extern vl_driver VESA; + +#endif diff --git a/src/mesa/drivers/dos/vesa/blit.S b/src/mesa/drivers/dos/vesa/blit.S deleted file mode 100644 index 3598614c9f1..00000000000 --- a/src/mesa/drivers/dos/vesa/blit.S +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - - .file "blit.S" - -/* - * extern unsigned int vesa_gran_mask, vesa_gran_shift; - * extern int vl_video_selector; - - * extern void *vl_current_draw_buffer; - * extern int vl_current_stride, vl_current_height; - * extern int vl_current_offset, vl_current_delta; - */ - - .text - -/* Desc: VESA bank switching routine (BIOS) - * - * In : EBX=0, EDX = bank number - * Out : - - * - * Note: thrashes EAX - */ - .p2align 5,,31 -_vesa_swbankBIOS: - movw $0x4f05, %ax - int $0x10 - ret - - .p2align 2,,3 - .global _vesa_swbank -_vesa_swbank: .long _vesa_swbankBIOS - -/* Desc: void vesa_b_dump_virtual (void); - * - * In : - - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _vesa_b_dump_virtual -_vesa_b_dump_virtual: - cld - pushl %es - pushl %ebx - pushl %esi - pushl %edi - pushl %ebp - movl _vl_video_selector, %es - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vesa_gran_shift, %ecx - movl _vesa_gran_mask, %ebp - movl %edi, %edx - xorl %ebx, %ebx - andl %ebp, %edi - shrl %cl, %edx - incl %ebp - call *_vesa_swbank - movl _vl_current_stride, %ecx - movl _vl_current_height, %eax - movl _vl_current_delta, %ebx - shrl $2, %ecx - .balign 4 - 0: - pushl %ecx - .balign 4 - 1: - cmpl %ebp, %edi - jb 2f - pushl %eax - pushl %ebx - incl %edx - xorl %ebx, %ebx - call *_vesa_swbank - popl %ebx - popl %eax - subl %ebp, %edi - .balign 4 - 2: - movsl - decl %ecx - jnz 1b - popl %ecx - addl %ebx, %edi - decl %eax - jnz 0b - popl %ebp - popl %edi - popl %esi - popl %ebx - popl %es - ret - -/* Desc: void vesa_l_dump_virtual (void); - * - * In : - - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _vesa_l_dump_virtual -_vesa_l_dump_virtual: - cld - pushl %es - pushl %esi - pushl %edi - movl _vl_video_selector, %es - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vl_current_stride, %ecx - movl _vl_current_height, %edx - movl _vl_current_delta, %eax - shrl $2, %ecx - .balign 4 - 0: - pushl %ecx - rep; movsl - popl %ecx - addl %eax, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - popl %es - ret - -/* Desc: void vesa_l_dump_virtual_mmx (void); - * - * In : - - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _vesa_l_dump_virtual_mmx -_vesa_l_dump_virtual_mmx: -#ifdef USE_MMX_ASM - pushl %esi - pushl %edi - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vl_current_stride, %ecx - movl _vl_current_height, %edx - movl _vl_current_delta, %eax - shrl $3, %ecx - .balign 4 - 0: - pushl %ecx - .balign 4 - 1: - movq (%esi), %mm0 - addl $8, %esi - movq %mm0, %fs:(%edi) - addl $8, %edi - decl %ecx - jnz 1b - popl %ecx - addl %eax, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - emms -#endif - ret diff --git a/src/mesa/drivers/dos/vesa/vesa.c b/src/mesa/drivers/dos/vesa/vesa.c deleted file mode 100644 index 1f3de844d7d..00000000000 --- a/src/mesa/drivers/dos/vesa/vesa.c +++ /dev/null @@ -1,521 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.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. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "vesa.h" - - - -static vl_mode modes[64]; - -static word16 vesa_ver; -static int banked_selector, linear_selector; -static int oldmode = -1; - -static int vesa_color_precision = 6; - -static void *vesa_pmcode; -unsigned int vesa_gran_mask, vesa_gran_shift; - - - -/* - * VESA info - */ -#define V_SIGN 0 -#define V_MINOR 4 -#define V_MAJOR 5 -#define V_OEM_OFS 6 -#define V_OEM_SEG 8 -#define V_MODE_OFS 14 -#define V_MODE_SEG 16 -#define V_MEMORY 18 - -/* - * mode info - */ -#define M_ATTR 0 -#define M_GRAN 4 -#define M_SCANLEN 16 -#define M_XRES 18 -#define M_YRES 20 -#define M_BPP 25 -#define M_RED 31 -#define M_GREEN 33 -#define M_BLUE 35 -#define M_PHYS_PTR 40 - -/* - * VESA 3.0 CRTC timings structure - */ -typedef struct CRTCInfoBlock { - unsigned short HorizontalTotal; - unsigned short HorizontalSyncStart; - unsigned short HorizontalSyncEnd; - unsigned short VerticalTotal; - unsigned short VerticalSyncStart; - unsigned short VerticalSyncEnd; - unsigned char Flags; - unsigned long PixelClock; /* units of Hz */ - unsigned short RefreshRate; /* units of 0.01 Hz */ - unsigned char reserved[40]; -} __PACKED__ CRTCInfoBlock; - -#define HNEG (1 << 2) -#define VNEG (1 << 3) -#define DOUBLESCAN (1 << 0) - - - -/* Desc: Attempts to detect VESA, check video modes and create selectors. - * - * In : - - * Out : mode array - * - * Note: - - */ -static vl_mode *vesa_init (void) -{ - __dpmi_regs r; - word16 *p; - vl_mode *q; - char vesa_info[512], tmp[512]; - int maxsize = 0; - word32 linearfb = 0; - - if (vesa_ver) { - return modes; - } - - _farpokel(_stubinfo->ds_selector, 0, 0x32454256); - r.x.ax = 0x4f00; - r.x.di = 0; - r.x.es = _stubinfo->ds_segment; - __dpmi_int(0x10, &r); - movedata(_stubinfo->ds_selector, 0, _my_ds(), (unsigned)vesa_info, 512); - if ((r.x.ax!=0x004f) || ((_32_ vesa_info[V_SIGN])!=0x41534556)) { - return NULL; - } - - p = (word16 *)(((_16_ vesa_info[V_MODE_SEG])<<4) + (_16_ vesa_info[V_MODE_OFS])); - q = modes; - do { - if ((q->mode=_farpeekw(__djgpp_dos_sel, (unsigned long)(p++)))==0xffff) { - break; - } - - r.x.ax = 0x4f01; - r.x.cx = q->mode; - r.x.di = 512; - r.x.es = _stubinfo->ds_segment; - __dpmi_int(0x10, &r); - movedata(_stubinfo->ds_selector, 512, _my_ds(), (unsigned)tmp, 256); - switch (tmp[M_BPP]) { - case 16: - q->bpp = tmp[M_RED] + tmp[M_GREEN] + tmp[M_BLUE]; - break; - case 8: - case 15: - case 24: - case 32: - q->bpp = tmp[M_BPP]; - break; - default: - q->bpp = 0; - } - if ((r.x.ax==0x004f) && ((tmp[M_ATTR]&0x11)==0x11) && q->bpp) { - q->xres = _16_ tmp[M_XRES]; - q->yres = _16_ tmp[M_YRES]; - q->scanlen = _16_ tmp[M_SCANLEN]; - q->gran = (_16_ tmp[M_GRAN])<<10; - if (tmp[M_ATTR]&0x80) { -#if 0 - *(q+1) = *q++; -#else - vl_mode *q1 = q + 1; - *q1 = *q++; -#endif - linearfb = _32_ tmp[M_PHYS_PTR]; - q->mode |= 0x4000; - } - if (maxsize<(q->scanlen*q->yres)) { - maxsize = q->scanlen*q->yres; - } - q++; - } - } while (TRUE); - - if (q==modes) { - return NULL; - } - if (linearfb) { - maxsize = ((maxsize+0xfffUL)&~0xfffUL); - if (_create_selector(&linear_selector, linearfb, maxsize)) { - return NULL; - } - } - if (_create_selector(&banked_selector, 0xa0000, modes[0].gran)) { - _remove_selector(&linear_selector); - return NULL; - } - - for (q=modes; q->mode!=0xffff; q++) { - q->sel = (q->mode&0x4000) ? linear_selector : banked_selector; - } - - if (vesa_info[V_MAJOR] >= 2) { - r.x.ax = 0x4f0a; - r.h.bl = 0; - __dpmi_int(0x10, &r); - if (r.x.ax == 0x004f) { - vesa_pmcode = malloc(r.x.cx); - movedata(__djgpp_dos_sel, (r.x.es << 4) + r.x.di, _my_ds(), (unsigned)vesa_pmcode, r.x.cx); - p = (word16 *)((long)vesa_pmcode + ((word16 *)vesa_pmcode)[3]); - while (*p++ != 0xffff) ; - if (*p != 0xffff) { - free(vesa_pmcode); - vesa_pmcode = NULL; - } else { - vesa_swbank = (char *)vesa_pmcode + ((word16 *)vesa_pmcode)[0]; - } - } - } - - vesa_ver = _16_ vesa_info[V_MINOR]; - return modes; -} - - - -/* Desc: Frees all resources allocated by VESA init code. - * - * In : - - * Out : - - * - * Note: - - */ -static void vesa_finit (void) -{ - if (vesa_ver) { - _remove_selector(&linear_selector); - _remove_selector(&banked_selector); - if (vesa_pmcode != NULL) { - free(vesa_pmcode); - vesa_pmcode = NULL; - } - } -} - - - -/* Desc: Uses VESA 3.0 function 0x4F0B to find the closest pixel clock to the requested value. - * - * In : mode, clock - * Out : desired clock - * - * Note: - - */ -static unsigned long _closest_pixclk (int mode_no, unsigned long vclk) -{ - __dpmi_regs r; - - r.x.ax = 0x4F0B; - r.h.bl = 0; - r.d.ecx = vclk; - r.x.dx = mode_no; - __dpmi_int(0x10, &r); - - return (r.x.ax==0x004f) ? r.d.ecx : 0; -} - - - -/* Desc: Calculates CRTC mode timings. - * - * In : crtc block, geometry, adjust - * Out : - * - * Note: - */ -static void _crtc_timing (CRTCInfoBlock *crtc, int xres, int yres, int xadjust, int yadjust) -{ - int HTotal, VTotal; - int HDisp, VDisp; - int HSS, VSS; - int HSE, VSE; - int HSWidth, VSWidth; - int SS, SE; - int doublescan = FALSE; - - if (yres < 400) { - doublescan = TRUE; - yres *= 2; - } - - HDisp = xres; - HTotal = (int)(HDisp * 1.27) & ~0x7; - HSWidth = (int)((HTotal - HDisp) / 5) & ~0x7; - HSS = HDisp + 16; - HSE = HSS + HSWidth; - VDisp = yres; - VTotal = VDisp * 1.07; - VSWidth = (VTotal / 100) + 1; - VSS = VDisp + ((int)(VTotal - VDisp) / 5) + 1; - VSE = VSS + VSWidth; - - SS = HSS + xadjust; - SE = HSE + xadjust; - - if (xadjust < 0) { - if (SS < (HDisp + 8)) { - SS = HDisp + 8; - SE = SS + HSWidth; - } - } else { - if ((HTotal - 24) < SE) { - SE = HTotal - 24; - SS = SE - HSWidth; - } - } - - HSS = SS; - HSE = SE; - - SS = VSS + yadjust; - SE = VSE + yadjust; - - if (yadjust < 0) { - if (SS < (VDisp + 3)) { - SS = VDisp + 3; - SE = SS + VSWidth; - } - } else { - if ((VTotal - 4) < SE) { - SE = VTotal - 4; - SS = SE - VSWidth; - } - } - - VSS = SS; - VSE = SE; - - crtc->HorizontalTotal = HTotal; - crtc->HorizontalSyncStart = HSS; - crtc->HorizontalSyncEnd = HSE; - crtc->VerticalTotal = VTotal; - crtc->VerticalSyncStart = VSS; - crtc->VerticalSyncEnd = VSE; - crtc->Flags = HNEG | VNEG; - - if (doublescan) - crtc->Flags |= DOUBLESCAN; -} - - - -/* Desc: Attempts to enter specified video mode. - * - * In : ptr to mode structure, refresh rate - * Out : 0 if success - * - * Note: - - */ -static int vesa_entermode (vl_mode *p, int refresh) -{ - __dpmi_regs r; - - if (p->mode & 0x4000) { - VESA.blit = vl_can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual; - } else { - VESA.blit = vesa_b_dump_virtual; - { int n; for (vesa_gran_shift=0, n=p->gran; n; vesa_gran_shift++, n>>=1) ; } - vesa_gran_mask = (1<<(--vesa_gran_shift)) - 1; - if ((unsigned)p->gran != (vesa_gran_mask+1)) { - return !0; - } - } - - if (oldmode == -1) { - r.x.ax = 0x4f03; - __dpmi_int(0x10, &r); - oldmode = r.x.bx; - } - - r.x.ax = 0x4f02; - r.x.bx = p->mode; - - if (refresh && ((vesa_ver>>8) >= 3)) { - /* VESA 3.0 stuff for controlling the refresh rate */ - CRTCInfoBlock crtc; - unsigned long vclk; - double f0; - - _crtc_timing(&crtc, p->xres, p->yres, 0, 0); - - vclk = (double)crtc.HorizontalTotal * crtc.VerticalTotal * refresh; - vclk = _closest_pixclk(p->mode, vclk); - - if (vclk != 0) { - f0 = (double)vclk / (crtc.HorizontalTotal * crtc.VerticalTotal); - /*_current_refresh_rate = (int)(f0 + 0.5);*/ - - crtc.PixelClock = vclk; - crtc.RefreshRate = refresh * 100; - - movedata(_my_ds(), (unsigned)&crtc, _stubinfo->ds_selector, 0, sizeof(crtc)); - - r.x.di = 0; - r.x.es = _stubinfo->ds_segment; - r.x.bx |= 0x0800; - } - } - - __dpmi_int(0x10, &r); - if (r.x.ax != 0x004f) { - return !0; - } - - if (p->bpp == 8) { - r.x.ax = 0x4f08; - r.x.bx = 0x0800; - __dpmi_int(0x10, &r); - if (r.x.ax == 0x004f) { - r.x.ax = 0x4f08; - r.h.bl = 0x01; - __dpmi_int(0x10, &r); - vesa_color_precision = r.h.bh; - } - } - - return 0; -} - - - -/* Desc: Restores to the mode prior to first call to vesa_entermode. - * - * In : - - * Out : - - * - * Note: - - */ -static void vesa_restore (void) -{ - __dpmi_regs r; - - if (oldmode != -1) { - r.x.ax = 0x4f02; - r.x.bx = oldmode; - __dpmi_int(0x10, &r); - } -} - - - -/* Desc: set one palette entry - * - * In : color index, R, G, B - * Out : - - * - * Note: uses integer values - */ -static void vesa_setCI_i (int index, int red, int green, int blue) -{ -#if 0 - __asm("\n\ - movw $0x1010, %%ax \n\ - movb %1, %%dh \n\ - movb %2, %%ch \n\ - int $0x10 \n\ - "::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); -#else - outportb(0x03C8, index); - outportb(0x03C9, red); - outportb(0x03C9, green); - outportb(0x03C9, blue); -#endif -} - - - -/* Desc: set one palette entry - * - * In : color index, R, G, B - * Out : - - * - * Note: uses normalized values - */ -static void vesa_setCI_f (int index, float red, float green, float blue) -{ - float max = (1 << vesa_color_precision) - 1; - - vesa_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); -} - - - -/* Desc: retrieve CI precision - * - * In : - - * Out : precision in bits - * - * Note: - - */ -static int vesa_getCIprec (void) -{ - return vesa_color_precision; -} - - - -/* - * the driver - */ -vl_driver VESA = { - vesa_init, - vesa_entermode, - NULL, - vesa_setCI_f, - vesa_setCI_i, - vesa_getCIprec, - vesa_restore, - vesa_finit -}; diff --git a/src/mesa/drivers/dos/vesa/vesa.h b/src/mesa/drivers/dos/vesa/vesa.h deleted file mode 100644 index eb914e16c13..00000000000 --- a/src/mesa/drivers/dos/vesa/vesa.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef VESA_H_included -#define VESA_H_included - -#include "../internal.h" - -extern void *vesa_swbank; - -extern void vesa_b_dump_virtual (void); -extern void vesa_l_dump_virtual (void); -extern void vesa_l_dump_virtual_mmx (void); - -extern vl_driver VESA; - -#endif diff --git a/src/mesa/drivers/dos/vga.c b/src/mesa/drivers/dos/vga.c new file mode 100644 index 00000000000..ed899628405 --- /dev/null +++ b/src/mesa/drivers/dos/vga.c @@ -0,0 +1,235 @@ +/* + * Mesa 3-D graphics library + * Version: 4.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. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include +#include + +#include "video.h" +#include "vga.h" + + + +static vl_mode modes[] = { + {0x13 | 0x4000, 320, 200, 320, 8, -1, 320*200}, + {0xffff, -1, -1, -1, -1, -1, -1} +}; + +static word16 vga_ver; +static int linear_selector; +static int oldmode = -1; + +#define vga_color_precision 6 + + + +/* Desc: Attempts to detect VGA, check video modes and create selectors. + * + * In : - + * Out : mode array + * + * Note: - + */ +static vl_mode *vga_init (void) +{ + int rv = 0; + + if (vga_ver) { + return modes; + } + + __asm("\n\ + movw $0x1a00, %%ax \n\ + int $0x10 \n\ + cmpb $0x1a, %%al \n\ + jne 0f \n\ + cmpb $0x07, %%bl \n\ + jb 0f \n\ + andl $0xff, %%ebx \n\ + movl %%ebx, %0 \n\ + 0:":"=g"(rv)::"%eax", "%ebx"); + if (rv == 0) { + return NULL; + } + + if (_create_selector(&linear_selector, 0xa0000, 0x10000)) { + return NULL; + } + + modes[0].sel = linear_selector; + + vga_ver = rv; + return modes; +} + + + +/* Desc: Frees all resources allocated by VGA init code. + * + * In : - + * Out : - + * + * Note: - + */ +static void vga_fini (void) +{ + if (vga_ver) { + _remove_selector(&linear_selector); + } +} + + + +/* Desc: Attempts to enter specified video mode. + * + * In : ptr to mode structure, refresh rate + * Out : 0 if success + * + * Note: - + */ +static int vga_entermode (vl_mode *p, int refresh) +{ + if (!(p->mode & 0x4000)) { + return -1; + } + VGA.blit = _can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual; + + if (oldmode == -1) { + __asm("\n\ + movb $0x0f, %%ah \n\ + int $0x10 \n\ + andl $0xff, %%eax \n\ + movl %%eax, %0 \n\ + ":"=g"(oldmode)::"%eax", "%ebx"); + } + + __asm("int $0x10"::"a"(p->mode&0xff)); + + return 0; + + (void)refresh; /* silence compiler warning */ +} + + + +/* Desc: Restores to the mode prior to first call to vga_entermode. + * + * In : - + * Out : - + * + * Note: - + */ +static void vga_restore (void) +{ + if (oldmode != -1) { + __asm("int $0x10"::"a"(oldmode)); + } +} + + + +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses integer values + */ +static void vga_setCI_i (int index, int red, int green, int blue) +{ +#if 0 + __asm("\n\ + movw $0x1010, %%ax \n\ + movb %1, %%dh \n\ + movb %2, %%ch \n\ + int $0x10 \n\ + "::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); +#else + outportb(0x03C8, index); + outportb(0x03C9, red); + outportb(0x03C9, green); + outportb(0x03C9, blue); +#endif +} + + + +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses normalized values + */ +static void vga_setCI_f (int index, float red, float green, float blue) +{ + float max = (1 << vga_color_precision) - 1; + + vga_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); +} + + + +/* Desc: state retrieval + * + * In : parameter name, ptr to storage + * Out : 0 if request successfully processed + * + * Note: - + */ +static int vga_get (int pname, int *params) +{ + switch (pname) { + case VL_GET_CI_PREC: + params[0] = vga_color_precision; + break; + default: + return -1; + } + return 0; +} + + + +/* + * the driver + */ +vl_driver VGA = { + vga_init, + vga_entermode, + NULL, + vga_setCI_f, + vga_setCI_i, + vga_get, + vga_restore, + vga_fini +}; diff --git a/src/mesa/drivers/dos/vga.h b/src/mesa/drivers/dos/vga.h new file mode 100644 index 00000000000..d1047940418 --- /dev/null +++ b/src/mesa/drivers/dos/vga.h @@ -0,0 +1,42 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef VGA_H_included +#define VGA_H_included + +#include "internal.h" +#include "vesa.h" + +extern vl_driver VGA; + +#endif diff --git a/src/mesa/drivers/dos/vga/vga.c b/src/mesa/drivers/dos/vga/vga.c deleted file mode 100644 index d1d2db51b5e..00000000000 --- a/src/mesa/drivers/dos/vga/vga.c +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.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. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include -#include - -#include "vga.h" - - - -static vl_mode modes[4] = { - {0x13 | 0x4000, 320, 200, 320, 8, -1, 320*200}, - {0xffff, -1, -1, -1, -1, -1, -1} -}; - -static word16 vga_ver; -static int linear_selector; -static int oldmode = -1; - -#define vga_color_precision 6 - - - -/* Desc: Attempts to detect VGA, check video modes and create selectors. - * - * In : - - * Out : mode array - * - * Note: - - */ -static vl_mode *vga_init (void) -{ - int rv = 0; - - if (vga_ver) { - return modes; - } - - __asm("\n\ - movw $0x1a00, %%ax \n\ - int $0x10 \n\ - cmpb $0x1a, %%al \n\ - jne 0f \n\ - cmpb $0x07, %%bl \n\ - jb 0f \n\ - andl $0xff, %%ebx \n\ - movl %%ebx, %0 \n\ - 0:":"=g"(rv)::"%eax", "%ebx"); - if (rv == 0) { - return NULL; - } - - if (_create_selector(&linear_selector, 0xa0000, 0x10000)) { - return NULL; - } - - modes[0].sel = linear_selector; - - vga_ver = rv; - return modes; -} - - - -/* Desc: Frees all resources allocated by VGA init code. - * - * In : - - * Out : - - * - * Note: - - */ -static void vga_finit (void) -{ - if (vga_ver) { - _remove_selector(&linear_selector); - } -} - - - -/* Desc: Attempts to enter specified video mode. - * - * In : ptr to mode structure, refresh rate - * Out : 0 if success - * - * Note: - - */ -static int vga_entermode (vl_mode *p, int refresh) -{ - if (!(p->mode & 0x4000)) { - return -1; - } - VGA.blit = vl_can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual; - - if (oldmode == -1) { - __asm("\n\ - movb $0x0f, %%ah \n\ - int $0x10 \n\ - andl $0xff, %%eax \n\ - movl %%eax, %0 \n\ - ":"=g"(oldmode)::"%eax", "%ebx"); - } - - __asm("int $0x10"::"a"(p->mode&0xff)); - - return 0; -} - - - -/* Desc: Restores to the mode prior to first call to vga_entermode. - * - * In : - - * Out : - - * - * Note: - - */ -static void vga_restore (void) -{ - if (oldmode != -1) { - __asm("int $0x10"::"a"(oldmode)); - } -} - - - -/* Desc: set one palette entry - * - * In : color index, R, G, B - * Out : - - * - * Note: uses integer values - */ -static void vga_setCI_i (int index, int red, int green, int blue) -{ -#if 0 - __asm("\n\ - movw $0x1010, %%ax \n\ - movb %1, %%dh \n\ - movb %2, %%ch \n\ - int $0x10 \n\ - "::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); -#else - outportb(0x03C8, index); - outportb(0x03C9, red); - outportb(0x03C9, green); - outportb(0x03C9, blue); -#endif -} - - - -/* Desc: set one palette entry - * - * In : color index, R, G, B - * Out : - - * - * Note: uses normalized values - */ -static void vga_setCI_f (int index, float red, float green, float blue) -{ - float max = (1 << vga_color_precision) - 1; - - vga_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); -} - - - -/* Desc: retrieve CI precision - * - * In : - - * Out : precision in bits - * - * Note: - - */ -static int vga_getCIprec (void) -{ - return vga_color_precision; -} - - - -/* - * the driver - */ -vl_driver VGA = { - vga_init, - vga_entermode, - NULL, - vga_setCI_f, - vga_setCI_i, - vga_getCIprec, - vga_restore, - vga_finit -}; diff --git a/src/mesa/drivers/dos/vga/vga.h b/src/mesa/drivers/dos/vga/vga.h deleted file mode 100644 index b7ae84c9617..00000000000 --- a/src/mesa/drivers/dos/vga/vga.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef VGA_H_included -#define VGA_H_included - -#include "../internal.h" -#include "../vesa/vesa.h" - -extern vl_driver VGA; - -#endif diff --git a/src/mesa/drivers/dos/video.c b/src/mesa/drivers/dos/video.c index aba99ac5428..3e93e6095a8 100644 --- a/src/mesa/drivers/dos/video.c +++ b/src/mesa/drivers/dos/video.c @@ -35,10 +35,10 @@ #include -#include "video.h" #include "internal.h" -#include "vesa/vesa.h" -#include "vga/vga.h" +#include "vesa.h" +#include "vga.h" +#include "video.h" @@ -56,22 +56,22 @@ int vl_current_offset, vl_current_delta; /* lookup table for scaling 5 bit colors up to 8 bits */ static int _rgb_scale_5[32] = { - 0, 8, 16, 24, 32, 41, 49, 57, - 65, 74, 82, 90, 98, 106, 115, 123, - 131, 139, 148, 156, 164, 172, 180, 189, - 197, 205, 213, 222, 230, 238, 246, 255 + 0, 8, 16, 25, 33, 41, 49, 58, + 66, 74, 82, 90, 99, 107, 115, 123, + 132, 140, 148, 156, 165, 173, 181, 189, + 197, 206, 214, 222, 230, 239, 247, 255 }; /* lookup table for scaling 6 bit colors up to 8 bits */ static int _rgb_scale_6[64] = { 0, 4, 8, 12, 16, 20, 24, 28, - 32, 36, 40, 44, 48, 52, 56, 60, - 64, 68, 72, 76, 80, 85, 89, 93, + 32, 36, 40, 45, 49, 53, 57, 61, + 65, 69, 73, 77, 81, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, - 129, 133, 137, 141, 145, 149, 153, 157, - 161, 165, 170, 174, 178, 182, 186, 190, - 194, 198, 202, 206, 210, 214, 218, 222, - 226, 230, 234, 238, 242, 246, 250, 255 + 130, 134, 138, 142, 146, 150, 154, 158, + 162, 166, 170, 174, 178, 182, 186, 190, + 194, 198, 202, 206, 210, 215, 219, 223, + 227, 231, 235, 239, 243, 247, 251, 255 }; /* FakeColor data */ @@ -376,36 +376,24 @@ int vl_sync_buffer (void **buffer, int x, int y, int width, int height) -/* Desc: get screen geometry +/* Desc: state retrieval * - * In : ptr to WIDTH, ptr to HEIGHT + * In : name, storage * Out : - * * Note: - */ -void vl_get_screen_size (int *width, int *height) +int vl_get (int pname, int *params) { - *width = video_mode->xres; - *height = video_mode->yres; -} - - - -/* Desc: retrieve CPU MMX capability - * - * In : - - * Out : FALSE if CPU cannot do MMX - * - * Note: - - */ -int vl_can_mmx (void) -{ -#ifdef USE_MMX_ASM - extern int _mesa_identify_x86_cpu_features (void); - return (_mesa_identify_x86_cpu_features() & 0x00800000); -#else + switch (pname) { + case VL_GET_SCREEN_SIZE: + params[0] = video_mode->xres; + params[1] = video_mode->yres; + break; + default: + return drv->get(pname, params); + } return 0; -#endif } @@ -431,7 +419,7 @@ static int vl_setup_mode (vl_mode *p) vl_mixfix = vl_mixfix##bpp; \ vl_mixrgb = vl_mixrgb##bpp; \ vl_mixrgba = vl_mixrgba##bpp; \ - vl_clear = vl_can_mmx() ? v_clear##bpp##_mmx : v_clear##bpp + vl_clear = _can_mmx() ? v_clear##bpp##_mmx : v_clear##bpp switch (p->bpp) { case 8: @@ -475,7 +463,7 @@ static int vl_setup_mode (vl_mode *p) void vl_video_exit (void) { drv->restore(); - drv->finit(); + drv->fini(); } @@ -523,7 +511,7 @@ int vl_video_init (int width, int height, int bpp, int rgb, int refresh) if ((vl_setup_mode(p) == 0) && (drv->entermode(p, refresh) == 0)) { vl_flip = drv->blit; if (fake) { - min = drv->getCIprec(); + drv->get(VL_GET_CI_PREC, (int *)(&min)); fake_buildpalette(min); if (min == 8) { vl_getrgba = v_getrgba8fake8; diff --git a/src/mesa/drivers/dos/video.h b/src/mesa/drivers/dos/video.h index 8dfb9a91766..e908178ad4d 100644 --- a/src/mesa/drivers/dos/video.h +++ b/src/mesa/drivers/dos/video.h @@ -36,6 +36,12 @@ typedef int fixed; +#define VL_GET_CARD_NAME 0x0100 +#define VL_GET_VRAM 0x0101 +#define VL_GET_CI_PREC 0x0200 +#define VL_GET_HPIXELS 0x0201 +#define VL_GET_SCREEN_SIZE 0x0202 + extern int (*vl_mixfix) (fixed r, fixed g, fixed b); extern int (*vl_mixrgb) (const unsigned char rgb[]); extern int (*vl_mixrgba) (const unsigned char rgba[]); @@ -50,7 +56,7 @@ extern int (*vl_getpixel) (unsigned int offset); void vl_setCI (int index, float red, float green, float blue); int vl_sync_buffer (void **buffer, int x, int y, int width, int height); -void vl_get_screen_size (int *width, int *height); +int vl_get (int pname, int *params); void vl_video_exit (void); int vl_video_init (int width, int height, int bpp, int rgb, int refresh); diff --git a/src/mesa/drivers/dos/virtual.S b/src/mesa/drivers/dos/virtual.S index c5a72975feb..0605514b14a 100644 --- a/src/mesa/drivers/dos/virtual.S +++ b/src/mesa/drivers/dos/virtual.S @@ -108,7 +108,7 @@ _v_clear_common: .global _v_clear8_mmx _v_clear8_mmx: #ifdef USE_MMX_ASM - movq 4(%esp), %mm0 + movd 4(%esp), %mm0 punpcklbw %mm0, %mm0 punpcklwd %mm0, %mm0 jmp _v_clear_common_mmx @@ -125,7 +125,7 @@ _v_clear8_mmx: .global _v_clear16_mmx _v_clear16_mmx: #ifdef USE_MMX_ASM - movq 4(%esp), %mm0 + movd 4(%esp), %mm0 punpcklwd %mm0, %mm0 jmp _v_clear_common_mmx #endif @@ -141,7 +141,7 @@ _v_clear16_mmx: .global _v_clear32_mmx _v_clear32_mmx: #ifdef USE_MMX_ASM - movq 4(%esp), %mm0 + movd 4(%esp), %mm0 .balign 4 _v_clear_common_mmx: punpckldq %mm0, %mm0 diff --git a/src/mesa/main/Makefile.DJ b/src/mesa/main/Makefile.DJ index cabeff10362..e2714f9088f 100644 --- a/src/mesa/main/Makefile.DJ +++ b/src/mesa/main/Makefile.DJ @@ -40,6 +40,9 @@ # As a consequence, you'll need the DJGPP Glide3 # library to build any application. # default = no +# MATROX=1 build for Matrox Millennium I (MGA2064W) cards. +# This is experimental and not intensively tested. +# default = no # HAVE_X86=1 optimize for i386. # default = no # HAVE_MMX=1 allow MMX specializations, provided your assembler @@ -70,8 +73,17 @@ GL_IMP = libigl.a CC = gcc CFLAGS += -I$(TOP)/include -I. -ifdef FX -CFLAGS += -D__DOS__ -I$(GLIDE) -DFX -DFX_GLIDE3 -DFXMESA_USE_ARGB +ifeq ($(FX),1) +CFLAGS += -D__DOS__ -DH3 +CFLAGS += -I$(GLIDE) -DFX -DFX_GLIDE3 -DFXMESA_USE_ARGB +LIBNAME = "MesaGL/FX DJGPP" +else +ifeq ($(MATROX),1) +CFLAGS += -DMATROX +LIBNAME = "MesaGL/MGA DJGPP" +else +LIBNAME = "MesaGL DJGPP" +endif endif AR = ar @@ -228,22 +240,22 @@ K3D_SOURCES = \ X86/3dnow_xform4.S \ X86/3dnow_normal.S -ifdef HAVE_MMX +ifeq ($(HAVE_MMX),1) X86_SOURCES += $(MMX_SOURCES) CFLAGS += -DUSE_MMX_ASM HAVE_X86 = 1 endif -ifdef HAVE_SSE +ifeq ($(HAVE_SSE),1) X86_SOURCES += $(SSE_SOURCES) CFLAGS += -DUSE_SSE_ASM HAVE_X86 = 1 endif -ifdef HAVE_3DNOW +ifeq ($(HAVE_3DNOW),1) X86_SOURCES += $(K3D_SOURCES) CFLAGS += -DUSE_3DNOW_ASM HAVE_X86 = 1 endif -ifdef HAVE_X86 +ifeq ($(HAVE_X86),1) CFLAGS += -DUSE_X86_ASM else X86_SOURCES = @@ -251,15 +263,7 @@ endif DRIVER_SOURCES = \ DOS/dmesa.c -ifndef FX -DRIVER_SOURCES += \ - DOS/video.c \ - DOS/virtual.S \ - DOS/vesa/vesa.c \ - DOS/vesa/blit.S \ - DOS/vga/vga.c \ - DOS/dpmi.c -else +ifeq ($(FX),1) DRIVER_SOURCES += \ FX/fxapi.c \ FX/fxdd.c \ @@ -270,6 +274,22 @@ DRIVER_SOURCES += \ FX/fxtris.c \ FX/fxvb.c \ FX/fxglidew.c +else +ifeq ($(MATROX),1) +DRIVER_SOURCES += \ + DOS/mga/mga.c \ + DOS/mga/mga_hw.c \ + DOS/mga/mga_mode.c \ + DOS/dpmi.c +else +DRIVER_SOURCES += \ + DOS/video.c \ + DOS/virtual.S \ + DOS/vesa.c \ + DOS/blit.S \ + DOS/vga.c \ + DOS/dpmi.c +endif endif SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(DRIVER_SOURCES) @@ -295,10 +315,10 @@ ifeq ($(DXE3GEN),) $(warning Missing DXE3GEN and/or DXE3.LD! You must have DXE3GEN) $(warning somewhere in PATH, and DXE3.LD in DJGPP/LIB directory.) else -ifdef FX - -dxe3gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) -D "MesaGL/FX DJGPP" -E _gl -E _DMesa -P glid3.dxe -U $(OBJECTS) +ifeq ($(FX),1) + -dxe3gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -P glid3.dxe -U $(OBJECTS) else - -dxe3gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) -D "MesaGL DJGPP" -E _gl -E _DMesa -U $(OBJECTS) + -dxe3gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -U $(OBJECTS) endif endif @@ -319,8 +339,7 @@ clean: -$(RM) $(subst /,\,tnl/*.o) -$(RM) $(subst /,\,X86/*.o) -$(RM) $(subst /,\,DOS/*.o) - -$(RM) $(subst /,\,DOS/vesa/*.o) - -$(RM) $(subst /,\,DOS/vga/*.o) + -$(RM) $(subst /,\,DOS/mga/*.o) -$(RM) $(subst /,\,FX/*.o) -include depend -- cgit v1.2.3 From 001a3012ac66c279ba8076a13c59d71d025f2ed9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 28 Feb 2003 16:31:32 +0000 Subject: updated version --- include/GL/gl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index b4fc69af39e..57632f6bfa4 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,10 +1,10 @@ -/* $Id: gl.h,v 1.74 2003/02/10 20:22:08 alanh Exp $ */ +/* $Id: gl.h,v 1.75 2003/02/28 16:31:32 brianp Exp $ */ /* * Mesa 3-D graphics library - * Version: 4.1 + * Version: 5.1 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2003 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"), -- cgit v1.2.3 From 47d8adde43c71f32d3677bb8ad965f262b6f3150 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 8 Mar 2003 18:28:14 +0000 Subject: DOS update (Daniel Borca) --- docs/README.DJ | 12 +-- include/GL/dmesa.h | 2 +- progs/samples/Makefile.DJ | 5 +- src/glu/mesa/Makefile.DJ | 2 +- src/glu/sgi/Makefile.DJ | 2 +- src/glut/dos/Makefile.DJ | 2 +- src/glut/dos/PC_HW/pc_hw.h | 5 +- src/glut/dos/PC_HW/pc_irq.S | 10 ++- src/glut/dos/PC_HW/pc_keyb.c | 25 +++---- src/glut/dos/PC_HW/pc_mouse.c | 144 ++++++++++++++++++++++-------------- src/glut/dos/callback.c | 2 +- src/glut/dos/color.c | 2 +- src/glut/dos/extens.c | 2 +- src/glut/dos/glutint.h | 2 +- src/glut/dos/init.c | 5 +- src/glut/dos/menu.c | 2 +- src/glut/dos/mouse.c | 16 +++- src/glut/dos/overlay.c | 2 +- src/glut/dos/state.c | 2 +- src/glut/dos/window.c | 2 +- src/mesa/drivers/dos/blit.S | 2 +- src/mesa/drivers/dos/dmesa.c | 9 ++- src/mesa/drivers/dos/dpmi.c | 2 +- src/mesa/drivers/dos/internal.h | 4 +- src/mesa/drivers/dos/mga/m_ttemp.h | 2 +- src/mesa/drivers/dos/mga/m_ttemp2.h | 2 +- src/mesa/drivers/dos/mga/mga.c | 2 +- src/mesa/drivers/dos/mga/mga.h | 2 +- src/mesa/drivers/dos/mga/mga_hw.c | 2 +- src/mesa/drivers/dos/mga/mga_hw.h | 2 +- src/mesa/drivers/dos/mga/mga_mode.c | 2 +- src/mesa/drivers/dos/mga/mga_mode.h | 2 +- src/mesa/drivers/dos/mga/mga_reg.h | 2 +- src/mesa/drivers/dos/vesa.c | 2 +- src/mesa/drivers/dos/vesa.h | 2 +- src/mesa/drivers/dos/vga.c | 2 +- src/mesa/drivers/dos/vga.h | 2 +- src/mesa/drivers/dos/video.c | 2 +- src/mesa/drivers/dos/video.h | 2 +- src/mesa/drivers/dos/virtual.S | 2 +- src/mesa/main/Makefile.DJ | 3 +- 41 files changed, 174 insertions(+), 124 deletions(-) (limited to 'include') diff --git a/docs/README.DJ b/docs/README.DJ index 13167611ba0..a800d6eb958 100644 --- a/docs/README.DJ +++ b/docs/README.DJ @@ -1,12 +1,12 @@ - Mesa 5.0 DOS/DJGPP Port v1.3 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Mesa 5.0.1 DOS/DJGPP Port v1.3 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Description: ~~~~~~~~~~~~ -Well, guess what... this is the DOS port of Mesa 5.0, for DJGPP fans... Whoa! +Well, guess what... this is the DOS port of Mesa 5.0.1, for DJGPP fans... Whoa! The driver has its origins in ddsample.c, written by Brian Paul and found by me in Mesa 3.4.2. @@ -165,8 +165,8 @@ space (and since dynamic modules shall) the SIGINT can't be hooked (well, it can, but it is useless), therefore you must live with the 'Exiting due to signal SIGINT' message... -The mouse driver is far from complete (lack of positioning, drawing, etc), but -is enough to make almost all the demos work. +The mouse driver is far from complete (lack of drawing, etc), but is enough to +make almost all the demos work. Supports the CuteMouse WheelAPI. The timer is pretty versatile for it supports multiple timers with different frequencies. While not being the most accurate timer in the known universe, I @@ -207,7 +207,7 @@ v1.2 (nov-2002) * synced w/ Mesa-4.1 - removed dmesadxe.h -v1.3 (feb-2003) +v1.3 (mar-2003) + enabled OpenGL 1.4 support + added MMX clear/blit routines + enabled SGI's GLU compilation diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h index 2c0ef81abe2..89df5a4e216 100644 --- a/include/GL/dmesa.h +++ b/include/GL/dmesa.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * DOS/DJGPP device driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/progs/samples/Makefile.DJ b/progs/samples/Makefile.DJ index 3d679ebe7c6..81db8253426 100644 --- a/progs/samples/Makefile.DJ +++ b/progs/samples/Makefile.DJ @@ -20,7 +20,7 @@ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# DOS/DJGPP samples makefile v1.3 for Mesa 5.0 +# DOS/DJGPP samples makefile v1.3 for Mesa # # Copyright (C) 2002 - Borca Daniel # Email : dborca@yahoo.com @@ -63,6 +63,7 @@ CFLAGS = -Wall -W -pedantic CFLAGS += -O2 -ffast-math -mcpu=$(CPU) CFLAGS += -I$(TOP)/include +LD = gxx LDFLAGS = -s -L$(TOP)/lib ifeq ($(DXE),1) @@ -79,7 +80,7 @@ endif .c.o: $(CC) -o $@ $(CFLAGS) -c $< .o.exe: - $(CC) -o $@ $(LDFLAGS) $(DMESADXE) $< $(LDLIBS) + $(LD) -o $@ $(LDFLAGS) $(DMESADXE) $< $(LDLIBS) all: $(error Must specify to build) diff --git a/src/glu/mesa/Makefile.DJ b/src/glu/mesa/Makefile.DJ index 6c8ec1bd5d4..e4423ccad08 100644 --- a/src/glu/mesa/Makefile.DJ +++ b/src/glu/mesa/Makefile.DJ @@ -20,7 +20,7 @@ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# DOS/DJGPP glu makefile v1.3 for Mesa 5.0 +# DOS/DJGPP glu makefile v1.3 for Mesa # # Copyright (C) 2002 - Borca Daniel # Email : dborca@yahoo.com diff --git a/src/glu/sgi/Makefile.DJ b/src/glu/sgi/Makefile.DJ index 6f4bcd81c09..0f0984fb6c9 100644 --- a/src/glu/sgi/Makefile.DJ +++ b/src/glu/sgi/Makefile.DJ @@ -20,7 +20,7 @@ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# DOS/DJGPP glu makefile v1.3 for Mesa 5.0 +# DOS/DJGPP glu makefile v1.3 for Mesa # # Copyright (C) 2002 - Borca Daniel # Email : dborca@yahoo.com diff --git a/src/glut/dos/Makefile.DJ b/src/glut/dos/Makefile.DJ index 2fb1bee27d7..2ae88520dc3 100644 --- a/src/glut/dos/Makefile.DJ +++ b/src/glut/dos/Makefile.DJ @@ -20,7 +20,7 @@ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# DOS/DJGPP glut makefile v1.3 for Mesa 5.0 +# DOS/DJGPP glut makefile v1.3 for Mesa # # Copyright (C) 2002 - Borca Daniel # Email : dborca@yahoo.com diff --git a/src/glut/dos/PC_HW/pc_hw.h b/src/glut/dos/PC_HW/pc_hw.h index c38c8959b6c..c029005b53c 100644 --- a/src/glut/dos/PC_HW/pc_hw.h +++ b/src/glut/dos/PC_HW/pc_hw.h @@ -25,7 +25,7 @@ typedef void (*VFUNC) (void); typedef void (*PFUNC) (void *); -typedef void (*MFUNC) (int x, int y, int b); +typedef void (*MFUNC) (int x, int y, int z, int b); /* * atexit @@ -211,7 +211,8 @@ void pc_remove_mouse (void); MFUNC pc_install_mouse_handler (MFUNC handler); void pc_mouse_area (int x1, int y1, int x2, int y2); void pc_mouse_speed (int xspeed, int yspeed); -int pc_query_mouse (int *x, int *y); +int pc_query_mouse (int *x, int *y, int *z); +void pc_warp_mouse (int x, int y); /* * standard redirection diff --git a/src/glut/dos/PC_HW/pc_irq.S b/src/glut/dos/PC_HW/pc_irq.S index 196546072cc..7f0b747d342 100644 --- a/src/glut/dos/PC_HW/pc_irq.S +++ b/src/glut/dos/PC_HW/pc_irq.S @@ -1,5 +1,5 @@ /* - * PC/HW routine collection v1.0 for DOS/DJGPP + * PC/HW routine collection v1.3 for DOS/DJGPP * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -74,6 +74,9 @@ _pc_install_irq: addl %edx, %eax movl %eax, IRQ_STACK(%edi) + movl ___djgpp_ds_alias, %eax + movl %eax, IRQ_STACK+4(%edi) + movl %ss:12(%ebp), %eax movl %eax, IRQ_HOOK(%edi) @@ -131,8 +134,7 @@ __irq_wrapper_##x: ; \ pushl %gs ; \ movl %ss, %ebx ; \ movl %esp, %esi ; \ - movl %cs:___djgpp_ds_alias, %ss ; \ - movl %cs:__irq_stack_##x, %esp ; \ + lss %cs:__irq_stack_##x, %esp ; \ pushl %ss ; \ pushl %ss ; \ popl %es ; \ @@ -160,7 +162,7 @@ __irq_old_##x: ; \ __irq_hook_##x: ; \ .long 0 ; \ __irq_stack_##x: ; \ - .long 0 + .long 0, 0 WRAPPER(0); WRAPPER(1); diff --git a/src/glut/dos/PC_HW/pc_keyb.c b/src/glut/dos/PC_HW/pc_keyb.c index 333ca757f50..6475be35086 100644 --- a/src/glut/dos/PC_HW/pc_keyb.c +++ b/src/glut/dos/PC_HW/pc_keyb.c @@ -357,20 +357,6 @@ static void handle_code (int scancode, int keycode) in_a_terrupt--; } ENDOFUNC(handle_code) -static __inline void satisfy (void) -{ - __asm("\n\ - inb $0x61, %%al \n\ - movb %%al, %%ah \n\ - orb $0x80, %%al \n\ - outb %%al, $0x61 \n\ - xchgb %%al, %%ah \n\ - outb %%al, $0x61 \n\ - movb $0x20, %%al \n\ - outb %%al, $0x20 \n\ - ":::"%eax"); -} - static int keyboard () { unsigned char temp, scancode; @@ -410,7 +396,16 @@ static int keyboard () ":::"%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); } - satisfy(); + __asm("\n\ + inb $0x61, %%al \n\ + movb %%al, %%ah \n\ + orb $0x80, %%al \n\ + outb %%al, $0x61 \n\ + xchgb %%al, %%ah \n\ + outb %%al, $0x61 \n\ + movb $0x20, %%al \n\ + outb %%al, $0x20 \n\ + ":::"%eax"); return 0; } ENDOFUNC(keyboard) diff --git a/src/glut/dos/PC_HW/pc_mouse.c b/src/glut/dos/PC_HW/pc_mouse.c index 3ed76509067..1740bfbac43 100644 --- a/src/glut/dos/PC_HW/pc_mouse.c +++ b/src/glut/dos/PC_HW/pc_mouse.c @@ -8,11 +8,15 @@ #include +#include +#include #include "pc_hw.h" +#define PC_CUTE_WHEEL 1 /* CuteMouse WheelAPI */ + #define MOUSE_STACK_SIZE 16384 #define CLEAR_MICKEYS() \ @@ -21,20 +25,23 @@ ox = oy = 0; \ } while (0) -extern void mouse_wrapper (void); -extern void mouse_wrapper_end (void); +extern void mouse_wrap (void); +extern int mouse_wrap_end[]; static MFUNC mouse_func; -static void *mouse_stack; static long mouse_callback; static __dpmi_regs mouse_regs; -static volatile int pc_mouse_x, pc_mouse_y, pc_mouse_b; +static volatile struct { + volatile int x, y, z, b; +} pc_mouse; static int minx = 0; static int maxx = 319; static int miny = 0; static int maxy = 199; +static int minz = 0; +static int maxz = 255; static int sx = 2; static int sy = 2; @@ -43,27 +50,34 @@ static int emulat3 = FALSE; static int ox, oy; + static void mouse (__dpmi_regs *r) { int nx = (signed short)r->x.si / sx; int ny = (signed short)r->x.di / sy; int dx = nx - ox; int dy = ny - oy; +#if PC_CUTE_WHEEL + int dz = (signed char)r->h.bh; +#endif ox = nx; oy = ny; - pc_mouse_b = r->x.bx; - pc_mouse_x = MID(minx, pc_mouse_x + dx, maxx); - pc_mouse_y = MID(miny, pc_mouse_y + dy, maxy); + pc_mouse.b = r->h.bl; + pc_mouse.x = MID(minx, pc_mouse.x + dx, maxx); + pc_mouse.y = MID(miny, pc_mouse.y + dy, maxy); +#if PC_CUTE_WHEEL + pc_mouse.z = MID(minz, pc_mouse.z + dz, maxz); +#endif if (emulat3) { - if ((pc_mouse_b&3)==3) { - pc_mouse_b = 4; + if ((pc_mouse.b&3)==3) { + pc_mouse.b = 4; } } if (mouse_func) { - mouse_func(pc_mouse_x, pc_mouse_y, pc_mouse_b); + mouse_func(pc_mouse.x, pc_mouse.y, pc_mouse.z, pc_mouse.b); } } ENDOFUNC(mouse) @@ -83,7 +97,7 @@ void pc_remove_mouse (void) mouse_callback = 0; - free((void *)((unsigned long)mouse_stack-MOUSE_STACK_SIZE)); + free((void *)(mouse_wrap_end[0] - MOUSE_STACK_SIZE)); } } @@ -109,26 +123,26 @@ int pc_install_mouse (void) /* lock wrapper */ LOCKDATA(mouse_func); - LOCKDATA(mouse_stack); LOCKDATA(mouse_callback); LOCKDATA(mouse_regs); - LOCKDATA(pc_mouse_x); - LOCKDATA(pc_mouse_y); - LOCKDATA(pc_mouse_b); + LOCKDATA(pc_mouse); LOCKDATA(minx); LOCKDATA(maxx); LOCKDATA(miny); LOCKDATA(maxy); + LOCKDATA(minz); + LOCKDATA(maxz); LOCKDATA(sx); LOCKDATA(sy); LOCKDATA(emulat3); LOCKDATA(ox); LOCKDATA(oy); LOCKFUNC(mouse); - LOCKFUNC(mouse_wrapper); + LOCKFUNC(mouse_wrap); + mouse_wrap_end[1] = __djgpp_ds_alias; /* grab a locked stack */ - if ((mouse_stack=pc_malloc(MOUSE_STACK_SIZE))==NULL) { + if ((mouse_wrap_end[0] = (int)pc_malloc(MOUSE_STACK_SIZE)) == NULL) { return 0; } @@ -150,19 +164,23 @@ int pc_install_mouse (void) movl %%ecx, %0 \n\ 0: \n\ ":"=g"(mouse_callback) - :"S" (mouse_wrapper), "D"(&mouse_regs) + :"S" (mouse_wrap), "D"(&mouse_regs) :"%eax", "%ecx", "%edx"); if (!mouse_callback) { - free(mouse_stack); + free((void *)mouse_wrap_end[0]); return 0; } /* adjust stack */ - mouse_stack = (void *)((unsigned long)mouse_stack + MOUSE_STACK_SIZE); + mouse_wrap_end[0] += MOUSE_STACK_SIZE; /* install the handler */ mouse_regs.x.ax = 0x000c; - mouse_regs.x.cx = 0x007f; +#if PC_CUTE_WHEEL + mouse_regs.x.cx = 0x7f | 0x80; +#else + mouse_regs.x.cx = 0x7f; +#endif mouse_regs.x.dx = mouse_callback&0xffff; mouse_regs.x.es = mouse_callback>>16; __dpmi_int(0x33, &mouse_regs); @@ -205,41 +223,57 @@ void pc_mouse_speed (int xspeed, int yspeed) ENABLE(); } -int pc_query_mouse (int *x, int *y) +int pc_query_mouse (int *x, int *y, int *z) { - *x = pc_mouse_x; - *y = pc_mouse_y; - return pc_mouse_b; + *x = pc_mouse.x; + *y = pc_mouse.y; + *z = pc_mouse.z; + return pc_mouse.b; } +void pc_warp_mouse (int x, int y) +{ + CLEAR_MICKEYS(); + + pc_mouse.x = MID(minx, x, maxx); + pc_mouse.y = MID(miny, y, maxy); + + if (mouse_func) { + mouse_func(pc_mouse.x, pc_mouse.y, pc_mouse.z, pc_mouse.b); + } +} + +/* Hack alert: + * `mouse_wrap_end' actually holds the + * address of stack in a safe data selector. + */ __asm("\n\ - .text \n\ - .p2align 5,,31 \n\ - .global _mouse_wrapper \n\ -_mouse_wrapper: \n\ - cld \n\ - lodsl \n\ - movl %eax, %es:42(%edi) \n\ - addw $4, %es:46(%edi) \n\ - pushl %es \n\ - movl %ss, %ebx \n\ - movl %esp, %esi \n\ - movl %cs:___djgpp_ds_alias, %ss \n\ - movl %cs:_mouse_stack, %esp \n\ - pushl %ss \n\ - pushl %ss \n\ - popl %es \n\ - popl %ds \n\ - movl ___djgpp_dos_sel, %fs \n\ - pushl %fs \n\ - popl %gs \n\ - pushl %edi \n\ - call _mouse \n\ - popl %edi \n\ - movl %ebx, %ss \n\ - movl %esi, %esp \n\ - popl %es \n\ - iret \n\ - .balign 4 \n\ - .global _mouse_wrapper_end \n\ -_mouse_wrapper_end:"); + .text \n\ + .p2align 5,,31 \n\ + .global _mouse_wrap \n\ +_mouse_wrap: \n\ + cld \n\ + lodsl \n\ + movl %eax, %es:42(%edi) \n\ + addw $4, %es:46(%edi) \n\ + pushl %es \n\ + movl %ss, %ebx \n\ + movl %esp, %esi \n\ + lss %cs:_mouse_wrap_end, %esp\n\ + pushl %ss \n\ + pushl %ss \n\ + popl %es \n\ + popl %ds \n\ + movl ___djgpp_dos_sel, %fs \n\ + pushl %fs \n\ + popl %gs \n\ + pushl %edi \n\ + call _mouse \n\ + popl %edi \n\ + movl %ebx, %ss \n\ + movl %esi, %esp \n\ + popl %es \n\ + iret \n\ + .balign 4 \n\ + .global _mouse_wrap_end \n\ +_mouse_wrap_end:.long 0, 0"); diff --git a/src/glut/dos/callback.c b/src/glut/dos/callback.c index 6e3f5a77c78..67e52ee59f0 100644 --- a/src/glut/dos/callback.c +++ b/src/glut/dos/callback.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.3 for Mesa 5.0 + * DOS/DJGPP glut driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/color.c b/src/glut/dos/color.c index 2e8ed3f95bf..490839968ec 100644 --- a/src/glut/dos/color.c +++ b/src/glut/dos/color.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.3 for Mesa 5.0 + * DOS/DJGPP glut driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/extens.c b/src/glut/dos/extens.c index ae8e44f4088..ca4da058cd0 100644 --- a/src/glut/dos/extens.c +++ b/src/glut/dos/extens.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.3 for Mesa 5.0 + * DOS/DJGPP glut driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/glutint.h b/src/glut/dos/glutint.h index bbabf0fdb2c..dfc42754df8 100644 --- a/src/glut/dos/glutint.h +++ b/src/glut/dos/glutint.h @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.3 for Mesa 5.0 + * DOS/DJGPP glut driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/init.c b/src/glut/dos/init.c index 6c034ff5e2b..9553cf2532e 100644 --- a/src/glut/dos/init.c +++ b/src/glut/dos/init.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.3 for Mesa 5.0 + * DOS/DJGPP glut driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -152,10 +152,11 @@ void APIENTRY glutMainLoop (void) if (g_mouse) { int mouse_x; int mouse_y; + int mouse_z; int mouse_b; /* query mouse */ - mouse_b = pc_query_mouse(&mouse_x, &mouse_y); + mouse_b = pc_query_mouse(&mouse_x, &mouse_y, &mouse_z); /* relative to window coordinates */ g_mouse_x = mouse_x - g_curwin->xpos; diff --git a/src/glut/dos/menu.c b/src/glut/dos/menu.c index 9a3841b12b6..e8f7b0a75b0 100644 --- a/src/glut/dos/menu.c +++ b/src/glut/dos/menu.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.3 for Mesa 5.0 + * DOS/DJGPP glut driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/mouse.c b/src/glut/dos/mouse.c index d82f5e8a8c8..7ba6358bc26 100644 --- a/src/glut/dos/mouse.c +++ b/src/glut/dos/mouse.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.3 for Mesa 5.0 + * DOS/DJGPP glut driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -44,3 +44,17 @@ void __glutInitMouse (void) g_curwin->show_mouse = (g_curwin->mouse || g_curwin->motion || g_curwin->passive); } } + + + +void APIENTRY glutSetCursor (int cursor) +{ + /* XXX completely futile until full mouse support (maybe never) */ +} + + + +void APIENTRY glutWarpPointer (int x, int y) +{ + pc_warp_mouse(x, y); +} diff --git a/src/glut/dos/overlay.c b/src/glut/dos/overlay.c index f1f72cf1f83..d0e2a859c7b 100644 --- a/src/glut/dos/overlay.c +++ b/src/glut/dos/overlay.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.3 for Mesa 5.0 + * DOS/DJGPP glut driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/state.c b/src/glut/dos/state.c index e9735a06a2a..38b03a72ab5 100644 --- a/src/glut/dos/state.c +++ b/src/glut/dos/state.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.3 for Mesa 5.0 + * DOS/DJGPP glut driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/glut/dos/window.c b/src/glut/dos/window.c index cad4726936f..839241a9b09 100644 --- a/src/glut/dos/window.c +++ b/src/glut/dos/window.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.3 for Mesa 5.0 + * DOS/DJGPP glut driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/blit.S b/src/mesa/drivers/dos/blit.S index 3598614c9f1..7d0da5da289 100644 --- a/src/mesa/drivers/dos/blit.S +++ b/src/mesa/drivers/dos/blit.S @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * DOS/DJGPP device driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index 5202bbd6b17..d3d3d4abcb7 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 5.1 + * Version: 5.0 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * 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"), @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * DOS/DJGPP device driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -39,6 +39,7 @@ #include "extensions.h" #include "macros.h" #include "matrix.h" +#include "mmath.h" #include "texformat.h" #include "texstore.h" #include "array_cache/acache.h" @@ -1099,7 +1100,7 @@ static const GLubyte* get_string (GLcontext *ctx, GLenum name) #ifdef MATROX " (MGA)" #endif - "\0port (c) Borca Daniel feb-2003"; + "\0port (c) Borca Daniel mar-2003"; default: return NULL; } diff --git a/src/mesa/drivers/dos/dpmi.c b/src/mesa/drivers/dos/dpmi.c index db6a3063390..17c005a9e58 100644 --- a/src/mesa/drivers/dos/dpmi.c +++ b/src/mesa/drivers/dos/dpmi.c @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * DOS/DJGPP device driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/internal.h b/src/mesa/drivers/dos/internal.h index f6dc0e4b41f..6860ef35840 100644 --- a/src/mesa/drivers/dos/internal.h +++ b/src/mesa/drivers/dos/internal.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * DOS/DJGPP device driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -34,7 +34,7 @@ #ifndef INTERNAL_H_included #define INTERNAL_H_included -#include "../macros.h" +#include "../mmath.h" /* * general purpose defines, etc. diff --git a/src/mesa/drivers/dos/mga/m_ttemp.h b/src/mesa/drivers/dos/mga/m_ttemp.h index d3de69a825a..1c5fbda29af 100644 --- a/src/mesa/drivers/dos/mga/m_ttemp.h +++ b/src/mesa/drivers/dos/mga/m_ttemp.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 -- MGA2064W triangle template + * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W triangle template * * Copyright (c) 2003 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/mga/m_ttemp2.h b/src/mesa/drivers/dos/mga/m_ttemp2.h index 27a1c8ba037..2933f2b1a95 100644 --- a/src/mesa/drivers/dos/mga/m_ttemp2.h +++ b/src/mesa/drivers/dos/mga/m_ttemp2.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 -- MGA2064W triangle template + * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W triangle template * * Copyright (c) 2003 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/mga/mga.c b/src/mesa/drivers/dos/mga/mga.c index 59bb09c9d3d..27afba0ba04 100644 --- a/src/mesa/drivers/dos/mga/mga.c +++ b/src/mesa/drivers/dos/mga/mga.c @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 -- MGA2064W + * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W * * Copyright (c) 2003 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/mga/mga.h b/src/mesa/drivers/dos/mga/mga.h index fc5722b0314..d84fe72e269 100644 --- a/src/mesa/drivers/dos/mga/mga.h +++ b/src/mesa/drivers/dos/mga/mga.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 -- MGA2064W + * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W * * Copyright (c) 2003 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/mga/mga_hw.c b/src/mesa/drivers/dos/mga/mga_hw.c index 4354ce86155..08c1d7e54a4 100644 --- a/src/mesa/drivers/dos/mga/mga_hw.c +++ b/src/mesa/drivers/dos/mga/mga_hw.c @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 -- MGA2064W HW mapping + * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W HW mapping * * Copyright (c) 2003 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/mga/mga_hw.h b/src/mesa/drivers/dos/mga/mga_hw.h index 246ed9c6ad7..c6575b97f88 100644 --- a/src/mesa/drivers/dos/mga/mga_hw.h +++ b/src/mesa/drivers/dos/mga/mga_hw.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 -- MGA2064W HW mapping + * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W HW mapping * * Copyright (c) 2003 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/mga/mga_mode.c b/src/mesa/drivers/dos/mga/mga_mode.c index 33f47a6486e..4c6d926111d 100644 --- a/src/mesa/drivers/dos/mga/mga_mode.c +++ b/src/mesa/drivers/dos/mga/mga_mode.c @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 -- MGA2064W mode switching + * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W mode switching * * Copyright (c) 2003 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/mga/mga_mode.h b/src/mesa/drivers/dos/mga/mga_mode.h index 4049bd8fd2d..b458d00d802 100644 --- a/src/mesa/drivers/dos/mga/mga_mode.h +++ b/src/mesa/drivers/dos/mga/mga_mode.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 -- MGA2064W mode switching + * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W mode switching * * Copyright (c) 2003 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/mga/mga_reg.h b/src/mesa/drivers/dos/mga/mga_reg.h index 73d22de2b87..4cd664ff967 100644 --- a/src/mesa/drivers/dos/mga/mga_reg.h +++ b/src/mesa/drivers/dos/mga/mga_reg.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 -- MGA2064W register mnemonics + * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W register mnemonics * * Copyright (c) 2003 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/vesa.c b/src/mesa/drivers/dos/vesa.c index eebaa5006b9..cb8c29dfc71 100644 --- a/src/mesa/drivers/dos/vesa.c +++ b/src/mesa/drivers/dos/vesa.c @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * DOS/DJGPP device driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/vesa.h b/src/mesa/drivers/dos/vesa.h index 369196f1443..030c816f080 100644 --- a/src/mesa/drivers/dos/vesa.h +++ b/src/mesa/drivers/dos/vesa.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * DOS/DJGPP device driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/vga.c b/src/mesa/drivers/dos/vga.c index ed899628405..4fe8773243f 100644 --- a/src/mesa/drivers/dos/vga.c +++ b/src/mesa/drivers/dos/vga.c @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * DOS/DJGPP device driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/vga.h b/src/mesa/drivers/dos/vga.h index d1047940418..f1bc62bbe73 100644 --- a/src/mesa/drivers/dos/vga.h +++ b/src/mesa/drivers/dos/vga.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * DOS/DJGPP device driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/video.c b/src/mesa/drivers/dos/video.c index 3e93e6095a8..297c9d56624 100644 --- a/src/mesa/drivers/dos/video.c +++ b/src/mesa/drivers/dos/video.c @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * DOS/DJGPP device driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/video.h b/src/mesa/drivers/dos/video.h index e908178ad4d..bb40fd00dfb 100644 --- a/src/mesa/drivers/dos/video.h +++ b/src/mesa/drivers/dos/video.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * DOS/DJGPP device driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/drivers/dos/virtual.S b/src/mesa/drivers/dos/virtual.S index 0605514b14a..0df584150f3 100644 --- a/src/mesa/drivers/dos/virtual.S +++ b/src/mesa/drivers/dos/virtual.S @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa 5.0 + * DOS/DJGPP device driver v1.3 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com diff --git a/src/mesa/main/Makefile.DJ b/src/mesa/main/Makefile.DJ index 2a3c6a79b7a..33e6ca5d448 100644 --- a/src/mesa/main/Makefile.DJ +++ b/src/mesa/main/Makefile.DJ @@ -20,7 +20,7 @@ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# DOS/DJGPP core makefile v1.3 for Mesa 5.0 +# DOS/DJGPP core makefile v1.3 for Mesa # # Copyright (C) 2002 - Borca Daniel # Email : dborca@yahoo.com @@ -130,6 +130,7 @@ CORE_SOURCES = \ light.c \ lines.c \ matrix.c \ + mmath.c \ pixel.c \ points.c \ polygon.c \ -- cgit v1.2.3 From 997d468afeca6791d21ce703af36d8604e72a0c1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 29 Mar 2003 16:39:21 +0000 Subject: added GL_ARB_vertex_buffer_object functions --- include/GL/glext.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 7d1f396bbd4..f0fd7bb04a2 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -5025,6 +5025,28 @@ typedef void (APIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); #define GL_ATI_texture_env_combine3 1 #endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +/* large enough to contain any pointer (32 or 64 bit): */ +typedef long int GLsizeiptrARB; +typedef long int GLintptrARB; + +extern void glBindBufferARB(GLenum target, GLuint buffer); +extern void glDeleteBuffersARB(GLsizei n, const GLuint * buffer); +extern void glGenBuffersARB(GLsizei n, GLuint * buffer); +extern GLboolean glIsBufferARB(GLuint buffer); +extern void glBufferDataARB(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); +extern void glBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); +extern void glGetBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void * data); +extern void glMapBufferARB(GLenum target, GLenum access); +extern GLboolean glUnmapBufferARB(GLenum target); +extern void glGetBufferParameterivARB(GLenum target, GLenum pname, GLint * params); +extern void glGetBufferPointervARB(GLenum target, GLenum pname, GLvoid ** params); + +#endif + + #ifdef __cplusplus } #endif -- cgit v1.2.3 From ef393cbb54f49e229df623ab7c91b4dbc78b6df7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 9 Apr 2003 02:32:12 +0000 Subject: Added GL_ARB_vertex_buffer_object tokens --- include/GL/glext.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index f0fd7bb04a2..69da3aa7b27 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -5032,6 +5032,38 @@ typedef void (APIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); typedef long int GLsizeiptrARB; typedef long int GLintptrARB; +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD + extern void glBindBufferARB(GLenum target, GLuint buffer); extern void glDeleteBuffersARB(GLsizei n, const GLuint * buffer); extern void glGenBuffersARB(GLsizei n, GLuint * buffer); -- cgit v1.2.3 From 4c928471c182761b6649415ff0614715f0247770 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 9 Apr 2003 02:32:56 +0000 Subject: Added function pointer typedefs for GL_NV_fragment_program --- include/GL/gl.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 57632f6bfa4..2d7b9ba3ef4 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,5 +1,3 @@ -/* $Id: gl.h,v 1.75 2003/02/28 16:31:32 brianp Exp $ */ - /* * Mesa 3-D graphics library * Version: 5.1 @@ -2705,6 +2703,13 @@ GLAPI void GLAPIENTRY glGetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte * name, const GLfloat *v); +typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte * name, const GLdouble *v); +typedef void (APIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLfloat *params); +typedef void (APIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLdouble *params); + #endif /* GL_NV_fragment_program */ -- cgit v1.2.3 From af0c2470210632abf365b149bc81274aa7b04258 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 17 Apr 2003 01:48:56 +0000 Subject: temporary GL_ARB_fragment_program tokens --- include/GL/gl.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 2d7b9ba3ef4..e99f4999d02 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2645,6 +2645,7 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid +/* XXX temporary until glext.h is updated! */ #ifndef GL_NV_fragment_program #define GL_NV_fragment_program 1 @@ -2714,6 +2715,28 @@ typedef void (APIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsi +/* XXX temporary until glext.h is updated! */ +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 + +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 + +#endif /* GL_ARB_fragment_program */ + + + /********************************************************************** * Begin system-specific stuff -- cgit v1.2.3 From 9b14e0fbfd96d02574f8f5910ebc8a52c62a24aa Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 18 Apr 2003 01:56:44 +0000 Subject: more GL_ARB_fragment_program tokens --- include/GL/gl.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index e99f4999d02..c9353cb83d9 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2732,6 +2732,8 @@ typedef void (APIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsi #define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E #define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F #define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 #endif /* GL_ARB_fragment_program */ -- cgit v1.2.3 From 2780bb824f542c47d5412a3909eaa84ed3f13451 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 21 Apr 2003 14:57:07 +0000 Subject: added GL_EXT_depth_bounds_test --- include/GL/gl.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index c9353cb83d9..94cfd76b3da 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2739,6 +2739,20 @@ typedef void (APIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsi +/* XXX temporary until glext.h is updated! */ +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 + +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 + +GLAPI void GLAPIENTRY glDepthBoundsEXT(GLclampd zmin, GLclampd zmax); + +typedef void (APIENTRY * PFNGLDEPTHBOUNDSEXTPROC)(GLclampd zmin, GLclampd zmax); + +#endif /* GL_EXT_depth_bounds_test */ + + /********************************************************************** * Begin system-specific stuff -- cgit v1.2.3 From e78f8237241d241989c976913268e152015b49b1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Apr 2003 17:42:07 +0000 Subject: fix function prototypes for manging (Bill Hoffman) --- include/GL/gl.h | 47 ++++++++++++----------------------------------- include/GL/glext.h | 20 ++++++++++---------- 2 files changed, 22 insertions(+), 45 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 94cfd76b3da..ab6efc537d4 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2657,52 +2657,29 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid #define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 -GLAPI void GLAPIENTRY -glProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, - GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void GLAPIENTRY -glProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte *name, - GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void GLAPIENTRY -glProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte *name, - const float v[]); +GLAPI void GLAPIENTRY glProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte *name, const float v[]); -GLAPI void GLAPIENTRY -glProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte *name, - const double v[]); +GLAPI void GLAPIENTRY glProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte *name, const double v[]); -GLAPI void GLAPIENTRY -glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name, - GLfloat *params); +GLAPI void GLAPIENTRY glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); -GLAPI void GLAPIENTRY -glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, - GLdouble *params); +GLAPI void GLAPIENTRY glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); -GLAPI void GLAPIENTRY -glProgramLocalParameter4dARB(GLenum target, GLuint index, - GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void GLAPIENTRY -glProgramLocalParameter4dvARB(GLenum target, GLuint index, - const GLdouble *params); +GLAPI void GLAPIENTRY glProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble *params); -GLAPI void GLAPIENTRY -glProgramLocalParameter4fARB(GLenum target, GLuint index, - GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void GLAPIENTRY -glProgramLocalParameter4fvARB(GLenum target, GLuint index, - const GLfloat *params); +GLAPI void GLAPIENTRY glProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat *params); -GLAPI void GLAPIENTRY -glGetProgramLocalParameterdvARB(GLenum target, GLuint index, GLdouble *params); - -GLAPI void GLAPIENTRY -glGetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat *params); +GLAPI void GLAPIENTRY glGetProgramLocalParameterdvARB(GLenum target, GLuint index, GLdouble *params); +GLAPI void GLAPIENTRY glGetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat *params); typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); diff --git a/include/GL/glext.h b/include/GL/glext.h index 69da3aa7b27..2cef3ce2f58 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -5064,17 +5064,17 @@ typedef long int GLintptrARB; #define GL_BUFFER_MAPPED_ARB 0x88BC #define GL_BUFFER_MAP_POINTER_ARB 0x88BD -extern void glBindBufferARB(GLenum target, GLuint buffer); -extern void glDeleteBuffersARB(GLsizei n, const GLuint * buffer); -extern void glGenBuffersARB(GLsizei n, GLuint * buffer); +GLAPI void APIENTRY glBindBufferARB(GLenum target, GLuint buffer); +GLAPI void APIENTRY glDeleteBuffersARB(GLsizei n, const GLuint * buffer); +GLAPI void APIENTRY glGenBuffersARB(GLsizei n, GLuint * buffer); extern GLboolean glIsBufferARB(GLuint buffer); -extern void glBufferDataARB(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); -extern void glBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); -extern void glGetBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void * data); -extern void glMapBufferARB(GLenum target, GLenum access); -extern GLboolean glUnmapBufferARB(GLenum target); -extern void glGetBufferParameterivARB(GLenum target, GLenum pname, GLint * params); -extern void glGetBufferPointervARB(GLenum target, GLenum pname, GLvoid ** params); +GLAPI void APIENTRY glBufferDataARB(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); +GLAPI void APIENTRY glBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); +GLAPI void APIENTRY glGetBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void * data); +GLAPI void APIENTRY glMapBufferARB(GLenum target, GLenum access); +GLAPI GLboolean APIENTRY glUnmapBufferARB(GLenum target); +GLAPI void APIENTRY glGetBufferParameterivARB(GLenum target, GLenum pname, GLint * params); +GLAPI void APIENTRY glGetBufferPointervARB(GLenum target, GLenum pname, GLvoid ** params); #endif -- cgit v1.2.3 From 3e50d140f505cc579267de6534d2a9ad68a5efcf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Apr 2003 20:23:17 +0000 Subject: updated with newest functions --- include/GL/gl_mangle.h | 408 ++++++++++++++++++++++++++----------------------- 1 file changed, 213 insertions(+), 195 deletions(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index f3559902634..ef5f5216601 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -1,4 +1,4 @@ -#if 0 /* $Id: gl_mangle.h,v 1.12 2003/02/04 02:29:21 brianp Exp $ */ +#if 0 #define GL_MANGLE_C1 "DO NOT EDIT!!! - TO REGENERATE from gl.h, EXECUTE THIS FILE IN SHELL (/bin/sh) and save the output" #define GL_MANGLE_C2 "This file is used to create GL function protypes and aliases for the function names" files="gl.h glext.h" @@ -35,24 +35,25 @@ #define glAccum MANGLE(Accum) #define glActiveStencilFaceEXT MANGLE(ActiveStencilFaceEXT) -#define glActiveTexture MANGLE(ActiveTexture) #define glActiveTextureARB MANGLE(ActiveTextureARB) +#define glActiveTexture MANGLE(ActiveTexture) #define glAlphaFragmentOp1ATI MANGLE(AlphaFragmentOp1ATI) #define glAlphaFragmentOp2ATI MANGLE(AlphaFragmentOp2ATI) #define glAlphaFragmentOp3ATI MANGLE(AlphaFragmentOp3ATI) #define glAlphaFunc MANGLE(AlphaFunc) #define glApplyTextureEXT MANGLE(ApplyTextureEXT) #define glAreProgramsResidentNV MANGLE(AreProgramsResidentNV) -#define glAreTexturesResident MANGLE(AreTexturesResident) #define glAreTexturesResidentEXT MANGLE(AreTexturesResidentEXT) -#define glArrayElement MANGLE(ArrayElement) +#define glAreTexturesResident MANGLE(AreTexturesResident) #define glArrayElementEXT MANGLE(ArrayElementEXT) +#define glArrayElement MANGLE(ArrayElement) #define glArrayObjectATI MANGLE(ArrayObjectATI) #define glAsyncMarkerSGIX MANGLE(AsyncMarkerSGIX) -#define glBegin MANGLE(Begin) #define glBeginFragmentShaderATI MANGLE(BeginFragmentShaderATI) +#define glBegin MANGLE(Begin) #define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV) #define glBeginVertexShaderEXT MANGLE(BeginVertexShaderEXT) +#define glBindBufferARB MANGLE(BindBufferARB) #define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI) #define glBindLightParameterEXT MANGLE(BindLightParameterEXT) #define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT) @@ -60,8 +61,8 @@ #define glBindProgramARB MANGLE(BindProgramARB) #define glBindProgramNV MANGLE(BindProgramNV) #define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT) -#define glBindTexture MANGLE(BindTexture) #define glBindTextureEXT MANGLE(BindTextureEXT) +#define glBindTexture MANGLE(BindTexture) #define glBindTextureUnitParameterEXT MANGLE(BindTextureUnitParameterEXT) #define glBindVertexShaderEXT MANGLE(BindVertexShaderEXT) #define glBinormal3bEXT MANGLE(Binormal3bEXT) @@ -76,24 +77,26 @@ #define glBinormal3svEXT MANGLE(Binormal3svEXT) #define glBinormalPointerEXT MANGLE(BinormalPointerEXT) #define glBitmap MANGLE(Bitmap) -#define glBlendColor MANGLE(BlendColor) #define glBlendColorEXT MANGLE(BlendColorEXT) -#define glBlendEquation MANGLE(BlendEquation) +#define glBlendColor MANGLE(BlendColor) #define glBlendEquationEXT MANGLE(BlendEquationEXT) +#define glBlendEquation MANGLE(BlendEquation) #define glBlendFunc MANGLE(BlendFunc) -#define glBlendFuncSeparate MANGLE(BlendFuncSeparate) #define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT) #define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR) +#define glBlendFuncSeparate MANGLE(BlendFuncSeparate) +#define glBufferDataARB MANGLE(BufferDataARB) +#define glBufferSubDataARB MANGLE(BufferSubDataARB) #define glCallList MANGLE(CallList) #define glCallLists MANGLE(CallLists) -#define glClear MANGLE(Clear) #define glClearAccum MANGLE(ClearAccum) #define glClearColor MANGLE(ClearColor) #define glClearDepth MANGLE(ClearDepth) #define glClearIndex MANGLE(ClearIndex) +#define glClear MANGLE(Clear) #define glClearStencil MANGLE(ClearStencil) -#define glClientActiveTexture MANGLE(ClientActiveTexture) #define glClientActiveTextureARB MANGLE(ClientActiveTextureARB) +#define glClientActiveTexture MANGLE(ClientActiveTexture) #define glClientActiveVertexStreamATI MANGLE(ClientActiveVertexStreamATI) #define glClipPlane MANGLE(ClipPlane) #define glColor3b MANGLE(Color3b) @@ -141,14 +144,14 @@ #define glColorFragmentOp3ATI MANGLE(ColorFragmentOp3ATI) #define glColorMask MANGLE(ColorMask) #define glColorMaterial MANGLE(ColorMaterial) -#define glColorPointer MANGLE(ColorPointer) #define glColorPointerEXT MANGLE(ColorPointerEXT) #define glColorPointerListIBM MANGLE(ColorPointerListIBM) +#define glColorPointer MANGLE(ColorPointer) #define glColorPointervINTEL MANGLE(ColorPointervINTEL) -#define glColorSubTable MANGLE(ColorSubTable) #define glColorSubTableEXT MANGLE(ColorSubTableEXT) -#define glColorTable MANGLE(ColorTable) +#define glColorSubTable MANGLE(ColorSubTable) #define glColorTableEXT MANGLE(ColorTableEXT) +#define glColorTable MANGLE(ColorTable) #define glColorTableParameterfv MANGLE(ColorTableParameterfv) #define glColorTableParameterfvSGI MANGLE(ColorTableParameterfvSGI) #define glColorTableParameteriv MANGLE(ColorTableParameteriv) @@ -161,57 +164,58 @@ #define glCombinerParameteriNV MANGLE(CombinerParameteriNV) #define glCombinerParameterivNV MANGLE(CombinerParameterivNV) #define glCombinerStageParameterfvNV MANGLE(CombinerStageParameterfvNV) -#define glCompressedTexImage1D MANGLE(CompressedTexImage1D) #define glCompressedTexImage1DARB MANGLE(CompressedTexImage1DARB) -#define glCompressedTexImage2D MANGLE(CompressedTexImage2D) +#define glCompressedTexImage1D MANGLE(CompressedTexImage1D) #define glCompressedTexImage2DARB MANGLE(CompressedTexImage2DARB) -#define glCompressedTexImage3D MANGLE(CompressedTexImage3D) +#define glCompressedTexImage2D MANGLE(CompressedTexImage2D) #define glCompressedTexImage3DARB MANGLE(CompressedTexImage3DARB) -#define glCompressedTexSubImage1D MANGLE(CompressedTexSubImage1D) +#define glCompressedTexImage3D MANGLE(CompressedTexImage3D) #define glCompressedTexSubImage1DARB MANGLE(CompressedTexSubImage1DARB) -#define glCompressedTexSubImage2D MANGLE(CompressedTexSubImage2D) +#define glCompressedTexSubImage1D MANGLE(CompressedTexSubImage1D) #define glCompressedTexSubImage2DARB MANGLE(CompressedTexSubImage2DARB) -#define glCompressedTexSubImage3D MANGLE(CompressedTexSubImage3D) +#define glCompressedTexSubImage2D MANGLE(CompressedTexSubImage2D) #define glCompressedTexSubImage3DARB MANGLE(CompressedTexSubImage3DARB) -#define glConvolutionFilter1D MANGLE(ConvolutionFilter1D) +#define glCompressedTexSubImage3D MANGLE(CompressedTexSubImage3D) #define glConvolutionFilter1DEXT MANGLE(ConvolutionFilter1DEXT) -#define glConvolutionFilter2D MANGLE(ConvolutionFilter2D) +#define glConvolutionFilter1D MANGLE(ConvolutionFilter1D) #define glConvolutionFilter2DEXT MANGLE(ConvolutionFilter2DEXT) -#define glConvolutionParameterf MANGLE(ConvolutionParameterf) +#define glConvolutionFilter2D MANGLE(ConvolutionFilter2D) #define glConvolutionParameterfEXT MANGLE(ConvolutionParameterfEXT) -#define glConvolutionParameterfv MANGLE(ConvolutionParameterfv) +#define glConvolutionParameterf MANGLE(ConvolutionParameterf) #define glConvolutionParameterfvEXT MANGLE(ConvolutionParameterfvEXT) -#define glConvolutionParameteri MANGLE(ConvolutionParameteri) +#define glConvolutionParameterfv MANGLE(ConvolutionParameterfv) #define glConvolutionParameteriEXT MANGLE(ConvolutionParameteriEXT) -#define glConvolutionParameteriv MANGLE(ConvolutionParameteriv) +#define glConvolutionParameteri MANGLE(ConvolutionParameteri) #define glConvolutionParameterivEXT MANGLE(ConvolutionParameterivEXT) -#define glCopyColorSubTable MANGLE(CopyColorSubTable) +#define glConvolutionParameteriv MANGLE(ConvolutionParameteriv) #define glCopyColorSubTableEXT MANGLE(CopyColorSubTableEXT) +#define glCopyColorSubTable MANGLE(CopyColorSubTable) #define glCopyColorTable MANGLE(CopyColorTable) #define glCopyColorTableSGI MANGLE(CopyColorTableSGI) -#define glCopyConvolutionFilter1D MANGLE(CopyConvolutionFilter1D) #define glCopyConvolutionFilter1DEXT MANGLE(CopyConvolutionFilter1DEXT) -#define glCopyConvolutionFilter2D MANGLE(CopyConvolutionFilter2D) +#define glCopyConvolutionFilter1D MANGLE(CopyConvolutionFilter1D) #define glCopyConvolutionFilter2DEXT MANGLE(CopyConvolutionFilter2DEXT) +#define glCopyConvolutionFilter2D MANGLE(CopyConvolutionFilter2D) #define glCopyPixels MANGLE(CopyPixels) -#define glCopyTexImage1D MANGLE(CopyTexImage1D) #define glCopyTexImage1DEXT MANGLE(CopyTexImage1DEXT) -#define glCopyTexImage2D MANGLE(CopyTexImage2D) +#define glCopyTexImage1D MANGLE(CopyTexImage1D) #define glCopyTexImage2DEXT MANGLE(CopyTexImage2DEXT) -#define glCopyTexSubImage1D MANGLE(CopyTexSubImage1D) +#define glCopyTexImage2D MANGLE(CopyTexImage2D) #define glCopyTexSubImage1DEXT MANGLE(CopyTexSubImage1DEXT) -#define glCopyTexSubImage2D MANGLE(CopyTexSubImage2D) +#define glCopyTexSubImage1D MANGLE(CopyTexSubImage1D) #define glCopyTexSubImage2DEXT MANGLE(CopyTexSubImage2DEXT) -#define glCopyTexSubImage3D MANGLE(CopyTexSubImage3D) +#define glCopyTexSubImage2D MANGLE(CopyTexSubImage2D) #define glCopyTexSubImage3DEXT MANGLE(CopyTexSubImage3DEXT) +#define glCopyTexSubImage3D MANGLE(CopyTexSubImage3D) #define glCullFace MANGLE(CullFace) #define glCullParameterdvEXT MANGLE(CullParameterdvEXT) #define glCullParameterfvEXT MANGLE(CullParameterfvEXT) #define glCurrentPaletteMatrixARB MANGLE(CurrentPaletteMatrixARB) -#define glDeformSGIX MANGLE(DeformSGIX) #define glDeformationMap3dSGIX MANGLE(DeformationMap3dSGIX) #define glDeformationMap3fSGIX MANGLE(DeformationMap3fSGIX) +#define glDeformSGIX MANGLE(DeformSGIX) #define glDeleteAsyncMarkersSGIX MANGLE(DeleteAsyncMarkersSGIX) +#define glDeleteBuffersARB MANGLE(DeleteBuffersARB) #define glDeleteFencesNV MANGLE(DeleteFencesNV) #define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI) #define glDeleteLists MANGLE(DeleteLists) @@ -219,42 +223,43 @@ #define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV) #define glDeleteProgramsARB MANGLE(DeleteProgramsARB) #define glDeleteProgramsNV MANGLE(DeleteProgramsNV) -#define glDeleteTextures MANGLE(DeleteTextures) #define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT) +#define glDeleteTextures MANGLE(DeleteTextures) #define glDeleteVertexShaderEXT MANGLE(DeleteVertexShaderEXT) +#define glDepthBoundsEXT MANGLE(DepthBoundsEXT) #define glDepthFunc MANGLE(DepthFunc) #define glDepthMask MANGLE(DepthMask) #define glDepthRange MANGLE(DepthRange) #define glDetailTexFuncSGIS MANGLE(DetailTexFuncSGIS) -#define glDisable MANGLE(Disable) #define glDisableClientState MANGLE(DisableClientState) +#define glDisable MANGLE(Disable) #define glDisableTraceMESA MANGLE(DisableTraceMESA) #define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT) #define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB) -#define glDrawArrays MANGLE(DrawArrays) #define glDrawArraysEXT MANGLE(DrawArraysEXT) +#define glDrawArrays MANGLE(DrawArrays) #define glDrawBuffer MANGLE(DrawBuffer) #define glDrawElementArrayATI MANGLE(DrawElementArrayATI) #define glDrawElements MANGLE(DrawElements) #define glDrawMeshArraysSUN MANGLE(DrawMeshArraysSUN) #define glDrawPixels MANGLE(DrawPixels) #define glDrawRangeElementArrayATI MANGLE(DrawRangeElementArrayATI) -#define glDrawRangeElements MANGLE(DrawRangeElements) #define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT) +#define glDrawRangeElements MANGLE(DrawRangeElements) #define glEdgeFlag MANGLE(EdgeFlag) -#define glEdgeFlagPointer MANGLE(EdgeFlagPointer) #define glEdgeFlagPointerEXT MANGLE(EdgeFlagPointerEXT) #define glEdgeFlagPointerListIBM MANGLE(EdgeFlagPointerListIBM) +#define glEdgeFlagPointer MANGLE(EdgeFlagPointer) #define glEdgeFlagv MANGLE(EdgeFlagv) #define glElementPointerATI MANGLE(ElementPointerATI) -#define glEnable MANGLE(Enable) #define glEnableClientState MANGLE(EnableClientState) +#define glEnable MANGLE(Enable) #define glEnableTraceMESA MANGLE(EnableTraceMESA) #define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT) #define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB) -#define glEnd MANGLE(End) #define glEndFragmentShaderATI MANGLE(EndFragmentShaderATI) #define glEndList MANGLE(EndList) +#define glEnd MANGLE(End) #define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV) #define glEndTraceMESA MANGLE(EndTraceMESA) #define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT) @@ -275,38 +280,38 @@ #define glExtractComponentEXT MANGLE(ExtractComponentEXT) #define glFeedbackBuffer MANGLE(FeedbackBuffer) #define glFinalCombinerInputNV MANGLE(FinalCombinerInputNV) -#define glFinish MANGLE(Finish) #define glFinishAsyncSGIX MANGLE(FinishAsyncSGIX) #define glFinishFenceNV MANGLE(FinishFenceNV) +#define glFinish MANGLE(Finish) #define glFinishTextureSUNX MANGLE(FinishTextureSUNX) #define glFlush MANGLE(Flush) #define glFlushRasterSGIX MANGLE(FlushRasterSGIX) #define glFlushVertexArrayRangeNV MANGLE(FlushVertexArrayRangeNV) -#define glFogCoordPointer MANGLE(FogCoordPointer) -#define glFogCoordPointerEXT MANGLE(FogCoordPointerEXT) -#define glFogCoordPointerListIBM MANGLE(FogCoordPointerListIBM) -#define glFogCoordd MANGLE(FogCoordd) #define glFogCoorddEXT MANGLE(FogCoorddEXT) -#define glFogCoorddv MANGLE(FogCoorddv) +#define glFogCoordd MANGLE(FogCoordd) #define glFogCoorddvEXT MANGLE(FogCoorddvEXT) -#define glFogCoordf MANGLE(FogCoordf) +#define glFogCoorddv MANGLE(FogCoorddv) #define glFogCoordfEXT MANGLE(FogCoordfEXT) -#define glFogCoordfv MANGLE(FogCoordfv) +#define glFogCoordf MANGLE(FogCoordf) #define glFogCoordfvEXT MANGLE(FogCoordfvEXT) -#define glFogFuncSGIS MANGLE(FogFuncSGIS) +#define glFogCoordfv MANGLE(FogCoordfv) +#define glFogCoordPointerEXT MANGLE(FogCoordPointerEXT) +#define glFogCoordPointerListIBM MANGLE(FogCoordPointerListIBM) +#define glFogCoordPointer MANGLE(FogCoordPointer) #define glFogf MANGLE(Fogf) +#define glFogFuncSGIS MANGLE(FogFuncSGIS) #define glFogfv MANGLE(Fogfv) #define glFogi MANGLE(Fogi) #define glFogiv MANGLE(Fogiv) #define glFragmentColorMaterialSGIX MANGLE(FragmentColorMaterialSGIX) -#define glFragmentLightModelfSGIX MANGLE(FragmentLightModelfSGIX) -#define glFragmentLightModelfvSGIX MANGLE(FragmentLightModelfvSGIX) -#define glFragmentLightModeliSGIX MANGLE(FragmentLightModeliSGIX) -#define glFragmentLightModelivSGIX MANGLE(FragmentLightModelivSGIX) #define glFragmentLightfSGIX MANGLE(FragmentLightfSGIX) #define glFragmentLightfvSGIX MANGLE(FragmentLightfvSGIX) #define glFragmentLightiSGIX MANGLE(FragmentLightiSGIX) #define glFragmentLightivSGIX MANGLE(FragmentLightivSGIX) +#define glFragmentLightModelfSGIX MANGLE(FragmentLightModelfSGIX) +#define glFragmentLightModelfvSGIX MANGLE(FragmentLightModelfvSGIX) +#define glFragmentLightModeliSGIX MANGLE(FragmentLightModeliSGIX) +#define glFragmentLightModelivSGIX MANGLE(FragmentLightModelivSGIX) #define glFragmentMaterialfSGIX MANGLE(FragmentMaterialfSGIX) #define glFragmentMaterialfvSGIX MANGLE(FragmentMaterialfvSGIX) #define glFragmentMaterialiSGIX MANGLE(FragmentMaterialiSGIX) @@ -315,6 +320,7 @@ #define glFrontFace MANGLE(FrontFace) #define glFrustum MANGLE(Frustum) #define glGenAsyncMarkersSGIX MANGLE(GenAsyncMarkersSGIX) +#define glGenBuffersARB MANGLE(GenBuffersARB) #define glGenFencesNV MANGLE(GenFencesNV) #define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI) #define glGenLists MANGLE(GenLists) @@ -322,20 +328,23 @@ #define glGenProgramsARB MANGLE(GenProgramsARB) #define glGenProgramsNV MANGLE(GenProgramsNV) #define glGenSymbolsEXT MANGLE(GenSymbolsEXT) -#define glGenTextures MANGLE(GenTextures) #define glGenTexturesEXT MANGLE(GenTexturesEXT) +#define glGenTextures MANGLE(GenTextures) #define glGenVertexShadersEXT MANGLE(GenVertexShadersEXT) #define glGetArrayObjectfvATI MANGLE(GetArrayObjectfvATI) #define glGetArrayObjectivATI MANGLE(GetArrayObjectivATI) #define glGetBooleanv MANGLE(GetBooleanv) +#define glGetBufferParameterivARB MANGLE(GetBufferParameterivARB) +#define glGetBufferPointervARB MANGLE(GetBufferPointervARB) +#define glGetBufferSubDataARB MANGLE(GetBufferSubDataARB) #define glGetClipPlane MANGLE(GetClipPlane) -#define glGetColorTable MANGLE(GetColorTable) #define glGetColorTableEXT MANGLE(GetColorTableEXT) -#define glGetColorTableParameterfv MANGLE(GetColorTableParameterfv) +#define glGetColorTable MANGLE(GetColorTable) #define glGetColorTableParameterfvEXT MANGLE(GetColorTableParameterfvEXT) +#define glGetColorTableParameterfv MANGLE(GetColorTableParameterfv) #define glGetColorTableParameterfvSGI MANGLE(GetColorTableParameterfvSGI) -#define glGetColorTableParameteriv MANGLE(GetColorTableParameteriv) #define glGetColorTableParameterivEXT MANGLE(GetColorTableParameterivEXT) +#define glGetColorTableParameteriv MANGLE(GetColorTableParameteriv) #define glGetColorTableParameterivSGI MANGLE(GetColorTableParameterivSGI) #define glGetColorTableSGI MANGLE(GetColorTableSGI) #define glGetCombinerInputParameterfvNV MANGLE(GetCombinerInputParameterfvNV) @@ -343,14 +352,14 @@ #define glGetCombinerOutputParameterfvNV MANGLE(GetCombinerOutputParameterfvNV) #define glGetCombinerOutputParameterivNV MANGLE(GetCombinerOutputParameterivNV) #define glGetCombinerStageParameterfvNV MANGLE(GetCombinerStageParameterfvNV) -#define glGetCompressedTexImage MANGLE(GetCompressedTexImage) #define glGetCompressedTexImageARB MANGLE(GetCompressedTexImageARB) -#define glGetConvolutionFilter MANGLE(GetConvolutionFilter) +#define glGetCompressedTexImage MANGLE(GetCompressedTexImage) #define glGetConvolutionFilterEXT MANGLE(GetConvolutionFilterEXT) -#define glGetConvolutionParameterfv MANGLE(GetConvolutionParameterfv) +#define glGetConvolutionFilter MANGLE(GetConvolutionFilter) #define glGetConvolutionParameterfvEXT MANGLE(GetConvolutionParameterfvEXT) -#define glGetConvolutionParameteriv MANGLE(GetConvolutionParameteriv) +#define glGetConvolutionParameterfv MANGLE(GetConvolutionParameterfv) #define glGetConvolutionParameterivEXT MANGLE(GetConvolutionParameterivEXT) +#define glGetConvolutionParameteriv MANGLE(GetConvolutionParameteriv) #define glGetDetailTexFuncSGIS MANGLE(GetDetailTexFuncSGIS) #define glGetDoublev MANGLE(GetDoublev) #define glGetError MANGLE(GetError) @@ -363,12 +372,12 @@ #define glGetFragmentLightivSGIX MANGLE(GetFragmentLightivSGIX) #define glGetFragmentMaterialfvSGIX MANGLE(GetFragmentMaterialfvSGIX) #define glGetFragmentMaterialivSGIX MANGLE(GetFragmentMaterialivSGIX) -#define glGetHistogram MANGLE(GetHistogram) #define glGetHistogramEXT MANGLE(GetHistogramEXT) -#define glGetHistogramParameterfv MANGLE(GetHistogramParameterfv) +#define glGetHistogram MANGLE(GetHistogram) #define glGetHistogramParameterfvEXT MANGLE(GetHistogramParameterfvEXT) -#define glGetHistogramParameteriv MANGLE(GetHistogramParameteriv) +#define glGetHistogramParameterfv MANGLE(GetHistogramParameterfv) #define glGetHistogramParameterivEXT MANGLE(GetHistogramParameterivEXT) +#define glGetHistogramParameteriv MANGLE(GetHistogramParameteriv) #define glGetImageTransformParameterfvHP MANGLE(GetImageTransformParameterfvHP) #define glGetImageTransformParameterivHP MANGLE(GetImageTransformParameterivHP) #define glGetInstrumentsSGIX MANGLE(GetInstrumentsSGIX) @@ -386,19 +395,19 @@ #define glGetMapAttribParameterfvNV MANGLE(GetMapAttribParameterfvNV) #define glGetMapAttribParameterivNV MANGLE(GetMapAttribParameterivNV) #define glGetMapControlPointsNV MANGLE(GetMapControlPointsNV) -#define glGetMapParameterfvNV MANGLE(GetMapParameterfvNV) -#define glGetMapParameterivNV MANGLE(GetMapParameterivNV) #define glGetMapdv MANGLE(GetMapdv) #define glGetMapfv MANGLE(GetMapfv) #define glGetMapiv MANGLE(GetMapiv) +#define glGetMapParameterfvNV MANGLE(GetMapParameterfvNV) +#define glGetMapParameterivNV MANGLE(GetMapParameterivNV) #define glGetMaterialfv MANGLE(GetMaterialfv) #define glGetMaterialiv MANGLE(GetMaterialiv) -#define glGetMinmax MANGLE(GetMinmax) #define glGetMinmaxEXT MANGLE(GetMinmaxEXT) -#define glGetMinmaxParameterfv MANGLE(GetMinmaxParameterfv) +#define glGetMinmax MANGLE(GetMinmax) #define glGetMinmaxParameterfvEXT MANGLE(GetMinmaxParameterfvEXT) -#define glGetMinmaxParameteriv MANGLE(GetMinmaxParameteriv) +#define glGetMinmaxParameterfv MANGLE(GetMinmaxParameterfv) #define glGetMinmaxParameterivEXT MANGLE(GetMinmaxParameterivEXT) +#define glGetMinmaxParameteriv MANGLE(GetMinmaxParameteriv) #define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI) #define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI) #define glGetOcclusionQueryivNV MANGLE(GetOcclusionQueryivNV) @@ -408,21 +417,23 @@ #define glGetPixelMapusv MANGLE(GetPixelMapusv) #define glGetPixelTexGenParameterfvSGIS MANGLE(GetPixelTexGenParameterfvSGIS) #define glGetPixelTexGenParameterivSGIS MANGLE(GetPixelTexGenParameterivSGIS) -#define glGetPointerv MANGLE(GetPointerv) #define glGetPointervEXT MANGLE(GetPointervEXT) +#define glGetPointerv MANGLE(GetPointerv) #define glGetPolygonStipple MANGLE(GetPolygonStipple) #define glGetProgramEnvParameterdvARB MANGLE(GetProgramEnvParameterdvARB) #define glGetProgramEnvParameterfvARB MANGLE(GetProgramEnvParameterfvARB) +#define glGetProgramivARB MANGLE(GetProgramivARB) +#define glGetProgramivNV MANGLE(GetProgramivNV) #define glGetProgramLocalParameterdvARB MANGLE(GetProgramLocalParameterdvARB) #define glGetProgramLocalParameterfvARB MANGLE(GetProgramLocalParameterfvARB) +#define glGetProgramNamedParameterdvNV MANGLE(GetProgramNamedParameterdvNV) +#define glGetProgramNamedParameterfvNV MANGLE(GetProgramNamedParameterfvNV) #define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV) #define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV) #define glGetProgramStringARB MANGLE(GetProgramStringARB) #define glGetProgramStringNV MANGLE(GetProgramStringNV) -#define glGetProgramivARB MANGLE(GetProgramivARB) -#define glGetProgramivNV MANGLE(GetProgramivNV) -#define glGetSeparableFilter MANGLE(GetSeparableFilter) #define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT) +#define glGetSeparableFilter MANGLE(GetSeparableFilter) #define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS) #define glGetString MANGLE(GetString) #define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI) @@ -445,14 +456,14 @@ #define glGetVariantFloatvEXT MANGLE(GetVariantFloatvEXT) #define glGetVariantIntegervEXT MANGLE(GetVariantIntegervEXT) #define glGetVariantPointervEXT MANGLE(GetVariantPointervEXT) -#define glGetVertexAttribPointervARB MANGLE(GetVertexAttribPointervARB) -#define glGetVertexAttribPointervNV MANGLE(GetVertexAttribPointervNV) #define glGetVertexAttribdvARB MANGLE(GetVertexAttribdvARB) #define glGetVertexAttribdvNV MANGLE(GetVertexAttribdvNV) #define glGetVertexAttribfvARB MANGLE(GetVertexAttribfvARB) #define glGetVertexAttribfvNV MANGLE(GetVertexAttribfvNV) #define glGetVertexAttribivARB MANGLE(GetVertexAttribivARB) #define glGetVertexAttribivNV MANGLE(GetVertexAttribivNV) +#define glGetVertexAttribPointervARB MANGLE(GetVertexAttribPointervARB) +#define glGetVertexAttribPointervNV MANGLE(GetVertexAttribPointervNV) #define glGlobalAlphaFactorbSUN MANGLE(GlobalAlphaFactorbSUN) #define glGlobalAlphaFactordSUN MANGLE(GlobalAlphaFactordSUN) #define glGlobalAlphaFactorfSUN MANGLE(GlobalAlphaFactorfSUN) @@ -463,25 +474,25 @@ #define glGlobalAlphaFactorusSUN MANGLE(GlobalAlphaFactorusSUN) #define glHint MANGLE(Hint) #define glHintPGI MANGLE(HintPGI) -#define glHistogram MANGLE(Histogram) #define glHistogramEXT MANGLE(HistogramEXT) +#define glHistogram MANGLE(Histogram) #define glIglooInterfaceSGIX MANGLE(IglooInterfaceSGIX) #define glImageTransformParameterfHP MANGLE(ImageTransformParameterfHP) #define glImageTransformParameterfvHP MANGLE(ImageTransformParameterfvHP) #define glImageTransformParameteriHP MANGLE(ImageTransformParameteriHP) #define glImageTransformParameterivHP MANGLE(ImageTransformParameterivHP) -#define glIndexFuncEXT MANGLE(IndexFuncEXT) -#define glIndexMask MANGLE(IndexMask) -#define glIndexMaterialEXT MANGLE(IndexMaterialEXT) -#define glIndexPointer MANGLE(IndexPointer) -#define glIndexPointerEXT MANGLE(IndexPointerEXT) -#define glIndexPointerListIBM MANGLE(IndexPointerListIBM) #define glIndexd MANGLE(Indexd) #define glIndexdv MANGLE(Indexdv) #define glIndexf MANGLE(Indexf) +#define glIndexFuncEXT MANGLE(IndexFuncEXT) #define glIndexfv MANGLE(Indexfv) #define glIndexi MANGLE(Indexi) #define glIndexiv MANGLE(Indexiv) +#define glIndexMask MANGLE(IndexMask) +#define glIndexMaterialEXT MANGLE(IndexMaterialEXT) +#define glIndexPointerEXT MANGLE(IndexPointerEXT) +#define glIndexPointerListIBM MANGLE(IndexPointerListIBM) +#define glIndexPointer MANGLE(IndexPointer) #define glIndexs MANGLE(Indexs) #define glIndexsv MANGLE(Indexsv) #define glIndexub MANGLE(Indexub) @@ -498,18 +509,18 @@ #define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV) #define glIsProgramARB MANGLE(IsProgramARB) #define glIsProgramNV MANGLE(IsProgramNV) -#define glIsTexture MANGLE(IsTexture) #define glIsTextureEXT MANGLE(IsTextureEXT) +#define glIsTexture MANGLE(IsTexture) #define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT) #define glLightEnviSGIX MANGLE(LightEnviSGIX) -#define glLightModelf MANGLE(LightModelf) -#define glLightModelfv MANGLE(LightModelfv) -#define glLightModeli MANGLE(LightModeli) -#define glLightModeliv MANGLE(LightModeliv) #define glLightf MANGLE(Lightf) #define glLightfv MANGLE(Lightfv) #define glLighti MANGLE(Lighti) #define glLightiv MANGLE(Lightiv) +#define glLightModelf MANGLE(LightModelf) +#define glLightModelfv MANGLE(LightModelfv) +#define glLightModeli MANGLE(LightModeli) +#define glLightModeliv MANGLE(LightModeliv) #define glLineStipple MANGLE(LineStipple) #define glLineWidth MANGLE(LineWidth) #define glListBase MANGLE(ListBase) @@ -517,22 +528,23 @@ #define glListParameterfvSGIX MANGLE(ListParameterfvSGIX) #define glListParameteriSGIX MANGLE(ListParameteriSGIX) #define glListParameterivSGIX MANGLE(ListParameterivSGIX) -#define glLoadIdentity MANGLE(LoadIdentity) #define glLoadIdentityDeformationMapSGIX MANGLE(LoadIdentityDeformationMapSGIX) +#define glLoadIdentity MANGLE(LoadIdentity) #define glLoadMatrixd MANGLE(LoadMatrixd) #define glLoadMatrixf MANGLE(LoadMatrixf) #define glLoadName MANGLE(LoadName) #define glLoadProgramNV MANGLE(LoadProgramNV) -#define glLoadTransposeMatrixd MANGLE(LoadTransposeMatrixd) #define glLoadTransposeMatrixdARB MANGLE(LoadTransposeMatrixdARB) -#define glLoadTransposeMatrixf MANGLE(LoadTransposeMatrixf) +#define glLoadTransposeMatrixd MANGLE(LoadTransposeMatrixd) #define glLoadTransposeMatrixfARB MANGLE(LoadTransposeMatrixfARB) +#define glLoadTransposeMatrixf MANGLE(LoadTransposeMatrixf) #define glLockArraysEXT MANGLE(LockArraysEXT) #define glLogicOp MANGLE(LogicOp) #define glMap1d MANGLE(Map1d) #define glMap1f MANGLE(Map1f) #define glMap2d MANGLE(Map2d) #define glMap2f MANGLE(Map2f) +#define glMapBufferARB MANGLE(MapBufferARB) #define glMapControlPointsNV MANGLE(MapControlPointsNV) #define glMapGrid1d MANGLE(MapGrid1d) #define glMapGrid1f MANGLE(MapGrid1f) @@ -549,84 +561,84 @@ #define glMatrixIndexuivARB MANGLE(MatrixIndexuivARB) #define glMatrixIndexusvARB MANGLE(MatrixIndexusvARB) #define glMatrixMode MANGLE(MatrixMode) -#define glMinmax MANGLE(Minmax) #define glMinmaxEXT MANGLE(MinmaxEXT) -#define glMultMatrixd MANGLE(MultMatrixd) -#define glMultMatrixf MANGLE(MultMatrixf) -#define glMultTransposeMatrixd MANGLE(MultTransposeMatrixd) -#define glMultTransposeMatrixdARB MANGLE(MultTransposeMatrixdARB) -#define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf) -#define glMultTransposeMatrixfARB MANGLE(MultTransposeMatrixfARB) -#define glMultiDrawArrays MANGLE(MultiDrawArrays) +#define glMinmax MANGLE(Minmax) #define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT) -#define glMultiDrawElements MANGLE(MultiDrawElements) +#define glMultiDrawArrays MANGLE(MultiDrawArrays) #define glMultiDrawElementsEXT MANGLE(MultiDrawElementsEXT) +#define glMultiDrawElements MANGLE(MultiDrawElements) #define glMultiModeDrawArraysIBM MANGLE(MultiModeDrawArraysIBM) #define glMultiModeDrawElementsIBM MANGLE(MultiModeDrawElementsIBM) -#define glMultiTexCoord1d MANGLE(MultiTexCoord1d) #define glMultiTexCoord1dARB MANGLE(MultiTexCoord1dARB) -#define glMultiTexCoord1dv MANGLE(MultiTexCoord1dv) +#define glMultiTexCoord1d MANGLE(MultiTexCoord1d) #define glMultiTexCoord1dvARB MANGLE(MultiTexCoord1dvARB) -#define glMultiTexCoord1f MANGLE(MultiTexCoord1f) +#define glMultiTexCoord1dv MANGLE(MultiTexCoord1dv) #define glMultiTexCoord1fARB MANGLE(MultiTexCoord1fARB) -#define glMultiTexCoord1fv MANGLE(MultiTexCoord1fv) +#define glMultiTexCoord1f MANGLE(MultiTexCoord1f) #define glMultiTexCoord1fvARB MANGLE(MultiTexCoord1fvARB) -#define glMultiTexCoord1i MANGLE(MultiTexCoord1i) +#define glMultiTexCoord1fv MANGLE(MultiTexCoord1fv) #define glMultiTexCoord1iARB MANGLE(MultiTexCoord1iARB) -#define glMultiTexCoord1iv MANGLE(MultiTexCoord1iv) +#define glMultiTexCoord1i MANGLE(MultiTexCoord1i) #define glMultiTexCoord1ivARB MANGLE(MultiTexCoord1ivARB) -#define glMultiTexCoord1s MANGLE(MultiTexCoord1s) +#define glMultiTexCoord1iv MANGLE(MultiTexCoord1iv) #define glMultiTexCoord1sARB MANGLE(MultiTexCoord1sARB) -#define glMultiTexCoord1sv MANGLE(MultiTexCoord1sv) +#define glMultiTexCoord1s MANGLE(MultiTexCoord1s) #define glMultiTexCoord1svARB MANGLE(MultiTexCoord1svARB) -#define glMultiTexCoord2d MANGLE(MultiTexCoord2d) +#define glMultiTexCoord1sv MANGLE(MultiTexCoord1sv) #define glMultiTexCoord2dARB MANGLE(MultiTexCoord2dARB) -#define glMultiTexCoord2dv MANGLE(MultiTexCoord2dv) +#define glMultiTexCoord2d MANGLE(MultiTexCoord2d) #define glMultiTexCoord2dvARB MANGLE(MultiTexCoord2dvARB) -#define glMultiTexCoord2f MANGLE(MultiTexCoord2f) +#define glMultiTexCoord2dv MANGLE(MultiTexCoord2dv) #define glMultiTexCoord2fARB MANGLE(MultiTexCoord2fARB) -#define glMultiTexCoord2fv MANGLE(MultiTexCoord2fv) +#define glMultiTexCoord2f MANGLE(MultiTexCoord2f) #define glMultiTexCoord2fvARB MANGLE(MultiTexCoord2fvARB) -#define glMultiTexCoord2i MANGLE(MultiTexCoord2i) +#define glMultiTexCoord2fv MANGLE(MultiTexCoord2fv) #define glMultiTexCoord2iARB MANGLE(MultiTexCoord2iARB) -#define glMultiTexCoord2iv MANGLE(MultiTexCoord2iv) +#define glMultiTexCoord2i MANGLE(MultiTexCoord2i) #define glMultiTexCoord2ivARB MANGLE(MultiTexCoord2ivARB) -#define glMultiTexCoord2s MANGLE(MultiTexCoord2s) +#define glMultiTexCoord2iv MANGLE(MultiTexCoord2iv) #define glMultiTexCoord2sARB MANGLE(MultiTexCoord2sARB) -#define glMultiTexCoord2sv MANGLE(MultiTexCoord2sv) +#define glMultiTexCoord2s MANGLE(MultiTexCoord2s) #define glMultiTexCoord2svARB MANGLE(MultiTexCoord2svARB) -#define glMultiTexCoord3d MANGLE(MultiTexCoord3d) +#define glMultiTexCoord2sv MANGLE(MultiTexCoord2sv) #define glMultiTexCoord3dARB MANGLE(MultiTexCoord3dARB) -#define glMultiTexCoord3dv MANGLE(MultiTexCoord3dv) +#define glMultiTexCoord3d MANGLE(MultiTexCoord3d) #define glMultiTexCoord3dvARB MANGLE(MultiTexCoord3dvARB) -#define glMultiTexCoord3f MANGLE(MultiTexCoord3f) +#define glMultiTexCoord3dv MANGLE(MultiTexCoord3dv) #define glMultiTexCoord3fARB MANGLE(MultiTexCoord3fARB) -#define glMultiTexCoord3fv MANGLE(MultiTexCoord3fv) +#define glMultiTexCoord3f MANGLE(MultiTexCoord3f) #define glMultiTexCoord3fvARB MANGLE(MultiTexCoord3fvARB) -#define glMultiTexCoord3i MANGLE(MultiTexCoord3i) +#define glMultiTexCoord3fv MANGLE(MultiTexCoord3fv) #define glMultiTexCoord3iARB MANGLE(MultiTexCoord3iARB) -#define glMultiTexCoord3iv MANGLE(MultiTexCoord3iv) +#define glMultiTexCoord3i MANGLE(MultiTexCoord3i) #define glMultiTexCoord3ivARB MANGLE(MultiTexCoord3ivARB) -#define glMultiTexCoord3s MANGLE(MultiTexCoord3s) +#define glMultiTexCoord3iv MANGLE(MultiTexCoord3iv) #define glMultiTexCoord3sARB MANGLE(MultiTexCoord3sARB) -#define glMultiTexCoord3sv MANGLE(MultiTexCoord3sv) +#define glMultiTexCoord3s MANGLE(MultiTexCoord3s) #define glMultiTexCoord3svARB MANGLE(MultiTexCoord3svARB) -#define glMultiTexCoord4d MANGLE(MultiTexCoord4d) +#define glMultiTexCoord3sv MANGLE(MultiTexCoord3sv) #define glMultiTexCoord4dARB MANGLE(MultiTexCoord4dARB) -#define glMultiTexCoord4dv MANGLE(MultiTexCoord4dv) +#define glMultiTexCoord4d MANGLE(MultiTexCoord4d) #define glMultiTexCoord4dvARB MANGLE(MultiTexCoord4dvARB) -#define glMultiTexCoord4f MANGLE(MultiTexCoord4f) +#define glMultiTexCoord4dv MANGLE(MultiTexCoord4dv) #define glMultiTexCoord4fARB MANGLE(MultiTexCoord4fARB) -#define glMultiTexCoord4fv MANGLE(MultiTexCoord4fv) +#define glMultiTexCoord4f MANGLE(MultiTexCoord4f) #define glMultiTexCoord4fvARB MANGLE(MultiTexCoord4fvARB) -#define glMultiTexCoord4i MANGLE(MultiTexCoord4i) +#define glMultiTexCoord4fv MANGLE(MultiTexCoord4fv) #define glMultiTexCoord4iARB MANGLE(MultiTexCoord4iARB) -#define glMultiTexCoord4iv MANGLE(MultiTexCoord4iv) +#define glMultiTexCoord4i MANGLE(MultiTexCoord4i) #define glMultiTexCoord4ivARB MANGLE(MultiTexCoord4ivARB) -#define glMultiTexCoord4s MANGLE(MultiTexCoord4s) +#define glMultiTexCoord4iv MANGLE(MultiTexCoord4iv) #define glMultiTexCoord4sARB MANGLE(MultiTexCoord4sARB) -#define glMultiTexCoord4sv MANGLE(MultiTexCoord4sv) +#define glMultiTexCoord4s MANGLE(MultiTexCoord4s) #define glMultiTexCoord4svARB MANGLE(MultiTexCoord4svARB) +#define glMultiTexCoord4sv MANGLE(MultiTexCoord4sv) +#define glMultMatrixd MANGLE(MultMatrixd) +#define glMultMatrixf MANGLE(MultMatrixf) +#define glMultTransposeMatrixdARB MANGLE(MultTransposeMatrixdARB) +#define glMultTransposeMatrixd MANGLE(MultTransposeMatrixd) +#define glMultTransposeMatrixfARB MANGLE(MultTransposeMatrixfARB) +#define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf) #define glNewList MANGLE(NewList) #define glNewObjectBufferATI MANGLE(NewObjectBufferATI) #define glNewTraceMESA MANGLE(NewTraceMESA) @@ -642,9 +654,9 @@ #define glNormal3iv MANGLE(Normal3iv) #define glNormal3s MANGLE(Normal3s) #define glNormal3sv MANGLE(Normal3sv) -#define glNormalPointer MANGLE(NormalPointer) #define glNormalPointerEXT MANGLE(NormalPointerEXT) #define glNormalPointerListIBM MANGLE(NormalPointerListIBM) +#define glNormalPointer MANGLE(NormalPointer) #define glNormalPointervINTEL MANGLE(NormalPointervINTEL) #define glNormalStream3bATI MANGLE(NormalStream3bATI) #define glNormalStream3bvATI MANGLE(NormalStream3bvATI) @@ -657,8 +669,6 @@ #define glNormalStream3sATI MANGLE(NormalStream3sATI) #define glNormalStream3svATI MANGLE(NormalStream3svATI) #define glOrtho MANGLE(Ortho) -#define glPNTrianglesfATI MANGLE(PNTrianglesfATI) -#define glPNTrianglesiATI MANGLE(PNTrianglesiATI) #define glPassTexCoordATI MANGLE(PassTexCoordATI) #define glPassThrough MANGLE(PassThrough) #define glPixelMapfv MANGLE(PixelMapfv) @@ -678,13 +688,15 @@ #define glPixelTransformParameteriEXT MANGLE(PixelTransformParameteriEXT) #define glPixelTransformParameterivEXT MANGLE(PixelTransformParameterivEXT) #define glPixelZoom MANGLE(PixelZoom) -#define glPointParameterf MANGLE(PointParameterf) +#define glPNTrianglesfATI MANGLE(PNTrianglesfATI) +#define glPNTrianglesiATI MANGLE(PNTrianglesiATI) #define glPointParameterfARB MANGLE(PointParameterfARB) #define glPointParameterfEXT MANGLE(PointParameterfEXT) +#define glPointParameterf MANGLE(PointParameterf) #define glPointParameterfSGIS MANGLE(PointParameterfSGIS) -#define glPointParameterfv MANGLE(PointParameterfv) #define glPointParameterfvARB MANGLE(PointParameterfvARB) #define glPointParameterfvEXT MANGLE(PointParameterfvEXT) +#define glPointParameterfv MANGLE(PointParameterfv) #define glPointParameterfvSGIS MANGLE(PointParameterfvSGIS) #define glPointParameteri MANGLE(PointParameteri) #define glPointParameteriNV MANGLE(PointParameteriNV) @@ -694,15 +706,15 @@ #define glPollAsyncSGIX MANGLE(PollAsyncSGIX) #define glPollInstrumentsSGIX MANGLE(PollInstrumentsSGIX) #define glPolygonMode MANGLE(PolygonMode) -#define glPolygonOffset MANGLE(PolygonOffset) #define glPolygonOffsetEXT MANGLE(PolygonOffsetEXT) +#define glPolygonOffset MANGLE(PolygonOffset) #define glPolygonStipple MANGLE(PolygonStipple) #define glPopAttrib MANGLE(PopAttrib) #define glPopClientAttrib MANGLE(PopClientAttrib) #define glPopMatrix MANGLE(PopMatrix) #define glPopName MANGLE(PopName) -#define glPrioritizeTextures MANGLE(PrioritizeTextures) #define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT) +#define glPrioritizeTextures MANGLE(PrioritizeTextures) #define glProgramEnvParameter4dARB MANGLE(ProgramEnvParameter4dARB) #define glProgramEnvParameter4dvARB MANGLE(ProgramEnvParameter4dvARB) #define glProgramEnvParameter4fARB MANGLE(ProgramEnvParameter4fARB) @@ -711,6 +723,10 @@ #define glProgramLocalParameter4dvARB MANGLE(ProgramLocalParameter4dvARB) #define glProgramLocalParameter4fARB MANGLE(ProgramLocalParameter4fARB) #define glProgramLocalParameter4fvARB MANGLE(ProgramLocalParameter4fvARB) +#define glProgramNamedParameter4dNV MANGLE(ProgramNamedParameter4dNV) +#define glProgramNamedParameter4dvNV MANGLE(ProgramNamedParameter4dvNV) +#define glProgramNamedParameter4fNV MANGLE(ProgramNamedParameter4fNV) +#define glProgramNamedParameter4fvNV MANGLE(ProgramNamedParameter4fvNV) #define glProgramParameter4dNV MANGLE(ProgramParameter4dNV) #define glProgramParameter4dvNV MANGLE(ProgramParameter4dvNV) #define glProgramParameter4fNV MANGLE(ProgramParameter4fNV) @@ -783,15 +799,15 @@ #define glReplacementCodeusSUN MANGLE(ReplacementCodeusSUN) #define glReplacementCodeusvSUN MANGLE(ReplacementCodeusvSUN) #define glRequestResidentProgramsNV MANGLE(RequestResidentProgramsNV) -#define glResetHistogram MANGLE(ResetHistogram) #define glResetHistogramEXT MANGLE(ResetHistogramEXT) -#define glResetMinmax MANGLE(ResetMinmax) +#define glResetHistogram MANGLE(ResetHistogram) #define glResetMinmaxEXT MANGLE(ResetMinmaxEXT) +#define glResetMinmax MANGLE(ResetMinmax) #define glResizeBuffersMESA MANGLE(ResizeBuffersMESA) #define glRotated MANGLE(Rotated) #define glRotatef MANGLE(Rotatef) -#define glSampleCoverage MANGLE(SampleCoverage) #define glSampleCoverageARB MANGLE(SampleCoverageARB) +#define glSampleCoverage MANGLE(SampleCoverage) #define glSampleMapATI MANGLE(SampleMapATI) #define glSampleMaskEXT MANGLE(SampleMaskEXT) #define glSampleMaskSGIS MANGLE(SampleMaskSGIS) @@ -800,44 +816,44 @@ #define glScaled MANGLE(Scaled) #define glScalef MANGLE(Scalef) #define glScissor MANGLE(Scissor) -#define glSecondaryColor3b MANGLE(SecondaryColor3b) #define glSecondaryColor3bEXT MANGLE(SecondaryColor3bEXT) -#define glSecondaryColor3bv MANGLE(SecondaryColor3bv) +#define glSecondaryColor3b MANGLE(SecondaryColor3b) #define glSecondaryColor3bvEXT MANGLE(SecondaryColor3bvEXT) -#define glSecondaryColor3d MANGLE(SecondaryColor3d) +#define glSecondaryColor3bv MANGLE(SecondaryColor3bv) #define glSecondaryColor3dEXT MANGLE(SecondaryColor3dEXT) -#define glSecondaryColor3dv MANGLE(SecondaryColor3dv) +#define glSecondaryColor3d MANGLE(SecondaryColor3d) #define glSecondaryColor3dvEXT MANGLE(SecondaryColor3dvEXT) -#define glSecondaryColor3f MANGLE(SecondaryColor3f) +#define glSecondaryColor3dv MANGLE(SecondaryColor3dv) #define glSecondaryColor3fEXT MANGLE(SecondaryColor3fEXT) -#define glSecondaryColor3fv MANGLE(SecondaryColor3fv) +#define glSecondaryColor3f MANGLE(SecondaryColor3f) #define glSecondaryColor3fvEXT MANGLE(SecondaryColor3fvEXT) -#define glSecondaryColor3i MANGLE(SecondaryColor3i) +#define glSecondaryColor3fv MANGLE(SecondaryColor3fv) #define glSecondaryColor3iEXT MANGLE(SecondaryColor3iEXT) -#define glSecondaryColor3iv MANGLE(SecondaryColor3iv) +#define glSecondaryColor3i MANGLE(SecondaryColor3i) #define glSecondaryColor3ivEXT MANGLE(SecondaryColor3ivEXT) -#define glSecondaryColor3s MANGLE(SecondaryColor3s) +#define glSecondaryColor3iv MANGLE(SecondaryColor3iv) #define glSecondaryColor3sEXT MANGLE(SecondaryColor3sEXT) -#define glSecondaryColor3sv MANGLE(SecondaryColor3sv) +#define glSecondaryColor3s MANGLE(SecondaryColor3s) #define glSecondaryColor3svEXT MANGLE(SecondaryColor3svEXT) -#define glSecondaryColor3ub MANGLE(SecondaryColor3ub) +#define glSecondaryColor3sv MANGLE(SecondaryColor3sv) #define glSecondaryColor3ubEXT MANGLE(SecondaryColor3ubEXT) -#define glSecondaryColor3ubv MANGLE(SecondaryColor3ubv) +#define glSecondaryColor3ub MANGLE(SecondaryColor3ub) #define glSecondaryColor3ubvEXT MANGLE(SecondaryColor3ubvEXT) -#define glSecondaryColor3ui MANGLE(SecondaryColor3ui) +#define glSecondaryColor3ubv MANGLE(SecondaryColor3ubv) #define glSecondaryColor3uiEXT MANGLE(SecondaryColor3uiEXT) -#define glSecondaryColor3uiv MANGLE(SecondaryColor3uiv) +#define glSecondaryColor3ui MANGLE(SecondaryColor3ui) #define glSecondaryColor3uivEXT MANGLE(SecondaryColor3uivEXT) -#define glSecondaryColor3us MANGLE(SecondaryColor3us) +#define glSecondaryColor3uiv MANGLE(SecondaryColor3uiv) #define glSecondaryColor3usEXT MANGLE(SecondaryColor3usEXT) -#define glSecondaryColor3usv MANGLE(SecondaryColor3usv) +#define glSecondaryColor3us MANGLE(SecondaryColor3us) #define glSecondaryColor3usvEXT MANGLE(SecondaryColor3usvEXT) -#define glSecondaryColorPointer MANGLE(SecondaryColorPointer) +#define glSecondaryColor3usv MANGLE(SecondaryColor3usv) #define glSecondaryColorPointerEXT MANGLE(SecondaryColorPointerEXT) #define glSecondaryColorPointerListIBM MANGLE(SecondaryColorPointerListIBM) +#define glSecondaryColorPointer MANGLE(SecondaryColorPointer) #define glSelectBuffer MANGLE(SelectBuffer) -#define glSeparableFilter2D MANGLE(SeparableFilter2D) #define glSeparableFilter2DEXT MANGLE(SeparableFilter2DEXT) +#define glSeparableFilter2D MANGLE(SeparableFilter2D) #define glSetFenceNV MANGLE(SetFenceNV) #define glSetFragmentShaderConstantATI MANGLE(SetFragmentShaderConstantATI) #define glSetInvariantEXT MANGLE(SetInvariantEXT) @@ -883,13 +899,13 @@ #define glTexCoord1sv MANGLE(TexCoord1sv) #define glTexCoord2d MANGLE(TexCoord2d) #define glTexCoord2dv MANGLE(TexCoord2dv) -#define glTexCoord2f MANGLE(TexCoord2f) #define glTexCoord2fColor3fVertex3fSUN MANGLE(TexCoord2fColor3fVertex3fSUN) #define glTexCoord2fColor3fVertex3fvSUN MANGLE(TexCoord2fColor3fVertex3fvSUN) #define glTexCoord2fColor4fNormal3fVertex3fSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fSUN) #define glTexCoord2fColor4fNormal3fVertex3fvSUN MANGLE(TexCoord2fColor4fNormal3fVertex3fvSUN) #define glTexCoord2fColor4ubVertex3fSUN MANGLE(TexCoord2fColor4ubVertex3fSUN) #define glTexCoord2fColor4ubVertex3fvSUN MANGLE(TexCoord2fColor4ubVertex3fvSUN) +#define glTexCoord2f MANGLE(TexCoord2f) #define glTexCoord2fNormal3fVertex3fSUN MANGLE(TexCoord2fNormal3fVertex3fSUN) #define glTexCoord2fNormal3fVertex3fvSUN MANGLE(TexCoord2fNormal3fVertex3fvSUN) #define glTexCoord2fVertex3fSUN MANGLE(TexCoord2fVertex3fSUN) @@ -909,9 +925,9 @@ #define glTexCoord3sv MANGLE(TexCoord3sv) #define glTexCoord4d MANGLE(TexCoord4d) #define glTexCoord4dv MANGLE(TexCoord4dv) -#define glTexCoord4f MANGLE(TexCoord4f) #define glTexCoord4fColor4fNormal3fVertex4fSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fSUN) #define glTexCoord4fColor4fNormal3fVertex4fvSUN MANGLE(TexCoord4fColor4fNormal3fVertex4fvSUN) +#define glTexCoord4f MANGLE(TexCoord4f) #define glTexCoord4fVertex4fSUN MANGLE(TexCoord4fVertex4fSUN) #define glTexCoord4fVertex4fvSUN MANGLE(TexCoord4fVertex4fvSUN) #define glTexCoord4fv MANGLE(TexCoord4fv) @@ -919,9 +935,9 @@ #define glTexCoord4iv MANGLE(TexCoord4iv) #define glTexCoord4s MANGLE(TexCoord4s) #define glTexCoord4sv MANGLE(TexCoord4sv) -#define glTexCoordPointer MANGLE(TexCoordPointer) #define glTexCoordPointerEXT MANGLE(TexCoordPointerEXT) #define glTexCoordPointerListIBM MANGLE(TexCoordPointerListIBM) +#define glTexCoordPointer MANGLE(TexCoordPointer) #define glTexCoordPointervINTEL MANGLE(TexCoordPointervINTEL) #define glTexEnvf MANGLE(TexEnvf) #define glTexEnvfv MANGLE(TexEnvfv) @@ -936,19 +952,19 @@ #define glTexGeniv MANGLE(TexGeniv) #define glTexImage1D MANGLE(TexImage1D) #define glTexImage2D MANGLE(TexImage2D) -#define glTexImage3D MANGLE(TexImage3D) #define glTexImage3DEXT MANGLE(TexImage3DEXT) +#define glTexImage3D MANGLE(TexImage3D) #define glTexImage4DSGIS MANGLE(TexImage4DSGIS) #define glTexParameterf MANGLE(TexParameterf) #define glTexParameterfv MANGLE(TexParameterfv) #define glTexParameteri MANGLE(TexParameteri) #define glTexParameteriv MANGLE(TexParameteriv) -#define glTexSubImage1D MANGLE(TexSubImage1D) #define glTexSubImage1DEXT MANGLE(TexSubImage1DEXT) -#define glTexSubImage2D MANGLE(TexSubImage2D) +#define glTexSubImage1D MANGLE(TexSubImage1D) #define glTexSubImage2DEXT MANGLE(TexSubImage2DEXT) -#define glTexSubImage3D MANGLE(TexSubImage3D) +#define glTexSubImage2D MANGLE(TexSubImage2D) #define glTexSubImage3DEXT MANGLE(TexSubImage3DEXT) +#define glTexSubImage3D MANGLE(TexSubImage3D) #define glTexSubImage4DSGIS MANGLE(TexSubImage4DSGIS) #define glTextureColorMaskSGIS MANGLE(TextureColorMaskSGIS) #define glTextureLightEXT MANGLE(TextureLightEXT) @@ -964,13 +980,14 @@ #define glTranslated MANGLE(Translated) #define glTranslatef MANGLE(Translatef) #define glUnlockArraysEXT MANGLE(UnlockArraysEXT) +#define glUnmapBufferARB MANGLE(UnmapBufferARB) #define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI) #define glVariantArrayObjectATI MANGLE(VariantArrayObjectATI) -#define glVariantPointerEXT MANGLE(VariantPointerEXT) #define glVariantbvEXT MANGLE(VariantbvEXT) #define glVariantdvEXT MANGLE(VariantdvEXT) #define glVariantfvEXT MANGLE(VariantfvEXT) #define glVariantivEXT MANGLE(VariantivEXT) +#define glVariantPointerEXT MANGLE(VariantPointerEXT) #define glVariantsvEXT MANGLE(VariantsvEXT) #define glVariantubvEXT MANGLE(VariantubvEXT) #define glVariantuivEXT MANGLE(VariantuivEXT) @@ -1036,13 +1053,6 @@ #define glVertexAttrib3sNV MANGLE(VertexAttrib3sNV) #define glVertexAttrib3svARB MANGLE(VertexAttrib3svARB) #define glVertexAttrib3svNV MANGLE(VertexAttrib3svNV) -#define glVertexAttrib4NbvARB MANGLE(VertexAttrib4NbvARB) -#define glVertexAttrib4NivARB MANGLE(VertexAttrib4NivARB) -#define glVertexAttrib4NsvARB MANGLE(VertexAttrib4NsvARB) -#define glVertexAttrib4NubARB MANGLE(VertexAttrib4NubARB) -#define glVertexAttrib4NubvARB MANGLE(VertexAttrib4NubvARB) -#define glVertexAttrib4NuivARB MANGLE(VertexAttrib4NuivARB) -#define glVertexAttrib4NusvARB MANGLE(VertexAttrib4NusvARB) #define glVertexAttrib4bvARB MANGLE(VertexAttrib4bvARB) #define glVertexAttrib4dARB MANGLE(VertexAttrib4dARB) #define glVertexAttrib4dNV MANGLE(VertexAttrib4dNV) @@ -1053,6 +1063,13 @@ #define glVertexAttrib4fvARB MANGLE(VertexAttrib4fvARB) #define glVertexAttrib4fvNV MANGLE(VertexAttrib4fvNV) #define glVertexAttrib4ivARB MANGLE(VertexAttrib4ivARB) +#define glVertexAttrib4NbvARB MANGLE(VertexAttrib4NbvARB) +#define glVertexAttrib4NivARB MANGLE(VertexAttrib4NivARB) +#define glVertexAttrib4NsvARB MANGLE(VertexAttrib4NsvARB) +#define glVertexAttrib4NubARB MANGLE(VertexAttrib4NubARB) +#define glVertexAttrib4NubvARB MANGLE(VertexAttrib4NubvARB) +#define glVertexAttrib4NuivARB MANGLE(VertexAttrib4NuivARB) +#define glVertexAttrib4NusvARB MANGLE(VertexAttrib4NusvARB) #define glVertexAttrib4sARB MANGLE(VertexAttrib4sARB) #define glVertexAttrib4sNV MANGLE(VertexAttrib4sNV) #define glVertexAttrib4svARB MANGLE(VertexAttrib4svARB) @@ -1080,9 +1097,9 @@ #define glVertexBlendARB MANGLE(VertexBlendARB) #define glVertexBlendEnvfATI MANGLE(VertexBlendEnvfATI) #define glVertexBlendEnviATI MANGLE(VertexBlendEnviATI) -#define glVertexPointer MANGLE(VertexPointer) #define glVertexPointerEXT MANGLE(VertexPointerEXT) #define glVertexPointerListIBM MANGLE(VertexPointerListIBM) +#define glVertexPointer MANGLE(VertexPointer) #define glVertexPointervINTEL MANGLE(VertexPointervINTEL) #define glVertexStream1dATI MANGLE(VertexStream1dATI) #define glVertexStream1dvATI MANGLE(VertexStream1dvATI) @@ -1116,66 +1133,66 @@ #define glVertexStream4ivATI MANGLE(VertexStream4ivATI) #define glVertexStream4sATI MANGLE(VertexStream4sATI) #define glVertexStream4svATI MANGLE(VertexStream4svATI) -#define glVertexWeightPointerEXT MANGLE(VertexWeightPointerEXT) #define glVertexWeightfEXT MANGLE(VertexWeightfEXT) #define glVertexWeightfvEXT MANGLE(VertexWeightfvEXT) +#define glVertexWeightPointerEXT MANGLE(VertexWeightPointerEXT) #define glViewport MANGLE(Viewport) -#define glWeightPointerARB MANGLE(WeightPointerARB) #define glWeightbvARB MANGLE(WeightbvARB) #define glWeightdvARB MANGLE(WeightdvARB) #define glWeightfvARB MANGLE(WeightfvARB) #define glWeightivARB MANGLE(WeightivARB) +#define glWeightPointerARB MANGLE(WeightPointerARB) #define glWeightsvARB MANGLE(WeightsvARB) #define glWeightubvARB MANGLE(WeightubvARB) #define glWeightuivARB MANGLE(WeightuivARB) #define glWeightusvARB MANGLE(WeightusvARB) -#define glWindowPos2d MANGLE(WindowPos2d) #define glWindowPos2dARB MANGLE(WindowPos2dARB) +#define glWindowPos2d MANGLE(WindowPos2d) #define glWindowPos2dMESA MANGLE(WindowPos2dMESA) -#define glWindowPos2dv MANGLE(WindowPos2dv) #define glWindowPos2dvARB MANGLE(WindowPos2dvARB) +#define glWindowPos2dv MANGLE(WindowPos2dv) #define glWindowPos2dvMESA MANGLE(WindowPos2dvMESA) -#define glWindowPos2f MANGLE(WindowPos2f) #define glWindowPos2fARB MANGLE(WindowPos2fARB) +#define glWindowPos2f MANGLE(WindowPos2f) #define glWindowPos2fMESA MANGLE(WindowPos2fMESA) -#define glWindowPos2fv MANGLE(WindowPos2fv) #define glWindowPos2fvARB MANGLE(WindowPos2fvARB) +#define glWindowPos2fv MANGLE(WindowPos2fv) #define glWindowPos2fvMESA MANGLE(WindowPos2fvMESA) -#define glWindowPos2i MANGLE(WindowPos2i) #define glWindowPos2iARB MANGLE(WindowPos2iARB) +#define glWindowPos2i MANGLE(WindowPos2i) #define glWindowPos2iMESA MANGLE(WindowPos2iMESA) -#define glWindowPos2iv MANGLE(WindowPos2iv) #define glWindowPos2ivARB MANGLE(WindowPos2ivARB) +#define glWindowPos2iv MANGLE(WindowPos2iv) #define glWindowPos2ivMESA MANGLE(WindowPos2ivMESA) -#define glWindowPos2s MANGLE(WindowPos2s) #define glWindowPos2sARB MANGLE(WindowPos2sARB) +#define glWindowPos2s MANGLE(WindowPos2s) #define glWindowPos2sMESA MANGLE(WindowPos2sMESA) -#define glWindowPos2sv MANGLE(WindowPos2sv) #define glWindowPos2svARB MANGLE(WindowPos2svARB) +#define glWindowPos2sv MANGLE(WindowPos2sv) #define glWindowPos2svMESA MANGLE(WindowPos2svMESA) -#define glWindowPos3d MANGLE(WindowPos3d) #define glWindowPos3dARB MANGLE(WindowPos3dARB) +#define glWindowPos3d MANGLE(WindowPos3d) #define glWindowPos3dMESA MANGLE(WindowPos3dMESA) -#define glWindowPos3dv MANGLE(WindowPos3dv) #define glWindowPos3dvARB MANGLE(WindowPos3dvARB) +#define glWindowPos3dv MANGLE(WindowPos3dv) #define glWindowPos3dvMESA MANGLE(WindowPos3dvMESA) -#define glWindowPos3f MANGLE(WindowPos3f) #define glWindowPos3fARB MANGLE(WindowPos3fARB) +#define glWindowPos3f MANGLE(WindowPos3f) #define glWindowPos3fMESA MANGLE(WindowPos3fMESA) -#define glWindowPos3fv MANGLE(WindowPos3fv) #define glWindowPos3fvARB MANGLE(WindowPos3fvARB) +#define glWindowPos3fv MANGLE(WindowPos3fv) #define glWindowPos3fvMESA MANGLE(WindowPos3fvMESA) -#define glWindowPos3i MANGLE(WindowPos3i) #define glWindowPos3iARB MANGLE(WindowPos3iARB) +#define glWindowPos3i MANGLE(WindowPos3i) #define glWindowPos3iMESA MANGLE(WindowPos3iMESA) -#define glWindowPos3iv MANGLE(WindowPos3iv) #define glWindowPos3ivARB MANGLE(WindowPos3ivARB) +#define glWindowPos3iv MANGLE(WindowPos3iv) #define glWindowPos3ivMESA MANGLE(WindowPos3ivMESA) -#define glWindowPos3s MANGLE(WindowPos3s) #define glWindowPos3sARB MANGLE(WindowPos3sARB) +#define glWindowPos3s MANGLE(WindowPos3s) #define glWindowPos3sMESA MANGLE(WindowPos3sMESA) -#define glWindowPos3sv MANGLE(WindowPos3sv) #define glWindowPos3svARB MANGLE(WindowPos3svARB) +#define glWindowPos3sv MANGLE(WindowPos3sv) #define glWindowPos3svMESA MANGLE(WindowPos3svMESA) #define glWindowPos4dMESA MANGLE(WindowPos4dMESA) #define glWindowPos4dvMESA MANGLE(WindowPos4dvMESA) @@ -1186,4 +1203,5 @@ #define glWindowPos4sMESA MANGLE(WindowPos4sMESA) #define glWindowPos4svMESA MANGLE(WindowPos4svMESA) #define glWriteMaskEXT MANGLE(WriteMaskEXT) + #endif /* GL_MANGLE_H */ -- cgit v1.2.3 From c6506004d4924740b3b6265a688a9c103106af94 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 28 Apr 2003 14:42:33 +0000 Subject: fix glIsBufferARB() prototype --- include/GL/glext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 2cef3ce2f58..82d06a0f1e6 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -5067,7 +5067,7 @@ typedef long int GLintptrARB; GLAPI void APIENTRY glBindBufferARB(GLenum target, GLuint buffer); GLAPI void APIENTRY glDeleteBuffersARB(GLsizei n, const GLuint * buffer); GLAPI void APIENTRY glGenBuffersARB(GLsizei n, GLuint * buffer); -extern GLboolean glIsBufferARB(GLuint buffer); +GLAPI GLboolean APIENTRY glIsBufferARB(GLuint buffer); GLAPI void APIENTRY glBufferDataARB(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); GLAPI void APIENTRY glBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); GLAPI void APIENTRY glGetBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void * data); -- cgit v1.2.3 From 5329d0ca7ab830e8bf71ebe63988e098aa70cffd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 29 Apr 2003 22:20:36 +0000 Subject: updated for glIsBufferARB --- include/GL/gl_mangle.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index ef5f5216601..8dde77a9242 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -502,6 +502,7 @@ #define glInstrumentsBufferSGIX MANGLE(InstrumentsBufferSGIX) #define glInterleavedArrays MANGLE(InterleavedArrays) #define glIsAsyncMarkerSGIX MANGLE(IsAsyncMarkerSGIX) +#define glIsBufferARB MANGLE(IsBufferARB) #define glIsEnabled MANGLE(IsEnabled) #define glIsFenceNV MANGLE(IsFenceNV) #define glIsList MANGLE(IsList) -- cgit v1.2.3 From b93df0af47f107f0abc06bbd6806f7642cd25e7c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 10 May 2003 04:38:24 +0000 Subject: remove temporary stuff --- include/GL/gl.h | 91 --------------------------------------------------------- 1 file changed, 91 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index ab6efc537d4..f7456ef99a0 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2625,97 +2625,6 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid -#ifndef GL_APPLE_client_storage -#define GL_APPLE_client_storage 1 - -#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 - -#endif /* GL_APPLE_client_storage */ - - - -#ifndef GL_APPLE_ycbcr_422 -#define GL_APPLE_ycbcr_422 1 - -#define GL_YCBCR_422_APPLE 0x85B9 -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB - -#endif /* GL_APPLE_ycbcr_422 */ - - - -/* XXX temporary until glext.h is updated! */ -#ifndef GL_NV_fragment_program -#define GL_NV_fragment_program 1 - -#define GL_FRAGMENT_PROGRAM_NV 0x8870 -#define GL_MAX_TEXTURE_COORDS_NV 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 -#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 -#define GL_PROGRAM_ERROR_STRING_NV 0x8874 -#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 - - -GLAPI void GLAPIENTRY glProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); - -GLAPI void GLAPIENTRY glProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); - -GLAPI void GLAPIENTRY glProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte *name, const float v[]); - -GLAPI void GLAPIENTRY glProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte *name, const double v[]); - -GLAPI void GLAPIENTRY glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); - -GLAPI void GLAPIENTRY glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); - -GLAPI void GLAPIENTRY glProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); - -GLAPI void GLAPIENTRY glProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble *params); - -GLAPI void GLAPIENTRY glProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); - -GLAPI void GLAPIENTRY glProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat *params); - -GLAPI void GLAPIENTRY glGetProgramLocalParameterdvARB(GLenum target, GLuint index, GLdouble *params); - -GLAPI void GLAPIENTRY glGetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat *params); - -typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte * name, const GLfloat *v); -typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte * name, const GLdouble *v); -typedef void (APIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLfloat *params); -typedef void (APIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte * name, GLdouble *params); - -#endif /* GL_NV_fragment_program */ - - - -/* XXX temporary until glext.h is updated! */ -#ifndef GL_ARB_fragment_program -#define GL_ARB_fragment_program 1 - -#define GL_FRAGMENT_PROGRAM_ARB 0x8804 -#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 -#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 -#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 -#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 -#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 -#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A -#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B -#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C -#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D -#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E -#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F -#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 -#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 - -#endif /* GL_ARB_fragment_program */ - - - /* XXX temporary until glext.h is updated! */ #ifndef GL_EXT_depth_bounds_test #define GL_EXT_depth_bounds_test 1 -- cgit v1.2.3 From 3ef8ed72ca1b7dfebad8bc9709f74762127c0e0c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 10 May 2003 04:39:05 +0000 Subject: version 18 of glext.h --- include/GL/glext.h | 617 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 538 insertions(+), 79 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 82d06a0f1e6..f8b6cbc611a 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -49,9 +49,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2002/08/21 */ +/* glext.h last updated 2003/5/9 */ /* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 17 +#define GL_GLEXT_VERSION 18 #ifndef GL_VERSION_1_2 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 @@ -534,21 +534,29 @@ extern "C" { #endif #ifndef GL_ARB_vertex_program -#define GL_VERTEX_PROGRAM_ARB 0x8620 -#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 #define GL_COLOR_SUM_ARB 0x8458 -#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_VERTEX_PROGRAM_ARB 0x8620 #define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 #define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 #define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A #define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 #define GL_PROGRAM_LENGTH_ARB 0x8627 -#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B #define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 #define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 #define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 #define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 @@ -572,15 +580,7 @@ extern "C" { #define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 #define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 #define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 -#define GL_PROGRAM_STRING_ARB 0x8628 -#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B -#define GL_CURRENT_MATRIX_ARB 0x8641 #define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 -#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 -#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 -#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F -#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E -#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 #define GL_MATRIX0_ARB 0x88C0 #define GL_MATRIX1_ARB 0x88C1 #define GL_MATRIX2_ARB 0x88C2 @@ -615,6 +615,58 @@ extern "C" { #define GL_MATRIX31_ARB 0x88DF #endif +#ifndef GL_ARB_fragment_program +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +#endif + #ifndef GL_EXT_abgr #define GL_ABGR_EXT 0x8000 #endif @@ -2308,7 +2360,7 @@ extern "C" { #define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA #define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB #define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INARIANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD #define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE #define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF #define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 @@ -2423,12 +2475,158 @@ extern "C" { #define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 #endif +#ifndef GL_ATI_text_fragment_shader +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 +#endif + +#ifndef GL_APPLE_element_array +#define GL_ELEMENT_ARRAY_APPLE 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A +#endif + +#ifndef GL_APPLE_fence +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_YCBCR_422_APPLE 0x85B9 +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#endif + +#ifndef GL_S3_s3tc +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 +#endif + #ifndef GL_ATI_texture_env_combine3 #define GL_MODULATE_ADD_ATI 0x8744 #define GL_MODULATE_SIGNED_ADD_ATI 0x8745 #define GL_MODULATE_SUBTRACT_ATI 0x8746 #endif +#ifndef GL_ATI_texture_float +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F +#endif + +#ifndef GL_NV_float_buffer +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E +#endif + +#ifndef GL_NV_fragment_program +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 +#endif + +#ifndef GL_NV_half_float +#define GL_HALF_FLOAT_NV 0x140B +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D +#endif + +#ifndef GL_NV_primitive_restart +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F +#endif + +#ifndef GL_NV_vertex_program2 +#endif + +#ifndef GL_ATI_map_object_buffer +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#endif + + /*************************************************************/ #ifndef GL_VERSION_1_2 @@ -2561,7 +2759,7 @@ GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLin GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, void *); +GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); @@ -2608,7 +2806,7 @@ typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint le typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img); +typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); #endif #ifndef GL_VERSION_1_4 @@ -2820,7 +3018,7 @@ GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, G GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, void *); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); @@ -2828,7 +3026,7 @@ typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img); +typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); #endif #ifndef GL_ARB_texture_border_clamp @@ -3083,6 +3281,44 @@ typedef void (APIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLe typedef GLboolean (APIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program); #endif +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 +/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */ +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +/* GL types for handling large vertex buffer objects */ +/* Only used by this extension for now; later needs to be moved earlier in glext.h */ +#include +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint); +GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsBufferARB (GLuint); +GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); +GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); +GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum); +GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum); +GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef void (APIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +typedef void (APIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +typedef void (APIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +typedef GLvoid* (APIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target); +typedef void (APIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + #ifndef GL_EXT_abgr #define GL_EXT_abgr 1 #endif @@ -4731,7 +4967,7 @@ GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint); GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum); GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *); GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glDeleteObjectBufferATI (GLuint); +GLAPI void APIENTRY glFreeObjectBufferATI (GLuint); GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint); GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *); GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *); @@ -4744,7 +4980,7 @@ typedef GLboolean (APIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); typedef void (APIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); typedef void (APIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); typedef void (APIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLDELETEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); typedef void (APIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); typedef void (APIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); typedef void (APIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); @@ -4769,8 +5005,8 @@ GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLen GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint); GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint); GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const void *); -GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const void *); +GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *); +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *); GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *); GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *); GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *); @@ -4779,7 +5015,7 @@ GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *); GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *); GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *); GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const void *); +GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *); GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint); GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint); GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum); @@ -4812,8 +5048,8 @@ typedef void (APIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum o typedef void (APIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); typedef void (APIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); typedef GLuint (APIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -typedef void (APIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const void *addr); -typedef void (APIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const void *addr); +typedef void (APIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); typedef void (APIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); typedef void (APIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); typedef void (APIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); @@ -4822,7 +5058,7 @@ typedef void (APIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr typedef void (APIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); typedef void (APIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); typedef void (APIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); -typedef void (APIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const void *addr); +typedef void (APIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); typedef void (APIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); typedef void (APIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); typedef GLuint (APIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); @@ -5021,61 +5257,284 @@ GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum); typedef void (APIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); #endif +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 +#endif + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *); +GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei); +GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei); +GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (APIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +#endif + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *); +GLAPI void APIENTRY glSetFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint); +GLAPI void APIENTRY glFinishFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint); +GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); +typedef void (APIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef void (APIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); +typedef void (APIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint); +GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (APIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef GLboolean (APIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *); +GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *); +GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 +#endif + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); +#endif + #ifndef GL_ATI_texture_env_combine3 #define GL_ATI_texture_env_combine3 1 #endif +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 +#endif -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 -/* large enough to contain any pointer (32 or 64 bit): */ -typedef long int GLsizeiptrARB; -typedef long int GLintptrARB; - -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD - -GLAPI void APIENTRY glBindBufferARB(GLenum target, GLuint buffer); -GLAPI void APIENTRY glDeleteBuffersARB(GLsizei n, const GLuint * buffer); -GLAPI void APIENTRY glGenBuffersARB(GLsizei n, GLuint * buffer); -GLAPI GLboolean APIENTRY glIsBufferARB(GLuint buffer); -GLAPI void APIENTRY glBufferDataARB(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); -GLAPI void APIENTRY glBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); -GLAPI void APIENTRY glGetBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void * data); -GLAPI void APIENTRY glMapBufferARB(GLenum target, GLenum access); -GLAPI GLboolean APIENTRY glUnmapBufferARB(GLenum target); -GLAPI void APIENTRY glGetBufferParameterivARB(GLenum target, GLenum pname, GLint * params); -GLAPI void APIENTRY glGetBufferPointervARB(GLenum target, GLenum pname, GLvoid ** params); +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 +#endif +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 +/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *); +GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *); +GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +typedef void (APIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +typedef void (APIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +#endif + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 +/* GL type for representing NVIDIA "half" floating point type in host memory */ +/* Only used by this extension for now; later needs to be moved earlier in glext.h */ +typedef unsigned short GLhalfNV; +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV); +GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glFogCoordhNV (GLhalfNV); +GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *); +GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV); +GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); +typedef void (APIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRY * PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRY * PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRY * PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +typedef void (APIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRY * PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRY * PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +typedef void (APIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); +typedef void (APIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); +typedef void (APIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); +typedef void (APIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); +typedef void (APIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); +typedef void (APIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); +typedef void (APIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); +typedef void (APIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); +typedef void (APIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *); +GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); +typedef void (APIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +#endif + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPrimitiveRestartNV (void); +GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void); +typedef void (APIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 +#endif + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 +#endif + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint); +GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLvoid* (APIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); #endif -- cgit v1.2.3 From 06a03bfb2ada23cfbc0f86055842d3d941918299 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 10 May 2003 04:48:16 +0000 Subject: updated with new glext.h stuff --- include/GL/gl_mangle.h | 80 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 8dde77a9242..ebf15f427f9 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -64,6 +64,7 @@ #define glBindTextureEXT MANGLE(BindTextureEXT) #define glBindTexture MANGLE(BindTexture) #define glBindTextureUnitParameterEXT MANGLE(BindTextureUnitParameterEXT) +#define glBindVertexArrayAPPLE MANGLE(BindVertexArrayAPPLE) #define glBindVertexShaderEXT MANGLE(BindVertexShaderEXT) #define glBinormal3bEXT MANGLE(Binormal3bEXT) #define glBinormal3bvEXT MANGLE(Binormal3bvEXT) @@ -107,6 +108,8 @@ #define glColor3fVertex3fSUN MANGLE(Color3fVertex3fSUN) #define glColor3fVertex3fvSUN MANGLE(Color3fVertex3fvSUN) #define glColor3fv MANGLE(Color3fv) +#define glColor3hNV MANGLE(Color3hNV) +#define glColor3hvNV MANGLE(Color3hvNV) #define glColor3i MANGLE(Color3i) #define glColor3iv MANGLE(Color3iv) #define glColor3s MANGLE(Color3s) @@ -125,6 +128,8 @@ #define glColor4fNormal3fVertex3fSUN MANGLE(Color4fNormal3fVertex3fSUN) #define glColor4fNormal3fVertex3fvSUN MANGLE(Color4fNormal3fVertex3fvSUN) #define glColor4fv MANGLE(Color4fv) +#define glColor4hNV MANGLE(Color4hNV) +#define glColor4hvNV MANGLE(Color4hvNV) #define glColor4i MANGLE(Color4i) #define glColor4iv MANGLE(Color4iv) #define glColor4s MANGLE(Color4s) @@ -216,15 +221,16 @@ #define glDeformSGIX MANGLE(DeformSGIX) #define glDeleteAsyncMarkersSGIX MANGLE(DeleteAsyncMarkersSGIX) #define glDeleteBuffersARB MANGLE(DeleteBuffersARB) +#define glDeleteFencesAPPLE MANGLE(DeleteFencesAPPLE) #define glDeleteFencesNV MANGLE(DeleteFencesNV) #define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI) #define glDeleteLists MANGLE(DeleteLists) -#define glDeleteObjectBufferATI MANGLE(DeleteObjectBufferATI) #define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV) #define glDeleteProgramsARB MANGLE(DeleteProgramsARB) #define glDeleteProgramsNV MANGLE(DeleteProgramsNV) #define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT) #define glDeleteTextures MANGLE(DeleteTextures) +#define glDeleteVertexArraysAPPLE MANGLE(DeleteVertexArraysAPPLE) #define glDeleteVertexShaderEXT MANGLE(DeleteVertexShaderEXT) #define glDepthBoundsEXT MANGLE(DepthBoundsEXT) #define glDepthFunc MANGLE(DepthFunc) @@ -239,10 +245,13 @@ #define glDrawArraysEXT MANGLE(DrawArraysEXT) #define glDrawArrays MANGLE(DrawArrays) #define glDrawBuffer MANGLE(DrawBuffer) +#define glDrawBuffersATI MANGLE(DrawBuffersATI) +#define glDrawElementArrayAPPLE MANGLE(DrawElementArrayAPPLE) #define glDrawElementArrayATI MANGLE(DrawElementArrayATI) #define glDrawElements MANGLE(DrawElements) #define glDrawMeshArraysSUN MANGLE(DrawMeshArraysSUN) #define glDrawPixels MANGLE(DrawPixels) +#define glDrawRangeElementArrayAPPLE MANGLE(DrawRangeElementArrayAPPLE) #define glDrawRangeElementArrayATI MANGLE(DrawRangeElementArrayATI) #define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT) #define glDrawRangeElements MANGLE(DrawRangeElements) @@ -251,6 +260,7 @@ #define glEdgeFlagPointerListIBM MANGLE(EdgeFlagPointerListIBM) #define glEdgeFlagPointer MANGLE(EdgeFlagPointer) #define glEdgeFlagv MANGLE(EdgeFlagv) +#define glElementPointerAPPLE MANGLE(ElementPointerAPPLE) #define glElementPointerATI MANGLE(ElementPointerATI) #define glEnableClientState MANGLE(EnableClientState) #define glEnable MANGLE(Enable) @@ -281,11 +291,15 @@ #define glFeedbackBuffer MANGLE(FeedbackBuffer) #define glFinalCombinerInputNV MANGLE(FinalCombinerInputNV) #define glFinishAsyncSGIX MANGLE(FinishAsyncSGIX) +#define glFinishFenceAPPLE MANGLE(FinishFenceAPPLE) #define glFinishFenceNV MANGLE(FinishFenceNV) #define glFinish MANGLE(Finish) +#define glFinishObjectAPPLE MANGLE(FinishObjectAPPLE) #define glFinishTextureSUNX MANGLE(FinishTextureSUNX) #define glFlush MANGLE(Flush) +#define glFlushPixelDataRangeNV MANGLE(FlushPixelDataRangeNV) #define glFlushRasterSGIX MANGLE(FlushRasterSGIX) +#define glFlushVertexArrayRangeAPPLE MANGLE(FlushVertexArrayRangeAPPLE) #define glFlushVertexArrayRangeNV MANGLE(FlushVertexArrayRangeNV) #define glFogCoorddEXT MANGLE(FogCoorddEXT) #define glFogCoordd MANGLE(FogCoordd) @@ -295,6 +309,8 @@ #define glFogCoordf MANGLE(FogCoordf) #define glFogCoordfvEXT MANGLE(FogCoordfvEXT) #define glFogCoordfv MANGLE(FogCoordfv) +#define glFogCoordhNV MANGLE(FogCoordhNV) +#define glFogCoordhvNV MANGLE(FogCoordhvNV) #define glFogCoordPointerEXT MANGLE(FogCoordPointerEXT) #define glFogCoordPointerListIBM MANGLE(FogCoordPointerListIBM) #define glFogCoordPointer MANGLE(FogCoordPointer) @@ -317,10 +333,12 @@ #define glFragmentMaterialiSGIX MANGLE(FragmentMaterialiSGIX) #define glFragmentMaterialivSGIX MANGLE(FragmentMaterialivSGIX) #define glFrameZoomSGIX MANGLE(FrameZoomSGIX) +#define glFreeObjectBufferATI MANGLE(FreeObjectBufferATI) #define glFrontFace MANGLE(FrontFace) #define glFrustum MANGLE(Frustum) #define glGenAsyncMarkersSGIX MANGLE(GenAsyncMarkersSGIX) #define glGenBuffersARB MANGLE(GenBuffersARB) +#define glGenFencesAPPLE MANGLE(GenFencesAPPLE) #define glGenFencesNV MANGLE(GenFencesNV) #define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI) #define glGenLists MANGLE(GenLists) @@ -330,6 +348,7 @@ #define glGenSymbolsEXT MANGLE(GenSymbolsEXT) #define glGenTexturesEXT MANGLE(GenTexturesEXT) #define glGenTextures MANGLE(GenTextures) +#define glGenVertexArraysAPPLE MANGLE(GenVertexArraysAPPLE) #define glGenVertexShadersEXT MANGLE(GenVertexShadersEXT) #define glGetArrayObjectfvATI MANGLE(GetArrayObjectfvATI) #define glGetArrayObjectivATI MANGLE(GetArrayObjectivATI) @@ -456,6 +475,8 @@ #define glGetVariantFloatvEXT MANGLE(GetVariantFloatvEXT) #define glGetVariantIntegervEXT MANGLE(GetVariantIntegervEXT) #define glGetVariantPointervEXT MANGLE(GetVariantPointervEXT) +#define glGetVertexAttribArrayObjectfvATI MANGLE(GetVertexAttribArrayObjectfvATI) +#define glGetVertexAttribArrayObjectivATI MANGLE(GetVertexAttribArrayObjectivATI) #define glGetVertexAttribdvARB MANGLE(GetVertexAttribdvARB) #define glGetVertexAttribdvNV MANGLE(GetVertexAttribdvNV) #define glGetVertexAttribfvARB MANGLE(GetVertexAttribfvARB) @@ -504,6 +525,7 @@ #define glIsAsyncMarkerSGIX MANGLE(IsAsyncMarkerSGIX) #define glIsBufferARB MANGLE(IsBufferARB) #define glIsEnabled MANGLE(IsEnabled) +#define glIsFenceAPPLE MANGLE(IsFenceAPPLE) #define glIsFenceNV MANGLE(IsFenceNV) #define glIsList MANGLE(IsList) #define glIsObjectBufferATI MANGLE(IsObjectBufferATI) @@ -513,6 +535,7 @@ #define glIsTextureEXT MANGLE(IsTextureEXT) #define glIsTexture MANGLE(IsTexture) #define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT) +#define glIsVertexArrayAPPLE MANGLE(IsVertexArrayAPPLE) #define glLightEnviSGIX MANGLE(LightEnviSGIX) #define glLightf MANGLE(Lightf) #define glLightfv MANGLE(Lightfv) @@ -551,6 +574,7 @@ #define glMapGrid1f MANGLE(MapGrid1f) #define glMapGrid2d MANGLE(MapGrid2d) #define glMapGrid2f MANGLE(MapGrid2f) +#define glMapObjectBufferATI MANGLE(MapObjectBufferATI) #define glMapParameterfvNV MANGLE(MapParameterfvNV) #define glMapParameterivNV MANGLE(MapParameterivNV) #define glMaterialf MANGLE(Materialf) @@ -566,8 +590,10 @@ #define glMinmax MANGLE(Minmax) #define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT) #define glMultiDrawArrays MANGLE(MultiDrawArrays) +#define glMultiDrawElementArrayAPPLE MANGLE(MultiDrawElementArrayAPPLE) #define glMultiDrawElementsEXT MANGLE(MultiDrawElementsEXT) #define glMultiDrawElements MANGLE(MultiDrawElements) +#define glMultiDrawRangeElementArrayAPPLE MANGLE(MultiDrawRangeElementArrayAPPLE) #define glMultiModeDrawArraysIBM MANGLE(MultiModeDrawArraysIBM) #define glMultiModeDrawElementsIBM MANGLE(MultiModeDrawElementsIBM) #define glMultiTexCoord1dARB MANGLE(MultiTexCoord1dARB) @@ -578,6 +604,8 @@ #define glMultiTexCoord1f MANGLE(MultiTexCoord1f) #define glMultiTexCoord1fvARB MANGLE(MultiTexCoord1fvARB) #define glMultiTexCoord1fv MANGLE(MultiTexCoord1fv) +#define glMultiTexCoord1hNV MANGLE(MultiTexCoord1hNV) +#define glMultiTexCoord1hvNV MANGLE(MultiTexCoord1hvNV) #define glMultiTexCoord1iARB MANGLE(MultiTexCoord1iARB) #define glMultiTexCoord1i MANGLE(MultiTexCoord1i) #define glMultiTexCoord1ivARB MANGLE(MultiTexCoord1ivARB) @@ -594,6 +622,8 @@ #define glMultiTexCoord2f MANGLE(MultiTexCoord2f) #define glMultiTexCoord2fvARB MANGLE(MultiTexCoord2fvARB) #define glMultiTexCoord2fv MANGLE(MultiTexCoord2fv) +#define glMultiTexCoord2hNV MANGLE(MultiTexCoord2hNV) +#define glMultiTexCoord2hvNV MANGLE(MultiTexCoord2hvNV) #define glMultiTexCoord2iARB MANGLE(MultiTexCoord2iARB) #define glMultiTexCoord2i MANGLE(MultiTexCoord2i) #define glMultiTexCoord2ivARB MANGLE(MultiTexCoord2ivARB) @@ -610,6 +640,8 @@ #define glMultiTexCoord3f MANGLE(MultiTexCoord3f) #define glMultiTexCoord3fvARB MANGLE(MultiTexCoord3fvARB) #define glMultiTexCoord3fv MANGLE(MultiTexCoord3fv) +#define glMultiTexCoord3hNV MANGLE(MultiTexCoord3hNV) +#define glMultiTexCoord3hvNV MANGLE(MultiTexCoord3hvNV) #define glMultiTexCoord3iARB MANGLE(MultiTexCoord3iARB) #define glMultiTexCoord3i MANGLE(MultiTexCoord3i) #define glMultiTexCoord3ivARB MANGLE(MultiTexCoord3ivARB) @@ -626,6 +658,8 @@ #define glMultiTexCoord4f MANGLE(MultiTexCoord4f) #define glMultiTexCoord4fvARB MANGLE(MultiTexCoord4fvARB) #define glMultiTexCoord4fv MANGLE(MultiTexCoord4fv) +#define glMultiTexCoord4hNV MANGLE(MultiTexCoord4hNV) +#define glMultiTexCoord4hvNV MANGLE(MultiTexCoord4hvNV) #define glMultiTexCoord4iARB MANGLE(MultiTexCoord4iARB) #define glMultiTexCoord4i MANGLE(MultiTexCoord4i) #define glMultiTexCoord4ivARB MANGLE(MultiTexCoord4ivARB) @@ -651,6 +685,8 @@ #define glNormal3fVertex3fSUN MANGLE(Normal3fVertex3fSUN) #define glNormal3fVertex3fvSUN MANGLE(Normal3fVertex3fvSUN) #define glNormal3fv MANGLE(Normal3fv) +#define glNormal3hNV MANGLE(Normal3hNV) +#define glNormal3hvNV MANGLE(Normal3hvNV) #define glNormal3i MANGLE(Normal3i) #define glNormal3iv MANGLE(Normal3iv) #define glNormal3s MANGLE(Normal3s) @@ -672,6 +708,7 @@ #define glOrtho MANGLE(Ortho) #define glPassTexCoordATI MANGLE(PassTexCoordATI) #define glPassThrough MANGLE(PassThrough) +#define glPixelDataRangeNV MANGLE(PixelDataRangeNV) #define glPixelMapfv MANGLE(PixelMapfv) #define glPixelMapuiv MANGLE(PixelMapuiv) #define glPixelMapusv MANGLE(PixelMapusv) @@ -714,6 +751,8 @@ #define glPopClientAttrib MANGLE(PopClientAttrib) #define glPopMatrix MANGLE(PopMatrix) #define glPopName MANGLE(PopName) +#define glPrimitiveRestartIndexNV MANGLE(PrimitiveRestartIndexNV) +#define glPrimitiveRestartNV MANGLE(PrimitiveRestartNV) #define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT) #define glPrioritizeTextures MANGLE(PrioritizeTextures) #define glProgramEnvParameter4dARB MANGLE(ProgramEnvParameter4dARB) @@ -829,6 +868,8 @@ #define glSecondaryColor3f MANGLE(SecondaryColor3f) #define glSecondaryColor3fvEXT MANGLE(SecondaryColor3fvEXT) #define glSecondaryColor3fv MANGLE(SecondaryColor3fv) +#define glSecondaryColor3hNV MANGLE(SecondaryColor3hNV) +#define glSecondaryColor3hvNV MANGLE(SecondaryColor3hvNV) #define glSecondaryColor3iEXT MANGLE(SecondaryColor3iEXT) #define glSecondaryColor3i MANGLE(SecondaryColor3i) #define glSecondaryColor3ivEXT MANGLE(SecondaryColor3ivEXT) @@ -855,6 +896,7 @@ #define glSelectBuffer MANGLE(SelectBuffer) #define glSeparableFilter2DEXT MANGLE(SeparableFilter2DEXT) #define glSeparableFilter2D MANGLE(SeparableFilter2D) +#define glSetFenceAPPLE MANGLE(SetFenceAPPLE) #define glSetFenceNV MANGLE(SetFenceNV) #define glSetFragmentShaderConstantATI MANGLE(SetFragmentShaderConstantATI) #define glSetInvariantEXT MANGLE(SetInvariantEXT) @@ -870,8 +912,10 @@ #define glSpriteParameterivSGIX MANGLE(SpriteParameterivSGIX) #define glStartInstrumentsSGIX MANGLE(StartInstrumentsSGIX) #define glStencilFunc MANGLE(StencilFunc) +#define glStencilFuncSeparateATI MANGLE(StencilFuncSeparateATI) #define glStencilMask MANGLE(StencilMask) #define glStencilOp MANGLE(StencilOp) +#define glStencilOpSeparateATI MANGLE(StencilOpSeparateATI) #define glStopInstrumentsSGIX MANGLE(StopInstrumentsSGIX) #define glSwizzleEXT MANGLE(SwizzleEXT) #define glTagSampleBufferSGIX MANGLE(TagSampleBufferSGIX) @@ -887,13 +931,17 @@ #define glTangent3svEXT MANGLE(Tangent3svEXT) #define glTangentPointerEXT MANGLE(TangentPointerEXT) #define glTbufferMask3DFX MANGLE(TbufferMask3DFX) +#define glTestFenceAPPLE MANGLE(TestFenceAPPLE) #define glTestFenceNV MANGLE(TestFenceNV) +#define glTestObjectAPPLE MANGLE(TestObjectAPPLE) #define glTexBumpParameterfvATI MANGLE(TexBumpParameterfvATI) #define glTexBumpParameterivATI MANGLE(TexBumpParameterivATI) #define glTexCoord1d MANGLE(TexCoord1d) #define glTexCoord1dv MANGLE(TexCoord1dv) #define glTexCoord1f MANGLE(TexCoord1f) #define glTexCoord1fv MANGLE(TexCoord1fv) +#define glTexCoord1hNV MANGLE(TexCoord1hNV) +#define glTexCoord1hvNV MANGLE(TexCoord1hvNV) #define glTexCoord1i MANGLE(TexCoord1i) #define glTexCoord1iv MANGLE(TexCoord1iv) #define glTexCoord1s MANGLE(TexCoord1s) @@ -912,6 +960,8 @@ #define glTexCoord2fVertex3fSUN MANGLE(TexCoord2fVertex3fSUN) #define glTexCoord2fVertex3fvSUN MANGLE(TexCoord2fVertex3fvSUN) #define glTexCoord2fv MANGLE(TexCoord2fv) +#define glTexCoord2hNV MANGLE(TexCoord2hNV) +#define glTexCoord2hvNV MANGLE(TexCoord2hvNV) #define glTexCoord2i MANGLE(TexCoord2i) #define glTexCoord2iv MANGLE(TexCoord2iv) #define glTexCoord2s MANGLE(TexCoord2s) @@ -920,6 +970,8 @@ #define glTexCoord3dv MANGLE(TexCoord3dv) #define glTexCoord3f MANGLE(TexCoord3f) #define glTexCoord3fv MANGLE(TexCoord3fv) +#define glTexCoord3hNV MANGLE(TexCoord3hNV) +#define glTexCoord3hvNV MANGLE(TexCoord3hvNV) #define glTexCoord3i MANGLE(TexCoord3i) #define glTexCoord3iv MANGLE(TexCoord3iv) #define glTexCoord3s MANGLE(TexCoord3s) @@ -932,6 +984,8 @@ #define glTexCoord4fVertex4fSUN MANGLE(TexCoord4fVertex4fSUN) #define glTexCoord4fVertex4fvSUN MANGLE(TexCoord4fVertex4fvSUN) #define glTexCoord4fv MANGLE(TexCoord4fv) +#define glTexCoord4hNV MANGLE(TexCoord4hNV) +#define glTexCoord4hvNV MANGLE(TexCoord4hvNV) #define glTexCoord4i MANGLE(TexCoord4i) #define glTexCoord4iv MANGLE(TexCoord4iv) #define glTexCoord4s MANGLE(TexCoord4s) @@ -982,6 +1036,7 @@ #define glTranslatef MANGLE(Translatef) #define glUnlockArraysEXT MANGLE(UnlockArraysEXT) #define glUnmapBufferARB MANGLE(UnmapBufferARB) +#define glUnmapObjectBufferATI MANGLE(UnmapObjectBufferATI) #define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI) #define glVariantArrayObjectATI MANGLE(VariantArrayObjectATI) #define glVariantbvEXT MANGLE(VariantbvEXT) @@ -997,6 +1052,8 @@ #define glVertex2dv MANGLE(Vertex2dv) #define glVertex2f MANGLE(Vertex2f) #define glVertex2fv MANGLE(Vertex2fv) +#define glVertex2hNV MANGLE(Vertex2hNV) +#define glVertex2hvNV MANGLE(Vertex2hvNV) #define glVertex2i MANGLE(Vertex2i) #define glVertex2iv MANGLE(Vertex2iv) #define glVertex2s MANGLE(Vertex2s) @@ -1005,6 +1062,8 @@ #define glVertex3dv MANGLE(Vertex3dv) #define glVertex3f MANGLE(Vertex3f) #define glVertex3fv MANGLE(Vertex3fv) +#define glVertex3hNV MANGLE(Vertex3hNV) +#define glVertex3hvNV MANGLE(Vertex3hvNV) #define glVertex3i MANGLE(Vertex3i) #define glVertex3iv MANGLE(Vertex3iv) #define glVertex3s MANGLE(Vertex3s) @@ -1013,10 +1072,14 @@ #define glVertex4dv MANGLE(Vertex4dv) #define glVertex4f MANGLE(Vertex4f) #define glVertex4fv MANGLE(Vertex4fv) +#define glVertex4hNV MANGLE(Vertex4hNV) +#define glVertex4hvNV MANGLE(Vertex4hvNV) #define glVertex4i MANGLE(Vertex4i) #define glVertex4iv MANGLE(Vertex4iv) #define glVertex4s MANGLE(Vertex4s) #define glVertex4sv MANGLE(Vertex4sv) +#define glVertexArrayParameteriAPPLE MANGLE(VertexArrayParameteriAPPLE) +#define glVertexArrayRangeAPPLE MANGLE(VertexArrayRangeAPPLE) #define glVertexArrayRangeNV MANGLE(VertexArrayRangeNV) #define glVertexAttrib1dARB MANGLE(VertexAttrib1dARB) #define glVertexAttrib1dNV MANGLE(VertexAttrib1dNV) @@ -1026,6 +1089,8 @@ #define glVertexAttrib1fNV MANGLE(VertexAttrib1fNV) #define glVertexAttrib1fvARB MANGLE(VertexAttrib1fvARB) #define glVertexAttrib1fvNV MANGLE(VertexAttrib1fvNV) +#define glVertexAttrib1hNV MANGLE(VertexAttrib1hNV) +#define glVertexAttrib1hvNV MANGLE(VertexAttrib1hvNV) #define glVertexAttrib1sARB MANGLE(VertexAttrib1sARB) #define glVertexAttrib1sNV MANGLE(VertexAttrib1sNV) #define glVertexAttrib1svARB MANGLE(VertexAttrib1svARB) @@ -1038,6 +1103,8 @@ #define glVertexAttrib2fNV MANGLE(VertexAttrib2fNV) #define glVertexAttrib2fvARB MANGLE(VertexAttrib2fvARB) #define glVertexAttrib2fvNV MANGLE(VertexAttrib2fvNV) +#define glVertexAttrib2hNV MANGLE(VertexAttrib2hNV) +#define glVertexAttrib2hvNV MANGLE(VertexAttrib2hvNV) #define glVertexAttrib2sARB MANGLE(VertexAttrib2sARB) #define glVertexAttrib2sNV MANGLE(VertexAttrib2sNV) #define glVertexAttrib2svARB MANGLE(VertexAttrib2svARB) @@ -1050,6 +1117,8 @@ #define glVertexAttrib3fNV MANGLE(VertexAttrib3fNV) #define glVertexAttrib3fvARB MANGLE(VertexAttrib3fvARB) #define glVertexAttrib3fvNV MANGLE(VertexAttrib3fvNV) +#define glVertexAttrib3hNV MANGLE(VertexAttrib3hNV) +#define glVertexAttrib3hvNV MANGLE(VertexAttrib3hvNV) #define glVertexAttrib3sARB MANGLE(VertexAttrib3sARB) #define glVertexAttrib3sNV MANGLE(VertexAttrib3sNV) #define glVertexAttrib3svARB MANGLE(VertexAttrib3svARB) @@ -1063,6 +1132,8 @@ #define glVertexAttrib4fNV MANGLE(VertexAttrib4fNV) #define glVertexAttrib4fvARB MANGLE(VertexAttrib4fvARB) #define glVertexAttrib4fvNV MANGLE(VertexAttrib4fvNV) +#define glVertexAttrib4hNV MANGLE(VertexAttrib4hNV) +#define glVertexAttrib4hvNV MANGLE(VertexAttrib4hvNV) #define glVertexAttrib4ivARB MANGLE(VertexAttrib4ivARB) #define glVertexAttrib4NbvARB MANGLE(VertexAttrib4NbvARB) #define glVertexAttrib4NivARB MANGLE(VertexAttrib4NivARB) @@ -1080,19 +1151,24 @@ #define glVertexAttrib4ubvNV MANGLE(VertexAttrib4ubvNV) #define glVertexAttrib4uivARB MANGLE(VertexAttrib4uivARB) #define glVertexAttrib4usvARB MANGLE(VertexAttrib4usvARB) +#define glVertexAttribArrayObjectATI MANGLE(VertexAttribArrayObjectATI) #define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB) #define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV) #define glVertexAttribs1dvNV MANGLE(VertexAttribs1dvNV) #define glVertexAttribs1fvNV MANGLE(VertexAttribs1fvNV) +#define glVertexAttribs1hvNV MANGLE(VertexAttribs1hvNV) #define glVertexAttribs1svNV MANGLE(VertexAttribs1svNV) #define glVertexAttribs2dvNV MANGLE(VertexAttribs2dvNV) #define glVertexAttribs2fvNV MANGLE(VertexAttribs2fvNV) +#define glVertexAttribs2hvNV MANGLE(VertexAttribs2hvNV) #define glVertexAttribs2svNV MANGLE(VertexAttribs2svNV) #define glVertexAttribs3dvNV MANGLE(VertexAttribs3dvNV) #define glVertexAttribs3fvNV MANGLE(VertexAttribs3fvNV) +#define glVertexAttribs3hvNV MANGLE(VertexAttribs3hvNV) #define glVertexAttribs3svNV MANGLE(VertexAttribs3svNV) #define glVertexAttribs4dvNV MANGLE(VertexAttribs4dvNV) #define glVertexAttribs4fvNV MANGLE(VertexAttribs4fvNV) +#define glVertexAttribs4hvNV MANGLE(VertexAttribs4hvNV) #define glVertexAttribs4svNV MANGLE(VertexAttribs4svNV) #define glVertexAttribs4ubvNV MANGLE(VertexAttribs4ubvNV) #define glVertexBlendARB MANGLE(VertexBlendARB) @@ -1136,6 +1212,8 @@ #define glVertexStream4svATI MANGLE(VertexStream4svATI) #define glVertexWeightfEXT MANGLE(VertexWeightfEXT) #define glVertexWeightfvEXT MANGLE(VertexWeightfvEXT) +#define glVertexWeighthNV MANGLE(VertexWeighthNV) +#define glVertexWeighthvNV MANGLE(VertexWeighthvNV) #define glVertexWeightPointerEXT MANGLE(VertexWeightPointerEXT) #define glViewport MANGLE(Viewport) #define glWeightbvARB MANGLE(WeightbvARB) -- cgit v1.2.3 From 9ac51f57efe07ed43a1e4224a7f5daddec401b36 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 5 Jun 2003 00:50:18 +0000 Subject: Removed all RCS / CVS tags (Id, Header, Date, etc.) from everything. --- include/GL/amesa.h | 2 -- include/GL/foomesa.h | 13 ------------- include/GL/fxmesa.h | 2 -- include/GL/ggimesa.h | 2 -- include/GL/glu_mangle.h | 21 --------------------- include/GL/glut_h.dja | 12 ------------ include/GL/glx.h | 2 -- include/GL/glx_mangle.h | 2 -- include/GL/mesa_wgl.h | 2 -- include/GL/mglmesa.h | 5 ++--- include/GL/osmesa.h | 2 -- include/GL/svgamesa.h | 2 -- include/GL/wmesa.h | 28 ---------------------------- include/GL/xmesa.h | 2 -- include/GL/xmesa_x.h | 1 - include/GL/xmesa_xf86.h | 1 - progs/demos/Makefile.BeOS-R4 | 1 - progs/demos/Makefile.cygnus | 1 - progs/demos/Makefile.win | 3 +-- progs/demos/bounce.c | 1 - progs/demos/clearspd.c | 1 - progs/demos/drawpix.c | 1 - progs/demos/gamma.c | 1 - progs/demos/gears.c | 1 - progs/demos/geartrain.c | 1 - progs/demos/glinfo.c | 1 - progs/demos/gloss.c | 1 - progs/demos/glutfx.c | 1 - progs/demos/isosurf.c | 1 - progs/demos/morph3d.c | 24 ------------------------ progs/demos/multiarb.c | 1 - progs/demos/osdemo.c | 1 - progs/demos/paltex.c | 1 - progs/demos/readpix.c | 1 - progs/demos/reflect.c | 1 - progs/demos/renormal.c | 6 ------ progs/demos/spectex.c | 1 - progs/demos/tessdemo.c | 1 - progs/demos/texcyl.c | 1 - progs/demos/texdown.c | 1 - progs/demos/texobj.c | 1 - progs/demos/trispd.c | 1 - progs/demos/winpos.c | 1 - progs/redbook/Makefile.BeOS-R4 | 14 -------------- progs/samples/Makefile.BeOS-R4 | 1 - progs/samples/Makefile.dja | 1 - progs/samples/Makefile.win | 1 - progs/samples/logo.c | 1 - progs/xdemos/glthreads.c | 1 - progs/xdemos/glxdemo.c | 16 ---------------- progs/xdemos/glxheads.c | 1 - progs/xdemos/glxpixmap.c | 1 - progs/xdemos/pbdemo.c | 1 - progs/xdemos/pbinfo.c | 1 - progs/xdemos/pbutil.c | 1 - progs/xdemos/pbutil.h | 1 - progs/xdemos/shape.c | 1 - progs/xdemos/vindex.c | 1 - progs/xdemos/vtest.c | 1 - progs/xdemos/wincopy.c | 1 - progs/xdemos/xdemo.c | 18 ------------------ progs/xdemos/xfont.c | 1 - src/glu/mesa/Makefile.BeOS-R4 | 1 - src/glu/mesa/all.h | 1 - src/glu/mesa/glu.c | 1 - src/glu/mesa/gluP.h | 1 - src/glu/mesa/mipmap.c | 1 - src/glu/mesa/nurbs.c | 1 - src/glu/mesa/nurbs.h | 1 - src/glu/mesa/nurbscrv.c | 1 - src/glu/mesa/nurbssrf.c | 1 - src/glu/mesa/nurbsutl.c | 1 - src/glu/mesa/polytest.c | 1 - src/glu/mesa/project.c | 1 - src/glu/mesa/quadric.c | 1 - src/glu/mesa/tess.c | 1 - src/glu/mesa/tess.h | 1 - src/glu/mesa/tesselat.c | 1 - src/mesa/array_cache/ac_context.c | 1 - src/mesa/array_cache/ac_context.h | 1 - src/mesa/array_cache/acache.h | 1 - src/mesa/drivers/x11/glxapi.c | 1 - src/mesa/drivers/x11/glxapi.h | 1 - src/mesa/drivers/x11/glxheader.h | 1 - src/mesa/drivers/x11/realglx.c | 1 - src/mesa/drivers/x11/realglx.h | 1 - src/mesa/drivers/x11/xfonts.c | 1 - src/mesa/drivers/x11/xfonts.h | 1 - src/mesa/drivers/x11/xm_line.c | 1 - src/mesa/drivers/x11/xm_tri.c | 1 - src/mesa/drivers/x11/xmesaP.h | 1 - src/mesa/glapi/glapi.c | 1 - src/mesa/glapi/glapi.h | 1 - src/mesa/glapi/glthread.c | 1 - src/mesa/glapi/glthread.h | 1 - src/mesa/main/KNOWN_BUGS | 1 - src/mesa/main/Makefile.OSMesa16 | 1 - src/mesa/main/accum.c | 1 - src/mesa/main/accum.h | 1 - src/mesa/main/api_arrayelt.c | 1 + src/mesa/main/api_arrayelt.h | 1 - src/mesa/main/api_eval.c | 1 - src/mesa/main/api_eval.h | 1 - src/mesa/main/api_loopback.h | 1 - src/mesa/main/api_noop.c | 1 - src/mesa/main/api_noop.h | 1 - src/mesa/main/api_validate.c | 1 + src/mesa/main/api_validate.h | 1 - src/mesa/main/attrib.c | 1 - src/mesa/main/attrib.h | 1 - src/mesa/main/blend.c | 1 - src/mesa/main/blend.h | 1 - src/mesa/main/bufferobj.h | 1 - src/mesa/main/buffers.h | 1 - src/mesa/main/clip.c | 1 - src/mesa/main/clip.h | 1 - src/mesa/main/colormac.h | 1 - src/mesa/main/colortab.c | 1 - src/mesa/main/colortab.h | 1 - src/mesa/main/context.h | 1 - src/mesa/main/convolve.c | 1 - src/mesa/main/convolve.h | 1 - src/mesa/main/dd.h | 1 - src/mesa/main/debug.c | 1 - src/mesa/main/debug.h | 1 - src/mesa/main/dispatch.c | 1 - src/mesa/main/dlist.h | 1 - src/mesa/main/drawpix.c | 1 - src/mesa/main/drawpix.h | 1 - src/mesa/main/enable.h | 1 - src/mesa/main/enums.c | 1 - src/mesa/main/enums.h | 1 - src/mesa/main/eval.c | 1 - src/mesa/main/eval.h | 1 - src/mesa/main/extensions.h | 1 - src/mesa/main/feedback.c | 1 - src/mesa/main/feedback.h | 1 - src/mesa/main/fog.h | 1 - src/mesa/main/get.h | 1 - src/mesa/main/glheader.h | 1 - src/mesa/main/hash.c | 1 - src/mesa/main/hash.h | 1 - src/mesa/main/hint.c | 1 - src/mesa/main/hint.h | 1 - src/mesa/main/histogram.c | 1 - src/mesa/main/histogram.h | 1 - src/mesa/main/image.c | 1 - src/mesa/main/image.h | 1 - src/mesa/main/light.c | 1 - src/mesa/main/light.h | 1 - src/mesa/main/lines.c | 1 - src/mesa/main/lines.h | 1 - src/mesa/main/macros.h | 1 - src/mesa/main/matrix.h | 1 - src/mesa/main/nvfragparse.h | 1 - src/mesa/main/nvfragprog.h | 1 - src/mesa/main/nvvertprog.h | 1 - src/mesa/main/pixel.c | 1 - src/mesa/main/pixel.h | 1 - src/mesa/main/points.c | 1 - src/mesa/main/points.h | 1 - src/mesa/main/polygon.c | 1 - src/mesa/main/polygon.h | 1 - src/mesa/main/rastpos.h | 1 - src/mesa/main/simple_list.h | 1 - src/mesa/main/state.h | 1 - src/mesa/main/stencil.c | 1 - src/mesa/main/stencil.h | 1 - src/mesa/main/texcompress.h | 1 - src/mesa/main/texobj.c | 2 -- src/mesa/main/texobj.h | 1 - src/mesa/main/texstate.h | 1 - src/mesa/main/texutil.c | 1 - src/mesa/main/texutil.h | 1 - src/mesa/main/texutil_tmp.h | 1 - src/mesa/main/varray.h | 1 - src/mesa/main/vtxfmt.c | 1 - src/mesa/main/vtxfmt.h | 1 - src/mesa/main/vtxfmt_tmp.h | 1 - src/mesa/math/m_clip_tmp.h | 1 - src/mesa/math/m_copy_tmp.h | 1 - src/mesa/math/m_debug.h | 1 - src/mesa/math/m_debug_clip.c | 1 - src/mesa/math/m_debug_norm.c | 1 - src/mesa/math/m_debug_util.h | 1 - src/mesa/math/m_debug_xform.c | 1 - src/mesa/math/m_dotprod_tmp.h | 1 - src/mesa/math/m_eval.c | 1 - src/mesa/math/m_eval.h | 1 - src/mesa/math/m_matrix.c | 1 - src/mesa/math/m_matrix.h | 1 - src/mesa/math/m_norm_tmp.h | 1 - src/mesa/math/m_translate.h | 1 - src/mesa/math/m_vector.c | 1 - src/mesa/math/m_vector.h | 1 - src/mesa/math/m_xform.c | 1 - src/mesa/math/m_xform.h | 1 - src/mesa/math/m_xform_tmp.h | 1 - src/mesa/math/mathmod.h | 1 - src/mesa/swrast/s_aaline.h | 1 - src/mesa/swrast/s_aalinetemp.h | 1 - src/mesa/swrast/s_aatriangle.h | 1 - src/mesa/swrast/s_aatritemp.h | 1 - src/mesa/swrast/s_accum.c | 1 - src/mesa/swrast/s_accum.h | 1 - src/mesa/swrast/s_alpha.c | 1 - src/mesa/swrast/s_alpha.h | 1 - src/mesa/swrast/s_alphabuf.c | 1 - src/mesa/swrast/s_alphabuf.h | 1 - src/mesa/swrast/s_blend.c | 1 - src/mesa/swrast/s_blend.h | 1 - src/mesa/swrast/s_buffers.c | 1 - src/mesa/swrast/s_drawpix.h | 1 - src/mesa/swrast/s_feedback.c | 1 - src/mesa/swrast/s_feedback.h | 1 - src/mesa/swrast/s_fog.c | 1 - src/mesa/swrast/s_fog.h | 1 - src/mesa/swrast/s_imaging.c | 1 - src/mesa/swrast/s_lines.h | 1 - src/mesa/swrast/s_linetemp.h | 1 - src/mesa/swrast/s_logic.c | 1 - src/mesa/swrast/s_logic.h | 1 - src/mesa/swrast/s_masking.c | 1 - src/mesa/swrast/s_masking.h | 1 - src/mesa/swrast/s_nvfragprog.h | 1 - src/mesa/swrast/s_pixeltex.c | 1 - src/mesa/swrast/s_pixeltex.h | 1 - src/mesa/swrast/s_points.h | 1 - src/mesa/swrast/s_pointtemp.h | 1 - src/mesa/swrast/s_readpix.c | 1 - src/mesa/swrast/s_span.h | 1 - src/mesa/swrast/s_spantemp.h | 1 - src/mesa/swrast/s_stencil.c | 1 - src/mesa/swrast/s_stencil.h | 1 - src/mesa/swrast/s_texstore.c | 1 - src/mesa/swrast/s_texture.h | 1 - src/mesa/swrast/s_triangle.h | 1 - src/mesa/swrast/s_trispan.h | 1 - src/mesa/swrast/s_tritemp.h | 3 --- src/mesa/swrast/s_zoom.c | 1 - src/mesa/swrast/s_zoom.h | 1 - src/mesa/swrast/swrast.h | 1 - src/mesa/swrast_setup/ss_context.c | 1 - src/mesa/swrast_setup/ss_context.h | 1 - src/mesa/swrast_setup/ss_triangle.c | 1 - src/mesa/swrast_setup/ss_triangle.h | 1 - src/mesa/swrast_setup/ss_tritmp.h | 1 - src/mesa/swrast_setup/ss_vb.h | 1 - src/mesa/swrast_setup/ss_vbtmp.h | 1 - src/mesa/swrast_setup/swrast_setup.h | 1 - src/mesa/tnl/t_array_api.h | 1 - src/mesa/tnl/t_array_import.c | 1 - src/mesa/tnl/t_array_import.h | 1 - src/mesa/tnl/t_context.c | 1 - src/mesa/tnl/t_eval_api.c | 1 - src/mesa/tnl/t_eval_api.h | 1 - src/mesa/tnl/t_imm_alloc.c | 1 - src/mesa/tnl/t_imm_alloc.h | 1 - src/mesa/tnl/t_imm_api.h | 1 - src/mesa/tnl/t_imm_debug.c | 1 - src/mesa/tnl/t_imm_debug.h | 1 - src/mesa/tnl/t_imm_dlist.h | 1 - src/mesa/tnl/t_imm_elt.h | 1 - src/mesa/tnl/t_imm_eval.c | 1 - src/mesa/tnl/t_imm_eval.h | 1 - src/mesa/tnl/t_pipeline.c | 1 - src/mesa/tnl/t_pipeline.h | 1 - src/mesa/tnl/t_vb_cliptmp.h | 1 - src/mesa/tnl/t_vb_fog.c | 1 - src/mesa/tnl/t_vb_light.c | 1 - src/mesa/tnl/t_vb_lighttmp.h | 1 - src/mesa/tnl/t_vb_normals.c | 1 - src/mesa/tnl/t_vb_points.c | 1 - src/mesa/tnl/t_vb_render.c | 1 - src/mesa/tnl/t_vb_rendertmp.h | 1 - src/mesa/tnl/t_vb_vertex.c | 1 - src/mesa/tnl/tnl.h | 1 - 277 files changed, 5 insertions(+), 433 deletions(-) (limited to 'include') diff --git a/include/GL/amesa.h b/include/GL/amesa.h index 25a5aa48a82..852d34cf4f5 100644 --- a/include/GL/amesa.h +++ b/include/GL/amesa.h @@ -1,5 +1,3 @@ -/* $Id: amesa.h,v 1.2 2000/02/09 19:03:28 brianp Exp $ */ - /* * Mesa 3-D graphics library * Version: 3.3 diff --git a/include/GL/foomesa.h b/include/GL/foomesa.h index 88746294501..8517d88388f 100644 --- a/include/GL/foomesa.h +++ b/include/GL/foomesa.h @@ -1,5 +1,3 @@ -/* $Id: foomesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ - /* * Mesa 3-D graphics library * Version: 3.0 @@ -21,17 +19,6 @@ */ -/* - * $Log: foomesa.h,v $ - * Revision 1.1 1999/08/19 00:55:40 jtg - * Initial revision - * - * Revision 1.1 1998/06/02 01:34:18 brianp - * Initial revision - * - */ - - /* * Example Foo/Mesa interface. See src/ddsample.c for more info. */ diff --git a/include/GL/fxmesa.h b/include/GL/fxmesa.h index 60a9b5f99e6..b1978923986 100644 --- a/include/GL/fxmesa.h +++ b/include/GL/fxmesa.h @@ -1,5 +1,3 @@ -/* $Id: fxmesa.h,v 1.4 2001/09/23 16:06:13 brianp Exp $ */ - /* * Mesa 3-D graphics library * Version: 4.0 diff --git a/include/GL/ggimesa.h b/include/GL/ggimesa.h index 1e8eb52b6a9..90e0b422225 100644 --- a/include/GL/ggimesa.h +++ b/include/GL/ggimesa.h @@ -1,5 +1,3 @@ -/* $Id: ggimesa.h,v 1.4 2002/06/10 15:16:44 brianp Exp $ */ - /* * Mesa 3-D graphics library GGI bindings (GGIGL [giggle]) * Version: 4.0 diff --git a/include/GL/glu_mangle.h b/include/GL/glu_mangle.h index 6f92f221a5c..4cc9b6f044c 100644 --- a/include/GL/glu_mangle.h +++ b/include/GL/glu_mangle.h @@ -1,5 +1,3 @@ -/* $Id: glu_mangle.h,v 1.3 2001/09/20 22:18:47 kschultz Exp $ */ - /* * Mesa 3-D graphics library * Version: 3.0 @@ -21,25 +19,6 @@ */ -/* - * $Log: glu_mangle.h,v $ - * Revision 1.3 2001/09/20 22:18:47 kschultz - * add mangling for new entry points - * - * Revision 1.2 1999/09/10 02:08:19 gareth - * Added GLU 1.3 tessellation (except winding rule code). - * - * Revision 1.1.1.1 1999/08/19 00:55:40 jtg - * Imported sources - * - * Revision 3.1 1999/06/21 22:00:42 brianp - * added #ifndef GLU_MANGLE_H stuff - * - * Revision 3.0 1998/02/20 05:04:45 brianp - * initial rev - * - */ - #ifndef GLU_MANGLE_H #define GLU_MANGLE_H diff --git a/include/GL/glut_h.dja b/include/GL/glut_h.dja index d5713f0c90a..e76dcb985e3 100644 --- a/include/GL/glut_h.dja +++ b/include/GL/glut_h.dja @@ -1,4 +1,3 @@ -/* $Id*/ /* * Mesa 3-D graphics library @@ -21,17 +20,6 @@ */ -/* - * $Log: glut_h.dja,v $ - * Revision 1.1 1999/08/19 00:55:40 jtg - * Initial revision - * - * Revision 1.1 1999/06/23 00:51:27 brianp - * initial check-in - * - */ - - /* * This header file is based on the REAL glut.h by Mark J. Kilgard. * diff --git a/include/GL/glx.h b/include/GL/glx.h index 88fa0f571c9..5feb013bae0 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,5 +1,3 @@ -/* $Id: glx.h,v 1.39 2003/01/14 04:49:31 brianp Exp $ */ - /* * Mesa 3-D graphics library * Version: 4.1 diff --git a/include/GL/glx_mangle.h b/include/GL/glx_mangle.h index da96d2003fe..d0b47d94e73 100644 --- a/include/GL/glx_mangle.h +++ b/include/GL/glx_mangle.h @@ -1,5 +1,3 @@ -/* $Id: glx_mangle.h,v 1.2 2001/11/09 22:01:02 brianp Exp $ */ - /* * Mesa 3-D graphics library * Version: 4.1 diff --git a/include/GL/mesa_wgl.h b/include/GL/mesa_wgl.h index 8a7b746857d..a331bb3514b 100644 --- a/include/GL/mesa_wgl.h +++ b/include/GL/mesa_wgl.h @@ -1,5 +1,3 @@ -/* $Id: mesa_wgl.h,v 1.6 2001/05/07 13:58:00 gareth Exp $ */ - /* * Mesa 3-D graphics library * Version: 3.1 diff --git a/include/GL/mglmesa.h b/include/GL/mglmesa.h index 76deb339710..d9ba61c175a 100644 --- a/include/GL/mglmesa.h +++ b/include/GL/mglmesa.h @@ -5,8 +5,8 @@ * Copyright (C) 1996 SciTech Software. * All rights reserved. * -* Filename: $Workfile: mglmesa.h $ -* Version: $Revision: 1.1 $ +* Filename: mglmesa.h +* Version: Revision: 1.1.1.1 * * Language: ANSI C * Environment: Any @@ -34,7 +34,6 @@ * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* $Date: 1999/08/19 00:55:40 $ $Author: jtg $ * ****************************************************************************/ diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h index d9412378121..cf892b91c93 100644 --- a/include/GL/osmesa.h +++ b/include/GL/osmesa.h @@ -1,5 +1,3 @@ -/* $Id: osmesa.h,v 1.10 2002/04/04 16:58:04 brianp Exp $ */ - /* * Mesa 3-D graphics library * Version: 4.1 diff --git a/include/GL/svgamesa.h b/include/GL/svgamesa.h index 775251a05b4..67c0e4c5c65 100644 --- a/include/GL/svgamesa.h +++ b/include/GL/svgamesa.h @@ -1,5 +1,3 @@ -/* $Id: svgamesa.h,v 1.6 2001/09/23 16:06:13 brianp Exp $ */ - /* * Mesa 3-D graphics library * Version: 4.0 diff --git a/include/GL/wmesa.h b/include/GL/wmesa.h index 67ca17f7a4a..dc1ec89d2b1 100644 --- a/include/GL/wmesa.h +++ b/include/GL/wmesa.h @@ -1,5 +1,3 @@ -/* $Id: wmesa.h,v 1.2 2002/04/23 18:23:32 kschultz Exp $ */ - /* * Mesa 3-D graphics library * Version: 3.0 @@ -22,32 +20,6 @@ */ -/* - * $Log: wmesa.h,v $ - * Revision 1.2 2002/04/23 18:23:32 kschultz - * Fix up alpha buffer handling for Windows. - * - add two new Pixel Format Descriptors that do not have alpha bits to - * mirror the two that do. - * - add logic to wglChoosePixelFormat to match PFD's with respect to alpha. - * - Create/clear software alpha buffer as required. - * Now a wgl or GLUT program can control the creation of a software alpha - * buffer via the PFD or GLUT parms, respectively. - * - * Revision 1.1.1.1 1999/08/19 00:55:40 jtg - * Imported sources - * - * Revision 3.2 1999/01/03 02:54:45 brianp - * updated per Ted Jump - * - * Revision 3.1 1998/12/01 02:34:27 brianp - * applied Mark Kilgard's patches from November 30, 1998 - * - * Revision 3.0 1998/02/20 05:06:59 brianp - * initial rev - * - */ - - /* * Windows driver by: Mark E. Peterson (markp@ic.mankato.mn.us) * Updated by Li Wei (liwei@aiar.xjtu.edu.cn) diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index d5a08f9d5f2..2b7f3675431 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -1,5 +1,3 @@ -/* $Id: xmesa.h,v 1.14 2002/10/05 03:03:37 brianp Exp $ */ - /* * Mesa 3-D graphics library * Version: 4.1 diff --git a/include/GL/xmesa_x.h b/include/GL/xmesa_x.h index d5fb399b446..def0447195f 100644 --- a/include/GL/xmesa_x.h +++ b/include/GL/xmesa_x.h @@ -30,7 +30,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Authors: * Kevin E. Martin * - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/xmesa_x.h,v 1.2 2000/02/25 20:31:11 brianp Exp $ */ #ifndef _XMESA_X_H_ diff --git a/include/GL/xmesa_xf86.h b/include/GL/xmesa_xf86.h index a07c7f48936..983f234ddd9 100644 --- a/include/GL/xmesa_xf86.h +++ b/include/GL/xmesa_xf86.h @@ -30,7 +30,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Authors: * Kevin E. Martin * - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/xmesa_xf86.h,v 1.5 2000/04/05 22:09:10 brianp Exp $ */ #ifndef _XMESA_XF86_H_ diff --git a/progs/demos/Makefile.BeOS-R4 b/progs/demos/Makefile.BeOS-R4 index 8511409a464..37ff24f8b46 100644 --- a/progs/demos/Makefile.BeOS-R4 +++ b/progs/demos/Makefile.BeOS-R4 @@ -1,4 +1,3 @@ -# $Id: Makefile.BeOS-R4,v 1.15 2003/04/17 19:20:54 brianp Exp $ # Mesa 3-D graphics library # Version: 3.5 diff --git a/progs/demos/Makefile.cygnus b/progs/demos/Makefile.cygnus index c41c4a60281..0efc1ab0c99 100644 --- a/progs/demos/Makefile.cygnus +++ b/progs/demos/Makefile.cygnus @@ -1,4 +1,3 @@ -# $Id: Makefile.cygnus,v 1.12 2000/12/24 22:53:54 pesco Exp $ # Mesa 3-D graphics library # Version: 3.3 diff --git a/progs/demos/Makefile.win b/progs/demos/Makefile.win index 188ca2f6734..64271f652fb 100644 --- a/progs/demos/Makefile.win +++ b/progs/demos/Makefile.win @@ -1,4 +1,3 @@ -# $Id: Makefile.win,v 1.8 2003/04/17 19:20:55 brianp Exp $ # Mesa 3-D graphics library # Version: 5.1 @@ -129,4 +128,4 @@ readtex.c: -copy ..\util\readtex.c . readtex.h: - -copy ..\util\readtex.h . \ No newline at end of file + -copy ..\util\readtex.h . diff --git a/progs/demos/bounce.c b/progs/demos/bounce.c index d97791be5d4..c0f739ea47c 100644 --- a/progs/demos/bounce.c +++ b/progs/demos/bounce.c @@ -1,4 +1,3 @@ -/* $Id: bounce.c,v 1.3 2000/08/16 20:36:34 brianp Exp $ */ /* * Bouncing ball demo. diff --git a/progs/demos/clearspd.c b/progs/demos/clearspd.c index c9a4e2630f8..42953f6675e 100644 --- a/progs/demos/clearspd.c +++ b/progs/demos/clearspd.c @@ -1,4 +1,3 @@ -/* $Id: clearspd.c,v 1.5 2002/10/31 12:38:32 keithw Exp $ */ /* * Simple GLUT program to measure glClear() and glutSwapBuffers() speed. diff --git a/progs/demos/drawpix.c b/progs/demos/drawpix.c index 25d336ece68..e25cb3374ac 100644 --- a/progs/demos/drawpix.c +++ b/progs/demos/drawpix.c @@ -1,4 +1,3 @@ -/* $Id: drawpix.c,v 1.8 2002/07/12 15:54:02 brianp Exp $ */ /* * glDrawPixels demo/test/benchmark diff --git a/progs/demos/gamma.c b/progs/demos/gamma.c index abb852294da..9b2c3e1052b 100644 --- a/progs/demos/gamma.c +++ b/progs/demos/gamma.c @@ -1,4 +1,3 @@ -/* $Id: gamma.c,v 1.3 2002/04/22 16:03:37 brianp Exp $ */ /* Draw test patterns to help determine correct gamma value for a display. When the intensities of the inner squares nearly match the intensities diff --git a/progs/demos/gears.c b/progs/demos/gears.c index ac908850532..e9061ed6c92 100644 --- a/progs/demos/gears.c +++ b/progs/demos/gears.c @@ -1,4 +1,3 @@ -/* $Id: gears.c,v 1.6 2000/04/06 02:22:59 brianp Exp $ */ /* * 3-D gear wheels. This program is in the public domain. diff --git a/progs/demos/geartrain.c b/progs/demos/geartrain.c index 98addb8eb4b..ec31e743abc 100644 --- a/progs/demos/geartrain.c +++ b/progs/demos/geartrain.c @@ -1,4 +1,3 @@ -/* $Id: geartrain.c,v 1.8 2001/10/04 19:14:26 kschultz Exp $ */ /* * GearTrain Simulator * Version: 1.00 diff --git a/progs/demos/glinfo.c b/progs/demos/glinfo.c index 4e34983ff50..a6a7478288e 100644 --- a/progs/demos/glinfo.c +++ b/progs/demos/glinfo.c @@ -1,4 +1,3 @@ -/* $Id: glinfo.c,v 1.2 2002/04/22 16:03:37 brianp Exp $ */ /* * Print GL, GLU and GLUT version and extension info diff --git a/progs/demos/gloss.c b/progs/demos/gloss.c index 9f9703ac6ca..8e3d6ca2426 100644 --- a/progs/demos/gloss.c +++ b/progs/demos/gloss.c @@ -1,4 +1,3 @@ -/* $Id: gloss.c,v 1.7 2002/11/28 15:51:55 brianp Exp $ */ /* * Specular reflection demo. The specular highlight is modulated by diff --git a/progs/demos/glutfx.c b/progs/demos/glutfx.c index ec4468471c1..8bf55823897 100644 --- a/progs/demos/glutfx.c +++ b/progs/demos/glutfx.c @@ -1,4 +1,3 @@ -/* $Id: glutfx.c,v 1.3 2002/04/22 16:03:37 brianp Exp $ */ /* * Example of how one might use GLUT with the 3Dfx driver in full-screen mode. diff --git a/progs/demos/isosurf.c b/progs/demos/isosurf.c index 12125aac965..b7c151586c3 100644 --- a/progs/demos/isosurf.c +++ b/progs/demos/isosurf.c @@ -1,4 +1,3 @@ -/* $Id: isosurf.c,v 1.15 2002/10/18 17:47:35 kschultz Exp $ */ /* * Display an isosurface of 3-D wind speed volume. diff --git a/progs/demos/morph3d.c b/progs/demos/morph3d.c index fd9f6a7d700..2ce04a30992 100644 --- a/progs/demos/morph3d.c +++ b/progs/demos/morph3d.c @@ -1,27 +1,3 @@ -/* $Id: morph3d.c,v 1.4 2000/06/27 17:04:43 brianp Exp $ */ - -/* - * $Log: morph3d.c,v $ - * Revision 1.4 2000/06/27 17:04:43 brianp - * fixed compiler warnings - * - * Revision 1.3 1999/12/15 13:00:45 brianp - * moved #define to column 0 - * - * Revision 1.2 1999/09/17 12:27:01 brianp - * silenced some warnings - * - * Revision 1.1.1.1 1999/08/19 00:55:40 jtg - * Imported sources - * - * Revision 3.1 1998/06/29 02:37:30 brianp - * minor changes for Windows (Ted Jump) - * - * Revision 3.0 1998/02/14 18:42:29 brianp - * initial rev - * - */ - /*- * morph3d.c - Shows 3D morphing objects diff --git a/progs/demos/multiarb.c b/progs/demos/multiarb.c index 239efac6633..20aa29f9966 100644 --- a/progs/demos/multiarb.c +++ b/progs/demos/multiarb.c @@ -1,4 +1,3 @@ -/* $Id: multiarb.c,v 1.12 2003/05/30 15:30:17 brianp Exp $ */ /* * GL_ARB_multitexture demo diff --git a/progs/demos/osdemo.c b/progs/demos/osdemo.c index 22321cc10f1..cdb3c72423e 100644 --- a/progs/demos/osdemo.c +++ b/progs/demos/osdemo.c @@ -1,4 +1,3 @@ -/* $Id: osdemo.c,v 1.10 2003/03/03 03:14:25 brianp Exp $ */ /* * Demo of off-screen Mesa rendering diff --git a/progs/demos/paltex.c b/progs/demos/paltex.c index 242d0c4bd35..8d0400c76a4 100644 --- a/progs/demos/paltex.c +++ b/progs/demos/paltex.c @@ -1,4 +1,3 @@ -/* $Id: paltex.c,v 1.9 2002/07/22 13:45:31 brianp Exp $ */ /* * Paletted texture demo. Written by Brian Paul. diff --git a/progs/demos/readpix.c b/progs/demos/readpix.c index ec3665008d2..784e4c88d7b 100644 --- a/progs/demos/readpix.c +++ b/progs/demos/readpix.c @@ -1,4 +1,3 @@ -/* $Id: readpix.c,v 1.8 2002/07/12 15:54:02 brianp Exp $ */ /* * glReadPixels and glCopyPixels test diff --git a/progs/demos/reflect.c b/progs/demos/reflect.c index 0c734a030cb..91b2ad9e730 100644 --- a/progs/demos/reflect.c +++ b/progs/demos/reflect.c @@ -1,4 +1,3 @@ -/* $Id: reflect.c,v 1.7 2001/04/25 15:51:32 brianp Exp $ */ /* * Demo of a reflective, texture-mapped surface with OpenGL. diff --git a/progs/demos/renormal.c b/progs/demos/renormal.c index dc5d980722a..284dffdb274 100644 --- a/progs/demos/renormal.c +++ b/progs/demos/renormal.c @@ -1,15 +1,9 @@ -/* $Id: renormal.c,v 1.3 1999/09/17 12:27:01 brianp Exp $ */ /* * Test GL_EXT_rescale_normal extension * Brian Paul January 1998 This program is in the public domain. */ -/* - * $Id: renormal.c,v 1.3 1999/09/17 12:27:01 brianp Exp $ - */ - - #include #include #include diff --git a/progs/demos/spectex.c b/progs/demos/spectex.c index 68de85ca054..9364245995d 100644 --- a/progs/demos/spectex.c +++ b/progs/demos/spectex.c @@ -1,4 +1,3 @@ -/* $Id: spectex.c,v 1.2 2002/04/22 16:03:37 brianp Exp $ */ /* * GLUT demonstration of texturing with specular highlights. diff --git a/progs/demos/tessdemo.c b/progs/demos/tessdemo.c index 581dec90d5a..66fdc6370c8 100644 --- a/progs/demos/tessdemo.c +++ b/progs/demos/tessdemo.c @@ -1,4 +1,3 @@ -/* $Id: tessdemo.c,v 1.13 2002/10/18 17:47:36 kschultz Exp $ */ /* * A demo of the GLU polygon tesselation functions written by Bogdan Sikorski. diff --git a/progs/demos/texcyl.c b/progs/demos/texcyl.c index 7741a75f855..61c8d908b06 100644 --- a/progs/demos/texcyl.c +++ b/progs/demos/texcyl.c @@ -1,4 +1,3 @@ -/* $Id: texcyl.c,v 1.6 2002/04/22 16:03:37 brianp Exp $ */ /* * Textured cylinder demo: lighting, texturing, reflection mapping. diff --git a/progs/demos/texdown.c b/progs/demos/texdown.c index d56884f379a..9f4f5086917 100644 --- a/progs/demos/texdown.c +++ b/progs/demos/texdown.c @@ -1,4 +1,3 @@ -/* $Id: texdown.c,v 1.4 2001/02/07 03:04:58 gareth Exp $ */ /* * Copyright (C) 1999 Brian Paul All Rights Reserved. diff --git a/progs/demos/texobj.c b/progs/demos/texobj.c index 3ec9e85f858..ff701e98c3b 100644 --- a/progs/demos/texobj.c +++ b/progs/demos/texobj.c @@ -1,4 +1,3 @@ -/* $Id: texobj.c,v 1.7 2003/04/21 14:50:12 brianp Exp $ */ /* * Example of using the 1.1 texture object functions. diff --git a/progs/demos/trispd.c b/progs/demos/trispd.c index 61d625526f2..165d088e3d3 100644 --- a/progs/demos/trispd.c +++ b/progs/demos/trispd.c @@ -1,4 +1,3 @@ -/* $Id: trispd.c,v 1.4 2002/07/12 15:54:02 brianp Exp $ */ /* * Simple GLUT program to measure triangle strip rendering speed. diff --git a/progs/demos/winpos.c b/progs/demos/winpos.c index c8f7fb3844b..62504198dd6 100644 --- a/progs/demos/winpos.c +++ b/progs/demos/winpos.c @@ -1,4 +1,3 @@ -/* $Id: winpos.c,v 1.7 2003/02/27 19:43:02 kschultz Exp $ */ /* * Example of how to use the GL_MESA_window_pos extension. diff --git a/progs/redbook/Makefile.BeOS-R4 b/progs/redbook/Makefile.BeOS-R4 index 4f6734e67b0..ad6f97caa28 100644 --- a/progs/redbook/Makefile.BeOS-R4 +++ b/progs/redbook/Makefile.BeOS-R4 @@ -1,21 +1,7 @@ -# $Id: Makefile.BeOS-R4,v 1.2 1999/09/17 00:08:31 brianp Exp $ # Makefile for OpenGL Programming Guide programs for BeOS R4 # This file is in the public domain. - -# $Log: Makefile.BeOS-R4,v $ -# Revision 1.2 1999/09/17 00:08:31 brianp -# link with -lGLU -lGL instead of -lMesaGLU -lMesaGL -# -# Revision 1.1.1.1 1999/08/19 00:55:40 jtg -# Imported sources -# -# Revision 1.1 1999/02/25 02:13:06 brianp -# initial check-in -# - - ##### MACROS ##### INCDIR = ../include diff --git a/progs/samples/Makefile.BeOS-R4 b/progs/samples/Makefile.BeOS-R4 index 3e1bfb605fb..97de22e60c2 100644 --- a/progs/samples/Makefile.BeOS-R4 +++ b/progs/samples/Makefile.BeOS-R4 @@ -1,4 +1,3 @@ -# $Id: Makefile.BeOS-R4,v 1.2 1999/09/17 00:08:38 brianp Exp $ # Mesa 3-D graphics library # Version: 3.1 diff --git a/progs/samples/Makefile.dja b/progs/samples/Makefile.dja index f2d53829687..b60a11197b6 100644 --- a/progs/samples/Makefile.dja +++ b/progs/samples/Makefile.dja @@ -1,4 +1,3 @@ -# $Id: Makefile.dja,v 1.1 1999/08/19 00:55:41 jtg Exp $ # Makefile for sample programs for MS-DOS with DJGPP and ALLEGRO diff --git a/progs/samples/Makefile.win b/progs/samples/Makefile.win index fc277726a02..e74568f7c96 100644 --- a/progs/samples/Makefile.win +++ b/progs/samples/Makefile.win @@ -1,4 +1,3 @@ -# $Id: Makefile.win,v 1.1 2002/01/16 00:57:54 kschultz Exp $ # Mesa 3-D graphics library # Version: 3.5 diff --git a/progs/samples/logo.c b/progs/samples/logo.c index 98a8e99aece..ae74af685a7 100644 --- a/progs/samples/logo.c +++ b/progs/samples/logo.c @@ -1,4 +1,3 @@ -/* $Id: logo.c,v 1.3 2002/11/05 20:59:16 brianp Exp $ */ /* * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc. diff --git a/progs/xdemos/glthreads.c b/progs/xdemos/glthreads.c index 91fca3dec16..63a94c55681 100644 --- a/progs/xdemos/glthreads.c +++ b/progs/xdemos/glthreads.c @@ -1,4 +1,3 @@ -/* $Id: glthreads.c,v 1.2 2002/03/08 19:44:28 brianp Exp $ */ /* * Copyright (C) 2000 Brian Paul All Rights Reserved. diff --git a/progs/xdemos/glxdemo.c b/progs/xdemos/glxdemo.c index 5e7d4497907..37df64ebee8 100644 --- a/progs/xdemos/glxdemo.c +++ b/progs/xdemos/glxdemo.c @@ -1,4 +1,3 @@ -/* $Id: glxdemo.c,v 1.2 2002/04/02 23:53:56 brianp Exp $ */ /* @@ -8,21 +7,6 @@ * Brian Paul */ - -/* - * $Log: glxdemo.c,v $ - * Revision 1.2 2002/04/02 23:53:56 brianp - * added an error check - * - * Revision 1.1.1.1 1999/08/19 00:55:43 jtg - * Imported sources - * - * Revision 3.0 1998/02/21 02:16:54 brianp - * initial rev - * - */ - - #include #include #include diff --git a/progs/xdemos/glxheads.c b/progs/xdemos/glxheads.c index 428576d9d9c..b1e2be87763 100644 --- a/progs/xdemos/glxheads.c +++ b/progs/xdemos/glxheads.c @@ -1,4 +1,3 @@ -/* $Id: glxheads.c,v 1.4 2003/04/21 14:51:16 brianp Exp $ */ /* * Exercise multiple GLX connections on multiple X displays. diff --git a/progs/xdemos/glxpixmap.c b/progs/xdemos/glxpixmap.c index bde24ebcd04..9db4df2c8b8 100644 --- a/progs/xdemos/glxpixmap.c +++ b/progs/xdemos/glxpixmap.c @@ -1,4 +1,3 @@ -/* $Id: glxpixmap.c,v 1.3 2002/07/12 15:54:02 brianp Exp $ */ /* diff --git a/progs/xdemos/pbdemo.c b/progs/xdemos/pbdemo.c index 611e7e594fd..9bce5699a27 100644 --- a/progs/xdemos/pbdemo.c +++ b/progs/xdemos/pbdemo.c @@ -1,4 +1,3 @@ -/* $Id: pbdemo.c,v 1.1 2002/10/05 18:30:13 brianp Exp $ */ /* * This program demonstrates how to do "off-screen" rendering using diff --git a/progs/xdemos/pbinfo.c b/progs/xdemos/pbinfo.c index f0b2f0eed4c..948ad9ca22c 100644 --- a/progs/xdemos/pbinfo.c +++ b/progs/xdemos/pbinfo.c @@ -1,4 +1,3 @@ -/* $Id: pbinfo.c,v 1.2 2003/04/21 14:51:16 brianp Exp $ */ /* * Print list of fbconfigs and test each to see if a pbuffer can be created diff --git a/progs/xdemos/pbutil.c b/progs/xdemos/pbutil.c index 4451a6d1a5b..1daa95def68 100644 --- a/progs/xdemos/pbutil.c +++ b/progs/xdemos/pbutil.c @@ -1,4 +1,3 @@ -/* $Id: pbutil.c,v 1.1 2002/10/05 18:30:13 brianp Exp $ */ /* * OpenGL pbuffers utility functions. diff --git a/progs/xdemos/pbutil.h b/progs/xdemos/pbutil.h index 9230b47c311..d13c969c4c8 100644 --- a/progs/xdemos/pbutil.h +++ b/progs/xdemos/pbutil.h @@ -1,4 +1,3 @@ -/* $Id: pbutil.h,v 1.1 2002/10/05 18:30:13 brianp Exp $ */ /* * OpenGL pbuffers utility functions. diff --git a/progs/xdemos/shape.c b/progs/xdemos/shape.c index 242dd2485cb..9cae9eb2895 100644 --- a/progs/xdemos/shape.c +++ b/progs/xdemos/shape.c @@ -1,4 +1,3 @@ -/* $Id: shape.c,v 1.3 2000/06/27 15:34:35 brianp Exp $ */ /* * Example of using the X "shape" extension with OpenGL: render a spinning diff --git a/progs/xdemos/vindex.c b/progs/xdemos/vindex.c index f9e3192f38e..991fce2a591 100644 --- a/progs/xdemos/vindex.c +++ b/progs/xdemos/vindex.c @@ -1,4 +1,3 @@ -/* $Id: vindex.c,v 1.1 1999/08/19 00:55:43 jtg Exp $ */ /* * Test Linux 8-bit SVGA/Mesa color index mode diff --git a/progs/xdemos/vtest.c b/progs/xdemos/vtest.c index f0900b6ed6d..e322fbc5c80 100644 --- a/progs/xdemos/vtest.c +++ b/progs/xdemos/vtest.c @@ -1,4 +1,3 @@ -/* $Id: vtest.c,v 1.1 1999/08/19 00:55:43 jtg Exp $ */ /* * Test SVGA/Mesa interface in 32K color mode. diff --git a/progs/xdemos/wincopy.c b/progs/xdemos/wincopy.c index ccf332b9a7f..39d471a5e54 100644 --- a/progs/xdemos/wincopy.c +++ b/progs/xdemos/wincopy.c @@ -1,4 +1,3 @@ -/* $Id: wincopy.c,v 1.1 1999/11/25 17:41:51 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/progs/xdemos/xdemo.c b/progs/xdemos/xdemo.c index 28f945b27d8..52039cb6424 100644 --- a/progs/xdemos/xdemo.c +++ b/progs/xdemos/xdemo.c @@ -1,5 +1,3 @@ -/* $Id: xdemo.c,v 1.2 2000/04/05 22:09:58 brianp Exp $ */ - /* * Very simple demo of how to use the Mesa/X11 interface instead of the @@ -11,22 +9,6 @@ * Brian Paul */ - -/* - * $Log: xdemo.c,v $ - * Revision 1.2 2000/04/05 22:09:58 brianp - * new arguments to XMesaCreateVisual() - * - * Revision 1.1.1.1 1999/08/19 00:55:43 jtg - * Imported sources - * - * Revision 3.0 1998/02/21 02:16:54 brianp - * initial rev - * - */ - - - #include #include #include diff --git a/progs/xdemos/xfont.c b/progs/xdemos/xfont.c index 9b01bc48377..2585aa6447c 100644 --- a/progs/xdemos/xfont.c +++ b/progs/xdemos/xfont.c @@ -1,4 +1,3 @@ -/* $Id: xfont.c,v 1.3 1999/11/05 08:12:46 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mesa/Makefile.BeOS-R4 b/src/glu/mesa/Makefile.BeOS-R4 index dcc58aaf540..99cff18f866 100644 --- a/src/glu/mesa/Makefile.BeOS-R4 +++ b/src/glu/mesa/Makefile.BeOS-R4 @@ -1,4 +1,3 @@ -# $Id: Makefile.BeOS-R4,v 1.7 2000/07/11 14:11:04 brianp Exp $ # Makefile for GLU for BeOS R4 # Mesa 3-D graphics library diff --git a/src/glu/mesa/all.h b/src/glu/mesa/all.h index 427fc3898d5..874c9359254 100644 --- a/src/glu/mesa/all.h +++ b/src/glu/mesa/all.h @@ -1,4 +1,3 @@ -/* $Id: all.h,v 1.2 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mesa/glu.c b/src/glu/mesa/glu.c index 7cc5fab156e..f9e33980a4e 100644 --- a/src/glu/mesa/glu.c +++ b/src/glu/mesa/glu.c @@ -1,4 +1,3 @@ -/* $Id: glu.c,v 1.24 2001/03/20 17:56:10 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mesa/gluP.h b/src/glu/mesa/gluP.h index 7d0ec3c84d7..6a65f751496 100644 --- a/src/glu/mesa/gluP.h +++ b/src/glu/mesa/gluP.h @@ -1,4 +1,3 @@ -/* $Id: gluP.h,v 1.5 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mesa/mipmap.c b/src/glu/mesa/mipmap.c index 22f2dbf8743..d85ce9b9b0a 100644 --- a/src/glu/mesa/mipmap.c +++ b/src/glu/mesa/mipmap.c @@ -1,4 +1,3 @@ -/* $Id: mipmap.c,v 1.8 2000/10/26 21:48:18 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mesa/nurbs.c b/src/glu/mesa/nurbs.c index c93dc3cae68..3f102b4e455 100644 --- a/src/glu/mesa/nurbs.c +++ b/src/glu/mesa/nurbs.c @@ -1,4 +1,3 @@ -/* $Id: nurbs.c,v 1.4 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mesa/nurbs.h b/src/glu/mesa/nurbs.h index c80cacf57af..3642e213a8c 100644 --- a/src/glu/mesa/nurbs.h +++ b/src/glu/mesa/nurbs.h @@ -1,4 +1,3 @@ -/* $Id: nurbs.h,v 1.3 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mesa/nurbscrv.c b/src/glu/mesa/nurbscrv.c index 5bde023275f..4483e1f7761 100644 --- a/src/glu/mesa/nurbscrv.c +++ b/src/glu/mesa/nurbscrv.c @@ -1,4 +1,3 @@ -/* $Id: nurbscrv.c,v 1.3 2000/11/10 17:23:04 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mesa/nurbssrf.c b/src/glu/mesa/nurbssrf.c index c8d44bec0df..d39fa47d18a 100644 --- a/src/glu/mesa/nurbssrf.c +++ b/src/glu/mesa/nurbssrf.c @@ -1,4 +1,3 @@ -/* $Id: nurbssrf.c,v 1.2 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mesa/nurbsutl.c b/src/glu/mesa/nurbsutl.c index 027f245827e..b46348a50b2 100644 --- a/src/glu/mesa/nurbsutl.c +++ b/src/glu/mesa/nurbsutl.c @@ -1,4 +1,3 @@ -/* $Id: nurbsutl.c,v 1.4 2000/11/10 17:23:04 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mesa/polytest.c b/src/glu/mesa/polytest.c index ccf9cdd4b47..1ff966f61ce 100644 --- a/src/glu/mesa/polytest.c +++ b/src/glu/mesa/polytest.c @@ -1,4 +1,3 @@ -/* $Id: polytest.c,v 1.4 2000/11/10 17:23:04 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mesa/project.c b/src/glu/mesa/project.c index c8ab95992af..6fa03267e53 100644 --- a/src/glu/mesa/project.c +++ b/src/glu/mesa/project.c @@ -1,4 +1,3 @@ -/* $Id: project.c,v 1.3 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mesa/quadric.c b/src/glu/mesa/quadric.c index 1f71e346e0d..0f6889b284f 100644 --- a/src/glu/mesa/quadric.c +++ b/src/glu/mesa/quadric.c @@ -1,4 +1,3 @@ -/* $Id: quadric.c,v 1.9 2001/01/15 20:04:28 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mesa/tess.c b/src/glu/mesa/tess.c index 5d24bdb69e0..341d29bae3a 100644 --- a/src/glu/mesa/tess.c +++ b/src/glu/mesa/tess.c @@ -1,4 +1,3 @@ -/* $Id: tess.c,v 1.27 2002/10/15 14:45:19 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mesa/tess.h b/src/glu/mesa/tess.h index 8fb7a414d49..4e51dddd37d 100644 --- a/src/glu/mesa/tess.h +++ b/src/glu/mesa/tess.h @@ -1,4 +1,3 @@ -/* $Id: tess.h,v 1.18 2001/03/20 17:56:10 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/glu/mesa/tesselat.c b/src/glu/mesa/tesselat.c index 60754d7f174..47d230073fd 100644 --- a/src/glu/mesa/tesselat.c +++ b/src/glu/mesa/tesselat.c @@ -1,4 +1,3 @@ -/* $Id: tesselat.c,v 1.3 2000/07/11 14:11:04 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/array_cache/ac_context.c b/src/mesa/array_cache/ac_context.c index 28d4b225feb..0cd3b8b4fc1 100644 --- a/src/mesa/array_cache/ac_context.c +++ b/src/mesa/array_cache/ac_context.c @@ -1,4 +1,3 @@ -/* $Id: ac_context.c,v 1.11 2003/03/01 01:50:24 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/array_cache/ac_context.h b/src/mesa/array_cache/ac_context.h index fbc90743e38..36aded3152c 100644 --- a/src/mesa/array_cache/ac_context.h +++ b/src/mesa/array_cache/ac_context.h @@ -1,4 +1,3 @@ -/* $Id: ac_context.h,v 1.6 2003/01/14 04:55:46 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/array_cache/acache.h b/src/mesa/array_cache/acache.h index d6935235db9..2bb64f3656c 100644 --- a/src/mesa/array_cache/acache.h +++ b/src/mesa/array_cache/acache.h @@ -1,4 +1,3 @@ -/* $Id: acache.h,v 1.4 2002/10/29 20:28:58 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index 25653f8f6f2..4680994310e 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -1,4 +1,3 @@ -/* $Id: glxapi.c,v 1.32 2003/01/14 04:49:07 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/x11/glxapi.h b/src/mesa/drivers/x11/glxapi.h index 2090d02d75d..6f09a68fe08 100644 --- a/src/mesa/drivers/x11/glxapi.h +++ b/src/mesa/drivers/x11/glxapi.h @@ -1,4 +1,3 @@ -/* $Id: glxapi.h,v 1.15 2003/01/14 04:49:07 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/x11/glxheader.h b/src/mesa/drivers/x11/glxheader.h index 6f6b3978d85..b5834003890 100644 --- a/src/mesa/drivers/x11/glxheader.h +++ b/src/mesa/drivers/x11/glxheader.h @@ -1,4 +1,3 @@ -/* $Id: glxheader.h,v 1.5 2002/10/25 00:01:58 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/x11/realglx.c b/src/mesa/drivers/x11/realglx.c index 8ce9720a8b3..520f0f1e303 100644 --- a/src/mesa/drivers/x11/realglx.c +++ b/src/mesa/drivers/x11/realglx.c @@ -1,4 +1,3 @@ -/* $Id: realglx.c,v 1.7 2003/01/14 04:49:07 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/x11/realglx.h b/src/mesa/drivers/x11/realglx.h index f7c2b6470a8..150129db681 100644 --- a/src/mesa/drivers/x11/realglx.h +++ b/src/mesa/drivers/x11/realglx.h @@ -1,4 +1,3 @@ -/* $Id: realglx.h,v 1.5 2002/10/08 23:16:27 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/x11/xfonts.c b/src/mesa/drivers/x11/xfonts.c index 0f2dbbe1833..8e256e097bb 100644 --- a/src/mesa/drivers/x11/xfonts.c +++ b/src/mesa/drivers/x11/xfonts.c @@ -1,4 +1,3 @@ -/* $Id: xfonts.c,v 1.15 2002/10/24 23:57:23 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/x11/xfonts.h b/src/mesa/drivers/x11/xfonts.h index abf95223ba9..e36f42f817a 100644 --- a/src/mesa/drivers/x11/xfonts.h +++ b/src/mesa/drivers/x11/xfonts.h @@ -1,4 +1,3 @@ -/* $Id: xfonts.h,v 1.3 2001/01/08 04:06:20 keithw Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/x11/xm_line.c b/src/mesa/drivers/x11/xm_line.c index de007ea9cbd..9b0e5653147 100644 --- a/src/mesa/drivers/x11/xm_line.c +++ b/src/mesa/drivers/x11/xm_line.c @@ -1,4 +1,3 @@ -/* $Id: xm_line.c,v 1.24 2003/04/01 17:28:12 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c index e5d76e26a60..8e8b8fc9388 100644 --- a/src/mesa/drivers/x11/xm_tri.c +++ b/src/mesa/drivers/x11/xm_tri.c @@ -1,4 +1,3 @@ -/* $Id: xm_tri.c,v 1.33 2003/04/01 17:28:12 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 5024e527c29..bb014a0df39 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -1,4 +1,3 @@ -/* $Id: xmesaP.h,v 1.36 2003/04/01 17:28:12 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index fcdab05e412..3cb4ccca341 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -1,4 +1,3 @@ -/* $Id: glapi.c,v 1.67 2002/10/29 15:03:14 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/glapi/glapi.h b/src/mesa/glapi/glapi.h index be62118b57f..41d7aaf0287 100644 --- a/src/mesa/glapi/glapi.h +++ b/src/mesa/glapi/glapi.h @@ -1,4 +1,3 @@ -/* $Id: glapi.h,v 1.20 2002/06/29 19:48:16 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/glapi/glthread.c b/src/mesa/glapi/glthread.c index dce8a8a837e..5fa8313975c 100644 --- a/src/mesa/glapi/glthread.c +++ b/src/mesa/glapi/glthread.c @@ -1,4 +1,3 @@ -/* $Id: glthread.c,v 1.10 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/glapi/glthread.h b/src/mesa/glapi/glthread.h index 5281a3e7030..00710c1058e 100644 --- a/src/mesa/glapi/glthread.h +++ b/src/mesa/glapi/glthread.h @@ -1,4 +1,3 @@ -/* $Id: glthread.h,v 1.12 2002/12/12 13:03:15 keithw Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/KNOWN_BUGS b/src/mesa/main/KNOWN_BUGS index f94658b224c..efbb0ca40fc 100644 --- a/src/mesa/main/KNOWN_BUGS +++ b/src/mesa/main/KNOWN_BUGS @@ -1,4 +1,3 @@ -$Id: KNOWN_BUGS,v 1.3 2000/07/19 15:08:55 brianp Exp $ Performance issues with EXT_point_parameters & quake2 diff --git a/src/mesa/main/Makefile.OSMesa16 b/src/mesa/main/Makefile.OSMesa16 index 4a4951d482d..206c4d9376e 100644 --- a/src/mesa/main/Makefile.OSMesa16 +++ b/src/mesa/main/Makefile.OSMesa16 @@ -1,4 +1,3 @@ -# $Id: Makefile.OSMesa16,v 1.15 2003/04/17 02:33:11 brianp Exp $ # Mesa 3-D graphics library # Version: 5.1 diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c index 7f0145d0be1..1185adbfd41 100644 --- a/src/mesa/main/accum.c +++ b/src/mesa/main/accum.c @@ -1,4 +1,3 @@ -/* $Id: accum.c,v 1.39 2002/10/24 23:57:19 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/accum.h b/src/mesa/main/accum.h index dde8dfe17b4..8682525dc14 100644 --- a/src/mesa/main/accum.h +++ b/src/mesa/main/accum.h @@ -1,4 +1,3 @@ -/* $Id: accum.h,v 1.6 2001/03/12 00:48:37 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index f8269fe61ca..edfa8e53cf4 100644 --- a/src/mesa/main/api_arrayelt.c +++ b/src/mesa/main/api_arrayelt.c @@ -1,3 +1,4 @@ + /* * Mesa 3-D graphics library * Version: 5.1 diff --git a/src/mesa/main/api_arrayelt.h b/src/mesa/main/api_arrayelt.h index 7fed406e504..706a72308c5 100644 --- a/src/mesa/main/api_arrayelt.h +++ b/src/mesa/main/api_arrayelt.h @@ -1,4 +1,3 @@ -/* $Id: api_arrayelt.h,v 1.1 2001/06/01 22:22:10 keithw Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/api_eval.c b/src/mesa/main/api_eval.c index 254f8149889..1a705f06c92 100644 --- a/src/mesa/main/api_eval.c +++ b/src/mesa/main/api_eval.c @@ -1,4 +1,3 @@ -/* $Id: api_eval.c,v 1.4 2003/03/01 01:50:20 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/api_eval.h b/src/mesa/main/api_eval.h index 23776b6a14c..d6cb38c9f8c 100644 --- a/src/mesa/main/api_eval.h +++ b/src/mesa/main/api_eval.h @@ -1,4 +1,3 @@ -/* $Id: api_eval.h,v 1.1 2001/06/04 13:57:35 keithw Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/api_loopback.h b/src/mesa/main/api_loopback.h index 901c70cde6a..a4858e44f47 100644 --- a/src/mesa/main/api_loopback.h +++ b/src/mesa/main/api_loopback.h @@ -1,4 +1,3 @@ -/* $Id: api_loopback.h,v 1.2 2001/03/12 00:48:37 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c index f15e3b61423..a1f689d6f95 100644 --- a/src/mesa/main/api_noop.c +++ b/src/mesa/main/api_noop.c @@ -1,4 +1,3 @@ -/* $Id: api_noop.c,v 1.13 2003/05/30 21:37:14 idr Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/api_noop.h b/src/mesa/main/api_noop.h index de099bbe0aa..da133ace786 100644 --- a/src/mesa/main/api_noop.h +++ b/src/mesa/main/api_noop.h @@ -1,4 +1,3 @@ -/* $Id: api_noop.h,v 1.5 2002/04/09 16:56:50 keithw Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 8feda650cc5..945f68c1741 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -1,3 +1,4 @@ + /* * Mesa 3-D graphics library * Version: 5.1 diff --git a/src/mesa/main/api_validate.h b/src/mesa/main/api_validate.h index f24365055bb..10f0c34e663 100644 --- a/src/mesa/main/api_validate.h +++ b/src/mesa/main/api_validate.h @@ -1,4 +1,3 @@ -/* $Id: api_validate.h,v 1.2 2001/03/12 00:48:37 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 1ae12c8bef4..30c0c7faffd 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1,4 +1,3 @@ -/* $Id: attrib.c,v 1.78 2003/02/05 15:24:28 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/attrib.h b/src/mesa/main/attrib.h index fabe3e0d037..decc71a782b 100644 --- a/src/mesa/main/attrib.h +++ b/src/mesa/main/attrib.h @@ -1,4 +1,3 @@ -/* $Id: attrib.h,v 1.6 2002/02/13 00:53:19 keithw Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index 0b1f86e3e69..e031851f98b 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -1,4 +1,3 @@ -/* $Id: blend.c,v 1.38 2002/10/24 23:57:19 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/blend.h b/src/mesa/main/blend.h index 3e8b4ec1b57..d0a24afd00f 100644 --- a/src/mesa/main/blend.h +++ b/src/mesa/main/blend.h @@ -1,4 +1,3 @@ -/* $Id: blend.h,v 1.9 2001/06/18 17:26:08 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index 3f4cd206211..58c4b592993 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -1,4 +1,3 @@ -/* $Id: bufferobj.h,v 1.2 2003/05/10 04:35:09 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h index 67c1fae8069..dfa2131309d 100644 --- a/src/mesa/main/buffers.h +++ b/src/mesa/main/buffers.h @@ -1,4 +1,3 @@ -/* $Id: buffers.h,v 1.5 2001/06/18 17:26:08 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/clip.c b/src/mesa/main/clip.c index 8f701bb7120..3050f4e379f 100644 --- a/src/mesa/main/clip.c +++ b/src/mesa/main/clip.c @@ -1,4 +1,3 @@ -/* $Id: clip.c,v 1.27 2003/03/01 01:50:20 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/clip.h b/src/mesa/main/clip.h index 6d034b64b83..fffcf13e979 100644 --- a/src/mesa/main/clip.h +++ b/src/mesa/main/clip.h @@ -1,4 +1,3 @@ -/* $Id: clip.h,v 1.6 2001/03/12 00:48:37 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/colormac.h b/src/mesa/main/colormac.h index 7f6b922f62b..e26052343e3 100644 --- a/src/mesa/main/colormac.h +++ b/src/mesa/main/colormac.h @@ -1,4 +1,3 @@ -/* $Id: colormac.h,v 1.12 2003/03/01 01:50:20 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 0a785743c06..78ef93caa61 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -1,4 +1,3 @@ -/* $Id: colortab.c,v 1.49 2003/03/01 01:50:20 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/colortab.h b/src/mesa/main/colortab.h index 813b4e28771..e3bc76e5c33 100644 --- a/src/mesa/main/colortab.h +++ b/src/mesa/main/colortab.h @@ -1,4 +1,3 @@ -/* $Id: colortab.h,v 1.9 2001/03/12 00:48:37 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index 8b1de0a53aa..a123b317bc1 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -1,4 +1,3 @@ -/* $Id: context.h,v 1.35 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c index a5e71b8cbdc..341d60eacdd 100644 --- a/src/mesa/main/convolve.c +++ b/src/mesa/main/convolve.c @@ -1,4 +1,3 @@ -/* $Id: convolve.c,v 1.28 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/convolve.h b/src/mesa/main/convolve.h index 72a5d6f6327..f97c9f35bdf 100644 --- a/src/mesa/main/convolve.h +++ b/src/mesa/main/convolve.h @@ -1,4 +1,3 @@ -/* $Id: convolve.h,v 1.4 2001/02/06 17:22:16 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 59316ca0549..88ffb8fb473 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -1,4 +1,3 @@ -/* $Id: dd.h,v 1.75 2003/04/01 16:41:52 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 2be25feb5a0..7cd30f30bba 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -1,4 +1,3 @@ -/* $Id: debug.c,v 1.14 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/debug.h b/src/mesa/main/debug.h index 2565f018c53..6b45c033683 100644 --- a/src/mesa/main/debug.h +++ b/src/mesa/main/debug.h @@ -1,4 +1,3 @@ -/* $Id: debug.h,v 1.3 2001/03/12 00:48:37 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/dispatch.c b/src/mesa/main/dispatch.c index 91155bc2c60..87dc64f02d9 100644 --- a/src/mesa/main/dispatch.c +++ b/src/mesa/main/dispatch.c @@ -1,4 +1,3 @@ -/* $Id: dispatch.c,v 1.28 2002/10/24 23:57:20 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/dlist.h b/src/mesa/main/dlist.h index 6671620d470..9880aa07935 100644 --- a/src/mesa/main/dlist.h +++ b/src/mesa/main/dlist.h @@ -1,4 +1,3 @@ -/* $Id: dlist.h,v 1.17 2001/12/14 02:50:01 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index f5d780e2ae2..4597cd09162 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -1,4 +1,3 @@ -/* $Id: drawpix.c,v 1.64 2003/03/01 01:50:20 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/drawpix.h b/src/mesa/main/drawpix.h index aa321faec17..478767af4bf 100644 --- a/src/mesa/main/drawpix.h +++ b/src/mesa/main/drawpix.h @@ -1,4 +1,3 @@ -/* $Id: drawpix.h,v 1.7 2001/06/18 17:26:08 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/enable.h b/src/mesa/main/enable.h index 24f48f0aefa..bf71f1773f7 100644 --- a/src/mesa/main/enable.h +++ b/src/mesa/main/enable.h @@ -1,4 +1,3 @@ -/* $Id: enable.h,v 1.4 2001/03/12 00:48:37 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 5b722f530e7..20009d66dd3 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -1,4 +1,3 @@ -/* $Id: enums.c,v 1.26 2003/01/25 00:46:46 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/enums.h b/src/mesa/main/enums.h index 6a859172530..ff59233296a 100644 --- a/src/mesa/main/enums.h +++ b/src/mesa/main/enums.h @@ -1,4 +1,3 @@ -/* $Id: enums.h,v 1.3 2001/03/12 00:48:37 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/eval.c b/src/mesa/main/eval.c index d207d14b208..03d779e8941 100644 --- a/src/mesa/main/eval.c +++ b/src/mesa/main/eval.c @@ -1,4 +1,3 @@ -/* $Id: eval.c,v 1.25 2003/03/01 01:50:20 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/eval.h b/src/mesa/main/eval.h index ce1e9b279b7..2e4f5227e4b 100644 --- a/src/mesa/main/eval.h +++ b/src/mesa/main/eval.h @@ -1,4 +1,3 @@ -/* $Id: eval.h,v 1.6 2001/03/12 00:48:37 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h index d940be2e434..fee9d0d57ec 100644 --- a/src/mesa/main/extensions.h +++ b/src/mesa/main/extensions.h @@ -1,4 +1,3 @@ -/* $Id: extensions.h,v 1.15 2002/06/29 20:03:13 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c index 6bd336b5f70..53c43cf3176 100644 --- a/src/mesa/main/feedback.c +++ b/src/mesa/main/feedback.c @@ -1,4 +1,3 @@ -/* $Id: feedback.c,v 1.28 2003/03/01 01:50:20 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/feedback.h b/src/mesa/main/feedback.h index 1d77032d972..e91546248ae 100644 --- a/src/mesa/main/feedback.h +++ b/src/mesa/main/feedback.h @@ -1,4 +1,3 @@ -/* $Id: feedback.h,v 1.7 2001/03/12 00:48:37 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/fog.h b/src/mesa/main/fog.h index af448bfb837..cd7f59cc6d2 100644 --- a/src/mesa/main/fog.h +++ b/src/mesa/main/fog.h @@ -1,4 +1,3 @@ -/* $Id: fog.h,v 1.12 2001/03/12 00:48:37 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/get.h b/src/mesa/main/get.h index 92a927b0455..eaddb746f9a 100644 --- a/src/mesa/main/get.h +++ b/src/mesa/main/get.h @@ -1,4 +1,3 @@ -/* $Id: get.h,v 1.5 2001/03/12 00:48:38 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h index c203b91598c..52950b35565 100644 --- a/src/mesa/main/glheader.h +++ b/src/mesa/main/glheader.h @@ -1,4 +1,3 @@ -/* $Id: glheader.h,v 1.30 2003/03/01 01:50:21 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/hash.c b/src/mesa/main/hash.c index b22ee2551ab..32e37a268d2 100644 --- a/src/mesa/main/hash.c +++ b/src/mesa/main/hash.c @@ -1,4 +1,3 @@ -/* $Id: hash.c,v 1.15 2002/12/12 13:03:15 keithw Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/hash.h b/src/mesa/main/hash.h index 313c699e348..07bdef46c18 100644 --- a/src/mesa/main/hash.h +++ b/src/mesa/main/hash.h @@ -1,4 +1,3 @@ -/* $Id: hash.h,v 1.6 2002/09/16 17:55:36 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/hint.c b/src/mesa/main/hint.c index 7ccb7be5557..90ccc8bf6f1 100644 --- a/src/mesa/main/hint.c +++ b/src/mesa/main/hint.c @@ -1,4 +1,3 @@ -/* $Id: hint.c,v 1.14 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/hint.h b/src/mesa/main/hint.h index 6b8f34dc05a..f33be7b54df 100644 --- a/src/mesa/main/hint.h +++ b/src/mesa/main/hint.h @@ -1,4 +1,3 @@ -/* $Id: hint.h,v 1.4 2002/06/15 02:38:15 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c index e96c990f584..63b147b0053 100644 --- a/src/mesa/main/histogram.c +++ b/src/mesa/main/histogram.c @@ -1,4 +1,3 @@ -/* $Id: histogram.c,v 1.13 2003/03/25 02:26:29 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/histogram.h b/src/mesa/main/histogram.h index f929b0513c2..ece6f11ed2d 100644 --- a/src/mesa/main/histogram.h +++ b/src/mesa/main/histogram.h @@ -1,4 +1,3 @@ -/* $Id: histogram.h,v 1.5 2003/03/25 02:26:29 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index b36c804e532..34bcf37d158 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1,4 +1,3 @@ -/* $Id: image.c,v 1.70 2003/03/01 01:50:21 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/image.h b/src/mesa/main/image.h index 4b5d7caba02..39260f0b4f1 100644 --- a/src/mesa/main/image.h +++ b/src/mesa/main/image.h @@ -1,4 +1,3 @@ -/* $Id: image.h,v 1.18 2002/03/13 04:34:32 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index e1513b88296..42180ad7273 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -1,4 +1,3 @@ -/* $Id: light.c,v 1.56 2003/05/30 21:37:19 idr Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/light.h b/src/mesa/main/light.h index 63c40f87975..557e4880209 100644 --- a/src/mesa/main/light.h +++ b/src/mesa/main/light.h @@ -1,4 +1,3 @@ -/* $Id: light.h,v 1.15 2002/10/25 21:06:30 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c index 821b17e0b55..8a5f59f5965 100644 --- a/src/mesa/main/lines.c +++ b/src/mesa/main/lines.c @@ -1,4 +1,3 @@ -/* $Id: lines.c,v 1.31 2003/03/01 01:50:21 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/lines.h b/src/mesa/main/lines.h index 08848ea7b14..ac4b33f4db6 100644 --- a/src/mesa/main/lines.h +++ b/src/mesa/main/lines.h @@ -1,4 +1,3 @@ -/* $Id: lines.h,v 1.5 2001/03/12 00:48:38 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index 63bd02bdff8..9f326a0093b 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -1,4 +1,3 @@ -/* $Id: macros.h,v 1.32 2003/03/04 16:33:54 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/matrix.h b/src/mesa/main/matrix.h index 59c0a6fad4f..13dc31eac49 100644 --- a/src/mesa/main/matrix.h +++ b/src/mesa/main/matrix.h @@ -1,4 +1,3 @@ -/* $Id: matrix.h,v 1.12 2001/03/12 00:48:38 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/nvfragparse.h b/src/mesa/main/nvfragparse.h index dd07be11ef9..16f96ceca2f 100644 --- a/src/mesa/main/nvfragparse.h +++ b/src/mesa/main/nvfragparse.h @@ -1,4 +1,3 @@ -/* $Id: nvfragparse.h,v 1.1 2003/01/14 04:55:46 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/nvfragprog.h b/src/mesa/main/nvfragprog.h index 5505582eb1e..491fcdda6c6 100644 --- a/src/mesa/main/nvfragprog.h +++ b/src/mesa/main/nvfragprog.h @@ -1,4 +1,3 @@ -/* $Id: nvfragprog.h,v 1.7 2003/05/10 04:36:11 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/nvvertprog.h b/src/mesa/main/nvvertprog.h index 017e31a7940..b96d1133eb6 100644 --- a/src/mesa/main/nvvertprog.h +++ b/src/mesa/main/nvvertprog.h @@ -1,4 +1,3 @@ -/* $Id: nvvertprog.h,v 1.2 2003/04/07 14:57:27 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index cec1982ca3d..db378226f8b 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -1,4 +1,3 @@ -/* $Id: pixel.c,v 1.38 2003/01/26 14:34:56 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/pixel.h b/src/mesa/main/pixel.h index 94f84e0fe0d..48138e08389 100644 --- a/src/mesa/main/pixel.h +++ b/src/mesa/main/pixel.h @@ -1,4 +1,3 @@ -/* $Id: pixel.h,v 1.10 2001/03/12 00:48:38 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index 9f9e3ad554a..272a47de1b0 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -1,4 +1,3 @@ -/* $Id: points.c,v 1.35 2003/03/01 01:50:22 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/points.h b/src/mesa/main/points.h index 02a542feb9a..da57fba7a7c 100644 --- a/src/mesa/main/points.h +++ b/src/mesa/main/points.h @@ -1,4 +1,3 @@ -/* $Id: points.h,v 1.7 2002/05/27 17:04:53 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c index a347b615df1..dd4f44ec363 100644 --- a/src/mesa/main/polygon.c +++ b/src/mesa/main/polygon.c @@ -1,4 +1,3 @@ -/* $Id: polygon.c,v 1.25 2002/10/24 23:57:21 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/polygon.h b/src/mesa/main/polygon.h index 58013369654..81b67ff5468 100644 --- a/src/mesa/main/polygon.h +++ b/src/mesa/main/polygon.h @@ -1,4 +1,3 @@ -/* $Id: polygon.h,v 1.4 2001/03/12 00:48:38 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/rastpos.h b/src/mesa/main/rastpos.h index 618057b9d6d..3d18cb91c5f 100644 --- a/src/mesa/main/rastpos.h +++ b/src/mesa/main/rastpos.h @@ -1,4 +1,3 @@ -/* $Id: rastpos.h,v 1.6 2002/05/27 17:03:09 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/simple_list.h b/src/mesa/main/simple_list.h index 3755e70f12d..2d9d4c8453c 100644 --- a/src/mesa/main/simple_list.h +++ b/src/mesa/main/simple_list.h @@ -1,4 +1,3 @@ -/* $Id: simple_list.h,v 1.2 2001/03/12 00:48:38 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/state.h b/src/mesa/main/state.h index 641c0c34132..8d3ccc16d5b 100644 --- a/src/mesa/main/state.h +++ b/src/mesa/main/state.h @@ -1,4 +1,3 @@ -/* $Id: state.h,v 1.8 2002/02/13 00:53:19 keithw Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c index 3bcdd2fe123..1b7c637c4c7 100644 --- a/src/mesa/main/stencil.c +++ b/src/mesa/main/stencil.c @@ -1,4 +1,3 @@ -/* $Id: stencil.c,v 1.30 2003/03/17 21:38:47 keithw Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/stencil.h b/src/mesa/main/stencil.h index 41b9a72464e..bb20884b85c 100644 --- a/src/mesa/main/stencil.h +++ b/src/mesa/main/stencil.h @@ -1,4 +1,3 @@ -/* $Id: stencil.h,v 1.10 2002/09/06 02:56:09 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h index c1377a819be..d0856142e32 100644 --- a/src/mesa/main/texcompress.h +++ b/src/mesa/main/texcompress.h @@ -1,4 +1,3 @@ -/* $Id: texcompress.h,v 1.2 2002/10/18 17:41:45 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 68d9845bbf3..3d5d256240d 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1,5 +1,3 @@ -/* $Id: texobj.c,v 1.68 2003/04/01 18:10:10 brianp Exp $ */ - /* * Mesa 3-D graphics library * Version: 5.1 diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h index ff46187809d..6311a50a717 100644 --- a/src/mesa/main/texobj.h +++ b/src/mesa/main/texobj.h @@ -1,4 +1,3 @@ -/* $Id: texobj.h,v 1.9 2003/04/01 16:41:55 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/texstate.h b/src/mesa/main/texstate.h index 343f289d82a..de4678665dd 100644 --- a/src/mesa/main/texstate.h +++ b/src/mesa/main/texstate.h @@ -1,4 +1,3 @@ -/* $Id: texstate.h,v 1.10 2002/12/05 04:51:57 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/texutil.c b/src/mesa/main/texutil.c index 26eda819bfb..19d3df1109b 100644 --- a/src/mesa/main/texutil.c +++ b/src/mesa/main/texutil.c @@ -1,4 +1,3 @@ -/* $Id: texutil.c,v 1.35 2003/03/01 01:50:22 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/texutil.h b/src/mesa/main/texutil.h index 2a91bf3a4c9..97e629cfb48 100644 --- a/src/mesa/main/texutil.h +++ b/src/mesa/main/texutil.h @@ -1,4 +1,3 @@ -/* $Id: texutil.h,v 1.11 2002/10/29 20:28:54 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/texutil_tmp.h b/src/mesa/main/texutil_tmp.h index ef177df9a83..2dd3ccee5ee 100644 --- a/src/mesa/main/texutil_tmp.h +++ b/src/mesa/main/texutil_tmp.h @@ -1,4 +1,3 @@ -/* $Id: texutil_tmp.h,v 1.13 2003/04/21 14:52:32 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h index 7515fc26623..168c17243a9 100644 --- a/src/mesa/main/varray.h +++ b/src/mesa/main/varray.h @@ -1,4 +1,3 @@ -/* $Id: varray.h,v 1.15 2003/05/01 22:44:03 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 62329bc30eb..d7b18e4c1cc 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -1,4 +1,3 @@ -/* $Id: vtxfmt.c,v 1.14 2002/10/29 20:28:56 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/vtxfmt.h b/src/mesa/main/vtxfmt.h index 82fca460ec9..6f6006bd229 100644 --- a/src/mesa/main/vtxfmt.h +++ b/src/mesa/main/vtxfmt.h @@ -1,4 +1,3 @@ -/* $Id: vtxfmt.h,v 1.5 2002/10/29 20:28:56 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/main/vtxfmt_tmp.h b/src/mesa/main/vtxfmt_tmp.h index d0f32deae93..0900d6e3fc9 100644 --- a/src/mesa/main/vtxfmt_tmp.h +++ b/src/mesa/main/vtxfmt_tmp.h @@ -1,4 +1,3 @@ -/* $Id: vtxfmt_tmp.h,v 1.11 2002/10/29 20:28:56 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_clip_tmp.h b/src/mesa/math/m_clip_tmp.h index 5a8bd0d0b84..6551798c318 100644 --- a/src/mesa/math/m_clip_tmp.h +++ b/src/mesa/math/m_clip_tmp.h @@ -1,4 +1,3 @@ -/* $Id: m_clip_tmp.h,v 1.9 2003/03/19 05:33:09 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_copy_tmp.h b/src/mesa/math/m_copy_tmp.h index ccde3f3c476..a9e33511ee2 100644 --- a/src/mesa/math/m_copy_tmp.h +++ b/src/mesa/math/m_copy_tmp.h @@ -1,4 +1,3 @@ -/* $Id: m_copy_tmp.h,v 1.6 2001/03/30 14:44:43 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_debug.h b/src/mesa/math/m_debug.h index 193e540aa28..6476b6de28c 100644 --- a/src/mesa/math/m_debug.h +++ b/src/mesa/math/m_debug.h @@ -1,4 +1,3 @@ -/* $Id: m_debug.h,v 1.5 2002/10/29 20:28:58 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_debug_clip.c b/src/mesa/math/m_debug_clip.c index aad7b662778..867850c6137 100644 --- a/src/mesa/math/m_debug_clip.c +++ b/src/mesa/math/m_debug_clip.c @@ -1,4 +1,3 @@ -/* $Id: m_debug_clip.c,v 1.6 2002/12/04 14:24:44 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_debug_norm.c b/src/mesa/math/m_debug_norm.c index 0786ad05ee8..4eac6f6dc69 100644 --- a/src/mesa/math/m_debug_norm.c +++ b/src/mesa/math/m_debug_norm.c @@ -1,4 +1,3 @@ -/* $Id: m_debug_norm.c,v 1.13 2003/03/01 01:50:24 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_debug_util.h b/src/mesa/math/m_debug_util.h index a9724fc5264..9b89c90e36a 100644 --- a/src/mesa/math/m_debug_util.h +++ b/src/mesa/math/m_debug_util.h @@ -1,4 +1,3 @@ -/* $Id: m_debug_util.h,v 1.6 2002/10/29 20:28:59 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_debug_xform.c b/src/mesa/math/m_debug_xform.c index 7879660fdff..ba2701e1798 100644 --- a/src/mesa/math/m_debug_xform.c +++ b/src/mesa/math/m_debug_xform.c @@ -1,4 +1,3 @@ -/* $Id: m_debug_xform.c,v 1.12 2003/02/25 19:27:07 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_dotprod_tmp.h b/src/mesa/math/m_dotprod_tmp.h index 9eead6c36ef..03e65af6c1a 100644 --- a/src/mesa/math/m_dotprod_tmp.h +++ b/src/mesa/math/m_dotprod_tmp.h @@ -1,4 +1,3 @@ -/* $Id: m_dotprod_tmp.h,v 1.6 2001/03/30 14:44:43 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_eval.c b/src/mesa/math/m_eval.c index dca09b029bd..42ffd4133d3 100644 --- a/src/mesa/math/m_eval.c +++ b/src/mesa/math/m_eval.c @@ -1,4 +1,3 @@ -/* $Id: m_eval.c,v 1.6 2001/09/18 23:06:14 kschultz Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_eval.h b/src/mesa/math/m_eval.h index 2553c96a678..a23cbd402e6 100644 --- a/src/mesa/math/m_eval.h +++ b/src/mesa/math/m_eval.h @@ -1,4 +1,3 @@ -/* $Id: m_eval.h,v 1.2 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c index 95a77e6a084..e204cc7bbc6 100644 --- a/src/mesa/math/m_matrix.c +++ b/src/mesa/math/m_matrix.c @@ -1,4 +1,3 @@ -/* $Id: m_matrix.c,v 1.16 2003/03/01 01:50:24 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_matrix.h b/src/mesa/math/m_matrix.h index 74eb610e81a..00bfcf8d166 100644 --- a/src/mesa/math/m_matrix.h +++ b/src/mesa/math/m_matrix.h @@ -1,4 +1,3 @@ -/* $Id: m_matrix.h,v 1.6 2003/02/25 19:27:06 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_norm_tmp.h b/src/mesa/math/m_norm_tmp.h index 5f24f5a2a27..2b7945586e3 100644 --- a/src/mesa/math/m_norm_tmp.h +++ b/src/mesa/math/m_norm_tmp.h @@ -1,4 +1,3 @@ -/* $Id: m_norm_tmp.h,v 1.14 2003/03/04 16:34:01 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_translate.h b/src/mesa/math/m_translate.h index f15bb77e2d3..c473f83d6fb 100644 --- a/src/mesa/math/m_translate.h +++ b/src/mesa/math/m_translate.h @@ -1,4 +1,3 @@ -/* $Id: m_translate.h,v 1.6 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_vector.c b/src/mesa/math/m_vector.c index 3e453e8e8d2..e01c87d67df 100644 --- a/src/mesa/math/m_vector.c +++ b/src/mesa/math/m_vector.c @@ -1,4 +1,3 @@ -/* $Id: m_vector.c,v 1.9 2002/12/04 14:24:44 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_vector.h b/src/mesa/math/m_vector.h index 222a49880bc..4b1b643ea7c 100644 --- a/src/mesa/math/m_vector.h +++ b/src/mesa/math/m_vector.h @@ -1,4 +1,3 @@ -/* $Id: m_vector.h,v 1.6 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_xform.c b/src/mesa/math/m_xform.c index a6813d29e9f..94d0f6d753b 100644 --- a/src/mesa/math/m_xform.c +++ b/src/mesa/math/m_xform.c @@ -1,4 +1,3 @@ -/* $Id: m_xform.c,v 1.19 2003/03/01 01:50:24 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_xform.h b/src/mesa/math/m_xform.h index 5d94b5151b4..badc29eaf5f 100644 --- a/src/mesa/math/m_xform.h +++ b/src/mesa/math/m_xform.h @@ -1,4 +1,3 @@ -/* $Id: m_xform.h,v 1.11 2002/01/05 20:51:12 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/m_xform_tmp.h b/src/mesa/math/m_xform_tmp.h index 96def930a1f..7cf4780bd39 100644 --- a/src/mesa/math/m_xform_tmp.h +++ b/src/mesa/math/m_xform_tmp.h @@ -1,4 +1,3 @@ -/* $Id: m_xform_tmp.h,v 1.7 2001/05/18 23:58:26 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/math/mathmod.h b/src/mesa/math/mathmod.h index 44bf2b97d5b..35f6671f2d1 100644 --- a/src/mesa/math/mathmod.h +++ b/src/mesa/math/mathmod.h @@ -1,4 +1,3 @@ -/* $Id: mathmod.h,v 1.3 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_aaline.h b/src/mesa/swrast/s_aaline.h index c470bfecbfa..41e7e5fd4d4 100644 --- a/src/mesa/swrast/s_aaline.h +++ b/src/mesa/swrast/s_aaline.h @@ -1,4 +1,3 @@ -/* $Id: s_aaline.h,v 1.3 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h index 13a825e7c00..66d127e2ddd 100644 --- a/src/mesa/swrast/s_aalinetemp.h +++ b/src/mesa/swrast/s_aalinetemp.h @@ -1,4 +1,3 @@ -/* $Id: s_aalinetemp.h,v 1.24 2003/03/25 02:23:44 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_aatriangle.h b/src/mesa/swrast/s_aatriangle.h index af723086d41..ebb828eb19f 100644 --- a/src/mesa/swrast/s_aatriangle.h +++ b/src/mesa/swrast/s_aatriangle.h @@ -1,4 +1,3 @@ -/* $Id: s_aatriangle.h,v 1.4 2003/03/25 02:23:44 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h index 0ffba71f3e3..ac7829ebfc6 100644 --- a/src/mesa/swrast/s_aatritemp.h +++ b/src/mesa/swrast/s_aatritemp.h @@ -1,4 +1,3 @@ -/* $Id: s_aatritemp.h,v 1.36 2003/03/25 02:23:44 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c index 0dfe93bb6bd..aa2d6b413bf 100644 --- a/src/mesa/swrast/s_accum.c +++ b/src/mesa/swrast/s_accum.c @@ -1,4 +1,3 @@ -/* $Id: s_accum.c,v 1.22 2003/03/25 02:23:44 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_accum.h b/src/mesa/swrast/s_accum.h index 62b11825d4e..eba85aa1ea8 100644 --- a/src/mesa/swrast/s_accum.h +++ b/src/mesa/swrast/s_accum.h @@ -1,4 +1,3 @@ -/* $Id: s_accum.h,v 1.5 2003/03/25 02:23:44 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_alpha.c b/src/mesa/swrast/s_alpha.c index 9ad3ea3b127..55c1e6a58f8 100644 --- a/src/mesa/swrast/s_alpha.c +++ b/src/mesa/swrast/s_alpha.c @@ -1,4 +1,3 @@ -/* $Id: s_alpha.c,v 1.14 2003/03/25 02:23:44 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_alpha.h b/src/mesa/swrast/s_alpha.h index cf69223b9ed..add0f74c453 100644 --- a/src/mesa/swrast/s_alpha.h +++ b/src/mesa/swrast/s_alpha.h @@ -1,4 +1,3 @@ -/* $Id: s_alpha.h,v 1.8 2003/03/25 02:23:44 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_alphabuf.c b/src/mesa/swrast/s_alphabuf.c index 31812769d5c..c74ab45a44c 100644 --- a/src/mesa/swrast/s_alphabuf.c +++ b/src/mesa/swrast/s_alphabuf.c @@ -1,4 +1,3 @@ -/* $Id: s_alphabuf.c,v 1.17 2003/03/25 02:23:45 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_alphabuf.h b/src/mesa/swrast/s_alphabuf.h index d74db0114b3..f09bb91adbe 100644 --- a/src/mesa/swrast/s_alphabuf.h +++ b/src/mesa/swrast/s_alphabuf.h @@ -1,4 +1,3 @@ -/* $Id: s_alphabuf.h,v 1.5 2003/03/25 02:23:45 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c index 2e98b5f21b7..d2b47cb3b96 100644 --- a/src/mesa/swrast/s_blend.c +++ b/src/mesa/swrast/s_blend.c @@ -1,4 +1,3 @@ -/* $Id: s_blend.c,v 1.26 2003/03/25 02:23:45 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_blend.h b/src/mesa/swrast/s_blend.h index 5afa604783e..11bf378e319 100644 --- a/src/mesa/swrast/s_blend.h +++ b/src/mesa/swrast/s_blend.h @@ -1,4 +1,3 @@ -/* $Id: s_blend.h,v 1.8 2003/03/25 02:23:45 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c index 1ee8030cd9d..22aee6c91d2 100644 --- a/src/mesa/swrast/s_buffers.c +++ b/src/mesa/swrast/s_buffers.c @@ -1,4 +1,3 @@ -/* $Id: s_buffers.c,v 1.17 2003/03/25 02:23:45 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_drawpix.h b/src/mesa/swrast/s_drawpix.h index 9c0d8e5529f..605a293daea 100644 --- a/src/mesa/swrast/s_drawpix.h +++ b/src/mesa/swrast/s_drawpix.h @@ -1,4 +1,3 @@ -/* $Id: s_drawpix.h,v 1.4 2003/03/25 02:23:46 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_feedback.c b/src/mesa/swrast/s_feedback.c index f0264ac7741..7afb3fa1ad1 100644 --- a/src/mesa/swrast/s_feedback.c +++ b/src/mesa/swrast/s_feedback.c @@ -1,4 +1,3 @@ -/* $Id: s_feedback.c,v 1.11 2003/03/25 02:23:46 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_feedback.h b/src/mesa/swrast/s_feedback.h index 5b86a94bf89..73f45c10be5 100644 --- a/src/mesa/swrast/s_feedback.h +++ b/src/mesa/swrast/s_feedback.h @@ -1,4 +1,3 @@ -/* $Id: s_feedback.h,v 1.6 2003/03/25 02:23:46 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c index 0b3ae5b060e..da06e3f3543 100644 --- a/src/mesa/swrast/s_fog.c +++ b/src/mesa/swrast/s_fog.c @@ -1,4 +1,3 @@ -/* $Id: s_fog.c,v 1.25 2003/03/25 02:23:46 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_fog.h b/src/mesa/swrast/s_fog.h index acc522d27fd..f5744b1d952 100644 --- a/src/mesa/swrast/s_fog.h +++ b/src/mesa/swrast/s_fog.h @@ -1,4 +1,3 @@ -/* $Id: s_fog.h,v 1.10 2003/03/25 02:23:46 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_imaging.c b/src/mesa/swrast/s_imaging.c index 1c432cc1b24..b9c413687b1 100644 --- a/src/mesa/swrast/s_imaging.c +++ b/src/mesa/swrast/s_imaging.c @@ -1,4 +1,3 @@ -/* $Id: s_imaging.c,v 1.7 2003/03/25 02:23:46 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_lines.h b/src/mesa/swrast/s_lines.h index 99a60d9b063..5372b99b915 100644 --- a/src/mesa/swrast/s_lines.h +++ b/src/mesa/swrast/s_lines.h @@ -1,4 +1,3 @@ -/* $Id: s_lines.h,v 1.5 2001/03/12 00:48:42 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h index 34bff2fdb11..1cb330dbdf5 100644 --- a/src/mesa/swrast/s_linetemp.h +++ b/src/mesa/swrast/s_linetemp.h @@ -1,4 +1,3 @@ -/* $Id: s_linetemp.h,v 1.18 2003/03/25 02:23:46 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_logic.c b/src/mesa/swrast/s_logic.c index c130387674b..ad27cb7b625 100644 --- a/src/mesa/swrast/s_logic.c +++ b/src/mesa/swrast/s_logic.c @@ -1,4 +1,3 @@ -/* $Id: s_logic.c,v 1.13 2003/03/25 02:23:47 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_logic.h b/src/mesa/swrast/s_logic.h index 824f2352f3f..19ec9c3246f 100644 --- a/src/mesa/swrast/s_logic.h +++ b/src/mesa/swrast/s_logic.h @@ -1,4 +1,3 @@ -/* $Id: s_logic.h,v 1.6 2003/03/25 02:23:47 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_masking.c b/src/mesa/swrast/s_masking.c index 2b761426df6..3badb86007e 100644 --- a/src/mesa/swrast/s_masking.c +++ b/src/mesa/swrast/s_masking.c @@ -1,4 +1,3 @@ -/* $Id: s_masking.c,v 1.9 2003/03/25 02:23:47 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_masking.h b/src/mesa/swrast/s_masking.h index f9f61e950fb..965e9f21809 100644 --- a/src/mesa/swrast/s_masking.h +++ b/src/mesa/swrast/s_masking.h @@ -1,4 +1,3 @@ -/* $Id: s_masking.h,v 1.6 2003/03/25 02:23:47 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_nvfragprog.h b/src/mesa/swrast/s_nvfragprog.h index 5aefdaeb3a7..749acbc0599 100644 --- a/src/mesa/swrast/s_nvfragprog.h +++ b/src/mesa/swrast/s_nvfragprog.h @@ -1,4 +1,3 @@ -/* $Id: s_nvfragprog.h,v 1.2 2003/02/23 04:10:54 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_pixeltex.c b/src/mesa/swrast/s_pixeltex.c index 1ddfae14b77..776a38c9153 100644 --- a/src/mesa/swrast/s_pixeltex.c +++ b/src/mesa/swrast/s_pixeltex.c @@ -1,4 +1,3 @@ -/* $Id: s_pixeltex.c,v 1.11 2002/10/24 23:57:24 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_pixeltex.h b/src/mesa/swrast/s_pixeltex.h index 73b09da7f5d..6ef7a44df1e 100644 --- a/src/mesa/swrast/s_pixeltex.h +++ b/src/mesa/swrast/s_pixeltex.h @@ -1,4 +1,3 @@ -/* $Id: s_pixeltex.h,v 1.5 2002/01/27 18:32:03 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_points.h b/src/mesa/swrast/s_points.h index 27047f45ba8..40b442e951f 100644 --- a/src/mesa/swrast/s_points.h +++ b/src/mesa/swrast/s_points.h @@ -1,4 +1,3 @@ -/* $Id: s_points.h,v 1.6 2002/02/02 21:40:33 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h index d0e2b54a039..eda6cfe576d 100644 --- a/src/mesa/swrast/s_pointtemp.h +++ b/src/mesa/swrast/s_pointtemp.h @@ -1,4 +1,3 @@ -/* $Id: s_pointtemp.h,v 1.23 2003/03/25 02:23:47 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index 11bb6265b6f..00aa43d07cc 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -1,4 +1,3 @@ -/* $Id: s_readpix.c,v 1.18 2003/03/25 02:23:47 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_span.h b/src/mesa/swrast/s_span.h index b4ec957db31..ee78a0e8e04 100644 --- a/src/mesa/swrast/s_span.h +++ b/src/mesa/swrast/s_span.h @@ -1,4 +1,3 @@ -/* $Id: s_span.h,v 1.19 2003/03/25 02:23:47 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_spantemp.h b/src/mesa/swrast/s_spantemp.h index ce01c987e48..3452b0b2842 100644 --- a/src/mesa/swrast/s_spantemp.h +++ b/src/mesa/swrast/s_spantemp.h @@ -1,4 +1,3 @@ -/* $Id: s_spantemp.h,v 1.2 2002/11/28 15:56:06 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index e6282c5af76..73bddc32fb8 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -1,4 +1,3 @@ -/* $Id: s_stencil.c,v 1.29 2003/03/25 02:23:47 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_stencil.h b/src/mesa/swrast/s_stencil.h index af95909a12e..655f1dc3cf8 100644 --- a/src/mesa/swrast/s_stencil.h +++ b/src/mesa/swrast/s_stencil.h @@ -1,4 +1,3 @@ -/* $Id: s_stencil.h,v 1.10 2003/03/25 02:23:48 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_texstore.c b/src/mesa/swrast/s_texstore.c index 7101328974b..edf75f61f5e 100644 --- a/src/mesa/swrast/s_texstore.c +++ b/src/mesa/swrast/s_texstore.c @@ -1,4 +1,3 @@ -/* $Id: s_texstore.c,v 1.11 2003/03/25 02:23:48 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_texture.h b/src/mesa/swrast/s_texture.h index ddb7b0dde82..b0c16083da1 100644 --- a/src/mesa/swrast/s_texture.h +++ b/src/mesa/swrast/s_texture.h @@ -1,4 +1,3 @@ -/* $Id: s_texture.h,v 1.15 2003/02/23 04:10:54 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_triangle.h b/src/mesa/swrast/s_triangle.h index 09b47852e66..0de812500c5 100644 --- a/src/mesa/swrast/s_triangle.h +++ b/src/mesa/swrast/s_triangle.h @@ -1,4 +1,3 @@ -/* $Id: s_triangle.h,v 1.8 2003/03/25 02:23:48 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_trispan.h b/src/mesa/swrast/s_trispan.h index ebd5188d39e..15207e863e3 100644 --- a/src/mesa/swrast/s_trispan.h +++ b/src/mesa/swrast/s_trispan.h @@ -1,4 +1,3 @@ -/* $Id: s_trispan.h,v 1.4 2001/12/17 04:54:35 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h index bb6f822cbcf..97060285e5d 100644 --- a/src/mesa/swrast/s_tritemp.h +++ b/src/mesa/swrast/s_tritemp.h @@ -1,5 +1,3 @@ -/* $Id: s_tritemp.h,v 1.49 2003/04/08 02:27:18 brianp Exp $ */ - /* * Mesa 3-D graphics library * Version: 5.1 @@ -23,7 +21,6 @@ * 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. */ -/* $XFree86: xc/extras/Mesa/src/swrast/s_tritemp.h,v 1.2 2002/02/27 21:07:54 tsi Exp $ */ /* * Triangle Rasterizer Template diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index 6cc9be587c4..c53bc93fab4 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -1,4 +1,3 @@ -/* $Id: s_zoom.c,v 1.24 2003/03/25 02:23:48 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/s_zoom.h b/src/mesa/swrast/s_zoom.h index 75cb404f886..e410e9d2618 100644 --- a/src/mesa/swrast/s_zoom.h +++ b/src/mesa/swrast/s_zoom.h @@ -1,4 +1,3 @@ -/* $Id: s_zoom.h,v 1.9 2003/03/25 02:23:48 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h index 3f33dbb355e..011c71ae4b8 100644 --- a/src/mesa/swrast/swrast.h +++ b/src/mesa/swrast/swrast.h @@ -1,4 +1,3 @@ -/* $Id: swrast.h,v 1.35 2003/02/23 04:10:54 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index 398a8df7c39..c000e41943b 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -1,4 +1,3 @@ -/* $Id: ss_context.c,v 1.20 2002/10/29 20:29:00 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast_setup/ss_context.h b/src/mesa/swrast_setup/ss_context.h index 059df6c0c30..84813e98eb0 100644 --- a/src/mesa/swrast_setup/ss_context.h +++ b/src/mesa/swrast_setup/ss_context.h @@ -1,4 +1,3 @@ -/* $Id: ss_context.h,v 1.12 2002/10/29 20:29:00 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast_setup/ss_triangle.c b/src/mesa/swrast_setup/ss_triangle.c index d2f140f7ff8..b041c32ef5c 100644 --- a/src/mesa/swrast_setup/ss_triangle.c +++ b/src/mesa/swrast_setup/ss_triangle.c @@ -1,4 +1,3 @@ -/* $Id: ss_triangle.c,v 1.20 2002/10/29 22:25:57 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast_setup/ss_triangle.h b/src/mesa/swrast_setup/ss_triangle.h index 8f7b57d7cbd..78833269e6e 100644 --- a/src/mesa/swrast_setup/ss_triangle.h +++ b/src/mesa/swrast_setup/ss_triangle.h @@ -1,4 +1,3 @@ -/* $Id: ss_triangle.h,v 1.4 2002/10/29 20:29:00 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast_setup/ss_tritmp.h b/src/mesa/swrast_setup/ss_tritmp.h index d3d4572bf94..77219fc6076 100644 --- a/src/mesa/swrast_setup/ss_tritmp.h +++ b/src/mesa/swrast_setup/ss_tritmp.h @@ -1,4 +1,3 @@ -/* $Id: ss_tritmp.h,v 1.20 2002/11/13 15:04:29 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast_setup/ss_vb.h b/src/mesa/swrast_setup/ss_vb.h index 63fc5148f2a..6ea0cb1a704 100644 --- a/src/mesa/swrast_setup/ss_vb.h +++ b/src/mesa/swrast_setup/ss_vb.h @@ -1,4 +1,3 @@ -/* $Id: ss_vb.h,v 1.4 2002/10/29 20:29:01 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast_setup/ss_vbtmp.h b/src/mesa/swrast_setup/ss_vbtmp.h index 723e3d1c8de..00290c30c36 100644 --- a/src/mesa/swrast_setup/ss_vbtmp.h +++ b/src/mesa/swrast_setup/ss_vbtmp.h @@ -1,4 +1,3 @@ -/* $Id: ss_vbtmp.h,v 1.24 2003/02/04 14:40:02 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/swrast_setup/swrast_setup.h b/src/mesa/swrast_setup/swrast_setup.h index acf8fa5d220..4825c772f11 100644 --- a/src/mesa/swrast_setup/swrast_setup.h +++ b/src/mesa/swrast_setup/swrast_setup.h @@ -1,4 +1,3 @@ -/* $Id: swrast_setup.h,v 1.10 2002/10/29 20:29:01 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_array_api.h b/src/mesa/tnl/t_array_api.h index 32a70443f56..c26112bef5c 100644 --- a/src/mesa/tnl/t_array_api.h +++ b/src/mesa/tnl/t_array_api.h @@ -1,4 +1,3 @@ -/* $Id: t_array_api.h,v 1.2 2001/03/12 00:48:43 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_array_import.c b/src/mesa/tnl/t_array_import.c index fbcb9b33100..1bdf1c64e51 100644 --- a/src/mesa/tnl/t_array_import.c +++ b/src/mesa/tnl/t_array_import.c @@ -1,4 +1,3 @@ -/* $Id: t_array_import.c,v 1.29 2003/04/08 02:27:19 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_array_import.h b/src/mesa/tnl/t_array_import.h index 497ee00dae6..7bc248f7160 100644 --- a/src/mesa/tnl/t_array_import.h +++ b/src/mesa/tnl/t_array_import.h @@ -1,4 +1,3 @@ -/* $Id: t_array_import.h,v 1.4 2001/08/13 22:15:54 keithw Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c index 0b5e575ceaf..67558733f06 100644 --- a/src/mesa/tnl/t_context.c +++ b/src/mesa/tnl/t_context.c @@ -1,4 +1,3 @@ -/* $Id: t_context.c,v 1.32 2003/04/08 02:27:20 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_eval_api.c b/src/mesa/tnl/t_eval_api.c index 1824fc3fa9e..08eb9d35629 100644 --- a/src/mesa/tnl/t_eval_api.c +++ b/src/mesa/tnl/t_eval_api.c @@ -1,4 +1,3 @@ -/* $Id: t_eval_api.c,v 1.13 2003/03/01 01:50:26 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_eval_api.h b/src/mesa/tnl/t_eval_api.h index 49a463b8f71..0ac6c0b147b 100644 --- a/src/mesa/tnl/t_eval_api.h +++ b/src/mesa/tnl/t_eval_api.h @@ -1,4 +1,3 @@ -/* $Id: t_eval_api.h,v 1.2 2001/03/12 00:48:43 gareth Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_imm_alloc.c b/src/mesa/tnl/t_imm_alloc.c index 48a657028b5..8ffb182fd1a 100644 --- a/src/mesa/tnl/t_imm_alloc.c +++ b/src/mesa/tnl/t_imm_alloc.c @@ -1,4 +1,3 @@ -/* $Id: t_imm_alloc.c,v 1.20 2003/03/31 18:19:56 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_imm_alloc.h b/src/mesa/tnl/t_imm_alloc.h index 862daf224db..502be3fe9b1 100644 --- a/src/mesa/tnl/t_imm_alloc.h +++ b/src/mesa/tnl/t_imm_alloc.h @@ -1,4 +1,3 @@ -/* $Id: t_imm_alloc.h,v 1.3 2002/04/19 12:32:14 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_imm_api.h b/src/mesa/tnl/t_imm_api.h index 6615a9ce93a..1cb89fd4d1a 100644 --- a/src/mesa/tnl/t_imm_api.h +++ b/src/mesa/tnl/t_imm_api.h @@ -1,4 +1,3 @@ -/* $Id: t_imm_api.h,v 1.5 2002/04/09 16:56:52 keithw Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_imm_debug.c b/src/mesa/tnl/t_imm_debug.c index c87d97cd9b4..856eaa75f7a 100644 --- a/src/mesa/tnl/t_imm_debug.c +++ b/src/mesa/tnl/t_imm_debug.c @@ -1,4 +1,3 @@ -/* $Id: t_imm_debug.c,v 1.10 2003/01/14 04:55:47 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_imm_debug.h b/src/mesa/tnl/t_imm_debug.h index 22c7650fc5f..91eea934798 100644 --- a/src/mesa/tnl/t_imm_debug.h +++ b/src/mesa/tnl/t_imm_debug.h @@ -1,4 +1,3 @@ -/* $Id: t_imm_debug.h,v 1.3 2002/10/29 20:29:02 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_imm_dlist.h b/src/mesa/tnl/t_imm_dlist.h index 187074db051..e12d4c05326 100644 --- a/src/mesa/tnl/t_imm_dlist.h +++ b/src/mesa/tnl/t_imm_dlist.h @@ -1,4 +1,3 @@ -/* $Id: t_imm_dlist.h,v 1.4 2002/10/29 20:29:02 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_imm_elt.h b/src/mesa/tnl/t_imm_elt.h index 4b781f2f0c3..811cb17c35c 100644 --- a/src/mesa/tnl/t_imm_elt.h +++ b/src/mesa/tnl/t_imm_elt.h @@ -1,4 +1,3 @@ -/* $Id: t_imm_elt.h,v 1.3 2002/10/29 20:29:02 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_imm_eval.c b/src/mesa/tnl/t_imm_eval.c index 3b92d2a1740..ee906fc3069 100644 --- a/src/mesa/tnl/t_imm_eval.c +++ b/src/mesa/tnl/t_imm_eval.c @@ -1,4 +1,3 @@ -/* $Id: t_imm_eval.c,v 1.29 2003/03/31 18:19:57 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_imm_eval.h b/src/mesa/tnl/t_imm_eval.h index 341da514810..58e8a38af50 100644 --- a/src/mesa/tnl/t_imm_eval.h +++ b/src/mesa/tnl/t_imm_eval.h @@ -1,4 +1,3 @@ -/* $Id: t_imm_eval.h,v 1.3 2001/04/30 21:08:52 keithw Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_pipeline.c b/src/mesa/tnl/t_pipeline.c index 5ac7539d656..c187cf56a10 100644 --- a/src/mesa/tnl/t_pipeline.c +++ b/src/mesa/tnl/t_pipeline.c @@ -1,4 +1,3 @@ -/* $Id: t_pipeline.c,v 1.26 2003/03/01 01:50:27 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_pipeline.h b/src/mesa/tnl/t_pipeline.h index 179c536b360..9ccdb799890 100644 --- a/src/mesa/tnl/t_pipeline.h +++ b/src/mesa/tnl/t_pipeline.h @@ -1,4 +1,3 @@ -/* $Id: t_pipeline.h,v 1.10 2002/10/29 20:29:03 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_vb_cliptmp.h b/src/mesa/tnl/t_vb_cliptmp.h index 5f22012f9d1..ab180facf74 100644 --- a/src/mesa/tnl/t_vb_cliptmp.h +++ b/src/mesa/tnl/t_vb_cliptmp.h @@ -1,4 +1,3 @@ -/* $Id: t_vb_cliptmp.h,v 1.17 2003/03/01 01:50:27 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c index dedd4c53029..8968dfb4dfb 100644 --- a/src/mesa/tnl/t_vb_fog.c +++ b/src/mesa/tnl/t_vb_fog.c @@ -1,4 +1,3 @@ -/* $Id: t_vb_fog.c,v 1.20 2003/03/01 01:50:27 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index cdaf0379edc..86755486343 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -1,4 +1,3 @@ -/* $Id: t_vb_light.c,v 1.20 2003/03/01 01:50:27 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_vb_lighttmp.h b/src/mesa/tnl/t_vb_lighttmp.h index 90d7652063d..c0ef45ccef9 100644 --- a/src/mesa/tnl/t_vb_lighttmp.h +++ b/src/mesa/tnl/t_vb_lighttmp.h @@ -1,4 +1,3 @@ -/* $Id: t_vb_lighttmp.h,v 1.26 2002/10/29 20:29:03 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_vb_normals.c b/src/mesa/tnl/t_vb_normals.c index 1fbff7e9e46..4cf4bb65c78 100644 --- a/src/mesa/tnl/t_vb_normals.c +++ b/src/mesa/tnl/t_vb_normals.c @@ -1,4 +1,3 @@ -/* $Id: t_vb_normals.c,v 1.18 2003/03/01 01:50:27 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_vb_points.c b/src/mesa/tnl/t_vb_points.c index a631bad39dc..06f2c8c1408 100644 --- a/src/mesa/tnl/t_vb_points.c +++ b/src/mesa/tnl/t_vb_points.c @@ -1,4 +1,3 @@ -/* $Id: t_vb_points.c,v 1.11 2003/03/01 01:50:27 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_vb_render.c b/src/mesa/tnl/t_vb_render.c index bbfa1ae704f..28dd1412167 100644 --- a/src/mesa/tnl/t_vb_render.c +++ b/src/mesa/tnl/t_vb_render.c @@ -1,4 +1,3 @@ -/* $Id: t_vb_render.c,v 1.35 2003/04/08 02:27:20 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_vb_rendertmp.h b/src/mesa/tnl/t_vb_rendertmp.h index 192a83f7ba0..7bc0e37facc 100644 --- a/src/mesa/tnl/t_vb_rendertmp.h +++ b/src/mesa/tnl/t_vb_rendertmp.h @@ -1,4 +1,3 @@ -/* $Id: t_vb_rendertmp.h,v 1.10 2002/10/29 20:29:04 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/t_vb_vertex.c b/src/mesa/tnl/t_vb_vertex.c index 56aee97796d..25453933a12 100644 --- a/src/mesa/tnl/t_vb_vertex.c +++ b/src/mesa/tnl/t_vb_vertex.c @@ -1,4 +1,3 @@ -/* $Id: t_vb_vertex.c,v 1.18 2003/03/01 01:50:28 brianp Exp $ */ /* * Mesa 3-D graphics library diff --git a/src/mesa/tnl/tnl.h b/src/mesa/tnl/tnl.h index 1fe7b451cc4..349a8c7d605 100644 --- a/src/mesa/tnl/tnl.h +++ b/src/mesa/tnl/tnl.h @@ -1,4 +1,3 @@ -/* $Id: tnl.h,v 1.10 2002/10/29 20:29:04 brianp Exp $ */ /* * Mesa 3-D graphics library -- cgit v1.2.3 From b17a722ca3989e8563ee04cb2939f4835f8a171e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 13 Jun 2003 02:37:27 +0000 Subject: Implemented GL_ARB_occlusion_query (not 100% finalized). --- docs/RELNOTES-5.1 | 3 + docs/VERSIONS | 1 + include/GL/gl.h | 33 +++++ src/mesa/Makefile.X11 | 1 + src/mesa/glapi/APIspec | 63 ++++++++- src/mesa/glapi/glapioffsets.h | 8 ++ src/mesa/glapi/glapitable.h | 8 ++ src/mesa/glapi/glapitemp.h | 48 +++++++ src/mesa/glapi/glprocs.h | 8 ++ src/mesa/main/config.h | 1 + src/mesa/main/context.c | 4 + src/mesa/main/extensions.c | 4 + src/mesa/main/mtypes.h | 15 ++ src/mesa/main/occlude.c | 314 ++++++++++++++++++++++++++++++++++++++++++ src/mesa/main/occlude.h | 55 ++++++++ src/mesa/main/state.c | 14 ++ src/mesa/sparc/glapi_sparc.S | 168 ++++++++++++++++++++++ src/mesa/swrast/s_context.c | 2 +- src/mesa/swrast/s_span.c | 24 ++++ src/mesa/swrast/s_triangle.c | 14 +- src/mesa/x86/glapi_x86.S | 48 +++++++ 21 files changed, 829 insertions(+), 7 deletions(-) create mode 100644 src/mesa/main/occlude.c create mode 100644 src/mesa/main/occlude.h (limited to 'include') diff --git a/docs/RELNOTES-5.1 b/docs/RELNOTES-5.1 index 0a38006752f..d0619916cc6 100644 --- a/docs/RELNOTES-5.1 +++ b/docs/RELNOTES-5.1 @@ -60,6 +60,9 @@ GL_NV_light_max_exponent GL_EXT_texture_rectangle Identical to GL_NV_texture_rectangle +GL_ARB_occlusion_query + Useful for visibility-based culling. + Build System Changes diff --git a/docs/VERSIONS b/docs/VERSIONS index 0a35cb518ff..7d48f3f3253 100644 --- a/docs/VERSIONS +++ b/docs/VERSIONS @@ -1126,6 +1126,7 @@ Mesa Version History - GL_NV_fragment_program extension - GL_NV_light_max_exponent - GL_EXT_texture_rectangle (identical to GL_NV_texture_rectangle) + - GL_ARB_occlusion_query - new X86 feature detection code (Petr Sebor) - less memory used for display lists and vertex buffers - demo of per-pixel lighting with a fragment program (demos/fplight.c) diff --git a/include/GL/gl.h b/include/GL/gl.h index f7456ef99a0..260b59ac386 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2640,6 +2640,39 @@ typedef void (APIENTRY * PFNGLDEPTHBOUNDSEXTPROC)(GLclampd zmin, GLclampd zmax); +/* XXX temporary until glext.h is updated! */ +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 + +#define GL_SAMPLES_PASSED_ARB 0x8914 +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 + +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void GLAPIENTRY glGenQueriesARB(GLsizei n, GLuint *ids); +GLAPI void GLAPIENTRY glDeleteQueriesARB(GLsizei n, const GLuint *ids); +GLAPI GLboolean GLAPIENTRY glIsQueryARB(GLuint id); +GLAPI void GLAPIENTRY glBeginQueryARB(GLenum target, GLuint id); +GLAPI void GLAPIENTRY glEndQueryARB(GLenum target); +GLAPI void GLAPIENTRY glGetQueryivARB(GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetQueryObjectivARB(GLuint id, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params); +#endif + +typedef void (APIENTRY * PFNGLGENQUERIESARBPROC)(GLsizei n, GLuint *ids); +typedef void (APIENTRY * PFNGLDELETEQUERIESARBPROC)(GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRY * PFNGLISQUERYARBPROC)(GLuint id); +typedef void (APIENTRY * PFNGLBEGINQUERYARBPROC)(GLenum target, GLuint id); +typedef void (APIENTRY * PFNGLENDQUERYARBPROC)(GLenum target); +typedef void (APIENTRY * PFNGLGETQUERYIVARBPROC)(GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETQUERYOBJECTIVARBPROC)(GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC)(GLuint id, GLenum pname, GLuint *params); + +#endif /* GL_ARB_occlusion_query */ + + /********************************************************************** * Begin system-specific stuff */ diff --git a/src/mesa/Makefile.X11 b/src/mesa/Makefile.X11 index ae9f89cc8c7..30ab3bd4b8f 100644 --- a/src/mesa/Makefile.X11 +++ b/src/mesa/Makefile.X11 @@ -58,6 +58,7 @@ MAIN_SOURCES = \ main/nvfragparse.c \ main/nvvertexec.c \ main/nvvertparse.c \ + main/occlude.c \ main/pixel.c \ main/points.c \ main/polygon.c \ diff --git a/src/mesa/glapi/APIspec b/src/mesa/glapi/APIspec index 5075eaf0359..eba696346c5 100644 --- a/src/mesa/glapi/APIspec +++ b/src/mesa/glapi/APIspec @@ -1,4 +1,4 @@ -# $Id: APIspec,v 1.17 2003/05/10 04:35:36 brianp Exp $ +# $Id: APIspec,v 1.18 2003/06/13 02:37:28 brianp Exp $ # This file describes all the OpenGL functions. # We use a number of Python scripts to parse this file and @@ -8346,6 +8346,67 @@ offset 699 +# GL_ARB_occlusion_query + +name GenQueriesARB +return void +param n GLsizei +param ids GLuint * +category GL_ARB_occlusion_query +offset 700 + +name DeleteQueriesARB +return void +param n GLsizei +param ids const GLuint * +category GL_ARB_occlusion_query +offset 701 + +name IsQueryARB +return GLboolean +param id GLuint +category GL_ARB_occlusion_query +offset 702 + +name BeginQueryARB +return void +param target GLenum +param id GLuint +category GL_ARB_occlusion_query +offset 703 + +name EndQueryARB +return void +param target GLenum +category GL_ARB_occlusion_query +offset 704 + +name GetQueryivARB +return void +param target GLenum +param pname GLenum +param params GLint * +category GL_ARB_occlusion_query +offset 705 + +name GetQueryObjectivARB +return void +param id GLuint +param pname GLenum +param params GLint * +category GL_ARB_occlusion_query +offset 706 + +name GetQueryObjectuivARB +return void +param id GLuint +param pname GLenum +param params GLuint * +category GL_ARB_occlusion_query +offset 707 + + + # end of file sentinal name dummy diff --git a/src/mesa/glapi/glapioffsets.h b/src/mesa/glapi/glapioffsets.h index ccc05daee18..0dc699f5c22 100644 --- a/src/mesa/glapi/glapioffsets.h +++ b/src/mesa/glapi/glapioffsets.h @@ -702,5 +702,13 @@ #define _gloffset_MapBufferARB 697 #define _gloffset_UnmapBufferARB 698 #define _gloffset_DepthBoundsEXT 699 +#define _gloffset_GenQueriesARB 700 +#define _gloffset_DeleteQueriesARB 701 +#define _gloffset_IsQueryARB 702 +#define _gloffset_BeginQueryARB 703 +#define _gloffset_EndQueryARB 704 +#define _gloffset_GetQueryivARB 705 +#define _gloffset_GetQueryObjectivARB 706 +#define _gloffset_GetQueryObjectuivARB 707 #endif diff --git a/src/mesa/glapi/glapitable.h b/src/mesa/glapi/glapitable.h index 2bb31e2e0db..42f8408480a 100644 --- a/src/mesa/glapi/glapitable.h +++ b/src/mesa/glapi/glapitable.h @@ -706,6 +706,14 @@ struct _glapi_table void * (*MapBufferARB)(GLenum target, GLenum access); /* 697 */ GLboolean (*UnmapBufferARB)(GLenum target); /* 698 */ void (*DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 699 */ + void (*GenQueriesARB)(GLsizei n, GLuint * ids); /* 700 */ + void (*DeleteQueriesARB)(GLsizei n, const GLuint * ids); /* 701 */ + GLboolean (*IsQueryARB)(GLuint id); /* 702 */ + void (*BeginQueryARB)(GLenum target, GLuint id); /* 703 */ + void (*EndQueryARB)(GLenum target); /* 704 */ + void (*GetQueryivARB)(GLenum target, GLenum pname, GLint * params); /* 705 */ + void (*GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params); /* 706 */ + void (*GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params); /* 707 */ }; #endif diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index 707333043dc..4d373933d4a 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -4624,6 +4624,46 @@ KEYWORD1 void KEYWORD2 NAME(DepthBoundsEXT)(GLclampd zmin, GLclampd zmax) DISPATCH(DepthBoundsEXT, (zmin, zmax), (F, "glDepthBoundsEXT(%f, %f);\n", zmin, zmax)); } +KEYWORD1 void KEYWORD2 NAME(GenQueriesARB)(GLsizei n, GLuint * ids) +{ + DISPATCH(GenQueriesARB, (n, ids), (F, "glGenQueriesARB(%d, %p);\n", n, (const void *) ids)); +} + +KEYWORD1 void KEYWORD2 NAME(DeleteQueriesARB)(GLsizei n, const GLuint * ids) +{ + DISPATCH(DeleteQueriesARB, (n, ids), (F, "glDeleteQueriesARB(%d, %p);\n", n, (const void *) ids)); +} + +KEYWORD1 GLboolean KEYWORD2 NAME(IsQueryARB)(GLuint id) +{ + RETURN_DISPATCH(IsQueryARB, (id), (F, "glIsQueryARB(%d);\n", id)); +} + +KEYWORD1 void KEYWORD2 NAME(BeginQueryARB)(GLenum target, GLuint id) +{ + DISPATCH(BeginQueryARB, (target, id), (F, "glBeginQueryARB(0x%x, %d);\n", target, id)); +} + +KEYWORD1 void KEYWORD2 NAME(EndQueryARB)(GLenum target) +{ + DISPATCH(EndQueryARB, (target), (F, "glEndQueryARB(0x%x);\n", target)); +} + +KEYWORD1 void KEYWORD2 NAME(GetQueryivARB)(GLenum target, GLenum pname, GLint * params) +{ + DISPATCH(GetQueryivARB, (target, pname, params), (F, "glGetQueryivARB(0x%x, 0x%x, %p);\n", target, pname, (const void *) params)); +} + +KEYWORD1 void KEYWORD2 NAME(GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params) +{ + DISPATCH(GetQueryObjectivARB, (id, pname, params), (F, "glGetQueryObjectivARB(%d, 0x%x, %p);\n", id, pname, (const void *) params)); +} + +KEYWORD1 void KEYWORD2 NAME(GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params) +{ + DISPATCH(GetQueryObjectuivARB, (id, pname, params), (F, "glGetQueryObjectuivARB(%d, 0x%x, %p);\n", id, pname, (const void *) params)); +} + /* @@ -5337,6 +5377,14 @@ void *DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(MapBufferARB), TABLE_ENTRY(UnmapBufferARB), TABLE_ENTRY(DepthBoundsEXT), + TABLE_ENTRY(GenQueriesARB), + TABLE_ENTRY(DeleteQueriesARB), + TABLE_ENTRY(IsQueryARB), + TABLE_ENTRY(BeginQueryARB), + TABLE_ENTRY(EndQueryARB), + TABLE_ENTRY(GetQueryivARB), + TABLE_ENTRY(GetQueryObjectivARB), + TABLE_ENTRY(GetQueryObjectuivARB), /* A whole bunch of no-op functions. These might be called * when someone tries to call a dynamically-registered * extension function without a current rendering context. diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h index ea18fdfc69f..70bac5623b5 100644 --- a/src/mesa/glapi/glprocs.h +++ b/src/mesa/glapi/glprocs.h @@ -890,5 +890,13 @@ static struct name_address_offset static_functions[] = { { "glMapBufferARB", (GLvoid *) glMapBufferARB, _gloffset_MapBufferARB }, { "glUnmapBufferARB", (GLvoid *) glUnmapBufferARB, _gloffset_UnmapBufferARB }, { "glDepthBoundsEXT", (GLvoid *) glDepthBoundsEXT, _gloffset_DepthBoundsEXT }, + { "glGenQueriesARB", (GLvoid *) glGenQueriesARB, _gloffset_GenQueriesARB }, + { "glDeleteQueriesARB", (GLvoid *) glDeleteQueriesARB, _gloffset_DeleteQueriesARB }, + { "glIsQueryARB", (GLvoid *) glIsQueryARB, _gloffset_IsQueryARB }, + { "glBeginQueryARB", (GLvoid *) glBeginQueryARB, _gloffset_BeginQueryARB }, + { "glEndQueryARB", (GLvoid *) glEndQueryARB, _gloffset_EndQueryARB }, + { "glGetQueryivARB", (GLvoid *) glGetQueryivARB, _gloffset_GetQueryivARB }, + { "glGetQueryObjectivARB", (GLvoid *) glGetQueryObjectivARB, _gloffset_GetQueryObjectivARB }, + { "glGetQueryObjectuivARB", (GLvoid *) glGetQueryObjectuivARB, _gloffset_GetQueryObjectuivARB }, { NULL, NULL } /* end of list marker */ }; diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index f35f100205d..4b4b3ef10ae 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -243,5 +243,6 @@ #define FEATURE_ARB_fragment_program 1 +#define FEATURE_ARB_occlusion_query 1 #endif /* CONFIG_H */ diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index ae030bce849..666e3403a27 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1562,6 +1562,10 @@ init_attrib_groups( GLcontext *ctx ) ctx->FragmentProgram.Current->Base.RefCount++; #endif +#if FEATURE_ARB_occlusion_query + ctx->Occlusion.QueryObjects = _mesa_NewHashTable(); +#endif + /* Miscellaneous */ ctx->NewState = _NEW_ALL; ctx->RenderMode = GL_RENDER; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 50769fed31e..3b7c21a1622 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -54,6 +54,7 @@ static const struct { { OFF, "GL_ARB_imaging", F(ARB_imaging) }, { OFF, "GL_ARB_multisample", F(ARB_multisample) }, { OFF, "GL_ARB_multitexture", F(ARB_multitexture) }, + { OFF, "GL_ARB_occlusion_query", F(ARB_occlusion_query) }, { OFF, "GL_ARB_point_parameters", F(EXT_point_parameters) }, { OFF, "GL_ARB_shadow", F(ARB_shadow) }, { OFF, "GL_ARB_shadow_ambient", F(SGIX_shadow_ambient) }, @@ -163,6 +164,9 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #endif "GL_ARB_imaging", "GL_ARB_multitexture", +#if FEATURE_ARB_occlusion_query + "GL_ARB_occlusion_query", +#endif "GL_ARB_point_parameters", "GL_ARB_shadow", "GL_ARB_shadow_ambient", diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index dd660fa3abd..59a75da8c88 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1314,6 +1314,18 @@ struct fragment_program_state }; +/* + * State for GL_ARB_occlusion_query + */ +struct occlusion_state +{ + GLboolean Active; + GLuint CurrentQueryObject; + GLuint PassedCounter; + struct _mesa_HashTable *QueryObjects; +}; + + /* * State which can be shared by multiple contexts: */ @@ -1449,6 +1461,7 @@ struct gl_extensions { GLboolean ARB_imaging; GLboolean ARB_multisample; GLboolean ARB_multitexture; + GLboolean ARB_occlusion_query; GLboolean ARB_shadow; GLboolean ARB_texture_border_clamp; GLboolean ARB_texture_compression; @@ -1827,6 +1840,8 @@ struct __GLcontextRec { struct vertex_program_state VertexProgram; /* GL_NV_vertex_program */ struct fragment_program_state FragmentProgram; /* GL_NV_fragment_program */ + struct occlusion_state Occlusion; /* GL_ARB_occlusion_query */ + GLenum ErrorValue; /* Last error code */ GLenum RenderMode; /* either GL_RENDER, GL_SELECT, GL_FEEDBACK */ GLuint NewState; /* bitwise-or of _NEW_* flags */ diff --git a/src/mesa/main/occlude.c b/src/mesa/main/occlude.c new file mode 100644 index 00000000000..029e5d08946 --- /dev/null +++ b/src/mesa/main/occlude.c @@ -0,0 +1,314 @@ +/* + * Mesa 3-D graphics library + * Version: 5.1 + * + * Copyright (C) 1999-2003 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. + */ + + +/* + * \brief Functions to implement the GL_ARB_occlusion_query extension. + */ + + +#include "glheader.h" +#include "context.h" +#include "hash.h" +#include "imports.h" +#include "occlude.h" +#include "mtypes.h" + +#ifndef GL_SAMPLES_PASSED_ARB +#define GL_SAMPLES_PASSED_ARB 0x8914 +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#endif + + +struct occlusion_query +{ + GLenum Target; + GLuint Id; + GLuint PassedCounter; + GLboolean Active; +}; + + +/** + * Allocate a new occlusion query object. + * \param target - must be GL_SAMPLES_PASSED_ARB at this time + * \param id - the object's ID + * \return pointer to new occlusion_query object or NULL if out of memory. + */ +static struct occlusion_query * +new_query_object(GLenum target, GLuint id) +{ + struct occlusion_query *q = MALLOC_STRUCT(occlusion_query); + if (q) { + q->Target = target; + q->Id = id; + q->PassedCounter = 0; + q->Active = GL_FALSE; + } + return q; +} + + +/** + * Delete an occlusion query object. + */ +static void +delete_query_object(struct occlusion_query *q) +{ + FREE(q); +} + + +void +_mesa_GenQueriesARB(GLsizei n, GLuint *ids) +{ + GET_CURRENT_CONTEXT(ctx); + GLuint first; + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (n < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glGenQueriesARB(n < 0)"); + return; + } + + if (ctx->Occlusion.Active) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGenQueriesARB"); + return; + } + + first = _mesa_HashFindFreeKeyBlock(ctx->Occlusion.QueryObjects, n); + if (first) { + GLuint i; + for (i = 0; i < n; i++) { + struct occlusion_query *q = new_query_object(GL_SAMPLES_PASSED_ARB, + first + i); + if (!q) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenQueriesARB"); + return; + } + ids[i] = first + i; + _mesa_HashInsert(ctx->Occlusion.QueryObjects, first + i, q); + } + } +} + + +void +_mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids) +{ + GET_CURRENT_CONTEXT(ctx); + GLint i; + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (n < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteQueriesARB(n < 0)"); + return; + } + + if (ctx->Occlusion.Active) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glDeleteQueriesARB"); + return; + } + + for (i = 0; i < n; i++) { + if (ids[i] > 0) { + struct occlusion_query *q = (struct occlusion_query *) + _mesa_HashLookup(ctx->Occlusion.QueryObjects, ids[i]); + if (q) { + _mesa_HashRemove(ctx->Occlusion.QueryObjects, ids[i]); + delete_query_object(q); + } + } + } +} + + +GLboolean +_mesa_IsQueryARB(GLuint id) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); + + if (id && _mesa_HashLookup(ctx->Occlusion.QueryObjects, id)) + return GL_TRUE; + else + return GL_FALSE; +} + + +void +_mesa_BeginQueryARB(GLenum target, GLuint id) +{ + GET_CURRENT_CONTEXT(ctx); + struct occlusion_query *q; + ASSERT_OUTSIDE_BEGIN_END(ctx); + + FLUSH_VERTICES(ctx, _NEW_DEPTH); + + if (target != GL_SAMPLES_PASSED_ARB) { + _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); + return; + } + + if (ctx->Occlusion.CurrentQueryObject) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQueryARB(target)"); + return; + } + + q = (struct occlusion_query *) + _mesa_HashLookup(ctx->Occlusion.QueryObjects, id); + if (q && q->Active) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQueryARB"); + return; + } + else if (!q) { + q = new_query_object(target, id); + if (!q) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBeginQueryARB"); + return; + } + _mesa_HashInsert(ctx->Occlusion.QueryObjects, id, q); + } + + q->Active = GL_TRUE; + q->PassedCounter = 0; + ctx->Occlusion.Active = GL_TRUE; + ctx->Occlusion.CurrentQueryObject = id; + ctx->Occlusion.PassedCounter = 0; +} + + +void +_mesa_EndQueryARB(GLenum target) +{ + GET_CURRENT_CONTEXT(ctx); + struct occlusion_query *q; + ASSERT_OUTSIDE_BEGIN_END(ctx); + + FLUSH_VERTICES(ctx, _NEW_DEPTH); + + if (target != GL_SAMPLES_PASSED_ARB) { + _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); + return; + } + + q = (struct occlusion_query *) + _mesa_HashLookup(ctx->Occlusion.QueryObjects, + ctx->Occlusion.CurrentQueryObject); + if (!q || !q->Active) { + _mesa_problem(ctx, "bad query object in glEndQueryARB"); + return; + } + + q->PassedCounter = ctx->Occlusion.PassedCounter; + q->Active = GL_FALSE; + ctx->Occlusion.Active = GL_FALSE; + ctx->Occlusion.CurrentQueryObject = 0; +} + + +void +_mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (target != GL_SAMPLES_PASSED_ARB) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryivARB(target)"); + return; + } + + switch (pname) { + case GL_QUERY_COUNTER_BITS_ARB: + *params = 8 * sizeof(GLuint); + break; + case GL_CURRENT_QUERY_ARB: + *params = ctx->Occlusion.CurrentQueryObject; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryivARB(pname)"); + return; + } +} + + +void +_mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params) +{ + GET_CURRENT_CONTEXT(ctx); + struct occlusion_query *q; + ASSERT_OUTSIDE_BEGIN_END(ctx); + + q = (struct occlusion_query *) + _mesa_HashLookup(ctx->Occlusion.QueryObjects, id); + if (!q || q->Active) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetQueryObjectivARB"); + return; + } + + switch (pname) { + case GL_QUERY_RESULT_ARB: + *params = q->PassedCounter; + break; + case GL_QUERY_RESULT_AVAILABLE_ARB: + /* XXX revisit when we have a hardware implementation! */ + *params = GL_TRUE; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjectivARB(pname)"); + return; + } +} + + +void +_mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) +{ + GET_CURRENT_CONTEXT(ctx); + struct occlusion_query *q; + ASSERT_OUTSIDE_BEGIN_END(ctx); + + q = (struct occlusion_query *) + _mesa_HashLookup(ctx->Occlusion.QueryObjects, id); + if (!q || q->Active) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetQueryObjectuivARB"); + return; + } + + switch (pname) { + case GL_QUERY_RESULT_ARB: + *params = q->PassedCounter; + break; + case GL_QUERY_RESULT_AVAILABLE_ARB: + /* XXX revisit when we have a hardware implementation! */ + *params = GL_TRUE; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjectuivARB(pname)"); + return; + } +} diff --git a/src/mesa/main/occlude.h b/src/mesa/main/occlude.h new file mode 100644 index 00000000000..cc3786772bc --- /dev/null +++ b/src/mesa/main/occlude.h @@ -0,0 +1,55 @@ +/* + * Mesa 3-D graphics library + * Version: 5.1 + * + * Copyright (C) 1999-2003 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. + */ + + +#ifndef OCCLUDE_H +#define OCCLUDE_H + + +extern void +_mesa_GenQueriesARB(GLsizei n, GLuint *ids); + +extern void +_mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids); + +extern GLboolean +_mesa_IsQueryARB(GLuint id); + +extern void +_mesa_BeginQueryARB(GLenum target, GLuint id); + +extern void +_mesa_EndQueryARB(GLenum target); + +extern void +_mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params); + +extern void +_mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params); + +extern void +_mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params); + + +#endif /* OCCLUDE_H */ diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 63c8bc4abda..2851b8e083b 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -59,6 +59,9 @@ #include "light.h" #include "lines.h" #include "matrix.h" +#if FEATURE_ARB_occlusion_query +#include "occlude.h" +#endif #include "pixel.h" #include "points.h" #include "polygon.h" @@ -644,6 +647,17 @@ _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize) exec->MapBufferARB = _mesa_MapBufferARB; exec->UnmapBufferARB = _mesa_UnmapBufferARB; #endif + +#if FEATURE_ARB_occlusion_query + exec->GenQueriesARB = _mesa_GenQueriesARB; + exec->DeleteQueriesARB = _mesa_DeleteQueriesARB; + exec->IsQueryARB = _mesa_IsQueryARB; + exec->BeginQueryARB = _mesa_BeginQueryARB; + exec->EndQueryARB = _mesa_EndQueryARB; + exec->GetQueryivARB = _mesa_GetQueryivARB; + exec->GetQueryObjectivARB = _mesa_GetQueryObjectivARB; + exec->GetQueryObjectuivARB = _mesa_GetQueryObjectuivARB; +#endif } diff --git a/src/mesa/sparc/glapi_sparc.S b/src/mesa/sparc/glapi_sparc.S index 6c12304077c..b44ab68c3b7 100644 --- a/src/mesa/sparc/glapi_sparc.S +++ b/src/mesa/sparc/glapi_sparc.S @@ -18623,6 +18623,174 @@ glDepthBoundsEXT: sethi %hi(0x00000000), %g1 ld [%g1 + %lo(0x00000000)], %g1 ld [%g1 + (4 * _gloffset_DepthBoundsEXT)], %g3 +#endif + jmpl %g3, %g0 + nop + +.globl glGenQueriesARB +.type glGenQueriesARB,#function +glGenQueriesARB: +#ifdef __sparc_v9__ + sethi %hi(0x00000000), %g2 + sethi %hi(0x00000000), %g1 + or %g2, %lo(0x00000000), %g2 + or %g1, %lo(0x00000000), %g1 + sllx %g2, 32, %g2 + ldx [%g1 + %g2], %g1 + sethi %hi(8 * _gloffset_GenQueriesARB), %g2 + or %g2, %lo(8 * _gloffset_GenQueriesARB), %g2 + ldx [%g1 + %g2], %g3 +#else + sethi %hi(0x00000000), %g1 + ld [%g1 + %lo(0x00000000)], %g1 + ld [%g1 + (4 * _gloffset_GenQueriesARB)], %g3 +#endif + jmpl %g3, %g0 + nop + +.globl glDeleteQueriesARB +.type glDeleteQueriesARB,#function +glDeleteQueriesARB: +#ifdef __sparc_v9__ + sethi %hi(0x00000000), %g2 + sethi %hi(0x00000000), %g1 + or %g2, %lo(0x00000000), %g2 + or %g1, %lo(0x00000000), %g1 + sllx %g2, 32, %g2 + ldx [%g1 + %g2], %g1 + sethi %hi(8 * _gloffset_DeleteQueriesARB), %g2 + or %g2, %lo(8 * _gloffset_DeleteQueriesARB), %g2 + ldx [%g1 + %g2], %g3 +#else + sethi %hi(0x00000000), %g1 + ld [%g1 + %lo(0x00000000)], %g1 + ld [%g1 + (4 * _gloffset_DeleteQueriesARB)], %g3 +#endif + jmpl %g3, %g0 + nop + +.globl glIsQueryARB +.type glIsQueryARB,#function +glIsQueryARB: +#ifdef __sparc_v9__ + sethi %hi(0x00000000), %g2 + sethi %hi(0x00000000), %g1 + or %g2, %lo(0x00000000), %g2 + or %g1, %lo(0x00000000), %g1 + sllx %g2, 32, %g2 + ldx [%g1 + %g2], %g1 + sethi %hi(8 * _gloffset_IsQueryARB), %g2 + or %g2, %lo(8 * _gloffset_IsQueryARB), %g2 + ldx [%g1 + %g2], %g3 +#else + sethi %hi(0x00000000), %g1 + ld [%g1 + %lo(0x00000000)], %g1 + ld [%g1 + (4 * _gloffset_IsQueryARB)], %g3 +#endif + jmpl %g3, %g0 + nop + +.globl glBeginQueryARB +.type glBeginQueryARB,#function +glBeginQueryARB: +#ifdef __sparc_v9__ + sethi %hi(0x00000000), %g2 + sethi %hi(0x00000000), %g1 + or %g2, %lo(0x00000000), %g2 + or %g1, %lo(0x00000000), %g1 + sllx %g2, 32, %g2 + ldx [%g1 + %g2], %g1 + sethi %hi(8 * _gloffset_BeginQueryARB), %g2 + or %g2, %lo(8 * _gloffset_BeginQueryARB), %g2 + ldx [%g1 + %g2], %g3 +#else + sethi %hi(0x00000000), %g1 + ld [%g1 + %lo(0x00000000)], %g1 + ld [%g1 + (4 * _gloffset_BeginQueryARB)], %g3 +#endif + jmpl %g3, %g0 + nop + +.globl glEndQueryARB +.type glEndQueryARB,#function +glEndQueryARB: +#ifdef __sparc_v9__ + sethi %hi(0x00000000), %g2 + sethi %hi(0x00000000), %g1 + or %g2, %lo(0x00000000), %g2 + or %g1, %lo(0x00000000), %g1 + sllx %g2, 32, %g2 + ldx [%g1 + %g2], %g1 + sethi %hi(8 * _gloffset_EndQueryARB), %g2 + or %g2, %lo(8 * _gloffset_EndQueryARB), %g2 + ldx [%g1 + %g2], %g3 +#else + sethi %hi(0x00000000), %g1 + ld [%g1 + %lo(0x00000000)], %g1 + ld [%g1 + (4 * _gloffset_EndQueryARB)], %g3 +#endif + jmpl %g3, %g0 + nop + +.globl glGetQueryivARB +.type glGetQueryivARB,#function +glGetQueryivARB: +#ifdef __sparc_v9__ + sethi %hi(0x00000000), %g2 + sethi %hi(0x00000000), %g1 + or %g2, %lo(0x00000000), %g2 + or %g1, %lo(0x00000000), %g1 + sllx %g2, 32, %g2 + ldx [%g1 + %g2], %g1 + sethi %hi(8 * _gloffset_GetQueryivARB), %g2 + or %g2, %lo(8 * _gloffset_GetQueryivARB), %g2 + ldx [%g1 + %g2], %g3 +#else + sethi %hi(0x00000000), %g1 + ld [%g1 + %lo(0x00000000)], %g1 + ld [%g1 + (4 * _gloffset_GetQueryivARB)], %g3 +#endif + jmpl %g3, %g0 + nop + +.globl glGetQueryObjectivARB +.type glGetQueryObjectivARB,#function +glGetQueryObjectivARB: +#ifdef __sparc_v9__ + sethi %hi(0x00000000), %g2 + sethi %hi(0x00000000), %g1 + or %g2, %lo(0x00000000), %g2 + or %g1, %lo(0x00000000), %g1 + sllx %g2, 32, %g2 + ldx [%g1 + %g2], %g1 + sethi %hi(8 * _gloffset_GetQueryObjectivARB), %g2 + or %g2, %lo(8 * _gloffset_GetQueryObjectivARB), %g2 + ldx [%g1 + %g2], %g3 +#else + sethi %hi(0x00000000), %g1 + ld [%g1 + %lo(0x00000000)], %g1 + ld [%g1 + (4 * _gloffset_GetQueryObjectivARB)], %g3 +#endif + jmpl %g3, %g0 + nop + +.globl glGetQueryObjectuivARB +.type glGetQueryObjectuivARB,#function +glGetQueryObjectuivARB: +#ifdef __sparc_v9__ + sethi %hi(0x00000000), %g2 + sethi %hi(0x00000000), %g1 + or %g2, %lo(0x00000000), %g2 + or %g1, %lo(0x00000000), %g1 + sllx %g2, 32, %g2 + ldx [%g1 + %g2], %g1 + sethi %hi(8 * _gloffset_GetQueryObjectuivARB), %g2 + or %g2, %lo(8 * _gloffset_GetQueryObjectuivARB), %g2 + ldx [%g1 + %g2], %g3 +#else + sethi %hi(0x00000000), %g1 + ld [%g1 + %lo(0x00000000)], %g1 + ld [%g1 + (4 * _gloffset_GetQueryObjectuivARB)], %g3 #endif jmpl %g3, %g0 nop diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 5160e810cdb..6a25be68f5d 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -79,7 +79,7 @@ _swrast_update_rasterflags( GLcontext *ctx ) RasterMask |= CLIP_BIT; } - if (ctx->Depth.OcclusionTest) + if (ctx->Depth.OcclusionTest || ctx->Occlusion.Active) RasterMask |= OCCLUSION_BIT; diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index cce69b8c439..59e89252a05 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -841,6 +841,14 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span) /* if we get here, something passed the depth test */ ctx->OcclusionResult = GL_TRUE; +#if FEATURE_ARB_occlusion_query + if (ctx->Occlusion.Active) { + GLuint i; + for (i = 0; i < span->end; i++) + ctx->Occlusion.PassedCounter += span->array->mask[i]; + } +#endif + /* we have to wait until after occlusion to do this test */ if (ctx->Color.DrawBuffer == GL_NONE || ctx->Color.IndexMask == 0) { /* write no pixels */ @@ -1046,6 +1054,14 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span) /* if we get here, something passed the depth test */ ctx->OcclusionResult = GL_TRUE; +#if FEATURE_ARB_occlusion_query + if (ctx->Occlusion.Active) { + GLuint i; + for (i = 0; i < span->end; i++) + ctx->Occlusion.PassedCounter += span->array->mask[i]; + } +#endif + /* can't abort span-writing until after occlusion testing */ if (colorMask == 0x0) { span->interpMask = origInterpMask; @@ -1288,6 +1304,14 @@ _swrast_write_texture_span( GLcontext *ctx, struct sw_span *span) /* if we get here, some fragments passed the depth test */ ctx->OcclusionResult = GL_TRUE; +#if FEATURE_ARB_occlusion_query + if (ctx->Occlusion.Active) { + GLuint i; + for (i = 0; i < span->end; i++) + ctx->Occlusion.PassedCounter += span->array->mask[i]; + } +#endif + /* We had to wait until now to check for glColorMask(F,F,F,F) because of * the occlusion test. */ diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 43c131a6e75..0ce3459d544 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -899,13 +899,16 @@ fast_persp_span(GLcontext *ctx, struct sw_span *span, +/* + * Special tri function for occlusion testing + */ #define NAME occlusion_zless_triangle #define DO_OCCLUSION_TEST #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define SETUP_CODE \ - if (ctx->OcclusionResult) { \ - return; \ +#define SETUP_CODE \ + if (ctx->OcclusionResult && !ctx->Occlusion.Active) { \ + return; \ } #define RENDER_SPAN( span ) \ GLuint i; \ @@ -913,7 +916,7 @@ fast_persp_span(GLcontext *ctx, struct sw_span *span, GLdepth z = FixedToDepth(span.z); \ if (z < zRow[i]) { \ ctx->OcclusionResult = GL_TRUE; \ - return; \ + ctx->Occlusion.PassedCounter++; \ } \ span.z += span.zStep; \ } @@ -1034,7 +1037,8 @@ _swrast_choose_triangle( GLcontext *ctx ) return; } - if (ctx->Depth.OcclusionTest && + /* special case for occlusion testing */ + if ((ctx->Depth.OcclusionTest || ctx->Occlusion.Active) && ctx->Depth.Test && ctx->Depth.Mask == GL_FALSE && ctx->Depth.Func == GL_LESS && diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index a515818e4ba..a574c63bcaa 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -5337,5 +5337,53 @@ GL_PREFIX(DepthBoundsEXT): MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) JMP(GL_OFFSET(_gloffset_DepthBoundsEXT)) +ALIGNTEXT16 +GLOBL_FN(GL_PREFIX(GenQueriesARB)) +GL_PREFIX(GenQueriesARB): + MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) + JMP(GL_OFFSET(_gloffset_GenQueriesARB)) + +ALIGNTEXT16 +GLOBL_FN(GL_PREFIX(DeleteQueriesARB)) +GL_PREFIX(DeleteQueriesARB): + MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) + JMP(GL_OFFSET(_gloffset_DeleteQueriesARB)) + +ALIGNTEXT16 +GLOBL_FN(GL_PREFIX(IsQueryARB)) +GL_PREFIX(IsQueryARB): + MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) + JMP(GL_OFFSET(_gloffset_IsQueryARB)) + +ALIGNTEXT16 +GLOBL_FN(GL_PREFIX(BeginQueryARB)) +GL_PREFIX(BeginQueryARB): + MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) + JMP(GL_OFFSET(_gloffset_BeginQueryARB)) + +ALIGNTEXT16 +GLOBL_FN(GL_PREFIX(EndQueryARB)) +GL_PREFIX(EndQueryARB): + MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) + JMP(GL_OFFSET(_gloffset_EndQueryARB)) + +ALIGNTEXT16 +GLOBL_FN(GL_PREFIX(GetQueryivARB)) +GL_PREFIX(GetQueryivARB): + MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) + JMP(GL_OFFSET(_gloffset_GetQueryivARB)) + +ALIGNTEXT16 +GLOBL_FN(GL_PREFIX(GetQueryObjectivARB)) +GL_PREFIX(GetQueryObjectivARB): + MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) + JMP(GL_OFFSET(_gloffset_GetQueryObjectivARB)) + +ALIGNTEXT16 +GLOBL_FN(GL_PREFIX(GetQueryObjectuivARB)) +GL_PREFIX(GetQueryObjectuivARB): + MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) + JMP(GL_OFFSET(_gloffset_GetQueryObjectuivARB)) + #endif /* __WIN32__ */ -- cgit v1.2.3 From 642699a19f1c07336a6fadacd6d5a9028f5d346f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Jun 2003 14:32:44 +0000 Subject: DOS updates for new tree (Daniel Borca) --- Makefile.DJ | 108 ++ docs/README.DJ | 451 ++--- include/GL/dmesa.h | 294 +-- progs/samples/Makefile.DJ | 169 +- src/glu/mesa/Makefile.DJ | 202 ++- src/glu/sgi/Makefile.DJ | 378 ++-- src/glut/dos/Makefile.DJ | 270 +-- src/glut/dos/PC_HW/pc_hw.c | 290 +-- src/glut/dos/PC_HW/pc_hw.h | 450 ++--- src/glut/dos/PC_HW/pc_irq.S | 364 ++-- src/glut/dos/PC_HW/pc_keyb.c | 1084 +++++------ src/glut/dos/PC_HW/pc_mouse.c | 556 +++--- src/glut/dos/PC_HW/pc_timer.c | 316 ++-- src/glut/dos/callback.c | 328 ++-- src/glut/dos/color.c | 118 +- src/glut/dos/extens.c | 126 +- src/glut/dos/glutint.h | 300 +-- src/glut/dos/init.c | 508 +++--- src/glut/dos/menu.c | 232 +-- src/glut/dos/mouse.c | 120 +- src/glut/dos/overlay.c | 182 +- src/glut/dos/state.c | 284 +-- src/glut/dos/window.c | 520 +++--- src/mesa/Makefile.DJ | 373 ++++ src/mesa/drivers/dos/blit.S | 398 ++-- src/mesa/drivers/dos/dmesa.c | 3421 ++++++++++++++++++----------------- src/mesa/drivers/dos/dpmi.c | 296 +-- src/mesa/drivers/dos/internal.h | 258 +-- src/mesa/drivers/dos/mga/m_ttemp.h | 754 ++++---- src/mesa/drivers/dos/mga/m_ttemp2.h | 750 ++++---- src/mesa/drivers/dos/mga/mga.c | 3072 +++++++++++++++---------------- src/mesa/drivers/dos/mga/mga.h | 182 +- src/mesa/drivers/dos/mga/mga_hw.c | 832 ++++----- src/mesa/drivers/dos/mga/mga_hw.h | 226 +-- src/mesa/drivers/dos/mga/mga_mode.c | 462 ++--- src/mesa/drivers/dos/mga/mga_mode.h | 94 +- src/mesa/drivers/dos/mga/mga_reg.h | 414 ++--- src/mesa/drivers/dos/vesa.c | 1066 +++++------ src/mesa/drivers/dos/vesa.h | 94 +- src/mesa/drivers/dos/vga.c | 470 ++--- src/mesa/drivers/dos/vga.h | 84 +- src/mesa/drivers/dos/video.c | 1050 +++++------ src/mesa/drivers/dos/video.h | 128 +- src/mesa/drivers/dos/virtual.S | 978 +++++----- src/mesa/main/Makefile.DJ | 348 ---- 45 files changed, 11794 insertions(+), 11606 deletions(-) create mode 100644 Makefile.DJ create mode 100644 src/mesa/Makefile.DJ delete mode 100644 src/mesa/main/Makefile.DJ (limited to 'include') diff --git a/Makefile.DJ b/Makefile.DJ new file mode 100644 index 00000000000..78207d9ed14 --- /dev/null +++ b/Makefile.DJ @@ -0,0 +1,108 @@ +# Mesa 3-D graphics library +# Version: 4.0 +# +# Copyright (C) 1999 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# DOS/DJGPP makefile v1.4 for Mesa +# +# Copyright (C) 2002 - Borca Daniel +# Email : dborca@yahoo.com +# Web : http://www.geocities.com/dborca + + +# +# Available options: +# +# Environment variables: +# CPU optimize for the given processor. +# default = k6 +# GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++) +# or `mesa'. +# default = mesa +# GLIDE path to Glide3 SDK include files; used with FX. +# default = $(TOP)/include/glide3 +# FX=1 build for 3dfx Glide3. Note that this disables +# compilation of most DMesa code and requires fxMesa. +# As a consequence, you'll need the DJGPP Glide3 +# library to build any application. +# default = no +# MATROX=1 build for Matrox Millennium I (MGA2064W) cards. +# This is experimental and not intensively tested. +# default = no +# HAVE_X86=1 optimize for i386. +# default = no +# HAVE_MMX=1 allow MMX specializations, provided your assembler +# supports MMX instruction set. However, the true CPU +# capabilities are checked at run-time to avoid crashes. +# default = no +# HAVE_SSE=1 (see HAVE_MMX) +# default = no +# HAVE_3DNOW=1 (see HAVE_MMX) +# default = no +# +# Targets: +# all: build everything +# libgl: build GL +# libglu: build GLU +# libglut: build GLUT +# clean: remove object files +# realclean: remove all generated files +# + + + +.PHONY : all libgl libglu libglut clean realclean + +CPU ?= k6 + +GLU ?= mesa + +CFLAGS = -Wall -W -pedantic +CFLAGS += -O2 -ffast-math -mcpu=$(CPU) + +export CFLAGS + +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = del $(subst /,\,$(1)) +else +UNLINK = $(RM) $(1) +endif + +all: libgl libglu libglut + +libgl: lib + $(MAKE) -f Makefile.DJ -C src/mesa +libglu: lib + $(MAKE) -f Makefile.DJ -C src/glu/$(GLU) +libglut: lib + $(MAKE) -f Makefile.DJ -C src/glut/dos + +lib: + mkdir lib + +clean: + $(MAKE) -f Makefile.DJ clean -C src/mesa + $(MAKE) -f Makefile.DJ clean -C src/glu/mesa + $(MAKE) -f Makefile.DJ clean -C src/glu/sgi + $(MAKE) -f Makefile.DJ clean -C src/glut/dos + +realclean: clean + -$(call UNLINK,lib/*.a) + -$(call UNLINK,lib/*.dxe) diff --git a/docs/README.DJ b/docs/README.DJ index 0ddcea8baec..78512587661 100644 --- a/docs/README.DJ +++ b/docs/README.DJ @@ -1,225 +1,226 @@ - Mesa 5.0.1 DOS/DJGPP Port v1.3 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - -Description: -~~~~~~~~~~~~ - -Well, guess what... this is the DOS port of Mesa 5.0.1, for DJGPP fans... Whoa! -The driver has its origins in ddsample.c, written by Brian Paul and found by me -in Mesa 3.4.2. - - - -Legal: -~~~~~~ - -Mesa copyright applies, provided this package is used within Mesa. For anything -else, see GPL. - - - -Installation: -~~~~~~~~~~~~~ - -Unzip and type: - - make -f Makefile.DJ [OPTIONS...] - -Available options: - - Environment variables: - CPU optimize for the given processor. - default = k6 - GLU=[src|si] specify GLU directory; can be `src' (src-glu = Mesa) - or `si' (si-glu = SGI's GLU -- requires GNU/C++). - default = src - GLIDE path to Glide3 SDK include files; used with FX. - default = $(TOP)/include/glide3 - FX=1 build for 3dfx Glide3. Note that this disables - compilation of most DMesa code and requires fxMesa. - As a consequence, you'll need the DJGPP Glide3 - library to build any application. - default = no - MATROX=1 build for Matrox Millennium I (MGA2064W) cards. - This is experimental and not intensively tested. - default = no - HAVE_X86=1 optimize for i386. - default = no - HAVE_MMX=1 allow MMX specializations, provided your assembler - supports MMX instruction set. However, the true CPU - capabilities are checked at run-time to avoid crashes. - default = no - HAVE_SSE=1 (see HAVE_MMX) - default = no - HAVE_3DNOW=1 (see HAVE_MMX) - default = no - - Targets: - all: build everything - libgl: build GL - libglu: build GLU - libglut: build GLUT - clean: remove object files - realclean: remove all generated files - - - -Tested on: - CPU: K6-2 (CXT) @500(412.5) MHz - Mainboard: ViA Apollo VP2/97 w/ 128 MB SDRAM - Video card: PowerColor EvilKing3 (Voodoo3 3000 PCI) w/ 16 MB SDRAM - DJGPP: djdev 2.04 + gcc v3.2.2 + make v3.79.1 - OS: DOS and Win9x - - - -FAQ: -~~~~ - -1. Compilation - - Q) I tried to run `make' and it exits because `gcc' complains it cannot find - some stupid file. - A) You need LFN support. - A) When compiling for Glide (FX=1), pay attention to Glide path. - - Q) Libraries built OK, but linker complains about `vsnprintf' every time I - compile some demo. - A) Upgrade to DJGPP 2.04. - A) Add `vsnprintf.c' to the CORE_SOURCES in `src/Makefile.DJ' (untested!). - A) The following hack should be safe in 90% of the cases, but if anything - goes wrong, don't come back to me crying. Anyway, patch `src/imports.c' - with the following line: - #define vsnprintf(buf, max, fmt, arg) vsprintf(buf, fmt, arg) - - Q) `make' complains about DXE3 or something, yet it builds the libraries. - A) DXE3 refers to the DJGPP dynamic modules. You'll need either the latest - DJGPP distro, or download the separate package from my web page. Read the - DXE3 documentation on how to use them. Hint: build your export object - file; then link it with your application. For example: - dxe3res -o dxe3tbl.c gl.dxe glu.dxe glut.dxe - gcc -o dxe3tbl.o -c dxe3tbl.c - gcc -o OUT.exe dxe3tbl.o IN.c -liglut -liglu -ligl -ldl - -2. Using Mesa for DJGPP - - Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better... - A) Is that a question? If you have a Voodoo3/Banshee card, you're lucky (the - Glide port is on my web page). If you have a Matrox Millennium I card, - you just MIGHT be lucky... If you haven't, sorry; everything is done in - software. Suggestions? - - Q) I tried to set refresh rate w/ DMesa, but without success. - A) Refresh rate control works only for VESA 3.0. If you were compiling for - Glide, see Glide info. If not, sorry! - - Q) I made a simple application and it does nothing. It exits right away. Not - even a blank screen. - A) The pure software drivers (VESA/VGA) support only double-buffered modes. - A) Another weird "feature" is that buffer width must be multiple of 8 (I'm a - lazy programmer and I found that the easiest way to keep buffer handling - at peak performance ;-). - - Q) My demo doesn't display text. I know I used the GLUT font routines! - A) Then you probably use GLUT as a DXE. Well, there is no direct access to - variables due to the way DXE works. Read the documentation. The author of - GLUT took this into account for _WIN32 DLL's only; I don't want to modify - his headers. The only workaround is to link GLUT the old way :-( - - Q) The GLUT is incomplete. - A) See below. - - - -libGLUT (the toolkit): -~~~~~~~~~~~~~~~~~~~~~~ - -Well, this "skeletal" GLUT implementation was taken from AllegGL project and -heavily changed. Thanks should go to Bernhard Tschirren, Mark Kilgard, Brian -Paul and probably others (or probably not ;-). GLUT functionality will be -extended only on an "as needed" basis. - -GLUT talks to hardware via PC_HW package which was put together from various -pieces I wrote long time ago. It consists from the keyboard, mouse and timer -drivers. - -My keyboard driver used only scancodes; as GLUT requires ASCII values for keys, -I borrowed the translation tables (and maybe more) from Allegro -- many thanks -to Shawn Hargreaves et co. Ctrl-Alt-Del (plus Ctrl-Alt-End, for Windows users) -will shut down the GLUT engine unconditionally: it will raise SIGINT, which in -turn will (hopefully) call the destructors, thus cleaning up your/my mess ;-) -NB: since the DJGPP guys ensured signal handlers won't go beyond program's -space (and since dynamic modules shall) the SIGINT can't be hooked (well, it -can, but it is useless), therefore you must live with the 'Exiting due to -signal SIGINT' message... - -The mouse driver is far from complete (lack of drawing, etc), but is enough to -make almost all the demos work. Supports the CuteMouse WheelAPI. - -The timer is pretty versatile for it supports multiple timers with different -frequencies. While not being the most accurate timer in the known universe, I -think it's OK. Take this example: you have timer A with a very high rate, and -then you have timer B with very low rate compared to A; now, A ticks OK, but -timer B will probably loose precision! - -As an addition, stdout and stderr are redirected and dumped upon exit. This -means that `printf' can be safely called during graphics. A bit of a hack, I -know, because all messages come in bulk, but I think it's better than nothing. -"Borrowed" from LIBRHUTI (Robert Hoehne). - -Window creating defaults: 300x300x16 at (0,0), 16-bit depth, 16-bit accum, -8-bit stencil. However, the video mode is chosen in such a way that first -window will fit. If you need high resolution with small windows, set initial -position far to the right (or way down); then you can move them back to any -position right before the main loop. - -The following environment variables can customize GLUT behaviour: - DMESA_GLUT_REFRESH - set vertical screen refresh rate (VESA3) - DMESA_GLUT_BPP - set default bits per pixel (VGA needs 8) - GLUT_FPS - print frames/second statistics to stderr - - - -History: -~~~~~~~~ - -v1.0 (mar-2002) - initial release - -v1.1 (sep-2002) - + added 3dfx Glide3 support - + added refresh rate control - + added fonts in GLUT - * lots of minor changes - -v1.2 (nov-2002) - * synced w/ Mesa-4.1 - - removed dmesadxe.h - -v1.3 (mar-2003) - + enabled OpenGL 1.4 support - + added MMX clear/blit routines - + enabled SGI's GLU compilation - + added samples makefile - + added new GLUT functions - + added color-index modes - + added Matrox Millennium MGA2064W driver - + added 8bit FakeColor (thanks to Neil Funk) - + added VGA support (to keep Ben Decker happy) - ! fixed some compilation errors (reported by Chan Kar Heng) - * optimized driver for faster callback access... yeah, right :) - * overhauled virtual buffer and internal video drivers - * better fxMesa integration - * revamped GLUT - * switched to DXE3 - - - -Contact: -~~~~~~~~ - -Name: Borca Daniel -E-mail: dborca@yahoo.com -WWW: http://www.geocities.com/dborca/ + Mesa 5.0.1 DOS/DJGPP Port v1.4 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + +Description: +~~~~~~~~~~~~ + +Well, guess what... this is the DOS port of Mesa 5.0.1, for DJGPP fans... Whoa! +The driver has its origins in ddsample.c, written by Brian Paul and found by me +in Mesa 3.4.2. + + + +Legal: +~~~~~~ + +Mesa copyright applies, provided this package is used within Mesa. For anything +else, see GPL. + + + +Installation: +~~~~~~~~~~~~~ + +Unzip and type: + + make -f Makefile.DJ [OPTIONS...] + +Available options: + + Environment variables: + CPU optimize for the given processor. + default = k6 + GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++) + or `mesa'. + default = mesa + GLIDE path to Glide3 SDK include files; used with FX. + default = $(TOP)/include/glide3 + FX=1 build for 3dfx Glide3. Note that this disables + compilation of most DMesa code and requires fxMesa. + As a consequence, you'll need the DJGPP Glide3 + library to build any application. + default = no + MATROX=1 build for Matrox Millennium I (MGA2064W) cards. + This is experimental and not intensively tested. + default = no + HAVE_X86=1 optimize for i386. + default = no + HAVE_MMX=1 allow MMX specializations, provided your assembler + supports MMX instruction set. However, the true CPU + capabilities are checked at run-time to avoid crashes. + default = no + HAVE_SSE=1 (see HAVE_MMX) + default = no + HAVE_3DNOW=1 (see HAVE_MMX) + default = no + + Targets: + all: build everything + libgl: build GL + libglu: build GLU + libglut: build GLUT + clean: remove object files + realclean: remove all generated files + + + +Tested on: + CPU: AMD Duron @800 MHz + Mainboard: EP-8KTA3 w/ 128 MB SDRAM + Video card: Voodoo5 5500 AGP w/ 64 MB SDRAM + DJGPP: djdev 2.04 + gcc v3.2.2 + make v3.79.1 + OS: DOS and Win98SE + + + +FAQ: +~~~~ + +1. Compilation + + Q) I tried to run `make' and it exits because `gcc' complains it cannot find + some stupid file. + A) You need LFN support. + A) When compiling for Glide (FX=1), pay attention to Glide path. + + Q) Libraries built OK, but linker complains about `vsnprintf' every time I + compile some demo. + A) Upgrade to DJGPP 2.04. + A) Add `vsnprintf.c' to the CORE_SOURCES in `src/Makefile.DJ' (untested!). + A) The following hack should be safe in 90% of the cases, but if anything + goes wrong, don't come back to me crying. Anyway, patch `src/imports.c' + with the following line: + #define vsnprintf(buf, max, fmt, arg) vsprintf(buf, fmt, arg) + + Q) `make' complains about DXE3 or something, yet it builds the libraries. + A) DXE3 refers to the DJGPP dynamic modules. You'll need either the latest + DJGPP distro, or download the separate package from my web page. Read the + DXE3 documentation on how to use them. + A) When compiling for Glide (FX=1), make sure `glid3.dxe' can be found in + LD_LIBRARY_PATH (or top `lib' directory). + +2. Using Mesa for DJGPP + + Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better... + A) Is that a question? If you have a 3dfx Voodoo Banshee or higher card, + you're lucky (check http://sourceforge.net/projects/glide for the DJGPP + port). If you have a Matrox Millennium I card, you just MIGHT be lucky... + If you haven't, sorry; everything is done in software. Suggestions? + + Q) I tried to set refresh rate w/ DMesa, but without success. + A) Refresh rate control works only for VESA 3.0. If you were compiling for + Glide, see Glide info. If not, sorry! + + Q) I made a simple application and it does nothing. It exits right away. Not + even a blank screen. + A) The pure software drivers (VESA/VGA) support only double-buffered modes. + A) Another weird "feature" is that buffer width must be multiple of 8 (I'm a + lazy programmer and I found that the easiest way to keep buffer handling + at peak performance ;-). + + Q) My demo doesn't display text. I know I used the GLUT font routines! + A) Then you probably use GLUT as a DXE. Well, there is no direct access to + variables due to the way DXE works. Read the documentation. The author of + GLUT took this into account for _WIN32 DLL's only; I don't want to modify + his headers. The only workaround is to link GLUT the old way :-( + + Q) The GLUT is incomplete. + A) See below. + + + +libGLUT (the toolkit): +~~~~~~~~~~~~~~~~~~~~~~ + +Well, this "skeletal" GLUT implementation was taken from AllegGL project and +heavily changed. Thanks should go to Bernhard Tschirren, Mark Kilgard, Brian +Paul and probably others (or probably not ;-). GLUT functionality will be +extended only on an "as needed" basis. + +GLUT talks to hardware via PC_HW package which was put together from various +pieces I wrote long time ago. It consists from the keyboard, mouse and timer +drivers. + +My keyboard driver used only scancodes; as GLUT requires ASCII values for keys, +I borrowed the translation tables (and maybe more) from Allegro -- many thanks +to Shawn Hargreaves et co. Ctrl-Alt-Del (plus Ctrl-Alt-End, for Windows users) +will shut down the GLUT engine unconditionally: it will raise SIGINT, which in +turn will (hopefully) call the destructors, thus cleaning up your/my mess ;-) +NB: since the DJGPP guys ensured signal handlers won't go beyond program's +space (and since dynamic modules shall) the SIGINT can't be hooked (well, it +can, but it is useless), therefore you must live with the 'Exiting due to +signal SIGINT' message... + +The mouse driver is far from complete (lack of drawing, etc), but is enough to +make almost all the demos work. Supports the CuteMouse WheelAPI. + +The timer is pretty versatile for it supports multiple timers with different +frequencies. While not being the most accurate timer in the known universe, I +think it's OK. Take this example: you have timer A with a very high rate, and +then you have timer B with very low rate compared to A; now, A ticks OK, but +timer B will probably loose precision! + +As an addition, stdout and stderr are redirected and dumped upon exit. This +means that `printf' can be safely called during graphics. A bit of a hack, I +know, because all messages come in bulk, but I think it's better than nothing. +"Borrowed" from LIBRHUTI (Robert Hoehne). + +Window creating defaults: 300x300x16 at (0,0), 16-bit depth, 16-bit accum, +8-bit stencil. However, the video mode is chosen in such a way that first +window will fit. If you need high resolution with small windows, set initial +position far to the right (or way down); then you can move them back to any +position right before the main loop. + +The following environment variables can customize GLUT behaviour: + DMESA_GLUT_REFRESH - set vertical screen refresh rate (VESA3) + DMESA_GLUT_BPP - set default bits per pixel (VGA needs 8) + GLUT_FPS - print frames/second statistics to stderr + + + +History: +~~~~~~~~ + +v1.0 (mar-2002) + initial release + +v1.1 (sep-2002) + + added 3dfx Glide3 support + + added refresh rate control + + added fonts in GLUT + * lots of minor changes + +v1.2 (nov-2002) + * synced w/ Mesa-4.1 + - removed dmesadxe.h + +v1.3 (mar-2003) + + enabled OpenGL 1.4 support + + added MMX clear/blit routines + + enabled SGI's GLU compilation + + added samples makefile + + added new GLUT functions + + added color-index modes + + added Matrox Millennium MGA2064W driver + + added 8bit FakeColor (thanks to Neil Funk) + + added VGA support (to keep Ben Decker happy) + ! fixed some compilation errors (reported by Chan Kar Heng) + * optimized driver for faster callback access... yeah, right :) + * overhauled virtual buffer and internal video drivers + * better fxMesa integration + * revamped GLUT + * switched to DXE3 + +v1.4 (jun-2003) + * accomodated makefiles with the new sourcetree + + + +Contact: +~~~~~~~~ + +Name: Borca Daniel +E-mail: dborca@yahoo.com +WWW: http://www.geocities.com/dborca/ diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h index 89df5a4e216..bb7d9b0cc96 100644 --- a/include/GL/dmesa.h +++ b/include/GL/dmesa.h @@ -1,147 +1,147 @@ -/* - * Mesa 3-D graphics library - * Version: 5.0 - * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef DMESA_H_included -#define DMESA_H_included - -#define DMESA_MAJOR_VERSION 5 -#define DMESA_MINOR_VERSION 0 - -/* Sample Usage: - * - * 1. Call DMesaCreateVisual() to initialize graphics. - * 2. Call DMesaCreateContext() to create a DMesa rendering context. - * 3. Call DMesaCreateBuffer() to define the window. - * 4. Call DMesaMakeCurrent() to bind the DMesaBuffer to a DMesaContext. - * 5. Make gl* calls to render your graphics. - * 6. Use DMesaSwapBuffers() when double buffering to swap front/back buffers. - * 7. Before exiting, destroy DMesaBuffer, DMesaContext and DMesaVisual. - */ - -typedef struct dmesa_context *DMesaContext; -typedef struct dmesa_visual *DMesaVisual; -typedef struct dmesa_buffer *DMesaBuffer; - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Create a new Visual and set graphics mode. - */ -DMesaVisual DMesaCreateVisual (GLint width, /* X res */ - GLint height, /* Y res */ - GLint colDepth, /* BPP */ - GLint refresh, /* refresh rate: 0=default */ - GLboolean dbFlag, /* double-buffered */ - GLboolean rgbFlag, /* RGB mode */ - GLboolean alphaFlag,/* alpha buffer requested */ - GLint depthSize, /* requested bits/depth */ - GLint stencilSize, /* requested bits/stencil */ - GLint accumSize); /* requested bits/accum */ - -/* - * Destroy Visual and restore screen. - */ -void DMesaDestroyVisual (DMesaVisual v); - - - -/* - * Create a new Context for rendering. - */ -DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share); - -/* - * Destroy Context. - */ -void DMesaDestroyContext (DMesaContext c); - -/* - * Return a handle to the current context. - */ -DMesaContext DMesaGetCurrentContext (void); - - - -/* - * Create a new Buffer (window). - */ -DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, - GLint xpos, GLint ypos, - GLint width, GLint height); - -/* - * Destroy Buffer. - */ -void DMesaDestroyBuffer (DMesaBuffer b); - -/* - * Swap the front and back buffers for the given Buffer. - * No action is taken if the buffer is not double buffered. - */ -void DMesaSwapBuffers (DMesaBuffer b); - -/* - * Bind Buffer to Context and make the Context the current one. - */ -GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b); - - - -/* - * Move/Resize current Buffer. - */ -GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos); -GLboolean DMesaResizeBuffer (GLint width, GLint height); - -/* - * Set palette index, using normalized values. - */ -void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue); - -/* - * DMesa state retrieval. - */ -#define DMESA_GET_SCREEN_SIZE 0x0100 -#define DMESA_GET_DRIVER_CAPS 0x0200 - -#define DMESA_DRIVER_SWDB_BIT 0x1 /* software double-buffered */ -#define DMESA_DRIVER_LLWO_BIT 0x2 /* lower-left window origin */ -int DMesaGetIntegerv (GLenum pname, GLint *params); - -#ifdef __cplusplus -} -#endif - -#endif +/* + * Mesa 3-D graphics library + * Version: 5.0 + * + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef DMESA_H_included +#define DMESA_H_included + +#define DMESA_MAJOR_VERSION 5 +#define DMESA_MINOR_VERSION 0 + +/* Sample Usage: + * + * 1. Call DMesaCreateVisual() to initialize graphics. + * 2. Call DMesaCreateContext() to create a DMesa rendering context. + * 3. Call DMesaCreateBuffer() to define the window. + * 4. Call DMesaMakeCurrent() to bind the DMesaBuffer to a DMesaContext. + * 5. Make gl* calls to render your graphics. + * 6. Use DMesaSwapBuffers() when double buffering to swap front/back buffers. + * 7. Before exiting, destroy DMesaBuffer, DMesaContext and DMesaVisual. + */ + +typedef struct dmesa_context *DMesaContext; +typedef struct dmesa_visual *DMesaVisual; +typedef struct dmesa_buffer *DMesaBuffer; + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Create a new Visual and set graphics mode. + */ +DMesaVisual DMesaCreateVisual (GLint width, /* X res */ + GLint height, /* Y res */ + GLint colDepth, /* BPP */ + GLint refresh, /* refresh rate: 0=default */ + GLboolean dbFlag, /* double-buffered */ + GLboolean rgbFlag, /* RGB mode */ + GLboolean alphaFlag,/* alpha buffer requested */ + GLint depthSize, /* requested bits/depth */ + GLint stencilSize, /* requested bits/stencil */ + GLint accumSize); /* requested bits/accum */ + +/* + * Destroy Visual and restore screen. + */ +void DMesaDestroyVisual (DMesaVisual v); + + + +/* + * Create a new Context for rendering. + */ +DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share); + +/* + * Destroy Context. + */ +void DMesaDestroyContext (DMesaContext c); + +/* + * Return a handle to the current context. + */ +DMesaContext DMesaGetCurrentContext (void); + + + +/* + * Create a new Buffer (window). + */ +DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, + GLint xpos, GLint ypos, + GLint width, GLint height); + +/* + * Destroy Buffer. + */ +void DMesaDestroyBuffer (DMesaBuffer b); + +/* + * Swap the front and back buffers for the given Buffer. + * No action is taken if the buffer is not double buffered. + */ +void DMesaSwapBuffers (DMesaBuffer b); + +/* + * Bind Buffer to Context and make the Context the current one. + */ +GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b); + + + +/* + * Move/Resize current Buffer. + */ +GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos); +GLboolean DMesaResizeBuffer (GLint width, GLint height); + +/* + * Set palette index, using normalized values. + */ +void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue); + +/* + * DMesa state retrieval. + */ +#define DMESA_GET_SCREEN_SIZE 0x0100 +#define DMESA_GET_DRIVER_CAPS 0x0200 + +#define DMESA_DRIVER_SWDB_BIT 0x1 /* software double-buffered */ +#define DMESA_DRIVER_LLWO_BIT 0x2 /* lower-left window origin */ +int DMesaGetIntegerv (GLenum pname, GLint *params); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/progs/samples/Makefile.DJ b/progs/samples/Makefile.DJ index e29e0e598c1..13b1c7221b4 100644 --- a/progs/samples/Makefile.DJ +++ b/progs/samples/Makefile.DJ @@ -1,86 +1,83 @@ -# Mesa 3-D graphics library -# Version: 4.0 -# -# Copyright (C) 1999 Brian Paul All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -# DOS/DJGPP samples makefile v1.3 for Mesa -# -# Copyright (C) 2002 - Borca Daniel -# Email : dborca@yahoo.com -# Web : http://www.geocities.com/dborca - - -# -# Available options: -# -# Environment variables: -# CPU optimize for the given processor. -# default = k6 -# GLIDE path to Glide3 SDK library files; used with FX. -# default = $(TOP)/lib/glide3 -# FX=1 build for 3dfx Glide3. Note that this disables -# compilation of most DMesa code and requires fxMesa. -# As a consequence, you'll need the DJGPP Glide3 -# library to build any application. -# default = no -# DXE=1 use DXE modules. The resolution object file must be -# present in the `lib' directory in order to use this -# option (see README.DJ for details). -# default = no -# -# Targets: -# build a specific file -# - - - -.PHONY : all -.SUFFIXES : .c .o .exe - -TOP = .. -CPU ?= k6 -GLIDE ?= $(TOP)/lib/glide3 - -CC = gcc -CFLAGS = -Wall -W -pedantic -CFLAGS += -O2 -ffast-math -mcpu=$(CPU) -CFLAGS += -I$(TOP)/include - -LD = gxx -LDFLAGS = -s -L$(TOP)/lib - -ifeq ($(DXE),1) -DXE3TABLE = $(TOP)/lib/dxe3tbl.o -LDLIBS += -liglut -liglu -ligl -ldl -else -LDLIBS = -lglut -lglu -lgl -ifeq ($(FX),1) -LDFLAGS += -L$(GLIDE) -LDLIBS += -lglid3 -endif -endif - -.c.o: - $(CC) -o $@ $(CFLAGS) -c $< -.o.exe: - $(LD) -o $@ $(LDFLAGS) $(DXE3TABLE) $< $(LDLIBS) - -all: - $(error Must specify to build) +# Mesa 3-D graphics library +# Version: 4.0 +# +# Copyright (C) 1999 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# DOS/DJGPP samples makefile v1.4 for Mesa +# +# Copyright (C) 2002 - Borca Daniel +# Email : dborca@yahoo.com +# Web : http://www.geocities.com/dborca + + +# +# Available options: +# +# Environment variables: +# CPU optimize for the given processor. +# default = k6 +# GLIDE path to Glide3 SDK library files; used with FX. +# default = $(TOP)/lib/glide3 +# FX=1 build for 3dfx Glide3. Note that this disables +# compilation of most DMesa code and requires fxMesa. +# As a consequence, you'll need the DJGPP Glide3 +# library to build any application. +# default = no +# DXE=1 use DXE modules (see README.DJ for details). +# default = no +# +# Targets: +# build a specific file +# + + + +.PHONY : all +.SUFFIXES : .c .o .exe + +TOP = ../.. +CPU ?= k6 +GLIDE ?= $(TOP)/lib/glide3 + +CC = gcc +CFLAGS = -Wall -W -pedantic +CFLAGS += -O2 -ffast-math -mcpu=$(CPU) +CFLAGS += -I$(TOP)/include -I../util + +LD = gxx +LDFLAGS = -s -L$(TOP)/lib + +ifeq ($(DXE),1) +LDLIBS += -liglut -liglu -ligl +else +LDLIBS = -lglut -lglu -lgl +ifeq ($(FX),1) +LDFLAGS += -L$(GLIDE) +LDLIBS += -lglid3 +endif +endif + +.c.o: + $(CC) -o $@ $(CFLAGS) -c $< +.o.exe: + $(LD) -o $@ $(LDFLAGS) $< $(LDLIBS) + +all: + $(error Must specify to build) diff --git a/src/glu/mesa/Makefile.DJ b/src/glu/mesa/Makefile.DJ index b11b23345f8..1e61080b49b 100644 --- a/src/glu/mesa/Makefile.DJ +++ b/src/glu/mesa/Makefile.DJ @@ -1,100 +1,102 @@ -# Mesa 3-D graphics library -# Version: 4.0 -# -# Copyright (C) 1999 Brian Paul All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -# DOS/DJGPP glu makefile v1.3 for Mesa -# -# Copyright (C) 2002 - Borca Daniel -# Email : dborca@yahoo.com -# Web : http://www.geocities.com/dborca - - -# -# Available options: -# -# Environment variables: -# CFLAGS -# -# Targets: -# all: build GLU -# clean: remove object files -# - - - -.PHONY: all clean - -TOP = .. -LIBDIR = $(TOP)/lib -GLU_LIB = libglu.a -GLU_DXE = glu.dxe -GLU_IMP = libiglu.a - -CC = gcc -CFLAGS += -I$(TOP)/include - -AR = ar -ARFLAGS = rus - -HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe) - -ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) -UNLINK = del $(subst /,\,$(1)) -else -UNLINK = $(RM) $(1) -endif - -CORE_SOURCES = \ - glu.c \ - mipmap.c \ - nurbs.c \ - nurbscrv.c \ - nurbssrf.c \ - nurbsutl.c \ - polytest.c \ - project.c \ - quadric.c \ - tess.c \ - tesselat.c - -SOURCES = $(CORE_SOURCES) - -OBJECTS = $(SOURCES:.c=.o) - -.c.o: - $(CC) -o $@ $(CFLAGS) -c $< - -all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP) - -$(LIBDIR)/$(GLU_LIB): $(OBJECTS) - $(AR) $(ARFLAGS) $(LIBDIR)/$(GLU_LIB) $(OBJECTS) - -$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS) -ifeq ($(HAVEDXE3),) - $(warning Missing DXE3 package... Skipping $(GLU_DXE)) -else - -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -I $(LIBDIR)/$(GLU_IMP) -D "MesaGLU DJGPP" -E _glu -P gl.dxe -U $(OBJECTS) -endif - -clean: - -$(call UNLINK,*.o) - --include depend +# Mesa 3-D graphics library +# Version: 4.0 +# +# Copyright (C) 1999 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# DOS/DJGPP glu makefile v1.4 for Mesa +# +# Copyright (C) 2002 - Borca Daniel +# Email : dborca@yahoo.com +# Web : http://www.geocities.com/dborca + + +# +# Available options: +# +# Environment variables: +# CFLAGS +# +# Targets: +# all: build GLU +# clean: remove object files +# + + + +.PHONY: all clean + +TOP = ../../.. +LIBDIR = $(TOP)/lib +GLU_LIB = libglu.a +GLU_DXE = glu.dxe +GLU_IMP = libiglu.a + +export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR) + +CC = gcc +CFLAGS += -I$(TOP)/include + +AR = ar +ARFLAGS = rus + +HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe) + +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = del $(subst /,\,$(1)) +else +UNLINK = $(RM) $(1) +endif + +CORE_SOURCES = \ + glu.c \ + mipmap.c \ + nurbs.c \ + nurbscrv.c \ + nurbssrf.c \ + nurbsutl.c \ + polytest.c \ + project.c \ + quadric.c \ + tess.c \ + tesselat.c + +SOURCES = $(CORE_SOURCES) + +OBJECTS = $(SOURCES:.c=.o) + +.c.o: + $(CC) -o $@ $(CFLAGS) -c $< + +all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP) + +$(LIBDIR)/$(GLU_LIB): $(OBJECTS) + $(AR) $(ARFLAGS) $(LIBDIR)/$(GLU_LIB) $(OBJECTS) + +$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS) +ifeq ($(HAVEDXE3),) + $(warning Missing DXE3 package... Skipping $(GLU_DXE)) +else + -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU DJGPP" -E _glu -P gl.dxe -U $(OBJECTS) +endif + +clean: + -$(call UNLINK,*.o) + +-include depend diff --git a/src/glu/sgi/Makefile.DJ b/src/glu/sgi/Makefile.DJ index d81da0fba4e..0facbc7ee92 100644 --- a/src/glu/sgi/Makefile.DJ +++ b/src/glu/sgi/Makefile.DJ @@ -1,188 +1,190 @@ -# Mesa 3-D graphics library -# Version: 4.0 -# -# Copyright (C) 1999 Brian Paul All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -# DOS/DJGPP glu makefile v1.3 for Mesa -# -# Copyright (C) 2002 - Borca Daniel -# Email : dborca@yahoo.com -# Web : http://www.geocities.com/dborca - - -# -# Available options: -# -# Environment variables: -# CFLAGS -# -# Targets: -# all: build GLU -# clean: remove object files -# - - - -.PHONY: all clean - -TOP = .. -LIBDIR = $(TOP)/lib -GLU_LIB = libglu.a -GLU_DXE = glu.dxe -GLU_IMP = libiglu.a - -CC = gcc -CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include -Iinclude -CXX = gpp -CXXFLAGS = $(CFLAGS) -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess - -AR = ar -ARFLAGS = rus - -HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe) - -ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) -UNLINK = del $(subst /,\,$(1)) -else -UNLINK = $(RM) $(1) -endif - -C_SOURCES = \ - libutil/error.c \ - libutil/glue.c \ - libutil/mipmap.c \ - libutil/project.c \ - libutil/quad.c \ - libutil/registry.c \ - libtess/dict.c \ - libtess/geom.c \ - libtess/memalloc.c \ - libtess/mesh.c \ - libtess/normal.c \ - libtess/priorityq.c \ - libtess/render.c \ - libtess/sweep.c \ - libtess/tess.c \ - libtess/tessmono.c - -CC_SOURCES = \ - libnurbs/interface/bezierEval.cc \ - libnurbs/interface/bezierPatch.cc \ - libnurbs/interface/bezierPatchMesh.cc \ - libnurbs/interface/glcurveval.cc \ - libnurbs/interface/glinterface.cc \ - libnurbs/interface/glrenderer.cc \ - libnurbs/interface/glsurfeval.cc \ - libnurbs/interface/incurveeval.cc \ - libnurbs/interface/insurfeval.cc \ - libnurbs/internals/arc.cc \ - libnurbs/internals/arcsorter.cc \ - libnurbs/internals/arctess.cc \ - libnurbs/internals/backend.cc \ - libnurbs/internals/basiccrveval.cc \ - libnurbs/internals/basicsurfeval.cc \ - libnurbs/internals/bin.cc \ - libnurbs/internals/bufpool.cc \ - libnurbs/internals/cachingeval.cc \ - libnurbs/internals/ccw.cc \ - libnurbs/internals/coveandtiler.cc \ - libnurbs/internals/curve.cc \ - libnurbs/internals/curvelist.cc \ - libnurbs/internals/curvesub.cc \ - libnurbs/internals/dataTransform.cc \ - libnurbs/internals/displaylist.cc \ - libnurbs/internals/flist.cc \ - libnurbs/internals/flistsorter.cc \ - libnurbs/internals/hull.cc \ - libnurbs/internals/intersect.cc \ - libnurbs/internals/knotvector.cc \ - libnurbs/internals/mapdesc.cc \ - libnurbs/internals/mapdescv.cc \ - libnurbs/internals/maplist.cc \ - libnurbs/internals/mesher.cc \ - libnurbs/internals/monoTriangulationBackend.cc \ - libnurbs/internals/monotonizer.cc \ - libnurbs/internals/mycode.cc \ - libnurbs/internals/nurbsinterfac.cc \ - libnurbs/internals/nurbstess.cc \ - libnurbs/internals/patch.cc \ - libnurbs/internals/patchlist.cc \ - libnurbs/internals/quilt.cc \ - libnurbs/internals/reader.cc \ - libnurbs/internals/renderhints.cc \ - libnurbs/internals/slicer.cc \ - libnurbs/internals/sorter.cc \ - libnurbs/internals/splitarcs.cc \ - libnurbs/internals/subdivider.cc \ - libnurbs/internals/tobezier.cc \ - libnurbs/internals/trimline.cc \ - libnurbs/internals/trimregion.cc \ - libnurbs/internals/trimvertpool.cc \ - libnurbs/internals/uarray.cc \ - libnurbs/internals/varray.cc \ - libnurbs/nurbtess/directedLine.cc \ - libnurbs/nurbtess/gridWrap.cc \ - libnurbs/nurbtess/monoChain.cc \ - libnurbs/nurbtess/monoPolyPart.cc \ - libnurbs/nurbtess/monoTriangulation.cc \ - libnurbs/nurbtess/partitionX.cc \ - libnurbs/nurbtess/partitionY.cc \ - libnurbs/nurbtess/polyDBG.cc \ - libnurbs/nurbtess/polyUtil.cc \ - libnurbs/nurbtess/primitiveStream.cc \ - libnurbs/nurbtess/quicksort.cc \ - libnurbs/nurbtess/rectBlock.cc \ - libnurbs/nurbtess/sampleComp.cc \ - libnurbs/nurbtess/sampleCompBot.cc \ - libnurbs/nurbtess/sampleCompRight.cc \ - libnurbs/nurbtess/sampleCompTop.cc \ - libnurbs/nurbtess/sampleMonoPoly.cc \ - libnurbs/nurbtess/sampledLine.cc \ - libnurbs/nurbtess/searchTree.cc - -SOURCES = $(C_SOURCES) $(CC_SOURCES) - -OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) - -.c.o: - $(CC) -o $@ $(CFLAGS) -c $< -.cc.o: - $(CXX) -o $@ $(CXXFLAGS) -c $< - -all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP) - -$(LIBDIR)/$(GLU_LIB): $(OBJECTS) - $(AR) $(ARFLAGS) $(LIBDIR)/$(GLU_LIB) $(OBJECTS) - -$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS) -ifeq ($(HAVEDXE3),) - $(warning Missing DXE3 package... Skipping $(GLU_DXE)) -else - -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -I $(LIBDIR)/$(GLU_IMP) -D "MesaGLU/SGI DJGPP" -E _glu -P gl.dxe -U $(OBJECTS) -endif - -clean: - -$(call UNLINK,libutil/*.o) - -$(call UNLINK,libtess/*.o) - -$(call UNLINK,libnurbs/interface/*.o) - -$(call UNLINK,libnurbs/internals/*.o) - -$(call UNLINK,libnurbs/nurbtess/*.o) - --include depend +# Mesa 3-D graphics library +# Version: 4.0 +# +# Copyright (C) 1999 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# DOS/DJGPP glu makefile v1.4 for Mesa +# +# Copyright (C) 2002 - Borca Daniel +# Email : dborca@yahoo.com +# Web : http://www.geocities.com/dborca + + +# +# Available options: +# +# Environment variables: +# CFLAGS +# +# Targets: +# all: build GLU +# clean: remove object files +# + + + +.PHONY: all clean + +TOP = ../../.. +LIBDIR = $(TOP)/lib +GLU_LIB = libglu.a +GLU_DXE = glu.dxe +GLU_IMP = libiglu.a + +export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR) + +CC = gcc +CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include -Iinclude +CXX = gpp +CXXFLAGS = $(CFLAGS) -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess + +AR = ar +ARFLAGS = rus + +HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe) + +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = del $(subst /,\,$(1)) +else +UNLINK = $(RM) $(1) +endif + +C_SOURCES = \ + libutil/error.c \ + libutil/glue.c \ + libutil/mipmap.c \ + libutil/project.c \ + libutil/quad.c \ + libutil/registry.c \ + libtess/dict.c \ + libtess/geom.c \ + libtess/memalloc.c \ + libtess/mesh.c \ + libtess/normal.c \ + libtess/priorityq.c \ + libtess/render.c \ + libtess/sweep.c \ + libtess/tess.c \ + libtess/tessmono.c + +CC_SOURCES = \ + libnurbs/interface/bezierEval.cc \ + libnurbs/interface/bezierPatch.cc \ + libnurbs/interface/bezierPatchMesh.cc \ + libnurbs/interface/glcurveval.cc \ + libnurbs/interface/glinterface.cc \ + libnurbs/interface/glrenderer.cc \ + libnurbs/interface/glsurfeval.cc \ + libnurbs/interface/incurveeval.cc \ + libnurbs/interface/insurfeval.cc \ + libnurbs/internals/arc.cc \ + libnurbs/internals/arcsorter.cc \ + libnurbs/internals/arctess.cc \ + libnurbs/internals/backend.cc \ + libnurbs/internals/basiccrveval.cc \ + libnurbs/internals/basicsurfeval.cc \ + libnurbs/internals/bin.cc \ + libnurbs/internals/bufpool.cc \ + libnurbs/internals/cachingeval.cc \ + libnurbs/internals/ccw.cc \ + libnurbs/internals/coveandtiler.cc \ + libnurbs/internals/curve.cc \ + libnurbs/internals/curvelist.cc \ + libnurbs/internals/curvesub.cc \ + libnurbs/internals/dataTransform.cc \ + libnurbs/internals/displaylist.cc \ + libnurbs/internals/flist.cc \ + libnurbs/internals/flistsorter.cc \ + libnurbs/internals/hull.cc \ + libnurbs/internals/intersect.cc \ + libnurbs/internals/knotvector.cc \ + libnurbs/internals/mapdesc.cc \ + libnurbs/internals/mapdescv.cc \ + libnurbs/internals/maplist.cc \ + libnurbs/internals/mesher.cc \ + libnurbs/internals/monoTriangulationBackend.cc \ + libnurbs/internals/monotonizer.cc \ + libnurbs/internals/mycode.cc \ + libnurbs/internals/nurbsinterfac.cc \ + libnurbs/internals/nurbstess.cc \ + libnurbs/internals/patch.cc \ + libnurbs/internals/patchlist.cc \ + libnurbs/internals/quilt.cc \ + libnurbs/internals/reader.cc \ + libnurbs/internals/renderhints.cc \ + libnurbs/internals/slicer.cc \ + libnurbs/internals/sorter.cc \ + libnurbs/internals/splitarcs.cc \ + libnurbs/internals/subdivider.cc \ + libnurbs/internals/tobezier.cc \ + libnurbs/internals/trimline.cc \ + libnurbs/internals/trimregion.cc \ + libnurbs/internals/trimvertpool.cc \ + libnurbs/internals/uarray.cc \ + libnurbs/internals/varray.cc \ + libnurbs/nurbtess/directedLine.cc \ + libnurbs/nurbtess/gridWrap.cc \ + libnurbs/nurbtess/monoChain.cc \ + libnurbs/nurbtess/monoPolyPart.cc \ + libnurbs/nurbtess/monoTriangulation.cc \ + libnurbs/nurbtess/partitionX.cc \ + libnurbs/nurbtess/partitionY.cc \ + libnurbs/nurbtess/polyDBG.cc \ + libnurbs/nurbtess/polyUtil.cc \ + libnurbs/nurbtess/primitiveStream.cc \ + libnurbs/nurbtess/quicksort.cc \ + libnurbs/nurbtess/rectBlock.cc \ + libnurbs/nurbtess/sampleComp.cc \ + libnurbs/nurbtess/sampleCompBot.cc \ + libnurbs/nurbtess/sampleCompRight.cc \ + libnurbs/nurbtess/sampleCompTop.cc \ + libnurbs/nurbtess/sampleMonoPoly.cc \ + libnurbs/nurbtess/sampledLine.cc \ + libnurbs/nurbtess/searchTree.cc + +SOURCES = $(C_SOURCES) $(CC_SOURCES) + +OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) + +.c.o: + $(CC) -o $@ $(CFLAGS) -c $< +.cc.o: + $(CXX) -o $@ $(CXXFLAGS) -c $< + +all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP) + +$(LIBDIR)/$(GLU_LIB): $(OBJECTS) + $(AR) $(ARFLAGS) $(LIBDIR)/$(GLU_LIB) $(OBJECTS) + +$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS) +ifeq ($(HAVEDXE3),) + $(warning Missing DXE3 package... Skipping $(GLU_DXE)) +else + -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU/SGI DJGPP" -E _glu -P gl.dxe -U $(OBJECTS) +endif + +clean: + -$(call UNLINK,libutil/*.o) + -$(call UNLINK,libtess/*.o) + -$(call UNLINK,libnurbs/interface/*.o) + -$(call UNLINK,libnurbs/internals/*.o) + -$(call UNLINK,libnurbs/nurbtess/*.o) + +-include depend diff --git a/src/glut/dos/Makefile.DJ b/src/glut/dos/Makefile.DJ index 52c347cda34..c870d23d444 100644 --- a/src/glut/dos/Makefile.DJ +++ b/src/glut/dos/Makefile.DJ @@ -1,134 +1,136 @@ -# Mesa 3-D graphics library -# Version: 4.0 -# -# Copyright (C) 1999 Brian Paul All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -# DOS/DJGPP glut makefile v1.3 for Mesa -# -# Copyright (C) 2002 - Borca Daniel -# Email : dborca@yahoo.com -# Web : http://www.geocities.com/dborca - - -# -# Available options: -# -# Environment variables: -# CFLAGS -# -# MKGLUT absolute path to original GLUT. -# default = $(TOP)/src-glut -# -# Targets: -# all: build GLUT -# clean: remove object files -# - - - -.PHONY: all clean - -TOP = .. -GLIDE ?= $(TOP)/include/glide3 -MKGLUT ?= $(TOP)/src-glut -LIBDIR = $(TOP)/lib -GLUT_LIB = libglut.a -GLUT_DXE = glut.dxe -GLUT_IMP = libiglut.a - -CC = gcc -CFLAGS += -I- -I$(TOP)/include -I. -I$(MKGLUT) -IPC_HW - -AR = ar -ARFLAGS = rus - -HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe) - -ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) -UNLINK = del $(subst /,\,$(1)) -else -UNLINK = $(RM) $(1) -endif - -CORE_SOURCES = \ - callback.c \ - color.c \ - extens.c \ - init.c \ - menu.c \ - mouse.c \ - overlay.c \ - state.c \ - window.c - -PC_HW_SOURCES = \ - PC_HW/pc_hw.c \ - PC_HW/pc_keyb.c \ - PC_HW/pc_mouse.c \ - PC_HW/pc_timer.c \ - PC_HW/pc_irq.S - -MKGLUT_SOURCES = \ - $(MKGLUT)/glut_bitmap.c \ - $(MKGLUT)/glut_bwidth.c \ - $(MKGLUT)/glut_stroke.c \ - $(MKGLUT)/glut_swidth.c \ - $(MKGLUT)/glut_shapes.c \ - $(MKGLUT)/glut_teapot.c \ - $(MKGLUT)/glut_8x13.c \ - $(MKGLUT)/glut_9x15.c \ - $(MKGLUT)/glut_hel10.c \ - $(MKGLUT)/glut_hel12.c \ - $(MKGLUT)/glut_hel18.c \ - $(MKGLUT)/glut_tr10.c \ - $(MKGLUT)/glut_tr24.c \ - $(MKGLUT)/glut_roman.c \ - $(MKGLUT)/glut_mroman.c \ - $(MKGLUT)/glut_util.c - -SOURCES = $(CORE_SOURCES) $(PC_HW_SOURCES) $(MKGLUT_SOURCES) - -OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) - -.c.o: - $(CC) -o $@ $(CFLAGS) -c $< -.S.o: - $(CC) -o $@ $(CFLAGS) -c $< -.s.o: - $(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $< - -all: $(LIBDIR)/$(GLUT_LIB) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP) - -$(LIBDIR)/$(GLUT_LIB): $(OBJECTS) - $(AR) $(ARFLAGS) $(LIBDIR)/$(GLUT_LIB) $(OBJECTS) - -$(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS) -ifeq ($(HAVEDXE3),) - $(warning Missing DXE3 package... Skipping $(GLUT_DXE)) -else - -dxe3gen -o $(LIBDIR)/$(GLUT_DXE) -I $(LIBDIR)/$(GLUT_IMP) -D "MesaGLUT DJGPP" -E _glut -P gl.dxe -P glu.dxe -U $(OBJECTS) -endif - -clean: - -$(call UNLINK,*.o) - -$(call UNLINK,PC_HW/*.o) - -$(call UNLINK,$(MKGLUT)/*.o) - --include depend +# Mesa 3-D graphics library +# Version: 4.0 +# +# Copyright (C) 1999 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# DOS/DJGPP glut makefile v1.4 for Mesa +# +# Copyright (C) 2002 - Borca Daniel +# Email : dborca@yahoo.com +# Web : http://www.geocities.com/dborca + + +# +# Available options: +# +# Environment variables: +# CFLAGS +# +# MKGLUT absolute path to original GLUT. +# default = $(TOP)/src-glut +# +# Targets: +# all: build GLUT +# clean: remove object files +# + + + +.PHONY: all clean + +TOP = ../../.. +GLIDE ?= $(TOP)/include/glide3 +MKGLUT ?= $(TOP)/src/glut/glx +LIBDIR = $(TOP)/lib +GLUT_LIB = libglut.a +GLUT_DXE = glut.dxe +GLUT_IMP = libiglut.a + +export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR) + +CC = gcc +CFLAGS += -I- -I$(TOP)/include -I. -I$(MKGLUT) -IPC_HW + +AR = ar +ARFLAGS = rus + +HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe) + +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = del $(subst /,\,$(1)) +else +UNLINK = $(RM) $(1) +endif + +CORE_SOURCES = \ + callback.c \ + color.c \ + extens.c \ + init.c \ + menu.c \ + mouse.c \ + overlay.c \ + state.c \ + window.c + +PC_HW_SOURCES = \ + PC_HW/pc_hw.c \ + PC_HW/pc_keyb.c \ + PC_HW/pc_mouse.c \ + PC_HW/pc_timer.c \ + PC_HW/pc_irq.S + +MKGLUT_SOURCES = \ + $(MKGLUT)/glut_bitmap.c \ + $(MKGLUT)/glut_bwidth.c \ + $(MKGLUT)/glut_stroke.c \ + $(MKGLUT)/glut_swidth.c \ + $(MKGLUT)/glut_shapes.c \ + $(MKGLUT)/glut_teapot.c \ + $(MKGLUT)/glut_8x13.c \ + $(MKGLUT)/glut_9x15.c \ + $(MKGLUT)/glut_hel10.c \ + $(MKGLUT)/glut_hel12.c \ + $(MKGLUT)/glut_hel18.c \ + $(MKGLUT)/glut_tr10.c \ + $(MKGLUT)/glut_tr24.c \ + $(MKGLUT)/glut_roman.c \ + $(MKGLUT)/glut_mroman.c \ + $(MKGLUT)/glut_util.c + +SOURCES = $(CORE_SOURCES) $(PC_HW_SOURCES) $(MKGLUT_SOURCES) + +OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) + +.c.o: + $(CC) -o $@ $(CFLAGS) -c $< +.S.o: + $(CC) -o $@ $(CFLAGS) -c $< +.s.o: + $(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $< + +all: $(LIBDIR)/$(GLUT_LIB) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP) + +$(LIBDIR)/$(GLUT_LIB): $(OBJECTS) + $(AR) $(ARFLAGS) $(LIBDIR)/$(GLUT_LIB) $(OBJECTS) + +$(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS) +ifeq ($(HAVEDXE3),) + $(warning Missing DXE3 package... Skipping $(GLUT_DXE)) +else + -dxe3gen -o $(LIBDIR)/$(GLUT_DXE) -Y $(LIBDIR)/$(GLUT_IMP) -D "MesaGLUT DJGPP" -E _glut -P gl.dxe -P glu.dxe -U $(OBJECTS) +endif + +clean: + -$(call UNLINK,*.o) + -$(call UNLINK,PC_HW/*.o) + -$(call UNLINK,$(MKGLUT)/*.o) + +-include depend diff --git a/src/glut/dos/PC_HW/pc_hw.c b/src/glut/dos/PC_HW/pc_hw.c index f08286d4c49..b1fd84bdb67 100644 --- a/src/glut/dos/PC_HW/pc_hw.c +++ b/src/glut/dos/PC_HW/pc_hw.c @@ -1,145 +1,145 @@ -/* - * PC/HW routine collection v1.3 for DOS/DJGPP - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include -#include -#include /* for mode definitions */ -#include -#include -#include - -#include "pc_hw.h" - -/* - * atexit - */ -#define MAX_ATEXIT 32 - -static volatile int atexitcnt; -static VFUNC atexittbl[MAX_ATEXIT]; - -static void __attribute__((destructor)) doexit (void) -{ - while (atexitcnt) atexittbl[--atexitcnt](); -} - -int pc_clexit (VFUNC f) -{ - int i; - - for (i=0;i 0) { - h_outbak = dup(STDOUT_FILENO); - fflush(stdout); - dup2(h_out, STDOUT_FILENO); - } - - return h_out; -} - -void pc_close_stdout (void) -{ - FILE *f; - char *line = alloca(512); - - if (h_out > 0) { - dup2(h_outbak, STDOUT_FILENO); - close(h_out); - close(h_outbak); - - f = fopen(outname, "rt"); - while (fgets(line, 512, f)) { - fputs(line, stdout); - } - fclose(f); - - remove(outname); - } -} - -int pc_open_stderr (void) -{ - tmpnam(errname); - - if ((h_err=open(errname, O_WRONLY | O_CREAT | O_TEXT | O_TRUNC, S_IREAD | S_IWRITE)) > 0) { - h_errbak = dup(STDERR_FILENO); - fflush(stderr); - dup2(h_err, STDERR_FILENO); - } - - return h_err; -} - -void pc_close_stderr (void) -{ - FILE *f; - char *line = alloca(512); - - if (h_err > 0) { - dup2(h_errbak, STDERR_FILENO); - close(h_err); - close(h_errbak); - - f = fopen(errname, "rt"); - while (fgets(line, 512, f)) { - fputs(line, stderr); - } - fclose(f); - - remove(errname); - } -} +/* + * PC/HW routine collection v1.3 for DOS/DJGPP + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include +#include +#include /* for mode definitions */ +#include +#include +#include + +#include "pc_hw.h" + +/* + * atexit + */ +#define MAX_ATEXIT 32 + +static volatile int atexitcnt; +static VFUNC atexittbl[MAX_ATEXIT]; + +static void __attribute__((destructor)) doexit (void) +{ + while (atexitcnt) atexittbl[--atexitcnt](); +} + +int pc_clexit (VFUNC f) +{ + int i; + + for (i=0;i 0) { + h_outbak = dup(STDOUT_FILENO); + fflush(stdout); + dup2(h_out, STDOUT_FILENO); + } + + return h_out; +} + +void pc_close_stdout (void) +{ + FILE *f; + char *line = alloca(512); + + if (h_out > 0) { + dup2(h_outbak, STDOUT_FILENO); + close(h_out); + close(h_outbak); + + f = fopen(outname, "rt"); + while (fgets(line, 512, f)) { + fputs(line, stdout); + } + fclose(f); + + remove(outname); + } +} + +int pc_open_stderr (void) +{ + tmpnam(errname); + + if ((h_err=open(errname, O_WRONLY | O_CREAT | O_TEXT | O_TRUNC, S_IREAD | S_IWRITE)) > 0) { + h_errbak = dup(STDERR_FILENO); + fflush(stderr); + dup2(h_err, STDERR_FILENO); + } + + return h_err; +} + +void pc_close_stderr (void) +{ + FILE *f; + char *line = alloca(512); + + if (h_err > 0) { + dup2(h_errbak, STDERR_FILENO); + close(h_err); + close(h_errbak); + + f = fopen(errname, "rt"); + while (fgets(line, 512, f)) { + fputs(line, stderr); + } + fclose(f); + + remove(errname); + } +} diff --git a/src/glut/dos/PC_HW/pc_hw.h b/src/glut/dos/PC_HW/pc_hw.h index c029005b53c..26bb8ba17df 100644 --- a/src/glut/dos/PC_HW/pc_hw.h +++ b/src/glut/dos/PC_HW/pc_hw.h @@ -1,225 +1,225 @@ -/* - * PC/HW routine collection v1.3 for DOS/DJGPP - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef PC_HW_H_included -#define PC_HW_H_included - -#include -#include - -/* - * misc C definitions - */ -#define FALSE 0 -#define TRUE !FALSE - -#define MIN(x,y) (((x) < (y)) ? (x) : (y)) -#define MAX(x,y) (((x) > (y)) ? (x) : (y)) -#define MID(x,y,z) MAX((x), MIN((y), (z))) - -typedef void (*VFUNC) (void); -typedef void (*PFUNC) (void *); -typedef void (*MFUNC) (int x, int y, int z, int b); - -/* - * atexit - */ -int pc_atexit (VFUNC f); -int pc_clexit (VFUNC f); - -/* - * locked memory - */ -#define ENDOFUNC(x) static void x##_end() { } -#define LOCKFUNC(x) _go32_dpmi_lock_code((void *)x, (long)x##_end - (long)x) -#define LOCKDATA(x) _go32_dpmi_lock_data((void *)&x, sizeof(x)) -#define LOCKBUFF(x, l) _go32_dpmi_lock_data((void *)x, l) - -void *pc_malloc (size_t size); - -/* - * IRQ - */ -#define ENABLE() __asm __volatile ("sti") -#define DISABLE() __asm __volatile ("cli") - -extern int pc_install_irq (int i, int (*handler) ()); -extern int pc_remove_irq (int i); - -/* - * keyboard - */ -#define KB_SHIFT_FLAG 0x0001 -#define KB_CTRL_FLAG 0x0002 -#define KB_ALT_FLAG 0x0004 -#define KB_LWIN_FLAG 0x0008 -#define KB_RWIN_FLAG 0x0010 -#define KB_MENU_FLAG 0x0020 -#define KB_SCROLOCK_FLAG 0x0100 -#define KB_NUMLOCK_FLAG 0x0200 -#define KB_CAPSLOCK_FLAG 0x0400 -#define KB_INALTSEQ_FLAG 0x0800 -#define KB_ACCENT1_FLAG 0x1000 -#define KB_ACCENT2_FLAG 0x2000 -#define KB_ACCENT3_FLAG 0x4000 -#define KB_ACCENT4_FLAG 0x8000 - -#define KEY_A 1 -#define KEY_B 2 -#define KEY_C 3 -#define KEY_D 4 -#define KEY_E 5 -#define KEY_F 6 -#define KEY_G 7 -#define KEY_H 8 -#define KEY_I 9 -#define KEY_J 10 -#define KEY_K 11 -#define KEY_L 12 -#define KEY_M 13 -#define KEY_N 14 -#define KEY_O 15 -#define KEY_P 16 -#define KEY_Q 17 -#define KEY_R 18 -#define KEY_S 19 -#define KEY_T 20 -#define KEY_U 21 -#define KEY_V 22 -#define KEY_W 23 -#define KEY_X 24 -#define KEY_Y 25 -#define KEY_Z 26 -#define KEY_0 27 -#define KEY_1 28 -#define KEY_2 29 -#define KEY_3 30 -#define KEY_4 31 -#define KEY_5 32 -#define KEY_6 33 -#define KEY_7 34 -#define KEY_8 35 -#define KEY_9 36 -#define KEY_0_PAD 37 -#define KEY_1_PAD 38 -#define KEY_2_PAD 39 -#define KEY_3_PAD 40 -#define KEY_4_PAD 41 -#define KEY_5_PAD 42 -#define KEY_6_PAD 43 -#define KEY_7_PAD 44 -#define KEY_8_PAD 45 -#define KEY_9_PAD 46 -#define KEY_F1 47 -#define KEY_F2 48 -#define KEY_F3 49 -#define KEY_F4 50 -#define KEY_F5 51 -#define KEY_F6 52 -#define KEY_F7 53 -#define KEY_F8 54 -#define KEY_F9 55 -#define KEY_F10 56 -#define KEY_F11 57 -#define KEY_F12 58 -#define KEY_ESC 59 -#define KEY_TILDE 60 -#define KEY_MINUS 61 -#define KEY_EQUALS 62 -#define KEY_BACKSPACE 63 -#define KEY_TAB 64 -#define KEY_OPENBRACE 65 -#define KEY_CLOSEBRACE 66 -#define KEY_ENTER 67 -#define KEY_COLON 68 -#define KEY_QUOTE 69 -#define KEY_BACKSLASH 70 -#define KEY_BACKSLASH2 71 -#define KEY_COMMA 72 -#define KEY_STOP 73 -#define KEY_SLASH 74 -#define KEY_SPACE 75 -#define KEY_INSERT 76 -#define KEY_DEL 77 -#define KEY_HOME 78 -#define KEY_END 79 -#define KEY_PGUP 80 -#define KEY_PGDN 81 -#define KEY_LEFT 82 -#define KEY_RIGHT 83 -#define KEY_UP 84 -#define KEY_DOWN 85 -#define KEY_SLASH_PAD 86 -#define KEY_ASTERISK 87 -#define KEY_MINUS_PAD 88 -#define KEY_PLUS_PAD 89 -#define KEY_DEL_PAD 90 -#define KEY_ENTER_PAD 91 -#define KEY_PRTSCR 92 -#define KEY_PAUSE 93 -#define KEY_ABNT_C1 94 -#define KEY_YEN 95 -#define KEY_KANA 96 -#define KEY_CONVERT 97 -#define KEY_NOCONVERT 98 -#define KEY_AT 99 -#define KEY_CIRCUMFLEX 100 -#define KEY_COLON2 101 -#define KEY_KANJI 102 - -#define KEY_MODIFIERS 103 - -#define KEY_LSHIFT 103 -#define KEY_RSHIFT 104 -#define KEY_LCONTROL 105 -#define KEY_RCONTROL 106 -#define KEY_ALT 107 -#define KEY_ALTGR 108 -#define KEY_LWIN 109 -#define KEY_RWIN 110 -#define KEY_MENU 111 -#define KEY_SCRLOCK 112 -#define KEY_NUMLOCK 113 -#define KEY_CAPSLOCK 114 - -#define KEY_MAX 115 - -int pc_install_keyb (void); -void pc_remove_keyb (void); -int pc_keypressed (void); -int pc_readkey (void); -int pc_keydown (int code); -int pc_keyshifts (void); - -/* - * timer - */ -int pc_install_int (PFUNC func, void *parm, unsigned int freq); -void pc_remove_timer (void); - -/* - * mouse - */ -int pc_install_mouse (void); -void pc_remove_mouse (void); -MFUNC pc_install_mouse_handler (MFUNC handler); -void pc_mouse_area (int x1, int y1, int x2, int y2); -void pc_mouse_speed (int xspeed, int yspeed); -int pc_query_mouse (int *x, int *y, int *z); -void pc_warp_mouse (int x, int y); - -/* - * standard redirection - */ -int pc_open_stdout (void); -int pc_open_stderr (void); -void pc_close_stdout (void); -void pc_close_stderr (void); - -#endif +/* + * PC/HW routine collection v1.3 for DOS/DJGPP + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef PC_HW_H_included +#define PC_HW_H_included + +#include +#include + +/* + * misc C definitions + */ +#define FALSE 0 +#define TRUE !FALSE + +#define MIN(x,y) (((x) < (y)) ? (x) : (y)) +#define MAX(x,y) (((x) > (y)) ? (x) : (y)) +#define MID(x,y,z) MAX((x), MIN((y), (z))) + +typedef void (*VFUNC) (void); +typedef void (*PFUNC) (void *); +typedef void (*MFUNC) (int x, int y, int z, int b); + +/* + * atexit + */ +int pc_atexit (VFUNC f); +int pc_clexit (VFUNC f); + +/* + * locked memory + */ +#define ENDOFUNC(x) static void x##_end() { } +#define LOCKFUNC(x) _go32_dpmi_lock_code((void *)x, (long)x##_end - (long)x) +#define LOCKDATA(x) _go32_dpmi_lock_data((void *)&x, sizeof(x)) +#define LOCKBUFF(x, l) _go32_dpmi_lock_data((void *)x, l) + +void *pc_malloc (size_t size); + +/* + * IRQ + */ +#define ENABLE() __asm __volatile ("sti") +#define DISABLE() __asm __volatile ("cli") + +extern int pc_install_irq (int i, int (*handler) ()); +extern int pc_remove_irq (int i); + +/* + * keyboard + */ +#define KB_SHIFT_FLAG 0x0001 +#define KB_CTRL_FLAG 0x0002 +#define KB_ALT_FLAG 0x0004 +#define KB_LWIN_FLAG 0x0008 +#define KB_RWIN_FLAG 0x0010 +#define KB_MENU_FLAG 0x0020 +#define KB_SCROLOCK_FLAG 0x0100 +#define KB_NUMLOCK_FLAG 0x0200 +#define KB_CAPSLOCK_FLAG 0x0400 +#define KB_INALTSEQ_FLAG 0x0800 +#define KB_ACCENT1_FLAG 0x1000 +#define KB_ACCENT2_FLAG 0x2000 +#define KB_ACCENT3_FLAG 0x4000 +#define KB_ACCENT4_FLAG 0x8000 + +#define KEY_A 1 +#define KEY_B 2 +#define KEY_C 3 +#define KEY_D 4 +#define KEY_E 5 +#define KEY_F 6 +#define KEY_G 7 +#define KEY_H 8 +#define KEY_I 9 +#define KEY_J 10 +#define KEY_K 11 +#define KEY_L 12 +#define KEY_M 13 +#define KEY_N 14 +#define KEY_O 15 +#define KEY_P 16 +#define KEY_Q 17 +#define KEY_R 18 +#define KEY_S 19 +#define KEY_T 20 +#define KEY_U 21 +#define KEY_V 22 +#define KEY_W 23 +#define KEY_X 24 +#define KEY_Y 25 +#define KEY_Z 26 +#define KEY_0 27 +#define KEY_1 28 +#define KEY_2 29 +#define KEY_3 30 +#define KEY_4 31 +#define KEY_5 32 +#define KEY_6 33 +#define KEY_7 34 +#define KEY_8 35 +#define KEY_9 36 +#define KEY_0_PAD 37 +#define KEY_1_PAD 38 +#define KEY_2_PAD 39 +#define KEY_3_PAD 40 +#define KEY_4_PAD 41 +#define KEY_5_PAD 42 +#define KEY_6_PAD 43 +#define KEY_7_PAD 44 +#define KEY_8_PAD 45 +#define KEY_9_PAD 46 +#define KEY_F1 47 +#define KEY_F2 48 +#define KEY_F3 49 +#define KEY_F4 50 +#define KEY_F5 51 +#define KEY_F6 52 +#define KEY_F7 53 +#define KEY_F8 54 +#define KEY_F9 55 +#define KEY_F10 56 +#define KEY_F11 57 +#define KEY_F12 58 +#define KEY_ESC 59 +#define KEY_TILDE 60 +#define KEY_MINUS 61 +#define KEY_EQUALS 62 +#define KEY_BACKSPACE 63 +#define KEY_TAB 64 +#define KEY_OPENBRACE 65 +#define KEY_CLOSEBRACE 66 +#define KEY_ENTER 67 +#define KEY_COLON 68 +#define KEY_QUOTE 69 +#define KEY_BACKSLASH 70 +#define KEY_BACKSLASH2 71 +#define KEY_COMMA 72 +#define KEY_STOP 73 +#define KEY_SLASH 74 +#define KEY_SPACE 75 +#define KEY_INSERT 76 +#define KEY_DEL 77 +#define KEY_HOME 78 +#define KEY_END 79 +#define KEY_PGUP 80 +#define KEY_PGDN 81 +#define KEY_LEFT 82 +#define KEY_RIGHT 83 +#define KEY_UP 84 +#define KEY_DOWN 85 +#define KEY_SLASH_PAD 86 +#define KEY_ASTERISK 87 +#define KEY_MINUS_PAD 88 +#define KEY_PLUS_PAD 89 +#define KEY_DEL_PAD 90 +#define KEY_ENTER_PAD 91 +#define KEY_PRTSCR 92 +#define KEY_PAUSE 93 +#define KEY_ABNT_C1 94 +#define KEY_YEN 95 +#define KEY_KANA 96 +#define KEY_CONVERT 97 +#define KEY_NOCONVERT 98 +#define KEY_AT 99 +#define KEY_CIRCUMFLEX 100 +#define KEY_COLON2 101 +#define KEY_KANJI 102 + +#define KEY_MODIFIERS 103 + +#define KEY_LSHIFT 103 +#define KEY_RSHIFT 104 +#define KEY_LCONTROL 105 +#define KEY_RCONTROL 106 +#define KEY_ALT 107 +#define KEY_ALTGR 108 +#define KEY_LWIN 109 +#define KEY_RWIN 110 +#define KEY_MENU 111 +#define KEY_SCRLOCK 112 +#define KEY_NUMLOCK 113 +#define KEY_CAPSLOCK 114 + +#define KEY_MAX 115 + +int pc_install_keyb (void); +void pc_remove_keyb (void); +int pc_keypressed (void); +int pc_readkey (void); +int pc_keydown (int code); +int pc_keyshifts (void); + +/* + * timer + */ +int pc_install_int (PFUNC func, void *parm, unsigned int freq); +void pc_remove_timer (void); + +/* + * mouse + */ +int pc_install_mouse (void); +void pc_remove_mouse (void); +MFUNC pc_install_mouse_handler (MFUNC handler); +void pc_mouse_area (int x1, int y1, int x2, int y2); +void pc_mouse_speed (int xspeed, int yspeed); +int pc_query_mouse (int *x, int *y, int *z); +void pc_warp_mouse (int x, int y); + +/* + * standard redirection + */ +int pc_open_stdout (void); +int pc_open_stderr (void); +void pc_close_stdout (void); +void pc_close_stderr (void); + +#endif diff --git a/src/glut/dos/PC_HW/pc_irq.S b/src/glut/dos/PC_HW/pc_irq.S index 7f0b747d342..6d99bd805ee 100644 --- a/src/glut/dos/PC_HW/pc_irq.S +++ b/src/glut/dos/PC_HW/pc_irq.S @@ -1,182 +1,182 @@ -/* - * PC/HW routine collection v1.3 for DOS/DJGPP - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - - .file "pc_irq.S" - - .text - -#define IRQ_STACK_SIZE 16384 - -#define IRQ_WRAPPER_LEN (__irq_wrapper_1-__irq_wrapper_0) -#define IRQ_OLD (__irq_old_0-__irq_wrapper_0) -#define IRQ_HOOK (__irq_hook_0-__irq_wrapper_0) -#define IRQ_STACK (__irq_stack_0-__irq_wrapper_0) - - .balign 4 -common: - movw $0x0400, %ax - int $0x31 - - movl %ss:8(%ebp), %ebx - cmpl $15, %ebx - jbe 0f - fail: - orl $-1, %eax - popl %edi - popl %ebx - leave - ret - - 0: - movl %ebx, %edi - imull $IRQ_WRAPPER_LEN, %edi - addl $__irq_wrapper_0, %edi - - cmpb $7, %bl - jbe 1f - movb %dl, %dh - subb $8, %dh - 1: - addb %dh, %bl - ret - - .balign 4 - .global _pc_install_irq -_pc_install_irq: - pushl %ebp - movl %esp, %ebp - pushl %ebx - pushl %edi - - call common - - cmpl $0, IRQ_HOOK(%edi) - jne fail - - pushl $IRQ_WRAPPER_LEN - pushl %edi - call __go32_dpmi_lock_code - addl $8, %esp - testl %eax, %eax - jnz fail - - pushl $IRQ_STACK_SIZE - call _pc_malloc - popl %edx - testl %eax, %eax - jz fail - addl %edx, %eax - movl %eax, IRQ_STACK(%edi) - - movl ___djgpp_ds_alias, %eax - movl %eax, IRQ_STACK+4(%edi) - - movl %ss:12(%ebp), %eax - movl %eax, IRQ_HOOK(%edi) - - movw $0x0204, %ax - int $0x31 - movl %edx, IRQ_OLD(%edi) - movw %cx, IRQ_OLD+4(%edi) - movw $0x0205, %ax - movl %edi, %edx - movl %cs, %ecx - int $0x31 - - done: - xorl %eax, %eax - popl %edi - popl %ebx - leave - ret - - .balign 4 - .global _pc_remove_irq -_pc_remove_irq: - pushl %ebp - movl %esp, %ebp - pushl %ebx - pushl %edi - - call common - - cmpl $0, IRQ_HOOK(%edi) - je fail - - movl $0, IRQ_HOOK(%edi) - - movw $0x0205, %ax - movl IRQ_OLD(%edi), %edx - movl IRQ_OLD+4(%edi), %ecx - int $0x31 - - movl IRQ_STACK(%edi), %eax - subl $IRQ_STACK_SIZE, %eax - pushl %eax - call _free - popl %eax - - jmp done - -#define WRAPPER(x) ; \ - .balign 4 ; \ -__irq_wrapper_##x: ; \ - pushal ; \ - pushl %ds ; \ - pushl %es ; \ - pushl %fs ; \ - pushl %gs ; \ - movl %ss, %ebx ; \ - movl %esp, %esi ; \ - lss %cs:__irq_stack_##x, %esp ; \ - pushl %ss ; \ - pushl %ss ; \ - popl %es ; \ - popl %ds ; \ - movl ___djgpp_dos_sel, %fs ; \ - pushl %fs ; \ - popl %gs ; \ - call *__irq_hook_##x ; \ - movl %ebx, %ss ; \ - movl %esi, %esp ; \ - testl %eax, %eax ; \ - popl %gs ; \ - popl %fs ; \ - popl %es ; \ - popl %ds ; \ - popal ; \ - jz __irq_ignore_##x ; \ -__irq_bypass_##x: ; \ - ljmp *%cs:__irq_old_##x ; \ -__irq_ignore_##x: ; \ - iret ; \ - .balign 4 ; \ -__irq_old_##x: ; \ - .long 0, 0 ; \ -__irq_hook_##x: ; \ - .long 0 ; \ -__irq_stack_##x: ; \ - .long 0, 0 - - WRAPPER(0); - WRAPPER(1); - WRAPPER(2); - WRAPPER(3); - WRAPPER(4); - WRAPPER(5); - WRAPPER(6); - WRAPPER(7); - WRAPPER(8); - WRAPPER(9); - WRAPPER(10); - WRAPPER(11); - WRAPPER(12); - WRAPPER(13); - WRAPPER(14); - WRAPPER(15); +/* + * PC/HW routine collection v1.3 for DOS/DJGPP + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + + .file "pc_irq.S" + + .text + +#define IRQ_STACK_SIZE 16384 + +#define IRQ_WRAPPER_LEN (__irq_wrapper_1-__irq_wrapper_0) +#define IRQ_OLD (__irq_old_0-__irq_wrapper_0) +#define IRQ_HOOK (__irq_hook_0-__irq_wrapper_0) +#define IRQ_STACK (__irq_stack_0-__irq_wrapper_0) + + .balign 4 +common: + movw $0x0400, %ax + int $0x31 + + movl %ss:8(%ebp), %ebx + cmpl $15, %ebx + jbe 0f + fail: + orl $-1, %eax + popl %edi + popl %ebx + leave + ret + + 0: + movl %ebx, %edi + imull $IRQ_WRAPPER_LEN, %edi + addl $__irq_wrapper_0, %edi + + cmpb $7, %bl + jbe 1f + movb %dl, %dh + subb $8, %dh + 1: + addb %dh, %bl + ret + + .balign 4 + .global _pc_install_irq +_pc_install_irq: + pushl %ebp + movl %esp, %ebp + pushl %ebx + pushl %edi + + call common + + cmpl $0, IRQ_HOOK(%edi) + jne fail + + pushl $IRQ_WRAPPER_LEN + pushl %edi + call __go32_dpmi_lock_code + addl $8, %esp + testl %eax, %eax + jnz fail + + pushl $IRQ_STACK_SIZE + call _pc_malloc + popl %edx + testl %eax, %eax + jz fail + addl %edx, %eax + movl %eax, IRQ_STACK(%edi) + + movl ___djgpp_ds_alias, %eax + movl %eax, IRQ_STACK+4(%edi) + + movl %ss:12(%ebp), %eax + movl %eax, IRQ_HOOK(%edi) + + movw $0x0204, %ax + int $0x31 + movl %edx, IRQ_OLD(%edi) + movw %cx, IRQ_OLD+4(%edi) + movw $0x0205, %ax + movl %edi, %edx + movl %cs, %ecx + int $0x31 + + done: + xorl %eax, %eax + popl %edi + popl %ebx + leave + ret + + .balign 4 + .global _pc_remove_irq +_pc_remove_irq: + pushl %ebp + movl %esp, %ebp + pushl %ebx + pushl %edi + + call common + + cmpl $0, IRQ_HOOK(%edi) + je fail + + movl $0, IRQ_HOOK(%edi) + + movw $0x0205, %ax + movl IRQ_OLD(%edi), %edx + movl IRQ_OLD+4(%edi), %ecx + int $0x31 + + movl IRQ_STACK(%edi), %eax + subl $IRQ_STACK_SIZE, %eax + pushl %eax + call _free + popl %eax + + jmp done + +#define WRAPPER(x) ; \ + .balign 4 ; \ +__irq_wrapper_##x: ; \ + pushal ; \ + pushl %ds ; \ + pushl %es ; \ + pushl %fs ; \ + pushl %gs ; \ + movl %ss, %ebx ; \ + movl %esp, %esi ; \ + lss %cs:__irq_stack_##x, %esp ; \ + pushl %ss ; \ + pushl %ss ; \ + popl %es ; \ + popl %ds ; \ + movl ___djgpp_dos_sel, %fs ; \ + pushl %fs ; \ + popl %gs ; \ + call *__irq_hook_##x ; \ + movl %ebx, %ss ; \ + movl %esi, %esp ; \ + testl %eax, %eax ; \ + popl %gs ; \ + popl %fs ; \ + popl %es ; \ + popl %ds ; \ + popal ; \ + jz __irq_ignore_##x ; \ +__irq_bypass_##x: ; \ + ljmp *%cs:__irq_old_##x ; \ +__irq_ignore_##x: ; \ + iret ; \ + .balign 4 ; \ +__irq_old_##x: ; \ + .long 0, 0 ; \ +__irq_hook_##x: ; \ + .long 0 ; \ +__irq_stack_##x: ; \ + .long 0, 0 + + WRAPPER(0); + WRAPPER(1); + WRAPPER(2); + WRAPPER(3); + WRAPPER(4); + WRAPPER(5); + WRAPPER(6); + WRAPPER(7); + WRAPPER(8); + WRAPPER(9); + WRAPPER(10); + WRAPPER(11); + WRAPPER(12); + WRAPPER(13); + WRAPPER(14); + WRAPPER(15); diff --git a/src/glut/dos/PC_HW/pc_keyb.c b/src/glut/dos/PC_HW/pc_keyb.c index ec509c2ace7..d3c87bc5bde 100644 --- a/src/glut/dos/PC_HW/pc_keyb.c +++ b/src/glut/dos/PC_HW/pc_keyb.c @@ -1,542 +1,542 @@ -/* - * PC/HW routine collection v1.3 for DOS/DJGPP - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include -#include -#include - -#include "pc_hw.h" - - - -#define KEYB_IRQ 1 - -#define KEY_BUFFER_SIZE 64 - -#define KB_MODIFIERS (KB_SHIFT_FLAG | KB_CTRL_FLAG | KB_ALT_FLAG | KB_LWIN_FLAG | KB_RWIN_FLAG | KB_MENU_FLAG) -#define KB_LED_FLAGS (KB_SCROLOCK_FLAG | KB_NUMLOCK_FLAG | KB_CAPSLOCK_FLAG) - -static int keyboard_installed; - -static volatile struct { - volatile int start, end; - volatile int key[KEY_BUFFER_SIZE]; -} key_buffer; - -static volatile int key_enhanced, key_pause_loop, key_shifts; -static int leds_ok = TRUE; -static int in_a_terrupt = FALSE; -static volatile char pc_key[KEY_MAX]; - - - -/* convert Allegro format scancodes into key_shifts flag bits */ -static unsigned short modifier_table[KEY_MAX - KEY_MODIFIERS] = -{ - KB_SHIFT_FLAG, KB_SHIFT_FLAG, KB_CTRL_FLAG, - KB_CTRL_FLAG, KB_ALT_FLAG, KB_ALT_FLAG, - KB_LWIN_FLAG, KB_RWIN_FLAG, KB_MENU_FLAG, - KB_SCROLOCK_FLAG, KB_NUMLOCK_FLAG, KB_CAPSLOCK_FLAG -}; - - - -/* lookup table for converting hardware scancodes into Allegro format */ -static unsigned char hw_to_mycode[128] = -{ - /* 0x00 */ 0, KEY_ESC, KEY_1, KEY_2, - /* 0x04 */ KEY_3, KEY_4, KEY_5, KEY_6, - /* 0x08 */ KEY_7, KEY_8, KEY_9, KEY_0, - /* 0x0C */ KEY_MINUS, KEY_EQUALS, KEY_BACKSPACE, KEY_TAB, - /* 0x10 */ KEY_Q, KEY_W, KEY_E, KEY_R, - /* 0x14 */ KEY_T, KEY_Y, KEY_U, KEY_I, - /* 0x18 */ KEY_O, KEY_P, KEY_OPENBRACE, KEY_CLOSEBRACE, - /* 0x1C */ KEY_ENTER, KEY_LCONTROL, KEY_A, KEY_S, - /* 0x20 */ KEY_D, KEY_F, KEY_G, KEY_H, - /* 0x24 */ KEY_J, KEY_K, KEY_L, KEY_COLON, - /* 0x28 */ KEY_QUOTE, KEY_TILDE, KEY_LSHIFT, KEY_BACKSLASH, - /* 0x2C */ KEY_Z, KEY_X, KEY_C, KEY_V, - /* 0x30 */ KEY_B, KEY_N, KEY_M, KEY_COMMA, - /* 0x34 */ KEY_STOP, KEY_SLASH, KEY_RSHIFT, KEY_ASTERISK, - /* 0x38 */ KEY_ALT, KEY_SPACE, KEY_CAPSLOCK, KEY_F1, - /* 0x3C */ KEY_F2, KEY_F3, KEY_F4, KEY_F5, - /* 0x40 */ KEY_F6, KEY_F7, KEY_F8, KEY_F9, - /* 0x44 */ KEY_F10, KEY_NUMLOCK, KEY_SCRLOCK, KEY_7_PAD, - /* 0x48 */ KEY_8_PAD, KEY_9_PAD, KEY_MINUS_PAD, KEY_4_PAD, - /* 0x4C */ KEY_5_PAD, KEY_6_PAD, KEY_PLUS_PAD, KEY_1_PAD, - /* 0x50 */ KEY_2_PAD, KEY_3_PAD, KEY_0_PAD, KEY_DEL_PAD, - /* 0x54 */ KEY_PRTSCR, 0, KEY_BACKSLASH2, KEY_F11, - /* 0x58 */ KEY_F12, 0, 0, KEY_LWIN, - /* 0x5C */ KEY_RWIN, KEY_MENU, 0, 0, - /* 0x60 */ 0, 0, 0, 0, - /* 0x64 */ 0, 0, 0, 0, - /* 0x68 */ 0, 0, 0, 0, - /* 0x6C */ 0, 0, 0, 0, - /* 0x70 */ KEY_KANA, 0, 0, KEY_ABNT_C1, - /* 0x74 */ 0, 0, 0, 0, - /* 0x78 */ 0, KEY_CONVERT, 0, KEY_NOCONVERT, - /* 0x7C */ 0, KEY_YEN, 0, 0 -}; - - - -/* lookup table for converting extended hardware codes into Allegro format */ -static unsigned char hw_to_mycode_ex[128] = -{ - /* 0x00 */ 0, KEY_ESC, KEY_1, KEY_2, - /* 0x04 */ KEY_3, KEY_4, KEY_5, KEY_6, - /* 0x08 */ KEY_7, KEY_8, KEY_9, KEY_0, - /* 0x0C */ KEY_MINUS, KEY_EQUALS, KEY_BACKSPACE, KEY_TAB, - /* 0x10 */ KEY_CIRCUMFLEX, KEY_AT, KEY_COLON2, KEY_R, - /* 0x14 */ KEY_KANJI, KEY_Y, KEY_U, KEY_I, - /* 0x18 */ KEY_O, KEY_P, KEY_OPENBRACE, KEY_CLOSEBRACE, - /* 0x1C */ KEY_ENTER_PAD, KEY_RCONTROL, KEY_A, KEY_S, - /* 0x20 */ KEY_D, KEY_F, KEY_G, KEY_H, - /* 0x24 */ KEY_J, KEY_K, KEY_L, KEY_COLON, - /* 0x28 */ KEY_QUOTE, KEY_TILDE, 0, KEY_BACKSLASH, - /* 0x2C */ KEY_Z, KEY_X, KEY_C, KEY_V, - /* 0x30 */ KEY_B, KEY_N, KEY_M, KEY_COMMA, - /* 0x34 */ KEY_STOP, KEY_SLASH_PAD, 0, KEY_PRTSCR, - /* 0x38 */ KEY_ALTGR, KEY_SPACE, KEY_CAPSLOCK, KEY_F1, - /* 0x3C */ KEY_F2, KEY_F3, KEY_F4, KEY_F5, - /* 0x40 */ KEY_F6, KEY_F7, KEY_F8, KEY_F9, - /* 0x44 */ KEY_F10, KEY_NUMLOCK, KEY_PAUSE, KEY_HOME, - /* 0x48 */ KEY_UP, KEY_PGUP, KEY_MINUS_PAD, KEY_LEFT, - /* 0x4C */ KEY_5_PAD, KEY_RIGHT, KEY_PLUS_PAD, KEY_END, - /* 0x50 */ KEY_DOWN, KEY_PGDN, KEY_INSERT, KEY_DEL, - /* 0x54 */ KEY_PRTSCR, 0, KEY_BACKSLASH2, KEY_F11, - /* 0x58 */ KEY_F12, 0, 0, KEY_LWIN, - /* 0x5C */ KEY_RWIN, KEY_MENU, 0, 0, - /* 0x60 */ 0, 0, 0, 0, - /* 0x64 */ 0, 0, 0, 0, - /* 0x68 */ 0, 0, 0, 0, - /* 0x6C */ 0, 0, 0, 0, - /* 0x70 */ 0, 0, 0, 0, - /* 0x74 */ 0, 0, 0, 0, - /* 0x78 */ 0, 0, 0, 0, - /* 0x7C */ 0, 0, 0, 0 -}; - - - -/* default mapping table for the US keyboard layout */ -static unsigned short standard_key_ascii_table[KEY_MAX] = -{ - /* start */ 0, - /* alphabet */ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - /* numbers */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - /* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - /* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - /* misc chars */ 27, '`', '-', '=', 8, 9, '[', ']', 13, ';', '\'', '\\', '\\', ',', '.', '/', ' ', - /* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - /* numpad */ '/', '*', '-', '+', '.', 13, - /* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - - - -/* capslock mapping table for the US keyboard layout */ -static unsigned short standard_key_capslock_table[KEY_MAX] = -{ - /* start */ 0, - /* alphabet */ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - /* numbers */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - /* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - /* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - /* misc chars */ 27, '`', '-', '=', 8, 9, '[', ']', 13, ';', '\'', '\\', '\\', ',', '.', '/', ' ', - /* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - /* numpad */ '/', '*', '-', '+', '.', 13, - /* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - - - -/* shifted mapping table for the US keyboard layout */ -static unsigned short standard_key_shift_table[KEY_MAX] = -{ - /* start */ 0, - /* alphabet */ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - /* numbers */ ')', '!', '@', '#', '$', '%', '^', '&', '*', '(', - /* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - /* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - /* misc chars */ 27, '~', '_', '+', 8, 9, '{', '}', 13, ':', '"', '|', '|', '<', '>', '?', ' ', - /* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - /* numpad */ '/', '*', '-', '+', '.', 13, - /* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - - - -/* ctrl+key mapping table for the US keyboard layout */ -static unsigned short standard_key_control_table[KEY_MAX] = -{ - /* start */ 0, - /* alphabet */ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - /* numbers */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - /* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - /* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - /* misc chars */ 27, 2, 2, 2, 127, 127, 2, 2, 10, 2, 2, 2, 2, 2, 2, 2, 2, - /* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - /* numpad */ 2, 2, 2, 2, 2, 10, - /* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - - - -/* convert numeric pad scancodes into arrow codes */ -static unsigned char numlock_table[10] = -{ - KEY_INSERT, KEY_END, KEY_DOWN, KEY_PGDN, KEY_LEFT, - KEY_5_PAD, KEY_RIGHT, KEY_HOME, KEY_UP, KEY_PGUP -}; - - - -/* kb_wait_for_write_ready: - * Wait for the keyboard controller to set the ready-for-write bit. - */ -static __inline int kb_wait_for_write_ready (void) -{ - int timeout = 4096; - - while ((timeout>0) && (inportb(0x64)&2)) timeout--; - - return (timeout>0); -} - - - -/* kb_wait_for_read_ready: - * Wait for the keyboard controller to set the ready-for-read bit. - */ -static __inline int kb_wait_for_read_ready (void) -{ - int timeout = 16384; - - while ((timeout>0) && (!(inportb(0x64)&1))) timeout--; - - return (timeout>0); -} - - - -/* kb_send_data: - * Sends a byte to the keyboard controller. Returns 1 if all OK. - */ -static __inline int kb_send_data (unsigned char data) -{ - int resends = 4; - int timeout, temp; - - do { - if (!kb_wait_for_write_ready()) - return 0; - - outportb(0x60, data); - timeout = 4096; - - while (--timeout>0) { - if (!kb_wait_for_read_ready()) - return 0; - - temp = inportb(0x60); - - if (temp == 0xFA) - return 1; - - if (temp == 0xFE) - break; - } - } while ((resends-- > 0) && (timeout > 0)); - - return 0; -} - - - -static void update_leds (int leds) -{ - if (leds_ok) { - if (!in_a_terrupt) - DISABLE(); - - if (!kb_send_data(0xED)) { - kb_send_data(0xF4); - leds_ok = FALSE; - } else if (!kb_send_data((leds>>8)&7)) { - kb_send_data(0xF4); - leds_ok = FALSE; - } - - if (!in_a_terrupt) - ENABLE(); - } -} ENDOFUNC(update_leds) - - - -static void inject_key (int scancode) -{ - unsigned short *table; - - if ((scancode >= KEY_0_PAD) && (scancode <= KEY_9_PAD)) { - if (((key_shifts & KB_NUMLOCK_FLAG) != 0) == ((key_shifts & KB_SHIFT_FLAG) != 0)) { - scancode = numlock_table[scancode - KEY_0_PAD]; - } - table = standard_key_ascii_table; - } else if (key_shifts & KB_CTRL_FLAG) { - table = standard_key_control_table; - } else if (key_shifts & KB_SHIFT_FLAG) { - if (key_shifts & KB_CAPSLOCK_FLAG) { - if (standard_key_ascii_table[scancode]==standard_key_capslock_table[scancode]) { - table = standard_key_shift_table; - } else { - table = standard_key_ascii_table; - } - } else { - table = standard_key_shift_table; - } - } else if (key_shifts & KB_CAPSLOCK_FLAG) { - table = standard_key_capslock_table; - } else { - table = standard_key_ascii_table; - } - - key_buffer.key[key_buffer.end++] = (scancode<<16)|table[scancode]; - - if (key_buffer.end>=KEY_BUFFER_SIZE) - key_buffer.end = 0; - if (key_buffer.end==key_buffer.start) { - key_buffer.start++; - if (key_buffer.start>=KEY_BUFFER_SIZE) - key_buffer.start = 0; - } -} ENDOFUNC(inject_key) - -static void handle_code (int scancode, int keycode) -{ - in_a_terrupt++; - - if (keycode==0) { /* pause */ - inject_key(scancode); - pc_key[KEY_PAUSE] ^= TRUE; - } else if (scancode) { - int flag; - - if (scancode>=KEY_MODIFIERS) { - flag = modifier_table[scancode - KEY_MODIFIERS]; - } else { - flag = 0; - } - if ((char)keycode<0) { /* release */ - pc_key[scancode] = FALSE; - if (flag&KB_MODIFIERS) { - key_shifts &= ~flag; - } - } else { /* keypress */ - pc_key[scancode] = TRUE; - if (flag&KB_MODIFIERS) { - key_shifts |= flag; - } - if (flag&KB_LED_FLAGS) { - key_shifts ^= flag; - update_leds(key_shifts); - } - if (scancode=KEY_BUFFER_SIZE) - key_buffer.start = 0; - ENABLE(); - - return key; - } else { - return 0; - } -} - -int pc_keydown (int code) -{ - return pc_key[code]; -} - -int pc_keyshifts (void) -{ - return key_shifts; -} - -void pc_remove_keyb (void) -{ - if (keyboard_installed) { - int s1, s2, s3; - - keyboard_installed = FALSE; - pc_clexit(pc_remove_keyb); - - DISABLE(); - _farsetsel(__djgpp_dos_sel); - _farnspokew(0x41c, _farnspeekw(0x41a)); - - s1 = _farnspeekb(0x417) & 0x80; - s2 = _farnspeekb(0x418) & 0xFC; - s3 = _farnspeekb(0x496) & 0xF3; - - if (pc_key[KEY_RSHIFT]) { s1 |= 1; } - if (pc_key[KEY_LSHIFT]) { s1 |= 2; } - if (pc_key[KEY_LCONTROL]) { s2 |= 1; s1 |= 4; } - if (pc_key[KEY_ALT]) { s1 |= 8; s2 |= 2; } - if (pc_key[KEY_RCONTROL]) { s1 |= 4; s3 |= 4; } - if (pc_key[KEY_ALTGR]) { s1 |= 8; s3 |= 8; } - - if (key_shifts&KB_SCROLOCK_FLAG) s1 |= 16; - if (key_shifts&KB_NUMLOCK_FLAG) s1 |= 32; - if (key_shifts&KB_CAPSLOCK_FLAG) s1 |= 64; - - _farnspokeb(0x417, s1); - _farnspokeb(0x418, s2); - _farnspokeb(0x496, s3); - update_leds(key_shifts); - - ENABLE(); - pc_remove_irq(KEYB_IRQ); - } -} - -int pc_install_keyb (void) -{ - if (keyboard_installed||pc_install_irq(KEYB_IRQ, keyboard)) { - return -1; - } else { - int s1, s2, s3; - - LOCKDATA(key_buffer); - LOCKDATA(key_enhanced); - LOCKDATA(key_pause_loop); - LOCKDATA(key_shifts); - LOCKDATA(leds_ok); - LOCKDATA(in_a_terrupt); - LOCKDATA(pc_key); - LOCKDATA(modifier_table); - LOCKDATA(hw_to_mycode); - LOCKDATA(hw_to_mycode_ex); - LOCKDATA(standard_key_ascii_table); - LOCKDATA(standard_key_capslock_table); - LOCKDATA(standard_key_shift_table); - LOCKDATA(standard_key_control_table); - LOCKDATA(numlock_table); - LOCKFUNC(update_leds); - LOCKFUNC(inject_key); - LOCKFUNC(handle_code); - LOCKFUNC(keyboard); - - DISABLE(); - _farsetsel(__djgpp_dos_sel); - _farnspokew(0x41c, _farnspeekw(0x41a)); - - key_shifts = 0; - s1 = _farnspeekb(0x417); - s2 = _farnspeekb(0x418); - s3 = _farnspeekb(0x496); - - if (s1&1) { key_shifts |= KB_SHIFT_FLAG; pc_key[KEY_RSHIFT] = TRUE; } - if (s1&2) { key_shifts |= KB_SHIFT_FLAG; pc_key[KEY_LSHIFT] = TRUE; } - if (s2&1) { key_shifts |= KB_CTRL_FLAG; pc_key[KEY_LCONTROL] = TRUE; } - if (s2&2) { key_shifts |= KB_ALT_FLAG; pc_key[KEY_ALT] = TRUE; } - if (s3&4) { key_shifts |= KB_CTRL_FLAG; pc_key[KEY_RCONTROL] = TRUE; } - if (s3&8) { key_shifts |= KB_ALT_FLAG; pc_key[KEY_ALTGR] = TRUE; } - - if (s1&16) key_shifts |= KB_SCROLOCK_FLAG; - if (s1&32) key_shifts |= KB_NUMLOCK_FLAG; - if (s1&64) key_shifts |= KB_CAPSLOCK_FLAG; - update_leds(key_shifts); - - key_enhanced = key_pause_loop = 0; - key_buffer.start = key_buffer.end = 0; - ENABLE(); - - pc_atexit(pc_remove_keyb); - keyboard_installed = TRUE; - return 0; - } -} +/* + * PC/HW routine collection v1.3 for DOS/DJGPP + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include +#include +#include + +#include "pc_hw.h" + + + +#define KEYB_IRQ 1 + +#define KEY_BUFFER_SIZE 64 + +#define KB_MODIFIERS (KB_SHIFT_FLAG | KB_CTRL_FLAG | KB_ALT_FLAG | KB_LWIN_FLAG | KB_RWIN_FLAG | KB_MENU_FLAG) +#define KB_LED_FLAGS (KB_SCROLOCK_FLAG | KB_NUMLOCK_FLAG | KB_CAPSLOCK_FLAG) + +static int keyboard_installed; + +static volatile struct { + volatile int start, end; + volatile int key[KEY_BUFFER_SIZE]; +} key_buffer; + +static volatile int key_enhanced, key_pause_loop, key_shifts; +static int leds_ok = TRUE; +static int in_a_terrupt = FALSE; +static volatile char pc_key[KEY_MAX]; + + + +/* convert Allegro format scancodes into key_shifts flag bits */ +static unsigned short modifier_table[KEY_MAX - KEY_MODIFIERS] = +{ + KB_SHIFT_FLAG, KB_SHIFT_FLAG, KB_CTRL_FLAG, + KB_CTRL_FLAG, KB_ALT_FLAG, KB_ALT_FLAG, + KB_LWIN_FLAG, KB_RWIN_FLAG, KB_MENU_FLAG, + KB_SCROLOCK_FLAG, KB_NUMLOCK_FLAG, KB_CAPSLOCK_FLAG +}; + + + +/* lookup table for converting hardware scancodes into Allegro format */ +static unsigned char hw_to_mycode[128] = +{ + /* 0x00 */ 0, KEY_ESC, KEY_1, KEY_2, + /* 0x04 */ KEY_3, KEY_4, KEY_5, KEY_6, + /* 0x08 */ KEY_7, KEY_8, KEY_9, KEY_0, + /* 0x0C */ KEY_MINUS, KEY_EQUALS, KEY_BACKSPACE, KEY_TAB, + /* 0x10 */ KEY_Q, KEY_W, KEY_E, KEY_R, + /* 0x14 */ KEY_T, KEY_Y, KEY_U, KEY_I, + /* 0x18 */ KEY_O, KEY_P, KEY_OPENBRACE, KEY_CLOSEBRACE, + /* 0x1C */ KEY_ENTER, KEY_LCONTROL, KEY_A, KEY_S, + /* 0x20 */ KEY_D, KEY_F, KEY_G, KEY_H, + /* 0x24 */ KEY_J, KEY_K, KEY_L, KEY_COLON, + /* 0x28 */ KEY_QUOTE, KEY_TILDE, KEY_LSHIFT, KEY_BACKSLASH, + /* 0x2C */ KEY_Z, KEY_X, KEY_C, KEY_V, + /* 0x30 */ KEY_B, KEY_N, KEY_M, KEY_COMMA, + /* 0x34 */ KEY_STOP, KEY_SLASH, KEY_RSHIFT, KEY_ASTERISK, + /* 0x38 */ KEY_ALT, KEY_SPACE, KEY_CAPSLOCK, KEY_F1, + /* 0x3C */ KEY_F2, KEY_F3, KEY_F4, KEY_F5, + /* 0x40 */ KEY_F6, KEY_F7, KEY_F8, KEY_F9, + /* 0x44 */ KEY_F10, KEY_NUMLOCK, KEY_SCRLOCK, KEY_7_PAD, + /* 0x48 */ KEY_8_PAD, KEY_9_PAD, KEY_MINUS_PAD, KEY_4_PAD, + /* 0x4C */ KEY_5_PAD, KEY_6_PAD, KEY_PLUS_PAD, KEY_1_PAD, + /* 0x50 */ KEY_2_PAD, KEY_3_PAD, KEY_0_PAD, KEY_DEL_PAD, + /* 0x54 */ KEY_PRTSCR, 0, KEY_BACKSLASH2, KEY_F11, + /* 0x58 */ KEY_F12, 0, 0, KEY_LWIN, + /* 0x5C */ KEY_RWIN, KEY_MENU, 0, 0, + /* 0x60 */ 0, 0, 0, 0, + /* 0x64 */ 0, 0, 0, 0, + /* 0x68 */ 0, 0, 0, 0, + /* 0x6C */ 0, 0, 0, 0, + /* 0x70 */ KEY_KANA, 0, 0, KEY_ABNT_C1, + /* 0x74 */ 0, 0, 0, 0, + /* 0x78 */ 0, KEY_CONVERT, 0, KEY_NOCONVERT, + /* 0x7C */ 0, KEY_YEN, 0, 0 +}; + + + +/* lookup table for converting extended hardware codes into Allegro format */ +static unsigned char hw_to_mycode_ex[128] = +{ + /* 0x00 */ 0, KEY_ESC, KEY_1, KEY_2, + /* 0x04 */ KEY_3, KEY_4, KEY_5, KEY_6, + /* 0x08 */ KEY_7, KEY_8, KEY_9, KEY_0, + /* 0x0C */ KEY_MINUS, KEY_EQUALS, KEY_BACKSPACE, KEY_TAB, + /* 0x10 */ KEY_CIRCUMFLEX, KEY_AT, KEY_COLON2, KEY_R, + /* 0x14 */ KEY_KANJI, KEY_Y, KEY_U, KEY_I, + /* 0x18 */ KEY_O, KEY_P, KEY_OPENBRACE, KEY_CLOSEBRACE, + /* 0x1C */ KEY_ENTER_PAD, KEY_RCONTROL, KEY_A, KEY_S, + /* 0x20 */ KEY_D, KEY_F, KEY_G, KEY_H, + /* 0x24 */ KEY_J, KEY_K, KEY_L, KEY_COLON, + /* 0x28 */ KEY_QUOTE, KEY_TILDE, 0, KEY_BACKSLASH, + /* 0x2C */ KEY_Z, KEY_X, KEY_C, KEY_V, + /* 0x30 */ KEY_B, KEY_N, KEY_M, KEY_COMMA, + /* 0x34 */ KEY_STOP, KEY_SLASH_PAD, 0, KEY_PRTSCR, + /* 0x38 */ KEY_ALTGR, KEY_SPACE, KEY_CAPSLOCK, KEY_F1, + /* 0x3C */ KEY_F2, KEY_F3, KEY_F4, KEY_F5, + /* 0x40 */ KEY_F6, KEY_F7, KEY_F8, KEY_F9, + /* 0x44 */ KEY_F10, KEY_NUMLOCK, KEY_PAUSE, KEY_HOME, + /* 0x48 */ KEY_UP, KEY_PGUP, KEY_MINUS_PAD, KEY_LEFT, + /* 0x4C */ KEY_5_PAD, KEY_RIGHT, KEY_PLUS_PAD, KEY_END, + /* 0x50 */ KEY_DOWN, KEY_PGDN, KEY_INSERT, KEY_DEL, + /* 0x54 */ KEY_PRTSCR, 0, KEY_BACKSLASH2, KEY_F11, + /* 0x58 */ KEY_F12, 0, 0, KEY_LWIN, + /* 0x5C */ KEY_RWIN, KEY_MENU, 0, 0, + /* 0x60 */ 0, 0, 0, 0, + /* 0x64 */ 0, 0, 0, 0, + /* 0x68 */ 0, 0, 0, 0, + /* 0x6C */ 0, 0, 0, 0, + /* 0x70 */ 0, 0, 0, 0, + /* 0x74 */ 0, 0, 0, 0, + /* 0x78 */ 0, 0, 0, 0, + /* 0x7C */ 0, 0, 0, 0 +}; + + + +/* default mapping table for the US keyboard layout */ +static unsigned short standard_key_ascii_table[KEY_MAX] = +{ + /* start */ 0, + /* alphabet */ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + /* numbers */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + /* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + /* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + /* misc chars */ 27, '`', '-', '=', 8, 9, '[', ']', 13, ';', '\'', '\\', '\\', ',', '.', '/', ' ', + /* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + /* numpad */ '/', '*', '-', '+', '.', 13, + /* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + + + +/* capslock mapping table for the US keyboard layout */ +static unsigned short standard_key_capslock_table[KEY_MAX] = +{ + /* start */ 0, + /* alphabet */ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', + /* numbers */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + /* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + /* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + /* misc chars */ 27, '`', '-', '=', 8, 9, '[', ']', 13, ';', '\'', '\\', '\\', ',', '.', '/', ' ', + /* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + /* numpad */ '/', '*', '-', '+', '.', 13, + /* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + + + +/* shifted mapping table for the US keyboard layout */ +static unsigned short standard_key_shift_table[KEY_MAX] = +{ + /* start */ 0, + /* alphabet */ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', + /* numbers */ ')', '!', '@', '#', '$', '%', '^', '&', '*', '(', + /* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + /* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + /* misc chars */ 27, '~', '_', '+', 8, 9, '{', '}', 13, ':', '"', '|', '|', '<', '>', '?', ' ', + /* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + /* numpad */ '/', '*', '-', '+', '.', 13, + /* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + + + +/* ctrl+key mapping table for the US keyboard layout */ +static unsigned short standard_key_control_table[KEY_MAX] = +{ + /* start */ 0, + /* alphabet */ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + /* numbers */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + /* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + /* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + /* misc chars */ 27, 2, 2, 2, 127, 127, 2, 2, 10, 2, 2, 2, 2, 2, 2, 2, 2, + /* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + /* numpad */ 2, 2, 2, 2, 2, 10, + /* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + + + +/* convert numeric pad scancodes into arrow codes */ +static unsigned char numlock_table[10] = +{ + KEY_INSERT, KEY_END, KEY_DOWN, KEY_PGDN, KEY_LEFT, + KEY_5_PAD, KEY_RIGHT, KEY_HOME, KEY_UP, KEY_PGUP +}; + + + +/* kb_wait_for_write_ready: + * Wait for the keyboard controller to set the ready-for-write bit. + */ +static __inline int kb_wait_for_write_ready (void) +{ + int timeout = 4096; + + while ((timeout>0) && (inportb(0x64)&2)) timeout--; + + return (timeout>0); +} + + + +/* kb_wait_for_read_ready: + * Wait for the keyboard controller to set the ready-for-read bit. + */ +static __inline int kb_wait_for_read_ready (void) +{ + int timeout = 16384; + + while ((timeout>0) && (!(inportb(0x64)&1))) timeout--; + + return (timeout>0); +} + + + +/* kb_send_data: + * Sends a byte to the keyboard controller. Returns 1 if all OK. + */ +static __inline int kb_send_data (unsigned char data) +{ + int resends = 4; + int timeout, temp; + + do { + if (!kb_wait_for_write_ready()) + return 0; + + outportb(0x60, data); + timeout = 4096; + + while (--timeout>0) { + if (!kb_wait_for_read_ready()) + return 0; + + temp = inportb(0x60); + + if (temp == 0xFA) + return 1; + + if (temp == 0xFE) + break; + } + } while ((resends-- > 0) && (timeout > 0)); + + return 0; +} + + + +static void update_leds (int leds) +{ + if (leds_ok) { + if (!in_a_terrupt) + DISABLE(); + + if (!kb_send_data(0xED)) { + kb_send_data(0xF4); + leds_ok = FALSE; + } else if (!kb_send_data((leds>>8)&7)) { + kb_send_data(0xF4); + leds_ok = FALSE; + } + + if (!in_a_terrupt) + ENABLE(); + } +} ENDOFUNC(update_leds) + + + +static void inject_key (int scancode) +{ + unsigned short *table; + + if ((scancode >= KEY_0_PAD) && (scancode <= KEY_9_PAD)) { + if (((key_shifts & KB_NUMLOCK_FLAG) != 0) == ((key_shifts & KB_SHIFT_FLAG) != 0)) { + scancode = numlock_table[scancode - KEY_0_PAD]; + } + table = standard_key_ascii_table; + } else if (key_shifts & KB_CTRL_FLAG) { + table = standard_key_control_table; + } else if (key_shifts & KB_SHIFT_FLAG) { + if (key_shifts & KB_CAPSLOCK_FLAG) { + if (standard_key_ascii_table[scancode]==standard_key_capslock_table[scancode]) { + table = standard_key_shift_table; + } else { + table = standard_key_ascii_table; + } + } else { + table = standard_key_shift_table; + } + } else if (key_shifts & KB_CAPSLOCK_FLAG) { + table = standard_key_capslock_table; + } else { + table = standard_key_ascii_table; + } + + key_buffer.key[key_buffer.end++] = (scancode<<16)|table[scancode]; + + if (key_buffer.end>=KEY_BUFFER_SIZE) + key_buffer.end = 0; + if (key_buffer.end==key_buffer.start) { + key_buffer.start++; + if (key_buffer.start>=KEY_BUFFER_SIZE) + key_buffer.start = 0; + } +} ENDOFUNC(inject_key) + +static void handle_code (int scancode, int keycode) +{ + in_a_terrupt++; + + if (keycode==0) { /* pause */ + inject_key(scancode); + pc_key[KEY_PAUSE] ^= TRUE; + } else if (scancode) { + int flag; + + if (scancode>=KEY_MODIFIERS) { + flag = modifier_table[scancode - KEY_MODIFIERS]; + } else { + flag = 0; + } + if ((char)keycode<0) { /* release */ + pc_key[scancode] = FALSE; + if (flag&KB_MODIFIERS) { + key_shifts &= ~flag; + } + } else { /* keypress */ + pc_key[scancode] = TRUE; + if (flag&KB_MODIFIERS) { + key_shifts |= flag; + } + if (flag&KB_LED_FLAGS) { + key_shifts ^= flag; + update_leds(key_shifts); + } + if (scancode=KEY_BUFFER_SIZE) + key_buffer.start = 0; + ENABLE(); + + return key; + } else { + return 0; + } +} + +int pc_keydown (int code) +{ + return pc_key[code]; +} + +int pc_keyshifts (void) +{ + return key_shifts; +} + +void pc_remove_keyb (void) +{ + if (keyboard_installed) { + int s1, s2, s3; + + keyboard_installed = FALSE; + pc_clexit(pc_remove_keyb); + + DISABLE(); + _farsetsel(__djgpp_dos_sel); + _farnspokew(0x41c, _farnspeekw(0x41a)); + + s1 = _farnspeekb(0x417) & 0x80; + s2 = _farnspeekb(0x418) & 0xFC; + s3 = _farnspeekb(0x496) & 0xF3; + + if (pc_key[KEY_RSHIFT]) { s1 |= 1; } + if (pc_key[KEY_LSHIFT]) { s1 |= 2; } + if (pc_key[KEY_LCONTROL]) { s2 |= 1; s1 |= 4; } + if (pc_key[KEY_ALT]) { s1 |= 8; s2 |= 2; } + if (pc_key[KEY_RCONTROL]) { s1 |= 4; s3 |= 4; } + if (pc_key[KEY_ALTGR]) { s1 |= 8; s3 |= 8; } + + if (key_shifts&KB_SCROLOCK_FLAG) s1 |= 16; + if (key_shifts&KB_NUMLOCK_FLAG) s1 |= 32; + if (key_shifts&KB_CAPSLOCK_FLAG) s1 |= 64; + + _farnspokeb(0x417, s1); + _farnspokeb(0x418, s2); + _farnspokeb(0x496, s3); + update_leds(key_shifts); + + ENABLE(); + pc_remove_irq(KEYB_IRQ); + } +} + +int pc_install_keyb (void) +{ + if (keyboard_installed||pc_install_irq(KEYB_IRQ, keyboard)) { + return -1; + } else { + int s1, s2, s3; + + LOCKDATA(key_buffer); + LOCKDATA(key_enhanced); + LOCKDATA(key_pause_loop); + LOCKDATA(key_shifts); + LOCKDATA(leds_ok); + LOCKDATA(in_a_terrupt); + LOCKDATA(pc_key); + LOCKDATA(modifier_table); + LOCKDATA(hw_to_mycode); + LOCKDATA(hw_to_mycode_ex); + LOCKDATA(standard_key_ascii_table); + LOCKDATA(standard_key_capslock_table); + LOCKDATA(standard_key_shift_table); + LOCKDATA(standard_key_control_table); + LOCKDATA(numlock_table); + LOCKFUNC(update_leds); + LOCKFUNC(inject_key); + LOCKFUNC(handle_code); + LOCKFUNC(keyboard); + + DISABLE(); + _farsetsel(__djgpp_dos_sel); + _farnspokew(0x41c, _farnspeekw(0x41a)); + + key_shifts = 0; + s1 = _farnspeekb(0x417); + s2 = _farnspeekb(0x418); + s3 = _farnspeekb(0x496); + + if (s1&1) { key_shifts |= KB_SHIFT_FLAG; pc_key[KEY_RSHIFT] = TRUE; } + if (s1&2) { key_shifts |= KB_SHIFT_FLAG; pc_key[KEY_LSHIFT] = TRUE; } + if (s2&1) { key_shifts |= KB_CTRL_FLAG; pc_key[KEY_LCONTROL] = TRUE; } + if (s2&2) { key_shifts |= KB_ALT_FLAG; pc_key[KEY_ALT] = TRUE; } + if (s3&4) { key_shifts |= KB_CTRL_FLAG; pc_key[KEY_RCONTROL] = TRUE; } + if (s3&8) { key_shifts |= KB_ALT_FLAG; pc_key[KEY_ALTGR] = TRUE; } + + if (s1&16) key_shifts |= KB_SCROLOCK_FLAG; + if (s1&32) key_shifts |= KB_NUMLOCK_FLAG; + if (s1&64) key_shifts |= KB_CAPSLOCK_FLAG; + update_leds(key_shifts); + + key_enhanced = key_pause_loop = 0; + key_buffer.start = key_buffer.end = 0; + ENABLE(); + + pc_atexit(pc_remove_keyb); + keyboard_installed = TRUE; + return 0; + } +} diff --git a/src/glut/dos/PC_HW/pc_mouse.c b/src/glut/dos/PC_HW/pc_mouse.c index cf8fb668ba0..fc0902ce81b 100644 --- a/src/glut/dos/PC_HW/pc_mouse.c +++ b/src/glut/dos/PC_HW/pc_mouse.c @@ -1,278 +1,278 @@ -/* - * PC/HW routine collection v1.3 for DOS/DJGPP - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include -#include -#include - -#include "pc_hw.h" - - - -#define PC_CUTE_WHEEL 1 /* CuteMouse WheelAPI */ - -#define MOUSE_STACK_SIZE 16384 - -#define CLEAR_MICKEYS() \ - do { \ - __asm __volatile ("movw $0xb, %%ax; int $0x33":::"%eax", "%ecx", "%edx"); \ - ox = oy = 0; \ - } while (0) - -extern void mouse_wrap (void); -extern int mouse_wrap_end[]; - -static MFUNC mouse_func; -static long mouse_callback; -static __dpmi_regs mouse_regs; - -static volatile struct { - volatile int x, y, z, b; -} pc_mouse; - -static int minx = 0; -static int maxx = 319; -static int miny = 0; -static int maxy = 199; -static int minz = 0; -static int maxz = 255; - -static int sx = 2; -static int sy = 2; - -static int emulat3 = FALSE; - -static int ox, oy; - - -static void mouse (__dpmi_regs *r) -{ - int nx = (signed short)r->x.si / sx; - int ny = (signed short)r->x.di / sy; - int dx = nx - ox; - int dy = ny - oy; -#if PC_CUTE_WHEEL - int dz = (signed char)r->h.bh; -#endif - ox = nx; - oy = ny; - - pc_mouse.b = r->h.bl; - pc_mouse.x = MID(minx, pc_mouse.x + dx, maxx); - pc_mouse.y = MID(miny, pc_mouse.y + dy, maxy); -#if PC_CUTE_WHEEL - pc_mouse.z = MID(minz, pc_mouse.z + dz, maxz); -#endif - - if (emulat3) { - if ((pc_mouse.b&3)==3) { - pc_mouse.b = 4; - } - } - - if (mouse_func) { - mouse_func(pc_mouse.x, pc_mouse.y, pc_mouse.z, pc_mouse.b); - } -} ENDOFUNC(mouse) - -void pc_remove_mouse (void) -{ - if (mouse_callback) { - pc_clexit(pc_remove_mouse); - __asm("\n\ - movl %%edx, %%ecx \n\ - shrl $16, %%ecx \n\ - movw $0x0304, %%ax \n\ - int $0x31 \n\ - movw $0x000c, %%ax \n\ - xorl %%ecx, %%ecx \n\ - int $0x33 \n\ - "::"d"(mouse_callback):"%eax", "%ecx"); - - mouse_callback = 0; - - free((void *)(mouse_wrap_end[0] - MOUSE_STACK_SIZE)); - } -} - -int pc_install_mouse (void) -{ - int buttons; - - /* fail if already call-backed */ - if (mouse_callback) { - return 0; - } - - /* reset mouse and get status */ - __asm("\n\ - xorl %%eax, %%eax \n\ - int $0x33 \n\ - andl %%ebx, %%eax \n\ - movl %%eax, %0 \n\ - ":"=g" (buttons)::"%eax", "%ebx"); - if (!buttons) { - return 0; - } - - /* lock wrapper */ - LOCKDATA(mouse_func); - LOCKDATA(mouse_callback); - LOCKDATA(mouse_regs); - LOCKDATA(pc_mouse); - LOCKDATA(minx); - LOCKDATA(maxx); - LOCKDATA(miny); - LOCKDATA(maxy); - LOCKDATA(minz); - LOCKDATA(maxz); - LOCKDATA(sx); - LOCKDATA(sy); - LOCKDATA(emulat3); - LOCKDATA(ox); - LOCKDATA(oy); - LOCKFUNC(mouse); - LOCKFUNC(mouse_wrap); - - mouse_wrap_end[1] = __djgpp_ds_alias; - /* grab a locked stack */ - if ((mouse_wrap_end[0] = (int)pc_malloc(MOUSE_STACK_SIZE)) == NULL) { - return 0; - } - - /* try to hook a call-back */ - __asm("\n\ - pushl %%ds \n\ - pushl %%es \n\ - movw $0x0303, %%ax \n\ - pushl %%ds \n\ - pushl %%cs \n\ - popl %%ds \n\ - popl %%es \n\ - int $0x31 \n\ - popl %%es \n\ - popl %%ds \n\ - jc 0f \n\ - shll $16, %%ecx \n\ - movw %%dx, %%cx \n\ - movl %%ecx, %0 \n\ - 0: \n\ - ":"=g"(mouse_callback) - :"S" (mouse_wrap), "D"(&mouse_regs) - :"%eax", "%ecx", "%edx"); - if (!mouse_callback) { - free((void *)mouse_wrap_end[0]); - return 0; - } - - /* adjust stack */ - mouse_wrap_end[0] += MOUSE_STACK_SIZE; - - /* install the handler */ - mouse_regs.x.ax = 0x000c; -#if PC_CUTE_WHEEL - mouse_regs.x.cx = 0x7f | 0x80; -#else - mouse_regs.x.cx = 0x7f; -#endif - mouse_regs.x.dx = mouse_callback&0xffff; - mouse_regs.x.es = mouse_callback>>16; - __dpmi_int(0x33, &mouse_regs); - - CLEAR_MICKEYS(); - - emulat3 = buttons<3; - pc_atexit(pc_remove_mouse); - return buttons; -} - -MFUNC pc_install_mouse_handler (MFUNC handler) -{ - MFUNC old; - - if (!mouse_callback && !pc_install_mouse()) { - return NULL; - } - - old = mouse_func; - mouse_func = handler; - return old; -} - -void pc_mouse_area (int x1, int y1, int x2, int y2) -{ - minx = x1; - maxx = x2; - miny = y1; - maxy = y2; -} - -void pc_mouse_speed (int xspeed, int yspeed) -{ - DISABLE(); - - sx = MAX(1, xspeed); - sy = MAX(1, yspeed); - - ENABLE(); -} - -int pc_query_mouse (int *x, int *y, int *z) -{ - *x = pc_mouse.x; - *y = pc_mouse.y; - *z = pc_mouse.z; - return pc_mouse.b; -} - -void pc_warp_mouse (int x, int y) -{ - CLEAR_MICKEYS(); - - pc_mouse.x = MID(minx, x, maxx); - pc_mouse.y = MID(miny, y, maxy); - - if (mouse_func) { - mouse_func(pc_mouse.x, pc_mouse.y, pc_mouse.z, pc_mouse.b); - } -} - -/* Hack alert: - * `mouse_wrap_end' actually holds the - * address of stack in a safe data selector. - */ -__asm("\n\ - .text \n\ - .p2align 5,,31 \n\ - .global _mouse_wrap \n\ -_mouse_wrap: \n\ - cld \n\ - lodsl \n\ - movl %eax, %es:42(%edi) \n\ - addw $4, %es:46(%edi) \n\ - pushl %es \n\ - movl %ss, %ebx \n\ - movl %esp, %esi \n\ - lss %cs:_mouse_wrap_end, %esp\n\ - pushl %ss \n\ - pushl %ss \n\ - popl %es \n\ - popl %ds \n\ - movl ___djgpp_dos_sel, %fs \n\ - pushl %fs \n\ - popl %gs \n\ - pushl %edi \n\ - call _mouse \n\ - popl %edi \n\ - movl %ebx, %ss \n\ - movl %esi, %esp \n\ - popl %es \n\ - iret \n\ - .global _mouse_wrap_end \n\ -_mouse_wrap_end:.long 0, 0"); +/* + * PC/HW routine collection v1.3 for DOS/DJGPP + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include +#include +#include + +#include "pc_hw.h" + + + +#define PC_CUTE_WHEEL 1 /* CuteMouse WheelAPI */ + +#define MOUSE_STACK_SIZE 16384 + +#define CLEAR_MICKEYS() \ + do { \ + __asm __volatile ("movw $0xb, %%ax; int $0x33":::"%eax", "%ecx", "%edx"); \ + ox = oy = 0; \ + } while (0) + +extern void mouse_wrap (void); +extern int mouse_wrap_end[]; + +static MFUNC mouse_func; +static long mouse_callback; +static __dpmi_regs mouse_regs; + +static volatile struct { + volatile int x, y, z, b; +} pc_mouse; + +static int minx = 0; +static int maxx = 319; +static int miny = 0; +static int maxy = 199; +static int minz = 0; +static int maxz = 255; + +static int sx = 2; +static int sy = 2; + +static int emulat3 = FALSE; + +static int ox, oy; + + +static void mouse (__dpmi_regs *r) +{ + int nx = (signed short)r->x.si / sx; + int ny = (signed short)r->x.di / sy; + int dx = nx - ox; + int dy = ny - oy; +#if PC_CUTE_WHEEL + int dz = (signed char)r->h.bh; +#endif + ox = nx; + oy = ny; + + pc_mouse.b = r->h.bl; + pc_mouse.x = MID(minx, pc_mouse.x + dx, maxx); + pc_mouse.y = MID(miny, pc_mouse.y + dy, maxy); +#if PC_CUTE_WHEEL + pc_mouse.z = MID(minz, pc_mouse.z + dz, maxz); +#endif + + if (emulat3) { + if ((pc_mouse.b&3)==3) { + pc_mouse.b = 4; + } + } + + if (mouse_func) { + mouse_func(pc_mouse.x, pc_mouse.y, pc_mouse.z, pc_mouse.b); + } +} ENDOFUNC(mouse) + +void pc_remove_mouse (void) +{ + if (mouse_callback) { + pc_clexit(pc_remove_mouse); + __asm("\n\ + movl %%edx, %%ecx \n\ + shrl $16, %%ecx \n\ + movw $0x0304, %%ax \n\ + int $0x31 \n\ + movw $0x000c, %%ax \n\ + xorl %%ecx, %%ecx \n\ + int $0x33 \n\ + "::"d"(mouse_callback):"%eax", "%ecx"); + + mouse_callback = 0; + + free((void *)(mouse_wrap_end[0] - MOUSE_STACK_SIZE)); + } +} + +int pc_install_mouse (void) +{ + int buttons; + + /* fail if already call-backed */ + if (mouse_callback) { + return 0; + } + + /* reset mouse and get status */ + __asm("\n\ + xorl %%eax, %%eax \n\ + int $0x33 \n\ + andl %%ebx, %%eax \n\ + movl %%eax, %0 \n\ + ":"=g" (buttons)::"%eax", "%ebx"); + if (!buttons) { + return 0; + } + + /* lock wrapper */ + LOCKDATA(mouse_func); + LOCKDATA(mouse_callback); + LOCKDATA(mouse_regs); + LOCKDATA(pc_mouse); + LOCKDATA(minx); + LOCKDATA(maxx); + LOCKDATA(miny); + LOCKDATA(maxy); + LOCKDATA(minz); + LOCKDATA(maxz); + LOCKDATA(sx); + LOCKDATA(sy); + LOCKDATA(emulat3); + LOCKDATA(ox); + LOCKDATA(oy); + LOCKFUNC(mouse); + LOCKFUNC(mouse_wrap); + + mouse_wrap_end[1] = __djgpp_ds_alias; + /* grab a locked stack */ + if ((mouse_wrap_end[0] = (int)pc_malloc(MOUSE_STACK_SIZE)) == NULL) { + return 0; + } + + /* try to hook a call-back */ + __asm("\n\ + pushl %%ds \n\ + pushl %%es \n\ + movw $0x0303, %%ax \n\ + pushl %%ds \n\ + pushl %%cs \n\ + popl %%ds \n\ + popl %%es \n\ + int $0x31 \n\ + popl %%es \n\ + popl %%ds \n\ + jc 0f \n\ + shll $16, %%ecx \n\ + movw %%dx, %%cx \n\ + movl %%ecx, %0 \n\ + 0: \n\ + ":"=g"(mouse_callback) + :"S" (mouse_wrap), "D"(&mouse_regs) + :"%eax", "%ecx", "%edx"); + if (!mouse_callback) { + free((void *)mouse_wrap_end[0]); + return 0; + } + + /* adjust stack */ + mouse_wrap_end[0] += MOUSE_STACK_SIZE; + + /* install the handler */ + mouse_regs.x.ax = 0x000c; +#if PC_CUTE_WHEEL + mouse_regs.x.cx = 0x7f | 0x80; +#else + mouse_regs.x.cx = 0x7f; +#endif + mouse_regs.x.dx = mouse_callback&0xffff; + mouse_regs.x.es = mouse_callback>>16; + __dpmi_int(0x33, &mouse_regs); + + CLEAR_MICKEYS(); + + emulat3 = buttons<3; + pc_atexit(pc_remove_mouse); + return buttons; +} + +MFUNC pc_install_mouse_handler (MFUNC handler) +{ + MFUNC old; + + if (!mouse_callback && !pc_install_mouse()) { + return NULL; + } + + old = mouse_func; + mouse_func = handler; + return old; +} + +void pc_mouse_area (int x1, int y1, int x2, int y2) +{ + minx = x1; + maxx = x2; + miny = y1; + maxy = y2; +} + +void pc_mouse_speed (int xspeed, int yspeed) +{ + DISABLE(); + + sx = MAX(1, xspeed); + sy = MAX(1, yspeed); + + ENABLE(); +} + +int pc_query_mouse (int *x, int *y, int *z) +{ + *x = pc_mouse.x; + *y = pc_mouse.y; + *z = pc_mouse.z; + return pc_mouse.b; +} + +void pc_warp_mouse (int x, int y) +{ + CLEAR_MICKEYS(); + + pc_mouse.x = MID(minx, x, maxx); + pc_mouse.y = MID(miny, y, maxy); + + if (mouse_func) { + mouse_func(pc_mouse.x, pc_mouse.y, pc_mouse.z, pc_mouse.b); + } +} + +/* Hack alert: + * `mouse_wrap_end' actually holds the + * address of stack in a safe data selector. + */ +__asm("\n\ + .text \n\ + .p2align 5,,31 \n\ + .global _mouse_wrap \n\ +_mouse_wrap: \n\ + cld \n\ + lodsl \n\ + movl %eax, %es:42(%edi) \n\ + addw $4, %es:46(%edi) \n\ + pushl %es \n\ + movl %ss, %ebx \n\ + movl %esp, %esi \n\ + lss %cs:_mouse_wrap_end, %esp\n\ + pushl %ss \n\ + pushl %ss \n\ + popl %es \n\ + popl %ds \n\ + movl ___djgpp_dos_sel, %fs \n\ + pushl %fs \n\ + popl %gs \n\ + pushl %edi \n\ + call _mouse \n\ + popl %edi \n\ + movl %ebx, %ss \n\ + movl %esi, %esp \n\ + popl %es \n\ + iret \n\ + .global _mouse_wrap_end \n\ +_mouse_wrap_end:.long 0, 0"); diff --git a/src/glut/dos/PC_HW/pc_timer.c b/src/glut/dos/PC_HW/pc_timer.c index 36c02910a3e..bf39bd0a4c0 100644 --- a/src/glut/dos/PC_HW/pc_timer.c +++ b/src/glut/dos/PC_HW/pc_timer.c @@ -1,158 +1,158 @@ -/* - * PC/HW routine collection v1.3 for DOS/DJGPP - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include - -#include "pc_hw.h" - -#define TIMER_IRQ 0 - -#define MAX_TIMERS 8 - -#define PIT_FREQ 0x1234DD - -#define unvolatile(__v, __t) __extension__ ({union { volatile __t __cp; __t __p; } __q; __q.__cp = __v; __q.__p;}) - -static int timer_installed; - -typedef struct { - volatile unsigned int counter, clock_ticks, freq; - volatile PFUNC func; - volatile void *parm; -} TIMER; - -static TIMER timer_main, timer_func[MAX_TIMERS]; - -static int timer () -{ - int i; - - for (i=0;ifunc) { - t->clock_ticks += t->counter; - if (t->clock_ticks>=timer_main.counter) { - t->clock_ticks -= timer_main.counter; - t->func(unvolatile(t->parm, void *)); - } - } - } - - timer_main.clock_ticks += timer_main.counter; - if (timer_main.clock_ticks>=0x10000) { - timer_main.clock_ticks -= 0x10000; - return 1; - } else { - outportb(0x20, 0x20); - return 0; - } -} ENDOFUNC(timer) - -void pc_remove_timer (void) -{ - if (timer_installed) { - timer_installed = FALSE; - pc_clexit(pc_remove_timer); - - DISABLE(); - outportb(0x43, 0x34); - outportb(0x40, 0); - outportb(0x40, 0); - ENABLE(); - - pc_remove_irq(TIMER_IRQ); - } -} - -static int install_timer (void) -{ - if (timer_installed||pc_install_irq(TIMER_IRQ, timer)) { - return -1; - } else { - LOCKDATA(timer_func); - LOCKDATA(timer_main); - LOCKFUNC(timer); - - timer_main.counter = 0x10000; - - DISABLE(); - outportb(0x43, 0x34); - outportb(0x40, 0); - outportb(0x40, 0); - timer_main.clock_ticks = 0; - ENABLE(); - - pc_atexit(pc_remove_timer); - timer_installed = TRUE; - return 0; - } -} - -static TIMER *find_slot (PFUNC func) -{ - int i; - - for (i=0;ifunc = func; - t->parm = parm; - t->freq = freq; - t->clock_ticks = 0; - - if (new_counter < timer_main.counter) { - for (i=0;i>8)); - timer_main.clock_ticks = 0; - timer_main.counter = new_counter; - timer_main.freq = freq; - } else { - t->counter = PIT_FREQ * freq / (timer_main.freq * timer_main.freq); - } - - ENABLE(); - - return 0; - } - - return -1; -} +/* + * PC/HW routine collection v1.3 for DOS/DJGPP + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include + +#include "pc_hw.h" + +#define TIMER_IRQ 0 + +#define MAX_TIMERS 8 + +#define PIT_FREQ 0x1234DD + +#define unvolatile(__v, __t) __extension__ ({union { volatile __t __cp; __t __p; } __q; __q.__cp = __v; __q.__p;}) + +static int timer_installed; + +typedef struct { + volatile unsigned int counter, clock_ticks, freq; + volatile PFUNC func; + volatile void *parm; +} TIMER; + +static TIMER timer_main, timer_func[MAX_TIMERS]; + +static int timer () +{ + int i; + + for (i=0;ifunc) { + t->clock_ticks += t->counter; + if (t->clock_ticks>=timer_main.counter) { + t->clock_ticks -= timer_main.counter; + t->func(unvolatile(t->parm, void *)); + } + } + } + + timer_main.clock_ticks += timer_main.counter; + if (timer_main.clock_ticks>=0x10000) { + timer_main.clock_ticks -= 0x10000; + return 1; + } else { + outportb(0x20, 0x20); + return 0; + } +} ENDOFUNC(timer) + +void pc_remove_timer (void) +{ + if (timer_installed) { + timer_installed = FALSE; + pc_clexit(pc_remove_timer); + + DISABLE(); + outportb(0x43, 0x34); + outportb(0x40, 0); + outportb(0x40, 0); + ENABLE(); + + pc_remove_irq(TIMER_IRQ); + } +} + +static int install_timer (void) +{ + if (timer_installed||pc_install_irq(TIMER_IRQ, timer)) { + return -1; + } else { + LOCKDATA(timer_func); + LOCKDATA(timer_main); + LOCKFUNC(timer); + + timer_main.counter = 0x10000; + + DISABLE(); + outportb(0x43, 0x34); + outportb(0x40, 0); + outportb(0x40, 0); + timer_main.clock_ticks = 0; + ENABLE(); + + pc_atexit(pc_remove_timer); + timer_installed = TRUE; + return 0; + } +} + +static TIMER *find_slot (PFUNC func) +{ + int i; + + for (i=0;ifunc = func; + t->parm = parm; + t->freq = freq; + t->clock_ticks = 0; + + if (new_counter < timer_main.counter) { + for (i=0;i>8)); + timer_main.clock_ticks = 0; + timer_main.counter = new_counter; + timer_main.freq = freq; + } else { + t->counter = PIT_FREQ * freq / (timer_main.freq * timer_main.freq); + } + + ENABLE(); + + return 0; + } + + return -1; +} diff --git a/src/glut/dos/callback.c b/src/glut/dos/callback.c index 67e52ee59f0..8ab75e794c5 100644 --- a/src/glut/dos/callback.c +++ b/src/glut/dos/callback.c @@ -1,164 +1,164 @@ -/* - * Mesa 3-D graphics library - * Version: 3.4 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include "glutint.h" - - - -GLUTidleCB g_idle_func = NULL; - - - -void APIENTRY glutDisplayFunc (GLUTdisplayCB func) -{ - g_curwin->display = func; -} - - - -void APIENTRY glutReshapeFunc (GLUTreshapeCB func) -{ - g_curwin->reshape = func; -} - - - -void APIENTRY glutKeyboardFunc (GLUTkeyboardCB func) -{ - g_curwin->keyboard = func; -} - - - -void APIENTRY glutMouseFunc (GLUTmouseCB func) -{ - g_curwin->mouse = func; -} - - - -void APIENTRY glutMotionFunc (GLUTmotionCB func) -{ - g_curwin->motion = func; -} - - - -void APIENTRY glutPassiveMotionFunc (GLUTpassiveCB func) -{ - g_curwin->passive = func; -} - - - -void APIENTRY glutEntryFunc (GLUTentryCB func) -{ - g_curwin->entry = func; -} - - - -void APIENTRY glutVisibilityFunc (GLUTvisibilityCB func) -{ - g_curwin->visibility = func; -} - - - -void APIENTRY glutWindowStatusFunc (GLUTwindowStatusCB func) -{ -} - - - -void APIENTRY glutIdleFunc (GLUTidleCB func) -{ - g_idle_func = func; -} - - - -void APIENTRY glutTimerFunc (unsigned int millis, GLUTtimerCB func, int value) -{ -} - - - -void APIENTRY glutSpecialFunc (GLUTspecialCB func) -{ - g_curwin->special = func; -} - - - -void APIENTRY glutSpaceballMotionFunc (GLUTspaceMotionCB func) -{ -} - - - -void APIENTRY glutSpaceballRotateFunc (GLUTspaceRotateCB func) -{ -} - - - -void APIENTRY glutSpaceballButtonFunc (GLUTspaceButtonCB func) -{ -} - - - -void APIENTRY glutDialsFunc (GLUTdialsCB func) -{ -} - - - -void APIENTRY glutButtonBoxFunc (GLUTbuttonBoxCB func) -{ -} - - - -void APIENTRY glutTabletMotionFunc (GLUTtabletMotionCB func) -{ -} - - - -void APIENTRY glutTabletButtonFunc (GLUTtabletButtonCB func) -{ -} - - - -void APIENTRY glutJoystickFunc (GLUTjoystickCB func, int interval) -{ -} +/* + * Mesa 3-D graphics library + * Version: 3.4 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include "glutint.h" + + + +GLUTidleCB g_idle_func = NULL; + + + +void APIENTRY glutDisplayFunc (GLUTdisplayCB func) +{ + g_curwin->display = func; +} + + + +void APIENTRY glutReshapeFunc (GLUTreshapeCB func) +{ + g_curwin->reshape = func; +} + + + +void APIENTRY glutKeyboardFunc (GLUTkeyboardCB func) +{ + g_curwin->keyboard = func; +} + + + +void APIENTRY glutMouseFunc (GLUTmouseCB func) +{ + g_curwin->mouse = func; +} + + + +void APIENTRY glutMotionFunc (GLUTmotionCB func) +{ + g_curwin->motion = func; +} + + + +void APIENTRY glutPassiveMotionFunc (GLUTpassiveCB func) +{ + g_curwin->passive = func; +} + + + +void APIENTRY glutEntryFunc (GLUTentryCB func) +{ + g_curwin->entry = func; +} + + + +void APIENTRY glutVisibilityFunc (GLUTvisibilityCB func) +{ + g_curwin->visibility = func; +} + + + +void APIENTRY glutWindowStatusFunc (GLUTwindowStatusCB func) +{ +} + + + +void APIENTRY glutIdleFunc (GLUTidleCB func) +{ + g_idle_func = func; +} + + + +void APIENTRY glutTimerFunc (unsigned int millis, GLUTtimerCB func, int value) +{ +} + + + +void APIENTRY glutSpecialFunc (GLUTspecialCB func) +{ + g_curwin->special = func; +} + + + +void APIENTRY glutSpaceballMotionFunc (GLUTspaceMotionCB func) +{ +} + + + +void APIENTRY glutSpaceballRotateFunc (GLUTspaceRotateCB func) +{ +} + + + +void APIENTRY glutSpaceballButtonFunc (GLUTspaceButtonCB func) +{ +} + + + +void APIENTRY glutDialsFunc (GLUTdialsCB func) +{ +} + + + +void APIENTRY glutButtonBoxFunc (GLUTbuttonBoxCB func) +{ +} + + + +void APIENTRY glutTabletMotionFunc (GLUTtabletMotionCB func) +{ +} + + + +void APIENTRY glutTabletButtonFunc (GLUTtabletButtonCB func) +{ +} + + + +void APIENTRY glutJoystickFunc (GLUTjoystickCB func, int interval) +{ +} diff --git a/src/glut/dos/color.c b/src/glut/dos/color.c index 490839968ec..cfb2ff926af 100644 --- a/src/glut/dos/color.c +++ b/src/glut/dos/color.c @@ -1,59 +1,59 @@ -/* - * Mesa 3-D graphics library - * Version: 3.4 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include "glutint.h" -#include "GL/dmesa.h" - - - -#define CLAMP(i) ((i) > 1.0 ? 1.0 : ((i) < 0.0 ? 0.0 : (i))) - - - -void APIENTRY glutSetColor (int ndx, GLfloat red, GLfloat green, GLfloat blue) -{ - if (g_display_mode & GLUT_INDEX) { - if ((ndx >= 0) && (ndx < (256 - RESERVED_COLORS))) { - DMesaSetCI(ndx, CLAMP(red), CLAMP(green), CLAMP(blue)); - } - } -} - - - -GLfloat APIENTRY glutGetColor (int ndx, int component) -{ - return 0.0; -} - - - -void APIENTRY glutCopyColormap (int win) -{ -} +/* + * Mesa 3-D graphics library + * Version: 3.4 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include "glutint.h" +#include "GL/dmesa.h" + + + +#define CLAMP(i) ((i) > 1.0 ? 1.0 : ((i) < 0.0 ? 0.0 : (i))) + + + +void APIENTRY glutSetColor (int ndx, GLfloat red, GLfloat green, GLfloat blue) +{ + if (g_display_mode & GLUT_INDEX) { + if ((ndx >= 0) && (ndx < (256 - RESERVED_COLORS))) { + DMesaSetCI(ndx, CLAMP(red), CLAMP(green), CLAMP(blue)); + } + } +} + + + +GLfloat APIENTRY glutGetColor (int ndx, int component) +{ + return 0.0; +} + + + +void APIENTRY glutCopyColormap (int win) +{ +} diff --git a/src/glut/dos/extens.c b/src/glut/dos/extens.c index ca4da058cd0..bc6cfe0f5ff 100644 --- a/src/glut/dos/extens.c +++ b/src/glut/dos/extens.c @@ -1,63 +1,63 @@ -/* - * Mesa 3-D graphics library - * Version: 3.4 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include - -#include "GL/glut.h" - - - -int APIENTRY glutExtensionSupported (const char *extension) -{ - static const GLubyte *extensions = NULL; - const GLubyte *last, *where; - - /* Extension names should not have spaces. */ - if (strchr(extension, ' ') || *extension == '\0') { - return GL_FALSE; - } - - /* Not my problem if you don't have a valid OpenGL context */ - if (!extensions) { - extensions = glGetString(GL_EXTENSIONS); - } - - /* Take care of sub-strings etc. */ - for (last = extensions;;) { - if ((where = (GLubyte *)strstr((const char *)last, extension)) == NULL) { - return GL_FALSE; - } - last = where + strlen(extension); - if (where == extensions || *(where - 1) == ' ') { - if (*last == ' ' || *last == '\0') { - return GL_TRUE; - } - } - } -} +/* + * Mesa 3-D graphics library + * Version: 3.4 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include + +#include "GL/glut.h" + + + +int APIENTRY glutExtensionSupported (const char *extension) +{ + static const GLubyte *extensions = NULL; + const GLubyte *last, *where; + + /* Extension names should not have spaces. */ + if (strchr(extension, ' ') || *extension == '\0') { + return GL_FALSE; + } + + /* Not my problem if you don't have a valid OpenGL context */ + if (!extensions) { + extensions = glGetString(GL_EXTENSIONS); + } + + /* Take care of sub-strings etc. */ + for (last = extensions;;) { + if ((where = (GLubyte *)strstr((const char *)last, extension)) == NULL) { + return GL_FALSE; + } + last = where + strlen(extension); + if (where == extensions || *(where - 1) == ' ') { + if (*last == ' ' || *last == '\0') { + return GL_TRUE; + } + } + } +} diff --git a/src/glut/dos/glutint.h b/src/glut/dos/glutint.h index dfc42754df8..e8dffb581be 100644 --- a/src/glut/dos/glutint.h +++ b/src/glut/dos/glutint.h @@ -1,150 +1,150 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef __glutint_h__ -#define __glutint_h__ - -#include - -#include "GL/dmesa.h" - - - -/* GLUT function types */ -typedef void (GLUTCALLBACK *GLUTdisplayCB) (void); -typedef void (GLUTCALLBACK *GLUTreshapeCB) (int, int); -typedef void (GLUTCALLBACK *GLUTkeyboardCB) (unsigned char, int, int); -typedef void (GLUTCALLBACK *GLUTmouseCB) (int, int, int, int); -typedef void (GLUTCALLBACK *GLUTmotionCB) (int, int); -typedef void (GLUTCALLBACK *GLUTpassiveCB) (int, int); -typedef void (GLUTCALLBACK *GLUTentryCB) (int); -typedef void (GLUTCALLBACK *GLUTvisibilityCB) (int); -typedef void (GLUTCALLBACK *GLUTwindowStatusCB) (int); -typedef void (GLUTCALLBACK *GLUTidleCB) (void); -typedef void (GLUTCALLBACK *GLUTtimerCB) (int); -typedef void (GLUTCALLBACK *GLUTmenuStateCB) (int); /* DEPRECATED. */ -typedef void (GLUTCALLBACK *GLUTmenuStatusCB) (int, int, int); -typedef void (GLUTCALLBACK *GLUTselectCB) (int); -typedef void (GLUTCALLBACK *GLUTspecialCB) (int, int, int); -typedef void (GLUTCALLBACK *GLUTspaceMotionCB) (int, int, int); -typedef void (GLUTCALLBACK *GLUTspaceRotateCB) (int, int, int); -typedef void (GLUTCALLBACK *GLUTspaceButtonCB) (int, int); -typedef void (GLUTCALLBACK *GLUTdialsCB) (int, int); -typedef void (GLUTCALLBACK *GLUTbuttonBoxCB) (int, int); -typedef void (GLUTCALLBACK *GLUTtabletMotionCB) (int, int); -typedef void (GLUTCALLBACK *GLUTtabletButtonCB) (int, int, int, int); -typedef void (GLUTCALLBACK *GLUTjoystickCB) (unsigned int, int, int, int); - -typedef struct GLUTwindow { - int num; /* window id */ - - DMesaBuffer buffer; - - int show_mouse; - - /* GLUT settable or visible window state. */ - int xpos; - int ypos; - int width; /* window width in pixels */ - int height; /* window height in pixels */ - - /* Per-window callbacks. */ - GLUTdisplayCB display; /* redraw */ - GLUTreshapeCB reshape; /* resize (width,height) */ - GLUTmouseCB mouse; /* mouse (button,state,x,y) */ - GLUTmotionCB motion; /* motion (x,y) */ - GLUTpassiveCB passive; /* passive motion (x,y) */ - GLUTentryCB entry; /* window entry/exit (state) */ - GLUTkeyboardCB keyboard; /* keyboard (ASCII,x,y) */ - GLUTkeyboardCB keyboardUp; /* keyboard up (ASCII,x,y) */ - GLUTwindowStatusCB windowStatus; /* window status */ - GLUTvisibilityCB visibility; /* visibility */ - GLUTspecialCB special; /* special key */ - GLUTspecialCB specialUp; /* special up key */ - GLUTbuttonBoxCB buttonBox; /* button box */ - GLUTdialsCB dials; /* dials */ - GLUTspaceMotionCB spaceMotion; /* Spaceball motion */ - GLUTspaceRotateCB spaceRotate; /* Spaceball rotate */ - GLUTspaceButtonCB spaceButton; /* Spaceball button */ - GLUTtabletMotionCB tabletMotion; /* tablet motion */ - GLUTtabletButtonCB tabletButton; /* tablet button */ - GLUTjoystickCB joystick; /* joystick */ -} GLUTwindow; - -extern GLUTidleCB g_idle_func; -extern GLUTmenuStatusCB g_menu_status_func; - -extern GLboolean g_redisplay; - -extern GLuint g_bpp; /* HW: bits per pixel */ -extern GLuint g_refresh; /* HW: vertical refresh rate */ -extern GLuint g_screen_w, g_screen_h; /* HW: physical screen size */ -extern GLint g_driver_caps; - -extern GLuint g_fps; - -extern GLuint g_display_mode; /* display bits */ -extern int g_init_x, g_init_y; /* initial window position */ -extern GLuint g_init_w, g_init_h; /* initial window size */ - -extern int g_mouse; /* non-zero if mouse installed */ -extern int g_mouse_x, g_mouse_y; /* mouse coords, relative to current win */ - -extern GLUTwindow *g_curwin; /* current window */ - -extern char *__glutProgramName; /* program name */ - -extern void __glutInitMouse (void); - -/* private routines from glut_util.c */ -extern char * __glutStrdup(const char *string); -extern void __glutWarning(char *format,...); -extern void __glutFatalError(char *format,...); -extern void __glutFatalUsage(char *format,...); - - - -/* hmmm... */ -#include "pc_hw/pc_hw.h" - - - -#define MAX_WINDOWS 2 - -#define DEFAULT_WIDTH 300 -#define DEFAULT_HEIGHT 300 -#define DEFAULT_BPP 16 - -#define DEPTH_SIZE 16 -#define STENCIL_SIZE 8 -#define ACCUM_SIZE 16 - -#define RESERVED_COLORS 0 - -#endif /* __glutint_h__ */ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef __glutint_h__ +#define __glutint_h__ + +#include + +#include "GL/dmesa.h" + + + +/* GLUT function types */ +typedef void (GLUTCALLBACK *GLUTdisplayCB) (void); +typedef void (GLUTCALLBACK *GLUTreshapeCB) (int, int); +typedef void (GLUTCALLBACK *GLUTkeyboardCB) (unsigned char, int, int); +typedef void (GLUTCALLBACK *GLUTmouseCB) (int, int, int, int); +typedef void (GLUTCALLBACK *GLUTmotionCB) (int, int); +typedef void (GLUTCALLBACK *GLUTpassiveCB) (int, int); +typedef void (GLUTCALLBACK *GLUTentryCB) (int); +typedef void (GLUTCALLBACK *GLUTvisibilityCB) (int); +typedef void (GLUTCALLBACK *GLUTwindowStatusCB) (int); +typedef void (GLUTCALLBACK *GLUTidleCB) (void); +typedef void (GLUTCALLBACK *GLUTtimerCB) (int); +typedef void (GLUTCALLBACK *GLUTmenuStateCB) (int); /* DEPRECATED. */ +typedef void (GLUTCALLBACK *GLUTmenuStatusCB) (int, int, int); +typedef void (GLUTCALLBACK *GLUTselectCB) (int); +typedef void (GLUTCALLBACK *GLUTspecialCB) (int, int, int); +typedef void (GLUTCALLBACK *GLUTspaceMotionCB) (int, int, int); +typedef void (GLUTCALLBACK *GLUTspaceRotateCB) (int, int, int); +typedef void (GLUTCALLBACK *GLUTspaceButtonCB) (int, int); +typedef void (GLUTCALLBACK *GLUTdialsCB) (int, int); +typedef void (GLUTCALLBACK *GLUTbuttonBoxCB) (int, int); +typedef void (GLUTCALLBACK *GLUTtabletMotionCB) (int, int); +typedef void (GLUTCALLBACK *GLUTtabletButtonCB) (int, int, int, int); +typedef void (GLUTCALLBACK *GLUTjoystickCB) (unsigned int, int, int, int); + +typedef struct GLUTwindow { + int num; /* window id */ + + DMesaBuffer buffer; + + int show_mouse; + + /* GLUT settable or visible window state. */ + int xpos; + int ypos; + int width; /* window width in pixels */ + int height; /* window height in pixels */ + + /* Per-window callbacks. */ + GLUTdisplayCB display; /* redraw */ + GLUTreshapeCB reshape; /* resize (width,height) */ + GLUTmouseCB mouse; /* mouse (button,state,x,y) */ + GLUTmotionCB motion; /* motion (x,y) */ + GLUTpassiveCB passive; /* passive motion (x,y) */ + GLUTentryCB entry; /* window entry/exit (state) */ + GLUTkeyboardCB keyboard; /* keyboard (ASCII,x,y) */ + GLUTkeyboardCB keyboardUp; /* keyboard up (ASCII,x,y) */ + GLUTwindowStatusCB windowStatus; /* window status */ + GLUTvisibilityCB visibility; /* visibility */ + GLUTspecialCB special; /* special key */ + GLUTspecialCB specialUp; /* special up key */ + GLUTbuttonBoxCB buttonBox; /* button box */ + GLUTdialsCB dials; /* dials */ + GLUTspaceMotionCB spaceMotion; /* Spaceball motion */ + GLUTspaceRotateCB spaceRotate; /* Spaceball rotate */ + GLUTspaceButtonCB spaceButton; /* Spaceball button */ + GLUTtabletMotionCB tabletMotion; /* tablet motion */ + GLUTtabletButtonCB tabletButton; /* tablet button */ + GLUTjoystickCB joystick; /* joystick */ +} GLUTwindow; + +extern GLUTidleCB g_idle_func; +extern GLUTmenuStatusCB g_menu_status_func; + +extern GLboolean g_redisplay; + +extern GLuint g_bpp; /* HW: bits per pixel */ +extern GLuint g_refresh; /* HW: vertical refresh rate */ +extern GLuint g_screen_w, g_screen_h; /* HW: physical screen size */ +extern GLint g_driver_caps; + +extern GLuint g_fps; + +extern GLuint g_display_mode; /* display bits */ +extern int g_init_x, g_init_y; /* initial window position */ +extern GLuint g_init_w, g_init_h; /* initial window size */ + +extern int g_mouse; /* non-zero if mouse installed */ +extern int g_mouse_x, g_mouse_y; /* mouse coords, relative to current win */ + +extern GLUTwindow *g_curwin; /* current window */ + +extern char *__glutProgramName; /* program name */ + +extern void __glutInitMouse (void); + +/* private routines from glut_util.c */ +extern char * __glutStrdup(const char *string); +extern void __glutWarning(char *format,...); +extern void __glutFatalError(char *format,...); +extern void __glutFatalUsage(char *format,...); + + + +/* hmmm... */ +#include "pc_hw/pc_hw.h" + + + +#define MAX_WINDOWS 2 + +#define DEFAULT_WIDTH 300 +#define DEFAULT_HEIGHT 300 +#define DEFAULT_BPP 16 + +#define DEPTH_SIZE 16 +#define STENCIL_SIZE 8 +#define ACCUM_SIZE 16 + +#define RESERVED_COLORS 0 + +#endif /* __glutint_h__ */ diff --git a/src/glut/dos/init.c b/src/glut/dos/init.c index 9553cf2532e..5d09561dac3 100644 --- a/src/glut/dos/init.c +++ b/src/glut/dos/init.c @@ -1,254 +1,254 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include - -#include "glutint.h" - - - -GLboolean g_redisplay = GL_FALSE; - -GLuint g_bpp = DEFAULT_BPP; -GLuint g_refresh = 0; -GLuint g_screen_w, g_screen_h; -GLint g_driver_caps; - -GLuint g_fps = 0; - -GLuint g_display_mode = 0; -int g_init_x = 0, g_init_y = 0; -GLuint g_init_w = DEFAULT_WIDTH, g_init_h = DEFAULT_HEIGHT; - -char *__glutProgramName = NULL; - - - -void APIENTRY glutInit (int *argc, char **argv) -{ - char *str; - const char *env; - - if ((env = getenv("DMESA_GLUT_BPP")) != NULL) { - g_bpp = atoi(env); - } - if ((env = getenv("DMESA_GLUT_REFRESH")) != NULL) { - g_refresh = atoi(env); - } - - /* Determine program name. */ - str = strrchr(argv[0], '/'); - if (str == NULL) { - str = argv[0]; - } else { - str++; - } - __glutProgramName = __glutStrdup(str); - - /* check if GLUT_FPS env var is set */ - if ((env = getenv("GLUT_FPS")) != NULL) { - if ((g_fps = atoi(env)) <= 0) { - g_fps = 5000; /* 5000 milliseconds */ - } - } - - /* Initialize timer */ - glutGet(GLUT_ELAPSED_TIME); -} - - - -void APIENTRY glutInitDisplayMode (unsigned int mode) -{ - g_display_mode = mode; -} - - - -void APIENTRY glutInitWindowPosition (int x, int y) -{ - g_init_x = x; - g_init_y = y; -} - - - -void APIENTRY glutInitWindowSize (int width, int height) -{ - g_init_w = width; - g_init_h = height; -} - - - -void APIENTRY glutMainLoop (void) -{ - GLboolean idle; - static int old_mouse_x = 0; - static int old_mouse_y = 0; - static int old_mouse_b = 0; - - { - GLint screen_size[2]; - DMesaGetIntegerv(DMESA_GET_SCREEN_SIZE, screen_size); - g_screen_w = screen_size[0]; - g_screen_h = screen_size[1]; - DMesaGetIntegerv(DMESA_GET_DRIVER_CAPS, &g_driver_caps); - } - - pc_install_keyb(); - __glutInitMouse(); - - glutPostRedisplay(); - if (g_curwin->reshape) { - g_curwin->reshape(g_curwin->width, g_curwin->height); - } - if (g_curwin->visibility) { - g_curwin->visibility(GLUT_VISIBLE); - } - - while (GL_TRUE) { - idle = GL_TRUE; - - if (g_redisplay && g_curwin->display) { - idle = GL_FALSE; - g_redisplay = GL_FALSE; - - if (g_curwin->show_mouse && !(g_display_mode & GLUT_DOUBLE)) { - /* XXX scare mouse */ - g_curwin->display(); - /* XXX unscare mouse */ - } else { - g_curwin->display(); - } - } - - if (g_mouse) { - int mouse_x; - int mouse_y; - int mouse_z; - int mouse_b; - - /* query mouse */ - mouse_b = pc_query_mouse(&mouse_x, &mouse_y, &mouse_z); - - /* relative to window coordinates */ - g_mouse_x = mouse_x - g_curwin->xpos; - g_mouse_y = mouse_y - g_curwin->ypos; - - /* mouse was moved? */ - if ((mouse_x != old_mouse_x) || (mouse_y != old_mouse_y)) { - idle = GL_FALSE; - old_mouse_x = mouse_x; - old_mouse_y = mouse_y; - - if (mouse_b) { - /* any button pressed */ - if (g_curwin->motion) { - g_curwin->motion(g_mouse_x, g_mouse_y); - } - } else { - /* no button pressed */ - if (g_curwin->passive) { - g_curwin->passive(g_mouse_x, g_mouse_y); - } - } - } - - /* button state changed? */ - if (mouse_b != old_mouse_b) { - GLUTmouseCB mouse_func; - - if ((mouse_func = g_curwin->mouse)) { - if ((old_mouse_b & 1) && !(mouse_b & 1)) - mouse_func(GLUT_LEFT_BUTTON, GLUT_UP, g_mouse_x, g_mouse_y); - else if (!(old_mouse_b & 1) && (mouse_b & 1)) - mouse_func(GLUT_LEFT_BUTTON, GLUT_DOWN, g_mouse_x, g_mouse_y); - - if ((old_mouse_b & 2) && !(mouse_b & 2)) - mouse_func(GLUT_RIGHT_BUTTON, GLUT_UP, g_mouse_x, g_mouse_y); - else if (!(old_mouse_b & 2) && (mouse_b & 2)) - mouse_func(GLUT_RIGHT_BUTTON, GLUT_DOWN, g_mouse_x, g_mouse_y); - - if ((old_mouse_b & 4) && !(mouse_b & 4)) - mouse_func(GLUT_MIDDLE_BUTTON, GLUT_UP, g_mouse_x, g_mouse_y); - else if (!(old_mouse_b & 3) && (mouse_b & 4)) - mouse_func(GLUT_MIDDLE_BUTTON, GLUT_DOWN, g_mouse_x, g_mouse_y); - } - - idle = GL_FALSE; - old_mouse_b = mouse_b; - } - } - - if (pc_keypressed()) { - int key; - int glut_key; - - idle = GL_FALSE; - key = pc_readkey(); - - switch (key>>16) { - case KEY_F1: glut_key = GLUT_KEY_F1; goto special; - case KEY_F2: glut_key = GLUT_KEY_F2; goto special; - case KEY_F3: glut_key = GLUT_KEY_F3; goto special; - case KEY_F4: glut_key = GLUT_KEY_F4; goto special; - case KEY_F5: glut_key = GLUT_KEY_F5; goto special; - case KEY_F6: glut_key = GLUT_KEY_F6; goto special; - case KEY_F7: glut_key = GLUT_KEY_F7; goto special; - case KEY_F8: glut_key = GLUT_KEY_F8; goto special; - case KEY_F9: glut_key = GLUT_KEY_F9; goto special; - case KEY_F10: glut_key = GLUT_KEY_F10; goto special; - case KEY_F11: glut_key = GLUT_KEY_F11; goto special; - case KEY_F12: glut_key = GLUT_KEY_F12; goto special; - case KEY_LEFT: glut_key = GLUT_KEY_LEFT; goto special; - case KEY_UP: glut_key = GLUT_KEY_UP; goto special; - case KEY_RIGHT: glut_key = GLUT_KEY_RIGHT; goto special; - case KEY_DOWN: glut_key = GLUT_KEY_DOWN; goto special; - case KEY_PGUP: glut_key = GLUT_KEY_PAGE_UP; goto special; - case KEY_PGDN: glut_key = GLUT_KEY_PAGE_DOWN; goto special; - case KEY_HOME: glut_key = GLUT_KEY_HOME; goto special; - case KEY_END: glut_key = GLUT_KEY_END; goto special; - case KEY_INSERT: glut_key = GLUT_KEY_INSERT; goto special; - special: - if (g_curwin->special) { - g_curwin->special(glut_key, g_mouse_x, g_mouse_y); - } - break; - default: - if (g_curwin->keyboard) { - g_curwin->keyboard(key & 0xFF, g_mouse_x, g_mouse_y); - } - } - } - - if (idle && g_idle_func) - g_idle_func(); - } -} +/* + * Mesa 3-D graphics library + * Version: 4.0 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include + +#include "glutint.h" + + + +GLboolean g_redisplay = GL_FALSE; + +GLuint g_bpp = DEFAULT_BPP; +GLuint g_refresh = 0; +GLuint g_screen_w, g_screen_h; +GLint g_driver_caps; + +GLuint g_fps = 0; + +GLuint g_display_mode = 0; +int g_init_x = 0, g_init_y = 0; +GLuint g_init_w = DEFAULT_WIDTH, g_init_h = DEFAULT_HEIGHT; + +char *__glutProgramName = NULL; + + + +void APIENTRY glutInit (int *argc, char **argv) +{ + char *str; + const char *env; + + if ((env = getenv("DMESA_GLUT_BPP")) != NULL) { + g_bpp = atoi(env); + } + if ((env = getenv("DMESA_GLUT_REFRESH")) != NULL) { + g_refresh = atoi(env); + } + + /* Determine program name. */ + str = strrchr(argv[0], '/'); + if (str == NULL) { + str = argv[0]; + } else { + str++; + } + __glutProgramName = __glutStrdup(str); + + /* check if GLUT_FPS env var is set */ + if ((env = getenv("GLUT_FPS")) != NULL) { + if ((g_fps = atoi(env)) <= 0) { + g_fps = 5000; /* 5000 milliseconds */ + } + } + + /* Initialize timer */ + glutGet(GLUT_ELAPSED_TIME); +} + + + +void APIENTRY glutInitDisplayMode (unsigned int mode) +{ + g_display_mode = mode; +} + + + +void APIENTRY glutInitWindowPosition (int x, int y) +{ + g_init_x = x; + g_init_y = y; +} + + + +void APIENTRY glutInitWindowSize (int width, int height) +{ + g_init_w = width; + g_init_h = height; +} + + + +void APIENTRY glutMainLoop (void) +{ + GLboolean idle; + static int old_mouse_x = 0; + static int old_mouse_y = 0; + static int old_mouse_b = 0; + + { + GLint screen_size[2]; + DMesaGetIntegerv(DMESA_GET_SCREEN_SIZE, screen_size); + g_screen_w = screen_size[0]; + g_screen_h = screen_size[1]; + DMesaGetIntegerv(DMESA_GET_DRIVER_CAPS, &g_driver_caps); + } + + pc_install_keyb(); + __glutInitMouse(); + + glutPostRedisplay(); + if (g_curwin->reshape) { + g_curwin->reshape(g_curwin->width, g_curwin->height); + } + if (g_curwin->visibility) { + g_curwin->visibility(GLUT_VISIBLE); + } + + while (GL_TRUE) { + idle = GL_TRUE; + + if (g_redisplay && g_curwin->display) { + idle = GL_FALSE; + g_redisplay = GL_FALSE; + + if (g_curwin->show_mouse && !(g_display_mode & GLUT_DOUBLE)) { + /* XXX scare mouse */ + g_curwin->display(); + /* XXX unscare mouse */ + } else { + g_curwin->display(); + } + } + + if (g_mouse) { + int mouse_x; + int mouse_y; + int mouse_z; + int mouse_b; + + /* query mouse */ + mouse_b = pc_query_mouse(&mouse_x, &mouse_y, &mouse_z); + + /* relative to window coordinates */ + g_mouse_x = mouse_x - g_curwin->xpos; + g_mouse_y = mouse_y - g_curwin->ypos; + + /* mouse was moved? */ + if ((mouse_x != old_mouse_x) || (mouse_y != old_mouse_y)) { + idle = GL_FALSE; + old_mouse_x = mouse_x; + old_mouse_y = mouse_y; + + if (mouse_b) { + /* any button pressed */ + if (g_curwin->motion) { + g_curwin->motion(g_mouse_x, g_mouse_y); + } + } else { + /* no button pressed */ + if (g_curwin->passive) { + g_curwin->passive(g_mouse_x, g_mouse_y); + } + } + } + + /* button state changed? */ + if (mouse_b != old_mouse_b) { + GLUTmouseCB mouse_func; + + if ((mouse_func = g_curwin->mouse)) { + if ((old_mouse_b & 1) && !(mouse_b & 1)) + mouse_func(GLUT_LEFT_BUTTON, GLUT_UP, g_mouse_x, g_mouse_y); + else if (!(old_mouse_b & 1) && (mouse_b & 1)) + mouse_func(GLUT_LEFT_BUTTON, GLUT_DOWN, g_mouse_x, g_mouse_y); + + if ((old_mouse_b & 2) && !(mouse_b & 2)) + mouse_func(GLUT_RIGHT_BUTTON, GLUT_UP, g_mouse_x, g_mouse_y); + else if (!(old_mouse_b & 2) && (mouse_b & 2)) + mouse_func(GLUT_RIGHT_BUTTON, GLUT_DOWN, g_mouse_x, g_mouse_y); + + if ((old_mouse_b & 4) && !(mouse_b & 4)) + mouse_func(GLUT_MIDDLE_BUTTON, GLUT_UP, g_mouse_x, g_mouse_y); + else if (!(old_mouse_b & 3) && (mouse_b & 4)) + mouse_func(GLUT_MIDDLE_BUTTON, GLUT_DOWN, g_mouse_x, g_mouse_y); + } + + idle = GL_FALSE; + old_mouse_b = mouse_b; + } + } + + if (pc_keypressed()) { + int key; + int glut_key; + + idle = GL_FALSE; + key = pc_readkey(); + + switch (key>>16) { + case KEY_F1: glut_key = GLUT_KEY_F1; goto special; + case KEY_F2: glut_key = GLUT_KEY_F2; goto special; + case KEY_F3: glut_key = GLUT_KEY_F3; goto special; + case KEY_F4: glut_key = GLUT_KEY_F4; goto special; + case KEY_F5: glut_key = GLUT_KEY_F5; goto special; + case KEY_F6: glut_key = GLUT_KEY_F6; goto special; + case KEY_F7: glut_key = GLUT_KEY_F7; goto special; + case KEY_F8: glut_key = GLUT_KEY_F8; goto special; + case KEY_F9: glut_key = GLUT_KEY_F9; goto special; + case KEY_F10: glut_key = GLUT_KEY_F10; goto special; + case KEY_F11: glut_key = GLUT_KEY_F11; goto special; + case KEY_F12: glut_key = GLUT_KEY_F12; goto special; + case KEY_LEFT: glut_key = GLUT_KEY_LEFT; goto special; + case KEY_UP: glut_key = GLUT_KEY_UP; goto special; + case KEY_RIGHT: glut_key = GLUT_KEY_RIGHT; goto special; + case KEY_DOWN: glut_key = GLUT_KEY_DOWN; goto special; + case KEY_PGUP: glut_key = GLUT_KEY_PAGE_UP; goto special; + case KEY_PGDN: glut_key = GLUT_KEY_PAGE_DOWN; goto special; + case KEY_HOME: glut_key = GLUT_KEY_HOME; goto special; + case KEY_END: glut_key = GLUT_KEY_END; goto special; + case KEY_INSERT: glut_key = GLUT_KEY_INSERT; goto special; + special: + if (g_curwin->special) { + g_curwin->special(glut_key, g_mouse_x, g_mouse_y); + } + break; + default: + if (g_curwin->keyboard) { + g_curwin->keyboard(key & 0xFF, g_mouse_x, g_mouse_y); + } + } + } + + if (idle && g_idle_func) + g_idle_func(); + } +} diff --git a/src/glut/dos/menu.c b/src/glut/dos/menu.c index e8f7b0a75b0..31e05f0c472 100644 --- a/src/glut/dos/menu.c +++ b/src/glut/dos/menu.c @@ -1,116 +1,116 @@ -/* - * Mesa 3-D graphics library - * Version: 3.4 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include "glutint.h" - - - -GLUTmenuStatusCB g_menu_status_func = NULL; - - - -void APIENTRY glutMenuStateFunc (GLUTmenuStateCB func) -{ - g_menu_status_func = (GLUTmenuStatusCB)func; -} - - - -void APIENTRY glutMenuStatusFunc (GLUTmenuStatusCB func) -{ - g_menu_status_func = func; -} - - - -int APIENTRY glutCreateMenu (GLUTselectCB func) -{ - return 0; -} - - - -void APIENTRY glutDestroyMenu (int menu) -{ -} - - - -int APIENTRY glutGetMenu (void) -{ - return 0; -} - - - -void APIENTRY glutSetMenu (int menu) -{ -} - - - -void APIENTRY glutAddMenuEntry (const char *label, int value) -{ -} - - - -void APIENTRY glutAddSubMenu (const char *label, int submenu) -{ -} - - - -void APIENTRY glutChangeToMenuEntry (int item, const char *label, int value) -{ -} - - - -void APIENTRY glutChangeToSubMenu (int item, const char *label, int submenu) -{ -} - - - -void APIENTRY glutRemoveMenuItem (int item) -{ -} - - - -void APIENTRY glutAttachMenu (int button) -{ -} - - - -void APIENTRY glutDetachMenu (int button) -{ -} +/* + * Mesa 3-D graphics library + * Version: 3.4 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include "glutint.h" + + + +GLUTmenuStatusCB g_menu_status_func = NULL; + + + +void APIENTRY glutMenuStateFunc (GLUTmenuStateCB func) +{ + g_menu_status_func = (GLUTmenuStatusCB)func; +} + + + +void APIENTRY glutMenuStatusFunc (GLUTmenuStatusCB func) +{ + g_menu_status_func = func; +} + + + +int APIENTRY glutCreateMenu (GLUTselectCB func) +{ + return 0; +} + + + +void APIENTRY glutDestroyMenu (int menu) +{ +} + + + +int APIENTRY glutGetMenu (void) +{ + return 0; +} + + + +void APIENTRY glutSetMenu (int menu) +{ +} + + + +void APIENTRY glutAddMenuEntry (const char *label, int value) +{ +} + + + +void APIENTRY glutAddSubMenu (const char *label, int submenu) +{ +} + + + +void APIENTRY glutChangeToMenuEntry (int item, const char *label, int value) +{ +} + + + +void APIENTRY glutChangeToSubMenu (int item, const char *label, int submenu) +{ +} + + + +void APIENTRY glutRemoveMenuItem (int item) +{ +} + + + +void APIENTRY glutAttachMenu (int button) +{ +} + + + +void APIENTRY glutDetachMenu (int button) +{ +} diff --git a/src/glut/dos/mouse.c b/src/glut/dos/mouse.c index 7ba6358bc26..373ac49ffed 100644 --- a/src/glut/dos/mouse.c +++ b/src/glut/dos/mouse.c @@ -1,60 +1,60 @@ -/* - * Mesa 3-D graphics library - * Version: 3.4 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include "glutint.h" - - - -int g_mouse; -int g_mouse_x = 0, g_mouse_y = 0; - - - -void __glutInitMouse (void) -{ - if ((g_mouse = pc_install_mouse())) { - pc_mouse_area(g_curwin->xpos, g_curwin->ypos, g_curwin->xpos + g_curwin->width - 1, g_curwin->ypos + g_curwin->height - 1); - - g_curwin->show_mouse = (g_curwin->mouse || g_curwin->motion || g_curwin->passive); - } -} - - - -void APIENTRY glutSetCursor (int cursor) -{ - /* XXX completely futile until full mouse support (maybe never) */ -} - - - -void APIENTRY glutWarpPointer (int x, int y) -{ - pc_warp_mouse(x, y); -} +/* + * Mesa 3-D graphics library + * Version: 3.4 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include "glutint.h" + + + +int g_mouse; +int g_mouse_x = 0, g_mouse_y = 0; + + + +void __glutInitMouse (void) +{ + if ((g_mouse = pc_install_mouse())) { + pc_mouse_area(g_curwin->xpos, g_curwin->ypos, g_curwin->xpos + g_curwin->width - 1, g_curwin->ypos + g_curwin->height - 1); + + g_curwin->show_mouse = (g_curwin->mouse || g_curwin->motion || g_curwin->passive); + } +} + + + +void APIENTRY glutSetCursor (int cursor) +{ + /* XXX completely futile until full mouse support (maybe never) */ +} + + + +void APIENTRY glutWarpPointer (int x, int y) +{ + pc_warp_mouse(x, y); +} diff --git a/src/glut/dos/overlay.c b/src/glut/dos/overlay.c index d0e2a859c7b..b36f94c49a5 100644 --- a/src/glut/dos/overlay.c +++ b/src/glut/dos/overlay.c @@ -1,91 +1,91 @@ -/* - * Mesa 3-D graphics library - * Version: 3.4 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include "glutint.h" - - - -int APIENTRY glutLayerGet (GLenum info) -{ - switch (info) { - case GLUT_OVERLAY_POSSIBLE: - case GLUT_HAS_OVERLAY: - return GL_FALSE; - case GLUT_LAYER_IN_USE: - return GLUT_NORMAL; - case GLUT_NORMAL_DAMAGED: - return GL_FALSE; - case GLUT_OVERLAY_DAMAGED: - case GLUT_TRANSPARENT_INDEX: - default: - return -1; - } -} - - - -void APIENTRY glutOverlayDisplayFunc (GLUTdisplayCB func) -{ -} - - - -void APIENTRY glutEstablishOverlay (void) -{ -} - - - -void APIENTRY glutRemoveOverlay (void) -{ -} - - - -void APIENTRY glutUseLayer (GLenum layer) -{ -} - - - -void APIENTRY glutPostOverlayRedisplay (void) -{ -} - - - -void APIENTRY glutShowOverlay (void) -{ -} - - - -void APIENTRY glutHideOverlay (void) -{ -} +/* + * Mesa 3-D graphics library + * Version: 3.4 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include "glutint.h" + + + +int APIENTRY glutLayerGet (GLenum info) +{ + switch (info) { + case GLUT_OVERLAY_POSSIBLE: + case GLUT_HAS_OVERLAY: + return GL_FALSE; + case GLUT_LAYER_IN_USE: + return GLUT_NORMAL; + case GLUT_NORMAL_DAMAGED: + return GL_FALSE; + case GLUT_OVERLAY_DAMAGED: + case GLUT_TRANSPARENT_INDEX: + default: + return -1; + } +} + + + +void APIENTRY glutOverlayDisplayFunc (GLUTdisplayCB func) +{ +} + + + +void APIENTRY glutEstablishOverlay (void) +{ +} + + + +void APIENTRY glutRemoveOverlay (void) +{ +} + + + +void APIENTRY glutUseLayer (GLenum layer) +{ +} + + + +void APIENTRY glutPostOverlayRedisplay (void) +{ +} + + + +void APIENTRY glutShowOverlay (void) +{ +} + + + +void APIENTRY glutHideOverlay (void) +{ +} diff --git a/src/glut/dos/state.c b/src/glut/dos/state.c index 38b03a72ab5..245d2ef621c 100644 --- a/src/glut/dos/state.c +++ b/src/glut/dos/state.c @@ -1,142 +1,142 @@ -/* - * Mesa 3-D graphics library - * Version: 3.4 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include "glutint.h" - - - -#define FREQUENCY 100 - - - -static int timer_installed; -static volatile int ticks; - - - -static void ticks_timer (void *p) -{ - (void)p; - ticks++; -} ENDOFUNC(ticks_timer) - - - -int APIENTRY glutGet (GLenum type) -{ - switch (type) { - case GLUT_WINDOW_X: - return g_curwin->xpos; - case GLUT_WINDOW_Y: - return g_curwin->ypos; - case GLUT_WINDOW_WIDTH: - return g_curwin->width; - case GLUT_WINDOW_HEIGHT: - return g_curwin->height; - case GLUT_WINDOW_STENCIL_SIZE: - return STENCIL_SIZE; - case GLUT_WINDOW_DEPTH_SIZE: - return DEPTH_SIZE; - case GLUT_WINDOW_RGBA: - return !(g_display_mode & GLUT_INDEX); - case GLUT_WINDOW_COLORMAP_SIZE: - return (g_display_mode & GLUT_INDEX) ? (256 - RESERVED_COLORS) : 0; - case GLUT_SCREEN_WIDTH: - return g_screen_w; - case GLUT_SCREEN_HEIGHT: - return g_screen_h; - case GLUT_INIT_WINDOW_X: - return g_init_x; - case GLUT_INIT_WINDOW_Y: - return g_init_y; - case GLUT_INIT_WINDOW_WIDTH: - return g_init_w; - case GLUT_INIT_WINDOW_HEIGHT: - return g_init_h; - case GLUT_INIT_DISPLAY_MODE: - return g_display_mode; - case GLUT_ELAPSED_TIME: - if (!timer_installed) { - timer_installed = GL_TRUE; - LOCKDATA(ticks); - LOCKFUNC(ticks_timer); - pc_install_int(ticks_timer, NULL, FREQUENCY); - } - return ticks*1000/FREQUENCY; - default: - return -1; - } -} - - - -int APIENTRY glutDeviceGet (GLenum type) -{ - switch (type) { - case GLUT_HAS_KEYBOARD: - return GL_TRUE; - case GLUT_HAS_MOUSE: - return (g_mouse != 0); - case GLUT_NUM_MOUSE_BUTTONS: - return g_mouse; - case GLUT_HAS_SPACEBALL: - case GLUT_HAS_DIAL_AND_BUTTON_BOX: - case GLUT_HAS_TABLET: - return GL_FALSE; - case GLUT_NUM_SPACEBALL_BUTTONS: - case GLUT_NUM_BUTTON_BOX_BUTTONS: - case GLUT_NUM_DIALS: - case GLUT_NUM_TABLET_BUTTONS: - return 0; - default: - return -1; - } -} - - - -int APIENTRY glutGetModifiers (void) -{ - int mod = 0; - int shifts = pc_keyshifts(); - - if (shifts & (KB_SHIFT_FLAG | KB_CAPSLOCK_FLAG)) { - mod |= GLUT_ACTIVE_SHIFT; - } - - if (shifts & KB_ALT_FLAG) { - mod |= GLUT_ACTIVE_ALT; - } - - if (shifts & KB_CTRL_FLAG) { - mod |= GLUT_ACTIVE_CTRL; - } - - return mod; -} +/* + * Mesa 3-D graphics library + * Version: 3.4 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include "glutint.h" + + + +#define FREQUENCY 100 + + + +static int timer_installed; +static volatile int ticks; + + + +static void ticks_timer (void *p) +{ + (void)p; + ticks++; +} ENDOFUNC(ticks_timer) + + + +int APIENTRY glutGet (GLenum type) +{ + switch (type) { + case GLUT_WINDOW_X: + return g_curwin->xpos; + case GLUT_WINDOW_Y: + return g_curwin->ypos; + case GLUT_WINDOW_WIDTH: + return g_curwin->width; + case GLUT_WINDOW_HEIGHT: + return g_curwin->height; + case GLUT_WINDOW_STENCIL_SIZE: + return STENCIL_SIZE; + case GLUT_WINDOW_DEPTH_SIZE: + return DEPTH_SIZE; + case GLUT_WINDOW_RGBA: + return !(g_display_mode & GLUT_INDEX); + case GLUT_WINDOW_COLORMAP_SIZE: + return (g_display_mode & GLUT_INDEX) ? (256 - RESERVED_COLORS) : 0; + case GLUT_SCREEN_WIDTH: + return g_screen_w; + case GLUT_SCREEN_HEIGHT: + return g_screen_h; + case GLUT_INIT_WINDOW_X: + return g_init_x; + case GLUT_INIT_WINDOW_Y: + return g_init_y; + case GLUT_INIT_WINDOW_WIDTH: + return g_init_w; + case GLUT_INIT_WINDOW_HEIGHT: + return g_init_h; + case GLUT_INIT_DISPLAY_MODE: + return g_display_mode; + case GLUT_ELAPSED_TIME: + if (!timer_installed) { + timer_installed = GL_TRUE; + LOCKDATA(ticks); + LOCKFUNC(ticks_timer); + pc_install_int(ticks_timer, NULL, FREQUENCY); + } + return ticks*1000/FREQUENCY; + default: + return -1; + } +} + + + +int APIENTRY glutDeviceGet (GLenum type) +{ + switch (type) { + case GLUT_HAS_KEYBOARD: + return GL_TRUE; + case GLUT_HAS_MOUSE: + return (g_mouse != 0); + case GLUT_NUM_MOUSE_BUTTONS: + return g_mouse; + case GLUT_HAS_SPACEBALL: + case GLUT_HAS_DIAL_AND_BUTTON_BOX: + case GLUT_HAS_TABLET: + return GL_FALSE; + case GLUT_NUM_SPACEBALL_BUTTONS: + case GLUT_NUM_BUTTON_BOX_BUTTONS: + case GLUT_NUM_DIALS: + case GLUT_NUM_TABLET_BUTTONS: + return 0; + default: + return -1; + } +} + + + +int APIENTRY glutGetModifiers (void) +{ + int mod = 0; + int shifts = pc_keyshifts(); + + if (shifts & (KB_SHIFT_FLAG | KB_CAPSLOCK_FLAG)) { + mod |= GLUT_ACTIVE_SHIFT; + } + + if (shifts & KB_ALT_FLAG) { + mod |= GLUT_ACTIVE_ALT; + } + + if (shifts & KB_CTRL_FLAG) { + mod |= GLUT_ACTIVE_CTRL; + } + + return mod; +} diff --git a/src/glut/dos/window.c b/src/glut/dos/window.c index 839241a9b09..cfc2f965c04 100644 --- a/src/glut/dos/window.c +++ b/src/glut/dos/window.c @@ -1,260 +1,260 @@ -/* - * Mesa 3-D graphics library - * Version: 4.1 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include - -#include "glutint.h" -#include "GL/dmesa.h" - - - -GLUTwindow *g_curwin; -static GLuint swaptime, swapcount; - -static DMesaVisual visual = NULL; -static DMesaContext context = NULL; -static GLUTwindow *windows[MAX_WINDOWS]; - - - -static void clean (void) -{ - int i; - - for (i=1; i<=MAX_WINDOWS; i++) { - glutDestroyWindow(i); - } - if (context) DMesaDestroyContext(context); - if (visual) DMesaDestroyVisual(visual); - - pc_close_stdout(); - pc_close_stderr(); -} - - - -int APIENTRY glutCreateWindow (const char *title) -{ - int i; - int m8width = (g_init_w + 7) & ~7; - - if (!visual) { - if ((visual=DMesaCreateVisual(g_init_x + m8width, g_init_y + g_init_h, g_bpp, g_refresh, - g_display_mode & GLUT_DOUBLE, - !(g_display_mode & GLUT_INDEX), - g_display_mode & GLUT_ALPHA, - g_display_mode & GLUT_DEPTH ?DEPTH_SIZE :0, - g_display_mode & GLUT_STENCIL?STENCIL_SIZE:0, - g_display_mode & GLUT_ACCUM ?ACCUM_SIZE :0))==NULL) { - return 0; - } - - if ((context=DMesaCreateContext(visual, NULL))==NULL) { - DMesaDestroyVisual(visual); - return 0; - } - - pc_open_stdout(); - pc_open_stderr(); - pc_atexit(clean); - } - - for (i=0; inum = ++i; - w->xpos = g_init_x; - w->ypos = g_init_y; - w->width = m8width; - w->height = g_init_h; - w->buffer = b; - - return i; - } - } - - return 0; -} - - - -int APIENTRY glutCreateSubWindow (int win, int x, int y, int width, int height) -{ - return GL_FALSE; -} - - - -void APIENTRY glutDestroyWindow (int win) -{ - if (windows[--win]) { - DMesaDestroyBuffer(windows[win]->buffer); - free(windows[win]); - windows[win] = NULL; - } -} - - - -void APIENTRY glutPostRedisplay (void) -{ - g_redisplay = GL_TRUE; -} - - - -void APIENTRY glutSwapBuffers (void) -{ - if (g_curwin->show_mouse) { - /* XXX scare mouse */ - DMesaSwapBuffers(g_curwin->buffer); - /* XXX unscare mouse */ - } else { - DMesaSwapBuffers(g_curwin->buffer); - } - - if (g_fps) { - GLint t = glutGet(GLUT_ELAPSED_TIME); - swapcount++; - if (swaptime == 0) - swaptime = t; - else if (t - swaptime > g_fps) { - double time = 0.001 * (t - swaptime); - double fps = (double)swapcount / time; - fprintf(stderr, "GLUT: %d frames in %.2f seconds = %.2f FPS\n", swapcount, time, fps); - swaptime = t; - swapcount = 0; - } - } -} - - - -int APIENTRY glutGetWindow (void) -{ - return g_curwin->num; -} - - - -void APIENTRY glutSetWindow (int win) -{ - g_curwin = windows[win - 1]; -} - - - -void APIENTRY glutSetWindowTitle (const char *title) -{ -} - - - -void APIENTRY glutSetIconTitle (const char *title) -{ -} - - - -void APIENTRY glutPositionWindow (int x, int y) -{ - if (DMesaMoveBuffer(x, y)) { - g_curwin->xpos = x; - g_curwin->ypos = y; - } -} - - - -void APIENTRY glutReshapeWindow (int width, int height) -{ - if (DMesaResizeBuffer(width, height)) { - g_curwin->width = width; - g_curwin->height = height; - if (g_curwin->reshape) { - g_curwin->reshape(width, height); - } else { - glViewport(0, 0, width, height); - } - } -} - - - -void APIENTRY glutFullScreen (void) -{ -} - - - -void APIENTRY glutPopWindow (void) -{ -} - - - -void APIENTRY glutPushWindow (void) -{ -} - - - -void APIENTRY glutIconifyWindow (void) -{ -} - - - -void APIENTRY glutShowWindow (void) -{ -} - - - -void APIENTRY glutHideWindow (void) -{ -} +/* + * Mesa 3-D graphics library + * Version: 4.1 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * DOS/DJGPP glut driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include + +#include "glutint.h" +#include "GL/dmesa.h" + + + +GLUTwindow *g_curwin; +static GLuint swaptime, swapcount; + +static DMesaVisual visual = NULL; +static DMesaContext context = NULL; +static GLUTwindow *windows[MAX_WINDOWS]; + + + +static void clean (void) +{ + int i; + + for (i=1; i<=MAX_WINDOWS; i++) { + glutDestroyWindow(i); + } + if (context) DMesaDestroyContext(context); + if (visual) DMesaDestroyVisual(visual); + + pc_close_stdout(); + pc_close_stderr(); +} + + + +int APIENTRY glutCreateWindow (const char *title) +{ + int i; + int m8width = (g_init_w + 7) & ~7; + + if (!visual) { + if ((visual=DMesaCreateVisual(g_init_x + m8width, g_init_y + g_init_h, g_bpp, g_refresh, + g_display_mode & GLUT_DOUBLE, + !(g_display_mode & GLUT_INDEX), + g_display_mode & GLUT_ALPHA, + g_display_mode & GLUT_DEPTH ?DEPTH_SIZE :0, + g_display_mode & GLUT_STENCIL?STENCIL_SIZE:0, + g_display_mode & GLUT_ACCUM ?ACCUM_SIZE :0))==NULL) { + return 0; + } + + if ((context=DMesaCreateContext(visual, NULL))==NULL) { + DMesaDestroyVisual(visual); + return 0; + } + + pc_open_stdout(); + pc_open_stderr(); + pc_atexit(clean); + } + + for (i=0; inum = ++i; + w->xpos = g_init_x; + w->ypos = g_init_y; + w->width = m8width; + w->height = g_init_h; + w->buffer = b; + + return i; + } + } + + return 0; +} + + + +int APIENTRY glutCreateSubWindow (int win, int x, int y, int width, int height) +{ + return GL_FALSE; +} + + + +void APIENTRY glutDestroyWindow (int win) +{ + if (windows[--win]) { + DMesaDestroyBuffer(windows[win]->buffer); + free(windows[win]); + windows[win] = NULL; + } +} + + + +void APIENTRY glutPostRedisplay (void) +{ + g_redisplay = GL_TRUE; +} + + + +void APIENTRY glutSwapBuffers (void) +{ + if (g_curwin->show_mouse) { + /* XXX scare mouse */ + DMesaSwapBuffers(g_curwin->buffer); + /* XXX unscare mouse */ + } else { + DMesaSwapBuffers(g_curwin->buffer); + } + + if (g_fps) { + GLint t = glutGet(GLUT_ELAPSED_TIME); + swapcount++; + if (swaptime == 0) + swaptime = t; + else if (t - swaptime > g_fps) { + double time = 0.001 * (t - swaptime); + double fps = (double)swapcount / time; + fprintf(stderr, "GLUT: %d frames in %.2f seconds = %.2f FPS\n", swapcount, time, fps); + swaptime = t; + swapcount = 0; + } + } +} + + + +int APIENTRY glutGetWindow (void) +{ + return g_curwin->num; +} + + + +void APIENTRY glutSetWindow (int win) +{ + g_curwin = windows[win - 1]; +} + + + +void APIENTRY glutSetWindowTitle (const char *title) +{ +} + + + +void APIENTRY glutSetIconTitle (const char *title) +{ +} + + + +void APIENTRY glutPositionWindow (int x, int y) +{ + if (DMesaMoveBuffer(x, y)) { + g_curwin->xpos = x; + g_curwin->ypos = y; + } +} + + + +void APIENTRY glutReshapeWindow (int width, int height) +{ + if (DMesaResizeBuffer(width, height)) { + g_curwin->width = width; + g_curwin->height = height; + if (g_curwin->reshape) { + g_curwin->reshape(width, height); + } else { + glViewport(0, 0, width, height); + } + } +} + + + +void APIENTRY glutFullScreen (void) +{ +} + + + +void APIENTRY glutPopWindow (void) +{ +} + + + +void APIENTRY glutPushWindow (void) +{ +} + + + +void APIENTRY glutIconifyWindow (void) +{ +} + + + +void APIENTRY glutShowWindow (void) +{ +} + + + +void APIENTRY glutHideWindow (void) +{ +} diff --git a/src/mesa/Makefile.DJ b/src/mesa/Makefile.DJ new file mode 100644 index 00000000000..ad9cd5b37b0 --- /dev/null +++ b/src/mesa/Makefile.DJ @@ -0,0 +1,373 @@ +# Mesa 3-D graphics library +# Version: 5.1 +# +# Copyright (C) 1999-2003 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# DOS/DJGPP core makefile v1.4 for Mesa +# +# Copyright (C) 2002 - Borca Daniel +# Email : dborca@yahoo.com +# Web : http://www.geocities.com/dborca + + +# +# Available options: +# +# Environment variables: +# CFLAGS +# +# GLIDE path to Glide3 SDK include files; used with FX. +# default = $(TOP)/include/glide3 +# FX=1 build for 3dfx Glide3. Note that this disables +# compilation of most DMesa code and requires fxMesa. +# As a consequence, you'll need the DJGPP Glide3 +# library to build any application. +# default = no +# MATROX=1 build for Matrox Millennium I (MGA2064W) cards. +# This is experimental and not intensively tested. +# default = no +# HAVE_X86=1 optimize for i386. +# default = no +# HAVE_MMX=1 allow MMX specializations, provided your assembler +# supports MMX instruction set. However, the true CPU +# capabilities are checked at run-time to avoid crashes. +# default = no +# HAVE_SSE=1 (see HAVE_MMX) +# default = no +# HAVE_3DNOW=1 (see HAVE_MMX) +# default = no +# +# Targets: +# all: build GL +# clean: remove object files +# + + + +.PHONY: all clean +.INTERMEDIATE: x86/gen_matypes.exe + +TOP = ../.. +GLIDE ?= $(TOP)/include/glide3 +LIBDIR = $(TOP)/lib +GL_LIB = libgl.a +GL_DXE = gl.dxe +GL_IMP = libigl.a + +export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR) + +CC = gcc +CFLAGS += -I$(TOP)/include -I. -Imain -Iglapi +ifeq ($(FX),1) +CFLAGS += -D__DOS__ -DH3 +CFLAGS += -I$(GLIDE) -DFX -DFX_GLIDE3 -DFXMESA_USE_ARGB +LIBNAME = "MesaGL/FX DJGPP" +else +ifeq ($(MATROX),1) +CFLAGS += -DMATROX +LIBNAME = "MesaGL/MGA DJGPP" +else +LIBNAME = "MesaGL DJGPP" +endif +endif + +AR = ar +ARFLAGS = rus + +HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe) + +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = del $(subst /,\,$(1)) +else +UNLINK = $(RM) $(1) +endif + +MAIN_SOURCES = \ + main/api_arrayelt.c \ + main/api_loopback.c \ + main/api_noop.c \ + main/api_validate.c \ + main/accum.c \ + main/arbprogram.c \ + main/attrib.c \ + main/blend.c \ + main/bufferobj.c \ + main/buffers.c \ + main/clip.c \ + main/colortab.c \ + main/context.c \ + main/convolve.c \ + main/debug.c \ + main/depth.c \ + main/dispatch.c \ + main/dlist.c \ + main/drawpix.c \ + main/enable.c \ + main/enums.c \ + main/eval.c \ + main/extensions.c \ + main/feedback.c \ + main/fog.c \ + main/get.c \ + main/hash.c \ + main/hint.c \ + main/histogram.c \ + main/image.c \ + main/imports.c \ + main/light.c \ + main/lines.c \ + main/matrix.c \ + main/nvprogram.c \ + main/nvfragparse.c \ + main/nvvertexec.c \ + main/nvvertparse.c \ + main/occlude.c \ + main/pixel.c \ + main/points.c \ + main/polygon.c \ + main/rastpos.c \ + main/state.c \ + main/stencil.c \ + main/texcompress.c \ + main/texformat.c \ + main/teximage.c \ + main/texobj.c \ + main/texstate.c \ + main/texstore.c \ + main/texutil.c \ + main/varray.c \ + main/vtxfmt.c + +GLAPI_SOURCES = \ + glapi/glapi.c \ + glapi/glthread.c + +MATH_SOURCES = \ + math/m_debug_clip.c \ + math/m_debug_norm.c \ + math/m_debug_xform.c \ + math/m_eval.c \ + math/m_matrix.c \ + math/m_translate.c \ + math/m_vector.c \ + math/m_xform.c + +ARRAY_CACHE_SOURCES = \ + array_cache/ac_context.c \ + array_cache/ac_import.c + +SWRAST_SOURCES = \ + swrast/s_aaline.c \ + swrast/s_aatriangle.c \ + swrast/s_accum.c \ + swrast/s_alpha.c \ + swrast/s_alphabuf.c \ + swrast/s_bitmap.c \ + swrast/s_blend.c \ + swrast/s_buffers.c \ + swrast/s_copypix.c \ + swrast/s_context.c \ + swrast/s_depth.c \ + swrast/s_drawpix.c \ + swrast/s_feedback.c \ + swrast/s_fog.c \ + swrast/s_imaging.c \ + swrast/s_lines.c \ + swrast/s_logic.c \ + swrast/s_masking.c \ + swrast/s_nvfragprog.c \ + swrast/s_pixeltex.c \ + swrast/s_points.c \ + swrast/s_readpix.c \ + swrast/s_span.c \ + swrast/s_stencil.c \ + swrast/s_texture.c \ + swrast/s_texstore.c \ + swrast/s_triangle.c \ + swrast/s_zoom.c + +SWRAST_SETUP_SOURCES = \ + swrast_setup/ss_context.c \ + swrast_setup/ss_triangle.c \ + swrast_setup/ss_vb.c + +TNL_SOURCES = \ + tnl/t_array_api.c \ + tnl/t_array_import.c \ + tnl/t_context.c \ + tnl/t_eval_api.c \ + tnl/t_imm_alloc.c \ + tnl/t_imm_api.c \ + tnl/t_imm_debug.c \ + tnl/t_imm_dlist.c \ + tnl/t_imm_elt.c \ + tnl/t_imm_eval.c \ + tnl/t_imm_exec.c \ + tnl/t_imm_fixup.c \ + tnl/t_pipeline.c \ + tnl/t_vb_fog.c \ + tnl/t_vb_light.c \ + tnl/t_vb_normals.c \ + tnl/t_vb_points.c \ + tnl/t_vb_program.c \ + tnl/t_vb_render.c \ + tnl/t_vb_texgen.c \ + tnl/t_vb_texmat.c \ + tnl/t_vb_vertex.c + +X86_SOURCES = \ + x86/x86.c \ + x86/glapi_x86.S \ + x86/common_x86.c \ + x86/common_x86_asm.S \ + x86/x86_xform2.S \ + x86/x86_xform3.S \ + x86/x86_xform4.S \ + x86/x86_cliptest.S + +MMX_SOURCES = \ + x86/mmx_blend.S + +SSE_SOURCES = \ + x86/sse.c \ + x86/sse_xform2.S \ + x86/sse_xform3.S \ + x86/sse_xform4.S \ + x86/sse_normal.S + +K3D_SOURCES = \ + x86/3dnow.c \ + x86/3dnow_xform2.S \ + x86/3dnow_xform3.S \ + x86/3dnow_xform4.S \ + x86/3dnow_normal.S + +CORE_SOURCES = \ + $(MAIN_SOURCES) \ + $(GLAPI_SOURCES) \ + $(MATH_SOURCES) \ + $(ARRAY_CACHE_SOURCES) \ + $(SWRAST_SOURCES) \ + $(SWRAST_SETUP_SOURCES) \ + $(TNL_SOURCES) + +ifeq ($(HAVE_MMX),1) +X86_SOURCES += $(MMX_SOURCES) +CFLAGS += -DUSE_MMX_ASM +HAVE_X86 = 1 +endif +ifeq ($(HAVE_SSE),1) +X86_SOURCES += $(SSE_SOURCES) +CFLAGS += -DUSE_SSE_ASM +HAVE_X86 = 1 +endif +ifeq ($(HAVE_3DNOW),1) +X86_SOURCES += $(K3D_SOURCES) +CFLAGS += -DUSE_3DNOW_ASM +HAVE_X86 = 1 +endif +ifeq ($(HAVE_X86),1) +CFLAGS += -DUSE_X86_ASM +else +X86_SOURCES = +endif + +DRIVER_SOURCES = \ + drivers/dos/dmesa.c +ifeq ($(FX),1) +DRIVER_SOURCES += \ + drivers/glide/fxapi.c \ + drivers/glide/fxdd.c \ + drivers/glide/fxddspan.c \ + drivers/glide/fxddtex.c \ + drivers/glide/fxsetup.c \ + drivers/glide/fxtexman.c \ + drivers/glide/fxtris.c \ + drivers/glide/fxvb.c \ + drivers/glide/fxglidew.c +else +ifeq ($(MATROX),1) +DRIVER_SOURCES += \ + drivers/dos/mga/mga.c \ + drivers/dos/mga/mga_hw.c \ + drivers/dos/mga/mga_mode.c \ + drivers/dos/dpmi.c +else +DRIVER_SOURCES += \ + drivers/dos/video.c \ + drivers/dos/virtual.S \ + drivers/dos/vesa.c \ + drivers/dos/blit.S \ + drivers/dos/vga.c \ + drivers/dos/dpmi.c +endif +endif + +SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(DRIVER_SOURCES) + +OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) + +X86_OBJECTS = $(addsuffix .o,$(basename $(X86_SOURCES))) + +.c.o: + $(CC) -o $@ $(CFLAGS) -c $< +.S.o: + $(CC) -o $@ $(CFLAGS) -c $< +.s.o: + $(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $< + +all: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP) + +$(LIBDIR)/$(GL_LIB): $(OBJECTS) + $(AR) $(ARFLAGS) $(LIBDIR)/$(GL_LIB) $(OBJECTS) + +$(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP): $(OBJECTS) +ifeq ($(HAVEDXE3),) + $(warning Missing DXE3 package... Skipping $(GL_DXE)) +else +ifeq ($(FX),1) + -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -P glid3.dxe -U $(OBJECTS) +else + -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -U $(OBJECTS) +endif +endif + +$(X86_OBJECTS): x86/matypes.h + +x86/matypes.h: x86/gen_matypes.exe + $< > $@ + +x86/gen_matypes.exe: x86/gen_matypes.c + $(CC) -o $@ $(CFLAGS) -s $< + +clean: + -$(call UNLINK,array_cache/*.o) + -$(call UNLINK,glapi/*.o) + -$(call UNLINK,main/*.o) + -$(call UNLINK,math/*.o) + -$(call UNLINK,swrast/*.o) + -$(call UNLINK,swrast_setup/*.o) + -$(call UNLINK,tnl/*.o) + -$(call UNLINK,x86/*.o) + -$(call UNLINK,drivers/dos/*.o) + -$(call UNLINK,drivers/dos/mga/*.o) + -$(call UNLINK,drivers/glide/*.o) + +-include depend diff --git a/src/mesa/drivers/dos/blit.S b/src/mesa/drivers/dos/blit.S index 7d0da5da289..f5888c7e395 100644 --- a/src/mesa/drivers/dos/blit.S +++ b/src/mesa/drivers/dos/blit.S @@ -1,199 +1,199 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - - .file "blit.S" - -/* - * extern unsigned int vesa_gran_mask, vesa_gran_shift; - * extern int vl_video_selector; - - * extern void *vl_current_draw_buffer; - * extern int vl_current_stride, vl_current_height; - * extern int vl_current_offset, vl_current_delta; - */ - - .text - -/* Desc: VESA bank switching routine (BIOS) - * - * In : EBX=0, EDX = bank number - * Out : - - * - * Note: thrashes EAX - */ - .p2align 5,,31 -_vesa_swbankBIOS: - movw $0x4f05, %ax - int $0x10 - ret - - .p2align 2,,3 - .global _vesa_swbank -_vesa_swbank: .long _vesa_swbankBIOS - -/* Desc: void vesa_b_dump_virtual (void); - * - * In : - - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _vesa_b_dump_virtual -_vesa_b_dump_virtual: - cld - pushl %es - pushl %ebx - pushl %esi - pushl %edi - pushl %ebp - movl _vl_video_selector, %es - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vesa_gran_shift, %ecx - movl _vesa_gran_mask, %ebp - movl %edi, %edx - xorl %ebx, %ebx - andl %ebp, %edi - shrl %cl, %edx - incl %ebp - call *_vesa_swbank - movl _vl_current_stride, %ecx - movl _vl_current_height, %eax - movl _vl_current_delta, %ebx - shrl $2, %ecx - .balign 4 - 0: - pushl %ecx - .balign 4 - 1: - cmpl %ebp, %edi - jb 2f - pushl %eax - pushl %ebx - incl %edx - xorl %ebx, %ebx - call *_vesa_swbank - popl %ebx - popl %eax - subl %ebp, %edi - .balign 4 - 2: - movsl - decl %ecx - jnz 1b - popl %ecx - addl %ebx, %edi - decl %eax - jnz 0b - popl %ebp - popl %edi - popl %esi - popl %ebx - popl %es - ret - -/* Desc: void vesa_l_dump_virtual (void); - * - * In : - - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _vesa_l_dump_virtual -_vesa_l_dump_virtual: - cld - pushl %es - pushl %esi - pushl %edi - movl _vl_video_selector, %es - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vl_current_stride, %ecx - movl _vl_current_height, %edx - movl _vl_current_delta, %eax - shrl $2, %ecx - .balign 4 - 0: - pushl %ecx - rep; movsl - popl %ecx - addl %eax, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - popl %es - ret - -/* Desc: void vesa_l_dump_virtual_mmx (void); - * - * In : - - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _vesa_l_dump_virtual_mmx -_vesa_l_dump_virtual_mmx: -#ifdef USE_MMX_ASM - pushl %esi - pushl %edi - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vl_current_stride, %ecx - movl _vl_current_height, %edx - movl _vl_current_delta, %eax - shrl $3, %ecx - .balign 4 - 0: - pushl %ecx - .balign 4 - 1: - movq (%esi), %mm0 - addl $8, %esi - movq %mm0, %fs:(%edi) - addl $8, %edi - decl %ecx - jnz 1b - popl %ecx - addl %eax, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - emms -#endif - ret +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + + .file "blit.S" + +/* + * extern unsigned int vesa_gran_mask, vesa_gran_shift; + * extern int vl_video_selector; + + * extern void *vl_current_draw_buffer; + * extern int vl_current_stride, vl_current_height; + * extern int vl_current_offset, vl_current_delta; + */ + + .text + +/* Desc: VESA bank switching routine (BIOS) + * + * In : EBX=0, EDX = bank number + * Out : - + * + * Note: thrashes EAX + */ + .p2align 5,,31 +_vesa_swbankBIOS: + movw $0x4f05, %ax + int $0x10 + ret + + .p2align 2,,3 + .global _vesa_swbank +_vesa_swbank: .long _vesa_swbankBIOS + +/* Desc: void vesa_b_dump_virtual (void); + * + * In : - + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _vesa_b_dump_virtual +_vesa_b_dump_virtual: + cld + pushl %es + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %es + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + movl _vl_current_delta, %ebx + shrl $2, %ecx + .balign 4 + 0: + pushl %ecx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + pushl %eax + pushl %ebx + incl %edx + xorl %ebx, %ebx + call *_vesa_swbank + popl %ebx + popl %eax + subl %ebp, %edi + .balign 4 + 2: + movsl + decl %ecx + jnz 1b + popl %ecx + addl %ebx, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + popl %es + ret + +/* Desc: void vesa_l_dump_virtual (void); + * + * In : - + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _vesa_l_dump_virtual +_vesa_l_dump_virtual: + cld + pushl %es + pushl %esi + pushl %edi + movl _vl_video_selector, %es + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %eax + shrl $2, %ecx + .balign 4 + 0: + pushl %ecx + rep; movsl + popl %ecx + addl %eax, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %es + ret + +/* Desc: void vesa_l_dump_virtual_mmx (void); + * + * In : - + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _vesa_l_dump_virtual_mmx +_vesa_l_dump_virtual_mmx: +#ifdef USE_MMX_ASM + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %eax + shrl $3, %ecx + .balign 4 + 0: + pushl %ecx + .balign 4 + 1: + movq (%esi), %mm0 + addl $8, %esi + movq %mm0, %fs:(%edi) + addl $8, %edi + decl %ecx + jnz 1b + popl %ecx + addl %eax, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + emms +#endif + ret diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index a389e3d3397..9ec0036176a 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -1,1685 +1,1736 @@ -/* - * Mesa 3-D graphics library - * Version: 5.0.1 - * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa - * - * Copyright (c) 2003 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef FX -#include "glheader.h" -#include "context.h" -#include "extensions.h" -#include "macros.h" -#include "matrix.h" -#include "mmath.h" -#include "texformat.h" -#include "texstore.h" -#include "array_cache/acache.h" -#include "swrast/s_context.h" -#include "swrast/s_depth.h" -#include "swrast/s_lines.h" -#include "swrast/s_triangle.h" -#include "swrast/s_trispan.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" -#ifndef MATROX -#include "video.h" -#else /* MATROX */ -#include "mga/mga.h" -#endif /* MATROX */ -#else /* FX */ -#include "../FX/fxdrv.h" -#endif /* FX */ - -#include "GL/dmesa.h" - - - -/* - * In C++ terms, this class derives from the GLvisual class. - * Add system-specific fields to it. - */ -struct dmesa_visual { - GLvisual gl_visual; - GLboolean db_flag; /* double buffered? */ - GLboolean rgb_flag; /* RGB mode? */ - GLuint depth; /* bits per pixel (1, 8, 24, etc) */ -#ifdef MATROX - int stride_in_pixels; -#endif - int zbuffer; /* Z=buffer: 0=no, 1=SW, -1=HW */ -}; - -/* - * In C++ terms, this class derives from the GLframebuffer class. - * Add system-specific fields to it. - */ -struct dmesa_buffer { - GLframebuffer gl_buffer; /* The depth, stencil, accum, etc buffers */ - void *the_window; /* your window handle, etc */ - - int xpos, ypos; /* position */ - int width, height; /* size in pixels */ -}; - -/* - * In C++ terms, this class derives from the GLcontext class. - * Add system-specific fields to it. - */ -struct dmesa_context { - GLcontext gl_ctx; /* the core library context */ - DMesaVisual visual; - DMesaBuffer Buffer; - GLuint ClearColor; - GLuint ClearIndex; - /* etc... */ -}; - - - -#ifndef FX -/**************************************************************************** - * Read/Write pixels - ***************************************************************************/ -#define FLIP(y) (dmesa->Buffer->height - (y) - 1) -#define FLIP2(y) (_b_ - (y)) - - -#ifndef MATROX -#define DSTRIDE dmesa->Buffer->width -#else -#define DSTRIDE dmesa->visual->stride_in_pixels -#define vl_putpixel mga_putpixel -#define vl_mixrgba mga_mixrgb -#define vl_mixrgb mga_mixrgb -#define vl_getrgba mga_getrgba -#define vl_setz mga_setz -#define vl_getz mga_getz -#endif - -/**************************************************************************** - * RGB[A] - ***************************************************************************/ -static void write_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLubyte rgba[][4], const GLubyte mask[]) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, offset; - -#ifndef MATROX - offset = DSTRIDE * FLIP(y) + x; - if (mask) { - /* draw some pixels */ - for (i=0; iBuffer->height - 1; - - if (mask) { - /* draw some pixels */ - for (i=0; iBuffer->height - 1, rgba = vl_mixrgba(color); - - if (mask) { - /* draw some pixels */ - for (i=0; iBuffer->height - 1; - - if (mask) { - /* read some pixels */ - for (i=0; iBuffer->height - 1; - - if (mask) { - /* draw some pixels */ - for (i=0; iBuffer->height - 1; - - if (mask) { - /* draw some pixels */ - for (i=0; iBuffer->height - 1; - - if (mask) { - /* read some pixels */ - for (i=0; iBuffer->height - 1; - - if (mask) { - /* draw some values */ - for (i=0; iBuffer->height - 1; - - /* read all values */ - for (i=0; iBuffer->height - 1; -#ifndef MATROX - GLuint _w_ = dmesa->Buffer->width; - -#define SETUP_CODE GLuint rgb = vl_mixrgb(v2->color); - -#define RENDER_SPAN(span) \ - GLuint i, offset = FLIP2(span.y)*_w_ + span.x; \ - for (i = 0; i < span.end; i++, offset++) { \ - vl_putpixel(offset, rgb); \ - } - -#include "swrast/s_tritemp.h" -#else /* MATROX */ - MGAvertex m0, m1, m2; - m0.win[0] = v0->win[0]; - m0.win[1] = FLIP2(v0->win[1]); - m1.win[0] = v1->win[0]; - m1.win[1] = FLIP2(v1->win[1]); - m2.win[0] = v2->win[0]; - m2.win[1] = FLIP2(v2->win[1]); - *(unsigned long *)m2.color = *(unsigned long *)v2->color; - mga_draw_tri_rgb_flat((int)SWRAST_CONTEXT(ctx)->_backface_sign, &m0, &m1, &m2); -#endif /* MATROX */ -} - - - -/* - * Z-less flat triangle. - */ -static void tri_rgb_flat_zless (GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint _b_ = dmesa->Buffer->height - 1; -#ifndef MATROX - GLuint _w_ = dmesa->Buffer->width; - -#define INTERP_Z 1 -#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define SETUP_CODE GLuint rgb = vl_mixrgb(v2->color); - -#define RENDER_SPAN(span) \ - GLuint i, offset = FLIP2(span.y)*_w_ + span.x; \ - for (i = 0; i < span.end; i++, offset++) { \ - const DEPTH_TYPE z = FixedToDepth(span.z); \ - if (z < zRow[i]) { \ - vl_putpixel(offset, rgb); \ - zRow[i] = z; \ - } \ - span.z += span.zStep; \ - } - -#include "swrast/s_tritemp.h" -#else /* MATROX */ - MGAvertex m0, m1, m2; - m0.win[0] = v0->win[0]; - m0.win[1] = FLIP2(v0->win[1]); - m0.win[2] = v0->win[2]; - m1.win[0] = v1->win[0]; - m1.win[1] = FLIP2(v1->win[1]); - m1.win[2] = v1->win[2]; - m2.win[0] = v2->win[0]; - m2.win[1] = FLIP2(v2->win[1]); - m2.win[2] = v2->win[2]; - *(unsigned long *)m2.color = *(unsigned long *)v2->color; - mga_draw_tri_rgb_flat_zless((int)SWRAST_CONTEXT(ctx)->_backface_sign, &m0, &m1, &m2); -#endif /* MATROX */ -} - - - -/* - * NON-depth-buffered iterated triangle. - */ -static void tri_rgb_iter (GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint _b_ = dmesa->Buffer->height - 1; -#ifndef MATROX - GLuint _w_ = dmesa->Buffer->width; - -#define INTERP_RGB 1 -#define RENDER_SPAN(span) \ - GLuint i, offset = FLIP2(span.y)*_w_ + span.x; \ - for (i = 0; i < span.end; i++, offset++) { \ - vl_putpixel(offset, vl_mixfix(span.red, span.green, span.blue)); \ - span.red += span.redStep; \ - span.green += span.greenStep; \ - span.blue += span.blueStep; \ - } - -#include "swrast/s_tritemp.h" -#else /* MATROX */ - MGAvertex m0, m1, m2; - m0.win[0] = v0->win[0]; - m0.win[1] = FLIP2(v0->win[1]); - m1.win[0] = v1->win[0]; - m1.win[1] = FLIP2(v1->win[1]); - m2.win[0] = v2->win[0]; - m2.win[1] = FLIP2(v2->win[1]); - *(unsigned long *)m0.color = *(unsigned long *)v0->color; - *(unsigned long *)m1.color = *(unsigned long *)v1->color; - *(unsigned long *)m2.color = *(unsigned long *)v2->color; - mga_draw_tri_rgb_iter((int)SWRAST_CONTEXT(ctx)->_backface_sign, &m0, &m1, &m2); -#endif /* MATROX */ -} - - - -/* - * Z-less iterated triangle. - */ -static void tri_rgb_iter_zless (GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint _b_ = dmesa->Buffer->height - 1; -#ifndef MATROX - GLuint _w_ = dmesa->Buffer->width; - -#define INTERP_Z 1 -#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define INTERP_RGB 1 - -#define RENDER_SPAN(span) \ - GLuint i, offset = FLIP2(span.y)*_w_ + span.x; \ - for (i = 0; i < span.end; i++, offset++) { \ - const DEPTH_TYPE z = FixedToDepth(span.z); \ - if (z < zRow[i]) { \ - vl_putpixel(offset, vl_mixfix(span.red, span.green, span.blue));\ - zRow[i] = z; \ - } \ - span.red += span.redStep; \ - span.green += span.greenStep; \ - span.blue += span.blueStep; \ - span.z += span.zStep; \ - } - -#include "swrast/s_tritemp.h" -#else /* MATROX */ - MGAvertex m0, m1, m2; - m0.win[0] = v0->win[0]; - m0.win[1] = FLIP2(v0->win[1]); - m0.win[2] = v0->win[2]; - m1.win[0] = v1->win[0]; - m1.win[1] = FLIP2(v1->win[1]); - m1.win[2] = v1->win[2]; - m2.win[0] = v2->win[0]; - m2.win[1] = FLIP2(v2->win[1]); - m2.win[2] = v2->win[2]; - *(unsigned long *)m0.color = *(unsigned long *)v0->color; - *(unsigned long *)m1.color = *(unsigned long *)v1->color; - *(unsigned long *)m2.color = *(unsigned long *)v2->color; - mga_draw_tri_rgb_iter_zless((int)SWRAST_CONTEXT(ctx)->_backface_sign, &m0, &m1, &m2); -#endif /* MATROX */ -} - - - -/* - * Analyze context state to see if we can provide a fast triangle function - * Otherwise, return NULL. - */ -static swrast_tri_func dmesa_choose_tri_function (GLcontext *ctx) -{ - const SWcontext *swrast = SWRAST_CONTEXT(ctx); - - if ((ctx->RenderMode != GL_RENDER) - || (ctx->Polygon.SmoothFlag) - || (ctx->Polygon.StippleFlag) - || (ctx->Texture._EnabledUnits) - || (swrast->_RasterMask & MULTI_DRAW_BIT) - || (ctx->Polygon.CullFlag && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)) { - return (swrast_tri_func)NULL; - } - - if (swrast->_RasterMask==DEPTH_BIT - && ctx->Depth.Func==GL_LESS - && ctx->Depth.Mask==GL_TRUE - && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS) { - return (ctx->Light.ShadeModel==GL_SMOOTH) ? tri_rgb_iter_zless : tri_rgb_flat_zless; - } - - if (swrast->_RasterMask==0) { /* no depth test */ - return (ctx->Light.ShadeModel==GL_SMOOTH) ? tri_rgb_iter : tri_rgb_flat; - } - - return (swrast_tri_func)NULL; -} - - - -/* Override for the swrast triangle-selection function. Try to use one - * of our internal triangle functions, otherwise fall back to the - * standard swrast functions. - */ -static void dmesa_choose_tri (GLcontext *ctx) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - if (!(swrast->Triangle=dmesa_choose_tri_function(ctx))) - _swrast_choose_triangle(ctx); -} - - - -/**************************************************************************** - * Optimized line rendering - ***************************************************************************/ - -#ifdef MATROX -static __inline void matrox_line_clip_hack (GLcontext *ctx, int _b_, MGAvertex *m0, const SWvertex *vert0, MGAvertex *m1, const SWvertex *vert1) -{ - int x0 = vert0->win[0]; - int y0 = vert0->win[1]; - int x1 = vert1->win[0]; - int y1 = vert1->win[1]; - /* s_linetemp.h { */ - GLint w = ctx->DrawBuffer->Width; - GLint h = ctx->DrawBuffer->Height; - if ((x0==w) | (x1==w)) { - if ((x0==w) & (x1==w)) - return; - x0 -= x0==w; - x1 -= x1==w; - } - if ((y0==h) | (y1==h)) { - if ((y0==h) & (y1==h)) - return; - y0 -= y0==h; - y1 -= y1==h; - } - /* } s_linetemp.h */ - m0->win[0] = x0; - m0->win[1] = FLIP2(y0); - m1->win[0] = x1; - m1->win[1] = FLIP2(y1); -} -#endif - -/* - * NON-depth-buffered flat line. - */ -static void line_rgb_flat (GLcontext *ctx, - const SWvertex *vert0, - const SWvertex *vert1) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint _b_ = dmesa->Buffer->height - 1; -#ifndef MATROX - GLuint _w_ = dmesa->Buffer->width; - GLuint rgb = vl_mixrgb(vert1->color); - -#define INTERP_XY 1 -#define CLIP_HACK 1 -#define PLOT(X,Y) vl_putpixel(FLIP2(Y) * _w_ + X, rgb); - -#include "swrast/s_linetemp.h" -#else - MGAvertex m0, m1; - matrox_line_clip_hack(ctx, _b_, &m0, vert0, &m1, vert1); - *(unsigned long *)m1.color = *(unsigned long *)vert1->color; - mga_draw_line_rgb_flat(&m0, &m1); -#endif -} - - - -/* - * Z-less flat line. - */ -static void line_rgb_flat_zless (GLcontext *ctx, - const SWvertex *vert0, - const SWvertex *vert1) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint _b_ = dmesa->Buffer->height - 1; -#ifndef MATROX - GLuint _w_ = dmesa->Buffer->width; - GLuint rgb = vl_mixrgb(vert1->color); - -#define INTERP_XY 1 -#define INTERP_Z 1 -#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define CLIP_HACK 1 -#define PLOT(X,Y) \ - if (Z < *zPtr) { \ - *zPtr = Z; \ - vl_putpixel(FLIP2(Y) * _w_ + X, rgb); \ - } - -#include "swrast/s_linetemp.h" -#else - MGAvertex m0, m1; - matrox_line_clip_hack(ctx, _b_, &m0, vert0, &m1, vert1); - m0.win[2] = vert0->win[2]; - m1.win[2] = vert1->win[2]; - *(unsigned long *)m1.color = *(unsigned long *)vert1->color; - mga_draw_line_rgb_flat_zless(&m0, &m1); -#endif -} - - - -#ifndef MATROX -#define line_rgb_iter NULL -#define line_rgb_iter_zless NULL -#else /* MATROX */ -/* - * NON-depth-buffered iterated line. - */ -static void line_rgb_iter (GLcontext *ctx, - const SWvertex *vert0, - const SWvertex *vert1) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint _b_ = dmesa->Buffer->height - 1; - MGAvertex m0, m1; - matrox_line_clip_hack(ctx, _b_, &m0, vert0, &m1, vert1); - *(unsigned long *)m0.color = *(unsigned long *)vert0->color; - *(unsigned long *)m1.color = *(unsigned long *)vert1->color; - mga_draw_line_rgb_iter(&m0, &m1); -} - - - -/* - * Z-less iterated line. - */ -static void line_rgb_iter_zless (GLcontext *ctx, - const SWvertex *vert0, - const SWvertex *vert1) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint _b_ = dmesa->Buffer->height - 1; - MGAvertex m0, m1; - matrox_line_clip_hack(ctx, _b_, &m0, vert0, &m1, vert1); - m0.win[2] = vert0->win[2]; - m1.win[2] = vert1->win[2]; - *(unsigned long *)m0.color = *(unsigned long *)vert0->color; - *(unsigned long *)m1.color = *(unsigned long *)vert1->color; - mga_draw_line_rgb_iter_zless(&m0, &m1); -} -#endif /* MATROX */ - - - -/* - * Analyze context state to see if we can provide a fast line function - * Otherwise, return NULL. - */ -static swrast_line_func dmesa_choose_line_function (GLcontext *ctx) -{ - const SWcontext *swrast = SWRAST_CONTEXT(ctx); - - if ((ctx->RenderMode != GL_RENDER) - || (ctx->Line.SmoothFlag) - || (ctx->Texture._EnabledUnits) - || (ctx->Line.StippleFlag) - || (swrast->_RasterMask & MULTI_DRAW_BIT) - || (ctx->Line.Width!=1.0F)) { - return (swrast_line_func)NULL; - } - - if (swrast->_RasterMask==DEPTH_BIT - && ctx->Depth.Func==GL_LESS - && ctx->Depth.Mask==GL_TRUE - && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS) { - return (ctx->Light.ShadeModel==GL_SMOOTH) ? line_rgb_iter_zless : line_rgb_flat_zless; - } - - if (swrast->_RasterMask==0) { /* no depth test */ - return (ctx->Light.ShadeModel==GL_SMOOTH) ? line_rgb_iter : line_rgb_flat; - } - - return (swrast_line_func)NULL; -} - - - -/* Override for the swrast line-selection function. Try to use one - * of our internal line functions, otherwise fall back to the - * standard swrast functions. - */ -static void dmesa_choose_line (GLcontext *ctx) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - if (!(swrast->Line=dmesa_choose_line_function(ctx))) - _swrast_choose_line(ctx); -} - - - -/**************************************************************************** - * Miscellaneous device driver funcs - ***************************************************************************/ - -static void clear_index (GLcontext *ctx, GLuint index) -{ - ((DMesaContext)ctx)->ClearIndex = index; -} - -static void clear_color (GLcontext *ctx, const GLfloat color[4]) -{ - GLubyte col[4]; - CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); - CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); - CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]); - CLAMPED_FLOAT_TO_UBYTE(col[3], color[3]); - ((DMesaContext)ctx)->ClearColor = vl_mixrgba(col); -} - - - -static void clear (GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height) -{ - const DMesaContext c = (DMesaContext)ctx; - const GLuint *colorMask = (GLuint *)&ctx->Color.ColorMask; - -/* - * Clear the specified region of the buffers indicated by 'mask' - * using the clear color or index as specified by one of the two - * functions above. - * If all==GL_TRUE, clear whole buffer, else just clear region defined - * by x,y,width,height - */ - - /* we can't handle color or index masking */ - if ((*colorMask == 0xffffffff) && (ctx->Color.IndexMask == 0xffffffff)) { -#ifndef MATROX - if (mask & DD_BACK_LEFT_BIT) { - int color = c->visual->rgb_flag ? c->ClearColor : c->ClearIndex; - - if (all) { - vl_clear(color); - } else { - vl_rect(x, y, width, height, color); - } - - mask &= ~DD_BACK_LEFT_BIT; - } -#else /* MATROX */ - unsigned short z = -1; - int color = c->ClearColor; - if (mask & DD_DEPTH_BIT) { - z = ctx->Depth.Clear * 0xffff; - } - if (all) { - mga_clear(mask & DD_FRONT_LEFT_BIT, - mask & DD_BACK_LEFT_BIT, - mask & DD_DEPTH_BIT, - 0, 0, c->Buffer->width, c->Buffer->height, - color, z); - } else { - mga_clear(mask & DD_FRONT_LEFT_BIT, - mask & DD_BACK_LEFT_BIT, - mask & DD_DEPTH_BIT, - x, y, width, height, - color, z); - } - mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT | DD_DEPTH_BIT); -#endif /* MATROX */ - } - - if (mask) { - _swrast_Clear(ctx, mask, all, x, y, width, height); - } -} - - - -static void set_buffer (GLcontext *ctx, GLframebuffer *colorBuffer, GLuint bufferBit) -{ - /* - * XXX todo - examine bufferBit and set read/write pointers - */ -} - - - -/* - * Return the width and height of the current buffer. - * If anything special has to been done when the buffer/window is - * resized, do it now. - */ -static void get_buffer_size (GLframebuffer *buffer, GLuint *width, GLuint *height) -{ - DMesaBuffer b = (DMesaBuffer)buffer; - - *width = b->width; - *height = b->height; -} - - - -static const GLubyte* get_string (GLcontext *ctx, GLenum name) -{ - switch (name) { - case GL_RENDERER: - return (const GLubyte *)"Mesa DJGPP" - #ifdef FX - " (FX)" - #endif - #ifdef MATROX - " (MGA)" - #endif - "\0port (c) Borca Daniel mar-2003"; - default: - return NULL; - } -} - - - -static void finish (GLcontext *ctx) -{ - /* - * XXX todo - OPTIONAL FUNCTION: implements glFinish if possible - */ -} - - - -static void flush (GLcontext *ctx) -{ - /* - * XXX todo - OPTIONAL FUNCTION: implements glFlush if possible - */ -} - - - -/**************************************************************************** - * State - ***************************************************************************/ -#define DMESA_NEW_LINE (_NEW_LINE | \ - _NEW_TEXTURE | \ - _NEW_LIGHT | \ - _NEW_DEPTH | \ - _NEW_RENDERMODE | \ - _SWRAST_NEW_RASTERMASK) - -#define DMESA_NEW_TRIANGLE (_NEW_POLYGON | \ - _NEW_TEXTURE | \ - _NEW_LIGHT | \ - _NEW_DEPTH | \ - _NEW_RENDERMODE | \ - _SWRAST_NEW_RASTERMASK) - -/* Extend the software rasterizer with our line and triangle - * functions. - */ -static void dmesa_register_swrast_functions (GLcontext *ctx) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - swrast->choose_line = dmesa_choose_line; - swrast->choose_triangle = dmesa_choose_tri; - - swrast->invalidate_line |= DMESA_NEW_LINE; - swrast->invalidate_triangle |= DMESA_NEW_TRIANGLE; -} - - - -/* Setup pointers and other driver state that is constant for the life - * of a context. - */ -static void dmesa_init_pointers (GLcontext *ctx) -{ - TNLcontext *tnl; - struct swrast_device_driver *dd = _swrast_GetDeviceDriverReference(ctx); - - ctx->Driver.GetString = get_string; - ctx->Driver.GetBufferSize = get_buffer_size; - ctx->Driver.Flush = flush; - ctx->Driver.Finish = finish; - - /* Software rasterizer pixel paths: - */ - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; - ctx->Driver.Clear = clear; - ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = _swrast_ReadPixels; - ctx->Driver.DrawBuffer = _swrast_DrawBuffer; - - /* Software texture functions: - */ - ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format; - ctx->Driver.TexImage1D = _mesa_store_teximage1d; - ctx->Driver.TexImage2D = _mesa_store_teximage2d; - ctx->Driver.TexImage3D = _mesa_store_teximage3d; - ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; - ctx->Driver.TexSubImage2D = _mesa_store_texsubimage2d; - ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; - ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; - - ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; - ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; - ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; - ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; - ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; - - ctx->Driver.CompressedTexImage1D = _mesa_store_compressed_teximage1d; - ctx->Driver.CompressedTexImage2D = _mesa_store_compressed_teximage2d; - ctx->Driver.CompressedTexImage3D = _mesa_store_compressed_teximage3d; - ctx->Driver.CompressedTexSubImage1D = _mesa_store_compressed_texsubimage1d; - ctx->Driver.CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d; - ctx->Driver.CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d; - - /* Swrast hooks for imaging extensions: - */ - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; - - /* Statechange callbacks: - */ - ctx->Driver.ClearColor = clear_color; - ctx->Driver.ClearIndex = clear_index; - - /* Initialize the TNL driver interface: - */ - tnl = TNL_CONTEXT(ctx); - tnl->Driver.RunPipeline = _tnl_run_pipeline; - - dd->SetBuffer = set_buffer; - - /* Install swsetup for tnl->Driver.Render.*: - */ - _swsetup_Wakeup(ctx); - - /* The span functions should be in `dmesa_update_state', but I'm - * pretty sure they will never change during the life of the Visual - */ -#ifdef MATROX - if (((DMesaContext)ctx)->visual->zbuffer == -1) { - /* Depth span/pixel functions */ - dd->WriteDepthSpan = write_depth_span; - dd->WriteDepthPixels = write_depth_pixels; - dd->ReadDepthSpan = read_depth_span; - dd->ReadDepthPixels = read_depth_pixels; - } -#endif - -#ifndef MATROX - /* Index span/pixel functions */ - dd->WriteCI32Span = write_index_span; - dd->WriteCI8Span = write_index8_span; - dd->WriteMonoCISpan = write_mono_index_span; - dd->WriteCI32Pixels = write_index_pixels; - dd->WriteMonoCIPixels = write_mono_index_pixels; - dd->ReadCI32Span = read_index_span; - dd->ReadCI32Pixels = read_index_pixels; -#endif - - /* RGB(A) span/pixel functions */ - dd->WriteRGBASpan = write_rgba_span; - dd->WriteRGBSpan = write_rgb_span; - dd->WriteMonoRGBASpan = write_mono_rgba_span; - dd->WriteRGBAPixels = write_rgba_pixels; - dd->WriteMonoRGBAPixels = write_mono_rgba_pixels; - dd->ReadRGBASpan = read_rgba_span; - dd->ReadRGBAPixels = read_rgba_pixels; -} - - - -static void dmesa_update_state (GLcontext *ctx, GLuint new_state) -{ - /* Propogate statechange information to swrast and swrast_setup - * modules. The DMesa driver has no internal GL-dependent state. - */ - _swrast_InvalidateState( ctx, new_state ); - _ac_InvalidateState( ctx, new_state ); - _tnl_InvalidateState( ctx, new_state ); - _swsetup_InvalidateState( ctx, new_state ); -} -#endif /* FX */ - - - -/**************************************************************************** - * DMesa Public API Functions - ***************************************************************************/ - -/* - * The exact arguments to this function will depend on your window system - */ -DMesaVisual DMesaCreateVisual (GLint width, - GLint height, - GLint colDepth, - GLint refresh, - GLboolean dbFlag, - GLboolean rgbFlag, - GLboolean alphaFlag, - GLint depthSize, - GLint stencilSize, - GLint accumSize) -{ -#ifndef FX - DMesaVisual v; - GLint redBits, greenBits, blueBits, alphaBits, indexBits; - -#ifndef MATROX - if (!dbFlag) { - return NULL; - } -#else - if (!rgbFlag) { - return NULL; - } -#endif - - alphaBits = 0; - - if (!rgbFlag) { - indexBits = 8; - redBits = 0; - greenBits = 0; - blueBits = 0; - } else { - indexBits = 0; - switch (colDepth) { - case 8: - redBits = 8; - greenBits = 8; - blueBits = 8; - break; - case 15: - redBits = 5; - greenBits = 5; - blueBits = 5; - break; - case 16: - redBits = 5; - greenBits = 6; - blueBits = 5; - break; - case 32: - alphaBits = 8; - case 24: - redBits = 8; - greenBits = 8; - blueBits = 8; - break; - default: - return NULL; - } - } - -#ifndef MATROX - if ((colDepth=vl_video_init(width, height, colDepth, rgbFlag, refresh)) <= 0) { - return NULL; - } -#else - if (mga_open(width, height, colDepth, dbFlag ? 2 : 1, depthSize == 16, refresh) < 0) { - return NULL; - } -#endif - - if (alphaFlag && (alphaBits==0)) { - alphaBits = 8; - } - - if ((v=(DMesaVisual)CALLOC_STRUCT(dmesa_visual)) != NULL) { - /* Create core visual */ - _mesa_initialize_visual((GLvisual *)v, - rgbFlag, /* rgb */ - dbFlag, - GL_FALSE, /* stereo */ - redBits, - greenBits, - blueBits, - alphaBits, - indexBits, /* indexBits */ - depthSize, - stencilSize, - accumSize, /* accumRed */ - accumSize, /* accumGreen */ - accumSize, /* accumBlue */ - alphaFlag?accumSize:0, /* accumAlpha */ - 1); /* numSamples */ - - v->depth = colDepth; - v->db_flag = dbFlag; - v->rgb_flag = rgbFlag; - - v->zbuffer = (depthSize > 0) ? 1 : 0; -#ifdef MATROX - mga_get(MGA_GET_HPIXELS, &v->stride_in_pixels); - if (depthSize == 16) { - v->zbuffer = -1; - } -#endif - } - - return v; - -#else /* FX */ - - int i = 0, fx_attrib[32]; - - if (!rgbFlag) { - return NULL; - } - - if (dbFlag) fx_attrib[i++] = FXMESA_DOUBLEBUFFER; - if (depthSize > 0) { fx_attrib[i++] = FXMESA_DEPTH_SIZE; fx_attrib[i++] = depthSize; } - if (stencilSize > 0) { fx_attrib[i++] = FXMESA_STENCIL_SIZE; fx_attrib[i++] = stencilSize; } - if (accumSize > 0) { fx_attrib[i++] = FXMESA_ACCUM_SIZE; fx_attrib[i++] = accumSize; } - if (alphaFlag) { fx_attrib[i++] = FXMESA_ALPHA_SIZE; fx_attrib[i++] = 1; } - fx_attrib[i] = FXMESA_NONE; - - return (DMesaVisual)fxMesaCreateBestContext(-1, width, height, fx_attrib); -#endif /* FX */ -} - - - -void DMesaDestroyVisual (DMesaVisual v) -{ -#ifndef FX - _mesa_destroy_visual((GLvisual *)v); - -#ifndef MATROX - vl_video_exit(); -#else - mga_close(1, 1); -#endif - -#else - fxMesaDestroyContext((fxMesaContext)v); -#endif -} - - - -DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, - GLint xpos, GLint ypos, - GLint width, GLint height) -{ -#ifndef FX - DMesaBuffer b; - - if ((b=(DMesaBuffer)CALLOC_STRUCT(dmesa_buffer)) != NULL) { - _mesa_initialize_framebuffer((GLframebuffer *)b, - (GLvisual *)visual, - visual->zbuffer == 1, - ((GLvisual *)visual)->stencilBits > 0, - ((GLvisual *)visual)->accumRedBits > 0, - ((GLvisual *)visual)->alphaBits > 0); - b->xpos = xpos; - b->ypos = ypos; - b->width = width; - b->height = height; - } - - return b; -#else - return (DMesaBuffer)visual; -#endif -} - - - -void DMesaDestroyBuffer (DMesaBuffer b) -{ -#ifndef FX -#ifndef MATROX - free(b->the_window); -#endif - _mesa_destroy_framebuffer((GLframebuffer *)b); -#endif -} - - - -DMesaContext DMesaCreateContext (DMesaVisual visual, - DMesaContext share) -{ -#ifndef FX - DMesaContext c; - GLboolean direct = GL_FALSE; - - if ((c=(DMesaContext)CALLOC_STRUCT(dmesa_context)) != NULL) { - _mesa_initialize_context((GLcontext *)c, - (GLvisual *)visual, - (GLcontext *)share, - (void *)c, direct); - - _mesa_enable_sw_extensions((GLcontext *)c); - _mesa_enable_1_3_extensions((GLcontext *)c); - _mesa_enable_1_4_extensions((GLcontext *)c); - - /* you probably have to do a bunch of other initializations here. */ - c->visual = visual; - - ((GLcontext *)c)->Driver.UpdateState = dmesa_update_state; - - /* Initialize the software rasterizer and helper modules. - */ - _swrast_CreateContext((GLcontext *)c); - _ac_CreateContext((GLcontext *)c); - _tnl_CreateContext((GLcontext *)c); - _swsetup_CreateContext((GLcontext *)c); - if (visual->rgb_flag) dmesa_register_swrast_functions((GLcontext *)c); - dmesa_init_pointers((GLcontext *)c); - } - - return c; - -#else /* FX */ - return (DMesaContext)visual; -#endif /* FX */ -} - - - -void DMesaDestroyContext (DMesaContext c) -{ -#ifndef FX - if (c) { - _swsetup_DestroyContext((GLcontext *)c); - _swrast_DestroyContext((GLcontext *)c); - _tnl_DestroyContext((GLcontext *)c); - _ac_DestroyContext((GLcontext *)c); - _mesa_destroy_context((GLcontext *)c); - } -#endif -} - - - -GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos) -{ -#if !defined(FX) && !defined(MATROX) - GET_CURRENT_CONTEXT(ctx); - DMesaBuffer b = ((DMesaContext)ctx)->Buffer; - - if (vl_sync_buffer(&b->the_window, xpos, ypos, b->width, b->height) != 0) { - return GL_FALSE; - } else { - b->xpos = xpos; - b->ypos = ypos; - return GL_TRUE; - } - -#else - return GL_FALSE; -#endif -} - - - -GLboolean DMesaResizeBuffer (GLint width, GLint height) -{ -#if !defined(FX) && !defined(MATROX) - GET_CURRENT_CONTEXT(ctx); - DMesaBuffer b = ((DMesaContext)ctx)->Buffer; - - if (vl_sync_buffer(&b->the_window, b->xpos, b->ypos, width, height) != 0) { - return GL_FALSE; - } else { - b->width = width; - b->height = height; - return GL_TRUE; - } - -#else - return GL_FALSE; -#endif -} - - - -/* - * Make the specified context and buffer the current one. - */ -GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b) -{ -#ifndef FX - if ((c != NULL) && (b != NULL)) { -#ifndef MATROX - if (vl_sync_buffer(&b->the_window, b->xpos, b->ypos, b->width, b->height) != 0) { - return GL_FALSE; - } -#endif - - c->Buffer = b; - - _mesa_make_current((GLcontext *)c, (GLframebuffer *)b); - if (((GLcontext *)c)->Viewport.Width == 0) { - /* initialize viewport to window size */ - _mesa_Viewport(0, 0, b->width, b->height); - } - } else { - /* Detach */ - _mesa_make_current(NULL, NULL); - } - -#else - fxMesaMakeCurrent((fxMesaContext)c); -#endif - - return GL_TRUE; -} - - - -void DMesaSwapBuffers (DMesaBuffer b) -{ - /* copy/swap back buffer to front if applicable */ -#ifndef FX - GET_CURRENT_CONTEXT(ctx); - _mesa_notifySwapBuffers(ctx); -#ifndef MATROX - vl_flip(); -#else - if (((DMesaContext)ctx)->visual->db_flag) { - mga_swapbuffers(1); - } -#endif -#else - fxMesaSwapBuffers(); -#endif -} - - - -void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue) -{ -#if !defined(FX) && !defined(MATROX) - vl_setCI(ndx, red, green, blue); -#endif -} - - - -DMesaContext DMesaGetCurrentContext (void) -{ -#ifndef FX - GET_CURRENT_CONTEXT(ctx); - return (DMesaContext)ctx; -#else - return (DMesaContext)fxMesaGetCurrentContext(); -#endif -} - - - -int DMesaGetIntegerv (GLenum pname, GLint *params) -{ -#ifndef FX - GET_CURRENT_CONTEXT(ctx); - const DMesaContext c = (DMesaContext)ctx; -#else - const fxMesaContext c = fxMesaGetCurrentContext(); -#endif - - if (c == NULL) { - return -1; - } - - switch (pname) { - case DMESA_GET_SCREEN_SIZE: - #ifndef FX - #ifndef MATROX - vl_get(VL_GET_SCREEN_SIZE, params); - #else - mga_get(MGA_GET_SCREEN_SIZE, params); - #endif - #else - params[0] = c->screen_width; - params[1] = c->screen_height; - #endif - break; - case DMESA_GET_DRIVER_CAPS: - #ifndef FX - #ifndef MATROX - params[0] = DMESA_DRIVER_SWDB_BIT; - #else - params[0] = 0; - #endif - #else - params[0] = DMESA_DRIVER_LLWO_BIT; - #endif - break; - default: - return -1; - } - - return 0; -} +/* + * Mesa 3-D graphics library + * Version: 5.0.1 + * + * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.4 for Mesa + * + * Copyright (c) 2003 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef FX +#include "glheader.h" +#include "context.h" +#include "extensions.h" +#include "macros.h" +#include "matrix.h" +#include "mtypes.h" +#include "texformat.h" +#include "teximage.h" +#include "texstore.h" +#include "imports.h" +#include "array_cache/acache.h" +#include "swrast/s_context.h" +#include "swrast/s_depth.h" +#include "swrast/s_lines.h" +#include "swrast/s_triangle.h" +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" +#include "tnl/tnl.h" +#include "tnl/t_context.h" +#include "tnl/t_pipeline.h" +#ifndef MATROX +#include "video.h" +#else /* MATROX */ +#include "mga/mga.h" +#endif /* MATROX */ +#else /* FX */ +#include "../glide/fxdrv.h" +#endif /* FX */ + +#include "GL/dmesa.h" + + + +/* + * In C++ terms, this class derives from the GLvisual class. + * Add system-specific fields to it. + */ +struct dmesa_visual { + GLvisual gl_visual; + GLboolean db_flag; /* double buffered? */ + GLboolean rgb_flag; /* RGB mode? */ + GLuint depth; /* bits per pixel (1, 8, 24, etc) */ +#ifdef MATROX + int stride_in_pixels; +#endif + int zbuffer; /* Z=buffer: 0=no, 1=SW, -1=HW */ +}; + +/* + * In C++ terms, this class derives from the GLframebuffer class. + * Add system-specific fields to it. + */ +struct dmesa_buffer { + GLframebuffer gl_buffer; /* The depth, stencil, accum, etc buffers */ + void *the_window; /* your window handle, etc */ + + int xpos, ypos; /* position */ + int width, height; /* size in pixels */ +}; + +/* + * In C++ terms, this class derives from the GLcontext class. + * Add system-specific fields to it. + */ +struct dmesa_context { + GLcontext gl_ctx; /* the core library context */ + DMesaVisual visual; + DMesaBuffer Buffer; + GLuint ClearColor; + GLuint ClearIndex; + /* etc... */ +}; + + + +#ifndef FX +/**************************************************************************** + * Read/Write pixels + ***************************************************************************/ +#define FLIP(y) (dmesa->Buffer->height - (y) - 1) +#define FLIP2(y) (_b_ - (y)) + + +#ifndef MATROX +#define DSTRIDE dmesa->Buffer->width +#else +#define DSTRIDE dmesa->visual->stride_in_pixels +#define vl_putpixel mga_putpixel +#define vl_mixrgba mga_mixrgb +#define vl_mixrgb mga_mixrgb +#define vl_getrgba mga_getrgba +#define vl_setz mga_setz +#define vl_getz mga_getz +#endif + +/**************************************************************************** + * RGB[A] + ***************************************************************************/ +static void write_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, + const GLubyte rgba[][4], const GLubyte mask[]) +{ + const DMesaContext dmesa = (DMesaContext)ctx; + GLuint i, offset; + +#ifndef MATROX + offset = DSTRIDE * FLIP(y) + x; + if (mask) { + /* draw some pixels */ + for (i=0; iBuffer->height - 1; + + if (mask) { + /* draw some pixels */ + for (i=0; iBuffer->height - 1, rgba = vl_mixrgba(color); + + if (mask) { + /* draw some pixels */ + for (i=0; iBuffer->height - 1; + + if (mask) { + /* read some pixels */ + for (i=0; iBuffer->height - 1; + + if (mask) { + /* draw some pixels */ + for (i=0; iBuffer->height - 1; + + if (mask) { + /* draw some pixels */ + for (i=0; iBuffer->height - 1; + + if (mask) { + /* read some pixels */ + for (i=0; iBuffer->height - 1; + + if (mask) { + /* draw some values */ + for (i=0; iBuffer->height - 1; + + /* read all values */ + for (i=0; iBuffer->height - 1; \ + GLuint _w_ = dmesa->Buffer->width; \ + GLuint rgb = vl_mixrgb(v2->color); + +#define RENDER_SPAN(span) \ + GLuint i, offset = FLIP2(span.y)*_w_ + span.x; \ + for (i = 0; i < span.end; i++, offset++) { \ + vl_putpixel(offset, rgb); \ + } + +#include "swrast/s_tritemp.h" + +#else /* MATROX */ + +static void tri_rgb_flat (GLcontext *ctx, + const SWvertex *v0, + const SWvertex *v1, + const SWvertex *v2) +{ + const DMesaContext dmesa = (DMesaContext)ctx; + GLuint _b_ = dmesa->Buffer->height - 1; + MGAvertex m0, m1, m2; + m0.win[0] = v0->win[0]; + m0.win[1] = FLIP2(v0->win[1]); + m1.win[0] = v1->win[0]; + m1.win[1] = FLIP2(v1->win[1]); + m2.win[0] = v2->win[0]; + m2.win[1] = FLIP2(v2->win[1]); + *(unsigned long *)m2.color = *(unsigned long *)v2->color; + mga_draw_tri_rgb_flat((int)SWRAST_CONTEXT(ctx)->_backface_sign, &m0, &m1, &m2); +} +#endif /* MATROX */ + + + +/* + * Z-less flat triangle. + */ +#ifndef MATROX + +#define NAME tri_rgb_flat_zless + +#define INTERP_Z 1 +#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE + +#define SETUP_CODE \ + const DMesaContext dmesa = (DMesaContext)ctx; \ + GLuint _b_ = dmesa->Buffer->height - 1; \ + GLuint _w_ = dmesa->Buffer->width; \ + GLuint rgb = vl_mixrgb(v2->color); + +#define RENDER_SPAN(span) \ + GLuint i, offset = FLIP2(span.y)*_w_ + span.x; \ + for (i = 0; i < span.end; i++, offset++) { \ + const DEPTH_TYPE z = FixedToDepth(span.z); \ + if (z < zRow[i]) { \ + vl_putpixel(offset, rgb); \ + zRow[i] = z; \ + } \ + span.z += span.zStep; \ + } + +#include "swrast/s_tritemp.h" + +#else /* MATROX */ + +static void tri_rgb_flat_zless (GLcontext *ctx, + const SWvertex *v0, + const SWvertex *v1, + const SWvertex *v2) +{ + const DMesaContext dmesa = (DMesaContext)ctx; + GLuint _b_ = dmesa->Buffer->height - 1; + MGAvertex m0, m1, m2; + m0.win[0] = v0->win[0]; + m0.win[1] = FLIP2(v0->win[1]); + m0.win[2] = v0->win[2]; + m1.win[0] = v1->win[0]; + m1.win[1] = FLIP2(v1->win[1]); + m1.win[2] = v1->win[2]; + m2.win[0] = v2->win[0]; + m2.win[1] = FLIP2(v2->win[1]); + m2.win[2] = v2->win[2]; + *(unsigned long *)m2.color = *(unsigned long *)v2->color; + mga_draw_tri_rgb_flat_zless((int)SWRAST_CONTEXT(ctx)->_backface_sign, &m0, &m1, &m2); +} +#endif /* MATROX */ + + + +/* + * NON-depth-buffered iterated triangle. + */ +#ifndef MATROX + +#define NAME tri_rgb_iter + +#define INTERP_RGB 1 + +#define SETUP_CODE \ + const DMesaContext dmesa = (DMesaContext)ctx; \ + GLuint _b_ = dmesa->Buffer->height - 1; \ + GLuint _w_ = dmesa->Buffer->width; + +#define RENDER_SPAN(span) \ + GLuint i, offset = FLIP2(span.y)*_w_ + span.x; \ + for (i = 0; i < span.end; i++, offset++) { \ + vl_putpixel(offset, vl_mixfix(span.red, span.green, span.blue)); \ + span.red += span.redStep; \ + span.green += span.greenStep; \ + span.blue += span.blueStep; \ + } + +#include "swrast/s_tritemp.h" + +#else /* MATROX */ + +static void tri_rgb_iter (GLcontext *ctx, + const SWvertex *v0, + const SWvertex *v1, + const SWvertex *v2) +{ + const DMesaContext dmesa = (DMesaContext)ctx; + GLuint _b_ = dmesa->Buffer->height - 1; + MGAvertex m0, m1, m2; + m0.win[0] = v0->win[0]; + m0.win[1] = FLIP2(v0->win[1]); + m1.win[0] = v1->win[0]; + m1.win[1] = FLIP2(v1->win[1]); + m2.win[0] = v2->win[0]; + m2.win[1] = FLIP2(v2->win[1]); + *(unsigned long *)m0.color = *(unsigned long *)v0->color; + *(unsigned long *)m1.color = *(unsigned long *)v1->color; + *(unsigned long *)m2.color = *(unsigned long *)v2->color; + mga_draw_tri_rgb_iter((int)SWRAST_CONTEXT(ctx)->_backface_sign, &m0, &m1, &m2); +} +#endif /* MATROX */ + + + +/* + * Z-less iterated triangle. + */ +#ifndef MATROX + +#define NAME tri_rgb_iter_zless + +#define INTERP_Z 1 +#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE +#define INTERP_RGB 1 + +#define SETUP_CODE \ + const DMesaContext dmesa = (DMesaContext)ctx; \ + GLuint _b_ = dmesa->Buffer->height - 1; \ + GLuint _w_ = dmesa->Buffer->width; + +#define RENDER_SPAN(span) \ + GLuint i, offset = FLIP2(span.y)*_w_ + span.x; \ + for (i = 0; i < span.end; i++, offset++) { \ + const DEPTH_TYPE z = FixedToDepth(span.z); \ + if (z < zRow[i]) { \ + vl_putpixel(offset, vl_mixfix(span.red, span.green, span.blue));\ + zRow[i] = z; \ + } \ + span.red += span.redStep; \ + span.green += span.greenStep; \ + span.blue += span.blueStep; \ + span.z += span.zStep; \ + } + +#include "swrast/s_tritemp.h" + +#else /* MATROX */ + +static void tri_rgb_iter_zless (GLcontext *ctx, + const SWvertex *v0, + const SWvertex *v1, + const SWvertex *v2) +{ + const DMesaContext dmesa = (DMesaContext)ctx; + GLuint _b_ = dmesa->Buffer->height - 1; + MGAvertex m0, m1, m2; + m0.win[0] = v0->win[0]; + m0.win[1] = FLIP2(v0->win[1]); + m0.win[2] = v0->win[2]; + m1.win[0] = v1->win[0]; + m1.win[1] = FLIP2(v1->win[1]); + m1.win[2] = v1->win[2]; + m2.win[0] = v2->win[0]; + m2.win[1] = FLIP2(v2->win[1]); + m2.win[2] = v2->win[2]; + *(unsigned long *)m0.color = *(unsigned long *)v0->color; + *(unsigned long *)m1.color = *(unsigned long *)v1->color; + *(unsigned long *)m2.color = *(unsigned long *)v2->color; + mga_draw_tri_rgb_iter_zless((int)SWRAST_CONTEXT(ctx)->_backface_sign, &m0, &m1, &m2); +} +#endif /* MATROX */ + + + +/* + * Analyze context state to see if we can provide a fast triangle function + * Otherwise, return NULL. + */ +static swrast_tri_func dmesa_choose_tri_function (GLcontext *ctx) +{ + const SWcontext *swrast = SWRAST_CONTEXT(ctx); + + if ((ctx->RenderMode != GL_RENDER) + || (ctx->Polygon.SmoothFlag) + || (ctx->Polygon.StippleFlag) + || (ctx->Texture._EnabledUnits) + || (swrast->_RasterMask & MULTI_DRAW_BIT) + || (ctx->Polygon.CullFlag && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)) { + return (swrast_tri_func)NULL; + } + + if (swrast->_RasterMask==DEPTH_BIT + && ctx->Depth.Func==GL_LESS + && ctx->Depth.Mask==GL_TRUE + && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS) { + return (ctx->Light.ShadeModel==GL_SMOOTH) ? tri_rgb_iter_zless : tri_rgb_flat_zless; + } + + if (swrast->_RasterMask==0) { /* no depth test */ + return (ctx->Light.ShadeModel==GL_SMOOTH) ? tri_rgb_iter : tri_rgb_flat; + } + + return (swrast_tri_func)NULL; +} + + + +/* Override for the swrast triangle-selection function. Try to use one + * of our internal triangle functions, otherwise fall back to the + * standard swrast functions. + */ +static void dmesa_choose_tri (GLcontext *ctx) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + + if (!(swrast->Triangle=dmesa_choose_tri_function(ctx))) + _swrast_choose_triangle(ctx); +} + + + +/**************************************************************************** + * Optimized line rendering + ***************************************************************************/ + +#ifdef MATROX +static __inline void matrox_line_clip_hack (GLcontext *ctx, int _b_, MGAvertex *m0, const SWvertex *vert0, MGAvertex *m1, const SWvertex *vert1) +{ + int x0 = vert0->win[0]; + int y0 = vert0->win[1]; + int x1 = vert1->win[0]; + int y1 = vert1->win[1]; + /* s_linetemp.h { */ + GLint w = ctx->DrawBuffer->Width; + GLint h = ctx->DrawBuffer->Height; + if ((x0==w) | (x1==w)) { + if ((x0==w) & (x1==w)) + return; + x0 -= x0==w; + x1 -= x1==w; + } + if ((y0==h) | (y1==h)) { + if ((y0==h) & (y1==h)) + return; + y0 -= y0==h; + y1 -= y1==h; + } + /* } s_linetemp.h */ + m0->win[0] = x0; + m0->win[1] = FLIP2(y0); + m1->win[0] = x1; + m1->win[1] = FLIP2(y1); +} +#endif + +/* + * NON-depth-buffered flat line. + */ +#ifndef MATROX + +#define NAME line_rgb_flat + +#define INTERP_XY 1 +#define CLIP_HACK 1 + +#define SETUP_CODE \ + const DMesaContext dmesa = (DMesaContext)ctx; \ + GLuint _b_ = dmesa->Buffer->height - 1; \ + GLuint _w_ = dmesa->Buffer->width; \ + GLuint rgb = vl_mixrgb(vert1->color); + +#define PLOT(X,Y) vl_putpixel(FLIP2(Y) * _w_ + X, rgb); + +#include "swrast/s_linetemp.h" + +#else /* MATROX */ + +static void line_rgb_flat (GLcontext *ctx, + const SWvertex *vert0, + const SWvertex *vert1) +{ + const DMesaContext dmesa = (DMesaContext)ctx; + GLuint _b_ = dmesa->Buffer->height - 1; + MGAvertex m0, m1; + matrox_line_clip_hack(ctx, _b_, &m0, vert0, &m1, vert1); + *(unsigned long *)m1.color = *(unsigned long *)vert1->color; + mga_draw_line_rgb_flat(&m0, &m1); +} +#endif /* MATROX */ + + + +/* + * Z-less flat line. + */ +#ifndef MATROX + +#define NAME line_rgb_flat_zless + +#define INTERP_XY 1 +#define INTERP_Z 1 +#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE +#define CLIP_HACK 1 + +#define SETUP_CODE \ + const DMesaContext dmesa = (DMesaContext)ctx; \ + GLuint _b_ = dmesa->Buffer->height - 1; \ + GLuint _w_ = dmesa->Buffer->width; \ + GLuint rgb = vl_mixrgb(vert1->color); + +#define PLOT(X,Y) \ + if (Z < *zPtr) { \ + *zPtr = Z; \ + vl_putpixel(FLIP2(Y) * _w_ + X, rgb); \ + } + +#include "swrast/s_linetemp.h" + +#else /* MATROX */ + +static void line_rgb_flat_zless (GLcontext *ctx, + const SWvertex *vert0, + const SWvertex *vert1) +{ + const DMesaContext dmesa = (DMesaContext)ctx; + GLuint _b_ = dmesa->Buffer->height - 1; + MGAvertex m0, m1; + matrox_line_clip_hack(ctx, _b_, &m0, vert0, &m1, vert1); + m0.win[2] = vert0->win[2]; + m1.win[2] = vert1->win[2]; + *(unsigned long *)m1.color = *(unsigned long *)vert1->color; + mga_draw_line_rgb_flat_zless(&m0, &m1); +} +#endif /* MATROX */ + + + +#ifndef MATROX +#define line_rgb_iter NULL +#define line_rgb_iter_zless NULL +#else /* MATROX */ +/* + * NON-depth-buffered iterated line. + */ +static void line_rgb_iter (GLcontext *ctx, + const SWvertex *vert0, + const SWvertex *vert1) +{ + const DMesaContext dmesa = (DMesaContext)ctx; + GLuint _b_ = dmesa->Buffer->height - 1; + MGAvertex m0, m1; + matrox_line_clip_hack(ctx, _b_, &m0, vert0, &m1, vert1); + *(unsigned long *)m0.color = *(unsigned long *)vert0->color; + *(unsigned long *)m1.color = *(unsigned long *)vert1->color; + mga_draw_line_rgb_iter(&m0, &m1); +} + + + +/* + * Z-less iterated line. + */ +static void line_rgb_iter_zless (GLcontext *ctx, + const SWvertex *vert0, + const SWvertex *vert1) +{ + const DMesaContext dmesa = (DMesaContext)ctx; + GLuint _b_ = dmesa->Buffer->height - 1; + MGAvertex m0, m1; + matrox_line_clip_hack(ctx, _b_, &m0, vert0, &m1, vert1); + m0.win[2] = vert0->win[2]; + m1.win[2] = vert1->win[2]; + *(unsigned long *)m0.color = *(unsigned long *)vert0->color; + *(unsigned long *)m1.color = *(unsigned long *)vert1->color; + mga_draw_line_rgb_iter_zless(&m0, &m1); +} +#endif /* MATROX */ + + + +/* + * Analyze context state to see if we can provide a fast line function + * Otherwise, return NULL. + */ +static swrast_line_func dmesa_choose_line_function (GLcontext *ctx) +{ + const SWcontext *swrast = SWRAST_CONTEXT(ctx); + + if ((ctx->RenderMode != GL_RENDER) + || (ctx->Line.SmoothFlag) + || (ctx->Texture._EnabledUnits) + || (ctx->Line.StippleFlag) + || (swrast->_RasterMask & MULTI_DRAW_BIT) + || (ctx->Line.Width!=1.0F)) { + return (swrast_line_func)NULL; + } + + if (swrast->_RasterMask==DEPTH_BIT + && ctx->Depth.Func==GL_LESS + && ctx->Depth.Mask==GL_TRUE + && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS) { + return (ctx->Light.ShadeModel==GL_SMOOTH) ? line_rgb_iter_zless : line_rgb_flat_zless; + } + + if (swrast->_RasterMask==0) { /* no depth test */ + return (ctx->Light.ShadeModel==GL_SMOOTH) ? line_rgb_iter : line_rgb_flat; + } + + return (swrast_line_func)NULL; +} + + + +/* Override for the swrast line-selection function. Try to use one + * of our internal line functions, otherwise fall back to the + * standard swrast functions. + */ +static void dmesa_choose_line (GLcontext *ctx) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + + if (!(swrast->Line=dmesa_choose_line_function(ctx))) + _swrast_choose_line(ctx); +} + + + +/**************************************************************************** + * Miscellaneous device driver funcs + ***************************************************************************/ + +static void clear_index (GLcontext *ctx, GLuint index) +{ + ((DMesaContext)ctx)->ClearIndex = index; +} + +static void clear_color (GLcontext *ctx, const GLfloat color[4]) +{ + GLubyte col[4]; + CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]); + CLAMPED_FLOAT_TO_UBYTE(col[3], color[3]); + ((DMesaContext)ctx)->ClearColor = vl_mixrgba(col); +} + + + +static void clear (GLcontext *ctx, GLbitfield mask, GLboolean all, + GLint x, GLint y, GLint width, GLint height) +{ + const DMesaContext c = (DMesaContext)ctx; + const GLuint *colorMask = (GLuint *)&ctx->Color.ColorMask; + +/* + * Clear the specified region of the buffers indicated by 'mask' + * using the clear color or index as specified by one of the two + * functions above. + * If all==GL_TRUE, clear whole buffer, else just clear region defined + * by x,y,width,height + */ + + /* we can't handle color or index masking */ + if ((*colorMask == 0xffffffff) && (ctx->Color.IndexMask == 0xffffffff)) { +#ifndef MATROX + if (mask & DD_BACK_LEFT_BIT) { + int color = c->visual->rgb_flag ? c->ClearColor : c->ClearIndex; + + if (all) { + vl_clear(color); + } else { + vl_rect(x, y, width, height, color); + } + + mask &= ~DD_BACK_LEFT_BIT; + } +#else /* MATROX */ + unsigned short z = -1; + int color = c->ClearColor; + if (mask & DD_DEPTH_BIT) { + z = ctx->Depth.Clear * 0xffff; + } + if (all) { + mga_clear(mask & DD_FRONT_LEFT_BIT, + mask & DD_BACK_LEFT_BIT, + mask & DD_DEPTH_BIT, + 0, 0, c->Buffer->width, c->Buffer->height, + color, z); + } else { + mga_clear(mask & DD_FRONT_LEFT_BIT, + mask & DD_BACK_LEFT_BIT, + mask & DD_DEPTH_BIT, + x, y, width, height, + color, z); + } + mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT | DD_DEPTH_BIT); +#endif /* MATROX */ + } + + if (mask) { + _swrast_Clear(ctx, mask, all, x, y, width, height); + } +} + + + +static void set_buffer (GLcontext *ctx, GLframebuffer *colorBuffer, GLuint bufferBit) +{ + /* + * XXX todo - examine bufferBit and set read/write pointers + */ +} + + + +/* + * Return the width and height of the current buffer. + * If anything special has to been done when the buffer/window is + * resized, do it now. + */ +static void get_buffer_size (GLframebuffer *buffer, GLuint *width, GLuint *height) +{ + DMesaBuffer b = (DMesaBuffer)buffer; + + *width = b->width; + *height = b->height; +} + + + +static const GLubyte* get_string (GLcontext *ctx, GLenum name) +{ + switch (name) { + case GL_RENDERER: + return (const GLubyte *)"Mesa DJGPP" + #ifdef FX + " (FX)" + #endif + #ifdef MATROX + " (MGA)" + #endif + "\0port (c) Borca Daniel mar-2003"; + default: + return NULL; + } +} + + + +static void finish (GLcontext *ctx) +{ + /* + * XXX todo - OPTIONAL FUNCTION: implements glFinish if possible + */ +} + + + +static void flush (GLcontext *ctx) +{ + /* + * XXX todo - OPTIONAL FUNCTION: implements glFlush if possible + */ +} + + + +/**************************************************************************** + * State + ***************************************************************************/ +#define DMESA_NEW_LINE (_NEW_LINE | \ + _NEW_TEXTURE | \ + _NEW_LIGHT | \ + _NEW_DEPTH | \ + _NEW_RENDERMODE | \ + _SWRAST_NEW_RASTERMASK) + +#define DMESA_NEW_TRIANGLE (_NEW_POLYGON | \ + _NEW_TEXTURE | \ + _NEW_LIGHT | \ + _NEW_DEPTH | \ + _NEW_RENDERMODE | \ + _SWRAST_NEW_RASTERMASK) + +/* Extend the software rasterizer with our line and triangle + * functions. + */ +static void dmesa_register_swrast_functions (GLcontext *ctx) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + + swrast->choose_line = dmesa_choose_line; + swrast->choose_triangle = dmesa_choose_tri; + + swrast->invalidate_line |= DMESA_NEW_LINE; + swrast->invalidate_triangle |= DMESA_NEW_TRIANGLE; +} + + + +/* Setup pointers and other driver state that is constant for the life + * of a context. + */ +static void dmesa_init_pointers (GLcontext *ctx) +{ + TNLcontext *tnl; + struct swrast_device_driver *dd = _swrast_GetDeviceDriverReference(ctx); + + ctx->Driver.GetString = get_string; + ctx->Driver.GetBufferSize = get_buffer_size; + ctx->Driver.Flush = flush; + ctx->Driver.Finish = finish; + + /* Software rasterizer pixel paths: + */ + ctx->Driver.Accum = _swrast_Accum; + ctx->Driver.Bitmap = _swrast_Bitmap; + ctx->Driver.Clear = clear; + ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; + ctx->Driver.CopyPixels = _swrast_CopyPixels; + ctx->Driver.DrawPixels = _swrast_DrawPixels; + ctx->Driver.ReadPixels = _swrast_ReadPixels; + ctx->Driver.DrawBuffer = _swrast_DrawBuffer; + + /* Software texture functions: + */ + ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format; + ctx->Driver.TexImage1D = _mesa_store_teximage1d; + ctx->Driver.TexImage2D = _mesa_store_teximage2d; + ctx->Driver.TexImage3D = _mesa_store_teximage3d; + ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; + ctx->Driver.TexSubImage2D = _mesa_store_texsubimage2d; + ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; + ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; + + ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; + ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; + ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; + ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; + ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; + + ctx->Driver.CompressedTexImage1D = _mesa_store_compressed_teximage1d; + ctx->Driver.CompressedTexImage2D = _mesa_store_compressed_teximage2d; + ctx->Driver.CompressedTexImage3D = _mesa_store_compressed_teximage3d; + ctx->Driver.CompressedTexSubImage1D = _mesa_store_compressed_texsubimage1d; + ctx->Driver.CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d; + ctx->Driver.CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d; + + /* Swrast hooks for imaging extensions: + */ + ctx->Driver.CopyColorTable = _swrast_CopyColorTable; + ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; + ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; + ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; + + /* Statechange callbacks: + */ + ctx->Driver.ClearColor = clear_color; + ctx->Driver.ClearIndex = clear_index; + + /* Initialize the TNL driver interface: + */ + tnl = TNL_CONTEXT(ctx); + tnl->Driver.RunPipeline = _tnl_run_pipeline; + + dd->SetBuffer = set_buffer; + + /* Install swsetup for tnl->Driver.Render.*: + */ + _swsetup_Wakeup(ctx); + + /* The span functions should be in `dmesa_update_state', but I'm + * pretty sure they will never change during the life of the Visual + */ +#ifdef MATROX + if (((DMesaContext)ctx)->visual->zbuffer == -1) { + /* Depth span/pixel functions */ + dd->WriteDepthSpan = write_depth_span; + dd->WriteDepthPixels = write_depth_pixels; + dd->ReadDepthSpan = read_depth_span; + dd->ReadDepthPixels = read_depth_pixels; + } +#endif + +#ifndef MATROX + /* Index span/pixel functions */ + dd->WriteCI32Span = write_index_span; + dd->WriteCI8Span = write_index8_span; + dd->WriteMonoCISpan = write_mono_index_span; + dd->WriteCI32Pixels = write_index_pixels; + dd->WriteMonoCIPixels = write_mono_index_pixels; + dd->ReadCI32Span = read_index_span; + dd->ReadCI32Pixels = read_index_pixels; +#endif + + /* RGB(A) span/pixel functions */ + dd->WriteRGBASpan = write_rgba_span; + dd->WriteRGBSpan = write_rgb_span; + dd->WriteMonoRGBASpan = write_mono_rgba_span; + dd->WriteRGBAPixels = write_rgba_pixels; + dd->WriteMonoRGBAPixels = write_mono_rgba_pixels; + dd->ReadRGBASpan = read_rgba_span; + dd->ReadRGBAPixels = read_rgba_pixels; +} + + + +static void dmesa_update_state (GLcontext *ctx, GLuint new_state) +{ + /* Propogate statechange information to swrast and swrast_setup + * modules. The DMesa driver has no internal GL-dependent state. + */ + _swrast_InvalidateState( ctx, new_state ); + _ac_InvalidateState( ctx, new_state ); + _tnl_InvalidateState( ctx, new_state ); + _swsetup_InvalidateState( ctx, new_state ); +} +#endif /* FX */ + + + +/**************************************************************************** + * DMesa Public API Functions + ***************************************************************************/ + +/* + * The exact arguments to this function will depend on your window system + */ +DMesaVisual DMesaCreateVisual (GLint width, + GLint height, + GLint colDepth, + GLint refresh, + GLboolean dbFlag, + GLboolean rgbFlag, + GLboolean alphaFlag, + GLint depthSize, + GLint stencilSize, + GLint accumSize) +{ +#ifndef FX + DMesaVisual v; + GLint redBits, greenBits, blueBits, alphaBits, indexBits; + +#ifndef MATROX + if (!dbFlag) { + return NULL; + } +#else + if (!rgbFlag) { + return NULL; + } +#endif + + alphaBits = 0; + + if (!rgbFlag) { + indexBits = 8; + redBits = 0; + greenBits = 0; + blueBits = 0; + } else { + indexBits = 0; + switch (colDepth) { + case 8: + redBits = 8; + greenBits = 8; + blueBits = 8; + break; + case 15: + redBits = 5; + greenBits = 5; + blueBits = 5; + break; + case 16: + redBits = 5; + greenBits = 6; + blueBits = 5; + break; + case 32: + alphaBits = 8; + case 24: + redBits = 8; + greenBits = 8; + blueBits = 8; + break; + default: + return NULL; + } + } + +#ifndef MATROX + if ((colDepth=vl_video_init(width, height, colDepth, rgbFlag, refresh)) <= 0) { + return NULL; + } +#else + if (mga_open(width, height, colDepth, dbFlag ? 2 : 1, depthSize == 16, refresh) < 0) { + return NULL; + } +#endif + + if (alphaFlag && (alphaBits==0)) { + alphaBits = 8; + } + + if ((v=(DMesaVisual)CALLOC_STRUCT(dmesa_visual)) != NULL) { + /* Create core visual */ + _mesa_initialize_visual((GLvisual *)v, + rgbFlag, /* rgb */ + dbFlag, + GL_FALSE, /* stereo */ + redBits, + greenBits, + blueBits, + alphaBits, + indexBits, /* indexBits */ + depthSize, + stencilSize, + accumSize, /* accumRed */ + accumSize, /* accumGreen */ + accumSize, /* accumBlue */ + alphaFlag?accumSize:0, /* accumAlpha */ + 1); /* numSamples */ + + v->depth = colDepth; + v->db_flag = dbFlag; + v->rgb_flag = rgbFlag; + + v->zbuffer = (depthSize > 0) ? 1 : 0; +#ifdef MATROX + mga_get(MGA_GET_HPIXELS, &v->stride_in_pixels); + if (depthSize == 16) { + v->zbuffer = -1; + } +#endif + } + + return v; + +#else /* FX */ + + int i = 0, fx_attrib[32]; + + if (!rgbFlag) { + return NULL; + } + + if (dbFlag) fx_attrib[i++] = FXMESA_DOUBLEBUFFER; + if (depthSize > 0) { fx_attrib[i++] = FXMESA_DEPTH_SIZE; fx_attrib[i++] = depthSize; } + if (stencilSize > 0) { fx_attrib[i++] = FXMESA_STENCIL_SIZE; fx_attrib[i++] = stencilSize; } + if (accumSize > 0) { fx_attrib[i++] = FXMESA_ACCUM_SIZE; fx_attrib[i++] = accumSize; } + if (alphaFlag) { fx_attrib[i++] = FXMESA_ALPHA_SIZE; fx_attrib[i++] = 1; } + fx_attrib[i] = FXMESA_NONE; + + return (DMesaVisual)fxMesaCreateBestContext(-1, width, height, fx_attrib); +#endif /* FX */ +} + + + +void DMesaDestroyVisual (DMesaVisual v) +{ +#ifndef FX + _mesa_destroy_visual((GLvisual *)v); + +#ifndef MATROX + vl_video_exit(); +#else + mga_close(1, 1); +#endif + +#else + fxMesaDestroyContext((fxMesaContext)v); +#endif +} + + + +DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, + GLint xpos, GLint ypos, + GLint width, GLint height) +{ +#ifndef FX + DMesaBuffer b; + + if ((b=(DMesaBuffer)CALLOC_STRUCT(dmesa_buffer)) != NULL) { + _mesa_initialize_framebuffer((GLframebuffer *)b, + (GLvisual *)visual, + visual->zbuffer == 1, + ((GLvisual *)visual)->stencilBits > 0, + ((GLvisual *)visual)->accumRedBits > 0, + ((GLvisual *)visual)->alphaBits > 0); + b->xpos = xpos; + b->ypos = ypos; + b->width = width; + b->height = height; + } + + return b; +#else + return (DMesaBuffer)visual; +#endif +} + + + +void DMesaDestroyBuffer (DMesaBuffer b) +{ +#ifndef FX +#ifndef MATROX + free(b->the_window); +#endif + _mesa_destroy_framebuffer((GLframebuffer *)b); +#endif +} + + + +DMesaContext DMesaCreateContext (DMesaVisual visual, + DMesaContext share) +{ +#ifndef FX + DMesaContext c; + GLboolean direct = GL_FALSE; + + if ((c=(DMesaContext)CALLOC_STRUCT(dmesa_context)) != NULL) { + _mesa_initialize_context((GLcontext *)c, + (GLvisual *)visual, + (GLcontext *)share, + (void *)c, direct); + + _mesa_enable_sw_extensions((GLcontext *)c); + _mesa_enable_1_3_extensions((GLcontext *)c); + _mesa_enable_1_4_extensions((GLcontext *)c); + + /* you probably have to do a bunch of other initializations here. */ + c->visual = visual; + + ((GLcontext *)c)->Driver.UpdateState = dmesa_update_state; + + /* Initialize the software rasterizer and helper modules. + */ + _swrast_CreateContext((GLcontext *)c); + _ac_CreateContext((GLcontext *)c); + _tnl_CreateContext((GLcontext *)c); + _swsetup_CreateContext((GLcontext *)c); + if (visual->rgb_flag) dmesa_register_swrast_functions((GLcontext *)c); + dmesa_init_pointers((GLcontext *)c); + } + + return c; + +#else /* FX */ + return (DMesaContext)visual; +#endif /* FX */ +} + + + +void DMesaDestroyContext (DMesaContext c) +{ +#ifndef FX + if (c) { + _swsetup_DestroyContext((GLcontext *)c); + _swrast_DestroyContext((GLcontext *)c); + _tnl_DestroyContext((GLcontext *)c); + _ac_DestroyContext((GLcontext *)c); + _mesa_destroy_context((GLcontext *)c); + } +#endif +} + + + +GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos) +{ +#if !defined(FX) && !defined(MATROX) + GET_CURRENT_CONTEXT(ctx); + DMesaBuffer b = ((DMesaContext)ctx)->Buffer; + + if (vl_sync_buffer(&b->the_window, xpos, ypos, b->width, b->height) != 0) { + return GL_FALSE; + } else { + b->xpos = xpos; + b->ypos = ypos; + return GL_TRUE; + } + +#else + return GL_FALSE; +#endif +} + + + +GLboolean DMesaResizeBuffer (GLint width, GLint height) +{ +#if !defined(FX) && !defined(MATROX) + GET_CURRENT_CONTEXT(ctx); + DMesaBuffer b = ((DMesaContext)ctx)->Buffer; + + if (vl_sync_buffer(&b->the_window, b->xpos, b->ypos, width, height) != 0) { + return GL_FALSE; + } else { + b->width = width; + b->height = height; + return GL_TRUE; + } + +#else + return GL_FALSE; +#endif +} + + + +/* + * Make the specified context and buffer the current one. + */ +GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b) +{ +#ifndef FX + if ((c != NULL) && (b != NULL)) { +#ifndef MATROX + if (vl_sync_buffer(&b->the_window, b->xpos, b->ypos, b->width, b->height) != 0) { + return GL_FALSE; + } +#endif + + c->Buffer = b; + + _mesa_make_current((GLcontext *)c, (GLframebuffer *)b); + if (((GLcontext *)c)->Viewport.Width == 0) { + /* initialize viewport to window size */ + _mesa_Viewport(0, 0, b->width, b->height); + } + } else { + /* Detach */ + _mesa_make_current(NULL, NULL); + } + +#else + fxMesaMakeCurrent((fxMesaContext)c); +#endif + + return GL_TRUE; +} + + + +void DMesaSwapBuffers (DMesaBuffer b) +{ + /* copy/swap back buffer to front if applicable */ +#ifndef FX + GET_CURRENT_CONTEXT(ctx); + _mesa_notifySwapBuffers(ctx); +#ifndef MATROX + vl_flip(); +#else + if (((DMesaContext)ctx)->visual->db_flag) { + mga_swapbuffers(1); + } +#endif +#else + fxMesaSwapBuffers(); +#endif +} + + + +void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue) +{ +#if !defined(FX) && !defined(MATROX) + vl_setCI(ndx, red, green, blue); +#endif +} + + + +DMesaContext DMesaGetCurrentContext (void) +{ +#ifndef FX + GET_CURRENT_CONTEXT(ctx); + return (DMesaContext)ctx; +#else + return (DMesaContext)fxMesaGetCurrentContext(); +#endif +} + + + +int DMesaGetIntegerv (GLenum pname, GLint *params) +{ +#ifndef FX + GET_CURRENT_CONTEXT(ctx); + const DMesaContext c = (DMesaContext)ctx; +#else + const fxMesaContext c = fxMesaGetCurrentContext(); +#endif + + if (c == NULL) { + return -1; + } + + switch (pname) { + case DMESA_GET_SCREEN_SIZE: + #ifndef FX + #ifndef MATROX + vl_get(VL_GET_SCREEN_SIZE, params); + #else + mga_get(MGA_GET_SCREEN_SIZE, params); + #endif + #else + params[0] = c->screen_width; + params[1] = c->screen_height; + #endif + break; + case DMESA_GET_DRIVER_CAPS: + #ifndef FX + #ifndef MATROX + params[0] = DMESA_DRIVER_SWDB_BIT; + #else + params[0] = 0; + #endif + #else + params[0] = DMESA_DRIVER_LLWO_BIT; + #endif + break; + default: + return -1; + } + + return 0; +} diff --git a/src/mesa/drivers/dos/dpmi.c b/src/mesa/drivers/dos/dpmi.c index 17c005a9e58..f9943ea60bf 100644 --- a/src/mesa/drivers/dos/dpmi.c +++ b/src/mesa/drivers/dos/dpmi.c @@ -1,148 +1,148 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include - -#include "internal.h" - - - -#ifndef MAX -#define MAX(x, y) (((x)<(y))?(y):(x)) -#endif - - - -/* _create_linear_mapping: - * Maps a physical address range into linear memory. - */ -int _create_linear_mapping (unsigned long *linear, unsigned long physaddr, int size) -{ - __dpmi_meminfo meminfo; - - if (physaddr >= 0x100000) { - /* map into linear memory */ - meminfo.address = physaddr; - meminfo.size = size; - if (__dpmi_physical_address_mapping(&meminfo) != 0) - return -1; - - *linear = meminfo.address; - } else { - /* exploit 1 -> 1 physical to linear mapping in low megabyte */ - *linear = physaddr; - } - - return 0; -} - - - -/* _remove_linear_mapping: - * Frees the DPMI resources being used to map a linear address range. - */ -void _remove_linear_mapping (unsigned long *linear) -{ - __dpmi_meminfo meminfo; - - if (*linear) { - if (*linear >= 0x100000) { - meminfo.address = *linear; - __dpmi_free_physical_address_mapping(&meminfo); - } - - *linear = 0; - } -} - - - -/* _create_selector: - * Allocates a selector to access a region of linear memory. - */ -int _create_selector (int *segment, unsigned long base, int size) -{ - /* allocate an ldt descriptor */ - if ((*segment=__dpmi_allocate_ldt_descriptors(1)) < 0) { - *segment = 0; - return -1; - } - - /* create the linear mapping */ - if (_create_linear_mapping(&base, base, size)) { - __dpmi_free_ldt_descriptor(*segment); - *segment = 0; - return -1; - } - - /* set the descriptor base and limit */ - __dpmi_set_segment_base_address(*segment, base); - __dpmi_set_segment_limit(*segment, MAX(size-1, 0xFFFF)); - - return 0; -} - - - -/* _remove_selector: - * Frees a DPMI segment selector. - */ -void _remove_selector (int *segment) -{ - if (*segment) { - unsigned long base; - __dpmi_get_segment_base_address(*segment, &base); - _remove_linear_mapping(&base); - __dpmi_free_ldt_descriptor(*segment); - *segment = 0; - } -} - - - -/* Desc: retrieve CPU MMX capability - * - * In : - - * Out : FALSE if CPU cannot do MMX - * - * Note: - - */ -int _can_mmx (void) -{ -#ifdef USE_MMX_ASM - extern int _mesa_identify_x86_cpu_features (void); - return (_mesa_identify_x86_cpu_features() & 0x00800000); -#else - return 0; -#endif -} +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.4 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include + +#include "internal.h" + + + +#ifndef MAX +#define MAX(x, y) (((x)<(y))?(y):(x)) +#endif + + + +/* _create_linear_mapping: + * Maps a physical address range into linear memory. + */ +int _create_linear_mapping (unsigned long *linear, unsigned long physaddr, int size) +{ + __dpmi_meminfo meminfo; + + if (physaddr >= 0x100000) { + /* map into linear memory */ + meminfo.address = physaddr; + meminfo.size = size; + if (__dpmi_physical_address_mapping(&meminfo) != 0) + return -1; + + *linear = meminfo.address; + } else { + /* exploit 1 -> 1 physical to linear mapping in low megabyte */ + *linear = physaddr; + } + + return 0; +} + + + +/* _remove_linear_mapping: + * Frees the DPMI resources being used to map a linear address range. + */ +void _remove_linear_mapping (unsigned long *linear) +{ + __dpmi_meminfo meminfo; + + if (*linear) { + if (*linear >= 0x100000) { + meminfo.address = *linear; + __dpmi_free_physical_address_mapping(&meminfo); + } + + *linear = 0; + } +} + + + +/* _create_selector: + * Allocates a selector to access a region of linear memory. + */ +int _create_selector (int *segment, unsigned long base, int size) +{ + /* allocate an ldt descriptor */ + if ((*segment=__dpmi_allocate_ldt_descriptors(1)) < 0) { + *segment = 0; + return -1; + } + + /* create the linear mapping */ + if (_create_linear_mapping(&base, base, size)) { + __dpmi_free_ldt_descriptor(*segment); + *segment = 0; + return -1; + } + + /* set the descriptor base and limit */ + __dpmi_set_segment_base_address(*segment, base); + __dpmi_set_segment_limit(*segment, MAX(size-1, 0xFFFF)); + + return 0; +} + + + +/* _remove_selector: + * Frees a DPMI segment selector. + */ +void _remove_selector (int *segment) +{ + if (*segment) { + unsigned long base; + __dpmi_get_segment_base_address(*segment, &base); + _remove_linear_mapping(&base); + __dpmi_free_ldt_descriptor(*segment); + *segment = 0; + } +} + + + +/* Desc: retrieve CPU MMX capability + * + * In : - + * Out : FALSE if CPU cannot do MMX + * + * Note: - + */ +int _can_mmx (void) +{ +#ifdef USE_MMX_ASM + extern int _mesa_x86_cpu_features; + return (_mesa_x86_cpu_features & 0x00800000); +#else + return 0; +#endif +} diff --git a/src/mesa/drivers/dos/internal.h b/src/mesa/drivers/dos/internal.h index 6860ef35840..dfb9274ecc7 100644 --- a/src/mesa/drivers/dos/internal.h +++ b/src/mesa/drivers/dos/internal.h @@ -1,129 +1,129 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef INTERNAL_H_included -#define INTERNAL_H_included - -#include "../mmath.h" - -/* - * general purpose defines, etc. - */ -#ifndef FALSE -#define FALSE 0 -#define TRUE !FALSE -#endif - -#define __PACKED__ __attribute__((packed)) - -typedef unsigned char word8; -typedef unsigned short word16; -typedef unsigned long word32; - -#define _16_ *(word16 *)& -#define _32_ *(word32 *)& - - - -/* - * video mode structure - */ -typedef struct vl_mode { - int mode; - int xres, yres; - int scanlen; - int bpp; - - int sel; - int gran; -} vl_mode; - - - -/* - * video driver structure - */ -typedef struct { - vl_mode *(*init) (void); - int (*entermode) (vl_mode *p, int refresh); - void (*blit) (void); - void (*setCI_f) (int index, float red, float green, float blue); - void (*setCI_i) (int index, int red, int green, int blue); - int (*get) (int pname, int *params); - void (*restore) (void); - void (*fini) (void); -} vl_driver; - - - -/* - * memory mapping - */ -int _create_linear_mapping (unsigned long *linear, unsigned long physaddr, int size); -void _remove_linear_mapping (unsigned long *linear); -int _create_selector (int *segment, unsigned long base, int size); -void _remove_selector (int *segment); - -/* - * system routines - */ -int _can_mmx (void); - -/* - * asm routines to deal with virtual buffering - */ -extern void v_clear8 (int color); -#define v_clear15 v_clear16 -extern void v_clear16 (int color); -extern void v_clear24 (int color); -extern void v_clear32 (int color); - -extern void v_clear8_mmx (int color); -#define v_clear15_mmx v_clear16_mmx -extern void v_clear16_mmx (int color); -extern void v_clear24_mmx (int color); -extern void v_clear32_mmx (int color); - -extern void v_rect8 (int x, int y, int width, int height, int color); -#define v_rect15 v_rect16 -extern void v_rect16 (int x, int y, int width, int height, int color); -extern void v_rect24 (int x, int y, int width, int height, int color); -extern void v_rect32 (int x, int y, int width, int height, int color); - -extern void v_putpixel8 (unsigned int offset, int color); -#define v_putpixel15 v_putpixel16 -extern void v_putpixel16 (unsigned int offset, int color); -extern void v_putpixel24 (unsigned int offset, int color); -extern void v_putpixel32 (unsigned int offset, int color); - -#endif +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.4 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef INTERNAL_H_included +#define INTERNAL_H_included + +#include "../main/mtypes.h" + +/* + * general purpose defines, etc. + */ +#ifndef FALSE +#define FALSE 0 +#define TRUE !FALSE +#endif + +#define __PACKED__ __attribute__((packed)) + +typedef unsigned char word8; +typedef unsigned short word16; +typedef unsigned long word32; + +#define _16_ *(word16 *)& +#define _32_ *(word32 *)& + + + +/* + * video mode structure + */ +typedef struct vl_mode { + int mode; + int xres, yres; + int scanlen; + int bpp; + + int sel; + int gran; +} vl_mode; + + + +/* + * video driver structure + */ +typedef struct { + vl_mode *(*init) (void); + int (*entermode) (vl_mode *p, int refresh); + void (*blit) (void); + void (*setCI_f) (int index, float red, float green, float blue); + void (*setCI_i) (int index, int red, int green, int blue); + int (*get) (int pname, int *params); + void (*restore) (void); + void (*fini) (void); +} vl_driver; + + + +/* + * memory mapping + */ +int _create_linear_mapping (unsigned long *linear, unsigned long physaddr, int size); +void _remove_linear_mapping (unsigned long *linear); +int _create_selector (int *segment, unsigned long base, int size); +void _remove_selector (int *segment); + +/* + * system routines + */ +int _can_mmx (void); + +/* + * asm routines to deal with virtual buffering + */ +extern void v_clear8 (int color); +#define v_clear15 v_clear16 +extern void v_clear16 (int color); +extern void v_clear24 (int color); +extern void v_clear32 (int color); + +extern void v_clear8_mmx (int color); +#define v_clear15_mmx v_clear16_mmx +extern void v_clear16_mmx (int color); +extern void v_clear24_mmx (int color); +extern void v_clear32_mmx (int color); + +extern void v_rect8 (int x, int y, int width, int height, int color); +#define v_rect15 v_rect16 +extern void v_rect16 (int x, int y, int width, int height, int color); +extern void v_rect24 (int x, int y, int width, int height, int color); +extern void v_rect32 (int x, int y, int width, int height, int color); + +extern void v_putpixel8 (unsigned int offset, int color); +#define v_putpixel15 v_putpixel16 +extern void v_putpixel16 (unsigned int offset, int color); +extern void v_putpixel24 (unsigned int offset, int color); +extern void v_putpixel32 (unsigned int offset, int color); + +#endif diff --git a/src/mesa/drivers/dos/mga/m_ttemp.h b/src/mesa/drivers/dos/mga/m_ttemp.h index 1c5fbda29af..90d9de35642 100644 --- a/src/mesa/drivers/dos/mga/m_ttemp.h +++ b/src/mesa/drivers/dos/mga/m_ttemp.h @@ -1,377 +1,377 @@ -/* - * Mesa 3-D graphics library - * Version: 5.0 - * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W triangle template - * - * Copyright (c) 2003 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -/* - * Triangle Rasterizer Template - * - * This file is #include'd to generate custom triangle rasterizers. - * - * The following macros may be defined to indicate what auxillary information - * must be interplated across the triangle: - * INTERP_Z - if defined, interpolate Z values - * INTERP_RGB - if defined, interpolate RGB values - * - * TAG - function name - * CULL - enable culling for: 0=no, 1=back, -1=front - * - * SETUP_CODE - to be executed once per triangle (usually HW init) - * - * For flatshaded primitives, the provoking vertex is the final one. - * This code was designed for the origin to be in the upper-left corner. - * - * Inspired by triangle rasterizer code written by Brian Paul. - */ - - - -#define TRI_SWAP(a, b) \ -do { \ - const MGAvertex *tmp = a; \ - a = b; \ - b = tmp; \ -} while (0) - -void TAG (int cull, const MGAvertex *v1, const MGAvertex *v2, const MGAvertex *v3) -{ - int area; - int x1, y1, x2, y2, x3, y3; - int eMaj_dx, eMaj_dy, eBot_dx, eBot_dy, eTop_dx, eTop_dy; -#ifdef INTERP_RGB -#define FIFO_CNT_RGB 3 - int eMaj_dr, eBot_dr, eMaj_dg, eBot_dg, eMaj_db, eBot_db; - int drdx, drdy, dgdx, dgdy, dbdx, dbdy; -#else -#define FIFO_CNT_RGB 0 -#endif -#ifdef INTERP_Z -#define FIFO_CNT_Z 1 - int dzdx, dzdy; - int eMaj_dz, eBot_dz; - int z1, z2, z3; -#else -#define FIFO_CNT_Z 0 -#endif - -#if defined(INTERP_Z) || defined(INTERP_RGB) - double one_area; -#ifndef INTERP_RGB - int red = v3->color[0]; - int green = v3->color[1]; - int blue = v3->color[2]; -#endif -#else - unsigned long color = mga_mixrgb_full(v3->color); -#endif - - int sgn = 0; - - /* sort along the vertical axis */ - if (v2->win[1] < v1->win[1]) { - TRI_SWAP(v1, v2); -#ifdef CULL - cull = -cull; -#endif - } - - if (v3->win[1] < v1->win[1]) { - TRI_SWAP(v1, v3); - TRI_SWAP(v2, v3); - } else if (v3->win[1] < v2->win[1]) { - TRI_SWAP(v2, v3); -#ifdef CULL - cull = -cull; -#endif - } - - x1 = v1->win[0]; - y1 = v1->win[1]; - x2 = v2->win[0]; - y2 = v2->win[1]; - x3 = v3->win[0]; - y3 = v3->win[1]; - - /* compute deltas for each edge */ - eMaj_dx = x3 - x1; - eMaj_dy = y3 - y1; - eBot_dx = x2 - x1; - eBot_dy = y2 - y1; - eTop_dx = x3 - x2; - eTop_dy = y3 - y2; - - /* compute area */ - if ((area = eMaj_dx * eBot_dy - eBot_dx * eMaj_dy) == 0) { - return; - } -#ifdef CULL - if ((area * cull) > 0) { - return; - } -#endif - - mga_select(); - - /* set engine state */ -#ifdef SETUP_CODE - SETUP_CODE -#endif - - /* draw lower triangle */ -#if defined(INTERP_Z) || defined(INTERP_RGB) - one_area = (double)(1<<15) / (double)area; - mga_fifo(1); -#else - mga_fifo(2); - mga_outl(M_FCOL, color); -#endif - mga_outl(M_YDST, y1); - -#ifdef INTERP_Z - z1 = v1->win[2]; - z2 = v2->win[2]; - z3 = v3->win[2]; - - /* compute d?/dx and d?/dy derivatives */ - eMaj_dz = z3 - z1; - eBot_dz = z2 - z1; - dzdx = (eMaj_dz * eBot_dy - eMaj_dy * eBot_dz) * one_area; - dzdy = (eMaj_dx * eBot_dz - eMaj_dz * eBot_dx) * one_area; - -#ifndef INTERP_RGB - mga_fifo(11); - mga_outl(M_DR2, dzdx); - mga_outl(M_DR3, dzdy); - mga_outl(M_DR4, red<<15); - mga_outl(M_DR6, 0); - mga_outl(M_DR7, 0); - mga_outl(M_DR8, green<<15); - mga_outl(M_DR10, 0); - mga_outl(M_DR11, 0); - mga_outl(M_DR12, blue<<15); - mga_outl(M_DR14, 0); - mga_outl(M_DR15, 0); -#else - mga_fifo(2); - mga_outl(M_DR2, dzdx); - mga_outl(M_DR3, dzdy); -#endif -#endif - -#ifdef INTERP_RGB - /* compute color deltas */ - eMaj_dr = v3->color[0] - v1->color[0]; - eBot_dr = v2->color[0] - v1->color[0]; - eMaj_dg = v3->color[1] - v1->color[1]; - eBot_dg = v2->color[1] - v1->color[1]; - eMaj_db = v3->color[2] - v1->color[2]; - eBot_db = v2->color[2] - v1->color[2]; - - /* compute color increments */ - drdx = (eMaj_dr * eBot_dy - eMaj_dy * eBot_dr) * one_area; - drdy = (eMaj_dx * eBot_dr - eMaj_dr * eBot_dx) * one_area; - dgdx = (eMaj_dg * eBot_dy - eMaj_dy * eBot_dg) * one_area; - dgdy = (eMaj_dx * eBot_dg - eMaj_dg * eBot_dx) * one_area; - dbdx = (eMaj_db * eBot_dy - eMaj_dy * eBot_db) * one_area; - dbdy = (eMaj_dx * eBot_db - eMaj_db * eBot_dx) * one_area; - - mga_fifo(6); - mga_outl(M_DR6, drdx); - mga_outl(M_DR7, drdy); - mga_outl(M_DR10, dgdx); - mga_outl(M_DR11, dgdy); - mga_outl(M_DR14, dbdx); - mga_outl(M_DR15, dbdy); -#endif - - if (area > 0) { /* major edge on the right */ - if (eBot_dy) { /* have lower triangle */ - mga_fifo(9 + FIFO_CNT_Z + FIFO_CNT_RGB); - - mga_outl(M_AR0, eBot_dy); - if (x2 < x1) { - mga_outl(M_AR1, eBot_dx + eBot_dy - 1); - mga_outl(M_AR2, eBot_dx); - sgn |= M_SDXL; - } else { - mga_outl(M_AR1, -eBot_dx); - mga_outl(M_AR2, -eBot_dx); - } - - mga_outl(M_AR6, eMaj_dy); - if (x3 < x1) { - mga_outl(M_AR4, eMaj_dx + eMaj_dy - 1); - mga_outl(M_AR5, eMaj_dx); - sgn |= M_SDXR; - } else { - mga_outl(M_AR4, -eMaj_dx); - mga_outl(M_AR5, -eMaj_dx); - } - - mga_outl(M_FXBNDRY, (x1<<16) | x1); -#ifdef INTERP_Z - mga_outl(M_DR0, z1<<15); -#endif -#ifdef INTERP_RGB - mga_outl(M_DR4, v1->color[0]<<15); - mga_outl(M_DR8, v1->color[1]<<15); - mga_outl(M_DR12, v1->color[2]<<15); -#endif - mga_outl(M_SGN, sgn); - mga_outl(M_LEN | M_EXEC, eBot_dy); - } else { /* no lower triangle */ - mga_fifo(4 + FIFO_CNT_Z + FIFO_CNT_RGB); - - mga_outl(M_AR6, eMaj_dy); - if (x3 < x1) { - mga_outl(M_AR4, eMaj_dx + eMaj_dy - 1); - mga_outl(M_AR5, eMaj_dx); - sgn |= M_SDXR; - } else { - mga_outl(M_AR4, -eMaj_dx); - mga_outl(M_AR5, -eMaj_dx); - } - - mga_outl(M_FXBNDRY, (x1<<16) | x2); -#ifdef INTERP_Z - mga_outl(M_DR0, z2<<15); -#endif -#ifdef INTERP_RGB - mga_outl(M_DR4, v2->color[0]<<15); - mga_outl(M_DR8, v2->color[1]<<15); - mga_outl(M_DR12, v2->color[2]<<15); -#endif - } - - /* draw upper triangle */ - if (eTop_dy) { - mga_fifo(5); - mga_outl(M_AR0, eTop_dy); - if (x3 < x2) { - mga_outl(M_AR1, eTop_dx + eTop_dy - 1); - mga_outl(M_AR2, eTop_dx); - sgn |= M_SDXL; - } else { - mga_outl(M_AR1, -eTop_dx); - mga_outl(M_AR2, -eTop_dx); - sgn &= ~M_SDXL; - } - mga_outl(M_SGN, sgn); - mga_outl(M_LEN | M_EXEC, eTop_dy); - } - } else { /* major edge on the left */ - if (eBot_dy) { /* have lower triangle */ - mga_fifo(9 + FIFO_CNT_Z + FIFO_CNT_RGB); - - mga_outl(M_AR0, eMaj_dy); - if (x3 < x1) { - mga_outl(M_AR1, eMaj_dx + eMaj_dy - 1); - mga_outl(M_AR2, eMaj_dx); - sgn |= M_SDXL; - } else { - mga_outl(M_AR1, -eMaj_dx); - mga_outl(M_AR2, -eMaj_dx); - } - - mga_outl(M_AR6, eBot_dy); - if (x2 < x1) { - mga_outl(M_AR4, eBot_dx + eBot_dy - 1); - mga_outl(M_AR5, eBot_dx); - sgn |= M_SDXR; - } else { - mga_outl(M_AR4, -eBot_dx); - mga_outl(M_AR5, -eBot_dx); - } - - mga_outl(M_FXBNDRY, (x1<<16) | x1); -#ifdef INTERP_Z - mga_outl(M_DR0, z1<<15); -#endif -#ifdef INTERP_RGB - mga_outl(M_DR4, v1->color[0]<<15); - mga_outl(M_DR8, v1->color[1]<<15); - mga_outl(M_DR12, v1->color[2]<<15); -#endif - mga_outl(M_SGN, sgn); - mga_outl(M_LEN | M_EXEC, eBot_dy); - } else { /* no lower triangle */ - mga_fifo(4 + FIFO_CNT_Z + FIFO_CNT_RGB); - - mga_outl(M_AR0, eMaj_dy); - if (x3 < x1) { - mga_outl(M_AR1, eMaj_dx + eMaj_dy - 1); - mga_outl(M_AR2, eMaj_dx); - sgn |= M_SDXL; - } else { - mga_outl(M_AR1, -eMaj_dx); - mga_outl(M_AR2, -eMaj_dx); - } - - mga_outl(M_FXBNDRY, (x2<<16) | x1); -#ifdef INTERP_Z - mga_outl(M_DR0, z1<<15); -#endif -#ifdef INTERP_RGB - mga_outl(M_DR4, v1->color[0]<<15); - mga_outl(M_DR8, v1->color[1]<<15); - mga_outl(M_DR12, v1->color[2]<<15); -#endif - } - - /* draw upper triangle */ - if (eTop_dy) { - mga_fifo(5); - mga_outl(M_AR6, eTop_dy); - if (x3 < x2) { - mga_outl(M_AR4, eTop_dx + eTop_dy - 1); - mga_outl(M_AR5, eTop_dx); - sgn |= M_SDXR; - } else { - mga_outl(M_AR4, -eTop_dx); - mga_outl(M_AR5, -eTop_dx); - sgn &= ~M_SDXR; - } - mga_outl(M_SGN, sgn); - mga_outl(M_LEN | M_EXEC, eTop_dy); - } - } -} - -#undef FIFO_CNT_RGB -#undef FIFO_CNT_Z - -#undef TRI_SWAP - -#undef SETUP_CODE -#undef INTERP_RGB -#undef INTERP_Z -#undef CULL -#undef TAG +/* + * Mesa 3-D graphics library + * Version: 5.0 + * + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W triangle template + * + * Copyright (c) 2003 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +/* + * Triangle Rasterizer Template + * + * This file is #include'd to generate custom triangle rasterizers. + * + * The following macros may be defined to indicate what auxillary information + * must be interplated across the triangle: + * INTERP_Z - if defined, interpolate Z values + * INTERP_RGB - if defined, interpolate RGB values + * + * TAG - function name + * CULL - enable culling for: 0=no, 1=back, -1=front + * + * SETUP_CODE - to be executed once per triangle (usually HW init) + * + * For flatshaded primitives, the provoking vertex is the final one. + * This code was designed for the origin to be in the upper-left corner. + * + * Inspired by triangle rasterizer code written by Brian Paul. + */ + + + +#define TRI_SWAP(a, b) \ +do { \ + const MGAvertex *tmp = a; \ + a = b; \ + b = tmp; \ +} while (0) + +void TAG (int cull, const MGAvertex *v1, const MGAvertex *v2, const MGAvertex *v3) +{ + int area; + int x1, y1, x2, y2, x3, y3; + int eMaj_dx, eMaj_dy, eBot_dx, eBot_dy, eTop_dx, eTop_dy; +#ifdef INTERP_RGB +#define FIFO_CNT_RGB 3 + int eMaj_dr, eBot_dr, eMaj_dg, eBot_dg, eMaj_db, eBot_db; + int drdx, drdy, dgdx, dgdy, dbdx, dbdy; +#else +#define FIFO_CNT_RGB 0 +#endif +#ifdef INTERP_Z +#define FIFO_CNT_Z 1 + int dzdx, dzdy; + int eMaj_dz, eBot_dz; + int z1, z2, z3; +#else +#define FIFO_CNT_Z 0 +#endif + +#if defined(INTERP_Z) || defined(INTERP_RGB) + double one_area; +#ifndef INTERP_RGB + int red = v3->color[0]; + int green = v3->color[1]; + int blue = v3->color[2]; +#endif +#else + unsigned long color = mga_mixrgb_full(v3->color); +#endif + + int sgn = 0; + + /* sort along the vertical axis */ + if (v2->win[1] < v1->win[1]) { + TRI_SWAP(v1, v2); +#ifdef CULL + cull = -cull; +#endif + } + + if (v3->win[1] < v1->win[1]) { + TRI_SWAP(v1, v3); + TRI_SWAP(v2, v3); + } else if (v3->win[1] < v2->win[1]) { + TRI_SWAP(v2, v3); +#ifdef CULL + cull = -cull; +#endif + } + + x1 = v1->win[0]; + y1 = v1->win[1]; + x2 = v2->win[0]; + y2 = v2->win[1]; + x3 = v3->win[0]; + y3 = v3->win[1]; + + /* compute deltas for each edge */ + eMaj_dx = x3 - x1; + eMaj_dy = y3 - y1; + eBot_dx = x2 - x1; + eBot_dy = y2 - y1; + eTop_dx = x3 - x2; + eTop_dy = y3 - y2; + + /* compute area */ + if ((area = eMaj_dx * eBot_dy - eBot_dx * eMaj_dy) == 0) { + return; + } +#ifdef CULL + if ((area * cull) > 0) { + return; + } +#endif + + mga_select(); + + /* set engine state */ +#ifdef SETUP_CODE + SETUP_CODE +#endif + + /* draw lower triangle */ +#if defined(INTERP_Z) || defined(INTERP_RGB) + one_area = (double)(1<<15) / (double)area; + mga_fifo(1); +#else + mga_fifo(2); + mga_outl(M_FCOL, color); +#endif + mga_outl(M_YDST, y1); + +#ifdef INTERP_Z + z1 = v1->win[2]; + z2 = v2->win[2]; + z3 = v3->win[2]; + + /* compute d?/dx and d?/dy derivatives */ + eMaj_dz = z3 - z1; + eBot_dz = z2 - z1; + dzdx = (eMaj_dz * eBot_dy - eMaj_dy * eBot_dz) * one_area; + dzdy = (eMaj_dx * eBot_dz - eMaj_dz * eBot_dx) * one_area; + +#ifndef INTERP_RGB + mga_fifo(11); + mga_outl(M_DR2, dzdx); + mga_outl(M_DR3, dzdy); + mga_outl(M_DR4, red<<15); + mga_outl(M_DR6, 0); + mga_outl(M_DR7, 0); + mga_outl(M_DR8, green<<15); + mga_outl(M_DR10, 0); + mga_outl(M_DR11, 0); + mga_outl(M_DR12, blue<<15); + mga_outl(M_DR14, 0); + mga_outl(M_DR15, 0); +#else + mga_fifo(2); + mga_outl(M_DR2, dzdx); + mga_outl(M_DR3, dzdy); +#endif +#endif + +#ifdef INTERP_RGB + /* compute color deltas */ + eMaj_dr = v3->color[0] - v1->color[0]; + eBot_dr = v2->color[0] - v1->color[0]; + eMaj_dg = v3->color[1] - v1->color[1]; + eBot_dg = v2->color[1] - v1->color[1]; + eMaj_db = v3->color[2] - v1->color[2]; + eBot_db = v2->color[2] - v1->color[2]; + + /* compute color increments */ + drdx = (eMaj_dr * eBot_dy - eMaj_dy * eBot_dr) * one_area; + drdy = (eMaj_dx * eBot_dr - eMaj_dr * eBot_dx) * one_area; + dgdx = (eMaj_dg * eBot_dy - eMaj_dy * eBot_dg) * one_area; + dgdy = (eMaj_dx * eBot_dg - eMaj_dg * eBot_dx) * one_area; + dbdx = (eMaj_db * eBot_dy - eMaj_dy * eBot_db) * one_area; + dbdy = (eMaj_dx * eBot_db - eMaj_db * eBot_dx) * one_area; + + mga_fifo(6); + mga_outl(M_DR6, drdx); + mga_outl(M_DR7, drdy); + mga_outl(M_DR10, dgdx); + mga_outl(M_DR11, dgdy); + mga_outl(M_DR14, dbdx); + mga_outl(M_DR15, dbdy); +#endif + + if (area > 0) { /* major edge on the right */ + if (eBot_dy) { /* have lower triangle */ + mga_fifo(9 + FIFO_CNT_Z + FIFO_CNT_RGB); + + mga_outl(M_AR0, eBot_dy); + if (x2 < x1) { + mga_outl(M_AR1, eBot_dx + eBot_dy - 1); + mga_outl(M_AR2, eBot_dx); + sgn |= M_SDXL; + } else { + mga_outl(M_AR1, -eBot_dx); + mga_outl(M_AR2, -eBot_dx); + } + + mga_outl(M_AR6, eMaj_dy); + if (x3 < x1) { + mga_outl(M_AR4, eMaj_dx + eMaj_dy - 1); + mga_outl(M_AR5, eMaj_dx); + sgn |= M_SDXR; + } else { + mga_outl(M_AR4, -eMaj_dx); + mga_outl(M_AR5, -eMaj_dx); + } + + mga_outl(M_FXBNDRY, (x1<<16) | x1); +#ifdef INTERP_Z + mga_outl(M_DR0, z1<<15); +#endif +#ifdef INTERP_RGB + mga_outl(M_DR4, v1->color[0]<<15); + mga_outl(M_DR8, v1->color[1]<<15); + mga_outl(M_DR12, v1->color[2]<<15); +#endif + mga_outl(M_SGN, sgn); + mga_outl(M_LEN | M_EXEC, eBot_dy); + } else { /* no lower triangle */ + mga_fifo(4 + FIFO_CNT_Z + FIFO_CNT_RGB); + + mga_outl(M_AR6, eMaj_dy); + if (x3 < x1) { + mga_outl(M_AR4, eMaj_dx + eMaj_dy - 1); + mga_outl(M_AR5, eMaj_dx); + sgn |= M_SDXR; + } else { + mga_outl(M_AR4, -eMaj_dx); + mga_outl(M_AR5, -eMaj_dx); + } + + mga_outl(M_FXBNDRY, (x1<<16) | x2); +#ifdef INTERP_Z + mga_outl(M_DR0, z2<<15); +#endif +#ifdef INTERP_RGB + mga_outl(M_DR4, v2->color[0]<<15); + mga_outl(M_DR8, v2->color[1]<<15); + mga_outl(M_DR12, v2->color[2]<<15); +#endif + } + + /* draw upper triangle */ + if (eTop_dy) { + mga_fifo(5); + mga_outl(M_AR0, eTop_dy); + if (x3 < x2) { + mga_outl(M_AR1, eTop_dx + eTop_dy - 1); + mga_outl(M_AR2, eTop_dx); + sgn |= M_SDXL; + } else { + mga_outl(M_AR1, -eTop_dx); + mga_outl(M_AR2, -eTop_dx); + sgn &= ~M_SDXL; + } + mga_outl(M_SGN, sgn); + mga_outl(M_LEN | M_EXEC, eTop_dy); + } + } else { /* major edge on the left */ + if (eBot_dy) { /* have lower triangle */ + mga_fifo(9 + FIFO_CNT_Z + FIFO_CNT_RGB); + + mga_outl(M_AR0, eMaj_dy); + if (x3 < x1) { + mga_outl(M_AR1, eMaj_dx + eMaj_dy - 1); + mga_outl(M_AR2, eMaj_dx); + sgn |= M_SDXL; + } else { + mga_outl(M_AR1, -eMaj_dx); + mga_outl(M_AR2, -eMaj_dx); + } + + mga_outl(M_AR6, eBot_dy); + if (x2 < x1) { + mga_outl(M_AR4, eBot_dx + eBot_dy - 1); + mga_outl(M_AR5, eBot_dx); + sgn |= M_SDXR; + } else { + mga_outl(M_AR4, -eBot_dx); + mga_outl(M_AR5, -eBot_dx); + } + + mga_outl(M_FXBNDRY, (x1<<16) | x1); +#ifdef INTERP_Z + mga_outl(M_DR0, z1<<15); +#endif +#ifdef INTERP_RGB + mga_outl(M_DR4, v1->color[0]<<15); + mga_outl(M_DR8, v1->color[1]<<15); + mga_outl(M_DR12, v1->color[2]<<15); +#endif + mga_outl(M_SGN, sgn); + mga_outl(M_LEN | M_EXEC, eBot_dy); + } else { /* no lower triangle */ + mga_fifo(4 + FIFO_CNT_Z + FIFO_CNT_RGB); + + mga_outl(M_AR0, eMaj_dy); + if (x3 < x1) { + mga_outl(M_AR1, eMaj_dx + eMaj_dy - 1); + mga_outl(M_AR2, eMaj_dx); + sgn |= M_SDXL; + } else { + mga_outl(M_AR1, -eMaj_dx); + mga_outl(M_AR2, -eMaj_dx); + } + + mga_outl(M_FXBNDRY, (x2<<16) | x1); +#ifdef INTERP_Z + mga_outl(M_DR0, z1<<15); +#endif +#ifdef INTERP_RGB + mga_outl(M_DR4, v1->color[0]<<15); + mga_outl(M_DR8, v1->color[1]<<15); + mga_outl(M_DR12, v1->color[2]<<15); +#endif + } + + /* draw upper triangle */ + if (eTop_dy) { + mga_fifo(5); + mga_outl(M_AR6, eTop_dy); + if (x3 < x2) { + mga_outl(M_AR4, eTop_dx + eTop_dy - 1); + mga_outl(M_AR5, eTop_dx); + sgn |= M_SDXR; + } else { + mga_outl(M_AR4, -eTop_dx); + mga_outl(M_AR5, -eTop_dx); + sgn &= ~M_SDXR; + } + mga_outl(M_SGN, sgn); + mga_outl(M_LEN | M_EXEC, eTop_dy); + } + } +} + +#undef FIFO_CNT_RGB +#undef FIFO_CNT_Z + +#undef TRI_SWAP + +#undef SETUP_CODE +#undef INTERP_RGB +#undef INTERP_Z +#undef CULL +#undef TAG diff --git a/src/mesa/drivers/dos/mga/m_ttemp2.h b/src/mesa/drivers/dos/mga/m_ttemp2.h index 2933f2b1a95..13ca87d348a 100644 --- a/src/mesa/drivers/dos/mga/m_ttemp2.h +++ b/src/mesa/drivers/dos/mga/m_ttemp2.h @@ -1,375 +1,375 @@ -/* - * Mesa 3-D graphics library - * Version: 5.0 - * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W triangle template - * - * Copyright (c) 2003 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -/* - * Triangle Rasterizer Template - * - * This file is #include'd to generate custom triangle rasterizers. - * - * The following macros may be defined to indicate what auxillary information - * must be interplated across the triangle: - * INTERP_Z - if defined, interpolate Z values - * INTERP_RGB - if defined, interpolate RGB values - * - * TAG - function name - * CULL - enable culling for: 0=no, 1=back, -1=front - * - * SETUP_CODE - to be executed once per triangle (usually HW init) - * - * For flatshaded primitives, the provoking vertex is the final one. - * This code was designed for the origin to be in the upper-left corner. - * - * Inspired by triangle rasterizer code written by Brian Paul. - */ - - - -#define TRI_SWAP(a, b) \ -do { \ - const MGAvertex *tmp = a; \ - a = b; \ - b = tmp; \ -} while (0) - -void TAG (int cull, const MGAvertex *v1, const MGAvertex *v2, const MGAvertex *v3) -{ - int area; - int x1, y1, x2, y2, x3, y3; - int eMaj_dx, eMaj_dy, eBot_dx, eBot_dy, eTop_dx, eTop_dy; -#ifdef INTERP_RGB -#define FIFO_CNT_RGB 3 - int eMaj_dr, eBot_dr, eMaj_dg, eBot_dg, eMaj_db, eBot_db; - int drdx, drdy, dgdx, dgdy, dbdx, dbdy; -#else -#define FIFO_CNT_RGB 0 -#endif -#ifdef INTERP_Z -#define FIFO_CNT_Z 1 - int dzdx, dzdy; - int eMaj_dz, eBot_dz; - int z1, z2, z3; -#else -#define FIFO_CNT_Z 0 -#endif - -#if defined(INTERP_Z) || defined(INTERP_RGB) -#ifndef INTERP_RGB - int red = v3->color[0]; - int green = v3->color[1]; - int blue = v3->color[2]; -#endif -#else - unsigned long color = mga_mixrgb_full(v3->color); -#endif - - int sgn = 0; - - /* sort along the vertical axis */ - if (v2->win[1] < v1->win[1]) { - TRI_SWAP(v1, v2); -#ifdef CULL - cull = -cull; -#endif - } - - if (v3->win[1] < v1->win[1]) { - TRI_SWAP(v1, v3); - TRI_SWAP(v2, v3); - } else if (v3->win[1] < v2->win[1]) { - TRI_SWAP(v2, v3); -#ifdef CULL - cull = -cull; -#endif - } - - x1 = v1->win[0]; - y1 = v1->win[1]; - x2 = v2->win[0]; - y2 = v2->win[1]; - x3 = v3->win[0]; - y3 = v3->win[1]; - - /* compute deltas for each edge */ - eMaj_dx = x3 - x1; - eMaj_dy = y3 - y1; - eBot_dx = x2 - x1; - eBot_dy = y2 - y1; - eTop_dx = x3 - x2; - eTop_dy = y3 - y2; - - /* compute area */ - if ((area = eMaj_dx * eBot_dy - eBot_dx * eMaj_dy) == 0) { - return; - } -#ifdef CULL - if ((area * cull) > 0) { - return; - } -#endif - - mga_select(); - - /* set engine state */ -#ifdef SETUP_CODE - SETUP_CODE -#endif - - /* draw lower triangle */ -#if defined(INTERP_Z) || defined(INTERP_RGB) - mga_fifo(1); -#else - mga_fifo(2); - mga_outl(M_FCOL, color); -#endif - mga_outl(M_YDST, y1); - -#ifdef INTERP_Z - z1 = v1->win[2]; - z2 = v2->win[2]; - z3 = v3->win[2]; - - /* compute d?/dx and d?/dy derivatives */ - eMaj_dz = z3 - z1; - eBot_dz = z2 - z1; - dzdx = ((long long)(eMaj_dz * eBot_dy - eMaj_dy * eBot_dz)<<15) / area; - dzdy = ((long long)(eMaj_dx * eBot_dz - eMaj_dz * eBot_dx)<<15) / area; - -#ifndef INTERP_RGB - mga_fifo(11); - mga_outl(M_DR2, dzdx); - mga_outl(M_DR3, dzdy); - mga_outl(M_DR4, red<<15); - mga_outl(M_DR6, 0); - mga_outl(M_DR7, 0); - mga_outl(M_DR8, green<<15); - mga_outl(M_DR10, 0); - mga_outl(M_DR11, 0); - mga_outl(M_DR12, blue<<15); - mga_outl(M_DR14, 0); - mga_outl(M_DR15, 0); -#else - mga_fifo(2); - mga_outl(M_DR2, dzdx); - mga_outl(M_DR3, dzdy); -#endif -#endif - -#ifdef INTERP_RGB - /* compute color deltas */ - eMaj_dr = v3->color[0] - v1->color[0]; - eBot_dr = v2->color[0] - v1->color[0]; - eMaj_dg = v3->color[1] - v1->color[1]; - eBot_dg = v2->color[1] - v1->color[1]; - eMaj_db = v3->color[2] - v1->color[2]; - eBot_db = v2->color[2] - v1->color[2]; - - /* compute color increments */ - drdx = ((long long)(eMaj_dr * eBot_dy - eMaj_dy * eBot_dr)<<15) / area; - drdy = ((long long)(eMaj_dx * eBot_dr - eMaj_dr * eBot_dx)<<15) / area; - dgdx = ((long long)(eMaj_dg * eBot_dy - eMaj_dy * eBot_dg)<<15) / area; - dgdy = ((long long)(eMaj_dx * eBot_dg - eMaj_dg * eBot_dx)<<15) / area; - dbdx = ((long long)(eMaj_db * eBot_dy - eMaj_dy * eBot_db)<<15) / area; - dbdy = ((long long)(eMaj_dx * eBot_db - eMaj_db * eBot_dx)<<15) / area; - - mga_fifo(6); - mga_outl(M_DR6, drdx); - mga_outl(M_DR7, drdy); - mga_outl(M_DR10, dgdx); - mga_outl(M_DR11, dgdy); - mga_outl(M_DR14, dbdx); - mga_outl(M_DR15, dbdy); -#endif - - if (area > 0) { /* major edge on the right */ - if (eBot_dy) { /* have lower triangle */ - mga_fifo(9 + FIFO_CNT_Z + FIFO_CNT_RGB); - - mga_outl(M_AR0, eBot_dy); - if (x2 < x1) { - mga_outl(M_AR1, eBot_dx + eBot_dy - 1); - mga_outl(M_AR2, eBot_dx); - sgn |= M_SDXL; - } else { - mga_outl(M_AR1, -eBot_dx); - mga_outl(M_AR2, -eBot_dx); - } - - mga_outl(M_AR6, eMaj_dy); - if (x3 < x1) { - mga_outl(M_AR4, eMaj_dx + eMaj_dy - 1); - mga_outl(M_AR5, eMaj_dx); - sgn |= M_SDXR; - } else { - mga_outl(M_AR4, -eMaj_dx); - mga_outl(M_AR5, -eMaj_dx); - } - - mga_outl(M_FXBNDRY, (x1<<16) | x1); -#ifdef INTERP_Z - mga_outl(M_DR0, z1<<15); -#endif -#ifdef INTERP_RGB - mga_outl(M_DR4, v1->color[0]<<15); - mga_outl(M_DR8, v1->color[1]<<15); - mga_outl(M_DR12, v1->color[2]<<15); -#endif - mga_outl(M_SGN, sgn); - mga_outl(M_LEN | M_EXEC, eBot_dy); - } else { /* no lower triangle */ - mga_fifo(4 + FIFO_CNT_Z + FIFO_CNT_RGB); - - mga_outl(M_AR6, eMaj_dy); - if (x3 < x1) { - mga_outl(M_AR4, eMaj_dx + eMaj_dy - 1); - mga_outl(M_AR5, eMaj_dx); - sgn |= M_SDXR; - } else { - mga_outl(M_AR4, -eMaj_dx); - mga_outl(M_AR5, -eMaj_dx); - } - - mga_outl(M_FXBNDRY, (x1<<16) | x2); -#ifdef INTERP_Z - mga_outl(M_DR0, z2<<15); -#endif -#ifdef INTERP_RGB - mga_outl(M_DR4, v2->color[0]<<15); - mga_outl(M_DR8, v2->color[1]<<15); - mga_outl(M_DR12, v2->color[2]<<15); -#endif - } - - /* draw upper triangle */ - if (eTop_dy) { - mga_fifo(5); - mga_outl(M_AR0, eTop_dy); - if (x3 < x2) { - mga_outl(M_AR1, eTop_dx + eTop_dy - 1); - mga_outl(M_AR2, eTop_dx); - sgn |= M_SDXL; - } else { - mga_outl(M_AR1, -eTop_dx); - mga_outl(M_AR2, -eTop_dx); - sgn &= ~M_SDXL; - } - mga_outl(M_SGN, sgn); - mga_outl(M_LEN | M_EXEC, eTop_dy); - } - } else { /* major edge on the left */ - if (eBot_dy) { /* have lower triangle */ - mga_fifo(9 + FIFO_CNT_Z + FIFO_CNT_RGB); - - mga_outl(M_AR0, eMaj_dy); - if (x3 < x1) { - mga_outl(M_AR1, eMaj_dx + eMaj_dy - 1); - mga_outl(M_AR2, eMaj_dx); - sgn |= M_SDXL; - } else { - mga_outl(M_AR1, -eMaj_dx); - mga_outl(M_AR2, -eMaj_dx); - } - - mga_outl(M_AR6, eBot_dy); - if (x2 < x1) { - mga_outl(M_AR4, eBot_dx + eBot_dy - 1); - mga_outl(M_AR5, eBot_dx); - sgn |= M_SDXR; - } else { - mga_outl(M_AR4, -eBot_dx); - mga_outl(M_AR5, -eBot_dx); - } - - mga_outl(M_FXBNDRY, (x1<<16) | x1); -#ifdef INTERP_Z - mga_outl(M_DR0, z1<<15); -#endif -#ifdef INTERP_RGB - mga_outl(M_DR4, v1->color[0]<<15); - mga_outl(M_DR8, v1->color[1]<<15); - mga_outl(M_DR12, v1->color[2]<<15); -#endif - mga_outl(M_SGN, sgn); - mga_outl(M_LEN | M_EXEC, eBot_dy); - } else { /* no lower triangle */ - mga_fifo(4 + FIFO_CNT_Z + FIFO_CNT_RGB); - - mga_outl(M_AR0, eMaj_dy); - if (x3 < x1) { - mga_outl(M_AR1, eMaj_dx + eMaj_dy - 1); - mga_outl(M_AR2, eMaj_dx); - sgn |= M_SDXL; - } else { - mga_outl(M_AR1, -eMaj_dx); - mga_outl(M_AR2, -eMaj_dx); - } - - mga_outl(M_FXBNDRY, (x2<<16) | x1); -#ifdef INTERP_Z - mga_outl(M_DR0, z1<<15); -#endif -#ifdef INTERP_RGB - mga_outl(M_DR4, v1->color[0]<<15); - mga_outl(M_DR8, v1->color[1]<<15); - mga_outl(M_DR12, v1->color[2]<<15); -#endif - } - - /* draw upper triangle */ - if (eTop_dy) { - mga_fifo(5); - mga_outl(M_AR6, eTop_dy); - if (x3 < x2) { - mga_outl(M_AR4, eTop_dx + eTop_dy - 1); - mga_outl(M_AR5, eTop_dx); - sgn |= M_SDXR; - } else { - mga_outl(M_AR4, -eTop_dx); - mga_outl(M_AR5, -eTop_dx); - sgn &= ~M_SDXR; - } - mga_outl(M_SGN, sgn); - mga_outl(M_LEN | M_EXEC, eTop_dy); - } - } -} - -#undef FIFO_CNT_RGB -#undef FIFO_CNT_Z - -#undef TRI_SWAP - -#undef SETUP_CODE -#undef INTERP_RGB -#undef INTERP_Z -#undef CULL -#undef TAG +/* + * Mesa 3-D graphics library + * Version: 5.0 + * + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W triangle template + * + * Copyright (c) 2003 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +/* + * Triangle Rasterizer Template + * + * This file is #include'd to generate custom triangle rasterizers. + * + * The following macros may be defined to indicate what auxillary information + * must be interplated across the triangle: + * INTERP_Z - if defined, interpolate Z values + * INTERP_RGB - if defined, interpolate RGB values + * + * TAG - function name + * CULL - enable culling for: 0=no, 1=back, -1=front + * + * SETUP_CODE - to be executed once per triangle (usually HW init) + * + * For flatshaded primitives, the provoking vertex is the final one. + * This code was designed for the origin to be in the upper-left corner. + * + * Inspired by triangle rasterizer code written by Brian Paul. + */ + + + +#define TRI_SWAP(a, b) \ +do { \ + const MGAvertex *tmp = a; \ + a = b; \ + b = tmp; \ +} while (0) + +void TAG (int cull, const MGAvertex *v1, const MGAvertex *v2, const MGAvertex *v3) +{ + int area; + int x1, y1, x2, y2, x3, y3; + int eMaj_dx, eMaj_dy, eBot_dx, eBot_dy, eTop_dx, eTop_dy; +#ifdef INTERP_RGB +#define FIFO_CNT_RGB 3 + int eMaj_dr, eBot_dr, eMaj_dg, eBot_dg, eMaj_db, eBot_db; + int drdx, drdy, dgdx, dgdy, dbdx, dbdy; +#else +#define FIFO_CNT_RGB 0 +#endif +#ifdef INTERP_Z +#define FIFO_CNT_Z 1 + int dzdx, dzdy; + int eMaj_dz, eBot_dz; + int z1, z2, z3; +#else +#define FIFO_CNT_Z 0 +#endif + +#if defined(INTERP_Z) || defined(INTERP_RGB) +#ifndef INTERP_RGB + int red = v3->color[0]; + int green = v3->color[1]; + int blue = v3->color[2]; +#endif +#else + unsigned long color = mga_mixrgb_full(v3->color); +#endif + + int sgn = 0; + + /* sort along the vertical axis */ + if (v2->win[1] < v1->win[1]) { + TRI_SWAP(v1, v2); +#ifdef CULL + cull = -cull; +#endif + } + + if (v3->win[1] < v1->win[1]) { + TRI_SWAP(v1, v3); + TRI_SWAP(v2, v3); + } else if (v3->win[1] < v2->win[1]) { + TRI_SWAP(v2, v3); +#ifdef CULL + cull = -cull; +#endif + } + + x1 = v1->win[0]; + y1 = v1->win[1]; + x2 = v2->win[0]; + y2 = v2->win[1]; + x3 = v3->win[0]; + y3 = v3->win[1]; + + /* compute deltas for each edge */ + eMaj_dx = x3 - x1; + eMaj_dy = y3 - y1; + eBot_dx = x2 - x1; + eBot_dy = y2 - y1; + eTop_dx = x3 - x2; + eTop_dy = y3 - y2; + + /* compute area */ + if ((area = eMaj_dx * eBot_dy - eBot_dx * eMaj_dy) == 0) { + return; + } +#ifdef CULL + if ((area * cull) > 0) { + return; + } +#endif + + mga_select(); + + /* set engine state */ +#ifdef SETUP_CODE + SETUP_CODE +#endif + + /* draw lower triangle */ +#if defined(INTERP_Z) || defined(INTERP_RGB) + mga_fifo(1); +#else + mga_fifo(2); + mga_outl(M_FCOL, color); +#endif + mga_outl(M_YDST, y1); + +#ifdef INTERP_Z + z1 = v1->win[2]; + z2 = v2->win[2]; + z3 = v3->win[2]; + + /* compute d?/dx and d?/dy derivatives */ + eMaj_dz = z3 - z1; + eBot_dz = z2 - z1; + dzdx = ((long long)(eMaj_dz * eBot_dy - eMaj_dy * eBot_dz)<<15) / area; + dzdy = ((long long)(eMaj_dx * eBot_dz - eMaj_dz * eBot_dx)<<15) / area; + +#ifndef INTERP_RGB + mga_fifo(11); + mga_outl(M_DR2, dzdx); + mga_outl(M_DR3, dzdy); + mga_outl(M_DR4, red<<15); + mga_outl(M_DR6, 0); + mga_outl(M_DR7, 0); + mga_outl(M_DR8, green<<15); + mga_outl(M_DR10, 0); + mga_outl(M_DR11, 0); + mga_outl(M_DR12, blue<<15); + mga_outl(M_DR14, 0); + mga_outl(M_DR15, 0); +#else + mga_fifo(2); + mga_outl(M_DR2, dzdx); + mga_outl(M_DR3, dzdy); +#endif +#endif + +#ifdef INTERP_RGB + /* compute color deltas */ + eMaj_dr = v3->color[0] - v1->color[0]; + eBot_dr = v2->color[0] - v1->color[0]; + eMaj_dg = v3->color[1] - v1->color[1]; + eBot_dg = v2->color[1] - v1->color[1]; + eMaj_db = v3->color[2] - v1->color[2]; + eBot_db = v2->color[2] - v1->color[2]; + + /* compute color increments */ + drdx = ((long long)(eMaj_dr * eBot_dy - eMaj_dy * eBot_dr)<<15) / area; + drdy = ((long long)(eMaj_dx * eBot_dr - eMaj_dr * eBot_dx)<<15) / area; + dgdx = ((long long)(eMaj_dg * eBot_dy - eMaj_dy * eBot_dg)<<15) / area; + dgdy = ((long long)(eMaj_dx * eBot_dg - eMaj_dg * eBot_dx)<<15) / area; + dbdx = ((long long)(eMaj_db * eBot_dy - eMaj_dy * eBot_db)<<15) / area; + dbdy = ((long long)(eMaj_dx * eBot_db - eMaj_db * eBot_dx)<<15) / area; + + mga_fifo(6); + mga_outl(M_DR6, drdx); + mga_outl(M_DR7, drdy); + mga_outl(M_DR10, dgdx); + mga_outl(M_DR11, dgdy); + mga_outl(M_DR14, dbdx); + mga_outl(M_DR15, dbdy); +#endif + + if (area > 0) { /* major edge on the right */ + if (eBot_dy) { /* have lower triangle */ + mga_fifo(9 + FIFO_CNT_Z + FIFO_CNT_RGB); + + mga_outl(M_AR0, eBot_dy); + if (x2 < x1) { + mga_outl(M_AR1, eBot_dx + eBot_dy - 1); + mga_outl(M_AR2, eBot_dx); + sgn |= M_SDXL; + } else { + mga_outl(M_AR1, -eBot_dx); + mga_outl(M_AR2, -eBot_dx); + } + + mga_outl(M_AR6, eMaj_dy); + if (x3 < x1) { + mga_outl(M_AR4, eMaj_dx + eMaj_dy - 1); + mga_outl(M_AR5, eMaj_dx); + sgn |= M_SDXR; + } else { + mga_outl(M_AR4, -eMaj_dx); + mga_outl(M_AR5, -eMaj_dx); + } + + mga_outl(M_FXBNDRY, (x1<<16) | x1); +#ifdef INTERP_Z + mga_outl(M_DR0, z1<<15); +#endif +#ifdef INTERP_RGB + mga_outl(M_DR4, v1->color[0]<<15); + mga_outl(M_DR8, v1->color[1]<<15); + mga_outl(M_DR12, v1->color[2]<<15); +#endif + mga_outl(M_SGN, sgn); + mga_outl(M_LEN | M_EXEC, eBot_dy); + } else { /* no lower triangle */ + mga_fifo(4 + FIFO_CNT_Z + FIFO_CNT_RGB); + + mga_outl(M_AR6, eMaj_dy); + if (x3 < x1) { + mga_outl(M_AR4, eMaj_dx + eMaj_dy - 1); + mga_outl(M_AR5, eMaj_dx); + sgn |= M_SDXR; + } else { + mga_outl(M_AR4, -eMaj_dx); + mga_outl(M_AR5, -eMaj_dx); + } + + mga_outl(M_FXBNDRY, (x1<<16) | x2); +#ifdef INTERP_Z + mga_outl(M_DR0, z2<<15); +#endif +#ifdef INTERP_RGB + mga_outl(M_DR4, v2->color[0]<<15); + mga_outl(M_DR8, v2->color[1]<<15); + mga_outl(M_DR12, v2->color[2]<<15); +#endif + } + + /* draw upper triangle */ + if (eTop_dy) { + mga_fifo(5); + mga_outl(M_AR0, eTop_dy); + if (x3 < x2) { + mga_outl(M_AR1, eTop_dx + eTop_dy - 1); + mga_outl(M_AR2, eTop_dx); + sgn |= M_SDXL; + } else { + mga_outl(M_AR1, -eTop_dx); + mga_outl(M_AR2, -eTop_dx); + sgn &= ~M_SDXL; + } + mga_outl(M_SGN, sgn); + mga_outl(M_LEN | M_EXEC, eTop_dy); + } + } else { /* major edge on the left */ + if (eBot_dy) { /* have lower triangle */ + mga_fifo(9 + FIFO_CNT_Z + FIFO_CNT_RGB); + + mga_outl(M_AR0, eMaj_dy); + if (x3 < x1) { + mga_outl(M_AR1, eMaj_dx + eMaj_dy - 1); + mga_outl(M_AR2, eMaj_dx); + sgn |= M_SDXL; + } else { + mga_outl(M_AR1, -eMaj_dx); + mga_outl(M_AR2, -eMaj_dx); + } + + mga_outl(M_AR6, eBot_dy); + if (x2 < x1) { + mga_outl(M_AR4, eBot_dx + eBot_dy - 1); + mga_outl(M_AR5, eBot_dx); + sgn |= M_SDXR; + } else { + mga_outl(M_AR4, -eBot_dx); + mga_outl(M_AR5, -eBot_dx); + } + + mga_outl(M_FXBNDRY, (x1<<16) | x1); +#ifdef INTERP_Z + mga_outl(M_DR0, z1<<15); +#endif +#ifdef INTERP_RGB + mga_outl(M_DR4, v1->color[0]<<15); + mga_outl(M_DR8, v1->color[1]<<15); + mga_outl(M_DR12, v1->color[2]<<15); +#endif + mga_outl(M_SGN, sgn); + mga_outl(M_LEN | M_EXEC, eBot_dy); + } else { /* no lower triangle */ + mga_fifo(4 + FIFO_CNT_Z + FIFO_CNT_RGB); + + mga_outl(M_AR0, eMaj_dy); + if (x3 < x1) { + mga_outl(M_AR1, eMaj_dx + eMaj_dy - 1); + mga_outl(M_AR2, eMaj_dx); + sgn |= M_SDXL; + } else { + mga_outl(M_AR1, -eMaj_dx); + mga_outl(M_AR2, -eMaj_dx); + } + + mga_outl(M_FXBNDRY, (x2<<16) | x1); +#ifdef INTERP_Z + mga_outl(M_DR0, z1<<15); +#endif +#ifdef INTERP_RGB + mga_outl(M_DR4, v1->color[0]<<15); + mga_outl(M_DR8, v1->color[1]<<15); + mga_outl(M_DR12, v1->color[2]<<15); +#endif + } + + /* draw upper triangle */ + if (eTop_dy) { + mga_fifo(5); + mga_outl(M_AR6, eTop_dy); + if (x3 < x2) { + mga_outl(M_AR4, eTop_dx + eTop_dy - 1); + mga_outl(M_AR5, eTop_dx); + sgn |= M_SDXR; + } else { + mga_outl(M_AR4, -eTop_dx); + mga_outl(M_AR5, -eTop_dx); + sgn &= ~M_SDXR; + } + mga_outl(M_SGN, sgn); + mga_outl(M_LEN | M_EXEC, eTop_dy); + } + } +} + +#undef FIFO_CNT_RGB +#undef FIFO_CNT_Z + +#undef TRI_SWAP + +#undef SETUP_CODE +#undef INTERP_RGB +#undef INTERP_Z +#undef CULL +#undef TAG diff --git a/src/mesa/drivers/dos/mga/mga.c b/src/mesa/drivers/dos/mga/mga.c index 27afba0ba04..5b0ee6437ef 100644 --- a/src/mesa/drivers/dos/mga/mga.c +++ b/src/mesa/drivers/dos/mga/mga.c @@ -1,1536 +1,1536 @@ -/* - * Mesa 3-D graphics library - * Version: 5.0 - * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W - * - * Copyright (c) 2003 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - * - * Thanks to Shawn Hargreaves for FreeBE/AF - */ - - -#include -#include -#include - -#include "../internal.h" -#include "mga_reg.h" -#include "mga_hw.h" -#include "mga_mode.h" -#include "mga.h" - - - -/* cached drawing engine state */ -#define OP_NONE 0 - -#define OP_DRAWRECT (\ - M_DWG_TRAP | /* opcod */ \ - M_DWG_BLK | /* atype */ \ - /* linear */ \ - M_DWG_NOZCMP | /* zmode */ \ - M_DWG_SOLID | /* solid */ \ - M_DWG_ARZERO | /* arzero */ \ - M_DWG_SGNZERO | /* sgnzero */ \ - M_DWG_SHFTZERO | /* shftzero */ \ - M_DWG_BOP_SRC /* bop */ \ - /* trans */ \ - /* bltmod */ \ - /* pattern */ \ - /* transc */ ) -#define OP_DRAWRECT_TX32BGR (\ - M_DWG_TEXTURE_TRAP | /* opcod */ \ - M_DWG_I | /* atype */ \ - /* linear */ \ - M_DWG_NOZCMP | /* zmode */ \ - /* solid */ \ - M_DWG_ARZERO | /* arzero */ \ - M_DWG_SGNZERO | /* sgnzero */ \ - M_DWG_SHFTZERO | /* shftzero */ \ - M_DWG_BOP_SRC | /* bop */ \ - /* trans */ \ - M_DWG_BU32BGR /* bltmod */ \ - /* pattern */ \ - /* transc */ ) -#define OP_DRAWRECT_TX24BGR (\ - M_DWG_TEXTURE_TRAP | /* opcod */ \ - M_DWG_I | /* atype */ \ - /* linear */ \ - M_DWG_NOZCMP | /* zmode */ \ - /* solid */ \ - M_DWG_ARZERO | /* arzero */ \ - M_DWG_SGNZERO | /* sgnzero */ \ - M_DWG_SHFTZERO | /* shftzero */ \ - M_DWG_BOP_SRC | /* bop */ \ - /* trans */ \ - M_DWG_BU24BGR /* bltmod */ \ - /* pattern */ \ - /* transc */ ) -#define OP_DRAWLINE (\ - M_DWG_AUTOLINE_CLOSE | /* opcod */ \ - M_DWG_RPL | /* atype */ \ - /* linear */ \ - M_DWG_NOZCMP | /* zmode */ \ - M_DWG_SOLID | /* solid */ \ - /* arzero */ \ - /* sgnzero */ \ - M_DWG_SHFTZERO | /* shftzero */ \ - M_DWG_BOP_SRC | /* bop */ \ - /* trans */ \ - M_DWG_BFCOL /* bltmod */ \ - /* pattern */ \ - /* transc */ ) -#define OP_DRAWLINE_I (\ - M_DWG_AUTOLINE_CLOSE | /* opcod */ \ - M_DWG_I | /* atype */ \ - /* linear */ \ - M_DWG_NOZCMP | /* zmode */ \ - /* solid */ \ - /* arzero */ \ - /* sgnzero */ \ - /* shftzero */ \ - M_DWG_BOP_SRC | /* bop */ \ - /* trans */ \ - M_DWG_BFCOL /* bltmod */ \ - /* pattern */ \ - /* transc */ ) -#define OP_DRAWLINE_ZI (\ - M_DWG_AUTOLINE_CLOSE | /* opcod */ \ - M_DWG_ZI | /* atype */ \ - /* linear */ \ - M_DWG_ZLT | /* zmode */ \ - /* solid */ \ - /* arzero */ \ - /* sgnzero */ \ - /* shftzero */ \ - M_DWG_BOP_SRC | /* bop */ \ - /* trans */ \ - M_DWG_BFCOL /* bltmod */ \ - /* pattern */ \ - /* transc */ ) -#define OP_DRAWTRAP (\ - M_DWG_TRAP | /* opcod */ \ - M_DWG_BLK | /* atype */ \ - /* linear */ \ - M_DWG_NOZCMP | /* zmode */ \ - M_DWG_SOLID | /* solid */ \ - /* arzero */ \ - /* sgnzero */ \ - M_DWG_SHFTZERO | /* shftzero */ \ - M_DWG_BOP_SRC /* bop */ \ - /* trans */ \ - /* bltmod */ \ - /* pattern */ \ - /* transc */ ) -#define OP_DRAWTRAP_I (\ - M_DWG_TRAP | /* opcod */ \ - M_DWG_I | /* atype */ \ - /* linear */ \ - M_DWG_NOZCMP | /* zmode */ \ - /* solid */ \ - /* arzero */ \ - /* sgnzero */ \ - M_DWG_SHFTZERO | /* shftzero */ \ - M_DWG_BOP_SRC /* bop */ \ - /* trans */ \ - /* bltmod */ \ - /* pattern */ \ - /* transc */ ) -#define OP_DRAWTRAP_ZI (\ - M_DWG_TRAP | /* opcod */ \ - M_DWG_ZI | /* atype */ \ - /* linear */ \ - M_DWG_ZLT | /* zmode */ \ - /* solid */ \ - /* arzero */ \ - /* sgnzero */ \ - M_DWG_SHFTZERO | /* shftzero */ \ - M_DWG_BOP_SRC /* bop */ \ - /* trans */ \ - /* bltmod */ \ - /* pattern */ \ - /* transc */ ) -#define OP_ILOAD_32BGR (\ - M_DWG_ILOAD | /* opcod */ \ - M_DWG_RPL | /* atype */ \ - /* linear */ \ - /* zmode */ \ - /* solid */ \ - /* arzero */ \ - M_DWG_SGNZERO | /* sgnzero */ \ - M_DWG_SHFTZERO | /* shftzero */ \ - M_DWG_BOP_SRC | /* bop */ \ - /* trans */ \ - M_DWG_BU32BGR /* bltmod */ \ - /* pattern */ \ - /* transc */ ) -#define OP_ILOAD_24BGR (\ - M_DWG_ILOAD | /* opcod */ \ - M_DWG_RPL | /* atype */ \ - /* linear */ \ - /* zmode */ \ - /* solid */ \ - /* arzero */ \ - M_DWG_SGNZERO | /* sgnzero */ \ - M_DWG_SHFTZERO | /* shftzero */ \ - M_DWG_BOP_SRC | /* bop */ \ - /* trans */ \ - M_DWG_BU24BGR /* bltmod */ \ - /* pattern */ \ - /* transc */ ) - - - -/* internal hardware data structures */ -static int interleave; -static unsigned long zorg; -static unsigned long vram; -static char card_name[80]; - - - -/* some info about current mode */ -static int __bpp, __bypp; -static int __pixwidth, __bytwidth, __pagewidth, __width, __height, __zheight; -static int __operation; -static int __scrollx, __scrolly; - - - -/* buffers */ -static int mga_readbuffer, mga_writebuffer; -static long mga_readbuffer_ptr, mga_writebuffer_ptr; -static long mga_backbuffer_ptr, mga_frontbuffer_ptr; - - - -/* lookup table for scaling 2 bit colors up to 8 bits */ -static int _rgb_scale_2[4] = { - 0, 85, 170, 255 -}; - -/* lookup table for scaling 3 bit colors up to 8 bits */ -static int _rgb_scale_3[8] = { - 0, 36, 73, 109, 146, 182, 219, 255 -}; - -/* lookup table for scaling 5 bit colors up to 8 bits */ -static int _rgb_scale_5[32] = { - 0, 8, 16, 25, 33, 41, 49, 58, - 66, 74, 82, 90, 99, 107, 115, 123, - 132, 140, 148, 156, 165, 173, 181, 189, - 197, 206, 214, 222, 230, 239, 247, 255 -}; - -/* lookup table for scaling 6 bit colors up to 8 bits */ -static int _rgb_scale_6[64] = { - 0, 4, 8, 12, 16, 20, 24, 28, - 32, 36, 40, 45, 49, 53, 57, 61, - 65, 69, 73, 77, 81, 85, 89, 93, - 97, 101, 105, 109, 113, 117, 121, 125, - 130, 134, 138, 142, 146, 150, 154, 158, - 162, 166, 170, 174, 178, 182, 186, 190, - 194, 198, 202, 206, 210, 215, 219, 223, - 227, 231, 235, 239, 243, 247, 251, 255 -}; - - - -/* - * pixel/color routines - */ -void (*mga_putpixel) (unsigned int offset, int color); -int (*mga_getpixel) (unsigned int offset); -void (*mga_getrgba) (unsigned int offset, unsigned char rgba[4]); -int (*mga_mixrgb) (const unsigned char rgb[]); -static int (*mga_mixrgb_full) (const unsigned char rgb[]); - - - -/* mga_fifo: - * Waits until there are at least free slots in the FIFO buffer. - */ -#define mga_fifo(n) do { } while (mga_inb(M_FIFOSTATUS) < (n)) - - - -static int _mga_rread (int port, int index) -{ - mga_select(); - mga_outb(port, index); - return mga_inb(port+1); -} - - - -static void _mga_rwrite (int port, int index, int v) -{ - mga_select(); - mga_outb(port, index); - mga_outb(port+1, v); -} - - - -static void _mga_ralter (int port, int index, int mask, int v) -{ - int temp; - temp = _mga_rread(port, index); - temp &= (~mask); - temp |= (v & mask); - _mga_rwrite(port, index, temp); -} - - - -/* WaitTillIdle: - * Delay until the hardware controller has finished drawing. - */ -void mga_wait_idle (void) -{ - int tries = 2; - - /*hwptr_unselect(oldptr);*/ - - mga_select(); - - while (tries--) { - do { - } while (!(mga_inl(M_FIFOSTATUS) & 0x200)); - - do { - } while (mga_inl(M_STATUS) & 0x10000); - - mga_outb(M_CRTC_INDEX, 0); - } - - /*hwptr_select(oldptr);*/ -} - - - -/* Desc: Waits for the next vertical sync period. - * - * In : - * Out : - * - * Note: - */ -static void _mga_wait_retrace (void) -{ - int t1 = 0; - int t2 = 0; - - do { - t1 = t2; - t2 = mga_inl(M_VCOUNT); - } while (t2 >= t1); -} - - - -/* Desc: fix scan lines - * - * In : - * Out : - * - * Note: - */ -static unsigned long _mga_fix_scans (unsigned long l) -{ - unsigned long m = 0; - - switch (__bpp) { - case 8: - m = interleave?128:64; - break; - case 15: - case 16: - m = interleave?64:32; - break; - case 24: - m = interleave?128:64; - break; - case 32: - m = 32; - break; - } - - m -= 1; - return (l + m) & ~m; -} - - - -/* Desc: HW scrolling function - * - * In : - * Out : - * - * Note: view Z-buffer in 16bit modes: _mga_display_start(0, 0, __height, 1) - */ -void mga_display_start (long boffset, long x, long y, long waitVRT) -{ - long addr; - - mga_select(); - - if (waitVRT >= 0) { - - addr = __bytwidth * y + (boffset + x) * __bypp; - - if (interleave) { - addr /= 8; - } else { - addr /= 4; - } - - _mga_rwrite(M_CRTC_INDEX, 0x0D, (addr)&0xFF); - _mga_rwrite(M_CRTC_INDEX, 0x0C, (addr>>8)&0xFF); - _mga_ralter(M_CRTC_EXT_INDEX, 0, 0x0F, (addr>>16)&0x0F); - - while (waitVRT--) { - _mga_wait_retrace(); - } - } - - __scrollx = x; - __scrolly = y; -} - - - -/* Desc: set READ buffer - * - * In : either FRONT or BACK buffer - * Out : - * - * Note: - */ -void mga_set_readbuffer (int buffer) -{ - mga_readbuffer = buffer; - - mga_readbuffer_ptr = (mga_readbuffer == MGA_FRONTBUFFER) ? mga_frontbuffer_ptr : mga_backbuffer_ptr; -} - - - -/* Desc: set WRITE buffer - * - * In : either FRONT or BACK buffer - * Out : - * - * Note: - */ -void mga_set_writebuffer (int buffer) -{ - mga_writebuffer = buffer; - - mga_writebuffer_ptr = (mga_writebuffer == MGA_FRONTBUFFER) ? mga_frontbuffer_ptr : mga_backbuffer_ptr; - - mga_select(); - mga_fifo(1); - mga_outl(M_YDSTORG, mga_writebuffer_ptr); - - __operation = OP_NONE; -} - - - -/* Desc: swap buffers - * - * In : number of vertical retraces to wait - * Out : - * - * Note: - */ -void mga_swapbuffers (int swapinterval) -{ - /* flip the buffers */ - mga_backbuffer_ptr ^= __pagewidth; - mga_frontbuffer_ptr ^= __pagewidth; - - /* update READ/WRITE pointers */ - mga_set_readbuffer(mga_readbuffer); - mga_set_writebuffer(mga_writebuffer); - - /* make sure we always see the FRONT buffer */ - mga_display_start(mga_frontbuffer_ptr, __scrollx, __scrolly, swapinterval); -} - - - -/* Desc: color composition (w/o ALPHA) - * - * In : array of integers (R, G, B) - * Out : color - * - * Note: - - */ -static __inline int _mga_mixrgb8 (const unsigned char rgb[]) -{ - return (rgb[0]&0xe0)|((rgb[1]>>5)<<2)|(rgb[2]>>6); -} -static __inline int _mga_mixrgb15 (const unsigned char rgb[]) -{ - return ((rgb[0]>>3)<<10)|((rgb[1]>>3)<<5)|(rgb[2]>>3); -} -static __inline int _mga_mixrgb16 (const unsigned char rgb[]) -{ - return ((rgb[0]>>3)<<11)|((rgb[1]>>2)<<5)|(rgb[2]>>3); -} -static __inline int _mga_mixrgb32 (const unsigned char rgb[]) -{ - return (rgb[0]<<16)|(rgb[1]<<8)|(rgb[2]); -} - - - -/* Desc: color composition (w/o ALPHA) + replication - * - * In : array of integers (R, G, B) - * Out : color - * - * Note: - - */ -static int _mga_mixrgb8_full (const unsigned char rgb[]) -{ - int color = _mga_mixrgb8(rgb); - color |= color<<8; - return (color<<16) | color; -} -static int _mga_mixrgb15_full (const unsigned char rgb[]) -{ - int color = _mga_mixrgb15(rgb); - return (color<<16) | color; -} -static int _mga_mixrgb16_full (const unsigned char rgb[]) -{ - int color = _mga_mixrgb16(rgb); - return (color<<16) | color; -} -#define _mga_mixrgb32_full _mga_mixrgb32 - - - -/* Desc: putpixel - * - * In : pixel offset, pixel value - * Out : - - * - * Note: uses current write buffer - */ -static void _mga_putpixel8 (unsigned int offset, int color) -{ - hwptr_pokeb(mgaptr.linear_map, mga_writebuffer_ptr + offset, color); -} -#define _mga_putpixel15 _mga_putpixel16 -static void _mga_putpixel16 (unsigned int offset, int color) -{ - hwptr_pokew(mgaptr.linear_map, (mga_writebuffer_ptr + offset) * 2, color); -} -static void _mga_putpixel32 (unsigned int offset, int color) -{ - hwptr_pokel(mgaptr.linear_map, (mga_writebuffer_ptr + offset) * 4, color); -} - - - -/* Desc: pixel retrieval - * - * In : pixel offset - * Out : pixel value - * - * Note: uses current read buffer - */ -static __inline int _mga_getpixel8 (unsigned int offset) -{ - return hwptr_peekb(mgaptr.linear_map, mga_readbuffer_ptr + offset); -} -#define _mga_getpixel15 _mga_getpixel16 -static __inline int _mga_getpixel16 (unsigned int offset) -{ - return hwptr_peekw(mgaptr.linear_map, (mga_readbuffer_ptr + offset) * 2); -} -static __inline int _mga_getpixel32 (unsigned int offset) -{ - return hwptr_peekl(mgaptr.linear_map, (mga_readbuffer_ptr + offset) * 4); -} - - - -/* Desc: color decomposition - * - * In : pixel offset, array of integers to hold color components (R, G, B, A) - * Out : - - * - * Note: uses current read buffer - */ -static void _mga_getrgba8 (unsigned int offset, unsigned char rgba[4]) -{ - int c = _mga_getpixel8(offset); - rgba[0] = _rgb_scale_3[(c >> 5) & 0x7]; - rgba[1] = _rgb_scale_3[(c >> 2) & 0x7]; - rgba[2] = _rgb_scale_2[c & 0x3]; - rgba[3] = 255; -} -static void _mga_getrgba15 (unsigned int offset, unsigned char rgba[4]) -{ - int c = _mga_getpixel15(offset); - rgba[0] = _rgb_scale_5[(c >> 10) & 0x1F]; - rgba[1] = _rgb_scale_5[(c >> 5) & 0x1F]; - rgba[2] = _rgb_scale_5[c & 0x1F]; - rgba[3] = 255; -} -static void _mga_getrgba16 (unsigned int offset, unsigned char rgba[4]) -{ - int c = _mga_getpixel16(offset); - rgba[0] = _rgb_scale_5[(c >> 11) & 0x1F]; - rgba[1] = _rgb_scale_6[(c >> 5) & 0x3F]; - rgba[2] = _rgb_scale_5[c & 0x1F]; - rgba[3] = 255; -} -static void _mga_getrgba32 (unsigned int offset, unsigned char rgba[4]) -{ - int c = _mga_getpixel32(offset); - rgba[0] = c >> 16; - rgba[1] = c >> 8; - rgba[2] = c; - rgba[3] = c >> 24; -} - - - -/* Desc: RGB flat line - * - * In : - * Out : - * - * Note: - */ -void mga_draw_line_rgb_flat (const MGAvertex *v1, const MGAvertex *v2) -{ - unsigned long color; - int x1 = v1->win[0]; - int y1 = v1->win[1]; - int x2 = v2->win[0]; - int y2 = v2->win[1]; - - if ((x1 == x2) && (y1 == y2)) { - return; - } - - mga_select(); - - /* set engine state */ - if (__operation != OP_DRAWLINE) { - mga_fifo(1); - mga_outl(M_DWGCTL, OP_DRAWLINE); - __operation = OP_DRAWLINE; - } - - color = mga_mixrgb_full(v2->color); - - /* draw the line */ - mga_fifo(3); - mga_outl(M_FCOL, color); - mga_outl(M_XYSTRT, (y1<<16) | x1); - mga_outl(M_XYEND | M_EXEC, (y2<<16) | x2); -} - - - -/* Desc: RGB flat Z-less line - * - * In : - * Out : - * - * Note: I never figured out "diagonal increments" - */ -void mga_draw_line_rgb_flat_zless (const MGAvertex *v1, const MGAvertex *v2) -{ - int z1, dz; - int x1 = v1->win[0]; - int y1 = v1->win[1]; - int x2 = v2->win[0]; - int y2 = v2->win[1]; - int dx = abs(x2 - x1); - int dy = abs(y2 - y1); - - if ((dx == 0) && (dy == 0)) { - return; - } - - mga_select(); - - /* set engine state */ - if (__operation != OP_DRAWLINE_ZI) { - mga_fifo(1); - mga_outl(M_DWGCTL, OP_DRAWLINE_ZI); - __operation = OP_DRAWLINE_ZI; - } - - if (dx < dy) { - dx = dy; - } - - z1 = v1->win[2] << 15; - dz = ((v2->win[2] << 15) - z1) / dx; - - /* draw the line */ - mga_fifo(14); - mga_outl(M_DR0, z1); - mga_outl(M_DR2, dz); - mga_outl(M_DR3, dz); - mga_outl(M_DR4, v2->color[0] << 15); - mga_outl(M_DR6, 0); - mga_outl(M_DR7, 0); - mga_outl(M_DR8, v2->color[1] << 15); - mga_outl(M_DR10, 0); - mga_outl(M_DR11, 0); - mga_outl(M_DR12, v2->color[2] << 15); - mga_outl(M_DR14, 0); - mga_outl(M_DR15, 0); - mga_outl(M_XYSTRT, (y1<<16) | x1); - mga_outl(M_XYEND | M_EXEC, (y2<<16) | x2); -} - - - -/* Desc: RGB iterated line - * - * In : - * Out : - * - * Note: I never figured out "diagonal increments" - */ -void mga_draw_line_rgb_iter (const MGAvertex *v1, const MGAvertex *v2) -{ - int r1, g1, b1; - int dr, dg, db; - int x1 = v1->win[0]; - int y1 = v1->win[1]; - int x2 = v2->win[0]; - int y2 = v2->win[1]; - int dx = abs(x2 - x1); - int dy = abs(y2 - y1); - - if ((dx == 0) && (dy == 0)) { - return; - } - - mga_select(); - - /* set engine state */ - if (__operation != OP_DRAWLINE_I) { - mga_fifo(1); - mga_outl(M_DWGCTL, OP_DRAWLINE_I); - __operation = OP_DRAWLINE_I; - } - - if (dx < dy) { - dx = dy; - } - - r1 = v1->color[0] << 15; - g1 = v1->color[1] << 15; - b1 = v1->color[2] << 15; - dr = ((v2->color[0] << 15) - r1) / dx; - dg = ((v2->color[1] << 15) - g1) / dx; - db = ((v2->color[2] << 15) - b1) / dx; - - /* draw the line */ - mga_fifo(11); - mga_outl(M_DR4, r1); - mga_outl(M_DR6, dr); - mga_outl(M_DR7, dr); - mga_outl(M_DR8, g1); - mga_outl(M_DR10, dg); - mga_outl(M_DR11, dg); - mga_outl(M_DR12, b1); - mga_outl(M_DR14, db); - mga_outl(M_DR15, db); - mga_outl(M_XYSTRT, (y1<<16) | x1); - mga_outl(M_XYEND | M_EXEC, (y2<<16) | x2); -} - - - -/* Desc: RGB iterated Z-less line - * - * In : - * Out : - * - * Note: I never figured out "diagonal increments" - */ -void mga_draw_line_rgb_iter_zless (const MGAvertex *v1, const MGAvertex *v2) -{ - int z1, dz; - int r1, g1, b1; - int dr, dg, db; - int x1 = v1->win[0]; - int y1 = v1->win[1]; - int x2 = v2->win[0]; - int y2 = v2->win[1]; - int dx = abs(x2 - x1); - int dy = abs(y2 - y1); - - if ((dx == 0) && (dy == 0)) { - return; - } - - mga_select(); - - /* set engine state */ - if (__operation != OP_DRAWLINE_ZI) { - mga_fifo(1); - mga_outl(M_DWGCTL, OP_DRAWLINE_ZI); - __operation = OP_DRAWLINE_ZI; - } - - if (dx < dy) { - dx = dy; - } - - z1 = v1->win[2] << 15; - dz = ((v2->win[2] << 15) - z1) / dx; - - r1 = v1->color[0] << 15; - g1 = v1->color[1] << 15; - b1 = v1->color[2] << 15; - dr = ((v2->color[0] << 15) - r1) / dx; - dg = ((v2->color[1] << 15) - g1) / dx; - db = ((v2->color[2] << 15) - b1) / dx; - - /* draw the line */ - mga_fifo(14); - mga_outl(M_DR0, z1); - mga_outl(M_DR2, dz); - mga_outl(M_DR3, dz); - mga_outl(M_DR4, r1); - mga_outl(M_DR6, dr); - mga_outl(M_DR7, dr); - mga_outl(M_DR8, g1); - mga_outl(M_DR10, dg); - mga_outl(M_DR11, dg); - mga_outl(M_DR12, b1); - mga_outl(M_DR14, db); - mga_outl(M_DR15, db); - mga_outl(M_XYSTRT, (y1<<16) | x1); - mga_outl(M_XYEND | M_EXEC, (y2<<16) | x2); -} - - - -/* Desc: RGB flat triangle - * - * In : - * Out : - * - * Note: - */ -#define TAG mga_draw_tri_rgb_flat -#define CULL -#define SETUP_CODE \ - if (__operation != OP_DRAWTRAP) { \ - mga_fifo(1); \ - mga_outl(M_DWGCTL, OP_DRAWTRAP); \ - __operation = OP_DRAWTRAP; \ - } -#include "m_ttemp.h" - - - -/* Desc: RGB flat Z-less triangle - * - * In : - * Out : - * - * Note: - */ -#define TAG mga_draw_tri_rgb_flat_zless -#define CULL -#define INTERP_Z -#define SETUP_CODE \ - if (__operation != OP_DRAWTRAP_ZI) { \ - mga_fifo(1); \ - mga_outl(M_DWGCTL, OP_DRAWTRAP_ZI); \ - __operation = OP_DRAWTRAP_ZI; \ - } -#include "m_ttemp.h" - - - -/* Desc: RGB iterated triangle - * - * In : - * Out : - * - * Note: - */ -#define TAG mga_draw_tri_rgb_iter -#define CULL -#define INTERP_RGB -#define SETUP_CODE \ - if (__operation != OP_DRAWTRAP_I) { \ - mga_fifo(1); \ - mga_outl(M_DWGCTL, OP_DRAWTRAP_I); \ - __operation = OP_DRAWTRAP_I; \ - } -#include "m_ttemp.h" - - - -/* Desc: RGB iterated Z-less triangle - * - * In : - * Out : - * - * Note: - */ -#define TAG mga_draw_tri_rgb_iter_zless -#define CULL -#define INTERP_Z -#define INTERP_RGB -#define SETUP_CODE \ - if (__operation != OP_DRAWTRAP_ZI) { \ - mga_fifo(1); \ - mga_outl(M_DWGCTL, OP_DRAWTRAP_ZI); \ - __operation = OP_DRAWTRAP_ZI; \ - } -#include "m_ttemp.h" - - - -/* Desc: RGB flat rectangle - * - * In : - * Out : - * - * Note: - */ -void mga_draw_rect_rgb_flat (int left, int top, int width, int height, int color) -{ - if (__bpp == 8) { - color |= color << 8; - } - if (__bpp <= 16) { - color |= color << 16; - } - - mga_select(); - - /* set engine state */ - if (__operation != OP_DRAWRECT) { - - mga_fifo(1); - mga_outl(M_DWGCTL, OP_DRAWRECT); - __operation = OP_DRAWRECT; - } - - /* draw the rectangle */ - mga_fifo(3); - mga_outl(M_FCOL, color); - mga_outl(M_FXBNDRY, ((left+width)<<16) | left); - mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | height); -} - - - -/* Desc: 32RGB textured span - * - * In : - * Out : - * - * Note: 0 <= width <= 7*1024 - */ -void mga_draw_span_rgb_tx32 (int left, int top, int width, const unsigned long *bitmap) -{ - int i; - - if (!width) { - return; - } - - mga_select(); - - /* set engine state */ - if (__operation != OP_DRAWRECT_TX32BGR) { - mga_fifo(1); - mga_outl(M_DWGCTL, OP_DRAWRECT_TX32BGR); - __operation = OP_DRAWRECT_TX32BGR; - } - - /* draw the rectangle */ - mga_fifo(2); - mga_outl(M_FXBNDRY, ((left+width)<<16) | left); - mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | 1); - - /* copy data to the pseudo-dma window */ - i = 0; - do { - mga_outl(i, *bitmap); - bitmap++; - i += 4; - } while (--width); -} - - - -/* Desc: 24RGB textured span - * - * In : - * Out : - * - * Note: 0 <= width <= 7*1024 - */ -void mga_draw_span_rgb_tx24 (int left, int top, int width, const unsigned long *bitmap) -{ - int i; - - mga_select(); - - /* set engine state */ - if (__operation != OP_DRAWRECT_TX24BGR) { - mga_fifo(1); - mga_outl(M_DWGCTL, OP_DRAWRECT_TX24BGR); - __operation = OP_DRAWRECT_TX24BGR; - } - - /* draw the rectangle */ - mga_fifo(2); - mga_outl(M_FXBNDRY, ((left+width)<<16) | left); - mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | 1); - - /* copy data to the pseudo-dma window */ - i = 0; - width = (width * 3 + 3) / 4; - while (width) { - mga_outl(i & (7 * 1024 - 1), *bitmap); - bitmap++; - i += 4; - width--; - } -} - - - -/* Desc: 32RGB textured rectangle - * - * In : - * Out : - * - * Note: - */ -void mga_draw_rect_rgb_tx32 (int left, int top, int width, int height, const unsigned long *bitmap) -{ - int i; - - mga_select(); - - /* set engine state */ - if (__operation != OP_DRAWRECT_TX32BGR) { - mga_fifo(1); - mga_outl(M_DWGCTL, OP_DRAWRECT_TX32BGR); - __operation = OP_DRAWRECT_TX32BGR; - } - - /* draw the rectangle */ - mga_fifo(2); - mga_outl(M_FXBNDRY, ((left+width)<<16) | left); - mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | height); - - /* copy data to the pseudo-dma window */ - i = 0; - width *= height; - while (width) { - mga_outl(i & (7 * 1024 - 1), *bitmap); - bitmap++; - i += 4; - width--; - } -} - - - -/* Desc: 24RGB textured rectangle - * - * In : - * Out : - * - * Note: - */ -void mga_draw_rect_rgb_tx24 (int left, int top, int width, int height, const unsigned long *bitmap) -{ - int i; - - mga_select(); - - /* set engine state */ - if (__operation != OP_DRAWRECT_TX24BGR) { - mga_fifo(1); - mga_outl(M_DWGCTL, OP_DRAWRECT_TX24BGR); - __operation = OP_DRAWRECT_TX24BGR; - } - - /* draw the rectangle */ - mga_fifo(2); - mga_outl(M_FXBNDRY, ((left+width)<<16) | left); - mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | height); - - /* copy data to the pseudo-dma window */ - i = 0; - width = (width * height * 3 + 3) / 4; - while (width) { - mga_outl(i & (7 * 1024 - 1), *bitmap); - bitmap++; - i += 4; - width--; - } -} - - - -/* Desc: copy 32RGB image to screen - * - * In : - * Out : - * - * Note: - */ -void mga_iload_32RGB (int left, int top, int width, int height, const unsigned long *bitmap) -{ - int i; - - mga_select(); - - /* set engine state */ - if (__operation != OP_ILOAD_32BGR) { - mga_fifo(1); - mga_outl(M_DWGCTL, OP_ILOAD_32BGR); - __operation = OP_ILOAD_32BGR; - } - - /* draw the bitmap */ - mga_fifo(5); - mga_outl(M_AR0, width-1); - mga_outl(M_AR3, 0); - mga_outl(M_AR5, 0); - mga_outl(M_FXBNDRY, ((left+width-1)<<16) | left); - mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | height); - - /* copy data to the pseudo-dma window */ - i = 0; - width *= height; - while (width) { - mga_outl(i & (7 * 1024 - 1), *bitmap); - bitmap++; - i += 4; - width--; - } -} - - - -/* Desc: copy 24RGB image to screen - * - * In : - * Out : - * - * Note: - */ -void mga_iload_24RGB (int left, int top, int width, int height, const unsigned long *bitmap) -{ - int i; - - mga_select(); - - /* set engine state */ - if (__operation != OP_ILOAD_24BGR) { - mga_fifo(1); - mga_outl(M_DWGCTL, OP_ILOAD_24BGR); - __operation = OP_ILOAD_24BGR; - } - - /* draw the bitmap */ - mga_fifo(5); - mga_outl(M_AR0, width-1); - mga_outl(M_AR3, 0); - mga_outl(M_AR5, 0); - mga_outl(M_FXBNDRY, ((left+width-1)<<16) | left); - mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | height); - - /* copy data to the pseudo-dma window */ - i = 0; - width = (width * height * 3 + 3) / 4; - while (width) { - mga_outl(i & (7 * 1024 - 1), *bitmap); - bitmap++; - i += 4; - width--; - } -} - - - -/* Desc: get Z-buffer value - * - * In : - * Out : - * - * Note: - */ -unsigned short mga_getz (int offset) -{ - return hwptr_peekw(mgaptr.linear_map, zorg + (mga_readbuffer_ptr + offset) * 2); -} - - - -/* Desc: put Z-buffer value - * - * In : - * Out : - * - * Note: - */ -void mga_setz (int offset, unsigned short z) -{ - hwptr_pokew(mgaptr.linear_map, zorg + (mga_writebuffer_ptr + offset) * 2, z); -} - - - -/* Desc: clear Z-buffer - * - * In : - * Out : - * - * Note: uses current write buffer - */ -static void _mga_clear_zed (int left, int top, int width, int height, unsigned short z) -{ - if (__bpp == 16) { - /* GPU store (high bandwidth) - * Hack alert: - * can cause problems with concurrent FB accesses - */ - mga_select(); - mga_fifo(1); - mga_outl(M_YDSTORG, mga_writebuffer_ptr + zorg/2); - mga_draw_rect_rgb_flat(left, top, width, height, z); - mga_fifo(1); - mga_outl(M_YDSTORG, mga_writebuffer_ptr); - } else { - /* CPU store */ - unsigned long i, zz = (z<<16) | z; - unsigned long ofs = zorg + (top * __pixwidth + left + mga_writebuffer_ptr) * 2; - hwptr_select(mgaptr.linear_map); - while (height--) { - i = width/2; - while (i--) { - hwptr_nspokel(mgaptr.linear_map, ofs, zz); - ofs += 4; - } - if (width & 1) { - hwptr_nspokew(mgaptr.linear_map, ofs, z); - ofs += 2; - } - ofs += (__pixwidth - width) * 2; - } - } -} - - - -/* Desc: clear color- and Z-buffer - * - * In : front = clear front buffer - * back = clear back buffer - * zed = clear depth buffer - * left = leftmost pixel to be cleared - * top = starting line - * width = number of pixels - * height = number of lines - * color = color to clear to - * z = z value (ignored if zed==0) - * Out : - * - * Note: - */ -void mga_clear (int front, int back, int zed, int left, int top, int width, int height, int color, unsigned short z) -{ - if (front) { - if (mga_writebuffer == MGA_FRONTBUFFER) { - mga_draw_rect_rgb_flat(left, top, width, height, color); - if (zed) { - _mga_clear_zed(left, top, width, height, z); - } - front = 0; - } - } - if (back) { - if (mga_writebuffer == MGA_BACKBUFFER) { - mga_draw_rect_rgb_flat(left, top, width, height, color); - if (zed) { - _mga_clear_zed(left, top, width, height, z); - } - back = 0; - } - } - if (front) { - int old = mga_writebuffer; - mga_set_writebuffer(MGA_FRONTBUFFER); - mga_draw_rect_rgb_flat(left, top, width, height, color); - if (zed) { - _mga_clear_zed(left, top, width, height, z); - } - mga_set_writebuffer(old); - front = 0; - } - if (back) { - int old = mga_writebuffer; - mga_set_writebuffer(MGA_BACKBUFFER); - mga_draw_rect_rgb_flat(left, top, width, height, color); - if (zed) { - _mga_clear_zed(left, top, width, height, z); - } - mga_set_writebuffer(old); - back = 0; - } -} - - - -/* Desc: Attempts to enter specified video mode. - * - * In : ptr to mode structure, number of pages, Z-buffer request, refresh rate - * Out : 0 if success - * - * Note: also set up the accelerator engine - */ -int mga_open (int width, int height, int bpp, int buffers, int zbuffer, int refresh) -{ - static int mill_strides[] = { 640, 768, 800, 960, 1024, 1152, 1280, 1600, 1920, 2048, 0 }; - unsigned int i, used; - MGA_MODE *p; - - if (mga_hw_init(&vram, &interleave, card_name) == 0) { - return -1; - } - - if ((p = mga_mode_find(width, height, bpp)) == NULL) { - return -1; - } - - __bpp = p->bpp; - __width = __pagewidth = p->xres; - __height = p->yres; - - if (buffers > 1) { - __pagewidth = _mga_fix_scans(__pagewidth); - __pixwidth = __pagewidth * buffers; - } else { - __pixwidth = __pagewidth; - __pixwidth = _mga_fix_scans(__pixwidth); - } - - for (i=0; mill_strides[i]; i++) { - if (__pixwidth <= mill_strides[i]) { - __pixwidth = mill_strides[i]; - break; - } - } - - __bypp = (__bpp+7)/8; - __bytwidth = __pixwidth * __bypp; - - /* compute used memory: framebuffer + zbuffer */ - used = __bytwidth * __height; - if (zbuffer) { - zorg = (used + 511) & ~511; - /* Hack alert: - * a 16-bit Z-buffer size is (stride_in_pixels * number_of_lines * 2) - * We cannot mess with the Z-buffer width, but we might decrease the - * number of lines, if the user requests less than (screen_height). For - * example with a 2MB card, one can have 640x480x16 display with 2 color - * buffers and Z-buffer if the maximum requested height is 339: - * Total = (640*480 * 2 + 640*339 * 2) * 2 - * However, this means the user must not write beyond the window's height - * and if we'll ever implement moveable windows, we'll have to reconsider - * this hack. - */ -#if 1 - __zheight = height; /* smaller */ - used = zorg + __pixwidth * 2 * __zheight; -#else - __zheight = __height; - used = zorg + __pixwidth * 2 * __zheight; -#endif - } - - if (mill_strides[i] && (vram>=used)) { - /* enter mode */ - mga_mode_switch(p, refresh); - /* change the scan line length */ - _mga_ralter(M_CRTC_INDEX, 0x14, 0x40, 0); /* disable DWORD */ - _mga_ralter(M_CRTC_INDEX, 0x17, 0x40, 0x40); /* wbmode = BYTE */ - if (interleave) { - _mga_rwrite(M_CRTC_INDEX, 0x13, __bytwidth/16); - _mga_ralter(M_CRTC_EXT_INDEX, 0, 0x30, ((__bytwidth/16)>>4)&0x30); - } else { - _mga_rwrite(M_CRTC_INDEX, 0x13, __bytwidth/8); - _mga_ralter(M_CRTC_EXT_INDEX, 0, 0x30, ((__bytwidth/8)>>4)&0x30); - } - } else { - return -1; - } - - /* setup buffers */ - mga_frontbuffer_ptr = 0; - if (buffers > 1) { - mga_backbuffer_ptr = __pagewidth; - mga_set_readbuffer(MGA_BACKBUFFER); - mga_set_writebuffer(MGA_BACKBUFFER); - } else { - mga_backbuffer_ptr = 0; - mga_set_readbuffer(MGA_FRONTBUFFER); - mga_set_writebuffer(MGA_FRONTBUFFER); - } - mga_display_start(mga_frontbuffer_ptr, __scrollx = 0, __scrolly = 0, 1); - - /* set up the accelerator engine */ - mga_select(); - - mga_fifo(8); - mga_outl(M_PITCH, __pixwidth); - mga_outl(M_PLNWT, 0xFFFFFFFF); - mga_outl(M_OPMODE, M_DMA_BLIT); - mga_outl(M_CXBNDRY, 0xFFFF0000); - mga_outl(M_YTOP, 0x00000000); - mga_outl(M_YBOT, 0x007FFFFF); - mga_outl(M_ZORG, zorg); - -#define INITPTR(bpp) \ - mga_putpixel = _mga_putpixel##bpp; \ - mga_getrgba = _mga_getrgba##bpp; \ - mga_getpixel = _mga_getpixel##bpp; \ - mga_mixrgb = _mga_mixrgb##bpp; \ - mga_mixrgb_full = _mga_mixrgb##bpp##_full - - switch (__bpp) { - case 8: - mga_outl(M_MACCESS, 0); - INITPTR(8); - break; - case 15: - mga_outl(M_MACCESS, 0x80000001); - INITPTR(15); - break; - case 16: - mga_outl(M_MACCESS, 1); - INITPTR(16); - break; - case 32: - mga_outl(M_MACCESS, 2); - INITPTR(32); - break; - } - -#undef INITPTR - - /* disable VGA aperture */ - i = mga_inb(M_MISC_R); - mga_outb(M_MISC_W, i & ~2); - - /* clear Z-buffer (if any) */ - if (zbuffer) { - unsigned long ofs = zorg; - unsigned long len = zorg + __pixwidth * 2 * __zheight; - - hwptr_select(mgaptr.linear_map); - for (; ofs +#include +#include + +#include "../internal.h" +#include "mga_reg.h" +#include "mga_hw.h" +#include "mga_mode.h" +#include "mga.h" + + + +/* cached drawing engine state */ +#define OP_NONE 0 + +#define OP_DRAWRECT (\ + M_DWG_TRAP | /* opcod */ \ + M_DWG_BLK | /* atype */ \ + /* linear */ \ + M_DWG_NOZCMP | /* zmode */ \ + M_DWG_SOLID | /* solid */ \ + M_DWG_ARZERO | /* arzero */ \ + M_DWG_SGNZERO | /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC /* bop */ \ + /* trans */ \ + /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_DRAWRECT_TX32BGR (\ + M_DWG_TEXTURE_TRAP | /* opcod */ \ + M_DWG_I | /* atype */ \ + /* linear */ \ + M_DWG_NOZCMP | /* zmode */ \ + /* solid */ \ + M_DWG_ARZERO | /* arzero */ \ + M_DWG_SGNZERO | /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC | /* bop */ \ + /* trans */ \ + M_DWG_BU32BGR /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_DRAWRECT_TX24BGR (\ + M_DWG_TEXTURE_TRAP | /* opcod */ \ + M_DWG_I | /* atype */ \ + /* linear */ \ + M_DWG_NOZCMP | /* zmode */ \ + /* solid */ \ + M_DWG_ARZERO | /* arzero */ \ + M_DWG_SGNZERO | /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC | /* bop */ \ + /* trans */ \ + M_DWG_BU24BGR /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_DRAWLINE (\ + M_DWG_AUTOLINE_CLOSE | /* opcod */ \ + M_DWG_RPL | /* atype */ \ + /* linear */ \ + M_DWG_NOZCMP | /* zmode */ \ + M_DWG_SOLID | /* solid */ \ + /* arzero */ \ + /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC | /* bop */ \ + /* trans */ \ + M_DWG_BFCOL /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_DRAWLINE_I (\ + M_DWG_AUTOLINE_CLOSE | /* opcod */ \ + M_DWG_I | /* atype */ \ + /* linear */ \ + M_DWG_NOZCMP | /* zmode */ \ + /* solid */ \ + /* arzero */ \ + /* sgnzero */ \ + /* shftzero */ \ + M_DWG_BOP_SRC | /* bop */ \ + /* trans */ \ + M_DWG_BFCOL /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_DRAWLINE_ZI (\ + M_DWG_AUTOLINE_CLOSE | /* opcod */ \ + M_DWG_ZI | /* atype */ \ + /* linear */ \ + M_DWG_ZLT | /* zmode */ \ + /* solid */ \ + /* arzero */ \ + /* sgnzero */ \ + /* shftzero */ \ + M_DWG_BOP_SRC | /* bop */ \ + /* trans */ \ + M_DWG_BFCOL /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_DRAWTRAP (\ + M_DWG_TRAP | /* opcod */ \ + M_DWG_BLK | /* atype */ \ + /* linear */ \ + M_DWG_NOZCMP | /* zmode */ \ + M_DWG_SOLID | /* solid */ \ + /* arzero */ \ + /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC /* bop */ \ + /* trans */ \ + /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_DRAWTRAP_I (\ + M_DWG_TRAP | /* opcod */ \ + M_DWG_I | /* atype */ \ + /* linear */ \ + M_DWG_NOZCMP | /* zmode */ \ + /* solid */ \ + /* arzero */ \ + /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC /* bop */ \ + /* trans */ \ + /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_DRAWTRAP_ZI (\ + M_DWG_TRAP | /* opcod */ \ + M_DWG_ZI | /* atype */ \ + /* linear */ \ + M_DWG_ZLT | /* zmode */ \ + /* solid */ \ + /* arzero */ \ + /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC /* bop */ \ + /* trans */ \ + /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_ILOAD_32BGR (\ + M_DWG_ILOAD | /* opcod */ \ + M_DWG_RPL | /* atype */ \ + /* linear */ \ + /* zmode */ \ + /* solid */ \ + /* arzero */ \ + M_DWG_SGNZERO | /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC | /* bop */ \ + /* trans */ \ + M_DWG_BU32BGR /* bltmod */ \ + /* pattern */ \ + /* transc */ ) +#define OP_ILOAD_24BGR (\ + M_DWG_ILOAD | /* opcod */ \ + M_DWG_RPL | /* atype */ \ + /* linear */ \ + /* zmode */ \ + /* solid */ \ + /* arzero */ \ + M_DWG_SGNZERO | /* sgnzero */ \ + M_DWG_SHFTZERO | /* shftzero */ \ + M_DWG_BOP_SRC | /* bop */ \ + /* trans */ \ + M_DWG_BU24BGR /* bltmod */ \ + /* pattern */ \ + /* transc */ ) + + + +/* internal hardware data structures */ +static int interleave; +static unsigned long zorg; +static unsigned long vram; +static char card_name[80]; + + + +/* some info about current mode */ +static int __bpp, __bypp; +static int __pixwidth, __bytwidth, __pagewidth, __width, __height, __zheight; +static int __operation; +static int __scrollx, __scrolly; + + + +/* buffers */ +static int mga_readbuffer, mga_writebuffer; +static long mga_readbuffer_ptr, mga_writebuffer_ptr; +static long mga_backbuffer_ptr, mga_frontbuffer_ptr; + + + +/* lookup table for scaling 2 bit colors up to 8 bits */ +static int _rgb_scale_2[4] = { + 0, 85, 170, 255 +}; + +/* lookup table for scaling 3 bit colors up to 8 bits */ +static int _rgb_scale_3[8] = { + 0, 36, 73, 109, 146, 182, 219, 255 +}; + +/* lookup table for scaling 5 bit colors up to 8 bits */ +static int _rgb_scale_5[32] = { + 0, 8, 16, 25, 33, 41, 49, 58, + 66, 74, 82, 90, 99, 107, 115, 123, + 132, 140, 148, 156, 165, 173, 181, 189, + 197, 206, 214, 222, 230, 239, 247, 255 +}; + +/* lookup table for scaling 6 bit colors up to 8 bits */ +static int _rgb_scale_6[64] = { + 0, 4, 8, 12, 16, 20, 24, 28, + 32, 36, 40, 45, 49, 53, 57, 61, + 65, 69, 73, 77, 81, 85, 89, 93, + 97, 101, 105, 109, 113, 117, 121, 125, + 130, 134, 138, 142, 146, 150, 154, 158, + 162, 166, 170, 174, 178, 182, 186, 190, + 194, 198, 202, 206, 210, 215, 219, 223, + 227, 231, 235, 239, 243, 247, 251, 255 +}; + + + +/* + * pixel/color routines + */ +void (*mga_putpixel) (unsigned int offset, int color); +int (*mga_getpixel) (unsigned int offset); +void (*mga_getrgba) (unsigned int offset, unsigned char rgba[4]); +int (*mga_mixrgb) (const unsigned char rgb[]); +static int (*mga_mixrgb_full) (const unsigned char rgb[]); + + + +/* mga_fifo: + * Waits until there are at least free slots in the FIFO buffer. + */ +#define mga_fifo(n) do { } while (mga_inb(M_FIFOSTATUS) < (n)) + + + +static int _mga_rread (int port, int index) +{ + mga_select(); + mga_outb(port, index); + return mga_inb(port+1); +} + + + +static void _mga_rwrite (int port, int index, int v) +{ + mga_select(); + mga_outb(port, index); + mga_outb(port+1, v); +} + + + +static void _mga_ralter (int port, int index, int mask, int v) +{ + int temp; + temp = _mga_rread(port, index); + temp &= (~mask); + temp |= (v & mask); + _mga_rwrite(port, index, temp); +} + + + +/* WaitTillIdle: + * Delay until the hardware controller has finished drawing. + */ +void mga_wait_idle (void) +{ + int tries = 2; + + /*hwptr_unselect(oldptr);*/ + + mga_select(); + + while (tries--) { + do { + } while (!(mga_inl(M_FIFOSTATUS) & 0x200)); + + do { + } while (mga_inl(M_STATUS) & 0x10000); + + mga_outb(M_CRTC_INDEX, 0); + } + + /*hwptr_select(oldptr);*/ +} + + + +/* Desc: Waits for the next vertical sync period. + * + * In : + * Out : + * + * Note: + */ +static void _mga_wait_retrace (void) +{ + int t1 = 0; + int t2 = 0; + + do { + t1 = t2; + t2 = mga_inl(M_VCOUNT); + } while (t2 >= t1); +} + + + +/* Desc: fix scan lines + * + * In : + * Out : + * + * Note: + */ +static unsigned long _mga_fix_scans (unsigned long l) +{ + unsigned long m = 0; + + switch (__bpp) { + case 8: + m = interleave?128:64; + break; + case 15: + case 16: + m = interleave?64:32; + break; + case 24: + m = interleave?128:64; + break; + case 32: + m = 32; + break; + } + + m -= 1; + return (l + m) & ~m; +} + + + +/* Desc: HW scrolling function + * + * In : + * Out : + * + * Note: view Z-buffer in 16bit modes: _mga_display_start(0, 0, __height, 1) + */ +void mga_display_start (long boffset, long x, long y, long waitVRT) +{ + long addr; + + mga_select(); + + if (waitVRT >= 0) { + + addr = __bytwidth * y + (boffset + x) * __bypp; + + if (interleave) { + addr /= 8; + } else { + addr /= 4; + } + + _mga_rwrite(M_CRTC_INDEX, 0x0D, (addr)&0xFF); + _mga_rwrite(M_CRTC_INDEX, 0x0C, (addr>>8)&0xFF); + _mga_ralter(M_CRTC_EXT_INDEX, 0, 0x0F, (addr>>16)&0x0F); + + while (waitVRT--) { + _mga_wait_retrace(); + } + } + + __scrollx = x; + __scrolly = y; +} + + + +/* Desc: set READ buffer + * + * In : either FRONT or BACK buffer + * Out : + * + * Note: + */ +void mga_set_readbuffer (int buffer) +{ + mga_readbuffer = buffer; + + mga_readbuffer_ptr = (mga_readbuffer == MGA_FRONTBUFFER) ? mga_frontbuffer_ptr : mga_backbuffer_ptr; +} + + + +/* Desc: set WRITE buffer + * + * In : either FRONT or BACK buffer + * Out : + * + * Note: + */ +void mga_set_writebuffer (int buffer) +{ + mga_writebuffer = buffer; + + mga_writebuffer_ptr = (mga_writebuffer == MGA_FRONTBUFFER) ? mga_frontbuffer_ptr : mga_backbuffer_ptr; + + mga_select(); + mga_fifo(1); + mga_outl(M_YDSTORG, mga_writebuffer_ptr); + + __operation = OP_NONE; +} + + + +/* Desc: swap buffers + * + * In : number of vertical retraces to wait + * Out : + * + * Note: + */ +void mga_swapbuffers (int swapinterval) +{ + /* flip the buffers */ + mga_backbuffer_ptr ^= __pagewidth; + mga_frontbuffer_ptr ^= __pagewidth; + + /* update READ/WRITE pointers */ + mga_set_readbuffer(mga_readbuffer); + mga_set_writebuffer(mga_writebuffer); + + /* make sure we always see the FRONT buffer */ + mga_display_start(mga_frontbuffer_ptr, __scrollx, __scrolly, swapinterval); +} + + + +/* Desc: color composition (w/o ALPHA) + * + * In : array of integers (R, G, B) + * Out : color + * + * Note: - + */ +static __inline int _mga_mixrgb8 (const unsigned char rgb[]) +{ + return (rgb[0]&0xe0)|((rgb[1]>>5)<<2)|(rgb[2]>>6); +} +static __inline int _mga_mixrgb15 (const unsigned char rgb[]) +{ + return ((rgb[0]>>3)<<10)|((rgb[1]>>3)<<5)|(rgb[2]>>3); +} +static __inline int _mga_mixrgb16 (const unsigned char rgb[]) +{ + return ((rgb[0]>>3)<<11)|((rgb[1]>>2)<<5)|(rgb[2]>>3); +} +static __inline int _mga_mixrgb32 (const unsigned char rgb[]) +{ + return (rgb[0]<<16)|(rgb[1]<<8)|(rgb[2]); +} + + + +/* Desc: color composition (w/o ALPHA) + replication + * + * In : array of integers (R, G, B) + * Out : color + * + * Note: - + */ +static int _mga_mixrgb8_full (const unsigned char rgb[]) +{ + int color = _mga_mixrgb8(rgb); + color |= color<<8; + return (color<<16) | color; +} +static int _mga_mixrgb15_full (const unsigned char rgb[]) +{ + int color = _mga_mixrgb15(rgb); + return (color<<16) | color; +} +static int _mga_mixrgb16_full (const unsigned char rgb[]) +{ + int color = _mga_mixrgb16(rgb); + return (color<<16) | color; +} +#define _mga_mixrgb32_full _mga_mixrgb32 + + + +/* Desc: putpixel + * + * In : pixel offset, pixel value + * Out : - + * + * Note: uses current write buffer + */ +static void _mga_putpixel8 (unsigned int offset, int color) +{ + hwptr_pokeb(mgaptr.linear_map, mga_writebuffer_ptr + offset, color); +} +#define _mga_putpixel15 _mga_putpixel16 +static void _mga_putpixel16 (unsigned int offset, int color) +{ + hwptr_pokew(mgaptr.linear_map, (mga_writebuffer_ptr + offset) * 2, color); +} +static void _mga_putpixel32 (unsigned int offset, int color) +{ + hwptr_pokel(mgaptr.linear_map, (mga_writebuffer_ptr + offset) * 4, color); +} + + + +/* Desc: pixel retrieval + * + * In : pixel offset + * Out : pixel value + * + * Note: uses current read buffer + */ +static __inline int _mga_getpixel8 (unsigned int offset) +{ + return hwptr_peekb(mgaptr.linear_map, mga_readbuffer_ptr + offset); +} +#define _mga_getpixel15 _mga_getpixel16 +static __inline int _mga_getpixel16 (unsigned int offset) +{ + return hwptr_peekw(mgaptr.linear_map, (mga_readbuffer_ptr + offset) * 2); +} +static __inline int _mga_getpixel32 (unsigned int offset) +{ + return hwptr_peekl(mgaptr.linear_map, (mga_readbuffer_ptr + offset) * 4); +} + + + +/* Desc: color decomposition + * + * In : pixel offset, array of integers to hold color components (R, G, B, A) + * Out : - + * + * Note: uses current read buffer + */ +static void _mga_getrgba8 (unsigned int offset, unsigned char rgba[4]) +{ + int c = _mga_getpixel8(offset); + rgba[0] = _rgb_scale_3[(c >> 5) & 0x7]; + rgba[1] = _rgb_scale_3[(c >> 2) & 0x7]; + rgba[2] = _rgb_scale_2[c & 0x3]; + rgba[3] = 255; +} +static void _mga_getrgba15 (unsigned int offset, unsigned char rgba[4]) +{ + int c = _mga_getpixel15(offset); + rgba[0] = _rgb_scale_5[(c >> 10) & 0x1F]; + rgba[1] = _rgb_scale_5[(c >> 5) & 0x1F]; + rgba[2] = _rgb_scale_5[c & 0x1F]; + rgba[3] = 255; +} +static void _mga_getrgba16 (unsigned int offset, unsigned char rgba[4]) +{ + int c = _mga_getpixel16(offset); + rgba[0] = _rgb_scale_5[(c >> 11) & 0x1F]; + rgba[1] = _rgb_scale_6[(c >> 5) & 0x3F]; + rgba[2] = _rgb_scale_5[c & 0x1F]; + rgba[3] = 255; +} +static void _mga_getrgba32 (unsigned int offset, unsigned char rgba[4]) +{ + int c = _mga_getpixel32(offset); + rgba[0] = c >> 16; + rgba[1] = c >> 8; + rgba[2] = c; + rgba[3] = c >> 24; +} + + + +/* Desc: RGB flat line + * + * In : + * Out : + * + * Note: + */ +void mga_draw_line_rgb_flat (const MGAvertex *v1, const MGAvertex *v2) +{ + unsigned long color; + int x1 = v1->win[0]; + int y1 = v1->win[1]; + int x2 = v2->win[0]; + int y2 = v2->win[1]; + + if ((x1 == x2) && (y1 == y2)) { + return; + } + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWLINE) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWLINE); + __operation = OP_DRAWLINE; + } + + color = mga_mixrgb_full(v2->color); + + /* draw the line */ + mga_fifo(3); + mga_outl(M_FCOL, color); + mga_outl(M_XYSTRT, (y1<<16) | x1); + mga_outl(M_XYEND | M_EXEC, (y2<<16) | x2); +} + + + +/* Desc: RGB flat Z-less line + * + * In : + * Out : + * + * Note: I never figured out "diagonal increments" + */ +void mga_draw_line_rgb_flat_zless (const MGAvertex *v1, const MGAvertex *v2) +{ + int z1, dz; + int x1 = v1->win[0]; + int y1 = v1->win[1]; + int x2 = v2->win[0]; + int y2 = v2->win[1]; + int dx = abs(x2 - x1); + int dy = abs(y2 - y1); + + if ((dx == 0) && (dy == 0)) { + return; + } + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWLINE_ZI) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWLINE_ZI); + __operation = OP_DRAWLINE_ZI; + } + + if (dx < dy) { + dx = dy; + } + + z1 = v1->win[2] << 15; + dz = ((v2->win[2] << 15) - z1) / dx; + + /* draw the line */ + mga_fifo(14); + mga_outl(M_DR0, z1); + mga_outl(M_DR2, dz); + mga_outl(M_DR3, dz); + mga_outl(M_DR4, v2->color[0] << 15); + mga_outl(M_DR6, 0); + mga_outl(M_DR7, 0); + mga_outl(M_DR8, v2->color[1] << 15); + mga_outl(M_DR10, 0); + mga_outl(M_DR11, 0); + mga_outl(M_DR12, v2->color[2] << 15); + mga_outl(M_DR14, 0); + mga_outl(M_DR15, 0); + mga_outl(M_XYSTRT, (y1<<16) | x1); + mga_outl(M_XYEND | M_EXEC, (y2<<16) | x2); +} + + + +/* Desc: RGB iterated line + * + * In : + * Out : + * + * Note: I never figured out "diagonal increments" + */ +void mga_draw_line_rgb_iter (const MGAvertex *v1, const MGAvertex *v2) +{ + int r1, g1, b1; + int dr, dg, db; + int x1 = v1->win[0]; + int y1 = v1->win[1]; + int x2 = v2->win[0]; + int y2 = v2->win[1]; + int dx = abs(x2 - x1); + int dy = abs(y2 - y1); + + if ((dx == 0) && (dy == 0)) { + return; + } + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWLINE_I) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWLINE_I); + __operation = OP_DRAWLINE_I; + } + + if (dx < dy) { + dx = dy; + } + + r1 = v1->color[0] << 15; + g1 = v1->color[1] << 15; + b1 = v1->color[2] << 15; + dr = ((v2->color[0] << 15) - r1) / dx; + dg = ((v2->color[1] << 15) - g1) / dx; + db = ((v2->color[2] << 15) - b1) / dx; + + /* draw the line */ + mga_fifo(11); + mga_outl(M_DR4, r1); + mga_outl(M_DR6, dr); + mga_outl(M_DR7, dr); + mga_outl(M_DR8, g1); + mga_outl(M_DR10, dg); + mga_outl(M_DR11, dg); + mga_outl(M_DR12, b1); + mga_outl(M_DR14, db); + mga_outl(M_DR15, db); + mga_outl(M_XYSTRT, (y1<<16) | x1); + mga_outl(M_XYEND | M_EXEC, (y2<<16) | x2); +} + + + +/* Desc: RGB iterated Z-less line + * + * In : + * Out : + * + * Note: I never figured out "diagonal increments" + */ +void mga_draw_line_rgb_iter_zless (const MGAvertex *v1, const MGAvertex *v2) +{ + int z1, dz; + int r1, g1, b1; + int dr, dg, db; + int x1 = v1->win[0]; + int y1 = v1->win[1]; + int x2 = v2->win[0]; + int y2 = v2->win[1]; + int dx = abs(x2 - x1); + int dy = abs(y2 - y1); + + if ((dx == 0) && (dy == 0)) { + return; + } + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWLINE_ZI) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWLINE_ZI); + __operation = OP_DRAWLINE_ZI; + } + + if (dx < dy) { + dx = dy; + } + + z1 = v1->win[2] << 15; + dz = ((v2->win[2] << 15) - z1) / dx; + + r1 = v1->color[0] << 15; + g1 = v1->color[1] << 15; + b1 = v1->color[2] << 15; + dr = ((v2->color[0] << 15) - r1) / dx; + dg = ((v2->color[1] << 15) - g1) / dx; + db = ((v2->color[2] << 15) - b1) / dx; + + /* draw the line */ + mga_fifo(14); + mga_outl(M_DR0, z1); + mga_outl(M_DR2, dz); + mga_outl(M_DR3, dz); + mga_outl(M_DR4, r1); + mga_outl(M_DR6, dr); + mga_outl(M_DR7, dr); + mga_outl(M_DR8, g1); + mga_outl(M_DR10, dg); + mga_outl(M_DR11, dg); + mga_outl(M_DR12, b1); + mga_outl(M_DR14, db); + mga_outl(M_DR15, db); + mga_outl(M_XYSTRT, (y1<<16) | x1); + mga_outl(M_XYEND | M_EXEC, (y2<<16) | x2); +} + + + +/* Desc: RGB flat triangle + * + * In : + * Out : + * + * Note: + */ +#define TAG mga_draw_tri_rgb_flat +#define CULL +#define SETUP_CODE \ + if (__operation != OP_DRAWTRAP) { \ + mga_fifo(1); \ + mga_outl(M_DWGCTL, OP_DRAWTRAP); \ + __operation = OP_DRAWTRAP; \ + } +#include "m_ttemp.h" + + + +/* Desc: RGB flat Z-less triangle + * + * In : + * Out : + * + * Note: + */ +#define TAG mga_draw_tri_rgb_flat_zless +#define CULL +#define INTERP_Z +#define SETUP_CODE \ + if (__operation != OP_DRAWTRAP_ZI) { \ + mga_fifo(1); \ + mga_outl(M_DWGCTL, OP_DRAWTRAP_ZI); \ + __operation = OP_DRAWTRAP_ZI; \ + } +#include "m_ttemp.h" + + + +/* Desc: RGB iterated triangle + * + * In : + * Out : + * + * Note: + */ +#define TAG mga_draw_tri_rgb_iter +#define CULL +#define INTERP_RGB +#define SETUP_CODE \ + if (__operation != OP_DRAWTRAP_I) { \ + mga_fifo(1); \ + mga_outl(M_DWGCTL, OP_DRAWTRAP_I); \ + __operation = OP_DRAWTRAP_I; \ + } +#include "m_ttemp.h" + + + +/* Desc: RGB iterated Z-less triangle + * + * In : + * Out : + * + * Note: + */ +#define TAG mga_draw_tri_rgb_iter_zless +#define CULL +#define INTERP_Z +#define INTERP_RGB +#define SETUP_CODE \ + if (__operation != OP_DRAWTRAP_ZI) { \ + mga_fifo(1); \ + mga_outl(M_DWGCTL, OP_DRAWTRAP_ZI); \ + __operation = OP_DRAWTRAP_ZI; \ + } +#include "m_ttemp.h" + + + +/* Desc: RGB flat rectangle + * + * In : + * Out : + * + * Note: + */ +void mga_draw_rect_rgb_flat (int left, int top, int width, int height, int color) +{ + if (__bpp == 8) { + color |= color << 8; + } + if (__bpp <= 16) { + color |= color << 16; + } + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWRECT) { + + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWRECT); + __operation = OP_DRAWRECT; + } + + /* draw the rectangle */ + mga_fifo(3); + mga_outl(M_FCOL, color); + mga_outl(M_FXBNDRY, ((left+width)<<16) | left); + mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | height); +} + + + +/* Desc: 32RGB textured span + * + * In : + * Out : + * + * Note: 0 <= width <= 7*1024 + */ +void mga_draw_span_rgb_tx32 (int left, int top, int width, const unsigned long *bitmap) +{ + int i; + + if (!width) { + return; + } + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWRECT_TX32BGR) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWRECT_TX32BGR); + __operation = OP_DRAWRECT_TX32BGR; + } + + /* draw the rectangle */ + mga_fifo(2); + mga_outl(M_FXBNDRY, ((left+width)<<16) | left); + mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | 1); + + /* copy data to the pseudo-dma window */ + i = 0; + do { + mga_outl(i, *bitmap); + bitmap++; + i += 4; + } while (--width); +} + + + +/* Desc: 24RGB textured span + * + * In : + * Out : + * + * Note: 0 <= width <= 7*1024 + */ +void mga_draw_span_rgb_tx24 (int left, int top, int width, const unsigned long *bitmap) +{ + int i; + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWRECT_TX24BGR) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWRECT_TX24BGR); + __operation = OP_DRAWRECT_TX24BGR; + } + + /* draw the rectangle */ + mga_fifo(2); + mga_outl(M_FXBNDRY, ((left+width)<<16) | left); + mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | 1); + + /* copy data to the pseudo-dma window */ + i = 0; + width = (width * 3 + 3) / 4; + while (width) { + mga_outl(i & (7 * 1024 - 1), *bitmap); + bitmap++; + i += 4; + width--; + } +} + + + +/* Desc: 32RGB textured rectangle + * + * In : + * Out : + * + * Note: + */ +void mga_draw_rect_rgb_tx32 (int left, int top, int width, int height, const unsigned long *bitmap) +{ + int i; + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWRECT_TX32BGR) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWRECT_TX32BGR); + __operation = OP_DRAWRECT_TX32BGR; + } + + /* draw the rectangle */ + mga_fifo(2); + mga_outl(M_FXBNDRY, ((left+width)<<16) | left); + mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | height); + + /* copy data to the pseudo-dma window */ + i = 0; + width *= height; + while (width) { + mga_outl(i & (7 * 1024 - 1), *bitmap); + bitmap++; + i += 4; + width--; + } +} + + + +/* Desc: 24RGB textured rectangle + * + * In : + * Out : + * + * Note: + */ +void mga_draw_rect_rgb_tx24 (int left, int top, int width, int height, const unsigned long *bitmap) +{ + int i; + + mga_select(); + + /* set engine state */ + if (__operation != OP_DRAWRECT_TX24BGR) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_DRAWRECT_TX24BGR); + __operation = OP_DRAWRECT_TX24BGR; + } + + /* draw the rectangle */ + mga_fifo(2); + mga_outl(M_FXBNDRY, ((left+width)<<16) | left); + mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | height); + + /* copy data to the pseudo-dma window */ + i = 0; + width = (width * height * 3 + 3) / 4; + while (width) { + mga_outl(i & (7 * 1024 - 1), *bitmap); + bitmap++; + i += 4; + width--; + } +} + + + +/* Desc: copy 32RGB image to screen + * + * In : + * Out : + * + * Note: + */ +void mga_iload_32RGB (int left, int top, int width, int height, const unsigned long *bitmap) +{ + int i; + + mga_select(); + + /* set engine state */ + if (__operation != OP_ILOAD_32BGR) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_ILOAD_32BGR); + __operation = OP_ILOAD_32BGR; + } + + /* draw the bitmap */ + mga_fifo(5); + mga_outl(M_AR0, width-1); + mga_outl(M_AR3, 0); + mga_outl(M_AR5, 0); + mga_outl(M_FXBNDRY, ((left+width-1)<<16) | left); + mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | height); + + /* copy data to the pseudo-dma window */ + i = 0; + width *= height; + while (width) { + mga_outl(i & (7 * 1024 - 1), *bitmap); + bitmap++; + i += 4; + width--; + } +} + + + +/* Desc: copy 24RGB image to screen + * + * In : + * Out : + * + * Note: + */ +void mga_iload_24RGB (int left, int top, int width, int height, const unsigned long *bitmap) +{ + int i; + + mga_select(); + + /* set engine state */ + if (__operation != OP_ILOAD_24BGR) { + mga_fifo(1); + mga_outl(M_DWGCTL, OP_ILOAD_24BGR); + __operation = OP_ILOAD_24BGR; + } + + /* draw the bitmap */ + mga_fifo(5); + mga_outl(M_AR0, width-1); + mga_outl(M_AR3, 0); + mga_outl(M_AR5, 0); + mga_outl(M_FXBNDRY, ((left+width-1)<<16) | left); + mga_outl(M_YDSTLEN | M_EXEC, (top<<16) | height); + + /* copy data to the pseudo-dma window */ + i = 0; + width = (width * height * 3 + 3) / 4; + while (width) { + mga_outl(i & (7 * 1024 - 1), *bitmap); + bitmap++; + i += 4; + width--; + } +} + + + +/* Desc: get Z-buffer value + * + * In : + * Out : + * + * Note: + */ +unsigned short mga_getz (int offset) +{ + return hwptr_peekw(mgaptr.linear_map, zorg + (mga_readbuffer_ptr + offset) * 2); +} + + + +/* Desc: put Z-buffer value + * + * In : + * Out : + * + * Note: + */ +void mga_setz (int offset, unsigned short z) +{ + hwptr_pokew(mgaptr.linear_map, zorg + (mga_writebuffer_ptr + offset) * 2, z); +} + + + +/* Desc: clear Z-buffer + * + * In : + * Out : + * + * Note: uses current write buffer + */ +static void _mga_clear_zed (int left, int top, int width, int height, unsigned short z) +{ + if (__bpp == 16) { + /* GPU store (high bandwidth) + * Hack alert: + * can cause problems with concurrent FB accesses + */ + mga_select(); + mga_fifo(1); + mga_outl(M_YDSTORG, mga_writebuffer_ptr + zorg/2); + mga_draw_rect_rgb_flat(left, top, width, height, z); + mga_fifo(1); + mga_outl(M_YDSTORG, mga_writebuffer_ptr); + } else { + /* CPU store */ + unsigned long i, zz = (z<<16) | z; + unsigned long ofs = zorg + (top * __pixwidth + left + mga_writebuffer_ptr) * 2; + hwptr_select(mgaptr.linear_map); + while (height--) { + i = width/2; + while (i--) { + hwptr_nspokel(mgaptr.linear_map, ofs, zz); + ofs += 4; + } + if (width & 1) { + hwptr_nspokew(mgaptr.linear_map, ofs, z); + ofs += 2; + } + ofs += (__pixwidth - width) * 2; + } + } +} + + + +/* Desc: clear color- and Z-buffer + * + * In : front = clear front buffer + * back = clear back buffer + * zed = clear depth buffer + * left = leftmost pixel to be cleared + * top = starting line + * width = number of pixels + * height = number of lines + * color = color to clear to + * z = z value (ignored if zed==0) + * Out : + * + * Note: + */ +void mga_clear (int front, int back, int zed, int left, int top, int width, int height, int color, unsigned short z) +{ + if (front) { + if (mga_writebuffer == MGA_FRONTBUFFER) { + mga_draw_rect_rgb_flat(left, top, width, height, color); + if (zed) { + _mga_clear_zed(left, top, width, height, z); + } + front = 0; + } + } + if (back) { + if (mga_writebuffer == MGA_BACKBUFFER) { + mga_draw_rect_rgb_flat(left, top, width, height, color); + if (zed) { + _mga_clear_zed(left, top, width, height, z); + } + back = 0; + } + } + if (front) { + int old = mga_writebuffer; + mga_set_writebuffer(MGA_FRONTBUFFER); + mga_draw_rect_rgb_flat(left, top, width, height, color); + if (zed) { + _mga_clear_zed(left, top, width, height, z); + } + mga_set_writebuffer(old); + front = 0; + } + if (back) { + int old = mga_writebuffer; + mga_set_writebuffer(MGA_BACKBUFFER); + mga_draw_rect_rgb_flat(left, top, width, height, color); + if (zed) { + _mga_clear_zed(left, top, width, height, z); + } + mga_set_writebuffer(old); + back = 0; + } +} + + + +/* Desc: Attempts to enter specified video mode. + * + * In : ptr to mode structure, number of pages, Z-buffer request, refresh rate + * Out : 0 if success + * + * Note: also set up the accelerator engine + */ +int mga_open (int width, int height, int bpp, int buffers, int zbuffer, int refresh) +{ + static int mill_strides[] = { 640, 768, 800, 960, 1024, 1152, 1280, 1600, 1920, 2048, 0 }; + unsigned int i, used; + MGA_MODE *p; + + if (mga_hw_init(&vram, &interleave, card_name) == 0) { + return -1; + } + + if ((p = mga_mode_find(width, height, bpp)) == NULL) { + return -1; + } + + __bpp = p->bpp; + __width = __pagewidth = p->xres; + __height = p->yres; + + if (buffers > 1) { + __pagewidth = _mga_fix_scans(__pagewidth); + __pixwidth = __pagewidth * buffers; + } else { + __pixwidth = __pagewidth; + __pixwidth = _mga_fix_scans(__pixwidth); + } + + for (i=0; mill_strides[i]; i++) { + if (__pixwidth <= mill_strides[i]) { + __pixwidth = mill_strides[i]; + break; + } + } + + __bypp = (__bpp+7)/8; + __bytwidth = __pixwidth * __bypp; + + /* compute used memory: framebuffer + zbuffer */ + used = __bytwidth * __height; + if (zbuffer) { + zorg = (used + 511) & ~511; + /* Hack alert: + * a 16-bit Z-buffer size is (stride_in_pixels * number_of_lines * 2) + * We cannot mess with the Z-buffer width, but we might decrease the + * number of lines, if the user requests less than (screen_height). For + * example with a 2MB card, one can have 640x480x16 display with 2 color + * buffers and Z-buffer if the maximum requested height is 339: + * Total = (640*480 * 2 + 640*339 * 2) * 2 + * However, this means the user must not write beyond the window's height + * and if we'll ever implement moveable windows, we'll have to reconsider + * this hack. + */ +#if 1 + __zheight = height; /* smaller */ + used = zorg + __pixwidth * 2 * __zheight; +#else + __zheight = __height; + used = zorg + __pixwidth * 2 * __zheight; +#endif + } + + if (mill_strides[i] && (vram>=used)) { + /* enter mode */ + mga_mode_switch(p, refresh); + /* change the scan line length */ + _mga_ralter(M_CRTC_INDEX, 0x14, 0x40, 0); /* disable DWORD */ + _mga_ralter(M_CRTC_INDEX, 0x17, 0x40, 0x40); /* wbmode = BYTE */ + if (interleave) { + _mga_rwrite(M_CRTC_INDEX, 0x13, __bytwidth/16); + _mga_ralter(M_CRTC_EXT_INDEX, 0, 0x30, ((__bytwidth/16)>>4)&0x30); + } else { + _mga_rwrite(M_CRTC_INDEX, 0x13, __bytwidth/8); + _mga_ralter(M_CRTC_EXT_INDEX, 0, 0x30, ((__bytwidth/8)>>4)&0x30); + } + } else { + return -1; + } + + /* setup buffers */ + mga_frontbuffer_ptr = 0; + if (buffers > 1) { + mga_backbuffer_ptr = __pagewidth; + mga_set_readbuffer(MGA_BACKBUFFER); + mga_set_writebuffer(MGA_BACKBUFFER); + } else { + mga_backbuffer_ptr = 0; + mga_set_readbuffer(MGA_FRONTBUFFER); + mga_set_writebuffer(MGA_FRONTBUFFER); + } + mga_display_start(mga_frontbuffer_ptr, __scrollx = 0, __scrolly = 0, 1); + + /* set up the accelerator engine */ + mga_select(); + + mga_fifo(8); + mga_outl(M_PITCH, __pixwidth); + mga_outl(M_PLNWT, 0xFFFFFFFF); + mga_outl(M_OPMODE, M_DMA_BLIT); + mga_outl(M_CXBNDRY, 0xFFFF0000); + mga_outl(M_YTOP, 0x00000000); + mga_outl(M_YBOT, 0x007FFFFF); + mga_outl(M_ZORG, zorg); + +#define INITPTR(bpp) \ + mga_putpixel = _mga_putpixel##bpp; \ + mga_getrgba = _mga_getrgba##bpp; \ + mga_getpixel = _mga_getpixel##bpp; \ + mga_mixrgb = _mga_mixrgb##bpp; \ + mga_mixrgb_full = _mga_mixrgb##bpp##_full + + switch (__bpp) { + case 8: + mga_outl(M_MACCESS, 0); + INITPTR(8); + break; + case 15: + mga_outl(M_MACCESS, 0x80000001); + INITPTR(15); + break; + case 16: + mga_outl(M_MACCESS, 1); + INITPTR(16); + break; + case 32: + mga_outl(M_MACCESS, 2); + INITPTR(32); + break; + } + +#undef INITPTR + + /* disable VGA aperture */ + i = mga_inb(M_MISC_R); + mga_outb(M_MISC_W, i & ~2); + + /* clear Z-buffer (if any) */ + if (zbuffer) { + unsigned long ofs = zorg; + unsigned long len = zorg + __pixwidth * 2 * __zheight; + + hwptr_select(mgaptr.linear_map); + for (; ofs -#include -#include -#include -#include -#include - -#include "../internal.h" -#include "mga_reg.h" -#include "mga_hw.h" - - - -/* Hack alert: - * these should really be externs - */ -/* PCI access routines */ -static int pci_find_device (int deviceID, int vendorID, int deviceIndex, int *handle); -static unsigned long pci_read_long (int handle, int index); -static void pci_write_long (int handle, int index, unsigned long value); - - - -/* PCI device identifiers */ -#define MATROX_VENDOR_ID 0x102B - -typedef enum { - MATROX_MILL_ID = 0x0519 -} MATROX_ID; - -static MATROX_ID matrox_id_list[] = { - MATROX_MILL_ID, - 0 -}; - - - -/* internal hardware data structures */ -#if !MGA_FARPTR -static int dirty; -#endif -static int bus_id; -static unsigned long reg40; -static unsigned long io_mem_base[4], linear_base; -static unsigned long io_mem_size[4], linear_size; -static MATROX_ID matrox_id; - - - -/* interface structures containing hardware pointer data */ -MGA_HWPTR mgaptr; - - - -/* Desc: create MMAP - * - * In : - * Out : - * - * Note: - */ -static int _create_mmap (__dpmi_paddr *m, unsigned long base, unsigned long size) -{ -#if MGA_FARPTR - int sel; - if (_create_selector(&sel, base, size)) { - return -1; - } - m->selector = sel; - m->offset32 = 0; -#else - m->selector = _my_ds(); - if (_create_linear_mapping(&m->offset32, base, size)) { - return -1; - } - m->offset32 -= __djgpp_base_address; -#endif - return 0; -} - - - -/* Desc: destroy MMAP - * - * In : - * Out : - * - * Note: - */ -static void _destroy_mmap (__dpmi_paddr *m) -{ -#if MGA_FARPTR - int sel = m->selector; - _remove_selector(&sel); -#else - m->offset32 += __djgpp_base_address; - _remove_linear_mapping(&m->offset32); -#endif - m->selector = 0; - m->offset32 = 0; -} - - - -/* Desc: Counts amount of installed RAM - * - * In : - * Out : - * - * Note: - */ -static int _mga_get_vram (MATROX_ID chip, unsigned long base) -{ - int ProbeSize = 8; - int SizeFound = 2; - unsigned char tmp; - int i; - __dpmi_paddr fb; - - switch (chip) { - case MATROX_MILL_ID: - ProbeSize = 8; - break; - } - - if (_create_mmap(&fb, base, ProbeSize*1024*1024)) { - return 0; - } - - /* turn MGA mode on - enable linear frame buffer (CRTCEXT3) */ - mga_select(); - mga_outb(M_CRTC_EXT_INDEX, 3); - tmp = mga_inb(M_CRTC_EXT_DATA); - mga_outb(M_CRTC_EXT_DATA, tmp | M_MGAMODE); - - /* write, read and compare method */ - for (i=ProbeSize; i>2; i-= 2) { - hwptr_pokeb(fb, i*1024*1024 - 1, 0xAA); - mga_select(); - mga_outb(M_CRTC_INDEX, 0); /* flush the cache */ - mga_inl(M_STATUS); /* delay */ - mga_inl(M_STATUS); /* delay */ - mga_inl(M_STATUS); /* delay */ - if (hwptr_peekb(fb, i*1024*1024 - 1) == 0xAA) { - SizeFound = i; - break; - } - } - - /* restore CRTCEXT3 state */ - mga_select(); - mga_outb(M_CRTC_EXT_INDEX, 3); - mga_outb(M_CRTC_EXT_DATA, tmp); - - _destroy_mmap(&fb); - - return SizeFound*1024*1024; -} - - - -/* Desc: Frees all resources allocated by MGA init code. - * - * In : - * Out : - * - * Note: - */ -void mga_hw_fini (void) -{ - int i; - - pci_write_long(bus_id, 0x40, reg40); - - for (i=0; i<4; i++) { - _destroy_mmap(&mgaptr.io_mem_map[i]); - } - - _destroy_mmap(&mgaptr.linear_map); - -#if !MGA_FARPTR - if (dirty) { - __djgpp_nearptr_disable(); - dirty = FALSE; - } -#endif - - matrox_id = 0; -} - - - -/* Desc: Attempts to detect MGA. - * - * In : - * Out : - * - * Note: The first thing ever to be called. This is in charge of filling in - * the driver header with all the required information and function - * pointers. We do not yet have access to the video memory, so we can't - * talk directly to the card. - */ -int mga_hw_init (unsigned long *vram, int *interleave, char *name) -{ - int i; - unsigned long pci_base[2]; - - if (matrox_id) { - return matrox_id; - } - -#if !MGA_FARPTR - /* enable nearptr access */ - if (_crt0_startup_flags & _CRT0_FLAG_NEARPTR) { - dirty = FALSE; - } else { - if (__djgpp_nearptr_enable() == 0) - return NULL; - - dirty = TRUE; - } -#endif - - /* find PCI device */ - matrox_id = 0; - - for (bus_id=0, i=0; matrox_id_list[i]; i++) { - if (pci_find_device(matrox_id_list[i], MATROX_VENDOR_ID, 0, &bus_id)) { - matrox_id = matrox_id_list[i]; - break; - } - } - - /* set up the card name */ - switch (matrox_id) { - case MATROX_MILL_ID: - if (name) strcpy(name, "Millennium"); - break; - default: - matrox_id = 0; - return -1; - } - - reg40 = pci_read_long(bus_id, 0x40); -#if 0 /* overclock a little :) */ - { - int rfhcnt = (reg40 >> 16) & 0xF; - if ((reg40 & 0x200000) && (rfhcnt < 0xC)) { - pci_write_long(bus_id, 0x40, (reg40 & 0xFFF0FFFF) | 0x000C0000); - } - } -#endif - - /* read hardware configuration data */ - for (i=0; i<2; i++) - pci_base[i] = pci_read_long(bus_id, 16+i*4); - - /* work out the linear framebuffer and MMIO addresses */ - if (matrox_id == MATROX_MILL_ID) { - if (pci_base[0]) - io_mem_base[0] = pci_base[0] & 0xFFFFC000; - - if (pci_base[1]) - linear_base = pci_base[1] & 0xFF800000; - } - - if (!linear_base || !io_mem_base[0]) - return NULL; - - /* deal with the memory mapping crap */ - io_mem_size[0] = 0x4000; - - for (i=0; i<4; i++) { - if (io_mem_base[i]) { - if (_create_mmap(&mgaptr.io_mem_map[i], io_mem_base[i], io_mem_size[i])) { - mga_hw_fini(); - return NULL; - } - } - } - - *vram = linear_size = _mga_get_vram(matrox_id, linear_base); - - if (_create_mmap(&mgaptr.linear_map, linear_base, linear_size)) { - mga_hw_fini(); - return NULL; - } - - /* fill in user data */ - *interleave = linear_size > 2*1024*1024; - - return matrox_id; -} - - - -/* PCI routines added by SET */ -#define PCIAddr 0xCF8 -#define PCIData 0xCFC -#define PCIEnable 0x80000000 - - - -/* FindPCIDevice: - * Replacement for the INT 1A - PCI BIOS v2.0c+ - FIND PCI DEVICE, AX = B102h - * - * Note: deviceIndex is because a card can hold more than one PCI chip. - * - * Searches the board of the vendor supplied in vendorID with - * identification number deviceID and index deviceIndex (normally 0). - * The value returned in handle can be used to access the PCI registers - * of this board. - * - * Return: 1 if found 0 if not found. - */ -static int pci_find_device (int deviceID, int vendorID, int deviceIndex, int *handle) -{ - int model, vendor, card, device; - unsigned value, full_id, bus, busMax; - - deviceIndex <<= 8; - - /* for each PCI bus */ - for (bus=0, busMax=0x10000; bus> 16; - - if (vendor != 0xFFFF) { - /* is this the one we want? */ - if ((deviceID == model) && (vendorID == vendor)) { - *handle = value; - return 1; - } - - /* is it a bridge to a secondary bus? */ - outportl(PCIAddr, value | 8); - - if (((inportl(PCIData) >> 16) == 0x0600) || (full_id==0x00011011)) - busMax += 0x10000; - } - } - } - - return 0; -} - - - -/* Desc: - * - * In : - * Out : - * - * Note: - */ -static unsigned long pci_read_long (int handle, int index) -{ - outportl(PCIAddr, PCIEnable | handle | index); - return inportl(PCIData); -} - - - -/* Desc: - * - * In : - * Out : - * - * Note: - */ -static void pci_write_long (int handle, int index, unsigned long value) -{ - outportl(PCIAddr, PCIEnable | handle | index); - outportl(PCIData, value); -} +/* + * Mesa 3-D graphics library + * Version: 5.0 + * + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.4 for Mesa -- MGA2064W HW mapping + * + * Copyright (c) 2003 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include +#include +#include +#include +#include +#include + +#include "../internal.h" +#include "mga_reg.h" +#include "mga_hw.h" + + + +/* Hack alert: + * these should really be externs + */ +/* PCI access routines */ +static int pci_find_device (int deviceID, int vendorID, int deviceIndex, int *handle); +static unsigned long pci_read_long (int handle, int index); +static void pci_write_long (int handle, int index, unsigned long value); + + + +/* PCI device identifiers */ +#define MATROX_VENDOR_ID 0x102B + +typedef enum { + MATROX_MILL_ID = 0x0519 +} MATROX_ID; + +static MATROX_ID matrox_id_list[] = { + MATROX_MILL_ID, + 0 +}; + + + +/* internal hardware data structures */ +#if !MGA_FARPTR +static int dirty; +#endif +static int bus_id; +static unsigned long reg40; +static unsigned long io_mem_base[4], linear_base; +static unsigned long io_mem_size[4], linear_size; +static MATROX_ID matrox_id; + + + +/* interface structures containing hardware pointer data */ +MGA_HWPTR mgaptr; + + + +/* Desc: create MMAP + * + * In : + * Out : + * + * Note: + */ +static int _create_mmap (__dpmi_paddr *m, unsigned long base, unsigned long size) +{ +#if MGA_FARPTR + int sel; + if (_create_selector(&sel, base, size)) { + return -1; + } + m->selector = sel; + m->offset32 = 0; +#else + m->selector = _my_ds(); + if (_create_linear_mapping(&m->offset32, base, size)) { + return -1; + } + m->offset32 -= __djgpp_base_address; +#endif + return 0; +} + + + +/* Desc: destroy MMAP + * + * In : + * Out : + * + * Note: + */ +static void _destroy_mmap (__dpmi_paddr *m) +{ +#if MGA_FARPTR + int sel = m->selector; + _remove_selector(&sel); +#else + m->offset32 += __djgpp_base_address; + _remove_linear_mapping(&m->offset32); +#endif + m->selector = 0; + m->offset32 = 0; +} + + + +/* Desc: Counts amount of installed RAM + * + * In : + * Out : + * + * Note: + */ +static int _mga_get_vram (MATROX_ID chip, unsigned long base) +{ + int ProbeSize = 8; + int SizeFound = 2; + unsigned char tmp; + int i; + __dpmi_paddr fb; + + switch (chip) { + case MATROX_MILL_ID: + ProbeSize = 8; + break; + } + + if (_create_mmap(&fb, base, ProbeSize*1024*1024)) { + return 0; + } + + /* turn MGA mode on - enable linear frame buffer (CRTCEXT3) */ + mga_select(); + mga_outb(M_CRTC_EXT_INDEX, 3); + tmp = mga_inb(M_CRTC_EXT_DATA); + mga_outb(M_CRTC_EXT_DATA, tmp | M_MGAMODE); + + /* write, read and compare method */ + for (i=ProbeSize; i>2; i-= 2) { + hwptr_pokeb(fb, i*1024*1024 - 1, 0xAA); + mga_select(); + mga_outb(M_CRTC_INDEX, 0); /* flush the cache */ + mga_inl(M_STATUS); /* delay */ + mga_inl(M_STATUS); /* delay */ + mga_inl(M_STATUS); /* delay */ + if (hwptr_peekb(fb, i*1024*1024 - 1) == 0xAA) { + SizeFound = i; + break; + } + } + + /* restore CRTCEXT3 state */ + mga_select(); + mga_outb(M_CRTC_EXT_INDEX, 3); + mga_outb(M_CRTC_EXT_DATA, tmp); + + _destroy_mmap(&fb); + + return SizeFound*1024*1024; +} + + + +/* Desc: Frees all resources allocated by MGA init code. + * + * In : + * Out : + * + * Note: + */ +void mga_hw_fini (void) +{ + int i; + + pci_write_long(bus_id, 0x40, reg40); + + for (i=0; i<4; i++) { + _destroy_mmap(&mgaptr.io_mem_map[i]); + } + + _destroy_mmap(&mgaptr.linear_map); + +#if !MGA_FARPTR + if (dirty) { + __djgpp_nearptr_disable(); + dirty = FALSE; + } +#endif + + matrox_id = 0; +} + + + +/* Desc: Attempts to detect MGA. + * + * In : + * Out : + * + * Note: The first thing ever to be called. This is in charge of filling in + * the driver header with all the required information and function + * pointers. We do not yet have access to the video memory, so we can't + * talk directly to the card. + */ +int mga_hw_init (unsigned long *vram, int *interleave, char *name) +{ + int i; + unsigned long pci_base[2]; + + if (matrox_id) { + return matrox_id; + } + +#if !MGA_FARPTR + /* enable nearptr access */ + if (_crt0_startup_flags & _CRT0_FLAG_NEARPTR) { + dirty = FALSE; + } else { + if (__djgpp_nearptr_enable() == 0) + return 0; + + dirty = TRUE; + } +#endif + + /* find PCI device */ + matrox_id = 0; + + for (bus_id=0, i=0; matrox_id_list[i]; i++) { + if (pci_find_device(matrox_id_list[i], MATROX_VENDOR_ID, 0, &bus_id)) { + matrox_id = matrox_id_list[i]; + break; + } + } + + /* set up the card name */ + switch (matrox_id) { + case MATROX_MILL_ID: + if (name) strcpy(name, "Millennium"); + break; + default: + matrox_id = 0; + return -1; + } + + reg40 = pci_read_long(bus_id, 0x40); +#if 0 /* overclock a little :) */ + { + int rfhcnt = (reg40 >> 16) & 0xF; + if ((reg40 & 0x200000) && (rfhcnt < 0xC)) { + pci_write_long(bus_id, 0x40, (reg40 & 0xFFF0FFFF) | 0x000C0000); + } + } +#endif + + /* read hardware configuration data */ + for (i=0; i<2; i++) + pci_base[i] = pci_read_long(bus_id, 16+i*4); + + /* work out the linear framebuffer and MMIO addresses */ + if (matrox_id == MATROX_MILL_ID) { + if (pci_base[0]) + io_mem_base[0] = pci_base[0] & 0xFFFFC000; + + if (pci_base[1]) + linear_base = pci_base[1] & 0xFF800000; + } + + if (!linear_base || !io_mem_base[0]) + return 0; + + /* deal with the memory mapping crap */ + io_mem_size[0] = 0x4000; + + for (i=0; i<4; i++) { + if (io_mem_base[i]) { + if (_create_mmap(&mgaptr.io_mem_map[i], io_mem_base[i], io_mem_size[i])) { + mga_hw_fini(); + return 0; + } + } + } + + *vram = linear_size = _mga_get_vram(matrox_id, linear_base); + + if (_create_mmap(&mgaptr.linear_map, linear_base, linear_size)) { + mga_hw_fini(); + return 0; + } + + /* fill in user data */ + *interleave = linear_size > 2*1024*1024; + + return matrox_id; +} + + + +/* PCI routines added by SET */ +#define PCIAddr 0xCF8 +#define PCIData 0xCFC +#define PCIEnable 0x80000000 + + + +/* FindPCIDevice: + * Replacement for the INT 1A - PCI BIOS v2.0c+ - FIND PCI DEVICE, AX = B102h + * + * Note: deviceIndex is because a card can hold more than one PCI chip. + * + * Searches the board of the vendor supplied in vendorID with + * identification number deviceID and index deviceIndex (normally 0). + * The value returned in handle can be used to access the PCI registers + * of this board. + * + * Return: 1 if found 0 if not found. + */ +static int pci_find_device (int deviceID, int vendorID, int deviceIndex, int *handle) +{ + int model, vendor, card, device; + unsigned value, full_id, bus, busMax; + + deviceIndex <<= 8; + + /* for each PCI bus */ + for (bus=0, busMax=0x10000; bus> 16; + + if (vendor != 0xFFFF) { + /* is this the one we want? */ + if ((deviceID == model) && (vendorID == vendor)) { + *handle = value; + return 1; + } + + /* is it a bridge to a secondary bus? */ + outportl(PCIAddr, value | 8); + + if (((inportl(PCIData) >> 16) == 0x0600) || (full_id==0x00011011)) + busMax += 0x10000; + } + } + } + + return 0; +} + + + +/* Desc: + * + * In : + * Out : + * + * Note: + */ +static unsigned long pci_read_long (int handle, int index) +{ + outportl(PCIAddr, PCIEnable | handle | index); + return inportl(PCIData); +} + + + +/* Desc: + * + * In : + * Out : + * + * Note: + */ +static void pci_write_long (int handle, int index, unsigned long value) +{ + outportl(PCIAddr, PCIEnable | handle | index); + outportl(PCIData, value); +} diff --git a/src/mesa/drivers/dos/mga/mga_hw.h b/src/mesa/drivers/dos/mga/mga_hw.h index c6575b97f88..8cc266b49e7 100644 --- a/src/mesa/drivers/dos/mga/mga_hw.h +++ b/src/mesa/drivers/dos/mga/mga_hw.h @@ -1,113 +1,113 @@ -/* - * Mesa 3-D graphics library - * Version: 5.0 - * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W HW mapping - * - * Copyright (c) 2003 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef MGA_HW_included -#define MGA_HW_included - - - -/* set this to zero to use near pointers */ -#define MGA_FARPTR 1 - - - -/* access macros */ -#if MGA_FARPTR - -#include - -#define hwptr_pokeb(ptr, off, val) _farpokeb((ptr).selector, (ptr).offset32+(off), (val)) -#define hwptr_pokew(ptr, off, val) _farpokew((ptr).selector, (ptr).offset32+(off), (val)) -#define hwptr_pokel(ptr, off, val) _farpokel((ptr).selector, (ptr).offset32+(off), (val)) - -#define hwptr_peekb(ptr, off) _farpeekb((ptr).selector, (ptr).offset32+(off)) -#define hwptr_peekw(ptr, off) _farpeekw((ptr).selector, (ptr).offset32+(off)) -#define hwptr_peekl(ptr, off) _farpeekl((ptr).selector, (ptr).offset32+(off)) - -#define hwptr_select(ptr) _farsetsel((ptr).selector) -#define hwptr_unselect(ptr) (ptr).selector = _fargetsel() - -#define hwptr_nspokeb(ptr, off, val) _farnspokeb((ptr).offset32+(off), (val)) -#define hwptr_nspokew(ptr, off, val) _farnspokew((ptr).offset32+(off), (val)) -#define hwptr_nspokel(ptr, off, val) _farnspokel((ptr).offset32+(off), (val)) - -#define hwptr_nspeekb(ptr, off) _farnspeekb((ptr).offset32+(off)) -#define hwptr_nspeekw(ptr, off) _farnspeekw((ptr).offset32+(off)) -#define hwptr_nspeekl(ptr, off) _farnspeekl((ptr).offset32+(off)) - -#else - -#define hwptr_pokeb(ptr, off, val) *((volatile unsigned char *)((ptr).offset32+(off))) = (val) -#define hwptr_pokew(ptr, off, val) *((volatile unsigned short *)((ptr).offset32+(off))) = (val) -#define hwptr_pokel(ptr, off, val) *((volatile unsigned long *)((ptr).offset32+(off))) = (val) - -#define hwptr_peekb(ptr, off) (*((volatile unsigned char *)((ptr).offset32+(off)))) -#define hwptr_peekw(ptr, off) (*((volatile unsigned short *)((ptr).offset32+(off)))) -#define hwptr_peekl(ptr, off) (*((volatile unsigned long *)((ptr).offset32+(off)))) - -#define hwptr_select(ptr) -#define hwptr_unselect(ptr) - -#define hwptr_nspokeb(ptr, off, val) *((volatile unsigned char *)((ptr).offset32+(off))) = (val) -#define hwptr_nspokew(ptr, off, val) *((volatile unsigned short *)((ptr).offset32+(off))) = (val) -#define hwptr_nspokel(ptr, off, val) *((volatile unsigned long *)((ptr).offset32+(off))) = (val) - -#define hwptr_nspeekb(ptr, off) (*((volatile unsigned char *)((ptr).offset32+(off)))) -#define hwptr_nspeekw(ptr, off) (*((volatile unsigned short *)((ptr).offset32+(off)))) -#define hwptr_nspeekl(ptr, off) (*((volatile unsigned long *)((ptr).offset32+(off)))) - -#endif - - - -/* helpers for accessing the Matrox registers */ -#define mga_select() hwptr_select(mgaptr.io_mem_map[0]) -#define mga_inb(addr) hwptr_nspeekb(mgaptr.io_mem_map[0], addr) -#define mga_inw(addr) hwptr_nspeekw(mgaptr.io_mem_map[0], addr) -#define mga_inl(addr) hwptr_nspeekl(mgaptr.io_mem_map[0], addr) -#define mga_outb(addr, val) hwptr_nspokeb(mgaptr.io_mem_map[0], addr, val) -#define mga_outw(addr, val) hwptr_nspokew(mgaptr.io_mem_map[0], addr, val) -#define mga_outl(addr, val) hwptr_nspokel(mgaptr.io_mem_map[0], addr, val) - - - -typedef struct MGA_HWPTR { - __dpmi_paddr io_mem_map[4], linear_map; -} MGA_HWPTR; - -extern MGA_HWPTR mgaptr; - -void mga_hw_fini (void); -int mga_hw_init (unsigned long *vram, int *interleave, char *name); - -#endif +/* + * Mesa 3-D graphics library + * Version: 5.0 + * + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W HW mapping + * + * Copyright (c) 2003 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef MGA_HW_included +#define MGA_HW_included + + + +/* set this to zero to use near pointers */ +#define MGA_FARPTR 1 + + + +/* access macros */ +#if MGA_FARPTR + +#include + +#define hwptr_pokeb(ptr, off, val) _farpokeb((ptr).selector, (ptr).offset32+(off), (val)) +#define hwptr_pokew(ptr, off, val) _farpokew((ptr).selector, (ptr).offset32+(off), (val)) +#define hwptr_pokel(ptr, off, val) _farpokel((ptr).selector, (ptr).offset32+(off), (val)) + +#define hwptr_peekb(ptr, off) _farpeekb((ptr).selector, (ptr).offset32+(off)) +#define hwptr_peekw(ptr, off) _farpeekw((ptr).selector, (ptr).offset32+(off)) +#define hwptr_peekl(ptr, off) _farpeekl((ptr).selector, (ptr).offset32+(off)) + +#define hwptr_select(ptr) _farsetsel((ptr).selector) +#define hwptr_unselect(ptr) (ptr).selector = _fargetsel() + +#define hwptr_nspokeb(ptr, off, val) _farnspokeb((ptr).offset32+(off), (val)) +#define hwptr_nspokew(ptr, off, val) _farnspokew((ptr).offset32+(off), (val)) +#define hwptr_nspokel(ptr, off, val) _farnspokel((ptr).offset32+(off), (val)) + +#define hwptr_nspeekb(ptr, off) _farnspeekb((ptr).offset32+(off)) +#define hwptr_nspeekw(ptr, off) _farnspeekw((ptr).offset32+(off)) +#define hwptr_nspeekl(ptr, off) _farnspeekl((ptr).offset32+(off)) + +#else + +#define hwptr_pokeb(ptr, off, val) *((volatile unsigned char *)((ptr).offset32+(off))) = (val) +#define hwptr_pokew(ptr, off, val) *((volatile unsigned short *)((ptr).offset32+(off))) = (val) +#define hwptr_pokel(ptr, off, val) *((volatile unsigned long *)((ptr).offset32+(off))) = (val) + +#define hwptr_peekb(ptr, off) (*((volatile unsigned char *)((ptr).offset32+(off)))) +#define hwptr_peekw(ptr, off) (*((volatile unsigned short *)((ptr).offset32+(off)))) +#define hwptr_peekl(ptr, off) (*((volatile unsigned long *)((ptr).offset32+(off)))) + +#define hwptr_select(ptr) +#define hwptr_unselect(ptr) + +#define hwptr_nspokeb(ptr, off, val) *((volatile unsigned char *)((ptr).offset32+(off))) = (val) +#define hwptr_nspokew(ptr, off, val) *((volatile unsigned short *)((ptr).offset32+(off))) = (val) +#define hwptr_nspokel(ptr, off, val) *((volatile unsigned long *)((ptr).offset32+(off))) = (val) + +#define hwptr_nspeekb(ptr, off) (*((volatile unsigned char *)((ptr).offset32+(off)))) +#define hwptr_nspeekw(ptr, off) (*((volatile unsigned short *)((ptr).offset32+(off)))) +#define hwptr_nspeekl(ptr, off) (*((volatile unsigned long *)((ptr).offset32+(off)))) + +#endif + + + +/* helpers for accessing the Matrox registers */ +#define mga_select() hwptr_select(mgaptr.io_mem_map[0]) +#define mga_inb(addr) hwptr_nspeekb(mgaptr.io_mem_map[0], addr) +#define mga_inw(addr) hwptr_nspeekw(mgaptr.io_mem_map[0], addr) +#define mga_inl(addr) hwptr_nspeekl(mgaptr.io_mem_map[0], addr) +#define mga_outb(addr, val) hwptr_nspokeb(mgaptr.io_mem_map[0], addr, val) +#define mga_outw(addr, val) hwptr_nspokew(mgaptr.io_mem_map[0], addr, val) +#define mga_outl(addr, val) hwptr_nspokel(mgaptr.io_mem_map[0], addr, val) + + + +typedef struct MGA_HWPTR { + __dpmi_paddr io_mem_map[4], linear_map; +} MGA_HWPTR; + +extern MGA_HWPTR mgaptr; + +void mga_hw_fini (void); +int mga_hw_init (unsigned long *vram, int *interleave, char *name); + +#endif diff --git a/src/mesa/drivers/dos/mga/mga_mode.c b/src/mesa/drivers/dos/mga/mga_mode.c index 4c6d926111d..efba24ca691 100644 --- a/src/mesa/drivers/dos/mga/mga_mode.c +++ b/src/mesa/drivers/dos/mga/mga_mode.c @@ -1,231 +1,231 @@ -/* - * Mesa 3-D graphics library - * Version: 5.0 - * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W mode switching - * - * Copyright (c) 2003 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include -#include -#include -#include -#include -#include -#include - -#include "../internal.h" -#include "mga_mode.h" - - - -static MGA_MODE oldmode; -static MGA_MODE modes[64]; - - - -/* - * VESA info - */ -#define V_SIGN 0 -#define V_MINOR 4 -#define V_MAJOR 5 -#define V_OEM_OFS 6 -#define V_OEM_SEG 8 -#define V_MODE_OFS 14 -#define V_MODE_SEG 16 -#define V_MEMORY 18 - -/* - * mode info - */ -#define M_ATTR 0 -#define M_GRAN 4 -#define M_SCANLEN 16 -#define M_XRES 18 -#define M_YRES 20 -#define M_BPP 25 -#define M_RED 31 -#define M_GREEN 33 -#define M_BLUE 35 -#define M_PHYS_PTR 40 - - - -/* Desc: get available modes - * - * In : - - * Out : linear modes list ptr - * - * Note: shouldn't use VESA... - */ -static MGA_MODE *_mga_mode_check (void) -{ - __dpmi_regs r; - word16 *p; - MGA_MODE *q; - char vesa_info[512], tmp[512]; - - _farpokel(_stubinfo->ds_selector, 0, 0x32454256); - r.x.ax = 0x4f00; - r.x.di = 0; - r.x.es = _stubinfo->ds_segment; - __dpmi_int(0x10, &r); - movedata(_stubinfo->ds_selector, 0, _my_ds(), (unsigned)vesa_info, 512); - if ((r.x.ax!=0x004f) || ((_32_ vesa_info[V_SIGN])!=0x41534556)) { - return NULL; - } - - p = (word16 *)(((_16_ vesa_info[V_MODE_SEG])<<4) + (_16_ vesa_info[V_MODE_OFS])); - q = modes; - do { - if ((q->mode=_farpeekw(__djgpp_dos_sel, (unsigned long)(p++)))==0xffff) { - break; - } - - r.x.ax = 0x4f01; - r.x.cx = q->mode; - r.x.di = 512; - r.x.es = _stubinfo->ds_segment; - __dpmi_int(0x10, &r); - movedata(_stubinfo->ds_selector, 512, _my_ds(), (unsigned)tmp, 256); - switch (tmp[M_BPP]) { - case 16: - q->bpp = tmp[M_RED] + tmp[M_GREEN] + tmp[M_BLUE]; - break; - case 8: - case 15: - case 24: - case 32: - q->bpp = tmp[M_BPP]; - break; - default: - q->bpp = 0; - } - if ((r.x.ax==0x004f) && ((tmp[M_ATTR]&0x11)==0x11) && q->bpp && (tmp[M_ATTR]&0x80)) { - q->xres = _16_ tmp[M_XRES]; - q->yres = _16_ tmp[M_YRES]; - q->mode |= 0x4000; - q++; - } - } while (TRUE); - - return modes; -} - - - -/* Desc: save current mode - * - * In : ptr to mode structure - * Out : 0 if success - * - * Note: shouldn't use VESA... - */ -static int _mga_mode_save (MGA_MODE *p) -{ - __asm("\n\ - movw $0x4f03, %%ax \n\ - int $0x10 \n\ - movl %%ebx, %0 \n\ - ":"=g"(p->mode)::"%eax", "%ebx"); - return 0; -} - - - -/* Desc: switch to specified mode - * - * In : ptr to mode structure, refresh rate - * Out : 0 if success - * - * Note: shouldn't use VESA... - */ -int mga_mode_switch (MGA_MODE *p, int refresh) -{ - if (oldmode.mode == 0) { - _mga_mode_save(&oldmode); - } - __asm("movw $0x4f02, %%ax; int $0x10"::"b"(p->mode):"%eax"); - return 0; - - (void)refresh; /* silence compiler warning */ -} - - - -/* Desc: restore to the mode prior to first call to `mga_switch' - * - * In : - - * Out : 0 if success - * - * Note: shouldn't use VESA... - */ -int mga_mode_restore (void) -{ - if (oldmode.mode != 0) { - __asm("movw $0x4f02, %%ax; int $0x10"::"b"(oldmode.mode):"%eax"); - oldmode.mode = 0; - } - return 0; -} - - - -/* Desc: return suitable mode - * - * In : width, height, bpp - * Out : ptr to mode structure - * - * Note: - - */ -MGA_MODE *mga_mode_find (int width, int height, int bpp) -{ - static MGA_MODE *q = NULL; - - MGA_MODE *p; - unsigned int min; - - if (q == NULL) { - if ((q = _mga_mode_check()) == NULL) { - return NULL; - } - } - - /* search for a mode that fits our request */ - for (min=-1, p=NULL; q->mode!=0xffff; q++) { - if ((q->xres>=width) && (q->yres>=height) && (q->bpp==bpp)) { - if (min>=(unsigned)(q->xres*q->yres)) { - min = q->xres*q->yres; - p = q; - } - } - } - - return p; -} +/* + * Mesa 3-D graphics library + * Version: 5.0 + * + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W mode switching + * + * Copyright (c) 2003 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include +#include +#include +#include +#include +#include +#include + +#include "../internal.h" +#include "mga_mode.h" + + + +static MGA_MODE oldmode; +static MGA_MODE modes[64]; + + + +/* + * VESA info + */ +#define V_SIGN 0 +#define V_MINOR 4 +#define V_MAJOR 5 +#define V_OEM_OFS 6 +#define V_OEM_SEG 8 +#define V_MODE_OFS 14 +#define V_MODE_SEG 16 +#define V_MEMORY 18 + +/* + * mode info + */ +#define M_ATTR 0 +#define M_GRAN 4 +#define M_SCANLEN 16 +#define M_XRES 18 +#define M_YRES 20 +#define M_BPP 25 +#define M_RED 31 +#define M_GREEN 33 +#define M_BLUE 35 +#define M_PHYS_PTR 40 + + + +/* Desc: get available modes + * + * In : - + * Out : linear modes list ptr + * + * Note: shouldn't use VESA... + */ +static MGA_MODE *_mga_mode_check (void) +{ + __dpmi_regs r; + word16 *p; + MGA_MODE *q; + char vesa_info[512], tmp[512]; + + _farpokel(_stubinfo->ds_selector, 0, 0x32454256); + r.x.ax = 0x4f00; + r.x.di = 0; + r.x.es = _stubinfo->ds_segment; + __dpmi_int(0x10, &r); + movedata(_stubinfo->ds_selector, 0, _my_ds(), (unsigned)vesa_info, 512); + if ((r.x.ax!=0x004f) || ((_32_ vesa_info[V_SIGN])!=0x41534556)) { + return NULL; + } + + p = (word16 *)(((_16_ vesa_info[V_MODE_SEG])<<4) + (_16_ vesa_info[V_MODE_OFS])); + q = modes; + do { + if ((q->mode=_farpeekw(__djgpp_dos_sel, (unsigned long)(p++)))==0xffff) { + break; + } + + r.x.ax = 0x4f01; + r.x.cx = q->mode; + r.x.di = 512; + r.x.es = _stubinfo->ds_segment; + __dpmi_int(0x10, &r); + movedata(_stubinfo->ds_selector, 512, _my_ds(), (unsigned)tmp, 256); + switch (tmp[M_BPP]) { + case 16: + q->bpp = tmp[M_RED] + tmp[M_GREEN] + tmp[M_BLUE]; + break; + case 8: + case 15: + case 24: + case 32: + q->bpp = tmp[M_BPP]; + break; + default: + q->bpp = 0; + } + if ((r.x.ax==0x004f) && ((tmp[M_ATTR]&0x11)==0x11) && q->bpp && (tmp[M_ATTR]&0x80)) { + q->xres = _16_ tmp[M_XRES]; + q->yres = _16_ tmp[M_YRES]; + q->mode |= 0x4000; + q++; + } + } while (TRUE); + + return modes; +} + + + +/* Desc: save current mode + * + * In : ptr to mode structure + * Out : 0 if success + * + * Note: shouldn't use VESA... + */ +static int _mga_mode_save (MGA_MODE *p) +{ + __asm("\n\ + movw $0x4f03, %%ax \n\ + int $0x10 \n\ + movl %%ebx, %0 \n\ + ":"=g"(p->mode)::"%eax", "%ebx"); + return 0; +} + + + +/* Desc: switch to specified mode + * + * In : ptr to mode structure, refresh rate + * Out : 0 if success + * + * Note: shouldn't use VESA... + */ +int mga_mode_switch (MGA_MODE *p, int refresh) +{ + if (oldmode.mode == 0) { + _mga_mode_save(&oldmode); + } + __asm("movw $0x4f02, %%ax; int $0x10"::"b"(p->mode):"%eax"); + return 0; + + (void)refresh; /* silence compiler warning */ +} + + + +/* Desc: restore to the mode prior to first call to `mga_switch' + * + * In : - + * Out : 0 if success + * + * Note: shouldn't use VESA... + */ +int mga_mode_restore (void) +{ + if (oldmode.mode != 0) { + __asm("movw $0x4f02, %%ax; int $0x10"::"b"(oldmode.mode):"%eax"); + oldmode.mode = 0; + } + return 0; +} + + + +/* Desc: return suitable mode + * + * In : width, height, bpp + * Out : ptr to mode structure + * + * Note: - + */ +MGA_MODE *mga_mode_find (int width, int height, int bpp) +{ + static MGA_MODE *q = NULL; + + MGA_MODE *p; + unsigned int min; + + if (q == NULL) { + if ((q = _mga_mode_check()) == NULL) { + return NULL; + } + } + + /* search for a mode that fits our request */ + for (min=-1, p=NULL; q->mode!=0xffff; q++) { + if ((q->xres>=width) && (q->yres>=height) && (q->bpp==bpp)) { + if (min>=(unsigned)(q->xres*q->yres)) { + min = q->xres*q->yres; + p = q; + } + } + } + + return p; +} diff --git a/src/mesa/drivers/dos/mga/mga_mode.h b/src/mesa/drivers/dos/mga/mga_mode.h index b458d00d802..c9e04bc2ea2 100644 --- a/src/mesa/drivers/dos/mga/mga_mode.h +++ b/src/mesa/drivers/dos/mga/mga_mode.h @@ -1,47 +1,47 @@ -/* - * Mesa 3-D graphics library - * Version: 5.0 - * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W mode switching - * - * Copyright (c) 2003 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef MGA_MODE_included -#define MGA_MODE_included - -typedef struct MGA_MODE { - int mode; - int xres, yres; - int bpp; -} MGA_MODE; - -int mga_mode_switch (MGA_MODE *p, int refresh); -int mga_mode_restore (void); -MGA_MODE *mga_mode_find (int width, int height, int bpp); - -#endif +/* + * Mesa 3-D graphics library + * Version: 5.0 + * + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W mode switching + * + * Copyright (c) 2003 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef MGA_MODE_included +#define MGA_MODE_included + +typedef struct MGA_MODE { + int mode; + int xres, yres; + int bpp; +} MGA_MODE; + +int mga_mode_switch (MGA_MODE *p, int refresh); +int mga_mode_restore (void); +MGA_MODE *mga_mode_find (int width, int height, int bpp); + +#endif diff --git a/src/mesa/drivers/dos/mga/mga_reg.h b/src/mesa/drivers/dos/mga/mga_reg.h index 4cd664ff967..11db81886b6 100644 --- a/src/mesa/drivers/dos/mga/mga_reg.h +++ b/src/mesa/drivers/dos/mga/mga_reg.h @@ -1,207 +1,207 @@ -/* - * Mesa 3-D graphics library - * Version: 5.0 - * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W register mnemonics - * - * Copyright (c) 2003 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef MGA_REG_H_included -#define MGA_REG_H_included - -/* Matrox hardware registers: */ -#define M_AR0 0x1C60 -#define M_AR1 0x1C64 -#define M_AR2 0x1C68 -#define M_AR3 0x1C6C -#define M_AR4 0x1C70 -#define M_AR5 0x1C74 -#define M_AR6 0x1C78 -#define M_BCOL 0x1C20 -#define M_CXBNDRY 0x1C80 -#define M_CXLEFT 0x1CA0 -#define M_CXRIGHT 0x1CA4 -#define M_DR0 0x1CC0 -#define M_DR2 0x1CC8 -#define M_DR3 0x1CCC -#define M_DR4 0x1CD0 -#define M_DR6 0x1CD8 -#define M_DR7 0x1CDC -#define M_DR8 0x1CE0 -#define M_DR10 0x1CE8 -#define M_DR11 0x1CEC -#define M_DR12 0x1CF0 -#define M_DR14 0x1CF8 -#define M_DR15 0x1CFC -#define M_DWGCTL 0x1C00 -#define M_FCOL 0x1C24 -#define M_FIFOSTATUS 0x1E10 -#define M_FXBNDRY 0x1C84 -#define M_FXLEFT 0x1CA8 -#define M_FXRIGHT 0x1CAC -#define M_ICLEAR 0x1E18 -#define M_IEN 0x1E1C -#define M_LEN 0x1C5C -#define M_MACCESS 0x1C04 -#define M_OPMODE 0x1E54 -#define M_PAT0 0x1C10 -#define M_PAT1 0x1C14 -#define M_PITCH 0x1C8C -#define M_PLNWT 0x1C1C -#define M_RESET 0x1E40 -#define M_SGN 0x1C58 -#define M_SHIFT 0x1C50 -#define M_SRC0 0x1C30 -#define M_SRC1 0x1C34 -#define M_SRC2 0x1C38 -#define M_SRC3 0x1C3C -#define M_STATUS 0x1E14 -#define M_VCOUNT 0x1E20 -#define M_XDST 0x1CB0 -#define M_XYEND 0x1C44 -#define M_XYSTRT 0x1C40 -#define M_YBOT 0x1C9C -#define M_YDST 0x1C90 -#define M_YDSTLEN 0x1C88 -#define M_YDSTORG 0x1C94 -#define M_YTOP 0x1C98 -#define M_ZORG 0x1C0C - -#define M_EXEC 0x0100 - -/* DWGCTL: opcod */ -#define M_DWG_LINE_OPEN 0x0 -#define M_DWG_AUTOLINE_OPEN 0x1 -#define M_DWG_LINE_CLOSE 0x2 -#define M_DWG_AUTOLINE_CLOSE 0x3 -#define M_DWG_TRAP 0x4 -#define M_DWG_TEXTURE_TRAP 0x5 -#define M_DWG_BITBLT 0x8 -#define M_DWG_FBITBLT 0xC -#define M_DWG_ILOAD 0x9 -#define M_DWG_ILOAD_SCALE 0xD -#define M_DWG_ILOAD_FILTER 0xF -#define M_DWG_IDUMP 0xA - -/* DWGCTL: atype */ -#define M_DWG_RPL (0x0 << 4) -#define M_DWG_RSTR (0x1 << 4) -#define M_DWG_ZI (0x3 << 4) -#define M_DWG_BLK (0x4 << 4) -#define M_DWG_I (0x7 << 4) - -/* DWGCTL: linear */ -#define M_DWG_LINEAR (0x1 << 7) - -/* DWGCTL: zmode */ -#define M_DWG_NOZCMP (0x0 << 8) -#define M_DWG_ZE (0x2 << 8) -#define M_DWG_ZNE (0x3 << 8) -#define M_DWG_ZLT (0x4 << 8) -#define M_DWG_ZLTE (0x5 << 8) -#define M_DWG_ZGT (0x6 << 8) -#define M_DWG_ZGTE (0x7 << 8) - -/* DWGCTL: solid */ -#define M_DWG_SOLID (0x1 << 11) - -/* DWGCTL: arzero */ -#define M_DWG_ARZERO (0x1 << 12) - -/* DWGCTL: sgnzero */ -#define M_DWG_SGNZERO (0x1 << 13) - -/* DWGCTL: shiftzero */ -#define M_DWG_SHFTZERO (0x1 << 14) - -/* DWGCTL: bop */ -#define M_DWG_BOP_XOR (0x6 << 16) -#define M_DWG_BOP_AND (0x8 << 16) -#define M_DWG_BOP_SRC (0xC << 16) -#define M_DWG_BOP_OR (0xE << 16) - -/* DWGCTL: trans */ -#define M_DWG_TRANS_0 (0x0 << 20) -#define M_DWG_TRANS_1 (0x1 << 20) -#define M_DWG_TRANS_2 (0x2 << 20) -#define M_DWG_TRANS_3 (0x3 << 20) -#define M_DWG_TRANS_4 (0x4 << 20) -#define M_DWG_TRANS_5 (0x5 << 20) -#define M_DWG_TRANS_6 (0x6 << 20) -#define M_DWG_TRANS_7 (0x7 << 20) -#define M_DWG_TRANS_8 (0x8 << 20) -#define M_DWG_TRANS_9 (0x9 << 20) -#define M_DWG_TRANS_A (0xA << 20) -#define M_DWG_TRANS_B (0xB << 20) -#define M_DWG_TRANS_C (0xC << 20) -#define M_DWG_TRANS_D (0xD << 20) -#define M_DWG_TRANS_E (0xE << 20) -#define M_DWG_TRANS_F (0xF << 20) - -/* DWGCTL: bltmod */ -#define M_DWG_BMONOLEF (0x0 << 25) -#define M_DWG_BMONOWF (0x4 << 25) -#define M_DWG_BPLAN (0x1 << 25) -#define M_DWG_BFCOL (0x2 << 25) -#define M_DWG_BUYUV (0xE << 25) -#define M_DWG_BU32BGR (0x3 << 25) -#define M_DWG_BU32RGB (0x7 << 25) -#define M_DWG_BU24BGR (0xB << 25) -#define M_DWG_BU24RGB (0xF << 25) - -/* DWGCTL: pattern */ -#define M_DWG_PATTERN (0x1 << 29) - -/* DWGCTL: transc */ -#define M_DWG_TRANSC (0x1 << 30) - -/* OPMODE: */ -#define M_DMA_GENERAL (0x0 << 2) -#define M_DMA_BLIT (0x1 << 2) -#define M_DMA_VECTOR (0x2 << 2) - -/* SGN: */ -#define M_SDXL (0x1 << 1) -#define M_SDXR (0x1 << 5) - - - -/* VGAREG */ -#define M_CRTC_INDEX 0x1FD4 -#define M_CRTC_DATA 0x1FD5 - -#define M_CRTC_EXT_INDEX 0x1FDE -#define M_CRTC_EXT_DATA 0x1FDF - -#define M_MISC_R 0x1FCC -#define M_MISC_W 0x1FC2 - -/* CRTCEXT3: */ -#define M_MGAMODE (0x1 << 7) - -#endif +/* + * Mesa 3-D graphics library + * Version: 5.0 + * + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa -- MGA2064W register mnemonics + * + * Copyright (c) 2003 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef MGA_REG_H_included +#define MGA_REG_H_included + +/* Matrox hardware registers: */ +#define M_AR0 0x1C60 +#define M_AR1 0x1C64 +#define M_AR2 0x1C68 +#define M_AR3 0x1C6C +#define M_AR4 0x1C70 +#define M_AR5 0x1C74 +#define M_AR6 0x1C78 +#define M_BCOL 0x1C20 +#define M_CXBNDRY 0x1C80 +#define M_CXLEFT 0x1CA0 +#define M_CXRIGHT 0x1CA4 +#define M_DR0 0x1CC0 +#define M_DR2 0x1CC8 +#define M_DR3 0x1CCC +#define M_DR4 0x1CD0 +#define M_DR6 0x1CD8 +#define M_DR7 0x1CDC +#define M_DR8 0x1CE0 +#define M_DR10 0x1CE8 +#define M_DR11 0x1CEC +#define M_DR12 0x1CF0 +#define M_DR14 0x1CF8 +#define M_DR15 0x1CFC +#define M_DWGCTL 0x1C00 +#define M_FCOL 0x1C24 +#define M_FIFOSTATUS 0x1E10 +#define M_FXBNDRY 0x1C84 +#define M_FXLEFT 0x1CA8 +#define M_FXRIGHT 0x1CAC +#define M_ICLEAR 0x1E18 +#define M_IEN 0x1E1C +#define M_LEN 0x1C5C +#define M_MACCESS 0x1C04 +#define M_OPMODE 0x1E54 +#define M_PAT0 0x1C10 +#define M_PAT1 0x1C14 +#define M_PITCH 0x1C8C +#define M_PLNWT 0x1C1C +#define M_RESET 0x1E40 +#define M_SGN 0x1C58 +#define M_SHIFT 0x1C50 +#define M_SRC0 0x1C30 +#define M_SRC1 0x1C34 +#define M_SRC2 0x1C38 +#define M_SRC3 0x1C3C +#define M_STATUS 0x1E14 +#define M_VCOUNT 0x1E20 +#define M_XDST 0x1CB0 +#define M_XYEND 0x1C44 +#define M_XYSTRT 0x1C40 +#define M_YBOT 0x1C9C +#define M_YDST 0x1C90 +#define M_YDSTLEN 0x1C88 +#define M_YDSTORG 0x1C94 +#define M_YTOP 0x1C98 +#define M_ZORG 0x1C0C + +#define M_EXEC 0x0100 + +/* DWGCTL: opcod */ +#define M_DWG_LINE_OPEN 0x0 +#define M_DWG_AUTOLINE_OPEN 0x1 +#define M_DWG_LINE_CLOSE 0x2 +#define M_DWG_AUTOLINE_CLOSE 0x3 +#define M_DWG_TRAP 0x4 +#define M_DWG_TEXTURE_TRAP 0x5 +#define M_DWG_BITBLT 0x8 +#define M_DWG_FBITBLT 0xC +#define M_DWG_ILOAD 0x9 +#define M_DWG_ILOAD_SCALE 0xD +#define M_DWG_ILOAD_FILTER 0xF +#define M_DWG_IDUMP 0xA + +/* DWGCTL: atype */ +#define M_DWG_RPL (0x0 << 4) +#define M_DWG_RSTR (0x1 << 4) +#define M_DWG_ZI (0x3 << 4) +#define M_DWG_BLK (0x4 << 4) +#define M_DWG_I (0x7 << 4) + +/* DWGCTL: linear */ +#define M_DWG_LINEAR (0x1 << 7) + +/* DWGCTL: zmode */ +#define M_DWG_NOZCMP (0x0 << 8) +#define M_DWG_ZE (0x2 << 8) +#define M_DWG_ZNE (0x3 << 8) +#define M_DWG_ZLT (0x4 << 8) +#define M_DWG_ZLTE (0x5 << 8) +#define M_DWG_ZGT (0x6 << 8) +#define M_DWG_ZGTE (0x7 << 8) + +/* DWGCTL: solid */ +#define M_DWG_SOLID (0x1 << 11) + +/* DWGCTL: arzero */ +#define M_DWG_ARZERO (0x1 << 12) + +/* DWGCTL: sgnzero */ +#define M_DWG_SGNZERO (0x1 << 13) + +/* DWGCTL: shiftzero */ +#define M_DWG_SHFTZERO (0x1 << 14) + +/* DWGCTL: bop */ +#define M_DWG_BOP_XOR (0x6 << 16) +#define M_DWG_BOP_AND (0x8 << 16) +#define M_DWG_BOP_SRC (0xC << 16) +#define M_DWG_BOP_OR (0xE << 16) + +/* DWGCTL: trans */ +#define M_DWG_TRANS_0 (0x0 << 20) +#define M_DWG_TRANS_1 (0x1 << 20) +#define M_DWG_TRANS_2 (0x2 << 20) +#define M_DWG_TRANS_3 (0x3 << 20) +#define M_DWG_TRANS_4 (0x4 << 20) +#define M_DWG_TRANS_5 (0x5 << 20) +#define M_DWG_TRANS_6 (0x6 << 20) +#define M_DWG_TRANS_7 (0x7 << 20) +#define M_DWG_TRANS_8 (0x8 << 20) +#define M_DWG_TRANS_9 (0x9 << 20) +#define M_DWG_TRANS_A (0xA << 20) +#define M_DWG_TRANS_B (0xB << 20) +#define M_DWG_TRANS_C (0xC << 20) +#define M_DWG_TRANS_D (0xD << 20) +#define M_DWG_TRANS_E (0xE << 20) +#define M_DWG_TRANS_F (0xF << 20) + +/* DWGCTL: bltmod */ +#define M_DWG_BMONOLEF (0x0 << 25) +#define M_DWG_BMONOWF (0x4 << 25) +#define M_DWG_BPLAN (0x1 << 25) +#define M_DWG_BFCOL (0x2 << 25) +#define M_DWG_BUYUV (0xE << 25) +#define M_DWG_BU32BGR (0x3 << 25) +#define M_DWG_BU32RGB (0x7 << 25) +#define M_DWG_BU24BGR (0xB << 25) +#define M_DWG_BU24RGB (0xF << 25) + +/* DWGCTL: pattern */ +#define M_DWG_PATTERN (0x1 << 29) + +/* DWGCTL: transc */ +#define M_DWG_TRANSC (0x1 << 30) + +/* OPMODE: */ +#define M_DMA_GENERAL (0x0 << 2) +#define M_DMA_BLIT (0x1 << 2) +#define M_DMA_VECTOR (0x2 << 2) + +/* SGN: */ +#define M_SDXL (0x1 << 1) +#define M_SDXR (0x1 << 5) + + + +/* VGAREG */ +#define M_CRTC_INDEX 0x1FD4 +#define M_CRTC_DATA 0x1FD5 + +#define M_CRTC_EXT_INDEX 0x1FDE +#define M_CRTC_EXT_DATA 0x1FDF + +#define M_MISC_R 0x1FCC +#define M_MISC_W 0x1FC2 + +/* CRTCEXT3: */ +#define M_MGAMODE (0x1 << 7) + +#endif diff --git a/src/mesa/drivers/dos/vesa.c b/src/mesa/drivers/dos/vesa.c index cb8c29dfc71..ea5bcb7a86e 100644 --- a/src/mesa/drivers/dos/vesa.c +++ b/src/mesa/drivers/dos/vesa.c @@ -1,533 +1,533 @@ -/* - * Mesa 3-D graphics library - * Version: 4.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. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "video.h" -#include "vesa.h" - - - -static vl_mode modes[128]; - -static word16 vesa_ver; -static int banked_selector, linear_selector; -static int oldmode = -1; - -static int vesa_color_precision = 6; - -static word16 *vesa_pmcode; -unsigned int vesa_gran_mask, vesa_gran_shift; - - - -/* - * VESA info - */ -#define V_SIGN 0 -#define V_MINOR 4 -#define V_MAJOR 5 -#define V_OEM_OFS 6 -#define V_OEM_SEG 8 -#define V_MODE_OFS 14 -#define V_MODE_SEG 16 -#define V_MEMORY 18 - -/* - * mode info - */ -#define M_ATTR 0 -#define M_GRAN 4 -#define M_SCANLEN 16 -#define M_XRES 18 -#define M_YRES 20 -#define M_BPP 25 -#define M_RED 31 -#define M_GREEN 33 -#define M_BLUE 35 -#define M_PHYS_PTR 40 - -/* - * VESA 3.0 CRTC timings structure - */ -typedef struct CRTCInfoBlock { - unsigned short HorizontalTotal; - unsigned short HorizontalSyncStart; - unsigned short HorizontalSyncEnd; - unsigned short VerticalTotal; - unsigned short VerticalSyncStart; - unsigned short VerticalSyncEnd; - unsigned char Flags; - unsigned long PixelClock; /* units of Hz */ - unsigned short RefreshRate; /* units of 0.01 Hz */ - unsigned char reserved[40]; -} __PACKED__ CRTCInfoBlock; - -#define HNEG (1 << 2) -#define VNEG (1 << 3) -#define DOUBLESCAN (1 << 0) - - - -/* Desc: Attempts to detect VESA, check video modes and create selectors. - * - * In : - - * Out : mode array - * - * Note: - - */ -static vl_mode *vesa_init (void) -{ - __dpmi_regs r; - word16 *p; - vl_mode *q; - char vesa_info[512], tmp[512]; - int maxsize = 0; - word32 linearfb = 0; - - if (vesa_ver) { - return modes; - } - - _farpokel(_stubinfo->ds_selector, 0, 0x32454256); - r.x.ax = 0x4f00; - r.x.di = 0; - r.x.es = _stubinfo->ds_segment; - __dpmi_int(0x10, &r); - movedata(_stubinfo->ds_selector, 0, _my_ds(), (unsigned)vesa_info, 512); - if ((r.x.ax!=0x004f) || ((_32_ vesa_info[V_SIGN])!=0x41534556)) { - return NULL; - } - - p = (word16 *)(((_16_ vesa_info[V_MODE_SEG])<<4) + (_16_ vesa_info[V_MODE_OFS])); - q = modes; - do { - if ((q->mode=_farpeekw(__djgpp_dos_sel, (unsigned long)(p++)))==0xffff) { - break; - } - - r.x.ax = 0x4f01; - r.x.cx = q->mode; - r.x.di = 512; - r.x.es = _stubinfo->ds_segment; - __dpmi_int(0x10, &r); - movedata(_stubinfo->ds_selector, 512, _my_ds(), (unsigned)tmp, 256); - switch (tmp[M_BPP]) { - case 16: - q->bpp = tmp[M_RED] + tmp[M_GREEN] + tmp[M_BLUE]; - break; - case 8: - case 15: - case 24: - case 32: - q->bpp = tmp[M_BPP]; - break; - default: - q->bpp = 0; - } - if ((r.x.ax==0x004f) && ((tmp[M_ATTR]&0x11)==0x11) && q->bpp) { - q->xres = _16_ tmp[M_XRES]; - q->yres = _16_ tmp[M_YRES]; - q->scanlen = _16_ tmp[M_SCANLEN]; - q->gran = (_16_ tmp[M_GRAN])<<10; - if (tmp[M_ATTR]&0x80) { -#if 0 - *(q+1) = *q++; -#else - vl_mode *q1 = q + 1; - *q1 = *q++; -#endif - linearfb = _32_ tmp[M_PHYS_PTR]; - q->mode |= 0x4000; - } - if (maxsize<(q->scanlen*q->yres)) { - maxsize = q->scanlen*q->yres; - } - q++; - } - } while (TRUE); - - if (q==modes) { - return NULL; - } - if (linearfb) { - maxsize = ((maxsize+0xfffUL)&~0xfffUL); - if (_create_selector(&linear_selector, linearfb, maxsize)) { - return NULL; - } - } - if (_create_selector(&banked_selector, 0xa0000, modes[0].gran)) { - _remove_selector(&linear_selector); - return NULL; - } - - for (q=modes; q->mode!=0xffff; q++) { - q->sel = (q->mode&0x4000) ? linear_selector : banked_selector; - } - - if (vesa_info[V_MAJOR] >= 2) { - r.x.ax = 0x4f0a; - r.x.bx = 0; - __dpmi_int(0x10, &r); - if (r.x.ax == 0x004f) { - vesa_pmcode = (word16 *)malloc(r.x.cx); - movedata(__djgpp_dos_sel, (r.x.es << 4) + r.x.di, _my_ds(), (unsigned)vesa_pmcode, r.x.cx); - if (vesa_pmcode[3]) { - p = (word16 *)((long)vesa_pmcode + vesa_pmcode[3]); - while (*p++ != 0xffff) ; - } else { - p = NULL; - } - if (p && (*p != 0xffff)) { - free(vesa_pmcode); - vesa_pmcode = NULL; - } else { - vesa_swbank = (void *)((long)vesa_pmcode + vesa_pmcode[0]); - } - } - } - - vesa_ver = _16_ vesa_info[V_MINOR]; - return modes; -} - - - -/* Desc: Frees all resources allocated by VESA init code. - * - * In : - - * Out : - - * - * Note: - - */ -static void vesa_fini (void) -{ - if (vesa_ver) { - _remove_selector(&linear_selector); - _remove_selector(&banked_selector); - if (vesa_pmcode != NULL) { - free(vesa_pmcode); - vesa_pmcode = NULL; - } - } -} - - - -/* Desc: Uses VESA 3.0 function 0x4F0B to find the closest pixel clock to the requested value. - * - * In : mode, clock - * Out : desired clock - * - * Note: - - */ -static unsigned long _closest_pixclk (int mode_no, unsigned long vclk) -{ - __dpmi_regs r; - - r.x.ax = 0x4F0B; - r.h.bl = 0; - r.d.ecx = vclk; - r.x.dx = mode_no; - __dpmi_int(0x10, &r); - - return (r.x.ax==0x004f) ? r.d.ecx : 0; -} - - - -/* Desc: Calculates CRTC mode timings. - * - * In : crtc block, geometry, adjust - * Out : - * - * Note: - */ -static void _crtc_timing (CRTCInfoBlock *crtc, int xres, int yres, int xadjust, int yadjust) -{ - int HTotal, VTotal; - int HDisp, VDisp; - int HSS, VSS; - int HSE, VSE; - int HSWidth, VSWidth; - int SS, SE; - int doublescan = FALSE; - - if (yres < 400) { - doublescan = TRUE; - yres *= 2; - } - - HDisp = xres; - HTotal = (int)(HDisp * 1.27) & ~0x7; - HSWidth = (int)((HTotal - HDisp) / 5) & ~0x7; - HSS = HDisp + 16; - HSE = HSS + HSWidth; - VDisp = yres; - VTotal = VDisp * 1.07; - VSWidth = (VTotal / 100) + 1; - VSS = VDisp + ((int)(VTotal - VDisp) / 5) + 1; - VSE = VSS + VSWidth; - - SS = HSS + xadjust; - SE = HSE + xadjust; - - if (xadjust < 0) { - if (SS < (HDisp + 8)) { - SS = HDisp + 8; - SE = SS + HSWidth; - } - } else { - if ((HTotal - 24) < SE) { - SE = HTotal - 24; - SS = SE - HSWidth; - } - } - - HSS = SS; - HSE = SE; - - SS = VSS + yadjust; - SE = VSE + yadjust; - - if (yadjust < 0) { - if (SS < (VDisp + 3)) { - SS = VDisp + 3; - SE = SS + VSWidth; - } - } else { - if ((VTotal - 4) < SE) { - SE = VTotal - 4; - SS = SE - VSWidth; - } - } - - VSS = SS; - VSE = SE; - - crtc->HorizontalTotal = HTotal; - crtc->HorizontalSyncStart = HSS; - crtc->HorizontalSyncEnd = HSE; - crtc->VerticalTotal = VTotal; - crtc->VerticalSyncStart = VSS; - crtc->VerticalSyncEnd = VSE; - crtc->Flags = HNEG | VNEG; - - if (doublescan) - crtc->Flags |= DOUBLESCAN; -} - - - -/* Desc: Attempts to enter specified video mode. - * - * In : ptr to mode structure, refresh rate - * Out : 0 if success - * - * Note: - - */ -static int vesa_entermode (vl_mode *p, int refresh) -{ - __dpmi_regs r; - - if (p->mode & 0x4000) { - VESA.blit = _can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual; - } else { - VESA.blit = vesa_b_dump_virtual; - { int n; for (vesa_gran_shift=0, n=p->gran; n; vesa_gran_shift++, n>>=1) ; } - vesa_gran_mask = (1<<(--vesa_gran_shift)) - 1; - if ((unsigned)p->gran != (vesa_gran_mask+1)) { - return !0; - } - } - - if (oldmode == -1) { - r.x.ax = 0x4f03; - __dpmi_int(0x10, &r); - oldmode = r.x.bx; - } - - r.x.ax = 0x4f02; - r.x.bx = p->mode; - - if (refresh && ((vesa_ver>>8) >= 3)) { - /* VESA 3.0 stuff for controlling the refresh rate */ - CRTCInfoBlock crtc; - unsigned long vclk; - double f0; - - _crtc_timing(&crtc, p->xres, p->yres, 0, 0); - - vclk = (double)crtc.HorizontalTotal * crtc.VerticalTotal * refresh; - vclk = _closest_pixclk(p->mode, vclk); - - if (vclk != 0) { - f0 = (double)vclk / (crtc.HorizontalTotal * crtc.VerticalTotal); - /*_current_refresh_rate = (int)(f0 + 0.5);*/ - - crtc.PixelClock = vclk; - crtc.RefreshRate = refresh * 100; - - movedata(_my_ds(), (unsigned)&crtc, _stubinfo->ds_selector, 0, sizeof(crtc)); - - r.x.di = 0; - r.x.es = _stubinfo->ds_segment; - r.x.bx |= 0x0800; - } - } - - __dpmi_int(0x10, &r); - if (r.x.ax != 0x004f) { - return !0; - } - - if (p->bpp == 8) { - r.x.ax = 0x4f08; - r.x.bx = 0x0800; - __dpmi_int(0x10, &r); - if (r.x.ax == 0x004f) { - r.x.ax = 0x4f08; - r.h.bl = 0x01; - __dpmi_int(0x10, &r); - vesa_color_precision = r.h.bh; - } - } - - return 0; -} - - - -/* Desc: Restores to the mode prior to first call to vesa_entermode. - * - * In : - - * Out : - - * - * Note: - - */ -static void vesa_restore (void) -{ - __dpmi_regs r; - - if (oldmode != -1) { - r.x.ax = 0x4f02; - r.x.bx = oldmode; - __dpmi_int(0x10, &r); - } -} - - - -/* Desc: set one palette entry - * - * In : color index, R, G, B - * Out : - - * - * Note: uses integer values - */ -static void vesa_setCI_i (int index, int red, int green, int blue) -{ -#if 0 - __asm("\n\ - movw $0x1010, %%ax \n\ - movb %1, %%dh \n\ - movb %2, %%ch \n\ - int $0x10 \n\ - "::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); -#else - outportb(0x03C8, index); - outportb(0x03C9, red); - outportb(0x03C9, green); - outportb(0x03C9, blue); -#endif -} - - - -/* Desc: set one palette entry - * - * In : color index, R, G, B - * Out : - - * - * Note: uses normalized values - */ -static void vesa_setCI_f (int index, float red, float green, float blue) -{ - float max = (1 << vesa_color_precision) - 1; - - vesa_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); -} - - - -/* Desc: state retrieval - * - * In : parameter name, ptr to storage - * Out : 0 if request successfully processed - * - * Note: - - */ -static int vesa_get (int pname, int *params) -{ - switch (pname) { - case VL_GET_CI_PREC: - params[0] = vesa_color_precision; - break; - default: - return -1; - } - return 0; -} - - - -/* - * the driver - */ -vl_driver VESA = { - vesa_init, - vesa_entermode, - NULL, - vesa_setCI_f, - vesa_setCI_i, - vesa_get, - vesa_restore, - vesa_fini -}; +/* + * Mesa 3-D graphics library + * Version: 4.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. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "video.h" +#include "vesa.h" + + + +static vl_mode modes[128]; + +static word16 vesa_ver; +static int banked_selector, linear_selector; +static int oldmode = -1; + +static int vesa_color_precision = 6; + +static word16 *vesa_pmcode; +unsigned int vesa_gran_mask, vesa_gran_shift; + + + +/* + * VESA info + */ +#define V_SIGN 0 +#define V_MINOR 4 +#define V_MAJOR 5 +#define V_OEM_OFS 6 +#define V_OEM_SEG 8 +#define V_MODE_OFS 14 +#define V_MODE_SEG 16 +#define V_MEMORY 18 + +/* + * mode info + */ +#define M_ATTR 0 +#define M_GRAN 4 +#define M_SCANLEN 16 +#define M_XRES 18 +#define M_YRES 20 +#define M_BPP 25 +#define M_RED 31 +#define M_GREEN 33 +#define M_BLUE 35 +#define M_PHYS_PTR 40 + +/* + * VESA 3.0 CRTC timings structure + */ +typedef struct CRTCInfoBlock { + unsigned short HorizontalTotal; + unsigned short HorizontalSyncStart; + unsigned short HorizontalSyncEnd; + unsigned short VerticalTotal; + unsigned short VerticalSyncStart; + unsigned short VerticalSyncEnd; + unsigned char Flags; + unsigned long PixelClock; /* units of Hz */ + unsigned short RefreshRate; /* units of 0.01 Hz */ + unsigned char reserved[40]; +} __PACKED__ CRTCInfoBlock; + +#define HNEG (1 << 2) +#define VNEG (1 << 3) +#define DOUBLESCAN (1 << 0) + + + +/* Desc: Attempts to detect VESA, check video modes and create selectors. + * + * In : - + * Out : mode array + * + * Note: - + */ +static vl_mode *vesa_init (void) +{ + __dpmi_regs r; + word16 *p; + vl_mode *q; + char vesa_info[512], tmp[512]; + int maxsize = 0; + word32 linearfb = 0; + + if (vesa_ver) { + return modes; + } + + _farpokel(_stubinfo->ds_selector, 0, 0x32454256); + r.x.ax = 0x4f00; + r.x.di = 0; + r.x.es = _stubinfo->ds_segment; + __dpmi_int(0x10, &r); + movedata(_stubinfo->ds_selector, 0, _my_ds(), (unsigned)vesa_info, 512); + if ((r.x.ax!=0x004f) || ((_32_ vesa_info[V_SIGN])!=0x41534556)) { + return NULL; + } + + p = (word16 *)(((_16_ vesa_info[V_MODE_SEG])<<4) + (_16_ vesa_info[V_MODE_OFS])); + q = modes; + do { + if ((q->mode=_farpeekw(__djgpp_dos_sel, (unsigned long)(p++)))==0xffff) { + break; + } + + r.x.ax = 0x4f01; + r.x.cx = q->mode; + r.x.di = 512; + r.x.es = _stubinfo->ds_segment; + __dpmi_int(0x10, &r); + movedata(_stubinfo->ds_selector, 512, _my_ds(), (unsigned)tmp, 256); + switch (tmp[M_BPP]) { + case 16: + q->bpp = tmp[M_RED] + tmp[M_GREEN] + tmp[M_BLUE]; + break; + case 8: + case 15: + case 24: + case 32: + q->bpp = tmp[M_BPP]; + break; + default: + q->bpp = 0; + } + if ((r.x.ax==0x004f) && ((tmp[M_ATTR]&0x11)==0x11) && q->bpp) { + q->xres = _16_ tmp[M_XRES]; + q->yres = _16_ tmp[M_YRES]; + q->scanlen = _16_ tmp[M_SCANLEN]; + q->gran = (_16_ tmp[M_GRAN])<<10; + if (tmp[M_ATTR]&0x80) { +#if 0 + *(q+1) = *q++; +#else + vl_mode *q1 = q + 1; + *q1 = *q++; +#endif + linearfb = _32_ tmp[M_PHYS_PTR]; + q->mode |= 0x4000; + } + if (maxsize<(q->scanlen*q->yres)) { + maxsize = q->scanlen*q->yres; + } + q++; + } + } while (TRUE); + + if (q==modes) { + return NULL; + } + if (linearfb) { + maxsize = ((maxsize+0xfffUL)&~0xfffUL); + if (_create_selector(&linear_selector, linearfb, maxsize)) { + return NULL; + } + } + if (_create_selector(&banked_selector, 0xa0000, modes[0].gran)) { + _remove_selector(&linear_selector); + return NULL; + } + + for (q=modes; q->mode!=0xffff; q++) { + q->sel = (q->mode&0x4000) ? linear_selector : banked_selector; + } + + if (vesa_info[V_MAJOR] >= 2) { + r.x.ax = 0x4f0a; + r.x.bx = 0; + __dpmi_int(0x10, &r); + if (r.x.ax == 0x004f) { + vesa_pmcode = (word16 *)malloc(r.x.cx); + movedata(__djgpp_dos_sel, (r.x.es << 4) + r.x.di, _my_ds(), (unsigned)vesa_pmcode, r.x.cx); + if (vesa_pmcode[3]) { + p = (word16 *)((long)vesa_pmcode + vesa_pmcode[3]); + while (*p++ != 0xffff) ; + } else { + p = NULL; + } + if (p && (*p != 0xffff)) { + free(vesa_pmcode); + vesa_pmcode = NULL; + } else { + vesa_swbank = (void *)((long)vesa_pmcode + vesa_pmcode[0]); + } + } + } + + vesa_ver = _16_ vesa_info[V_MINOR]; + return modes; +} + + + +/* Desc: Frees all resources allocated by VESA init code. + * + * In : - + * Out : - + * + * Note: - + */ +static void vesa_fini (void) +{ + if (vesa_ver) { + _remove_selector(&linear_selector); + _remove_selector(&banked_selector); + if (vesa_pmcode != NULL) { + free(vesa_pmcode); + vesa_pmcode = NULL; + } + } +} + + + +/* Desc: Uses VESA 3.0 function 0x4F0B to find the closest pixel clock to the requested value. + * + * In : mode, clock + * Out : desired clock + * + * Note: - + */ +static unsigned long _closest_pixclk (int mode_no, unsigned long vclk) +{ + __dpmi_regs r; + + r.x.ax = 0x4F0B; + r.h.bl = 0; + r.d.ecx = vclk; + r.x.dx = mode_no; + __dpmi_int(0x10, &r); + + return (r.x.ax==0x004f) ? r.d.ecx : 0; +} + + + +/* Desc: Calculates CRTC mode timings. + * + * In : crtc block, geometry, adjust + * Out : + * + * Note: + */ +static void _crtc_timing (CRTCInfoBlock *crtc, int xres, int yres, int xadjust, int yadjust) +{ + int HTotal, VTotal; + int HDisp, VDisp; + int HSS, VSS; + int HSE, VSE; + int HSWidth, VSWidth; + int SS, SE; + int doublescan = FALSE; + + if (yres < 400) { + doublescan = TRUE; + yres *= 2; + } + + HDisp = xres; + HTotal = (int)(HDisp * 1.27) & ~0x7; + HSWidth = (int)((HTotal - HDisp) / 5) & ~0x7; + HSS = HDisp + 16; + HSE = HSS + HSWidth; + VDisp = yres; + VTotal = VDisp * 1.07; + VSWidth = (VTotal / 100) + 1; + VSS = VDisp + ((int)(VTotal - VDisp) / 5) + 1; + VSE = VSS + VSWidth; + + SS = HSS + xadjust; + SE = HSE + xadjust; + + if (xadjust < 0) { + if (SS < (HDisp + 8)) { + SS = HDisp + 8; + SE = SS + HSWidth; + } + } else { + if ((HTotal - 24) < SE) { + SE = HTotal - 24; + SS = SE - HSWidth; + } + } + + HSS = SS; + HSE = SE; + + SS = VSS + yadjust; + SE = VSE + yadjust; + + if (yadjust < 0) { + if (SS < (VDisp + 3)) { + SS = VDisp + 3; + SE = SS + VSWidth; + } + } else { + if ((VTotal - 4) < SE) { + SE = VTotal - 4; + SS = SE - VSWidth; + } + } + + VSS = SS; + VSE = SE; + + crtc->HorizontalTotal = HTotal; + crtc->HorizontalSyncStart = HSS; + crtc->HorizontalSyncEnd = HSE; + crtc->VerticalTotal = VTotal; + crtc->VerticalSyncStart = VSS; + crtc->VerticalSyncEnd = VSE; + crtc->Flags = HNEG | VNEG; + + if (doublescan) + crtc->Flags |= DOUBLESCAN; +} + + + +/* Desc: Attempts to enter specified video mode. + * + * In : ptr to mode structure, refresh rate + * Out : 0 if success + * + * Note: - + */ +static int vesa_entermode (vl_mode *p, int refresh) +{ + __dpmi_regs r; + + if (p->mode & 0x4000) { + VESA.blit = _can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual; + } else { + VESA.blit = vesa_b_dump_virtual; + { int n; for (vesa_gran_shift=0, n=p->gran; n; vesa_gran_shift++, n>>=1) ; } + vesa_gran_mask = (1<<(--vesa_gran_shift)) - 1; + if ((unsigned)p->gran != (vesa_gran_mask+1)) { + return !0; + } + } + + if (oldmode == -1) { + r.x.ax = 0x4f03; + __dpmi_int(0x10, &r); + oldmode = r.x.bx; + } + + r.x.ax = 0x4f02; + r.x.bx = p->mode; + + if (refresh && ((vesa_ver>>8) >= 3)) { + /* VESA 3.0 stuff for controlling the refresh rate */ + CRTCInfoBlock crtc; + unsigned long vclk; + double f0; + + _crtc_timing(&crtc, p->xres, p->yres, 0, 0); + + vclk = (double)crtc.HorizontalTotal * crtc.VerticalTotal * refresh; + vclk = _closest_pixclk(p->mode, vclk); + + if (vclk != 0) { + f0 = (double)vclk / (crtc.HorizontalTotal * crtc.VerticalTotal); + /*_current_refresh_rate = (int)(f0 + 0.5);*/ + + crtc.PixelClock = vclk; + crtc.RefreshRate = refresh * 100; + + movedata(_my_ds(), (unsigned)&crtc, _stubinfo->ds_selector, 0, sizeof(crtc)); + + r.x.di = 0; + r.x.es = _stubinfo->ds_segment; + r.x.bx |= 0x0800; + } + } + + __dpmi_int(0x10, &r); + if (r.x.ax != 0x004f) { + return !0; + } + + if (p->bpp == 8) { + r.x.ax = 0x4f08; + r.x.bx = 0x0800; + __dpmi_int(0x10, &r); + if (r.x.ax == 0x004f) { + r.x.ax = 0x4f08; + r.h.bl = 0x01; + __dpmi_int(0x10, &r); + vesa_color_precision = r.h.bh; + } + } + + return 0; +} + + + +/* Desc: Restores to the mode prior to first call to vesa_entermode. + * + * In : - + * Out : - + * + * Note: - + */ +static void vesa_restore (void) +{ + __dpmi_regs r; + + if (oldmode != -1) { + r.x.ax = 0x4f02; + r.x.bx = oldmode; + __dpmi_int(0x10, &r); + } +} + + + +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses integer values + */ +static void vesa_setCI_i (int index, int red, int green, int blue) +{ +#if 0 + __asm("\n\ + movw $0x1010, %%ax \n\ + movb %1, %%dh \n\ + movb %2, %%ch \n\ + int $0x10 \n\ + "::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); +#else + outportb(0x03C8, index); + outportb(0x03C9, red); + outportb(0x03C9, green); + outportb(0x03C9, blue); +#endif +} + + + +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses normalized values + */ +static void vesa_setCI_f (int index, float red, float green, float blue) +{ + float max = (1 << vesa_color_precision) - 1; + + vesa_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); +} + + + +/* Desc: state retrieval + * + * In : parameter name, ptr to storage + * Out : 0 if request successfully processed + * + * Note: - + */ +static int vesa_get (int pname, int *params) +{ + switch (pname) { + case VL_GET_CI_PREC: + params[0] = vesa_color_precision; + break; + default: + return -1; + } + return 0; +} + + + +/* + * the driver + */ +vl_driver VESA = { + vesa_init, + vesa_entermode, + NULL, + vesa_setCI_f, + vesa_setCI_i, + vesa_get, + vesa_restore, + vesa_fini +}; diff --git a/src/mesa/drivers/dos/vesa.h b/src/mesa/drivers/dos/vesa.h index 030c816f080..9287697c370 100644 --- a/src/mesa/drivers/dos/vesa.h +++ b/src/mesa/drivers/dos/vesa.h @@ -1,47 +1,47 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef VESA_H_included -#define VESA_H_included - -#include "internal.h" - -extern void *vesa_swbank; - -extern void vesa_b_dump_virtual (void); -extern void vesa_l_dump_virtual (void); -extern void vesa_l_dump_virtual_mmx (void); - -extern vl_driver VESA; - -#endif +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef VESA_H_included +#define VESA_H_included + +#include "internal.h" + +extern void *vesa_swbank; + +extern void vesa_b_dump_virtual (void); +extern void vesa_l_dump_virtual (void); +extern void vesa_l_dump_virtual_mmx (void); + +extern vl_driver VESA; + +#endif diff --git a/src/mesa/drivers/dos/vga.c b/src/mesa/drivers/dos/vga.c index 4fe8773243f..9de32f0cd5e 100644 --- a/src/mesa/drivers/dos/vga.c +++ b/src/mesa/drivers/dos/vga.c @@ -1,235 +1,235 @@ -/* - * Mesa 3-D graphics library - * Version: 4.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. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include -#include - -#include "video.h" -#include "vga.h" - - - -static vl_mode modes[] = { - {0x13 | 0x4000, 320, 200, 320, 8, -1, 320*200}, - {0xffff, -1, -1, -1, -1, -1, -1} -}; - -static word16 vga_ver; -static int linear_selector; -static int oldmode = -1; - -#define vga_color_precision 6 - - - -/* Desc: Attempts to detect VGA, check video modes and create selectors. - * - * In : - - * Out : mode array - * - * Note: - - */ -static vl_mode *vga_init (void) -{ - int rv = 0; - - if (vga_ver) { - return modes; - } - - __asm("\n\ - movw $0x1a00, %%ax \n\ - int $0x10 \n\ - cmpb $0x1a, %%al \n\ - jne 0f \n\ - cmpb $0x07, %%bl \n\ - jb 0f \n\ - andl $0xff, %%ebx \n\ - movl %%ebx, %0 \n\ - 0:":"=g"(rv)::"%eax", "%ebx"); - if (rv == 0) { - return NULL; - } - - if (_create_selector(&linear_selector, 0xa0000, 0x10000)) { - return NULL; - } - - modes[0].sel = linear_selector; - - vga_ver = rv; - return modes; -} - - - -/* Desc: Frees all resources allocated by VGA init code. - * - * In : - - * Out : - - * - * Note: - - */ -static void vga_fini (void) -{ - if (vga_ver) { - _remove_selector(&linear_selector); - } -} - - - -/* Desc: Attempts to enter specified video mode. - * - * In : ptr to mode structure, refresh rate - * Out : 0 if success - * - * Note: - - */ -static int vga_entermode (vl_mode *p, int refresh) -{ - if (!(p->mode & 0x4000)) { - return -1; - } - VGA.blit = _can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual; - - if (oldmode == -1) { - __asm("\n\ - movb $0x0f, %%ah \n\ - int $0x10 \n\ - andl $0xff, %%eax \n\ - movl %%eax, %0 \n\ - ":"=g"(oldmode)::"%eax", "%ebx"); - } - - __asm("int $0x10"::"a"(p->mode&0xff)); - - return 0; - - (void)refresh; /* silence compiler warning */ -} - - - -/* Desc: Restores to the mode prior to first call to vga_entermode. - * - * In : - - * Out : - - * - * Note: - - */ -static void vga_restore (void) -{ - if (oldmode != -1) { - __asm("int $0x10"::"a"(oldmode)); - } -} - - - -/* Desc: set one palette entry - * - * In : color index, R, G, B - * Out : - - * - * Note: uses integer values - */ -static void vga_setCI_i (int index, int red, int green, int blue) -{ -#if 0 - __asm("\n\ - movw $0x1010, %%ax \n\ - movb %1, %%dh \n\ - movb %2, %%ch \n\ - int $0x10 \n\ - "::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); -#else - outportb(0x03C8, index); - outportb(0x03C9, red); - outportb(0x03C9, green); - outportb(0x03C9, blue); -#endif -} - - - -/* Desc: set one palette entry - * - * In : color index, R, G, B - * Out : - - * - * Note: uses normalized values - */ -static void vga_setCI_f (int index, float red, float green, float blue) -{ - float max = (1 << vga_color_precision) - 1; - - vga_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); -} - - - -/* Desc: state retrieval - * - * In : parameter name, ptr to storage - * Out : 0 if request successfully processed - * - * Note: - - */ -static int vga_get (int pname, int *params) -{ - switch (pname) { - case VL_GET_CI_PREC: - params[0] = vga_color_precision; - break; - default: - return -1; - } - return 0; -} - - - -/* - * the driver - */ -vl_driver VGA = { - vga_init, - vga_entermode, - NULL, - vga_setCI_f, - vga_setCI_i, - vga_get, - vga_restore, - vga_fini -}; +/* + * Mesa 3-D graphics library + * Version: 4.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. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#include +#include + +#include "video.h" +#include "vga.h" + + + +static vl_mode modes[] = { + {0x13 | 0x4000, 320, 200, 320, 8, -1, 320*200}, + {0xffff, -1, -1, -1, -1, -1, -1} +}; + +static word16 vga_ver; +static int linear_selector; +static int oldmode = -1; + +#define vga_color_precision 6 + + + +/* Desc: Attempts to detect VGA, check video modes and create selectors. + * + * In : - + * Out : mode array + * + * Note: - + */ +static vl_mode *vga_init (void) +{ + int rv = 0; + + if (vga_ver) { + return modes; + } + + __asm("\n\ + movw $0x1a00, %%ax \n\ + int $0x10 \n\ + cmpb $0x1a, %%al \n\ + jne 0f \n\ + cmpb $0x07, %%bl \n\ + jb 0f \n\ + andl $0xff, %%ebx \n\ + movl %%ebx, %0 \n\ + 0:":"=g"(rv)::"%eax", "%ebx"); + if (rv == 0) { + return NULL; + } + + if (_create_selector(&linear_selector, 0xa0000, 0x10000)) { + return NULL; + } + + modes[0].sel = linear_selector; + + vga_ver = rv; + return modes; +} + + + +/* Desc: Frees all resources allocated by VGA init code. + * + * In : - + * Out : - + * + * Note: - + */ +static void vga_fini (void) +{ + if (vga_ver) { + _remove_selector(&linear_selector); + } +} + + + +/* Desc: Attempts to enter specified video mode. + * + * In : ptr to mode structure, refresh rate + * Out : 0 if success + * + * Note: - + */ +static int vga_entermode (vl_mode *p, int refresh) +{ + if (!(p->mode & 0x4000)) { + return -1; + } + VGA.blit = _can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual; + + if (oldmode == -1) { + __asm("\n\ + movb $0x0f, %%ah \n\ + int $0x10 \n\ + andl $0xff, %%eax \n\ + movl %%eax, %0 \n\ + ":"=g"(oldmode)::"%eax", "%ebx"); + } + + __asm("int $0x10"::"a"(p->mode&0xff)); + + return 0; + + (void)refresh; /* silence compiler warning */ +} + + + +/* Desc: Restores to the mode prior to first call to vga_entermode. + * + * In : - + * Out : - + * + * Note: - + */ +static void vga_restore (void) +{ + if (oldmode != -1) { + __asm("int $0x10"::"a"(oldmode)); + } +} + + + +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses integer values + */ +static void vga_setCI_i (int index, int red, int green, int blue) +{ +#if 0 + __asm("\n\ + movw $0x1010, %%ax \n\ + movb %1, %%dh \n\ + movb %2, %%ch \n\ + int $0x10 \n\ + "::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); +#else + outportb(0x03C8, index); + outportb(0x03C9, red); + outportb(0x03C9, green); + outportb(0x03C9, blue); +#endif +} + + + +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses normalized values + */ +static void vga_setCI_f (int index, float red, float green, float blue) +{ + float max = (1 << vga_color_precision) - 1; + + vga_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); +} + + + +/* Desc: state retrieval + * + * In : parameter name, ptr to storage + * Out : 0 if request successfully processed + * + * Note: - + */ +static int vga_get (int pname, int *params) +{ + switch (pname) { + case VL_GET_CI_PREC: + params[0] = vga_color_precision; + break; + default: + return -1; + } + return 0; +} + + + +/* + * the driver + */ +vl_driver VGA = { + vga_init, + vga_entermode, + NULL, + vga_setCI_f, + vga_setCI_i, + vga_get, + vga_restore, + vga_fini +}; diff --git a/src/mesa/drivers/dos/vga.h b/src/mesa/drivers/dos/vga.h index f1bc62bbe73..aeb8faddaed 100644 --- a/src/mesa/drivers/dos/vga.h +++ b/src/mesa/drivers/dos/vga.h @@ -1,42 +1,42 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef VGA_H_included -#define VGA_H_included - -#include "internal.h" -#include "vesa.h" - -extern vl_driver VGA; - -#endif +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef VGA_H_included +#define VGA_H_included + +#include "internal.h" +#include "vesa.h" + +extern vl_driver VGA; + +#endif diff --git a/src/mesa/drivers/dos/video.c b/src/mesa/drivers/dos/video.c index 297c9d56624..a2524e052c2 100644 --- a/src/mesa/drivers/dos/video.c +++ b/src/mesa/drivers/dos/video.c @@ -1,525 +1,525 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - * - * Thanks to CrazyPyro (Neil Funk) for FakeColor - */ - - -#include - -#include "internal.h" -#include "vesa.h" -#include "vga.h" -#include "video.h" - - - -static vl_driver *drv; -/* based upon mode specific data: valid entire session */ -int vl_video_selector; -static vl_mode *video_mode; -static int video_scanlen, video_bypp; -/* valid until next buffer */ -void *vl_current_draw_buffer, *vl_current_read_buffer; -int vl_current_stride, vl_current_width, vl_current_height, vl_current_bytes; -int vl_current_offset, vl_current_delta; - - - -/* lookup table for scaling 5 bit colors up to 8 bits */ -static int _rgb_scale_5[32] = { - 0, 8, 16, 25, 33, 41, 49, 58, - 66, 74, 82, 90, 99, 107, 115, 123, - 132, 140, 148, 156, 165, 173, 181, 189, - 197, 206, 214, 222, 230, 239, 247, 255 -}; - -/* lookup table for scaling 6 bit colors up to 8 bits */ -static int _rgb_scale_6[64] = { - 0, 4, 8, 12, 16, 20, 24, 28, - 32, 36, 40, 45, 49, 53, 57, 61, - 65, 69, 73, 77, 81, 85, 89, 93, - 97, 101, 105, 109, 113, 117, 121, 125, - 130, 134, 138, 142, 146, 150, 154, 158, - 162, 166, 170, 174, 178, 182, 186, 190, - 194, 198, 202, 206, 210, 215, 219, 223, - 227, 231, 235, 239, 243, 247, 251, 255 -}; - -/* FakeColor data */ -#define R_CNT 6 -#define G_CNT 6 -#define B_CNT 6 - -#define R_BIAS 7 -#define G_BIAS 7 -#define B_BIAS 7 - -static word32 VGAPalette[256]; -static word8 array_r[256]; -static word8 array_g[256]; -static word8 array_b[256]; - - - -int (*vl_mixfix) (fixed r, fixed g, fixed b); -int (*vl_mixrgb) (const unsigned char rgb[]); -int (*vl_mixrgba) (const unsigned char rgba[]); -void (*vl_getrgba) (unsigned int offset, unsigned char rgba[4]); -int (*vl_getpixel) (unsigned int offset); -void (*vl_clear) (int color); -void (*vl_rect) (int x, int y, int width, int height, int color); -void (*vl_flip) (void); -void (*vl_putpixel) (unsigned int offset, int color); - - - -/* Desc: color composition (w/o ALPHA) - * - * In : R, G, B - * Out : color - * - * Note: - - */ -static int vl_mixfix8fake (fixed r, fixed g, fixed b) -{ - return array_b[b>>FIXED_SHIFT]*G_CNT*R_CNT - + array_g[g>>FIXED_SHIFT]*R_CNT - + array_r[r>>FIXED_SHIFT]; -} -#define vl_mixfix8 vl_mixfix8fake -static int vl_mixfix15 (fixed r, fixed g, fixed b) -{ - return ((r>>(3+FIXED_SHIFT))<<10) - |((g>>(3+FIXED_SHIFT))<<5) - |(b>>(3+FIXED_SHIFT)); -} -static int vl_mixfix16 (fixed r, fixed g, fixed b) -{ - return ((r>>(3+FIXED_SHIFT))<<11) - |((g>>(2+FIXED_SHIFT))<<5) - |(b>>(3+FIXED_SHIFT)); -} -#define vl_mixfix24 vl_mixfix32 -static int vl_mixfix32 (fixed r, fixed g, fixed b) -{ - return ((r>>FIXED_SHIFT)<<16) - |((g>>FIXED_SHIFT)<<8) - |(b>>FIXED_SHIFT); -} - - - -/* Desc: color composition (w/ ALPHA) - * - * In : array of integers (R, G, B, A) - * Out : color - * - * Note: - - */ -#define vl_mixrgba8 vl_mixrgb8fake -#define vl_mixrgba15 vl_mixrgb15 -#define vl_mixrgba16 vl_mixrgb16 -#define vl_mixrgba24 vl_mixrgb24 -static int vl_mixrgba32 (const unsigned char rgba[]) -{ - return (rgba[3]<<24)|(rgba[0]<<16)|(rgba[1]<<8)|(rgba[2]); -} - - - -/* Desc: color composition (w/o ALPHA) - * - * In : array of integers (R, G, B) - * Out : color - * - * Note: - - */ -static int vl_mixrgb8fake (const unsigned char rgba[]) -{ - return array_b[rgba[2]]*G_CNT*R_CNT - + array_g[rgba[1]]*R_CNT - + array_r[rgba[0]]; -} -#define vl_mixrgb8 vl_mixrgb8fake -static int vl_mixrgb15 (const unsigned char rgb[]) -{ - return ((rgb[0]>>3)<<10)|((rgb[1]>>3)<<5)|(rgb[2]>>3); -} -static int vl_mixrgb16 (const unsigned char rgb[]) -{ - return ((rgb[0]>>3)<<11)|((rgb[1]>>2)<<5)|(rgb[2]>>3); -} -#define vl_mixrgb24 vl_mixrgb32 -static int vl_mixrgb32 (const unsigned char rgb[]) -{ - return (rgb[0]<<16)|(rgb[1]<<8)|(rgb[2]); -} - - - -/* Desc: color decomposition - * - * In : pixel offset, array of integers to hold color components (R, G, B, A) - * Out : - - * - * Note: uses current read buffer - */ -static void v_getrgba8fake6 (unsigned int offset, unsigned char rgba[]) -{ - word32 c = VGAPalette[((word8 *)vl_current_read_buffer)[offset]]; - rgba[0] = _rgb_scale_6[(c >> 16) & 0x3F]; - rgba[1] = _rgb_scale_6[(c >> 8) & 0x3F]; - rgba[2] = _rgb_scale_6[c & 0x3F]; - rgba[3] = c >> 24; -} -static void v_getrgba8fake8 (unsigned int offset, unsigned char rgba[]) -{ - word32 c = VGAPalette[((word8 *)vl_current_read_buffer)[offset]]; - rgba[0] = c >> 16; - rgba[1] = c >> 8; - rgba[2] = c; - rgba[3] = c >> 24; -} -#define v_getrgba8 v_getrgba8fake6 -static void v_getrgba15 (unsigned int offset, unsigned char rgba[4]) -{ - word32 c = ((word16 *)vl_current_read_buffer)[offset]; - rgba[0] = _rgb_scale_5[(c >> 10) & 0x1F]; - rgba[1] = _rgb_scale_5[(c >> 5) & 0x1F]; - rgba[2] = _rgb_scale_5[c & 0x1F]; - rgba[3] = 255; -} -static void v_getrgba16 (unsigned int offset, unsigned char rgba[4]) -{ - word32 c = ((word16 *)vl_current_read_buffer)[offset]; - rgba[0] = _rgb_scale_5[(c >> 11) & 0x1F]; - rgba[1] = _rgb_scale_6[(c >> 5) & 0x3F]; - rgba[2] = _rgb_scale_5[c & 0x1F]; - rgba[3] = 255; -} -static void v_getrgba24 (unsigned int offset, unsigned char rgba[4]) -{ - word32 c = *(word32 *)((long)vl_current_read_buffer+offset*3); - rgba[0] = c >> 16; - rgba[1] = c >> 8; - rgba[2] = c; - rgba[3] = 255; -} -static void v_getrgba32 (unsigned int offset, unsigned char rgba[4]) -{ - word32 c = ((word32 *)vl_current_read_buffer)[offset]; - rgba[0] = c >> 16; - rgba[1] = c >> 8; - rgba[2] = c; - rgba[3] = c >> 24; -} - - - -/* Desc: pixel retrieval - * - * In : pixel offset - * Out : pixel value - * - * Note: uses current read buffer - */ -static int v_getpixel8 (unsigned int offset) -{ - return ((word8 *)vl_current_read_buffer)[offset]; -} -#define v_getpixel15 v_getpixel16 -static int v_getpixel16 (unsigned int offset) -{ - return ((word16 *)vl_current_read_buffer)[offset]; -} -static int v_getpixel24 (unsigned int offset) -{ - return *(word32 *)((long)vl_current_read_buffer+offset*3); -} -static int v_getpixel32 (unsigned int offset) -{ - return ((word32 *)vl_current_read_buffer)[offset]; -} - - - -/* Desc: set one palette entry - * - * In : index, R, G, B - * Out : - - * - * Note: color components are in range [0.0 .. 1.0] - */ -void vl_setCI (int index, float red, float green, float blue) -{ - drv->setCI_f(index, red, green, blue); -} - - - -/* Desc: set one palette entry - * - * In : color, R, G, B - * Out : - - * - * Note: - - */ -static void fake_setcolor (int c, int r, int g, int b) -{ - VGAPalette[c] = 0xff000000 | (r<<16) | (g<<8) | b; - - drv->setCI_i(c, r, g, b); -} - - - -/* Desc: build FakeColor palette - * - * In : CI precision in bits - * Out : - - * - * Note: - - */ -static void fake_buildpalette (int bits) -{ - double c_r, c_g, c_b; - int r, g, b, color = 0; - - double max = (1 << bits) - 1; - - for (b=0; b video_mode->xres) || (y+height > video_mode->yres)) { - return -1; - } else { - void *newbuf = *buffer; - - if ((newbuf == NULL) || (vl_current_width != width) || (vl_current_height != height)) { - newbuf = realloc(newbuf, width * height * video_bypp); - } - - if (newbuf == NULL) { - return -2; - } - - vl_current_width = width; - vl_current_height = height; - vl_current_stride = vl_current_width * video_bypp; - vl_current_bytes = vl_current_stride * height; - - vl_current_offset = video_scanlen * y + video_bypp * x; - vl_current_delta = video_scanlen - vl_current_stride; - - vl_current_draw_buffer = vl_current_read_buffer = *buffer = newbuf; - return 0; - } -} - - - -/* Desc: state retrieval - * - * In : name, storage - * Out : - - * - * Note: - - */ -int vl_get (int pname, int *params) -{ - switch (pname) { - case VL_GET_SCREEN_SIZE: - params[0] = video_mode->xres; - params[1] = video_mode->yres; - break; - default: - return drv->get(pname, params); - } - return 0; -} - - - -/* Desc: setup mode - * - * In : ptr to mode definition - * Out : 0 if success - * - * Note: - - */ -static int vl_setup_mode (vl_mode *p) -{ - if (p == NULL) { - return -1; - } - -#define INITPTR(bpp) \ - vl_putpixel = v_putpixel##bpp; \ - vl_getrgba = v_getrgba##bpp; \ - vl_getpixel = v_getpixel##bpp; \ - vl_rect = v_rect##bpp; \ - vl_mixfix = vl_mixfix##bpp; \ - vl_mixrgb = vl_mixrgb##bpp; \ - vl_mixrgba = vl_mixrgba##bpp; \ - vl_clear = _can_mmx() ? v_clear##bpp##_mmx : v_clear##bpp - - switch (p->bpp) { - case 8: - INITPTR(8); - break; - case 15: - INITPTR(15); - break; - case 16: - INITPTR(16); - break; - case 24: - INITPTR(24); - break; - case 32: - INITPTR(32); - break; - default: - return -1; - } - -#undef INITPTR - - video_mode = p; - video_bypp = (p->bpp+7)/8; - video_scanlen = p->scanlen; - vl_video_selector = p->sel; - - return 0; -} - - - -/* Desc: restore to the mode prior to first call to `vl_video_init'. - * - * In : - - * Out : - - * - * Note: - - */ -void vl_video_exit (void) -{ - drv->restore(); - drv->fini(); -} - - - -/* Desc: enter mode - * - * In : xres, yres, bits/pixel, RGB, refresh rate - * Out : pixel width in bits if success - * - * Note: - - */ -int vl_video_init (int width, int height, int bpp, int rgb, int refresh) -{ - int fake; - vl_mode *p, *q; - unsigned int min; - - fake = 0; - if (!rgb) { - bpp = 8; - } else if (bpp == 8) { - fake = 1; - } - - /* initialize hardware */ - drv = &VESA; - if ((q=drv->init()) == NULL) { - drv = &VGA; - if ((q=drv->init()) == NULL) { - return 0; - } - } - - /* search for a mode that fits our request */ - for (min=-1, p=NULL; q->mode!=0xffff; q++) { - if ((q->xres>=width) && (q->yres>=height) && (q->bpp==bpp)) { - if (min>=(unsigned)(q->xres*q->yres)) { - min = q->xres*q->yres; - p = q; - } - } - } - - /* setup and enter mode */ - if ((vl_setup_mode(p) == 0) && (drv->entermode(p, refresh) == 0)) { - vl_flip = drv->blit; - if (fake) { - drv->get(VL_GET_CI_PREC, (int *)(&min)); - fake_buildpalette(min); - if (min == 8) { - vl_getrgba = v_getrgba8fake8; - } - } - return bpp; - } - - /* abort */ - return 0; -} +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + * + * Thanks to CrazyPyro (Neil Funk) for FakeColor + */ + + +#include + +#include "internal.h" +#include "vesa.h" +#include "vga.h" +#include "video.h" + + + +static vl_driver *drv; +/* based upon mode specific data: valid entire session */ +int vl_video_selector; +static vl_mode *video_mode; +static int video_scanlen, video_bypp; +/* valid until next buffer */ +void *vl_current_draw_buffer, *vl_current_read_buffer; +int vl_current_stride, vl_current_width, vl_current_height, vl_current_bytes; +int vl_current_offset, vl_current_delta; + + + +/* lookup table for scaling 5 bit colors up to 8 bits */ +static int _rgb_scale_5[32] = { + 0, 8, 16, 25, 33, 41, 49, 58, + 66, 74, 82, 90, 99, 107, 115, 123, + 132, 140, 148, 156, 165, 173, 181, 189, + 197, 206, 214, 222, 230, 239, 247, 255 +}; + +/* lookup table for scaling 6 bit colors up to 8 bits */ +static int _rgb_scale_6[64] = { + 0, 4, 8, 12, 16, 20, 24, 28, + 32, 36, 40, 45, 49, 53, 57, 61, + 65, 69, 73, 77, 81, 85, 89, 93, + 97, 101, 105, 109, 113, 117, 121, 125, + 130, 134, 138, 142, 146, 150, 154, 158, + 162, 166, 170, 174, 178, 182, 186, 190, + 194, 198, 202, 206, 210, 215, 219, 223, + 227, 231, 235, 239, 243, 247, 251, 255 +}; + +/* FakeColor data */ +#define R_CNT 6 +#define G_CNT 6 +#define B_CNT 6 + +#define R_BIAS 7 +#define G_BIAS 7 +#define B_BIAS 7 + +static word32 VGAPalette[256]; +static word8 array_r[256]; +static word8 array_g[256]; +static word8 array_b[256]; + + + +int (*vl_mixfix) (fixed r, fixed g, fixed b); +int (*vl_mixrgb) (const unsigned char rgb[]); +int (*vl_mixrgba) (const unsigned char rgba[]); +void (*vl_getrgba) (unsigned int offset, unsigned char rgba[4]); +int (*vl_getpixel) (unsigned int offset); +void (*vl_clear) (int color); +void (*vl_rect) (int x, int y, int width, int height, int color); +void (*vl_flip) (void); +void (*vl_putpixel) (unsigned int offset, int color); + + + +/* Desc: color composition (w/o ALPHA) + * + * In : R, G, B + * Out : color + * + * Note: - + */ +static int vl_mixfix8fake (fixed r, fixed g, fixed b) +{ + return array_b[b>>FIXED_SHIFT]*G_CNT*R_CNT + + array_g[g>>FIXED_SHIFT]*R_CNT + + array_r[r>>FIXED_SHIFT]; +} +#define vl_mixfix8 vl_mixfix8fake +static int vl_mixfix15 (fixed r, fixed g, fixed b) +{ + return ((r>>(3+FIXED_SHIFT))<<10) + |((g>>(3+FIXED_SHIFT))<<5) + |(b>>(3+FIXED_SHIFT)); +} +static int vl_mixfix16 (fixed r, fixed g, fixed b) +{ + return ((r>>(3+FIXED_SHIFT))<<11) + |((g>>(2+FIXED_SHIFT))<<5) + |(b>>(3+FIXED_SHIFT)); +} +#define vl_mixfix24 vl_mixfix32 +static int vl_mixfix32 (fixed r, fixed g, fixed b) +{ + return ((r>>FIXED_SHIFT)<<16) + |((g>>FIXED_SHIFT)<<8) + |(b>>FIXED_SHIFT); +} + + + +/* Desc: color composition (w/ ALPHA) + * + * In : array of integers (R, G, B, A) + * Out : color + * + * Note: - + */ +#define vl_mixrgba8 vl_mixrgb8fake +#define vl_mixrgba15 vl_mixrgb15 +#define vl_mixrgba16 vl_mixrgb16 +#define vl_mixrgba24 vl_mixrgb24 +static int vl_mixrgba32 (const unsigned char rgba[]) +{ + return (rgba[3]<<24)|(rgba[0]<<16)|(rgba[1]<<8)|(rgba[2]); +} + + + +/* Desc: color composition (w/o ALPHA) + * + * In : array of integers (R, G, B) + * Out : color + * + * Note: - + */ +static int vl_mixrgb8fake (const unsigned char rgba[]) +{ + return array_b[rgba[2]]*G_CNT*R_CNT + + array_g[rgba[1]]*R_CNT + + array_r[rgba[0]]; +} +#define vl_mixrgb8 vl_mixrgb8fake +static int vl_mixrgb15 (const unsigned char rgb[]) +{ + return ((rgb[0]>>3)<<10)|((rgb[1]>>3)<<5)|(rgb[2]>>3); +} +static int vl_mixrgb16 (const unsigned char rgb[]) +{ + return ((rgb[0]>>3)<<11)|((rgb[1]>>2)<<5)|(rgb[2]>>3); +} +#define vl_mixrgb24 vl_mixrgb32 +static int vl_mixrgb32 (const unsigned char rgb[]) +{ + return (rgb[0]<<16)|(rgb[1]<<8)|(rgb[2]); +} + + + +/* Desc: color decomposition + * + * In : pixel offset, array of integers to hold color components (R, G, B, A) + * Out : - + * + * Note: uses current read buffer + */ +static void v_getrgba8fake6 (unsigned int offset, unsigned char rgba[]) +{ + word32 c = VGAPalette[((word8 *)vl_current_read_buffer)[offset]]; + rgba[0] = _rgb_scale_6[(c >> 16) & 0x3F]; + rgba[1] = _rgb_scale_6[(c >> 8) & 0x3F]; + rgba[2] = _rgb_scale_6[c & 0x3F]; + rgba[3] = c >> 24; +} +static void v_getrgba8fake8 (unsigned int offset, unsigned char rgba[]) +{ + word32 c = VGAPalette[((word8 *)vl_current_read_buffer)[offset]]; + rgba[0] = c >> 16; + rgba[1] = c >> 8; + rgba[2] = c; + rgba[3] = c >> 24; +} +#define v_getrgba8 v_getrgba8fake6 +static void v_getrgba15 (unsigned int offset, unsigned char rgba[4]) +{ + word32 c = ((word16 *)vl_current_read_buffer)[offset]; + rgba[0] = _rgb_scale_5[(c >> 10) & 0x1F]; + rgba[1] = _rgb_scale_5[(c >> 5) & 0x1F]; + rgba[2] = _rgb_scale_5[c & 0x1F]; + rgba[3] = 255; +} +static void v_getrgba16 (unsigned int offset, unsigned char rgba[4]) +{ + word32 c = ((word16 *)vl_current_read_buffer)[offset]; + rgba[0] = _rgb_scale_5[(c >> 11) & 0x1F]; + rgba[1] = _rgb_scale_6[(c >> 5) & 0x3F]; + rgba[2] = _rgb_scale_5[c & 0x1F]; + rgba[3] = 255; +} +static void v_getrgba24 (unsigned int offset, unsigned char rgba[4]) +{ + word32 c = *(word32 *)((long)vl_current_read_buffer+offset*3); + rgba[0] = c >> 16; + rgba[1] = c >> 8; + rgba[2] = c; + rgba[3] = 255; +} +static void v_getrgba32 (unsigned int offset, unsigned char rgba[4]) +{ + word32 c = ((word32 *)vl_current_read_buffer)[offset]; + rgba[0] = c >> 16; + rgba[1] = c >> 8; + rgba[2] = c; + rgba[3] = c >> 24; +} + + + +/* Desc: pixel retrieval + * + * In : pixel offset + * Out : pixel value + * + * Note: uses current read buffer + */ +static int v_getpixel8 (unsigned int offset) +{ + return ((word8 *)vl_current_read_buffer)[offset]; +} +#define v_getpixel15 v_getpixel16 +static int v_getpixel16 (unsigned int offset) +{ + return ((word16 *)vl_current_read_buffer)[offset]; +} +static int v_getpixel24 (unsigned int offset) +{ + return *(word32 *)((long)vl_current_read_buffer+offset*3); +} +static int v_getpixel32 (unsigned int offset) +{ + return ((word32 *)vl_current_read_buffer)[offset]; +} + + + +/* Desc: set one palette entry + * + * In : index, R, G, B + * Out : - + * + * Note: color components are in range [0.0 .. 1.0] + */ +void vl_setCI (int index, float red, float green, float blue) +{ + drv->setCI_f(index, red, green, blue); +} + + + +/* Desc: set one palette entry + * + * In : color, R, G, B + * Out : - + * + * Note: - + */ +static void fake_setcolor (int c, int r, int g, int b) +{ + VGAPalette[c] = 0xff000000 | (r<<16) | (g<<8) | b; + + drv->setCI_i(c, r, g, b); +} + + + +/* Desc: build FakeColor palette + * + * In : CI precision in bits + * Out : - + * + * Note: - + */ +static void fake_buildpalette (int bits) +{ + double c_r, c_g, c_b; + int r, g, b, color = 0; + + double max = (1 << bits) - 1; + + for (b=0; b video_mode->xres) || (y+height > video_mode->yres)) { + return -1; + } else { + void *newbuf = *buffer; + + if ((newbuf == NULL) || (vl_current_width != width) || (vl_current_height != height)) { + newbuf = realloc(newbuf, width * height * video_bypp); + } + + if (newbuf == NULL) { + return -2; + } + + vl_current_width = width; + vl_current_height = height; + vl_current_stride = vl_current_width * video_bypp; + vl_current_bytes = vl_current_stride * height; + + vl_current_offset = video_scanlen * y + video_bypp * x; + vl_current_delta = video_scanlen - vl_current_stride; + + vl_current_draw_buffer = vl_current_read_buffer = *buffer = newbuf; + return 0; + } +} + + + +/* Desc: state retrieval + * + * In : name, storage + * Out : - + * + * Note: - + */ +int vl_get (int pname, int *params) +{ + switch (pname) { + case VL_GET_SCREEN_SIZE: + params[0] = video_mode->xres; + params[1] = video_mode->yres; + break; + default: + return drv->get(pname, params); + } + return 0; +} + + + +/* Desc: setup mode + * + * In : ptr to mode definition + * Out : 0 if success + * + * Note: - + */ +static int vl_setup_mode (vl_mode *p) +{ + if (p == NULL) { + return -1; + } + +#define INITPTR(bpp) \ + vl_putpixel = v_putpixel##bpp; \ + vl_getrgba = v_getrgba##bpp; \ + vl_getpixel = v_getpixel##bpp; \ + vl_rect = v_rect##bpp; \ + vl_mixfix = vl_mixfix##bpp; \ + vl_mixrgb = vl_mixrgb##bpp; \ + vl_mixrgba = vl_mixrgba##bpp; \ + vl_clear = _can_mmx() ? v_clear##bpp##_mmx : v_clear##bpp + + switch (p->bpp) { + case 8: + INITPTR(8); + break; + case 15: + INITPTR(15); + break; + case 16: + INITPTR(16); + break; + case 24: + INITPTR(24); + break; + case 32: + INITPTR(32); + break; + default: + return -1; + } + +#undef INITPTR + + video_mode = p; + video_bypp = (p->bpp+7)/8; + video_scanlen = p->scanlen; + vl_video_selector = p->sel; + + return 0; +} + + + +/* Desc: restore to the mode prior to first call to `vl_video_init'. + * + * In : - + * Out : - + * + * Note: - + */ +void vl_video_exit (void) +{ + drv->restore(); + drv->fini(); +} + + + +/* Desc: enter mode + * + * In : xres, yres, bits/pixel, RGB, refresh rate + * Out : pixel width in bits if success + * + * Note: - + */ +int vl_video_init (int width, int height, int bpp, int rgb, int refresh) +{ + int fake; + vl_mode *p, *q; + unsigned int min; + + fake = 0; + if (!rgb) { + bpp = 8; + } else if (bpp == 8) { + fake = 1; + } + + /* initialize hardware */ + drv = &VESA; + if ((q=drv->init()) == NULL) { + drv = &VGA; + if ((q=drv->init()) == NULL) { + return 0; + } + } + + /* search for a mode that fits our request */ + for (min=-1, p=NULL; q->mode!=0xffff; q++) { + if ((q->xres>=width) && (q->yres>=height) && (q->bpp==bpp)) { + if (min>=(unsigned)(q->xres*q->yres)) { + min = q->xres*q->yres; + p = q; + } + } + } + + /* setup and enter mode */ + if ((vl_setup_mode(p) == 0) && (drv->entermode(p, refresh) == 0)) { + vl_flip = drv->blit; + if (fake) { + drv->get(VL_GET_CI_PREC, (int *)(&min)); + fake_buildpalette(min); + if (min == 8) { + vl_getrgba = v_getrgba8fake8; + } + } + return bpp; + } + + /* abort */ + return 0; +} diff --git a/src/mesa/drivers/dos/video.h b/src/mesa/drivers/dos/video.h index bb40fd00dfb..55560ee25b8 100644 --- a/src/mesa/drivers/dos/video.h +++ b/src/mesa/drivers/dos/video.h @@ -1,64 +1,64 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef VIDEO_H_included -#define VIDEO_H_included - -typedef int fixed; - -#define VL_GET_CARD_NAME 0x0100 -#define VL_GET_VRAM 0x0101 -#define VL_GET_CI_PREC 0x0200 -#define VL_GET_HPIXELS 0x0201 -#define VL_GET_SCREEN_SIZE 0x0202 - -extern int (*vl_mixfix) (fixed r, fixed g, fixed b); -extern int (*vl_mixrgb) (const unsigned char rgb[]); -extern int (*vl_mixrgba) (const unsigned char rgba[]); -extern void (*vl_getrgba) (unsigned int offset, unsigned char rgba[4]); - -extern void (*vl_clear) (int color); -extern void (*vl_rect) (int x, int y, int width, int height, int color); -extern void (*vl_flip) (void); -extern void (*vl_putpixel) (unsigned int offset, int color); -extern int (*vl_getpixel) (unsigned int offset); - -void vl_setCI (int index, float red, float green, float blue); - -int vl_sync_buffer (void **buffer, int x, int y, int width, int height); -int vl_get (int pname, int *params); - -void vl_video_exit (void); -int vl_video_init (int width, int height, int bpp, int rgb, int refresh); - -#endif +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef VIDEO_H_included +#define VIDEO_H_included + +typedef int fixed; + +#define VL_GET_CARD_NAME 0x0100 +#define VL_GET_VRAM 0x0101 +#define VL_GET_CI_PREC 0x0200 +#define VL_GET_HPIXELS 0x0201 +#define VL_GET_SCREEN_SIZE 0x0202 + +extern int (*vl_mixfix) (fixed r, fixed g, fixed b); +extern int (*vl_mixrgb) (const unsigned char rgb[]); +extern int (*vl_mixrgba) (const unsigned char rgba[]); +extern void (*vl_getrgba) (unsigned int offset, unsigned char rgba[4]); + +extern void (*vl_clear) (int color); +extern void (*vl_rect) (int x, int y, int width, int height, int color); +extern void (*vl_flip) (void); +extern void (*vl_putpixel) (unsigned int offset, int color); +extern int (*vl_getpixel) (unsigned int offset); + +void vl_setCI (int index, float red, float green, float blue); + +int vl_sync_buffer (void **buffer, int x, int y, int width, int height); +int vl_get (int pname, int *params); + +void vl_video_exit (void); +int vl_video_init (int width, int height, int bpp, int rgb, int refresh); + +#endif diff --git a/src/mesa/drivers/dos/virtual.S b/src/mesa/drivers/dos/virtual.S index 0df584150f3..c5cc1fe86f8 100644 --- a/src/mesa/drivers/dos/virtual.S +++ b/src/mesa/drivers/dos/virtual.S @@ -1,489 +1,489 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - - .file "virtual.S" - -/* - * extern void *vl_current_draw_buffer; - * extern int vl_current_width, vl_current_bytes; - */ - - .text - -/* Desc: void v_clear8 (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_clear8 -_v_clear8: - movl 4(%esp), %eax - movb %al, %ah - pushw %ax - pushw %ax - popl %eax - jmp _v_clear_common - -/* Desc: void v_clear16 (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_clear16 -_v_clear16: - movl 4(%esp), %eax - pushw %ax - pushw %ax - popl %eax - jmp _v_clear_common - -/* Desc: void v_clear32 (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_clear32 -_v_clear32: - movl 4(%esp), %eax - .balign 4 -_v_clear_common: - movl _vl_current_bytes, %ecx - movl _vl_current_draw_buffer, %edx - shrl $2, %ecx - .balign 4 - 0: - movl %eax, (%edx) - addl $4, %edx - decl %ecx - jnz 0b - ret - -/* Desc: void v_clear8_mmx (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_clear8_mmx -_v_clear8_mmx: -#ifdef USE_MMX_ASM - movd 4(%esp), %mm0 - punpcklbw %mm0, %mm0 - punpcklwd %mm0, %mm0 - jmp _v_clear_common_mmx -#endif - -/* Desc: void v_clear16_mmx (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_clear16_mmx -_v_clear16_mmx: -#ifdef USE_MMX_ASM - movd 4(%esp), %mm0 - punpcklwd %mm0, %mm0 - jmp _v_clear_common_mmx -#endif - -/* Desc: void v_clear32_mmx (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_clear32_mmx -_v_clear32_mmx: -#ifdef USE_MMX_ASM - movd 4(%esp), %mm0 - .balign 4 -_v_clear_common_mmx: - punpckldq %mm0, %mm0 - movl _vl_current_bytes, %ecx - movl _vl_current_draw_buffer, %edx - shrl $3, %ecx - .balign 4 - 0: - movq %mm0, (%edx) - addl $8, %edx - decl %ecx - jnz 0b - emms -#endif - ret - -/* Desc: void v_clear24 (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_clear24 -_v_clear24: - movl $0xaaaaaaab, %eax - mull _vl_current_bytes - movl 4(%esp), %eax - movl %edx, %ecx - pushl %ebx - movl _vl_current_draw_buffer, %edx - shrl %ecx - movb 10(%esp), %bl - .balign 4 - 0: - movw %ax, (%edx) - movb %bl, 2(%edx) - addl $3, %edx - decl %ecx - jnz 0b - popl %ebx - ret - -/* Desc: void v_clear24_mmx (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_clear24_mmx -_v_clear24_mmx: -#ifdef USE_MMX_ASM - movl 4(%esp), %eax - movl %eax, %edx - movl %eax, %ecx - shll $16, %edx - rorl $8, %ecx - movw %cx, %dx - rorl $16, %ecx - movb %dh, %cl - shll $8, %eax - movb %ch, %al - rorl $8, %eax - - pushl %edx - pushl %eax - movq (%esp), %mm0 - pushl %ecx - movq (%esp), %mm1 - pushl %edx - movq (%esp), %mm2 - - movl $0xaaaaaaab, %eax - mull _vl_current_bytes - movl %edx, %ecx - movl _vl_current_draw_buffer, %edx - shrl $4, %ecx - .balign 4 - 0: - movq %mm0, (%edx) - movq %mm1, 8(%edx) - movq %mm2, 16(%edx) - addl $24, %edx - decl %ecx - jnz 0b - emms - addl $16, %esp -#endif - ret - -/* Desc: void v_rect8 (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_rect8 -_v_rect8: - cld - pushl %esi - pushl %edi - movl 28(%esp), %eax - movl _vl_current_width, %esi - movl 16(%esp), %edi - movb %al, %ah - movl 20(%esp), %ecx - imull %esi, %edi - movl 24(%esp), %edx - subl %ecx, %esi - addl 12(%esp), %edi - pushw %ax - pushw %ax - pushl %ds - popl %es - addl _vl_current_draw_buffer, %edi - popl %eax - pushl %ebx - movl %ecx, %ebx - andl $3, %ebx - .balign 4 - 0: - pushl %ecx - .balign 4 - 1: - shrl $2, %ecx - rep; stosl - testl %ebx, %ebx - jz 2f - movl %ebx, %ecx - rep; stosb - .balign 4 - 2: - popl %ecx - addl %esi, %edi - decl %edx - jnz 0b - popl %ebx - popl %edi - popl %esi - ret - -/* Desc: void v_rect16 (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_rect16 -_v_rect16: - cld - pushl %esi - pushl %edi - movl 28(%esp), %eax - movl _vl_current_width, %esi - movl 16(%esp), %edi - movl 20(%esp), %ecx - imull %esi, %edi - movl 24(%esp), %edx - subl %ecx, %esi - addl 12(%esp), %edi - pushw %ax - shll %esi - pushw %ax - shll %edi - pushl %ds - popl %es - addl _vl_current_draw_buffer, %edi - popl %eax - .balign 4 - 0: - pushl %ecx - .balign 4 - 1: - shrl %ecx - rep; stosl - jnc 2f - stosw - .balign 4 - 2: - popl %ecx - addl %esi, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - ret - -/* Desc: void v_rect24 (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_rect24 -_v_rect24: - pushl %esi - pushl %edi - movl 28(%esp), %eax - movl _vl_current_width, %esi - movl 16(%esp), %edi - movl 20(%esp), %ecx - imull %esi, %edi - movl 24(%esp), %edx - subl %ecx, %esi - addl 12(%esp), %edi - leal (%esi, %esi, 2), %esi - pushl %ebx - leal (%edi, %edi, 2), %edi - movl %eax, %ebx - addl _vl_current_draw_buffer, %edi - shrl $16, %ebx - .balign 4 - 0: - pushl %ecx - .balign 4 - 1: - movw %ax, (%edi) - movb %bl, 2(%edi) - addl $3, %edi - decl %ecx - jnz 1b - popl %ecx - addl %esi, %edi - decl %edx - jnz 0b - popl %ebx - popl %edi - popl %esi - ret - -/* Desc: void v_rect32 (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_rect32 -_v_rect32: - pushl %esi - pushl %edi - movl _vl_current_width, %esi - movl 16(%esp), %edi - movl 20(%esp), %ecx - imull %esi, %edi - movl 24(%esp), %edx - subl %ecx, %esi - addl 12(%esp), %edi - shll $2, %esi - shll $2, %edi - movl 28(%esp), %eax - addl _vl_current_draw_buffer, %edi - .balign 4 - 0: - pushl %ecx - .balign 4 - 1: - movl %eax, (%edi) - addl $4, %edi - decl %ecx - jnz 1b - popl %ecx - addl %esi, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - ret - -/* Desc: void v_putpixel8 (unsigned int offset, int color); - * - * In : offset within buffer, color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_putpixel8 -_v_putpixel8: - movl 8(%esp), %ecx - movl 4(%esp), %edx - movl _vl_current_draw_buffer, %eax - movb %cl, (%eax,%edx) - ret - -/* Desc: void v_putpixel16 (unsigned int offset, int color); - * - * In : offset within buffer, color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_putpixel16 -_v_putpixel16: - movl 8(%esp), %ecx - movl 4(%esp), %edx - movl _vl_current_draw_buffer, %eax - movw %cx, (%eax,%edx,2) - ret - -/* Desc: void v_putpixel24 (unsigned int offset, int color); - * - * In : offset within buffer, color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_putpixel24 -_v_putpixel24: - movl 4(%esp), %eax - movl 8(%esp), %edx - movl _vl_current_draw_buffer, %ecx - leal (%eax,%eax,2), %eax - movw %dx, (%ecx,%eax) - shrl $16, %edx - movb %dl, 2(%ecx,%eax) - ret - -/* Desc: void v_putpixel32 (unsigned int offset, int color); - * - * In : offset within buffer, color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_putpixel32 -_v_putpixel32: - movl 8(%esp), %ecx - movl 4(%esp), %edx - movl _vl_current_draw_buffer, %eax - movl %ecx, (%eax,%edx,4) - ret +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.3 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + + .file "virtual.S" + +/* + * extern void *vl_current_draw_buffer; + * extern int vl_current_width, vl_current_bytes; + */ + + .text + +/* Desc: void v_clear8 (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_clear8 +_v_clear8: + movl 4(%esp), %eax + movb %al, %ah + pushw %ax + pushw %ax + popl %eax + jmp _v_clear_common + +/* Desc: void v_clear16 (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_clear16 +_v_clear16: + movl 4(%esp), %eax + pushw %ax + pushw %ax + popl %eax + jmp _v_clear_common + +/* Desc: void v_clear32 (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_clear32 +_v_clear32: + movl 4(%esp), %eax + .balign 4 +_v_clear_common: + movl _vl_current_bytes, %ecx + movl _vl_current_draw_buffer, %edx + shrl $2, %ecx + .balign 4 + 0: + movl %eax, (%edx) + addl $4, %edx + decl %ecx + jnz 0b + ret + +/* Desc: void v_clear8_mmx (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_clear8_mmx +_v_clear8_mmx: +#ifdef USE_MMX_ASM + movd 4(%esp), %mm0 + punpcklbw %mm0, %mm0 + punpcklwd %mm0, %mm0 + jmp _v_clear_common_mmx +#endif + +/* Desc: void v_clear16_mmx (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_clear16_mmx +_v_clear16_mmx: +#ifdef USE_MMX_ASM + movd 4(%esp), %mm0 + punpcklwd %mm0, %mm0 + jmp _v_clear_common_mmx +#endif + +/* Desc: void v_clear32_mmx (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_clear32_mmx +_v_clear32_mmx: +#ifdef USE_MMX_ASM + movd 4(%esp), %mm0 + .balign 4 +_v_clear_common_mmx: + punpckldq %mm0, %mm0 + movl _vl_current_bytes, %ecx + movl _vl_current_draw_buffer, %edx + shrl $3, %ecx + .balign 4 + 0: + movq %mm0, (%edx) + addl $8, %edx + decl %ecx + jnz 0b + emms +#endif + ret + +/* Desc: void v_clear24 (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_clear24 +_v_clear24: + movl $0xaaaaaaab, %eax + mull _vl_current_bytes + movl 4(%esp), %eax + movl %edx, %ecx + pushl %ebx + movl _vl_current_draw_buffer, %edx + shrl %ecx + movb 10(%esp), %bl + .balign 4 + 0: + movw %ax, (%edx) + movb %bl, 2(%edx) + addl $3, %edx + decl %ecx + jnz 0b + popl %ebx + ret + +/* Desc: void v_clear24_mmx (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_clear24_mmx +_v_clear24_mmx: +#ifdef USE_MMX_ASM + movl 4(%esp), %eax + movl %eax, %edx + movl %eax, %ecx + shll $16, %edx + rorl $8, %ecx + movw %cx, %dx + rorl $16, %ecx + movb %dh, %cl + shll $8, %eax + movb %ch, %al + rorl $8, %eax + + pushl %edx + pushl %eax + movq (%esp), %mm0 + pushl %ecx + movq (%esp), %mm1 + pushl %edx + movq (%esp), %mm2 + + movl $0xaaaaaaab, %eax + mull _vl_current_bytes + movl %edx, %ecx + movl _vl_current_draw_buffer, %edx + shrl $4, %ecx + .balign 4 + 0: + movq %mm0, (%edx) + movq %mm1, 8(%edx) + movq %mm2, 16(%edx) + addl $24, %edx + decl %ecx + jnz 0b + emms + addl $16, %esp +#endif + ret + +/* Desc: void v_rect8 (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_rect8 +_v_rect8: + cld + pushl %esi + pushl %edi + movl 28(%esp), %eax + movl _vl_current_width, %esi + movl 16(%esp), %edi + movb %al, %ah + movl 20(%esp), %ecx + imull %esi, %edi + movl 24(%esp), %edx + subl %ecx, %esi + addl 12(%esp), %edi + pushw %ax + pushw %ax + pushl %ds + popl %es + addl _vl_current_draw_buffer, %edi + popl %eax + pushl %ebx + movl %ecx, %ebx + andl $3, %ebx + .balign 4 + 0: + pushl %ecx + .balign 4 + 1: + shrl $2, %ecx + rep; stosl + testl %ebx, %ebx + jz 2f + movl %ebx, %ecx + rep; stosb + .balign 4 + 2: + popl %ecx + addl %esi, %edi + decl %edx + jnz 0b + popl %ebx + popl %edi + popl %esi + ret + +/* Desc: void v_rect16 (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_rect16 +_v_rect16: + cld + pushl %esi + pushl %edi + movl 28(%esp), %eax + movl _vl_current_width, %esi + movl 16(%esp), %edi + movl 20(%esp), %ecx + imull %esi, %edi + movl 24(%esp), %edx + subl %ecx, %esi + addl 12(%esp), %edi + pushw %ax + shll %esi + pushw %ax + shll %edi + pushl %ds + popl %es + addl _vl_current_draw_buffer, %edi + popl %eax + .balign 4 + 0: + pushl %ecx + .balign 4 + 1: + shrl %ecx + rep; stosl + jnc 2f + stosw + .balign 4 + 2: + popl %ecx + addl %esi, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + ret + +/* Desc: void v_rect24 (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_rect24 +_v_rect24: + pushl %esi + pushl %edi + movl 28(%esp), %eax + movl _vl_current_width, %esi + movl 16(%esp), %edi + movl 20(%esp), %ecx + imull %esi, %edi + movl 24(%esp), %edx + subl %ecx, %esi + addl 12(%esp), %edi + leal (%esi, %esi, 2), %esi + pushl %ebx + leal (%edi, %edi, 2), %edi + movl %eax, %ebx + addl _vl_current_draw_buffer, %edi + shrl $16, %ebx + .balign 4 + 0: + pushl %ecx + .balign 4 + 1: + movw %ax, (%edi) + movb %bl, 2(%edi) + addl $3, %edi + decl %ecx + jnz 1b + popl %ecx + addl %esi, %edi + decl %edx + jnz 0b + popl %ebx + popl %edi + popl %esi + ret + +/* Desc: void v_rect32 (int color); + * + * In : color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_rect32 +_v_rect32: + pushl %esi + pushl %edi + movl _vl_current_width, %esi + movl 16(%esp), %edi + movl 20(%esp), %ecx + imull %esi, %edi + movl 24(%esp), %edx + subl %ecx, %esi + addl 12(%esp), %edi + shll $2, %esi + shll $2, %edi + movl 28(%esp), %eax + addl _vl_current_draw_buffer, %edi + .balign 4 + 0: + pushl %ecx + .balign 4 + 1: + movl %eax, (%edi) + addl $4, %edi + decl %ecx + jnz 1b + popl %ecx + addl %esi, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + ret + +/* Desc: void v_putpixel8 (unsigned int offset, int color); + * + * In : offset within buffer, color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_putpixel8 +_v_putpixel8: + movl 8(%esp), %ecx + movl 4(%esp), %edx + movl _vl_current_draw_buffer, %eax + movb %cl, (%eax,%edx) + ret + +/* Desc: void v_putpixel16 (unsigned int offset, int color); + * + * In : offset within buffer, color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_putpixel16 +_v_putpixel16: + movl 8(%esp), %ecx + movl 4(%esp), %edx + movl _vl_current_draw_buffer, %eax + movw %cx, (%eax,%edx,2) + ret + +/* Desc: void v_putpixel24 (unsigned int offset, int color); + * + * In : offset within buffer, color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_putpixel24 +_v_putpixel24: + movl 4(%esp), %eax + movl 8(%esp), %edx + movl _vl_current_draw_buffer, %ecx + leal (%eax,%eax,2), %eax + movw %dx, (%ecx,%eax) + shrl $16, %edx + movb %dl, 2(%ecx,%eax) + ret + +/* Desc: void v_putpixel32 (unsigned int offset, int color); + * + * In : offset within buffer, color + * Out : - + * + * Note: uses current draw buffer + */ + .p2align 5,,31 + .global _v_putpixel32 +_v_putpixel32: + movl 8(%esp), %ecx + movl 4(%esp), %edx + movl _vl_current_draw_buffer, %eax + movl %ecx, (%eax,%edx,4) + ret diff --git a/src/mesa/main/Makefile.DJ b/src/mesa/main/Makefile.DJ deleted file mode 100644 index 518a1689155..00000000000 --- a/src/mesa/main/Makefile.DJ +++ /dev/null @@ -1,348 +0,0 @@ -# Mesa 3-D graphics library -# Version: 5.1 -# -# Copyright (C) 1999-2003 Brian Paul All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -# DOS/DJGPP core makefile v1.3 for Mesa -# -# Copyright (C) 2002 - Borca Daniel -# Email : dborca@yahoo.com -# Web : http://www.geocities.com/dborca - - -# -# Available options: -# -# Environment variables: -# CFLAGS -# -# GLIDE path to Glide3 SDK include files; used with FX. -# default = $(TOP)/include/glide3 -# FX=1 build for 3dfx Glide3. Note that this disables -# compilation of most DMesa code and requires fxMesa. -# As a consequence, you'll need the DJGPP Glide3 -# library to build any application. -# default = no -# MATROX=1 build for Matrox Millennium I (MGA2064W) cards. -# This is experimental and not intensively tested. -# default = no -# HAVE_X86=1 optimize for i386. -# default = no -# HAVE_MMX=1 allow MMX specializations, provided your assembler -# supports MMX instruction set. However, the true CPU -# capabilities are checked at run-time to avoid crashes. -# default = no -# HAVE_SSE=1 (see HAVE_MMX) -# default = no -# HAVE_3DNOW=1 (see HAVE_MMX) -# default = no -# -# Targets: -# all: build GL -# clean: remove object files -# - - - -.PHONY: all clean -.INTERMEDIATE: X86/gen_matypes.exe - -TOP = .. -GLIDE ?= $(TOP)/include/glide3 -LIBDIR = $(TOP)/lib -GL_LIB = libgl.a -GL_DXE = gl.dxe -GL_IMP = libigl.a - -CC = gcc -CFLAGS += -I$(TOP)/include -I. -ifeq ($(FX),1) -CFLAGS += -D__DOS__ -DH3 -CFLAGS += -I$(GLIDE) -DFX -DFX_GLIDE3 -DFXMESA_USE_ARGB -LIBNAME = "MesaGL/FX DJGPP" -else -ifeq ($(MATROX),1) -CFLAGS += -DMATROX -LIBNAME = "MesaGL/MGA DJGPP" -else -LIBNAME = "MesaGL DJGPP" -endif -endif - -AR = ar -ARFLAGS = rus - -HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe) - -ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) -UNLINK = del $(subst /,\,$(1)) -else -UNLINK = $(RM) $(1) -endif - -CORE_SOURCES = \ - api_arrayelt.c \ - api_loopback.c \ - api_noop.c \ - api_validate.c \ - accum.c \ - arbprogram.c \ - attrib.c \ - blend.c \ - bufferobj.c \ - buffers.c \ - clip.c \ - colortab.c \ - context.c \ - convolve.c \ - debug.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 \ - glthread.c \ - hash.c \ - hint.c \ - histogram.c \ - image.c \ - imports.c \ - light.c \ - lines.c \ - matrix.c \ - mmath.c \ - pixel.c \ - points.c \ - polygon.c \ - rastpos.c \ - state.c \ - stencil.c \ - texcompress.c \ - texformat.c \ - teximage.c \ - texobj.c \ - texstate.c \ - texstore.c \ - texutil.c \ - varray.c \ - vpexec.c \ - vpparse.c \ - vpstate.c \ - vtxfmt.c \ - math/m_debug_clip.c \ - math/m_debug_norm.c \ - math/m_debug_xform.c \ - math/m_eval.c \ - math/m_matrix.c \ - math/m_translate.c \ - math/m_vector.c \ - math/m_xform.c \ - array_cache/ac_context.c \ - array_cache/ac_import.c \ - swrast/s_aaline.c \ - swrast/s_aatriangle.c \ - swrast/s_accum.c \ - swrast/s_alpha.c \ - swrast/s_alphabuf.c \ - swrast/s_bitmap.c \ - swrast/s_blend.c \ - swrast/s_buffers.c \ - swrast/s_copypix.c \ - swrast/s_context.c \ - swrast/s_depth.c \ - swrast/s_drawpix.c \ - swrast/s_feedback.c \ - swrast/s_fog.c \ - swrast/s_histogram.c \ - swrast/s_imaging.c \ - swrast/s_lines.c \ - swrast/s_logic.c \ - swrast/s_masking.c \ - swrast/s_pixeltex.c \ - swrast/s_points.c \ - swrast/s_readpix.c \ - swrast/s_span.c \ - swrast/s_stencil.c \ - swrast/s_texture.c \ - swrast/s_texstore.c \ - swrast/s_triangle.c \ - swrast/s_zoom.c \ - swrast_setup/ss_context.c \ - swrast_setup/ss_triangle.c \ - swrast_setup/ss_vb.c \ - tnl/t_array_api.c \ - tnl/t_array_import.c \ - tnl/t_context.c \ - tnl/t_eval_api.c \ - tnl/t_imm_alloc.c \ - tnl/t_imm_api.c \ - tnl/t_imm_debug.c \ - tnl/t_imm_dlist.c \ - tnl/t_imm_elt.c \ - tnl/t_imm_eval.c \ - tnl/t_imm_exec.c \ - tnl/t_imm_fixup.c \ - tnl/t_pipeline.c \ - tnl/t_vb_fog.c \ - tnl/t_vb_light.c \ - tnl/t_vb_normals.c \ - tnl/t_vb_points.c \ - tnl/t_vb_program.c \ - tnl/t_vb_render.c \ - tnl/t_vb_texgen.c \ - tnl/t_vb_texmat.c \ - tnl/t_vb_vertex.c - -X86_SOURCES = \ - X86/x86.c \ - X86/glapi_x86.S \ - X86/common_x86.c \ - X86/common_x86_asm.S \ - X86/x86_xform2.S \ - X86/x86_xform3.S \ - X86/x86_xform4.S \ - X86/x86_cliptest.S - -MMX_SOURCES = \ - X86/mmx_blend.S - -SSE_SOURCES = \ - X86/sse.c \ - X86/sse_xform2.S \ - X86/sse_xform3.S \ - X86/sse_xform4.S \ - X86/sse_normal.S - -K3D_SOURCES = \ - X86/3dnow.c \ - X86/3dnow_xform2.S \ - X86/3dnow_xform3.S \ - X86/3dnow_xform4.S \ - X86/3dnow_normal.S - -ifeq ($(HAVE_MMX),1) -X86_SOURCES += $(MMX_SOURCES) -CFLAGS += -DUSE_MMX_ASM -HAVE_X86 = 1 -endif -ifeq ($(HAVE_SSE),1) -X86_SOURCES += $(SSE_SOURCES) -CFLAGS += -DUSE_SSE_ASM -HAVE_X86 = 1 -endif -ifeq ($(HAVE_3DNOW),1) -X86_SOURCES += $(K3D_SOURCES) -CFLAGS += -DUSE_3DNOW_ASM -HAVE_X86 = 1 -endif -ifeq ($(HAVE_X86),1) -CFLAGS += -DUSE_X86_ASM -else -X86_SOURCES = -endif - -DRIVER_SOURCES = \ - DOS/dmesa.c -ifeq ($(FX),1) -DRIVER_SOURCES += \ - FX/fxapi.c \ - FX/fxdd.c \ - FX/fxddspan.c \ - FX/fxddtex.c \ - FX/fxsetup.c \ - FX/fxtexman.c \ - FX/fxtris.c \ - FX/fxvb.c \ - FX/fxglidew.c -else -ifeq ($(MATROX),1) -DRIVER_SOURCES += \ - DOS/mga/mga.c \ - DOS/mga/mga_hw.c \ - DOS/mga/mga_mode.c \ - DOS/dpmi.c -else -DRIVER_SOURCES += \ - DOS/video.c \ - DOS/virtual.S \ - DOS/vesa.c \ - DOS/blit.S \ - DOS/vga.c \ - DOS/dpmi.c -endif -endif - -SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(DRIVER_SOURCES) - -OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) - -X86_OBJECTS = $(addsuffix .o,$(basename $(X86_SOURCES))) - -.c.o: - $(CC) -o $@ $(CFLAGS) -c $< -.S.o: - $(CC) -o $@ $(CFLAGS) -c $< -.s.o: - $(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $< - -all: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP) - -$(LIBDIR)/$(GL_LIB): $(OBJECTS) - $(AR) $(ARFLAGS) $(LIBDIR)/$(GL_LIB) $(OBJECTS) - -$(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP): $(OBJECTS) -ifeq ($(HAVEDXE3),) - $(warning Missing DXE3 package... Skipping $(GL_DXE)) -else -ifeq ($(FX),1) - -dxe3gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -P glid3.dxe -U $(OBJECTS) -else - -dxe3gen -o $(LIBDIR)/$(GL_DXE) -I $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -U $(OBJECTS) -endif -endif - -$(X86_OBJECTS): X86/matypes.h - -X86/matypes.h: X86/gen_matypes.exe - $< > $@ - -X86/gen_matypes.exe: X86/gen_matypes.c - $(CC) -o $@ $(CFLAGS) -s $< - -clean: - -$(call UNLINK,*.o) - -$(call UNLINK,array_cache/*.o) - -$(call UNLINK,math/*.o) - -$(call UNLINK,swrast/*.o) - -$(call UNLINK,swrast_setup/*.o) - -$(call UNLINK,tnl/*.o) - -$(call UNLINK,X86/*.o) - -$(call UNLINK,DOS/*.o) - -$(call UNLINK,DOS/mga/*.o) - -$(call UNLINK,FX/*.o) - --include depend -- cgit v1.2.3 From c19cbb58cd2862393d67b62a5fc523b6fa1ac9a6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 17 Jul 2003 14:50:11 +0000 Subject: more DOS updates from Daniel Borca --- include/GL/fxmesa.h | 1 + src/mesa/drivers/dos/dmesa.c | 3 + src/mesa/drivers/glide/fxapi.c | 41 +++++- src/mesa/drivers/glide/fxdd.c | 222 +++++++++++++++++++++++++++++++- src/mesa/drivers/glide/fxddspan.c | 257 ++++++++++++++++++++++++++++++++++++-- src/mesa/drivers/glide/fxdrv.h | 6 +- src/mesa/drivers/glide/fxglidew.c | 21 +++- src/mesa/drivers/glide/fxglidew.h | 13 +- 8 files changed, 541 insertions(+), 23 deletions(-) (limited to 'include') diff --git a/include/GL/fxmesa.h b/include/GL/fxmesa.h index b1978923986..7697c720073 100644 --- a/include/GL/fxmesa.h +++ b/include/GL/fxmesa.h @@ -51,6 +51,7 @@ extern "C" { #define FXMESA_DEPTH_SIZE 12 /* followed by an integer */ #define FXMESA_STENCIL_SIZE 13 /* followed by an integer */ #define FXMESA_ACCUM_SIZE 14 /* followed by an integer */ +#define FXMESA_COLORDEPTH 20 /* followed by an integer */ diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index 9ec0036176a..92381307c28 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -1452,6 +1452,8 @@ DMesaVisual DMesaCreateVisual (GLint width, if (stencilSize > 0) { fx_attrib[i++] = FXMESA_STENCIL_SIZE; fx_attrib[i++] = stencilSize; } if (accumSize > 0) { fx_attrib[i++] = FXMESA_ACCUM_SIZE; fx_attrib[i++] = accumSize; } if (alphaFlag) { fx_attrib[i++] = FXMESA_ALPHA_SIZE; fx_attrib[i++] = 1; } + fx_attrib[i++] = FXMESA_COLORDEPTH; + fx_attrib[i++] = colDepth; fx_attrib[i] = FXMESA_NONE; return (DMesaVisual)fxMesaCreateBestContext(-1, width, height, fx_attrib); @@ -1534,6 +1536,7 @@ DMesaContext DMesaCreateContext (DMesaVisual visual, _mesa_enable_sw_extensions((GLcontext *)c); _mesa_enable_1_3_extensions((GLcontext *)c); _mesa_enable_1_4_extensions((GLcontext *)c); + _mesa_enable_1_5_extensions((GLcontext *)c); /* you probably have to do a bunch of other initializations here. */ c->visual = visual; diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index a1fdf1dc871..bb87565296b 100644 --- a/src/mesa/drivers/glide/fxapi.c +++ b/src/mesa/drivers/glide/fxapi.c @@ -1,4 +1,4 @@ -/* $Id: fxapi.c,v 1.35 2002/10/24 23:57:23 brianp Exp $ */ +/* $Id: fxapi.c,v 1.36 2003/07/17 14:50:12 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -283,6 +283,8 @@ fxMesaCreateContext(GLuint win, char *errorstr; GLboolean useBGR; char *system = NULL; + GLuint pixFmt, colDepth = 16; + GLint redBits, greenBits, blueBits, alphaBits; if (MESA_VERBOSE & VERBOSE_DRIVER) { fprintf(stderr, "fxmesa: fxMesaCreateContext() Start\n"); @@ -295,6 +297,9 @@ fxMesaCreateContext(GLuint win, i = 0; while (attribList[i] != FXMESA_NONE) { switch (attribList[i]) { + case FXMESA_COLORDEPTH: + colDepth = attribList[++i]; + break; case FXMESA_DOUBLEBUFFER: doubleBuffer = GL_TRUE; break; @@ -379,12 +384,42 @@ fxMesaCreateContext(GLuint win, fxMesa->board = glbCurrentBoard; - fxMesa->glideContext = FX_grSstWinOpen((FxU32) win, res, ref, + switch (fxMesa->colDepth = colDepth) { + case 15: + redBits = 5; + greenBits = 5; + blueBits = 5; + alphaBits = 1; + pixFmt = 4; /* GR_PIXFMT_ARGB_1555 */ + break; + case 16: + redBits = 5; + greenBits = 6; + blueBits = 5; + alphaBits = 0; + pixFmt = 3; /* GR_PIXFMT_ARGB_565 */ + break; + case 32: + redBits = 8; + greenBits = 8; + blueBits = 8; + alphaBits = 8; + pixFmt = 5; /* GR_PIXFMT_ARGB_8888 */ + break; + default: + errorstr = "pixelFormat"; + goto errorhandler; + } + + + fxMesa->glideContext = FX_grSstWinOpen(&glbHWConfig.SSTs[glbCurrentBoard], + (FxU32)win, res, ref, #ifdef FXMESA_USE_ARGB GR_COLORFORMAT_ARGB, #else GR_COLORFORMAT_ABGR, #endif + pixFmt, GR_ORIGIN_LOWER_LEFT, 2, aux); if (!fxMesa->glideContext) { errorstr = "grSstWinOpen"; @@ -497,7 +532,7 @@ fxMesaCreateContext(GLuint win, fxMesa->glVis = _mesa_create_visual(GL_TRUE, /* RGB mode */ doubleBuffer, GL_FALSE, /* stereo */ - 5, 6, 5, 0, /* RGBA bits */ + redBits, greenBits, blueBits, alphaBits, /* RGBA bits */ 0, /* index bits */ depthSize, /* depth_size */ stencilSize, /* stencil_size */ diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index f20b1147f8e..81d3754e42e 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -1,4 +1,8 @@ -/* $Id: fxdd.c,v 1.97 2003/06/16 14:30:57 brianp Exp $ */ +/* Hack alert: + * fxDDReadPixels888 does not convert 8A8R8G8B into 5R5G5B + */ + +/* $Id: fxdd.c,v 1.98 2003/07/17 14:50:12 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -66,6 +70,14 @@ GLubyte FX_PixelToR[0x10000]; GLubyte FX_PixelToG[0x10000]; GLubyte FX_PixelToB[0x10000]; +/* lookup table for scaling 5 bit colors up to 8 bits */ +GLuint FX_rgb_scale_5[32] = { + 0, 8, 16, 25, 33, 41, 49, 58, + 66, 74, 82, 90, 99, 107, 115, 123, + 132, 140, 148, 156, 165, 173, 181, 189, + 197, 206, 214, 222, 230, 239, 247, 255 +}; + /* * Initialize the FX_PixelTo{RGB} arrays. @@ -89,9 +101,10 @@ fxInitPixelTables(fxMesaContext fxMesa, GLboolean bgrOrder) g = (pixel & 0x07E0) >> 3; b = (pixel & 0x001F) << 3; } - r = r * 255 / 0xF8; /* fill in low-order bits */ - g = g * 255 / 0xFC; - b = b * 255 / 0xF8; + /* fill in low-order bits with proper rounding */ + r = (GLuint)(((double)r * 255. / 0xF8) + 0.5); + g = (GLuint)(((double)g * 255. / 0xFC) + 0.5); + b = (GLuint)(((double)b * 255. / 0xF8) + 0.5); FX_PixelToR[pixel] = r; FX_PixelToG[pixel] = g; FX_PixelToB[pixel] = b; @@ -581,6 +594,190 @@ fxDDReadPixels(GLcontext * ctx, GLint x, GLint y, } } +static void fxDDReadPixels555 (GLcontext * ctx, + GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *packing, + GLvoid *dstImage) +{ + if (ctx->_ImageTransferState) { + _swrast_ReadPixels(ctx, x, y, width, height, format, type, + packing, dstImage); + return; + } + else { + fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + GrLfbInfo_t info; + + BEGIN_BOARD_LOCK(); + if (grLfbLock(GR_LFB_READ_ONLY, + fxMesa->currentFB, + GR_LFBWRITEMODE_ANY, + GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) { + const GLint winX = 0; + const GLint winY = fxMesa->height - 1; + const GLint srcStride = info.strideInBytes / 2; /* stride in GLushorts */ + const GLushort *src = (const GLushort *) info.lfbPtr + + (winY - y) * srcStride + (winX + x); + GLubyte *dst = (GLubyte *) _mesa_image_address(packing, dstImage, + width, height, format, + type, 0, 0, 0); + GLint dstStride = + _mesa_image_row_stride(packing, width, format, type); + + if (format == GL_RGB && type == GL_UNSIGNED_BYTE) { + /* convert 5R5G5B into 8R8G8B */ + GLint row, col; + const GLint halfWidth = width >> 1; + const GLint extraPixel = (width & 1); + for (row = 0; row < height; row++) { + GLubyte *d = dst; + for (col = 0; col < halfWidth; col++) { + const GLuint pixel = ((const GLuint *) src)[col]; + *d++ = FX_rgb_scale_5[ pixel & 0x1f]; + *d++ = FX_rgb_scale_5[(pixel >> 5) & 0x1f]; + *d++ = FX_rgb_scale_5[(pixel >> 10) & 0x1f]; + *d++ = FX_rgb_scale_5[(pixel >> 16) & 0x1f]; + *d++ = FX_rgb_scale_5[(pixel >> 21) & 0x1f]; + *d++ = FX_rgb_scale_5[(pixel >> 26) & 0x1f]; + } + if (extraPixel) { + GLushort pixel = src[width - 1]; + *d++ = FX_rgb_scale_5[ pixel & 0x1f]; + *d++ = FX_rgb_scale_5[(pixel >> 5) & 0x1f]; + *d++ = FX_rgb_scale_5[(pixel >> 10) & 0x1f]; + } + dst += dstStride; + src -= srcStride; + } + } + else if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) { + /* convert 5R6G5B into 8R8G8B8A */ + GLint row, col; + const GLint halfWidth = width >> 1; + const GLint extraPixel = (width & 1); + for (row = 0; row < height; row++) { + GLubyte *d = dst; + for (col = 0; col < halfWidth; col++) { + const GLuint pixel = ((const GLuint *) src)[col]; + *d++ = FX_rgb_scale_5[ pixel & 0x1f]; + *d++ = FX_rgb_scale_5[(pixel >> 5) & 0x1f]; + *d++ = FX_rgb_scale_5[(pixel >> 10) & 0x1f]; + *d++ = (pixel & 0x8000) ? 255 : 0; + *d++ = FX_rgb_scale_5[(pixel >> 16) & 0x1f]; + *d++ = FX_rgb_scale_5[(pixel >> 21) & 0x1f]; + *d++ = FX_rgb_scale_5[(pixel >> 26) & 0x1f]; + *d++ = (pixel & 0x80000000) ? 255 : 0; + } + if (extraPixel) { + const GLushort pixel = src[width - 1]; + *d++ = FX_rgb_scale_5[ pixel & 0x1f]; + *d++ = FX_rgb_scale_5[(pixel >> 5) & 0x1f]; + *d++ = FX_rgb_scale_5[(pixel >> 10) & 0x1f]; + *d++ = (pixel & 0x8000) ? 255 : 0; + } + dst += dstStride; + src -= srcStride; + } + } + else if (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5) { + /* directly memcpy 5R5G5B pixels into client's buffer */ + const GLint widthInBytes = width * 2; + GLint row; + for (row = 0; row < height; row++) { + MEMCPY(dst, src, widthInBytes); + dst += dstStride; + src -= srcStride; + } + } + else { + grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB); + END_BOARD_LOCK(); + _swrast_ReadPixels(ctx, x, y, width, height, format, type, + packing, dstImage); + return; + } + + grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB); + } + END_BOARD_LOCK(); + } +} + +static void fxDDReadPixels888 (GLcontext * ctx, + GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *packing, + GLvoid *dstImage) +{ + if (ctx->_ImageTransferState) { + _swrast_ReadPixels(ctx, x, y, width, height, format, type, + packing, dstImage); + return; + } + else { + fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + GrLfbInfo_t info; + + BEGIN_BOARD_LOCK(); + if (grLfbLock(GR_LFB_READ_ONLY, + fxMesa->currentFB, + GR_LFBWRITEMODE_ANY, + GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) { + const GLint winX = 0; + const GLint winY = fxMesa->height - 1; + const GLint srcStride = info.strideInBytes / 4; /* stride in GLuints */ + const GLuint *src = (const GLuint *) info.lfbPtr + + (winY - y) * srcStride + (winX + x); + GLubyte *dst = (GLubyte *) _mesa_image_address(packing, dstImage, + width, height, format, + type, 0, 0, 0); + GLint dstStride = + _mesa_image_row_stride(packing, width, format, type); + + if (format == GL_RGB && type == GL_UNSIGNED_BYTE) { + /* convert 8A8R8G8B into 8R8G8B */ + GLint row, col; + for (row = 0; row < height; row++) { + GLubyte *d = dst; + for (col = 0; col < width; col++) { + const GLuint pixel = ((const GLuint *) src)[col]; + *d++ = pixel >> 16; + *d++ = pixel >> 8; + *d++ = pixel; + } + dst += dstStride; + src -= srcStride; + } + } + else if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) { + /* directly memcpy 8A8R8G8B pixels into client's buffer */ + const GLint widthInBytes = width * 4; + GLint row; + for (row = 0; row < height; row++) { + MEMCPY(dst, src, widthInBytes); + dst += dstStride; + src -= srcStride; + } + } + else if (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5) { + /* convert 8A8R8G8B into 5R5G5B */ + } + else { + grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB); + END_BOARD_LOCK(); + _swrast_ReadPixels(ctx, x, y, width, height, format, type, + packing, dstImage); + return; + } + + grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB); + } + END_BOARD_LOCK(); + } +} static void @@ -804,7 +1001,7 @@ fxDDInitExtensions(GLcontext * ctx) { fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; - _mesa_add_extension(ctx, GL_TRUE, "3DFX_set_global_palette", 0); + /*_mesa_add_extension(ctx, GL_TRUE, "3DFX_set_global_palette", 0);*/ _mesa_enable_extension(ctx, "GL_EXT_point_parameters"); _mesa_enable_extension(ctx, "GL_EXT_paletted_texture"); _mesa_enable_extension(ctx, "GL_EXT_texture_lod_bias"); @@ -1009,7 +1206,20 @@ fxSetupDDPointers(GLcontext * ctx) ctx->Driver.Bitmap = fxDDDrawBitmap; ctx->Driver.CopyPixels = _swrast_CopyPixels; ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = fxDDReadPixels; + { + fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + switch (fxMesa->colDepth) { + case 15: + ctx->Driver.ReadPixels = fxDDReadPixels555; + break; + case 16: + ctx->Driver.ReadPixels = fxDDReadPixels; + break; + case 32: + ctx->Driver.ReadPixels = fxDDReadPixels888; + break; + } + } ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; ctx->Driver.Finish = fxDDFinish; ctx->Driver.Flush = NULL; diff --git a/src/mesa/drivers/glide/fxddspan.c b/src/mesa/drivers/glide/fxddspan.c index 04d832d8d9f..e106ce291e2 100644 --- a/src/mesa/drivers/glide/fxddspan.c +++ b/src/mesa/drivers/glide/fxddspan.c @@ -1,4 +1,9 @@ -/* $Id: fxddspan.c,v 1.22 2002/11/04 20:29:04 brianp Exp $ */ +/* Hack alert: + * Depth32 functions won't compile with Glide2 + * Optimize and check endianess for `read_R8G8B8_pixels' + */ + +/* $Id: fxddspan.c,v 1.23 2003/07/17 14:50:12 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -42,6 +47,7 @@ #if defined(FX) #include "fxdrv.h" +#include "fxglidew.h" #include "swrast/swrast.h" #ifdef _MSC_VER @@ -347,6 +353,69 @@ read_R5G6B5_span(const GLcontext * ctx, END_BOARD_LOCK(); } +/* + * Read a span of 15-bit RGB pixels. Note, we don't worry about cliprects + * since OpenGL says obscured pixels have undefined values. + */ +static void read_R5G5B5_span (const GLcontext * ctx, + GLuint n, + GLint x, GLint y, + GLubyte rgba[][4]) +{ + fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + GrLfbInfo_t info; + BEGIN_BOARD_LOCK(); + if (grLfbLock(GR_LFB_READ_ONLY, + fxMesa->currentFB, + GR_LFBWRITEMODE_ANY, GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) { + const GLint winX = 0; + const GLint winY = fxMesa->height - 1; + const GLint srcStride = info.strideInBytes / 2; /* stride in GLushorts */ + const GLushort *data16 = (const GLushort *) info.lfbPtr + + (winY - y) * srcStride + (winX + x); + const GLuint *data32 = (const GLuint *) data16; + GLuint i, j; + GLuint extraPixel = (n & 1); + n -= extraPixel; + for (i = j = 0; i < n; i += 2, j++) { + GLuint pixel = data32[j]; + rgba[i][RCOMP] = FX_rgb_scale_5[ pixel & 0x1f]; + rgba[i][GCOMP] = FX_rgb_scale_5[(pixel >> 5) & 0x1f]; + rgba[i][BCOMP] = FX_rgb_scale_5[(pixel >> 10) & 0x1f]; + rgba[i][ACOMP] = (pixel & 0x8000) ? 255 : 0; + rgba[i + 1][RCOMP] = FX_rgb_scale_5[(pixel >> 16) & 0x1f]; + rgba[i + 1][GCOMP] = FX_rgb_scale_5[(pixel >> 21) & 0x1f]; + rgba[i + 1][BCOMP] = FX_rgb_scale_5[(pixel >> 26) & 0x1f]; + rgba[i + 1][ACOMP] = (pixel & 0x80000000) ? 255 : 0; + } + if (extraPixel) { + GLushort pixel = data16[n]; + rgba[n][RCOMP] = FX_rgb_scale_5[ pixel & 0x1f]; + rgba[n][GCOMP] = FX_rgb_scale_5[(pixel >> 5) & 0x1f]; + rgba[n][BCOMP] = FX_rgb_scale_5[(pixel >> 10) & 0x1f]; + rgba[n][ACOMP] = (pixel & 0x8000) ? 255 : 0; + } + + grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB); + } + END_BOARD_LOCK(); +} + +/* + * Read a span of 32-bit RGB pixels. Note, we don't worry about cliprects + * since OpenGL says obscured pixels have undefined values. + */ +static void read_R8G8B8_span (const GLcontext * ctx, + GLuint n, + GLint x, GLint y, + GLubyte rgba[][4]) +{ + fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + BEGIN_BOARD_LOCK(); + FX_grLfbReadRegion(fxMesa->currentFB, x, fxMesa->height - 1 - y, n, 1, n * 4, rgba); + END_BOARD_LOCK(); +} + /************************************************************************/ /***** Pixel functions *****/ @@ -424,6 +493,68 @@ read_R5G6B5_pixels(const GLcontext * ctx, } +static void read_R5G5B5_pixels (const GLcontext * ctx, + GLuint n, + const GLint x[], const GLint y[], + GLubyte rgba[][4], + const GLubyte mask[]) +{ + fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + GrLfbInfo_t info; + BEGIN_BOARD_LOCK(); + if (grLfbLock(GR_LFB_READ_ONLY, + fxMesa->currentFB, + GR_LFBWRITEMODE_ANY, GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) { + const GLint srcStride = info.strideInBytes / 2; /* stride in GLushorts */ + const GLint winX = 0; + const GLint winY = fxMesa->height - 1; + GLuint i; + for (i = 0; i < n; i++) { + if (mask[i]) { + const GLushort *data16 = (const GLushort *) info.lfbPtr + + (winY - y[i]) * srcStride + (winX + x[i]); + const GLushort pixel = *data16; + rgba[i][RCOMP] = FX_rgb_scale_5[ pixel & 0x1f]; + rgba[i][GCOMP] = FX_rgb_scale_5[(pixel >> 5) & 0x1f]; + rgba[i][BCOMP] = FX_rgb_scale_5[(pixel >> 10) & 0x1f]; + rgba[i][ACOMP] = (pixel & 0x8000) ? 255 : 0; + } + } + grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB); + } + END_BOARD_LOCK(); +} + + +static void +read_R8G8B8_pixels(const GLcontext * ctx, + GLuint n, const GLint x[], const GLint y[], + GLubyte rgba[][4], const GLubyte mask[]) +{ + fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + GrLfbInfo_t info; + BEGIN_BOARD_LOCK(); + if (grLfbLock(GR_LFB_READ_ONLY, + fxMesa->currentFB, + GR_LFBWRITEMODE_ANY, GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) { + const GLint srcStride = info.strideInBytes / 4; /* stride in GLuints */ + const GLint winX = 0; + const GLint winY = fxMesa->height - 1; + GLuint i; + for (i = 0; i < n; i++) { + if (mask[i]) { + const GLuint *data32 = (const GLuint *) info.lfbPtr + + (winY - y[i]) * srcStride + (winX + x[i]); + const GLuint pixel = *data32; + *(GLuint *)&rgba[i][0] = pixel; + } + } + grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB); + } + END_BOARD_LOCK(); +} + + /************************************************************************/ /***** Depth functions *****/ @@ -464,6 +595,35 @@ fxDDWriteDepthSpan(GLcontext * ctx, } +void +fxDDWriteDepth32Span(GLcontext * ctx, + GLuint n, GLint x, GLint y, const GLdepth depth[], + const GLubyte mask[]) +{ + fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + GLint bottom = fxMesa->height - 1; + + if (MESA_VERBOSE & VERBOSE_DRIVER) { + fprintf(stderr, "fxmesa: fxDDWriteDepth32Span(...)\n"); + } + + + if (mask) { + GLint i; + for (i = 0; i < n; i++) { + if (mask[i]) { + writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, x + i, bottom - y, + GR_LFBWRITEMODE_Z32, 1, 1, 0, (void *) &depth[i]); + } + } + } + else { + writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, x, bottom - y, + GR_LFBWRITEMODE_Z32, n, 1, 0, (void *) depth); + } +} + + void fxDDReadDepthSpan(GLcontext * ctx, GLuint n, GLint x, GLint y, GLdepth depth[]) @@ -484,6 +644,21 @@ fxDDReadDepthSpan(GLcontext * ctx, } +void +fxDDReadDepth32Span(GLcontext * ctx, + GLuint n, GLint x, GLint y, GLdepth depth[]) +{ + fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + GLint bottom = fxMesa->height - 1; + + if (MESA_VERBOSE & VERBOSE_DRIVER) { + fprintf(stderr, "fxmesa: fxDDReadDepth32Span(...)\n"); + } + + FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth); +} + + void fxDDWriteDepthPixels(GLcontext * ctx, @@ -510,6 +685,30 @@ fxDDWriteDepthPixels(GLcontext * ctx, } +void +fxDDWriteDepth32Pixels(GLcontext * ctx, + GLuint n, const GLint x[], const GLint y[], + const GLdepth depth[], const GLubyte mask[]) +{ + fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + GLint bottom = fxMesa->height - 1; + GLuint i; + + if (MESA_VERBOSE & VERBOSE_DRIVER) { + fprintf(stderr, "fxmesa: fxDDWriteDepth32Pixels(...)\n"); + } + + for (i = 0; i < n; i++) { + if (mask[i]) { + int xpos = x[i]; + int ypos = bottom - y[i]; + writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, xpos, ypos, + GR_LFBWRITEMODE_Z32, 1, 1, 0, (void *) &depth[i]); + } + } +} + + void fxDDReadDepthPixels(GLcontext * ctx, GLuint n, const GLint x[], const GLint y[], GLdepth depth[]) @@ -532,6 +731,26 @@ fxDDReadDepthPixels(GLcontext * ctx, GLuint n, } +void +fxDDReadDepth32Pixels(GLcontext * ctx, GLuint n, + const GLint x[], const GLint y[], GLdepth depth[]) +{ + fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + GLint bottom = fxMesa->height - 1; + GLuint i; + + if (MESA_VERBOSE & VERBOSE_DRIVER) { + fprintf(stderr, "fxmesa: fxDDReadDepth32Pixels(...)\n"); + } + + for (i = 0; i < n; i++) { + int xpos = x[i]; + int ypos = bottom - y[i]; + FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, xpos, ypos, 1, 1, 0, &depth[i]); + } +} + + /* Set the buffer used for reading */ /* XXX support for separate read/draw buffers hasn't been tested */ @@ -573,14 +792,36 @@ fxSetupDDSpanPointers(GLcontext * ctx) swdd->WriteRGBAPixels = fxDDWriteRGBAPixels; swdd->WriteMonoRGBAPixels = fxDDWriteMonoRGBAPixels; - swdd->WriteDepthSpan = fxDDWriteDepthSpan; - swdd->WriteDepthPixels = fxDDWriteDepthPixels; - swdd->ReadDepthSpan = fxDDReadDepthSpan; - swdd->ReadDepthPixels = fxDDReadDepthPixels; - /* swdd->ReadRGBASpan =fxDDReadRGBASpan; */ - swdd->ReadRGBASpan = read_R5G6B5_span; - swdd->ReadRGBAPixels = read_R5G6B5_pixels; + { + fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + switch (fxMesa->colDepth) { + case 15: + swdd->ReadRGBASpan = read_R5G5B5_span; + swdd->ReadRGBAPixels = read_R5G5B5_pixels; + swdd->WriteDepthSpan = fxDDWriteDepthSpan; + swdd->WriteDepthPixels = fxDDWriteDepthPixels; + swdd->ReadDepthSpan = fxDDReadDepthSpan; + swdd->ReadDepthPixels = fxDDReadDepthPixels; + break; + case 16: + swdd->ReadRGBASpan = read_R5G6B5_span; + swdd->ReadRGBAPixels = read_R5G6B5_pixels; + swdd->WriteDepthSpan = fxDDWriteDepthSpan; + swdd->WriteDepthPixels = fxDDWriteDepthPixels; + swdd->ReadDepthSpan = fxDDReadDepthSpan; + swdd->ReadDepthPixels = fxDDReadDepthPixels; + break; + case 32: + swdd->ReadRGBASpan = read_R8G8B8_span; + swdd->ReadRGBAPixels = read_R8G8B8_pixels; + swdd->WriteDepthSpan = fxDDWriteDepth32Span; + swdd->WriteDepthPixels = fxDDWriteDepth32Pixels; + swdd->ReadDepthSpan = fxDDReadDepth32Span; + swdd->ReadDepthPixels = fxDDReadDepth32Pixels; + break; + } + } } diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h index c7e1b5aa7a4..56d76634fb5 100644 --- a/src/mesa/drivers/glide/fxdrv.h +++ b/src/mesa/drivers/glide/fxdrv.h @@ -1,4 +1,4 @@ -/* $Id: fxdrv.h,v 1.56 2003/01/08 21:32:33 brianp Exp $ */ +/* $Id: fxdrv.h,v 1.57 2003/07/17 14:50:12 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -334,6 +334,8 @@ extern GLubyte FX_PixelToR[0x10000]; extern GLubyte FX_PixelToG[0x10000]; extern GLubyte FX_PixelToB[0x10000]; +/* lookup table for scaling 5 bit colors up to 8 bits */ +GLuint FX_rgb_scale_5[32]; typedef void (*fx_tri_func) (fxMesaContext, GrVertex *, GrVertex *, GrVertex *); typedef void (*fx_line_func) (fxMesaContext, GrVertex *, GrVertex *); @@ -440,6 +442,8 @@ struct tfxMesaContext int clipMaxX; int clipMinY; int clipMaxY; + + int colDepth; }; diff --git a/src/mesa/drivers/glide/fxglidew.c b/src/mesa/drivers/glide/fxglidew.c index e45dfabcec9..950dfdbc86c 100644 --- a/src/mesa/drivers/glide/fxglidew.c +++ b/src/mesa/drivers/glide/fxglidew.c @@ -1,4 +1,4 @@ -/* $Id: fxglidew.c,v 1.19 2001/09/23 16:50:01 brianp Exp $ */ +/* $Id: fxglidew.c,v 1.20 2003/07/17 14:50:12 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -386,6 +386,13 @@ FX_grSstQueryHardware(GrHwConfiguration * config) grGet(GR_REVISION_TMU, 4, &result); config->SSTs[i].sstBoard.VoodooConfig.tmuConfig[j].tmuRev = result; } + + { + const char *extension = grGetString(GR_EXTENSION); + if (strstr(extension, " PIXEXT ")) { + config->SSTs[i].sstBoard.VoodooConfig.gExt.grSstWinOpen = grGetProcAddress("grSstWinOpenExt"); + } + } } END_BOARD_LOCK(); return 1; @@ -428,15 +435,25 @@ FX_grSstQueryHardware(GrHwConfiguration * c) /* It appears to me that this function is needed either way. */ FX_GrContext_t -FX_grSstWinOpen(FxU32 hWnd, +FX_grSstWinOpen(struct SstCard_St *c, + FxU32 hWnd, GrScreenResolution_t screen_resolution, GrScreenRefresh_t refresh_rate, GrColorFormat_t color_format, + GrPixelFormat_t pixel_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers) { FX_GrContext_t i; BEGIN_BOARD_LOCK(); + if ((c->type == GR_SSTTYPE_VOODOO) && c->sstBoard.VoodooConfig.gExt.grSstWinOpen) { + i = c->sstBoard.VoodooConfig.gExt.grSstWinOpen(hWnd, + screen_resolution, + refresh_rate, + color_format, origin_location, + pixel_format, + nColBuffers, nAuxBuffers); + } else i = grSstWinOpen(hWnd, screen_resolution, refresh_rate, diff --git a/src/mesa/drivers/glide/fxglidew.h b/src/mesa/drivers/glide/fxglidew.h index 1efe1501409..1ef3451d92a 100644 --- a/src/mesa/drivers/glide/fxglidew.h +++ b/src/mesa/drivers/glide/fxglidew.h @@ -1,4 +1,4 @@ -/* $Id: fxglidew.h,v 1.13 2001/09/23 16:50:01 brianp Exp $ */ +/* $Id: fxglidew.h,v 1.14 2003/07/17 14:50:12 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -42,7 +42,9 @@ */ #if !defined(FX_GLIDE3) typedef FxU32 FX_GrContext_t; /* Not used in Glide2 */ +typedef FxU32 GrPixelFormat_t; #else +#include typedef GrContext_t FX_GrContext_t; #endif @@ -117,6 +119,9 @@ typedef struct GrVoodooConfig_St int fbiRev; /* Rev of Pixelfx chip */ int nTexelfx; /* How many texelFX chips are there? */ FxBool sliDetect; /* Is it a scan-line interleaved board? */ + struct { /* Glide extensions */ + GrProc grSstWinOpen; + } gExt; GrTMUConfig_t tmuConfig[GLIDE_NUM_TMU]; /* Configuration of the Texelfx chips */ } GrVoodooConfig_t; @@ -140,7 +145,7 @@ GrAT3DConfig_t; typedef struct { int num_sst; /* # of HW units in the system */ - struct + struct SstCard_St { GrSstType type; /* Which hardware is it? */ union SstBoard_u @@ -474,10 +479,12 @@ extern void FX_grGammaCorrectionValue(float val); #endif -extern FX_GrContext_t FX_grSstWinOpen(FxU32 hWnd, +extern FX_GrContext_t FX_grSstWinOpen(struct SstCard_St *c, + FxU32 hWnd, GrScreenResolution_t screen_resolution, GrScreenRefresh_t refresh_rate, GrColorFormat_t color_format, + GrPixelFormat_t pixel_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers); -- cgit v1.2.3 From 389858ee7b5207d356c9211386024af8ff9797f5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 21 Jul 2003 04:30:25 +0000 Subject: tokens, functions for GL_MESA_program_debug --- include/GL/gl.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 260b59ac386..4bcd43e41c4 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2673,6 +2673,33 @@ typedef void (APIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC)(GLuint id, GLenum pname, #endif /* GL_ARB_occlusion_query */ +#ifndef GL_MESA_program_debug +#define GL_MESA_program_debug 1 + +#define GL_FRAGMENT_PROGRAM_POSITION_MESA 0x9900 +#define GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x9901 +#define GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x9902 +#define GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x9903 +#define GL_VERTEX_PROGRAM_POSITION_MESA 0x9904 +#define GL_VERTEX_PROGRAM_CALLBACK_MESA 0x9905 +#define GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x9906 +#define GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x9907 + +typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data); + +extern void +glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, + GLvoid *data); + +extern void +glGetProgramRegisterfvMESA(GLenum target, + GLsizei len, const GLubyte *registerName, + GLfloat *v); + +#endif /* GL_MESA_program_debug */ + + + /********************************************************************** * Begin system-specific stuff */ -- cgit v1.2.3 From 9d73b81068182b72e332b762786d3e89f8dcac71 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 19 Aug 2003 01:08:24 +0000 Subject: Fix glPixelMap: s/GLint/GLsizei/ --- include/GL/gl.h | 6 +++--- src/mesa/main/pixel.c | 10 +++++----- src/mesa/main/pixel.h | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 4bcd43e41c4..52765c37b45 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1197,11 +1197,11 @@ GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param ); GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param ); GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param ); -GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLint mapsize, +GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ); -GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLint mapsize, +GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLsizei mapsize, const GLuint *values ); -GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLint mapsize, +GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLsizei mapsize, const GLushort *values ); GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values ); diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index 80ddeb270bd..e0c792b4f18 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -1,9 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 4.1 + * Version: 5.1 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2003 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"), @@ -255,7 +255,7 @@ _mesa_PixelStoref( GLenum pname, GLfloat param ) void -_mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ) +_mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ) { GLint i; GET_CURRENT_CONTEXT(ctx); @@ -353,7 +353,7 @@ _mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ) void -_mesa_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values ) +_mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ) { const GLint n = MIN2(mapsize, MAX_PIXEL_MAP_TABLE); GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; @@ -374,7 +374,7 @@ _mesa_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values ) void -_mesa_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values ) +_mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ) { const GLint n = MIN2(mapsize, MAX_PIXEL_MAP_TABLE); GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; diff --git a/src/mesa/main/pixel.h b/src/mesa/main/pixel.h index e5594537693..e41d6b1d83f 100644 --- a/src/mesa/main/pixel.h +++ b/src/mesa/main/pixel.h @@ -5,9 +5,9 @@ /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 5.1 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2003 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"), @@ -48,13 +48,13 @@ extern void _mesa_GetPixelMapusv( GLenum map, GLushort *values ); extern void -_mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ); +_mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ); extern void -_mesa_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values ); +_mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ); extern void -_mesa_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values ); +_mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ); extern void _mesa_PixelStoref( GLenum pname, GLfloat param ); -- cgit v1.2.3 From 9ec58c2c5bbf90428a0e8e1c4f4af3805c602cd3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 19 Aug 2003 15:52:51 +0000 Subject: DOS and glide driver updates from Daniel Borca --- Makefile.DJ | 10 +- Makefile.mgw | 4 +- docs/README.DJ | 26 +- include/GL/dmesa.h | 6 +- include/GL/fxmesa.h | 4 +- include/GL/glut.h | 2 +- progs/samples/Makefile.DJ | 15 +- src/glu/mesa/Makefile.DJ | 10 +- src/glu/sgi/Makefile.DJ | 10 +- src/glut/dos/Makefile.DJ | 10 +- src/glut/dos/glutint.h | 24 +- src/glut/dos/init.c | 73 ++- src/glut/dos/state.c | 6 +- src/glut/dos/window.c | 69 ++- src/glut/glx/glut_bitmap.c | 2 +- src/glut/glx/glut_bwidth.c | 4 +- src/glut/glx/glut_stroke.c | 2 +- src/glut/glx/glut_swidth.c | 4 +- src/mesa/Makefile.DJ | 32 +- src/mesa/drivers/dos/dmesa.c | 32 +- src/mesa/drivers/glide/fxapi.c | 248 ++++------ src/mesa/drivers/glide/fxdd.c | 169 +++---- src/mesa/drivers/glide/fxddspan.c | 75 +-- src/mesa/drivers/glide/fxddtex.c | 205 ++++++-- src/mesa/drivers/glide/fxdrv.h | 19 +- src/mesa/drivers/glide/fxglidew.c | 278 +++-------- src/mesa/drivers/glide/fxglidew.h | 780 ++++++------------------------ src/mesa/drivers/glide/fxopengl.def | 934 ++++++++++++++++++------------------ src/mesa/drivers/glide/fxsetup.c | 196 ++++---- src/mesa/drivers/glide/fxtexman.c | 66 ++- src/mesa/drivers/glide/fxwgl.c | 416 ++++++++-------- 31 files changed, 1559 insertions(+), 2172 deletions(-) (limited to 'include') diff --git a/Makefile.DJ b/Makefile.DJ index 78207d9ed14..f7c8277fe5f 100644 --- a/Makefile.DJ +++ b/Makefile.DJ @@ -23,7 +23,7 @@ # DOS/DJGPP makefile v1.4 for Mesa # # Copyright (C) 2002 - Borca Daniel -# Email : dborca@yahoo.com +# Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca @@ -32,12 +32,12 @@ # # Environment variables: # CPU optimize for the given processor. -# default = k6 +# default = pentium # GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++) # or `mesa'. # default = mesa -# GLIDE path to Glide3 SDK include files; used with FX. -# default = $(TOP)/include/glide3 +# GLIDE path to Glide3 SDK; used with FX. +# default = $(TOP)/glide3 # FX=1 build for 3dfx Glide3. Note that this disables # compilation of most DMesa code and requires fxMesa. # As a consequence, you'll need the DJGPP Glide3 @@ -70,7 +70,7 @@ .PHONY : all libgl libglu libglut clean realclean -CPU ?= k6 +CPU ?= pentium GLU ?= mesa diff --git a/Makefile.mgw b/Makefile.mgw index 8a95b2582f6..77d6c97f75b 100644 --- a/Makefile.mgw +++ b/Makefile.mgw @@ -32,7 +32,7 @@ # # Environment variables: # CPU optimize for the given processor. -# default = k6 +# default = pentium # GLIDE path to Glide3 SDK; used with FX. # default = $(TOP)/glide3 # FX=1 build for 3dfx Glide3. Note that this disables @@ -62,7 +62,7 @@ .PHONY : all libgl clean realclean -CPU ?= k6 +CPU ?= pentium CFLAGS = -Wall -W -pedantic CFLAGS += -O2 -ffast-math -mcpu=$(CPU) diff --git a/docs/README.DJ b/docs/README.DJ index 26fd9d05396..0ca479163ff 100644 --- a/docs/README.DJ +++ b/docs/README.DJ @@ -31,12 +31,12 @@ Available options: Environment variables: CPU optimize for the given processor. - default = k6 + default = pentium GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++) or `mesa'. default = mesa - GLIDE path to Glide3 SDK include files; used with FX. - default = $(TOP)/include/glide3 + GLIDE path to Glide3 SDK; used with FX. + default = $(TOP)/glide3 FX=1 build for 3dfx Glide3. Note that this disables compilation of most DMesa code and requires fxMesa. As a consequence, you'll need the DJGPP Glide3 @@ -70,7 +70,7 @@ Tested on: CPU: AMD Athlon XP 1800+ Mainboard: EP-8KTA3 w/ 128 MB SDRAM Video card: Voodoo5 5500 AGP w/ 64 MB SDRAM - DJGPP: djdev 2.04 + gcc v3.2.2 + make v3.79.1 + DJGPP: djdev 2.04 + gcc v3.2.2 + make v3.80 OS: DOS and Win98SE @@ -119,12 +119,6 @@ FAQ: lazy programmer and I found that the easiest way to keep buffer handling at peak performance ;-). - Q) My demo doesn't display text. I know I used the GLUT font routines! - A) Then you probably use GLUT as a DXE. Well, there is no direct access to - variables due to the way DXE works. Read the documentation. The author of - GLUT took this into account for _WIN32 DLL's only; I don't want to modify - his headers. The only workaround is to link GLUT the old way :-( - Q) The GLUT is incomplete. A) See below. @@ -173,9 +167,12 @@ position far to the right (or way down); then you can move them back to any position right before the main loop. The following environment variables can customize GLUT behaviour: + GLUT_FPS - print frames/second statistics to stderr DMESA_GLUT_REFRESH - set vertical screen refresh rate (VESA3) DMESA_GLUT_BPP - set default bits per pixel (VGA needs 8) - GLUT_FPS - print frames/second statistics to stderr + DMESA_GLUT_DEPTH - set default depth bits + DMESA_GLUT_STENCIL - set default stencil bits + DMESA_GLUT_ACCUM - set default accum bits @@ -212,8 +209,11 @@ v1.3 (mar-2003) * revamped GLUT * switched to DXE3 -v1.4 (jun-2003) +v1.4 (aug-2003) + + enabled fonts with DXE + + truly added multi-window support in GLUT * accomodated makefiles with the new sourcetree + * hacked and slashed the 3dfx driver (w/ help from Hiroshi Morii) @@ -221,5 +221,5 @@ Contact: ~~~~~~~~ Name: Borca Daniel -E-mail: dborca@yahoo.com +E-mail: dborca@users.sourceforge.net WWW: http://www.geocities.com/dborca/ diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h index bb7d9b0cc96..7510fdb9f4e 100644 --- a/include/GL/dmesa.h +++ b/include/GL/dmesa.h @@ -23,10 +23,10 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa + * DOS/DJGPP device driver v1.4 for Mesa * * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com + * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca */ @@ -90,7 +90,7 @@ void DMesaDestroyContext (DMesaContext c); /* * Return a handle to the current context. */ -DMesaContext DMesaGetCurrentContext (void); +void *DMesaGetCurrentContext (void); diff --git a/include/GL/fxmesa.h b/include/GL/fxmesa.h index 7697c720073..42f6ed8d72c 100644 --- a/include/GL/fxmesa.h +++ b/include/GL/fxmesa.h @@ -76,7 +76,7 @@ GLAPI GLboolean GLAPIENTRY fxMesaSelectCurrentBoard(int n); GLAPI void GLAPIENTRY fxMesaMakeCurrent(fxMesaContext ctx); -GLAPI fxMesaContext GLAPIENTRY fxMesaGetCurrentContext(void); +GLAPI void * GLAPIENTRY fxMesaGetCurrentContext(void); GLAPI void GLAPIENTRY fxMesaSwapBuffers(void); @@ -88,6 +88,8 @@ GLAPI int GLAPIENTRY fxQueryHardware(void); GLAPI void GLAPIENTRY fxCloseHardware(void); +GLAPI void GLAPIENTRY fxGetScreenGeometry (GLint *w, GLint *h); + #if defined (__BEOS__) #pragma export off diff --git a/include/GL/glut.h b/include/GL/glut.h index 87fd6cee6c9..27d937f7ce8 100644 --- a/include/GL/glut.h +++ b/include/GL/glut.h @@ -350,7 +350,7 @@ WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *); #define GLUT_NORMAL 0 #define GLUT_OVERLAY 1 -#if defined(_WIN32) +#if defined(_WIN32) || defined (GLUT_IMPORT_LIB) /* Stroke font constants (use these in GLUT program). */ #define GLUT_STROKE_ROMAN ((void*)0) #define GLUT_STROKE_MONO_ROMAN ((void*)1) diff --git a/progs/samples/Makefile.DJ b/progs/samples/Makefile.DJ index 13b1c7221b4..f8b0ccda48d 100644 --- a/progs/samples/Makefile.DJ +++ b/progs/samples/Makefile.DJ @@ -23,7 +23,7 @@ # DOS/DJGPP samples makefile v1.4 for Mesa # # Copyright (C) 2002 - Borca Daniel -# Email : dborca@yahoo.com +# Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca @@ -32,9 +32,9 @@ # # Environment variables: # CPU optimize for the given processor. -# default = k6 -# GLIDE path to Glide3 SDK library files; used with FX. -# default = $(TOP)/lib/glide3 +# default = pentium +# GLIDE path to Glide3 SDK; used with FX. +# default = $(TOP)/glide3 # FX=1 build for 3dfx Glide3. Note that this disables # compilation of most DMesa code and requires fxMesa. # As a consequence, you'll need the DJGPP Glide3 @@ -53,13 +53,14 @@ .SUFFIXES : .c .o .exe TOP = ../.. -CPU ?= k6 -GLIDE ?= $(TOP)/lib/glide3 +CPU ?= pentium +GLIDE ?= $(TOP)/glide3 CC = gcc CFLAGS = -Wall -W -pedantic CFLAGS += -O2 -ffast-math -mcpu=$(CPU) CFLAGS += -I$(TOP)/include -I../util +CFLAGS += -DGLUT_IMPORT_LIB LD = gxx LDFLAGS = -s -L$(TOP)/lib @@ -69,7 +70,7 @@ LDLIBS += -liglut -liglu -ligl else LDLIBS = -lglut -lglu -lgl ifeq ($(FX),1) -LDFLAGS += -L$(GLIDE) +LDFLAGS += -L$(GLIDE)/lib LDLIBS += -lglid3 endif endif diff --git a/src/glu/mesa/Makefile.DJ b/src/glu/mesa/Makefile.DJ index 1e61080b49b..4d383cda315 100644 --- a/src/glu/mesa/Makefile.DJ +++ b/src/glu/mesa/Makefile.DJ @@ -23,7 +23,7 @@ # DOS/DJGPP glu makefile v1.4 for Mesa # # Copyright (C) 2002 - Borca Daniel -# Email : dborca@yahoo.com +# Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca @@ -48,7 +48,7 @@ GLU_LIB = libglu.a GLU_DXE = glu.dxe GLU_IMP = libiglu.a -export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR) +export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib CC = gcc CFLAGS += -I$(TOP)/include @@ -87,16 +87,14 @@ OBJECTS = $(SOURCES:.c=.o) all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP) $(LIBDIR)/$(GLU_LIB): $(OBJECTS) - $(AR) $(ARFLAGS) $(LIBDIR)/$(GLU_LIB) $(OBJECTS) + $(AR) $(ARFLAGS) $@ $^ $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS) ifeq ($(HAVEDXE3),) $(warning Missing DXE3 package... Skipping $(GLU_DXE)) else - -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU DJGPP" -E _glu -P gl.dxe -U $(OBJECTS) + -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU DJGPP" -E _glu -P gl.dxe -U $^ endif clean: -$(call UNLINK,*.o) - --include depend diff --git a/src/glu/sgi/Makefile.DJ b/src/glu/sgi/Makefile.DJ index 0facbc7ee92..b3bad70181c 100644 --- a/src/glu/sgi/Makefile.DJ +++ b/src/glu/sgi/Makefile.DJ @@ -23,7 +23,7 @@ # DOS/DJGPP glu makefile v1.4 for Mesa # # Copyright (C) 2002 - Borca Daniel -# Email : dborca@yahoo.com +# Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca @@ -48,7 +48,7 @@ GLU_LIB = libglu.a GLU_DXE = glu.dxe GLU_IMP = libiglu.a -export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR) +export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib CC = gcc CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include -Iinclude @@ -171,13 +171,13 @@ OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP) $(LIBDIR)/$(GLU_LIB): $(OBJECTS) - $(AR) $(ARFLAGS) $(LIBDIR)/$(GLU_LIB) $(OBJECTS) + $(AR) $(ARFLAGS) $@ $^ $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS) ifeq ($(HAVEDXE3),) $(warning Missing DXE3 package... Skipping $(GLU_DXE)) else - -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU/SGI DJGPP" -E _glu -P gl.dxe -U $(OBJECTS) + -dxe3gen -o $(LIBDIR)/$(GLU_DXE) -Y $(LIBDIR)/$(GLU_IMP) -D "MesaGLU/SGI DJGPP" -E _glu -P gl.dxe -U $^ endif clean: @@ -186,5 +186,3 @@ clean: -$(call UNLINK,libnurbs/interface/*.o) -$(call UNLINK,libnurbs/internals/*.o) -$(call UNLINK,libnurbs/nurbtess/*.o) - --include depend diff --git a/src/glut/dos/Makefile.DJ b/src/glut/dos/Makefile.DJ index c870d23d444..4586a0ba699 100644 --- a/src/glut/dos/Makefile.DJ +++ b/src/glut/dos/Makefile.DJ @@ -23,7 +23,7 @@ # DOS/DJGPP glut makefile v1.4 for Mesa # # Copyright (C) 2002 - Borca Daniel -# Email : dborca@yahoo.com +# Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca @@ -53,10 +53,11 @@ GLUT_LIB = libglut.a GLUT_DXE = glut.dxe GLUT_IMP = libiglut.a -export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR) +export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib CC = gcc CFLAGS += -I- -I$(TOP)/include -I. -I$(MKGLUT) -IPC_HW +CFLAGS += -DGLUT_IMPORT_LIB AR = ar ARFLAGS = rus @@ -78,6 +79,7 @@ CORE_SOURCES = \ mouse.c \ overlay.c \ state.c \ + util.c \ window.c PC_HW_SOURCES = \ @@ -119,13 +121,13 @@ OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) all: $(LIBDIR)/$(GLUT_LIB) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP) $(LIBDIR)/$(GLUT_LIB): $(OBJECTS) - $(AR) $(ARFLAGS) $(LIBDIR)/$(GLUT_LIB) $(OBJECTS) + $(AR) $(ARFLAGS) $@ $^ $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS) ifeq ($(HAVEDXE3),) $(warning Missing DXE3 package... Skipping $(GLUT_DXE)) else - -dxe3gen -o $(LIBDIR)/$(GLUT_DXE) -Y $(LIBDIR)/$(GLUT_IMP) -D "MesaGLUT DJGPP" -E _glut -P gl.dxe -P glu.dxe -U $(OBJECTS) + -dxe3gen -o $(LIBDIR)/$(GLUT_DXE) -Y $(LIBDIR)/$(GLUT_IMP) -D "MesaGLUT DJGPP" -E _glut -P gl.dxe -P glu.dxe -U $^ endif clean: diff --git a/src/glut/dos/glutint.h b/src/glut/dos/glutint.h index e8dffb581be..013b307e941 100644 --- a/src/glut/dos/glutint.h +++ b/src/glut/dos/glutint.h @@ -19,10 +19,10 @@ */ /* - * DOS/DJGPP glut driver v1.3 for Mesa + * DOS/DJGPP glut driver v1.4 for Mesa * * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com + * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca */ @@ -64,9 +64,11 @@ typedef void (GLUTCALLBACK *GLUTjoystickCB) (unsigned int, int, int, int); typedef struct GLUTwindow { int num; /* window id */ + DMesaContext context; DMesaBuffer buffer; int show_mouse; + GLboolean redisplay; /* GLUT settable or visible window state. */ int xpos; @@ -100,9 +102,10 @@ typedef struct GLUTwindow { extern GLUTidleCB g_idle_func; extern GLUTmenuStatusCB g_menu_status_func; -extern GLboolean g_redisplay; - extern GLuint g_bpp; /* HW: bits per pixel */ +extern GLuint g_depth; /* HW: depth bits */ +extern GLuint g_stencil; /* HW: stencil bits */ +extern GLuint g_accum; /* HW: accum bits */ extern GLuint g_refresh; /* HW: vertical refresh rate */ extern GLuint g_screen_w, g_screen_h; /* HW: physical screen size */ extern GLint g_driver_caps; @@ -117,6 +120,7 @@ extern int g_mouse; /* non-zero if mouse installed */ extern int g_mouse_x, g_mouse_y; /* mouse coords, relative to current win */ extern GLUTwindow *g_curwin; /* current window */ +extern GLUTwindow *g_windows[]; extern char *__glutProgramName; /* program name */ @@ -127,6 +131,10 @@ extern char * __glutStrdup(const char *string); extern void __glutWarning(char *format,...); extern void __glutFatalError(char *format,...); extern void __glutFatalUsage(char *format,...); +/* Private routines from util.c */ +#ifdef GLUT_IMPORT_LIB +extern void *__glutFont(void *font); +#endif @@ -137,14 +145,6 @@ extern void __glutFatalUsage(char *format,...); #define MAX_WINDOWS 2 -#define DEFAULT_WIDTH 300 -#define DEFAULT_HEIGHT 300 -#define DEFAULT_BPP 16 - -#define DEPTH_SIZE 16 -#define STENCIL_SIZE 8 -#define ACCUM_SIZE 16 - #define RESERVED_COLORS 0 #endif /* __glutint_h__ */ diff --git a/src/glut/dos/init.c b/src/glut/dos/init.c index 5d09561dac3..22bab9f8afc 100644 --- a/src/glut/dos/init.c +++ b/src/glut/dos/init.c @@ -19,10 +19,10 @@ */ /* - * DOS/DJGPP glut driver v1.3 for Mesa + * DOS/DJGPP glut driver v1.4 for Mesa * * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com + * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca */ @@ -31,11 +31,20 @@ #include "glutint.h" +#define DEFAULT_WIDTH 300 +#define DEFAULT_HEIGHT 300 +#define DEFAULT_BPP 16 + +#define DEPTH_SIZE 16 +#define STENCIL_SIZE 8 +#define ACCUM_SIZE 16 -GLboolean g_redisplay = GL_FALSE; GLuint g_bpp = DEFAULT_BPP; +GLuint g_depth = DEPTH_SIZE; +GLuint g_stencil = STENCIL_SIZE; +GLuint g_accum = ACCUM_SIZE; GLuint g_refresh = 0; GLuint g_screen_w, g_screen_h; GLint g_driver_caps; @@ -58,6 +67,15 @@ void APIENTRY glutInit (int *argc, char **argv) if ((env = getenv("DMESA_GLUT_BPP")) != NULL) { g_bpp = atoi(env); } + if ((env = getenv("DMESA_GLUT_DEPTH")) != NULL) { + g_depth = atoi(env); + } + if ((env = getenv("DMESA_GLUT_STENCIL")) != NULL) { + g_stencil = atoi(env); + } + if ((env = getenv("DMESA_GLUT_ACCUM")) != NULL) { + g_accum = atoi(env); + } if ((env = getenv("DMESA_GLUT_REFRESH")) != NULL) { g_refresh = atoi(env); } @@ -109,6 +127,7 @@ void APIENTRY glutInitWindowSize (int width, int height) void APIENTRY glutMainLoop (void) { + int i; GLboolean idle; static int old_mouse_x = 0; static int old_mouse_y = 0; @@ -125,29 +144,43 @@ void APIENTRY glutMainLoop (void) pc_install_keyb(); __glutInitMouse(); - glutPostRedisplay(); - if (g_curwin->reshape) { - g_curwin->reshape(g_curwin->width, g_curwin->height); - } - if (g_curwin->visibility) { - g_curwin->visibility(GLUT_VISIBLE); + for (i = 0; i < MAX_WINDOWS; i++) { + if (g_windows[i] != NULL) { + GLUTwindow *w = g_windows[i]; + glutSetWindow(w->num); + glutPostRedisplay(); + if (w->reshape) { + w->reshape(w->width, w->height); + } + if (w->visibility) { + w->visibility(GLUT_VISIBLE); + } + } } while (GL_TRUE) { idle = GL_TRUE; - if (g_redisplay && g_curwin->display) { - idle = GL_FALSE; - g_redisplay = GL_FALSE; - - if (g_curwin->show_mouse && !(g_display_mode & GLUT_DOUBLE)) { - /* XXX scare mouse */ - g_curwin->display(); - /* XXX unscare mouse */ - } else { - g_curwin->display(); - } + for (i = 0; i < MAX_WINDOWS; i++) { + if (g_windows[i] != NULL) { + GLUTwindow *w = g_windows[i]; + if (w->redisplay && w->display) { + idle = GL_FALSE; + w->redisplay = GL_FALSE; + + if (DMesaMakeCurrent(w->context, w->buffer)) { + if (w->show_mouse && !(g_display_mode & GLUT_DOUBLE)) { + /* XXX scare mouse */ + w->display(); + /* XXX unscare mouse */ + } else { + w->display(); + } + } + } + } } + DMesaMakeCurrent(g_curwin->context, g_curwin->buffer); if (g_mouse) { int mouse_x; diff --git a/src/glut/dos/state.c b/src/glut/dos/state.c index 245d2ef621c..e9d854cd4e1 100644 --- a/src/glut/dos/state.c +++ b/src/glut/dos/state.c @@ -19,7 +19,7 @@ */ /* - * DOS/DJGPP glut driver v1.3 for Mesa + * DOS/DJGPP glut driver v1.4 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@yahoo.com @@ -60,9 +60,9 @@ int APIENTRY glutGet (GLenum type) case GLUT_WINDOW_HEIGHT: return g_curwin->height; case GLUT_WINDOW_STENCIL_SIZE: - return STENCIL_SIZE; + return g_stencil; case GLUT_WINDOW_DEPTH_SIZE: - return DEPTH_SIZE; + return g_depth; case GLUT_WINDOW_RGBA: return !(g_display_mode & GLUT_INDEX); case GLUT_WINDOW_COLORMAP_SIZE: diff --git a/src/glut/dos/window.c b/src/glut/dos/window.c index cfc2f965c04..06e8ea9ead1 100644 --- a/src/glut/dos/window.c +++ b/src/glut/dos/window.c @@ -19,10 +19,10 @@ */ /* - * DOS/DJGPP glut driver v1.3 for Mesa + * DOS/DJGPP glut driver v1.4 for Mesa * * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com + * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca */ @@ -38,8 +38,7 @@ GLUTwindow *g_curwin; static GLuint swaptime, swapcount; static DMesaVisual visual = NULL; -static DMesaContext context = NULL; -static GLUTwindow *windows[MAX_WINDOWS]; +GLUTwindow *g_windows[MAX_WINDOWS]; @@ -50,7 +49,6 @@ static void clean (void) for (i=1; i<=MAX_WINDOWS; i++) { glutDestroyWindow(i); } - if (context) DMesaDestroyContext(context); if (visual) DMesaDestroyVisual(visual); pc_close_stdout(); @@ -64,53 +62,72 @@ int APIENTRY glutCreateWindow (const char *title) int i; int m8width = (g_init_w + 7) & ~7; + /* We set the Visual once. This will be our desktop (graphic mode). + * We should do this in the `glutInit' code, but we don't have any idea + * about its geometry. Supposedly, when we are about to create one + * window, we have a slight idea about resolution. + */ if (!visual) { if ((visual=DMesaCreateVisual(g_init_x + m8width, g_init_y + g_init_h, g_bpp, g_refresh, g_display_mode & GLUT_DOUBLE, !(g_display_mode & GLUT_INDEX), g_display_mode & GLUT_ALPHA, - g_display_mode & GLUT_DEPTH ?DEPTH_SIZE :0, - g_display_mode & GLUT_STENCIL?STENCIL_SIZE:0, - g_display_mode & GLUT_ACCUM ?ACCUM_SIZE :0))==NULL) { - return 0; - } - - if ((context=DMesaCreateContext(visual, NULL))==NULL) { - DMesaDestroyVisual(visual); + g_display_mode & GLUT_DEPTH ? g_depth :0, + g_display_mode & GLUT_STENCIL ? g_stencil:0, + g_display_mode & GLUT_ACCUM ? g_accum :0))==NULL) { return 0; } + /* Also hook stdio/stderr once */ pc_open_stdout(); pc_open_stderr(); pc_atexit(clean); } + /* Search for an empty slot. + * Each window has its own rendering Context and its own Buffer. + */ for (i=0; inum = ++i; w->xpos = g_init_x; w->ypos = g_init_y; w->width = m8width; w->height = g_init_h; + w->context = c; w->buffer = b; return i; @@ -131,10 +148,13 @@ int APIENTRY glutCreateSubWindow (int win, int x, int y, int width, int height) void APIENTRY glutDestroyWindow (int win) { - if (windows[--win]) { - DMesaDestroyBuffer(windows[win]->buffer); - free(windows[win]); - windows[win] = NULL; + if (g_windows[--win]) { + GLUTwindow *w = g_windows[win]; + DMesaMakeCurrent(NULL, NULL); + DMesaDestroyBuffer(w->buffer); + DMesaDestroyContext(w->context); + free(w); + g_windows[win] = NULL; } } @@ -142,7 +162,7 @@ void APIENTRY glutDestroyWindow (int win) void APIENTRY glutPostRedisplay (void) { - g_redisplay = GL_TRUE; + g_curwin->redisplay = GL_TRUE; } @@ -183,7 +203,8 @@ int APIENTRY glutGetWindow (void) void APIENTRY glutSetWindow (int win) { - g_curwin = windows[win - 1]; + g_curwin = g_windows[win - 1]; + DMesaMakeCurrent(g_curwin->context, g_curwin->buffer); } diff --git a/src/glut/glx/glut_bitmap.c b/src/glut/glx/glut_bitmap.c index f471167810e..8fec7f11710 100644 --- a/src/glut/glx/glut_bitmap.c +++ b/src/glut/glx/glut_bitmap.c @@ -16,7 +16,7 @@ glutBitmapCharacter(GLUTbitmapFont font, int c) GLint swapbytes, lsbfirst, rowlength; GLint skiprows, skippixels, alignment; -#if defined(_WIN32) +#if defined(_WIN32) || defined(GLUT_IMPORT_LIB) fontinfo = (BitmapFontPtr) __glutFont(font); #else fontinfo = (BitmapFontPtr) font; diff --git a/src/glut/glx/glut_bwidth.c b/src/glut/glx/glut_bwidth.c index 34776f8b0f3..f9cdb184da7 100644 --- a/src/glut/glx/glut_bwidth.c +++ b/src/glut/glx/glut_bwidth.c @@ -15,7 +15,7 @@ glutBitmapWidth(GLUTbitmapFont font, int c) BitmapFontPtr fontinfo; const BitmapCharRec *ch; -#ifdef _WIN32 +#if defined(_WIN32) || defined(GLUT_IMPORT_LIB) fontinfo = (BitmapFontPtr) __glutFont(font); #else fontinfo = (BitmapFontPtr) font; @@ -37,7 +37,7 @@ glutBitmapLength(GLUTbitmapFont font, const unsigned char *string) BitmapFontPtr fontinfo; const BitmapCharRec *ch; -#ifdef _WIN32 +#if defined(_WIN32) || defined(GLUT_IMPORT_LIB) fontinfo = (BitmapFontPtr) __glutFont(font); #else fontinfo = (BitmapFontPtr) font; diff --git a/src/glut/glx/glut_stroke.c b/src/glut/glx/glut_stroke.c index a7af66201fe..7569012ec4e 100644 --- a/src/glut/glx/glut_stroke.c +++ b/src/glut/glx/glut_stroke.c @@ -18,7 +18,7 @@ glutStrokeCharacter(GLUTstrokeFont font, int c) int i, j; -#if defined(_WIN32) +#if defined(_WIN32) || defined(GLUT_IMPORT_LIB) fontinfo = (StrokeFontPtr) __glutFont(font); #else fontinfo = (StrokeFontPtr) font; diff --git a/src/glut/glx/glut_swidth.c b/src/glut/glx/glut_swidth.c index d999b4d38c4..4717bbff5b1 100644 --- a/src/glut/glx/glut_swidth.c +++ b/src/glut/glx/glut_swidth.c @@ -15,7 +15,7 @@ glutStrokeWidth(GLUTstrokeFont font, int c) StrokeFontPtr fontinfo; const StrokeCharRec *ch; -#if defined(_WIN32) +#if defined(_WIN32) || defined(GLUT_IMPORT_LIB) fontinfo = (StrokeFontPtr) __glutFont(font); #else fontinfo = (StrokeFontPtr) font; @@ -37,7 +37,7 @@ glutStrokeLength(GLUTstrokeFont font, const unsigned char *string) StrokeFontPtr fontinfo; const StrokeCharRec *ch; -#if defined(_WIN32) +#if defined(_WIN32) || defined(GLUT_IMPORT_LIB) fontinfo = (StrokeFontPtr) __glutFont(font); #else fontinfo = (StrokeFontPtr) font; diff --git a/src/mesa/Makefile.DJ b/src/mesa/Makefile.DJ index ad9cd5b37b0..2d9c2d94efd 100644 --- a/src/mesa/Makefile.DJ +++ b/src/mesa/Makefile.DJ @@ -23,7 +23,7 @@ # DOS/DJGPP core makefile v1.4 for Mesa # # Copyright (C) 2002 - Borca Daniel -# Email : dborca@yahoo.com +# Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca @@ -33,8 +33,8 @@ # Environment variables: # CFLAGS # -# GLIDE path to Glide3 SDK include files; used with FX. -# default = $(TOP)/include/glide3 +# GLIDE path to Glide3 SDK; used with FX. +# default = $(TOP)/glide3 # FX=1 build for 3dfx Glide3. Note that this disables # compilation of most DMesa code and requires fxMesa. # As a consequence, you'll need the DJGPP Glide3 @@ -65,19 +65,19 @@ .INTERMEDIATE: x86/gen_matypes.exe TOP = ../.. -GLIDE ?= $(TOP)/include/glide3 +GLIDE ?= $(TOP)/glide3 LIBDIR = $(TOP)/lib GL_LIB = libgl.a GL_DXE = gl.dxe GL_IMP = libigl.a -export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR) +export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH);$(LIBDIR);$(GLIDE)/lib CC = gcc CFLAGS += -I$(TOP)/include -I. -Imain -Iglapi ifeq ($(FX),1) CFLAGS += -D__DOS__ -DH3 -CFLAGS += -I$(GLIDE) -DFX -DFX_GLIDE3 -DFXMESA_USE_ARGB +CFLAGS += -I$(GLIDE)/include -DFX LIBNAME = "MesaGL/FX DJGPP" else ifeq ($(MATROX),1) @@ -260,12 +260,12 @@ K3D_SOURCES = \ x86/3dnow_normal.S CORE_SOURCES = \ - $(MAIN_SOURCES) \ - $(GLAPI_SOURCES) \ - $(MATH_SOURCES) \ - $(ARRAY_CACHE_SOURCES) \ - $(SWRAST_SOURCES) \ - $(SWRAST_SETUP_SOURCES) \ + $(MAIN_SOURCES) \ + $(GLAPI_SOURCES) \ + $(MATH_SOURCES) \ + $(ARRAY_CACHE_SOURCES) \ + $(SWRAST_SOURCES) \ + $(SWRAST_SETUP_SOURCES) \ $(TNL_SOURCES) ifeq ($(HAVE_MMX),1) @@ -336,16 +336,16 @@ X86_OBJECTS = $(addsuffix .o,$(basename $(X86_SOURCES))) all: $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP) $(LIBDIR)/$(GL_LIB): $(OBJECTS) - $(AR) $(ARFLAGS) $(LIBDIR)/$(GL_LIB) $(OBJECTS) + $(AR) $(ARFLAGS) $@ $^ $(LIBDIR)/$(GL_DXE) $(LIBDIR)/$(GL_IMP): $(OBJECTS) ifeq ($(HAVEDXE3),) $(warning Missing DXE3 package... Skipping $(GL_DXE)) else ifeq ($(FX),1) - -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -P glid3.dxe -U $(OBJECTS) + -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -P glid3.dxe -U $^ else - -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -U $(OBJECTS) + -dxe3gen -o $(LIBDIR)/$(GL_DXE) -Y $(LIBDIR)/$(GL_IMP) -D $(LIBNAME) -E _gl -E _DMesa -U $^ endif endif @@ -369,5 +369,3 @@ clean: -$(call UNLINK,drivers/dos/*.o) -$(call UNLINK,drivers/dos/mga/*.o) -$(call UNLINK,drivers/glide/*.o) - --include depend diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index 92381307c28..7918fe9e9df 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -26,14 +26,14 @@ * DOS/DJGPP device driver v1.4 for Mesa * * Copyright (c) 2003 - Borca Daniel - * Email : dborca@yahoo.com + * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca */ -#ifndef FX #include "glheader.h" #include "context.h" +#ifndef FX #include "extensions.h" #include "macros.h" #include "matrix.h" @@ -58,7 +58,7 @@ #include "mga/mga.h" #endif /* MATROX */ #else /* FX */ -#include "../glide/fxdrv.h" +#include "GL/fxmesa.h" #endif /* FX */ #include "GL/dmesa.h" @@ -1142,7 +1142,7 @@ static const GLubyte* get_string (GLcontext *ctx, GLenum name) #ifdef MATROX " (MGA)" #endif - "\0port (c) Borca Daniel mar-2003"; + "\0port (c) Borca Daniel aug-2003"; default: return NULL; } @@ -1474,7 +1474,7 @@ void DMesaDestroyVisual (DMesaVisual v) #endif #else - fxMesaDestroyContext((fxMesaContext)v); + fxMesaDestroyContext((tdfxContextPtr)v); #endif } @@ -1536,7 +1536,7 @@ DMesaContext DMesaCreateContext (DMesaVisual visual, _mesa_enable_sw_extensions((GLcontext *)c); _mesa_enable_1_3_extensions((GLcontext *)c); _mesa_enable_1_4_extensions((GLcontext *)c); - _mesa_enable_1_5_extensions((GLcontext *)c); + _mesa_enable_1_5_extensions((GLcontext *)c); /* you probably have to do a bunch of other initializations here. */ c->visual = visual; @@ -1645,7 +1645,7 @@ GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b) } #else - fxMesaMakeCurrent((fxMesaContext)c); + fxMesaMakeCurrent((tdfxContextPtr)c); #endif return GL_TRUE; @@ -1682,13 +1682,13 @@ void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue) -DMesaContext DMesaGetCurrentContext (void) +void *DMesaGetCurrentContext (void) { #ifndef FX GET_CURRENT_CONTEXT(ctx); - return (DMesaContext)ctx; + return ctx; #else - return (DMesaContext)fxMesaGetCurrentContext(); + return fxMesaGetCurrentContext(); #endif } @@ -1696,14 +1696,7 @@ DMesaContext DMesaGetCurrentContext (void) int DMesaGetIntegerv (GLenum pname, GLint *params) { -#ifndef FX - GET_CURRENT_CONTEXT(ctx); - const DMesaContext c = (DMesaContext)ctx; -#else - const fxMesaContext c = fxMesaGetCurrentContext(); -#endif - - if (c == NULL) { + if (DMesaGetCurrentContext() == NULL) { return -1; } @@ -1716,8 +1709,7 @@ int DMesaGetIntegerv (GLenum pname, GLint *params) mga_get(MGA_GET_SCREEN_SIZE, params); #endif #else - params[0] = c->screen_width; - params[1] = c->screen_height; + fxGetScreenGeometry(¶ms[0], ¶ms[1]); #endif break; case DMESA_GET_DRIVER_CAPS: diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index bb87565296b..451c3a8ce2a 100644 --- a/src/mesa/drivers/glide/fxapi.c +++ b/src/mesa/drivers/glide/fxapi.c @@ -1,4 +1,4 @@ -/* $Id: fxapi.c,v 1.36 2003/07/17 14:50:12 brianp Exp $ */ +/* $Id: fxapi.c,v 1.37 2003/08/19 15:52:53 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -29,6 +29,8 @@ * Brian Paul * Daryll Strauss * Keith Whitwell + * Daniel Borca + * Hiroshi Morii */ @@ -103,10 +105,29 @@ fxMesaSelectCurrentBoard(int n) } -fxMesaContext GLAPIENTRY -fxMesaGetCurrentContext(void) +void * GLAPIENTRY fxMesaGetCurrentContext (void) +{ + GET_CURRENT_CONTEXT(ctx); + return ctx; +} + + +void GLAPIENTRY fxGetScreenGeometry (GLint *w, GLint *h) { - return fxMesaCurrentCtx; + GLint width = 0; + GLint height = 0; + + if (fxMesaCurrentCtx != NULL) { + width = fxMesaCurrentCtx->screen_width; + height = fxMesaCurrentCtx->screen_height; + } + + if (w != NULL) { + *w = width; + } + if (h != NULL) { + *h = height; + } } @@ -133,11 +154,7 @@ gl3DfxSetPaletteEXT(GLuint * pal) if (fxMesa) { fxMesa->haveGlobalPaletteTexture = 1; - FX_grTexDownloadTable(GR_TMU0, GR_TEXTABLE_PALETTE, - (GuTexPalette *) pal); - if (fxMesa->haveTwoTMUs) - FX_grTexDownloadTable(GR_TMU1, GR_TEXTABLE_PALETTE, - (GuTexPalette *) pal); + grTexDownloadTable(GR_TEXTABLE_PALETTE, (GuTexPalette *) pal); } } @@ -169,16 +186,8 @@ fxBestResolution(int width, int height, int aux) fxQueryHardware(); - if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) { - fbmem = glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.fbRam; - - if (glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.sliDetect) - fbmem *= 2; - } - else if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_SST96) - fbmem = glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config.fbRam; - else - fbmem = 2; + fbmem = glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig.fbRam + * glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig.numChips; /* A work around for BZFlag */ @@ -187,13 +196,14 @@ fxBestResolution(int width, int height, int aux) height = 480; } - for (i = 0; i < NUM_RESOLUTIONS; i++) + for (i = 0; i < NUM_RESOLUTIONS; i++) { if (resolutions[i][4 - aux] <= fbmem) { - if ((width <= resolutions[i][0]) && (height <= resolutions[i][1])) + if ((width <= resolutions[i][0]) && (height <= resolutions[i][1])) { return resolutions[i][2]; - + } lastvalidres = resolutions[i][2]; } + } return lastvalidres; } @@ -282,7 +292,6 @@ fxMesaCreateContext(GLuint win, /*FX_GrContext_t glideContext = 0; */ char *errorstr; GLboolean useBGR; - char *system = NULL; GLuint pixFmt, colDepth = 16; GLint redBits, greenBits, blueBits, alphaBits; @@ -306,15 +315,15 @@ fxMesaCreateContext(GLuint win, case FXMESA_ALPHA_SIZE: i++; alphaBuffer = attribList[i] > 0; - if (alphaBuffer) + if (alphaBuffer) { aux = 1; + } break; case FXMESA_DEPTH_SIZE: i++; depthSize = attribList[i]; if (depthSize) { aux = 1; - depthSize = 16; } break; case FXMESA_STENCIL_SIZE: @@ -337,26 +346,26 @@ fxMesaCreateContext(GLuint win, break; default: if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxMesaCreateContext() End (defualt)\n"); + fprintf(stderr, "fxmesa: bad FXMESA_* switch\n"); } return NULL; } i++; } + if (depthSize) { + depthSize = (colDepth == 32) ? 24 : 16; + } + /* A workaround for Linux GLQuake */ if (depthSize && alphaBuffer) alphaBuffer = 0; if ((type = fxQueryHardware()) < 0) { - fprintf(stderr, - "fx Driver: ERROR no Voodoo1/2 Graphics or Voodoo Rush !\n"); + fprintf(stderr, "fxmesa: ERROR no Voodoo hardware!\n"); return NULL; } - if (type == GR_SSTTYPE_VOODOO) - win = 0; - grSstSelect(glbCurrentBoard); fxMesa = (fxMesaContext) calloc(1, sizeof(struct tfxMesaContext)); @@ -365,23 +374,14 @@ fxMesaCreateContext(GLuint win, goto errorhandler; } - if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) - fxMesa->haveTwoTMUs = - (glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.nTexelfx > - 1); - else if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_SST96) - fxMesa->haveTwoTMUs = - (glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config.nTexelfx > - 1); - else - fxMesa->haveTwoTMUs = GL_FALSE; - + fxMesa->haveTwoTMUs = (glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig.nTexelfx > 1); fxMesa->haveDoubleBuffer = doubleBuffer; fxMesa->haveAlphaBuffer = alphaBuffer; fxMesa->haveGlobalPaletteTexture = GL_FALSE; fxMesa->haveZBuffer = depthSize ? 1 : 0; fxMesa->verbose = verbose; fxMesa->board = glbCurrentBoard; + fxMesa->maxTextureSize = glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig.maxTextureSize; /* [koolsmoky] */ switch (fxMesa->colDepth = colDepth) { @@ -390,21 +390,21 @@ fxMesaCreateContext(GLuint win, greenBits = 5; blueBits = 5; alphaBits = 1; - pixFmt = 4; /* GR_PIXFMT_ARGB_1555 */ + pixFmt = GR_PIXFMT_ARGB_1555; break; case 16: redBits = 5; greenBits = 6; blueBits = 5; alphaBits = 0; - pixFmt = 3; /* GR_PIXFMT_ARGB_565 */ + pixFmt = GR_PIXFMT_RGB_565; break; case 32: redBits = 8; greenBits = 8; blueBits = 8; alphaBits = 8; - pixFmt = 5; /* GR_PIXFMT_ARGB_8888 */ + pixFmt = GR_PIXFMT_ARGB_8888; break; default: errorstr = "pixelFormat"; @@ -414,11 +414,7 @@ fxMesaCreateContext(GLuint win, fxMesa->glideContext = FX_grSstWinOpen(&glbHWConfig.SSTs[glbCurrentBoard], (FxU32)win, res, ref, -#ifdef FXMESA_USE_ARGB - GR_COLORFORMAT_ARGB, -#else GR_COLORFORMAT_ABGR, -#endif pixFmt, GR_ORIGIN_LOWER_LEFT, 2, aux); if (!fxMesa->glideContext) { @@ -428,87 +424,34 @@ fxMesaCreateContext(GLuint win, /* * Pixel tables are used during pixel read-back - * Either initialize them for RGB or BGR order. + * Either initialize them for RGB or BGR order; + * However, 32bit capable cards have the right order. + * As a consequence, 32bit read-back is not swizzled! * Also determine if we need vertex snapping. */ - - fxMesa->snapVertices = GL_TRUE; /* play it safe */ - -#ifdef FXMESA_USE_ARGB - useBGR = GL_FALSE; /* Force RGB pixel order */ - system = "FXMESA_USE_ARGB"; -#else - if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) { - /* jk991130 - Voodoo 3s don't use BGR. Query the # of TMUs - * as Voodoo3s have 2 TMUs on board, Banshee has only 1 - * bk000413 - another suggestion from Joseph Kain is using - * VendorID 0x121a for all 3dfx boards - * DeviceID VG 1/V2 2/VB 3/V3 5 - * For now we cehck for known BGR devices, and presume - * everything else to be a V3/RGB. - */ - GrVoodooConfig_t *voodoo; - voodoo = &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig; - - if (voodoo->nTexelfx == 1) { - /* Voodoo1 or Banshee */ - useBGR = GL_TRUE; - system = "Voodoo1"; - } - else if (voodoo->nTexelfx == 2 && - voodoo->fbiRev == 260 && - voodoo->tmuConfig[0].tmuRev == 4 && - (voodoo->tmuConfig[0].tmuRam == 2 || - voodoo->tmuConfig[0].tmuRam == 4)) { - /* Voodoo 2 */ - useBGR = GL_TRUE; - system = "Voodoo2"; - fxMesa->snapVertices = GL_FALSE; - } - else if (voodoo->nTexelfx == 2 && - voodoo->fbiRev == 2 && - voodoo->tmuConfig[0].tmuRev == 1 && - voodoo->tmuConfig[0].tmuRam == 4) { - /* Quantum3D Obsidian 50/100 */ - useBGR = GL_TRUE; - system = "Quantum3D Obsidian"; - } - else - /* Brian - * (voodoo->nTexelfx == 2 && - * voodoo->fbiRev == 0 && - * voodoo->tmuConfig[0].tmuRev == 148441048 && - * voodoo->tmuConfig[0].tmuRam == 3) - * Bernd - * (voodoo->nTexelfx == 2 && - * voodoo->fbiRev == 69634 && - * voodoo->tmuConfig[0].tmuRev == 69634 && - * voodoo->tmuConfig[0].tmuRam == 2 ) - */ - { - /* Presumed Voodoo3 */ - useBGR = GL_FALSE; - system = "Voodoo3"; - fxMesa->snapVertices = GL_FALSE; - } - if (verbose) { - fprintf(stderr, - "Voodoo: Texelfx: %d / FBI Rev.: %d / TMU Rev.: %d / TMU RAM: %d\n", - voodoo->nTexelfx, voodoo->fbiRev, voodoo->tmuConfig[0].tmuRev, - voodoo->tmuConfig[0].tmuRam); - } - } - else { - useBGR = GL_FALSE; /* use RGB pixel order otherwise */ - system = "non-voodoo"; - fxMesa->snapVertices = GL_FALSE; + switch (glbHWConfig.SSTs[glbCurrentBoard].type) { + case GR_SSTTYPE_VOODOO: + case GR_SSTTYPE_Banshee: + useBGR = GL_TRUE; + fxMesa->snapVertices = GL_TRUE; + break; + case GR_SSTTYPE_Voodoo2: + useBGR = GL_TRUE; + fxMesa->snapVertices = GL_FALSE; + break; + case GR_SSTTYPE_Voodoo3: + case GR_SSTTYPE_Voodoo4: + case GR_SSTTYPE_Voodoo5: + default: + useBGR = GL_FALSE; + fxMesa->snapVertices = GL_FALSE; + break; } -#endif /*FXMESA_USE_ARGB */ if (verbose) { - fprintf(stderr, "Voodoo pixel order: %s (%s)\n", - useBGR ? "BGR" : "RGB", system); - fprintf(stderr, "Vertex snapping: %d\n", fxMesa->snapVertices); + fprintf(stderr, "Voodoo pixel order = %s, vertex snapping = %d\n", + useBGR ? "BGR" : "RGB", + fxMesa->snapVertices); } fxInitPixelTables(fxMesa, useBGR); @@ -527,8 +470,8 @@ fxMesaCreateContext(GLuint win, fxMesa->new_state = ~0; if (verbose) - fprintf(stderr, "Voodoo Glide screen size: %dx%d\n", - (int) FX_grSstScreenWidth(), (int) FX_grSstScreenHeight()); + fprintf(stderr, "Voodoo screen: %dx%dx%d\n", + (int)FX_grSstScreenWidth(), (int)FX_grSstScreenHeight(), colDepth); fxMesa->glVis = _mesa_create_visual(GL_TRUE, /* RGB mode */ doubleBuffer, GL_FALSE, /* stereo */ @@ -594,7 +537,7 @@ fxMesaCreateContext(GLuint win, errorhandler: if (fxMesa) { if (fxMesa->glideContext) - FX_grSstWinClose(fxMesa->glideContext); + grSstWinClose(fxMesa->glideContext); fxMesa->glideContext = 0; if (fxMesa->state) @@ -611,7 +554,7 @@ fxMesaCreateContext(GLuint win, } if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxMesaCreateContext() End (%s)\n", errorstr); + fprintf(stderr, "fxmesa: ERROR (%s)\n", errorstr); } return NULL; } @@ -679,7 +622,7 @@ fxMesaDestroyContext(fxMesaContext fxMesa) _mesa_destroy_framebuffer(fxMesa->glBuffer); fxCloseHardware(); - FX_grSstWinClose(fxMesa->glideContext); + grSstWinClose(fxMesa->glideContext); free(fxMesa); @@ -784,7 +727,7 @@ fxMesaSwapBuffers(void) /* * Don't allow swap buffer commands to build up! */ - while (FX_grGetInteger(FX_PENDING_BUFFERSWAPS) > + while (FX_grGetInteger(GR_PENDING_BUFFERSWAPS) > fxMesaCurrentCtx->maxPendingSwapBuffers) /* The driver is able to sleep when waiting for the completation of multiple swapbuffer operations instead of wasting @@ -817,38 +760,15 @@ fxQueryHardware(void) if (getenv("MESA_FX_INFO")) { char buf[80]; - - FX_grGlideGetVersion(buf); - fprintf(stderr, "Voodoo Using Glide V%s\n", buf); - fprintf(stderr, "Voodoo Number of boards: %d\n", - glbHWConfig.num_sst); - - if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) { - GrVoodooConfig_t *voodoo; - voodoo = - &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig; - - fprintf(stderr, "Voodoo Framebuffer RAM: %d\n", - voodoo->sliDetect ? (voodoo->fbRam * - 2) : voodoo->fbRam); - fprintf(stderr, "Voodoo Number of TMUs: %d\n", - voodoo->nTexelfx); - fprintf(stderr, "Voodoo fbRam: %d\n", voodoo->fbRam); - fprintf(stderr, "Voodoo fbiRev: %d\n", voodoo->fbiRev); - - fprintf(stderr, "Voodoo SLI detected: %d\n", - voodoo->sliDetect); - } - else if (glbHWConfig.SSTs[glbCurrentBoard].type == - GR_SSTTYPE_SST96) { - GrSst96Config_t *sst96; - sst96 = - &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config; - fprintf(stderr, "Voodoo Framebuffer RAM: %d\n", sst96->fbRam); - fprintf(stderr, "Voodoo Number of TMUs: %d\n", - sst96->nTexelfx); - } - + GrVoodooConfig_t *voodoo = &glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig; + + strcpy(buf, grGetString(GR_VERSION)); + fprintf(stderr, "Voodoo Using Glide %s\n", buf); + fprintf(stderr, "Voodoo Number of boards: %d\n", glbHWConfig.num_sst); + fprintf(stderr, "Voodoo Number of TMUs: %d\n", voodoo->nTexelfx); + fprintf(stderr, "Voodoo fbRam: %d\n", voodoo->fbRam); + fprintf(stderr, "Voodoo fbiRev: %d\n", voodoo->fbiRev); + fprintf(stderr, "Voodoo chips detected: %d\n", voodoo->numChips); } } else { @@ -858,7 +778,7 @@ fxQueryHardware(void) glbGlideInitialized = 1; #if defined(__WIN32__) - onexit((_onexit_t) cleangraphics); + _onexit((_onexit_t) cleangraphics); #elif defined(__linux__) /* Only register handler if environment variable is not defined. */ if (!getenv("MESA_FX_NO_SIGNALS")) { diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 81d3754e42e..3b58eb0535d 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -2,7 +2,7 @@ * fxDDReadPixels888 does not convert 8A8R8G8B into 5R5G5B */ -/* $Id: fxdd.c,v 1.98 2003/07/17 14:50:12 brianp Exp $ */ +/* $Id: fxdd.c,v 1.99 2003/08/19 15:52:53 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -33,6 +33,8 @@ * Brian Paul * Daryll Strauss * Keith Whitwell + * Daniel Borca + * Hiroshi Morii */ /* fxdd.c - 3Dfx VooDoo Mesa device driver functions */ @@ -167,7 +169,8 @@ fxDDClear(GLcontext * ctx, GLbitfield mask, GLboolean all, { fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask); - const FxU16 clearD = (FxU16) (ctx->Depth.Clear * 0xffff); + /* [dBorca] should use an adequate scaler for 16 vs 32bit (GR_ZDEPTH_MIN_MAX) */ + const FxU32 clearD = (FxU32) (ctx->Depth.Clear * 0x00ffffff); GLbitfield softwareMask = mask & (DD_STENCIL_BIT | DD_ACCUM_BIT); /* we can't clear stencil or accum buffers */ @@ -191,11 +194,11 @@ fxDDClear(GLcontext * ctx, GLbitfield mask, GLboolean all, switch (mask) { case DD_BACK_LEFT_BIT | DD_DEPTH_BIT: /* back buffer & depth */ - FX_grDepthMask(FXTRUE); - FX_grRenderBuffer(GR_BUFFER_BACKBUFFER); + grDepthMask(FXTRUE); + grRenderBuffer(GR_BUFFER_BACKBUFFER); FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); if (!ctx->Depth.Mask) { - FX_grDepthMask(FXFALSE); + grDepthMask(FXFALSE); } break; case DD_FRONT_LEFT_BIT | DD_DEPTH_BIT: @@ -204,70 +207,68 @@ fxDDClear(GLcontext * ctx, GLbitfield mask, GLboolean all, * This is a work-around/ */ /* clear depth */ - FX_grDepthMask(FXTRUE); - FX_grRenderBuffer(GR_BUFFER_BACKBUFFER); - FX_grColorMask(FXFALSE, FXFALSE); + grDepthMask(FXTRUE); + grRenderBuffer(GR_BUFFER_BACKBUFFER); + grColorMask(FXFALSE, FXFALSE); FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); /* clear front */ - FX_grColorMask(FXTRUE, ctx->Color.ColorMask[ACOMP] - && fxMesa->haveAlphaBuffer); - FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER); + grColorMask(FXTRUE, ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer); + grRenderBuffer(GR_BUFFER_FRONTBUFFER); FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); break; case DD_BACK_LEFT_BIT: /* back buffer only */ - FX_grDepthMask(FXFALSE); - FX_grRenderBuffer(GR_BUFFER_BACKBUFFER); + grDepthMask(FXFALSE); + grRenderBuffer(GR_BUFFER_BACKBUFFER); FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); if (ctx->Depth.Mask) { - FX_grDepthMask(FXTRUE); + grDepthMask(FXTRUE); } break; case DD_FRONT_LEFT_BIT: /* front buffer only */ - FX_grDepthMask(FXFALSE); - FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER); + grDepthMask(FXFALSE); + grRenderBuffer(GR_BUFFER_FRONTBUFFER); FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); if (ctx->Depth.Mask) { - FX_grDepthMask(FXTRUE); + grDepthMask(FXTRUE); } break; case DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT: /* front and back */ - FX_grDepthMask(FXFALSE); - FX_grRenderBuffer(GR_BUFFER_BACKBUFFER); + grDepthMask(FXFALSE); + grRenderBuffer(GR_BUFFER_BACKBUFFER); FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); - FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER); + grRenderBuffer(GR_BUFFER_FRONTBUFFER); FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); if (ctx->Depth.Mask) { - FX_grDepthMask(FXTRUE); + grDepthMask(FXTRUE); } break; case DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT | DD_DEPTH_BIT: /* clear front */ - FX_grDepthMask(FXFALSE); - FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER); + grDepthMask(FXFALSE); + grRenderBuffer(GR_BUFFER_FRONTBUFFER); FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); /* clear back and depth */ - FX_grDepthMask(FXTRUE); - FX_grRenderBuffer(GR_BUFFER_BACKBUFFER); + grDepthMask(FXTRUE); + grRenderBuffer(GR_BUFFER_BACKBUFFER); FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); if (!ctx->Depth.Mask) { - FX_grDepthMask(FXFALSE); + grDepthMask(FXFALSE); } break; case DD_DEPTH_BIT: /* just the depth buffer */ - FX_grRenderBuffer(GR_BUFFER_BACKBUFFER); - FX_grColorMask(FXFALSE, FXFALSE); - FX_grDepthMask(FXTRUE); + grRenderBuffer(GR_BUFFER_BACKBUFFER); + grColorMask(FXFALSE, FXFALSE); + grDepthMask(FXTRUE); FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); - FX_grColorMask(FXTRUE, ctx->Color.ColorMask[ACOMP] - && fxMesa->haveAlphaBuffer); + grColorMask(FXTRUE, ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer); if (ctx->Color._DrawDestMask & FRONT_LEFT_BIT) - FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER); + grRenderBuffer(GR_BUFFER_FRONTBUFFER); if (!ctx->Depth.Test || !ctx->Depth.Mask) - FX_grDepthMask(FXFALSE); + grDepthMask(FXFALSE); break; default: /* error */ @@ -294,14 +295,14 @@ fxDDSetDrawBuffer(GLcontext * ctx, GLenum mode) if (mode == GL_FRONT_LEFT) { fxMesa->currentFB = GR_BUFFER_FRONTBUFFER; - FX_grRenderBuffer(fxMesa->currentFB); + grRenderBuffer(fxMesa->currentFB); } else if (mode == GL_BACK_LEFT) { fxMesa->currentFB = GR_BUFFER_BACKBUFFER; - FX_grRenderBuffer(fxMesa->currentFB); + grRenderBuffer(fxMesa->currentFB); } else if (mode == GL_NONE) { - FX_grColorMask(FXFALSE, FXFALSE); + grColorMask(FXFALSE, FXFALSE); } else { /* we'll need a software fallback */ @@ -404,10 +405,10 @@ fxDDDrawBitmap(GLcontext * ctx, GLint px, GLint py, } info.size = sizeof(info); - if (!FX_grLfbLock(GR_LFB_WRITE_ONLY, - fxMesa->currentFB, - GR_LFBWRITEMODE_565, - GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) { + if (!grLfbLock(GR_LFB_WRITE_ONLY, + fxMesa->currentFB, + GR_LFBWRITEMODE_565, + GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) { #ifndef FX_SILENT fprintf(stderr, "fx Driver: error locking the linear frame buffer\n"); #endif @@ -476,7 +477,7 @@ fxDDDrawBitmap(GLcontext * ctx, GLint px, GLint py, } } - FX_grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); + grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); } @@ -783,7 +784,7 @@ static void fxDDReadPixels888 (GLcontext * ctx, static void fxDDFinish(GLcontext * ctx) { - FX_grFlush(); + grFlush(); } @@ -797,43 +798,23 @@ fxDDFinish(GLcontext * ctx) static const GLubyte * fxDDGetString(GLcontext * ctx, GLenum name) { - switch (name) { - case GL_RENDERER: - { - static char buf[80]; - - if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) { - GrVoodooConfig_t *vc = - &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig; - - sprintf(buf, - "Mesa Glide v0.30 Voodoo_Graphics %d " - "CARD/%d FB/%d TM/%d TMU/%s", - glbCurrentBoard, - (vc->sliDetect ? (vc->fbRam * 2) : vc->fbRam), - (vc->tmuConfig[GR_TMU0].tmuRam + - ((vc->nTexelfx > 1) ? vc->tmuConfig[GR_TMU1]. - tmuRam : 0)), vc->nTexelfx, - (vc->sliDetect ? "SLI" : "NOSLI")); - } - else if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_SST96) { - GrSst96Config_t *sc = - &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config; - - sprintf(buf, - "Glide v0.30 Voodoo_Rush %d " - "CARD/%d FB/%d TM/%d TMU/NOSLI", - glbCurrentBoard, - sc->fbRam, sc->tmuConfig.tmuRam, sc->nTexelfx); - } - else { - strcpy(buf, "Glide v0.30 UNKNOWN"); - } - return (GLubyte *) buf; - } - default: - return NULL; - } + switch (name) { + case GL_RENDERER: + { + static char buf[80]; + GrVoodooConfig_t *vc = &glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig; + sprintf(buf, "Mesa %s v0.31 %s %dMB FB, %dMB TM, %d TMU, %s", + grGetString(GR_RENDERER), + grGetString(GR_HARDWARE), + vc->fbRam, + (vc->tmuConfig[GR_TMU0].tmuRam + ((vc->nTexelfx > 1) ? vc->tmuConfig[GR_TMU1].tmuRam : 0)), + (vc->nTexelfx * vc->numChips), + (vc->numChips > 1) ? "SLI" : "NOSLI"); + return (GLubyte *)buf; + } + default: + return NULL; + } } static const struct gl_pipeline_stage *fx_pipeline[] = { @@ -909,18 +890,18 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa) fxMesa->unitsState.depthMask = GL_TRUE; fxMesa->unitsState.depthTestFunc = GR_CMP_LESS; - FX_grColorMask(FXTRUE, fxMesa->haveAlphaBuffer ? FXTRUE : FXFALSE); + grColorMask(FXTRUE, fxMesa->haveAlphaBuffer ? FXTRUE : FXFALSE); if (fxMesa->haveDoubleBuffer) { fxMesa->currentFB = GR_BUFFER_BACKBUFFER; - FX_grRenderBuffer(GR_BUFFER_BACKBUFFER); + grRenderBuffer(GR_BUFFER_BACKBUFFER); } else { fxMesa->currentFB = GR_BUFFER_FRONTBUFFER; - FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER); + grRenderBuffer(GR_BUFFER_FRONTBUFFER); } - fxMesa->state = malloc(FX_grGetInteger(FX_GLIDE_STATE_SIZE)); - fxMesa->fogTable = (GrFog_t *) malloc(FX_grGetInteger(FX_FOG_TABLE_ENTRIES) * + fxMesa->state = malloc(FX_grGetInteger(GR_GLIDE_STATE_SIZE)); + fxMesa->fogTable = (GrFog_t *) malloc(FX_grGetInteger(GR_FOG_TABLE_ENTRIES) * sizeof(GrFog_t)); if (!fxMesa->state || !fxMesa->fogTable) { @@ -932,14 +913,19 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa) } if (fxMesa->haveZBuffer) - FX_grDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER); + grDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER); -#ifndef FXMESA_USE_ARGB - FX_grLfbWriteColorFormat(GR_COLORFORMAT_ABGR); /* Not every Glide has this */ -#endif + grLfbWriteColorFormat(GR_COLORFORMAT_ABGR); - fxMesa->textureAlign = FX_grGetInteger(FX_TEXTURE_ALIGN); - fxMesa->glCtx->Const.MaxTextureLevels = 9; + fxMesa->textureAlign = FX_grGetInteger(GR_TEXTURE_ALIGN); + /* [koolsmoky] */ + { + int textureSize = ((fxMesa->maxTextureSize > 2048) ? 2048 : fxMesa->maxTextureSize); + fxMesa->glCtx->Const.MaxTextureLevels = 0; + do { + fxMesa->glCtx->Const.MaxTextureLevels++; + } while ((textureSize >>= 0x1) & 0x7ff); + } fxMesa->glCtx->Const.MaxTextureUnits = fxMesa->haveTwoTMUs ? 2 : 1; fxMesa->new_state = _NEW_ALL; @@ -950,6 +936,7 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa) _tnl_CreateContext(fxMesa->glCtx); _swsetup_CreateContext(fxMesa->glCtx); + /* Install customized pipeline */ _tnl_destroy_pipeline(fxMesa->glCtx); _tnl_install_pipeline(fxMesa->glCtx, fx_pipeline); @@ -970,7 +957,7 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa) fxDDInitExtensions(fxMesa->glCtx); - FX_grGlideGetState((GrState *) fxMesa->state); + grGlideGetState((GrState *) fxMesa->state); return 1; } diff --git a/src/mesa/drivers/glide/fxddspan.c b/src/mesa/drivers/glide/fxddspan.c index e106ce291e2..6e847acce4e 100644 --- a/src/mesa/drivers/glide/fxddspan.c +++ b/src/mesa/drivers/glide/fxddspan.c @@ -1,9 +1,11 @@ /* Hack alert: - * Depth32 functions won't compile with Glide2 + * The performance hit is disastruous for SPAN functions. + * Should we use SpanRenderStart / SpanRenderFinish in `swrast.h' + * for locking / unlocking the LFB? * Optimize and check endianess for `read_R8G8B8_pixels' */ -/* $Id: fxddspan.c,v 1.23 2003/07/17 14:50:12 brianp Exp $ */ +/* $Id: fxddspan.c,v 1.24 2003/08/19 15:52:53 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -34,6 +36,8 @@ * Brian Paul * Daryll Strauss * Keith Whitwell + * Daniel Borca + * Hiroshi Morii */ @@ -60,9 +64,6 @@ #endif -#if !defined(FXMESA_USE_ARGB) - - #define writeRegionClipped(fxm,dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \ FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) @@ -87,42 +88,6 @@ src_data) \ -#else /* !defined(FXMESA_USE_RGBA) */ - -#define writeRegionClipped(fxm,dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \ - FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) - - -#define MESACOLOR_TO_ARGB(c) ( \ - ( ((unsigned int)(c[ACOMP]))<<24 ) | \ - ( ((unsigned int)(c[RCOMP]))<<16 ) | \ - ( ((unsigned int)(c[GCOMP]))<<8 ) | \ - ( (unsigned int)(c[BCOMP])) ) - -inline void -LFB_WRITE_SPAN_MESA(GrBuffer_t dst_buffer, - FxU32 dst_x, - FxU32 dst_y, - FxU32 src_width, FxI32 src_stride, void *src_data) -{ - /* Covert to ARGB */ - GLubyte(*rgba)[4] = src_data; - GLuint argb[MAX_WIDTH]; - int i; - - for (i = 0; i < src_width; i++) { - argb[i] = MESACOLOR_TO_ARGB(rgba[i]); - } - writeRegionClipped( /*fxMesa, */ NULL, dst_buffer, - dst_x, - dst_y, - GR_LFB_SRC_FMT_8888, - src_width, 1, src_stride, (void *) argb); -} - -#endif /* !defined(FXMESA_USE_RGBA) */ - - /************************************************************************/ /***** Span functions *****/ /************************************************************************/ @@ -412,7 +377,7 @@ static void read_R8G8B8_span (const GLcontext * ctx, { fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; BEGIN_BOARD_LOCK(); - FX_grLfbReadRegion(fxMesa->currentFB, x, fxMesa->height - 1 - y, n, 1, n * 4, rgba); + grLfbReadRegion(fxMesa->currentFB, x, fxMesa->height - 1 - y, n, 1, n * 4, rgba); END_BOARD_LOCK(); } @@ -602,6 +567,7 @@ fxDDWriteDepth32Span(GLcontext * ctx, { fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; GLint bottom = fxMesa->height - 1; + GLint i; if (MESA_VERBOSE & VERBOSE_DRIVER) { fprintf(stderr, "fxmesa: fxDDWriteDepth32Span(...)\n"); @@ -609,17 +575,21 @@ fxDDWriteDepth32Span(GLcontext * ctx, if (mask) { - GLint i; for (i = 0; i < n; i++) { if (mask[i]) { + GLuint d = depth[i] << 8; writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, x + i, bottom - y, - GR_LFBWRITEMODE_Z32, 1, 1, 0, (void *) &depth[i]); + GR_LFBWRITEMODE_Z32, 1, 1, 0, (void *) &d); } } } else { + GLuint depth32[MAX_WIDTH]; + for (i = 0; i < n; i++) { + depth32[i] = depth[i] << 8; + } writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, x, bottom - y, - GR_LFBWRITEMODE_Z32, n, 1, 0, (void *) depth); + GR_LFBWRITEMODE_Z32, n, 1, 0, (void *) depth32); } } @@ -637,7 +607,7 @@ fxDDReadDepthSpan(GLcontext * ctx, fprintf(stderr, "fxmesa: fxDDReadDepthSpan(...)\n"); } - FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth16); + grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth16); for (i = 0; i < n; i++) { depth[i] = depth16[i]; } @@ -655,7 +625,7 @@ fxDDReadDepth32Span(GLcontext * ctx, fprintf(stderr, "fxmesa: fxDDReadDepth32Span(...)\n"); } - FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth); + grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth); } @@ -702,8 +672,9 @@ fxDDWriteDepth32Pixels(GLcontext * ctx, if (mask[i]) { int xpos = x[i]; int ypos = bottom - y[i]; + GLuint d = depth[i] << 8; writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER, xpos, ypos, - GR_LFBWRITEMODE_Z32, 1, 1, 0, (void *) &depth[i]); + GR_LFBWRITEMODE_Z32, 1, 1, 0, (void *) &d); } } } @@ -725,7 +696,7 @@ fxDDReadDepthPixels(GLcontext * ctx, GLuint n, int xpos = x[i]; int ypos = bottom - y[i]; GLushort d; - FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, xpos, ypos, 1, 1, 0, &d); + grLfbReadRegion(GR_BUFFER_AUXBUFFER, xpos, ypos, 1, 1, 0, &d); depth[i] = d; } } @@ -746,7 +717,7 @@ fxDDReadDepth32Pixels(GLcontext * ctx, GLuint n, for (i = 0; i < n; i++) { int xpos = x[i]; int ypos = bottom - y[i]; - FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER, xpos, ypos, 1, 1, 0, &depth[i]); + grLfbReadRegion(GR_BUFFER_AUXBUFFER, xpos, ypos, 1, 1, 0, &depth[i]); } } @@ -766,11 +737,11 @@ fxDDSetBuffer(GLcontext * ctx, GLframebuffer * buffer, GLuint bufferBit) if (bufferBit == FRONT_LEFT_BIT) { fxMesa->currentFB = GR_BUFFER_FRONTBUFFER; - FX_grRenderBuffer(fxMesa->currentFB); + grRenderBuffer(fxMesa->currentFB); } else if (bufferBit == BACK_LEFT_BIT) { fxMesa->currentFB = GR_BUFFER_BACKBUFFER; - FX_grRenderBuffer(fxMesa->currentFB); + grRenderBuffer(fxMesa->currentFB); } } diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index fafdb7c4d68..a2c3aec8a51 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -1,4 +1,4 @@ -/* $Id: fxddtex.c,v 1.46 2001/11/06 16:01:19 brianp Exp $ */ +/* $Id: fxddtex.c,v 1.47 2003/08/19 15:52:53 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -29,6 +29,8 @@ * Brian Paul * Daryll Strauss * Keith Whitwell + * Daniel Borca + * Hiroshi Morii */ @@ -172,10 +174,10 @@ fxDDTexEnv(GLcontext * ctx, GLenum target, GLenum pname, /* apply any lod biasing right now */ if (pname == GL_TEXTURE_LOD_BIAS_EXT) { - FX_grTexLodBiasValue(GR_TMU0, *param); + grTexLodBiasValue(GR_TMU0, *param); if (fxMesa->haveTwoTMUs) { - FX_grTexLodBiasValue(GR_TMU1, *param); + grTexLodBiasValue(GR_TMU1, *param); } } @@ -450,11 +452,7 @@ fxDDTexUseGlbPalette(GLcontext * ctx, GLboolean state) if (state) { fxMesa->haveGlobalPaletteTexture = 1; - FX_grTexDownloadTable(GR_TMU0, GR_TEXTABLE_PALETTE, - &(fxMesa->glbPalette)); - if (fxMesa->haveTwoTMUs) - FX_grTexDownloadTable(GR_TMU1, GR_TEXTABLE_PALETTE, - &(fxMesa->glbPalette)); + grTexDownloadTable(GR_TEXTABLE_PALETTE, &(fxMesa->glbPalette)); } else { fxMesa->haveGlobalPaletteTexture = 0; @@ -504,8 +502,8 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, float *sscale, float *tscale, int *i_sscale, int *i_tscale, int *wscale, int *hscale) { - - static GrLOD_t lod[9] = { GR_LOD_256, GR_LOD_128, GR_LOD_64, GR_LOD_32, + /* [koolsmoky] */ + static GrLOD_t lod[12] = { GR_LOD_2048, GR_LOD_1024, GR_LOD_512, GR_LOD_256, GR_LOD_128, GR_LOD_64, GR_LOD_32, GR_LOD_16, GR_LOD_8, GR_LOD_4, GR_LOD_2, GR_LOD_1 }; @@ -521,14 +519,14 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, switch (logw - logh) { case 0: aspectratio = GR_ASPECT_1x1; - l = lod[8 - logw]; + l = lod[11 - logw]; s = t = 256.0f; is = it = INT_TRICK(8); ws = hs = 1; break; case 1: aspectratio = GR_ASPECT_2x1; - l = lod[8 - logw]; + l = lod[11 - logw]; s = 256.0f; t = 128.0f; is = INT_TRICK(8); @@ -538,7 +536,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, break; case 2: aspectratio = GR_ASPECT_4x1; - l = lod[8 - logw]; + l = lod[11 - logw]; s = 256.0f; t = 64.0f; is = INT_TRICK(8); @@ -548,7 +546,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, break; case 3: aspectratio = GR_ASPECT_8x1; - l = lod[8 - logw]; + l = lod[11 - logw]; s = 256.0f; t = 32.0f; is = INT_TRICK(8); @@ -558,7 +556,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, break; case 4: aspectratio = GR_ASPECT_8x1; - l = lod[8 - logw]; + l = lod[11 - logw]; s = 256.0f; t = 32.0f; is = INT_TRICK(8); @@ -568,7 +566,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, break; case 5: aspectratio = GR_ASPECT_8x1; - l = lod[8 - logw]; + l = lod[11 - logw]; s = 256.0f; t = 32.0f; is = INT_TRICK(8); @@ -578,7 +576,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, break; case 6: aspectratio = GR_ASPECT_8x1; - l = lod[8 - logw]; + l = lod[11 - logw]; s = 256.0f; t = 32.0f; is = INT_TRICK(8); @@ -588,7 +586,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, break; case 7: aspectratio = GR_ASPECT_8x1; - l = lod[8 - logw]; + l = lod[11 - logw]; s = 256.0f; t = 32.0f; is = INT_TRICK(8); @@ -598,7 +596,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, break; case 8: aspectratio = GR_ASPECT_8x1; - l = lod[8 - logw]; + l = lod[11 - logw]; s = 256.0f; t = 32.0f; is = INT_TRICK(8); @@ -606,9 +604,39 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, ws = 1; hs = 32; break; + case 9: + aspectratio = GR_ASPECT_8x1; + l = lod[11 - logw]; + s = 256.0f; + t = 32.0f; + is = INT_TRICK(8); + it = INT_TRICK(5); + ws = 1; + hs = 64; + break; + case 10: + aspectratio = GR_ASPECT_8x1; + l = lod[11 - logw]; + s = 256.0f; + t = 32.0f; + is = INT_TRICK(8); + it = INT_TRICK(5); + ws = 1; + hs = 128; + break; + case 11: + aspectratio = GR_ASPECT_8x1; + l = lod[11 - logw]; + s = 256.0f; + t = 32.0f; + is = INT_TRICK(8); + it = INT_TRICK(5); + ws = 1; + hs = 256; + break; case -1: aspectratio = GR_ASPECT_1x2; - l = lod[8 - logh]; + l = lod[11 - logh]; s = 128.0f; t = 256.0f; is = INT_TRICK(7); @@ -618,7 +646,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, break; case -2: aspectratio = GR_ASPECT_1x4; - l = lod[8 - logh]; + l = lod[11 - logh]; s = 64.0f; t = 256.0f; is = INT_TRICK(6); @@ -628,7 +656,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, break; case -3: aspectratio = GR_ASPECT_1x8; - l = lod[8 - logh]; + l = lod[11 - logh]; s = 32.0f; t = 256.0f; is = INT_TRICK(5); @@ -638,7 +666,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, break; case -4: aspectratio = GR_ASPECT_1x8; - l = lod[8 - logh]; + l = lod[11 - logh]; s = 32.0f; t = 256.0f; is = INT_TRICK(5); @@ -648,7 +676,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, break; case -5: aspectratio = GR_ASPECT_1x8; - l = lod[8 - logh]; + l = lod[11 - logh]; s = 32.0f; t = 256.0f; is = INT_TRICK(5); @@ -658,7 +686,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, break; case -6: aspectratio = GR_ASPECT_1x8; - l = lod[8 - logh]; + l = lod[11 - logh]; s = 32.0f; t = 256.0f; is = INT_TRICK(5); @@ -668,7 +696,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, break; case -7: aspectratio = GR_ASPECT_1x8; - l = lod[8 - logh]; + l = lod[11 - logh]; s = 32.0f; t = 256.0f; is = INT_TRICK(5); @@ -678,7 +706,7 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, break; case -8: aspectratio = GR_ASPECT_1x8; - l = lod[8 - logh]; + l = lod[11 - logh]; s = 32.0f; t = 256.0f; is = INT_TRICK(5); @@ -686,6 +714,36 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, ws = 32; hs = 1; break; + case -9: + aspectratio = GR_ASPECT_1x8; + l = lod[11 - logh]; + s = 32.0f; + t = 256.0f; + is = INT_TRICK(5); + it = INT_TRICK(8); + ws = 64; + hs = 1; + break; + case -10: + aspectratio = GR_ASPECT_1x8; + l = lod[11 - logh]; + s = 32.0f; + t = 256.0f; + is = INT_TRICK(5); + it = INT_TRICK(8); + ws = 128; + hs = 1; + break; + case -11: + aspectratio = GR_ASPECT_1x8; + l = lod[11 - logh]; + s = 32.0f; + t = 256.0f; + is = INT_TRICK(5); + it = INT_TRICK(8); + ws = 256; + hs = 1; + break; default: return 0; break; @@ -724,8 +782,10 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, * Glide internal texture format and base texture format. */ void -fxTexGetFormat(GLenum glformat, GrTextureFormat_t * tfmt, GLint * ifmt) +fxTexGetFormat(GLcontext *ctx, GLenum glformat, GrTextureFormat_t * tfmt, GLint * ifmt) /* [koolsmoky] */ { + fxMesaContext fxMesa = FX_CONTEXT(ctx); + switch (glformat) { case 1: case GL_LUMINANCE: @@ -771,33 +831,61 @@ fxTexGetFormat(GLenum glformat, GrTextureFormat_t * tfmt, GLint * ifmt) if (ifmt) (*ifmt) = GL_ALPHA; break; - case 3: - case GL_RGB: case GL_R3_G3_B2: case GL_RGB4: case GL_RGB5: + if (tfmt) + (*tfmt) = GR_TEXFMT_RGB_565; + if (ifmt) + (*ifmt) = GL_RGB; + break; + case 3: + case GL_RGB: case GL_RGB8: case GL_RGB10: case GL_RGB12: case GL_RGB16: +#if 0 /* [koolsmoky] getting ready for 32bpp textures */ + if (fxMesa->colDepth == 32) { + if (tfmt) (*tfmt) = GR_TEXFMT_ARGB_8888; + } else { + if (tfmt) (*tfmt) = GR_TEXFMT_RGB_565; + } + if (ifmt) (*ifmt) = GL_RGB; +#else if (tfmt) (*tfmt) = GR_TEXFMT_RGB_565; if (ifmt) (*ifmt) = GL_RGB; +#endif break; - case 4: - case GL_RGBA: case GL_RGBA2: case GL_RGBA4: + if (tfmt) + (*tfmt) = GR_TEXFMT_ARGB_4444; + if (ifmt) + (*ifmt) = GL_RGBA; + break; + case 4: + case GL_RGBA: case GL_RGBA8: case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: +#if 0 /* [koolsmoky] getting ready for 32bpp textures */ + if (fxMesa->colDepth == 32) { + if (tfmt) (*tfmt) = GR_TEXFMT_ARGB_8888; + } else { + if (tfmt) (*tfmt) = GR_TEXFMT_ARGB_4444; + } + if (ifmt) (*ifmt) = GL_RGBA; +#else if (tfmt) (*tfmt) = GR_TEXFMT_ARGB_4444; if (ifmt) (*ifmt) = GL_RGBA; - break; +#endif + break; case GL_RGB5_A1: if (tfmt) (*tfmt) = GR_TEXFMT_ARGB_1555; @@ -1008,6 +1096,27 @@ fetch_r5g5b5a1(const struct gl_texture_image *texImage, } +#if 0 /* [koolsmoky] getting ready for 32bpp textures */ +static void +fetch_a8r8g8b8(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLvoid * texelOut) +{ + GLchan *rgba = (GLchan *) texelOut; + const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); + const GLuint *texel; + + i = i * mml->wScale; + j = j * mml->hScale; + + texel = ((GLuint *) texImage->Data) + j * mml->width + i; + rgba[RCOMP] = (((*texel) >> 16) & 0xff); + rgba[GCOMP] = (((*texel) >> 8) & 0xff); + rgba[BCOMP] = (((*texel)) & 0xff); + rgba[ACOMP] = (((*texel) >> 24) & 0xff); +} +#endif + + static void PrintTexture(int w, int h, int c, const GLubyte * data) { @@ -1029,6 +1138,8 @@ const struct gl_texture_format * fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat, GLenum srcFormat, GLenum srcType ) { + fxMesaContext fxMesa = FX_CONTEXT(ctx); + switch (internalFormat) { case GL_INTENSITY: case GL_INTENSITY4: @@ -1066,25 +1177,37 @@ fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: return &_mesa_texformat_al88; - case 3: - case GL_RGB: case GL_R3_G3_B2: case GL_RGB4: case GL_RGB5: + return &_mesa_texformat_rgb565; + case 3: + case GL_RGB: case GL_RGB8: case GL_RGB10: case GL_RGB12: case GL_RGB16: +#if 0 /* [koolsmoky] getting ready for 32bpp textures */ + return (fxMesa->colDepth == 32) ? &_mesa_texformat_argb8888 + : &_mesa_texformat_rgb565; +#else return &_mesa_texformat_rgb565; - case 4: - case GL_RGBA: +#endif case GL_RGBA2: case GL_RGBA4: + return &_mesa_texformat_argb4444; + case 4: + case GL_RGBA: case GL_RGBA8: case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: +#if 0 /* [koolsmoky] getting ready for 32bpp textures */ + return (fxMesa->colDepth == 32) ? &_mesa_texformat_argb8888 + : &_mesa_texformat_argb4444; +#else return &_mesa_texformat_argb4444; +#endif case GL_RGB5_A1: return &_mesa_texformat_argb1555; default: @@ -1114,6 +1237,10 @@ fxGlideFormat(GLint mesaFormat) return GR_TEXFMT_ARGB_4444; case MESA_FORMAT_ARGB1555: return GR_TEXFMT_ARGB_1555; +#if 0 /* [koolsmoky] getting ready for 32bpp textures */ + case MESA_FORMAT_ARGB8888: + return GR_TEXFMT_ARGB_8888; +#endif default: _mesa_problem(NULL, "Unexpected format in fxGlideFormat"); return 0; @@ -1141,6 +1268,10 @@ fxFetchFunction(GLint mesaFormat) return fetch_r4g4b4a4; case MESA_FORMAT_ARGB1555: return fetch_r5g5b5a1; +#if 0 /* [koolsmoky] getting ready for 32bpp textures */ + case MESA_FORMAT_ARGB8888: + return fetch_a8r8g8b8; +#endif default: _mesa_problem(NULL, "Unexpected format in fxGlideFormat"); return NULL; diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h index 56d76634fb5..271cd85dfea 100644 --- a/src/mesa/drivers/glide/fxdrv.h +++ b/src/mesa/drivers/glide/fxdrv.h @@ -1,4 +1,4 @@ -/* $Id: fxdrv.h,v 1.57 2003/07/17 14:50:12 brianp Exp $ */ +/* $Id: fxdrv.h,v 1.58 2003/08/19 15:52:53 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -29,6 +29,8 @@ * Brian Paul * Daryll Strauss * Keith Whitwell + * Daniel Borca + * Hiroshi Morii */ /* fxsetup.c - 3Dfx VooDoo rendering mode setup functions */ @@ -87,14 +89,6 @@ extern float gl_ubyte_to_float_255_color_tab[256]; -#if defined(FXMESA_USE_ARGB) -#define FXCOLOR4( c ) ( \ - ( ((unsigned int)(c[3]))<<24 ) | \ - ( ((unsigned int)(c[0]))<<16 ) | \ - ( ((unsigned int)(c[1]))<<8 ) | \ - ( (unsigned int)(c[2])) ) - -#else #ifdef __i386__ #define FXCOLOR4( c ) (* (int *)c) #else @@ -104,7 +98,6 @@ extern float gl_ubyte_to_float_255_color_tab[256]; ( ((unsigned int)(c[1]))<<8 ) | \ ( (unsigned int)(c[0])) ) #endif -#endif @@ -433,7 +426,7 @@ struct tfxMesaContext GLint swapInterval; GLint maxPendingSwapBuffers; - FX_GrContext_t glideContext; + GrContext_t glideContext; int screen_width; int screen_height; @@ -444,6 +437,7 @@ struct tfxMesaContext int clipMaxY; int colDepth; + int maxTextureSize; /* [koolsmoky] */ }; @@ -527,7 +521,8 @@ extern void fxTMReloadSubMipMapLevel(fxMesaContext, struct gl_texture_object *, GLint, GLint, GLint); -extern void fxTexGetFormat(GLenum, GrTextureFormat_t *, GLint *); +extern void fxTexGetFormat(GLcontext *, GLenum, GrTextureFormat_t *, GLint *); /* [koolsmoky] */ + extern int fxTexGetInfo(int, int, GrLOD_t *, GrAspectRatio_t *, float *, float *, int *, int *, int *, int *); diff --git a/src/mesa/drivers/glide/fxglidew.c b/src/mesa/drivers/glide/fxglidew.c index 950dfdbc86c..69fbebdec83 100644 --- a/src/mesa/drivers/glide/fxglidew.c +++ b/src/mesa/drivers/glide/fxglidew.c @@ -1,4 +1,4 @@ -/* $Id: fxglidew.c,v 1.20 2003/07/17 14:50:12 brianp Exp $ */ +/* $Id: fxglidew.c,v 1.21 2003/08/19 15:52:53 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -29,6 +29,8 @@ * Brian Paul * Daryll Strauss * Keith Whitwell + * Daniel Borca + * Hiroshi Morii */ /* fxsetup.c - 3Dfx VooDoo rendering mode setup functions */ @@ -49,111 +51,21 @@ FxI32 FX_grGetInteger_NoLock(FxU32 pname) { -#if !defined(FX_GLIDE3) - switch (pname) { - case FX_FOG_TABLE_ENTRIES: - return GR_FOG_TABLE_SIZE; - case FX_GLIDE_STATE_SIZE: - return sizeof(GrState); - case FX_LFB_PIXEL_PIPE: - return FXFALSE; - case FX_PENDING_BUFFERSWAPS: - return grBufferNumPending(); - case FX_TEXTURE_ALIGN: - /* This is a guess from reading the glide3 docs */ - return 8; - default: - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "Wrong parameter in FX_grGetInteger!\n"); - } - return -1; - } -#else - FxU32 grname; - FxI32 result; - - switch (pname) { - case FX_FOG_TABLE_ENTRIES: - case FX_GLIDE_STATE_SIZE: - case FX_LFB_PIXEL_PIPE: - case FX_PENDING_BUFFERSWAPS: - case FX_TEXTURE_ALIGN: - grname = pname; - break; - default: - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "Wrong parameter in FX_grGetInteger!\n"); - } - return -1; - } + FxI32 result; - grGet(grname, 4, &result); - return result; -#endif -} + if (grGet(pname, 4, &result)) { + return result; + } -FxI32 -FX_grGetInteger(FxU32 pname) -{ - int result; - - BEGIN_BOARD_LOCK(); - result = FX_grGetInteger_NoLock(pname); - END_BOARD_LOCK(); - return result; -} - - -FxBool -FX_grLfbLock(GrLock_t type, GrBuffer_t buffer, - GrLfbWriteMode_t writeMode, GrOriginLocation_t origin, - FxBool pixelPipeline, GrLfbInfo_t * info) -{ - FxBool result; - - BEGIN_BOARD_LOCK(); - result = grLfbLock(type, buffer, writeMode, origin, pixelPipeline, info); - END_BOARD_LOCK(); - return result; -} - -FxU32 -FX_grTexTextureMemRequired(FxU32 evenOdd, GrTexInfo * info) -{ - FxU32 result; - - BEGIN_BOARD_LOCK(); - result = grTexTextureMemRequired(evenOdd, info); - END_BOARD_LOCK(); - return result; -} - -FxU32 -FX_grTexMinAddress(GrChipID_t tmu) -{ - FxU32 result; - - BEGIN_BOARD_LOCK(); - result = grTexMinAddress(tmu); - END_BOARD_LOCK(); - return result; -} - -extern FxU32 -FX_grTexMaxAddress(GrChipID_t tmu) -{ - FxU32 result; - - BEGIN_BOARD_LOCK(); - result = grTexMaxAddress(tmu); - END_BOARD_LOCK(); - return result; + if (MESA_VERBOSE & VERBOSE_DRIVER) { + fprintf(stderr, "Wrong parameter in FX_grGetInteger!\n"); + } + return -1; } FxBool FX_grSstControl(FxU32 code) { -#if defined(FX_GLIDE3) /* The glide 3 sources call for grEnable/grDisable to be called in exchange * for grSstControl. */ switch (code) { @@ -166,47 +78,9 @@ FX_grSstControl(FxU32 code) } /* Appearently GR_CONTROL_RESIZE can be ignored. */ return 1; /* OK? */ -#else - FxU32 result; - BEGIN_BOARD_LOCK(); - result = grSstControl(code); - END_BOARD_LOCK(); - return result; -#endif } -#if defined(FX_GLIDE3) - -void -FX_grGammaCorrectionValue(float val) -{ - (void) val; -/* ToDo */ -} - -int -FX_getFogTableSize(void) -{ - int result; - BEGIN_BOARD_LOCK(); - grGet(GR_FOG_TABLE_ENTRIES, sizeof(int), (void *) &result); - END_BOARD_LOCK(); - return result; -} - -int -FX_getGrStateSize(void) -{ - int result; - BEGIN_BOARD_LOCK(); - grGet(GR_GLIDE_STATE_SIZE, sizeof(int), (void *) &result); - END_BOARD_LOCK(); - - return result; - -} - int FX_grSstScreenWidth() { @@ -231,14 +105,6 @@ FX_grSstScreenHeight() return result[3]; } -void -FX_grGlideGetVersion(char *buf) -{ - BEGIN_BOARD_LOCK(); - strcpy(buf, grGetString(GR_VERSION)); - END_BOARD_LOCK(); -} - void FX_grSstPerfStats(GrSstPerfStats_t * st) { @@ -272,14 +138,6 @@ FX_grAADrawPoint(GrVertex * a) END_CLIP_LOOP(); } -void -FX_grDrawPolygonVertexList(int n, GrVertex * verts) -{ - BEGIN_CLIP_LOOP(); - grDrawVertexArrayContiguous(GR_POLYGON, n, verts, sizeof(GrVertex)); - END_CLIP_LOOP(); -} - void FX_setupGrVertexLayout(void) { @@ -334,14 +192,6 @@ FX_grHints_NoLock(GrHint_t hintType, FxU32 hintMask) } } -void -FX_grHints(GrHint_t hintType, FxU32 hintMask) -{ - BEGIN_BOARD_LOCK(); - FX_grHints_NoLock(hintType, hintMask); - END_BOARD_LOCK(); -} - /* * Glide3 doesn't have the grSstQueryHardware function anymore. * Instead, we call grGet() and fill in the data structures ourselves. @@ -360,81 +210,63 @@ FX_grSstQueryHardware(GrHwConfiguration * config) for (i = 0; i < config->num_sst; i++) { FxI32 result; + const char *extension; - config->SSTs[i].type = GR_SSTTYPE_VOODOO; grSstSelect(i); + extension = grGetString(GR_HARDWARE); + if (strstr(extension, "Voodoo Banshee")) { + config->SSTs[i].type = GR_SSTTYPE_Banshee; + } else if (strstr(extension, "Voodoo3")) { + config->SSTs[i].type = GR_SSTTYPE_Voodoo3; + } else if (strstr(extension, "Voodoo4")) { + config->SSTs[i].type = GR_SSTTYPE_Voodoo4; + } else if (strstr(extension, "Voodoo5")) { + config->SSTs[i].type = GR_SSTTYPE_Voodoo5; + } else { /* Voodoo1,2,rush */ + /* ZZZ TO DO */ + config->SSTs[i].type = GR_SSTTYPE_VOODOO; + } + grGet(GR_MEMORY_FB, 4, &result); - config->SSTs[i].sstBoard.VoodooConfig.fbRam = result / (1024 * 1024); + config->SSTs[i].VoodooConfig.fbRam = result / (1024 * 1024); grGet(GR_NUM_TMU, 4, &result); - config->SSTs[i].sstBoard.VoodooConfig.nTexelfx = result; + config->SSTs[i].VoodooConfig.nTexelfx = result; grGet(GR_REVISION_FB, 4, &result); - config->SSTs[i].sstBoard.VoodooConfig.fbiRev = result; + config->SSTs[i].VoodooConfig.fbiRev = result; - grGet(GR_NUM_FB, 4, (void *) &numFB); - if (numFB > 1) - config->SSTs[i].sstBoard.VoodooConfig.sliDetect = FXTRUE; - else - config->SSTs[i].sstBoard.VoodooConfig.sliDetect = FXFALSE; - - for (j = 0; j < config->SSTs[i].sstBoard.VoodooConfig.nTexelfx; j++) { + for (j = 0; j < config->SSTs[i].VoodooConfig.nTexelfx; j++) { grGet(GR_MEMORY_TMU, 4, &result); - config->SSTs[i].sstBoard.VoodooConfig.tmuConfig[j].tmuRam = - result / (1024 * 1024); + config->SSTs[i].VoodooConfig.tmuConfig[j].tmuRam = result / (1024 * 1024); grGet(GR_REVISION_TMU, 4, &result); - config->SSTs[i].sstBoard.VoodooConfig.tmuConfig[j].tmuRev = result; + config->SSTs[i].VoodooConfig.tmuConfig[j].tmuRev = result; } - { - const char *extension = grGetString(GR_EXTENSION); - if (strstr(extension, " PIXEXT ")) { - config->SSTs[i].sstBoard.VoodooConfig.gExt.grSstWinOpen = grGetProcAddress("grSstWinOpenExt"); - } + extension = grGetString(GR_EXTENSION); + if (strstr(extension, " PIXEXT ")) { + config->SSTs[i].VoodooConfig.grSstWinOpenExt = grGetProcAddress("grSstWinOpenExt"); } - } - END_BOARD_LOCK(); - return 1; -} - -#else - -int -FX_grSstScreenWidth() -{ - int i; - BEGIN_BOARD_LOCK(); - i = grSstScreenWidth(); - END_BOARD_LOCK(); - return i; -} -int -FX_grSstScreenHeight() -{ - int i; - BEGIN_BOARD_LOCK(); - i = grSstScreenHeight(); - END_BOARD_LOCK(); - return i; -} + /* [koolsmoky] */ + grGet(GR_MAX_TEXTURE_SIZE, 4, &result); + config->SSTs[i].VoodooConfig.maxTextureSize = result; -int -FX_grSstQueryHardware(GrHwConfiguration * c) -{ - int i; - BEGIN_BOARD_LOCK(); - i = grSstQueryHardware(c); + /* need to get the number of SLI units for napalm */ + grGet(GR_NUM_FB, 4, (void *) &numFB); + config->SSTs[i].VoodooConfig.numChips = numFB; + /* this can only be useful for Voodoo2: + * sliDetect = ((config->SSTs[i].type == GR_SSTTYPE_Voodoo2) && (numFB > 1)); + */ + } END_BOARD_LOCK(); - return i; + return 1; } -#endif /* FX_GLIDE3 */ - /* It appears to me that this function is needed either way. */ -FX_GrContext_t +GrContext_t FX_grSstWinOpen(struct SstCard_St *c, FxU32 hWnd, GrScreenResolution_t screen_resolution, @@ -444,15 +276,15 @@ FX_grSstWinOpen(struct SstCard_St *c, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers) { - FX_GrContext_t i; + GrContext_t i; BEGIN_BOARD_LOCK(); - if ((c->type == GR_SSTTYPE_VOODOO) && c->sstBoard.VoodooConfig.gExt.grSstWinOpen) { - i = c->sstBoard.VoodooConfig.gExt.grSstWinOpen(hWnd, - screen_resolution, - refresh_rate, - color_format, origin_location, - pixel_format, - nColBuffers, nAuxBuffers); + if (c->VoodooConfig.grSstWinOpenExt) { + i = c->VoodooConfig.grSstWinOpenExt(hWnd, + screen_resolution, + refresh_rate, + color_format, origin_location, + pixel_format, + nColBuffers, nAuxBuffers); } else i = grSstWinOpen(hWnd, screen_resolution, diff --git a/src/mesa/drivers/glide/fxglidew.h b/src/mesa/drivers/glide/fxglidew.h index 1ef3451d92a..a09df0b48cf 100644 --- a/src/mesa/drivers/glide/fxglidew.h +++ b/src/mesa/drivers/glide/fxglidew.h @@ -1,4 +1,4 @@ -/* $Id: fxglidew.h,v 1.14 2003/07/17 14:50:12 brianp Exp $ */ +/* $Id: fxglidew.h,v 1.15 2003/08/19 15:52:53 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -29,141 +29,95 @@ * Brian Paul * Daryll Strauss * Keith Whitwell + * Daniel Borca + * Hiroshi Morii */ #ifndef __FX_GLIDE_WARPER__ #define __FX_GLIDE_WARPER__ -#include -/* - * General context: - */ -#if !defined(FX_GLIDE3) -typedef FxU32 FX_GrContext_t; /* Not used in Glide2 */ -typedef FxU32 GrPixelFormat_t; -#else +#include #include -typedef GrContext_t FX_GrContext_t; -#endif -/* - * Glide3 emulation on Glide2: - */ -#if !defined(FX_GLIDE3) - /* Constanst for FX_grGetInteger( ) */ -#define FX_FOG_TABLE_ENTRIES 0x0004 /* The number of entries in the hardware fog table. */ -#define FX_GLIDE_STATE_SIZE 0x0006 /* Size of buffer, in bytes, needed to save Glide state. */ -#define FX_LFB_PIXEL_PIPE 0x0009 /* 1 if LFB writes can go through the 3D pixel pipe. */ -#define FX_PENDING_BUFFERSWAPS 0x0014 /* The number of buffer swaps pending. */ -#define FX_TEXTURE_ALIGN 0x0024 /* The required alignment for textures */ -#else -#define FX_FOG_TABLE_ENTRIES GR_FOG_TABLE_ENTRIES -#define FX_GLIDE_STATE_SIZE GR_GLIDE_STATE_SIZE -#define FX_LFB_PIXEL_PIPE GR_LFB_PIXEL_PIPE -#define FX_PENDING_BUFFERSWAPS GR_PENDING_BUFFERSWAPS -#define FX_TEXTURE_ALIGN GR_TEXTURE_ALIGN -#endif -/* - * Genral warper functions for Glide2/Glide3: - */ -extern FxI32 FX_grGetInteger(FxU32 pname); + +#define FX_grGetInteger FX_grGetInteger_NoLock extern FxI32 FX_grGetInteger_NoLock(FxU32 pname); -/* - * Glide2 emulation on Glide3: - */ -#if defined(FX_GLIDE3) - -#define GR_ASPECT_1x1 GR_ASPECT_LOG2_1x1 -#define GR_ASPECT_2x1 GR_ASPECT_LOG2_2x1 -#define GR_ASPECT_4x1 GR_ASPECT_LOG2_4x1 -#define GR_ASPECT_8x1 GR_ASPECT_LOG2_8x1 -#define GR_ASPECT_1x2 GR_ASPECT_LOG2_1x2 -#define GR_ASPECT_1x4 GR_ASPECT_LOG2_1x4 -#define GR_ASPECT_1x8 GR_ASPECT_LOG2_1x8 - -#define GR_LOD_256 GR_LOD_LOG2_256 -#define GR_LOD_128 GR_LOD_LOG2_128 -#define GR_LOD_64 GR_LOD_LOG2_64 -#define GR_LOD_32 GR_LOD_LOG2_32 -#define GR_LOD_16 GR_LOD_LOG2_16 -#define GR_LOD_8 GR_LOD_LOG2_8 -#define GR_LOD_4 GR_LOD_LOG2_4 -#define GR_LOD_2 GR_LOD_LOG2_2 -#define GR_LOD_1 GR_LOD_LOG2_1 - -#define GR_FOG_WITH_TABLE GR_FOG_WITH_TABLE_ON_Q + + +#define GR_ASPECT_1x1 GR_ASPECT_LOG2_1x1 +#define GR_ASPECT_2x1 GR_ASPECT_LOG2_2x1 +#define GR_ASPECT_4x1 GR_ASPECT_LOG2_4x1 +#define GR_ASPECT_8x1 GR_ASPECT_LOG2_8x1 +#define GR_ASPECT_1x2 GR_ASPECT_LOG2_1x2 +#define GR_ASPECT_1x4 GR_ASPECT_LOG2_1x4 +#define GR_ASPECT_1x8 GR_ASPECT_LOG2_1x8 + +#define GR_LOD_2048 GR_LOD_LOG2_2048 /* [koolsmoky] big texture support for napalm */ +#define GR_LOD_1024 GR_LOD_LOG2_1024 +#define GR_LOD_512 GR_LOD_LOG2_512 +#define GR_LOD_256 GR_LOD_LOG2_256 +#define GR_LOD_128 GR_LOD_LOG2_128 +#define GR_LOD_64 GR_LOD_LOG2_64 +#define GR_LOD_32 GR_LOD_LOG2_32 +#define GR_LOD_16 GR_LOD_LOG2_16 +#define GR_LOD_8 GR_LOD_LOG2_8 +#define GR_LOD_4 GR_LOD_LOG2_4 +#define GR_LOD_2 GR_LOD_LOG2_2 +#define GR_LOD_1 GR_LOD_LOG2_1 + +#define GR_FOG_WITH_TABLE GR_FOG_WITH_TABLE_ON_Q + + typedef int GrSstType; -#define MAX_NUM_SST 4 - -#define GR_SSTTYPE_VOODOO 0 -#define GR_SSTTYPE_SST96 1 -#define GR_SSTTYPE_AT3D 2 -#define GR_SSTTYPE_Voodoo2 3 - -typedef struct GrTMUConfig_St -{ - int tmuRev; /* Rev of Texelfx chip */ - int tmuRam; /* 1, 2, or 4 MB */ -} -GrTMUConfig_t; - -typedef struct GrVoodooConfig_St -{ - int fbRam; /* 1, 2, or 4 MB */ - int fbiRev; /* Rev of Pixelfx chip */ - int nTexelfx; /* How many texelFX chips are there? */ - FxBool sliDetect; /* Is it a scan-line interleaved board? */ - struct { /* Glide extensions */ - GrProc grSstWinOpen; - } gExt; - GrTMUConfig_t tmuConfig[GLIDE_NUM_TMU]; /* Configuration of the Texelfx chips */ -} -GrVoodooConfig_t; - -typedef struct GrSst96Config_St -{ - int fbRam; /* How much? */ - int nTexelfx; - GrTMUConfig_t tmuConfig; -} -GrSst96Config_t; - -typedef GrVoodooConfig_t GrVoodoo2Config_t; - -typedef struct GrAT3DConfig_St -{ - int rev; -} -GrAT3DConfig_t; - -typedef struct -{ - int num_sst; /* # of HW units in the system */ - struct SstCard_St - { - GrSstType type; /* Which hardware is it? */ - union SstBoard_u - { - GrVoodooConfig_t VoodooConfig; - GrSst96Config_t SST96Config; - GrAT3DConfig_t AT3DConfig; - GrVoodoo2Config_t Voodoo2Config; - } - sstBoard; - } - SSTs[MAX_NUM_SST]; /* configuration for each board */ -} -GrHwConfiguration; +#define MAX_NUM_SST 4 + +enum { + GR_SSTTYPE_VOODOO = 0, + GR_SSTTYPE_SST96 = 1, + GR_SSTTYPE_AT3D = 2, + GR_SSTTYPE_Voodoo2 = 3, + GR_SSTTYPE_Banshee = 4, + GR_SSTTYPE_Voodoo3 = 5, + GR_SSTTYPE_Voodoo4 = 6, + GR_SSTTYPE_Voodoo5 = 7 +}; + +typedef struct GrTMUConfig_St { + int tmuRev; /* Rev of Texelfx chip */ + int tmuRam; /* 1, 2, or 4 MB */ +} GrTMUConfig_t; + +typedef struct GrVoodooConfig_St { + int fbRam; /* 1, 2, or 4 MB */ + int fbiRev; /* Rev of Pixelfx chip */ + int nTexelfx; /* How many texelFX chips are there? */ + GrTMUConfig_t tmuConfig[GLIDE_NUM_TMU]; /* Configuration of the Texelfx chips */ + int maxTextureSize; + int numChips; /* Number of Voodoo chips [koolsmoky] */ + /* Glide3 extensions */ + GrProc grSstWinOpenExt; +} GrVoodooConfig_t; + +typedef struct { + int num_sst; /* # of HW units in the system */ + struct SstCard_St { + GrSstType type; /* Which hardware is it? */ + GrVoodooConfig_t VoodooConfig; + } + SSTs[MAX_NUM_SST]; /* configuration for each board */ +} GrHwConfiguration; + + typedef FxU32 GrHint_t; -#define GR_HINTTYPE_MIN 0 -#define GR_HINT_STWHINT 0 +#define GR_HINTTYPE_MIN 0 +#define GR_HINT_STWHINT 0 typedef FxU32 GrSTWHint_t; #define GR_STWHINT_W_DIFF_FBI FXBIT(0) @@ -174,33 +128,32 @@ typedef FxU32 GrSTWHint_t; #define GR_STWHINT_W_DIFF_TMU2 FXBIT(5) #define GR_STWHINT_ST_DIFF_TMU2 FXBIT(6) -#define GR_CONTROL_ACTIVATE 1 -#define GR_CONTROL_DEACTIVATE 0 +#define GR_CONTROL_ACTIVATE 1 +#define GR_CONTROL_DEACTIVATE 0 + + + +#define GrState void + -#define GrState void /* ** move the vertex layout defintion to application */ -typedef struct -{ - float sow; /* s texture ordinate (s over w) */ - float tow; /* t texture ordinate (t over w) */ - float oow; /* 1/w (used mipmapping - really 0xfff/w) */ -} -GrTmuVertex; - - -typedef struct -{ - float x, y, z; /* X, Y, and Z of scrn space -- Z is ignored */ - float r, g, b; /* R, G, B, ([0..255.0]) */ - float ooz; /* 65535/Z (used for Z-buffering) */ - float a; /* Alpha [0..255.0] */ - float oow; /* 1/W (used for W-buffering, texturing) */ - GrTmuVertex tmuvtx[GLIDE_NUM_TMU]; -} -GrVertex; +typedef struct { + float sow; /* s texture ordinate (s over w) */ + float tow; /* t texture ordinate (t over w) */ + float oow; /* 1/w (used mipmapping - really 0xfff/w) */ +} GrTmuVertex; + +typedef struct { + float x, y, z; /* X, Y, and Z of scrn space -- Z is ignored */ + float r, g, b; /* R, G, B, ([0..255.0]) */ + float ooz; /* 65535/Z (used for Z-buffering) */ + float a; /* Alpha [0..255.0] */ + float oow; /* 1/W (used for W-buffering, texturing) */ + GrTmuVertex tmuvtx[GLIDE_NUM_TMU]; +} GrVertex; #define GR_VERTEX_X_OFFSET 0 #define GR_VERTEX_Y_OFFSET 1 @@ -218,142 +171,52 @@ GrVertex; #define GR_VERTEX_TOW_TMU1_OFFSET 13 #define GR_VERTEX_OOW_TMU1_OFFSET 14 -#endif /* - * Glide2 functions for Glide3 + * Write region: ToDo possible exploit the PixelPipe parameter. */ -#if defined(FX_GLIDE3) -#define FX_grTexDownloadTable(TMU,type,data) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grTexDownloadTable(type,data); \ - END_BOARD_LOCK(); \ - } while (0); -#define FX_grTexDownloadTable_NoLock(TMU,type,data) \ - grTexDownloadTable(type, data) -#else -#define FX_grTexDownloadTable(TMU,type,data) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grTexDownloadTable(TMU,type,data); \ - END_BOARD_LOCK(); \ - } while (0); -#define FX_grTexDownloadTable_NoLock grTexDownloadTable -#endif +#define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \ + do { \ + BEGIN_BOARD_LOCK(); \ + grLfbWriteRegion(dst_buffer,\ + dst_x, \ + dst_y, \ + src_format,\ + src_width, \ + src_height,\ + FXFALSE, \ + src_stride,\ + src_data); \ + END_BOARD_LOCK(); \ + } while(0) -/* - * Flush - */ -#if defined(FX_GLIDE3) -#define FX_grFlush() \ - do { \ - BEGIN_BOARD_LOCK(); \ - grFlush(); \ - END_BOARD_LOCK(); \ - } while (0) -#else -#define FX_grFlush() \ - do { \ - BEGIN_BOARD_LOCK(); \ - grSstIdle(); \ - END_BOARD_LOCK(); \ - } while (0) -#endif -#define FX_grFinish() \ - do { \ - BEGIN_BOARD_LOCK(); \ - grFinish(); \ - END_BOARD_LOCK(); \ - } while (0) /* - * Write region: ToDo possible exploit the PixelPipe parameter. + * Draw triangle */ -#if defined(FX_GLIDE3) -#define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,FXFALSE,src_stride,src_data); \ - END_BOARD_LOCK(); \ - } while(0) -#else -#define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \ +#define FX_grDrawTriangle(a,b,c)\ do { \ - BEGIN_BOARD_LOCK(); \ - grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data); \ - END_BOARD_LOCK(); \ + BEGIN_CLIP_LOOP(); \ + grDrawTriangle(a,b,c); \ + END_CLIP_LOOP(); \ } while (0) -#endif -/* - * Read region - */ -#define FX_grLfbReadRegion(src_buffer,src_x,src_y,src_width,src_height,dst_stride,dst_data) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grLfbReadRegion(src_buffer,src_x,src_y,src_width,src_height,dst_stride,dst_data); \ - END_BOARD_LOCK(); \ - } while (0); -/* - * Draw triangle - */ -#define FX_grDrawTriangle(a,b,c) \ - do { \ - BEGIN_CLIP_LOOP(); \ - grDrawTriangle(a,b,c); \ - END_CLIP_LOOP(); \ - } while (0) /* * For Lod/LodLog2 conversion. */ -#if defined(FX_GLIDE3) #define FX_largeLodLog2(info) (info).largeLodLog2 -#else -#define FX_largeLodLog2(info) (info).largeLod -#endif - -#if defined(FX_GLIDE3) -#define FX_aspectRatioLog2(info) (info).aspectRatioLog2 -#else -#define FX_aspectRatioLog2(info) (info).aspectRatio -#endif - -#if defined(FX_GLIDE3) +#define FX_aspectRatioLog2(info) (info).aspectRatioLog2 #define FX_smallLodLog2(info) (info).smallLodLog2 -#else -#define FX_smallLodLog2(info) (info).smallLod -#endif - -#if defined(FX_GLIDE3) #define FX_lodToValue(val) ((int)(GR_LOD_256-val)) -#else -#define FX_lodToValue(val) ((int)(val)) -#endif - -#if defined(FX_GLIDE3) #define FX_largeLodValue(info) ((int)(GR_LOD_256-(info).largeLodLog2)) -#else -#define FX_largeLodValue(info) ((int)(info).largeLod) -#endif -#define FX_largeLodValue_NoLock FX_largeLodValue - -#if defined(FX_GLIDE3) #define FX_smallLodValue(info) ((int)(GR_LOD_256-(info).smallLodLog2)) -#else -#define FX_smallLodValue(info) ((int)(info).smallLod) -#endif -#define FX_smallLodValue_NoLock FX_smallLodValue - -#if defined(FX_GLIDE3) #define FX_valueToLod(val) ((GrLOD_t)(GR_LOD_256-val)) -#else -#define FX_valueToLod(val) ((GrLOD_t)(val)) -#endif + + /* * ScreenWidth/Height stuff. @@ -364,129 +227,51 @@ extern int FX_grSstScreenHeight(void); /* - * Version string. - */ -#if defined(FX_GLIDE3) -extern void FX_grGlideGetVersion(char *buf); -#else -#define FX_grGlideGetVersion(b) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grGlideGetVersion(b); \ - END_BOARD_LOCK(); \ - } while (0) -#endif -/* - * Performance statistics + * Query */ -#if defined(FX_GLIDE3) -extern void FX_grSstPerfStats(GrSstPerfStats_t * st); -#else -#define FX_grSstPerfStats(s) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grSstPerfStats(s); \ - END_BOARD_LOCK(); \ - } while (0) -#endif +extern void FX_grSstPerfStats(GrSstPerfStats_t *st); +extern int FX_grSstQueryHardware(GrHwConfiguration *config); + -/* - * Hardware Query - */ -extern int FX_grSstQueryHardware(GrHwConfiguration * config); /* * GrHints */ -#if defined(FX_GLIDE3) +#define FX_grHints FX_grHints_NoLock extern void FX_grHints_NoLock(GrHint_t hintType, FxU32 hintMask); -extern void FX_grHints(GrHint_t hintType, FxU32 hintMask); -#else -#define FX_grHints(t,m) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grHints(t, m); \ - END_BOARD_LOCK(); \ - } while(0) -#define FX_grHints_NoLock grHints -#endif + + + /* * Antialiashed line+point drawing. */ -#if defined(FX_GLIDE3) -extern void FX_grAADrawLine(GrVertex * a, GrVertex * b); -#else -#define FX_grAADrawLine(a,b) \ - do { \ - BEGIN_CLIP_LOOP(); \ - grAADrawLine(a,b); \ - END_CLIP_LOOP(); \ - } while (0) -#endif - -#if defined(FX_GLIDE3) -extern void FX_grAADrawPoint(GrVertex * a); -#else -#define FX_grAADrawPoint(a) \ - do { \ - BEGIN_CLIP_LOOP(); \ - grAADrawPoint(a); \ - END_CLIP_LOOP(); \ - } while (0) -#endif +extern void FX_grAADrawLine(GrVertex *a, GrVertex *b); +extern void FX_grAADrawPoint(GrVertex *a); + + /* * Needed for Glide3 only, to set up Glide2 compatible vertex layout. */ -#if defined(FX_GLIDE3) extern void FX_setupGrVertexLayout(void); -#else -#define FX_setupGrVertexLayout() do {} while (0) -#endif + + + /* * grSstControl stuff */ extern FxBool FX_grSstControl(FxU32 code); -/* - * grGammaCorrectionValue - */ -#if defined(FX_GLIDE3) -extern void FX_grGammaCorrectionValue(float val); -#else -#define FX_grGammaCorrectionValue(v) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grGammaCorrectionValue(v) \ - END_BOARD_LOCK(); \ - } while (0) -#endif - -#if defined(FX_GLIDE3) -#define FX_grSstWinClose(w) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grSstWinClose(w); \ - END_BOARD_LOCK(); \ - } while (0) -#else -#define FX_grSstWinClose(w) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grSstWinClose(); \ - END_BOARD_LOCK(); \ - } while (0) -#endif -extern FX_GrContext_t FX_grSstWinOpen(struct SstCard_St *c, - FxU32 hWnd, - GrScreenResolution_t screen_resolution, - GrScreenRefresh_t refresh_rate, - GrColorFormat_t color_format, - GrPixelFormat_t pixel_format, - GrOriginLocation_t origin_location, - int nColBuffers, int nAuxBuffers); +extern GrContext_t FX_grSstWinOpen(struct SstCard_St *c, + FxU32 hWnd, + GrScreenResolution_t screen_resolution, + GrScreenRefresh_t refresh_rate, + GrColorFormat_t color_format, + GrPixelFormat_t pixel_format, + GrOriginLocation_t origin_location, + int nColBuffers, int nAuxBuffers); #define FX_grDrawLine(v1, v2) \ @@ -503,30 +288,12 @@ extern FX_GrContext_t FX_grSstWinOpen(struct SstCard_St *c, END_CLIP_LOOP(); \ } while (0) -#if defined(FX_GLIDE3) -extern void FX_grDrawPolygonVertexList(int n, GrVertex * v); -#else -#define FX_grDrawPolygonVertexList(n, v) \ - do { \ - BEGIN_CLIP_LOOP(); \ - grDrawPolygonVertexList(n, v); \ - END_CLIP_LOOP(); \ - } while (0) -#endif - -#define FX_grDitherMode(m) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grDitherMode(m); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grRenderBuffer(b) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grRenderBuffer(b); \ - END_BOARD_LOCK(); \ - } while (0) +#define FX_grDrawPolygonVertexList(n, v) \ + do { \ + BEGIN_CLIP_LOOP(); \ + grDrawVertexArrayContiguous(GR_POLYGON, n, v, sizeof(GrVertex)); \ + END_CLIP_LOOP(); \ + } while (0) #define FX_grBufferClear(c, a, d) \ do { \ @@ -535,40 +302,6 @@ extern void FX_grDrawPolygonVertexList(int n, GrVertex * v); END_CLIP_LOOP(); \ } while (0) -#define FX_grDepthMask(m) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grDepthMask(m); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grColorMask(c, a) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grColorMask(c, a); \ - END_BOARD_LOCK(); \ - } while (0) - -extern FxBool FX_grLfbLock(GrLock_t type, GrBuffer_t buffer, - GrLfbWriteMode_t writeMode, - GrOriginLocation_t origin, FxBool pixelPipeline, - GrLfbInfo_t * info); - -#define FX_grLfbUnlock(t, b) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grLfbUnlock(t, b); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grConstantColorValue(v) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grConstantColorValue(v); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grConstantColorValue_NoLock grConstantColorValue #define FX_grAADrawTriangle(a, b, c, ab, bc, ca) \ do { \ @@ -577,208 +310,7 @@ extern FxBool FX_grLfbLock(GrLock_t type, GrBuffer_t buffer, END_CLIP_LOOP(); \ } while (0) -#define FX_grAlphaBlendFunction(rs, rd, as, ad) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grAlphaBlendFunction(rs, rd, as, ad); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grAlphaCombine(func, fact, loc, oth, inv) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grAlphaCombine(func, fact, loc, oth, inv); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grAlphaCombine_NoLock grAlphaCombine - -#define FX_grAlphaTestFunction(f) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grAlphaTestFunction(f); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grAlphaTestReferenceValue(v) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grAlphaTestReferenceValue(v); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grClipWindow(minx, miny, maxx, maxy) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grClipWindow(minx, miny, maxx, maxy); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grClipWindow_NoLock grClipWindow - -#define FX_grColorCombine(func, fact, loc, oth, inv) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grColorCombine(func, fact, loc, oth, inv); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grColorCombine_NoLock grColorCombine - -#define FX_grCullMode(m) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grCullMode(m); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grDepthBiasLevel(lev) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grDepthBiasLevel(lev); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grDepthBufferFunction(func) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grDepthBufferFunction(func); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grFogColorValue(c) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grFogColorValue(c); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grFogMode(m) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grFogMode(m); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grFogTable(t) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grFogTable(t); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grTexClampMode(t, sc, tc) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grTexClampMode(t, sc, tc); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grTexClampMode_NoLock grTexClampMode - -#define FX_grTexCombine(t, rfunc, rfact, afunc, afact, rinv, ainv) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grTexCombine(t, rfunc, rfact, afunc, afact, rinv, ainv); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grTexCombine_NoLock grTexCombine -#define FX_grTexDownloadMipMapLevel(t, sa, tlod, llod, ar, f, eo, d) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grTexDownloadMipMapLevel(t, sa, tlod, llod, ar, f, eo, d); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grTexDownloadMipMapLevel_NoLock grTexDownloadMipMapLevel - -#define FX_grTexDownloadMipMapLevelPartial(t, sa, tlod, llod, ar, f, eo, d, s, e); \ - do { \ - BEGIN_BOARD_LOCK(); \ - grTexDownloadMipMapLevelPartial(t, sa, tlod, llod, ar, f, eo, d, s, e); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grTexFilterMode(t, minf, magf) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grTexFilterMode(t, minf, magf); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grTexFilterMode_NoLock grTexFilterMode - -extern FxU32 FX_grTexMinAddress(GrChipID_t tmu); -extern FxU32 FX_grTexMaxAddress(GrChipID_t tmu); - -#define FX_grTexMipMapMode(t, m, lod) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grTexMipMapMode(t, m, lod); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grTexMipMapMode_NoLock grTexMipMapMode - -#define FX_grTexSource(t, sa, eo, i) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grTexSource(t, sa, eo, i); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grTexSource_NoLock grTexSource - -extern FxU32 FX_grTexTextureMemRequired(FxU32 evenOdd, GrTexInfo * info); -#define FX_grTexTextureMemRequired_NoLock grTexTextureMemRequired - -#define FX_grGlideGetState(s) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grGlideGetState(s); \ - END_BOARD_LOCK(); \ - } while (0) -#define FX_grGlideGetState_NoLock(s) grGlideGetState(s); - -#define FX_grDRIBufferSwap(i) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grDRIBufferSwap(i); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grSstSelect(b) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grSstSelect(b); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grSstSelect_NoLock grSstSelect - -#define FX_grGlideSetState(s) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grGlideSetState(s); \ - END_BOARD_LOCK(); \ - } while (0) -#define FX_grGlideSetState_NoLock(s) grGlideSetState(s); - -#define FX_grDepthBufferMode(m) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grDepthBufferMode(m); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grLfbWriteColorFormat(f) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grLfbWriteColorFormat(f); \ - END_BOARD_LOCK(); \ - } while (0) #define FX_grDrawVertexArray(m, c, p) \ do { \ @@ -787,26 +319,6 @@ extern FxU32 FX_grTexTextureMemRequired(FxU32 evenOdd, GrTexInfo * info); END_CLIP_LOOP(); \ } while (0) -#define FX_grGlideShutdown() \ - do { \ - BEGIN_BOARD_LOCK(); \ - grGlideShutdown(); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grTexLodBiasValue_NoLock(t, v) grTexLodBiasValue(t, v) - -#define FX_grTexLodBiasValue(t, v) \ - do { \ - BEGIN_BOARD_LOCK(); \ - grTexLodBiasValue(t, v); \ - END_BOARD_LOCK(); \ - } while (0) - -#define FX_grGlideInit_NoLock grGlideInit -#define FX_grSstWinOpen_NoLock grSstWinOpen -extern int FX_getFogTableSize(void); -extern int FX_getGrStateSize(void); #endif /* __FX_GLIDE_WARPER__ */ diff --git a/src/mesa/drivers/glide/fxopengl.def b/src/mesa/drivers/glide/fxopengl.def index af76f4c1b21..cb321670cec 100644 --- a/src/mesa/drivers/glide/fxopengl.def +++ b/src/mesa/drivers/glide/fxopengl.def @@ -1,467 +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 +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/src/mesa/drivers/glide/fxsetup.c b/src/mesa/drivers/glide/fxsetup.c index 48a1ae69267..523bf2b3fdd 100644 --- a/src/mesa/drivers/glide/fxsetup.c +++ b/src/mesa/drivers/glide/fxsetup.c @@ -1,4 +1,4 @@ -/* $Id: fxsetup.c,v 1.38 2002/11/04 20:29:04 brianp Exp $ */ +/* $Id: fxsetup.c,v 1.39 2003/08/19 15:52:53 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -29,6 +29,8 @@ * Brian Paul * Daryll Strauss * Keith Whitwell + * Daniel Borca + * Hiroshi Morii */ /* fxsetup.c - 3Dfx VooDoo rendering mode setup functions */ @@ -78,8 +80,8 @@ fxTexValidate(GLcontext * ctx, struct gl_texture_object *tObj) else FX_smallLodLog2(ti->info) = FX_largeLodLog2(ti->info); - fxTexGetFormat(tObj->Image[minl]->TexFormat->BaseFormat, &(ti->info.format), - &(ti->baseLevelInternalFormat)); + fxTexGetFormat(ctx, tObj->Image[minl]->TexFormat->BaseFormat, &(ti->info.format), + &(ti->baseLevelInternalFormat)); /* [koolsmoky] */ switch (tObj->WrapS) { case GL_CLAMP_TO_EDGE: @@ -309,7 +311,7 @@ fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj) else { if (fxMesa->haveTwoTMUs) { if (fxMesa->freeTexMem[FX_TMU0] > - FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_BOTH, + grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info))) { fxTMMoveInTM_NoLock(fxMesa, tObj, FX_TMU0); } @@ -328,22 +330,19 @@ fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj) if (MESA_VERBOSE & VERBOSE_DRIVER) { fprintf(stderr, "fxmesa: uploading texture palette\n"); } - FX_grTexDownloadTable_NoLock(GR_TMU0, GR_TEXTABLE_PALETTE, - &(ti->palette)); - FX_grTexDownloadTable_NoLock(GR_TMU1, GR_TEXTABLE_PALETTE, - &(ti->palette)); + grTexDownloadTable(GR_TEXTABLE_PALETTE, &(ti->palette)); } - FX_grTexClampMode_NoLock(GR_TMU0, ti->sClamp, ti->tClamp); - FX_grTexClampMode_NoLock(GR_TMU1, ti->sClamp, ti->tClamp); - FX_grTexFilterMode_NoLock(GR_TMU0, ti->minFilt, ti->maxFilt); - FX_grTexFilterMode_NoLock(GR_TMU1, ti->minFilt, ti->maxFilt); - FX_grTexMipMapMode_NoLock(GR_TMU0, ti->mmMode, ti->LODblend); - FX_grTexMipMapMode_NoLock(GR_TMU1, ti->mmMode, ti->LODblend); + grTexClampMode(GR_TMU0, ti->sClamp, ti->tClamp); + grTexClampMode(GR_TMU1, ti->sClamp, ti->tClamp); + grTexFilterMode(GR_TMU0, ti->minFilt, ti->maxFilt); + grTexFilterMode(GR_TMU1, ti->minFilt, ti->maxFilt); + grTexMipMapMode(GR_TMU0, ti->mmMode, ti->LODblend); + grTexMipMapMode(GR_TMU1, ti->mmMode, ti->LODblend); - FX_grTexSource_NoLock(GR_TMU0, ti->tm[FX_TMU0]->startAddr, + grTexSource(GR_TMU0, ti->tm[FX_TMU0]->startAddr, GR_MIPMAPLEVELMASK_ODD, &(ti->info)); - FX_grTexSource_NoLock(GR_TMU1, ti->tm[FX_TMU1]->startAddr, + grTexSource(GR_TMU1, ti->tm[FX_TMU1]->startAddr, GR_MIPMAPLEVELMASK_EVEN, &(ti->info)); } else { @@ -357,8 +356,7 @@ fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj) if (MESA_VERBOSE & VERBOSE_DRIVER) { fprintf(stderr, "fxmesa: uploading texture palette\n"); } - FX_grTexDownloadTable_NoLock(tmu, GR_TEXTABLE_PALETTE, - &(ti->palette)); + grTexDownloadTable(GR_TEXTABLE_PALETTE, &(ti->palette)); } /* KW: The alternative is to do the download to the other tmu. If @@ -368,12 +366,11 @@ fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj) if (ti->LODblend && (MESA_VERBOSE & VERBOSE_DRIVER)) fprintf(stderr, "fxmesa: not blending texture - only on one tmu\n"); - FX_grTexClampMode_NoLock(tmu, ti->sClamp, ti->tClamp); - FX_grTexFilterMode_NoLock(tmu, ti->minFilt, ti->maxFilt); - FX_grTexMipMapMode_NoLock(tmu, ti->mmMode, FXFALSE); + grTexClampMode(tmu, ti->sClamp, ti->tClamp); + grTexFilterMode(tmu, ti->minFilt, ti->maxFilt); + grTexMipMapMode(tmu, ti->mmMode, FXFALSE); - FX_grTexSource_NoLock(tmu, ti->tm[tmu]->startAddr, - GR_MIPMAPLEVELMASK_BOTH, &(ti->info)); + grTexSource(tmu, ti->tm[tmu]->startAddr, GR_MIPMAPLEVELMASK_BOTH, &(ti->info)); } } @@ -385,7 +382,7 @@ fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu, FxBool LODblend) } if (LODblend) { - FX_grTexCombine_NoLock(GR_TMU0, + grTexCombine(GR_TMU0, GR_COMBINE_FUNCTION_BLEND, GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION, GR_COMBINE_FUNCTION_BLEND, @@ -393,7 +390,7 @@ fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu, FxBool LODblend) FXFALSE, FXFALSE); if (fxMesa->haveTwoTMUs) - FX_grTexCombine_NoLock(GR_TMU1, + grTexCombine(GR_TMU1, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, GR_COMBINE_FUNCTION_LOCAL, @@ -402,13 +399,13 @@ fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu, FxBool LODblend) } else { if (tmu != FX_TMU1) { - FX_grTexCombine_NoLock(GR_TMU0, + grTexCombine(GR_TMU0, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE); if (fxMesa->haveTwoTMUs) { - FX_grTexCombine_NoLock(GR_TMU1, + grTexCombine(GR_TMU1, GR_COMBINE_FUNCTION_ZERO, GR_COMBINE_FACTOR_NONE, GR_COMBINE_FUNCTION_ZERO, @@ -417,7 +414,7 @@ fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu, FxBool LODblend) fxMesa->tmuSrc = FX_TMU0; } else { - FX_grTexCombine_NoLock(GR_TMU1, + grTexCombine(GR_TMU1, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, GR_COMBINE_FUNCTION_LOCAL, @@ -425,7 +422,7 @@ fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu, FxBool LODblend) /* GR_COMBINE_FUNCTION_SCALE_OTHER doesn't work ?!? */ - FX_grTexCombine_NoLock(GR_TMU0, + grTexCombine(GR_TMU0, GR_COMBINE_FUNCTION_BLEND, GR_COMBINE_FACTOR_ONE, GR_COMBINE_FUNCTION_BLEND, @@ -495,25 +492,25 @@ fxSetupTextureSingleTMU_NoLock(GLcontext * ctx, GLuint textureset) switch (ctx->Texture.Unit[textureset].EnvMode) { case GL_DECAL: - FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL, + grAlphaCombine(GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, locala, GR_COMBINE_OTHER_NONE, FXFALSE); - FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_BLEND, + grColorCombine(GR_COMBINE_FUNCTION_BLEND, GR_COMBINE_FACTOR_TEXTURE_ALPHA, localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE); break; case GL_MODULATE: - FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER, + grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_LOCAL, locala, GR_COMBINE_OTHER_TEXTURE, FXFALSE); if (ifmt == GL_ALPHA) - FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL, + grColorCombine(GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, localc, GR_COMBINE_OTHER_NONE, FXFALSE); else - FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER, + grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_LOCAL, localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE); break; @@ -523,20 +520,20 @@ fxSetupTextureSingleTMU_NoLock(GLcontext * ctx, GLuint textureset) break; case GL_REPLACE: if ((ifmt == GL_RGB) || (ifmt == GL_LUMINANCE)) - FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL, + grAlphaCombine(GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, locala, GR_COMBINE_OTHER_NONE, FXFALSE); else - FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER, + grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_ONE, locala, GR_COMBINE_OTHER_TEXTURE, FXFALSE); if (ifmt == GL_ALPHA) - FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL, + grColorCombine(GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, localc, GR_COMBINE_OTHER_NONE, FXFALSE); else - FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER, + grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_ONE, localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE); break; @@ -673,34 +670,29 @@ fxSetupDoubleTMU_NoLock(fxMesaContext fxMesa, } if (!fxMesa->haveGlobalPaletteTexture) { + /* [dBorca] + * all TMUs share the same table. + * The next test shouldn't be TMU specific... + */ if (ti0->info.format == GR_TEXFMT_P_8) { if (MESA_VERBOSE & VERBOSE_DRIVER) { fprintf(stderr, "fxmesa: uploading texture palette TMU0\n"); } - FX_grTexDownloadTable_NoLock(tmu0, GR_TEXTABLE_PALETTE, - &(ti0->palette)); - } - - if (ti1->info.format == GR_TEXFMT_P_8) { - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: uploading texture palette TMU1\n"); - } - FX_grTexDownloadTable_NoLock(tmu1, GR_TEXTABLE_PALETTE, - &(ti1->palette)); + grTexDownloadTable(GR_TEXTABLE_PALETTE, &(ti0->palette)); } } - FX_grTexSource_NoLock(tmu0, ti0->tm[tmu0]->startAddr, + grTexSource(tmu0, ti0->tm[tmu0]->startAddr, GR_MIPMAPLEVELMASK_BOTH, &(ti0->info)); - FX_grTexClampMode_NoLock(tmu0, ti0->sClamp, ti0->tClamp); - FX_grTexFilterMode_NoLock(tmu0, ti0->minFilt, ti0->maxFilt); - FX_grTexMipMapMode_NoLock(tmu0, ti0->mmMode, FXFALSE); + grTexClampMode(tmu0, ti0->sClamp, ti0->tClamp); + grTexFilterMode(tmu0, ti0->minFilt, ti0->maxFilt); + grTexMipMapMode(tmu0, ti0->mmMode, FXFALSE); - FX_grTexSource_NoLock(tmu1, ti1->tm[tmu1]->startAddr, + grTexSource(tmu1, ti1->tm[tmu1]->startAddr, GR_MIPMAPLEVELMASK_BOTH, &(ti1->info)); - FX_grTexClampMode_NoLock(tmu1, ti1->sClamp, ti1->tClamp); - FX_grTexFilterMode_NoLock(tmu1, ti1->minFilt, ti1->maxFilt); - FX_grTexMipMapMode_NoLock(tmu1, ti1->mmMode, FXFALSE); + grTexClampMode(tmu1, ti1->sClamp, ti1->tClamp); + grTexFilterMode(tmu1, ti1->minFilt, ti1->maxFilt); + grTexMipMapMode(tmu1, ti1->mmMode, FXFALSE); #undef T0_NOT_IN_TMU #undef T1_NOT_IN_TMU @@ -784,62 +776,62 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx) isalpha[tmu1] = GL_FALSE; if (isalpha[FX_TMU1]) - FX_grTexCombine_NoLock(GR_TMU1, + grTexCombine(GR_TMU1, GR_COMBINE_FUNCTION_ZERO, GR_COMBINE_FACTOR_NONE, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, FXTRUE, FXFALSE); else - FX_grTexCombine_NoLock(GR_TMU1, + grTexCombine(GR_TMU1, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE); if (isalpha[FX_TMU0]) - FX_grTexCombine_NoLock(GR_TMU0, + grTexCombine(GR_TMU0, GR_COMBINE_FUNCTION_BLEND_OTHER, GR_COMBINE_FACTOR_ONE, GR_COMBINE_FUNCTION_BLEND_OTHER, GR_COMBINE_FACTOR_LOCAL, FXFALSE, FXFALSE); else - FX_grTexCombine_NoLock(GR_TMU0, + grTexCombine(GR_TMU0, GR_COMBINE_FUNCTION_BLEND_OTHER, GR_COMBINE_FACTOR_LOCAL, GR_COMBINE_FUNCTION_BLEND_OTHER, GR_COMBINE_FACTOR_LOCAL, FXFALSE, FXFALSE); - FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER, + grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_LOCAL, localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE); - FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER, + grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_LOCAL, locala, GR_COMBINE_OTHER_TEXTURE, FXFALSE); break; } case (FX_UM_E0_REPLACE | FX_UM_E1_BLEND): /* Only for GLQuake */ if (tmu1 == FX_TMU1) { - FX_grTexCombine_NoLock(GR_TMU1, + grTexCombine(GR_TMU1, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, FXTRUE, FXFALSE); - FX_grTexCombine_NoLock(GR_TMU0, + grTexCombine(GR_TMU0, GR_COMBINE_FUNCTION_BLEND_OTHER, GR_COMBINE_FACTOR_LOCAL, GR_COMBINE_FUNCTION_BLEND_OTHER, GR_COMBINE_FACTOR_LOCAL, FXFALSE, FXFALSE); } else { - FX_grTexCombine_NoLock(GR_TMU1, + grTexCombine(GR_TMU1, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE); - FX_grTexCombine_NoLock(GR_TMU0, + grTexCombine(GR_TMU0, GR_COMBINE_FUNCTION_BLEND_OTHER, GR_COMBINE_FACTOR_ONE_MINUS_LOCAL, GR_COMBINE_FUNCTION_BLEND_OTHER, @@ -847,23 +839,23 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx) FXFALSE, FXFALSE); } - FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL, + grAlphaCombine(GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, locala, GR_COMBINE_OTHER_NONE, FXFALSE); - FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER, + grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_ONE, localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE); break; case (FX_UM_E0_REPLACE | FX_UM_E1_MODULATE): /* Quake 2 and 3 */ if (tmu1 == FX_TMU1) { - FX_grTexCombine_NoLock(GR_TMU1, + grTexCombine(GR_TMU1, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, GR_COMBINE_FUNCTION_ZERO, GR_COMBINE_FACTOR_NONE, FXFALSE, FXTRUE); - FX_grTexCombine_NoLock(GR_TMU0, + grTexCombine(GR_TMU0, GR_COMBINE_FUNCTION_BLEND_OTHER, GR_COMBINE_FACTOR_LOCAL, GR_COMBINE_FUNCTION_BLEND_OTHER, @@ -871,13 +863,13 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx) } else { - FX_grTexCombine_NoLock(GR_TMU1, + grTexCombine(GR_TMU1, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE); - FX_grTexCombine_NoLock(GR_TMU0, + grTexCombine(GR_TMU0, GR_COMBINE_FUNCTION_BLEND_OTHER, GR_COMBINE_FACTOR_LOCAL, GR_COMBINE_FUNCTION_BLEND_OTHER, @@ -885,16 +877,16 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx) } if (ti0->baseLevelInternalFormat == GL_RGB) - FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL, + grAlphaCombine(GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, locala, GR_COMBINE_OTHER_NONE, FXFALSE); else - FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER, + grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_ONE, locala, GR_COMBINE_OTHER_NONE, FXFALSE); - FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER, + grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_ONE, localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE); break; @@ -915,36 +907,36 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx) isalpha[tmu1] = GL_FALSE; if (isalpha[FX_TMU1]) - FX_grTexCombine_NoLock(GR_TMU1, + grTexCombine(GR_TMU1, GR_COMBINE_FUNCTION_ZERO, GR_COMBINE_FACTOR_NONE, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, FXTRUE, FXFALSE); else - FX_grTexCombine_NoLock(GR_TMU1, + grTexCombine(GR_TMU1, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, FXFALSE, FXFALSE); if (isalpha[FX_TMU0]) - FX_grTexCombine_NoLock(GR_TMU0, + grTexCombine(GR_TMU0, GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_ONE, GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL, GR_COMBINE_FACTOR_ONE, FXFALSE, FXFALSE); else - FX_grTexCombine_NoLock(GR_TMU0, + grTexCombine(GR_TMU0, GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL, GR_COMBINE_FACTOR_ONE, GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL, GR_COMBINE_FACTOR_ONE, FXFALSE, FXFALSE); - FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER, + grColorCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_LOCAL, localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE); - FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER, + grAlphaCombine(GR_COMBINE_FUNCTION_SCALE_OTHER, GR_COMBINE_FACTOR_LOCAL, locala, GR_COMBINE_OTHER_TEXTURE, FXFALSE); break; @@ -983,11 +975,11 @@ fxSetupTextureNone_NoLock(GLcontext * ctx) else localc = GR_COMBINE_LOCAL_CONSTANT; - FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL, + grAlphaCombine(GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, locala, GR_COMBINE_OTHER_NONE, FXFALSE); - FX_grColorCombine_NoLock(GR_COMBINE_FUNCTION_LOCAL, + grColorCombine(GR_COMBINE_FUNCTION_LOCAL, GR_COMBINE_FACTOR_NONE, localc, GR_COMBINE_OTHER_NONE, FXFALSE); @@ -1161,10 +1153,10 @@ fxSetupBlend(GLcontext * ctx) tfxUnitsState *us = &fxMesa->unitsState; if (us->blendEnabled) - FX_grAlphaBlendFunction(us->blendSrcFuncRGB, us->blendDstFuncRGB, + grAlphaBlendFunction(us->blendSrcFuncRGB, us->blendDstFuncRGB, us->blendSrcFuncAlpha, us->blendDstFuncAlpha); else - FX_grAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ONE, + grAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ONE, GR_BLEND_ZERO); } @@ -1230,11 +1222,11 @@ fxSetupAlphaTest(GLcontext * ctx) if (us->alphaTestEnabled) { GrAlpha_t ref = (GLint) (us->alphaTestRefValue * 255.0); - FX_grAlphaTestFunction(us->alphaTestFunc); - FX_grAlphaTestReferenceValue(ref); + grAlphaTestFunction(us->alphaTestFunc); + grAlphaTestReferenceValue(ref); } else - FX_grAlphaTestFunction(GR_CMP_ALWAYS); + grAlphaTestFunction(GR_CMP_ALWAYS); } /************************************************************************/ @@ -1306,12 +1298,12 @@ fxSetupDepthTest(GLcontext * ctx) tfxUnitsState *us = &fxMesa->unitsState; if (us->depthTestEnabled) { - FX_grDepthBufferFunction(us->depthTestFunc); - FX_grDepthMask(us->depthMask); + grDepthBufferFunction(us->depthTestFunc); + grDepthMask(us->depthMask); } else { - FX_grDepthBufferFunction(GR_CMP_ALWAYS); - FX_grDepthMask(FXFALSE); + grDepthBufferFunction(GR_CMP_ALWAYS); + grDepthMask(FXFALSE); } } @@ -1337,10 +1329,10 @@ fxSetupColorMask(GLcontext * ctx) fxMesaContext fxMesa = FX_CONTEXT(ctx); if (ctx->Color.DrawBuffer == GL_NONE) { - FX_grColorMask(FXFALSE, FXFALSE); + grColorMask(FXFALSE, FXFALSE); } else { - FX_grColorMask(ctx->Color.ColorMask[RCOMP] || + grColorMask(ctx->Color.ColorMask[RCOMP] || ctx->Color.ColorMask[GCOMP] || ctx->Color.ColorMask[BCOMP], ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer); @@ -1369,7 +1361,7 @@ fxSetupFog(GLcontext * ctx) col[1] = (unsigned int) (255 * ctx->Fog.Color[1]); col[2] = (unsigned int) (255 * ctx->Fog.Color[2]); col[3] = (unsigned int) (255 * ctx->Fog.Color[3]); - FX_grFogColorValue(FXCOLOR4(col)); + grFogColorValue(FXCOLOR4(col)); if (fxMesa->fogTableMode != ctx->Fog.Mode || fxMesa->fogDensity != ctx->Fog.Density || @@ -1396,11 +1388,11 @@ fxSetupFog(GLcontext * ctx) fxMesa->fogEnd = ctx->Fog.End; } - FX_grFogTable(fxMesa->fogTable); - FX_grFogMode(GR_FOG_WITH_TABLE); + grFogTable(fxMesa->fogTable); + grFogMode(GR_FOG_WITH_TABLE); } else { - FX_grFogMode(GR_FOG_DISABLE); + grFogMode(GR_FOG_DISABLE); } } @@ -1444,7 +1436,7 @@ fxSetScissorValues(GLcontext * ctx) ymin = fxMesa->screen_height - fxMesa->clipMaxY; if (ymax > fxMesa->screen_height - fxMesa->clipMinY) ymax = fxMesa->screen_height - fxMesa->clipMinY; - FX_grClipWindow_NoLock(xmin, ymin, xmax, ymax); + grClipWindow(xmin, ymin, xmax, ymax); } static void @@ -1509,7 +1501,7 @@ fxSetupCull(GLcontext * ctx) FX_CONTEXT(ctx)->cullMode = GR_CULL_DISABLE; if (FX_CONTEXT(ctx)->raster_primitive == GL_TRIANGLES) - FX_grCullMode(FX_CONTEXT(ctx)->cullMode); + grCullMode(FX_CONTEXT(ctx)->cullMode); } @@ -1548,10 +1540,10 @@ fxDDEnable(GLcontext * ctx, GLenum cap, GLboolean state) break; case GL_DITHER: if (state) { - FX_grDitherMode(GR_DITHER_4x4); + grDitherMode(GR_DITHER_4x4); } else { - FX_grDitherMode(GR_DITHER_DISABLE); + grDitherMode(GR_DITHER_DISABLE); } break; case GL_SCISSOR_TEST: diff --git a/src/mesa/drivers/glide/fxtexman.c b/src/mesa/drivers/glide/fxtexman.c index b03122f8c1b..5189816cdef 100644 --- a/src/mesa/drivers/glide/fxtexman.c +++ b/src/mesa/drivers/glide/fxtexman.c @@ -1,4 +1,4 @@ -/* $Id: fxtexman.c,v 1.15 2001/09/23 16:50:01 brianp Exp $ */ +/* $Id: fxtexman.c,v 1.16 2003/08/19 15:52:53 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -29,6 +29,8 @@ * Brian Paul * Daryll Strauss * Keith Whitwell + * Daniel Borca + * Hiroshi Morii */ /* fxtexman.c - 3Dfx VooDoo texture memory functions */ @@ -137,11 +139,11 @@ fxTMUInit(fxMesaContext fxMesa, int tmu) MemRange *tmn, *last; FxU32 start, end, blockstart, blockend; - start = FX_grTexMinAddress(tmu); - end = FX_grTexMaxAddress(tmu); + start = grTexMinAddress(tmu); + end = grTexMaxAddress(tmu); if (fxMesa->verbose) { - fprintf(stderr, "Voodoo %s configuration:", + fprintf(stderr, "Voodoo %s configuration:\n", (tmu == FX_TMU0) ? "TMU0" : "TMU1"); fprintf(stderr, "Voodoo Lower texture memory address (%u)\n", (unsigned int) start); @@ -308,7 +310,7 @@ static MemRange * fxTMAddObj(fxMesaContext fxMesa, struct gl_texture_object *tObj, GLint tmu, int texmemsize) { - FxU32 startAddr; + FxI32 startAddr; MemRange *range; startAddr = fxTMFindStartAddr(fxMesa, tmu, texmemsize); @@ -363,16 +365,14 @@ fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj, switch (where) { case FX_TMU0: case FX_TMU1: - texmemsize = - (int) FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_BOTH, - &(ti->info)); + texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info)); ti->tm[where] = fxTMAddObj(fxMesa, tObj, where, texmemsize); fxMesa->stats.memTexUpload += texmemsize; for (i = FX_largeLodValue(ti->info), l = ti->minLevel; i <= FX_smallLodValue(ti->info); i++, l++) { struct gl_texture_image *texImage = tObj->Image[l]; - FX_grTexDownloadMipMapLevel_NoLock(where, + grTexDownloadMipMapLevel(where, ti->tm[where]->startAddr, FX_valueToLod(i), FX_largeLodLog2(ti->info), @@ -383,15 +383,11 @@ fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj, } break; case FX_TMU_SPLIT: - texmemsize = - (int) FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_ODD, - &(ti->info)); + texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_ODD, &(ti->info)); ti->tm[FX_TMU0] = fxTMAddObj(fxMesa, tObj, FX_TMU0, texmemsize); fxMesa->stats.memTexUpload += texmemsize; - texmemsize = - (int) FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_EVEN, - &(ti->info)); + texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_EVEN, &(ti->info)); ti->tm[FX_TMU1] = fxTMAddObj(fxMesa, tObj, FX_TMU1, texmemsize); fxMesa->stats.memTexUpload += texmemsize; @@ -399,7 +395,7 @@ fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj, i <= FX_smallLodValue(ti->info); i++, l++) { struct gl_texture_image *texImage = tObj->Image[l]; - FX_grTexDownloadMipMapLevel_NoLock(GR_TMU0, + grTexDownloadMipMapLevel(GR_TMU0, ti->tm[FX_TMU0]->startAddr, FX_valueToLod(i), FX_largeLodLog2(ti->info), @@ -408,7 +404,7 @@ fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj, GR_MIPMAPLEVELMASK_ODD, texImage->Data); - FX_grTexDownloadMipMapLevel_NoLock(GR_TMU1, + grTexDownloadMipMapLevel(GR_TMU1, ti->tm[FX_TMU1]->startAddr, FX_valueToLod(i), FX_largeLodLog2(ti->info), @@ -419,22 +415,18 @@ fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj, } break; case FX_TMU_BOTH: - texmemsize = - (int) FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_BOTH, - &(ti->info)); + texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info)); ti->tm[FX_TMU0] = fxTMAddObj(fxMesa, tObj, FX_TMU0, texmemsize); fxMesa->stats.memTexUpload += texmemsize; - texmemsize = - (int) FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_BOTH, - &(ti->info)); + texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info)); ti->tm[FX_TMU1] = fxTMAddObj(fxMesa, tObj, FX_TMU1, texmemsize); fxMesa->stats.memTexUpload += texmemsize; for (i = FX_largeLodValue(ti->info), l = ti->minLevel; i <= FX_smallLodValue(ti->info); i++, l++) { struct gl_texture_image *texImage = tObj->Image[l]; - FX_grTexDownloadMipMapLevel_NoLock(GR_TMU0, + grTexDownloadMipMapLevel(GR_TMU0, ti->tm[FX_TMU0]->startAddr, FX_valueToLod(i), FX_largeLodLog2(ti->info), @@ -443,7 +435,7 @@ fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj, GR_MIPMAPLEVELMASK_BOTH, texImage->Data); - FX_grTexDownloadMipMapLevel_NoLock(GR_TMU1, + grTexDownloadMipMapLevel(GR_TMU1, ti->tm[FX_TMU1]->startAddr, FX_valueToLod(i), FX_largeLodLog2(ti->info), @@ -505,15 +497,11 @@ fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj, fxTexGetInfo(mml->width, mml->height, &lodlevel, NULL, NULL, NULL, NULL, NULL, NULL, NULL); -#ifdef FX_GLIDE3 lodlevel -= level; -#else - lodlevel += level; -#endif switch (tmu) { case FX_TMU0: case FX_TMU1: - FX_grTexDownloadMipMapLevel(tmu, + grTexDownloadMipMapLevel(tmu, ti->tm[tmu]->startAddr, FX_valueToLod(FX_lodToValue(lodlevel)), FX_largeLodLog2(ti->info), @@ -522,7 +510,7 @@ fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj, GR_MIPMAPLEVELMASK_BOTH, texImage->Data); break; case FX_TMU_SPLIT: - FX_grTexDownloadMipMapLevel(GR_TMU0, + grTexDownloadMipMapLevel(GR_TMU0, ti->tm[GR_TMU0]->startAddr, FX_valueToLod(FX_lodToValue(lodlevel)), FX_largeLodLog2(ti->info), @@ -530,7 +518,7 @@ fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj, ti->info.format, GR_MIPMAPLEVELMASK_ODD, texImage->Data); - FX_grTexDownloadMipMapLevel(GR_TMU1, + grTexDownloadMipMapLevel(GR_TMU1, ti->tm[GR_TMU1]->startAddr, FX_valueToLod(FX_lodToValue(lodlevel)), FX_largeLodLog2(ti->info), @@ -539,7 +527,7 @@ fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj, GR_MIPMAPLEVELMASK_EVEN, texImage->Data); break; case FX_TMU_BOTH: - FX_grTexDownloadMipMapLevel(GR_TMU0, + grTexDownloadMipMapLevel(GR_TMU0, ti->tm[GR_TMU0]->startAddr, FX_valueToLod(FX_lodToValue(lodlevel)), FX_largeLodLog2(ti->info), @@ -547,7 +535,7 @@ fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj, ti->info.format, GR_MIPMAPLEVELMASK_BOTH, texImage->Data); - FX_grTexDownloadMipMapLevel(GR_TMU1, + grTexDownloadMipMapLevel(GR_TMU1, ti->tm[GR_TMU1]->startAddr, FX_valueToLod(FX_lodToValue(lodlevel)), FX_largeLodLog2(ti->info), @@ -602,7 +590,7 @@ fxTMReloadSubMipMapLevel(fxMesaContext fxMesa, switch (tmu) { case FX_TMU0: case FX_TMU1: - FX_grTexDownloadMipMapLevelPartial(tmu, + grTexDownloadMipMapLevelPartial(tmu, ti->tm[tmu]->startAddr, FX_valueToLod(FX_lodToValue(lodlevel) + level), @@ -613,7 +601,7 @@ fxTMReloadSubMipMapLevel(fxMesaContext fxMesa, yoffset, yoffset + height - 1); break; case FX_TMU_SPLIT: - FX_grTexDownloadMipMapLevelPartial(GR_TMU0, + grTexDownloadMipMapLevelPartial(GR_TMU0, ti->tm[FX_TMU0]->startAddr, FX_valueToLod(FX_lodToValue(lodlevel) + level), @@ -623,7 +611,7 @@ fxTMReloadSubMipMapLevel(fxMesaContext fxMesa, GR_MIPMAPLEVELMASK_ODD, data, yoffset, yoffset + height - 1); - FX_grTexDownloadMipMapLevelPartial(GR_TMU1, + grTexDownloadMipMapLevelPartial(GR_TMU1, ti->tm[FX_TMU1]->startAddr, FX_valueToLod(FX_lodToValue(lodlevel) + level), @@ -634,7 +622,7 @@ fxTMReloadSubMipMapLevel(fxMesaContext fxMesa, yoffset, yoffset + height - 1); break; case FX_TMU_BOTH: - FX_grTexDownloadMipMapLevelPartial(GR_TMU0, + grTexDownloadMipMapLevelPartial(GR_TMU0, ti->tm[FX_TMU0]->startAddr, FX_valueToLod(FX_lodToValue(lodlevel) + level), @@ -644,7 +632,7 @@ fxTMReloadSubMipMapLevel(fxMesaContext fxMesa, GR_MIPMAPLEVELMASK_BOTH, data, yoffset, yoffset + height - 1); - FX_grTexDownloadMipMapLevelPartial(GR_TMU1, + grTexDownloadMipMapLevelPartial(GR_TMU1, ti->tm[FX_TMU1]->startAddr, FX_valueToLod(FX_lodToValue(lodlevel) + level), diff --git a/src/mesa/drivers/glide/fxwgl.c b/src/mesa/drivers/glide/fxwgl.c index ab6b1a1fe85..a55b9cdf2c4 100644 --- a/src/mesa/drivers/glide/fxwgl.c +++ b/src/mesa/drivers/glide/fxwgl.c @@ -1,4 +1,4 @@ -/* $Id: fxwgl.c,v 1.16 2002/10/24 23:57:23 brianp Exp $ */ +/* $Id: fxwgl.c,v 1.17 2003/08/19 15:52:53 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -43,9 +43,9 @@ extern "C" #endif #include -#include "glheader.h" -#include "fxdrv.h" -#include "glapi.h" +#define GL_GLEXT_PROTOTYPES +#include "GL/gl.h" +#include "GL/glext.h" #ifdef __cplusplus } @@ -53,6 +53,9 @@ extern "C" #include #include "GL/fxmesa.h" +#include "glheader.h" +#include "fxdrv.h" +#include "glapi.h" #define MAX_MESA_ATTRS 20 @@ -71,6 +74,88 @@ struct __pixelformat__ WINGDIAPI void GLAPIENTRY gl3DfxSetPaletteEXT(GLuint *); struct __pixelformat__ pix[] = { +#if 0 + /* None */ + { + { + sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | + PFD_DOUBLEBUFFER | PFD_SWAP_COPY, + PFD_TYPE_RGBA, + 16, + 5, 11, 6, 5, 5, 0, 0, 0, + 0, 0, 0, 0, 0, + 0, + 0, + 0, + PFD_MAIN_PLANE, + 0, 0, 0, 0} + , + { + FXMESA_COLORDEPTH, 16, + FXMESA_DOUBLEBUFFER, + FXMESA_ALPHA_SIZE, 0, + FXMESA_DEPTH_SIZE, 0, + FXMESA_STENCIL_SIZE, 0, + FXMESA_ACCUM_SIZE, 0, + FXMESA_NONE} + } + , + + /* Alpha */ + { + { + sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | + PFD_DOUBLEBUFFER | PFD_SWAP_COPY, + PFD_TYPE_RGBA, + 16, + 5, 10, 5, 5, 5, 0, 1, 15, + 0, 0, 0, 0, 0, + 0, + 0, + 0, + PFD_MAIN_PLANE, + 0, 0, 0, 0} + , + { + FXMESA_COLORDEPTH, 15, + FXMESA_DOUBLEBUFFER, + FXMESA_ALPHA_SIZE, 1, + FXMESA_DEPTH_SIZE, 0, + FXMESA_STENCIL_SIZE, 0, + FXMESA_ACCUM_SIZE, 0, + FXMESA_NONE} + } + , + + /* Depth */ + { + { + sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | + PFD_DOUBLEBUFFER | PFD_SWAP_COPY, + PFD_TYPE_RGBA, + 16, + 5, 11, 6, 5, 5, 0, 0, 0, + 0, 0, 0, 0, 0, + 16, + 0, + 0, + PFD_MAIN_PLANE, + 0, 0, 0, 0} + , + { + FXMESA_COLORDEPTH, 16, + FXMESA_DOUBLEBUFFER, + FXMESA_ALPHA_SIZE, 0, + FXMESA_DEPTH_SIZE, 16, + FXMESA_STENCIL_SIZE, 0, + FXMESA_ACCUM_SIZE, 0, + FXMESA_NONE} + } + , + /* None */ { { @@ -79,7 +164,7 @@ struct __pixelformat__ pix[] = { PFD_DOUBLEBUFFER | PFD_SWAP_COPY, PFD_TYPE_RGBA, 32, - 8, 0, 8, 8, 8, 16, 0, 24, + 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -88,6 +173,7 @@ struct __pixelformat__ pix[] = { 0, 0, 0, 0} , { + FXMESA_COLORDEPTH, 32, FXMESA_DOUBLEBUFFER, FXMESA_ALPHA_SIZE, 0, FXMESA_DEPTH_SIZE, 0, @@ -105,7 +191,7 @@ struct __pixelformat__ pix[] = { PFD_DOUBLEBUFFER | PFD_SWAP_COPY, PFD_TYPE_RGBA, 32, - 8, 0, 8, 8, 8, 16, 8, 24, + 8, 16, 8, 8, 8, 0, 8, 24, 0, 0, 0, 0, 0, 0, 0, @@ -114,6 +200,7 @@ struct __pixelformat__ pix[] = { 0, 0, 0, 0} , { + FXMESA_COLORDEPTH, 32, FXMESA_DOUBLEBUFFER, FXMESA_ALPHA_SIZE, 8, FXMESA_DEPTH_SIZE, 0, @@ -131,7 +218,7 @@ struct __pixelformat__ pix[] = { PFD_DOUBLEBUFFER | PFD_SWAP_COPY, PFD_TYPE_RGBA, 32, - 8, 0, 8, 8, 8, 16, 0, 24, + 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, @@ -140,6 +227,7 @@ struct __pixelformat__ pix[] = { 0, 0, 0, 0} , { + FXMESA_COLORDEPTH, 32, FXMESA_DOUBLEBUFFER, FXMESA_ALPHA_SIZE, 0, FXMESA_DEPTH_SIZE, 16, @@ -147,6 +235,78 @@ struct __pixelformat__ pix[] = { FXMESA_ACCUM_SIZE, 0, FXMESA_NONE} } +#endif + /* 16bit RGB565 */ + { + {sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | + PFD_DOUBLEBUFFER | PFD_SWAP_COPY, + PFD_TYPE_RGBA, + 16, + 5, 11, 6, 5, 5, 0, 0, 0, + 0, 0, 0, 0, 0, + 16, + 0, + 0, + PFD_MAIN_PLANE, + 0, 0, 0, 0} + , + {FXMESA_COLORDEPTH, 16, + FXMESA_DOUBLEBUFFER, + FXMESA_ALPHA_SIZE, 0, + FXMESA_DEPTH_SIZE, 16, + FXMESA_STENCIL_SIZE, 0, + FXMESA_ACCUM_SIZE, 0, + FXMESA_NONE} + } + , + /* 16bit ARGB1555 */ + { + {sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | + PFD_DOUBLEBUFFER | PFD_SWAP_COPY, + PFD_TYPE_RGBA, + 16, + 5, 10, 5, 5, 5, 0, 1, 15, + 0, 0, 0, 0, 0, + 16, + 0, + 0, + PFD_MAIN_PLANE, + 0, 0, 0, 0} + , + {FXMESA_COLORDEPTH, 15, + FXMESA_DOUBLEBUFFER, + FXMESA_ALPHA_SIZE, 1, + FXMESA_DEPTH_SIZE, 16, + FXMESA_STENCIL_SIZE, 0, + FXMESA_ACCUM_SIZE, 0, + FXMESA_NONE} + } + , + /* 32bit ARGB8888 */ + { + {sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | + PFD_DOUBLEBUFFER | PFD_SWAP_COPY, + PFD_TYPE_RGBA, + 32, + 8, 16, 8, 8, 8, 0, 8, 24, + 0, 0, 0, 0, 0, + 24, + 0, + 0, + PFD_MAIN_PLANE, + 0, 0, 0, 0} + , + {FXMESA_COLORDEPTH, 32, + FXMESA_DOUBLEBUFFER, + FXMESA_ALPHA_SIZE, 8, + FXMESA_DEPTH_SIZE, 24, + FXMESA_STENCIL_SIZE, 0, + FXMESA_ACCUM_SIZE, 0, + FXMESA_NONE} + } }; static int qt_pix = sizeof(pix) / sizeof(pix[0]); @@ -160,8 +320,12 @@ static GLboolean haveDualHead; /* For the in-window-rendering hack */ +#ifndef GR_CONTROL_RESIZE +/* Apparently GR_CONTROL_RESIZE can be ignored. OK? */ +#define GR_CONTROL_RESIZE -1 +#endif + static GLboolean gdiWindowHack; -static GLboolean gdiWindowHackEna; static void *dibSurfacePtr; static BITMAPINFO *dibBMI; static HBITMAP dibHBM; @@ -173,64 +337,39 @@ __wglMonitor(HWND hwnd, UINT message, UINT wParam, LONG lParam) long ret; /* Now gives the resized window at the end to hWNDOldProc */ if (ctx && hwnd == hWND) { - switch (message) { - case WM_PAINT: - case WM_MOVE: - break; - case WM_DISPLAYCHANGE: - case WM_SIZE: - if (wParam != SIZE_MINIMIZED) { - static int moving = 0; - if (!moving) { - if (fxQueryHardware() != GR_SSTTYPE_VOODOO) { - if (!FX_grSstControl(GR_CONTROL_RESIZE)) { - moving = 1; - SetWindowPos(hwnd, 0, 0, 0, 300, 300, - SWP_NOMOVE | SWP_NOZORDER); - moving = 0; - if (!FX_grSstControl(GR_CONTROL_RESIZE)) { - /*MessageBox(0,_T("Error changing windowsize"),_T("fxMESA"),MB_OK); */ - PostMessage(hWND, WM_CLOSE, 0, 0); + switch (message) { + case WM_PAINT: + case WM_MOVE: + break; + case WM_DISPLAYCHANGE: + case WM_SIZE: + if (wParam != SIZE_MINIMIZED) { + static int moving = 0; + if (!moving) { + if (!FX_grSstControl(GR_CONTROL_RESIZE)) { + moving = 1; + SetWindowPos(hwnd, 0, 0, 0, 300, 300, SWP_NOMOVE | SWP_NOZORDER); + moving = 0; + if (!FX_grSstControl(GR_CONTROL_RESIZE)) { + /*MessageBox(0,_T("Error changing windowsize"),_T("fxMESA"),MB_OK); */ + PostMessage(hWND, WM_CLOSE, 0, 0); } - } - } - + } /* Do the clipping in the glide library */ - FX_grClipWindow(0, 0, FX_grSstScreenWidth(), - FX_grSstScreenHeight()); - /* And let the new size set in the context */ - fxMesaUpdateScreenSize(ctx); - } - } - break; - case WM_ACTIVATE: - if ((fxQueryHardware() == GR_SSTTYPE_VOODOO) && - (!gdiWindowHack) && (!haveDualHead)) { - WORD fActive = LOWORD(wParam); - BOOL fMinimized = (BOOL) HIWORD(wParam); - - if ((fActive == WA_INACTIVE) || fMinimized) - FX_grSstControl(GR_CONTROL_DEACTIVATE); - else - FX_grSstControl(GR_CONTROL_ACTIVATE); - } - break; - case WM_SHOWWINDOW: - break; - case WM_SYSKEYDOWN: - case WM_SYSCHAR: - if (gdiWindowHackEna && (VK_RETURN == wParam)) { - if (gdiWindowHack) { - gdiWindowHack = GL_FALSE; - FX_grSstControl(GR_CONTROL_ACTIVATE); - } - else { - gdiWindowHack = GL_TRUE; - FX_grSstControl(GR_CONTROL_DEACTIVATE); - } - } - break; - } + grClipWindow(0, 0, FX_grSstScreenWidth(), FX_grSstScreenHeight()); + /* And let the new size set in the context */ + fxMesaUpdateScreenSize(ctx); + } + } + break; + case WM_ACTIVATE: + break; + case WM_SHOWWINDOW: + break; + case WM_SYSKEYDOWN: + case WM_SYSCHAR: + break; + } } /* Finaly call the hWNDOldProc, which handles the resize witch the @@ -277,85 +416,13 @@ wglCreateContext(HDC hdc) freopen("MESA.LOG", "w", stderr); #endif - ShowWindow(hWnd, SW_SHOWNORMAL); - SetForegroundWindow(hWnd); - Sleep(100); /* an hack for win95 */ - - if (fxQueryHardware() == GR_SSTTYPE_VOODOO) { - RECT cliRect; - - GetClientRect(hWnd, &cliRect); - error = !(ctx = - fxMesaCreateBestContext((GLuint) hWnd, cliRect.right, - cliRect.bottom, - pix[curPFD - 1].mesaAttr)); - - if (!error) { - /* create the DIB section for windowed rendering */ - DWORD *p; - - dibWnd = hWnd; - - hDC = GetDC(dibWnd); - - dibBMI = - (BITMAPINFO *) MALLOC(sizeof(BITMAPINFO) + - (256 * sizeof(RGBQUAD))); - - memset(dibBMI, 0, sizeof(BITMAPINFO) + (256 * sizeof(RGBQUAD))); - - dibBMI->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - dibBMI->bmiHeader.biWidth = ctx->width; - dibBMI->bmiHeader.biHeight = -ctx->height; - dibBMI->bmiHeader.biPlanes = (short) 1; - dibBMI->bmiHeader.biBitCount = (short) 16; - dibBMI->bmiHeader.biCompression = BI_BITFIELDS; - dibBMI->bmiHeader.biSizeImage = 0; - dibBMI->bmiHeader.biXPelsPerMeter = 0; - dibBMI->bmiHeader.biYPelsPerMeter = 0; - dibBMI->bmiHeader.biClrUsed = 3; - dibBMI->bmiHeader.biClrImportant = 3; - - p = (DWORD *) dibBMI->bmiColors; - p[0] = 0xF800; - p[1] = 0x07E0; - p[2] = 0x001F; - - dibHBM = - CreateDIBSection(hDC, dibBMI, DIB_RGB_COLORS, &dibSurfacePtr, - NULL, 0); - - ReleaseDC(dibWnd, hDC); - - gdiWindowHackEna = (dibHBM != NULL ? GL_TRUE : GL_FALSE); - - if (!getenv("MESA_WGL_FX") - || !strcmp(getenv("MESA_WGL_FX"), "fullscreen")) - gdiWindowHack = GL_FALSE; - else { - gdiWindowHack = GL_TRUE; - FX_grSstControl(GR_CONTROL_DEACTIVATE); - } - } - } - else { - /* For the Voodoo Rush */ - - if (getenv("MESA_WGL_FX") - && !strcmp(getenv("MESA_WGL_FX"), "fullscreen")) { - RECT cliRect; - - GetClientRect(hWnd, &cliRect); - error = !(ctx = - fxMesaCreateBestContext((GLuint) hWnd, cliRect.right, - cliRect.bottom, - pix[curPFD - 1].mesaAttr)); - } - else - error = !(ctx = - fxMesaCreateContext((GLuint) hWnd, GR_RESOLUTION_NONE, - GR_REFRESH_75Hz, - pix[curPFD - 1].mesaAttr)); + { + RECT cliRect; + ShowWindow(hWnd, SW_SHOWNORMAL); + SetForegroundWindow(hWnd); + Sleep(100); /* a hack for win95 */ + GetClientRect(hWnd, &cliRect); + error = !(ctx = fxMesaCreateBestContext((GLuint) hWnd, cliRect.right, cliRect.bottom, pix[curPFD - 1].mesaAttr)); } if (getenv("SST_DUALHEAD")) @@ -389,15 +456,6 @@ BOOL GLAPIENTRY wglDeleteContext(HGLRC hglrc) { if (ctx && hglrc == (HGLRC) 1) { - if (gdiWindowHackEna) { - DeleteObject(dibHBM); - FREE(dibBMI); - - dibSurfacePtr = NULL; - dibBMI = NULL; - dibHBM = NULL; - dibWnd = NULL; - } fxMesaDestroyContext(ctx); @@ -505,7 +563,7 @@ wglUseFontBitmaps(HDC fontDevice, DWORD firstChar, DWORD numChars, // Place chars based on base line VERIFY(SetTextAlign(bitDevice, TA_BASELINE) >= 0 ? 1 : 0); - for (i = 0; i < numChars; i++) { + for (i = 0; i < (int)numChars; i++) { SIZE size; char curChar; int charWidth, charHeight, bmapWidth, bmapHeight, numBytes, res; @@ -513,7 +571,7 @@ wglUseFontBitmaps(HDC fontDevice, DWORD firstChar, DWORD numChars, HGDIOBJ origBmap; unsigned char *bmap; - curChar = i + firstChar; + curChar = (char)(i + firstChar); // [koolsmoky] explicit cast // Find how high/wide this character is VERIFY(GetTextExtentPoint32(bitDevice, &curChar, 1, &size)); @@ -624,6 +682,9 @@ wglChoosePixelFormat(HDC hdc, CONST PIXELFORMATDESCRIPTOR * ppfd) } for (i = 0; i < qt_valid_pix; i++) { + if (ppfd->cColorBits > 0 && pix[i].pfd.cColorBits != ppfd->cColorBits) + continue; + if ((ppfd->dwFlags & PFD_DRAW_TO_WINDOW) && !(pix[i].pfd.dwFlags & PFD_DRAW_TO_WINDOW)) continue; if ((ppfd->dwFlags & PFD_DRAW_TO_BITMAP) @@ -737,53 +798,6 @@ wglSwapBuffers(HDC hdc) fxMesaSwapBuffers(); - if (gdiWindowHack) { - GLuint width = ctx->width; - GLuint height = ctx->height; - - HDC hdcScreen = GetDC(dibWnd); - HDC hdcDIBSection = CreateCompatibleDC(hdcScreen); - HBITMAP holdBitmap = (HBITMAP) SelectObject(hdcDIBSection, dibHBM); - - FX_grLfbReadRegion(GR_BUFFER_FRONTBUFFER, 0, 0, - width, height, width * 2, dibSurfacePtr); - - /* Since the hardware is configured for GR_COLORFORMAT_ABGR the pixel data is - * going to come out as BGR 565, which is reverse of what we need for blitting - * to screen, so we need to convert it here pixel-by-pixel (ick). This loop would NOT - * be required if the color format was changed to GR_COLORFORMAT_ARGB, but I do - * not know the ramifications of that, so this will work until that is resolved. - * - * This routine CRIES out for MMX implementation, however since that's not - * guaranteed to be running on MMX enabled hardware so I'm not going to do - * that. I'm just going to try to make a reasonably efficient C - * version. -TAJ - * - * This routine drops frame rate by <1 fps on a 200Mhz MMX processor with a 640x480 - * display. Obviously, it's performance hit will be higher on larger displays and - * less on smaller displays. To support the window-hack display this is probably fine. - */ -#if FXMESA_USE_ARGB - { - unsigned long *pixel = dibSurfacePtr; - unsigned long count = (width * height) / 2; - - while (count--) { - *pixel++ = (*pixel & 0x07e007e0) /* greens */ - |((*pixel & 0xf800f800) >> 11) /* swap blues */ - |((*pixel & 0x001f001f) << 11) /* swap reds */ - ; - } - } -#endif - - BitBlt(hdcScreen, 0, 0, width, height, hdcDIBSection, 0, 0, SRCCOPY); - - ReleaseDC(dibWnd, hdcScreen); - SelectObject(hdcDIBSection, holdBitmap); - DeleteDC(hdcDIBSection); - } - return (TRUE); } -- cgit v1.2.3 From 724c2c7f6f5638f0e761f7bb181480695c275831 Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Sat, 23 Aug 2003 01:25:30 +0000 Subject: Add file miniglx.h --- include/GL/miniglx.h | 400 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 400 insertions(+) create mode 100644 include/GL/miniglx.h (limited to 'include') diff --git a/include/GL/miniglx.h b/include/GL/miniglx.h new file mode 100644 index 00000000000..7720d3536d0 --- /dev/null +++ b/include/GL/miniglx.h @@ -0,0 +1,400 @@ +/* $Id: miniglx.h,v 1.1 2003/08/23 01:25:30 jonsmirl Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 5.0 + * + * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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. + */ + + +/** + * \file miniglx.h + * \brief Mini GLX interface functions. + * \author Brian Paul + * + * See comments miniglx.c for more information. + */ + +#ifndef MINIGLX_H +#define MINIGLX_H + +#include +#include + +/** + * \name Replacement Xlib/GLX types + */ +/*@{*/ +/** + * \brief Boolean type. + * + * It can have the values #True or #False. + */ +typedef int Bool; + +/** + * \brief Color map. + * + * Alias for private ::MiniGLXColormapRec structure. + */ +typedef struct MiniGLXColormapRec *Colormap; + +/** + * \brief Window attributes. + */ +typedef struct MiniGLXSetWindowAttributesRec { + int background_pixel; /**< \brief background pixel */ + int border_pixel; /**< \brief border pixel value */ + Colormap colormap; /**< \brief color map to be associated with window */ + int event_mask; /**< \brief set of events that should be saved */ +} XSetWindowAttributes; + +/** + * \brief Visual. + * + * Alias for the private ::MiniGLXVisualRec structure. + * + * \sa \ref datatypes. + */ +typedef struct MiniGLXVisualRec Visual; + +/** + * \brief Visual information. + * + * \sa \ref datatypes. + */ +typedef unsigned int VisualID; +typedef struct MiniGLXXVisualInfoRec { + Visual *visual; /**< \brief pointer to the GLX Visual */ + VisualID visualid; /**< \brief visual ID */ + int screen; /**< \brief screen number */ + int depth; /**< \brief bit depth */ + int class; /**< \brief class */ + int bits_per_rgb; /**< \brief total bits per pixel */ +} XVisualInfo; + +/** + * \brief Display handle. + * + * Alias for the private ::MiniGLXDisplayRec structure. + * + * \sa \ref datatypes. + */ +typedef struct MiniGLXDisplayRec Display; + +/** + * \brief Window handle. + * + * Alias for the private ::MiniGLXWindowRec structure. + * + * \sa \ref datatypes. + */ +typedef struct MiniGLXWindowRec *Window; + +/** + * \brief Drawable. + * + * Alias for the private ::MiniGLXWindowRec structure. + * + * For Mini GLX only the full-screen window can be used as source and + * destination in graphics operations. + * + * \sa \ref datatypes. + */ +typedef struct MiniGLXWindowRec *Drawable; + +/** + * \brief GLX drawable. + * + * Alias for the private ::MiniGLXWindowRec structure. + * + * Same as #Drawable. + * + * \sa \ref datatypes. + */ +typedef struct MiniGLXWindowRec *GLXDrawable; + +/** + * \brief GLX context. + * + * Alias for the private ::MiniGLXContext structure. + * + * \sa \ref datatypes. + */ +typedef struct MiniGLXContextRec *GLXContext; +/*@}*/ + + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; + int x, y; + int width, height; + int count; /* if non-zero, at least this many more */ +} XExposeEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window parent; /* parent of the window */ + Window window; /* window id of window created */ + int x, y; /* window location */ + int width, height; /* size of window */ + int border_width; /* border width */ + Bool override_redirect; /* creation should be overridden */ +} XCreateWindowEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window event; + Window window; +} XDestroyWindowEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window event; + Window window; + Bool from_configure; +} XUnmapEvent; + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window event; + Window window; + Bool override_redirect; /* boolean, is override set... */ +} XMapEvent; + + +typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window parent; + Window window; +} XMapRequestEvent; + +typedef union _XEvent { + int type; /* must not be changed; first element */ + XExposeEvent xexpose; + XCreateWindowEvent xcreatewindow; + XDestroyWindowEvent xdestroywindow; + XUnmapEvent xunmap; + XMapEvent xmap; + XMapRequestEvent xmaprequest; + long pad[24]; +} XEvent; + + +/** + * \name Xlib constants + */ +/*@{*/ +#define False 0 +#define True 1 +#define None 0 +#define AllocNone 0 +#define InputOutput 1 +#define ExposureMask (1L<<15) +#define StructureNotifyMask (1L<<17) +#define CWBackPixel (1L<<1) +#define CWBorderPixel (1L<<3) +#define CWEventMask (1L<<11) +#define CWColormap (1L<<13) +#define PseudoColor 3 +#define TrueColor 4 +#define VisualScreenMask 0x2 +#define Expose 12 +#define CreateNotify 16 +#define DestroyNotify 17 +#define UnmapNotify 18 +#define MapNotify 19 +#define MapRequest 20 + +/*@}*/ + +/** + * \name Standard GLX tokens + */ +/*@{*/ +#define GLX_USE_GL 1 +#define GLX_BUFFER_SIZE 2 +#define GLX_LEVEL 3 +#define GLX_RGBA 4 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 +#define GLX_BAD_ATTRIBUTE 1 +#define GLX_BAD_VISUAL 4 +/*@}*/ + + +/** + * \name Unique to Mini GLX + * + * At compile time, the Mini GLX interface version can be tested with the + * MINI_GLX_VERSION_1_x preprocessor tokens. + * + * \sa glXQueryVersion() + */ +/*@{*/ +/** \brief Defined if version 1.0 of Mini GLX is supported. */ +#define MINI_GLX_VERSION_1_0 1 +/*@}*/ + + +/** + * \name Server-specific functions + */ +extern Display * +__miniglx_StartServer( const char *display_name ); + +extern int +__miniglx_Select( Display *dpy, int maxfd, + fd_set *rfds, fd_set *wfds, fd_set *xfds, + struct timeval *tv ); + + +/** + * \name Simulated Xlib functions + */ +/*@{*/ +extern Display * +XOpenDisplay( const char *dpy_name ); + + +extern void +XCloseDisplay( Display *display ); + +extern Window +XCreateWindow( Display *display, Window parent, int x, int y, + unsigned int width, unsigned int height, + unsigned int border_width, int depth, unsigned int class, + Visual *visual, unsigned long valuemask, + XSetWindowAttributes *attributes ); + +extern int +XNextEvent(Display *display, XEvent *event_return); + +extern Bool +XCheckMaskEvent( Display *dpy, long event_mask, XEvent *event_return ); + +/** + * \brief Return the root window. + * + * \param display the display handle. It is ignored by Mini GLX, but should be + * the value returned by XOpenDisplay(). + * \param screen the screen number on the host server. It is ignored by Mini + * GLX but should be zero. + * + * \return the root window. Always zero on Mini GLX. + */ +#define RootWindow(display, screen) 0 +#define DefaultScreen(dpy) 0 + +extern void +XDestroyWindow( Display *display, Window w ); + +extern void +XMapWindow( Display *display, Window w ); + +/* Should clients have access to this? + */ +extern void +XUnmapWindow( Display *display, Window w ); + +extern Colormap +XCreateColormap( Display *display, Window w, Visual *visual, int alloc ); + +extern void +XFreeColormap( Display *display, Colormap cmap ); + +extern void +XFree( void *data ); + +extern XVisualInfo * +XGetVisualInfo( Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return ); +/*@}*/ + + + +/** + * \name GLX functions + */ +/*@{*/ +extern XVisualInfo* +glXChooseVisual( Display *dpy, int screen, int *attribList ); + +extern int +glXGetConfig( Display *dpy, XVisualInfo *vis, int attrib, int *value ); + +extern GLXContext +glXCreateContext( Display *dpy, XVisualInfo *vis, + GLXContext shareList, Bool direct ); + +extern void +glXDestroyContext( Display *dpy, GLXContext ctx ); + +extern Bool +glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx); + +extern void +glXSwapBuffers( Display *dpy, GLXDrawable drawable ); + +extern GLXContext +glXGetCurrentContext( void ); + +extern GLXDrawable +glXGetCurrentDrawable( void ); + +extern const void * +glXGetProcAddress( const GLubyte *procname ); + +extern Bool +glXQueryVersion( Display *dpy, int *major, int *minor ); +/*@}*/ + + +#endif /* MINIGLX_H */ -- cgit v1.2.3 From dc22a652c98187b68114c03f7fd7a0facdef1a4b Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Sun, 24 Aug 2003 04:44:23 +0000 Subject: Fix compile problems with `glMultiModeDrawArraysIBM' Adjust makefiles to create depends and not store it in CVS Remove dependency on kernel pci_ids.h --- Makefile.X11 | 10 ++++- include/GL/glext.h | 6 +-- src/mesa/drivers/dri/mga/Makefile.X11 | 4 +- src/mesa/drivers/dri/r128/server/pci_ids.h | 57 +++++++++++++++++++++++++++++ src/mesa/drivers/dri/r128/server/r128_dri.c | 3 +- src/mesa/glapi/glapitemp.h | 22 +++++------ 6 files changed, 83 insertions(+), 19 deletions(-) create mode 100644 src/mesa/drivers/dri/r128/server/pci_ids.h (limited to 'include') diff --git a/Makefile.X11 b/Makefile.X11 index 48b929bcdb7..36030d4be12 100644 --- a/Makefile.X11 +++ b/Makefile.X11 @@ -1,4 +1,4 @@ -# $Id: Makefile.X11,v 1.80 2003/08/22 20:11:43 brianp Exp $ +# $Id: Makefile.X11,v 1.81 2003/08/24 04:44:23 jonsmirl Exp $ # Mesa 3-D graphics library # Version: 5.1 @@ -234,6 +234,14 @@ linux-solo: if [ -d src/glx/mini ] ; then touch src/glx/mini/depend ; fi if [ -d src/glu/mini ] ; then touch src/glu/mini/depend ; fi if [ -d src/glut/mini ] ; then touch src/glut/mini/depend ; fi + if [ -d src/mesa/drivers/dri/r200 ] ; then touch src/mesa/drivers/dri/r200/depend ; fi + if [ -d src/mesa/drivers/dri/r128 ] ; then touch src/mesa/drivers/dri/r128/depend ; fi + if [ -d src/mesa/drivers/dri/radeon ] ; then touch src/mesa/drivers/dri/radeon/depend ; fi + if [ -d src/mesa/drivers/dri/mga ] ; then touch src/mesa/drivers/dri/mga/depend ; fi + if [ -d src/mesa/drivers/dri/fb ] ; then touch src/mesa/drivers/dri/fb/depend ; fi + if [ -d src/glut/mini ] ; then touch src/glut/mini/depend ; fi + if [ -d progs/miniglx ] ; then touch progs/miniglx/depend ; fi + if [ -d progs/tests ] ; then touch progs/tests/depend ; fi if [ -d src/mesa ] ; then cd src/mesa ; $(MAKE) -f Makefile.X11 $@ ; fi if [ -d src/mesa/drivers/dri/r200 ] ; then cd src/mesa/drivers/dri/r200 ; $(MAKE) -f Makefile.X11 $@ ; fi if [ -d src/mesa/drivers/dri/r128 ] ; then cd src/mesa/drivers/dri/r128 ; $(MAKE) -f Makefile.X11 $@ ; fi diff --git a/include/GL/glext.h b/include/GL/glext.h index f8b6cbc611a..4dd69441f18 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -4553,9 +4553,9 @@ typedef void (APIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); #ifndef GL_IBM_multimode_draw_arrays #define GL_IBM_multimode_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiModeDrawArraysIBM (GLenum, const GLint *, const GLsizei *, GLsizei, GLint); -GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* *, GLsizei, GLint); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid * const *, GLsizei, GLint); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); typedef void (APIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, GLint modestride); diff --git a/src/mesa/drivers/dri/mga/Makefile.X11 b/src/mesa/drivers/dri/mga/Makefile.X11 index 0dce6e7b1a7..4f20c7a8331 100644 --- a/src/mesa/drivers/dri/mga/Makefile.X11 +++ b/src/mesa/drivers/dri/mga/Makefile.X11 @@ -1,4 +1,4 @@ -# $Id: Makefile.X11,v 1.2 2003/08/22 20:11:44 brianp Exp $ +# $Id: Makefile.X11,v 1.3 2003/08/24 04:44:23 jonsmirl Exp $ # Mesa 3-D graphics library # Version: 5.0 @@ -102,7 +102,7 @@ mga_dri.so: $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.X11 # Run 'make -f Makefile.X11 dep' to update the dependencies if you change # what's included by any source file. depend: $(C_SOURCES) $(ASM_SOURCES) - makedepend -fdepend -Y $(SHARED_INCLUDES) \ + makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) \ $(C_SOURCES) $(ASM_SOURCES) diff --git a/src/mesa/drivers/dri/r128/server/pci_ids.h b/src/mesa/drivers/dri/r128/server/pci_ids.h new file mode 100644 index 00000000000..fe8b0878748 --- /dev/null +++ b/src/mesa/drivers/dri/r128/server/pci_ids.h @@ -0,0 +1,57 @@ +/* Rage128 M3 */ +#define PCI_DEVICE_ID_ATI_RAGE128_LE 0x4c45 +#define PCI_DEVICE_ID_ATI_RAGE128_LF 0x4c46 +/* Rage128 M4 */ +#define PCI_DEVICE_ID_ATI_RAGE128_MF 0x4d46 +#define PCI_DEVICE_ID_ATI_RAGE128_ML 0x4d4c +/* Rage128 Pro GL */ +#define PCI_DEVICE_ID_ATI_RAGE128_PA 0x5041 +#define PCI_DEVICE_ID_ATI_RAGE128_PB 0x5042 +#define PCI_DEVICE_ID_ATI_RAGE128_PC 0x5043 +#define PCI_DEVICE_ID_ATI_RAGE128_PD 0x5044 +#define PCI_DEVICE_ID_ATI_RAGE128_PE 0x5045 +#define PCI_DEVICE_ID_ATI_RAGE128_PF 0x5046 +/* Rage128 Pro VR */ +#define PCI_DEVICE_ID_ATI_RAGE128_PG 0x5047 +#define PCI_DEVICE_ID_ATI_RAGE128_PH 0x5048 +#define PCI_DEVICE_ID_ATI_RAGE128_PI 0x5049 +#define PCI_DEVICE_ID_ATI_RAGE128_PJ 0x504A +#define PCI_DEVICE_ID_ATI_RAGE128_PK 0x504B +#define PCI_DEVICE_ID_ATI_RAGE128_PL 0x504C +#define PCI_DEVICE_ID_ATI_RAGE128_PM 0x504D +#define PCI_DEVICE_ID_ATI_RAGE128_PN 0x504E +#define PCI_DEVICE_ID_ATI_RAGE128_PO 0x504F +#define PCI_DEVICE_ID_ATI_RAGE128_PP 0x5050 +#define PCI_DEVICE_ID_ATI_RAGE128_PQ 0x5051 +#define PCI_DEVICE_ID_ATI_RAGE128_PR 0x5052 +#define PCI_DEVICE_ID_ATI_RAGE128_TR 0x5452 +#define PCI_DEVICE_ID_ATI_RAGE128_PS 0x5053 +#define PCI_DEVICE_ID_ATI_RAGE128_PT 0x5054 +#define PCI_DEVICE_ID_ATI_RAGE128_PU 0x5055 +#define PCI_DEVICE_ID_ATI_RAGE128_PV 0x5056 +#define PCI_DEVICE_ID_ATI_RAGE128_PW 0x5057 +#define PCI_DEVICE_ID_ATI_RAGE128_PX 0x5058 +/* Rage128 GL */ +#define PCI_DEVICE_ID_ATI_RAGE128_RE 0x5245 +#define PCI_DEVICE_ID_ATI_RAGE128_RF 0x5246 +/* Rage128 VR */ +#define PCI_DEVICE_ID_ATI_RAGE128_RE 0x5245 +#define PCI_DEVICE_ID_ATI_RAGE128_RF 0x5246 +#define PCI_DEVICE_ID_ATI_RAGE128_RG 0x5247 +#define PCI_DEVICE_ID_ATI_RAGE128_RK 0x524b +#define PCI_DEVICE_ID_ATI_RAGE128_RL 0x524c +#define PCI_DEVICE_ID_ATI_RAGE128_SE 0x5345 +#define PCI_DEVICE_ID_ATI_RAGE128_SF 0x5346 +#define PCI_DEVICE_ID_ATI_RAGE128_SG 0x5347 +#define PCI_DEVICE_ID_ATI_RAGE128_SH 0x5348 +#define PCI_DEVICE_ID_ATI_RAGE128_SK 0x534b +#define PCI_DEVICE_ID_ATI_RAGE128_SL 0x534c +#define PCI_DEVICE_ID_ATI_RAGE128_SM 0x534d +#define PCI_DEVICE_ID_ATI_RAGE128_SN 0x534e +/* Rage128 Pro Ultra */ +#define PCI_DEVICE_ID_ATI_RAGE128_TF 0x5446 +#define PCI_DEVICE_ID_ATI_RAGE128_TL 0x544C +#define PCI_DEVICE_ID_ATI_RAGE128_TR 0x5452 +#define PCI_DEVICE_ID_ATI_RAGE128_TS 0x5453 +#define PCI_DEVICE_ID_ATI_RAGE128_TT 0x5454 +#define PCI_DEVICE_ID_ATI_RAGE128_TU 0x5455 diff --git a/src/mesa/drivers/dri/r128/server/r128_dri.c b/src/mesa/drivers/dri/r128/server/r128_dri.c index aa8f49f9c7e..633c5ad5b3d 100644 --- a/src/mesa/drivers/dri/r128/server/r128_dri.c +++ b/src/mesa/drivers/dri/r128/server/r128_dri.c @@ -43,7 +43,8 @@ #include #include #include -#include +// Fix this to use kernel pci_ids.h when all of these IDs make it into the kernel +#include "pci_ids.h" #include "driver.h" #include "drm.h" diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index 3c9e89a72b4..32c003168d1 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -3511,8 +3511,16 @@ KEYWORD1 void KEYWORD2 NAME(WindowPos4svMESA)(const GLshort * v) DISPATCH(WindowPos4svMESA, (v), (F, "glWindowPos4svMESA(%p);\n", (const void *) v)); } -/* No dispatch for MultiModeDrawArraysIBM() */ -/* No dispatch for MultiModeDrawElementsIBM() */ +KEYWORD1 void KEYWORD2 NAME(MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride) +{ + DISPATCH(MultiModeDrawArraysIBM, (mode, first, count, primcount, modestride), (F, "glMultiModeDrawArraysIBM(%p, %p, %p, %d, %d);\n", (const void *) mode, (const void *) first, (const void *) count, primcount, modestride)); +} + +KEYWORD1 void KEYWORD2 NAME(MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride) +{ + DISPATCH(MultiModeDrawElementsIBM, (mode, count, type, indices, primcount, modestride), (F, "glMultiModeDrawElementsIBM(%p, %p, 0x%x, %p, %d, %d);\n", (const void *) mode, (const void *) count, type, (const void *) indices, primcount, modestride)); +} + /* No dispatch for ColorPointerListIBM() */ /* No dispatch for SecondaryColorPointerListIBM() */ /* No dispatch for EdgeFlagPointerListIBM() */ @@ -4664,16 +4672,6 @@ KEYWORD1 void KEYWORD2 NAME(GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuin DISPATCH(GetQueryObjectuivARB, (id, pname, params), (F, "glGetQueryObjectuivARB(%d, 0x%x, %p);\n", id, pname, (const void *) params)); } -KEYWORD1 void KEYWORD2 NAME(MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride) -{ - DISPATCH(MultiModeDrawArraysIBM, (mode, first, count, primcount, modestride), (F, "glMultiModeDrawArraysIBM(%p, %p, %p, %d, %d);\n", (const void *) mode, (const void *) first, (const void *) count, primcount, modestride)); -} - -KEYWORD1 void KEYWORD2 NAME(MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride) -{ - DISPATCH(MultiModeDrawElementsIBM, (mode, count, type, indices, primcount, modestride), (F, "glMultiModeDrawElementsIBM(%p, %p, 0x%x, %p, %d, %d);\n", (const void *) mode, (const void *) count, type, (const void *) indices, primcount, modestride)); -} - /* -- cgit v1.2.3 From 371f7cdb7a44cae904584cebcc59a495f17a9d8e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 24 Aug 2003 14:49:53 +0000 Subject: fix PFNGLMULTIMODEDRAWARRAYSIBMPROC --- include/GL/glext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 4dd69441f18..cb32fba2a7e 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -4557,7 +4557,7 @@ typedef void (APIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint); GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid * const *, GLsizei, GLint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum * mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); typedef void (APIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, GLint modestride); #endif -- cgit v1.2.3 From 58c5df87becefd6b343d2802454ea75b908cdde9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 28 Aug 2003 03:08:40 +0000 Subject: remove a bunch of the extension definitions from the legacy section --- include/GL/gl.h | 432 +------------------------------------------------------- 1 file changed, 1 insertion(+), 431 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 52765c37b45..0f59c8726df 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2118,437 +2118,7 @@ typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLs */ #if defined(GL_GLEXT_LEGACY) - -/* - * 1. GL_EXT_abgr - */ -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 - -#define GL_ABGR_EXT 0x8000 - -#endif /* GL_EXT_abgr */ - - - -/* - * 2. GL_EXT_blend_color - */ -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 - -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_COLOR_EXT 0x8005 - -GLAPI void GLAPIENTRY glBlendColorEXT( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); - -#endif /* GL_EXT_blend_color */ - - - -/* - * 3. GL_EXT_polygon_offset - */ -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 - -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 - -GLAPI void GLAPIENTRY glPolygonOffsetEXT( GLfloat factor, GLfloat bias ); - -#endif /* GL_EXT_polygon_offset */ - - - -/* - * 6. GL_EXT_texture3D - */ -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 - -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A - -GLAPI void GLAPIENTRY glTexImage3DEXT( GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ); - -GLAPI void GLAPIENTRY glTexSubImage3DEXT( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); - -GLAPI void GLAPIENTRY glCopyTexSubImage3DEXT( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ); - -#endif /* GL_EXT_texture3D */ - - - -/* - * 20. GL_EXT_texture_object - */ -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 - -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 - -GLAPI void GLAPIENTRY glGenTexturesEXT( GLsizei n, GLuint *textures ); - -GLAPI void GLAPIENTRY glDeleteTexturesEXT( GLsizei n, const GLuint *textures); - -GLAPI void GLAPIENTRY glBindTextureEXT( GLenum target, GLuint texture ); - -GLAPI void GLAPIENTRY glPrioritizeTexturesEXT( GLsizei n, const GLuint *textures, const GLclampf *priorities ); - -GLAPI GLboolean GLAPIENTRY glAreTexturesResidentEXT( GLsizei n, const GLuint *textures, GLboolean *residences ); - -GLAPI GLboolean GLAPIENTRY glIsTextureEXT( GLuint texture ); - -#endif /* GL_EXT_texture_object */ - - - -/* - * 27. GL_EXT_rescale_normal - */ -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 - -#define GL_RESCALE_NORMAL_EXT 0x803A - -#endif /* GL_EXT_rescale_normal */ - - - -/* - * 30. GL_EXT_vertex_array - */ -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 - -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 - -GLAPI void GLAPIENTRY glVertexPointerEXT( GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glNormalPointerEXT( GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glColorPointerEXT( GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glIndexPointerEXT( GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glTexCoordPointerEXT( GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *ptr ); - -GLAPI void GLAPIENTRY glEdgeFlagPointerEXT( GLsizei stride, GLsizei count, const GLboolean *ptr ); - -GLAPI void GLAPIENTRY glGetPointervEXT( GLenum pname, GLvoid **params ); - -GLAPI void GLAPIENTRY glArrayElementEXT( GLint i ); - -GLAPI void GLAPIENTRY glDrawArraysEXT( GLenum mode, GLint first, GLsizei count ); - -#endif /* GL_EXT_vertex_array */ - - - -/* - * 35. GL_SGIS_texture_edge_clamp - */ -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 - -#define GL_CLAMP_TO_EDGE_SGIS 0x812F - -#endif /* GL_SGIS_texture_edge_clamp */ - - - -/* - * 37. GL_EXT_blend_minmax - */ -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 - -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_BLEND_EQUATION_EXT 0x8009 - -GLAPI void GLAPIENTRY glBlendEquationEXT( GLenum mode ); - -#endif /* GL_EXT_blend_minmax */ - - - -/* - * 38. GL_EXT_blend_subtract (requires GL_EXT_blend_max ) - */ -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 - -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B - -#endif /* GL_EXT_blend_subtract */ - - - -/* - * 39. GL_EXT_blend_logic_op - */ -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 - -/* No new tokens or functions */ - -#endif /* GL_EXT_blend_logic_op */ - - - -/* - * 54. GL_EXT_point_parameters - */ -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 - -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 - -GLAPI void GLAPIENTRY glPointParameterfEXT( GLenum pname, GLfloat param ); -GLAPI void GLAPIENTRY glPointParameterfvEXT( GLenum pname, const GLfloat *params ); -GLAPI void GLAPIENTRY glPointParameterfSGIS(GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glPointParameterfvSGIS(GLenum pname, const GLfloat *params); - -#endif /* GL_EXT_point_parameters */ - - - -/* - * 78. GL_EXT_paletted_texture - */ -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 - -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 -#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 - -GLAPI void GLAPIENTRY glColorTableEXT( GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table ); - -GLAPI void GLAPIENTRY glColorSubTableEXT( GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data ); - -GLAPI void GLAPIENTRY glGetColorTableEXT( GLenum target, GLenum format, GLenum type, GLvoid *table ); - -GLAPI void GLAPIENTRY glGetColorTableParameterfvEXT( GLenum target, GLenum pname, GLfloat *params ); - -GLAPI void GLAPIENTRY glGetColorTableParameterivEXT( GLenum target, GLenum pname, GLint *params ); - -#endif /* GL_EXT_paletted_texture */ - - - -/* - * 79. GL_EXT_clip_volume_hint - */ -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 - -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 - -#endif /* GL_EXT_clip_volume_hint */ - - - -/* - * 97. GL_EXT_compiled_vertex_array - */ -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 - -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 - -GLAPI void GLAPIENTRY glLockArraysEXT( GLint first, GLsizei count ); -GLAPI void GLAPIENTRY glUnlockArraysEXT( void ); - -#endif /* GL_EXT_compiled_vertex_array */ - -/* - * 137. GL_HP_occlusion_test - */ -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 - -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 - -#endif /* GL_HP_occlusion_test */ - - -/* - * 141. GL_EXT_shared_texture_palette (req's GL_EXT_paletted_texture) - */ -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 - -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB - -#endif /* GL_EXT_shared_texture_palette */ - - - -/* - * 176. GL_EXT_stencil_wrap - */ -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 - -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 - -#endif /* GL_EXT_stencil_wrap */ - - - -/* - * 179. GL_NV_texgen_reflection - */ -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 - -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 - -#endif /* GL_NV_texgen_reflection */ - - - -/* - * 185. GL_EXT_texture_env_add - */ -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 - -/* No new tokens or functions */ - -#endif /* GL_EXT_texture_env_add */ - - - -/* - * 197. GL_MESA_window_pos - */ -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 - -GLAPI void GLAPIENTRY glWindowPos2iMESA( GLint x, GLint y ); -GLAPI void GLAPIENTRY glWindowPos2sMESA( GLshort x, GLshort y ); -GLAPI void GLAPIENTRY glWindowPos2fMESA( GLfloat x, GLfloat y ); -GLAPI void GLAPIENTRY glWindowPos2dMESA( GLdouble x, GLdouble y ); -GLAPI void GLAPIENTRY glWindowPos2ivMESA( const GLint *p ); -GLAPI void GLAPIENTRY glWindowPos2svMESA( const GLshort *p ); -GLAPI void GLAPIENTRY glWindowPos2fvMESA( const GLfloat *p ); -GLAPI void GLAPIENTRY glWindowPos2dvMESA( const GLdouble *p ); -GLAPI void GLAPIENTRY glWindowPos3iMESA( GLint x, GLint y, GLint z ); -GLAPI void GLAPIENTRY glWindowPos3sMESA( GLshort x, GLshort y, GLshort z ); -GLAPI void GLAPIENTRY glWindowPos3fMESA( GLfloat x, GLfloat y, GLfloat z ); -GLAPI void GLAPIENTRY glWindowPos3dMESA( GLdouble x, GLdouble y, GLdouble z ); -GLAPI void GLAPIENTRY glWindowPos3ivMESA( const GLint *p ); -GLAPI void GLAPIENTRY glWindowPos3svMESA( const GLshort *p ); -GLAPI void GLAPIENTRY glWindowPos3fvMESA( const GLfloat *p ); -GLAPI void GLAPIENTRY glWindowPos3dvMESA( const GLdouble *p ); -GLAPI void GLAPIENTRY glWindowPos4iMESA( GLint x, GLint y, GLint z, GLint w ); -GLAPI void GLAPIENTRY glWindowPos4sMESA( GLshort x, GLshort y, GLshort z, GLshort w ); -GLAPI void GLAPIENTRY glWindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); -GLAPI void GLAPIENTRY glWindowPos4dMESA( GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void GLAPIENTRY glWindowPos4ivMESA( const GLint *p ); -GLAPI void GLAPIENTRY glWindowPos4svMESA( const GLshort *p ); -GLAPI void GLAPIENTRY glWindowPos4fvMESA( const GLfloat *p ); -GLAPI void GLAPIENTRY glWindowPos4dvMESA( const GLdouble *p ); - -#endif /* GL_MESA_window_pos */ - - - -/* - * 196. GL_MESA_resize_bufffers - */ -#ifndef GL_MESA_resize_bufffers -#define GL_MESA_resize_buffers 1 - -GLAPI void GLAPIENTRY glResizeBuffersMESA( void ); - -#endif /* GL_MESA_resize_bufffers */ - - - -/* - * 220. GL_EXT_texture_env_dot3 - */ -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 - -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 - -#endif /* GL_EXT_texture_env_dot3 */ - +/* All extensions that used to be here are now found in glext.h */ #else /* GL_GLEXT_LEGACY */ -- cgit v1.2.3 From 760960028f189e3afcbfef1f877dbd5b86fd1ae4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 28 Aug 2003 16:57:01 +0000 Subject: Updates from Daniel Borca --- docs/README.DJ | 23 ++++++++++++----------- include/GL/dmesa.h | 2 +- progs/samples/Makefile.DJ | 2 +- src/glut/dos/glutint.h | 1 + src/glut/dos/init.c | 5 +++++ src/glut/dos/window.c | 8 ++++---- src/mesa/Makefile.DJ | 6 +++--- src/mesa/drivers/dos/dmesa.c | 33 +++++++++++++++++++++++++-------- src/mesa/drivers/dos/video.c | 34 +++++++++++++++++++--------------- 9 files changed, 71 insertions(+), 43 deletions(-) (limited to 'include') diff --git a/docs/README.DJ b/docs/README.DJ index fe3435e6c13..9fc7a55c634 100644 --- a/docs/README.DJ +++ b/docs/README.DJ @@ -97,7 +97,7 @@ FAQ: A) DXE3 refers to the DJGPP dynamic modules. You'll need either the latest DJGPP distro, or download the separate package from my web page. Read the DXE3 documentation on how to use them. - A) When compiling for Glide (FX=1), make sure `glid3.dxe' can be found in + A) When compiling for Glide (FX=1), make sure `glide3x.dxe' can be found in LD_LIBRARY_PATH (or top `lib' directory). 2. Using Mesa for DJGPP @@ -160,19 +160,19 @@ means that `printf' can be safely called during graphics. A bit of a hack, I know, because all messages come in bulk, but I think it's better than nothing. "Borrowed" from LIBRHUTI (Robert Hoehne). -Window creating defaults: 300x300x16 at (0,0), 16-bit depth, 16-bit accum, -8-bit stencil. However, the video mode is chosen in such a way that first -window will fit. If you need high resolution with small windows, set initial -position far to the right (or way down); then you can move them back to any -position right before the main loop. +Window creating defaults: (0, 0, 300, 300), 16bpp. However, the video mode is +chosen in such a way that first window will fit. If you need high resolution +with small windows, set initial position far to the right (or way down); then +you can move them back to any position right before the main loop. The following environment variables can customize GLUT behaviour: GLUT_FPS - print frames/second statistics to stderr DMESA_GLUT_REFRESH - set vertical screen refresh rate (VESA3) DMESA_GLUT_BPP - set default bits per pixel (VGA needs 8) - DMESA_GLUT_DEPTH - set default depth bits - DMESA_GLUT_STENCIL - set default stencil bits - DMESA_GLUT_ACCUM - set default accum bits + DMESA_GLUT_ALPHA - set default alpha bits (8) + DMESA_GLUT_DEPTH - set default depth bits (16) + DMESA_GLUT_STENCIL - set default stencil bits (8) + DMESA_GLUT_ACCUM - set default accum bits (16) @@ -211,9 +211,10 @@ v1.3 (mar-2003) v1.4 (aug-2003) + enabled GLUT fonts with DXE - + truly added multi-window support in GLUT + + truly added multi-window support in GLUT (for Adrian Woodward) * accomodated makefiles with the new sourcetree - * hacked and slashed the 3dfx driver (w/ help from Hiroshi Morii) + * fixed some ALPHA issues + x hacked and slashed the 3dfx driver (w/ help from Hiroshi Morii) diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h index 7510fdb9f4e..46aa4e22608 100644 --- a/include/GL/dmesa.h +++ b/include/GL/dmesa.h @@ -65,7 +65,7 @@ DMesaVisual DMesaCreateVisual (GLint width, /* X res */ GLint refresh, /* refresh rate: 0=default */ GLboolean dbFlag, /* double-buffered */ GLboolean rgbFlag, /* RGB mode */ - GLboolean alphaFlag,/* alpha buffer requested */ + GLint alphaSize, /* requested bits/alpha */ GLint depthSize, /* requested bits/depth */ GLint stencilSize, /* requested bits/stencil */ GLint accumSize); /* requested bits/accum */ diff --git a/progs/samples/Makefile.DJ b/progs/samples/Makefile.DJ index f8b0ccda48d..2f0f687587b 100644 --- a/progs/samples/Makefile.DJ +++ b/progs/samples/Makefile.DJ @@ -71,7 +71,7 @@ else LDLIBS = -lglut -lglu -lgl ifeq ($(FX),1) LDFLAGS += -L$(GLIDE)/lib -LDLIBS += -lglid3 +LDLIBS += -lgld3x endif endif diff --git a/src/glut/dos/glutint.h b/src/glut/dos/glutint.h index 013b307e941..23ab169d399 100644 --- a/src/glut/dos/glutint.h +++ b/src/glut/dos/glutint.h @@ -103,6 +103,7 @@ extern GLUTidleCB g_idle_func; extern GLUTmenuStatusCB g_menu_status_func; extern GLuint g_bpp; /* HW: bits per pixel */ +extern GLuint g_alpha; /* HW: alpha bits */ extern GLuint g_depth; /* HW: depth bits */ extern GLuint g_stencil; /* HW: stencil bits */ extern GLuint g_accum; /* HW: accum bits */ diff --git a/src/glut/dos/init.c b/src/glut/dos/init.c index 22bab9f8afc..d30f270c646 100644 --- a/src/glut/dos/init.c +++ b/src/glut/dos/init.c @@ -35,6 +35,7 @@ #define DEFAULT_HEIGHT 300 #define DEFAULT_BPP 16 +#define ALPHA_SIZE 8 #define DEPTH_SIZE 16 #define STENCIL_SIZE 8 #define ACCUM_SIZE 16 @@ -42,6 +43,7 @@ GLuint g_bpp = DEFAULT_BPP; +GLuint g_alpha = ALPHA_SIZE; GLuint g_depth = DEPTH_SIZE; GLuint g_stencil = STENCIL_SIZE; GLuint g_accum = ACCUM_SIZE; @@ -67,6 +69,9 @@ void APIENTRY glutInit (int *argc, char **argv) if ((env = getenv("DMESA_GLUT_BPP")) != NULL) { g_bpp = atoi(env); } + if ((env = getenv("DMESA_GLUT_ALPHA")) != NULL) { + g_alpha = atoi(env); + } if ((env = getenv("DMESA_GLUT_DEPTH")) != NULL) { g_depth = atoi(env); } diff --git a/src/glut/dos/window.c b/src/glut/dos/window.c index 06e8ea9ead1..af00897f3e5 100644 --- a/src/glut/dos/window.c +++ b/src/glut/dos/window.c @@ -71,10 +71,10 @@ int APIENTRY glutCreateWindow (const char *title) if ((visual=DMesaCreateVisual(g_init_x + m8width, g_init_y + g_init_h, g_bpp, g_refresh, g_display_mode & GLUT_DOUBLE, !(g_display_mode & GLUT_INDEX), - g_display_mode & GLUT_ALPHA, - g_display_mode & GLUT_DEPTH ? g_depth :0, - g_display_mode & GLUT_STENCIL ? g_stencil:0, - g_display_mode & GLUT_ACCUM ? g_accum :0))==NULL) { + (g_display_mode & GLUT_ALPHA ) ? g_alpha : 0, + (g_display_mode & GLUT_DEPTH ) ? g_depth : 0, + (g_display_mode & GLUT_STENCIL) ? g_stencil : 0, + (g_display_mode & GLUT_ACCUM ) ? g_accum : 0))==NULL) { return 0; } diff --git a/src/mesa/Makefile.DJ b/src/mesa/Makefile.DJ index 893a91bc1cb..a1b11d949be 100644 --- a/src/mesa/Makefile.DJ +++ b/src/mesa/Makefile.DJ @@ -78,13 +78,13 @@ CFLAGS += -I$(TOP)/include -I. -Imain -Iglapi ifeq ($(FX),1) CFLAGS += -D__DOS__ -DH3 CFLAGS += -I$(GLIDE)/include -DFX -LIBNAME = "MesaGL/FX DJGPP" +LIBNAME = "Mesa/FX DJGPP" else ifeq ($(MATROX),1) CFLAGS += -DMATROX -LIBNAME = "MesaGL/MGA DJGPP" +LIBNAME = "Mesa/MGA DJGPP" else -LIBNAME = "MesaGL DJGPP" +LIBNAME = "Mesa DJGPP" endif endif diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index 73b47569d9b..5d2cfb8b2bb 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -73,6 +73,7 @@ struct dmesa_visual { GLvisual gl_visual; GLboolean db_flag; /* double buffered? */ GLboolean rgb_flag; /* RGB mode? */ + GLboolean sw_alpha; /* use Mesa's alpha buffer? */ GLuint depth; /* bits per pixel (1, 8, 24, etc) */ #ifdef MATROX int stride_in_pixels; @@ -1335,7 +1336,7 @@ DMesaVisual DMesaCreateVisual (GLint width, GLint refresh, GLboolean dbFlag, GLboolean rgbFlag, - GLboolean alphaFlag, + GLint alphaSize, GLint depthSize, GLint stencilSize, GLint accumSize) @@ -1343,6 +1344,7 @@ DMesaVisual DMesaCreateVisual (GLint width, #ifndef FX DMesaVisual v; GLint redBits, greenBits, blueBits, alphaBits, indexBits; + GLboolean sw_alpha; #ifndef MATROX if (!dbFlag) { @@ -1370,6 +1372,7 @@ DMesaVisual DMesaCreateVisual (GLint width, blueBits = 8; break; case 15: + alphaBits = 1; redBits = 5; greenBits = 5; blueBits = 5; @@ -1391,6 +1394,23 @@ DMesaVisual DMesaCreateVisual (GLint width, } } + /* Okay, + * `alphaBits' is what we can provide + * `alphaSize' is what app requests + * + * Note that alpha buffering is required only if destination alpha is used + * in alpha blending; alpha blending modes that do not use destination alpha + * can be used w/o alpha buffer. + * + * We will use whatever ALPHA app requests. Later, in `CreateBuffer' we'll + * instruct Mesa to use its own ALPHA buffer, by passing a non-FALSE value + * for ALPHA to `_mesa_initialize_framebuffer'. + * + * Basically, 32bit modes provide ALPHA storage, but can we rely on this? + */ + alphaBits = alphaSize; + sw_alpha = (alphaBits > 0); + #ifndef MATROX if ((colDepth=vl_video_init(width, height, colDepth, rgbFlag, refresh)) <= 0) { return NULL; @@ -1401,10 +1421,6 @@ DMesaVisual DMesaCreateVisual (GLint width, } #endif - if (alphaFlag && (alphaBits==0)) { - alphaBits = 8; - } - if ((v=(DMesaVisual)CALLOC_STRUCT(dmesa_visual)) != NULL) { /* Create core visual */ _mesa_initialize_visual((GLvisual *)v, @@ -1421,12 +1437,13 @@ DMesaVisual DMesaCreateVisual (GLint width, accumSize, /* accumRed */ accumSize, /* accumGreen */ accumSize, /* accumBlue */ - alphaFlag?accumSize:0, /* accumAlpha */ + alphaBits?accumSize:0, /* accumAlpha */ 1); /* numSamples */ v->depth = colDepth; v->db_flag = dbFlag; v->rgb_flag = rgbFlag; + v->sw_alpha = sw_alpha; v->zbuffer = (depthSize > 0) ? 1 : 0; #ifdef MATROX @@ -1451,7 +1468,7 @@ DMesaVisual DMesaCreateVisual (GLint width, if (depthSize > 0) { fx_attrib[i++] = FXMESA_DEPTH_SIZE; fx_attrib[i++] = depthSize; } if (stencilSize > 0) { fx_attrib[i++] = FXMESA_STENCIL_SIZE; fx_attrib[i++] = stencilSize; } if (accumSize > 0) { fx_attrib[i++] = FXMESA_ACCUM_SIZE; fx_attrib[i++] = accumSize; } - if (alphaFlag) { fx_attrib[i++] = FXMESA_ALPHA_SIZE; fx_attrib[i++] = 1; } + if (alphaSize) { fx_attrib[i++] = FXMESA_ALPHA_SIZE; fx_attrib[i++] = alphaSize; } fx_attrib[i++] = FXMESA_COLORDEPTH; fx_attrib[i++] = colDepth; fx_attrib[i] = FXMESA_NONE; @@ -1493,7 +1510,7 @@ DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, visual->zbuffer == 1, ((GLvisual *)visual)->stencilBits > 0, ((GLvisual *)visual)->accumRedBits > 0, - ((GLvisual *)visual)->alphaBits > 0); + visual->sw_alpha); b->xpos = xpos; b->ypos = ypos; b->width = width; diff --git a/src/mesa/drivers/dos/video.c b/src/mesa/drivers/dos/video.c index 35c643b4c9a..5432141bb0d 100644 --- a/src/mesa/drivers/dos/video.c +++ b/src/mesa/drivers/dos/video.c @@ -23,10 +23,10 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa + * DOS/DJGPP device driver v1.4 for Mesa * * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com + * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca * * Thanks to CrazyPyro (Neil Funk) for FakeColor @@ -163,7 +163,11 @@ static int vl_mixfix32 (fixed r, fixed g, fixed b) #define vl_mixrgba24 vl_mixrgb24 static int vl_mixrgba32 (const unsigned char rgba[]) { - return (rgba[3]<<24)|(rgba[0]<<16)|(rgba[1]<<8)|(rgba[2]); + /* Hack alert: + * currently, DMesa uses Mesa's alpha buffer; + * so we don't really care about alpha value here... + */ + return /*(rgba[3]<<24)|*/(rgba[0]<<16)|(rgba[1]<<8)|(rgba[2]); } @@ -175,11 +179,11 @@ static int vl_mixrgba32 (const unsigned char rgba[]) * * Note: - */ -static int vl_mixrgb8fake (const unsigned char rgba[]) +static int vl_mixrgb8fake (const unsigned char rgb[]) { - return array_b[rgba[2]]*G_CNT*R_CNT - + array_g[rgba[1]]*R_CNT - + array_r[rgba[0]]; + return array_b[rgb[2]]*G_CNT*R_CNT + + array_g[rgb[1]]*R_CNT + + array_r[rgb[0]]; } #define vl_mixrgb8 vl_mixrgb8fake static int vl_mixrgb15 (const unsigned char rgb[]) @@ -205,21 +209,21 @@ static int vl_mixrgb32 (const unsigned char rgb[]) * * Note: uses current read buffer */ -static void v_getrgba8fake6 (unsigned int offset, unsigned char rgba[]) +static void v_getrgba8fake6 (unsigned int offset, unsigned char rgba[4]) { word32 c = VGAPalette[((word8 *)vl_current_read_buffer)[offset]]; rgba[0] = _rgb_scale_6[(c >> 16) & 0x3F]; rgba[1] = _rgb_scale_6[(c >> 8) & 0x3F]; rgba[2] = _rgb_scale_6[c & 0x3F]; - rgba[3] = c >> 24; + /*rgba[3] = c >> 24;*/ /* dummy alpha; we have separate SW alpha, so ignore */ } -static void v_getrgba8fake8 (unsigned int offset, unsigned char rgba[]) +static void v_getrgba8fake8 (unsigned int offset, unsigned char rgba[4]) { word32 c = VGAPalette[((word8 *)vl_current_read_buffer)[offset]]; rgba[0] = c >> 16; rgba[1] = c >> 8; rgba[2] = c; - rgba[3] = c >> 24; + /*rgba[3] = c >> 24;*/ /* dummy alpha; we have separate SW alpha, so ignore */ } #define v_getrgba8 v_getrgba8fake6 static void v_getrgba15 (unsigned int offset, unsigned char rgba[4]) @@ -235,7 +239,7 @@ static void v_getrgba15 (unsigned int offset, unsigned char rgba[4]) rgba[1] = _rgb_scale_5[(c >> 5) & 0x1F]; rgba[2] = _rgb_scale_5[c & 0x1F]; #endif - rgba[3] = 255; + /*rgba[3] = 255;*/ /* dummy alpha; we have separate SW alpha, so ignore */ } static void v_getrgba16 (unsigned int offset, unsigned char rgba[4]) { @@ -249,7 +253,7 @@ static void v_getrgba16 (unsigned int offset, unsigned char rgba[4]) rgba[1] = _rgb_scale_6[(c >> 5) & 0x3F]; rgba[2] = _rgb_scale_5[c & 0x1F]; #endif - rgba[3] = 255; + /*rgba[3] = 255;*/ /* dummy alpha; we have separate SW alpha, so ignore */ } static void v_getrgba24 (unsigned int offset, unsigned char rgba[4]) { @@ -257,7 +261,7 @@ static void v_getrgba24 (unsigned int offset, unsigned char rgba[4]) rgba[0] = c >> 16; rgba[1] = c >> 8; rgba[2] = c; - rgba[3] = 255; + /*rgba[3] = 255;*/ /* dummy alpha; we have separate SW alpha, so ignore */ } static void v_getrgba32 (unsigned int offset, unsigned char rgba[4]) { @@ -265,7 +269,7 @@ static void v_getrgba32 (unsigned int offset, unsigned char rgba[4]) rgba[0] = c >> 16; rgba[1] = c >> 8; rgba[2] = c; - rgba[3] = c >> 24; + /*rgba[3] = c >> 24;*/ /* dummy alpha; we have separate SW alpha, so ignore */ } -- cgit v1.2.3 From c8363a31cfcd8e3c60387df31525158847ab1457 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 2 Sep 2003 19:25:17 +0000 Subject: Added support for EXT_texture_mirror_clamp and the single wrap mode that it addes to ATI_texture_mirror_once. This includes updating the texwrap test to exercise the new mode. --- include/GL/gl.h | 12 +++++++ progs/tests/texwrap.c | 20 ++++++----- src/mesa/main/extensions.c | 4 ++- src/mesa/main/mtypes.h | 1 + src/mesa/main/texstate.c | 84 ++++++++++++++++++--------------------------- src/mesa/swrast/s_texture.c | 35 ++++++++++++++++--- 6 files changed, 92 insertions(+), 64 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 0f59c8726df..469f464b264 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2210,6 +2210,18 @@ typedef void (APIENTRY * PFNGLDEPTHBOUNDSEXTPROC)(GLclampd zmin, GLclampd zmax); +/* XXX temporary until glext.h is updated! */ +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 + +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 + +#endif /* GL_EXT_texture_mirror_clamp */ + + + /* XXX temporary until glext.h is updated! */ #ifndef GL_ARB_occlusion_query #define GL_ARB_occlusion_query 1 diff --git a/progs/tests/texwrap.c b/progs/tests/texwrap.c index 2602f3210de..35f5050ef70 100644 --- a/progs/tests/texwrap.c +++ b/progs/tests/texwrap.c @@ -1,4 +1,4 @@ -/* $Id: texwrap.c,v 1.6 2003/05/30 15:30:17 brianp Exp $ */ +/* $Id: texwrap.c,v 1.7 2003/09/02 19:25:18 idr Exp $ */ /* * Test texture wrap modes. @@ -24,9 +24,10 @@ #define GL_MIRRORED_REPEAT 0x8370 #endif -#ifndef GL_ATI_texture_mirror_once -#define GL_MIRROR_CLAMP_ATI 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 +#ifndef GL_EXT_texture_mirror_clamp +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 #endif #define BORDER_TEXTURE 1 @@ -61,11 +62,14 @@ static struct wrap_mode modes[] = { WRAP_EXT ( GL_MIRRORED_REPEAT, "GL_ARB_texture_mirrored_repeat", "GL_IBM_texture_mirrored_repeat", 1.4 ), - WRAP_EXT ( GL_MIRROR_CLAMP_ATI, "GL_ATI_texture_mirror_once", - NULL, + WRAP_EXT ( GL_MIRROR_CLAMP_EXT, "GL_ATI_texture_mirror_once", + "GL_EXT_texture_mirror_clamp", 999.0 ), - WRAP_EXT ( GL_MIRROR_CLAMP_TO_EDGE_ATI, "GL_ATI_texture_mirror_once", - NULL, + WRAP_EXT ( GL_MIRROR_CLAMP_TO_EDGE_EXT, "GL_ATI_texture_mirror_once", + "GL_EXT_texture_mirror_clamp", + 999.0 ), + WRAP_EXT ( GL_MIRROR_CLAMP_TO_BORDER_EXT, "GL_EXT_texture_mirror_clamp", + NULL, 999.0 ), { 0 } }; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 886311e0f1c..9928a5244e6 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -100,8 +100,9 @@ static const struct { { OFF, "GL_EXT_texture_env_combine", F(EXT_texture_env_combine) }, { OFF, "GL_EXT_texture_env_dot3", F(EXT_texture_env_dot3) }, { OFF, "GL_EXT_texture_filter_anisotropic", F(EXT_texture_filter_anisotropic) }, - { ON, "GL_EXT_texture_object", 0 }, { OFF, "GL_EXT_texture_lod_bias", F(EXT_texture_lod_bias) }, + { OFF, "GL_EXT_texture_mirror_clamp", F(EXT_texture_mirror_clamp) }, + { ON, "GL_EXT_texture_object", 0 }, { OFF, "GL_EXT_texture_rectangle", F(NV_texture_rectangle) }, { ON, "GL_EXT_vertex_array", 0 }, { OFF, "GL_EXT_vertex_array_set", F(EXT_vertex_array_set) }, @@ -196,6 +197,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.EXT_texture_env_add = GL_TRUE; ctx->Extensions.EXT_texture_env_combine = GL_TRUE; ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE; + ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE; ctx->Extensions.EXT_texture_lod_bias = GL_TRUE; ctx->Extensions.HP_occlusion_test = GL_TRUE; ctx->Extensions.IBM_multimode_draw_arrays = GL_TRUE; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 47cb19b6259..a51a463602c 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1770,6 +1770,7 @@ struct gl_extensions GLboolean EXT_texture_env_dot3; GLboolean EXT_texture_filter_anisotropic; GLboolean EXT_texture_lod_bias; + GLboolean EXT_texture_mirror_clamp; GLboolean EXT_vertex_array_set; GLboolean HP_occlusion_test; GLboolean IBM_rasterpos_clip; diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index a62106aa491..133b957aa56 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -1048,6 +1048,35 @@ _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) /* Texture Parameters */ /**********************************************************************/ +static GLboolean +_mesa_validate_texture_wrap_mode(GLcontext * ctx, + GLenum target, GLenum eparam) +{ + const struct gl_extensions * const e = & ctx->Extensions; + + if (eparam == GL_CLAMP || eparam == GL_CLAMP_TO_EDGE || + (eparam == GL_CLAMP_TO_BORDER && e->ARB_texture_border_clamp)) { + /* any texture target */ + return GL_TRUE; + } + else if (target != GL_TEXTURE_RECTANGLE_NV && + (eparam == GL_REPEAT || + (eparam == GL_MIRRORED_REPEAT && + e->ARB_texture_mirrored_repeat) || + (eparam == GL_MIRROR_CLAMP_EXT && + (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) || + (eparam == GL_MIRROR_CLAMP_TO_EDGE_EXT && + (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp)) || + (eparam == GL_MIRROR_CLAMP_TO_BORDER_EXT && + (e->EXT_texture_mirror_clamp)))) { + /* non-rectangle texture */ + return GL_TRUE; + } + + _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); + return GL_FALSE; +} + void _mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ) @@ -1141,81 +1170,34 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) case GL_TEXTURE_WRAP_S: if (texObj->WrapS == eparam) return; - if (eparam == GL_CLAMP || eparam == GL_CLAMP_TO_EDGE || - (eparam == GL_CLAMP_TO_BORDER && - ctx->Extensions.ARB_texture_border_clamp)) { - /* any texture target */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->WrapS = eparam; - } - else if (texObj->Target != GL_TEXTURE_RECTANGLE_NV && - (eparam == GL_REPEAT || - (eparam == GL_MIRRORED_REPEAT && - ctx->Extensions.ARB_texture_mirrored_repeat) || - (eparam == GL_MIRROR_CLAMP_ATI && - ctx->Extensions.ATI_texture_mirror_once) || - (eparam == GL_MIRROR_CLAMP_TO_EDGE_ATI && - ctx->Extensions.ATI_texture_mirror_once))) { - /* non-rectangle texture */ + if (_mesa_validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); texObj->WrapS = eparam; } else { - _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); return; } break; case GL_TEXTURE_WRAP_T: if (texObj->WrapT == eparam) return; - if (eparam == GL_CLAMP || eparam == GL_CLAMP_TO_EDGE || - (eparam == GL_CLAMP_TO_BORDER && - ctx->Extensions.ARB_texture_border_clamp)) { - /* any texture target */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->WrapT = eparam; - } - else if (texObj->Target != GL_TEXTURE_RECTANGLE_NV && - (eparam == GL_REPEAT || - (eparam == GL_MIRRORED_REPEAT && - ctx->Extensions.ARB_texture_mirrored_repeat) || - (eparam == GL_MIRROR_CLAMP_ATI && - ctx->Extensions.ATI_texture_mirror_once) || - (eparam == GL_MIRROR_CLAMP_TO_EDGE_ATI && - ctx->Extensions.ATI_texture_mirror_once))) { - /* non-rectangle texture */ + if (_mesa_validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); texObj->WrapT = eparam; } else { - _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); return; } break; case GL_TEXTURE_WRAP_R: if (texObj->WrapR == eparam) return; - if (eparam == GL_CLAMP || eparam == GL_CLAMP_TO_EDGE || - (eparam == GL_CLAMP_TO_BORDER && - ctx->Extensions.ARB_texture_border_clamp)) { - /* any texture target */ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texObj->WrapR = eparam; - } - else if (texObj->Target != GL_TEXTURE_RECTANGLE_NV && - (eparam == GL_REPEAT || - (eparam == GL_MIRRORED_REPEAT && - ctx->Extensions.ARB_texture_mirrored_repeat) || - (eparam == GL_MIRROR_CLAMP_ATI && - ctx->Extensions.ATI_texture_mirror_once) || - (eparam == GL_MIRROR_CLAMP_TO_EDGE_ATI && - ctx->Extensions.ATI_texture_mirror_once))) { - /* non-rectangle texture */ + if (_mesa_validate_texture_wrap_mode(ctx, texObj->Target, eparam)) { FLUSH_VERTICES(ctx, _NEW_TEXTURE); texObj->WrapR = eparam; } else { - _mesa_error( ctx, GL_INVALID_VALUE, "glTexParameter(param)" ); + return; } break; case GL_TEXTURE_BORDER_COLOR: diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index 6f38aab7f0a..a196f34c275 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -122,7 +122,7 @@ repeat_remainder(GLint a, GLint b) if (I1 >= (GLint) SIZE) \ I1 = SIZE - 1; \ } \ - else if (wrapMode == GL_MIRROR_CLAMP_ATI) { \ + else if (wrapMode == GL_MIRROR_CLAMP_EXT) { \ U = (GLfloat) fabs(S); \ if (U >= 1.0F) \ U = (GLfloat) SIZE; \ @@ -132,7 +132,7 @@ repeat_remainder(GLint a, GLint b) I0 = IFLOOR(U); \ I1 = I0 + 1; \ } \ - else if (wrapMode == GL_MIRROR_CLAMP_TO_EDGE_ATI) { \ + else if (wrapMode == GL_MIRROR_CLAMP_TO_EDGE_EXT) { \ U = (GLfloat) fabs(S); \ if (U >= 1.0F) \ U = (GLfloat) SIZE; \ @@ -146,6 +146,20 @@ repeat_remainder(GLint a, GLint b) if (I1 >= (GLint) SIZE) \ I1 = SIZE - 1; \ } \ + else if (wrapMode == GL_MIRROR_CLAMP_TO_BORDER_EXT) { \ + const GLfloat min = -1.0F / (2.0F * SIZE); \ + const GLfloat max = 1.0F - min; \ + U = (GLfloat) fabs(S); \ + if (U <= min) \ + U = min * SIZE; \ + else if (U >= max) \ + U = max * SIZE; \ + else \ + U *= SIZE; \ + U -= 0.5F; \ + I0 = IFLOOR(U); \ + I1 = I0 + 1; \ + } \ else { \ ASSERT(wrapMode == GL_CLAMP); \ if (S <= 0.0F) \ @@ -215,7 +229,7 @@ repeat_remainder(GLint a, GLint b) else \ I = IFLOOR(u * SIZE); \ } \ - else if (wrapMode == GL_MIRROR_CLAMP_ATI) { \ + else if (wrapMode == GL_MIRROR_CLAMP_EXT) { \ /* s limited to [0,1] */ \ /* i limited to [0,size-1] */ \ const GLfloat u = (GLfloat) fabs(S); \ @@ -226,7 +240,7 @@ repeat_remainder(GLint a, GLint b) else \ I = IFLOOR(u * SIZE); \ } \ - else if (wrapMode == GL_MIRROR_CLAMP_TO_EDGE_ATI) { \ + else if (wrapMode == GL_MIRROR_CLAMP_TO_EDGE_EXT) { \ /* s limited to [min,max] */ \ /* i limited to [0, size-1] */ \ const GLfloat min = 1.0F / (2.0F * SIZE); \ @@ -239,6 +253,19 @@ repeat_remainder(GLint a, GLint b) else \ I = IFLOOR(u * SIZE); \ } \ + else if (wrapMode == GL_MIRROR_CLAMP_TO_BORDER_EXT) { \ + /* s limited to [min,max] */ \ + /* i limited to [0, size-1] */ \ + const GLfloat min = -1.0F / (2.0F * SIZE); \ + const GLfloat max = 1.0F - min; \ + const GLfloat u = (GLfloat) fabs(S); \ + if (u < min) \ + I = -1; \ + else if (u > max) \ + I = SIZE; \ + else \ + I = IFLOOR(u * SIZE); \ + } \ else { \ ASSERT(wrapMode == GL_CLAMP); \ /* s limited to [0,1] */ \ -- cgit v1.2.3 From d7dabacfa3b3143ee418919460e2edeefef1867a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 23 Sep 2003 14:44:33 +0000 Subject: new enum values for GL_MESA_program_debug --- include/GL/gl.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 469f464b264..2887e70cda0 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2258,14 +2258,14 @@ typedef void (APIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC)(GLuint id, GLenum pname, #ifndef GL_MESA_program_debug #define GL_MESA_program_debug 1 -#define GL_FRAGMENT_PROGRAM_POSITION_MESA 0x9900 -#define GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x9901 -#define GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x9902 -#define GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x9903 -#define GL_VERTEX_PROGRAM_POSITION_MESA 0x9904 -#define GL_VERTEX_PROGRAM_CALLBACK_MESA 0x9905 -#define GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x9906 -#define GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x9907 +#define GL_FRAGMENT_PROGRAM_POSITION_MESA 0x8bb0 +#define GL_FRAGMENT_PROGRAM_CALLBACK_MESA 0x8bb1 +#define GL_FRAGMENT_PROGRAM_CALLBACK_FUNC_MESA 0x8bb2 +#define GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA 0x8bb3 +#define GL_VERTEX_PROGRAM_POSITION_MESA 0x8bb4 +#define GL_VERTEX_PROGRAM_CALLBACK_MESA 0x8bb5 +#define GL_VERTEX_PROGRAM_CALLBACK_FUNC_MESA 0x8bb6 +#define GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA 0x8bb7 typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data); @@ -2274,8 +2274,7 @@ glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data); extern void -glGetProgramRegisterfvMESA(GLenum target, - GLsizei len, const GLubyte *registerName, +glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v); #endif /* GL_MESA_program_debug */ -- cgit v1.2.3 From d6643331ab1a2215338be19177296d255170c798 Mon Sep 17 00:00:00 2001 From: Kendall Bennett Date: Tue, 30 Sep 2003 20:02:27 +0000 Subject: Updates required for building the SciTech SNAP version of Mesa. This includes: 1. Changes to the main header files to exclude some stuff is __SCITECH_SNAP__ is defined. The main GL/gl.h header file in SciTech SNAP is actually a wrapper that defines a bunch of necessary stuff and then included GL/gl_mesa.h which is the normal Mesa GL/gl.h header file renamed. 2. Changed APIENTRY * to APIENTRYP macros in the GL/gl.h and GL/glext.h header files. This will better support other compilers like IBM VisualAge C++. I added a basic macro for APIENTRYP to GL/gl.h (inside the !SNAP block), so existing code will compile the same, but when the SNAP version is being built we will use the correc definitions for the target compiler. 3. Changed a few more void * declarations to GLvoid *'s to avoid Open Watcom compiler complaints. 4. Updates the OPENGL_VERSION macro to include a patch number (set to 0 for now). Probably not necessary, but the original macro was wrong and we use that macro in our code. 5. Changed _tnl_end() to _tnl_end_ctx() to avoid conflicts with _tnl_End when using a compiler that has a case insensitive link. --- include/GL/gl.h | 262 +++---- include/GL/glext.h | 1806 ++++++++++++++++++++++----------------------- src/mesa/main/glheader.h | 2 +- src/mesa/main/texstore.h | 10 +- src/mesa/main/version.h | 5 +- src/mesa/tnl/t_eval_api.c | 10 +- src/mesa/tnl/t_imm_api.c | 4 +- src/mesa/tnl/t_imm_api.h | 2 +- 8 files changed, 1054 insertions(+), 1047 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 2887e70cda0..a3179cf2570 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -32,8 +32,12 @@ /********************************************************************** - * Begin system-specific stuff. + * Begin system-specific stuff. Do not do any of this when building + * for SciTech SNAP, as this is all done before this header file is + * included. */ +#if !defined(__SCITECH_SNAP__) + #if defined(__BEOS__) #include /* to get some BeOS-isms */ #endif @@ -89,6 +93,7 @@ #ifndef APIENTRY #define APIENTRY GLAPIENTRY #endif +#define APIENTRYP APIENTRY * #ifdef CENTERLINE_CLPP #define signed @@ -98,6 +103,7 @@ #pragma export on #endif +#endif /* !__SCITECH_SNAP__ */ /* * End system-specific stuff. **********************************************************************/ @@ -1514,10 +1520,10 @@ GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level, GLint y, GLsizei width, GLsizei height ); -typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (APIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* @@ -1709,40 +1715,40 @@ GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target, GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); -typedef void (APIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -typedef void (APIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); -typedef void (APIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); -typedef void (APIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); @@ -1948,52 +1954,52 @@ GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] ); GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert ); -typedef void (APIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img); +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img); /* @@ -2073,40 +2079,40 @@ GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); #endif /* GL_ARB_multitexture */ @@ -2204,7 +2210,7 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid GLAPI void GLAPIENTRY glDepthBoundsEXT(GLclampd zmin, GLclampd zmax); -typedef void (APIENTRY * PFNGLDEPTHBOUNDSEXTPROC)(GLclampd zmin, GLclampd zmax); +typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC)(GLclampd zmin, GLclampd zmax); #endif /* GL_EXT_depth_bounds_test */ @@ -2243,14 +2249,14 @@ GLAPI void GLAPIENTRY glGetQueryObjectivARB(GLuint id, GLenum pname, GLint *para GLAPI void GLAPIENTRY glGetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params); #endif -typedef void (APIENTRY * PFNGLGENQUERIESARBPROC)(GLsizei n, GLuint *ids); -typedef void (APIENTRY * PFNGLDELETEQUERIESARBPROC)(GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRY * PFNGLISQUERYARBPROC)(GLuint id); -typedef void (APIENTRY * PFNGLBEGINQUERYARBPROC)(GLenum target, GLuint id); -typedef void (APIENTRY * PFNGLENDQUERYARBPROC)(GLenum target); -typedef void (APIENTRY * PFNGLGETQUERYIVARBPROC)(GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETQUERYOBJECTIVARBPROC)(GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC)(GLuint id, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLGENQUERIESARBPROC)(GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC)(GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC)(GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC)(GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYARBPROC)(GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC)(GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC)(GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC)(GLuint id, GLenum pname, GLuint *params); #endif /* GL_ARB_occlusion_query */ diff --git a/include/GL/glext.h b/include/GL/glext.h index cb32fba2a7e..777cc03936a 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -34,7 +34,7 @@ extern "C" { ** version 1.2.1 Specification. */ -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) #define WIN32_LEAN_AND_MEAN 1 #include #endif @@ -2671,44 +2671,44 @@ GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsize GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -typedef void (APIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); -typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (APIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); -typedef void (APIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); -typedef void (APIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); #endif #ifndef GL_VERSION_1_3 @@ -2761,52 +2761,52 @@ GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsi GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); #endif #ifndef GL_VERSION_1_4 @@ -2858,51 +2858,51 @@ GLAPI void APIENTRY glWindowPos3iv (const GLint *); GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort); GLAPI void APIENTRY glWindowPos3sv (const GLshort *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (APIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); -typedef void (APIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); -typedef void (APIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); -typedef void (APIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); -typedef void (APIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); -typedef void (APIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); -typedef void (APIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); -typedef void (APIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); -typedef void (APIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); #endif #ifndef GL_ARB_multitexture @@ -2943,40 +2943,40 @@ GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); #endif #ifndef GL_ARB_transpose_matrix @@ -2987,10 +2987,10 @@ GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); #endif #ifndef GL_ARB_multisample @@ -2998,7 +2998,7 @@ typedef void (APIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); #endif #ifndef GL_ARB_texture_env_add @@ -3020,13 +3020,13 @@ GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, G GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); #endif #ifndef GL_ARB_texture_border_clamp @@ -3039,8 +3039,8 @@ typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLin GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); #endif #ifndef GL_ARB_vertex_blend @@ -3057,16 +3057,16 @@ GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *); GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *); GLAPI void APIENTRY glVertexBlendARB (GLint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); -typedef void (APIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); -typedef void (APIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); -typedef void (APIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); -typedef void (APIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); -typedef void (APIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); -typedef void (APIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); -typedef void (APIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); -typedef void (APIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); +typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); +typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); +typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); +typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); +typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); +typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); +typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); #endif #ifndef GL_ARB_matrix_palette @@ -3078,11 +3078,11 @@ GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *); GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *); GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); -typedef void (APIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); -typedef void (APIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); -typedef void (APIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); -typedef void (APIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); #endif #ifndef GL_ARB_texture_env_combine @@ -3133,22 +3133,22 @@ GLAPI void APIENTRY glWindowPos3ivARB (const GLint *); GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort); GLAPI void APIENTRY glWindowPos3svARB (const GLshort *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); -typedef void (APIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); -typedef void (APIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); #endif #ifndef GL_ARB_vertex_program @@ -3217,68 +3217,68 @@ GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *); GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *); GLAPI GLboolean APIENTRY glIsProgramARB (GLuint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); -typedef void (APIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); -typedef void (APIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); -typedef void (APIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); -typedef void (APIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); -typedef void (APIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); -typedef void (APIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); #endif #ifndef GL_ARB_fragment_program @@ -3306,17 +3306,17 @@ GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum); GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *); GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef void (APIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); -typedef void (APIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); -typedef void (APIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); -typedef GLvoid* (APIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target); -typedef void (APIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); +typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); #endif #ifndef GL_EXT_abgr @@ -3328,7 +3328,7 @@ typedef void (APIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum p #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); #endif #ifndef GL_EXT_polygon_offset @@ -3336,7 +3336,7 @@ typedef void (APIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); #endif #ifndef GL_EXT_texture @@ -3349,8 +3349,8 @@ typedef void (APIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bia GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); #endif #ifndef GL_SGIS_texture_filter4 @@ -3359,8 +3359,8 @@ typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); -typedef void (APIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); #endif #ifndef GL_EXT_subtexture @@ -3369,8 +3369,8 @@ typedef void (APIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filt GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); #endif #ifndef GL_EXT_copy_texture @@ -3382,11 +3382,11 @@ GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); #endif #ifndef GL_EXT_histogram @@ -3403,16 +3403,16 @@ GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); GLAPI void APIENTRY glResetHistogramEXT (GLenum); GLAPI void APIENTRY glResetMinmaxEXT (GLenum); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); -typedef void (APIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); #endif #ifndef GL_EXT_convolution @@ -3432,19 +3432,19 @@ GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); #endif #ifndef GL_EXT_color_matrix @@ -3462,13 +3462,13 @@ GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); #endif #ifndef GL_SGIX_pixel_texture @@ -3476,7 +3476,7 @@ typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, G #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); #endif #ifndef GL_SGIS_pixel_texture @@ -3489,12 +3489,12 @@ GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); #endif #ifndef GL_SGIS_texture4D @@ -3503,8 +3503,8 @@ typedef void (APIENTRY * PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); #endif #ifndef GL_SGI_texture_color_table @@ -3525,12 +3525,12 @@ GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); -typedef void (APIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); -typedef void (APIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); -typedef void (APIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); -typedef GLboolean (APIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); -typedef void (APIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); +typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); +typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); #endif #ifndef GL_SGIS_detail_texture @@ -3539,8 +3539,8 @@ typedef void (APIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuin GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); #endif #ifndef GL_SGIS_sharpen_texture @@ -3549,8 +3549,8 @@ typedef void (APIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); #endif #ifndef GL_EXT_packed_pixels @@ -3567,8 +3567,8 @@ typedef void (APIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); GLAPI void APIENTRY glSamplePatternSGIS (GLenum); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); #endif #ifndef GL_EXT_rescale_normal @@ -3588,15 +3588,15 @@ GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid * GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (APIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); -typedef void (APIENTRY * PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); -typedef void (APIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); +typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); +typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); #endif #ifndef GL_EXT_misc_attribute @@ -3628,7 +3628,7 @@ typedef void (APIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GL #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBlendEquationEXT (GLenum); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); #endif #ifndef GL_EXT_blend_subtract @@ -3659,10 +3659,10 @@ GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); #endif #ifndef GL_SGIX_texture_multi_buffer @@ -3675,8 +3675,8 @@ typedef void (APIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GL GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); #endif #ifndef GL_SGIS_point_parameters @@ -3685,8 +3685,8 @@ typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfl GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); #endif #ifndef GL_SGIX_instruments @@ -3699,12 +3699,12 @@ GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); GLAPI void APIENTRY glStartInstrumentsSGIX (void); GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef GLint (APIENTRY * PFNGLGETINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRY * PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); -typedef GLint (APIENTRY * PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); -typedef void (APIENTRY * PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); -typedef void (APIENTRY * PFNGLSTARTINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRY * PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); +typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); +typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); +typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); +typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); #endif #ifndef GL_SGIX_texture_scale_bias @@ -3716,7 +3716,7 @@ typedef void (APIENTRY * PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glFrameZoomSGIX (GLint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); +typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); #endif #ifndef GL_SGIX_tag_sample_buffer @@ -3724,7 +3724,7 @@ typedef void (APIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glTagSampleBufferSGIX (void); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); +typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); #endif #ifndef GL_SGIX_polynomial_ffd @@ -3735,10 +3735,10 @@ GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLi GLAPI void APIENTRY glDeformSGIX (GLbitfield); GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); -typedef void (APIENTRY * PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); -typedef void (APIENTRY * PFNGLDEFORMSGIXPROC) (GLbitfield mask); -typedef void (APIENTRY * PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); #endif #ifndef GL_SGIX_reference_plane @@ -3746,7 +3746,7 @@ typedef void (APIENTRY * PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield ma #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); +typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); #endif #ifndef GL_SGIX_flush_raster @@ -3754,7 +3754,7 @@ typedef void (APIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation) #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glFlushRasterSGIX (void); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); +typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); #endif #ifndef GL_SGIX_depth_texture @@ -3767,8 +3767,8 @@ typedef void (APIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); -typedef void (APIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); +typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); #endif #ifndef GL_SGIX_fog_offset @@ -3785,12 +3785,12 @@ GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); #endif #ifndef GL_HP_convolution_border_modes @@ -3807,8 +3807,8 @@ typedef void (APIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); #endif #ifndef GL_PGI_vertex_hints @@ -3820,7 +3820,7 @@ typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glHintPGI (GLenum, GLint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLHINTPGIPROC) (GLenum target, GLint mode); +typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); #endif #ifndef GL_EXT_paletted_texture @@ -3831,10 +3831,10 @@ GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); #endif #ifndef GL_EXT_clip_volume_hint @@ -3851,12 +3851,12 @@ GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); #endif #ifndef GL_SGIX_ir_instrument1 @@ -3884,7 +3884,7 @@ typedef void (APIENTRY * PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pnam #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); #endif #ifndef GL_EXT_index_func @@ -3892,7 +3892,7 @@ typedef void (APIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); +typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); #endif #ifndef GL_EXT_index_array_formats @@ -3905,8 +3905,8 @@ typedef void (APIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); GLAPI void APIENTRY glUnlockArraysEXT (void); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); -typedef void (APIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); +typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); #endif #ifndef GL_EXT_cull_vertex @@ -3915,8 +3915,8 @@ typedef void (APIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); -typedef void (APIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); #endif #ifndef GL_SGIX_ycrcb @@ -3945,24 +3945,24 @@ GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); #endif #ifndef GL_IBM_rasterpos_clip @@ -3978,7 +3978,7 @@ typedef void (APIENTRY * PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); #endif #ifndef GL_WIN_phong_shading @@ -3996,9 +3996,9 @@ GLAPI void APIENTRY glApplyTextureEXT (GLenum); GLAPI void APIENTRY glTextureLightEXT (GLenum); GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); -typedef void (APIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); -typedef void (APIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); #endif #ifndef GL_SGIX_blend_alpha_minmax @@ -4019,12 +4019,12 @@ GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); -typedef GLint (APIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); -typedef GLint (APIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); -typedef GLuint (APIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); -typedef void (APIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); -typedef GLboolean (APIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); +typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); +typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); #endif #ifndef GL_SGIX_async_pixel @@ -4043,10 +4043,10 @@ GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); -typedef void (APIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); #endif #ifndef GL_HP_occlusion_test @@ -4061,10 +4061,10 @@ GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); #endif #ifndef GL_EXT_pixel_transform_color_table @@ -4100,23 +4100,23 @@ GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); -typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); #endif #ifndef GL_EXT_texture_perturb_normal @@ -4124,7 +4124,7 @@ typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glTextureNormalEXT (GLenum); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); #endif #ifndef GL_EXT_multi_draw_arrays @@ -4133,8 +4133,8 @@ typedef void (APIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); -typedef void (APIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); #endif #ifndef GL_EXT_fog_coord @@ -4146,11 +4146,11 @@ GLAPI void APIENTRY glFogCoorddEXT (GLdouble); GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); -typedef void (APIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); -typedef void (APIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); -typedef void (APIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); -typedef void (APIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); #endif #ifndef GL_REND_screen_coordinates @@ -4183,28 +4183,28 @@ GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); -typedef void (APIENTRY * PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRY * PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); -typedef void (APIENTRY * PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); -typedef void (APIENTRY * PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); -typedef void (APIENTRY * PFNGLTANGENT3IVEXTPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); -typedef void (APIENTRY * PFNGLTANGENT3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); -typedef void (APIENTRY * PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRY * PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); -typedef void (APIENTRY * PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); -typedef void (APIENTRY * PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); -typedef void (APIENTRY * PFNGLBINORMAL3IVEXTPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); -typedef void (APIENTRY * PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); +typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); +typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); +typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); +typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); +typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); +typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); +typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); +typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); +typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); +typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); #endif #ifndef GL_EXT_texture_env_combine @@ -4228,7 +4228,7 @@ typedef void (APIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stri #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glFinishTextureSUNX (void); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); +typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); #endif #ifndef GL_SUN_global_alpha @@ -4243,14 +4243,14 @@ GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); -typedef void (APIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); #endif #ifndef GL_SUN_triangle_list @@ -4264,13 +4264,13 @@ GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); #endif #ifndef GL_SUN_vertex @@ -4317,46 +4317,46 @@ GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLu GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); #endif #ifndef GL_EXT_blend_func_separate @@ -4364,7 +4364,7 @@ typedef void (APIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3F #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); #endif #ifndef GL_INGR_blend_func_separate @@ -4372,7 +4372,7 @@ typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLen #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); #endif #ifndef GL_INGR_color_clamp @@ -4418,9 +4418,9 @@ GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); -typedef void (APIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); -typedef void (APIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); #endif #ifndef GL_NV_light_max_exponent @@ -4433,8 +4433,8 @@ typedef void (APIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (APIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); #endif #ifndef GL_NV_register_combiners @@ -4454,19 +4454,19 @@ GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GL GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -typedef void (APIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); #endif #ifndef GL_NV_fog_distance @@ -4490,7 +4490,7 @@ typedef void (APIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum va #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glResizeBuffersMESA (void); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); +typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); #endif #ifndef GL_MESA_window_pos @@ -4521,30 +4521,30 @@ GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); -typedef void (APIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); -typedef void (APIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); -typedef void (APIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); -typedef void (APIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); #endif #ifndef GL_IBM_cull_vertex @@ -4557,8 +4557,8 @@ typedef void (APIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint); GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid * const *, GLsizei, GLint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum * mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (APIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, GLint modestride); +typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum * mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, GLint modestride); #endif #ifndef GL_IBM_vertex_array_lists @@ -4573,14 +4573,14 @@ GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLin GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); #endif #ifndef GL_SGIX_subsample @@ -4612,7 +4612,7 @@ typedef void (APIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glTbufferMask3DFX (GLuint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); +typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); #endif #ifndef GL_EXT_multisample @@ -4621,8 +4621,8 @@ typedef void (APIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); GLAPI void APIENTRY glSamplePatternEXT (GLenum); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); +typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); #endif #ifndef GL_SGIX_vertex_preclip @@ -4646,7 +4646,7 @@ typedef void (APIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); #endif #ifndef GL_SGIX_igloo_interface @@ -4654,7 +4654,7 @@ typedef void (APIENTRY * PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolea #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); +typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); #endif #ifndef GL_EXT_texture_env_dot3 @@ -4676,13 +4676,13 @@ GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); GLAPI void APIENTRY glFinishFenceNV (GLuint); GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); -typedef GLboolean (APIENTRY * PFNGLISFENCENVPROC) (GLuint fence); -typedef GLboolean (APIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); -typedef void (APIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); -typedef void (APIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); #endif #ifndef GL_NV_evaluators @@ -4698,15 +4698,15 @@ GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint * GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); -typedef void (APIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); -typedef void (APIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); #endif #ifndef GL_NV_packed_depth_stencil @@ -4719,8 +4719,8 @@ typedef void (APIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *); GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); -typedef void (APIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); #endif #ifndef GL_NV_texture_compression_vtc @@ -4811,70 +4811,70 @@ GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); -typedef void (APIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); -typedef void (APIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); -typedef void (APIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); -typedef void (APIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); -typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); -typedef void (APIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v); -typedef void (APIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v); -typedef void (APIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); -typedef void (APIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); -typedef void (APIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); -typedef void (APIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); -typedef void (APIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); +typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); +typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); +typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v); +typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); #endif #ifndef GL_SGIX_texture_coordinate_clamp @@ -4909,10 +4909,10 @@ GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *); GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *); GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); -typedef void (APIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); -typedef void (APIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); -typedef void (APIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); #endif #ifndef GL_ATI_fragment_shader @@ -4933,20 +4933,20 @@ GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuin GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef GLuint (APIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); -typedef void (APIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); -typedef void (APIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); -typedef void (APIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRY * PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRY * PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); +typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); #endif #ifndef GL_ATI_pn_triangles @@ -4955,8 +4955,8 @@ typedef void (APIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, con GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint); GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); #endif #ifndef GL_ATI_vertex_array_object @@ -4975,18 +4975,18 @@ GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GL GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *); GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef GLuint (APIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); -typedef GLboolean (APIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); -typedef void (APIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); +typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); +typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); #endif #ifndef GL_EXT_vertex_shader @@ -5035,48 +5035,48 @@ GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *); GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *); GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); -typedef GLuint (APIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); -typedef void (APIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); -typedef void (APIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); -typedef void (APIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); -typedef void (APIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -typedef void (APIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef void (APIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef GLuint (APIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -typedef void (APIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); -typedef void (APIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); -typedef void (APIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); -typedef void (APIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); -typedef void (APIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); -typedef void (APIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); -typedef void (APIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); -typedef void (APIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); -typedef void (APIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); -typedef void (APIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); -typedef void (APIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); -typedef void (APIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef void (APIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef GLuint (APIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); -typedef GLuint (APIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); -typedef GLuint (APIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); -typedef GLuint (APIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); -typedef GLuint (APIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value); -typedef GLboolean (APIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); -typedef void (APIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); -typedef void (APIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); +typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); +typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); +typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); +typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); +typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); +typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); +typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); +typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); +typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); +typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); #endif #ifndef GL_ATI_vertex_streams @@ -5128,51 +5128,51 @@ GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum); GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint); GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); -typedef void (APIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); -typedef void (APIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); -typedef void (APIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); -typedef void (APIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); -typedef void (APIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); -typedef void (APIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); -typedef void (APIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); -typedef void (APIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (APIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -typedef void (APIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); -typedef void (APIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); -typedef void (APIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); -typedef void (APIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -typedef void (APIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -typedef void (APIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); -typedef void (APIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); #endif #ifndef GL_ATI_element_array @@ -5182,9 +5182,9 @@ GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *); GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei); GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); -typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); #endif #ifndef GL_SUN_mesh_array @@ -5192,7 +5192,7 @@ typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); +typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); #endif #ifndef GL_SUN_slice_accum @@ -5218,13 +5218,13 @@ GLAPI void APIENTRY glEndOcclusionQueryNV (void); GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *); GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void); -typedef void (APIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); #endif #ifndef GL_NV_point_sprite @@ -5233,8 +5233,8 @@ typedef void (APIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pna GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint); GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); #endif #ifndef GL_NV_texture_shader3 @@ -5254,7 +5254,7 @@ typedef void (APIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); +typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); #endif #ifndef GL_ATI_text_fragment_shader @@ -5274,11 +5274,11 @@ GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei); GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); -typedef void (APIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -typedef void (APIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (APIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); #endif #ifndef GL_APPLE_fence @@ -5293,14 +5293,14 @@ GLAPI void APIENTRY glFinishFenceAPPLE (GLuint); GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint); GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); -typedef void (APIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence); -typedef void (APIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); -typedef void (APIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); +typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); +typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); #endif #ifndef GL_APPLE_vertex_array_object @@ -5311,10 +5311,10 @@ GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *); GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); -typedef void (APIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef GLboolean (APIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); #endif #ifndef GL_APPLE_vertex_array_range @@ -5324,9 +5324,9 @@ GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *); GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *); GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); -typedef void (APIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); -typedef void (APIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); #endif #ifndef GL_APPLE_ycbcr_422 @@ -5342,7 +5342,7 @@ typedef void (APIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLi #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); #endif #ifndef GL_ATI_texture_env_combine3 @@ -5368,12 +5368,12 @@ GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *); GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); -typedef void (APIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); -typedef void (APIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); -typedef void (APIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); #endif #ifndef GL_NV_half_float @@ -5429,52 +5429,52 @@ GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *); GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *); GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); -typedef void (APIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRY * PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRY * PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRY * PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); -typedef void (APIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRY * PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRY * PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); -typedef void (APIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); -typedef void (APIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); -typedef void (APIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); -typedef void (APIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); -typedef void (APIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); -typedef void (APIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); -typedef void (APIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); -typedef void (APIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); -typedef void (APIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); -typedef void (APIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); +typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); +typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); #endif #ifndef GL_NV_pixel_data_range @@ -5483,8 +5483,8 @@ typedef void (APIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *); GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); -typedef void (APIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); #endif #ifndef GL_NV_primitive_restart @@ -5493,8 +5493,8 @@ typedef void (APIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); GLAPI void APIENTRY glPrimitiveRestartNV (void); GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void); -typedef void (APIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); #endif #ifndef GL_NV_texture_expand_normal @@ -5511,8 +5511,8 @@ typedef void (APIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint); GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef GLvoid* (APIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); #endif #ifndef GL_ATI_separate_stencil @@ -5521,8 +5521,8 @@ typedef void (APIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum); GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); #endif #ifndef GL_ATI_vertex_attrib_array_object @@ -5532,9 +5532,9 @@ GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboole GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *); GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); #endif diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h index f0cc2df0750..86827324688 100644 --- a/src/mesa/main/glheader.h +++ b/src/mesa/main/glheader.h @@ -113,7 +113,7 @@ # endif # define GLWINAPI __stdcall # define GLWINAPIV __cdecl -#else +#elif !defined(__SCITECH_SNAP__) /* non-Windows compilation */ # define GLAPI extern # define GLAPIENTRY diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index f6931dc5e7b..72da2a08f96 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -64,7 +64,7 @@ extern void _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint border, - GLenum format, GLenum type, const void *pixels, + GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage); @@ -74,7 +74,7 @@ extern void _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, GLint width, GLint height, GLint depth, GLint border, - GLenum format, GLenum type, const void *pixels, + GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage); @@ -83,7 +83,7 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, extern void _mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint width, - GLenum format, GLenum type, const void *pixels, + GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage); @@ -93,7 +93,7 @@ extern void _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint width, GLint height, - GLenum format, GLenum type, const void *pixels, + GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage); @@ -103,7 +103,7 @@ extern void _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint width, GLint height, GLint depth, - GLenum format, GLenum type, const void *pixels, + GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing, struct gl_texture_object *texObj, struct gl_texture_image *texImage); diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index a8c3dfc03a5..371a6e59a1b 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -41,11 +41,12 @@ /* OpenGL API version */ #define OPENGL_MAJOR 1 #define OPENGL_MINOR 4 +#define OPENGL_PATCH 0 #define OPENGL_VERSION_STRING "1.4" /* To make version comparison easy */ -#define OPENGL_VERSION(a,b) (((a) << 16) + ((b) << 8) + (0)) -#define OPENGL_VERSION_CODE OPENGL_VERSION(OPENGL_MAJOR, OPENGL_MINOR) +#define OPENGL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) +#define OPENGL_VERSION_CODE OPENGL_VERSION(OPENGL_MAJOR, OPENGL_MINOR, OPENGL_PATCH) #endif /* VERSION_H */ diff --git a/src/mesa/tnl/t_eval_api.c b/src/mesa/tnl/t_eval_api.c index 08eb9d35629..294f1b742cf 100644 --- a/src/mesa/tnl/t_eval_api.c +++ b/src/mesa/tnl/t_eval_api.c @@ -120,7 +120,7 @@ _tnl_exec_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) for (i=i1;i<=i2;i++,u+=du) { _tnl_eval_coord1f( ctx, u ); } - _tnl_end(ctx); + _tnl_end_ctx(ctx); /* Need this for replay *and* compile: */ @@ -190,7 +190,7 @@ _tnl_exec_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) _tnl_eval_coord2f( ctx, u, v ); } } - _tnl_end(ctx); + _tnl_end_ctx(ctx); break; case GL_LINE: for (v=v1,j=j1;j<=j2;j++,v+=dv) { @@ -198,14 +198,14 @@ _tnl_exec_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) for (u=u1,i=i1;i<=i2;i++,u+=du) { _tnl_eval_coord2f( ctx, u, v ); } - _tnl_end(ctx); + _tnl_end_ctx(ctx); } for (u=u1,i=i1;i<=i2;i++,u+=du) { _tnl_Begin( GL_LINE_STRIP ); for (v=v1,j=j1;j<=j2;j++,v+=dv) { _tnl_eval_coord2f( ctx, u, v ); } - _tnl_end(ctx); + _tnl_end_ctx(ctx); } break; case GL_FILL: @@ -215,7 +215,7 @@ _tnl_exec_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) _tnl_eval_coord2f( ctx, u, v ); _tnl_eval_coord2f( ctx, u, v+dv ); } - _tnl_end(ctx); + _tnl_end_ctx(ctx); } break; default: diff --git a/src/mesa/tnl/t_imm_api.c b/src/mesa/tnl/t_imm_api.c index 04495043002..c0dcb1863ce 100644 --- a/src/mesa/tnl/t_imm_api.c +++ b/src/mesa/tnl/t_imm_api.c @@ -334,7 +334,7 @@ _tnl_hard_begin( GLcontext *ctx, GLenum p ) * rects/arrays together in a single immediate struct. */ void -_tnl_end( GLcontext *ctx ) +_tnl_end_ctx( GLcontext *ctx ) { struct immediate *IM = TNL_CURRENT_IM(ctx); GLuint state = IM->BeginState; @@ -387,7 +387,7 @@ _tnl_End(void) { GET_CURRENT_CONTEXT(ctx); - _tnl_end( ctx ); + _tnl_end_ctx( ctx ); /* Need to keep save primitive uptodate in COMPILE and * COMPILE_AND_EXEC modes, need to keep exec primitive uptodate diff --git a/src/mesa/tnl/t_imm_api.h b/src/mesa/tnl/t_imm_api.h index 1cb89fd4d1a..a6a06235c7d 100644 --- a/src/mesa/tnl/t_imm_api.h +++ b/src/mesa/tnl/t_imm_api.h @@ -42,7 +42,7 @@ extern void _tnl_End(void); /* TNL-private internal functions for building higher-level operations: */ extern GLboolean _tnl_hard_begin( GLcontext *ctx, GLenum p ); -extern void _tnl_end( GLcontext *ctx ); +extern void _tnl_end_ctx( GLcontext *ctx ); extern void _tnl_vertex2f( GLcontext *ctx, GLfloat x, GLfloat y ); extern void _tnl_eval_coord1f( GLcontext *CC, GLfloat u ); extern void _tnl_eval_coord2f( GLcontext *CC, GLfloat u, GLfloat v ); -- cgit v1.2.3 From a75246f8f5fa951d62b6b40db5bf47517b50d459 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 2 Oct 2003 17:36:43 +0000 Subject: updates from Daniel Borca --- docs/README.DJ | 8 +- include/GL/fxmesa.h | 5 +- progs/samples/Makefile.mgw | 67 ++ src/glut/dos/window.c | 4 +- src/mesa/Makefile.DJ | 3 +- src/mesa/Makefile.mgw | 19 +- src/mesa/drivers/glide/fxapi.c | 783 +++++++------ src/mesa/drivers/glide/fxdd.c | 686 ++++++----- src/mesa/drivers/glide/fxddspan.c | 107 +- src/mesa/drivers/glide/fxddtex.c | 525 ++++----- src/mesa/drivers/glide/fxdrv.h | 84 +- src/mesa/drivers/glide/fxg.c | 2135 +++++++++++++++++++++++++++++++++++ src/mesa/drivers/glide/fxg.h | 352 ++++++ src/mesa/drivers/glide/fxglidew.c | 99 +- src/mesa/drivers/glide/fxglidew.h | 197 +--- src/mesa/drivers/glide/fxopengl.def | 869 ++++++++++---- src/mesa/drivers/glide/fxsetup.c | 443 ++++---- src/mesa/drivers/glide/fxtexman.c | 125 +- src/mesa/drivers/glide/fxtris.c | 534 +++++++-- src/mesa/drivers/glide/fxvb.c | 38 +- src/mesa/drivers/glide/fxvbtmp.h | 34 +- src/mesa/drivers/glide/fxwgl.c | 473 +++++--- src/mesa/x86/assyntax.h | 4 +- 23 files changed, 5572 insertions(+), 2022 deletions(-) create mode 100644 progs/samples/Makefile.mgw create mode 100644 src/mesa/drivers/glide/fxg.c create mode 100644 src/mesa/drivers/glide/fxg.h (limited to 'include') diff --git a/docs/README.DJ b/docs/README.DJ index 9fc7a55c634..da174f4acbd 100644 --- a/docs/README.DJ +++ b/docs/README.DJ @@ -1,12 +1,12 @@ - Mesa 5.0.1 DOS/DJGPP Port v1.4 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Mesa 5.1 DOS/DJGPP Port v1.4 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Description: ~~~~~~~~~~~~ -Well, guess what... this is the DOS port of Mesa 5.0.1, for DJGPP fans... Whoa! +Well, guess what... this is the DOS port of Mesa 5.1, for DJGPP fans... Whoa! The driver has its origins in ddsample.c, written by Brian Paul and found by me in Mesa 3.4.2. @@ -209,7 +209,7 @@ v1.3 (mar-2003) * revamped GLUT * switched to DXE3 -v1.4 (aug-2003) +v1.4 (oct-2003) + enabled GLUT fonts with DXE + truly added multi-window support in GLUT (for Adrian Woodward) * accomodated makefiles with the new sourcetree diff --git a/include/GL/fxmesa.h b/include/GL/fxmesa.h index 42f6ed8d72c..24c38278f50 100644 --- a/include/GL/fxmesa.h +++ b/include/GL/fxmesa.h @@ -38,7 +38,7 @@ extern "C" { #endif -#define FXMESA_MAJOR_VERSION 4 +#define FXMESA_MAJOR_VERSION 5 #define FXMESA_MINOR_VERSION 0 @@ -52,6 +52,7 @@ extern "C" { #define FXMESA_STENCIL_SIZE 13 /* followed by an integer */ #define FXMESA_ACCUM_SIZE 14 /* followed by an integer */ #define FXMESA_COLORDEPTH 20 /* followed by an integer */ +#define FXMESA_SHARE_CONTEXT 990099 /* keep in sync with xmesa1.c! */ @@ -84,7 +85,7 @@ GLAPI void GLAPIENTRY fxMesaSetNearFar(GLfloat nearVal, GLfloat farVal); GLAPI void GLAPIENTRY fxMesaUpdateScreenSize(fxMesaContext ctx); -GLAPI int GLAPIENTRY fxQueryHardware(void); +GLAPI GLboolean GLAPIENTRY fxQueryHardware(void); GLAPI void GLAPIENTRY fxCloseHardware(void); diff --git a/progs/samples/Makefile.mgw b/progs/samples/Makefile.mgw new file mode 100644 index 00000000000..04c4b792534 --- /dev/null +++ b/progs/samples/Makefile.mgw @@ -0,0 +1,67 @@ +# Mesa 3-D graphics library +# Version: 4.0 +# +# Copyright (C) 1999 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# MinGW samples makefile v1.0 for Mesa +# +# Copyright (C) 2002 - Borca Daniel +# Email : dborca@users.sourceforge.net +# Web : http://www.geocities.com/dborca + + +# +# Available options: +# +# Environment variables: +# CPU optimize for the given processor. +# default = pentium +# +# Targets: +# build a specific file +# + + + +.PHONY : all +.SUFFIXES : .c .o .exe + +TOP = ../.. +CPU ?= pentium + +CC = mingw32-gcc +CFLAGS = -Wall -W -pedantic +CFLAGS += -O2 -ffast-math -mcpu=$(CPU) +CFLAGS += -I$(TOP)/include -I../util +CFLAGS += -DGLUT_DISABLE_ATEXIT_HACK +CFLAGS += -D_WINDEF_ -D_WINGDI_ + +LD = mingw32-g++ +LDFLAGS = -s -L$(TOP)/lib + +LDLIBS = -lglut32 -lglu32 -lopengl32 + +.c.o: + $(CC) -o $@ $(CFLAGS) -c $< +.o.exe: + $(LD) -o $@ $(LDFLAGS) $< $(LDLIBS) + +all: + $(error Must specify to build) diff --git a/src/glut/dos/window.c b/src/glut/dos/window.c index af00897f3e5..ed95451e8d1 100644 --- a/src/glut/dos/window.c +++ b/src/glut/dos/window.c @@ -37,7 +37,7 @@ GLUTwindow *g_curwin; static GLuint swaptime, swapcount; -static DMesaVisual visual = NULL; +static DMesaVisual visual = NULL; GLUTwindow *g_windows[MAX_WINDOWS]; @@ -49,7 +49,7 @@ static void clean (void) for (i=1; i<=MAX_WINDOWS; i++) { glutDestroyWindow(i); } - if (visual) DMesaDestroyVisual(visual); + if (visual) DMesaDestroyVisual(visual); pc_close_stdout(); pc_close_stderr(); diff --git a/src/mesa/Makefile.DJ b/src/mesa/Makefile.DJ index b375c05b618..9d9eb05f6d4 100644 --- a/src/mesa/Makefile.DJ +++ b/src/mesa/Makefile.DJ @@ -304,7 +304,8 @@ DRIVER_SOURCES += \ drivers/glide/fxtexman.c \ drivers/glide/fxtris.c \ drivers/glide/fxvb.c \ - drivers/glide/fxglidew.c + drivers/glide/fxglidew.c \ + drivers/glide/fxg.c else ifeq ($(MATROX),1) DRIVER_SOURCES += \ diff --git a/src/mesa/Makefile.mgw b/src/mesa/Makefile.mgw index d8fb47c9328..0834908ec14 100644 --- a/src/mesa/Makefile.mgw +++ b/src/mesa/Makefile.mgw @@ -60,6 +60,7 @@ .PHONY: all clean .INTERMEDIATE: x86/gen_matypes.exe +.SUFFIXES: .rc .res TOP = ../.. GLIDE ?= $(TOP)/glide3 @@ -75,8 +76,9 @@ CFLAGS += -I$(TOP)/include -I. -Imain -Iglapi ifeq ($(FX),1) CFLAGS += -DH3 CFLAGS += -I$(GLIDE)/include -DFX -LDLIBS += -L$(GLIDE)/lib -lglide3 +LDLIBS += -L$(GLIDE)/lib -lglide3x GL_DEF = drivers/glide/fxopengl.def +GL_RES = drivers/glide/fx.rc else GL_DEF = drivers/windows/gdi/mesa.def endif @@ -135,6 +137,7 @@ MAIN_SOURCES = \ main/pixel.c \ main/points.c \ main/polygon.c \ + main/program.c \ main/rastpos.c \ main/state.c \ main/stencil.c \ @@ -293,6 +296,7 @@ DRIVER_SOURCES = \ drivers/glide/fxtris.c \ drivers/glide/fxvb.c \ drivers/glide/fxglidew.c \ + drivers/glide/fxg.c \ drivers/glide/fxwgl.c else DRIVER_SOURCES = \ @@ -306,16 +310,20 @@ OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) X86_OBJECTS = $(addsuffix .o,$(basename $(X86_SOURCES))) +RESOURCE = $(GL_RES:.rc=.res) + .c.o: $(CC) -o $@ $(CFLAGS) -c $< .S.o: $(CC) -o $@ $(CFLAGS) -c $< .s.o: $(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $< +.rc.res: + windres -o $@ -Irc -Ocoff $< all: $(LIBDIR)/$(GL_DLL) $(LIBDIR)/$(GL_IMP) -$(LIBDIR)/$(GL_DLL) $(LIBDIR)/$(GL_IMP): $(OBJECTS) +$(LIBDIR)/$(GL_DLL) $(LIBDIR)/$(GL_IMP): $(OBJECTS) $(RESOURCE) dllwrap -o $(LIBDIR)/$(GL_DLL) --output-lib $(LIBDIR)/$(GL_IMP) --target i386-mingw32 --def $(GL_DEF) $^ $(LDLIBS) $(X86_OBJECTS): x86/matypes.h @@ -326,6 +334,12 @@ x86/matypes.h: x86/gen_matypes.exe x86/gen_matypes.exe: x86/gen_matypes.c $(CC) -o $@ $(CFLAGS) -s $< +# [dBorca] Hack alert: +# use standard API, to work around Win32 @x names +# also glapi_x86.S is protected against __WIN32__ +main/dispatch.o: main/dispatch.c + $(CC) -o $@ $(CFLAGS) -UUSE_X86_ASM -c $< + clean: -$(call UNLINK,array_cache/*.o) -$(call UNLINK,glapi/*.o) @@ -337,3 +351,4 @@ clean: -$(call UNLINK,x86/*.o) -$(call UNLINK,drivers/windows/gdi/*.o) -$(call UNLINK,drivers/glide/*.o) + -$(call UNLINK,drivers/glide/*.res) diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index 451c3a8ce2a..89b4a38a620 100644 --- a/src/mesa/drivers/glide/fxapi.c +++ b/src/mesa/drivers/glide/fxapi.c @@ -1,4 +1,4 @@ -/* $Id: fxapi.c,v 1.37 2003/08/19 15:52:53 brianp Exp $ */ +/* $Id: fxapi.c,v 1.38 2003/10/02 17:36:44 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -44,6 +44,22 @@ #if defined(FX) #include "fxdrv.h" +#ifndef TDFX_DEBUG +int TDFX_DEBUG = (0 +/* | VERBOSE_VARRAY */ +/* | VERBOSE_TEXTURE */ +/* | VERBOSE_IMMEDIATE */ +/* | VERBOSE_PIPELINE */ +/* | VERBOSE_DRIVER */ +/* | VERBOSE_STATE */ +/* | VERBOSE_API */ +/* | VERBOSE_DISPLAY_LIST */ +/* | VERBOSE_LIGHTING */ +/* | VERBOSE_PRIMS */ +/* | VERBOSE_VERTS */ + ); +#endif + static fxMesaContext fxMesaCurrentCtx = NULL; /* @@ -54,8 +70,8 @@ static int glbGlideInitialized = 0; static int glb3DfxPresent = 0; static int glbTotNumCtx = 0; -GrHwConfiguration glbHWConfig; -int glbCurrentBoard = 0; +static GrHwConfiguration glbHWConfig; +static int glbCurrentBoard = 0; #if defined(__WIN32__) @@ -78,7 +94,7 @@ cleangraphics(void) static void cleangraphics_handler(int s) { - fprintf(stderr, "fxmesa: Received a not handled signal %d\n", s); + fprintf(stderr, "fxmesa: ERROR: received a not handled signal %d\n", s); cleangraphics(); /* abort(); */ @@ -91,8 +107,7 @@ cleangraphics_handler(int s) * Select the Voodoo board to use when creating * a new context. */ -GLboolean GLAPIENTRY -fxMesaSelectCurrentBoard(int n) +GLboolean GLAPIENTRY fxMesaSelectCurrentBoard (int n) { fxQueryHardware(); @@ -142,13 +157,14 @@ gl3DfxSetPaletteEXT(GLuint * pal) { fxMesaContext fxMesa = fxMesaCurrentCtx; - if (MESA_VERBOSE & VERBOSE_DRIVER) { + if (TDFX_DEBUG & VERBOSE_DRIVER) { int i; - fprintf(stderr, "fxmesa: gl3DfxSetPaletteEXT()\n"); + fprintf(stderr, "%s(...)\n", __FUNCTION__); - for (i = 0; i < 256; i++) - fprintf(stderr, "%x\n", pal[i]); + for (i = 0; i < 256; i++) { + fprintf(stderr, "\t%x\n", pal[i]); + } } if (fxMesa) { @@ -159,53 +175,34 @@ gl3DfxSetPaletteEXT(GLuint * pal) } -static GrScreenResolution_t -fxBestResolution(int width, int height, int aux) +static GrScreenResolution_t fxBestResolution (int width, int height) { - static int resolutions[][5] = { - {320, 200, GR_RESOLUTION_320x200, 2, 2}, - {320, 240, GR_RESOLUTION_320x240, 2, 2}, - {512, 384, GR_RESOLUTION_512x384, 2, 2}, - {640, 400, GR_RESOLUTION_640x400, 2, 2}, - {640, 480, GR_RESOLUTION_640x480, 2, 2}, - {800, 600, GR_RESOLUTION_800x600, 4, 2}, - {960, 720, GR_RESOLUTION_960x720, 6, 4} -#ifdef GR_RESOLUTION_1024x768 - , {1024, 768, GR_RESOLUTION_1024x768, 8, 4} -#endif -#ifdef GR_RESOLUTION_1280x1024 - , {1280, 1024, GR_RESOLUTION_1280x1024, 8, 8} -#endif -#ifdef GR_RESOLUTION_1600x1200 - , {1600, 1200, GR_RESOLUTION_1600x1200, 16, 8} -#endif - }; - int NUM_RESOLUTIONS = sizeof(resolutions) / (sizeof(int) * 5); - int i, fbmem; - GrScreenResolution_t lastvalidres = resolutions[4][2]; - - fxQueryHardware(); - - fbmem = glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig.fbRam - * glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig.numChips; - - /* A work around for BZFlag */ - - if ((width == 1) && (height == 1)) { - width = 640; - height = 480; - } - - for (i = 0; i < NUM_RESOLUTIONS; i++) { - if (resolutions[i][4 - aux] <= fbmem) { - if ((width <= resolutions[i][0]) && (height <= resolutions[i][1])) { - return resolutions[i][2]; - } - lastvalidres = resolutions[i][2]; - } - } + static int resolutions[][5] = { + { 320, 200, GR_RESOLUTION_320x200 }, + { 320, 240, GR_RESOLUTION_320x240 }, + { 512, 384, GR_RESOLUTION_512x384 }, + { 640, 400, GR_RESOLUTION_640x400 }, + { 640, 480, GR_RESOLUTION_640x480 }, + { 800, 600, GR_RESOLUTION_800x600 }, + {1024, 768, GR_RESOLUTION_1024x768 }, + {1280, 1024, GR_RESOLUTION_1280x1024}, + {1600, 1200, GR_RESOLUTION_1600x1200}, + }; + + int i, NUM_RESOLUTIONS = sizeof(resolutions) / sizeof(resolutions[0]); + int lastvalidres = 4; /* set default to GR_RESOLUTION_640x480 */ + int min = 2048 * 2048; /* max is GR_RESOLUTION_2048x2048 */ + + for (i = 0; i < NUM_RESOLUTIONS; i++) { + if ((width <= resolutions[i][0]) && (height <= resolutions[i][1])) { + if (min > (resolutions[i][0] * resolutions[i][1])) { + min = resolutions[i][0] * resolutions[i][1]; + lastvalidres = i; + } + } + } - return lastvalidres; + return resolutions[lastvalidres][2]; } @@ -213,63 +210,16 @@ fxMesaContext GLAPIENTRY fxMesaCreateBestContext(GLuint win, GLint width, GLint height, const GLint attribList[]) { - GrScreenRefresh_t refresh; - int i; - int res, aux; - refresh = GR_REFRESH_75Hz; - - if (getenv("SST_SCREENREFRESH")) { - if (!strcmp(getenv("SST_SCREENREFRESH"), "60")) - refresh = GR_REFRESH_60Hz; - if (!strcmp(getenv("SST_SCREENREFRESH"), "70")) - refresh = GR_REFRESH_70Hz; - if (!strcmp(getenv("SST_SCREENREFRESH"), "72")) - refresh = GR_REFRESH_72Hz; - if (!strcmp(getenv("SST_SCREENREFRESH"), "75")) - refresh = GR_REFRESH_75Hz; - if (!strcmp(getenv("SST_SCREENREFRESH"), "80")) - refresh = GR_REFRESH_80Hz; - if (!strcmp(getenv("SST_SCREENREFRESH"), "85")) - refresh = GR_REFRESH_85Hz; - if (!strcmp(getenv("SST_SCREENREFRESH"), "90")) - refresh = GR_REFRESH_90Hz; - if (!strcmp(getenv("SST_SCREENREFRESH"), "100")) - refresh = GR_REFRESH_100Hz; - if (!strcmp(getenv("SST_SCREENREFRESH"), "120")) - refresh = GR_REFRESH_120Hz; - } - - aux = 0; - for (i = 0; attribList[i] != FXMESA_NONE; i++) - if ((attribList[i] == FXMESA_ALPHA_SIZE) || - (attribList[i] == FXMESA_DEPTH_SIZE)) { - if (attribList[++i] > 0) { - aux = 1; - break; - } - } + int res = fxBestResolution(width, height); - res = fxBestResolution(width, height, aux); + if (res == -1) { + return NULL; + } - return fxMesaCreateContext(win, res, refresh, attribList); + return fxMesaCreateContext(win, res, GR_REFRESH_60Hz/*ZZZ: GR_REFRESH_75Hz*/, attribList); } -#if 0 -void -fxsignals() -{ - signal(SIGINT, SIG_IGN); - signal(SIGHUP, SIG_IGN); - signal(SIGPIPE, SIG_IGN); - signal(SIGFPE, SIG_IGN); - signal(SIGBUS, SIG_IGN); - signal(SIGILL, SIG_IGN); - signal(SIGSEGV, SIG_IGN); - signal(SIGTERM, SIG_IGN); -} -#endif - /* * Create a new FX/Mesa context and return a handle to it. */ @@ -278,149 +228,269 @@ fxMesaCreateContext(GLuint win, GrScreenResolution_t res, GrScreenRefresh_t ref, const GLint attribList[]) { - fxMesaContext fxMesa = NULL; - int i, type; - int aux; - GLboolean doubleBuffer = GL_FALSE; - GLboolean alphaBuffer = GL_FALSE; - GLboolean verbose = GL_FALSE; - GLint depthSize = 0; - GLint stencilSize = 0; - GLint accumSize = 0; - GLcontext *shareCtx = NULL; - GLcontext *ctx = 0; - /*FX_GrContext_t glideContext = 0; */ - char *errorstr; - GLboolean useBGR; - GLuint pixFmt, colDepth = 16; - GLint redBits, greenBits, blueBits, alphaBits; - - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxMesaCreateContext() Start\n"); - } + fxMesaContext fxMesa = NULL; + GLcontext *ctx = NULL, *shareCtx = NULL; + + int i; + const char *str; + int numChips, sliaa, fsaa; + struct SstCard_St *voodoo; + struct tdfx_glide *Glide; + + GLboolean aux; + GLboolean doubleBuffer; + GLuint colDepth; + GLuint depthSize, alphaSize, stencilSize, accumSize; + GLuint redBits, greenBits, blueBits, alphaBits; + GrPixelFormat_t pixFmt; + + GLboolean useBGR; + GLboolean verbose = GL_FALSE; + + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); + } - if (getenv("MESA_FX_INFO")) - verbose = GL_TRUE; - - aux = 0; - i = 0; - while (attribList[i] != FXMESA_NONE) { - switch (attribList[i]) { - case FXMESA_COLORDEPTH: - colDepth = attribList[++i]; - break; - case FXMESA_DOUBLEBUFFER: - doubleBuffer = GL_TRUE; - break; - case FXMESA_ALPHA_SIZE: - i++; - alphaBuffer = attribList[i] > 0; - if (alphaBuffer) { - aux = 1; - } - break; - case FXMESA_DEPTH_SIZE: - i++; - depthSize = attribList[i]; - if (depthSize) { - aux = 1; - } - break; - case FXMESA_STENCIL_SIZE: - i++; - stencilSize = attribList[i]; - break; - case FXMESA_ACCUM_SIZE: - i++; - accumSize = attribList[i]; - break; - /* XXX ugly hack here for sharing display lists */ -#define FXMESA_SHARE_CONTEXT 990099 /* keep in sync with xmesa1.c! */ - case FXMESA_SHARE_CONTEXT: - i++; - { - const void *vPtr = &attribList[i]; - GLcontext **ctx = (GLcontext **) vPtr; - shareCtx = *ctx; - } - break; - default: - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: bad FXMESA_* switch\n"); - } - return NULL; - } - i++; - } + if (getenv("MESA_FX_INFO")) { + verbose = GL_TRUE; + } - if (depthSize) { - depthSize = (colDepth == 32) ? 24 : 16; - } + /* Okay, first process the user flags */ + aux = GL_FALSE; + doubleBuffer = GL_FALSE; + colDepth = 16; + depthSize = alphaSize = stencilSize = accumSize = 0; + + i = 0; + while (attribList[i] != FXMESA_NONE) { + switch (attribList[i]) { + case FXMESA_COLORDEPTH: + colDepth = attribList[++i]; + break; + case FXMESA_DOUBLEBUFFER: + doubleBuffer = GL_TRUE; + break; + case FXMESA_ALPHA_SIZE: + if ((alphaSize = attribList[++i])) { + aux = GL_TRUE; + } + break; + case FXMESA_DEPTH_SIZE: + if ((depthSize = attribList[++i])) { + aux = GL_TRUE; + } + break; + case FXMESA_STENCIL_SIZE: + stencilSize = attribList[++i]; + break; + case FXMESA_ACCUM_SIZE: + accumSize = attribList[++i]; + break; + /* XXX ugly hack here for sharing display lists */ + case FXMESA_SHARE_CONTEXT: + { + const void *vPtr = &attribList[++i]; + GLcontext **ctx = (GLcontext **)vPtr; + shareCtx = *ctx; + } + break; + default: + fprintf(stderr, "%s: ERROR: wrong parameter (%d) passed\n", __FUNCTION__, attribList[i]); + return NULL; + } + i++; + } - /* A workaround for Linux GLQuake */ - if (depthSize && alphaBuffer) - alphaBuffer = 0; + if (!fxQueryHardware()) { + fprintf(stderr, "%s: ERROR: no Voodoo hardware!\n", __FUNCTION__); + return NULL; + } - if ((type = fxQueryHardware()) < 0) { - fprintf(stderr, "fxmesa: ERROR no Voodoo hardware!\n"); - return NULL; - } + grSstSelect(glbCurrentBoard); + /*grEnable(GR_OPENGL_MODE_EXT);*/ /* ZZZ: trick to make GL happy. + Glide3 will unmap memory for card when grSstWinClose is called. + This also forces the SLI band height to be 32 (above 1024x768) or 16 + and disables the splash screen due to y-origin swapping. + Note: We only want the former. */ + voodoo = &glbHWConfig.SSTs[glbCurrentBoard]; + numChips = voodoo->numChips; + + fxMesa = (fxMesaContext)CALLOC_STRUCT(tfxMesaContext); + if (!fxMesa) { + str = "private context"; + goto errorhandler; + } - grSstSelect(glbCurrentBoard); + fxMesa->type = voodoo->type; + fxMesa->HavePixExt = voodoo->HavePixExt; + fxMesa->HaveTexFmt = voodoo->HaveTexFmt; + fxMesa->HaveCmbExt = voodoo->HaveCmbExt; + fxMesa->HaveMirExt = voodoo->HaveMirExt; + fxMesa->HaveTexus2 = voodoo->HaveTexus2; + fxMesa->Glide = glbHWConfig.Glide; + Glide = &fxMesa->Glide; + sprintf(fxMesa->rendererString, "Mesa %s v0.51 %s %dMB FB, %dMB TM, %d TMU, %s", + grGetString(GR_RENDERER), + grGetString(GR_HARDWARE), + voodoo->fbRam, + (voodoo->tmuConfig[GR_TMU0].tmuRam + ((voodoo->nTexelfx > 1) ? voodoo->tmuConfig[GR_TMU1].tmuRam : 0)), + voodoo->nTexelfx, + (numChips > 1) ? "SLI" : "NOSLI"); + + switch (fxMesa->colDepth = colDepth) { + case 15: + redBits = 5; + greenBits = 5; + blueBits = 5; + alphaBits = 1; + pixFmt = GR_PIXFMT_ARGB_1555; + break; + case 16: + redBits = 5; + greenBits = 6; + blueBits = 5; + alphaBits = depthSize ? 0 : 8; + pixFmt = GR_PIXFMT_RGB_565; + break; + case 32: + redBits = 8; + greenBits = 8; + blueBits = 8; + alphaBits = 8; + pixFmt = GR_PIXFMT_ARGB_8888; + break; + default: + str = "pixelFormat"; + goto errorhandler; + } - fxMesa = (fxMesaContext) calloc(1, sizeof(struct tfxMesaContext)); - if (!fxMesa) { - errorstr = "malloc"; - goto errorhandler; - } + /* Tips: + * 1. we don't bother setting/checking AUX for stencil, because we'll decide + * later whether we have HW stencil, based on depth buffer (thus AUX is + * properly set) + * 2. when both DEPTH and ALPHA are enabled, depth should win. However, it is + * not clear whether 15bpp and 32bpp require AUX alpha buffer. Furthermore, + * alpha buffering is required only if destination alpha is used in alpha + * blending; alpha blending modes that do not use destination alpha can be + * used w/o alpha buffer. + * 3. `alphaBits' is what we can provide + * `alphaSize' is what app requests + * if we cannot provide enough bits for alpha buffer, we should fallback to + * SW alpha. However, setting `alphaBits' to `alphaSize' might confuse some + * of the span functions... + */ + + fxMesa->haveHwAlpha = GL_FALSE; + if (alphaSize && (alphaSize <= alphaBits)) { + alphaSize = alphaBits; + fxMesa->haveHwAlpha = GL_TRUE; + } - fxMesa->haveTwoTMUs = (glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig.nTexelfx > 1); - fxMesa->haveDoubleBuffer = doubleBuffer; - fxMesa->haveAlphaBuffer = alphaBuffer; - fxMesa->haveGlobalPaletteTexture = GL_FALSE; - fxMesa->haveZBuffer = depthSize ? 1 : 0; - fxMesa->verbose = verbose; - fxMesa->board = glbCurrentBoard; - fxMesa->maxTextureSize = glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig.maxTextureSize; /* [koolsmoky] */ - - - switch (fxMesa->colDepth = colDepth) { - case 15: - redBits = 5; - greenBits = 5; - blueBits = 5; - alphaBits = 1; - pixFmt = GR_PIXFMT_ARGB_1555; - break; - case 16: - redBits = 5; - greenBits = 6; - blueBits = 5; - alphaBits = 0; - pixFmt = GR_PIXFMT_RGB_565; - break; - case 32: - redBits = 8; - greenBits = 8; - blueBits = 8; - alphaBits = 8; - pixFmt = GR_PIXFMT_ARGB_8888; - break; - default: - errorstr = "pixelFormat"; - goto errorhandler; - } + fxMesa->haveHwStencil = (fxMesa->HavePixExt && stencilSize && depthSize == 24); + fxMesa->haveZBuffer = depthSize > 0; + fxMesa->haveDoubleBuffer = doubleBuffer; + fxMesa->haveGlobalPaletteTexture = GL_FALSE; + fxMesa->verbose = verbose; + fxMesa->board = glbCurrentBoard; - fxMesa->glideContext = FX_grSstWinOpen(&glbHWConfig.SSTs[glbCurrentBoard], - (FxU32)win, res, ref, - GR_COLORFORMAT_ABGR, - pixFmt, - GR_ORIGIN_LOWER_LEFT, 2, aux); - if (!fxMesa->glideContext) { - errorstr = "grSstWinOpen"; - goto errorhandler; - } + fxMesa->haveTwoTMUs = (voodoo->nTexelfx > 1); + + if ((str = Glide->grGetRegistryOrEnvironmentStringExt("FX_GLIDE_NUM_TMU"))) { + if (atoi(str) <= 1) { + fxMesa->haveTwoTMUs = GL_FALSE; + } + } + + if ((str = Glide->grGetRegistryOrEnvironmentStringExt("FX_GLIDE_SWAPPENDINGCOUNT"))) { + fxMesa->maxPendingSwapBuffers = atoi(str); + if (fxMesa->maxPendingSwapBuffers > 3) { + fxMesa->maxPendingSwapBuffers = 3; + } else if (fxMesa->maxPendingSwapBuffers < 0) { + fxMesa->maxPendingSwapBuffers = 0; + } + } else { + fxMesa->maxPendingSwapBuffers = 2; + } + + if ((str = Glide->grGetRegistryOrEnvironmentStringExt("FX_GLIDE_SWAPINTERVAL"))) { + fxMesa->swapInterval = atoi(str); + } else { + fxMesa->swapInterval = 0; + } + + if ((str = Glide->grGetRegistryOrEnvironmentStringExt("SSTH3_SLI_AA_CONFIGURATION"))) { + sliaa = atoi(str); + } else { + sliaa = 0; + } + switch (colDepth) { + case 15: + if ((numChips == 4) && (sliaa == 8)) { + pixFmt = GR_PIXFMT_AA_8_ARGB_1555; + fsaa = 8; + } else if (((numChips == 4) && (sliaa == 7)) || ((numChips == 2) && (sliaa == 4))) { + pixFmt = GR_PIXFMT_AA_4_ARGB_1555; + fsaa = 4; + } else if (((numChips == 4) && (sliaa == 6)) || ((numChips == 2) && (sliaa == 3)) || ((numChips == 1) && (sliaa == 1))) { + pixFmt = GR_PIXFMT_AA_2_ARGB_1555; + fsaa = 2; + } else { + fsaa = 0; + } + break; + case 16: + if ((numChips == 4) && (sliaa == 8)) { + pixFmt = GR_PIXFMT_AA_8_RGB_565; + fsaa = 8; + } else if (((numChips == 4) && (sliaa == 7)) || ((numChips == 2) && (sliaa == 4))) { + pixFmt = GR_PIXFMT_AA_4_RGB_565; + fsaa = 4; + } else if (((numChips == 4) && (sliaa == 6)) || ((numChips == 2) && (sliaa == 3)) || ((numChips == 1) && (sliaa == 1))) { + pixFmt = GR_PIXFMT_AA_2_RGB_565; + fsaa = 2; + } else { + fsaa = 0; + } + break; + case 32: + if ((numChips == 4) && (sliaa == 8)) { + pixFmt = GR_PIXFMT_AA_8_ARGB_8888; + fsaa = 8; + } else if (((numChips == 4) && (sliaa == 7)) || ((numChips == 2) && (sliaa == 4))) { + pixFmt = GR_PIXFMT_AA_4_ARGB_8888; + fsaa = 4; + } else if (((numChips == 4) && (sliaa == 6)) || ((numChips == 2) && (sliaa == 3)) || ((numChips == 1) && (sliaa == 1))) { + pixFmt = GR_PIXFMT_AA_2_ARGB_8888; + fsaa = 2; + } else { + fsaa = 0; + } + break; + default: /* NOTREACHED */ + str = "pixelFormat"; + goto errorhandler; + } + fxMesa->fsaa = fsaa; + + BEGIN_BOARD_LOCK(); + if (fxMesa->HavePixExt) { + fxMesa->glideContext = Glide->grSstWinOpenExt((FxU32)win, res, ref, + GR_COLORFORMAT_ABGR, GR_ORIGIN_LOWER_LEFT, + pixFmt, + 2, aux); + } else if (pixFmt == GR_PIXFMT_RGB_565) { + fxMesa->glideContext = grSstWinOpen((FxU32)win, res, ref, + GR_COLORFORMAT_ABGR, GR_ORIGIN_LOWER_LEFT, + 2, aux); + } else { + fxMesa->glideContext = 0; + } + END_BOARD_LOCK(); + if (!fxMesa->glideContext) { + str = "grSstWinOpen"; + goto errorhandler; + } /* * Pixel tables are used during pixel read-back @@ -429,7 +499,7 @@ fxMesaCreateContext(GLuint win, * As a consequence, 32bit read-back is not swizzled! * Also determine if we need vertex snapping. */ - switch (glbHWConfig.SSTs[glbCurrentBoard].type) { + switch (voodoo->type) { case GR_SSTTYPE_VOODOO: case GR_SSTTYPE_Banshee: useBGR = GL_TRUE; @@ -448,12 +518,6 @@ fxMesaCreateContext(GLuint win, break; } - if (verbose) { - fprintf(stderr, "Voodoo pixel order = %s, vertex snapping = %d\n", - useBGR ? "BGR" : "RGB", - fxMesa->snapVertices); - } - fxInitPixelTables(fxMesa, useBGR); fxMesa->width = FX_grSstScreenWidth(); @@ -467,22 +531,40 @@ fxMesaCreateContext(GLuint win, fxMesa->screen_width = fxMesa->width; fxMesa->screen_height = fxMesa->height; - fxMesa->new_state = ~0; - - if (verbose) - fprintf(stderr, "Voodoo screen: %dx%dx%d\n", - (int)FX_grSstScreenWidth(), (int)FX_grSstScreenHeight(), colDepth); - - fxMesa->glVis = _mesa_create_visual(GL_TRUE, /* RGB mode */ - doubleBuffer, GL_FALSE, /* stereo */ - redBits, greenBits, blueBits, alphaBits, /* RGBA bits */ - 0, /* index bits */ + if (verbose) { + char buf[80]; + + strcpy(buf, grGetString(GR_VERSION)); + fprintf(stderr, "Voodoo Using Glide %s\n", buf); + fprintf(stderr, "Voodoo Number of boards: %d\n", glbHWConfig.num_sst); + fprintf(stderr, "Voodoo Number of TMUs: %d\n", voodoo->nTexelfx); + fprintf(stderr, "Voodoo fbRam: %d\n", voodoo->fbRam); + fprintf(stderr, "Voodoo fbiRev: %d\n", voodoo->fbiRev); + fprintf(stderr, "Voodoo chips detected: %d\n", voodoo->numChips); + fprintf(stderr, "Voodoo pixel order = %s, vertex snapping = %d\n", + useBGR ? "BGR" : "RGB", + fxMesa->snapVertices); + fprintf(stderr, "Voodoo screen: %dx%d.%d\n", + fxMesa->screen_width, fxMesa->screen_height, colDepth); + } + + fxMesa->glVis = _mesa_create_visual(GL_TRUE, /* RGB mode */ + doubleBuffer, + GL_FALSE, /* stereo */ + redBits, /* RGBA.R bits */ + greenBits, /* RGBA.G bits */ + blueBits, /* RGBA.B bits */ + alphaSize, /* RGBA.A bits */ + 0, /* index bits */ depthSize, /* depth_size */ stencilSize, /* stencil_size */ - accumSize, accumSize, accumSize, - accumSize, 1); + accumSize, + accumSize, + accumSize, + alphaSize ? accumSize : 0, + 1); if (!fxMesa->glVis) { - errorstr = "_mesa_create_visual"; + str = "_mesa_create_visual"; goto errorhandler; } @@ -490,24 +572,24 @@ fxMesaCreateContext(GLuint win, shareCtx, (void *) fxMesa, GL_TRUE); if (!ctx) { - errorstr = "_mesa_create_context"; + str = "_mesa_create_context"; goto errorhandler; } if (!fxDDInitFxMesaContext(fxMesa)) { - errorstr = "fxDDInitFxMesaContext failed"; + str = "fxDDInitFxMesaContext"; goto errorhandler; } - fxMesa->glBuffer = _mesa_create_framebuffer(fxMesa->glVis, GL_FALSE, /* no software depth */ - fxMesa->glVis->stencilBits > 0, - fxMesa->glVis->accumRedBits > - 0, - fxMesa->glVis->alphaBits > 0); + fxMesa->glBuffer = _mesa_create_framebuffer(fxMesa->glVis, + GL_FALSE, /* no software depth */ + stencilSize && !fxMesa->haveHwStencil, + fxMesa->glVis->accumRedBits > 0, + alphaSize && !fxMesa->haveHwAlpha); if (!fxMesa->glBuffer) { - errorstr = "_mesa_create_framebuffer"; + str = "_mesa_create_framebuffer"; goto errorhandler; } @@ -528,35 +610,35 @@ fxMesaCreateContext(GLuint win, } #endif - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxMesaCreateContext() End\n"); - } - return fxMesa; - errorhandler: - if (fxMesa) { - if (fxMesa->glideContext) - grSstWinClose(fxMesa->glideContext); - fxMesa->glideContext = 0; - - if (fxMesa->state) - free(fxMesa->state); - if (fxMesa->fogTable) - free(fxMesa->fogTable); - if (fxMesa->glBuffer) - _mesa_destroy_framebuffer(fxMesa->glBuffer); - if (fxMesa->glVis) - _mesa_destroy_visual(fxMesa->glVis); - if (fxMesa->glCtx) - _mesa_destroy_context(fxMesa->glCtx); - free(fxMesa); - } +errorhandler: + if (fxMesa) { + if (fxMesa->glideContext) { + grSstWinClose(fxMesa->glideContext); + fxMesa->glideContext = 0; + } + + if (fxMesa->state) { + FREE(fxMesa->state); + } + if (fxMesa->fogTable) { + FREE(fxMesa->fogTable); + } + if (fxMesa->glBuffer) { + _mesa_destroy_framebuffer(fxMesa->glBuffer); + } + if (fxMesa->glVis) { + _mesa_destroy_visual(fxMesa->glVis); + } + if (fxMesa->glCtx) { + _mesa_destroy_context(fxMesa->glCtx); + } + FREE(fxMesa); + } - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: ERROR (%s)\n", errorstr); - } - return NULL; + fprintf(stderr, "%s: ERROR: %s\n", __FUNCTION__, str); + return NULL; } @@ -577,8 +659,8 @@ fxMesaUpdateScreenSize(fxMesaContext fxMesa) void GLAPIENTRY fxMesaDestroyContext(fxMesaContext fxMesa) { - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxMesaDestroyContext()\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } if (!fxMesa) @@ -621,10 +703,10 @@ fxMesaDestroyContext(fxMesaContext fxMesa) _mesa_destroy_context(fxMesa->glCtx); _mesa_destroy_framebuffer(fxMesa->glBuffer); - fxCloseHardware(); grSstWinClose(fxMesa->glideContext); + fxCloseHardware(); - free(fxMesa); + FREE(fxMesa); if (fxMesa == fxMesaCurrentCtx) fxMesaCurrentCtx = NULL; @@ -637,16 +719,12 @@ fxMesaDestroyContext(fxMesaContext fxMesa) void GLAPIENTRY fxMesaMakeCurrent(fxMesaContext fxMesa) { - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxMesaMakeCurrent(...) Start\n"); - } - if (!fxMesa) { _mesa_make_current(NULL, NULL); fxMesaCurrentCtx = NULL; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxMesaMakeCurrent(NULL) End\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(NULL)\n", __FUNCTION__); } return; @@ -655,14 +733,17 @@ fxMesaMakeCurrent(fxMesaContext fxMesa) /* if this context is already the current one, we can return early */ if (fxMesaCurrentCtx == fxMesa && fxMesaCurrentCtx->glCtx == _mesa_get_current_context()) { - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, - "fxmesa: fxMesaMakeCurrent(fxMesaCurrentCtx==fxMesa) End\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(fxMesaCurrentCtx==fxMesa)\n", __FUNCTION__); } return; } + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); + } + if (fxMesaCurrentCtx) grGlideGetState((GrState *) fxMesaCurrentCtx->state); @@ -678,43 +759,17 @@ fxMesaMakeCurrent(fxMesaContext fxMesa) /* The first time we call MakeCurrent we set the initial viewport size */ if (fxMesa->glCtx->Viewport.Width == 0) _mesa_set_viewport(fxMesa->glCtx, 0, 0, fxMesa->width, fxMesa->height); - - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxMesaMakeCurrent(...) End\n"); - } } -#if 0 -static void -QueryCounters(void) -{ - static GLuint prevPassed = 0; - static GLuint prevFailed = 0; - GLuint failed, passed; - GrSstPerfStats_t st; - - FX_grSstPerfStats(&st); - failed = st.zFuncFail - st.aFuncFail - st.chromaFail; - passed = st.pixelsIn - failed; - printf("failed: %d passed: %d\n", failed - prevFailed, - passed - prevPassed); - - prevPassed = passed; - prevFailed = failed; -} -#endif - - /* * Swap front/back buffers for current context if double buffered. */ void GLAPIENTRY fxMesaSwapBuffers(void) { - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, - "fxmesa: ------------------------------- fxMesaSwapBuffers() -------------------------------\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s()\n", __FUNCTION__); } if (fxMesaCurrentCtx) { @@ -745,53 +800,29 @@ fxMesaSwapBuffers(void) /* * Query 3Dfx hardware presence/kind */ -int GLAPIENTRY -fxQueryHardware(void) +GLboolean GLAPIENTRY fxQueryHardware (void) { - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxQueryHardware() Start\n"); - } + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s()\n", __FUNCTION__); + } - if (!glbGlideInitialized) { - grGlideInit(); - if (FX_grSstQueryHardware(&glbHWConfig)) { - grSstSelect(glbCurrentBoard); - glb3DfxPresent = 1; - - if (getenv("MESA_FX_INFO")) { - char buf[80]; - GrVoodooConfig_t *voodoo = &glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig; - - strcpy(buf, grGetString(GR_VERSION)); - fprintf(stderr, "Voodoo Using Glide %s\n", buf); - fprintf(stderr, "Voodoo Number of boards: %d\n", glbHWConfig.num_sst); - fprintf(stderr, "Voodoo Number of TMUs: %d\n", voodoo->nTexelfx); - fprintf(stderr, "Voodoo fbRam: %d\n", voodoo->fbRam); - fprintf(stderr, "Voodoo fbiRev: %d\n", voodoo->fbiRev); - fprintf(stderr, "Voodoo chips detected: %d\n", voodoo->numChips); - } - } - else { - glb3DfxPresent = 0; - } + if (!glbGlideInitialized) { + grGlideInit(); + glb3DfxPresent = FX_grSstQueryHardware(&glbHWConfig); - glbGlideInitialized = 1; + glbGlideInitialized = 1; #if defined(__WIN32__) - _onexit((_onexit_t) cleangraphics); + _onexit((_onexit_t) cleangraphics); #elif defined(__linux__) - /* Only register handler if environment variable is not defined. */ - if (!getenv("MESA_FX_NO_SIGNALS")) { - atexit(cleangraphics); - } + /* Only register handler if environment variable is not defined. */ + if (!getenv("MESA_FX_NO_SIGNALS")) { + atexit(cleangraphics); + } #endif - } - - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxQueryHardware() End (voodooo)\n"); - } + } - return glbHWConfig.SSTs[glbCurrentBoard].type; + return glb3DfxPresent; } @@ -802,7 +833,7 @@ void GLAPIENTRY fxCloseHardware(void) { if (glbGlideInitialized) { - if (getenv("MESA_FX_INFO")) { + if (fxMesaCurrentCtx && fxMesaCurrentCtx->verbose) { GrSstPerfStats_t st; FX_grSstPerfStats(&st); diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 3b58eb0535d..09844a6e2a8 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -2,7 +2,7 @@ * fxDDReadPixels888 does not convert 8A8R8G8B into 5R5G5B */ -/* $Id: fxdd.c,v 1.99 2003/08/19 15:52:53 brianp Exp $ */ +/* $Id: fxdd.c,v 1.100 2003/10/02 17:36:44 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -63,8 +63,6 @@ -float gl_ubyte_to_float_255_color_tab[256]; - /* These lookup table are used to extract RGB values in [0,255] from * 16-bit pixel values. */ @@ -72,6 +70,12 @@ GLubyte FX_PixelToR[0x10000]; GLubyte FX_PixelToG[0x10000]; GLubyte FX_PixelToB[0x10000]; +/* lookup table for scaling 4 bit colors up to 8 bits */ +GLuint FX_rgb_scale_4[16] = { + 0, 17, 34, 51, 68, 85, 102, 119, + 136, 153, 170, 187, 204, 221, 238, 255 +}; + /* lookup table for scaling 5 bit colors up to 8 bits */ GLuint FX_rgb_scale_5[32] = { 0, 8, 16, 25, 33, 41, 49, 58, @@ -80,6 +84,18 @@ GLuint FX_rgb_scale_5[32] = { 197, 206, 214, 222, 230, 239, 247, 255 }; +/* lookup table for scaling 6 bit colors up to 8 bits */ +GLuint FX_rgb_scale_6[64] = { + 0, 4, 8, 12, 16, 20, 24, 28, + 32, 36, 40, 45, 49, 53, 57, 61, + 65, 69, 73, 77, 81, 85, 89, 93, + 97, 101, 105, 109, 113, 117, 121, 125, + 130, 134, 138, 142, 146, 150, 154, 158, + 162, 166, 170, 174, 178, 182, 186, 190, + 194, 198, 202, 206, 210, 215, 219, 223, + 227, 231, 235, 239, 243, 247, 251, 255 +}; + /* * Initialize the FX_PixelTo{RGB} arrays. @@ -120,22 +136,18 @@ fxInitPixelTables(fxMesaContext fxMesa, GLboolean bgrOrder) /* Return buffer size information */ static void -fxDDBufferSize(GLframebuffer *buffer, GLuint * width, GLuint * height) +fxDDBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height) { GET_CURRENT_CONTEXT(ctx); - if (ctx && ctx->DriverCtx) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + if (ctx && FX_CONTEXT(ctx)) { + fxMesaContext fxMesa = FX_CONTEXT(ctx); - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDBufferSize(...) Start\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } *width = fxMesa->width; *height = fxMesa->height; - - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDBufferSize(...) End\n"); - } } } @@ -144,11 +156,11 @@ fxDDBufferSize(GLframebuffer *buffer, GLuint * width, GLuint * height) static void fxDDClearColor(GLcontext * ctx, const GLfloat color[4]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GLubyte col[4]; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDClearColor(%f,%f,%f,%f)\n", + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(%f, %f, %f, %f)\n", __FUNCTION__, color[0], color[1], color[2], color[3]); } @@ -163,122 +175,264 @@ fxDDClearColor(GLcontext * ctx, const GLfloat color[4]) /* Clear the color and/or depth buffers */ -static void -fxDDClear(GLcontext * ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height) +static void fxDDClear( GLcontext *ctx, + GLbitfield mask, GLboolean all, + GLint x, GLint y, GLint width, GLint height ) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; - const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask); - /* [dBorca] should use an adequate scaler for 16 vs 32bit (GR_ZDEPTH_MIN_MAX) */ - const FxU32 clearD = (FxU32) (ctx->Depth.Clear * 0x00ffffff); - GLbitfield softwareMask = mask & (DD_STENCIL_BIT | DD_ACCUM_BIT); - - /* we can't clear stencil or accum buffers */ - mask &= ~(DD_STENCIL_BIT | DD_ACCUM_BIT); - - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDClear(%d,%d,%d,%d)\n", (int) x, (int) y, - (int) width, (int) height); + fxMesaContext fxMesa = FX_CONTEXT(ctx); + GLbitfield softwareMask = mask & (DD_ACCUM_BIT); + const GLuint stencil_size = fxMesa->haveHwStencil ? ctx->Visual.stencilBits : 0; + const FxU32 clearD = (FxU32) (((1 << ctx->Visual.depthBits) - 1) * ctx->Depth.Clear); + const FxU8 clearS = (FxU8) (ctx->Stencil.Clear & 0xff); + + if ( TDFX_DEBUG & MESA_VERBOSE ) { + fprintf( stderr, "%s( %d, %d, %d, %d )\n", + __FUNCTION__, (int) x, (int) y, (int) width, (int) height ); } - if (colorMask != 0xffffffff) { - /* do masked color buffer clears in software */ - softwareMask |= (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)); - mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT); +/*jejeje*/ + /* Need this check to respond to glScissor and clipping updates */ + if (fxMesa->new_state & FX_NEW_SCISSOR) { + extern void fxSetupScissor(GLcontext * ctx); + fxSetupScissor(ctx); } - /* - * This could probably be done fancier but doing each possible case - * explicitly is less error prone. - */ - switch (mask) { - case DD_BACK_LEFT_BIT | DD_DEPTH_BIT: - /* back buffer & depth */ - grDepthMask(FXTRUE); - grRenderBuffer(GR_BUFFER_BACKBUFFER); - FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); - if (!ctx->Depth.Mask) { - grDepthMask(FXFALSE); + /* we can't clear accum buffers */ + mask &= ~(DD_ACCUM_BIT); + + if (mask & DD_STENCIL_BIT) { + if (!fxMesa->haveHwStencil || fxMesa->unitsState.stencilWriteMask != 0xff) { + /* Napalm seems to have trouble with stencil write masks != 0xff */ + /* do stencil clear in software */ + mask &= ~(DD_STENCIL_BIT); + softwareMask |= DD_STENCIL_BIT; } - break; - case DD_FRONT_LEFT_BIT | DD_DEPTH_BIT: - /* XXX it appears that the depth buffer isn't cleared when - * glRenderBuffer(GR_BUFFER_FRONTBUFFER) is set. - * This is a work-around/ + } + + if (ctx->Visual.greenBits != 8 && ctx->Visual.greenBits != 5) { + /* can only do color masking if running in 24/32bpp on Napalm */ + if (ctx->Color.ColorMask[RCOMP] != ctx->Color.ColorMask[GCOMP] || + ctx->Color.ColorMask[GCOMP] != ctx->Color.ColorMask[BCOMP]) { + softwareMask |= (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)); + mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT); + } + } + + if (fxMesa->haveHwStencil) { + /* + * If we want to clear stencil, it must be enabled + * in the HW, even if the stencil test is not enabled + * in the OGL state. */ - /* clear depth */ - grDepthMask(FXTRUE); - grRenderBuffer(GR_BUFFER_BACKBUFFER); - grColorMask(FXFALSE, FXFALSE); - FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); - /* clear front */ - grColorMask(FXTRUE, ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer); - grRenderBuffer(GR_BUFFER_FRONTBUFFER); - FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); - break; - case DD_BACK_LEFT_BIT: - /* back buffer only */ - grDepthMask(FXFALSE); - grRenderBuffer(GR_BUFFER_BACKBUFFER); - FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); - if (ctx->Depth.Mask) { - grDepthMask(FXTRUE); + BEGIN_BOARD_LOCK(); + if (mask & DD_STENCIL_BIT) { + fxMesa->Glide.grStencilMaskExt(0xff /*fxMesa->unitsState.stencilWriteMask*/); + /* set stencil ref value = desired clear value */ + fxMesa->Glide.grStencilFuncExt(GR_CMP_ALWAYS, clearS, 0xff); + fxMesa->Glide.grStencilOpExt(GR_STENCILOP_REPLACE, + GR_STENCILOP_REPLACE, GR_STENCILOP_REPLACE); + grEnable(GR_STENCIL_MODE_EXT); } - break; - case DD_FRONT_LEFT_BIT: - /* front buffer only */ - grDepthMask(FXFALSE); - grRenderBuffer(GR_BUFFER_FRONTBUFFER); - FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); - if (ctx->Depth.Mask) { - grDepthMask(FXTRUE); + else { + grDisable(GR_STENCIL_MODE_EXT); } - break; - case DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT: - /* front and back */ - grDepthMask(FXFALSE); - grRenderBuffer(GR_BUFFER_BACKBUFFER); - FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); - grRenderBuffer(GR_BUFFER_FRONTBUFFER); - FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); - if (ctx->Depth.Mask) { + END_BOARD_LOCK(); + } + + /* + * This may be ugly, but it's needed in order to work around a number + * of Glide bugs. + */ + BEGIN_CLIP_LOOP(); + { + /* + * This could probably be done fancier but doing each possible case + * explicitly is less error prone. + */ + switch (mask & ~DD_STENCIL_BIT) { + case DD_BACK_LEFT_BIT | DD_DEPTH_BIT: + /* back buffer & depth */ + fxColorMask(fxMesa, GL_TRUE); /* work around Voodoo3 bug */ grDepthMask(FXTRUE); - } - break; - case DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT | DD_DEPTH_BIT: - /* clear front */ - grDepthMask(FXFALSE); - grRenderBuffer(GR_BUFFER_FRONTBUFFER); - FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); - /* clear back and depth */ - grDepthMask(FXTRUE); - grRenderBuffer(GR_BUFFER_BACKBUFFER); - FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); - if (!ctx->Depth.Mask) { + grRenderBuffer(GR_BUFFER_BACKBUFFER); + if (stencil_size > 0) { + fxMesa->Glide.grBufferClearExt(fxMesa->clearC, + fxMesa->clearA, + clearD, clearS); + } + else + grBufferClear(fxMesa->clearC, + fxMesa->clearA, + clearD); + if (!ctx->Depth.Mask || !ctx->Depth.Test) { + grDepthMask(FXFALSE); + } + break; + case DD_FRONT_LEFT_BIT | DD_DEPTH_BIT: + /* XXX it appears that the depth buffer isn't cleared when + * glRenderBuffer(GR_BUFFER_FRONTBUFFER) is set. + * This is a work-around/ + */ + /* clear depth */ + grDepthMask(FXTRUE); + grRenderBuffer(GR_BUFFER_BACKBUFFER); + fxColorMask(fxMesa, GL_FALSE); + if (stencil_size > 0) + fxMesa->Glide.grBufferClearExt(fxMesa->clearC, + fxMesa->clearA, + clearD, clearS); + else + grBufferClear(fxMesa->clearC, + fxMesa->clearA, + clearD); + /* clear front */ + fxColorMask(fxMesa, GL_TRUE); + grRenderBuffer(GR_BUFFER_FRONTBUFFER); + if (stencil_size > 0) + fxMesa->Glide.grBufferClearExt(fxMesa->clearC, + fxMesa->clearA, + clearD, clearS); + else + grBufferClear(fxMesa->clearC, + fxMesa->clearA, + clearD); + if (!ctx->Depth.Mask || !ctx->Depth.Test) { + grDepthMask(FXFALSE); + } + break; + case DD_BACK_LEFT_BIT: + /* back buffer only */ grDepthMask(FXFALSE); - } - break; - case DD_DEPTH_BIT: - /* just the depth buffer */ - grRenderBuffer(GR_BUFFER_BACKBUFFER); - grColorMask(FXFALSE, FXFALSE); - grDepthMask(FXTRUE); - FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, clearD); - grColorMask(FXTRUE, ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer); - if (ctx->Color._DrawDestMask & FRONT_LEFT_BIT) + grRenderBuffer(GR_BUFFER_BACKBUFFER); + if (stencil_size > 0) + fxMesa->Glide.grBufferClearExt(fxMesa->clearC, + fxMesa->clearA, + clearD, clearS); + else + grBufferClear(fxMesa->clearC, + fxMesa->clearA, + clearD); + if (ctx->Depth.Mask && ctx->Depth.Test) { + grDepthMask(FXTRUE); + } + break; + case DD_FRONT_LEFT_BIT: + /* front buffer only */ + grDepthMask(FXFALSE); + grRenderBuffer(GR_BUFFER_FRONTBUFFER); + if (stencil_size > 0) + fxMesa->Glide.grBufferClearExt(fxMesa->clearC, + fxMesa->clearA, + clearD, clearS); + else + grBufferClear(fxMesa->clearC, + fxMesa->clearA, + clearD); + if (ctx->Depth.Mask && ctx->Depth.Test) { + grDepthMask(FXTRUE); + } + break; + case DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT: + /* front and back */ + grDepthMask(FXFALSE); + grRenderBuffer(GR_BUFFER_BACKBUFFER); + if (stencil_size > 0) + fxMesa->Glide.grBufferClearExt(fxMesa->clearC, + fxMesa->clearA, + clearD, clearS); + else + grBufferClear(fxMesa->clearC, + fxMesa->clearA, + clearD); grRenderBuffer(GR_BUFFER_FRONTBUFFER); - if (!ctx->Depth.Test || !ctx->Depth.Mask) + if (stencil_size > 0) + fxMesa->Glide.grBufferClearExt(fxMesa->clearC, + fxMesa->clearA, + clearD, clearS); + else + grBufferClear(fxMesa->clearC, + fxMesa->clearA, + clearD); + if (ctx->Depth.Mask && ctx->Depth.Test) { + grDepthMask(FXTRUE); + } + break; + case DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT | DD_DEPTH_BIT: + /* clear front */ grDepthMask(FXFALSE); - break; - default: - /* error */ - ; + grRenderBuffer(GR_BUFFER_FRONTBUFFER); + if (stencil_size > 0) + fxMesa->Glide.grBufferClearExt(fxMesa->clearC, + fxMesa->clearA, + clearD, clearS); + else + grBufferClear(fxMesa->clearC, + fxMesa->clearA, + clearD); + /* clear back and depth */ + grDepthMask(FXTRUE); + grRenderBuffer(GR_BUFFER_BACKBUFFER); + if (stencil_size > 0) + fxMesa->Glide.grBufferClearExt(fxMesa->clearC, + fxMesa->clearA, + clearD, clearS); + else + grBufferClear(fxMesa->clearC, + fxMesa->clearA, + clearD); + if (!ctx->Depth.Mask || !ctx->Depth.Mask) { + grDepthMask(FXFALSE); + } + break; + case DD_DEPTH_BIT: + /* just the depth buffer */ + grRenderBuffer(GR_BUFFER_BACKBUFFER); + fxColorMask(fxMesa, GL_FALSE); + grDepthMask(FXTRUE); + if (stencil_size > 0) + fxMesa->Glide.grBufferClearExt(fxMesa->clearC, + fxMesa->clearA, + clearD, clearS); + else + grBufferClear(fxMesa->clearC, + fxMesa->clearA, + clearD); + fxColorMask(fxMesa, GL_TRUE); + if (ctx->Color._DrawDestMask & FRONT_LEFT_BIT) + grRenderBuffer(GR_BUFFER_FRONTBUFFER); + if (!ctx->Depth.Test || !ctx->Depth.Mask) + grDepthMask(FXFALSE); + break; + default: + /* clear no color buffers or depth buffer but might clear stencil */ + if (stencil_size > 0 && (mask & DD_STENCIL_BIT)) { + /* XXX need this RenderBuffer call to work around Glide bug */ + grRenderBuffer(GR_BUFFER_BACKBUFFER); + grDepthMask(FXFALSE); + fxColorMask(fxMesa, GL_FALSE); + fxMesa->Glide.grBufferClearExt(fxMesa->clearC, + fxMesa->clearA, + clearD, clearS); + if (ctx->Depth.Mask && ctx->Depth.Test) { + grDepthMask(FXTRUE); + } + fxColorMask(fxMesa, GL_TRUE); + if (ctx->Color._DrawDestMask & FRONT_LEFT_BIT) + grRenderBuffer(GR_BUFFER_FRONTBUFFER); + } + } + } + END_CLIP_LOOP(); + + if (fxMesa->haveHwStencil && (mask & DD_STENCIL_BIT)) { + /* We changed the stencil state above. Signal that we need to + * upload it again. + */ + fxMesa->new_state |= FX_NEW_STENCIL; } - /* Clear any remaining buffers: - */ if (softwareMask) - _swrast_Clear(ctx, softwareMask, all, x, y, width, height); + _swrast_Clear( ctx, softwareMask, all, x, y, width, height ); } @@ -287,10 +441,10 @@ fxDDClear(GLcontext * ctx, GLbitfield mask, GLboolean all, static void fxDDSetDrawBuffer(GLcontext * ctx, GLenum mode) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDSetBuffer(%x)\n", (int) mode); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(%x)\n", __FUNCTION__, (int)mode); } if (mode == GL_FRONT_LEFT) { @@ -302,7 +456,7 @@ fxDDSetDrawBuffer(GLcontext * ctx, GLenum mode) grRenderBuffer(fxMesa->currentFB); } else if (mode == GL_NONE) { - grColorMask(FXFALSE, FXFALSE); + fxColorMask(fxMesa, GL_FALSE); } else { /* we'll need a software fallback */ @@ -323,7 +477,7 @@ fxDDDrawBitmap(GLcontext * ctx, GLint px, GLint py, const struct gl_pixelstore_attrib *unpack, const GLubyte * bitmap) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GrLfbInfo_t info; FxU16 color; const struct gl_pixelstore_attrib *finalUnpack; @@ -409,9 +563,7 @@ fxDDDrawBitmap(GLcontext * ctx, GLint px, GLint py, fxMesa->currentFB, GR_LFBWRITEMODE_565, GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) { -#ifndef FX_SILENT - fprintf(stderr, "fx Driver: error locking the linear frame buffer\n"); -#endif + fprintf(stderr, "%s: ERROR: locking the linear frame buffer\n", __FUNCTION__); return; } @@ -493,7 +645,7 @@ fxDDReadPixels(GLcontext * ctx, GLint x, GLint y, return; } else { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GrLfbInfo_t info; BEGIN_BOARD_LOCK(); @@ -608,7 +760,7 @@ static void fxDDReadPixels555 (GLcontext * ctx, return; } else { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GrLfbInfo_t info; BEGIN_BOARD_LOCK(); @@ -719,7 +871,7 @@ static void fxDDReadPixels888 (GLcontext * ctx, return; } else { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GrLfbInfo_t info; BEGIN_BOARD_LOCK(); @@ -798,20 +950,11 @@ fxDDFinish(GLcontext * ctx) static const GLubyte * fxDDGetString(GLcontext * ctx, GLenum name) { + fxMesaContext fxMesa = FX_CONTEXT(ctx); + switch (name) { case GL_RENDERER: - { - static char buf[80]; - GrVoodooConfig_t *vc = &glbHWConfig.SSTs[glbCurrentBoard].VoodooConfig; - sprintf(buf, "Mesa %s v0.31 %s %dMB FB, %dMB TM, %d TMU, %s", - grGetString(GR_RENDERER), - grGetString(GR_HARDWARE), - vc->fbRam, - (vc->tmuConfig[GR_TMU0].tmuRam + ((vc->nTexelfx > 1) ? vc->tmuConfig[GR_TMU1].tmuRam : 0)), - (vc->nTexelfx * vc->numChips), - (vc->numChips > 1) ? "SLI" : "NOSLI"); - return (GLubyte *)buf; - } + return (GLubyte *)fxMesa->rendererString; default: return NULL; } @@ -821,10 +964,10 @@ static const struct gl_pipeline_stage *fx_pipeline[] = { &_tnl_vertex_transform_stage, /* TODO: Add the fastpath here */ &_tnl_normal_transform_stage, &_tnl_lighting_stage, - &_tnl_fog_coordinate_stage, /* TODO: Omit fog stage */ + /*&_tnl_fog_coordinate_stage,*/ /* TODO: Omit fog stage ZZZ ZZZ ZZZ */ &_tnl_texgen_stage, &_tnl_texture_transform_stage, - &_tnl_point_attenuation_stage, + /*&_tnl_point_attenuation_stage,*/ /* TODO: For AA primitives ZZZ ZZZ ZZZ */ &_tnl_render_stage, 0, }; @@ -836,31 +979,10 @@ int fxDDInitFxMesaContext(fxMesaContext fxMesa) { int i; - - for (i = 0; i < 256; i++) { - gl_ubyte_to_float_255_color_tab[i] = (float) i; - } + GLcontext *ctx = fxMesa->glCtx; FX_setupGrVertexLayout(); - if (getenv("FX_EMULATE_SINGLE_TMU")) - fxMesa->haveTwoTMUs = GL_FALSE; - - if (getenv("FX_GLIDE_SWAPINTERVAL")) - fxMesa->swapInterval = atoi(getenv("FX_GLIDE_SWAPINTERVAL")); - else - fxMesa->swapInterval = 1; - - if (getenv("MESA_FX_SWAP_PENDING")) - fxMesa->maxPendingSwapBuffers = atoi(getenv("MESA_FX_SWAP_PENDING")); - else - fxMesa->maxPendingSwapBuffers = 2; - - if (getenv("MESA_FX_INFO")) - fxMesa->verbose = GL_TRUE; - else - fxMesa->verbose = GL_FALSE; - fxMesa->color = 0xffffffff; fxMesa->clearC = 0; fxMesa->clearA = 0; @@ -877,7 +999,7 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa) /* FX units setup */ fxMesa->unitsState.alphaTestEnabled = GL_FALSE; - fxMesa->unitsState.alphaTestFunc = GR_CMP_ALWAYS; + fxMesa->unitsState.alphaTestFunc = GL_ALWAYS; fxMesa->unitsState.alphaTestRefValue = 0.0; fxMesa->unitsState.blendEnabled = GL_FALSE; @@ -888,9 +1010,12 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa) fxMesa->unitsState.depthTestEnabled = GL_FALSE; fxMesa->unitsState.depthMask = GL_TRUE; - fxMesa->unitsState.depthTestFunc = GR_CMP_LESS; + fxMesa->unitsState.depthTestFunc = GL_LESS; + fxMesa->unitsState.depthBias = 0; - grColorMask(FXTRUE, fxMesa->haveAlphaBuffer ? FXTRUE : FXFALSE); + fxMesa->unitsState.stencilWriteMask = 0xff; + + fxColorMask(fxMesa, GL_TRUE); if (fxMesa->haveDoubleBuffer) { fxMesa->currentFB = GR_BUFFER_BACKBUFFER; grRenderBuffer(GR_BUFFER_BACKBUFFER); @@ -900,15 +1025,15 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa) grRenderBuffer(GR_BUFFER_FRONTBUFFER); } - fxMesa->state = malloc(FX_grGetInteger(GR_GLIDE_STATE_SIZE)); - fxMesa->fogTable = (GrFog_t *) malloc(FX_grGetInteger(GR_FOG_TABLE_ENTRIES) * + fxMesa->state = MALLOC(FX_grGetInteger(GR_GLIDE_STATE_SIZE)); + fxMesa->fogTable = (GrFog_t *) MALLOC(FX_grGetInteger(GR_FOG_TABLE_ENTRIES) * sizeof(GrFog_t)); if (!fxMesa->state || !fxMesa->fogTable) { if (fxMesa->state) - free(fxMesa->state); + FREE(fxMesa->state); if (fxMesa->fogTable) - free(fxMesa->fogTable); + FREE(fxMesa->fogTable); return 0; } @@ -920,42 +1045,50 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa) fxMesa->textureAlign = FX_grGetInteger(GR_TEXTURE_ALIGN); /* [koolsmoky] */ { - int textureSize = ((fxMesa->maxTextureSize > 2048) ? 2048 : fxMesa->maxTextureSize); - fxMesa->glCtx->Const.MaxTextureLevels = 0; + int textureLevels = 0; + int textureSize = FX_grGetInteger(GR_MAX_TEXTURE_SIZE); do { - fxMesa->glCtx->Const.MaxTextureLevels++; + textureLevels++; } while ((textureSize >>= 0x1) & 0x7ff); + ctx->Const.MaxTextureLevels = textureLevels; } - fxMesa->glCtx->Const.MaxTextureUnits = fxMesa->haveTwoTMUs ? 2 : 1; + ctx->Const.MaxTextureCoordUnits = fxMesa->haveTwoTMUs ? 2 : 1; + ctx->Const.MaxTextureImageUnits = fxMesa->haveTwoTMUs ? 2 : 1; + ctx->Const.MaxTextureUnits = MAX2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits); + fxMesa->new_state = _NEW_ALL; + if (!fxMesa->haveHwStencil) { + /* don't touch stencil if there is none */ + fxMesa->new_state &= ~FX_NEW_STENCIL; + } /* Initialize the software rasterizer and helper modules. */ - _swrast_CreateContext(fxMesa->glCtx); - _ac_CreateContext(fxMesa->glCtx); - _tnl_CreateContext(fxMesa->glCtx); - _swsetup_CreateContext(fxMesa->glCtx); + _swrast_CreateContext(ctx); + _ac_CreateContext(ctx); + _tnl_CreateContext(ctx); + _swsetup_CreateContext(ctx); /* Install customized pipeline */ - _tnl_destroy_pipeline(fxMesa->glCtx); - _tnl_install_pipeline(fxMesa->glCtx, fx_pipeline); + _tnl_destroy_pipeline(ctx); + _tnl_install_pipeline(ctx, fx_pipeline); - fxAllocVB(fxMesa->glCtx); + fxAllocVB(ctx); - fxSetupDDPointers(fxMesa->glCtx); - fxDDInitTriFuncs(fxMesa->glCtx); + fxSetupDDPointers(ctx); + fxDDInitTriFuncs(ctx); /* Tell the software rasterizer to use pixel fog always. */ - _swrast_allow_vertex_fog(fxMesa->glCtx, GL_FALSE); - _swrast_allow_pixel_fog(fxMesa->glCtx, GL_TRUE); + _swrast_allow_vertex_fog(ctx, GL_FALSE); + _swrast_allow_pixel_fog(ctx, GL_TRUE); /* Tell tnl not to calculate or use vertex fog factors. (Needed to * tell render stage not to clip fog coords). */ -/* _tnl_calculate_vertex_fog( fxMesa->glCtx, GL_FALSE ); */ +/* _tnl_calculate_vertex_fog( ctx, GL_FALSE ); */ - fxDDInitExtensions(fxMesa->glCtx); + fxDDInitExtensions(ctx); grGlideGetState((GrState *) fxMesa->state); @@ -973,9 +1106,9 @@ fxDDDestroyFxMesaContext(fxMesaContext fxMesa) _swrast_DestroyContext(fxMesa->glCtx); if (fxMesa->state) - free(fxMesa->state); + FREE(fxMesa->state); if (fxMesa->fogTable) - free(fxMesa->fogTable); + FREE(fxMesa->fogTable); fxTMClose(fxMesa); fxFreeVB(fxMesa->glCtx); } @@ -986,7 +1119,7 @@ fxDDDestroyFxMesaContext(fxMesaContext fxMesa) void fxDDInitExtensions(GLcontext * ctx) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); /*_mesa_add_extension(ctx, GL_TRUE, "3DFX_set_global_palette", 0);*/ _mesa_enable_extension(ctx, "GL_EXT_point_parameters"); @@ -994,11 +1127,32 @@ fxDDInitExtensions(GLcontext * ctx) _mesa_enable_extension(ctx, "GL_EXT_texture_lod_bias"); _mesa_enable_extension(ctx, "GL_EXT_shared_texture_palette"); - if (fxMesa->haveTwoTMUs) + if (fxMesa->haveTwoTMUs) { _mesa_enable_extension(ctx, "GL_EXT_texture_env_add"); - - if (fxMesa->haveTwoTMUs) _mesa_enable_extension(ctx, "GL_ARB_multitexture"); + } + + if (fxMesa->haveHwStencil) { + _mesa_enable_extension( ctx, "GL_EXT_stencil_wrap" ); + } + +#if 0 /* not ready yet */ + /* banshee/avenger should enable this for NCC */ + _mesa_enable_extension( ctx, "GL_ARB_texture_compression" ); +#endif + if (0/*IS_NAPALM*/) { + /* tex_compress: not ready yet */ + _mesa_enable_extension( ctx, "GL_3DFX_texture_compression_FXT1" ); + _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" ); + /*_mesa_enable_extension( ctx, "GL_S3_s3tc" );*/ + + /* env_combine: not ready yet */ + /*_mesa_enable_extension( ctx, "GL_EXT_texture_env_combine" );*/ + } + + if (fxMesa->HaveMirExt) { + _mesa_enable_extension(ctx, "GL_ARB_texture_mirrored_repeat"); + } } @@ -1010,38 +1164,52 @@ fxDDInitExtensions(GLcontext * ctx) * * Performs similar work to fxDDChooseRenderState() - should be merged. */ -GLboolean +GLuint fx_check_IsInHardware(GLcontext * ctx) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); - if (ctx->RenderMode != GL_RENDER) - return GL_FALSE; + if (ctx->RenderMode != GL_RENDER) { + return FX_FALLBACK_RENDER_MODE; + } - if (ctx->Stencil.Enabled || - (ctx->Color._DrawDestMask != FRONT_LEFT_BIT && - ctx->Color._DrawDestMask != BACK_LEFT_BIT) || - ((ctx->Color.BlendEnabled) - && (ctx->Color.BlendEquation != GL_FUNC_ADD_EXT)) - || ((ctx->Color.ColorLogicOpEnabled) - && (ctx->Color.LogicOp != GL_COPY)) - || (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) + if (ctx->Stencil.Enabled && !fxMesa->haveHwStencil) { + return FX_FALLBACK_STENCIL; + } + + if (ctx->Color._DrawDestMask != FRONT_LEFT_BIT && ctx->Color._DrawDestMask != BACK_LEFT_BIT) { + return FX_FALLBACK_DRAW_BUFFER; + } + + if (ctx->Color.BlendEnabled && (ctx->Color.BlendEquation != GL_FUNC_ADD_EXT)) { + return FX_FALLBACK_BLEND; + } + + if (ctx->Color.ColorLogicOpEnabled && (ctx->Color.LogicOp != GL_COPY)) { + return FX_FALLBACK_LOGICOP; + } + + if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) { + return FX_FALLBACK_SPECULAR; + } + + if ((ctx->Color.ColorMask[RCOMP] != ctx->Color.ColorMask[GCOMP]) || - (!((ctx-> - Color.ColorMask[RCOMP] == ctx->Color.ColorMask[GCOMP]) - && (ctx->Color.ColorMask[GCOMP] == ctx->Color.ColorMask[BCOMP]) - && (ctx->Color.ColorMask[ACOMP] == ctx->Color.ColorMask[ACOMP]))) + (ctx->Color.ColorMask[GCOMP] != ctx->Color.ColorMask[BCOMP]) + || + (ctx->Color.ColorMask[BCOMP] != ctx->Color.ColorMask[ACOMP]) ) { - return GL_FALSE; + return FX_FALLBACK_COLORMASK; } + /* Unsupported texture/multitexture cases */ if (fxMesa->haveTwoTMUs) { /* we can only do 2D textures */ if (ctx->Texture.Unit[0]._ReallyEnabled & ~TEXTURE_2D_BIT) - return GL_FALSE; + return FX_FALLBACK_TEXTURE_1D_3D; if (ctx->Texture.Unit[1]._ReallyEnabled & ~TEXTURE_2D_BIT) - return GL_FALSE; + return FX_FALLBACK_TEXTURE_1D_3D; if (ctx->Texture.Unit[0]._ReallyEnabled & TEXTURE_2D_BIT) { if (ctx->Texture.Unit[0].EnvMode == GL_BLEND && @@ -1050,21 +1218,21 @@ fx_check_IsInHardware(GLcontext * ctx) ctx->Texture.Unit[0].EnvColor[1] != 0 || ctx->Texture.Unit[0].EnvColor[2] != 0 || ctx->Texture.Unit[0].EnvColor[3] != 1)) { - return GL_FALSE; + return FX_FALLBACK_TEXTURE_ENV; } if (ctx->Texture.Unit[0]._Current->Image[0]->Border > 0) - return GL_FALSE; + return FX_FALLBACK_TEXTURE_BORDER; } if (ctx->Texture.Unit[1]._ReallyEnabled & TEXTURE_2D_BIT) { if (ctx->Texture.Unit[1].EnvMode == GL_BLEND) - return GL_FALSE; + return FX_FALLBACK_TEXTURE_ENV; if (ctx->Texture.Unit[1]._Current->Image[0]->Border > 0) - return GL_FALSE; + return FX_FALLBACK_TEXTURE_BORDER; } - if (MESA_VERBOSE & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) - fprintf(stderr, "fxMesa: fxIsInHardware, envmode is %s/%s\n", + if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) + fprintf(stderr, "%s: envmode is %s/%s\n", __FUNCTION__, _mesa_lookup_enum_by_nr(ctx->Texture.Unit[0].EnvMode), _mesa_lookup_enum_by_nr(ctx->Texture.Unit[1].EnvMode)); @@ -1078,96 +1246,51 @@ fx_check_IsInHardware(GLcontext * ctx) * back to software. */ if (!fxMesa->haveTwoTMUs && ctx->Color.BlendEnabled) { - return GL_FALSE; + return FX_FALLBACK_TEXTURE_MULTI; } if ((ctx->Texture.Unit[0].EnvMode != ctx->Texture.Unit[1].EnvMode) && (ctx->Texture.Unit[0].EnvMode != GL_MODULATE) && (ctx->Texture.Unit[0].EnvMode != GL_REPLACE)) { /* q2, seems ok... */ - if (MESA_VERBOSE & VERBOSE_DRIVER) - fprintf(stderr, "fxMesa: unsupported multitex env mode\n"); - return GL_FALSE; + if (TDFX_DEBUG & VERBOSE_DRIVER) + fprintf(stderr, "%s: unsupported multitex env mode\n", __FUNCTION__); + return FX_FALLBACK_TEXTURE_MULTI; } } } else { /* we have just one texture unit */ if (ctx->Texture._EnabledUnits > 0x1) { - return GL_FALSE; + return FX_FALLBACK_TEXTURE_MULTI; } if ((ctx->Texture.Unit[0]._ReallyEnabled & TEXTURE_2D_BIT) && (ctx->Texture.Unit[0].EnvMode == GL_BLEND)) { - return GL_FALSE; + return FX_FALLBACK_TEXTURE_ENV; } } - return GL_TRUE; + return 0; } -static void -update_texture_scales(GLcontext * ctx) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - struct gl_texture_unit *t0 = &ctx->Texture.Unit[fxMesa->tmu_source[0]]; - struct gl_texture_unit *t1 = &ctx->Texture.Unit[fxMesa->tmu_source[1]]; - - if (t0 && t0->_Current && FX_TEXTURE_DATA(t0)) { - fxMesa->s0scale = FX_TEXTURE_DATA(t0)->sScale; - fxMesa->t0scale = FX_TEXTURE_DATA(t0)->tScale; - fxMesa->inv_s0scale = 1.0 / fxMesa->s0scale; - fxMesa->inv_t0scale = 1.0 / fxMesa->t0scale; - } - - if (t1 && t1->_Current && FX_TEXTURE_DATA(t1)) { - fxMesa->s1scale = FX_TEXTURE_DATA(t1)->sScale; - fxMesa->t1scale = FX_TEXTURE_DATA(t1)->tScale; - fxMesa->inv_s1scale = 1.0 / fxMesa->s1scale; - fxMesa->inv_t1scale = 1.0 / fxMesa->t1scale; - } -} - static void fxDDUpdateDDPointers(GLcontext * ctx, GLuint new_state) { /* TNLcontext *tnl = TNL_CONTEXT(ctx);*/ fxMesaContext fxMesa = FX_CONTEXT(ctx); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "fxDDUpdateDDPointers(%08x)\n", new_state); + } + _swrast_InvalidateState(ctx, new_state); _ac_InvalidateState(ctx, new_state); _tnl_InvalidateState(ctx, new_state); _swsetup_InvalidateState(ctx, new_state); - /* Recalculate fog table on projection matrix changes. This used to - * be triggered by the NearFar callback. - */ - if (new_state & _NEW_PROJECTION) - fxMesa->new_state |= FX_NEW_FOG; - - if (new_state & (_FX_NEW_IS_IN_HARDWARE | - _FX_NEW_RENDERSTATE | - _FX_NEW_SETUP_FUNCTION | - _NEW_TEXTURE)) { - - if (new_state & _FX_NEW_IS_IN_HARDWARE) - fxCheckIsInHardware(ctx); - - if (fxMesa->new_state) - fxSetupFXUnits(ctx); - - if (fxMesa->is_in_hardware) { - if (new_state & _FX_NEW_RENDERSTATE) - fxDDChooseRenderState(ctx); - - if (new_state & _FX_NEW_SETUP_FUNCTION) - fxChooseVertexState(ctx); - } - - if (new_state & _NEW_TEXTURE) - update_texture_scales(ctx); - } + fxMesa->new_gl_state |= new_state; } @@ -1176,10 +1299,11 @@ fxDDUpdateDDPointers(GLcontext * ctx, GLuint new_state) void fxSetupDDPointers(GLcontext * ctx) { + fxMesaContext fxMesa = FX_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxSetupDDPointers()\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s()\n", __FUNCTION__); } ctx->Driver.UpdateState = fxDDUpdateDDPointers; @@ -1193,8 +1317,6 @@ fxSetupDDPointers(GLcontext * ctx) ctx->Driver.Bitmap = fxDDDrawBitmap; ctx->Driver.CopyPixels = _swrast_CopyPixels; ctx->Driver.DrawPixels = _swrast_DrawPixels; - { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; switch (fxMesa->colDepth) { case 15: ctx->Driver.ReadPixels = fxDDReadPixels555; @@ -1206,7 +1328,6 @@ fxSetupDDPointers(GLcontext * ctx) ctx->Driver.ReadPixels = fxDDReadPixels888; break; } - } ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; ctx->Driver.Finish = fxDDFinish; ctx->Driver.Flush = NULL; @@ -1249,8 +1370,11 @@ fxSetupDDPointers(GLcontext * ctx) ctx->Driver.CullFace = fxDDCullFace; ctx->Driver.ShadeModel = fxDDShadeModel; ctx->Driver.Enable = fxDDEnable; - - tnl->Driver.RunPipeline = _tnl_run_pipeline; + if (fxMesa->haveHwStencil) { + ctx->Driver.StencilFunc = fxDDStencilFunc; + ctx->Driver.StencilMask = fxDDStencilMask; + ctx->Driver.StencilOp = fxDDStencilOp; + } fxSetupDDSpanPointers(ctx); fxDDUpdateDDPointers(ctx, ~0); diff --git a/src/mesa/drivers/glide/fxddspan.c b/src/mesa/drivers/glide/fxddspan.c index 6e847acce4e..460126e86b1 100644 --- a/src/mesa/drivers/glide/fxddspan.c +++ b/src/mesa/drivers/glide/fxddspan.c @@ -5,7 +5,7 @@ * Optimize and check endianess for `read_R8G8B8_pixels' */ -/* $Id: fxddspan.c,v 1.24 2003/08/19 15:52:53 brianp Exp $ */ +/* $Id: fxddspan.c,v 1.25 2003/10/02 17:36:44 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -98,12 +98,12 @@ fxDDWriteRGBASpan(const GLcontext * ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GLuint i; GLint bottom = fxMesa->height - 1; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDWriteRGBASpan(...)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } if (mask) { @@ -140,13 +140,13 @@ fxDDWriteRGBSpan(const GLcontext * ctx, GLuint n, GLint x, GLint y, const GLubyte rgb[][3], const GLubyte mask[]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GLuint i; GLint bottom = fxMesa->height - 1; GLubyte rgba[MAX_WIDTH][4]; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDWriteRGBSpan()\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } if (mask) { @@ -195,14 +195,14 @@ fxDDWriteMonoRGBASpan(const GLcontext * ctx, GLuint n, GLint x, GLint y, const GLchan color[4], const GLubyte mask[]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GLuint i; GLint bottom = fxMesa->height - 1; GLuint data[MAX_WIDTH]; GrColor_t gColor = FXCOLOR4(color); - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDWriteMonoRGBASpan(...)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } if (mask) { @@ -244,14 +244,13 @@ static void fxDDReadRGBASpan(const GLcontext * ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GLushort data[MAX_WIDTH]; GLuint i; GLint bottom = fxMesa->height - 1; - printf("read span %d, %d, %d\n", x, y, n); - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDReadRGBASpan(...)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } assert(n < MAX_WIDTH); @@ -277,7 +276,7 @@ static void read_R5G6B5_span(const GLcontext * ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GrLfbInfo_t info; BEGIN_BOARD_LOCK(); if (grLfbLock(GR_LFB_READ_ONLY, @@ -327,7 +326,7 @@ static void read_R5G5B5_span (const GLcontext * ctx, GLint x, GLint y, GLubyte rgba[][4]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GrLfbInfo_t info; BEGIN_BOARD_LOCK(); if (grLfbLock(GR_LFB_READ_ONLY, @@ -375,7 +374,7 @@ static void read_R8G8B8_span (const GLcontext * ctx, GLint x, GLint y, GLubyte rgba[][4]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); BEGIN_BOARD_LOCK(); grLfbReadRegion(fxMesa->currentFB, x, fxMesa->height - 1 - y, n, 1, n * 4, rgba); END_BOARD_LOCK(); @@ -391,12 +390,12 @@ fxDDWriteRGBAPixels(const GLcontext * ctx, GLuint n, const GLint x[], const GLint y[], CONST GLubyte rgba[][4], const GLubyte mask[]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GLuint i; GLint bottom = fxMesa->height - 1; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDWriteRGBAPixels(...)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } for (i = 0; i < n; i++) @@ -410,13 +409,13 @@ fxDDWriteMonoRGBAPixels(const GLcontext * ctx, GLuint n, const GLint x[], const GLint y[], const GLchan color[4], const GLubyte mask[]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GLuint i; GLint bottom = fxMesa->height - 1; GrColor_t gColor = FXCOLOR4(color); - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDWriteMonoRGBAPixels(...)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } for (i = 0; i < n; i++) @@ -431,7 +430,7 @@ read_R5G6B5_pixels(const GLcontext * ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GrLfbInfo_t info; BEGIN_BOARD_LOCK(); if (grLfbLock(GR_LFB_READ_ONLY, @@ -464,7 +463,7 @@ static void read_R5G5B5_pixels (const GLcontext * ctx, GLubyte rgba[][4], const GLubyte mask[]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GrLfbInfo_t info; BEGIN_BOARD_LOCK(); if (grLfbLock(GR_LFB_READ_ONLY, @@ -496,7 +495,7 @@ read_R8G8B8_pixels(const GLcontext * ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GrLfbInfo_t info; BEGIN_BOARD_LOCK(); if (grLfbLock(GR_LFB_READ_ONLY, @@ -530,11 +529,11 @@ fxDDWriteDepthSpan(GLcontext * ctx, GLuint n, GLint x, GLint y, const GLdepth depth[], const GLubyte mask[]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GLint bottom = fxMesa->height - 1; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDWriteDepthSpan(...)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } @@ -565,12 +564,12 @@ fxDDWriteDepth32Span(GLcontext * ctx, GLuint n, GLint x, GLint y, const GLdepth depth[], const GLubyte mask[]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GLint bottom = fxMesa->height - 1; GLint i; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDWriteDepth32Span(...)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } @@ -598,13 +597,13 @@ void fxDDReadDepthSpan(GLcontext * ctx, GLuint n, GLint x, GLint y, GLdepth depth[]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GLint bottom = fxMesa->height - 1; GLushort depth16[MAX_WIDTH]; GLuint i; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDReadDepthSpan(...)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth16); @@ -618,11 +617,11 @@ void fxDDReadDepth32Span(GLcontext * ctx, GLuint n, GLint x, GLint y, GLdepth depth[]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GLint bottom = fxMesa->height - 1; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDReadDepth32Span(...)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth); @@ -635,12 +634,12 @@ fxDDWriteDepthPixels(GLcontext * ctx, GLuint n, const GLint x[], const GLint y[], const GLdepth depth[], const GLubyte mask[]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GLint bottom = fxMesa->height - 1; GLuint i; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDWriteDepthPixels(...)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } for (i = 0; i < n; i++) { @@ -660,12 +659,12 @@ fxDDWriteDepth32Pixels(GLcontext * ctx, GLuint n, const GLint x[], const GLint y[], const GLdepth depth[], const GLubyte mask[]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GLint bottom = fxMesa->height - 1; GLuint i; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDWriteDepth32Pixels(...)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } for (i = 0; i < n; i++) { @@ -684,12 +683,12 @@ void fxDDReadDepthPixels(GLcontext * ctx, GLuint n, const GLint x[], const GLint y[], GLdepth depth[]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GLint bottom = fxMesa->height - 1; GLuint i; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDReadDepthPixels(...)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } for (i = 0; i < n; i++) { @@ -706,12 +705,12 @@ void fxDDReadDepth32Pixels(GLcontext * ctx, GLuint n, const GLint x[], const GLint y[], GLdepth depth[]) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GLint bottom = fxMesa->height - 1; GLuint i; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDReadDepth32Pixels(...)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } for (i = 0; i < n; i++) { @@ -728,11 +727,11 @@ fxDDReadDepth32Pixels(GLcontext * ctx, GLuint n, static void fxDDSetBuffer(GLcontext * ctx, GLframebuffer * buffer, GLuint bufferBit) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); (void) buffer; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDSetBuffer(%x)\n", (int) bufferBit); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(%x)\n", __FUNCTION__, (int)bufferBit); } if (bufferBit == FRONT_LEFT_BIT) { @@ -765,7 +764,7 @@ fxSetupDDSpanPointers(GLcontext * ctx) /* swdd->ReadRGBASpan =fxDDReadRGBASpan; */ { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); switch (fxMesa->colDepth) { case 15: swdd->ReadRGBASpan = read_R5G5B5_span; diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index a2c3aec8a51..38a268922ae 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -1,4 +1,4 @@ -/* $Id: fxddtex.c,v 1.47 2003/08/19 15:52:53 brianp Exp $ */ +/* $Id: fxddtex.c,v 1.48 2003/10/02 17:36:44 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -76,8 +76,6 @@ fxPrintTextureData(tfxTexInfo * ti) fprintf(stderr, "\tClamps: s %d t %d\n", (int) ti->sClamp, (int) ti->tClamp); fprintf(stderr, "\tScales: s %f t %f\n", ti->sScale, ti->tScale); - fprintf(stderr, "\tInt Scales: s %d t %d\n", - ti->int_sScale / 0x800000, ti->int_tScale / 0x800000); fprintf(stderr, "\t%s\n", (ti->fixedPalette) ? "Fixed palette" : "Non fixed palette"); fprintf(stderr, "\t%s\n", (ti->validated) ? "Validated" : "Not validated"); @@ -91,7 +89,7 @@ fxPrintTextureData(tfxTexInfo * ti) static void fxTexInvalidate(GLcontext * ctx, struct gl_texture_object *tObj) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); tfxTexInfo *ti; ti = fxTMGetTexInfo(tObj); @@ -108,7 +106,7 @@ fxAllocTexObjData(fxMesaContext fxMesa) tfxTexInfo *ti; if (!(ti = CALLOC(sizeof(tfxTexInfo)))) { - fprintf(stderr, "fx Driver: out of memory !\n"); + fprintf(stderr, "%s: ERROR: out of memory !\n", __FUNCTION__); fxCloseHardware(); exit(-1); } @@ -136,11 +134,11 @@ fxAllocTexObjData(fxMesaContext fxMesa) void fxDDTexBind(GLcontext * ctx, GLenum target, struct gl_texture_object *tObj) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); tfxTexInfo *ti; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDTexBind(%d,%x)\n", tObj->Name, + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(%d, %x)\n", __FUNCTION__, tObj->Name, (GLuint) tObj->DriverData); } @@ -163,13 +161,13 @@ void fxDDTexEnv(GLcontext * ctx, GLenum target, GLenum pname, const GLfloat * param) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); - if (MESA_VERBOSE & VERBOSE_DRIVER) { + if (TDFX_DEBUG & VERBOSE_DRIVER) { if (param) - fprintf(stderr, "fxmesa: texenv(%x,%x)\n", pname, (GLint) (*param)); + fprintf(stderr, "%s(%x, %x)\n", __FUNCTION__, pname, (GLint) (*param)); else - fprintf(stderr, "fxmesa: texenv(%x)\n", pname); + fprintf(stderr, "%s(%x)\n", __FUNCTION__, pname); } /* apply any lod biasing right now */ @@ -189,13 +187,13 @@ void fxDDTexParam(GLcontext * ctx, GLenum target, struct gl_texture_object *tObj, GLenum pname, const GLfloat * params) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GLenum param = (GLenum) (GLint) params[0]; tfxTexInfo *ti; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDTexParam(%d,%x,%x,%x)\n", tObj->Name, - (GLuint) tObj->DriverData, pname, param); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(%d, %x, %x, %x)\n", __FUNCTION__, + tObj->Name, (GLuint) tObj->DriverData, pname, param); } if (target != GL_TEXTURE_2D) @@ -220,16 +218,6 @@ fxDDTexParam(GLcontext * ctx, GLenum target, struct gl_texture_object *tObj, ti->minFilt = GR_TEXTUREFILTER_BILINEAR; ti->LODblend = FXFALSE; break; - case GL_NEAREST_MIPMAP_NEAREST: - ti->mmMode = GR_MIPMAP_NEAREST; - ti->minFilt = GR_TEXTUREFILTER_POINT_SAMPLED; - ti->LODblend = FXFALSE; - break; - case GL_LINEAR_MIPMAP_NEAREST: - ti->mmMode = GR_MIPMAP_NEAREST; - ti->minFilt = GR_TEXTUREFILTER_BILINEAR; - ti->LODblend = FXFALSE; - break; case GL_NEAREST_MIPMAP_LINEAR: if (fxMesa->haveTwoTMUs) { ti->mmMode = GR_MIPMAP_NEAREST; @@ -240,8 +228,16 @@ fxDDTexParam(GLcontext * ctx, GLenum target, struct gl_texture_object *tObj, ti->LODblend = FXFALSE; } ti->minFilt = GR_TEXTUREFILTER_POINT_SAMPLED; + break; /* ZZZ: we may have to fall through here for V3 */ + case GL_NEAREST_MIPMAP_NEAREST: + ti->mmMode = GR_MIPMAP_NEAREST; + ti->minFilt = GR_TEXTUREFILTER_POINT_SAMPLED; + ti->LODblend = FXFALSE; break; case GL_LINEAR_MIPMAP_LINEAR: + /* ZZZ: HACK ALERT! trilinear is bugged! mipmap blending produce + incorrect filtered colors for the smallest mipmap levels. */ +#if 0 if (fxMesa->haveTwoTMUs) { ti->mmMode = GR_MIPMAP_NEAREST; ti->LODblend = FXTRUE; @@ -251,6 +247,12 @@ fxDDTexParam(GLcontext * ctx, GLenum target, struct gl_texture_object *tObj, ti->LODblend = FXFALSE; } ti->minFilt = GR_TEXTUREFILTER_BILINEAR; + break; /* ZZZ: we may have to fall through here for V3 */ +#endif + case GL_LINEAR_MIPMAP_NEAREST: + ti->mmMode = GR_MIPMAP_NEAREST; + ti->minFilt = GR_TEXTUREFILTER_BILINEAR; + ti->LODblend = FXFALSE; break; default: break; @@ -274,6 +276,9 @@ fxDDTexParam(GLcontext * ctx, GLenum target, struct gl_texture_object *tObj, case GL_TEXTURE_WRAP_S: switch (param) { + case GL_MIRRORED_REPEAT: + ti->sClamp = GR_TEXTURECLAMP_MIRROR_EXT; + break; case GL_CLAMP: ti->sClamp = GR_TEXTURECLAMP_CLAMP; break; @@ -288,6 +293,9 @@ fxDDTexParam(GLcontext * ctx, GLenum target, struct gl_texture_object *tObj, case GL_TEXTURE_WRAP_T: switch (param) { + case GL_MIRRORED_REPEAT: + ti->tClamp = GR_TEXTURECLAMP_MIRROR_EXT; + break; case GL_CLAMP: ti->tClamp = GR_TEXTURECLAMP_CLAMP; break; @@ -328,8 +336,8 @@ fxDDTexDel(GLcontext * ctx, struct gl_texture_object *tObj) fxMesaContext fxMesa = FX_CONTEXT(ctx); tfxTexInfo *ti = fxTMGetTexInfo(tObj); - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDTexDel(%d,%p)\n", tObj->Name, (void *) ti); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(%d, %p)\n", __FUNCTION__, tObj->Name, (void *) ti); } if (!ti) @@ -419,8 +427,8 @@ fxDDTexPalette(GLcontext * ctx, struct gl_texture_object *tObj) if (tObj) { /* per-texture palette */ tfxTexInfo *ti; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDTexPalette(%d,%x)\n", + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(%d, %x)\n", __FUNCTION__, tObj->Name, (GLuint) tObj->DriverData); } if (!tObj->DriverData) @@ -431,8 +439,8 @@ fxDDTexPalette(GLcontext * ctx, struct gl_texture_object *tObj) } else { /* global texture palette */ - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDTexPalette(global)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(global)\n", __FUNCTION__); } convertPalette(fxMesa->glbPalette.data, &ctx->Texture.Palette); fxMesa->new_state |= FX_NEW_TEXTURING; @@ -445,8 +453,8 @@ fxDDTexUseGlbPalette(GLcontext * ctx, GLboolean state) { fxMesaContext fxMesa = FX_CONTEXT(ctx); - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDTexUseGlbPalette(%d)\n", state); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(%d)\n", __FUNCTION__, state); } if (state) { @@ -492,261 +500,107 @@ logbase2(int n) } } -/* Need different versions for different cpus. - */ -#define INT_TRICK(l2) (0x800000 * l2) - int fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, float *sscale, float *tscale, - int *i_sscale, int *i_tscale, int *wscale, int *hscale) + int *wscale, int *hscale) { /* [koolsmoky] */ - static GrLOD_t lod[12] = { GR_LOD_2048, GR_LOD_1024, GR_LOD_512, GR_LOD_256, GR_LOD_128, GR_LOD_64, GR_LOD_32, - GR_LOD_16, GR_LOD_8, GR_LOD_4, GR_LOD_2, GR_LOD_1 + static GrLOD_t lod[12] = { + GR_LOD_LOG2_1, + GR_LOD_LOG2_2, + GR_LOD_LOG2_4, + GR_LOD_LOG2_8, + GR_LOD_LOG2_16, + GR_LOD_LOG2_32, + GR_LOD_LOG2_64, + GR_LOD_LOG2_128, + GR_LOD_LOG2_256, + GR_LOD_LOG2_512, + GR_LOD_LOG2_1024, + GR_LOD_LOG2_2048 }; int logw, logh, ws, hs; GrLOD_t l; GrAspectRatio_t aspectratio; float s, t; - int is, it; logw = logbase2(w); logh = logbase2(h); switch (logw - logh) { case 0: - aspectratio = GR_ASPECT_1x1; - l = lod[11 - logw]; + aspectratio = GR_ASPECT_LOG2_1x1; + l = lod[logw]; s = t = 256.0f; - is = it = INT_TRICK(8); ws = hs = 1; break; case 1: - aspectratio = GR_ASPECT_2x1; - l = lod[11 - logw]; + aspectratio = GR_ASPECT_LOG2_2x1; + l = lod[logw]; s = 256.0f; t = 128.0f; - is = INT_TRICK(8); - it = INT_TRICK(7); ws = 1; hs = 1; break; case 2: - aspectratio = GR_ASPECT_4x1; - l = lod[11 - logw]; + aspectratio = GR_ASPECT_LOG2_4x1; + l = lod[logw]; s = 256.0f; t = 64.0f; - is = INT_TRICK(8); - it = INT_TRICK(6); ws = 1; hs = 1; break; case 3: - aspectratio = GR_ASPECT_8x1; - l = lod[11 - logw]; + aspectratio = GR_ASPECT_LOG2_8x1; + l = lod[logw]; s = 256.0f; t = 32.0f; - is = INT_TRICK(8); - it = INT_TRICK(5); ws = 1; hs = 1; break; - case 4: - aspectratio = GR_ASPECT_8x1; - l = lod[11 - logw]; - s = 256.0f; - t = 32.0f; - is = INT_TRICK(8); - it = INT_TRICK(5); - ws = 1; - hs = 2; - break; - case 5: - aspectratio = GR_ASPECT_8x1; - l = lod[11 - logw]; - s = 256.0f; - t = 32.0f; - is = INT_TRICK(8); - it = INT_TRICK(5); - ws = 1; - hs = 4; - break; - case 6: - aspectratio = GR_ASPECT_8x1; - l = lod[11 - logw]; - s = 256.0f; - t = 32.0f; - is = INT_TRICK(8); - it = INT_TRICK(5); - ws = 1; - hs = 8; - break; - case 7: - aspectratio = GR_ASPECT_8x1; - l = lod[11 - logw]; - s = 256.0f; - t = 32.0f; - is = INT_TRICK(8); - it = INT_TRICK(5); - ws = 1; - hs = 16; - break; - case 8: - aspectratio = GR_ASPECT_8x1; - l = lod[11 - logw]; - s = 256.0f; - t = 32.0f; - is = INT_TRICK(8); - it = INT_TRICK(5); - ws = 1; - hs = 32; - break; - case 9: - aspectratio = GR_ASPECT_8x1; - l = lod[11 - logw]; - s = 256.0f; - t = 32.0f; - is = INT_TRICK(8); - it = INT_TRICK(5); - ws = 1; - hs = 64; - break; - case 10: - aspectratio = GR_ASPECT_8x1; - l = lod[11 - logw]; - s = 256.0f; - t = 32.0f; - is = INT_TRICK(8); - it = INT_TRICK(5); - ws = 1; - hs = 128; - break; - case 11: - aspectratio = GR_ASPECT_8x1; - l = lod[11 - logw]; - s = 256.0f; - t = 32.0f; - is = INT_TRICK(8); - it = INT_TRICK(5); - ws = 1; - hs = 256; - break; case -1: - aspectratio = GR_ASPECT_1x2; - l = lod[11 - logh]; + aspectratio = GR_ASPECT_LOG2_1x2; + l = lod[logh]; s = 128.0f; t = 256.0f; - is = INT_TRICK(7); - it = INT_TRICK(8); ws = 1; hs = 1; break; case -2: - aspectratio = GR_ASPECT_1x4; - l = lod[11 - logh]; + aspectratio = GR_ASPECT_LOG2_1x4; + l = lod[logh]; s = 64.0f; t = 256.0f; - is = INT_TRICK(6); - it = INT_TRICK(8); ws = 1; hs = 1; break; case -3: - aspectratio = GR_ASPECT_1x8; - l = lod[11 - logh]; + aspectratio = GR_ASPECT_LOG2_1x8; + l = lod[logh]; s = 32.0f; t = 256.0f; - is = INT_TRICK(5); - it = INT_TRICK(8); ws = 1; hs = 1; break; - case -4: - aspectratio = GR_ASPECT_1x8; - l = lod[11 - logh]; - s = 32.0f; - t = 256.0f; - is = INT_TRICK(5); - it = INT_TRICK(8); - ws = 2; - hs = 1; - break; - case -5: - aspectratio = GR_ASPECT_1x8; - l = lod[11 - logh]; - s = 32.0f; - t = 256.0f; - is = INT_TRICK(5); - it = INT_TRICK(8); - ws = 4; - hs = 1; - break; - case -6: - aspectratio = GR_ASPECT_1x8; - l = lod[11 - logh]; - s = 32.0f; - t = 256.0f; - is = INT_TRICK(5); - it = INT_TRICK(8); - ws = 8; - hs = 1; - break; - case -7: - aspectratio = GR_ASPECT_1x8; - l = lod[11 - logh]; - s = 32.0f; - t = 256.0f; - is = INT_TRICK(5); - it = INT_TRICK(8); - ws = 16; - hs = 1; - break; - case -8: - aspectratio = GR_ASPECT_1x8; - l = lod[11 - logh]; - s = 32.0f; - t = 256.0f; - is = INT_TRICK(5); - it = INT_TRICK(8); - ws = 32; - hs = 1; - break; - case -9: - aspectratio = GR_ASPECT_1x8; - l = lod[11 - logh]; - s = 32.0f; - t = 256.0f; - is = INT_TRICK(5); - it = INT_TRICK(8); - ws = 64; - hs = 1; - break; - case -10: - aspectratio = GR_ASPECT_1x8; - l = lod[11 - logh]; - s = 32.0f; - t = 256.0f; - is = INT_TRICK(5); - it = INT_TRICK(8); - ws = 128; - hs = 1; - break; - case -11: - aspectratio = GR_ASPECT_1x8; - l = lod[11 - logh]; - s = 32.0f; - t = 256.0f; - is = INT_TRICK(5); - it = INT_TRICK(8); - ws = 256; - hs = 1; - break; default: - return 0; - break; + if ((logw - logh) > 3) { + aspectratio = GR_ASPECT_LOG2_8x1; + l = lod[logw]; + s = 256.0f; + t = 32.0f; + ws = 1; + hs = 1 << (logw - logh - 3); + } else /*if ((logw - logh) < -3)*/ { + aspectratio = GR_ASPECT_LOG2_1x8; + l = lod[logh]; + s = 32.0f; + t = 256.0f; + ws = 1 << (logh - logw - 3); + hs = 1; + } } if (lodlevel) @@ -767,12 +621,6 @@ fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, if (hscale) (*hscale) = hs; - if (i_sscale) - *i_sscale = is; - - if (i_tscale) - *i_tscale = it; - return 1; } @@ -785,6 +633,7 @@ void fxTexGetFormat(GLcontext *ctx, GLenum glformat, GrTextureFormat_t * tfmt, GLint * ifmt) /* [koolsmoky] */ { fxMesaContext fxMesa = FX_CONTEXT(ctx); + GLboolean allow32bpt = fxMesa->HaveTexFmt; switch (glformat) { case 1: @@ -845,19 +694,10 @@ fxTexGetFormat(GLcontext *ctx, GLenum glformat, GrTextureFormat_t * tfmt, GLint case GL_RGB10: case GL_RGB12: case GL_RGB16: -#if 0 /* [koolsmoky] getting ready for 32bpp textures */ - if (fxMesa->colDepth == 32) { - if (tfmt) (*tfmt) = GR_TEXFMT_ARGB_8888; - } else { - if (tfmt) (*tfmt) = GR_TEXFMT_RGB_565; - } - if (ifmt) (*ifmt) = GL_RGB; -#else if (tfmt) - (*tfmt) = GR_TEXFMT_RGB_565; + (*tfmt) = allow32bpt ? GR_TEXFMT_ARGB_8888 : GR_TEXFMT_RGB_565; if (ifmt) (*ifmt) = GL_RGB; -#endif break; case GL_RGBA2: case GL_RGBA4: @@ -872,20 +712,11 @@ fxTexGetFormat(GLcontext *ctx, GLenum glformat, GrTextureFormat_t * tfmt, GLint case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: -#if 0 /* [koolsmoky] getting ready for 32bpp textures */ - if (fxMesa->colDepth == 32) { - if (tfmt) (*tfmt) = GR_TEXFMT_ARGB_8888; - } else { - if (tfmt) (*tfmt) = GR_TEXFMT_ARGB_4444; - } - if (ifmt) (*ifmt) = GL_RGBA; -#else if (tfmt) - (*tfmt) = GR_TEXFMT_ARGB_4444; + (*tfmt) = allow32bpt ? GR_TEXFMT_ARGB_8888 : GR_TEXFMT_ARGB_4444; if (ifmt) (*ifmt) = GL_RGBA; -#endif - break; + break; case GL_RGB5_A1: if (tfmt) (*tfmt) = GR_TEXFMT_ARGB_1555; @@ -905,9 +736,8 @@ fxTexGetFormat(GLcontext *ctx, GLenum glformat, GrTextureFormat_t * tfmt, GLint (*ifmt) = GL_RGBA; /* XXX why is this RGBA? */ break; default: - fprintf(stderr, - "fx Driver: unsupported internalFormat (0x%x) in fxTexGetFormat()\n", - glformat); + fprintf(stderr, "%s: ERROR: unsupported internalFormat (0x%x)\n", + __FUNCTION__, glformat); fxCloseHardware(); exit(-1); break; @@ -921,9 +751,8 @@ fxIsTexSupported(GLenum target, GLint internalFormat, if (target != GL_TEXTURE_2D) return GL_FALSE; - if (!fxTexGetInfo - (image->Width, image->Height, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL)) return GL_FALSE; + if (!fxTexGetInfo(image->Width, image->Height, NULL, NULL, NULL, NULL, NULL, NULL)) + return GL_FALSE; if (image->Border > 0) return GL_FALSE; @@ -1051,9 +880,9 @@ fetch_r5g6b5(const struct gl_texture_image *texImage, j = j * mml->hScale; texel = ((GLushort *) texImage->Data) + j * mml->width + i; - rgba[RCOMP] = (((*texel) >> 11) & 0x1f) * 255 / 31; - rgba[GCOMP] = (((*texel) >> 5) & 0x3f) * 255 / 63; - rgba[BCOMP] = (((*texel) >> 0) & 0x1f) * 255 / 31; + rgba[RCOMP] = FX_rgb_scale_5[(*texel >> 11) & 0x1F]; + rgba[GCOMP] = FX_rgb_scale_6[(*texel >> 5) & 0x3F]; + rgba[BCOMP] = FX_rgb_scale_5[ *texel & 0x1F]; rgba[ACOMP] = 255; } @@ -1070,10 +899,10 @@ fetch_r4g4b4a4(const struct gl_texture_image *texImage, j = j * mml->hScale; texel = ((GLushort *) texImage->Data) + j * mml->width + i; - rgba[RCOMP] = (((*texel) >> 12) & 0xf) * 255 / 15; - rgba[GCOMP] = (((*texel) >> 8) & 0xf) * 255 / 15; - rgba[BCOMP] = (((*texel) >> 4) & 0xf) * 255 / 15; - rgba[ACOMP] = (((*texel) >> 0) & 0xf) * 255 / 15; + rgba[RCOMP] = FX_rgb_scale_4[(*texel >> 12) & 0xF]; + rgba[GCOMP] = FX_rgb_scale_4[(*texel >> 8) & 0xF]; + rgba[BCOMP] = FX_rgb_scale_4[(*texel >> 4) & 0xF]; + rgba[ACOMP] = FX_rgb_scale_4[ *texel & 0xF]; } @@ -1089,14 +918,13 @@ fetch_r5g5b5a1(const struct gl_texture_image *texImage, j = j * mml->hScale; texel = ((GLushort *) texImage->Data) + j * mml->width + i; - rgba[RCOMP] = (((*texel) >> 11) & 0x1f) * 255 / 31; - rgba[GCOMP] = (((*texel) >> 6) & 0x1f) * 255 / 31; - rgba[BCOMP] = (((*texel) >> 1) & 0x1f) * 255 / 31; - rgba[ACOMP] = (((*texel) >> 0) & 0x01) * 255; + rgba[RCOMP] = FX_rgb_scale_5[(*texel >> 11) & 0x1F]; + rgba[GCOMP] = FX_rgb_scale_5[(*texel >> 6) & 0x1F]; + rgba[BCOMP] = FX_rgb_scale_5[(*texel >> 1) & 0x1F]; + rgba[ACOMP] = ((*texel) & 0x01) * 255; } -#if 0 /* [koolsmoky] getting ready for 32bpp textures */ static void fetch_a8r8g8b8(const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLvoid * texelOut) @@ -1110,11 +938,10 @@ fetch_a8r8g8b8(const struct gl_texture_image *texImage, texel = ((GLuint *) texImage->Data) + j * mml->width + i; rgba[RCOMP] = (((*texel) >> 16) & 0xff); - rgba[GCOMP] = (((*texel) >> 8) & 0xff); - rgba[BCOMP] = (((*texel)) & 0xff); + rgba[GCOMP] = (((*texel) >> 8) & 0xff); + rgba[BCOMP] = (((*texel) ) & 0xff); rgba[ACOMP] = (((*texel) >> 24) & 0xff); } -#endif static void @@ -1124,12 +951,12 @@ PrintTexture(int w, int h, int c, const GLubyte * data) for (i = 0; i < h; i++) { for (j = 0; j < w; j++) { if (c == 2) - printf("%02x %02x ", data[0], data[1]); + fprintf(stderr, "%02x %02x ", data[0], data[1]); else if (c == 3) - printf("%02x %02x %02x ", data[0], data[1], data[2]); + fprintf(stderr, "%02x %02x %02x ", data[0], data[1], data[2]); data += c; } - printf("\n"); + fprintf(stderr, "\n"); } } @@ -1139,6 +966,11 @@ fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat, GLenum srcFormat, GLenum srcType ) { fxMesaContext fxMesa = FX_CONTEXT(ctx); + GLboolean allow32bpt = fxMesa->HaveTexFmt; + + if (TDFX_DEBUG & VERBOSE_TEXTURE) { + fprintf(stderr, "fxDDChooseTextureFormat(...)\n"); + } switch (internalFormat) { case GL_INTENSITY: @@ -1146,6 +978,7 @@ fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_INTENSITY8: case GL_INTENSITY12: case GL_INTENSITY16: + case GL_COMPRESSED_INTENSITY: return &_mesa_texformat_i8; case 1: case GL_LUMINANCE: @@ -1153,12 +986,14 @@ fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE8: case GL_LUMINANCE12: case GL_LUMINANCE16: + case GL_COMPRESSED_LUMINANCE: return &_mesa_texformat_l8; case GL_ALPHA: case GL_ALPHA4: case GL_ALPHA8: case GL_ALPHA12: case GL_ALPHA16: + case GL_COMPRESSED_ALPHA: return &_mesa_texformat_a8; case GL_COLOR_INDEX: case GL_COLOR_INDEX1_EXT: @@ -1176,6 +1011,7 @@ fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE12_ALPHA4: case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: + case GL_COMPRESSED_LUMINANCE_ALPHA: return &_mesa_texformat_al88; case GL_R3_G3_B2: case GL_RGB4: @@ -1183,33 +1019,57 @@ fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat, return &_mesa_texformat_rgb565; case 3: case GL_RGB: + case GL_COMPRESSED_RGB: + if ( srcFormat == GL_RGB && srcType == GL_UNSIGNED_SHORT_5_6_5 ) { + return &_mesa_texformat_rgb565; + } + /* intentional fall through */ case GL_RGB8: case GL_RGB10: case GL_RGB12: case GL_RGB16: -#if 0 /* [koolsmoky] getting ready for 32bpp textures */ - return (fxMesa->colDepth == 32) ? &_mesa_texformat_argb8888 - : &_mesa_texformat_rgb565; -#else - return &_mesa_texformat_rgb565; -#endif + return (allow32bpt) ? &_mesa_texformat_argb8888 + : &_mesa_texformat_rgb565; case GL_RGBA2: case GL_RGBA4: return &_mesa_texformat_argb4444; case 4: case GL_RGBA: + case GL_COMPRESSED_RGBA: + if ( srcFormat == GL_BGRA ) { + if ( srcType == GL_UNSIGNED_INT_8_8_8_8_REV ) { + return &_mesa_texformat_argb8888; + } + else if ( srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ) { + return &_mesa_texformat_argb4444; + } + else if ( srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ) { + return &_mesa_texformat_argb1555; + } + } + /* intentional fall through */ case GL_RGBA8: case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: -#if 0 /* [koolsmoky] getting ready for 32bpp textures */ - return (fxMesa->colDepth == 32) ? &_mesa_texformat_argb8888 - : &_mesa_texformat_argb4444; -#else - return &_mesa_texformat_argb4444; -#endif + return (allow32bpt) ? &_mesa_texformat_argb8888 + : &_mesa_texformat_argb4444; case GL_RGB5_A1: return &_mesa_texformat_argb1555; +#if 0 + /* GL_EXT_texture_compression_s3tc */ + case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: + return &_mesa_texformat_rgb_dxt1; + case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: + return &_mesa_texformat_rgba_dxt1; + case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: + return &_mesa_texformat_rgba_dxt3; + case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: + return &_mesa_texformat_rgba_dxt5; + /*case GL_COMPRESSED_RGB_FXT1_3DFX: + case GL_COMPRESSED_RGBA_FXT1_3DFX: + return blah;*/ +#endif default: _mesa_problem(NULL, "unexpected format in fxDDChooseTextureFormat"); return NULL; @@ -1237,9 +1097,22 @@ fxGlideFormat(GLint mesaFormat) return GR_TEXFMT_ARGB_4444; case MESA_FORMAT_ARGB1555: return GR_TEXFMT_ARGB_1555; -#if 0 /* [koolsmoky] getting ready for 32bpp textures */ +#if 1 /* [koolsmoky] getting ready for 32bpp textures */ case MESA_FORMAT_ARGB8888: return GR_TEXFMT_ARGB_8888; +#endif +#if 0 + case MESA_FORMAT_RGB_DXT1: + case MESA_FORMAT_RGBA_DXT1: + return GR_TEXFMT_ARGB_CMP_DXT1; + case MESA_FORMAT_RGBA_DXT3: + return GR_TEXFMT_ARGB_CMP_DXT3; + case MESA_FORMAT_RGBA_DXT5: + return GR_TEXFMT_ARGB_CMP_DXT5; + /*case MESA_FORMAT_ARGB_CMP_FXT1: + return GR_TEXFMT_ARGB_CMP_FXT1; + case MESA_FORMAT_RGB_CMP_FXT1: + return GL_COMPRESSED_RGBA_FXT1_3DFX;*/ #endif default: _mesa_problem(NULL, "Unexpected format in fxGlideFormat"); @@ -1268,12 +1141,19 @@ fxFetchFunction(GLint mesaFormat) return fetch_r4g4b4a4; case MESA_FORMAT_ARGB1555: return fetch_r5g5b5a1; -#if 0 /* [koolsmoky] getting ready for 32bpp textures */ +#if 1 /* [koolsmoky] getting ready for 32bpp textures */ case MESA_FORMAT_ARGB8888: return fetch_a8r8g8b8; +#endif +#if 0 + case MESA_FORMAT_RGB_DXT1: + case MESA_FORMAT_RGBA_DXT1: + case MESA_FORMAT_RGBA_DXT3: + case MESA_FORMAT_RGBA_DXT5: + return fetch_r4g4b4a4; #endif default: - _mesa_problem(NULL, "Unexpected format in fxGlideFormat"); + _mesa_problem(NULL, "Unexpected format in fxFetchFunction"); return NULL; } } @@ -1286,11 +1166,17 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); tfxTexInfo *ti; tfxMipMapLevel *mml; GLint texelBytes; + if (TDFX_DEBUG & VERBOSE_TEXTURE) { + fprintf(stderr, "fxDDTexImage2D: id=%d int 0x%x format 0x%x type 0x%x %dx%d\n", + texObj->Name, texImage->IntFormat, format, type, + texImage->Width, texImage->Height); + } + if (!fxIsTexSupported(target, internalFormat, texImage)) { _mesa_problem(NULL, "fx Driver: unsupported texture in fxDDTexImg()\n"); return; @@ -1306,7 +1192,7 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, ti = fxTMGetTexInfo(texObj); if (!texImage->DriverData) { - texImage->DriverData = MALLOC(sizeof(tfxMipMapLevel)); + texImage->DriverData = CALLOC(sizeof(tfxMipMapLevel)); if (!texImage->DriverData) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); return; @@ -1315,7 +1201,7 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, mml = FX_MIPMAP_DATA(texImage); fxTexGetInfo(width, height, NULL, NULL, NULL, NULL, - NULL, NULL, &mml->wScale, &mml->hScale); + &mml->wScale, &mml->hScale); mml->width = width * mml->wScale; mml->height = height * mml->hScale; @@ -1327,7 +1213,7 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, internalFormat, format, type); assert(texImage->TexFormat); texelBytes = texImage->TexFormat->TexelBytes; - assert(texelBytes == 1 || texelBytes == 2); + /*if (!fxMesa->HaveTexFmt) assert(texelBytes == 1 || texelBytes == 2);*/ if (mml->wScale != 1 || mml->hScale != 1) { /* rescale image to overcome 1:8 aspect limitation */ @@ -1346,7 +1232,7 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, 0, /* dstImageStride */ format, type, pixels, packing); assert(!texImage->Data); - texImage->Data = MALLOC(mml->width * mml->height * texelBytes); + texImage->Data = MESA_PBUFFER_ALLOC(mml->width * mml->height * texelBytes); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); FREE(tempImage); @@ -1362,7 +1248,7 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, else { /* no rescaling needed */ assert(!texImage->Data); - texImage->Data = MALLOC(mml->width * mml->height * texelBytes); + texImage->Data = MESA_PBUFFER_ALLOC(mml->width * mml->height * texelBytes); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); return; @@ -1377,16 +1263,18 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, } mml->glideFormat = fxGlideFormat(texImage->TexFormat->MesaFormat); + ti->info.format = mml->glideFormat; texImage->FetchTexel = fxFetchFunction(texImage->TexFormat->MesaFormat); - fxTexInvalidate(ctx, texObj); - - if (ti->validated && ti->isInTM) { - /*printf("reloadmipmaplevels\n"); */ + /* [dBorca] + * Hack alert: unsure... + */ + if (!(fxMesa->new_state & FX_NEW_TEXTURING) && ti->validated && ti->isInTM) { + /*fprintf(stderr, "reloadmipmaplevels\n"); */ fxTMReloadMipMapLevel(fxMesa, texObj, level); } else { - /*printf("invalidate2\n"); */ + /*fprintf(stderr, "invalidate2\n"); */ fxTexInvalidate(ctx, texObj); } } @@ -1401,11 +1289,15 @@ fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); tfxTexInfo *ti; tfxMipMapLevel *mml; GLint texelBytes; + if (TDFX_DEBUG & VERBOSE_TEXTURE) { + fprintf(stderr, "fxDDTexSubImage2D: id=%d\n", texObj->Name); + } + if (!texObj->DriverData) { _mesa_problem(ctx, "problem in fxDDTexSubImage2D"); return; @@ -1425,7 +1317,7 @@ fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, /* need to rescale subimage to match mipmap level's rescale factors */ const GLint newWidth = width * mml->wScale; const GLint newHeight = height * mml->hScale; - GLvoid *scaledImage, *tempImage; + GLvoid *tempImage; GLubyte *destAddr; tempImage = MALLOC(width * height * texelBytes); if (!tempImage) { @@ -1443,13 +1335,6 @@ fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, format, type, pixels, packing); /* now rescale */ - scaledImage = MALLOC(newWidth * newHeight * texelBytes); - if (!scaledImage) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D"); - FREE(tempImage); - return; - } - /* compute address of dest subimage within the overal tex image */ destAddr = (GLubyte *) texImage->Data + (yoffset * mml->hScale * mml->width @@ -1462,7 +1347,6 @@ fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, tempImage, destAddr); FREE(tempImage); - FREE(scaledImage); } else { /* no rescaling needed */ @@ -1476,7 +1360,10 @@ fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, format, type, pixels, packing); } - if (ti->validated && ti->isInTM) + /* [dBorca] + * Hack alert: unsure... + */ + if (!(fxMesa->new_state & FX_NEW_TEXTURING) && ti->validated && ti->isInTM) fxTMReloadMipMapLevel(fxMesa, texObj, level); else fxTexInvalidate(ctx, texObj); diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h index 271cd85dfea..b404d52fa62 100644 --- a/src/mesa/drivers/glide/fxdrv.h +++ b/src/mesa/drivers/glide/fxdrv.h @@ -1,4 +1,4 @@ -/* $Id: fxdrv.h,v 1.58 2003/08/19 15:52:53 brianp Exp $ */ +/* $Id: fxdrv.h,v 1.59 2003/10/02 17:36:44 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -69,25 +69,12 @@ #define ZCOORD GR_VERTEX_OOZ_OFFSET #define OOWCOORD GR_VERTEX_OOW_OFFSET -#define RCOORD GR_VERTEX_R_OFFSET -#define GCOORD GR_VERTEX_G_OFFSET -#define BCOORD GR_VERTEX_B_OFFSET -#define ACOORD GR_VERTEX_A_OFFSET - #define S0COORD GR_VERTEX_SOW_TMU0_OFFSET #define T0COORD GR_VERTEX_TOW_TMU0_OFFSET #define S1COORD GR_VERTEX_SOW_TMU1_OFFSET #define T1COORD GR_VERTEX_TOW_TMU1_OFFSET -extern float gl_ubyte_to_float_255_color_tab[256]; -#define UBYTE_COLOR_TO_FLOAT_255_COLOR(c) gl_ubyte_to_float_255_color_tab[c] -#define UBYTE_COLOR_TO_FLOAT_255_COLOR2(f,c) \ - (*(int *)&(f)) = ((int *)gl_ubyte_to_float_255_color_tab)[c] - - - - #ifdef __i386__ #define FXCOLOR4( c ) (* (int *)c) @@ -208,10 +195,6 @@ typedef struct tfxTexInfo_t GrMipMapMode_t mmMode; GLfloat sScale, tScale; - GLint int_sScale, int_tScale; /* x86 floating point trick for - * multiplication by powers of 2. - * Used in fxfasttmp.h - */ GuTexPalette palette; @@ -252,6 +235,19 @@ typedef struct GLboolean depthTestEnabled; GLboolean depthMask; GrCmpFnc_t depthTestFunc; + FxI32 depthBias; + + /* Stencil */ + + GLboolean stencilEnabled; + GrCmpFnc_t stencilFunction; /* Stencil function */ + GrStencil_t stencilRefValue; /* Stencil reference value */ + GrStencil_t stencilValueMask; /* Value mask */ + GrStencil_t stencilWriteMask; /* Write mask */ + GrCmpFnc_t stencilFailFunc; /* Stencil fail function */ + GrCmpFnc_t stencilZFailFunc; /* Stencil pass, depth fail function */ + GrCmpFnc_t stencilZPassFunc; /* Stencil pass, depth pass function */ + GrStencil_t stencilClear; /* Buffer clear value */ } tfxUnitsState; @@ -268,6 +264,7 @@ tfxUnitsState; #define FX_NEW_SCISSOR 0x20 #define FX_NEW_COLOR_MASK 0x40 #define FX_NEW_CULL 0x80 +#define FX_NEW_STENCIL 0x100 #define FX_CONTEXT(ctx) ((fxMesaContext)((ctx)->DriverCtx)) @@ -327,8 +324,10 @@ extern GLubyte FX_PixelToR[0x10000]; extern GLubyte FX_PixelToG[0x10000]; extern GLubyte FX_PixelToB[0x10000]; -/* lookup table for scaling 5 bit colors up to 8 bits */ -GLuint FX_rgb_scale_5[32]; +/* lookup table for scaling y bit colors up to 8 bits */ +extern GLuint FX_rgb_scale_4[16]; +extern GLuint FX_rgb_scale_5[32]; +extern GLuint FX_rgb_scale_6[64]; typedef void (*fx_tri_func) (fxMesaContext, GrVertex *, GrVertex *, GrVertex *); typedef void (*fx_line_func) (fxMesaContext, GrVertex *, GrVertex *); @@ -359,6 +358,7 @@ struct tfxMesaContext GLuint new_state; + GLuint new_gl_state; /* Texture Memory Manager Data */ @@ -387,7 +387,7 @@ struct tfxMesaContext /* Rasterization: */ GLuint render_index; - GLuint is_in_hardware; + GLuint fallback; GLenum render_primitive; GLenum raster_primitive; @@ -419,7 +419,8 @@ struct tfxMesaContext GLboolean verbose; GLboolean haveTwoTMUs; /* True if we really have 2 tmu's */ - GLboolean haveAlphaBuffer; + GLboolean haveHwAlpha; + GLboolean haveHwStencil; GLboolean haveZBuffer; GLboolean haveDoubleBuffer; GLboolean haveGlobalPaletteTexture; @@ -430,19 +431,27 @@ struct tfxMesaContext int screen_width; int screen_height; - int initDone; int clipMinX; int clipMaxX; int clipMinY; int clipMaxY; int colDepth; - int maxTextureSize; /* [koolsmoky] */ -}; + GLboolean fsaa; + /* Glide (per card) capabilities. These get mirrored + * from `glbHWConfig' when creating a new context... + */ + GrSstType type; + FxBool HavePixExt; /* PIXEXT */ + FxBool HaveTexFmt; /* TEXFMT */ + FxBool HaveCmbExt; /* COMBINE */ + FxBool HaveMirExt; /* TEXMIRROR */ + FxBool HaveTexus2; /* Texus 2 - FXT1 */ + struct tdfx_glide Glide; + char rendererString[100]; +}; -extern GrHwConfiguration glbHWConfig; -extern int glbCurrentBoard; extern void fxSetupFXUnits(GLcontext *); extern void fxSetupDDPointers(GLcontext *); @@ -505,6 +514,9 @@ extern void fxDDAlphaFunc(GLcontext *, GLenum, GLfloat); extern void fxDDBlendFunc(GLcontext *, GLenum, GLenum); extern void fxDDDepthMask(GLcontext *, GLboolean); extern void fxDDDepthFunc(GLcontext *, GLenum); +extern void fxDDStencilFunc (GLcontext *ctx, GLenum func, GLint ref, GLuint mask); +extern void fxDDStencilMask (GLcontext *ctx, GLuint mask); +extern void fxDDStencilOp (GLcontext *ctx, GLenum sfail, GLenum zfail, GLenum zpass); extern void fxDDInitExtensions(GLcontext * ctx); @@ -524,7 +536,7 @@ extern void fxTMReloadSubMipMapLevel(fxMesaContext, extern void fxTexGetFormat(GLcontext *, GLenum, GrTextureFormat_t *, GLint *); /* [koolsmoky] */ extern int fxTexGetInfo(int, int, GrLOD_t *, GrAspectRatio_t *, - float *, float *, int *, int *, int *, int *); + float *, float *, int *, int *); extern void fxDDScissor(GLcontext * ctx, GLint x, GLint y, GLsizei w, GLsizei h); @@ -558,6 +570,7 @@ extern int fxDDInitFxMesaContext(fxMesaContext fxMesa); extern void fxDDDestroyFxMesaContext(fxMesaContext fxMesa); +void fxColorMask (fxMesaContext fxMesa, GLboolean enable); extern void fxSetScissorValues(GLcontext * ctx); @@ -567,6 +580,19 @@ extern void fxInitPixelTables(fxMesaContext fxMesa, GLboolean bgrOrder); extern void fxCheckIsInHardware(GLcontext *ctx); -extern GLboolean fx_check_IsInHardware(GLcontext *ctx); +/* Flags for software fallback cases */ +#define FX_FALLBACK_TEXTURE_1D_3D 0x0001 +#define FX_FALLBACK_DRAW_BUFFER 0x0002 +#define FX_FALLBACK_SPECULAR 0x0004 +#define FX_FALLBACK_STENCIL 0x0008 +#define FX_FALLBACK_RENDER_MODE 0x0010 +#define FX_FALLBACK_LOGICOP 0x0020 +#define FX_FALLBACK_TEXTURE_ENV 0x0040 +#define FX_FALLBACK_TEXTURE_BORDER 0x0080 +#define FX_FALLBACK_COLORMASK 0x0100 +#define FX_FALLBACK_BLEND 0x0200 +#define FX_FALLBACK_TEXTURE_MULTI 0x0400 + +extern GLuint fx_check_IsInHardware(GLcontext *ctx); #endif diff --git a/src/mesa/drivers/glide/fxg.c b/src/mesa/drivers/glide/fxg.c new file mode 100644 index 00000000000..3d00e080b17 --- /dev/null +++ b/src/mesa/drivers/glide/fxg.c @@ -0,0 +1,2135 @@ +/* + * Mesa 3-D graphics library + * Version: 5.0.1 + * + * Copyright (C) 1999-2003 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. + */ + +/* + * Mesa/FX device driver. Interface to Glide3. + * + * Copyright (c) 2003 - Daniel Borca + * Email : dborca@users.sourceforge.net + * Web : http://www.geocities.com/dborca + */ + + +#include +#include +#include + +#define DEBUG_TRAP_internal +#include "fxg.h" + + + +/****************************************************************************\ +* logging * +\****************************************************************************/ +#if DEBUG_TRAP +#define TRAP_LOG trap_printf +#ifdef __GNUC__ +__attribute__ ((format(printf, 1, 2))) +#endif /* __GNUC__ */ +int trap_printf (const char *format, ...) +{ + va_list arg; + int n; + FILE *trap_file; + va_start(arg, format); + trap_file = fopen("trap.log", "a"); + if (trap_file == NULL) { + trap_file = stderr; + } + n = vfprintf(trap_file, format, arg); + fclose(trap_file); + va_end(arg); + return n; +} +#else /* DEBUG_TRAP */ +#ifdef __GNUC__ +#define TRAP_LOG(format, ...) do {} while (0) +#else /* __GNUC__ */ +#define TRAP_LOG 0 && (unsigned long) +#endif /* __GNUC__ */ +#endif /* DEBUG_TRAP */ + + + +#if DEBUG_TRAP +/****************************************************************************\ +* helpers * +\****************************************************************************/ + +#define GOT "\t" + +const char *TRP_BOOL (FxBool b) +{ + return b ? "FXTRUE" : "FXFALSE"; +} + +#define TRAP_CASE_STRING(name) case name: return #name +#define TRAP_NODEFAULT default: assert(0) + +const char *TRP_PARAM (FxU32 mode) +{ + switch (mode) { + TRAP_CASE_STRING(GR_PARAM_DISABLE); + TRAP_CASE_STRING(GR_PARAM_ENABLE); + TRAP_NODEFAULT; + } +} + +const char *TRP_VTX (FxU32 param) +{ + switch (param) { + TRAP_CASE_STRING(GR_PARAM_XY); + TRAP_CASE_STRING(GR_PARAM_Z); + TRAP_CASE_STRING(GR_PARAM_W); + TRAP_CASE_STRING(GR_PARAM_Q); + TRAP_CASE_STRING(GR_PARAM_FOG_EXT); + TRAP_CASE_STRING(GR_PARAM_A); + TRAP_CASE_STRING(GR_PARAM_RGB); + TRAP_CASE_STRING(GR_PARAM_PARGB); + TRAP_CASE_STRING(GR_PARAM_ST0); + TRAP_CASE_STRING(GR_PARAM_ST1); + TRAP_CASE_STRING(GR_PARAM_ST2); + TRAP_CASE_STRING(GR_PARAM_Q0); + TRAP_CASE_STRING(GR_PARAM_Q1); + TRAP_CASE_STRING(GR_PARAM_Q2); + TRAP_NODEFAULT; + } +} + +const char *TRP_ARRAY (FxU32 mode) +{ + switch (mode) { + TRAP_CASE_STRING(GR_POINTS); + TRAP_CASE_STRING(GR_LINE_STRIP); + TRAP_CASE_STRING(GR_LINES); + TRAP_CASE_STRING(GR_POLYGON); + TRAP_CASE_STRING(GR_TRIANGLE_STRIP); + TRAP_CASE_STRING(GR_TRIANGLE_FAN); + TRAP_CASE_STRING(GR_TRIANGLES); + TRAP_CASE_STRING(GR_TRIANGLE_STRIP_CONTINUE); + TRAP_CASE_STRING(GR_TRIANGLE_FAN_CONTINUE); + TRAP_NODEFAULT; + } +} + +const char *TRP_BUFFER (GrBuffer_t buffer) +{ + switch (buffer) { + TRAP_CASE_STRING(GR_BUFFER_FRONTBUFFER); + TRAP_CASE_STRING(GR_BUFFER_BACKBUFFER); + TRAP_CASE_STRING(GR_BUFFER_AUXBUFFER); + TRAP_CASE_STRING(GR_BUFFER_DEPTHBUFFER); + TRAP_CASE_STRING(GR_BUFFER_ALPHABUFFER); + TRAP_CASE_STRING(GR_BUFFER_TRIPLEBUFFER); + TRAP_CASE_STRING(GR_BUFFER_TEXTUREBUFFER_EXT); + TRAP_CASE_STRING(GR_BUFFER_TEXTUREAUXBUFFER_EXT); + TRAP_NODEFAULT; + } +} + +const char *TRP_ORIGIN (GrOriginLocation_t origin_location) +{ + switch (origin_location) { + TRAP_CASE_STRING(GR_ORIGIN_UPPER_LEFT); + TRAP_CASE_STRING(GR_ORIGIN_LOWER_LEFT); + TRAP_CASE_STRING(GR_ORIGIN_ANY); + TRAP_NODEFAULT; + } +} + +const char *TRP_REFRESH (GrScreenRefresh_t refresh_rate) +{ + switch (refresh_rate) { + TRAP_CASE_STRING(GR_REFRESH_60Hz); + TRAP_CASE_STRING(GR_REFRESH_70Hz); + TRAP_CASE_STRING(GR_REFRESH_72Hz); + TRAP_CASE_STRING(GR_REFRESH_75Hz); + TRAP_CASE_STRING(GR_REFRESH_80Hz); + TRAP_CASE_STRING(GR_REFRESH_90Hz); + TRAP_CASE_STRING(GR_REFRESH_100Hz); + TRAP_CASE_STRING(GR_REFRESH_85Hz); + TRAP_CASE_STRING(GR_REFRESH_120Hz); + TRAP_CASE_STRING(GR_REFRESH_NONE); + TRAP_NODEFAULT; + } +} + +const char *TRP_COLFMT (GrColorFormat_t color_format) +{ + switch (color_format) { + TRAP_CASE_STRING(GR_COLORFORMAT_ARGB); + TRAP_CASE_STRING(GR_COLORFORMAT_ABGR); + TRAP_CASE_STRING(GR_COLORFORMAT_RGBA); + TRAP_CASE_STRING(GR_COLORFORMAT_BGRA); + TRAP_NODEFAULT; + } +} + +const char *TRP_RESOLUTION (GrScreenResolution_t screen_resolution) +{ + switch (screen_resolution) { + TRAP_CASE_STRING(GR_RESOLUTION_320x200); + TRAP_CASE_STRING(GR_RESOLUTION_320x240); + TRAP_CASE_STRING(GR_RESOLUTION_400x256); + TRAP_CASE_STRING(GR_RESOLUTION_512x384); + TRAP_CASE_STRING(GR_RESOLUTION_640x200); + TRAP_CASE_STRING(GR_RESOLUTION_640x350); + TRAP_CASE_STRING(GR_RESOLUTION_640x400); + TRAP_CASE_STRING(GR_RESOLUTION_640x480); + TRAP_CASE_STRING(GR_RESOLUTION_800x600); + TRAP_CASE_STRING(GR_RESOLUTION_960x720); + TRAP_CASE_STRING(GR_RESOLUTION_856x480); + TRAP_CASE_STRING(GR_RESOLUTION_512x256); + TRAP_CASE_STRING(GR_RESOLUTION_1024x768); + TRAP_CASE_STRING(GR_RESOLUTION_1280x1024); + TRAP_CASE_STRING(GR_RESOLUTION_1600x1200); + TRAP_CASE_STRING(GR_RESOLUTION_400x300); + TRAP_CASE_STRING(GR_RESOLUTION_1152x864); + TRAP_CASE_STRING(GR_RESOLUTION_1280x960); + TRAP_CASE_STRING(GR_RESOLUTION_1600x1024); + TRAP_CASE_STRING(GR_RESOLUTION_1792x1344); + TRAP_CASE_STRING(GR_RESOLUTION_1856x1392); + TRAP_CASE_STRING(GR_RESOLUTION_1920x1440); + TRAP_CASE_STRING(GR_RESOLUTION_2048x1536); + TRAP_CASE_STRING(GR_RESOLUTION_2048x2048); + TRAP_CASE_STRING(GR_RESOLUTION_NONE); + TRAP_NODEFAULT; + } +} + +const char *TRP_BLEND (GrAlphaBlendFnc_t func) +{ + switch (func) { + TRAP_CASE_STRING(GR_BLEND_ZERO); + TRAP_CASE_STRING(GR_BLEND_SRC_ALPHA); + TRAP_CASE_STRING(GR_BLEND_SRC_COLOR); + /*TRAP_CASE_STRING(GR_BLEND_DST_COLOR); ==GR_BLEND_SRC_COLOR*/ + TRAP_CASE_STRING(GR_BLEND_DST_ALPHA); + TRAP_CASE_STRING(GR_BLEND_ONE); + TRAP_CASE_STRING(GR_BLEND_ONE_MINUS_SRC_ALPHA); + TRAP_CASE_STRING(GR_BLEND_ONE_MINUS_SRC_COLOR); + /*TRAP_CASE_STRING(GR_BLEND_ONE_MINUS_DST_COLOR); ==GR_BLEND_ONE_MINUS_SRC_COLOR*/ + TRAP_CASE_STRING(GR_BLEND_ONE_MINUS_DST_ALPHA); + TRAP_CASE_STRING(GR_BLEND_RESERVED_8); + TRAP_CASE_STRING(GR_BLEND_RESERVED_9); + TRAP_CASE_STRING(GR_BLEND_RESERVED_A); + TRAP_CASE_STRING(GR_BLEND_RESERVED_B); + TRAP_CASE_STRING(GR_BLEND_RESERVED_C); + TRAP_CASE_STRING(GR_BLEND_RESERVED_D); + TRAP_CASE_STRING(GR_BLEND_RESERVED_E); + TRAP_CASE_STRING(GR_BLEND_ALPHA_SATURATE); + /*TRAP_CASE_STRING(GR_BLEND_PREFOG_COLOR); ==GR_BLEND_ALPHA_SATURATE*/ + TRAP_NODEFAULT; + } +} + +const char *TRP_CMBFUNC (GrCombineFunction_t cfunc) +{ + switch (cfunc) { + TRAP_CASE_STRING(GR_COMBINE_FUNCTION_ZERO); + /*TRAP_CASE_STRING(GR_COMBINE_FUNCTION_NONE); ==GR_COMBINE_FUNCTION_ZERO*/ + TRAP_CASE_STRING(GR_COMBINE_FUNCTION_LOCAL); + TRAP_CASE_STRING(GR_COMBINE_FUNCTION_LOCAL_ALPHA); + TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER); + /*TRAP_CASE_STRING(GR_COMBINE_FUNCTION_BLEND_OTHER); ==GR_COMBINE_FUNCTION_SCALE_OTHER*/ + TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL); + TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL_ALPHA); + TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL); + TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL); + /*TRAP_CASE_STRING(GR_COMBINE_FUNCTION_BLEND); ==GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL*/ + TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL_ALPHA); + TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL); + /*TRAP_CASE_STRING(GR_COMBINE_FUNCTION_BLEND_LOCAL); ==GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL*/ + TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL_ALPHA); + TRAP_NODEFAULT; + } +} + +const char *TRP_CMBFACT (GrCombineFactor_t cfactor) +{ + switch (cfactor) { + TRAP_CASE_STRING(GR_COMBINE_FACTOR_ZERO); + /*TRAP_CASE_STRING(GR_COMBINE_FACTOR_NONE); ==GR_COMBINE_FACTOR_ZERO*/ + TRAP_CASE_STRING(GR_COMBINE_FACTOR_LOCAL); + TRAP_CASE_STRING(GR_COMBINE_FACTOR_OTHER_ALPHA); + TRAP_CASE_STRING(GR_COMBINE_FACTOR_LOCAL_ALPHA); + TRAP_CASE_STRING(GR_COMBINE_FACTOR_TEXTURE_ALPHA); + TRAP_CASE_STRING(GR_COMBINE_FACTOR_TEXTURE_RGB); + /*TRAP_CASE_STRING(GR_COMBINE_FACTOR_DETAIL_FACTOR); ==GR_COMBINE_FACTOR_TEXTURE_ALPHA*/ + /*TRAP_CASE_STRING(GR_COMBINE_FACTOR_LOD_FRACTION); ==GR_COMBINE_FACTOR_TEXTURE_RGB ???*/ + TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE); + TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_LOCAL); + TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA); + TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA); + TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA); + /*TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR); ==GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA*/ + TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION); + TRAP_NODEFAULT; + } +} + +const char *TRP_CMBLOCAL (GrCombineLocal_t clocal) +{ + switch (clocal) { + TRAP_CASE_STRING(GR_COMBINE_LOCAL_ITERATED); + TRAP_CASE_STRING(GR_COMBINE_LOCAL_CONSTANT); + /*TRAP_CASE_STRING(GR_COMBINE_LOCAL_NONE); ==GR_COMBINE_LOCAL_CONSTANT*/ + TRAP_CASE_STRING(GR_COMBINE_LOCAL_DEPTH); + TRAP_NODEFAULT; + } +} + +const char *TRP_CMBOTHER (GrCombineOther_t cother) +{ + switch (cother) { + TRAP_CASE_STRING(GR_COMBINE_OTHER_ITERATED); + TRAP_CASE_STRING(GR_COMBINE_OTHER_TEXTURE); + TRAP_CASE_STRING(GR_COMBINE_OTHER_CONSTANT); + /*TRAP_CASE_STRING(GR_COMBINE_OTHER_NONE); ==GR_COMBINE_OTHER_CONSTANT*/ + TRAP_NODEFAULT; + } +} + +const char *TRP_CMPFUNC (GrCmpFnc_t function) +{ + switch (function) { + TRAP_CASE_STRING(GR_CMP_NEVER); + TRAP_CASE_STRING(GR_CMP_LESS); + TRAP_CASE_STRING(GR_CMP_EQUAL); + TRAP_CASE_STRING(GR_CMP_LEQUAL); + TRAP_CASE_STRING(GR_CMP_GREATER); + TRAP_CASE_STRING(GR_CMP_NOTEQUAL); + TRAP_CASE_STRING(GR_CMP_GEQUAL); + TRAP_CASE_STRING(GR_CMP_ALWAYS); + TRAP_NODEFAULT; + } +} + +const char *TRP_CKMODE (GrChromakeyMode_t mode) +{ + switch (mode) { + TRAP_CASE_STRING(GR_CHROMAKEY_DISABLE); + TRAP_CASE_STRING(GR_CHROMAKEY_ENABLE); + TRAP_NODEFAULT; + } +} + +const char *TRP_CULLMODE (GrCullMode_t mode) +{ + switch (mode) { + TRAP_CASE_STRING(GR_CULL_DISABLE); + TRAP_CASE_STRING(GR_CULL_NEGATIVE); + TRAP_CASE_STRING(GR_CULL_POSITIVE); + TRAP_NODEFAULT; + } +} + +const char *TRP_DEPTHMODE (GrDepthBufferMode_t mode) +{ + switch (mode) { + TRAP_CASE_STRING(GR_DEPTHBUFFER_DISABLE); + TRAP_CASE_STRING(GR_DEPTHBUFFER_ZBUFFER); + TRAP_CASE_STRING(GR_DEPTHBUFFER_WBUFFER); + TRAP_CASE_STRING(GR_DEPTHBUFFER_ZBUFFER_COMPARE_TO_BIAS); + TRAP_CASE_STRING(GR_DEPTHBUFFER_WBUFFER_COMPARE_TO_BIAS); + TRAP_NODEFAULT; + } +} + +const char *TRP_DITHERMODE (GrDitherMode_t mode) +{ + switch (mode) { + TRAP_CASE_STRING(GR_DITHER_DISABLE); + TRAP_CASE_STRING(GR_DITHER_2x2); + TRAP_CASE_STRING(GR_DITHER_4x4); + TRAP_NODEFAULT; + } +} + +const char *TRP_FOGMODE (GrFogMode_t mode) +{ + switch (mode) { + TRAP_CASE_STRING(GR_FOG_DISABLE); + TRAP_CASE_STRING(GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT); + TRAP_CASE_STRING(GR_FOG_WITH_TABLE_ON_Q); + /*TRAP_CASE_STRING(GR_FOG_WITH_TABLE_ON_W); ==GR_FOG_WITH_TABLE_ON_Q*/ + TRAP_CASE_STRING(GR_FOG_WITH_ITERATED_Z); + TRAP_CASE_STRING(GR_FOG_WITH_ITERATED_ALPHA_EXT); + TRAP_CASE_STRING(GR_FOG_MULT2); + TRAP_CASE_STRING(GR_FOG_ADD2); + TRAP_NODEFAULT; + } +} + +const char *TRP_GETNAME (FxU32 pname) +{ + switch (pname) { + TRAP_CASE_STRING(GR_BITS_DEPTH); + TRAP_CASE_STRING(GR_BITS_RGBA); + TRAP_CASE_STRING(GR_FIFO_FULLNESS); + TRAP_CASE_STRING(GR_FOG_TABLE_ENTRIES); + TRAP_CASE_STRING(GR_GAMMA_TABLE_ENTRIES); + TRAP_CASE_STRING(GR_GLIDE_STATE_SIZE); + TRAP_CASE_STRING(GR_GLIDE_VERTEXLAYOUT_SIZE); + TRAP_CASE_STRING(GR_IS_BUSY); + TRAP_CASE_STRING(GR_LFB_PIXEL_PIPE); + TRAP_CASE_STRING(GR_MAX_TEXTURE_SIZE); + TRAP_CASE_STRING(GR_MAX_TEXTURE_ASPECT_RATIO); + TRAP_CASE_STRING(GR_MEMORY_FB); + TRAP_CASE_STRING(GR_MEMORY_TMU); + TRAP_CASE_STRING(GR_MEMORY_UMA); + TRAP_CASE_STRING(GR_NUM_BOARDS); + TRAP_CASE_STRING(GR_NON_POWER_OF_TWO_TEXTURES); + TRAP_CASE_STRING(GR_NUM_FB); + TRAP_CASE_STRING(GR_NUM_SWAP_HISTORY_BUFFER); + TRAP_CASE_STRING(GR_NUM_TMU); + TRAP_CASE_STRING(GR_PENDING_BUFFERSWAPS); + TRAP_CASE_STRING(GR_REVISION_FB); + TRAP_CASE_STRING(GR_REVISION_TMU); + TRAP_CASE_STRING(GR_STATS_LINES); + TRAP_CASE_STRING(GR_STATS_PIXELS_AFUNC_FAIL); + TRAP_CASE_STRING(GR_STATS_PIXELS_CHROMA_FAIL); + TRAP_CASE_STRING(GR_STATS_PIXELS_DEPTHFUNC_FAIL); + TRAP_CASE_STRING(GR_STATS_PIXELS_IN); + TRAP_CASE_STRING(GR_STATS_PIXELS_OUT); + TRAP_CASE_STRING(GR_STATS_PIXELS); + TRAP_CASE_STRING(GR_STATS_POINTS); + TRAP_CASE_STRING(GR_STATS_TRIANGLES_IN); + TRAP_CASE_STRING(GR_STATS_TRIANGLES_OUT); + TRAP_CASE_STRING(GR_STATS_TRIANGLES); + TRAP_CASE_STRING(GR_SWAP_HISTORY); + TRAP_CASE_STRING(GR_SUPPORTS_PASSTHRU); + TRAP_CASE_STRING(GR_TEXTURE_ALIGN); + TRAP_CASE_STRING(GR_VIDEO_POSITION); + TRAP_CASE_STRING(GR_VIEWPORT); + TRAP_CASE_STRING(GR_WDEPTH_MIN_MAX); + TRAP_CASE_STRING(GR_ZDEPTH_MIN_MAX); + TRAP_CASE_STRING(GR_VERTEX_PARAMETER); + TRAP_CASE_STRING(GR_BITS_GAMMA); + TRAP_CASE_STRING(GR_GET_RESERVED_1); + TRAP_NODEFAULT; + } +} + +const char *TRP_GETSTRING (FxU32 pname) +{ + switch (pname) { + TRAP_CASE_STRING(GR_EXTENSION); + TRAP_CASE_STRING(GR_HARDWARE); + TRAP_CASE_STRING(GR_RENDERER); + TRAP_CASE_STRING(GR_VENDOR); + TRAP_CASE_STRING(GR_VERSION); + TRAP_NODEFAULT; + } +} + +const char *TRP_ENABLE (GrEnableMode_t mode) +{ + switch (mode) { + TRAP_CASE_STRING(GR_AA_ORDERED); + TRAP_CASE_STRING(GR_ALLOW_MIPMAP_DITHER); + TRAP_CASE_STRING(GR_PASSTHRU); + TRAP_CASE_STRING(GR_SHAMELESS_PLUG); + TRAP_CASE_STRING(GR_VIDEO_SMOOTHING); + TRAP_CASE_STRING(GR_TEXTURE_UMA_EXT); + TRAP_CASE_STRING(GR_STENCIL_MODE_EXT); + TRAP_CASE_STRING(GR_OPENGL_MODE_EXT); + TRAP_NODEFAULT; + } +} + +const char *TRP_COORD (GrCoordinateSpaceMode_t mode) +{ + switch (mode) { + TRAP_CASE_STRING(GR_WINDOW_COORDS); + TRAP_CASE_STRING(GR_CLIP_COORDS); + TRAP_NODEFAULT; + } +} + +const char *TRP_STIPPLEMODE (GrStippleMode_t mode) +{ + switch (mode) { + TRAP_CASE_STRING(GR_STIPPLE_DISABLE); + TRAP_CASE_STRING(GR_STIPPLE_PATTERN); + TRAP_CASE_STRING(GR_STIPPLE_ROTATE); + TRAP_NODEFAULT; + } +} + +const char *TRP_LODLEVEL (GrLOD_t lod) +{ + switch (lod) { + TRAP_CASE_STRING(GR_LOD_LOG2_2048); + TRAP_CASE_STRING(GR_LOD_LOG2_1024); + TRAP_CASE_STRING(GR_LOD_LOG2_512); + TRAP_CASE_STRING(GR_LOD_LOG2_256); + TRAP_CASE_STRING(GR_LOD_LOG2_128); + TRAP_CASE_STRING(GR_LOD_LOG2_64); + TRAP_CASE_STRING(GR_LOD_LOG2_32); + TRAP_CASE_STRING(GR_LOD_LOG2_16); + TRAP_CASE_STRING(GR_LOD_LOG2_8); + TRAP_CASE_STRING(GR_LOD_LOG2_4); + TRAP_CASE_STRING(GR_LOD_LOG2_2); + TRAP_CASE_STRING(GR_LOD_LOG2_1); + TRAP_NODEFAULT; + } +} + +const char *TRP_ASPECTRATIO (GrAspectRatio_t aspect) +{ + switch (aspect) { + TRAP_CASE_STRING(GR_ASPECT_LOG2_8x1); + TRAP_CASE_STRING(GR_ASPECT_LOG2_4x1); + TRAP_CASE_STRING(GR_ASPECT_LOG2_2x1); + TRAP_CASE_STRING(GR_ASPECT_LOG2_1x1); + TRAP_CASE_STRING(GR_ASPECT_LOG2_1x2); + TRAP_CASE_STRING(GR_ASPECT_LOG2_1x4); + TRAP_CASE_STRING(GR_ASPECT_LOG2_1x8); + TRAP_NODEFAULT; + } +} + +const char *TRP_TEXFMT (GrTextureFormat_t fmt) +{ + switch (fmt) { + TRAP_CASE_STRING(GR_TEXFMT_8BIT); + /*TRAP_CASE_STRING(GR_TEXFMT_RGB_332); ==GR_TEXFMT_8BIT*/ + TRAP_CASE_STRING(GR_TEXFMT_YIQ_422); + TRAP_CASE_STRING(GR_TEXFMT_ALPHA_8); + TRAP_CASE_STRING(GR_TEXFMT_INTENSITY_8); + TRAP_CASE_STRING(GR_TEXFMT_ALPHA_INTENSITY_44); + TRAP_CASE_STRING(GR_TEXFMT_P_8); + TRAP_CASE_STRING(GR_TEXFMT_RSVD0); + /*TRAP_CASE_STRING(GR_TEXFMT_P_8_6666); ==GR_TEXFMT_RSVD0*/ + /*TRAP_CASE_STRING(GR_TEXFMT_P_8_6666_EXT); ==GR_TEXFMT_RSVD0*/ + TRAP_CASE_STRING(GR_TEXFMT_RSVD1); + TRAP_CASE_STRING(GR_TEXFMT_16BIT); + /*TRAP_CASE_STRING(GR_TEXFMT_ARGB_8332); ==GR_TEXFMT_16BIT*/ + TRAP_CASE_STRING(GR_TEXFMT_AYIQ_8422); + TRAP_CASE_STRING(GR_TEXFMT_RGB_565); + TRAP_CASE_STRING(GR_TEXFMT_ARGB_1555); + TRAP_CASE_STRING(GR_TEXFMT_ARGB_4444); + TRAP_CASE_STRING(GR_TEXFMT_ALPHA_INTENSITY_88); + TRAP_CASE_STRING(GR_TEXFMT_AP_88); + TRAP_CASE_STRING(GR_TEXFMT_RSVD2); + /*TRAP_CASE_STRING(GR_TEXFMT_RSVD4); ==GR_TEXFMT_RSVD2*/ + TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_FXT1); + TRAP_CASE_STRING(GR_TEXFMT_ARGB_8888); + TRAP_CASE_STRING(GR_TEXFMT_YUYV_422); + TRAP_CASE_STRING(GR_TEXFMT_UYVY_422); + TRAP_CASE_STRING(GR_TEXFMT_AYUV_444); + TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_DXT1); + TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_DXT2); + TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_DXT3); + TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_DXT4); + TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_DXT5); + TRAP_CASE_STRING(GR_TEXTFMT_RGB_888); + TRAP_NODEFAULT; + } +} + +const char *TRP_EVENODD (FxU32 evenOdd) +{ + switch (evenOdd) { + TRAP_CASE_STRING(GR_MIPMAPLEVELMASK_EVEN); + TRAP_CASE_STRING(GR_MIPMAPLEVELMASK_ODD); + TRAP_CASE_STRING(GR_MIPMAPLEVELMASK_BOTH); + TRAP_NODEFAULT; + } +} + +const char *TRP_NCC (GrNCCTable_t table) +{ + switch (table) { + TRAP_CASE_STRING(GR_NCCTABLE_NCC0); + TRAP_CASE_STRING(GR_NCCTABLE_NCC1); + TRAP_NODEFAULT; + } +} + +const char *TRP_CLAMPMODE (GrTextureClampMode_t clampmode) +{ + switch (clampmode) { + TRAP_CASE_STRING(GR_TEXTURECLAMP_WRAP); + TRAP_CASE_STRING(GR_TEXTURECLAMP_CLAMP); + TRAP_CASE_STRING(GR_TEXTURECLAMP_MIRROR_EXT); + TRAP_NODEFAULT; + } +} + +const char *TRP_TEXFILTER (GrTextureFilterMode_t filter_mode) +{ + switch (filter_mode) { + TRAP_CASE_STRING(GR_TEXTUREFILTER_POINT_SAMPLED); + TRAP_CASE_STRING(GR_TEXTUREFILTER_BILINEAR); + TRAP_NODEFAULT; + } +} + +const char *TRP_TABLE (GrTexTable_t type) +{ + switch (type) { + TRAP_CASE_STRING(GR_TEXTABLE_NCC0); + TRAP_CASE_STRING(GR_TEXTABLE_NCC1); + TRAP_CASE_STRING(GR_TEXTABLE_PALETTE); + TRAP_CASE_STRING(GR_TEXTABLE_PALETTE_6666_EXT); + TRAP_NODEFAULT; + } +} + +const char *TRP_MIPMODE (GrMipMapMode_t mode) +{ + switch (mode) { + TRAP_CASE_STRING(GR_MIPMAP_DISABLE); + TRAP_CASE_STRING(GR_MIPMAP_NEAREST); + TRAP_CASE_STRING(GR_MIPMAP_NEAREST_DITHER); + TRAP_NODEFAULT; + } +} + +const char *TRP_TEXBASERANGE (GrTexBaseRange_t range) +{ + switch (range) { + TRAP_CASE_STRING(GR_TEXBASE_2048); + TRAP_CASE_STRING(GR_TEXBASE_1024); + TRAP_CASE_STRING(GR_TEXBASE_512); + TRAP_CASE_STRING(GR_TEXBASE_256_TO_1); + TRAP_CASE_STRING(GR_TEXBASE_256); + TRAP_CASE_STRING(GR_TEXBASE_128); + TRAP_CASE_STRING(GR_TEXBASE_64); + TRAP_CASE_STRING(GR_TEXBASE_32_TO_1); + TRAP_NODEFAULT; + } +} + +const char *TRP_LOCKTYPE (GrLock_t type) +{ + switch (type) { + TRAP_CASE_STRING(GR_LFB_READ_ONLY); + TRAP_CASE_STRING(GR_LFB_WRITE_ONLY); + /*TRAP_CASE_STRING(GR_LFB_IDLE); ==GR_LFB_READ_ONLY*/ + TRAP_CASE_STRING(GR_LFB_NOIDLE); + TRAP_CASE_STRING(GR_LFB_WRITE_ONLY_EXPLICIT_EXT); + TRAP_NODEFAULT; + } +} + +const char *TRP_WRITEMODE (GrLfbWriteMode_t writeMode) +{ + switch (writeMode) { + TRAP_CASE_STRING(GR_LFBWRITEMODE_565); + TRAP_CASE_STRING(GR_LFBWRITEMODE_555); + TRAP_CASE_STRING(GR_LFBWRITEMODE_1555); + TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED1); + TRAP_CASE_STRING(GR_LFBWRITEMODE_888); + TRAP_CASE_STRING(GR_LFBWRITEMODE_8888); + TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED2); + TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED3); + TRAP_CASE_STRING(GR_LFBWRITEMODE_Z32); + TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED5); + TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED6); + TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED7); + TRAP_CASE_STRING(GR_LFBWRITEMODE_565_DEPTH); + TRAP_CASE_STRING(GR_LFBWRITEMODE_555_DEPTH); + TRAP_CASE_STRING(GR_LFBWRITEMODE_1555_DEPTH); + TRAP_CASE_STRING(GR_LFBWRITEMODE_ZA16); + TRAP_CASE_STRING(GR_LFBWRITEMODE_ANY); + TRAP_NODEFAULT; + } +} + +const char *TRP_SRCFMT (GrLfbSrcFmt_t src_format) +{ + switch (src_format) { + TRAP_CASE_STRING(GR_LFB_SRC_FMT_565); + TRAP_CASE_STRING(GR_LFB_SRC_FMT_555); + TRAP_CASE_STRING(GR_LFB_SRC_FMT_1555); + TRAP_CASE_STRING(GR_LFB_SRC_FMT_888); + TRAP_CASE_STRING(GR_LFB_SRC_FMT_8888); + TRAP_CASE_STRING(GR_LFB_SRC_FMT_565_DEPTH); + TRAP_CASE_STRING(GR_LFB_SRC_FMT_555_DEPTH); + TRAP_CASE_STRING(GR_LFB_SRC_FMT_1555_DEPTH); + TRAP_CASE_STRING(GR_LFB_SRC_FMT_ZA16); + TRAP_CASE_STRING(GR_LFB_SRC_FMT_RLE16); + TRAP_CASE_STRING(GR_LFBWRITEMODE_Z32); /*???*/ + TRAP_NODEFAULT; + } +} + +const char *TRP_CRMODE (GrChromaRangeMode_t mode) +{ + switch (mode) { + TRAP_CASE_STRING(GR_CHROMARANGE_DISABLE_EXT); + /*TRAP_CASE_STRING(GR_CHROMARANGE_RGB_ALL_EXT); ==GR_CHROMARANGE_DISABLE_EXT*/ + TRAP_CASE_STRING(GR_CHROMARANGE_ENABLE_EXT); + TRAP_NODEFAULT; + } +} + +const char *TRP_PIXFMT (GrPixelFormat_t pixelformat) +{ + switch (pixelformat) { + TRAP_CASE_STRING(GR_PIXFMT_I_8); + TRAP_CASE_STRING(GR_PIXFMT_AI_88); + TRAP_CASE_STRING(GR_PIXFMT_RGB_565); + TRAP_CASE_STRING(GR_PIXFMT_ARGB_1555); + TRAP_CASE_STRING(GR_PIXFMT_ARGB_8888); + TRAP_CASE_STRING(GR_PIXFMT_AA_2_RGB_565); + TRAP_CASE_STRING(GR_PIXFMT_AA_2_ARGB_1555); + TRAP_CASE_STRING(GR_PIXFMT_AA_2_ARGB_8888); + TRAP_CASE_STRING(GR_PIXFMT_AA_4_RGB_565); + TRAP_CASE_STRING(GR_PIXFMT_AA_4_ARGB_1555); + TRAP_CASE_STRING(GR_PIXFMT_AA_4_ARGB_8888); + TRAP_CASE_STRING(GR_PIXFMT_AA_8_RGB_565); + TRAP_CASE_STRING(GR_PIXFMT_AA_8_ARGB_1555); + TRAP_CASE_STRING(GR_PIXFMT_AA_8_ARGB_8888); + TRAP_NODEFAULT; + } +} + +const char *TRP_STENCILOP (GrStencilOp_t op) +{ + switch (op) { + TRAP_CASE_STRING(GR_STENCILOP_KEEP); + TRAP_CASE_STRING(GR_STENCILOP_ZERO); + TRAP_CASE_STRING(GR_STENCILOP_REPLACE); + TRAP_CASE_STRING(GR_STENCILOP_INCR_CLAMP); + TRAP_CASE_STRING(GR_STENCILOP_DECR_CLAMP); + TRAP_CASE_STRING(GR_STENCILOP_INVERT); + TRAP_CASE_STRING(GR_STENCILOP_INCR_WRAP); + TRAP_CASE_STRING(GR_STENCILOP_DECR_WRAP); + TRAP_NODEFAULT; + } +} + +const char *TRP_BLENDOP (GrAlphaBlendOp_t op) +{ + switch (op) { + TRAP_CASE_STRING(GR_BLEND_OP_ADD); + TRAP_CASE_STRING(GR_BLEND_OP_SUB); + TRAP_CASE_STRING(GR_BLEND_OP_REVSUB); + TRAP_CASE_STRING(GR_BLEND_SAME_COLOR_EXT); + TRAP_CASE_STRING(GR_BLEND_ONE_MINUS_SAME_COLOR_EXT); + TRAP_NODEFAULT; + } +} + +const char *TRP_CU (GrCCUColor_t a) +{ + switch (a) { + TRAP_CASE_STRING(GR_CMBX_ZERO); + TRAP_CASE_STRING(GR_CMBX_TEXTURE_ALPHA); + TRAP_CASE_STRING(GR_CMBX_ALOCAL); + TRAP_CASE_STRING(GR_CMBX_AOTHER); + TRAP_CASE_STRING(GR_CMBX_B); + TRAP_CASE_STRING(GR_CMBX_CONSTANT_ALPHA); + TRAP_CASE_STRING(GR_CMBX_CONSTANT_COLOR); + TRAP_CASE_STRING(GR_CMBX_DETAIL_FACTOR); + TRAP_CASE_STRING(GR_CMBX_ITALPHA); + TRAP_CASE_STRING(GR_CMBX_ITRGB); + TRAP_CASE_STRING(GR_CMBX_LOCAL_TEXTURE_ALPHA); + TRAP_CASE_STRING(GR_CMBX_LOCAL_TEXTURE_RGB); + TRAP_CASE_STRING(GR_CMBX_LOD_FRAC); + TRAP_CASE_STRING(GR_CMBX_OTHER_TEXTURE_ALPHA); + TRAP_CASE_STRING(GR_CMBX_OTHER_TEXTURE_RGB); + TRAP_CASE_STRING(GR_CMBX_TEXTURE_RGB); + TRAP_CASE_STRING(GR_CMBX_TMU_CALPHA); + TRAP_CASE_STRING(GR_CMBX_TMU_CCOLOR); + TRAP_NODEFAULT; + } +} + +const char *TRP_CMBMODE (GrCombineMode_t a_mode) +{ + switch (a_mode) { + TRAP_CASE_STRING(GR_FUNC_MODE_ZERO); + TRAP_CASE_STRING(GR_FUNC_MODE_X); + TRAP_CASE_STRING(GR_FUNC_MODE_ONE_MINUS_X); + TRAP_CASE_STRING(GR_FUNC_MODE_NEGATIVE_X); + TRAP_CASE_STRING(GR_FUNC_MODE_X_MINUS_HALF); + TRAP_NODEFAULT; + } +} + +const char *TRP_TMU (GrChipID_t tmu) +{ + switch (tmu) { + TRAP_CASE_STRING(GR_TMU0); + TRAP_CASE_STRING(GR_TMU1); + TRAP_NODEFAULT; + } +} + + + +/****************************************************************************\ +* REAL POINTERS * +\****************************************************************************/ + +/* +** glide extensions +*/ +char * (FX_CALL *real_grGetRegistryOrEnvironmentStringExt) (char *theEntry); +void (FX_CALL *real_grGetGammaTableExt) (FxU32 nentries, FxU32 *red, FxU32 *green, FxU32 *blue); +void (FX_CALL *real_grChromaRangeModeExt) (GrChromakeyMode_t mode); +void (FX_CALL *real_grChromaRangeExt) (GrColor_t color, GrColor_t range, GrChromaRangeMode_t match_mode); +void (FX_CALL *real_grTexChromaModeExt) (GrChipID_t tmu, GrChromakeyMode_t mode); +void (FX_CALL *real_grTexChromaRangeExt) (GrChipID_t tmu, GrColor_t min, GrColor_t max, GrTexChromakeyMode_t mode); + +/* tbext */ +void (FX_CALL *real_grTextureBufferExt) (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLOD, GrLOD_t largeLOD, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 odd_even_mask); +void (FX_CALL *real_grTextureAuxBufferExt) (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLOD, GrLOD_t largeLOD, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 odd_even_mask); +void (FX_CALL *real_grAuxBufferExt) (GrBuffer_t buffer); + +/* napalm */ +GrContext_t (FX_CALL *real_grSstWinOpenExt) (FxU32 hWnd, GrScreenResolution_t resolution, GrScreenRefresh_t refresh, GrColorFormat_t format, GrOriginLocation_t origin, GrPixelFormat_t pixelformat, int nColBuffers, int nAuxBuffers); +void (FX_CALL *real_grStencilFuncExt) (GrCmpFnc_t fnc, GrStencil_t ref, GrStencil_t mask); +void (FX_CALL *real_grStencilMaskExt) (GrStencil_t value); +void (FX_CALL *real_grStencilOpExt) (GrStencilOp_t stencil_fail, GrStencilOp_t depth_fail, GrStencilOp_t depth_pass); +void (FX_CALL *real_grLfbConstantStencilExt) (GrStencil_t value); +void (FX_CALL *real_grBufferClearExt) (GrColor_t color, GrAlpha_t alpha, FxU32 depth, GrStencil_t stencil); +void (FX_CALL *real_grColorCombineExt) (GrCCUColor_t a, GrCombineMode_t a_mode, GrCCUColor_t b, GrCombineMode_t b_mode, GrCCUColor_t c, FxBool c_invert, GrCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert); +void (FX_CALL *real_grAlphaCombineExt) (GrACUColor_t a, GrCombineMode_t a_mode, GrACUColor_t b, GrCombineMode_t b_mode, GrACUColor_t c, FxBool c_invert, GrACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert); +void (FX_CALL *real_grTexColorCombineExt) (GrChipID_t tmu, GrTCCUColor_t a, GrCombineMode_t a_mode, GrTCCUColor_t b, GrCombineMode_t b_mode, GrTCCUColor_t c, FxBool c_invert, GrTCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert); +void (FX_CALL *real_grTexAlphaCombineExt) (GrChipID_t tmu, GrTACUColor_t a, GrCombineMode_t a_mode, GrTACUColor_t b, GrCombineMode_t b_mode, GrTACUColor_t c, FxBool c_invert, GrTACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert); +void (FX_CALL *real_grConstantColorValueExt) (GrChipID_t tmu, GrColor_t value); +void (FX_CALL *real_grColorMaskExt) (FxBool r, FxBool g, FxBool b, FxBool a); +void (FX_CALL *real_grAlphaBlendFunctionExt) (GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendOp_t rgb_op, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df, GrAlphaBlendOp_t alpha_op); +void (FX_CALL *real_grTBufferWriteMaskExt) (FxU32 tmask); + + + +/****************************************************************************\ +* DEBUG HOOKS * +\****************************************************************************/ + +/* +** rendering functions +*/ +void FX_CALL trap_grDrawPoint (const void *pt) +{ +#define FN_NAME "grDrawPoint" + TRAP_LOG("%s(%p)\n", FN_NAME, pt); + grDrawPoint(pt); +#undef FN_NAME +} + +void FX_CALL trap_grDrawLine (const void *v1, + const void *v2) +{ +#define FN_NAME "grDrawLine" + TRAP_LOG("%s(%p, %p)\n", FN_NAME, v1, v2); + grDrawLine(v1, v2); +#undef FN_NAME +} + +void FX_CALL trap_grDrawTriangle (const void *a, + const void *b, + const void *c) +{ +#define FN_NAME "grDrawTriangle" + TRAP_LOG("%s(%p, %p, %p)\n", FN_NAME, a, b, c); + grDrawTriangle(a, b, c); +#undef FN_NAME +} + +void FX_CALL trap_grVertexLayout (FxU32 param, + FxI32 offset, + FxU32 mode) +{ +#define FN_NAME "grVertexLayout" + TRAP_LOG("%s(%s, %ld, %s)\n", FN_NAME, TRP_VTX(param), offset, TRP_PARAM(mode)); + grVertexLayout(param, offset, mode); +#undef FN_NAME +} + +void FX_CALL trap_grDrawVertexArray (FxU32 mode, + FxU32 Count, + void *pointers) +{ +#define FN_NAME "grDrawVertexArray" + TRAP_LOG("%s(%s, %lu, %p)\n", FN_NAME, TRP_ARRAY(mode), Count, pointers); + grDrawVertexArray(mode, Count, pointers); +#undef FN_NAME +} + +void FX_CALL trap_grDrawVertexArrayContiguous (FxU32 mode, + FxU32 Count, + void *pointers, + FxU32 stride) +{ +#define FN_NAME "grDrawVertexArrayContiguous" + TRAP_LOG("%s(%s, %lu, %p, %lu)\n", FN_NAME, TRP_ARRAY(mode), Count, pointers, stride); + grDrawVertexArrayContiguous(mode, Count, pointers, stride); +#undef FN_NAME +} + +/* +** Antialiasing Functions +*/ +void FX_CALL trap_grAADrawTriangle (const void *a, + const void *b, + const void *c, + FxBool ab_antialias, + FxBool bc_antialias, + FxBool ca_antialias) +{ +#define FN_NAME "grAADrawTriangle" + TRAP_LOG("%s(%p, %p, %p, %s, %s, %s)\n", FN_NAME, a, b, c, TRP_BOOL(ab_antialias), TRP_BOOL(bc_antialias), TRP_BOOL(ca_antialias)); + grAADrawTriangle(a, b, c, ab_antialias, bc_antialias, ca_antialias); +#undef FN_NAME +} + +/* +** buffer management +*/ +void FX_CALL trap_grBufferClear (GrColor_t color, + GrAlpha_t alpha, + FxU32 depth) +{ +#define FN_NAME "grBufferClear" + TRAP_LOG("%s(%08lx, %02x, %08lx)\n", FN_NAME, color, alpha, depth); + grBufferClear(color, alpha, depth); +#undef FN_NAME +} + +void FX_CALL trap_grBufferSwap (FxU32 swap_interval) +{ +#define FN_NAME "grBufferSwap" + TRAP_LOG("%s(%lu)\n", FN_NAME, swap_interval); + grBufferSwap(swap_interval); +#undef FN_NAME +} + +void FX_CALL trap_grRenderBuffer (GrBuffer_t buffer) +{ +#define FN_NAME "grRenderBuffer" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_BUFFER(buffer)); + grRenderBuffer(buffer); +#undef FN_NAME +} + +/* +** error management +*/ +void FX_CALL trap_grErrorSetCallback (GrErrorCallbackFnc_t fnc) +{ +#define FN_NAME "grErrorSetCallback" + TRAP_LOG("%s(%p)\n", FN_NAME, (void *)fnc); + grErrorSetCallback(fnc); +#undef FN_NAME +} + +/* +** SST routines +*/ +void FX_CALL trap_grFinish (void) +{ +#define FN_NAME "grFinish" + TRAP_LOG("%s()\n", FN_NAME); + grFinish(); +#undef FN_NAME +} + +void FX_CALL trap_grFlush (void) +{ +#define FN_NAME "grFlush" + TRAP_LOG("%s()\n", FN_NAME); + grFlush(); +#undef FN_NAME +} + +GrContext_t FX_CALL trap_grSstWinOpen (FxU32 hWnd, + GrScreenResolution_t screen_resolution, + GrScreenRefresh_t refresh_rate, + GrColorFormat_t color_format, + GrOriginLocation_t origin_location, + int nColBuffers, + int nAuxBuffers) +{ +#define FN_NAME "grSstWinOpen" + GrContext_t rv; + TRAP_LOG("%s(%08lx, %s, %s, %s, %s, %d, %d)\n", FN_NAME, hWnd, TRP_RESOLUTION(screen_resolution), TRP_REFRESH(refresh_rate), TRP_COLFMT(color_format), TRP_ORIGIN(origin_location), nColBuffers, nAuxBuffers); + rv = grSstWinOpen(hWnd, screen_resolution, refresh_rate, color_format, origin_location, nColBuffers, nAuxBuffers); + TRAP_LOG(GOT "%p\n", (void *)rv); + return rv; +#undef FN_NAME +} + +FxBool FX_CALL trap_grSstWinClose (GrContext_t context) +{ +#define FN_NAME "grSstWinClose" + FxBool rv; + TRAP_LOG("%s(%p)\n", FN_NAME, (void *)context); + rv = grSstWinClose(context); + TRAP_LOG(GOT "%s\n", TRP_BOOL(rv)); + return rv; +#undef FN_NAME +} + +void FX_CALL trap_grSetNumPendingBuffers (FxI32 NumPendingBuffers) +{ +#define FN_NAME "grSetNumPendingBuffers" + TRAP_LOG("%s(%ld)\n", FN_NAME, NumPendingBuffers); + grSetNumPendingBuffers(NumPendingBuffers); +#undef FN_NAME +} + +FxBool FX_CALL trap_grSelectContext (GrContext_t context) +{ +#define FN_NAME "grSelectContext" + FxBool rv; + TRAP_LOG("%s(%p)\n", FN_NAME, (void *)context); + rv = grSelectContext(context); + TRAP_LOG(GOT "%s\n", TRP_BOOL(rv)); + return rv; +#undef FN_NAME +} + +void FX_CALL trap_grSstOrigin (GrOriginLocation_t origin) +{ +#define FN_NAME "grSstOrigin" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_ORIGIN(origin)); + grSstOrigin(origin); +#undef FN_NAME +} + +void FX_CALL trap_grSstSelect (int which_sst) +{ +#define FN_NAME "grSstSelect" + TRAP_LOG("%s(%d)\n", FN_NAME, which_sst); + grSstSelect(which_sst); +#undef FN_NAME +} + +/* +** Glide configuration and special effect maintenance functions +*/ +void FX_CALL trap_grAlphaBlendFunction (GrAlphaBlendFnc_t rgb_sf, + GrAlphaBlendFnc_t rgb_df, + GrAlphaBlendFnc_t alpha_sf, + GrAlphaBlendFnc_t alpha_df) +{ +#define FN_NAME "grAlphaBlendFunction" + TRAP_LOG("%s(%s, %s, %s, %s)\n", FN_NAME, TRP_BLEND(rgb_sf), TRP_BLEND(rgb_df), TRP_BLEND(alpha_sf), TRP_BLEND(alpha_df)); + grAlphaBlendFunction(rgb_sf, rgb_df, alpha_sf, alpha_df); +#undef FN_NAME +} + +void FX_CALL trap_grAlphaCombine (GrCombineFunction_t function, + GrCombineFactor_t factor, + GrCombineLocal_t local, + GrCombineOther_t other, + FxBool invert) +{ +#define FN_NAME "grAlphaCombine" + TRAP_LOG("%s(%s, %s, %s, %s, %s)\n", FN_NAME, TRP_CMBFUNC(function), TRP_CMBFACT(factor), TRP_CMBLOCAL(local), TRP_CMBOTHER(other), TRP_BOOL(invert)); + grAlphaCombine(function, factor, local, other, invert); +#undef FN_NAME +} + +void FX_CALL trap_grAlphaControlsITRGBLighting (FxBool enable) +{ +#define FN_NAME "grAlphaControlsITRGBLighting" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_BOOL(enable)); + grAlphaControlsITRGBLighting(enable); +#undef FN_NAME +} + +void FX_CALL trap_grAlphaTestFunction (GrCmpFnc_t function) +{ +#define FN_NAME "grAlphaTestFunction" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_CMPFUNC(function)); + grAlphaTestFunction(function); +#undef FN_NAME +} + +void FX_CALL trap_grAlphaTestReferenceValue (GrAlpha_t value) +{ +#define FN_NAME "grAlphaTestReferenceValue" + TRAP_LOG("%s(%02x)\n", FN_NAME, value); + grAlphaTestReferenceValue(value); +#undef FN_NAME +} + +void FX_CALL trap_grChromakeyMode (GrChromakeyMode_t mode) +{ +#define FN_NAME "grChromakeyMode" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_CKMODE(mode)); + grChromakeyMode(mode); +#undef FN_NAME +} + +void FX_CALL trap_grChromakeyValue (GrColor_t value) +{ +#define FN_NAME "grChromakeyValue" + TRAP_LOG("%s(%08lx)\n", FN_NAME, value); + grChromakeyValue(value); +#undef FN_NAME +} + +void FX_CALL trap_grClipWindow (FxU32 minx, + FxU32 miny, + FxU32 maxx, + FxU32 maxy) +{ +#define FN_NAME "grClipWindow" + TRAP_LOG("%s(%lu, %lu, %lu, %lu)\n", FN_NAME, minx, miny, maxx, maxy); + grClipWindow(minx, miny, maxx, maxy); +#undef FN_NAME +} + +void FX_CALL trap_grColorCombine (GrCombineFunction_t function, + GrCombineFactor_t factor, + GrCombineLocal_t local, + GrCombineOther_t other, + FxBool invert) +{ +#define FN_NAME "grColorCombine" + TRAP_LOG("%s(%s, %s, %s, %s, %s)\n", FN_NAME, TRP_CMBFUNC(function), TRP_CMBFACT(factor), TRP_CMBLOCAL(local), TRP_CMBOTHER(other), TRP_BOOL(invert)); + grColorCombine(function, factor, local, other, invert); +#undef FN_NAME +} + +void FX_CALL trap_grColorMask (FxBool rgb, + FxBool a) +{ +#define FN_NAME "grColorMask" + TRAP_LOG("%s(%s, %s)\n", FN_NAME, TRP_BOOL(rgb), TRP_BOOL(a)); + grColorMask(rgb, a); +#undef FN_NAME +} + +void FX_CALL trap_grCullMode (GrCullMode_t mode) +{ +#define FN_NAME "grCullMode" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_CULLMODE(mode)); + grCullMode(mode); +#undef FN_NAME +} + +void FX_CALL trap_grConstantColorValue (GrColor_t value) +{ +#define FN_NAME "grConstantColorValue" + TRAP_LOG("%s(%08lx)\n", FN_NAME, value); + grConstantColorValue(value); +#undef FN_NAME +} + +void FX_CALL trap_grDepthBiasLevel (FxI32 level) +{ +#define FN_NAME "grDepthBiasLevel" + TRAP_LOG("%s(%ld)\n", FN_NAME, level); + grDepthBiasLevel(level); +#undef FN_NAME +} + +void FX_CALL trap_grDepthBufferFunction (GrCmpFnc_t function) +{ +#define FN_NAME "grDepthBufferFunction" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_CMPFUNC(function)); + grDepthBufferFunction(function); +#undef FN_NAME +} + +void FX_CALL trap_grDepthBufferMode (GrDepthBufferMode_t mode) +{ +#define FN_NAME "grDepthBufferMode" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_DEPTHMODE(mode)); + grDepthBufferMode(mode); +#undef FN_NAME +} + +void FX_CALL trap_grDepthMask (FxBool mask) +{ +#define FN_NAME "grDepthMask" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_BOOL(mask)); + grDepthMask(mask); +#undef FN_NAME +} + +void FX_CALL trap_grDisableAllEffects (void) +{ +#define FN_NAME "grDisableAllEffects" + TRAP_LOG("%s()\n", FN_NAME); + grDisableAllEffects(); +#undef FN_NAME +} + +void FX_CALL trap_grDitherMode (GrDitherMode_t mode) +{ +#define FN_NAME "grDitherMode" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_DITHERMODE(mode)); + grDitherMode(mode); +#undef FN_NAME +} + +void FX_CALL trap_grFogColorValue (GrColor_t fogcolor) +{ +#define FN_NAME "grFogColorValue" + TRAP_LOG("%s(%08lx)\n", FN_NAME, fogcolor); + grFogColorValue(fogcolor); +#undef FN_NAME +} + +void FX_CALL trap_grFogMode (GrFogMode_t mode) +{ +#define FN_NAME "grFogMode" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_FOGMODE(mode)); + grFogMode(mode); +#undef FN_NAME +} + +void FX_CALL trap_grFogTable (const GrFog_t ft[]) +{ +#define FN_NAME "grFogTable" + TRAP_LOG("%s(%p)\n", FN_NAME, ft); + grFogTable(ft); +#undef FN_NAME +} + +void FX_CALL trap_grLoadGammaTable (FxU32 nentries, + FxU32 *red, + FxU32 *green, + FxU32 *blue) +{ +#define FN_NAME "grLoadGammaTable" + TRAP_LOG("%s(%lu, %p, %p, %p)\n", FN_NAME, nentries, (void *)red, (void *)green, (void *)blue); + grLoadGammaTable(nentries, red, green, blue); +#undef FN_NAME +} + +void FX_CALL trap_grSplash (float x, + float y, + float width, + float height, + FxU32 frame) +{ +#define FN_NAME "grSplash" + TRAP_LOG("%s(%f, %f, %f, %f, %lu)\n", FN_NAME, x, y, width, height, frame); + grSplash(x, y, width, height, frame); +#undef FN_NAME +} + +FxU32 FX_CALL trap_grGet (FxU32 pname, + FxU32 plength, + FxI32 *params) +{ +#define FN_NAME "grGet" + FxU32 rv, i; + TRAP_LOG("%s(%s, %lu, %p)\n", FN_NAME, TRP_GETNAME(pname), plength, (void *)params); + rv = grGet(pname, plength, params); + TRAP_LOG(GOT "["); + for (i = 0; i < (rv/sizeof(FxI32)); i++) { + TRAP_LOG("%s%ld", i ? ", " : "", params[i]); + } + TRAP_LOG("]\n"); + return rv; +#undef FN_NAME +} + +const char *FX_CALL trap_grGetString (FxU32 pname) +{ +#define FN_NAME "grGetString" + const char *rv; + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_GETSTRING(pname)); + rv = grGetString(pname); + if (rv) { + TRAP_LOG(GOT "\"%s\"\n", rv); + } else { + TRAP_LOG(GOT "NULL\n"); + } + return rv; +#undef FN_NAME +} + +FxI32 FX_CALL trap_grQueryResolutions (const GrResolution *resTemplate, + GrResolution *output) +{ +#define FN_NAME "grQueryResolutions" + FxI32 rv; + TRAP_LOG("%s(%p, %p)\n", FN_NAME, (void *)resTemplate, (void *)output); + rv = grQueryResolutions(resTemplate, output); + TRAP_LOG(GOT "%ld\n", rv); + return rv; +#undef FN_NAME +} + +FxBool FX_CALL trap_grReset (FxU32 what) +{ +#define FN_NAME "grReset" + FxBool rv; + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_GETNAME(what)); + rv = grReset(what); + TRAP_LOG(GOT "%s\n", TRP_BOOL(rv)); + return rv; +#undef FN_NAME +} + +GrProc FX_CALL trap_grGetProcAddress (char *procName) +{ +#define FN_NAME "grGetProcAddress" + GrProc rv; + TRAP_LOG("%s(%s)\n", FN_NAME, procName); + rv = grGetProcAddress(procName); + TRAP_LOG(GOT "%p\n", (void *)rv); + return rv; +#undef FN_NAME +} + +void FX_CALL trap_grEnable (GrEnableMode_t mode) +{ +#define FN_NAME "grEnable" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_ENABLE(mode)); + grEnable(mode); +#undef FN_NAME +} + +void FX_CALL trap_grDisable (GrEnableMode_t mode) +{ +#define FN_NAME "grDisable" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_ENABLE(mode)); + grDisable(mode); +#undef FN_NAME +} + +void FX_CALL trap_grCoordinateSpace (GrCoordinateSpaceMode_t mode) +{ +#define FN_NAME "grCoordinateSpace" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_COORD(mode)); + grCoordinateSpace(mode); +#undef FN_NAME +} + +void FX_CALL trap_grDepthRange (FxFloat n, + FxFloat f) +{ +#define FN_NAME "grDepthRange" + TRAP_LOG("%s(%f, %f)\n", FN_NAME, n, f); + grDepthRange(n, f); +#undef FN_NAME +} + +void FX_CALL trap_grStippleMode (GrStippleMode_t mode) +{ +#define FN_NAME "grStippleMode" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_STIPPLEMODE(mode)); + grStippleMode(mode); +#undef FN_NAME +} + +void FX_CALL trap_grStipplePattern (GrStipplePattern_t mode) +{ +#define FN_NAME "grStipplePattern" + TRAP_LOG("%s(%08lx)\n", FN_NAME, mode); + grStipplePattern(mode); +#undef FN_NAME +} + +void FX_CALL trap_grViewport (FxI32 x, + FxI32 y, + FxI32 width, + FxI32 height) +{ +#define FN_NAME "grViewport" + TRAP_LOG("%s(%ld, %ld, %ld, %ld)\n", FN_NAME, x, y, width, height); + grViewport(x, y, width, height); +#undef FN_NAME +} + +/* +** texture mapping control functions +*/ +FxU32 FX_CALL trap_grTexCalcMemRequired (GrLOD_t lodmin, + GrLOD_t lodmax, + GrAspectRatio_t aspect, + GrTextureFormat_t fmt) +{ +#define FN_NAME "grTexCalcMemRequired" + FxU32 rv; + TRAP_LOG("%s(%s, %s, %s, %s)\n", FN_NAME, TRP_LODLEVEL(lodmin), TRP_LODLEVEL(lodmax), TRP_ASPECTRATIO(aspect), TRP_TEXFMT(fmt)); + rv = grTexCalcMemRequired(lodmin, lodmax, aspect, fmt); + TRAP_LOG(GOT "%lu\n", rv); + return rv; +#undef FN_NAME +} + +FxU32 FX_CALL trap_grTexTextureMemRequired (FxU32 evenOdd, + GrTexInfo *info) +{ +#define FN_NAME "grTexTextureMemRequired" + FxU32 rv; + TRAP_LOG("%s(%s, %p)\n", FN_NAME, TRP_EVENODD(evenOdd), (void *)info); + rv = grTexTextureMemRequired(evenOdd, info); + TRAP_LOG(GOT "%lu\n", rv); + return rv; +#undef FN_NAME +} + +FxU32 FX_CALL trap_grTexMinAddress (GrChipID_t tmu) +{ +#define FN_NAME "grTexMinAddress" + FxU32 rv; + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_TMU(tmu)); + rv = grTexMinAddress(tmu); + TRAP_LOG(GOT "%lu\n", rv); + return rv; +#undef FN_NAME +} + +FxU32 FX_CALL trap_grTexMaxAddress (GrChipID_t tmu) +{ +#define FN_NAME "grTexMaxAddress" + FxU32 rv; + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_TMU(tmu)); + rv = grTexMaxAddress(tmu); + TRAP_LOG(GOT "%lu\n", rv); + return rv; +#undef FN_NAME +} + +void FX_CALL trap_grTexNCCTable (GrNCCTable_t table) +{ +#define FN_NAME "grTexNCCTable" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_NCC(table)); + grTexNCCTable(table); +#undef FN_NAME +} + +void FX_CALL trap_grTexSource (GrChipID_t tmu, + FxU32 startAddress, + FxU32 evenOdd, + GrTexInfo *info) +{ +#define FN_NAME "grTexSource" + TRAP_LOG("%s(%s, %08lx, %s, %p)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_EVENODD(evenOdd), (void *)info); + grTexSource(tmu, startAddress, evenOdd, info); +#undef FN_NAME +} + +void FX_CALL trap_grTexClampMode (GrChipID_t tmu, + GrTextureClampMode_t s_clampmode, + GrTextureClampMode_t t_clampmode) +{ +#define FN_NAME "grTexClampMode" + TRAP_LOG("%s(%s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_CLAMPMODE(s_clampmode), TRP_CLAMPMODE(t_clampmode)); + grTexClampMode(tmu, s_clampmode, t_clampmode); +#undef FN_NAME +} + +void FX_CALL trap_grTexCombine (GrChipID_t tmu, + GrCombineFunction_t rgb_function, + GrCombineFactor_t rgb_factor, + GrCombineFunction_t alpha_function, + GrCombineFactor_t alpha_factor, + FxBool rgb_invert, + FxBool alpha_invert) +{ +#define FN_NAME "grTexCombine" + TRAP_LOG("%s(%s, %s, %s, %s, %s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_CMBFUNC(rgb_function), TRP_CMBFACT(rgb_factor), TRP_CMBFUNC(alpha_function), TRP_CMBFACT(alpha_factor), TRP_BOOL(rgb_invert), TRP_BOOL(alpha_invert)); + grTexCombine(tmu, rgb_function, rgb_factor, alpha_function, alpha_factor, rgb_invert, alpha_invert); +#undef FN_NAME +} + +void FX_CALL trap_grTexDetailControl (GrChipID_t tmu, + int lod_bias, + FxU8 detail_scale, + float detail_max) +{ +#define FN_NAME "grTexDetailControl" + TRAP_LOG("%s(%s, %u, %d, %f)\n", FN_NAME, TRP_TMU(tmu), lod_bias, detail_scale, detail_max); + grTexDetailControl(tmu, lod_bias, detail_scale, detail_max); +#undef FN_NAME +} + +void FX_CALL trap_grTexFilterMode (GrChipID_t tmu, + GrTextureFilterMode_t minfilter_mode, + GrTextureFilterMode_t magfilter_mode) +{ +#define FN_NAME "grTexFilterMode" + TRAP_LOG("%s(%s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_TEXFILTER(minfilter_mode), TRP_TEXFILTER(magfilter_mode)); + grTexFilterMode(tmu, minfilter_mode, magfilter_mode); +#undef FN_NAME +} + +void FX_CALL trap_grTexLodBiasValue (GrChipID_t tmu, + float bias) +{ +#define FN_NAME "grTexLodBiasValue" + TRAP_LOG("%s(%s, %f)\n", FN_NAME, TRP_TMU(tmu), bias); + grTexLodBiasValue(tmu, bias); +#undef FN_NAME +} + +void FX_CALL trap_grTexDownloadMipMap (GrChipID_t tmu, + FxU32 startAddress, + FxU32 evenOdd, + GrTexInfo *info) +{ +#define FN_NAME "grTexDownloadMipMap" + TRAP_LOG("%s(%s, %08lx, %s, %p)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_EVENODD(evenOdd), (void *)info); + grTexDownloadMipMap(tmu, startAddress, evenOdd, info); +#undef FN_NAME +} + +void FX_CALL trap_grTexDownloadMipMapLevel (GrChipID_t tmu, + FxU32 startAddress, + GrLOD_t thisLod, + GrLOD_t largeLod, + GrAspectRatio_t aspectRatio, + GrTextureFormat_t format, + FxU32 evenOdd, + void *data) +{ +#define FN_NAME "grTexDownloadMipMapLevel" + TRAP_LOG("%s(%s, %08lx, %s, %s, %s, %s, %s, %p)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_LODLEVEL(thisLod), TRP_LODLEVEL(largeLod), TRP_ASPECTRATIO(aspectRatio), TRP_TEXFMT(format), TRP_EVENODD(evenOdd), data); + grTexDownloadMipMapLevel(tmu, startAddress, thisLod, largeLod, aspectRatio, format, evenOdd, data); +#undef FN_NAME +} + +FxBool FX_CALL trap_grTexDownloadMipMapLevelPartial (GrChipID_t tmu, + FxU32 startAddress, + GrLOD_t thisLod, + GrLOD_t largeLod, + GrAspectRatio_t aspectRatio, + GrTextureFormat_t format, + FxU32 evenOdd, + void *data, + int start, + int end) +{ +#define FN_NAME "grTexDownloadMipMapLevelPartial" + FxBool rv; + TRAP_LOG("%s(%s, %08lx, %s, %s, %s, %s, %s, %p, %d, %d)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_LODLEVEL(thisLod), TRP_LODLEVEL(largeLod), TRP_ASPECTRATIO(aspectRatio), TRP_TEXFMT(format), TRP_EVENODD(evenOdd), data, start, end); + rv = grTexDownloadMipMapLevelPartial(tmu, startAddress, thisLod, largeLod, aspectRatio, format, evenOdd, data, start, end); + TRAP_LOG(GOT "%s\n", TRP_BOOL(rv)); + return rv; +#undef FN_NAME +} + +void FX_CALL trap_grTexDownloadTable (GrTexTable_t type, + void *data) +{ +#define FN_NAME "grTexDownloadTable" + TRAP_LOG("%s(%s, %p)\n", FN_NAME, TRP_TABLE(type), data); + grTexDownloadTable(type, data); +#undef FN_NAME +} + +void FX_CALL trap_grTexDownloadTablePartial (GrTexTable_t type, + void *data, + int start, + int end) +{ +#define FN_NAME "grTexDownloadTablePartial" + TRAP_LOG("%s(%s, %p, %d, %d)\n", FN_NAME, TRP_TABLE(type), data, start, end); + grTexDownloadTablePartial(type, data, start, end); +#undef FN_NAME +} + +void FX_CALL trap_grTexMipMapMode (GrChipID_t tmu, + GrMipMapMode_t mode, + FxBool lodBlend) +{ +#define FN_NAME "grTexMipMapMode" + TRAP_LOG("%s(%s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_MIPMODE(mode), TRP_BOOL(lodBlend)); + grTexMipMapMode(tmu, mode, lodBlend); +#undef FN_NAME +} + +void FX_CALL trap_grTexMultibase (GrChipID_t tmu, + FxBool enable) +{ +#define FN_NAME "grTexMultibase" + TRAP_LOG("%s(%s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_BOOL(enable)); + grTexMultibase(tmu, enable); +#undef FN_NAME +} + +void FX_CALL trap_grTexMultibaseAddress (GrChipID_t tmu, + GrTexBaseRange_t range, + FxU32 startAddress, + FxU32 evenOdd, + GrTexInfo *info) +{ +#define FN_NAME "grTexMultibaseAddress" + TRAP_LOG("%s(%s, %s, %08lx, %s, %p)\n", FN_NAME, TRP_TMU(tmu), TRP_TEXBASERANGE(range), startAddress, TRP_EVENODD(evenOdd), (void *)info); + grTexMultibaseAddress(tmu, range, startAddress, evenOdd, info); +#undef FN_NAME +} + +/* +** linear frame buffer functions +*/ +FxBool FX_CALL trap_grLfbLock (GrLock_t type, + GrBuffer_t buffer, + GrLfbWriteMode_t writeMode, + GrOriginLocation_t origin, + FxBool pixelPipeline, + GrLfbInfo_t *info) +{ +#define FN_NAME "grLfbLock" + FxBool rv; + TRAP_LOG("%s(%s, %s, %s, %s, %s, %p)\n", FN_NAME, TRP_LOCKTYPE(type), TRP_BUFFER(buffer), TRP_WRITEMODE(writeMode), TRP_ORIGIN(origin), TRP_BOOL(pixelPipeline), (void *)info); + rv = grLfbLock(type, buffer, writeMode, origin, pixelPipeline, info); + TRAP_LOG(GOT "%s\n", TRP_BOOL(rv)); + return rv; +#undef FN_NAME +} + +FxBool FX_CALL trap_grLfbUnlock (GrLock_t type, + GrBuffer_t buffer) +{ +#define FN_NAME "grLfbUnlock" + FxBool rv; + TRAP_LOG("%s(%s, %s)\n", FN_NAME, TRP_LOCKTYPE(type), TRP_BUFFER(buffer)); + rv = grLfbUnlock(type, buffer); + TRAP_LOG(GOT "%s\n", TRP_BOOL(rv)); + return rv; +#undef FN_NAME +} + +void FX_CALL trap_grLfbConstantAlpha (GrAlpha_t alpha) +{ +#define FN_NAME "grLfbConstantAlpha" + TRAP_LOG("%s(%02x)\n", FN_NAME, alpha); + grLfbConstantAlpha(alpha); +#undef FN_NAME +} + +void FX_CALL trap_grLfbConstantDepth (FxU32 depth) +{ +#define FN_NAME "grLfbConstantDepth" + TRAP_LOG("%s(%08lx)\n", FN_NAME, depth); + grLfbConstantDepth(depth); +#undef FN_NAME +} + +void FX_CALL trap_grLfbWriteColorSwizzle (FxBool swizzleBytes, + FxBool swapWords) +{ +#define FN_NAME "grLfbWriteColorSwizzle" + TRAP_LOG("%s(%s, %s)\n", FN_NAME, TRP_BOOL(swizzleBytes), TRP_BOOL(swapWords)); + grLfbWriteColorSwizzle(swizzleBytes, swapWords); +#undef FN_NAME +} + +void FX_CALL trap_grLfbWriteColorFormat (GrColorFormat_t colorFormat) +{ +#define FN_NAME "grLfbWriteColorFormat" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_COLFMT(colorFormat)); + grLfbWriteColorFormat(colorFormat); +#undef FN_NAME +} + +FxBool FX_CALL trap_grLfbWriteRegion (GrBuffer_t dst_buffer, + FxU32 dst_x, + FxU32 dst_y, + GrLfbSrcFmt_t src_format, + FxU32 src_width, + FxU32 src_height, + FxBool pixelPipeline, + FxI32 src_stride, + void *src_data) +{ +#define FN_NAME "grLfbWriteRegion" + FxBool rv; + TRAP_LOG("%s(%s, %lu, %lu, %s, %lu, %lu, %s, %ld, %p)\n", FN_NAME, TRP_BUFFER(dst_buffer), dst_x, dst_y, TRP_SRCFMT(src_format), src_width, src_height, TRP_BOOL(pixelPipeline), src_stride, src_data); + rv = grLfbWriteRegion(dst_buffer, dst_x, dst_y, src_format, src_width, src_height, pixelPipeline, src_stride, src_data); + TRAP_LOG(GOT "%s\n", TRP_BOOL(rv)); + return rv; +#undef FN_NAME +} + +FxBool FX_CALL trap_grLfbReadRegion (GrBuffer_t src_buffer, + FxU32 src_x, + FxU32 src_y, + FxU32 src_width, + FxU32 src_height, + FxU32 dst_stride, + void *dst_data) +{ +#define FN_NAME "grLfbReadRegion" + FxBool rv; + TRAP_LOG("%s(%s, %lu, %lu, %lu, %lu, %ld, %p)\n", FN_NAME, TRP_BUFFER(src_buffer), src_x, src_y, src_width, src_height, dst_stride, dst_data); + rv = grLfbReadRegion(src_buffer, src_x, src_y, src_width, src_height, dst_stride, dst_data); + TRAP_LOG(GOT "%s\n", TRP_BOOL(rv)); + return rv; +#undef FN_NAME +} + +/* +** glide management functions +*/ +void FX_CALL trap_grGlideInit (void) +{ +#define FN_NAME "grGlideInit" + TRAP_LOG("%s()\n", FN_NAME); + grGlideInit(); +#undef FN_NAME +} + +void FX_CALL trap_grGlideShutdown (void) +{ +#define FN_NAME "grGlideShutdown" + TRAP_LOG("%s()\n", FN_NAME); + grGlideShutdown(); +#undef FN_NAME +} + +void FX_CALL trap_grGlideGetState (void *state) +{ +#define FN_NAME "grGlideGetState" + TRAP_LOG("%s(%p)\n", FN_NAME, state); + grGlideGetState(state); +#undef FN_NAME +} + +void FX_CALL trap_grGlideSetState (const void *state) +{ +#define FN_NAME "grGlideSetState" + TRAP_LOG("%s(%p)\n", FN_NAME, state); + grGlideSetState(state); +#undef FN_NAME +} + +void FX_CALL trap_grGlideGetVertexLayout (void *layout) +{ +#define FN_NAME "grGlideGetVertexLayout" + TRAP_LOG("%s(%p)\n", FN_NAME, layout); + grGlideGetVertexLayout(layout); +#undef FN_NAME +} + +void FX_CALL trap_grGlideSetVertexLayout (const void *layout) +{ +#define FN_NAME "grGlideSetVertexLayout" + TRAP_LOG("%s(%p)\n", FN_NAME, layout); + grGlideSetVertexLayout(layout); +#undef FN_NAME +} + +/* +** glide utility functions +*/ +void FX_CALL trap_guGammaCorrectionRGB (FxFloat red, + FxFloat green, + FxFloat blue) +{ +#define FN_NAME "guGammaCorrectionRGB" + TRAP_LOG("%s(%f, %f, %f)\n", FN_NAME, red, green, blue); + guGammaCorrectionRGB(red, green, blue); +#undef FN_NAME +} + +float FX_CALL trap_guFogTableIndexToW (int i) +{ +#define FN_NAME "guFogTableIndexToW" + float rv; + TRAP_LOG("%s(%d)\n", FN_NAME, i); + rv = guFogTableIndexToW(i); + TRAP_LOG(GOT "%f\n", rv); + return rv; +#undef FN_NAME +} + +void FX_CALL trap_guFogGenerateExp (GrFog_t *fogtable, + float density) +{ +#define FN_NAME "guFogGenerateExp" + TRAP_LOG("%s(%p, %f)\n", FN_NAME, fogtable, density); + guFogGenerateExp(fogtable, density); +#undef FN_NAME +} + +void FX_CALL trap_guFogGenerateExp2 (GrFog_t *fogtable, + float density) +{ +#define FN_NAME "guFogGenerateExp2" + TRAP_LOG("%s(%p, %f)\n", FN_NAME, fogtable, density); + guFogGenerateExp2(fogtable, density); +#undef FN_NAME +} + +void FX_CALL trap_guFogGenerateLinear (GrFog_t *fogtable, + float nearZ, + float farZ) +{ +#define FN_NAME "guFogGenerateLinear" + TRAP_LOG("%s(%p, %f, %f)\n", FN_NAME, fogtable, nearZ, farZ); + guFogGenerateLinear(fogtable, nearZ, farZ); +#undef FN_NAME +} + +/* +** glide extensions +*/ +char *FX_CALL trap_grGetRegistryOrEnvironmentStringExt (char *theEntry) +{ +#define FN_NAME "grGetRegistryOrEnvironmentStringExt" + char *rv; + TRAP_LOG("%s(\"%s\")\n", FN_NAME, theEntry); + assert(real_grGetRegistryOrEnvironmentStringExt); + rv = (*real_grGetRegistryOrEnvironmentStringExt)(theEntry); + if (rv) { + TRAP_LOG(GOT "\"%s\"\n", rv); + } else { + TRAP_LOG(GOT "NULL\n"); + } + return rv; +#undef FN_NAME +} + +void FX_CALL trap_grGetGammaTableExt (FxU32 nentries, + FxU32 *red, + FxU32 *green, + FxU32 *blue) +{ +#define FN_NAME "grGetGammaTableExt" + TRAP_LOG("%s(%lu, %p, %p, %p)\n", FN_NAME, nentries, (void *)red, (void *)green, (void *)blue); + assert(real_grGetGammaTableExt); + (*real_grGetGammaTableExt)(nentries, red, green, blue); +#undef FN_NAME +} + +void FX_CALL trap_grChromaRangeModeExt (GrChromakeyMode_t mode) +{ +#define FN_NAME "grChromaRangeModeExt" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_CKMODE(mode)); + assert(real_grChromaRangeModeExt); + (*real_grChromaRangeModeExt)(mode); +#undef FN_NAME +} + +void FX_CALL trap_grChromaRangeExt (GrColor_t color, + GrColor_t range, + GrChromaRangeMode_t match_mode) +{ +#define FN_NAME "grChromaRangeExt" + TRAP_LOG("%s(%08lx, %08lx, %s)\n", FN_NAME, color, range, TRP_CRMODE(match_mode)); + assert(real_grChromaRangeExt); + (*real_grChromaRangeExt)(color, range, match_mode); +#undef FN_NAME +} + +void FX_CALL trap_grTexChromaModeExt (GrChipID_t tmu, + GrChromakeyMode_t mode) +{ +#define FN_NAME "grTexChromaModeExt" + TRAP_LOG("%s(%s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_CKMODE(mode)); + assert(real_grTexChromaModeExt); + (*real_grTexChromaModeExt)(tmu, mode); +#undef FN_NAME +} + +void FX_CALL trap_grTexChromaRangeExt (GrChipID_t tmu, + GrColor_t min, + GrColor_t max, + GrTexChromakeyMode_t mode) +{ +#define FN_NAME "grTexChromaRangeExt" + TRAP_LOG("%s(%s, %08lx, %08lx, %s)\n", FN_NAME, TRP_TMU(tmu), min, max, TRP_CRMODE(mode)); + assert(real_grTexChromaRangeExt); + (*real_grTexChromaRangeExt)(tmu, min, max, mode); +#undef FN_NAME +} + + /* tbext */ +void FX_CALL trap_grTextureBufferExt (GrChipID_t tmu, + FxU32 startAddress, + GrLOD_t thisLOD, + GrLOD_t largeLOD, + GrAspectRatio_t aspectRatio, + GrTextureFormat_t format, + FxU32 odd_even_mask) +{ +#define FN_NAME "grTextureBufferExt" + TRAP_LOG("%s(%s, %08lx, %s, %s, %s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_LODLEVEL(thisLOD), TRP_LODLEVEL(largeLOD), TRP_ASPECTRATIO(aspectRatio), TRP_TEXFMT(format), TRP_EVENODD(odd_even_mask)); + assert(real_grTextureBufferExt); + (*real_grTextureBufferExt)(tmu, startAddress, thisLOD, largeLOD, aspectRatio, format, odd_even_mask); +#undef FN_NAME +} + +void FX_CALL trap_grTextureAuxBufferExt (GrChipID_t tmu, + FxU32 startAddress, + GrLOD_t thisLOD, + GrLOD_t largeLOD, + GrAspectRatio_t aspectRatio, + GrTextureFormat_t format, + FxU32 odd_even_mask) +{ +#define FN_NAME "grTextureAuxBufferExt" + TRAP_LOG("%s(%s, %08lx, %s, %s, %s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_LODLEVEL(thisLOD), TRP_LODLEVEL(largeLOD), TRP_ASPECTRATIO(aspectRatio), TRP_TEXFMT(format), TRP_EVENODD(odd_even_mask)); + assert(real_grTextureAuxBufferExt); + (*real_grTextureAuxBufferExt)(tmu, startAddress, thisLOD, largeLOD, aspectRatio, format, odd_even_mask); +#undef FN_NAME +} + +void FX_CALL trap_grAuxBufferExt (GrBuffer_t buffer) +{ +#define FN_NAME "grAuxBufferExt" + TRAP_LOG("%s(%s)\n", FN_NAME, TRP_BUFFER(buffer)); + assert(real_grAuxBufferExt); + (*real_grAuxBufferExt)(buffer); +#undef FN_NAME +} + + /* napalm */ +GrContext_t FX_CALL trap_grSstWinOpenExt (FxU32 hWnd, + GrScreenResolution_t resolution, + GrScreenRefresh_t refresh, + GrColorFormat_t format, + GrOriginLocation_t origin, + GrPixelFormat_t pixelformat, + int nColBuffers, + int nAuxBuffers) +{ +#define FN_NAME "grSstWinOpenExt" + GrContext_t rv; + TRAP_LOG("%s(%08lx, %s, %s, %s, %s, %s, %d, %d)\n", FN_NAME, hWnd, TRP_RESOLUTION(resolution), TRP_REFRESH(refresh), TRP_COLFMT(format), TRP_ORIGIN(origin), TRP_PIXFMT(pixelformat), nColBuffers, nAuxBuffers); + assert(real_grSstWinOpenExt); + rv = (*real_grSstWinOpenExt)(hWnd, resolution, refresh, format, origin, pixelformat, nColBuffers, nAuxBuffers); + TRAP_LOG(GOT "%p\n", (void *)rv); + return rv; +#undef FN_NAME +} + +void FX_CALL trap_grStencilFuncExt (GrCmpFnc_t fnc, + GrStencil_t ref, + GrStencil_t mask) +{ +#define FN_NAME "grStencilFuncExt" + TRAP_LOG("%s(%s, %02x, %02x)\n", FN_NAME, TRP_CMPFUNC(fnc), ref, mask); + assert(real_grStencilFuncExt); + (*real_grStencilFuncExt)(fnc, ref, mask); +#undef FN_NAME +} + +void FX_CALL trap_grStencilMaskExt (GrStencil_t value) +{ +#define FN_NAME "grStencilMaskExt" + TRAP_LOG("%s(%02x)\n", FN_NAME, value); + assert(real_grStencilMaskExt); + (*real_grStencilMaskExt)(value); +#undef FN_NAME +} + +void FX_CALL trap_grStencilOpExt (GrStencilOp_t stencil_fail, + GrStencilOp_t depth_fail, + GrStencilOp_t depth_pass) +{ +#define FN_NAME "grStencilOpExt" + TRAP_LOG("%s(%s, %s, %s)\n", FN_NAME, TRP_STENCILOP(stencil_fail), TRP_STENCILOP(depth_fail), TRP_STENCILOP(depth_pass)); + assert(real_grStencilOpExt); + (*real_grStencilOpExt)(stencil_fail, depth_fail, depth_pass); +#undef FN_NAME +} + +void FX_CALL trap_grLfbConstantStencilExt (GrStencil_t value) +{ +#define FN_NAME "grLfbConstantStencilExt" + TRAP_LOG("%s(%02x)\n", FN_NAME, value); + assert(real_grLfbConstantStencilExt); + (*real_grLfbConstantStencilExt)(value); +#undef FN_NAME +} + +void FX_CALL trap_grBufferClearExt (GrColor_t color, + GrAlpha_t alpha, + FxU32 depth, + GrStencil_t stencil) +{ +#define FN_NAME "grBufferClearExt" + TRAP_LOG("%s(%08lx, %02x, %08lx, %02x)\n", FN_NAME, color, alpha, depth, stencil); + assert(real_grBufferClearExt); + (*real_grBufferClearExt)(color, alpha, depth, stencil); +#undef FN_NAME +} + +void FX_CALL trap_grColorCombineExt (GrCCUColor_t a, + GrCombineMode_t a_mode, + GrCCUColor_t b, + GrCombineMode_t b_mode, + GrCCUColor_t c, + FxBool c_invert, + GrCCUColor_t d, + FxBool d_invert, + FxU32 shift, + FxBool invert) +{ +#define FN_NAME "grColorCombineExt" + TRAP_LOG("%s(%s, %s, %s, %s, %s, %s, %s, %s, %lu, %s)\n", FN_NAME, TRP_CU(a), TRP_CMBMODE(a_mode), TRP_CU(b), TRP_CMBMODE(b_mode), TRP_CU(c), TRP_BOOL(c_invert), TRP_CU(d), TRP_BOOL(d_invert), shift, TRP_BOOL(invert)); + assert(real_grColorCombineExt); + (*real_grColorCombineExt)(a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert); +#undef FN_NAME +} + +void FX_CALL trap_grAlphaCombineExt (GrACUColor_t a, + GrCombineMode_t a_mode, + GrACUColor_t b, + GrCombineMode_t b_mode, + GrACUColor_t c, + FxBool c_invert, + GrACUColor_t d, + FxBool d_invert, + FxU32 shift, + FxBool invert) +{ +#define FN_NAME "grAlphaCombineExt" + TRAP_LOG("%s(%s, %s, %s, %s, %s, %s, %s, %s, %lu, %s)\n", FN_NAME, TRP_CU(a), TRP_CMBMODE(a_mode), TRP_CU(b), TRP_CMBMODE(b_mode), TRP_CU(c), TRP_BOOL(c_invert), TRP_CU(d), TRP_BOOL(d_invert), shift, TRP_BOOL(invert)); + assert(real_grAlphaCombineExt); + (*real_grAlphaCombineExt)(a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert); +#undef FN_NAME +} + +void FX_CALL trap_grTexColorCombineExt (GrChipID_t tmu, + GrTCCUColor_t a, + GrCombineMode_t a_mode, + GrTCCUColor_t b, + GrCombineMode_t b_mode, + GrTCCUColor_t c, + FxBool c_invert, + GrTCCUColor_t d, + FxBool d_invert, + FxU32 shift, + FxBool invert) +{ +#define FN_NAME "grTexColorCombineExt" + TRAP_LOG("%s(%s, %s, %s, %s, %s, %s, %s, %s, %s, %lu, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_CU(a), TRP_CMBMODE(a_mode), TRP_CU(b), TRP_CMBMODE(b_mode), TRP_CU(c), TRP_BOOL(c_invert), TRP_CU(d), TRP_BOOL(d_invert), shift, TRP_BOOL(invert)); + assert(real_grTexColorCombineExt); + (*real_grTexColorCombineExt)(tmu, a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert); +#undef FN_NAME +} + +void FX_CALL trap_grTexAlphaCombineExt (GrChipID_t tmu, + GrTACUColor_t a, + GrCombineMode_t a_mode, + GrTACUColor_t b, + GrCombineMode_t b_mode, + GrTACUColor_t c, + FxBool c_invert, + GrTACUColor_t d, + FxBool d_invert, + FxU32 shift, + FxBool invert) +{ +#define FN_NAME "grTexAlphaCombineExt" + TRAP_LOG("%s(%s, %s, %s, %s, %s, %s, %s, %s, %s, %lu, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_CU(a), TRP_CMBMODE(a_mode), TRP_CU(b), TRP_CMBMODE(b_mode), TRP_CU(c), TRP_BOOL(c_invert), TRP_CU(d), TRP_BOOL(d_invert), shift, TRP_BOOL(invert)); + assert(real_grTexAlphaCombineExt); + (*real_grTexAlphaCombineExt)(tmu, a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert); +#undef FN_NAME +} + +void FX_CALL trap_grConstantColorValueExt (GrChipID_t tmu, + GrColor_t value) +{ +#define FN_NAME "grConstantColorValueExt" + TRAP_LOG("%s(%s, %08lx)\n", FN_NAME, TRP_TMU(tmu), value); + assert(real_grConstantColorValueExt); + (*real_grConstantColorValueExt)(tmu, value); +#undef FN_NAME +} + +void FX_CALL trap_grColorMaskExt (FxBool r, + FxBool g, + FxBool b, + FxBool a) +{ +#define FN_NAME "grColorMaskExt" + TRAP_LOG("%s(%s, %s, %s, %s)\n", FN_NAME, TRP_BOOL(r), TRP_BOOL(g), TRP_BOOL(b), TRP_BOOL(a)); + assert(real_grColorMaskExt); + (*real_grColorMaskExt)(r, g, b, a); +#undef FN_NAME +} + +void FX_CALL trap_grAlphaBlendFunctionExt (GrAlphaBlendFnc_t rgb_sf, + GrAlphaBlendFnc_t rgb_df, + GrAlphaBlendOp_t rgb_op, + GrAlphaBlendFnc_t alpha_sf, + GrAlphaBlendFnc_t alpha_df, + GrAlphaBlendOp_t alpha_op) +{ +#define FN_NAME "grAlphaBlendFunctionExt" + TRAP_LOG("%s(%s, %s, %s, %s, %s, %s)\n", FN_NAME, TRP_BLEND(rgb_sf), TRP_BLEND(rgb_df), TRP_BLENDOP(rgb_op), TRP_BLEND(alpha_sf), TRP_BLEND(alpha_df), TRP_BLENDOP(alpha_op)); + assert(real_grAlphaBlendFunctionExt); + (*real_grAlphaBlendFunctionExt)(rgb_sf, rgb_df, rgb_op, alpha_sf, alpha_df, alpha_op); +#undef FN_NAME +} + +void FX_CALL trap_grTBufferWriteMaskExt (FxU32 tmask) +{ +#define FN_NAME "grTBufferWriteMaskExt" + TRAP_LOG("%s(%08lx)\n", FN_NAME, tmask); + assert(real_grTBufferWriteMaskExt); + (*real_grTBufferWriteMaskExt)(tmask); +#undef FN_NAME +} +#endif + + + +/****************************************************************************\ +* interface +\****************************************************************************/ +void tdfx_hook_glide (struct tdfx_glide *Glide) +{ +#if DEBUG_TRAP +#define GET_EXT_ADDR(name) *(GrProc *)&real_##name = grGetProcAddress(#name), Glide->name = trap_##name +#else /* DEBUG_TRAP */ +#define GET_EXT_ADDR(name) *(GrProc *)&Glide->name = grGetProcAddress(#name) +#endif /* DEBUG_TRAP */ + + /* + ** glide extensions + */ + GET_EXT_ADDR(grGetRegistryOrEnvironmentStringExt); + GET_EXT_ADDR(grGetGammaTableExt); + GET_EXT_ADDR(grChromaRangeModeExt); + GET_EXT_ADDR(grChromaRangeExt); + GET_EXT_ADDR(grTexChromaModeExt); + GET_EXT_ADDR(grTexChromaRangeExt); + /* tbext */ + GET_EXT_ADDR(grTextureBufferExt); + GET_EXT_ADDR(grTextureAuxBufferExt); + GET_EXT_ADDR(grAuxBufferExt); + /* napalm */ + GET_EXT_ADDR(grSstWinOpenExt); + GET_EXT_ADDR(grStencilFuncExt); + GET_EXT_ADDR(grStencilMaskExt); + GET_EXT_ADDR(grStencilOpExt); + GET_EXT_ADDR(grLfbConstantStencilExt); + GET_EXT_ADDR(grBufferClearExt); + GET_EXT_ADDR(grColorCombineExt); + GET_EXT_ADDR(grAlphaCombineExt); + GET_EXT_ADDR(grTexColorCombineExt); + GET_EXT_ADDR(grTexAlphaCombineExt); + GET_EXT_ADDR(grConstantColorValueExt); + GET_EXT_ADDR(grColorMaskExt); + GET_EXT_ADDR(grAlphaBlendFunctionExt); + GET_EXT_ADDR(grTBufferWriteMaskExt); + +#undef GET_EXT_ADDR +} diff --git a/src/mesa/drivers/glide/fxg.h b/src/mesa/drivers/glide/fxg.h new file mode 100644 index 00000000000..234e52aee8c --- /dev/null +++ b/src/mesa/drivers/glide/fxg.h @@ -0,0 +1,352 @@ +/* + * Mesa 3-D graphics library + * Version: 5.0.1 + * + * Copyright (C) 1999-2003 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. + */ + +/* + * Mesa/FX device driver. Interface to Glide3. + * + * Copyright (c) 2003 - Daniel Borca + * Email : dborca@users.sourceforge.net + * Web : http://www.geocities.com/dborca + */ + + +#ifndef TDFX_GLIDE_H_included +#define TDFX_GLIDE_H_included + +#include +#include + +#define DEBUG_TRAP 0 + +#if DEBUG_TRAP +/* +** rendering functions +*/ +void FX_CALL trap_grDrawPoint (const void *pt); +void FX_CALL trap_grDrawLine (const void *v1, const void *v2); +void FX_CALL trap_grDrawTriangle (const void *a, const void *b, const void *c); +void FX_CALL trap_grVertexLayout (FxU32 param, FxI32 offset, FxU32 mode); +void FX_CALL trap_grDrawVertexArray (FxU32 mode, FxU32 Count, void *pointers); +void FX_CALL trap_grDrawVertexArrayContiguous (FxU32 mode, FxU32 Count, void *pointers, FxU32 stride); + +/* +** Antialiasing Functions +*/ +void FX_CALL trap_grAADrawTriangle (const void *a, const void *b, const void *c, FxBool ab_antialias, FxBool bc_antialias, FxBool ca_antialias); + +/* +** buffer management +*/ +void FX_CALL trap_grBufferClear (GrColor_t color, GrAlpha_t alpha, FxU32 depth); +void FX_CALL trap_grBufferSwap (FxU32 swap_interval); +void FX_CALL trap_grRenderBuffer (GrBuffer_t buffer); + +/* +** error management +*/ +void FX_CALL trap_grErrorSetCallback (GrErrorCallbackFnc_t fnc); + +/* +** SST routines +*/ +void FX_CALL trap_grFinish (void); +void FX_CALL trap_grFlush (void); +GrContext_t FX_CALL trap_grSstWinOpen (FxU32 hWnd, GrScreenResolution_t screen_resolution, GrScreenRefresh_t refresh_rate, GrColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers); +FxBool FX_CALL trap_grSstWinClose (GrContext_t context); +void FX_CALL trap_grSetNumPendingBuffers (FxI32 NumPendingBuffers); +FxBool FX_CALL trap_grSelectContext (GrContext_t context); +void FX_CALL trap_grSstOrigin (GrOriginLocation_t origin); +void FX_CALL trap_grSstSelect (int which_sst); + +/* +** Glide configuration and special effect maintenance functions +*/ +void FX_CALL trap_grAlphaBlendFunction (GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df); +void FX_CALL trap_grAlphaCombine (GrCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, FxBool invert); +void FX_CALL trap_grAlphaControlsITRGBLighting (FxBool enable); +void FX_CALL trap_grAlphaTestFunction (GrCmpFnc_t function); +void FX_CALL trap_grAlphaTestReferenceValue (GrAlpha_t value); +void FX_CALL trap_grChromakeyMode (GrChromakeyMode_t mode); +void FX_CALL trap_grChromakeyValue (GrColor_t value); +void FX_CALL trap_grClipWindow (FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy); +void FX_CALL trap_grColorCombine (GrCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, FxBool invert); +void FX_CALL trap_grColorMask (FxBool rgb, FxBool a); +void FX_CALL trap_grCullMode (GrCullMode_t mode); +void FX_CALL trap_grConstantColorValue (GrColor_t value); +void FX_CALL trap_grDepthBiasLevel (FxI32 level); +void FX_CALL trap_grDepthBufferFunction (GrCmpFnc_t function); +void FX_CALL trap_grDepthBufferMode (GrDepthBufferMode_t mode); +void FX_CALL trap_grDepthMask (FxBool mask); +void FX_CALL trap_grDisableAllEffects (void); +void FX_CALL trap_grDitherMode (GrDitherMode_t mode); +void FX_CALL trap_grFogColorValue (GrColor_t fogcolor); +void FX_CALL trap_grFogMode (GrFogMode_t mode); +void FX_CALL trap_grFogTable (const GrFog_t ft[]); +void FX_CALL trap_grLoadGammaTable (FxU32 nentries, FxU32 *red, FxU32 *green, FxU32 *blue); +void FX_CALL trap_grSplash (float x, float y, float width, float height, FxU32 frame); +FxU32 FX_CALL trap_grGet (FxU32 pname, FxU32 plength, FxI32 *params); +const char * FX_CALL trap_grGetString (FxU32 pname); +FxI32 FX_CALL trap_grQueryResolutions (const GrResolution *resTemplate, GrResolution *output); +FxBool FX_CALL trap_grReset (FxU32 what); +GrProc FX_CALL trap_grGetProcAddress (char *procName); +void FX_CALL trap_grEnable (GrEnableMode_t mode); +void FX_CALL trap_grDisable (GrEnableMode_t mode); +void FX_CALL trap_grCoordinateSpace (GrCoordinateSpaceMode_t mode); +void FX_CALL trap_grDepthRange (FxFloat n, FxFloat f); +void FX_CALL trap_grStippleMode (GrStippleMode_t mode); +void FX_CALL trap_grStipplePattern (GrStipplePattern_t mode); +void FX_CALL trap_grViewport (FxI32 x, FxI32 y, FxI32 width, FxI32 height); + +/* +** texture mapping control functions +*/ +FxU32 FX_CALL trap_grTexCalcMemRequired (GrLOD_t lodmin, GrLOD_t lodmax, GrAspectRatio_t aspect, GrTextureFormat_t fmt); +FxU32 FX_CALL trap_grTexTextureMemRequired (FxU32 evenOdd, GrTexInfo *info); +FxU32 FX_CALL trap_grTexMinAddress (GrChipID_t tmu); +FxU32 FX_CALL trap_grTexMaxAddress (GrChipID_t tmu); +void FX_CALL trap_grTexNCCTable (GrNCCTable_t table); +void FX_CALL trap_grTexSource (GrChipID_t tmu, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info); +void FX_CALL trap_grTexClampMode (GrChipID_t tmu, GrTextureClampMode_t s_clampmode, GrTextureClampMode_t t_clampmode); +void FX_CALL trap_grTexCombine (GrChipID_t tmu, GrCombineFunction_t rgb_function, GrCombineFactor_t rgb_factor, GrCombineFunction_t alpha_function, GrCombineFactor_t alpha_factor, FxBool rgb_invert, FxBool alpha_invert); +void FX_CALL trap_grTexDetailControl (GrChipID_t tmu, int lod_bias, FxU8 detail_scale, float detail_max); +void FX_CALL trap_grTexFilterMode (GrChipID_t tmu, GrTextureFilterMode_t minfilter_mode, GrTextureFilterMode_t magfilter_mode); +void FX_CALL trap_grTexLodBiasValue (GrChipID_t tmu, float bias); +void FX_CALL trap_grTexDownloadMipMap (GrChipID_t tmu, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info); +void FX_CALL trap_grTexDownloadMipMapLevel (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLod, GrLOD_t largeLod, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 evenOdd, void *data); +FxBool FX_CALL trap_grTexDownloadMipMapLevelPartial (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLod, GrLOD_t largeLod, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 evenOdd, void *data, int start, int end); +void FX_CALL trap_grTexDownloadTable (GrTexTable_t type, void *data); +void FX_CALL trap_grTexDownloadTablePartial (GrTexTable_t type, void *data, int start, int end); +void FX_CALL trap_grTexMipMapMode (GrChipID_t tmu, GrMipMapMode_t mode, FxBool lodBlend); +void FX_CALL trap_grTexMultibase (GrChipID_t tmu, FxBool enable); +void FX_CALL trap_grTexMultibaseAddress (GrChipID_t tmu, GrTexBaseRange_t range, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info); + +/* +** linear frame buffer functions +*/ +FxBool FX_CALL trap_grLfbLock (GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode, GrOriginLocation_t origin, FxBool pixelPipeline, GrLfbInfo_t *info); +FxBool FX_CALL trap_grLfbUnlock (GrLock_t type, GrBuffer_t buffer); +void FX_CALL trap_grLfbConstantAlpha (GrAlpha_t alpha); +void FX_CALL trap_grLfbConstantDepth (FxU32 depth); +void FX_CALL trap_grLfbWriteColorSwizzle (FxBool swizzleBytes, FxBool swapWords); +void FX_CALL trap_grLfbWriteColorFormat (GrColorFormat_t colorFormat); +FxBool FX_CALL trap_grLfbWriteRegion (GrBuffer_t dst_buffer, FxU32 dst_x, FxU32 dst_y, GrLfbSrcFmt_t src_format, FxU32 src_width, FxU32 src_height, FxBool pixelPipeline, FxI32 src_stride, void *src_data); +FxBool FX_CALL trap_grLfbReadRegion (GrBuffer_t src_buffer, FxU32 src_x, FxU32 src_y, FxU32 src_width, FxU32 src_height, FxU32 dst_stride, void *dst_data); + +/* +** glide management functions +*/ +void FX_CALL trap_grGlideInit (void); +void FX_CALL trap_grGlideShutdown (void); +void FX_CALL trap_grGlideGetState (void *state); +void FX_CALL trap_grGlideSetState (const void *state); +void FX_CALL trap_grGlideGetVertexLayout (void *layout); +void FX_CALL trap_grGlideSetVertexLayout (const void *layout); + +/* +** glide utility functions +*/ +void FX_CALL trap_guGammaCorrectionRGB (FxFloat red, FxFloat green, FxFloat blue); +float FX_CALL trap_guFogTableIndexToW (int i); +void FX_CALL trap_guFogGenerateExp (GrFog_t *fogtable, float density); +void FX_CALL trap_guFogGenerateExp2 (GrFog_t *fogtable, float density); +void FX_CALL trap_guFogGenerateLinear (GrFog_t *fogtable, float nearZ, float farZ); + +#ifndef DEBUG_TRAP_internal +/* +** rendering functions +*/ +#define grDrawPoint trap_grDrawPoint +#define grDrawLine trap_grDrawLine +#define grDrawTriangle trap_grDrawTriangle +#define grVertexLayout trap_grVertexLayout +#define grDrawVertexArray trap_grDrawVertexArray +#define grDrawVertexArrayContiguous trap_grDrawVertexArrayContiguous + +/* +** Antialiasing Functions +*/ +#define grAADrawTriangle trap_grAADrawTriangle + +/* +** buffer management +*/ +#define grBufferClear trap_grBufferClear +#define grBufferSwap trap_grBufferSwap +#define grRenderBuffer trap_grRenderBuffer + +/* +** error management +*/ +#define grErrorSetCallback trap_grErrorSetCallback + +/* +** SST routines +*/ +#define grFinish trap_grFinish +#define grFlush trap_grFlush +#define grSstWinOpen trap_grSstWinOpen +#define grSstWinClose trap_grSstWinClose +#define grSetNumPendingBuffers trap_grSetNumPendingBuffers +#define grSelectContext trap_grSelectContext +#define grSstOrigin trap_grSstOrigin +#define grSstSelect trap_grSstSelect + +/* +** Glide configuration and special effect maintenance functions +*/ +#define grAlphaBlendFunction trap_grAlphaBlendFunction +#define grAlphaCombine trap_grAlphaCombine +#define grAlphaControlsITRGBLighting trap_grAlphaControlsITRGBLighting +#define grAlphaTestFunction trap_grAlphaTestFunction +#define grAlphaTestReferenceValue trap_grAlphaTestReferenceValue +#define grChromakeyMode trap_grChromakeyMode +#define grChromakeyValue trap_grChromakeyValue +#define grClipWindow trap_grClipWindow +#define grColorCombine trap_grColorCombine +#define grColorMask trap_grColorMask +#define grCullMode trap_grCullMode +#define grConstantColorValue trap_grConstantColorValue +#define grDepthBiasLevel trap_grDepthBiasLevel +#define grDepthBufferFunction trap_grDepthBufferFunction +#define grDepthBufferMode trap_grDepthBufferMode +#define grDepthMask trap_grDepthMask +#define grDisableAllEffects trap_grDisableAllEffects +#define grDitherMode trap_grDitherMode +#define grFogColorValue trap_grFogColorValue +#define grFogMode trap_grFogMode +#define grFogTable trap_grFogTable +#define grLoadGammaTable trap_grLoadGammaTable +#define grSplash trap_grSplash +#define grGet trap_grGet +#define grGetString trap_grGetString +#define grQueryResolutions trap_grQueryResolutions +#define grReset trap_grReset +#define grGetProcAddress trap_grGetProcAddress +#define grEnable trap_grEnable +#define grDisable trap_grDisable +#define grCoordinateSpace trap_grCoordinateSpace +#define grDepthRange trap_grDepthRange +#define grStippleMode trap_grStippleMode +#define grStipplePattern trap_grStipplePattern +#define grViewport trap_grViewport + +/* +** texture mapping control functions +*/ +#define grTexCalcMemRequired trap_grTexCalcMemRequired +#define grTexTextureMemRequired trap_grTexTextureMemRequired +#define grTexMinAddress trap_grTexMinAddress +#define grTexMaxAddress trap_grTexMaxAddress +#define grTexNCCTable trap_grTexNCCTable +#define grTexSource trap_grTexSource +#define grTexClampMode trap_grTexClampMode +#define grTexCombine trap_grTexCombine +#define grTexDetailControl trap_grTexDetailControl +#define grTexFilterMode trap_grTexFilterMode +#define grTexLodBiasValue trap_grTexLodBiasValue +#define grTexDownloadMipMap trap_grTexDownloadMipMap +#define grTexDownloadMipMapLevel trap_grTexDownloadMipMapLevel +#define grTexDownloadMipMapLevelPartial trap_grTexDownloadMipMapLevelPartial +#define grTexDownloadTable trap_grTexDownloadTable +#define grTexDownloadTablePartial trap_grTexDownloadTablePartial +#define grTexMipMapMode trap_grTexMipMapMode +#define grTexMultibase trap_grTexMultibase +#define grTexMultibaseAddress trap_grTexMultibaseAddress + +/* +** linear frame buffer functions +*/ +#define grLfbLock trap_grLfbLock +#define grLfbUnlock trap_grLfbUnlock +#define grLfbConstantAlpha trap_grLfbConstantAlpha +#define grLfbConstantDepth trap_grLfbConstantDepth +#define grLfbWriteColorSwizzle trap_grLfbWriteColorSwizzle +#define grLfbWriteColorFormat trap_grLfbWriteColorFormat +#define grLfbWriteRegion trap_grLfbWriteRegion +#define grLfbReadRegion trap_grLfbReadRegion + +/* +** glide management functions +*/ +#define grGlideInit trap_grGlideInit +#define grGlideShutdown trap_grGlideShutdown +#define grGlideGetState trap_grGlideGetState +#define grGlideSetState trap_grGlideSetState +#define grGlideGetVertexLayout trap_grGlideGetVertexLayout +#define grGlideSetVertexLayout trap_grGlideSetVertexLayout + +/* +** glide utility functions +*/ +#define guGammaCorrectionRGB trap_guGammaCorrectionRGB +#define guFogTableIndexToW trap_guFogTableIndexToW +#define guFogGenerateExp trap_guFogGenerateExp +#define guFogGenerateExp2 trap_guFogGenerateExp2 +#define guFogGenerateLinear trap_guFogGenerateLinear +#endif /* DEBUG_TRAP_internal */ +#endif /* DEBUG_TRAP */ + +struct tdfx_glide { + /* + ** glide extensions + */ + char * (FX_CALL *grGetRegistryOrEnvironmentStringExt) (char *theEntry); + void (FX_CALL *grGetGammaTableExt) (FxU32 nentries, FxU32 *red, FxU32 *green, FxU32 *blue); + void (FX_CALL *grChromaRangeModeExt) (GrChromakeyMode_t mode); + void (FX_CALL *grChromaRangeExt) (GrColor_t color, GrColor_t range, GrChromaRangeMode_t match_mode); + void (FX_CALL *grTexChromaModeExt) (GrChipID_t tmu, GrChromakeyMode_t mode); + void (FX_CALL *grTexChromaRangeExt) (GrChipID_t tmu, GrColor_t min, GrColor_t max, GrTexChromakeyMode_t mode); + + /* tbext */ + void (FX_CALL *grTextureBufferExt) (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLOD, GrLOD_t largeLOD, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 odd_even_mask); + void (FX_CALL *grTextureAuxBufferExt) (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLOD, GrLOD_t largeLOD, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 odd_even_mask); + void (FX_CALL *grAuxBufferExt) (GrBuffer_t buffer); + + /* napalm */ + GrContext_t (FX_CALL *grSstWinOpenExt) (FxU32 hWnd, GrScreenResolution_t resolution, GrScreenRefresh_t refresh, GrColorFormat_t format, GrOriginLocation_t origin, GrPixelFormat_t pixelformat, int nColBuffers, int nAuxBuffers); + void (FX_CALL *grStencilFuncExt) (GrCmpFnc_t fnc, GrStencil_t ref, GrStencil_t mask); + void (FX_CALL *grStencilMaskExt) (GrStencil_t value); + void (FX_CALL *grStencilOpExt) (GrStencilOp_t stencil_fail, GrStencilOp_t depth_fail, GrStencilOp_t depth_pass); + void (FX_CALL *grLfbConstantStencilExt) (GrStencil_t value); + void (FX_CALL *grBufferClearExt) (GrColor_t color, GrAlpha_t alpha, FxU32 depth, GrStencil_t stencil); + void (FX_CALL *grColorCombineExt) (GrCCUColor_t a, GrCombineMode_t a_mode, GrCCUColor_t b, GrCombineMode_t b_mode, GrCCUColor_t c, FxBool c_invert, GrCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert); + void (FX_CALL *grAlphaCombineExt) (GrACUColor_t a, GrCombineMode_t a_mode, GrACUColor_t b, GrCombineMode_t b_mode, GrACUColor_t c, FxBool c_invert, GrACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert); + void (FX_CALL *grTexColorCombineExt) (GrChipID_t tmu, GrTCCUColor_t a, GrCombineMode_t a_mode, GrTCCUColor_t b, GrCombineMode_t b_mode, GrTCCUColor_t c, FxBool c_invert, GrTCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert); + void (FX_CALL *grTexAlphaCombineExt) (GrChipID_t tmu, GrTACUColor_t a, GrCombineMode_t a_mode, GrTACUColor_t b, GrCombineMode_t b_mode, GrTACUColor_t c, FxBool c_invert, GrTACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert); + void (FX_CALL *grConstantColorValueExt) (GrChipID_t tmu, GrColor_t value); + void (FX_CALL *grColorMaskExt) (FxBool r, FxBool g, FxBool b, FxBool a); + void (FX_CALL *grAlphaBlendFunctionExt) (GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendOp_t rgb_op, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df, GrAlphaBlendOp_t alpha_op); + void (FX_CALL *grTBufferWriteMaskExt) (FxU32 tmask); + + /* + ** Texus2 functions + */ + void (*txImgQuantize) (void *xxx_unknown_arguments); + void (*txImgDequantizeFXT1) (void *txMip, void *pxMip); + void (*txErrorSetCallback) (void *fnc); +}; + +void tdfx_hook_glide (struct tdfx_glide *Glide); + +#endif diff --git a/src/mesa/drivers/glide/fxglidew.c b/src/mesa/drivers/glide/fxglidew.c index 69fbebdec83..6e89f00ed83 100644 --- a/src/mesa/drivers/glide/fxglidew.c +++ b/src/mesa/drivers/glide/fxglidew.c @@ -1,4 +1,4 @@ -/* $Id: fxglidew.c,v 1.21 2003/08/19 15:52:53 brianp Exp $ */ +/* $Id: fxglidew.c,v 1.22 2003/10/02 17:36:44 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -41,7 +41,6 @@ #endif #if defined(FX) -#include "glide.h" #include "fxglidew.h" #include "fxdrv.h" @@ -57,8 +56,8 @@ FX_grGetInteger_NoLock(FxU32 pname) return result; } - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "Wrong parameter in FX_grGetInteger!\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s: wrong parameter (%lx)\n", __FUNCTION__, pname); } return -1; } @@ -121,23 +120,6 @@ FX_grSstPerfStats(GrSstPerfStats_t * st) st->pixelsOut = n; } -void -FX_grAADrawLine(GrVertex * a, GrVertex * b) -{ - /* ToDo */ - BEGIN_CLIP_LOOP(); - grDrawLine(a, b); - END_CLIP_LOOP(); -} - -void -FX_grAADrawPoint(GrVertex * a) -{ - BEGIN_CLIP_LOOP(); - grDrawPoint(a); - END_CLIP_LOOP(); -} - void FX_setupGrVertexLayout(void) { @@ -146,8 +128,7 @@ FX_setupGrVertexLayout(void) grCoordinateSpace(GR_WINDOW_COORDS); grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE); - grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE); - grVertexLayout(GR_PARAM_A, GR_VERTEX_A_OFFSET << 2, GR_PARAM_ENABLE); + grVertexLayout(GR_PARAM_PARGB, GR_VERTEX_PARGB_OFFSET << 2, GR_PARAM_ENABLE); grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE); grVertexLayout(GR_PARAM_Z, GR_VERTEX_OOZ_OFFSET << 2, GR_PARAM_ENABLE); grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, @@ -229,84 +210,40 @@ FX_grSstQueryHardware(GrHwConfiguration * config) } grGet(GR_MEMORY_FB, 4, &result); - config->SSTs[i].VoodooConfig.fbRam = result / (1024 * 1024); + config->SSTs[i].fbRam = result / (1024 * 1024); grGet(GR_NUM_TMU, 4, &result); - config->SSTs[i].VoodooConfig.nTexelfx = result; + config->SSTs[i].nTexelfx = result; grGet(GR_REVISION_FB, 4, &result); - config->SSTs[i].VoodooConfig.fbiRev = result; + config->SSTs[i].fbiRev = result; - for (j = 0; j < config->SSTs[i].VoodooConfig.nTexelfx; j++) { + for (j = 0; j < config->SSTs[i].nTexelfx; j++) { grGet(GR_MEMORY_TMU, 4, &result); - config->SSTs[i].VoodooConfig.tmuConfig[j].tmuRam = result / (1024 * 1024); + config->SSTs[i].tmuConfig[j].tmuRam = result / (1024 * 1024); grGet(GR_REVISION_TMU, 4, &result); - config->SSTs[i].VoodooConfig.tmuConfig[j].tmuRev = result; + config->SSTs[i].tmuConfig[j].tmuRev = result; } extension = grGetString(GR_EXTENSION); - if (strstr(extension, " PIXEXT ")) { - config->SSTs[i].VoodooConfig.grSstWinOpenExt = grGetProcAddress("grSstWinOpenExt"); - } - - /* [koolsmoky] */ - grGet(GR_MAX_TEXTURE_SIZE, 4, &result); - config->SSTs[i].VoodooConfig.maxTextureSize = result; + config->SSTs[i].HavePixExt = (strstr(extension, " PIXEXT ") != NULL); + config->SSTs[i].HaveTexFmt = (strstr(extension, " TEXFMT ") != NULL); + config->SSTs[i].HaveCmbExt = (strstr(extension, " COMBINE ") != NULL); + config->SSTs[i].HaveMirExt = (strstr(extension, " TEXMIRROR ") != NULL); + config->SSTs[i].HaveTexus2 = GL_FALSE; /* need to get the number of SLI units for napalm */ grGet(GR_NUM_FB, 4, (void *) &numFB); - config->SSTs[i].VoodooConfig.numChips = numFB; + config->SSTs[i].numChips = numFB; /* this can only be useful for Voodoo2: * sliDetect = ((config->SSTs[i].type == GR_SSTTYPE_Voodoo2) && (numFB > 1)); */ } - END_BOARD_LOCK(); - return 1; -} + tdfx_hook_glide(&config->Glide); -/* It appears to me that this function is needed either way. */ -GrContext_t -FX_grSstWinOpen(struct SstCard_St *c, - FxU32 hWnd, - GrScreenResolution_t screen_resolution, - GrScreenRefresh_t refresh_rate, - GrColorFormat_t color_format, - GrPixelFormat_t pixel_format, - GrOriginLocation_t origin_location, - int nColBuffers, int nAuxBuffers) -{ - GrContext_t i; - BEGIN_BOARD_LOCK(); - if (c->VoodooConfig.grSstWinOpenExt) { - i = c->VoodooConfig.grSstWinOpenExt(hWnd, - screen_resolution, - refresh_rate, - color_format, origin_location, - pixel_format, - nColBuffers, nAuxBuffers); - } else - i = grSstWinOpen(hWnd, - screen_resolution, - refresh_rate, - color_format, origin_location, nColBuffers, nAuxBuffers); - - /* - fprintf(stderr, - "grSstWinOpen( win %d res %d ref %d fmt %d\n" - " org %d ncol %d naux %d )\n" - " ==> %d\n", - hWnd, - screen_resolution, - refresh_rate, - color_format, - origin_location, - nColBuffers, - nAuxBuffers, - i); - */ END_BOARD_LOCK(); - return i; + return 1; } diff --git a/src/mesa/drivers/glide/fxglidew.h b/src/mesa/drivers/glide/fxglidew.h index a09df0b48cf..f6177e4ff58 100644 --- a/src/mesa/drivers/glide/fxglidew.h +++ b/src/mesa/drivers/glide/fxglidew.h @@ -1,4 +1,4 @@ -/* $Id: fxglidew.h,v 1.15 2003/08/19 15:52:53 brianp Exp $ */ +/* $Id: fxglidew.h,v 1.16 2003/10/02 17:36:44 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -38,43 +38,10 @@ #define __FX_GLIDE_WARPER__ -#include -#include +#include "fxg.h" -#define FX_grGetInteger FX_grGetInteger_NoLock -extern FxI32 FX_grGetInteger_NoLock(FxU32 pname); - - - -#define GR_ASPECT_1x1 GR_ASPECT_LOG2_1x1 -#define GR_ASPECT_2x1 GR_ASPECT_LOG2_2x1 -#define GR_ASPECT_4x1 GR_ASPECT_LOG2_4x1 -#define GR_ASPECT_8x1 GR_ASPECT_LOG2_8x1 -#define GR_ASPECT_1x2 GR_ASPECT_LOG2_1x2 -#define GR_ASPECT_1x4 GR_ASPECT_LOG2_1x4 -#define GR_ASPECT_1x8 GR_ASPECT_LOG2_1x8 - -#define GR_LOD_2048 GR_LOD_LOG2_2048 /* [koolsmoky] big texture support for napalm */ -#define GR_LOD_1024 GR_LOD_LOG2_1024 -#define GR_LOD_512 GR_LOD_LOG2_512 -#define GR_LOD_256 GR_LOD_LOG2_256 -#define GR_LOD_128 GR_LOD_LOG2_128 -#define GR_LOD_64 GR_LOD_LOG2_64 -#define GR_LOD_32 GR_LOD_LOG2_32 -#define GR_LOD_16 GR_LOD_LOG2_16 -#define GR_LOD_8 GR_LOD_LOG2_8 -#define GR_LOD_4 GR_LOD_LOG2_4 -#define GR_LOD_2 GR_LOD_LOG2_2 -#define GR_LOD_1 GR_LOD_LOG2_1 - -#define GR_FOG_WITH_TABLE GR_FOG_WITH_TABLE_ON_Q - - - -typedef int GrSstType; - #define MAX_NUM_SST 4 enum { @@ -88,29 +55,33 @@ enum { GR_SSTTYPE_Voodoo5 = 7 }; +#define GrState void + +typedef int GrSstType; + typedef struct GrTMUConfig_St { int tmuRev; /* Rev of Texelfx chip */ int tmuRam; /* 1, 2, or 4 MB */ } GrTMUConfig_t; -typedef struct GrVoodooConfig_St { - int fbRam; /* 1, 2, or 4 MB */ - int fbiRev; /* Rev of Pixelfx chip */ - int nTexelfx; /* How many texelFX chips are there? */ - GrTMUConfig_t tmuConfig[GLIDE_NUM_TMU]; /* Configuration of the Texelfx chips */ - int maxTextureSize; - int numChips; /* Number of Voodoo chips [koolsmoky] */ - /* Glide3 extensions */ - GrProc grSstWinOpenExt; -} GrVoodooConfig_t; - typedef struct { int num_sst; /* # of HW units in the system */ struct SstCard_St { GrSstType type; /* Which hardware is it? */ - GrVoodooConfig_t VoodooConfig; + int fbRam; /* 1, 2, or 4 MB */ + int fbiRev; /* Rev of Pixelfx chip */ + int nTexelfx; /* How many texelFX chips are there? */ + int numChips; /* Number of Voodoo chips [koolsmoky] */ + GrTMUConfig_t tmuConfig[GLIDE_NUM_TMU]; /* Configuration of the Texelfx chips */ + /* Glide3 extensions */ + FxBool HavePixExt; /* PIXEXT */ + FxBool HaveTexFmt; /* TEXFMT */ + FxBool HaveCmbExt; /* COMBINE */ + FxBool HaveMirExt; /* TEXMIRROR */ + FxBool HaveTexus2; /* Texus 2 - FXT1 */ } SSTs[MAX_NUM_SST]; /* configuration for each board */ + struct tdfx_glide Glide; } GrHwConfiguration; @@ -133,10 +104,6 @@ typedef FxU32 GrSTWHint_t; -#define GrState void - - - /* ** move the vertex layout defintion to application */ @@ -147,29 +114,38 @@ typedef struct { } GrTmuVertex; typedef struct { - float x, y, z; /* X, Y, and Z of scrn space -- Z is ignored */ - float r, g, b; /* R, G, B, ([0..255.0]) */ + float x, y; /* X and Y in screen space */ float ooz; /* 65535/Z (used for Z-buffering) */ - float a; /* Alpha [0..255.0] */ float oow; /* 1/W (used for W-buffering, texturing) */ + unsigned char pargb[4]; /* B, G, R, A [0..255] */ GrTmuVertex tmuvtx[GLIDE_NUM_TMU]; + long pad[16 - 11]; /* future use; also ensure 64b structure */ } GrVertex; #define GR_VERTEX_X_OFFSET 0 #define GR_VERTEX_Y_OFFSET 1 -#define GR_VERTEX_Z_OFFSET 2 -#define GR_VERTEX_R_OFFSET 3 -#define GR_VERTEX_G_OFFSET 4 -#define GR_VERTEX_B_OFFSET 5 -#define GR_VERTEX_OOZ_OFFSET 6 -#define GR_VERTEX_A_OFFSET 7 -#define GR_VERTEX_OOW_OFFSET 8 -#define GR_VERTEX_SOW_TMU0_OFFSET 9 -#define GR_VERTEX_TOW_TMU0_OFFSET 10 -#define GR_VERTEX_OOW_TMU0_OFFSET 11 -#define GR_VERTEX_SOW_TMU1_OFFSET 12 -#define GR_VERTEX_TOW_TMU1_OFFSET 13 -#define GR_VERTEX_OOW_TMU1_OFFSET 14 +#define GR_VERTEX_OOZ_OFFSET 2 +#define GR_VERTEX_OOW_OFFSET 3 +#define GR_VERTEX_PARGB_OFFSET 4 +#define GR_VERTEX_SOW_TMU0_OFFSET 5 +#define GR_VERTEX_TOW_TMU0_OFFSET 6 +#define GR_VERTEX_OOW_TMU0_OFFSET 7 +#define GR_VERTEX_SOW_TMU1_OFFSET 8 +#define GR_VERTEX_TOW_TMU1_OFFSET 9 +#define GR_VERTEX_OOW_TMU1_OFFSET 10 + + + +/* + * For Lod/LodLog2 conversion. + */ +#define FX_largeLodLog2(info) (info).largeLodLog2 +#define FX_aspectRatioLog2(info) (info).aspectRatioLog2 +#define FX_smallLodLog2(info) (info).smallLodLog2 +#define FX_lodToValue(val) ((int)(GR_LOD_LOG2_256-val)) +#define FX_largeLodValue(info) ((int)(GR_LOD_LOG2_256-(info).largeLodLog2)) +#define FX_smallLodValue(info) ((int)(GR_LOD_LOG2_256-(info).smallLodLog2)) +#define FX_valueToLod(val) ((GrLOD_t)(GR_LOD_LOG2_256-val)) @@ -193,31 +169,6 @@ typedef struct { -/* - * Draw triangle - */ -#define FX_grDrawTriangle(a,b,c)\ - do { \ - BEGIN_CLIP_LOOP(); \ - grDrawTriangle(a,b,c); \ - END_CLIP_LOOP(); \ - } while (0) - - - -/* - * For Lod/LodLog2 conversion. - */ -#define FX_largeLodLog2(info) (info).largeLodLog2 -#define FX_aspectRatioLog2(info) (info).aspectRatioLog2 -#define FX_smallLodLog2(info) (info).smallLodLog2 -#define FX_lodToValue(val) ((int)(GR_LOD_256-val)) -#define FX_largeLodValue(info) ((int)(GR_LOD_256-(info).largeLodLog2)) -#define FX_smallLodValue(info) ((int)(GR_LOD_256-(info).smallLodLog2)) -#define FX_valueToLod(val) ((GrLOD_t)(GR_LOD_256-val)) - - - /* * ScreenWidth/Height stuff. */ @@ -231,6 +182,8 @@ extern int FX_grSstScreenHeight(void); */ extern void FX_grSstPerfStats(GrSstPerfStats_t *st); extern int FX_grSstQueryHardware(GrHwConfiguration *config); +#define FX_grGetInteger FX_grGetInteger_NoLock +extern FxI32 FX_grGetInteger_NoLock(FxU32 pname); @@ -242,14 +195,6 @@ extern void FX_grHints_NoLock(GrHint_t hintType, FxU32 hintMask); -/* - * Antialiashed line+point drawing. - */ -extern void FX_grAADrawLine(GrVertex *a, GrVertex *b); -extern void FX_grAADrawPoint(GrVertex *a); - - - /* * Needed for Glide3 only, to set up Glide2 compatible vertex layout. */ @@ -262,39 +207,6 @@ extern void FX_setupGrVertexLayout(void); */ extern FxBool FX_grSstControl(FxU32 code); - - -extern GrContext_t FX_grSstWinOpen(struct SstCard_St *c, - FxU32 hWnd, - GrScreenResolution_t screen_resolution, - GrScreenRefresh_t refresh_rate, - GrColorFormat_t color_format, - GrPixelFormat_t pixel_format, - GrOriginLocation_t origin_location, - int nColBuffers, int nAuxBuffers); - - -#define FX_grDrawLine(v1, v2) \ - do { \ - BEGIN_CLIP_LOOP(); \ - grDrawLine(v1, v2); \ - END_CLIP_LOOP(); \ - } while (0) - -#define FX_grDrawPoint(p) \ - do { \ - BEGIN_CLIP_LOOP(); \ - grDrawPoint(p); \ - END_CLIP_LOOP(); \ - } while (0) - -#define FX_grDrawPolygonVertexList(n, v) \ - do { \ - BEGIN_CLIP_LOOP(); \ - grDrawVertexArrayContiguous(GR_POLYGON, n, v, sizeof(GrVertex)); \ - END_CLIP_LOOP(); \ - } while (0) - #define FX_grBufferClear(c, a, d) \ do { \ BEGIN_CLIP_LOOP(); \ @@ -303,21 +215,12 @@ extern GrContext_t FX_grSstWinOpen(struct SstCard_St *c, } while (0) -#define FX_grAADrawTriangle(a, b, c, ab, bc, ca) \ - do { \ - BEGIN_CLIP_LOOP(); \ - grAADrawTriangle(a, b, c, ab, bc, ca); \ - END_CLIP_LOOP(); \ - } while (0) - - -#define FX_grDrawVertexArray(m, c, p) \ - do { \ - BEGIN_CLIP_LOOP(); \ - grDrawVertexArray(m, c, p); \ - END_CLIP_LOOP(); \ - } while (0) +#if FX_DEBUG +extern int TDFX_DEBUG; +#else +#define TDFX_DEBUG 0 +#endif diff --git a/src/mesa/drivers/glide/fxopengl.def b/src/mesa/drivers/glide/fxopengl.def index cb321670cec..9d0d3eb5012 100644 --- a/src/mesa/drivers/glide/fxopengl.def +++ b/src/mesa/drivers/glide/fxopengl.def @@ -1,197 +1,501 @@ EXPORTS glAccum + glActiveStencilFaceEXT + glActiveTexture + glActiveTextureARB glAlphaFunc + glAreProgramsResidentNV glAreTexturesResident + glAreTexturesResidentEXT glArrayElement + glArrayElementEXT glBegin + glBeginQueryARB + glBindBufferARB + glBindProgramARB + glBindProgramNV glBindTexture + glBindTextureEXT glBitmap + glBlendColor + glBlendColorEXT + glBlendEquation + glBlendEquationEXT glBlendFunc + glBlendFuncSeparate + glBlendFuncSeparateEXT + glBlendFuncSeparateINGR + glBufferDataARB + glBufferSubDataARB glCallList glCallLists glClear glClearAccum - glClearIndex glClearColor glClearDepth + glClearIndex glClearStencil + glClientActiveTexture + glClientActiveTextureARB glClipPlane + glColorMask + glColorMaterial + glColorPointer + glColorPointerEXT + glColorSubTable + glColorSubTableEXT + glColorTable + glColorTableEXT + glColorTableParameterfv + glColorTableParameterfvSGI + glColorTableParameteriv + glColorTableParameterivSGI + glColorTableSGI glColor3b - glColor3d - glColor3f - glColor3i - glColor3s - glColor3ub - glColor3ui - glColor3us - glColor4b - glColor4d - glColor4f - glColor4i - glColor4s - glColor4ub - glColor4ui - glColor4us 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 - glColorTableEXT - glColorSubTableEXT + glCombinerInputNV + glCombinerOutputNV + glCombinerParameterfNV + glCombinerParameterfvNV + glCombinerParameteriNV + glCombinerParameterivNV + glCompressedTexImage1D + glCompressedTexImage1DARB + glCompressedTexImage2D + glCompressedTexImage2DARB + glCompressedTexImage3D + glCompressedTexImage3DARB + glCompressedTexSubImage1D + glCompressedTexSubImage1DARB + glCompressedTexSubImage2D + glCompressedTexSubImage2DARB + glCompressedTexSubImage3D + glCompressedTexSubImage3DARB + glConvolutionFilter1D + glConvolutionFilter1DEXT + glConvolutionFilter2D + glConvolutionFilter2DEXT + glConvolutionParameterf + glConvolutionParameterfEXT + glConvolutionParameterfv + glConvolutionParameterfvEXT + glConvolutionParameteri + glConvolutionParameteriEXT + glConvolutionParameteriv + glConvolutionParameterivEXT + glCopyColorSubTable + glCopyColorSubTableEXT + glCopyColorTable + glCopyColorTableSGI + glCopyConvolutionFilter1D + glCopyConvolutionFilter1DEXT + glCopyConvolutionFilter2D + glCopyConvolutionFilter2DEXT glCopyPixels glCopyTexImage1D + glCopyTexImage1DEXT glCopyTexImage2D + glCopyTexImage2DEXT glCopyTexSubImage1D + glCopyTexSubImage1DEXT glCopyTexSubImage2D + glCopyTexSubImage2DEXT + glCopyTexSubImage3D + glCopyTexSubImage3DEXT glCullFace + glCullParameterdvEXT + glCullParameterfvEXT + glDeleteBuffersARB + glDeleteFencesNV + glDeleteLists + glDeleteProgramsARB + glDeleteProgramsNV + glDeleteQueriesARB + glDeleteTextures + glDeleteTexturesEXT + glDepthBoundsEXT glDepthFunc glDepthMask glDepthRange - glDeleteLists - glDeleteTextures + glDetailTexFuncSGIS glDisable glDisableClientState + glDisableVertexAttribArrayARB glDrawArrays + glDrawArraysEXT glDrawBuffer glDrawElements glDrawPixels + glDrawRangeElements + glDrawRangeElementsEXT + glEdgeFlag + glEdgeFlagPointer + glEdgeFlagPointerEXT + glEdgeFlagv glEnable glEnableClientState + glEnableVertexAttribArrayARB glEnd glEndList + glEndQueryARB glEvalCoord1d - glEvalCoord1f glEvalCoord1dv + glEvalCoord1f glEvalCoord1fv glEvalCoord2d - glEvalCoord2f glEvalCoord2dv + glEvalCoord2f glEvalCoord2fv - glEvalPoint1 - glEvalPoint2 glEvalMesh1 - glEdgeFlag - glEdgeFlagv - glEdgeFlagPointer glEvalMesh2 + glEvalPoint1 + glEvalPoint2 + glExecuteProgramNV glFeedbackBuffer + glFinalCombinerInputNV glFinish + glFinishFenceNV glFlush + glFlushRasterSGIX + glFlushVertexArrayRangeNV + glFogCoordd + glFogCoorddEXT + glFogCoorddv + glFogCoorddvEXT + glFogCoordf + glFogCoordfEXT + glFogCoordfv + glFogCoordfvEXT + glFogCoordPointer + glFogCoordPointerEXT glFogf - glFogi glFogfv + glFogi glFogiv + glFragmentColorMaterialSGIX + glFragmentLightfSGIX + glFragmentLightfvSGIX + glFragmentLightiSGIX + glFragmentLightivSGIX + glFragmentLightModelfSGIX + glFragmentLightModelfvSGIX + glFragmentLightModeliSGIX + glFragmentLightModelivSGIX + glFragmentMaterialfSGIX + glFragmentMaterialfvSGIX + glFragmentMaterialiSGIX + glFragmentMaterialivSGIX + glFrameZoomSGIX glFrontFace glFrustum + glGenBuffersARB + glGenFencesNV glGenLists + glGenProgramsARB + glGenProgramsNV + glGenQueriesARB glGenTextures + glGenTexturesEXT glGetBooleanv + glGetBufferParameterivARB + glGetBufferPointervARB + glGetBufferSubDataARB glGetClipPlane + glGetColorTable glGetColorTableEXT - glGetColorTableParameterivEXT + glGetColorTableParameterfv glGetColorTableParameterfvEXT + glGetColorTableParameterfvSGI + glGetColorTableParameteriv + glGetColorTableParameterivEXT + glGetColorTableParameterivSGI + glGetColorTableSGI + glGetCombinerInputParameterfvNV + glGetCombinerInputParameterivNV + glGetCombinerOutputParameterfvNV + glGetCombinerOutputParameterivNV + glGetCompressedTexImage + glGetCompressedTexImageARB + glGetConvolutionFilter + glGetConvolutionFilterEXT + glGetConvolutionParameterfv + glGetConvolutionParameterfvEXT + glGetConvolutionParameteriv + glGetConvolutionParameterivEXT + glGetDetailTexFuncSGIS glGetDoublev glGetError + glGetFenceivNV + glGetFinalCombinerInputParameterfvNV + glGetFinalCombinerInputParameterivNV glGetFloatv + glGetFragmentLightfvSGIX + glGetFragmentLightivSGIX + glGetFragmentMaterialfvSGIX + glGetFragmentMaterialivSGIX + glGetHistogram + glGetHistogramEXT + glGetHistogramParameterfv + glGetHistogramParameterfvEXT + glGetHistogramParameteriv + glGetHistogramParameterivEXT + glGetInstrumentsSGIX glGetIntegerv glGetLightfv glGetLightiv + glGetListParameterfvSGIX + glGetListParameterivSGIX glGetMapdv glGetMapfv glGetMapiv glGetMaterialfv glGetMaterialiv + glGetMinmax + glGetMinmaxEXT + glGetMinmaxParameterfv + glGetMinmaxParameterfvEXT + glGetMinmaxParameteriv + glGetMinmaxParameterivEXT glGetPixelMapfv glGetPixelMapuiv glGetPixelMapusv + glGetPixelTexGenParameterfvSGIS + glGetPixelTexGenParameterivSGIS glGetPointerv + glGetPointervEXT glGetPolygonStipple + glGetProgramEnvParameterdvARB + glGetProgramEnvParameterfvARB + glGetProgramivARB + glGetProgramivNV + glGetProgramLocalParameterdvARB + glGetProgramLocalParameterfvARB + glGetProgramNamedParameterdvNV + glGetProgramNamedParameterfvNV + glGetProgramParameterdvNV + glGetProgramParameterfvNV + glGetProgramStringARB + glGetProgramStringNV + glGetQueryivARB + glGetQueryObjectivARB + glGetQueryObjectuivARB + glGetSeparableFilter + glGetSeparableFilterEXT + glGetSharpenTexFuncSGIS glGetString glGetTexEnvfv glGetTexEnviv - glGetTexGeniv + glGetTexFilterFuncSGIS glGetTexGendv glGetTexGenfv + glGetTexGeniv glGetTexImage glGetTexLevelParameterfv glGetTexLevelParameteriv glGetTexParameterfv glGetTexParameteriv + glGetTrackMatrixivNV + glGetVertexAttribdvARB + glGetVertexAttribdvNV + glGetVertexAttribfvARB + glGetVertexAttribfvNV + glGetVertexAttribivARB + glGetVertexAttribivNV + glGetVertexAttribPointervARB + glGetVertexAttribPointervNV glHint + glHintPGI + glHistogram + glHistogramEXT glIndexd - glIndexf - glIndexi - glIndexs - glIndexub glIndexdv + glIndexf + glIndexFuncEXT glIndexfv + glIndexi glIndexiv - glIndexsv - glIndexubv glIndexMask + glIndexMaterialEXT glIndexPointer - glInterleavedArrays + glIndexPointerEXT + glIndexs + glIndexsv + glIndexub + glIndexubv glInitNames + glInstrumentsBufferSGIX + glInterleavedArrays + glIsBufferARB + glIsEnabled + glIsFenceNV glIsList + glIsProgramARB + glIsProgramNV + glIsQueryARB glIsTexture + glIsTextureEXT + glLightEnviSGIX glLightf - glLighti glLightfv + glLighti glLightiv glLightModelf - glLightModeli glLightModelfv + glLightModeli glLightModeliv - glLineWidth glLineStipple + glLineWidth glListBase + glListParameterfSGIX + glListParameterfvSGIX + glListParameteriSGIX + glListParameterivSGIX glLoadIdentity glLoadMatrixd glLoadMatrixf glLoadName + glLoadProgramNV + glLoadTransposeMatrixd + glLoadTransposeMatrixdARB + glLoadTransposeMatrixf + glLoadTransposeMatrixfARB + glLockArraysEXT glLogicOp - glMap1d - glMap1f - glMap2d - glMap2f + glMapBufferARB glMapGrid1d glMapGrid1f glMapGrid2d glMapGrid2f + glMap1d + glMap1f + glMap2d + glMap2f glMaterialf - glMateriali glMaterialfv + glMateriali glMaterialiv glMatrixMode + glMinmax + glMinmaxEXT + glMultiDrawArrays + glMultiDrawArraysEXT + glMultiDrawElements + glMultiDrawElementsEXT + glMultiModeDrawArraysIBM + glMultiModeDrawElementsIBM + glMultiTexCoord1d + glMultiTexCoord1dARB + glMultiTexCoord1dv + glMultiTexCoord1dvARB + glMultiTexCoord1f + glMultiTexCoord1fARB + glMultiTexCoord1fv + glMultiTexCoord1fvARB + glMultiTexCoord1i + glMultiTexCoord1iARB + glMultiTexCoord1iv + glMultiTexCoord1ivARB + glMultiTexCoord1s + glMultiTexCoord1sARB + glMultiTexCoord1sv + glMultiTexCoord1svARB + glMultiTexCoord2d + glMultiTexCoord2dARB + glMultiTexCoord2dv + glMultiTexCoord2dvARB + glMultiTexCoord2f + glMultiTexCoord2fARB + glMultiTexCoord2fv + glMultiTexCoord2fvARB + glMultiTexCoord2i + glMultiTexCoord2iARB + glMultiTexCoord2iv + glMultiTexCoord2ivARB + glMultiTexCoord2s + glMultiTexCoord2sARB + glMultiTexCoord2sv + glMultiTexCoord2svARB + glMultiTexCoord3d + glMultiTexCoord3dARB + glMultiTexCoord3dv + glMultiTexCoord3dvARB + glMultiTexCoord3f + glMultiTexCoord3fARB + glMultiTexCoord3fv + glMultiTexCoord3fvARB + glMultiTexCoord3i + glMultiTexCoord3iARB + glMultiTexCoord3iv + glMultiTexCoord3ivARB + glMultiTexCoord3s + glMultiTexCoord3sARB + glMultiTexCoord3sv + glMultiTexCoord3svARB + glMultiTexCoord4d + glMultiTexCoord4dARB + glMultiTexCoord4dv + glMultiTexCoord4dvARB + glMultiTexCoord4f + glMultiTexCoord4fARB + glMultiTexCoord4fv + glMultiTexCoord4fvARB + glMultiTexCoord4i + glMultiTexCoord4iARB + glMultiTexCoord4iv + glMultiTexCoord4ivARB + glMultiTexCoord4s + glMultiTexCoord4sARB + glMultiTexCoord4sv + glMultiTexCoord4svARB glMultMatrixd glMultMatrixf + glMultTransposeMatrixd + glMultTransposeMatrixdARB + glMultTransposeMatrixf + glMultTransposeMatrixfARB glNewList + glNormalPointer + glNormalPointerEXT glNormal3b - glNormal3d - glNormal3f - glNormal3i - glNormal3s glNormal3bv + glNormal3d glNormal3dv + glNormal3f glNormal3fv + glNormal3i glNormal3iv + glNormal3s glNormal3sv - glNormalPointer glOrtho glPassThrough glPixelMapfv @@ -199,10 +503,28 @@ EXPORTS glPixelMapusv glPixelStoref glPixelStorei + glPixelTexGenParameterfSGIS + glPixelTexGenParameterfvSGIS + glPixelTexGenParameteriSGIS + glPixelTexGenParameterivSGIS + glPixelTexGenSGIX glPixelTransferf glPixelTransferi glPixelZoom + glPointParameterf + glPointParameterfARB + glPointParameterfEXT + glPointParameterfSGIS + glPointParameterfv + glPointParameterfvARB + glPointParameterfvEXT + glPointParameterfvSGIS + glPointParameteri + glPointParameteriNV + glPointParameteriv + glPointParameterivNV glPointSize + glPollInstrumentsSGIX glPolygonMode glPolygonOffset glPolygonOffsetEXT @@ -212,256 +534,403 @@ EXPORTS glPopMatrix glPopName glPrioritizeTextures + glPrioritizeTexturesEXT + glProgramEnvParameter4dARB + glProgramEnvParameter4dvARB + glProgramEnvParameter4fARB + glProgramEnvParameter4fvARB + glProgramLocalParameter4dARB + glProgramLocalParameter4dvARB + glProgramLocalParameter4fARB + glProgramLocalParameter4fvARB + glProgramNamedParameter4dNV + glProgramNamedParameter4dvNV + glProgramNamedParameter4fNV + glProgramNamedParameter4fvNV + glProgramParameters4dvNV + glProgramParameters4fvNV + glProgramParameter4dNV + glProgramParameter4dvNV + glProgramParameter4fNV + glProgramParameter4fvNV + glProgramStringARB + glPushAttrib + glPushClientAttrib glPushMatrix + glPushName glRasterPos2d - glRasterPos2f - glRasterPos2i - glRasterPos2s - glRasterPos3d - glRasterPos3f - glRasterPos3i - glRasterPos3s - glRasterPos4d - glRasterPos4f - glRasterPos4i - glRasterPos4s glRasterPos2dv + glRasterPos2f glRasterPos2fv + glRasterPos2i glRasterPos2iv + glRasterPos2s glRasterPos2sv + glRasterPos3d glRasterPos3dv + glRasterPos3f glRasterPos3fv + glRasterPos3i glRasterPos3iv + glRasterPos3s glRasterPos3sv + glRasterPos4d glRasterPos4dv + glRasterPos4f glRasterPos4fv + glRasterPos4i glRasterPos4iv + glRasterPos4s glRasterPos4sv glReadBuffer + glReadInstrumentsSGIX glReadPixels glRectd - glRectf - glRecti - glRects glRectdv + glRectf glRectfv + glRecti glRectiv + glRects glRectsv - glScissor - glIsEnabled - glPushAttrib - glPushClientAttrib - glPushName + glReferencePlaneSGIX glRenderMode + glRequestResidentProgramsNV + glResetHistogram + glResetHistogramEXT + glResetMinmax + glResetMinmaxEXT + glResizeBuffersMESA glRotated glRotatef - glSelectBuffer + glSampleCoverage + glSampleCoverageARB + glSampleMaskEXT + glSampleMaskSGIS + glSamplePatternEXT + glSamplePatternSGIS glScaled glScalef + glScissor + glSecondaryColorPointer + glSecondaryColorPointerEXT + glSecondaryColor3b + glSecondaryColor3bEXT + glSecondaryColor3bv + glSecondaryColor3bvEXT + glSecondaryColor3d + glSecondaryColor3dEXT + glSecondaryColor3dv + glSecondaryColor3dvEXT + glSecondaryColor3f + glSecondaryColor3fEXT + glSecondaryColor3fv + glSecondaryColor3fvEXT + glSecondaryColor3i + glSecondaryColor3iEXT + glSecondaryColor3iv + glSecondaryColor3ivEXT + glSecondaryColor3s + glSecondaryColor3sEXT + glSecondaryColor3sv + glSecondaryColor3svEXT + glSecondaryColor3ub + glSecondaryColor3ubEXT + glSecondaryColor3ubv + glSecondaryColor3ubvEXT + glSecondaryColor3ui + glSecondaryColor3uiEXT + glSecondaryColor3uiv + glSecondaryColor3uivEXT + glSecondaryColor3us + glSecondaryColor3usEXT + glSecondaryColor3usv + glSecondaryColor3usvEXT + glSelectBuffer + glSeparableFilter2D + glSeparableFilter2DEXT + glSetFenceNV glShadeModel + glSharpenTexFuncSGIS + glSpriteParameterfSGIX + glSpriteParameterfvSGIX + glSpriteParameteriSGIX + glSpriteParameterivSGIX + glStartInstrumentsSGIX glStencilFunc glStencilMask glStencilOp + glStopInstrumentsSGIX + glTagSampleBufferSGIX + glTbufferMask3DFX + glTestFenceNV + glTexCoordPointer + glTexCoordPointerEXT glTexCoord1d - glTexCoord1f - glTexCoord1i - glTexCoord1s - glTexCoord2d - glTexCoord2f - glTexCoord2i - glTexCoord2s - glTexCoord3d - glTexCoord3f - glTexCoord3i - glTexCoord3s - glTexCoord4d - glTexCoord4f - glTexCoord4i - glTexCoord4s 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 + glTexEnvf + glTexEnvfv + glTexEnvi + glTexEnviv + glTexFilterFuncSGIS glTexGend + glTexGendv glTexGenf + glTexGenfv glTexGeni - glTexGendv glTexGeniv - glTexGenfv - glTexEnvf - glTexEnvi - glTexEnvfv - glTexEnviv glTexImage1D glTexImage2D + glTexImage3D + glTexImage3DEXT + glTexImage4DSGIS glTexParameterf - glTexParameteri glTexParameterfv + glTexParameteri glTexParameteriv glTexSubImage1D + glTexSubImage1DEXT glTexSubImage2D + glTexSubImage2DEXT + glTexSubImage3D + glTexSubImage3DEXT + glTexSubImage4DSGIS + glTrackMatrixNV glTranslated glTranslatef + glUnlockArraysEXT + glUnmapBufferARB + glVertexArrayRangeNV + glVertexAttribPointerARB + glVertexAttribPointerNV + glVertexAttribs1dvNV + glVertexAttribs1fvNV + glVertexAttribs1svNV + glVertexAttribs2dvNV + glVertexAttribs2fvNV + glVertexAttribs2svNV + glVertexAttribs3dvNV + glVertexAttribs3fvNV + glVertexAttribs3svNV + glVertexAttribs4dvNV + glVertexAttribs4fvNV + glVertexAttribs4svNV + glVertexAttribs4ubvNV + glVertexAttrib1dARB + glVertexAttrib1dNV + glVertexAttrib1dvARB + glVertexAttrib1dvNV + glVertexAttrib1fARB + glVertexAttrib1fNV + glVertexAttrib1fvARB + glVertexAttrib1fvNV + glVertexAttrib1sARB + glVertexAttrib1sNV + glVertexAttrib1svARB + glVertexAttrib1svNV + glVertexAttrib2dARB + glVertexAttrib2dNV + glVertexAttrib2dvARB + glVertexAttrib2dvNV + glVertexAttrib2fARB + glVertexAttrib2fNV + glVertexAttrib2fvARB + glVertexAttrib2fvNV + glVertexAttrib2sARB + glVertexAttrib2sNV + glVertexAttrib2svARB + glVertexAttrib2svNV + glVertexAttrib3dARB + glVertexAttrib3dNV + glVertexAttrib3dvARB + glVertexAttrib3dvNV + glVertexAttrib3fARB + glVertexAttrib3fNV + glVertexAttrib3fvARB + glVertexAttrib3fvNV + glVertexAttrib3sARB + glVertexAttrib3sNV + glVertexAttrib3svARB + glVertexAttrib3svNV + glVertexAttrib4bvARB + glVertexAttrib4dARB + glVertexAttrib4dNV + glVertexAttrib4dvARB + glVertexAttrib4dvNV + glVertexAttrib4fARB + glVertexAttrib4fNV + glVertexAttrib4fvARB + glVertexAttrib4fvNV + glVertexAttrib4ivARB + glVertexAttrib4NbvARB + glVertexAttrib4NivARB + glVertexAttrib4NsvARB + glVertexAttrib4NubARB + glVertexAttrib4NubvARB + glVertexAttrib4NuivARB + glVertexAttrib4NusvARB + glVertexAttrib4sARB + glVertexAttrib4sNV + glVertexAttrib4svARB + glVertexAttrib4svNV + glVertexAttrib4ubNV + glVertexAttrib4ubvARB + glVertexAttrib4ubvNV + glVertexAttrib4uivARB + glVertexAttrib4usvARB + glVertexPointer + glVertexPointerEXT + glVertexWeightfEXT + glVertexWeightfvEXT + glVertexWeightPointerEXT glVertex2d - glVertex2f - glVertex2i - glVertex2s - glVertex3d - glVertex3f - glVertex3i - glVertex3s - glVertex4d - glVertex4f - glVertex4i - glVertex4s glVertex2dv + glVertex2f glVertex2fv + glVertex2i glVertex2iv + glVertex2s glVertex2sv + glVertex3d glVertex3dv + glVertex3f glVertex3fv + glVertex3i glVertex3iv + glVertex3s glVertex3sv + glVertex4d glVertex4dv + glVertex4f glVertex4fv + glVertex4i glVertex4iv + glVertex4s 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 + glWindowPos2d + glWindowPos2dARB glWindowPos2dMESA + glWindowPos2dv + glWindowPos2dvARB + glWindowPos2dvMESA + glWindowPos2f + glWindowPos2fARB + glWindowPos2fMESA + glWindowPos2fv + glWindowPos2fvARB + glWindowPos2fvMESA + glWindowPos2i + glWindowPos2iARB + glWindowPos2iMESA + glWindowPos2iv + glWindowPos2ivARB glWindowPos2ivMESA + glWindowPos2s + glWindowPos2sARB + glWindowPos2sMESA + glWindowPos2sv + glWindowPos2svARB glWindowPos2svMESA - glWindowPos2fvMESA - glWindowPos2dvMESA - glWindowPos3iMESA - glWindowPos3sMESA - glWindowPos3fMESA + glWindowPos3d + glWindowPos3dARB glWindowPos3dMESA + glWindowPos3dv + glWindowPos3dvARB + glWindowPos3dvMESA + glWindowPos3f + glWindowPos3fARB + glWindowPos3fMESA + glWindowPos3fv + glWindowPos3fvARB + glWindowPos3fvMESA + glWindowPos3i + glWindowPos3iARB + glWindowPos3iMESA + glWindowPos3iv + glWindowPos3ivARB glWindowPos3ivMESA + glWindowPos3s + glWindowPos3sARB + glWindowPos3sMESA + glWindowPos3sv + glWindowPos3svARB glWindowPos3svMESA - glWindowPos3fvMESA - glWindowPos3dvMESA - glWindowPos4iMESA - glWindowPos4sMESA glWindowPos4dMESA + glWindowPos4dvMESA + glWindowPos4fMESA + glWindowPos4fvMESA + glWindowPos4iMESA glWindowPos4ivMESA + glWindowPos4sMESA glWindowPos4svMESA - glWindowPos4fvMESA - glWindowPos4dvMESA - glResizeBuffersMESA + fxCloseHardware +;fxGetScreenGeometry + fxMesaCreateBestContext + fxMesaCreateContext + fxMesaDestroyContext + fxMesaGetCurrentContext + fxMesaMakeCurrent + fxMesaSelectCurrentBoard +;fxMesaSetNearFar + fxMesaSwapBuffers + fxMesaUpdateScreenSize + fxQueryHardware + wglChoosePixelFormat wglCopyContext wglCreateContext wglCreateLayerContext wglDeleteContext ;wglDescribeLayerPlane + wglDescribePixelFormat wglGetCurrentContext wglGetCurrentDC ;wglGetLayerPaletteEntries + wglGetPixelFormat wglGetProcAddress wglMakeCurrent ;wglRealizeLayerPalette ;wglSetLayerPaletteEntries + wglSetPixelFormat wglShareLists + wglSwapBuffers 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/src/mesa/drivers/glide/fxsetup.c b/src/mesa/drivers/glide/fxsetup.c index 523bf2b3fdd..9ebc603ae7a 100644 --- a/src/mesa/drivers/glide/fxsetup.c +++ b/src/mesa/drivers/glide/fxsetup.c @@ -1,4 +1,4 @@ -/* $Id: fxsetup.c,v 1.39 2003/08/19 15:52:53 brianp Exp $ */ +/* $Id: fxsetup.c,v 1.40 2003/10/02 17:36:44 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -52,18 +52,17 @@ fxTexValidate(GLcontext * ctx, struct gl_texture_object *tObj) tfxTexInfo *ti = fxTMGetTexInfo(tObj); GLint minl, maxl; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxTexValidate(...) Start\n"); - } - if (ti->validated) { - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, - "fxmesa: fxTexValidate(...) End (validated=GL_TRUE)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s: validated=GL_TRUE\n", __FUNCTION__); } return; } + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(%p (%d))\n", __FUNCTION__, (void *)tObj, tObj->Name); + } + ti->tObj = tObj; minl = ti->minLevel = tObj->BaseLevel; maxl = ti->maxLevel = MIN2(tObj->MaxLevel, tObj->Image[0]->MaxLog2); @@ -71,38 +70,48 @@ fxTexValidate(GLcontext * ctx, struct gl_texture_object *tObj) fxTexGetInfo(tObj->Image[minl]->Width, tObj->Image[minl]->Height, &(FX_largeLodLog2(ti->info)), &(FX_aspectRatioLog2(ti->info)), &(ti->sScale), &(ti->tScale), - &(ti->int_sScale), &(ti->int_tScale), NULL, NULL); + NULL, NULL); if ((tObj->MinFilter != GL_NEAREST) && (tObj->MinFilter != GL_LINEAR)) fxTexGetInfo(tObj->Image[maxl]->Width, tObj->Image[maxl]->Height, &(FX_smallLodLog2(ti->info)), NULL, - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL); else FX_smallLodLog2(ti->info) = FX_largeLodLog2(ti->info); +/*jejeje*/ +ti->baseLevelInternalFormat = tObj->Image[minl]->Format; +#if 0 fxTexGetFormat(ctx, tObj->Image[minl]->TexFormat->BaseFormat, &(ti->info.format), &(ti->baseLevelInternalFormat)); /* [koolsmoky] */ +#endif switch (tObj->WrapS) { + case GL_MIRRORED_REPEAT: + ti->sClamp = GR_TEXTURECLAMP_MIRROR_EXT; + break; case GL_CLAMP_TO_EDGE: /* What's this really mean compared to GL_CLAMP? */ case GL_CLAMP: - ti->sClamp = 1; + ti->sClamp = GR_TEXTURECLAMP_CLAMP; break; case GL_REPEAT: - ti->sClamp = 0; + ti->sClamp = GR_TEXTURECLAMP_WRAP; break; default: ; /* silence compiler warning */ } switch (tObj->WrapT) { + case GL_MIRRORED_REPEAT: + ti->tClamp = GR_TEXTURECLAMP_MIRROR_EXT; + break; case GL_CLAMP_TO_EDGE: /* What's this really mean compared to GL_CLAMP? */ case GL_CLAMP: - ti->tClamp = 1; + ti->tClamp = GR_TEXTURECLAMP_CLAMP; break; case GL_REPEAT: - ti->tClamp = 0; + ti->tClamp = GR_TEXTURECLAMP_WRAP; break; default: ; /* silence compiler warning */ @@ -111,10 +120,6 @@ fxTexValidate(GLcontext * ctx, struct gl_texture_object *tObj) ti->validated = GL_TRUE; ti->info.data = NULL; - - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxTexValidate(...) End\n"); - } } static void @@ -274,8 +279,8 @@ fxGetTexSetConfiguration(GLcontext * ctx, unitsmode |= (ifmt | envmode); - if (MESA_VERBOSE & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) - fxPrintUnitsMode("unitsmode", unitsmode); + if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) + fxPrintUnitsMode(__FUNCTION__, unitsmode); return unitsmode; } @@ -292,6 +297,10 @@ fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj) tfxTexInfo *ti = fxTMGetTexInfo(tObj); int tmu; + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(%p (%d))\n", __FUNCTION__, (void *)tObj, tObj->Name); + } + /* Make sure we're not loaded incorrectly */ if (ti->isInTM) { if (ti->LODblend) { @@ -309,7 +318,10 @@ fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj) if (ti->LODblend) fxTMMoveInTM_NoLock(fxMesa, tObj, FX_TMU_SPLIT); else { - if (fxMesa->haveTwoTMUs) { + /* XXX putting textures into the second memory bank when the + * first bank is full is not working at this time. + */ + if (/*[dBorca]: fixme*/0 && fxMesa->haveTwoTMUs) { if (fxMesa->freeTexMem[FX_TMU0] > grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info))) { @@ -327,8 +339,8 @@ fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj) if (ti->LODblend && ti->whichTMU == FX_TMU_SPLIT) { if ((ti->info.format == GR_TEXFMT_P_8) && (!fxMesa->haveGlobalPaletteTexture)) { - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: uploading texture palette\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s: uploading texture palette\n", __FUNCTION__); } grTexDownloadTable(GR_TEXTABLE_PALETTE, &(ti->palette)); } @@ -353,8 +365,8 @@ fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj) if ((ti->info.format == GR_TEXFMT_P_8) && (!fxMesa->haveGlobalPaletteTexture)) { - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: uploading texture palette\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s: uploading texture palette\n", __FUNCTION__); } grTexDownloadTable(GR_TEXTABLE_PALETTE, &(ti->palette)); } @@ -363,8 +375,9 @@ fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj) * we get to this point, I think it means we are thrashing the * texture memory, so perhaps it's not a good idea. */ - if (ti->LODblend && (MESA_VERBOSE & VERBOSE_DRIVER)) - fprintf(stderr, "fxmesa: not blending texture - only on one tmu\n"); + if (ti->LODblend && (TDFX_DEBUG & VERBOSE_DRIVER)) { + fprintf(stderr, "%s: not blending texture - only one tmu\n", __FUNCTION__); + } grTexClampMode(tmu, ti->sClamp, ti->tClamp); grTexFilterMode(tmu, ti->minFilt, ti->maxFilt); @@ -377,8 +390,8 @@ fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj) static void fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu, FxBool LODblend) { - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxSelectSingleTMUSrc(%d,%d)\n", tmu, LODblend); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(%d, %d)\n", __FUNCTION__, tmu, LODblend); } if (LODblend) { @@ -436,7 +449,7 @@ fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu, FxBool LODblend) static void fxSetupTextureSingleTMU_NoLock(GLcontext * ctx, GLuint textureset) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GrCombineLocal_t localc, locala; GLuint unitsmode; GLint ifmt; @@ -444,8 +457,8 @@ fxSetupTextureSingleTMU_NoLock(GLcontext * ctx, GLuint textureset) struct gl_texture_object *tObj = ctx->Texture.Unit[textureset].Current2D; int tmu; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxSetupTextureSingleTMU(...) Start\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } ti = fxTMGetTexInfo(tObj); @@ -486,8 +499,8 @@ fxSetupTextureSingleTMU_NoLock(GLcontext * ctx, GLuint textureset) else localc = GR_COMBINE_LOCAL_CONSTANT; - if (MESA_VERBOSE & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) - fprintf(stderr, "fxMesa: fxSetupTextureSingleTMU, envmode is %s\n", + if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) + fprintf(stderr, "%s: envmode is %s\n", __FUNCTION__, _mesa_lookup_enum_by_nr(ctx->Texture.Unit[textureset].EnvMode)); switch (ctx->Texture.Unit[textureset].EnvMode) { @@ -515,8 +528,8 @@ fxSetupTextureSingleTMU_NoLock(GLcontext * ctx, GLuint textureset) localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE); break; case GL_BLEND: - if (MESA_VERBOSE & VERBOSE_DRIVER) - fprintf(stderr, "fx Driver: GL_BLEND not yet supported\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) + fprintf(stderr, "%s: GL_BLEND not yet supported\n", __FUNCTION__); break; case GL_REPLACE: if ((ifmt == GL_RGB) || (ifmt == GL_LUMINANCE)) @@ -538,15 +551,11 @@ fxSetupTextureSingleTMU_NoLock(GLcontext * ctx, GLuint textureset) localc, GR_COMBINE_OTHER_TEXTURE, FXFALSE); break; default: - if (MESA_VERBOSE & VERBOSE_DRIVER) - fprintf(stderr, "fx Driver: %x Texture.EnvMode not yet supported\n", + if (TDFX_DEBUG & VERBOSE_DRIVER) + fprintf(stderr, "%s: %x Texture.EnvMode not yet supported\n", __FUNCTION__, ctx->Texture.Unit[textureset].EnvMode); break; } - - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxSetupTextureSingleTMU(...) End\n"); - } } #if 00 @@ -579,8 +588,8 @@ fxSetupDoubleTMU_NoLock(fxMesaContext fxMesa, GLuint tstate = 0; int tmu0 = 0, tmu1 = 1; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxSetupDoubleTMU(...)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } /* We shouldn't need to do this. There is something wrong with @@ -675,8 +684,8 @@ fxSetupDoubleTMU_NoLock(fxMesaContext fxMesa, * The next test shouldn't be TMU specific... */ if (ti0->info.format == GR_TEXFMT_P_8) { - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: uploading texture palette TMU0\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s: uploading texture palette TMU0\n", __FUNCTION__); } grTexDownloadTable(GR_TEXTABLE_PALETTE, &(ti0->palette)); } @@ -705,7 +714,7 @@ fxSetupDoubleTMU_NoLock(fxMesaContext fxMesa, static void fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GrCombineLocal_t localc, locala; tfxTexInfo *ti0, *ti1; struct gl_texture_object *tObj0 = ctx->Texture.Unit[0].Current2D; @@ -713,8 +722,8 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx) GLuint envmode, ifmt, unitsmode; int tmu0 = 0, tmu1 = 1; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxSetupTextureDoubleTMU(...) Start\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } ti0 = fxTMGetTexInfo(tObj0); @@ -749,8 +758,8 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx) localc = GR_COMBINE_LOCAL_CONSTANT; - if (MESA_VERBOSE & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) - fprintf(stderr, "fxMesa: fxSetupTextureDoubleTMU, envmode is %s/%s\n", + if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) + fprintf(stderr, "%s: envmode is %s/%s\n", __FUNCTION__, _mesa_lookup_enum_by_nr(ctx->Texture.Unit[0].EnvMode), _mesa_lookup_enum_by_nr(ctx->Texture.Unit[1].EnvMode)); @@ -765,15 +774,8 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx) { GLboolean isalpha[FX_NUM_TMU]; - if (ti0->baseLevelInternalFormat == GL_ALPHA) - isalpha[tmu0] = GL_TRUE; - else - isalpha[tmu0] = GL_FALSE; - - if (ti1->baseLevelInternalFormat == GL_ALPHA) - isalpha[tmu1] = GL_TRUE; - else - isalpha[tmu1] = GL_FALSE; + isalpha[tmu0] = (ti0->baseLevelInternalFormat == GL_ALPHA); + isalpha[tmu1] = (ti1->baseLevelInternalFormat == GL_ALPHA); if (isalpha[FX_TMU1]) grTexCombine(GR_TMU1, @@ -896,15 +898,8 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx) { GLboolean isalpha[FX_NUM_TMU]; - if (ti0->baseLevelInternalFormat == GL_ALPHA) - isalpha[tmu0] = GL_TRUE; - else - isalpha[tmu0] = GL_FALSE; - - if (ti1->baseLevelInternalFormat == GL_ALPHA) - isalpha[tmu1] = GL_TRUE; - else - isalpha[tmu1] = GL_FALSE; + isalpha[tmu0] = (ti0->baseLevelInternalFormat == GL_ALPHA); + isalpha[tmu1] = (ti1->baseLevelInternalFormat == GL_ALPHA); if (isalpha[FX_TMU1]) grTexCombine(GR_TMU1, @@ -942,13 +937,9 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx) break; } default: - fprintf(stderr, "Unexpected dual texture mode encountered\n"); + fprintf(stderr, "%s: Unexpected dual texture mode encountered\n", __FUNCTION__); break; } - - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxSetupTextureDoubleTMU(...) End\n"); - } } /************************* No Texture ***************************/ @@ -956,11 +947,11 @@ fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx) static void fxSetupTextureNone_NoLock(GLcontext * ctx) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GrCombineLocal_t localc, locala; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxSetupTextureNone(...)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } if ((ctx->Light.ShadeModel == GL_SMOOTH) || 1 || @@ -993,10 +984,10 @@ fxSetupTextureNone_NoLock(GLcontext * ctx) static void fxSetupTexture_NoLock(GLcontext * ctx) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxSetupTexture(...)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(...)\n", __FUNCTION__); } /* Texture Combine, Color Combine and Alpha Combine. */ @@ -1032,7 +1023,7 @@ fxSetupTexture(GLcontext * ctx) void fxDDBlendFunc(GLcontext * ctx, GLenum sfactor, GLenum dfactor) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); tfxUnitsState *us = &fxMesa->unitsState; GrAlphaBlendFnc_t sfact, dfact, asfact, adfact; @@ -1149,7 +1140,7 @@ fxDDBlendFunc(GLcontext * ctx, GLenum sfactor, GLenum dfactor) static void fxSetupBlend(GLcontext * ctx) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); tfxUnitsState *us = &fxMesa->unitsState; if (us->blendEnabled) @@ -1167,48 +1158,15 @@ fxSetupBlend(GLcontext * ctx) void fxDDAlphaFunc(GLcontext * ctx, GLenum func, GLfloat ref) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); tfxUnitsState *us = &fxMesa->unitsState; - GrCmpFnc_t newfunc; - switch (func) { - case GL_NEVER: - newfunc = GR_CMP_NEVER; - break; - case GL_LESS: - newfunc = GR_CMP_LESS; - break; - case GL_EQUAL: - newfunc = GR_CMP_EQUAL; - break; - case GL_LEQUAL: - newfunc = GR_CMP_LEQUAL; - break; - case GL_GREATER: - newfunc = GR_CMP_GREATER; - break; - case GL_NOTEQUAL: - newfunc = GR_CMP_NOTEQUAL; - break; - case GL_GEQUAL: - newfunc = GR_CMP_GEQUAL; - break; - case GL_ALWAYS: - newfunc = GR_CMP_ALWAYS; - break; - default: - fprintf(stderr, "fx Driver: internal error in fxDDAlphaFunc()\n"); - fxCloseHardware(); - exit(-1); - break; - } - - if (newfunc != us->alphaTestFunc) { - us->alphaTestFunc = newfunc; - fxMesa->new_state |= FX_NEW_ALPHA; - } - - if (ref != us->alphaTestRefValue) { + if ( + (us->alphaTestFunc != func) + || + (us->alphaTestRefValue != ref) + ) { + us->alphaTestFunc = func; us->alphaTestRefValue = ref; fxMesa->new_state |= FX_NEW_ALPHA; } @@ -1217,12 +1175,12 @@ fxDDAlphaFunc(GLcontext * ctx, GLenum func, GLfloat ref) static void fxSetupAlphaTest(GLcontext * ctx) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); tfxUnitsState *us = &fxMesa->unitsState; if (us->alphaTestEnabled) { GrAlpha_t ref = (GLint) (us->alphaTestRefValue * 255.0); - grAlphaTestFunction(us->alphaTestFunc); + grAlphaTestFunction(us->alphaTestFunc - GL_NEVER + GR_CMP_NEVER); grAlphaTestReferenceValue(ref); } else @@ -1236,53 +1194,19 @@ fxSetupAlphaTest(GLcontext * ctx) void fxDDDepthFunc(GLcontext * ctx, GLenum func) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); tfxUnitsState *us = &fxMesa->unitsState; - GrCmpFnc_t dfunc; - - switch (func) { - case GL_NEVER: - dfunc = GR_CMP_NEVER; - break; - case GL_LESS: - dfunc = GR_CMP_LESS; - break; - case GL_GEQUAL: - dfunc = GR_CMP_GEQUAL; - break; - case GL_LEQUAL: - dfunc = GR_CMP_LEQUAL; - break; - case GL_GREATER: - dfunc = GR_CMP_GREATER; - break; - case GL_NOTEQUAL: - dfunc = GR_CMP_NOTEQUAL; - break; - case GL_EQUAL: - dfunc = GR_CMP_EQUAL; - break; - case GL_ALWAYS: - dfunc = GR_CMP_ALWAYS; - break; - default: - fprintf(stderr, "fx Driver: internal error in fxDDDepthFunc()\n"); - fxCloseHardware(); - exit(-1); - break; - } - if (dfunc != us->depthTestFunc) { - us->depthTestFunc = dfunc; + if (us->depthTestFunc != func) { + us->depthTestFunc = func; fxMesa->new_state |= FX_NEW_DEPTH; } - } void fxDDDepthMask(GLcontext * ctx, GLboolean flag) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); tfxUnitsState *us = &fxMesa->unitsState; if (flag != us->depthMask) { @@ -1294,11 +1218,11 @@ fxDDDepthMask(GLcontext * ctx, GLboolean flag) static void fxSetupDepthTest(GLcontext * ctx) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); tfxUnitsState *us = &fxMesa->unitsState; if (us->depthTestEnabled) { - grDepthBufferFunction(us->depthTestFunc); + grDepthBufferFunction(us->depthTestFunc - GL_NEVER + GR_CMP_NEVER); grDepthMask(us->depthMask); } else { @@ -1307,15 +1231,135 @@ fxSetupDepthTest(GLcontext * ctx) } } +/************************************************************************/ +/************************** Stencil SetUp *******************************/ +/************************************************************************/ + +static GrStencil_t convertGLStencilOp( GLenum op ) +{ + switch ( op ) { + case GL_KEEP: + return GR_STENCILOP_KEEP; + case GL_ZERO: + return GR_STENCILOP_ZERO; + case GL_REPLACE: + return GR_STENCILOP_REPLACE; + case GL_INCR: + return GR_STENCILOP_INCR_CLAMP; + case GL_DECR: + return GR_STENCILOP_DECR_CLAMP; + case GL_INVERT: + return GR_STENCILOP_INVERT; + case GL_INCR_WRAP_EXT: + return GR_STENCILOP_INCR_WRAP; + case GL_DECR_WRAP_EXT: + return GR_STENCILOP_DECR_WRAP; + default: + _mesa_problem( NULL, "bad stencil op in convertGLStencilOp" ); + } + return GR_STENCILOP_KEEP; /* never get, silence compiler warning */ +} + +void +fxDDStencilFunc (GLcontext *ctx, GLenum func, GLint ref, GLuint mask) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + tfxUnitsState *us = &fxMesa->unitsState; + + if ( + (us->stencilFunction != func) + || + (us->stencilRefValue != ref) + || + (us->stencilValueMask != mask) + ) { + us->stencilFunction = func; + us->stencilRefValue = ref; + us->stencilValueMask = mask; + fxMesa->new_state |= FX_NEW_STENCIL; + } +} + +void +fxDDStencilMask (GLcontext *ctx, GLuint mask) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + tfxUnitsState *us = &fxMesa->unitsState; + + if (us->stencilWriteMask != mask) { + us->stencilWriteMask = mask; + fxMesa->new_state |= FX_NEW_STENCIL; + } +} + +void +fxDDStencilOp (GLcontext *ctx, GLenum sfail, GLenum zfail, GLenum zpass) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + tfxUnitsState *us = &fxMesa->unitsState; + + if ( + (us->stencilFailFunc != sfail) + || + (us->stencilZFailFunc != zfail) + || + (us->stencilZPassFunc != zpass) + ) { + us->stencilFailFunc = sfail; + us->stencilZFailFunc = zfail; + us->stencilZPassFunc = zpass; + fxMesa->new_state |= FX_NEW_STENCIL; + } +} + +static void +fxSetupStencil (GLcontext * ctx) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + tfxUnitsState *us = &fxMesa->unitsState; + + if (us->stencilEnabled) { + grEnable(GR_STENCIL_MODE_EXT); + fxMesa->Glide.grStencilOpExt(convertGLStencilOp(us->stencilFailFunc), + convertGLStencilOp(us->stencilZFailFunc), + convertGLStencilOp(us->stencilZPassFunc)); + fxMesa->Glide.grStencilFuncExt(us->stencilFunction - GL_NEVER + GR_CMP_NEVER, + us->stencilRefValue, + us->stencilValueMask); + fxMesa->Glide.grStencilMaskExt(us->stencilWriteMask); + } else { + grDisable(GR_STENCIL_MODE_EXT); + } +} + /************************************************************************/ /**************************** Color Mask SetUp **************************/ /************************************************************************/ +void fxColorMask (fxMesaContext fxMesa, GLboolean enable) +{ +/* These are used in calls to FX_grColorMask() */ +static const FxBool false4[4] = { FXFALSE, FXFALSE, FXFALSE, FXFALSE }; +static const FxBool true4[4] = { FXTRUE, FXTRUE, FXTRUE, FXTRUE }; + + const FxBool *rgba = enable ? true4 : false4; + + if (fxMesa->colDepth != 16) { + /* 32bpp mode or 15bpp mode */ + fxMesa->Glide.grColorMaskExt(rgba[RCOMP], rgba[GCOMP], + rgba[BCOMP], rgba[ACOMP] && fxMesa->haveHwAlpha); + } + else { + /* 16 bpp mode */ + grColorMask(rgba[RCOMP] || rgba[GCOMP] || rgba[BCOMP], rgba[ACOMP] && fxMesa->haveHwAlpha); + } +} + void fxDDColorMask(GLcontext * ctx, GLboolean r, GLboolean g, GLboolean b, GLboolean a) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); fxMesa->new_state |= FX_NEW_COLOR_MASK; (void) r; (void) g; @@ -1329,13 +1373,10 @@ fxSetupColorMask(GLcontext * ctx) fxMesaContext fxMesa = FX_CONTEXT(ctx); if (ctx->Color.DrawBuffer == GL_NONE) { - grColorMask(FXFALSE, FXFALSE); + fxColorMask(fxMesa, GL_FALSE); } else { - grColorMask(ctx->Color.ColorMask[RCOMP] || - ctx->Color.ColorMask[GCOMP] || - ctx->Color.ColorMask[BCOMP], - ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer); + fxColorMask(fxMesa, GL_TRUE); } } @@ -1389,7 +1430,7 @@ fxSetupFog(GLcontext * ctx) } grFogTable(fxMesa->fogTable); - grFogMode(GR_FOG_WITH_TABLE); + grFogMode(GR_FOG_WITH_TABLE_ON_Q); } else { grFogMode(GR_FOG_DISABLE); @@ -1410,7 +1451,7 @@ fxDDFogfv(GLcontext * ctx, GLenum pname, const GLfloat * params) void fxSetScissorValues(GLcontext * ctx) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); int xmin, xmax; int ymin, ymax, check; @@ -1439,7 +1480,7 @@ fxSetScissorValues(GLcontext * ctx) grClipWindow(xmin, ymin, xmax, ymax); } -static void +void fxSetupScissor(GLcontext * ctx) { BEGIN_BOARD_LOCK(); @@ -1473,35 +1514,42 @@ fxDDFrontFace(GLcontext * ctx, GLenum mode) } -static void +void fxSetupCull(GLcontext * ctx) { + fxMesaContext fxMesa = FX_CONTEXT(ctx); + GrCullMode_t mode = GR_CULL_DISABLE; + if (ctx->Polygon.CullFlag) { switch (ctx->Polygon.CullFaceMode) { case GL_BACK: if (ctx->Polygon.FrontFace == GL_CCW) - FX_CONTEXT(ctx)->cullMode = GR_CULL_NEGATIVE; + mode = GR_CULL_NEGATIVE; else - FX_CONTEXT(ctx)->cullMode = GR_CULL_POSITIVE; + mode = GR_CULL_POSITIVE; break; case GL_FRONT: if (ctx->Polygon.FrontFace == GL_CCW) - FX_CONTEXT(ctx)->cullMode = GR_CULL_POSITIVE; + mode = GR_CULL_POSITIVE; else - FX_CONTEXT(ctx)->cullMode = GR_CULL_NEGATIVE; + mode = GR_CULL_NEGATIVE; break; case GL_FRONT_AND_BACK: - FX_CONTEXT(ctx)->cullMode = GR_CULL_DISABLE; - break; + /* Handled as a fallback on triangles in tdfx_tris.c */ + return; default: + ASSERT(0); break; } } - else - FX_CONTEXT(ctx)->cullMode = GR_CULL_DISABLE; - if (FX_CONTEXT(ctx)->raster_primitive == GL_TRIANGLES) - grCullMode(FX_CONTEXT(ctx)->cullMode); + /* KW: don't need to check raster_primitive here as we don't + * attempt to draw lines or points with triangles. + */ + if (fxMesa->cullMode != mode) { + fxMesa->cullMode = mode; + grCullMode(mode); + } } @@ -1512,11 +1560,12 @@ fxSetupCull(GLcontext * ctx) void fxDDEnable(GLcontext * ctx, GLenum cap, GLboolean state) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); tfxUnitsState *us = &fxMesa->unitsState; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDEnable(...)\n"); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(%s)\n", state ? __FUNCTION__ : "fxDDDisable", + _mesa_lookup_enum_by_nr(cap)); } switch (cap) { @@ -1538,6 +1587,12 @@ fxDDEnable(GLcontext * ctx, GLenum cap, GLboolean state) fxMesa->new_state |= FX_NEW_DEPTH; } break; + case GL_STENCIL_TEST: + if (fxMesa->haveHwStencil && state != us->stencilEnabled) { + us->stencilEnabled = state; + fxMesa->new_state |= FX_NEW_STENCIL; + } + break; case GL_DITHER: if (state) { grDitherMode(GR_DITHER_4x4); @@ -1595,7 +1650,7 @@ static void fx_print_state_flags(const char *msg, GLuint flags) { fprintf(stderr, - "%s: (0x%x) %s%s%s%s%s%s%s\n", + "%s: (0x%x) %s%s%s%s%s%s%s%s\n", msg, flags, (flags & FX_NEW_TEXTURING) ? "texture, " : "", @@ -1604,17 +1659,18 @@ fx_print_state_flags(const char *msg, GLuint flags) (flags & FX_NEW_FOG) ? "fog, " : "", (flags & FX_NEW_SCISSOR) ? "scissor, " : "", (flags & FX_NEW_COLOR_MASK) ? "colormask, " : "", - (flags & FX_NEW_CULL) ? "cull, " : ""); + (flags & FX_NEW_CULL) ? "cull, " : "", + (flags & FX_NEW_STENCIL) ? "stencil, " : ""); } void fxSetupFXUnits(GLcontext * ctx) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); GLuint newstate = fxMesa->new_state; - if (MESA_VERBOSE & VERBOSE_DRIVER) - fx_print_state_flags("fxmesa: fxSetupFXUnits", newstate); + if (TDFX_DEBUG & VERBOSE_DRIVER) + fx_print_state_flags(__FUNCTION__, newstate); if (newstate) { if (newstate & FX_NEW_TEXTURING) @@ -1629,6 +1685,9 @@ fxSetupFXUnits(GLcontext * ctx) if (newstate & FX_NEW_DEPTH) fxSetupDepthTest(ctx); + if (newstate & FX_NEW_STENCIL) + fxSetupStencil(ctx); + if (newstate & FX_NEW_FOG) fxSetupFog(ctx); diff --git a/src/mesa/drivers/glide/fxtexman.c b/src/mesa/drivers/glide/fxtexman.c index 5189816cdef..648649c0328 100644 --- a/src/mesa/drivers/glide/fxtexman.c +++ b/src/mesa/drivers/glide/fxtexman.c @@ -1,4 +1,4 @@ -/* $Id: fxtexman.c,v 1.16 2003/08/19 15:52:53 brianp Exp $ */ +/* $Id: fxtexman.c,v 1.17 2003/10/02 17:36:44 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -116,10 +116,11 @@ fxTMNewRangeNode(fxMesaContext fxMesa, FxU32 start, FxU32 end) } else { if (!(result = MALLOC(sizeof(MemRange)))) { - fprintf(stderr, "fxDriver: out of memory!\n"); + fprintf(stderr, "%s: ERROR: out of memory!\n", __FUNCTION__); fxCloseHardware(); exit(-1); } + result->next = NULL; } result->startAddr = start; result->endAddr = end; @@ -137,11 +138,13 @@ static void fxTMUInit(fxMesaContext fxMesa, int tmu) { MemRange *tmn, *last; - FxU32 start, end, blockstart, blockend; + FxU32 start, end, blockstart, blockend, boundary; start = grTexMinAddress(tmu); end = grTexMaxAddress(tmu); + boundary = (fxMesa->type >= GR_SSTTYPE_Banshee) ? (end - start) : FX_2MB_SPLIT; + if (fxMesa->verbose) { fprintf(stderr, "Voodoo %s configuration:\n", (tmu == FX_TMU0) ? "TMU0" : "TMU1"); @@ -149,7 +152,7 @@ fxTMUInit(fxMesaContext fxMesa, int tmu) (unsigned int) start); fprintf(stderr, "Voodoo Higher texture memory address (%u)\n", (unsigned int) end); - fprintf(stderr, "Voodoo Splitting Texture memory in 2b blocks:\n"); + fprintf(stderr, "Voodoo Splitting Texture memory in %luMB blocks:\n", boundary >> 20); } fxMesa->freeTexMem[tmu] = end - start; @@ -158,17 +161,16 @@ fxTMUInit(fxMesaContext fxMesa, int tmu) last = 0; blockstart = start; while (blockstart < end) { - if (blockstart + FX_2MB_SPLIT > end) + if (blockstart + boundary > end) blockend = end; else - blockend = blockstart + FX_2MB_SPLIT; + blockend = blockstart + boundary; if (fxMesa->verbose) fprintf(stderr, "Voodoo %07u-%07u\n", (unsigned int) blockstart, (unsigned int) blockend); tmn = fxTMNewRangeNode(fxMesa, blockstart, blockend); - tmn->next = 0; if (last) last->next = tmn; @@ -176,7 +178,7 @@ fxTMUInit(fxMesaContext fxMesa, int tmu) fxMesa->tmFree[tmu] = tmn; last = tmn; - blockstart += FX_2MB_SPLIT; + blockstart += boundary; } } @@ -210,9 +212,12 @@ fxTMFindStartAddr(fxMesaContext fxMesa, GLint tmu, int size) tmp = tmp->next; } /* No free space. Discard oldest */ + if (TDFX_DEBUG & VERBOSE_TEXTURE) { + fprintf(stderr, "%s: No free space. Discard oldest\n", __FUNCTION__); + } obj = fxTMFindOldestObject(fxMesa, tmu); if (!obj) { - fprintf(stderr, "fx Driver: No space for texture\n"); + fprintf(stderr, "%s: ERROR: No space for texture\n", __FUNCTION__); return -1; } fxTMMoveOutTM(fxMesa, obj); @@ -224,6 +229,7 @@ static void fxTMRemoveRange(fxMesaContext fxMesa, GLint tmu, MemRange * range) { MemRange *tmp, *prev; + FxU32 boundary = (fxMesa->type >= GR_SSTTYPE_Banshee) ? -1 : (FX_2MB_SPLIT - 1); if (range->startAddr == range->endAddr) { fxTMDeleteRangeNode(fxMesa, range); @@ -246,7 +252,7 @@ fxTMRemoveRange(fxMesaContext fxMesa, GLint tmu, MemRange * range) range->next = tmp; if (tmp) { if (range->endAddr == tmp->startAddr - && tmp->startAddr & (FX_2MB_SPLIT - 1)) { + && tmp->startAddr & boundary) { /* Combine */ tmp->startAddr = range->startAddr; fxTMDeleteRangeNode(fxMesa, range); @@ -255,7 +261,7 @@ fxTMRemoveRange(fxMesaContext fxMesa, GLint tmu, MemRange * range) } if (prev) { if (prev->endAddr == range->startAddr - && range->startAddr & (FX_2MB_SPLIT - 1)) { + && range->startAddr & boundary) { /* Combine */ prev->endAddr = range->endAddr; prev->next = range->next; @@ -273,15 +279,19 @@ static struct gl_texture_object * fxTMFindOldestObject(fxMesaContext fxMesa, int tmu) { GLuint age, old, lasttime, bindnumber; + GLfloat lowestPriority; tfxTexInfo *info; - struct gl_texture_object *obj, *tmp; + struct gl_texture_object *obj, *tmp, *lowestPriorityObj; tmp = fxMesa->glCtx->Shared->TexObjectList; if (!tmp) return 0; - obj = 0; + obj = NULL; old = 0; + lowestPriorityObj = NULL; + lowestPriority = 1.0F; + bindnumber = fxMesa->texBindNumber; while (tmp) { info = fxTMGetTexInfo(tmp); @@ -300,10 +310,29 @@ fxTMFindOldestObject(fxMesaContext fxMesa, int tmu) old = age; obj = tmp; } + + /* examine priority */ + if (obj->Priority < lowestPriority) { + lowestPriority = tmp->Priority; + lowestPriorityObj = tmp; + } } tmp = tmp->Next; } - return obj; + + if (lowestPriority < 1.0) { + ASSERT(lowestPriorityObj); + if (TDFX_DEBUG & VERBOSE_TEXTURE) { + fprintf(stderr, "fxTMFindOldestObject: %d pri=%f\n", lowestPriorityObj->Name, lowestPriority); + } + return lowestPriorityObj; + } + else { + if (TDFX_DEBUG & VERBOSE_TEXTURE) { + fprintf(stderr, "fxTMFindOldestObject: %d age=%d\n", obj->Name, old); + } + return obj; + } } static MemRange * @@ -330,15 +359,14 @@ fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj, int i, l; int texmemsize; - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxTMMoveInTM(%d)\n", tObj->Name); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(%d)\n", __FUNCTION__, tObj->Name); } fxMesa->stats.reqTexUpload++; if (!ti->validated) { - fprintf(stderr, - "fx Driver: internal error in fxTMMoveInTM() -> not validated\n"); + fprintf(stderr, "%s: INTERNAL ERROR: not validated\n", __FUNCTION__); fxCloseHardware(); exit(-1); } @@ -355,9 +383,9 @@ fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj, } } - if (MESA_VERBOSE & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) { - fprintf(stderr, "fxmesa: downloading %x (%d) in texture memory in %d\n", - (GLuint) tObj, tObj->Name, where); + if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) { + fprintf(stderr, "%s: downloading %p (%d) in texture memory in %d\n", + __FUNCTION__, (void *)tObj, tObj->Name, where); } ti->whichTMU = (FxU32) where; @@ -419,9 +447,9 @@ fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj, ti->tm[FX_TMU0] = fxTMAddObj(fxMesa, tObj, FX_TMU0, texmemsize); fxMesa->stats.memTexUpload += texmemsize; - texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info)); + /*texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info));*/ ti->tm[FX_TMU1] = fxTMAddObj(fxMesa, tObj, FX_TMU1, texmemsize); - fxMesa->stats.memTexUpload += texmemsize; + fxMesa->stats.memTexUpload += texmemsize; /* ZZZ: required? */ for (i = FX_largeLodValue(ti->info), l = ti->minLevel; i <= FX_smallLodValue(ti->info); i++, l++) { @@ -446,9 +474,7 @@ fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj, } break; default: - fprintf(stderr, - "fx Driver: internal error in fxTMMoveInTM() -> wrong tmu (%d)\n", - where); + fprintf(stderr, "%s: INTERNAL ERROR: wrong tmu (%d)\n", __FUNCTION__, where); fxCloseHardware(); exit(-1); } @@ -479,14 +505,17 @@ fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj, struct gl_texture_image *texImage = tObj->Image[level]; tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); + if (TDFX_DEBUG & VERBOSE_TEXTURE) { + fprintf(stderr, "fxTMReloadMipMapLevel(%p (%d), %d)\n", (void *)tObj, tObj->Name, level); + } + assert(mml); assert(mml->width > 0); assert(mml->height > 0); assert(mml->glideFormat > 0); if (!ti->validated) { - fprintf(stderr, - "fx Driver: internal error in fxTMReloadMipMapLevel() -> not validated\n"); + fprintf(stderr, "%s: INTERNAL ERROR: not validated\n", __FUNCTION__); fxCloseHardware(); exit(-1); } @@ -494,16 +523,14 @@ fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj, tmu = (int) ti->whichTMU; fxTMMoveInTM(fxMesa, tObj, tmu); - fxTexGetInfo(mml->width, mml->height, - &lodlevel, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + lodlevel = ti->info.largeLodLog2 - (level - ti->minLevel); - lodlevel -= level; switch (tmu) { case FX_TMU0: case FX_TMU1: grTexDownloadMipMapLevel(tmu, ti->tm[tmu]->startAddr, - FX_valueToLod(FX_lodToValue(lodlevel)), + lodlevel, FX_largeLodLog2(ti->info), FX_aspectRatioLog2(ti->info), ti->info.format, @@ -512,7 +539,7 @@ fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj, case FX_TMU_SPLIT: grTexDownloadMipMapLevel(GR_TMU0, ti->tm[GR_TMU0]->startAddr, - FX_valueToLod(FX_lodToValue(lodlevel)), + lodlevel, FX_largeLodLog2(ti->info), FX_aspectRatioLog2(ti->info), ti->info.format, @@ -520,7 +547,7 @@ fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj, grTexDownloadMipMapLevel(GR_TMU1, ti->tm[GR_TMU1]->startAddr, - FX_valueToLod(FX_lodToValue(lodlevel)), + lodlevel, FX_largeLodLog2(ti->info), FX_aspectRatioLog2(ti->info), ti->info.format, @@ -529,7 +556,7 @@ fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj, case FX_TMU_BOTH: grTexDownloadMipMapLevel(GR_TMU0, ti->tm[GR_TMU0]->startAddr, - FX_valueToLod(FX_lodToValue(lodlevel)), + lodlevel, FX_largeLodLog2(ti->info), FX_aspectRatioLog2(ti->info), ti->info.format, @@ -537,7 +564,7 @@ fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj, grTexDownloadMipMapLevel(GR_TMU1, ti->tm[GR_TMU1]->startAddr, - FX_valueToLod(FX_lodToValue(lodlevel)), + lodlevel, FX_largeLodLog2(ti->info), FX_aspectRatioLog2(ti->info), ti->info.format, @@ -545,9 +572,7 @@ fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj, break; default: - fprintf(stderr, - "fx Driver: internal error in fxTMReloadMipMapLevel() -> wrong tmu (%d)\n", - tmu); + fprintf(stderr, "%s: INTERNAL ERROR: wrong tmu (%d)\n", __FUNCTION__, tmu); fxCloseHardware(); exit(-1); } @@ -568,8 +593,7 @@ fxTMReloadSubMipMapLevel(fxMesaContext fxMesa, assert(mml); if (!ti->validated) { - fprintf(stderr, - "fx Driver: internal error in fxTMReloadSubMipMapLevel() -> not validated\n"); + fprintf(stderr, "%s: INTERNAL ERROR: not validated\n", __FUNCTION__); fxCloseHardware(); exit(-1); } @@ -578,7 +602,7 @@ fxTMReloadSubMipMapLevel(fxMesaContext fxMesa, fxTMMoveInTM(fxMesa, tObj, tmu); fxTexGetInfo(mml->width, mml->height, - &lodlevel, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + &lodlevel, NULL, NULL, NULL, NULL, NULL); if ((ti->info.format == GR_TEXFMT_INTENSITY_8) || (ti->info.format == GR_TEXFMT_P_8) || @@ -643,9 +667,7 @@ fxTMReloadSubMipMapLevel(fxMesaContext fxMesa, yoffset, yoffset + height - 1); break; default: - fprintf(stderr, - "fx Driver: internal error in fxTMReloadSubMipMapLevel() -> wrong tmu (%d)\n", - tmu); + fprintf(stderr, "%s: INTERNAL ERROR: wrong tmu (%d)\n", __FUNCTION__, tmu); fxCloseHardware(); exit(-1); } @@ -656,9 +678,8 @@ fxTMMoveOutTM(fxMesaContext fxMesa, struct gl_texture_object *tObj) { tfxTexInfo *ti = fxTMGetTexInfo(tObj); - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxTMMoveOutTM(%x (%d))\n", (GLuint) tObj, - tObj->Name); + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "%s(%p (%d))\n", __FUNCTION__, (void *)tObj, tObj->Name); } if (!ti->isInTM) @@ -675,7 +696,7 @@ fxTMMoveOutTM(fxMesaContext fxMesa, struct gl_texture_object *tObj) fxTMRemoveRange(fxMesa, FX_TMU1, ti->tm[FX_TMU1]); break; default: - fprintf(stderr, "fx Driver: internal error in fxTMMoveOutTM()\n"); + fprintf(stderr, "%s: INTERNAL ERROR: bad TMU (%ld)\n", __FUNCTION__, ti->whichTMU); fxCloseHardware(); exit(-1); } @@ -690,13 +711,17 @@ fxTMFreeTexture(fxMesaContext fxMesa, struct gl_texture_object *tObj) tfxTexInfo *ti = fxTMGetTexInfo(tObj); int i; + if (TDFX_DEBUG & VERBOSE_TEXTURE) { + fprintf(stderr, "%s(%p (%d))\n", __FUNCTION__, (void *)tObj, tObj->Name); + } + fxTMMoveOutTM(fxMesa, tObj); for (i = 0; i < MAX_TEXTURE_LEVELS; i++) { struct gl_texture_image *texImage = tObj->Image[i]; if (texImage) { if (texImage->Data) { - FREE(texImage->Data); + MESA_PBUFFER_FREE(texImage->Data); texImage->Data = NULL; } if (texImage->DriverData) { diff --git a/src/mesa/drivers/glide/fxtris.c b/src/mesa/drivers/glide/fxtris.c index 9a88e58c475..3c6f51a3264 100644 --- a/src/mesa/drivers/glide/fxtris.c +++ b/src/mesa/drivers/glide/fxtris.c @@ -1,4 +1,4 @@ -/* $Id: fxtris.c,v 1.23 2003/09/23 14:41:02 brianp Exp $ */ +/* $Id: fxtris.c,v 1.24 2003/10/02 17:36:44 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -136,10 +136,10 @@ fx_translate_vertex( GLcontext *ctx, const GrVertex *src, SWvertex *dst) dst->win[2] = src->ooz; dst->win[3] = src->oow; - dst->color[0] = (GLubyte) src->r; - dst->color[1] = (GLubyte) src->g; - dst->color[2] = (GLubyte) src->b; - dst->color[3] = (GLubyte) src->a; + dst->color[0] = src->pargb[2]; + dst->color[1] = src->pargb[1]; + dst->color[2] = src->pargb[0]; + dst->color[3] = src->pargb[3]; dst->texcoord[ts0][0] = fxMesa->inv_s0scale * src->tmuvtx[0].sow * w; dst->texcoord[ts0][1] = fxMesa->inv_t0scale * src->tmuvtx[0].tow * w; @@ -208,17 +208,14 @@ fx_fallback_point( fxMesaContext fxMesa, static void fx_print_vertex( GLcontext *ctx, const GrVertex *v ) { - fprintf(stderr, "vertex at %p\n", (void *) v); + fprintf(stderr, "%s:\n", __FUNCTION__); - fprintf(stderr, "x %f y %f z %f oow %f\n", - v->x, v->y, v->ooz, v->oow); - fprintf(stderr, "r %f g %f b %f a %f\n", - v->r, - v->g, - v->b, - v->a); + fprintf(stderr, "\tvertex at %p\n", (void *) v); + + fprintf(stderr, "\tx %f y %f z %f oow %f\n", v->x, v->y, v->ooz, v->oow); + fprintf(stderr, "\tr %d g %d b %d a %d\n", v->pargb[2], v->pargb[1], v->pargb[0], v->pargb[3]); - fprintf(stderr, "\n"); + fprintf(stderr, "\n"); } #define DO_FALLBACK 0 @@ -233,7 +230,9 @@ static void fx_draw_quad( fxMesaContext fxMesa, GrVertex *v2, GrVertex *v3 ) { + BEGIN_CLIP_LOOP(); QUAD( v0, v1, v2, v3 ); + END_CLIP_LOOP(); } static void fx_draw_triangle( fxMesaContext fxMesa, @@ -241,7 +240,9 @@ static void fx_draw_triangle( fxMesaContext fxMesa, GrVertex *v1, GrVertex *v2 ) { + BEGIN_CLIP_LOOP(); TRI( v0, v1, v2 ); + END_CLIP_LOOP(); } static void fx_draw_line( fxMesaContext fxMesa, @@ -250,7 +251,9 @@ static void fx_draw_line( fxMesaContext fxMesa, { /* No support for wide lines (avoid wide/aa line fallback). */ + BEGIN_CLIP_LOOP(); LINE(v0, v1); + END_CLIP_LOOP(); } static void fx_draw_point( fxMesaContext fxMesa, @@ -258,7 +261,9 @@ static void fx_draw_point( fxMesaContext fxMesa, { /* No support for wide points. */ + BEGIN_CLIP_LOOP(); POINT( v0 ); + END_CLIP_LOOP(); } #undef DO_FALLBACK @@ -307,41 +312,26 @@ static struct { #define VERT_SET_RGBA( dst, f ) \ do { \ - dst->r = (GLfloat)f[0]; \ - dst->g = (GLfloat)f[1]; \ - dst->b = (GLfloat)f[2]; \ - dst->a = (GLfloat)f[3]; \ + dst->pargb[2] = f[0]; \ + dst->pargb[1] = f[1]; \ + dst->pargb[0] = f[2]; \ + dst->pargb[3] = f[3]; \ } while (0) #define VERT_COPY_RGBA( v0, v1 ) \ -do { \ - v0->r = v1->r; \ - v0->g = v1->g; \ - v0->b = v1->b; \ - v0->a = v1->a; \ -} while (0) + *(GLuint *)&v0->pargb = *(GLuint *)&v1->pargb #define VERT_SAVE_RGBA( idx ) \ -do { \ - color[idx][0] = v[idx]->r; \ - color[idx][1] = v[idx]->g; \ - color[idx][2] = v[idx]->b; \ - color[idx][3] = v[idx]->a; \ -} while (0) + *(GLuint *)&color[idx] = *(GLuint *)&v[idx]->pargb #define VERT_RESTORE_RGBA( idx ) \ -do { \ - v[idx]->r = color[idx][0]; \ - v[idx]->g = color[idx][1]; \ - v[idx]->b = color[idx][2]; \ - v[idx]->a = color[idx][3]; \ -} while (0) + *(GLuint *)&v[idx]->pargb = *(GLuint *)&color[idx] #define LOCAL_VARS(n) \ fxMesaContext fxMesa = FX_CONTEXT(ctx); \ - GLfloat color[n][4]; \ + GLubyte color[n][4]; \ (void) color; @@ -534,6 +524,321 @@ static void init_rast_tab( void ) } +/**********************************************************************/ +/* Render whole begin/end objects */ +/**********************************************************************/ + + +/* Accelerate vertex buffer rendering when renderindex == 0 and + * there is no clipping. + */ + +static void fx_render_vb_points( GLcontext *ctx, + GLuint start, + GLuint count, + GLuint flags ) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + GrVertex *fxVB = fxMesa->verts; + GLint i; + (void) flags; + + if (TDFX_DEBUG & VERBOSE_VARRAY) { + fprintf(stderr, "fx_render_vb_points\n"); + } + + fxRenderPrimitive(ctx, GL_POINTS); + + /* Adjust point coords */ + for (i = start; i < count; i++) { + fxVB[i].x += PNT_X_OFFSET - TRI_X_OFFSET; + fxVB[i].y += PNT_Y_OFFSET - TRI_Y_OFFSET; + } + + grDrawVertexArrayContiguous( GR_POINTS, count-start, + fxVB + start, sizeof(GrVertex)); + /* restore point coords */ + for (i = start; i < count; i++) { + fxVB[i].x -= PNT_X_OFFSET - TRI_X_OFFSET; + fxVB[i].y -= PNT_Y_OFFSET - TRI_Y_OFFSET; + } +} + +static void fx_render_vb_line_strip( GLcontext *ctx, + GLuint start, + GLuint count, + GLuint flags ) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + GrVertex *fxVB = fxMesa->verts; + GLint i; + (void) flags; + + if (TDFX_DEBUG & VERBOSE_VARRAY) { + fprintf(stderr, "fx_render_vb_line_strip\n"); + } + + fxRenderPrimitive(ctx, GL_LINE_STRIP); + + /* adjust line coords */ + for (i = start; i < count; i++) { + fxVB[i].x += LINE_X_OFFSET - TRI_X_OFFSET; + fxVB[i].y += LINE_Y_OFFSET - TRI_Y_OFFSET; + } + + grDrawVertexArrayContiguous( GR_LINE_STRIP, count-start, + fxVB + start, sizeof(GrVertex)); + + /* restore line coords */ + for (i = start; i < count; i++) { + fxVB[i].x -= LINE_X_OFFSET - TRI_X_OFFSET; + fxVB[i].y -= LINE_Y_OFFSET - TRI_Y_OFFSET; + } +} + +static void fx_render_vb_line_loop( GLcontext *ctx, + GLuint start, + GLuint count, + GLuint flags ) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + GrVertex *fxVB = fxMesa->verts; + GLint i; + GLint j = start; + (void) flags; + + if (TDFX_DEBUG & VERBOSE_VARRAY) { + fprintf(stderr, "fx_render_vb_line_loop\n"); + } + + fxRenderPrimitive(ctx, GL_LINE_LOOP); + + if (!(flags & PRIM_BEGIN)) { + j++; + } + + /* adjust line coords */ + for (i = start; i < count; i++) { + fxVB[i].x += LINE_X_OFFSET - TRI_X_OFFSET; + fxVB[i].y += LINE_Y_OFFSET - TRI_Y_OFFSET; + } + + grDrawVertexArrayContiguous( GR_LINE_STRIP, count-j, + fxVB + j, sizeof(GrVertex)); + + if (flags & PRIM_END) + grDrawLine( fxVB + (count - 1), + fxVB + start ); + + /* restore line coords */ + for (i = start; i < count; i++) { + fxVB[i].x -= LINE_X_OFFSET - TRI_X_OFFSET; + fxVB[i].y -= LINE_Y_OFFSET - TRI_Y_OFFSET; + } +} + +static void fx_render_vb_lines( GLcontext *ctx, + GLuint start, + GLuint count, + GLuint flags ) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + GrVertex *fxVB = fxMesa->verts; + GLint i; + (void) flags; + + if (TDFX_DEBUG & VERBOSE_VARRAY) { + fprintf(stderr, "fx_render_vb_lines\n"); + } + + fxRenderPrimitive(ctx, GL_LINES); + + /* adjust line coords */ + for (i = start; i < count; i++) { + fxVB[i].x += LINE_X_OFFSET - TRI_X_OFFSET; + fxVB[i].y += LINE_Y_OFFSET - TRI_Y_OFFSET; + } + + grDrawVertexArrayContiguous( GR_LINES, count-start, + fxVB + start, sizeof(GrVertex)); + + /* restore line coords */ + for (i = start; i < count; i++) { + fxVB[i].x -= LINE_X_OFFSET - TRI_X_OFFSET; + fxVB[i].y -= LINE_Y_OFFSET - TRI_Y_OFFSET; + } +} + +static void fx_render_vb_triangles( GLcontext *ctx, + GLuint start, + GLuint count, + GLuint flags ) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + GrVertex *fxVB = fxMesa->verts; + (void) flags; + + if (TDFX_DEBUG & VERBOSE_VARRAY) { + fprintf(stderr, "fx_render_vb_triangles\n"); + } + + fxRenderPrimitive(ctx, GL_TRIANGLES); + +#if 0 + /* [dBorca] + * apparently, this causes troubles with some programs (GLExcess); + * might be a bug in Glide... However, "grDrawVertexArrayContiguous" + * eventually calls "grDrawTriangle" for GR_TRIANGLES, so we're better + * off doing it by hand... + */ + grDrawVertexArrayContiguous( GR_TRIANGLES, count-start, + fxVB + start, sizeof(GrVertex)); +#else + { + GLuint j; + for (j=start+2; jverts; + int mode; + (void) flags; + + if (TDFX_DEBUG & VERBOSE_VARRAY) { + fprintf(stderr, "fx_render_vb_tri_strip\n"); + } + + fxRenderPrimitive(ctx, GL_TRIANGLE_STRIP); + + if (flags & PRIM_PARITY) + mode = GR_TRIANGLE_STRIP_CONTINUE; + else + mode = GR_TRIANGLE_STRIP; + + grDrawVertexArrayContiguous( mode, count-start, + fxVB + start, sizeof(GrVertex)); +} + + +static void fx_render_vb_tri_fan( GLcontext *ctx, + GLuint start, + GLuint count, + GLuint flags ) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + GrVertex *fxVB = fxMesa->verts; + (void) flags; + + if (TDFX_DEBUG & VERBOSE_VARRAY) { + fprintf(stderr, "fx_render_vb_tri_fan\n"); + } + + fxRenderPrimitive(ctx, GL_TRIANGLE_FAN); + + grDrawVertexArrayContiguous( GR_TRIANGLE_FAN, count-start, + fxVB + start, sizeof(GrVertex) ); +} + +static void fx_render_vb_quads( GLcontext *ctx, + GLuint start, + GLuint count, + GLuint flags ) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + GrVertex *fxVB = fxMesa->verts; + GLuint i; + (void) flags; + + if (TDFX_DEBUG & VERBOSE_VARRAY) { + fprintf(stderr, "fx_render_vb_quads\n"); + } + + fxRenderPrimitive(ctx, GL_QUADS); + + for (i = start ; i < count-3 ; i += 4 ) { +#define VERT(x) (fxVB + (x)) + grDrawTriangle( VERT(i), VERT(i+1), VERT(i+3) ); + grDrawTriangle( VERT(i+1), VERT(i+2), VERT(i+3) ); +#undef VERT + } +} + +static void fx_render_vb_quad_strip( GLcontext *ctx, + GLuint start, + GLuint count, + GLuint flags ) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + GrVertex *fxVB = fxMesa->verts; + (void) flags; + + if (TDFX_DEBUG & VERBOSE_VARRAY) { + fprintf(stderr, "fx_render_vb_quad_strip\n"); + } + + fxRenderPrimitive(ctx, GL_QUAD_STRIP); + + count -= (count-start)&1; + + grDrawVertexArrayContiguous( GR_TRIANGLE_STRIP, + count-start, fxVB + start, sizeof(GrVertex)); +} + +static void fx_render_vb_poly( GLcontext *ctx, + GLuint start, + GLuint count, + GLuint flags ) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + GrVertex *fxVB = fxMesa->verts; + (void) flags; + + if (TDFX_DEBUG & VERBOSE_VARRAY) { + fprintf(stderr, "fx_render_vb_poly\n"); + } + + fxRenderPrimitive(ctx, GL_POLYGON); + + grDrawVertexArrayContiguous( GR_POLYGON, count-start, + fxVB + start, sizeof(GrVertex)); +} + +static void fx_render_vb_noop( GLcontext *ctx, + GLuint start, + GLuint count, + GLuint flags ) +{ + (void) (ctx && start && count && flags); +} + +static void (*fx_render_tab_verts[GL_POLYGON+2])(GLcontext *, + GLuint, + GLuint, + GLuint) = +{ + fx_render_vb_points, + fx_render_vb_lines, + fx_render_vb_line_loop, + fx_render_vb_line_strip, + fx_render_vb_triangles, + fx_render_vb_tri_strip, + fx_render_vb_tri_fan, + fx_render_vb_quads, + fx_render_vb_quad_strip, + fx_render_vb_poly, + fx_render_vb_noop, +}; + /**********************************************************************/ /* Render whole (indexed) begin/end objects */ @@ -582,7 +887,7 @@ static void init_rast_tab( void ) #undef TAG #define TAG(x) fx_##x##_verts #define ELT(x) x -#include "../common/t_dd_rendertmp.h" +/*#include "../common/t_dd_rendertmp.h"*/ /* we have fx_render_vb_* now */ @@ -621,7 +926,7 @@ static void fxFastRenderClippedPoly( GLcontext *ctx, const GLuint *elts, GLuint n ) { fxMesaContext fxMesa = FX_CONTEXT( ctx ); - GrVertex *vertptr = fxMesa->verts; + GrVertex *vertptr = fxMesa->verts; const GrVertex *start = VERT(elts[0]); int i; for (i = 2 ; i < n ; i++) { @@ -650,8 +955,6 @@ void fxDDChooseRenderState(GLcontext *ctx) GLuint flags = ctx->_TriangleCaps; GLuint index = 0; -/* fprintf(stderr, "%s\n", __FUNCTION__); */ - if (flags & (ANY_FALLBACK_FLAGS|ANY_RASTER_FLAGS)) { if (flags & ANY_RASTER_FLAGS) { if (flags & DD_TRI_LIGHT_TWOSIDE) index |= FX_TWOSIDE_BIT; @@ -665,30 +968,31 @@ void fxDDChooseRenderState(GLcontext *ctx) fxMesa->draw_tri = fx_draw_triangle; /* Hook in fallbacks for specific primitives. - * - * + * [dBorca] Hack alert: + * If we're in FSAA mode, we always do anti-aliased primitives. */ if (flags & (POINT_FALLBACK| LINE_FALLBACK| TRI_FALLBACK)) { + if (fxMesa->verbose) { + fprintf(stderr, "Voodoo ! fallback (%x), raster (%x)\n", + flags & ANY_FALLBACK_FLAGS, flags & ANY_RASTER_FLAGS); + } + if (flags & POINT_FALLBACK) fxMesa->draw_point = fx_fallback_point; if (flags & LINE_FALLBACK) fxMesa->draw_line = fx_fallback_line; - if (flags & TRI_FALLBACK) { -/* fprintf(stderr, "tri fallback\n"); */ + if (flags & TRI_FALLBACK) fxMesa->draw_tri = fx_fallback_tri; - } index |= FX_FALLBACK_BIT; } } -/* fprintf(stderr, "render index %x\n", index); */ - tnl->Driver.Render.Points = rast_tab[index].points; tnl->Driver.Render.Line = rast_tab[index].line; tnl->Driver.Render.ClippedLine = rast_tab[index].line; @@ -699,14 +1003,13 @@ void fxDDChooseRenderState(GLcontext *ctx) tnl->Driver.Render.PrimTabVerts = fx_render_tab_verts; tnl->Driver.Render.PrimTabElts = fx_render_tab_elts; tnl->Driver.Render.ClippedPolygon = fxFastRenderClippedPoly; - - tnl->Driver.Render.ClippedPolygon = fxRenderClippedPoly; - } else { tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; tnl->Driver.Render.ClippedPolygon = fxRenderClippedPoly; } + + fxMesa->render_index = index; } @@ -714,6 +1017,65 @@ void fxDDChooseRenderState(GLcontext *ctx) /* Runtime render state and callbacks */ /**********************************************************************/ +static void fxRunPipeline( GLcontext *ctx ) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + GLuint new_gl_state = fxMesa->new_gl_state; + + if (TDFX_DEBUG & VERBOSE_PIPELINE) { + fprintf(stderr, "fxRunPipeline()\n"); + } + + /* Recalculate fog table on projection matrix changes. This used to + * be triggered by the NearFar callback. + */ + if (new_gl_state & _NEW_PROJECTION) + fxMesa->new_state |= FX_NEW_FOG; + + if (new_gl_state & (_FX_NEW_IS_IN_HARDWARE | + _FX_NEW_RENDERSTATE | + _FX_NEW_SETUP_FUNCTION | + _NEW_TEXTURE)) { + + if (new_gl_state & _FX_NEW_IS_IN_HARDWARE) + fxCheckIsInHardware(ctx); + + if (fxMesa->new_state) + fxSetupFXUnits(ctx); + + if (!fxMesa->fallback) { + if (new_gl_state & _FX_NEW_RENDERSTATE) + fxDDChooseRenderState(ctx); + + if (new_gl_state & _FX_NEW_SETUP_FUNCTION) + fxChooseVertexState(ctx); + } + + if (new_gl_state & _NEW_TEXTURE) { + struct gl_texture_unit *t0 = &ctx->Texture.Unit[fxMesa->tmu_source[0]]; + struct gl_texture_unit *t1 = &ctx->Texture.Unit[fxMesa->tmu_source[1]]; + + if (t0 && t0->_Current && FX_TEXTURE_DATA(t0)) { + fxMesa->s0scale = FX_TEXTURE_DATA(t0)->sScale; + fxMesa->t0scale = FX_TEXTURE_DATA(t0)->tScale; + fxMesa->inv_s0scale = 1.0 / fxMesa->s0scale; + fxMesa->inv_t0scale = 1.0 / fxMesa->t0scale; + } + + if (t1 && t1->_Current && FX_TEXTURE_DATA(t1)) { + fxMesa->s1scale = FX_TEXTURE_DATA(t1)->sScale; + fxMesa->t1scale = FX_TEXTURE_DATA(t1)->tScale; + fxMesa->inv_s1scale = 1.0 / fxMesa->s1scale; + fxMesa->inv_t1scale = 1.0 / fxMesa->t1scale; + } + } + } + + fxMesa->new_gl_state = 0; + + _tnl_run_pipeline( ctx ); +} + static GLenum reduced_prim[GL_POLYGON+1] = { GL_POINTS, @@ -735,18 +1097,19 @@ static GLenum reduced_prim[GL_POLYGON+1] = { */ static void fxRasterPrimitive( GLcontext *ctx, GLenum prim ) { + extern void fxSetupCull (GLcontext *ctx); + fxMesaContext fxMesa = FX_CONTEXT( ctx ); fxMesa->raster_primitive = prim; - if (prim == GL_TRIANGLES) - grCullMode( fxMesa->cullMode ); - else - grCullMode( GR_CULL_DISABLE ); + + fxSetupCull(ctx); } -/* Determine the rasterized primitive when drawing filled polygons. +/* Determine the rasterized primitive when not drawing unfilled + * polygons. */ static void fxRenderPrimitive( GLcontext *ctx, GLenum prim ) { @@ -755,9 +1118,7 @@ static void fxRenderPrimitive( GLcontext *ctx, GLenum prim ) fxMesa->render_primitive = prim; - if (rprim == GL_TRIANGLES && - (ctx->Polygon.FrontMode != GL_FILL || - ctx->Polygon.BackMode != GL_FILL)) + if (rprim == GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED)) return; if (fxMesa->raster_primitive != rprim) { @@ -765,35 +1126,66 @@ static void fxRenderPrimitive( GLcontext *ctx, GLenum prim ) } } +static void fxRenderFinish( GLcontext *ctx ) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + + if (fxMesa->render_index & FX_FALLBACK_BIT) + _swrast_flush( ctx ); +} + /**********************************************************************/ /* Manage total rasterization fallbacks */ /**********************************************************************/ +static char *fallbackStrings[] = { + "1D/3D Texture map", + "glDrawBuffer(GL_FRONT_AND_BACK)", + "Separate specular color", + "glEnable/Disable(GL_STENCIL_TEST)", + "glRenderMode(selection or feedback)", + "glLogicOp()", + "Texture env mode", + "Texture border", + "glColorMask", + "blend mode", + "line stipple" +}; + + +static char *getFallbackString(GLuint bit) +{ + int i = 0; + while (bit > 1) { + i++; + bit >>= 1; + } + return fallbackStrings[i]; +} + void fxCheckIsInHardware( GLcontext *ctx ) { - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + fxMesaContext fxMesa = FX_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint oldfallback = !fxMesa->is_in_hardware; - GLuint newfallback; - - fxMesa->is_in_hardware = fx_check_IsInHardware( ctx ); - newfallback = !fxMesa->is_in_hardware; + GLuint oldfallback = fxMesa->fallback; + GLuint newfallback = fxMesa->fallback = fx_check_IsInHardware( ctx ); if (newfallback) { if (oldfallback == 0) { -/* fprintf(stderr, "goint to fallback\n"); */ + if (fxMesa->verbose) { + fprintf(stderr, "Voodoo ! begin SW 0x08%x %s\n", newfallback, getFallbackString(newfallback)); + } _swsetup_Wakeup( ctx ); } } else { if (oldfallback) { -/* fprintf(stderr, "leaving fallback\n"); */ _swrast_flush( ctx ); tnl->Driver.Render.Start = fxCheckTexSizes; - tnl->Driver.Render.Finish = _swrast_flush; + tnl->Driver.Render.Finish = fxRenderFinish; tnl->Driver.Render.PrimitiveNotify = fxRenderPrimitive; tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon; tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine; @@ -804,6 +1196,9 @@ void fxCheckIsInHardware( GLcontext *ctx ) tnl->Driver.Render.Multipass = 0; fxChooseVertexState(ctx); fxDDChooseRenderState(ctx); + if (fxMesa->verbose) { + fprintf(stderr, "Voodoo ! end SW 0x08%x %s\n", oldfallback, getFallbackString(oldfallback)); + } } } } @@ -818,8 +1213,9 @@ void fxDDInitTriFuncs( GLcontext *ctx ) firsttime = 0; } + tnl->Driver.RunPipeline = fxRunPipeline; tnl->Driver.Render.Start = fxCheckTexSizes; - tnl->Driver.Render.Finish = _swrast_flush; + tnl->Driver.Render.Finish = fxRenderFinish; tnl->Driver.Render.PrimitiveNotify = fxRenderPrimitive; tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon; tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine; diff --git a/src/mesa/drivers/glide/fxvb.c b/src/mesa/drivers/glide/fxvb.c index 9fc73e23796..da9108b7ba0 100644 --- a/src/mesa/drivers/glide/fxvb.c +++ b/src/mesa/drivers/glide/fxvb.c @@ -1,3 +1,5 @@ +/* $Id: fxvb.c,v 1.19 2003/10/02 17:36:45 brianp Exp $ */ + /* * Mesa 3-D graphics library * Version: 5.1 @@ -37,7 +39,6 @@ #include "mtypes.h" #include "imports.h" #include "macros.h" -#include "context.h" #include "colormac.h" #include "math/m_translate.h" @@ -55,10 +56,7 @@ static void copy_pv( GLcontext *ctx, GLuint edst, GLuint esrc ) GrVertex *dst = fxMesa->verts + edst; GrVertex *src = fxMesa->verts + esrc; - dst->r = src->r; - dst->g = src->g; - dst->b = src->b; - dst->a = src->a; + *(GLuint *)&dst->pargb = *(GLuint *)&src->pargb; } typedef void (*emit_func)( GLcontext *, GLuint, GLuint, void * ); @@ -104,7 +102,8 @@ static void import_float_colors( GLcontext *ctx ) } -#define GET_COLOR(ptr, idx) (((GLfloat (*)[4])((ptr)->Ptr))[idx]) +/* Hack alert: assume chan is 8 bits */ +#define GET_COLOR(ptr, idx) (((GLchan (*)[4])((ptr)->Ptr))[idx]) static void interp_extras( GLcontext *ctx, @@ -114,20 +113,19 @@ static void interp_extras( GLcontext *ctx, { struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - /*fprintf(stderr, "%s\n", __FUNCTION__);*/ - if (VB->ColorPtr[1]) { - INTERP_4F( t, + INTERP_4CHAN( t, GET_COLOR(VB->ColorPtr[1], dst), GET_COLOR(VB->ColorPtr[1], out), GET_COLOR(VB->ColorPtr[1], in) ); - +#if 0 /* [dBorca] leaving disabled for now */ if (VB->SecondaryColorPtr[1]) { - INTERP_3F( t, + INTERP_3CHAN( t, GET_COLOR(VB->SecondaryColorPtr[1], dst), GET_COLOR(VB->SecondaryColorPtr[1], out), GET_COLOR(VB->SecondaryColorPtr[1], in) ); } +#endif } if (VB->EdgeFlag) { @@ -143,13 +141,14 @@ static void copy_pv_extras( GLcontext *ctx, GLuint dst, GLuint src ) struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; if (VB->ColorPtr[1]) { - COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), + COPY_CHAN4( GET_COLOR(VB->ColorPtr[1], dst), GET_COLOR(VB->ColorPtr[1], src) ); - +#if 0 /* [dBorca] leaving disabled for now */ if (VB->SecondaryColorPtr[1]) { - COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst), + COPY_CHAN4( GET_COLOR(VB->SecondaryColorPtr[1], dst), GET_COLOR(VB->SecondaryColorPtr[1], src) ); } +#endif } copy_pv(ctx, dst, src); @@ -285,9 +284,7 @@ void fxCheckTexSizes( GLcontext *ctx ) * In the unfilled and twosided cases we are using the * Extras ones anyway, so leave them in place. */ - if (!(NEED_TWO_SIDED_LIGHTING(ctx) || - ctx->Polygon.FrontMode != GL_FILL || - ctx->Polygon.BackMode != GL_FILL)) { + if (!(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) { tnl->Driver.Render.Interp = setup_tab[fxMesa->SetupIndex].interp; } } @@ -358,13 +355,10 @@ void fxChooseVertexState( GLcontext *ctx ) fxMesa->SetupIndex = ind; - if (NEED_TWO_SIDED_LIGHTING(ctx) || - ctx->Polygon.FrontMode != GL_FILL || - ctx->Polygon.BackMode != GL_FILL) { + if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) { tnl->Driver.Render.Interp = interp_extras; tnl->Driver.Render.CopyPV = copy_pv_extras; - } - else { + } else { tnl->Driver.Render.Interp = setup_tab[ind].interp; tnl->Driver.Render.CopyPV = copy_pv; } diff --git a/src/mesa/drivers/glide/fxvbtmp.h b/src/mesa/drivers/glide/fxvbtmp.h index e53cf981f50..d1a022ff5e4 100644 --- a/src/mesa/drivers/glide/fxvbtmp.h +++ b/src/mesa/drivers/glide/fxvbtmp.h @@ -1,4 +1,4 @@ -/* $Id: fxvbtmp.h,v 1.12 2002/10/29 20:28:57 brianp Exp $ */ +/* $Id: fxvbtmp.h,v 1.13 2003/10/02 17:36:45 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -45,6 +45,7 @@ static void TAG(emit)( GLcontext *ctx, GLuint proj_stride = VB->NdcPtr->stride; GrVertex *v = (GrVertex *)dest; GLfloat u0scale,v0scale,u1scale,v1scale; + const GLubyte *mask = VB->ClipMask; const GLfloat *const s = ctx->Viewport._WindowMap.m; int i; @@ -86,11 +87,16 @@ static void TAG(emit)( GLcontext *ctx, for (i=start; i < end; i++, v++) { if (IND & SETUP_XYZW) { - /* unclipped */ - v->x = s[0] * proj[0][0] + s[12]; - v->y = s[5] * proj[0][1] + s[13]; - v->ooz = s[10] * proj[0][2] + s[14]; - v->oow = proj[0][3]; + if (mask[i] == 0) { + /* unclipped */ + v->x = s[0] * proj[0][0] + s[12]; + v->y = s[5] * proj[0][1] + s[13]; + v->ooz = s[10] * proj[0][2] + s[14]; + v->oow = proj[0][3]; + } else { + /* clipped */ + v->oow = 1.0; + } if (IND & SETUP_SNAP) { #if defined(USE_IEEE) @@ -108,10 +114,10 @@ static void TAG(emit)( GLcontext *ctx, proj = (GLfloat (*)[4])((GLubyte *)proj + proj_stride); } if (IND & SETUP_RGBA) { - v->r = (GLfloat) col[0][0]; - v->g = (GLfloat) col[0][1]; - v->b = (GLfloat) col[0][2]; - v->a = (GLfloat) col[0][3]; + v->pargb[2] = col[0][0]; + v->pargb[1] = col[0][1]; + v->pargb[0] = col[0][2]; + v->pargb[3] = col[0][3]; STRIDE_4UB(col, col_stride); } if (IND & SETUP_TMU0) { @@ -210,10 +216,10 @@ static void TAG(interp)( GLcontext *ctx, } - INTERP_F( t, dst->r, out->r, in->r ); - INTERP_F( t, dst->g, out->g, in->g ); - INTERP_F( t, dst->b, out->b, in->b ); - INTERP_F( t, dst->a, out->a, in->a ); + INTERP_UB( t, dst->pargb[0], out->pargb[0], in->pargb[0] ); + INTERP_UB( t, dst->pargb[1], out->pargb[1], in->pargb[1] ); + INTERP_UB( t, dst->pargb[2], out->pargb[2], in->pargb[2] ); + INTERP_UB( t, dst->pargb[3], out->pargb[3], in->pargb[3] ); if (IND & SETUP_TMU0) { if (IND & SETUP_PTEX) { diff --git a/src/mesa/drivers/glide/fxwgl.c b/src/mesa/drivers/glide/fxwgl.c index a55b9cdf2c4..1337585aec8 100644 --- a/src/mesa/drivers/glide/fxwgl.c +++ b/src/mesa/drivers/glide/fxwgl.c @@ -1,4 +1,4 @@ -/* $Id: fxwgl.c,v 1.17 2003/08/19 15:52:53 brianp Exp $ */ +/* $Id: fxwgl.c,v 1.18 2003/10/02 17:36:45 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -35,7 +35,7 @@ */ -#ifdef __WIN32__ +#ifdef _WIN32 #ifdef __cplusplus extern "C" @@ -51,11 +51,11 @@ extern "C" } #endif -#include #include "GL/fxmesa.h" #include "glheader.h" -#include "fxdrv.h" #include "glapi.h" +#include "imports.h" +#include "fxdrv.h" #define MAX_MESA_ATTRS 20 @@ -71,73 +71,62 @@ struct __pixelformat__ GLint mesaAttr[MAX_MESA_ATTRS]; }; -WINGDIAPI void GLAPIENTRY gl3DfxSetPaletteEXT(GLuint *); +//WINGDIAPI void GLAPIENTRY gl3DfxSetPaletteEXT(GLuint *); struct __pixelformat__ pix[] = { -#if 0 - /* None */ + /* 16bit RGB565 single buffer with depth */ { - { - sizeof(PIXELFORMATDESCRIPTOR), 1, - PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | - PFD_DOUBLEBUFFER | PFD_SWAP_COPY, + {sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL, PFD_TYPE_RGBA, 16, - 5, 11, 6, 5, 5, 0, 0, 0, + 5, 0, 6, 5, 5, 11, 0, 0, 0, 0, 0, 0, 0, - 0, + 16, 0, 0, PFD_MAIN_PLANE, 0, 0, 0, 0} , - { - FXMESA_COLORDEPTH, 16, - FXMESA_DOUBLEBUFFER, + {FXMESA_COLORDEPTH, 16, FXMESA_ALPHA_SIZE, 0, - FXMESA_DEPTH_SIZE, 0, + FXMESA_DEPTH_SIZE, 16, FXMESA_STENCIL_SIZE, 0, FXMESA_ACCUM_SIZE, 0, FXMESA_NONE} - } + } , - - /* Alpha */ + /* 16bit RGB565 double buffer with depth */ { - { - sizeof(PIXELFORMATDESCRIPTOR), 1, + {sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_SWAP_COPY, PFD_TYPE_RGBA, 16, - 5, 10, 5, 5, 5, 0, 1, 15, + 5, 0, 6, 5, 5, 11, 0, 0, 0, 0, 0, 0, 0, - 0, + 16, 0, 0, PFD_MAIN_PLANE, 0, 0, 0, 0} , - { - FXMESA_COLORDEPTH, 15, + {FXMESA_COLORDEPTH, 16, FXMESA_DOUBLEBUFFER, - FXMESA_ALPHA_SIZE, 1, - FXMESA_DEPTH_SIZE, 0, + FXMESA_ALPHA_SIZE, 0, + FXMESA_DEPTH_SIZE, 16, FXMESA_STENCIL_SIZE, 0, FXMESA_ACCUM_SIZE, 0, FXMESA_NONE} - } + } , - - /* Depth */ + /* 16bit ARGB1555 single buffer with depth */ { - { - sizeof(PIXELFORMATDESCRIPTOR), 1, - PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | - PFD_DOUBLEBUFFER | PFD_SWAP_COPY, + {sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL, PFD_TYPE_RGBA, 16, - 5, 11, 6, 5, 5, 0, 0, 0, + 5, 0, 5, 5, 5, 10, 1, 15, 0, 0, 0, 0, 0, 16, 0, @@ -145,156 +134,118 @@ struct __pixelformat__ pix[] = { PFD_MAIN_PLANE, 0, 0, 0, 0} , - { - FXMESA_COLORDEPTH, 16, - FXMESA_DOUBLEBUFFER, - FXMESA_ALPHA_SIZE, 0, + {FXMESA_COLORDEPTH, 15, + FXMESA_ALPHA_SIZE, 1, FXMESA_DEPTH_SIZE, 16, FXMESA_STENCIL_SIZE, 0, FXMESA_ACCUM_SIZE, 0, FXMESA_NONE} - } + } , - - /* None */ + /* 16bit ARGB1555 double buffer with depth */ { - { - sizeof(PIXELFORMATDESCRIPTOR), 1, + {sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_SWAP_COPY, PFD_TYPE_RGBA, - 32, - 8, 16, 8, 8, 8, 0, 0, 0, + 16, + 5, 0, 5, 5, 5, 10, 1, 15, 0, 0, 0, 0, 0, - 0, + 16, 0, 0, PFD_MAIN_PLANE, 0, 0, 0, 0} , - { - FXMESA_COLORDEPTH, 32, + {FXMESA_COLORDEPTH, 15, FXMESA_DOUBLEBUFFER, - FXMESA_ALPHA_SIZE, 0, - FXMESA_DEPTH_SIZE, 0, + FXMESA_ALPHA_SIZE, 1, + FXMESA_DEPTH_SIZE, 16, FXMESA_STENCIL_SIZE, 0, FXMESA_ACCUM_SIZE, 0, FXMESA_NONE} - } + } , - - /* Alpha */ +#if 1 + /* 24bit RGB888 single buffer with depth */ { - { - sizeof(PIXELFORMATDESCRIPTOR), 1, - PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | - PFD_DOUBLEBUFFER | PFD_SWAP_COPY, + {sizeof(PIXELFORMATDESCRIPTOR), 1, + PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL, PFD_TYPE_RGBA, - 32, - 8, 16, 8, 8, 8, 0, 8, 24, + 24, + 8, 0, 8, 8, 8, 16, 0, 0, 0, 0, 0, 0, 0, - 0, - 0, + 24, + 8, 0, PFD_MAIN_PLANE, 0, 0, 0, 0} , - { - FXMESA_COLORDEPTH, 32, - FXMESA_DOUBLEBUFFER, + {FXMESA_COLORDEPTH, 32, FXMESA_ALPHA_SIZE, 8, - FXMESA_DEPTH_SIZE, 0, - FXMESA_STENCIL_SIZE, 0, + FXMESA_DEPTH_SIZE, 24, + FXMESA_STENCIL_SIZE, 8, FXMESA_ACCUM_SIZE, 0, FXMESA_NONE} - } + } , - - /* Depth */ - { - { - sizeof(PIXELFORMATDESCRIPTOR), 1, - PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | - PFD_DOUBLEBUFFER | PFD_SWAP_COPY, - PFD_TYPE_RGBA, - 32, - 8, 16, 8, 8, 8, 0, 0, 0, - 0, 0, 0, 0, 0, - 16, - 0, - 0, - PFD_MAIN_PLANE, - 0, 0, 0, 0} - , - { - FXMESA_COLORDEPTH, 32, - FXMESA_DOUBLEBUFFER, - FXMESA_ALPHA_SIZE, 0, - FXMESA_DEPTH_SIZE, 16, - FXMESA_STENCIL_SIZE, 0, - FXMESA_ACCUM_SIZE, 0, - FXMESA_NONE} - } -#endif - /* 16bit RGB565 */ + /* 24bit RGB888 double buffer with depth */ { {sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_SWAP_COPY, PFD_TYPE_RGBA, - 16, - 5, 11, 6, 5, 5, 0, 0, 0, + 24, + 8, 0, 8, 8, 8, 16, 0, 0, 0, 0, 0, 0, 0, - 16, - 0, + 24, + 8, 0, PFD_MAIN_PLANE, 0, 0, 0, 0} , - {FXMESA_COLORDEPTH, 16, + {FXMESA_COLORDEPTH, 32, FXMESA_DOUBLEBUFFER, - FXMESA_ALPHA_SIZE, 0, - FXMESA_DEPTH_SIZE, 16, - FXMESA_STENCIL_SIZE, 0, + FXMESA_ALPHA_SIZE, 8, + FXMESA_DEPTH_SIZE, 24, + FXMESA_STENCIL_SIZE, 8, FXMESA_ACCUM_SIZE, 0, FXMESA_NONE} - } - , - /* 16bit ARGB1555 */ + }, +#endif + /* 32bit ARGB8888 single buffer with depth */ { {sizeof(PIXELFORMATDESCRIPTOR), 1, - PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | - PFD_DOUBLEBUFFER | PFD_SWAP_COPY, + PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL, PFD_TYPE_RGBA, - 16, - 5, 10, 5, 5, 5, 0, 1, 15, + 32, + 8, 0, 8, 8, 8, 16, 8, 24, 0, 0, 0, 0, 0, - 16, - 0, + 24, + 8, 0, PFD_MAIN_PLANE, 0, 0, 0, 0} , - {FXMESA_COLORDEPTH, 15, - FXMESA_DOUBLEBUFFER, - FXMESA_ALPHA_SIZE, 1, - FXMESA_DEPTH_SIZE, 16, - FXMESA_STENCIL_SIZE, 0, + {FXMESA_COLORDEPTH, 32, + FXMESA_ALPHA_SIZE, 8, + FXMESA_DEPTH_SIZE, 24, + FXMESA_STENCIL_SIZE, 8, FXMESA_ACCUM_SIZE, 0, FXMESA_NONE} } , - /* 32bit ARGB8888 */ + /* 32bit ARGB8888 double buffer with depth */ { {sizeof(PIXELFORMATDESCRIPTOR), 1, PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_SWAP_COPY, PFD_TYPE_RGBA, 32, - 8, 16, 8, 8, 8, 0, 8, 24, + 8, 0, 8, 8, 8, 16, 8, 24, 0, 0, 0, 0, 0, 24, - 0, + 8, 0, PFD_MAIN_PLANE, 0, 0, 0, 0} @@ -303,7 +254,7 @@ struct __pixelformat__ pix[] = { FXMESA_DOUBLEBUFFER, FXMESA_ALPHA_SIZE, 8, FXMESA_DEPTH_SIZE, 24, - FXMESA_STENCIL_SIZE, 0, + FXMESA_STENCIL_SIZE, 8, FXMESA_ACCUM_SIZE, 0, FXMESA_NONE} } @@ -331,7 +282,7 @@ static BITMAPINFO *dibBMI; static HBITMAP dibHBM; static HWND dibWnd; -LONG GLAPIENTRY +static LRESULT APIENTRY __wglMonitor(HWND hwnd, UINT message, UINT wParam, LONG lParam) { long ret; /* Now gives the resized window at the end to hWNDOldProc */ @@ -343,6 +294,7 @@ __wglMonitor(HWND hwnd, UINT message, UINT wParam, LONG lParam) break; case WM_DISPLAYCHANGE: case WM_SIZE: +#if 0 if (wParam != SIZE_MINIMIZED) { static int moving = 0; if (!moving) { @@ -361,6 +313,7 @@ __wglMonitor(HWND hwnd, UINT message, UINT wParam, LONG lParam) fxMesaUpdateScreenSize(ctx); } } +#endif break; case WM_ACTIVATE: break; @@ -379,13 +332,13 @@ __wglMonitor(HWND hwnd, UINT message, UINT wParam, LONG lParam) return (ret); } -BOOL GLAPIENTRY +GLAPI BOOL GLAPIENTRY wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) { return (FALSE); } -HGLRC GLAPIENTRY +GLAPI HGLRC GLAPIENTRY wglCreateContext(HDC hdc) { HWND hWnd; @@ -412,7 +365,7 @@ wglCreateContext(HDC hdc) SetWindowLong(hWnd, GWL_WNDPROC, (LONG) __wglMonitor); } -#ifndef FX_SILENT +#ifdef FX_DEBUG freopen("MESA.LOG", "w", stderr); #endif @@ -425,11 +378,11 @@ wglCreateContext(HDC hdc) error = !(ctx = fxMesaCreateBestContext((GLuint) hWnd, cliRect.right, cliRect.bottom, pix[curPFD - 1].mesaAttr)); } - if (getenv("SST_DUALHEAD")) + /*if (getenv("SST_DUALHEAD")) haveDualHead = ((atoi(getenv("SST_DUALHEAD")) == 1) ? GL_TRUE : GL_FALSE); else - haveDualHead = GL_FALSE; + haveDualHead = GL_FALSE;*/ if (error) { SetLastError(0); @@ -445,14 +398,14 @@ wglCreateContext(HDC hdc) return ((HGLRC) 1); } -HGLRC GLAPIENTRY +GLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC hdc, int iLayerPlane) { SetLastError(0); return (NULL); } -BOOL GLAPIENTRY +GLAPI BOOL GLAPIENTRY wglDeleteContext(HGLRC hglrc) { if (ctx && hglrc == (HGLRC) 1) { @@ -471,7 +424,7 @@ wglDeleteContext(HGLRC hglrc) return (FALSE); } -HGLRC GLAPIENTRY +GLAPI HGLRC GLAPIENTRY wglGetCurrentContext(VOID) { if (ctx) @@ -481,7 +434,7 @@ wglGetCurrentContext(VOID) return (NULL); } -HDC GLAPIENTRY +GLAPI HDC GLAPIENTRY wglGetCurrentDC(VOID) { if (ctx) @@ -491,10 +444,11 @@ wglGetCurrentDC(VOID) return (NULL); } -PROC GLAPIENTRY +GLAPI PROC GLAPIENTRY wglGetProcAddress(LPCSTR lpszProc) -{ +{ PROC p = (PROC) _glapi_get_proc_address((const char *) lpszProc); + if (p) return p; @@ -502,7 +456,7 @@ wglGetProcAddress(LPCSTR lpszProc) return (NULL); } -BOOL GLAPIENTRY +GLAPI BOOL GLAPIENTRY wglMakeCurrent(HDC hdc, HGLRC hglrc) { if ((hdc == NULL) && (hglrc == NULL)) @@ -520,7 +474,7 @@ wglMakeCurrent(HDC hdc, HGLRC hglrc) return (TRUE); } -BOOL GLAPIENTRY +GLAPI BOOL GLAPIENTRY wglShareLists(HGLRC hglrc1, HGLRC hglrc2) { if (!ctx || hglrc1 != (HGLRC) 1 || hglrc1 != hglrc2) { @@ -531,19 +485,17 @@ wglShareLists(HGLRC hglrc1, HGLRC hglrc2) return (TRUE); } -BOOL GLAPIENTRY -wglUseFontBitmaps(HDC fontDevice, DWORD firstChar, DWORD numChars, - DWORD listBase) +static BOOL +wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar, DWORD numChars, + DWORD listBase) { -#define VERIFY(a) a - TEXTMETRIC metric; BITMAPINFO *dibInfo; HDC bitDevice; COLORREF tempColor; int i; - VERIFY(GetTextMetrics(fontDevice, &metric)); + GetTextMetrics(fontDevice, &metric); dibInfo = (BITMAPINFO *) calloc(sizeof(BITMAPINFO) + sizeof(RGBQUAD), 1); dibInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); @@ -552,8 +504,6 @@ wglUseFontBitmaps(HDC fontDevice, DWORD firstChar, DWORD numChars, dibInfo->bmiHeader.biCompression = BI_RGB; bitDevice = CreateCompatibleDC(fontDevice); - // HDC bitDevice = CreateDC("DISPLAY", NULL, NULL, NULL); - // VERIFY(bitDevice); // Swap fore and back colors so the bitmap has the right polarity tempColor = GetBkColor(bitDevice); @@ -561,7 +511,7 @@ wglUseFontBitmaps(HDC fontDevice, DWORD firstChar, DWORD numChars, SetTextColor(bitDevice, tempColor); // Place chars based on base line - VERIFY(SetTextAlign(bitDevice, TA_BASELINE) >= 0 ? 1 : 0); + SetTextAlign(bitDevice, TA_BASELINE); for (i = 0; i < (int)numChars; i++) { SIZE size; @@ -574,8 +524,8 @@ wglUseFontBitmaps(HDC fontDevice, DWORD firstChar, DWORD numChars, curChar = (char)(i + firstChar); // [koolsmoky] explicit cast // Find how high/wide this character is - VERIFY(GetTextExtentPoint32(bitDevice, &curChar, 1, &size)); - + GetTextExtentPoint32(bitDevice, &curChar, 1, &size); + // Create the output bitmap charWidth = size.cx; charHeight = size.cy; @@ -586,18 +536,17 @@ wglUseFontBitmaps(HDC fontDevice, DWORD firstChar, DWORD numChars, // Assign the output bitmap to the device origBmap = SelectObject(bitDevice, bitObject); - VERIFY(origBmap); - VERIFY(PatBlt(bitDevice, 0, 0, bmapWidth, bmapHeight, BLACKNESS)); + PatBlt(bitDevice, 0, 0, bmapWidth, bmapHeight, BLACKNESS); // Use our source font on the device - VERIFY(SelectObject(bitDevice, GetCurrentObject(fontDevice, OBJ_FONT))); + SelectObject(bitDevice, GetCurrentObject(fontDevice, OBJ_FONT)); // Draw the character - VERIFY(TextOut(bitDevice, 0, metric.tmAscent, &curChar, 1)); + TextOut(bitDevice, 0, metric.tmAscent, &curChar, 1); // Unselect our bmap object - VERIFY(SelectObject(bitDevice, origBmap)); + SelectObject(bitDevice, origBmap); // Convert the display dependant representation to a 1 bit deep DIB numBytes = (bmapWidth * bmapHeight) / 8; @@ -606,7 +555,6 @@ wglUseFontBitmaps(HDC fontDevice, DWORD firstChar, DWORD numChars, dibInfo->bmiHeader.biHeight = bmapHeight; res = GetDIBits(bitDevice, bitObject, 0, bmapHeight, bmap, dibInfo, DIB_RGB_COLORS); - //VERIFY(res); // Create the GL object glNewList(i + listBase, GL_COMPILE); @@ -623,21 +571,20 @@ wglUseFontBitmaps(HDC fontDevice, DWORD firstChar, DWORD numChars, } // Destroy the DC - VERIFY(DeleteDC(bitDevice)); + DeleteDC(bitDevice); FREE(dibInfo); return TRUE; -#undef VERIFY } -BOOL GLAPIENTRY +GLAPI BOOL GLAPIENTRY wglUseFontBitmapsW(HDC hdc, DWORD first, DWORD count, DWORD listBase) { return (FALSE); } -BOOL GLAPIENTRY +GLAPI BOOL GLAPIENTRY wglUseFontOutlinesA(HDC hdc, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf) @@ -646,7 +593,7 @@ wglUseFontOutlinesA(HDC hdc, DWORD first, DWORD count, return (FALSE); } -BOOL GLAPIENTRY +GLAPI BOOL GLAPIENTRY wglUseFontOutlinesW(HDC hdc, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf) @@ -656,7 +603,7 @@ wglUseFontOutlinesW(HDC hdc, DWORD first, DWORD count, } -BOOL GLAPIENTRY +GLAPI BOOL GLAPIENTRY wglSwapLayerBuffers(HDC hdc, UINT fuPlanes) { if (ctx && WindowFromDC(hdc) == hWND) { @@ -669,11 +616,46 @@ wglSwapLayerBuffers(HDC hdc, UINT fuPlanes) return (FALSE); } -int GLAPIENTRY -wglChoosePixelFormat(HDC hdc, CONST PIXELFORMATDESCRIPTOR * ppfd) +GLAPI int GLAPIENTRY +wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR * ppfd) { int i, best = -1, qt_valid_pix; +#if 0 + FILE *pix_file; + pix_file = fopen("pix_log.txt", "a"); + if (pix_file) { + fprintf(pix_file, "wglChoosePixelFormat\n"); + fprintf(pix_file, "nSize = %d\n",ppfd->nSize); + fprintf(pix_file, "nVersion = %d\n",ppfd->nVersion); + fprintf(pix_file, "dwFlags = %d\n",ppfd->dwFlags); + fprintf(pix_file, "iPixelType = %d\n",ppfd->iPixelType); + fprintf(pix_file, "cColorBits = %d\n",ppfd->cColorBits); + fprintf(pix_file, "cRedBits = %d\n",ppfd->cRedBits); + fprintf(pix_file, "cRedShift = %d\n",ppfd->cRedShift); + fprintf(pix_file, "cGreenBits = %d\n",ppfd->cGreenBits); + fprintf(pix_file, "cGreenShift = %d\n",ppfd->cGreenShift); + fprintf(pix_file, "cBlueBits = %d\n",ppfd->cBlueBits); + fprintf(pix_file, "cBlueShift = %d\n",ppfd->cBlueShift); + fprintf(pix_file, "cAlphaBits = %d\n",ppfd->cAlphaBits); + fprintf(pix_file, "cAlphaShift = %d\n",ppfd->cAlphaShift); + fprintf(pix_file, "cAccumBits = %d\n",ppfd->cAccumBits); + fprintf(pix_file, "cAccumRedBits = %d\n",ppfd->cAccumRedBits); + fprintf(pix_file, "cAccumGreenBits = %d\n",ppfd->cAccumGreenBits); + fprintf(pix_file, "cAccumBlueBits = %d\n",ppfd->cAccumBlueBits); + fprintf(pix_file, "cAccumAlphaBits = %d\n",ppfd->cAccumAlphaBits); + fprintf(pix_file, "cDepthBits = %d\n",ppfd->cDepthBits); + fprintf(pix_file, "cStencilBits = %d\n",ppfd->cStencilBits); + fprintf(pix_file, "cAuxBuffers = %d\n",ppfd->cAuxBuffers); + fprintf(pix_file, "iLayerType = %d\n",ppfd->iLayerType); + fprintf(pix_file, "bReserved = %d\n",ppfd->bReserved); + fprintf(pix_file, "dwLayerMask = %d\n",ppfd->dwLayerMask); + fprintf(pix_file, "dwVisibleMask = %d\n",ppfd->dwVisibleMask); + fprintf(pix_file, "dwDamageMask = %d\n",ppfd->dwDamageMask); + } + fclose(pix_file); +#endif + qt_valid_pix = qt_pix; if (ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR) || ppfd->nVersion != 1) { @@ -706,6 +688,11 @@ wglChoosePixelFormat(HDC hdc, CONST PIXELFORMATDESCRIPTOR * ppfd) if (ppfd->cAlphaBits > 0 && pix[i].pfd.cAlphaBits == 0) continue; /* need alpha buffer */ +#if 0 + if ((ppfd->cColorBits == 32) && (ppfd->cStencilBits > 0 && pix[i].pfd.cStencilBits == 0)) + continue; /* need stencil */ +#endif + if (ppfd->iPixelType == pix[i].pfd.iPixelType) { best = i + 1; break; @@ -720,13 +707,14 @@ wglChoosePixelFormat(HDC hdc, CONST PIXELFORMATDESCRIPTOR * ppfd) return (best); } -int GLAPIENTRY -ChoosePixelFormat(HDC hdc, CONST PIXELFORMATDESCRIPTOR * ppfd) +GLAPI int GLAPIENTRY +ChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR * ppfd) { + return wglChoosePixelFormat(hdc, ppfd); } -int GLAPIENTRY +GLAPI int GLAPIENTRY wglDescribePixelFormat(HDC hdc, int iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd) { @@ -746,14 +734,14 @@ wglDescribePixelFormat(HDC hdc, int iPixelFormat, UINT nBytes, return (qt_valid_pix); } -int GLAPIENTRY +GLAPI int GLAPIENTRY DescribePixelFormat(HDC hdc, int iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd) { return wglDescribePixelFormat(hdc, iPixelFormat, nBytes, ppfd); } -int GLAPIENTRY +GLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc) { if (curPFD == 0) { @@ -764,15 +752,14 @@ wglGetPixelFormat(HDC hdc) return (curPFD); } -int GLAPIENTRY +GLAPI int GLAPIENTRY GetPixelFormat(HDC hdc) { return wglGetPixelFormat(hdc); } -BOOL GLAPIENTRY -wglSetPixelFormat(HDC hdc, int iPixelFormat, - CONST PIXELFORMATDESCRIPTOR * ppfd) +GLAPI BOOL GLAPIENTRY +wglSetPixelFormat(HDC hdc, int iPixelFormat, const PIXELFORMATDESCRIPTOR * ppfd) { int qt_valid_pix; @@ -788,7 +775,7 @@ wglSetPixelFormat(HDC hdc, int iPixelFormat, return (TRUE); } -BOOL GLAPIENTRY +GLAPI BOOL GLAPIENTRY wglSwapBuffers(HDC hdc) { if (!ctx) { @@ -801,16 +788,152 @@ wglSwapBuffers(HDC hdc) return (TRUE); } -BOOL GLAPIENTRY -SetPixelFormat(HDC hdc, int iPixelFormat, CONST PIXELFORMATDESCRIPTOR * ppfd) +GLAPI BOOL GLAPIENTRY +SetPixelFormat(HDC hdc, int iPixelFormat, const PIXELFORMATDESCRIPTOR * ppfd) { return wglSetPixelFormat(hdc, iPixelFormat, ppfd); } -BOOL GLAPIENTRY +GLAPI BOOL GLAPIENTRY SwapBuffers(HDC hdc) { return wglSwapBuffers(hdc); } +static FIXED FixedFromDouble(double d) +{ + long l = (long) (d * 65536L); + return *(FIXED *)&l; +} + +/* +** This was yanked from windows/gdi/wgl.c +*/ +GLAPI BOOL GLAPIENTRY +wglUseFontBitmapsA(HDC hdc, DWORD first, DWORD count, DWORD listBase) +{ + int i; + GLuint font_list; + DWORD size; + GLYPHMETRICS gm; + HANDLE hBits; + LPSTR lpBits; + MAT2 mat; + int success = TRUE; + + if (first<0) + return FALSE; + if (count<0) + return FALSE; + if (listBase<0) + return FALSE; + + font_list = listBase; + + mat.eM11 = FixedFromDouble(1); + mat.eM12 = FixedFromDouble(0); + mat.eM21 = FixedFromDouble(0); + mat.eM22 = FixedFromDouble(-1); + + memset(&gm,0,sizeof(gm)); + + /* + ** If we can't get the glyph outline, it may be because this is a fixed + ** font. Try processing it that way. + */ + if( GetGlyphOutline(hdc, first, GGO_BITMAP, &gm, 0, NULL, &mat) + == GDI_ERROR ) + { + return wglUseFontBitmaps_FX( hdc, first, count, listBase ); + } + + /* + ** Otherwise process all desired characters. + */ + for (i = 0; i < count; i++) + { + DWORD err; + + glNewList( font_list+i, GL_COMPILE ); + + /* allocate space for the bitmap/outline */ + size = GetGlyphOutline(hdc, first + i, GGO_BITMAP, &gm, 0, NULL, &mat); + if (size == GDI_ERROR) + { + glEndList( ); + err = GetLastError(); + success = FALSE; + continue; + } + + hBits = GlobalAlloc(GHND, size+1); + lpBits = GlobalLock(hBits); + + err = GetGlyphOutline(hdc, /* handle to device context */ + first + i, /* character to query */ + GGO_BITMAP, /* format of data to return */ + &gm, /* pointer to structure for metrics*/ + size, /* size of buffer for data */ + lpBits, /* pointer to buffer for data */ + &mat /* pointer to transformation */ + /* matrix structure */ + ); + + if (err == GDI_ERROR) + { + GlobalUnlock(hBits); + GlobalFree(hBits); + + glEndList( ); + err = GetLastError(); + success = FALSE; + continue; + } + + glBitmap(gm.gmBlackBoxX,gm.gmBlackBoxY, + -gm.gmptGlyphOrigin.x, + gm.gmptGlyphOrigin.y, + gm.gmCellIncX,gm.gmCellIncY, + (const GLubyte * )lpBits); + + GlobalUnlock(hBits); + GlobalFree(hBits); + + glEndList( ); + } + + return success; +} + +GLAPI BOOL GLAPIENTRY +wglDescribeLayerPlane(HDC hdc, int iPixelFormat, int iLayerPlane, + UINT nBytes, LPLAYERPLANEDESCRIPTOR ppfd) +{ + SetLastError(0); + return (FALSE); +} + +GLAPI int GLAPIENTRY +wglGetLayerPaletteEntries(HDC hdc, int iLayerPlane, int iStart, + int cEntries, CONST COLORREF *pcr) +{ + SetLastError(0); + return (FALSE); +} + +GLAPI BOOL GLAPIENTRY +wglRealizeLayerPalette(HDC hdc,int iLayerPlane,BOOL bRealize) +{ + SetLastError(0); + return(FALSE); +} + +GLAPI int GLAPIENTRY +wglSetLayerPaletteEntries(HDC hdc,int iLayerPlane, int iStart, + int cEntries, CONST COLORREF *pcr) +{ + SetLastError(0); + return(FALSE); +} + #endif /* FX */ diff --git a/src/mesa/x86/assyntax.h b/src/mesa/x86/assyntax.h index 6ee6ac6c29e..53e554728d8 100644 --- a/src/mesa/x86/assyntax.h +++ b/src/mesa/x86/assyntax.h @@ -1,4 +1,4 @@ -/* $Id: assyntax.h,v 1.21 2002/06/11 01:26:58 brianp Exp $ */ +/* $Id: assyntax.h,v 1.22 2003/10/02 17:36:45 brianp Exp $ */ #ifndef __ASSYNTAX_H__ #define __ASSYNTAX_H__ @@ -254,7 +254,7 @@ #endif /* ACK_ASSEMBLER */ -#if defined(__QNX__) || defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || defined(__ELF__) || defined(__GNU__) || defined(__GNUC__) && !defined(DJGPP) +#if defined(__QNX__) || defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || defined(__ELF__) || defined(__GNU__) || defined(__GNUC__) && !defined(__DJGPP__) && !defined(__MINGW32__) #define GLNAME(a) a #else #define GLNAME(a) CONCAT(_,a) -- cgit v1.2.3 From ad5cd6d337589af1a5cd03a93baf943745db583c Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Fri, 10 Oct 2003 22:09:05 +0000 Subject: Add missing entry points. (Warren Cashen) --- include/GL/glu_mangle.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/GL/glu_mangle.h b/include/GL/glu_mangle.h index 4cc9b6f044c..9c25aa864c1 100644 --- a/include/GL/glu_mangle.h +++ b/include/GL/glu_mangle.h @@ -80,5 +80,7 @@ #define gluBuild3DMipmaps mgluBuild3DMipmaps #define gluCheckExtension mgluCheckExtension #define gluUnProject4 mgluUnProject4 +#define gluNurbsCallbackData mgluNurbsCallbackData +#define gluNurbsCallbackDataEXT mgluNurbsCallbackDataEXT #endif -- cgit v1.2.3 From 596d57c42a24430e72e225c051270918d0b2e864 Mon Sep 17 00:00:00 2001 From: Kendall Bennett Date: Tue, 14 Oct 2003 23:48:57 +0000 Subject: Updates to SGI GLU code to get it to compile clean with the Open Watcom compiler. Most of the changes were to get rid of warnings, but many of the warnings could not be removed in the code so I also added #pragma's to disable the warnings. Someone really should clean up this code, but I didn't want to mess with it that much (and potentially break it). --- include/GL/glu.h | 2 +- src/glu/sgi/include/gluos.h | 28 +- src/glu/sgi/libnurbs/interface/bezierEval.cc | 40 +- src/glu/sgi/libnurbs/interface/glrenderer.cc | 58 +- src/glu/sgi/libnurbs/interface/glsurfeval.cc | 404 +- src/glu/sgi/libnurbs/internals/arc.cc | 71 +- src/glu/sgi/libnurbs/internals/basiccrveval.cc | 30 +- src/glu/sgi/libnurbs/internals/basicsurfeval.cc | 56 +- src/glu/sgi/libnurbs/internals/coveandtiler.cc | 84 +- src/glu/sgi/libnurbs/internals/knotvector.cc | 41 +- src/glu/sgi/libnurbs/nurbtess/directedLine.cc | 122 +- src/glu/sgi/libnurbs/nurbtess/polyDBG.cc | 111 +- src/glu/sgi/libtess/geom.h | 21 +- src/glu/sgi/libtess/normal.c | 19 +- src/glu/sgi/libtess/sweep.c | 60 +- src/glu/sgi/libtess/tess.c | 49 +- src/glu/sgi/libutil/mipmap.c | 4554 ++++++++++++----------- src/glu/sgi/libutil/quad.c | 79 +- 18 files changed, 2935 insertions(+), 2894 deletions(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index 5eaa5547482..719feb1aed0 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -266,7 +266,7 @@ typedef GLUtesselator GLUtriangulatorObj; #define GLU_TESS_MAX_COORD 1.0e150 /* Internal convenience typedefs */ -typedef void (GLAPIENTRY *_GLUfuncptr)(); +typedef void (GLAPIENTRYP _GLUfuncptr)(); GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb); GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess); diff --git a/src/glu/sgi/include/gluos.h b/src/glu/sgi/include/gluos.h index dd0bd79b0de..b91b9c5c06f 100644 --- a/src/glu/sgi/include/gluos.h +++ b/src/glu/sgi/include/gluos.h @@ -1,18 +1,38 @@ /* ** gluos.h - operating system dependencies for GLU ** -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/include/gluos.h,v 1.5 2003/02/12 16:04:07 brianp Exp $ +** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/include/gluos.h,v 1.6 2003/10/14 23:48:57 kendallb Exp $ */ #ifdef __VMS -#ifdef __cplusplus +#ifdef __cplusplus #pragma message disable nocordel #pragma message disable codeunreachable #pragma message disable codcauunr #endif #endif -#ifdef _WIN32 -#include /* For _MAX_PATH definition */ +#ifdef __WATCOMC__ +/* Disable *lots* of warnings to get a clean build. I can't be bothered fixing the + * code at the moment, as it is pretty ugly. + */ +#pragma warning 7 10 +#pragma warning 13 10 +#pragma warning 14 10 +#pragma warning 367 10 +#pragma warning 379 10 +#pragma warning 726 10 +#pragma warning 836 10 +#endif + +#ifdef BUILD_FOR_SNAP + +#include +#include +#include + +#elif defined(_WIN32) + +#include /* For _MAX_PATH definition */ #include #include diff --git a/src/glu/sgi/libnurbs/interface/bezierEval.cc b/src/glu/sgi/libnurbs/interface/bezierEval.cc index a1bbbf52a78..c72d64f787f 100644 --- a/src/glu/sgi/libnurbs/interface/bezierEval.cc +++ b/src/glu/sgi/libnurbs/interface/bezierEval.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -31,10 +31,10 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/11/29 16:16:55 $ $Revision: 1.2 $ +** $Date: 2003/10/14 23:48:57 $ $Revision: 1.3 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/bezierEval.cc,v 1.2 2001/11/29 16:16:55 kschultz Exp $ +** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/bezierEval.cc,v 1.3 2003/10/14 23:48:57 kendallb Exp $ */ #include @@ -43,6 +43,10 @@ #include #include "bezierEval.h" +#ifdef __WATCOMC__ +#pragma warning 14 10 +#endif + #define TOLERANCE 0.0001 #ifndef MAX_ORDER @@ -88,7 +92,7 @@ void bezierCurveEval(float u0, float u1, int order, float *ctlpoints, int stride } } - + /*order = degree +1 >=1. */ @@ -109,7 +113,7 @@ void bezierCurveEvalfast(float u0, float u1, int order, float *ctlpoints, int st buf[r][i][j] = (1-uprime)*buf[r-1][i][j] + uprime*buf[r-1][i+1][j]; } } - + for(j=0; j=3 && dimension <=4); bezierSurfEvalDerGen(1,0, u0, u1, uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u, v, partialU); bezierSurfEvalDerGen(0,1, u0, u1, uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u, v, partialV); - + if(dimension == 3){/*inhomogeneous*/ crossProduct(partialU, partialV, retNormal); @@ -215,11 +219,11 @@ void bezierSurfEvalNormal(float u0, float u1, int uorder, float v0, float v1, in float newPartialU[MAX_DIMENSION]; float newPartialV[MAX_DIMENSION]; int i; - bezierSurfEvalDerGen(0,0, u0, u1, uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u, v, val); + bezierSurfEvalDerGen(0,0, u0, u1, uorder, v0, v1, vorder, dimension, ctlpoints, ustride, vstride, u, v, val); for(i=0; i<=2; i++){ newPartialU[i] = partialU[i] * val[3] - val[i] * partialU[3]; - newPartialV[i] = partialV[i] * val[3] - val[i] * partialV[3]; + newPartialV[i] = partialV[i] * val[3] - val[i] * partialV[3]; } crossProduct(newPartialU, newPartialV, retNormal); normalize(retNormal); @@ -231,7 +235,7 @@ static void normalize(float vec[3]) { float size = (float)sqrt(vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]); - if(size < TOLERANCE) + if(size < TOLERANCE) { #ifdef DEBUG fprintf(stderr, "Warning: in oglBSpline.c normal is 0\n"); @@ -244,7 +248,7 @@ static void normalize(float vec[3]) vec[2] = vec[2]/size; } } - + static void crossProduct(float x[3], float y[3], float ret[3]) { diff --git a/src/glu/sgi/libnurbs/interface/glrenderer.cc b/src/glu/sgi/libnurbs/interface/glrenderer.cc index 15bea9c212e..7c9da9f45b1 100644 --- a/src/glu/sgi/libnurbs/interface/glrenderer.cc +++ b/src/glu/sgi/libnurbs/interface/glrenderer.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -31,10 +31,10 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ +** $Date: 2003/10/14 23:48:57 $ $Revision: 1.2 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glrenderer.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $ +** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glrenderer.cc,v 1.2 2003/10/14 23:48:57 kendallb Exp $ */ #include "gluos.h" @@ -99,7 +99,7 @@ GLUnurbs::GLUnurbs() //default autoloadmode is true autoloadmode = 1; - //default callbackFlag is 0 + //default callbackFlag is 0 callbackFlag = 0; errorCallback = NULL; @@ -127,8 +127,8 @@ GLUnurbs::errorHandler(int i) postError( gluError ); } -void -GLUnurbs::loadGLMatrices(void) +void +GLUnurbs::loadGLMatrices(void) { GLfloat vmat[4][4]; GLint viewport[4]; @@ -140,20 +140,20 @@ GLUnurbs::loadGLMatrices(void) } void -GLUnurbs::useGLMatrices(const GLfloat modelMatrix[16], +GLUnurbs::useGLMatrices(const GLfloat modelMatrix[16], const GLfloat projMatrix[16], const GLint viewport[4]) { GLfloat vmat[4][4]; - multmatrix4d(vmat, (const GLfloat (*)[4]) modelMatrix, + multmatrix4d(vmat, (const GLfloat (*)[4]) modelMatrix, (const GLfloat (*)[4]) projMatrix); loadCullingMatrix((GLfloat (*)[4]) vmat); loadSamplingMatrix((const GLfloat (*)[4]) vmat, (const GLint *) viewport); } /*-------------------------------------------------------------------------- - * grabGLMatrix + * grabGLMatrix *-------------------------------------------------------------------------- */ @@ -164,8 +164,8 @@ GLUnurbs::grabGLMatrix(GLfloat vmat[4][4]) ::glGetFloatv((GLenum) GL_MODELVIEW_MATRIX, (GLfloat *) &(m1[0][0])); ::glGetFloatv((GLenum) GL_PROJECTION_MATRIX, (GLfloat *) &(m2[0][0])); - multmatrix4d((GLfloat (*)[4]) vmat, - (GLfloat (*)[4]) m1, (GLfloat (*)[4]) m2); + multmatrix4d((GLfloat (*)[4]) vmat, + (const GLfloat (*)[4]) m1, (const GLfloat (*)[4]) m2); } //for object space tesselation: view independent @@ -180,27 +180,27 @@ GLUnurbs::setSamplingMatrixIdentity( void ) }; const long rstride = sizeof(smat[0]) / sizeof(smat[0][0]); const long cstride = 1; - - setnurbsproperty(GL_MAP1_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride, + + setnurbsproperty(GL_MAP1_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride, cstride); - setnurbsproperty(GL_MAP1_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride, + setnurbsproperty(GL_MAP1_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride, cstride); - setnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride, + setnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride, cstride); - setnurbsproperty(GL_MAP2_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride, + setnurbsproperty(GL_MAP2_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride, cstride); } void -GLUnurbs::loadSamplingMatrix(const GLfloat vmat[4][4], +GLUnurbs::loadSamplingMatrix(const GLfloat vmat[4][4], const GLint viewport[4]) { /* rescale the mapping to correspond to pixels in x/y */ REAL xsize = 0.5 * (REAL) (viewport[2]); REAL ysize = 0.5 * (REAL) (viewport[3]); - + INREAL smat[4][4]; smat[0][0] = vmat[0][0] * xsize; smat[1][0] = vmat[1][0] * xsize; @@ -225,13 +225,13 @@ GLUnurbs::loadSamplingMatrix(const GLfloat vmat[4][4], const long rstride = sizeof(smat[0]) / sizeof(smat[0][0]); const long cstride = 1; - setnurbsproperty(GL_MAP1_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride, + setnurbsproperty(GL_MAP1_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride, cstride); - setnurbsproperty(GL_MAP1_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride, + setnurbsproperty(GL_MAP1_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride, cstride); - setnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride, + setnurbsproperty(GL_MAP2_VERTEX_3, N_SAMPLINGMATRIX, &smat[0][0], rstride, cstride); - setnurbsproperty(GL_MAP2_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride, + setnurbsproperty(GL_MAP2_VERTEX_4, N_SAMPLINGMATRIX, &smat[0][0], rstride, cstride); } @@ -263,14 +263,14 @@ GLUnurbs::loadCullingMatrix(GLfloat vmat[4][4]) const long rstride = sizeof(cmat[0]) / sizeof(cmat[0][0]); const long cstride = 1; - setnurbsproperty(GL_MAP2_VERTEX_3, N_CULLINGMATRIX, &cmat[0][0], rstride, + setnurbsproperty(GL_MAP2_VERTEX_3, N_CULLINGMATRIX, &cmat[0][0], rstride, cstride); - setnurbsproperty(GL_MAP2_VERTEX_4, N_CULLINGMATRIX, &cmat[0][0], rstride, + setnurbsproperty(GL_MAP2_VERTEX_4, N_CULLINGMATRIX, &cmat[0][0], rstride, cstride); //added for curves by zl - setnurbsproperty(GL_MAP1_VERTEX_3, N_CULLINGMATRIX, &cmat[0][0], rstride, + setnurbsproperty(GL_MAP1_VERTEX_3, N_CULLINGMATRIX, &cmat[0][0], rstride, cstride); - setnurbsproperty(GL_MAP1_VERTEX_4, N_CULLINGMATRIX, &cmat[0][0], rstride, + setnurbsproperty(GL_MAP1_VERTEX_4, N_CULLINGMATRIX, &cmat[0][0], rstride, cstride); } diff --git a/src/glu/sgi/libnurbs/interface/glsurfeval.cc b/src/glu/sgi/libnurbs/interface/glsurfeval.cc index 3f6ff87942e..6f63aff44bc 100644 --- a/src/glu/sgi/libnurbs/interface/glsurfeval.cc +++ b/src/glu/sgi/libnurbs/interface/glsurfeval.cc @@ -35,8 +35,8 @@ /* * glsurfeval.c++ * - * $Date: 2001/07/16 15:46:42 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glsurfeval.cc,v 1.2 2001/07/16 15:46:42 brianp Exp $ + * $Date: 2003/10/14 23:48:57 $ $Revision: 1.3 $ + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glsurfeval.cc,v 1.3 2003/10/14 23:48:57 kendallb Exp $ */ /* Polynomial Evaluator Interface */ @@ -58,14 +58,14 @@ /*#define NO_EVALUATION*/ //#define USE_LOD //for LOD test, have to turn on USE_LOD in insurfeval.c++ too - + /*for statistics*/ //#define STATISTICS #ifdef STATISTICS static int STAT_num_of_triangles=0; static int STAT_num_of_eval_vertices=0; static int STAT_num_of_quad_strips=0; -#endif +#endif /*for output triangles*/ /*#define OUTPUT_TRIANGLES*/ @@ -74,16 +74,16 @@ static int STAT_num_of_quad_strips=0; /*#define FOR_CHRIS*/ #ifdef FOR_CHRIS extern "C" { void evalUStripExt(int n_upper, REAL v_upper, REAL* upper_val, - int n_lower, REAL v_lower, REAL* lower_val);} + int n_lower, REAL v_lower, REAL* lower_val);} extern "C" { void evalVStripExt(int n_left, REAL u_left, REAL* left_val, - int n_right, REAL u_right, REAL* right_val); + int n_right, REAL u_right, REAL* right_val); } #endif /**************begin for LOD_eval_list***********/ -void OpenGLSurfaceEvaluator::LOD_eval_list(int level) +void OpenGLSurfaceEvaluator::LOD_eval_list(int level) { if(level == 0) LOD_eval_level = 1; @@ -98,8 +98,8 @@ void OpenGLSurfaceEvaluator::LOD_eval_list(int level) } -OpenGLSurfaceEvaluator::OpenGLSurfaceEvaluator() -{ +OpenGLSurfaceEvaluator::OpenGLSurfaceEvaluator() +{ int i; for (i=0; i= n_upper) /*case1: no more in upper*/ - { - if(j= n_lower) /*case2: no more in lower*/ - { - if(i=i; k--) /*reverse order for two-side lighting*/ + + for(k=n_upper-1; k>=i; k--) /*reverse order for two-side lighting*/ { coord2f(upper_val[k], v_upper); // glNormal3fv(upperNormal[k]); // glVertex3fv(upperXYZ[k]); } - endtfan(); - } - break; /*exit the main loop*/ - } + endtfan(); + } + break; /*exit the main loop*/ + } else /* case3: neither is empty, plus the leftMostV, there is at least one triangle to output*/ - { - if(upper_val[i] <= lower_val[j]) - { + { + if(upper_val[i] <= lower_val[j]) + { bgntfan(); coord2f(lower_val[j], v_lower); // glNormal3fv(lowerNormal[j]); // glVertex3fv(lowerXYZ[j]); - /*find the last k>=i such that - *upperverts[k][0] <= lowerverts[j][0] - */ - k=i; + /*find the last k>=i such that + *upperverts[k][0] <= lowerverts[j][0] + */ + k=i; - while(k lower_val[j]) - break; - k++; + while(k lower_val[j]) + break; + k++; - } - k--; + } + k--; - for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/ - { + for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/ + { coord2f(upper_val[l], v_upper); // glNormal3fv(upperNormal[l]); // glVertex3fv(upperXYZ[l]); - } + } coord2f(leftMostV[0], leftMostV[1]); // glNormal3fv(leftMostNormal); // glVertex3fv(leftMostXYZ); - endtfan(); + endtfan(); - /*update i and leftMostV for next loop - */ - i = k+1; + /*update i and leftMostV for next loop + */ + i = k+1; leftMostV[0] = upper_val[k]; leftMostV[1] = v_upper; // leftMostNormal = upperNormal[k]; // leftMostXYZ = upperXYZ[k]; - } - else /*upperVerts[i][0] > lowerVerts[j][0]*/ - { + } + else /*upperVerts[i][0] > lowerVerts[j][0]*/ + { bgntfan(); coord2f(upper_val[i], v_upper); // glNormal3fv(upperNormal[i]); // glVertex3fv(upperXYZ[i]); - + coord2f(leftMostV[0], leftMostV[1]); -// glNormal3fv(leftMostNormal); +// glNormal3fv(leftMostNormal); // glVertex3fv(leftMostXYZ); - - - /*find the last k>=j such that - *lowerverts[k][0] < upperverts[i][0] - */ - k=j; - while(k< n_lower) - { - if(lower_val[k] >= upper_val[i]) - break; + + + /*find the last k>=j such that + *lowerverts[k][0] < upperverts[i][0] + */ + k=j; + while(k< n_lower) + { + if(lower_val[k] >= upper_val[i]) + break; coord2f(lower_val[k], v_lower); // glNormal3fv(lowerNormal[k]); // glVertex3fv(lowerXYZ[k]); - k++; - } - endtfan(); + k++; + } + endtfan(); - /*update j and leftMostV for next loop - */ - j=k; + /*update j and leftMostV for next loop + */ + j=k; leftMostV[0] = lower_val[j-1]; leftMostV[1] = v_lower; // leftMostNormal = lowerNormal[j-1]; // leftMostXYZ = lowerXYZ[j-1]; - } - } + } + } } - //clean up + //clean up // free(upperXYZ); // free(lowerXYZ); // free(upperNormal); @@ -526,7 +526,7 @@ OpenGLSurfaceEvaluator::evalUStrip(int n_upper, REAL v_upper, REAL* upper_val, i #endif } - + void OpenGLSurfaceEvaluator::evalVStrip(int n_left, REAL u_left, REAL* left_val, int n_right, REAL u_right, REAL* right_val) @@ -548,11 +548,11 @@ OpenGLSurfaceEvaluator::evalVStrip(int n_left, REAL u_left, REAL* left_val, int /* *the algorithm works by scanning from bot to top. *botMostV: the bot most of the remaining verteces (on both left and right). - * it could an element of leftVerts or rightVerts. - *i: leftVerts[i] is the first vertex to the top of botMostV on left line + * it could an element of leftVerts or rightVerts. + *i: leftVerts[i] is the first vertex to the top of botMostV on left line *j: rightVerts[j] is the first vertex to the top of botMostV on rightline */ - + /*initialize i,j,and botMostV */ if(left_val[0] <= right_val[0]) @@ -573,142 +573,142 @@ OpenGLSurfaceEvaluator::evalVStrip(int n_left, REAL u_left, REAL* left_val, int } /*the main loop. - *the invariance is that: - *at the beginning of each loop, the meaning of i,j,and botMostV are + *the invariance is that: + *at the beginning of each loop, the meaning of i,j,and botMostV are *maintained */ while(1) { if(i >= n_left) /*case1: no more in left*/ - { - if(j= n_right) /*case2: no more in right*/ - { - if(i=i; k--) /*reverse order for two-side lighting*/ + + for(k=n_left-1; k>=i; k--) /*reverse order for two-side lighting*/ { coord2f(u_left, left_val[k]); // glNormal3fv(leftNormal[k]); // glVertex3fv(leftXYZ[k]); } - endtfan(); - } - break; /*exit the main loop*/ - } + endtfan(); + } + break; /*exit the main loop*/ + } else /* case3: neither is empty, plus the botMostV, there is at least one triangle to output*/ - { - if(left_val[i] <= right_val[j]) - { + { + if(left_val[i] <= right_val[j]) + { bgntfan(); coord2f(u_right, right_val[j]); // glNormal3fv(rightNormal[j]); // glVertex3fv(rightXYZ[j]); - /*find the last k>=i such that - *leftverts[k][0] <= rightverts[j][0] - */ - k=i; + /*find the last k>=i such that + *leftverts[k][0] <= rightverts[j][0] + */ + k=i; - while(k right_val[j]) - break; - k++; + while(k right_val[j]) + break; + k++; - } - k--; + } + k--; - for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/ - { + for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/ + { coord2f(u_left, left_val[l]); // glNormal3fv(leftNormal[l]); // glVertex3fv(leftXYZ[l]); - } + } coord2f(botMostV[0], botMostV[1]); // glNormal3fv(botMostNormal); // glVertex3fv(botMostXYZ); - endtfan(); + endtfan(); - /*update i and botMostV for next loop - */ - i = k+1; + /*update i and botMostV for next loop + */ + i = k+1; botMostV[0] = u_left; botMostV[1] = left_val[k]; // botMostNormal = leftNormal[k]; // botMostXYZ = leftXYZ[k]; - } - else /*left_val[i] > right_val[j])*/ - { + } + else /*left_val[i] > right_val[j])*/ + { bgntfan(); coord2f(u_left, left_val[i]); // glNormal3fv(leftNormal[i]); // glVertex3fv(leftXYZ[i]); - + coord2f(botMostV[0], botMostV[1]); -// glNormal3fv(botMostNormal); +// glNormal3fv(botMostNormal); // glVertex3fv(botMostXYZ); - - - /*find the last k>=j such that - *rightverts[k][0] < leftverts[i][0] - */ - k=j; - while(k< n_right) - { - if(right_val[k] >= left_val[i]) - break; + + + /*find the last k>=j such that + *rightverts[k][0] < leftverts[i][0] + */ + k=j; + while(k< n_right) + { + if(right_val[k] >= left_val[i]) + break; coord2f(u_right, right_val[k]); // glNormal3fv(rightNormal[k]); // glVertex3fv(rightXYZ[k]); - k++; - } - endtfan(); + k++; + } + endtfan(); - /*update j and botMostV for next loop - */ - j=k; + /*update j and botMostV for next loop + */ + j=k; botMostV[0] = u_right; botMostV[1] = right_val[j-1]; // botMostNormal = rightNormal[j-1]; // botMostXYZ = rightXYZ[j-1]; - } - } + } + } } - //clean up + //clean up // free(leftXYZ); // free(leftNormal); // free(rightXYZ); // free(rightNormal); #endif } - + void OpenGLSurfaceEvaluator::bgnqstrip(void) @@ -742,25 +742,25 @@ OpenGLSurfaceEvaluator::bgnmap2f(long) { if(output_triangles) { - /*deallocate the space which may has been + /*deallocate the space which may has been *allocated by global_bpm previously */ if(global_bpm != NULL) { bezierPatchMeshListDelete(global_bpm); global_bpm = NULL; } - + /* auto_normal_flag = 1; //always output normal in callback mode. - //we could have used the following code, - //but Inspector doesn't have gl context - //before it calls tessellator. - //this way is temporary. + //we could have used the following code, + //but Inspector doesn't have gl context + //before it calls tessellator. + //this way is temporary. */ //NEWCALLBACK //if one of the two normal callback functions are set, - //then set + //then set if(normalCallBackN != NULL || normalCallBackData != NULL) auto_normal_flag = 1; @@ -777,19 +777,19 @@ OpenGLSurfaceEvaluator::bgnmap2f(long) if(glIsEnabled(GL_AUTO_NORMAL) == GL_TRUE) auto_normal_flag = 1; else if (callback_auto_normal == 1) - auto_normal_flag = 1; + auto_normal_flag = 1; else auto_normal_flag = 0; */ //NEWCALLBACK: no need to worry about gl states when gling clalback } - else + else { glPushAttrib((GLbitfield) GL_EVAL_BIT); - + /*to avoid side effect, we restor the opengl state for GL_POLYGON_MODE - */ + */ glGetIntegerv(GL_POLYGON_MODE, gl_polygon_mode); } @@ -806,17 +806,17 @@ OpenGLSurfaceEvaluator::endmap2f(void) if(output_triangles) { //bezierPatchMeshListDelDeg(global_bpm); - + // bezierPatchMeshListEval(global_bpm); //surfcount++; //printf("surfcount=%i\n", surfcount); //if(surfcount == 8) exit(0); - + inBPMListEvalEM(global_bpm); - - - + + + /* global_bpm = bezierPatchMeshListReverse(global_bpm); { @@ -837,7 +837,7 @@ OpenGLSurfaceEvaluator::endmap2f(void) //bezierPatchMeshListPrint(global_bpm); //bezierPatchMeshListDraw(global_bpm); -// printf("num triangles=%i\n", bezierPatchMeshListNumTriangles(global_bpm)); +// printf("num triangles=%i\n", bezierPatchMeshListNumTriangles(global_bpm)); #ifdef USE_LOD #else @@ -873,20 +873,20 @@ glPopAttrib(); void OpenGLSurfaceEvaluator::map2f( long _type, - REAL _ulower, /* u lower domain coord */ + REAL _ulower, /* u lower domain coord */ REAL _uupper, /* u upper domain coord */ long _ustride, /* interpoint distance */ long _uorder, /* parametric order */ - REAL _vlower, /* v lower domain coord */ - REAL _vupper, /* v upper domain coord */ + REAL _vlower, /* v lower domain coord */ + REAL _vupper, /* v upper domain coord */ long _vstride, /* interpoint distance */ long _vorder, /* parametric order */ - REAL *pts) /* control points */ + REAL *pts) /* control points */ { #ifdef USE_INTERNAL_EVAL - inMap2f((int) _type, (REAL) _ulower, (REAL) _uupper, - (int) _ustride, (int) _uorder, (REAL) _vlower, - (REAL) _vupper, (int) _vstride, (int) _vorder, + inMap2f((int) _type, (REAL) _ulower, (REAL) _uupper, + (int) _ustride, (int) _uorder, (REAL) _vlower, + (REAL) _vupper, (int) _vstride, (int) _vorder, (REAL *) pts); #else @@ -897,7 +897,7 @@ OpenGLSurfaceEvaluator::map2f( if(global_bpm == NULL) global_bpm = bezierPatchMeshMake2(10,10); if( - (global_bpm->bpatch == NULL && + (global_bpm->bpatch == NULL && (_type == GL_MAP2_VERTEX_3 || _type == GL_MAP2_VERTEX_4)) || (global_bpm->bpatch_normal == NULL && @@ -922,7 +922,7 @@ OpenGLSurfaceEvaluator::map2f( global_bpm = bezierPatchMeshListInsert(global_bpm, temp); /* - global_bpm = bezierPatchMeshListInsert(global_bpm, + global_bpm = bezierPatchMeshListInsert(global_bpm, bezierPatchMeshMake( (int) _type, _ulower, _uupper,(int) _ustride, (int) _uorder, _vlower, _vupper, (int) _vstride, (int) _vorder, pts, 10, 10)); */ @@ -930,12 +930,12 @@ OpenGLSurfaceEvaluator::map2f( } else /*not output triangles*/ { - glMap2f((GLenum) _type, (GLfloat) _ulower, (GLfloat) _uupper, - (GLint) _ustride, (GLint) _uorder, (GLfloat) _vlower, - (GLfloat) _vupper, (GLint) _vstride, (GLint) _vorder, + glMap2f((GLenum) _type, (GLfloat) _ulower, (GLfloat) _uupper, + (GLint) _ustride, (GLint) _uorder, (GLfloat) _vlower, + (GLfloat) _vupper, (GLint) _vstride, (GLint) _vorder, (const GLfloat *) pts); } - + #endif } @@ -976,18 +976,18 @@ if(output_triangles) if(global_grid_nu == 0 || global_grid_nv == 0) return; /*no points need to be output*/ du = (global_grid_u1 - global_grid_u0) / (REAL)global_grid_nu; - dv = (global_grid_v1 - global_grid_v0) / (REAL)global_grid_nv; - + dv = (global_grid_v1 - global_grid_v0) / (REAL)global_grid_nv; + if(global_grid_nu >= global_grid_nv){ for(i=umin; i=vmin; j--){ REAL v1 = (j == global_grid_nv)? global_grid_v1: (global_grid_v0 +j*dv); - + coord2f(u1, v1); coord2f(u2, v1); } @@ -999,10 +999,10 @@ if(output_triangles) for(i=vmin; i=umin; j--){ - REAL u1 = (j == global_grid_nu)? global_grid_u1: (global_grid_u0 +j*du); + REAL u1 = (j == global_grid_nu)? global_grid_u1: (global_grid_u0 +j*du); coord2f(u1, v2); coord2f(u1, v1); } @@ -1016,15 +1016,15 @@ else switch(style) { default: case N_MESHFILL: - glEvalMesh2((GLenum) GL_FILL, (GLint) umin, (GLint) umax, + glEvalMesh2((GLenum) GL_FILL, (GLint) umin, (GLint) umax, (GLint) vmin, (GLint) vmax); break; case N_MESHLINE: - glEvalMesh2((GLenum) GL_LINE, (GLint) umin, (GLint) umax, + glEvalMesh2((GLenum) GL_LINE, (GLint) umin, (GLint) umax, (GLint) vmin, (GLint) vmax); break; case N_MESHPOINT: - glEvalMesh2((GLenum) GL_POINT, (GLint) umin, (GLint) umax, + glEvalMesh2((GLenum) GL_POINT, (GLint) umin, (GLint) umax, (GLint) vmin, (GLint) vmax); break; } @@ -1171,7 +1171,7 @@ return; if (vcount == 2) { vertexCache[0]->invoke(this); vertexCache[1]->invoke(this); - coord2f(u,v); + coord2f(u,v); } else { vcount++; diff --git a/src/glu/sgi/libnurbs/internals/arc.cc b/src/glu/sgi/libnurbs/internals/arc.cc index 845f05fab92..3b968303bdc 100644 --- a/src/glu/sgi/libnurbs/internals/arc.cc +++ b/src/glu/sgi/libnurbs/internals/arc.cc @@ -35,8 +35,8 @@ /* * arc.c++ * - * $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arc.cc,v 1.2 2002/11/01 23:35:07 brianp Exp $ + * $Date: 2003/10/14 23:48:57 $ $Revision: 1.3 $ + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arc.cc,v 1.3 2003/10/14 23:48:57 kendallb Exp $ */ #include @@ -50,11 +50,11 @@ #include "simplemath.h" /* local preprocessor definitions */ -#define ZERO 0.00001/*0.000001*/ +#define ZERO 0.00001/*0.000001*/ -const int Arc::bezier_tag = (1<<13); -const int Arc::arc_tag = (1<<3); -const int Arc::tail_tag = (1<<6); +const int Arc::bezier_tag = (1<<13); +const int Arc::arc_tag = (1<<3); +const int Arc::tail_tag = (1<<6); /*-------------------------------------------------------------------------- * makeSide - attach a pwl arc to an arc and mark it as a border arc @@ -72,7 +72,7 @@ Arc::makeSide( PwlArc *pwl, arc_side side ) clearbezier(); setside( side ); } - + /*-------------------------------------------------------------------------- * numpts - count number of points on arc loop @@ -100,7 +100,7 @@ void Arc::markverts( void ) { Arc_ptr jarc = this; - + do { TrimVertex *p = jarc->pwlArc->pts; for( int i=0; ipwlArc->npts; i++ ) @@ -125,22 +125,22 @@ Arc::getextrema( Arc_ptr extrema[4] ) botpt = toppt = this->tail()[1]; for( Arc_ptr jarc = this->next; jarc != this; jarc = jarc->next ) { - if ( jarc->tail()[0] < leftpt || + if ( jarc->tail()[0] < leftpt || (jarc->tail()[0] <= leftpt && jarc->rhead()[0]<=leftpt)) { leftpt = jarc->pwlArc->pts->param[0]; extrema[1] = jarc; } - if ( jarc->tail()[0] > rightpt || + if ( jarc->tail()[0] > rightpt || (jarc->tail()[0] >= rightpt && jarc->rhead()[0] >= rightpt)) { rightpt = jarc->pwlArc->pts->param[0]; extrema[3] = jarc; } - if ( jarc->tail()[1] < botpt || - (jarc->tail()[1] <= botpt && jarc->rhead()[1] <= botpt )) { + if ( jarc->tail()[1] < botpt || + (jarc->tail()[1] <= botpt && jarc->rhead()[1] <= botpt )) { botpt = jarc->pwlArc->pts->param[1]; extrema[2] = jarc; } - if ( jarc->tail()[1] > toppt || + if ( jarc->tail()[1] > toppt || (jarc->tail()[1] >= toppt && jarc->rhead()[1] >= toppt)) { toppt = jarc->pwlArc->pts->param[1]; extrema[0] = jarc; @@ -160,7 +160,7 @@ Arc::show() #ifndef NDEBUG dprintf( "\tPWLARC NP: %d FL: 1\n", pwlArc->npts ); for( int i = 0; i < pwlArc->npts; i++ ) { - dprintf( "\t\tVERTEX %f %f\n", pwlArc->pts[i].param[0], + dprintf( "\t\tVERTEX %f %f\n", pwlArc->pts[i].param[0], pwlArc->pts[i].param[1] ); } #endif @@ -176,13 +176,6 @@ Arc::print( void ) { Arc_ptr jarc = this; - if( ! this ) { -#ifndef NDEBUG - dprintf( "\n\nEMPTY TRIM\n\n" ); -#endif - return; - } - #ifndef NDEBUG dprintf( "BGNTRIM\n" ); #endif @@ -217,10 +210,10 @@ Arc::isDisconnected( void ) #endif return 1; } else { - /* average two points together */ - p0[0] = p1[0] = (p1[0] + p0[0]) * 0.5; - p0[1] = p1[1] = (p1[1] + p0[1]) * 0.5; - return 0; + /* average two points together */ + p0[0] = p1[0] = (p1[0] + p0[0]) * 0.5; + p0[1] = p1[1] = (p1[1] + p0[1]) * 0.5; + return 0; } } @@ -251,29 +244,29 @@ Arc::check( void ) do { assert( (jarc->pwlArc != 0) || (jarc->bezierArc != 0) ); - if (jarc->prev == 0 || jarc->next == 0) { + if (jarc->prev == 0 || jarc->next == 0) { #ifndef NDEBUG dprintf( "checkjarc:null next/prev pointer\n"); jarc->print( ); #endif return 0; - } + } - if (jarc->next->prev != jarc) { + if (jarc->next->prev != jarc) { #ifndef NDEBUG dprintf( "checkjarc: pointer linkage screwed up\n"); jarc->print( ); #endif return 0; - } + } - if( jarc->pwlArc ) { + if( jarc->pwlArc ) { #ifndef NDEBUG assert( jarc->pwlArc->npts >= 1 ); assert( jarc->pwlArc->npts < 100000 ); /* for( int i=0; i < jarc->pwlArc->npts-1; i++ ) - assert( neq_vert( jarc->pwlArc->pts[i].param, + assert( neq_vert( jarc->pwlArc->pts[i].param, jarc->pwlArc->pts[i+1].param) ); */ #endif @@ -287,7 +280,7 @@ Arc::check( void ) return 0; } if( jarc->tail()[0] != jarc->prev->rhead()[0] ) { - + #ifndef NDEBUG dprintf( "checkjarc: geometric linkage screwed up 2\n"); jarc->prev->show(); @@ -316,13 +309,13 @@ Arc::check( void ) } if( jarc->isbezier() ) { assert( jarc->pwlArc->npts == 2 ); - assert( (jarc->pwlArc->pts[0].param[0] == \ - jarc->pwlArc->pts[1].param[0]) ||\ - (jarc->pwlArc->pts[0].param[1] == \ - jarc->pwlArc->pts[1].param[1]) ); + assert( (jarc->pwlArc->pts[0].param[0] == \ + jarc->pwlArc->pts[1].param[0]) ||\ + (jarc->pwlArc->pts[0].param[1] == \ + jarc->pwlArc->pts[1].param[1]) ); } } - jarc = jarc->next; + jarc = jarc->next; } while (jarc != this); return 1; } @@ -347,9 +340,9 @@ Arc::append( Arc_ptr jarc ) if( jarc != 0 ) { next = jarc->next; prev = jarc; - next->prev = prev->next = this; + next->prev = prev->next = this; } else { - next = prev = this; + next = prev = this; } return this; } diff --git a/src/glu/sgi/libnurbs/internals/basiccrveval.cc b/src/glu/sgi/libnurbs/internals/basiccrveval.cc index 0d3d5aa8d38..24b33f0667c 100644 --- a/src/glu/sgi/libnurbs/internals/basiccrveval.cc +++ b/src/glu/sgi/libnurbs/internals/basiccrveval.cc @@ -35,15 +35,15 @@ /* * basiccrveval.c++ * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basiccrveval.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $ + * $Date: 2003/10/14 23:48:57 $ $Revision: 1.2 $ + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basiccrveval.cc,v 1.2 2003/10/14 23:48:57 kendallb Exp $ */ #include "mystdio.h" #include "types.h" #include "basiccrveval.h" -void +void BasicCurveEvaluator::domain1f( REAL, REAL ) { #ifndef NDEBUG @@ -51,15 +51,15 @@ BasicCurveEvaluator::domain1f( REAL, REAL ) #endif } -void -BasicCurveEvaluator::range1f( long type, REAL *, REAL * ) +void +BasicCurveEvaluator::range1f( long , REAL *, REAL * ) { #ifndef NDEBUG dprintf( "range1f\n" ); #endif } -void +void BasicCurveEvaluator::enable( long ) { #ifndef NDEBUG @@ -67,7 +67,7 @@ BasicCurveEvaluator::enable( long ) #endif } -void +void BasicCurveEvaluator::disable( long ) { #ifndef NDEBUG @@ -75,7 +75,7 @@ BasicCurveEvaluator::disable( long ) #endif } -void +void BasicCurveEvaluator::bgnmap1f( long ) { #ifndef NDEBUG @@ -83,7 +83,7 @@ BasicCurveEvaluator::bgnmap1f( long ) #endif } -void +void BasicCurveEvaluator::map1f( long, REAL, REAL, long, long, REAL * ) { #ifndef NDEBUG @@ -91,7 +91,7 @@ BasicCurveEvaluator::map1f( long, REAL, REAL, long, long, REAL * ) #endif } -void +void BasicCurveEvaluator::mapgrid1f( long, REAL, REAL ) { #ifndef NDEBUG @@ -99,7 +99,7 @@ BasicCurveEvaluator::mapgrid1f( long, REAL, REAL ) #endif } -void +void BasicCurveEvaluator::mapmesh1f( long, long, long ) { #ifndef NDEBUG @@ -107,7 +107,7 @@ BasicCurveEvaluator::mapmesh1f( long, long, long ) #endif } -void +void BasicCurveEvaluator::evalcoord1f( long, REAL ) { #ifndef NDEBUG @@ -115,7 +115,7 @@ BasicCurveEvaluator::evalcoord1f( long, REAL ) #endif } -void +void BasicCurveEvaluator::endmap1f( void ) { #ifndef NDEBUG @@ -123,7 +123,7 @@ BasicCurveEvaluator::endmap1f( void ) #endif } -void +void BasicCurveEvaluator::bgnline( void ) { #ifndef NDEBUG @@ -131,7 +131,7 @@ BasicCurveEvaluator::bgnline( void ) #endif } -void +void BasicCurveEvaluator::endline( void ) { #ifndef NDEBUG diff --git a/src/glu/sgi/libnurbs/internals/basicsurfeval.cc b/src/glu/sgi/libnurbs/internals/basicsurfeval.cc index 0ade6fa8f7d..f84d3b6074f 100644 --- a/src/glu/sgi/libnurbs/internals/basicsurfeval.cc +++ b/src/glu/sgi/libnurbs/internals/basicsurfeval.cc @@ -35,15 +35,19 @@ /* * basicsurfaceevaluator.c++ * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $ + * $Date: 2003/10/14 23:48:57 $ $Revision: 1.2 $ + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.cc,v 1.2 2003/10/14 23:48:57 kendallb Exp $ */ #include "mystdio.h" #include "types.h" #include "basicsurfeval.h" -void +#ifdef __WATCOMC__ +#pragma warning 726 10 +#endif + +void BasicSurfaceEvaluator::domain2f( REAL, REAL, REAL, REAL ) { #ifndef NDEBUG @@ -51,7 +55,7 @@ BasicSurfaceEvaluator::domain2f( REAL, REAL, REAL, REAL ) #endif } -void +void BasicSurfaceEvaluator::polymode( long ) { #ifndef NDEBUG @@ -63,12 +67,12 @@ void BasicSurfaceEvaluator::range2f( long type, REAL *from, REAL *to ) { #ifndef NDEBUG - dprintf( "range2f type %ld, from (%g,%g), to (%g,%g)\n", + dprintf( "range2f type %ld, from (%g,%g), to (%g,%g)\n", type, from[0], from[1], to[0], to[1] ); #endif } -void +void BasicSurfaceEvaluator::enable( long ) { #ifndef NDEBUG @@ -76,7 +80,7 @@ BasicSurfaceEvaluator::enable( long ) #endif } -void +void BasicSurfaceEvaluator::disable( long ) { #ifndef NDEBUG @@ -84,7 +88,7 @@ BasicSurfaceEvaluator::disable( long ) #endif } -void +void BasicSurfaceEvaluator::bgnmap2f( long ) { #ifndef NDEBUG @@ -92,7 +96,7 @@ BasicSurfaceEvaluator::bgnmap2f( long ) #endif } -void +void BasicSurfaceEvaluator::endmap2f( void ) { #ifndef NDEBUG @@ -100,8 +104,8 @@ BasicSurfaceEvaluator::endmap2f( void ) #endif } -void -BasicSurfaceEvaluator::map2f( long, REAL, REAL, long, long, +void +BasicSurfaceEvaluator::map2f( long, REAL, REAL, long, long, REAL, REAL, long, long, REAL * ) { @@ -110,7 +114,7 @@ BasicSurfaceEvaluator::map2f( long, REAL, REAL, long, long, #endif } -void +void BasicSurfaceEvaluator::mapgrid2f( long, REAL, REAL, long, REAL, REAL ) { #ifndef NDEBUG @@ -118,7 +122,7 @@ BasicSurfaceEvaluator::mapgrid2f( long, REAL, REAL, long, REAL, REAL ) #endif } -void +void BasicSurfaceEvaluator::mapmesh2f( long, long, long, long, long ) { #ifndef NDEBUG @@ -126,7 +130,7 @@ BasicSurfaceEvaluator::mapmesh2f( long, long, long, long, long ) #endif } -void +void BasicSurfaceEvaluator::evalcoord2f( long, REAL, REAL ) { #ifndef NDEBUG @@ -134,7 +138,7 @@ BasicSurfaceEvaluator::evalcoord2f( long, REAL, REAL ) #endif } -void +void BasicSurfaceEvaluator::evalpoint2i( long, long ) { #ifndef NDEBUG @@ -142,7 +146,7 @@ BasicSurfaceEvaluator::evalpoint2i( long, long ) #endif } -void +void BasicSurfaceEvaluator::bgnline( void ) { #ifndef NDEBUG @@ -150,7 +154,7 @@ BasicSurfaceEvaluator::bgnline( void ) #endif } -void +void BasicSurfaceEvaluator::endline( void ) { #ifndef NDEBUG @@ -158,7 +162,7 @@ BasicSurfaceEvaluator::endline( void ) #endif } -void +void BasicSurfaceEvaluator::bgnclosedline( void ) { #ifndef NDEBUG @@ -166,7 +170,7 @@ BasicSurfaceEvaluator::bgnclosedline( void ) #endif } -void +void BasicSurfaceEvaluator::endclosedline( void ) { #ifndef NDEBUG @@ -174,7 +178,7 @@ BasicSurfaceEvaluator::endclosedline( void ) #endif } -void +void BasicSurfaceEvaluator::bgntfan( void ) { #ifndef NDEBUG @@ -182,13 +186,13 @@ BasicSurfaceEvaluator::bgntfan( void ) #endif } -void +void BasicSurfaceEvaluator::endtfan( void ) { } -void +void BasicSurfaceEvaluator::bgntmesh( void ) { #ifndef NDEBUG @@ -196,7 +200,7 @@ BasicSurfaceEvaluator::bgntmesh( void ) #endif } -void +void BasicSurfaceEvaluator::swaptmesh( void ) { #ifndef NDEBUG @@ -204,7 +208,7 @@ BasicSurfaceEvaluator::swaptmesh( void ) #endif } -void +void BasicSurfaceEvaluator::endtmesh( void ) { #ifndef NDEBUG @@ -212,7 +216,7 @@ BasicSurfaceEvaluator::endtmesh( void ) #endif } -void +void BasicSurfaceEvaluator::bgnqstrip( void ) { #ifndef NDEBUG @@ -220,7 +224,7 @@ BasicSurfaceEvaluator::bgnqstrip( void ) #endif } -void +void BasicSurfaceEvaluator::endqstrip( void ) { #ifndef NDEBUG diff --git a/src/glu/sgi/libnurbs/internals/coveandtiler.cc b/src/glu/sgi/libnurbs/internals/coveandtiler.cc index 61ca3b8f70f..9297d3fc21f 100644 --- a/src/glu/sgi/libnurbs/internals/coveandtiler.cc +++ b/src/glu/sgi/libnurbs/internals/coveandtiler.cc @@ -35,8 +35,8 @@ /* * coveandtiler.c++ * - * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/coveandtiler.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $ + * $Date: 2003/10/14 23:48:57 $ $Revision: 1.2 $ + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/coveandtiler.cc,v 1.2 2003/10/14 23:48:57 kendallb Exp $ */ #include "glimports.h" @@ -52,7 +52,7 @@ const int CoveAndTiler::MAXSTRIPSIZE = 1000; CoveAndTiler::CoveAndTiler( Backend& b ) - : backend( b ) + : backend( b ) { } CoveAndTiler::~CoveAndTiler( void ) @@ -76,19 +76,19 @@ CoveAndTiler::output( GridTrimVertex& g ) backend.tmeshvert( &g ); } -void +void CoveAndTiler::coveAndTile( void ) { long ustart = (top.ustart >= bot.ustart) ? top.ustart : bot.ustart; - long uend = (top.uend <= bot.uend) ? top.uend : bot.uend; + long uend = (top.uend <= bot.uend) ? top.uend : bot.uend; if( ustart <= uend ) { tile( bot.vindex, ustart, uend ); - if( top.ustart >= bot.ustart ) + if( top.ustart >= bot.ustart ) coveUpperLeft(); - else + else coveLowerLeft(); - - if( top.uend <= bot.uend ) + + if( top.uend <= bot.uend ) coveUpperRight(); else coveLowerRight(); @@ -126,7 +126,7 @@ CoveAndTiler::coveAndTile( void ) } else { tllv.set( bot.ustart-1, top.vindex ); } - coveLowerLeftNoGrid( tl ); + coveLowerLeftNoGrid( tl ); } TrimVertex brv, trv, *br, *tr; @@ -158,7 +158,7 @@ CoveAndTiler::coveAndTile( void ) br = rl; brrv.set( rl ); if( rf->param[0] < uarray.uarray[bot.uend+1] ) { - assert( rf->param[0] >= uarray.uarray[bot.uend] ); + assert( rf->param[0] >= uarray.uarray[bot.uend] ); trrv.set( rf ); } else { trrv.set( bot.uend+1, top.vindex ); @@ -179,7 +179,7 @@ CoveAndTiler::coveAndTile( void ) } } -void +void CoveAndTiler::tile( long vindex, long ustart, long uend ) { long numsteps = uend - ustart; @@ -195,7 +195,7 @@ CoveAndTiler::tile( long vindex, long ustart, long uend ) } } -void +void CoveAndTiler::coveUpperRight( void ) { GridVertex tgv( top.uend, top.vindex ); @@ -207,7 +207,7 @@ CoveAndTiler::coveUpperRight( void ) output( tgv ); backend.swaptmesh(); output( gv ); - coveUR(); + coveUR(); backend.endtmesh(); } @@ -215,15 +215,15 @@ void CoveAndTiler::coveUpperRightNoGrid( TrimVertex* br ) { backend.bgntmesh( "coveUpperRight" ); - output( right.first() ); + output( right.first() ); output( right.next() ); backend.swaptmesh(); output( br ); - coveUR(); + coveUR(); backend.endtmesh(); } -void +void CoveAndTiler::coveUR( ) { GridVertex gv( top.uend, bot.vindex ); @@ -238,7 +238,7 @@ CoveAndTiler::coveUR( ) backend.swaptmesh(); } } else while( 1 ) { - if( vert->param[0] < uarray.uarray[gv.gparam[0]] ) { + if( vert->param[0] < uarray.uarray[gv.gparam[0]] ) { output( vert ); backend.swaptmesh(); vert = right.next(); @@ -250,7 +250,7 @@ CoveAndTiler::coveUR( ) for( ; vert; vert = right.next() ) { output( vert ); backend.swaptmesh(); - } + } break; } } @@ -269,7 +269,7 @@ CoveAndTiler::coveUpperLeft( void ) output( left.next() ); output( gv ); backend.swaptmesh(); - coveUL(); + coveUL(); backend.endtmesh(); } @@ -277,15 +277,15 @@ void CoveAndTiler::coveUpperLeftNoGrid( TrimVertex* bl ) { backend.bgntmesh( "coveUpperLeftNoGrid" ); - output( left.first() ); + output( left.first() ); output( left.next() ); output( bl ); backend.swaptmesh(); - coveUL(); + coveUL(); backend.endtmesh(); } -void +void CoveAndTiler::coveUL() { GridVertex gv( top.ustart, bot.vindex ); @@ -318,7 +318,7 @@ CoveAndTiler::coveUL() } } -void +void CoveAndTiler::coveLowerLeft( void ) { GridVertex bgv( bot.ustart, bot.vindex ); @@ -330,7 +330,7 @@ CoveAndTiler::coveLowerLeft( void ) output( bgv ); backend.swaptmesh(); output( gv ); - coveLL(); + coveLL(); backend.endtmesh(); } @@ -338,15 +338,15 @@ void CoveAndTiler::coveLowerLeftNoGrid( TrimVertex* tl ) { backend.bgntmesh( "coveLowerLeft" ); - output( left.last() ); + output( left.last() ); output( left.prev() ); backend.swaptmesh(); output( tl ); - coveLL( ); + coveLL( ); backend.endtmesh(); } -void +void CoveAndTiler::coveLL() { GridVertex gv( bot.ustart, top.vindex ); @@ -360,7 +360,7 @@ CoveAndTiler::coveLL() backend.swaptmesh(); } } else while( 1 ) { - if( vert->param[0] > uarray.uarray[gv.gparam[0]] ){ + if( vert->param[0] > uarray.uarray[gv.gparam[0]] ){ output( vert ); backend.swaptmesh(); vert = left.prev(); @@ -369,29 +369,29 @@ CoveAndTiler::coveLL() backend.swaptmesh(); output( gv ); if( gv.prevu() == top.ustart ) { - for( ; vert; vert = left.prev() ) { + for( ; vert; vert = left.prev() ) { output( vert ); backend.swaptmesh(); - } - break; + } + break; } } } } -void +void CoveAndTiler::coveLowerRight( void ) { GridVertex bgv( bot.uend, bot.vindex ); GridVertex gv( bot.uend, top.vindex ); right.last(); - backend.bgntmesh( "coveLowerRight" ); + backend.bgntmesh( "coveLowerRight" ); output( bgv ); output( right.prev() ); output( gv ); backend.swaptmesh(); - coveLR(); + coveLR(); backend.endtmesh( ); } @@ -399,15 +399,15 @@ void CoveAndTiler::coveLowerRightNoGrid( TrimVertex* tr ) { backend.bgntmesh( "coveLowerRIght" ); - output( right.last() ); + output( right.last() ); output( right.prev() ); output( tr ); backend.swaptmesh(); - coveLR(); + coveLR(); backend.endtmesh(); } -void +void CoveAndTiler::coveLR( ) { GridVertex gv( bot.uend, top.vindex ); @@ -421,7 +421,7 @@ CoveAndTiler::coveLR( ) output( vert ); } } else while( 1 ) { - if( vert->param[0] < uarray.uarray[gv.gparam[0]] ) { + if( vert->param[0] < uarray.uarray[gv.gparam[0]] ) { backend.swaptmesh(); output( vert ); vert = right.prev(); @@ -430,11 +430,11 @@ CoveAndTiler::coveLR( ) output( gv ); backend.swaptmesh(); if( gv.nextu() == top.uend ) { - for( ; vert; vert = right.prev() ) { + for( ; vert; vert = right.prev() ) { backend.swaptmesh(); output( vert ); - } - break; + } + break; } } } diff --git a/src/glu/sgi/libnurbs/internals/knotvector.cc b/src/glu/sgi/libnurbs/internals/knotvector.cc index b48efbd4bfa..3e047456f5c 100644 --- a/src/glu/sgi/libnurbs/internals/knotvector.cc +++ b/src/glu/sgi/libnurbs/internals/knotvector.cc @@ -35,8 +35,8 @@ /* * knotvector.c++ * - * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ - * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/knotvector.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $ + * $Date: 2003/10/14 23:48:57 $ $Revision: 1.2 $ + * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/knotvector.cc,v 1.2 2003/10/14 23:48:57 kendallb Exp $ */ #include "glimports.h" @@ -45,17 +45,20 @@ #include "knotvector.h" #include "defines.h" +#ifdef __WATCOMC__ +#pragma warning 726 10 +#endif void Knotvector::init( long _knotcount, long _stride, long _order, INREAL *_knotlist ) { - knotcount = _knotcount; - stride = _stride; - order = _order; + knotcount = _knotcount; + stride = _stride; + order = _order; knotlist = new Knot[_knotcount]; assert( knotlist != 0 ); for( int i = 0; i != _knotcount; i++ ) - knotlist[i] = (Knot) _knotlist[i]; + knotlist[i] = (Knot) _knotlist[i]; } Knotvector::Knotvector( void ) @@ -70,7 +73,7 @@ Knotvector::~Knotvector( void ) int Knotvector::validate( void ) { - /* kindex is used as an array index so subtract one first, + /* kindex is used as an array index so subtract one first, * this propagates throughout the code so study carefully */ long kindex = knotcount-1; @@ -85,7 +88,7 @@ int Knotvector::validate( void ) } if( identical( knotlist[kindex-(order-1)], knotlist[order-1]) ) { - // valid knot range is empty + // valid knot range is empty return( 3 ); } @@ -94,33 +97,33 @@ int Knotvector::validate( void ) // decreasing knot sequence return( 4 ); } - + /* check for valid multiplicity */ /* kindex is currently the index of the last knot. * In the next loop it is decremented to ignore the last knot - * and the loop stops when kindex is 2 so as to ignore the first - * knot as well. These knots are not used in computing - * knot multiplicities. + * and the loop stops when kindex is 2 so as to ignore the first + * knot as well. These knots are not used in computing + * knot multiplicities. */ long multi = 1; for( ; kindex >= 1; kindex-- ) { if( knotlist[kindex] - knotlist[kindex-1] < TOLERANCE ) { - multi++; + multi++; continue; - } + } if ( multi > order ) { - // knot multiplicity greater than order of spline + // knot multiplicity greater than order of spline return( 5 ); - } + } multi = 1; } if ( multi > order ) { - // knot multiplicity greater than order of spline + // knot multiplicity greater than order of spline return( 5 ); - } + } return 0; } @@ -128,7 +131,7 @@ int Knotvector::validate( void ) void Knotvector::show( char *msg ) { #ifndef NDEBUG - dprintf( "%s\n", msg ); + dprintf( "%s\n", msg ); dprintf( "order = %ld, count = %ld\n", order, knotcount ); for( int i=0; i @@ -47,6 +47,10 @@ #include "directedLine.h" #include "polyDBG.h" +#ifdef __WATCOMC__ +#pragma warning 726 10 +#endif + //we must return the newLine directedLine* directedLine::deleteChain(directedLine* begin, directedLine* end) { @@ -61,10 +65,10 @@ directedLine* directedLine::deleteChain(directedLine* begin, directedLine* end) delete end->sline; delete begin; delete end; - + return ret; } - + directedLine* newLine; sampledLine* sline = new sampledLine(begin->head(), end->tail()); newLine = new directedLine(INCREASING, sline); @@ -85,9 +89,9 @@ directedLine* directedLine::deleteChain(directedLine* begin, directedLine* end) void directedLine::deleteSingleLine(directedLine* dline) { - //make sure that dline->prev->tail is the same as + //make sure that dline->prev->tail is the same as //dline->next->head. This is for numerical erros. - //for example, if we delete a line which is almost degeneate + //for example, if we delete a line which is almost degeneate //within (epsilon), then we want to make that the polygon after deletion //is still a valid polygon @@ -107,18 +111,18 @@ static Int myequal(Real a[2], Real b[2]) if(a[0]==b[0] && a[1] == b[1]) return 1; else - return 0; + return 0; */ - + if(fabs(a[0]-b[0]) < 0.00001 && fabs(a[1]-b[1]) < 0.00001) return 1; else return 0; - + } - + directedLine* directedLine::deleteDegenerateLines() { //if there is only one edge or two edges, don't do anything @@ -136,7 +140,7 @@ directedLine* directedLine::deleteDegenerateLines() head()[1] != tail()[1]) */ first = this; - else + else { for(temp = this->next; temp != this; temp = temp->next) { @@ -149,7 +153,7 @@ directedLine* directedLine::deleteDegenerateLines() first = temp; break; } - + } } @@ -164,17 +168,17 @@ directedLine* directedLine::deleteDegenerateLines() for(temp =first->next; temp != first; temp = tempNext) { tempNext = temp->getNext(); -/* +/* if(temp->head()[0] == temp->tail()[0] && temp->head()[1] == temp->tail()[1]) -*/ +*/ if(myequal(temp->head(), temp->tail())) deleteSingleLine(temp); - } + } return first; } - + directedLine* directedLine::deleteDegenerateLinesAllPolygons() { directedLine* temp; @@ -188,7 +192,7 @@ directedLine* directedLine::deleteDegenerateLinesAllPolygons() if(ret == NULL) { ret = retEnd = temp->deleteDegenerateLines(); - + } else { @@ -277,7 +281,7 @@ void directedLine::deletePolygonList() temp->deleteSinglePolygon(); } } - + /*a loop by itself*/ directedLine::directedLine(short dir, sampledLine* sl) @@ -289,7 +293,7 @@ directedLine::directedLine(short dir, sampledLine* sl) nextPolygon = NULL; // prevPolygon = NULL; rootBit = 0;/*important to initilzae to 0 meaning not root yet*/ - + rootLink = NULL; } @@ -305,7 +309,7 @@ directedLine::directedLine() next = this; prev = this; nextPolygon = NULL; - rootBit = 0;/*important to initilzae to 0 meaning not root yet*/ + rootBit = 0;/*important to initilzae to 0 meaning not root yet*/ rootLink = NULL; } @@ -344,7 +348,7 @@ Int directedLine::numEdges() Int ret=0; directedLine* temp; if(next == this) return 1; - + ret = 1; for(temp = next; temp != this; temp = temp->next) ret++; @@ -373,7 +377,7 @@ short directedLine::isPolygon() /*check this edge*/ if(! isConnected()) return 0; - + /*check all other edges*/ for(temp=next; temp != this; temp = temp->next){ if(!isConnected()) return 0; @@ -381,14 +385,14 @@ short directedLine::isPolygon() return 1; } -/*check if the head of this edge is connected to +/*check if the head of this edge is connected to *the tail of the prev */ short directedLine::isConnected() { if( (head()[0] == prev->tail()[0]) && (head()[1] == prev->tail()[1])) return 1; - else + else return 0; } @@ -410,9 +414,9 @@ Int compV2InX(Real A[2], Real B[2]) /*compare two vertices NOT lines! *A vertex is the head of a directed line. - *(x_1, y_1) <= (x_2, y_2) if + *(x_1, y_1) <= (x_2, y_2) if *either y_1 < y_2 - *or y_1 == y_2 && x_1 < x_2. + *or y_1 == y_2 && x_1 < x_2. *return -1 if this->head() <= nl->head(), *return 1 otherwise */ @@ -425,9 +429,9 @@ Int directedLine::compInY(directedLine* nl) /*compare two vertices NOT lines! *A vertex is the head of a directed line. - *(x_1, y_1) <= (x_2, y_2) if + *(x_1, y_1) <= (x_2, y_2) if *either x_1 < x_2 - *or x_1 == x_2 && y_1 < y_2. + *or x_1 == x_2 && y_1 < y_2. *return -1 if this->head() <= nl->head(), *return 1 otherwise */ @@ -467,8 +471,8 @@ void directedLine::printSingle() { if(direction == INCREASING) printf("direction is INCREASING\n"); - else - printf("direction is DECREASING\n"); + else + printf("direction is DECREASING\n"); printf("head=%f,%f)\n", head()[0], head()[1]); sline->print(); } @@ -515,7 +519,7 @@ directedLine* directedLine::cutoffPolygon(directedLine *p) for(temp=this; temp != p; temp = temp->nextPolygon) { - if(temp == NULL) + if(temp == NULL) { fprintf(stderr, "in cutoffPolygon, not found\n"); exit(1); @@ -531,7 +535,7 @@ directedLine* directedLine::cutoffPolygon(directedLine *p) else { prev_polygon->nextPolygon = p->nextPolygon; return this; - } + } } Int directedLine::numPolygons() @@ -539,9 +543,9 @@ Int directedLine::numPolygons() if(nextPolygon == NULL) return 1; else return 1+nextPolygon->numPolygons(); } - -/*let array[index ...] denote + +/*let array[index ...] denote *all the edges in this polygon *return the next available index of array. */ @@ -555,8 +559,8 @@ Int directedLine::toArraySinglePolygon(directedLine** array, Int index) } return index; } - -/*the space is allocated. The caller is responsible for + +/*the space is allocated. The caller is responsible for *deallocate the space. *total_num_edges is set to be the total number of edges of all polygons */ @@ -602,14 +606,14 @@ Real directedLine::polyArea() /*******************split or combine polygons begin********************/ /*conect a diagonal of a single simple polygon or two simple polygons. *If the two vertices v1 (head) and v2 (head) are in the same simple polygon, - *then we actually split the simple polygon into two polygons. + *then we actually split the simple polygon into two polygons. *If instead two vertices velong to two difference polygons, *then we combine the two polygons into one polygon. - *It is upto the caller to decide whether this is a split or a + *It is upto the caller to decide whether this is a split or a *combination. * *Case Split: - *split a single simple polygon into two simple polygons by + *split a single simple polygon into two simple polygons by *connecting a diagonal (two vertices). *v1, v2: the two vertices are the head() of the two directedLines. * this routine generates one new sampledLine which is returned in @@ -625,11 +629,11 @@ Real directedLine::polyArea() *the returned polygon is returned in ret_p1. */ /*ARGSUSED*/ -void directedLine::connectDiagonal(directedLine* v1, directedLine* v2, - directedLine** ret_p1, +void directedLine::connectDiagonal(directedLine* v1, directedLine* v2, + directedLine** ret_p1, directedLine** ret_p2, sampledLine** generatedLine, - directedLine* polygonList ) + directedLine* polygonList ) { sampledLine *nsline = new sampledLine(2); @@ -637,7 +641,7 @@ void directedLine::connectDiagonal(directedLine* v1, directedLine* v2, nsline->setPoint(0, v1->head()); nsline->setPoint(1, v2->head()); - + /*the increasing line is from v1 head to v2 head*/ @@ -651,12 +655,12 @@ void directedLine::connectDiagonal(directedLine* v1, directedLine* v2, directedLine* v1Prev = v1->prev; directedLine* v2Prev = v2->prev; - v1 ->prev = newLineDec; + v1 ->prev = newLineDec; v2Prev ->next = newLineDec; newLineDec->next = v1; newLineDec->prev = v2Prev; - v2 ->prev = newLineInc; + v2 ->prev = newLineInc; v1Prev ->next = newLineInc; newLineInc->next = v2; newLineInc->prev = v1Prev; @@ -668,19 +672,19 @@ void directedLine::connectDiagonal(directedLine* v1, directedLine* v2, //see the function connectDiangle /*ARGSUSED*/ -void directedLine::connectDiagonal_2slines(directedLine* v1, directedLine* v2, - directedLine** ret_p1, +void directedLine::connectDiagonal_2slines(directedLine* v1, directedLine* v2, + directedLine** ret_p1, directedLine** ret_p2, - directedLine* polygonList ) + directedLine* polygonList ) { sampledLine *nsline = new sampledLine(2); - sampledLine *nsline2 = new sampledLine(2); + sampledLine *nsline2 = new sampledLine(2); nsline->setPoint(0, v1->head()); nsline->setPoint(1, v2->head()); nsline2->setPoint(0, v1->head()); nsline2->setPoint(1, v2->head()); - + /*the increasing line is from v1 head to v2 head*/ directedLine* newLineInc = new directedLine(INCREASING, nsline); @@ -689,12 +693,12 @@ void directedLine::connectDiagonal_2slines(directedLine* v1, directedLine* v2, directedLine* v1Prev = v1->prev; directedLine* v2Prev = v2->prev; - v1 ->prev = newLineDec; + v1 ->prev = newLineDec; v2Prev ->next = newLineDec; newLineDec->next = v1; newLineDec->prev = v2Prev; - v2 ->prev = newLineInc; + v2 ->prev = newLineInc; v1Prev ->next = newLineInc; newLineInc->next = v2; newLineInc->prev = v1Prev; @@ -793,7 +797,7 @@ directedLine* readAllPolygons(char* filename) Int nPolygons; fscanf(fp, "%i", &nPolygons); directedLine *ret = NULL; - + for(i=0; irootLinkSet(NULL); - + directedLine *dLine; for(j=2; jrootLinkSet(thisPoly); dLine = new directedLine(INCREASING, sLine); dLine->rootLinkSet(thisPoly); thisPoly->insert(dLine); - + ret = thisPoly->insertPolygon(ret); } fclose(fp); diff --git a/src/glu/sgi/libnurbs/nurbtess/polyDBG.cc b/src/glu/sgi/libnurbs/nurbtess/polyDBG.cc index e4a65c2eb3c..76f1076623c 100644 --- a/src/glu/sgi/libnurbs/nurbtess/polyDBG.cc +++ b/src/glu/sgi/libnurbs/nurbtess/polyDBG.cc @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -31,10 +31,10 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2001/11/29 16:16:55 $ $Revision: 1.2 $ +** $Date: 2003/10/14 23:48:57 $ $Revision: 1.3 $ */ /* -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/polyDBG.cc,v 1.2 2001/11/29 16:16:55 kschultz Exp $ +** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/polyDBG.cc,v 1.3 2003/10/14 23:48:57 kendallb Exp $ */ #include @@ -43,6 +43,11 @@ #include "zlassert.h" #include "polyDBG.h" +#ifdef __WATCOMC__ +#pragma warning 14 10 +#pragma warning 391 10 +#pragma warning 726 10 +#endif static Real area(Real A[2], Real B[2], Real C[2]) { @@ -71,7 +76,7 @@ Int DBG_is_U_monotone(directedLine* poly) { Int n_changes = 0; Int prev_sign; - Int cur_sign; + Int cur_sign; directedLine* temp; cur_sign = compV2InX(poly->tail(), poly->head()); @@ -119,7 +124,7 @@ Int DBG_is_U_direction(directedLine* poly) if(temp->head()[0] == temp->tail()[0]) V_count += temp->get_npoints(); else if(temp->head()[1] == temp->tail()[1]) - U_count += temp->get_npoints(); + U_count += temp->get_npoints(); */ } @@ -142,7 +147,7 @@ Int DBG_edgesIntersect(directedLine* l1, directedLine* l2) (l1->tail()[1] - l1->head()[1])*(l2->tail()[1]-l2->head()[1]) >=0) return 0; //not intersect else - return 1; + return 1; } //else we use the normal code } @@ -154,8 +159,8 @@ Int DBG_edgesIntersect(directedLine* l1, directedLine* l2) (l2->tail()[1] - l2->head()[1])*(l1->tail()[1]-l1->head()[1]) >=0) return 0; //not intersect else - return 1; - } + return 1; + } //else we use the normal code } else //the two edges are not connected @@ -165,11 +170,11 @@ Int DBG_edgesIntersect(directedLine* l1, directedLine* l2) (l1->tail()[0] == l2->tail()[0] && l1->tail()[1] == l2->tail()[1])) return 1; - + } - - if( + + if( ( area(l1->head(), l1->tail(), l2->head()) * @@ -184,7 +189,7 @@ Int DBG_edgesIntersect(directedLine* l1, directedLine* l2) ) ) return 1; - else + else return 0; } @@ -207,7 +212,7 @@ Int DBG_edgesIntersectGen(Real A[2], Real B[2], Real C[2], Real D[2]) else return 0; } - + /*determien whether (A,B) interesect chain[start] to [end] */ Int DBG_intersectChain(vertexArray* chain, Int start, Int end, Real A[2], Real B[2]) @@ -216,13 +221,13 @@ Int DBG_intersectChain(vertexArray* chain, Int start, Int end, Real A[2], Real B for(i=start; i<=end-2; i++) if(DBG_edgesIntersectGen(chain->getVertex(i), chain->getVertex(i+1), A, B)) return 1; - + return 0; } /*determine whether a polygon intersect itself or not *return 1 is it does, - * 0 otherwise + * 0 otherwise */ Int DBG_polygonSelfIntersect(directedLine* poly) { @@ -235,7 +240,7 @@ Int DBG_polygonSelfIntersect(directedLine* poly) { return 1; } - + } for(temp1=poly->getNext(); temp1 != poly; temp1 = temp1->getNext()) @@ -261,7 +266,7 @@ Int DBG_edgeIntersectPoly(directedLine* edge, directedLine* poly) return 1; return 0; } - + /*check whether two polygons intersect */ Int DBG_polygonsIntersect(directedLine* p1, directedLine* p2) @@ -291,7 +296,7 @@ Int DBG_polygonListIntersect(directedLine* pList) if(DBG_polygonsIntersect(temp, temp2)) return 1; } - + return 0; } @@ -303,16 +308,16 @@ Int DBG_isCounterclockwise(directedLine* poly) /*ray: v0 with direction (dx,dy). *edge: v1-v2. - * the extra point v10[2] is given for the information at + * the extra point v10[2] is given for the information at *v1. Basically this edge is connectd to edge - * v10-v1. If v1 is on the ray, + * v10-v1. If v1 is on the ray, * then we need v10 to determine whether this ray intersects - * the edge or not (that is, return 1 or return 0). + * the edge or not (that is, return 1 or return 0). * If v1 is on the ray, then if v2 and v10 are on the same side of the ray, * we return 0, otherwise return 1. *For v2, if v2 is on the ray, we always return 0. *Notice that v1 and v2 are not symmetric. So the edge is directed!!! - * The purpose for this convention is such that: a point is inside a polygon + * The purpose for this convention is such that: a point is inside a polygon * if and only if it intersets with odd number of edges. */ Int DBG_rayIntersectEdge(Real v0[2], Real dx, Real dy, Real v10[2], Real v1[2], Real v2[2]) @@ -330,17 +335,17 @@ if( (v1[1] >= v0[1] && v2[1]<= v0[1] ) /*if the ray is parallel to the edge, return 0: not intersect*/ - if(denom == 0.0) + if(denom == 0.0) return 0; /*if v0 is on the edge, return 0: not intersect*/ - if(nomRay == 0.0) + if(nomRay == 0.0) return 0; - + /*if v1 is on the positive ray, and the neighbor of v1 crosses the ray *return 1: intersect */ - if(nomEdge == 0) + if(nomEdge == 0) { /*v1 is on the positive or negative ray*/ /* @@ -351,7 +356,7 @@ if( (v1[1] >= v0[1] && v2[1]<= v0[1] ) { if(area(v0, v1, v10) * area(v0, v1, v2) >0) return 0; - else + else return 1; } else /*v1 on negative ray*/ @@ -378,10 +383,10 @@ Int DBG_rayIntersectPoly(Real v0[2], Real dx, Real dy, directedLine* poly) Int count=0; if(DBG_rayIntersectEdge(v0, dx, dy, poly->getPrev()->head(), poly->head(), poly->tail())) count++; - + for(temp=poly->getNext(); temp != poly; temp = temp->getNext()) if(DBG_rayIntersectEdge(v0, dx, dy, temp->getPrev()->head(), temp->head(), temp->tail())) - count++; + count++; /*printf("ray intersect poly: count=%i\n", count);*/ return count; } @@ -398,8 +403,8 @@ poly->printList(); == (DBG_rayIntersectPoly(v,1,Real(0.1234), poly) % 2 ) ); if(DBG_rayIntersectPoly(v, 1, 0, poly) % 2 == 1) - return 1; - else + return 1; + else return 0; } @@ -410,8 +415,8 @@ Int DBG_enclosingPolygons(directedLine* poly, directedLine* list) { directedLine* temp; Int count=0; -/* -printf("%i\n", DBG_pointInsidePoly(poly->head(), +/* +printf("%i\n", DBG_pointInsidePoly(poly->head(), list->getNextPolygon() ->getNextPolygon() ->getNextPolygon() @@ -423,15 +428,15 @@ printf("%i\n", DBG_pointInsidePoly(poly->head(), { if(poly != temp) if(DBG_pointInsidePoly(poly->head(), temp)) - count++; -/* printf("count=%i\n", count);*/ + count++; +/* printf("count=%i\n", count);*/ } return count; } void DBG_reverse(directedLine* poly) { - if(poly->getDirection() == INCREASING) + if(poly->getDirection() == INCREASING) poly->putDirection(DECREASING); else poly->putDirection(INCREASING); @@ -443,7 +448,7 @@ void DBG_reverse(directedLine* poly) directedLine* temp; for(temp=oldNext; temp!=poly; temp = oldNext) { - if(temp->getDirection() == INCREASING) + if(temp->getDirection() == INCREASING) temp->putDirection(DECREASING); else temp->putDirection(INCREASING); @@ -512,7 +517,7 @@ Int DBG_check(directedLine *polyList) correctDir = 0; /*clockwise*/ Int actualDir = DBG_isCounterclockwise(temp); - + if(correctDir != actualDir) { fprintf(stderr, "DBG_check: polygon with incorrect orientations. reversed\n"); @@ -526,7 +531,7 @@ Int DBG_check(directedLine *polyList) /**************handle self intersections*****************/ //determine whether e interects [begin, end] or not -static directedLine* DBG_edgeIntersectChainD(directedLine *e, +static directedLine* DBG_edgeIntersectChainD(directedLine *e, directedLine *begin, directedLine *end) { directedLine *temp; @@ -537,10 +542,10 @@ static directedLine* DBG_edgeIntersectChainD(directedLine *e, } if(DBG_edgesIntersect(e, end)) return end; - return NULL; + return NULL; } -//given a polygon, cut the edges off and finally obtain a +//given a polygon, cut the edges off and finally obtain a //a polygon without intersections. The cut-off edges are //dealloated. The new polygon is returned. directedLine* DBG_cutIntersectionPoly(directedLine *polygon, int& cutOccur) @@ -563,7 +568,7 @@ directedLine* DBG_cutIntersectionPoly(directedLine *polygon, int& cutOccur) Int n=5; buf[0] = interc->tail()[0]; buf[1] = interc->tail()[1]; - + for(i=1; ideleteSingleLine(next); - + if(begin != end) { if(DBG_polygonSelfIntersect(begin)) @@ -615,7 +620,7 @@ directedLine* DBG_cutIntersectionPoly(directedLine *polygon, int& cutOccur) return begin; } -//given a polygon, cut the edges off and finally obtain a +//given a polygon, cut the edges off and finally obtain a //a polygon without intersections. The cut-off edges are //dealloated. The new polygon is returned. static directedLine* DBG_cutIntersectionPoly_notwork(directedLine *polygon) @@ -642,7 +647,7 @@ static directedLine* DBG_cutIntersectionPoly_notwork(directedLine *polygon) crt=crt->deleteChain(crt, crt->getNext()); } else - { + { //now we know crt and crt->getNext do not intersect begin = crt; end = crt->getNext(); @@ -651,8 +656,8 @@ static directedLine* DBG_cutIntersectionPoly_notwork(directedLine *polygon) for(temp=end->getNext(); temp!=begin; temp= temp->getNext()) { //printf("temp=(%f,%f)\n", temp->head()[0], temp->head()[1]); - directedLine *intersect = DBG_edgeIntersectChainD(temp, begin, end); - if(intersect != NULL) + directedLine *intersect = DBG_edgeIntersectChainD(temp, begin, end); + if(intersect != NULL) { crt = crt->deleteChain(intersect, temp); find=1; @@ -686,7 +691,7 @@ directedLine* DBG_cutIntersectionAllPoly(directedLine* list) if(left != NULL) ret=left->insertPolygon(ret); } - return ret; + return ret; } sampledLine* DBG_collectSampledLinesAllPoly(directedLine *polygonList) @@ -709,7 +714,7 @@ sampledLine* DBG_collectSampledLinesAllPoly(directedLine *polygonList) DBG_collectSampledLinesPoly(temp, tempHead, tempTail); cTail->insert(tempHead); cTail = tempTail; - } + } return cHead; } @@ -721,7 +726,7 @@ void DBG_collectSampledLinesPoly(directedLine *polygon, sampledLine*& retHead, retTail = NULL; if(polygon == NULL) return; - + retHead = retTail = polygon->getSampledLine(); for(temp = polygon->getNext(); temp != polygon; temp=temp->getNext()) { diff --git a/src/glu/sgi/libtess/geom.h b/src/glu/sgi/libtess/geom.h index 14969d48781..d2c649eee25 100644 --- a/src/glu/sgi/libtess/geom.h +++ b/src/glu/sgi/libtess/geom.h @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -35,8 +35,8 @@ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/geom.h,v 1.1 2001/03/17 00:25:41 brianp Exp $ +** $Date: 2003/10/14 23:48:57 $ $Revision: 1.2 $ +** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/geom.h,v 1.2 2003/10/14 23:48:57 kendallb Exp $ */ #ifndef __geom_h_ @@ -58,8 +58,8 @@ ((u)->s == (v)->s && (u)->t <= (v)->t)) #endif -#define EdgeEval(u,v,w) __gl_edgeEval(u,v,w) -#define EdgeSign(u,v,w) __gl_edgeSign(u,v,w) +#define EdgeEval(u,v,w) __gl_edgeEval(u,v,w) +#define EdgeSign(u,v,w) __gl_edgeSign(u,v,w) /* Versions of VertLeq, EdgeSign, EdgeEval with s and t transposed. */ @@ -69,11 +69,12 @@ #define TransSign(u,v,w) __gl_transSign(u,v,w) -#define EdgeGoesLeft(e) VertLeq( (e)->Dst, (e)->Org ) +#define EdgeGoesLeft(e) VertLeq( (e)->Dst, (e)->Org ) #define EdgeGoesRight(e) VertLeq( (e)->Org, (e)->Dst ) +#undef ABS #define ABS(x) ((x) < 0 ? -(x) : (x)) -#define VertL1dist(u,v) (ABS(u->s - v->s) + ABS(u->t - v->t)) +#define VertL1dist(u,v) (ABS(u->s - v->s) + ABS(u->t - v->t)) #define VertCCW(u,v,w) __gl_vertCCW(u,v,w) diff --git a/src/glu/sgi/libtess/normal.c b/src/glu/sgi/libtess/normal.c index 618cfd9ccf4..7ffd39eb32d 100644 --- a/src/glu/sgi/libtess/normal.c +++ b/src/glu/sgi/libtess/normal.c @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -35,8 +35,8 @@ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2002/11/01 23:45:31 $ $Revision: 1.2 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/normal.c,v 1.2 2002/11/01 23:45:31 brianp Exp $ +** $Date: 2003/10/14 23:48:57 $ $Revision: 1.3 $ +** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/normal.c,v 1.3 2003/10/14 23:48:57 kendallb Exp $ */ #include "gluos.h" @@ -64,6 +64,7 @@ static void Normalize( GLdouble v[3] ) } #endif +#undef ABS #define ABS(x) ((x) < 0 ? -(x) : (x)) static int LongAxis( GLdouble v[3] ) @@ -138,7 +139,7 @@ static void ComputeNormal( GLUtesselator *tess, GLdouble norm[3] ) norm[LongAxis(d1)] = 1; } } - + static void CheckOrientation( GLUtesselator *tess ) { @@ -176,7 +177,7 @@ extern int RandomSweep; #define S_UNIT_X (RandomSweep ? (2*drand48()-1) : 1.0) #define S_UNIT_Y (RandomSweep ? (2*drand48()-1) : 0.0) #else -#if defined(SLANTED_SWEEP) +#if defined(SLANTED_SWEEP) /* The "feature merging" is not intended to be complete. There are * special cases where edges are nearly parallel to the sweep line * which are not implemented. The algorithm should still behave @@ -242,7 +243,7 @@ void __gl_projectPolygon( GLUtesselator *tess ) sUnit[i] = 0; sUnit[(i+1)%3] = S_UNIT_X; sUnit[(i+2)%3] = S_UNIT_Y; - + tUnit[i] = 0; tUnit[(i+1)%3] = (norm[i] > 0) ? -S_UNIT_Y : S_UNIT_Y; tUnit[(i+2)%3] = (norm[i] > 0) ? S_UNIT_X : -S_UNIT_X; diff --git a/src/glu/sgi/libtess/sweep.c b/src/glu/sgi/libtess/sweep.c index f28fad4e506..e9fa8a77166 100644 --- a/src/glu/sgi/libtess/sweep.c +++ b/src/glu/sgi/libtess/sweep.c @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -35,8 +35,8 @@ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2002/11/07 14:17:05 $ $Revision: 1.5 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/sweep.c,v 1.5 2002/11/07 14:17:05 brianp Exp $ +** $Date: 2003/10/14 23:48:57 $ $Revision: 1.6 $ +** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/sweep.c,v 1.6 2003/10/14 23:48:57 kendallb Exp $ */ #include "gluos.h" @@ -92,6 +92,8 @@ extern void DebugEvent( GLUtesselator *tess ); * when it is necessary.) */ +#undef MAX +#undef MIN #define MAX(x,y) ((x) >= (y) ? (x) : (y)) #define MIN(x,y) ((x) <= (y) ? (x) : (y)) @@ -99,7 +101,7 @@ extern void DebugEvent( GLUtesselator *tess ); * winding of the new edge. */ #define AddWinding(eDst,eSrc) (eDst->winding += eSrc->winding, \ - eDst->Sym->winding += eSrc->Sym->winding) + eDst->Sym->winding += eSrc->Sym->winding) static void SweepEvent( GLUtesselator *tess, GLUvertex *vEvent ); static void WalkDirtyRegions( GLUtesselator *tess, ActiveRegion *regUp ); @@ -175,7 +177,7 @@ static int FixUpperEdge( ActiveRegion *reg, GLUhalfEdge *newEdge ) reg->eUp = newEdge; newEdge->activeRegion = reg; - return 1; + return 1; } static ActiveRegion *TopLeftRegion( ActiveRegion *reg ) @@ -225,7 +227,7 @@ static ActiveRegion *AddRegionBelow( GLUtesselator *tess, if (regNew == NULL) longjmp(tess->env,1); regNew->eUp = eNewUp; - /* __gl_dictListInsertBefore */ + /* __gl_dictListInsertBefore */ regNew->nodeUp = dictInsertBefore( tess->dict, regAbove->nodeUp, regNew ); if (regNew->nodeUp == NULL) longjmp(tess->env,1); regNew->fixUpperEdge = FALSE; @@ -292,7 +294,7 @@ static GLUhalfEdge *FinishLeftRegions( GLUtesselator *tess, * active region to the face, since at this point each face will belong * to at most one region (this was not necessarily true until this point * in the sweep). The walk stops at the region above regLast; if regLast - * is NULL we walk as far as possible. At the same time we relink the + * is NULL we walk as far as possible. At the same time we relink the * mesh if necessary, so that the ordering of edges around vOrg is the * same as in the dictionary. */ @@ -449,11 +451,11 @@ static void SpliceMergeVertices( GLUtesselator *tess, GLUhalfEdge *e1, data[0] = e1->Org->data; data[1] = e2->Org->data; CallCombine( tess, e1->Org, data, weights, FALSE ); - if ( !__gl_meshSplice( e1, e2 ) ) longjmp(tess->env,1); + if ( !__gl_meshSplice( e1, e2 ) ) longjmp(tess->env,1); } static void VertexWeights( GLUvertex *isect, GLUvertex *org, GLUvertex *dst, - GLfloat *weights ) + GLfloat *weights ) /* * Find some weights which describe how the intersection vertex is * a linear combination of "org" and "dest". Each of the two edges @@ -596,7 +598,7 @@ static int CheckForLeftSplice( GLUtesselator *tess, ActiveRegion *regUp ) /* eUp->Dst is below eLo, so splice eUp->Dst into eLo */ regUp->dirty = regLo->dirty = TRUE; e = __gl_meshSplitEdge( eLo ); - if (e == NULL) longjmp(tess->env,1); + if (e == NULL) longjmp(tess->env,1); if ( !__gl_meshSplice( eUp->Lnext, eLo->Sym ) ) longjmp(tess->env,1); e->Rface->inside = regUp->inside; } @@ -682,7 +684,7 @@ static int CheckForIntersect( GLUtesselator *tess, ActiveRegion *regUp ) return FALSE; } - if( (! VertEq( dstUp, tess->event ) + if( (! VertEq( dstUp, tess->event ) && EdgeSign( dstUp, tess->event, &isect ) >= 0) || (! VertEq( dstLo, tess->event ) && EdgeSign( dstLo, tess->event, &isect ) <= 0 )) @@ -705,7 +707,7 @@ static int CheckForIntersect( GLUtesselator *tess, ActiveRegion *regUp ) if( dstUp == tess->event ) { /* Splice dstUp into eLo, and process the new region(s) */ if (__gl_meshSplitEdge( eLo->Sym ) == NULL) longjmp(tess->env,1); - if ( !__gl_meshSplice( eUp->Lnext, eLo->Oprev ) ) longjmp(tess->env,1); + if ( !__gl_meshSplice( eUp->Lnext, eLo->Oprev ) ) longjmp(tess->env,1); regLo = regUp; regUp = TopRightRegion( regUp ); e = RegionBelow(regUp)->eUp->Rprev; @@ -813,7 +815,7 @@ static void WalkDirtyRegions( GLUtesselator *tess, ActiveRegion *regUp ) if( eUp->Org != eLo->Org ) { if( eUp->Dst != eLo->Dst && ! regUp->fixUpperEdge && ! regLo->fixUpperEdge - && (eUp->Dst == tess->event || eLo->Dst == tess->event) ) + && (eUp->Dst == tess->event || eLo->Dst == tess->event) ) { /* When all else fails in CheckForIntersect(), it uses tess->event * as the intersection location. To make this possible, it requires @@ -822,7 +824,7 @@ static void WalkDirtyRegions( GLUtesselator *tess, ActiveRegion *regUp ) * case it might splice one of these edges into tess->event, and * violate the invariant that fixable edges are the only right-going * edge from their associated vertex). - */ + */ if( CheckForIntersect( tess, regUp )) { /* WalkDirtyRegions() was called recursively; we're done */ return; @@ -846,7 +848,7 @@ static void WalkDirtyRegions( GLUtesselator *tess, ActiveRegion *regUp ) static void ConnectRightVertex( GLUtesselator *tess, ActiveRegion *regUp, - GLUhalfEdge *eBottomLeft ) + GLUhalfEdge *eBottomLeft ) /* * Purpose: connect a "right" vertex vEvent (one where all edges go left) * to the unprocessed portion of the mesh. Since there are no right-going @@ -959,7 +961,7 @@ static void ConnectLeftDegenerate( GLUtesselator *tess, SpliceMergeVertices( tess, e, vEvent->anEdge ); return; } - + if( ! VertEq( e->Dst, vEvent )) { /* General case -- splice vEvent into edge e which passes through it */ if (__gl_meshSplitEdge( e->Sym ) == NULL) longjmp(tess->env,1); @@ -969,7 +971,7 @@ static void ConnectLeftDegenerate( GLUtesselator *tess, regUp->fixUpperEdge = FALSE; } if ( !__gl_meshSplice( vEvent->anEdge, e ) ) longjmp(tess->env,1); - SweepEvent( tess, vEvent ); /* recurse */ + SweepEvent( tess, vEvent ); /* recurse */ return; } @@ -1075,9 +1077,9 @@ static void SweepEvent( GLUtesselator *tess, GLUvertex *vEvent ) ActiveRegion *regUp, *reg; GLUhalfEdge *e, *eTopLeft, *eBottomLeft; - tess->event = vEvent; /* for access in EdgeLeq() */ + tess->event = vEvent; /* for access in EdgeLeq() */ DebugEvent( tess ); - + /* Check if this vertex is the right endpoint of an edge that is * already in the dictionary. In this case we don't need to waste * time searching for the location to insert new edges. @@ -1143,7 +1145,7 @@ static void AddSentinel( GLUtesselator *tess, GLdouble t ) e->Org->t = t; e->Dst->s = -SENTINEL_COORD; e->Dst->t = t; - tess->event = e->Dst; /* initialize it */ + tess->event = e->Dst; /* initialize it */ reg->eUp = e; reg->windingNumber = 0; @@ -1193,7 +1195,7 @@ static void DoneEdgeDict( GLUtesselator *tess ) DeleteRegion( tess, reg ); /* __gl_meshDelete( reg->eUp );*/ } - dictDeleteDict( tess->dict ); /* __gl_dictListDeleteDict */ + dictDeleteDict( tess->dict ); /* __gl_dictListDeleteDict */ } @@ -1209,10 +1211,10 @@ static void RemoveDegenerateEdges( GLUtesselator *tess ) for( e = eHead->next; e != eHead; e = eNext ) { eNext = e->next; eLnext = e->Lnext; - + if( VertEq( e->Org, e->Dst ) && e->Lnext->Lnext != e ) { /* Zero-length edge, contour has at least 3 edges */ - + SpliceMergeVertices( tess, eLnext, e ); /* deletes e->Org */ if ( !__gl_meshDelete( e ) ) longjmp(tess->env,1); /* e is a self-loop */ e = eLnext; @@ -1220,7 +1222,7 @@ static void RemoveDegenerateEdges( GLUtesselator *tess ) } if( eLnext->Lnext == e ) { /* Degenerate contour (one or two edges) */ - + if( eLnext != e ) { if( eLnext == eNext || eLnext == eNext->Sym ) { eNext = eNext->next; } if ( !__gl_meshDelete( eLnext ) ) longjmp(tess->env,1); @@ -1327,7 +1329,7 @@ int __gl_computeInterior( GLUtesselator *tess ) for( ;; ) { vNext = (GLUvertex *)pqMinimum( tess->pq ); /* __gl_pqSortMinimum */ if( vNext == NULL || ! VertEq( vNext, v )) break; - + /* Merge together all vertices at exactly the same location. * This is more efficient than processing them one at a time, * simplifies the code (see ConnectLeftDegenerate), and is also @@ -1349,7 +1351,7 @@ int __gl_computeInterior( GLUtesselator *tess ) } /* Set tess->event for debugging purposes */ - /* __GL_DICTLISTKEY */ /* __GL_DICTLISTMIN */ + /* __GL_DICTLISTKEY */ /* __GL_DICTLISTMIN */ tess->event = ((ActiveRegion *) dictKey( dictMin( tess->dict )))->eUp->Org; DebugEvent( tess ); DoneEdgeDict( tess ); diff --git a/src/glu/sgi/libtess/tess.c b/src/glu/sgi/libtess/tess.c index 0793106334f..308b2f56b90 100644 --- a/src/glu/sgi/libtess/tess.c +++ b/src/glu/sgi/libtess/tess.c @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -35,8 +35,8 @@ /* ** Author: Eric Veach, July 1994. ** -** $Date: 2002/11/01 23:45:31 $ $Revision: 1.3 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/tess.c,v 1.3 2002/11/01 23:45:31 brianp Exp $ +** $Date: 2003/10/14 23:48:57 $ $Revision: 1.4 $ +** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/tess.c,v 1.4 2003/10/14 23:48:57 kendallb Exp $ */ #include "gluos.h" @@ -63,13 +63,13 @@ /*ARGSUSED*/ static void GLAPIENTRY noEnd( void ) {} /*ARGSUSED*/ static void GLAPIENTRY noError( GLenum errnum ) {} /*ARGSUSED*/ static void GLAPIENTRY noCombine( GLdouble coords[3], void *data[4], - GLfloat weight[4], void **dataOut ) {} + GLfloat weight[4], void **dataOut ) {} /*ARGSUSED*/ static void GLAPIENTRY noMesh( GLUmesh *mesh ) {} /*ARGSUSED*/ void GLAPIENTRY __gl_noBeginData( GLenum type, void *polygonData ) {} -/*ARGSUSED*/ void GLAPIENTRY __gl_noEdgeFlagData( GLboolean boundaryEdge, +/*ARGSUSED*/ void GLAPIENTRY __gl_noEdgeFlagData( GLboolean boundaryEdge, void *polygonData ) {} /*ARGSUSED*/ void GLAPIENTRY __gl_noVertexData( void *data, void *polygonData ) {} @@ -85,9 +85,10 @@ /* Half-edges are allocated in pairs (see mesh.c) */ typedef struct { GLUhalfEdge e, eSym; } EdgePair; +#undef MAX #define MAX(a,b) ((a) > (b) ? (a) : (b)) #define MAX_FAST_ALLOC (MAX(sizeof(EdgePair), \ - MAX(sizeof(GLUvertex),sizeof(GLUface)))) + MAX(sizeof(GLUvertex),sizeof(GLUface)))) GLUtesselator * GLAPIENTRY @@ -170,7 +171,7 @@ static void GotoState( GLUtesselator *tess, enum TessState newState ) gluTessBeginContour( tess ); break; default: - ; + ; } } else { switch( tess->state ) { @@ -184,7 +185,7 @@ static void GotoState( GLUtesselator *tess, enum TessState newState ) MakeDormant( tess ); break; default: - ; + ; } } } @@ -246,7 +247,7 @@ gluGetTessProperty( GLUtesselator *tess, GLenum which, GLdouble *value ) /* tolerance should be in range [0..1] */ assert(0.0 <= tess->relTolerance && tess->relTolerance <= 1.0); *value= tess->relTolerance; - break; + break; case GLU_TESS_WINDING_RULE: assert(tess->windingRule == GLU_TESS_WINDING_ODD || tess->windingRule == GLU_TESS_WINDING_NONZERO || @@ -295,7 +296,7 @@ gluTessCallback( GLUtesselator *tess, GLenum which, _GLUfuncptr fn) return; case GLU_TESS_EDGE_FLAG_DATA: tess->callEdgeFlagData= (fn == NULL) ? - &__gl_noEdgeFlagData : (void (GLAPIENTRY *)(GLboolean, void *)) fn; + &__gl_noEdgeFlagData : (void (GLAPIENTRY *)(GLboolean, void *)) fn; /* If the client wants boundary edges to be flagged, * we render everything as separate triangles (no strips or fans). */ @@ -313,8 +314,8 @@ gluTessCallback( GLUtesselator *tess, GLenum which, _GLUfuncptr fn) tess->callEnd = (fn == NULL) ? &noEnd : (void (GLAPIENTRY *)(void)) fn; return; case GLU_TESS_END_DATA: - tess->callEndData = (fn == NULL) ? &__gl_noEndData : - (void (GLAPIENTRY *)(void *)) fn; + tess->callEndData = (fn == NULL) ? &__gl_noEndData : + (void (GLAPIENTRY *)(void *)) fn; return; case GLU_TESS_ERROR: tess->callError = (fn == NULL) ? &noError : (void (GLAPIENTRY *)(GLenum)) fn; @@ -329,9 +330,9 @@ gluTessCallback( GLUtesselator *tess, GLenum which, _GLUfuncptr fn) return; case GLU_TESS_COMBINE_DATA: tess->callCombineData = (fn == NULL) ? &__gl_noCombineData : - (void (GLAPIENTRY *)(GLdouble [3], - void *[4], - GLfloat [4], + (void (GLAPIENTRY *)(GLdouble [3], + void *[4], + GLfloat [4], void **, void *)) fn; return; @@ -368,7 +369,7 @@ static int AddVertex( GLUtesselator *tess, GLdouble coords[3], void *data ) e->Org->coords[0] = coords[0]; e->Org->coords[1] = coords[1]; e->Org->coords[2] = coords[2]; - + /* The winding of an edge says how the winding number changes as we * cross from the edge''s right face to its left face. We add the * vertices in such an order that a CCW contour will add +1 to @@ -503,7 +504,7 @@ gluTessEndPolygon( GLUtesselator *tess ) { GLUmesh *mesh; - if (setjmp(tess->env) != 0) { + if (setjmp(tess->env) != 0) { /* come back here if out of memory */ CALL_ERROR_OR_ERROR_DATA( GLU_OUT_OF_MEMORY ); return; @@ -521,7 +522,7 @@ gluTessEndPolygon( GLUtesselator *tess ) * an explicit mesh either. */ if( __gl_renderCache( tess )) { - tess->polygonData= NULL; + tess->polygonData= NULL; return; } } @@ -554,15 +555,15 @@ gluTessEndPolygon( GLUtesselator *tess ) if( tess->boundaryOnly ) { rc = __gl_meshSetWindingNumber( mesh, 1, TRUE ); } else { - rc = __gl_meshTessellateInterior( mesh ); + rc = __gl_meshTessellateInterior( mesh ); } if (rc == 0) longjmp(tess->env,1); /* could've used a label */ __gl_meshCheckMesh( mesh ); if( tess->callBegin != &noBegin || tess->callEnd != &noEnd - || tess->callVertex != &noVertex || tess->callEdgeFlag != &noEdgeFlag - || tess->callBeginData != &__gl_noBeginData + || tess->callVertex != &noVertex || tess->callEdgeFlag != &noEdgeFlag + || tess->callBeginData != &__gl_noBeginData || tess->callEndData != &__gl_noEndData || tess->callVertexData != &__gl_noVertexData || tess->callEdgeFlagData != &__gl_noEdgeFlagData ) diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index 5b275fa50d1..4ee54533582 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -31,8 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2002/11/01 23:45:31 $ $Revision: 1.3 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libutil/mipmap.c,v 1.3 2002/11/01 23:45:31 brianp Exp $ +** $Date: 2003/10/14 23:48:58 $ $Revision: 1.4 $ +** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libutil/mipmap.c,v 1.4 2003/10/14 23:48:58 kendallb Exp $ */ #include "gluos.h" @@ -55,11 +55,11 @@ typedef union { float f; } Type_Widget; -/* Pixel storage modes */ +/* Pixel storage modes */ typedef struct { GLint pack_alignment; - GLint pack_row_length; - GLint pack_skip_rows; + GLint pack_row_length; + GLint pack_skip_rows; GLint pack_skip_pixels; GLint pack_lsb_first; GLint pack_swap_bytes; @@ -76,20 +76,20 @@ typedef struct { GLint unpack_image_height; } PixelStorageModes; -static int gluBuild1DMipmapLevelsCore(GLenum, GLint, +static int gluBuild1DMipmapLevelsCore(GLenum, GLint, GLsizei, GLsizei, - GLenum, GLenum, GLint, GLint, GLint, + GLenum, GLenum, GLint, GLint, GLint, const void *); -static int gluBuild2DMipmapLevelsCore(GLenum, GLint, - GLsizei, GLsizei, - GLsizei, GLsizei, - GLenum, GLenum, GLint, GLint, GLint, +static int gluBuild2DMipmapLevelsCore(GLenum, GLint, + GLsizei, GLsizei, + GLsizei, GLsizei, + GLenum, GLenum, GLint, GLint, GLint, const void *); -static int gluBuild3DMipmapLevelsCore(GLenum, GLint, +static int gluBuild3DMipmapLevelsCore(GLenum, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLsizei, GLsizei, - GLenum, GLenum, GLint, GLint, GLint, + GLenum, GLenum, GLint, GLint, GLint, const void *); /* @@ -100,58 +100,58 @@ static GLint elements_per_group(GLenum format, GLenum type); static GLint is_index(GLenum format); static GLint image_size(GLint width, GLint height, GLenum format, GLenum type); static void fill_image(const PixelStorageModes *, - GLint width, GLint height, GLenum format, - GLenum type, GLboolean index_format, + GLint width, GLint height, GLenum format, + GLenum type, GLboolean index_format, const void *userdata, GLushort *newimage); static void empty_image(const PixelStorageModes *, - GLint width, GLint height, GLenum format, - GLenum type, GLboolean index_format, + GLint width, GLint height, GLenum format, + GLenum type, GLboolean index_format, const GLushort *oldimage, void *userdata); -static void scale_internal(GLint components, GLint widthin, GLint heightin, - const GLushort *datain, - GLint widthout, GLint heightout, +static void scale_internal(GLint components, GLint widthin, GLint heightin, + const GLushort *datain, + GLint widthout, GLint heightout, GLushort *dataout); -static void scale_internal_ubyte(GLint components, GLint widthin, - GLint heightin, const GLubyte *datain, - GLint widthout, GLint heightout, +static void scale_internal_ubyte(GLint components, GLint widthin, + GLint heightin, const GLubyte *datain, + GLint widthout, GLint heightout, GLubyte *dataout, GLint element_size, GLint ysize, GLint group_size); static void scale_internal_byte(GLint components, GLint widthin, - GLint heightin, const GLbyte *datain, - GLint widthout, GLint heightout, - GLbyte *dataout, GLint element_size, - GLint ysize, GLint group_size); + GLint heightin, const GLbyte *datain, + GLint widthout, GLint heightout, + GLbyte *dataout, GLint element_size, + GLint ysize, GLint group_size); static void scale_internal_ushort(GLint components, GLint widthin, - GLint heightin, const GLushort *datain, - GLint widthout, GLint heightout, - GLushort *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes); + GLint heightin, const GLushort *datain, + GLint widthout, GLint heightout, + GLushort *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes); static void scale_internal_short(GLint components, GLint widthin, - GLint heightin, const GLshort *datain, - GLint widthout, GLint heightout, - GLshort *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes); + GLint heightin, const GLshort *datain, + GLint widthout, GLint heightout, + GLshort *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes); static void scale_internal_uint(GLint components, GLint widthin, - GLint heightin, const GLuint *datain, - GLint widthout, GLint heightout, - GLuint *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes); + GLint heightin, const GLuint *datain, + GLint widthout, GLint heightout, + GLuint *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes); static void scale_internal_int(GLint components, GLint widthin, - GLint heightin, const GLint *datain, - GLint widthout, GLint heightout, - GLint *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes); + GLint heightin, const GLint *datain, + GLint widthout, GLint heightout, + GLint *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes); static void scale_internal_float(GLint components, GLint widthin, - GLint heightin, const GLfloat *datain, - GLint widthout, GLint heightout, - GLfloat *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes); + GLint heightin, const GLfloat *datain, + GLint widthout, GLint heightout, + GLfloat *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes); static int checkMipmapArgs(GLenum, GLenum, GLenum); static GLboolean legalFormat(GLenum); @@ -231,27 +231,27 @@ static void halve1DimagePackedPixel(int, static void halve1Dimage_ubyte(GLint, GLuint, GLuint,const GLubyte *, GLubyte *, GLint, GLint, GLint); -static void halve1Dimage_byte(GLint, GLuint, GLuint,const GLbyte *, GLbyte *, +static void halve1Dimage_byte(GLint, GLuint, GLuint,const GLbyte *, GLbyte *, GLint, GLint, GLint); static void halve1Dimage_ushort(GLint, GLuint, GLuint, const GLushort *, GLushort *, GLint, GLint, GLint, GLint); -static void halve1Dimage_short(GLint, GLuint, GLuint,const GLshort *, GLshort *, +static void halve1Dimage_short(GLint, GLuint, GLuint,const GLshort *, GLshort *, GLint, GLint, GLint, GLint); -static void halve1Dimage_uint(GLint, GLuint, GLuint, const GLuint *, GLuint *, +static void halve1Dimage_uint(GLint, GLuint, GLuint, const GLuint *, GLuint *, GLint, GLint, GLint, GLint); -static void halve1Dimage_int(GLint, GLuint, GLuint, const GLint *, GLint *, +static void halve1Dimage_int(GLint, GLuint, GLuint, const GLint *, GLint *, GLint, GLint, GLint, GLint); -static void halve1Dimage_float(GLint, GLuint, GLuint, const GLfloat *, GLfloat *, +static void halve1Dimage_float(GLint, GLuint, GLuint, const GLfloat *, GLfloat *, GLint, GLint, GLint, GLint); static GLint imageSize3D(GLint, GLint, GLint, GLenum,GLenum); -static void fillImage3D(const PixelStorageModes *, GLint, GLint, GLint,GLenum, +static void fillImage3D(const PixelStorageModes *, GLint, GLint, GLint,GLenum, GLenum, GLboolean, const void *, GLushort *); static void emptyImage3D(const PixelStorageModes *, - GLint, GLint, GLint, GLenum, - GLenum, GLboolean, + GLint, GLint, GLint, GLenum, + GLenum, GLboolean, const GLushort *, void *); -static void scaleInternal3D(GLint, GLint, GLint, GLint, const GLushort *, +static void scaleInternal3D(GLint, GLint, GLint, GLint, const GLushort *, GLint, GLint, GLint, GLushort *); static void retrieveStoreModes(PixelStorageModes *psm) @@ -312,8 +312,8 @@ static int computeLog(GLuint value) } } -/* -** Compute the nearest power of 2 number. This algorithm is a little +/* +** Compute the nearest power of 2 number. This algorithm is a little ** strange, but it works quite well. */ static int nearestPower(GLuint value) @@ -341,10 +341,10 @@ static int nearestPower(GLuint value) #define __GLU_SWAP_4_BYTES(s)\ (GLuint)(((GLuint)((const GLubyte*)(s))[3])<<24 | \ - ((GLuint)((const GLubyte*)(s))[2])<<16 | \ - ((GLuint)((const GLubyte*)(s))[1])<<8 | ((const GLubyte*)(s))[0]) + ((GLuint)((const GLubyte*)(s))[2])<<16 | \ + ((GLuint)((const GLubyte*)(s))[1])<<8 | ((const GLubyte*)(s))[0]) -static void halveImage(GLint components, GLuint width, GLuint height, +static void halveImage(GLint components, GLuint width, GLuint height, const GLushort *datain, GLushort *dataout) { int i, j, k; @@ -363,7 +363,7 @@ static void halveImage(GLint components, GLuint width, GLuint height, for (i = 0; i < newheight; i++) { for (j = 0; j < newwidth; j++) { for (k = 0; k < components; k++) { - s[0] = (t[0] + t[components] + t[delta] + + s[0] = (t[0] + t[components] + t[delta] + t[delta+components] + 2) / 4; s++; t++; } @@ -373,7 +373,7 @@ static void halveImage(GLint components, GLuint width, GLuint height, } } -static void halveImage_ubyte(GLint components, GLuint width, GLuint height, +static void halveImage_ubyte(GLint components, GLuint width, GLuint height, const GLubyte *datain, GLubyte *dataout, GLint element_size, GLint ysize, GLint group_size) { @@ -399,11 +399,11 @@ static void halveImage_ubyte(GLint components, GLuint width, GLuint height, for (i = 0; i < newheight; i++) { for (j = 0; j < newwidth; j++) { for (k = 0; k < components; k++) { - s[0] = (*(const GLubyte*)t + + s[0] = (*(const GLubyte*)t + *(const GLubyte*)(t+group_size) + - *(const GLubyte*)(t+ysize) + - *(const GLubyte*)(t+ysize+group_size) + 2) / 4; - s++; t += element_size; + *(const GLubyte*)(t+ysize) + + *(const GLubyte*)(t+ysize+group_size) + 2) / 4; + s++; t += element_size; } t += group_size; } @@ -412,9 +412,9 @@ static void halveImage_ubyte(GLint components, GLuint width, GLuint height, } /* */ -static void halve1Dimage_ubyte(GLint components, GLuint width, GLuint height, - const GLubyte *dataIn, GLubyte *dataOut, - GLint element_size, GLint ysize, +static void halve1Dimage_ubyte(GLint components, GLuint width, GLuint height, + const GLubyte *dataIn, GLubyte *dataOut, + GLint element_size, GLint ysize, GLint group_size) { GLint halfWidth= width / 2; @@ -437,19 +437,19 @@ static void halve1Dimage_ubyte(GLint components, GLuint width, GLuint height, *(const GLubyte*)(src+group_size)) / 2; src+= element_size; - dest++; - } + dest++; + } src+= group_size; /* skip to next 2 */ } { - int padBytes= ysize - (width*group_size); + int padBytes= ysize - (width*group_size); src+= padBytes; /* for assertion only */ } } else if (width == 1) { /* 1 column */ int padBytes= ysize - (width * group_size); assert(height != 1); /* widthxheight can't be 1x1 */ - halfWidth= 1; + halfWidth= 1; /* one vertical column with possible pad bytes per row */ /* average two at a time */ @@ -460,7 +460,7 @@ static void halve1Dimage_ubyte(GLint components, GLuint width, GLuint height, src+= element_size; dest++; - } + } src+= padBytes; /* add pad bytes, if any, to get to end to row */ src+= ysize; } @@ -471,7 +471,7 @@ static void halve1Dimage_ubyte(GLint components, GLuint width, GLuint height, [components * element_size * halfWidth * halfHeight]); } /* halve1Dimage_ubyte() */ -static void halveImage_byte(GLint components, GLuint width, GLuint height, +static void halveImage_byte(GLint components, GLuint width, GLuint height, const GLbyte *datain, GLbyte *dataout, GLint element_size, GLint ysize, GLint group_size) @@ -498,11 +498,11 @@ static void halveImage_byte(GLint components, GLuint width, GLuint height, for (i = 0; i < newheight; i++) { for (j = 0; j < newwidth; j++) { for (k = 0; k < components; k++) { - s[0] = (*(const GLbyte*)t + + s[0] = (*(const GLbyte*)t + *(const GLbyte*)(t+group_size) + - *(const GLbyte*)(t+ysize) + - *(const GLbyte*)(t+ysize+group_size) + 2) / 4; - s++; t += element_size; + *(const GLbyte*)(t+ysize) + + *(const GLbyte*)(t+ysize+group_size) + 2) / 4; + s++; t += element_size; } t += group_size; } @@ -510,8 +510,8 @@ static void halveImage_byte(GLint components, GLuint width, GLuint height, } } -static void halve1Dimage_byte(GLint components, GLuint width, GLuint height, - const GLbyte *dataIn, GLbyte *dataOut, +static void halve1Dimage_byte(GLint components, GLuint width, GLuint height, + const GLbyte *dataIn, GLbyte *dataOut, GLint element_size,GLint ysize, GLint group_size) { GLint halfWidth= width / 2; @@ -533,19 +533,19 @@ static void halve1Dimage_byte(GLint components, GLuint width, GLuint height, *dest= (*(const GLbyte*)src + *(const GLbyte*)(src+group_size)) / 2; src+= element_size; - dest++; - } + dest++; + } src+= group_size; /* skip to next 2 */ } { - int padBytes= ysize - (width*group_size); + int padBytes= ysize - (width*group_size); src+= padBytes; /* for assertion only */ } } else if (width == 1) { /* 1 column */ int padBytes= ysize - (width * group_size); assert(height != 1); /* widthxheight can't be 1x1 */ - halfWidth= 1; + halfWidth= 1; /* one vertical column with possible pad bytes per row */ /* average two at a time */ @@ -556,7 +556,7 @@ static void halve1Dimage_byte(GLint components, GLuint width, GLuint height, src+= element_size; dest++; - } + } src+= padBytes; /* add pad bytes, if any, to get to end to row */ src+= ysize; } @@ -568,8 +568,8 @@ static void halve1Dimage_byte(GLint components, GLuint width, GLuint height, [components * element_size * halfWidth * halfHeight]); } /* halve1Dimage_byte() */ -static void halveImage_ushort(GLint components, GLuint width, GLuint height, - const GLushort *datain, GLushort *dataout, +static void halveImage_ushort(GLint components, GLuint width, GLuint height, + const GLushort *datain, GLushort *dataout, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes) { @@ -596,9 +596,9 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height, for (i = 0; i < newheight; i++) { for (j = 0; j < newwidth; j++) { for (k = 0; k < components; k++) { - s[0] = (*(const GLushort*)t + - *(const GLushort*)(t+group_size) + - *(const GLushort*)(t+ysize) + + s[0] = (*(const GLushort*)t + + *(const GLushort*)(t+group_size) + + *(const GLushort*)(t+ysize) + *(const GLushort*)(t+ysize+group_size) + 2) / 4; s++; t += element_size; } @@ -608,23 +608,23 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height, } else for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { s[0] = (__GLU_SWAP_2_BYTES(t) + __GLU_SWAP_2_BYTES(t+group_size) + __GLU_SWAP_2_BYTES(t+ysize) + __GLU_SWAP_2_BYTES(t+ysize+group_size)+ 2)/4; - s++; t += element_size; + s++; t += element_size; } t += group_size; - } - t += ysize; + } + t += ysize; } } -static void halve1Dimage_ushort(GLint components, GLuint width, GLuint height, - const GLushort *dataIn, GLushort *dataOut, - GLint element_size, GLint ysize, +static void halve1Dimage_ushort(GLint components, GLuint width, GLuint height, + const GLushort *dataIn, GLushort *dataOut, + GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes) { GLint halfWidth= width / 2; @@ -656,19 +656,19 @@ static void halve1Dimage_ushort(GLint components, GLuint width, GLuint height, *dest= (ushort[0] + ushort[1]) / 2; src+= element_size; - dest++; - } + dest++; + } src+= group_size; /* skip to next 2 */ } { - int padBytes= ysize - (width*group_size); + int padBytes= ysize - (width*group_size); src+= padBytes; /* for assertion only */ } } else if (width == 1) { /* 1 column */ int padBytes= ysize - (width * group_size); assert(height != 1); /* widthxheight can't be 1x1 */ - halfWidth= 1; + halfWidth= 1; /* one vertical column with possible pad bytes per row */ /* average two at a time */ @@ -689,7 +689,7 @@ static void halve1Dimage_ushort(GLint components, GLuint width, GLuint height, src+= element_size; dest++; - } + } src+= padBytes; /* add pad bytes, if any, to get to end to row */ src+= ysize; } @@ -703,7 +703,7 @@ static void halve1Dimage_ushort(GLint components, GLuint width, GLuint height, } /* halve1Dimage_ushort() */ -static void halveImage_short(GLint components, GLuint width, GLuint height, +static void halveImage_short(GLint components, GLuint width, GLuint height, const GLshort *datain, GLshort *dataout, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes) @@ -731,9 +731,9 @@ static void halveImage_short(GLint components, GLuint width, GLuint height, for (i = 0; i < newheight; i++) { for (j = 0; j < newwidth; j++) { for (k = 0; k < components; k++) { - s[0] = (*(const GLshort*)t + - *(const GLshort*)(t+group_size) + - *(const GLshort*)(t+ysize) + + s[0] = (*(const GLshort*)t + + *(const GLshort*)(t+group_size) + + *(const GLshort*)(t+ysize) + *(const GLshort*)(t+ysize+group_size) + 2) / 4; s++; t += element_size; } @@ -743,30 +743,30 @@ static void halveImage_short(GLint components, GLuint width, GLuint height, } else for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { GLushort b; GLint buf; - b = __GLU_SWAP_2_BYTES(t); + b = __GLU_SWAP_2_BYTES(t); buf = *(const GLshort*)&b; - b = __GLU_SWAP_2_BYTES(t+group_size); + b = __GLU_SWAP_2_BYTES(t+group_size); buf += *(const GLshort*)&b; - b = __GLU_SWAP_2_BYTES(t+ysize); + b = __GLU_SWAP_2_BYTES(t+ysize); buf += *(const GLshort*)&b; - b = __GLU_SWAP_2_BYTES(t+ysize+group_size); + b = __GLU_SWAP_2_BYTES(t+ysize+group_size); buf += *(const GLshort*)&b; s[0] = (GLshort)((buf+2)/4); - s++; t += element_size; + s++; t += element_size; } t += group_size; - } - t += ysize; + } + t += ysize; } } -static void halve1Dimage_short(GLint components, GLuint width, GLuint height, - const GLshort *dataIn, GLshort *dataOut, - GLint element_size, GLint ysize, +static void halve1Dimage_short(GLint components, GLuint width, GLuint height, + const GLshort *dataIn, GLshort *dataOut, + GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes) { GLint halfWidth= width / 2; @@ -798,19 +798,19 @@ static void halve1Dimage_short(GLint components, GLuint width, GLuint height, *dest= (sshort[0] + sshort[1]) / 2; src+= element_size; - dest++; - } + dest++; + } src+= group_size; /* skip to next 2 */ } { - int padBytes= ysize - (width*group_size); + int padBytes= ysize - (width*group_size); src+= padBytes; /* for assertion only */ } } else if (width == 1) { /* 1 column */ int padBytes= ysize - (width * group_size); assert(height != 1); /* widthxheight can't be 1x1 */ - halfWidth= 1; + halfWidth= 1; /* one vertical column with possible pad bytes per row */ /* average two at a time */ @@ -831,7 +831,7 @@ static void halve1Dimage_short(GLint components, GLuint width, GLuint height, src+= element_size; dest++; - } + } src+= padBytes; /* add pad bytes, if any, to get to end to row */ src+= ysize; } @@ -845,8 +845,8 @@ static void halve1Dimage_short(GLint components, GLuint width, GLuint height, } /* halve1Dimage_short() */ -static void halveImage_uint(GLint components, GLuint width, GLuint height, - const GLuint *datain, GLuint *dataout, +static void halveImage_uint(GLint components, GLuint width, GLuint height, + const GLuint *datain, GLuint *dataout, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes) { @@ -869,15 +869,15 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height, t = (const char *)datain; /* Piece o' cake! */ - if (!myswap_bytes) + if (!myswap_bytes) for (i = 0; i < newheight; i++) { for (j = 0; j < newwidth; j++) { for (k = 0; k < components; k++) { - /* need to cast to double to hold large unsigned ints */ - s[0] = ((double)*(const GLuint*)t + - (double)*(const GLuint*)(t+group_size) + - (double)*(const GLuint*)(t+ysize) + - (double)*(const GLuint*)(t+ysize+group_size))/4 + 0.5; + /* need to cast to double to hold large unsigned ints */ + s[0] = ((double)*(const GLuint*)t + + (double)*(const GLuint*)(t+group_size) + + (double)*(const GLuint*)(t+ysize) + + (double)*(const GLuint*)(t+ysize+group_size))/4 + 0.5; s++; t += element_size; } @@ -887,28 +887,28 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height, } else for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { - /* need to cast to double to hold large unsigned ints */ + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { + /* need to cast to double to hold large unsigned ints */ GLdouble buf; - buf = (GLdouble)__GLU_SWAP_4_BYTES(t) + - (GLdouble)__GLU_SWAP_4_BYTES(t+group_size) + - (GLdouble)__GLU_SWAP_4_BYTES(t+ysize) + - (GLdouble)__GLU_SWAP_4_BYTES(t+ysize+group_size); - s[0] = (GLuint)(buf/4 + 0.5); + buf = (GLdouble)__GLU_SWAP_4_BYTES(t) + + (GLdouble)__GLU_SWAP_4_BYTES(t+group_size) + + (GLdouble)__GLU_SWAP_4_BYTES(t+ysize) + + (GLdouble)__GLU_SWAP_4_BYTES(t+ysize+group_size); + s[0] = (GLuint)(buf/4 + 0.5); s++; t += element_size; } t += group_size; - } - t += ysize; + } + t += ysize; } } /* */ -static void halve1Dimage_uint(GLint components, GLuint width, GLuint height, - const GLuint *dataIn, GLuint *dataOut, - GLint element_size, GLint ysize, +static void halve1Dimage_uint(GLint components, GLuint width, GLuint height, + const GLuint *dataIn, GLuint *dataOut, + GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes) { GLint halfWidth= width / 2; @@ -937,22 +937,22 @@ static void halve1Dimage_uint(GLint components, GLuint width, GLuint height, uint[0]= *(const GLuint*)src; uint[1]= *(const GLuint*)(src+group_size); } - *dest= ((double)uint[0]+(double)uint[1])/2.0; + *dest= ((double)uint[0]+(double)uint[1])/2.0; src+= element_size; - dest++; - } + dest++; + } src+= group_size; /* skip to next 2 */ } { - int padBytes= ysize - (width*group_size); + int padBytes= ysize - (width*group_size); src+= padBytes; /* for assertion only */ } } else if (width == 1) { /* 1 column */ int padBytes= ysize - (width * group_size); assert(height != 1); /* widthxheight can't be 1x1 */ - halfWidth= 1; + halfWidth= 1; /* one vertical column with possible pad bytes per row */ /* average two at a time */ @@ -973,7 +973,7 @@ static void halve1Dimage_uint(GLint components, GLuint width, GLuint height, src+= element_size; dest++; - } + } src+= padBytes; /* add pad bytes, if any, to get to end to row */ src+= ysize; } @@ -986,8 +986,8 @@ static void halve1Dimage_uint(GLint components, GLuint width, GLuint height, } /* halve1Dimage_uint() */ -static void halveImage_int(GLint components, GLuint width, GLuint height, - const GLint *datain, GLint *dataout, GLint element_size, +static void halveImage_int(GLint components, GLuint width, GLuint height, + const GLint *datain, GLint *dataout, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes) { int i, j, k; @@ -1009,13 +1009,13 @@ static void halveImage_int(GLint components, GLuint width, GLuint height, t = (const char *)datain; /* Piece o' cake! */ - if (!myswap_bytes) + if (!myswap_bytes) for (i = 0; i < newheight; i++) { for (j = 0; j < newwidth; j++) { for (k = 0; k < components; k++) { - s[0] = ((float)*(const GLint*)t + - (float)*(const GLint*)(t+group_size) + - (float)*(const GLint*)(t+ysize) + + s[0] = ((float)*(const GLint*)t + + (float)*(const GLint*)(t+group_size) + + (float)*(const GLint*)(t+ysize) + (float)*(const GLint*)(t+ysize+group_size))/4 + 0.5; s++; t += element_size; } @@ -1023,34 +1023,34 @@ static void halveImage_int(GLint components, GLuint width, GLuint height, } t += ysize; } - else + else for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { GLuint b; - GLfloat buf; - b = __GLU_SWAP_4_BYTES(t); - buf = *(GLint*)&b; - b = __GLU_SWAP_4_BYTES(t+group_size); - buf += *(GLint*)&b; - b = __GLU_SWAP_4_BYTES(t+ysize); - buf += *(GLint*)&b; - b = __GLU_SWAP_4_BYTES(t+ysize+group_size); - buf += *(GLint*)&b; - s[0] = (GLint)(buf/4 + 0.5); - - s++; t += element_size; + GLfloat buf; + b = __GLU_SWAP_4_BYTES(t); + buf = *(GLint*)&b; + b = __GLU_SWAP_4_BYTES(t+group_size); + buf += *(GLint*)&b; + b = __GLU_SWAP_4_BYTES(t+ysize); + buf += *(GLint*)&b; + b = __GLU_SWAP_4_BYTES(t+ysize+group_size); + buf += *(GLint*)&b; + s[0] = (GLint)(buf/4 + 0.5); + + s++; t += element_size; } t += group_size; - } - t += ysize; + } + t += ysize; } } /* */ -static void halve1Dimage_int(GLint components, GLuint width, GLuint height, - const GLint *dataIn, GLint *dataOut, - GLint element_size, GLint ysize, +static void halve1Dimage_int(GLint components, GLuint width, GLuint height, + const GLint *dataIn, GLint *dataOut, + GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes) { GLint halfWidth= width / 2; @@ -1082,19 +1082,19 @@ static void halve1Dimage_int(GLint components, GLuint width, GLuint height, *dest= ((float)uint[0]+(float)uint[1])/2.0; src+= element_size; - dest++; - } + dest++; + } src+= group_size; /* skip to next 2 */ } { - int padBytes= ysize - (width*group_size); + int padBytes= ysize - (width*group_size); src+= padBytes; /* for assertion only */ } } else if (width == 1) { /* 1 column */ int padBytes= ysize - (width * group_size); assert(height != 1); /* widthxheight can't be 1x1 */ - halfWidth= 1; + halfWidth= 1; /* one vertical column with possible pad bytes per row */ /* average two at a time */ @@ -1115,7 +1115,7 @@ static void halve1Dimage_int(GLint components, GLuint width, GLuint height, src+= element_size; dest++; - } + } src+= padBytes; /* add pad bytes, if any, to get to end to row */ src+= ysize; } @@ -1129,8 +1129,8 @@ static void halve1Dimage_int(GLint components, GLuint width, GLuint height, } /* halve1Dimage_int() */ -static void halveImage_float(GLint components, GLuint width, GLuint height, - const GLfloat *datain, GLfloat *dataout, +static void halveImage_float(GLint components, GLuint width, GLuint height, + const GLfloat *datain, GLfloat *dataout, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes) { @@ -1157,9 +1157,9 @@ static void halveImage_float(GLint components, GLuint width, GLuint height, for (i = 0; i < newheight; i++) { for (j = 0; j < newwidth; j++) { for (k = 0; k < components; k++) { - s[0] = (*(const GLfloat*)t + - *(const GLfloat*)(t+group_size) + - *(const GLfloat*)(t+ysize) + + s[0] = (*(const GLfloat*)t + + *(const GLfloat*)(t+group_size) + + *(const GLfloat*)(t+ysize) + *(const GLfloat*)(t+ysize+group_size)) / 4; s++; t += element_size; } @@ -1167,38 +1167,38 @@ static void halveImage_float(GLint components, GLuint width, GLuint height, } t += ysize; } - else + else for (i = 0; i < newheight; i++) { - for (j = 0; j < newwidth; j++) { - for (k = 0; k < components; k++) { + for (j = 0; j < newwidth; j++) { + for (k = 0; k < components; k++) { GLuint b; - b = __GLU_SWAP_4_BYTES(t); - s[0] = *(GLfloat*)&b; - b = __GLU_SWAP_4_BYTES(t+group_size); - s[0] += *(GLfloat*)&b; - b = __GLU_SWAP_4_BYTES(t+ysize); - s[0] += *(GLfloat*)&b; - b = __GLU_SWAP_4_BYTES(t+ysize+group_size); - s[0] += *(GLfloat*)&b; + b = __GLU_SWAP_4_BYTES(t); + s[0] = *(GLfloat*)&b; + b = __GLU_SWAP_4_BYTES(t+group_size); + s[0] += *(GLfloat*)&b; + b = __GLU_SWAP_4_BYTES(t+ysize); + s[0] += *(GLfloat*)&b; + b = __GLU_SWAP_4_BYTES(t+ysize+group_size); + s[0] += *(GLfloat*)&b; s[0] /= 4; - s++; t += element_size; + s++; t += element_size; } t += group_size; - } - t += ysize; + } + t += ysize; } } /* */ -static void halve1Dimage_float(GLint components, GLuint width, GLuint height, - const GLfloat *dataIn, GLfloat *dataOut, - GLint element_size, GLint ysize, +static void halve1Dimage_float(GLint components, GLuint width, GLuint height, + const GLfloat *dataIn, GLfloat *dataOut, + GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes) { GLint halfWidth= width / 2; GLint halfHeight= height / 2; const char *src= (const char *) dataIn; - GLfloat *dest= dataOut; + GLfloat *dest= dataOut; int jj; assert(width == 1 || height == 1); /* must be 1D */ @@ -1224,19 +1224,19 @@ static void halve1Dimage_float(GLint components, GLuint width, GLuint height, *dest= (sfloat[0] + sfloat[1]) / 2.0; src+= element_size; - dest++; - } + dest++; + } src+= group_size; /* skip to next 2 */ } { - int padBytes= ysize - (width*group_size); + int padBytes= ysize - (width*group_size); src+= padBytes; /* for assertion only */ } } else if (width == 1) { /* 1 column */ int padBytes= ysize - (width * group_size); assert(height != 1); /* widthxheight can't be 1x1 */ - halfWidth= 1; + halfWidth= 1; /* one vertical column with possible pad bytes per row */ /* average two at a time */ @@ -1257,7 +1257,7 @@ static void halve1Dimage_float(GLint components, GLuint width, GLuint height, src+= element_size; dest++; - } + } src+= padBytes; /* add pad bytes, if any, to get to end to row */ src+= ysize; /* skip to odd row */ } @@ -1268,9 +1268,9 @@ static void halve1Dimage_float(GLint components, GLuint width, GLuint height, [components * element_size * halfWidth * halfHeight]); } /* halve1Dimage_float() */ -static void scale_internal(GLint components, GLint widthin, GLint heightin, - const GLushort *datain, - GLint widthout, GLint heightout, +static void scale_internal(GLint components, GLint widthin, GLint heightin, + const GLushort *datain, + GLint widthout, GLint heightout, GLushort *dataout) { float x, lowx, highx, convx, halfconvx; @@ -1364,9 +1364,9 @@ static void scale_internal(GLint components, GLint widthin, GLint heightin, } } -static void scale_internal_ubyte(GLint components, GLint widthin, - GLint heightin, const GLubyte *datain, - GLint widthout, GLint heightout, +static void scale_internal_ubyte(GLint components, GLint widthin, + GLint heightin, const GLubyte *datain, + GLint widthout, GLint heightout, GLubyte *dataout, GLint element_size, GLint ysize, GLint group_size) { @@ -1391,8 +1391,8 @@ static void scale_internal_ubyte(GLint components, GLint widthin, const char *left, *right; if (widthin == widthout*2 && heightin == heightout*2) { - halveImage_ubyte(components, widthin, heightin, - (const GLubyte *)datain, (GLubyte *)dataout, + halveImage_ubyte(components, widthin, heightin, + (const GLubyte *)datain, (GLubyte *)dataout, element_size, ysize, group_size); return; } @@ -1402,7 +1402,7 @@ static void scale_internal_ubyte(GLint components, GLint widthin, convy_float = convy - convy_int; convx_int = floor(convx); convx_float = convx - convx_int; - + area = convx * convy; lowy_int = 0; @@ -1430,58 +1430,58 @@ static void scale_internal_ubyte(GLint components, GLint widthin, if((highy_int>lowy_int) && (highx_int>lowx_int)) { y_percent = 1-lowy_float; - temp = (const char *)datain + xindex + lowy_int * ysize; + temp = (const char *)datain + xindex + lowy_int * ysize; percent = y_percent * (1-lowx_float); - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { totals[k] += (GLubyte)(*(temp_index)) * percent; - } + } left = temp; - for(l = lowx_int+1; l < highx_int; l++) { + for(l = lowx_int+1; l < highx_int; l++) { temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * y_percent; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)) * y_percent; } - } + } temp += group_size; right = temp; percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * percent; - } + totals[k] += (GLubyte)(*(temp_index)) * percent; + } - /* calculate the value for pixels in the last row */ + /* calculate the value for pixels in the last row */ y_percent = highy_float; percent = y_percent * (1-lowx_float); temp = (const char *)datain + xindex + highy_int * ysize; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * percent; - } + totals[k] += (GLubyte)(*(temp_index)) * percent; + } for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * y_percent; - } - } - temp += group_size; + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)) * y_percent; + } + } + temp += group_size; percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * percent; - } + totals[k] += (GLubyte)(*(temp_index)) * percent; + } - /* calculate the value for pixels in the 1st and last column */ + /* calculate the value for pixels in the 1st and last column */ for(m = lowy_int+1; m < highy_int; m++) { left += ysize; right += ysize; - for (k = 0; k < components; - k++, left += element_size, right += element_size) { - totals[k] += (GLubyte)(*(left))*(1-lowx_float) + for (k = 0; k < components; + k++, left += element_size, right += element_size) { + totals[k] += (GLubyte)(*(left))*(1-lowx_float) +(GLubyte)(*(right))*highx_float; } } @@ -1489,68 +1489,68 @@ static void scale_internal_ubyte(GLint components, GLint widthin, x_percent = highx_float - lowx_float; percent = (1-lowy_float)*x_percent; temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * percent; - } + totals[k] += (GLubyte)(*(temp_index)) * percent; + } for(m = lowy_int+1; m < highy_int; m++) { temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * x_percent; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)) * x_percent; } } percent = x_percent * highy_float; temp += ysize; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * percent; - } + totals[k] += (GLubyte)(*(temp_index)) * percent; + } } else if (highx_int > lowx_int) { y_percent = highy_float - lowy_float; percent = (1-lowx_float)*y_percent; temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * percent; - } + totals[k] += (GLubyte)(*(temp_index)) * percent; + } for (l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * y_percent; + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)) * y_percent; } } temp += group_size; percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * percent; + totals[k] += (GLubyte)(*(temp_index)) * percent; } } else { percent = (highy_float-lowy_float)*(highx_float-lowx_float); temp = (const char *)datain + xindex + lowy_int * ysize; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)) * percent; - } + totals[k] += (GLubyte)(*(temp_index)) * percent; + } } - /* this is for the pixels in the body */ + /* this is for the pixels in the body */ temp0 = (const char *)datain + xindex + group_size + (lowy_int+1)*ysize; for (m = lowy_int+1; m < highy_int; m++) { temp = temp0; for(l = lowx_int+1; l < highx_int; l++) { - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLubyte)(*(temp_index)); - } - temp += group_size; - } - temp0 += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLubyte)(*(temp_index)); + } + temp += group_size; + } + temp0 += ysize; } outindex = (j + (i * widthout)) * components; @@ -1561,7 +1561,7 @@ static void scale_internal_ubyte(GLint components, GLint widthin, lowx_int = highx_int; lowx_float = highx_float; highx_int += convx_int; - highx_float += convx_float; + highx_float += convx_float; if(highx_float > 1) { highx_float -= 1.0; highx_int++; @@ -1578,9 +1578,9 @@ static void scale_internal_ubyte(GLint components, GLint widthin, } } -static void scale_internal_byte(GLint components, GLint widthin, - GLint heightin, const GLbyte *datain, - GLint widthout, GLint heightout, +static void scale_internal_byte(GLint components, GLint widthin, + GLint heightin, const GLbyte *datain, + GLint widthout, GLint heightout, GLbyte *dataout, GLint element_size, GLint ysize, GLint group_size) { @@ -1605,8 +1605,8 @@ static void scale_internal_byte(GLint components, GLint widthin, const char *left, *right; if (widthin == widthout*2 && heightin == heightout*2) { - halveImage_byte(components, widthin, heightin, - (const GLbyte *)datain, (GLbyte *)dataout, + halveImage_byte(components, widthin, heightin, + (const GLbyte *)datain, (GLbyte *)dataout, element_size, ysize, group_size); return; } @@ -1616,7 +1616,7 @@ static void scale_internal_byte(GLint components, GLint widthin, convy_float = convy - convy_int; convx_int = floor(convx); convx_float = convx - convx_int; - + area = convx * convy; lowy_int = 0; @@ -1639,63 +1639,63 @@ static void scale_internal_byte(GLint components, GLint widthin, */ totals[0] = totals[1] = totals[2] = totals[3] = 0.0; - /* calculate the value for pixels in the 1st row */ + /* calculate the value for pixels in the 1st row */ xindex = lowx_int*group_size; if((highy_int>lowy_int) && (highx_int>lowx_int)) { y_percent = 1-lowy_float; - temp = (const char *)datain + xindex + lowy_int * ysize; + temp = (const char *)datain + xindex + lowy_int * ysize; percent = y_percent * (1-lowx_float); - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { totals[k] += (GLbyte)(*(temp_index)) * percent; - } + } left = temp; - for(l = lowx_int+1; l < highx_int; l++) { + for(l = lowx_int+1; l < highx_int; l++) { temp += group_size; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * y_percent; + totals[k] += (GLbyte)(*(temp_index)) * y_percent; } - } + } temp += group_size; right = temp; percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * percent; - } + totals[k] += (GLbyte)(*(temp_index)) * percent; + } - /* calculate the value for pixels in the last row */ + /* calculate the value for pixels in the last row */ y_percent = highy_float; percent = y_percent * (1-lowx_float); temp = (const char *)datain + xindex + highy_int * ysize; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * percent; - } + totals[k] += (GLbyte)(*(temp_index)) * percent; + } for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * y_percent; - } - } - temp += group_size; + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLbyte)(*(temp_index)) * y_percent; + } + } + temp += group_size; percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * percent; - } + totals[k] += (GLbyte)(*(temp_index)) * percent; + } - /* calculate the value for pixels in the 1st and last column */ + /* calculate the value for pixels in the 1st and last column */ for(m = lowy_int+1; m < highy_int; m++) { left += ysize; right += ysize; - for (k = 0; k < components; - k++, left += element_size, right += element_size) { - totals[k] += (GLbyte)(*(left))*(1-lowx_float) + for (k = 0; k < components; + k++, left += element_size, right += element_size) { + totals[k] += (GLbyte)(*(left))*(1-lowx_float) +(GLbyte)(*(right))*highx_float; } } @@ -1703,68 +1703,68 @@ static void scale_internal_byte(GLint components, GLint widthin, x_percent = highx_float - lowx_float; percent = (1-lowy_float)*x_percent; temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * percent; - } + totals[k] += (GLbyte)(*(temp_index)) * percent; + } for(m = lowy_int+1; m < highy_int; m++) { temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * x_percent; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLbyte)(*(temp_index)) * x_percent; } } percent = x_percent * highy_float; temp += ysize; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * percent; - } + totals[k] += (GLbyte)(*(temp_index)) * percent; + } } else if (highx_int > lowx_int) { y_percent = highy_float - lowy_float; percent = (1-lowx_float)*y_percent; temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * percent; - } + totals[k] += (GLbyte)(*(temp_index)) * percent; + } for (l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * y_percent; + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + totals[k] += (GLbyte)(*(temp_index)) * y_percent; } } temp += group_size; percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * percent; + totals[k] += (GLbyte)(*(temp_index)) * percent; } } else { percent = (highy_float-lowy_float)*(highx_float-lowx_float); temp = (const char *)datain + xindex + lowy_int * ysize; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)) * percent; - } + totals[k] += (GLbyte)(*(temp_index)) * percent; + } } - /* this is for the pixels in the body */ - temp0 = (const char *)datain + xindex + group_size + + /* this is for the pixels in the body */ + temp0 = (const char *)datain + xindex + group_size + (lowy_int+1)*ysize; for (m = lowy_int+1; m < highy_int; m++) { temp = temp0; for(l = lowx_int+1; l < highx_int; l++) { - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - totals[k] += (GLbyte)(*(temp_index)); - } - temp += group_size; - } - temp0 += ysize; + totals[k] += (GLbyte)(*(temp_index)); + } + temp += group_size; + } + temp0 += ysize; } outindex = (j + (i * widthout)) * components; @@ -1775,7 +1775,7 @@ static void scale_internal_byte(GLint components, GLint widthin, lowx_int = highx_int; lowx_float = highx_float; highx_int += convx_int; - highx_float += convx_float; + highx_float += convx_float; if(highx_float > 1) { highx_float -= 1.0; highx_int++; @@ -1792,9 +1792,9 @@ static void scale_internal_byte(GLint components, GLint widthin, } } -static void scale_internal_ushort(GLint components, GLint widthin, - GLint heightin, const GLushort *datain, - GLint widthout, GLint heightout, +static void scale_internal_ushort(GLint components, GLint widthin, + GLint heightin, const GLushort *datain, + GLint widthout, GLint heightout, GLushort *dataout, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes) @@ -1820,8 +1820,8 @@ static void scale_internal_ushort(GLint components, GLint widthin, const char *left, *right; if (widthin == widthout*2 && heightin == heightout*2) { - halveImage_ushort(components, widthin, heightin, - (const GLushort *)datain, (GLushort *)dataout, + halveImage_ushort(components, widthin, heightin, + (const GLushort *)datain, (GLushort *)dataout, element_size, ysize, group_size, myswap_bytes); return; } @@ -1831,7 +1831,7 @@ static void scale_internal_ushort(GLint components, GLint widthin, convy_float = convy - convy_int; convx_int = floor(convx); convx_float = convx - convx_int; - + area = convx * convy; lowy_int = 0; @@ -1858,171 +1858,171 @@ static void scale_internal_ushort(GLint components, GLint widthin, if((highy_int>lowy_int) && (highx_int>lowx_int)) { y_percent = 1-lowy_float; - temp = (const char *)datain + xindex + lowy_int * ysize; + temp = (const char *)datain + xindex + lowy_int * ysize; percent = y_percent * (1-lowx_float); - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { if (myswap_bytes) { totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; } else { - totals[k] += *(const GLushort*)temp_index * percent; + totals[k] += *(const GLushort*)temp_index * percent; } - } + } left = temp; - for(l = lowx_int+1; l < highx_int; l++) { + for(l = lowx_int+1; l < highx_int; l++) { temp += group_size; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLushort*)temp_index * y_percent; - } - } - } + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLushort*)temp_index * y_percent; + } + } + } temp += group_size; right = temp; percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } - - /* calculate the value for pixels in the last row */ + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } + + /* calculate the value for pixels in the last row */ y_percent = highy_float; percent = y_percent * (1-lowx_float); temp = (const char *)datain + xindex + highy_int * ysize; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; + temp += group_size; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLushort*)temp_index * y_percent; - } - } - } - temp += group_size; + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLushort*)temp_index * y_percent; + } + } + } + temp += group_size; percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } /* calculate the value for pixels in the 1st and last column */ for(m = lowy_int+1; m < highy_int; m++) { left += ysize; right += ysize; - for (k = 0; k < components; - k++, left += element_size, right += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(left) * (1-lowx_float) + - __GLU_SWAP_2_BYTES(right) * highx_float; - } else { - totals[k] += *(const GLushort*)left * (1-lowx_float) - + *(const GLushort*)right * highx_float; - } + for (k = 0; k < components; + k++, left += element_size, right += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(left) * (1-lowx_float) + + __GLU_SWAP_2_BYTES(right) * highx_float; + } else { + totals[k] += *(const GLushort*)left * (1-lowx_float) + + *(const GLushort*)right * highx_float; + } } } } else if (highy_int > lowy_int) { x_percent = highx_float - lowx_float; percent = (1-lowy_float)*x_percent; temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } for(m = lowy_int+1; m < highy_int; m++) { temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * x_percent; - } else { - totals[k] += *(const GLushort*)temp_index * x_percent; - } + } else { + totals[k] += *(const GLushort*)temp_index * x_percent; + } } } percent = x_percent * highy_float; temp += ysize; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } } else if (highx_int > lowx_int) { y_percent = highy_float - lowy_float; percent = (1-lowx_float)*y_percent; temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } for (l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLushort*)temp_index * y_percent; - } + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLushort*)temp_index * y_percent; + } } } temp += group_size; percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } } } else { percent = (highy_float-lowy_float)*(highx_float-lowx_float); temp = (const char *)datain + xindex + lowy_int * ysize; - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } } /* this is for the pixels in the body */ @@ -2031,17 +2031,17 @@ static void scale_internal_ushort(GLint components, GLint widthin, for (m = lowy_int+1; m < highy_int; m++) { temp = temp0; for(l = lowx_int+1; l < highx_int; l++) { - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index); - } else { - totals[k] += *(const GLushort*)temp_index; - } - } - temp += group_size; - } - temp0 += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index); + } else { + totals[k] += *(const GLushort*)temp_index; + } + } + temp += group_size; + } + temp0 += ysize; } outindex = (j + (i * widthout)) * components; @@ -2052,7 +2052,7 @@ static void scale_internal_ushort(GLint components, GLint widthin, lowx_int = highx_int; lowx_float = highx_float; highx_int += convx_int; - highx_float += convx_float; + highx_float += convx_float; if(highx_float > 1) { highx_float -= 1.0; highx_int++; @@ -2070,11 +2070,11 @@ static void scale_internal_ushort(GLint components, GLint widthin, } static void scale_internal_short(GLint components, GLint widthin, - GLint heightin, const GLshort *datain, - GLint widthout, GLint heightout, - GLshort *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes) + GLint heightin, const GLshort *datain, + GLint widthout, GLint heightout, + GLshort *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes) { float convx; float convy; @@ -2099,10 +2099,10 @@ static void scale_internal_short(GLint components, GLint widthin, GLushort swapbuf; /* unsigned buffer */ if (widthin == widthout*2 && heightin == heightout*2) { - halveImage_short(components, widthin, heightin, - (const GLshort *)datain, (GLshort *)dataout, - element_size, ysize, group_size, myswap_bytes); - return; + halveImage_short(components, widthin, heightin, + (const GLshort *)datain, (GLshort *)dataout, + element_size, ysize, group_size, myswap_bytes); + return; } convy = (float) heightin/heightout; convx = (float) widthin/widthout; @@ -2119,253 +2119,253 @@ static void scale_internal_short(GLint components, GLint widthin, highy_float = convy_float; for (i = 0; i < heightout; i++) { - lowx_int = 0; - lowx_float = 0; - highx_int = convx_int; - highx_float = convx_float; - - for (j = 0; j < widthout; j++) { - /* - ** Ok, now apply box filter to box that goes from (lowx, lowy) - ** to (highx, highy) on input data into this pixel on output - ** data. - */ - totals[0] = totals[1] = totals[2] = totals[3] = 0.0; - - /* calculate the value for pixels in the 1st row */ - xindex = lowx_int*group_size; - if((highy_int>lowy_int) && (highx_int>lowx_int)) { - - y_percent = 1-lowy_float; - temp = (const char *)datain + xindex + lowy_int * ysize; - percent = y_percent * (1-lowx_float); - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + lowx_int = 0; + lowx_float = 0; + highx_int = convx_int; + highx_float = convx_float; + + for (j = 0; j < widthout; j++) { + /* + ** Ok, now apply box filter to box that goes from (lowx, lowy) + ** to (highx, highy) on input data into this pixel on output + ** data. + */ + totals[0] = totals[1] = totals[2] = totals[3] = 0.0; + + /* calculate the value for pixels in the 1st row */ + xindex = lowx_int*group_size; + if((highy_int>lowy_int) && (highx_int>lowx_int)) { + + y_percent = 1-lowy_float; + temp = (const char *)datain + xindex + lowy_int * ysize; + percent = y_percent * (1-lowx_float); + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - left = temp; - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + left = temp; + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * y_percent; - } else { - totals[k] += *(const GLshort*)temp_index * y_percent; - } - } - } - temp += group_size; - right = temp; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLshort*)&swapbuf * y_percent; + } else { + totals[k] += *(const GLshort*)temp_index * y_percent; + } + } + } + temp += group_size; + right = temp; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - - /* calculate the value for pixels in the last row */ - y_percent = highy_float; - percent = y_percent * (1-lowx_float); - temp = (const char *)datain + xindex + highy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + + /* calculate the value for pixels in the last row */ + y_percent = highy_float; + percent = y_percent * (1-lowx_float); + temp = (const char *)datain + xindex + highy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * y_percent; - } else { - totals[k] += *(const GLshort*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLshort*)&swapbuf * y_percent; + } else { + totals[k] += *(const GLshort*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - - /* calculate the value for pixels in the 1st and last column */ - for(m = lowy_int+1; m < highy_int; m++) { - left += ysize; - right += ysize; - for (k = 0; k < components; - k++, left += element_size, right += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + + /* calculate the value for pixels in the 1st and last column */ + for(m = lowy_int+1; m < highy_int; m++) { + left += ysize; + right += ysize; + for (k = 0; k < components; + k++, left += element_size, right += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_2_BYTES(left); - totals[k] += *(const GLshort*)&swapbuf * (1-lowx_float); + totals[k] += *(const GLshort*)&swapbuf * (1-lowx_float); swapbuf = __GLU_SWAP_2_BYTES(right); totals[k] += *(const GLshort*)&swapbuf * highx_float; - } else { - totals[k] += *(const GLshort*)left * (1-lowx_float) - + *(const GLshort*)right * highx_float; - } - } - } - } else if (highy_int > lowy_int) { - x_percent = highx_float - lowx_float; - percent = (1-lowy_float)*x_percent; - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + } else { + totals[k] += *(const GLshort*)left * (1-lowx_float) + + *(const GLshort*)right * highx_float; + } + } + } + } else if (highy_int > lowy_int) { + x_percent = highx_float - lowx_float; + percent = (1-lowy_float)*x_percent; + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - for(m = lowy_int+1; m < highy_int; m++) { - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + for(m = lowy_int+1; m < highy_int; m++) { + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * x_percent; - } else { - totals[k] += *(const GLshort*)temp_index * x_percent; - } - } - } - percent = x_percent * highy_float; - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLshort*)&swapbuf * x_percent; + } else { + totals[k] += *(const GLshort*)temp_index * x_percent; + } + } + } + percent = x_percent * highy_float; + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - } else if (highx_int > lowx_int) { - y_percent = highy_float - lowy_float; - percent = (1-lowx_float)*y_percent; - - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + } else if (highx_int > lowx_int) { + y_percent = highy_float - lowy_float; + percent = (1-lowx_float)*y_percent; + + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - for (l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + for (l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * y_percent; - } else { - totals[k] += *(const GLshort*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLshort*)&swapbuf * y_percent; + } else { + totals[k] += *(const GLshort*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - } else { - percent = (highy_float-lowy_float)*(highx_float-lowx_float); - temp = (const char *)datain + xindex + lowy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + } else { + percent = (highy_float-lowy_float)*(highx_float-lowx_float); + temp = (const char *)datain + xindex + lowy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf * percent; - } else { - totals[k] += *(const GLshort*)temp_index * percent; - } - } - } - - /* this is for the pixels in the body */ - temp0 = (const char *)datain + xindex + group_size + + totals[k] += *(const GLshort*)&swapbuf * percent; + } else { + totals[k] += *(const GLshort*)temp_index * percent; + } + } + } + + /* this is for the pixels in the body */ + temp0 = (const char *)datain + xindex + group_size + (lowy_int+1)*ysize; - for (m = lowy_int+1; m < highy_int; m++) { - temp = temp0; - for(l = lowx_int+1; l < highx_int; l++) { - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + for (m = lowy_int+1; m < highy_int; m++) { + temp = temp0; + for(l = lowx_int+1; l < highx_int; l++) { + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_2_BYTES(temp_index); - totals[k] += *(const GLshort*)&swapbuf; - } else { - totals[k] += *(const GLshort*)temp_index; - } - } - temp += group_size; - } - temp0 += ysize; - } - - outindex = (j + (i * widthout)) * components; - for (k = 0; k < components; k++) { - dataout[outindex + k] = totals[k]/area; - /*printf("totals[%d] = %f\n", k, totals[k]);*/ - } - lowx_int = highx_int; - lowx_float = highx_float; - highx_int += convx_int; - highx_float += convx_float; - if(highx_float > 1) { - highx_float -= 1.0; - highx_int++; - } - } - lowy_int = highy_int; - lowy_float = highy_float; - highy_int += convy_int; - highy_float += convy_float; - if(highy_float > 1) { - highy_float -= 1.0; - highy_int++; - } + totals[k] += *(const GLshort*)&swapbuf; + } else { + totals[k] += *(const GLshort*)temp_index; + } + } + temp += group_size; + } + temp0 += ysize; + } + + outindex = (j + (i * widthout)) * components; + for (k = 0; k < components; k++) { + dataout[outindex + k] = totals[k]/area; + /*printf("totals[%d] = %f\n", k, totals[k]);*/ + } + lowx_int = highx_int; + lowx_float = highx_float; + highx_int += convx_int; + highx_float += convx_float; + if(highx_float > 1) { + highx_float -= 1.0; + highx_int++; + } + } + lowy_int = highy_int; + lowy_float = highy_float; + highy_int += convy_int; + highy_float += convy_float; + if(highy_float > 1) { + highy_float -= 1.0; + highy_int++; + } } } static void scale_internal_uint(GLint components, GLint widthin, - GLint heightin, const GLuint *datain, - GLint widthout, GLint heightout, - GLuint *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes) + GLint heightin, const GLuint *datain, + GLint widthout, GLint heightout, + GLuint *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes) { float convx; float convy; @@ -2388,10 +2388,10 @@ static void scale_internal_uint(GLint components, GLint widthin, const char *left, *right; if (widthin == widthout*2 && heightin == heightout*2) { - halveImage_uint(components, widthin, heightin, - (const GLuint *)datain, (GLuint *)dataout, - element_size, ysize, group_size, myswap_bytes); - return; + halveImage_uint(components, widthin, heightin, + (const GLuint *)datain, (GLuint *)dataout, + element_size, ysize, group_size, myswap_bytes); + return; } convy = (float) heightin/heightout; convx = (float) widthin/widthout; @@ -2407,249 +2407,542 @@ static void scale_internal_uint(GLint components, GLint widthin, highy_int = convy_int; highy_float = convy_float; - for (i = 0; i < heightout; i++) { - lowx_int = 0; - lowx_float = 0; - highx_int = convx_int; - highx_float = convx_float; - - for (j = 0; j < widthout; j++) { - /* - ** Ok, now apply box filter to box that goes from (lowx, lowy) - ** to (highx, highy) on input data into this pixel on output - ** data. - */ - totals[0] = totals[1] = totals[2] = totals[3] = 0.0; - - /* calculate the value for pixels in the 1st row */ - xindex = lowx_int*group_size; - if((highy_int>lowy_int) && (highx_int>lowx_int)) { - - y_percent = 1-lowy_float; - temp = (const char *)datain + xindex + lowy_int * ysize; - percent = y_percent * (1-lowx_float); - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - left = temp; - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_4_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLuint*)temp_index * y_percent; - } - } - } - temp += group_size; - right = temp; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - - /* calculate the value for pixels in the last row */ - y_percent = highy_float; - percent = y_percent * (1-lowx_float); - temp = (const char *)datain + xindex + highy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_4_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLuint*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - - /* calculate the value for pixels in the 1st and last column */ - for(m = lowy_int+1; m < highy_int; m++) { - left += ysize; - right += ysize; - for (k = 0; k < components; - k++, left += element_size, right += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_4_BYTES(left) * (1-lowx_float) - + __GLU_SWAP_4_BYTES(right) * highx_float; - } else { - totals[k] += *(const GLuint*)left * (1-lowx_float) - + *(const GLuint*)right * highx_float; - } - } - } - } else if (highy_int > lowy_int) { - x_percent = highx_float - lowx_float; - percent = (1-lowy_float)*x_percent; - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - for(m = lowy_int+1; m < highy_int; m++) { - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_4_BYTES(temp_index) * x_percent; - } else { - totals[k] += *(const GLuint*)temp_index * x_percent; - } - } - } - percent = x_percent * highy_float; - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - } else if (highx_int > lowx_int) { - y_percent = highy_float - lowy_float; - percent = (1-lowx_float)*y_percent; - - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - for (l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_4_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLuint*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - } else { - percent = (highy_float-lowy_float)*(highx_float-lowx_float); - temp = (const char *)datain + xindex + lowy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLuint*)temp_index * percent; - } - } - } - - /* this is for the pixels in the body */ - temp0 = (const char *)datain + xindex + group_size + + for (i = 0; i < heightout; i++) { + lowx_int = 0; + lowx_float = 0; + highx_int = convx_int; + highx_float = convx_float; + + for (j = 0; j < widthout; j++) { + /* + ** Ok, now apply box filter to box that goes from (lowx, lowy) + ** to (highx, highy) on input data into this pixel on output + ** data. + */ + totals[0] = totals[1] = totals[2] = totals[3] = 0.0; + + /* calculate the value for pixels in the 1st row */ + xindex = lowx_int*group_size; + if((highy_int>lowy_int) && (highx_int>lowx_int)) { + + y_percent = 1-lowy_float; + temp = (const char *)datain + xindex + lowy_int * ysize; + percent = y_percent * (1-lowx_float); + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + left = temp; + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_4_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLuint*)temp_index * y_percent; + } + } + } + temp += group_size; + right = temp; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + + /* calculate the value for pixels in the last row */ + y_percent = highy_float; + percent = y_percent * (1-lowx_float); + temp = (const char *)datain + xindex + highy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_4_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLuint*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + + /* calculate the value for pixels in the 1st and last column */ + for(m = lowy_int+1; m < highy_int; m++) { + left += ysize; + right += ysize; + for (k = 0; k < components; + k++, left += element_size, right += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_4_BYTES(left) * (1-lowx_float) + + __GLU_SWAP_4_BYTES(right) * highx_float; + } else { + totals[k] += *(const GLuint*)left * (1-lowx_float) + + *(const GLuint*)right * highx_float; + } + } + } + } else if (highy_int > lowy_int) { + x_percent = highx_float - lowx_float; + percent = (1-lowy_float)*x_percent; + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + for(m = lowy_int+1; m < highy_int; m++) { + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_4_BYTES(temp_index) * x_percent; + } else { + totals[k] += *(const GLuint*)temp_index * x_percent; + } + } + } + percent = x_percent * highy_float; + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + } else if (highx_int > lowx_int) { + y_percent = highy_float - lowy_float; + percent = (1-lowx_float)*y_percent; + + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + for (l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_4_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLuint*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + } else { + percent = (highy_float-lowy_float)*(highx_float-lowx_float); + temp = (const char *)datain + xindex + lowy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLuint*)temp_index * percent; + } + } + } + + /* this is for the pixels in the body */ + temp0 = (const char *)datain + xindex + group_size + + (lowy_int+1)*ysize; + for (m = lowy_int+1; m < highy_int; m++) { + temp = temp0; + for(l = lowx_int+1; l < highx_int; l++) { + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_4_BYTES(temp_index); + } else { + totals[k] += *(const GLuint*)temp_index; + } + } + temp += group_size; + } + temp0 += ysize; + } + + outindex = (j + (i * widthout)) * components; + for (k = 0; k < components; k++) { + /* clamp at UINT_MAX */ + float value= totals[k]/area; + if (value >= (float) UINT_MAX) { /* need '=' */ + dataout[outindex + k] = UINT_MAX; + } + else dataout[outindex + k] = value; + } + lowx_int = highx_int; + lowx_float = highx_float; + highx_int += convx_int; + highx_float += convx_float; + if(highx_float > 1) { + highx_float -= 1.0; + highx_int++; + } + } + lowy_int = highy_int; + lowy_float = highy_float; + highy_int += convy_int; + highy_float += convy_float; + if(highy_float > 1) { + highy_float -= 1.0; + highy_int++; + } + } +} + + + +static void scale_internal_int(GLint components, GLint widthin, + GLint heightin, const GLint *datain, + GLint widthout, GLint heightout, + GLint *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes) +{ + float convx; + float convy; + float percent; + /* Max components in a format is 4, so... */ + float totals[4]; + float area; + int i,j,k,xindex; + + const char *temp, *temp0; + const char *temp_index; + int outindex; + + int lowx_int, highx_int, lowy_int, highy_int; + float x_percent, y_percent; + float lowx_float, highx_float, lowy_float, highy_float; + float convy_float, convx_float; + int convy_int, convx_int; + int l, m; + const char *left, *right; + + GLuint swapbuf; /* unsigned buffer */ + + if (widthin == widthout*2 && heightin == heightout*2) { + halveImage_int(components, widthin, heightin, + (const GLint *)datain, (GLint *)dataout, + element_size, ysize, group_size, myswap_bytes); + return; + } + convy = (float) heightin/heightout; + convx = (float) widthin/widthout; + convy_int = floor(convy); + convy_float = convy - convy_int; + convx_int = floor(convx); + convx_float = convx - convx_int; + + area = convx * convy; + + lowy_int = 0; + lowy_float = 0; + highy_int = convy_int; + highy_float = convy_float; + + for (i = 0; i < heightout; i++) { + lowx_int = 0; + lowx_float = 0; + highx_int = convx_int; + highx_float = convx_float; + + for (j = 0; j < widthout; j++) { + /* + ** Ok, now apply box filter to box that goes from (lowx, lowy) + ** to (highx, highy) on input data into this pixel on output + ** data. + */ + totals[0] = totals[1] = totals[2] = totals[3] = 0.0; + + /* calculate the value for pixels in the 1st row */ + xindex = lowx_int*group_size; + if((highy_int>lowy_int) && (highx_int>lowx_int)) { + + y_percent = 1-lowy_float; + temp = (const char *)datain + xindex + lowy_int * ysize; + percent = y_percent * (1-lowx_float); + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + left = temp; + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * y_percent; + } else { + totals[k] += *(const GLint*)temp_index * y_percent; + } + } + } + temp += group_size; + right = temp; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + + /* calculate the value for pixels in the last row */ + y_percent = highy_float; + percent = y_percent * (1-lowx_float); + temp = (const char *)datain + xindex + highy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * y_percent; + } else { + totals[k] += *(const GLint*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + + /* calculate the value for pixels in the 1st and last column */ + for(m = lowy_int+1; m < highy_int; m++) { + left += ysize; + right += ysize; + for (k = 0; k < components; + k++, left += element_size, right += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(left); + totals[k] += *(const GLint*)&swapbuf * (1-lowx_float); + swapbuf = __GLU_SWAP_4_BYTES(right); + totals[k] += *(const GLint*)&swapbuf * highx_float; + } else { + totals[k] += *(const GLint*)left * (1-lowx_float) + + *(const GLint*)right * highx_float; + } + } + } + } else if (highy_int > lowy_int) { + x_percent = highx_float - lowx_float; + percent = (1-lowy_float)*x_percent; + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + for(m = lowy_int+1; m < highy_int; m++) { + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * x_percent; + } else { + totals[k] += *(const GLint*)temp_index * x_percent; + } + } + } + percent = x_percent * highy_float; + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + } else if (highx_int > lowx_int) { + y_percent = highy_float - lowy_float; + percent = (1-lowx_float)*y_percent; + + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + for (l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * y_percent; + } else { + totals[k] += *(const GLint*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + } else { + percent = (highy_float-lowy_float)*(highx_float-lowx_float); + temp = (const char *)datain + xindex + lowy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf * percent; + } else { + totals[k] += *(const GLint*)temp_index * percent; + } + } + } + + /* this is for the pixels in the body */ + temp0 = (const char *)datain + xindex + group_size + (lowy_int+1)*ysize; - for (m = lowy_int+1; m < highy_int; m++) { - temp = temp0; - for(l = lowx_int+1; l < highx_int; l++) { - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_4_BYTES(temp_index); - } else { - totals[k] += *(const GLuint*)temp_index; - } - } - temp += group_size; - } - temp0 += ysize; - } - - outindex = (j + (i * widthout)) * components; - for (k = 0; k < components; k++) { - /* clamp at UINT_MAX */ - float value= totals[k]/area; - if (value >= (float) UINT_MAX) { /* need '=' */ - dataout[outindex + k] = UINT_MAX; + for (m = lowy_int+1; m < highy_int; m++) { + temp = temp0; + for(l = lowx_int+1; l < highx_int; l++) { + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + swapbuf = __GLU_SWAP_4_BYTES(temp_index); + totals[k] += *(const GLint*)&swapbuf; + } else { + totals[k] += *(const GLint*)temp_index; + } + } + temp += group_size; } - else dataout[outindex + k] = value; + temp0 += ysize; + } + + outindex = (j + (i * widthout)) * components; + for (k = 0; k < components; k++) { + dataout[outindex + k] = totals[k]/area; + /*printf("totals[%d] = %f\n", k, totals[k]);*/ } - lowx_int = highx_int; - lowx_float = highx_float; - highx_int += convx_int; - highx_float += convx_float; - if(highx_float > 1) { - highx_float -= 1.0; - highx_int++; - } - } - lowy_int = highy_int; - lowy_float = highy_float; - highy_int += convy_int; - highy_float += convy_float; - if(highy_float > 1) { - highy_float -= 1.0; - highy_int++; - } + lowx_int = highx_int; + lowx_float = highx_float; + highx_int += convx_int; + highx_float += convx_float; + if(highx_float > 1) { + highx_float -= 1.0; + highx_int++; + } + } + lowy_int = highy_int; + lowy_float = highy_float; + highy_int += convy_int; + highy_float += convy_float; + if(highy_float > 1) { + highy_float -= 1.0; + highy_int++; + } } } -static void scale_internal_int(GLint components, GLint widthin, - GLint heightin, const GLint *datain, - GLint widthout, GLint heightout, - GLint *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes) +static void scale_internal_float(GLint components, GLint widthin, + GLint heightin, const GLfloat *datain, + GLint widthout, GLint heightout, + GLfloat *dataout, GLint element_size, + GLint ysize, GLint group_size, + GLint myswap_bytes) { float convx; float convy; @@ -2674,10 +2967,10 @@ static void scale_internal_int(GLint components, GLint widthin, GLuint swapbuf; /* unsigned buffer */ if (widthin == widthout*2 && heightin == heightout*2) { - halveImage_int(components, widthin, heightin, - (const GLint *)datain, (GLint *)dataout, - element_size, ysize, group_size, myswap_bytes); - return; + halveImage_float(components, widthin, heightin, + (const GLfloat *)datain, (GLfloat *)dataout, + element_size, ysize, group_size, myswap_bytes); + return; } convy = (float) heightin/heightout; convx = (float) widthin/widthout; @@ -2694,537 +2987,244 @@ static void scale_internal_int(GLint components, GLint widthin, highy_float = convy_float; for (i = 0; i < heightout; i++) { - lowx_int = 0; - lowx_float = 0; - highx_int = convx_int; - highx_float = convx_float; - - for (j = 0; j < widthout; j++) { - /* - ** Ok, now apply box filter to box that goes from (lowx, lowy) - ** to (highx, highy) on input data into this pixel on output - ** data. - */ - totals[0] = totals[1] = totals[2] = totals[3] = 0.0; - - /* calculate the value for pixels in the 1st row */ - xindex = lowx_int*group_size; - if((highy_int>lowy_int) && (highx_int>lowx_int)) { - - y_percent = 1-lowy_float; - temp = (const char *)datain + xindex + lowy_int * ysize; - percent = y_percent * (1-lowx_float); - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - left = temp; - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * y_percent; - } else { - totals[k] += *(const GLint*)temp_index * y_percent; - } - } - } - temp += group_size; - right = temp; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - - /* calculate the value for pixels in the last row */ - y_percent = highy_float; - percent = y_percent * (1-lowx_float); - temp = (const char *)datain + xindex + highy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * y_percent; - } else { - totals[k] += *(const GLint*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - - /* calculate the value for pixels in the 1st and last column */ - for(m = lowy_int+1; m < highy_int; m++) { - left += ysize; - right += ysize; - for (k = 0; k < components; - k++, left += element_size, right += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(left); - totals[k] += *(const GLint*)&swapbuf * (1-lowx_float); - swapbuf = __GLU_SWAP_4_BYTES(right); - totals[k] += *(const GLint*)&swapbuf * highx_float; - } else { - totals[k] += *(const GLint*)left * (1-lowx_float) - + *(const GLint*)right * highx_float; - } - } - } - } else if (highy_int > lowy_int) { - x_percent = highx_float - lowx_float; - percent = (1-lowy_float)*x_percent; - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - for(m = lowy_int+1; m < highy_int; m++) { - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * x_percent; - } else { - totals[k] += *(const GLint*)temp_index * x_percent; - } - } - } - percent = x_percent * highy_float; - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - } else if (highx_int > lowx_int) { - y_percent = highy_float - lowy_float; - percent = (1-lowx_float)*y_percent; - - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - for (l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * y_percent; - } else { - totals[k] += *(const GLint*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - } else { - percent = (highy_float-lowy_float)*(highx_float-lowx_float); - temp = (const char *)datain + xindex + lowy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf * percent; - } else { - totals[k] += *(const GLint*)temp_index * percent; - } - } - } - - /* this is for the pixels in the body */ - temp0 = (const char *)datain + xindex + group_size + - (lowy_int+1)*ysize; - for (m = lowy_int+1; m < highy_int; m++) { - temp = temp0; - for(l = lowx_int+1; l < highx_int; l++) { - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLint*)&swapbuf; - } else { - totals[k] += *(const GLint*)temp_index; - } - } - temp += group_size; - } - temp0 += ysize; - } - - outindex = (j + (i * widthout)) * components; - for (k = 0; k < components; k++) { - dataout[outindex + k] = totals[k]/area; - /*printf("totals[%d] = %f\n", k, totals[k]);*/ - } - lowx_int = highx_int; - lowx_float = highx_float; - highx_int += convx_int; - highx_float += convx_float; - if(highx_float > 1) { - highx_float -= 1.0; - highx_int++; - } - } - lowy_int = highy_int; - lowy_float = highy_float; - highy_int += convy_int; - highy_float += convy_float; - if(highy_float > 1) { - highy_float -= 1.0; - highy_int++; - } - } -} - - - -static void scale_internal_float(GLint components, GLint widthin, - GLint heightin, const GLfloat *datain, - GLint widthout, GLint heightout, - GLfloat *dataout, GLint element_size, - GLint ysize, GLint group_size, - GLint myswap_bytes) -{ - float convx; - float convy; - float percent; - /* Max components in a format is 4, so... */ - float totals[4]; - float area; - int i,j,k,xindex; - - const char *temp, *temp0; - const char *temp_index; - int outindex; - - int lowx_int, highx_int, lowy_int, highy_int; - float x_percent, y_percent; - float lowx_float, highx_float, lowy_float, highy_float; - float convy_float, convx_float; - int convy_int, convx_int; - int l, m; - const char *left, *right; - - GLuint swapbuf; /* unsigned buffer */ - - if (widthin == widthout*2 && heightin == heightout*2) { - halveImage_float(components, widthin, heightin, - (const GLfloat *)datain, (GLfloat *)dataout, - element_size, ysize, group_size, myswap_bytes); - return; - } - convy = (float) heightin/heightout; - convx = (float) widthin/widthout; - convy_int = floor(convy); - convy_float = convy - convy_int; - convx_int = floor(convx); - convx_float = convx - convx_int; + lowx_int = 0; + lowx_float = 0; + highx_int = convx_int; + highx_float = convx_float; - area = convx * convy; + for (j = 0; j < widthout; j++) { + /* + ** Ok, now apply box filter to box that goes from (lowx, lowy) + ** to (highx, highy) on input data into this pixel on output + ** data. + */ + totals[0] = totals[1] = totals[2] = totals[3] = 0.0; - lowy_int = 0; - lowy_float = 0; - highy_int = convy_int; - highy_float = convy_float; + /* calculate the value for pixels in the 1st row */ + xindex = lowx_int*group_size; + if((highy_int>lowy_int) && (highx_int>lowx_int)) { - for (i = 0; i < heightout; i++) { - lowx_int = 0; - lowx_float = 0; - highx_int = convx_int; - highx_float = convx_float; - - for (j = 0; j < widthout; j++) { - /* - ** Ok, now apply box filter to box that goes from (lowx, lowy) - ** to (highx, highy) on input data into this pixel on output - ** data. - */ - totals[0] = totals[1] = totals[2] = totals[3] = 0.0; - - /* calculate the value for pixels in the 1st row */ - xindex = lowx_int*group_size; - if((highy_int>lowy_int) && (highx_int>lowx_int)) { - - y_percent = 1-lowy_float; - temp = (const char *)datain + xindex + lowy_int * ysize; - percent = y_percent * (1-lowx_float); - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + y_percent = 1-lowy_float; + temp = (const char *)datain + xindex + lowy_int * ysize; + percent = y_percent * (1-lowx_float); + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLfloat*)&swapbuf * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - left = temp; - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLfloat*)&swapbuf * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + left = temp; + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLfloat*)&swapbuf * y_percent; - } else { - totals[k] += *(const GLfloat*)temp_index * y_percent; - } - } - } - temp += group_size; - right = temp; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLfloat*)&swapbuf * y_percent; + } else { + totals[k] += *(const GLfloat*)temp_index * y_percent; + } + } + } + temp += group_size; + right = temp; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLfloat*)&swapbuf * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - - /* calculate the value for pixels in the last row */ - y_percent = highy_float; - percent = y_percent * (1-lowx_float); - temp = (const char *)datain + xindex + highy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLfloat*)&swapbuf * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + + /* calculate the value for pixels in the last row */ + y_percent = highy_float; + percent = y_percent * (1-lowx_float); + temp = (const char *)datain + xindex + highy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLfloat*)&swapbuf * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - for(l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLfloat*)&swapbuf * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + for(l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLfloat*)&swapbuf * y_percent; - } else { - totals[k] += *(const GLfloat*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLfloat*)&swapbuf * y_percent; + } else { + totals[k] += *(const GLfloat*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLfloat*)&swapbuf * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - - /* calculate the value for pixels in the 1st and last column */ - for(m = lowy_int+1; m < highy_int; m++) { - left += ysize; - right += ysize; - for (k = 0; k < components; - k++, left += element_size, right += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLfloat*)&swapbuf * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + + /* calculate the value for pixels in the 1st and last column */ + for(m = lowy_int+1; m < highy_int; m++) { + left += ysize; + right += ysize; + for (k = 0; k < components; + k++, left += element_size, right += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_4_BYTES(left); - totals[k] += *(const GLfloat*)&swapbuf * (1-lowx_float); - swapbuf = __GLU_SWAP_4_BYTES(right); - totals[k] += *(const GLfloat*)&swapbuf * highx_float; - } else { - totals[k] += *(const GLfloat*)left * (1-lowx_float) - + *(const GLfloat*)right * highx_float; - } - } - } - } else if (highy_int > lowy_int) { - x_percent = highx_float - lowx_float; - percent = (1-lowy_float)*x_percent; - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLfloat*)&swapbuf * (1-lowx_float); + swapbuf = __GLU_SWAP_4_BYTES(right); + totals[k] += *(const GLfloat*)&swapbuf * highx_float; + } else { + totals[k] += *(const GLfloat*)left * (1-lowx_float) + + *(const GLfloat*)right * highx_float; + } + } + } + } else if (highy_int > lowy_int) { + x_percent = highx_float - lowx_float; + percent = (1-lowy_float)*x_percent; + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLfloat*)&swapbuf * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - for(m = lowy_int+1; m < highy_int; m++) { - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLfloat*)&swapbuf * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + for(m = lowy_int+1; m < highy_int; m++) { + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLfloat*)&swapbuf * x_percent; - } else { - totals[k] += *(const GLfloat*)temp_index * x_percent; - } - } - } - percent = x_percent * highy_float; - temp += ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLfloat*)&swapbuf * x_percent; + } else { + totals[k] += *(const GLfloat*)temp_index * x_percent; + } + } + } + percent = x_percent * highy_float; + temp += ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLfloat*)&swapbuf * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - } else if (highx_int > lowx_int) { - y_percent = highy_float - lowy_float; - percent = (1-lowx_float)*y_percent; - - temp = (const char *)datain + xindex + lowy_int*ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLfloat*)&swapbuf * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + } else if (highx_int > lowx_int) { + y_percent = highy_float - lowy_float; + percent = (1-lowx_float)*y_percent; + + temp = (const char *)datain + xindex + lowy_int*ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLfloat*)&swapbuf * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - for (l = lowx_int+1; l < highx_int; l++) { - temp += group_size; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLfloat*)&swapbuf * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + for (l = lowx_int+1; l < highx_int; l++) { + temp += group_size; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLfloat*)&swapbuf * y_percent; - } else { - totals[k] += *(const GLfloat*)temp_index * y_percent; - } - } - } - temp += group_size; - percent = y_percent * highx_float; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLfloat*)&swapbuf * y_percent; + } else { + totals[k] += *(const GLfloat*)temp_index * y_percent; + } + } + } + temp += group_size; + percent = y_percent * highx_float; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLfloat*)&swapbuf * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - } else { - percent = (highy_float-lowy_float)*(highx_float-lowx_float); - temp = (const char *)datain + xindex + lowy_int * ysize; - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + totals[k] += *(const GLfloat*)&swapbuf * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + } else { + percent = (highy_float-lowy_float)*(highx_float-lowx_float); + temp = (const char *)datain + xindex + lowy_int * ysize; + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLfloat*)&swapbuf * percent; - } else { - totals[k] += *(const GLfloat*)temp_index * percent; - } - } - } - - /* this is for the pixels in the body */ - temp0 = (const char *)datain + xindex + group_size + + totals[k] += *(const GLfloat*)&swapbuf * percent; + } else { + totals[k] += *(const GLfloat*)temp_index * percent; + } + } + } + + /* this is for the pixels in the body */ + temp0 = (const char *)datain + xindex + group_size + (lowy_int+1)*ysize; - for (m = lowy_int+1; m < highy_int; m++) { - temp = temp0; - for(l = lowx_int+1; l < highx_int; l++) { - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { + for (m = lowy_int+1; m < highy_int; m++) { + temp = temp0; + for(l = lowx_int+1; l < highx_int; l++) { + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { swapbuf = __GLU_SWAP_4_BYTES(temp_index); - totals[k] += *(const GLfloat*)&swapbuf; - } else { - totals[k] += *(const GLfloat*)temp_index; - } - } - temp += group_size; - } - temp0 += ysize; - } - - outindex = (j + (i * widthout)) * components; - for (k = 0; k < components; k++) { - dataout[outindex + k] = totals[k]/area; - /*printf("totals[%d] = %f\n", k, totals[k]);*/ - } - lowx_int = highx_int; - lowx_float = highx_float; - highx_int += convx_int; - highx_float += convx_float; - if(highx_float > 1) { - highx_float -= 1.0; - highx_int++; - } - } - lowy_int = highy_int; - lowy_float = highy_float; - highy_int += convy_int; - highy_float += convy_float; - if(highy_float > 1) { - highy_float -= 1.0; - highy_int++; - } + totals[k] += *(const GLfloat*)&swapbuf; + } else { + totals[k] += *(const GLfloat*)temp_index; + } + } + temp += group_size; + } + temp0 += ysize; + } + + outindex = (j + (i * widthout)) * components; + for (k = 0; k < components; k++) { + dataout[outindex + k] = totals[k]/area; + /*printf("totals[%d] = %f\n", k, totals[k]);*/ + } + lowx_int = highx_int; + lowx_float = highx_float; + highx_int += convx_int; + highx_float += convx_float; + if(highx_float > 1) { + highx_float -= 1.0; + highx_int++; + } + } + lowy_int = highy_int; + lowy_float = highy_float; + highy_int += convy_int; + highy_float += convy_float; + if(highy_float > 1) { + highy_float -= 1.0; + highy_int++; + } } } @@ -3238,7 +3238,7 @@ static int checkMipmapArgs(GLenum internalFormat, GLenum format, GLenum type) } if (!isLegalFormatForPackedPixelType(format, type)) { - return GLU_INVALID_OPERATION; + return GLU_INVALID_OPERATION; } return 0; @@ -3279,7 +3279,7 @@ static GLboolean legalType(GLenum type) case GL_UNSIGNED_INT: case GL_FLOAT: case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_BYTE_2_3_3_REV: case GL_UNSIGNED_SHORT_5_6_5: case GL_UNSIGNED_SHORT_5_6_5_REV: case GL_UNSIGNED_SHORT_4_4_4_4: @@ -3290,7 +3290,7 @@ static GLboolean legalType(GLenum type) case GL_UNSIGNED_INT_8_8_8_8_REV: case GL_UNSIGNED_INT_10_10_10_2: case GL_UNSIGNED_INT_2_10_10_10_REV: - return GL_TRUE; + return GL_TRUE; default: return GL_FALSE; } @@ -3325,14 +3325,14 @@ static GLboolean isLegalFormatForPackedPixelType(GLenum format, GLenum type) if (!isTypePackedPixel(type)) { return GL_TRUE; } - + /* 3_3_2/2_3_3_REV & 5_6_5/5_6_5_REV are only compatible with RGB */ - if ((type == GL_UNSIGNED_BYTE_3_3_2 || type == GL_UNSIGNED_BYTE_2_3_3_REV|| + if ((type == GL_UNSIGNED_BYTE_3_3_2 || type == GL_UNSIGNED_BYTE_2_3_3_REV|| type == GL_UNSIGNED_SHORT_5_6_5|| type == GL_UNSIGNED_SHORT_5_6_5_REV) && format != GL_RGB) return GL_FALSE; - - /* 4_4_4_4/4_4_4_4_REV & 5_5_5_1/1_5_5_5_REV & 8_8_8_8/8_8_8_8_REV & + + /* 4_4_4_4/4_4_4_4_REV & 5_5_5_1/1_5_5_5_REV & 8_8_8_8/8_8_8_8_REV & * 10_10_10_2/2_10_10_10_REV are only compatible with RGBA, BGRA & ABGR_EXT. */ if ((type == GL_UNSIGNED_SHORT_4_4_4_4 || @@ -3343,7 +3343,7 @@ static GLboolean isLegalFormatForPackedPixelType(GLenum format, GLenum type) type == GL_UNSIGNED_INT_8_8_8_8_REV || type == GL_UNSIGNED_INT_10_10_10_2 || type == GL_UNSIGNED_INT_2_10_10_10_REV) && - (format != GL_RGBA && + (format != GL_RGBA && format != GL_BGRA)) { return GL_FALSE; } @@ -3351,7 +3351,7 @@ static GLboolean isLegalFormatForPackedPixelType(GLenum format, GLenum type) return GL_TRUE; } /* isLegalFormatForPackedPixelType() */ -static GLboolean isLegalLevels(GLint userLevel,GLint baseLevel,GLint maxLevel, +static GLboolean isLegalLevels(GLint userLevel,GLint baseLevel,GLint maxLevel, GLint totalLevels) { if (baseLevel < 0 || baseLevel < userLevel || maxLevel < baseLevel || @@ -3362,31 +3362,31 @@ static GLboolean isLegalLevels(GLint userLevel,GLint baseLevel,GLint maxLevel, /* Given user requested texture size, determine if it fits. If it * doesn't then halve both sides and make the determination again - * until it does fit (for IR only). + * until it does fit (for IR only). * Note that proxy textures are not implemented in RE* even though - * they advertise the texture extension. + * they advertise the texture extension. * Note that proxy textures are implemented but not according to spec in * IMPACT*. */ -static void closestFit(GLenum target, GLint width, GLint height, - GLint internalFormat, GLenum format, GLenum type, +static void closestFit(GLenum target, GLint width, GLint height, + GLint internalFormat, GLenum format, GLenum type, GLint *newWidth, GLint *newHeight) { /* Use proxy textures if OpenGL version is >= 1.1 */ if ( (strtod((const char *)glGetString(GL_VERSION),NULL) >= 1.1) ) { GLint widthPowerOf2= nearestPower(width); - GLint heightPowerOf2= nearestPower(height); + GLint heightPowerOf2= nearestPower(height); GLint proxyWidth; do { /* compute level 1 width & height, clamping each at 1 */ GLint widthAtLevelOne= (widthPowerOf2 > 1) ? - widthPowerOf2 >> 1 : - widthPowerOf2; + widthPowerOf2 >> 1 : + widthPowerOf2; GLint heightAtLevelOne= (heightPowerOf2 > 1) ? - heightPowerOf2 >> 1 : - heightPowerOf2; + heightPowerOf2 >> 1 : + heightPowerOf2; GLenum proxyTarget; assert(widthAtLevelOne > 0); assert(heightAtLevelOne > 0); @@ -3398,19 +3398,19 @@ static void closestFit(GLenum target, GLint width, GLint height, widthAtLevelOne,heightAtLevelOne,0,format,type,NULL); } else #if defined(GL_ARB_texture_cube_map) - if ((target == GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB) || - (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB) || - (target == GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB) || - (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB) || - (target == GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB) || - (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) { - proxyTarget = GL_PROXY_TEXTURE_CUBE_MAP_ARB; - glTexImage2D(proxyTarget, 1, /* must be non-zero */ - internalFormat, - widthAtLevelOne,heightAtLevelOne,0,format,type,NULL); - } else + if ((target == GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB) || + (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB) || + (target == GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB) || + (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB) || + (target == GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB) || + (target == GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) { + proxyTarget = GL_PROXY_TEXTURE_CUBE_MAP_ARB; + glTexImage2D(proxyTarget, 1, /* must be non-zero */ + internalFormat, + widthAtLevelOne,heightAtLevelOne,0,format,type,NULL); + } else #endif /* GL_ARB_texture_cube_map */ - { + { assert(target == GL_TEXTURE_1D || target == GL_PROXY_TEXTURE_1D); proxyTarget = GL_PROXY_TEXTURE_1D; glTexImage1D(proxyTarget, 1, /* must be non-zero */ @@ -3424,13 +3424,13 @@ static void closestFit(GLenum target, GLint width, GLint height, * break out. This should never happen. But things * happen. The disadvantage with this if-statement is * that we will never be aware of when this happens - * since it will silently branch out. + * since it will silently branch out. */ goto noProxyTextures; } widthPowerOf2= widthAtLevelOne; heightPowerOf2= heightAtLevelOne; - } + } /* else it does fit */ } while (proxyWidth == 0); /* loop must terminate! */ @@ -3456,8 +3456,8 @@ noProxyTextures: } /* closestFit() */ GLint GLAPIENTRY -gluScaleImage(GLenum format, GLsizei widthin, GLsizei heightin, - GLenum typein, const void *datain, +gluScaleImage(GLenum format, GLsizei widthin, GLsizei heightin, + GLenum typein, const void *datain, GLsizei widthout, GLsizei heightout, GLenum typeout, void *dataout) { @@ -3482,7 +3482,7 @@ gluScaleImage(GLenum format, GLsizei widthin, GLsizei heightin, return GLU_INVALID_OPERATION; } beforeImage = - malloc(image_size(widthin, heightin, format, GL_UNSIGNED_SHORT)); + malloc(image_size(widthin, heightin, format, GL_UNSIGNED_SHORT)); afterImage = malloc(image_size(widthout, heightout, format, GL_UNSIGNED_SHORT)); if (beforeImage == NULL || afterImage == NULL) { @@ -3493,9 +3493,9 @@ gluScaleImage(GLenum format, GLsizei widthin, GLsizei heightin, fill_image(&psm,widthin, heightin, format, typein, is_index(format), datain, beforeImage); components = elements_per_group(format, 0); - scale_internal(components, widthin, heightin, beforeImage, + scale_internal(components, widthin, heightin, beforeImage, widthout, heightout, afterImage); - empty_image(&psm,widthout, heightout, format, typeout, + empty_image(&psm,widthout, heightout, format, typeout, is_index(format), afterImage, dataout); free((GLbyte *) beforeImage); free((GLbyte *) afterImage); @@ -3506,7 +3506,7 @@ gluScaleImage(GLenum format, GLsizei widthin, GLsizei heightin, int gluBuild1DMipmapLevelsCore(GLenum target, GLint internalFormat, GLsizei width, GLsizei widthPowerOf2, - GLenum format, GLenum type, + GLenum format, GLenum type, GLint userLevel, GLint baseLevel,GLint maxLevel, const void *data) { @@ -3532,7 +3532,7 @@ int gluBuild1DMipmapLevelsCore(GLenum target, GLint internalFormat, retrieveStoreModes(&psm); newImage = (GLushort *) - malloc(image_size(width, 1, format, GL_UNSIGNED_SHORT)); + malloc(image_size(width, 1, format, GL_UNSIGNED_SHORT)); newImage_width = width; if (newImage == NULL) { return GLU_OUT_OF_MEMORY; @@ -3553,7 +3553,7 @@ int gluBuild1DMipmapLevelsCore(GLenum target, GLint internalFormat, if (newImage_width == newwidth) { /* Use newImage for this level */ if (baseLevel <= level && level <= maxLevel) { - glTexImage1D(target, level, internalFormat, newImage_width, + glTexImage1D(target, level, internalFormat, newImage_width, 0, format, GL_UNSIGNED_SHORT, (void *) newImage); } } else { @@ -3569,10 +3569,10 @@ int gluBuild1DMipmapLevelsCore(GLenum target, GLint internalFormat, return GLU_OUT_OF_MEMORY; } } - scale_internal(cmpts, newImage_width, 1, newImage, + scale_internal(cmpts, newImage_width, 1, newImage, newwidth, 1, otherImage); /* Swap newImage and otherImage */ - imageTemp = otherImage; + imageTemp = otherImage; otherImage = newImage; newImage = imageTemp; @@ -3598,9 +3598,9 @@ int gluBuild1DMipmapLevelsCore(GLenum target, GLint internalFormat, } GLint GLAPIENTRY -gluBuild1DMipmapLevels(GLenum target, GLint internalFormat, +gluBuild1DMipmapLevels(GLenum target, GLint internalFormat, GLsizei width, - GLenum format, GLenum type, + GLenum format, GLenum type, GLint userLevel, GLint baseLevel, GLint maxLevel, const void *data) { @@ -3616,19 +3616,19 @@ gluBuild1DMipmapLevels(GLenum target, GLint internalFormat, levels = computeLog(width); levels+= userLevel; - if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels)) + if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels)) return GLU_INVALID_VALUE; - return gluBuild1DMipmapLevelsCore(target, internalFormat, + return gluBuild1DMipmapLevelsCore(target, internalFormat, width, - width,format, type, + width,format, type, userLevel, baseLevel, maxLevel, data); } /* gluBuild1DMipmapLevels() */ GLint GLAPIENTRY gluBuild1DMipmaps(GLenum target, GLint internalFormat, GLsizei width, - GLenum format, GLenum type, + GLenum format, GLenum type, const void *data) { GLint widthPowerOf2; @@ -3653,7 +3653,7 @@ gluBuild1DMipmaps(GLenum target, GLint internalFormat, GLsizei width, static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat, GLint width, GLint height, GLenum format, - GLenum type, const void *data) + GLenum type, const void *data) { GLint newwidth, newheight; GLint level, levels; @@ -3684,15 +3684,15 @@ static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat, otherImage = NULL; newImage = (GLushort *) - malloc(image_size(width, height, format, GL_UNSIGNED_SHORT)); + malloc(image_size(width, height, format, GL_UNSIGNED_SHORT)); newImage_width = width; newImage_height = height; if (newImage == NULL) { - return GLU_OUT_OF_MEMORY; + return GLU_OUT_OF_MEMORY; } fill_image(&psm,width, height, format, type, is_index(format), - data, newImage); + data, newImage); cmpts = elements_per_group(format,type); glPixelStorei(GL_UNPACK_ALIGNMENT, 2); @@ -3705,39 +3705,39 @@ static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); for (level = 0; level <= levels; level++) { - if (newImage_width == newwidth && newImage_height == newheight) { /* Use newImage for this level */ - glTexImage2D(target, level, internalFormat, newImage_width, - newImage_height, 0, format, GL_UNSIGNED_SHORT, - (void *) newImage); - } else { - if (otherImage == NULL) { - memreq = - image_size(newwidth, newheight, format, GL_UNSIGNED_SHORT); - otherImage = (GLushort *) malloc(memreq); - if (otherImage == NULL) { - glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels); - glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); - glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); - return GLU_OUT_OF_MEMORY; - } - } - scale_internal(cmpts, newImage_width, newImage_height, newImage, - newwidth, newheight, otherImage); - /* Swap newImage and otherImage */ - imageTemp = otherImage; - otherImage = newImage; - newImage = imageTemp; - - newImage_width = newwidth; - newImage_height = newheight; - glTexImage2D(target, level, internalFormat, newImage_width, - newImage_height, 0, format, GL_UNSIGNED_SHORT, - (void *) newImage); - } - if (newwidth > 1) newwidth /= 2; - if (newheight > 1) newheight /= 2; + if (newImage_width == newwidth && newImage_height == newheight) { /* Use newImage for this level */ + glTexImage2D(target, level, internalFormat, newImage_width, + newImage_height, 0, format, GL_UNSIGNED_SHORT, + (void *) newImage); + } else { + if (otherImage == NULL) { + memreq = + image_size(newwidth, newheight, format, GL_UNSIGNED_SHORT); + otherImage = (GLushort *) malloc(memreq); + if (otherImage == NULL) { + glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); + glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); + glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels); + glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); + glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + return GLU_OUT_OF_MEMORY; + } + } + scale_internal(cmpts, newImage_width, newImage_height, newImage, + newwidth, newheight, otherImage); + /* Swap newImage and otherImage */ + imageTemp = otherImage; + otherImage = newImage; + newImage = imageTemp; + + newImage_width = newwidth; + newImage_height = newheight; + glTexImage2D(target, level, internalFormat, newImage_width, + newImage_height, 0, format, GL_UNSIGNED_SHORT, + (void *) newImage); + } + if (newwidth > 1) newwidth /= 2; + if (newheight > 1) newheight /= 2; } glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows); @@ -3747,7 +3747,7 @@ static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat, free((GLbyte *) newImage); if (otherImage) { - free((GLbyte *) otherImage); + free((GLbyte *) otherImage); } return 0; } @@ -3756,12 +3756,12 @@ static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat, #define __GLU_INIT_SWAP_IMAGE void *tmpImage #define __GLU_SWAP_IMAGE(a,b) tmpImage = a; a = b; b = tmpImage; -static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, - GLsizei width, GLsizei height, - GLsizei widthPowerOf2, - GLsizei heightPowerOf2, - GLenum format, GLenum type, - GLint userLevel, +static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, + GLsizei width, GLsizei height, + GLsizei widthPowerOf2, + GLsizei heightPowerOf2, + GLenum format, GLenum type, + GLint userLevel, GLint baseLevel,GLint maxLevel, const void *data) { @@ -3782,7 +3782,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, if(type == GL_BITMAP) { return bitmapBuild2DMipmaps(target, internalFormat, width, height, - format, type, data); + format, type, data); } srcImage = dstImage = NULL; @@ -3813,7 +3813,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, if (padding) { rowsize += psm.unpack_alignment - padding; } - usersImage = (const GLubyte *) data + psm.unpack_skip_rows * rowsize + + usersImage = (const GLubyte *) data + psm.unpack_skip_rows * rowsize + psm.unpack_skip_pixels * group_size; glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); @@ -3825,8 +3825,8 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, /* already power-of-two square */ if (width == newwidth && height == newheight) { /* Use usersImage for level userLevel */ - if (baseLevel <= level && level <= maxLevel) { - glTexImage2D(target, level, internalFormat, width, + if (baseLevel <= level && level <= maxLevel) { + glTexImage2D(target, level, internalFormat, width, height, 0, format, type, usersImage); } @@ -3846,7 +3846,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, if (nextWidth < 1) nextWidth= 1; if (nextHeight < 1) nextHeight= 1; memreq = image_size(nextWidth, nextHeight, format, type); - } + } switch(type) { case GL_UNSIGNED_BYTE: @@ -3870,23 +3870,23 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, case GL_FLOAT: dstImage = (GLfloat *)malloc(memreq); break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: dstImage = (GLubyte *)malloc(memreq); break; - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_1_5_5_5_REV: dstImage = (GLushort *)malloc(memreq); - break; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - dstImage = (GLuint *)malloc(memreq); + break; + case GL_UNSIGNED_INT_8_8_8_8: + case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_INT_10_10_10_2: + case GL_UNSIGNED_INT_2_10_10_10_REV: + dstImage = (GLuint *)malloc(memreq); break; default: return GLU_INVALID_ENUM; @@ -3903,12 +3903,12 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, switch(type) { case GL_UNSIGNED_BYTE: halveImage_ubyte(cmpts, width, height, - (const GLubyte *)usersImage, (GLubyte *)dstImage, + (const GLubyte *)usersImage, (GLubyte *)dstImage, element_size, rowsize, group_size); break; case GL_BYTE: halveImage_byte(cmpts, width, height, - (const GLbyte *)usersImage, (GLbyte *)dstImage, + (const GLbyte *)usersImage, (GLbyte *)dstImage, element_size, rowsize, group_size); break; case GL_UNSIGNED_SHORT: @@ -3918,17 +3918,17 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, break; case GL_SHORT: halveImage_short(cmpts, width, height, - (const GLshort *)usersImage, (GLshort *)dstImage, + (const GLshort *)usersImage, (GLshort *)dstImage, element_size, rowsize, group_size, myswap_bytes); break; case GL_UNSIGNED_INT: halveImage_uint(cmpts, width, height, - (const GLuint *)usersImage, (GLuint *)dstImage, + (const GLuint *)usersImage, (GLuint *)dstImage, element_size, rowsize, group_size, myswap_bytes); break; case GL_INT: halveImage_int(cmpts, width, height, - (const GLint *)usersImage, (GLint *)dstImage, + (const GLint *)usersImage, (GLint *)dstImage, element_size, rowsize, group_size, myswap_bytes); break; case GL_FLOAT: @@ -3936,69 +3936,69 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, (const GLfloat *)usersImage, (GLfloat *)dstImage, element_size, rowsize, group_size, myswap_bytes); break; - case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_3_3_2: assert(format == GL_RGB); halveImagePackedPixel(3,extract332,shove332, width,height,usersImage,dstImage, element_size,rowsize,myswap_bytes); break; - case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_BYTE_2_3_3_REV: assert(format == GL_RGB); halveImagePackedPixel(3,extract233rev,shove233rev, width,height,usersImage,dstImage, element_size,rowsize,myswap_bytes); break; - case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5: halveImagePackedPixel(3,extract565,shove565, width,height,usersImage,dstImage, element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_SHORT_5_6_5_REV: + break; + case GL_UNSIGNED_SHORT_5_6_5_REV: halveImagePackedPixel(3,extract565rev,shove565rev, width,height,usersImage,dstImage, element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_SHORT_4_4_4_4: + break; + case GL_UNSIGNED_SHORT_4_4_4_4: halveImagePackedPixel(4,extract4444,shove4444, width,height,usersImage,dstImage, element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: + break; + case GL_UNSIGNED_SHORT_4_4_4_4_REV: halveImagePackedPixel(4,extract4444rev,shove4444rev, width,height,usersImage,dstImage, element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_SHORT_5_5_5_1: + break; + case GL_UNSIGNED_SHORT_5_5_5_1: halveImagePackedPixel(4,extract5551,shove5551, width,height,usersImage,dstImage, element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: + break; + case GL_UNSIGNED_SHORT_1_5_5_5_REV: halveImagePackedPixel(4,extract1555rev,shove1555rev, width,height,usersImage,dstImage, element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_INT_8_8_8_8: + break; + case GL_UNSIGNED_INT_8_8_8_8: halveImagePackedPixel(4,extract8888,shove8888, width,height,usersImage,dstImage, element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_INT_8_8_8_8_REV: + break; + case GL_UNSIGNED_INT_8_8_8_8_REV: halveImagePackedPixel(4,extract8888rev,shove8888rev, width,height,usersImage,dstImage, element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_INT_10_10_10_2: + break; + case GL_UNSIGNED_INT_10_10_10_2: halveImagePackedPixel(4,extract1010102,shove1010102, width,height,usersImage,dstImage, element_size,rowsize,myswap_bytes); - break; - case GL_UNSIGNED_INT_2_10_10_10_REV: + break; + case GL_UNSIGNED_INT_2_10_10_10_REV: halveImagePackedPixel(4,extract2101010rev,shove2101010rev, width,height,usersImage,dstImage, element_size,rowsize,myswap_bytes); - break; - default: + break; + default: assert(0); break; } @@ -4006,7 +4006,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, newheight = height/2; /* clamp to 1 */ if (newwidth < 1) newwidth= 1; - if (newheight < 1) newheight= 1; + if (newheight < 1) newheight= 1; myswap_bytes = 0; rowsize = newwidth * group_size; @@ -4035,22 +4035,22 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, case GL_FLOAT: dstImage = (GLfloat *)malloc(memreq); break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: dstImage = (GLubyte *)malloc(memreq); break; - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_1_5_5_5_REV: dstImage = (GLushort *)malloc(memreq); break; - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: + case GL_UNSIGNED_INT_8_8_8_8: + case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_INT_10_10_10_2: + case GL_UNSIGNED_INT_2_10_10_10_REV: dstImage = (GLuint *)malloc(memreq); break; default: @@ -4069,30 +4069,30 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, } else { /* user's image is *not* nice power-of-2 sized square */ memreq = image_size(newwidth, newheight, format, type); switch(type) { - case GL_UNSIGNED_BYTE: - dstImage = (GLubyte *)malloc(memreq); - break; - case GL_BYTE: - dstImage = (GLbyte *)malloc(memreq); - break; - case GL_UNSIGNED_SHORT: - dstImage = (GLushort *)malloc(memreq); - break; - case GL_SHORT: - dstImage = (GLshort *)malloc(memreq); - break; - case GL_UNSIGNED_INT: - dstImage = (GLuint *)malloc(memreq); - break; - case GL_INT: - dstImage = (GLint *)malloc(memreq); - break; - case GL_FLOAT: - dstImage = (GLfloat *)malloc(memreq); - break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - dstImage = (GLubyte *)malloc(memreq); + case GL_UNSIGNED_BYTE: + dstImage = (GLubyte *)malloc(memreq); + break; + case GL_BYTE: + dstImage = (GLbyte *)malloc(memreq); + break; + case GL_UNSIGNED_SHORT: + dstImage = (GLushort *)malloc(memreq); + break; + case GL_SHORT: + dstImage = (GLshort *)malloc(memreq); + break; + case GL_UNSIGNED_INT: + dstImage = (GLuint *)malloc(memreq); + break; + case GL_INT: + dstImage = (GLint *)malloc(memreq); + break; + case GL_FLOAT: + dstImage = (GLfloat *)malloc(memreq); + break; + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: + dstImage = (GLubyte *)malloc(memreq); break; case GL_UNSIGNED_SHORT_5_6_5: case GL_UNSIGNED_SHORT_5_6_5_REV: @@ -4108,9 +4108,9 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, case GL_UNSIGNED_INT_2_10_10_10_REV: dstImage = (GLuint *)malloc(memreq); break; - default: - return GLU_INVALID_ENUM; - } + default: + return GLU_INVALID_ENUM; + } if (dstImage == NULL) { glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment); @@ -4130,7 +4130,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, break; case GL_BYTE: scale_internal_byte(cmpts, width, height, - (const GLbyte *)usersImage, newwidth, newheight, + (const GLbyte *)usersImage, newwidth, newheight, (GLbyte *)dstImage, element_size, rowsize, group_size); break; @@ -4154,89 +4154,89 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, break; case GL_INT: scale_internal_int(cmpts, width, height, - (const GLint *)usersImage, newwidth, newheight, + (const GLint *)usersImage, newwidth, newheight, (GLint *)dstImage, element_size, rowsize, group_size, myswap_bytes); break; case GL_FLOAT: scale_internal_float(cmpts, width, height, - (const GLfloat *)usersImage, newwidth, newheight, + (const GLfloat *)usersImage, newwidth, newheight, (GLfloat *)dstImage, element_size, rowsize, group_size, myswap_bytes); break; - case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_3_3_2: scaleInternalPackedPixel(3,extract332,shove332, width, height,usersImage, newwidth,newheight,(void *)dstImage, element_size,rowsize,myswap_bytes); break; - case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_BYTE_2_3_3_REV: scaleInternalPackedPixel(3,extract233rev,shove233rev, width, height,usersImage, newwidth,newheight,(void *)dstImage, element_size,rowsize,myswap_bytes); break; - case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5: scaleInternalPackedPixel(3,extract565,shove565, width, height,usersImage, newwidth,newheight,(void *)dstImage, element_size,rowsize,myswap_bytes); break; - case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_5_6_5_REV: scaleInternalPackedPixel(3,extract565rev,shove565rev, width, height,usersImage, newwidth,newheight,(void *)dstImage, element_size,rowsize,myswap_bytes); break; - case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_4_4_4_4: scaleInternalPackedPixel(4,extract4444,shove4444, width, height,usersImage, newwidth,newheight,(void *)dstImage, element_size,rowsize,myswap_bytes); break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: + case GL_UNSIGNED_SHORT_4_4_4_4_REV: scaleInternalPackedPixel(4,extract4444rev,shove4444rev, width, height,usersImage, newwidth,newheight,(void *)dstImage, element_size,rowsize,myswap_bytes); break; - case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_5_5_5_1: scaleInternalPackedPixel(4,extract5551,shove5551, width, height,usersImage, newwidth,newheight,(void *)dstImage, element_size,rowsize,myswap_bytes); break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: + case GL_UNSIGNED_SHORT_1_5_5_5_REV: scaleInternalPackedPixel(4,extract1555rev,shove1555rev, width, height,usersImage, newwidth,newheight,(void *)dstImage, element_size,rowsize,myswap_bytes); break; - case GL_UNSIGNED_INT_8_8_8_8: + case GL_UNSIGNED_INT_8_8_8_8: scaleInternalPackedPixel(4,extract8888,shove8888, width, height,usersImage, newwidth,newheight,(void *)dstImage, element_size,rowsize,myswap_bytes); break; - case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_INT_8_8_8_8_REV: scaleInternalPackedPixel(4,extract8888rev,shove8888rev, width, height,usersImage, newwidth,newheight,(void *)dstImage, element_size,rowsize,myswap_bytes); break; - case GL_UNSIGNED_INT_10_10_10_2: + case GL_UNSIGNED_INT_10_10_10_2: scaleInternalPackedPixel(4,extract1010102,shove1010102, width, height,usersImage, newwidth,newheight,(void *)dstImage, element_size,rowsize,myswap_bytes); break; - case GL_UNSIGNED_INT_2_10_10_10_REV: + case GL_UNSIGNED_INT_2_10_10_10_REV: scaleInternalPackedPixel(4,extract2101010rev,shove2101010rev, width, height,usersImage, newwidth,newheight,(void *)dstImage, element_size,rowsize,myswap_bytes); break; - default: + default: assert(0); break; } @@ -4246,14 +4246,14 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, __GLU_SWAP_IMAGE(srcImage,dstImage); if(levels != 0) { /* use as little memory as possible */ - { + { int nextWidth= newwidth/2; int nextHeight= newheight/2; if (nextWidth < 1) nextWidth= 1; - if (nextHeight < 1) nextHeight= 1; + if (nextHeight < 1) nextHeight= 1; memreq = image_size(nextWidth, nextHeight, format, type); - } + } switch(type) { case GL_UNSIGNED_BYTE: @@ -4277,12 +4277,12 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, case GL_FLOAT: dstImage = (GLfloat *)malloc(memreq); break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: dstImage = (GLubyte *)malloc(memreq); break; - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: case GL_UNSIGNED_SHORT_4_4_4_4: case GL_UNSIGNED_SHORT_4_4_4_4_REV: case GL_UNSIGNED_SHORT_5_5_5_1: @@ -4308,12 +4308,12 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, } } /* level userLevel is in srcImage; nothing saved yet */ - level = userLevel; + level = userLevel; } glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); if (baseLevel <= level && level <= maxLevel) { - glTexImage2D(target, level, internalFormat, newwidth, newheight, 0, + glTexImage2D(target, level, internalFormat, newwidth, newheight, 0, format, type, (void *)srcImage); } @@ -4355,96 +4355,96 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, (GLfloat *)srcImage, (GLfloat *)dstImage, element_size, rowsize, group_size, myswap_bytes); break; - case GL_UNSIGNED_BYTE_3_3_2: - halveImagePackedPixel(3,extract332,shove332, + case GL_UNSIGNED_BYTE_3_3_2: + halveImagePackedPixel(3,extract332,shove332, newwidth,newheight, srcImage,dstImage,element_size,rowsize, myswap_bytes); break; - case GL_UNSIGNED_BYTE_2_3_3_REV: - halveImagePackedPixel(3,extract233rev,shove233rev, + case GL_UNSIGNED_BYTE_2_3_3_REV: + halveImagePackedPixel(3,extract233rev,shove233rev, newwidth,newheight, srcImage,dstImage,element_size,rowsize, myswap_bytes); break; case GL_UNSIGNED_SHORT_5_6_5: - halveImagePackedPixel(3,extract565,shove565, + halveImagePackedPixel(3,extract565,shove565, newwidth,newheight, srcImage,dstImage,element_size,rowsize, myswap_bytes); - break; + break; case GL_UNSIGNED_SHORT_5_6_5_REV: - halveImagePackedPixel(3,extract565rev,shove565rev, + halveImagePackedPixel(3,extract565rev,shove565rev, newwidth,newheight, srcImage,dstImage,element_size,rowsize, myswap_bytes); - break; - case GL_UNSIGNED_SHORT_4_4_4_4: - halveImagePackedPixel(4,extract4444,shove4444, + break; + case GL_UNSIGNED_SHORT_4_4_4_4: + halveImagePackedPixel(4,extract4444,shove4444, newwidth,newheight, srcImage,dstImage,element_size,rowsize, myswap_bytes); break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - halveImagePackedPixel(4,extract4444rev,shove4444rev, + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + halveImagePackedPixel(4,extract4444rev,shove4444rev, newwidth,newheight, srcImage,dstImage,element_size,rowsize, myswap_bytes); break; - case GL_UNSIGNED_SHORT_5_5_5_1: - halveImagePackedPixel(4,extract5551,shove5551, + case GL_UNSIGNED_SHORT_5_5_5_1: + halveImagePackedPixel(4,extract5551,shove5551, newwidth,newheight, srcImage,dstImage,element_size,rowsize, myswap_bytes); break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - halveImagePackedPixel(4,extract1555rev,shove1555rev, + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + halveImagePackedPixel(4,extract1555rev,shove1555rev, newwidth,newheight, srcImage,dstImage,element_size,rowsize, myswap_bytes); break; - case GL_UNSIGNED_INT_8_8_8_8: - halveImagePackedPixel(4,extract8888,shove8888, + case GL_UNSIGNED_INT_8_8_8_8: + halveImagePackedPixel(4,extract8888,shove8888, newwidth,newheight, srcImage,dstImage,element_size,rowsize, myswap_bytes); break; - case GL_UNSIGNED_INT_8_8_8_8_REV: - halveImagePackedPixel(4,extract8888rev,shove8888rev, + case GL_UNSIGNED_INT_8_8_8_8_REV: + halveImagePackedPixel(4,extract8888rev,shove8888rev, newwidth,newheight, srcImage,dstImage,element_size,rowsize, myswap_bytes); break; - case GL_UNSIGNED_INT_10_10_10_2: - halveImagePackedPixel(4,extract1010102,shove1010102, + case GL_UNSIGNED_INT_10_10_10_2: + halveImagePackedPixel(4,extract1010102,shove1010102, newwidth,newheight, srcImage,dstImage,element_size,rowsize, myswap_bytes); break; - case GL_UNSIGNED_INT_2_10_10_10_REV: - halveImagePackedPixel(4,extract2101010rev,shove2101010rev, + case GL_UNSIGNED_INT_2_10_10_10_REV: + halveImagePackedPixel(4,extract2101010rev,shove2101010rev, newwidth,newheight, srcImage,dstImage,element_size,rowsize, myswap_bytes); break; - default: - assert(0); + default: + assert(0); break; } __GLU_SWAP_IMAGE(srcImage,dstImage); - if (newwidth > 1) { newwidth /= 2; rowsize /= 2;} - if (newheight > 1) newheight /= 2; + if (newwidth > 1) { newwidth /= 2; rowsize /= 2;} + if (newheight > 1) newheight /= 2; { /* compute amount to pad per row, if any */ - int rowPad= rowsize % psm.unpack_alignment; + int rowPad= rowsize % psm.unpack_alignment; /* should row be padded? */ if (rowPad == 0) { /* nope, row should not be padded */ /* call tex image with srcImage untouched since it's not padded */ if (baseLevel <= level && level <= maxLevel) { - glTexImage2D(target, level, internalFormat, newwidth, newheight, 0, + glTexImage2D(target, level, internalFormat, newwidth, newheight, 0, format, type, (void *) srcImage); } } @@ -4469,7 +4469,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, for (ii= 0, dstTrav= (unsigned char *) newMipmapImage, srcTrav= (unsigned char *) srcImage; - ii< newheight; + ii< newheight; ii++, dstTrav+= newRowLength, /* make sure the correct distance... */ srcTrav+= rowsize) { /* ...is skipped */ @@ -4477,14 +4477,14 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, /* note that the pad bytes are not visited and will contain * garbage, which is ok. */ - } + } - /* ...and use this new image for mipmapping instead */ + /* ...and use this new image for mipmapping instead */ if (baseLevel <= level && level <= maxLevel) { - glTexImage2D(target, level, internalFormat, newwidth, newheight, 0, + glTexImage2D(target, level, internalFormat, newwidth, newheight, 0, format, type, newMipmapImage); } - free(newMipmapImage); /* don't forget to free it! */ + free(newMipmapImage); /* don't forget to free it! */ } /* else */ } } /* for level */ @@ -4502,9 +4502,9 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, } /* gluBuild2DMipmapLevelsCore() */ GLint GLAPIENTRY -gluBuild2DMipmapLevels(GLenum target, GLint internalFormat, - GLsizei width, GLsizei height, - GLenum format, GLenum type, +gluBuild2DMipmapLevels(GLenum target, GLint internalFormat, + GLsizei width, GLsizei height, + GLenum format, GLenum type, GLint userLevel, GLint baseLevel, GLint maxLevel, const void *data) { @@ -4522,21 +4522,21 @@ gluBuild2DMipmapLevels(GLenum target, GLint internalFormat, if (level > levels) levels=level; levels+= userLevel; - if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels)) + if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels)) return GLU_INVALID_VALUE; - return gluBuild2DMipmapLevelsCore(target, internalFormat, + return gluBuild2DMipmapLevelsCore(target, internalFormat, width, height, width, height, - format, type, + format, type, userLevel, baseLevel, maxLevel, data); } /* gluBuild2DMipmapLevels() */ GLint GLAPIENTRY -gluBuild2DMipmaps(GLenum target, GLint internalFormat, - GLsizei width, GLsizei height, - GLenum format, GLenum type, +gluBuild2DMipmaps(GLenum target, GLint internalFormat, + GLsizei width, GLsizei height, + GLenum format, GLenum type, const void *data) { GLint widthPowerOf2, heightPowerOf2; @@ -4563,16 +4563,17 @@ gluBuild2DMipmaps(GLenum target, GLint internalFormat, 0,0,levels,data); } /* gluBuild2DMipmaps() */ +#if 0 /* ** This routine is for the limited case in which -** type == GL_UNSIGNED_BYTE && format != index && +** type == GL_UNSIGNED_BYTE && format != index && ** unpack_alignment = 1 && unpack_swap_bytes == false ** ** so all of the work data can be kept as ubytes instead of shorts. */ static int fastBuild2DMipmaps(const PixelStorageModes *psm, - GLenum target, GLint components, GLint width, - GLint height, GLenum format, + GLenum target, GLint components, GLint width, + GLint height, GLenum format, GLenum type, void *data) { GLint newwidth, newheight; @@ -4620,8 +4621,8 @@ static int fastBuild2DMipmaps(const PixelStorageModes *psm, GLubyte *iter2; GLint i, j; - newImage = (GLubyte *) - malloc(image_size(width, height, format, GL_UNSIGNED_BYTE)); + newImage = (GLubyte *) + malloc(image_size(width, height, format, GL_UNSIGNED_BYTE)); newImage_width = width; newImage_height = height; if (newImage == NULL) { @@ -4638,7 +4639,7 @@ static int fastBuild2DMipmaps(const PixelStorageModes *psm, } rowsize = groups_per_line * cmpts; elements_per_line = width * cmpts; - start = (const GLubyte *) data + psm->unpack_skip_rows * rowsize + + start = (const GLubyte *) data + psm->unpack_skip_rows * rowsize + psm->unpack_skip_pixels * cmpts; iter2 = newImage; @@ -4663,12 +4664,12 @@ static int fastBuild2DMipmaps(const PixelStorageModes *psm, for (level = 0; level <= levels; level++) { if (newImage_width == newwidth && newImage_height == newheight) { /* Use newImage for this level */ - glTexImage2D(target, level, components, newImage_width, - newImage_height, 0, format, GL_UNSIGNED_BYTE, + glTexImage2D(target, level, components, newImage_width, + newImage_height, 0, format, GL_UNSIGNED_BYTE, (void *) newImage); } else { if (otherImage == NULL) { - memreq = + memreq = image_size(newwidth, newheight, format, GL_UNSIGNED_BYTE); otherImage = (GLubyte *) malloc(memreq); if (otherImage == NULL) { @@ -4681,18 +4682,18 @@ static int fastBuild2DMipmaps(const PixelStorageModes *psm, } } /* - scale_internal_ubyte(cmpts, newImage_width, newImage_height, + scale_internal_ubyte(cmpts, newImage_width, newImage_height, newImage, newwidth, newheight, otherImage); */ /* Swap newImage and otherImage */ - imageTemp = otherImage; + imageTemp = otherImage; otherImage = newImage; newImage = imageTemp; newImage_width = newwidth; newImage_height = newheight; - glTexImage2D(target, level, components, newImage_width, - newImage_height, 0, format, GL_UNSIGNED_BYTE, + glTexImage2D(target, level, components, newImage_width, + newImage_height, 0, format, GL_UNSIGNED_BYTE, (void *) newImage); } if (newwidth > 1) newwidth /= 2; @@ -4712,18 +4713,19 @@ static int fastBuild2DMipmaps(const PixelStorageModes *psm, } return 0; } +#endif /* * Utility Routines */ -static GLint elements_per_group(GLenum format, GLenum type) +static GLint elements_per_group(GLenum format, GLenum type) { /* * Return the number of elements per group of a specified format */ /* If the type is packedpixels then answer is 1 (ignore format) */ - if (type == GL_UNSIGNED_BYTE_3_3_2 || + if (type == GL_UNSIGNED_BYTE_3_3_2 || type == GL_UNSIGNED_BYTE_2_3_3_REV || type == GL_UNSIGNED_SHORT_5_6_5 || type == GL_UNSIGNED_SHORT_5_6_5_REV || @@ -4735,7 +4737,7 @@ static GLint elements_per_group(GLenum format, GLenum type) type == GL_UNSIGNED_INT_8_8_8_8_REV || type == GL_UNSIGNED_INT_10_10_10_2 || type == GL_UNSIGNED_INT_2_10_10_10_REV) { - return 1; + return 1; } /* Types are not packed pixels, so get elements per group */ @@ -4753,7 +4755,7 @@ static GLint elements_per_group(GLenum format, GLenum type) } } -static GLfloat bytes_per_element(GLenum type) +static GLfloat bytes_per_element(GLenum type) { /* * Return the number of bytes per element, based on the element type @@ -4776,7 +4778,7 @@ static GLfloat bytes_per_element(GLenum type) case GL_FLOAT: return(sizeof(GLfloat)); case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_BYTE_2_3_3_REV: return(sizeof(GLubyte)); case GL_UNSIGNED_SHORT_5_6_5: case GL_UNSIGNED_SHORT_5_6_5_REV: @@ -4795,7 +4797,7 @@ static GLfloat bytes_per_element(GLenum type) } } -static GLint is_index(GLenum format) +static GLint is_index(GLenum format) { return format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX; } @@ -4804,7 +4806,7 @@ static GLint is_index(GLenum format) ** Compute memory required for internal packed array of data of given type ** and format. */ -static GLint image_size(GLint width, GLint height, GLenum format, GLenum type) +static GLint image_size(GLint width, GLint height, GLenum format, GLenum type) { int bytes_per_row; int components; @@ -4825,8 +4827,8 @@ assert(height > 0); ** The internal format used is an array of unsigned shorts. */ static void fill_image(const PixelStorageModes *psm, - GLint width, GLint height, GLenum format, - GLenum type, GLboolean index_format, + GLint width, GLint height, GLenum format, + GLenum type, GLboolean index_format, const void *userdata, GLushort *newimage) { GLint components; @@ -4860,7 +4862,7 @@ static void fill_image(const PixelStorageModes *psm, if (padding) { rowsize += psm->unpack_alignment - padding; } - start = (const GLubyte *) userdata + psm->unpack_skip_rows * rowsize + + start = (const GLubyte *) userdata + psm->unpack_skip_rows * rowsize + (psm->unpack_skip_pixels * components / 8); elements_per_line = width * components; iter2 = newimage; @@ -4902,7 +4904,7 @@ static void fill_image(const PixelStorageModes *psm, if (padding) { rowsize += psm->unpack_alignment - padding; } - start = (const GLubyte *) userdata + psm->unpack_skip_rows * rowsize + + start = (const GLubyte *) userdata + psm->unpack_skip_rows * rowsize + psm->unpack_skip_pixels * group_size; elements_per_line = width * components; @@ -4920,7 +4922,7 @@ static void fill_image(const PixelStorageModes *psm, *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_BYTE_2_3_3_REV: extract233rev(0,iter,extractComponents); for (k = 0; k < 3; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); @@ -4941,37 +4943,37 @@ static void fill_image(const PixelStorageModes *psm, *iter2++ = (*((const GLbyte *) iter)) * 516; } break; - case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5: extract565(myswap_bytes,iter,extractComponents); for (k = 0; k < 3; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_5_6_5_REV: extract565rev(myswap_bytes,iter,extractComponents); for (k = 0; k < 3; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_4_4_4_4: extract4444(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: + case GL_UNSIGNED_SHORT_4_4_4_4_REV: extract4444rev(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_5_5_5_1: extract5551(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: + case GL_UNSIGNED_SHORT_1_5_5_5_REV: extract1555rev(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); @@ -4997,19 +4999,19 @@ static void fill_image(const PixelStorageModes *psm, *iter2++ = widget.us[0]; } break; - case GL_UNSIGNED_INT_8_8_8_8: + case GL_UNSIGNED_INT_8_8_8_8: extract8888(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_INT_8_8_8_8_REV: extract8888rev(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_INT_10_10_10_2: + case GL_UNSIGNED_INT_10_10_10_2: extract1010102(myswap_bytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); @@ -5063,7 +5065,7 @@ static void fill_image(const PixelStorageModes *psm, /* want 'iter' pointing at start, not within, row for assertion * purposes */ - iter= start; + iter= start; #endif } /* for i */ @@ -5076,7 +5078,7 @@ static void fill_image(const PixelStorageModes *psm, elements_per_group(format,0)]); } assert( iter == &((const GLubyte *)userdata)[rowsize*height + - psm->unpack_skip_rows * rowsize + + psm->unpack_skip_rows * rowsize + psm->unpack_skip_pixels * group_size] ); } /* else */ @@ -5088,8 +5090,8 @@ static void fill_image(const PixelStorageModes *psm, ** empty_image() because it is the opposite of fill_image(). */ static void empty_image(const PixelStorageModes *psm, - GLint width, GLint height, GLenum format, - GLenum type, GLboolean index_format, + GLint width, GLint height, GLenum format, + GLenum type, GLboolean index_format, const GLushort *oldimage, void *userdata) { GLint components; @@ -5123,7 +5125,7 @@ static void empty_image(const PixelStorageModes *psm, if (padding) { rowsize += psm->pack_alignment - padding; } - start = (GLubyte *) userdata + psm->pack_skip_rows * rowsize + + start = (GLubyte *) userdata + psm->pack_skip_rows * rowsize + (psm->pack_skip_pixels * components / 8); elements_per_line = width * components; iter2 = oldimage; @@ -5165,7 +5167,7 @@ static void empty_image(const PixelStorageModes *psm, start += rowsize; } } else { - float shoveComponents[4]; + float shoveComponents[4]; element_size = bytes_per_element(type); group_size = element_size * components; @@ -5176,7 +5178,7 @@ static void empty_image(const PixelStorageModes *psm, if (padding) { rowsize += psm->pack_alignment - padding; } - start = (GLubyte *) userdata + psm->pack_skip_rows * rowsize + + start = (GLubyte *) userdata + psm->pack_skip_rows * rowsize + psm->pack_skip_pixels * group_size; elements_per_line = width * components; @@ -5187,18 +5189,18 @@ static void empty_image(const PixelStorageModes *psm, Type_Widget widget; switch(type) { - case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_3_3_2: for (k = 0; k < 3; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove332(shoveComponents,0,(void *)iter); break; case GL_UNSIGNED_BYTE_2_3_3_REV: for (k = 0; k < 3; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove233rev(shoveComponents,0,(void *)iter); - break; + break; case GL_UNSIGNED_BYTE: if (index_format) { *iter = *iter2++; @@ -5213,10 +5215,10 @@ static void empty_image(const PixelStorageModes *psm, *((GLbyte *) iter) = *iter2++ >> 9; } break; - case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5: for (k = 0; k < 3; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove565(shoveComponents,0,(void *)&widget.us[0]); if (myswap_bytes) { iter[0] = widget.ub[1]; @@ -5226,10 +5228,10 @@ static void empty_image(const PixelStorageModes *psm, *(GLushort *)iter = widget.us[0]; } break; - case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_5_6_5_REV: for (k = 0; k < 3; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove565rev(shoveComponents,0,(void *)&widget.us[0]); if (myswap_bytes) { iter[0] = widget.ub[1]; @@ -5239,10 +5241,10 @@ static void empty_image(const PixelStorageModes *psm, *(GLushort *)iter = widget.us[0]; } break; - case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_4_4_4_4: for (k = 0; k < 4; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove4444(shoveComponents,0,(void *)&widget.us[0]); if (myswap_bytes) { iter[0] = widget.ub[1]; @@ -5251,10 +5253,10 @@ static void empty_image(const PixelStorageModes *psm, *(GLushort *)iter = widget.us[0]; } break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: + case GL_UNSIGNED_SHORT_4_4_4_4_REV: for (k = 0; k < 4; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove4444rev(shoveComponents,0,(void *)&widget.us[0]); if (myswap_bytes) { iter[0] = widget.ub[1]; @@ -5266,7 +5268,7 @@ static void empty_image(const PixelStorageModes *psm, case GL_UNSIGNED_SHORT_5_5_5_1: for (k = 0; k < 4; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove5551(shoveComponents,0,(void *)&widget.us[0]); if (myswap_bytes) { iter[0] = widget.ub[1]; @@ -5278,7 +5280,7 @@ static void empty_image(const PixelStorageModes *psm, case GL_UNSIGNED_SHORT_1_5_5_5_REV: for (k = 0; k < 4; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove1555rev(shoveComponents,0,(void *)&widget.us[0]); if (myswap_bytes) { iter[0] = widget.ub[1]; @@ -5306,10 +5308,10 @@ static void empty_image(const PixelStorageModes *psm, iter[1] = widget.ub[1]; } break; - case GL_UNSIGNED_INT_8_8_8_8: + case GL_UNSIGNED_INT_8_8_8_8: for (k = 0; k < 4; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove8888(shoveComponents,0,(void *)&widget.ui); if (myswap_bytes) { iter[3] = widget.ub[0]; @@ -5317,14 +5319,14 @@ static void empty_image(const PixelStorageModes *psm, iter[1] = widget.ub[2]; iter[0] = widget.ub[3]; } else { - *(GLuint *)iter= widget.ui; + *(GLuint *)iter= widget.ui; } break; - case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_INT_8_8_8_8_REV: for (k = 0; k < 4; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove8888rev(shoveComponents,0,(void *)&widget.ui); if (myswap_bytes) { iter[3] = widget.ub[0]; @@ -5332,13 +5334,13 @@ static void empty_image(const PixelStorageModes *psm, iter[1] = widget.ub[2]; iter[0] = widget.ub[3]; } else { - *(GLuint *)iter= widget.ui; + *(GLuint *)iter= widget.ui; } break; - case GL_UNSIGNED_INT_10_10_10_2: + case GL_UNSIGNED_INT_10_10_10_2: for (k = 0; k < 4; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove1010102(shoveComponents,0,(void *)&widget.ui); if (myswap_bytes) { iter[3] = widget.ub[0]; @@ -5346,13 +5348,13 @@ static void empty_image(const PixelStorageModes *psm, iter[1] = widget.ub[2]; iter[0] = widget.ub[3]; } else { - *(GLuint *)iter= widget.ui; + *(GLuint *)iter= widget.ui; } break; case GL_UNSIGNED_INT_2_10_10_10_REV: for (k = 0; k < 4; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove2101010rev(shoveComponents,0,(void *)&widget.ui); if (myswap_bytes) { iter[3] = widget.ub[0]; @@ -5360,7 +5362,7 @@ static void empty_image(const PixelStorageModes *psm, iter[1] = widget.ub[2]; iter[0] = widget.ub[3]; } else { - *(GLuint *)iter= widget.ui; + *(GLuint *)iter= widget.ui; } break; case GL_INT: @@ -5405,7 +5407,7 @@ static void empty_image(const PixelStorageModes *psm, /* want 'iter' pointing at start, not within, row for assertion * purposes */ - iter= start; + iter= start; #endif } /* for i */ @@ -5418,16 +5420,16 @@ static void empty_image(const PixelStorageModes *psm, elements_per_group(format,0)]); } assert( iter == &((GLubyte *)userdata)[rowsize*height + - psm->pack_skip_rows * rowsize + + psm->pack_skip_rows * rowsize + psm->pack_skip_pixels * group_size] ); } /* else */ } /* empty_image() */ /*-------------------------------------------------------------------------- - * Decimation of packed pixel types + * Decimation of packed pixel types *-------------------------------------------------------------------------- - */ + */ static void extract332(int isSwap, const void *packedPixel, GLfloat extractComponents[]) { @@ -5441,11 +5443,11 @@ static void extract332(int isSwap, extractComponents[0]= (float)((ubyte & 0xe0) >> 5) / 7.0; extractComponents[1]= (float)((ubyte & 0x1c) >> 2) / 7.0; /* 7 = 2^3-1 */ - extractComponents[2]= (float)((ubyte & 0x03) ) / 3.0; /* 3 = 2^2-1 */ + extractComponents[2]= (float)((ubyte & 0x03) ) / 3.0; /* 3 = 2^2-1 */ } /* extract332() */ -static void shove332(const GLfloat shoveComponents[], - int index, void *packedPixel) +static void shove332(const GLfloat shoveComponents[], + int index, void *packedPixel) { /* 11100000 == 0xe0 */ /* 00011100 == 0x1c */ @@ -5456,12 +5458,12 @@ static void shove332(const GLfloat shoveComponents[], assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); /* due to limited precision, need to round before shoving */ - ((GLubyte *)packedPixel)[index] = + ((GLubyte *)packedPixel)[index] = ((GLubyte)((shoveComponents[0] * 7)+0.5) << 5) & 0xe0; - ((GLubyte *)packedPixel)[index] |= + ((GLubyte *)packedPixel)[index] |= ((GLubyte)((shoveComponents[1] * 7)+0.5) << 2) & 0x1c; ((GLubyte *)packedPixel)[index] |= - ((GLubyte)((shoveComponents[2] * 3)+0.5) ) & 0x03; + ((GLubyte)((shoveComponents[2] * 3)+0.5) ) & 0x03; } /* shove332() */ static void extract233rev(int isSwap, @@ -5472,7 +5474,7 @@ static void extract233rev(int isSwap, isSwap= isSwap; /* turn off warnings */ /* 0000,0111 == 0x07 */ - /* 0011,1000 == 0x38 */ + /* 0011,1000 == 0x38 */ /* 1100,0000 == 0xC0 */ extractComponents[0]= (float)((ubyte & 0x07) ) / 7.0; @@ -5480,11 +5482,11 @@ static void extract233rev(int isSwap, extractComponents[2]= (float)((ubyte & 0xC0) >> 6) / 3.0; } /* extract233rev() */ -static void shove233rev(const GLfloat shoveComponents[], - int index, void *packedPixel) +static void shove233rev(const GLfloat shoveComponents[], + int index, void *packedPixel) { /* 0000,0111 == 0x07 */ - /* 0011,1000 == 0x38 */ + /* 0011,1000 == 0x38 */ /* 1100,0000 == 0xC0 */ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); @@ -5492,18 +5494,18 @@ static void shove233rev(const GLfloat shoveComponents[], assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); /* due to limited precision, need to round before shoving */ - ((GLubyte *)packedPixel)[index] = + ((GLubyte *)packedPixel)[index] = ((GLubyte)((shoveComponents[0] * 7.0)+0.5) ) & 0x07; - ((GLubyte *)packedPixel)[index]|= + ((GLubyte *)packedPixel)[index]|= ((GLubyte)((shoveComponents[1] * 7.0)+0.5) << 3) & 0x38; - ((GLubyte *)packedPixel)[index]|= + ((GLubyte *)packedPixel)[index]|= ((GLubyte)((shoveComponents[2] * 3.0)+0.5) << 6) & 0xC0; } /* shove233rev() */ static void extract565(int isSwap, const void *packedPixel, GLfloat extractComponents[]) { - GLushort ushort= *(const GLushort *)packedPixel; + GLushort ushort= *(const GLushort *)packedPixel; if (isSwap) { ushort= __GLU_SWAP_2_BYTES(packedPixel); @@ -5533,18 +5535,18 @@ static void shove565(const GLfloat shoveComponents[], assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); /* due to limited precision, need to round before shoving */ - ((GLushort *)packedPixel)[index] = + ((GLushort *)packedPixel)[index] = ((GLushort)((shoveComponents[0] * 31)+0.5) << 11) & 0xf800; - ((GLushort *)packedPixel)[index]|= + ((GLushort *)packedPixel)[index]|= ((GLushort)((shoveComponents[1] * 63)+0.5) << 5) & 0x07e0; - ((GLushort *)packedPixel)[index]|= + ((GLushort *)packedPixel)[index]|= ((GLushort)((shoveComponents[2] * 31)+0.5) ) & 0x001f; } /* shove565() */ static void extract565rev(int isSwap, const void *packedPixel, GLfloat extractComponents[]) { - GLushort ushort= *(const GLushort *)packedPixel; + GLushort ushort= *(const GLushort *)packedPixel; if (isSwap) { ushort= __GLU_SWAP_2_BYTES(packedPixel); @@ -5557,7 +5559,7 @@ static void extract565rev(int isSwap, /* 00000111,11100000 == 0x07e0 */ /* 11111000,00000000 == 0xf800 */ - extractComponents[0]= (float)((ushort & 0x001F) ) / 31.0; + extractComponents[0]= (float)((ushort & 0x001F) ) / 31.0; extractComponents[1]= (float)((ushort & 0x07E0) >> 5) / 63.0; extractComponents[2]= (float)((ushort & 0xF800) >> 11) / 31.0; } /* extract565rev() */ @@ -5574,15 +5576,15 @@ static void shove565rev(const GLfloat shoveComponents[], assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0); /* due to limited precision, need to round before shoving */ - ((GLushort *)packedPixel)[index] = + ((GLushort *)packedPixel)[index] = ((GLushort)((shoveComponents[0] * 31.0)+0.5) ) & 0x001F; - ((GLushort *)packedPixel)[index]|= + ((GLushort *)packedPixel)[index]|= ((GLushort)((shoveComponents[1] * 63.0)+0.5) << 5) & 0x07E0; - ((GLushort *)packedPixel)[index]|= + ((GLushort *)packedPixel)[index]|= ((GLushort)((shoveComponents[2] * 31.0)+0.5) << 11) & 0xF800; } /* shove565rev() */ -static void extract4444(int isSwap,const void *packedPixel, +static void extract4444(int isSwap,const void *packedPixel, GLfloat extractComponents[]) { GLushort ushort; @@ -5594,15 +5596,15 @@ static void extract4444(int isSwap,const void *packedPixel, ushort= *(const GLushort *)packedPixel; } - /* 11110000,00000000 == 0xf000 */ - /* 00001111,00000000 == 0x0f00 */ - /* 00000000,11110000 == 0x00f0 */ - /* 00000000,00001111 == 0x000f */ + /* 11110000,00000000 == 0xf000 */ + /* 00001111,00000000 == 0x0f00 */ + /* 00000000,11110000 == 0x00f0 */ + /* 00000000,00001111 == 0x000f */ extractComponents[0]= (float)((ushort & 0xf000) >> 12) / 15.0;/* 15=2^4-1 */ extractComponents[1]= (float)((ushort & 0x0f00) >> 8) / 15.0; extractComponents[2]= (float)((ushort & 0x00f0) >> 4) / 15.0; - extractComponents[3]= (float)((ushort & 0x000f) ) / 15.0; + extractComponents[3]= (float)((ushort & 0x000f) ) / 15.0; } /* extract4444() */ static void shove4444(const GLfloat shoveComponents[], @@ -5614,17 +5616,17 @@ static void shove4444(const GLfloat shoveComponents[], assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); /* due to limited precision, need to round before shoving */ - ((GLushort *)packedPixel)[index] = + ((GLushort *)packedPixel)[index] = ((GLushort)((shoveComponents[0] * 15)+0.5) << 12) & 0xf000; - ((GLushort *)packedPixel)[index]|= + ((GLushort *)packedPixel)[index]|= ((GLushort)((shoveComponents[1] * 15)+0.5) << 8) & 0x0f00; - ((GLushort *)packedPixel)[index]|= + ((GLushort *)packedPixel)[index]|= ((GLushort)((shoveComponents[2] * 15)+0.5) << 4) & 0x00f0; - ((GLushort *)packedPixel)[index]|= + ((GLushort *)packedPixel)[index]|= ((GLushort)((shoveComponents[3] * 15)+0.5) ) & 0x000f; } /* shove4444() */ -static void extract4444rev(int isSwap,const void *packedPixel, +static void extract4444rev(int isSwap,const void *packedPixel, GLfloat extractComponents[]) { GLushort ushort; @@ -5636,13 +5638,13 @@ static void extract4444rev(int isSwap,const void *packedPixel, ushort= *(const GLushort *)packedPixel; } - /* 00000000,00001111 == 0x000f */ - /* 00000000,11110000 == 0x00f0 */ - /* 00001111,00000000 == 0x0f00 */ - /* 11110000,00000000 == 0xf000 */ + /* 00000000,00001111 == 0x000f */ + /* 00000000,11110000 == 0x00f0 */ + /* 00001111,00000000 == 0x0f00 */ + /* 11110000,00000000 == 0xf000 */ /* 15 = 2^4-1 */ - extractComponents[0]= (float)((ushort & 0x000F) ) / 15.0; + extractComponents[0]= (float)((ushort & 0x000F) ) / 15.0; extractComponents[1]= (float)((ushort & 0x00F0) >> 4) / 15.0; extractComponents[2]= (float)((ushort & 0x0F00) >> 8) / 15.0; extractComponents[3]= (float)((ushort & 0xF000) >> 12) / 15.0; @@ -5651,10 +5653,10 @@ static void extract4444rev(int isSwap,const void *packedPixel, static void shove4444rev(const GLfloat shoveComponents[], int index,void *packedPixel) { - /* 00000000,00001111 == 0x000f */ - /* 00000000,11110000 == 0x00f0 */ - /* 00001111,00000000 == 0x0f00 */ - /* 11110000,00000000 == 0xf000 */ + /* 00000000,00001111 == 0x000f */ + /* 00000000,11110000 == 0x00f0 */ + /* 00001111,00000000 == 0x0f00 */ + /* 11110000,00000000 == 0xf000 */ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); @@ -5662,17 +5664,17 @@ static void shove4444rev(const GLfloat shoveComponents[], assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); /* due to limited precision, need to round before shoving */ - ((GLushort *)packedPixel)[index] = + ((GLushort *)packedPixel)[index] = ((GLushort)((shoveComponents[0] * 15)+0.5) ) & 0x000F; - ((GLushort *)packedPixel)[index]|= + ((GLushort *)packedPixel)[index]|= ((GLushort)((shoveComponents[1] * 15)+0.5) << 4) & 0x00F0; - ((GLushort *)packedPixel)[index]|= + ((GLushort *)packedPixel)[index]|= ((GLushort)((shoveComponents[2] * 15)+0.5) << 8) & 0x0F00; - ((GLushort *)packedPixel)[index]|= + ((GLushort *)packedPixel)[index]|= ((GLushort)((shoveComponents[3] * 15)+0.5) << 12) & 0xF000; } /* shove4444rev() */ -static void extract5551(int isSwap,const void *packedPixel, +static void extract5551(int isSwap,const void *packedPixel, GLfloat extractComponents[]) { GLushort ushort; @@ -5684,10 +5686,10 @@ static void extract5551(int isSwap,const void *packedPixel, ushort= *(const GLushort *)packedPixel; } - /* 11111000,00000000 == 0xf800 */ - /* 00000111,11000000 == 0x07c0 */ - /* 00000000,00111110 == 0x003e */ - /* 00000000,00000001 == 0x0001 */ + /* 11111000,00000000 == 0xf800 */ + /* 00000111,11000000 == 0x07c0 */ + /* 00000000,00111110 == 0x003e */ + /* 00000000,00000001 == 0x0001 */ extractComponents[0]=(float)((ushort & 0xf800) >> 11) / 31.0;/* 31 = 2^5-1*/ extractComponents[1]=(float)((ushort & 0x07c0) >> 6) / 31.0; @@ -5698,10 +5700,10 @@ static void extract5551(int isSwap,const void *packedPixel, static void shove5551(const GLfloat shoveComponents[], int index,void *packedPixel) { - /* 11111000,00000000 == 0xf800 */ - /* 00000111,11000000 == 0x07c0 */ - /* 00000000,00111110 == 0x003e */ - /* 00000000,00000001 == 0x0001 */ + /* 11111000,00000000 == 0xf800 */ + /* 00000111,11000000 == 0x07c0 */ + /* 00000000,00111110 == 0x003e */ + /* 00000000,00000001 == 0x0001 */ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); @@ -5709,17 +5711,17 @@ static void shove5551(const GLfloat shoveComponents[], assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); /* due to limited precision, need to round before shoving */ - ((GLushort *)packedPixel)[index] = + ((GLushort *)packedPixel)[index] = ((GLushort)((shoveComponents[0] * 31)+0.5) << 11) & 0xf800; - ((GLushort *)packedPixel)[index]|= + ((GLushort *)packedPixel)[index]|= ((GLushort)((shoveComponents[1] * 31)+0.5) << 6) & 0x07c0; - ((GLushort *)packedPixel)[index]|= + ((GLushort *)packedPixel)[index]|= ((GLushort)((shoveComponents[2] * 31)+0.5) << 1) & 0x003e; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[3])+0.5) ) & 0x0001; + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[3])+0.5) ) & 0x0001; } /* shove5551() */ -static void extract1555rev(int isSwap,const void *packedPixel, +static void extract1555rev(int isSwap,const void *packedPixel, GLfloat extractComponents[]) { GLushort ushort; @@ -5731,13 +5733,13 @@ static void extract1555rev(int isSwap,const void *packedPixel, ushort= *(const GLushort *)packedPixel; } - /* 00000000,00011111 == 0x001F */ - /* 00000011,11100000 == 0x03E0 */ - /* 01111100,00000000 == 0x7C00 */ - /* 10000000,00000000 == 0x8000 */ + /* 00000000,00011111 == 0x001F */ + /* 00000011,11100000 == 0x03E0 */ + /* 01111100,00000000 == 0x7C00 */ + /* 10000000,00000000 == 0x8000 */ /* 31 = 2^5-1 */ - extractComponents[0]= (float)((ushort & 0x001F) ) / 31.0; + extractComponents[0]= (float)((ushort & 0x001F) ) / 31.0; extractComponents[1]= (float)((ushort & 0x03E0) >> 5) / 31.0; extractComponents[2]= (float)((ushort & 0x7C00) >> 10) / 31.0; extractComponents[3]= (float)((ushort & 0x8000) >> 15); @@ -5746,10 +5748,10 @@ static void extract1555rev(int isSwap,const void *packedPixel, static void shove1555rev(const GLfloat shoveComponents[], int index,void *packedPixel) { - /* 00000000,00011111 == 0x001F */ - /* 00000011,11100000 == 0x03E0 */ - /* 01111100,00000000 == 0x7C00 */ - /* 10000000,00000000 == 0x8000 */ + /* 00000000,00011111 == 0x001F */ + /* 00000011,11100000 == 0x03E0 */ + /* 01111100,00000000 == 0x7C00 */ + /* 10000000,00000000 == 0x8000 */ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); @@ -5757,15 +5759,15 @@ static void shove1555rev(const GLfloat shoveComponents[], assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); /* due to limited precision, need to round before shoving */ - ((GLushort *)packedPixel)[index] = + ((GLushort *)packedPixel)[index] = ((GLushort)((shoveComponents[0] * 31)+0.5) ) & 0x001F; - ((GLushort *)packedPixel)[index]|= + ((GLushort *)packedPixel)[index]|= ((GLushort)((shoveComponents[1] * 31)+0.5) << 5) & 0x03E0; - ((GLushort *)packedPixel)[index]|= + ((GLushort *)packedPixel)[index]|= ((GLushort)((shoveComponents[2] * 31)+0.5) << 10) & 0x7C00; - ((GLushort *)packedPixel)[index]|= - ((GLushort)((shoveComponents[3])+0.5) << 15) & 0x8000; -} /* shove1555rev() */ + ((GLushort *)packedPixel)[index]|= + ((GLushort)((shoveComponents[3])+0.5) << 15) & 0x8000; +} /* shove1555rev() */ static void extract8888(int isSwap, const void *packedPixel, GLfloat extractComponents[]) @@ -5779,25 +5781,25 @@ static void extract8888(int isSwap, uint= *(const GLuint *)packedPixel; } - /* 11111111,00000000,00000000,00000000 == 0xff000000 */ - /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */ - /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */ - /* 00000000,00000000,00000000,11111111 == 0x000000ff */ + /* 11111111,00000000,00000000,00000000 == 0xff000000 */ + /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */ + /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */ + /* 00000000,00000000,00000000,11111111 == 0x000000ff */ /* 255 = 2^8-1 */ extractComponents[0]= (float)((uint & 0xff000000) >> 24) / 255.0; extractComponents[1]= (float)((uint & 0x00ff0000) >> 16) / 255.0; extractComponents[2]= (float)((uint & 0x0000ff00) >> 8) / 255.0; - extractComponents[3]= (float)((uint & 0x000000ff) ) / 255.0; + extractComponents[3]= (float)((uint & 0x000000ff) ) / 255.0; } /* extract8888() */ static void shove8888(const GLfloat shoveComponents[], int index,void *packedPixel) { - /* 11111111,00000000,00000000,00000000 == 0xff000000 */ - /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */ - /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */ - /* 00000000,00000000,00000000,11111111 == 0x000000ff */ + /* 11111111,00000000,00000000,00000000 == 0xff000000 */ + /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */ + /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */ + /* 00000000,00000000,00000000,11111111 == 0x000000ff */ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); @@ -5805,14 +5807,14 @@ static void shove8888(const GLfloat shoveComponents[], assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); /* due to limited precision, need to round before shoving */ - ((GLuint *)packedPixel)[index] = + ((GLuint *)packedPixel)[index] = ((GLuint)((shoveComponents[0] * 255)+0.5) << 24) & 0xff000000; - ((GLuint *)packedPixel)[index]|= + ((GLuint *)packedPixel)[index]|= ((GLuint)((shoveComponents[1] * 255)+0.5) << 16) & 0x00ff0000; - ((GLuint *)packedPixel)[index]|= + ((GLuint *)packedPixel)[index]|= ((GLuint)((shoveComponents[2] * 255)+0.5) << 8) & 0x0000ff00; - ((GLuint *)packedPixel)[index]|= - ((GLuint)((shoveComponents[3] * 255)+0.5) ) & 0x000000ff; + ((GLuint *)packedPixel)[index]|= + ((GLuint)((shoveComponents[3] * 255)+0.5) ) & 0x000000ff; } /* shove8888() */ static void extract8888rev(int isSwap, @@ -5827,13 +5829,13 @@ static void extract8888rev(int isSwap, uint= *(const GLuint *)packedPixel; } - /* 00000000,00000000,00000000,11111111 == 0x000000ff */ - /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */ - /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */ - /* 11111111,00000000,00000000,00000000 == 0xff000000 */ + /* 00000000,00000000,00000000,11111111 == 0x000000ff */ + /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */ + /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */ + /* 11111111,00000000,00000000,00000000 == 0xff000000 */ /* 255 = 2^8-1 */ - extractComponents[0]= (float)((uint & 0x000000FF) ) / 255.0; + extractComponents[0]= (float)((uint & 0x000000FF) ) / 255.0; extractComponents[1]= (float)((uint & 0x0000FF00) >> 8) / 255.0; extractComponents[2]= (float)((uint & 0x00FF0000) >> 16) / 255.0; extractComponents[3]= (float)((uint & 0xFF000000) >> 24) / 255.0; @@ -5842,10 +5844,10 @@ static void extract8888rev(int isSwap, static void shove8888rev(const GLfloat shoveComponents[], int index,void *packedPixel) { - /* 00000000,00000000,00000000,11111111 == 0x000000ff */ - /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */ - /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */ - /* 11111111,00000000,00000000,00000000 == 0xff000000 */ + /* 00000000,00000000,00000000,11111111 == 0x000000ff */ + /* 00000000,00000000,11111111,00000000 == 0x0000ff00 */ + /* 00000000,11111111,00000000,00000000 == 0x00ff0000 */ + /* 11111111,00000000,00000000,00000000 == 0xff000000 */ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); @@ -5853,13 +5855,13 @@ static void shove8888rev(const GLfloat shoveComponents[], assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); /* due to limited precision, need to round before shoving */ - ((GLuint *)packedPixel)[index] = - ((GLuint)((shoveComponents[0] * 255)+0.5) ) & 0x000000FF; - ((GLuint *)packedPixel)[index]|= + ((GLuint *)packedPixel)[index] = + ((GLuint)((shoveComponents[0] * 255)+0.5) ) & 0x000000FF; + ((GLuint *)packedPixel)[index]|= ((GLuint)((shoveComponents[1] * 255)+0.5) << 8) & 0x0000FF00; - ((GLuint *)packedPixel)[index]|= + ((GLuint *)packedPixel)[index]|= ((GLuint)((shoveComponents[2] * 255)+0.5) << 16) & 0x00FF0000; - ((GLuint *)packedPixel)[index]|= + ((GLuint *)packedPixel)[index]|= ((GLuint)((shoveComponents[3] * 255)+0.5) << 24) & 0xFF000000; } /* shove8888rev() */ @@ -5875,25 +5877,25 @@ static void extract1010102(int isSwap, uint= *(const GLuint *)packedPixel; } - /* 11111111,11000000,00000000,00000000 == 0xffc00000 */ - /* 00000000,00111111,11110000,00000000 == 0x003ff000 */ - /* 00000000,00000000,00001111,11111100 == 0x00000ffc */ - /* 00000000,00000000,00000000,00000011 == 0x00000003 */ + /* 11111111,11000000,00000000,00000000 == 0xffc00000 */ + /* 00000000,00111111,11110000,00000000 == 0x003ff000 */ + /* 00000000,00000000,00001111,11111100 == 0x00000ffc */ + /* 00000000,00000000,00000000,00000011 == 0x00000003 */ /* 1023 = 2^10-1 */ - extractComponents[0]= (float)((uint & 0xffc00000) >> 22) / 1023.0; + extractComponents[0]= (float)((uint & 0xffc00000) >> 22) / 1023.0; extractComponents[1]= (float)((uint & 0x003ff000) >> 12) / 1023.0; extractComponents[2]= (float)((uint & 0x00000ffc) >> 2) / 1023.0; - extractComponents[3]= (float)((uint & 0x00000003) ) / 3.0; + extractComponents[3]= (float)((uint & 0x00000003) ) / 3.0; } /* extract1010102() */ static void shove1010102(const GLfloat shoveComponents[], int index,void *packedPixel) { - /* 11111111,11000000,00000000,00000000 == 0xffc00000 */ - /* 00000000,00111111,11110000,00000000 == 0x003ff000 */ - /* 00000000,00000000,00001111,11111100 == 0x00000ffc */ - /* 00000000,00000000,00000000,00000011 == 0x00000003 */ + /* 11111111,11000000,00000000,00000000 == 0xffc00000 */ + /* 00000000,00111111,11110000,00000000 == 0x003ff000 */ + /* 00000000,00000000,00001111,11111100 == 0x00000ffc */ + /* 00000000,00000000,00000000,00000011 == 0x00000003 */ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); @@ -5901,15 +5903,15 @@ static void shove1010102(const GLfloat shoveComponents[], assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); /* due to limited precision, need to round before shoving */ - ((GLuint *)packedPixel)[index] = + ((GLuint *)packedPixel)[index] = ((GLuint)((shoveComponents[0] * 1023)+0.5) << 22) & 0xffc00000; - ((GLuint *)packedPixel)[index]|= + ((GLuint *)packedPixel)[index]|= ((GLuint)((shoveComponents[1] * 1023)+0.5) << 12) & 0x003ff000; - ((GLuint *)packedPixel)[index]|= + ((GLuint *)packedPixel)[index]|= ((GLuint)((shoveComponents[2] * 1023)+0.5) << 2) & 0x00000ffc; - ((GLuint *)packedPixel)[index]|= - ((GLuint)((shoveComponents[3] * 3)+0.5) ) & 0x00000003; -} /* shove1010102() */ + ((GLuint *)packedPixel)[index]|= + ((GLuint)((shoveComponents[3] * 3)+0.5) ) & 0x00000003; +} /* shove1010102() */ static void extract2101010rev(int isSwap, const void *packedPixel, @@ -5924,26 +5926,26 @@ static void extract2101010rev(int isSwap, uint= *(const GLuint *)packedPixel; } - /* 00000000,00000000,00000011,11111111 == 0x000003FF */ - /* 00000000,00001111,11111100,00000000 == 0x000FFC00 */ - /* 00111111,11110000,00000000,00000000 == 0x3FF00000 */ - /* 11000000,00000000,00000000,00000000 == 0xC0000000 */ + /* 00000000,00000000,00000011,11111111 == 0x000003FF */ + /* 00000000,00001111,11111100,00000000 == 0x000FFC00 */ + /* 00111111,11110000,00000000,00000000 == 0x3FF00000 */ + /* 11000000,00000000,00000000,00000000 == 0xC0000000 */ /* 1023 = 2^10-1 */ - extractComponents[0]= (float)((uint & 0x000003FF) ) / 1023.0; + extractComponents[0]= (float)((uint & 0x000003FF) ) / 1023.0; extractComponents[1]= (float)((uint & 0x000FFC00) >> 10) / 1023.0; extractComponents[2]= (float)((uint & 0x3FF00000) >> 20) / 1023.0; - extractComponents[3]= (float)((uint & 0xC0000000) >> 30) / 3.0; + extractComponents[3]= (float)((uint & 0xC0000000) >> 30) / 3.0; /* 3 = 2^2-1 */ } /* extract2101010rev() */ static void shove2101010rev(const GLfloat shoveComponents[], int index,void *packedPixel) { - /* 00000000,00000000,00000011,11111111 == 0x000003FF */ - /* 00000000,00001111,11111100,00000000 == 0x000FFC00 */ - /* 00111111,11110000,00000000,00000000 == 0x3FF00000 */ - /* 11000000,00000000,00000000,00000000 == 0xC0000000 */ + /* 00000000,00000000,00000011,11111111 == 0x000003FF */ + /* 00000000,00001111,11111100,00000000 == 0x000FFC00 */ + /* 00111111,11110000,00000000,00000000 == 0x3FF00000 */ + /* 11000000,00000000,00000000,00000000 == 0xC0000000 */ assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0); assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0); @@ -5951,14 +5953,14 @@ static void shove2101010rev(const GLfloat shoveComponents[], assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0); /* due to limited precision, need to round before shoving */ - ((GLuint *)packedPixel)[index] = + ((GLuint *)packedPixel)[index] = ((GLuint)((shoveComponents[0] * 1023)+0.5) ) & 0x000003FF; - ((GLuint *)packedPixel)[index]|= + ((GLuint *)packedPixel)[index]|= ((GLuint)((shoveComponents[1] * 1023)+0.5) << 10) & 0x000FFC00; - ((GLuint *)packedPixel)[index]|= + ((GLuint *)packedPixel)[index]|= ((GLuint)((shoveComponents[2] * 1023)+0.5) << 20) & 0x3FF00000; - ((GLuint *)packedPixel)[index]|= - ((GLuint)((shoveComponents[3] * 3)+0.5) << 30) & 0xC0000000; + ((GLuint *)packedPixel)[index]|= + ((GLuint)((shoveComponents[3] * 3)+0.5) << 30) & 0xC0000000; } /* shove2101010rev() */ static void scaleInternalPackedPixel(int components, @@ -5966,7 +5968,7 @@ static void scaleInternalPackedPixel(int components, (int, const void *,GLfloat []), void (*shovePackedPixel) (const GLfloat [], int, void *), - GLint widthIn,GLint heightIn, + GLint widthIn,GLint heightIn, const void *dataIn, GLint widthOut,GLint heightOut, void *dataOut, @@ -6007,7 +6009,7 @@ static void scaleInternalPackedPixel(int components, convy_float = convy - convy_int; convx_int = floor(convx); convx_float = convx - convx_int; - + area = convx * convy; lowy_int = 0; @@ -6034,118 +6036,118 @@ static void scaleInternalPackedPixel(int components, if((highy_int>lowy_int) && (highx_int>lowx_int)) { y_percent = 1-lowy_float; - temp = (const char *)dataIn + xindex + lowy_int * rowSizeInBytes; + temp = (const char *)dataIn + xindex + lowy_int * rowSizeInBytes; percent = y_percent * (1-lowx_float); #if 0 - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { if (myswap_bytes) { totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; } else { - totals[k] += *(const GLushort*)temp_index * percent; + totals[k] += *(const GLushort*)temp_index * percent; } - } + } #else (*extractPackedPixel)(isSwap,temp,extractTotals); for (k = 0; k < components; k++) { totals[k]+= extractTotals[k] * percent; - } + } #endif left = temp; - for(l = lowx_int+1; l < highx_int; l++) { + for(l = lowx_int+1; l < highx_int; l++) { temp += pixelSizeInBytes; #if 0 - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLushort*)temp_index * y_percent; - } + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLushort*)temp_index * y_percent; + } } #else (*extractPackedPixel)(isSwap,temp,extractTotals); for (k = 0; k < components; k++) { totals[k]+= extractTotals[k] * y_percent; - } + } #endif - } + } temp += pixelSizeInBytes; right = temp; percent = y_percent * highx_float; #if 0 - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } #else (*extractPackedPixel)(isSwap,temp,extractTotals); for (k = 0; k < components; k++) { totals[k]+= extractTotals[k] * percent; - } + } #endif /* calculate the value for pixels in the last row */ - + y_percent = highy_float; percent = y_percent * (1-lowx_float); temp = (const char *)dataIn + xindex + highy_int * rowSizeInBytes; #if 0 - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } #else (*extractPackedPixel)(isSwap,temp,extractTotals); for (k = 0; k < components; k++) { totals[k]+= extractTotals[k] * percent; - } + } #endif for(l = lowx_int+1; l < highx_int; l++) { - temp += pixelSizeInBytes; + temp += pixelSizeInBytes; #if 0 - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLushort*)temp_index * y_percent; - } - } + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLushort*)temp_index * y_percent; + } + } #else (*extractPackedPixel)(isSwap,temp,extractTotals); for (k = 0; k < components; k++) { totals[k]+= extractTotals[k] * y_percent; - } + } #endif - } - temp += pixelSizeInBytes; + } + temp += pixelSizeInBytes; percent = y_percent * highx_float; #if 0 - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } #else (*extractPackedPixel)(isSwap,temp,extractTotals); for (k = 0; k < components; k++) { totals[k]+= extractTotals[k] * percent; - } + } #endif /* calculate the value for pixels in the 1st and last column */ @@ -6153,23 +6155,23 @@ static void scaleInternalPackedPixel(int components, left += rowSizeInBytes; right += rowSizeInBytes; #if 0 - for (k = 0; k < components; - k++, left += element_size, right += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(left) * (1-lowx_float) + - __GLU_SWAP_2_BYTES(right) * highx_float; - } else { - totals[k] += *(const GLushort*)left * (1-lowx_float) - + *(const GLushort*)right * highx_float; - } + for (k = 0; k < components; + k++, left += element_size, right += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(left) * (1-lowx_float) + + __GLU_SWAP_2_BYTES(right) * highx_float; + } else { + totals[k] += *(const GLushort*)left * (1-lowx_float) + + *(const GLushort*)right * highx_float; + } } #else (*extractPackedPixel)(isSwap,left,extractTotals); (*extractPackedPixel)(isSwap,right,extractMoreTotals); for (k = 0; k < components; k++) { totals[k]+= (extractTotals[k]*(1-lowx_float) + - extractMoreTotals[k]*highx_float); + extractMoreTotals[k]*highx_float); } #endif } @@ -6178,128 +6180,128 @@ static void scaleInternalPackedPixel(int components, percent = (1-lowy_float)*x_percent; temp = (const char *)dataIn + xindex + lowy_int*rowSizeInBytes; #if 0 - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } #else (*extractPackedPixel)(isSwap,temp,extractTotals); for (k = 0; k < components; k++) { totals[k]+= extractTotals[k] * percent; - } + } #endif for(m = lowy_int+1; m < highy_int; m++) { temp += rowSizeInBytes; #if 0 - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * x_percent; - } else { - totals[k] += *(const GLushort*)temp_index * x_percent; - } + } else { + totals[k] += *(const GLushort*)temp_index * x_percent; + } } #else (*extractPackedPixel)(isSwap,temp,extractTotals); for (k = 0; k < components; k++) { totals[k]+= extractTotals[k] * x_percent; - } + } #endif } percent = x_percent * highy_float; temp += rowSizeInBytes; #if 0 - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } #else (*extractPackedPixel)(isSwap,temp,extractTotals); for (k = 0; k < components; k++) { totals[k]+= extractTotals[k] * percent; - } + } #endif } else if (highx_int > lowx_int) { y_percent = highy_float - lowy_float; percent = (1-lowx_float)*y_percent; temp = (const char *)dataIn + xindex + lowy_int*rowSizeInBytes; #if 0 - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } #else (*extractPackedPixel)(isSwap,temp,extractTotals); for (k = 0; k < components; k++) { totals[k]+= extractTotals[k] * percent; - } + } #endif for (l = lowx_int+1; l < highx_int; l++) { - temp += pixelSizeInBytes; + temp += pixelSizeInBytes; #if 0 - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += - __GLU_SWAP_2_BYTES(temp_index) * y_percent; - } else { - totals[k] += *(const GLushort*)temp_index * y_percent; - } + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += + __GLU_SWAP_2_BYTES(temp_index) * y_percent; + } else { + totals[k] += *(const GLushort*)temp_index * y_percent; + } } #else (*extractPackedPixel)(isSwap,temp,extractTotals); for (k = 0; k < components; k++) { totals[k]+= extractTotals[k] * y_percent; - } + } #endif } temp += pixelSizeInBytes; percent = y_percent * highx_float; #if 0 - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } } #else (*extractPackedPixel)(isSwap,temp,extractTotals); for (k = 0; k < components; k++) { totals[k]+= extractTotals[k] * percent; - } + } #endif } else { percent = (highy_float-lowy_float)*(highx_float-lowx_float); temp = (const char *)dataIn + xindex + lowy_int * rowSizeInBytes; #if 0 - for (k = 0, temp_index = temp; k < components; + for (k = 0, temp_index = temp; k < components; k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; - } else { - totals[k] += *(const GLushort*)temp_index * percent; - } - } + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index) * percent; + } else { + totals[k] += *(const GLushort*)temp_index * percent; + } + } #else (*extractPackedPixel)(isSwap,temp,extractTotals); for (k = 0; k < components; k++) { totals[k]+= extractTotals[k] * percent; - } + } #endif } @@ -6309,23 +6311,23 @@ static void scaleInternalPackedPixel(int components, temp = temp0; for(l = lowx_int+1; l < highx_int; l++) { #if 0 - for (k = 0, temp_index = temp; k < components; - k++, temp_index += element_size) { - if (myswap_bytes) { - totals[k] += __GLU_SWAP_2_BYTES(temp_index); - } else { - totals[k] += *(const GLushort*)temp_index; - } - } + for (k = 0, temp_index = temp; k < components; + k++, temp_index += element_size) { + if (myswap_bytes) { + totals[k] += __GLU_SWAP_2_BYTES(temp_index); + } else { + totals[k] += *(const GLushort*)temp_index; + } + } #else (*extractPackedPixel)(isSwap,temp,extractTotals); for (k = 0; k < components; k++) { totals[k]+= extractTotals[k]; - } + } #endif - temp += pixelSizeInBytes; - } - temp0 += rowSizeInBytes; + temp += pixelSizeInBytes; + } + temp0 += rowSizeInBytes; } outindex = (j + (i * widthOut)); /* * (components == 1) */ @@ -6336,14 +6338,14 @@ static void scaleInternalPackedPixel(int components, } #else for (k = 0; k < components; k++) { - shoveTotals[k]= totals[k]/area; + shoveTotals[k]= totals[k]/area; } (*shovePackedPixel)(shoveTotals,outindex,(void *)dataOut); #endif lowx_int = highx_int; lowx_float = highx_float; highx_int += convx_int; - highx_float += convx_float; + highx_float += convx_float; if(highx_float > 1) { highx_float -= 1.0; highx_int++; @@ -6362,17 +6364,17 @@ static void scaleInternalPackedPixel(int components, assert(outindex == (widthOut*heightOut - 1)); } /* scaleInternalPackedPixel() */ -/* rowSizeInBytes is at least the width (in bytes) due to padding on - * inputs; not always equal. Output NEVER has row padding. +/* rowSizeInBytes is at least the width (in bytes) due to padding on + * inputs; not always equal. Output NEVER has row padding. */ static void halveImagePackedPixel(int components, void (*extractPackedPixel) (int, const void *,GLfloat []), void (*shovePackedPixel) (const GLfloat [],int, void *), - GLint width, GLint height, + GLint width, GLint height, const void *dataIn, void *dataOut, - GLint pixelSizeInBytes, + GLint pixelSizeInBytes, GLint rowSizeInBytes, GLint isSwap) { /* handle case where there is only 1 column/row */ @@ -6409,13 +6411,13 @@ static void halveImagePackedPixel(int components, (*extractPackedPixel)(isSwap, (src+rowSizeInBytes+pixelSizeInBytes), &extractTotals[3][0]); - for (cc = 0; cc < components; cc++) { + for (cc = 0; cc < components; cc++) { int kk; /* grab 4 pixels to average */ totals[cc]= 0.0; /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ - * extractTotals[2][RED]+extractTotals[3][RED]; + * extractTotals[2][RED]+extractTotals[3][RED]; * totals[RED]/= 4.0; */ for (kk = 0; kk < BOX4; kk++) { @@ -6434,13 +6436,13 @@ static void halveImagePackedPixel(int components, /* src is at beginning of a row here, but it's the second row of * the square block of 4 pixels that we just worked on so we - * need to go one more row. - * i.e., - * OO... - * here -->OO... - * but want -->OO... - * OO... - * ... + * need to go one more row. + * i.e., + * OO... + * here -->OO... + * but want -->OO... + * OO... + * ... */ src+= rowSizeInBytes; } @@ -6456,9 +6458,9 @@ static void halve1DimagePackedPixel(int components, (int, const void *,GLfloat []), void (*shovePackedPixel) (const GLfloat [],int, void *), - GLint width, GLint height, + GLint width, GLint height, const void *dataIn, void *dataOut, - GLint pixelSizeInBytes, + GLint pixelSizeInBytes, GLint rowSizeInBytes, GLint isSwap) { int halfWidth= width / 2; @@ -6487,8 +6489,8 @@ static void halve1DimagePackedPixel(int components, (*extractPackedPixel)(isSwap,src, &extractTotals[0][0]); (*extractPackedPixel)(isSwap,(src+pixelSizeInBytes), - &extractTotals[1][0]); - for (cc = 0; cc < components; cc++) { + &extractTotals[1][0]); + for (cc = 0; cc < components; cc++) { int kk; /* grab 2 pixels to average */ @@ -6509,7 +6511,7 @@ static void halve1DimagePackedPixel(int components, } { - int padBytes= rowSizeInBytes - (width*pixelSizeInBytes); + int padBytes= rowSizeInBytes - (width*pixelSizeInBytes); src+= padBytes; /* for assertion only */ } assert(src == &((const char *)dataIn)[rowSizeInBytes]); @@ -6533,8 +6535,8 @@ static void halve1DimagePackedPixel(int components, (*extractPackedPixel)(isSwap,src, &extractTotals[0][0]); (*extractPackedPixel)(isSwap,(src+rowSizeInBytes), - &extractTotals[1][0]); - for (cc = 0; cc < components; cc++) { + &extractTotals[1][0]); + for (cc = 0; cc < components; cc++) { int kk; /* grab 2 pixels to average */ @@ -6568,13 +6570,13 @@ static void halve1DimagePackedPixel(int components, * Or is it might be supported as an extension. * Contributed by Gerk Huisma . */ - + typedef GLAPI void (GLAPIENTRY *TexImage3Dproc)( GLenum target, GLint level, - GLenum internalFormat, - GLsizei width, GLsizei height, - GLsizei depth, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ); + GLenum internalFormat, + GLsizei width, GLsizei height, + GLsizei depth, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ); static TexImage3Dproc pTexImage3D; @@ -6586,30 +6588,30 @@ static TexImage3Dproc pTexImage3D; #endif static void gluTexImage3D( GLenum target, GLint level, - GLenum internalFormat, - GLsizei width, GLsizei height, - GLsizei depth, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels ) + GLenum internalFormat, + GLsizei width, GLsizei height, + GLsizei depth, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ) { if (!pTexImage3D) { #ifdef WIN32 pTexImage3D = (TexImage3Dproc) wglGetProcAddress("glTexImage3D"); - if (!pTexImage3D) - pTexImage3D = (TexImage3Dproc) wglGetProcAddress("glTexImage3DEXT"); + if (!pTexImage3D) + pTexImage3D = (TexImage3Dproc) wglGetProcAddress("glTexImage3DEXT"); #else void *libHandle = dlopen("libgl.so", RTLD_LAZY); pTexImage3D = TexImage3Dproc) dlsym(libHandle, "glTexImage3D" ); - if (!pTexImage3D) - pTexImage3D = (TexImage3Dproc) dlsym(libHandle,"glTexImage3DEXT"); + if (!pTexImage3D) + pTexImage3D = (TexImage3Dproc) dlsym(libHandle,"glTexImage3DEXT"); dlclose(libHandle); #endif } /* Now call glTexImage3D */ - if (pTexImage3D) - pTexImage3D(target, level, internalFormat, width, height, - depth, border, format, type, pixels); + if (pTexImage3D) + pTexImage3D(target, level, internalFormat, width, height, + depth, border, format, type, pixels); } #else @@ -6620,10 +6622,10 @@ static void gluTexImage3D( GLenum target, GLint level, #endif static GLint imageSize3D(GLint width, GLint height, GLint depth, - GLenum format, GLenum type) + GLenum format, GLenum type) { int components= elements_per_group(format,type); - int bytes_per_row= bytes_per_element(type) * width; + int bytes_per_row= bytes_per_element(type) * width; assert(width > 0 && height > 0 && depth > 0); assert(type != GL_BITMAP); @@ -6631,9 +6633,9 @@ assert(type != GL_BITMAP); return bytes_per_row * height * depth * components; } /* imageSize3D() */ -static void fillImage3D(const PixelStorageModes *psm, - GLint width, GLint height, GLint depth, GLenum format, - GLenum type, GLboolean indexFormat, +static void fillImage3D(const PixelStorageModes *psm, + GLint width, GLint height, GLint depth, GLenum format, + GLenum type, GLboolean indexFormat, const void *userImage, GLushort *newImage) { int myswapBytes; @@ -6646,10 +6648,10 @@ static void fillImage3D(const PixelStorageModes *psm, int elementsPerLine; int rowsPerImage; int imageSize; - const GLubyte *start, *rowStart, *iter; + const GLubyte *start, *rowStart, *iter; GLushort *iter2; - int ww, hh, dd, k; - + int ww, hh, dd, k; + myswapBytes= psm->unpack_swap_bytes; components= elements_per_group(format,type); if (psm->unpack_row_length > 0) { @@ -6663,8 +6665,8 @@ static void fillImage3D(const PixelStorageModes *psm, if (elementSize == 1) myswapBytes= 0; /* 3dstuff begin */ - if (psm->unpack_image_height > 0) { - rowsPerImage= psm->unpack_image_height; + if (psm->unpack_image_height > 0) { + rowsPerImage= psm->unpack_image_height; } else { rowsPerImage= height; @@ -6679,10 +6681,10 @@ static void fillImage3D(const PixelStorageModes *psm, imageSize= rowsPerImage * rowSize; /* 3dstuff */ - start= (const GLubyte *)userImage + psm->unpack_skip_rows * rowSize + - psm->unpack_skip_pixels * groupSize + - /*3dstuff*/ - psm->unpack_skip_images * imageSize; + start= (const GLubyte *)userImage + psm->unpack_skip_rows * rowSize + + psm->unpack_skip_pixels * groupSize + + /*3dstuff*/ + psm->unpack_skip_images * imageSize; elementsPerLine = width * components; iter2= newImage; @@ -6718,37 +6720,37 @@ static void fillImage3D(const PixelStorageModes *psm, *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_BYTE_2_3_3_REV: extract233rev(0,iter,extractComponents); for (k = 0; k < 3; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5: extract565(myswapBytes,iter,extractComponents); for (k = 0; k < 3; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_5_6_5_REV: extract565rev(myswapBytes,iter,extractComponents); for (k = 0; k < 3; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_4_4_4_4: extract4444(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_4_4_4_4_REV: + case GL_UNSIGNED_SHORT_4_4_4_4_REV: extract4444rev(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_5_5_5_1: extract5551(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); @@ -6780,19 +6782,19 @@ static void fillImage3D(const PixelStorageModes *psm, *iter2++ = widget.us[0]; } break; - case GL_UNSIGNED_INT_8_8_8_8: + case GL_UNSIGNED_INT_8_8_8_8: extract8888(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_INT_8_8_8_8_REV: + case GL_UNSIGNED_INT_8_8_8_8_REV: extract8888rev(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); } break; - case GL_UNSIGNED_INT_10_10_10_2: + case GL_UNSIGNED_INT_10_10_10_2: extract1010102(myswapBytes,iter,extractComponents); for (k = 0; k < 4; k++) { *iter2++ = (GLushort)(extractComponents[k]*65535); @@ -6838,8 +6840,8 @@ static void fillImage3D(const PixelStorageModes *psm, } } break; - default: - assert(0); + default: + assert(0); } iter+= elementSize; @@ -6861,13 +6863,13 @@ static void fillImage3D(const PixelStorageModes *psm, elements_per_group(format,0)]); } assert( iter == &((const GLubyte *)userImage)[rowSize*height*depth + - psm->unpack_skip_rows * rowSize + + psm->unpack_skip_rows * rowSize + psm->unpack_skip_pixels * groupSize + /*3dstuff*/ psm->unpack_skip_images * imageSize] ); } /* fillImage3D () */ -static void scaleInternal3D(GLint components, +static void scaleInternal3D(GLint components, GLint widthIn, GLint heightIn, GLint depthIn, const GLushort *dataIn, GLint widthOut, GLint heightOut, GLint depthOut, @@ -6876,7 +6878,7 @@ static void scaleInternal3D(GLint components, float x, lowx, highx, convx, halfconvx; float y, lowy, highy, convy, halfconvy; float z, lowz, highz, convz, halfconvz; - float xpercent,ypercent,zpercent; + float xpercent,ypercent,zpercent; float percent; /* Max components in a format is 4, so... */ float totals[4]; @@ -6890,7 +6892,7 @@ static void scaleInternal3D(GLint components, halfconvx = convx/2; halfconvy = convy/2; halfconvz = convz/2; - for (d = 0; d < depthOut; d++) { + for (d = 0; d < depthOut; d++) { z = convz * (d+0.5); if (depthIn > depthOut) { highz = z + halfconvz; @@ -6960,11 +6962,11 @@ static void scaleInternal3D(GLint components, percent = xpercent * ypercent * zpercent; volume += percent; - temp = (xindex + (yindex*widthIn) + + temp = (xindex + (yindex*widthIn) + (zindex*widthIn*heightIn)) * components; for (k = 0; k < components; k++) { - assert(0 <= (temp+k) && - (temp+k) < + assert(0 <= (temp+k) && + (temp+k) < (widthIn*heightIn*depthIn*components)); totals[k] += dataIn[temp + k] * percent; } @@ -6981,13 +6983,13 @@ static void scaleInternal3D(GLint components, z = zint; } /* while z */ - temp = (j + (i * widthOut) + + temp = (j + (i * widthOut) + (d*widthOut*heightOut)) * components; for (k = 0; k < components; k++) { - /* totals[] should be rounded in the case of enlarging an + /* totals[] should be rounded in the case of enlarging an * RGB ramp when the type is 332 or 4444 */ - assert(0 <= (temp+k) && + assert(0 <= (temp+k) && (temp+k) < (widthOut*heightOut*depthOut*components)); dataOut[temp + k] = (totals[k]+0.5)/volume; } @@ -7027,7 +7029,7 @@ static void emptyImage3D(const PixelStorageModes *psm, elementSize= bytes_per_element(type); groupSize= elementSize * components; if (elementSize == 1) myswapBytes= 0; - + /* 3dstuff begin */ if (psm->pack_image_height > 0) { rowsPerImage= psm->pack_image_height; @@ -7036,24 +7038,24 @@ static void emptyImage3D(const PixelStorageModes *psm, rowsPerImage= height; } - /* 3dstuff end */ + /* 3dstuff end */ rowSize = groupsPerLine * groupSize; padding = rowSize % psm->pack_alignment; if (padding) { rowSize+= psm->pack_alignment - padding; } - + imageSize= rowsPerImage * rowSize; /* 3dstuff */ start = (GLubyte *)userImage + psm->pack_skip_rows * rowSize + - psm->pack_skip_pixels * groupSize + - /*3dstuff*/ - psm->pack_skip_images * imageSize; + psm->pack_skip_pixels * groupSize + + /*3dstuff*/ + psm->pack_skip_images * imageSize; elementsPerLine= width * components; iter2 = oldImage; - for (dd= 0; dd < depth; dd++) { + for (dd= 0; dd < depth; dd++) { rowStart= start; for (ii= 0; ii< height; ii++) { @@ -7078,22 +7080,22 @@ static void emptyImage3D(const PixelStorageModes *psm, *((GLbyte *) iter) = *iter2++ >> 9; } break; - case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_3_3_2: for (k = 0; k < 3; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove332(shoveComponents,0,(void *)iter); break; case GL_UNSIGNED_BYTE_2_3_3_REV: for (k = 0; k < 3; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove233rev(shoveComponents,0,(void *)iter); - break; - case GL_UNSIGNED_SHORT_5_6_5: + break; + case GL_UNSIGNED_SHORT_5_6_5: for (k = 0; k < 3; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove565(shoveComponents,0,(void *)&widget.us[0]); if (myswapBytes) { iter[0] = widget.ub[1]; @@ -7103,10 +7105,10 @@ static void emptyImage3D(const PixelStorageModes *psm, *(GLushort *)iter = widget.us[0]; } break; - case GL_UNSIGNED_SHORT_5_6_5_REV: + case GL_UNSIGNED_SHORT_5_6_5_REV: for (k = 0; k < 3; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove565rev(shoveComponents,0,(void *)&widget.us[0]); if (myswapBytes) { iter[0] = widget.ub[1]; @@ -7119,7 +7121,7 @@ static void emptyImage3D(const PixelStorageModes *psm, case GL_UNSIGNED_SHORT_4_4_4_4: for (k = 0; k < 4; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove4444(shoveComponents,0,(void *)&widget.us[0]); if (myswapBytes) { iter[0] = widget.ub[1]; @@ -7131,7 +7133,7 @@ static void emptyImage3D(const PixelStorageModes *psm, case GL_UNSIGNED_SHORT_4_4_4_4_REV: for (k = 0; k < 4; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove4444rev(shoveComponents,0,(void *)&widget.us[0]); if (myswapBytes) { iter[0] = widget.ub[1]; @@ -7143,7 +7145,7 @@ static void emptyImage3D(const PixelStorageModes *psm, case GL_UNSIGNED_SHORT_5_5_5_1: for (k = 0; k < 4; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove5551(shoveComponents,0,(void *)&widget.us[0]); if (myswapBytes) { iter[0] = widget.ub[1]; @@ -7155,7 +7157,7 @@ static void emptyImage3D(const PixelStorageModes *psm, case GL_UNSIGNED_SHORT_1_5_5_5_REV: for (k = 0; k < 4; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove1555rev(shoveComponents,0,(void *)&widget.us[0]); if (myswapBytes) { iter[0] = widget.ub[1]; @@ -7186,7 +7188,7 @@ static void emptyImage3D(const PixelStorageModes *psm, case GL_UNSIGNED_INT_8_8_8_8: for (k = 0; k < 4; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove8888(shoveComponents,0,(void *)&widget.ui); if (myswapBytes) { iter[3] = widget.ub[0]; @@ -7200,7 +7202,7 @@ static void emptyImage3D(const PixelStorageModes *psm, case GL_UNSIGNED_INT_8_8_8_8_REV: for (k = 0; k < 4; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove8888rev(shoveComponents,0,(void *)&widget.ui); if (myswapBytes) { iter[3] = widget.ub[0]; @@ -7211,10 +7213,10 @@ static void emptyImage3D(const PixelStorageModes *psm, *(GLuint *)iter= widget.ui; } break; - case GL_UNSIGNED_INT_10_10_10_2: + case GL_UNSIGNED_INT_10_10_10_2: for (k = 0; k < 4; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove1010102(shoveComponents,0,(void *)&widget.ui); if (myswapBytes) { iter[3] = widget.ub[0]; @@ -7225,10 +7227,10 @@ static void emptyImage3D(const PixelStorageModes *psm, *(GLuint *)iter= widget.ui; } break; - case GL_UNSIGNED_INT_2_10_10_10_REV: + case GL_UNSIGNED_INT_2_10_10_10_REV: for (k = 0; k < 4; k++) { shoveComponents[k]= *iter2++ / 65535.0; - } + } shove2101010rev(shoveComponents,0,(void *)&widget.ui); if (myswapBytes) { iter[3] = widget.ub[0]; @@ -7295,16 +7297,16 @@ static void emptyImage3D(const PixelStorageModes *psm, elements_per_group(format,0)]); } assert( iter == &((GLubyte *)userImage)[rowSize*height*depth + - psm->unpack_skip_rows * rowSize + + psm->unpack_skip_rows * rowSize + psm->unpack_skip_pixels * groupSize + /*3dstuff*/ psm->unpack_skip_images * imageSize] ); } /* emptyImage3D() */ -static -int gluScaleImage3D(GLenum format, +static +int gluScaleImage3D(GLenum format, GLint widthIn, GLint heightIn, GLint depthIn, - GLenum typeIn, const void *dataIn, + GLenum typeIn, const void *dataIn, GLint widthOut, GLint heightOut, GLint depthOut, GLenum typeOut, void *dataOut) { @@ -7312,16 +7314,16 @@ int gluScaleImage3D(GLenum format, GLushort *beforeImage, *afterImage; PixelStorageModes psm; - if (widthIn == 0 || heightIn == 0 || depthIn == 0 || + if (widthIn == 0 || heightIn == 0 || depthIn == 0 || widthOut == 0 || heightOut == 0 || depthOut == 0) { return 0; } - if (widthIn < 0 || heightIn < 0 || depthIn < 0 || + if (widthIn < 0 || heightIn < 0 || depthIn < 0 || widthOut < 0 || heightOut < 0 || depthOut < 0) { return GLU_INVALID_VALUE; } - + if (!legalFormat(format) || !legalType(typeIn) || !legalType(typeOut) || typeIn == GL_BITMAP || typeOut == GL_BITMAP) { return GLU_INVALID_ENUM; @@ -7334,12 +7336,12 @@ int gluScaleImage3D(GLenum format, } beforeImage = malloc(imageSize3D(widthIn, heightIn, depthIn, format, - GL_UNSIGNED_SHORT)); - afterImage = malloc(imageSize3D(widthOut, heightOut, depthOut, format, + GL_UNSIGNED_SHORT)); + afterImage = malloc(imageSize3D(widthOut, heightOut, depthOut, format, GL_UNSIGNED_SHORT)); if (beforeImage == NULL || afterImage == NULL) { return GLU_OUT_OF_MEMORY; - } + } retrieveStoreModes3D(&psm); fillImage3D(&psm,widthIn,heightIn,depthIn,format,typeIn, is_index(format), @@ -7357,11 +7359,11 @@ int gluScaleImage3D(GLenum format, static void closestFit3D(GLenum target, GLint width, GLint height, GLint depth, - GLint internalFormat, GLenum format, GLenum type, + GLint internalFormat, GLenum format, GLenum type, GLint *newWidth, GLint *newHeight, GLint *newDepth) { GLint widthPowerOf2= nearestPower(width); - GLint heightPowerOf2= nearestPower(height); + GLint heightPowerOf2= nearestPower(height); GLint depthPowerOf2= nearestPower(depth); GLint proxyWidth; @@ -7369,15 +7371,15 @@ static void closestFit3D(GLenum target, GLint width, GLint height, GLint depth, /* compute level 1 width & height & depth, clamping each at 1 */ GLint widthAtLevelOne= (widthPowerOf2 > 1) ? widthPowerOf2 >> 1 : - widthPowerOf2; + widthPowerOf2; GLint heightAtLevelOne= (heightPowerOf2 > 1) ? heightPowerOf2 >> 1 : - heightPowerOf2; + heightPowerOf2; GLint depthAtLevelOne= (depthPowerOf2 > 1) ? depthPowerOf2 >> 1 : - depthPowerOf2; + depthPowerOf2; GLenum proxyTarget; - assert(widthAtLevelOne > 0); + assert(widthAtLevelOne > 0); assert(heightAtLevelOne > 0); assert(depthAtLevelOne > 0); @@ -7400,7 +7402,7 @@ static void closestFit3D(GLenum target, GLint width, GLint height, GLint depth, widthPowerOf2= widthAtLevelOne; heightPowerOf2= heightAtLevelOne; depthPowerOf2= depthAtLevelOne; - } + } /* else it does fit */ } while (proxyWidth == 0); /* loop must terminate! */ @@ -7419,8 +7421,8 @@ static void halveImagePackedPixelSlice(int components, (const GLfloat [],int, void *), GLint width, GLint height, GLint depth, const void *dataIn, void *dataOut, - GLint pixelSizeInBytes, - GLint rowSizeInBytes, + GLint pixelSizeInBytes, + GLint rowSizeInBytes, GLint imageSizeInBytes, GLint isSwap) { @@ -7458,7 +7460,7 @@ static void halveImagePackedPixelSlice(int components, } totals[cc]/= (float)BOX2; } /* for cc */ - + (*shovePackedPixel)(totals,outIndex,dataOut); outIndex++; /* skip over to next group of 2 */ @@ -7471,7 +7473,7 @@ static void halveImagePackedPixelSlice(int components, for (ii= 0; ii< halfDepth; ii++) { for (jj= 0; jj< halfWidth; jj++) { float totals[4]; - float extractTotals[BOX4][4]; + float extractTotals[BOX4][4]; int cc; (*extractPackedPixel)(isSwap,src, @@ -7484,12 +7486,12 @@ static void halveImagePackedPixelSlice(int components, (src+imageSizeInBytes+pixelSizeInBytes), &extractTotals[3][0]); for (cc = 0; cc < components; cc++) { - int kk; + int kk; /* grab 4 pixels to average */ totals[cc]= 0.0; /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ - * extractTotals[2][RED]+extractTotals[3][RED]; + * extractTotals[2][RED]+extractTotals[3][RED]; * totals[RED]/= 4.0; */ for (kk = 0; kk < BOX4; kk++) { @@ -7531,7 +7533,7 @@ static void halveImagePackedPixelSlice(int components, /* grab 4 pixels to average */ totals[cc]= 0.0; /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ - * extractTotals[2][RED]+extractTotals[3][RED]; + * extractTotals[2][RED]+extractTotals[3][RED]; * totals[RED]/= 4.0; */ for (kk = 0; kk < BOX4; kk++) { @@ -7546,7 +7548,7 @@ static void halveImagePackedPixelSlice(int components, /* skip over to next vertical square of 4 */ src+= imageSizeInBytes + imageSizeInBytes; } - } + } /* assert() */ } @@ -7559,8 +7561,8 @@ static void halveImagePackedPixel3D(int components, (const GLfloat [],int, void *), GLint width, GLint height, GLint depth, const void *dataIn, void *dataOut, - GLint pixelSizeInBytes, - GLint rowSizeInBytes, + GLint pixelSizeInBytes, + GLint rowSizeInBytes, GLint imageSizeInBytes, GLint isSwap) { @@ -7573,13 +7575,13 @@ static void halveImagePackedPixel3D(int components, return; } /* a horizontal or vertical slice viewed from top */ - else if (width == 1 || height == 1) { + else if (width == 1 || height == 1) { assert(1 <= depth); halveImagePackedPixelSlice(components, extractPackedPixel,shovePackedPixel, width, height, depth, dataIn, dataOut, - pixelSizeInBytes, rowSizeInBytes, + pixelSizeInBytes, rowSizeInBytes, imageSizeInBytes, isSwap); return; } @@ -7588,7 +7590,7 @@ static void halveImagePackedPixel3D(int components, int halfWidth= width / 2; int halfHeight= height / 2; - int halfDepth= depth / 2; + int halfDepth= depth / 2; const char *src= (const char *) dataIn; int padBytes= rowSizeInBytes - (width*pixelSizeInBytes); int outIndex= 0; @@ -7597,7 +7599,7 @@ static void halveImagePackedPixel3D(int components, for (ii= 0; ii< halfHeight; ii++) { for (jj= 0; jj< halfWidth; jj++) { #define BOX8 8 - float totals[4]; /* 4 is maximum components */ + float totals[4]; /* 4 is maximum components */ float extractTotals[BOX8][4]; /* 4 is maximum components */ int cc; @@ -7620,15 +7622,15 @@ static void halveImagePackedPixel3D(int components, (*extractPackedPixel)(isSwap, (src+rowSizeInBytes+pixelSizeInBytes+imageSizeInBytes), &extractTotals[7][0]); - for (cc = 0; cc < components; cc++) { + for (cc = 0; cc < components; cc++) { int kk; /* grab 8 pixels to average */ totals[cc]= 0.0; /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ - * extractTotals[2][RED]+extractTotals[3][RED]+ - * extractTotals[4][RED]+extractTotals[5][RED]+ - * extractTotals[6][RED]+extractTotals[7][RED]; + * extractTotals[2][RED]+extractTotals[3][RED]+ + * extractTotals[4][RED]+extractTotals[5][RED]+ + * extractTotals[6][RED]+extractTotals[7][RED]; * totals[RED]/= 8.0; */ for (kk = 0; kk < BOX8; kk++) { @@ -7647,18 +7649,18 @@ static void halveImagePackedPixel3D(int components, /* src is at beginning of a row here, but it's the second row of * the square block of 4 pixels that we just worked on so we - * need to go one more row. - * i.e., - * OO... - * here -->OO... - * but want -->OO... - * OO... - * ... + * need to go one more row. + * i.e., + * OO... + * here -->OO... + * but want -->OO... + * OO... + * ... */ src+= rowSizeInBytes; } - src+= imageSizeInBytes; + src+= imageSizeInBytes; } /* for dd */ /* both pointers must reach one byte after the end */ @@ -7668,14 +7670,14 @@ static void halveImagePackedPixel3D(int components, } /* halveImagePackedPixel3D() */ -static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, - GLsizei width, - GLsizei height, +static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, + GLsizei width, + GLsizei height, GLsizei depth, - GLsizei widthPowerOf2, - GLsizei heightPowerOf2, + GLsizei widthPowerOf2, + GLsizei heightPowerOf2, GLsizei depthPowerOf2, - GLenum format, GLenum type, + GLenum format, GLenum type, GLint userLevel, GLint baseLevel,GLint maxLevel, const void *data) @@ -7724,8 +7726,8 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, if (elementSize == 1) myswapBytes = 0; /* 3dstuff begin */ - if (psm.unpack_image_height > 0) { - rowsPerImage= psm.unpack_image_height; + if (psm.unpack_image_height > 0) { + rowsPerImage= psm.unpack_image_height; } else { rowsPerImage= height; @@ -7740,10 +7742,10 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, imageSize= rowsPerImage * rowSize; /* 3dstuff */ - usersImage = (const GLubyte *)data + psm.unpack_skip_rows * rowSize + + usersImage = (const GLubyte *)data + psm.unpack_skip_rows * rowSize + psm.unpack_skip_pixels * groupSize + /* 3dstuff */ - psm.unpack_skip_images * imageSize; + psm.unpack_skip_images * imageSize; glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); @@ -7756,7 +7758,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, if (width == newWidth && height == newHeight && depth == newDepth) { /* Use usersImage for level userLevel */ if (baseLevel <= level && level <= maxLevel) { - gluTexImage3D(target, level, internalFormat, width, + gluTexImage3D(target, level, internalFormat, width, height, depth, 0, format, type, usersImage); } @@ -7778,7 +7780,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, /* clamp to 1 */ if (nextWidth < 1) nextWidth= 1; if (nextHeight < 1) nextHeight= 1; - if (nextDepth < 1) nextDepth= 1; + if (nextDepth < 1) nextDepth= 1; memReq = imageSize3D(nextWidth, nextHeight, nextDepth, format, type); } switch(type) { @@ -7803,8 +7805,8 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, case GL_FLOAT: dstImage = (GLfloat *)malloc(memReq); break; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: + case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_2_3_3_REV: dstImage = (GLubyte *)malloc(memReq); break; case GL_UNSIGNED_SHORT_5_6_5: @@ -7819,7 +7821,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, case GL_UNSIGNED_INT_8_8_8_8_REV: case GL_UNSIGNED_INT_10_10_10_2: case GL_UNSIGNED_INT_2_10_10_10_REV: - dstImage = (GLuint *)malloc(memReq); + dstImage = (GLuint *)malloc(memReq); break; default: return GLU_INVALID_ENUM; /* assertion */ @@ -7873,7 +7875,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, } break; case GL_SHORT: - if (depth > 1) { + if (depth > 1) { halveImage3D(cmpts,extractSshort,shoveSshort, width,height,depth, usersImage,dstImage,elementSize,groupSize,rowSize, @@ -7885,7 +7887,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, } break; case GL_UNSIGNED_INT: - if (depth > 1) { + if (depth > 1) { halveImage3D(cmpts,extractUint,shoveUint, width,height,depth, usersImage,dstImage,elementSize,groupSize,rowSize, @@ -7897,7 +7899,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, } break; case GL_INT: - if (depth > 1) { + if (depth > 1) { halveImage3D(cmpts,extractSint,shoveSint, width,height,depth, usersImage,dstImage,elementSize,groupSize,rowSize, @@ -7920,7 +7922,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, elementSize,rowSize,groupSize,myswapBytes); } break; - case GL_UNSIGNED_BYTE_3_3_2: + case GL_UNSIGNED_BYTE_3_3_2: assert(format == GL_RGB); halveImagePackedPixel3D(3,extract332,shove332, width,height,depth,usersImage,dstImage, @@ -7946,42 +7948,42 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, halveImagePackedPixel3D(4,extract4444,shove4444, width,height,depth,usersImage,dstImage, elementSize,rowSize,imageSize,myswapBytes); - break; + break; case GL_UNSIGNED_SHORT_4_4_4_4_REV: halveImagePackedPixel3D(4,extract4444rev,shove4444rev, width,height,depth,usersImage,dstImage, elementSize,rowSize,imageSize,myswapBytes); - break; + break; case GL_UNSIGNED_SHORT_5_5_5_1: halveImagePackedPixel3D(4,extract5551,shove5551, width,height,depth,usersImage,dstImage, elementSize,rowSize,imageSize,myswapBytes); - break; + break; case GL_UNSIGNED_SHORT_1_5_5_5_REV: halveImagePackedPixel3D(4,extract1555rev,shove1555rev, width,height,depth,usersImage,dstImage, elementSize,rowSize,imageSize,myswapBytes); - break; + break; case GL_UNSIGNED_INT_8_8_8_8: halveImagePackedPixel3D(4,extract8888,shove8888, width,height,depth,usersImage,dstImage, elementSize,rowSize,imageSize,myswapBytes); - break; + break; case GL_UNSIGNED_INT_8_8_8_8_REV: halveImagePackedPixel3D(4,extract8888rev,shove8888rev, width,height,depth,usersImage,dstImage, elementSize,rowSize,imageSize,myswapBytes); - break; + break; case GL_UNSIGNED_INT_10_10_10_2: halveImagePackedPixel3D(4,extract1010102,shove1010102, width,height,depth,usersImage,dstImage, elementSize,rowSize,imageSize,myswapBytes); - break; + break; case GL_UNSIGNED_INT_2_10_10_10_REV: halveImagePackedPixel3D(4,extract2101010rev,shove2101010rev, width,height,depth,usersImage,dstImage, elementSize,rowSize,imageSize,myswapBytes); - break; + break; default: assert(0); break; @@ -7991,7 +7993,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, newDepth = depth/2; /* clamp to 1 */ if (newWidth < 1) newWidth= 1; - if (newHeight < 1) newHeight= 1; + if (newHeight < 1) newHeight= 1; if (newDepth < 1) newDepth= 1; myswapBytes = 0; @@ -8054,7 +8056,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, return GLU_OUT_OF_MEMORY; } /* level userLevel+1 is in srcImage; level userLevel already saved */ - level = userLevel+1; + level = userLevel+1; } else {/* user's image is *not* nice power-of-2 sized square */ memReq = imageSize3D(newWidth, newHeight, newDepth, format, type); switch(type) { @@ -8098,7 +8100,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, dstImage = (GLuint *)malloc(memReq); break; default: - return GLU_INVALID_ENUM; /* assertion */ + return GLU_INVALID_ENUM; /* assertion */ } if (dstImage == NULL) { @@ -8129,8 +8131,8 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, int nextHeight= newHeight/2; int nextDepth= newDepth/2; if (nextWidth < 1) nextWidth= 1; - if (nextHeight < 1) nextHeight= 1; - if (nextDepth < 1) nextDepth= 1; + if (nextHeight < 1) nextHeight= 1; + if (nextDepth < 1) nextDepth= 1; memReq = imageSize3D(nextWidth, nextHeight, nextDepth, format, type); } @@ -8189,7 +8191,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, } } /* level userLevel is in srcImage; nothing saved yet */ - level = userLevel; + level = userLevel; } glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); @@ -8225,7 +8227,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, } break; case GL_UNSIGNED_SHORT: - if (newDepth > 1) { + if (newDepth > 1) { halveImage3D(cmpts,extractUshort,shoveUshort, newWidth,newHeight,newDepth, srcImage,dstImage,elementSize,groupSize,rowSize, @@ -8320,13 +8322,13 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, srcImage,dstImage,elementSize,rowSize, imageSize,myswapBytes); break; - case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_5_5_5_1: halveImagePackedPixel3D(4,extract5551,shove5551, newWidth,newHeight,newDepth, srcImage,dstImage,elementSize,rowSize, imageSize,myswapBytes); break; - case GL_UNSIGNED_SHORT_1_5_5_5_REV: + case GL_UNSIGNED_SHORT_1_5_5_5_REV: halveImagePackedPixel3D(4,extract1555rev,shove1555rev, newWidth,newHeight,newDepth, srcImage,dstImage,elementSize,rowSize, @@ -8390,9 +8392,9 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, } /* gluBuild3DMipmapLevelsCore() */ GLint GLAPIENTRY -gluBuild3DMipmapLevels(GLenum target, GLint internalFormat, +gluBuild3DMipmapLevels(GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, + GLenum format, GLenum type, GLint userLevel, GLint baseLevel, GLint maxLevel, const void *data) { @@ -8416,19 +8418,19 @@ gluBuild3DMipmapLevels(GLenum target, GLint internalFormat, if (level > levels) levels=level; levels+= userLevel; - if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels)) + if (!isLegalLevels(userLevel,baseLevel,maxLevel,levels)) return GLU_INVALID_VALUE; - return gluBuild3DMipmapLevelsCore(target, internalFormat, + return gluBuild3DMipmapLevelsCore(target, internalFormat, width, height, depth, width, height, depth, - format, type, + format, type, userLevel, baseLevel, maxLevel, data); } /* gluBuild3DMipmapLevels() */ GLint GLAPIENTRY -gluBuild3DMipmaps(GLenum target, GLint internalFormat, +gluBuild3DMipmaps(GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data) { @@ -8455,9 +8457,9 @@ gluBuild3DMipmaps(GLenum target, GLint internalFormat, level = computeLog(depthPowerOf2); if (level > levels) levels=level; - return gluBuild3DMipmapLevelsCore(target, internalFormat, + return gluBuild3DMipmapLevelsCore(target, internalFormat, width, height, depth, - widthPowerOf2, heightPowerOf2, + widthPowerOf2, heightPowerOf2, depthPowerOf2, format, type, 0, 0, levels, data); @@ -8504,7 +8506,7 @@ static GLdouble extractUshort(int isSwap, const void *uitem) ushort= *(const GLushort *)uitem; } - assert(ushort <= 65535); + assert(ushort <= 65535); return (GLdouble)ushort; } /* extractUshort() */ @@ -8527,7 +8529,7 @@ static GLdouble extractSshort(int isSwap, const void *sitem) sshort= *(const GLshort *)sitem; } - assert(sshort <= 32767); + assert(sshort <= 32767); return (GLdouble)sshort; } /* extractSshort() */ @@ -8550,14 +8552,14 @@ static GLdouble extractUint(int isSwap, const void *uitem) uint= *(const GLuint *)uitem; } - assert(uint <= 0xffffffff); + assert(uint <= 0xffffffff); return (GLdouble)uint; } /* extractUint() */ static void shoveUint(GLdouble value, int index, void *data) { - assert(0.0 <= value && value <= (GLdouble) UINT_MAX); + assert(0.0 <= value && value <= (GLdouble) UINT_MAX); ((GLuint *)data)[index]= (GLuint)value; } /* shoveUint() */ @@ -8573,14 +8575,14 @@ static GLdouble extractSint(int isSwap, const void *sitem) sint= *(const GLint *)sitem; } - assert(sint <= 0x7fffffff); + assert(sint <= 0x7fffffff); return (GLdouble)sint; } /* extractSint() */ static void shoveSint(GLdouble value, int index, void *data) { - assert(0.0 <= value && value <= (GLdouble) INT_MAX); + assert(0.0 <= value && value <= (GLdouble) INT_MAX); ((GLint *)data)[index]= (GLint)value; } /* shoveSint() */ @@ -8596,7 +8598,7 @@ static GLdouble extractFloat(int isSwap, const void *item) ffloat= *(const GLfloat *)item; } - assert(ffloat <= 1.0); + assert(ffloat <= 1.0); return (GLdouble)ffloat; } /* extractFloat() */ @@ -8614,8 +8616,8 @@ static void halveImageSlice(int components, GLint width, GLint height, GLint depth, const void *dataIn, void *dataOut, GLint elementSizeInBytes, - GLint groupSizeInBytes, - GLint rowSizeInBytes, + GLint groupSizeInBytes, + GLint rowSizeInBytes, GLint imageSizeInBytes, GLint isSwap) { @@ -8678,7 +8680,7 @@ static void halveImageSlice(int components, for (cc = 0; cc < components; cc++) { int kk; double totals[4]; - double extractTotals[BOX4][4]; + double extractTotals[BOX4][4]; extractTotals[0][cc]=(*extract)(isSwap,src); extractTotals[1][cc]=(*extract)(isSwap, @@ -8691,7 +8693,7 @@ static void halveImageSlice(int components, /* grab 4 pixels to average */ totals[cc]= 0.0; /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ - * extractTotals[2][RED]+extractTotals[3][RED]; + * extractTotals[2][RED]+extractTotals[3][RED]; * totals[RED]/= 4.0; */ for (kk = 0; kk < BOX4; kk++) { @@ -8703,7 +8705,7 @@ static void halveImageSlice(int components, outIndex++; src+= elementSizeInBytes; - } /* for cc */ + } /* for cc */ /* skip over to next horizontal square of 4 */ src+= groupSizeInBytes; @@ -8715,7 +8717,7 @@ static void halveImageSlice(int components, assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]); assert(outIndex == halfWidth * halfDepth * components); - } + } else if (width == 1) { /* vertical slice viewed from top */ /* printf("vertical slice\n"); */ assert(height != 1); @@ -8740,7 +8742,7 @@ static void halveImageSlice(int components, /* grab 4 pixels to average */ totals[cc]= 0.0; /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ - * extractTotals[2][RED]+extractTotals[3][RED]; + * extractTotals[2][RED]+extractTotals[3][RED]; * totals[RED]/= 4.0; */ for (kk = 0; kk < BOX4; kk++) { @@ -8760,7 +8762,7 @@ static void halveImageSlice(int components, } /* for jj */ src+= imageSizeInBytes; - } /* for ii */ + } /* for ii */ assert(src == &((const char *)dataIn)[rowSizeInBytes*height*depth]); assert(outIndex == halfHeight * halfDepth * components); @@ -8774,19 +8776,19 @@ static void halveImage3D(int components, GLint width, GLint height, GLint depth, const void *dataIn, void *dataOut, GLint elementSizeInBytes, - GLint groupSizeInBytes, - GLint rowSizeInBytes, + GLint groupSizeInBytes, + GLint rowSizeInBytes, GLint imageSizeInBytes, GLint isSwap) { - assert(depth > 1); + assert(depth > 1); /* a horizontal/vertical/one-column slice viewed from top */ - if (width == 1 || height == 1) { + if (width == 1 || height == 1) { assert(1 <= depth); - halveImageSlice(components,extract,shove, width, height, depth, - dataIn, dataOut, elementSizeInBytes, groupSizeInBytes, + halveImageSlice(components,extract,shove, width, height, depth, + dataIn, dataOut, elementSizeInBytes, groupSizeInBytes, rowSizeInBytes, imageSizeInBytes, isSwap); return; } @@ -8795,7 +8797,7 @@ static void halveImage3D(int components, int halfWidth= width / 2; int halfHeight= height / 2; - int halfDepth= depth / 2; + int halfDepth= depth / 2; const char *src= (const char *) dataIn; int padBytes= rowSizeInBytes - (width*groupSizeInBytes); int outIndex= 0; @@ -8832,9 +8834,9 @@ static void halveImage3D(int components, totals[cc]= 0.0; /* totals[RED]= extractTotals[0][RED]+extractTotals[1][RED]+ - * extractTotals[2][RED]+extractTotals[3][RED]+ - * extractTotals[4][RED]+extractTotals[5][RED]+ - * extractTotals[6][RED]+extractTotals[7][RED]; + * extractTotals[2][RED]+extractTotals[3][RED]+ + * extractTotals[4][RED]+extractTotals[5][RED]+ + * extractTotals[6][RED]+extractTotals[7][RED]; * totals[RED]/= 8.0; */ for (kk = 0; kk < BOX8; kk++) { @@ -8857,18 +8859,18 @@ static void halveImage3D(int components, /* src is at beginning of a row here, but it's the second row of * the square block of 4 pixels that we just worked on so we - * need to go one more row. - * i.e., - * OO... - * here -->OO... - * but want -->OO... - * OO... - * ... + * need to go one more row. + * i.e., + * OO... + * here -->OO... + * but want -->OO... + * OO... + * ... */ src+= rowSizeInBytes; } /* for ii */ - src+= imageSizeInBytes; + src+= imageSizeInBytes; } /* for dd */ /* both pointers must reach one byte after the end */ diff --git a/src/glu/sgi/libutil/quad.c b/src/glu/sgi/libutil/quad.c index 57e3f2636fb..1939b0f7d05 100644 --- a/src/glu/sgi/libutil/quad.c +++ b/src/glu/sgi/libutil/quad.c @@ -6,21 +6,21 @@ ** this file except in compliance with the License. You may obtain a copy ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** +** ** http://oss.sgi.com/projects/FreeB -** +** ** Note that, as provided in the License, the Software is distributed on an ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** +** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. -** +** ** Additional Notice Provisions: The application programming interfaces ** established by SGI in conjunction with the Original Code are The ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released @@ -31,8 +31,8 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2002/11/01 23:45:31 $ $Revision: 1.3 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libutil/quad.c,v 1.3 2002/11/01 23:45:31 brianp Exp $ +** $Date: 2003/10/14 23:48:58 $ $Revision: 1.4 $ +** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libutil/quad.c,v 1.4 2003/10/14 23:48:58 kendallb Exp $ */ #include "gluos.h" @@ -46,10 +46,11 @@ /* Make it not a power of two to avoid cache thrashing on the chip */ #define CACHE_SIZE 240 -#define PI 3.14159265358979323846 +#undef PI +#define PI 3.14159265358979323846 struct GLUquadric { - GLint normals; + GLint normals; GLboolean textureCoords; GLint orientation; GLint drawStyle; @@ -70,7 +71,7 @@ gluNewQuadric(void) newstate->textureCoords = GL_FALSE; newstate->orientation = GLU_OUTSIDE; newstate->drawStyle = GLU_FILL; - newstate->errorCallback = NULL; + newstate->errorCallback = NULL; return newstate; } @@ -153,7 +154,7 @@ gluQuadricDrawStyle(GLUquadric *qobj, GLenum drawStyle) } void GLAPIENTRY -gluCylinder(GLUquadric *qobj, GLdouble baseRadius, GLdouble topRadius, +gluCylinder(GLUquadric *qobj, GLdouble baseRadius, GLdouble topRadius, GLdouble height, GLint slices, GLint stacks) { GLint i,j; @@ -219,7 +220,7 @@ gluCylinder(GLUquadric *qobj, GLdouble baseRadius, GLdouble topRadius, sinCache2[i] = -xyNormalRatio * SIN(angle); cosCache2[i] = -xyNormalRatio * COS(angle); } - } + } sinCache[i] = SIN(angle); cosCache[i] = COS(angle); } @@ -235,7 +236,7 @@ gluCylinder(GLUquadric *qobj, GLdouble baseRadius, GLdouble topRadius, cosCache3[i] = -xyNormalRatio * COS(angle); } } - } + } sinCache[slices] = sinCache[0]; cosCache[slices] = cosCache[0]; @@ -252,8 +253,8 @@ gluCylinder(GLUquadric *qobj, GLdouble baseRadius, GLdouble topRadius, case GLU_FILL: /* Note: ** An argument could be made for using a TRIANGLE_FAN for the end - ** of the cylinder of either radii is 0.0 (a cone). However, a - ** TRIANGLE_FAN would not work in smooth shading mode (the common + ** of the cylinder of either radii is 0.0 (a cone). However, a + ** TRIANGLE_FAN would not work in smooth shading mode (the common ** case) because the normal for the apex is different for every ** triangle (and TRIANGLE_FAN doesn't let me respecify that normal). ** Now, my choice is GL_TRIANGLES, or leave the GL_QUAD_STRIP and @@ -285,26 +286,26 @@ gluCylinder(GLUquadric *qobj, GLdouble baseRadius, GLdouble topRadius, glTexCoord2f(1 - (float) i / slices, (float) j / stacks); } - glVertex3f(radiusLow * sinCache[i], + glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], zLow); if (qobj->textureCoords) { glTexCoord2f(1 - (float) i / slices, (float) (j+1) / stacks); } - glVertex3f(radiusHigh * sinCache[i], + glVertex3f(radiusHigh * sinCache[i], radiusHigh * cosCache[i], zHigh); } else { if (qobj->textureCoords) { glTexCoord2f(1 - (float) i / slices, (float) (j+1) / stacks); } - glVertex3f(radiusHigh * sinCache[i], + glVertex3f(radiusHigh * sinCache[i], radiusHigh * cosCache[i], zHigh); if (qobj->textureCoords) { glTexCoord2f(1 - (float) i / slices, (float) j / stacks); } - glVertex3f(radiusLow * sinCache[i], + glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], zLow); } } @@ -333,7 +334,7 @@ gluCylinder(GLUquadric *qobj, GLdouble baseRadius, GLdouble topRadius, glTexCoord2f(1 - (float) i / slices, (float) j / stacks); } - glVertex3f(radiusLow * sintemp, + glVertex3f(radiusLow * sintemp, radiusLow * costemp, zLow); } } @@ -361,7 +362,7 @@ gluCylinder(GLUquadric *qobj, GLdouble baseRadius, GLdouble topRadius, glTexCoord2f(1 - (float) i / slices, (float) j / stacks); } - glVertex3f(radiusLow * sinCache[i], + glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], zLow); } glEnd(); @@ -389,7 +390,7 @@ gluCylinder(GLUquadric *qobj, GLdouble baseRadius, GLdouble topRadius, glTexCoord2f(1 - (float) i / slices, (float) j / stacks); } - glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], + glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], zLow); } glEnd(); @@ -415,7 +416,7 @@ gluCylinder(GLUquadric *qobj, GLdouble baseRadius, GLdouble topRadius, glTexCoord2f(1 - (float) i / slices, (float) j / stacks); } - glVertex3f(radiusLow * sintemp, + glVertex3f(radiusLow * sintemp, radiusLow * costemp, zLow); } glEnd(); @@ -427,14 +428,14 @@ gluCylinder(GLUquadric *qobj, GLdouble baseRadius, GLdouble topRadius, } void GLAPIENTRY -gluDisk(GLUquadric *qobj, GLdouble innerRadius, GLdouble outerRadius, +gluDisk(GLUquadric *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops) { gluPartialDisk(qobj, innerRadius, outerRadius, slices, loops, 0.0, 360.0); } void GLAPIENTRY -gluPartialDisk(GLUquadric *qobj, GLdouble innerRadius, +gluPartialDisk(GLUquadric *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops, GLdouble startAngle, GLdouble sweepAngle) { @@ -511,7 +512,7 @@ gluPartialDisk(GLUquadric *qobj, GLdouble innerRadius, glTexCoord2f(0.5, 0.5); } glVertex3f(0.0, 0.0, 0.0); - radiusLow = outerRadius - + radiusLow = outerRadius - deltaRadius * ((float) (loops-1) / loops); if (qobj->textureCoords) { texLow = radiusLow / outerRadius / 2; @@ -523,7 +524,7 @@ gluPartialDisk(GLUquadric *qobj, GLdouble innerRadius, glTexCoord2f(texLow * sinCache[i] + 0.5, texLow * cosCache[i] + 0.5); } - glVertex3f(radiusLow * sinCache[i], + glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0); } } else { @@ -532,7 +533,7 @@ gluPartialDisk(GLUquadric *qobj, GLdouble innerRadius, glTexCoord2f(texLow * sinCache[i] + 0.5, texLow * cosCache[i] + 0.5); } - glVertex3f(radiusLow * sinCache[i], + glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0); } } @@ -555,28 +556,28 @@ gluPartialDisk(GLUquadric *qobj, GLdouble innerRadius, glTexCoord2f(texLow * sinCache[i] + 0.5, texLow * cosCache[i] + 0.5); } - glVertex3f(radiusLow * sinCache[i], + glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0); if (qobj->textureCoords) { glTexCoord2f(texHigh * sinCache[i] + 0.5, texHigh * cosCache[i] + 0.5); } - glVertex3f(radiusHigh * sinCache[i], + glVertex3f(radiusHigh * sinCache[i], radiusHigh * cosCache[i], 0.0); } else { if (qobj->textureCoords) { glTexCoord2f(texHigh * sinCache[i] + 0.5, texHigh * cosCache[i] + 0.5); } - glVertex3f(radiusHigh * sinCache[i], + glVertex3f(radiusHigh * sinCache[i], radiusHigh * cosCache[i], 0.0); if (qobj->textureCoords) { glTexCoord2f(texLow * sinCache[i] + 0.5, texLow * cosCache[i] + 0.5); } - glVertex3f(radiusLow * sinCache[i], + glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0); } } @@ -629,7 +630,7 @@ gluPartialDisk(GLUquadric *qobj, GLdouble innerRadius, glTexCoord2f(texLow * sinCache[i] + 0.5, texLow * cosCache[i] + 0.5); } - glVertex3f(radiusLow * sinCache[i], + glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0); } glEnd(); @@ -684,7 +685,7 @@ gluPartialDisk(GLUquadric *qobj, GLdouble innerRadius, glTexCoord2f(texLow * sinCache[i] + 0.5, texLow * cosCache[i] + 0.5); } - glVertex3f(radiusLow * sinCache[i], + glVertex3f(radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0); } glEnd(); @@ -788,7 +789,7 @@ gluSphere(GLUquadric *qobj, GLdouble radius, GLint slices, GLint stacks) cosCache3b[j] = -COS(angle); } } - } + } sinCache1a[slices] = sinCache1a[0]; cosCache1a[slices] = cosCache1a[0]; @@ -969,7 +970,7 @@ gluSphere(GLUquadric *qobj, GLdouble radius, GLint slices, GLint stacks) } break; default: - break; + break; } glBegin(GL_QUAD_STRIP); @@ -1046,7 +1047,7 @@ gluSphere(GLUquadric *qobj, GLdouble radius, GLint slices, GLint stacks) costemp2 = cosCache2b[j]; break; default: - break; + break; } for (i = 0; i < slices; i++) { switch(qobj->normals) { @@ -1067,7 +1068,7 @@ gluSphere(GLUquadric *qobj, GLdouble radius, GLint slices, GLint stacks) glTexCoord2f(1 - (float) i / slices, 1 - (float) j / stacks); } - glVertex3f(sintemp1 * sinCache1a[i], + glVertex3f(sintemp1 * sinCache1a[i], sintemp1 * cosCache1a[i], costemp1); } } @@ -1109,7 +1110,7 @@ gluSphere(GLUquadric *qobj, GLdouble radius, GLint slices, GLint stacks) glTexCoord2f(1 - (float) i / slices, 1 - (float) j / stacks); } - glVertex3f(sintemp1 * sinCache1a[i], + glVertex3f(sintemp1 * sinCache1a[i], sintemp1 * cosCache1a[i], costemp1); } glEnd(); @@ -1149,7 +1150,7 @@ gluSphere(GLUquadric *qobj, GLdouble radius, GLint slices, GLint stacks) glTexCoord2f(1 - (float) i / slices, 1 - (float) j / stacks); } - glVertex3f(sintemp1 * sinCache1b[j], + glVertex3f(sintemp1 * sinCache1b[j], costemp1 * sinCache1b[j], cosCache1b[j]); } glEnd(); -- cgit v1.2.3 From 3fc0db95e4b44fab108fd0495933f0d83c9b6336 Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Thu, 16 Oct 2003 04:50:42 +0000 Subject: Minor changes to make linux-solo build again --- include/GL/glu.h | 4 ++ src/mesa/Makefile.X11 | 2 + src/mesa/drivers/dri/gamma/Makefile.X11 | 119 +++++++++++++++++++++++++++++++ src/mesa/drivers/dri/gamma/gamma_xmesa.c | 2 +- src/mesa/drivers/dri/i810/i810screen.c | 17 ++--- src/mesa/drivers/dri/i830/i830_screen.c | 18 ++--- 6 files changed, 144 insertions(+), 18 deletions(-) create mode 100644 src/mesa/drivers/dri/gamma/Makefile.X11 (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index 719feb1aed0..129777852f2 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -40,6 +40,10 @@ #define GLAPIENTRY #endif +#ifndef GLAPIENTRYP +#define GLAPIENTRYP +#endif + #ifndef GLAPI #define GLAPI #endif diff --git a/src/mesa/Makefile.X11 b/src/mesa/Makefile.X11 index 72e1499392a..dd4336e6d02 100644 --- a/src/mesa/Makefile.X11 +++ b/src/mesa/Makefile.X11 @@ -237,11 +237,13 @@ CORE_SOURCES = \ # This will probably get set to $(X86_SOURCES) in Make-config: ASM_SOURCES = +ifndef SOLO # This should get set in Make-config someday: DRIVER_SOURCES = \ $(X11_DRIVER_SOURCES) \ $(GLIDE_DRIVER_SOURCES) \ $(SVGA_DRIVER_SOURCES) +endif ### Object files diff --git a/src/mesa/drivers/dri/gamma/Makefile.X11 b/src/mesa/drivers/dri/gamma/Makefile.X11 new file mode 100644 index 00000000000..be0daceae72 --- /dev/null +++ b/src/mesa/drivers/dri/gamma/Makefile.X11 @@ -0,0 +1,119 @@ +# $Id: Makefile.X11,v 1.1 2003/10/16 04:50:42 jonsmirl Exp $ + +# Mesa 3-D graphics library +# Version: 5.0 +# Copyright (C) 1995-2002 Brian Paul + +TOP = ../../../../.. + +default: linux-solo + +SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver +MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini + +DEFINES += \ + -D_HAVE_SWRAST=1 \ + -D_HAVE_SWTNL=1 \ + -D_HAVE_SANITY=1 \ + -D_HAVE_CODEGEN=1 \ + -D_HAVE_LIGHTING=1 \ + -D_HAVE_TEXGEN=1 \ + -D_HAVE_USERCLIP=1 \ + -DGLX_DIRECT_RENDERING + +# Not yet +# MINIGLX_SOURCES = server/i810_dri.c + +DRIVER_SOURCES = \ + gamma_context.c \ + gamma_dd.c \ + gamma_inithw.c \ + gamma_lock.c \ + gamma_render.c \ + gamma_screen.c \ + gamma_span.c \ + gamma_state.c \ + gamma_tex.c \ + gamma_texmem.c \ + gamma_texstate.c \ + gamma_tris.c \ + gamma_vb.c \ + gamma_xmesa.c \ + ../common/mm.c \ + ../common/utils.c \ + ../common/texmem.c \ + ../common/vblank.c + +INCLUDES = $(MINIGLX_INCLUDES) \ + $(SHARED_INCLUDES) + + +C_SOURCES = $(DRIVER_SOURCES) \ + $(MINIGLX_SOURCES) + +MESA_MODULES = $(TOP)/src/mesa/mesa.a + + +ifeq ($(WINDOW_SYSTEM),dri) +WINOBJ=$(MESABUILDDIR)/dri/dri.a +WINLIB= +else +WINOBJ= +WINLIB=-L$(MESA)/src/glx/mini +endif + +ASM_SOURCES = +OBJECTS = $(C_SOURCES:.c=.o) \ + $(ASM_SOURCES:.S=.o) + +### Include directories + +INCLUDE_DIRS = \ + -I$(TOP)/include \ + -I$(TOP)/src/mesa \ + -I$(TOP)/src/mesa/main \ + -I$(TOP)/src/mesa/glapi \ + -I$(TOP)/src/mesa/math \ + -I$(TOP)/src/mesa/transform \ + -I$(TOP)/src/mesa/swrast \ + -I$(TOP)/src/mesa/swrast_setup + + +##### RULES ##### + +.c.o: + $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + +.S.o: + $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + + +##### TARGETS ##### + +targets: depend i810_dri.so + +i810_dri.so: $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.X11 + rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS) + rm -f $(TOP)/lib/i810_dri.so && \ + install i810_dri.so $(TOP)/lib/i810_dri.so + +# Run 'make -f Makefile.X11 dep' to update the dependencies if you change +# what's included by any source file. +depend: $(C_SOURCES) $(ASM_SOURCES) + makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) \ + $(C_SOURCES) $(ASM_SOURCES) + + +# Emacs tags +tags: + etags `find . -name \*.[ch]` `find ../include` + + +# Remove .o and backup files +clean: + -rm -f *.o */*.o *~ *.o *~ *.so server/*.o + + +include $(TOP)/Make-config + +include depend diff --git a/src/mesa/drivers/dri/gamma/gamma_xmesa.c b/src/mesa/drivers/dri/gamma/gamma_xmesa.c index 67bcf019d0c..c0a298cb859 100644 --- a/src/mesa/drivers/dri/gamma/gamma_xmesa.c +++ b/src/mesa/drivers/dri/gamma/gamma_xmesa.c @@ -66,7 +66,7 @@ gammaDestroyContext(__DRIcontextPrivate *driContextPriv) gmesa->glCtx->DriverCtx = NULL; _mesa_destroy_context(gmesa->glCtx); - Xfree(gmesa); + FREE(gmesa); driContextPriv->driverPrivate = NULL; } } diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index 9bc784ed8f8..604d56e2c27 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -34,6 +34,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "glheader.h" +#include "imports.h" #include "context.h" #include "matrix.h" #include "simple_list.h" @@ -68,12 +69,12 @@ static drmBufMapPtr i810_create_empty_buffers(void) { drmBufMapPtr retval; - retval = (drmBufMapPtr)ALIGN_MALLOC(sizeof(drmBufMap)); + retval = (drmBufMapPtr)ALIGN_MALLOC(sizeof(drmBufMap), 32); if(retval == NULL) return NULL; memset(retval, 0, sizeof(drmBufMap)); - retval->list = (drmBufPtr)ALIGN_MALLOC(sizeof(drmBuf) * I810_DMA_BUF_NR); + retval->list = (drmBufPtr)ALIGN_MALLOC(sizeof(drmBuf) * I810_DMA_BUF_NR, 32); if(retval->list == NULL) { - Xfree(retval); + FREE(retval); return NULL; } memset(retval->list, 0, sizeof(drmBuf) * I810_DMA_BUF_NR); @@ -143,7 +144,7 @@ i810InitDriver(__DRIscreenPrivate *sPriv) i810Screen->bufs = i810_create_empty_buffers(); if (i810Screen->bufs == NULL) { __driUtilMessage("i810InitDriver: i810_create_empty_buffers() failed"); - Xfree(i810Screen); + FREE(i810Screen); return GL_FALSE; } @@ -154,7 +155,7 @@ i810InitDriver(__DRIscreenPrivate *sPriv) i810Screen->back.handle, i810Screen->back.size, (drmAddress *)&i810Screen->back.map) != 0) { - Xfree(i810Screen); + FREE(i810Screen); sPriv->private = NULL; __driUtilMessage("i810InitDriver: drmMap failed"); return GL_FALSE; @@ -167,7 +168,7 @@ i810InitDriver(__DRIscreenPrivate *sPriv) i810Screen->depth.handle, i810Screen->depth.size, (drmAddress *)&i810Screen->depth.map) != 0) { - Xfree(i810Screen); + FREE(i810Screen); drmUnmap(i810Screen->back.map, i810Screen->back.size); sPriv->private = NULL; __driUtilMessage("i810InitDriver: drmMap (2) failed"); @@ -181,7 +182,7 @@ i810InitDriver(__DRIscreenPrivate *sPriv) i810Screen->tex.handle, i810Screen->tex.size, (drmAddress *)&i810Screen->tex.map) != 0) { - Xfree(i810Screen); + FREE(i810Screen); drmUnmap(i810Screen->back.map, i810Screen->back.size); drmUnmap(i810Screen->depth.map, i810Screen->depth.size); sPriv->private = NULL; @@ -205,7 +206,7 @@ i810DestroyScreen(__DRIscreenPrivate *sPriv) drmUnmap(i810Screen->depth.map, i810Screen->depth.size); drmUnmap(i810Screen->tex.map, i810Screen->tex.size); - Xfree(i810Screen); + FREE(i810Screen); sPriv->private = NULL; } diff --git a/src/mesa/drivers/dri/i830/i830_screen.c b/src/mesa/drivers/dri/i830/i830_screen.c index 58358eb016c..b0117210f52 100644 --- a/src/mesa/drivers/dri/i830/i830_screen.c +++ b/src/mesa/drivers/dri/i830/i830_screen.c @@ -57,7 +57,7 @@ static int i830_malloc_proxy_buf(drmBufMapPtr buffers) drmBufPtr buf; int i; - buffer = ALIGN_MALLOC(I830_DMA_BUF_SZ); + buffer = ALIGN_MALLOC(I830_DMA_BUF_SZ, 32); if(buffer == NULL) return -1; for(i = 0; i < I830_DMA_BUF_NR; i++) { buf = &(buffers->list[i]); @@ -71,12 +71,12 @@ static drmBufMapPtr i830_create_empty_buffers(void) { drmBufMapPtr retval; - retval = (drmBufMapPtr)ALIGN_MALLOC(sizeof(drmBufMap)); + retval = (drmBufMapPtr)ALIGN_MALLOC(sizeof(drmBufMap), 32); if(retval == NULL) return NULL; memset(retval, 0, sizeof(drmBufMap)); - retval->list = (drmBufPtr)ALIGN_MALLOC(sizeof(drmBuf) * I830_DMA_BUF_NR); + retval->list = (drmBufPtr)ALIGN_MALLOC(sizeof(drmBuf) * I830_DMA_BUF_NR, 32); if(retval->list == NULL) { - Xfree(retval); + FREE(retval); return NULL; } @@ -182,7 +182,7 @@ static GLboolean i830InitDriver(__DRIscreenPrivate *sPriv) if(i830Screen->bufs == NULL) { fprintf(stderr,"\nERROR: Failed to create empty buffers in %s \n", __FUNCTION__); - Xfree(i830Screen); + FREE(i830Screen); return GL_FALSE; } @@ -203,7 +203,7 @@ static GLboolean i830InitDriver(__DRIscreenPrivate *sPriv) (drmAddress *)&i830Screen->back.map) != 0) { fprintf(stderr, "\nERROR: line %d, Function %s, File %s\n", __LINE__, __FUNCTION__, __FILE__); - Xfree(i830Screen); + FREE(i830Screen); sPriv->private = NULL; return GL_FALSE; } @@ -217,7 +217,7 @@ static GLboolean i830InitDriver(__DRIscreenPrivate *sPriv) (drmAddress *)&i830Screen->depth.map) != 0) { fprintf(stderr, "\nERROR: line %d, Function %s, File %s\n", __LINE__, __FUNCTION__, __FILE__); - Xfree(i830Screen); + FREE(i830Screen); drmUnmap(i830Screen->back.map, i830Screen->back.size); sPriv->private = NULL; return GL_FALSE; @@ -232,7 +232,7 @@ static GLboolean i830InitDriver(__DRIscreenPrivate *sPriv) (drmAddress *)&i830Screen->tex.map) != 0) { fprintf(stderr, "\nERROR: line %d, Function %s, File %s\n", __LINE__, __FUNCTION__, __FILE__); - Xfree(i830Screen); + FREE(i830Screen); drmUnmap(i830Screen->back.map, i830Screen->back.size); drmUnmap(i830Screen->depth.map, i830Screen->depth.size); sPriv->private = NULL; @@ -288,7 +288,7 @@ static void i830DestroyScreen(__DRIscreenPrivate *sPriv) drmUnmap(i830Screen->back.map, i830Screen->back.size); drmUnmap(i830Screen->depth.map, i830Screen->depth.size); drmUnmap(i830Screen->tex.map, i830Screen->tex.size); - Xfree(i830Screen); + FREE(i830Screen); sPriv->private = NULL; } -- cgit v1.2.3 From 3eb0edb31f06d36b22fa524a3ae98ea94843fa8e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 16 Oct 2003 16:33:05 +0000 Subject: added GL_ARB_point_sprite tokens --- include/GL/gl.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index a3179cf2570..e2dbeb3e93a 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2261,6 +2261,16 @@ typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC)(GLuint id, GLenum pname, #endif /* GL_ARB_occlusion_query */ +/* XXX temporary until glext.h is updated! */ +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 + +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 + +#endif /* GL_ARB_point_sprite */ + + #ifndef GL_MESA_program_debug #define GL_MESA_program_debug 1 -- cgit v1.2.3 From 906449753f126f74ad3321d0af897f6609880c17 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Mon, 20 Oct 2003 17:36:41 +0000 Subject: Define GLAPIENTRYP properly so that GLU compiles on Windows. --- include/GL/glu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index 129777852f2..99515dcc373 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -41,7 +41,7 @@ #endif #ifndef GLAPIENTRYP -#define GLAPIENTRYP +#define GLAPIENTRYP GLAPIENTRY * #endif #ifndef GLAPI -- cgit v1.2.3 From 1b6cca67b5f7c658b6a141e83bbb20ce45a3b85c Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Tue, 21 Oct 2003 11:15:52 +0000 Subject: documentation update; also new makefiles for Win32 MesaFX build --- Makefile.wfx | 87 ++++++++++ docs/README.3DFX | 49 +++++- include/GL/fxmesa.h | 2 +- src/mesa/Makefile.wfx | 433 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 566 insertions(+), 5 deletions(-) create mode 100644 Makefile.wfx create mode 100644 src/mesa/Makefile.wfx (limited to 'include') diff --git a/Makefile.wfx b/Makefile.wfx new file mode 100644 index 00000000000..14ab00c8d1a --- /dev/null +++ b/Makefile.wfx @@ -0,0 +1,87 @@ +# Mesa 3-D graphics library +# Version: 5.1 +# +# Copyright (C) 1999-2003 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. + +# Win32/FX makefile for Mesa +# +# Copyright (c) 2003 - Hiroshi Morii +# Email : koolsmoky@users.sourceforge.net +# URL : http://www.3dfxzone.it/koolsmoky + +# Debug build : nmake -f Makefile.wfx debug +# Optimized build : nmake -f Makefile.wfx +# Remove objects : nmake -f Makefile.wfx clean +# Remove files in bin, lib : nmake -f Makefile.wfx clobber +# Remove all generated files : nmake -f Makefile.wfx realclean + +# Build the libs +SUBDIRS = src\mesa.dir +DBGBUILD = $(SUBDIRS:.dir=.debug) +CLEAN = $(SUBDIRS:.dir=.clean) +CLOBBER = $(SUBDIRS:.dir=.clobber) +REALCLEAN = $(SUBDIRS:.dir=.realclean) +LIBDIR = lib + +# default rule +default : $(LIBDIR) $(SUBDIRS) + +# debug build rules +debug : $(LIBDIR) $(DBGBUILD) + +# cleanup rules +clean : $(CLEAN) +clobber : $(CLOBBER) +realclean : $(REALCLEAN) + +# inference rules +$(LIBDIR): + @echo. + @mkdir $(LIBDIR) + +$(SUBDIRS): + @echo. + @cd $* + @nmake -f Makefile.wfx + @cd .. + +$(DBGBUILD): + @echo. + @cd $* + @nmake -f Makefile.wfx DEBUG=1 + @cd .. + +$(CLEAN): + @echo. + @cd $* + @nmake -f Makefile.wfx clean + @cd .. + +$(CLOBBER): + @echo. + @cd $* + @nmake -f Makefile.wfx clobber + @cd .. + +$(REALCLEAN): + @echo. + @cd $* + @nmake -f Makefile.wfx realclean + @cd .. diff --git a/docs/README.3DFX b/docs/README.3DFX index 1ccb766fd25..2b6b2e9e933 100644 --- a/docs/README.3DFX +++ b/docs/README.3DFX @@ -9,18 +9,59 @@ Mesa-5.1 release notes: 1) Glide2 support has been ceased; in order to keep Voodoo Graphics, Voodoo2 and Voodoo Rush compatibility, please visit the Glide SourceForge and help us to fix Glide3 for those cards. -2) The non-DRI Linux build is currently broken. Any help will be appreciated. +2) The current release is a WIP; among other things, the Linux build works + only to some extent. Any help will be appreciated. 3) Glide3 can be found at http://sourceforge.net/projects/glide/ -Known supported HW: Voodoo Banshee, Voodoo3, Voodoo4, Voodoo5 5500 -Known supported OS: DOS (DJGPP), Windows9x/2k (MinGW/MSVC), Linux+DRI -Comments, notes, flames: + +Known supported HW/OS: +---------------------- + +Voodoo Banshee, Voodoo3, Voodoo4, Voodoo5 5500 +DOS (DJGPP), Windows9x/2k (MinGW/MSVC), Linux + + + +How to compile: +--------------- + +DJGPP/MinGW/MSVC: + Place the Glide3 SDK in the top Mesa directory: + $(MESA)/glide3/include/*.h + $(MESA)/glide3/lib/ + Required headers: + 3dfx.h, g3ext.h, glide.h, glidesys.h, glideutl.h, sst1vid.h + Required libraries: + OS specific + Type: + make -f Makefile.DJ HAVE_MMX=1 HAVE_3DNOW=1 FX=1 + or + make -f Makefile.mgw HAVE_MMX=1 HAVE_3DNOW=1 FX=1 + or + nmake -f Makefile.wfx + Look into the corresponding makefiles for further information. + +Linux: + Place the Glide3 SDK in /usr/local/glide + Type: + make linux-glide + + + +Contact: +-------- + Daniel Borca Hiroshi Morii +The info below this line is outdated. You have been warned... +************************************************************* + + + Info for Mesa 4.1 ----------------- diff --git a/include/GL/fxmesa.h b/include/GL/fxmesa.h index 24c38278f50..fd3dbaeac5b 100644 --- a/include/GL/fxmesa.h +++ b/include/GL/fxmesa.h @@ -22,7 +22,7 @@ /* * FXMesa - 3Dfx Glide driver for Mesa. Contributed by David Bucciarelli * - * NOTE: This version requires Glide 2.3 or later. + * NOTE: This version requires Glide3 (http://sourceforge.net/projects/glide) */ diff --git a/src/mesa/Makefile.wfx b/src/mesa/Makefile.wfx new file mode 100644 index 00000000000..afc17de199a --- /dev/null +++ b/src/mesa/Makefile.wfx @@ -0,0 +1,433 @@ +# Mesa 3-D graphics library +# Version: 5.1 +# +# Copyright (C) 1999-2003 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. + +# Win32/FX core makefile for Mesa +# +# Copyright (c) 2003 - Hiroshi Morii +# Email : koolsmoky@users.sourceforge.net +# URL : http://www.3dfxzone.it/koolsmoky + +# Debug build : nmake -f Makefile.fx.win32 DEBUG=1 +# Optimized build : nmake -f Makefile.fx.win32 +# Remove objects : nmake -f Makefile.fx.win32 clean +# Remove files in bin, lib : nmake -f Makefile.fx.win32 clobber +# Remove all generated files : nmake -f Makefile.fx.win32 realclean + +.SUFFIXES: .S +################################## +# general +################################## +BUILDROOT = ..\.. + +!if "$(GLIDE3SDK)"=="" +GLIDE3SDK = $(BUILDROOT)\glide3 +!endif + +!if "$(GLIDE3SDK)"=="" +!error GLIDE3SDK undefined! Need to specify Glide3x SDK path! +!endif + +GLIDE3LIB = $(GLIDE3SDK)\lib\glide3x.lib +TEXUS2LIB = #$(GLIDE3SDK)\lib\texus2.lib +LIBDIR = $(BUILDROOT)\lib +GL_DLL = Mesa.dll + +HAVE_X86 = 1 +HAVE_MMX = 1 +HAVE_SSE = +HAVE_3DNOW = 1 + +################################## +# build flags +################################## +FLAGS = -DH3 -DFX_GLIDE_NAPALM=1 -DH4=1 -DFX_GLIDE_H5_CSIM=1 -DGLIDE3=1 -DGLIDE3_ALPHA=1 -DBUILD_GL32 -DFX #-DGLX_DIRECT_RENDERING + +!if "$(USE_IEEE)"=="1" +FLAGS = $(FLAGS) -D__i386__ +!endif + +!if "$(HAVE_MMX)"=="1" +FLAGS = $(FLAGS) -DUSE_MMX_ASM +!endif +!if "$(HAVE_SSE)"=="1" +FLAGS = $(FLAGS) -DUSE_SSE_ASM +!endif +!if "$(HAVE_3DNOW)"=="1" +FLAGS = $(FLAGS) -DUSE_3DNOW_ASM +!endif +!if "$(HAVE_X86)"=="1" +FLAGS = $(FLAGS) -DUSE_X86_ASM +!endif + +!if "$(DEBUG)" == "1" +FLAGS = $(FLAGS) -DMESA_DEBUG -DFX_DEBUG +!endif + +################################## +# compiler setup +################################## +CC = cl +LINK = link +AR = lib +AS = nasm + +CFLAGS = -G6 -c -D__MSC__ -D_MSC_VER=1200 -D_WIN32 -DWIN32 -DSTRICT -W3 #-WX -D__WIN32__ +LFLAGS = -nologo /DLL /OPT:WIN98 /MACHINE:IX86 /NODEFAULTLIB #/SUBSYSTEM:WINDOWS,4.00 +ARFLAGS = -nologo +ASFLAGS = -O2 -fwin32 + +!if "$(DEBUG)"== "1" +CFLAGS = $(CFLAGS) -Od -MDd -DDEBUG=1 -D_DEBUG -D_MT -Zi #-D_DLL conflicts with BUILD_GL32 +LFLAGS = $(LFLAGS) -debugtype:both /DEBUG +ARFLAGS = $(ARFLAGS) -debugtype:both +ASFLAGS = $(ASFLAGS) -g -DDEBUG=1 +!else +CFLAGS = $(CFLAGS) -Ox -MD -D_MT +!endif + +################################# +# OS commands +################################# +RM = @del +MV = mv + +################################# +# sources +################################# +MAIN_SOURCES = \ + main\api_arrayelt.c \ + main\api_loopback.c \ + main\api_noop.c \ + main\api_validate.c \ + main\accum.c \ + main\arbprogram.c \ + main\arbfragparse.c \ + main\arbvertparse.c \ + main\attrib.c \ + main\blend.c \ + main\bufferobj.c \ + main\buffers.c \ + main\clip.c \ + main\colortab.c \ + main\context.c \ + main\convolve.c \ + main\debug.c \ + main\depth.c \ + main\dispatch.c \ + main\dlist.c \ + main\drawpix.c \ + main\enable.c \ + main\enums.c \ + main\eval.c \ + main\extensions.c \ + main\feedback.c \ + main\fog.c \ + main\get.c \ + main\hash.c \ + main\hint.c \ + main\histogram.c \ + main\image.c \ + main\imports.c \ + main\light.c \ + main\lines.c \ + main\matrix.c \ + main\nvprogram.c \ + main\nvfragparse.c \ + main\nvvertexec.c \ + main\nvvertparse.c \ + main\occlude.c \ + main\pixel.c \ + main\points.c \ + main\polygon.c \ + main\program.c \ + main\rastpos.c \ + main\state.c \ + main\stencil.c \ + main\texcompress.c \ + main\texformat.c \ + main\teximage.c \ + main\texobj.c \ + main\texstate.c \ + main\texstore.c \ + main\texutil.c \ + main\varray.c \ + main\vtxfmt.c + +GLAPI_SOURCES = \ + glapi\glapi.c \ + glapi\glthread.c + +MATH_SOURCES = \ + math\m_debug_clip.c \ + math\m_debug_norm.c \ + math\m_debug_xform.c \ + math\m_eval.c \ + math\m_matrix.c \ + math\m_translate.c \ + math\m_vector.c \ + math\m_xform.c + +ARRAY_CACHE_SOURCES = \ + array_cache\ac_context.c \ + array_cache\ac_import.c + +SWRAST_SOURCES = \ + swrast\s_aaline.c \ + swrast\s_aatriangle.c \ + swrast\s_accum.c \ + swrast\s_alpha.c \ + swrast\s_alphabuf.c \ + swrast\s_bitmap.c \ + swrast\s_blend.c \ + swrast\s_buffers.c \ + swrast\s_copypix.c \ + swrast\s_context.c \ + swrast\s_depth.c \ + swrast\s_drawpix.c \ + swrast\s_feedback.c \ + swrast\s_fog.c \ + swrast\s_imaging.c \ + swrast\s_lines.c \ + swrast\s_logic.c \ + swrast\s_masking.c \ + swrast\s_nvfragprog.c \ + swrast\s_pixeltex.c \ + swrast\s_points.c \ + swrast\s_readpix.c \ + swrast\s_span.c \ + swrast\s_stencil.c \ + swrast\s_texture.c \ + swrast\s_texstore.c \ + swrast\s_triangle.c \ + swrast\s_zoom.c + +SWRAST_SETUP_SOURCES = \ + swrast_setup\ss_context.c \ + swrast_setup\ss_triangle.c \ + swrast_setup\ss_vb.c + +TNL_SOURCES = \ + tnl\t_array_api.c \ + tnl\t_array_import.c \ + tnl\t_context.c \ + tnl\t_eval_api.c \ + tnl\t_imm_alloc.c \ + tnl\t_imm_api.c \ + tnl\t_imm_debug.c \ + tnl\t_imm_dlist.c \ + tnl\t_imm_elt.c \ + tnl\t_imm_eval.c \ + tnl\t_imm_exec.c \ + tnl\t_imm_fixup.c \ + tnl\t_pipeline.c \ + tnl\t_vb_fog.c \ + tnl\t_vb_light.c \ + tnl\t_vb_normals.c \ + tnl\t_vb_points.c \ + tnl\t_vb_program.c \ + tnl\t_vb_render.c \ + tnl\t_vb_texgen.c \ + tnl\t_vb_texmat.c \ + tnl\t_vb_vertex.c + +DRIVER_SOURCES = \ + drivers\glide\fxapi.c \ + drivers\glide\fxdd.c \ + drivers\glide\fxddspan.c \ + drivers\glide\fxddtex.c \ + drivers\glide\fxsetup.c \ + drivers\glide\fxtexman.c \ + drivers\glide\fxtris.c \ + drivers\glide\fxvb.c \ + drivers\glide\fxglidew.c \ + drivers\glide\fxwgl.c \ + drivers\glide\fxg.c + +X86_SOURCES = \ + x86\x86.c \ + x86\glapi_x86.S \ + x86\common_x86.c \ + x86\common_x86_asm.S \ + x86\x86_xform2.S \ + x86\x86_xform3.S \ + x86\x86_xform4.S \ + x86\x86_cliptest.S + +MMX_SOURCES = \ + x86\mmx_blend.S + +SSE_SOURCES = \ + x86\sse.c \ + x86\sse_xform2.S \ + x86\sse_xform3.S \ + x86\sse_xform4.S \ + x86\sse_normal.S + +K3D_SOURCES = \ + x86\3dnow.c \ + x86\3dnow_xform2.S \ + x86\3dnow_xform3.S \ + x86\3dnow_xform4.S \ + x86\3dnow_normal.S + +!if "$(HAVE_MMX)"=="1" +X86_SOURCES = $(X86_SOURCES) $(MMX_SOURCES) +HAVE_X86 = 1 +!endif +!if "$(HAVE_SSE)"=="1" +X86_SOURCES = $(X86_SOURCES) $(SSE_SOURCES) +HAVE_X86 = 1 +!endif +!if "$(HAVE_3DNOW)"=="1" +X86_SOURCES = $(X86_SOURCES) $(K3D_SOURCES) +HAVE_X86 = 1 +!endif +!if "$(HAVE_X86)"=="1" +!else +X86_SOURCES = +!endif + +EXPORTS = drivers\glide\fxopengl.def + +MAIN_OBJS = $(MAIN_SOURCES:.c=.obj) +GLAPI_OBJS = $(GLAPI_SOURCES:.c=.obj) +MATH_OBJS = $(MATH_SOURCES:.c=.obj) +ARRAY_CACHE_OBJS = $(ARRAY_CACHE_SOURCES:.c=.obj) +SWRAST_OBJS = $(SWRAST_SOURCES:.c=.obj) +SWRAST_SETUP_OBJS = $(SWRAST_SETUP_SOURCES:.c=.obj) +TNL_OBJS = $(TNL_SOURCES:.c=.obj) +DRIVER_OBJS = $(DRIVER_SOURCES:.c=.obj) +X86_OBJS = $(X86_SOURCES:.c=.obj) +X86_OBJS = $(X86_OBJS:.S=.obj) + +RES = drivers\glide\fx.res + +CORE_LIBS = \ + $(LIBDIR)\main.lib \ + $(LIBDIR)\glapi.lib \ + $(LIBDIR)\math.lib \ + $(LIBDIR)\array_cache.lib \ + $(LIBDIR)\swrast.lib \ + $(LIBDIR)\swarst_setup.lib \ + $(LIBDIR)\tnl.lib + +!if "$(X86_SOURCES)"!="" +X86_LIB = $(LIBDIR)\x86.lib +!else +X86_LIB = +!endif + +INCS = -I$(BUILDROOT)\include \ + -I. \ + -I.\drivers\glide \ + -I.\main \ + -I.\glapi \ + -I$(GLIDE3SDK)\include + +DEP_LIB = user32.lib gdi32.lib kernel32.lib + +!if "$(DEBUG)" == "1" +STD_LIB = MSVCRTD.lib +!else +STD_LIB = MSVCRT.lib +!endif + +################################# +# build rules +################################# +default:: all + +all: $(X86_LIB) $(CORE_LIBS) $(LIBDIR)\$(GL_DLL) + +$(LIBDIR)\$(GL_DLL): $(DRIVER_OBJS) $(CORE_LIBS) $(X86_LIB) $(RES) + $(LINK) -out:$@ -def:$(EXPORTS) $(LFLAGS) $(DRIVER_OBJS) $(CORE_LIBS) $(X86_LIB) $(DEP_LIB) $(STD_LIB) $(TEXUS2LIB) $(GLIDE3LIB) $(RES) + +$(LIBDIR)\main.lib: $(MAIN_OBJS) + $(AR) -out:$@ $(ARFLAGS) $(MAIN_OBJS) + +$(LIBDIR)\glapi.lib: $(GLAPI_OBJS) + $(AR) -out:$@ $(ARFLAGS) $(GLAPI_OBJS) + +$(LIBDIR)\math.lib: $(MATH_OBJS) + $(AR) -out:$@ $(ARFLAGS) $(MATH_OBJS) + +$(LIBDIR)\array_cache.lib: $(ARRAY_CACHE_OBJS) + $(AR) -out:$@ $(ARFLAGS) $(ARRAY_CACHE_OBJS) + +$(LIBDIR)\swrast.lib: $(SWRAST_OBJS) + $(AR) -out:$@ $(ARFLAGS) $(SWRAST_OBJS) + +$(LIBDIR)\swarst_setup.lib: $(SWRAST_SETUP_OBJS) + $(AR) -out:$@ $(ARFLAGS) $(SWRAST_SETUP_OBJS) + +$(LIBDIR)\tnl.lib: $(TNL_OBJS) + $(AR) -out:$@ $(ARFLAGS) $(TNL_OBJS) + +x86\matypes.h: x86\gen_matypes.exe + x86\gen_matypes.exe > $@ + +x86\gen_matypes.exe: x86\gen_matypes.obj + $(CC) -o $@ x86\gen_matypes.obj + +$(LIBDIR)\x86.lib: x86\matypes.h $(X86_OBJS) + $(AR) -out:$@ $(ARFLAGS) $(X86_OBJS) + +.c.obj: + $(CC) $(CFLAGS) $(FLAGS) $(INCS) $< /Fo$*.obj + +.S.obj: + $(CC) $(CFLAGS) $(FLAGS) $(INCS) $< -D__WIN32__ -DNASM_ASSEMBLER -EP > $*.i + $(AS) $(ASFLAGS) $(INCS) $*.i -o $*.obj + $(RM) $*.i + +.rc.res: + $(RC) -Fo$@ $(INCS) $(FLAGS) -D__WIN32__ $< + +# [dBorca] Hack alert: +# use standard API, to work around Win32 @x names +# also glapi_x86.S is protected against __WIN32__ +main\dispatch.obj: main\dispatch.c + $(CC) $(CFLAGS) $(FLAGS) $(INCS) -UUSE_X86_ASM main\dispatch.c /Fo$*.obj + +################################# +# cleanup rules +################################# +realclean: clean clobber + +clean:: + $(RM) array_cache\*.obj + $(RM) glapi\*.obj + $(RM) main\*.obj + $(RM) math\*.obj + $(RM) swrast\*.obj + $(RM) swrast_setup\*.obj + $(RM) tnl\*.obj + $(RM) x86\*.obj + $(RM) drivers\glide\*.obj + $(RM) drivers\glide\*.res + $(RM) $(LIBDIR)\*.pdb + $(RM) *.pdb + +clobber:: + $(RM) $(LIBDIR)\*.lib + $(RM) $(LIBDIR)\*.exp + $(RM) $(LIBDIR)\*.dll -- cgit v1.2.3 From 20f40fa4273b8800fe05f20c02dd19d5d1203ce5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 27 Oct 2003 18:33:34 +0000 Subject: minor fix to glutSetColor prototype (Evgeny Kotsuba) --- include/GL/glut.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glut.h b/include/GL/glut.h index 27d937f7ce8..3a67f1f560d 100644 --- a/include/GL/glut.h +++ b/include/GL/glut.h @@ -648,7 +648,7 @@ GLUTAPI void GLUTAPIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned in #endif /* GLUT color index sub-API. */ -GLUTAPI void GLUTAPIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue); +GLUTAPI void GLUTAPIENTRY glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue); GLUTAPI GLfloat GLUTAPIENTRY glutGetColor(int ndx, int component); GLUTAPI void GLUTAPIENTRY glutCopyColormap(int win); -- cgit v1.2.3 From 67f8a1d4ad5c6f94067ef9a621b513fe8f708c72 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 22 Nov 2003 18:44:10 +0000 Subject: added OpenGL 1.5 tokens and functions not yet put into glext.h --- include/GL/gl.h | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index e2dbeb3e93a..39c5113c4d2 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2297,6 +2297,117 @@ glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, +/* + * XXX temporary - these new 1.5 tokens should be defined in glext.h + */ +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 + +/* New and improved token names */ +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA + +/* Buffer object tokens */ +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA + +/* Occlusion query tokens */ +#define GL_SAMPLES_PASSED 0x8914 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 + +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; + +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void GLAPIENTRY glGenQueries(GLsizei n, GLuint *ids); +GLAPI void GLAPIENTRY glDeleteQueries(GLsizei n, const GLuint *ids); +GLAPI GLboolean GLAPIENTRY glIsQuery(GLuint id); +GLAPI void GLAPIENTRY glBeginQuery(GLenum target, GLuint id); +GLAPI void GLAPIENTRY glEndQuery(GLenum target); +GLAPI void GLAPIENTRY glGetQueryiv(GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetQueryObjectiv(GLuint id, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params); +GLAPI void APIENTRY glBindBuffer(GLenum, GLuint); +GLAPI void APIENTRY glDeleteBuffers(GLsizei, const GLuint *); +GLAPI void APIENTRY glGenBuffers(GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsBuffer(GLuint); +GLAPI void APIENTRY glBufferData(GLenum, GLsizeiptr, const GLvoid *, GLenum); +GLAPI void APIENTRY glBufferSubData(GLenum, GLintptr, GLsizeiptr, const GLvoid *); +GLAPI void APIENTRY glGetBufferSubData(GLenum, GLintptr, GLsizeiptr, GLvoid *); +GLAPI GLvoid* APIENTRY glMapBuffer(GLenum, GLenum); +GLAPI GLboolean APIENTRY glUnmapBuffer(GLenum); +GLAPI void APIENTRY glGetBufferParameteriv(GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetBufferPointerv(GLenum, GLenum, GLvoid* *); +#endif + +typedef void (APIENTRYP PFNGLGENQUERIESPROC)(GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC)(GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC)(GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYPROC)(GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYPROC)(GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVPROC)(GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC)(GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC)(GLuint id, GLenum pname, GLuint *params); + +typedef void (APIENTRYP PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSPROC)(GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC)(GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC)(GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC)(GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC)(GLenum target, GLenum pname, GLvoid* *params); + +#endif /* GL_VERSION_1_5 */ + + + /********************************************************************** * Begin system-specific stuff */ -- cgit v1.2.3 From 91b6a4aa901e09b395cf6d81ed29dfe281dbc9f7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 23 Nov 2003 16:22:54 +0000 Subject: include malloc.h to get ptrdiff_t for vertex buffer object's GLintptr --- include/GL/gl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 39c5113c4d2..2d383042913 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -37,7 +37,9 @@ * included. */ #if !defined(__SCITECH_SNAP__) - + +#include /* to get ptrdiff_t, used below */ + #if defined(__BEOS__) #include /* to get some BeOS-isms */ #endif -- cgit v1.2.3 From 3eb58b4c1eb85ad2a68e7d4aed523026d8c7bbf8 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Thu, 4 Dec 2003 12:33:15 +0000 Subject: bring over glcore.h changes from DRI trunk --- include/GL/internal/glcore.h | 74 +++++++++++++++++++++++++++++++------------- 1 file changed, 53 insertions(+), 21 deletions(-) (limited to 'include') diff --git a/include/GL/internal/glcore.h b/include/GL/internal/glcore.h index f3b180c165c..140b3991687 100644 --- a/include/GL/internal/glcore.h +++ b/include/GL/internal/glcore.h @@ -41,8 +41,14 @@ #include #endif +#ifdef CAPI +#undef CAPI +#endif +#define CAPI + #define GL_CORE_SGI 1 #define GL_CORE_MESA 2 +#define GL_CORE_APPLE 4 typedef struct __GLcontextRec __GLcontext; typedef struct __GLinterfaceRec __GLinterface; @@ -65,10 +71,13 @@ typedef struct __GLinterfaceRec __GLinterface; ** context to the application. */ typedef struct __GLcontextModesRec { + struct __GLcontextModesRec * next; + GLboolean rgbMode; + GLboolean floatMode; GLboolean colorIndexMode; - GLboolean doubleBufferMode; - GLboolean stereoMode; + GLuint doubleBufferMode; + GLuint stereoMode; GLboolean haveAccumBuffer; GLboolean haveDepthBuffer; @@ -88,6 +97,46 @@ typedef struct __GLcontextModesRec { GLint level; GLint pixmapMode; + + /* GLX */ + GLint visualID; + GLint visualType; /**< One of the GLX X visual types. (i.e., + * \c GLX_TRUE_COLOR, etc.) + */ + + /* EXT_visual_rating / GLX 1.2 */ + GLint visualRating; + + /* EXT_visual_info / GLX 1.2 */ + GLint transparentPixel; + /* colors are floats scaled to ints */ + GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha; + GLint transparentIndex; + + /* ARB_multisample / SGIS_multisample */ + GLint sampleBuffers; + GLint samples; + + /* SGIX_fbconfig / GLX 1.3 */ + GLint drawableType; + GLint renderType; + GLint xRenderable; + GLint fbconfigID; + + /* SGIX_pbuffer / GLX 1.3 */ + GLint maxPbufferWidth; + GLint maxPbufferHeight; + GLint maxPbufferPixels; + GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */ + GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */ + + /* SGIX_visual_select_group */ + GLint visualSelectGroup; + + /* OML_swap_method */ + GLint swapMethod; + + GLint screen; } __GLcontextModes; /************************************************************************/ @@ -219,11 +268,7 @@ struct __GLdrawableBufferRec { /* exported */ void (*freePrivate)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); -#ifdef __cplusplus - void *privatePtr; -#else void *private; -#endif /* private */ void *other; /* implementation private data */ @@ -314,14 +359,7 @@ struct __GLdrawablePrivateRec { void (*unlockDP)(__GLdrawablePrivate *glPriv); /* exported */ -#if 0 /* disable, just like in __GLimportsRec */ - void *wsPriv; /* pointer to the window system DrawablePrivate */ -#endif -#ifdef __cplusplus - void *privatePtr; -#else void *private; -#endif void (*freePrivate)(__GLdrawablePrivate *); /* client data */ @@ -374,14 +412,7 @@ typedef struct __GLimportsRec { /* Drawing surface management */ __GLdrawablePrivate *(*getDrawablePrivate)(__GLcontext *gc); - -#if 0 - /* At some point, this field got removed from the XFree86 glcore.h file. - * we're removing it here to prevent interop problems. (Brian) - */ - /* Pointer to the window system context */ - void *wscx; -#endif + __GLdrawablePrivate *(*getReadablePrivate)(__GLcontext *gc); /* Operating system dependent data goes here */ void *other; @@ -397,6 +428,7 @@ typedef struct __GLexportsRec { /* Context management (return GL_FALSE on failure) */ GLboolean (*destroyContext)(__GLcontext *gc); GLboolean (*loseCurrent)(__GLcontext *gc); + /* oldglPriv isn't used anymore, kept for backwards compatibility */ GLboolean (*makeCurrent)(__GLcontext *gc); GLboolean (*shareContext)(__GLcontext *gc, __GLcontext *gcShare); GLboolean (*copyContext)(__GLcontext *dst, const __GLcontext *src, GLuint mask); -- cgit v1.2.3 From f82c775fff7974ef9537332cdb5ade70703ba38c Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Thu, 4 Dec 2003 15:59:03 +0000 Subject: #define GLAPIENTRYP GLAPIENTRY * --- include/GL/gl.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 2d383042913..393784bf5ca 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -96,6 +96,7 @@ #define APIENTRY GLAPIENTRY #endif #define APIENTRYP APIENTRY * +#define GLAPIENTRYP GLAPIENTRY * #ifdef CENTERLINE_CLPP #define signed -- cgit v1.2.3 From faf4059aa8cc477732eaebffe2af2d3ace10d043 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Thu, 4 Dec 2003 15:59:41 +0000 Subject: check if GLAPIENTRYP is already set --- include/GL/gl.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 393784bf5ca..cc1bba19135 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -96,7 +96,10 @@ #define APIENTRY GLAPIENTRY #endif #define APIENTRYP APIENTRY * + +#ifndef GLAPIENTRYP #define GLAPIENTRYP GLAPIENTRY * +#endif #ifdef CENTERLINE_CLPP #define signed -- cgit v1.2.3 From 78c58413649838ff83e416e5a76d5cf15ee89b87 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 6 Dec 2003 01:49:54 +0000 Subject: s/APIENTRY/GLAPIENTRY/ for 1.5 functions --- include/GL/gl.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index cc1bba19135..1f53ff47907 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -38,7 +38,7 @@ */ #if !defined(__SCITECH_SNAP__) -#include /* to get ptrdiff_t, used below */ +#include /* to get ptrdiff_t, used below */ #if defined(__BEOS__) #include /* to get some BeOS-isms */ @@ -2376,17 +2376,17 @@ GLAPI void GLAPIENTRY glEndQuery(GLenum target); GLAPI void GLAPIENTRY glGetQueryiv(GLenum target, GLenum pname, GLint *params); GLAPI void GLAPIENTRY glGetQueryObjectiv(GLuint id, GLenum pname, GLint *params); GLAPI void GLAPIENTRY glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params); -GLAPI void APIENTRY glBindBuffer(GLenum, GLuint); -GLAPI void APIENTRY glDeleteBuffers(GLsizei, const GLuint *); -GLAPI void APIENTRY glGenBuffers(GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsBuffer(GLuint); -GLAPI void APIENTRY glBufferData(GLenum, GLsizeiptr, const GLvoid *, GLenum); -GLAPI void APIENTRY glBufferSubData(GLenum, GLintptr, GLsizeiptr, const GLvoid *); -GLAPI void APIENTRY glGetBufferSubData(GLenum, GLintptr, GLsizeiptr, GLvoid *); -GLAPI GLvoid* APIENTRY glMapBuffer(GLenum, GLenum); -GLAPI GLboolean APIENTRY glUnmapBuffer(GLenum); -GLAPI void APIENTRY glGetBufferParameteriv(GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetBufferPointerv(GLenum, GLenum, GLvoid* *); +GLAPI void GLAPIENTRY glBindBuffer(GLenum, GLuint); +GLAPI void GLAPIENTRY glDeleteBuffers(GLsizei, const GLuint *); +GLAPI void GLAPIENTRY glGenBuffers(GLsizei, GLuint *); +GLAPI GLboolean GLAPIENTRY glIsBuffer(GLuint); +GLAPI void GLAPIENTRY glBufferData(GLenum, GLsizeiptr, const GLvoid *, GLenum); +GLAPI void GLAPIENTRY glBufferSubData(GLenum, GLintptr, GLsizeiptr, const GLvoid *); +GLAPI void GLAPIENTRY glGetBufferSubData(GLenum, GLintptr, GLsizeiptr, GLvoid *); +GLAPI GLvoid* GLAPIENTRY glMapBuffer(GLenum, GLenum); +GLAPI GLboolean GLAPIENTRY glUnmapBuffer(GLenum); +GLAPI void GLAPIENTRY glGetBufferParameteriv(GLenum, GLenum, GLint *); +GLAPI void GLAPIENTRY glGetBufferPointerv(GLenum, GLenum, GLvoid* *); #endif typedef void (APIENTRYP PFNGLGENQUERIESPROC)(GLsizei n, GLuint *ids); -- cgit v1.2.3 From fde2b9750ea9f37b018aaa26c9bbb6454cd1c016 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 6 Dec 2003 17:17:42 +0000 Subject: basic API work for FBConfigs & Pbuffers --- include/GL/miniglx.h | 42 ++++++++++++++++++++++++++++++++++++++++-- src/glx/mini/miniglx.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 89 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/miniglx.h b/include/GL/miniglx.h index 7720d3536d0..4416e587d67 100644 --- a/include/GL/miniglx.h +++ b/include/GL/miniglx.h @@ -1,4 +1,4 @@ -/* $Id: miniglx.h,v 1.1 2003/08/23 01:25:30 jonsmirl Exp $ */ +/* $Id: miniglx.h,v 1.2 2003/12/06 17:17:42 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -91,6 +91,15 @@ typedef struct MiniGLXXVisualInfoRec { int bits_per_rgb; /**< \brief total bits per pixel */ } XVisualInfo; +/** + * \brief GLX Frame Buffer Configuration (for pbuffers) + * \sa \ref datatypes. + */ +typedef struct MiniGLXFBConfigRec { + XVisualInfo *visInfo; +} GLXFBConfig; + + /** * \brief Display handle. * @@ -132,6 +141,17 @@ typedef struct MiniGLXWindowRec *Drawable; */ typedef struct MiniGLXWindowRec *GLXDrawable; +/** + * \brief GLX pbuffer. + * + * Alias for the private ::MiniGLXWindowRec structure. + * + * Same as #Drawable. + * + * \sa \ref datatypes. + */ +typedef struct MiniGLXWindowRec *GLXPbuffer; + /** * \brief GLX context. * @@ -282,6 +302,8 @@ typedef union _XEvent { /*@{*/ /** \brief Defined if version 1.0 of Mini GLX is supported. */ #define MINI_GLX_VERSION_1_0 1 +/** \brief Defined if version 1.1 of Mini GLX is supported. */ +#define MINI_GLX_VERSION_1_1 1 /*@}*/ @@ -355,7 +377,8 @@ extern void XFree( void *data ); extern XVisualInfo * -XGetVisualInfo( Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return ); +XGetVisualInfo( Display *display, long vinfo_mask, + XVisualInfo *vinfo_template, int *nitems_return ); /*@}*/ @@ -394,6 +417,21 @@ glXGetProcAddress( const GLubyte *procname ); extern Bool glXQueryVersion( Display *dpy, int *major, int *minor ); + +/* Added in MiniGLX 1.1 */ +extern GLXPbuffer +glXCreatePbuffer( Display *dpy, GLXFBConfig config, const int *attribList ); + +extern void +glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf ); + +extern GLXFBConfig * +glXChooseFBConfig( Display *dpy, int screen, const int *attribList, + int *nitems ); + +extern XVisualInfo * +glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ); + /*@}*/ diff --git a/src/glx/mini/miniglx.c b/src/glx/mini/miniglx.c index 15563df3f3e..5cec09c8aa5 100644 --- a/src/glx/mini/miniglx.c +++ b/src/glx/mini/miniglx.c @@ -31,7 +31,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $Id: miniglx.c,v 1.2 2003/10/21 06:05:40 jonsmirl Exp $ */ +/* $Id: miniglx.c,v 1.3 2003/12/06 17:18:09 brianp Exp $ */ /** * \mainpage Mini GLX @@ -1935,6 +1935,10 @@ glXGetProcAddress( const GLubyte *procName ) { "XFreeColormap", (void *) XFreeColormap }, { "XFree", (void *) XFree }, { "XGetVisualinfo", (void *) XGetVisualInfo }, + { "glXCreatePbuffer", (void *) glXCreatePbuffer }, + { "glXDestroyPbuffer", (void *) glXDestroyPbuffer }, + { "glXChooseFBConfig", (void *) glXChooseFBConfig }, + { "glXGetVisualFromFBConfig", (void *) glXGetVisualFromFBConfig }, { NULL, NULL } }; const struct name_address *entry; @@ -1972,4 +1976,48 @@ glXQueryVersion( Display *dpy, int *major, int *minor ) } +/** + * \brief Create a new pbuffer. + */ +GLXPbuffer +glXCreatePbuffer( Display *dpy, GLXFBConfig config, const int *attribList ) +{ + return NULL; +} + + +void +glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf ) +{ + free(pbuf); +} + + +GLXFBConfig * +glXChooseFBConfig( Display *dpy, int screen, const int *attribList, + int *nitems ) +{ + GLXFBConfig *f = (GLXFBConfig *) malloc(sizeof(GLXFBConfig)); + f->visInfo = glXChooseVisual( dpy, screen, (int *) attribList ); + if (f->visInfo) { + *nitems = 1; + return f; + } + else { + *nitems = 0; + free(f); + return NULL; + } +} + + +XVisualInfo * +glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ) +{ + /* XVisualInfo and GLXFBConfig are the same structure */ + (void) dpy; + return config.visInfo; +} + + /*@}*/ -- cgit v1.2.3 From a763123b35ac4f7bd1b3a47b5b3180f217a3b81d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 6 Dec 2003 17:20:10 +0000 Subject: glFBDev driver from embedded-2 branch. Probably won't be actively used/maintained, but bring it to the trunk so it doesn't get lost. --- include/GL/glfbdev.h | 145 +++++++ progs/fbdev/glfbdevtest.c | 524 +++++++++++++++++++++++++ src/mesa/drivers/fbdev/glfbdev.c | 828 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 1497 insertions(+) create mode 100644 include/GL/glfbdev.h create mode 100644 progs/fbdev/glfbdevtest.c create mode 100644 src/mesa/drivers/fbdev/glfbdev.c (limited to 'include') diff --git a/include/GL/glfbdev.h b/include/GL/glfbdev.h new file mode 100644 index 00000000000..cd6cdd5e51f --- /dev/null +++ b/include/GL/glfbdev.h @@ -0,0 +1,145 @@ +/* + * Mesa 3-D graphics library + * Version: 5.1 + * + * Copyright (C) 1999-2003 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. + */ + + +#ifndef GLFBDEV_H +#define GLFBDEV_H + + +/* avoid including linux/fb.h */ +struct fb_fix_screeninfo; +struct fb_var_screeninfo; + + +/* public types */ +typedef struct GLFBDevVisualRec *GLFBDevVisualPtr; +typedef struct GLFBDevBufferRec *GLFBDevBufferPtr; +typedef struct GLFBDevContextRec *GLFBDevContextPtr; + + +/* API version */ +#define GLFBDEV_VERSION_1_0 1 + + +/* For glFBDevCreateVisual */ +#define GLFBDEV_DOUBLE_BUFFER 100 +#define GLFBDEV_COLOR_INDEX 101 +#define GLFBDEV_DEPTH_SIZE 102 +#define GLFBDEV_STENCIL_SIZE 103 +#define GLFBDEV_ACCUM_SIZE 104 +#define GLFBDEV_LEVEL 105 +#define GLFBDEV_NONE 0 + +/* For glFBDevGetString */ +#define GLFBDEV_VERSION 200 +#define GLFBDEV_VENDOR 201 + + +/* Misc functions */ + +extern const char * +glFBDevGetString( int str ); + + +extern const void * +glFBDevGetProcAddress( const char *procName ); + + + +/** + * Create a GLFBDevVisual. + * \param fixInfo - needed to get the visual types, etc. + * \param varInfo - needed to get the bits_per_pixel, etc. + * \param attribs - for requesting depth, stencil, accum buffers, etc. + */ +extern GLFBDevVisualPtr +glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, + const struct fb_var_screeninfo *varInfo, + const int *attribs ); + +extern void +glFBDevDestroyVisual( GLFBDevVisualPtr visual ); + +extern int +glFBDevGetVisualAttrib( const GLFBDevVisualPtr visual, int attrib); + + + +/** + * Create a GLFBDevBuffer. + * \param fixInfo, varInfo - needed in order to get the screen size + * (resolution), etc. + * \param visual - as returned by glFBDevCreateVisual() + * \param frontBuffer - address of front color buffer + * \param backBuffer - address of back color buffer (may be NULL) + * \param size - size of the color buffer(s) in bytes. + */ +extern GLFBDevBufferPtr +glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo, + const struct fb_var_screeninfo *varInfo, + const GLFBDevVisualPtr visual, + void *frontBuffer, void *backBuffer, size_t size ); + +extern void +glFBDevDestroyBuffer( GLFBDevBufferPtr buffer ); + +extern int +glFBDevGetBufferAttrib( const GLFBDevBufferPtr buffer, int attrib); + +extern GLFBDevBufferPtr +glFBDevGetCurrentDrawBuffer( void ); + +extern GLFBDevBufferPtr +glFBDevGetCurrentReadBuffer( void ); + +extern void +glFBDevSwapBuffers( GLFBDevBufferPtr buffer ); + + + +/** + * Create a GLFBDevContext. + * \param visual - as created by glFBDevCreateVisual. + * \param share - specifies another context with which to share textures, + * display lists, etc. (may be NULL). + */ +extern GLFBDevContextPtr +glFBDevCreateContext( const GLFBDevVisualPtr visual, GLFBDevContextPtr share ); + +extern void +glFBDevDestroyContext( GLFBDevContextPtr context ); + +extern int +glFBDevGetContextAttrib( const GLFBDevContextPtr context, int attrib); + +extern GLFBDevContextPtr +glFBDevGetCurrentContext( void ); + +extern int +glFBDevMakeCurrent( GLFBDevContextPtr context, + GLFBDevBufferPtr drawBuffer, + GLFBDevBufferPtr readBuffer ); + + +#endif /* GLFBDEV_H */ diff --git a/progs/fbdev/glfbdevtest.c b/progs/fbdev/glfbdevtest.c new file mode 100644 index 00000000000..a461c55e2f8 --- /dev/null +++ b/progs/fbdev/glfbdevtest.c @@ -0,0 +1,524 @@ +/* + * Test the GLFBDev interface. Only tested with radeonfb driver!!!! + * + * Written by Brian Paul + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEFAULT_DEPTH 8 + +static struct fb_fix_screeninfo FixedInfo; +static struct fb_var_screeninfo VarInfo, OrigVarInfo; +static int DesiredDepth = 0; +static int OriginalVT = -1; +static int ConsoleFD = -1; +static int FrameBufferFD = -1; +static caddr_t FrameBuffer = (caddr_t) -1; +static caddr_t MMIOAddress = (caddr_t) -1; + + +static void +print_fixed_info(const struct fb_fix_screeninfo *fixed, const char *s) +{ + static const char *visuals[] = { + "MONO01", "MONO10", "TRUECOLOR", "PSEUDOCOLOR", + "DIRECTCOLOR", "STATIC_PSEUDOCOLOR" + }; + + printf("%s info -----------------------\n", s); + printf("id = %16s\n", fixed->id); + printf("smem_start = 0x%lx\n", fixed->smem_start); + printf("smem_len = %d (0x%x)\n", fixed->smem_len, fixed->smem_len); + printf("type = 0x%x\n", fixed->type); + printf("type_aux = 0x%x\n", fixed->type_aux); + printf("visual = 0x%x (%s)\n", fixed->visual, visuals[fixed->visual]); + printf("xpanstep = %d\n", fixed->xpanstep); + printf("ypanstep = %d\n", fixed->ypanstep); + printf("ywrapstep = %d\n", fixed->ywrapstep); + printf("line_length = %d\n", fixed->line_length); + printf("mmio_start = 0x%lx\n", fixed->mmio_start); + printf("mmio_len = %d (0x%x)\n", fixed->mmio_len, fixed->mmio_len); + printf("accel = 0x%x\n", fixed->accel); +} + + +static void +print_var_info(const struct fb_var_screeninfo *var, const char *s) +{ + printf("%s info -----------------------\n", s); + printf("xres = %d\n", var->xres); + printf("yres = %d\n", var->yres); + printf("xres_virtual = %d\n", var->xres_virtual); + printf("yres_virtual = %d\n", var->yres_virtual); + printf("xoffset = %d\n", var->xoffset); + printf("yoffset = %d\n", var->yoffset); + printf("bits_per_pixel = %d\n", var->bits_per_pixel); + printf("grayscale = %d\n", var->grayscale); + + printf("red.offset = %d length = %d msb_right = %d\n", + var->red.offset, var->red.length, var->red.msb_right); + printf("green.offset = %d length = %d msb_right = %d\n", + var->green.offset, var->green.length, var->green.msb_right); + printf("blue.offset = %d length = %d msb_right = %d\n", + var->blue.offset, var->blue.length, var->blue.msb_right); + printf("transp.offset = %d length = %d msb_right = %d\n", + var->transp.offset, var->transp.length, var->transp.msb_right); + + printf("nonstd = %d\n", var->nonstd); + printf("activate = %d\n", var->activate); + printf("height = %d mm\n", var->height); + printf("width = %d mm\n", var->width); + printf("accel_flags = 0x%x\n", var->accel_flags); + printf("pixclock = %d\n", var->pixclock); + printf("left_margin = %d\n", var->left_margin); + printf("right_margin = %d\n", var->right_margin); + printf("upper_margin = %d\n", var->upper_margin); + printf("lower_margin = %d\n", var->lower_margin); + printf("hsync_len = %d\n", var->hsync_len); + printf("vsync_len = %d\n", var->vsync_len); + printf("sync = %d\n", var->sync); + printf("vmode = %d\n", var->vmode); +} + + +static void +signal_handler(int signumber) +{ + signal(signumber, SIG_IGN); /* prevent recursion! */ + fprintf(stderr, "error: got signal %d (exiting)\n", signumber); + exit(1); +} + + +static void +initialize_fbdev( void ) +{ + char ttystr[1000]; + int fd, vtnumber, ttyfd; + int sz; + + (void) sz; + + if (geteuid()) { + fprintf(stderr, "error: you need to be root\n"); + exit(1); + } + +#if 1 + /* open the framebuffer device */ + FrameBufferFD = open("/dev/fb0", O_RDWR); + if (FrameBufferFD < 0) { + fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno)); + exit(1); + } +#endif + + /* open /dev/tty0 and get the vt number */ + if ((fd = open("/dev/tty0", O_WRONLY, 0)) < 0) { + fprintf(stderr, "error opening /dev/tty0\n"); + exit(1); + } + if (ioctl(fd, VT_OPENQRY, &vtnumber) < 0 || vtnumber < 0) { + fprintf(stderr, "error: couldn't get a free vt\n"); + exit(1); + } + close(fd); + + /* open the console tty */ + sprintf(ttystr, "/dev/tty%d", vtnumber); /* /dev/tty1-64 */ + ConsoleFD = open(ttystr, O_RDWR | O_NDELAY, 0); + if (ConsoleFD < 0) { + fprintf(stderr, "error couldn't open console fd\n"); + exit(1); + } + + /* save current vt number */ + { + struct vt_stat vts; + if (ioctl(ConsoleFD, VT_GETSTATE, &vts) == 0) + OriginalVT = vts.v_active; + } + + /* disconnect from controlling tty */ + ttyfd = open("/dev/tty", O_RDWR); + if (ttyfd >= 0) { + ioctl(ttyfd, TIOCNOTTY, 0); + close(ttyfd); + } + + /* some magic to restore the vt when we exit */ + { + struct vt_mode vt; + if (ioctl(ConsoleFD, VT_ACTIVATE, vtnumber) != 0) + printf("ioctl VT_ACTIVATE: %s\n", strerror(errno)); + if (ioctl(ConsoleFD, VT_WAITACTIVE, vtnumber) != 0) + printf("ioctl VT_WAITACTIVE: %s\n", strerror(errno)); + + if (ioctl(ConsoleFD, VT_GETMODE, &vt) < 0) { + fprintf(stderr, "error: ioctl VT_GETMODE: %s\n", strerror(errno)); + exit(1); + } + + vt.mode = VT_PROCESS; + vt.relsig = SIGUSR1; + vt.acqsig = SIGUSR1; + if (ioctl(ConsoleFD, VT_SETMODE, &vt) < 0) { + fprintf(stderr, "error: ioctl(VT_SETMODE) failed: %s\n", + strerror(errno)); + exit(1); + } + } + + /* go into graphics mode */ + if (ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) { + fprintf(stderr, "error: ioctl(KDSETMODE, KD_GRAPHICS) failed: %s\n", + strerror(errno)); + exit(1); + } + + +#if 0 + /* open the framebuffer device */ + FrameBufferFD = open("/dev/fb0", O_RDWR); + if (FrameBufferFD < 0) { + fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno)); + exit(1); + } +#endif + + /* Get the fixed screen info */ + if (ioctl(FrameBufferFD, FBIOGET_FSCREENINFO, &FixedInfo)) { + fprintf(stderr, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n", + strerror(errno)); + exit(1); + } + + print_fixed_info(&FixedInfo, "Fixed"); + + + /* get the variable screen info */ + if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &OrigVarInfo)) { + fprintf(stderr, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n", + strerror(errno)); + exit(1); + } + + print_var_info(&OrigVarInfo, "Orig Var"); + + /* operate on a copy */ + VarInfo = OrigVarInfo; + + /* set the depth, resolution, etc */ + DesiredDepth = 32; + if (DesiredDepth) + VarInfo.bits_per_pixel = DesiredDepth; + + if (VarInfo.bits_per_pixel == 16) { + VarInfo.red.offset = 11; + VarInfo.green.offset = 5; + VarInfo.blue.offset = 0; + VarInfo.red.length = 5; + VarInfo.green.length = 6; + VarInfo.blue.length = 5; + VarInfo.transp.offset = 0; + VarInfo.transp.length = 0; + } + else if (VarInfo.bits_per_pixel == 32) { + VarInfo.red.offset = 16; + VarInfo.green.offset = 8; + VarInfo.blue.offset = 0; + VarInfo.transp.offset = 24; + VarInfo.red.length = 8; + VarInfo.green.length = 8; + VarInfo.blue.length = 8; + VarInfo.transp.length = 8; + } + /* timing values taken from /etc/fb.modes (1280x1024 @ 75Hz) */ + VarInfo.xres_virtual = VarInfo.xres = 1280; + VarInfo.yres_virtual = VarInfo.yres = 1024; + VarInfo.pixclock = 7408; + VarInfo.left_margin = 248; + VarInfo.right_margin = 16; + VarInfo.upper_margin = 38; + VarInfo.lower_margin = 1; + VarInfo.hsync_len = 144; + VarInfo.vsync_len = 3; + + VarInfo.xoffset = 0; + VarInfo.yoffset = 0; + VarInfo.nonstd = 0; + VarInfo.vmode &= ~FB_VMODE_YWRAP; /* turn off scrolling */ + + /* set new variable screen info */ + if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) { + fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", + strerror(errno)); + exit(1); + } + + print_var_info(&VarInfo, "New Var"); + + if (FixedInfo.visual != FB_VISUAL_TRUECOLOR && + FixedInfo.visual != FB_VISUAL_DIRECTCOLOR) { + fprintf(stderr, "non-TRUE/DIRECT-COLOR visuals (0x%x) not supported by this demo.\n", FixedInfo.visual); + exit(1); + } + + /* initialize colormap */ + if (FixedInfo.visual == FB_VISUAL_DIRECTCOLOR) { + struct fb_cmap cmap; + unsigned short red[256], green[256], blue[256]; + int i; + + /* we're assuming 256 entries here */ + printf("initializing directcolor colormap\n"); + cmap.start = 0; + cmap.len = 256; + cmap.red = red; + cmap.green = green; + cmap.blue = blue; + cmap.transp = NULL; + for (i = 0; i < cmap.len; i++) { + red[i] = green[i] = blue[i] = (i << 8) | i; + } + if (ioctl(FrameBufferFD, FBIOPUTCMAP, (void *) &cmap) < 0) { + fprintf(stderr, "ioctl(FBIOPUTCMAP) failed [%d]\n", i); + } + } + + /* + * fbdev says the frame buffer is at offset zero, and the mmio region + * is immediately after. + */ + + /* mmap the framebuffer into our address space */ + FrameBuffer = (caddr_t) mmap(0, /* start */ + FixedInfo.smem_len, /* bytes */ + PROT_READ | PROT_WRITE, /* prot */ + MAP_SHARED, /* flags */ + FrameBufferFD, /* fd */ + 0 /* offset */); + if (FrameBuffer == (caddr_t) - 1) { + fprintf(stderr, "error: unable to mmap framebuffer: %s\n", + strerror(errno)); + exit(1); + } + printf("FrameBuffer = %p\n", FrameBuffer); + +#if 1 + /* mmap the MMIO region into our address space */ + MMIOAddress = (caddr_t) mmap(0, /* start */ + FixedInfo.mmio_len, /* bytes */ + PROT_READ | PROT_WRITE, /* prot */ + MAP_SHARED, /* flags */ + FrameBufferFD, /* fd */ + FixedInfo.smem_len /* offset */); + if (MMIOAddress == (caddr_t) - 1) { + fprintf(stderr, "error: unable to mmap mmio region: %s\n", + strerror(errno)); + } + printf("MMIOAddress = %p\n", MMIOAddress); + + /* try out some simple MMIO register reads */ + if (1) + { + typedef unsigned int CARD32; + typedef unsigned char CARD8; +#define RADEON_CONFIG_MEMSIZE 0x00f8 +#define RADEON_MEM_SDRAM_MODE_REG 0x0158 +#define MMIO_IN32(base, offset) \ + *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) +#define INREG(addr) MMIO_IN32(MMIOAddress, addr) + int sz, type; + const char *typeStr[] = {"SDR", "DDR", "64-bit SDR"}; + sz = INREG(RADEON_CONFIG_MEMSIZE); + type = INREG(RADEON_MEM_SDRAM_MODE_REG); + printf("RADEON_CONFIG_MEMSIZE = %d (%d MB)\n", sz, sz / 1024 / 1024); + printf("RADEON_MEM_SDRAM_MODE_REG >> 30 = %d (%s)\n", + type >> 30, typeStr[type>>30]); + } +#endif + +} + + +static void +shutdown_fbdev( void ) +{ + struct vt_mode VT; + + printf("cleaning up...\n"); + /* restore original variable screen info */ + if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &OrigVarInfo)) { + fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", + strerror(errno)); + exit(1); + } + + munmap(MMIOAddress, FixedInfo.mmio_len); + munmap(FrameBuffer, FixedInfo.smem_len); + close(FrameBufferFD); + + /* restore text mode */ + ioctl(ConsoleFD, KDSETMODE, KD_TEXT); + + /* set vt */ + if (ioctl(ConsoleFD, VT_GETMODE, &VT) != -1) { + VT.mode = VT_AUTO; + ioctl(ConsoleFD, VT_SETMODE, &VT); + } + + /* restore original vt */ + if (OriginalVT >= 0) { + ioctl(ConsoleFD, VT_ACTIVATE, OriginalVT); + OriginalVT = -1; + } + + close(ConsoleFD); +} + + +/* Borrowed from GLUT */ +static void +doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings) +{ + int i, j; + GLfloat theta, phi, theta1; + GLfloat cosTheta, sinTheta; + GLfloat cosTheta1, sinTheta1; + GLfloat ringDelta, sideDelta; + + ringDelta = 2.0 * M_PI / rings; + sideDelta = 2.0 * M_PI / nsides; + + theta = 0.0; + cosTheta = 1.0; + sinTheta = 0.0; + for (i = rings - 1; i >= 0; i--) { + theta1 = theta + ringDelta; + cosTheta1 = cos(theta1); + sinTheta1 = sin(theta1); + glBegin(GL_QUAD_STRIP); + phi = 0.0; + for (j = nsides; j >= 0; j--) { + GLfloat cosPhi, sinPhi, dist; + + phi += sideDelta; + cosPhi = cos(phi); + sinPhi = sin(phi); + dist = R + r * cosPhi; + + glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi); + glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi); + glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi); + glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi); + } + glEnd(); + theta = theta1; + cosTheta = cosTheta1; + sinTheta = sinTheta1; + } +} + + +static void +gltest( void ) +{ + static const int attribs[] = { + GLFBDEV_DOUBLE_BUFFER, + GLFBDEV_DEPTH_SIZE, 16, + GLFBDEV_NONE + }; + GLFBDevContextPtr ctx; + GLFBDevBufferPtr buf; + GLFBDevVisualPtr vis; + int bytes, r, g, b, a; + float ang; + + printf("GLFBDEV_VENDOR = %s\n", glFBDevGetString(GLFBDEV_VENDOR)); + printf("GLFBDEV_VERSION = %s\n", glFBDevGetString(GLFBDEV_VERSION)); + + /* framebuffer size */ + bytes = VarInfo.xres_virtual * VarInfo.yres_virtual * VarInfo.bits_per_pixel / 8; + + vis = glFBDevCreateVisual( &FixedInfo, &VarInfo, attribs ); + assert(vis); + + buf = glFBDevCreateBuffer( &FixedInfo, &VarInfo, vis, FrameBuffer, NULL, bytes ); + assert(buf); + + ctx = glFBDevCreateContext( vis, NULL ); + assert(buf); + + b = glFBDevMakeCurrent( ctx, buf, buf ); + assert(b); + + /*printf("GL_EXTENSIONS: %s\n", glGetString(GL_EXTENSIONS));*/ + glGetIntegerv(GL_RED_BITS, &r); + glGetIntegerv(GL_GREEN_BITS, &g); + glGetIntegerv(GL_BLUE_BITS, &b); + glGetIntegerv(GL_ALPHA_BITS, &a); + printf("RED_BITS=%d GREEN_BITS=%d BLUE_BITS=%d ALPHA_BITS=%d\n", + r, g, b, a); + + glClearColor(0.5, 0.5, 1.0, 0); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glFrustum(-1, 1, -1, 1, 2, 30); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0, 0, -15); + glViewport(0, 0, VarInfo.xres_virtual, VarInfo.yres_virtual); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_DEPTH_TEST); + + for (ang = 0; ang <= 180; ang += 15) { + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glPushMatrix(); + glRotatef(ang, 1, 0, 0); + doughnut(1, 3, 40, 20); + glPopMatrix(); + glFBDevSwapBuffers(buf); + } + + /* clean up */ + b = glFBDevMakeCurrent( NULL, NULL, NULL); + assert(b); + + glFBDevDestroyContext(ctx); + glFBDevDestroyBuffer(buf); + glFBDevDestroyVisual(vis); +} + + +int +main( int argc, char *argv[] ) +{ + signal(SIGUSR1, signal_handler); /* exit if someone tries a vt switch */ + signal(SIGSEGV, signal_handler); /* catch segfaults */ + + initialize_fbdev(); + gltest(); + shutdown_fbdev(); + + return 0; +} diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c new file mode 100644 index 00000000000..6d3ed01d7b4 --- /dev/null +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -0,0 +1,828 @@ +/* + * Mesa 3-D graphics library + * Version: 5.1 + * + * Copyright (C) 1999-2003 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. + */ + + +/* + * OpenGL (Mesa) interface for fbdev. + * For info about fbdev: + * http://www.tldp.org/HOWTO/Framebuffer-HOWTO.html + * + * known VGA modes + * Colours 640x400 640x480 800x600 1024x768 1152x864 1280x1024 1600x1200 + * --------+-------------------------------------------------------------- + * 4 bits | ? ? 0x302 ? ? ? ? + * 8 bits | 0x300 0x301 0x303 0x305 0x161 0x307 0x31C + * 15 bits | ? 0x310 0x313 0x316 0x162 0x319 0x31D + * 16 bits | ? 0x311 0x314 0x317 0x163 0x31A 0x31E + * 24 bits | ? 0x312 0x315 0x318 ? 0x31B 0x31F + * 32 bits | ? ? ? ? 0x164 ? + */ + + +#ifdef USE_GLFBDEV_DRIVER + +#include "glheader.h" +#include +#include "GL/glfbdev.h" +#include "context.h" +#include "extensions.h" +#include "imports.h" +#include "texformat.h" +#include "teximage.h" +#include "texstore.h" +#include "array_cache/acache.h" +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" +#include "tnl/tnl.h" +#include "tnl/t_context.h" +#include "tnl/t_pipeline.h" + + +#define PF_B8G8R8 1 +#define PF_B8G8R8A8 2 +#define PF_B5G6R5 3 +#define PF_B5G5R5 4 +#define PF_CI8 5 + + +/* + * Derived from Mesa's GLvisual class. + */ +struct GLFBDevVisualRec { + GLvisual glvisual; /* base class */ + struct fb_fix_screeninfo fix; + struct fb_var_screeninfo var; + int pixelFormat; +}; + +/* + * Derived from Mesa's GLframebuffer class. + */ +struct GLFBDevBufferRec { + GLframebuffer glframebuffer; /* base class */ + GLFBDevVisualPtr visual; + struct fb_fix_screeninfo fix; + struct fb_var_screeninfo var; + void *frontStart; + void *backStart; + size_t size; + GLuint bytesPerPixel; + GLuint rowStride; /* in bytes */ + GLubyte *frontBottom; /* pointer to last row */ + GLubyte *backBottom; /* pointer to last row */ + GLubyte *curBottom; /* = frontBottom or backBottom */ + GLboolean mallocBackBuffer; +}; + +/* + * Derived from Mesa's GLcontext class. + */ +struct GLFBDevContextRec { + GLcontext glcontext; /* base class */ + GLFBDevVisualPtr visual; + GLFBDevBufferPtr drawBuffer; + GLFBDevBufferPtr readBuffer; + GLFBDevBufferPtr curBuffer; +}; + + + +#define GLFBDEV_CONTEXT(CTX) ((GLFBDevContextPtr) (CTX)) +#define GLFBDEV_BUFFER(BUF) ((GLFBDevBufferPtr) (BUF)) + + +/**********************************************************************/ +/* Internal device driver functions */ +/**********************************************************************/ + + +static const GLubyte * +get_string(GLcontext *ctx, GLenum pname) +{ + (void) ctx; + switch (pname) { + case GL_RENDERER: + return (const GLubyte *) "Mesa glfbdev"; + default: + return NULL; + } +} + + +static void +update_state( GLcontext *ctx, GLuint new_state ) +{ + /* not much to do here - pass it on */ + _swrast_InvalidateState( ctx, new_state ); + _swsetup_InvalidateState( ctx, new_state ); + _ac_InvalidateState( ctx, new_state ); + _tnl_InvalidateState( ctx, new_state ); +} + + +static void +get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) +{ + const GLFBDevBufferPtr fbdevbuffer = (GLFBDevBufferPtr) buffer; + *width = fbdevbuffer->var.xres_virtual; + *height = fbdevbuffer->var.yres_virtual; +} + + +/* specifies the buffer for swrast span rendering/reading */ +static void +set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit ) +{ + GLFBDevContextPtr fbdevctx = GLFBDEV_CONTEXT(ctx); + GLFBDevBufferPtr fbdevbuf = GLFBDEV_BUFFER(buffer); + fbdevctx->curBuffer = fbdevbuf; + switch (bufferBit) { + case FRONT_LEFT_BIT: + fbdevbuf->curBottom = fbdevbuf->frontBottom; + break; + case BACK_LEFT_BIT: + fbdevbuf->curBottom = fbdevbuf->backBottom; + break; + default: + _mesa_problem(ctx, "bad bufferBit in set_buffer()"); + } +} + + +static void +init_core_functions( GLcontext *ctx ) +{ + ctx->Driver.GetString = get_string; + ctx->Driver.UpdateState = update_state; + ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; + ctx->Driver.GetBufferSize = get_buffer_size; + + ctx->Driver.Accum = _swrast_Accum; + ctx->Driver.Bitmap = _swrast_Bitmap; + ctx->Driver.Clear = _swrast_Clear; /* would be good to optimize */ + ctx->Driver.CopyPixels = _swrast_CopyPixels; + ctx->Driver.DrawPixels = _swrast_DrawPixels; + ctx->Driver.ReadPixels = _swrast_ReadPixels; + ctx->Driver.DrawBuffer = _swrast_DrawBuffer; + + ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format; + ctx->Driver.TexImage1D = _mesa_store_teximage1d; + ctx->Driver.TexImage2D = _mesa_store_teximage2d; + ctx->Driver.TexImage3D = _mesa_store_teximage3d; + ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; + ctx->Driver.TexSubImage2D = _mesa_store_texsubimage2d; + ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; + ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; + + ctx->Driver.CompressedTexImage1D = _mesa_store_compressed_teximage1d; + ctx->Driver.CompressedTexImage2D = _mesa_store_compressed_teximage2d; + ctx->Driver.CompressedTexImage3D = _mesa_store_compressed_teximage3d; + ctx->Driver.CompressedTexSubImage1D = _mesa_store_compressed_texsubimage1d; + ctx->Driver.CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d; + ctx->Driver.CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d; + + ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; + ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; + ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; + ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; + ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; + ctx->Driver.CopyColorTable = _swrast_CopyColorTable; + ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; + ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; + ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; +} + + +/* + * Generate code for span functions. + */ + +/* 24-bit BGR */ +#define NAME(PREFIX) PREFIX##_B8G8R8 +#define SPAN_VARS \ + const GLFBDevContextPtr fbdevctx = GLFBDEV_CONTEXT(ctx); \ + const GLFBDevBufferPtr fbdevbuf = fbdevctx->curBuffer; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLubyte *P = fbdevbuf->curBottom - (Y) * fbdevbuf->rowStride + (X) * 3 +#define INC_PIXEL_PTR(P) P += 3 +#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ + P[0] = B; P[1] = G; P[2] = R +#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ + P[0] = B; P[1] = G; P[2] = R +#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ + R = P[2]; G = P[1]; B = P[0]; A = CHAN_MAX + +#include "swrast/s_spantemp.h" + + +/* 32-bit BGRA */ +#define NAME(PREFIX) PREFIX##_B8G8R8A8 +#define SPAN_VARS \ + const GLFBDevContextPtr fbdevctx = GLFBDEV_CONTEXT(ctx); \ + const GLFBDevBufferPtr fbdevbuf = fbdevctx->curBuffer; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLubyte *P = fbdevbuf->curBottom - (Y) * fbdevbuf->rowStride + (X) * 4 +#define INC_PIXEL_PTR(P) P += 4 +#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ + P[0] = B; P[1] = G; P[2] = R; P[3] = 255 +#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ + P[0] = B; P[1] = G; P[2] = R; P[3] = A +#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ + R = P[2]; G = P[1]; B = P[0]; A = P[3] + +#include "swrast/s_spantemp.h" + + +/* 16-bit BGR (XXX implement dithering someday) */ +#define NAME(PREFIX) PREFIX##_B5G6R5 +#define SPAN_VARS \ + const GLFBDevContextPtr fbdevctx = GLFBDEV_CONTEXT(ctx); \ + const GLFBDevBufferPtr fbdevbuf = fbdevctx->curBuffer; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLushort *P = (GLushort *) (fbdevbuf->curBottom - (Y) * fbdevbuf->rowStride + (X) * 2) +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ + *P = ( (((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | ((B) >> 3) ) +#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ + *P = ( (((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | ((B) >> 3) ) +#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ + R = ( (((*P) >> 8) & 0xf8) | (((*P) >> 11) & 0x7) ); \ + G = ( (((*P) >> 3) & 0xfc) | (((*P) >> 5) & 0x3) ); \ + B = ( (((*P) << 3) & 0xf8) | (((*P) ) & 0x7) ); \ + A = CHAN_MAX + +#include "swrast/s_spantemp.h" + + +/* 15-bit BGR (XXX implement dithering someday) */ +#define NAME(PREFIX) PREFIX##_B5G5R5 +#define SPAN_VARS \ + const GLFBDevContextPtr fbdevctx = GLFBDEV_CONTEXT(ctx); \ + const GLFBDevBufferPtr fbdevbuf = fbdevctx->curBuffer; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLushort *P = (GLushort *) (fbdevbuf->curBottom - (Y) * fbdevbuf->rowStride + (X) * 2) +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ + *P = ( (((R) & 0xf8) << 7) | (((G) & 0xf8) << 2) | ((B) >> 3) ) +#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ + *P = ( (((R) & 0xf8) << 7) | (((G) & 0xf8) << 2) | ((B) >> 3) ) +#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ + R = ( (((*P) >> 7) & 0xf8) | (((*P) >> 10) & 0x7) ); \ + G = ( (((*P) >> 2) & 0xf8) | (((*P) >> 5) & 0x7) ); \ + B = ( (((*P) << 3) & 0xf8) | (((*P) ) & 0x7) ); \ + A = CHAN_MAX + +#include "swrast/s_spantemp.h" + + +/* 8-bit color index */ +#define NAME(PREFIX) PREFIX##_CI8 +#define SPAN_VARS \ + const GLFBDevContextPtr fbdevctx = GLFBDEV_CONTEXT(ctx); \ + const GLFBDevBufferPtr fbdevbuf = fbdevctx->curBuffer; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLubyte *P = fbdevbuf->curBottom - (Y) * fbdevbuf->rowStride + (X) +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_CI_PIXEL(P, CI) \ + P[0] = CI +#define FETCH_CI_PIXEL(CI, P) \ + CI = P[0] + +#include "swrast/s_spantemp.h" + +/**********************************************************************/ +/* Public API functions */ +/**********************************************************************/ + + +const char * +glFBDevGetString( int str ) +{ + switch (str) { + case GLFBDEV_VENDOR: + return "Mesa Project"; + case GLFBDEV_VERSION: + return "1.0.0"; + default: + return NULL; + } +} + + +const void * +glFBDevGetProcAddress( const char *procName ) +{ + struct name_address { + const char *name; + const void *func; + }; + static const struct name_address functions[] = { + { "glFBDevGetString", (void *) glFBDevGetString }, + { "glFBDevGetProcAddress", (void *) glFBDevGetProcAddress }, + { "glFBDevCreateVisual", (void *) glFBDevCreateVisual }, + { "glFBDevDestroyVisual", (void *) glFBDevDestroyVisual }, + { "glFBDevGetVisualAttrib", (void *) glFBDevGetVisualAttrib }, + { "glFBDevCreateBuffer", (void *) glFBDevCreateBuffer }, + { "glFBDevDestroyBuffer", (void *) glFBDevDestroyBuffer }, + { "glFBDevGetBufferAttrib", (void *) glFBDevGetBufferAttrib }, + { "glFBDevGetCurrentDrawBuffer", (void *) glFBDevGetCurrentDrawBuffer }, + { "glFBDevGetCurrentReadBuffer", (void *) glFBDevGetCurrentReadBuffer }, + { "glFBDevSwapBuffers", (void *) glFBDevSwapBuffers }, + { "glFBDevCreateContext", (void *) glFBDevCreateContext }, + { "glFBDevDestroyContext", (void *) glFBDevDestroyContext }, + { "glFBDevGetContextAttrib", (void *) glFBDevGetContextAttrib }, + { "glFBDevGetCurrentContext", (void *) glFBDevGetCurrentContext }, + { "glFBDevMakeCurrent", (void *) glFBDevMakeCurrent }, + { NULL, NULL } + }; + const struct name_address *entry; + for (entry = functions; entry->name; entry++) { + if (_mesa_strcmp(entry->name, procName) == 0) { + return entry->func; + } + } + return _glapi_get_proc_address(procName); +} + + +GLFBDevVisualPtr +glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, + const struct fb_var_screeninfo *varInfo, + const int *attribs ) +{ + GLFBDevVisualPtr vis; + const int *attrib; + GLboolean rgbFlag = GL_TRUE, dbFlag = GL_FALSE, stereoFlag = GL_FALSE; + GLint redBits = 0, greenBits = 0, blueBits = 0, alphaBits = 0; + GLint indexBits = 0, depthBits = 0, stencilBits = 0; + GLint accumRedBits = 0, accumGreenBits = 0; + GLint accumBlueBits = 0, accumAlphaBits = 0; + GLint numSamples = 0; + + ASSERT(fixInfo); + ASSERT(varInfo); + + vis = CALLOC_STRUCT(GLFBDevVisualRec); + if (!vis) + return NULL; + + vis->fix = *fixInfo; /* struct assignment */ + vis->var = *varInfo; /* struct assignment */ + + for (attrib = attribs; attrib && *attrib != GLFBDEV_NONE; attrib++) { + switch (*attrib) { + case GLFBDEV_DOUBLE_BUFFER: + dbFlag = GL_TRUE; + break; + case GLFBDEV_COLOR_INDEX: + rgbFlag = GL_FALSE; + break; + case GLFBDEV_DEPTH_SIZE: + depthBits = attrib[1]; + attrib++; + break; + case GLFBDEV_STENCIL_SIZE: + stencilBits = attrib[1]; + attrib++; + break; + case GLFBDEV_ACCUM_SIZE: + accumRedBits = accumGreenBits = accumBlueBits = accumAlphaBits + = attrib[1]; + attrib++; + break; + case GLFBDEV_LEVEL: + /* ignored for now */ + break; + default: + /* unexpected token */ + _mesa_free(vis); + return NULL; + } + } + + if (rgbFlag) { + redBits = varInfo->red.length; + greenBits = varInfo->green.length; + blueBits = varInfo->blue.length; + alphaBits = varInfo->transp.length; + + if ((fixInfo->visual == FB_VISUAL_TRUECOLOR || + fixInfo->visual == FB_VISUAL_DIRECTCOLOR) + && varInfo->bits_per_pixel == 24 + && varInfo->red.offset == 16 + && varInfo->green.offset == 8 + && varInfo->blue.offset == 0) { + vis->pixelFormat = PF_B8G8R8; + } + else if ((fixInfo->visual == FB_VISUAL_TRUECOLOR || + fixInfo->visual == FB_VISUAL_DIRECTCOLOR) + && varInfo->bits_per_pixel == 32 + && varInfo->red.offset == 16 + && varInfo->green.offset == 8 + && varInfo->blue.offset == 0 + && varInfo->transp.offset == 24) { + vis->pixelFormat = PF_B8G8R8A8; + } + else if ((fixInfo->visual == FB_VISUAL_TRUECOLOR || + fixInfo->visual == FB_VISUAL_DIRECTCOLOR) + && varInfo->bits_per_pixel == 16 + && varInfo->red.offset == 11 + && varInfo->green.offset == 5 + && varInfo->blue.offset == 0) { + vis->pixelFormat = PF_B5G6R5; + } + else if ((fixInfo->visual == FB_VISUAL_TRUECOLOR || + fixInfo->visual == FB_VISUAL_DIRECTCOLOR) + && varInfo->bits_per_pixel == 16 + && varInfo->red.offset == 10 + && varInfo->green.offset == 5 + && varInfo->blue.offset == 0) { + vis->pixelFormat = PF_B5G5R5; + } + else { + _mesa_problem(NULL, "Unsupported fbdev RGB visual/bitdepth!\n"); + /* + printf("fixInfo->visual = 0x%x\n", fixInfo->visual); + printf("varInfo->bits_per_pixel = %d\n", varInfo->bits_per_pixel); + printf("varInfo->red.offset = %d\n", varInfo->red.offset); + printf("varInfo->green.offset = %d\n", varInfo->green.offset); + printf("varInfo->blue.offset = %d\n", varInfo->blue.offset); + */ + _mesa_free(vis); + return NULL; + } + } + else { + indexBits = varInfo->bits_per_pixel; + if ((fixInfo->visual == FB_VISUAL_PSEUDOCOLOR || + fixInfo->visual == FB_VISUAL_STATIC_PSEUDOCOLOR) + && varInfo->bits_per_pixel == 8) { + vis->pixelFormat = PF_CI8; + } + else { + _mesa_problem(NULL, "Unsupported fbdev CI visual/bitdepth!\n"); + _mesa_free(vis); + return NULL; + } + } + + if (!_mesa_initialize_visual(&vis->glvisual, rgbFlag, dbFlag, stereoFlag, + redBits, greenBits, blueBits, alphaBits, + indexBits, depthBits, stencilBits, + accumRedBits, accumGreenBits, + accumBlueBits, accumAlphaBits, + numSamples)) { + /* something was invalid */ + _mesa_free(vis); + return NULL; + } + + return vis; +} + + +void +glFBDevDestroyVisual( GLFBDevVisualPtr visual ) +{ + if (visual) + _mesa_free(visual); +} + + +int +glFBDevGetVisualAttrib( const GLFBDevVisualPtr visual, int attrib) +{ + (void) visual; + (void) attrib; + return -1; +} + + + +GLFBDevBufferPtr +glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo, + const struct fb_var_screeninfo *varInfo, + const GLFBDevVisualPtr visual, + void *frontBuffer, void *backBuffer, size_t size ) +{ + GLFBDevBufferPtr buf; + + ASSERT(visual); + ASSERT(frontBuffer); + ASSERT(size > 0); + + if (visual->fix.visual != fixInfo->visual || + visual->fix.type != fixInfo->type || + visual->var.bits_per_pixel != varInfo->bits_per_pixel || + visual->var.grayscale != varInfo->grayscale || + visual->var.red.offset != varInfo->red.offset || + visual->var.green.offset != varInfo->green.offset || + visual->var.blue.offset != varInfo->blue.offset || + visual->var.transp.offset != varInfo->transp.offset) { + /* visual mismatch! */ + return NULL; + } + + buf = CALLOC_STRUCT(GLFBDevBufferRec); + if (!buf) + return NULL; + + _mesa_initialize_framebuffer(&buf->glframebuffer, &visual->glvisual, + visual->glvisual.haveDepthBuffer, + visual->glvisual.haveStencilBuffer, + visual->glvisual.haveAccumBuffer, + GL_FALSE); + + buf->fix = *fixInfo; /* struct assignment */ + buf->var = *varInfo; /* struct assignment */ + buf->visual = visual; /* ptr assignment */ + buf->frontStart = frontBuffer; + buf->size = size; + buf->bytesPerPixel = visual->var.bits_per_pixel / 8; + buf->rowStride = visual->var.xres_virtual * buf->bytesPerPixel; + buf->frontBottom = (GLubyte *) buf->frontStart + + (visual->var.yres_virtual - 1) * buf->rowStride; + + if (visual->glvisual.doubleBufferMode) { + if (backBuffer) { + buf->backStart = backBuffer; + buf->mallocBackBuffer = GL_FALSE; + } + else { + buf->backStart = _mesa_malloc(size); + if (!buf->backStart) { + _mesa_free_framebuffer_data(&buf->glframebuffer); + _mesa_free(buf); + return NULL; + } + buf->mallocBackBuffer = GL_TRUE; + } + buf->backBottom = (GLubyte *) buf->backStart + + (visual->var.yres_virtual - 1) * buf->rowStride; + buf->curBottom = buf->backBottom; + } + else { + buf->backStart = NULL; + buf->mallocBackBuffer = GL_FALSE; + buf->backBottom = NULL; + buf->curBottom = buf->frontBottom; + } + + return buf; +} + + +void +glFBDevDestroyBuffer( GLFBDevBufferPtr buffer ) +{ + if (buffer) { + /* check if destroying the current buffer */ + GLFBDevBufferPtr curDraw = glFBDevGetCurrentDrawBuffer(); + GLFBDevBufferPtr curRead = glFBDevGetCurrentReadBuffer(); + if (buffer == curDraw || buffer == curRead) { + glFBDevMakeCurrent( NULL, NULL, NULL); + } + if (buffer->mallocBackBuffer) { + _mesa_free(buffer->backStart); + } + /* free the software depth, stencil, accum buffers */ + _mesa_free_framebuffer_data(&buffer->glframebuffer); + _mesa_free(buffer); + } +} + + +int +glFBDevGetBufferAttrib( const GLFBDevBufferPtr buffer, int attrib) +{ + (void) buffer; + (void) attrib; + return -1; +} + + +GLFBDevBufferPtr +glFBDevGetCurrentDrawBuffer( void ) +{ + GLFBDevContextPtr fbdevctx = glFBDevGetCurrentContext(); + if (fbdevctx) + return fbdevctx->drawBuffer; + else + return NULL; +} + + +GLFBDevBufferPtr +glFBDevGetCurrentReadBuffer( void ) +{ + GLFBDevContextPtr fbdevctx = glFBDevGetCurrentContext(); + if (fbdevctx) + return fbdevctx->readBuffer; + else + return NULL; +} + + +void +glFBDevSwapBuffers( GLFBDevBufferPtr buffer ) +{ + GLFBDevContextPtr fbdevctx = glFBDevGetCurrentContext(); + + if (!buffer || !buffer->visual->glvisual.doubleBufferMode) + return; + + /* check if swapping currently bound buffer */ + if (fbdevctx->drawBuffer == buffer) { + /* flush pending rendering */ + _mesa_notifySwapBuffers(&fbdevctx->glcontext); + } + + ASSERT(buffer->frontStart); + ASSERT(buffer->backStart); + _mesa_memcpy(buffer->frontStart, buffer->backStart, buffer->size); +} + + +GLFBDevContextPtr +glFBDevCreateContext( const GLFBDevVisualPtr visual, GLFBDevContextPtr share ) +{ + GLFBDevContextPtr ctx; + GLcontext *glctx; + + ASSERT(visual); + + ctx = CALLOC_STRUCT(GLFBDevContextRec); + if (!ctx) + return NULL; + + if (!_mesa_initialize_context(&ctx->glcontext, &visual->glvisual, + share ? &share->glcontext : NULL, + (void *) ctx, GL_FALSE)) { + _mesa_free(ctx); + return NULL; + } + + ctx->visual = visual; + + /* Create module contexts */ + glctx = (GLcontext *) &ctx->glcontext; + init_core_functions( glctx ); + _swrast_CreateContext( glctx ); + _ac_CreateContext( glctx ); + _tnl_CreateContext( glctx ); + _swsetup_CreateContext( glctx ); + _swsetup_Wakeup( glctx ); + + /* swrast init */ + { + struct swrast_device_driver *swdd; + swdd = _swrast_GetDeviceDriverReference( glctx ); + swdd->SetBuffer = set_buffer; + if (visual->pixelFormat == PF_B8G8R8) { + swdd->WriteRGBASpan = write_rgba_span_B8G8R8; + swdd->WriteRGBSpan = write_rgb_span_B8G8R8; + swdd->WriteMonoRGBASpan = write_monorgba_span_B8G8R8; + swdd->WriteRGBAPixels = write_rgba_pixels_B8G8R8; + swdd->WriteMonoRGBAPixels = write_monorgba_pixels_B8G8R8; + swdd->ReadRGBASpan = read_rgba_span_B8G8R8; + swdd->ReadRGBAPixels = read_rgba_pixels_B8G8R8; + } + else if (visual->pixelFormat == PF_B8G8R8A8) { + swdd->WriteRGBASpan = write_rgba_span_B8G8R8A8; + swdd->WriteRGBSpan = write_rgb_span_B8G8R8A8; + swdd->WriteMonoRGBASpan = write_monorgba_span_B8G8R8A8; + swdd->WriteRGBAPixels = write_rgba_pixels_B8G8R8A8; + swdd->WriteMonoRGBAPixels = write_monorgba_pixels_B8G8R8A8; + swdd->ReadRGBASpan = read_rgba_span_B8G8R8A8; + swdd->ReadRGBAPixels = read_rgba_pixels_B8G8R8A8; + } + else if (visual->pixelFormat == PF_B5G6R5) { + swdd->WriteRGBASpan = write_rgba_span_B5G6R5; + swdd->WriteRGBSpan = write_rgb_span_B5G6R5; + swdd->WriteMonoRGBASpan = write_monorgba_span_B5G6R5; + swdd->WriteRGBAPixels = write_rgba_pixels_B5G6R5; + swdd->WriteMonoRGBAPixels = write_monorgba_pixels_B5G6R5; + swdd->ReadRGBASpan = read_rgba_span_B5G6R5; + swdd->ReadRGBAPixels = read_rgba_pixels_B5G6R5; + } + else if (visual->pixelFormat == PF_B5G5R5) { + swdd->WriteRGBASpan = write_rgba_span_B5G5R5; + swdd->WriteRGBSpan = write_rgb_span_B5G5R5; + swdd->WriteMonoRGBASpan = write_monorgba_span_B5G5R5; + swdd->WriteRGBAPixels = write_rgba_pixels_B5G5R5; + swdd->WriteMonoRGBAPixels = write_monorgba_pixels_B5G5R5; + swdd->ReadRGBASpan = read_rgba_span_B5G5R5; + swdd->ReadRGBAPixels = read_rgba_pixels_B5G5R5; + } + else if (visual->pixelFormat == PF_CI8) { + swdd->WriteCI32Span = write_index32_span_CI8; + swdd->WriteCI8Span = write_index8_span_CI8; + swdd->WriteMonoCISpan = write_monoindex_span_CI8; + swdd->WriteCI32Pixels = write_index_pixels_CI8; + swdd->WriteMonoCIPixels = write_monoindex_pixels_CI8; + swdd->ReadCI32Span = read_index_span_CI8; + swdd->ReadCI32Pixels = read_index_pixels_CI8; + } + else { + _mesa_printf("bad pixelformat: %d\n", visual->pixelFormat); + } + } + + /* use default TCL pipeline */ + { + TNLcontext *tnl = TNL_CONTEXT(glctx); + tnl->Driver.RunPipeline = _tnl_run_pipeline; + } + + _mesa_enable_sw_extensions(glctx); + + return ctx; +} + + +void +glFBDevDestroyContext( GLFBDevContextPtr context ) +{ + GLFBDevContextPtr fbdevctx = glFBDevGetCurrentContext(); + + if (context) { + if (fbdevctx == context) { + /* destroying current context */ + _mesa_make_current2(NULL, NULL, NULL); + _mesa_notifyDestroy(&context->glcontext); + } + _mesa_free_context_data(&context->glcontext); + _mesa_free(context); + } +} + + +int +glFBDevGetContextAttrib( const GLFBDevContextPtr context, int attrib) +{ + (void) context; + (void) attrib; + return -1; +} + + +GLFBDevContextPtr +glFBDevGetCurrentContext( void ) +{ + GET_CURRENT_CONTEXT(ctx); + return (GLFBDevContextPtr) ctx; +} + + +int +glFBDevMakeCurrent( GLFBDevContextPtr context, + GLFBDevBufferPtr drawBuffer, + GLFBDevBufferPtr readBuffer ) +{ + if (context && drawBuffer && readBuffer) { + /* Make sure the context's visual and the buffers' visuals match. + * XXX we might do this by comparing specific fields like bits_per_pixel, + * visual, etc. in the future. + */ + if (context->visual != drawBuffer->visual || + context->visual != readBuffer->visual) { + return 0; + } + _mesa_make_current2( &context->glcontext, + &drawBuffer->glframebuffer, + &readBuffer->glframebuffer ); + context->drawBuffer = drawBuffer; + context->readBuffer = readBuffer; + context->curBuffer = drawBuffer; + } + else { + /* unbind */ + _mesa_make_current2( NULL, NULL, NULL ); + } + + return 1; +} + +#endif /* USE_GLFBDEV_DRIVER */ + -- cgit v1.2.3 From 3abad78e26e561ffb30ef63a559eb8f9682e4f44 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 8 Dec 2003 15:00:24 +0000 Subject: Can't include when building XFree86 server - define ptrdiff_t to int instead --- include/GL/gl.h | 4 ++++ include/GL/glext.h | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 1f53ff47907..40d80d2eec7 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -38,7 +38,11 @@ */ #if !defined(__SCITECH_SNAP__) +#ifndef XFree86Server #include /* to get ptrdiff_t, used below */ +#else +#define ptrdiff_t int +#endif #if defined(__BEOS__) #include /* to get some BeOS-isms */ diff --git a/include/GL/glext.h b/include/GL/glext.h index 777cc03936a..7f1f938c4ce 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -3290,7 +3290,11 @@ typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); #define GL_ARB_vertex_buffer_object 1 /* GL types for handling large vertex buffer objects */ /* Only used by this extension for now; later needs to be moved earlier in glext.h */ +#ifndef XFree86Server #include +#else +#define ptrdiff_t int +#endif typedef ptrdiff_t GLintptrARB; typedef ptrdiff_t GLsizeiptrARB; #ifdef GL_GLEXT_PROTOTYPES -- cgit v1.2.3 From 18343db1d86aa98dddf17f010dc94d5d98445e27 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Mon, 8 Dec 2003 16:57:21 +0000 Subject: reverse Keith's 'XFree86Server' glue. --- include/GL/gl.h | 4 ---- include/GL/glext.h | 4 ---- 2 files changed, 8 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 40d80d2eec7..1f53ff47907 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -38,11 +38,7 @@ */ #if !defined(__SCITECH_SNAP__) -#ifndef XFree86Server #include /* to get ptrdiff_t, used below */ -#else -#define ptrdiff_t int -#endif #if defined(__BEOS__) #include /* to get some BeOS-isms */ diff --git a/include/GL/glext.h b/include/GL/glext.h index 7f1f938c4ce..777cc03936a 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -3290,11 +3290,7 @@ typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); #define GL_ARB_vertex_buffer_object 1 /* GL types for handling large vertex buffer objects */ /* Only used by this extension for now; later needs to be moved earlier in glext.h */ -#ifndef XFree86Server #include -#else -#define ptrdiff_t int -#endif typedef ptrdiff_t GLintptrARB; typedef ptrdiff_t GLsizeiptrARB; #ifdef GL_GLEXT_PROTOTYPES -- cgit v1.2.3 From a9fc4b1b1c12b9f5cd69638b3fd79b876935541b Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 11 Dec 2003 13:10:20 +0000 Subject: Remove dead file glcore-new.h --- include/GL/internal/glcore-new.h | 424 --------------------------------------- 1 file changed, 424 deletions(-) delete mode 100644 include/GL/internal/glcore-new.h (limited to 'include') diff --git a/include/GL/internal/glcore-new.h b/include/GL/internal/glcore-new.h deleted file mode 100644 index cd65286bc7a..00000000000 --- a/include/GL/internal/glcore-new.h +++ /dev/null @@ -1,424 +0,0 @@ -#ifndef __gl_core_h_ -#define __gl_core_h_ - -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -** -** $Date: 2001/01/08 03:56:53 $ $Revision: 1.1 $ -** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/internal/Attic/glcore-new.h,v 1.1 2001/01/08 03:56:53 keithw Exp $ -*/ - -#ifdef XFree86LOADER -#include "xf86_ansic.h" -#else -#include -#endif - -typedef struct __GLcontextRec __GLcontext; -typedef struct __GLinterfaceRec __GLinterface; - -/* -** This file defines the interface between the GL core and the surrounding -** "operating system" that supports it (currently the GLX or WGL extensions). -** -** Members (data and function pointers) are documented as imported or -** exported according to how they are used by the core rendering functions. -** Imported members are initialized by the "operating system" and used by -** the core functions. Exported members are initialized by the core functions -** and used by the "operating system". -*/ - -/* -** Mode and limit information for a context. This information is -** kept around in the context so that values can be used during -** command execution, and for returning information about the -** context to the application. -*/ -typedef struct __GLcontextModesRec { - GLboolean rgbMode; - GLboolean colorIndexMode; - GLboolean doubleBufferMode; - GLboolean stereoMode; - - GLboolean haveAccumBuffer; - GLboolean haveDepthBuffer; - GLboolean haveStencilBuffer; - - GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */ - GLuint redMask, greenMask, blueMask, alphaMask; - GLint rgbBits; /* total bits for rgb */ - GLint indexBits; /* total bits for colorindex */ - - GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits; - GLint depthBits; - GLint stencilBits; - - GLint numAuxBuffers; - - GLint level; - - GLint pixmapMode; -} __GLcontextModes; - -/************************************************************************/ - -/* -** Structure used for allocating and freeing drawable private memory. -** (like software buffers, for example). -** -** The memory allocation routines are provided by the surrounding -** "operating system" code, and they are to be used for allocating -** software buffers and things which are associated with the drawable, -** and used by any context which draws to that drawable. There are -** separate memory allocation functions for drawables and contexts -** since drawables and contexts can be created and destroyed independently -** of one another, and the "operating system" may want to use separate -** allocation arenas for each. -** -** The freePrivate function is filled in by the core routines when they -** allocates software buffers, and stick them in "private". The freePrivate -** function will destroy anything allocated to this drawable (to be called -** when the drawable is destroyed). -*/ -typedef struct __GLdrawableRegionRec __GLdrawableRegion; -typedef struct __GLdrawableBufferRec __GLdrawableBuffer; -typedef struct __GLdrawablePrivateRec __GLdrawablePrivate; - -typedef struct __GLregionRectRec { - /* lower left (inside the rectangle) */ - GLint x0, y0; - /* upper right (outside the rectangle) */ - GLint x1, y1; -} __GLregionRect; - -struct __GLdrawableRegionRec { - GLint numRects; - __GLregionRect *rects; - __GLregionRect boundingRect; -}; - -/************************************************************************/ - -/* masks for the buffers */ -#define __GL_FRONT_BUFFER_MASK 0x00000001 -#define __GL_FRONT_LEFT_BUFFER_MASK 0x00000001 -#define __GL_FRONT_RIGHT_BUFFER_MASK 0x00000002 -#define __GL_BACK_BUFFER_MASK 0x00000004 -#define __GL_BACK_LEFT_BUFFER_MASK 0x00000004 -#define __GL_BACK_RIGHT_BUFFER_MASK 0x00000008 -#define __GL_ACCUM_BUFFER_MASK 0x00000010 -#define __GL_DEPTH_BUFFER_MASK 0x00000020 -#define __GL_STENCIL_BUFFER_MASK 0x00000040 -#define __GL_AUX_BUFFER_MASK(i) (0x0000080 << (i)) - -#define __GL_ALL_BUFFER_MASK 0xffffffff - -/* what Resize routines return if resize resorted to fallback case */ -#define __GL_BUFFER_FALLBACK 0x10 - -typedef void (*__GLbufFallbackInitFn)(__GLdrawableBuffer *buf, - __GLdrawablePrivate *glPriv, GLint bits); -typedef void (*__GLbufMainInitFn)(__GLdrawableBuffer *buf, - __GLdrawablePrivate *glPriv, GLint bits, - __GLbufFallbackInitFn back); - -/* -** A drawable buffer -** -** This data structure describes the context side of a drawable. -** -** According to the spec there could be multiple contexts bound to the same -** drawable at the same time (from different threads). In order to avoid -** multiple-access conflicts, locks are used to serialize access. When a -** thread needs to access (read or write) a member of the drawable, it takes -** a lock first. Some of the entries in the drawable are treated "mostly -** constant", so we take the freedom of allowing access to them without -** taking a lock (for optimization reasons). -** -** For more details regarding locking, see buffers.h in the GL core -*/ -struct __GLdrawableBufferRec { - /* - ** Buffer dimensions - */ - GLint width, height, depth; - - /* - ** Framebuffer base address - */ - void *base; - - /* - ** Framebuffer size (in bytes) - */ - GLuint size; - - /* - ** Size (in bytes) of each element in the framebuffer - */ - GLuint elementSize; - GLuint elementSizeLog2; - - /* - ** Element skip from one scanline to the next. - ** If the buffer is part of another buffer (for example, fullscreen - ** front buffer), outerWidth is the width of that buffer. - */ - GLint outerWidth; - - /* - ** outerWidth * elementSize - */ - GLint byteWidth; - - /* - ** Allocation/deallocation is done based on this handle. A handle - ** is conceptually different from the framebuffer 'base'. - */ - void *handle; - - /* imported */ - GLboolean (*resize)(__GLdrawableBuffer *buf, - GLint x, GLint y, GLuint width, GLuint height, - __GLdrawablePrivate *glPriv, GLuint bufferMask); - void (*lock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); - void (*unlock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); - void (*fill)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, - GLuint val, GLint x, GLint y, GLint w, GLint h); - void (*free)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); - - /* exported */ - void (*freePrivate)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); -#ifdef __cplusplus - void *privatePtr; -#else - void *private; -#endif - - /* private */ - void *other; /* implementation private data */ - __GLbufMainInitFn mainInit; - __GLbufFallbackInitFn fallbackInit; -}; - -/* -** The context side of the drawable private -*/ -struct __GLdrawablePrivateRec { - /* - ** Drawable Modes - */ - __GLcontextModes *modes; - - /* - ** Drawable size - */ - GLuint width, height; - - /* - ** Origin in screen coordinates of the drawable - */ - GLint xOrigin, yOrigin; -#ifdef __GL_ALIGNED_BUFFERS - /* - ** Drawable offset from screen origin - */ - GLint xOffset, yOffset; - - /* - ** Alignment restriction - */ - GLint xAlignment, yAlignment; -#endif - /* - ** Should we invert the y axis? - */ - GLint yInverted; - - /* - ** Mask specifying which buffers are renderable by the hw - */ - GLuint accelBufferMask; - - /* - ** the buffers themselves - */ - __GLdrawableBuffer frontBuffer; - __GLdrawableBuffer backBuffer; - __GLdrawableBuffer accumBuffer; - __GLdrawableBuffer depthBuffer; - __GLdrawableBuffer stencilBuffer; -#if __GL_NUMBER_OF_AUX_BUFFERS > 0 - __GLdrawableBuffer *auxBuffer; -#endif - - __GLdrawableRegion ownershipRegion; - - /* - ** Lock for the drawable private structure - */ - void *lock; -#ifdef DEBUG - /* lock debugging info */ - int lockRefCount; - int lockLine[10]; - char *lockFile[10]; -#endif - - /* imported */ - void *(*malloc)(size_t size); - void *(*calloc)(size_t numElem, size_t elemSize); - void *(*realloc)(void *oldAddr, size_t newSize); - void (*free)(void *addr); - - GLboolean (*addSwapRect)(__GLdrawablePrivate *glPriv, - GLint x, GLint y, GLsizei width, GLsizei height); - void (*setClipRect)(__GLdrawablePrivate *glPriv, - GLint x, GLint y, GLsizei width, GLsizei height); - void (*updateClipRegion)(__GLdrawablePrivate *glPriv); - GLboolean (*resize)(__GLdrawablePrivate *glPriv); - void (*getDrawableSize)(__GLdrawablePrivate *glPriv, - GLint *x, GLint *y, GLuint *width, GLuint *height); - - void (*lockDP)(__GLdrawablePrivate *glPriv, __GLcontext *gc); - void (*unlockDP)(__GLdrawablePrivate *glPriv); - - /* exported */ - void *wsPriv; /* pointer to the window system DrawablePrivate */ -#ifdef __cplusplus - void *privatePtr; -#else - void *private; -#endif - void (*freePrivate)(__GLdrawablePrivate *); - - /* client data */ - void *other; -}; - -/* -** Macros to lock/unlock the drawable private -*/ -#if defined(DEBUG) -#define __GL_LOCK_DP(glPriv,gc) \ - (*(glPriv)->lockDP)(glPriv,gc); \ - (glPriv)->lockLine[(glPriv)->lockRefCount] = __LINE__; \ - (glPriv)->lockFile[(glPriv)->lockRefCount] = __FILE__; \ - (glPriv)->lockRefCount++ -#define __GL_UNLOCK_DP(glPriv) \ - (glPriv)->lockRefCount--; \ - (glPriv)->lockLine[(glPriv)->lockRefCount] = 0; \ - (glPriv)->lockFile[(glPriv)->lockRefCount] = NULL; \ - (*(glPriv)->unlockDP)(glPriv) -#else /* DEBUG */ -#define __GL_LOCK_DP(glPriv,gc) (*(glPriv)->lockDP)(glPriv,gc) -#define __GL_UNLOCK_DP(glPriv) (*(glPriv)->unlockDP)(glPriv) -#endif /* DEBUG */ - - -/* -** Procedures which are imported by the GL from the surrounding -** "operating system". Math functions are not considered part of the -** "operating system". -*/ -typedef struct __GLimportsRec { - /* Memory management */ - void * (*malloc)(__GLcontext *gc, size_t size); - void *(*calloc)(__GLcontext *gc, size_t numElem, size_t elemSize); - void *(*realloc)(__GLcontext *gc, void *oldAddr, size_t newSize); - void (*free)(__GLcontext *gc, void *addr); - - /* Error handling */ - void (*warning)(__GLcontext *gc, char *fmt); - void (*fatal)(__GLcontext *gc, char *fmt); - - /* other system calls */ - char *(CAPI *getenv)(__GLcontext *gc, const char *var); - int (CAPI *atoi)(__GLcontext *gc, const char *str); - int (CAPI *sprintf)(__GLcontext *gc, char *str, const char *fmt, ...); - void *(CAPI *fopen)(__GLcontext *gc, const char *path, const char *mode); - int (CAPI *fclose)(__GLcontext *gc, void *stream); - int (CAPI *fprintf)(__GLcontext *gc, void *stream, const char *fmt, ...); - - /* Drawing surface management */ - __GLdrawablePrivate *(*getDrawablePrivate)(__GLcontext *gc); - - /* Pointer to the window system context */ - void *wscx; - - /* Operating system dependent data goes here */ - void *other; -} __GLimports; - -/************************************************************************/ - -/* -** Procedures which are exported by the GL to the surrounding "operating -** system" so that it can manage multiple GL context's. -*/ -typedef struct __GLexportsRec { - /* Context management (return GL_FALSE on failure) */ - GLboolean (*destroyContext)(__GLcontext *gc); - GLboolean (*loseCurrent)(__GLcontext *gc); - GLboolean (*makeCurrent)(__GLcontext *gc); - GLboolean (*shareContext)(__GLcontext *gc, __GLcontext *gcShare); - GLboolean (*copyContext)(__GLcontext *dst, const __GLcontext *src, GLuint mask); - GLboolean (*forceCurrent)(__GLcontext *gc); - - /* Drawing surface notification callbacks */ - GLboolean (*notifyResize)(__GLcontext *gc); - void (*notifyDestroy)(__GLcontext *gc); - void (*notifySwapBuffers)(__GLcontext *gc); - - /* Dispatch table override control for external agents like libGLS */ - struct __GLdispatchStateRec* (*dispatchExec)(__GLcontext *gc); - void (*beginDispatchOverride)(__GLcontext *gc); - void (*endDispatchOverride)(__GLcontext *gc); -} __GLexports; - -/************************************************************************/ - -/* -** This must be the first member of a __GLcontext structure. This is the -** only part of a context that is exposed to the outside world; everything -** else is opaque. -*/ -struct __GLinterfaceRec { - __GLimports imports; - __GLexports exports; -}; - -extern __GLcontext *__glCoreCreateContext(__GLimports *, __GLcontextModes *); -extern void __glCoreNopDispatch(void); - -#endif /* __gl_core_h_ */ -- cgit v1.2.3 From e0ee87422be17a76e11241c408a3b85b7495540c Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 11 Dec 2003 15:47:43 +0000 Subject: Quash annoying compiler warning --- include/GL/glx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 5feb013bae0..b34b2ceaec8 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -293,7 +293,7 @@ extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable, /* GLX 1.4 and later */ -extern void (*glXGetProcAddress(const GLubyte *procname))(); +extern void (*glXGetProcAddress(const GLubyte *procname))( void ); #ifndef GLX_GLXEXT_LEGACY -- cgit v1.2.3 From c3fb2558f036ca8dd9f9a62269b57636ca3b5e4c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 11 Dec 2003 23:55:55 +0000 Subject: replace gl/mesa_wgl.h with GL/mesa_wgl.h (Simon Goodall) --- include/GL/gl.h | 2 +- src/glu/mesa/gluP.h | 2 +- src/mesa/main/glheader.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 1f53ff47907..652689c48bd 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -85,7 +85,7 @@ #endif #if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__) -#include +#include #endif #if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED diff --git a/src/glu/mesa/gluP.h b/src/glu/mesa/gluP.h index 6a65f751496..965bc7eb8cf 100644 --- a/src/glu/mesa/gluP.h +++ b/src/glu/mesa/gluP.h @@ -109,7 +109,7 @@ typedef unsigned long COLORREF; typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR; typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT; typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR; -#include +#include #endif diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h index 78b20f809d2..a1dc0193039 100644 --- a/src/mesa/main/glheader.h +++ b/src/mesa/main/glheader.h @@ -164,7 +164,7 @@ typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIP typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT; typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR; #if !defined(GLX_USE_MESA) -#include +#include #endif #endif -- cgit v1.2.3 From 3b81ccd826271925bbc9286df84a802027645875 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Fri, 12 Dec 2003 22:35:02 +0000 Subject: fix for C++ --- include/GL/internal/glcore.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/GL/internal/glcore.h b/include/GL/internal/glcore.h index 140b3991687..7080b7ce74e 100644 --- a/include/GL/internal/glcore.h +++ b/include/GL/internal/glcore.h @@ -268,7 +268,11 @@ struct __GLdrawableBufferRec { /* exported */ void (*freePrivate)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv); +#ifdef __cplusplus + void *privatePtr; +#else void *private; +#endif /* private */ void *other; /* implementation private data */ @@ -359,7 +363,11 @@ struct __GLdrawablePrivateRec { void (*unlockDP)(__GLdrawablePrivate *glPriv); /* exported */ +#ifdef __cplusplus + void *privatePtr; +#else void *private; +#endif void (*freePrivate)(__GLdrawablePrivate *); /* client data */ -- cgit v1.2.3 From e9e98405e720845f06f7a375585491e938f4dacd Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Fri, 19 Dec 2003 11:26:46 +0000 Subject: DMesa: removed MGA2064W driver DMesa: added capability to query visuals fxMesa: WGL_3DFX_gamma_control fxMesa: minor fixes to interface (fxQueryHardware vs fxMesaSelect...) --- Makefile.DJ | 3 - Makefile.X11 | 3 +- docs/README.DJ | 33 ++- include/GL/dmesa.h | 3 +- include/GL/fxmesa.h | 4 +- progs/demos/tunnel2.c | 6 +- src/mesa/Makefile.DJ | 17 -- src/mesa/drivers/dos/dmesa.c | 455 ++++-------------------------------- src/mesa/drivers/dos/internal.h | 9 +- src/mesa/drivers/dos/vesa.c | 5 +- src/mesa/drivers/dos/vga.c | 5 +- src/mesa/drivers/dos/video.c | 62 ++++- src/mesa/drivers/dos/video.h | 5 +- src/mesa/drivers/glide/fxapi.c | 68 +++--- src/mesa/drivers/glide/fxg.c | 3 + src/mesa/drivers/glide/fxopengl.def | 1 - src/mesa/drivers/glide/fxwgl.c | 23 ++ src/mesa/drivers/x11/xm_api.c | 6 +- 18 files changed, 211 insertions(+), 500 deletions(-) (limited to 'include') diff --git a/Makefile.DJ b/Makefile.DJ index f7c8277fe5f..93983f9165e 100644 --- a/Makefile.DJ +++ b/Makefile.DJ @@ -43,9 +43,6 @@ # As a consequence, you'll need the DJGPP Glide3 # library to build any application. # default = no -# MATROX=1 build for Matrox Millennium I (MGA2064W) cards. -# This is experimental and not intensively tested. -# default = no # HAVE_X86=1 optimize for i386. # default = no # HAVE_MMX=1 allow MMX specializations, provided your assembler diff --git a/Makefile.X11 b/Makefile.X11 index 85a59375eea..f45e21117bd 100644 --- a/Makefile.X11 +++ b/Makefile.X11 @@ -1,4 +1,4 @@ -# $Id: Makefile.X11,v 1.102 2003/12/17 15:11:41 brianp Exp $ +# $Id: Makefile.X11,v 1.103 2003/12/19 11:26:46 dborca Exp $ # Mesa 3-D graphics library # Version: 5.1 @@ -541,7 +541,6 @@ LIB_FILES = \ $(DIRECTORY)/src/mesa/drivers/beos/*.h \ $(DIRECTORY)/src/mesa/drivers/common/*.[ch] \ $(DIRECTORY)/src/mesa/drivers/dos/*.[chS] \ - $(DIRECTORY)/src/mesa/drivers/dos/mga/*.[ch] \ $(DIRECTORY)/src/mesa/drivers/dri/common/*.[ch] \ $(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \ $(DIRECTORY)/src/mesa/drivers/glide/*.[ch] \ diff --git a/docs/README.DJ b/docs/README.DJ index d8bb589f083..446e8d9023d 100644 --- a/docs/README.DJ +++ b/docs/README.DJ @@ -1,4 +1,4 @@ - Mesa 5.1 DOS/DJGPP Port v1.4 + Mesa 6.0 DOS/DJGPP Port v1.5 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -6,7 +6,7 @@ Description: ~~~~~~~~~~~~ -Well, guess what... this is the DOS port of Mesa 5.1, for DJGPP fans... Whoa! +Well, guess what... this is the DOS port of Mesa 6.0, for DJGPP fans... Whoa! The driver has its origins in ddsample.c, written by Brian Paul and found by me in Mesa 3.4.2. @@ -42,9 +42,6 @@ Available options: As a consequence, you'll need the DJGPP Glide3 library to build any application. default = no - MATROX=1 build for Matrox Millennium I (MGA2064W) cards. - This is experimental and not intensively tested. - default = no HAVE_X86=1 optimize for i386. default = no HAVE_MMX=1 allow MMX specializations, provided your assembler @@ -103,9 +100,8 @@ FAQ: 2. Using Mesa for DJGPP Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better... - A) Is that a question? If you have a 3dfx Voodoo Banshee or higher card, - you're lucky (check http://sourceforge.net/projects/glide for the DJGPP - port). If you have a Matrox Millennium I card, you just MIGHT be lucky... + A) Is that a question? If you have a 3dfx Voodoo^2 or higher card, you're + lucky (check http://sourceforge.net/projects/glide for the DJGPP port). If you haven't, sorry; everything is done in software. Suggestions? Q) I tried to set refresh rate w/ DMesa, but without success. @@ -119,6 +115,23 @@ FAQ: lazy programmer and I found that the easiest way to keep buffer handling at peak performance ;-). + Q) How do I query for a list of available video modes to choose as a visual? + A) This is an ugly hack, for which I'm sure I'll burn in hell. + First, query for a list of modes: + n = DMesaGetIntegerv(DMESA_GET_VIDEO_MODES, NULL); + If `n' is strictly positive, you allocate an array of pointers to a given + struct (which is guaranteed to be extended only - not changed in future): + struct { + int xres, yres; + int bpp; + } **l = malloc(n * sizeof(void **)); + Now pass the newly allocated buffer to fill in: + DMesaGetIntegerv(DMESA_GET_VIDEO_MODES, (GLint *)l); + And collect the info: + for (i = 0; i < n; i++) { + printf("%dx%d:%d\n", l[i]->xres, l[i]->yres, l[i]->bpp); + } + Q) The GLUT is incomplete. A) See below. @@ -217,6 +230,10 @@ v1.4 (dec-2003) * minor changes to PC_HW/timer interface x hacked and slashed the 3dfx driver (w/ help from Hiroshi Morii) +v1.5 (dec-2003) + + added interface to query available "visuals" (GLFW - Marcus Geelnard) + - removed Matrox Millennium MGA2064W driver + Contact: diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h index 46aa4e22608..364792ac1ab 100644 --- a/include/GL/dmesa.h +++ b/include/GL/dmesa.h @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.4 for Mesa + * DOS/DJGPP device driver v1.5 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@users.sourceforge.net @@ -135,6 +135,7 @@ void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue); */ #define DMESA_GET_SCREEN_SIZE 0x0100 #define DMESA_GET_DRIVER_CAPS 0x0200 +#define DMESA_GET_VIDEO_MODES 0x0300 #define DMESA_DRIVER_SWDB_BIT 0x1 /* software double-buffered */ #define DMESA_DRIVER_LLWO_BIT 0x2 /* lower-left window origin */ diff --git a/include/GL/fxmesa.h b/include/GL/fxmesa.h index fd3dbaeac5b..5c63a8db658 100644 --- a/include/GL/fxmesa.h +++ b/include/GL/fxmesa.h @@ -73,7 +73,7 @@ GLAPI fxMesaContext GLAPIENTRY fxMesaCreateBestContext(GLuint win, const GLint attribList[]); GLAPI void GLAPIENTRY fxMesaDestroyContext(fxMesaContext ctx); -GLAPI GLboolean GLAPIENTRY fxMesaSelectCurrentBoard(int n); +GLAPI GLint GLAPIENTRY fxMesaSelectCurrentBoard(int n); GLAPI void GLAPIENTRY fxMesaMakeCurrent(fxMesaContext ctx); @@ -85,8 +85,6 @@ GLAPI void GLAPIENTRY fxMesaSetNearFar(GLfloat nearVal, GLfloat farVal); GLAPI void GLAPIENTRY fxMesaUpdateScreenSize(fxMesaContext ctx); -GLAPI GLboolean GLAPIENTRY fxQueryHardware(void); - GLAPI void GLAPIENTRY fxCloseHardware(void); GLAPI void GLAPIENTRY fxGetScreenGeometry (GLint *w, GLint *h); diff --git a/progs/demos/tunnel2.c b/progs/demos/tunnel2.c index 048cd6d8e7c..436f01b3e49 100644 --- a/progs/demos/tunnel2.c +++ b/progs/demos/tunnel2.c @@ -31,7 +31,7 @@ static int fullscreen = 1; #endif #ifdef FX -GLboolean fxMesaSelectCurrentBoard(int); +GLint fxMesaSelectCurrentBoard(int); #endif static int WIDTHC0 = 640; @@ -549,7 +549,7 @@ main(int ac, char **av) glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); #ifdef FX - if (!fxMesaSelectCurrentBoard(0)) { + if (fxMesaSelectCurrentBoard(0) < 0) { fprintf(stderr, "The first Voodoo Graphics board is missing !?!?\n"); return -1; } @@ -568,7 +568,7 @@ main(int ac, char **av) glutSpecialFunc(special); #ifdef FX - if (!fxMesaSelectCurrentBoard(1)) { + if (fxMesaSelectCurrentBoard(1) < 0) { fprintf(stderr, "The second Voodoo Graphics board is missing !\n"); exit(-1); } diff --git a/src/mesa/Makefile.DJ b/src/mesa/Makefile.DJ index cd336fc50e9..71e44861f80 100644 --- a/src/mesa/Makefile.DJ +++ b/src/mesa/Makefile.DJ @@ -40,9 +40,6 @@ # As a consequence, you'll need the DJGPP Glide3 # library to build any application. # default = no -# MATROX=1 build for Matrox Millennium I (MGA2064W) cards. -# This is experimental and not intensively tested. -# default = no # HAVE_X86=1 optimize for i386. # default = no # HAVE_MMX=1 allow MMX specializations, provided your assembler @@ -80,13 +77,8 @@ CFLAGS += -D__DOS__ -DH3 CFLAGS += -I$(GLIDE)/include -DFX LIBNAME = "Mesa/FX DJGPP" else -ifeq ($(MATROX),1) -CFLAGS += -DMATROX -LIBNAME = "Mesa/MGA DJGPP" -else LIBNAME = "Mesa DJGPP" endif -endif AR = ar ARFLAGS = rus @@ -305,13 +297,6 @@ DRIVER_SOURCES += \ drivers/glide/fxglidew.c \ drivers/glide/fxg.c else -ifeq ($(MATROX),1) -DRIVER_SOURCES += \ - drivers/dos/mga/mga.c \ - drivers/dos/mga/mga_hw.c \ - drivers/dos/mga/mga_mode.c \ - drivers/dos/dpmi.c -else DRIVER_SOURCES += \ drivers/dos/video.c \ drivers/dos/virtual.S \ @@ -320,7 +305,6 @@ DRIVER_SOURCES += \ drivers/dos/vga.c \ drivers/dos/dpmi.c endif -endif SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(DRIVER_SOURCES) @@ -369,5 +353,4 @@ clean: -$(call UNLINK,tnl/*.o) -$(call UNLINK,x86/*.o) -$(call UNLINK,drivers/dos/*.o) - -$(call UNLINK,drivers/dos/mga/*.o) -$(call UNLINK,drivers/glide/*.o) diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index a5d052b39db..5b4f71ad69e 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.4 for Mesa + * DOS/DJGPP device driver v1.5 for Mesa * * Copyright (c) 2003 - Borca Daniel * Email : dborca@users.sourceforge.net @@ -53,11 +53,7 @@ #include "tnl/tnl.h" #include "tnl/t_context.h" #include "tnl/t_pipeline.h" -#ifndef MATROX #include "video.h" -#else /* MATROX */ -#include "mga/mga.h" -#endif /* MATROX */ #else /* FX */ #include "GL/fxmesa.h" #endif /* FX */ @@ -76,9 +72,6 @@ struct dmesa_visual { GLboolean rgb_flag; /* RGB mode? */ GLboolean sw_alpha; /* use Mesa's alpha buffer? */ GLuint depth; /* bits per pixel (1, 8, 24, etc) */ -#ifdef MATROX - int stride_in_pixels; -#endif int zbuffer; /* Z=buffer: 0=no, 1=SW, -1=HW */ }; @@ -116,18 +109,7 @@ struct dmesa_context { #define FLIP(y) (dmesa->Buffer->height - (y) - 1) #define FLIP2(y) (_b_ - (y)) - -#ifndef MATROX #define DSTRIDE dmesa->Buffer->width -#else -#define DSTRIDE dmesa->visual->stride_in_pixels -#define vl_putpixel mga_putpixel -#define vl_mixrgba mga_mixrgb -#define vl_mixrgb mga_mixrgb -#define vl_getrgba mga_getrgba -#define vl_setz mga_setz -#define vl_getz mga_getz -#endif /**************************************************************************** * RGB[A] @@ -138,7 +120,6 @@ static void write_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, const DMesaContext dmesa = (DMesaContext)ctx; GLuint i, offset; -#ifndef MATROX offset = DSTRIDE * FLIP(y) + x; if (mask) { /* draw some pixels */ @@ -153,29 +134,6 @@ static void write_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, vl_putpixel(offset, vl_mixrgba(rgba[i])); } } -#else /* MATROX */ - y = FLIP(y); - if (mask) { - /* draw some pixels */ - offset = 0; - for (i = 0; i < n; i++) { - if (mask[i]) { - ++offset; - } else { - if (offset != 0) { - mga_draw_span_rgb_tx32(x + i - offset, y, offset, (const unsigned long *)(&rgba[i-offset])); - offset = 0; - } - } - } - if (offset != 0) { - mga_draw_span_rgb_tx32(x + n - offset, y, offset, (const unsigned long *)(&rgba[n-offset])); - } - } else { - /* draw all pixels */ - mga_draw_span_rgb_tx32(x, y, n, (const unsigned long *)rgba); - } -#endif /* MATROX */ } @@ -319,7 +277,6 @@ static void read_rgba_pixels (const GLcontext *ctx, /**************************************************************************** * Index ***************************************************************************/ -#ifndef MATROX static void write_index_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLuint index[], const GLubyte mask[]) { @@ -477,90 +434,12 @@ static void read_index_pixels (const GLcontext *ctx, } } } -#endif /* !MATROX */ /**************************************************************************** * Z-buffer ***************************************************************************/ -#ifdef MATROX -static void write_depth_span (GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLdepth depth[], const GLubyte mask[]) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, offset; - - offset = DSTRIDE * FLIP(y) + x; - if (mask) { - /* draw some values */ - for (i=0; iBuffer->height - 1; - - if (mask) { - /* draw some values */ - for (i=0; iBuffer->height - 1; - - /* read all values */ - for (i=0; iBuffer->height - 1; - MGAvertex m0, m1, m2; - m0.win[0] = v0->win[0]; - m0.win[1] = FLIP2(v0->win[1]); - m1.win[0] = v1->win[0]; - m1.win[1] = FLIP2(v1->win[1]); - m2.win[0] = v2->win[0]; - m2.win[1] = FLIP2(v2->win[1]); - *(unsigned long *)m2.color = *(unsigned long *)v2->color; - mga_draw_tri_rgb_flat((int)SWRAST_CONTEXT(ctx)->_BackfaceSign, &m0, &m1, &m2); -} -#endif /* MATROX */ - /* * Z-less flat triangle. */ -#ifndef MATROX - #define NAME tri_rgb_flat_zless #define INTERP_Z 1 @@ -641,37 +495,11 @@ static void tri_rgb_flat (GLcontext *ctx, #include "swrast/s_tritemp.h" -#else /* MATROX */ - -static void tri_rgb_flat_zless (GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint _b_ = dmesa->Buffer->height - 1; - MGAvertex m0, m1, m2; - m0.win[0] = v0->win[0]; - m0.win[1] = FLIP2(v0->win[1]); - m0.win[2] = v0->win[2]; - m1.win[0] = v1->win[0]; - m1.win[1] = FLIP2(v1->win[1]); - m1.win[2] = v1->win[2]; - m2.win[0] = v2->win[0]; - m2.win[1] = FLIP2(v2->win[1]); - m2.win[2] = v2->win[2]; - *(unsigned long *)m2.color = *(unsigned long *)v2->color; - mga_draw_tri_rgb_flat_zless((int)SWRAST_CONTEXT(ctx)->_BackfaceSign, &m0, &m1, &m2); -} -#endif /* MATROX */ - /* * NON-depth-buffered iterated triangle. */ -#ifndef MATROX - #define NAME tri_rgb_iter #define INTERP_RGB 1 @@ -692,36 +520,11 @@ static void tri_rgb_flat_zless (GLcontext *ctx, #include "swrast/s_tritemp.h" -#else /* MATROX */ - -static void tri_rgb_iter (GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint _b_ = dmesa->Buffer->height - 1; - MGAvertex m0, m1, m2; - m0.win[0] = v0->win[0]; - m0.win[1] = FLIP2(v0->win[1]); - m1.win[0] = v1->win[0]; - m1.win[1] = FLIP2(v1->win[1]); - m2.win[0] = v2->win[0]; - m2.win[1] = FLIP2(v2->win[1]); - *(unsigned long *)m0.color = *(unsigned long *)v0->color; - *(unsigned long *)m1.color = *(unsigned long *)v1->color; - *(unsigned long *)m2.color = *(unsigned long *)v2->color; - mga_draw_tri_rgb_iter((int)SWRAST_CONTEXT(ctx)->_BackfaceSign, &m0, &m1, &m2); -} -#endif /* MATROX */ - /* * Z-less iterated triangle. */ -#ifndef MATROX - #define NAME tri_rgb_iter_zless #define INTERP_Z 1 @@ -749,32 +552,6 @@ static void tri_rgb_iter (GLcontext *ctx, #include "swrast/s_tritemp.h" -#else /* MATROX */ - -static void tri_rgb_iter_zless (GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint _b_ = dmesa->Buffer->height - 1; - MGAvertex m0, m1, m2; - m0.win[0] = v0->win[0]; - m0.win[1] = FLIP2(v0->win[1]); - m0.win[2] = v0->win[2]; - m1.win[0] = v1->win[0]; - m1.win[1] = FLIP2(v1->win[1]); - m1.win[2] = v1->win[2]; - m2.win[0] = v2->win[0]; - m2.win[1] = FLIP2(v2->win[1]); - m2.win[2] = v2->win[2]; - *(unsigned long *)m0.color = *(unsigned long *)v0->color; - *(unsigned long *)m1.color = *(unsigned long *)v1->color; - *(unsigned long *)m2.color = *(unsigned long *)v2->color; - mga_draw_tri_rgb_iter_zless((int)SWRAST_CONTEXT(ctx)->_BackfaceSign, &m0, &m1, &m2); -} -#endif /* MATROX */ - /* @@ -828,41 +605,9 @@ static void dmesa_choose_tri (GLcontext *ctx) * Optimized line rendering ***************************************************************************/ -#ifdef MATROX -static __inline void matrox_line_clip_hack (GLcontext *ctx, int _b_, MGAvertex *m0, const SWvertex *vert0, MGAvertex *m1, const SWvertex *vert1) -{ - int x0 = vert0->win[0]; - int y0 = vert0->win[1]; - int x1 = vert1->win[0]; - int y1 = vert1->win[1]; - /* s_linetemp.h { */ - GLint w = ctx->DrawBuffer->Width; - GLint h = ctx->DrawBuffer->Height; - if ((x0==w) | (x1==w)) { - if ((x0==w) & (x1==w)) - return; - x0 -= x0==w; - x1 -= x1==w; - } - if ((y0==h) | (y1==h)) { - if ((y0==h) & (y1==h)) - return; - y0 -= y0==h; - y1 -= y1==h; - } - /* } s_linetemp.h */ - m0->win[0] = x0; - m0->win[1] = FLIP2(y0); - m1->win[0] = x1; - m1->win[1] = FLIP2(y1); -} -#endif - /* * NON-depth-buffered flat line. */ -#ifndef MATROX - #define NAME line_rgb_flat #define INTERP_XY 1 @@ -878,28 +623,11 @@ static __inline void matrox_line_clip_hack (GLcontext *ctx, int _b_, MGAvertex * #include "swrast/s_linetemp.h" -#else /* MATROX */ - -static void line_rgb_flat (GLcontext *ctx, - const SWvertex *vert0, - const SWvertex *vert1) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint _b_ = dmesa->Buffer->height - 1; - MGAvertex m0, m1; - matrox_line_clip_hack(ctx, _b_, &m0, vert0, &m1, vert1); - *(unsigned long *)m1.color = *(unsigned long *)vert1->color; - mga_draw_line_rgb_flat(&m0, &m1); -} -#endif /* MATROX */ - /* * Z-less flat line. */ -#ifndef MATROX - #define NAME line_rgb_flat_zless #define INTERP_XY 1 @@ -921,65 +649,19 @@ static void line_rgb_flat (GLcontext *ctx, #include "swrast/s_linetemp.h" -#else /* MATROX */ -static void line_rgb_flat_zless (GLcontext *ctx, - const SWvertex *vert0, - const SWvertex *vert1) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint _b_ = dmesa->Buffer->height - 1; - MGAvertex m0, m1; - matrox_line_clip_hack(ctx, _b_, &m0, vert0, &m1, vert1); - m0.win[2] = vert0->win[2]; - m1.win[2] = vert1->win[2]; - *(unsigned long *)m1.color = *(unsigned long *)vert1->color; - mga_draw_line_rgb_flat_zless(&m0, &m1); -} -#endif /* MATROX */ - - -#ifndef MATROX -#define line_rgb_iter NULL -#define line_rgb_iter_zless NULL -#else /* MATROX */ /* * NON-depth-buffered iterated line. */ -static void line_rgb_iter (GLcontext *ctx, - const SWvertex *vert0, - const SWvertex *vert1) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint _b_ = dmesa->Buffer->height - 1; - MGAvertex m0, m1; - matrox_line_clip_hack(ctx, _b_, &m0, vert0, &m1, vert1); - *(unsigned long *)m0.color = *(unsigned long *)vert0->color; - *(unsigned long *)m1.color = *(unsigned long *)vert1->color; - mga_draw_line_rgb_iter(&m0, &m1); -} +#define line_rgb_iter NULL /* * Z-less iterated line. */ -static void line_rgb_iter_zless (GLcontext *ctx, - const SWvertex *vert0, - const SWvertex *vert1) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint _b_ = dmesa->Buffer->height - 1; - MGAvertex m0, m1; - matrox_line_clip_hack(ctx, _b_, &m0, vert0, &m1, vert1); - m0.win[2] = vert0->win[2]; - m1.win[2] = vert1->win[2]; - *(unsigned long *)m0.color = *(unsigned long *)vert0->color; - *(unsigned long *)m1.color = *(unsigned long *)vert1->color; - mga_draw_line_rgb_iter_zless(&m0, &m1); -} -#endif /* MATROX */ +#define line_rgb_iter_zless NULL @@ -1067,7 +749,6 @@ static void clear (GLcontext *ctx, GLbitfield mask, GLboolean all, /* we can't handle color or index masking */ if ((*colorMask == 0xffffffff) && (ctx->Color.IndexMask == 0xffffffff)) { -#ifndef MATROX if (mask & DD_BACK_LEFT_BIT) { int color = c->visual->rgb_flag ? c->ClearColor : c->ClearIndex; @@ -1079,27 +760,6 @@ static void clear (GLcontext *ctx, GLbitfield mask, GLboolean all, mask &= ~DD_BACK_LEFT_BIT; } -#else /* MATROX */ - unsigned short z = -1; - int color = c->ClearColor; - if (mask & DD_DEPTH_BIT) { - z = ctx->Depth.Clear * 0xffff; - } - if (all) { - mga_clear(mask & DD_FRONT_LEFT_BIT, - mask & DD_BACK_LEFT_BIT, - mask & DD_DEPTH_BIT, - 0, 0, c->Buffer->width, c->Buffer->height, - color, z); - } else { - mga_clear(mask & DD_FRONT_LEFT_BIT, - mask & DD_BACK_LEFT_BIT, - mask & DD_DEPTH_BIT, - x, y, width, height, - color, z); - } - mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT | DD_DEPTH_BIT); -#endif /* MATROX */ } if (mask) { @@ -1149,10 +809,7 @@ static const GLubyte* get_string (GLcontext *ctx, GLenum name) switch (name) { case GL_RENDERER: return (const GLubyte *)"Mesa DJGPP" - #ifdef MATROX - " (MGA)" - #endif - "\0port (c) Borca Daniel oct-2003"; + "\0port (c) Borca Daniel dec-2003"; default: return NULL; } @@ -1285,17 +942,7 @@ static void dmesa_init_pointers (GLcontext *ctx) /* The span functions should be in `dmesa_update_state', but I'm * pretty sure they will never change during the life of the Visual */ -#ifdef MATROX - if (((DMesaContext)ctx)->visual->zbuffer == -1) { - /* Depth span/pixel functions */ - dd->WriteDepthSpan = write_depth_span; - dd->WriteDepthPixels = write_depth_pixels; - dd->ReadDepthSpan = read_depth_span; - dd->ReadDepthPixels = read_depth_pixels; - } -#endif -#ifndef MATROX /* Index span/pixel functions */ dd->WriteCI32Span = write_index_span; dd->WriteCI8Span = write_index8_span; @@ -1304,7 +951,6 @@ static void dmesa_init_pointers (GLcontext *ctx) dd->WriteMonoCIPixels = write_mono_index_pixels; dd->ReadCI32Span = read_index_span; dd->ReadCI32Pixels = read_index_pixels; -#endif /* RGB(A) span/pixel functions */ dd->WriteRGBASpan = write_rgba_span; @@ -1355,15 +1001,9 @@ DMesaVisual DMesaCreateVisual (GLint width, GLint redBits, greenBits, blueBits, alphaBits, indexBits; GLboolean sw_alpha; -#ifndef MATROX if (!dbFlag) { return NULL; } -#else - if (!rgbFlag) { - return NULL; - } -#endif alphaBits = 0; @@ -1420,15 +1060,9 @@ DMesaVisual DMesaCreateVisual (GLint width, alphaBits = alphaSize; sw_alpha = (alphaBits > 0); -#ifndef MATROX if ((colDepth=vl_video_init(width, height, colDepth, rgbFlag, refresh)) <= 0) { return NULL; } -#else - if (mga_open(width, height, colDepth, dbFlag ? 2 : 1, depthSize == 16, refresh) < 0) { - return NULL; - } -#endif if ((v=(DMesaVisual)CALLOC_STRUCT(dmesa_visual)) != NULL) { /* Create core visual */ @@ -1455,12 +1089,6 @@ DMesaVisual DMesaCreateVisual (GLint width, v->sw_alpha = sw_alpha; v->zbuffer = (depthSize > 0) ? 1 : 0; -#ifdef MATROX - mga_get(MGA_GET_HPIXELS, &v->stride_in_pixels); - if (depthSize == 16) { - v->zbuffer = -1; - } -#endif } return v; @@ -1493,11 +1121,7 @@ void DMesaDestroyVisual (DMesaVisual v) #ifndef FX _mesa_destroy_visual((GLvisual *)v); -#ifndef MATROX vl_video_exit(); -#else - mga_close(1, 1); -#endif #else fxMesaDestroyContext((fxMesaContext)v); @@ -1537,9 +1161,7 @@ DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, void DMesaDestroyBuffer (DMesaBuffer b) { #ifndef FX -#ifndef MATROX free(b->the_window); -#endif _mesa_destroy_framebuffer((GLframebuffer *)b); #endif } @@ -1605,7 +1227,7 @@ void DMesaDestroyContext (DMesaContext c) GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos) { -#if !defined(FX) && !defined(MATROX) +#ifndef FX GET_CURRENT_CONTEXT(ctx); DMesaBuffer b = ((DMesaContext)ctx)->Buffer; @@ -1626,7 +1248,7 @@ GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos) GLboolean DMesaResizeBuffer (GLint width, GLint height) { -#if !defined(FX) && !defined(MATROX) +#ifndef FX GET_CURRENT_CONTEXT(ctx); DMesaBuffer b = ((DMesaContext)ctx)->Buffer; @@ -1652,11 +1274,9 @@ GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b) { #ifndef FX if ((c != NULL) && (b != NULL)) { -#ifndef MATROX if (vl_sync_buffer(&b->the_window, b->xpos, b->ypos, b->width, b->height) != 0) { return GL_FALSE; } -#endif c->Buffer = b; @@ -1685,13 +1305,7 @@ void DMesaSwapBuffers (DMesaBuffer b) #ifndef FX GET_CURRENT_CONTEXT(ctx); _mesa_notifySwapBuffers(ctx); -#ifndef MATROX vl_flip(); -#else - if (((DMesaContext)ctx)->visual->db_flag) { - mga_swapbuffers(1); - } -#endif #else fxMesaSwapBuffers(); #endif @@ -1701,7 +1315,7 @@ void DMesaSwapBuffers (DMesaBuffer b) void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue) { -#if !defined(FX) && !defined(MATROX) +#ifndef FX vl_setCI(ndx, red, green, blue); #endif } @@ -1722,33 +1336,64 @@ void *DMesaGetCurrentContext (void) int DMesaGetIntegerv (GLenum pname, GLint *params) { - if (DMesaGetCurrentContext() == NULL) { - return -1; - } - switch (pname) { case DMESA_GET_SCREEN_SIZE: #ifndef FX - #ifndef MATROX vl_get(VL_GET_SCREEN_SIZE, params); #else - mga_get(MGA_GET_SCREEN_SIZE, params); - #endif - #else fxGetScreenGeometry(¶ms[0], ¶ms[1]); #endif break; case DMESA_GET_DRIVER_CAPS: #ifndef FX - #ifndef MATROX params[0] = DMESA_DRIVER_SWDB_BIT; #else - params[0] = 0; - #endif - #else params[0] = DMESA_DRIVER_LLWO_BIT; #endif break; + case DMESA_GET_VIDEO_MODES: + #ifndef FX + return vl_get(VL_GET_VIDEO_MODES, params); + #else + { + /* `vmode' struct must be sync'ed with `internal.h' (vl_mode) + * `vmode' list must be sync'ed with `fxapi.c' + * `hw >= 6' means Napalm and can do 32bit rendering + * TODO: we should take an envvar for `fxMesaSelectCurrentBoard' + */ + static struct { + int width, height; + int bpp; + } vmode[] = { + { 320, 200, 16 }, + { 320, 240, 16 }, + { 512, 384, 16 }, + { 640, 400, 16 }, + { 640, 480, 16 }, + { 800, 600, 16 }, + {1024, 768, 16 }, + + { 320, 200, 32 }, + { 320, 240, 32 }, + { 512, 384, 32 }, + { 640, 400, 32 }, + { 640, 480, 32 }, + { 800, 600, 32 }, + {1024, 768, 32 } + }; + int hw = fxMesaSelectCurrentBoard(0); + int i, n = sizeof(vmode) / sizeof(vmode[0]); + if (hw < 6) { + n /= 2; + } + if (params) { + for (i = 0; i < n; i++) { + params[i] = (GLint)(&vmode[i]); + } + } + return n; + } + #endif default: return -1; } diff --git a/src/mesa/drivers/dos/internal.h b/src/mesa/drivers/dos/internal.h index dfb9274ecc7..fd47dbb7b82 100644 --- a/src/mesa/drivers/dos/internal.h +++ b/src/mesa/drivers/dos/internal.h @@ -23,10 +23,10 @@ */ /* - * DOS/DJGPP device driver v1.4 for Mesa + * DOS/DJGPP device driver v1.5 for Mesa * * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com + * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca */ @@ -59,11 +59,12 @@ typedef unsigned long word32; * video mode structure */ typedef struct vl_mode { - int mode; int xres, yres; - int scanlen; int bpp; + int mode; + int scanlen; + int sel; int gran; } vl_mode; diff --git a/src/mesa/drivers/dos/vesa.c b/src/mesa/drivers/dos/vesa.c index ea5bcb7a86e..e87651e4fd2 100644 --- a/src/mesa/drivers/dos/vesa.c +++ b/src/mesa/drivers/dos/vesa.c @@ -23,10 +23,10 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa + * DOS/DJGPP device driver v1.5 for Mesa * * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com + * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca */ @@ -450,6 +450,7 @@ static void vesa_restore (void) r.x.ax = 0x4f02; r.x.bx = oldmode; __dpmi_int(0x10, &r); + oldmode = -1; } } diff --git a/src/mesa/drivers/dos/vga.c b/src/mesa/drivers/dos/vga.c index 9de32f0cd5e..3a4bd9b6876 100644 --- a/src/mesa/drivers/dos/vga.c +++ b/src/mesa/drivers/dos/vga.c @@ -23,10 +23,10 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa + * DOS/DJGPP device driver v1.5 for Mesa * * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com + * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca */ @@ -152,6 +152,7 @@ static void vga_restore (void) { if (oldmode != -1) { __asm("int $0x10"::"a"(oldmode)); + oldmode = -1; } } diff --git a/src/mesa/drivers/dos/video.c b/src/mesa/drivers/dos/video.c index 5432141bb0d..41903ebe799 100644 --- a/src/mesa/drivers/dos/video.c +++ b/src/mesa/drivers/dos/video.c @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.4 for Mesa + * DOS/DJGPP device driver v1.5 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@users.sourceforge.net @@ -416,6 +416,33 @@ void v_init_pixeltables (void) +/* Desc: initialize hardware + * + * In : - + * Out : list of available modes + * + * Note: when returning non-NULL, global variable `drv' is guaranteed to be ok + */ +static vl_mode *v_init_hw (void) +{ + static vl_mode *q = NULL; + + if (q == NULL) { + /* initialize hardware */ + if ((q = VESA.init()) != NULL) { + drv = &VESA; + } else if ((q = VGA.init()) != NULL) { + drv = &VGA; + } else { + drv = NULL; + } + } + + return q; +} + + + /* Desc: sync buffer with video hardware * * In : ptr to old buffer, position, size @@ -456,7 +483,7 @@ int vl_sync_buffer (void **buffer, int x, int y, int width, int height) /* Desc: state retrieval * * In : name, storage - * Out : - + * Out : -1 for an error * * Note: - */ @@ -467,8 +494,28 @@ int vl_get (int pname, int *params) params[0] = video_mode->xres; params[1] = video_mode->yres; break; + case VL_GET_VIDEO_MODES: + { + int n; + vl_mode *q; + if ((q = v_init_hw()) == NULL) { + return -1; + } + /* count available visuals */ + for (n = 0; q->mode != 0xffff; q++) { + if ((q + 1)->mode == (q->mode | 0x4000)) { + /* same mode, but linear */ + q++; + } + if (params) { + params[n] = (int)q; + } + n++; + } + return n; + } default: - return drv->get(pname, params); + return (drv != NULL) ? drv->get(pname, params) : -1; } return 0; } @@ -541,6 +588,7 @@ void vl_video_exit (void) { drv->restore(); drv->fini(); + video_mode = NULL; } @@ -571,12 +619,8 @@ int vl_video_init (int width, int height, int bpp, int rgb, int refresh) #endif /* initialize hardware */ - drv = &VESA; - if ((q=drv->init()) == NULL) { - drv = &VGA; - if ((q=drv->init()) == NULL) { - return 0; - } + if ((q = v_init_hw()) == NULL) { + return 0; } /* search for a mode that fits our request */ diff --git a/src/mesa/drivers/dos/video.h b/src/mesa/drivers/dos/video.h index 55560ee25b8..e928f19c373 100644 --- a/src/mesa/drivers/dos/video.h +++ b/src/mesa/drivers/dos/video.h @@ -23,10 +23,10 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa + * DOS/DJGPP device driver v1.5 for Mesa * * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com + * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca */ @@ -41,6 +41,7 @@ typedef int fixed; #define VL_GET_CI_PREC 0x0200 #define VL_GET_HPIXELS 0x0201 #define VL_GET_SCREEN_SIZE 0x0202 +#define VL_GET_VIDEO_MODES 0x0300 extern int (*vl_mixfix) (fixed r, fixed g, fixed b); extern int (*vl_mixrgb) (const unsigned char rgb[]); diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index e928b156eb5..12b919b2e60 100644 --- a/src/mesa/drivers/glide/fxapi.c +++ b/src/mesa/drivers/glide/fxapi.c @@ -101,20 +101,47 @@ cleangraphics_handler(int s) #endif +/* + * Query 3Dfx hardware presence/kind + */ +static GLboolean GLAPIENTRY fxQueryHardware (void) +{ + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "fxQueryHardware()\n"); + } + + if (!glbGlideInitialized) { + grGlideInit(); + glb3DfxPresent = FX_grSstQueryHardware(&glbHWConfig); + + glbGlideInitialized = 1; + +#if defined(__WIN32__) + _onexit((_onexit_t) cleangraphics); +#elif defined(__linux__) + /* Only register handler if environment variable is not defined. */ + if (!getenv("MESA_FX_NO_SIGNALS")) { + atexit(cleangraphics); + } +#endif + } + + return glb3DfxPresent; +} + + /* * Select the Voodoo board to use when creating * a new context. */ -GLboolean GLAPIENTRY fxMesaSelectCurrentBoard (int n) +GLint GLAPIENTRY fxMesaSelectCurrentBoard (int n) { fxQueryHardware(); if ((n < 0) || (n >= glbHWConfig.num_sst)) - return GL_FALSE; - - glbCurrentBoard = n; + return -1; - return GL_TRUE; + return glbHWConfig.SSTs[glbCurrentBoard = n].type; } @@ -415,7 +442,7 @@ fxMesaCreateContext(GLuint win, redBits = 5; greenBits = 5; blueBits = 5; - alphaBits = 1; + alphaBits = depthSize ? 1 : 8; switch(fxMesa->fsaa) { case 8: pixFmt = GR_PIXFMT_AA_8_ARGB_1555; @@ -851,35 +878,6 @@ fxMesaSwapBuffers(void) } -/* - * Query 3Dfx hardware presence/kind - */ -GLboolean GLAPIENTRY fxQueryHardware (void) -{ - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxQueryHardware()\n"); - } - - if (!glbGlideInitialized) { - grGlideInit(); - glb3DfxPresent = FX_grSstQueryHardware(&glbHWConfig); - - glbGlideInitialized = 1; - -#if defined(__WIN32__) - _onexit((_onexit_t) cleangraphics); -#elif defined(__linux__) - /* Only register handler if environment variable is not defined. */ - if (!getenv("MESA_FX_NO_SIGNALS")) { - atexit(cleangraphics); - } -#endif - } - - return glb3DfxPresent; -} - - /* * Shutdown Glide library */ diff --git a/src/mesa/drivers/glide/fxg.c b/src/mesa/drivers/glide/fxg.c index 6a06ee1461c..7f75f1292c2 100644 --- a/src/mesa/drivers/glide/fxg.c +++ b/src/mesa/drivers/glide/fxg.c @@ -2212,6 +2212,7 @@ void FX_CALL fake_grTexDownloadTableExt (GrChipID_t tmu, GrTexTable_t type, void *data) { + (void)tmu; grTexDownloadTable(type, data); } @@ -2221,12 +2222,14 @@ void FX_CALL fake_grTexDownloadTablePartialExt (GrChipID_t tmu, int start, int end) { + (void)tmu; grTexDownloadTablePartial(type, data, start, end); } void FX_CALL fake_grTexNCCTableExt (GrChipID_t tmu, GrNCCTable_t table) { + (void)tmu; grTexNCCTable(table); } diff --git a/src/mesa/drivers/glide/fxopengl.def b/src/mesa/drivers/glide/fxopengl.def index 03ca66444ef..84614923bae 100644 --- a/src/mesa/drivers/glide/fxopengl.def +++ b/src/mesa/drivers/glide/fxopengl.def @@ -907,7 +907,6 @@ EXPORTS ;fxMesaSetNearFar fxMesaSwapBuffers fxMesaUpdateScreenSize - fxQueryHardware wglChoosePixelFormat wglCopyContext wglCreateContext diff --git a/src/mesa/drivers/glide/fxwgl.c b/src/mesa/drivers/glide/fxwgl.c index 72a8c561b42..41960209e93 100644 --- a/src/mesa/drivers/glide/fxwgl.c +++ b/src/mesa/drivers/glide/fxwgl.c @@ -77,6 +77,7 @@ struct __pixelformat__ }; WINGDIAPI void GLAPIENTRY gl3DfxSetPaletteEXT(GLuint *); +static GLushort gammaTable[3*256]; struct __pixelformat__ pix[] = { /* 16bit RGB565 single buffer with depth */ @@ -426,12 +427,34 @@ wglGetSwapIntervalEXT (void) GLAPI BOOL GLAPIENTRY wglGetDeviceGammaRamp3DFX (HDC hdc, LPVOID arrays) { + /* gammaTable should be per-context */ + memcpy(arrays, gammaTable, 3*256*sizeof(GLushort)); return TRUE; } GLAPI BOOL GLAPIENTRY wglSetDeviceGammaRamp3DFX (HDC hdc, LPVOID arrays) { + GLint i, tableSize, inc, index; + GLushort *red, *green, *blue; + FxU32 gammaTableR[256], gammaTableG[256], gammaTableB[256]; + + /* gammaTable should be per-context */ + memcpy(gammaTable, arrays, 3*256*sizeof(GLushort)); + + tableSize = FX_grGetInteger(GR_GAMMA_TABLE_ENTRIES); + inc = 256 / tableSize; + red = (GLushort *)arrays; + green = (GLushort *)arrays + 256; + blue = (GLushort *)arrays + 512; + for (i = 0, index = 0; i < tableSize; i++, index += inc) { + gammaTableR[i] = red[index] >> 8; + gammaTableG[i] = green[index] >> 8; + gammaTableB[i] = blue[index] >> 8; + } + + grLoadGammaTable(tableSize, gammaTableR, gammaTableG, gammaTableB); + return TRUE; } diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 02c67c25cf3..f1d4ea0ccb0 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1799,8 +1799,8 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, XMesaWindow w, } attribs[numAttribs++] = FXMESA_NONE; - /* [dBorca] need to revise this ASAP!!! */ - /*if ((hw = fxQueryHardware())==GR_SSTTYPE_VOODOO) { + /* [dBorca] we should take an envvar for `fxMesaSelectCurrentBoard'!!! */ + if ((hw = fxMesaSelectCurrentBoard(0))==GR_SSTTYPE_VOODOO) { b->FXctx = fxMesaCreateBestContext(0, b->width, b->height, attribs); if ((v->undithered_pf!=PF_Index) && (b->backimage)) { b->FXisHackUsable = b->FXctx ? GL_TRUE : GL_FALSE; @@ -1810,7 +1810,7 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, XMesaWindow w, b->FXwindowHack = GL_FALSE; } } - else */{ + else { if (fxEnvVar[0]=='w' || fxEnvVar[0]=='W') b->FXctx = fxMesaCreateContext(w, GR_RESOLUTION_NONE, GR_REFRESH_75Hz, attribs); -- cgit v1.2.3 From cf75101bba7b944b597f29adc3a7f83d85c0d4b1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 9 Jan 2004 20:34:04 +0000 Subject: regenerated to support new 1.5 functions, etc. --- include/GL/gl_mangle.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index ebf15f427f9..2116a87a646 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -52,8 +52,11 @@ #define glBeginFragmentShaderATI MANGLE(BeginFragmentShaderATI) #define glBegin MANGLE(Begin) #define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV) +#define glBeginQueryARB MANGLE(BeginQueryARB) +#define glBeginQuery MANGLE(BeginQuery) #define glBeginVertexShaderEXT MANGLE(BeginVertexShaderEXT) #define glBindBufferARB MANGLE(BindBufferARB) +#define glBindBuffer MANGLE(BindBuffer) #define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI) #define glBindLightParameterEXT MANGLE(BindLightParameterEXT) #define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT) @@ -87,7 +90,9 @@ #define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR) #define glBlendFuncSeparate MANGLE(BlendFuncSeparate) #define glBufferDataARB MANGLE(BufferDataARB) +#define glBufferData MANGLE(BufferData) #define glBufferSubDataARB MANGLE(BufferSubDataARB) +#define glBufferSubData MANGLE(BufferSubData) #define glCallList MANGLE(CallList) #define glCallLists MANGLE(CallLists) #define glClearAccum MANGLE(ClearAccum) @@ -221,6 +226,7 @@ #define glDeformSGIX MANGLE(DeformSGIX) #define glDeleteAsyncMarkersSGIX MANGLE(DeleteAsyncMarkersSGIX) #define glDeleteBuffersARB MANGLE(DeleteBuffersARB) +#define glDeleteBuffers MANGLE(DeleteBuffers) #define glDeleteFencesAPPLE MANGLE(DeleteFencesAPPLE) #define glDeleteFencesNV MANGLE(DeleteFencesNV) #define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI) @@ -228,6 +234,8 @@ #define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV) #define glDeleteProgramsARB MANGLE(DeleteProgramsARB) #define glDeleteProgramsNV MANGLE(DeleteProgramsNV) +#define glDeleteQueriesARB MANGLE(DeleteQueriesARB) +#define glDeleteQueries MANGLE(DeleteQueries) #define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT) #define glDeleteTextures MANGLE(DeleteTextures) #define glDeleteVertexArraysAPPLE MANGLE(DeleteVertexArraysAPPLE) @@ -271,6 +279,8 @@ #define glEndList MANGLE(EndList) #define glEnd MANGLE(End) #define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV) +#define glEndQueryARB MANGLE(EndQueryARB) +#define glEndQuery MANGLE(EndQuery) #define glEndTraceMESA MANGLE(EndTraceMESA) #define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT) #define glEvalCoord1d MANGLE(EvalCoord1d) @@ -338,6 +348,7 @@ #define glFrustum MANGLE(Frustum) #define glGenAsyncMarkersSGIX MANGLE(GenAsyncMarkersSGIX) #define glGenBuffersARB MANGLE(GenBuffersARB) +#define glGenBuffers MANGLE(GenBuffers) #define glGenFencesAPPLE MANGLE(GenFencesAPPLE) #define glGenFencesNV MANGLE(GenFencesNV) #define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI) @@ -345,6 +356,8 @@ #define glGenOcclusionQueriesNV MANGLE(GenOcclusionQueriesNV) #define glGenProgramsARB MANGLE(GenProgramsARB) #define glGenProgramsNV MANGLE(GenProgramsNV) +#define glGenQueriesARB MANGLE(GenQueriesARB) +#define glGenQueries MANGLE(GenQueries) #define glGenSymbolsEXT MANGLE(GenSymbolsEXT) #define glGenTexturesEXT MANGLE(GenTexturesEXT) #define glGenTextures MANGLE(GenTextures) @@ -354,8 +367,11 @@ #define glGetArrayObjectivATI MANGLE(GetArrayObjectivATI) #define glGetBooleanv MANGLE(GetBooleanv) #define glGetBufferParameterivARB MANGLE(GetBufferParameterivARB) +#define glGetBufferParameteriv MANGLE(GetBufferParameteriv) #define glGetBufferPointervARB MANGLE(GetBufferPointervARB) +#define glGetBufferPointerv MANGLE(GetBufferPointerv) #define glGetBufferSubDataARB MANGLE(GetBufferSubDataARB) +#define glGetBufferSubData MANGLE(GetBufferSubData) #define glGetClipPlane MANGLE(GetClipPlane) #define glGetColorTableEXT MANGLE(GetColorTableEXT) #define glGetColorTable MANGLE(GetColorTable) @@ -451,6 +467,12 @@ #define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV) #define glGetProgramStringARB MANGLE(GetProgramStringARB) #define glGetProgramStringNV MANGLE(GetProgramStringNV) +#define glGetQueryivARB MANGLE(GetQueryivARB) +#define glGetQueryiv MANGLE(GetQueryiv) +#define glGetQueryObjectivARB MANGLE(GetQueryObjectivARB) +#define glGetQueryObjectiv MANGLE(GetQueryObjectiv) +#define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB) +#define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv) #define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT) #define glGetSeparableFilter MANGLE(GetSeparableFilter) #define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS) @@ -524,6 +546,7 @@ #define glInterleavedArrays MANGLE(InterleavedArrays) #define glIsAsyncMarkerSGIX MANGLE(IsAsyncMarkerSGIX) #define glIsBufferARB MANGLE(IsBufferARB) +#define glIsBuffer MANGLE(IsBuffer) #define glIsEnabled MANGLE(IsEnabled) #define glIsFenceAPPLE MANGLE(IsFenceAPPLE) #define glIsFenceNV MANGLE(IsFenceNV) @@ -532,6 +555,8 @@ #define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV) #define glIsProgramARB MANGLE(IsProgramARB) #define glIsProgramNV MANGLE(IsProgramNV) +#define glIsQueryARB MANGLE(IsQueryARB) +#define glIsQuery MANGLE(IsQuery) #define glIsTextureEXT MANGLE(IsTextureEXT) #define glIsTexture MANGLE(IsTexture) #define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT) @@ -569,6 +594,7 @@ #define glMap2d MANGLE(Map2d) #define glMap2f MANGLE(Map2f) #define glMapBufferARB MANGLE(MapBufferARB) +#define glMapBuffer MANGLE(MapBuffer) #define glMapControlPointsNV MANGLE(MapControlPointsNV) #define glMapGrid1d MANGLE(MapGrid1d) #define glMapGrid1f MANGLE(MapGrid1f) @@ -1036,6 +1062,7 @@ #define glTranslatef MANGLE(Translatef) #define glUnlockArraysEXT MANGLE(UnlockArraysEXT) #define glUnmapBufferARB MANGLE(UnmapBufferARB) +#define glUnmapBuffer MANGLE(UnmapBuffer) #define glUnmapObjectBufferATI MANGLE(UnmapObjectBufferATI) #define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI) #define glVariantArrayObjectATI MANGLE(VariantArrayObjectATI) -- cgit v1.2.3 From c661cccf3772ab137da5112c9bf43674330ed4ec Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 13 Jan 2004 01:54:03 +0000 Subject: updated to version 21 with OpenGL 1.5 support --- include/GL/glext.h | 395 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 381 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 777cc03936a..56d7399426d 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -42,6 +42,9 @@ extern "C" { #ifndef APIENTRY #define APIENTRY #endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif #ifndef GLAPI #define GLAPI extern #endif @@ -49,9 +52,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2003/5/9 */ +/* glext.h last updated 2003/1/12 */ /* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 18 +#define GL_GLEXT_VERSION 21 #ifndef GL_VERSION_1_2 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 @@ -317,6 +320,59 @@ extern "C" { #define GL_COMPARE_R_TO_TEXTURE 0x884E #endif +#ifndef GL_VERSION_1_5 +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 +#define GL_FOG_COORD_SOURCE GL_FOG_COORDINATE_SOURCE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +#endif + #ifndef GL_ARB_multitexture #define GL_TEXTURE0_ARB 0x84C0 #define GL_TEXTURE1_ARB 0x84C1 @@ -667,6 +723,69 @@ extern "C" { #define GL_DYNAMIC_COPY_ARB 0x88EA #endif +#ifndef GL_ARB_occlusion_query +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 +#endif + +#ifndef GL_ARB_shader_objects +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#endif + +#ifndef GL_ARB_shading_language_100 +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#endif + +#ifndef GL_ARB_point_sprite +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 +#endif + #ifndef GL_EXT_abgr #define GL_ABGR_EXT 0x8000 #endif @@ -2626,9 +2745,59 @@ extern "C" { #ifndef GL_ATI_vertex_attrib_array_object #endif +#ifndef GL_EXT_depth_bounds_test +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D +#endif + +#ifndef GL_MESA_pack_invert +#define GL_PACK_INVERT_MESA 0x8758 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 +#endif + /*************************************************************/ +#include +#ifndef GL_VERSION_1_5 +/* GL types for handling large vertex buffer objects */ +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; +#endif + +#ifndef GL_ARB_vertex_buffer_object +/* GL types for handling large vertex buffer objects */ +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; +#endif + +#ifndef GL_ARB_shader_objects +/* GL types for handling shader object handles and characters */ +typedef char GLcharARB; /* native character */ +typedef unsigned int GLhandleARB; /* shader object handle */ +#endif + +#ifndef GL_NV_half_float +/* GL type for representing NVIDIA "half" floating point type in host memory */ +typedef unsigned short GLhalfNV; +#endif + #ifndef GL_VERSION_1_2 #define GL_VERSION_1_2 1 #ifdef GL_GLEXT_PROTOTYPES @@ -2905,6 +3074,50 @@ typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); #endif +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsQuery (GLuint); +GLAPI void APIENTRY glBeginQuery (GLenum, GLuint); +GLAPI void APIENTRY glEndQuery (GLenum); +GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *); +GLAPI void APIENTRY glBindBuffer (GLenum, GLuint); +GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsBuffer (GLuint); +GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum); +GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *); +GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *); +GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum); +GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum); +GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + #ifndef GL_ARB_multitexture #define GL_ARB_multitexture 1 #ifdef GL_GLEXT_PROTOTYPES @@ -3288,11 +3501,6 @@ typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); #ifndef GL_ARB_vertex_buffer_object #define GL_ARB_vertex_buffer_object 1 -/* GL types for handling large vertex buffer objects */ -/* Only used by this extension for now; later needs to be moved earlier in glext.h */ -#include -typedef ptrdiff_t GLintptrARB; -typedef ptrdiff_t GLsizeiptrARB; #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint); GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *); @@ -3319,6 +3527,140 @@ typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); #endif +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsQueryARB (GLuint); +GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint); +GLAPI void APIENTRY glEndQueryARB (GLenum); +GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB); +GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum); +GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB); +GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum); +GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); +GLAPI void APIENTRY glCompileShaderARB (GLhandleARB); +GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); +GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB); +GLAPI void APIENTRY glLinkProgramARB (GLhandleARB); +GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB); +GLAPI void APIENTRY glValidateProgramARB (GLhandleARB); +GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat); +GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform1iARB (GLint, GLint); +GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint); +GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *); +GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *); +GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); +GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); +GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *); +GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); +GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *); +GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *); +GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); +typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *); +GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); +GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 +#endif + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 +#endif + #ifndef GL_EXT_abgr #define GL_EXT_abgr 1 #endif @@ -4553,12 +4895,12 @@ typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); #ifndef GL_IBM_multimode_draw_arrays #define GL_IBM_multimode_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES +#ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint); -GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid * const *, GLsizei, GLint); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum * mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, GLint modestride); +typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); #endif #ifndef GL_IBM_vertex_array_lists @@ -5378,9 +5720,6 @@ typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsiz #ifndef GL_NV_half_float #define GL_NV_half_float 1 -/* GL type for representing NVIDIA "half" floating point type in host memory */ -/* Only used by this extension for now; later needs to be moved earlier in glext.h */ -typedef unsigned short GLhalfNV; #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV); GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *); @@ -5537,6 +5876,34 @@ typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); #endif +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); +#endif + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 +#endif + #ifdef __cplusplus } -- cgit v1.2.3 From cdde03efe2164b4bd23a8f59a797144c14ec6cce Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 13 Jan 2004 02:04:57 +0000 Subject: remove stuff that's now in glext.h --- include/GL/gl.h | 206 +------------------------------------------------------- 1 file changed, 2 insertions(+), 204 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 652689c48bd..5be9bb4f84a 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 5.1 + * Version: 6.0 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2004 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"), @@ -2187,96 +2187,6 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid #endif /* GL_MESA_packed_depth_stencil */ -#ifndef GL_MESA_ycbcr_texture -#define GL_MESA_ycbcr_texture 1 - -#define GL_YCBCR_MESA 0x8757 -#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA /* same as Apple */ -#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB /* same as Apple */ - -#endif /* GL_MESA_texture_ycbcr */ - - - -#ifndef GL_MESA_pack_invert -#define GL_MESA_pack_invert 1 - -#define GL_PACK_INVERT_MESA 0x8758 - -#endif /* GL_MESA_pack_invert */ - - - -/* XXX temporary until glext.h is updated! */ -#ifndef GL_EXT_depth_bounds_test -#define GL_EXT_depth_bounds_test 1 - -#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 -#define GL_DEPTH_BOUNDS_EXT 0x8891 - -GLAPI void GLAPIENTRY glDepthBoundsEXT(GLclampd zmin, GLclampd zmax); - -typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC)(GLclampd zmin, GLclampd zmax); - -#endif /* GL_EXT_depth_bounds_test */ - - - -/* XXX temporary until glext.h is updated! */ -#ifndef GL_EXT_texture_mirror_clamp -#define GL_EXT_texture_mirror_clamp 1 - -#define GL_MIRROR_CLAMP_EXT 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 - -#endif /* GL_EXT_texture_mirror_clamp */ - - - -/* XXX temporary until glext.h is updated! */ -#ifndef GL_ARB_occlusion_query -#define GL_ARB_occlusion_query 1 - -#define GL_SAMPLES_PASSED_ARB 0x8914 -#define GL_QUERY_COUNTER_BITS_ARB 0x8864 -#define GL_CURRENT_QUERY_ARB 0x8865 -#define GL_QUERY_RESULT_ARB 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 - -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void GLAPIENTRY glGenQueriesARB(GLsizei n, GLuint *ids); -GLAPI void GLAPIENTRY glDeleteQueriesARB(GLsizei n, const GLuint *ids); -GLAPI GLboolean GLAPIENTRY glIsQueryARB(GLuint id); -GLAPI void GLAPIENTRY glBeginQueryARB(GLenum target, GLuint id); -GLAPI void GLAPIENTRY glEndQueryARB(GLenum target); -GLAPI void GLAPIENTRY glGetQueryivARB(GLenum target, GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glGetQueryObjectivARB(GLuint id, GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glGetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params); -#endif - -typedef void (APIENTRYP PFNGLGENQUERIESARBPROC)(GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC)(GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC)(GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC)(GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYARBPROC)(GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC)(GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC)(GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC)(GLuint id, GLenum pname, GLuint *params); - -#endif /* GL_ARB_occlusion_query */ - - -/* XXX temporary until glext.h is updated! */ -#ifndef GL_ARB_point_sprite -#define GL_ARB_point_sprite 1 - -#define GL_POINT_SPRITE_ARB 0x8861 -#define GL_COORD_REPLACE_ARB 0x8862 - -#endif /* GL_ARB_point_sprite */ - - #ifndef GL_MESA_program_debug #define GL_MESA_program_debug 1 @@ -2302,118 +2212,6 @@ glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, #endif /* GL_MESA_program_debug */ - -/* - * XXX temporary - these new 1.5 tokens should be defined in glext.h - */ -#ifndef GL_VERSION_1_5 -#define GL_VERSION_1_5 1 - -/* New and improved token names */ -#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE -#define GL_FOG_COORD GL_FOG_COORDINATE -#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE -#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE -#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE -#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER -#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY -#define GL_SRC0_RGB GL_SOURCE0_RGB -#define GL_SRC1_RGB GL_SOURCE1_RGB -#define GL_SRC2_RGB GL_SOURCE2_RGB -#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA -#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA -#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA - -/* Buffer object tokens */ -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_READ_ONLY 0x88B8 -#define GL_WRITE_ONLY 0x88B9 -#define GL_READ_WRITE 0x88BA -#define GL_BUFFER_ACCESS 0x88BB -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA - -/* Occlusion query tokens */ -#define GL_SAMPLES_PASSED 0x8914 -#define GL_QUERY_COUNTER_BITS 0x8864 -#define GL_CURRENT_QUERY 0x8865 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 - -typedef ptrdiff_t GLintptr; -typedef ptrdiff_t GLsizeiptr; - -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void GLAPIENTRY glGenQueries(GLsizei n, GLuint *ids); -GLAPI void GLAPIENTRY glDeleteQueries(GLsizei n, const GLuint *ids); -GLAPI GLboolean GLAPIENTRY glIsQuery(GLuint id); -GLAPI void GLAPIENTRY glBeginQuery(GLenum target, GLuint id); -GLAPI void GLAPIENTRY glEndQuery(GLenum target); -GLAPI void GLAPIENTRY glGetQueryiv(GLenum target, GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glGetQueryObjectiv(GLuint id, GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params); -GLAPI void GLAPIENTRY glBindBuffer(GLenum, GLuint); -GLAPI void GLAPIENTRY glDeleteBuffers(GLsizei, const GLuint *); -GLAPI void GLAPIENTRY glGenBuffers(GLsizei, GLuint *); -GLAPI GLboolean GLAPIENTRY glIsBuffer(GLuint); -GLAPI void GLAPIENTRY glBufferData(GLenum, GLsizeiptr, const GLvoid *, GLenum); -GLAPI void GLAPIENTRY glBufferSubData(GLenum, GLintptr, GLsizeiptr, const GLvoid *); -GLAPI void GLAPIENTRY glGetBufferSubData(GLenum, GLintptr, GLsizeiptr, GLvoid *); -GLAPI GLvoid* GLAPIENTRY glMapBuffer(GLenum, GLenum); -GLAPI GLboolean GLAPIENTRY glUnmapBuffer(GLenum); -GLAPI void GLAPIENTRY glGetBufferParameteriv(GLenum, GLenum, GLint *); -GLAPI void GLAPIENTRY glGetBufferPointerv(GLenum, GLenum, GLvoid* *); -#endif - -typedef void (APIENTRYP PFNGLGENQUERIESPROC)(GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESPROC)(GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYPROC)(GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYPROC)(GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYPROC)(GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVPROC)(GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC)(GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC)(GLuint id, GLenum pname, GLuint *params); - -typedef void (APIENTRYP PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSPROC)(GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC)(GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC)(GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC)(GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC)(GLenum target, GLenum pname, GLvoid* *params); - -#endif /* GL_VERSION_1_5 */ - - - /********************************************************************** * Begin system-specific stuff */ -- cgit v1.2.3 From 3d06dc75816ef7f1c6e2c3f24a98dd2934c4c385 Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Fri, 23 Jan 2004 15:57:52 +0000 Subject: accomodated new driver_func initialization added DMesaGetProcAddress some other minor fixes updated documentation --- docs/README.DJ | 13 ++- include/GL/dmesa.h | 15 ++-- src/mesa/Makefile.DJ | 4 +- src/mesa/Makefile.mgw | 4 +- src/mesa/drivers/dos/dmesa.c | 177 +++++++++++++++++---------------------- src/mesa/drivers/glide/fxapi.c | 3 +- src/mesa/drivers/glide/fxdd.c | 27 ++---- src/mesa/drivers/glide/fxddtex.c | 4 - src/mesa/drivers/glide/fxdrv.h | 2 - src/mesa/drivers/glide/fxtris.c | 4 +- src/mesa/drivers/glide/fxwgl.c | 15 +++- 11 files changed, 125 insertions(+), 143 deletions(-) (limited to 'include') diff --git a/docs/README.DJ b/docs/README.DJ index 2571a5327a0..15bff62177c 100644 --- a/docs/README.DJ +++ b/docs/README.DJ @@ -116,6 +116,16 @@ FAQ: lazy programmer and I found that the easiest way to keep buffer handling at peak performance ;-). + Q) I'm getting a "bad font!" fatal error. + A) By default, DOS GLUT compiles with GLUT_IMPORT_LIB, to cope with variable + access inside dynamic modules (same mechanism used for Win32 _DLL). Since + -DGLUT_IMPORT_LIB affects Mesa's `glut.h', your apps must be compiled the + same way GLUT was compiled (either with or without defining it). If you + want to use another `glut.h' when building your own demos, or just don't + feel happy about this, make sure you remove the line with GLUT_IMPORT_LIB + from `Mesa/src/glut/dos/Makefile.DJ' before (re)making GLUT. Beware, this + means you will never EVER be able to safely use `glut.dxe'! + Q) How do I query for a list of available video modes to choose as a visual? A) This is an ugly hack, for which I'm sure I'll burn in hell. First, query for a list of modes: @@ -238,7 +248,8 @@ v1.5 (jan-2004) x more changes to the 3dfx driver v1.6 (???-2004) - * fixed a horrible bug in VGA initialization routine + + added DMesaGetProcAddress + ! fixed a horrible bug in VGA initialization routine diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h index 364792ac1ab..e67e54aad15 100644 --- a/include/GL/dmesa.h +++ b/include/GL/dmesa.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 5.0 + * Version: 6.1 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2004 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"), @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.5 for Mesa + * DOS/DJGPP device driver v1.6 for Mesa * * Copyright (C) 2002 - Borca Daniel * Email : dborca@users.sourceforge.net @@ -34,8 +34,8 @@ #ifndef DMESA_H_included #define DMESA_H_included -#define DMESA_MAJOR_VERSION 5 -#define DMESA_MINOR_VERSION 0 +#define DMESA_MAJOR_VERSION 6 +#define DMESA_MINOR_VERSION 1 /* Sample Usage: * @@ -130,6 +130,11 @@ GLboolean DMesaResizeBuffer (GLint width, GLint height); */ void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue); +/* + * DMesa functions + */ +void *DMesaGetProcAddress (const char *name); + /* * DMesa state retrieval. */ diff --git a/src/mesa/Makefile.DJ b/src/mesa/Makefile.DJ index 517e24b3b4c..bd8e6f039d6 100644 --- a/src/mesa/Makefile.DJ +++ b/src/mesa/Makefile.DJ @@ -20,7 +20,7 @@ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# DOS/DJGPP core makefile v1.5 for Mesa +# DOS/DJGPP core makefile v1.6 for Mesa # # Copyright (C) 2002 - Borca Daniel # Email : dborca@users.sourceforge.net @@ -174,7 +174,7 @@ DRIVER_SOURCES += \ drivers/dos/dpmi.c endif -SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(DRIVER_SOURCES) +SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(COMMON_DRIVER_SOURCES) $(DRIVER_SOURCES) OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) diff --git a/src/mesa/Makefile.mgw b/src/mesa/Makefile.mgw index 2068667c603..bb370d86b45 100644 --- a/src/mesa/Makefile.mgw +++ b/src/mesa/Makefile.mgw @@ -20,7 +20,7 @@ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# MinGW core makefile v1.1 for Mesa +# MinGW core makefile v1.2 for Mesa # # Copyright (C) 2002 - Borca Daniel # Email : dborca@users.sourceforge.net @@ -170,7 +170,7 @@ DRIVER_SOURCES = \ drivers/windows/gdi/wgl.c endif -SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(DRIVER_SOURCES) +SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(COMMON_DRIVER_SOURCES) $(DRIVER_SOURCES) OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index 54323713864..c8fd91864bd 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 5.1 + * Version: 6.1 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2004 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"), @@ -23,7 +23,7 @@ */ /* - * DOS/DJGPP device driver v1.5 for Mesa + * DOS/DJGPP device driver v1.6 for Mesa * * Copyright (c) 2003 - Borca Daniel * Email : dborca@users.sourceforge.net @@ -53,6 +53,7 @@ #include "tnl/tnl.h" #include "tnl/t_context.h" #include "tnl/t_pipeline.h" +#include "drivers/common/driverfuncs.h" #include "video.h" #else /* FX */ #include "GL/fxmesa.h" @@ -868,76 +869,45 @@ static void dmesa_register_swrast_functions (GLcontext *ctx) +static void dmesa_update_state (GLcontext *ctx, GLuint new_state) +{ + /* Propagate statechange information to swrast and swrast_setup + * modules. The DMesa driver has no internal GL-dependent state. + */ + _swrast_InvalidateState( ctx, new_state ); + _ac_InvalidateState( ctx, new_state ); + _tnl_InvalidateState( ctx, new_state ); + _swsetup_InvalidateState( ctx, new_state ); +} + + + +/* Initialize the device driver function table with the functions + * we implement in this driver. + */ +static void dmesa_init_driver_functions (DMesaVisual visual, + struct dd_function_table *driver) +{ + driver->UpdateState = dmesa_update_state; + driver->GetString = get_string; + driver->GetBufferSize = get_buffer_size; + driver->Flush = flush; + driver->Finish = finish; + driver->Clear = clear; + driver->ClearColor = clear_color; + driver->ClearIndex = clear_index; +} + + + /* Setup pointers and other driver state that is constant for the life * of a context. */ static void dmesa_init_pointers (GLcontext *ctx) { - TNLcontext *tnl; struct swrast_device_driver *dd = _swrast_GetDeviceDriverReference(ctx); - ctx->Driver.GetString = get_string; - ctx->Driver.GetBufferSize = get_buffer_size; - ctx->Driver.Flush = flush; - ctx->Driver.Finish = finish; - - /* Software rasterizer pixel paths: - */ - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; - ctx->Driver.Clear = clear; - ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = _swrast_ReadPixels; - ctx->Driver.DrawBuffer = _swrast_DrawBuffer; - - /* Software texture functions: - */ - ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format; - ctx->Driver.TexImage1D = _mesa_store_teximage1d; - ctx->Driver.TexImage2D = _mesa_store_teximage2d; - ctx->Driver.TexImage3D = _mesa_store_teximage3d; - ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; - ctx->Driver.TexSubImage2D = _mesa_store_texsubimage2d; - ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; - ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; - - ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; - ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; - ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; - ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; - ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; - - ctx->Driver.CompressedTexImage1D = _mesa_store_compressed_teximage1d; - ctx->Driver.CompressedTexImage2D = _mesa_store_compressed_teximage2d; - ctx->Driver.CompressedTexImage3D = _mesa_store_compressed_teximage3d; - ctx->Driver.CompressedTexSubImage1D = _mesa_store_compressed_texsubimage1d; - ctx->Driver.CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d; - ctx->Driver.CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d; - - /* Swrast hooks for imaging extensions: - */ - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; - - /* Statechange callbacks: - */ - ctx->Driver.ClearColor = clear_color; - ctx->Driver.ClearIndex = clear_index; - - /* Initialize the TNL driver interface: - */ - tnl = TNL_CONTEXT(ctx); - tnl->Driver.RunPipeline = _tnl_run_pipeline; - dd->SetBuffer = set_buffer; - - /* Install swsetup for tnl->Driver.Render.*: - */ - _swsetup_Wakeup(ctx); /* The span functions should be in `dmesa_update_state', but I'm * pretty sure they will never change during the life of the Visual @@ -961,19 +931,6 @@ static void dmesa_init_pointers (GLcontext *ctx) dd->ReadRGBASpan = read_rgba_span; dd->ReadRGBAPixels = read_rgba_pixels; } - - - -static void dmesa_update_state (GLcontext *ctx, GLuint new_state) -{ - /* Propagate statechange information to swrast and swrast_setup - * modules. The DMesa driver has no internal GL-dependent state. - */ - _swrast_InvalidateState( ctx, new_state ); - _ac_InvalidateState( ctx, new_state ); - _tnl_InvalidateState( ctx, new_state ); - _swsetup_InvalidateState( ctx, new_state ); -} #endif /* FX */ @@ -1188,36 +1145,46 @@ DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share) { #ifndef FX - DMesaContext c; - GLboolean direct = GL_FALSE; + GLcontext *c; + TNLcontext *tnl; + struct dd_function_table functions; - if ((c=(DMesaContext)CALLOC_STRUCT(dmesa_context)) != NULL) { - _mesa_initialize_context((GLcontext *)c, + if ((c=(GLcontext *)CALLOC_STRUCT(dmesa_context)) != NULL) { + /* Initialize device driver function table */ + _mesa_init_driver_functions(&functions); + /* override with our functions */ + dmesa_init_driver_functions(visual, &functions); + + _mesa_initialize_context(c, (GLvisual *)visual, (GLcontext *)share, - (void *)c, direct); - - _mesa_enable_sw_extensions((GLcontext *)c); - _mesa_enable_1_3_extensions((GLcontext *)c); - _mesa_enable_1_4_extensions((GLcontext *)c); - _mesa_enable_1_5_extensions((GLcontext *)c); + &functions, + (void *)c); + + _mesa_enable_sw_extensions(c); + _mesa_enable_1_3_extensions(c); + _mesa_enable_1_4_extensions(c); + _mesa_enable_1_5_extensions(c); /* you probably have to do a bunch of other initializations here. */ - c->visual = visual; - - ((GLcontext *)c)->Driver.UpdateState = dmesa_update_state; + ((DMesaContext)c)->visual = visual; /* Initialize the software rasterizer and helper modules. */ - _swrast_CreateContext((GLcontext *)c); - _ac_CreateContext((GLcontext *)c); - _tnl_CreateContext((GLcontext *)c); - _swsetup_CreateContext((GLcontext *)c); - if (visual->rgb_flag) dmesa_register_swrast_functions((GLcontext *)c); - dmesa_init_pointers((GLcontext *)c); + _swrast_CreateContext(c); + _ac_CreateContext(c); + _tnl_CreateContext(c); + _swsetup_CreateContext(c); + /* tnl setup */ + tnl = TNL_CONTEXT(c); + tnl->Driver.RunPipeline = _tnl_run_pipeline; + /* swrast setup */ + if (visual->rgb_flag) dmesa_register_swrast_functions(c); + dmesa_init_pointers(c); + _swsetup_Wakeup(c); } - return c; + return (DMesaContext)c; #else /* FX */ return (DMesaContext)visual; @@ -1350,6 +1317,20 @@ void *DMesaGetCurrentContext (void) +void *DMesaGetProcAddress (const char *name) +{ + void *p = (void *)_glapi_get_proc_address(name); + +/* TODO: handle DMesa* namespace + if (p == NULL) { + } +*/ + + return p; +} + + + int DMesaGetIntegerv (GLenum pname, GLint *params) { switch (pname) { diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index 75629cbd3f2..50f783f3b25 100644 --- a/src/mesa/drivers/glide/fxapi.c +++ b/src/mesa/drivers/glide/fxapi.c @@ -42,6 +42,8 @@ #if defined(FX) #include "fxdrv.h" +#include "drivers/common/driverfuncs.h" + #ifndef TDFX_DEBUG int TDFX_DEBUG = (0 /* | VERBOSE_VARRAY */ @@ -653,7 +655,6 @@ fxMesaCreateContext(GLuint win, } _mesa_init_driver_functions(&functions); - ctx->Driver. ctx = fxMesa->glCtx = _mesa_create_context(fxMesa->glVis, shareCtx, &functions, (void *) fxMesa); if (!ctx) { diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 6e66f599aad..a07a27bad49 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -1498,6 +1498,11 @@ fxDDInitExtensions(GLcontext * ctx) if (fxMesa->HaveMirExt) { _mesa_enable_extension(ctx, "GL_ARB_texture_mirrored_repeat"); } + + /* core-level extensions */ +#if 1 + _mesa_enable_extension(ctx, "GL_ARB_vertex_buffer_object"); +#endif } @@ -1666,9 +1671,6 @@ fxSetupDDPointers(GLcontext * ctx) ctx->Driver.Clear = fxDDClear; ctx->Driver.DrawBuffer = fxDDSetDrawBuffer; ctx->Driver.GetBufferSize = fxDDBufferSize; - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; switch (fxMesa->colDepth) { case 15: ctx->Driver.ReadPixels = fxDDReadPixels555; @@ -1684,34 +1686,15 @@ fxSetupDDPointers(GLcontext * ctx) ctx->Driver.Bitmap = fxDDDrawBitmap4; break; } - ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; ctx->Driver.Finish = fxDDFinish; ctx->Driver.Flush = NULL; ctx->Driver.ChooseTextureFormat = fxDDChooseTextureFormat; - ctx->Driver.TexImage1D = _mesa_store_teximage1d; ctx->Driver.TexImage2D = fxDDTexImage2D; - ctx->Driver.TexImage3D = _mesa_store_teximage3d; - ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; ctx->Driver.TexSubImage2D = fxDDTexSubImage2D; - ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; - ctx->Driver.CompressedTexImage1D = _mesa_store_compressed_teximage1d; ctx->Driver.CompressedTexImage2D = fxDDCompressedTexImage2D; - ctx->Driver.CompressedTexImage3D = _mesa_store_compressed_teximage3d; - ctx->Driver.CompressedTexSubImage1D = _mesa_store_compressed_texsubimage1d; ctx->Driver.CompressedTexSubImage2D = fxDDCompressedTexSubImage2D; - ctx->Driver.CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d; ctx->Driver.IsCompressedFormat = fxDDIsCompressedFormat; ctx->Driver.CompressedTextureSize = fxDDCompressedTextureSize; - ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; - ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; - ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; - ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; - ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; - ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; ctx->Driver.TexEnv = fxDDTexEnv; ctx->Driver.TexParameter = fxDDTexParam; ctx->Driver.BindTexture = fxDDTexBind; diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 62f4ad15ee7..a6a5dc5aa79 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -148,7 +148,6 @@ fxDDTexBind(GLcontext * ctx, GLenum target, struct gl_texture_object *tObj) tObj->DriverData = fxAllocTexObjData(fxMesa); } ti = fxTMGetTexInfo(tObj); - assert(ti); fxMesa->texBindNumber++; ti->lastTimeUsed = fxMesa->texBindNumber; @@ -203,7 +202,6 @@ fxDDTexParam(GLcontext * ctx, GLenum target, struct gl_texture_object *tObj, if (!tObj->DriverData) tObj->DriverData = fxAllocTexObjData(fxMesa); ti = fxTMGetTexInfo(tObj); - assert(ti); switch (pname) { case GL_TEXTURE_MIN_FILTER: @@ -482,7 +480,6 @@ fxDDTexPalette(GLcontext * ctx, struct gl_texture_object *tObj) if (!tObj->DriverData) tObj->DriverData = fxAllocTexObjData(fxMesa); ti = fxTMGetTexInfo(tObj); - assert(ti); ti->paltype = convertPalette(fxMesa, ti->palette.data, &tObj->Palette); fxTexInvalidate(ctx, tObj); } @@ -519,7 +516,6 @@ fxDDTexUseGlbPalette(GLcontext * ctx, GLboolean state) struct gl_texture_object *tObj = ctx->Texture.Unit[0]._Current; if (!tObj->DriverData) tObj->DriverData = fxAllocTexObjData(fxMesa); - assert(tObj->DriverData); fxTexInvalidate(ctx, tObj); } } diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h index 1f31f621604..1b42be8e7bb 100644 --- a/src/mesa/drivers/glide/fxdrv.h +++ b/src/mesa/drivers/glide/fxdrv.h @@ -59,8 +59,6 @@ #include "math/m_vector.h" -#include "drivers/common/driverfuncs.h" - /* Define some shorter names for these things. */ diff --git a/src/mesa/drivers/glide/fxtris.c b/src/mesa/drivers/glide/fxtris.c index a5165684a37..3b82b570eb7 100644 --- a/src/mesa/drivers/glide/fxtris.c +++ b/src/mesa/drivers/glide/fxtris.c @@ -1215,14 +1215,14 @@ static void fxRunPipeline( GLcontext *ctx ) struct gl_texture_unit *t0 = &ctx->Texture.Unit[fxMesa->tmu_source[0]]; struct gl_texture_unit *t1 = &ctx->Texture.Unit[fxMesa->tmu_source[1]]; - if (t0 && t0->_Current && FX_TEXTURE_DATA(t0)) { + if (t0->_Current && FX_TEXTURE_DATA(t0)) { fxMesa->s0scale = FX_TEXTURE_DATA(t0)->sScale; fxMesa->t0scale = FX_TEXTURE_DATA(t0)->tScale; fxMesa->inv_s0scale = 1.0 / fxMesa->s0scale; fxMesa->inv_t0scale = 1.0 / fxMesa->t0scale; } - if (t1 && t1->_Current && FX_TEXTURE_DATA(t1)) { + if (t1->_Current && FX_TEXTURE_DATA(t1)) { fxMesa->s1scale = FX_TEXTURE_DATA(t1)->sScale; fxMesa->t1scale = FX_TEXTURE_DATA(t1)->tScale; fxMesa->inv_s1scale = 1.0 / fxMesa->s1scale; diff --git a/src/mesa/drivers/glide/fxwgl.c b/src/mesa/drivers/glide/fxwgl.c index adf88a485c6..ae1d913f3bf 100644 --- a/src/mesa/drivers/glide/fxwgl.c +++ b/src/mesa/drivers/glide/fxwgl.c @@ -218,7 +218,6 @@ struct __pixelformat__ pix[] = { FXMESA_NONE} } }; -static int qt_pix = sizeof(pix) / sizeof(pix[0]); static fxMesaContext ctx = NULL; static WNDPROC hWNDOldProc; @@ -676,6 +675,14 @@ wglSwapLayerBuffers(HDC hdc, UINT fuPlanes) return (FALSE); } +static int pfd_tablen (void) +{ + /* we should take an envvar for `fxMesaSelectCurrentBoard' */ + return (fxMesaSelectCurrentBoard(0) < GR_SSTTYPE_Voodoo4) + ? 2 /* only 16bit entries */ + : sizeof(pix) / sizeof(pix[0]); /* full table */ +} + GLAPI int GLAPIENTRY wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR * ppfd) { @@ -723,7 +730,7 @@ wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR * ppfd) } #endif - qt_valid_pix = qt_pix; + qt_valid_pix = pfd_tablen(); if (ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR) || ppfd->nVersion != 1) { SetLastError(0); @@ -787,7 +794,7 @@ wglDescribePixelFormat(HDC hdc, int iPixelFormat, UINT nBytes, { int qt_valid_pix; - qt_valid_pix = qt_pix; + qt_valid_pix = pfd_tablen(); if (iPixelFormat < 1 || iPixelFormat > qt_valid_pix || ((nBytes != sizeof(PIXELFORMATDESCRIPTOR)) && (nBytes != 0))) { @@ -830,7 +837,7 @@ wglSetPixelFormat(HDC hdc, int iPixelFormat, const PIXELFORMATDESCRIPTOR * ppfd) { int qt_valid_pix; - qt_valid_pix = qt_pix; + qt_valid_pix = pfd_tablen(); if (iPixelFormat < 1 || iPixelFormat > qt_valid_pix) { if (ppfd == NULL) { -- cgit v1.2.3 From 74cf25b0816f7b8e00ed9cbe2e028e943a92170f Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 27 Jan 2004 21:40:35 +0000 Subject: Missed this commit as part of the addition of GL_EXT_blend_equation_separate / GL_ATI_blend_equation_separate. --- include/GL/gl.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 5be9bb4f84a..b1cbb0e530c 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2212,6 +2212,17 @@ glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, #endif /* GL_MESA_program_debug */ +#ifndef GL_ATI_blend_equation_separate +#define GL_ATI_blend_equation_separate 1 + +#define GL_ALPHA_BLEND_EQUATION_ATI 0x883D + +GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA ); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA); + +#endif /* GL_ATI_blend_equation_separate */ + + /********************************************************************** * Begin system-specific stuff */ -- cgit v1.2.3 From c2f739169efed62cb3a1f80a02e9afa9da7092dc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 5 Feb 2004 15:23:12 +0000 Subject: update function mangling and add comment about it to gl.h --- include/GL/gl.h | 9 ++++++++- include/GL/gl_mangle.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index b1cbb0e530c..9bab8c51e28 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.0 + * Version: 6.1 * * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. * @@ -2223,6 +2223,13 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen #endif /* GL_ATI_blend_equation_separate */ +/** + ** NOTE!!!!! If you add new functions to this file, or update + ** glext.h be sure to regenerate the gl_mangle.h file. See comments + ** in that file for details. + **/ + + /********************************************************************** * Begin system-specific stuff */ diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 2116a87a646..8d3306b9fb1 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -49,12 +49,14 @@ #define glArrayElement MANGLE(ArrayElement) #define glArrayObjectATI MANGLE(ArrayObjectATI) #define glAsyncMarkerSGIX MANGLE(AsyncMarkerSGIX) +#define glAttachObjectARB MANGLE(AttachObjectARB) #define glBeginFragmentShaderATI MANGLE(BeginFragmentShaderATI) #define glBegin MANGLE(Begin) #define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV) #define glBeginQueryARB MANGLE(BeginQueryARB) #define glBeginQuery MANGLE(BeginQuery) #define glBeginVertexShaderEXT MANGLE(BeginVertexShaderEXT) +#define glBindAttribLocationARB MANGLE(BindAttribLocationARB) #define glBindBufferARB MANGLE(BindBufferARB) #define glBindBuffer MANGLE(BindBuffer) #define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI) @@ -85,6 +87,8 @@ #define glBlendColor MANGLE(BlendColor) #define glBlendEquationEXT MANGLE(BlendEquationEXT) #define glBlendEquation MANGLE(BlendEquation) +#define glBlendEquationSeparateATI MANGLE(BlendEquationSeparateATI) +#define glBlendEquationSeparateEXT MANGLE(BlendEquationSeparateEXT) #define glBlendFunc MANGLE(BlendFunc) #define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT) #define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR) @@ -174,6 +178,7 @@ #define glCombinerParameteriNV MANGLE(CombinerParameteriNV) #define glCombinerParameterivNV MANGLE(CombinerParameterivNV) #define glCombinerStageParameterfvNV MANGLE(CombinerStageParameterfvNV) +#define glCompileShaderARB MANGLE(CompileShaderARB) #define glCompressedTexImage1DARB MANGLE(CompressedTexImage1DARB) #define glCompressedTexImage1D MANGLE(CompressedTexImage1D) #define glCompressedTexImage2DARB MANGLE(CompressedTexImage2DARB) @@ -217,6 +222,8 @@ #define glCopyTexSubImage2D MANGLE(CopyTexSubImage2D) #define glCopyTexSubImage3DEXT MANGLE(CopyTexSubImage3DEXT) #define glCopyTexSubImage3D MANGLE(CopyTexSubImage3D) +#define glCreateProgramObjectARB MANGLE(CreateProgramObjectARB) +#define glCreateShaderObjectARB MANGLE(CreateShaderObjectARB) #define glCullFace MANGLE(CullFace) #define glCullParameterdvEXT MANGLE(CullParameterdvEXT) #define glCullParameterfvEXT MANGLE(CullParameterfvEXT) @@ -231,6 +238,7 @@ #define glDeleteFencesNV MANGLE(DeleteFencesNV) #define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI) #define glDeleteLists MANGLE(DeleteLists) +#define glDeleteObjectARB MANGLE(DeleteObjectARB) #define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV) #define glDeleteProgramsARB MANGLE(DeleteProgramsARB) #define glDeleteProgramsNV MANGLE(DeleteProgramsNV) @@ -244,6 +252,7 @@ #define glDepthFunc MANGLE(DepthFunc) #define glDepthMask MANGLE(DepthMask) #define glDepthRange MANGLE(DepthRange) +#define glDetachObjectARB MANGLE(DetachObjectARB) #define glDetailTexFuncSGIS MANGLE(DetailTexFuncSGIS) #define glDisableClientState MANGLE(DisableClientState) #define glDisable MANGLE(Disable) @@ -363,8 +372,12 @@ #define glGenTextures MANGLE(GenTextures) #define glGenVertexArraysAPPLE MANGLE(GenVertexArraysAPPLE) #define glGenVertexShadersEXT MANGLE(GenVertexShadersEXT) +#define glGetActiveAttribARB MANGLE(GetActiveAttribARB) +#define glGetActiveUniformARB MANGLE(GetActiveUniformARB) #define glGetArrayObjectfvATI MANGLE(GetArrayObjectfvATI) #define glGetArrayObjectivATI MANGLE(GetArrayObjectivATI) +#define glGetAttachedObjectsARB MANGLE(GetAttachedObjectsARB) +#define glGetAttribLocationARB MANGLE(GetAttribLocationARB) #define glGetBooleanv MANGLE(GetBooleanv) #define glGetBufferParameterivARB MANGLE(GetBufferParameterivARB) #define glGetBufferParameteriv MANGLE(GetBufferParameteriv) @@ -407,6 +420,7 @@ #define glGetFragmentLightivSGIX MANGLE(GetFragmentLightivSGIX) #define glGetFragmentMaterialfvSGIX MANGLE(GetFragmentMaterialfvSGIX) #define glGetFragmentMaterialivSGIX MANGLE(GetFragmentMaterialivSGIX) +#define glGetHandleARB MANGLE(GetHandleARB) #define glGetHistogramEXT MANGLE(GetHistogramEXT) #define glGetHistogram MANGLE(GetHistogram) #define glGetHistogramParameterfvEXT MANGLE(GetHistogramParameterfvEXT) @@ -415,6 +429,7 @@ #define glGetHistogramParameteriv MANGLE(GetHistogramParameteriv) #define glGetImageTransformParameterfvHP MANGLE(GetImageTransformParameterfvHP) #define glGetImageTransformParameterivHP MANGLE(GetImageTransformParameterivHP) +#define glGetInfoLogARB MANGLE(GetInfoLogARB) #define glGetInstrumentsSGIX MANGLE(GetInstrumentsSGIX) #define glGetIntegerv MANGLE(GetIntegerv) #define glGetInvariantBooleanvEXT MANGLE(GetInvariantBooleanvEXT) @@ -445,6 +460,8 @@ #define glGetMinmaxParameteriv MANGLE(GetMinmaxParameteriv) #define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI) #define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI) +#define glGetObjectParameterfvARB MANGLE(GetObjectParameterfvARB) +#define glGetObjectParameterivARB MANGLE(GetObjectParameterivARB) #define glGetOcclusionQueryivNV MANGLE(GetOcclusionQueryivNV) #define glGetOcclusionQueryuivNV MANGLE(GetOcclusionQueryuivNV) #define glGetPixelMapfv MANGLE(GetPixelMapfv) @@ -475,6 +492,7 @@ #define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv) #define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT) #define glGetSeparableFilter MANGLE(GetSeparableFilter) +#define glGetShaderSourceARB MANGLE(GetShaderSourceARB) #define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS) #define glGetString MANGLE(GetString) #define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI) @@ -491,6 +509,9 @@ #define glGetTexParameterfv MANGLE(GetTexParameterfv) #define glGetTexParameteriv MANGLE(GetTexParameteriv) #define glGetTrackMatrixivNV MANGLE(GetTrackMatrixivNV) +#define glGetUniformfvARB MANGLE(GetUniformfvARB) +#define glGetUniformivARB MANGLE(GetUniformivARB) +#define glGetUniformLocationARB MANGLE(GetUniformLocationARB) #define glGetVariantArrayObjectfvATI MANGLE(GetVariantArrayObjectfvATI) #define glGetVariantArrayObjectivATI MANGLE(GetVariantArrayObjectivATI) #define glGetVariantBooleanvEXT MANGLE(GetVariantBooleanvEXT) @@ -572,6 +593,7 @@ #define glLightModeliv MANGLE(LightModeliv) #define glLineStipple MANGLE(LineStipple) #define glLineWidth MANGLE(LineWidth) +#define glLinkProgramARB MANGLE(LinkProgramARB) #define glListBase MANGLE(ListBase) #define glListParameterfSGIX MANGLE(ListParameterfSGIX) #define glListParameterfvSGIX MANGLE(ListParameterfvSGIX) @@ -931,6 +953,7 @@ #define glShaderOp1EXT MANGLE(ShaderOp1EXT) #define glShaderOp2EXT MANGLE(ShaderOp2EXT) #define glShaderOp3EXT MANGLE(ShaderOp3EXT) +#define glShaderSourceARB MANGLE(ShaderSourceARB) #define glSharpenTexFuncSGIS MANGLE(SharpenTexFuncSGIS) #define glSpriteParameterfSGIX MANGLE(SpriteParameterfSGIX) #define glSpriteParameterfvSGIX MANGLE(SpriteParameterfvSGIX) @@ -1060,11 +1083,32 @@ #define glTrackMatrixNV MANGLE(TrackMatrixNV) #define glTranslated MANGLE(Translated) #define glTranslatef MANGLE(Translatef) +#define glUniform1fARB MANGLE(Uniform1fARB) +#define glUniform1fvARB MANGLE(Uniform1fvARB) +#define glUniform1iARB MANGLE(Uniform1iARB) +#define glUniform1ivARB MANGLE(Uniform1ivARB) +#define glUniform2fARB MANGLE(Uniform2fARB) +#define glUniform2fvARB MANGLE(Uniform2fvARB) +#define glUniform2iARB MANGLE(Uniform2iARB) +#define glUniform2ivARB MANGLE(Uniform2ivARB) +#define glUniform3fARB MANGLE(Uniform3fARB) +#define glUniform3fvARB MANGLE(Uniform3fvARB) +#define glUniform3iARB MANGLE(Uniform3iARB) +#define glUniform3ivARB MANGLE(Uniform3ivARB) +#define glUniform4fARB MANGLE(Uniform4fARB) +#define glUniform4fvARB MANGLE(Uniform4fvARB) +#define glUniform4iARB MANGLE(Uniform4iARB) +#define glUniform4ivARB MANGLE(Uniform4ivARB) +#define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB) +#define glUniformMatrix3fvARB MANGLE(UniformMatrix3fvARB) +#define glUniformMatrix4fvARB MANGLE(UniformMatrix4fvARB) #define glUnlockArraysEXT MANGLE(UnlockArraysEXT) #define glUnmapBufferARB MANGLE(UnmapBufferARB) #define glUnmapBuffer MANGLE(UnmapBuffer) #define glUnmapObjectBufferATI MANGLE(UnmapObjectBufferATI) #define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI) +#define glUseProgramObjectARB MANGLE(UseProgramObjectARB) +#define glValidateProgramARB MANGLE(ValidateProgramARB) #define glVariantArrayObjectATI MANGLE(VariantArrayObjectATI) #define glVariantbvEXT MANGLE(VariantbvEXT) #define glVariantdvEXT MANGLE(VariantdvEXT) -- cgit v1.2.3 From 1f3d9eedad03d578d8d4d86924e2168fec5bdc8d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 6 Feb 2004 01:17:30 +0000 Subject: added GLU_INCOMPATIBLE_GL_VERSION --- include/GL/glu.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/GL/glu.h b/include/GL/glu.h index 99515dcc373..c0bac75a8cc 100644 --- a/include/GL/glu.h +++ b/include/GL/glu.h @@ -75,6 +75,7 @@ extern "C" { #define GLU_INVALID_ENUM 100900 #define GLU_INVALID_VALUE 100901 #define GLU_OUT_OF_MEMORY 100902 +#define GLU_INCOMPATIBLE_GL_VERSION 100903 #define GLU_INVALID_OPERATION 100904 /* NurbsDisplay */ -- cgit v1.2.3 From d039b43e3074d14193944408ef211a9abf10608b Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Sat, 7 Feb 2004 10:54:36 +0000 Subject: added NUL driver for DMesa --- docs/README.DJ | 16 ++- include/GL/dmesa.h | 1 + src/mesa/Makefile.DJ | 1 + src/mesa/drivers/dos/dmesa.c | 105 +++++++++---------- src/mesa/drivers/dos/null.c | 222 +++++++++++++++++++++++++++++++++++++++++ src/mesa/drivers/dos/null.h | 41 ++++++++ src/mesa/drivers/dos/video.c | 8 ++ src/mesa/drivers/glide/fxwgl.c | 134 +++++++++++++------------ 8 files changed, 412 insertions(+), 116 deletions(-) create mode 100644 src/mesa/drivers/dos/null.c create mode 100644 src/mesa/drivers/dos/null.h (limited to 'include') diff --git a/docs/README.DJ b/docs/README.DJ index ed7f8c858ba..0ec3622a5a7 100644 --- a/docs/README.DJ +++ b/docs/README.DJ @@ -111,7 +111,7 @@ FAQ: Q) I made a simple application and it does nothing. It exits right away. Not even a blank screen. - A) The pure software drivers (VESA/VGA) support only double-buffered modes. + A) Pure software drivers (VESA/VGA/NUL) support only double-buffered modes. A) Another weird "feature" is that buffer width must be multiple of 8 (I'm a lazy programmer and I found that the easiest way to keep buffer handling at peak performance ;-). @@ -126,6 +126,13 @@ FAQ: from `Mesa/src/glut/dos/Makefile.DJ' before (re)making GLUT. Beware, this means you will never EVER be able to safely use `glut.dxe'! + Q) What is NUL driver good for, if I don't get any output at all? + A) For debugging. The NUL driver is very much like OSMesa. Everything is + done just the same as VESA/VGA drivers, only it doesn't touches your + video hardware. You can query the actual buffer by issuing: + DMesaGetIntegerv(DMESA_GET_BUFFER_ADDR, &buffer); + and dump it to a file. + Q) How do I query for a list of available video modes to choose as a visual? A) This is an ugly hack, for which I'm sure I'll burn in hell. First, query for a list of modes: @@ -189,7 +196,11 @@ chosen in such a way that first window will fit. If you need high resolution with small windows, set initial position far to the right (or way down); then you can move them back to any position right before the main loop. -The following environment variables can customize GLUT behaviour: + + +Environment variables: +~~~~~~~~~~~~~~~~~~~~~~ + DMESA_NULDRV - (any value) force NUL driver GLUT_FPS - print frames/second statistics to stderr DMESA_GLUT_REFRESH - set vertical screen refresh rate (VESA3) DMESA_GLUT_BPP - set default bits per pixel (VGA needs 8) @@ -248,6 +259,7 @@ v1.5 (jan-2004) x more changes to the 3dfx driver v1.6 (???-2004) + + implemented NUL driver + added DMesaGetProcAddress and glutGetProcAddress ! fixed a horrible bug in VGA initialization routine diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h index e67e54aad15..8d4c5bd645d 100644 --- a/include/GL/dmesa.h +++ b/include/GL/dmesa.h @@ -141,6 +141,7 @@ void *DMesaGetProcAddress (const char *name); #define DMESA_GET_SCREEN_SIZE 0x0100 #define DMESA_GET_DRIVER_CAPS 0x0200 #define DMESA_GET_VIDEO_MODES 0x0300 +#define DMESA_GET_BUFFER_ADDR 0x0400 #define DMESA_DRIVER_SWDB_BIT 0x1 /* software double-buffered */ #define DMESA_DRIVER_LLWO_BIT 0x2 /* lower-left window origin */ diff --git a/src/mesa/Makefile.DJ b/src/mesa/Makefile.DJ index fdcc2ec5467..56cf315c726 100644 --- a/src/mesa/Makefile.DJ +++ b/src/mesa/Makefile.DJ @@ -171,6 +171,7 @@ DRIVER_SOURCES += \ drivers/dos/vesa.c \ drivers/dos/blit.S \ drivers/dos/vga.c \ + drivers/dos/null.c \ drivers/dos/dpmi.c endif diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index c8fd91864bd..e0744a88de8 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -69,11 +69,8 @@ */ struct dmesa_visual { GLvisual gl_visual; - GLboolean db_flag; /* double buffered? */ - GLboolean rgb_flag; /* RGB mode? */ GLboolean sw_alpha; /* use Mesa's alpha buffer? */ - GLuint depth; /* bits per pixel (1, 8, 24, etc) */ - int zbuffer; /* Z=buffer: 0=no, 1=SW, -1=HW */ + int z_buffer; /* Z=buffer: 0=no, 1=SW, -1=HW */ }; /* @@ -95,7 +92,7 @@ struct dmesa_buffer { struct dmesa_context { GLcontext gl_ctx; /* the core library context */ DMesaVisual visual; - DMesaBuffer Buffer; + DMesaBuffer buffer; GLuint ClearColor; GLuint ClearIndex; /* etc... */ @@ -107,10 +104,10 @@ struct dmesa_context { /**************************************************************************** * Read/Write pixels ***************************************************************************/ -#define FLIP(y) (dmesa->Buffer->height - (y) - 1) +#define FLIP(y) (dmesa->buffer->height - (y) - 1) #define FLIP2(y) (_b_ - (y)) -#define DSTRIDE dmesa->Buffer->width +#define DSTRIDE dmesa->buffer->width /**************************************************************************** * RGB[A] @@ -208,7 +205,7 @@ static void write_rgba_pixels (const GLcontext *ctx, const GLubyte rgba[][4], const GLubyte mask[]) { const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, _w_ = DSTRIDE, _b_ = dmesa->Buffer->height - 1; + GLuint i, _w_ = DSTRIDE, _b_ = dmesa->buffer->height - 1; if (mask) { /* draw some pixels */ @@ -232,7 +229,7 @@ static void write_mono_rgba_pixels (const GLcontext *ctx, const GLchan color[4], const GLubyte mask[]) { const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, _w_ = DSTRIDE, _b_ = dmesa->Buffer->height - 1, rgba = vl_mixrgba(color); + GLuint i, _w_ = DSTRIDE, _b_ = dmesa->buffer->height - 1, rgba = vl_mixrgba(color); if (mask) { /* draw some pixels */ @@ -256,7 +253,7 @@ static void read_rgba_pixels (const GLcontext *ctx, GLubyte rgba[][4], const GLubyte mask[]) { const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, _w_ = DSTRIDE, _b_ = dmesa->Buffer->height - 1; + GLuint i, _w_ = DSTRIDE, _b_ = dmesa->buffer->height - 1; if (mask) { /* read some pixels */ @@ -371,7 +368,7 @@ static void write_index_pixels (const GLcontext *ctx, const GLuint index[], const GLubyte mask[]) { const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, _w_ = DSTRIDE, _b_ = dmesa->Buffer->height - 1; + GLuint i, _w_ = DSTRIDE, _b_ = dmesa->buffer->height - 1; if (mask) { /* draw some pixels */ @@ -395,7 +392,7 @@ static void write_mono_index_pixels (const GLcontext *ctx, GLuint colorIndex, const GLubyte mask[]) { const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, _w_ = DSTRIDE, _b_ = dmesa->Buffer->height - 1; + GLuint i, _w_ = DSTRIDE, _b_ = dmesa->buffer->height - 1; if (mask) { /* draw some pixels */ @@ -419,7 +416,7 @@ static void read_index_pixels (const GLcontext *ctx, GLuint index[], const GLubyte mask[]) { const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, _w_ = DSTRIDE, _b_ = dmesa->Buffer->height - 1; + GLuint i, _w_ = DSTRIDE, _b_ = dmesa->buffer->height - 1; if (mask) { /* read some pixels */ @@ -455,8 +452,8 @@ static void read_index_pixels (const GLcontext *ctx, #define SETUP_CODE \ const DMesaContext dmesa = (DMesaContext)ctx; \ - GLuint _b_ = dmesa->Buffer->height - 1; \ - GLuint _w_ = dmesa->Buffer->width; \ + GLuint _b_ = dmesa->buffer->height - 1; \ + GLuint _w_ = dmesa->buffer->width; \ GLuint rgb = vl_mixrgb(v2->color); #define RENDER_SPAN(span) \ @@ -479,8 +476,8 @@ static void read_index_pixels (const GLcontext *ctx, #define SETUP_CODE \ const DMesaContext dmesa = (DMesaContext)ctx; \ - GLuint _b_ = dmesa->Buffer->height - 1; \ - GLuint _w_ = dmesa->Buffer->width; \ + GLuint _b_ = dmesa->buffer->height - 1; \ + GLuint _w_ = dmesa->buffer->width; \ GLuint rgb = vl_mixrgb(v2->color); #define RENDER_SPAN(span) \ @@ -507,8 +504,8 @@ static void read_index_pixels (const GLcontext *ctx, #define SETUP_CODE \ const DMesaContext dmesa = (DMesaContext)ctx; \ - GLuint _b_ = dmesa->Buffer->height - 1; \ - GLuint _w_ = dmesa->Buffer->width; + GLuint _b_ = dmesa->buffer->height - 1; \ + GLuint _w_ = dmesa->buffer->width; #define RENDER_SPAN(span) \ GLuint i, offset = FLIP2(span.y)*_w_ + span.x; \ @@ -534,8 +531,8 @@ static void read_index_pixels (const GLcontext *ctx, #define SETUP_CODE \ const DMesaContext dmesa = (DMesaContext)ctx; \ - GLuint _b_ = dmesa->Buffer->height - 1; \ - GLuint _w_ = dmesa->Buffer->width; + GLuint _b_ = dmesa->buffer->height - 1; \ + GLuint _w_ = dmesa->buffer->width; #define RENDER_SPAN(span) \ GLuint i, offset = FLIP2(span.y)*_w_ + span.x; \ @@ -616,8 +613,8 @@ static void dmesa_choose_tri (GLcontext *ctx) #define SETUP_CODE \ const DMesaContext dmesa = (DMesaContext)ctx; \ - GLuint _b_ = dmesa->Buffer->height - 1; \ - GLuint _w_ = dmesa->Buffer->width; \ + GLuint _b_ = dmesa->buffer->height - 1; \ + GLuint _w_ = dmesa->buffer->width; \ GLuint rgb = vl_mixrgb(vert1->color); #define PLOT(X,Y) vl_putpixel(FLIP2(Y) * _w_ + X, rgb); @@ -638,8 +635,8 @@ static void dmesa_choose_tri (GLcontext *ctx) #define SETUP_CODE \ const DMesaContext dmesa = (DMesaContext)ctx; \ - GLuint _b_ = dmesa->Buffer->height - 1; \ - GLuint _w_ = dmesa->Buffer->width; \ + GLuint _b_ = dmesa->buffer->height - 1; \ + GLuint _w_ = dmesa->buffer->width; \ GLuint rgb = vl_mixrgb(vert1->color); #define PLOT(X,Y) \ @@ -751,7 +748,7 @@ static void clear (GLcontext *ctx, GLbitfield mask, GLboolean all, /* we can't handle color or index masking */ if ((*colorMask == 0xffffffff) && (ctx->Color.IndexMask == 0xffffffff)) { if (mask & DD_BACK_LEFT_BIT) { - int color = c->visual->rgb_flag ? c->ClearColor : c->ClearIndex; + int color = ((GLvisual *)(c->visual))->rgbMode ? c->ClearColor : c->ClearIndex; if (all) { vl_clear(color); @@ -958,10 +955,6 @@ DMesaVisual DMesaCreateVisual (GLint width, GLint redBits, greenBits, blueBits, alphaBits, indexBits; GLboolean sw_alpha; - if (!dbFlag) { - return NULL; - } - alphaBits = 0; if (!rgbFlag) { @@ -1017,6 +1010,9 @@ DMesaVisual DMesaCreateVisual (GLint width, alphaBits = alphaSize; sw_alpha = (alphaBits > 0); + if (!dbFlag) { + return NULL; + } if ((colDepth=vl_video_init(width, height, colDepth, rgbFlag, refresh)) <= 0) { return NULL; } @@ -1040,12 +1036,8 @@ DMesaVisual DMesaCreateVisual (GLint width, alphaBits?accumSize:0, /* accumAlpha */ 1); /* numSamples */ - v->depth = colDepth; - v->db_flag = dbFlag; - v->rgb_flag = rgbFlag; v->sw_alpha = sw_alpha; - - v->zbuffer = (depthSize > 0) ? 1 : 0; + v->z_buffer = (depthSize > 0) ? 1 : 0; } return v; @@ -1113,7 +1105,7 @@ DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, if ((b=(DMesaBuffer)CALLOC_STRUCT(dmesa_buffer)) != NULL) { _mesa_initialize_framebuffer((GLframebuffer *)b, (GLvisual *)visual, - visual->zbuffer == 1, + visual->z_buffer == 1, ((GLvisual *)visual)->stencilBits > 0, ((GLvisual *)visual)->accumRedBits > 0, visual->sw_alpha); @@ -1134,7 +1126,9 @@ DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, void DMesaDestroyBuffer (DMesaBuffer b) { #ifndef FX - free(b->the_window); + if (b->the_window != NULL) { + free(b->the_window); + } _mesa_destroy_framebuffer((GLframebuffer *)b); #endif } @@ -1179,7 +1173,7 @@ DMesaContext DMesaCreateContext (DMesaVisual visual, tnl = TNL_CONTEXT(c); tnl->Driver.RunPipeline = _tnl_run_pipeline; /* swrast setup */ - if (visual->rgb_flag) dmesa_register_swrast_functions(c); + if (((GLvisual *)visual)->rgbMode) dmesa_register_swrast_functions(c); dmesa_init_pointers(c); _swsetup_Wakeup(c); } @@ -1212,19 +1206,16 @@ GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos) { #ifndef FX GET_CURRENT_CONTEXT(ctx); - DMesaBuffer b = ((DMesaContext)ctx)->Buffer; + DMesaBuffer b = ((DMesaContext)ctx)->buffer; - if (vl_sync_buffer(&b->the_window, xpos, ypos, b->width, b->height) != 0) { - return GL_FALSE; - } else { + if (vl_sync_buffer(&b->the_window, xpos, ypos, b->width, b->height) == 0) { b->xpos = xpos; b->ypos = ypos; return GL_TRUE; } +#endif -#else return GL_FALSE; -#endif } @@ -1233,19 +1224,16 @@ GLboolean DMesaResizeBuffer (GLint width, GLint height) { #ifndef FX GET_CURRENT_CONTEXT(ctx); - DMesaBuffer b = ((DMesaContext)ctx)->Buffer; + DMesaBuffer b = ((DMesaContext)ctx)->buffer; - if (vl_sync_buffer(&b->the_window, b->xpos, b->ypos, width, height) != 0) { - return GL_FALSE; - } else { + if (vl_sync_buffer(&b->the_window, b->xpos, b->ypos, width, height) == 0) { b->width = width; b->height = height; return GL_TRUE; } +#endif -#else return GL_FALSE; -#endif } @@ -1261,7 +1249,7 @@ GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b) return GL_FALSE; } - c->Buffer = b; + c->buffer = b; _mesa_make_current((GLcontext *)c, (GLframebuffer *)b); if (((GLcontext *)c)->Viewport.Width == 0) { @@ -1391,6 +1379,21 @@ int DMesaGetIntegerv (GLenum pname, GLint *params) return n; } #endif + case DMESA_GET_BUFFER_ADDR: + #ifndef FX + { + DMesaContext c = (DMesaContext)DMesaGetCurrentContext(); + if (c != NULL) { + DMesaBuffer b = c->buffer; + if (b != NULL) { + params[0] = (GLint)b->the_window; + } + } + } + #else + return -1; + #endif + break; default: return -1; } diff --git a/src/mesa/drivers/dos/null.c b/src/mesa/drivers/dos/null.c new file mode 100644 index 00000000000..62e2c942ef9 --- /dev/null +++ b/src/mesa/drivers/dos/null.c @@ -0,0 +1,222 @@ +/* + * Mesa 3-D graphics library + * Version: 4.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. + */ + +/* + * DOS/DJGPP device driver v1.6 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@users.sourceforge.net + * Web : http://www.geocities.com/dborca + */ + + +#include +#include + +#include "video.h" +#include "null.h" + + + +static vl_mode *modes; + +#define null_color_precision 8 + + + + +static void null_blit_nop (void) +{ +} + + + +/* Desc: Attempts to detect VGA, check video modes and create selectors. + * + * In : - + * Out : mode array + * + * Note: - + */ +static vl_mode *null_init (void) +{ + static int m[][2] = { + {320, 200}, + {320, 240}, + {400, 300}, + {512, 384}, + {640, 400}, + {640, 480}, + {800, 600}, + {1024, 768}, + {1280, 1024}, + {1600, 1200} + }; + static int b[] = { + 8, + 15, + 16, + 24, + 32 + }; + + unsigned int i, j, k; + + if (modes == NULL) { + modes = malloc(sizeof(vl_mode) * + (1 + (sizeof(m) / sizeof(m[0]) * sizeof(b) / sizeof(b[0])))); + + if (modes != NULL) { + for (k = 0, i = 0; i < sizeof(m) / sizeof(m[0]); i++) { + for (j = 0; j < sizeof(b) / sizeof(b[0]); j++, k++) { + modes[k].xres = m[i][0]; + modes[k].yres = m[i][1]; + modes[k].bpp = b[j]; + modes[k].mode = 0x4000; + modes[k].scanlen = m[i][0] * ((b[j] + 7) / 8); + modes[k].sel = -1; + modes[k].gran = -1; + } + } + modes[k].xres = -1; + modes[k].yres = -1; + modes[k].bpp = -1; + modes[k].mode = 0xffff; + modes[k].scanlen = -1; + modes[k].sel = -1; + modes[k].gran = -1; + } + } + + return modes; +} + + + +/* Desc: Frees all resources allocated by VGA init code. + * + * In : - + * Out : - + * + * Note: - + */ +static void null_fini (void) +{ +} + + + +/* Desc: Attempts to enter specified video mode. + * + * In : ptr to mode structure, refresh rate + * Out : 0 if success + * + * Note: - + */ +static int null_entermode (vl_mode *p, int refresh) +{ + NUL.blit = null_blit_nop; + + return 0; + + (void)(p && refresh); /* silence compiler warning */ +} + + + +/* Desc: Restores to the mode prior to first call to null_entermode. + * + * In : - + * Out : - + * + * Note: - + */ +static void null_restore (void) +{ +} + + + +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses integer values + */ +static void null_setCI_i (int index, int red, int green, int blue) +{ + (void)(index && red && green && blue); /* silence compiler warning */ +} + + + +/* Desc: set one palette entry + * + * In : color index, R, G, B + * Out : - + * + * Note: uses normalized values + */ +static void null_setCI_f (int index, float red, float green, float blue) +{ + float max = (1 << null_color_precision) - 1; + + null_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); +} + + + +/* Desc: state retrieval + * + * In : parameter name, ptr to storage + * Out : 0 if request successfully processed + * + * Note: - + */ +static int null_get (int pname, int *params) +{ + switch (pname) { + default: + params[0] = params[0]; /* silence compiler warning */ + return -1; + } + return 0; +} + + + +/* + * the driver + */ +vl_driver NUL = { + null_init, + null_entermode, + NULL, + null_setCI_f, + null_setCI_i, + null_get, + null_restore, + null_fini +}; diff --git a/src/mesa/drivers/dos/null.h b/src/mesa/drivers/dos/null.h new file mode 100644 index 00000000000..a38accc8570 --- /dev/null +++ b/src/mesa/drivers/dos/null.h @@ -0,0 +1,41 @@ +/* + * Mesa 3-D graphics library + * Version: 4.0 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * DOS/DJGPP device driver v1.6 for Mesa + * + * Copyright (C) 2002 - Borca Daniel + * Email : dborca@yahoo.com + * Web : http://www.geocities.com/dborca + */ + + +#ifndef NULL_H_included +#define NULL_H_included + +#include "internal.h" + +extern vl_driver NUL; + +#endif diff --git a/src/mesa/drivers/dos/video.c b/src/mesa/drivers/dos/video.c index 41903ebe799..d3774e7c3e4 100644 --- a/src/mesa/drivers/dos/video.c +++ b/src/mesa/drivers/dos/video.c @@ -38,6 +38,7 @@ #include "internal.h" #include "vesa.h" #include "vga.h" +#include "null.h" #include "video.h" @@ -428,6 +429,13 @@ static vl_mode *v_init_hw (void) static vl_mode *q = NULL; if (q == NULL) { + /* are we forced to NUL driver? */ + if (getenv("DMESA_NULDRV")) { + if ((q = NUL.init()) != NULL) { + drv = &NUL; + } + return q; + } /* initialize hardware */ if ((q = VESA.init()) != NULL) { drv = &VESA; diff --git a/src/mesa/drivers/glide/fxwgl.c b/src/mesa/drivers/glide/fxwgl.c index c17560d7247..f8450b1b014 100644 --- a/src/mesa/drivers/glide/fxwgl.c +++ b/src/mesa/drivers/glide/fxwgl.c @@ -572,12 +572,12 @@ wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar, DWORD numChars, bitDevice = CreateCompatibleDC(fontDevice); - // Swap fore and back colors so the bitmap has the right polarity + /* Swap fore and back colors so the bitmap has the right polarity */ tempColor = GetBkColor(bitDevice); SetBkColor(bitDevice, GetTextColor(bitDevice)); SetTextColor(bitDevice, tempColor); - // Place chars based on base line + /* Place chars based on base line */ SetTextAlign(bitDevice, TA_BASELINE); for (i = 0; i < (int)numChars; i++) { @@ -588,34 +588,34 @@ wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar, DWORD numChars, HGDIOBJ origBmap; unsigned char *bmap; - curChar = (char)(i + firstChar); // [koolsmoky] explicit cast + curChar = (char)(i + firstChar); /* [koolsmoky] explicit cast */ - // Find how high/wide this character is + /* Find how high/wide this character is */ GetTextExtentPoint32(bitDevice, &curChar, 1, &size); - // Create the output bitmap + /* Create the output bitmap */ charWidth = size.cx; charHeight = size.cy; - bmapWidth = ((charWidth + 31) / 32) * 32; // Round up to the next multiple of 32 bits + bmapWidth = ((charWidth + 31) / 32) * 32; /* Round up to the next multiple of 32 bits */ bmapHeight = charHeight; bitObject = CreateCompatibleBitmap(bitDevice, bmapWidth, bmapHeight); - //VERIFY(bitObject); + /*VERIFY(bitObject);*/ - // Assign the output bitmap to the device + /* Assign the output bitmap to the device */ origBmap = SelectObject(bitDevice, bitObject); PatBlt(bitDevice, 0, 0, bmapWidth, bmapHeight, BLACKNESS); - // Use our source font on the device + /* Use our source font on the device */ SelectObject(bitDevice, GetCurrentObject(fontDevice, OBJ_FONT)); - // Draw the character + /* Draw the character */ TextOut(bitDevice, 0, metric.tmAscent, &curChar, 1); - // Unselect our bmap object + /* Unselect our bmap object */ SelectObject(bitDevice, origBmap); - // Convert the display dependant representation to a 1 bit deep DIB + /* Convert the display dependant representation to a 1 bit deep DIB */ numBytes = (bmapWidth * bmapHeight) / 8; bmap = MALLOC(numBytes); dibInfo->bmiHeader.biWidth = bmapWidth; @@ -623,21 +623,21 @@ wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar, DWORD numChars, res = GetDIBits(bitDevice, bitObject, 0, bmapHeight, bmap, dibInfo, DIB_RGB_COLORS); - // Create the GL object + /* Create the GL object */ glNewList(i + listBase, GL_COMPILE); glBitmap(bmapWidth, bmapHeight, 0.0, metric.tmDescent, charWidth, 0.0, bmap); glEndList(); - // CheckGL(); + /* CheckGL(); */ - // Destroy the bmap object + /* Destroy the bmap object */ DeleteObject(bitObject); - // Deallocate the bitmap data + /* Deallocate the bitmap data */ FREE(bmap); } - // Destroy the DC + /* Destroy the DC */ DeleteDC(bitDevice); FREE(dibInfo); @@ -695,87 +695,95 @@ GLAPI int GLAPIENTRY wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR * ppfd) { int i, best = -1, qt_valid_pix; + PIXELFORMATDESCRIPTOR pfd = *ppfd; #if 0 FILE *pix_file; pix_file = fopen("pix_log.txt", "a"); if (pix_file) { fprintf(pix_file, "wglChoosePixelFormat\n"); - fprintf(pix_file, "nSize = %d\n",ppfd->nSize); - fprintf(pix_file, "nVersion = %d\n",ppfd->nVersion); - fprintf(pix_file, "dwFlags = %d\n",ppfd->dwFlags); - fprintf(pix_file, "iPixelType = %d\n",ppfd->iPixelType); - fprintf(pix_file, "cColorBits = %d\n",ppfd->cColorBits); - fprintf(pix_file, "cRedBits = %d\n",ppfd->cRedBits); - fprintf(pix_file, "cRedShift = %d\n",ppfd->cRedShift); - fprintf(pix_file, "cGreenBits = %d\n",ppfd->cGreenBits); - fprintf(pix_file, "cGreenShift = %d\n",ppfd->cGreenShift); - fprintf(pix_file, "cBlueBits = %d\n",ppfd->cBlueBits); - fprintf(pix_file, "cBlueShift = %d\n",ppfd->cBlueShift); - fprintf(pix_file, "cAlphaBits = %d\n",ppfd->cAlphaBits); - fprintf(pix_file, "cAlphaShift = %d\n",ppfd->cAlphaShift); - fprintf(pix_file, "cAccumBits = %d\n",ppfd->cAccumBits); - fprintf(pix_file, "cAccumRedBits = %d\n",ppfd->cAccumRedBits); - fprintf(pix_file, "cAccumGreenBits = %d\n",ppfd->cAccumGreenBits); - fprintf(pix_file, "cAccumBlueBits = %d\n",ppfd->cAccumBlueBits); - fprintf(pix_file, "cAccumAlphaBits = %d\n",ppfd->cAccumAlphaBits); - fprintf(pix_file, "cDepthBits = %d\n",ppfd->cDepthBits); - fprintf(pix_file, "cStencilBits = %d\n",ppfd->cStencilBits); - fprintf(pix_file, "cAuxBuffers = %d\n",ppfd->cAuxBuffers); - fprintf(pix_file, "iLayerType = %d\n",ppfd->iLayerType); - fprintf(pix_file, "bReserved = %d\n",ppfd->bReserved); - fprintf(pix_file, "dwLayerMask = %d\n",ppfd->dwLayerMask); - fprintf(pix_file, "dwVisibleMask = %d\n",ppfd->dwVisibleMask); - fprintf(pix_file, "dwDamageMask = %d\n",ppfd->dwDamageMask); + fprintf(pix_file, "nSize = %d\n",pfd.nSize); + fprintf(pix_file, "nVersion = %d\n",pfd.nVersion); + fprintf(pix_file, "dwFlags = %d\n",pfd.dwFlags); + fprintf(pix_file, "iPixelType = %d\n",pfd.iPixelType); + fprintf(pix_file, "cColorBits = %d\n",pfd.cColorBits); + fprintf(pix_file, "cRedBits = %d\n",pfd.cRedBits); + fprintf(pix_file, "cRedShift = %d\n",pfd.cRedShift); + fprintf(pix_file, "cGreenBits = %d\n",pfd.cGreenBits); + fprintf(pix_file, "cGreenShift = %d\n",pfd.cGreenShift); + fprintf(pix_file, "cBlueBits = %d\n",pfd.cBlueBits); + fprintf(pix_file, "cBlueShift = %d\n",pfd.cBlueShift); + fprintf(pix_file, "cAlphaBits = %d\n",pfd.cAlphaBits); + fprintf(pix_file, "cAlphaShift = %d\n",pfd.cAlphaShift); + fprintf(pix_file, "cAccumBits = %d\n",pfd.cAccumBits); + fprintf(pix_file, "cAccumRedBits = %d\n",pfd.cAccumRedBits); + fprintf(pix_file, "cAccumGreenBits = %d\n",pfd.cAccumGreenBits); + fprintf(pix_file, "cAccumBlueBits = %d\n",pfd.cAccumBlueBits); + fprintf(pix_file, "cAccumAlphaBits = %d\n",pfd.cAccumAlphaBits); + fprintf(pix_file, "cDepthBits = %d\n",pfd.cDepthBits); + fprintf(pix_file, "cStencilBits = %d\n",pfd.cStencilBits); + fprintf(pix_file, "cAuxBuffers = %d\n",pfd.cAuxBuffers); + fprintf(pix_file, "iLayerType = %d\n",pfd.iLayerType); + fprintf(pix_file, "bReserved = %d\n",pfd.bReserved); + fprintf(pix_file, "dwLayerMask = %d\n",pfd.dwLayerMask); + fprintf(pix_file, "dwVisibleMask = %d\n",pfd.dwVisibleMask); + fprintf(pix_file, "dwDamageMask = %d\n",pfd.dwDamageMask); fclose(pix_file); } #endif -#if 1 || QUAKE2 - if (ppfd->cColorBits == 24 && ppfd->cDepthBits == 32) { - ppfd->cColorBits = 16; - ppfd->cDepthBits = 16; + qt_valid_pix = pfd_tablen(); + +#if 1 || QUAKE2 || GORE + /* QUAKE2: 24+32 */ + /* GORE : 24+16 */ + if (pfd.cColorBits == 24) { + /* the first 2 entries are 16bit */ + pfd.cColorBits = (qt_valid_pix > 2) ? 32 : 16; + } + if (pfd.cColorBits == 32) { + pfd.cDepthBits = 24; + } else if (pfd.cColorBits == 16) { + pfd.cDepthBits = 16; } #endif - qt_valid_pix = pfd_tablen(); - - if (ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR) || ppfd->nVersion != 1) { + if (pfd.nSize != sizeof(PIXELFORMATDESCRIPTOR) || pfd.nVersion != 1) { SetLastError(0); return (0); } for (i = 0; i < qt_valid_pix; i++) { - if (ppfd->cColorBits > 0 && pix[i].pfd.cColorBits != ppfd->cColorBits) + if (pfd.cColorBits > 0 && pix[i].pfd.cColorBits != pfd.cColorBits) continue; - if ((ppfd->dwFlags & PFD_DRAW_TO_WINDOW) + if ((pfd.dwFlags & PFD_DRAW_TO_WINDOW) && !(pix[i].pfd.dwFlags & PFD_DRAW_TO_WINDOW)) continue; - if ((ppfd->dwFlags & PFD_DRAW_TO_BITMAP) + if ((pfd.dwFlags & PFD_DRAW_TO_BITMAP) && !(pix[i].pfd.dwFlags & PFD_DRAW_TO_BITMAP)) continue; - if ((ppfd->dwFlags & PFD_SUPPORT_GDI) + if ((pfd.dwFlags & PFD_SUPPORT_GDI) && !(pix[i].pfd.dwFlags & PFD_SUPPORT_GDI)) continue; - if ((ppfd->dwFlags & PFD_SUPPORT_OPENGL) + if ((pfd.dwFlags & PFD_SUPPORT_OPENGL) && !(pix[i].pfd.dwFlags & PFD_SUPPORT_OPENGL)) continue; - if (!(ppfd->dwFlags & PFD_DOUBLEBUFFER_DONTCARE) - && ((ppfd->dwFlags & PFD_DOUBLEBUFFER) != + if (!(pfd.dwFlags & PFD_DOUBLEBUFFER_DONTCARE) + && ((pfd.dwFlags & PFD_DOUBLEBUFFER) != (pix[i].pfd.dwFlags & PFD_DOUBLEBUFFER))) continue; - if (!(ppfd->dwFlags & PFD_STEREO_DONTCARE) - && ((ppfd->dwFlags & PFD_STEREO) != + if (!(pfd.dwFlags & PFD_STEREO_DONTCARE) + && ((pfd.dwFlags & PFD_STEREO) != (pix[i].pfd.dwFlags & PFD_STEREO))) continue; - if (ppfd->cDepthBits > 0 && pix[i].pfd.cDepthBits == 0) + if (pfd.cDepthBits > 0 && pix[i].pfd.cDepthBits == 0) continue; /* need depth buffer */ - if (ppfd->cAlphaBits > 0 && pix[i].pfd.cAlphaBits == 0) + if (pfd.cAlphaBits > 0 && pix[i].pfd.cAlphaBits == 0) continue; /* need alpha buffer */ #if 0 - if ((ppfd->cColorBits == 32) && (ppfd->cStencilBits > 0 && pix[i].pfd.cStencilBits == 0)) + if ((pfd.cColorBits == 32) && (pfd.cStencilBits > 0 && pix[i].pfd.cStencilBits == 0)) continue; /* need stencil */ #endif - if (ppfd->iPixelType == pix[i].pfd.iPixelType) { + if (pfd.iPixelType == pix[i].pfd.iPixelType) { best = i + 1; break; } -- cgit v1.2.3 From 22633805fa4edf5771a4aa951de947e3346f76be Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Tue, 10 Feb 2004 07:46:07 +0000 Subject: fixed back fxMesaGetCurrentContext to match MakeCurrent --- include/GL/dmesa.h | 7 ++++++- include/GL/fxmesa.h | 2 +- src/mesa/drivers/dos/dmesa.c | 39 ++++++++++++++++++++++++++++++--------- src/mesa/drivers/glide/fxapi.c | 5 ++--- src/mesa/drivers/glide/fxddtex.c | 2 +- 5 files changed, 40 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h index 8d4c5bd645d..c7207bd8b6e 100644 --- a/include/GL/dmesa.h +++ b/include/GL/dmesa.h @@ -90,7 +90,7 @@ void DMesaDestroyContext (DMesaContext c); /* * Return a handle to the current context. */ -void *DMesaGetCurrentContext (void); +DMesaContext DMesaGetCurrentContext (void); @@ -106,6 +106,11 @@ DMesaBuffer DMesaCreateBuffer (DMesaVisual visual, */ void DMesaDestroyBuffer (DMesaBuffer b); +/* + * Return a handle to the current buffer. + */ +DMesaBuffer DMesaGetCurrentBuffer (void); + /* * Swap the front and back buffers for the given Buffer. * No action is taken if the buffer is not double buffered. diff --git a/include/GL/fxmesa.h b/include/GL/fxmesa.h index 5c63a8db658..057e6bd017e 100644 --- a/include/GL/fxmesa.h +++ b/include/GL/fxmesa.h @@ -77,7 +77,7 @@ GLAPI GLint GLAPIENTRY fxMesaSelectCurrentBoard(int n); GLAPI void GLAPIENTRY fxMesaMakeCurrent(fxMesaContext ctx); -GLAPI void * GLAPIENTRY fxMesaGetCurrentContext(void); +GLAPI fxMesaContext GLAPIENTRY fxMesaGetCurrentContext(void); GLAPI void GLAPIENTRY fxMesaSwapBuffers(void); diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index c7c8fcff849..752f13e909d 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -807,7 +807,7 @@ static const GLubyte* get_string (GLcontext *ctx, GLenum name) switch (name) { case GL_RENDERER: return (const GLubyte *)"Mesa DJGPP" - "\0port (c) Borca Daniel dec-2003"; + "\0port (c) Borca Daniel feb-2004"; default: return NULL; } @@ -1137,8 +1137,8 @@ void DMesaDestroyBuffer (DMesaBuffer b) DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share) { -#ifndef FX GLcontext *c; +#ifndef FX TNLcontext *tnl; struct dd_function_table functions; @@ -1177,11 +1177,11 @@ DMesaContext DMesaCreateContext (DMesaVisual visual, _swsetup_Wakeup(c); } - return (DMesaContext)c; - #else /* FX */ - return (DMesaContext)visual; + c = (GLcontext *)0xdeadbeef; #endif /* FX */ + + return (DMesaContext)c; } @@ -1292,13 +1292,34 @@ void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue) -void *DMesaGetCurrentContext (void) +DMesaContext DMesaGetCurrentContext (void) { -#ifndef FX GET_CURRENT_CONTEXT(ctx); - return ctx; + +#ifndef FX +#else + if (ctx != NULL) { + ctx = (GLcontext *)0xdeadbeef; + } +#endif + + return (DMesaContext)ctx; +} + + + +DMesaBuffer DMesaGetCurrentBuffer (void) +{ + const DMesaContext dmesa = DMesaGetCurrentContext(); + + if (dmesa == NULL) { + return NULL; + } + +#ifndef FX + return dmesa->buffer; #else - return fxMesaGetCurrentContext(); + return (DMesaBuffer)fxMesaGetCurrentContext(); #endif } diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index 61c69853e6a..8ffa36c9c36 100644 --- a/src/mesa/drivers/glide/fxapi.c +++ b/src/mesa/drivers/glide/fxapi.c @@ -147,10 +147,9 @@ GLint GLAPIENTRY fxMesaSelectCurrentBoard (int n) } -void * GLAPIENTRY fxMesaGetCurrentContext (void) +fxMesaContext GLAPIENTRY fxMesaGetCurrentContext (void) { - GET_CURRENT_CONTEXT(ctx); - return ctx; + return fxMesaCurrentCtx; } diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 17ff0826961..baaba8e6e31 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -1257,7 +1257,7 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, } } #endif -#if 1 || FX_COMPRESS_DXT5_AS_DXT3_HACK +#if 0 && FX_COMPRESS_DXT5_AS_DXT3_HACK /* [dBorca] either VSA is stupid at DXT5, * or our compression tool is broken. See * above for caveats. -- cgit v1.2.3 From 304d3aa9cb727eb4cd4797c33f8e13e5ac4285a9 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 19 Feb 2004 00:57:04 +0000 Subject: Refactored several variables out of XMesaVisual in favor of identical fields in __GLcontextModes (the base type). Removed the need to keep the XMesaVisualInfo pointer when building inside the X-server. --- include/GL/xmesa_x.h | 13 ++--- include/GL/xmesa_xf86.h | 11 ++-- src/mesa/drivers/x11/fakeglx.c | 14 ++--- src/mesa/drivers/x11/xm_api.c | 127 +++++++++++++++++++++++++++-------------- src/mesa/drivers/x11/xm_dd.c | 7 ++- src/mesa/drivers/x11/xmesaP.h | 15 ++--- 6 files changed, 109 insertions(+), 78 deletions(-) (limited to 'include') diff --git a/include/GL/xmesa_x.h b/include/GL/xmesa_x.h index def0447195f..8c4e41e545a 100644 --- a/include/GL/xmesa_x.h +++ b/include/GL/xmesa_x.h @@ -74,16 +74,11 @@ typedef XColor XMesaColor; #define XMesaFreeGC XFreeGC #define GET_COLORMAP_SIZE(__v) __v->visinfo->colormap_size -#define GET_REDMASK(__v) __v->visinfo->red_mask -#define GET_GREENMASK(__v) __v->visinfo->green_mask -#define GET_BLUEMASK(__v) __v->visinfo->blue_mask -#if defined(__cplusplus) || defined(c_plusplus) -#define GET_VISUAL_CLASS(__v) __v->visinfo->c_class -#else -#define GET_VISUAL_CLASS(__v) __v->visinfo->class -#endif +#define GET_REDMASK(__v) __v->mesa_visual.redMask +#define GET_GREENMASK(__v) __v->mesa_visual.greenMask +#define GET_BLUEMASK(__v) __v->mesa_visual.blueMask #define GET_VISUAL_DEPTH(__v) __v->visinfo->depth -#define GET_BLACK_PIXEL(__v) BlackPixel(__v->display, __v->visinfo->screen) +#define GET_BLACK_PIXEL(__v) BlackPixel(__v->display, __v->mesa_visual.screen) #define CHECK_BYTE_ORDER(__v) host_byte_order()==ImageByteOrder(__v->display) #define CHECK_FOR_HPCR(__v) XInternAtom(__v->display, "_HP_RGB_SMOOTH_MAP_LIST", True) diff --git a/include/GL/xmesa_xf86.h b/include/GL/xmesa_xf86.h index 983f234ddd9..88a94dcd765 100644 --- a/include/GL/xmesa_xf86.h +++ b/include/GL/xmesa_xf86.h @@ -174,12 +174,11 @@ do { \ FreeScratchGC(__gc); \ } while (0) -#define GET_COLORMAP_SIZE(__v) __v->visinfo->ColormapEntries -#define GET_REDMASK(__v) __v->visinfo->redMask -#define GET_GREENMASK(__v) __v->visinfo->greenMask -#define GET_BLUEMASK(__v) __v->visinfo->blueMask -#define GET_VISUAL_CLASS(__v) __v->visinfo->class -#define GET_VISUAL_DEPTH(__v) __v->visinfo->nplanes +#define GET_COLORMAP_SIZE(__v) __v->ColormapEntries +#define GET_REDMASK(__v) __v->mesa_visual.redMask +#define GET_GREENMASK(__v) __v->mesa_visual.greenMask +#define GET_BLUEMASK(__v) __v->mesa_visual.blueMask +#define GET_VISUAL_DEPTH(__v) __v->nplanes #define GET_BLACK_PIXEL(__v) __v->display->blackPixel #define CHECK_BYTE_ORDER(__v) GL_TRUE #define CHECK_FOR_HPCR(__v) GL_FALSE diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index a616915f1d9..063cc9c3575 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -296,7 +296,7 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo, for (i=0; idisplay == dpy - && v->level == level + && v->mesa_visual.level == level && v->ximage_flag == ximageFlag && v->mesa_visual.rgbMode == rgbFlag && v->mesa_visual.doubleBufferMode == dbFlag @@ -1559,7 +1559,7 @@ get_config( XMesaVisual xmvis, int attrib, int *value, GLboolean fbconfig ) *value = xmvis->visinfo->depth; return 0; case GLX_LEVEL: - *value = xmvis->level; + *value = xmvis->mesa_visual.level; return 0; case GLX_RGBA: if (xmvis->mesa_visual.rgbMode) { @@ -1623,11 +1623,11 @@ get_config( XMesaVisual xmvis, int attrib, int *value, GLboolean fbconfig ) } return 0; case GLX_TRANSPARENT_TYPE_EXT: - if (xmvis->level==0) { + if (xmvis->mesa_visual.level==0) { /* normal planes */ *value = GLX_NONE_EXT; } - else if (xmvis->level>0) { + else if (xmvis->mesa_visual.level>0) { /* overlay */ if (xmvis->mesa_visual.rgbMode) { *value = GLX_TRANSPARENT_RGB_EXT; @@ -1636,7 +1636,7 @@ get_config( XMesaVisual xmvis, int attrib, int *value, GLboolean fbconfig ) *value = GLX_TRANSPARENT_INDEX_EXT; } } - else if (xmvis->level<0) { + else if (xmvis->mesa_visual.level<0) { /* underlay */ *value = GLX_NONE_EXT; } @@ -1668,8 +1668,8 @@ get_config( XMesaVisual xmvis, int attrib, int *value, GLboolean fbconfig ) */ case GLX_VISUAL_CAVEAT_EXT: /* test for zero, just in case */ - if (xmvis->VisualCaveat > 0) - *value = xmvis->VisualCaveat; + if (xmvis->mesa_visual.visualRating > 0) + *value = xmvis->mesa_visual.visualRating; else *value = GLX_NONE_EXT; return 0; diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 9a852d9e4cc..16963ab71c7 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -81,12 +81,10 @@ #include "tnl/t_pipeline.h" #include "drivers/common/driverfuncs.h" - -#ifndef GLX_NONE_EXT -#define GLX_NONE_EXT 0x8000 +#ifdef XFree86Server +#include #endif - /* * Global X driver lock */ @@ -273,8 +271,7 @@ static GLint gamma_adjust( GLfloat gamma, GLint value, GLint max ) static int bits_per_pixel( XMesaVisual xmv ) { - XMesaVisualInfo visinfo = xmv->visinfo; - const int depth = visinfo->nplanes; + const int depth = xmv->nplanes; int i; for (i = 0; i < screenInfo.numPixmapFormats; i++) { if (screenInfo.formats[i].depth == depth) @@ -1200,26 +1197,25 @@ static GLboolean initialize_visual_and_buffer( int client, * being color indexed. This is weird but might be useful to someone. */ v->dithered_pf = v->undithered_pf = PF_Index; - v->index_bits = GET_VISUAL_DEPTH(v); + v->mesa_visual.indexBits = GET_VISUAL_DEPTH(v); } else { /* RGB WINDOW: * We support RGB rendering into almost any kind of visual. */ - int xclass; - xclass = GET_VISUAL_CLASS(v); - if (xclass==TrueColor || xclass==DirectColor) { + const int xclass = v->mesa_visual.visualType; + if (xclass==GLX_TRUE_COLOR || xclass==GLX_DIRECT_COLOR) { setup_truecolor( v, b, cmap ); } - else if (xclass==StaticGray && GET_VISUAL_DEPTH(v)==1) { + else if (xclass==GLX_STATIC_GRAY && GET_VISUAL_DEPTH(v)==1) { setup_monochrome( v, b ); } - else if (xclass==GrayScale || xclass==StaticGray) { + else if (xclass==GLX_GRAY_SCALE || xclass==GLX_STATIC_GRAY) { if (!setup_grayscale( client, v, b, cmap )) { return GL_FALSE; } } - else if ((xclass==PseudoColor || xclass==StaticColor) + else if ((xclass==GLX_PSEUDO_COLOR || xclass==GLX_STATIC_COLOR) && GET_VISUAL_DEPTH(v)>=4 && GET_VISUAL_DEPTH(v)<=16) { if (!setup_dithered_color( client, v, b, cmap )) { return GL_FALSE; @@ -1229,7 +1225,7 @@ static GLboolean initialize_visual_and_buffer( int client, _mesa_warning(NULL, "XMesa: RGB mode rendering not supported in given visual."); return GL_FALSE; } - v->index_bits = 0; + v->mesa_visual.indexBits = 0; if (_mesa_getenv("MESA_NO_DITHER")) { v->dithered_pf = v->undithered_pf; @@ -1246,7 +1242,7 @@ static GLboolean initialize_visual_and_buffer( int client, _mesa_printf("X/Mesa visual = %p\n", (void *) v); _mesa_printf("X/Mesa dithered pf = %u\n", v->dithered_pf); _mesa_printf("X/Mesa undithered pf = %u\n", v->undithered_pf); - _mesa_printf("X/Mesa level = %d\n", v->level); + _mesa_printf("X/Mesa level = %d\n", v->mesa_visual.level); _mesa_printf("X/Mesa depth = %d\n", GET_VISUAL_DEPTH(v)); _mesa_printf("X/Mesa bits per pixel = %d\n", v->BitsPerPixel); } @@ -1410,6 +1406,34 @@ xmesa_color_to_pixel( XMesaContext xmesa, GLubyte r, GLubyte g, GLubyte b, GLuby } +#define NUM_VISUAL_TYPES 6 + +/** + * Convert an X visual type to a GLX visual type. + * + * \param visualType X visual type (i.e., \c TrueColor, \c StaticGray, etc.) + * to be converted. + * \return If \c visualType is a valid X visual type, a GLX visual type will + * be returned. Otherwise \c GLX_NONE will be returned. + * + * \note + * This code was lifted directly from lib/GL/glx/glcontextmodes.c in the + * DRI CVS tree. + */ +static GLint +xmesa_convert_from_x_visual_type( int visualType ) +{ + static const int glx_visual_types[ NUM_VISUAL_TYPES ] = { + GLX_STATIC_GRAY, GLX_GRAY_SCALE, + GLX_STATIC_COLOR, GLX_PSEUDO_COLOR, + GLX_TRUE_COLOR, GLX_DIRECT_COLOR + }; + + return ( (unsigned) visualType < NUM_VISUAL_TYPES ) + ? glx_visual_types[ visualType ] : GLX_NONE; +} + + /**********************************************************************/ /***** Public Functions *****/ /**********************************************************************/ @@ -1435,7 +1459,7 @@ xmesa_color_to_pixel( XMesaContext xmesa, GLubyte r, GLubyte g, GLubyte b, GLuby * accum_alpha_size - requested bits/alpha accum values, or zero * num_samples - number of samples/pixel if multisampling, or zero * level - visual level, usually 0 - * visualCaveat - ala the GLX extension, usually GLX_NONE_EXT + * visualCaveat - ala the GLX extension, usually GLX_NONE * Return; a new XMesaVisual or 0 if error. */ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, @@ -1488,9 +1512,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, * the struct but we may need some of the information contained in it * at a later time. */ -#ifdef XFree86Server - v->visinfo = visinfo; -#else +#ifndef XFree86Server v->visinfo = (XVisualInfo *) MALLOC(sizeof(*visinfo)); if(!v->visinfo) { FREE(v); @@ -1499,19 +1521,6 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, MEMCPY(v->visinfo, visinfo, sizeof(*visinfo)); #endif -#ifdef XFree86Server - /* Initialize the depth of the screen */ - { - PixmapFormatRec *format; - - for (format = screenInfo.formats; - format->depth != display->rootDepth; - format++) - ; - v->screen_depth = format->bitsPerPixel; - } -#endif - /* check for MESA_GAMMA environment variable */ gamma = _mesa_getenv("MESA_GAMMA"); if (gamma) { @@ -1526,15 +1535,42 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, } v->ximage_flag = ximage_flag; - v->level = level; - v->VisualCaveat = visualCaveat; + +#ifdef XFree86Server + /* We could calculate these values by ourselves. nplanes is either the sum + * of the red, green, and blue bits or the number index bits. + * ColormapEntries is either (1U << index_bits) or + * (1U << max(redBits, greenBits, blueBits)). + */ + v->nplanes = visinfo->nplanes; + v->ColormapEntries = visinfo->ColormapEntries; + + v->mesa_visual.redMask = visinfo->redMask; + v->mesa_visual.greenMask = visinfo->greenMask; + v->mesa_visual.blueMask = visinfo->blueMask; + v->mesa_visual.visualID = visinfo->vid; + v->mesa_visual.screen = 0; /* FIXME: What should be done here? */ +#else + v->mesa_visual.redMask = visinfo->red_mask; + v->mesa_visual.greenMask = visinfo->green_mask; + v->mesa_visual.blueMask = visinfo->blue_mask; + v->mesa_visual.visualID = visinfo->visualid; + v->mesa_visual.screen = visinfo->screen; +#endif + +#if defined(XFree86Server) || !(defined(__cplusplus) || defined(c_plusplus)) + v->mesa_visual.visualType = xmesa_convert_from_x_visual_type(visinfo->class); +#else + v->mesa_visual.visualType = xmesa_convert_from_x_visual_type(visinfo->c_class); +#endif + + v->mesa_visual.visualRating = visualCaveat; (void) initialize_visual_and_buffer( 0, v, NULL, rgb_flag, 0, 0 ); { - int xclass; - xclass = GET_VISUAL_CLASS(v); - if (xclass==TrueColor || xclass==DirectColor) { + const int xclass = v->mesa_visual.visualType; + if (xclass==GLX_TRUE_COLOR || xclass==GLX_DIRECT_COLOR) { red_bits = bitcount(GET_REDMASK(v)); green_bits = bitcount(GET_GREENMASK(v)); blue_bits = bitcount(GET_BLUEMASK(v)); @@ -1561,12 +1597,14 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, rgb_flag, db_flag, stereo_flag, red_bits, green_bits, blue_bits, alpha_bits, - v->index_bits, + v->mesa_visual.indexBits, depth_size, stencil_size, accum_red_size, accum_green_size, accum_blue_size, accum_alpha_size, 0 ); + + v->mesa_visual.level = level; return v; } @@ -1837,13 +1875,14 @@ XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v, XMesaWindow w ) } -/* +/** * Create a new XMesaBuffer from an X pixmap. - * Input: v - the XMesaVisual - * p - the pixmap - * cmap - the colormap, may be 0 if using a TrueColor or DirectColor - * visual for the pixmap - * Return: new XMesaBuffer or NULL if error + * + * \param v the XMesaVisual + * \param p the pixmap + * \param cmap the colormap, may be 0 if using a \c GLX_TRUE_COLOR or + * \c GLX_DIRECT_COLOR visual for the pixmap + * \returns new XMesaBuffer or NULL if error */ XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v, XMesaPixmap p, XMesaColormap cmap ) diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index 9f4302b188f..68e56029d24 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -48,6 +48,9 @@ #include "tnl/tnl.h" #include "tnl/t_context.h" +#ifdef XFree86Server +#include +#endif /* * Return the size (width, height) of the X window for the given GLframebuffer. @@ -214,10 +217,10 @@ color_mask(GLcontext *ctx, GLboolean rmask, GLboolean gmask, GLboolean bmask, GLboolean amask) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); - int xclass = GET_VISUAL_CLASS(xmesa->xm_visual); + const int xclass = xmesa->xm_visual->mesa_visual.visualType; (void) amask; - if (xclass == TrueColor || xclass == DirectColor) { + if (xclass == GLX_TRUE_COLOR || xclass == GLX_DIRECT_COLOR) { unsigned long m; if (rmask && gmask && bmask) { m = ((unsigned long)~0L); diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index ee1f4add1a4..4a1f49799a0 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -86,17 +86,15 @@ enum pixel_format { struct xmesa_visual { GLvisual mesa_visual; /* Device independent visual parameters */ XMesaDisplay *display; /* The X11 display */ -#ifdef XFree86Server - GLint screen_depth; /* The depth of the screen */ -#else +#ifndef XFree86Server XVisualInfo *vishandle; /* Only used in fakeglx.c */ -#endif XMesaVisualInfo visinfo; /* X's visual info (pointer to private copy) */ +#else + GLint ColormapEntries; + GLint nplanes; +#endif GLint BitsPerPixel; /* True bits per pixel for XImages */ - GLint level; /* 0=normal, 1=overlay, etc */ - GLint VisualCaveat; /* for GLX_EXT_visual_rating extension */ - GLboolean ximage_flag; /* Use XImage for back buffer (not pixmap)? */ enum pixel_format dithered_pf; /* Pixel format when dithering */ @@ -106,9 +104,6 @@ struct xmesa_visual { GLfloat GreenGamma; GLfloat BlueGamma; - GLint rmult, gmult, bmult; /* Range of color values */ - GLint index_bits; /* Bits per pixel in CI mode */ - /* For PF_TRUECOLOR */ GLint rshift, gshift, bshift;/* Pixel color component shifts */ GLubyte Kernel[16]; /* Dither kernel */ -- cgit v1.2.3 From 0adce8f7c7f5d62f92d267c1952d7393edec5345 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 24 Feb 2004 03:01:27 +0000 Subject: upgraded to version 22 --- include/GL/glext.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 56d7399426d..4260acdacdb 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -52,9 +52,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2003/1/12 */ +/* glext.h last updated 2004/2/23 */ /* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 21 +#define GL_GLEXT_VERSION 22 #ifndef GL_VERSION_1_2 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 @@ -786,6 +786,9 @@ extern "C" { #define GL_COORD_REPLACE_ARB 0x8862 #endif +#ifndef GL_ARB_fragment_program_shadow +#endif + #ifndef GL_EXT_abgr #define GL_ABGR_EXT 0x8000 #endif @@ -3310,8 +3313,8 @@ typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type #define GL_ARB_texture_env_dot3 1 #endif -#ifndef GL_ARB_texture_mirror_repeat -#define GL_ARB_texture_mirror_repeat 1 +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 #endif #ifndef GL_ARB_depth_texture @@ -3661,6 +3664,10 @@ typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, #define GL_ARB_point_sprite 1 #endif +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 +#endif + #ifndef GL_EXT_abgr #define GL_EXT_abgr 1 #endif -- cgit v1.2.3 From ff6031c2091b9a80af132a8459310a64c6de4feb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 Mar 2004 16:20:38 +0000 Subject: remove some unneeded macros --- include/GL/xmesa_x.h | 9 ++++----- include/GL/xmesa_xf86.h | 43 +++++-------------------------------------- 2 files changed, 9 insertions(+), 43 deletions(-) (limited to 'include') diff --git a/include/GL/xmesa_x.h b/include/GL/xmesa_x.h index 8c4e41e545a..1455c88adbc 100644 --- a/include/GL/xmesa_x.h +++ b/include/GL/xmesa_x.h @@ -30,6 +30,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Authors: * Kevin E. Martin * + * When we're building the XMesa driver for stand-alone Mesa we + * include this file when building the xm_*.c files. + * We need to define some types and macros differently when building + * in the Xserver vs. stand-alone Mesa. */ #ifndef _XMESA_X_H_ @@ -55,19 +59,14 @@ typedef XColor XMesaColor; #define XMesaSetBackground XSetBackground #define XMesaSetPlaneMask XSetPlaneMask #define XMesaSetFunction XSetFunction -#define XMesaSetDashes XSetDashes -#define XMesaSetLineAttributes XSetLineAttributes #define XMesaSetFillStyle XSetFillStyle #define XMesaSetTile XSetTile -#define XMesaSetStipple XSetStipple #define XMesaDrawPoint XDrawPoint #define XMesaDrawPoints XDrawPoints -#define XMesaDrawLine XDrawLine #define XMesaFillRectangle XFillRectangle #define XMesaPutImage XPutImage #define XMesaCopyArea XCopyArea -#define XMesaFillPolygon XFillPolygon #define XMesaCreatePixmap XCreatePixmap #define XMesaFreePixmap XFreePixmap diff --git a/include/GL/xmesa_xf86.h b/include/GL/xmesa_xf86.h index 88a94dcd765..63a8e57dbca 100644 --- a/include/GL/xmesa_xf86.h +++ b/include/GL/xmesa_xf86.h @@ -30,6 +30,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Authors: * Kevin E. Martin * + * When we're building the XMesa driver for use in the X server (as the + * indirect render) we include this file when building the xm_*.c files. + * We need to define some types and macros differently when building + * in the Xserver vs. stand-alone Mesa. */ #ifndef _XMESA_XF86_H_ @@ -66,25 +70,6 @@ do { \ dixChangeGC(NullClient, __gc, __mask, NULL, __v); \ } while (0) -#define XMesaSetDashes(__d,__gc,__do,__dl,__n) \ -do { \ - (void) __d; \ - SetDashes(__gc, __do, __n, (unsigned char *)__dl); \ -} while (0) - -#define XMesaSetLineAttributes(__d,__gc,__lw,__ls,__cs,__js) \ -do { \ - CARD32 __v[4]; \ - (void) __d; \ - __v[0] = __lw; \ - __v[1] = __ls; \ - __v[2] = __cs; \ - __v[3] = __js; \ - dixChangeGC(NullClient, __gc, \ - GCLineWidth|GCLineStyle|GCCapStyle|GCJoinStyle, \ - __v, NULL); \ -} while (0) - #define XMesaSetForeground(d,gc,v) XMesaSetGeneric(d,gc,v,GCForeground) #define XMesaSetBackground(d,gc,v) XMesaSetGeneric(d,gc,v,GCBackground) #define XMesaSetPlaneMask(d,gc,v) XMesaSetGeneric(d,gc,v,GCPlaneMask) @@ -92,7 +77,6 @@ do { \ #define XMesaSetFillStyle(d,gc,v) XMesaSetGeneric(d,gc,v,GCFillStyle) #define XMesaSetTile(d,gc,v) XMesaSetGenericPtr(d,gc,v,GCTile) -#define XMesaSetStipple(d,gc,v) XMesaSetGenericPtr(d,gc,v,GCStipple) #define XMesaDrawPoint(__d,__b,__gc,__x,__y) \ do { \ @@ -111,18 +95,6 @@ do { \ (*gc->ops->PolyPoint)(__b, __gc, __m, __n, __p); \ } while (0) -#define XMesaDrawLine(__d,__b,__gc,__x0,__y0,__x1,__y1) \ -do { \ - XMesaPoint __p[2]; \ - (void) __d; \ - ValidateGC(__b, __gc); \ - __p[0].x = __x0; \ - __p[0].y = __y0; \ - __p[1].x = __x1; \ - __p[1].y = __y1; \ - (*__gc->ops->Polylines)(__b, __gc, CoordModeOrigin, 2, __p); \ -} while (0) - #define XMesaFillRectangle(__d,__b,__gc,__x,__y,__w,__h) \ do { \ xRectangle __r[1]; \ @@ -155,16 +127,11 @@ do { \ __sx, __sy, __w, __h, __x, __y); \ } while (0) -#define XMesaFillPolygon(__d,__b,__gc,__p,__n,__s,__m) \ -do { \ - (void) __d; \ - ValidateGC(__b, __gc); \ - (*__gc->ops->FillPolygon)(__b, __gc, __s, __m, __n, __p); \ -} while (0) /* CreatePixmap returns a PixmapPtr; so, it cannot be inside braces */ #define XMesaCreatePixmap(__d,__b,__w,__h,__depth) \ (*__d->CreatePixmap)(__d, __w, __h, __depth) + #define XMesaFreePixmap(__d,__b) \ (*__d->DestroyPixmap)(__b) -- cgit v1.2.3 From 192c988c7360d026a6f345b21acc2cdf41977915 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 22 Mar 2004 23:31:29 +0000 Subject: new DRI interface header --- include/GL/internal/dri_interface.h | 499 ++++++++++++++++++++++++++++++++++++ 1 file changed, 499 insertions(+) create mode 100644 include/GL/internal/dri_interface.h (limited to 'include') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h new file mode 100644 index 00000000000..1f1917d0bf9 --- /dev/null +++ b/include/GL/internal/dri_interface.h @@ -0,0 +1,499 @@ +/* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * (C) Copyright IBM Corporation 2004 + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 (including the next + * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS 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. + */ + +/** + * \file dri_interface.h + * + * This file contains all the types and functions that define the interface + * between a DRI driver and driver loader. Currently, the most common driver + * loader is the XFree86 libGL.so. However, other loaders do exist, and in + * the future the server-side libglx.a will also be a loader. + * + * \author Kevin E. Martin + * \author Ian Romanick + */ + +/* FIXME: With a small amount of work, these two includes can be removed. */ +#include +#include + +#ifndef DRI_NEW_INTERFACE_ONLY +#include +#endif + +#include +#include + +/** + * \name DRI interface structures + * + * The following structures define the interface between the GLX client + * side library and the DRI (direct rendering infrastructure). + */ +/*@{*/ +typedef struct __DRIdisplayRec __DRIdisplay; +typedef struct __DRIscreenRec __DRIscreen; +typedef struct __DRIcontextRec __DRIcontext; +typedef struct __DRIdrawableRec __DRIdrawable; +typedef struct __DRIdriverRec __DRIdriver; +typedef struct __DRIframebufferRec __DRIframebuffer; +typedef struct __DRIversionRec __DRIversion; +typedef unsigned long __DRIid; +struct _XF86DRIClipRect; +/*@}*/ + + +/** + * \name Functions provided by the driver loader. + */ +/*@{*/ +extern __DRIscreen *__glXFindDRIScreen(Display *dpy, int scrn); + + +/** + * Type of a pointer to \c __glXGetInternalVersion, as returned by + * \c glXGetProcAddress. + * + * \sa __glXGetInternalVersion, glXGetProcAddress + */ +typedef int (* PFNGLXGETINTERNALVERSIONPROC) ( void ); + +/** + * Type of a pointer to \c __glXWindowExists, as returned by + * \c glXGetProcAddress. + * + * \sa __glXWindowExists, glXGetProcAddress + */ +typedef Bool (* PFNGLXWINDOWEXISTSPROC) (Display *dpy, GLXDrawable draw); + +/** + * Type of a pointer to \c __glXGetUST, as returned by \c glXGetProcAddress. + * + * \sa __glXGetUST, glXGetProcAddress + */ +typedef int (* PFNGLXGETUSTPROC) ( int64_t * ust ); + +/** + * Type of pointer to \c __glXCreateContextModes, as returned by + * \c glXGetProcAddress. + * + * \sa _gl_context_modes_create, glXGetProcAddress + */ + +typedef __GLcontextModes * (* PFNGLXCREATECONTEXTMODES) ( unsigned count, + size_t minimum_bytes_per_struct ); + +/** + * Type of a pointer to \c glXGetScreenDriver, as returned by + * \c glXGetProcAddress. This function is used to get the name of the DRI + * driver for the specified screen of the specified display. The driver + * name is typically used with \c glXGetDriverConfig. + * + * \sa glXGetScreenDriver, glXGetProcAddress, glXGetDriverConfig + */ +typedef const char * (* PFNGLXGETSCREENDRIVERPROC) (Display *dpy, int scrNum); + +/** + * Type of a pointer to \c glXGetDriverConfig, as returned by + * \c glXGetProcAddress. This function is used to get the XML document + * describing the configuration options available for the specified driver. + * + * \sa glXGetDriverConfig, glXGetProcAddress, glXGetScreenDriver + */ +typedef const char * (* PFNGLXGETDRIVERCONFIGPROC) (const char *driverName); + +/** + * Type of a pointer to \c __glXScrEnableExtension, as returned by + * \c glXGetProcAddress. This function is used to enable a GLX extension + * on the specified screen. + * + * \sa __glXScrEnableExtension, glXGetProcAddress + */ +typedef void (* PFNGLXSCRENABLEEXTENSIONPROC) ( void *psc, const char * name ); + +/** + * Type of a pointer to \c __glXGetDrawableInfo, as returned by + * \c glXGetProcAddress. This function is used to get information about the + * position, size, and clip rects of a drawable. + * + * \sa __glXGetDrawableInfo, glXGetProcAddress + */ +typedef Bool (* PFNGLXGETDRAWABLEINFOPROC) ( Display *dpy, int scrn, + Drawable draw, unsigned int * index, unsigned int * stamp, + int * x, int * y, int * width, int * height, + int * numClipRects, struct _XF86DRIClipRect ** pClipRects, + int * backX, int * backY, + int * numBackClipRects, struct _XF86DRIClipRect ** pBackClipRects ); +/*@}*/ + + +/** + * \name Functions and data provided by the driver. + */ +/*@{*/ + +extern void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc, + const __GLcontextModes * modes, const __DRIversion * ddx_version, + const __DRIversion * dri_version, const __DRIversion * drm_version, + const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, + int internal_api_version, __GLcontextModes ** driver_modes ); + +#ifndef DRI_NEW_INTERFACE_ONLY + +extern void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, + int numConfigs, __GLXvisualConfig *config); + +/** This is optionally implemented in each driver */ +extern void __driRegisterExtensions( void ); + +#endif /* DRI_NEW_INTERFACE_ONLY */ + + +/** + * XML document describing the configuration options supported by the + * driver. + */ +extern const char __driConfigOptions[]; + +/*@}*/ + + +/** + * Stored version of some component (i.e., server-side DRI module, kernel-side + * DRM, etc.). + * + * \todo + * There are several data structures that explicitly store a major version, + * minor version, and patch level. These structures should be modified to + * have a \c __DRIversionRec instead. + */ +struct __DRIversionRec { + int major; /**< Major version number. */ + int minor; /**< Minor version number. */ + int patch; /**< Patch-level. */ +}; + +/** + * Framebuffer information record. Used by libGL to communicate information + * about the framebuffer to the driver's \c __driCreateNewScreen function. + * + * In XFree86, most of this information is derrived from data returned by + * calling \c XF86DRIGetDeviceInfo. + * + * \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen + * __driUtilCreateNewScreen CallCreateNewScreen + * + * \bug This structure could be better named. + */ +struct __DRIframebufferRec { + unsigned char *base; /**< Framebuffer base address in the CPU's + * address space. This value is calculated by + * calling \c drmMap on the framebuffer handle + * returned by \c XF86DRIGetDeviceInfo (or a + * similar function). + */ + int size; /**< Framebuffer size, in bytes. */ + int stride; /**< Number of bytes from one line to the next. */ + int width; /**< Pixel width of the framebuffer. */ + int height; /**< Pixel height of the framebuffer. */ + int dev_priv_size; /**< Size of the driver's dev-priv structure. */ + void *dev_priv; /**< Pointer to the driver's dev-priv structure. */ +}; + + +/** + * Screen dependent methods. This structure is initialized during the + * \c __DRIdisplayRec::createScreen call. + */ +struct __DRIscreenRec { + /** + * Method to destroy the private DRI screen data. + */ + void (*destroyScreen)(Display *dpy, int scrn, void *screenPrivate); + + /** + * Method to create the private DRI context data and initialize the + * context dependent methods. + * + * \sa __DRIscreenRec::createNewContext driCreateContext + * driCreateNewContext + * + * \deprecated + * This function has been replaced by \c __DRIscreenRec::createNewContext. + * New drivers will continue to export this method, but it will eventually + * (in the next XFree86 major relearse) go away. + */ +#ifndef DRI_NEW_INTERFACE_ONLY + void *(*createContext)(Display *dpy, XVisualInfo *vis, void *sharedPrivate, + __DRIcontext *pctx); +#else + void * createContext; +#endif /* DRI_NEW_INTERFACE_ONLY */ + + /** + * Method to create the private DRI drawable data and initialize the + * drawable dependent methods. + */ + void *(*createNewDrawable)(Display *dpy, const __GLcontextModes *modes, + GLXDrawable draw, __DRIdrawable *pdraw, + int renderType, const int *attrs); + + /** + * Method to return a pointer to the DRI drawable data. + */ + __DRIdrawable *(*getDrawable)(Display *dpy, GLXDrawable draw, + void *drawablePrivate); + + /** + * Opaque pointer to private per screen direct rendering data. \c NULL + * if direct rendering is not supported on this screen. Never + * dereferenced in libGL. + */ + void *private; + + /** + * Get the number of vertical refreshes since some point in time before + * this function was first called (i.e., system start up). + * + * \since Internal API version 20030317. + */ + int (*getMSC)( void *screenPrivate, int64_t *msc ); + + /** + * Opaque pointer that points back to the containing + * \c __GLXscreenConfigs. This data structure is shared with DRI drivers + * but \c __GLXscreenConfigs is not. However, they are needed by some GLX + * functions called by DRI drivers. + * + * \since Internal API version 20030813. + */ + void *screenConfigs; + + /** + * Functions associated with MESA_allocate_memory. + * + * \since Internal API version 20030815. + */ + /*@{*/ + void *(*allocateMemory)(Display *dpy, int scrn, GLsizei size, + GLfloat readfreq, GLfloat writefreq, + GLfloat priority); + + void (*freeMemory)(Display *dpy, int scrn, GLvoid *pointer); + + GLuint (*memoryOffset)(Display *dpy, int scrn, const GLvoid *pointer); + /*@}*/ + + /** + * Method to create the private DRI context data and initialize the + * context dependent methods. + * + * \since Internal API version 20031201. + */ + void * (*createNewContext)(Display *dpy, const __GLcontextModes *modes, + int render_type, + void *sharedPrivate, __DRIcontext *pctx); +}; + +/** + * Context dependent methods. This structure is initialized during the + * \c __DRIscreenRec::createContext call. + */ +struct __DRIcontextRec { + /** + * Method to destroy the private DRI context data. + */ + void (*destroyContext)(Display *dpy, int scrn, void *contextPrivate); + + /** + * Method to bind a DRI drawable to a DRI graphics context. + * + * \deprecated Replaced by bindContext3. + */ +#ifndef DRI_NEW_INTERFACE_ONLY + Bool (*bindContext)(Display *dpy, int scrn, GLXDrawable draw, + GLXContext gc); +#else + void *bindContext; +#endif /* DRI_NEW_INTERFACE_ONLY */ + + /** + * Method to unbind a DRI drawable to a DRI graphics context. + * + * \deprecated Replaced by unbindContext3. + */ +#ifndef DRI_NEW_INTERFACE_ONLY + Bool (*unbindContext)(Display *dpy, int scrn, GLXDrawable draw, + GLXContext gc, int will_rebind); +#else + void *unbindContext; +#endif /* DRI_NEW_INTERFACE_ONLY */ + + /** + * Opaque pointer to private per context direct rendering data. + * \c NULL if direct rendering is not supported on the display or + * screen used to create this context. Never dereferenced in libGL. + */ + void *private; + + /** + * Method to bind a DRI drawable to a DRI graphics context. + * + * \since Internal API version 20030606. + * \deprecated Replaced by bindContext3. + */ +#ifndef DRI_NEW_INTERFACE_ONLY + Bool (*bindContext2)(Display *dpy, int scrn, GLXDrawable draw, + GLXDrawable read, GLXContext gc); +#else + void *bindContext2; +#endif /* DRI_NEW_INTERFACE_ONLY */ + + /** + * Method to unbind a DRI drawable from a DRI graphics context. + * + * \since Internal API version 20030606. + * \deprecated Replaced by unbindContext3. + */ +#ifndef DRI_NEW_INTERFACE_ONLY + Bool (*unbindContext2)(Display *dpy, int scrn, GLXDrawable draw, + GLXDrawable read, GLXContext gc); +#else + void *unbindContext2; +#endif /* DRI_NEW_INTERFACE_ONLY */ + + /** + * Pointer to the mode used to create this context. + * + * \since Internal API version 20040317. + */ + const __GLcontextModes * mode; + + /** + * Method to bind a DRI drawable to a DRI graphics context. + * + * \since Internal API version 20040317. + */ + Bool (*bindContext3)(Display *dpy, int scrn, __DRIid draw, + __DRIid read, __DRIcontext *ctx); + + /** + * Method to unbind a DRI drawable from a DRI graphics context. + * + * \since Internal API version 20040317. + */ + Bool (*unbindContext3)(Display *dpy, int scrn, __DRIid draw, + __DRIid read, __DRIcontext *ctx); +}; + +/** + * Drawable dependent methods. This structure is initialized during the + * \c __DRIscreenRec::createDrawable call. \c createDrawable is not called + * by libGL at this time. It's currently used via the dri_util.c utility code + * instead. + */ +struct __DRIdrawableRec { + /** + * Method to destroy the private DRI drawable data. + */ + void (*destroyDrawable)(Display *dpy, void *drawablePrivate); + + /** + * Method to swap the front and back buffers. + */ + void (*swapBuffers)(Display *dpy, void *drawablePrivate); + + /** + * Opaque pointer to private per drawable direct rendering data. + * \c NULL if direct rendering is not supported on the display or + * screen used to create this drawable. Never dereferenced in libGL. + */ + void *private; + + /** + * Get the number of completed swap buffers for this drawable. + * + * \since Internal API version 20030317. + */ + int (*getSBC)(Display *dpy, void *drawablePrivate, int64_t *sbc ); + + /** + * Wait for the SBC to be greater than or equal target_sbc. + * + * \since Internal API version 20030317. + */ + int (*waitForSBC)( Display * dpy, void *drawablePriv, + int64_t target_sbc, + int64_t * msc, int64_t * sbc ); + + /** + * Wait for the MSC to equal target_msc, or, if that has already passed, + * the next time (MSC % divisor) is equal to remainder. If divisor is + * zero, the function will return as soon as MSC is greater than or equal + * to target_msc. + * + * \since Internal API version 20030317. + */ + int (*waitForMSC)( Display * dpy, void *drawablePriv, + int64_t target_msc, int64_t divisor, int64_t remainder, + int64_t * msc, int64_t * sbc ); + + /** + * Like \c swapBuffers, but does NOT have an implicit \c glFlush. Once + * rendering is complete, waits until MSC is equal to target_msc, or + * if that has already passed, waits until (MSC % divisor) is equal + * to remainder. If divisor is zero, the swap will happen as soon as + * MSC is greater than or equal to target_msc. + * + * \since Internal API version 20030317. + */ + int64_t (*swapBuffersMSC)(Display *dpy, void *drawablePrivate, + int64_t target_msc, + int64_t divisor, int64_t remainder); + + /** + * Enable or disable frame usage tracking. + * + * \since Internal API version 20030317. + */ + int (*frameTracking)(Display *dpy, void *drawablePrivate, Bool enable); + + /** + * Retrieve frame usage information. + * + * \since Internal API version 20030317. + */ + int (*queryFrameTracking)(Display *dpy, void *drawablePrivate, + int64_t * sbc, int64_t * missedFrames, + float * lastMissedUsage, float * usage ); + + /** + * Used by drivers that implement the GLX_SGI_swap_control or + * GLX_MESA_swap_control extension. + * + * \since Internal API version 20030317. + */ + unsigned swap_interval; +}; -- cgit v1.2.3 From fda7215db36ddee1900cab38b1435f1d73ac7858 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Mar 2004 15:59:44 +0000 Subject: rename class to c_class if using C++ (bug 922294) --- include/GL/miniglx.h | 8 ++++++-- src/glx/mini/miniglx.c | 22 +++++++++++++++++----- 2 files changed, 23 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/GL/miniglx.h b/include/GL/miniglx.h index 4416e587d67..8c246a05cf5 100644 --- a/include/GL/miniglx.h +++ b/include/GL/miniglx.h @@ -1,4 +1,4 @@ -/* $Id: miniglx.h,v 1.2 2003/12/06 17:17:42 brianp Exp $ */ +/* $Id: miniglx.h,v 1.3 2004/03/24 15:59:44 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -87,7 +87,11 @@ typedef struct MiniGLXXVisualInfoRec { VisualID visualid; /**< \brief visual ID */ int screen; /**< \brief screen number */ int depth; /**< \brief bit depth */ +#if defined(__cplusplus) || defined(c_plusplus) + int c_class; /**< \brief class */ +#else int class; /**< \brief class */ +#endif int bits_per_rgb; /**< \brief total bits per pixel */ } XVisualInfo; @@ -333,7 +337,7 @@ XCloseDisplay( Display *display ); extern Window XCreateWindow( Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, - unsigned int border_width, int depth, unsigned int class, + unsigned int border_width, int depth, unsigned int winclass, Visual *visual, unsigned long valuemask, XSetWindowAttributes *attributes ); diff --git a/src/glx/mini/miniglx.c b/src/glx/mini/miniglx.c index 44502f5de23..00144a5f6a3 100644 --- a/src/glx/mini/miniglx.c +++ b/src/glx/mini/miniglx.c @@ -9,9 +9,9 @@ /* * Mesa 3-D graphics library - * Version: 5.0 + * Version: 6.0.1 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2004 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"), @@ -1152,7 +1152,7 @@ XCloseDisplay( Display *dpy ) * \param border_width the border width. For Mini GLX, it should be zero. * \param depth the window pixel depth. For Mini GLX, this should be the depth * found in the #XVisualInfo object returned by glXChooseVisual() - * \param class the window class. For Mini GLX this value should be + * \param winclass the window class. For Mini GLX this value should be * #InputOutput. * \param visual the visual type. It should be the visual field of the * #XVisualInfo object returned by glXChooseVisual(). @@ -1178,7 +1178,7 @@ XCloseDisplay( Display *dpy ) Window XCreateWindow( Display *dpy, Window parent, int x, int y, unsigned int width, unsigned int height, - unsigned int border_width, int depth, unsigned int class, + unsigned int border_width, int depth, unsigned int winclass, Visual *visual, unsigned long valuemask, XSetWindowAttributes *attributes ) { @@ -1189,7 +1189,7 @@ XCreateWindow( Display *dpy, Window parent, int x, int y, (void) y; (void) border_width; (void) depth; - (void) class; + (void) winclass; (void) valuemask; (void) attributes; @@ -1425,7 +1425,11 @@ XGetVisualInfo( Display *dpy, long vinfo_mask, XVisualInfo *vinfo_template, int results[i].visual = visResults + i; results[i].visualid = i; +#if defined(__cplusplus) || defined(c_plusplus) + results[i].c_class = TrueColor; +#else results[i].class = TrueColor; +#endif results[i].depth = dpy->modes[i].redBits + dpy->modes[i].redBits + dpy->modes[i].redBits + @@ -1612,7 +1616,11 @@ glXChooseVisual( Display *dpy, int screen, int *attribList ) /* compute depth and bpp */ if (rgbFlag) { /* XXX maybe support depth 16 someday */ +#if defined(__cplusplus) || defined(c_plusplus) + visInfo->c_class = TrueColor; +#else visInfo->class = TrueColor; +#endif visInfo->depth = dpy->driverContext.bpp; visInfo->bits_per_rgb = dpy->driverContext.bpp; if (dpy->driverContext.bpp == 32) @@ -1622,7 +1630,11 @@ glXChooseVisual( Display *dpy, int screen, int *attribList ) } else { /* color index mode */ +#if defined(__cplusplus) || defined(c_plusplus) + visInfo->c_class = PseudoColor; +#else visInfo->class = PseudoColor; +#endif visInfo->depth = 8; visInfo->bits_per_rgb = 8; /* bits/pixel */ vis->pixelFormat = PF_CI8; -- cgit v1.2.3 From 5eb921382ff378de224ddddf0f66321eb773a38c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 9 Apr 2004 17:18:22 +0000 Subject: added extern "C" for C++ (bug 930933) --- include/GL/miniglx.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/GL/miniglx.h b/include/GL/miniglx.h index 8c246a05cf5..41e20936285 100644 --- a/include/GL/miniglx.h +++ b/include/GL/miniglx.h @@ -1,10 +1,8 @@ -/* $Id: miniglx.h,v 1.3 2004/03/24 15:59:44 brianp Exp $ */ - /* * Mesa 3-D graphics library - * Version: 5.0 + * Version: 6.1 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2004 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"), @@ -39,6 +37,12 @@ #include #include + +#ifdef __cplusplus +extern "C" { +#endif + + /** * \name Replacement Xlib/GLX types */ @@ -439,4 +443,8 @@ glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ); /*@}*/ +#ifdef __cplusplus +} +#endif + #endif /* MINIGLX_H */ -- cgit v1.2.3 From ab37fddbfdb08d339e6a271b104ecd8c636f4c4c Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 15 Apr 2004 01:24:57 +0000 Subject: Correct the comments about when the bindContext3 / unbindContext3 interface was added. --- include/GL/internal/dri_interface.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 1f1917d0bf9..109b4ee8452 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -394,7 +394,7 @@ struct __DRIcontextRec { /** * Method to bind a DRI drawable to a DRI graphics context. * - * \since Internal API version 20040317. + * \since Internal API version 20040415. */ Bool (*bindContext3)(Display *dpy, int scrn, __DRIid draw, __DRIid read, __DRIcontext *ctx); @@ -402,7 +402,7 @@ struct __DRIcontextRec { /** * Method to unbind a DRI drawable from a DRI graphics context. * - * \since Internal API version 20040317. + * \since Internal API version 20040415. */ Bool (*unbindContext3)(Display *dpy, int scrn, __DRIid draw, __DRIid read, __DRIcontext *ctx); -- cgit v1.2.3 From 199972cef06476d308c62c9b21f1ccffeb72cdb6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Apr 2004 18:00:00 +0000 Subject: move #define for GL_DOUBLE, to put enums in right order --- include/GL/gl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 9bab8c51e28..60669aaf620 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -165,10 +165,10 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_INT 0x1404 #define GL_UNSIGNED_INT 0x1405 #define GL_FLOAT 0x1406 -#define GL_DOUBLE 0x140A #define GL_2_BYTES 0x1407 #define GL_3_BYTES 0x1408 #define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A /* Primitives */ #define GL_POINTS 0x0000 -- cgit v1.2.3 From 74d563cdfbfb07cc666d60dc909e90ddb9949cbb Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 29 Apr 2004 12:23:39 +0000 Subject: Allow *_dri.so to build in Mesa tree with the 'linux-dri' target. --- configs/linux-dri | 10 +- include/GL/internal/dri_interface.h | 5 + src/mesa/drivers/dri/Makefile | 2 + src/mesa/drivers/dri/Makefile.template | 11 +- src/mesa/drivers/dri/dri_client/Makefile | 1 + src/mesa/drivers/dri/dri_client/XF86dri.c | 2 - src/mesa/drivers/dri/dri_client/dri_util.c | 178 +++++++---- src/mesa/drivers/dri/dri_client/dri_util.h | 19 -- .../drivers/dri/dri_client/imports/glxclient.h | 330 +-------------------- src/mesa/drivers/dri/ffb/Makefile | 89 +----- src/mesa/drivers/dri/ffb/ffb_xmesa.c | 18 +- src/mesa/drivers/dri/gamma/Makefile | 83 +----- src/mesa/drivers/dri/i810/Makefile | 83 +----- src/mesa/drivers/dri/i810/i810ioctl.c | 12 +- src/mesa/drivers/dri/i810/i810screen.c | 2 +- src/mesa/drivers/dri/i810/server/i810_dri.h | 2 +- src/mesa/drivers/dri/i830/Makefile | 2 + src/mesa/drivers/dri/mach64/Makefile | 83 +----- src/mesa/drivers/dri/mach64/mach64_context.h | 2 + src/mesa/drivers/dri/mach64/mach64_screen.c | 7 +- src/mesa/drivers/dri/mga/Makefile | 89 +----- src/mesa/drivers/dri/mga/mga_xmesa.c | 2 +- src/mesa/drivers/dri/r128/Makefile | 84 +----- src/mesa/drivers/dri/r128/r128_ioctl.c | 10 +- src/mesa/drivers/dri/r128/r128_screen.c | 10 +- src/mesa/drivers/dri/r200/Makefile | 92 +----- src/mesa/drivers/dri/r200/r200_context.c | 1 + src/mesa/drivers/dri/r200/r200_screen.c | 2 +- src/mesa/drivers/dri/radeon/Makefile | 117 +------- src/mesa/drivers/dri/radeon/radeon_screen.c | 2 +- src/mesa/drivers/dri/radeon/radeon_screen.h | 2 +- src/mesa/drivers/dri/sis/Makefile | 82 +---- src/mesa/drivers/dri/tdfx/Makefile | 80 +---- src/mesa/drivers/dri/unichrome/Makefile | 82 +---- src/mesa/drivers/dri/unichrome/via_context.c | 6 +- src/mesa/drivers/dri/unichrome/via_context.h | 4 +- src/mesa/drivers/dri/unichrome/via_dri.h | 2 +- src/mesa/drivers/dri/unichrome/via_screen.c | 2 +- src/mesa/drivers/dri/unichrome/via_screen.h | 2 +- 39 files changed, 235 insertions(+), 1377 deletions(-) (limited to 'include') diff --git a/configs/linux-dri b/configs/linux-dri index 1fa60eb0933..70c71e58126 100644 --- a/configs/linux-dri +++ b/configs/linux-dri @@ -30,5 +30,11 @@ DRIVER_DIRS = dri PROGRAM_DIRS = WINDOW_SYSTEM=dri -#DRI_DIRS = dri_client gamma i810 i830 mach64 mga r128 r200 radeon sis tdfx -DRI_DIRS = dri_client i830 +# This kindof sucks - we only need the header files from here: +# +DRM_SOURCE_PATH=/home/progs/drm + +# Only savage missing: +# +DRI_DIRS = dri_client ffb gamma i810 i830 mach64 mga r128 r200 radeon sis tdfx unichrome + diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 109b4ee8452..14b3751484e 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -35,6 +35,9 @@ * \author Ian Romanick */ +#ifndef DRI_INTERFACE_H +#define DRI_INTERFACE_H + /* FIXME: With a small amount of work, these two includes can be removed. */ #include #include @@ -497,3 +500,5 @@ struct __DRIdrawableRec { */ unsigned swap_interval; }; + +#endif diff --git a/src/mesa/drivers/dri/Makefile b/src/mesa/drivers/dri/Makefile index 43731c00503..4d7b08ec0d4 100644 --- a/src/mesa/drivers/dri/Makefile +++ b/src/mesa/drivers/dri/Makefile @@ -14,7 +14,9 @@ $(LIB_DIR): subdirs: + echo $(DRI_DIRS) @for dir in $(DRI_DIRS) ; do \ + echo $$dir ; \ (cd $$dir ; make) || exit 1; \ done diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template index 33bd22e6e57..250259785b3 100644 --- a/src/mesa/drivers/dri/Makefile.template +++ b/src/mesa/drivers/dri/Makefile.template @@ -21,7 +21,6 @@ else WINOBJ= WINLIB=-L$(MESA)/src/glx/mini MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini -MINIGLX_SOURCES = INCLUDES = $(MINIGLX_INCLUDES) \ -I$(DRM_SOURCE_PATH)/shared \ $(SHARED_INCLUDES) @@ -32,12 +31,17 @@ OBJECTS = $(C_SOURCES:.c=.o) \ endif + + + ### Include directories SHARED_INCLUDES = \ -I. \ -I../common \ -Iserver \ + -I$(DRM_SOURCE_PATH)/shared \ -I$(TOP)/include \ + -I$(TOP)/include/GL/internal \ -I$(TOP)/src/mesa \ -I$(TOP)/src/mesa/main \ -I$(TOP)/src/mesa/glapi \ @@ -59,7 +63,7 @@ SHARED_INCLUDES = \ ##### TARGETS ##### -default: depend $(LIB_DIR)/$(LIBNAME) +default: depend symlinks $(LIB_DIR)/$(LIBNAME) #$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile @@ -74,7 +78,6 @@ $(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile ../Makefil - # Run 'make depend' to update the dependencies if you change # what's included by any source file. depend: $(C_SOURCES) $(ASM_SOURCES) @@ -90,6 +93,6 @@ tags: # Remove .o and backup files clean: - -rm -f *.o */*.o *~ *.o *~ *.so server/*.o + -rm -f *.o */*.o *~ *.o *~ *.so server/*.o $(SYMLINKS) include depend diff --git a/src/mesa/drivers/dri/dri_client/Makefile b/src/mesa/drivers/dri/dri_client/Makefile index 14ba1948b28..930e50504ff 100644 --- a/src/mesa/drivers/dri/dri_client/Makefile +++ b/src/mesa/drivers/dri/dri_client/Makefile @@ -23,6 +23,7 @@ OBJECTS = $(C_SOURCES:.c=.o) INCLUDES = \ -I$(TOP)/include \ + -I$(TOP)/include/GL/internal \ -I$(TOP)/src/mesa \ -I$(TOP)/src/mesa/main \ -I$(TOP)/src/mesa/glapi \ diff --git a/src/mesa/drivers/dri/dri_client/XF86dri.c b/src/mesa/drivers/dri/dri_client/XF86dri.c index ea14b7a0703..82ffb303550 100644 --- a/src/mesa/drivers/dri/dri_client/XF86dri.c +++ b/src/mesa/drivers/dri/dri_client/XF86dri.c @@ -607,7 +607,6 @@ Bool XF86DRIGetDeviceInfo(dpy, screen, hFrameBuffer, return True; } -#if 0 Bool XF86DRIOpenFullScreen(dpy, screen, drawable) Display* dpy; int screen; @@ -633,4 +632,3 @@ Bool XF86DRICloseFullScreen(dpy, screen, drawable) (void) drawable; return True; } -#endif diff --git a/src/mesa/drivers/dri/dri_client/dri_util.c b/src/mesa/drivers/dri/dri_client/dri_util.c index 428472873e4..08f3fee1819 100644 --- a/src/mesa/drivers/dri/dri_client/dri_util.c +++ b/src/mesa/drivers/dri/dri_client/dri_util.c @@ -312,9 +312,9 @@ static void __driGarbageCollectDrawables(void *drawHash) * While casting the opaque private pointers associated with the parameters * into their respective real types it also assures they are not \c NULL. */ -static Bool driUnbindContext2(Display *dpy, int scrn, +static Bool driUnbindContext3(Display *dpy, int scrn, GLXDrawable draw, GLXDrawable read, - GLXContext gc) + __DRIcontext *ctx) { __DRIscreen *pDRIScreen; __DRIdrawable *pdraw; @@ -326,10 +326,10 @@ static Bool driUnbindContext2(Display *dpy, int scrn, /* ** Assume error checking is done properly in glXMakeCurrent before - ** calling driUnbindContext2. + ** calling driUnbindContext3. */ - if (gc == NULL || draw == None || read == None) { + if (ctx == NULL || draw == None || read == None) { /* ERROR!!! */ return GL_FALSE; } @@ -341,7 +341,7 @@ static Bool driUnbindContext2(Display *dpy, int scrn, } psp = (__DRIscreenPrivate *)pDRIScreen->private; - pcp = (__DRIcontextPrivate *)gc->driContext.private; + pcp = (__DRIcontextPrivate *)ctx->private; pdraw = __driFindDrawable(psp->drawHash, draw); if (!pdraw) { @@ -403,59 +403,19 @@ static Bool driUnbindContext2(Display *dpy, int scrn, * be needed in those places when support for pbuffers and / or pixmaps * is added. Is it safe to assume that the drawable is a window? */ -static Bool driBindContext2(Display *dpy, int scrn, - GLXDrawable draw, GLXDrawable read, - GLXContext gc) +static Bool DoBindContext(Display *dpy, + GLXDrawable draw, GLXDrawable read, + __DRIcontext *ctx, const __GLcontextModes * modes, + __DRIscreenPrivate *psp) { - __DRIscreen *pDRIScreen; __DRIdrawable *pdraw; __DRIdrawablePrivate *pdp; __DRIdrawable *pread; __DRIdrawablePrivate *prp; - __DRIscreenPrivate *psp; - __DRIcontextPrivate *pcp; - const __GLcontextModes *modes; - - /* - ** Assume error checking is done properly in glXMakeCurrent before - ** calling driBindContext. - */ - - if (gc == NULL || draw == None || read == None) { - /* ERROR!!! */ - return GL_FALSE; - } - - pDRIScreen = __glXFindDRIScreen(dpy, scrn); -#ifdef DRI_NEW_INTERFACE_ONLY - if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { - /* ERROR!!! */ - return GL_FALSE; - } -#else - if ( driCompareGLXAPIVersion( 20031201 ) >= 0 ) { -#endif /* DRI_NEW_INTERFACE_ONLY */ - modes = gc->mode; -#ifndef DRI_NEW_INTERFACE_ONLY - } - else { - modes = findConfigMode( dpy, scrn, gc->vid, pDRIScreen ); - if ( modes == NULL ) { - /* ERROR!!! */ - return GL_FALSE; - } - } - - - /* findConfigMode will return NULL if the DRI screen or screen private - * are NULL. - */ - assert( (pDRIScreen != NULL) && (pDRIScreen->private != NULL) ); -#endif /* DRI_NEW_INTERFACE_ONLY */ + __DRIcontextPrivate * const pcp = ctx->private; /* Find the _DRIdrawable which corresponds to the writing GLXDrawable */ - psp = (__DRIscreenPrivate *)pDRIScreen->private; pdraw = __driFindDrawable(psp->drawHash, draw); if (!pdraw) { /* Allocate a new drawable */ @@ -505,7 +465,6 @@ static Bool driBindContext2(Display *dpy, int scrn, } /* Bind the drawable to the context */ - pcp = (__DRIcontextPrivate *)gc->driContext.private; pcp->driDrawablePriv = pdp; pdp->driContextPriv = pcp; pdp->refcount++; @@ -530,6 +489,87 @@ static Bool driBindContext2(Display *dpy, int scrn, } +/** + * This function takes both a read buffer and a draw buffer. This is needed + * for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent + * function. + */ +static Bool driBindContext3(Display *dpy, int scrn, + GLXDrawable draw, GLXDrawable read, + __DRIcontext * ctx) +{ + __DRIscreen *pDRIScreen; + + /* + ** Assume error checking is done properly in glXMakeCurrent before + ** calling driBindContext. + */ + + if (ctx == NULL || draw == None || read == None) { + /* ERROR!!! */ + return GL_FALSE; + } + + pDRIScreen = __glXFindDRIScreen(dpy, scrn); + if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { + /* ERROR!!! */ + return GL_FALSE; + } + + return DoBindContext( dpy, draw, read, ctx, ctx->mode, + (__DRIscreenPrivate *)pDRIScreen->private ); +} + + +#ifndef DRI_NEW_INTERFACE_ONLY +/** + * This function takes both a read buffer and a draw buffer. This is needed + * for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent + * function. + */ +static Bool driBindContext2(Display *dpy, int scrn, + GLXDrawable draw, GLXDrawable read, + GLXContext gc) +{ + __DRIscreen *pDRIScreen; + const __GLcontextModes *modes; + + /* + ** Assume error checking is done properly in glXMakeCurrent before + ** calling driBindContext. + */ + + if (gc == NULL || draw == None || read == None) { + /* ERROR!!! */ + return GL_FALSE; + } + + pDRIScreen = __glXFindDRIScreen(dpy, scrn); + modes = (driCompareGLXAPIVersion( 20040317 ) >= 0) + ? gc->driContext.mode + : findConfigMode( dpy, scrn, gc->vid, pDRIScreen ); + + if ( modes == NULL ) { + /* ERROR!!! */ + return GL_FALSE; + } + + /* findConfigMode will return NULL if the DRI screen or screen private + * are NULL. + */ + assert( (pDRIScreen != NULL) && (pDRIScreen->private != NULL) ); + + return DoBindContext( dpy, draw, read, & gc->driContext, modes, + (__DRIscreenPrivate *)pDRIScreen->private ); +} + +static Bool driUnbindContext2(Display *dpy, int scrn, + GLXDrawable draw, GLXDrawable read, + GLXContext gc) +{ + return driUnbindContext3(dpy, scrn, draw, read, & gc->driContext); +} + /* * Simply call bind with the same GLXDrawable for the read and draw buffers. */ @@ -550,6 +590,7 @@ static Bool driUnbindContext(Display *dpy, int scrn, (void) will_rebind; return driUnbindContext2( dpy, scrn, draw, draw, gc ); } +#endif /* DRI_NEW_INTERFACE_ONLY */ /*@}*/ @@ -957,6 +998,14 @@ driCreateNewContext(Display *dpy, const __GLcontextModes *modes, } pctx->destroyContext = driDestroyContext; +#ifdef DRI_NEW_INTERFACE_ONLY + pctx->bindContext = NULL; + pctx->unbindContext = NULL; + pctx->bindContext2 = NULL; + pctx->unbindContext2 = NULL; + pctx->bindContex3 = driBindContext3; + pctx->unbindContext3 = driUnbindContext3; +#else pctx->bindContext = driBindContext; pctx->unbindContext = driUnbindContext; if ( driCompareGLXAPIVersion( 20030606 ) >= 0 ) { @@ -964,6 +1013,12 @@ driCreateNewContext(Display *dpy, const __GLcontextModes *modes, pctx->unbindContext2 = driUnbindContext2; } + if ( driCompareGLXAPIVersion( 20040415 ) >= 0 ) { + pctx->bindContext3 = driBindContext3; + pctx->unbindContext3 = driUnbindContext3; + } +#endif + if ( !(*psp->DriverAPI.CreateContext)(modes, pcp, shareCtx) ) { (void)XF86DRIDestroyContext(dpy, modes->screen, pcp->contextID); Xfree(pcp); @@ -1108,6 +1163,22 @@ __driUtilCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc, __DRIscreenPrivate *psp; +#ifdef DRI_NEW_INTERFACE_ONLY + if ( internal_api_version < 20040415 ) { + fprintf( stderr, "libGL error: libGL.so version (%08u) is too old. " + "20040415 or later is required.\n", internal_api_version ); + return NULL; + } +#else + if ( internal_api_version == 20031201 ) { + fprintf( stderr, "libGL error: libGL version 20031201 has critical " + "binary compatilibity bugs.\nlibGL error: You must upgrade " + "to use direct-rendering!\n" ); + return NULL; + } +#endif /* DRI_NEW_INTERFACE_ONLY */ + + window_exists = (PFNGLXWINDOWEXISTSPROC) glXGetProcAddress( (const GLubyte *) "__glXWindowExists" ); @@ -1200,6 +1271,10 @@ __driUtilCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc, #endif psc->createNewDrawable = driCreateNewDrawable; psc->getDrawable = driGetDrawable; +#ifdef DRI_NEW_INTERFACE_ONLY + psc->getMSC = driGetMSC; + psc->createNewContext = driCreateNewContext; +#else if ( driCompareGLXAPIVersion( 20030317 ) >= 0 ) { psc->getMSC = driGetMSC; @@ -1207,6 +1282,7 @@ __driUtilCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc, psc->createNewContext = driCreateNewContext; } } +#endif if ( (psp->DriverAPI.InitDriver != NULL) && !(*psp->DriverAPI.InitDriver)(psp) ) { diff --git a/src/mesa/drivers/dri/dri_client/dri_util.h b/src/mesa/drivers/dri/dri_client/dri_util.h index f189b5a9677..4764bbbc665 100644 --- a/src/mesa/drivers/dri/dri_client/dri_util.h +++ b/src/mesa/drivers/dri/dri_client/dri_util.h @@ -575,25 +575,6 @@ __driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, int numConfigs, __GLXvisualConfig *config, const struct __DriverAPIRec *driverAPI); -/** This must be implemented in each driver - * \deprecated - */ -extern void * -__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config); - -/** This must be implemented in each driver */ -extern void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc, - const __GLcontextModes * modes, - const __DRIversion * ddx_version, const __DRIversion * dri_version, - const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer, - drmAddress pSAREA, int fd, int internal_api_version, - __GLcontextModes ** driver_modes ); - -/** This is optionally implemented in each driver */ -extern void -__driRegisterExtensions( void ); - /* Test the version of the internal GLX API. Returns a value like strcmp. */ extern int driCompareGLXAPIVersion( GLuint required_version ); diff --git a/src/mesa/drivers/dri/dri_client/imports/glxclient.h b/src/mesa/drivers/dri/dri_client/imports/glxclient.h index 317ea011169..74dfe69c956 100644 --- a/src/mesa/drivers/dri/dri_client/imports/glxclient.h +++ b/src/mesa/drivers/dri/dri_client/imports/glxclient.h @@ -78,65 +78,7 @@ typedef struct _glapi_table __GLapi; #ifdef GLX_DIRECT_RENDERING -/** - * \name DRI interface structures - * - * The following structures define the interface between the GLX client - * side library and the DRI (direct rendering infrastructure). - */ -/*@{*/ -typedef struct __DRIdisplayRec __DRIdisplay; -typedef struct __DRIscreenRec __DRIscreen; -typedef struct __DRIcontextRec __DRIcontext; -typedef struct __DRIdrawableRec __DRIdrawable; -typedef struct __DRIdriverRec __DRIdriver; -typedef struct __DRIframebufferRec __DRIframebuffer; -typedef struct __DRIversionRec __DRIversion; -/*@}*/ - -extern __DRIscreen *__glXFindDRIScreen(Display *dpy, int scrn); - -/** - * Stored version of some component (i.e., server-side DRI module, kernel-side - * DRM, etc.). - * - * \todo There are several data structures that explicitly store a major - * version, minor version, and patch level. These structures should - * be modified to have a \c __DRIversionRec instead. - */ -struct __DRIversionRec { - int major; /**< Major version number. */ - int minor; /**< Minor version number. */ - int patch; /**< Patch-level. */ -}; - -/** - * Framebuffer information record. Used by libGL to communicate information - * about the framebuffer to the driver's \c __DRIdisplayRec::createNewScreen - * function. - * - * In XFree86, most of this information is derrived from data returned by - * calling \c XF86DRIGetDeviceInfo. - * - * \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen - * __driUtilCreateNewScreen CallCreateNewScreen - * - * \bug This structure could be better named. - */ -struct __DRIframebufferRec { - unsigned char *base; /**< Framebuffer base address in the CPU's - * address space. This value is calculated by - * calling \c drmMap on the framebuffer handle - * returned by \c XF86DRIGetDeviceInfo (or a - * similar function). - */ - int size; /**< Framebuffer size, in bytes. */ - int stride; /**< Number of bytes from one line to the next. */ - int width; /**< Pixel width of the framebuffer. */ - int height; /**< Pixel height of the framebuffer. */ - int dev_priv_size; /**< Size of the driver's dev-priv structure. */ - void *dev_priv; /**< Pointer to the driver's dev-priv structure. */ -}; +#include typedef void *(*CreateScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc, int numConfigs, __GLXvisualConfig *config); @@ -147,6 +89,7 @@ typedef void *(*CreateNewScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc, const __DRIframebuffer * frame_buffer, void * pSAREA, int fd, int internal_api_version, __GLcontextModes ** driver_modes); + /** * Display dependent methods. This structure is initialized during the * \c driCreateDisplay call. @@ -183,231 +126,6 @@ struct __DRIdisplayRec { CreateNewScreenFunc * createNewScreen; }; -/** - * Screen dependent methods. This structure is initialized during the - * \c __DRIdisplayRec::createScreen call. - */ -struct __DRIscreenRec { - /** - * Method to destroy the private DRI screen data. - */ - void (*destroyScreen)(Display *dpy, int scrn, void *screenPrivate); - - /** - * Method to create the private DRI context data and initialize the - * context dependent methods. - * - * \sa __DRIscreenRec::createNewContext driCreateContext - * driCreateNewContext - * \deprecated This function has been replaced by - * __DRIscreenRec::createNewContext. New drivers will - * continue to export this method, but it will eventually - * (in the next XFree86 major relearse) go away. - */ - void *(*createContext)(Display *dpy, XVisualInfo *vis, void *sharedPrivate, - __DRIcontext *pctx); - - /** - * Method to create the private DRI drawable data and initialize the - * drawable dependent methods. - */ - void *(*createNewDrawable)(Display *dpy, const __GLcontextModes *modes, - GLXDrawable draw, __DRIdrawable *pdraw, - int renderType, const int *attrs); - - /** - * Method to return a pointer to the DRI drawable data. - */ - __DRIdrawable *(*getDrawable)(Display *dpy, GLXDrawable draw, - void *drawablePrivate); - - /** - * Opaque pointer to private per screen direct rendering data. \c NULL - * if direct rendering is not supported on this screen. Never - * dereferenced in libGL. - */ - void *private; - - /** - * Get the number of vertical refreshes since some point in time before - * this function was first called (i.e., system start up). - * - * \since Internal API version 20030317. - */ - int (*getMSC)( void *screenPrivate, int64_t *msc ); - - /** - * Opaque pointer that points back to the containing - * \c __GLXscreenConfigs. This data structure is shared with DRI drivers - * but \c __GLXscreenConfigs is not. However, they are needed by some GLX - * functions called by DRI drivers. - * - * \since Internal API version 20030813. - */ - void *screenConfigs; - - /** - * Functions associated with MESA_allocate_memory. - * - * \since Internal API version 20030815. - */ - /*@{*/ - void *(*allocateMemory)(Display *dpy, int scrn, GLsizei size, - GLfloat readfreq, GLfloat writefreq, - GLfloat priority); - - void (*freeMemory)(Display *dpy, int scrn, GLvoid *pointer); - - GLuint (*memoryOffset)(Display *dpy, int scrn, const GLvoid *pointer); - /*@}*/ - - /** - * Method to create the private DRI context data and initialize the - * context dependent methods. - * - * \since Internal API version 20031201. - */ - void * (*createNewContext)(Display *dpy, const __GLcontextModes *modes, - int render_type, - void *sharedPrivate, __DRIcontext *pctx); -}; - -/** - * Context dependent methods. This structure is initialized during the - * \c __DRIscreenRec::createContext call. - */ -struct __DRIcontextRec { - /** - * Method to destroy the private DRI context data. - */ - void (*destroyContext)(Display *dpy, int scrn, void *contextPrivate); - - /** - * Method to bind a DRI drawable to a DRI graphics context. - */ - Bool (*bindContext)(Display *dpy, int scrn, GLXDrawable draw, - GLXContext gc); - - /** - * Method to unbind a DRI drawable to a DRI graphics context. - */ - Bool (*unbindContext)(Display *dpy, int scrn, GLXDrawable draw, - GLXContext gc, int will_rebind); - - /** - * Opaque pointer to private per context direct rendering data. - * \c NULL if direct rendering is not supported on the display or - * screen used to create this context. Never dereferenced in libGL. - */ - void *private; - - /** - * Method to bind a DRI drawable to a DRI graphics context. - * - * \since Internal API version 20030606. - */ - Bool (*bindContext2)(Display *dpy, int scrn, GLXDrawable draw, - GLXDrawable read, GLXContext gc); - - /** - * Method to unbind a DRI drawable to a DRI graphics context. - * - * \since Internal API version 20030606. - */ - Bool (*unbindContext2)(Display *dpy, int scrn, GLXDrawable draw, - GLXDrawable read, GLXContext gc); -}; - -/** - * Drawable dependent methods. This structure is initialized during the - * \c __DRIscreenRec::createDrawable call. \c createDrawable is not called - * by libGL at this time. It's currently used via the dri_util.c utility code - * instead. - */ -struct __DRIdrawableRec { - /** - * Method to destroy the private DRI drawable data. - */ - void (*destroyDrawable)(Display *dpy, void *drawablePrivate); - - /** - * Method to swap the front and back buffers. - */ - void (*swapBuffers)(Display *dpy, void *drawablePrivate); - - /** - * Opaque pointer to private per drawable direct rendering data. - * \c NULL if direct rendering is not supported on the display or - * screen used to create this drawable. Never dereferenced in libGL. - */ - void *private; - - /** - * Get the number of completed swap buffers for this drawable. - * - * \since Internal API version 20030317. - */ - int (*getSBC)(Display *dpy, void *drawablePrivate, int64_t *sbc ); - - /** - * Wait for the SBC to be greater than or equal target_sbc. - * - * \since Internal API version 20030317. - */ - int (*waitForSBC)( Display * dpy, void *drawablePriv, - int64_t target_sbc, - int64_t * msc, int64_t * sbc ); - - /** - * Wait for the MSC to equal target_msc, or, if that has already passed, - * the next time (MSC % divisor) is equal to remainder. If divisor is - * zero, the function will return as soon as MSC is greater than or equal - * to target_msc. - * - * \since Internal API version 20030317. - */ - int (*waitForMSC)( Display * dpy, void *drawablePriv, - int64_t target_msc, int64_t divisor, int64_t remainder, - int64_t * msc, int64_t * sbc ); - - /** - * Like \c swapBuffers, but does NOT have an implicit \c glFlush. Once - * rendering is complete, waits until MSC is equal to target_msc, or - * if that has already passed, waits until (MSC % divisor) is equal - * to remainder. If divisor is zero, the swap will happen as soon as - * MSC is greater than or equal to target_msc. - * - * \since Internal API version 20030317. - */ - int64_t (*swapBuffersMSC)(Display *dpy, void *drawablePrivate, - int64_t target_msc, - int64_t divisor, int64_t remainder); - - /** - * Enable or disable frame usage tracking. - * - * \since Internal API version 20030317. - */ - int (*frameTracking)(Display *dpy, void *drawablePrivate, Bool enable); - - /** - * Retrieve frame usage information. - * - * \since Internal API version 20030317. - */ - int (*queryFrameTracking)(Display *dpy, void *drawablePrivate, - int64_t * sbc, int64_t * missedFrames, - float * lastMissedUsage, float * usage ); - - /** - * Used by drivers that implement the GLX_SGI_swap_control or - * GLX_MESA_swap_control extension. - * - * \since Internal API version 20030317. - */ - unsigned swap_interval; -}; - /* ** We keep a linked list of these structures, one per DRI device driver. @@ -810,16 +528,6 @@ struct __GLXcontextRec { * drivers should NEVER use this data or even care that it exists. */ void * client_state_private; - -#ifdef GLX_DIRECT_RENDERING - /** - * Pointer to the mode used to create this context. This field replaces - * the \c vid and \c fbconfigID fields. - * - * \since Internal API version 20031201. - */ - const __GLcontextModes * mode; -#endif /* GLX_DIRECT_RENDERING */ }; #define __glXSetError(gc,code) \ @@ -1103,41 +811,7 @@ extern char *__glXCombineExtensionStrings( const char *cext_string, /* Determine the internal API version */ extern int __glXGetInternalVersion(void); -/** - * Type of a pointer to \c __glXGetInternalVersion, as returned by - * \c glXGetProcAddress. - * - * \sa __glXGetInternalVersion, glXGetProcAddress - */ -typedef int (* PFNGLXGETINTERNALVERSIONPROC) ( void ); - -/** - * Type of a pointer to \c __glXWindowExists, as returned by - * \c glXGetProcAddress. - * - * \sa __glXWindowExists, glXGetProcAddress - */ -typedef Bool (* PFNGLXWINDOWEXISTSPROC) (Display *dpy, GLXDrawable draw); - /* Get the unadjusted system time */ extern int __glXGetUST( int64_t * ust ); -/** - * Type of a pointer to \c __glXGetUST, as returned by \c glXGetProcAddress. - * - * \sa __glXGetUST, glXGetProcAddress - */ -typedef int (* PFNGLXGETUSTPROC) ( int64_t * ust ); - - -/** - * Type of pointer to \c __glXCreateContextModes, as returned by - * \c glXGetProcAddress. - * - * \sa _gl_context_modes_create, glXGetProcAddress - */ - -typedef __GLcontextModes * (* PFNGLXCREATECONTEXTMODES) ( unsigned count, - size_t minimum_bytes_per_struct ); - #endif /* !__GLX_client_h__ */ diff --git a/src/mesa/drivers/dri/ffb/Makefile b/src/mesa/drivers/dri/ffb/Makefile index 42ed196256d..05972ca70f6 100644 --- a/src/mesa/drivers/dri/ffb/Makefile +++ b/src/mesa/drivers/dri/ffb/Makefile @@ -5,16 +5,6 @@ include $(TOP)/configs/current LIBNAME = ffb_dri.so -DEFINES += \ - -D_HAVE_SWRAST=1 \ - -D_HAVE_SWTNL=1 \ - -D_HAVE_SANITY=1 \ - -D_HAVE_CODEGEN=1 \ - -D_HAVE_LIGHTING=1 \ - -D_HAVE_TEXGEN=1 \ - -D_HAVE_USERCLIP=1 \ - -DGLX_DIRECT_RENDERING - # not yet # MINIGLX_SOURCES = server/ffb_dri.c @@ -40,90 +30,15 @@ DRIVER_SOURCES = \ ffb_tex.c \ ffb_tris.c \ ffb_vb.c \ - ffb_vtxfmt.c \ ffb_xmesa.c C_SOURCES = \ $(COMMON_SOURCES) \ - $(MINIGLX_SOURCES) \ $(DRIVER_SOURCES) -# Include directories -INCLUDE_DIRS = \ - -I. \ - -I../common \ - -Iserver \ - -I$(TOP)/src/glx/mini \ - -I$(TOP)/include \ - -I$(TOP)/src/mesa/drivers/dri/drm/shared \ - -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ - -I$(TOP)/src/mesa/glapi \ - -I$(TOP)/src/mesa/math \ - -I$(TOP)/src/mesa/transform \ - -I$(TOP)/src/mesa/shader \ - -I$(TOP)/src/mesa/swrast \ - -I$(TOP)/src/mesa/swrast_setup - -# Core Mesa objects -MESA_MODULES = $(TOP)/src/mesa/mesa.a - -# Libraries that the driver shared lib depends on -LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc - - -ifeq ($(WINDOW_SYSTEM),dri) -WINOBJ=$(MESABUILDDIR)/dri/dri.a -WINLIB= -else -WINOBJ= -WINLIB=-L$(MESA)/src/glx/mini -endif ASM_SOURCES = -OBJECTS = $(C_SOURCES:.c=.o) \ - $(ASM_SOURCES:.S=.o) - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: depend $(LIB_DIR)/$(LIBNAME) - - -$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile - $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \ - $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS) - - -$(SYMLINKS): - mkdir -p server - cd server - rm -f $@ && ln -s ../../radeon/$@ $@ - - -depend: $(C_SOURCES) $(ASM_SOURCES) - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \ - >& /dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -clean: - -rm -f *.o server/*.o - +include ../Makefile.template -include depend +symlinks: diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c index ae31bfeb034..0fa8675e023 100644 --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c +++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c @@ -56,6 +56,8 @@ #include "ffb_vtxfmt.h" #include "ffb_bitmap.h" +#include "drm_sarea.h" + static GLboolean ffbInitDriver(__DRIscreenPrivate *sPriv) { @@ -66,7 +68,7 @@ ffbInitDriver(__DRIscreenPrivate *sPriv) return GL_FALSE; /* Allocate the private area. */ - ffbScreen = (ffbScreenPrivate *) Xmalloc(sizeof(ffbScreenPrivate)); + ffbScreen = (ffbScreenPrivate *) MALLOC(sizeof(ffbScreenPrivate)); if (!ffbScreen) return GL_FALSE; @@ -75,7 +77,7 @@ ffbInitDriver(__DRIscreenPrivate *sPriv) gDRIPriv->hFbcRegs, gDRIPriv->sFbcRegs, &gDRIPriv->mFbcRegs)) { - Xfree(ffbScreen); + FREE(ffbScreen); return GL_FALSE; } ffbScreen->regs = (ffb_fbcPtr) gDRIPriv->mFbcRegs; @@ -86,7 +88,7 @@ ffbInitDriver(__DRIscreenPrivate *sPriv) gDRIPriv->sDacRegs, &gDRIPriv->mDacRegs)) { drmUnmap(gDRIPriv->mFbcRegs, gDRIPriv->sFbcRegs); - Xfree(ffbScreen); + FREE(ffbScreen); return GL_FALSE; } ffbScreen->dac = (ffb_dacPtr) gDRIPriv->mDacRegs; @@ -98,7 +100,7 @@ ffbInitDriver(__DRIscreenPrivate *sPriv) &gDRIPriv->mSfb8r)) { drmUnmap(gDRIPriv->mFbcRegs, gDRIPriv->sFbcRegs); drmUnmap(gDRIPriv->mDacRegs, gDRIPriv->sDacRegs); - Xfree(ffbScreen); + FREE(ffbScreen); return GL_FALSE; } ffbScreen->sfb8r = (volatile char *) gDRIPriv->mSfb8r; @@ -110,7 +112,7 @@ ffbInitDriver(__DRIscreenPrivate *sPriv) drmUnmap(gDRIPriv->mFbcRegs, gDRIPriv->sFbcRegs); drmUnmap(gDRIPriv->mDacRegs, gDRIPriv->sDacRegs); drmUnmap(gDRIPriv->mSfb8r, gDRIPriv->sSfb8r); - Xfree(ffbScreen); + FREE(ffbScreen); return GL_FALSE; } ffbScreen->sfb32 = (volatile char *) gDRIPriv->mSfb32; @@ -123,7 +125,7 @@ ffbInitDriver(__DRIscreenPrivate *sPriv) drmUnmap(gDRIPriv->mDacRegs, gDRIPriv->sDacRegs); drmUnmap(gDRIPriv->mSfb8r, gDRIPriv->sSfb8r); drmUnmap(gDRIPriv->mSfb32, gDRIPriv->sSfb32); - Xfree(ffbScreen); + FREE(ffbScreen); return GL_FALSE; } ffbScreen->sfb64 = (volatile char *) gDRIPriv->mSfb64; @@ -153,7 +155,7 @@ ffbDestroyScreen(__DRIscreenPrivate *sPriv) drmUnmap(gDRIPriv->mSfb32, gDRIPriv->sSfb32); drmUnmap(gDRIPriv->mSfb64, gDRIPriv->sSfb64); - Xfree(ffbScreen); + FREE(ffbScreen); } static const struct tnl_pipeline_stage *ffb_pipeline[] = { @@ -284,7 +286,9 @@ ffbCreateContext(const __GLcontextModes *mesaVis, ffbDDInitBitmapFuncs(ctx); ffbInitVB(ctx); +#if 0 ffbInitTnlModule(ctx); +#endif _tnl_destroy_pipeline(ctx); _tnl_install_pipeline(ctx, ffb_pipeline); diff --git a/src/mesa/drivers/dri/gamma/Makefile b/src/mesa/drivers/dri/gamma/Makefile index 1dcd922a43b..e72246100c3 100644 --- a/src/mesa/drivers/dri/gamma/Makefile +++ b/src/mesa/drivers/dri/gamma/Makefile @@ -5,16 +5,6 @@ include $(TOP)/configs/current LIBNAME = gamma_dri.so -DEFINES += \ - -D_HAVE_SWRAST=1 \ - -D_HAVE_SWTNL=1 \ - -D_HAVE_SANITY=1 \ - -D_HAVE_CODEGEN=1 \ - -D_HAVE_LIGHTING=1 \ - -D_HAVE_TEXGEN=1 \ - -D_HAVE_USERCLIP=1 \ - -DGLX_DIRECT_RENDERING - # Not yet # MINIGLX_SOURCES = server/gamma_dri.c @@ -43,79 +33,10 @@ DRIVER_SOURCES = \ C_SOURCES = \ $(COMMON_SOURCES) \ - $(MINIGLX_SOURCES) \ $(DRIVER_SOURCES) -# Include directories -INCLUDE_DIRS = \ - -I. \ - -I../common \ - -Iserver \ - -I$(TOP)/src/glx/mini \ - -I$(TOP)/include \ - -I$(DRM_SOURCE_PATH)/shared \ - -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ - -I$(TOP)/src/mesa/glapi \ - -I$(TOP)/src/mesa/math \ - -I$(TOP)/src/mesa/transform \ - -I$(TOP)/src/mesa/shader \ - -I$(TOP)/src/mesa/swrast \ - -I$(TOP)/src/mesa/swrast_setup - -# Core Mesa objects -MESA_MODULES = $(TOP)/src/mesa/mesa.a - -# Libraries that the driver shared lib depends on -LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc - - -ifeq ($(WINDOW_SYSTEM),dri) -WINOBJ=$(MESABUILDDIR)/dri/dri.a -WINLIB= -else -WINOBJ= -WINLIB=-L$(MESA)/src/glx/mini -endif - ASM_SOURCES = -OBJECTS = $(C_SOURCES:.c=.o) \ - $(ASM_SOURCES:.S=.o) - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: depend $(LIB_DIR)/$(LIBNAME) - - -$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile - $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \ - $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS) - - -depend: $(C_SOURCES) $(ASM_SOURCES) - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \ - >& /dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -clean: - -rm -f *.o server/*.o - +include ../Makefile.template -include depend +symlinks: diff --git a/src/mesa/drivers/dri/i810/Makefile b/src/mesa/drivers/dri/i810/Makefile index ab7873a2bc3..4f36a33762f 100644 --- a/src/mesa/drivers/dri/i810/Makefile +++ b/src/mesa/drivers/dri/i810/Makefile @@ -5,16 +5,6 @@ include $(TOP)/configs/current LIBNAME = i810_dri.so -DEFINES += \ - -D_HAVE_SWRAST=1 \ - -D_HAVE_SWTNL=1 \ - -D_HAVE_SANITY=1 \ - -D_HAVE_CODEGEN=1 \ - -D_HAVE_LIGHTING=1 \ - -D_HAVE_TEXGEN=1 \ - -D_HAVE_USERCLIP=1 \ - -DGLX_DIRECT_RENDERING - # Not yet # MINIGLX_SOURCES = server/i810_dri.c @@ -40,79 +30,10 @@ DRIVER_SOURCES = \ C_SOURCES = \ $(COMMON_SOURCES) \ - $(MINIGLX_SOURCES) \ $(DRIVER_SOURCES) -# Include directories -INCLUDE_DIRS = \ - -I. \ - -I../common \ - -Iserver \ - -I$(TOP)/src/glx/mini \ - -I$(TOP)/include \ - -I$(DRM_SOURCE_PATH)/shared \ - -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ - -I$(TOP)/src/mesa/glapi \ - -I$(TOP)/src/mesa/math \ - -I$(TOP)/src/mesa/transform \ - -I$(TOP)/src/mesa/shader \ - -I$(TOP)/src/mesa/swrast \ - -I$(TOP)/src/mesa/swrast_setup - -# Core Mesa objects -MESA_MODULES = $(TOP)/src/mesa/mesa.a - -# Libraries that the driver shared lib depends on -LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc - - -ifeq ($(WINDOW_SYSTEM),dri) -WINOBJ=$(MESABUILDDIR)/dri/dri.a -WINLIB= -else -WINOBJ= -WINLIB=-L$(MESA)/src/glx/mini -endif - ASM_SOURCES = -OBJECTS = $(C_SOURCES:.c=.o) \ - $(ASM_SOURCES:.S=.o) - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: depend $(LIB_DIR)/$(LIBNAME) - - -$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile - $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \ - $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS) - - -depend: $(C_SOURCES) $(ASM_SOURCES) - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \ - >& /dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -clean: - -rm -f *.o server/*.o - +include ../Makefile.template -include depend +symlinks: diff --git a/src/mesa/drivers/dri/i810/i810ioctl.c b/src/mesa/drivers/dri/i810/i810ioctl.c index 3d1be4c902f..829ad04c7e5 100644 --- a/src/mesa/drivers/dri/i810/i810ioctl.c +++ b/src/mesa/drivers/dri/i810/i810ioctl.c @@ -91,7 +91,7 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, { int nr = MIN2(i + I810_NR_SAREA_CLIPRECTS, imesa->numClipRects); drm_clip_rect_t *box = imesa->pClipRects; - drm_clip_rect_t *b = imesa->sarea->boxes; + drm_clip_rect_t *b = (drm_clip_rect_t *)imesa->sarea->boxes; int n = 0; if (!all) { @@ -156,13 +156,13 @@ void i810CopyBuffer( const __DRIdrawablePrivate *dPriv ) I810_FIREVERTICES( imesa ); LOCK_HARDWARE( imesa ); - pbox = dPriv->pClipRects; + pbox = (drm_clip_rect_t *)dPriv->pClipRects; nbox = dPriv->numClipRects; for (i = 0 ; i < nbox ; ) { int nr = MIN2(i + I810_NR_SAREA_CLIPRECTS, dPriv->numClipRects); - drm_clip_rect_t *b = imesa->sarea->boxes; + drm_clip_rect_t *b = (drm_clip_rect_t *)imesa->sarea->boxes; imesa->sarea->nbox = nr - i; @@ -204,8 +204,8 @@ void i810PageFlip( const __DRIdrawablePrivate *dPriv ) LOCK_HARDWARE( imesa ); if (dPriv->pClipRects) { - *imesa->sarea->boxes = dPriv->pClipRects[0]; - imesa->sarea->nbox = 1; + imesa->sarea->boxes[0] = dPriv->pClipRects[0]; + imesa->sarea->nbox = 1; } ret = drmCommandNone(imesa->driFd, DRM_I810_FLIP); if (ret) { @@ -403,7 +403,7 @@ void i810FlushPrimsLocked( i810ContextPtr imesa ) for (i = 0 ; i < nbox ; ) { int nr = MIN2(i + I810_NR_SAREA_CLIPRECTS, nbox); - drm_clip_rect_t *b = sarea->boxes; + drm_clip_rect_t *b = (drm_clip_rect_t *)sarea->boxes; if (imesa->scissor) { sarea->nbox = 0; diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index a095b28add1..8bb62217a92 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -50,7 +50,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "i810ioctl.h" #ifndef _SOLO -#include "glxextensions.h" +#include "GL/internal/dri_interface.h" #endif #ifdef USE_NEW_INTERFACE diff --git a/src/mesa/drivers/dri/i810/server/i810_dri.h b/src/mesa/drivers/dri/i810/server/i810_dri.h index 2931988c879..cfca20a95b8 100644 --- a/src/mesa/drivers/dri/i810/server/i810_dri.h +++ b/src/mesa/drivers/dri/i810/server/i810_dri.h @@ -78,7 +78,7 @@ typedef struct { unsigned int dirty; unsigned int nbox; - drm_clip_rect_t boxes[I810_NR_SAREA_CLIPRECTS]; + XF86DRIClipRectRec boxes[I810_NR_SAREA_CLIPRECTS]; /* Maintain an LRU of contiguous regions of texture space. If * you think you own a region of texture memory, and it has an diff --git a/src/mesa/drivers/dri/i830/Makefile b/src/mesa/drivers/dri/i830/Makefile index f6ba1fa6216..8a75927081d 100644 --- a/src/mesa/drivers/dri/i830/Makefile +++ b/src/mesa/drivers/dri/i830/Makefile @@ -34,5 +34,7 @@ C_SOURCES = \ ASM_SOURCES = + include ../Makefile.template +symlinks: diff --git a/src/mesa/drivers/dri/mach64/Makefile b/src/mesa/drivers/dri/mach64/Makefile index 77cc9420bf9..c855f4d882a 100644 --- a/src/mesa/drivers/dri/mach64/Makefile +++ b/src/mesa/drivers/dri/mach64/Makefile @@ -5,16 +5,6 @@ include $(TOP)/configs/current LIBNAME = mach64_dri.so -DEFINES += \ - -D_HAVE_SWRAST=1 \ - -D_HAVE_SWTNL=1 \ - -D_HAVE_SANITY=1 \ - -D_HAVE_CODEGEN=1 \ - -D_HAVE_LIGHTING=1 \ - -D_HAVE_TEXGEN=1 \ - -D_HAVE_USERCLIP=1 \ - -DGLX_DIRECT_RENDERING - # Not yet # MINIGLX_SOURCES = server/mach64_dri.c @@ -42,79 +32,10 @@ DRIVER_SOURCES = \ C_SOURCES = \ $(COMMON_SOURCES) \ - $(MINIGLX_SOURCES) \ $(DRIVER_SOURCES) -# Include directories -INCLUDE_DIRS = \ - -I. \ - -I../common \ - -Iserver \ - -I$(TOP)/src/glx/mini \ - -I$(TOP)/include \ - -I$(DRM_SOURCE_PATH)/shared \ - -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ - -I$(TOP)/src/mesa/glapi \ - -I$(TOP)/src/mesa/math \ - -I$(TOP)/src/mesa/transform \ - -I$(TOP)/src/mesa/shader \ - -I$(TOP)/src/mesa/swrast \ - -I$(TOP)/src/mesa/swrast_setup - -# Core Mesa objects -MESA_MODULES = $(TOP)/src/mesa/mesa.a - -# Libraries that the driver shared lib depends on -LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc - - -ifeq ($(WINDOW_SYSTEM),dri) -WINOBJ=$(MESABUILDDIR)/dri/dri.a -WINLIB= -else -WINOBJ= -WINLIB=-L$(MESA)/src/glx/mini -endif - ASM_SOURCES = -OBJECTS = $(C_SOURCES:.c=.o) \ - $(ASM_SOURCES:.S=.o) - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: depend $(LIB_DIR)/$(LIBNAME) - - -$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile - $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \ - $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS) - - -depend: $(C_SOURCES) $(ASM_SOURCES) - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \ - >& /dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -clean: - -rm -f *.o server/*.o - +include ../Makefile.template -include depend +symlinks: diff --git a/src/mesa/drivers/dri/mach64/mach64_context.h b/src/mesa/drivers/dri/mach64/mach64_context.h index 03b90a44717..e424c0bbbfb 100644 --- a/src/mesa/drivers/dri/mach64/mach64_context.h +++ b/src/mesa/drivers/dri/mach64/mach64_context.h @@ -116,6 +116,8 @@ typedef struct { } mach64_vertex; #endif +#define CARD32 GLuint /* KW: For building in mesa tree */ + /* The size of this union is not of relevence: */ union mach64_vertex_t { diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index 6ef16c11b27..4d36369ce9d 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -41,7 +41,7 @@ #include "vblank.h" #ifndef _SOLO -#include "glxextensions.h" +#include "GL/internal/dri_interface.h" #endif /* Mach64 configuration @@ -452,6 +452,10 @@ mach64InitDriver( __DRIscreenPrivate *driScreen ) */ void __driRegisterExtensions( void ) { +#if 0 + /* KW: This is handled differently in the other drivers, not sure + * what to do here. + */ PFNGLXENABLEEXTENSIONPROC glx_enable_extension; if ( driCompareGLXAPIVersion( 20030317 ) >= 0 ) { @@ -464,6 +468,7 @@ void __driRegisterExtensions( void ) glx_enable_extension( "GLX_MESA_swap_control", GL_FALSE ); } } +#endif } #endif diff --git a/src/mesa/drivers/dri/mga/Makefile b/src/mesa/drivers/dri/mga/Makefile index 249d810e0c8..58c925da487 100644 --- a/src/mesa/drivers/dri/mga/Makefile +++ b/src/mesa/drivers/dri/mga/Makefile @@ -5,16 +5,6 @@ include $(TOP)/configs/current LIBNAME = mga_dri.so -DEFINES += \ - -D_HAVE_SWRAST=1 \ - -D_HAVE_SWTNL=1 \ - -D_HAVE_SANITY=1 \ - -D_HAVE_CODEGEN=1 \ - -D_HAVE_LIGHTING=1 \ - -D_HAVE_TEXGEN=1 \ - -D_HAVE_USERCLIP=1 \ - -DGLX_DIRECT_RENDERING - MINIGLX_SOURCES = server/mga_dri.c COMMON_SOURCES = \ @@ -30,9 +20,7 @@ DRIVER_SOURCES = \ mgaioctl.c \ mgarender.c \ mgastate.c \ - mgatris.c - -FULL_DRIVER_SOURCES = \ + mgatris.c \ mgapixel.c \ mgaspan.c \ mgatex.c \ @@ -44,80 +32,11 @@ FULL_DRIVER_SOURCES = \ C_SOURCES = \ $(COMMON_SOURCES) \ - $(MINIGLX_SOURCES) \ - $(DRIVER_SOURCES) \ - $(FULL_DRIVER_SOURCES) - -# Include directories -INCLUDE_DIRS = \ - -I. \ - -I../common \ - -Iserver \ - -I$(TOP)/src/glx/mini \ - -I$(TOP)/include \ - -I$(DRM_SOURCE_PATH)/shared \ - -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ - -I$(TOP)/src/mesa/glapi \ - -I$(TOP)/src/mesa/math \ - -I$(TOP)/src/mesa/transform \ - -I$(TOP)/src/mesa/shader \ - -I$(TOP)/src/mesa/swrast \ - -I$(TOP)/src/mesa/swrast_setup - -# Core Mesa objects -MESA_MODULES = $(TOP)/src/mesa/mesa.a - -# Libraries that the driver shared lib depends on -LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc - + $(DRIVER_SOURCES) -ifeq ($(WINDOW_SYSTEM),dri) -WINOBJ=$(MESABUILDDIR)/dri/dri.a -WINLIB= -else -WINOBJ= -WINLIB=-L$(MESA)/src/glx/mini -endif ASM_SOURCES = -OBJECTS = $(C_SOURCES:.c=.o) \ - $(ASM_SOURCES:.S=.o) - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: depend $(LIB_DIR)/$(LIBNAME) - - -$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile - $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \ - $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS) - - -depend: $(C_SOURCES) $(ASM_SOURCES) - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \ - >& /dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -clean: - -rm -f *.o server/*.o - +include ../Makefile.template -include depend +symlinks: diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 0a00b347b38..df7856241fb 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -60,7 +60,7 @@ #include "vblank.h" #ifndef _SOLO -#include "glxextensions.h" +#include "GL/internal/dri_interface.h" #endif /* MGA configuration diff --git a/src/mesa/drivers/dri/r128/Makefile b/src/mesa/drivers/dri/r128/Makefile index 20434987015..bcda0a4d7d6 100644 --- a/src/mesa/drivers/dri/r128/Makefile +++ b/src/mesa/drivers/dri/r128/Makefile @@ -5,16 +5,6 @@ include $(TOP)/configs/current LIBNAME = r128_dri.so -DEFINES += \ - -D_HAVE_SWRAST=1 \ - -D_HAVE_SWTNL=1 \ - -D_HAVE_SANITY=1 \ - -D_HAVE_CODEGEN=1 \ - -D_HAVE_LIGHTING=1 \ - -D_HAVE_TEXGEN=1 \ - -D_HAVE_USERCLIP=1 \ - -DGLX_DIRECT_RENDERING - MINIGLX_SOURCES = server/r128_dri.c COMMON_SOURCES = \ @@ -41,79 +31,11 @@ DRIVER_SOURCES = \ C_SOURCES = \ $(COMMON_SOURCES) \ - $(DRIVER_SOURCES) \ - $(MINIGLX_SOURCES) - -# Include directories -INCLUDE_DIRS = \ - -I. \ - -I../common \ - -Iserver \ - -I$(TOP)/src/glx/mini \ - -I$(TOP)/include \ - -I$(DRM_SOURCE_PATH)/shared \ - -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ - -I$(TOP)/src/mesa/glapi \ - -I$(TOP)/src/mesa/math \ - -I$(TOP)/src/mesa/transform \ - -I$(TOP)/src/mesa/shader \ - -I$(TOP)/src/mesa/swrast \ - -I$(TOP)/src/mesa/swrast_setup - -# Core Mesa objects -MESA_MODULES = $(TOP)/src/mesa/mesa.a - -# Libraries that the driver shared lib depends on -LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc - - -ifeq ($(WINDOW_SYSTEM),dri) -WINOBJ=$(MESABUILDDIR)/dri/dri.a -WINLIB= -else -WINOBJ= -WINLIB=-L$(MESA)/src/glx/mini -endif + $(DRIVER_SOURCES) ASM_SOURCES = -OBJECTS = $(C_SOURCES:.c=.o) \ - $(ASM_SOURCES:.S=.o) - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: depend $(LIB_DIR)/$(LIBNAME) - - -$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile - $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \ - $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS) - - -depend: $(C_SOURCES) $(ASM_SOURCES) - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \ - >& /dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -clean: - -rm -f *.o server/*.o +include ../Makefile.template -include depend +symlinks: diff --git a/src/mesa/drivers/dri/r128/r128_ioctl.c b/src/mesa/drivers/dri/r128/r128_ioctl.c index 6ea8d529652..d9fc02501a7 100644 --- a/src/mesa/drivers/dri/r128/r128_ioctl.c +++ b/src/mesa/drivers/dri/r128/r128_ioctl.c @@ -44,12 +44,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "vblank.h" -#ifdef _SOLO -/* temporary - should really split r128_reg.h into r128_reg.h & r128_macros.h - * like the radeon */ -#include "r128_macros.h" -#endif - #define R128_TIMEOUT 2048 #define R128_IDLE_RETRY 32 @@ -221,6 +215,7 @@ static void delay( void ) { #define R128_MAX_OUTSTANDING 2 + /* Throttle the frame rate -- only allow one pending swap buffers * request at a time. * GH: We probably don't want a timeout here, as we can wait as @@ -235,7 +230,8 @@ static int r128WaitForFrameCompletion( r128ContextPtr rmesa ) int wait = 0; while ( 1 ) { - frame = INREG( R128_LAST_FRAME_REG ); + frame = *(volatile unsigned int *)(R128MMIO + R128_LAST_FRAME_REG); + if ( rmesa->sarea->last_frame - frame <= R128_MAX_OUTSTANDING ) { break; } diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index f77c325db19..5825e95ef26 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -47,7 +47,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "vblank.h" #ifndef _SOLO -#include "glxextensions.h" +#include "GL/internal/dri_interface.h" #endif /* R128 configuration @@ -345,7 +345,12 @@ r128InitDriver( __DRIscreenPrivate *sPriv ) */ void __driRegisterExtensions( void ) { - PFNGLXENABLEEXTENSIONPROC glx_enable_extension; +#if 0 + /* KW: This is done slightly differently to the other drivers and + dri_interface.h doesn't seem to cope. + */ + PFNGLXENABLEEXTENSIONPROC + glx_enable_extension; if ( driCompareGLXAPIVersion( 20030317 ) >= 0 ) { glx_enable_extension = (PFNGLXENABLEEXTENSIONPROC) @@ -357,6 +362,7 @@ void __driRegisterExtensions( void ) glx_enable_extension( "GLX_MESA_swap_control", GL_FALSE ); } } +#endif } #endif diff --git a/src/mesa/drivers/dri/r200/Makefile b/src/mesa/drivers/dri/r200/Makefile index 7a3b248c0c2..137660b3712 100644 --- a/src/mesa/drivers/dri/r200/Makefile +++ b/src/mesa/drivers/dri/r200/Makefile @@ -1,21 +1,10 @@ # src/mesa/drivers/dri/r200/Makefile -# Note, this Makefile requires GNU make TOP = ../../../../.. include $(TOP)/configs/current LIBNAME = r200_dri.so -DEFINES += \ - -D_HAVE_SWRAST=1 \ - -D_HAVE_SWTNL=1 \ - -D_HAVE_SANITY=1 \ - -D_HAVE_CODEGEN=1 \ - -D_HAVE_LIGHTING=1 \ - -D_HAVE_TEXGEN=1 \ - -D_HAVE_USERCLIP=1 \ - -DGLX_DIRECT_RENDERING - MINIGLX_SOURCES = server/radeon_dri.c COMMON_SOURCES = \ @@ -47,96 +36,25 @@ DRIVER_SOURCES = r200_context.c \ r200_vtxfmt_sse.c \ r200_vtxfmt_x86.c -C_SOURCES = $(COMMON_SOURCES) $(MINIGLX_SOURCES) $(DRIVER_SOURCES) - - -# Include directories -INCLUDE_DIRS = \ - -I. \ - -I../common \ - -Iserver \ - -I$(TOP)/src/glx/mini \ - -I$(TOP)/include \ - -I$(DRM_SOURCE_PATH)/shared \ - -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ - -I$(TOP)/src/mesa/glapi \ - -I$(TOP)/src/mesa/math \ - -I$(TOP)/src/mesa/transform \ - -I$(TOP)/src/mesa/swrast \ - -I$(TOP)/src/mesa/swrast_setup - - -# Core Mesa objects -MESA_MODULES = $(TOP)/src/mesa/mesa.a - - -# Libraries that the driver shared lib depends on -LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc - - -ifeq ($(WINDOW_SYSTEM),dri) -WINOBJ=$(MESABUILDDIR)/dri/dri.a -WINLIB= -else -WINOBJ= -WINLIB=-L$(MESA)/src/glx/mini -endif +C_SOURCES = $(COMMON_SOURCES) $(DRIVER_SOURCES) ASM_SOURCES = -OBJECTS = $(C_SOURCES:.c=.o) \ - $(ASM_SOURCES:.S=.o) - SYMLINKS = \ - server/radeon_common.h \ server/radeon_dri.c \ server/radeon_dri.h \ server/radeon.h \ server/radeon_macros.h \ - server/radeon_reg.h \ - server/radeon_sarea.h \ - - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - + server/radeon_reg.h ##### TARGETS ##### -default: depend $(SYMLINKS) $(LIB_DIR)/$(LIBNAME) - -$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile - $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \ - $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS) +include ../Makefile.template $(SYMLINKS): mkdir -p server - cd server - rm -f $@ && ln -s ../../radeon/$@ $@ - - -depend: $(C_SOURCES) $(ASM_SOURCES) - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \ - >& /dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -clean: - -rm -f *.o server/*.o - -rm -f $(SYMLINKS) + for i in $(SYMLINKS) ; do rm -f $$i && test -f ../radeon/$$i && ln -s ../../radeon/$$i $$i ; done +symlinks: $(SYMLINKS) -include depend diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index fa37d2b2e2c..95c7c323627 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -128,6 +128,7 @@ static const char * const card_extensions[] = "GL_ARB_texture_env_combine", "GL_ARB_texture_env_dot3", "GL_ARB_texture_mirrored_repeat", + "GL_ARB_vertex_buffer_object", "GL_EXT_blend_logic_op", "GL_EXT_blend_minmax", "GL_EXT_blend_subtract", diff --git a/src/mesa/drivers/dri/r200/r200_screen.c b/src/mesa/drivers/dri/r200/r200_screen.c index d115ef20fca..c5c29dd587d 100644 --- a/src/mesa/drivers/dri/r200/r200_screen.c +++ b/src/mesa/drivers/dri/r200/r200_screen.c @@ -51,7 +51,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "utils.h" #include "vblank.h" #ifndef _SOLO -#include "glxextensions.h" +#include "GL/internal/dri_interface.h" #endif /* R200 configuration diff --git a/src/mesa/drivers/dri/radeon/Makefile b/src/mesa/drivers/dri/radeon/Makefile index 2037d591010..e6f7c29d1ae 100644 --- a/src/mesa/drivers/dri/radeon/Makefile +++ b/src/mesa/drivers/dri/radeon/Makefile @@ -4,30 +4,7 @@ TOP = ../../../../.. include $(TOP)/configs/current -ifeq ($(EMBEDDED),true) -LIBNAME = radeon_es_dri.so -DEFINES += \ - -D_EMBEDDED \ - -D_HAVE_SWRAST=0 \ - -D_HAVE_SWTNL=0 \ - -D_HAVE_SANITY=0 \ - -D_HAVE_CODEGEN=0 \ - -D_HAVE_LIGHTING=0 \ - -D_HAVE_TEXGEN=0 \ - -D_HAVE_USERCLIP=0 \ - -DGLX_DIRECT_RENDERING -else LIBNAME = radeon_dri.so -DEFINES += \ - -D_HAVE_SWRAST=1 \ - -D_HAVE_SWTNL=1 \ - -D_HAVE_SANITY=1 \ - -D_HAVE_CODEGEN=1 \ - -D_HAVE_LIGHTING=1 \ - -D_HAVE_TEXGEN=1 \ - -D_HAVE_USERCLIP=1 \ - -DGLX_DIRECT_RENDERING -endif MINIGLX_SOURCES = server/radeon_dri.c @@ -45,16 +22,7 @@ DRIVER_SOURCES = \ radeon_lock.c \ radeon_screen.c \ radeon_state.c \ - radeon_state_init.c - -SUBSET_DRIVER_SOURCES = \ - radeon_subset_bitmap.c \ - radeon_subset_readpix.c \ - radeon_subset_select.c \ - radeon_subset_tex.c \ - radeon_subset_vtx.c - -FULL_DRIVER_SOURCES = \ + radeon_state_init.c \ radeon_tex.c \ radeon_texmem.c \ radeon_texstate.c \ @@ -69,91 +37,14 @@ FULL_DRIVER_SOURCES = \ radeon_vtxfmt_sse.c \ radeon_vtxfmt_x86.c -ifeq ($(EMBEDDED),true) -C_SOURCES = \ - $(COMMON_SOURCES) \ - $(MINIGLX_SOURCES) \ - $(DRIVER_SOURCES) \ - $(SUBSET_DRIVER_SOURCES) -else C_SOURCES = \ $(COMMON_SOURCES) \ - $(MINIGLX_SOURCES) \ - $(DRIVER_SOURCES) \ - $(FULL_DRIVER_SOURCES) -endif - - -# Include directories -INCLUDE_DIRS = \ - -I. \ - -I../common \ - -Iserver \ - -I$(TOP)/src/glx/mini \ - -I$(TOP)/include \ - -I$(DRM_SOURCE_PATH)/shared \ - -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ - -I$(TOP)/src/mesa/glapi \ - -I$(TOP)/src/mesa/math \ - -I$(TOP)/src/mesa/transform \ - -I$(TOP)/src/mesa/shader \ - -I$(TOP)/src/mesa/swrast \ - -I$(TOP)/src/mesa/swrast_setup + $(DRIVER_SOURCES) -# Core Mesa objects -MESA_MODULES = $(TOP)/src/mesa/mesa.a - -# Libraries that the driver shared lib depends on -LIB_DEPS = $(GL_LIB_DEPS) - - -ifeq ($(WINDOW_SYSTEM),dri) -WINOBJ=$(MESABUILDDIR)/dri/dri.a -WINLIB= -else -WINOBJ= -WINLIB=-L$(MESA)/src/glx/mini -endif ASM_SOURCES = -OBJECTS = $(C_SOURCES:.c=.o) \ - $(ASM_SOURCES:.S=.o) - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: depend $(LIB_DIR)/$(LIBNAME) - - -$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile - $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \ - $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(OBJECTS) $(MESA_MODULES) - - -depend: $(C_SOURCES) $(ASM_SOURCES) - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \ - >& /dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -clean: - -rm -f *.o server/*.o +include ../Makefile.template -include depend +symlinks: diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 14ea13648c9..f080d474462 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -49,7 +49,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "vblank.h" #ifndef _SOLO -#include "glxextensions.h" +#include "GL/internal/dri_interface.h" #endif /* Radeon configuration diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.h b/src/mesa/drivers/dri/radeon/radeon_screen.h index 5c80281777f..d501fa1f238 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.h +++ b/src/mesa/drivers/dri/radeon/radeon_screen.h @@ -43,7 +43,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * IMPORTS: these headers contain all the DRI, X and kernel-related * definitions that we need. */ -#include "dri_util.h" +/* #include "dri_util.h" */ #include "radeon_dri.h" #include "radeon_reg.h" #include "drm_sarea.h" diff --git a/src/mesa/drivers/dri/sis/Makefile b/src/mesa/drivers/dri/sis/Makefile index 0ecc6e56e05..0c1c5081c74 100644 --- a/src/mesa/drivers/dri/sis/Makefile +++ b/src/mesa/drivers/dri/sis/Makefile @@ -5,15 +5,6 @@ include $(TOP)/configs/current LIBNAME = sis_dri.so -DEFINES += \ - -D_HAVE_SWRAST=1 \ - -D_HAVE_SWTNL=1 \ - -D_HAVE_SANITY=1 \ - -D_HAVE_CODEGEN=1 \ - -D_HAVE_LIGHTING=1 \ - -D_HAVE_TEXGEN=1 \ - -D_HAVE_USERCLIP=1 \ - -DGLX_DIRECT_RENDERING # Not yet # MINIGLX_SOURCES = server/sis_dri.c @@ -44,79 +35,10 @@ DRIVER_SOURCES = \ C_SOURCES = \ $(COMMON_SOURCES) \ - $(MINIGLX_SOURCES) \ $(DRIVER_SOURCES) -# Include directories -INCLUDE_DIRS = \ - -I. \ - -I../common \ - -Iserver \ - -I$(TOP)/src/glx/mini \ - -I$(TOP)/include \ - -I$(DRM_SOURCE_PATH)/shared \ - -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ - -I$(TOP)/src/mesa/glapi \ - -I$(TOP)/src/mesa/math \ - -I$(TOP)/src/mesa/transform \ - -I$(TOP)/src/mesa/shader \ - -I$(TOP)/src/mesa/swrast \ - -I$(TOP)/src/mesa/swrast_setup - -# Core Mesa objects -MESA_MODULES = $(TOP)/src/mesa/mesa.a - -# Libraries that the driver shared lib depends on -LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc - - -ifeq ($(WINDOW_SYSTEM),dri) -WINOBJ=$(MESABUILDDIR)/dri/dri.a -WINLIB= -else -WINOBJ= -WINLIB=-L$(MESA)/src/glx/mini -endif - ASM_SOURCES = -OBJECTS = $(C_SOURCES:.c=.o) \ - $(ASM_SOURCES:.S=.o) - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: depend $(LIB_DIR)/$(LIBNAME) - - -$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile - $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \ - $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS) - - -depend: $(C_SOURCES) $(ASM_SOURCES) - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \ - >& /dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -clean: - -rm -f *.o server/*.o - +include ../Makefile.template -include depend +symlinks: diff --git a/src/mesa/drivers/dri/tdfx/Makefile b/src/mesa/drivers/dri/tdfx/Makefile index ddbbc416bc5..6517285e4ba 100644 --- a/src/mesa/drivers/dri/tdfx/Makefile +++ b/src/mesa/drivers/dri/tdfx/Makefile @@ -5,16 +5,6 @@ include $(TOP)/configs/current LIBNAME = tdfx_dri.so -DEFINES += \ - -D_HAVE_SWRAST=1 \ - -D_HAVE_SWTNL=1 \ - -D_HAVE_SANITY=1 \ - -D_HAVE_CODEGEN=1 \ - -D_HAVE_LIGHTING=1 \ - -D_HAVE_TEXGEN=1 \ - -D_HAVE_USERCLIP=1 \ - -DGLX_DIRECT_RENDERING - # not yet # MINIGLX_SOURCES = server/tdfx_dri.c @@ -43,79 +33,13 @@ DRIVER_SOURCES = \ C_SOURCES = \ $(COMMON_SOURCES) \ - $(MINIGLX_SOURCES) \ $(DRIVER_SOURCES) -# Include directories -INCLUDE_DIRS = \ - -I. \ - -I../common \ - -Iserver \ - -I$(TOP)/src/glx/mini \ - -I$(TOP)/include \ - -I$(DRM_SOURCE_PATH)/shared \ - -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ - -I$(TOP)/src/mesa/glapi \ - -I$(TOP)/src/mesa/math \ - -I$(TOP)/src/mesa/transform \ - -I$(TOP)/src/mesa/shader \ - -I$(TOP)/src/mesa/swrast \ - -I$(TOP)/src/mesa/swrast_setup - -# Core Mesa objects -MESA_MODULES = $(TOP)/src/mesa/mesa.a - -# Libraries that the driver shared lib depends on -LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc - - -ifeq ($(WINDOW_SYSTEM),dri) -WINOBJ=$(MESABUILDDIR)/dri/dri.a -WINLIB= -else -WINOBJ= -WINLIB=-L$(MESA)/src/glx/mini -endif ASM_SOURCES = -OBJECTS = $(C_SOURCES:.c=.o) \ - $(ASM_SOURCES:.S=.o) - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: depend $(LIB_DIR)/$(LIBNAME) - - -$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile - $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \ - $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS) - - -depend: $(C_SOURCES) $(ASM_SOURCES) - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \ - >& /dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - +include ../Makefile.template -clean: - -rm -f *.o server/*.o +symlinks: -include depend diff --git a/src/mesa/drivers/dri/unichrome/Makefile b/src/mesa/drivers/dri/unichrome/Makefile index 1af4f23af1e..5cef902860d 100644 --- a/src/mesa/drivers/dri/unichrome/Makefile +++ b/src/mesa/drivers/dri/unichrome/Makefile @@ -5,16 +5,6 @@ include $(TOP)/configs/current LIBNAME = unichrome_dri.so -DEFINES += \ - -D_HAVE_SWRAST=1 \ - -D_HAVE_SWTNL=1 \ - -D_HAVE_SANITY=1 \ - -D_HAVE_CODEGEN=1 \ - -D_HAVE_LIGHTING=1 \ - -D_HAVE_TEXGEN=1 \ - -D_HAVE_USERCLIP=1 \ - -DGLX_DIRECT_RENDERING - MINIGLX_SOURCES = server/via_dri.c COMMON_SOURCES = \ @@ -42,79 +32,11 @@ DRIVER_SOURCES = \ C_SOURCES = \ $(COMMON_SOURCES) \ - $(MINIGLX_SOURCES) \ $(DRIVER_SOURCES) -# Include directories -INCLUDE_DIRS = \ - -I. \ - -I../common \ - -Iserver \ - -I$(TOP)/src/glx/mini \ - -I$(TOP)/include \ - -I$(DRM_SOURCE_PATH)\shared \ - -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ - -I$(TOP)/src/mesa/glapi \ - -I$(TOP)/src/mesa/math \ - -I$(TOP)/src/mesa/transform \ - -I$(TOP)/src/mesa/shader \ - -I$(TOP)/src/mesa/swrast \ - -I$(TOP)/src/mesa/swrast_setup - -# Core Mesa objects -MESA_MODULES = $(TOP)/src/mesa/mesa.a - -# Libraries that the driver shared lib depends on -LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc - - -ifeq ($(WINDOW_SYSTEM),dri) -WINOBJ=$(MESABUILDDIR)/dri/dri.a -WINLIB= -else -WINOBJ= -WINLIB=-L$(MESA)/src/glx/mini -endif - ASM_SOURCES = -OBJECTS = $(C_SOURCES:.c=.o) \ - $(ASM_SOURCES:.S=.o) - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: depend $(LIB_DIR)/$(LIBNAME) - - -$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile - $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \ - $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS) - - -depend: $(C_SOURCES) $(ASM_SOURCES) - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \ - >& /dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -clean: - -rm -f *.o server/*.o +include ../Makefile.template -include depend +symlinks: diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c index 80b573e0e51..9986bede6f5 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.c +++ b/src/mesa/drivers/dri/unichrome/via_context.c @@ -454,7 +454,7 @@ viaCreateContext(const __GLcontextModes *mesaVis, _tnl_allow_vertex_fog(ctx, GL_TRUE); #ifndef _SOLO - vmesa->display = dpy; +/* vmesa->display = dpy; */ vmesa->display = sPriv->display; #endif @@ -545,7 +545,7 @@ viaCreateContext(const __GLcontextModes *mesaVis, { GLboolean saam; int count = 0, fbSize; -#ifdef _SOLO +#ifndef USE_XINERAMA vmesa->saam = 0; #else saam = XineramaIsActive(vmesa->display); @@ -706,7 +706,7 @@ void viaXMesaWindowMoved(viaContextPtr vmesa) break; } -#ifdef _SOLO +#ifndef USE_XINERAMA vmesa->viaScreen->fbOffset = 0; vmesa->saam &= ~S1; vmesa->saam |= S0; diff --git a/src/mesa/drivers/dri/unichrome/via_context.h b/src/mesa/drivers/dri/unichrome/via_context.h index 14123605914..25d9325288f 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.h +++ b/src/mesa/drivers/dri/unichrome/via_context.h @@ -44,7 +44,7 @@ typedef struct via_texture_object_t *viaTextureObjectPtr; #include "via_tex.h" #include "via_common.h" #include "xf86drmVIA.h" -#ifndef _SOLO +#ifdef USE_XINERAMA #include "../../../../../include/extensions/Xinerama.h" #endif #define VIA_FALLBACK_TEXTURE 0x1 @@ -264,7 +264,7 @@ struct via_context_t { int drawW; int drawH; GLuint saam; -#ifndef _SOLO +#ifdef USE_XINERAMA XineramaScreenInfo *xsi; #endif int drawXoffSaam; diff --git a/src/mesa/drivers/dri/unichrome/via_dri.h b/src/mesa/drivers/dri/unichrome/via_dri.h index aef0ac4ba0f..9c17cf6b1d8 100644 --- a/src/mesa/drivers/dri/unichrome/via_dri.h +++ b/src/mesa/drivers/dri/unichrome/via_dri.h @@ -29,7 +29,7 @@ typedef struct { int priv2; int fbOffset; int fbSize; -#ifndef _SOLO +#ifdef USE_XINERAMA Bool drixinerama; #endif int backOffset; diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index e0f64cf94d6..dd65b30f896 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -88,7 +88,7 @@ viaInitDriver(__DRIscreenPrivate *sPriv) viaScreen->bytesPerPixel = gDRIPriv->bytesPerPixel; viaScreen->fbOffset = 0; viaScreen->fbSize = gDRIPriv->fbSize; -#ifndef _SOLO +#ifdef USE_XINERAMA viaScreen->drixinerama = gDRIPriv->drixinerama; #endif /*=* John Sheng [2003.12.9] Tuxracer & VQ *=*/ diff --git a/src/mesa/drivers/dri/unichrome/via_screen.h b/src/mesa/drivers/dri/unichrome/via_screen.h index f8d2b9c57a6..e34636df7e4 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.h +++ b/src/mesa/drivers/dri/unichrome/via_screen.h @@ -43,7 +43,7 @@ typedef struct { int fbFormat; int fbOffset; int fbSize; -#ifndef _SOLO +#ifdef USE_XINERAMA Bool drixinerama; #endif -- cgit v1.2.3 From 27eb8fa35a76c7c9d79130d1fb9138dbeb455182 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 21 May 2004 15:51:13 +0000 Subject: remove duplicate GLX_DRAWABLE_TYPE token, sorted tokens by enum value --- include/GL/glx.h | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index b34b2ceaec8..083634261cb 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 4.1 + * Version: 6.1 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2003 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"), @@ -111,8 +111,6 @@ extern "C" { */ #define GLX_CONFIG_CAVEAT 0x20 #define GLX_DONT_CARE 0xFFFFFFFF -#define GLX_SLOW_CONFIG 0x8001 -#define GLX_NON_CONFORMANT_CONFIG 0x800D #define GLX_X_VISUAL_TYPE 0x22 #define GLX_TRANSPARENT_TYPE 0x23 #define GLX_TRANSPARENT_INDEX_VALUE 0x24 @@ -120,17 +118,6 @@ extern "C" { #define GLX_TRANSPARENT_GREEN_VALUE 0x26 #define GLX_TRANSPARENT_BLUE_VALUE 0x27 #define GLX_TRANSPARENT_ALPHA_VALUE 0x28 -#define GLX_MAX_PBUFFER_WIDTH 0x8016 -#define GLX_MAX_PBUFFER_HEIGHT 0x8017 -#define GLX_MAX_PBUFFER_PIXELS 0x8018 -#define GLX_PRESERVED_CONTENTS 0x801B -#define GLX_LARGEST_PBUFFER 0x801C -#define GLX_WIDTH 0x801D -#define GLX_HEIGHT 0x801E -#define GLX_EVENT_MASK 0x801F -#define GLX_DRAWABLE_TYPE 0x8010 -#define GLX_FBCONFIG_ID 0x8013 -#define GLX_VISUAL_ID 0x800B #define GLX_WINDOW_BIT 0x00000001 #define GLX_PIXMAP_BIT 0x00000002 #define GLX_PBUFFER_BIT 0x00000004 @@ -142,10 +129,8 @@ extern "C" { #define GLX_DEPTH_BUFFER_BIT 0x00000020 #define GLX_STENCIL_BUFFER_BIT 0x00000040 #define GLX_ACCUM_BUFFER_BIT 0x00000080 -#define GLX_DRAWABLE_TYPE 0x8010 -#define GLX_RENDER_TYPE 0x8011 -#define GLX_X_RENDERABLE 0x8012 #define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 #define GLX_TRUE_COLOR 0x8002 #define GLX_DIRECT_COLOR 0x8003 #define GLX_PSEUDO_COLOR 0x8004 @@ -154,18 +139,32 @@ extern "C" { #define GLX_STATIC_GRAY 0x8007 #define GLX_TRANSPARENT_RGB 0x8008 #define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 #define GLX_RGBA_TYPE 0x8014 #define GLX_COLOR_INDEX_TYPE 0x8015 -#define GLX_COLOR_INDEX_BIT 0x00000002 -#define GLX_RGBA_BIT 0x00000001 -#define GLX_SCREEN 0x800C -#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F #define GLX_DAMAGED 0x8020 #define GLX_SAVED 0x8021 #define GLX_WINDOW 0x8022 #define GLX_PBUFFER 0x8023 #define GLX_PBUFFER_HEIGHT 0x8040 #define GLX_PBUFFER_WIDTH 0x8041 +#define GLX_RGBA_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 /* -- cgit v1.2.3 From fabe2b9ba38e95bd21a35b265bfc403fa3cb2883 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 1 Jun 2004 16:38:56 +0000 Subject: Replace all occurances of XF86DRIClipRect (and related typedefs) with drm_clip_rect_t. --- include/GL/internal/dri_interface.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 14b3751484e..aaf2da8153c 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -48,6 +48,7 @@ #include #include +#include /** * \name DRI interface structures @@ -64,7 +65,6 @@ typedef struct __DRIdriverRec __DRIdriver; typedef struct __DRIframebufferRec __DRIframebuffer; typedef struct __DRIversionRec __DRIversion; typedef unsigned long __DRIid; -struct _XF86DRIClipRect; /*@}*/ @@ -89,7 +89,7 @@ typedef int (* PFNGLXGETINTERNALVERSIONPROC) ( void ); * * \sa __glXWindowExists, glXGetProcAddress */ -typedef Bool (* PFNGLXWINDOWEXISTSPROC) (Display *dpy, GLXDrawable draw); +typedef Bool (* PFNGLXWINDOWEXISTSPROC) (Display *dpy, __DRIid draw); /** * Type of a pointer to \c __glXGetUST, as returned by \c glXGetProcAddress. @@ -144,11 +144,11 @@ typedef void (* PFNGLXSCRENABLEEXTENSIONPROC) ( void *psc, const char * name ); * \sa __glXGetDrawableInfo, glXGetProcAddress */ typedef Bool (* PFNGLXGETDRAWABLEINFOPROC) ( Display *dpy, int scrn, - Drawable draw, unsigned int * index, unsigned int * stamp, + __DRIid draw, unsigned int * index, unsigned int * stamp, int * x, int * y, int * width, int * height, - int * numClipRects, struct _XF86DRIClipRect ** pClipRects, + int * numClipRects, drm_clip_rect_t ** pClipRects, int * backX, int * backY, - int * numBackClipRects, struct _XF86DRIClipRect ** pBackClipRects ); + int * numBackClipRects, drm_clip_rect_t ** pBackClipRects ); /*@}*/ @@ -260,13 +260,13 @@ struct __DRIscreenRec { * drawable dependent methods. */ void *(*createNewDrawable)(Display *dpy, const __GLcontextModes *modes, - GLXDrawable draw, __DRIdrawable *pdraw, + __DRIid draw, __DRIdrawable *pdraw, int renderType, const int *attrs); /** * Method to return a pointer to the DRI drawable data. */ - __DRIdrawable *(*getDrawable)(Display *dpy, GLXDrawable draw, + __DRIdrawable *(*getDrawable)(Display *dpy, __DRIid draw, void *drawablePrivate); /** -- cgit v1.2.3 From 60b0e12830310e7c05b4043857ed277b28b1c781 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 1 Jun 2004 20:24:59 +0000 Subject: Convert 'Display *' to '__DRInativeDisplay *'. Only portions of the interface that are not *strictly* part of the old interface were changed. Replace GetDrawableInfo type (dri_util.h) with PFNGLXGETDRAWABLEINFOPROC (dri_interface.h). Wrap __driCreateScreen (in drivers that use the new interface) with '#ifndef DRI_NEW_INTERFACE_ONLY'. --- include/GL/internal/dri_interface.h | 49 +++++++++++++++------------- src/mesa/drivers/dri/common/dri_util.c | 50 ++++++++++++++--------------- src/mesa/drivers/dri/common/dri_util.h | 20 ++++-------- src/mesa/drivers/dri/i810/i810screen.c | 4 +-- src/mesa/drivers/dri/i830/i830_screen.c | 4 +-- src/mesa/drivers/dri/mach64/mach64_screen.c | 4 +-- src/mesa/drivers/dri/mga/mga_xmesa.c | 4 +-- src/mesa/drivers/dri/r200/r200_screen.c | 4 +-- src/mesa/drivers/dri/radeon/radeon_screen.c | 4 +-- src/mesa/drivers/dri/tdfx/tdfx_screen.c | 4 +-- 10 files changed, 72 insertions(+), 75 deletions(-) (limited to 'include') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index aaf2da8153c..977a8228594 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -38,9 +38,11 @@ #ifndef DRI_INTERFACE_H #define DRI_INTERFACE_H +#ifndef DRI_NEW_INTERFACE_ONLY /* FIXME: With a small amount of work, these two includes can be removed. */ #include #include +#endif #ifndef DRI_NEW_INTERFACE_ONLY #include @@ -65,6 +67,7 @@ typedef struct __DRIdriverRec __DRIdriver; typedef struct __DRIframebufferRec __DRIframebuffer; typedef struct __DRIversionRec __DRIversion; typedef unsigned long __DRIid; +typedef void __DRInativeDisplay; /*@}*/ @@ -72,7 +75,7 @@ typedef unsigned long __DRIid; * \name Functions provided by the driver loader. */ /*@{*/ -extern __DRIscreen *__glXFindDRIScreen(Display *dpy, int scrn); +extern __DRIscreen *__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn); /** @@ -89,7 +92,7 @@ typedef int (* PFNGLXGETINTERNALVERSIONPROC) ( void ); * * \sa __glXWindowExists, glXGetProcAddress */ -typedef Bool (* PFNGLXWINDOWEXISTSPROC) (Display *dpy, __DRIid draw); +typedef Bool (* PFNGLXWINDOWEXISTSPROC) (__DRInativeDisplay *dpy, __DRIid draw); /** * Type of a pointer to \c __glXGetUST, as returned by \c glXGetProcAddress. @@ -116,7 +119,7 @@ typedef __GLcontextModes * (* PFNGLXCREATECONTEXTMODES) ( unsigned count, * * \sa glXGetScreenDriver, glXGetProcAddress, glXGetDriverConfig */ -typedef const char * (* PFNGLXGETSCREENDRIVERPROC) (Display *dpy, int scrNum); +typedef const char * (* PFNGLXGETSCREENDRIVERPROC) (__DRInativeDisplay *dpy, int scrNum); /** * Type of a pointer to \c glXGetDriverConfig, as returned by @@ -143,7 +146,7 @@ typedef void (* PFNGLXSCRENABLEEXTENSIONPROC) ( void *psc, const char * name ); * * \sa __glXGetDrawableInfo, glXGetProcAddress */ -typedef Bool (* PFNGLXGETDRAWABLEINFOPROC) ( Display *dpy, int scrn, +typedef Bool (* PFNGLXGETDRAWABLEINFOPROC) ( __DRInativeDisplay *dpy, int scrn, __DRIid draw, unsigned int * index, unsigned int * stamp, int * x, int * y, int * width, int * height, int * numClipRects, drm_clip_rect_t ** pClipRects, @@ -157,7 +160,7 @@ typedef Bool (* PFNGLXGETDRAWABLEINFOPROC) ( Display *dpy, int scrn, */ /*@{*/ -extern void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc, +extern void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, @@ -234,7 +237,7 @@ struct __DRIscreenRec { /** * Method to destroy the private DRI screen data. */ - void (*destroyScreen)(Display *dpy, int scrn, void *screenPrivate); + void (*destroyScreen)(__DRInativeDisplay *dpy, int scrn, void *screenPrivate); /** * Method to create the private DRI context data and initialize the @@ -259,14 +262,14 @@ struct __DRIscreenRec { * Method to create the private DRI drawable data and initialize the * drawable dependent methods. */ - void *(*createNewDrawable)(Display *dpy, const __GLcontextModes *modes, + void *(*createNewDrawable)(__DRInativeDisplay *dpy, const __GLcontextModes *modes, __DRIid draw, __DRIdrawable *pdraw, int renderType, const int *attrs); /** * Method to return a pointer to the DRI drawable data. */ - __DRIdrawable *(*getDrawable)(Display *dpy, __DRIid draw, + __DRIdrawable *(*getDrawable)(__DRInativeDisplay *dpy, __DRIid draw, void *drawablePrivate); /** @@ -300,13 +303,13 @@ struct __DRIscreenRec { * \since Internal API version 20030815. */ /*@{*/ - void *(*allocateMemory)(Display *dpy, int scrn, GLsizei size, + void *(*allocateMemory)(__DRInativeDisplay *dpy, int scrn, GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); - void (*freeMemory)(Display *dpy, int scrn, GLvoid *pointer); + void (*freeMemory)(__DRInativeDisplay *dpy, int scrn, GLvoid *pointer); - GLuint (*memoryOffset)(Display *dpy, int scrn, const GLvoid *pointer); + GLuint (*memoryOffset)(__DRInativeDisplay *dpy, int scrn, const GLvoid *pointer); /*@}*/ /** @@ -315,7 +318,7 @@ struct __DRIscreenRec { * * \since Internal API version 20031201. */ - void * (*createNewContext)(Display *dpy, const __GLcontextModes *modes, + void * (*createNewContext)(__DRInativeDisplay *dpy, const __GLcontextModes *modes, int render_type, void *sharedPrivate, __DRIcontext *pctx); }; @@ -328,7 +331,7 @@ struct __DRIcontextRec { /** * Method to destroy the private DRI context data. */ - void (*destroyContext)(Display *dpy, int scrn, void *contextPrivate); + void (*destroyContext)(__DRInativeDisplay *dpy, int scrn, void *contextPrivate); /** * Method to bind a DRI drawable to a DRI graphics context. @@ -399,7 +402,7 @@ struct __DRIcontextRec { * * \since Internal API version 20040415. */ - Bool (*bindContext3)(Display *dpy, int scrn, __DRIid draw, + Bool (*bindContext3)(__DRInativeDisplay *dpy, int scrn, __DRIid draw, __DRIid read, __DRIcontext *ctx); /** @@ -407,7 +410,7 @@ struct __DRIcontextRec { * * \since Internal API version 20040415. */ - Bool (*unbindContext3)(Display *dpy, int scrn, __DRIid draw, + Bool (*unbindContext3)(__DRInativeDisplay *dpy, int scrn, __DRIid draw, __DRIid read, __DRIcontext *ctx); }; @@ -421,12 +424,12 @@ struct __DRIdrawableRec { /** * Method to destroy the private DRI drawable data. */ - void (*destroyDrawable)(Display *dpy, void *drawablePrivate); + void (*destroyDrawable)(__DRInativeDisplay *dpy, void *drawablePrivate); /** * Method to swap the front and back buffers. */ - void (*swapBuffers)(Display *dpy, void *drawablePrivate); + void (*swapBuffers)(__DRInativeDisplay *dpy, void *drawablePrivate); /** * Opaque pointer to private per drawable direct rendering data. @@ -440,14 +443,14 @@ struct __DRIdrawableRec { * * \since Internal API version 20030317. */ - int (*getSBC)(Display *dpy, void *drawablePrivate, int64_t *sbc ); + int (*getSBC)(__DRInativeDisplay *dpy, void *drawablePrivate, int64_t *sbc ); /** * Wait for the SBC to be greater than or equal target_sbc. * * \since Internal API version 20030317. */ - int (*waitForSBC)( Display * dpy, void *drawablePriv, + int (*waitForSBC)( __DRInativeDisplay * dpy, void *drawablePriv, int64_t target_sbc, int64_t * msc, int64_t * sbc ); @@ -459,7 +462,7 @@ struct __DRIdrawableRec { * * \since Internal API version 20030317. */ - int (*waitForMSC)( Display * dpy, void *drawablePriv, + int (*waitForMSC)( __DRInativeDisplay * dpy, void *drawablePriv, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t * msc, int64_t * sbc ); @@ -472,7 +475,7 @@ struct __DRIdrawableRec { * * \since Internal API version 20030317. */ - int64_t (*swapBuffersMSC)(Display *dpy, void *drawablePrivate, + int64_t (*swapBuffersMSC)(__DRInativeDisplay *dpy, void *drawablePrivate, int64_t target_msc, int64_t divisor, int64_t remainder); @@ -481,14 +484,14 @@ struct __DRIdrawableRec { * * \since Internal API version 20030317. */ - int (*frameTracking)(Display *dpy, void *drawablePrivate, Bool enable); + int (*frameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate, Bool enable); /** * Retrieve frame usage information. * * \since Internal API version 20030317. */ - int (*queryFrameTracking)(Display *dpy, void *drawablePrivate, + int (*queryFrameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate, int64_t * sbc, int64_t * missedFrames, float * lastMissedUsage, float * usage ); diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 13101755b3e..4dbd57ae86c 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -44,7 +44,7 @@ /*#define DRI_NEW_INTERFACE_ONLY*/ #ifndef GLX_OML_sync_control -typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, __DRIid drawable, int32_t *numerator, int32_t *denominator); +typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (__DRInativeDisplay *dpy, __DRIid drawable, int32_t *numerator, int32_t *denominator); #endif /** @@ -61,7 +61,7 @@ static const int empty_attribute_list[1] = { None }; */ static PFNGLXWINDOWEXISTSPROC window_exists; -typedef Bool (*PFNGLXCREATECONTEXTWITHCONFIGPROC)( Display*, int, int, void *, +typedef Bool (*PFNGLXCREATECONTEXTWITHCONFIGPROC)( __DRInativeDisplay*, int, int, void *, drmContextPtr ); static PFNGLXCREATECONTEXTWITHCONFIGPROC create_context_with_config; @@ -73,14 +73,14 @@ static PFNGLXCREATECONTEXTWITHCONFIGPROC create_context_with_config; static int api_ver = 0; /* forward declarations */ -static int driQueryFrameTracking( Display * dpy, void * priv, +static int driQueryFrameTracking( __DRInativeDisplay * dpy, void * priv, int64_t * sbc, int64_t * missedFrames, float * lastMissedUsage, float * usage ); -static void *driCreateNewDrawable(Display *dpy, const __GLcontextModes *modes, +static void *driCreateNewDrawable(__DRInativeDisplay *dpy, const __GLcontextModes *modes, __DRIid draw, __DRIdrawable *pdraw, int renderType, const int *attrs); -static void driDestroyDrawable(Display *dpy, void *drawablePrivate); +static void driDestroyDrawable(__DRInativeDisplay *dpy, void *drawablePrivate); @@ -144,7 +144,7 @@ __driUtilMessage(const char *f, ...) * if found, or \c NULL if no match is found. */ static const __GLcontextModes * -findConfigMode(Display *dpy, int scrn, VisualID vid, +findConfigMode(__DRInativeDisplay *dpy, int scrn, VisualID vid, const __DRIscreen * pDRIScreen) { if ( (pDRIScreen != NULL) && (pDRIScreen->private != NULL) ) { @@ -166,7 +166,7 @@ findConfigMode(Display *dpy, int scrn, VisualID vid, * about X structures like a \c Visual. */ static Bool -fake_XF86DRICreateContextWithConfig( Display* dpy, int screen, int configID, +fake_XF86DRICreateContextWithConfig( __DRInativeDisplay* dpy, int screen, int configID, XID* context, drmContextPtr hHWContext ) { Visual vis; @@ -272,7 +272,7 @@ static void __driGarbageCollectDrawables(void *drawHash) { __DRIid draw; __DRIdrawable *pdraw; - Display *dpy; + __DRInativeDisplay *dpy; if (drmHashFirst(drawHash, &draw, (void **)&pdraw)) { do { @@ -316,7 +316,7 @@ static void __driGarbageCollectDrawables(void *drawHash) * While casting the opaque private pointers associated with the parameters * into their respective real types it also assures they are not \c NULL. */ -static Bool driUnbindContext3(Display *dpy, int scrn, +static Bool driUnbindContext3(__DRInativeDisplay *dpy, int scrn, __DRIid draw, __DRIid read, __DRIcontext *ctx) { @@ -407,7 +407,7 @@ static Bool driUnbindContext3(Display *dpy, int scrn, * be needed in those places when support for pbuffers and / or pixmaps * is added. Is it safe to assume that the drawable is a window? */ -static Bool DoBindContext(Display *dpy, +static Bool DoBindContext(__DRInativeDisplay *dpy, __DRIid draw, __DRIid read, __DRIcontext *ctx, const __GLcontextModes * modes, __DRIscreenPrivate *psp) @@ -498,7 +498,7 @@ static Bool DoBindContext(Display *dpy, * for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent * function. */ -static Bool driBindContext3(Display *dpy, int scrn, +static Bool driBindContext3(__DRInativeDisplay *dpy, int scrn, __DRIid draw, __DRIid read, __DRIcontext * ctx) { @@ -686,7 +686,7 @@ __driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp) * * Is called directly from glXSwapBuffers(). */ -static void driSwapBuffers( Display *dpy, void *drawablePrivate ) +static void driSwapBuffers( __DRInativeDisplay *dpy, void *drawablePrivate ) { __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; dPriv->swapBuffers(dPriv); @@ -706,7 +706,7 @@ static int driGetMSC( void *screenPrivate, int64_t *msc ) /** * Called directly from a number of higher-level GLX functions. */ -static int driGetSBC( Display *dpy, void *drawablePrivate, int64_t *sbc ) +static int driGetSBC( __DRInativeDisplay *dpy, void *drawablePrivate, int64_t *sbc ) { __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; __DRIswapInfo sInfo; @@ -719,7 +719,7 @@ static int driGetSBC( Display *dpy, void *drawablePrivate, int64_t *sbc ) return status; } -static int driWaitForSBC( Display * dpy, void *drawablePriv, +static int driWaitForSBC( __DRInativeDisplay * dpy, void *drawablePriv, int64_t target_sbc, int64_t * msc, int64_t * sbc ) { @@ -729,7 +729,7 @@ static int driWaitForSBC( Display * dpy, void *drawablePriv, msc, sbc ); } -static int driWaitForMSC( Display * dpy, void *drawablePriv, +static int driWaitForMSC( __DRInativeDisplay * dpy, void *drawablePriv, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t * msc, int64_t * sbc ) @@ -756,7 +756,7 @@ static int driWaitForMSC( Display * dpy, void *drawablePriv, return status; } -static int64_t driSwapBuffersMSC( Display * dpy, void *drawablePriv, +static int64_t driSwapBuffersMSC( __DRInativeDisplay * dpy, void *drawablePriv, int64_t target_msc, int64_t divisor, int64_t remainder ) { @@ -771,7 +771,7 @@ static int64_t driSwapBuffersMSC( Display * dpy, void *drawablePriv, /** * This is called via __DRIscreenRec's createNewDrawable pointer. */ -static void *driCreateNewDrawable(Display *dpy, +static void *driCreateNewDrawable(__DRInativeDisplay *dpy, const __GLcontextModes *modes, __DRIid draw, __DRIdrawable *pdraw, @@ -823,7 +823,7 @@ static void *driCreateNewDrawable(Display *dpy, pdp->driScreenPriv = psp; pdp->driContextPriv = &psp->dummyContextPriv; - pdp->getInfo = (GetDrawableInfo *) + pdp->getInfo = (PFNGLXGETDRAWABLEINFOPROC) glXGetProcAddress( (const GLubyte *) "__glXGetDrawableInfo" ); if ( pdp->getInfo == NULL ) { #ifdef DRI_NEW_INTERFACE_ONLY @@ -874,7 +874,7 @@ static void *driCreateNewDrawable(Display *dpy, return (void *) pdp; } -static __DRIdrawable *driGetDrawable(Display *dpy, __DRIid draw, +static __DRIdrawable *driGetDrawable(__DRInativeDisplay *dpy, __DRIid draw, void *screenPrivate) { __DRIscreenPrivate *psp = (__DRIscreenPrivate *) screenPrivate; @@ -886,7 +886,7 @@ static __DRIdrawable *driGetDrawable(Display *dpy, __DRIid draw, return __driFindDrawable(psp->drawHash, draw); } -static void driDestroyDrawable(Display *dpy, void *drawablePrivate) +static void driDestroyDrawable(__DRInativeDisplay *dpy, void *drawablePrivate) { __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *) drawablePrivate; __DRIscreenPrivate *psp = pdp->driScreenPriv; @@ -927,7 +927,7 @@ static void driDestroyDrawable(Display *dpy, void *drawablePrivate) * This function calls __DriverAPIRec::DestroyContext on \p contextPrivate, calls * drmDestroyContext(), and finally frees \p contextPrivate. */ -static void driDestroyContext(Display *dpy, int scrn, void *contextPrivate) +static void driDestroyContext(__DRInativeDisplay *dpy, int scrn, void *contextPrivate) { __DRIcontextPrivate *pcp = (__DRIcontextPrivate *) contextPrivate; @@ -962,7 +962,7 @@ static void driDestroyContext(Display *dpy, int scrn, void *contextPrivate) * */ static void * -driCreateNewContext(Display *dpy, const __GLcontextModes *modes, +driCreateNewContext(__DRInativeDisplay *dpy, const __GLcontextModes *modes, int render_type, void *sharedPrivate, __DRIcontext *pctx) { __DRIscreen *pDRIScreen; @@ -1109,7 +1109,7 @@ static void *driCreateContext(Display *dpy, XVisualInfo *vis, * This function calls __DriverAPIRec::DestroyScreen on \p screenPrivate, calls * drmClose(), and finally frees \p screenPrivate. */ -static void driDestroyScreen(Display *dpy, int scrn, void *screenPrivate) +static void driDestroyScreen(__DRInativeDisplay *dpy, int scrn, void *screenPrivate) { __DRIscreenPrivate *psp = (__DRIscreenPrivate *) screenPrivate; @@ -1159,7 +1159,7 @@ static void driDestroyScreen(Display *dpy, int scrn, void *screenPrivate) * \param driverAPI Driver API functions used by other routines in dri_util.c. */ __DRIscreenPrivate * -__driUtilCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc, +__driUtilCreateNewScreen(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -1560,7 +1560,7 @@ int driCompareGLXAPIVersion( GLuint required_version ) static int -driQueryFrameTracking( Display * dpy, void * priv, +driQueryFrameTracking( __DRInativeDisplay * dpy, void * priv, int64_t * sbc, int64_t * missedFrames, float * lastMissedUsage, float * usage ) { diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index 17f26d1a210..1cc5f7cc546 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -254,14 +254,6 @@ struct __DRIswapInfoRec { }; -typedef Bool (GetDrawableInfo)( Display *dpy, int scrn, __DRIid draw, - unsigned int * index, unsigned int * stamp, - int * x, int * y, int * width, int * height, - int * numClipRects, drm_clip_rect_t ** pClipRects, - int * backX, int * backY, - int * numBackClipRects, drm_clip_rect_t ** pBackClipRects ); - - /** * Per-drawable private DRI driver information. */ @@ -357,7 +349,7 @@ struct __DRIdrawablePrivateRec { * __driUtilUpdateDrawableInfo() which calls XF86DRIGetDrawableInfo(). */ /*@{*/ - Display *display; + __DRInativeDisplay *display; int screen; /*@}*/ @@ -370,7 +362,7 @@ struct __DRIdrawablePrivateRec { * Get information about the location, size, and clip rects of the * drawable within the display. */ - GetDrawableInfo * getInfo; + PFNGLXGETDRAWABLEINFOPROC getInfo; }; /** @@ -395,7 +387,7 @@ struct __DRIcontextPrivateRec { /** * This context's display pointer. */ - Display *display; + __DRInativeDisplay *display; /** * Pointer to drawable currently bound to this context. @@ -415,7 +407,7 @@ struct __DRIscreenPrivateRec { /** * Display for this screen */ - Display *display; + __DRInativeDisplay *display; /** * Current screen's number @@ -563,17 +555,19 @@ extern void __driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp); -extern __DRIscreenPrivate * __driUtilCreateNewScreen( Display *dpy, +extern __DRIscreenPrivate * __driUtilCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, int internal_api_version, const struct __DriverAPIRec *driverAPI ); +#ifndef DRI_NEW_INTERFACE_ONLY extern __DRIscreenPrivate * __driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, int numConfigs, __GLXvisualConfig *config, const struct __DriverAPIRec *driverAPI); +#endif /* DRI_NEW_INTERFACE_ONLY */ /* Test the version of the internal GLX API. Returns a value like strcmp. */ extern int diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index 8bb62217a92..8995ec0ba4c 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -401,7 +401,7 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &i810API); return (void *) psp; } -#else +#elif !defined(DRI_NEW_INTERFACE_ONLY) void *__driCreateScreen(struct DRIDriverRec *driver, struct DRIDriverContextRec *driverContext) { @@ -422,7 +422,7 @@ void *__driCreateScreen(struct DRIDriverRec *driver, * failure. */ #ifdef USE_NEW_INTERFACE -void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, diff --git a/src/mesa/drivers/dri/i830/i830_screen.c b/src/mesa/drivers/dri/i830/i830_screen.c index 1a40c79a013..4314b2160f2 100644 --- a/src/mesa/drivers/dri/i830/i830_screen.c +++ b/src/mesa/drivers/dri/i830/i830_screen.c @@ -392,7 +392,7 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &i830API); return (void *) psp; } -#else +#elif !defined(DRI_NEW_INTERFACE_ONLY) void *__driCreateScreen(struct DRIDriverRec *driver, struct DRIDriverContextRec *driverContext) { @@ -551,7 +551,7 @@ i830FillInModes( unsigned pixel_bits, unsigned depth_bits, * failure. */ #ifdef USE_NEW_INTERFACE -void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index cd59cba8b6e..f5c35e49273 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -505,7 +505,7 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &mach64API); return (void *) psp; } -#else +#elif !defined(DRI_NEW_INTERFACE_ONLY) void *__driCreateScreen(struct DRIDriverRec *driver, struct DRIDriverContextRec *driverContext) { @@ -526,7 +526,7 @@ void *__driCreateScreen(struct DRIDriverRec *driver, * failure. */ #ifdef USE_NEW_INTERFACE -void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index df7856241fb..40d3b71002d 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -931,7 +931,7 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &mgaAPI); return (void *) psp; } -#else +#elif !defined(DRI_NEW_INTERFACE_ONLY) void *__driCreateScreen(struct DRIDriverRec *driver, struct DRIDriverContextRec *driverContext) { @@ -953,7 +953,7 @@ void *__driCreateScreen(struct DRIDriverRec *driver, * failure. */ #ifdef USE_NEW_INTERFACE -void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, diff --git a/src/mesa/drivers/dri/r200/r200_screen.c b/src/mesa/drivers/dri/r200/r200_screen.c index 129d70a653e..e634390d219 100644 --- a/src/mesa/drivers/dri/r200/r200_screen.c +++ b/src/mesa/drivers/dri/r200/r200_screen.c @@ -608,7 +608,7 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &r200API); return (void *) psp; } -#else +#elif !defined(DRI_NEW_INTERFACE_ONLY) void *__driCreateScreen(struct DRIDriverRec *driver, struct DRIDriverContextRec *driverContext) { @@ -630,7 +630,7 @@ void *__driCreateScreen(struct DRIDriverRec *driver, * failure. */ #ifdef USE_NEW_INTERFACE -void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index f080d474462..d5bb24b2489 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -565,7 +565,7 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &radeonAPI); return (void *) psp; } -#else +#elif !defined(DRI_NEW_INTERFACE_ONLY) void *__driCreateScreen(struct DRIDriverRec *driver, struct DRIDriverContextRec *driverContext) { @@ -586,7 +586,7 @@ void *__driCreateScreen(struct DRIDriverRec *driver, * failure. */ #ifdef USE_NEW_INTERFACE -void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index ed50529fd0f..bc87da9aa0a 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -402,7 +402,7 @@ static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits, * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on * failure. */ -void * __driCreateNewScreen( Display *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -453,7 +453,7 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &tdfxAPI); return (void *) psp; } -#else +#elif !defined(DRI_NEW_INTERFACE_ONLY) void *__driCreateScreen(struct DRIDriverRec *driver, struct DRIDriverContextRec *driverContext) { -- cgit v1.2.3 From 318aa8409983f3292b4919196df2ca42f4de6a16 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 2 Jun 2004 17:37:09 +0000 Subject: XF86DRIDestroyContext, XF86DRICreateDrawable, and XF86DRIDestroyDrawable are all called directly from DRI drivers using the new interface. Therefore, prototypes, using available datatypes, must be available in dri_interface.h. Since the prototypes are available there, xf86dri.h is no longer needed for DRI_NEW_INTERFACE_ONLY builds. --- include/GL/internal/dri_interface.h | 19 ++- src/mesa/drivers/dri/common/dri_util.c | 6 +- src/mesa/drivers/dri/dri_client/xf86dri.h | 213 ------------------------------ 3 files changed, 15 insertions(+), 223 deletions(-) delete mode 100644 src/mesa/drivers/dri/dri_client/xf86dri.h (limited to 'include') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 977a8228594..be0496f6bc0 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -39,13 +39,9 @@ #define DRI_INTERFACE_H #ifndef DRI_NEW_INTERFACE_ONLY -/* FIXME: With a small amount of work, these two includes can be removed. */ -#include -#include -#endif - -#ifndef DRI_NEW_INTERFACE_ONLY -#include +# include +# include +# include "GL/glxint.h" #endif #include @@ -152,6 +148,15 @@ typedef Bool (* PFNGLXGETDRAWABLEINFOPROC) ( __DRInativeDisplay *dpy, int scrn, int * numClipRects, drm_clip_rect_t ** pClipRects, int * backX, int * backY, int * numBackClipRects, drm_clip_rect_t ** pBackClipRects ); + +extern Bool XF86DRIDestroyContext( __DRInativeDisplay *dpy, int screen, + __DRIid context_id ); + +extern Bool XF86DRICreateDrawable( __DRInativeDisplay *dpy, int screen, + __DRIid drawable, drm_drawable_t *hHWDrawable ); + +extern Bool XF86DRIDestroyDrawable( __DRInativeDisplay *dpy, int screen, + __DRIid drawable); /*@}*/ diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 6b251c1cd6b..8af4c0a50a3 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -37,12 +37,12 @@ #include #include #include "dri_util.h" -#include "xf86dri.h" +#ifndef DRI_NEW_INTERFACE_ONLY +# include "xf86dri.h" +#endif /* DRI_NEW_INTERFACE_ONLY */ #include "sarea.h" #include "glcontextmodes.h" -/*#define DRI_NEW_INTERFACE_ONLY*/ - #ifndef GLX_OML_sync_control typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (__DRInativeDisplay *dpy, __DRIid drawable, int32_t *numerator, int32_t *denominator); #endif diff --git a/src/mesa/drivers/dri/dri_client/xf86dri.h b/src/mesa/drivers/dri/dri_client/xf86dri.h deleted file mode 100644 index d76c7b6a792..00000000000 --- a/src/mesa/drivers/dri/dri_client/xf86dri.h +++ /dev/null @@ -1,213 +0,0 @@ -/* $XFree86: xc/lib/GL/dri/xf86dri.h,v 1.8 2002/10/30 12:51:25 alanh Exp $ */ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -Copyright 2000 VA Linux Systems, Inc. -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, sub license, 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 (including the -next paragraph) 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 NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * Jens Owen - * Rickard E. (Rik) Faith - * - */ - -#ifndef _XF86DRI_H_ -#define _XF86DRI_H_ - -#include -#include "drm.h" -#include - -#define X_XF86DRIQueryVersion 0 -#define X_XF86DRIQueryDirectRenderingCapable 1 -#define X_XF86DRIOpenConnection 2 -#define X_XF86DRICloseConnection 3 -#define X_XF86DRIGetClientDriverName 4 -#define X_XF86DRICreateContext 5 -#define X_XF86DRIDestroyContext 6 -#define X_XF86DRICreateDrawable 7 -#define X_XF86DRIDestroyDrawable 8 -#define X_XF86DRIGetDrawableInfo 9 -#define X_XF86DRIGetDeviceInfo 10 -#define X_XF86DRIAuthConnection 11 -#define X_XF86DRIOpenFullScreen 12 /* Deprecated */ -#define X_XF86DRICloseFullScreen 13 /* Deprecated */ - -#define XF86DRINumberEvents 0 - -#define XF86DRIClientNotLocal 0 -#define XF86DRIOperationNotSupported 1 -#define XF86DRINumberErrors (XF86DRIOperationNotSupported + 1) - -#ifndef _XF86DRI_SERVER_ - -_XFUNCPROTOBEGIN - -Bool XF86DRIQueryExtension( -#if NeedFunctionPrototypes - Display* /* dpy */, - int* /* event_base */, - int* /* error_base */ -#endif -); - -Bool XF86DRIQueryVersion( -#if NeedFunctionPrototypes - Display* /* dpy */, - int* /* majorVersion */, - int* /* minorVersion */, - int* /* patchVersion */ -#endif -); - -Bool XF86DRIQueryDirectRenderingCapable( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - Bool* /* isCapable */ -#endif -); - -Bool XF86DRIOpenConnection( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - drmHandlePtr /* hSAREA */, - char** /* busIDString */ -#endif -); - -Bool XF86DRIAuthConnection( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - drmMagic /* magic */ -#endif -); - -Bool XF86DRICloseConnection( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */ -#endif -); - -Bool XF86DRIGetClientDriverName( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - int* /* ddxDriverMajorVersion */, - int* /* ddxDriverMinorVersion */, - int* /* ddxDriverPatchVersion */, - char** /* clientDriverName */ -#endif -); - -Bool XF86DRICreateContext( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - Visual* /* visual */, - XID* /* ptr to returned context id */, - drmContextPtr /* hHWContext */ -#endif -); - -Bool XF86DRICreateContextWithConfig( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - int /* visual ID / fbconfig ID */, - XID* /* ptr to returned context id */, - drmContextPtr /* hHWContext */ -#endif -); - -Bool XF86DRIDestroyContext( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - XID /* context id */ -#endif -); - -Bool XF86DRICreateDrawable( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - Drawable /* drawable */, - drmDrawablePtr /* hHWDrawable */ -#endif -); - -Bool XF86DRIDestroyDrawable( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - Drawable /* drawable */ -#endif -); - -Bool XF86DRIGetDrawableInfo( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - Drawable /* drawable */, - unsigned int* /* index */, - unsigned int* /* stamp */, - int* /* X */, - int* /* Y */, - int* /* W */, - int* /* H */, - int* /* numClipRects */, - drm_clip_rect_t*, /* pClipRects */ - int* /* backX */, - int* /* backY */, - int* /* numBackClipRects */, - drm_clip_rect_t* /* pBackClipRects */ -#endif -); - -Bool XF86DRIGetDeviceInfo( -#if NeedFunctionPrototypes - Display* /* dpy */, - int /* screen */, - drmHandlePtr /* hFrameBuffer */, - int* /* fbOrigin */, - int* /* fbSize */, - int* /* fbStride */, - int* /* devPrivateSize */, - void** /* pDevPrivate */ -#endif -); - -_XFUNCPROTOEND - -#endif /* _XF86DRI_SERVER_ */ - -#endif /* _XF86DRI_H_ */ - -- cgit v1.2.3 From 749e842953a9ea6e1c9070af7f7211bfc48aa1fd Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 2 Jun 2004 20:46:03 +0000 Subject: Replace Bool with GLboolean. --- include/GL/internal/dri_interface.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index be0496f6bc0..c0cd128a9e9 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -88,7 +88,7 @@ typedef int (* PFNGLXGETINTERNALVERSIONPROC) ( void ); * * \sa __glXWindowExists, glXGetProcAddress */ -typedef Bool (* PFNGLXWINDOWEXISTSPROC) (__DRInativeDisplay *dpy, __DRIid draw); +typedef GLboolean (* PFNGLXWINDOWEXISTSPROC) (__DRInativeDisplay *dpy, __DRIid draw); /** * Type of a pointer to \c __glXGetUST, as returned by \c glXGetProcAddress. @@ -142,20 +142,20 @@ typedef void (* PFNGLXSCRENABLEEXTENSIONPROC) ( void *psc, const char * name ); * * \sa __glXGetDrawableInfo, glXGetProcAddress */ -typedef Bool (* PFNGLXGETDRAWABLEINFOPROC) ( __DRInativeDisplay *dpy, int scrn, +typedef GLboolean (* PFNGLXGETDRAWABLEINFOPROC) ( __DRInativeDisplay *dpy, int scrn, __DRIid draw, unsigned int * index, unsigned int * stamp, int * x, int * y, int * width, int * height, int * numClipRects, drm_clip_rect_t ** pClipRects, int * backX, int * backY, int * numBackClipRects, drm_clip_rect_t ** pBackClipRects ); -extern Bool XF86DRIDestroyContext( __DRInativeDisplay *dpy, int screen, +extern GLboolean XF86DRIDestroyContext( __DRInativeDisplay *dpy, int screen, __DRIid context_id ); -extern Bool XF86DRICreateDrawable( __DRInativeDisplay *dpy, int screen, +extern GLboolean XF86DRICreateDrawable( __DRInativeDisplay *dpy, int screen, __DRIid drawable, drm_drawable_t *hHWDrawable ); -extern Bool XF86DRIDestroyDrawable( __DRInativeDisplay *dpy, int screen, +extern GLboolean XF86DRIDestroyDrawable( __DRInativeDisplay *dpy, int screen, __DRIid drawable); /*@}*/ @@ -407,7 +407,7 @@ struct __DRIcontextRec { * * \since Internal API version 20040415. */ - Bool (*bindContext3)(__DRInativeDisplay *dpy, int scrn, __DRIid draw, + GLboolean (*bindContext3)(__DRInativeDisplay *dpy, int scrn, __DRIid draw, __DRIid read, __DRIcontext *ctx); /** @@ -415,7 +415,7 @@ struct __DRIcontextRec { * * \since Internal API version 20040415. */ - Bool (*unbindContext3)(__DRInativeDisplay *dpy, int scrn, __DRIid draw, + GLboolean (*unbindContext3)(__DRInativeDisplay *dpy, int scrn, __DRIid draw, __DRIid read, __DRIcontext *ctx); }; @@ -489,7 +489,7 @@ struct __DRIdrawableRec { * * \since Internal API version 20030317. */ - int (*frameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate, Bool enable); + int (*frameTracking)(__DRInativeDisplay *dpy, void *drawablePrivate, GLboolean enable); /** * Retrieve frame usage information. -- cgit v1.2.3 From ba3d643c49ce16f8dcddac56308588839c55bc87 Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Thu, 3 Jun 2004 01:56:07 +0000 Subject: kill __driRegisterExtensions(), none of the functions did anything --- include/GL/internal/dri_interface.h | 3 --- src/glx/mini/dri_util.h | 4 ---- src/mesa/drivers/dri/fb/fb_dri.c | 6 ------ src/mesa/drivers/dri/mach64/mach64_screen.c | 26 ------------------------- src/mesa/drivers/dri/r128/r128_screen.c | 30 ----------------------------- src/mesa/drivers/dri/x11/x11_dri.c | 5 ----- 6 files changed, 74 deletions(-) (limited to 'include') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index c0cd128a9e9..079ff106baf 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -176,9 +176,6 @@ extern void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscre extern void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, int numConfigs, __GLXvisualConfig *config); -/** This is optionally implemented in each driver */ -extern void __driRegisterExtensions( void ); - #endif /* DRI_NEW_INTERFACE_ONLY */ diff --git a/src/glx/mini/dri_util.h b/src/glx/mini/dri_util.h index a3934da4b92..638bfa95243 100644 --- a/src/glx/mini/dri_util.h +++ b/src/glx/mini/dri_util.h @@ -524,8 +524,4 @@ driCalculateSwapUsage( __DRIdrawablePrivate *dPriv, extern int driCompareGLXAPIVersion( GLuint required_version ); -/** This is optionally implemented in each driver */ -extern void -__driRegisterExtensions( void ); - #endif /* _DRI_UTIL_H_ */ diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c index 1d35be2c777..5b3fbd33d4d 100644 --- a/src/mesa/drivers/dri/fb/fb_dri.c +++ b/src/mesa/drivers/dri/fb/fb_dri.c @@ -578,12 +578,6 @@ static struct __DriverAPIRec fbAPI = { }; -void -__driRegisterExtensions( void ) -{ -} - - /* * This is the bootstrap function for the driver. * The __driCreateScreen name is the symbol that libGL.so fetches. diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index 8ec10ea1101..b11a1623dad 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -443,32 +443,6 @@ mach64InitDriver( __DRIscreenPrivate *driScreen ) return GL_TRUE; } -#ifndef _SOLO -/* This function is called by libGL.so as soon as libGL.so is loaded. - * This is where we register new extension functions with the dispatcher. - */ -void __driRegisterExtensions( void ) -{ -#if 0 - /* KW: This is handled differently in the other drivers, not sure - * what to do here. - */ - PFNGLXENABLEEXTENSIONPROC glx_enable_extension; - - if ( driCompareGLXAPIVersion( 20030317 ) >= 0 ) { - glx_enable_extension = (PFNGLXENABLEEXTENSIONPROC) - glXGetProcAddress( (const GLubyte *) "__glXEnableExtension" ); - - if ( glx_enable_extension != NULL ) { - glx_enable_extension( "GLX_SGI_swap_control", GL_FALSE ); - glx_enable_extension( "GLX_SGI_video_sync", GL_FALSE ); - glx_enable_extension( "GLX_MESA_swap_control", GL_FALSE ); - } - } -#endif -} -#endif - static struct __DriverAPIRec mach64API = { .InitDriver = mach64InitDriver, .DestroyScreen = mach64DestroyScreen, diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index 5825e95ef26..48a17ab172b 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -335,36 +335,6 @@ r128InitDriver( __DRIscreenPrivate *sPriv ) return GL_TRUE; } -#ifndef _SOLO -/** - * This function is called by libGL.so as soon as libGL.so is loaded. - * This is where we register new extension functions with the dispatcher. - * - * \todo This interface has been deprecated, so we should probably remove - * this function before the next XFree86 release. - */ -void __driRegisterExtensions( void ) -{ -#if 0 - /* KW: This is done slightly differently to the other drivers and - dri_interface.h doesn't seem to cope. - */ - PFNGLXENABLEEXTENSIONPROC - glx_enable_extension; - - if ( driCompareGLXAPIVersion( 20030317 ) >= 0 ) { - glx_enable_extension = (PFNGLXENABLEEXTENSIONPROC) - glXGetProcAddress( (const GLubyte *) "__glXEnableExtension" ); - - if ( glx_enable_extension != NULL ) { - glx_enable_extension( "GLX_SGI_swap_control", GL_FALSE ); - glx_enable_extension( "GLX_SGI_video_sync", GL_FALSE ); - glx_enable_extension( "GLX_MESA_swap_control", GL_FALSE ); - } - } -#endif -} -#endif static struct __DriverAPIRec r128API = { .InitDriver = r128InitDriver, diff --git a/src/mesa/drivers/dri/x11/x11_dri.c b/src/mesa/drivers/dri/x11/x11_dri.c index 5ea3f1a1c45..cc307b0cc4b 100644 --- a/src/mesa/drivers/dri/x11/x11_dri.c +++ b/src/mesa/drivers/dri/x11/x11_dri.c @@ -450,11 +450,6 @@ static struct __DriverAPIRec x11API = { x11OpenCloseFullScreen }; -void -__driRegisterExtensions(void) -{ -} - /* * This is the bootstrap function for the driver. * The __driCreateScreen name is the symbol that libGL.so fetches. -- cgit v1.2.3 From e1a7f31c2b47e053ad70f5c4c519e294c273724c Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Sun, 6 Jun 2004 02:20:20 +0000 Subject: Remove the rest of the need for glxclient.h and remove it from the tree. --- include/GL/internal/glcore.h | 27 + src/mesa/drivers/dri/common/dri_util.h | 15 +- src/mesa/drivers/dri/common/glcontextmodes.c | 30 +- src/mesa/drivers/dri/common/glcontextmodes.h | 4 +- .../drivers/dri/dri_client/imports/glxclient.h | 817 --------------------- 5 files changed, 58 insertions(+), 835 deletions(-) delete mode 100644 src/mesa/drivers/dri/dri_client/imports/glxclient.h (limited to 'include') diff --git a/include/GL/internal/glcore.h b/include/GL/internal/glcore.h index 7080b7ce74e..48748d91e8f 100644 --- a/include/GL/internal/glcore.h +++ b/include/GL/internal/glcore.h @@ -139,6 +139,33 @@ typedef struct __GLcontextModesRec { GLint screen; } __GLcontextModes; +/* Several fields of __GLcontextModes can take these as values. Since + * GLX header files may not be available everywhere they need to be used, + * redefine them here. + */ +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_SWAP_EXCHANGE_OML 0x8061 +#define GLX_SWAP_COPY_OML 0x8062 +#define GLX_SWAP_UNDEFINED_OML 0x8063 + +#define GLX_DONT_CARE 0xFFFFFFFF + +#define GLX_RGBA_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_PBUFFER_BIT 0x00000004 + /************************************************************************/ /* diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index 5ecc39a69b0..276650274d8 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -54,10 +54,17 @@ #define CAPI /* XXX this should be globally defined somewhere */ #include -#include "glxclient.h" /* for GLXDrawable */ -#include "drm.h" /* for drm_clip_rect_t */ -#include "drm_sarea.h" /* for XF86DRISAREAPtr */ -#include "GL/internal/glcore.h" /* for __GLcontextModes */ +#ifdef DRI_NEW_INTERFACE_ONLY +# include +#else +# include "glxclient.h" +#endif /* DRI_NEW_INTERFACE_ONLY */ +#include "drm.h" +#include "drm_sarea.h" +#include "GL/internal/glcore.h" +#include "GL/internal/dri_interface.h" + +#define GLX_BAD_CONTEXT 5 /* This is a temporary relic. Once all drivers are converted to support * the new interface, it can go away. diff --git a/src/mesa/drivers/dri/common/glcontextmodes.c b/src/mesa/drivers/dri/common/glcontextmodes.c index 448c33d1874..420c597e59c 100644 --- a/src/mesa/drivers/dri/common/glcontextmodes.c +++ b/src/mesa/drivers/dri/common/glcontextmodes.c @@ -31,20 +31,26 @@ * \author Ian Romanick */ -#include -#include -#include "GL/glxint.h" +#ifdef DRI_NEW_INTERFACE_ONLY +# include +# include +# include "dri_interface.h" +#else +# include +# include +# include "GL/glxint.h" -#ifdef XFree86Server -# include "GL/glx_ansic.h" +# ifdef XFree86Server +# include "GL/glx_ansic.h" extern void * __glXMalloc( size_t size ); extern void __glXFree( void * ptr ); -# define Xmalloc __glXMalloc -# define Xfree __glXFree -#else -# include -# define __glXMemset memset -#endif /* XFree86Server */ +# define Xmalloc __glXMalloc +# define Xfree __glXFree +# else +# include +# define __glXMemset memset +# endif /* XFree86Server */ +#endif /* DRI_NEW_INTERFACE_ONLY */ #include "glcontextmodes.h" @@ -169,7 +175,6 @@ _gl_copy_visual_to_context_mode( __GLcontextModes * mode, mode->swapMethod = GLX_SWAP_UNDEFINED_OML; } -#endif /* DRI_NEW_INTERFACE_ONLY */ /** @@ -310,6 +315,7 @@ _gl_get_context_mode_data(const __GLcontextModes *mode, int attribute, return GLX_BAD_ATTRIBUTE; } } +#endif /* DRI_NEW_INTERFACE_ONLY */ /** diff --git a/src/mesa/drivers/dri/common/glcontextmodes.h b/src/mesa/drivers/dri/common/glcontextmodes.h index 8959e1d4ea9..46b4c68dcaf 100644 --- a/src/mesa/drivers/dri/common/glcontextmodes.h +++ b/src/mesa/drivers/dri/common/glcontextmodes.h @@ -37,10 +37,10 @@ extern GLint _gl_convert_from_x_visual_type( int visualType ); extern GLint _gl_convert_to_x_visual_type( int visualType ); extern void _gl_copy_visual_to_context_mode( __GLcontextModes * mode, const __GLXvisualConfig * config ); -#endif /* DRI_NEW_INTERFACE_ONLY */ - extern int _gl_get_context_mode_data( const __GLcontextModes *mode, int attribute, int *value_return ); +#endif /* DRI_NEW_INTERFACE_ONLY */ + extern __GLcontextModes * _gl_context_modes_create( unsigned count, size_t minimum_size ); extern void _gl_context_modes_destroy( __GLcontextModes * modes ); diff --git a/src/mesa/drivers/dri/dri_client/imports/glxclient.h b/src/mesa/drivers/dri/dri_client/imports/glxclient.h deleted file mode 100644 index 74dfe69c956..00000000000 --- a/src/mesa/drivers/dri/dri_client/imports/glxclient.h +++ /dev/null @@ -1,817 +0,0 @@ -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: The application programming interfaces -** established by SGI in conjunction with the Original Code are The -** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released -** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version -** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X -** Window System(R) (Version 1.3), released October 19, 1998. This software -** was created using the OpenGL(R) version 1.2.1 Sample Implementation -** published by SGI, but has not been independently verified as being -** compliant with the OpenGL(R) version 1.2.1 Specification. -*/ -/* $XFree86: xc/lib/GL/glx/glxclient.h,v 1.15 2002/10/30 12:51:26 alanh Exp $ */ - -/** - * \file glxclient.h - * Direct rendering support added by Precision Insight, Inc. - * - * \author Kevin E. Martin - */ - -#ifndef _GLX_client_h_ -#define _GLX_client_h_ -#define NEED_REPLIES -#define NEED_EVENTS -#include -#include -#define GLX_GLXEXT_PROTOTYPES -#include -#include -#include -#include -#include "GL/glxint.h" -#include "GL/glxproto.h" -#include "GL/internal/glcore.h" -#include "glapitable.h" -#ifdef NEED_GL_FUNCS_WRAPPED -#include "indirect.h" -#endif -#ifdef XTHREADS -#include "Xthreads.h" -#endif -#ifdef GLX_BUILT_IN_XMESA -#include "realglx.h" /* just silences prototype warnings */ -#endif - -#define GLX_MAJOR_VERSION 1 /* current version numbers */ -#define GLX_MINOR_VERSION 2 - -#define __GLX_MAX_TEXTURE_UNITS 32 - -typedef struct __GLXcontextRec __GLXcontext; -typedef struct __GLXdisplayPrivateRec __GLXdisplayPrivate; -typedef struct _glapi_table __GLapi; - -/************************************************************************/ - -#ifdef GLX_DIRECT_RENDERING - -#include - -typedef void *(*CreateScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config); - -typedef void *(*CreateNewScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc, - const __GLcontextModes * modes, const __DRIversion * ddx_version, - const __DRIversion * dri_version, const __DRIversion * drm_version, - const __DRIframebuffer * frame_buffer, void * pSAREA, - int fd, int internal_api_version, __GLcontextModes ** driver_modes); - - -/** - * Display dependent methods. This structure is initialized during the - * \c driCreateDisplay call. - */ -struct __DRIdisplayRec { - /** - * Method to destroy the private DRI display data. - */ - void (*destroyDisplay)(Display *dpy, void *displayPrivate); - - /** - * Methods to create the private DRI screen data and initialize the - * screen dependent methods. - * This is an array [indexed by screen number] of function pointers. - * - * \deprecated This array of function pointers has been replaced by - * \c __DRIdisplayRec::createNewScreen. - * \sa __DRIdisplayRec::createNewScreen - */ - CreateScreenFunc * createScreen; - - /** - * Opaque pointer to private per display direct rendering data. - * \c NULL if direct rendering is not supported on this display. - */ - struct __DRIdisplayPrivateRec *private; - - /** - * Array of pointers to methods to create and initialize the private DRI - * screen data. - * - * \sa __DRIdisplayRec::createScreen - */ - CreateNewScreenFunc * createNewScreen; -}; - - -/* -** We keep a linked list of these structures, one per DRI device driver. -*/ -struct __DRIdriverRec { - const char *name; - void *handle; - CreateScreenFunc createScreenFunc; - CreateNewScreenFunc createNewScreenFunc; - struct __DRIdriverRec *next; -}; - -/* -** Function to create and DRI display data and initialize the display -** dependent methods. -*/ -extern void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp); - -extern __DRIdriver *driGetDriver(Display *dpy, int scrNum); - -extern void DRI_glXUseXFont( Font font, int first, int count, int listbase ); - -/* -** Functions to obtain driver configuration information from a direct -** rendering client application -*/ -extern const char *glXGetScreenDriver (Display *dpy, int scrNum); - -extern const char *glXGetDriverConfig (const char *driverName); - -#endif - -/************************************************************************/ - -#define __GL_CLIENT_ATTRIB_STACK_DEPTH 16 - -typedef struct __GLXpixelStoreModeRec { - GLboolean swapEndian; - GLboolean lsbFirst; - GLuint rowLength; - GLuint imageHeight; - GLuint imageDepth; - GLuint skipRows; - GLuint skipPixels; - GLuint skipImages; - GLuint alignment; -} __GLXpixelStoreMode; - -/* The next 3 structures are deprecated. Client state is no longer tracked - * using them. They only remain to maintain the layout / structure offset of - * __GLXcontextRec. In XFree86 5.0 they will be removed altogether. - */ - -typedef struct __GLXvertexArrayPointerStateRecDEPRECATED { - GLboolean enable; - void (*proc)(const void *); - const GLubyte *ptr; - GLsizei skip; - GLint size; - GLenum type; - GLsizei stride; -} __GLXvertexArrayPointerStateDEPRECATED; - -typedef struct __GLXvertArrayStateRecDEPRECATED { - __GLXvertexArrayPointerStateDEPRECATED vertex; - __GLXvertexArrayPointerStateDEPRECATED normal; - __GLXvertexArrayPointerStateDEPRECATED color; - __GLXvertexArrayPointerStateDEPRECATED index; - __GLXvertexArrayPointerStateDEPRECATED texCoord[__GLX_MAX_TEXTURE_UNITS]; - __GLXvertexArrayPointerStateDEPRECATED edgeFlag; - GLint maxElementsVertices; - GLint maxElementsIndices; - GLint activeTexture; -} __GLXvertArrayStateDEPRECATED; - -typedef struct __GLXattributeRecDEPRECATED { - GLuint mask; - - /* - ** Pixel storage state. Most of the pixel store mode state is kept - ** here and used by the client code to manage the packing and - ** unpacking of data sent to/received from the server. - */ - __GLXpixelStoreMode storePack, storeUnpack; - - /* - ** Vertex Array storage state. The vertex array component - ** state is stored here and is used to manage the packing of - ** DrawArrays data sent to the server. - */ - __GLXvertArrayStateDEPRECATED vertArray; -} __GLXattributeDEPRECATED; - -typedef struct __GLXvertexArrayPointerStateRec { - void (*proc)(const void *); - void (*mtex_proc)(GLenum, const void *); - const GLubyte *ptr; - GLsizei skip; - GLint size; - GLenum type; - GLsizei stride; -} __GLXvertexArrayPointerState; - -/** - * Define which entries of \c __GLXvertArrayState::arrays match which - * vertex arrays in the client-state vector. These are only the one-of - * arrays. See the \c __GLXvertArrayState::arrays documentation for more - * details. - * - * \sa __GLXvertArrayState - */ -enum { - edgeFlag_ARRAY, /**< \c GL_EDGE_FLAG_ARRAY */ - index_ARRAY, /**< \c GL_INDEX_ARRAY */ - fogCoord_ARRAY, /**< \c GL_FOG_COORD_ARRAY */ - secondaryColor_ARRAY, /**< \c GL_SECONDARY_COLOR_ARRAY */ - color_ARRAY, /**< \c GL_COLOR_ARRAY */ - normal_ARRAY, /**< \c GL_NORMAL_ARRAY */ - - /** - * \c GL_VERTEX_ARRAY \b must be last! All of the code for emitting arrays - * and array elements is written based on the assumption that the vertex - * array is last. - */ - vertex_ARRAY, - - __GLX_MAX_ARRAYS /**< Place holder entry. */ -}; - -#define ENABLE_ARRAY(state,a) \ - do { (state)->vertArray.enables |= (1U << (a ## _ARRAY)); } while( 0 ) -#define DISABLE_ARRAY(state,a) \ - do { (state)->vertArray.enables &= ~(1U << (a ## _ARRAY)); } while( 0 ) -#define IS_ARRAY_ENABLED_BY_INDEX(state, i) \ - (((state)->vertArray.enables & (1U << (i))) != 0) -#define IS_ARRAY_ENABLED(state, a) \ - IS_ARRAY_ENABLED_BY_INDEX(state, a ## _ARRAY) - -#define ENABLE_TEXARRAY(state,a) \ - do { (state)->vertArray.texture_enables |= (1U << a); } while( 0 ) -#define DISABLE_TEXARRAY(state,a) \ - do { (state)->vertArray.texture_enables &= ~(1U << a); } while( 0 ) -#define IS_TEXARRAY_ENABLED(state, a) \ - (((state)->vertArray.texture_enables & (1U << a)) != 0) - -/** - * Client-side vertex array state. - */ -typedef struct __GLXvertArrayStateRec { - /** - * Which client-side arrays are enabled? These are the flag bits for - * all of the non-texture coordinate arrays. - */ - GLuint enables; - - /** - * Which of the texture coordinate arrays are enabled? - */ - GLuint texture_enables; - - /** - * State for "one-of" arrays. These are the arrays, such as - * GL_COLOR_ARRAY or GL_FOG_COORD_ARRAY for which there is only one - * array. There are also "many-of" arrays, such as - * GL_TEXTURE_COORD_ARRAY. - */ - __GLXvertexArrayPointerState arrays[__GLX_MAX_ARRAYS]; - - __GLXvertexArrayPointerState texCoord[__GLX_MAX_TEXTURE_UNITS]; - - GLint maxElementsVertices; - GLint maxElementsIndices; - GLint activeTexture; -} __GLXvertArrayState; - -typedef struct __GLXattributeRec { - GLuint mask; - - /* - ** Pixel storage state. Most of the pixel store mode state is kept - ** here and used by the client code to manage the packing and - ** unpacking of data sent to/received from the server. - */ - __GLXpixelStoreMode storePack, storeUnpack; - - /* - ** Vertex Array storage state. The vertex array component - ** state is stored here and is used to manage the packing of - ** DrawArrays data sent to the server. - */ - __GLXvertArrayState vertArray; - - /** - * Is EXT_vertex_array / GL 1.1 DrawArrays protocol specifically - * disabled? - */ - GLboolean NoDrawArraysProtocol; -} __GLXattribute; - -typedef struct __GLXattributeMachineRec { - __GLXattribute *stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; - __GLXattribute **stackPointer; -} __GLXattributeMachine; - -/** - * GLX state that needs to be kept on the client. One of these records - * exist for each context that has been made current by this client. - */ -struct __GLXcontextRec { - /** - * \name Drawing command buffer. - * - * Drawing commands are packed into this buffer before being sent as a - * single GLX protocol request. The buffer is sent when it overflows or - * is flushed by \c __glXFlushRenderBuffer. \c pc is the next location - * in the buffer to be filled. \c limit is described above in the buffer - * slop discussion. - * - * Commands that require large amounts of data to be transfered will - * also use this buffer to hold a header that describes the large - * command. - * - * These must be the first 6 fields since they are static initialized - * in the dummy context in glxext.c - */ - /*@{*/ - GLubyte *buf; - GLubyte *pc; - GLubyte *limit; - GLubyte *bufEnd; - GLint bufSize; - /*@}*/ - - /** - * The XID of this rendering context. When the context is created a - * new XID is allocated. This is set to None when the context is - * destroyed but is still current to some thread. In this case the - * context will be freed on next MakeCurrent. - */ - XID xid; - - /** - * The XID of the \c shareList context. - */ - XID share_xid; - - /** - * Visual id. - * - * \deprecated - * This filed has been largely been replaced by the \c mode field, but - * the work is not quite done. - */ - VisualID vid; - - /** - * Screen number. - */ - GLint screen; - - /** - * \c GL_TRUE if the context was created with ImportContext, which - * means the server-side context was created by another X client. - */ - GLboolean imported; - - /** - * The context tag returned by MakeCurrent when this context is made - * current. This tag is used to identify the context that a thread has - * current so that proper server context management can be done. It is - * used for all context specific commands (i.e., \c Render, \c RenderLarge, - * \c WaitX, \c WaitGL, \c UseXFont, and \c MakeCurrent (for the old - * context)). - */ - GLXContextTag currentContextTag; - - /** - * \name Rendering mode - * - * The rendering mode is kept on the client as well as the server. - * When \c glRenderMode is called, the buffer associated with the - * previous rendering mode (feedback or select) is filled. - */ - /*@{*/ - GLenum renderMode; - GLfloat *feedbackBuf; - GLuint *selectBuf; - /*@}*/ - - /** - * This is \c GL_TRUE if the pixel unpack modes are such that an image - * can be unpacked from the clients memory by just copying. It may - * still be true that the server will have to do some work. This - * just promises that a straight copy will fetch the correct bytes. - */ - GLboolean fastImageUnpack; - - /** - * Fill newImage with the unpacked form of \c oldImage getting it - * ready for transport to the server. - */ - void (*fillImage)(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum, - GLenum, const GLvoid*, GLubyte*, GLubyte*); - - /** - * \name Client side attribs. - */ - /*@{*/ - __GLXattributeDEPRECATED stateDEPRECATED; - __GLXattributeMachine attributes; - /*@}*/ - - /** - * Client side error code. This is set when client side gl API - * routines need to set an error because of a bad enumerant or - * running out of memory, etc. - */ - GLenum error; - - /** - * Whether this context does direct rendering. - */ - Bool isDirect; - - /** - * \c dpy of current display for this context. Will be \c NULL if not - * current to any display, or if this is the "dummy context". - */ - Display *currentDpy; - - /** - * The current drawable for this context. Will be None if this - * context is not current to any drawable. currentReadable is below. - */ - GLXDrawable currentDrawable; - - /** - * \name GL Constant Strings - * - * Constant strings that describe the server implementation - * These pertain to GL attributes, not to be confused with - * GLX versioning attributes. - */ - /*@{*/ - GLubyte *vendor; - GLubyte *renderer; - GLubyte *version; - GLubyte *extensions; - /*@}*/ - - /** - * Record the dpy this context was created on for later freeing - */ - Display *createDpy; - - /** - * Maximum small render command size. This is the smaller of 64k and - * the size of the above buffer. - */ - GLint maxSmallRenderCommandSize; - - /** - * Major opcode for the extension. Copied here so a lookup isn't - * needed. - */ - GLint majorOpcode; - -#ifdef GLX_DIRECT_RENDERING - /** - * Per context direct rendering interface functions and data. - */ - __DRIcontext driContext; -#endif - - /** - * \c GLXFBConfigID used to create this context. May be \c None. This - * field has been replaced by the \c mode field. - * - * \since Internal API version 20030317. - * - * \deprecated - * This filed has been largely been replaced by the \c mode field, but - * the work is not quite done. - */ - GLXFBConfigID fbconfigID; - - /** - * The current read-drawable for this context. Will be None if this - * context is not current to any drawable. - * - * \since Internal API version 20030606. - */ - GLXDrawable currentReadable; - - /** - * Pointer to client-state data that is private to libGL. This is only - * used for indirect rendering contexts. - * - * No internal API version change was made for this change. Client-side - * drivers should NEVER use this data or even care that it exists. - */ - void * client_state_private; -}; - -#define __glXSetError(gc,code) \ - if (!(gc)->error) { \ - (gc)->error = code; \ - } - -extern void __glFreeAttributeState(__GLXcontext *); - -/************************************************************************/ - -/** - * The size of the largest drawing command known to the implementation - * that will use the GLXRender GLX command. In this case it is - * \c glPolygonStipple. - */ -#define __GLX_MAX_SMALL_RENDER_CMD_SIZE 156 - -/** - * To keep the implementation fast, the code uses a "limit" pointer - * to determine when the drawing command buffer is too full to hold - * another fixed size command. This constant defines the amount of - * space that must always be available in the drawing command buffer - * at all times for the implementation to work. It is important that - * the number be just large enough, but not so large as to reduce the - * efficacy of the buffer. The "+32" is just to keep the code working - * in case somebody counts wrong. - */ -#define __GLX_BUFFER_LIMIT_SIZE (__GLX_MAX_SMALL_RENDER_CMD_SIZE + 32) - -/** - * This implementation uses a smaller threshold for switching - * to the RenderLarge protocol than the protcol requires so that - * large copies don't occur. - */ -#define __GLX_RENDER_CMD_SIZE_LIMIT 4096 - -/** - * One of these records exists per screen of the display. It contains - * a pointer to the config data for that screen (if the screen supports GL). - */ -typedef struct __GLXscreenConfigsRec { - /** - * GLX visuals formated as \c __GLXvisualConfig structures. - */ - /*@{*/ - __GLXvisualConfig * old_configs; - int numOldConfigs; - /*@}*/ - - /** - * GLX extension string reported by the X-server. - */ - const char *serverGLXexts; - - /** - * GLX extension string to be reported to applications. This is the - * set of extensions that the application can actually use. - */ - char *effectiveGLXexts; - -#ifdef GLX_DIRECT_RENDERING - /** - * Per screen direct rendering interface functions and data. - */ - __DRIscreen driScreen; -#endif - - /** - * Linked list of configurations for this screen. This is intended to - * be a superset of \c old_configs. - */ - __GLcontextModes *configs; - /** - * Per-screen dynamic GLX extension tracking. The \c direct_support - * field only contains enough bits for 64 extensions. Should libGL - * ever need to track more than 64 GLX extensions, we can safely grow - * this field. The \c __GLXscreenConfigs structure is not used outside - * libGL. - */ - /*@{*/ - unsigned char direct_support[8]; - GLboolean ext_list_first_time; - /*@}*/ - -} __GLXscreenConfigs; - -/** - * Per display private data. One of these records exists for each display - * that is using the OpenGL (GLX) extension. - */ -struct __GLXdisplayPrivateRec { - /** - * Back pointer to the display - */ - Display *dpy; - - /** - * The \c majorOpcode is common to all connections to the same server. - * It is also copied into the context structure. - */ - int majorOpcode; - - /** - * \name Server Version - * - * Major and minor version returned by the server during initialization. - */ - /*@{*/ - int majorVersion, minorVersion; - /*@}*/ - - /** - * \name Storage for the servers GLX vendor and versions strings. - * - * These are the same for all screens on this display. These fields will - * be filled in on demand. - */ - /*@{*/ - char *serverGLXvendor; - char *serverGLXversion; - /*@}*/ - - /** - * Configurations of visuals for all screens on this display. - * Also, per screen data which now includes the server \c GLX_EXTENSION - * string. - */ - __GLXscreenConfigs *screenConfigs; - -#ifdef GLX_DIRECT_RENDERING - /** - * Per display direct rendering interface functions and data. - */ - __DRIdisplay driDisplay; -#endif -}; - -void __glXFreeContext(__GLXcontext*); - -extern GLubyte *__glXFlushRenderBuffer(__GLXcontext*, GLubyte*); - -extern void __glXSendLargeChunk(__GLXcontext *gc, GLint requestNumber, - GLint totalRequests, - const GLvoid * data, GLint dataLen); - -extern void __glXSendLargeCommand(__GLXcontext *, const GLvoid *, GLint, - const GLvoid *, GLint); - -/* Initialize the GLX extension for dpy */ -extern __GLXdisplayPrivate *__glXInitialize(Display*); - -/************************************************************************/ - -extern int __glXDebug; - -/* This is per-thread storage in an MT environment */ -#if defined(GLX_DIRECT_RENDERING) && defined(XTHREADS) -extern __GLXcontext *__glXGetCurrentContext(void); -extern void __glXSetCurrentContext(__GLXcontext *c); -#else -extern __GLXcontext *__glXcurrentContext; -#define __glXGetCurrentContext() __glXcurrentContext -#define __glXSetCurrentContext(gc) __glXcurrentContext = gc -#endif - - -/* -** Global lock for all threads in this address space using the GLX -** extension -*/ -#if defined(GLX_DIRECT_RENDERING) && defined(XTHREADS) -extern xmutex_rec __glXmutex; -#define __glXLock() xmutex_lock(&__glXmutex) -#define __glXUnlock() xmutex_unlock(&__glXmutex) -#else -#define __glXLock() -#define __glXUnlock() -#endif - -/* -** Setup for a command. Initialize the extension for dpy if necessary. -*/ -extern CARD8 __glXSetupForCommand(Display *dpy); - -/************************************************************************/ - -/* -** Data conversion and packing support. -*/ - -/* Return the size, in bytes, of some pixel data */ -extern GLint __glImageSize(GLint, GLint, GLint, GLenum, GLenum); - -/* Return the number of elements per group of a specified format*/ -extern GLint __glElementsPerGroup(GLenum format, GLenum type); - -/* Return the number of bytes per element, based on the element type (other -** than GL_BITMAP). -*/ -extern GLint __glBytesPerElement(GLenum type); - -/* Return the k value for a given map target */ -extern GLint __glEvalComputeK(GLenum); - -/* -** Fill the transport buffer with the data from the users buffer, -** applying some of the pixel store modes (unpack modes) to the data -** first. As a side effect of this call, the "modes" field is -** updated to contain the modes needed by the server to decode the -** sent data. -*/ -extern void __glFillImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum, - GLenum, const GLvoid*, GLubyte*, GLubyte*); - -/* Copy map data with a stride into a packed buffer */ -extern void __glFillMap1f(GLint, GLint, GLint, const GLfloat *, GLubyte *); -extern void __glFillMap1d(GLint, GLint, GLint, const GLdouble *, GLubyte *); -extern void __glFillMap2f(GLint, GLint, GLint, GLint, GLint, - const GLfloat *, GLfloat *); -extern void __glFillMap2d(GLint, GLint, GLint, GLint, GLint, - const GLdouble *, GLdouble *); - -/* -** Empty an image out of the reply buffer into the clients memory applying -** the pack modes to pack back into the clients requested format. -*/ -extern void __glEmptyImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum, - GLenum, const GLubyte *, GLvoid *); - - -/* -** Allocate and Initialize Vertex Array client state -*/ -extern void __glXInitVertexArrayState(__GLXcontext*); - -/* -** Inform the Server of the major and minor numbers and of the client -** libraries extension string. -*/ -extern void __glXClientInfo ( Display *dpy, int opcode ); - -/************************************************************************/ - -/* -** Declarations that should be in Xlib -*/ -#ifdef __GL_USE_OUR_PROTOTYPES -extern void _XFlush(Display*); -extern Status _XReply(Display*, xReply*, int, Bool); -extern void _XRead(Display*, void*, long); -extern void _XSend(Display*, const void*, long); -#endif - - -/* -** GLX_BUILT_IN_XMESA controls whether libGL has a built-in verions of -** Mesa that can render to non-GLX displays. -*/ -#ifdef GLX_BUILT_IN_XMESA -#define GLX_PREFIX(function) _real_##function -#else -#define GLX_PREFIX(function) function -#endif - - -extern void __glXInitializeVisualConfigFromTags( __GLcontextModes *config, - int count, const INT32 *bp, Bool tagged_only, Bool fbconfig_style_tags ); - -extern char *__glXInternalQueryServerString( Display *dpy, int opcode, - int screen, int name ); - -extern char *__glXstrdup(const char *str); - - -extern const char __glXGLClientVersion[]; -extern const char __glXGLClientExtensions[]; -extern char *__glXCombineExtensionStrings( const char *cext_string, - const char *sext_string ); - -/* Determine the internal API version */ -extern int __glXGetInternalVersion(void); - -/* Get the unadjusted system time */ -extern int __glXGetUST( int64_t * ust ); - -#endif /* !__GLX_client_h__ */ -- cgit v1.2.3 From 6b869d4fe19dc0ed35bdd17c843f25553e9e887c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 22 Jun 2004 17:16:02 +0000 Subject: Alexander Gottwald's patch for cygwin --- include/GL/gl.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 60669aaf620..ca0ab31328f 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -61,6 +61,9 @@ # define GLAPI extern # endif /* _STATIC_MESA support */ # define GLAPIENTRY __stdcall +#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */ +# define GLAPI extern +# define GLAPIENTRY __stdcall #else /* non-Windows compilation */ # define GLAPI extern -- cgit v1.2.3 From e4fbcd0fca4bf7b1534fdde097562fda2157e3b2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Jun 2004 14:48:04 +0000 Subject: updated to version 23 --- include/GL/glext.h | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 4260acdacdb..c3676a723d2 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -52,9 +52,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2004/2/23 */ +/* glext.h last updated 2004/6/22 */ /* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 22 +#define GL_GLEXT_VERSION 23 #ifndef GL_VERSION_1_2 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 @@ -251,7 +251,6 @@ extern "C" { #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 #define GL_CLAMP_TO_BORDER 0x812D -#define GL_CLAMP_TO_BORDER_SGIS 0x812D #define GL_COMBINE 0x8570 #define GL_COMBINE_RGB 0x8571 #define GL_COMBINE_ALPHA 0x8572 @@ -749,6 +748,14 @@ extern "C" { #define GL_FLOAT_MAT2_ARB 0x8B5A #define GL_FLOAT_MAT3_ARB 0x8B5B #define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 #define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 #define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 #define GL_OBJECT_LINK_STATUS_ARB 0x8B82 @@ -773,9 +780,11 @@ extern "C" { #ifndef GL_ARB_fragment_shader #define GL_FRAGMENT_SHADER_ARB 0x8B30 #define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B #endif #ifndef GL_ARB_shading_language_100 +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C #endif #ifndef GL_ARB_texture_non_power_of_two @@ -1119,6 +1128,10 @@ extern "C" { #define GL_CLAMP_TO_EDGE_SGIS 0x812F #endif +#ifndef GL_SGIS_texture_border_clamp +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#endif + #ifndef GL_EXT_blend_minmax #define GL_FUNC_ADD_EXT 0x8006 #define GL_MIN_EXT 0x8007 @@ -2774,6 +2787,33 @@ extern "C" { #define GL_YCBCR_MESA 0x8757 #endif +#ifndef GL_EXT_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF +#endif + +#ifndef GL_NV_fragment_program_option +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 +#endif + +#ifndef GL_NV_vertex_program2_option +/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ +/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */ +#endif + +#ifndef GL_NV_vertex_program3 +/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ +#endif + /*************************************************************/ @@ -5911,6 +5951,26 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLen #define GL_MESA_ycbcr_texture 1 #endif +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 +#endif + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 +#endif + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 +#endif + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 +#endif + #ifdef __cplusplus } -- cgit v1.2.3 From c2bffec91a5b6ba72514c875b70dbc96ac97431d Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Sat, 26 Jun 2004 17:16:42 +0000 Subject: Mesa-solo builds with these changes. There are still more fixups needed to get individual drivers working again. This converts miniglx to the new dri interface. Thanks to Erdi Chen for the new interface code. --- configs/linux-solo | 9 +- include/GL/internal/dri_interface.h | 13 +- include/GL/miniglx.h | 4 +- src/glx/mini/Makefile | 19 +- src/glx/mini/dri.h | 124 -- src/glx/mini/dri_util.c | 704 --------- src/glx/mini/dri_util.h | 527 ------- src/glx/mini/drmtest.c | 140 -- src/glx/mini/miniglx.c | 435 +++++- src/glx/mini/miniglxP.h | 19 +- src/glx/mini/miniglx_events.c | 4 +- src/glx/mini/xf86drm.c | 1587 -------------------- src/glx/mini/xf86drm.h | 609 -------- src/mesa/drivers/dri/Makefile.template | 1 + src/mesa/drivers/dri/common/dri_util.h | 3 + src/mesa/drivers/dri/fb/Makefile | 79 +- src/mesa/drivers/dri/unichrome/server/via_dri.c | 88 +- src/mesa/drivers/dri/unichrome/server/via_driver.h | 76 +- src/mesa/drivers/dri/unichrome/server/via_priv.h | 4 +- 19 files changed, 536 insertions(+), 3909 deletions(-) delete mode 100644 src/glx/mini/dri.h delete mode 100644 src/glx/mini/dri_util.c delete mode 100644 src/glx/mini/dri_util.h delete mode 100644 src/glx/mini/drmtest.c delete mode 100644 src/glx/mini/xf86drm.c delete mode 100644 src/glx/mini/xf86drm.h (limited to 'include') diff --git a/configs/linux-solo b/configs/linux-solo index e6d4fdf9fd1..3b125d9e2a4 100644 --- a/configs/linux-solo +++ b/configs/linux-solo @@ -8,9 +8,11 @@ CONFIG_NAME = linux-solo CC = gcc CXX = g++ -CFLAGS = -Wmissing-prototypes -g -std=c99 -pedantic -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE +CCOMMON = -D_SOLO -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -CXXFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE +CFLAGS = $(CCOMMON) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math + +CXXFLAGS = $(CCOMMON) -Wall -O3 -ansi -pedantic -fPIC ASM_SOURCES = $(X86_SOURCES) @@ -26,4 +28,5 @@ SRC_DIRS = mesa glx glu glut/mini DRIVER_DIRS = dri PROGRAM_DIRS = miniglx -DRI_DIRS = fb gamma i810 i830 mach64 mga r128 r200 radeon sis tdfx +#DRI_DIRS = fb ffb gamma i810 i830 mach64 mga r128 r200 radeon sis savage tdfx unichrome +DRI_DIRS = i810 i830 mach64 mga r128 r200 radeon tdfx unichrome diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 079ff106baf..ced714d43e0 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -165,11 +165,14 @@ extern GLboolean XF86DRIDestroyDrawable( __DRInativeDisplay *dpy, int screen, */ /*@{*/ -extern void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, - const __GLcontextModes * modes, const __DRIversion * ddx_version, - const __DRIversion * dri_version, const __DRIversion * drm_version, - const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, - int internal_api_version, __GLcontextModes ** driver_modes ); +typedef void *(CREATENEWSCREENFUNC)(__DRInativeDisplay *dpy, int scrn, + __DRIscreen *psc, const __GLcontextModes * modes, + const __DRIversion * ddx_version, const __DRIversion * dri_version, + const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer, + void * pSAREA, int fd, int internal_api_version, + __GLcontextModes ** driver_modes); +typedef CREATENEWSCREENFUNC* PFNCREATENEWSCREENFUNC; +extern CREATENEWSCREENFUNC __driCreateNewScreen; #ifndef DRI_NEW_INTERFACE_ONLY diff --git a/include/GL/miniglx.h b/include/GL/miniglx.h index 41e20936285..1a6304f6ba1 100644 --- a/include/GL/miniglx.h +++ b/include/GL/miniglx.h @@ -420,8 +420,8 @@ glXGetCurrentContext( void ); extern GLXDrawable glXGetCurrentDrawable( void ); -extern const void * -glXGetProcAddress( const GLubyte *procname ); +extern void +(*glXGetProcAddress(const GLubyte *procname))( void ); extern Bool glXQueryVersion( Display *dpy, int *major, int *minor ); diff --git a/src/glx/mini/Makefile b/src/glx/mini/Makefile index 45bf6dd1584..009deb34eaf 100644 --- a/src/glx/mini/Makefile +++ b/src/glx/mini/Makefile @@ -5,13 +5,18 @@ TOP = ../../.. include $(TOP)/configs/current -C_SOURCES = dispatch.c \ - dri_util.c \ - ../../mesa/glapi/glapi.c \ - ../../mesa/glapi/glthread.c \ +DEFINES += -DGLX_DIRECT_RENDERING + +C_SOURCES = \ + $(TOP)/src/mesa/main/dispatch.c \ + $(TOP)/src/mesa/glapi/glapi.c \ + $(TOP)/src/mesa/glapi/glthread.c \ + $(TOP)/src/mesa/drivers/dri/common/glcontextmodes.c \ + $(TOP)/src/mesa/drivers/dri/dri_client/xf86drm.c \ + $(TOP)/src/mesa/drivers/dri/dri_client/xf86drmHash.c \ + $(TOP)/src/mesa/drivers/dri/dri_client/xf86drmRandom.c \ miniglx.c \ - miniglx_events.c \ - xf86drm.c + miniglx_events.c OBJECTS = $(C_SOURCES:.c=.o) @@ -26,6 +31,8 @@ INCLUDE_DIRS = \ -I$(TOP)/src/mesa/transform \ -I$(TOP)/src/mesa/swrast \ -I$(TOP)/src/mesa/swrast_setup \ + -I$(TOP)/src/mesa/drivers/dri/common \ + -I$(TOP)/src/mesa/drivers/dri/dri_client/imports \ -I$(DRM_SOURCE_PATH)/shared diff --git a/src/glx/mini/dri.h b/src/glx/mini/dri.h deleted file mode 100644 index 71f9a1acbf9..00000000000 --- a/src/glx/mini/dri.h +++ /dev/null @@ -1,124 +0,0 @@ -/** - * \file miniglxP.h - * \brief Define replacements for some X data types and define the DRI-related - * data structures. - * - * \note Cut down version of glxclient.h. - * - */ - -#ifndef _dri_h_ -#define _dri_h_ - -#include "driver.h" - -typedef struct __DRIscreenRec __DRIscreen; /**< \copydoc __DRIscreenRec */ -typedef struct __DRIcontextRec __DRIcontext; /**< \copydoc __DRIcontextRec */ -typedef struct __DRIdrawableRec __DRIdrawable; /**< \copydoc __DRIdrawableRec */ - -/** - * \brief Screen dependent methods. - * - * This structure is initialized during the MiniGLXDisplayRec::createScreen - * call. - */ -struct __DRIscreenRec { - /** - * \brief Method to destroy the private DRI screen data. - */ - void (*destroyScreen)(__DRIscreen *screen); - - /** - * \brief Method to create the private DRI context data and initialize the - * context dependent methods. - */ - void *(*createContext)(__DRIscreen *screen, const __GLcontextModes *glVisual, - void *sharedPrivate); - /** - * \brief Method to create the private DRI drawable data and initialize the - * drawable dependent methods. - */ - void *(*createDrawable)(__DRIscreen *screen, - int width, int height, int index, - const __GLcontextModes *glVisual); - - /* - * XXX in the future, implement this: - void *(*createPBuffer)(Display *dpy, int scrn, GLXPbuffer pbuffer, - GLXFBConfig config, __DRIdrawable *pdraw); - */ - - /** - * \brief Opaque pointer to private per screen direct rendering data. - * - * \c NULL if direct rendering is not supported on this screen. Never - * dereferenced in libGL. - */ -}; - -/** - * \brief Context dependent methods. - * - * This structure is initialized during the __DRIscreenRec::createContext call. - */ -struct __DRIcontextRec { - /** - * \brief Method to destroy the private DRI context data. - */ - void (*destroyContext)(__DRIcontext *context); - - /** - * \brief Method to bind a DRI drawable to a DRI graphics context. - * - * \todo XXX in the future, also pass a 'read' GLXDrawable for - * glXMakeCurrentReadSGI() and GLX 1.3's glXMakeContextCurrent(). - */ - GLboolean (*bindContext)(__DRIscreen *screen, __DRIdrawable *drawable, __DRIcontext *context); - - /** - * \brief Method to unbind a DRI drawable to a DRI graphics context. - */ - GLboolean (*unbindContext)(__DRIdrawable *drawable, __DRIcontext *context); - /** - * \brief Opaque pointer to private per context direct rendering data. - * - * NULL if direct rendering is not supported on the display or - * screen used to create this context. Never dereferenced in libGL. - */ -}; - -/** - * \brief Drawable dependent methods. - * - * This structure is initialized during the __DRIscreenRec::createDrawable call. - * - * __DRIscreenRec::createDrawable is not called by libGL at this time. It's - * currently used via the dri_util.c utility code instead. - */ -struct __DRIdrawableRec { - /** - * \brief Method to destroy the private DRI drawable data. - */ - void (*destroyDrawable)(__DRIdrawable *drawable); - - - /** - * \brief Method to swap the front and back buffers. - */ - void (*swapBuffers)(__DRIdrawable *drawable); - - /** - * \brief Opaque pointer to private per drawable direct rendering data. - * - * \c NULL if direct rendering is not supported on the display or - * screen used to create this drawable. Never dereferenced in libGL. - */ -}; - -typedef void *(driCreateScreenFunc)(struct DRIDriverRec *driver, - struct DRIDriverContextRec *driverContext); - -/** This must be implemented in each driver */ -extern driCreateScreenFunc __driCreateScreen; - -#endif /* _dri_h_ */ diff --git a/src/glx/mini/dri_util.c b/src/glx/mini/dri_util.c deleted file mode 100644 index 2c3016f1e27..00000000000 --- a/src/glx/mini/dri_util.c +++ /dev/null @@ -1,704 +0,0 @@ -/** - * \file dri_util.c - * \brief DRI utility functions. - * - * This module acts as glue between GLX and the actual hardware driver. A DRI - * driver doesn't really \e have to use any of this - it's optional. But, some - * useful stuff is done here that otherwise would have to be duplicated in most - * drivers. - * - * Basically, these utility functions take care of some of the dirty details of - * screen initialization, context creation, context binding, DRM setup, etc. - * - * These functions are compiled into each DRI driver so libGL.so knows nothing - * about them. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "dri_util.h" - -/** - * \brief Print message to \c stderr if the \c LIBGL_DEBUG environment variable - * is set. - * - * Is called from the drivers. - * - * \param f \e printf like format. - * - * \internal - * This function is a wrapper around vfprintf(). - */ -void -__driUtilMessage(const char *f, ...) -{ - va_list args; - - if (getenv("LIBGL_DEBUG")) { - fprintf(stderr, "libGL error: \n"); - va_start(args, f); - vfprintf(stderr, f, args); - va_end(args); - fprintf(stderr, "\n"); - } -} - - -/*****************************************************************/ -/** \name Visual utility functions */ -/*****************************************************************/ -/*@{*/ - - -/*@}*/ - - -/*****************************************************************/ -/** \name Context (un)binding functions */ -/*****************************************************************/ -/*@{*/ - - -/** - * \brief Unbind context. - * - * \param drawable __DRIdrawable - * \param context __DRIcontext - * \param will_rebind not used. - * - * \return GL_TRUE on success, or GL_FALSE on failure. - * - * \internal - * This function calls __DriverAPIRec::UnbindContext, and then decrements - * __DRIdrawablePrivateRec::refcount which must be non-zero for a successful - * return. - * - * While casting the opaque private pointers associated with the parameters into their - * respective real types it also assures they are not null. - */ -static GLboolean driUnbindContext(__DRIdrawable *drawable, - __DRIcontext *context) -{ - __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)drawable; - __DRIcontextPrivate *pcp = (__DRIcontextPrivate *)context; - __DRIscreenPrivate *psp; - - if (pdp == NULL || pcp == NULL) - return GL_FALSE; - - if (!(psp = (__DRIscreenPrivate *)pdp->driScreenPriv)) - return GL_FALSE; - - /* Let driver unbind drawable from context */ - (*psp->DriverAPI.UnbindContext)(pcp); - - if (pdp->refcount == 0) - return GL_FALSE; - - --pdp->refcount; - - return GL_TRUE; -} - - -/** - * \brief Unbind context. - * - * \param pDRIScreen __DRIscreen - * \param drawable __DRIdrawable - * \param context __DRIcontext - * - * \internal - * This function and increments __DRIdrawablePrivateRec::refcount and calls - * __DriverAPIRec::MakeCurrent to binds the drawable. - * - * While casting the opaque private pointers into their - * respective real types it also assures they are not null. - */ -static GLboolean driBindContext(__DRIscreen *screen, __DRIdrawable *drawable, - __DRIcontext *context) -{ - __DRIscreenPrivate *psp = (__DRIscreenPrivate *)screen; - __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)drawable; - __DRIcontextPrivate *pcp = (__DRIcontextPrivate *)context; - - if (psp == NULL) - return GL_FALSE; - - if (pdp == NULL || pcp == NULL) { - (*psp->DriverAPI.MakeCurrent)(0, 0, 0); - return GL_TRUE; - } - - /* Bind the drawable to the context */ - pcp->driDrawablePriv = pdp; - pdp->driContextPriv = pcp; - pdp->refcount++; - - /* Call device-specific MakeCurrent */ - (*psp->DriverAPI.MakeCurrent)(pcp, pdp, pdp); - - return GL_TRUE; -} - -/*@}*/ - - -/*****************************************************************/ -/** \name Drawable handling functions */ -/*****************************************************************/ -/*@{*/ - - -/** - * \brief Update private drawable information. - * - * \param pdp pointer to the private drawable information to update. - * - * \internal - * This function is a no-op. Should never be called but is referenced as an - * external symbol from client drivers. - */ -void __driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp) -{ - __DRIscreenPrivate *psp = pdp->driScreenPriv; - - pdp->numClipRects = psp->pSAREA->drawableTable[pdp->index].flags ? 1 : 0; - pdp->lastStamp = *(pdp->pStamp); -} - - -/** - * \brief Swap buffers. - * - * \param pDRIscreen __DRIscreen - * \param drawablePrivate opaque pointer to the per-drawable private info. - * - * \internal - * This function calls __DRIdrawablePrivate::swapBuffers. - * - * Is called directly from glXSwapBuffers(). - */ -static void driSwapBuffers(__DRIdrawable *drawable) -{ - __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)drawable; - if (pdp) - pdp->swapBuffers(pdp); -} - - -/** - * \brief Destroy per-drawable private information. - * - * \param pDRIscreen __DRIscreen - * \param drawablePrivate opaque pointer to the per-drawable private info. - * - * \internal - * This function calls __DriverAPIRec::DestroyBuffer on \p drawablePrivate, - * frees the clip rects if any, and finally frees \p drawablePrivate itself. - */ -static void driDestroyDrawable(__DRIdrawable *drawable) -{ - __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)drawable; - __DRIscreenPrivate *psp; - - if (pdp) { - psp = pdp->driScreenPriv; - (*psp->DriverAPI.DestroyBuffer)(pdp); - if (pdp->pClipRects) - free(pdp->pClipRects); - free(pdp); - } -} - - -/** - * \brief Create the per-drawable private driver information. - * - * \param dpy the display handle. - * \param scrn the screen number. - * \param draw the GLX drawable info. - * \param vid visual ID. - * \param pdraw will receive the drawable dependent methods. - * - * - * \returns a opaque pointer to the per-drawable private info on success, or NULL - * on failure. - * - * \internal - * This function allocates and fills a __DRIdrawablePrivateRec structure, - * initializing the invariant window dimensions and clip rects. It obtains the - * visual config, converts it into a __GLcontextModesRec and passes it to - * __DriverAPIRec::CreateBuffer to create a buffer. - */ -static void *driCreateDrawable(__DRIscreen *screen, - int width, int height, int index, - const __GLcontextModes *glVisual) -{ - __DRIscreenPrivate *psp = (__DRIscreenPrivate *)screen; - __DRIdrawablePrivate *pdp; - - if (!psp) - return NULL; - - if (!(pdp = (__DRIdrawablePrivate *)malloc(sizeof(__DRIdrawablePrivate)))) - return NULL; - - pdp->index = index; - pdp->refcount = 0; - pdp->lastStamp = -1; - pdp->numBackClipRects = 0; - pdp->pBackClipRects = NULL; - - /* Initialize with the invariant window dimensions and clip rects here. - */ - pdp->x = 0; - pdp->y = 0; - pdp->w = width; - pdp->h = height; - pdp->numClipRects = 0; - pdp->pClipRects = (drm_clip_rect_t *) malloc(sizeof(drm_clip_rect_t)); - (pdp->pClipRects)[0].x1 = 0; - (pdp->pClipRects)[0].y1 = 0; - (pdp->pClipRects)[0].x2 = width; - (pdp->pClipRects)[0].y2 = height; - - pdp->driScreenPriv = psp; - pdp->driContextPriv = 0; - - pdp->frontBuffer = psp->pFB; - pdp->currentBuffer = pdp->frontBuffer; - pdp->currentPitch = psp->fbStride; - pdp->backBuffer = psp->pFB + psp->fbStride * psp->fbHeight; - - if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, glVisual, GL_FALSE)) { - free(pdp); - return NULL; - } - - pdp->entry.destroyDrawable = driDestroyDrawable; - pdp->entry.swapBuffers = driSwapBuffers; /* called by glXSwapBuffers() */ - pdp->swapBuffers = psp->DriverAPI.SwapBuffers; - - pdp->pStamp = &(psp->pSAREA->drawableTable[pdp->index].stamp); - return (void *) pdp; -} - -/*@}*/ - - -/*****************************************************************/ -/** \name Context handling functions */ -/*****************************************************************/ -/*@{*/ - - -/** - * \brief Destroy the per-context private information. - * - * \param contextPrivate opaque pointer to the per-drawable private info. - * - * \internal - * This function calls __DriverAPIRec::DestroyContext on \p contextPrivate, calls - * drmDestroyContext(), and finally frees \p contextPrivate. - */ -static void driDestroyContext(__DRIcontext *context) -{ - __DRIcontextPrivate *pcp = (__DRIcontextPrivate *)context; - __DRIscreenPrivate *psp = NULL; - - if (pcp) { - (*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp); - psp = pcp->driDrawablePriv->driScreenPriv; - if (psp->fd) { - printf(">>> drmDestroyContext(0x%x)\n", (int) pcp->hHWContext); - drmDestroyContext(psp->fd, pcp->hHWContext); - } - free(pcp); - } -} - -/** - * \brief Create the per-drawable private driver information. - * - * \param dpy the display handle. - * \param vis the visual information. - * \param sharedPrivate the shared context dependent methods or NULL if non-existent. - * \param pctx will receive the context dependent methods. - * - * \returns a opaque pointer to the per-context private information on success, or NULL - * on failure. - * - * \internal - * This function allocates and fills a __DRIcontextPrivateRec structure. It - * gets the visual, converts it into a __GLcontextModesRec and passes it - * to __DriverAPIRec::CreateContext to create the context. - */ -static void *driCreateContext(__DRIscreen *screen, - const __GLcontextModes *glVisual, - void *sharedPrivate) -{ - __DRIscreenPrivate *psp = (__DRIscreenPrivate *)screen; - __DRIcontextPrivate *pcp; - __DRIcontextPrivate *pshare = (__DRIcontextPrivate *) sharedPrivate; - void *shareCtx; - - if (!psp) - return NULL; - - if (!(pcp = (__DRIcontextPrivate *)malloc(sizeof(__DRIcontextPrivate)))) - return NULL; - - pcp->driScreenPriv = psp; - pcp->driDrawablePriv = NULL; - - if (psp->fd) { - if (drmCreateContext(psp->fd, &pcp->hHWContext)) { - fprintf(stderr, ">>> drmCreateContext failed\n"); - free(pcp); - return NULL; - } - } - - shareCtx = pshare ? pshare->driverPrivate : NULL; - - if (!(*psp->DriverAPI.CreateContext)(glVisual, pcp, shareCtx)) { - if (psp->fd) - (void) drmDestroyContext(psp->fd, pcp->hHWContext); - free(pcp); - return NULL; - } - - pcp->entry.destroyContext = driDestroyContext; - pcp->entry.bindContext = driBindContext; - pcp->entry.unbindContext = driUnbindContext; - - return pcp; -} - -/*@}*/ - - -/*****************************************************************/ -/** \name Screen handling functions */ -/*****************************************************************/ -/*@{*/ - - -/** - * \brief Destroy the per-screen private information. - * - * \param pDRIscreen __DRIscreen - * - * \internal - * This function calls __DriverAPIRec::DestroyScreen on \p screenPrivate, calls - * drmClose(), and finally frees \p screenPrivate. - */ -static void driDestroyScreen(__DRIscreen *screen) -{ - __DRIscreenPrivate *psp = (__DRIscreenPrivate *)screen; - if (psp) { - if (psp->DriverAPI.DestroyScreen) - (*psp->DriverAPI.DestroyScreen)(psp); - - if (psp->fd) - (void)drmClose(psp->fd); - - free(psp->pDevPriv); - free(psp); - } -} - - -/** - * \brief Create the per-screen private information. - * - * \param dpy the display handle. - * \param scrn the screen number. - * \param psc will receive the screen dependent methods. - * \param numConfigs number of visuals. - * \param config visuals. - * \param driverAPI driver callbacks structure. - * - * \return a pointer to the per-screen private information. - * - * \internal - * This function allocates and fills a __DRIscreenPrivateRec structure. It - * opens the DRM device verifying that the exported version matches the - * expected. It copies the driver callback functions and calls - * __DriverAPIRec::InitDriver. - * - * If a client maps the framebuffer and SAREA regions. - */ -__DRIscreenPrivate * -__driUtilCreateScreen(struct DRIDriverRec *driver, - struct DRIDriverContextRec *driverContext, - const struct __DriverAPIRec *driverAPI) -{ - __DRIscreenPrivate *psp; - - if(!(psp = (__DRIscreenPrivate *)malloc(sizeof(__DRIscreenPrivate)))) - return NULL; - - psp->fd = drmOpen(NULL, driverContext->pciBusID); - if (psp->fd < 0) { - fprintf(stderr, "libGL error: failed to open DRM: %s\n", - strerror(-psp->fd)); - free(psp); - return NULL; - } - - { - drmVersionPtr version = drmGetVersion(psp->fd); - if (version) { - psp->drmMajor = version->version_major; - psp->drmMinor = version->version_minor; - psp->drmPatch = version->version_patchlevel; - drmFreeVersion(version); - } - else { - fprintf(stderr, "libGL error: failed to get drm version: %s\n", - strerror(-psp->fd)); - free(psp); - return NULL; - } - } - - /* install driver's callback functions */ - psp->DriverAPI = *driverAPI; - - /* - * Get device-specific info. pDevPriv will point to a struct - * (such as DRIRADEONRec in xfree86/driver/ati/radeon_dri.h) - * that has information about the screen size, depth, pitch, - * ancilliary buffers, DRM mmap handles, etc. - */ - psp->fbOrigin = driverContext->shared.fbOrigin; - psp->fbSize = driverContext->shared.fbSize; - psp->fbStride = driverContext->shared.fbStride; - psp->devPrivSize = driverContext->driverClientMsgSize; - psp->pDevPriv = driverContext->driverClientMsg; - psp->fbWidth = driverContext->shared.virtualWidth; - psp->fbHeight = driverContext->shared.virtualHeight; - psp->fbBPP = driverContext->bpp; - - if ((driverContext->FBAddress != NULL) && (driverContext->pSAREA != NULL)) { - /* Already mapped in server */ - psp->pFB = driverContext->FBAddress; - psp->pSAREA = driverContext->pSAREA; - } else { - /* - * Map the framebuffer region. - */ - if (drmMap(psp->fd, driverContext->shared.hFrameBuffer, psp->fbSize, - (drmAddressPtr)&psp->pFB)) { - fprintf(stderr, "libGL error: drmMap of framebuffer failed\n"); - (void)drmClose(psp->fd); - free(psp); - return NULL; - } - - /* - * Map the SAREA region. Further mmap regions may be setup in - * each DRI driver's "createScreen" function. - */ - if (drmMap(psp->fd, driverContext->shared.hSAREA, - driverContext->shared.SAREASize, - (drmAddressPtr)&psp->pSAREA)) { - fprintf(stderr, "libGL error: drmMap of sarea failed\n"); - (void)drmUnmap((drmAddress)psp->pFB, psp->fbSize); - (void)drmClose(psp->fd); - free(psp); - return NULL; - } - -#ifdef _EMBEDDED - mprotect(psp->pSAREA, driverContext->shared.SAREASize, PROT_READ); -#endif - } - - - /* Initialize the screen specific GLX driver */ - if (psp->DriverAPI.InitDriver) { - if (!(*psp->DriverAPI.InitDriver)(psp)) { - fprintf(stderr, "libGL error: InitDriver failed\n"); - free(psp->pDevPriv); - (void)drmClose(psp->fd); - free(psp); - return NULL; - } - } - - psp->entry.destroyScreen = driDestroyScreen; - psp->entry.createContext = driCreateContext; - psp->entry.createDrawable = driCreateDrawable; - - return psp; -} - - - -/** - * \brief Create the per-screen private information. - * - * Version for drivers without a DRM module. - * - * \param dpy the display handle. - * \param scrn the screen number. - * \param numConfigs number of visuals. - * \param config visuals. - * \param driverAPI driver callbacks structure. - * - * \internal - * Same as __driUtilCreateScreen() but without opening the DRM device. - */ -__DRIscreenPrivate * -__driUtilCreateScreenNoDRM(struct DRIDriverRec *driver, - struct DRIDriverContextRec *driverContext, - const struct __DriverAPIRec *driverAPI) -{ - __DRIscreenPrivate *psp; - - psp = (__DRIscreenPrivate *)calloc(1, sizeof(__DRIscreenPrivate)); - if (!psp) - return NULL; - - psp->ddxMajor = 4; - psp->ddxMinor = 0; - psp->ddxPatch = 1; - psp->driMajor = 4; - psp->driMinor = 1; - psp->driPatch = 0; - psp->fd = 0; - - psp->fbOrigin = driverContext->shared.fbOrigin; - psp->fbSize = driverContext->shared.fbSize; - psp->fbStride = driverContext->shared.fbStride; - psp->devPrivSize = driverContext->driverClientMsgSize; - psp->pDevPriv = driverContext->driverClientMsg; - psp->fbWidth = driverContext->shared.virtualWidth; - psp->fbHeight = driverContext->shared.virtualHeight; - psp->fbBPP = driverContext->bpp; - - psp->pFB = driverContext->FBAddress; - - /* install driver's callback functions */ - psp->DriverAPI = *driverAPI; - - if ((driverContext->FBAddress != NULL) && (driverContext->pSAREA != NULL)) { - /* Already mapped in server */ - psp->pFB = driverContext->FBAddress; - psp->pSAREA = driverContext->pSAREA; - } else { - int id; - psp->fd = open("/dev/mem", O_RDWR, 0); - /* - * Map the framebuffer region. - */ - if (drmMap(psp->fd, driverContext->shared.hFrameBuffer, psp->fbSize, - (drmAddressPtr)&psp->pFB)) { - fprintf(stderr, "libGL error: drmMap of framebuffer failed\n"); - (void)drmClose(psp->fd); - free(psp); - return NULL; - } - driverContext->FBAddress = psp->pFB; - - /* - * Map the SAREA region. Non-DRM drivers use a shmem SAREA - */ - id = shmget(driverContext->shared.hSAREA, driverContext->shared.SAREASize, 0); - driverContext->pSAREA = shmat(id, NULL, 0); - if (!driverContext->pSAREA) { - fprintf(stderr, "libGL error: shmget of sarea failed\n"); - (void)drmUnmap((drmAddress)psp->pFB, psp->fbSize); - (void)drmClose(psp->fd); - free(psp); - return NULL; - } - - close(psp->fd); - psp->fd = 0; - } - - /* Initialize the screen specific GLX driver */ - if (psp->DriverAPI.InitDriver) { - if (!(*psp->DriverAPI.InitDriver)(psp)) { - fprintf(stderr, "libGL error: InitDriver failed\n"); - free(psp->pDevPriv); - free(psp); - return NULL; - } - } - - psp->entry.destroyScreen = driDestroyScreen; - psp->entry.createContext = driCreateContext; - psp->entry.createDrawable = driCreateDrawable; - - return psp; -} - -/** - * Calculate amount of swap interval used between GLX buffer swaps. - * - * The usage value, on the range [0,max], is the fraction of total swap - * interval time used between GLX buffer swaps is calculated. - * - * \f$p = t_d / (i * t_r)\f$ - * - * Where \f$t_d\$f is the time since the last GLX buffer swap, \f$i\f$ is the - * swap interval (as set by \c glXSwapIntervalSGI), and \f$t_r\f$ time - * required for a single vertical refresh period (as returned by \c - * glXGetMscRateOML). - * - * See the documentation for the GLX_MESA_swap_frame_usage extension for more - * details. - * - * \param dPriv Pointer to the private drawable structure. - * \return If less than a single swap interval time period was required - * between GLX buffer swaps, a number greater than 0 and less than - * 1.0 is returned. If exactly one swap interval time period is - * required, 1.0 is returned, and if more than one is required then - * a number greater than 1.0 will be returned. - * - * \sa glXSwapIntervalSGI(), glXGetMscRateOML(). - */ -float -driCalculateSwapUsage( __DRIdrawablePrivate *dPriv, int64_t last_swap_ust, - int64_t current_ust ) -{ - return 0.0f; -} - -/** - * Compare the current GLX API version with a driver supplied required version. - * - * The minimum required version is compared with the API version exported by - * the \c __glXGetInternalVersion function (in libGL.so). - * - * \param required_version Minimum required internal GLX API version. - * \return A tri-value return, as from strcmp is returned. A value less - * than, equal to, or greater than zero will be returned if the - * internal GLX API version is less than, equal to, or greater - * than \c required_version. - * - * \sa __glXGetInternalVersion(). - */ -int driCompareGLXAPIVersion( GLuint required_version ) -{ - return 0; -} - -/*@}*/ diff --git a/src/glx/mini/dri_util.h b/src/glx/mini/dri_util.h deleted file mode 100644 index 638bfa95243..00000000000 --- a/src/glx/mini/dri_util.h +++ /dev/null @@ -1,527 +0,0 @@ -/** - * \file dri_util.h - * \brief DRI utility functions definitions. - * - * This module acts as glue between GLX and the actual hardware driver. A DRI - * driver doesn't really \e have to use any of this - it's optional. But, some - * useful stuff is done here that otherwise would have to be duplicated in most - * drivers. - * - * Basically, these utility functions take care of some of the dirty details of - * screen initialization, context creation, context binding, DRM setup, etc. - * - * These functions are compiled into each DRI driver so libGL.so knows nothing - * about them. - * - * Look for more comments in the dri_util.c file. - * - * \author Kevin E. Martin - * \author Brian Paul - */ - -/* - * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. - * 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, sub license, 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 (including the - * next paragraph) 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 NON-INFRINGEMENT. - * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - */ - - -#ifndef _DRI_UTIL_H_ -#define _DRI_UTIL_H_ - -#include -#include "dri.h" /* public entry points */ -#include "xf86drm.h" -#include "drm.h" -#include "drm_sarea.h" - -#define _SOLO - -typedef unsigned long CARD32; -typedef int (* PFNGLXGETUSTPROC) ( int64_t * ust ); - -typedef struct __DRIdisplayPrivateRec __DRIdisplayPrivate; /**< \brief Alias for __DRIdisplayPrivateRec */ -typedef struct __DRIscreenPrivateRec __DRIscreenPrivate; /**< \brief Alias for __DRIscreenPrivateRec */ -typedef struct __DRIcontextPrivateRec __DRIcontextPrivate; /**< \brief Alias for __DRIcontextPrivateRec */ -typedef struct __DRIdrawablePrivateRec __DRIdrawablePrivate; /**< \brief Alias for __DRIdrawablePrivateRec */ -typedef struct __DRIswapInfoRec __DRIswapInfo; /**< \brief Alias for __DRIswapInfoPrivateRec */ - - -/** - * Used by DRI_VALIDATE_DRAWABLE_INFO - */ -#define DRI_VALIDATE_DRAWABLE_INFO_ONCE(pDrawPriv) \ - do { \ - if (*(pDrawPriv->pStamp) != pDrawPriv->lastStamp) { \ - __driUtilUpdateDrawableInfo(pDrawPriv); \ - } \ - } while (0) - - -/** - * \brief Utility macro to validate the drawable information. - * - * See __DRIdrawablePrivateRec::pStamp and __DRIdrawablePrivateRec::lastStamp. - */ -#define DRI_VALIDATE_DRAWABLE_INFO(psp, pdp) \ -do { \ - DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp); \ -} while (0) - - -/** - * Driver callback functions. - * - * Each DRI driver must have one of these structures with all the pointers set - * to appropriate functions within the driver. - * - * When glXCreateContext() is called, for example, it'll call a helper function - * dri_util.c which in turn will jump through the \a CreateContext pointer in - * this structure. - */ -struct __DriverAPIRec { - /** - * Driver initialization callback - */ - GLboolean (*InitDriver)(__DRIscreenPrivate *driScrnPriv); - - /** - * Screen destruction callback - */ - void (*DestroyScreen)(__DRIscreenPrivate *driScrnPriv); - - /** - * Context creation callback - */ - GLboolean (*CreateContext)(const __GLcontextModes *glVis, - __DRIcontextPrivate *driContextPriv, - void *sharedContextPrivate); - - /** - * Context destruction callback - */ - void (*DestroyContext)(__DRIcontextPrivate *driContextPriv); - - /** - * Buffer (drawable) creation callback - */ - GLboolean (*CreateBuffer)(__DRIscreenPrivate *driScrnPriv, - __DRIdrawablePrivate *driDrawPriv, - const __GLcontextModes *glVis, - GLboolean pixmapBuffer); - - /** - * Buffer (drawable) destruction callback - */ - void (*DestroyBuffer)(__DRIdrawablePrivate *driDrawPriv); - - /** - * Buffer swapping callback - */ - void (*SwapBuffers)(__DRIdrawablePrivate *driDrawPriv); - - /** - * Context activation callback - */ - GLboolean (*MakeCurrent)(__DRIcontextPrivate *driContextPriv, - __DRIdrawablePrivate *driDrawPriv, - __DRIdrawablePrivate *driReadPriv); - - /** - * Context unbinding callback - */ - GLboolean (*UnbindContext)(__DRIcontextPrivate *driContextPriv); - - /** - * Full screen mode opening callback. - * - * \deprecated Full screen functionality is no longer used by DRI. - * Drivers should simply install a function returning - * \c GL_TRUE for backwards compatability. - */ - GLboolean (*OpenFullScreen)(__DRIcontextPrivate *driContextPriv); - - /** - * Full screen mode closing callback. - * - * \deprecated Full screen functionality is no longer used by DRI. - * Drivers should simply install a function returning - * \c GL_TRUE for backwards compatability. - */ - GLboolean (*CloseFullScreen)(__DRIcontextPrivate *driContextPriv); - - /* Retrieves statistics about buffer swap operations. Required if - * GLX_OML_sync_control or GLX_MESA_swap_frame_usage is supported. - */ - int (*GetSwapInfo)( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ); - - - /* Required if GLX_SGI_video_sync or GLX_OML_sync_control is - * supported. - */ - int (*GetMSC)( __DRIscreenPrivate * priv, int64_t * count ); - - /** - * These are required if GLX_OML_sync_control is supported. - */ - /*@{*/ - int (*WaitForMSC)( __DRIdrawablePrivate *priv, int64_t target_msc, - int64_t divisor, int64_t remainder, - int64_t * msc ); - int (*WaitForSBC)( __DRIdrawablePrivate *priv, int64_t target_sbc, - int64_t * msc, int64_t * sbc ); - - int64_t (*SwapBuffersMSC)( __DRIdrawablePrivate *priv, int64_t target_msc, - int64_t divisor, int64_t remainder ); - /*@}*/ -}; - - -struct __DRIswapInfoRec { - /** - * Number of swapBuffers operations that have been *completed*. - */ - uint64_t swap_count; - - /* - * Unadjusted system time of the last buffer swap. This is the time - * when the swap completed, not the time when swapBuffers was called. - */ - int64_t swap_ust; - - /* - * Number of swap operations that occurred after the swap deadline. That - * is if a swap happens more than swap_interval frames after the previous - * swap, it has missed its deadline. If swap_interval is 0, then the - * swap deadline is 1 frame after the previous swap. - */ - uint64_t swap_missed_count; - - /* - * Amount of time used by the last swap that missed its deadline. This - * is calculated as (__glXGetUST() - swap_ust) / (swap_interval * - * time_for_single_vrefresh)). If the actual value of swap_interval is - * 0, then 1 is used instead. If swap_missed_count is non-zero, this - * should be greater-than 1.0. - */ - float swap_missed_usage; -}; - - -/** - * \brief Per-drawable private DRI driver information. - * - */ -struct __DRIdrawablePrivateRec { - - /** - * \brief Public entry points - */ - __DRIdrawable entry; - - /** - * \brief Kernel drawable handle - * - * \note Not currently used. - */ - drmDrawable hHWDrawable; - - /** - * \brief Driver's private drawable information. - * - * This structure is opaque. - */ - void *driverPrivate; - - /** - * \brief Reference count for number of context's currently bound to this - * drawable. - * - * Once it reaches zero, the drawable can be destroyed. - * - * \note This behavior will change with GLX 1.3. - */ - int refcount; - - /** - * \brief Index of this drawable information in the SAREA. - */ - unsigned int index; - - /** - * \brief Pointer to the "drawable has changed ID" stamp in the SAREA. - */ - unsigned int *pStamp; - - /** - * \brief Last value of the stamp. - * - * If this differs from the value stored at - * __DRIdrawablePrivateRec::pStamp, then the drawable information has been - * modified by the X server, and the drawable information (below) should be - * retrieved from the X server. - */ - unsigned int lastStamp; - - /** - * \name Drawable - * Drawable information used in software fallbacks. - */ - /*@{*/ - int x; - int y; - int w; - int h; - int numClipRects; - drm_clip_rect_t *pClipRects; - /*@}*/ - - /** - * \name Back and depthbuffer - * Information about the back and depthbuffer where different from above. - */ - /*@{*/ - int backX; - int backY; - int backClipRectType; - int numBackClipRects; - drm_clip_rect_t *pBackClipRects; - /*@}*/ - - /** - * \brief Pointer to context to which this drawable is currently bound. - */ - __DRIcontextPrivate *driContextPriv; - - /** - * \brief Pointer to screen on which this drawable was created. - */ - __DRIscreenPrivate *driScreenPriv; - - int cpp; - void *frontBuffer; - void *backBuffer; - void *currentBuffer; - int currentPitch; - - int depthCpp; - void *depthBuffer; - int depthPitch; - - /** - * \brief Called via glXSwapBuffers(). - */ - void (*swapBuffers)( __DRIdrawablePrivate *dPriv ); -}; - -/** - * \brief Per-context private driver information. - */ -struct __DRIcontextPrivateRec { - /** - * \brief Public entry points - */ - __DRIcontext entry; - - /** - * \brief Kernel context handle used to access the device lock. - */ - drmContext hHWContext; - - /** - * \brief Device driver's private context data. This structure is opaque. - */ - void *driverPrivate; - - /** - * \brief Pointer to drawable currently bound to this context. - */ - __DRIdrawablePrivate *driDrawablePriv; - - /** - * \brief Pointer to screen on which this context was created. - */ - __DRIscreenPrivate *driScreenPriv; -}; - -/** - * \brief Per-screen private driver information. - */ -struct __DRIscreenPrivateRec { - - /** - * \brief Public entry points - */ - __DRIscreen entry; - - /** - * \brief Callback functions into the hardware-specific DRI driver code. - */ - struct __DriverAPIRec DriverAPI; - - /** - * \name DDX version - * DDX / 2D driver version information. - */ - /*@{*/ - int ddxMajor; - int ddxMinor; - int ddxPatch; - /*@}*/ - - /** - * \name DRI version - * DRI X extension version information. - */ - /*@{*/ - int driMajor; - int driMinor; - int driPatch; - /*@}*/ - - /** - * \name DRM version - * DRM (kernel module) version information. - */ - /*@{*/ - int drmMajor; - int drmMinor; - int drmPatch; - /*@}*/ - - /** - * \brief ID used when the client sets the drawable lock. - * - * The X server uses this value to detect if the client has died while - * holding the drawable lock. - */ - int drawLockID; - - /** - * \brief File descriptor returned when the kernel device driver is opened. - * - * Used to: - * - authenticate client to kernel - * - map the frame buffer, SAREA, etc. - * - close the kernel device driver - */ - int fd; - - /** - * \brief SAREA pointer - * - * Used to access: - * - the device lock - * - the device-independent per-drawable and per-context(?) information - */ - drm_sarea_t *pSAREA; - - /** - * \name Direct frame buffer access information - * Used for software fallbacks. - */ - /*@{*/ - unsigned char *pFB; - int fbSize; - int fbOrigin; - int fbStride; - int fbWidth; - int fbHeight; - int fbBPP; - /*@}*/ - - /** - * \name Device-dependent private information (stored in the SAREA). - * - * This data is accessed by the client driver only. - */ - /*@{*/ - void *pDevPriv; - int devPrivSize; - /*@}*/ - - /** - * \brief Dummy context to which drawables are bound when not bound to any - * other context. - * - * A dummy hHWContext is created for this context, and is used by the GL - * core when a hardware lock is required but the drawable is not currently - * bound (e.g., potentially during a SwapBuffers request). The dummy - * context is created when the first "real" context is created on this - * screen. - */ - __DRIcontextPrivate dummyContextPriv; - - /** - * \brief Hash table to hold the drawable information for this screen. - */ - void *drawHash; - - /** - * \brief Device-dependent private information (not stored in the SAREA). - * - * This pointer is never touched by the DRI layer. - */ - void *private; - - /** - * \brief Full screen mode. - * - * If we're in full screen mode (via DRIOpenFullScreen()), this points to - * the drawable that was bound. Otherwise, this is NULL. - */ - __DRIdrawablePrivate *fullscreen; - - - /** - * \brief Screen number for when multiple screens are supported - */ - int myNum; -}; - -extern void -__driUtilMessage(const char *f, ...); - - -extern void -__driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp); - - -extern __DRIscreenPrivate * -__driUtilCreateScreen(struct DRIDriverRec *driver, - struct DRIDriverContextRec *driverContext, - const struct __DriverAPIRec *driverAPI); - -__DRIscreenPrivate * -__driUtilCreateScreenNoDRM(struct DRIDriverRec *driver, - struct DRIDriverContextRec *driverContext, - const struct __DriverAPIRec *driverAPI); - -extern float -driCalculateSwapUsage( __DRIdrawablePrivate *dPriv, - int64_t last_swap_ust, int64_t current_ust ); - -/* Test the version of the internal GLX API. Returns a value like strcmp. */ -extern int -driCompareGLXAPIVersion( GLuint required_version ); - -#endif /* _DRI_UTIL_H_ */ diff --git a/src/glx/mini/drmtest.c b/src/glx/mini/drmtest.c deleted file mode 100644 index f9cad3994e0..00000000000 --- a/src/glx/mini/drmtest.c +++ /dev/null @@ -1,140 +0,0 @@ -#include -#include -#include -#include -#include "xf86drm.h" - -char *pciBusID = "PCI:1:0:0"; -#define DRM_PAGE_SIZE 4096 -void *pSAREA; - - -static int client( void ) -{ - int fd, ret, err; - drmContext clientContext; - - fprintf(stderr, "Opening client drm\n"); - - fd = drmOpen(NULL,pciBusID); - if (fd < 0) { - fprintf(stderr, "failed to open DRM: %s\n", strerror(-fd)); - return 1; - } - - - fprintf(stderr, "Create server context\n"); - if ((err = drmCreateContext(fd, &clientContext)) != 0) { - fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err); - return 0; - } - - - fprintf(stderr, "DRM_LOCK( %d %p %d )\n", fd, pSAREA, clientContext); - DRM_LOCK(fd, pSAREA, clientContext, 0); - fprintf(stderr, "locked\n"); - DRM_UNLOCK(fd, pSAREA, clientContext); - fprintf(stderr, "DRM_UNLOCK finished\n"); - - - fprintf(stderr, "Closing client drm: %d\n", fd); - ret = drmClose(fd); - fprintf(stderr, "done %d\n", ret); - - return ret; -} - -int main( int argc, char *argv[] ) -{ - char *drmModuleName = "radeon"; - int drmFD; - int err; - int SAREASize; - drmHandle hSAREA; - drmContext serverContext; - - /* Note that drmOpen will try to load the kernel module, if needed. */ - drmFD = drmOpen(drmModuleName, NULL ); - if (drmFD < 0) { - /* failed to open DRM */ - fprintf(stderr, "[drm] drmOpen failed\n"); - return 0; - } - - - if ((err = drmSetBusid(drmFD, pciBusID)) < 0) { - drmClose(drmFD); - fprintf(stderr, "[drm] drmSetBusid failed (%d, %s), %s\n", - drmFD, pciBusID, strerror(-err)); - return 0; - } - - - SAREASize = DRM_PAGE_SIZE; - - if (drmAddMap( drmFD, - 0, - SAREASize, - DRM_SHM, - DRM_CONTAINS_LOCK, - &hSAREA) < 0) - { - drmClose(drmFD); - fprintf(stderr, "[drm] drmAddMap failed\n"); - return 0; - } - - fprintf(stderr, "[drm] added %d byte SAREA at 0x%08lx\n", - SAREASize, hSAREA); - - if (drmMap( drmFD, - hSAREA, - SAREASize, - (drmAddressPtr)(&pSAREA)) < 0) - { - drmClose(drmFD); - fprintf(stderr, "[drm] drmMap failed\n"); - return 0; - } - - memset(pSAREA, 0, SAREASize); - fprintf(stderr, "[drm] mapped SAREA 0x%08lx to %p, size %d\n", - hSAREA, pSAREA, SAREASize); - - fprintf(stderr, "Create server context\n"); - if ((err = drmCreateContext(drmFD, &serverContext)) != 0) { - fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err); - return 0; - } - - - fprintf(stderr, "DRM_LOCK( %d %p %d )\n", drmFD, pSAREA, serverContext); - DRM_LOCK(drmFD, pSAREA, serverContext, 0); - fprintf(stderr, "locked\n"); - DRM_UNLOCK(drmFD, pSAREA, serverContext); - fprintf(stderr, "DRM_UNLOCK finished\n"); - - - client(); - - - fprintf(stderr, "DRM_LOCK( %d %p %d )\n", drmFD, pSAREA, serverContext); - DRM_LOCK(drmFD, pSAREA, serverContext, 0); - fprintf(stderr, "locked\n"); - DRM_UNLOCK(drmFD, pSAREA, serverContext); - fprintf(stderr, "DRM_UNLOCK finished\n"); - - - drmUnmap(pSAREA, SAREASize); - fprintf(stderr, "[drm] unmapped SAREA 0x%08lx from %p, size %d\n", - hSAREA, pSAREA, SAREASize); - pSAREA = 0; - - fprintf(stderr, "%s: Closing DRM fd\n", __FUNCTION__); - (void)drmClose(drmFD); - - return 0; -} - - - diff --git a/src/glx/mini/miniglx.c b/src/glx/mini/miniglx.c index 7e78a020ddb..31bd9cc034e 100644 --- a/src/glx/mini/miniglx.c +++ b/src/glx/mini/miniglx.c @@ -108,10 +108,45 @@ #include #include "miniglxP.h" -#include "dri.h" +#include "dri_util.h" +#include "imports.h" +#include "glcontextmodes.h" #include "glapi.h" -#include "xf86drm.h" + + +extern GLboolean __glXCreateContextWithConfig(__DRInativeDisplay *dpy, + int screen, int fbconfigID, void *contextID, + drm_context_t *hHWContext); + +extern GLboolean __glXGetDrawableInfo(__DRInativeDisplay *dpy, int scrn, + __DRIid draw, unsigned int * index, unsigned int * stamp, + int * x, int * y, int * width, int * height, + int * numClipRects, drm_clip_rect_t ** pClipRects, + int * backX, int * backY, + int * numBackClipRects, drm_clip_rect_t ** pBackClipRects); + + +/** Wrapper around either malloc() */ +void * +_mesa_malloc(size_t bytes) +{ + return malloc(bytes); +} + +/** Wrapper around either calloc() */ +void * +_mesa_calloc(size_t bytes) +{ + return calloc(1, bytes); +} + +/** Wrapper around either free() */ +void +_mesa_free(void *ptr) +{ + free(ptr); +} /** @@ -664,10 +699,10 @@ CloseFBDev( Display *dpy ) * Returns the MiniGLXDisplayRec::driScreen attribute. */ __DRIscreen * -__glXFindDRIScreen(Display *dpy, int scrn) +__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn) { (void) scrn; - return dpy->driScreen; + return &((Display*)dpy)->driScreen; } /** @@ -681,9 +716,10 @@ __glXFindDRIScreen(Display *dpy, int scrn) * the MiniGLXDisplayRec::TheWindow attribute. */ Bool -__glXWindowExists(Display *dpy, GLXDrawable draw) +__glXWindowExists(__DRInativeDisplay *dpy, GLXDrawable draw) { - if (dpy->TheWindow == draw) + Display* display = (Display*)dpy; + if (display->TheWindow == draw) return True; else return False; @@ -875,6 +911,24 @@ static int __read_config_file( Display *dpy ) static int InitDriver( Display *dpy ) { + char * str; + char * srvLibname = NULL; + + srvLibname = strdup(dpy->clientDriverName); + if (!srvLibname) { + goto failed; + } + + /* + * Construct server library name. Assume clientDriverName ends + * with dri.so. Replace dri.so with srv.so. + */ + str = strstr(srvLibname, "dri.so"); + if (!str) { + goto failed; + } + strcpy(str, "srv.so"); + /* * Begin DRI setup. * We're kind of combining the per-display and per-screen information @@ -884,32 +938,51 @@ static int InitDriver( Display *dpy ) if (!dpy->dlHandle) { fprintf(stderr, "Unable to open %s: %s\n", dpy->clientDriverName, dlerror()); - return GL_FALSE; + goto failed; + } + + dpy->dlHandleSrv = dlopen(srvLibname, RTLD_NOW | RTLD_GLOBAL); + if (!dpy->dlHandleSrv) { + fprintf(stderr, "Unable to open %s: %s\n", dpy->clientDriverName, + dlerror()); + goto failed; } /* Pull in Mini GLX specific hooks: */ - dpy->driver = (struct DRIDriverRec *) dlsym(dpy->dlHandle, + dpy->driver = (struct DRIDriverRec *) dlsym(dpy->dlHandleSrv, "__driDriver"); if (!dpy->driver) { fprintf(stderr, "Couldn't find __driDriver in %s\n", dpy->clientDriverName); - dlclose(dpy->dlHandle); - return GL_FALSE; + goto failed; } /* Pull in standard DRI client-side driver hooks: */ - dpy->createScreen = (driCreateScreenFunc*) dlsym(dpy->dlHandle, - "__driCreateScreen"); - if (!dpy->createScreen) { + dpy->createNewScreen = (PFNCREATENEWSCREENFUNC) + dlsym(dpy->dlHandle, "__driCreateNewScreen"); + if (!dpy->createNewScreen) { fprintf(stderr, "Couldn't find __driCreateScreen in %s\n", dpy->clientDriverName); - dlclose(dpy->dlHandle); - return GL_FALSE; + goto failed; } return GL_TRUE; + +failed: + if (srvLibname) { + free(srvLibname); + } + if (dpy->dlHandleSrv) { + dlclose(dpy->dlHandleSrv); + dpy->dlHandleSrv = 0; + } + if (dpy->dlHandle) { + dlclose(dpy->dlHandle); + dpy->dlHandle = 0; + } + return GL_FALSE; } @@ -1014,6 +1087,199 @@ __miniglx_StartServer( const char *display_name ) } +static void * +CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc) +{ + int directCapable; + void *psp = NULL; + drm_handle_t hSAREA; + drmAddress pSAREA; + const char *BusID; + __GLcontextModes *modes; + __GLcontextModes *temp; + int i; + __DRIversion ddx_version; + __DRIversion dri_version; + __DRIversion drm_version; + __DRIframebuffer framebuffer; + int fd = -1; + int status; + const char * err_msg; + const char * err_extra; + drmVersionPtr version; + drm_handle_t hFB; + int junk; + + + /* Create the linked list of context modes, and populate it with the + * GLX visual information passed in by libGL. + */ + + modes = _gl_context_modes_create( dpy->numModes, sizeof(__GLcontextModes) ); + if ( modes == NULL ) { + return NULL; + } + + temp = modes; + for ( i = 0 ; i < dpy->numModes ; i++ ) { + __GLcontextModes * next; + assert( temp != NULL ); + next = temp->next; + *temp = dpy->modes[i]; + temp->next = next; + temp->screen = scrn; + + temp = temp->next; + } + + err_msg = "XF86DRIOpenConnection"; + err_extra = NULL; + + hSAREA = dpy->driverContext.shared.hSAREA; + BusID = dpy->driverContext.pciBusID; + + fd = drmOpen(NULL, BusID); + + err_msg = "open DRM"; + err_extra = strerror( -fd ); + + if (fd < 0) goto done; + + drm_magic_t magic; + + err_msg = "drmGetMagic"; + err_extra = NULL; + + if (drmGetMagic(fd, &magic)) goto done; + + version = drmGetVersion(fd); + if (version) { + drm_version.major = version->version_major; + drm_version.minor = version->version_minor; + drm_version.patch = version->version_patchlevel; + drmFreeVersion(version); + } + else { + drm_version.major = -1; + drm_version.minor = -1; + drm_version.patch = -1; + } + + /* + * Get device name (like "tdfx") and the ddx version numbers. + * We'll check the version in each DRI driver's "createScreen" + * function. + */ + err_msg = "XF86DRIGetClientDriverName"; + ddx_version.major = 4; + ddx_version.minor = 0; + ddx_version.patch = 0; + + /* + * Get the DRI X extension version. + */ + err_msg = "XF86DRIQueryVersion"; + dri_version.major = 4; + dri_version.minor = 0; + dri_version.patch = 0; + + /* + * Get device-specific info. pDevPriv will point to a struct + * (such as DRIRADEONRec in xfree86/driver/ati/radeon_dri.h) + * that has information about the screen size, depth, pitch, + * ancilliary buffers, DRM mmap handles, etc. + */ + err_msg = "XF86DRIGetDeviceInfo"; + hFB = dpy->driverContext.shared.hFrameBuffer; + framebuffer.size = dpy->driverContext.shared.fbSize; + framebuffer.stride = dpy->driverContext.shared.fbStride; + framebuffer.dev_priv_size = dpy->driverContext.driverClientMsgSize; + framebuffer.dev_priv = dpy->driverContext.driverClientMsg; + framebuffer.width = dpy->driverContext.shared.virtualWidth; + framebuffer.height = dpy->driverContext.shared.virtualHeight; + + /* + * Map the framebuffer region. + */ + status = drmMap(fd, hFB, framebuffer.size, + (drmAddressPtr)&framebuffer.base); + + err_msg = "drmMap of framebuffer"; + err_extra = strerror( -status ); + + if ( status != 0 ) goto done; + + /* + * Map the SAREA region. Further mmap regions may be setup in + * each DRI driver's "createScreen" function. + */ + status = drmMap(fd, hSAREA, SAREA_MAX, &pSAREA); + + err_msg = "drmMap of sarea"; + err_extra = strerror( -status ); + + if ( status == 0 ) { + PFNGLXGETINTERNALVERSIONPROC get_ver; + + get_ver = (PFNGLXGETINTERNALVERSIONPROC) + glXGetProcAddress( (const GLubyte *) "__glXGetInternalVersion" ); + + err_msg = "InitDriver"; + err_extra = NULL; + psp = dpy->createNewScreen(dpy, scrn, psc, modes, + & ddx_version, + & dri_version, + & drm_version, + & framebuffer, + pSAREA, + fd, + (get_ver != NULL) ? (*get_ver)() : 20040602, + (__GLcontextModes **) &dpy->driver_modes); + if (dpy->driver_modes == NULL) { + dpy->driver_modes = modes; + } + else { + _gl_context_modes_destroy(modes); + modes = NULL; + } + } + +done: + if ( psp == NULL ) { + if ( pSAREA != MAP_FAILED ) { + (void)drmUnmap(pSAREA, SAREA_MAX); + } + + if ( framebuffer.base != MAP_FAILED ) { + (void)drmUnmap((drmAddress)framebuffer.base, framebuffer.size); + } + + if ( framebuffer.dev_priv != NULL ) { + free(framebuffer.dev_priv); + } + + if ( fd >= 0 ) { + (void)drmClose(fd); + } + + if ( modes != NULL ) { + _gl_context_modes_destroy( modes ); + } + + if ( err_extra != NULL ) { + fprintf(stderr, "libGL error: %s failed (%s)\n", err_msg, + err_extra); + } + else { + fprintf(stderr, "libGL error: %s failed\n", err_msg ); + } + + fprintf(stderr, "libGL error: reverting to (slow) indirect rendering\n"); + } + + return psp; +} + /** * \brief Initialize the graphics system. * @@ -1083,9 +1349,8 @@ XOpenDisplay( const char *display_name ) * * Need to shut down DRM and free DRI data in XDestroyWindow(), too. */ - dpy->driScreen = (*dpy->createScreen)(dpy->driver, - &dpy->driverContext); - if (!dpy->driScreen) { + dpy->driScreen.private = CallCreateNewScreen(dpy, 0, &dpy->driScreen); + if (!dpy->driScreen.private) { fprintf(stderr, "%s: __driCreateScreen failed\n", __FUNCTION__); dlclose(dpy->dlHandle); free(dpy); @@ -1124,7 +1389,7 @@ XCloseDisplay( Display *dpy ) /* As this is done in XOpenDisplay, need to undo it here: */ - (*dpy->driScreen->destroyScreen)(dpy->driScreen); + dpy->driScreen.destroyScreen(dpy, 0, dpy->driScreen.private); __miniglx_close_connections( dpy ); @@ -1187,6 +1452,8 @@ XCreateWindow( Display *dpy, Window parent, int x, int y, Visual *visual, unsigned long valuemask, XSetWindowAttributes *attributes ) { + const int empty_attribute_list[1] = { None }; + Window win; /* ignored */ @@ -1252,11 +1519,10 @@ XCreateWindow( Display *dpy, Window parent, int x, int y, win->curBottom = win->frontBottom; } - win->driDrawable = dpy->driScreen->createDrawable(dpy->driScreen, - width, height, - dpy->clientID, visual->mode); + dpy->driScreen.createNewDrawable(dpy, dpy->driver_modes, (int) win, + &win->driDrawable, GLX_WINDOW_BIT, empty_attribute_list); - if (!win->driDrawable) { + if (!win->driDrawable.private) { fprintf(stderr, "%s: dri.createDrawable failed\n", __FUNCTION__); free(win); return NULL; @@ -1293,7 +1559,7 @@ XDestroyWindow( Display *display, Window win ) XUnmapWindow( display, win ); /* Destroy the drawable. */ - (*win->driDrawable->destroyDrawable)(win->driDrawable); + win->driDrawable.destroyDrawable(display, win->driDrawable.private); free(win); /* unlink window from display */ @@ -1748,14 +2014,14 @@ glXCreateContext( Display *dpy, XVisualInfo *vis, ctx->vid = vis->visualid; if (shareList) - sharePriv = shareList->driContext; + sharePriv = shareList->driContext.private; else sharePriv = NULL; - - ctx->driContext = (*dpy->driScreen->createContext)(dpy->driScreen, - vis->visual->mode, - sharePriv); - if (!ctx->driContext) { + + ctx->driContext.private = dpy->driScreen.createNewContext(dpy, vis->visual->mode, + GLX_WINDOW_BIT, sharePriv, &ctx->driContext); + + if (!ctx->driContext.private) { free(ctx); return NULL; } @@ -1782,10 +2048,10 @@ glXDestroyContext( Display *dpy, GLXContext ctx ) if (ctx) { if (glxctx == ctx) { /* destroying current context */ - (*ctx->driContext->bindContext)(dpy->driScreen, 0, 0); + ctx->driContext.bindContext3(dpy, 0, 0, 0, 0); CurrentContext = 0; } - (*ctx->driContext->destroyContext)(ctx->driContext); + ctx->driContext.destroyContext(dpy, 0, ctx->driContext.private); free(ctx); } } @@ -1825,17 +2091,20 @@ glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx) GLXDrawable oldDrawable = glXGetCurrentDrawable(); /* unbind old */ if (oldContext) { - (*oldContext->driContext->unbindContext)(oldDrawable->driDrawable, oldContext->driContext); + oldContext->driContext.unbindContext3(dpy, 0, + (__DRIid) oldDrawable, (__DRIid) oldDrawable, + &oldContext->driContext); } /* bind new */ CurrentContext = ctx; - (*ctx->driContext->bindContext)(dpy->driScreen, drawable->driDrawable, ctx->driContext); + ctx->driContext.bindContext3(dpy, 0, (__DRIid) drawable, + (__DRIid) drawable, &ctx->driContext); ctx->drawBuffer = drawable; ctx->curBuffer = drawable; } else if (ctx && dpy) { /* unbind */ - (*ctx->driContext->bindContext)(dpy->driScreen, 0, 0); + ctx->driContext.bindContext3(dpy, 0, 0, 0, 0); } else if (dpy) { CurrentContext = 0; /* kw: this seems to be intended??? */ @@ -1865,7 +2134,7 @@ glXSwapBuffers( Display *dpy, GLXDrawable drawable ) if (!dpy || !drawable) return; - (*drawable->driDrawable->swapBuffers)(drawable->driDrawable); + drawable->driDrawable.swapBuffers(dpy, drawable->driDrawable.private); } @@ -1906,6 +2175,90 @@ glXGetCurrentDrawable( void ) } +GLboolean +__glXCreateContextWithConfig(__DRInativeDisplay *dpy, int screen, + int fbconfigID, void *contextID, drm_context_t *hHWContext) +{ + __DRIscreen *pDRIScreen; + __DRIscreenPrivate *psp; + + pDRIScreen = __glXFindDRIScreen(dpy, screen); + if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { + return GL_FALSE; + } + + psp = (__DRIscreenPrivate *) pDRIScreen->private; + + if (psp->fd) { + if (drmCreateContext(psp->fd, hHWContext)) { + fprintf(stderr, ">>> drmCreateContext failed\n"); + return GL_FALSE; + } + *(void**)contextID = (void*) *hHWContext; + } + + return GL_TRUE; +} + + +GLboolean +__glXGetDrawableInfo(__DRInativeDisplay *dpy, int scrn, + __DRIid draw, unsigned int * index, unsigned int * stamp, + int * x, int * y, int * width, int * height, + int * numClipRects, drm_clip_rect_t ** pClipRects, + int * backX, int * backY, + int * numBackClipRects, drm_clip_rect_t ** pBackClipRects) +{ + GLXDrawable drawable = (GLXDrawable) draw; + drm_clip_rect_t * cliprect; + + if (drawable == 0) { + return GL_FALSE; + } + + cliprect = (drm_clip_rect_t*) _mesa_malloc(sizeof(drm_clip_rect_t)); + cliprect->x1 = drawable->x; + cliprect->y1 = drawable->y; + cliprect->x2 = drawable->x + drawable->w; + cliprect->y2 = drawable->y + drawable->h; + + *x = drawable->x; + *y = drawable->y; + *width = drawable->w; + *height = drawable->h; + *numClipRects = 1; + *pClipRects = cliprect; + *backX = 0; + *backY = 0; + *numBackClipRects = 0; + *pBackClipRects = 0; + + return GL_TRUE; +} + + +GLboolean +XF86DRIDestroyContext(__DRInativeDisplay *dpy, int screen, __DRIid context_id ) +{ + return GL_TRUE; +} + + +GLboolean +XF86DRICreateDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable, + drm_drawable_t *hHWDrawable ) +{ + return GL_TRUE; +} + + +GLboolean +XF86DRIDestroyDrawable(__DRInativeDisplay *dpy, int screen, __DRIid drawable) +{ + return GL_TRUE; +} + + /** * \brief Query function address. * @@ -1926,8 +2279,7 @@ glXGetCurrentDrawable( void ) * Returns the function address by looking up its name in a static (name, * address) pair list. */ -const void * -glXGetProcAddress( const GLubyte *procName ) +void (*glXGetProcAddress(const GLubyte *procname))( void ) { struct name_address { const char *name; @@ -1955,15 +2307,18 @@ glXGetProcAddress( const GLubyte *procName ) { "glXDestroyPbuffer", (void *) glXDestroyPbuffer }, { "glXChooseFBConfig", (void *) glXChooseFBConfig }, { "glXGetVisualFromFBConfig", (void *) glXGetVisualFromFBConfig }, + { "__glXCreateContextWithConfig", (void *) __glXCreateContextWithConfig }, + { "__glXGetDrawableInfo", (void *) __glXGetDrawableInfo }, + { "__glXWindowExists", (void *) __glXWindowExists }, { NULL, NULL } }; const struct name_address *entry; for (entry = functions; entry->name; entry++) { - if (strcmp(entry->name, (const char *) procName) == 0) { + if (strcmp(entry->name, (const char *) procname) == 0) { return entry->func; } } - return _glapi_get_proc_address((const char *) procName); + return _glapi_get_proc_address((const char *) procname); } diff --git a/src/glx/mini/miniglxP.h b/src/glx/mini/miniglxP.h index a32429a677c..ce0eafe17e3 100644 --- a/src/glx/mini/miniglxP.h +++ b/src/glx/mini/miniglxP.h @@ -18,7 +18,7 @@ #include "mtypes.h" #include "driver.h" -#include "dri.h" +#include "GL/internal/dri_interface.h" /** * \brief Supported pixel formats. @@ -71,7 +71,7 @@ struct MiniGLXWindowRec { GLubyte *frontBottom; /**< \brief pointer to last row */ GLubyte *backBottom; /**< \brief pointer to last row */ GLubyte *curBottom; /**< = frontBottom or backBottom */ - __DRIdrawable *driDrawable; + __DRIdrawable driDrawable; GLuint ismapped; }; @@ -85,7 +85,7 @@ struct MiniGLXContextRec { Window drawBuffer; /**< \brief drawing buffer */ Window curBuffer; /**< \brief current buffer */ VisualID vid; /**< \brief visual ID */ - __DRIcontext *driContext; /**< \brief context dependent methods */ + __DRIcontext driContext; /**< \brief context dependent methods */ }; #define MINIGLX_BUF_SIZE 512 @@ -153,18 +153,23 @@ struct MiniGLXDisplayRec { /*@{*/ int numModes; /**< \brief Number of modes. */ const __GLcontextModes *modes; /**< \brief Modes list pointer. */ + const __GLcontextModes *driver_modes; /**< \brief Modes filtered by driver. */ /*@}*/ /** * \name From __GLXdisplayPrivate */ /*@{*/ - driCreateScreenFunc *createScreen; /**< \brief \e __driCreateScreen hook */ - __DRIscreen *driScreen; /**< \brief Screen dependent methods */ + PFNCREATENEWSCREENFUNC createNewScreen; /**< \brief \e __driCreateScreen hook */ + __DRIscreen driScreen; /**< \brief Screen dependent methods */ void *dlHandle; /**< * \brief handle to the client dynamic * library */ + void *dlHandleSrv; /**< + * \brief handle to the server dynamic + * library + */ /*@}*/ /** @@ -184,9 +189,7 @@ struct MiniGLXDisplayRec { /*@}*/ }; -extern __DRIscreen *__glXFindDRIScreen(Display *dpy, int scrn); - -extern Bool __glXWindowExists(Display *dpy, GLXDrawable draw); +extern Bool __glXWindowExists(__DRInativeDisplay *dpy, GLXDrawable draw); extern int __miniglx_open_connections( Display *dpy ); extern void __miniglx_close_connections( Display *dpy ); diff --git a/src/glx/mini/miniglx_events.c b/src/glx/mini/miniglx_events.c index 319fc530fa1..daa61ca73b5 100644 --- a/src/glx/mini/miniglx_events.c +++ b/src/glx/mini/miniglx_events.c @@ -38,7 +38,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $Id: miniglx_events.c,v 1.2 2004/03/11 20:35:38 jonsmirl Exp $ */ +/* $Id: miniglx_events.c,v 1.3 2004/06/26 17:16:42 jonsmirl Exp $ */ #include @@ -64,8 +64,6 @@ #include "miniglxP.h" -#include "xf86drm.h" -#include "dri_util.h" #define MINIGLX_FIFO_NAME "/tmp/miniglx.fifo" diff --git a/src/glx/mini/xf86drm.c b/src/glx/mini/xf86drm.c deleted file mode 100644 index bbb02e4032b..00000000000 --- a/src/glx/mini/xf86drm.c +++ /dev/null @@ -1,1587 +0,0 @@ -/** - * \file xf86drm.c - * \brief User-level interface to DRM device - * - * This file is an user-friendly interface to the DRM ioctls defined in drm.h. - * - * This covers only the device-independent ioctls -- it is up to the driver to - * wrap the device-dependent ioctls. - * - * \author Rickard E. (Rik) Faith - * \author Kevin E. Martin - */ - -/* - * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. - * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. - * 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 (including the next - * paragraph) 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 - * PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - */ - -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include "drm.h" - -/* Not all systems have MAP_FAILED defined */ -#ifndef MAP_FAILED -#define MAP_FAILED ((void *)-1) -#endif - -#include "xf86drm.h" - -#ifndef DRM_MAJOR -#define DRM_MAJOR 226 /* Linux */ -#endif - -#ifndef __linux__ -#undef DRM_MAJOR -#define DRM_MAJOR 145 /* Should set in drm.h for *BSD */ -#endif - -#ifndef DRM_MAX_MINOR -#define DRM_MAX_MINOR 16 -#endif - -#ifdef __linux__ -#include /* for makedev() */ -#endif - -#ifndef makedev - /* This definition needs to be changed on - some systems if dev_t is a structure. - If there is a header file we can get it - from, there would be best. */ -#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) -#endif - - -/** - * \brief Output a message to stderr. - * - * \param format printf() like format string. - * - * \internal - * This function is a wrapper around vfprintf(). - */ -static void -drmMsg(const char *format, ...) -{ - va_list ap; - - const char *env; - if ((env = getenv("LIBGL_DEBUG")) && strstr(env, "verbose")) - { - va_start(ap, format); - vfprintf(stderr, format, ap); - va_end(ap); - } -} - - - -/** - * \brief Open the DRM device, creating it if necessary. - * - * \param dev major and minor numbers of the device. - * \param minor minor number of the device. - * - * \return a file descriptor on success, or a negative value on error. - * - * \internal - * Assembles the device name from \p minor and opens it, creating the device - * special file node with the major and minor numbers specified by \p dev and - * parent directory if necessary and was called by root. - */ -static int drmOpenDevice(long dev, int minor) -{ - struct stat st; - char buf[64]; - int fd; - mode_t devmode = DRM_DEV_MODE; - int isroot = !geteuid(); -#if defined(XFree86Server) - uid_t user = DRM_DEV_UID; - gid_t group = DRM_DEV_GID; -#endif - - drmMsg("drmOpenDevice: minor is %d\n", minor); - -#if defined(XFree86Server) - devmode = xf86ConfigDRI.mode ? xf86ConfigDRI.mode : DRM_DEV_MODE; - devmode &= ~(S_IXUSR|S_IXGRP|S_IXOTH); - group = (xf86ConfigDRI.group >= 0) ? xf86ConfigDRI.group : DRM_DEV_GID; -#endif - - if (stat(DRM_DIR_NAME, &st)) { - if (!isroot) return DRM_ERR_NOT_ROOT; - mkdir(DRM_DIR_NAME, DRM_DEV_DIRMODE); - chown(DRM_DIR_NAME, 0, 0); /* root:root */ - chmod(DRM_DIR_NAME, DRM_DEV_DIRMODE); - } - - sprintf(buf, DRM_DEV_NAME, DRM_DIR_NAME, minor); - drmMsg("drmOpenDevice: node name is %s\n", buf); - if (stat(buf, &st)) { - if (!isroot) return DRM_ERR_NOT_ROOT; - remove(buf); - mknod(buf, S_IFCHR | devmode, dev); - } -#if defined(XFree86Server) - chown(buf, user, group); - chmod(buf, devmode); -#endif - - fd = open(buf, O_RDWR, 0); - drmMsg("drmOpenDevice: open result is %d, (%s)\n", - fd, fd < 0 ? strerror(errno) : "OK"); - if (fd >= 0) return fd; - - if (st.st_rdev != dev) { - if (!isroot) return DRM_ERR_NOT_ROOT; - remove(buf); - mknod(buf, S_IFCHR | devmode, dev); - } - fd = open(buf, O_RDWR, 0); - drmMsg("drmOpenDevice: open result is %d, (%s)\n", - fd, fd < 0 ? strerror(errno) : "OK"); - if (fd >= 0) return fd; - - drmMsg("drmOpenDevice: Open failed\n"); - remove(buf); - return -errno; -} - - -/** - * \brief Open the DRM device - * - * \param minor device minor number. - * \param create allow to create the device if set. - * - * \return a file descriptor on success, or a negative value on error. - * - * \internal - * Calls drmOpenDevice() if \p create is set, otherwise assembles the device - * name from \p minor and opens it. - */ -static int drmOpenMinor(int minor, int create) -{ - int fd; - char buf[64]; - - if (create) return drmOpenDevice(makedev(DRM_MAJOR, minor), minor); - - sprintf(buf, DRM_DEV_NAME, DRM_DIR_NAME, minor); - if ((fd = open(buf, O_RDWR, 0)) >= 0) return fd; - drmMsg("drmOpenMinor: open result is %d, (%s)\n", - fd, fd < 0 ? strerror(errno) : "OK"); - return -errno; -} - - -/** - * \brief Determine whether the DRM kernel driver has been loaded. - * - * \return 1 if the DRM driver is loaded, 0 otherwise. - * - * \internal - * Determine the presence of the kernel driver by attempting to open the 0 - * minor and get version information. For backward compatibility with older - * Linux implementations, /proc/dri is also checked. - */ -int drmAvailable(void) -{ - drmVersionPtr version; - int retval = 0; - int fd; - - if ((fd = drmOpenMinor(0, 1)) < 0) { - /* Try proc for backward Linux compatibility */ - if (!access("/proc/dri/0", R_OK)) return 1; - return 0; - } - - if ((version = drmGetVersion(fd))) { - retval = 1; - drmFreeVersion(version); - } - close(fd); - drmMsg("close %d\n", fd); - - return retval; -} - - -/** - * \brief Open the device by bus ID. - * - * \param busid bus ID. - * - * \return a file descriptor on success, or a negative value on error. - * - * \internal - * This function attempts to open every possible minor (up to DRM_MAX_MINOR), - * comparing the device bus ID with the one supplied. - * - * \sa drmOpenMinor() and drmGetBusid(). - */ -static int drmOpenByBusid(const char *busid) -{ - int i; - int fd; - const char *buf; - - drmMsg("drmOpenByBusid: busid is %s\n", busid); - for (i = 0; i < DRM_MAX_MINOR; i++) { - fd = drmOpenMinor(i, 1); - drmMsg("drmOpenByBusid: drmOpenMinor returns %d\n", fd); - if (fd >= 0) { - buf = drmGetBusid(fd); - drmMsg("drmOpenByBusid: drmGetBusid reports %s\n", buf); - if (buf && !strcmp(buf, busid)) { - drmFreeBusid(buf); - return fd; - } - if (buf) drmFreeBusid(buf); - close(fd); - drmMsg("close %d\n", fd); - } - } - return -1; -} - - -/** - * \brief Open the device by name. - * - * \param name driver name. - * - * \return a file descriptor on success, or a negative value on error. - * - * \internal - * This function opens the first minor number that matches the driver name and - * isn't already in use. If it's in use it then it will already have a bus ID - * assigned. - * - * \sa drmOpenMinor(), drmGetVersion() and drmGetBusid(). - */ -static int drmOpenByName(const char *name) -{ - int i; - int fd; - drmVersionPtr version; - char * id; - - if (!drmAvailable()) { -#if !defined(XFree86Server) - return -1; -#else - /* try to load the kernel module now */ - if (!xf86LoadKernelModule(name)) { - ErrorF("[drm] failed to load kernel module \"%s\"\n", - name); - return -1; - } -#endif - } - - for (i = 0; i < DRM_MAX_MINOR; i++) { - if ((fd = drmOpenMinor(i, 1)) >= 0) { - if ((version = drmGetVersion(fd))) { - if (!strcmp(version->name, name)) { - drmFreeVersion(version); - -/* return fd; */ - - id = drmGetBusid(fd); - drmMsg("drmGetBusid returned '%s'\n", id ? id : "NULL"); - if (!id || !*id) { - if (id) { - drmFreeBusid(id); - } - return fd; - } else { - drmFreeBusid(id); - } - } else { - drmFreeVersion(version); - } - } - close(fd); - drmMsg("close %d\n", fd); - } - } - - return -1; -} - - -/** - * \brief Open the DRM device. - * - * Looks up the specified name and bus ID, and opens the device found. The - * entry in /dev/dri is created if necessary and if called by root. - * - * \param name driver name. Not referenced if bus ID is supplied. - * \param busid bus ID. Zero if not known. - * - * \return a file descriptor on success, or a negative value on error. - * - * \internal - * It calls drmOpenByBusid() if \p busid is specified or drmOpenByName() - * otherwise. - */ -int drmOpen(const char *name, const char *busid) -{ - - if (busid) return drmOpenByBusid(busid); - return drmOpenByName(name); -} - - -/** - * \brief Free the version information returned by drmGetVersion(). - * - * \param v pointer to the version information. - * - * \internal - * It frees the memory pointed by \p %v as well as all the non-null strings - * pointers in it. - */ -void drmFreeVersion(drmVersionPtr v) -{ - if (!v) return; - if (v->name) free(v->name); - if (v->date) free(v->date); - if (v->desc) free(v->desc); - free(v); -} - - -/** - * \brief Free the non-public version information returned by the kernel. - * - * \param v pointer to the version information. - * - * \internal - * Used by drmGetVersion() to free the memory pointed by \p %v as well as all - * the non-null strings pointers in it. - */ -static void drmFreeKernelVersion(drm_version_t *v) -{ - if (!v) return; - if (v->name) free(v->name); - if (v->date) free(v->date); - if (v->desc) free(v->desc); - free(v); -} - - -/** - * \brief Copy version information. - * - * \param d destination pointer. - * \param s source pointer. - * - * \internal - * Used by drmGetVersion() to translate the information returned by the ioctl - * interface in a private structure into the public structure counterpart. - */ -static void drmCopyVersion(drmVersionPtr d, const drm_version_t *s) -{ - d->version_major = s->version_major; - d->version_minor = s->version_minor; - d->version_patchlevel = s->version_patchlevel; - d->name_len = s->name_len; - d->name = strdup(s->name); - d->date_len = s->date_len; - d->date = strdup(s->date); - d->desc_len = s->desc_len; - d->desc = strdup(s->desc); -} - - -/** - * \brief Query the driver version information. - * - * \param fd file descriptor. - * - * \return pointer to a drmVersion structure which should be freed with - * drmFreeVersion(). - * - * \note Similar information is available via /proc/dri. - * - * \internal - * It gets the version information via successive DRM_IOCTL_VERSION ioctls, - * first with zeros to get the string lengths, and then the actually strings. - * It also null-terminates them since they might not be already. - */ -drmVersionPtr drmGetVersion(int fd) -{ - drmVersionPtr retval; - drm_version_t *version = malloc(sizeof(*version)); - - /* First, get the lengths */ - version->name_len = 0; - version->name = NULL; - version->date_len = 0; - version->date = NULL; - version->desc_len = 0; - version->desc = NULL; - - if (ioctl(fd, DRM_IOCTL_VERSION, version)) { - drmFreeKernelVersion(version); - return NULL; - } - - /* Now, allocate space and get the data */ - if (version->name_len) - version->name = malloc(version->name_len + 1); - if (version->date_len) - version->date = malloc(version->date_len + 1); - if (version->desc_len) - version->desc = malloc(version->desc_len + 1); - - if (ioctl(fd, DRM_IOCTL_VERSION, version)) { - drmFreeKernelVersion(version); - return NULL; - } - - /* The results might not be null-terminated - strings, so terminate them. */ - - if (version->name_len) version->name[version->name_len] = '\0'; - if (version->date_len) version->date[version->date_len] = '\0'; - if (version->desc_len) version->desc[version->desc_len] = '\0'; - - /* Now, copy it all back into the - client-visible data structure... */ - retval = malloc(sizeof(*retval)); - drmCopyVersion(retval, version); - drmFreeKernelVersion(version); - return retval; -} - - -/** - * \brief Get version information for the DRM user space library. - * - * This version number is driver independent. - * - * \param fd file descriptor. - * - * \return version information. - * - * \internal - * This function allocates and fills a drm_version structure with a hard coded - * version number. - */ -drmVersionPtr drmGetLibVersion(int fd) -{ - drm_version_t *version = malloc(sizeof(*version)); - - /* Version history: - * revision 1.0.x = original DRM interface with no drmGetLibVersion - * entry point and many drm extensions - * revision 1.1.x = added drmCommand entry points for device extensions - * added drmGetLibVersion to identify libdrm.a version - */ - version->version_major = 1; - version->version_minor = 1; - version->version_patchlevel = 0; - - return (drmVersionPtr)version; -} - - -/** - * \brief Free the bus ID information. - * - * \param busid bus ID information string as given by drmGetBusid(). - * - * \internal - * This function is just frees the memory pointed by \p busid. - */ -void drmFreeBusid(const char *busid) -{ - free((void *)busid); -} - - -/** - * \brief Get the bus ID of the device. - * - * \param fd file descriptor. - * - * \return bus ID string. - * - * \internal - * This function gets the bus ID via successive DRM_IOCTL_GET_UNIQUE ioctls to - * get the string length and data, passing the arguments in a drm_unique - * structure. - */ -char *drmGetBusid(int fd) -{ - drm_unique_t u; - - u.unique_len = 0; - u.unique = NULL; - - if (ioctl(fd, DRM_IOCTL_GET_UNIQUE, &u)) return NULL; - u.unique = malloc(u.unique_len + 1); - if (ioctl(fd, DRM_IOCTL_GET_UNIQUE, &u)) return NULL; - u.unique[u.unique_len] = '\0'; - return u.unique; -} - - -/** - * \brief Set the bus ID of the device. - * - * \param fd file descriptor. - * \param busid bus ID string. - * - * \return zero on success, negative on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_SET_UNIQUE ioctl, passing - * the arguments in a drm_unique structure. - */ -int drmSetBusid(int fd, const char *busid) -{ - drm_unique_t u; - - u.unique = (char *)busid; - u.unique_len = strlen(busid); - - if (ioctl(fd, DRM_IOCTL_SET_UNIQUE, &u)) { - return -errno; - } - return 0; -} - - -/** - * \brief Specifies a range of memory that is available for mapping by a - * non-root process. - * - * \param fd file descriptor. - * \param offset usually the physical address. The actual meaning depends of - * the \p type parameter. See below. - * \param size of the memory in bytes. - * \param type type of the memory to be mapped. - * \param flags combination of several flags to modify the function actions. - * \param handle will be set to a value that may be used as the offset - * parameter for mmap(). - * - * \return zero on success or a negative value on error. - * - * \par Mapping the frame buffer - * For the frame buffer - * - \p offset will be the physical address of the start of the frame buffer, - * - \p size will be the size of the frame buffer in bytes, and - * - \p type will be DRM_FRAME_BUFFER. - * - * \par - * The area mapped will be uncached. If MTRR support is available in the - * kernel, the frame buffer area will be set to write combining. - * - * \par Mapping the MMIO register area - * For the MMIO register area, - * - \p offset will be the physical address of the start of the register area, - * - \p size will be the size of the register area bytes, and - * - \p type will be DRM_REGISTERS. - * \par - * The area mapped will be uncached. - * - * \par Mapping the SAREA - * For the SAREA, - * - \p offset will be ignored and should be set to zero, - * - \p size will be the desired size of the SAREA in bytes, - * - \p type will be DRM_SHM. - * - * \par - * A shared memory area of the requested size will be created and locked in - * kernel memory. This area may be mapped into client-space by using the handle - * returned. - * - * \note May only be called by root. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_ADD_MAP ioctl, passing - * the arguments in a drm_map structure. - */ -int drmAddMap(int fd, - drmHandle offset, - drmSize size, - drmMapType type, - drmMapFlags flags, - drmHandlePtr handle) -{ - drm_map_t map; - - map.offset = offset; - map.size = size; - map.handle = 0; - map.type = type; - map.flags = flags; - if (ioctl(fd, DRM_IOCTL_ADD_MAP, &map)) return -errno; - if (handle) *handle = (drmHandle)map.handle; - return 0; -} - - -/** - * \brief Make buffers available for DMA transfers. - * - * \param fd file descriptor. - * \param count number of buffers. - * \param size size of each buffer. - * \param flags buffer allocation flags. - * \param agp_offset offset in the AGP aperture - * - * \return number of buffers allocated, negative on error. - * - * \internal - * This function is a wrapper around DRM_IOCTL_ADD_BUFS ioctl. - * - * \sa drm_buf_desc. - */ -int drmAddBufs(int fd, int count, int size, drmBufDescFlags flags, - int agp_offset) -{ - drm_buf_desc_t request; - - request.count = count; - request.size = size; - request.low_mark = 0; - request.high_mark = 0; - request.flags = flags; - request.agp_start = agp_offset; - - if (ioctl(fd, DRM_IOCTL_ADD_BUFS, &request)) return -errno; - return request.count; -} - - -/** - * \brief Free buffers. - * - * \param fd file descriptor. - * \param count number of buffers to free. - * \param list list of buffers to be freed. - * - * \return zero on success, or a negative value on failure. - * - * \note This function is primarily used for debugging. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_FREE_BUFS ioctl, passing - * the arguments in a drm_buf_free structure. - */ -int drmFreeBufs(int fd, int count, int *list) -{ - drm_buf_free_t request; - - request.count = count; - request.list = list; - if (ioctl(fd, DRM_IOCTL_FREE_BUFS, &request)) return -errno; - return 0; -} - - -/** - * \brief Close the device. - * - * \param fd file descriptor. - * - * \internal - * This function closes the file descriptor. - */ -int drmClose(int fd) -{ - drmMsg("close %d\n", fd); - return close(fd); -} - - -/** - * \brief Map a region of memory. - * - * \param fd file descriptor. - * \param handle handle returned by drmAddMap(). - * \param size size in bytes. Must match the size used by drmAddMap(). - * \param address will contain the user-space virtual address where the mapping - * begins. - * - * \return zero on success, or a negative value on failure. - * - * \internal - * This function is a wrapper for mmap(). - */ -int drmMap(int fd, - drmHandle handle, - drmSize size, - drmAddressPtr address) -{ - static unsigned long pagesize_mask = 0; - - if (fd < 0) return -EINVAL; - - if (!pagesize_mask) - pagesize_mask = getpagesize() - 1; - - size = (size + pagesize_mask) & ~pagesize_mask; - - *address = mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, handle); - if (*address == MAP_FAILED) return -errno; - return 0; -} - - -/** - * \brief Unmap mappings obtained with drmMap(). - * - * \param address address as given by drmMap(). - * \param size size in bytes. Must match the size used by drmMap(). - * - * \return zero on success, or a negative value on failure. - * - * \internal - * This function is a wrapper for unmap(). - */ -int drmUnmap(drmAddress address, drmSize size) -{ - return munmap(address, size); -} - - -/** - * \brief Map all DMA buffers into client-virtual space. - * - * \param fd file descriptor. - * - * \return a pointer to a ::drmBufMap structure. - * - * \note The client may not use these buffers until obtaining buffer indices - * with drmDMA(). - * - * \internal - * This function calls the DRM_IOCTL_MAP_BUFS ioctl and copies the returned - * information about the buffers in a drm_buf_map structure into the - * client-visible data structures. - */ -drmBufMapPtr drmMapBufs(int fd) -{ - drm_buf_map_t bufs; - drmBufMapPtr retval; - int i; - - bufs.count = 0; - bufs.list = NULL; - if (ioctl(fd, DRM_IOCTL_MAP_BUFS, &bufs)) return NULL; - - if (bufs.count) { - if (!(bufs.list = malloc(bufs.count * sizeof(*bufs.list)))) - return NULL; - - if (ioctl(fd, DRM_IOCTL_MAP_BUFS, &bufs)) { - free(bufs.list); - return NULL; - } - /* Now, copy it all back into the - client-visible data structures... */ - retval = malloc(sizeof(*retval)); - retval->count = bufs.count; - retval->list = malloc(bufs.count * sizeof(*retval->list)); - for (i = 0; i < bufs.count; i++) { - retval->list[i].idx = bufs.list[i].idx; - retval->list[i].total = bufs.list[i].total; - retval->list[i].used = 0; - retval->list[i].address = bufs.list[i].address; - } - return retval; - } - return NULL; -} - - -/** - * \brief Unmap buffers allocated with drmMapBufs(). - * - * \return zero on success, or negative value on failure. - * - * \internal - * Calls munmap() for every buffer stored in \p bufs. - */ -int drmUnmapBufs(drmBufMapPtr bufs) -{ - int i; - - for (i = 0; i < bufs->count; i++) { - munmap(bufs->list[i].address, bufs->list[i].total); - } - return 0; -} - - -#define DRM_DMA_RETRY 16 - -/** - * \brief Reserve DMA buffers. - * - * \param fd file descriptor. - * \param request - * - * \return zero on success, or a negative value on failure. - * - * \internal - * Assemble the arguments into a drm_dma structure and keeps issuing the - * DRM_IOCTL_DMA ioctl until success or until maximum number of retries. - */ -int drmDMA(int fd, drmDMAReqPtr request) -{ - drm_dma_t dma; - int ret, i = 0; - - /* Copy to hidden structure */ - dma.context = request->context; - dma.send_count = request->send_count; - dma.send_indices = request->send_list; - dma.send_sizes = request->send_sizes; - dma.flags = request->flags; - dma.request_count = request->request_count; - dma.request_size = request->request_size; - dma.request_indices = request->request_list; - dma.request_sizes = request->request_sizes; - - do { - ret = ioctl( fd, DRM_IOCTL_DMA, &dma ); - } while ( ret && errno == EAGAIN && i++ < DRM_DMA_RETRY ); - - if ( ret == 0 ) { - request->granted_count = dma.granted_count; - return 0; - } else { - return -errno; - } -} - - -/** - * \brief Obtain heavyweight hardware lock. - * - * \param fd file descriptor. - * \param context context. - * \param flags flags that determine the sate of the hardware when the function - * returns. - * - * \return always zero. - * - * \internal - * This function translates the arguments into a drm_lock structure and issue - * the DRM_IOCTL_LOCK ioctl until the lock is successfully acquired. - */ -int drmGetLock(int fd, drmContext context, drmLockFlags flags) -{ - drm_lock_t lock; - - lock.context = context; - lock.flags = 0; - if (flags & DRM_LOCK_READY) lock.flags |= _DRM_LOCK_READY; - if (flags & DRM_LOCK_QUIESCENT) lock.flags |= _DRM_LOCK_QUIESCENT; - if (flags & DRM_LOCK_FLUSH) lock.flags |= _DRM_LOCK_FLUSH; - if (flags & DRM_LOCK_FLUSH_ALL) lock.flags |= _DRM_LOCK_FLUSH_ALL; - if (flags & DRM_HALT_ALL_QUEUES) lock.flags |= _DRM_HALT_ALL_QUEUES; - if (flags & DRM_HALT_CUR_QUEUES) lock.flags |= _DRM_HALT_CUR_QUEUES; - - while (ioctl(fd, DRM_IOCTL_LOCK, &lock)) - ; - return 0; -} - -static void (*drm_unlock_callback)( void ) = 0; - -/** - * \brief Release the hardware lock. - * - * \param fd file descriptor. - * \param context context. - * - * \return zero on success, or a negative value on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_UNLOCK ioctl, passing the - * argument in a drm_lock structure. - */ -int drmUnlock(int fd, drmContext context) -{ - drm_lock_t lock; - int ret; - - lock.context = context; - lock.flags = 0; - ret = ioctl(fd, DRM_IOCTL_UNLOCK, &lock); - - /* Need this to synchronize vt releasing. Could also teach fbdev - * about the drm lock... - */ - if (drm_unlock_callback) { - drm_unlock_callback(); - } - - return ret; -} - - -/** - * \brief Create context. - * - * Used by the X server during GLXContext initialization. This causes - * per-context kernel-level resources to be allocated. - * - * \param fd file descriptor. - * \param handle is set on success. To be used by the client when requesting DMA - * dispatch with drmDMA(). - * - * \return zero on success, or a negative value on failure. - * - * \note May only be called by root. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_ADD_CTX ioctl, passing the - * argument in a drm_ctx structure. - */ -int drmCreateContext(int fd, drmContextPtr handle) -{ - drm_ctx_t ctx; - - ctx.flags = 0; /* Modified with functions below */ - if (ioctl(fd, DRM_IOCTL_ADD_CTX, &ctx)) return -errno; - *handle = ctx.handle; - return 0; -} - - -/** - * \brief Destroy context. - * - * Free any kernel-level resources allocated with drmCreateContext() associated - * with the context. - * - * \param fd file descriptor. - * \param handle handle given by drmCreateContext(). - * - * \return zero on success, or a negative value on failure. - * - * \note May only be called by root. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_RM_CTX ioctl, passing the - * argument in a drm_ctx structure. - */ -int drmDestroyContext(int fd, drmContext handle) -{ - drm_ctx_t ctx; - ctx.handle = handle; - if (ioctl(fd, DRM_IOCTL_RM_CTX, &ctx)) return -errno; - return 0; -} - - -/** - * \brief Acquire the AGP device. - * - * Must be called before any of the other AGP related calls. - * - * \param fd file descriptor. - * - * \return zero on success, or a negative value on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_AGP_ACQUIRE ioctl. - */ -int drmAgpAcquire(int fd) -{ - if (ioctl(fd, DRM_IOCTL_AGP_ACQUIRE, NULL)) return -errno; - return 0; -} - - -/** - * \brief Release the AGP device. - * - * \param fd file descriptor. - * - * \return zero on success, or a negative value on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_AGP_RELEASE ioctl. - */ -int drmAgpRelease(int fd) -{ - if (ioctl(fd, DRM_IOCTL_AGP_RELEASE, NULL)) return -errno; - return 0; -} - - -/** - * \brief Set the AGP mode. - * - * \param fd file descriptor. - * \param mode AGP mode. - * - * \return zero on success, or a negative value on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_AGP_ENABLE ioctl, passing the - * argument in a drm_agp_mode structure. - */ -int drmAgpEnable(int fd, unsigned long mode) -{ - drm_agp_mode_t m; - - m.mode = mode; - if (ioctl(fd, DRM_IOCTL_AGP_ENABLE, &m)) return -errno; - return 0; -} - - -/** - * \brief Allocate a chunk of AGP memory. - * - * \param fd file descriptor. - * \param size requested memory size in bytes. Will be rounded to page boundary. - * \param type type of memory to allocate. - * \param address if not zero, will be set to the physical address of the - * allocated memory. - * \param handle on success will be set to a handle of the allocated memory. - * - * \return zero on success, or a negative value on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_AGP_ALLOC ioctl, passing the - * arguments in a drm_agp_buffer structure. - */ -int drmAgpAlloc(int fd, unsigned long size, unsigned long type, - unsigned long *address, unsigned long *handle) -{ - drm_agp_buffer_t b; - *handle = 0; - b.size = size; - b.handle = 0; - b.type = type; - if (ioctl(fd, DRM_IOCTL_AGP_ALLOC, &b)) return -errno; - if (address != 0UL) *address = b.physical; - *handle = b.handle; - return 0; -} - - -/** - * \brief Free a chunk of AGP memory. - * - * \param fd file descriptor. - * \param handle handle to the allocated memory, as given by drmAgpAllocate(). - * - * \return zero on success, or a negative value on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_AGP_FREE ioctl, passing the - * argument in a drm_agp_buffer structure. - */ -int drmAgpFree(int fd, unsigned long handle) -{ - drm_agp_buffer_t b; - - b.size = 0; - b.handle = handle; - if (ioctl(fd, DRM_IOCTL_AGP_FREE, &b)) return -errno; - return 0; -} - - -/** - * \brief Bind a chunk of AGP memory. - * - * \param fd file descriptor. - * \param handle handle to the allocated memory, as given by drmAgpAllocate(). - * \param offset offset in bytes. It will round to page boundary. - * - * \return zero on success, or a negative value on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_AGP_BIND ioctl, passing the - * argument in a drm_agp_binding structure. - */ -int drmAgpBind(int fd, unsigned long handle, unsigned long offset) -{ - drm_agp_binding_t b; - - b.handle = handle; - b.offset = offset; - if (ioctl(fd, DRM_IOCTL_AGP_BIND, &b)) return -errno; - return 0; -} - - -/** - * \brief Unbind a chunk of AGP memory. - * - * \param fd file descriptor. - * \param handle handle to the allocated memory, as given by drmAgpAllocate(). - * - * \return zero on success, or a negative value on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_AGP_UNBIND ioctl, passing - * the argument in a drm_agp_binding structure. - */ -int drmAgpUnbind(int fd, unsigned long handle) -{ - drm_agp_binding_t b; - - b.handle = handle; - b.offset = 0; - if (ioctl(fd, DRM_IOCTL_AGP_UNBIND, &b)) return -errno; - return 0; -} - - -/** - * \brief Get AGP driver major version number. - * - * \param fd file descriptor. - * - * \return major version number on success, or a negative value on failure.. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the - * necessary information in a drm_agp_info structure. - */ -int drmAgpVersionMajor(int fd) -{ - drm_agp_info_t i; - - if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) return -errno; - return i.agp_version_major; -} - - -/** - * \brief Get AGP driver minor version number. - * - * \param fd file descriptor. - * - * \return minor version number on success, or a negative value on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the - * necessary information in a drm_agp_info structure. - */ -int drmAgpVersionMinor(int fd) -{ - drm_agp_info_t i; - - if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) return -errno; - return i.agp_version_minor; -} - - -/** - * \brief Get AGP mode. - * - * \param fd file descriptor. - * - * \return mode on success, or zero on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the - * necessary information in a drm_agp_info structure. - */ -unsigned long drmAgpGetMode(int fd) -{ - drm_agp_info_t i; - - if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) return 0; - return i.mode; -} - - -/** - * \brief Get AGP aperture base. - * - * \param fd file descriptor. - * - * \return aperture base on success, zero on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the - * necessary information in a drm_agp_info structure. - */ -unsigned long drmAgpBase(int fd) -{ - drm_agp_info_t i; - - if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) return 0; - return i.aperture_base; -} - - -/** - * \brief Get AGP aperture size. - * - * \param fd file descriptor. - * - * \return aperture size on success, zero on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the - * necessary information in a drm_agp_info structure. - */ -unsigned long drmAgpSize(int fd) -{ - drm_agp_info_t i; - - if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) return 0; - return i.aperture_size; -} - - -/** - * \brief Get used AGP memory. - * - * \param fd file descriptor. - * - * \return memory used on success, or zero on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the - * necessary information in a drm_agp_info structure. - */ -unsigned long drmAgpMemoryUsed(int fd) -{ - drm_agp_info_t i; - - if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) return 0; - return i.memory_used; -} - - -/** - * \brief Get available AGP memory. - * - * \param fd file descriptor. - * - * \return memory available on success, or zero on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the - * necessary information in a drm_agp_info structure. - */ -unsigned long drmAgpMemoryAvail(int fd) -{ - drm_agp_info_t i; - - if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) return 0; - return i.memory_allowed; -} - - -/** - * \brief Get hardware vendor ID. - * - * \param fd file descriptor. - * - * \return vendor ID on success, or zero on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the - * necessary information in a drm_agp_info structure. - */ -unsigned int drmAgpVendorId(int fd) -{ - drm_agp_info_t i; - - if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) return 0; - return i.id_vendor; -} - - -/** - * \brief Get hardware device ID. - * - * \param fd file descriptor. - * - * \return zero on success, or zero on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the - * necessary information in a drm_agp_info structure. - */ -unsigned int drmAgpDeviceId(int fd) -{ - drm_agp_info_t i; - - if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) return 0; - return i.id_device; -} - -int drmScatterGatherAlloc(int fd, unsigned long size, unsigned long *handle) -{ - drm_scatter_gather_t sg; - - *handle = 0; - sg.size = size; - sg.handle = 0; - if (ioctl(fd, DRM_IOCTL_SG_ALLOC, &sg)) return -errno; - *handle = sg.handle; - return 0; -} - -int drmScatterGatherFree(int fd, unsigned long handle) -{ - drm_scatter_gather_t sg; - - sg.size = 0; - sg.handle = handle; - if (ioctl(fd, DRM_IOCTL_SG_FREE, &sg)) return -errno; - return 0; -} - -/** - * \brief Wait for VBLANK. - * - * \param fd file descriptor. - * \param vbl pointer to a drmVBlank structure. - * - * \return zero on success, or a negative value on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_WAIT_VBLANK ioctl. - */ -int drmWaitVBlank(int fd, drmVBlankPtr vbl) -{ - int ret; - - do { - ret = ioctl(fd, DRM_IOCTL_WAIT_VBLANK, vbl); - } while (ret && errno == EINTR); - - return ret; -} - - -/** - * \brief Install IRQ handler. - * - * \param fd file descriptor. - * \param irq IRQ number. - * - * \return zero on success, or a negative value on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_CONTROL ioctl, passing the - * argument in a drm_control structure. - */ -int drmCtlInstHandler(int fd, int irq) -{ - drm_control_t ctl; - - ctl.func = DRM_INST_HANDLER; - ctl.irq = irq; - if (ioctl(fd, DRM_IOCTL_CONTROL, &ctl)) return -errno; - return 0; -} - - -/** - * \brief Uninstall IRQ handler. - * - * \param fd file descriptor. - * - * \return zero on success, or a negative value on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_CONTROL ioctl, passing the - * argument in a drm_control structure. - */ -int drmCtlUninstHandler(int fd) -{ - drm_control_t ctl; - - ctl.func = DRM_UNINST_HANDLER; - ctl.irq = 0; - if (ioctl(fd, DRM_IOCTL_CONTROL, &ctl)) return -errno; - return 0; -} - - -/** - * \brief Get IRQ from bus ID. - * - * \param fd file descriptor. - * \param busnum bus number. - * \param devnum device number. - * \param funcnum function number. - * - * \return IRQ number on success, or a negative value on failure. - * - * \internal - * This function is a wrapper around the DRM_IOCTL_IRQ_BUSID ioctl, passing the - * arguments in a drm_irq_busid structure. - */ -int drmGetInterruptFromBusID(int fd, int busnum, int devnum, int funcnum) -{ - drm_irq_busid_t p; - - p.busnum = busnum; - p.devnum = devnum; - p.funcnum = funcnum; - if (ioctl(fd, DRM_IOCTL_IRQ_BUSID, &p)) return -errno; - return p.irq; -} - - -/** - * \brief Send a device-specific command. - * - * \param fd file descriptor. - * \param drmCommandIndex command index - * - * \return zero on success, or a negative value on failure. - * - * \internal - * It issues a ioctl given by - * \code DRM_COMMAND_BASE + drmCommandIndex \endcode. - */ -int drmCommandNone(int fd, unsigned long drmCommandIndex) -{ - void *data = NULL; /* dummy */ - unsigned long request; - - request = DRM_IO( DRM_COMMAND_BASE + drmCommandIndex); - - if (ioctl(fd, request, data)) { - return -errno; - } - return 0; -} - - -/** - * \brief Send a device-specific read command. - * - * \param fd file descriptor. - * \param drmCommandIndex command index - * \param data destination pointer of the data to be read. - * \param size size of the data to be read. - * - * \return zero on success, or a negative value on failure. - * - * \internal - * It issues a read ioctl given by - * \code DRM_COMMAND_BASE + drmCommandIndex \endcode. - */ -int drmCommandRead(int fd, unsigned long drmCommandIndex, - void *data, unsigned long size ) -{ - unsigned long request; - - request = DRM_IOC( DRM_IOC_READ, DRM_IOCTL_BASE, - DRM_COMMAND_BASE + drmCommandIndex, size); - - if (ioctl(fd, request, data)) { - return -errno; - } - return 0; -} - - -/** - * \brief Send a device-specific write command. - * - * \param fd file descriptor. - * \param drmCommandIndex command index - * \param data source pointer of the data to be written. - * \param size size of the data to be written. - * - * \return zero on success, or a negative value on failure. - * - * \internal - * It issues a write ioctl given by - * \code DRM_COMMAND_BASE + drmCommandIndex \endcode. - */ -int drmCommandWrite(int fd, unsigned long drmCommandIndex, - void *data, unsigned long size ) -{ - unsigned long request; - - request = DRM_IOC( DRM_IOC_WRITE, DRM_IOCTL_BASE, - DRM_COMMAND_BASE + drmCommandIndex, size); - - if (ioctl(fd, request, data)) { - return -errno; - } - return 0; -} - - -/** - * \brief Send a device-specific read-write command. - * - * \param fd file descriptor. - * \param drmCommandIndex command index - * \param data source pointer of the data to be read and written. - * \param size size of the data to be read and written. - * - * \return zero on success, or a negative value on failure. - * - * \internal - * It issues a read-write ioctl given by - * \code DRM_COMMAND_BASE + drmCommandIndex \endcode. - */ -int drmCommandWriteRead(int fd, unsigned long drmCommandIndex, - void *data, unsigned long size ) -{ - unsigned long request; - - request = DRM_IOC( DRM_IOC_READ|DRM_IOC_WRITE, DRM_IOCTL_BASE, - DRM_COMMAND_BASE + drmCommandIndex, size); - - if (ioctl(fd, request, data)) { - return -errno; - } - return 0; -} - diff --git a/src/glx/mini/xf86drm.h b/src/glx/mini/xf86drm.h deleted file mode 100644 index cee5ca5f696..00000000000 --- a/src/glx/mini/xf86drm.h +++ /dev/null @@ -1,609 +0,0 @@ -/* xf86drm.h -- OS-independent header for DRM user-level library interface - * Created: Tue Jan 5 08:17:23 1999 by faith@precisioninsight.com - * - * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas. - * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. - * 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 (including the next - * paragraph) 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 - * PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. - * - * Author: Rickard E. (Rik) Faith - * - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h,v 1.22 2003/06/12 14:12:35 eich Exp $ - * - */ - -#ifndef _XF86DRM_H_ -#define _XF86DRM_H_ - - /* Defaults, if nothing set in xf86config */ -#define DRM_DEV_UID 0 -#define DRM_DEV_GID 0 -/* Default /dev/dri directory permissions 0755 */ -#define DRM_DEV_DIRMODE \ - (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) -#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) - -#define DRM_DIR_NAME "/dev/dri" -#define DRM_DEV_NAME "%s/card%d" -#define DRM_PROC_NAME "/proc/dri/" /* For backware Linux compatibility */ - -#define DRM_ERR_NO_DEVICE (-1001) -#define DRM_ERR_NO_ACCESS (-1002) -#define DRM_ERR_NOT_ROOT (-1003) -#define DRM_ERR_INVALID (-1004) -#define DRM_ERR_NO_FD (-1005) - -#define DRM_AGP_NO_HANDLE 0 - -typedef unsigned long drmHandle, *drmHandlePtr; /* To mapped regions */ -typedef unsigned int drmSize, *drmSizePtr; /* For mapped regions */ -typedef void *drmAddress, **drmAddressPtr; /* For mapped regions */ -typedef unsigned int drmContext, *drmContextPtr; /* GLXContext handle */ -typedef unsigned int drmDrawable, *drmDrawablePtr; /* Unused */ -typedef unsigned int drmMagic, *drmMagicPtr; /* Magic for auth */ - -typedef struct _drmVersion { - int version_major; /* Major version */ - int version_minor; /* Minor version */ - int version_patchlevel; /* Patch level */ - int name_len; /* Length of name buffer */ - char *name; /* Name of driver */ - int date_len; /* Length of date buffer */ - char *date; /* User-space buffer to hold date */ - int desc_len; /* Length of desc buffer */ - char *desc; /* User-space buffer to hold desc */ -} drmVersion, *drmVersionPtr; - -typedef struct _drmStats { - unsigned long count; /* Number of data */ - struct { - unsigned long value; /* Value from kernel */ - const char *long_format; /* Suggested format for long_name */ - const char *long_name; /* Long name for value */ - const char *rate_format; /* Suggested format for rate_name */ - const char *rate_name; /* Short name for value per second */ - int isvalue; /* True if value (vs. counter) */ - const char *mult_names; /* Multiplier names (e.g., "KGM") */ - int mult; /* Multiplier value (e.g., 1024) */ - int verbose; /* Suggest only in verbose output */ - } data[15]; -} drmStatsT; - - - /* All of these enums *MUST* match with the - kernel implementation -- so do *NOT* - change them! (The drmlib implementation - will just copy the flags instead of - translating them.) */ -typedef enum { - DRM_FRAME_BUFFER = 0, /* WC, no caching, no core dump */ - DRM_REGISTERS = 1, /* no caching, no core dump */ - DRM_SHM = 2, /* shared, cached */ - DRM_AGP = 3, /* AGP/GART */ - DRM_SCATTER_GATHER = 4 /* PCI scatter/gather */ -} drmMapType; - -typedef enum { - DRM_RESTRICTED = 0x0001, /* Cannot be mapped to client-virtual */ - DRM_READ_ONLY = 0x0002, /* Read-only in client-virtual */ - DRM_LOCKED = 0x0004, /* Physical pages locked */ - DRM_KERNEL = 0x0008, /* Kernel requires access */ - DRM_WRITE_COMBINING = 0x0010, /* Use write-combining, if available */ - DRM_CONTAINS_LOCK = 0x0020, /* SHM page that contains lock */ - DRM_REMOVABLE = 0x0040 /* Removable mapping */ -} drmMapFlags; - -typedef enum { /* These values *MUST* match drm.h */ - /* Flags for DMA buffer dispatch */ - DRM_DMA_BLOCK = 0x01, /* Block until buffer dispatched. Note, - the buffer may not yet have been - processed by the hardware -- getting a - hardware lock with the hardware - quiescent will ensure that the buffer - has been processed. */ - DRM_DMA_WHILE_LOCKED = 0x02, /* Dispatch while lock held */ - DRM_DMA_PRIORITY = 0x04, /* High priority dispatch */ - - /* Flags for DMA buffer request */ - DRM_DMA_WAIT = 0x10, /* Wait for free buffers */ - DRM_DMA_SMALLER_OK = 0x20, /* Smaller-than-requested buffers ok */ - DRM_DMA_LARGER_OK = 0x40 /* Larger-than-requested buffers ok */ -} drmDMAFlags; - -typedef enum { - DRM_PAGE_ALIGN = 0x01, - DRM_AGP_BUFFER = 0x02, - DRM_SG_BUFFER = 0x04 -} drmBufDescFlags; - -typedef enum { - DRM_LOCK_READY = 0x01, /* Wait until hardware is ready for DMA */ - DRM_LOCK_QUIESCENT = 0x02, /* Wait until hardware quiescent */ - DRM_LOCK_FLUSH = 0x04, /* Flush this context's DMA queue first */ - DRM_LOCK_FLUSH_ALL = 0x08, /* Flush all DMA queues first */ - /* These *HALT* flags aren't supported yet - -- they will be used to support the - full-screen DGA-like mode. */ - DRM_HALT_ALL_QUEUES = 0x10, /* Halt all current and future queues */ - DRM_HALT_CUR_QUEUES = 0x20 /* Halt all current queues */ -} drmLockFlags; - -typedef enum { - DRM_CONTEXT_PRESERVED = 0x01, /* This context is preserved and - never swapped. */ - DRM_CONTEXT_2DONLY = 0x02 /* This context is for 2D rendering only. */ -} drmContextFlags, *drmContextFlagsPtr; - -typedef struct _drmBufDesc { - int count; /* Number of buffers of this size */ - int size; /* Size in bytes */ - int low_mark; /* Low water mark */ - int high_mark; /* High water mark */ -} drmBufDesc, *drmBufDescPtr; - -typedef struct _drmBufInfo { - int count; /* Number of buffers described in list */ - drmBufDescPtr list; /* List of buffer descriptions */ -} drmBufInfo, *drmBufInfoPtr; - -typedef struct _drmBuf { - int idx; /* Index into master buflist */ - int total; /* Buffer size */ - int used; /* Amount of buffer in use (for DMA) */ - drmAddress address; /* Address */ -} drmBuf, *drmBufPtr; - -typedef struct _drmBufMap { - int count; /* Number of buffers mapped */ - drmBufPtr list; /* Buffers */ -} drmBufMap, *drmBufMapPtr; - -typedef struct _drmLock { - volatile unsigned int lock; - char padding[60]; - /* This is big enough for most current (and future?) architectures: - DEC Alpha: 32 bytes - Intel Merced: ? - Intel P5/PPro/PII/PIII: 32 bytes - Intel StrongARM: 32 bytes - Intel i386/i486: 16 bytes - MIPS: 32 bytes (?) - Motorola 68k: 16 bytes - Motorola PowerPC: 32 bytes - Sun SPARC: 32 bytes - */ -} drmLock, *drmLockPtr; - -typedef struct _drmDMAReq { - /* Indices here refer to the offset into - list in drmBufInfo */ - drmContext context; /* Context handle */ - int send_count; /* Number of buffers to send */ - int *send_list; /* List of handles to buffers */ - int *send_sizes; /* Lengths of data to send, in bytes */ - drmDMAFlags flags; /* Flags */ - int request_count; /* Number of buffers requested */ - int request_size; /* Desired size of buffers requested */ - int *request_list; /* Buffer information */ - int *request_sizes; /* Minimum acceptable sizes */ - int granted_count; /* Number of buffers granted at this size */ -} drmDMAReq, *drmDMAReqPtr; - -typedef struct _drmRegion { - drmHandle handle; - unsigned int offset; - drmSize size; - drmAddress map; -} drmRegion, *drmRegionPtr; - -typedef struct _drmTextureRegion { - unsigned char next; - unsigned char prev; - unsigned char in_use; - unsigned char padding; /* Explicitly pad this out */ - unsigned int age; -} drmTextureRegion, *drmTextureRegionPtr; - - -typedef struct _drmClipRect { - unsigned short x1; /* Upper left: inclusive */ - unsigned short y1; - unsigned short x2; /* Lower right: exclusive */ - unsigned short y2; -} drmClipRect, *drmClipRectPtr; - - -typedef enum { - DRM_VBLANK_ABSOLUTE = 0x0, /* Wait for specific vblank sequence number */ - DRM_VBLANK_RELATIVE = 0x1, /* Wait for given number of vblanks */ - DRM_VBLANK_SIGNAL = 0x40000000 /* Send signal instead of blocking */ -} drmVBlankSeqType; - -typedef struct _drmVBlankReq { - drmVBlankSeqType type; - unsigned int sequence; - unsigned long signal; -} drmVBlankReq, *drmVBlankReqPtr; - -typedef struct _drmVBlankReply { - drmVBlankSeqType type; - unsigned int sequence; - long tval_sec; - long tval_usec; -} drmVBlankReply, *drmVBlankReplyPtr; - -typedef union _drmVBlank { - drmVBlankReq request; - drmVBlankReply reply; -} drmVBlank, *drmVBlankPtr; - - - -#define __drm_dummy_lock(lock) (*(__volatile__ unsigned int *)lock) - -#define DRM_LOCK_HELD 0x80000000 /* Hardware lock is held */ -#define DRM_LOCK_CONT 0x40000000 /* Hardware lock is contended */ - -#if defined(__GNUC__) && (__GNUC__ >= 2) -# if defined(__i386) || defined(__AMD64__) - /* Reflect changes here to drmP.h */ -#define DRM_CAS(lock,old,new,__ret) \ - do { \ - int __dummy; /* Can't mark eax as clobbered */ \ - __asm__ __volatile__( \ - "lock ; cmpxchg %4,%1\n\t" \ - "setnz %0" \ - : "=d" (__ret), \ - "=m" (__drm_dummy_lock(lock)), \ - "=a" (__dummy) \ - : "2" (old), \ - "r" (new)); \ - } while (0) - -#elif defined(__alpha__) - -#define DRM_CAS(lock, old, new, ret) \ - do { \ - int old32; \ - int cur32; \ - __asm__ __volatile__( \ - " mb\n" \ - " zap %4, 0xF0, %0\n" \ - " ldl_l %1, %2\n" \ - " zap %1, 0xF0, %1\n" \ - " cmpeq %0, %1, %1\n" \ - " beq %1, 1f\n" \ - " bis %5, %5, %1\n" \ - " stl_c %1, %2\n" \ - "1: xor %1, 1, %1\n" \ - " stl %1, %3" \ - : "+r" (old32), \ - "+&r" (cur32), \ - "=m" (__drm_dummy_lock(lock)),\ - "=m" (ret) \ - : "r" (old), \ - "r" (new)); \ - } while(0) - -#elif defined(__sparc__) - -#define DRM_CAS(lock,old,new,__ret) \ -do { register unsigned int __old __asm("o0"); \ - register unsigned int __new __asm("o1"); \ - register volatile unsigned int *__lock __asm("o2"); \ - __old = old; \ - __new = new; \ - __lock = (volatile unsigned int *)lock; \ - __asm__ __volatile__( \ - /*"cas [%2], %3, %0"*/ \ - ".word 0xd3e29008\n\t" \ - /*"membar #StoreStore | #StoreLoad"*/ \ - ".word 0x8143e00a" \ - : "=&r" (__new) \ - : "0" (__new), \ - "r" (__lock), \ - "r" (__old) \ - : "memory"); \ - __ret = (__new != __old); \ -} while(0) - -#elif defined(__ia64__) - -#if 0 -/* this currently generates bad code (missing stop bits)... */ -#include - -#define DRM_CAS(lock,old,new,__ret) \ - do { \ - __ret = (__sync_val_compare_and_swap(&__drm_dummy_lock(lock), \ - (old), (new)) \ - != (old)); \ - } while (0) - -#else -#define DRM_CAS(lock,old,new,__ret) \ - do { \ - unsigned int __result, __old = (old); \ - __asm__ __volatile__( \ - "mf\n" \ - "mov ar.ccv=%2\n" \ - ";;\n" \ - "cmpxchg4.acq %0=%1,%3,ar.ccv" \ - : "=r" (__result), "=m" (__drm_dummy_lock(lock)) \ - : "r" (__old), "r" (new) \ - : "memory"); \ - __ret = (__result) != (__old); \ - } while (0) - -#endif - -#elif defined(__powerpc__) - -#define DRM_CAS(lock,old,new,__ret) \ - do { \ - __asm__ __volatile__( \ - "sync;" \ - "0: lwarx %0,0,%1;" \ - " xor. %0,%3,%0;" \ - " bne 1f;" \ - " stwcx. %2,0,%1;" \ - " bne- 0b;" \ - "1: " \ - "sync;" \ - : "=&r"(__ret) \ - : "r"(lock), "r"(new), "r"(old) \ - : "cr0", "memory"); \ - } while (0) - -#endif /* architecture */ -#endif /* __GNUC__ >= 2 */ - -#ifndef DRM_CAS -#define DRM_CAS(lock,old,new,ret) do { ret=1; } while (0) /* FAST LOCK FAILS */ -#endif - -#if defined(__alpha__) || defined(__powerpc__) -#define DRM_CAS_RESULT(_result) int _result -#else -#define DRM_CAS_RESULT(_result) char _result -#endif - -#define DRM_LIGHT_LOCK(fd,lock,context) \ - do { \ - DRM_CAS_RESULT(__ret); \ - DRM_CAS(lock,context,DRM_LOCK_HELD|context,__ret); \ - if (__ret) drmGetLock(fd,context,0); \ - } while(0) - - /* This one counts fast locks -- for - benchmarking only. */ -#define DRM_LIGHT_LOCK_COUNT(fd,lock,context,count) \ - do { \ - DRM_CAS_RESULT(__ret); \ - DRM_CAS(lock,context,DRM_LOCK_HELD|context,__ret); \ - if (__ret) drmGetLock(fd,context,0); \ - else ++count; \ - } while(0) - -#define DRM_LOCK(fd,lock,context,flags) \ - do { \ - if (flags) drmGetLock(fd,context,flags); \ - else DRM_LIGHT_LOCK(fd,lock,context); \ - } while(0) - -#define DRM_UNLOCK(fd,lock,context) \ - do { \ - DRM_CAS_RESULT(__ret); \ - DRM_CAS(lock,DRM_LOCK_HELD|context,context,__ret); \ - if (__ret) drmUnlock(fd,context); \ - } while(0) - - /* Simple spin locks */ -#define DRM_SPINLOCK(spin,val) \ - do { \ - DRM_CAS_RESULT(__ret); \ - do { \ - DRM_CAS(spin,0,val,__ret); \ - if (__ret) while ((spin)->lock); \ - } while (__ret); \ - } while(0) - -#define DRM_SPINLOCK_TAKE(spin,val) \ - do { \ - DRM_CAS_RESULT(__ret); \ - int cur; \ - do { \ - cur = (*spin).lock; \ - DRM_CAS(spin,cur,val,__ret); \ - } while (__ret); \ - } while(0) - -#define DRM_SPINLOCK_COUNT(spin,val,count,__ret) \ - do { \ - int __i; \ - __ret = 1; \ - for (__i = 0; __ret && __i < count; __i++) { \ - DRM_CAS(spin,0,val,__ret); \ - if (__ret) for (;__i < count && (spin)->lock; __i++); \ - } \ - } while(0) - -#define DRM_SPINUNLOCK(spin,val) \ - do { \ - DRM_CAS_RESULT(__ret); \ - if ((*spin).lock == val) { /* else server stole lock */ \ - do { \ - DRM_CAS(spin,val,0,__ret); \ - } while (__ret); \ - } \ - } while(0) - -/* General user-level programmer's API: unprivileged */ -extern int drmAvailable(void); -extern int drmOpen(const char *name, const char *busid); -extern int drmClose(int fd); -extern drmVersionPtr drmGetVersion(int fd); -extern drmVersionPtr drmGetLibVersion(int fd); -extern void drmFreeVersion(drmVersionPtr); -extern int drmGetMagic(int fd, drmMagicPtr magic); -extern char *drmGetBusid(int fd); -extern int drmGetInterruptFromBusID(int fd, int busnum, int devnum, - int funcnum); -extern int drmGetMap(int fd, int idx, drmHandle *offset, - drmSize *size, drmMapType *type, - drmMapFlags *flags, drmHandle *handle, - int *mtrr); -extern int drmGetClient(int fd, int idx, int *auth, int *pid, - int *uid, unsigned long *magic, - unsigned long *iocs); -extern int drmGetStats(int fd, drmStatsT *stats); -extern int drmCommandNone(int fd, unsigned long drmCommandIndex); -extern int drmCommandRead(int fd, unsigned long drmCommandIndex, - void *data, unsigned long size); -extern int drmCommandWrite(int fd, unsigned long drmCommandIndex, - void *data, unsigned long size); -extern int drmCommandWriteRead(int fd, unsigned long drmCommandIndex, - void *data, unsigned long size); - -/* General user-level programmer's API: X server (root) only */ -extern void drmFreeBusid(const char *busid); -extern int drmSetBusid(int fd, const char *busid); -extern int drmAuthMagic(int fd, drmMagic magic); -extern int drmAddMap(int fd, - drmHandle offset, - drmSize size, - drmMapType type, - drmMapFlags flags, - drmHandlePtr handle); -extern int drmRmMap(int fd, drmHandle handle); -extern int drmAddContextPrivateMapping(int fd, drmContext ctx_id, - drmHandle handle); - -extern int drmAddBufs(int fd, int count, int size, - drmBufDescFlags flags, - int agp_offset); -extern int drmMarkBufs(int fd, double low, double high); -extern int drmCreateContext(int fd, drmContextPtr handle); -extern int drmSetContextFlags(int fd, drmContext context, - drmContextFlags flags); -extern int drmGetContextFlags(int fd, drmContext context, - drmContextFlagsPtr flags); -extern int drmAddContextTag(int fd, drmContext context, void *tag); -extern int drmDelContextTag(int fd, drmContext context); -extern void *drmGetContextTag(int fd, drmContext context); -extern drmContextPtr drmGetReservedContextList(int fd, int *count); -extern void drmFreeReservedContextList(drmContextPtr); -extern int drmSwitchToContext(int fd, drmContext context); -extern int drmDestroyContext(int fd, drmContext handle); -extern int drmCreateDrawable(int fd, drmDrawablePtr handle); -extern int drmDestroyDrawable(int fd, drmDrawable handle); -extern int drmCtlInstHandler(int fd, int irq); -extern int drmCtlUninstHandler(int fd); -extern int drmInstallSIGIOHandler(int fd, - void (*f)(int fd, - void *oldctx, - void *newctx)); -extern int drmRemoveSIGIOHandler(int fd); - -/* General user-level programmer's API: authenticated client and/or X */ -extern int drmMap(int fd, - drmHandle handle, - drmSize size, - drmAddressPtr address); -extern int drmUnmap(drmAddress address, drmSize size); -extern drmBufInfoPtr drmGetBufInfo(int fd); -extern drmBufMapPtr drmMapBufs(int fd); -extern int drmUnmapBufs(drmBufMapPtr bufs); -extern int drmDMA(int fd, drmDMAReqPtr request); -extern int drmFreeBufs(int fd, int count, int *list); -extern int drmGetLock(int fd, - drmContext context, - drmLockFlags flags); -extern int drmUnlock(int fd, drmContext context); -extern int drmFinish(int fd, int context, drmLockFlags flags); -extern int drmGetContextPrivateMapping(int fd, drmContext ctx_id, - drmHandlePtr handle); - -/* AGP/GART support: X server (root) only */ -extern int drmAgpAcquire(int fd); -extern int drmAgpRelease(int fd); -extern int drmAgpEnable(int fd, unsigned long mode); -extern int drmAgpAlloc(int fd, unsigned long size, - unsigned long type, unsigned long *address, - unsigned long *handle); -extern int drmAgpFree(int fd, unsigned long handle); -extern int drmAgpBind(int fd, unsigned long handle, - unsigned long offset); -extern int drmAgpUnbind(int fd, unsigned long handle); - -/* AGP/GART info: authenticated client and/or X */ -extern int drmAgpVersionMajor(int fd); -extern int drmAgpVersionMinor(int fd); -extern unsigned long drmAgpGetMode(int fd); -extern unsigned long drmAgpBase(int fd); /* Physical location */ -extern unsigned long drmAgpSize(int fd); /* Bytes */ -extern unsigned long drmAgpMemoryUsed(int fd); -extern unsigned long drmAgpMemoryAvail(int fd); -extern unsigned int drmAgpVendorId(int fd); -extern unsigned int drmAgpDeviceId(int fd); - -/* PCI scatter/gather support: X server (root) only */ -extern int drmScatterGatherAlloc(int fd, unsigned long size, - unsigned long *handle); -extern int drmScatterGatherFree(int fd, unsigned long handle); - -extern int drmWaitVBlank(int fd, drmVBlankPtr vbl); - -/* Support routines */ -extern int drmError(int err, const char *label); -extern void *drmMalloc(int size); -extern void drmFree(void *pt); - -/* Hash table routines */ -extern void *drmHashCreate(void); -extern int drmHashDestroy(void *t); -extern int drmHashLookup(void *t, unsigned long key, void **value); -extern int drmHashInsert(void *t, unsigned long key, void *value); -extern int drmHashDelete(void *t, unsigned long key); -extern int drmHashFirst(void *t, unsigned long *key, void **value); -extern int drmHashNext(void *t, unsigned long *key, void **value); - -/* PRNG routines */ -extern void *drmRandomCreate(unsigned long seed); -extern int drmRandomDestroy(void *state); -extern unsigned long drmRandom(void *state); -extern double drmRandomDouble(void *state); - -/* Skip list routines */ - -extern void *drmSLCreate(void); -extern int drmSLDestroy(void *l); -extern int drmSLLookup(void *l, unsigned long key, void **value); -extern int drmSLInsert(void *l, unsigned long key, void *value); -extern int drmSLDelete(void *l, unsigned long key); -extern int drmSLNext(void *l, unsigned long *key, void **value); -extern int drmSLFirst(void *l, unsigned long *key, void **value); -extern void drmSLDump(void *l); -extern int drmSLLookupNeighbors(void *l, unsigned long key, - unsigned long *prev_key, void **prev_value, - unsigned long *next_key, void **next_value); - -#endif diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template index bcea71a7969..29558c9e291 100644 --- a/src/mesa/drivers/dri/Makefile.template +++ b/src/mesa/drivers/dri/Makefile.template @@ -21,6 +21,7 @@ WINLIB=-L$(MESA)/src/glx/mini MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini INCLUDES = $(MINIGLX_INCLUDES) \ -I$(DRM_SOURCE_PATH)/shared \ + -I$(DRM_SOURCE_PATH)/libdrm \ $(SHARED_INCLUDES) OBJECTS = $(C_SOURCES:.c=.o) \ diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index 276650274d8..cdb65763773 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -558,6 +558,9 @@ extern float driCalculateSwapUsage( __DRIdrawablePrivate *dPriv, int64_t last_swap_ust, int64_t current_ust ); +extern void +(*glXGetProcAddress(const GLubyte *procname))( void ); + #endif /* GLX_DIRECT_RENDERING */ #endif /* _DRI_UTIL_H_ */ diff --git a/src/mesa/drivers/dri/fb/Makefile b/src/mesa/drivers/dri/fb/Makefile index d5fedac481f..dfe7e29212a 100644 --- a/src/mesa/drivers/dri/fb/Makefile +++ b/src/mesa/drivers/dri/fb/Makefile @@ -5,75 +5,24 @@ include $(TOP)/configs/current LIBNAME = fb_dri.so -DRIVER_SOURCES = fb_dri.c +COMMON_SOURCES = \ + ../../common/driverfuncs.c \ + ../common/mm.c \ + ../common/utils.c \ + ../common/texmem.c \ + ../common/vblank.c \ + ../common/dri_util.c \ + ../common/glcontextmodes.c + +DRIVER_SOURCES = \ + fb_dri.c C_SOURCES = \ - $(DRIVER_SOURCES) \ - $(DRI_SOURCES) - - -# Include directories -INCLUDE_DIRS = \ - -I. \ - -I../common \ - -Iserver \ - -I$(TOP)/src/glx/mini \ - -I$(TOP)/include \ - -I$(DRM_SOURCE_PATH)/shared \ - -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ - -I$(TOP)/src/mesa/glapi \ - -I$(TOP)/src/mesa/math \ - -I$(TOP)/src/mesa/transform \ - -I$(TOP)/src/mesa/shader \ - -I$(TOP)/src/mesa/swrast \ - -I$(TOP)/src/mesa/swrast_setup - -# Core Mesa objects -MESA_MODULES = $(TOP)/src/mesa/mesa.a - -# Libraries that the driver shared lib depends on -LIB_DEPS = -lm -lpthread -lc - + $(COMMON_SOURCES) \ + $(DRIVER_SOURCES) ASM_SOURCES = -OBJECTS = $(C_SOURCES:.c=.o) \ - $(ASM_SOURCES:.S=.o) - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: depend $(LIB_DIR)/$(LIBNAME) - - -$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile - CC=$(CC) CXX=$(CXX) $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \ - $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS) - - -depend: $(C_SOURCES) $(ASM_SOURCES) - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \ - > /dev/null 2>&1 - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -clean: - -rm -f *.o server/*.o +symlinks: -include depend diff --git a/src/mesa/drivers/dri/unichrome/server/via_dri.c b/src/mesa/drivers/dri/unichrome/server/via_dri.c index 381f493b7ae..4718935da5b 100644 --- a/src/mesa/drivers/dri/unichrome/server/via_dri.c +++ b/src/mesa/drivers/dri/unichrome/server/via_dri.c @@ -68,9 +68,9 @@ static int VIADRIFinishScreenInit(DRIDriverContext * ctx); /* _SOLO : missing macros normally defined by X code */ #define xf86DrvMsg(a, b, ...) fprintf(stderr, __VA_ARGS__) -#define MMIO_IN8(base, addr) ((*(((volatile CARD8*)base)+(addr)))+0) -#define MMIO_OUT8(base, addr, val) ((*(((volatile CARD8*)base)+(addr)))=((CARD8)val)) -#define MMIO_OUT16(base, addr, val) ((*(volatile CARD16*)(((CARD8*)base)+(addr)))=((CARD16)val)) +#define MMIO_IN8(base, addr) ((*(((volatile uint8_t*)base)+(addr)))+0) +#define MMIO_OUT8(base, addr, val) ((*(((volatile uint8_t*)base)+(addr)))=((uint8_t)val)) +#define MMIO_OUT16(base, addr, val) ((*(volatile uint16_t*)(((uint8_t*)base)+(addr)))=((uint16_t)val)) #define VIDEO 0 #define AGP 1 @@ -99,12 +99,12 @@ static int VIADRIAgpInit(const DRIDriverContext *ctx, VIAPtr pVia) if (drmAgpAcquire(pVia->drmFD) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAgpAcquire failed %d\n", errno); - return FALSE; + return GL_FALSE; } if (drmAgpEnable(pVia->drmFD, drmAgpGetMode(pVia->drmFD)&~0x0) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAgpEnable failed\n"); - return FALSE; + return GL_FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] drmAgpEnabled succeeded\n"); @@ -113,7 +113,7 @@ static int VIADRIAgpInit(const DRIDriverContext *ctx, VIAPtr pVia) xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAgpAlloc failed\n"); drmAgpRelease(pVia->drmFD); - return FALSE; + return GL_FALSE; } if (drmAgpBind(pVia->drmFD, pVia->agpHandle, 0) < 0) { @@ -122,7 +122,7 @@ static int VIADRIAgpInit(const DRIDriverContext *ctx, VIAPtr pVia) drmAgpFree(pVia->drmFD, pVia->agpHandle); drmAgpRelease(pVia->drmFD); - return FALSE; + return GL_FALSE; } pVia->agpSize = AGP_SIZE; @@ -137,7 +137,7 @@ static int VIADRIAgpInit(const DRIDriverContext *ctx, VIAPtr pVia) xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] Failed to map public agp area\n"); pVIADRI->agp.size = 0; - return FALSE; + return GL_FALSE; } /* Map AGP from kernel to Xserver - Not really needed */ drmMap(pVia->drmFD, pVIADRI->agp.handle,pVIADRI->agp.size, @@ -155,7 +155,7 @@ static int VIADRIAgpInit(const DRIDriverContext *ctx, VIAPtr pVia) "[drm] agp physical addr = 0x%08lx\n", agp_phys); drmVIAAgpInit(pVia->drmFD, 0, AGP_SIZE); - return TRUE; + return GL_TRUE; } @@ -169,17 +169,17 @@ static int VIADRIFBInit(DRIDriverContext * ctx, VIAPtr pVia) if (drmVIAFBInit(pVia->drmFD, FBOffset, FBSize) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR,"[drm] failed to init frame buffer area\n"); - return FALSE; + return GL_FALSE; } else { xf86DrvMsg(pScreen->myNum, X_INFO,"[drm] FBFreeStart= 0x%08lx FBFreeEnd= 0x%08lx FBSize= 0x%08lx\n", pVia->FBFreeStart, pVia->FBFreeEnd, FBSize); - return TRUE; + return GL_TRUE; } } static int VIADRIPciInit(DRIDriverContext * ctx, VIAPtr pVia) { - return TRUE; + return GL_TRUE; } static int VIADRIScreenInit(DRIDriverContext * ctx) @@ -194,7 +194,7 @@ static int VIADRIScreenInit(DRIDriverContext * ctx) if (sizeof(drm_sarea_t)+sizeof(VIASAREAPriv) > SAREA_MAX) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Data does not fit in SAREA\n"); - return FALSE; + return GL_FALSE; } ctx->shared.SAREASize = SAREA_MAX; #endif @@ -257,7 +257,7 @@ static int VIADRIScreenInit(DRIDriverContext * ctx) pVIADRI = (VIADRIPtr) CALLOC(sizeof(VIADRIRec)); if (!pVIADRI) { drmClose(ctx->drmFD); - return FALSE; + return GL_FALSE; } pVia->devPrivate = pVIADRI; ctx->driverClientMsg = pVIADRI; @@ -275,7 +275,7 @@ static int VIADRIScreenInit(DRIDriverContext * ctx) if (!(VIADRIFBInit(ctx, pVia))) { VIADRICloseScreen(ctx); xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[dri] frame buffer initialize fial .\n" ); - return FALSE; + return GL_FALSE; } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] frame buffer initialized.\n" ); @@ -283,7 +283,7 @@ static int VIADRIScreenInit(DRIDriverContext * ctx) /* DRIScreenInit doesn't add all the common mappings. Add additional mappings here. */ if (!VIADRIMapInit(ctx, pVia)) { VIADRICloseScreen(ctx); - return FALSE; + return GL_FALSE; } pVIADRI->regs.size = VIA_MMIO_REGSIZE; pVIADRI->regs.map = 0; @@ -301,7 +301,7 @@ static int VIADRIScreenInit(DRIDriverContext * ctx) (drmAddress *)&pVia->MapBase) != 0) { VIADRICloseScreen(ctx); - return FALSE; + return GL_FALSE; } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] mmio mapped.\n" ); @@ -338,7 +338,7 @@ VIADRIFinishScreenInit(DRIDriverContext * ctx) err = drmCreateContext(ctx->drmFD, &ctx->serverContext); if (err != 0) { fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err); - return FALSE; + return GL_FALSE; } DRM_LOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext, 0); @@ -346,7 +346,7 @@ VIADRIFinishScreenInit(DRIDriverContext * ctx) if (!VIADRIKernelInit(ctx, pVia)) { VIADRICloseScreen(ctx); - return FALSE; + return GL_FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, "[dri] kernel data initialized.\n"); @@ -371,7 +371,7 @@ VIADRIFinishScreenInit(DRIDriverContext * ctx) pVIADRI->scrnX=pVIADRI->width; pVIADRI->scrnY=pVIADRI->height; - return TRUE; + return GL_TRUE; } /* Initialize the kernel data structures. */ @@ -383,13 +383,13 @@ static int VIADRIKernelInit(DRIDriverContext * ctx, VIAPtr pVia) drmInfo.fb_offset = pVia->FrameBufferBase; drmInfo.mmio_offset = pVia->registerHandle; if (pVia->IsPCI) - drmInfo.agpAddr = (CARD32)NULL; + drmInfo.agpAddr = (uint32_t)NULL; else - drmInfo.agpAddr = (CARD32)pVia->agpAddr; + drmInfo.agpAddr = (uint32_t)pVia->agpAddr; - if (drmVIAInitMAP(pVia->drmFD, &drmInfo) < 0) return FALSE; + if (drmVIAInitMAP(pVia->drmFD, &drmInfo) < 0) return GL_FALSE; - return TRUE; + return GL_TRUE; } /* Add a map for the MMIO registers */ static int VIADRIMapInit(DRIDriverContext * ctx, VIAPtr pVia) @@ -398,13 +398,13 @@ static int VIADRIMapInit(DRIDriverContext * ctx, VIAPtr pVia) if (drmAddMap(pVia->drmFD, pVia->MmioBase, VIA_MMIO_REGSIZE, DRM_REGISTERS, flags, &pVia->registerHandle) < 0) { - return FALSE; + return GL_FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] register handle = 0x%08lx\n", pVia->registerHandle); - return TRUE; + return GL_TRUE; } const __GLcontextModes __glModes[] = @@ -522,7 +522,7 @@ static void VIADisableMMIO(DRIDriverContext * ctx) static void VIADisableExtendedFIFO(DRIDriverContext *ctx) { VIAPtr pVia = VIAPTR(ctx); - CARD32 dwGE230, dwGE298; + uint32_t dwGE230, dwGE298; /* Cause of exit XWindow will dump back register value, others chipset no * need to set extended fifo value */ @@ -544,8 +544,8 @@ static void VIADisableExtendedFIFO(DRIDriverContext *ctx) static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) { VIAPtr pVia = VIAPTR(ctx); - CARD8 bRegTemp; - CARD32 dwGE230, dwGE298; + uint8_t bRegTemp; + uint32_t dwGE230, dwGE298; switch (pVia->Chipset) { case VIA_CLE266: @@ -565,7 +565,7 @@ static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) bRegTemp &= ~0x7F; bRegTemp |= 0x3F; VGAOUT8(0x3C5, bRegTemp); - pVia->EnableExtendedFIFO = TRUE; + pVia->EnableExtendedFIFO = GL_TRUE; } } else /* Single view or Simultaneoue case */ @@ -584,7 +584,7 @@ static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) bRegTemp &= ~0x7F; bRegTemp |= 0x2F; VGAOUT8(0x3C5, bRegTemp); - pVia->EnableExtendedFIFO = TRUE; + pVia->EnableExtendedFIFO = GL_TRUE; } } /* 3c5.18[0:5] */ @@ -629,7 +629,7 @@ static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) bRegTemp |= 0x17; bRegTemp |= 0x40; /* force the preq always higher than treq */ VGAOUT8(0x3C5, bRegTemp); - pVia->EnableExtendedFIFO = TRUE; + pVia->EnableExtendedFIFO = GL_TRUE; } } break; @@ -665,7 +665,7 @@ static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) bRegTemp |= 0x17; bRegTemp |= 0x40; /* force the preq always higher than treq */ VGAOUT8(0x3C5, bRegTemp); - pVia->EnableExtendedFIFO = TRUE; + pVia->EnableExtendedFIFO = GL_TRUE; } else { if ( (ctx->shared.virtualWidth > 1024) && (ctx->shared.virtualWidth <= 1280) ) @@ -679,7 +679,7 @@ static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) bRegTemp &= ~0x3F; bRegTemp = (bRegTemp) | (0x17); VGAOUT8(0x3C5, bRegTemp); - pVia->EnableExtendedFIFO = TRUE; + pVia->EnableExtendedFIFO = GL_TRUE; } else if ((ctx->shared.virtualWidth > 1280)) { @@ -692,7 +692,7 @@ static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) bRegTemp &= ~0x3F; bRegTemp = (bRegTemp) | (0x1C); VGAOUT8(0x3C5, bRegTemp); - pVia->EnableExtendedFIFO = TRUE; + pVia->EnableExtendedFIFO = GL_TRUE; } else { @@ -740,7 +740,7 @@ static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) SR1C[7:0], SR1D[1:0] (10bits) *=*/ wRegTemp = (pBIOSInfo->offsetWidthByQWord >> 1) + 4; VGAOUT8(0x3c4, 0x1c); - VGAOUT8(0x3c5, (CARD8)(wRegTemp & 0xFF)); + VGAOUT8(0x3c5, (uint8_t)(wRegTemp & 0xFF)); VGAOUT8(0x3c4, 0x1d); bRegTemp = VGAIN8(0x3c5) & ~0x03; VGAOUT8(0x3c5, bRegTemp | ((wRegTemp & 0x300) >> 8)); @@ -786,7 +786,7 @@ static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) SR1C[7:0], SR1D[1:0] (10bits) *=*/ wRegTemp = (pBIOSInfo->offsetWidthByQWord >> 1) + 4; VGAOUT8(0x3c4, 0x1c); - VGAOUT8(0x3c5, (CARD8)(wRegTemp & 0xFF)); + VGAOUT8(0x3c5, (uint8_t)(wRegTemp & 0xFF)); VGAOUT8(0x3c4, 0x1d); bRegTemp = VGAIN8(0x3c5) & ~0x03; VGAOUT8(0x3c5, bRegTemp | ((wRegTemp & 0x300) >> 8)); @@ -814,9 +814,9 @@ static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) static void VIAInitialize2DEngine(DRIDriverContext *ctx) { VIAPtr pVia = VIAPTR(ctx); - CARD32 dwVQStartAddr, dwVQEndAddr; - CARD32 dwVQLen, dwVQStartL, dwVQEndL, dwVQStartEndH; - CARD32 dwGEMode; + uint32_t dwVQStartAddr, dwVQEndAddr; + uint32_t dwVQLen, dwVQStartL, dwVQEndL, dwVQStartEndH; + uint32_t dwGEMode; /* init 2D engine regs to reset 2D engine */ VIASETREG(0x04, 0x0); @@ -958,14 +958,14 @@ static void VIAInitialize3DEngine(DRIDriverContext *ctx) for (i = 0; i <= 0x7D; i++) { - VIASETREG(0x440, (CARD32) i << 24); + VIASETREG(0x440, (uint32_t) i << 24); } VIASETREG(0x43C, 0x00020000); for (i = 0; i <= 0x94; i++) { - VIASETREG(0x440, (CARD32) i << 24); + VIASETREG(0x440, (uint32_t) i << 24); } VIASETREG(0x440, 0x82400000); @@ -975,7 +975,7 @@ static void VIAInitialize3DEngine(DRIDriverContext *ctx) for (i = 0; i <= 0x94; i++) { - VIASETREG(0x440, (CARD32) i << 24); + VIASETREG(0x440, (uint32_t) i << 24); } VIASETREG(0x440, 0x82400000); @@ -983,7 +983,7 @@ static void VIAInitialize3DEngine(DRIDriverContext *ctx) for (i = 0; i <= 0x03; i++) { - VIASETREG(0x440, (CARD32) i << 24); + VIASETREG(0x440, (uint32_t) i << 24); } VIASETREG(0x43C, 0x00030000); diff --git a/src/mesa/drivers/dri/unichrome/server/via_driver.h b/src/mesa/drivers/dri/unichrome/server/via_driver.h index a39af111472..f6f2d58938b 100644 --- a/src/mesa/drivers/dri/unichrome/server/via_driver.h +++ b/src/mesa/drivers/dri/unichrome/server/via_driver.h @@ -77,14 +77,10 @@ #else #include "via_regs.h" -#include "dri.h" +#include "GL/internal/dri_interface.h" #include "via_dri.h" #endif -typedef unsigned char CARD8; -typedef unsigned short CARD16; -typedef enum Bool { FALSE, TRUE } Bool; - /* _SOLO : copied from via_bios.h */ /* System Memory CLK */ #define VIA_MEM_SDR66 0x00 @@ -155,7 +151,7 @@ typedef struct _VIA { int stateMode; VIAModeInfoPtr VIAModeList; #endif - Bool ModeStructInit; + int ModeStructInit; int Bpp, Bpl, ScissB; unsigned PlaneMask; @@ -179,20 +175,20 @@ typedef struct _VIA { unsigned char* FBBase; unsigned char* FBStart; - Bool PrimaryVidMapped; + int PrimaryVidMapped; int dacSpeedBpp; int minClock, maxClock; int MCLK, REFCLK, LCDclk; double refclk_fact; /* Here are all the Options */ - Bool VQEnable; - Bool pci_burst; - Bool NoPCIRetry; - Bool hwcursor; - Bool NoAccel; - Bool shadowFB; - Bool NoDDCValue; + int VQEnable; + int pci_burst; + int NoPCIRetry; + int hwcursor; + int NoAccel; + int shadowFB; + int NoDDCValue; int rotate; #if 0 @@ -216,12 +212,12 @@ typedef struct _VIA { XAAInfoRecPtr AccelInfoRec; xRectangle Rect; #endif - CARD32 SavedCmd; - CARD32 SavedFgColor; - CARD32 SavedBgColor; - CARD32 SavedPattern0; - CARD32 SavedPattern1; - CARD32 SavedPatternAddr; + uint32_t SavedCmd; + uint32_t SavedFgColor; + uint32_t SavedBgColor; + uint32_t SavedPattern0; + uint32_t SavedPattern1; + uint32_t SavedPatternAddr; #if 0 /* Support for Int10 processing */ @@ -235,7 +231,7 @@ typedef struct _VIA { /* Support for DGA */ int numDGAModes; /*DGAModePtr DGAModes;*/ - Bool DGAactive; + int DGAactive; int DGAViewportStatus; /* The various wait handlers. */ @@ -250,8 +246,8 @@ typedef struct _VIA { #endif /* MHS */ - Bool IsSecondary; - Bool HasSecondary; + int IsSecondary; + int HasSecondary; #if 0 /* Capture information */ @@ -259,16 +255,16 @@ typedef struct _VIA { #endif /* - CARD32 Cap0_Deinterlace; - CARD32 Cap1_Deinterlace; + uint32_t Cap0_Deinterlace; + uint32_t Cap1_Deinterlace; - Bool Cap0_FieldSwap; - Bool NoCap0_HFilter; - Bool Capture_OverScanOff; - Bool NoMPEGHQV_VFilter; + int Cap0_FieldSwap; + int NoCap0_HFilter; + int Capture_OverScanOff; + int NoMPEGHQV_VFilter; */ #ifdef XF86DRI - Bool directRenderingEnabled; + int directRenderingEnabled; DRIInfoPtr pDRIInfo; int drmFD; int numVisualConfigs; @@ -276,11 +272,11 @@ typedef struct _VIA { VIAConfigPrivPtr pVisualConfigsPriv; unsigned long agpHandle; unsigned long registerHandle; - CARD32 agpAddr; + uint32_t agpAddr; unsigned char *agpBase; unsigned int agpSize; - Bool IsPCI; - Bool drixinerama; + int IsPCI; + int drixinerama; #else int drmFD; unsigned long agpHandle; @@ -288,18 +284,18 @@ typedef struct _VIA { unsigned long agpAddr; unsigned char *agpBase; unsigned int agpSize; - Bool IsPCI; + int IsPCI; #endif - Bool V4LEnabled; - CARD16 ActiveDevice; /* if SAMM, non-equal pBIOSInfo->ActiveDevice */ + int V4LEnabled; + uint16_t ActiveDevice; /* if SAMM, non-equal pBIOSInfo->ActiveDevice */ unsigned char *CursorImage; - CARD32 CursorFG; - CARD32 CursorBG; - CARD32 CursorMC; + uint32_t CursorFG; + uint32_t CursorBG; + uint32_t CursorMC; unsigned char MemClk; - Bool EnableExtendedFIFO; + int EnableExtendedFIFO; VIADRIPtr devPrivate; } VIARec, *VIAPtr; diff --git a/src/mesa/drivers/dri/unichrome/server/via_priv.h b/src/mesa/drivers/dri/unichrome/server/via_priv.h index c5a8bb9517e..587531b37c2 100644 --- a/src/mesa/drivers/dri/unichrome/server/via_priv.h +++ b/src/mesa/drivers/dri/unichrome/server/via_priv.h @@ -47,8 +47,8 @@ typedef struct { BoxRec AvailFBArea; FBLinearPtr SWOVlinear; - Bool MPEG_ON; - Bool SWVideo_ON; + int MPEG_ON; + int SWVideo_ON; /*To solve the bandwidth issue */ unsigned long gdwUseExtendedFIFO; -- cgit v1.2.3 From 196fb036d68fac6258569270fa9013a4a5e05784 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Jul 2004 13:22:46 +0000 Subject: version 24 from oss.sgi.com --- include/GL/glext.h | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index c3676a723d2..e11736d6428 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -24,7 +24,7 @@ extern "C" { ** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2002 Silicon Graphics, Inc. +** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. ** @@ -52,9 +52,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2004/6/22 */ +/* glext.h last updated 2004/7/26 */ /* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 23 +#define GL_GLEXT_VERSION 24 #ifndef GL_VERSION_1_2 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 @@ -356,7 +356,7 @@ extern "C" { #define GL_DYNAMIC_READ 0x88E9 #define GL_DYNAMIC_COPY 0x88EA #define GL_SAMPLES_PASSED 0x8914 -#define GL_FOG_COORD_SOURCE GL_FOG_COORDINATE_SOURCE +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE #define GL_FOG_COORD GL_FOG_COORDINATE #define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE #define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE @@ -798,6 +798,33 @@ extern "C" { #ifndef GL_ARB_fragment_program_shadow #endif +#ifndef GL_ARB_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#endif + #ifndef GL_EXT_abgr #define GL_ABGR_EXT 0x8000 #endif @@ -2675,6 +2702,11 @@ extern "C" { #define GL_DRAW_BUFFER15_ATI 0x8834 #endif +#ifndef GL_ATI_pixel_format_float +#define GL_TYPE_RGBA_FLOAT_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 +#endif + #ifndef GL_ATI_texture_env_combine3 #define GL_MODULATE_ADD_ATI 0x8744 #define GL_MODULATE_SIGNED_ADD_ATI 0x8745 @@ -3708,6 +3740,18 @@ typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, #define GL_ARB_fragment_program_shadow 1 #endif +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 +#endif + #ifndef GL_EXT_abgr #define GL_EXT_abgr 1 #endif @@ -5734,6 +5778,13 @@ GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *); typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); #endif +#ifndef GL_ATI_pixel_format_float +#define GL_ATI_pixel_format_float 1 +/* This is really a WGL extension, but defines some associated GL enums. + * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string. + */ +#endif + #ifndef GL_ATI_texture_env_combine3 #define GL_ATI_texture_env_combine3 1 #endif -- cgit v1.2.3 From 6ade8a36b63caf93d7ffda8f789e2c94bad12c31 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Jul 2004 13:23:11 +0000 Subject: version 6 from oss.sgi.com --- include/GL/glxext.h | 98 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 86 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/GL/glxext.h b/include/GL/glxext.h index 54620bd4e17..f1e253a0c77 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -24,7 +24,7 @@ extern "C" { ** ** Original Code. The Original Code is: OpenGL Sample Implementation, ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. ** Copyright in any portions created by third parties is as indicated ** elsewhere herein. All Rights Reserved. ** @@ -34,7 +34,7 @@ extern "C" { ** version 1.2.1 Specification. */ -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) #define WIN32_LEAN_AND_MEAN 1 #include #endif @@ -42,6 +42,9 @@ extern "C" { #ifndef APIENTRY #define APIENTRY #endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif #ifndef GLAPI #define GLAPI extern #endif @@ -49,9 +52,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glxext.h last updated 2002/03/22 */ +/* glxext.h last updated 2004/07/26 */ /* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GLX_GLXEXT_VERSION 5 +#define GLX_GLXEXT_VERSION 6 #ifndef GLX_VERSION_1_3 #define GLX_WINDOW_BIT 0x00000001 @@ -279,6 +282,22 @@ extern "C" { #ifndef GLX_OML_sync_control #endif +#ifndef GLX_SGIX_hyperpipe_group +#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 +#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 +#define GLX_BAD_HYPERPIPE_SGIX 92 +#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 +#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 +#define GLX_PIPE_RECT_SGIX 0x00000001 +#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 +#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 +#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 +#define GLX_HYPERPIPE_ID_SGIX 0x8030 +#endif + +#ifndef GLX_MESA_agp_offset +#endif + /*************************************************************/ @@ -410,18 +429,18 @@ typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); #endif -#ifdef _VL_H #ifndef GLX_SGIX_video_source #define GLX_SGIX_video_source 1 +#ifdef _VL_H #ifdef GLX_GLXEXT_PROTOTYPES extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *, int, VLServer, VLPath, int, VLNode); extern void glXDestroyGLXVideoSourceSGIX (Display *, GLXVideoSourceSGIX); #endif /* GLX_GLXEXT_PROTOTYPES */ typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode); typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource); +#endif /* _VL_H */ #endif -#endif /* _VL_H */ #ifndef GLX_EXT_visual_rating #define GLX_EXT_visual_rating 1 #endif @@ -500,16 +519,16 @@ typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype); #endif -#ifdef _DM_BUFFER_H_ #ifndef GLX_SGIX_dmbuffer #define GLX_SGIX_dmbuffer 1 +#ifdef _DM_BUFFER_H_ #ifdef GLX_GLXEXT_PROTOTYPES extern Bool glXAssociateDMPbufferSGIX (Display *, GLXPbufferSGIX, DMparams *, DMbuffer); #endif /* GLX_GLXEXT_PROTOTYPES */ typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer); +#endif /* _DM_BUFFER_H_ */ #endif -#endif /* _DM_BUFFER_H_ */ #ifndef GLX_SGIX_swap_group #define GLX_SGIX_swap_group 1 #ifdef GLX_GLXEXT_PROTOTYPES @@ -576,13 +595,13 @@ typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode); #define GLX_OML_swap_method 1 #endif +#ifndef GLX_OML_sync_control +#define GLX_OML_sync_control 1 #if defined(__STDC_VERSION__) #if __STDC_VERSION__ >= 199901L /* Include ISO C99 integer types for OML_sync_control; need a better test */ #include -#ifndef GLX_OML_sync_control -#define GLX_OML_sync_control 1 #ifdef GLX_GLXEXT_PROTOTYPES extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *); extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *); @@ -595,10 +614,65 @@ typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, i typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc); typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc); -#endif - #endif /* C99 version test */ #endif /* STDC test */ +#endif + +#ifndef GLX_SGIX_hyperpipe_group +#define GLX_SGIX_hyperpipe_group 1 + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int networkId; +} GLXHyperpipeNetworkSGIX; + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int channel; + unsigned int + participationType; + int timeSlice; +} GLXHyperpipeConfigSGIX; + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int srcXOrigin, srcYOrigin, srcWidth, srcHeight; + int destXOrigin, destYOrigin, destWidth, destHeight; +} GLXPipeRect; + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int XOrigin, YOrigin, maxHeight, maxWidth; +} GLXPipeRectLimits; + +#ifdef GLX_GLXEXT_PROTOTYPES +extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *, int *); +extern int glXHyperpipeConfigSGIX (Display *, int, int, GLXHyperpipeConfigSGIX *, int *); +extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *, int, int *); +extern int glXDestroyHyperpipeConfigSGIX (Display *, int); +extern int glXBindHyperpipeSGIX (Display *, int); +extern int glXQueryHyperpipeBestAttribSGIX (Display *, int, int, int, void *, void *); +extern int glXHyperpipeAttribSGIX (Display *, int, int, int, void *); +extern int glXQueryHyperpipeAttribSGIX (Display *, int, int, int, void *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes); +typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId); +typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes); +typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList); +typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList); +typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList); +#endif + +#ifndef GLX_MESA_agp_offset +#define GLX_MESA_agp_offset 1 +#ifdef GLX_GLXEXT_PROTOTYPES +extern unsigned int glXGetAGPOffsetMESA (const void *); +#endif /* GLX_GLXEXT_PROTOTYPES */ +typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer); +#endif + #ifdef __cplusplus } -- cgit v1.2.3 From ac07d89fd37cb2b145c175b5557ef0475179c7f3 Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Mon, 16 Aug 2004 08:39:36 +0000 Subject: Stupid me. I don't know why I moved the GLView.h here at first, but now I know why I shouldn't: Official BeOS GLView.h defines a virtual ErrorCallback(GLenum) method, assuming a unsigned long GLenum. But under Mesa, GLenum is unsigned int. To keep binary compatibility, BeOS apps including Mesa GL/gl.h MUST include *our* GLView.h, or linker will report a missing ErrorCallback(unsigned int) symbol. Glup. --- include/GLView.h | 192 +++++++++++++++++++++++++++++++++++++++ src/mesa/drivers/beos/GLView.cpp | 2 +- src/mesa/drivers/beos/GLView.h | 192 --------------------------------------- 3 files changed, 193 insertions(+), 193 deletions(-) create mode 100644 include/GLView.h delete mode 100644 src/mesa/drivers/beos/GLView.h (limited to 'include') diff --git a/include/GLView.h b/include/GLView.h new file mode 100644 index 00000000000..8d9d25bb1cb --- /dev/null +++ b/include/GLView.h @@ -0,0 +1,192 @@ +/******************************************************************************* +/ +/ File: GLView.h +/ +/ Copyright 1993-98, Be Incorporated, All Rights Reserved. +/ +*******************************************************************************/ + +#ifndef BGLVIEW_H +#define BGLVIEW_H + +#include + +#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 + +#ifdef __cplusplus + + +#include +#include +#include +#include +#include +#include + +class BGLView : public BView { +public: + + BGLView(BRect rect, char *name, + ulong resizingMode, ulong mode, + ulong options); +virtual ~BGLView(); + + void LockGL(); + void UnlockGL(); + void SwapBuffers(); + void SwapBuffers( bool vSync ); + BView * EmbeddedView(); + status_t CopyPixelsOut(BPoint source, BBitmap *dest); + status_t CopyPixelsIn(BBitmap *source, BPoint dest); +virtual void ErrorCallback(unsigned long errorCode); // Mesa's GLenum is uint where Be's ones was ulong! + +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 ); + + void * getGC() { return m_gc; } + +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; + void * m_clip_info; + void * _Unused1; + + 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 // __cplusplus + +#endif // BGLVIEW_H + + + + + diff --git a/src/mesa/drivers/beos/GLView.cpp b/src/mesa/drivers/beos/GLView.cpp index 80af9bd4168..69f4cf90747 100644 --- a/src/mesa/drivers/beos/GLView.cpp +++ b/src/mesa/drivers/beos/GLView.cpp @@ -59,7 +59,7 @@ extern "C" { } // extern "C" #include -#include "GLView.h" +#include // BeOS component ordering for B_RGBA32 bitmap format #if B_HOST_IS_LENDIAN diff --git a/src/mesa/drivers/beos/GLView.h b/src/mesa/drivers/beos/GLView.h deleted file mode 100644 index 8d9d25bb1cb..00000000000 --- a/src/mesa/drivers/beos/GLView.h +++ /dev/null @@ -1,192 +0,0 @@ -/******************************************************************************* -/ -/ File: GLView.h -/ -/ Copyright 1993-98, Be Incorporated, All Rights Reserved. -/ -*******************************************************************************/ - -#ifndef BGLVIEW_H -#define BGLVIEW_H - -#include - -#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 - -#ifdef __cplusplus - - -#include -#include -#include -#include -#include -#include - -class BGLView : public BView { -public: - - BGLView(BRect rect, char *name, - ulong resizingMode, ulong mode, - ulong options); -virtual ~BGLView(); - - void LockGL(); - void UnlockGL(); - void SwapBuffers(); - void SwapBuffers( bool vSync ); - BView * EmbeddedView(); - status_t CopyPixelsOut(BPoint source, BBitmap *dest); - status_t CopyPixelsIn(BBitmap *source, BPoint dest); -virtual void ErrorCallback(unsigned long errorCode); // Mesa's GLenum is uint where Be's ones was ulong! - -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 ); - - void * getGC() { return m_gc; } - -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; - void * m_clip_info; - void * _Unused1; - - 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 // __cplusplus - -#endif // BGLVIEW_H - - - - - -- cgit v1.2.3 From a6c423d95663cfd8601cf84e10e8e1b12fa6ef15 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 25 Aug 2004 15:59:48 +0000 Subject: Silence gcc 3.4 warnings on ReactOS. Mostly unused var warnings. (patch 1015696) --- Makefile.mgw | 5 +- include/GL/wmesa.h | 20 ++++---- src/mesa/array_cache/ac_import.c | 9 ++++ src/mesa/drivers/windows/gdi/colors.h | 11 ++++- src/mesa/drivers/windows/gdi/wgl.c | 40 ++++++++++----- src/mesa/drivers/windows/gdi/wmesa.c | 88 +++++++++++++++++++++++++-------- src/mesa/drivers/windows/gdi/wmesadef.h | 1 + src/mesa/glapi/glapi.c | 11 ++++- src/mesa/main/api_noop.c | 1 + src/mesa/main/bufferobj.c | 14 +++++- src/mesa/main/context.c | 10 ++++ src/mesa/main/debug.c | 2 + src/mesa/main/dlist.c | 1 + src/mesa/main/get.c | 4 +- src/mesa/main/image.c | 2 + src/mesa/main/imports.c | 10 +++- src/mesa/main/imports.h | 2 +- src/mesa/main/light.c | 1 + src/mesa/main/pixel.c | 2 + src/mesa/main/state.c | 5 +- src/mesa/main/texcompress.c | 1 + src/mesa/main/texcompress_fxt1.c | 19 ++++++- src/mesa/main/texcompress_s3tc.c | 9 ++++ src/mesa/main/texformat.c | 2 + src/mesa/main/texformat_tmp.h | 36 +++++++++----- src/mesa/main/teximage.c | 2 + src/mesa/main/texobj.c | 1 + src/mesa/main/texstore.c | 40 +++++++++++++++ src/mesa/main/vtxfmt.c | 3 +- src/mesa/math/m_clip_tmp.h | 3 ++ src/mesa/math/m_xform_tmp.h | 12 +++-- src/mesa/shader/arbfragparse.c | 1 + src/mesa/shader/arbprogparse.c | 20 +++++--- src/mesa/shader/arbvertparse.c | 1 + src/mesa/shader/grammar.c | 62 +++++++++++------------ src/mesa/shader/nvfragprog.h | 1 + src/mesa/shader/nvvertexec.c | 8 +-- src/mesa/shader/nvvertparse.c | 1 + src/mesa/shader/program.c | 2 + src/mesa/swrast/s_auxbuffer.c | 1 + src/mesa/swrast/s_buffers.c | 2 + src/mesa/swrast/s_context.c | 1 + src/mesa/swrast/s_span.c | 3 ++ src/mesa/swrast/s_tcc.c | 4 ++ src/mesa/swrast/s_texture.c | 30 ++++++++++- src/mesa/swrast/s_triangle.c | 2 +- src/mesa/tnl/t_array_api.c | 1 + src/mesa/tnl/t_array_import.c | 1 + src/mesa/tnl/t_context.c | 1 + src/mesa/tnl/t_save_api.c | 17 +++++++ src/mesa/tnl/t_save_loopback.c | 2 + src/mesa/tnl/t_vb_render.c | 1 + src/mesa/tnl/t_vertex.c | 45 ++++++++++++++++- src/mesa/tnl/t_vertex_codegen.c | 1 + src/mesa/tnl/t_vtx_api.c | 7 ++- 55 files changed, 464 insertions(+), 118 deletions(-) (limited to 'include') diff --git a/Makefile.mgw b/Makefile.mgw index 762b05b7110..6f53efd55d8 100644 --- a/Makefile.mgw +++ b/Makefile.mgw @@ -58,8 +58,9 @@ .PHONY : all libgl clean realclean CPU ?= pentium - -CFLAGS = -Wall -W -pedantic + +# when -std=c99 mingw will not define WIN32 +CFLAGS = -Wall -W -Werror -pedantic -std=c99 -DWIN32 CFLAGS += -O2 -ffast-math -mcpu=$(CPU) export CFLAGS diff --git a/include/GL/wmesa.h b/include/GL/wmesa.h index dc1ec89d2b1..79b3c823029 100644 --- a/include/GL/wmesa.h +++ b/include/GL/wmesa.h @@ -52,15 +52,17 @@ extern "C" { #include "gl\gl.h" -#pragma warning (disable:4273) -#pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ -#pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ -#pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ -#pragma warning( disable : 4013 ) /* 'function' undefined; assuming extern returning int */ -#pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ -#pragma warning( disable : 4273 ) /* 'identifier' : inconsistent DLL linkage. dllexport assumed */ -#if (MESA_WARNQUIET>1) -# pragma warning( disable : 4146 ) /* unary minus operator applied to unsigned type, result still unsigned */ +#if defined(_MSV_VER) && !defined(__GNUC__) +# pragma warning (disable:4273) +# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ +# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ +# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ +# pragma warning( disable : 4013 ) /* 'function' undefined; assuming extern returning int */ +# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ +# pragma warning( disable : 4273 ) /* 'identifier' : inconsistent DLL linkage. dllexport assumed */ +# if (MESA_WARNQUIET>1) +# pragma warning( disable : 4146 ) /* unary minus operator applied to unsigned type, result still unsigned */ +# endif #endif /* diff --git a/src/mesa/array_cache/ac_import.c b/src/mesa/array_cache/ac_import.c index 49cff3dae30..c33a4e3fe12 100644 --- a/src/mesa/array_cache/ac_import.c +++ b/src/mesa/array_cache/ac_import.c @@ -276,6 +276,7 @@ import_texcoord( GLcontext *ctx, GLuint unit, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.TexCoord[unit]; struct gl_client_array *to = &ac->Cache.TexCoord[unit]; + (void) type; (void) stride; ASSERT(unit < ctx->Const.MaxTextureCoordUnits); @@ -305,6 +306,7 @@ import_vertex( GLcontext *ctx, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.Vertex; struct gl_client_array *to = &ac->Cache.Vertex; + (void) type; (void) stride; /* Limited choices at this stage: */ @@ -331,6 +333,7 @@ import_normal( GLcontext *ctx, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.Normal; struct gl_client_array *to = &ac->Cache.Normal; + (void) type; (void) stride; /* Limited choices at this stage: */ @@ -355,6 +358,7 @@ import_color( GLcontext *ctx, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.Color; struct gl_client_array *to = &ac->Cache.Color; + (void) stride; import( ctx, type, to, from ); @@ -367,6 +371,7 @@ import_index( GLcontext *ctx, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.Index; struct gl_client_array *to = &ac->Cache.Index; + (void) type; (void) stride; /* Limited choices at this stage: */ @@ -391,6 +396,7 @@ import_secondarycolor( GLcontext *ctx, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.SecondaryColor; struct gl_client_array *to = &ac->Cache.SecondaryColor; + (void) stride; import( ctx, type, to, from ); @@ -403,6 +409,7 @@ import_fogcoord( GLcontext *ctx, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.FogCoord; struct gl_client_array *to = &ac->Cache.FogCoord; + (void) type; (void) stride; /* Limited choices at this stage: */ @@ -427,6 +434,7 @@ import_edgeflag( GLcontext *ctx, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.EdgeFlag; struct gl_client_array *to = &ac->Cache.EdgeFlag; + (void) type; (void) stride; /* Limited choices at this stage: */ @@ -451,6 +459,7 @@ import_attrib( GLcontext *ctx, GLuint index, GLenum type, GLuint stride ) ACcontext *ac = AC_CONTEXT(ctx); const struct gl_client_array *from = &ac->Raw.Attrib[index]; struct gl_client_array *to = &ac->Cache.Attrib[index]; + (void) type; (void) stride; ASSERT(index < VERT_ATTRIB_MAX); diff --git a/src/mesa/drivers/windows/gdi/colors.h b/src/mesa/drivers/windows/gdi/colors.h index 7070b85e325..5ee66e829de 100644 --- a/src/mesa/drivers/windows/gdi/colors.h +++ b/src/mesa/drivers/windows/gdi/colors.h @@ -24,6 +24,9 @@ /* * $Log: colors.h,v $ + * Revision 1.2 2004/08/25 15:59:48 brianp + * Silence gcc 3.4 warnings on ReactOS. Mostly unused var warnings. (patch 1015696) + * * Revision 1.1 2003/07/24 03:47:46 kschultz * Source code for GDI driver. * @@ -49,6 +52,9 @@ /* * $Log: colors.h,v $ + * Revision 1.2 2004/08/25 15:59:48 brianp + * Silence gcc 3.4 warnings on ReactOS. Mostly unused var warnings. (patch 1015696) + * * Revision 1.1 2003/07/24 03:47:46 kschultz * Source code for GDI driver. * @@ -74,6 +80,9 @@ /* * $Log: colors.h,v $ + * Revision 1.2 2004/08/25 15:59:48 brianp + * Silence gcc 3.4 warnings on ReactOS. Mostly unused var warnings. (patch 1015696) + * * Revision 1.1 2003/07/24 03:47:46 kschultz * Source code for GDI driver. * @@ -141,7 +150,7 @@ char ColorMap16[] = { 0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E, 0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F}; -#define BGR8(r,g,b) (unsigned)(((BYTE)(b & 0xc0 | (g & 0xe0)>>2 | (r & 0xe0)>>5))) +#define BGR8(r,g,b) (unsigned)(((BYTE)((b & 0xc0) | ((g & 0xe0)>>2) | ((r & 0xe0)>>5)))) #ifdef DDRAW #define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(g&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[r])) << 11))) #else diff --git a/src/mesa/drivers/windows/gdi/wgl.c b/src/mesa/drivers/windows/gdi/wgl.c index 53850d1bdce..b530cfc02db 100644 --- a/src/mesa/drivers/windows/gdi/wgl.c +++ b/src/mesa/drivers/windows/gdi/wgl.c @@ -1,4 +1,4 @@ -/* $Id: wgl.c,v 1.4 2004/08/25 14:59:45 brianp Exp $ */ +/* $Id: wgl.c,v 1.5 2004/08/25 15:59:48 brianp Exp $ */ /* * This library is free software; you can redistribute it and/or @@ -107,6 +107,7 @@ static unsigned curPFD = 0; WGLAPI BOOL GLAPIENTRY wglCopyContext(HGLRC hglrcSrc,HGLRC hglrcDst,UINT mask) { + (void) hglrcSrc; (void) hglrcDst; (void) mask; return(FALSE); } @@ -166,6 +167,7 @@ WGLAPI BOOL GLAPIENTRY wglDeleteContext(HGLRC hglrc) WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC hdc,int iLayerPlane) { + (void) hdc; (void) iLayerPlane; SetLastError(0); return(NULL); } @@ -211,7 +213,8 @@ WGLAPI BOOL GLAPIENTRY wglMakeCurrent(HDC hdc,HGLRC hglrc) } WGLAPI BOOL GLAPIENTRY wglShareLists(HGLRC hglrc1,HGLRC hglrc2) -{ +{ + (void) hglrc1; (void) hglrc2; return(TRUE); } @@ -219,7 +222,7 @@ WGLAPI BOOL GLAPIENTRY wglShareLists(HGLRC hglrc1,HGLRC hglrc2) static FIXED FixedFromDouble(double d) { long l = (long) (d * 65536L); - return *(FIXED *)&l; + return *(FIXED *) (void *) &l; } @@ -258,9 +261,9 @@ static BOOL wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar, SetTextColor(bitDevice, tempColor); // Place chars based on base line - VERIFY(SetTextAlign(bitDevice, TA_BASELINE) >= 0 ? 1 : 0); + VERIFY(SetTextAlign(bitDevice, TA_BASELINE) != GDI_ERROR ? 1 : 0); - for(i = 0; i < numChars; i++) { + for(i = 0; i < (int)numChars; i++) { SIZE size; char curChar; int charWidth,charHeight,bmapWidth,bmapHeight,numBytes,res; @@ -285,7 +288,7 @@ static BOOL wglUseFontBitmaps_FX(HDC fontDevice, DWORD firstChar, // Assign the output bitmap to the device origBmap = SelectObject(bitDevice, bitObject); - VERIFY(origBmap); + (void) VERIFY(origBmap); VERIFY( PatBlt( bitDevice, 0, 0, bmapWidth, bmapHeight,BLACKNESS ) ); @@ -344,11 +347,7 @@ WGLAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first, MAT2 mat; int success = TRUE; - if (first<0) - return FALSE; - if (count<0) - return FALSE; - if (listBase<0) + if (count == 0) return FALSE; font_list = listBase; @@ -373,7 +372,7 @@ WGLAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first, /* ** Otherwise process all desired characters. */ - for (i = 0; i < count; i++) + for (i = 0; i < (int)count; i++) { DWORD err; @@ -432,6 +431,7 @@ WGLAPI BOOL GLAPIENTRY wglUseFontBitmapsA(HDC hdc, DWORD first, WGLAPI BOOL GLAPIENTRY wglUseFontBitmapsW(HDC hdc,DWORD first,DWORD count,DWORD listBase) { + (void) hdc; (void) first; (void) count; (void) listBase; return FALSE; } @@ -440,6 +440,9 @@ WGLAPI BOOL GLAPIENTRY wglUseFontOutlinesA(HDC hdc,DWORD first,DWORD count, FLOAT extrusion,int format, LPGLYPHMETRICSFLOAT lpgmf) { + (void) hdc; (void) first; (void) count; + (void) listBase; (void) deviation; (void) extrusion; (void) format; + (void) lpgmf; SetLastError(0); return(FALSE); } @@ -449,6 +452,9 @@ WGLAPI BOOL GLAPIENTRY wglUseFontOutlinesW(HDC hdc,DWORD first,DWORD count, FLOAT extrusion,int format, LPGLYPHMETRICSFLOAT lpgmf) { + (void) hdc; (void) first; (void) count; + (void) listBase; (void) deviation; (void) extrusion; (void) format; + (void) lpgmf; SetLastError(0); return(FALSE); } @@ -457,6 +463,7 @@ WGLAPI BOOL GLAPIENTRY wglDescribeLayerPlane(HDC hdc,int iPixelFormat, int iLayerPlane,UINT nBytes, LPLAYERPLANEDESCRIPTOR plpd) { + (void) hdc; (void) iPixelFormat; (void) iLayerPlane; (void) nBytes; (void) plpd; SetLastError(0); return(FALSE); } @@ -465,6 +472,7 @@ WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC hdc,int iLayerPlane, int iStart,int cEntries, CONST COLORREF *pcr) { + (void) hdc; (void) iLayerPlane; (void) iStart; (void) cEntries; (void) pcr; SetLastError(0); return(0); } @@ -473,18 +481,21 @@ WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC hdc,int iLayerPlane, int iStart,int cEntries, COLORREF *pcr) { + (void) hdc; (void) iLayerPlane; (void) iStart; (void) cEntries; (void) pcr; SetLastError(0); return(0); } WGLAPI BOOL GLAPIENTRY wglRealizeLayerPalette(HDC hdc,int iLayerPlane,BOOL bRealize) { + (void) hdc; (void) iLayerPlane; (void) bRealize; SetLastError(0); return(FALSE); } WGLAPI BOOL GLAPIENTRY wglSwapLayerBuffers(HDC hdc,UINT fuPlanes) { + (void) fuPlanes; if( !hdc ) { WMesaSwapBuffers(); @@ -498,6 +509,7 @@ WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC hdc, CONST PIXELFORMATDESCRIPTOR *ppfd) { int i,best = -1,bestdelta = 0x7FFFFFFF,delta,qt_valid_pix; + (void) hdc; qt_valid_pix = qt_pix; if(ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR) || ppfd->nVersion != 1) @@ -556,6 +568,7 @@ WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC hdc,int iPixelFormat,UINT nByte LPPIXELFORMATDESCRIPTOR ppfd) { int qt_valid_pix; + (void) hdc; qt_valid_pix = qt_pix; if(ppfd == NULL) @@ -584,6 +597,7 @@ WGLAPI PROC GLAPIENTRY wglGetProcAddress(LPCSTR lpszProc) WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc) { + (void) hdc; if(curPFD == 0) { SetLastError(0); @@ -596,6 +610,7 @@ WGLAPI BOOL GLAPIENTRY wglSetPixelFormat(HDC hdc,int iPixelFormat, PIXELFORMATDESCRIPTOR *ppfd) { int qt_valid_pix; + (void) hdc; qt_valid_pix = qt_pix; if(iPixelFormat < 1 || iPixelFormat > qt_valid_pix || ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR)) @@ -609,6 +624,7 @@ WGLAPI BOOL GLAPIENTRY wglSetPixelFormat(HDC hdc,int iPixelFormat, WGLAPI BOOL GLAPIENTRY wglSwapBuffers(HDC hdc) { + (void) hdc; if (ctx_current < 0) return FALSE; diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index eb64cf69a59..53d202251ad 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -45,6 +45,7 @@ #include "array_cache/acache.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" +#include "swrast/s_alphabuf.h" #include "swrast/s_context.h" #include "swrast/s_depth.h" #include "swrast/s_lines.h" @@ -165,7 +166,6 @@ static BOOL DDCreateOffScreen(WMesaContext wc); #define USE_GDI_TO_CLEAR 1 #endif -static void FlushToFile(PWMC pwc, PSTR szFile); BOOL wmCreateBackingStore(PWMC pwc, long lxSize, long lySize); BOOL wmDeleteBackingStore(PWMC pwc); void wmCreatePalette( PWMC pwdc ); @@ -347,15 +347,20 @@ BOOL wmSetDIBits(PWMC pwc, UINT uiScanWidth, UINT uiNumScans, BYTE DITHER_RGB_2_8BIT( int r, int g, int b, int x, int y); +#if 0 /* unused */ + /* Finish all pending operations and synchronize. */ static void finish(GLcontext* ctx) { /* No op */ + (void) ctx; } +#endif /* unused */ static void flush(GLcontext* ctx) { + (void) ctx; if((Current->rgb_flag &&!(Current->db_flag)) ||(!Current->rgb_flag)) { @@ -371,6 +376,7 @@ static void flush(GLcontext* ctx) */ static void clear_index(GLcontext* ctx, GLuint index) { + (void) ctx; Current->clearpixel = index; } @@ -382,6 +388,7 @@ static void clear_index(GLcontext* ctx, GLuint index) static void clear_color( GLcontext* ctx, const GLfloat color[4] ) { GLubyte col[4]; + (void) ctx; CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]); @@ -400,7 +407,7 @@ static void clear_color( GLcontext* ctx, const GLfloat color[4] ) * Otherwise, we let swrast do it. */ -static clear(GLcontext* ctx, GLbitfield mask, +static void clear(GLcontext* ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height) { const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask; @@ -467,7 +474,7 @@ static clear(GLcontext* ctx, GLbitfield mask, WORD wColor; BYTE bColor; LPDWORD lpdw = (LPDWORD)Current->pbPixels; - LPWORD lpw = (LPWORD)Current->pbPixels; + /*LPWORD lpw = (LPWORD)Current->pbPixels; */ LPBYTE lpb = Current->pbPixels; int lines; /* Double-buffering - clear back buffer */ @@ -513,7 +520,9 @@ static clear(GLcontext* ctx, GLbitfield mask, dwColor = BGR32(GetRValue(Current->clearpixel), GetGValue(Current->clearpixel), GetBValue(Current->clearpixel)); - } + } + else + dwColor = 0; if (nBypp != 3) { @@ -567,6 +576,7 @@ static clear(GLcontext* ctx, GLbitfield mask, static void enable( GLcontext* ctx, GLenum pname, GLboolean enable ) { + (void) ctx; if (!Current) return; @@ -592,6 +602,7 @@ static void enable( GLcontext* ctx, GLenum pname, GLboolean enable ) static void set_buffer(GLcontext *ctx, GLframebuffer *colorBuffer, GLuint bufferBit ) { + (void) ctx; (void) colorBuffer; (void) bufferBit; /* XXX todo - examine bufferBit and set read/write pointers */ return; } @@ -601,9 +612,10 @@ static void set_buffer(GLcontext *ctx, GLframebuffer *colorBuffer, /* Return characteristics of the output buffer. */ static void buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) { - GET_CURRENT_CONTEXT(ctx); + /*GET_CURRENT_CONTEXT(ctx);*/ int New_Size; RECT CR; + (void) buffer; GetClientRect(Current->Window,&CR); @@ -649,25 +661,36 @@ static void buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) /* Accelerated routines are not implemented in 4.0. See OSMesa for ideas. */ +#if 0 /* unused */ + static void fast_rgb_points( GLcontext* ctx, GLuint first, GLuint last ) { + (void) ctx; (void) first; (void) last; } +#endif /* unused */ + /* Return pointer to accelerated points function */ extern tnl_points_func choose_points_function( GLcontext* ctx ) { + (void) ctx; return NULL; } +#if 0 /* unused */ + static void fast_flat_rgb_line( GLcontext* ctx, GLuint v0, GLuint v1, GLuint pv ) { + (void) ctx; (void) v0; (void) v1; (void) pv; } static tnl_line_func choose_line_function( GLcontext* ctx ) { + (void) ctx; } +#endif /* unused */ /**********************************************************************/ /***** Span-based pixel drawing *****/ @@ -682,6 +705,7 @@ static void write_ci32_span( const GLcontext* ctx, { GLuint i; PBYTE Mem=Current->ScreenMem+FLIP(y)*Current->ScanWidth+x; + (void) ctx; assert(Current->rgb_flag==GL_FALSE); for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; + (void) ctx; assert(Current->rgb_flag==GL_FALSE); for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; + (void) ctx; assert(Current->rgb_flag==GL_FALSE); for (i=0; irgb_flag==GL_TRUE) { GLuint i; - HDC DC=DD_GETDC; + /*HDC DC=DD_GETDC;*/ y=FLIP(y); if (mask) { for (i=0; irgb_flag==GL_TRUE) { GLuint i; - HDC DC=DD_GETDC; + /*HDC DC=DD_GETDC;*/ y=FLIP(y); if (mask) { for (i=0; irgb_flag==GL_TRUE); y=FLIP(y); if(Current->rgb_flag==GL_TRUE) @@ -863,6 +892,7 @@ static void write_ci32_pixels( const GLcontext* ctx, const GLuint index[], const GLubyte mask[] ) { GLuint i; + (void) ctx; assert(Current->rgb_flag==GL_FALSE); for (i=0; irgb_flag==GL_FALSE); for (i=0; irgb_flag==GL_TRUE); for (i=0; irgb_flag==GL_TRUE); for (i=0; iScreenMem+FLIP(y)*Current->ScanWidth+x; assert(Current->rgb_flag==GL_FALSE); for (i=0; irgb_flag==GL_FALSE); for (i=0; irgb_flag==GL_TRUE); y = Current->height - y - 1; for (i=0; irgb_flag==GL_TRUE); for (i=0; ihDC; +/* HDC DC = Current->hDC;*/ GET_CURRENT_CONTEXT(ctx); /* If we're swapping the buffer associated with the current context @@ -1699,6 +1737,8 @@ void wmCreateDIBSection( DWORD dwScanWidth; UINT nBypp = pwc->cColorBits / 8; HDC hic; + (void) hDC; + (void) pbmi; dwScanWidth = (((pwc->ScanWidth * nBypp)+ 3) & ~3); @@ -1742,14 +1782,14 @@ void wmCreateDIBSection( pwc->hbmDIB = CreateDIBSection(hic, &(pwc->bmi), (iUsage ? DIB_PAL_COLORS : DIB_RGB_COLORS), - &(pwc->pbPixels), + (void **)&(pwc->pbPixels), pwc->dib.hFileMap, 0); #else pwc->hbmDIB = CreateDIBSection(hic, &(pwc->bmi), (iUsage ? DIB_PAL_COLORS : DIB_RGB_COLORS), - &(pwc->pbPixels), + (void **)&(pwc->pbPixels), 0, 0); #endif // USE_MAPPED_FILE @@ -1768,7 +1808,7 @@ void wmCreateDIBSection( BOOL wmFlush(PWMC pwc) { BOOL bRet = 0; - DWORD dwErr = 0; +/* DWORD dwErr = 0;*/ #ifdef DDRAW HRESULT ddrval; #endif @@ -3182,8 +3222,11 @@ static void flat_DITHER8_triangle( GLcontext *ctx, GLuint v0, GLuint v1, #endif /************** END DEAD TRIANGLE CODE ***********************/ +#if 0 /* unused */ + static tnl_triangle_func choose_triangle_function( GLcontext *ctx ) { + (void) ctx; #if 0 WMesaContext wmesa = (WMesaContext) ctx->DriverCtx; int depth = wmesa->cColorBits; @@ -3277,6 +3320,8 @@ static tnl_triangle_func choose_triangle_function( GLcontext *ctx ) #endif } +#endif /* unused */ + /* * Define a new viewport and reallocate auxillary buffers if the size of * the window (color buffer) has changed. @@ -3284,6 +3329,7 @@ static tnl_triangle_func choose_triangle_function( GLcontext *ctx ) void WMesaViewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height ) { + (void) ctx; (void) x; (void) y; (void) width; (void) height; assert(0); /* I don't think that this is being used. */ #if 0 /* Save viewport */ diff --git a/src/mesa/drivers/windows/gdi/wmesadef.h b/src/mesa/drivers/windows/gdi/wmesadef.h index 29fff9f4f5e..3c267aa0f6a 100644 --- a/src/mesa/drivers/windows/gdi/wmesadef.h +++ b/src/mesa/drivers/windows/gdi/wmesadef.h @@ -93,6 +93,7 @@ typedef struct _dibSection{ }WMDIBSECTION, *PWMDIBSECTION; #ifdef COMPILE_SETPIXEL +struct wmesa_context; typedef void (*SETPIXELTYPE)(struct wmesa_context *pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b); #endif diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index d60570ca69b..0f0add89155 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -684,6 +684,7 @@ generate_entrypoint(GLuint functionOffset) } return code; #else + (void) functionOffset; return NULL; #endif /* USE_*_ASM */ } @@ -718,6 +719,12 @@ fill_in_entrypoint_offset(void *entrypoint, GLuint offset) __glapi_sparc_icache_flush(&code[2]); #endif /* __sparc_v9__ && !linux */ +#else + + /* an unimplemented architecture */ + (void) entrypoint; + (void) offset; + #endif /* USE_*_ASM */ } @@ -732,7 +739,7 @@ _glapi_add_entrypoint(const char *funcName, GLuint offset) /* trivial rejection test */ #ifdef MANGLE if (!funcName || funcName[0] != 'm' || funcName[1] != 'g' || funcName[2] != 'l') - return NULL; + return GL_FALSE; #else if (!funcName || funcName[0] != 'g' || funcName[1] != 'l') return GL_FALSE; @@ -1006,5 +1013,7 @@ _glapi_check_table(const struct _glapi_table *table) assert(setFenceOffset == offset); assert(_glapi_get_proc_address("glSetFenceNV") == (void *) &glSetFenceNV); } +#else + (void) table; #endif } diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c index e5e6717e835..d09a4496573 100644 --- a/src/mesa/main/api_noop.c +++ b/src/mesa/main/api_noop.c @@ -568,6 +568,7 @@ void GLAPIENTRY _mesa_noop_EvalPoint2( GLint a, GLint b ) */ void GLAPIENTRY _mesa_noop_Begin( GLenum mode ) { + (void) mode; } diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 1f9b988d334..fab1059a182 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -142,6 +142,9 @@ struct gl_buffer_object * _mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target ) { struct gl_buffer_object *obj; + + (void) ctx; + obj = MALLOC_STRUCT(gl_buffer_object); _mesa_initialize_buffer_object(obj, name, target); return obj; @@ -157,6 +160,8 @@ _mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target ) void _mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ) { + (void) ctx; + if (bufObj->Data) _mesa_free(bufObj->Data); _mesa_free(bufObj); @@ -170,6 +175,8 @@ void _mesa_initialize_buffer_object( struct gl_buffer_object *obj, GLuint name, GLenum target ) { + (void) target; + _mesa_bzero(obj, sizeof(struct gl_buffer_object)); obj->RefCount = 1; obj->Name = name; @@ -231,7 +238,7 @@ _mesa_buffer_data( GLcontext *ctx, GLenum target, GLsizeiptrARB size, { void * new_data; - (void) target; + (void) ctx; (void) target; new_data = _mesa_realloc( bufObj->Data, bufObj->Size, size ); if ( new_data != NULL ) { @@ -269,6 +276,8 @@ _mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data, struct gl_buffer_object * bufObj ) { + (void) ctx; (void) target; + if ( (bufObj->Data != NULL) && ((GLuint)(size + offset) <= bufObj->Size) ) { _mesa_memcpy( (GLubyte *) bufObj->Data + offset, data, size ); @@ -299,6 +308,8 @@ _mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data, struct gl_buffer_object * bufObj ) { + (void) ctx; (void) target; + if ( (bufObj->Data != NULL) && ((GLuint)(size + offset) <= bufObj->Size) ) { _mesa_memcpy( data, (GLubyte *) bufObj->Data + offset, size ); @@ -326,6 +337,7 @@ void * _mesa_buffer_map( GLcontext *ctx, GLenum target, GLenum access, struct gl_buffer_object * bufObj ) { + (void) ctx; (void) target; (void) access; return bufObj->Data; } diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index fd3174c0fa2..0330aa47beb 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -192,6 +192,7 @@ GLboolean _mesa_loseCurrent(__GLcontext *gc) { /* XXX unbind context from thread */ + (void) gc; return GL_TRUE; } @@ -212,6 +213,7 @@ GLboolean _mesa_makeCurrent(__GLcontext *gc) { /* XXX bind context to thread */ + (void) gc; return GL_TRUE; } @@ -267,6 +269,7 @@ _mesa_copyContext(__GLcontext *dst, const __GLcontext *src, GLuint mask) GLboolean _mesa_forceCurrent(__GLcontext *gc) { + (void) gc; return GL_TRUE; } @@ -302,6 +305,7 @@ void _mesa_notifyDestroy(__GLcontext *gc) { /* Unbind from it. */ + (void) gc; } /** @@ -322,6 +326,7 @@ _mesa_notifySwapBuffers(__GLcontext *gc) struct __GLdispatchStateRec * _mesa_dispatchExec(__GLcontext *gc) { + (void) gc; return NULL; } @@ -329,12 +334,14 @@ _mesa_dispatchExec(__GLcontext *gc) void _mesa_beginDispatchOverride(__GLcontext *gc) { + (void) gc; } /** No-op */ void _mesa_endDispatchOverride(__GLcontext *gc) { + (void) gc; } /** @@ -372,6 +379,8 @@ _mesa_init_default_exports(__GLexports *exports) exports->dispatchExec = _mesa_dispatchExec; exports->beginDispatchOverride = _mesa_beginDispatchOverride; exports->endDispatchOverride = _mesa_endDispatchOverride; +#else + (void) exports; #endif } @@ -759,6 +768,7 @@ static void one_time_init( GLcontext *ctx ) { static GLboolean alreadyCalled = GL_FALSE; + (void) ctx; _glthread_LOCK_MUTEX(OneTimeLock); if (!alreadyCalled) { GLuint i; diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 77ac9e85bb1..7ce6cceed8f 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -180,6 +180,8 @@ static void add_debug_flags( const char *debug ) */ if (_mesa_strstr(debug, "flush")) MESA_DEBUG_FLAGS |= DEBUG_ALWAYS_FLUSH; +#else + (void) debug; #endif } diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index ea1a6ae1215..41b47722af8 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -165,6 +165,7 @@ do { \ * integer values starting at 0 is very important, see InstSize array usage) */ typedef enum { + OPCODE_INVALID = -1, /* Force signed enum */ OPCODE_ACCUM, OPCODE_ALPHA_FUNC, OPCODE_BIND_TEXTURE, diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 7a5e6ff8d95..38ae4df85be 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -6390,7 +6390,7 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetPointerv"); return; } - *params = (GLvoid *) ctx->FragmentProgram.Callback; + *params = *(GLvoid **) &ctx->FragmentProgram.Callback; break; case GL_FRAGMENT_PROGRAM_CALLBACK_DATA_MESA: if (!ctx->Extensions.MESA_program_debug) { @@ -6404,7 +6404,7 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetPointerv"); return; } - *params = (GLvoid *) ctx->VertexProgram.Callback; + *params = *(GLvoid **) &ctx->VertexProgram.Callback; break; case GL_VERTEX_PROGRAM_CALLBACK_DATA_MESA: if (!ctx->Extensions.MESA_program_debug) { diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 57fe6c3fbf7..fcac0437193 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -3778,6 +3778,8 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLfloat *dest, GLenum srcType, const GLvoid *source, const struct gl_pixelstore_attrib *srcPacking ) { + (void) srcPacking; + switch (srcType) { case GL_BYTE: { diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 0afc4ea4313..2219468f75a 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -536,7 +536,7 @@ _mesa_bitcount(unsigned int n) GLhalfARB _mesa_float_to_half(float val) { - const int flt = *((int *) &val); + const int flt = *((int *) (void *) &val); const int flt_m = flt & 0x7fffff; const int flt_e = (flt >> 23) & 0xff; const int flt_s = (flt >> 31) & 0x1; @@ -662,7 +662,7 @@ _mesa_half_to_float(GLhalfARB val) } flt = (flt_s << 31) | (flt_e << 23) | flt_m; - result = *((float *) &flt); + result = *((float *) (void *) &flt); return result; } @@ -1004,6 +1004,7 @@ _mesa_debug( const GLcontext *ctx, const char *fmtString, ... ) { char s[MAXSTRING]; va_list args; + (void) ctx; va_start(args, fmtString); vsnprintf(s, MAXSTRING, fmtString, args); va_end(args); @@ -1094,6 +1095,7 @@ default_sprintf(__GLcontext *gc, char *str, const char *fmt, ...) { int r; va_list args; + (void) gc; va_start( args, fmt ); r = vsprintf( str, fmt, args ); va_end( args ); @@ -1104,6 +1106,7 @@ default_sprintf(__GLcontext *gc, char *str, const char *fmt, ...) static void * CAPI default_fopen(__GLcontext *gc, const char *path, const char *mode) { + (void) gc; return fopen(path, mode); } @@ -1111,6 +1114,7 @@ default_fopen(__GLcontext *gc, const char *path, const char *mode) static int CAPI default_fclose(__GLcontext *gc, void *stream) { + (void) gc; return fclose((FILE *) stream); } @@ -1120,6 +1124,7 @@ default_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...) { int r; va_list args; + (void) gc; va_start( args, fmt ); r = vfprintf( (FILE *) stream, fmt, args ); va_end( args ); @@ -1132,6 +1137,7 @@ default_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...) static __GLdrawablePrivate * default_GetDrawablePrivate(__GLcontext *gc) { + (void) gc; return NULL; } diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 6b705f64154..62b71e49be5 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -556,7 +556,7 @@ static INLINE int iceil(float f) ***/ #if defined(USE_IEEE) && !defined(DEBUG) #define COPY_FLOAT( dst, src ) \ - ((fi_type *) &(dst))->i = ((fi_type *) &(src))->i + ((fi_type *) &(dst))->i = ((fi_type *) (void *) &(src))->i #else #define COPY_FLOAT( dst, src ) (dst) = (src) #endif diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index d7a995917df..0cf2635765f 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -1129,6 +1129,7 @@ _mesa_update_tnl_spaces( GLcontext *ctx, GLuint new_state ) { const GLuint oldneedeyecoords = ctx->_NeedEyeCoords; + (void) new_state; ctx->_NeedEyeCoords = 0; if (ctx->_ForceEyeCoords || diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index c4fa17f22f9..932dfce61cb 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -791,6 +791,8 @@ _mesa_scale_and_bias_rgba(const GLcontext *ctx, GLuint n, GLfloat rgba[][4], GLfloat rBias, GLfloat gBias, GLfloat bBias, GLfloat aBias) { + (void) ctx; + if (rScale != 1.0 || rBias != 0.0) { GLuint i; for (i = 0; i < n; i++) { diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 0f3750e61ca..997e3829c8a 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -119,10 +119,11 @@ generic_noop(void) void _mesa_init_no_op_table(struct _glapi_table *table, GLuint tableSize) { + typedef void (*func_ptr_t)(); GLuint i; - void **dispatch = (void **) table; + func_ptr_t *dispatch = (func_ptr_t *) table; for (i = 0; i < tableSize; i++) { - dispatch[i] = (void *) generic_noop; + dispatch[i] = (func_ptr_t)generic_noop; } } diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index 3d0326fccac..396f14a5663 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -113,6 +113,7 @@ _mesa_compressed_texture_size( GLcontext *ctx, GLuint size; ASSERT(depth == 1); + (void) depth; switch (format) { case GL_COMPRESSED_RGB_FXT1_3DFX: diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index 603f434f209..3aa5e663988 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -57,6 +57,7 @@ fxt1_decode_1 (const void *texture, int width, void _mesa_init_texture_fxt1( GLcontext *ctx ) { + (void) ctx; } @@ -76,6 +77,7 @@ texstore_rgb_fxt1(STORE_PARAMS) ASSERT(dstXoffset % 8 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset == 0); + (void) dstZoffset; (void) dstImageStride; if (srcFormat != GL_RGB || srcType != CHAN_TYPE || @@ -131,6 +133,7 @@ texstore_rgba_fxt1(STORE_PARAMS) ASSERT(dstXoffset % 8 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset == 0); + (void) dstZoffset; (void) dstImageStride; if (srcFormat != GL_RGBA || srcType != CHAN_TYPE || @@ -174,6 +177,7 @@ static void fetch_texel_2d_rgba_fxt1( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { + (void) k; fxt1_decode_1(texImage->Data, texImage->Width, i, j, texel); } @@ -184,6 +188,7 @@ fetch_texel_2d_f_rgba_fxt1( const struct gl_texture_image *texImage, { /* just sample as GLchan and convert to float here */ GLchan rgba[4]; + (void) k; fxt1_decode_1(texImage->Data, texImage->Width, i, j, rgba); texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]); texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]); @@ -196,6 +201,7 @@ static void fetch_texel_2d_rgb_fxt1( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { + (void) k; fxt1_decode_1(texImage->Data, texImage->Width, i, j, texel); texel[ACOMP] = 255; } @@ -207,6 +213,7 @@ fetch_texel_2d_f_rgb_fxt1( const struct gl_texture_image *texImage, { /* just sample as GLchan and convert to float here */ GLchan rgba[4]; + (void) k; fxt1_decode_1(texImage->Data, texImage->Width, i, j, rgba); texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]); texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]); @@ -316,6 +323,7 @@ typedef struct { #endif /* !__GNUC__ */ +#if 0 /* unused */ static int fxt1_bestcol (float vec[][MAX_COMP], int nv, @@ -360,6 +368,7 @@ fxt1_worst (float vec[MAX_COMP], return worst; } +#endif /* unused */ static int fxt1_variance (double variance[MAX_COMP], @@ -390,6 +399,7 @@ fxt1_variance (double variance[MAX_COMP], return best; } +#if 0 /* unused */ static int fxt1_choose (float vec[][MAX_COMP], int nv, @@ -678,6 +688,7 @@ fxt1_quantize_ALPHA0 (unsigned long *cc, cc[0] = lolo; } +#endif /* unused */ static void fxt1_quantize_ALPHA1 (unsigned long *cc, @@ -868,6 +879,7 @@ fxt1_quantize_ALPHA1 (unsigned long *cc, ((Fx64 *)cc)[1] = hi; } +#if 0 /* unused*/ static void fxt1_quantize_HI (unsigned long *cc, @@ -966,6 +978,7 @@ fxt1_quantize_HI (unsigned long *cc, } } +#endif /* unused */ static void fxt1_quantize_MIXED1 (unsigned long *cc, @@ -1284,7 +1297,7 @@ fxt1_quantize_MIXED0 (unsigned long *cc, } /* funky encoding for LSB of green */ - if (((lolo >> 1) & 1) != (((vec[1][GCOMP] ^ vec[0][GCOMP]) >> 2) & 1)) { + if ((int)((lolo >> 1) & 1) != (((vec[1][GCOMP] ^ vec[0][GCOMP]) >> 2) & 1)) { for (i = 0; i < n_comp; i++) { vec[1][i] = input[minColL][i]; vec[0][i] = input[maxColL][i]; @@ -1339,7 +1352,7 @@ fxt1_quantize_MIXED0 (unsigned long *cc, } /* funky encoding for LSB of green */ - if (((lohi >> 1) & 1) != (((vec[3][GCOMP] ^ vec[2][GCOMP]) >> 2) & 1)) { + if ((int)((lohi >> 1) & 1) != (((vec[3][GCOMP] ^ vec[2][GCOMP]) >> 2) & 1)) { for (i = 0; i < n_comp; i++) { vec[3][i] = input[minColR][i]; vec[2][i] = input[maxColR][i]; @@ -1455,6 +1468,8 @@ fxt1_encode (GLcontext *ctx, unsigned long *encoded = dest; GLubyte *newSource = NULL; + (void) ctx; + /* * Rescale image if width is less than 8 or height is less than 4. */ diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index 08697f46c42..572cdd25614 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -45,6 +45,7 @@ void _mesa_init_texture_s3tc( GLcontext *ctx ) { /* called during context initialization */ + (void) ctx; } @@ -64,6 +65,7 @@ texstore_rgb_dxt1(STORE_PARAMS) ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); + (void) dstZoffset; (void) dstImageStride; if (srcFormat != GL_RGB || srcType != CHAN_TYPE || @@ -121,6 +123,7 @@ texstore_rgba_dxt1(STORE_PARAMS) ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); + (void) dstZoffset; (void) dstImageStride; if (srcFormat != GL_RGBA || srcType != CHAN_TYPE || @@ -176,6 +179,7 @@ texstore_rgba_dxt3(STORE_PARAMS) ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); + (void) dstZoffset; (void) dstImageStride; if (srcFormat != GL_RGBA || srcType != CHAN_TYPE || @@ -230,6 +234,7 @@ texstore_rgba_dxt5(STORE_PARAMS) ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); + (void) dstZoffset; (void) dstImageStride; if (srcFormat != GL_RGBA || srcType != CHAN_TYPE || @@ -272,6 +277,7 @@ static void fetch_texel_2d_rgb_dxt1( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { + (void) texImage; (void) i; (void) j; (void) k; (void) texel; } @@ -293,6 +299,7 @@ static void fetch_texel_2d_rgba_dxt1( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { + (void) texImage; (void) i; (void) j; (void) k; (void) texel; } @@ -314,6 +321,7 @@ static void fetch_texel_2d_rgba_dxt3( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { + (void) texImage; (void) i; (void) j; (void) k; (void) texel; } @@ -335,6 +343,7 @@ static void fetch_texel_2d_rgba_dxt5( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { + (void) texImage; (void) i; (void) j; (void) k; (void) texel; } diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index c4f7a23e812..a496cf8cbf3 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -63,6 +63,7 @@ static void fetch_null_texel( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { + (void) texImage; (void) i; (void) j; (void) k; texel[RCOMP] = 0; texel[GCOMP] = 0; texel[BCOMP] = 0; @@ -73,6 +74,7 @@ static void fetch_null_texel( const struct gl_texture_image *texImage, static void fetch_null_texelf( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { + (void) texImage; (void) i; (void) j; (void) k; texel[RCOMP] = 0.0; texel[GCOMP] = 0.0; texel[BCOMP] = 0.0; diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index 0ccdead291b..d341c7864ae 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -44,34 +44,46 @@ #if DIM == 1 #define CHAN_SRC( t, i, j, k, sz ) \ - ((GLchan *)(t)->Data + (i) * (sz)) + ((void) (j), (void) (k), \ + ((GLchan *)(t)->Data + (i) * (sz))) #define UBYTE_SRC( t, i, j, k, sz ) \ - ((GLubyte *)(t)->Data + (i) * (sz)) + ((void) (j), (void) (k), \ + ((GLubyte *)(t)->Data + (i) * (sz))) #define USHORT_SRC( t, i, j, k ) \ - ((GLushort *)(t)->Data + (i)) + ((void) (j), (void) (k), \ + ((GLushort *)(t)->Data + (i))) #define UINT_SRC( t, i, j, k ) \ - ((GLuint *)(t)->Data + (i)) + ((void) (j), (void) (k), \ + ((GLuint *)(t)->Data + (i))) #define FLOAT_SRC( t, i, j, k, sz ) \ - ((GLfloat *)(t)->Data + (i) * (sz)) + ((void) (j), (void) (k), \ + ((GLfloat *)(t)->Data + (i) * (sz))) #define HALF_SRC( t, i, j, k, sz ) \ - ((GLhalfARB *)(t)->Data + (i) * (sz)) + ((void) (j), (void) (k), \ + ((GLhalfARB *)(t)->Data + (i) * (sz))) #define FETCH(x) fetch_texel_1d_##x #elif DIM == 2 #define CHAN_SRC( t, i, j, k, sz ) \ - ((GLchan *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz)) + ((void) (k), \ + ((GLchan *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))) #define UBYTE_SRC( t, i, j, k, sz ) \ - ((GLubyte *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz)) + ((void) (k), \ + ((GLubyte *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))) #define USHORT_SRC( t, i, j, k ) \ - ((GLushort *)(t)->Data + ((t)->RowStride * (j) + (i))) + ((void) (k), \ + ((GLushort *)(t)->Data + ((t)->RowStride * (j) + (i)))) #define UINT_SRC( t, i, j, k ) \ - ((GLuint *)(t)->Data + ((t)->RowStride * (j) + (i))) + ((void) (k), \ + ((GLuint *)(t)->Data + ((t)->RowStride * (j) + (i)))) #define FLOAT_SRC( t, i, j, k, sz ) \ - ((GLfloat *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz)) + ((void) (k), \ + ((GLfloat *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))) #define HALF_SRC( t, i, j, k, sz ) \ - ((GLhalfARB *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz)) + ((void) (k), \ + ((GLhalfARB *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))) #define FETCH(x) fetch_texel_2d_##x diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index b1f526c175d..b60a91f3703 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -481,6 +481,7 @@ is_ycbcr_format(GLenum format) static GLboolean is_compressed_format(GLcontext *ctx, GLenum internalFormat) { + (void) ctx; switch (internalFormat) { case GL_COMPRESSED_RGB_FXT1_3DFX: case GL_COMPRESSED_RGBA_FXT1_3DFX: @@ -2846,6 +2847,7 @@ compressed_subtexture_error_check(GLcontext *ctx, GLint dimensions, GLenum format, GLsizei imageSize) { GLint expectedSize, maxLevels = 0, maxTextureSize; + (void) zoffset; if (dimensions == 1) { /* 1D compressed textures not allowed */ diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 5cf71e872d8..74a5fdc06e9 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -64,6 +64,7 @@ struct gl_texture_object * _mesa_new_texture_object( GLcontext *ctx, GLuint name, GLenum target ) { struct gl_texture_object *obj; + (void) ctx; obj = MALLOC_STRUCT(gl_texture_object); _mesa_initialize_texture_object(obj, name, target); return obj; diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index c6c7cb488ad..879f585a87f 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -701,6 +701,7 @@ _mesa_texstore_rgba(GLcontext *ctx, GLuint dims, GLboolean _mesa_texstore_depth_component_float32(STORE_PARAMS) { + (void) dims; ASSERT(dstFormat == &_mesa_texformat_depth_component_float32); ASSERT(dstFormat->TexelBytes == sizeof(GLfloat)); @@ -744,6 +745,7 @@ _mesa_texstore_depth_component_float32(STORE_PARAMS) GLboolean _mesa_texstore_depth_component16(STORE_PARAMS) { + (void) dims; ASSERT(dstFormat == &_mesa_texformat_depth_component16); ASSERT(dstFormat->TexelBytes == sizeof(GLushort)); @@ -1553,6 +1555,7 @@ _mesa_texstore_a8(STORE_PARAMS) GLboolean _mesa_texstore_ci8(STORE_PARAMS) { + (void) dims; (void) baseInternalFormat; ASSERT(dstFormat == &_mesa_texformat_ci8); ASSERT(dstFormat->TexelBytes == 1); ASSERT(baseInternalFormat == GL_COLOR_INDEX); @@ -1599,6 +1602,7 @@ _mesa_texstore_ycbcr(STORE_PARAMS) { const GLuint ui = 1; const GLubyte littleEndian = *((const GLubyte *) &ui); + (void) ctx; (void) dims; (void) baseInternalFormat; ASSERT((dstFormat == &_mesa_texformat_ycbcr) || (dstFormat == &_mesa_texformat_ycbcr_rev)); @@ -1852,6 +1856,7 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, { GLint postConvWidth = width; GLint sizeInBytes; + (void) border; if (ctx->_ImageTransferState & IMAGE_CONVOLUTION_BIT) { _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL); @@ -1925,6 +1930,7 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, { GLint postConvWidth = width, postConvHeight = height; GLint texelBytes, sizeInBytes; + (void) border; if (ctx->_ImageTransferState & IMAGE_CONVOLUTION_BIT) { _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth, @@ -2004,6 +2010,7 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_image *texImage) { GLint texelBytes, sizeInBytes; + (void) border; /* choose the texture format */ assert(ctx->Driver.ChooseTextureFormat); @@ -2228,6 +2235,13 @@ _mesa_store_compressed_teximage1d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_image *texImage) { /* this space intentionally left blank */ + (void) ctx; + (void) target; (void) level; + (void) internalFormat; + (void) width; (void) border; + (void) imageSize; (void) data; + (void) texObj; + (void) texImage; } @@ -2243,6 +2257,8 @@ _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { + (void) width; (void) height; (void) border; + /* This is pretty simple, basically just do a memcpy without worrying * about the usual image unpacking or image transfer operations. */ @@ -2299,6 +2315,14 @@ _mesa_store_compressed_teximage3d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_image *texImage) { /* this space intentionally left blank */ + (void) ctx; + (void) target; (void) level; + (void) internalFormat; + (void) width; (void) height; (void) depth; + (void) border; + (void) imageSize; (void) data; + (void) texObj; + (void) texImage; } @@ -2316,6 +2340,13 @@ _mesa_store_compressed_texsubimage1d(GLcontext *ctx, GLenum target, struct gl_texture_image *texImage) { /* this space intentionally left blank */ + (void) ctx; + (void) target; (void) level; + (void) xoffset; (void) width; + (void) format; + (void) imageSize; (void) data; + (void) texObj; + (void) texImage; } @@ -2336,6 +2367,7 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, GLint i, rows; GLubyte *dest; const GLubyte *src; + (void) format; /* these should have been caught sooner */ ASSERT((width & 3) == 0 || width == 2 || width == 1); @@ -2389,6 +2421,14 @@ _mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target, struct gl_texture_image *texImage) { /* this space intentionally left blank */ + (void) ctx; + (void) target; (void) level; + (void) xoffset; (void) yoffset; (void) zoffset; + (void) width; (void) height; (void) depth; + (void) format; + (void) imageSize; (void) data; + (void) texObj; + (void) texImage; } diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 4f9a7c0e24f..e45e5ca22e2 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -49,6 +49,7 @@ { \ GET_CURRENT_CONTEXT(ctx); \ struct gl_tnl_module *tnl = &(ctx->TnlModule); \ + typedef void (*func_ptr_t)(); \ \ ASSERT( tnl->Current ); \ ASSERT( tnl->SwapCount < NUM_VERTEX_FORMAT_ENTRIES ); \ @@ -56,7 +57,7 @@ /* Save the swapped function's dispatch entry so it can be */ \ /* restored later. */ \ tnl->Swapped[tnl->SwapCount][0] = (void *)&(ctx->Exec->FUNC); \ - tnl->Swapped[tnl->SwapCount][1] = (void *)TAG(FUNC); \ + *(func_ptr_t *)(tnl->Swapped[tnl->SwapCount]+1) = (func_ptr_t)TAG(FUNC); \ tnl->SwapCount++; \ \ if ( 0 ) \ diff --git a/src/mesa/math/m_clip_tmp.h b/src/mesa/math/m_clip_tmp.h index 6551798c318..de9056333b5 100644 --- a/src/mesa/math/m_clip_tmp.h +++ b/src/mesa/math/m_clip_tmp.h @@ -129,6 +129,7 @@ static GLvector4f * _XFORMAPI TAG(cliptest_np_points4)( GLvector4f *clip_vec, GLubyte tmpAndMask = *andMask; GLubyte tmpOrMask = *orMask; GLuint i; + (void) proj_vec; STRIDE_LOOP { const GLfloat cx = from[0]; const GLfloat cy = from[1]; @@ -176,6 +177,7 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points3)( GLvector4f *clip_vec, const GLuint stride = clip_vec->stride; const GLuint count = clip_vec->count; const GLfloat *from = (GLfloat *)clip_vec->start; + (void) proj_vec; GLubyte tmpOrMask = *orMask; GLubyte tmpAndMask = *andMask; @@ -209,6 +211,7 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points2)( GLvector4f *clip_vec, const GLuint stride = clip_vec->stride; const GLuint count = clip_vec->count; const GLfloat *from = (GLfloat *)clip_vec->start; + (void) proj_vec; GLubyte tmpOrMask = *orMask; GLubyte tmpAndMask = *andMask; diff --git a/src/mesa/math/m_xform_tmp.h b/src/mesa/math/m_xform_tmp.h index 7cf4780bd39..e9383772562 100644 --- a/src/mesa/math/m_xform_tmp.h +++ b/src/mesa/math/m_xform_tmp.h @@ -106,6 +106,7 @@ TAG(transform_points1_identity)( GLvector4f *to_vec, GLuint count = from_vec->count; GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; GLuint i; + (void) m; if (to_vec == from_vec) return; STRIDE_LOOP { to[i][0] = from[0]; @@ -271,6 +272,7 @@ TAG(transform_points2_identity)( GLvector4f *to_vec, GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; GLuint count = from_vec->count; GLuint i; + (void) m; if (to_vec == from_vec) return; STRIDE_LOOP { to[i][0] = from[0]; @@ -441,6 +443,7 @@ TAG(transform_points3_identity)( GLvector4f *to_vec, GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; GLuint count = from_vec->count; GLuint i; + (void) m; if (to_vec == from_vec) return; STRIDE_LOOP { to[i][0] = from[0]; @@ -608,6 +611,7 @@ TAG(transform_points4_identity)( GLvector4f *to_vec, GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start; GLuint count = from_vec->count; GLuint i; + (void) m; if (to_vec == from_vec) return; STRIDE_LOOP { to[i][0] = from[0]; @@ -740,10 +744,10 @@ TAG(transform_points4_perspective)( GLvector4f *to_vec, to_vec->count = from_vec->count; } -static transform_func _XFORMAPI TAG(transform_tab_1)[7]; -static transform_func _XFORMAPI TAG(transform_tab_2)[7]; -static transform_func _XFORMAPI TAG(transform_tab_3)[7]; -static transform_func _XFORMAPI TAG(transform_tab_4)[7]; +static transform_func TAG(transform_tab_1)[7]; +static transform_func TAG(transform_tab_2)[7]; +static transform_func TAG(transform_tab_3)[7]; +static transform_func TAG(transform_tab_4)[7]; /* Similar functions could be called several times, with more highly * optimized routines overwriting the arrays. This only occurs during diff --git a/src/mesa/shader/arbfragparse.c b/src/mesa/shader/arbfragparse.c index 7192156463e..a0fc9dd5bb1 100644 --- a/src/mesa/shader/arbfragparse.c +++ b/src/mesa/shader/arbfragparse.c @@ -186,6 +186,7 @@ _mesa_parse_arb_fragment_program(GLcontext * ctx, GLenum target, { GLuint a, retval; struct arb_program ap; + (void) target; /* set the program target before parsing */ ap.Base.Target = GL_FRAGMENT_PROGRAM_ARB; diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 8e8051267d4..9d78027f636 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -42,6 +42,10 @@ #include "arbprogparse.h" #include "grammar_mesa.h" +#if !defined(__GNUC__) && !defined(__extension__) +# define __extension__ +#endif + /* TODO: * Fragment Program Stuff: * ----------------------------------------------------- @@ -129,7 +133,7 @@ typedef GLubyte *production; /** * This is the text describing the rules to parse the grammar */ -static char arb_grammar_text[] = +__extension__ static char arb_grammar_text[] = #include "arbprogram_syn.h" ; @@ -591,6 +595,7 @@ parse_string (GLubyte ** inst, struct var_cache **vc_head, { GLubyte *i = *inst; struct var_cache *va = NULL; + (void) Program; *inst += _mesa_strlen ((char *) i) + 1; @@ -614,7 +619,8 @@ static char * parse_string_without_adding (GLubyte ** inst, struct arb_program *Program) { GLubyte *i = *inst; - + (void) Program; + *inst += _mesa_strlen ((char *) i) + 1; return (char *) i; @@ -788,6 +794,7 @@ static GLuint parse_color_type (GLcontext * ctx, GLubyte ** inst, struct arb_program *Program, GLint * color) { + (void) ctx; (void) Program; *color = *(*inst)++ != COLOR_PRIMARY; return 0; } @@ -828,7 +835,7 @@ parse_texcoord_num (GLcontext * ctx, GLubyte ** inst, { GLint i = parse_integer (inst, Program); - if ((i < 0) || (i >= ctx->Const.MaxTextureUnits)) { + if ((i < 0) || (i >= (int)ctx->Const.MaxTextureUnits)) { _mesa_set_program_error (ctx, Program->Position, "Invalid texture unit index"); _mesa_error (ctx, GL_INVALID_OPERATION, "Invalid texture unit index"); @@ -1890,7 +1897,7 @@ parse_param (GLcontext * ctx, GLubyte ** inst, struct var_cache **vc_head, /* Test array length here! */ if (specified_length) { - if (specified_length != param_var->param_binding_length) { + if (specified_length != (int)param_var->param_binding_length) { _mesa_set_program_error (ctx, Program->Position, "Declared parameter array lenght does not match parameter list"); _mesa_error (ctx, GL_INVALID_OPERATION, @@ -2282,6 +2289,7 @@ parse_address_reg (GLcontext * ctx, GLubyte ** inst, { struct var_cache *dst; GLuint result; + (void) Index; dst = parse_string (inst, vc_head, Program, &result); Program->Position = parse_position (inst); @@ -2492,7 +2500,7 @@ parse_src_reg (GLcontext * ctx, GLubyte ** inst, struct var_cache **vc_head, offset = parse_integer (inst, Program); if ((offset < 0) - || (offset >= src->param_binding_length)) { + || (offset >= (int)src->param_binding_length)) { _mesa_set_program_error (ctx, Program->Position, "Index out of range"); _mesa_error (ctx, GL_INVALID_OPERATION, @@ -3686,7 +3694,7 @@ parse_arb_program (GLcontext * ctx, GLubyte * inst, struct var_cache **vc_head, } /* XXX temporary */ -static char core_grammar_text[] = +__extension__ static char core_grammar_text[] = #include "grammar_syn.h" ; diff --git a/src/mesa/shader/arbvertparse.c b/src/mesa/shader/arbvertparse.c index cfad87b5b1b..d0e776b47c1 100644 --- a/src/mesa/shader/arbvertparse.c +++ b/src/mesa/shader/arbvertparse.c @@ -175,6 +175,7 @@ _mesa_parse_arb_vertex_program(GLcontext * ctx, GLenum target, { GLuint retval; struct arb_program ap; + (void) target; /* set the program target before parsing */ ap.Base.Target = GL_VERTEX_PROGRAM_ARB; diff --git a/src/mesa/shader/grammar.c b/src/mesa/shader/grammar.c index af824f33843..fa2e96901d5 100644 --- a/src/mesa/shader/grammar.c +++ b/src/mesa/shader/grammar.c @@ -284,7 +284,7 @@ static void clear_last_error () /* free error parameter - if error_param is a "???" don't free it - it's static */ if (error_param != unknown) - mem_free ((void **) &error_param); + mem_free ((void **) (void *) &error_param); else error_param = NULL; @@ -297,7 +297,7 @@ static void set_last_error (const byte *msg, byte *param, int pos) /* error message can only be set only once */ if (error_message != NULL) { - mem_free ((void **) ¶m); + mem_free ((void **) (void *) ¶m); return; } @@ -1230,7 +1230,7 @@ static int get_identifier (const byte **text, byte **id) { if (string_grow (&p, &len, *t++)) { - mem_free ((void **) &p); + mem_free ((void **) (void *) &p); return 1; } } @@ -1379,7 +1379,7 @@ static int get_string (const byte **text, byte **str) if (string_grow (&p, &len, c)) { - mem_free ((void **) &p); + mem_free ((void **) (void *) &p); return 1; } } @@ -1424,7 +1424,7 @@ static int get_emtcode (const byte **text, map_byte **ma) } m->data = (byte) c[0]; - mem_free ((void **) &c); + mem_free ((void **) (void *) &c); } else { @@ -1502,11 +1502,11 @@ static int get_error (const byte **text, error **er, map_str *maps) if (!str_equal ((byte *) "error", temp)) { - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); return 0; } - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); error_create (er); if (*er == NULL) @@ -1532,12 +1532,12 @@ static int get_error (const byte **text, error **er, map_str *maps) if (map_str_find (&maps, temp, &(**er).m_text)) { - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); error_destroy (er); return 1; } - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); } /* try to extract "token" from "...$token$..." */ @@ -1558,7 +1558,7 @@ static int get_error (const byte **text, error **er, map_str *maps) { if (string_grow (&processed, &len, '$')) { - mem_free ((void **) &processed); + mem_free ((void **) (void *) &processed); error_destroy (er); return 1; } @@ -1569,7 +1569,7 @@ static int get_error (const byte **text, error **er, map_str *maps) { if (string_grow (&processed, &len, (**er).m_text[i])) { - mem_free ((void **) &processed); + mem_free ((void **) (void *) &processed); error_destroy (er); return 1; } @@ -1580,7 +1580,7 @@ static int get_error (const byte **text, error **er, map_str *maps) { if (string_grow (&processed, &len, '$')) { - mem_free ((void **) &processed); + mem_free ((void **) (void *) &processed); error_destroy (er); return 1; } @@ -1591,7 +1591,7 @@ static int get_error (const byte **text, error **er, map_str *maps) if (string_grow (&(**er).m_token_name, &tlen, '\0')) { - mem_free ((void **) &processed); + mem_free ((void **) (void *) &processed); error_destroy (er); return 1; } @@ -1603,7 +1603,7 @@ static int get_error (const byte **text, error **er, map_str *maps) { if (string_grow (&(**er).m_token_name, &tlen, (**er).m_text[i])) { - mem_free ((void **) &processed); + mem_free ((void **) (void *) &processed); error_destroy (er); return 1; } @@ -1652,11 +1652,11 @@ static int get_emits (const byte **text, emit **em, map_byte *mapb) dest = ed_regbyte; else { - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); return 0; } - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); emit_create (&e); if (e == NULL) @@ -1706,7 +1706,7 @@ static int get_emits (const byte **text, emit **em, map_byte *mapb) } e->m_byte = (byte) temp[0]; - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); e->m_emit_type = et_byte; } @@ -1720,12 +1720,12 @@ static int get_emits (const byte **text, emit **em, map_byte *mapb) if (map_byte_find (&mapb, temp, &e->m_byte)) { - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); emit_destroy (&e); return 1; } - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); e->m_emit_type = et_byte; } @@ -1819,7 +1819,7 @@ static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb t = u; } - mem_free ((void **) &keyword); + mem_free ((void **) (void *) &keyword); } if (*t == '\'') @@ -1843,7 +1843,7 @@ static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb if (get_string (&t, &temp2)) { - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); spec_destroy (&s); return 1; } @@ -1853,7 +1853,7 @@ static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb s->m_byte[0] = *temp; s->m_byte[1] = *temp2; - mem_free ((void **) &temp2); + mem_free ((void **) (void *) &temp2); } else { @@ -1861,7 +1861,7 @@ static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb *s->m_byte = *temp; } - mem_free ((void **) &temp); + mem_free ((void **) (void *) &temp); } else if (*t == '"') { @@ -1908,7 +1908,7 @@ static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb { if (get_identifier (&t, &s->m_string)) { - mem_free ((void **) &keyword); + mem_free ((void **) (void *) &keyword); spec_destroy (&s); return 1; } @@ -1917,7 +1917,7 @@ static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb s->m_spec_type = st_identifier_loop; } - mem_free ((void **) &keyword); + mem_free ((void **) (void *) &keyword); } else { @@ -1993,7 +1993,7 @@ static int get_rule (const byte **text, rule **ru, map_str *maps, map_byte *mapb r->m_oper = op_or; } - mem_free ((void **) &op); + mem_free ((void **) (void *) &op); if (get_spec (&t, &sp, maps, mapb)) { @@ -2550,7 +2550,7 @@ grammar grammar_load_from_text (const byte *text) { map_byte *ma = NULL; - mem_free ((void **) &symbol); + mem_free ((void **) (void *) &symbol); if (get_emtcode (&text, &ma)) { @@ -2565,7 +2565,7 @@ grammar grammar_load_from_text (const byte *text) { map_byte *ma = NULL; - mem_free ((void **) &symbol); + mem_free ((void **) (void *) &symbol); if (get_regbyte (&text, &ma)) { @@ -2580,7 +2580,7 @@ grammar grammar_load_from_text (const byte *text) { map_str *ma = NULL; - mem_free ((void **) &symbol); + mem_free ((void **) (void *) &symbol); if (get_errtext (&text, &ma)) { @@ -2593,7 +2593,7 @@ grammar grammar_load_from_text (const byte *text) /* .string */ else if (is_dot && str_equal (symbol, (byte *) "string")) { - mem_free ((void **) &symbol); + mem_free ((void **) (void *) &symbol); if (g->di->m_string != NULL) { @@ -2760,7 +2760,7 @@ void grammar_get_last_error (byte *text, unsigned int size, int *pos) *text = '\0'; #define APPEND_CHARACTER(x) if (dots_made == 0) {\ - if (len < size - 1) {\ + if (len < (int)size - 1) {\ text[len++] = (x); text[len] = '\0';\ } else {\ int i;\ diff --git a/src/mesa/shader/nvfragprog.h b/src/mesa/shader/nvfragprog.h index ae26a7b5743..8f02f228770 100644 --- a/src/mesa/shader/nvfragprog.h +++ b/src/mesa/shader/nvfragprog.h @@ -62,6 +62,7 @@ /* Fragment program instruction opcodes */ enum fp_opcode { + FP_OPCODE_INVALID = -1, /* Force signed enum */ FP_OPCODE_ABS = 1000, /* ARB_f_p only */ FP_OPCODE_ADD, FP_OPCODE_CMP, /* ARB_f_p only */ diff --git a/src/mesa/shader/nvvertexec.c b/src/mesa/shader/nvvertexec.c index f92396c955d..e10cb1ac48a 100644 --- a/src/mesa/shader/nvvertexec.c +++ b/src/mesa/shader/nvvertexec.c @@ -358,8 +358,8 @@ store_vector4( const struct vp_dst_register *dest, * Set x to positive or negative infinity. */ #if defined(USE_IEEE) || defined(_WIN32) -#define SET_POS_INFINITY(x) ( *((GLuint *) &x) = 0x7F800000 ) -#define SET_NEG_INFINITY(x) ( *((GLuint *) &x) = 0xFF800000 ) +#define SET_POS_INFINITY(x) ( *((GLuint *) (void *)&x) = 0x7F800000 ) +#define SET_NEG_INFINITY(x) ( *((GLuint *) (void *)&x) = 0xFF800000 ) #elif defined(VMS) #define SET_POS_INFINITY(x) x = __MAXFLOAT #define SET_NEG_INFINITY(x) x = -__MAXFLOAT @@ -368,7 +368,7 @@ store_vector4( const struct vp_dst_register *dest, #define SET_NEG_INFINITY(x) x = (GLfloat) -HUGE_VAL #endif -#define SET_FLOAT_BITS(x, bits) ((fi_type *) &(x))->i = bits +#define SET_FLOAT_BITS(x, bits) ((fi_type *) (void *) &(x))->i = bits /** @@ -467,7 +467,7 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct vertex_program *program) GLint ii = (GLint) floor_t0; ii = (ii < 23) + 0x3f800000; SET_FLOAT_BITS(q[0], ii); - q[0] = *((GLfloat *) &ii); + q[0] = *((GLfloat *) (void *)&ii); #else q[0] = (GLfloat) pow(2.0, floor_t0); #endif diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index aa6ea2ef0bb..7e8e749d8cc 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -1023,6 +1023,7 @@ static GLboolean Parse_OptionSequence(struct parse_state *parseState, struct vp_instruction program[]) { + (void) program; while (1) { if (!Parse_String(parseState, "OPTION")) return GL_TRUE; /* ok, not an OPTION statement */ diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index daec9252fff..c451fede923 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -167,6 +167,7 @@ static struct program * _mesa_init_program_struct( GLcontext *ctx, struct program *prog, GLenum target, GLuint id) { + (void) ctx; if (prog) { prog->Id = id; prog->Target = target; @@ -239,6 +240,7 @@ _mesa_new_program(GLcontext *ctx, GLenum target, GLuint id) void _mesa_delete_program(GLcontext *ctx, struct program *prog) { + (void) ctx; ASSERT(prog); if (prog->String) diff --git a/src/mesa/swrast/s_auxbuffer.c b/src/mesa/swrast/s_auxbuffer.c index 05a06bde53e..5d58c106852 100644 --- a/src/mesa/swrast/s_auxbuffer.c +++ b/src/mesa/swrast/s_auxbuffer.c @@ -93,6 +93,7 @@ void _swrast_use_aux_buffer(GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit) { SWcontext *swrast = SWRAST_CONTEXT(ctx); + (void) buffer; switch (bufferBit) { case DD_AUX0_BIT: diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c index 7888bb618f7..26b4f902e14 100644 --- a/src/mesa/swrast/s_buffers.c +++ b/src/mesa/swrast/s_buffers.c @@ -176,6 +176,7 @@ _swrast_Clear( GLcontext *ctx, GLbitfield mask, GLint x, GLint y, GLint width, GLint height ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); + (void) all; (void) x; (void) y; (void) width; (void) height; #ifdef DEBUG { const GLbitfield legalBits = @@ -254,6 +255,7 @@ _swrast_alloc_buffers( GLframebuffer *buffer ) void _swrast_DrawBuffer( GLcontext *ctx, GLenum mode ) { + (void) mode; _swrast_use_draw_buffer(ctx); } diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 32475cf5391..a678e0b55b2 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -403,6 +403,7 @@ _swrast_validate_texture_sample( GLcontext *ctx, GLuint texUnit, static void _swrast_sleep( GLcontext *ctx, GLuint new_state ) { + (void) ctx; (void) new_state; } diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 0627dea9ddf..46f59ef3c02 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -151,6 +151,7 @@ interpolate_colors(GLcontext *ctx, struct sw_span *span) const GLuint n = span->end; GLchan (*rgba)[4] = span->array->rgba; GLuint i; + (void) ctx; ASSERT((span->interpMask & SPAN_RGBA) && !(span->arrayMask & SPAN_RGBA)); @@ -211,6 +212,7 @@ interpolate_indexes(GLcontext *ctx, struct sw_span *span) const GLuint n = span->end; GLuint *indexes = span->array->index; GLuint i; + (void) ctx; ASSERT((span->interpMask & SPAN_INDEX) && !(span->arrayMask & SPAN_INDEX)); @@ -236,6 +238,7 @@ interpolate_indexes(GLcontext *ctx, struct sw_span *span) static void interpolate_specular(GLcontext *ctx, struct sw_span *span) { + (void) ctx; if (span->interpMask & SPAN_FLAT) { /* constant color */ const GLchan r = FixedToChan(span->specRed); diff --git a/src/mesa/swrast/s_tcc.c b/src/mesa/swrast/s_tcc.c index 3d8f550ece7..550a2aabdb3 100644 --- a/src/mesa/swrast/s_tcc.c +++ b/src/mesa/swrast/s_tcc.c @@ -179,6 +179,10 @@ _swrast_execute_codegen_program( GLcontext *ctx, struct fp_machine *machine, const struct sw_span *span, GLuint column ) { + (void) ctx; + (void) program; (void) maxInst; + (void) machine; (void) span; + (void) column; return 0; } diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index 59f884c00f4..834c72c50bf 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -456,6 +456,7 @@ sample_1d_nearest(GLcontext *ctx, { const GLint width = img->Width2; /* without border, power of two */ GLint i; + (void) ctx; COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoord[0], width, i); @@ -486,6 +487,7 @@ sample_1d_linear(GLcontext *ctx, GLint i0, i1; GLfloat u; GLuint useBorderColor; + (void) ctx; COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, texcoord[0], u, width, i0, i1); @@ -657,6 +659,7 @@ sample_nearest_1d( GLcontext *ctx, GLuint texUnit, { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; + (void) texUnit; (void) lambda; for (i=0;iImage[0][tObj->BaseLevel]; + (void) texUnit; (void) lambda; for (i=0;iWidth2; /* without border, power of two */ const GLint height = img->Height2; /* without border, power of two */ GLint i, j; + (void) ctx; COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoord[0], width, i); COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapT, texcoord[1], height, j); @@ -809,6 +814,7 @@ sample_2d_linear(GLcontext *ctx, GLint i0, j0, i1, j1; GLuint useBorderColor; GLfloat u, v; + (void) ctx; COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, texcoord[0], u, width, i0, i1); COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapT, texcoord[1], v, height, j0, j1); @@ -917,7 +923,9 @@ sample_2d_linear_repeat(GLcontext *ctx, const GLint height = img->Height2; GLint i0, j0, i1, j1; GLfloat u, v; - + (void) ctx; + (void) tObj; + ASSERT(tObj->WrapS == GL_REPEAT); ASSERT(tObj->WrapT == GL_REPEAT); ASSERT(img->Border == 0); @@ -1117,6 +1125,7 @@ sample_nearest_2d( GLcontext *ctx, GLuint texUnit, { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; + (void) texUnit; (void) lambda; for (i=0;iImage[0][tObj->BaseLevel]; + (void) texUnit; (void) lambda; for (i=0;iHeight - 1; const GLint shift = img->WidthLog2; GLuint k; + (void) ctx; + (void) texUnit; (void) lambda; ASSERT(tObj->WrapS==GL_REPEAT); ASSERT(tObj->WrapT==GL_REPEAT); @@ -1201,6 +1213,8 @@ opt_sample_rgba_2d( GLcontext *ctx, GLuint texUnit, const GLint rowMask = img->Height - 1; const GLint shift = img->WidthLog2; GLuint i; + (void) ctx; + (void) texUnit; (void) lambda; ASSERT(tObj->WrapS==GL_REPEAT); ASSERT(tObj->WrapT==GL_REPEAT); @@ -1366,6 +1380,7 @@ sample_3d_nearest(GLcontext *ctx, const GLint height = img->Height2; /* without border, power of two */ const GLint depth = img->Depth2; /* without border, power of two */ GLint i, j, k; + (void) ctx; COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapS, texcoord[0], width, i); COMPUTE_NEAREST_TEXEL_LOCATION(tObj->WrapT, texcoord[1], height, j); @@ -1400,6 +1415,7 @@ sample_3d_linear(GLcontext *ctx, GLint i0, j0, k0, i1, j1, k1; GLuint useBorderColor; GLfloat u, v, w; + (void) ctx; COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapS, texcoord[0], u, width, i0, i1); COMPUTE_LINEAR_TEXEL_LOCATIONS(tObj->WrapT, texcoord[1], v, height, j0, j1); @@ -1651,6 +1667,7 @@ sample_nearest_3d(GLcontext *ctx, GLuint texUnit, { GLuint i; struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel]; + (void) texUnit; (void) lambda; for (i=0;iImage[0][tObj->BaseLevel]; + (void) texUnit; (void) lambda; for (i=0;iHeight - 1; GLuint i; + (void) ctx; (void) texUnit; (void) lambda; @@ -2108,6 +2133,7 @@ sample_linear_rect(GLcontext *ctx, GLuint texUnit, const GLint height_minus_1 = img->Height - 1; GLuint i; + (void) ctx; (void) texUnit; (void) lambda; @@ -2284,6 +2310,7 @@ sample_depth_texture( GLcontext *ctx, GLuint unit, GLenum function; GLchan result; + (void) lambda; (void) unit; ASSERT(tObj->Image[0][tObj->BaseLevel]->Format == GL_DEPTH_COMPONENT); @@ -3494,6 +3521,7 @@ texture_apply( const GLcontext *ctx, GLuint i; GLint Rc, Gc, Bc, Ac; GLenum format; + (void) primary_rgba; ASSERT(texUnit); ASSERT(texUnit->_Current); diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 5c8d1ebe294..a1a629c18d2 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -927,7 +927,7 @@ fast_persp_span(GLcontext *ctx, struct sw_span *span, const GLuint *zRow = (const GLuint *) \ _swrast_zbuffer_address(ctx, span.x, span.y); \ for (i = 0; i < span.end; i++) { \ - if (span.z < zRow[i]) { \ + if ((GLuint)span.z < zRow[i]) { \ ctx->OcclusionResult = GL_TRUE; \ ctx->Occlusion.PassedCounter++; \ } \ diff --git a/src/mesa/tnl/t_array_api.c b/src/mesa/tnl/t_array_api.c index cc709d3641d..c3e63582214 100644 --- a/src/mesa/tnl/t_array_api.c +++ b/src/mesa/tnl/t_array_api.c @@ -438,4 +438,5 @@ void _tnl_array_init( GLcontext *ctx ) */ void _tnl_array_destroy( GLcontext *ctx ) { + (void) ctx; } diff --git a/src/mesa/tnl/t_array_import.c b/src/mesa/tnl/t_array_import.c index 0e50c6fa9a1..dac64631558 100644 --- a/src/mesa/tnl/t_array_import.c +++ b/src/mesa/tnl/t_array_import.c @@ -201,6 +201,7 @@ static void _tnl_import_edgeflag( GLcontext *ctx, struct gl_client_array *tmp; GLboolean is_writeable = 0; const GLubyte *data; + (void) writeable; (void) stride; tmp = _ac_import_edgeflag(ctx, GL_UNSIGNED_BYTE, sizeof(GLubyte), diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c index 14a7d6089be..7e4f3fd2399 100644 --- a/src/mesa/tnl/t_context.c +++ b/src/mesa/tnl/t_context.c @@ -51,6 +51,7 @@ _tnl_MakeCurrent( GLcontext *ctx, GLframebuffer *drawBuffer, GLframebuffer *readBuffer ) { + (void) ctx; (void) drawBuffer; (void) readBuffer; } diff --git a/src/mesa/tnl/t_save_api.c b/src/mesa/tnl/t_save_api.c index c40de16fcac..5a7e6b5666b 100644 --- a/src/mesa/tnl/t_save_api.c +++ b/src/mesa/tnl/t_save_api.c @@ -179,6 +179,7 @@ build_normal_lengths( struct tnl_vertex_list *node ) static struct tnl_vertex_store *alloc_vertex_store( GLcontext *ctx ) { struct tnl_vertex_store *store = MALLOC_STRUCT(tnl_vertex_store); + (void) ctx; store->used = 0; store->refcount = 1; return store; @@ -187,6 +188,7 @@ static struct tnl_vertex_store *alloc_vertex_store( GLcontext *ctx ) static struct tnl_primitive_store *alloc_prim_store( GLcontext *ctx ) { struct tnl_primitive_store *store = MALLOC_STRUCT(tnl_primitive_store); + (void) ctx; store->used = 0; store->refcount = 1; return store; @@ -1241,6 +1243,7 @@ static void GLAPIENTRY _save_DrawElements(GLenum mode, GLsizei count, GLenum typ const GLvoid *indices) { GET_CURRENT_CONTEXT(ctx); + (void) mode; (void) count; (void) type; (void) indices; _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawElements" ); } @@ -1251,24 +1254,28 @@ static void GLAPIENTRY _save_DrawRangeElements(GLenum mode, const GLvoid *indices) { GET_CURRENT_CONTEXT(ctx); + (void) mode; (void) start; (void) end; (void) count; (void) type; (void) indices; _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawRangeElements" ); } static void GLAPIENTRY _save_DrawArrays(GLenum mode, GLint start, GLsizei count) { GET_CURRENT_CONTEXT(ctx); + (void) mode; (void) start; (void) count; _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawArrays" ); } static void GLAPIENTRY _save_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) { GET_CURRENT_CONTEXT(ctx); + (void) x1; (void) y1; (void) x2; (void) y2; _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glRectf" ); } static void GLAPIENTRY _save_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) { GET_CURRENT_CONTEXT(ctx); + (void) mode; (void) i1; (void) i2; _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh1" ); } @@ -1276,12 +1283,14 @@ static void GLAPIENTRY _save_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) { GET_CURRENT_CONTEXT(ctx); + (void) mode; (void) i1; (void) i2; (void) j1; (void) j2; _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh2" ); } static void GLAPIENTRY _save_Begin( GLenum mode ) { GET_CURRENT_CONTEXT( ctx ); + (void) mode; _mesa_compile_error( ctx, GL_INVALID_OPERATION, "Recursive glBegin" ); } @@ -1467,6 +1476,8 @@ void _tnl_NewList( GLcontext *ctx, GLuint list, GLenum mode ) { TNLcontext *tnl = TNL_CONTEXT(ctx); + (void) list; (void) mode; + if (!tnl->save.prim_store) tnl->save.prim_store = alloc_prim_store( ctx ); @@ -1481,21 +1492,25 @@ void _tnl_NewList( GLcontext *ctx, GLuint list, GLenum mode ) void _tnl_EndList( GLcontext *ctx ) { + (void) ctx; assert(TNL_CONTEXT(ctx)->save.vertex_size == 0); } void _tnl_BeginCallList( GLcontext *ctx, GLuint list ) { + (void) ctx; (void) list; } void _tnl_EndCallList( GLcontext *ctx ) { + (void) ctx; } static void _tnl_destroy_vertex_list( GLcontext *ctx, void *data ) { struct tnl_vertex_list *node = (struct tnl_vertex_list *)data; + (void) ctx; if ( --node->vertex_store->refcount == 0 ) FREE( node->vertex_store ); @@ -1512,6 +1527,7 @@ static void _tnl_print_vertex_list( GLcontext *ctx, void *data ) { struct tnl_vertex_list *node = (struct tnl_vertex_list *)data; GLuint i; + (void) ctx; _mesa_debug(0, "TNL-VERTEX-LIST, %u vertices %d primitives, %d vertsize\n", node->count, @@ -1597,4 +1613,5 @@ void _tnl_save_init( GLcontext *ctx ) */ void _tnl_save_destroy( GLcontext *ctx ) { + (void) ctx; } diff --git a/src/mesa/tnl/t_save_loopback.c b/src/mesa/tnl/t_save_loopback.c index 088b73609a6..18ecc3514fa 100644 --- a/src/mesa/tnl/t_save_loopback.c +++ b/src/mesa/tnl/t_save_loopback.c @@ -164,11 +164,13 @@ static attr_func mat_attrfunc[4] = { static void index_attr1fv(GLcontext *ctx, GLint target, const GLfloat *v) { + (void) target; ctx->Exec->Indexf(v[0]); } static void edgeflag_attr1fv(GLcontext *ctx, GLint target, const GLfloat *v) { + (void) target; ctx->Exec->EdgeFlag((GLboolean)(v[0] == 1.0)); } diff --git a/src/mesa/tnl/t_vb_render.c b/src/mesa/tnl/t_vb_render.c index cbeb9d5f71f..44a09f56c07 100644 --- a/src/mesa/tnl/t_vb_render.c +++ b/src/mesa/tnl/t_vb_render.c @@ -353,6 +353,7 @@ static void check_render( GLcontext *ctx, struct tnl_pipeline_stage *stage ) static void dtr( struct tnl_pipeline_stage *stage ) { + (void) stage; } diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index bfa96a457d4..7147193a0d6 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -160,6 +160,7 @@ static void insert_2f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_4f_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -170,6 +171,7 @@ static void insert_4f_4( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_4f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -180,6 +182,7 @@ static void insert_4f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_4f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -190,6 +193,7 @@ static void insert_4f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_4f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = 0; @@ -200,6 +204,7 @@ static void insert_4f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -208,12 +213,14 @@ static void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte *v, con static void insert_3f_xyw_err( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; (void) v; (void) in; abort(); } static void insert_3f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -223,6 +230,7 @@ static void insert_3f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_3f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -232,6 +240,7 @@ static void insert_3f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_3f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = 0; @@ -242,6 +251,7 @@ static void insert_3f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_2f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -250,6 +260,7 @@ static void insert_2f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_2f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); + (void) a; out[0] = in[0]; out[1] = 0; @@ -258,7 +269,8 @@ static void insert_2f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const G static void insert_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { GLfloat *out = (GLfloat *)(v); - + (void) a; + out[0] = in[0]; } @@ -266,6 +278,7 @@ static void insert_4chan_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte const GLfloat *in ) { GLchan *c = (GLchan *)v; + (void) a; UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]); @@ -276,6 +289,7 @@ static void insert_4chan_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte const GLfloat *in ) { GLchan *c = (GLchan *)v; + (void) a; UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]); @@ -286,6 +300,7 @@ static void insert_4chan_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte const GLfloat *in ) { GLchan *c = (GLchan *)v; + (void) a; UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]); c[2] = 0; @@ -296,6 +311,7 @@ static void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte const GLfloat *in ) { GLchan *c = (GLchan *)v; + (void) a; UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]); c[1] = 0; c[2] = 0; @@ -305,6 +321,7 @@ static void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte static void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]); @@ -314,6 +331,7 @@ static void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]); @@ -323,6 +341,7 @@ static void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); v[2] = 0; @@ -332,6 +351,7 @@ static void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); v[1] = 0; v[2] = 0; @@ -341,6 +361,7 @@ static void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]); @@ -350,6 +371,7 @@ static void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]); @@ -359,6 +381,7 @@ static void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); v[0] = 0; @@ -368,6 +391,7 @@ static void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); v[1] = 0; v[0] = 0; @@ -377,6 +401,7 @@ static void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v static void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]); @@ -385,6 +410,7 @@ static void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v, static void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); v[2] = 0; @@ -393,6 +419,7 @@ static void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v, static void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); v[1] = 0; v[2] = 0; @@ -401,6 +428,7 @@ static void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v, static void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]); @@ -409,6 +437,7 @@ static void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v, static void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]); v[0] = 0; @@ -417,6 +446,7 @@ static void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v, static void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]); v[1] = 0; v[0] = 0; @@ -426,6 +456,7 @@ static void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v, static void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { + (void) a; UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]); } @@ -481,6 +512,7 @@ static void extract_2f_viewport( const struct tnl_clipspace_attr *a, GLfloat *ou static void extract_4f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { const GLfloat *in = (const GLfloat *)v; + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -491,6 +523,7 @@ static void extract_4f( const struct tnl_clipspace_attr *a, GLfloat *out, const static void extract_3f_xyw( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { const GLfloat *in = (const GLfloat *)v; + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -502,6 +535,7 @@ static void extract_3f_xyw( const struct tnl_clipspace_attr *a, GLfloat *out, co static void extract_3f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { const GLfloat *in = (const GLfloat *)v; + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -513,6 +547,7 @@ static void extract_3f( const struct tnl_clipspace_attr *a, GLfloat *out, const static void extract_2f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { const GLfloat *in = (const GLfloat *)v; + (void) a; out[0] = in[0]; out[1] = in[1]; @@ -523,6 +558,7 @@ static void extract_2f( const struct tnl_clipspace_attr *a, GLfloat *out, const static void extract_1f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { const GLfloat *in = (const GLfloat *)v; + (void) a; out[0] = in[0]; out[1] = 0; @@ -534,6 +570,7 @@ static void extract_4chan_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat * const GLubyte *v ) { GLchan *c = (GLchan *)v; + (void) a; out[0] = CHAN_TO_FLOAT(c[0]); out[1] = CHAN_TO_FLOAT(c[1]); @@ -544,6 +581,7 @@ static void extract_4chan_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat * static void extract_4ub_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { + (void) a; out[0] = UBYTE_TO_FLOAT(v[0]); out[1] = UBYTE_TO_FLOAT(v[1]); out[2] = UBYTE_TO_FLOAT(v[2]); @@ -553,6 +591,7 @@ static void extract_4ub_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *ou static void extract_4ub_4f_bgra( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { + (void) a; out[2] = UBYTE_TO_FLOAT(v[0]); out[1] = UBYTE_TO_FLOAT(v[1]); out[0] = UBYTE_TO_FLOAT(v[2]); @@ -562,6 +601,7 @@ static void extract_4ub_4f_bgra( const struct tnl_clipspace_attr *a, GLfloat *ou static void extract_3ub_3f_rgb( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { + (void) a; out[0] = UBYTE_TO_FLOAT(v[0]); out[1] = UBYTE_TO_FLOAT(v[1]); out[2] = UBYTE_TO_FLOAT(v[2]); @@ -571,6 +611,7 @@ static void extract_3ub_3f_rgb( const struct tnl_clipspace_attr *a, GLfloat *out static void extract_3ub_3f_bgr( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { + (void) a; out[2] = UBYTE_TO_FLOAT(v[0]); out[1] = UBYTE_TO_FLOAT(v[1]); out[0] = UBYTE_TO_FLOAT(v[2]); @@ -579,6 +620,7 @@ static void extract_3ub_3f_bgr( const struct tnl_clipspace_attr *a, GLfloat *out static void extract_1ub_1f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v ) { + (void) a; out[0] = UBYTE_TO_FLOAT(v[0]); out[1] = 0; out[2] = 0; @@ -731,6 +773,7 @@ static void generic_interp( GLcontext *ctx, const struct tnl_clipspace_attr *a = vtx->attr; const GLuint attr_count = vtx->attr_count; GLuint j; + (void) force_boundary; if (tnl->NeedNdcCoords) { const GLfloat *dstclip = VB->ClipPtr->data[edst]; diff --git a/src/mesa/tnl/t_vertex_codegen.c b/src/mesa/tnl/t_vertex_codegen.c index e3e7f2ef1d2..4ff96430700 100644 --- a/src/mesa/tnl/t_vertex_codegen.c +++ b/src/mesa/tnl/t_vertex_codegen.c @@ -161,6 +161,7 @@ static GLboolean emit_3f_xyw_4( struct tnl_clipspace_codegen *p ) static GLboolean emit_3f_xyw_err( struct tnl_clipspace_codegen *p ) { + (void) p; assert(0); return GL_FALSE; } diff --git a/src/mesa/tnl/t_vtx_api.c b/src/mesa/tnl/t_vtx_api.c index e75ac5b3397..a6b8cc30130 100644 --- a/src/mesa/tnl/t_vtx_api.c +++ b/src/mesa/tnl/t_vtx_api.c @@ -345,6 +345,7 @@ static void _tnl_fixup_vertex( GLcontext *ctx, GLuint attr, GLuint sz ) ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; } +#ifdef USE_X86_ASM static struct _tnl_dynfn *lookup( struct _tnl_dynfn *l, GLuint key ) { @@ -382,11 +383,13 @@ static tnl_attrfv_func do_codegen( GLcontext *ctx, GLuint attr, GLuint sz ) } if (dfn) - return (tnl_attrfv_func) dfn->code; + return *(tnl_attrfv_func *) &dfn->code; else return 0; } +#endif /* USE_X86_ASM */ + /* Helper function for 'CHOOSE' macro. Do what's necessary when an * entrypoint is called for the first time. */ @@ -824,6 +827,7 @@ static void _tnl_exec_vtxfmt_init( GLcontext *ctx ) void _tnl_FlushVertices( GLcontext *ctx, GLuint flags ) { TNLcontext *tnl = TNL_CONTEXT(ctx); + (void) flags; if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) return; @@ -860,6 +864,7 @@ static void _tnl_current_init( GLcontext *ctx ) static struct _tnl_dynfn *no_codegen( GLcontext *ctx, int key ) { + (void) ctx; (void) key; return 0; } -- cgit v1.2.3 From d86d1483ac7da934e935372722999164bfcf6ef7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 9 Sep 2004 18:13:35 +0000 Subject: Another attempt at fixing name mangling and gl__unused413(). --- include/GL/gl_mangle.h | 1 + src/mesa/glapi/gl_apitemp.py | 4 ---- src/mesa/glapi/glapitemp.h | 4 ---- 3 files changed, 1 insertion(+), 8 deletions(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 8d3306b9fb1..873be540ab1 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -30,6 +30,7 @@ /* Internal symbols which may collide with other OpenGL implementations. */ #define __glCoreCreateContext __mglCoreCreateContext #define __glCoreNopDispatch __mglCoreNopDispatch +#define gl__unused413 MANGLE(__unused413) /*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */ diff --git a/src/mesa/glapi/gl_apitemp.py b/src/mesa/glapi/gl_apitemp.py index 8070c4fccf2..b8b32ac3624 100644 --- a/src/mesa/glapi/gl_apitemp.py +++ b/src/mesa/glapi/gl_apitemp.py @@ -129,11 +129,7 @@ class PrintGlOffsets(gl_XML.FilterGLAPISpecBase): #error RETURN_DISPATCH must be defined #endif -#ifdef USE_MGL_NAMESPACE -GLAPI void GLAPIENTRY mgl__unused413(void); /* silence warning */ -#else GLAPI void GLAPIENTRY gl__unused413(void); /* silence warning */ -#endif """ return diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index 9108826840e..579494ce817 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -69,11 +69,7 @@ #error RETURN_DISPATCH must be defined #endif -#ifdef USE_MGL_NAMESPACE -GLAPI void GLAPIENTRY mgl__unused413(void); /* silence warning */ -#else GLAPI void GLAPIENTRY gl__unused413(void); /* silence warning */ -#endif KEYWORD1 void KEYWORD2 NAME(NewList)(GLuint list, GLenum mode) { -- cgit v1.2.3 From 4f1e3709de54c3a511d6eb0bb7670956fb8f8d2c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 27 Sep 2004 22:40:22 +0000 Subject: change include of glx_mangle.h to match other headers --- include/GL/glx.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 083634261cb..ca4e9ed4f68 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 6.2 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2004 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"), @@ -46,7 +46,7 @@ #if defined(USE_MGL_NAMESPACE) -#include +#include "glx_mangle.h" #endif -- cgit v1.2.3 From be91a0be5899a1c542096f545ccd78a43794d4ac Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 27 Sep 2004 22:40:31 +0000 Subject: version bump --- include/GL/gl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index ca0ab31328f..3f3f310f855 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 6.2 * * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. * -- cgit v1.2.3 From 788ff5b5c7eca4f9ca689a4224a2cf944ee60edc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 2 Oct 2004 22:47:48 +0000 Subject: remove unused413 stuff, glDrawBuffersARB uses that slot now --- include/GL/gl_mangle.h | 1 - src/mesa/glapi/gl_apitemp.py | 1 - src/mesa/glapi/glapitemp.h | 1 - src/mesa/glapi/glapitemp.py | 3 +-- 4 files changed, 1 insertion(+), 5 deletions(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 873be540ab1..8d3306b9fb1 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -30,7 +30,6 @@ /* Internal symbols which may collide with other OpenGL implementations. */ #define __glCoreCreateContext __mglCoreCreateContext #define __glCoreNopDispatch __mglCoreNopDispatch -#define gl__unused413 MANGLE(__unused413) /*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */ diff --git a/src/mesa/glapi/gl_apitemp.py b/src/mesa/glapi/gl_apitemp.py index b8b32ac3624..a68fc7e6632 100644 --- a/src/mesa/glapi/gl_apitemp.py +++ b/src/mesa/glapi/gl_apitemp.py @@ -129,7 +129,6 @@ class PrintGlOffsets(gl_XML.FilterGLAPISpecBase): #error RETURN_DISPATCH must be defined #endif -GLAPI void GLAPIENTRY gl__unused413(void); /* silence warning */ """ return diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index da1a59789b9..c1b6b091a1c 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -69,7 +69,6 @@ #error RETURN_DISPATCH must be defined #endif -GLAPI void GLAPIENTRY gl__unused413(void); /* silence warning */ KEYWORD1 void KEYWORD2 NAME(NewList)(GLuint list, GLenum mode) { diff --git a/src/mesa/glapi/glapitemp.py b/src/mesa/glapi/glapitemp.py index 8ce3092213c..99e77a66976 100644 --- a/src/mesa/glapi/glapitemp.py +++ b/src/mesa/glapi/glapitemp.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# $Id: glapitemp.py,v 1.6 2004/06/29 19:08:20 idr Exp $ +# $Id: glapitemp.py,v 1.7 2004/10/02 22:47:48 brianp Exp $ # Mesa 3-D graphics library # Version: 4.1 @@ -84,7 +84,6 @@ def PrintHead(): #error RETURN_DISPATCH must be defined #endif -GLAPI void GLAPIENTRY gl__unused413(void); /* silence warning */ """ #enddef -- cgit v1.2.3 From 65a9ca33816773f4edcd1c88bf7bf139eb440f4c Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Tue, 12 Oct 2004 06:43:57 +0000 Subject: bump version numbers to their real values --- include/GL/dmesa.h | 2 +- include/GL/fxmesa.h | 4 ++-- include/GL/xmesa.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h index c7207bd8b6e..795853bceb5 100644 --- a/include/GL/dmesa.h +++ b/include/GL/dmesa.h @@ -35,7 +35,7 @@ #define DMESA_H_included #define DMESA_MAJOR_VERSION 6 -#define DMESA_MINOR_VERSION 1 +#define DMESA_MINOR_VERSION 3 /* Sample Usage: * diff --git a/include/GL/fxmesa.h b/include/GL/fxmesa.h index 057e6bd017e..f8e9661f9cc 100644 --- a/include/GL/fxmesa.h +++ b/include/GL/fxmesa.h @@ -38,8 +38,8 @@ extern "C" { #endif -#define FXMESA_MAJOR_VERSION 5 -#define FXMESA_MINOR_VERSION 0 +#define FXMESA_MAJOR_VERSION 6 +#define FXMESA_MINOR_VERSION 3 /* diff --git a/include/GL/xmesa.h b/include/GL/xmesa.h index 2b7f3675431..ab813b23baa 100644 --- a/include/GL/xmesa.h +++ b/include/GL/xmesa.h @@ -87,8 +87,8 @@ extern struct Library *XLibBase; #endif -#define XMESA_MAJOR_VERSION 4 -#define XMESA_MINOR_VERSION 1 +#define XMESA_MAJOR_VERSION 6 +#define XMESA_MINOR_VERSION 3 -- cgit v1.2.3 From 33899b7c351fda77bed6dee5e5d02e31c2f7e0e5 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Sat, 16 Oct 2004 01:16:54 +0000 Subject: Add support for OES_read_format. As soon as glext.h is updated with the enums for this extension, the changes to gl.h can be removed. --- include/GL/gl.h | 11 +++++++++++ progs/demos/readpix.c | 16 ++++++++++++++++ src/mesa/main/context.c | 3 +++ src/mesa/main/extensions.c | 1 + src/mesa/main/get.c | 28 ++++++++++++++++++++++++++++ src/mesa/main/mtypes.h | 4 ++++ 6 files changed, 63 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 3f3f310f855..0bf4cd8097d 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2226,6 +2226,17 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen #endif /* GL_ATI_blend_equation_separate */ +/* As soon as the official glext.h is updated to include this, it will be + * removed from here. + */ +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 + +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B + +#endif /* GL_OES_read_format */ + /** ** NOTE!!!!! If you add new functions to this file, or update ** glext.h be sure to regenerate the gl_mangle.h file. See comments diff --git a/progs/demos/readpix.c b/progs/demos/readpix.c index 784e4c88d7b..fc322f2e811 100644 --- a/progs/demos/readpix.c +++ b/progs/demos/readpix.c @@ -207,6 +207,8 @@ Key( unsigned char key, int x, int y ) static void Init( GLboolean ciMode ) { + GLboolean have_read_format = GL_FALSE; + printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); @@ -234,6 +236,20 @@ Init( GLboolean ciMode ) } } +#ifdef GL_OES_read_format + if ( glutExtensionSupported( "GL_OES_read_format" ) ) { + glGetIntegerv( GL_IMPLEMENTATION_COLOR_READ_TYPE_OES, & ReadType ); + glGetIntegerv( GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES, & ReadFormat ); + + have_read_format = GL_TRUE; + } +#endif + + printf( "GL_OES_read_format %ssupported. " + "Using type / format = 0x%04x / 0x%04x\n", + (have_read_format) ? "" : "not ", + ReadType, ReadFormat ); + printf("Loaded %d by %d image\n", ImgWidth, ImgHeight ); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 44e3fcb9adc..f90751fd092 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1114,6 +1114,9 @@ _mesa_init_constants( GLcontext *ctx ) ctx->Const.MaxDrawBuffers = MAX_DRAW_BUFFERS; + ctx->Const.ColorReadFormat = GL_RGBA; + ctx->Const.ColorReadType = GL_UNSIGNED_BYTE; + /* sanity checks */ ASSERT(ctx->Const.MaxTextureUnits == MAX2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits)); } diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index a8003116fad..11c7ae55384 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -141,6 +141,7 @@ static const struct { { ON, "GL_NV_texgen_reflection", F(NV_texgen_reflection) }, { OFF, "GL_NV_vertex_program", F(NV_vertex_program) }, { OFF, "GL_NV_vertex_program1_1", F(NV_vertex_program1_1) }, + { ON, "GL_OES_read_format", F(OES_read_format) }, { OFF, "GL_SGI_color_matrix", F(SGI_color_matrix) }, { OFF, "GL_SGI_color_table", F(SGI_color_table) }, { OFF, "GL_SGI_texture_color_table", F(SGI_texture_color_table) }, diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 6eac604ea51..646e6ac20fc 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1723,6 +1723,13 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) } break; + case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: + *params = INT_TO_BOOL(ctx->Const.ColorReadType); + return; + case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: + *params = INT_TO_BOOL(ctx->Const.ColorReadFormat); + return; + default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv(pname=0x%x)", pname); } @@ -3317,6 +3324,13 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) } break; + case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: + *params = (GLdouble) ctx->Const.ColorReadType; + return; + case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: + *params = (GLdouble) ctx->Const.ColorReadFormat; + return; + default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev(pname=0x%x)", pname); } @@ -4887,6 +4901,13 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) } break; + case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: + *params = (GLfloat) ctx->Const.ColorReadType; + return; + case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: + *params = (GLfloat) ctx->Const.ColorReadFormat; + return; + default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv(0x%x)", pname); } @@ -6495,6 +6516,13 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) } break; + case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: + *params = ctx->Const.ColorReadType; + return; + case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: + *params = ctx->Const.ColorReadFormat; + return; + default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv(pname=0x%x)", pname); } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 4086ef94bed..37b940dea9d 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1913,6 +1913,9 @@ struct gl_constants GLboolean CheckArrayBounds; /* GL_ARB_draw_buffers */ GLuint MaxDrawBuffers; + /* GL_OES_read_format */ + GLenum ColorReadFormat; + GLenum ColorReadType; }; @@ -2015,6 +2018,7 @@ struct gl_extensions GLboolean NV_texture_rectangle; GLboolean NV_vertex_program; GLboolean NV_vertex_program1_1; + GLboolean OES_read_format; GLboolean SGI_color_matrix; GLboolean SGI_color_table; GLboolean SGI_texture_color_table; -- cgit v1.2.3 From bcd8735546f3842f917f2cdc4ff530e4215f01a1 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 25 Oct 2004 20:52:11 +0000 Subject: Import sarea.h from Xorg, needed for client GLX code. --- include/GL/internal/sarea.h | 94 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 include/GL/internal/sarea.h (limited to 'include') diff --git a/include/GL/internal/sarea.h b/include/GL/internal/sarea.h new file mode 100644 index 00000000000..77c16e0efe2 --- /dev/null +++ b/include/GL/internal/sarea.h @@ -0,0 +1,94 @@ +/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */ +/** + * \file sarea.h + * SAREA definitions. + * + * \author Kevin E. Martin + * \author Jens Owen + * \author Rickard E. (Rik) Faith + */ + +/* + * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. + * Copyright 2000 VA Linux Systems, Inc. + * 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, sub license, 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 (including the + * next paragraph) 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 NON-INFRINGEMENT. + * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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. + */ + +/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */ + +#ifndef _SAREA_H_ +#define _SAREA_H_ + +#include "xf86drm.h" + +/* SAREA area needs to be at least a page */ +#if defined(__alpha__) +#define SAREA_MAX 0x2000 +#elif defined(__ia64__) +#define SAREA_MAX 0x10000 /* 64kB */ +#else +/* Intel 830M driver needs at least 8k SAREA */ +#define SAREA_MAX 0x2000 +#endif + +#define SAREA_MAX_DRAWABLES 256 + +#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000 + +/** + * SAREA per drawable information. + * + * \sa _XF86DRISAREA. + */ +typedef struct _XF86DRISAREADrawable { + unsigned int stamp; + unsigned int flags; +} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr; + +/** + * SAREA frame information. + * + * \sa _XF86DRISAREA. + */ +typedef struct _XF86DRISAREAFrame { + unsigned int x; + unsigned int y; + unsigned int width; + unsigned int height; + unsigned int fullscreen; +} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr; + +/** + * SAREA definition. + */ +typedef struct _XF86DRISAREA { + /** first thing is always the DRM locking structure */ + drmLock lock; + /** \todo Use readers/writer lock for drawable_lock */ + drmLock drawable_lock; + XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES]; + XF86DRISAREAFrameRec frame; + drm_context_t dummy_context; +} XF86DRISAREARec, *XF86DRISAREAPtr; + +#endif -- cgit v1.2.3 From 83889ffd970a807074d834849677fd233c031dc7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 8 Nov 2004 15:08:48 +0000 Subject: Remove need for defining _MSC_VER when building Mesa for windows with a non MS C compiler (MinGW). (Gregor Anich) --- include/GL/gl.h | 4 ++-- include/GL/glut.h | 4 ++-- include/GL/mesa_wgl.h | 6 +++--- include/GL/wmesa.h | 2 +- src/mesa/Makefile.mgw | 2 +- src/mesa/drivers/windows/gdi/wmesa.c | 6 ++++-- src/mesa/drivers/windows/gdi/wmesadef.h | 2 +- src/mesa/main/glheader.h | 4 ++-- 8 files changed, 16 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 0bf4cd8097d..d9c6e30eb24 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -53,9 +53,9 @@ #endif #if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) -# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ +# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ # define GLAPI __declspec(dllexport) -# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ +# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ # define GLAPI __declspec(dllimport) # else /* for use with static link lib build of Win32 edition only */ # define GLAPI extern diff --git a/include/GL/glut.h b/include/GL/glut.h index 3a67f1f560d..7977dc94c92 100644 --- a/include/GL/glut.h +++ b/include/GL/glut.h @@ -75,7 +75,7 @@ extern "C" { To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */ /* XXX This is from Win32's */ -# if !defined(_MSC_VER) && !defined(__cdecl) +# if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__cdecl) /* Define __cdecl for non-Microsoft compilers. */ # define __cdecl # define GLUT_DEFINED___CDECL @@ -108,7 +108,7 @@ extern _CRTIMP void __cdecl exit(int); and redifinition of Windows system defs, also removes requirement of pretty much any standard windows header from this file */ -#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__) +#if (_MSC_VER >= 800) || defined(__MINGW32__) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__) # define GLUTAPIENTRY __stdcall #else # define GLUTAPIENTRY diff --git a/include/GL/mesa_wgl.h b/include/GL/mesa_wgl.h index a331bb3514b..21473763ed5 100644 --- a/include/GL/mesa_wgl.h +++ b/include/GL/mesa_wgl.h @@ -32,7 +32,7 @@ #define _mesa_wgl_h_ -#include +#include #ifdef __cplusplus extern "C" { @@ -40,10 +40,10 @@ extern "C" { #if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__)) -# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ +# if (defined(_MSC_VER) || defined(__MINGW32__)) && 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 */ +# elif (defined(_MSC_VER) || defined(__MINGW32__)) && 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 */ diff --git a/include/GL/wmesa.h b/include/GL/wmesa.h index 79b3c823029..0a6e8b64246 100644 --- a/include/GL/wmesa.h +++ b/include/GL/wmesa.h @@ -50,7 +50,7 @@ extern "C" { #endif -#include "gl\gl.h" +#include "GL/gl.h" #if defined(_MSV_VER) && !defined(__GNUC__) # pragma warning (disable:4273) diff --git a/src/mesa/Makefile.mgw b/src/mesa/Makefile.mgw index 336463ec78f..80145e50f52 100644 --- a/src/mesa/Makefile.mgw +++ b/src/mesa/Makefile.mgw @@ -71,7 +71,7 @@ endif LDLIBS = -lgdi32 CC = mingw32-gcc -CFLAGS += -DBUILD_GL32 -D_OPENGL32_ -D_MSC_VER +CFLAGS += -DBUILD_GL32 -D_OPENGL32_ CFLAGS += $(INCLUDE_DIRS) CFLAGS += -DUSE_EXTERNAL_DXTN_LIB=1 ifeq ($(FX),1) diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index 96cfafff4c3..acd5f4a34fb 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -18,7 +18,7 @@ * Updated for Mesa 4.0 by Karl Schultz (kschultz@sourceforge.net) */ -#ifdef NDEBUG +#if defined(NDEBUG) && defined(_MSC_VER) #pragma auto_inline(on) #pragma inline_depth(255) #pragma inline_recursion(on) @@ -74,7 +74,7 @@ /* Stereo and parallel not tested for Mesa 4.0. */ #define NO_STEREO #if !defined(NO_STEREO) -#include "gl\glu.h" +#include "GL/glu.h" #include "stereo.h" #endif @@ -114,6 +114,8 @@ WMesaContext WC = NULL; #if defined(_MSC_VER) && _MSC_VER >= 1200 #define FORCEINLINE __forceinline +#elif defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) +#define FORCEINLINE __attribute__((always_inline)) #else #define FORCEINLINE __inline #endif diff --git a/src/mesa/drivers/windows/gdi/wmesadef.h b/src/mesa/drivers/windows/gdi/wmesadef.h index 3c267aa0f6a..d43e990ed3c 100644 --- a/src/mesa/drivers/windows/gdi/wmesadef.h +++ b/src/mesa/drivers/windows/gdi/wmesadef.h @@ -70,7 +70,7 @@ #include -#include +#include #include "context.h" #ifdef DDRAW #define DIRECTDRAW_VERSION 0x0100 diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h index 3057770d095..5068e90c609 100644 --- a/src/mesa/main/glheader.h +++ b/src/mesa/main/glheader.h @@ -98,10 +98,10 @@ # pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ # endif # endif -# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ +# if (defined(_MSC_VER) || defined(__MINGW32__)) && 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 */ +# elif (defined(_MSC_VER) || defined(__MINGW32__)) && 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 */ -- cgit v1.2.3 From b653aaede5abf39f91f9d1152bb411572950184f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 25 Nov 2004 23:20:07 +0000 Subject: minor APIENTRY clean-ups --- include/GL/gl.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index d9c6e30eb24..da617cff710 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -64,11 +64,7 @@ #elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */ # define GLAPI extern # define GLAPIENTRY __stdcall -#else -/* non-Windows compilation */ -# define GLAPI extern -# define GLAPIENTRY -#endif /* WIN32 / CYGWIN bracket */ +#endif /* WIN32 && !CYGWIN */ #if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__) # define PRAGMA_EXPORT_SUPPORTED 1 @@ -95,10 +91,22 @@ #pragma import on #endif +#ifndef GLAPI +#define GLAPI extern +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + #ifndef APIENTRY #define APIENTRY GLAPIENTRY #endif + +/* "P" suffix for when function returns a pointer */ +#ifndef APIENTRYP #define APIENTRYP APIENTRY * +#endif #ifndef GLAPIENTRYP #define GLAPIENTRYP GLAPIENTRY * @@ -844,7 +852,7 @@ GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode ); GLAPI GLenum GLAPIENTRY glGetError( void ); -GLAPI const GLubyte* GLAPIENTRY glGetString( GLenum name ); +GLAPI const GLubyte GLAPIENTRYP glGetString( GLenum name ); GLAPI void GLAPIENTRY glFinish( void ); -- cgit v1.2.3 From 2dd5b9edaa8238c4f50f6191b3e50ba59db5ad47 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 27 Nov 2004 04:54:48 +0000 Subject: typedef GLUTproc, return it from glutGetProcAddress() --- include/GL/glut.h | 3 +- src/glut/glx/glut_ext.c | 240 ++++++++++++++++++++++++------------------------ 2 files changed, 122 insertions(+), 121 deletions(-) (limited to 'include') diff --git a/include/GL/glut.h b/include/GL/glut.h index 7977dc94c92..c1b78aa4e59 100644 --- a/include/GL/glut.h +++ b/include/GL/glut.h @@ -664,7 +664,8 @@ GLUTAPI int GLUTAPIENTRY glutGetModifiers(void); GLUTAPI int GLUTAPIENTRY glutLayerGet(GLenum type); #endif #if (GLUT_API_VERSION >= 5) -GLUTAPI void * GLUTAPIENTRY glutGetProcAddress(const char *procName); +typedef void (*GLUTproc)(); +GLUTAPI GLUTproc GLUTAPIENTRY glutGetProcAddress(const char *procName); #endif /* GLUT font sub-API */ diff --git a/src/glut/glx/glut_ext.c b/src/glut/glx/glut_ext.c index a7a56fbef8d..922a94b20dd 100644 --- a/src/glut/glx/glut_ext.c +++ b/src/glut/glx/glut_ext.c @@ -53,145 +53,145 @@ glutExtensionSupported(const char *extension) struct name_address_pair { const char *name; - const void *address; + const GLUTproc address; }; static struct name_address_pair glut_functions[] = { - { "glutInit", (const void *) glutInit }, - { "glutInitDisplayMode", (const void *) glutInitDisplayMode }, - { "glutInitDisplayString", (const void *) glutInitDisplayString }, - { "glutInitWindowPosition", (const void *) glutInitWindowPosition }, - { "glutInitWindowSize", (const void *) glutInitWindowSize }, - { "glutMainLoop", (const void *) glutMainLoop }, - { "glutCreateWindow", (const void *) glutCreateWindow }, - { "glutCreateSubWindow", (const void *) glutCreateSubWindow }, - { "glutDestroyWindow", (const void *) glutDestroyWindow }, - { "glutPostRedisplay", (const void *) glutPostRedisplay }, - { "glutPostWindowRedisplay", (const void *) glutPostWindowRedisplay }, - { "glutSwapBuffers", (const void *) glutSwapBuffers }, - { "glutGetWindow", (const void *) glutGetWindow }, - { "glutSetWindow", (const void *) glutSetWindow }, - { "glutSetWindowTitle", (const void *) glutSetWindowTitle }, - { "glutSetIconTitle", (const void *) glutSetIconTitle }, - { "glutPositionWindow", (const void *) glutPositionWindow }, - { "glutReshapeWindow", (const void *) glutReshapeWindow }, - { "glutPopWindow", (const void *) glutPopWindow }, - { "glutPushWindow", (const void *) glutPushWindow }, - { "glutIconifyWindow", (const void *) glutIconifyWindow }, - { "glutShowWindow", (const void *) glutShowWindow }, - { "glutHideWindow", (const void *) glutHideWindow }, - { "glutFullScreen", (const void *) glutFullScreen }, - { "glutSetCursor", (const void *) glutSetCursor }, - { "glutWarpPointer", (const void *) glutWarpPointer }, - { "glutEstablishOverlay", (const void *) glutEstablishOverlay }, - { "glutRemoveOverlay", (const void *) glutRemoveOverlay }, - { "glutUseLayer", (const void *) glutUseLayer }, - { "glutPostOverlayRedisplay", (const void *) glutPostOverlayRedisplay }, - { "glutPostWindowOverlayRedisplay", (const void *) glutPostWindowOverlayRedisplay }, - { "glutShowOverlay", (const void *) glutShowOverlay }, - { "glutHideOverlay", (const void *) glutHideOverlay }, - { "glutCreateMenu", (const void *) glutCreateMenu }, - { "glutDestroyMenu", (const void *) glutDestroyMenu }, - { "glutGetMenu", (const void *) glutGetMenu }, - { "glutSetMenu", (const void *) glutSetMenu }, - { "glutAddMenuEntry", (const void *) glutAddMenuEntry }, - { "glutAddSubMenu", (const void *) glutAddSubMenu }, - { "glutChangeToMenuEntry", (const void *) glutChangeToMenuEntry }, - { "glutChangeToSubMenu", (const void *) glutChangeToSubMenu }, - { "glutRemoveMenuItem", (const void *) glutRemoveMenuItem }, - { "glutAttachMenu", (const void *) glutAttachMenu }, - { "glutDetachMenu", (const void *) glutDetachMenu }, - { "glutDisplayFunc", (const void *) glutDisplayFunc }, - { "glutReshapeFunc", (const void *) glutReshapeFunc }, - { "glutKeyboardFunc", (const void *) glutKeyboardFunc }, - { "glutMouseFunc", (const void *) glutMouseFunc }, - { "glutMotionFunc", (const void *) glutMotionFunc }, - { "glutPassiveMotionFunc", (const void *) glutPassiveMotionFunc }, - { "glutEntryFunc", (const void *) glutEntryFunc }, - { "glutVisibilityFunc", (const void *) glutVisibilityFunc }, - { "glutIdleFunc", (const void *) glutIdleFunc }, - { "glutTimerFunc", (const void *) glutTimerFunc }, - { "glutMenuStateFunc", (const void *) glutMenuStateFunc }, - { "glutSpecialFunc", (const void *) glutSpecialFunc }, - { "glutSpaceballMotionFunc", (const void *) glutSpaceballMotionFunc }, - { "glutSpaceballRotateFunc", (const void *) glutSpaceballRotateFunc }, - { "glutSpaceballButtonFunc", (const void *) glutSpaceballButtonFunc }, - { "glutButtonBoxFunc", (const void *) glutButtonBoxFunc }, - { "glutDialsFunc", (const void *) glutDialsFunc }, - { "glutTabletMotionFunc", (const void *) glutTabletMotionFunc }, - { "glutTabletButtonFunc", (const void *) glutTabletButtonFunc }, - { "glutMenuStatusFunc", (const void *) glutMenuStatusFunc }, - { "glutOverlayDisplayFunc", (const void *) glutOverlayDisplayFunc }, - { "glutWindowStatusFunc", (const void *) glutWindowStatusFunc }, - { "glutKeyboardUpFunc", (const void *) glutKeyboardUpFunc }, - { "glutSpecialUpFunc", (const void *) glutSpecialUpFunc }, - { "glutJoystickFunc", (const void *) glutJoystickFunc }, - { "glutSetColor", (const void *) glutSetColor }, - { "glutGetColor", (const void *) glutGetColor }, - { "glutCopyColormap", (const void *) glutCopyColormap }, - { "glutGet", (const void *) glutGet }, - { "glutDeviceGet", (const void *) glutDeviceGet }, - { "glutExtensionSupported", (const void *) glutExtensionSupported }, - { "glutGetModifiers", (const void *) glutGetModifiers }, - { "glutLayerGet", (const void *) glutLayerGet }, - { "glutGetProcAddress", (const void *) glutGetProcAddress }, - { "glutBitmapCharacter", (const void *) glutBitmapCharacter }, - { "glutBitmapWidth", (const void *) glutBitmapWidth }, - { "glutStrokeCharacter", (const void *) glutStrokeCharacter }, - { "glutStrokeWidth", (const void *) glutStrokeWidth }, - { "glutBitmapLength", (const void *) glutBitmapLength }, - { "glutStrokeLength", (const void *) glutStrokeLength }, - { "glutWireSphere", (const void *) glutWireSphere }, - { "glutSolidSphere", (const void *) glutSolidSphere }, - { "glutWireCone", (const void *) glutWireCone }, - { "glutSolidCone", (const void *) glutSolidCone }, - { "glutWireCube", (const void *) glutWireCube }, - { "glutSolidCube", (const void *) glutSolidCube }, - { "glutWireTorus", (const void *) glutWireTorus }, - { "glutSolidTorus", (const void *) glutSolidTorus }, - { "glutWireDodecahedron", (const void *) glutWireDodecahedron }, - { "glutSolidDodecahedron", (const void *) glutSolidDodecahedron }, - { "glutWireTeapot", (const void *) glutWireTeapot }, - { "glutSolidTeapot", (const void *) glutSolidTeapot }, - { "glutWireOctahedron", (const void *) glutWireOctahedron }, - { "glutSolidOctahedron", (const void *) glutSolidOctahedron }, - { "glutWireTetrahedron", (const void *) glutWireTetrahedron }, - { "glutSolidTetrahedron", (const void *) glutSolidTetrahedron }, - { "glutWireIcosahedron", (const void *) glutWireIcosahedron }, - { "glutSolidIcosahedron", (const void *) glutSolidIcosahedron }, - { "glutVideoResizeGet", (const void *) glutVideoResizeGet }, - { "glutSetupVideoResizing", (const void *) glutSetupVideoResizing }, - { "glutStopVideoResizing", (const void *) glutStopVideoResizing }, - { "glutVideoResize", (const void *) glutVideoResize }, - { "glutVideoPan", (const void *) glutVideoPan }, - { "glutReportErrors", (const void *) glutReportErrors }, - { "glutIgnoreKeyRepeat", (const void *) glutIgnoreKeyRepeat }, - { "glutSetKeyRepeat", (const void *) glutSetKeyRepeat }, - { "glutForceJoystickFunc", (const void *) glutForceJoystickFunc }, - { "glutGameModeString", (const void *) glutGameModeString }, - { "glutEnterGameMode", (const void *) glutEnterGameMode }, - { "glutLeaveGameMode", (const void *) glutLeaveGameMode }, - { "glutGameModeGet", (const void *) glutGameModeGet }, + { "glutInit", (const GLUTproc) glutInit }, + { "glutInitDisplayMode", (const GLUTproc) glutInitDisplayMode }, + { "glutInitDisplayString", (const GLUTproc) glutInitDisplayString }, + { "glutInitWindowPosition", (const GLUTproc) glutInitWindowPosition }, + { "glutInitWindowSize", (const GLUTproc) glutInitWindowSize }, + { "glutMainLoop", (const GLUTproc) glutMainLoop }, + { "glutCreateWindow", (const GLUTproc) glutCreateWindow }, + { "glutCreateSubWindow", (const GLUTproc) glutCreateSubWindow }, + { "glutDestroyWindow", (const GLUTproc) glutDestroyWindow }, + { "glutPostRedisplay", (const GLUTproc) glutPostRedisplay }, + { "glutPostWindowRedisplay", (const GLUTproc) glutPostWindowRedisplay }, + { "glutSwapBuffers", (const GLUTproc) glutSwapBuffers }, + { "glutGetWindow", (const GLUTproc) glutGetWindow }, + { "glutSetWindow", (const GLUTproc) glutSetWindow }, + { "glutSetWindowTitle", (const GLUTproc) glutSetWindowTitle }, + { "glutSetIconTitle", (const GLUTproc) glutSetIconTitle }, + { "glutPositionWindow", (const GLUTproc) glutPositionWindow }, + { "glutReshapeWindow", (const GLUTproc) glutReshapeWindow }, + { "glutPopWindow", (const GLUTproc) glutPopWindow }, + { "glutPushWindow", (const GLUTproc) glutPushWindow }, + { "glutIconifyWindow", (const GLUTproc) glutIconifyWindow }, + { "glutShowWindow", (const GLUTproc) glutShowWindow }, + { "glutHideWindow", (const GLUTproc) glutHideWindow }, + { "glutFullScreen", (const GLUTproc) glutFullScreen }, + { "glutSetCursor", (const GLUTproc) glutSetCursor }, + { "glutWarpPointer", (const GLUTproc) glutWarpPointer }, + { "glutEstablishOverlay", (const GLUTproc) glutEstablishOverlay }, + { "glutRemoveOverlay", (const GLUTproc) glutRemoveOverlay }, + { "glutUseLayer", (const GLUTproc) glutUseLayer }, + { "glutPostOverlayRedisplay", (const GLUTproc) glutPostOverlayRedisplay }, + { "glutPostWindowOverlayRedisplay", (const GLUTproc) glutPostWindowOverlayRedisplay }, + { "glutShowOverlay", (const GLUTproc) glutShowOverlay }, + { "glutHideOverlay", (const GLUTproc) glutHideOverlay }, + { "glutCreateMenu", (const GLUTproc) glutCreateMenu }, + { "glutDestroyMenu", (const GLUTproc) glutDestroyMenu }, + { "glutGetMenu", (const GLUTproc) glutGetMenu }, + { "glutSetMenu", (const GLUTproc) glutSetMenu }, + { "glutAddMenuEntry", (const GLUTproc) glutAddMenuEntry }, + { "glutAddSubMenu", (const GLUTproc) glutAddSubMenu }, + { "glutChangeToMenuEntry", (const GLUTproc) glutChangeToMenuEntry }, + { "glutChangeToSubMenu", (const GLUTproc) glutChangeToSubMenu }, + { "glutRemoveMenuItem", (const GLUTproc) glutRemoveMenuItem }, + { "glutAttachMenu", (const GLUTproc) glutAttachMenu }, + { "glutDetachMenu", (const GLUTproc) glutDetachMenu }, + { "glutDisplayFunc", (const GLUTproc) glutDisplayFunc }, + { "glutReshapeFunc", (const GLUTproc) glutReshapeFunc }, + { "glutKeyboardFunc", (const GLUTproc) glutKeyboardFunc }, + { "glutMouseFunc", (const GLUTproc) glutMouseFunc }, + { "glutMotionFunc", (const GLUTproc) glutMotionFunc }, + { "glutPassiveMotionFunc", (const GLUTproc) glutPassiveMotionFunc }, + { "glutEntryFunc", (const GLUTproc) glutEntryFunc }, + { "glutVisibilityFunc", (const GLUTproc) glutVisibilityFunc }, + { "glutIdleFunc", (const GLUTproc) glutIdleFunc }, + { "glutTimerFunc", (const GLUTproc) glutTimerFunc }, + { "glutMenuStateFunc", (const GLUTproc) glutMenuStateFunc }, + { "glutSpecialFunc", (const GLUTproc) glutSpecialFunc }, + { "glutSpaceballMotionFunc", (const GLUTproc) glutSpaceballMotionFunc }, + { "glutSpaceballRotateFunc", (const GLUTproc) glutSpaceballRotateFunc }, + { "glutSpaceballButtonFunc", (const GLUTproc) glutSpaceballButtonFunc }, + { "glutButtonBoxFunc", (const GLUTproc) glutButtonBoxFunc }, + { "glutDialsFunc", (const GLUTproc) glutDialsFunc }, + { "glutTabletMotionFunc", (const GLUTproc) glutTabletMotionFunc }, + { "glutTabletButtonFunc", (const GLUTproc) glutTabletButtonFunc }, + { "glutMenuStatusFunc", (const GLUTproc) glutMenuStatusFunc }, + { "glutOverlayDisplayFunc", (const GLUTproc) glutOverlayDisplayFunc }, + { "glutWindowStatusFunc", (const GLUTproc) glutWindowStatusFunc }, + { "glutKeyboardUpFunc", (const GLUTproc) glutKeyboardUpFunc }, + { "glutSpecialUpFunc", (const GLUTproc) glutSpecialUpFunc }, + { "glutJoystickFunc", (const GLUTproc) glutJoystickFunc }, + { "glutSetColor", (const GLUTproc) glutSetColor }, + { "glutGetColor", (const GLUTproc) glutGetColor }, + { "glutCopyColormap", (const GLUTproc) glutCopyColormap }, + { "glutGet", (const GLUTproc) glutGet }, + { "glutDeviceGet", (const GLUTproc) glutDeviceGet }, + { "glutExtensionSupported", (const GLUTproc) glutExtensionSupported }, + { "glutGetModifiers", (const GLUTproc) glutGetModifiers }, + { "glutLayerGet", (const GLUTproc) glutLayerGet }, + { "glutGetProcAddress", (const GLUTproc) glutGetProcAddress }, + { "glutBitmapCharacter", (const GLUTproc) glutBitmapCharacter }, + { "glutBitmapWidth", (const GLUTproc) glutBitmapWidth }, + { "glutStrokeCharacter", (const GLUTproc) glutStrokeCharacter }, + { "glutStrokeWidth", (const GLUTproc) glutStrokeWidth }, + { "glutBitmapLength", (const GLUTproc) glutBitmapLength }, + { "glutStrokeLength", (const GLUTproc) glutStrokeLength }, + { "glutWireSphere", (const GLUTproc) glutWireSphere }, + { "glutSolidSphere", (const GLUTproc) glutSolidSphere }, + { "glutWireCone", (const GLUTproc) glutWireCone }, + { "glutSolidCone", (const GLUTproc) glutSolidCone }, + { "glutWireCube", (const GLUTproc) glutWireCube }, + { "glutSolidCube", (const GLUTproc) glutSolidCube }, + { "glutWireTorus", (const GLUTproc) glutWireTorus }, + { "glutSolidTorus", (const GLUTproc) glutSolidTorus }, + { "glutWireDodecahedron", (const GLUTproc) glutWireDodecahedron }, + { "glutSolidDodecahedron", (const GLUTproc) glutSolidDodecahedron }, + { "glutWireTeapot", (const GLUTproc) glutWireTeapot }, + { "glutSolidTeapot", (const GLUTproc) glutSolidTeapot }, + { "glutWireOctahedron", (const GLUTproc) glutWireOctahedron }, + { "glutSolidOctahedron", (const GLUTproc) glutSolidOctahedron }, + { "glutWireTetrahedron", (const GLUTproc) glutWireTetrahedron }, + { "glutSolidTetrahedron", (const GLUTproc) glutSolidTetrahedron }, + { "glutWireIcosahedron", (const GLUTproc) glutWireIcosahedron }, + { "glutSolidIcosahedron", (const GLUTproc) glutSolidIcosahedron }, + { "glutVideoResizeGet", (const GLUTproc) glutVideoResizeGet }, + { "glutSetupVideoResizing", (const GLUTproc) glutSetupVideoResizing }, + { "glutStopVideoResizing", (const GLUTproc) glutStopVideoResizing }, + { "glutVideoResize", (const GLUTproc) glutVideoResize }, + { "glutVideoPan", (const GLUTproc) glutVideoPan }, + { "glutReportErrors", (const GLUTproc) glutReportErrors }, + { "glutIgnoreKeyRepeat", (const GLUTproc) glutIgnoreKeyRepeat }, + { "glutSetKeyRepeat", (const GLUTproc) glutSetKeyRepeat }, + { "glutForceJoystickFunc", (const GLUTproc) glutForceJoystickFunc }, + { "glutGameModeString", (const GLUTproc) glutGameModeString }, + { "glutEnterGameMode", (const GLUTproc) glutEnterGameMode }, + { "glutLeaveGameMode", (const GLUTproc) glutLeaveGameMode }, + { "glutGameModeGet", (const GLUTproc) glutGameModeGet }, { NULL, NULL } }; /* XXX This isn't an official GLUT function, yet */ -void * GLUTAPIENTRY +GLUTproc GLUTAPIENTRY glutGetProcAddress(const char *procName) { /* Try GLUT functions first */ int i; for (i = 0; glut_functions[i].name; i++) { if (strcmp(glut_functions[i].name, procName) == 0) - return (void *) glut_functions[i].address; + return glut_functions[i].address; } /* Try core GL functions */ #if defined(_WIN32) - return (void *) wglGetProcAddress((LPCSTR) procName); + return (GLUTproc) wglGetProcAddress((LPCSTR) procName); #elif defined(GLX_ARB_get_proc_address) - return (void *) glXGetProcAddressARB((const GLubyte *) procName); + return (GLUTproc) glXGetProcAddressARB((const GLubyte *) procName); #else return NULL; #endif -- cgit v1.2.3 From 4d880987d248ff078845027cc21ba437564ac07d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 27 Nov 2004 16:24:39 +0000 Subject: Have OSMesaGetProcAddress() return new OSMESAproc typedef. --- include/GL/osmesa.h | 18 ++++++++++++------ src/mesa/drivers/osmesa/osmesa.c | 31 +++++++++++++++---------------- 2 files changed, 27 insertions(+), 22 deletions(-) (limited to 'include') diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h index cf892b91c93..ef645905c4d 100644 --- a/include/GL/osmesa.h +++ b/include/GL/osmesa.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 4.1 + * Version: 6.3 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2003 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"), @@ -60,8 +60,8 @@ extern "C" { #include -#define OSMESA_MAJOR_VERSION 4 -#define OSMESA_MINOR_VERSION 1 +#define OSMESA_MAJOR_VERSION 6 +#define OSMESA_MINOR_VERSION 3 #define OSMESA_PATCH_VERSION 0 @@ -252,12 +252,18 @@ OSMesaGetColorBuffer( OSMesaContext c, GLint *width, GLint *height, +/** + * This typedef is new in Mesa 6.3. + */ +typedef void (*OSMESAproc)(); + + /* * Return pointer to the named function. - * * New in Mesa 4.1 + * Return OSMESAproc in 6.3. */ -GLAPI void * GLAPIENTRY +GLAPI OSMESAproc GLAPIENTRY OSMesaGetProcAddress( const char *funcName ); diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index b25f7dca557..b95e446590e 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1276,35 +1276,34 @@ OSMesaGetColorBuffer( OSMesaContext c, GLint *width, } -typedef void (*generic_function)(); - struct name_function { const char *Name; - generic_function Function; + OSMESAproc Function; }; static struct name_function functions[] = { - { "OSMesaCreateContext", (generic_function) OSMesaCreateContext }, - { "OSMesaCreateContextExt", (generic_function) OSMesaCreateContextExt }, - { "OSMesaDestroyContext", (generic_function) OSMesaDestroyContext }, - { "OSMesaMakeCurrent", (generic_function) OSMesaMakeCurrent }, - { "OSMesaGetCurrentContext", (generic_function) OSMesaGetCurrentContext }, - { "OSMesaPixelsStore", (generic_function) OSMesaPixelStore }, - { "OSMesaGetIntegerv", (generic_function) OSMesaGetIntegerv }, - { "OSMesaGetDepthBuffer", (generic_function) OSMesaGetDepthBuffer }, - { "OSMesaGetColorBuffer", (generic_function) OSMesaGetColorBuffer }, - { "OSMesaGetProcAddress", (generic_function) OSMesaGetProcAddress }, + { "OSMesaCreateContext", (OSMESAproc) OSMesaCreateContext }, + { "OSMesaCreateContextExt", (OSMESAproc) OSMesaCreateContextExt }, + { "OSMesaDestroyContext", (OSMESAproc) OSMesaDestroyContext }, + { "OSMesaMakeCurrent", (OSMESAproc) OSMesaMakeCurrent }, + { "OSMesaGetCurrentContext", (OSMESAproc) OSMesaGetCurrentContext }, + { "OSMesaPixelsStore", (OSMESAproc) OSMesaPixelStore }, + { "OSMesaGetIntegerv", (OSMESAproc) OSMesaGetIntegerv }, + { "OSMesaGetDepthBuffer", (OSMESAproc) OSMesaGetDepthBuffer }, + { "OSMesaGetColorBuffer", (OSMESAproc) OSMesaGetColorBuffer }, + { "OSMesaGetProcAddress", (OSMESAproc) OSMesaGetProcAddress }, { NULL, NULL } }; -GLAPI void * GLAPIENTRY + +GLAPI OSMESAproc GLAPIENTRY OSMesaGetProcAddress( const char *funcName ) { int i; for (i = 0; functions[i].Name; i++) { if (_mesa_strcmp(functions[i].Name, funcName) == 0) - return (void *) functions[i].Function; + return functions[i].Function; } - return (void *) _glapi_get_proc_address(funcName); + return _glapi_get_proc_address(funcName); } -- cgit v1.2.3 From bf4c23d00fd2cc96336745430ceec89dbeacaead Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 29 Nov 2004 17:31:03 +0000 Subject: no need to include stddef.h anymore --- include/GL/gl.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index da617cff710..1d35af82a16 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.2 + * Version: 6.3 * * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. * @@ -38,8 +38,6 @@ */ #if !defined(__SCITECH_SNAP__) -#include /* to get ptrdiff_t, used below */ - #if defined(__BEOS__) #include /* to get some BeOS-isms */ #endif -- cgit v1.2.3 From 86356155018fce96ba3367fd1a48a18cd6db3c40 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Wed, 8 Dec 2004 12:59:15 +0000 Subject: Check for some header defines before redefining functions. Silences warnings. --- include/GL/internal/dri_interface.h | 3 +++ src/mesa/drivers/dri/common/dri_util.h | 3 +++ 2 files changed, 6 insertions(+) (limited to 'include') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index ced714d43e0..9c430469b29 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -149,6 +149,8 @@ typedef GLboolean (* PFNGLXGETDRAWABLEINFOPROC) ( __DRInativeDisplay *dpy, int s int * backX, int * backY, int * numBackClipRects, drm_clip_rect_t ** pBackClipRects ); +/* Test for the xf86dri.h header file */ +#ifndef _XF86DRI_H_ extern GLboolean XF86DRIDestroyContext( __DRInativeDisplay *dpy, int screen, __DRIid context_id ); @@ -157,6 +159,7 @@ extern GLboolean XF86DRICreateDrawable( __DRInativeDisplay *dpy, int screen, extern GLboolean XF86DRIDestroyDrawable( __DRInativeDisplay *dpy, int screen, __DRIid drawable); +#endif /*@}*/ diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index cdb65763773..f85a2fb68e1 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -558,8 +558,11 @@ extern float driCalculateSwapUsage( __DRIdrawablePrivate *dPriv, int64_t last_swap_ust, int64_t current_ust ); +/* Test for the GLX header glx.h */ +#ifndef GLX extern void (*glXGetProcAddress(const GLubyte *procname))( void ); +#endif #endif /* GLX_DIRECT_RENDERING */ -- cgit v1.2.3 From 38b317d508a2a3a4cc6d700ebca80c3b06c913e2 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Tue, 14 Dec 2004 09:11:52 +0000 Subject: uint*t -> u_int*t changes --- include/GL/glxext.h | 17 +-- src/mesa/drivers/dri/common/dri_util.c | 5 +- src/mesa/drivers/dri/common/dri_util.h | 5 +- src/mesa/drivers/dri/common/mmio.h | 10 +- src/mesa/drivers/dri/common/utils.c | 22 ++-- src/mesa/drivers/dri/common/utils.h | 2 +- src/mesa/drivers/dri/gamma/gamma_context.h | 38 +++--- src/mesa/drivers/dri/gamma/gamma_render.c | 6 +- src/mesa/drivers/dri/gamma/gamma_span.c | 8 +- src/mesa/drivers/dri/gamma/gamma_state.c | 34 +++--- src/mesa/drivers/dri/gamma/gamma_tex.c | 10 +- src/mesa/drivers/dri/gamma/gamma_tritmp.h | 18 +-- src/mesa/drivers/dri/i810/i810screen.c | 4 +- src/mesa/drivers/dri/i830/i830_screen.c | 4 +- src/mesa/drivers/dri/i915/i830_state.c | 6 +- src/mesa/drivers/dri/i915/i830_texblend.c | 8 -- src/mesa/drivers/dri/i915/i915_fragprog.c | 2 +- src/mesa/drivers/dri/i915/intel_context.h | 2 +- src/mesa/drivers/dri/i915/intel_ioctl.c | 4 +- src/mesa/drivers/dri/i915/intel_screen.c | 4 +- src/mesa/drivers/dri/mach64/mach64_screen.c | 4 +- src/mesa/drivers/dri/mga/mga_xmesa.c | 4 +- src/mesa/drivers/dri/mga/mga_xmesa.h | 2 +- src/mesa/drivers/dri/mga/mgaspan.c | 1 - src/mesa/drivers/dri/r128/r128_context.h | 6 +- src/mesa/drivers/dri/r128/r128_ioctl.c | 2 +- src/mesa/drivers/dri/r128/r128_ioctl.h | 6 +- src/mesa/drivers/dri/r128/r128_screen.c | 4 +- src/mesa/drivers/dri/r128/r128_tex.c | 6 +- src/mesa/drivers/dri/r128/r128_tex.h | 2 +- src/mesa/drivers/dri/r128/r128_texmem.c | 6 +- src/mesa/drivers/dri/r128/r128_texobj.h | 4 +- src/mesa/drivers/dri/r128/server/r128.h | 128 ++++++++++----------- src/mesa/drivers/dri/r128/server/r128_dri.c | 2 +- src/mesa/drivers/dri/r200/r200_ioctl.c | 4 +- src/mesa/drivers/dri/r200/r200_screen.c | 6 +- src/mesa/drivers/dri/r200/r200_state.c | 6 +- src/mesa/drivers/dri/r200/r200_tcl.c | 4 +- src/mesa/drivers/dri/radeon/radeon_ioctl.c | 6 +- src/mesa/drivers/dri/radeon/radeon_screen.c | 6 +- src/mesa/drivers/dri/radeon/radeon_screen.h | 2 +- src/mesa/drivers/dri/radeon/radeon_state.c | 2 +- src/mesa/drivers/dri/radeon/radeon_swtcl.c | 4 +- src/mesa/drivers/dri/radeon/radeon_tcl.c | 2 +- src/mesa/drivers/dri/sis/sis_screen.c | 4 +- src/mesa/drivers/dri/tdfx/tdfx_state.c | 2 +- src/mesa/drivers/dri/tdfx/tdfx_tex.c | 4 +- src/mesa/drivers/dri/tdfx/tdfx_texstate.c | 2 + src/mesa/drivers/dri/unichrome/server/via_dri.c | 34 +++--- src/mesa/drivers/dri/unichrome/server/via_driver.h | 26 ++--- src/mesa/drivers/dri/unichrome/via_screen.c | 4 +- src/mesa/drivers/dri/unichrome/via_state.c | 4 +- src/mesa/main/colortab.c | 5 +- src/mesa/main/enable.c | 3 - src/mesa/main/enums.h | 4 +- src/mesa/shader/arbprogparse.c | 5 +- src/mesa/x86/common_x86.c | 3 +- 57 files changed, 264 insertions(+), 264 deletions(-) (limited to 'include') diff --git a/include/GL/glxext.h b/include/GL/glxext.h index f1e253a0c77..880f2f30f04 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -331,6 +331,15 @@ typedef struct { } GLXBufferClobberEventSGIX; #endif +#if defined(__UNIXOS2__) || defined(__SOL64__) +typedef long int int32_t; +typedef long long int int64_t; +#endif + +#if defined(__SCO__) || defined(__USLC__) +#include +#endif + #ifndef GLX_VERSION_1_3 #define GLX_VERSION_1_3 1 #ifdef GLX_GLXEXT_PROTOTYPES @@ -597,11 +606,6 @@ typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode); #ifndef GLX_OML_sync_control #define GLX_OML_sync_control 1 -#if defined(__STDC_VERSION__) -#if __STDC_VERSION__ >= 199901L -/* Include ISO C99 integer types for OML_sync_control; need a better test */ -#include - #ifdef GLX_GLXEXT_PROTOTYPES extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *); extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *); @@ -614,8 +618,6 @@ typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, i typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc); typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc); -#endif /* C99 version test */ -#endif /* STDC test */ #endif #ifndef GLX_SGIX_hyperpipe_group @@ -673,7 +675,6 @@ extern unsigned int glXGetAGPOffsetMESA (const void *); typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer); #endif - #ifdef __cplusplus } #endif diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 88caa34e946..33facbbf6c6 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -27,13 +27,16 @@ #ifdef GLX_DIRECT_RENDERING -#include #include #include #include #include #include +#ifndef MAP_FAILED +#define MAP_FAILED ((void *)-1) +#endif + #ifndef DRI_NEW_INTERFACE_ONLY # include # include diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index f85a2fb68e1..534a26785ef 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -53,7 +53,6 @@ #define CAPI /* XXX this should be globally defined somewhere */ -#include #ifdef DRI_NEW_INTERFACE_ONLY # include #else @@ -208,7 +207,7 @@ struct __DRIswapInfoRec { /** * Number of swapBuffers operations that have been *completed*. */ - uint64_t swap_count; + u_int64_t swap_count; /** * Unadjusted system time of the last buffer swap. This is the time @@ -222,7 +221,7 @@ struct __DRIswapInfoRec { * swap, it has missed its deadline. If swap_interval is 0, then the * swap deadline is 1 frame after the previous swap. */ - uint64_t swap_missed_count; + u_int64_t swap_missed_count; /** * Amount of time used by the last swap that missed its deadline. This diff --git a/src/mesa/drivers/dri/common/mmio.h b/src/mesa/drivers/dri/common/mmio.h index 1418543dc53..a9bdce42bf9 100644 --- a/src/mesa/drivers/dri/common/mmio.h +++ b/src/mesa/drivers/dri/common/mmio.h @@ -33,15 +33,13 @@ #ifndef MMIO_H #define MMIO_H -#include - #if defined( __powerpc__ ) -static __inline__ uint32_t +static __inline__ u_int32_t read_MMIO_LE32( volatile void * base, unsigned long offset ) { volatile void * p = ((volatile char *) base) + offset; - uint32_t val; + u_int32_t val; __asm__ __volatile__( "lwbrx %0, %1, %2 ; eieio" : "=r" (val) @@ -51,10 +49,10 @@ read_MMIO_LE32( volatile void * base, unsigned long offset ) #else -static __inline__ uint32_t +static __inline__ u_int32_t read_MMIO_LE32( volatile void * base, unsigned long offset ) { - volatile uint32_t * p = (volatile uint32_t *) (((volatile char *) base) + offset); + volatile u_int32_t * p = (volatile u_int32_t *) (((volatile char *) base) + offset); return LE32_TO_CPU( p[0] ); } diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 0e8e54a2028..fcdd9f83777 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -415,12 +415,12 @@ GLboolean driClipRectToFramebuffer( const GLframebuffer *buffer, GLboolean driFillInModes( __GLcontextModes ** ptr_to_modes, GLenum fb_format, GLenum fb_type, - const uint8_t * depth_bits, const uint8_t * stencil_bits, + const u_int8_t * depth_bits, const u_int8_t * stencil_bits, unsigned num_depth_stencil_bits, const GLenum * db_modes, unsigned num_db_modes, int visType ) { - static const uint8_t bits_table[3][4] = { + static const u_int8_t bits_table[3][4] = { /* R G B A */ { 5, 6, 5, 0 }, /* Any GL_UNSIGNED_SHORT_5_6_5 */ { 8, 8, 8, 0 }, /* Any RGB with any GL_UNSIGNED_INT_8_8_8_8 */ @@ -431,7 +431,7 @@ driFillInModes( __GLcontextModes ** ptr_to_modes, * Given the four supported fb_type values, this results in valid array * indices of 3, 4, 5, and 7. */ - static const uint32_t masks_table_rgb[8][4] = { + static const u_int32_t masks_table_rgb[8][4] = { { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, @@ -442,7 +442,7 @@ driFillInModes( __GLcontextModes ** ptr_to_modes, { 0x000000FF, 0x0000FF00, 0x00FF0000, 0x00000000 } /* 8_8_8_8_REV */ }; - static const uint32_t masks_table_rgba[8][4] = { + static const u_int32_t masks_table_rgba[8][4] = { { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, @@ -453,7 +453,7 @@ driFillInModes( __GLcontextModes ** ptr_to_modes, { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 }, /* 8_8_8_8_REV */ }; - static const uint32_t masks_table_bgr[8][4] = { + static const u_int32_t masks_table_bgr[8][4] = { { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, @@ -464,7 +464,7 @@ driFillInModes( __GLcontextModes ** ptr_to_modes, { 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 }, /* 8_8_8_8_REV */ }; - static const uint32_t masks_table_bgra[8][4] = { + static const u_int32_t masks_table_bgra[8][4] = { { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, { 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, @@ -475,12 +475,12 @@ driFillInModes( __GLcontextModes ** ptr_to_modes, { 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000 }, /* 8_8_8_8_REV */ }; - static const uint8_t bytes_per_pixel[8] = { + static const u_int8_t bytes_per_pixel[8] = { 0, 0, 0, 2, 2, 4, 0, 4 }; - const uint8_t * bits; - const uint32_t * masks; + const u_int8_t * bits; + const u_int32_t * masks; const int index = fb_type & 0x07; __GLcontextModes * modes = *ptr_to_modes; unsigned i; @@ -490,7 +490,7 @@ driFillInModes( __GLcontextModes ** ptr_to_modes, if ( bytes_per_pixel[ index ] == 0 ) { fprintf( stderr, "[%s:%u] Framebuffer type 0x%04x has 0 bytes per pixel.\n", - __func__, __LINE__, fb_type ); + __FUNCTION__, __LINE__, fb_type ); return GL_FALSE; } @@ -528,7 +528,7 @@ driFillInModes( __GLcontextModes ** ptr_to_modes, default: fprintf( stderr, "[%s:%u] Framebuffer format 0x%04x is not GL_RGB, GL_RGBA, GL_BGR, or GL_BGRA.\n", - __func__, __LINE__, fb_format ); + __FUNCTION__, __LINE__, fb_format ); return GL_FALSE; } diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h index 3eaf13f4cab..21d7ad269d4 100644 --- a/src/mesa/drivers/dri/common/utils.h +++ b/src/mesa/drivers/dri/common/utils.h @@ -64,7 +64,7 @@ extern GLboolean driClipRectToFramebuffer( const GLframebuffer *buffer, extern GLboolean driFillInModes( __GLcontextModes ** modes, GLenum fb_format, GLenum fb_type, - const uint8_t * depth_bits, const uint8_t * stencil_bits, + const u_int8_t * depth_bits, const u_int8_t * stencil_bits, unsigned num_depth_stencil_bits, const GLenum * db_modes, unsigned num_db_modes, int visType ); diff --git a/src/mesa/drivers/dri/gamma/gamma_context.h b/src/mesa/drivers/dri/gamma/gamma_context.h index 4572a0224d2..6dd458bc95c 100644 --- a/src/mesa/drivers/dri/gamma/gamma_context.h +++ b/src/mesa/drivers/dri/gamma/gamma_context.h @@ -160,13 +160,13 @@ struct gamma_texture_object_t { int internalFormat; } image[GAMMA_TEX_MAXLEVELS]; - uint32_t TextureBaseAddr[GAMMA_TEX_MAXLEVELS]; - uint32_t TextureAddressMode; - uint32_t TextureColorMode; - uint32_t TextureFilterMode; - uint32_t TextureFormat; - uint32_t TextureReadMode; - uint32_t TextureBorderColor; + u_int32_t TextureBaseAddr[GAMMA_TEX_MAXLEVELS]; + u_int32_t TextureAddressMode; + u_int32_t TextureColorMode; + u_int32_t TextureFilterMode; + u_int32_t TextureFormat; + u_int32_t TextureReadMode; + u_int32_t TextureBorderColor; }; #define GAMMA_NO_PALETTE 0x0 @@ -300,18 +300,18 @@ struct gamma_context { unsigned int lastStamp; - uint32_t ClearColor; - uint32_t Color; - uint32_t DitherMode; - uint32_t ClearDepth; - uint32_t FogMode; - uint32_t AreaStippleMode; - uint32_t LBReadFormat; - uint32_t LBWriteFormat; - uint32_t LineMode; - uint32_t PointMode; - uint32_t TriangleMode; - uint32_t AntialiasMode; + u_int32_t ClearColor; + u_int32_t Color; + u_int32_t DitherMode; + u_int32_t ClearDepth; + u_int32_t FogMode; + u_int32_t AreaStippleMode; + u_int32_t LBReadFormat; + u_int32_t LBWriteFormat; + u_int32_t LineMode; + u_int32_t PointMode; + u_int32_t TriangleMode; + u_int32_t AntialiasMode; GLfloat ViewportScaleX; GLfloat ViewportScaleY; GLfloat ViewportScaleZ; diff --git a/src/mesa/drivers/dri/gamma/gamma_render.c b/src/mesa/drivers/dri/gamma/gamma_render.c index ce8b83934c9..4e0d63791d2 100644 --- a/src/mesa/drivers/dri/gamma/gamma_render.c +++ b/src/mesa/drivers/dri/gamma/gamma_render.c @@ -74,7 +74,7 @@ static void gamma_emit( GLcontext *ctx, GLuint start, GLuint end) WRITEF(gmesa->buf, Tr4, tc0[i][2]); WRITEF(gmesa->buf, Tt4, tc0[i][0]); WRITEF(gmesa->buf, Ts4, tc0[i][1]); - WRITE(gmesa->buf, PackedColor4, *(uint32_t*)col[i]); + WRITE(gmesa->buf, PackedColor4, *(u_int32_t*)col[i]); WRITEF(gmesa->buf, Vw, coord[i][3]); WRITEF(gmesa->buf, Vz, coord[i][2]); WRITEF(gmesa->buf, Vy, coord[i][1]); @@ -85,7 +85,7 @@ static void gamma_emit( GLcontext *ctx, GLuint start, GLuint end) CHECK_DMA_BUFFER(gmesa, 7); WRITEF(gmesa->buf, Tt2, tc0[i][0]); WRITEF(gmesa->buf, Ts2, tc0[i][1]); - WRITE(gmesa->buf, PackedColor4, *(uint32_t*)col[i]); + WRITE(gmesa->buf, PackedColor4, *(u_int32_t*)col[i]); WRITEF(gmesa->buf, Vw, coord[i][3]); WRITEF(gmesa->buf, Vz, coord[i][2]); WRITEF(gmesa->buf, Vy, coord[i][1]); @@ -94,7 +94,7 @@ static void gamma_emit( GLcontext *ctx, GLuint start, GLuint end) } else { for (i=start; i < end; i++) { CHECK_DMA_BUFFER(gmesa, 4); - WRITE(gmesa->buf, PackedColor4, *(uint32_t*)col[i]); + WRITE(gmesa->buf, PackedColor4, *(u_int32_t*)col[i]); WRITEF(gmesa->buf, Vz, coord[i][2]); WRITEF(gmesa->buf, Vy, coord[i][1]); WRITEF(gmesa->buf, Vx3, coord[i][0]); diff --git a/src/mesa/drivers/dri/gamma/gamma_span.c b/src/mesa/drivers/dri/gamma/gamma_span.c index 533166ddbb3..2cf0d49efbe 100644 --- a/src/mesa/drivers/dri/gamma/gamma_span.c +++ b/src/mesa/drivers/dri/gamma/gamma_span.c @@ -207,10 +207,10 @@ static void gammaReadRGBASpan8888( const GLcontext *ctx, { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); gammaScreenPtr gammascrn = gmesa->gammaScreen; - uint32_t dwords1, dwords2, i = 0; + u_int32_t dwords1, dwords2, i = 0; char *src = (char *)rgba[0]; GLuint read = n * gammascrn->cpp; /* Number of bytes we are expecting */ - uint32_t data; + u_int32_t data; FLUSH_DMA_BUFFER(gmesa); CHECK_DMA_BUFFER(gmesa, 16); @@ -232,8 +232,8 @@ static void gammaReadRGBASpan8888( const GLcontext *ctx, moredata: - dwords1 = *(volatile uint32_t*)(void *)(((uint8_t*)gammascrn->regions[0].map) + (GlintOutFIFOWords)); - dwords2 = *(volatile uint32_t*)(void *)(((uint8_t*)gammascrn->regions[2].map) + (GlintOutFIFOWords)); + dwords1 = *(volatile u_int32_t*)(void *)(((u_int8_t*)gammascrn->regions[0].map) + (GlintOutFIFOWords)); + dwords2 = *(volatile u_int32_t*)(void *)(((u_int8_t*)gammascrn->regions[2].map) + (GlintOutFIFOWords)); if (dwords1) { memcpy(src, (char*)gammascrn->regions[1].map + 0x1000, dwords1 << 2); diff --git a/src/mesa/drivers/dri/gamma/gamma_state.c b/src/mesa/drivers/dri/gamma/gamma_state.c index 29f1a57959f..4d9d92fdb66 100644 --- a/src/mesa/drivers/dri/gamma/gamma_state.c +++ b/src/mesa/drivers/dri/gamma/gamma_state.c @@ -45,9 +45,9 @@ static void gammaUpdateAlphaMode( GLcontext *ctx ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - uint32_t a = gmesa->AlphaTestMode; - uint32_t b = gmesa->AlphaBlendMode; - uint32_t f = gmesa->AB_FBReadMode_Save = 0; + u_int32_t a = gmesa->AlphaTestMode; + u_int32_t b = gmesa->AlphaBlendMode; + u_int32_t f = gmesa->AB_FBReadMode_Save = 0; GLubyte refByte = (GLint) (ctx->Color.AlphaRef * 255.0); a &= ~(AT_CompareMask | AT_RefValueMask); @@ -420,10 +420,10 @@ static void gammaDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, static void gammaUpdateZMode( GLcontext *ctx ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - uint32_t z = gmesa->DepthMode; - uint32_t delta = gmesa->DeltaMode; - uint32_t window = gmesa->Window; - uint32_t lbread = gmesa->LBReadMode; + u_int32_t z = gmesa->DepthMode; + u_int32_t delta = gmesa->DeltaMode; + u_int32_t window = gmesa->Window; + u_int32_t lbread = gmesa->LBReadMode; z &= ~DM_CompareMask; @@ -539,9 +539,9 @@ static void gammaDDFlush( GLcontext *ctx ) static void gammaUpdateFogAttrib( GLcontext *ctx ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - uint32_t f = gmesa->FogMode; - uint32_t g = gmesa->GeometryMode; - uint32_t d = gmesa->DeltaMode; + u_int32_t f = gmesa->FogMode; + u_int32_t g = gmesa->GeometryMode; + u_int32_t d = gmesa->DeltaMode; if (ctx->Fog.Enabled) { f |= FogModeEnable; @@ -637,7 +637,7 @@ static void gammaDDPointSize( GLcontext *ctx, GLfloat size ) static void gammaUpdatePolygon( GLcontext *ctx ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - uint32_t g = gmesa->GeometryMode; + u_int32_t g = gmesa->GeometryMode; g &= ~(GM_PolyOffsetFillEnable | GM_PolyOffsetPointEnable | GM_PolyOffsetLineEnable); @@ -755,7 +755,7 @@ static void gammaDDScissor( GLcontext *ctx, static void gammaUpdateCull( GLcontext *ctx ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - uint32_t g = gmesa->GeometryMode; + u_int32_t g = gmesa->GeometryMode; g &= ~(GM_PolyCullMask | GM_FFMask); @@ -975,8 +975,8 @@ static void gammaDDLightModelfv( GLcontext *ctx, GLenum pname, static void gammaDDShadeModel( GLcontext *ctx, GLenum mode ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - uint32_t g = gmesa->GeometryMode; - uint32_t c = gmesa->ColorDDAMode; + u_int32_t g = gmesa->GeometryMode; + u_int32_t c = gmesa->ColorDDAMode; g &= ~GM_ShadingMask; c &= ~ColorDDAShadingMask; @@ -1245,7 +1245,7 @@ static void gammaDDEnable( GLcontext *ctx, GLenum cap, GLboolean state ) case GL_DITHER: do { - uint32_t d = gmesa->DitherMode; + u_int32_t d = gmesa->DitherMode; FLUSH_BATCH( gmesa ); if ( state ) { @@ -1277,7 +1277,7 @@ static void gammaDDEnable( GLcontext *ctx, GLenum cap, GLboolean state ) #if ENABLELIGHTING case GL_LIGHTING: do { - uint32_t l = gmesa->LightingMode; + u_int32_t l = gmesa->LightingMode; FLUSH_BATCH( gmesa ); if ( state ) { @@ -1295,7 +1295,7 @@ static void gammaDDEnable( GLcontext *ctx, GLenum cap, GLboolean state ) case GL_COLOR_MATERIAL: do { - uint32_t m = gmesa->MaterialMode; + u_int32_t m = gmesa->MaterialMode; FLUSH_BATCH( gmesa ); if ( state ) { diff --git a/src/mesa/drivers/dri/gamma/gamma_tex.c b/src/mesa/drivers/dri/gamma/gamma_tex.c index 075d6d1357b..d4fc93f86b5 100644 --- a/src/mesa/drivers/dri/gamma/gamma_tex.c +++ b/src/mesa/drivers/dri/gamma/gamma_tex.c @@ -32,8 +32,8 @@ static GLuint gammaComputeLodBias(GLfloat bias) static void gammaSetTexWrapping(gammaTextureObjectPtr t, GLenum wraps, GLenum wrapt) { - uint32_t t1 = t->TextureAddressMode; - uint32_t t2 = t->TextureReadMode; + u_int32_t t1 = t->TextureAddressMode; + u_int32_t t2 = t->TextureReadMode; t1 &= ~(TAM_SWrap_Mask | TAM_TWrap_Mask); t2 &= ~(TRM_UWrap_Mask | TRM_VWrap_Mask); @@ -58,8 +58,8 @@ static void gammaSetTexFilter(gammaContextPtr gmesa, GLenum minf, GLenum magf, GLfloat bias) { - uint32_t t1 = t->TextureAddressMode; - uint32_t t2 = t->TextureReadMode; + u_int32_t t1 = t->TextureAddressMode; + u_int32_t t2 = t->TextureReadMode; t2 &= ~(TRM_Mag_Mask | TRM_Min_Mask); @@ -376,6 +376,7 @@ static GLboolean gammaIsTextureResident( GLcontext *ctx, return t && t->MemBlock; } +#ifdef UNUSED /** * Allocate a new texture object. * Called via ctx->Driver.NewTextureObject. @@ -391,6 +392,7 @@ gammaNewTextureObject( GLcontext *ctx, GLuint name, GLenum target ) obj = _mesa_new_texture_object(ctx, name, target); return obj; } +#endif void gammaInitTextureObjects( GLcontext *ctx ) { diff --git a/src/mesa/drivers/dri/gamma/gamma_tritmp.h b/src/mesa/drivers/dri/gamma/gamma_tritmp.h index d61d45b25f0..23459ff156e 100644 --- a/src/mesa/drivers/dri/gamma/gamma_tritmp.h +++ b/src/mesa/drivers/dri/gamma/gamma_tritmp.h @@ -1,8 +1,10 @@ +/* $XFree86: xc/extras/Mesa/src/mesa/drivers/dri/gamma/gamma_tritmp.h,v 1.2 2004/12/13 22:40:49 tsi Exp $ */ + static void TAG(gamma_point)( gammaContextPtr gmesa, const gammaVertex *v0 ) { - uint32_t vColor; - uint32_t vBegin; + u_int32_t vColor; + u_int32_t vBegin; vBegin = gmesa->Begin | B_PrimType_Points; @@ -55,8 +57,8 @@ static void TAG(gamma_line)( gammaContextPtr gmesa, const gammaVertex *v0, const gammaVertex *v1 ) { - uint32_t vColor; - uint32_t vBegin; + u_int32_t vColor; + u_int32_t vBegin; vBegin = gmesa->Begin | B_PrimType_Lines; @@ -164,8 +166,8 @@ static void TAG(gamma_triangle)( gammaContextPtr gmesa, const gammaVertex *v1, const gammaVertex *v2 ) { - uint32_t vColor; - uint32_t vBegin; + u_int32_t vColor; + u_int32_t vBegin; vBegin = gmesa->Begin | B_PrimType_Triangles; @@ -309,8 +311,8 @@ static void TAG(gamma_quad)( gammaContextPtr gmesa, const gammaVertex *v2, const gammaVertex *v3 ) { - uint32_t vColor; - uint32_t vBegin; + u_int32_t vColor; + u_int32_t vBegin; vBegin = gmesa->Begin | B_PrimType_Quads; diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index f87a205f202..27a2c7cba7f 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -64,11 +64,11 @@ static __GLcontextModes *fill_in_modes( __GLcontextModes *modes, unsigned num_db_modes, int visType ) { - static const uint8_t bits[1][4] = { + static const u_int8_t bits[1][4] = { { 5, 6, 5, 0 } }; - static const uint32_t masks[1][4] = { + static const u_int32_t masks[1][4] = { { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 } }; diff --git a/src/mesa/drivers/dri/i830/i830_screen.c b/src/mesa/drivers/dri/i830/i830_screen.c index f323baccbfa..b31e81898b6 100644 --- a/src/mesa/drivers/dri/i830/i830_screen.c +++ b/src/mesa/drivers/dri/i830/i830_screen.c @@ -394,8 +394,8 @@ i830FillInModes( unsigned pixel_bits, unsigned depth_bits, GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML }; - uint8_t depth_bits_array[2]; - uint8_t stencil_bits_array[2]; + u_int8_t depth_bits_array[2]; + u_int8_t stencil_bits_array[2]; depth_bits_array[0] = 0; diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c index c9d03296026..a5ebc9e2aa0 100644 --- a/src/mesa/drivers/dri/i915/i830_state.c +++ b/src/mesa/drivers/dri/i915/i830_state.c @@ -403,7 +403,7 @@ static void i830_set_blend_state( GLcontext * ctx ) break; default: fprintf( stderr, "[%s:%u] Invalid RGB blend equation (0x%04x).\n", - __func__, __LINE__, ctx->Color.BlendEquationRGB ); + __FUNCTION__, __LINE__, ctx->Color.BlendEquationRGB ); return; } @@ -431,7 +431,7 @@ static void i830_set_blend_state( GLcontext * ctx ) break; default: fprintf( stderr, "[%s:%u] Invalid alpha blend equation (0x%04x).\n", - __func__, __LINE__, ctx->Color.BlendEquationA ); + __FUNCTION__, __LINE__, ctx->Color.BlendEquationA ); return; } @@ -465,7 +465,7 @@ static void i830_set_blend_state( GLcontext * ctx ) if (0) { fprintf(stderr, "[%s:%u] STATE1: 0x%08x IALPHAB: 0x%08x blend is %sabled\n", - __func__, __LINE__, + __FUNCTION__, __LINE__, i830->state.Ctx[I830_CTXREG_STATE1], i830->state.Ctx[I830_CTXREG_IALPHAB], (ctx->Color.BlendEnabled) ? "en" : "dis"); diff --git a/src/mesa/drivers/dri/i915/i830_texblend.c b/src/mesa/drivers/dri/i915/i830_texblend.c index b1500227134..49e0347643c 100644 --- a/src/mesa/drivers/dri/i915/i830_texblend.c +++ b/src/mesa/drivers/dri/i915/i830_texblend.c @@ -161,12 +161,6 @@ i830SetTexEnvCombine(i830ContextPtr i830, TEXPIPE_ALPHA | TEXBLEND_ARG2 | TEXBLENDARG_MODIFY_PARMS, TEXPIPE_ALPHA | TEXBLEND_ARG0 | TEXBLENDARG_MODIFY_PARMS, }; - static const GLuint op_rgb[4] = { - 0, - TEXBLENDARG_INV_ARG, - TEXBLENDARG_REPLICATE_ALPHA, - TEXBLENDARG_REPLICATE_ALPHA | TEXBLENDARG_INV_ARG, - }; if(INTEL_DEBUG&DEBUG_TEXTURE) fprintf(stderr, "%s\n", __FUNCTION__); @@ -404,8 +398,6 @@ static void emit_texblend( i830ContextPtr i830, GLuint unit, GLuint blendUnit, GLboolean last_stage ) { struct gl_texture_unit *texUnit = &i830->intel.ctx.Texture.Unit[unit]; - struct gl_texture_object *tObj = texUnit->_Current; - i830TextureObjectPtr t = (i830TextureObjectPtr)tObj->DriverData; GLuint tmp[I830_TEXBLEND_SIZE], tmp_sz; diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index 2c2665d00cd..40e118ec414 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -42,7 +42,7 @@ - +#undef PI #define PI 3.141592 diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h index 625e96f580f..be941fd3002 100644 --- a/src/mesa/drivers/dri/i915/intel_context.h +++ b/src/mesa/drivers/dri/i915/intel_context.h @@ -357,7 +357,7 @@ do { \ * From linux kernel i386 header files, copes with odd sizes better * than COPY_DWORDS would: */ -#ifdef __i386__ +#if defined(i386) || defined(__i386__) static __inline__ void * __memcpy(void * to, const void * from, size_t n) { int d0, d1, d2; diff --git a/src/mesa/drivers/dri/i915/intel_ioctl.c b/src/mesa/drivers/dri/i915/intel_ioctl.c index db6d2cd2dda..b2e72efac1f 100644 --- a/src/mesa/drivers/dri/i915/intel_ioctl.c +++ b/src/mesa/drivers/dri/i915/intel_ioctl.c @@ -107,7 +107,7 @@ void intel_dump_batchbuffer( long offset, int i; fprintf(stderr, "\n\n\nSTART BATCH (%d dwords):\n", count); for (i = 0; i < count/4; i += 4) - fprintf(stderr, "\t0x%x: 0x%08x 0x%08x 0x%08x 0x%08x\n", + fprintf(stderr, "\t0x%lx: 0x%08x 0x%08x 0x%08x 0x%08x\n", offset + i*4, ptr[i], ptr[i+1], ptr[i+2], ptr[i+3]); fprintf(stderr, "END BATCH\n\n\n"); } @@ -247,7 +247,7 @@ void intelFlushBatchLocked( intelContextPtr intel, } } else { drmI830CmdBuffer cmd; - cmd.buf = intel->alloc.ptr + batch.start; + cmd.buf = (GLubyte *)intel->alloc.ptr + batch.start; cmd.sz = batch.used; cmd.DR1 = batch.DR1; cmd.DR4 = batch.DR4; diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index 8007ff48c2e..0da5f8d7d88 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -355,8 +355,8 @@ intelFillInModes( unsigned pixel_bits, unsigned depth_bits, GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML }; - uint8_t depth_bits_array[2]; - uint8_t stencil_bits_array[2]; + u_int8_t depth_bits_array[2]; + u_int8_t stencil_bits_array[2]; depth_bits_array[0] = 0; diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index a6cb8b95db3..0c033c55ea4 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -76,12 +76,12 @@ static __GLcontextModes * fill_in_modes( __GLcontextModes * modes, unsigned num_db_modes, int visType ) { - static const uint8_t bits[2][4] = { + static const u_int8_t bits[2][4] = { { 5, 6, 5, 0 }, { 8, 8, 8, 0 } }; - static const uint32_t masks[2][4] = { + static const u_int32_t masks[2][4] = { { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 }, { 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 } }; diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 6fcef0c4488..476756dba31 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -113,8 +113,8 @@ mgaFillInModes( unsigned pixel_bits, unsigned depth_bits, GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML }; - uint8_t depth_bits_array[3]; - uint8_t stencil_bits_array[3]; + u_int8_t depth_bits_array[3]; + u_int8_t stencil_bits_array[3]; depth_bits_array[0] = 0; diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.h b/src/mesa/drivers/dri/mga/mga_xmesa.h index 6825c5ace6f..51cab51dada 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.h +++ b/src/mesa/drivers/dri/mga/mga_xmesa.h @@ -144,7 +144,7 @@ do { \ #define MGA_BASE( reg ) ((unsigned long)(mmesa->mgaScreen->mmio.map)) #define MGA_ADDR( reg ) (MGA_BASE(reg) + reg) -#define MGA_DEREF( reg ) *(volatile uint32_t *)MGA_ADDR( reg ) +#define MGA_DEREF( reg ) *(volatile u_int32_t *)MGA_ADDR( reg ) #define MGA_READ( reg ) MGA_DEREF( reg ) #define MGA_WRITE( reg, val ) do { MGA_DEREF( reg ) = val; } while (0) diff --git a/src/mesa/drivers/dri/mga/mgaspan.c b/src/mesa/drivers/dri/mga/mgaspan.c index 62dccc6169f..81cf4c8812a 100644 --- a/src/mesa/drivers/dri/mga/mgaspan.c +++ b/src/mesa/drivers/dri/mga/mgaspan.c @@ -35,7 +35,6 @@ #define DBG 0 - #define LOCAL_VARS \ __DRIdrawablePrivate *dPriv = mmesa->mesa_drawable; \ mgaScreenPrivate *mgaScreen = mmesa->mgaScreen; \ diff --git a/src/mesa/drivers/dri/r128/r128_context.h b/src/mesa/drivers/dri/r128/r128_context.h index 0b4eaa2d741..4574f298bf8 100644 --- a/src/mesa/drivers/dri/r128/r128_context.h +++ b/src/mesa/drivers/dri/r128/r128_context.h @@ -140,9 +140,9 @@ struct r128_context { GLfloat hw_viewport[16]; GLfloat depth_scale; - uint32_t ClearColor; /* Color used to clear color buffer */ - uint32_t ClearDepth; /* Value used to clear depth buffer */ - uint32_t ClearStencil; /* Value used to clear stencil */ + u_int32_t ClearColor; /* Color used to clear color buffer */ + u_int32_t ClearDepth; /* Value used to clear depth buffer */ + u_int32_t ClearStencil; /* Value used to clear stencil */ /* Map GL texture units onto hardware */ diff --git a/src/mesa/drivers/dri/r128/r128_ioctl.c b/src/mesa/drivers/dri/r128/r128_ioctl.c index 1eb887f67ca..2ae0f6fa6b8 100644 --- a/src/mesa/drivers/dri/r128/r128_ioctl.c +++ b/src/mesa/drivers/dri/r128/r128_ioctl.c @@ -230,7 +230,7 @@ static int r128WaitForFrameCompletion( r128ContextPtr rmesa ) int wait = 0; while ( 1 ) { - uint32_t frame = read_MMIO_LE32( R128MMIO, R128_LAST_FRAME_REG ); + u_int32_t frame = read_MMIO_LE32( R128MMIO, R128_LAST_FRAME_REG ); if ( rmesa->sarea->last_frame - frame <= R128_MAX_OUTSTANDING ) { break; diff --git a/src/mesa/drivers/dri/r128/r128_ioctl.h b/src/mesa/drivers/dri/r128/r128_ioctl.h index c17d3ca8cb6..1ee17cf7c62 100644 --- a/src/mesa/drivers/dri/r128/r128_ioctl.h +++ b/src/mesa/drivers/dri/r128/r128_ioctl.h @@ -41,7 +41,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r128_reg.h" #include "r128_lock.h" -#define R128_BUFFER_MAX_DWORDS (R128_BUFFER_SIZE / sizeof(uint32_t)) +#define R128_BUFFER_MAX_DWORDS (R128_BUFFER_SIZE / sizeof(u_int32_t)) extern drmBufPtr r128GetBufferLocked( r128ContextPtr rmesa ); @@ -50,7 +50,7 @@ extern void r128FlushVerticesLocked( r128ContextPtr rmesa ); static __inline void *r128AllocDmaLow( r128ContextPtr rmesa, int count, int vert_size ) { - uint32_t *head; + u_int32_t *head; int bytes = count * vert_size; if ( !rmesa->vert_buf ) { @@ -64,7 +64,7 @@ static __inline void *r128AllocDmaLow( r128ContextPtr rmesa, int count, UNLOCK_HARDWARE( rmesa ); } - head = (uint32_t *)((char *)rmesa->vert_buf->address + rmesa->vert_buf->used); + head = (u_int32_t *)((char *)rmesa->vert_buf->address + rmesa->vert_buf->used); rmesa->vert_buf->used += bytes; rmesa->num_verts += count; diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index f4d069d1391..b9a92128bbb 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -381,8 +381,8 @@ r128FillInModes( unsigned pixel_bits, unsigned depth_bits, GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */ }; - uint8_t depth_bits_array[2]; - uint8_t stencil_bits_array[2]; + u_int8_t depth_bits_array[2]; + u_int8_t stencil_bits_array[2]; depth_bits_array[0] = depth_bits; diff --git a/src/mesa/drivers/dri/r128/r128_tex.c b/src/mesa/drivers/dri/r128/r128_tex.c index 29fa901c055..3b2d017c1f2 100644 --- a/src/mesa/drivers/dri/r128/r128_tex.c +++ b/src/mesa/drivers/dri/r128/r128_tex.c @@ -462,9 +462,9 @@ static void r128TexEnv( GLcontext *ctx, GLenum target, case GL_TEXTURE_LOD_BIAS: { - uint32_t t = rmesa->setup.tex_cntl_c; + u_int32_t t = rmesa->setup.tex_cntl_c; GLint bias; - uint32_t b; + u_int32_t b; /* GTH: This isn't exactly correct, but gives good results up to a * certain point. It is better than completely ignoring the LOD @@ -484,7 +484,7 @@ static void r128TexEnv( GLcontext *ctx, GLenum target, bias = 127; } - b = (uint32_t)bias & 0xff; + b = (u_int32_t)bias & 0xff; t &= ~R128_LOD_BIAS_MASK; t |= (b << R128_LOD_BIAS_SHIFT); diff --git a/src/mesa/drivers/dri/r128/r128_tex.h b/src/mesa/drivers/dri/r128/r128_tex.h index ddfdf683781..d6d2aeff954 100644 --- a/src/mesa/drivers/dri/r128/r128_tex.h +++ b/src/mesa/drivers/dri/r128/r128_tex.h @@ -70,7 +70,7 @@ extern void r128InitTextureFuncs( struct dd_function_table *functions ); #define R128PACKCOLOR4444( r, g, b, a ) \ ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4)) -static __inline__ uint32_t r128PackColor( GLuint cpp, +static __inline__ u_int32_t r128PackColor( GLuint cpp, GLubyte r, GLubyte g, GLubyte b, GLubyte a ) { diff --git a/src/mesa/drivers/dri/r128/r128_texmem.c b/src/mesa/drivers/dri/r128/r128_texmem.c index f7413cf5e35..d011a756719 100644 --- a/src/mesa/drivers/dri/r128/r128_texmem.c +++ b/src/mesa/drivers/dri/r128/r128_texmem.c @@ -85,7 +85,7 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t, int imageWidth, imageHeight; int remaining, rows; int format, dwords; - uint32_t pitch, offset; + u_int32_t pitch, offset; int i; /* Ensure we have a valid texture to upload */ @@ -201,7 +201,7 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t, remaining > 0 ; remaining -= rows, y += rows, i++ ) { - uint32_t *dst; + u_int32_t *dst; drmBufPtr buffer; assert(image->Data); @@ -212,7 +212,7 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t, LOCK_HARDWARE( rmesa ); buffer = r128GetBufferLocked( rmesa ); - dst = (uint32_t *)((char *)buffer->address + R128_HOSTDATA_BLIT_OFFSET); + dst = (u_int32_t *)((char *)buffer->address + R128_HOSTDATA_BLIT_OFFSET); /* Copy the next chunck of the texture image into the blit buffer */ { diff --git a/src/mesa/drivers/dri/r128/r128_texobj.h b/src/mesa/drivers/dri/r128/r128_texobj.h index 5ead8ca9f14..282e8871499 100644 --- a/src/mesa/drivers/dri/r128/r128_texobj.h +++ b/src/mesa/drivers/dri/r128/r128_texobj.h @@ -53,14 +53,14 @@ typedef struct r128_tex_obj r128TexObj, *r128TexObjPtr; struct r128_tex_obj { driTextureObject base; - uint32_t bufAddr; /* Offset to start of locally + u_int32_t bufAddr; /* Offset to start of locally shared texture block */ GLuint age; r128TexImage image[R128_MAX_TEXTURE_LEVELS]; /* Image data for all mipmap levels */ - uint32_t textureFormat; /* Actual hardware format */ + u_int32_t textureFormat; /* Actual hardware format */ drm_r128_texture_regs_t setup; /* Setup regs for texture */ }; diff --git a/src/mesa/drivers/dri/r128/server/r128.h b/src/mesa/drivers/dri/r128/server/r128.h index 15e25285b6a..ce98b1b915c 100644 --- a/src/mesa/drivers/dri/r128/server/r128.h +++ b/src/mesa/drivers/dri/r128/server/r128.h @@ -87,74 +87,74 @@ typedef struct { /* All values in XCLKS */ typedef struct { /* Common registers */ - uint32_t ovr_clr; - uint32_t ovr_wid_left_right; - uint32_t ovr_wid_top_bottom; - uint32_t ov0_scale_cntl; - uint32_t mpp_tb_config; - uint32_t mpp_gp_config; - uint32_t subpic_cntl; - uint32_t viph_control; - uint32_t i2c_cntl_1; - uint32_t gen_int_cntl; - uint32_t cap0_trig_cntl; - uint32_t cap1_trig_cntl; - uint32_t bus_cntl; - uint32_t config_cntl; + u_int32_t ovr_clr; + u_int32_t ovr_wid_left_right; + u_int32_t ovr_wid_top_bottom; + u_int32_t ov0_scale_cntl; + u_int32_t mpp_tb_config; + u_int32_t mpp_gp_config; + u_int32_t subpic_cntl; + u_int32_t viph_control; + u_int32_t i2c_cntl_1; + u_int32_t gen_int_cntl; + u_int32_t cap0_trig_cntl; + u_int32_t cap1_trig_cntl; + u_int32_t bus_cntl; + u_int32_t config_cntl; /* Other registers to save for VT switches */ - uint32_t dp_datatype; - uint32_t gen_reset_cntl; - uint32_t clock_cntl_index; - uint32_t amcgpio_en_reg; - uint32_t amcgpio_mask; + u_int32_t dp_datatype; + u_int32_t gen_reset_cntl; + u_int32_t clock_cntl_index; + u_int32_t amcgpio_en_reg; + u_int32_t amcgpio_mask; /* CRTC registers */ - uint32_t crtc_gen_cntl; - uint32_t crtc_ext_cntl; - uint32_t dac_cntl; - uint32_t crtc_h_total_disp; - uint32_t crtc_h_sync_strt_wid; - uint32_t crtc_v_total_disp; - uint32_t crtc_v_sync_strt_wid; - uint32_t crtc_offset; - uint32_t crtc_offset_cntl; - uint32_t crtc_pitch; + u_int32_t crtc_gen_cntl; + u_int32_t crtc_ext_cntl; + u_int32_t dac_cntl; + u_int32_t crtc_h_total_disp; + u_int32_t crtc_h_sync_strt_wid; + u_int32_t crtc_v_total_disp; + u_int32_t crtc_v_sync_strt_wid; + u_int32_t crtc_offset; + u_int32_t crtc_offset_cntl; + u_int32_t crtc_pitch; /* CRTC2 registers */ - uint32_t crtc2_gen_cntl; + u_int32_t crtc2_gen_cntl; /* Flat panel registers */ - uint32_t fp_crtc_h_total_disp; - uint32_t fp_crtc_v_total_disp; - uint32_t fp_gen_cntl; - uint32_t fp_h_sync_strt_wid; - uint32_t fp_horz_stretch; - uint32_t fp_panel_cntl; - uint32_t fp_v_sync_strt_wid; - uint32_t fp_vert_stretch; - uint32_t lvds_gen_cntl; - uint32_t tmds_crc; - uint32_t tmds_transmitter_cntl; + u_int32_t fp_crtc_h_total_disp; + u_int32_t fp_crtc_v_total_disp; + u_int32_t fp_gen_cntl; + u_int32_t fp_h_sync_strt_wid; + u_int32_t fp_horz_stretch; + u_int32_t fp_panel_cntl; + u_int32_t fp_v_sync_strt_wid; + u_int32_t fp_vert_stretch; + u_int32_t lvds_gen_cntl; + u_int32_t tmds_crc; + u_int32_t tmds_transmitter_cntl; /* Computed values for PLL */ - uint32_t dot_clock_freq; - uint32_t pll_output_freq; + u_int32_t dot_clock_freq; + u_int32_t pll_output_freq; int feedback_div; int post_div; /* PLL registers */ - uint32_t ppll_ref_div; - uint32_t ppll_div_3; - uint32_t htotal_cntl; + u_int32_t ppll_ref_div; + u_int32_t ppll_div_3; + u_int32_t htotal_cntl; /* DDA register */ - uint32_t dda_config; - uint32_t dda_on_off; + u_int32_t dda_config; + u_int32_t dda_on_off; /* Pallet */ GLboolean palette_valid; - uint32_t palette[256]; + u_int32_t palette[256]; } R128SaveRec, *R128SavePtr; typedef struct { @@ -169,8 +169,8 @@ typedef struct { unsigned char *MMIO; /* Map of MMIO region */ unsigned char *FB; /* Map of frame buffer */ - uint32_t MemCntl; - uint32_t BusCntl; + u_int32_t MemCntl; + u_int32_t BusCntl; unsigned long FbMapSize; /* Size of frame buffer, in bytes */ int Flags; /* Saved copy of mode flags */ @@ -201,7 +201,7 @@ typedef struct { /* Computed values for Rage 128 */ int pitch; int datatype; - uint32_t dp_gui_master_cntl; + u_int32_t dp_gui_master_cntl; /* Saved values for ScreenToScreenCopy */ int xdir; @@ -306,18 +306,18 @@ typedef struct { int log2TexGran; /* Saved scissor values */ - uint32_t sc_left; - uint32_t sc_right; - uint32_t sc_top; - uint32_t sc_bottom; + u_int32_t sc_left; + u_int32_t sc_right; + u_int32_t sc_top; + u_int32_t sc_bottom; - uint32_t re_top_left; - uint32_t re_width_height; + u_int32_t re_top_left; + u_int32_t re_width_height; - uint32_t aux_sc_cntl; + u_int32_t aux_sc_cntl; int irq; - uint32_t gen_int_cntl; + u_int32_t gen_int_cntl; GLboolean DMAForXv; @@ -388,7 +388,7 @@ do { \ #define R128_VERBOSE 0 -#define RING_LOCALS uint32_t *__head; int __count; +#define RING_LOCALS u_int32_t *__head; int __count; #define R128CCE_REFRESH(pScrn, info) \ do { \ @@ -429,12 +429,12 @@ do { \ fprintf(stderr, \ "ADVANCE_RING() used: %d+%d=%d/%d\n", \ info->indirectBuffer->used - info->indirectStart, \ - __count * sizeof(uint32_t), \ + __count * sizeof(u_int32_t), \ info->indirectBuffer->used - info->indirectStart + \ - __count * sizeof(uint32_t), \ + __count * sizeof(u_int32_t), \ info->indirectBuffer->total - info->indirectStart ); \ } \ - info->indirectBuffer->used += __count * (int)sizeof(uint32_t); \ + info->indirectBuffer->used += __count * (int)sizeof(u_int32_t); \ } while (0) #define OUT_RING( x ) do { \ diff --git a/src/mesa/drivers/dri/r128/server/r128_dri.c b/src/mesa/drivers/dri/r128/server/r128_dri.c index 61587617a63..a2b717b0ea3 100644 --- a/src/mesa/drivers/dri/r128/server/r128_dri.c +++ b/src/mesa/drivers/dri/r128/server/r128_dri.c @@ -271,7 +271,7 @@ static GLboolean R128DRIPciInit(const DRIDriverContext *ctx) { R128InfoPtr info = ctx->driverPrivate; unsigned char *R128MMIO = ctx->MMIOAddress; - uint32_t chunk; + u_int32_t chunk; int ret; int flags; diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c b/src/mesa/drivers/dri/r200/r200_ioctl.c index 04a00b71518..aafa2981bd4 100644 --- a/src/mesa/drivers/dri/r200/r200_ioctl.c +++ b/src/mesa/drivers/dri/r200/r200_ioctl.c @@ -343,11 +343,11 @@ void r200AllocDmaRegionVerts( r200ContextPtr rmesa, * SwapBuffers with client-side throttling */ -static uint32_t r200GetLastFrame(r200ContextPtr rmesa) +static u_int32_t r200GetLastFrame(r200ContextPtr rmesa) { drm_radeon_getparam_t gp; int ret; - uint32_t frame; + u_int32_t frame; gp.param = RADEON_PARAM_LAST_FRAME; gp.value = (int *)&frame; diff --git a/src/mesa/drivers/dri/r200/r200_screen.c b/src/mesa/drivers/dri/r200/r200_screen.c index 4d46accda6c..6731287d7b7 100644 --- a/src/mesa/drivers/dri/r200/r200_screen.c +++ b/src/mesa/drivers/dri/r200/r200_screen.c @@ -160,8 +160,8 @@ r200FillInModes( unsigned pixel_bits, unsigned depth_bits, GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */ }; - uint8_t depth_bits_array[2]; - uint8_t stencil_bits_array[2]; + u_int8_t depth_bits_array[2]; + u_int8_t stencil_bits_array[2]; depth_bits_array[0] = depth_bits; @@ -372,7 +372,7 @@ r200CreateScreen( __DRIscreenPrivate *sPriv ) __driUtilMessage("%s: drmMap (2) failed\n", __FUNCTION__ ); return NULL; } - screen->scratch = (__volatile__ uint32_t *) + screen->scratch = (__volatile__ u_int32_t *) ((GLubyte *)screen->status.map + RADEON_SCRATCH_REG_OFFSET); screen->buffers = drmMapBufs( sPriv->fd ); diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index 13a951f0659..f5a4a031188 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -273,7 +273,7 @@ static void r200_set_blend_state( GLcontext * ctx ) default: fprintf( stderr, "[%s:%u] Invalid RGB blend equation (0x%04x).\n", - __func__, __LINE__, ctx->Color.BlendEquationRGB ); + __FUNCTION__, __LINE__, ctx->Color.BlendEquationRGB ); return; } @@ -312,7 +312,7 @@ static void r200_set_blend_state( GLcontext * ctx ) default: fprintf( stderr, "[%s:%u] Invalid A blend equation (0x%04x).\n", - __func__, __LINE__, ctx->Color.BlendEquationA ); + __FUNCTION__, __LINE__, ctx->Color.BlendEquationA ); return; } @@ -829,7 +829,7 @@ static void r200PolygonMode( GLcontext *ctx, GLenum face, GLenum mode ) static void r200UpdateSpecular( GLcontext *ctx ) { r200ContextPtr rmesa = R200_CONTEXT(ctx); - uint32_t p = rmesa->hw.ctx.cmd[CTX_PP_CNTL]; + u_int32_t p = rmesa->hw.ctx.cmd[CTX_PP_CNTL]; R200_STATECHANGE( rmesa, tcl ); R200_STATECHANGE( rmesa, vtx ); diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c index e4f6caa472d..04c40d47c2e 100644 --- a/src/mesa/drivers/dri/r200/r200_tcl.c +++ b/src/mesa/drivers/dri/r200/r200_tcl.c @@ -101,7 +101,7 @@ static GLboolean discrete_prim[0x10] = { }; -#define LOCAL_VARS r200ContextPtr rmesa = R200_CONTEXT(ctx); (void)rmesa +#define LOCAL_VARS r200ContextPtr rmesa = R200_CONTEXT(ctx) #define ELT_TYPE GLushort #define ELT_INIT(prim, hw_prim) \ @@ -220,7 +220,7 @@ static void r200EmitPrim( GLcontext *ctx, #ifdef MESA_BIG_ENDIAN /* We could do without (most of) this ugliness if dest was always 32 bit word aligned... */ -#define EMIT_ELT(dest, offset, x) do { \ +#define EMIT_ELT(dest, offset, x) do { \ int off = offset + ( ( (GLuint)dest & 0x2 ) >> 1 ); \ GLushort *des = (GLushort *)( (GLuint)dest & ~0x2 ); \ (des)[ off + 1 - 2 * ( off & 1 ) ] = (GLushort)(x); \ diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.c b/src/mesa/drivers/dri/radeon/radeon_ioctl.c index 5b758e66ba2..ee1104d91a5 100644 --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.c +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.c @@ -772,11 +772,11 @@ void radeonAllocDmaRegionVerts( radeonContextPtr rmesa, * SwapBuffers with client-side throttling */ -static uint32_t radeonGetLastFrame (radeonContextPtr rmesa) +static u_int32_t radeonGetLastFrame (radeonContextPtr rmesa) { unsigned char *RADEONMMIO = rmesa->radeonScreen->mmio.map; int ret; - uint32_t frame; + u_int32_t frame; if (rmesa->dri.screen->drmMinor >= 4) { drm_radeon_getparam_t gp; @@ -1011,7 +1011,7 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all, __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; drm_radeon_sarea_t *sarea = rmesa->sarea; unsigned char *RADEONMMIO = rmesa->radeonScreen->mmio.map; - uint32_t clear; + u_int32_t clear; GLuint flags = 0; GLuint color_mask = 0; GLint ret, i; diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index d23313da448..35f965fd1e1 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -134,8 +134,8 @@ radeonFillInModes( unsigned pixel_bits, unsigned depth_bits, GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */ }; - uint8_t depth_bits_array[2]; - uint8_t stencil_bits_array[2]; + u_int8_t depth_bits_array[2]; + u_int8_t stencil_bits_array[2]; depth_bits_array[0] = depth_bits; @@ -273,7 +273,7 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv ) __driUtilMessage("%s: drmMap (2) failed\n", __FUNCTION__ ); return NULL; } - screen->scratch = (__volatile__ uint32_t *) + screen->scratch = (__volatile__ u_int32_t *) ((GLubyte *)screen->status.map + RADEON_SCRATCH_REG_OFFSET); screen->buffers = drmMapBufs( sPriv->fd ); diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.h b/src/mesa/drivers/dri/radeon/radeon_screen.h index edd4a08f818..72edec881d4 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.h +++ b/src/mesa/drivers/dri/radeon/radeon_screen.h @@ -89,7 +89,7 @@ typedef struct { drmBufMapPtr buffers; - __volatile__ uint32_t *scratch; + __volatile__ u_int32_t *scratch; __DRIscreenPrivate *driScreen; unsigned int sarea_priv_offset; diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c index 3d0eda3a07e..ff6f8bc7269 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state.c +++ b/src/mesa/drivers/dri/radeon/radeon_state.c @@ -693,7 +693,7 @@ static void radeonPolygonMode( GLcontext *ctx, GLenum face, GLenum mode ) static void radeonUpdateSpecular( GLcontext *ctx ) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - uint32_t p = rmesa->hw.ctx.cmd[CTX_PP_CNTL]; + u_int32_t p = rmesa->hw.ctx.cmd[CTX_PP_CNTL]; RADEON_STATECHANGE( rmesa, tcl ); diff --git a/src/mesa/drivers/dri/radeon/radeon_swtcl.c b/src/mesa/drivers/dri/radeon/radeon_swtcl.c index 35720fd6589..7adec5e488c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_swtcl.c +++ b/src/mesa/drivers/dri/radeon/radeon_swtcl.c @@ -508,8 +508,8 @@ static __inline void radeonEltPrimitive( radeonContextPtr rmesa, GLenum prim ) -#define LOCAL_VARS radeonContextPtr rmesa = RADEON_CONTEXT(ctx); (void)rmesa -#define ELTS_VARS( buf ) GLushort *dest = buf +#define LOCAL_VARS radeonContextPtr rmesa = RADEON_CONTEXT(ctx) +#define ELTS_VARS( buf ) GLushort *dest = buf; (void)rmesa; #define INIT( prim ) radeonDmaPrimitive( rmesa, prim ) #define ELT_INIT(prim) radeonEltPrimitive( rmesa, prim ) #define FLUSH() RADEON_NEWPRIM( rmesa ) diff --git a/src/mesa/drivers/dri/radeon/radeon_tcl.c b/src/mesa/drivers/dri/radeon/radeon_tcl.c index 760c9a03410..5c91bf4bd8a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tcl.c +++ b/src/mesa/drivers/dri/radeon/radeon_tcl.c @@ -105,7 +105,7 @@ static GLboolean discrete_prim[0x10] = { }; -#define LOCAL_VARS radeonContextPtr rmesa = RADEON_CONTEXT(ctx); (void)rmesa +#define LOCAL_VARS radeonContextPtr rmesa = RADEON_CONTEXT(ctx) #define ELT_TYPE GLushort #define ELT_INIT(prim, hw_prim) \ diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c index 1cf2211d302..91e7ec29601 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.c +++ b/src/mesa/drivers/dri/sis/sis_screen.c @@ -74,8 +74,8 @@ sisFillInModes(int bpp) static const GLenum back_buffer_modes[] = { GLX_NONE, GLX_SWAP_UNDEFINED_OML }; - uint8_t depth_bits_array[4]; - uint8_t stencil_bits_array[4]; + u_int8_t depth_bits_array[4]; + u_int8_t stencil_bits_array[4]; depth_bits_array[0] = 0; stencil_bits_array[0] = 0; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_state.c b/src/mesa/drivers/dri/tdfx/tdfx_state.c index 6edf804b2ec..7aa6098c721 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_state.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_state.c @@ -71,7 +71,7 @@ static void tdfxUpdateAlphaMode( GLcontext *ctx ) { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); GrCmpFnc_t func; - GrAlphaBlendFnc_t srcRGB, dstRGB, srcA, dstA; + GrAlphaBlendFnc_t srcRGB, dstRGB = GR_BLEND_ZERO, srcA, dstA; GrAlphaBlendOp_t eqRGB, eqA; GrAlpha_t ref = (GLint) (ctx->Color.AlphaRef * 255.0); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index 2e8e3cba5dd..3091fd18635 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -69,7 +69,7 @@ _mesa_halve2x2_teximage2d ( GLcontext *ctx, GLuint bpt = 0; GLubyte *_s = NULL; GLubyte *_d = NULL; - GLenum _t; + GLenum _t = 0; if (texImage->TexFormat->MesaFormat == MESA_FORMAT_RGB565) { _t = GL_UNSIGNED_SHORT_5_6_5_REV; @@ -650,6 +650,8 @@ convertPalette(FxU32 data[256], const struct gl_color_table *table) data[i] = (a << 24) | (r << 16) | (g << 8) | b; } return GR_TEXTABLE_PALETTE_6666_EXT; + default: + return GR_TEXTABLE_NCC0; /* ???? */ } /* XXX fixme: how can this happen? */ _mesa_error(NULL, GL_INVALID_ENUM, "convertPalette: table->Format == %s", diff --git a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c index bb974279a2a..7059b56e3d0 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c @@ -1922,8 +1922,10 @@ static void setupTextureDoubleTMU(GLcontext * ctx) tdfxTexInfo *ti1 = TDFX_TEXTURE_DATA(tObj1); struct gl_texture_image *baseImage0 = tObj0->Image[0][tObj0->BaseLevel]; struct gl_texture_image *baseImage1 = tObj1->Image[0][tObj1->BaseLevel]; +#if 0/*JJJ*/ const GLenum envMode0 = ctx->Texture.Unit[0].EnvMode; const GLenum envMode1 = ctx->Texture.Unit[1].EnvMode; +#endif if (baseImage0->Border > 0 || baseImage1->Border > 0) { FALLBACK(fxMesa, TDFX_FALLBACK_TEXTURE_BORDER, GL_TRUE); diff --git a/src/mesa/drivers/dri/unichrome/server/via_dri.c b/src/mesa/drivers/dri/unichrome/server/via_dri.c index 92c97003709..ea53c6adf86 100644 --- a/src/mesa/drivers/dri/unichrome/server/via_dri.c +++ b/src/mesa/drivers/dri/unichrome/server/via_dri.c @@ -68,9 +68,9 @@ static int VIADRIFinishScreenInit(DRIDriverContext * ctx); /* _SOLO : missing macros normally defined by X code */ #define xf86DrvMsg(a, b, ...) fprintf(stderr, __VA_ARGS__) -#define MMIO_IN8(base, addr) ((*(((volatile uint8_t*)base)+(addr)))+0) -#define MMIO_OUT8(base, addr, val) ((*(((volatile uint8_t*)base)+(addr)))=((uint8_t)val)) -#define MMIO_OUT16(base, addr, val) ((*(volatile uint16_t*)(((uint8_t*)base)+(addr)))=((uint16_t)val)) +#define MMIO_IN8(base, addr) ((*(((volatile u_int8_t*)base)+(addr)))+0) +#define MMIO_OUT8(base, addr, val) ((*(((volatile u_int8_t*)base)+(addr)))=((u_int8_t)val)) +#define MMIO_OUT16(base, addr, val) ((*(volatile u_int16_t*)(((u_int8_t*)base)+(addr)))=((u_int16_t)val)) #define VIDEO 0 #define AGP 1 @@ -383,9 +383,9 @@ static int VIADRIKernelInit(DRIDriverContext * ctx, VIAPtr pVia) drmInfo.fb_offset = pVia->FrameBufferBase; drmInfo.mmio_offset = pVia->registerHandle; if (pVia->IsPCI) - drmInfo.agpAddr = (uint32_t)NULL; + drmInfo.agpAddr = (u_int32_t)NULL; else - drmInfo.agpAddr = (uint32_t)pVia->agpAddr; + drmInfo.agpAddr = (u_int32_t)pVia->agpAddr; if (drmVIAInitMAP(pVia->drmFD, &drmInfo) < 0) return GL_FALSE; @@ -489,7 +489,7 @@ static void VIADisableMMIO(DRIDriverContext * ctx) static void VIADisableExtendedFIFO(DRIDriverContext *ctx) { VIAPtr pVia = VIAPTR(ctx); - uint32_t dwGE230, dwGE298; + u_int32_t dwGE230, dwGE298; /* Cause of exit XWindow will dump back register value, others chipset no * need to set extended fifo value */ @@ -511,8 +511,8 @@ static void VIADisableExtendedFIFO(DRIDriverContext *ctx) static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) { VIAPtr pVia = VIAPTR(ctx); - uint8_t bRegTemp; - uint32_t dwGE230, dwGE298; + u_int8_t bRegTemp; + u_int32_t dwGE230, dwGE298; switch (pVia->Chipset) { case VIA_CLE266: @@ -707,7 +707,7 @@ static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) SR1C[7:0], SR1D[1:0] (10bits) *=*/ wRegTemp = (pBIOSInfo->offsetWidthByQWord >> 1) + 4; VGAOUT8(0x3c4, 0x1c); - VGAOUT8(0x3c5, (uint8_t)(wRegTemp & 0xFF)); + VGAOUT8(0x3c5, (u_int8_t)(wRegTemp & 0xFF)); VGAOUT8(0x3c4, 0x1d); bRegTemp = VGAIN8(0x3c5) & ~0x03; VGAOUT8(0x3c5, bRegTemp | ((wRegTemp & 0x300) >> 8)); @@ -753,7 +753,7 @@ static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) SR1C[7:0], SR1D[1:0] (10bits) *=*/ wRegTemp = (pBIOSInfo->offsetWidthByQWord >> 1) + 4; VGAOUT8(0x3c4, 0x1c); - VGAOUT8(0x3c5, (uint8_t)(wRegTemp & 0xFF)); + VGAOUT8(0x3c5, (u_int8_t)(wRegTemp & 0xFF)); VGAOUT8(0x3c4, 0x1d); bRegTemp = VGAIN8(0x3c5) & ~0x03; VGAOUT8(0x3c5, bRegTemp | ((wRegTemp & 0x300) >> 8)); @@ -781,9 +781,9 @@ static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) static void VIAInitialize2DEngine(DRIDriverContext *ctx) { VIAPtr pVia = VIAPTR(ctx); - uint32_t dwVQStartAddr, dwVQEndAddr; - uint32_t dwVQLen, dwVQStartL, dwVQEndL, dwVQStartEndH; - uint32_t dwGEMode; + u_int32_t dwVQStartAddr, dwVQEndAddr; + u_int32_t dwVQLen, dwVQStartL, dwVQEndL, dwVQStartEndH; + u_int32_t dwGEMode; /* init 2D engine regs to reset 2D engine */ VIASETREG(0x04, 0x0); @@ -925,14 +925,14 @@ static void VIAInitialize3DEngine(DRIDriverContext *ctx) for (i = 0; i <= 0x7D; i++) { - VIASETREG(0x440, (uint32_t) i << 24); + VIASETREG(0x440, (u_int32_t) i << 24); } VIASETREG(0x43C, 0x00020000); for (i = 0; i <= 0x94; i++) { - VIASETREG(0x440, (uint32_t) i << 24); + VIASETREG(0x440, (u_int32_t) i << 24); } VIASETREG(0x440, 0x82400000); @@ -942,7 +942,7 @@ static void VIAInitialize3DEngine(DRIDriverContext *ctx) for (i = 0; i <= 0x94; i++) { - VIASETREG(0x440, (uint32_t) i << 24); + VIASETREG(0x440, (u_int32_t) i << 24); } VIASETREG(0x440, 0x82400000); @@ -950,7 +950,7 @@ static void VIAInitialize3DEngine(DRIDriverContext *ctx) for (i = 0; i <= 0x03; i++) { - VIASETREG(0x440, (uint32_t) i << 24); + VIASETREG(0x440, (u_int32_t) i << 24); } VIASETREG(0x43C, 0x00030000); diff --git a/src/mesa/drivers/dri/unichrome/server/via_driver.h b/src/mesa/drivers/dri/unichrome/server/via_driver.h index f6f2d58938b..997b2e41a70 100644 --- a/src/mesa/drivers/dri/unichrome/server/via_driver.h +++ b/src/mesa/drivers/dri/unichrome/server/via_driver.h @@ -212,12 +212,12 @@ typedef struct _VIA { XAAInfoRecPtr AccelInfoRec; xRectangle Rect; #endif - uint32_t SavedCmd; - uint32_t SavedFgColor; - uint32_t SavedBgColor; - uint32_t SavedPattern0; - uint32_t SavedPattern1; - uint32_t SavedPatternAddr; + u_int32_t SavedCmd; + u_int32_t SavedFgColor; + u_int32_t SavedBgColor; + u_int32_t SavedPattern0; + u_int32_t SavedPattern1; + u_int32_t SavedPatternAddr; #if 0 /* Support for Int10 processing */ @@ -255,8 +255,8 @@ typedef struct _VIA { #endif /* - uint32_t Cap0_Deinterlace; - uint32_t Cap1_Deinterlace; + u_int32_t Cap0_Deinterlace; + u_int32_t Cap1_Deinterlace; int Cap0_FieldSwap; int NoCap0_HFilter; @@ -272,7 +272,7 @@ typedef struct _VIA { VIAConfigPrivPtr pVisualConfigsPriv; unsigned long agpHandle; unsigned long registerHandle; - uint32_t agpAddr; + u_int32_t agpAddr; unsigned char *agpBase; unsigned int agpSize; int IsPCI; @@ -288,11 +288,11 @@ typedef struct _VIA { #endif int V4LEnabled; - uint16_t ActiveDevice; /* if SAMM, non-equal pBIOSInfo->ActiveDevice */ + u_int16_t ActiveDevice; /* if SAMM, non-equal pBIOSInfo->ActiveDevice */ unsigned char *CursorImage; - uint32_t CursorFG; - uint32_t CursorBG; - uint32_t CursorMC; + u_int32_t CursorFG; + u_int32_t CursorBG; + u_int32_t CursorMC; unsigned char MemClk; int EnableExtendedFIFO; diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index fb00950bbbd..283dec14036 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -324,8 +324,8 @@ viaFillInModes( unsigned pixel_bits, GLboolean have_back_buffer ) /* The 32-bit depth-buffer mode isn't supported yet, so don't actually * enable it. */ - static const uint8_t depth_bits_array[4] = { 0, 16, 24, 32 }; - static const uint8_t stencil_bits_array[4] = { 0, 0, 8, 0 }; + static const u_int8_t depth_bits_array[4] = { 0, 16, 24, 32 }; + static const u_int8_t stencil_bits_array[4] = { 0, 0, 8, 0 }; const unsigned depth_buffer_factor = 3; diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c index 4f75f08617f..052ceabc3b5 100644 --- a/src/mesa/drivers/dri/unichrome/via_state.c +++ b/src/mesa/drivers/dri/unichrome/via_state.c @@ -513,10 +513,10 @@ void viaInitState(GLcontext *ctx) /** * Convert S and T texture coordinate wrap modes to hardware bits. */ -static uint32_t +static u_int32_t get_wrap_mode( GLenum sWrap, GLenum tWrap ) { - uint32_t v = 0; + u_int32_t v = 0; switch( sWrap ) { diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index e6752d01229..4eafe3e899f 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -543,7 +543,6 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, struct gl_color_table *table = NULL; GLfloat rScale = 1.0, gScale = 1.0, bScale = 1.0, aScale = 1.0; GLfloat rBias = 0.0, gBias = 0.0, bBias = 0.0, aBias = 0.0; - GLint comps; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); switch (target) { @@ -636,8 +635,8 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, return; } - comps = _mesa_components_in_format(table->Format); - assert(comps > 0); /* error should have been caught sooner */ + /* error should have been caught sooner */ + assert(_mesa_components_in_format(table->Format) > 0); if (start + count > (GLint) table->Size) { _mesa_error(ctx, GL_INVALID_VALUE, "glColorSubTable(count)"); diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index f1ed98d4bb1..8968c0aa838 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -645,7 +645,6 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) texUnit->TexGenEnabled = newenabled; break; } - break; case GL_TEXTURE_GEN_S: { GLuint unit = ctx->Texture.CurrentUnit; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; @@ -658,7 +657,6 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) texUnit->TexGenEnabled = newenabled; break; } - break; case GL_TEXTURE_GEN_T: { GLuint unit = ctx->Texture.CurrentUnit; struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; @@ -671,7 +669,6 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) texUnit->TexGenEnabled = newenabled; break; } - break; /* * CLIENT STATE!!! diff --git a/src/mesa/main/enums.h b/src/mesa/main/enums.h index d2fa917d42f..7e8d4ee94fc 100644 --- a/src/mesa/main/enums.h +++ b/src/mesa/main/enums.h @@ -31,13 +31,13 @@ * 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. */ - +/* $XFree86: xc/extras/Mesa/src/mesa/main/enums.h,v 1.2 2004/06/23 19:40:14 tsi Exp $ */ #ifndef _ENUMS_H_ #define _ENUMS_H_ -#ifdef _HAVE_FULL_GL +#if defined(_HAVE_FULL_GL) && _HAVE_FULL_GL extern const char *_mesa_lookup_enum_by_nr( int nr ); extern int _mesa_lookup_enum_by_name( const char *symbol ); diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index a1be2b535ed..678d40bb685 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -42,9 +42,12 @@ #include "arbprogparse.h" #include "grammar_mesa.h" -#if !defined(__GNUC__) && !defined(__extension__) +#ifndef __extension__ +#if !defined(__GNUC__) || (__GNUC__ < 2) || \ + ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 7)) # define __extension__ #endif +#endif /* TODO: * Fragment Program Stuff: diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c index 2d830b4b0fd..b3e1401b8a2 100644 --- a/src/mesa/x86/common_x86.c +++ b/src/mesa/x86/common_x86.c @@ -230,7 +230,8 @@ static void check_os_sse_support( void ) #endif /* _POSIX_SOURCE && X86_FXSR_MAGIC */ #elif defined(__FreeBSD__) { - int ret, len, enabled; + int ret, enabled; + unsigned int len; len = sizeof(enabled); ret = sysctlbyname("hw.instruction_sse", &enabled, &len, NULL, 0); if (ret || !enabled) -- cgit v1.2.3 From 8b563fd4c540d23d16c6b0784a6bf25f5a0701d0 Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Wed, 15 Dec 2004 07:55:38 +0000 Subject: added DMesaProc type to prevent gcc 3.4.3 warnings --- include/GL/dmesa.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h index 795853bceb5..e67b3426f93 100644 --- a/include/GL/dmesa.h +++ b/include/GL/dmesa.h @@ -23,9 +23,9 @@ */ /* - * DOS/DJGPP device driver v1.6 for Mesa + * DOS/DJGPP device driver v1.7 for Mesa * - * Copyright (C) 2002 - Borca Daniel + * Copyright (C) 2002 - Daniel Borca * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca */ @@ -138,7 +138,8 @@ void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue); /* * DMesa functions */ -void *DMesaGetProcAddress (const char *name); +typedef void (*DMesaProc) (void); +DMesaProc DMesaGetProcAddress (const char *name); /* * DMesa state retrieval. -- cgit v1.2.3 From 538541e3002e7271fad21c0e5c21b65c0db90e45 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 17 Dec 2004 14:48:00 +0000 Subject: VMS update --- include/GL/glxext.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/glxext.h b/include/GL/glxext.h index 880f2f30f04..068f1c0667f 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -334,9 +334,9 @@ typedef struct { #if defined(__UNIXOS2__) || defined(__SOL64__) typedef long int int32_t; typedef long long int int64_t; -#endif - -#if defined(__SCO__) || defined(__USLC__) +#elif defined( __VMS ) +#include +#elif defined(__SCO__) || defined(__USLC__) #include #endif -- cgit v1.2.3 From 81ca616e7e84768cf91234e4132df9d737b98d94 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 3 Jan 2005 15:35:00 +0000 Subject: DirectFB driver (Claudio Ciccani) --- Makefile | 9 +- configs/linux-directfb | 29 ++ docs/README.directfb | 28 ++ include/GL/directfbgl.h | 89 ++++ src/mesa/drivers/directfb/Makefile | 53 +++ src/mesa/drivers/directfb/idirectfbgl_mesa.c | 642 +++++++++++++++++++++++++++ 6 files changed, 849 insertions(+), 1 deletion(-) create mode 100644 configs/linux-directfb create mode 100644 docs/README.directfb create mode 100644 include/GL/directfbgl.h create mode 100644 src/mesa/drivers/directfb/Makefile create mode 100644 src/mesa/drivers/directfb/idirectfbgl_mesa.c (limited to 'include') diff --git a/Makefile b/Makefile index 495ebbbdcb7..52d82b34b1a 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,11 @@ realclean: install: @echo "Installing" - $(TOP)/bin/installmesa + $(TOP)/bin/installmesa + +# DirectFBGL module installation +linux-directfb-install: + cd src/mesa/drivers/directfb && $(MAKE) install # If there's no current configuration file $(TOP)/configs/current: @@ -78,6 +82,7 @@ linux \ linux-alpha \ linux-alpha-static \ linux-debug \ +linux-directfb \ linux-dri \ linux-dri-x86 \ linux-dri-x86-64 \ @@ -201,6 +206,8 @@ LIB_FILES = \ $(DIRECTORY)/src/mesa/drivers/beos/Makefile \ $(DIRECTORY)/src/mesa/drivers/common/*.[ch] \ $(DIRECTORY)/src/mesa/drivers/common/descrip.mms \ + $(DIRECTORY)/src/mesa/drivers/directfb/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/directfb/Makefile \ $(DIRECTORY)/src/mesa/drivers/dos/*.[chS] \ $(DIRECTORY)/src/mesa/drivers/dri/common/*.[ch] \ $(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \ diff --git a/configs/linux-directfb b/configs/linux-directfb new file mode 100644 index 00000000000..f09c69ddabd --- /dev/null +++ b/configs/linux-directfb @@ -0,0 +1,29 @@ +# Configuration for DirectFB + +include $(TOP)/configs/default + +CONFIG_NAME = linux-directfb + +# Compiler and flags +CC = gcc +CXX = g++ + +CFLAGS = -Wall -O3 -ffast-math -fPIC -std=c99 -D_GNU_SOURCE -D_POSIX_SOURCE -D_SVID_SOURCE \ + -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -DPTHREADS + +CXXFLAGS = -Wall -O3 -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE + +HAVE_X86 = $(shell uname -m | grep 'i[3-6]86' >/dev/null && echo yes) +ifeq ($(HAVE_X86), yes) + CFLAGS += -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM + CXXFLAGS += -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM + ASM_SOURCES = $(X86_SOURCES) $(X86_API) +endif + +# Directories +SRC_DIRS = mesa glu +DRIVER_DIRS = directfb +PROGRAM_DIRS = # disabled + +# Library/program dependencies +GL_LIB_DEPS = -lm -lpthread diff --git a/docs/README.directfb b/docs/README.directfb new file mode 100644 index 00000000000..169ebe486ee --- /dev/null +++ b/docs/README.directfb @@ -0,0 +1,28 @@ + + Mesa DirectFB Information + + +Requirements +============ + + To build Mesa with DirectFB (DirectFBGL) support you need: + - DirectFB at least 0.9.21 (http://directfb.org) + - pkg-config at least 0.9 (http://pkgconfig.sf.net) + + +Installation +============ + Run + + make linux-directfb + + to build Mesa and DirectFBGL module, + + make install + + to install OpenGL libraries and + + make linux-directfb-install + + to install DirectFBGL module in the proper location. + diff --git a/include/GL/directfbgl.h b/include/GL/directfbgl.h new file mode 100644 index 00000000000..984c4b14279 --- /dev/null +++ b/include/GL/directfbgl.h @@ -0,0 +1,89 @@ +/* + (c) Copyright 2001 convergence integrated media GmbH. + All rights reserved. + + Written by Denis Oliver Kropp and + Andreas Hundt . + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#ifndef __DIRECTFBGL_H__ +#define __DIRECTFBGL_H__ + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + +typedef struct { + int buffer_size; + int depth_size; + int stencil_size; + int aux_buffers; + + int red_size; + int green_size; + int blue_size; + int alpha_size; + + int accum_red_size; + int accum_green_size; + int accum_blue_size; + int accum_alpha_size; + + DFBBoolean double_buffer; + DFBBoolean stereo; +} DFBGLAttributes; + + +DEFINE_INTERFACE( IDirectFBGL, + + /** Context handling **/ + + /* + * Acquire the hardware lock. + */ + DFBResult (*Lock) ( + IDirectFBGL *thiz + ); + + /* + * Release the lock. + */ + DFBResult (*Unlock) ( + IDirectFBGL *thiz + ); + + /* + * Query the OpenGL attributes. + */ + DFBResult (*GetAttributes) ( + IDirectFBGL *thiz, + DFBGLAttributes *attributes + ); +) + + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/src/mesa/drivers/directfb/Makefile b/src/mesa/drivers/directfb/Makefile new file mode 100644 index 00000000000..d78662dd967 --- /dev/null +++ b/src/mesa/drivers/directfb/Makefile @@ -0,0 +1,53 @@ +# src/mesa/drivers/directfb/Makefile + +TOP = ../../../.. + +include $(TOP)/configs/current + + +INCLUDE_DIRS = \ + -I$(TOP)/include \ + -I$(TOP)/src/mesa \ + -I$(TOP)/src/mesa/main \ + -I$(TOP)/src/mesa/glapi \ + -I$(TOP)/src/mesa/math \ + -I$(TOP)/src/mesa/tnl \ + -I$(TOP)/src/mesa/shader \ + -I$(TOP)/src/mesa/swrast \ + -I$(TOP)/src/mesa/swrast_setup + +DFB_CFLAGS = $(shell pkg-config --cflags directfb) +DFB_MODULEDIR = $(shell pkg-config --variable=moduledir directfb-internal) + +DIRECTFBGL_MESA_SOURCES = ../common/driverfuncs.c idirectfbgl_mesa.c + +DIRECTFBGL_MESA_OBJECTS = $(DIRECTFBGL_MESA_SOURCES:.c=.o) + +DIRECTFBGL_MESA = libidirectfbgl_mesa.so + +.c.o: + $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DFB_CFLAGS) $< -o $@ + + +default: directfbgl_mesa + +# Mesa DirectFBGL module +directfbgl_mesa: $(DIRECTFBGL_MESA_OBJECTS) + $(CC) -shared $(CFLAGS) $(DIRECTFBGL_MESA_OBJECTS) -o $(DIRECTFBGL_MESA) \ + -Wl,-soname -Wl,$(DIRECTFBGL_MESA) -L$(TOP)/lib -lGL -lm + + +install: + @if test -d $(DFB_MODULEDIR); then \ + echo "Installing DirectFBGL module."; \ + else \ + echo "*** Failed to determine DirectFB module's directory."; \ + echo "*** Installation aborted."; \ + exit 1; \ + fi; + install -m 0755 $(DIRECTFBGL_MESA) $(DFB_MODULEDIR)/interfaces/IDirectFBGL/ + + +clean: + rm -f *.o *.so + diff --git a/src/mesa/drivers/directfb/idirectfbgl_mesa.c b/src/mesa/drivers/directfb/idirectfbgl_mesa.c new file mode 100644 index 00000000000..c438b86421a --- /dev/null +++ b/src/mesa/drivers/directfb/idirectfbgl_mesa.c @@ -0,0 +1,642 @@ +/* + * Copyright (C) 2004 Claudio Ciccani + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * + * Based on glfbdev.c, written by Brian Paul. + * + */ + +#include +#include +#include + +#include + +#include +#include +#include + +#ifdef CLAMP +# undef CLAMP +#endif + +#include "GL/directfbgl.h" +#include "glheader.h" +#include "buffers.h" +#include "context.h" +#include "extensions.h" +#include "imports.h" +#include "texformat.h" +#include "teximage.h" +#include "texstore.h" +#include "array_cache/acache.h" +#include "swrast/swrast.h" +#include "swrast_setup/swrast_setup.h" +#include "tnl/tnl.h" +#include "tnl/t_context.h" +#include "tnl/t_pipeline.h" +#include "drivers/common/driverfuncs.h" + + +static DFBResult +Probe( void *data ); + +static DFBResult +Construct( IDirectFBGL *thiz, + IDirectFBSurface *surface ); + +#include + +DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBGL, Mesa ) + +/* + * private data struct of IDirectFBGL + */ +typedef struct { + int ref; /* reference counter */ + + bool locked; + + IDirectFBSurface *surface; + DFBSurfacePixelFormat format; + int width; + int height; + + struct { + __u8 *start; + __u8 *end; + int pitch; + } video; + + GLvisual visual; + GLframebuffer framebuffer; + GLcontext context; +} IDirectFBGL_data; + + +static bool dfb_mesa_setup_visual ( GLvisual *visual, + DFBSurfacePixelFormat format ); +static bool dfb_mesa_create_context ( GLcontext *context, + GLframebuffer *framebuffer, + GLvisual *visual, + DFBSurfacePixelFormat format, + void *data ); +static void dfb_mesa_destroy_context( GLcontext *context, + GLframebuffer *framebuffer ); + + +static void +IDirectFBGL_Destruct( IDirectFBGL *thiz ) +{ + IDirectFBGL_data *data = (IDirectFBGL_data*) thiz->priv; + + dfb_mesa_destroy_context( &data->context, &data->framebuffer ); + + data->surface->Release( data->surface ); + + DIRECT_DEALLOCATE_INTERFACE( thiz ); +} + +static DFBResult +IDirectFBGL_AddRef( IDirectFBGL *thiz ) +{ + DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); + + data->ref++; + + return DFB_OK; +} + +static DFBResult +IDirectFBGL_Release( IDirectFBGL *thiz ) +{ + DIRECT_INTERFACE_GET_DATA( IDirectFBGL ) + + if (--data->ref == 0) { + IDirectFBGL_Destruct( thiz ); + } + + return DFB_OK; +} + +static DFBResult +IDirectFBGL_Lock( IDirectFBGL *thiz ) +{ + IDirectFBSurface *surface; + int width = 0; + int height = 0; + DFBResult err; + + DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); + + if (data->locked) + return DFB_LOCKED; + + surface = data->surface; + surface->GetSize( surface, &width, &height ); + + err = surface->Lock( surface, DSLF_READ | DSLF_WRITE, + (void**) &data->video.start, &data->video.pitch ); + if (err != DFB_OK) { + D_ERROR( "DirectFBGL/Mesa: couldn't lock surface.\n" ); + return err; + } + data->video.end = data->video.start + (height-1) * data->video.pitch; + + if (data->width != width || data->height != height) { + data->width = width; + data->height = height; + _mesa_ResizeBuffersMESA(); + } + + data->locked = true; + + return DFB_OK; +} + +static DFBResult +IDirectFBGL_Unlock( IDirectFBGL *thiz ) +{ + DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); + + if (!data->locked) + return DFB_OK; + + data->surface->Unlock( data->surface ); + data->video.start = NULL; + data->video.end = NULL; + + data->locked = false; + + return DFB_OK; +} + +static DFBResult +IDirectFBGL_GetAttributes( IDirectFBGL *thiz, + DFBGLAttributes *attributes ) +{ + GLvisual *visual; + + DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); + + if (!attributes) + return DFB_INVARG; + + visual = &data->visual; + + attributes->buffer_size = visual->rgbBits ? : visual->indexBits; + attributes->depth_size = visual->depthBits; + attributes->stencil_size = visual->stencilBits; + attributes->aux_buffers = visual->numAuxBuffers; + attributes->red_size = visual->redBits; + attributes->green_size = visual->greenBits; + attributes->blue_size = visual->blueBits; + attributes->alpha_size = visual->alphaBits; + attributes->accum_red_size = visual->accumRedBits; + attributes->accum_green_size = visual->accumGreenBits; + attributes->accum_blue_size = visual->accumBlueBits; + attributes->accum_alpha_size = visual->accumAlphaBits; + attributes->double_buffer = (visual->doubleBufferMode != 0); + attributes->stereo = (visual->stereoMode != 0); + + return DFB_OK; +} + + +/* exported symbols */ + +static DFBResult +Probe( void *data ) +{ + return DFB_OK; +} + +static DFBResult +Construct( IDirectFBGL *thiz, + IDirectFBSurface *surface ) +{ + /* Allocate interface data. */ + DIRECT_ALLOCATE_INTERFACE_DATA( thiz, IDirectFBGL ); + + /* Initialize interface data. */ + data->ref = 1; + data->surface = surface; + + surface->AddRef( surface ); + surface->GetPixelFormat( surface, &data->format ); + surface->GetSize( surface, &data->width, &data->height ); + + /* Configure visual. */ + if (!dfb_mesa_setup_visual( &data->visual, data->format )) { + D_ERROR( "DirectFBGL/Mesa: failed to initialize visual.\n" ); + surface->Release( surface ); + return DFB_UNSUPPORTED; + } + + /* Create context. */ + if (!dfb_mesa_create_context( &data->context, &data->framebuffer, + &data->visual, data->format, (void*) data )) { + D_ERROR( "DirectFBGL/Mesa: failed to create context.\n" ); + surface->Release( surface ); + return DFB_UNSUPPORTED; + } + + /* Assign interface pointers. */ + thiz->AddRef = IDirectFBGL_AddRef; + thiz->Release = IDirectFBGL_Release; + thiz->Lock = IDirectFBGL_Lock; + thiz->Unlock = IDirectFBGL_Unlock; + thiz->GetAttributes = IDirectFBGL_GetAttributes; + + return DFB_OK; +} + + +/* internal functions */ + +static const GLubyte* +get_string( GLcontext *ctx, GLenum pname ) +{ + switch (pname) { + case GL_VENDOR: + return "Claudio Ciccani"; + case GL_VERSION: + return "1.0"; + default: + return NULL; + } +} + +static void +update_state( GLcontext *ctx, GLuint new_state ) +{ + _swrast_InvalidateState( ctx, new_state ); + _swsetup_InvalidateState( ctx, new_state ); + _ac_InvalidateState( ctx, new_state ); + _tnl_InvalidateState( ctx, new_state ); +} + +static void +get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) +{ + GLcontext *ctx = _mesa_get_current_context(); + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; + + *width = (GLuint) data->width; + *height = (GLuint) data->height; +} + +static void +set_viewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h ) +{ + _mesa_ResizeBuffersMESA(); +} + +/* required but not used */ +static void +set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit ) +{ + return; +} + + +/* RGB332 */ +#define NAME(PREFIX) PREFIX##_RGB332 +#define SPAN_VARS \ + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLubyte *P = data->video.end - (Y) * data->video.pitch + (X) +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ + *P = ( (((R) & 0xe0)) | (((G) & 0xe0) >> 3) | ((B) >> 6) ) +#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ + *P = ( (((R) & 0xe0)) | (((G) & 0xe0) >> 3) | ((B) >> 6) ) +#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ + R = ((*P & 0xe0) ); \ + G = ((*P & 0x1c) << 3); \ + B = ((*P & 0x03) << 6); \ + A = CHAN_MAX + +#include "swrast/s_spantemp.h" + +/* ARGB1555 */ +#define NAME(PREFIX) PREFIX##_ARGB1555 +#define SPAN_VARS \ + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2) +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ + *P = ( (((R) & 0xf8) << 7) | (((G) & 0xf8) << 2) | ((B) >> 3) ) +#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ + *P = ( (((A) & 0x80) << 8) | (((R) & 0xf8) << 7) | (((G) & 0xf8) << 2) | ((B) >> 3) ) +#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ + R = ((*P & 0x7c00) >> 7); \ + G = ((*P & 0x03e0) >> 2); \ + B = ((*P & 0x001f) << 3); \ + A = ((*P & 0x8000) ? 0xff : 0) + +#include "swrast/s_spantemp.h" + +/* RGB16 */ +#define NAME(PREFIX) PREFIX##_RGB16 +#define SPAN_VARS \ + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2) +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ + *P = ( (((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | ((B) >> 3) ) +#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ + *P = ( (((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | ((B) >> 3) ) +#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ + R = ((*P & 0xf800) >> 8); \ + G = ((*P & 0x07e0) >> 3); \ + B = ((*P & 0x001f) << 3); \ + A = CHAN_MAX + +#include "swrast/s_spantemp.h" + +/* RGB24 */ +#define NAME(PREFIX) PREFIX##_RGB24 +#define SPAN_VARS \ + IDirectFBGL_data *data = ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLubyte *P = data->video.end - (Y) * data->video.pitch + (X) * 3 +#define INC_PIXEL_PTR(P) P += 3 +#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ + P[0] = B; P[1] = G; P[2] = R +#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ + P[0] = B; P[1] = G; P[2] = R +#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ + R = P[2]; G = P[1]; B = P[0]; A = CHAN_MAX + +#include "swrast/s_spantemp.h" + +/* RGB32 */ +#define NAME(PREFIX) PREFIX##_RGB32 +#define SPAN_VARS \ + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4) +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ + *P = ( ((R) << 16) | ((G) << 8) | (B) ) +#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ + *P = ( ((R) << 16) | ((G) << 8) | (B) ) +#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ + R = ((*P & 0x00ff0000) >> 16); \ + G = ((*P & 0x0000ff00) >> 8); \ + B = ((*P & 0x000000ff) ); \ + A = CHAN_MAX + +#include "swrast/s_spantemp.h" + +/* ARGB */ +#define NAME(PREFIX) PREFIX##_ARGB +#define SPAN_VARS \ + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4) +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ + *P = ( 0xff000000 | ((R) << 16) | ((G) << 8) | (B) ) +#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ + *P = ( ((A) << 24) | ((R) << 16) | ((G) << 8) | (B) ) +#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ + R = ((*P & 0x00ff0000) >> 16); \ + G = ((*P & 0x0000ff00) >> 8); \ + B = ((*P & 0x000000ff) ); \ + A = ((*P & 0xff000000) >> 24) + +#include "swrast/s_spantemp.h" + +/* AiRGB */ +#define NAME(PREFIX) PREFIX##_AiRGB +#define SPAN_VARS \ + IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; +#define INIT_PIXEL_PTR(P, X, Y) \ + GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4) +#define INC_PIXEL_PTR(P) P += 1 +#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ + *P = ( ((R) << 16) | ((G) << 8) | (B) ) +#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ + *P = ( ((0xff - (A)) << 24) | ((R) << 16) | ((G) << 8) | (B) ) +#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ + R = ((*P & 0x00ff0000) >> 16); \ + G = ((*P & 0x0000ff00) >> 8); \ + B = ((*P & 0x000000ff) ); \ + A = (0xff - ((*P & 0xff000000) >> 24)) + +#include "swrast/s_spantemp.h" + + +static bool +dfb_mesa_setup_visual( GLvisual *visual, + DFBSurfacePixelFormat format ) +{ + GLboolean rgbFlag = GL_TRUE; + GLboolean dbFlag = GL_FALSE; + GLboolean stereoFlag = GL_FALSE; + GLint redBits = 0; + GLint blueBits = 0; + GLint greenBits = 0; + GLint alphaBits = 0; + GLint indexBits = 0; + GLint depthBits = 0; + GLint stencilBits = 0; + GLint accumRedBits = 0; + GLint accumGreenBits = 0; + GLint accumBlueBits = 0; + GLint accumAlphaBits = 0; + GLint numSamples = 0; + + /* FIXME: LUT8 support. */ + switch (format) { + case DSPF_RGB332: + redBits = 3; + greenBits = 3; + blueBits = 2; + break; + case DSPF_ARGB1555: + redBits = 5; + greenBits = 5; + blueBits = 5; + alphaBits = 1; + break; + case DSPF_RGB16: + redBits = 5; + greenBits = 6; + blueBits = 5; + break; + case DSPF_ARGB: + case DSPF_AiRGB: + alphaBits = 8; + case DSPF_RGB24: + case DSPF_RGB32: + redBits = 8; + greenBits = 8; + blueBits = 8; + break; + default: + D_WARN( "unsupported pixelformat" ); + return false; + } + + if (rgbFlag) { + accumRedBits = redBits; + accumGreenBits = greenBits; + accumBlueBits = blueBits; + accumAlphaBits = alphaBits; + depthBits = redBits + greenBits + blueBits; + stencilBits = alphaBits; + } else + depthBits = 8; + + return _mesa_initialize_visual( visual, + rgbFlag, dbFlag, stereoFlag, + redBits, greenBits, blueBits, alphaBits, + indexBits, depthBits, stencilBits, + accumRedBits, accumGreenBits, + accumBlueBits, accumAlphaBits, + numSamples ); +} + +static bool +dfb_mesa_create_context( GLcontext *context, + GLframebuffer *framebuffer, + GLvisual *visual, + DFBSurfacePixelFormat format, + void *data ) +{ + struct dd_function_table functions; + struct swrast_device_driver *swdd; + + _mesa_initialize_framebuffer( framebuffer, visual, + visual->haveDepthBuffer, + visual->haveStencilBuffer, + visual->haveAccumBuffer, + visual->accumAlphaBits > 0 ); + + _mesa_init_driver_functions( &functions ); + functions.GetString = get_string; + functions.UpdateState = update_state; + functions.GetBufferSize = get_buffer_size; + functions.Viewport = set_viewport; + + if (!_mesa_initialize_context( context, visual, NULL, + &functions, data )) { + D_DEBUG( "DirectFBGL/Mesa: _mesa_initialize_context() failed.\n" ); + _mesa_free_framebuffer_data( framebuffer ); + return false; + } + + _swrast_CreateContext( context ); + _ac_CreateContext( context ); + _tnl_CreateContext( context ); + _swsetup_CreateContext( context ); + _swsetup_Wakeup( context ); + + swdd = _swrast_GetDeviceDriverReference( context ); + swdd->SetBuffer = set_buffer; + switch (format) { + case DSPF_RGB332: + swdd->WriteRGBASpan = write_rgba_span_RGB332; + swdd->WriteRGBSpan = write_rgb_span_RGB332; + swdd->WriteMonoRGBASpan = write_monorgba_span_RGB332; + swdd->WriteRGBAPixels = write_rgba_pixels_RGB332; + swdd->WriteMonoRGBAPixels = write_monorgba_pixels_RGB332; + swdd->ReadRGBASpan = read_rgba_span_RGB332; + swdd->ReadRGBAPixels = read_rgba_pixels_RGB332; + break; + case DSPF_ARGB1555: + swdd->WriteRGBASpan = write_rgba_span_ARGB1555; + swdd->WriteRGBSpan = write_rgb_span_ARGB1555; + swdd->WriteMonoRGBASpan = write_monorgba_span_ARGB1555; + swdd->WriteRGBAPixels = write_rgba_pixels_ARGB1555; + swdd->WriteMonoRGBAPixels = write_monorgba_pixels_ARGB1555; + swdd->ReadRGBASpan = read_rgba_span_ARGB1555; + swdd->ReadRGBAPixels = read_rgba_pixels_ARGB1555; + break; + case DSPF_RGB16: + swdd->WriteRGBASpan = write_rgba_span_RGB16; + swdd->WriteRGBSpan = write_rgb_span_RGB16; + swdd->WriteMonoRGBASpan = write_monorgba_span_RGB16; + swdd->WriteRGBAPixels = write_rgba_pixels_RGB16; + swdd->WriteMonoRGBAPixels = write_monorgba_pixels_RGB16; + swdd->ReadRGBASpan = read_rgba_span_RGB16; + swdd->ReadRGBAPixels = read_rgba_pixels_RGB16; + break; + case DSPF_RGB24: + swdd->WriteRGBASpan = write_rgba_span_RGB24; + swdd->WriteRGBSpan = write_rgb_span_RGB24; + swdd->WriteMonoRGBASpan = write_monorgba_span_RGB24; + swdd->WriteRGBAPixels = write_rgba_pixels_RGB24; + swdd->WriteMonoRGBAPixels = write_monorgba_pixels_RGB24; + swdd->ReadRGBASpan = read_rgba_span_RGB24; + swdd->ReadRGBAPixels = read_rgba_pixels_RGB24; + break; + case DSPF_RGB32: + swdd->WriteRGBASpan = write_rgba_span_RGB32; + swdd->WriteRGBSpan = write_rgb_span_RGB32; + swdd->WriteMonoRGBASpan = write_monorgba_span_RGB32; + swdd->WriteRGBAPixels = write_rgba_pixels_RGB32; + swdd->WriteMonoRGBAPixels = write_monorgba_pixels_RGB32; + swdd->ReadRGBASpan = read_rgba_span_RGB32; + swdd->ReadRGBAPixels = read_rgba_pixels_RGB32; + break; + case DSPF_ARGB: + swdd->WriteRGBASpan = write_rgba_span_ARGB; + swdd->WriteRGBSpan = write_rgb_span_ARGB; + swdd->WriteMonoRGBASpan = write_monorgba_span_ARGB; + swdd->WriteRGBAPixels = write_rgba_pixels_ARGB; + swdd->WriteMonoRGBAPixels = write_monorgba_pixels_ARGB; + swdd->ReadRGBASpan = read_rgba_span_ARGB; + swdd->ReadRGBAPixels = read_rgba_pixels_ARGB; + break; + case DSPF_AiRGB: + swdd->WriteRGBASpan = write_rgba_span_AiRGB; + swdd->WriteRGBSpan = write_rgb_span_AiRGB; + swdd->WriteMonoRGBASpan = write_monorgba_span_AiRGB; + swdd->WriteRGBAPixels = write_rgba_pixels_AiRGB; + swdd->WriteMonoRGBAPixels = write_monorgba_pixels_AiRGB; + swdd->ReadRGBASpan = read_rgba_span_AiRGB; + swdd->ReadRGBAPixels = read_rgba_pixels_AiRGB; + break; + default: + D_BUG( "unexpected pixelformat" ); + return false; + } + + TNL_CONTEXT( context )->Driver.RunPipeline = _tnl_run_pipeline; + + _mesa_enable_sw_extensions( context ); + + _mesa_make_current( context, framebuffer ); + + return true; +} + +static void +dfb_mesa_destroy_context( GLcontext *context, + GLframebuffer *framebuffer ) +{ + _mesa_make_current( NULL, NULL ); + _mesa_free_framebuffer_data( framebuffer ); + _mesa_notifyDestroy( context ); + _mesa_free_context_data( context ); +} + -- cgit v1.2.3 From 85edffd5fff0328f96c73615d6bf98c4516b4ee4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 4 Jan 2005 14:48:14 +0000 Subject: added GLX_NV_float_buffer --- include/GL/glx.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index ca4e9ed4f68..bfaac778076 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.2 + * Version: 6.3 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -495,6 +495,17 @@ extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attr #endif /* GLX_ARB_render_texture */ +/* + * Remove this when glxext.h is updated. + */ +#ifndef GLX_NV_float_buffer +#define GLX_NV_float_buffer 1 + +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 + +#endif /* GLX_NV_float_buffer */ + + #ifdef __cplusplus } -- cgit v1.2.3 From d7b837ad4aa5306bd318fafa32f40599622f2c2a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 12 Jan 2005 04:06:55 +0000 Subject: temporary prototypes for OpenGL 2.0 --- include/GL/gl.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 1d35af82a16..eacd9b2da86 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2250,6 +2250,16 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen **/ +/* + * XXX temporary - remove when glext.h is updated + */ +#ifndef GL_VERSION_2_0 +GLAPI void GLAPIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum); +GLAPI void GLAPIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint); +GLAPI void GLAPIENTRY glStencilMaskSeparate (GLenum, GLuint); +#endif + + /********************************************************************** * Begin system-specific stuff */ -- cgit v1.2.3 From 5255044c00b45defc487d20943dee37742f13fdf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 16 Jan 2005 19:40:15 +0000 Subject: added a few OpenGL 2.0 tokens (temporary) --- include/GL/gl.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index eacd9b2da86..cefee9e8843 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2254,6 +2254,14 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen * XXX temporary - remove when glext.h is updated */ #ifndef GL_VERSION_2_0 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 + GLAPI void GLAPIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum); GLAPI void GLAPIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint); GLAPI void GLAPIENTRY glStencilMaskSeparate (GLenum, GLuint); -- cgit v1.2.3 From 14dee36fa78dc309919dd81ae37d0e8d13773104 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 20 Jan 2005 15:07:42 +0000 Subject: glext.h version 26 --- include/GL/gl.h | 17 --- include/GL/gl_mangle.h | 97 ++++++++++++- include/GL/glext.h | 367 ++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 459 insertions(+), 22 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index cefee9e8843..5d7bf485293 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2250,23 +2250,6 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen **/ -/* - * XXX temporary - remove when glext.h is updated - */ -#ifndef GL_VERSION_2_0 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 - -GLAPI void GLAPIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum); -GLAPI void GLAPIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint); -GLAPI void GLAPIENTRY glStencilMaskSeparate (GLenum, GLuint); -#endif - /********************************************************************** * Begin system-specific stuff diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 8d3306b9fb1..a58a00f632b 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -50,6 +50,7 @@ #define glArrayObjectATI MANGLE(ArrayObjectATI) #define glAsyncMarkerSGIX MANGLE(AsyncMarkerSGIX) #define glAttachObjectARB MANGLE(AttachObjectARB) +#define glAttachShader MANGLE(AttachShader) #define glBeginFragmentShaderATI MANGLE(BeginFragmentShaderATI) #define glBegin MANGLE(Begin) #define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV) @@ -57,6 +58,7 @@ #define glBeginQuery MANGLE(BeginQuery) #define glBeginVertexShaderEXT MANGLE(BeginVertexShaderEXT) #define glBindAttribLocationARB MANGLE(BindAttribLocationARB) +#define glBindAttribLocation MANGLE(BindAttribLocation) #define glBindBufferARB MANGLE(BindBufferARB) #define glBindBuffer MANGLE(BindBuffer) #define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI) @@ -89,6 +91,7 @@ #define glBlendEquation MANGLE(BlendEquation) #define glBlendEquationSeparateATI MANGLE(BlendEquationSeparateATI) #define glBlendEquationSeparateEXT MANGLE(BlendEquationSeparateEXT) +#define glBlendEquationSeparate MANGLE(BlendEquationSeparate) #define glBlendFunc MANGLE(BlendFunc) #define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT) #define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR) @@ -99,6 +102,7 @@ #define glBufferSubData MANGLE(BufferSubData) #define glCallList MANGLE(CallList) #define glCallLists MANGLE(CallLists) +#define glClampColorARB MANGLE(ClampColorARB) #define glClearAccum MANGLE(ClearAccum) #define glClearColor MANGLE(ClearColor) #define glClearDepth MANGLE(ClearDepth) @@ -179,6 +183,7 @@ #define glCombinerParameterivNV MANGLE(CombinerParameterivNV) #define glCombinerStageParameterfvNV MANGLE(CombinerStageParameterfvNV) #define glCompileShaderARB MANGLE(CompileShaderARB) +#define glCompileShader MANGLE(CompileShader) #define glCompressedTexImage1DARB MANGLE(CompressedTexImage1DARB) #define glCompressedTexImage1D MANGLE(CompressedTexImage1D) #define glCompressedTexImage2DARB MANGLE(CompressedTexImage2DARB) @@ -222,7 +227,9 @@ #define glCopyTexSubImage2D MANGLE(CopyTexSubImage2D) #define glCopyTexSubImage3DEXT MANGLE(CopyTexSubImage3DEXT) #define glCopyTexSubImage3D MANGLE(CopyTexSubImage3D) +#define glCreateProgram MANGLE(CreateProgram) #define glCreateProgramObjectARB MANGLE(CreateProgramObjectARB) +#define glCreateShader MANGLE(CreateShader) #define glCreateShaderObjectARB MANGLE(CreateShaderObjectARB) #define glCullFace MANGLE(CullFace) #define glCullParameterdvEXT MANGLE(CullParameterdvEXT) @@ -240,10 +247,12 @@ #define glDeleteLists MANGLE(DeleteLists) #define glDeleteObjectARB MANGLE(DeleteObjectARB) #define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV) +#define glDeleteProgram MANGLE(DeleteProgram) #define glDeleteProgramsARB MANGLE(DeleteProgramsARB) #define glDeleteProgramsNV MANGLE(DeleteProgramsNV) #define glDeleteQueriesARB MANGLE(DeleteQueriesARB) #define glDeleteQueries MANGLE(DeleteQueries) +#define glDeleteShader MANGLE(DeleteShader) #define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT) #define glDeleteTextures MANGLE(DeleteTextures) #define glDeleteVertexArraysAPPLE MANGLE(DeleteVertexArraysAPPLE) @@ -253,16 +262,20 @@ #define glDepthMask MANGLE(DepthMask) #define glDepthRange MANGLE(DepthRange) #define glDetachObjectARB MANGLE(DetachObjectARB) +#define glDetachShader MANGLE(DetachShader) #define glDetailTexFuncSGIS MANGLE(DetailTexFuncSGIS) #define glDisableClientState MANGLE(DisableClientState) #define glDisable MANGLE(Disable) #define glDisableTraceMESA MANGLE(DisableTraceMESA) #define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT) #define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB) +#define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray) #define glDrawArraysEXT MANGLE(DrawArraysEXT) #define glDrawArrays MANGLE(DrawArrays) #define glDrawBuffer MANGLE(DrawBuffer) +#define glDrawBuffersARB MANGLE(DrawBuffersARB) #define glDrawBuffersATI MANGLE(DrawBuffersATI) +#define glDrawBuffers MANGLE(DrawBuffers) #define glDrawElementArrayAPPLE MANGLE(DrawElementArrayAPPLE) #define glDrawElementArrayATI MANGLE(DrawElementArrayATI) #define glDrawElements MANGLE(DrawElements) @@ -284,6 +297,7 @@ #define glEnableTraceMESA MANGLE(EnableTraceMESA) #define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT) #define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB) +#define glEnableVertexAttribArray MANGLE(EnableVertexAttribArray) #define glEndFragmentShaderATI MANGLE(EndFragmentShaderATI) #define glEndList MANGLE(EndList) #define glEnd MANGLE(End) @@ -373,11 +387,15 @@ #define glGenVertexArraysAPPLE MANGLE(GenVertexArraysAPPLE) #define glGenVertexShadersEXT MANGLE(GenVertexShadersEXT) #define glGetActiveAttribARB MANGLE(GetActiveAttribARB) +#define glGetActiveAttrib MANGLE(GetActiveAttrib) #define glGetActiveUniformARB MANGLE(GetActiveUniformARB) +#define glGetActiveUniform MANGLE(GetActiveUniform) #define glGetArrayObjectfvATI MANGLE(GetArrayObjectfvATI) #define glGetArrayObjectivATI MANGLE(GetArrayObjectivATI) #define glGetAttachedObjectsARB MANGLE(GetAttachedObjectsARB) +#define glGetAttachedShaders MANGLE(GetAttachedShaders) #define glGetAttribLocationARB MANGLE(GetAttribLocationARB) +#define glGetAttribLocation MANGLE(GetAttribLocation) #define glGetBooleanv MANGLE(GetBooleanv) #define glGetBufferParameterivARB MANGLE(GetBufferParameterivARB) #define glGetBufferParameteriv MANGLE(GetBufferParameteriv) @@ -474,7 +492,9 @@ #define glGetPolygonStipple MANGLE(GetPolygonStipple) #define glGetProgramEnvParameterdvARB MANGLE(GetProgramEnvParameterdvARB) #define glGetProgramEnvParameterfvARB MANGLE(GetProgramEnvParameterfvARB) +#define glGetProgramInfoLog MANGLE(GetProgramInfoLog) #define glGetProgramivARB MANGLE(GetProgramivARB) +#define glGetProgramiv MANGLE(GetProgramiv) #define glGetProgramivNV MANGLE(GetProgramivNV) #define glGetProgramLocalParameterdvARB MANGLE(GetProgramLocalParameterdvARB) #define glGetProgramLocalParameterfvARB MANGLE(GetProgramLocalParameterfvARB) @@ -492,9 +512,11 @@ #define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv) #define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT) #define glGetSeparableFilter MANGLE(GetSeparableFilter) +#define glGetShaderInfoLog MANGLE(GetShaderInfoLog) +#define glGetShaderiv MANGLE(GetShaderiv) #define glGetShaderSourceARB MANGLE(GetShaderSourceARB) +#define glGetShaderSource MANGLE(GetShaderSource) #define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS) -#define glGetString MANGLE(GetString) #define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI) #define glGetTexBumpParameterivATI MANGLE(GetTexBumpParameterivATI) #define glGetTexEnvfv MANGLE(GetTexEnvfv) @@ -510,8 +532,11 @@ #define glGetTexParameteriv MANGLE(GetTexParameteriv) #define glGetTrackMatrixivNV MANGLE(GetTrackMatrixivNV) #define glGetUniformfvARB MANGLE(GetUniformfvARB) +#define glGetUniformfv MANGLE(GetUniformfv) #define glGetUniformivARB MANGLE(GetUniformivARB) +#define glGetUniformiv MANGLE(GetUniformiv) #define glGetUniformLocationARB MANGLE(GetUniformLocationARB) +#define glGetUniformLocation MANGLE(GetUniformLocation) #define glGetVariantArrayObjectfvATI MANGLE(GetVariantArrayObjectfvATI) #define glGetVariantArrayObjectivATI MANGLE(GetVariantArrayObjectivATI) #define glGetVariantBooleanvEXT MANGLE(GetVariantBooleanvEXT) @@ -521,12 +546,16 @@ #define glGetVertexAttribArrayObjectfvATI MANGLE(GetVertexAttribArrayObjectfvATI) #define glGetVertexAttribArrayObjectivATI MANGLE(GetVertexAttribArrayObjectivATI) #define glGetVertexAttribdvARB MANGLE(GetVertexAttribdvARB) +#define glGetVertexAttribdv MANGLE(GetVertexAttribdv) #define glGetVertexAttribdvNV MANGLE(GetVertexAttribdvNV) #define glGetVertexAttribfvARB MANGLE(GetVertexAttribfvARB) +#define glGetVertexAttribfv MANGLE(GetVertexAttribfv) #define glGetVertexAttribfvNV MANGLE(GetVertexAttribfvNV) #define glGetVertexAttribivARB MANGLE(GetVertexAttribivARB) +#define glGetVertexAttribiv MANGLE(GetVertexAttribiv) #define glGetVertexAttribivNV MANGLE(GetVertexAttribivNV) #define glGetVertexAttribPointervARB MANGLE(GetVertexAttribPointervARB) +#define glGetVertexAttribPointerv MANGLE(GetVertexAttribPointerv) #define glGetVertexAttribPointervNV MANGLE(GetVertexAttribPointervNV) #define glGlobalAlphaFactorbSUN MANGLE(GlobalAlphaFactorbSUN) #define glGlobalAlphaFactordSUN MANGLE(GlobalAlphaFactordSUN) @@ -575,9 +604,11 @@ #define glIsObjectBufferATI MANGLE(IsObjectBufferATI) #define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV) #define glIsProgramARB MANGLE(IsProgramARB) +#define glIsProgram MANGLE(IsProgram) #define glIsProgramNV MANGLE(IsProgramNV) #define glIsQueryARB MANGLE(IsQueryARB) #define glIsQuery MANGLE(IsQuery) +#define glIsShader MANGLE(IsShader) #define glIsTextureEXT MANGLE(IsTextureEXT) #define glIsTexture MANGLE(IsTexture) #define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT) @@ -594,6 +625,7 @@ #define glLineStipple MANGLE(LineStipple) #define glLineWidth MANGLE(LineWidth) #define glLinkProgramARB MANGLE(LinkProgramARB) +#define glLinkProgram MANGLE(LinkProgram) #define glListBase MANGLE(ListBase) #define glListParameterfSGIX MANGLE(ListParameterfSGIX) #define glListParameterfvSGIX MANGLE(ListParameterfvSGIX) @@ -954,6 +986,7 @@ #define glShaderOp2EXT MANGLE(ShaderOp2EXT) #define glShaderOp3EXT MANGLE(ShaderOp3EXT) #define glShaderSourceARB MANGLE(ShaderSourceARB) +#define glShaderSource MANGLE(ShaderSource) #define glSharpenTexFuncSGIS MANGLE(SharpenTexFuncSGIS) #define glSpriteParameterfSGIX MANGLE(SpriteParameterfSGIX) #define glSpriteParameterfvSGIX MANGLE(SpriteParameterfvSGIX) @@ -962,9 +995,12 @@ #define glStartInstrumentsSGIX MANGLE(StartInstrumentsSGIX) #define glStencilFunc MANGLE(StencilFunc) #define glStencilFuncSeparateATI MANGLE(StencilFuncSeparateATI) +#define glStencilFuncSeparate MANGLE(StencilFuncSeparate) #define glStencilMask MANGLE(StencilMask) +#define glStencilMaskSeparate MANGLE(StencilMaskSeparate) #define glStencilOp MANGLE(StencilOp) #define glStencilOpSeparateATI MANGLE(StencilOpSeparateATI) +#define glStencilOpSeparate MANGLE(StencilOpSeparate) #define glStopInstrumentsSGIX MANGLE(StopInstrumentsSGIX) #define glSwizzleEXT MANGLE(SwizzleEXT) #define glTagSampleBufferSGIX MANGLE(TagSampleBufferSGIX) @@ -1084,31 +1120,52 @@ #define glTranslated MANGLE(Translated) #define glTranslatef MANGLE(Translatef) #define glUniform1fARB MANGLE(Uniform1fARB) +#define glUniform1f MANGLE(Uniform1f) #define glUniform1fvARB MANGLE(Uniform1fvARB) +#define glUniform1fv MANGLE(Uniform1fv) #define glUniform1iARB MANGLE(Uniform1iARB) +#define glUniform1i MANGLE(Uniform1i) #define glUniform1ivARB MANGLE(Uniform1ivARB) +#define glUniform1iv MANGLE(Uniform1iv) #define glUniform2fARB MANGLE(Uniform2fARB) +#define glUniform2f MANGLE(Uniform2f) #define glUniform2fvARB MANGLE(Uniform2fvARB) +#define glUniform2fv MANGLE(Uniform2fv) #define glUniform2iARB MANGLE(Uniform2iARB) +#define glUniform2i MANGLE(Uniform2i) #define glUniform2ivARB MANGLE(Uniform2ivARB) +#define glUniform2iv MANGLE(Uniform2iv) #define glUniform3fARB MANGLE(Uniform3fARB) +#define glUniform3f MANGLE(Uniform3f) #define glUniform3fvARB MANGLE(Uniform3fvARB) +#define glUniform3fv MANGLE(Uniform3fv) #define glUniform3iARB MANGLE(Uniform3iARB) +#define glUniform3i MANGLE(Uniform3i) #define glUniform3ivARB MANGLE(Uniform3ivARB) +#define glUniform3iv MANGLE(Uniform3iv) #define glUniform4fARB MANGLE(Uniform4fARB) +#define glUniform4f MANGLE(Uniform4f) #define glUniform4fvARB MANGLE(Uniform4fvARB) +#define glUniform4fv MANGLE(Uniform4fv) #define glUniform4iARB MANGLE(Uniform4iARB) +#define glUniform4i MANGLE(Uniform4i) #define glUniform4ivARB MANGLE(Uniform4ivARB) +#define glUniform4iv MANGLE(Uniform4iv) #define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB) +#define glUniformMatrix2fv MANGLE(UniformMatrix2fv) #define glUniformMatrix3fvARB MANGLE(UniformMatrix3fvARB) +#define glUniformMatrix3fv MANGLE(UniformMatrix3fv) #define glUniformMatrix4fvARB MANGLE(UniformMatrix4fvARB) +#define glUniformMatrix4fv MANGLE(UniformMatrix4fv) #define glUnlockArraysEXT MANGLE(UnlockArraysEXT) #define glUnmapBufferARB MANGLE(UnmapBufferARB) #define glUnmapBuffer MANGLE(UnmapBuffer) #define glUnmapObjectBufferATI MANGLE(UnmapObjectBufferATI) #define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI) +#define glUseProgram MANGLE(UseProgram) #define glUseProgramObjectARB MANGLE(UseProgramObjectARB) #define glValidateProgramARB MANGLE(ValidateProgramARB) +#define glValidateProgram MANGLE(ValidateProgram) #define glVariantArrayObjectATI MANGLE(VariantArrayObjectATI) #define glVariantbvEXT MANGLE(VariantbvEXT) #define glVariantdvEXT MANGLE(VariantdvEXT) @@ -1153,77 +1210,114 @@ #define glVertexArrayRangeAPPLE MANGLE(VertexArrayRangeAPPLE) #define glVertexArrayRangeNV MANGLE(VertexArrayRangeNV) #define glVertexAttrib1dARB MANGLE(VertexAttrib1dARB) +#define glVertexAttrib1d MANGLE(VertexAttrib1d) #define glVertexAttrib1dNV MANGLE(VertexAttrib1dNV) #define glVertexAttrib1dvARB MANGLE(VertexAttrib1dvARB) +#define glVertexAttrib1dv MANGLE(VertexAttrib1dv) #define glVertexAttrib1dvNV MANGLE(VertexAttrib1dvNV) #define glVertexAttrib1fARB MANGLE(VertexAttrib1fARB) +#define glVertexAttrib1f MANGLE(VertexAttrib1f) #define glVertexAttrib1fNV MANGLE(VertexAttrib1fNV) #define glVertexAttrib1fvARB MANGLE(VertexAttrib1fvARB) +#define glVertexAttrib1fv MANGLE(VertexAttrib1fv) #define glVertexAttrib1fvNV MANGLE(VertexAttrib1fvNV) #define glVertexAttrib1hNV MANGLE(VertexAttrib1hNV) #define glVertexAttrib1hvNV MANGLE(VertexAttrib1hvNV) #define glVertexAttrib1sARB MANGLE(VertexAttrib1sARB) +#define glVertexAttrib1s MANGLE(VertexAttrib1s) #define glVertexAttrib1sNV MANGLE(VertexAttrib1sNV) #define glVertexAttrib1svARB MANGLE(VertexAttrib1svARB) +#define glVertexAttrib1sv MANGLE(VertexAttrib1sv) #define glVertexAttrib1svNV MANGLE(VertexAttrib1svNV) #define glVertexAttrib2dARB MANGLE(VertexAttrib2dARB) +#define glVertexAttrib2d MANGLE(VertexAttrib2d) #define glVertexAttrib2dNV MANGLE(VertexAttrib2dNV) #define glVertexAttrib2dvARB MANGLE(VertexAttrib2dvARB) +#define glVertexAttrib2dv MANGLE(VertexAttrib2dv) #define glVertexAttrib2dvNV MANGLE(VertexAttrib2dvNV) #define glVertexAttrib2fARB MANGLE(VertexAttrib2fARB) +#define glVertexAttrib2f MANGLE(VertexAttrib2f) #define glVertexAttrib2fNV MANGLE(VertexAttrib2fNV) #define glVertexAttrib2fvARB MANGLE(VertexAttrib2fvARB) +#define glVertexAttrib2fv MANGLE(VertexAttrib2fv) #define glVertexAttrib2fvNV MANGLE(VertexAttrib2fvNV) #define glVertexAttrib2hNV MANGLE(VertexAttrib2hNV) #define glVertexAttrib2hvNV MANGLE(VertexAttrib2hvNV) #define glVertexAttrib2sARB MANGLE(VertexAttrib2sARB) +#define glVertexAttrib2s MANGLE(VertexAttrib2s) #define glVertexAttrib2sNV MANGLE(VertexAttrib2sNV) #define glVertexAttrib2svARB MANGLE(VertexAttrib2svARB) +#define glVertexAttrib2sv MANGLE(VertexAttrib2sv) #define glVertexAttrib2svNV MANGLE(VertexAttrib2svNV) #define glVertexAttrib3dARB MANGLE(VertexAttrib3dARB) +#define glVertexAttrib3d MANGLE(VertexAttrib3d) #define glVertexAttrib3dNV MANGLE(VertexAttrib3dNV) #define glVertexAttrib3dvARB MANGLE(VertexAttrib3dvARB) +#define glVertexAttrib3dv MANGLE(VertexAttrib3dv) #define glVertexAttrib3dvNV MANGLE(VertexAttrib3dvNV) #define glVertexAttrib3fARB MANGLE(VertexAttrib3fARB) +#define glVertexAttrib3f MANGLE(VertexAttrib3f) #define glVertexAttrib3fNV MANGLE(VertexAttrib3fNV) #define glVertexAttrib3fvARB MANGLE(VertexAttrib3fvARB) +#define glVertexAttrib3fv MANGLE(VertexAttrib3fv) #define glVertexAttrib3fvNV MANGLE(VertexAttrib3fvNV) #define glVertexAttrib3hNV MANGLE(VertexAttrib3hNV) #define glVertexAttrib3hvNV MANGLE(VertexAttrib3hvNV) #define glVertexAttrib3sARB MANGLE(VertexAttrib3sARB) +#define glVertexAttrib3s MANGLE(VertexAttrib3s) #define glVertexAttrib3sNV MANGLE(VertexAttrib3sNV) #define glVertexAttrib3svARB MANGLE(VertexAttrib3svARB) +#define glVertexAttrib3sv MANGLE(VertexAttrib3sv) #define glVertexAttrib3svNV MANGLE(VertexAttrib3svNV) #define glVertexAttrib4bvARB MANGLE(VertexAttrib4bvARB) +#define glVertexAttrib4bv MANGLE(VertexAttrib4bv) #define glVertexAttrib4dARB MANGLE(VertexAttrib4dARB) +#define glVertexAttrib4d MANGLE(VertexAttrib4d) #define glVertexAttrib4dNV MANGLE(VertexAttrib4dNV) #define glVertexAttrib4dvARB MANGLE(VertexAttrib4dvARB) +#define glVertexAttrib4dv MANGLE(VertexAttrib4dv) #define glVertexAttrib4dvNV MANGLE(VertexAttrib4dvNV) #define glVertexAttrib4fARB MANGLE(VertexAttrib4fARB) +#define glVertexAttrib4f MANGLE(VertexAttrib4f) #define glVertexAttrib4fNV MANGLE(VertexAttrib4fNV) #define glVertexAttrib4fvARB MANGLE(VertexAttrib4fvARB) +#define glVertexAttrib4fv MANGLE(VertexAttrib4fv) #define glVertexAttrib4fvNV MANGLE(VertexAttrib4fvNV) #define glVertexAttrib4hNV MANGLE(VertexAttrib4hNV) #define glVertexAttrib4hvNV MANGLE(VertexAttrib4hvNV) #define glVertexAttrib4ivARB MANGLE(VertexAttrib4ivARB) +#define glVertexAttrib4iv MANGLE(VertexAttrib4iv) #define glVertexAttrib4NbvARB MANGLE(VertexAttrib4NbvARB) +#define glVertexAttrib4Nbv MANGLE(VertexAttrib4Nbv) #define glVertexAttrib4NivARB MANGLE(VertexAttrib4NivARB) +#define glVertexAttrib4Niv MANGLE(VertexAttrib4Niv) #define glVertexAttrib4NsvARB MANGLE(VertexAttrib4NsvARB) +#define glVertexAttrib4Nsv MANGLE(VertexAttrib4Nsv) #define glVertexAttrib4NubARB MANGLE(VertexAttrib4NubARB) +#define glVertexAttrib4Nub MANGLE(VertexAttrib4Nub) #define glVertexAttrib4NubvARB MANGLE(VertexAttrib4NubvARB) +#define glVertexAttrib4Nubv MANGLE(VertexAttrib4Nubv) #define glVertexAttrib4NuivARB MANGLE(VertexAttrib4NuivARB) +#define glVertexAttrib4Nuiv MANGLE(VertexAttrib4Nuiv) #define glVertexAttrib4NusvARB MANGLE(VertexAttrib4NusvARB) +#define glVertexAttrib4Nusv MANGLE(VertexAttrib4Nusv) #define glVertexAttrib4sARB MANGLE(VertexAttrib4sARB) +#define glVertexAttrib4s MANGLE(VertexAttrib4s) #define glVertexAttrib4sNV MANGLE(VertexAttrib4sNV) #define glVertexAttrib4svARB MANGLE(VertexAttrib4svARB) +#define glVertexAttrib4sv MANGLE(VertexAttrib4sv) #define glVertexAttrib4svNV MANGLE(VertexAttrib4svNV) #define glVertexAttrib4ubNV MANGLE(VertexAttrib4ubNV) #define glVertexAttrib4ubvARB MANGLE(VertexAttrib4ubvARB) +#define glVertexAttrib4ubv MANGLE(VertexAttrib4ubv) #define glVertexAttrib4ubvNV MANGLE(VertexAttrib4ubvNV) #define glVertexAttrib4uivARB MANGLE(VertexAttrib4uivARB) +#define glVertexAttrib4uiv MANGLE(VertexAttrib4uiv) #define glVertexAttrib4usvARB MANGLE(VertexAttrib4usvARB) +#define glVertexAttrib4usv MANGLE(VertexAttrib4usv) #define glVertexAttribArrayObjectATI MANGLE(VertexAttribArrayObjectATI) #define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB) +#define glVertexAttribPointer MANGLE(VertexAttribPointer) #define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV) #define glVertexAttribs1dvNV MANGLE(VertexAttribs1dvNV) #define glVertexAttribs1fvNV MANGLE(VertexAttribs1fvNV) @@ -1353,5 +1447,6 @@ #define glWindowPos4sMESA MANGLE(WindowPos4sMESA) #define glWindowPos4svMESA MANGLE(WindowPos4svMESA) #define glWriteMaskEXT MANGLE(WriteMaskEXT) +gl.h:GLAPI const GLubyte GLAPIENTRYP glGetString( GLenum name ); #endif /* GL_MANGLE_H */ diff --git a/include/GL/glext.h b/include/GL/glext.h index e11736d6428..b82879f18f7 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -52,9 +52,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2004/7/26 */ +/* glext.h last updated 2005/01/20 */ /* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 24 +#define GL_GLEXT_VERSION 26 #ifndef GL_VERSION_1_2 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 @@ -372,6 +372,93 @@ extern "C" { #define GL_SRC2_ALPHA GL_SOURCE2_ALPHA #endif +#ifndef GL_VERSION_2_0 +#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#endif + #ifndef GL_ARB_multitexture #define GL_TEXTURE0_ARB 0x84C0 #define GL_TEXTURE1_ARB 0x84C1 @@ -825,6 +912,48 @@ extern "C" { #define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 #endif +#ifndef GL_ARB_color_buffer_float +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_HALF_FLOAT_ARB 0x140B +#endif + +#ifndef GL_ARB_texture_float +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF +#endif + #ifndef GL_EXT_abgr #define GL_ABGR_EXT 0x8000 #endif @@ -2793,6 +2922,11 @@ extern "C" { #ifndef GL_ATI_vertex_attrib_array_object #endif +#ifndef GL_OES_read_format +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#endif + #ifndef GL_EXT_depth_bounds_test #define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 #define GL_DEPTH_BOUNDS_EXT 0x8891 @@ -2850,6 +2984,11 @@ extern "C" { /*************************************************************/ #include +#ifndef GL_VERSION_2_0 +/* GL type for program/shader text */ +typedef char GLchar; /* native character */ +#endif + #ifndef GL_VERSION_1_5 /* GL types for handling large vertex buffer objects */ typedef ptrdiff_t GLintptr; @@ -2863,13 +3002,17 @@ typedef ptrdiff_t GLsizeiptrARB; #endif #ifndef GL_ARB_shader_objects -/* GL types for handling shader object handles and characters */ +/* GL types for handling shader object handles and program/shader text */ typedef char GLcharARB; /* native character */ typedef unsigned int GLhandleARB; /* shader object handle */ #endif +/* GL types for "half" precision (s10e5) float data in host memory */ +#ifndef GL_ARB_half_float_pixel +typedef unsigned short GLhalfARB; +#endif + #ifndef GL_NV_half_float -/* GL type for representing NVIDIA "half" floating point type in host memory */ typedef unsigned short GLhalfNV; #endif @@ -3193,6 +3336,198 @@ typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pn typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params); #endif +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum); +GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *); +GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint); +GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint); +GLAPI void APIENTRY glAttachShader (GLuint, GLuint); +GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *); +GLAPI void APIENTRY glCompileShader (GLuint); +GLAPI GLuint APIENTRY glCreateProgram (void); +GLAPI GLuint APIENTRY glCreateShader (GLenum); +GLAPI void APIENTRY glDeleteProgram (GLuint); +GLAPI void APIENTRY glDeleteShader (GLuint); +GLAPI void APIENTRY glDetachShader (GLuint, GLuint); +GLAPI void APIENTRY glDisableVertexAttribArray (GLuint); +GLAPI void APIENTRY glEnableVertexAttribArray (GLuint); +GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *); +GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *); +GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *); +GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *); +GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *); +GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgram (GLuint); +GLAPI GLboolean APIENTRY glIsShader (GLuint); +GLAPI void APIENTRY glLinkProgram (GLuint); +GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *); +GLAPI void APIENTRY glUseProgram (GLuint); +GLAPI void APIENTRY glUniform1f (GLint, GLfloat); +GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform1i (GLint, GLint); +GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint); +GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glValidateProgram (GLuint); +GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); +typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +#endif + #ifndef GL_ARB_multitexture #define GL_ARB_multitexture 1 #ifdef GL_GLEXT_PROTOTYPES @@ -3752,6 +4087,26 @@ typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs) #define GL_ARB_texture_rectangle 1 #endif +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClampColorARB (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 +#endif + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 +#endif + #ifndef GL_EXT_abgr #define GL_EXT_abgr 1 #endif @@ -5974,6 +6329,10 @@ typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); #endif +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 +#endif + #ifndef GL_EXT_depth_bounds_test #define GL_EXT_depth_bounds_test 1 #ifdef GL_GLEXT_PROTOTYPES -- cgit v1.2.3 From 10602119182a55985e9d8183b6cb846755c6f415 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 21 Jan 2005 16:35:56 +0000 Subject: fix glGetString funniness --- include/GL/gl_mangle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index a58a00f632b..c8b0a117489 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -517,6 +517,7 @@ #define glGetShaderSourceARB MANGLE(GetShaderSourceARB) #define glGetShaderSource MANGLE(GetShaderSource) #define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS) +#define glGetString MANGLE(GetString) #define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI) #define glGetTexBumpParameterivATI MANGLE(GetTexBumpParameterivATI) #define glGetTexEnvfv MANGLE(GetTexEnvfv) @@ -1447,6 +1448,5 @@ #define glWindowPos4sMESA MANGLE(WindowPos4sMESA) #define glWindowPos4svMESA MANGLE(WindowPos4svMESA) #define glWriteMaskEXT MANGLE(WriteMaskEXT) -gl.h:GLAPI const GLubyte GLAPIENTRYP glGetString( GLenum name ); #endif /* GL_MANGLE_H */ -- cgit v1.2.3 From 5b0dd893704157cb8f9c42ce4a32a9d3e2a7edef Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 26 Jan 2005 19:19:06 +0000 Subject: remove a bunch of temporary #defines, now that glext.h was updated --- include/GL/gl.h | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 5d7bf485293..8df3a6f92ba 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2232,17 +2232,6 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen #endif /* GL_ATI_blend_equation_separate */ -/* As soon as the official glext.h is updated to include this, it will be - * removed from here. - */ -#ifndef GL_OES_read_format -#define GL_OES_read_format 1 - -#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B - -#endif /* GL_OES_read_format */ - /** ** NOTE!!!!! If you add new functions to this file, or update ** glext.h be sure to regenerate the gl_mangle.h file. See comments -- cgit v1.2.3 From cf69e051ce36d9dc9dac59621aa18805ea58515d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 8 Feb 2005 03:45:08 +0000 Subject: added GL_EXT_framebuffer_object enums/funcs. Remove when glext.h is updated --- include/GL/gl.h | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 119 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 8df3a6f92ba..f910c3221aa 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2210,11 +2210,11 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data); -extern void +GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data); -extern void +GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v); @@ -2232,6 +2232,123 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen #endif /* GL_ATI_blend_equation_separate */ +/* XXX this is temporary here! */ +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object + +GLAPI GLboolean GLAPIENTRY +glIsRenderbufferEXT(GLuint renderbuffer); + +GLAPI void GLAPIENTRY +glBindRenderbufferEXT(GLenum target, GLuint renderbuffer); + +GLAPI void GLAPIENTRY +glDeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers); + +GLAPI void GLAPIENTRY +glGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers); + +GLAPI void GLAPIENTRY +glRenderbufferStorageEXT(GLenum target, GLenum internalformat, + GLsizei width, GLsizei height); + +GLAPI void GLAPIENTRY +glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params); + +GLAPI GLboolean GLAPIENTRY +glIsFramebufferEXT(GLuint framebuffer); + +GLAPI void GLAPIENTRY +glBindFramebufferEXT(GLenum target, GLuint framebuffer); + +GLAPI void GLAPIENTRY +glDeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers); + +GLAPI void GLAPIENTRY +glGenFramebuffersEXT(GLsizei n, GLuint *framebuffers); + +GLAPI GLenum GLAPIENTRY +glCheckFramebufferStatusEXT(GLenum target); + +GLAPI void GLAPIENTRY +glFramebufferTexture1DEXT(GLenum target, GLenum attachment, + GLenum textarget, GLuint texture, GLint level); + +GLAPI void GLAPIENTRY +glFramebufferTexture2DEXT(GLenum target, GLenum attachment, + GLenum textarget, GLuint texture, GLint level); + +GLAPI void GLAPIENTRY +glFramebufferTexture3DEXT(GLenum target, GLenum attachment, + GLenum textarget, GLuint texture, + GLint level, GLint zoffset); + +GLAPI void GLAPIENTRY +glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, + GLenum renderbuffertarget, + GLuint renderbuffer); + +GLAPI void GLAPIENTRY +glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, + GLenum pname, GLint *params); + +GLAPI void GLAPIENTRY +glGenerateMipmapEXT(GLenum target); + + +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_STENCIL_INDEX_EXT 0x8D45 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_FRAMEBUFFER_STATUS_ERROR_EXT 0x8CDE +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 + +#endif /* GL_EXT_framebuffer_object */ + + + /** ** NOTE!!!!! If you add new functions to this file, or update ** glext.h be sure to regenerate the gl_mangle.h file. See comments -- cgit v1.2.3 From d084982240bafba0169c4a6cacf02d45d6cfd8c1 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 8 Feb 2005 05:46:53 +0000 Subject: Bug #2477: Make GLU/GLw/glut build properly even with -fvisibility=hidden. --- include/GL/gl.h | 3 +++ include/GL/glut.h | 2 +- src/glw/GLwDrawA.h | 4 ++-- src/glw/GLwDrawAP.h | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index f910c3221aa..1426df481c2 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -62,6 +62,9 @@ #elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */ # define GLAPI extern # define GLAPIENTRY __stdcall +#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 +# define GLAPI __attribute__((visibility("default"))) +# define GLAPIENTRY #endif /* WIN32 && !CYGWIN */ #if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__) diff --git a/include/GL/glut.h b/include/GL/glut.h index c1b78aa4e59..2e5be8a77c2 100644 --- a/include/GL/glut.h +++ b/include/GL/glut.h @@ -193,7 +193,7 @@ WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *); #else /* _WIN32 not defined */ /* Define GLUTAPIENTRY and GLUTCALLBACK to nothing if we aren't on Win32. */ -# define GLUTAPIENTRY +# define GLUTAPIENTRY GLAPI # define GLUTAPIENTRYV # define GLUT_APIENTRY_DEFINED # define GLUTCALLBACK diff --git a/src/glw/GLwDrawA.h b/src/glw/GLwDrawA.h index a62852c260f..4a381ac38cc 100644 --- a/src/glw/GLwDrawA.h +++ b/src/glw/GLwDrawA.h @@ -182,9 +182,9 @@ extern void GLwDrawingAreaSwapBuffers(Widget w); #ifdef __GLX_MOTIF #ifdef _NO_PROTO -extern Widget GLwCreateMDrawingArea(); +GLAPI extern Widget GLwCreateMDrawingArea(); #else -extern Widget GLwCreateMDrawingArea(Widget parent,char *name,ArgList arglist,Cardinal argcount); +GLAPI extern Widget GLwCreateMDrawingArea(Widget parent,char *name,ArgList arglist,Cardinal argcount); #endif #endif diff --git a/src/glw/GLwDrawAP.h b/src/glw/GLwDrawAP.h index f1217019541..031531b7e6e 100644 --- a/src/glw/GLwDrawAP.h +++ b/src/glw/GLwDrawAP.h @@ -59,7 +59,7 @@ typedef struct _GLwMDrawingAreaClassRec { } GLwMDrawingAreaClassRec; -extern GLwMDrawingAreaClassRec glwMDrawingAreaClassRec; +GLAPI extern GLwMDrawingAreaClassRec glwMDrawingAreaClassRec; /* XT */ -- cgit v1.2.3 From 09298228c64f14b6c74588a89f70b0de4d1ac6a4 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 15 Feb 2005 08:40:24 +0000 Subject: add EnableExtension so r200 enables all its extensions, add mesa memory extension entry points --- include/GL/miniglx.h | 13 +++++++++++++ src/glx/mini/miniglx.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) (limited to 'include') diff --git a/include/GL/miniglx.h b/include/GL/miniglx.h index 1a6304f6ba1..4af7ec1141e 100644 --- a/include/GL/miniglx.h +++ b/include/GL/miniglx.h @@ -440,6 +440,19 @@ glXChooseFBConfig( Display *dpy, int screen, const int *attribList, extern XVisualInfo * glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ); +extern void *glXAllocateMemoryMESA(Display *dpy, int scrn, + size_t size, float readFreq, + float writeFreq, float priority); + +extern void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer); + +extern GLuint glXGetMemoryOffsetMESA( Display *dpy, int scrn, + const void *pointer ); +/*@}*/ + +extern void +__glXScrEnableExtension( void *, const char * name ); + /*@}*/ diff --git a/src/glx/mini/miniglx.c b/src/glx/mini/miniglx.c index 51468dba797..5cd5eea9c7d 100644 --- a/src/glx/mini/miniglx.c +++ b/src/glx/mini/miniglx.c @@ -2289,6 +2289,7 @@ void (*glXGetProcAddress(const GLubyte *procname))( void ) { "__glXWindowExists", (void *) __glXWindowExists }, { "__glXCreateContextModes", (void *) _gl_context_modes_create }, { "__glXFindDRIScreen", (void *)__glXFindDRIScreen }, + { "__glXScrEnableExtension", (void *)__glXScrEnableExtension }, { NULL, NULL } }; const struct name_address *entry; @@ -2369,5 +2370,36 @@ glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ) return config.visInfo; } +void *glXAllocateMemoryMESA(Display *dpy, int scrn, + size_t size, float readFreq, + float writeFreq, float priority) +{ + if (dpy->driScreen.private && dpy->driScreen.allocateMemory) { + return (*dpy->driScreen.allocateMemory)( dpy, scrn, size, + readFreq, writeFreq, + priority ); + } +} + +void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer){ + if (dpy->driScreen.private && dpy->driScreen.freeMemory) { + (*dpy->driScreen.freeMemory)( dpy, scrn, pointer ); + } +} + +GLuint glXGetMemoryOffsetMESA( Display *dpy, int scrn, + const void *pointer ) +{ + if (dpy->driScreen.private && dpy->driScreen.memoryOffset) { + return (*dpy->driScreen.memoryOffset)( dpy, scrn, pointer ); + } +} + +void +__glXScrEnableExtension( void *psc, const char * name ) +{ + +} + /*@}*/ -- cgit v1.2.3 From f321f16e83cae427d6496c11955fd1c898d0395c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 16 Feb 2005 19:52:35 +0000 Subject: fix non-Win32 definition of GLUTAPIENTRY, remove some cruft --- include/GL/glut.h | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'include') diff --git a/include/GL/glut.h b/include/GL/glut.h index 2e5be8a77c2..23c740ee117 100644 --- a/include/GL/glut.h +++ b/include/GL/glut.h @@ -193,13 +193,11 @@ WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *); #else /* _WIN32 not defined */ /* Define GLUTAPIENTRY and GLUTCALLBACK to nothing if we aren't on Win32. */ -# define GLUTAPIENTRY GLAPI +# define GLUTAPIENTRY GLAPIENTRY # define GLUTAPIENTRYV -# define GLUT_APIENTRY_DEFINED # define GLUTCALLBACK # define GLUTAPI extern -/* Prototype exit for the non-Win32 case (see above). */ -/*extern void exit(int); this screws up gcc -ansi -pedantic! */ + #endif @@ -747,26 +745,4 @@ GLUTAPI int GLUTAPIENTRY glutGameModeGet(GLenum mode); } #endif -#if 0 -#ifdef GLUT_APIENTRY_DEFINED -# undef GLUT_APIENTRY_DEFINED -# undef APIENTRY -#endif - -#ifdef GLUT_WINGDIAPI_DEFINED -# undef GLUT_WINGDIAPI_DEFINED -# undef WINGDIAPI -#endif - -#ifdef GLUT_DEFINED___CDECL -# undef GLUT_DEFINED___CDECL -# undef __cdecl -#endif - -#ifdef GLUT_DEFINED__CRTIMP -# undef GLUT_DEFINED__CRTIMP -# undef _CRTIMP -#endif -#endif - #endif /* __glut_h__ */ -- cgit v1.2.3 From dee1c795c25c2915582c7928238498bb63d86234 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 20 Feb 2005 10:46:34 +0000 Subject: add more functionality to miniglx for glitz --- include/GL/miniglx.h | 137 ++++++++++++++++++++++++++++--------------------- src/glx/mini/miniglx.c | 132 +++++++++++++++++++++++++++++++++++------------ 2 files changed, 176 insertions(+), 93 deletions(-) (limited to 'include') diff --git a/include/GL/miniglx.h b/include/GL/miniglx.h index 4af7ec1141e..8c6180be60b 100644 --- a/include/GL/miniglx.h +++ b/include/GL/miniglx.h @@ -52,14 +52,20 @@ extern "C" { * * It can have the values #True or #False. */ +#ifndef MINIGLX_NO_XTYPES typedef int Bool; +#endif +typedef int MINI_Bool; /** * \brief Color map. * * Alias for private ::MiniGLXColormapRec structure. */ +typedef struct MiniGLXColormapRec *MINI_Colormap; +#ifndef MINIGLX_NO_XTYPES typedef struct MiniGLXColormapRec *Colormap; +#endif /** * \brief Window attributes. @@ -67,7 +73,7 @@ typedef struct MiniGLXColormapRec *Colormap; typedef struct MiniGLXSetWindowAttributesRec { int background_pixel; /**< \brief background pixel */ int border_pixel; /**< \brief border pixel value */ - Colormap colormap; /**< \brief color map to be associated with window */ + MINI_Colormap colormap; /**< \brief color map to be associated with window */ int event_mask; /**< \brief set of events that should be saved */ } XSetWindowAttributes; @@ -85,10 +91,13 @@ typedef struct MiniGLXVisualRec Visual; * * \sa \ref datatypes. */ -typedef unsigned int VisualID; +#ifndef MINIGLX_NO_XTYPES +typedef unsigned long VisualID; +#endif +typedef unsigned long MINI_VisualID; typedef struct MiniGLXXVisualInfoRec { Visual *visual; /**< \brief pointer to the GLX Visual */ - VisualID visualid; /**< \brief visual ID */ + MINI_VisualID visualid; /**< \brief visual ID */ int screen; /**< \brief screen number */ int depth; /**< \brief bit depth */ #if defined(__cplusplus) || defined(c_plusplus) @@ -115,7 +124,10 @@ typedef struct MiniGLXFBConfigRec { * * \sa \ref datatypes. */ +#ifndef MINIGLX_NO_XTYPES typedef struct MiniGLXDisplayRec Display; +#endif +typedef struct MiniGLXDisplayRec MINI_Display; /** * \brief Window handle. @@ -124,7 +136,10 @@ typedef struct MiniGLXDisplayRec Display; * * \sa \ref datatypes. */ +#ifndef MINIGLX_NO_XTYPES typedef struct MiniGLXWindowRec *Window; +#endif +typedef struct MiniGLXWindowRec *MINI_Window; /** * \brief Drawable. @@ -136,7 +151,10 @@ typedef struct MiniGLXWindowRec *Window; * * \sa \ref datatypes. */ +#ifndef MINIGLX_NO_XTYPES typedef struct MiniGLXWindowRec *Drawable; +#endif +typedef struct MiniGLXWindowRec *MINI_Drawable; /** * \brief GLX drawable. @@ -174,9 +192,9 @@ typedef struct MiniGLXContextRec *GLXContext; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window window; + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window window; int x, y; int width, height; int count; /* if non-zero, at least this many more */ @@ -185,53 +203,53 @@ typedef struct { typedef struct { int type; unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window parent; /* parent of the window */ - Window window; /* window id of window created */ + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window parent; /* parent of the window */ + MINI_Window window; /* window id of window created */ int x, y; /* window location */ int width, height; /* size of window */ int border_width; /* border width */ - Bool override_redirect; /* creation should be overridden */ + MINI_Bool override_redirect; /* creation should be overridden */ } XCreateWindowEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window event; - Window window; + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window event; + MINI_Window window; } XDestroyWindowEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window event; - Window window; - Bool from_configure; + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window event; + MINI_Window window; + MINI_Bool from_configure; } XUnmapEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window event; - Window window; - Bool override_redirect; /* boolean, is override set... */ + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window event; + MINI_Window window; + MINI_Bool override_redirect; /* boolean, is override set... */ } XMapEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Window parent; - Window window; + MINI_Bool send_event; /* true if this came from a SendEvent request */ + MINI_Display *display; /* Display the event was read from */ + MINI_Window parent; + MINI_Window window; } XMapRequestEvent; typedef union _XEvent { @@ -263,6 +281,7 @@ typedef union _XEvent { #define CWColormap (1L<<13) #define PseudoColor 3 #define TrueColor 4 +#define VisualIDMask 0x1 #define VisualScreenMask 0x2 #define Expose 12 #define CreateNotify 16 @@ -318,11 +337,11 @@ typedef union _XEvent { /** * \name Server-specific functions */ -extern Display * +extern MINI_Display * __miniglx_StartServer( const char *display_name ); extern int -__miniglx_Select( Display *dpy, int maxfd, +__miniglx_Select( MINI_Display *dpy, int maxfd, fd_set *rfds, fd_set *wfds, fd_set *xfds, struct timeval *tv ); @@ -331,25 +350,25 @@ __miniglx_Select( Display *dpy, int maxfd, * \name Simulated Xlib functions */ /*@{*/ -extern Display * +extern MINI_Display * XOpenDisplay( const char *dpy_name ); extern void -XCloseDisplay( Display *display ); +XCloseDisplay( MINI_Display *display ); -extern Window -XCreateWindow( Display *display, Window parent, int x, int y, +extern MINI_Window +XCreateWindow( MINI_Display *display, MINI_Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, int depth, unsigned int winclass, Visual *visual, unsigned long valuemask, XSetWindowAttributes *attributes ); extern int -XNextEvent(Display *display, XEvent *event_return); +XNextEvent(MINI_Display *display, XEvent *event_return); -extern Bool -XCheckMaskEvent( Display *dpy, long event_mask, XEvent *event_return ); +extern MINI_Bool +XCheckMaskEvent( MINI_Display *dpy, long event_mask, XEvent *event_return ); /** * \brief Return the root window. @@ -365,27 +384,27 @@ XCheckMaskEvent( Display *dpy, long event_mask, XEvent *event_return ); #define DefaultScreen(dpy) 0 extern void -XDestroyWindow( Display *display, Window w ); +XDestroyWindow( MINI_Display *display, MINI_Window w ); extern void -XMapWindow( Display *display, Window w ); +XMapWindow( MINI_Display *display, MINI_Window w ); /* Should clients have access to this? */ extern void -XUnmapWindow( Display *display, Window w ); +XUnmapWindow( MINI_Display *display, MINI_Window w ); -extern Colormap -XCreateColormap( Display *display, Window w, Visual *visual, int alloc ); +extern MINI_Colormap +XCreateColormap( MINI_Display *display, MINI_Window w, Visual *visual, int alloc ); extern void -XFreeColormap( Display *display, Colormap cmap ); +XFreeColormap( MINI_Display *display, MINI_Colormap cmap ); extern void XFree( void *data ); extern XVisualInfo * -XGetVisualInfo( Display *display, long vinfo_mask, +XGetVisualInfo( MINI_Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return ); /*@}*/ @@ -396,23 +415,23 @@ XGetVisualInfo( Display *display, long vinfo_mask, */ /*@{*/ extern XVisualInfo* -glXChooseVisual( Display *dpy, int screen, int *attribList ); +glXChooseVisual( MINI_Display *dpy, int screen, int *attribList ); extern int -glXGetConfig( Display *dpy, XVisualInfo *vis, int attrib, int *value ); +glXGetConfig( MINI_Display *dpy, XVisualInfo *vis, int attrib, int *value ); extern GLXContext -glXCreateContext( Display *dpy, XVisualInfo *vis, - GLXContext shareList, Bool direct ); +glXCreateContext( MINI_Display *dpy, XVisualInfo *vis, + GLXContext shareList, MINI_Bool direct ); extern void -glXDestroyContext( Display *dpy, GLXContext ctx ); +glXDestroyContext( MINI_Display *dpy, GLXContext ctx ); -extern Bool -glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx); +extern MINI_Bool +glXMakeCurrent( MINI_Display *dpy, GLXDrawable drawable, GLXContext ctx); extern void -glXSwapBuffers( Display *dpy, GLXDrawable drawable ); +glXSwapBuffers( MINI_Display *dpy, GLXDrawable drawable ); extern GLXContext glXGetCurrentContext( void ); @@ -423,22 +442,22 @@ glXGetCurrentDrawable( void ); extern void (*glXGetProcAddress(const GLubyte *procname))( void ); -extern Bool -glXQueryVersion( Display *dpy, int *major, int *minor ); +extern MINI_Bool +glXQueryVersion( MINI_Display *dpy, int *major, int *minor ); /* Added in MiniGLX 1.1 */ extern GLXPbuffer -glXCreatePbuffer( Display *dpy, GLXFBConfig config, const int *attribList ); +glXCreatePbuffer( MINI_Display *dpy, GLXFBConfig config, const int *attribList ); extern void -glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf ); +glXDestroyPbuffer( MINI_Display *dpy, GLXPbuffer pbuf ); extern GLXFBConfig * -glXChooseFBConfig( Display *dpy, int screen, const int *attribList, +glXChooseFBConfig( MINI_Display *dpy, int screen, const int *attribList, int *nitems ); extern XVisualInfo * -glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ); +glXGetVisualFromFBConfig( MINI_Display *dpy, GLXFBConfig config ); extern void *glXAllocateMemoryMESA(Display *dpy, int scrn, size_t size, float readFreq, diff --git a/src/glx/mini/miniglx.c b/src/glx/mini/miniglx.c index 5cd5eea9c7d..bb76ef87865 100644 --- a/src/glx/mini/miniglx.c +++ b/src/glx/mini/miniglx.c @@ -1215,8 +1215,20 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc) fd, (get_ver != NULL) ? (*get_ver)() : 20040602, (__GLcontextModes **) &dpy->driver_modes); - } + /* fill in dummy visual ids */ + { + __GLcontextModes *temp; + temp = (__GLcontextModes *)dpy->driver_modes; + i = 1; + while (temp) + { + temp->visualID = i++; + temp=temp->next; + } + } + } + done: if ( psp == NULL ) { if ( pSAREA != MAP_FAILED ) { @@ -1631,50 +1643,102 @@ XGetVisualInfo( Display *dpy, long vinfo_mask, XVisualInfo *vinfo_template, int const __GLcontextModes *mode; XVisualInfo *results; Visual *visResults; - int i, n; + int i, n=0; - ASSERT(vinfo_mask == VisualScreenMask); + // ASSERT(vinfo_mask == VisualScreenMask); ASSERT(vinfo_template.screen == 0); - n = 0; - for ( mode = dpy->driver_modes ; mode != NULL ; mode = mode->next ) - n++; + if (vinfo_mask == VisualIDMask) + { + for ( mode = dpy->driver_modes ; mode != NULL ; mode= mode->next ) + if (mode->visualID == vinfo_template->visualid) + n=1; - results = (XVisualInfo *)calloc(1, n * sizeof(XVisualInfo)); - if (!results) { - *nitens_return = 0; - return NULL; - } + if (n==0) + return NULL; + + results = (XVisualInfo *)calloc(1, n * sizeof(XVisualInfo)); + if (!results) { + *nitens_return = 0; + return NULL; + } + + visResults = (Visual *)calloc(1, n * sizeof(Visual)); + if (!results) { + free(results); + *nitens_return = 0; + return NULL; + } - visResults = (Visual *)calloc(1, n * sizeof(Visual)); - if (!results) { - free(results); - *nitens_return = 0; - return NULL; + for ( mode = dpy->driver_modes ; mode != NULL ; mode= mode->next ) + if (mode->visualID == vinfo_template->visualid) + { + visResults[0].mode=mode; + visResults[0].visInfo = results; + visResults[0].dpy = dpy; + if (dpy->driverContext.bpp == 32) + visResults[0].pixelFormat = PF_B8G8R8A8; /* XXX: FIX ME */ + else + visResults[0].pixelFormat = PF_B5G6R5; /* XXX: FIX ME */ + + results[0].visual = visResults; + results[0].visualid = mode->visualID; +#if defined(__cplusplus) || defined(c_plusplus) + results[0].c_class = TrueColor; +#else + results[0].class = TrueColor; +#endif + results[0].depth = mode->redBits + + mode->redBits + + mode->redBits + + mode->redBits; + results[0].bits_per_rgb = dpy->driverContext.bpp; + + } + } - - for ( mode = dpy->driver_modes, i = 0 ; mode != NULL ; mode = mode->next, i++ ) { - visResults[i].mode = mode; - visResults[i].visInfo = results + i; - visResults[i].dpy = dpy; - - if (dpy->driverContext.bpp == 32) + else // if (vinfo_mask == VisualScreenMask) + { + n = 0; + for ( mode = dpy->driver_modes ; mode != NULL ; mode = mode->next ) + n++; + + results = (XVisualInfo *)calloc(1, n * sizeof(XVisualInfo)); + if (!results) { + *nitens_return = 0; + return NULL; + } + + visResults = (Visual *)calloc(1, n * sizeof(Visual)); + if (!results) { + free(results); + *nitens_return = 0; + return NULL; + } + + for ( mode = dpy->driver_modes, i = 0 ; mode != NULL ; mode = mode->next, i++ ) { + visResults[i].mode = mode; + visResults[i].visInfo = results + i; + visResults[i].dpy = dpy; + + if (dpy->driverContext.bpp == 32) visResults[i].pixelFormat = PF_B8G8R8A8; /* XXX: FIX ME */ - else + else visResults[i].pixelFormat = PF_B5G6R5; /* XXX: FIX ME */ - - results[i].visual = visResults + i; - results[i].visualid = i; + + results[i].visual = visResults + i; + results[i].visualid = mode->visualID; #if defined(__cplusplus) || defined(c_plusplus) - results[i].c_class = TrueColor; + results[i].c_class = TrueColor; #else - results[i].class = TrueColor; + results[i].class = TrueColor; #endif - results[i].depth = mode->redBits + - mode->redBits + - mode->redBits + - mode->redBits; - results[i].bits_per_rgb = dpy->driverContext.bpp; + results[i].depth = mode->redBits + + mode->redBits + + mode->redBits + + mode->redBits; + results[i].bits_per_rgb = dpy->driverContext.bpp; + } } *nitens_return = n; return results; -- cgit v1.2.3 From 24dcc6b6bf995f663641f75c72d528510bee1fb2 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 26 Feb 2005 03:51:17 +0000 Subject: Add GLX_MESA_allocate_memory from Xorg glx.h --- include/GL/glx.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index bfaac778076..f9feb7fd1de 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -482,6 +482,21 @@ typedef GLuint (* PFNGLXGETAGPOFFSETMESAPROC) (const GLvoid *pointer); #endif /* GLX_MESA_agp_offset */ +/* + * ???. GLX_MESA_allocate_memory + */ +#ifndef GLX_MESA_allocate_memory +#define GLX_MESA_allocate_memory 1 + +extern void *glXAllocateMemoryMESA(Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority); +extern void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer); +extern GLuint glXGetMemoryOffsetMESA(Display *dpy, int scrn, const void *pointer); +typedef void * ( * PFNGLXALLOCATEMEMORYMESAPROC) (Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority); +typedef void ( * PFNGLXFREEMEMORYMESAPROC) (Display *dpy, int scrn, void *pointer); +typedef GLuint (* PFNGLXGETMEMORYOFFSETMESAPROC) (Display *dpy, int scrn, const void *pointer); + +#endif /* GLX_MESA_allocate_memory */ + /* * ARB ?. GLX_ARB_render_texture */ -- cgit v1.2.3 From 9bfd9582d418c7e73f7b66f050fac80bd3e04115 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 26 Feb 2005 03:55:44 +0000 Subject: bring over structs from Xorg glx.h to make Mesa glx.h the one true glx.h --- include/GL/glx.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index f9feb7fd1de..ab0467c1886 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -521,6 +521,28 @@ extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attr #endif /* GLX_NV_float_buffer */ +/*** Should these go here, or in another header? */ +/* +** GLX Events +*/ +typedef struct { + int event_type; /* GLX_DAMAGED or GLX_SAVED */ + int draw_type; /* GLX_WINDOW or GLX_PBUFFER */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came for SendEvent request */ + Display *display; /* display the event was read from */ + GLXDrawable drawable; /* XID of Drawable */ + unsigned int buffer_mask; /* mask indicating which buffers are affected */ + unsigned int aux_buffer; /* which aux buffer was affected */ + int x, y; + int width, height; + int count; /* if nonzero, at least this many more */ +} GLXPbufferClobberEvent; + +typedef union __GLXEvent { + GLXPbufferClobberEvent glxpbufferclobber; + long pad[24]; +} GLXEvent; #ifdef __cplusplus } -- cgit v1.2.3 From 8ff72e97231da2f81de422d2f58c23d09562446e Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 4 Mar 2005 20:18:55 +0000 Subject: Add preliminary EGL headers. --- include/GLES/egl.h | 232 ++++++++++++++++++++++++++++++++++++++++++++++++ include/GLES/egltypes.h | 48 ++++++++++ 2 files changed, 280 insertions(+) create mode 100644 include/GLES/egl.h create mode 100644 include/GLES/egltypes.h (limited to 'include') diff --git a/include/GLES/egl.h b/include/GLES/egl.h new file mode 100644 index 00000000000..6edb954a4dc --- /dev/null +++ b/include/GLES/egl.h @@ -0,0 +1,232 @@ +#ifndef _EGL_H +#define _EGL_H + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.0 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. This software +** was created using the OpenGL(R) version 1.2.1 Sample Implementation +** published by SGI, but has not been independently verified as being +** compliant with the OpenGL(R) version 1.2.1 Specification. +*/ + +#include +#include + +/* XXX should go in eglext.h */ +#define GL_OES_VERSION_1_0 1 +#define GL_OES_read_format 1 +#define GL_OES_compressed_paletted_texture 1 +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 +/* XXX */ + +/* +** Versioning and extensions +*/ +#define EGL_VERSION_1_0 1 +#if 0 +#define EGL_VERSION_1_1 1 +#endif + +/* +** Boolean +*/ +#define EGL_FALSE 0 +#define EGL_TRUE 1 + +/* +** Errors +*/ +#define EGL_SUCCESS 0x3000 +#define EGL_NOT_INITIALIZED 0x3001 +#define EGL_BAD_ACCESS 0x3002 +#define EGL_BAD_ALLOC 0x3003 +#define EGL_BAD_ATTRIBUTE 0x3004 +#define EGL_BAD_CONFIG 0x3005 +#define EGL_BAD_CONTEXT 0x3006 +#define EGL_BAD_CURRENT_SURFACE 0x3007 +#define EGL_BAD_DISPLAY 0x3008 +#define EGL_BAD_MATCH 0x3009 +#define EGL_BAD_NATIVE_PIXMAP 0x300A +#define EGL_BAD_NATIVE_WINDOW 0x300B +#define EGL_BAD_PARAMETER 0x300C +#define EGL_BAD_SURFACE 0x300D +#define EGL_CONTEXT_LOST 0x300E +/* 0x300F - 0x301F reserved for additional errors. */ + +/* +** Config attributes +*/ +#define EGL_BUFFER_SIZE 0x3020 +#define EGL_ALPHA_SIZE 0x3021 +#define EGL_BLUE_SIZE 0x3022 +#define EGL_GREEN_SIZE 0x3023 +#define EGL_RED_SIZE 0x3024 +#define EGL_DEPTH_SIZE 0x3025 +#define EGL_STENCIL_SIZE 0x3026 +#define EGL_CONFIG_CAVEAT 0x3027 +#define EGL_CONFIG_ID 0x3028 +#define EGL_LEVEL 0x3029 +#define EGL_MAX_PBUFFER_HEIGHT 0x302A +#define EGL_MAX_PBUFFER_PIXELS 0x302B +#define EGL_MAX_PBUFFER_WIDTH 0x302C +#define EGL_NATIVE_RENDERABLE 0x302D +#define EGL_NATIVE_VISUAL_ID 0x302E +#define EGL_NATIVE_VISUAL_TYPE 0x302F +/*#define EGL_PRESERVED_RESOURCES 0x3030*/ +#define EGL_SAMPLES 0x3031 +#define EGL_SAMPLE_BUFFERS 0x3032 +#define EGL_SURFACE_TYPE 0x3033 +#define EGL_TRANSPARENT_TYPE 0x3034 +#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 +#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 +#define EGL_TRANSPARENT_RED_VALUE 0x3037 +#define EGL_NONE 0x3038 /* Also a config value */ +#define EGL_BIND_TO_TEXTURE_RGB 0x3039 +#define EGL_BIND_TO_TEXTURE_RGBA 0x303A +#define EGL_MIN_SWAP_INTERVAL 0x303B +#define EGL_MAX_SWAP_INTERVAL 0x303C + +/* +** Config values +*/ +#define EGL_DONT_CARE ((EGLint) -1) + +#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */ +#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* " */ +#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */ +#define EGL_NO_TEXTURE 0x305C /* EGL_TEXTURE_FORMAT/TARGET value */ +#define EGL_TEXTURE_RGB 0x305D /* EGL_TEXTURE_FORMAT value */ +#define EGL_TEXTURE_RGBA 0x305E /* " */ +#define EGL_TEXTURE_2D 0x305F /* EGL_TEXTURE_TARGET value */ + +/* +** Config attribute mask bits +*/ +#define EGL_PBUFFER_BIT 0x01 /* EGL_SURFACE_TYPE mask bit */ +#define EGL_PIXMAP_BIT 0x02 /* " */ +#define EGL_WINDOW_BIT 0x04 /* " */ + +/* +** String names +*/ +#define EGL_VENDOR 0x3053 /* eglQueryString target */ +#define EGL_VERSION 0x3054 /* " */ +#define EGL_EXTENSIONS 0x3055 /* " */ + +/* +** Surface attributes +*/ +#define EGL_HEIGHT 0x3056 +#define EGL_WIDTH 0x3057 +#define EGL_LARGEST_PBUFFER 0x3058 +#define EGL_TEXTURE_FORMAT 0x3080 /* For pbuffers bound as textures */ +#define EGL_TEXTURE_TARGET 0x3081 /* " */ +#define EGL_MIPMAP_TEXTURE 0x3082 /* " */ +#define EGL_MIPMAP_LEVEL 0x3083 /* " */ + +/* +** BindTexImage / ReleaseTexImage buffer target +*/ +#define EGL_BACK_BUFFER 0x3084 + +/* +** Current surfaces +*/ +#define EGL_DRAW 0x3059 +#define EGL_READ 0x305A + +/* +** Engines +*/ +#define EGL_CORE_NATIVE_ENGINE 0x305B + +/* 0x305C-0x3FFFF reserved for future use */ + +/* +** Functions +*/ +#ifdef __cplusplus +extern "C" { +#endif + +GLAPI EGLint APIENTRY eglGetError (void); + +GLAPI EGLDisplay APIENTRY eglGetDisplay (NativeDisplayType display); +GLAPI EGLBoolean APIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor); +GLAPI EGLBoolean APIENTRY eglTerminate (EGLDisplay dpy); +GLAPI const char * APIENTRY eglQueryString (EGLDisplay dpy, EGLint name); +GLAPI void (* APIENTRY eglGetProcAddress (const char *procname))(); + +GLAPI EGLBoolean APIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); +GLAPI EGLBoolean APIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); +GLAPI EGLBoolean APIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); + +GLAPI EGLSurface APIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list); +GLAPI EGLSurface APIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list); +GLAPI EGLSurface APIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); +GLAPI EGLBoolean APIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface); +GLAPI EGLBoolean APIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); + +/* EGL 1.1 render-to-texture APIs */ +GLAPI EGLBoolean APIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); +GLAPI EGLBoolean APIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); +GLAPI EGLBoolean APIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); + +/* EGL 1.1 swap control API */ +GLAPI EGLBoolean APIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval); + +GLAPI EGLContext APIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list); +GLAPI EGLBoolean APIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx); +GLAPI EGLBoolean APIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); +GLAPI EGLContext APIENTRY eglGetCurrentContext (void); +GLAPI EGLSurface APIENTRY eglGetCurrentSurface (EGLint readdraw); +GLAPI EGLDisplay APIENTRY eglGetCurrentDisplay (void); +GLAPI EGLBoolean APIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); + +GLAPI EGLBoolean APIENTRY eglWaitGL (void); +GLAPI EGLBoolean APIENTRY eglWaitNative (EGLint engine); +GLAPI EGLBoolean APIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface draw); +GLAPI EGLBoolean APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target); + +#ifdef __cplusplus +} +#endif + +#endif /* _EGL_H */ diff --git a/include/GLES/egltypes.h b/include/GLES/egltypes.h new file mode 100644 index 00000000000..873a8459754 --- /dev/null +++ b/include/GLES/egltypes.h @@ -0,0 +1,48 @@ +/* + * egltypes.h - EGL API compatibility + * + * The intention here is to support multiple EGL implementations for the + * various backends - GLX, AGL, WGL, Solo - so we define the EGL types as + * opaque handles. We also define the Native types as opaque handles for + * now, which should be fine for GLX and Solo but the others who knows. + * They can extend this later. + * + * We require that 'int' be 32 bits. Other than that this should be pretty + * portable. + * + * Derived from the OpenGL|ES 1.1 egl.h on the Khronos website: + * http://www.khronos.org/opengles/spec_headers/opengles1_1/egl.h + * + */ + +#ifndef _EGLTYPES_H +#define _EGLTYPES_H + +#include + +/* + * Native types + */ +typedef void *NativeDisplayType; +typedef void *NativePixmapType; +typedef void *NativeWindowType; + +/* + * Types and resources + */ +typedef GLboolean EGLBoolean; +typedef GLint EGLint; +typedef void *EGLDisplay; +typedef void *EGLConfig; +typedef void *EGLSurface; +typedef void *EGLContext; + +/* + * EGL and native handle values + */ +#define EGL_DEFAULT_DISPLAY ((NativeDisplayType)0) +#define EGL_NO_CONTEXT ((EGLContext)0) +#define EGL_NO_DISPLAY ((EGLDisplay)0) +#define EGL_NO_SURFACE ((EGLSurface)0) + +#endif /* _EGLTYPES_H */ -- cgit v1.2.3 From 11b0a76370c2a00ffe9e50e6d8384b4daeb7cee4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 22 Apr 2005 21:16:12 +0000 Subject: prototype EGL_MESA_screen_surface. --- include/GLES/egl.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'include') diff --git a/include/GLES/egl.h b/include/GLES/egl.h index 6edb954a4dc..0fafc25e156 100644 --- a/include/GLES/egl.h +++ b/include/GLES/egl.h @@ -35,7 +35,11 @@ ** compliant with the OpenGL(R) version 1.2.1 Specification. */ +#if 0/*XXX TEMPORARY HACK*/ +#include +#else #include +#endif #include /* XXX should go in eglext.h */ @@ -225,6 +229,42 @@ GLAPI EGLBoolean APIENTRY eglWaitNative (EGLint engine); GLAPI EGLBoolean APIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface draw); GLAPI EGLBoolean APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target); + + +/* EGL_MESA_screen extension >>> PRELIMINARY <<< */ +#ifndef EGL_MESA_screen_surface +#define EGL_MESA_screen_surface 1 + +#define EGL_BAD_SCREEN_MESA 0x4000 +#define EGL_BAD_MODE_MESA 0x4001 +#define EGL_SCREEN_COUNT_MESA 0x4002 +#define EGL_SCREEN_POSITION_MESA 0x4003 +#define EGL_MODE_ID_MESA 0x4004 +#define EGL_REFRESH_RATE_MESA 0x4005 +#define EGL_OPTIMAL_MODE_MESA 0x4006 +#define EGL_SCREEN_BIT_MESA 0x08 + +GLAPI EGLBoolean APIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLint screen_number, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); +GLAPI EGLBoolean APIENTRY eglGetModesMESA(EGLDisplay dpy, EGLint screen_number, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); +GLAPI EGLBoolean APIENTRY eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value); +GLAPI EGLSurface APIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); +GLAPI EGLBoolean APIENTRY eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface); +GLAPI EGLBoolean APIENTRY eglScreenModeMESA(EGLDisplay dpy, EGLint screen_number, EGLModeMESA mode); +GLAPI EGLBoolean APIENTRY eglScreenAttribsMESA(EGLDisplay dpy, EGLint screen, const EGLint *attrib_list); +GLAPI EGLBoolean APIENTRY eglQueryDisplayMESA(EGLDisplay dpy, EGLint attribute, EGLint *value); +GLAPI EGLBoolean APIENTRY eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLint screen_number, EGLSurface *surface); +GLAPI EGLBoolean APIENTRY eglQueryScreenModeMESA(EGLDisplay dpy, EGLint screen_number, EGLModeMESA *mode); +GLAPI EGLBoolean APIENTRY eglQueryScreenMESA(EGLDisplay dpy, EGLint screen_number, EGLint attribute, EGLint *value); + +#endif /* EGL_MESA_screen_surface */ + + + + + + + + #ifdef __cplusplus } #endif -- cgit v1.2.3 From 20d44dc9bc0f60afa93a6542ebcda44ee88f69ef Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 22 Apr 2005 21:16:28 +0000 Subject: types for Mesa implementation of EGL --- include/GLES/egltypes.h | 74 +++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 39 deletions(-) (limited to 'include') diff --git a/include/GLES/egltypes.h b/include/GLES/egltypes.h index 873a8459754..c81116ace21 100644 --- a/include/GLES/egltypes.h +++ b/include/GLES/egltypes.h @@ -1,48 +1,44 @@ /* - * egltypes.h - EGL API compatibility - * - * The intention here is to support multiple EGL implementations for the - * various backends - GLX, AGL, WGL, Solo - so we define the EGL types as - * opaque handles. We also define the Native types as opaque handles for - * now, which should be fine for GLX and Solo but the others who knows. - * They can extend this later. - * - * We require that 'int' be 32 bits. Other than that this should be pretty - * portable. - * - * Derived from the OpenGL|ES 1.1 egl.h on the Khronos website: - * http://www.khronos.org/opengles/spec_headers/opengles1_1/egl.h - * - */ - -#ifndef _EGLTYPES_H -#define _EGLTYPES_H +** egltypes.h for Mesa +** +** ONLY egl.h SHOULD INCLUDE THIS FILE! +** +** See comments about egltypes.h in the standard egl.h file. +*/ + #include + /* - * Native types - */ -typedef void *NativeDisplayType; -typedef void *NativePixmapType; -typedef void *NativeWindowType; +** These opaque EGL types are implemented as unsigned 32-bit integers: +*/ +typedef u_int32_t EGLDisplay; +typedef u_int32_t EGLConfig; +typedef u_int32_t EGLSurface; +typedef u_int32_t EGLContext; + +/* EGL_MESA_screen_surface */ +typedef u_int32_t EGLModeMESA; + /* - * Types and resources - */ -typedef GLboolean EGLBoolean; -typedef GLint EGLint; -typedef void *EGLDisplay; -typedef void *EGLConfig; -typedef void *EGLSurface; -typedef void *EGLContext; +** Other basic EGL types: +*/ +typedef u_int8_t EGLBoolean; +typedef int32_t EGLint; + +typedef void * NativeDisplayType; +typedef int NativePixmapType; +typedef int NativeWindowType; /* - * EGL and native handle values - */ -#define EGL_DEFAULT_DISPLAY ((NativeDisplayType)0) -#define EGL_NO_CONTEXT ((EGLContext)0) -#define EGL_NO_DISPLAY ((EGLDisplay)0) -#define EGL_NO_SURFACE ((EGLSurface)0) - -#endif /* _EGLTYPES_H */ +** EGL and native handle null values: +*/ +#define EGL_DEFAULT_DISPLAY ((NativeDisplayType) 0) +#define EGL_NO_CONTEXT ((EGLContext) 0) +#define EGL_NO_DISPLAY ((EGLDisplay) 0) +#define EGL_NO_SURFACE ((EGLSurface) 0) + +/* EGL_MESA_screen_surface */ +#define EGL_NO_MODE_MESA ((EGLModeMESA) 0) -- cgit v1.2.3 From fe6ee3f5e69572fe8ea90183b2d5de7d76eecca2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 May 2005 20:00:15 +0000 Subject: EGLScreenMESA updates --- include/GLES/egl.h | 15 +++++++-------- include/GLES/egltypes.h | 1 + 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/GLES/egl.h b/include/GLES/egl.h index 0fafc25e156..64acb722a22 100644 --- a/include/GLES/egl.h +++ b/include/GLES/egl.h @@ -244,17 +244,16 @@ GLAPI EGLBoolean APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, Na #define EGL_OPTIMAL_MODE_MESA 0x4006 #define EGL_SCREEN_BIT_MESA 0x08 -GLAPI EGLBoolean APIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLint screen_number, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); -GLAPI EGLBoolean APIENTRY eglGetModesMESA(EGLDisplay dpy, EGLint screen_number, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); +GLAPI EGLBoolean APIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); +GLAPI EGLBoolean APIENTRY eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); GLAPI EGLBoolean APIENTRY eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value); +GLAPI EGLBoolean APIENTRY eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens); GLAPI EGLSurface APIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); GLAPI EGLBoolean APIENTRY eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface); -GLAPI EGLBoolean APIENTRY eglScreenModeMESA(EGLDisplay dpy, EGLint screen_number, EGLModeMESA mode); -GLAPI EGLBoolean APIENTRY eglScreenAttribsMESA(EGLDisplay dpy, EGLint screen, const EGLint *attrib_list); -GLAPI EGLBoolean APIENTRY eglQueryDisplayMESA(EGLDisplay dpy, EGLint attribute, EGLint *value); -GLAPI EGLBoolean APIENTRY eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLint screen_number, EGLSurface *surface); -GLAPI EGLBoolean APIENTRY eglQueryScreenModeMESA(EGLDisplay dpy, EGLint screen_number, EGLModeMESA *mode); -GLAPI EGLBoolean APIENTRY eglQueryScreenMESA(EGLDisplay dpy, EGLint screen_number, EGLint attribute, EGLint *value); +GLAPI EGLBoolean APIENTRY eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y); +GLAPI EGLBoolean APIENTRY eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value); +GLAPI EGLBoolean APIENTRY eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface); +GLAPI EGLBoolean APIENTRY eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode); #endif /* EGL_MESA_screen_surface */ diff --git a/include/GLES/egltypes.h b/include/GLES/egltypes.h index c81116ace21..65cba8d5793 100644 --- a/include/GLES/egltypes.h +++ b/include/GLES/egltypes.h @@ -20,6 +20,7 @@ typedef u_int32_t EGLContext; /* EGL_MESA_screen_surface */ typedef u_int32_t EGLModeMESA; +typedef u_int32_t EGLScreenMESA; /* -- cgit v1.2.3 From e4b2356c07d31fbeeabb13b2fb47db703b473080 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 May 2005 20:11:35 +0000 Subject: Major check-in of changes for GL_EXT_framebuffer_object extension. Main driver impacts: - new code for creating the Mesa GLframebuffer - new span/pixel read/write code Some drivers not yet updated/tested. --- docs/RELNOTES-6.3 | 5 +- include/GL/glfbdev.h | 5 +- progs/demos/reflect.c | 2 +- progs/tests/Makefile | 2 + progs/tests/fbotest1.c | 169 +++ progs/tests/fbotexture.c | 276 ++++ progs/tests/getprocaddress.c | 1 + src/mesa/drivers/common/driverfuncs.c | 11 +- src/mesa/drivers/dos/dmesa.c | 20 +- src/mesa/drivers/dri/common/depthtmp.h | 55 +- src/mesa/drivers/dri/common/drirenderbuffer.c | 96 ++ src/mesa/drivers/dri/common/drirenderbuffer.h | 39 + src/mesa/drivers/dri/common/spantmp.h | 54 +- src/mesa/drivers/dri/common/spantmp2.h | 105 +- src/mesa/drivers/dri/common/stenciltmp.h | 69 +- src/mesa/drivers/dri/fb/fb_dri.c | 172 ++- src/mesa/drivers/dri/ffb/ffb_clear.c | 20 +- src/mesa/drivers/dri/ffb/ffb_state.c | 4 +- src/mesa/drivers/dri/ffb/ffb_xmesa.c | 4 +- src/mesa/drivers/dri/gamma/gamma_span.c | 4 +- src/mesa/drivers/dri/gamma/gamma_state.c | 8 +- src/mesa/drivers/dri/i810/i810context.c | 25 +- src/mesa/drivers/dri/i810/i810ioctl.c | 12 +- src/mesa/drivers/dri/i810/i810screen.c | 45 + src/mesa/drivers/dri/i810/i810span.c | 53 +- src/mesa/drivers/dri/i810/i810span.h | 5 + src/mesa/drivers/dri/i810/i810state.c | 6 +- src/mesa/drivers/dri/i830/i830_context.c | 17 +- src/mesa/drivers/dri/i830/i830_ioctl.c | 28 +- src/mesa/drivers/dri/i830/i830_screen.c | 74 +- src/mesa/drivers/dri/i830/i830_span.c | 91 +- src/mesa/drivers/dri/i830/i830_span.h | 5 + src/mesa/drivers/dri/i830/i830_state.c | 8 +- src/mesa/drivers/dri/i915/i830_metaops.c | 6 +- src/mesa/drivers/dri/i915/i915_metaops.c | 6 +- src/mesa/drivers/dri/i915/intel_batchbuffer.c | 20 +- src/mesa/drivers/dri/i915/intel_context.c | 17 +- src/mesa/drivers/dri/i915/intel_ioctl.c | 26 +- src/mesa/drivers/dri/i915/intel_screen.c | 58 +- src/mesa/drivers/dri/i915/intel_span.c | 78 +- src/mesa/drivers/dri/i915/intel_span.h | 5 + src/mesa/drivers/dri/i915/intel_state.c | 6 +- src/mesa/drivers/dri/mach64/mach64_context.c | 8 +- src/mesa/drivers/dri/mach64/mach64_dd.c | 3 +- src/mesa/drivers/dri/mach64/mach64_ioctl.c | 12 +- src/mesa/drivers/dri/mach64/mach64_lock.c | 2 +- src/mesa/drivers/dri/mach64/mach64_screen.c | 50 + src/mesa/drivers/dri/mach64/mach64_span.c | 71 +- src/mesa/drivers/dri/mach64/mach64_span.h | 5 + src/mesa/drivers/dri/mach64/mach64_state.c | 10 +- src/mesa/drivers/dri/mga/mga_xmesa.c | 82 +- src/mesa/drivers/dri/mga/mga_xmesa.h | 11 + src/mesa/drivers/dri/mga/mgadd.c | 3 +- src/mesa/drivers/dri/mga/mgaioctl.c | 16 +- src/mesa/drivers/dri/mga/mgaspan.c | 59 +- src/mesa/drivers/dri/mga/mgaspan.h | 6 + src/mesa/drivers/dri/mga/mgastate.c | 6 +- src/mesa/drivers/dri/r128/r128_context.c | 8 +- src/mesa/drivers/dri/r128/r128_dd.c | 3 +- src/mesa/drivers/dri/r128/r128_ioctl.c | 16 +- src/mesa/drivers/dri/r128/r128_lock.c | 2 +- src/mesa/drivers/dri/r128/r128_screen.c | 49 + src/mesa/drivers/dri/r128/r128_span.c | 53 +- src/mesa/drivers/dri/r128/r128_span.h | 5 + src/mesa/drivers/dri/r128/r128_state.c | 8 +- src/mesa/drivers/dri/r200/r200_context.c | 15 +- src/mesa/drivers/dri/r200/r200_ioctl.c | 16 +- src/mesa/drivers/dri/r200/r200_lock.c | 4 +- src/mesa/drivers/dri/r200/r200_screen.c | 61 +- src/mesa/drivers/dri/r200/r200_span.c | 66 +- src/mesa/drivers/dri/r200/r200_span.h | 5 + src/mesa/drivers/dri/r200/r200_state.c | 6 +- src/mesa/drivers/dri/radeon/Makefile | 1 + src/mesa/drivers/dri/radeon/radeon_context.c | 13 +- src/mesa/drivers/dri/radeon/radeon_ioctl.c | 16 +- src/mesa/drivers/dri/radeon/radeon_lock.c | 4 +- src/mesa/drivers/dri/radeon/radeon_screen.c | 63 +- src/mesa/drivers/dri/radeon/radeon_screen.h | 3 - src/mesa/drivers/dri/radeon/radeon_span.c | 65 +- src/mesa/drivers/dri/radeon/radeon_span.h | 4 + src/mesa/drivers/dri/radeon/radeon_state.c | 6 +- src/mesa/drivers/dri/s3v/s3v_context.h | 2 + src/mesa/drivers/dri/s3v/s3v_dd.c | 3 +- src/mesa/drivers/dri/s3v/s3v_screen.h | 3 + src/mesa/drivers/dri/s3v/s3v_span.c | 61 +- src/mesa/drivers/dri/s3v/s3v_state.c | 6 +- src/mesa/drivers/dri/s3v/s3v_xmesa.c | 99 +- src/mesa/drivers/dri/savage/savage_init.h | 10 + src/mesa/drivers/dri/savage/savage_xmesa.c | 81 +- src/mesa/drivers/dri/savage/savagedd.c | 3 +- src/mesa/drivers/dri/savage/savageioctl.c | 16 +- src/mesa/drivers/dri/savage/savagespan.c | 74 +- src/mesa/drivers/dri/savage/savagespan.h | 9 + src/mesa/drivers/dri/savage/savagestate.c | 6 +- src/mesa/drivers/dri/sis/sis_clear.c | 38 +- src/mesa/drivers/dri/sis/sis_context.c | 8 +- src/mesa/drivers/dri/sis/sis_dd.c | 11 +- src/mesa/drivers/dri/sis/sis_screen.c | 68 + src/mesa/drivers/dri/sis/sis_span.c | 74 +- src/mesa/drivers/dri/sis/sis_span.h | 6 + src/mesa/drivers/dri/sis/sis_state.c | 6 +- src/mesa/drivers/dri/sis/sis_tris.c | 2 +- src/mesa/drivers/dri/tdfx/tdfx_context.c | 14 +- src/mesa/drivers/dri/tdfx/tdfx_dd.c | 3 +- src/mesa/drivers/dri/tdfx/tdfx_pixels.c | 4 +- src/mesa/drivers/dri/tdfx/tdfx_render.c | 40 +- src/mesa/drivers/dri/tdfx/tdfx_screen.c | 58 +- src/mesa/drivers/dri/tdfx/tdfx_span.c | 146 +- src/mesa/drivers/dri/tdfx/tdfx_span.h | 4 + src/mesa/drivers/dri/tdfx/tdfx_state.c | 10 +- src/mesa/drivers/dri/trident/trident_context.c | 74 +- src/mesa/drivers/dri/trident/trident_context.h | 10 + src/mesa/drivers/dri/trident/trident_dd.c | 3 +- src/mesa/drivers/dri/trident/trident_state.c | 15 +- src/mesa/drivers/dri/unichrome/via_context.c | 26 +- src/mesa/drivers/dri/unichrome/via_context.h | 2 +- src/mesa/drivers/dri/unichrome/via_ioctl.c | 20 +- src/mesa/drivers/dri/unichrome/via_screen.c | 68 +- src/mesa/drivers/dri/unichrome/via_screen.h | 1 + src/mesa/drivers/dri/unichrome/via_span.c | 64 +- src/mesa/drivers/dri/unichrome/via_span.h | 5 + src/mesa/drivers/fbdev/glfbdev.c | 413 +++--- src/mesa/drivers/glide/fxdd.c | 6 - src/mesa/drivers/osmesa/osmesa.c | 472 +++--- src/mesa/drivers/svga/svgamesa8.c | 22 +- src/mesa/drivers/x11/fakeglx.c | 32 +- src/mesa/drivers/x11/glxheader.h | 1 - src/mesa/drivers/x11/xm_api.c | 378 ++--- src/mesa/drivers/x11/xm_buffer.c | 111 ++ src/mesa/drivers/x11/xm_dd.c | 745 +++++----- src/mesa/drivers/x11/xm_line.c | 129 +- src/mesa/drivers/x11/xm_span.c | 966 +++++++++--- src/mesa/drivers/x11/xm_tri.c | 337 +++-- src/mesa/drivers/x11/xmesaP.h | 117 +- src/mesa/main/accum.c | 19 +- src/mesa/main/attrib.c | 7 + src/mesa/main/blend.c | 2 - src/mesa/main/bufferobj.c | 2 +- src/mesa/main/buffers.c | 548 ++++--- src/mesa/main/buffers.h | 7 +- src/mesa/main/config.h | 13 +- src/mesa/main/context.c | 241 +-- src/mesa/main/context.h | 36 +- src/mesa/main/dd.h | 15 +- src/mesa/main/depth.c | 5 +- src/mesa/main/dlist.c | 13 +- src/mesa/main/enable.c | 21 +- src/mesa/main/extensions.c | 2 +- src/mesa/main/fbobject.c | 379 +++-- src/mesa/main/fbobject.h | 141 +- src/mesa/main/framebuffer.c | 513 +++++++ src/mesa/main/framebuffer.h | 67 + src/mesa/main/get.c | 114 +- src/mesa/main/get_gen.py | 54 +- src/mesa/main/matrix.c | 16 +- src/mesa/main/mtypes.h | 297 ++-- src/mesa/main/pixel.c | 2 - src/mesa/main/polygon.c | 3 +- src/mesa/main/rastpos.c | 2 +- src/mesa/main/renderbuffer.c | 1863 ++++++++++++++++++++++++ src/mesa/main/renderbuffer.h | 84 ++ src/mesa/main/state.c | 4 + src/mesa/main/texformat.c | 67 +- src/mesa/main/texformat_tmp.h | 730 ++++++++-- src/mesa/main/texrender.c | 197 +++ src/mesa/main/texrender.h | 12 + src/mesa/main/texstore.c | 31 +- src/mesa/sources | 10 +- src/mesa/swrast/s_accum.c | 802 +++++----- src/mesa/swrast/s_accum.h | 11 +- src/mesa/swrast/s_alphabuf.c | 332 ----- src/mesa/swrast/s_alphabuf.h | 80 - src/mesa/swrast/s_auxbuffer.c | 129 -- src/mesa/swrast/s_auxbuffer.h | 41 - src/mesa/swrast/s_blend.c | 26 +- src/mesa/swrast/s_blend.h | 12 +- src/mesa/swrast/s_buffers.c | 370 +++-- src/mesa/swrast/s_context.c | 35 +- src/mesa/swrast/s_context.h | 3 - src/mesa/swrast/s_copypix.c | 82 +- src/mesa/swrast/s_depth.c | 912 +++--------- src/mesa/swrast/s_depth.h | 22 +- src/mesa/swrast/s_drawpix.c | 128 +- src/mesa/swrast/s_feedback.c | 13 +- src/mesa/swrast/s_imaging.c | 34 +- src/mesa/swrast/s_linetemp.h | 3 +- src/mesa/swrast/s_logic.c | 588 +++----- src/mesa/swrast/s_logic.h | 13 +- src/mesa/swrast/s_masking.c | 80 +- src/mesa/swrast/s_masking.h | 23 +- src/mesa/swrast/s_nvfragprog.c | 10 +- src/mesa/swrast/s_readpix.c | 91 +- src/mesa/swrast/s_span.c | 459 +++--- src/mesa/swrast/s_span.h | 6 +- src/mesa/swrast/s_spantemp.h | 117 +- src/mesa/swrast/s_stencil.c | 417 ++---- src/mesa/swrast/s_stencil.h | 16 +- src/mesa/swrast/s_texstore.c | 8 +- src/mesa/swrast/s_triangle.c | 28 +- src/mesa/swrast/s_tritemp.h | 9 +- src/mesa/swrast/swrast.h | 87 +- src/mesa/swrast_setup/ss_tritmp.h | 2 +- src/mesa/tnl_dd/t_dd_tritmp.h | 9 +- 203 files changed, 11646 insertions(+), 6299 deletions(-) create mode 100644 progs/tests/fbotest1.c create mode 100644 progs/tests/fbotexture.c create mode 100644 src/mesa/drivers/dri/common/drirenderbuffer.c create mode 100644 src/mesa/drivers/dri/common/drirenderbuffer.h create mode 100644 src/mesa/drivers/x11/xm_buffer.c create mode 100644 src/mesa/main/framebuffer.c create mode 100644 src/mesa/main/framebuffer.h create mode 100644 src/mesa/main/renderbuffer.c create mode 100644 src/mesa/main/renderbuffer.h create mode 100644 src/mesa/main/texrender.c create mode 100644 src/mesa/main/texrender.h delete mode 100644 src/mesa/swrast/s_alphabuf.c delete mode 100644 src/mesa/swrast/s_alphabuf.h delete mode 100644 src/mesa/swrast/s_auxbuffer.c delete mode 100644 src/mesa/swrast/s_auxbuffer.h (limited to 'include') diff --git a/docs/RELNOTES-6.3 b/docs/RELNOTES-6.3 index d7e7af09409..ee55e3a50cb 100644 --- a/docs/RELNOTES-6.3 +++ b/docs/RELNOTES-6.3 @@ -27,6 +27,9 @@ GL_OES_read_format - allows one to query the fastest glReadPixels format GL_ARB_pixel_buffer_object - buffer objects for pixel read/write functions. +GL_EXT_framebuffer_object - allows render-to-texture and provides a + window-system indepedent Pbuffer facility + DirectFB driver, contributed by Claudio Ciccani. See docs/README.directfb for details. @@ -94,4 +97,4 @@ D3D needs updating ---------------------------------------------------------------------- -$Id: RELNOTES-6.3,v 3.8 2005/01/20 04:03:37 brianp Exp $ +$Id: RELNOTES-6.3,v 3.9 2005/05/04 20:11:35 brianp Exp $ diff --git a/include/GL/glfbdev.h b/include/GL/glfbdev.h index cd6cdd5e51f..6af3ac31427 100644 --- a/include/GL/glfbdev.h +++ b/include/GL/glfbdev.h @@ -62,7 +62,10 @@ extern const char * glFBDevGetString( int str ); -extern const void * +typedef void (*GLFBDevProc)(); + + +extern const GLFBDevProc glFBDevGetProcAddress( const char *procName ); diff --git a/progs/demos/reflect.c b/progs/demos/reflect.c index d259d7b7188..bf6d91aaad3 100644 --- a/progs/demos/reflect.c +++ b/progs/demos/reflect.c @@ -389,7 +389,7 @@ static void SpecialKey( int key, int x, int y ) int main( int argc, char *argv[] ) { glutInit(&argc, argv); - glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL); + glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL | GLUT_ALPHA); glutInitWindowPosition( 0, 0 ); glutInitWindowSize( Width, Height ); glutCreateWindow(argv[0]); diff --git a/progs/tests/Makefile b/progs/tests/Makefile index c1218b1ca9c..4d3d2696b8b 100644 --- a/progs/tests/Makefile +++ b/progs/tests/Makefile @@ -26,6 +26,8 @@ SOURCES = antialias.c \ cva.c \ dinoshade.c \ floattex.c \ + fbotest1.c \ + fbotexture.c \ fogcoord.c \ fptest1.c \ fptexture.c \ diff --git a/progs/tests/fbotest1.c b/progs/tests/fbotest1.c new file mode 100644 index 00000000000..1b710041786 --- /dev/null +++ b/progs/tests/fbotest1.c @@ -0,0 +1,169 @@ +/* + * Test GL_EXT_framebuffer_object + * + * Brian Paul + * 7 Feb 2005 + */ + + +#define GL_GLEXT_PROTOTYPES +#include +#include +#include +#include +#include + +static int Width = 400, Height = 400; +static GLuint MyFB; + + +static void +CheckError(int line) +{ + GLenum err = glGetError(); + if (err) { + printf("GL Error 0x%x at line %d\n", (int) err, line); + } +} + + +static void +Display( void ) +{ + GLubyte *buffer = malloc(Width * Height * 4); + GLenum status; + + /* draw to user framebuffer */ + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB); + glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT); + glReadBuffer(GL_COLOR_ATTACHMENT1_EXT); + + status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { + printf("Framebuffer incomplete!!!\n"); + } + + glClearColor(0.5, 0.5, 1.0, 0.0); + glClear( GL_COLOR_BUFFER_BIT ); + + glBegin(GL_POLYGON); + glColor3f(1, 0, 0); + glVertex2f(-1, -1); + glColor3f(0, 1, 0); + glVertex2f(1, -1); + glColor3f(0, 0, 1); + glVertex2f(0, 1); + glEnd(); + + /* read from user framebuffer */ + glReadPixels(0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer); + + /* draw to window */ + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + glWindowPos2iARB(0, 0); + glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer); + + free(buffer); + glutSwapBuffers(); +} + + +static void +Reshape( int width, int height ) +{ + float ar = (float) width / (float) height; + glViewport( 0, 0, width, height ); + glMatrixMode( GL_PROJECTION ); + glLoadIdentity(); +#if 0 + glFrustum( -ar, ar, -1.0, 1.0, 5.0, 25.0 ); +#else + glOrtho(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0 ); +#endif + glMatrixMode( GL_MODELVIEW ); + glLoadIdentity(); + glTranslatef( 0.0, 0.0, -15.0 ); + Width = width; + Height = height; + glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height); +} + + +static void +Key( unsigned char key, int x, int y ) +{ + (void) x; + (void) y; + switch (key) { + case 27: + exit(0); + break; + } + glutPostRedisplay(); +} + + +static void +Init( void ) +{ + GLuint rb; + GLint i; + + if (!glutExtensionSupported("GL_EXT_framebuffer_object")) { + printf("GL_EXT_framebuffer_object not found!\n"); + /*exit(0);*/ + } + printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); + + glGenFramebuffersEXT(1, &MyFB); + assert(MyFB); + assert(glIsFramebufferEXT(MyFB)); + glDeleteFramebuffersEXT(1, &MyFB); + assert(!glIsFramebufferEXT(MyFB)); + /* Note, continue to use MyFB below */ + + glGenRenderbuffersEXT(1, &rb); + assert(rb); + assert(glIsRenderbufferEXT(rb)); + glDeleteRenderbuffersEXT(1, &rb); + assert(!glIsRenderbufferEXT(rb)); + rb = 42; /* an arbitrary ID */ + + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB); + assert(glIsFramebufferEXT(MyFB)); + glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb); + assert(glIsRenderbufferEXT(rb)); + + glGetIntegerv(GL_RENDERBUFFER_BINDING_EXT, &i); + assert(i == rb); + + glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &i); + assert(i == MyFB); + + glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, + GL_RENDERBUFFER_EXT, rb); + + glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height); + + CheckError(__LINE__); + + /* restore to default */ + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); +} + + +int +main( int argc, char *argv[] ) +{ + glutInit( &argc, argv ); + glutInitWindowPosition( 0, 0 ); + glutInitWindowSize(Width, Height); + glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); + glutCreateWindow(argv[0]); + glutReshapeFunc( Reshape ); + glutKeyboardFunc( Key ); + glutDisplayFunc( Display ); + Init(); + glutMainLoop(); + return 0; +} diff --git a/progs/tests/fbotexture.c b/progs/tests/fbotexture.c new file mode 100644 index 00000000000..dc347423aae --- /dev/null +++ b/progs/tests/fbotexture.c @@ -0,0 +1,276 @@ +/* + * Test GL_EXT_framebuffer_object render-to-texture + * + * Draw a teapot into a texture image with stenciling. + * Then draw a textured quad using that texture. + * + * Brian Paul + * 18 Apr 2005 + */ + + +#define GL_GLEXT_PROTOTYPES +#include +#include +#include +#include +#include + +static int Width = 400, Height = 400; +static int TexWidth = 512, TexHeight = 512; +static GLuint MyFB; +static GLuint TexObj; +static GLuint DepthRB, StencilRB; +static GLboolean Anim = GL_FALSE; +static GLfloat Rot = 0.0; + + +static void +CheckError(int line) +{ + GLenum err = glGetError(); + if (err) { + printf("GL Error 0x%x at line %d\n", (int) err, line); + } +} + + +static void +Idle(void) +{ + Rot = glutGet(GLUT_ELAPSED_TIME) * 0.05; + glutPostRedisplay(); +} + + +static void +RenderTexture(void) +{ + GLint level = 0; + GLenum status; + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0, 0.0, -15.0); + + /* draw to texture */ + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB); + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, + GL_TEXTURE_2D, TexObj, level); + + status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { + printf("Framebuffer incomplete!!!\n"); + } + + glViewport(0, 0, TexWidth, TexHeight); + + glClearColor(0.5, 0.5, 1.0, 0.0); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + + glEnable(GL_DEPTH_TEST); + glEnable(GL_STENCIL_TEST); + glStencilFunc(GL_NEVER, 1, ~0); + glStencilOp(GL_REPLACE, GL_KEEP, GL_REPLACE); + + /* draw diamond-shaped stencil pattern */ + glColor3f(0, 1, 0); + glBegin(GL_POLYGON); + glVertex2f(-0.2, 0.0); + glVertex2f( 0.0, -0.2); + glVertex2f( 0.2, 0.0); + glVertex2f( 0.0, 0.2); + glEnd(); + + /* draw teapot where stencil != 1 */ + glStencilFunc(GL_NOTEQUAL, 1, ~0); + glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); + +#if 0 + glBegin(GL_POLYGON); + glColor3f(1, 0, 0); + glVertex2f(-1, -1); + glColor3f(0, 1, 0); + glVertex2f(1, -1); + glColor3f(0, 0, 1); + glVertex2f(0, 1); + glEnd(); +#else + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glPushMatrix(); + glRotatef(0.5 * Rot, 1.0, 0.0, 0.0); + glutSolidTeapot(0.5); + glPopMatrix(); + glDisable(GL_LIGHTING); +#endif + glDisable(GL_DEPTH_TEST); + glDisable(GL_STENCIL_TEST); + + /* Bind normal framebuffer */ + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + + CheckError(__LINE__); +} + + + +static void +Display(void) +{ + float ar = (float) Width / (float) Height; + + RenderTexture(); + + /* draw textured quad in the window */ + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0, 0.0, -7.0); + + glViewport(0, 0, Width, Height); + + glClearColor(0.25, 0.25, 0.25, 0); + glClear(GL_COLOR_BUFFER_BIT); + + glPushMatrix(); + glRotatef(Rot, 0, 1, 0); + glEnable(GL_TEXTURE_2D); + glBegin(GL_POLYGON); + glColor3f(0.25, 0.25, 0.25); + glTexCoord2f(0, 0); + glVertex2f(-1, -1); + glTexCoord2f(1, 0); + glVertex2f(1, -1); + glColor3f(1.0, 1.0, 1.0); + glTexCoord2f(1, 1); + glVertex2f(1, 1); + glTexCoord2f(0, 1); + glVertex2f(-1, 1); + glEnd(); + glPopMatrix(); + glDisable(GL_TEXTURE_2D); + + glutSwapBuffers(); + CheckError(__LINE__); +} + + +static void +Reshape(int width, int height) +{ + glViewport(0, 0, width, height); + Width = width; + Height = height; +} + + +static void +Key(unsigned char key, int x, int y) +{ + (void) x; + (void) y; + switch (key) { + case 'a': + Anim = !Anim; + if (Anim) + glutIdleFunc(Idle); + else + glutIdleFunc(NULL); + break; + case 27: + exit(0); + break; + } + glutPostRedisplay(); +} + + +static void +Init(void) +{ + GLint i; + + if (!glutExtensionSupported("GL_EXT_framebuffer_object")) { + printf("GL_EXT_framebuffer_object not found!\n"); + exit(0); + } + printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); + + /* make framebuffer */ + glGenFramebuffersEXT(1, &MyFB); + assert(MyFB); + assert(glIsFramebufferEXT(MyFB)); + glDeleteFramebuffersEXT(1, &MyFB); + assert(!glIsFramebufferEXT(MyFB)); + /* Note, continue to use MyFB below */ + + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB); + assert(glIsFramebufferEXT(MyFB)); + glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &i); + assert(i == MyFB); + + /* make depth renderbuffer */ + glGenRenderbuffersEXT(1, &DepthRB); + assert(DepthRB); + assert(glIsRenderbufferEXT(DepthRB)); + glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRB); + glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, + TexWidth, TexHeight); + + /* make stencil renderbuffer */ + glGenRenderbuffersEXT(1, &StencilRB); + assert(StencilRB); + assert(glIsRenderbufferEXT(StencilRB)); + glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, StencilRB); + glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX, + TexWidth, TexHeight); + + /* attach DepthRB to MyFB */ + glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, + GL_RENDERBUFFER_EXT, DepthRB); + + /* attach StencilRB to MyFB */ + glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, + GL_RENDERBUFFER_EXT, StencilRB); + + + /* bind regular framebuffer */ + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + + /* Make texture object/image */ + glGenTextures(1, &TexObj); + glBindTexture(GL_TEXTURE_2D, TexObj); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TexWidth, TexHeight, 0, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + + CheckError(__LINE__); +} + + +int +main(int argc, char *argv[]) +{ + glutInit(&argc, argv); + glutInitWindowPosition(0, 0); + glutInitWindowSize(Width, Height); + glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); + glutCreateWindow(argv[0]); + glutReshapeFunc(Reshape); + glutKeyboardFunc(Key); + glutDisplayFunc(Display); + if (Anim) + glutIdleFunc(Idle); + Init(); + glutMainLoop(); + return 0; +} diff --git a/progs/tests/getprocaddress.c b/progs/tests/getprocaddress.c index 702255285d1..2480ed44cc7 100644 --- a/progs/tests/getprocaddress.c +++ b/progs/tests/getprocaddress.c @@ -288,6 +288,7 @@ check_functions( const char *extensions ) for (entry = functions; entry->name; entry++) { if (entry->name[0] == '-') { + /* XXX update for OpenGL 2.0 */ if (entry->name[1] == '1') { /* check GL version X.Y */ const char *version = (const char *) glGetString(GL_VERSION); diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 69cc9195689..dcaaa9199f5 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -27,7 +27,9 @@ #include "imports.h" #include "buffers.h" #include "context.h" +#include "framebuffer.h" #include "program.h" +#include "renderbuffer.h" #include "texcompress.h" #include "texformat.h" #include "teximage.h" @@ -38,6 +40,7 @@ #endif #if FEATURE_EXT_framebuffer_object #include "fbobject.h" +#include "texrender.h" #endif #include "driverfuncs.h" @@ -62,7 +65,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->GetString = NULL; /* REQUIRED! */ driver->UpdateState = NULL; /* REQUIRED! */ driver->GetBufferSize = NULL; /* REQUIRED! */ - driver->ResizeBuffers = _swrast_alloc_buffers; + driver->ResizeBuffers = _mesa_resize_framebuffer; driver->Error = NULL; driver->Finish = NULL; @@ -134,7 +137,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->ColorMaterial = NULL; driver->CullFace = NULL; driver->DrawBuffer = _swrast_DrawBuffer; - driver->DrawBuffers = _swrast_DrawBuffers; + driver->DrawBuffers = NULL; /***_swrast_DrawBuffers;***/ driver->FrontFace = NULL; driver->DepthFunc = NULL; driver->DepthMask = NULL; @@ -200,7 +203,9 @@ _mesa_init_driver_functions(struct dd_function_table *driver) #if FEATURE_EXT_framebuffer_object driver->NewFramebuffer = _mesa_new_framebuffer; - driver->NewRenderbuffer = _mesa_new_renderbuffer; + driver->NewRenderbuffer = _mesa_new_soft_renderbuffer; + driver->RenderbufferTexture = _mesa_renderbuffer_texture; + driver->FramebufferRenderbuffer = _mesa_framebuffer_renderbuffer; #endif /* T&L stuff */ diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index 9688dd95b26..d7c84770914 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -278,7 +278,8 @@ read_rgba_pixels (const GLcontext *ctx, * Index ***************************************************************************/ static void -write_index_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, +write_index_span (const GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, const GLuint index[], const GLubyte mask[]) { const DMesaContext dmesa = (DMesaContext)ctx; @@ -302,7 +303,8 @@ write_index_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, static void -write_index8_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, +write_index8_span (const GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, const GLubyte index[], const GLubyte mask[]) { const DMesaContext dmesa = (DMesaContext)ctx; @@ -326,7 +328,7 @@ write_index8_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, static void -write_mono_index_span (const GLcontext *ctx, +write_mono_index_span (const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, GLuint colorIndex, const GLubyte mask[]) { @@ -351,8 +353,8 @@ write_mono_index_span (const GLcontext *ctx, static void -read_index_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, - GLuint index[]) +read_index_span (const GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, GLuint index[]) { const DMesaContext dmesa = (DMesaContext)ctx; GLuint i, offset; @@ -366,7 +368,7 @@ read_index_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, static void -write_index_pixels (const GLcontext *ctx, +write_index_pixels (const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], const GLuint index[], const GLubyte mask[]) { @@ -390,7 +392,7 @@ write_index_pixels (const GLcontext *ctx, static void -write_mono_index_pixels (const GLcontext *ctx, +write_mono_index_pixels (const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], GLuint colorIndex, const GLubyte mask[]) { @@ -414,9 +416,9 @@ write_mono_index_pixels (const GLcontext *ctx, static void -read_index_pixels (const GLcontext *ctx, +read_index_pixels (const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], - GLuint index[], const GLubyte mask[]) + GLuint index[], const GLubyte mask[]) { const DMesaContext dmesa = (DMesaContext)ctx; GLuint i, _w_ = DSTRIDE, _b_ = dmesa->buffer->height - 1; diff --git a/src/mesa/drivers/dri/common/depthtmp.h b/src/mesa/drivers/dri/common/depthtmp.h index ad26e6b8914..74273165e45 100644 --- a/src/mesa/drivers/dri/common/depthtmp.h +++ b/src/mesa/drivers/dri/common/depthtmp.h @@ -1,5 +1,13 @@ /* $XFree86: xc/lib/GL/mesa/src/drv/common/depthtmp.h,v 1.5 2001/03/21 16:14:20 dawes Exp $ */ +/* + * Notes: + * 1. These functions plug into the gl_renderbuffer structure. + * 2. The 'values' parameter always points to GLuint values, regardless of + * the actual Z buffer depth. + */ + + #ifndef DBG #define DBG 0 #endif @@ -20,12 +28,14 @@ #endif static void TAG(WriteDepthSpan)( GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLdepth *depth, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *values, const GLubyte mask[] ) { HW_WRITE_LOCK() { + const GLuint *depth = (const GLuint *) values; GLint x1; GLint n1; LOCAL_DEPTH_VARS; @@ -64,14 +74,31 @@ static void TAG(WriteDepthSpan)( GLcontext *ctx, HW_WRITE_UNLOCK(); } -#if !HAVE_HW_DEPTH_SPANS + +#if HAVE_HW_DEPTH_SPANS +/* implement MonoWriteDepthSpan() in terms of WriteDepthSpan() */ +static void +TAG(WriteMonoDepthSpan)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *value, const GLubyte mask[] ) +{ + const GLuint depthVal = *((GLuint *) value); + GLuint depths[MAX_WIDTH]; + GLuint i; + for (i = 0; i < n; i++) + depths[i] = depthVal; + TAG(WriteDepthSpan)(ctx, rb, n, x, y, depths, mask); +} +#else static void TAG(WriteMonoDepthSpan)( GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLdepth depth, - const GLubyte mask[] ) + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *value, + const GLubyte mask[] ) { HW_WRITE_LOCK() { + const GLuint depth = *((GLuint *) value); GLint x1; GLint n1; LOCAL_DEPTH_VARS; @@ -102,15 +129,18 @@ static void TAG(WriteMonoDepthSpan)( GLcontext *ctx, } #endif + static void TAG(WriteDepthPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], - const GLdepth depth[], + const void *values, const GLubyte mask[] ) { HW_WRITE_LOCK() { + const GLuint *depth = (const GLuint *) values; GLuint i; LOCAL_DEPTH_VARS; @@ -141,11 +171,13 @@ static void TAG(WriteDepthPixels)( GLcontext *ctx, /* Read depth spans and pixels */ static void TAG(ReadDepthSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - GLdepth depth[] ) + void *values ) { HW_READ_LOCK() { + GLuint *depth = (GLuint *) values; GLint x1, n1; LOCAL_DEPTH_VARS; @@ -172,12 +204,15 @@ static void TAG(ReadDepthSpan)( GLcontext *ctx, HW_READ_UNLOCK(); } -static void TAG(ReadDepthPixels)( GLcontext *ctx, GLuint n, +static void TAG(ReadDepthPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], - GLdepth depth[] ) + void *values ) { HW_READ_LOCK() { + GLuint *depth = (GLuint *) values; GLuint i; LOCAL_DEPTH_VARS; diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.c b/src/mesa/drivers/dri/common/drirenderbuffer.c new file mode 100644 index 00000000000..3d9574f0cf2 --- /dev/null +++ b/src/mesa/drivers/dri/common/drirenderbuffer.c @@ -0,0 +1,96 @@ + +#include "mtypes.h" +#include "drirenderbuffer.h" +#include "renderbuffer.h" +#include "imports.h" + + +/** + * This will get called when a window is resized. + * Just update width, height and internal format fields for now. + */ +static GLboolean +driRenderbufferStorage(GLcontext *ctx, struct gl_renderbuffer *rb, + GLenum internalFormat, GLuint width, GLuint height) +{ + rb->Width = width; + rb->Height = height; + rb->InternalFormat = internalFormat; + return GL_TRUE; +} + + +/** + * Allocate a new driRenderbuffer object. + * Individual drivers are free to implement different versions of + * this function. + * \param format Either GL_RGBA, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24, + * GL_DEPTH_COMPONENT32, or GL_STENCIL_INDEX8_EXT (for now). + * \param cpp chars or bytes per pixel + * \param offset start of buffer with respect to framebuffer address + * \param pitch pixels per row + */ +driRenderbuffer * +driNewRenderbuffer(GLenum format, GLint cpp, GLint offset, GLint pitch) +{ + driRenderbuffer *drb; + + assert(format == GL_RGBA || + format == GL_DEPTH_COMPONENT16 || + format == GL_DEPTH_COMPONENT24 || + format == GL_DEPTH_COMPONENT32 || + format == GL_STENCIL_INDEX8_EXT); + + assert(cpp > 0); + assert(pitch > 0); + + drb = _mesa_calloc(sizeof(driRenderbuffer)); + if (drb) { + const GLuint name = 0; + + _mesa_init_renderbuffer(&drb->Base, name); + + /* Make sure we're using a null-valued GetPointer routine */ + assert(drb->Base.GetPointer(NULL, &drb->Base, 0, 0) == NULL); + + drb->Base.InternalFormat = format; + + if (format == GL_RGBA) { + /* Color */ + drb->Base._BaseFormat = GL_RGBA; + drb->Base.DataType = GL_UNSIGNED_BYTE; + } + else if (format == GL_DEPTH_COMPONENT16) { + /* Depth */ + drb->Base._BaseFormat = GL_DEPTH_COMPONENT; + /* we always Get/Put 32-bit Z values */ + drb->Base.DataType = GL_UNSIGNED_INT; + } + else if (format == GL_DEPTH_COMPONENT24) { + /* Depth */ + drb->Base._BaseFormat = GL_DEPTH_COMPONENT; + /* we always Get/Put 32-bit Z values */ + drb->Base.DataType = GL_UNSIGNED_INT; + } + else { + /* Stencil */ + ASSERT(format == GL_STENCIL_INDEX8); + drb->Base._BaseFormat = GL_STENCIL_INDEX; + drb->Base.DataType = GL_UNSIGNED_BYTE; + } + + /* XXX if we were allocating a user-created renderbuffer, we'd have + * to fill in the ComponentSizes[] array too. + */ + + drb->Base.AllocStorage = driRenderbufferStorage; + /* using default Delete function */ + + + /* DRI renderbuffer-specific fields: */ + drb->offset = offset; + drb->pitch = pitch; + drb->cpp = cpp; + } + return drb; +} diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.h b/src/mesa/drivers/dri/common/drirenderbuffer.h new file mode 100644 index 00000000000..627f1d41d98 --- /dev/null +++ b/src/mesa/drivers/dri/common/drirenderbuffer.h @@ -0,0 +1,39 @@ + +/** + * A driRenderbuffer is dervied from gl_renderbuffer. + * It describes a color buffer (front or back), a depth buffer, or stencil + * buffer etc. + * Specific to DRI drivers are the offset and pitch fields. + */ + + +#ifndef DRIRENDERBUFFER_H +#define DRIRENDERBUFFER_H + +#include "mtypes.h" + +typedef struct { + struct gl_renderbuffer Base; + + /* Chars or bytes per pixel. If Z and Stencil are stored together this + * will typically be 32 whether this a depth or stencil renderbuffer. + */ + GLint cpp; + + /* Buffer position and pitch (row stride). Recall that for today's DRI + * drivers, we have statically allocated color/depth/stencil buffers. + * So this information describes the whole screen, not just a window. + * To address pixels in a window, we need to know the window's position + * and size with respect to the screen. + */ + GLint offset; /* in bytes */ + GLint pitch; /* in pixels */ + +} driRenderbuffer; + + +driRenderbuffer * +driNewRenderbuffer(GLenum format, GLint cpp, GLint offset, GLint pitch); + + +#endif /* DRIRENDERBUFFER_H */ diff --git a/src/mesa/drivers/dri/common/spantmp.h b/src/mesa/drivers/dri/common/spantmp.h index 96f26333fcb..b15bbb25776 100644 --- a/src/mesa/drivers/dri/common/spantmp.h +++ b/src/mesa/drivers/dri/common/spantmp.h @@ -56,13 +56,14 @@ #endif -static void TAG(WriteRGBASpan)( const GLcontext *ctx, +static void TAG(WriteRGBASpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLubyte rgba[][4], - const GLubyte mask[] ) + const void *values, const GLubyte mask[] ) { HW_WRITE_LOCK() { + const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; GLint x1; GLint n1; LOCAL_VARS; @@ -98,13 +99,14 @@ static void TAG(WriteRGBASpan)( const GLcontext *ctx, HW_WRITE_UNLOCK(); } -static void TAG(WriteRGBSpan)( const GLcontext *ctx, +static void TAG(WriteRGBSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLubyte rgb[][3], - const GLubyte mask[] ) + const void *values, const GLubyte mask[] ) { HW_WRITE_LOCK() { + const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) values; GLint x1; GLint n1; LOCAL_VARS; @@ -136,15 +138,14 @@ static void TAG(WriteRGBSpan)( const GLcontext *ctx, HW_WRITE_UNLOCK(); } -static void TAG(WriteRGBAPixels)( const GLcontext *ctx, - GLuint n, - const GLint x[], - const GLint y[], - const GLubyte rgba[][4], - const GLubyte mask[] ) +static void TAG(WriteRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + const void *values, const GLubyte mask[] ) { HW_WRITE_LOCK() { + const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; GLuint i; LOCAL_VARS; @@ -183,13 +184,15 @@ static void TAG(WriteRGBAPixels)( const GLcontext *ctx, } -static void TAG(WriteMonoRGBASpan)( const GLcontext *ctx, +static void TAG(WriteMonoRGBASpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLchan color[4], + const void *value, const GLubyte mask[] ) { HW_WRITE_LOCK() { + const GLubyte *color = (const GLubyte *) value; GLint x1; GLint n1; LOCAL_VARS; @@ -221,14 +224,16 @@ static void TAG(WriteMonoRGBASpan)( const GLcontext *ctx, } -static void TAG(WriteMonoRGBAPixels)( const GLcontext *ctx, +static void TAG(WriteMonoRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, GLuint n, - const GLint x[], const GLint y[], - const GLchan color[], - const GLubyte mask[] ) + const GLint x[], const GLint y[], + const void *value, + const GLubyte mask[] ) { HW_WRITE_LOCK() { + const GLubyte *color = (const GLubyte *) value; GLuint i; LOCAL_VARS; INIT_MONO_PIXEL(p, color); @@ -261,12 +266,14 @@ static void TAG(WriteMonoRGBAPixels)( const GLcontext *ctx, } -static void TAG(ReadRGBASpan)( const GLcontext *ctx, +static void TAG(ReadRGBASpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - GLubyte rgba[][4]) + void *values) { HW_READ_LOCK() { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; GLint x1,n1; LOCAL_VARS; @@ -287,12 +294,15 @@ static void TAG(ReadRGBASpan)( const GLcontext *ctx, } -static void TAG(ReadRGBAPixels)( const GLcontext *ctx, +static void TAG(ReadRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], - GLubyte rgba[][4], const GLubyte mask[] ) + void *values ) { HW_READ_LOCK() { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; + const GLubyte *mask = NULL; /* remove someday */ GLuint i; LOCAL_VARS; diff --git a/src/mesa/drivers/dri/common/spantmp2.h b/src/mesa/drivers/dri/common/spantmp2.h index fa737a9623f..e15491d1add 100644 --- a/src/mesa/drivers/dri/common/spantmp2.h +++ b/src/mesa/drivers/dri/common/spantmp2.h @@ -145,13 +145,14 @@ #include "x86/common_x86_asm.h" #endif -static void TAG(WriteRGBASpan)( const GLcontext *ctx, +static void TAG(WriteRGBASpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLubyte rgba[][4], - const GLubyte mask[] ) + const void *values, const GLubyte mask[] ) { HW_WRITE_LOCK() { + const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; GLint x1; GLint n1; LOCAL_VARS; @@ -187,13 +188,14 @@ static void TAG(WriteRGBASpan)( const GLcontext *ctx, HW_WRITE_UNLOCK(); } -static void TAG(WriteRGBSpan)( const GLcontext *ctx, +static void TAG(WriteRGBSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLubyte rgb[][3], - const GLubyte mask[] ) + const void *values, const GLubyte mask[] ) { HW_WRITE_LOCK() { + const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) values; GLint x1; GLint n1; LOCAL_VARS; @@ -225,15 +227,14 @@ static void TAG(WriteRGBSpan)( const GLcontext *ctx, HW_WRITE_UNLOCK(); } -static void TAG(WriteRGBAPixels)( const GLcontext *ctx, - GLuint n, - const GLint x[], - const GLint y[], - const GLubyte rgba[][4], - const GLubyte mask[] ) +static void TAG(WriteRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + const void *values, const GLubyte mask[] ) { HW_WRITE_LOCK() { + const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; GLint i; LOCAL_VARS; @@ -272,13 +273,14 @@ static void TAG(WriteRGBAPixels)( const GLcontext *ctx, } -static void TAG(WriteMonoRGBASpan)( const GLcontext *ctx, +static void TAG(WriteMonoRGBASpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLchan color[4], - const GLubyte mask[] ) + const void *value, const GLubyte mask[] ) { HW_WRITE_LOCK() { + const GLubyte *color = (const GLubyte *) value; GLint x1; GLint n1; LOCAL_VARS; @@ -310,14 +312,16 @@ static void TAG(WriteMonoRGBASpan)( const GLcontext *ctx, } -static void TAG(WriteMonoRGBAPixels)( const GLcontext *ctx, +static void TAG(WriteMonoRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], - const GLchan color[], + const void *value, const GLubyte mask[] ) { HW_WRITE_LOCK() { + const GLubyte *color = (const GLubyte *) value; GLint i; LOCAL_VARS; INIT_MONO_PIXEL(p, color); @@ -350,12 +354,13 @@ static void TAG(WriteMonoRGBAPixels)( const GLcontext *ctx, } -static void TAG(ReadRGBASpan)( const GLcontext *ctx, - GLuint n, GLint x, GLint y, - GLubyte rgba[][4]) +static void TAG(ReadRGBASpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, void *values) { HW_READ_LOCK() { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; GLint x1,n1; LOCAL_VARS; @@ -381,9 +386,9 @@ static void TAG(ReadRGBASpan)( const GLcontext *ctx, (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)) || \ ((SPANTMP_PIXEL_FMT == GL_RGB) && \ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5))) -static void TAG2(ReadRGBASpan,_MMX)( const GLcontext *ctx, - GLuint n, GLint x, GLint y, - GLubyte rgba[][4]) +static void TAG2(ReadRGBASpan,_MMX)( GLcontext *ctx, + GLuint n, GLint x, GLint y, + GLubyte rgba[][4]) { #ifndef USE_INNER_EMMS /* The EMMS instruction is directly in-lined here because using GCC's @@ -394,6 +399,7 @@ static void TAG2(ReadRGBASpan,_MMX)( const GLcontext *ctx, HW_READ_LOCK() { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; GLint x1,n1; LOCAL_VARS; @@ -429,12 +435,14 @@ static void TAG2(ReadRGBASpan,_MMX)( const GLcontext *ctx, #if defined(USE_SSE_ASM) && \ (SPANTMP_PIXEL_FMT == GL_BGRA) && \ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) -static void TAG2(ReadRGBASpan,_SSE2)( const GLcontext *ctx, - GLuint n, GLint x, GLint y, - GLubyte rgba[][4]) +static void TAG2(ReadRGBASpan,_SSE2)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + void *values) { HW_READ_LOCK() { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; GLint x1,n1; LOCAL_VARS; @@ -461,9 +469,10 @@ static void TAG2(ReadRGBASpan,_SSE2)( const GLcontext *ctx, #if defined(USE_SSE_ASM) && \ (SPANTMP_PIXEL_FMT == GL_BGRA) && \ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) -static void TAG2(ReadRGBASpan,_SSE)( const GLcontext *ctx, - GLuint n, GLint x, GLint y, - GLubyte rgba[][4]) +static void TAG2(ReadRGBASpan,_SSE)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + void *values) { #ifndef USE_INNER_EMMS /* The EMMS instruction is directly in-lined here because using GCC's @@ -474,6 +483,7 @@ static void TAG2(ReadRGBASpan,_SSE)( const GLcontext *ctx, HW_READ_LOCK() { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; GLint x1,n1; LOCAL_VARS; @@ -501,12 +511,15 @@ static void TAG2(ReadRGBASpan,_SSE)( const GLcontext *ctx, #endif -static void TAG(ReadRGBAPixels)( const GLcontext *ctx, +static void TAG(ReadRGBAPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], - GLubyte rgba[][4], const GLubyte mask[] ) + void *values ) { HW_READ_LOCK() { + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; + GLubyte *mask = NULL; /* remove someday */ GLint i; LOCAL_VARS; @@ -537,21 +550,21 @@ static void TAG(ReadRGBAPixels)( const GLcontext *ctx, HW_READ_UNLOCK(); } -static void TAG(InitPointers)(struct swrast_device_driver *swdd) +static void TAG(InitPointers)(struct gl_renderbuffer *rb) { - swdd->WriteRGBASpan = TAG(WriteRGBASpan); - swdd->WriteRGBSpan = TAG(WriteRGBSpan); - swdd->WriteMonoRGBASpan = TAG(WriteMonoRGBASpan); - swdd->WriteRGBAPixels = TAG(WriteRGBAPixels); - swdd->WriteMonoRGBAPixels = TAG(WriteMonoRGBAPixels); - swdd->ReadRGBAPixels = TAG(ReadRGBAPixels); + rb->PutRow = TAG(WriteRGBASpan); + rb->PutRowRGB = TAG(WriteRGBSpan); + rb->PutMonoRow = TAG(WriteMonoRGBASpan); + rb->PutValues = TAG(WriteRGBAPixels); + rb->PutMonoValues = TAG(WriteMonoRGBAPixels); + rb->GetValues = TAG(ReadRGBAPixels); #if defined(USE_SSE_ASM) && \ (SPANTMP_PIXEL_FMT == GL_BGRA) && \ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) if ( cpu_has_xmm2 ) { - if (DBG) fprintf( stderr, "Using %s version of ReadRGBASpan\n", "SSE2" ); - swdd->ReadRGBASpan = TAG2(ReadRGBASpan, _SSE2); + if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "SSE2" ); + rb->GetRow = TAG2(ReadRGBASpan, _SSE2); } else #endif @@ -559,8 +572,8 @@ static void TAG(InitPointers)(struct swrast_device_driver *swdd) (SPANTMP_PIXEL_FMT == GL_BGRA) && \ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) if ( cpu_has_xmm ) { - if (DBG) fprintf( stderr, "Using %s version of ReadRGBASpan\n", "SSE" ); - swdd->ReadRGBASpan = TAG2(ReadRGBASpan, _SSE); + if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "SSE" ); + rb->GetRow = TAG2(ReadRGBASpan, _SSE); } else #endif @@ -570,14 +583,14 @@ static void TAG(InitPointers)(struct swrast_device_driver *swdd) ((SPANTMP_PIXEL_FMT == GL_RGB) && \ (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5))) if ( cpu_has_mmx ) { - if (DBG) fprintf( stderr, "Using %s version of ReadRGBASpan\n", "MMX" ); - swdd->ReadRGBASpan = TAG2(ReadRGBASpan, _MMX); + if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "MMX" ); + rb->GetRow = TAG2(ReadRGBASpan, _MMX); } else #endif { - if (DBG) fprintf( stderr, "Using %s version of ReadRGBASpan\n", "C" ); - swdd->ReadRGBASpan = TAG(ReadRGBASpan); + if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "C" ); + rb->GetRow = TAG(ReadRGBASpan); } } diff --git a/src/mesa/drivers/dri/common/stenciltmp.h b/src/mesa/drivers/dri/common/stenciltmp.h index dfbe665407d..ffcb1a4c1ee 100644 --- a/src/mesa/drivers/dri/common/stenciltmp.h +++ b/src/mesa/drivers/dri/common/stenciltmp.h @@ -19,12 +19,13 @@ #endif static void TAG(WriteStencilSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - const GLstencil *stencil, - const GLubyte mask[] ) + const void *values, const GLubyte mask[] ) { HW_WRITE_LOCK() { + const GLubyte *stencil = (const GLubyte *) values; GLint x1; GLint n1; LOCAL_STENCIL_VARS; @@ -57,15 +58,57 @@ static void TAG(WriteStencilSpan)( GLcontext *ctx, } +static void TAG(WriteMonoStencilSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *value, + const GLubyte mask[] ) +{ + HW_WRITE_LOCK() + { + const GLubyte stencil = *((const GLubyte *) value); + GLint x1; + GLint n1; + LOCAL_STENCIL_VARS; + + y = Y_FLIP(y); + + HW_CLIPLOOP() + { + GLint i = 0; + CLIPSPAN(x,y,n,x1,n1,i); + + if (DBG) fprintf(stderr, "WriteStencilSpan %d..%d (x1 %d)\n", + (int)i, (int)n1, (int)x1); + + if (mask) + { + for (;n1>0;i++,x1++,n1--) + if (mask[i]) + WRITE_STENCIL( x1, y, stencil ); + } + else + { + for (;n1>0;i++,x1++,n1--) + WRITE_STENCIL( x1, y, stencil ); + } + } + HW_ENDCLIPLOOP(); + } + HW_WRITE_UNLOCK(); +} + + + static void TAG(WriteStencilPixels)( GLcontext *ctx, - GLuint n, - const GLint x[], - const GLint y[], - const GLstencil stencil[], - const GLubyte mask[] ) + struct gl_renderbuffer *rb, + GLuint n, + const GLint x[], const GLint y[], + const void *values, const GLubyte mask[] ) { HW_WRITE_LOCK() { + const GLubyte *stencil = (const GLubyte *) values; GLuint i; LOCAL_STENCIL_VARS; @@ -91,11 +134,13 @@ static void TAG(WriteStencilPixels)( GLcontext *ctx, /* Read stencil spans and pixels */ static void TAG(ReadStencilSpan)( GLcontext *ctx, + struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, - GLstencil stencil[]) + void *values) { HW_READ_LOCK() { + GLubyte *stencil = (GLubyte *) values; GLint x1,n1; LOCAL_STENCIL_VARS; @@ -115,12 +160,14 @@ static void TAG(ReadStencilSpan)( GLcontext *ctx, HW_READ_UNLOCK(); } -static void TAG(ReadStencilPixels)( GLcontext *ctx, GLuint n, - const GLint x[], const GLint y[], - GLstencil stencil[] ) +static void TAG(ReadStencilPixels)( GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + void *values ) { HW_READ_LOCK() { + GLubyte *stencil = (GLubyte *) values; GLuint i; LOCAL_STENCIL_VARS; diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c index 696bf9e2e15..dc049fddb55 100644 --- a/src/mesa/drivers/dri/fb/fb_dri.c +++ b/src/mesa/drivers/dri/fb/fb_dri.c @@ -44,9 +44,12 @@ #include "driver.h" #include "drm.h" #include "utils.h" +#include "drirenderbuffer.h" #include "buffers.h" #include "extensions.h" +#include "framebuffer.h" +#include "renderbuffer.h" #include "array_cache/acache.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -153,10 +156,10 @@ set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit ) switch (bufferBit) { - case DD_FRONT_LEFT_BIT: + case BUFFER_BIT_FRONT_LEFT: fbdrawable->currentBuffer = fbdrawable->frontBuffer; break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: fbdrawable->currentBuffer = fbdrawable->backBuffer; break; default: @@ -171,7 +174,7 @@ init_core_functions( struct dd_function_table *functions ) { functions->GetString = get_string; functions->UpdateState = update_state; - functions->ResizeBuffers = _swrast_alloc_buffers; + functions->ResizeBuffers = _mesa_resize_framebuffer; functions->GetBufferSize = get_buffer_size; functions->Viewport = viewport; @@ -279,7 +282,67 @@ init_core_functions( struct dd_function_table *functions ) #define FETCH_CI_PIXEL(CI, P) \ CI = P[0] - #include "swrast/s_spantemp.h" +#include "swrast/s_spantemp.h" + + + +void +fbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) +{ + ASSERT(drb->Base.InternalFormat == GL_RGBA); + if (drb->Base.InternalFormat == GL_RGBA) { + if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { + drb->Base.GetRow = read_rgba_span_B5G6R5; + drb->Base.GetValues = read_rgba_pixels_B5G6R5; + drb->Base.PutRow = write_rgba_span_B5G6R5; + drb->Base.PutMonoRow = write_monorgba_span_B5G6R5; + drb->Base.PutRowRGB = write_rgb_span_B5G6R5; + drb->Base.PutValues = write_rgba_pixels_B5G6R5; + drb->Base.PutMonoValues = write_monorgba_pixels_B5G6R5; + } + else if (vis->redBits == 5 && vis->greenBits == 5 && vis->blueBits == 5) { + drb->Base.GetRow = read_rgba_span_B5G5R5; + drb->Base.GetValues = read_rgba_pixels_B5G5R5; + drb->Base.PutRow = write_rgba_span_B5G5R5; + drb->Base.PutMonoRow = write_monorgba_span_B5G5R5; + drb->Base.PutRowRGB = write_rgb_span_B5G5R5; + drb->Base.PutValues = write_rgba_pixels_B5G5R5; + drb->Base.PutMonoValues = write_monorgba_pixels_B5G5R5; + } + else if (vis->redBits == 8 && vis->greenBits == 8 && vis->blueBits == 8 + && vis->alphaBits == 8) { + drb->Base.GetRow = read_rgba_span_B8G8R8A8; + drb->Base.GetValues = read_rgba_pixels_B8G8R8A8; + drb->Base.PutRow = write_rgba_span_B8G8R8A8; + drb->Base.PutMonoRow = write_monorgba_span_B8G8R8A8; + drb->Base.PutRowRGB = write_rgb_span_B8G8R8A8; + drb->Base.PutValues = write_rgba_pixels_B8G8R8A8; + drb->Base.PutMonoValues = write_monorgba_pixels_B8G8R8A8; + } + else if (vis->redBits == 8 && vis->greenBits == 8 && vis->blueBits == 8 + && vis->alphaBits == 0) { + drb->Base.GetRow = read_rgba_span_B8G8R8; + drb->Base.GetValues = read_rgba_pixels_B8G8R8; + drb->Base.PutRow = write_rgba_span_B8G8R8; + drb->Base.PutMonoRow = write_monorgba_span_B8G8R8; + drb->Base.PutRowRGB = write_rgb_span_B8G8R8; + drb->Base.PutValues = write_rgba_pixels_B8G8R8; + drb->Base.PutMonoValues = write_monorgba_pixels_B8G8R8; + } + else if (vis->indexBits == 8) { + drb->Base.GetRow = read_index_span_CI8; + drb->Base.GetValues = read_index_pixels_CI8; + drb->Base.PutRow = write_index_span_CI8; + drb->Base.PutMonoRow = write_monoindex_span_CI8; + drb->Base.PutValues = write_index_pixels_CI8; + drb->Base.PutMonoValues = write_monoindex_pixels_CI8; + } + } + else { + /* hardware z/stencil/etc someday */ + } +} + /* Initialize the driver specific screen private data. @@ -377,60 +440,6 @@ fbCreateContext( const __GLcontextModes *glVisual, struct swrast_device_driver *swdd; swdd = _swrast_GetDeviceDriverReference( ctx ); swdd->SetBuffer = set_buffer; - if (!glVisual->rgbMode) { - swdd->WriteCI32Span = write_index32_span_CI8; - swdd->WriteCI8Span = write_index8_span_CI8; - swdd->WriteMonoCISpan = write_monoindex_span_CI8; - swdd->WriteCI32Pixels = write_index_pixels_CI8; - swdd->WriteMonoCIPixels = write_monoindex_pixels_CI8; - swdd->ReadCI32Span = read_index_span_CI8; - swdd->ReadCI32Pixels = read_index_pixels_CI8; - } - else if (glVisual->rgbBits == 24 && - glVisual->alphaBits == 0) { - swdd->WriteRGBASpan = write_rgba_span_B8G8R8; - swdd->WriteRGBSpan = write_rgb_span_B8G8R8; - swdd->WriteMonoRGBASpan = write_monorgba_span_B8G8R8; - swdd->WriteRGBAPixels = write_rgba_pixels_B8G8R8; - swdd->WriteMonoRGBAPixels = write_monorgba_pixels_B8G8R8; - swdd->ReadRGBASpan = read_rgba_span_B8G8R8; - swdd->ReadRGBAPixels = read_rgba_pixels_B8G8R8; - } - else if (glVisual->rgbBits == 32 && - glVisual->alphaBits == 8) { - swdd->WriteRGBASpan = write_rgba_span_B8G8R8A8; - swdd->WriteRGBSpan = write_rgb_span_B8G8R8A8; - swdd->WriteMonoRGBASpan = write_monorgba_span_B8G8R8A8; - swdd->WriteRGBAPixels = write_rgba_pixels_B8G8R8A8; - swdd->WriteMonoRGBAPixels = write_monorgba_pixels_B8G8R8A8; - swdd->ReadRGBASpan = read_rgba_span_B8G8R8A8; - swdd->ReadRGBAPixels = read_rgba_pixels_B8G8R8A8; - } - else if (glVisual->rgbBits == 16 && - glVisual->alphaBits == 0) { - swdd->WriteRGBASpan = write_rgba_span_B5G6R5; - swdd->WriteRGBSpan = write_rgb_span_B5G6R5; - swdd->WriteMonoRGBASpan = write_monorgba_span_B5G6R5; - swdd->WriteRGBAPixels = write_rgba_pixels_B5G6R5; - swdd->WriteMonoRGBAPixels = write_monorgba_pixels_B5G6R5; - swdd->ReadRGBASpan = read_rgba_span_B5G6R5; - swdd->ReadRGBAPixels = read_rgba_pixels_B5G6R5; - } - else if (glVisual->rgbBits == 15 && - glVisual->alphaBits == 0) { - swdd->WriteRGBASpan = write_rgba_span_B5G5R5; - swdd->WriteRGBSpan = write_rgb_span_B5G5R5; - swdd->WriteMonoRGBASpan = write_monorgba_span_B5G5R5; - swdd->WriteRGBAPixels = write_rgba_pixels_B5G5R5; - swdd->WriteMonoRGBAPixels = write_monorgba_pixels_B5G5R5; - swdd->ReadRGBASpan = read_rgba_span_B5G5R5; - swdd->ReadRGBAPixels = read_rgba_pixels_B5G5R5; - } - else { - _mesa_printf("bad pixelformat rgb %d alpha %d\n", - glVisual->rgbBits, - glVisual->alphaBits ); - } } /* use default TCL pipeline */ @@ -454,7 +463,7 @@ fbDestroyContext( __DRIcontextPrivate *driContextPriv ) /* check if we're deleting the currently bound context */ if (fbmesa == current) { - _mesa_make_current2(NULL, NULL, NULL); + _mesa_make_current(NULL, NULL, NULL); } /* Free fb context resources */ @@ -498,6 +507,7 @@ fbCreateBuffer( __DRIscreenPrivate *driScrnPriv, if (!fbdrawable) return 0; +#if 0 fbdrawable->mesa_framebuffer = (void *) _mesa_create_framebuffer( mesaVis, swDepth, @@ -509,6 +519,42 @@ fbCreateBuffer( __DRIscreenPrivate *driScrnPriv, _mesa_free(fbdrawable); return 0; } +#else + fbdrawable->mesa_framebuffer = _mesa_create_framebuffer(mesaVis); + if (!fbdrawable->mesa_framebuffer) { + _mesa_free(fbdrawable); + return 0; + } + + /* XXX double-check these parameters (bpp vs cpp, etc) */ + { + driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, spriv->bpp, + spriv->fbOrigin, + spriv->fbStride); + fbSetSpanFunctions(drb, mesaVis); + _mesa_add_renderbuffer(fbdrawable->mesa_framebuffer, + BUFFER_FRONT_LEFT, &drb->Base); + } + if (mesaVis->doubleBufferMode) { + /* XXX what are the correct origin/stride values? */ + driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, spriv->bpp, + spriv->fbOrigin, + spriv->fbStride); + fbSetSpanFunctions(drb, mesaVis); + _mesa_add_renderbuffer(fbdrawable->mesa_framebuffer, + BUFFER_BACK_LEFT, &drb->Base); + } + + _mesa_add_soft_renderbuffers(fbdrawable->mesa_framebuffer, + GL_FALSE, /* color */ + swDepth, + swStencil, + swAccum, + swAlpha, + GL_FALSE /* aux */); + +#endif + driDrawPriv->driverPrivate = fbdrawable; fbdrawable->frontBuffer = fbdrawable->currentBuffer = spriv->fbMap; @@ -591,11 +637,11 @@ fbMakeCurrent( __DRIcontextPrivate *driContextPriv, newFbCtx->dri.drawable = driDrawPriv; - _mesa_make_current2( newFbCtx->glCtx, - ((fbDrawablePtr)driDrawPriv->driverPrivate)->mesa_framebuffer, - ((fbDrawablePtr)driReadPriv->driverPrivate)->mesa_framebuffer); + _mesa_make_current( newFbCtx->glCtx, + ((fbDrawablePtr)driDrawPriv->driverPrivate)->mesa_framebuffer, + ((fbDrawablePtr)driReadPriv->driverPrivate)->mesa_framebuffer); } else { - _mesa_make_current( 0, 0 ); + _mesa_make_current( NULL, NULL, NULL ); } return GL_TRUE; diff --git a/src/mesa/drivers/dri/ffb/ffb_clear.c b/src/mesa/drivers/dri/ffb/ffb_clear.c index 2bb0eb047be..c63179149a7 100644 --- a/src/mesa/drivers/dri/ffb/ffb_clear.c +++ b/src/mesa/drivers/dri/ffb/ffb_clear.c @@ -267,7 +267,7 @@ void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all, { ffbContextPtr fmesa = FFB_CONTEXT(ctx); __DRIdrawablePrivate *dPriv = fmesa->driDrawable; - unsigned int stcmask = DD_STENCIL_BIT; + unsigned int stcmask = BUFFER_BIT_STENCIL; #ifdef CLEAR_TRACE fprintf(stderr, "ffbDDClear: mask(%08x) all(%d) " @@ -277,7 +277,7 @@ void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all, if (!(fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS)) stcmask = 0; - if (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT | DD_DEPTH_BIT | stcmask)) { + if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT | BUFFER_BIT_DEPTH | stcmask)) { ffb_fbcPtr ffb = fmesa->regs; unsigned int fbc, ppc; @@ -288,20 +288,20 @@ void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all, FFB_PPC_ZS_CONST | FFB_PPC_CS_CONST); /* Y/X enables must be both on or both off. */ - if (mask & (DD_DEPTH_BIT | stcmask)) { + if (mask & (BUFFER_BIT_DEPTH | stcmask)) { fbc |= (FFB_FBC_ZE_ON | FFB_FBC_YE_ON | FFB_FBC_WB_C); } else fbc |= FFB_FBC_ZE_OFF | FFB_FBC_YE_OFF; /* All RGB enables must be both on or both off. */ - if (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) { - if (mask & DD_FRONT_LEFT_BIT) { + if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) { + if (mask & BUFFER_BIT_FRONT_LEFT) { if (fmesa->back_buffer == 0) fbc |= FFB_FBC_WB_B; else fbc |= FFB_FBC_WB_A; } - if (mask & DD_BACK_LEFT_BIT) { + if (mask & BUFFER_BIT_BACK_LEFT) { if (fmesa->back_buffer == 0) fbc |= FFB_FBC_WB_A; else @@ -321,9 +321,9 @@ void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all, ffb->cmp = 0x80808080; ffb->rop = FFB_ROP_NEW; - if (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) + if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) ffb->fg = fmesa->clear_pixel; - if (mask & DD_DEPTH_BIT) + if (mask & BUFFER_BIT_DEPTH) ffb->constz = fmesa->clear_depth; if (mask & stcmask) ffb->consty = fmesa->clear_stencil; @@ -344,8 +344,8 @@ void ffbDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all, UNLOCK_HARDWARE(fmesa); - mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT | - DD_DEPTH_BIT | stcmask); + mask &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT | + BUFFER_BIT_DEPTH | stcmask); } if (mask) diff --git a/src/mesa/drivers/dri/ffb/ffb_state.c b/src/mesa/drivers/dri/ffb/ffb_state.c index 53d56d20436..48b58e09932 100644 --- a/src/mesa/drivers/dri/ffb/ffb_state.c +++ b/src/mesa/drivers/dri/ffb/ffb_state.c @@ -522,14 +522,14 @@ static void ffbDDSetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, #endif fbc &= ~(FFB_FBC_RB_MASK); switch (bufferBit) { - case DD_FRONT_LEFT_BIT: + case BUFFER_BIT_FRONT_LEFT: if (fmesa->back_buffer == 0) fbc |= FFB_FBC_RB_B; else fbc |= FFB_FBC_RB_A; break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: if (fmesa->back_buffer == 0) fbc |= FFB_FBC_RB_A; else diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c index 722b870f5e9..cdaafac15fb 100644 --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c +++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c @@ -515,8 +515,8 @@ ffbMakeCurrent(__DRIcontextPrivate *driContextPriv, * we need to clear all the hw buffers. */ ffbDDClear(fmesa->glCtx, - (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT | - DD_DEPTH_BIT | DD_STENCIL_BIT), + (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT | + BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL), 1, 0, 0, 0, 0); } } else { diff --git a/src/mesa/drivers/dri/gamma/gamma_span.c b/src/mesa/drivers/dri/gamma/gamma_span.c index c953dfd08ff..db61f1c7771 100644 --- a/src/mesa/drivers/dri/gamma/gamma_span.c +++ b/src/mesa/drivers/dri/gamma/gamma_span.c @@ -268,10 +268,10 @@ static void gammaSetBuffer( GLcontext *ctx, gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); switch ( bufferBit ) { - case DD_FRONT_LEFT_BIT: + case BUFFER_BIT_FRONT_LEFT: gmesa->readOffset = 0; break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: gmesa->readOffset = gmesa->driScreen->fbHeight * gmesa->driScreen->fbWidth * gmesa->gammaScreen->cpp; break; default: diff --git a/src/mesa/drivers/dri/gamma/gamma_state.c b/src/mesa/drivers/dri/gamma/gamma_state.c index 4d9d92fdb66..24a6b3672c7 100644 --- a/src/mesa/drivers/dri/gamma/gamma_state.c +++ b/src/mesa/drivers/dri/gamma/gamma_state.c @@ -230,12 +230,12 @@ static void gammaDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, VALIDATE_DRAWABLE_INFO_NO_LOCK(gmesa); #endif - if (mask & DD_DEPTH_BIT) { + if (mask & BUFFER_BIT_DEPTH) { /* Turn off writes the FB */ CHECK_DMA_BUFFER(gmesa, 1); WRITE(gmesa->buf, FBWriteMode, FBWriteModeDisable); - mask &= ~DD_DEPTH_BIT; + mask &= ~BUFFER_BIT_DEPTH; /* * Turn Rectangle2DControl off when the window is not clipped @@ -349,13 +349,13 @@ static void gammaDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, } } - if (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) { + if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) { int y = gmesa->driScreen->fbHeight - gmesa->driDrawable->y - gmesa->driDrawable->h; int x = gmesa->driDrawable->x; int w = gmesa->driDrawable->w; int h = gmesa->driDrawable->h; - mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT); + mask &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT); if (x < 0) { w -= -x; x = 0; } diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c index bf1b2fc93c6..aa4eb4be6ed 100644 --- a/src/mesa/drivers/dri/i810/i810context.c +++ b/src/mesa/drivers/dri/i810/i810context.c @@ -38,6 +38,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "matrix.h" #include "simple_list.h" #include "extensions.h" +#include "framebuffer.h" #include "imports.h" #include "swrast/swrast.h" @@ -245,7 +246,7 @@ i810CreateContext( const __GLcontextModes *mesaVis, ctx->Const.PointSizeGranularity = 1.0; ctx->Driver.GetBufferSize = i810BufferSize; - ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; + ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer; ctx->Driver.GetString = i810GetString; /* Who owns who? @@ -384,11 +385,12 @@ void i810XMesaSetBackClipRects( i810ContextPtr imesa ) static void i810XMesaWindowMoved( i810ContextPtr imesa ) { - switch (imesa->glCtx->Color._DrawDestMask[0]) { - case DD_FRONT_LEFT_BIT: + /* Determine current color drawing buffer */ + switch (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) { + case BUFFER_BIT_FRONT_LEFT: i810XMesaSetFrontClipRects( imesa ); break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: i810XMesaSetBackClipRects( imesa ); break; default: @@ -424,16 +426,16 @@ i810MakeCurrent(__DRIcontextPrivate *driContextPriv, */ imesa->driDrawable = driDrawPriv; - _mesa_make_current2(imesa->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate); + _mesa_make_current(imesa->glCtx, + (GLframebuffer *) driDrawPriv->driverPrivate, + (GLframebuffer *) driReadPriv->driverPrivate); /* Are these necessary? */ i810XMesaWindowMoved( imesa ); } else { - _mesa_make_current(0,0); + _mesa_make_current(NULL, NULL, NULL); } return GL_TRUE; @@ -445,11 +447,12 @@ i810UpdatePageFlipping( i810ContextPtr imesa ) GLcontext *ctx = imesa->glCtx; int front = 0; - switch (ctx->Color._DrawDestMask[0]) { - case DD_FRONT_LEFT_BIT: + /* Determine current color drawing buffer */ + switch (ctx->DrawBuffer->_ColorDrawBufferMask[0]) { + case BUFFER_BIT_FRONT_LEFT: front = 1; break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: front = 0; break; default: diff --git a/src/mesa/drivers/dri/i810/i810ioctl.c b/src/mesa/drivers/dri/i810/i810ioctl.c index 50ddd0976f2..ba651555a67 100644 --- a/src/mesa/drivers/dri/i810/i810ioctl.c +++ b/src/mesa/drivers/dri/i810/i810ioctl.c @@ -63,20 +63,20 @@ static void i810Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, I810_FIREVERTICES( imesa ); - if ((mask & DD_FRONT_LEFT_BIT) && colorMask == ~0U) { + if ((mask & BUFFER_BIT_FRONT_LEFT) && colorMask == ~0U) { clear.flags |= I810_FRONT; - mask &= ~DD_FRONT_LEFT_BIT; + mask &= ~BUFFER_BIT_FRONT_LEFT; } - if ((mask & DD_BACK_LEFT_BIT) && colorMask == ~0U) { + if ((mask & BUFFER_BIT_BACK_LEFT) && colorMask == ~0U) { clear.flags |= I810_BACK; - mask &= ~DD_BACK_LEFT_BIT; + mask &= ~BUFFER_BIT_BACK_LEFT; } - if (mask & DD_DEPTH_BIT) { + if (mask & BUFFER_BIT_DEPTH) { if (ctx->Depth.Mask) clear.flags |= I810_DEPTH; - mask &= ~DD_DEPTH_BIT; + mask &= ~BUFFER_BIT_DEPTH; } if (clear.flags) { diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index 072bcd0318e..f270df66b65 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -36,7 +36,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "glheader.h" #include "imports.h" #include "context.h" +#include "framebuffer.h" +#include "fbobject.h" #include "matrix.h" +#include "renderbuffer.h" #include "simple_list.h" #include "utils.h" @@ -330,22 +333,64 @@ i810DestroyScreen(__DRIscreenPrivate *sPriv) } +/** + * Create a buffer which corresponds to the window. + */ static GLboolean i810CreateBuffer( __DRIscreenPrivate *driScrnPriv, __DRIdrawablePrivate *driDrawPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) { + i810ScreenPrivate *screen = (i810ScreenPrivate *) driScrnPriv->private; + if (isPixmap) { return GL_FALSE; /* not implemented */ } else { +#if 0 driDrawPriv->driverPrivate = (void *) _mesa_create_framebuffer(mesaVis, GL_FALSE, /* software depth buffer? */ mesaVis->stencilBits > 0, mesaVis->accumRedBits > 0, GL_FALSE /* s/w alpha planes */); +#else + struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); + + { + driRenderbuffer *frontRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + /*screen->frontOffset*/0, screen->backPitch); + i810SetSpanFunctions(frontRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); + } + + if (mesaVis->doubleBufferMode) { + driRenderbuffer *backRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->backOffset, screen->backPitch); + i810SetSpanFunctions(backRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + } + + if (mesaVis->depthBits == 16) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp, + screen->depthOffset, screen->backPitch); + i810SetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + + _mesa_add_soft_renderbuffers(fb, + GL_FALSE, /* color */ + GL_FALSE, /* depth */ + mesaVis->stencilBits > 0, + mesaVis->accumRedBits > 0, + GL_FALSE, /* alpha */ + GL_FALSE /* aux */); + driDrawPriv->driverPrivate = (void *) fb; +#endif return (driDrawPriv->driverPrivate != NULL); } } diff --git a/src/mesa/drivers/dri/i810/i810span.c b/src/mesa/drivers/dri/i810/i810span.c index eb32cb7c703..78b8265b70d 100644 --- a/src/mesa/drivers/dri/i810/i810span.c +++ b/src/mesa/drivers/dri/i810/i810span.c @@ -123,13 +123,13 @@ static void i810SetBuffer(GLcontext *ctx, GLframebuffer *buffer, (void) buffer; switch(bufferBit) { - case DD_FRONT_LEFT_BIT: + case BUFFER_BIT_FRONT_LEFT: if ( imesa->sarea->pf_current_page == 1) imesa->readMap = imesa->i810Screen->back.map; else imesa->readMap = (char*)imesa->driScreen->pFB; break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: if ( imesa->sarea->pf_current_page == 1) imesa->readMap = (char*)imesa->driScreen->pFB; else @@ -165,6 +165,7 @@ void i810InitSpanFuncs( GLcontext *ctx ) swdd->SetBuffer = i810SetBuffer; +#if 0 swdd->WriteRGBASpan = i810WriteRGBASpan_565; swdd->WriteRGBSpan = i810WriteRGBSpan_565; swdd->WriteMonoRGBASpan = i810WriteMonoRGBASpan_565; @@ -172,12 +173,60 @@ void i810InitSpanFuncs( GLcontext *ctx ) swdd->WriteMonoRGBAPixels = i810WriteMonoRGBAPixels_565; swdd->ReadRGBASpan = i810ReadRGBASpan_565; swdd->ReadRGBAPixels = i810ReadRGBAPixels_565; +#endif +#if 0 swdd->ReadDepthSpan = i810ReadDepthSpan_16; swdd->WriteDepthSpan = i810WriteDepthSpan_16; swdd->ReadDepthPixels = i810ReadDepthPixels_16; swdd->WriteDepthPixels = i810WriteDepthPixels_16; +#endif swdd->SpanRenderStart = i810SpanRenderStart; swdd->SpanRenderFinish = i810SpanRenderFinish; } + + + +/** + * Plug in the Get/Put routines for the given driRenderbuffer. + */ +void +i810SetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) +{ + if (drb->Base.InternalFormat == GL_RGBA) { + /* always 565 RGB */ + drb->Base.GetRow = i810ReadRGBASpan_565; + drb->Base.GetValues = i810ReadRGBAPixels_565; + drb->Base.PutRow = i810WriteRGBASpan_565; + drb->Base.PutRowRGB = i810WriteRGBSpan_565; + drb->Base.PutMonoRow = i810WriteMonoRGBASpan_565; + drb->Base.PutValues = i810WriteRGBAPixels_565; + drb->Base.PutMonoValues = i810WriteMonoRGBAPixels_565; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + drb->Base.GetRow = i810ReadDepthSpan_16; + drb->Base.GetValues = i810ReadDepthPixels_16; + drb->Base.PutRow = i810WriteDepthSpan_16; + drb->Base.PutMonoRow = i810WriteMonoDepthSpan_16; + drb->Base.PutValues = i810WriteDepthPixels_16; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + /* should never get here */ + drb->Base.GetRow = NULL; + drb->Base.GetValues = NULL; + drb->Base.PutRow = NULL; + drb->Base.PutMonoRow = NULL; + drb->Base.PutValues = NULL; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + drb->Base.GetRow = NULL; + drb->Base.GetValues = NULL; + drb->Base.PutRow = NULL; + drb->Base.PutMonoRow = NULL; + drb->Base.PutValues = NULL; + drb->Base.PutMonoValues = NULL; + } +} diff --git a/src/mesa/drivers/dri/i810/i810span.h b/src/mesa/drivers/dri/i810/i810span.h index 545bce46a63..9aed253bd54 100644 --- a/src/mesa/drivers/dri/i810/i810span.h +++ b/src/mesa/drivers/dri/i810/i810span.h @@ -1,9 +1,14 @@ #ifndef _I810_SPAN_H #define _I810_SPAN_H +#include "drirenderbuffer.h" + extern void i810InitSpanFuncs( GLcontext *ctx ); extern void i810SpanRenderFinish( GLcontext *ctx ); extern void i810SpanRenderStart( GLcontext *ctx ); +extern void +i810SetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); + #endif diff --git a/src/mesa/drivers/dri/i810/i810state.c b/src/mesa/drivers/dri/i810/i810state.c index 42df2e8b9ee..ec9f07ada35 100644 --- a/src/mesa/drivers/dri/i810/i810state.c +++ b/src/mesa/drivers/dri/i810/i810state.c @@ -285,11 +285,11 @@ void i810DrawBuffer(GLcontext *ctx, GLenum mode ) /* * _DrawDestMask is easier to cope with than . */ - switch ( ctx->Color._DrawDestMask[0] ) { - case DD_FRONT_LEFT_BIT: + switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0]) { + case BUFFER_BIT_FRONT_LEFT: front = 1; break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: front = 0; break; default: diff --git a/src/mesa/drivers/dri/i830/i830_context.c b/src/mesa/drivers/dri/i830/i830_context.c index 082476f2118..66c25ac0e64 100644 --- a/src/mesa/drivers/dri/i830/i830_context.c +++ b/src/mesa/drivers/dri/i830/i830_context.c @@ -42,6 +42,7 @@ #include "matrix.h" #include "simple_list.h" #include "extensions.h" +#include "framebuffer.h" #include "imports.h" #include "swrast/swrast.h" @@ -305,7 +306,7 @@ GLboolean i830CreateContext( const __GLcontextModes *mesaVis, ctx->Const.PointSizeGranularity = 1.0; ctx->Driver.GetBufferSize = i830BufferSize; - ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; + ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer; ctx->Driver.GetString = i830DDGetString; /* Who owns who? */ @@ -476,11 +477,11 @@ void i830XMesaSetBackClipRects( i830ContextPtr imesa ) static void i830XMesaWindowMoved( i830ContextPtr imesa ) { - switch (imesa->glCtx->Color._DrawDestMask[0]) { - case DD_FRONT_LEFT_BIT: + switch (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) { + case BUFFER_BIT_FRONT_LEFT: i830XMesaSetFrontClipRects( imesa ); break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: i830XMesaSetBackClipRects( imesa ); break; default: @@ -527,11 +528,11 @@ GLboolean i830MakeCurrent(__DRIcontextPrivate *driContextPriv, imesa->driReadable = driReadPriv; - _mesa_make_current2(imesa->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate); + _mesa_make_current(imesa->glCtx, + (GLframebuffer *) driDrawPriv->driverPrivate, + (GLframebuffer *) driReadPriv->driverPrivate); } else { - _mesa_make_current(0,0); + _mesa_make_current(NULL, NULL, NULL); } return GL_TRUE; diff --git a/src/mesa/drivers/dri/i830/i830_ioctl.c b/src/mesa/drivers/dri/i830/i830_ioctl.c index cad48db9df5..cd0c143dfcb 100644 --- a/src/mesa/drivers/dri/i830/i830_ioctl.c +++ b/src/mesa/drivers/dri/i830/i830_ioctl.c @@ -186,7 +186,7 @@ static void i830ClearWithTris(GLcontext *ctx, GLbitfield mask, old_vertex_prim = imesa->hw_primitive; imesa->hw_primitive = PRIM3D_TRIFAN; - if(mask & DD_FRONT_LEFT_BIT) { + if(mask & BUFFER_BIT_FRONT_LEFT) { GLuint tmp = sarea->ContextState[I830_CTXREG_ENABLES_2]; sarea->dirty |= (I830_UPLOAD_CTX | I830_UPLOAD_BUFFERS | @@ -248,7 +248,7 @@ static void i830ClearWithTris(GLcontext *ctx, GLbitfield mask, i830FlushPrimsLocked( imesa ); } - if(mask & DD_BACK_LEFT_BIT) { + if(mask & BUFFER_BIT_BACK_LEFT) { GLuint tmp = sarea->ContextState[I830_CTXREG_ENABLES_2]; sarea->dirty |= (I830_UPLOAD_CTX | I830_UPLOAD_BUFFERS | @@ -311,7 +311,7 @@ static void i830ClearWithTris(GLcontext *ctx, GLbitfield mask, i830FlushPrimsLocked( imesa ); } - if(mask & DD_STENCIL_BIT) { + if(mask & BUFFER_BIT_STENCIL) { GLuint s_mask = ctx->Stencil.WriteMask[0]; sarea->dirty |= (I830_UPLOAD_CTX | I830_UPLOAD_BUFFERS | @@ -433,40 +433,40 @@ static void i830Clear(GLcontext *ctx, GLbitfield mask, GLboolean all, I830_FIREVERTICES( imesa ); - if (mask & DD_FRONT_LEFT_BIT) { + if (mask & BUFFER_BIT_FRONT_LEFT) { if(colorMask == ~0) { clear.flags |= I830_FRONT; } else { - tri_mask |= DD_FRONT_LEFT_BIT; + tri_mask |= BUFFER_BIT_FRONT_LEFT; } - mask &= ~DD_FRONT_LEFT_BIT; + mask &= ~BUFFER_BIT_FRONT_LEFT; } - if (mask & DD_BACK_LEFT_BIT) { + if (mask & BUFFER_BIT_BACK_LEFT) { if(colorMask == ~0) { clear.flags |= I830_BACK; } else { - tri_mask |= DD_BACK_LEFT_BIT; + tri_mask |= BUFFER_BIT_BACK_LEFT; } - mask &= ~DD_BACK_LEFT_BIT; + mask &= ~BUFFER_BIT_BACK_LEFT; } - if (mask & DD_DEPTH_BIT) { + if (mask & BUFFER_BIT_DEPTH) { clear.flags |= I830_DEPTH; clear.clear_depthmask = imesa->depth_clear_mask; clear.clear_depth = (GLuint)(ctx->Depth.Clear * imesa->ClearDepth); - mask &= ~DD_DEPTH_BIT; + mask &= ~BUFFER_BIT_DEPTH; } - if((mask & DD_STENCIL_BIT) && imesa->hw_stencil) { + if((mask & BUFFER_BIT_STENCIL) && imesa->hw_stencil) { if (ctx->Stencil.WriteMask[0] != 0xff) { - tri_mask |= DD_STENCIL_BIT; + tri_mask |= BUFFER_BIT_STENCIL; } else { clear.flags |= I830_DEPTH; clear.clear_depthmask |= imesa->stencil_clear_mask; clear.clear_depth |= (ctx->Stencil.Clear & 0xff) << 24; } - mask &= ~DD_STENCIL_BIT; + mask &= ~BUFFER_BIT_STENCIL; } /* First check for clears that need to happen with triangles */ diff --git a/src/mesa/drivers/dri/i830/i830_screen.c b/src/mesa/drivers/dri/i830/i830_screen.c index 47a2ef64acb..82883d07f2a 100644 --- a/src/mesa/drivers/dri/i830/i830_screen.c +++ b/src/mesa/drivers/dri/i830/i830_screen.c @@ -40,6 +40,8 @@ #include "context.h" #include "matrix.h" #include "simple_list.h" +#include "framebuffer.h" +#include "renderbuffer.h" #include "i830_screen.h" #include "i830_dri.h" @@ -54,6 +56,7 @@ #include "utils.h" #include "xmlpool.h" +#include "drirenderbuffer.h" PUBLIC const char __driConfigOptions[] = DRI_CONF_BEGIN @@ -310,27 +313,94 @@ static void i830DestroyScreen(__DRIscreenPrivate *sPriv) sPriv->private = NULL; } + static GLboolean i830CreateBuffer(__DRIscreenPrivate *driScrnPriv, __DRIdrawablePrivate *driDrawPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) { + i830ScreenPrivate *screen = (i830ScreenPrivate *) driScrnPriv->private; + if (isPixmap) { return GL_FALSE; /* not implemented */ - } else { + } + else { #if 0 GLboolean swStencil = (mesaVis->stencilBits > 0 && mesaVis->depthBits != 24); #else GLboolean swStencil = mesaVis->stencilBits > 0; #endif + +#if 0 driDrawPriv->driverPrivate = (void *) _mesa_create_framebuffer(mesaVis, GL_FALSE, /* software depth buffer? */ swStencil, mesaVis->accumRedBits > 0, GL_FALSE /* s/w alpha planes */); - +#else + struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); + + { + driRenderbuffer *frontRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + /*screen->frontOffset*/0, screen->backPitch); + i830SetSpanFunctions(frontRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); + } + + if (mesaVis->doubleBufferMode) { + driRenderbuffer *backRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->backOffset, screen->backPitch); + i830SetSpanFunctions(backRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + } + + if (mesaVis->depthBits == 16) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp, + screen->depthOffset, screen->backPitch); + i830SetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else if (mesaVis->depthBits == 24) { + if (mesaVis->stencilBits == 8) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp, + screen->depthOffset, screen->backPitch); + i830SetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else { + /* not really 32-bit Z, but use GL_DEPTH_COMPONENT32 anyway */ + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT32, screen->cpp, + screen->depthOffset, screen->backPitch); + i830SetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + } + + if (mesaVis->stencilBits > 0 && !swStencil) { + driRenderbuffer *stencilRb + = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp, + screen->depthOffset, screen->backPitch); + i830SetSpanFunctions(stencilRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); + } + + _mesa_add_soft_renderbuffers(fb, + GL_FALSE, /* color */ + GL_FALSE, /* depth */ + swStencil, + mesaVis->accumRedBits > 0, + GL_FALSE, /* alpha */ + GL_FALSE /* aux */); + driDrawPriv->driverPrivate = (void *) fb; +#endif + return (driDrawPriv->driverPrivate != NULL); } } diff --git a/src/mesa/drivers/dri/i830/i830_span.c b/src/mesa/drivers/dri/i830/i830_span.c index 9076b344233..a17ec9b6ac9 100644 --- a/src/mesa/drivers/dri/i830/i830_span.c +++ b/src/mesa/drivers/dri/i830/i830_span.c @@ -275,10 +275,10 @@ static void i830SetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, imesa->mesa_drawable = (colorBuffer == imesa->driDrawable->driverPrivate) ? imesa->driDrawable : imesa->driReadable; - if (bufferBit == DD_FRONT_LEFT_BIT) { + if (bufferBit == BUFFER_BIT_FRONT_LEFT) { imesa->drawMap = (char *)imesa->driScreen->pFB; imesa->readMap = (char *)imesa->driScreen->pFB; - } else if (bufferBit == DD_BACK_LEFT_BIT) { + } else if (bufferBit == BUFFER_BIT_BACK_LEFT) { imesa->drawMap = imesa->i830Screen->back.map; imesa->readMap = imesa->i830Screen->back.map; } else { @@ -316,6 +316,7 @@ void i830DDInitSpanFuncs( GLcontext *ctx ) switch (i830Screen->fbFormat) { case DV_PF_555: +#if 0 swdd->WriteRGBASpan = i830WriteRGBASpan_555; swdd->WriteRGBSpan = i830WriteRGBSpan_555; swdd->WriteMonoRGBASpan = i830WriteMonoRGBASpan_555; @@ -323,14 +324,15 @@ void i830DDInitSpanFuncs( GLcontext *ctx ) swdd->WriteMonoRGBAPixels = i830WriteMonoRGBAPixels_555; swdd->ReadRGBASpan = i830ReadRGBASpan_555; swdd->ReadRGBAPixels = i830ReadRGBAPixels_555; - swdd->ReadDepthSpan = i830ReadDepthSpan_16; swdd->WriteDepthSpan = i830WriteDepthSpan_16; swdd->ReadDepthPixels = i830ReadDepthPixels_16; swdd->WriteDepthPixels = i830WriteDepthPixels_16; +#endif break; case DV_PF_565: +#if 0 swdd->WriteRGBASpan = i830WriteRGBASpan_565; swdd->WriteRGBSpan = i830WriteRGBSpan_565; swdd->WriteMonoRGBASpan = i830WriteMonoRGBASpan_565; @@ -338,14 +340,15 @@ void i830DDInitSpanFuncs( GLcontext *ctx ) swdd->WriteMonoRGBAPixels = i830WriteMonoRGBAPixels_565; swdd->ReadRGBASpan = i830ReadRGBASpan_565; swdd->ReadRGBAPixels = i830ReadRGBAPixels_565; - swdd->ReadDepthSpan = i830ReadDepthSpan_16; swdd->WriteDepthSpan = i830WriteDepthSpan_16; swdd->ReadDepthPixels = i830ReadDepthPixels_16; swdd->WriteDepthPixels = i830WriteDepthPixels_16; +#endif break; case DV_PF_8888: +#if 0 swdd->WriteRGBASpan = i830WriteRGBASpan_8888; swdd->WriteRGBSpan = i830WriteRGBSpan_8888; swdd->WriteMonoRGBASpan = i830WriteMonoRGBASpan_8888; @@ -353,22 +356,26 @@ void i830DDInitSpanFuncs( GLcontext *ctx ) swdd->WriteMonoRGBAPixels = i830WriteMonoRGBAPixels_8888; swdd->ReadRGBASpan = i830ReadRGBASpan_8888; swdd->ReadRGBAPixels = i830ReadRGBAPixels_8888; +#endif if(imesa->hw_stencil) { +#if 0 swdd->ReadDepthSpan = i830ReadDepthSpan_24_8; swdd->WriteDepthSpan = i830WriteDepthSpan_24_8; swdd->ReadDepthPixels = i830ReadDepthPixels_24_8; swdd->WriteDepthPixels = i830WriteDepthPixels_24_8; - swdd->WriteStencilSpan = i830WriteStencilSpan_24_8; swdd->ReadStencilSpan = i830ReadStencilSpan_24_8; swdd->WriteStencilPixels = i830WriteStencilPixels_24_8; swdd->ReadStencilPixels = i830ReadStencilPixels_24_8; +#endif } else { +#if 0 swdd->ReadDepthSpan = i830ReadDepthSpan_24; swdd->WriteDepthSpan = i830WriteDepthSpan_24; swdd->ReadDepthPixels = i830ReadDepthPixels_24; swdd->WriteDepthPixels = i830WriteDepthPixels_24; +#endif } break; } @@ -376,3 +383,77 @@ void i830DDInitSpanFuncs( GLcontext *ctx ) swdd->SpanRenderStart = i830SpanRenderStart; swdd->SpanRenderFinish = i830SpanRenderFinish; } + + +/** + * Plug in the Get/Put routines for the given driRenderbuffer. + */ +void +i830SetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) +{ + if (drb->Base.InternalFormat == GL_RGBA) { + if (vis->redBits == 5 && vis->greenBits == 5 && vis->blueBits == 5) { + drb->Base.GetRow = i830ReadRGBASpan_555; + drb->Base.GetValues = i830ReadRGBAPixels_555; + drb->Base.PutRow = i830WriteRGBASpan_555; + drb->Base.PutRowRGB = i830WriteRGBSpan_555; + drb->Base.PutMonoRow = i830WriteMonoRGBASpan_555; + drb->Base.PutValues = i830WriteRGBAPixels_555; + drb->Base.PutMonoValues = i830WriteMonoRGBAPixels_555; + } + else if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { + drb->Base.GetRow = i830ReadRGBASpan_565; + drb->Base.GetValues = i830ReadRGBAPixels_565; + drb->Base.PutRow = i830WriteRGBASpan_565; + drb->Base.PutRowRGB = i830WriteRGBSpan_565; + drb->Base.PutMonoRow = i830WriteMonoRGBASpan_565; + drb->Base.PutValues = i830WriteRGBAPixels_565; + drb->Base.PutMonoValues = i830WriteMonoRGBAPixels_565; + } + else { + assert(vis->redBits == 8); + assert(vis->greenBits == 8); + assert(vis->blueBits == 8); + drb->Base.GetRow = i830ReadRGBASpan_8888; + drb->Base.GetValues = i830ReadRGBAPixels_8888; + drb->Base.PutRow = i830WriteRGBASpan_8888; + drb->Base.PutRowRGB = i830WriteRGBSpan_8888; + drb->Base.PutMonoRow = i830WriteMonoRGBASpan_8888; + drb->Base.PutValues = i830WriteRGBAPixels_8888; + drb->Base.PutMonoValues = i830WriteMonoRGBAPixels_8888; + } + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + drb->Base.GetRow = i830ReadDepthSpan_16; + drb->Base.GetValues = i830ReadDepthPixels_16; + drb->Base.PutRow = i830WriteDepthSpan_16; + drb->Base.PutMonoRow = i830WriteMonoDepthSpan_16; + drb->Base.PutValues = i830WriteDepthPixels_16; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + drb->Base.GetRow = i830ReadDepthSpan_24_8; + drb->Base.GetValues = i830ReadDepthPixels_24_8; + drb->Base.PutRow = i830WriteDepthSpan_24_8; + drb->Base.PutMonoRow = i830WriteMonoDepthSpan_24_8; + drb->Base.PutValues = i830WriteDepthPixels_24_8; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT32) { + /* not _really_ 32-bit Z */ + drb->Base.GetRow = i830ReadDepthSpan_24; + drb->Base.GetValues = i830ReadDepthPixels_24; + drb->Base.PutRow = i830WriteDepthSpan_24; + drb->Base.PutMonoRow = i830WriteMonoDepthSpan_24; + drb->Base.PutValues = i830WriteDepthPixels_24; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + drb->Base.GetRow = i830ReadStencilSpan_24_8; + drb->Base.GetValues = i830ReadStencilPixels_24_8; + drb->Base.PutRow = i830WriteStencilSpan_24_8; + drb->Base.PutMonoRow = i830WriteMonoStencilSpan_24_8; + drb->Base.PutValues = i830WriteStencilPixels_24_8; + drb->Base.PutMonoValues = NULL; + } +} diff --git a/src/mesa/drivers/dri/i830/i830_span.h b/src/mesa/drivers/dri/i830/i830_span.h index 0135468ffa2..4b83419718c 100644 --- a/src/mesa/drivers/dri/i830/i830_span.h +++ b/src/mesa/drivers/dri/i830/i830_span.h @@ -38,9 +38,14 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef _I830_SPAN_H #define _I830_SPAN_H +#include "drirenderbuffer.h" + extern void i830DDInitSpanFuncs( GLcontext *ctx ); extern void i830SpanRenderFinish( GLcontext *ctx ); extern void i830SpanRenderStart( GLcontext *ctx ); +extern void +i830SetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); + #endif diff --git a/src/mesa/drivers/dri/i830/i830_state.c b/src/mesa/drivers/dri/i830/i830_state.c index f8979c70187..61534854493 100644 --- a/src/mesa/drivers/dri/i830/i830_state.c +++ b/src/mesa/drivers/dri/i830/i830_state.c @@ -802,17 +802,17 @@ static void i830DrawBuffer(GLcontext *ctx, GLenum mode ) i830ContextPtr imesa = I830_CONTEXT(ctx); /* - * _DrawDestMask is easier to cope with than . + * _ColorDrawBufferMask is easier to cope with than . */ - switch ( ctx->Color._DrawDestMask[0] ) { - case DD_FRONT_LEFT_BIT: + switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) { + case BUFFER_BIT_FRONT_LEFT: I830_FIREVERTICES(imesa); I830_STATECHANGE(imesa, I830_UPLOAD_BUFFERS); imesa->BufferSetup[I830_DESTREG_CBUFADDR] = imesa->i830Screen->fbOffset; i830XMesaSetFrontClipRects( imesa ); FALLBACK( imesa, I830_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: I830_FIREVERTICES(imesa); I830_STATECHANGE(imesa, I830_UPLOAD_BUFFERS); imesa->BufferSetup[I830_DESTREG_CBUFADDR] = diff --git a/src/mesa/drivers/dri/i915/i830_metaops.c b/src/mesa/drivers/dri/i915/i830_metaops.c index 751d8e75edf..dd238378b00 100644 --- a/src/mesa/drivers/dri/i915/i830_metaops.c +++ b/src/mesa/drivers/dri/i915/i830_metaops.c @@ -386,7 +386,7 @@ i830ClearWithTris(intelContextPtr intel, GLbitfield mask, * The active cliprects will be applied as for any other geometry. */ - if(mask & DD_FRONT_LEFT_BIT) { + if(mask & BUFFER_BIT_FRONT_LEFT) { set_no_depth_stencil_write( i830 ); set_color_mask( i830, GL_TRUE ); set_draw_offset( i830, screen->frontOffset ); @@ -396,7 +396,7 @@ i830ClearWithTris(intelContextPtr intel, GLbitfield mask, 0, 0, 0, 0); } - if(mask & DD_BACK_LEFT_BIT) { + if(mask & BUFFER_BIT_BACK_LEFT) { set_no_depth_stencil_write( i830 ); set_color_mask( i830, GL_TRUE ); set_draw_offset( i830, screen->backOffset ); @@ -407,7 +407,7 @@ i830ClearWithTris(intelContextPtr intel, GLbitfield mask, 0, 0, 0, 0); } - if(mask & DD_STENCIL_BIT) { + if(mask & BUFFER_BIT_STENCIL) { set_stencil_replace( i830, intel->ctx.Stencil.WriteMask[0], intel->ctx.Stencil.Clear); diff --git a/src/mesa/drivers/dri/i915/i915_metaops.c b/src/mesa/drivers/dri/i915/i915_metaops.c index 3176c727d04..2e9063edf0b 100644 --- a/src/mesa/drivers/dri/i915/i915_metaops.c +++ b/src/mesa/drivers/dri/i915/i915_metaops.c @@ -475,7 +475,7 @@ i915ClearWithTris(intelContextPtr intel, GLbitfield mask, * The active cliprects will be applied as for any other geometry. */ - if (mask & DD_FRONT_LEFT_BIT) { + if (mask & BUFFER_BIT_FRONT_LEFT) { set_no_depth_stencil_write( i915 ); set_color_mask( i915, GL_TRUE ); set_draw_offset( i915, screen->frontOffset ); @@ -486,7 +486,7 @@ i915ClearWithTris(intelContextPtr intel, GLbitfield mask, 0, 0, 0, 0); } - if(mask & DD_BACK_LEFT_BIT) { + if (mask & BUFFER_BIT_BACK_LEFT) { set_no_depth_stencil_write( i915 ); set_color_mask( i915, GL_TRUE ); set_draw_offset( i915, screen->backOffset ); @@ -497,7 +497,7 @@ i915ClearWithTris(intelContextPtr intel, GLbitfield mask, 0, 0, 0, 0); } - if(mask & DD_STENCIL_BIT) { + if (mask & BUFFER_BIT_STENCIL) { set_stencil_replace( i915, intel->ctx.Stencil.WriteMask[0], intel->ctx.Stencil.Clear); diff --git a/src/mesa/drivers/dri/i915/intel_batchbuffer.c b/src/mesa/drivers/dri/i915/intel_batchbuffer.c index 2062c9079ea..7c9ad87bed6 100644 --- a/src/mesa/drivers/dri/i915/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/i915/intel_batchbuffer.c @@ -512,11 +512,11 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, clear_color = intel->ClearColor; clear_depth = 0; - if (flags & DD_DEPTH_BIT) { + if (flags & BUFFER_BIT_DEPTH) { clear_depth = (GLuint)(ctx->Depth.Clear * intel->ClearDepth); } - if (flags & DD_STENCIL_BIT) { + if (flags & BUFFER_BIT_STENCIL) { clear_depth |= (ctx->Stencil.Clear & 0xff) << 24; } @@ -531,8 +531,8 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, XY_COLOR_BLT_WRITE_ALPHA | XY_COLOR_BLT_WRITE_RGB); D_CMD = XY_COLOR_BLT_CMD; - if (flags & DD_DEPTH_BIT) D_CMD |= XY_COLOR_BLT_WRITE_RGB; - if (flags & DD_STENCIL_BIT) D_CMD |= XY_COLOR_BLT_WRITE_ALPHA; + if (flags & BUFFER_BIT_DEPTH) D_CMD |= XY_COLOR_BLT_WRITE_RGB; + if (flags & BUFFER_BIT_STENCIL) D_CMD |= XY_COLOR_BLT_WRITE_ALPHA; break; default: BR13 = (0xF0 << 16) | (pitch * cpp) | (1<<24); @@ -552,9 +552,9 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, if ( intel->sarea->pf_current_page == 1 ) { GLuint tmp = flags; - flags &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT); - if ( tmp & DD_FRONT_LEFT_BIT ) flags |= DD_BACK_LEFT_BIT; - if ( tmp & DD_BACK_LEFT_BIT ) flags |= DD_FRONT_LEFT_BIT; + flags &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT); + if ( tmp & BUFFER_BIT_FRONT_LEFT ) flags |= BUFFER_BIT_BACK_LEFT; + if ( tmp & BUFFER_BIT_BACK_LEFT ) flags |= BUFFER_BIT_FRONT_LEFT; } for (i = 0 ; i < intel->numClipRects ; i++) @@ -590,7 +590,7 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, b.y2 > intelScreen->height) continue; - if ( flags & DD_FRONT_LEFT_BIT ) { + if ( flags & BUFFER_BIT_FRONT_LEFT ) { BEGIN_BATCH( 6); OUT_BATCH( CMD ); OUT_BATCH( BR13 ); @@ -601,7 +601,7 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, ADVANCE_BATCH(); } - if ( flags & DD_BACK_LEFT_BIT ) { + if ( flags & BUFFER_BIT_BACK_LEFT ) { BEGIN_BATCH( 6); OUT_BATCH( CMD ); OUT_BATCH( BR13 ); @@ -612,7 +612,7 @@ void intelClearWithBlit(GLcontext *ctx, GLbitfield flags, GLboolean all, ADVANCE_BATCH(); } - if ( flags & (DD_STENCIL_BIT | DD_DEPTH_BIT) ) { + if ( flags & (BUFFER_BIT_STENCIL | BUFFER_BIT_DEPTH) ) { BEGIN_BATCH( 6); OUT_BATCH( D_CMD ); OUT_BATCH( BR13 ); diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c index 97e8933c21a..0dabfad5ffd 100644 --- a/src/mesa/drivers/dri/i915/intel_context.c +++ b/src/mesa/drivers/dri/i915/intel_context.c @@ -31,6 +31,7 @@ #include "matrix.h" #include "simple_list.h" #include "extensions.h" +#include "framebuffer.h" #include "imports.h" #include "swrast/swrast.h" @@ -235,7 +236,7 @@ void intelInitDriverFunctions( struct dd_function_table *functions ) functions->Clear = intelClear; functions->Finish = intelFinish; functions->GetBufferSize = intelBufferSize; - functions->ResizeBuffers = _swrast_alloc_buffers; + functions->ResizeBuffers = _mesa_resize_framebuffer; functions->GetString = intelGetString; functions->UpdateState = intelInvalidateState; functions->CopyColorTable = _swrast_CopyColorTable; @@ -493,11 +494,11 @@ void intelSetBackClipRects( intelContextPtr intel ) void intelWindowMoved( intelContextPtr intel ) { - switch (intel->ctx.Color._DrawDestMask[0]) { - case DD_FRONT_LEFT_BIT: + switch (intel->ctx.DrawBuffer->_ColorDrawBufferMask[0]) { + case BUFFER_BIT_FRONT_LEFT: intelSetFrontClipRects( intel ); break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: intelSetBackClipRects( intel ); break; default: @@ -525,11 +526,11 @@ GLboolean intelMakeCurrent(__DRIcontextPrivate *driContextPriv, intelWindowMoved( intel ); } - _mesa_make_current2(&intel->ctx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate); + _mesa_make_current(&intel->ctx, + (GLframebuffer *) driDrawPriv->driverPrivate, + (GLframebuffer *) driReadPriv->driverPrivate); } else { - _mesa_make_current(0,0); + _mesa_make_current(NULL, NULL, NULL); } return GL_TRUE; diff --git a/src/mesa/drivers/dri/i915/intel_ioctl.c b/src/mesa/drivers/dri/i915/intel_ioctl.c index 3662918dd84..9691627ebc3 100644 --- a/src/mesa/drivers/dri/i915/intel_ioctl.c +++ b/src/mesa/drivers/dri/i915/intel_ioctl.c @@ -348,41 +348,41 @@ void intelClear(GLcontext *ctx, GLbitfield mask, GLboolean all, */ intelFlush( &intel->ctx ); - if (mask & DD_FRONT_LEFT_BIT) { + if (mask & BUFFER_BIT_FRONT_LEFT) { if (colorMask == ~0) { - blit_mask |= DD_FRONT_LEFT_BIT; + blit_mask |= BUFFER_BIT_FRONT_LEFT; } else { - tri_mask |= DD_FRONT_LEFT_BIT; + tri_mask |= BUFFER_BIT_FRONT_LEFT; } } - if (mask & DD_BACK_LEFT_BIT) { + if (mask & BUFFER_BIT_BACK_LEFT) { if (colorMask == ~0) { - blit_mask |= DD_BACK_LEFT_BIT; + blit_mask |= BUFFER_BIT_BACK_LEFT; } else { - tri_mask |= DD_BACK_LEFT_BIT; + tri_mask |= BUFFER_BIT_BACK_LEFT; } } - if (mask & DD_DEPTH_BIT) { - blit_mask |= DD_DEPTH_BIT; + if (mask & BUFFER_BIT_DEPTH) { + blit_mask |= BUFFER_BIT_DEPTH; } - if (mask & DD_STENCIL_BIT) { + if (mask & BUFFER_BIT_STENCIL) { if (!intel->hw_stencil) { - swrast_mask |= DD_STENCIL_BIT; + swrast_mask |= BUFFER_BIT_STENCIL; } else if (ctx->Stencil.WriteMask[0] != 0xff) { - tri_mask |= DD_STENCIL_BIT; + tri_mask |= BUFFER_BIT_STENCIL; } else { - blit_mask |= DD_STENCIL_BIT; + blit_mask |= BUFFER_BIT_STENCIL; } } - swrast_mask |= (mask & DD_ACCUM_BIT); + swrast_mask |= (mask & BUFFER_BIT_ACCUM); if (blit_mask) intelClearWithBlit( ctx, blit_mask, all, cx, cy, cw, ch ); diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index 82367184774..06caa1a6bea 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -27,7 +27,9 @@ #include "glheader.h" #include "context.h" +#include "framebuffer.h" #include "matrix.h" +#include "renderbuffer.h" #include "simple_list.h" #include "utils.h" #include "xmlpool.h" @@ -233,24 +235,78 @@ static void intelDestroyScreen(__DRIscreenPrivate *sPriv) sPriv->private = NULL; } + static GLboolean intelCreateBuffer( __DRIscreenPrivate *driScrnPriv, __DRIdrawablePrivate *driDrawPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) { + intelScreenPrivate *screen = (intelScreenPrivate *) driScrnPriv->private; + if (isPixmap) { return GL_FALSE; /* not implemented */ } else { GLboolean swStencil = (mesaVis->stencilBits > 0 && mesaVis->depthBits != 24); +#if 0 driDrawPriv->driverPrivate = (void *) _mesa_create_framebuffer(mesaVis, GL_FALSE, /* software depth buffer? */ swStencil, mesaVis->accumRedBits > 0, GL_FALSE /* s/w alpha planes */); - +#else + struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); + + { + driRenderbuffer *frontRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->frontOffset, screen->frontPitch); + intelSetSpanFunctions(frontRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); + } + + if (mesaVis->doubleBufferMode) { + driRenderbuffer *backRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->backOffset, screen->backPitch); + intelSetSpanFunctions(backRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + } + + if (mesaVis->depthBits == 16) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp, + screen->depthOffset, screen->depthPitch); + intelSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else if (mesaVis->depthBits == 24) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp, + screen->depthOffset, screen->depthPitch); + intelSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + + if (mesaVis->stencilBits > 0 && !swStencil) { + driRenderbuffer *stencilRb + = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp, + screen->depthOffset, screen->depthPitch); + intelSetSpanFunctions(stencilRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); + } + + _mesa_add_soft_renderbuffers(fb, + GL_FALSE, /* color */ + GL_FALSE, /* depth */ + swStencil, + mesaVis->accumRedBits > 0, + GL_FALSE, /* alpha */ + GL_FALSE /* aux */); + driDrawPriv->driverPrivate = (void *) fb; +#endif return (driDrawPriv->driverPrivate != NULL); } } diff --git a/src/mesa/drivers/dri/i915/intel_span.c b/src/mesa/drivers/dri/i915/intel_span.c index 494022b2957..7a051718aa2 100644 --- a/src/mesa/drivers/dri/i915/intel_span.c +++ b/src/mesa/drivers/dri/i915/intel_span.c @@ -247,10 +247,10 @@ static void intelSetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, GLuint bufferBit) { intelContextPtr intel = INTEL_CONTEXT(ctx); - if (bufferBit == DD_FRONT_LEFT_BIT) { + if (bufferBit == BUFFER_BIT_FRONT_LEFT) { intel->drawMap = (char *)intel->driScreen->pFB; intel->readMap = (char *)intel->driScreen->pFB; - } else if (bufferBit == DD_BACK_LEFT_BIT) { + } else if (bufferBit == BUFFER_BIT_BACK_LEFT) { intel->drawMap = intel->intelScreen->back.map; intel->readMap = intel->intelScreen->back.map; } else { @@ -288,6 +288,7 @@ void intelInitSpanFuncs( GLcontext *ctx ) switch (intelScreen->fbFormat) { case DV_PF_555: +#if 0 swdd->WriteRGBASpan = intelWriteRGBASpan_555; swdd->WriteRGBSpan = intelWriteRGBSpan_555; swdd->WriteMonoRGBASpan = intelWriteMonoRGBASpan_555; @@ -295,14 +296,15 @@ void intelInitSpanFuncs( GLcontext *ctx ) swdd->WriteMonoRGBAPixels = intelWriteMonoRGBAPixels_555; swdd->ReadRGBASpan = intelReadRGBASpan_555; swdd->ReadRGBAPixels = intelReadRGBAPixels_555; - swdd->ReadDepthSpan = intelReadDepthSpan_16; swdd->WriteDepthSpan = intelWriteDepthSpan_16; swdd->ReadDepthPixels = intelReadDepthPixels_16; swdd->WriteDepthPixels = intelWriteDepthPixels_16; +#endif break; case DV_PF_565: +#if 0 swdd->WriteRGBASpan = intelWriteRGBASpan_565; swdd->WriteRGBSpan = intelWriteRGBSpan_565; swdd->WriteMonoRGBASpan = intelWriteMonoRGBASpan_565; @@ -310,14 +312,15 @@ void intelInitSpanFuncs( GLcontext *ctx ) swdd->WriteMonoRGBAPixels = intelWriteMonoRGBAPixels_565; swdd->ReadRGBASpan = intelReadRGBASpan_565; swdd->ReadRGBAPixels = intelReadRGBAPixels_565; - swdd->ReadDepthSpan = intelReadDepthSpan_16; swdd->WriteDepthSpan = intelWriteDepthSpan_16; swdd->ReadDepthPixels = intelReadDepthPixels_16; swdd->WriteDepthPixels = intelWriteDepthPixels_16; +#endif break; case DV_PF_8888: +#if 0 swdd->WriteRGBASpan = intelWriteRGBASpan_8888; swdd->WriteRGBSpan = intelWriteRGBSpan_8888; swdd->WriteMonoRGBASpan = intelWriteMonoRGBASpan_8888; @@ -325,7 +328,6 @@ void intelInitSpanFuncs( GLcontext *ctx ) swdd->WriteMonoRGBAPixels = intelWriteMonoRGBAPixels_8888; swdd->ReadRGBASpan = intelReadRGBASpan_8888; swdd->ReadRGBAPixels = intelReadRGBAPixels_8888; - swdd->ReadDepthSpan = intelReadDepthSpan_24_8; swdd->WriteDepthSpan = intelWriteDepthSpan_24_8; swdd->ReadDepthPixels = intelReadDepthPixels_24_8; @@ -335,9 +337,75 @@ void intelInitSpanFuncs( GLcontext *ctx ) swdd->ReadStencilSpan = intelReadStencilSpan_24_8; swdd->WriteStencilPixels = intelWriteStencilPixels_24_8; swdd->ReadStencilPixels = intelReadStencilPixels_24_8; +#endif break; } swdd->SpanRenderStart = intelSpanRenderStart; swdd->SpanRenderFinish = intelSpanRenderFinish; } + + +/** + * Plug in the Get/Put routines for the given driRenderbuffer. + */ +void +intelSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) +{ + if (drb->Base.InternalFormat == GL_RGBA) { + if (vis->redBits == 5 && vis->greenBits == 5 && vis->blueBits == 5) { + drb->Base.GetRow = intelReadRGBASpan_555; + drb->Base.GetValues = intelReadRGBAPixels_555; + drb->Base.PutRow = intelWriteRGBASpan_555; + drb->Base.PutRowRGB = intelWriteRGBSpan_555; + drb->Base.PutMonoRow = intelWriteMonoRGBASpan_555; + drb->Base.PutValues = intelWriteRGBAPixels_555; + drb->Base.PutMonoValues = intelWriteMonoRGBAPixels_555; + } + else if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { + drb->Base.GetRow = intelReadRGBASpan_565; + drb->Base.GetValues = intelReadRGBAPixels_565; + drb->Base.PutRow = intelWriteRGBASpan_565; + drb->Base.PutRowRGB = intelWriteRGBSpan_565; + drb->Base.PutMonoRow = intelWriteMonoRGBASpan_565; + drb->Base.PutValues = intelWriteRGBAPixels_565; + drb->Base.PutMonoValues = intelWriteMonoRGBAPixels_565; + } + else { + assert(vis->redBits == 8); + assert(vis->greenBits == 8); + assert(vis->blueBits == 8); + drb->Base.GetRow = intelReadRGBASpan_8888; + drb->Base.GetValues = intelReadRGBAPixels_8888; + drb->Base.PutRow = intelWriteRGBASpan_8888; + drb->Base.PutRowRGB = intelWriteRGBSpan_8888; + drb->Base.PutMonoRow = intelWriteMonoRGBASpan_8888; + drb->Base.PutValues = intelWriteRGBAPixels_8888; + drb->Base.PutMonoValues = intelWriteMonoRGBAPixels_8888; + } + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + drb->Base.GetRow = intelReadDepthSpan_16; + drb->Base.GetValues = intelReadDepthPixels_16; + drb->Base.PutRow = intelWriteDepthSpan_16; + drb->Base.PutMonoRow = intelWriteMonoDepthSpan_16; + drb->Base.PutValues = intelWriteDepthPixels_16; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + drb->Base.GetRow = intelReadDepthSpan_24_8; + drb->Base.GetValues = intelReadDepthPixels_24_8; + drb->Base.PutRow = intelWriteDepthSpan_24_8; + drb->Base.PutMonoRow = intelWriteMonoDepthSpan_24_8; + drb->Base.PutValues = intelWriteDepthPixels_24_8; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + drb->Base.GetRow = intelReadStencilSpan_24_8; + drb->Base.GetValues = intelReadStencilPixels_24_8; + drb->Base.PutRow = intelWriteStencilSpan_24_8; + drb->Base.PutMonoRow = intelWriteMonoStencilSpan_24_8; + drb->Base.PutValues = intelWriteStencilPixels_24_8; + drb->Base.PutMonoValues = NULL; + } +} diff --git a/src/mesa/drivers/dri/i915/intel_span.h b/src/mesa/drivers/dri/i915/intel_span.h index 3ff710b9c47..2d4f8589d0f 100644 --- a/src/mesa/drivers/dri/i915/intel_span.h +++ b/src/mesa/drivers/dri/i915/intel_span.h @@ -28,9 +28,14 @@ #ifndef _INTEL_SPAN_H #define _INTEL_SPAN_H +#include "drirenderbuffer.h" + extern void intelInitSpanFuncs( GLcontext *ctx ); extern void intelSpanRenderFinish( GLcontext *ctx ); extern void intelSpanRenderStart( GLcontext *ctx ); +extern void +intelSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); + #endif diff --git a/src/mesa/drivers/dri/i915/intel_state.c b/src/mesa/drivers/dri/i915/intel_state.c index 76bfaec18f5..db6a140d2d5 100644 --- a/src/mesa/drivers/dri/i915/intel_state.c +++ b/src/mesa/drivers/dri/i915/intel_state.c @@ -170,12 +170,12 @@ static void intelDrawBuffer(GLcontext *ctx, GLenum mode ) intelScreenPrivate *screen = intel->intelScreen; int front = 0; - switch ( ctx->Color._DrawDestMask[0] ) { - case DD_FRONT_LEFT_BIT: + switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) { + case BUFFER_BIT_FRONT_LEFT: front = 1; FALLBACK( intel, INTEL_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: front = 0; FALLBACK( intel, INTEL_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c index 1978c5d6151..8f508fa9114 100644 --- a/src/mesa/drivers/dri/mach64/mach64_context.c +++ b/src/mesa/drivers/dri/mach64/mach64_context.c @@ -306,14 +306,14 @@ mach64MakeCurrent( __DRIcontextPrivate *driContextPriv, mach64CalcViewport( newMach64Ctx->glCtx ); } - _mesa_make_current2( newMach64Ctx->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); + _mesa_make_current( newMach64Ctx->glCtx, + (GLframebuffer *) driDrawPriv->driverPrivate, + (GLframebuffer *) driReadPriv->driverPrivate ); newMach64Ctx->new_state |= MACH64_NEW_CLIP; } else { - _mesa_make_current( 0, 0 ); + _mesa_make_current( NULL, NULL, NULL ); } return GL_TRUE; diff --git a/src/mesa/drivers/dri/mach64/mach64_dd.c b/src/mesa/drivers/dri/mach64/mach64_dd.c index f1248bd8b7f..c0bb8629fad 100644 --- a/src/mesa/drivers/dri/mach64/mach64_dd.c +++ b/src/mesa/drivers/dri/mach64/mach64_dd.c @@ -37,6 +37,7 @@ #include "context.h" #include "utils.h" +#include "framebuffer.h" #define DRIVER_DATE "20030502" @@ -126,7 +127,7 @@ static void mach64DDFinish( GLcontext *ctx ) void mach64InitDriverFuncs( struct dd_function_table *functions ) { functions->GetBufferSize = mach64DDGetBufferSize; - functions->ResizeBuffers = _swrast_alloc_buffers; + functions->ResizeBuffers = _mesa_resize_framebuffer; functions->GetString = mach64DDGetString; functions->Finish = mach64DDFinish; functions->Flush = mach64DDFlush; diff --git a/src/mesa/drivers/dri/mach64/mach64_ioctl.c b/src/mesa/drivers/dri/mach64/mach64_ioctl.c index 752aa6ef4a7..1889dc2b93c 100644 --- a/src/mesa/drivers/dri/mach64/mach64_ioctl.c +++ b/src/mesa/drivers/dri/mach64/mach64_ioctl.c @@ -683,19 +683,19 @@ static void mach64DDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, mmesa->new_state = save_state & ~(MACH64_NEW_MASKS | MACH64_NEW_CLIP); } - if ( mask & DD_FRONT_LEFT_BIT ) { + if ( mask & BUFFER_BIT_FRONT_LEFT ) { flags |= MACH64_FRONT; - mask &= ~DD_FRONT_LEFT_BIT; + mask &= ~BUFFER_BIT_FRONT_LEFT; } - if ( mask & DD_BACK_LEFT_BIT ) { + if ( mask & BUFFER_BIT_BACK_LEFT ) { flags |= MACH64_BACK; - mask &= ~DD_BACK_LEFT_BIT; + mask &= ~BUFFER_BIT_BACK_LEFT; } - if ( ( mask & DD_DEPTH_BIT ) && ctx->Depth.Mask ) { + if ( ( mask & BUFFER_BIT_DEPTH ) && ctx->Depth.Mask ) { flags |= MACH64_DEPTH; - mask &= ~DD_DEPTH_BIT; + mask &= ~BUFFER_BIT_DEPTH; } if ( mask ) diff --git a/src/mesa/drivers/dri/mach64/mach64_lock.c b/src/mesa/drivers/dri/mach64/mach64_lock.c index ea926944ed4..3d41d71b371 100644 --- a/src/mesa/drivers/dri/mach64/mach64_lock.c +++ b/src/mesa/drivers/dri/mach64/mach64_lock.c @@ -69,7 +69,7 @@ void mach64GetLock( mach64ContextPtr mmesa, GLuint flags ) if ( mmesa->lastStamp != dPriv->lastStamp ) { mmesa->lastStamp = dPriv->lastStamp; - if (mmesa->glCtx->Color._DrawDestMask[0] == DD_BACK_LEFT_BIT) + if (mmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT) mach64SetCliprects( mmesa->glCtx, GL_BACK_LEFT ); else mach64SetCliprects( mmesa->glCtx, GL_FRONT_LEFT ); diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index c5806adc3d1..471ae1648e7 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -33,9 +33,12 @@ #include "mach64_ioctl.h" #include "mach64_tris.h" #include "mach64_vb.h" +#include "mach64_span.h" #include "context.h" #include "imports.h" +#include "framebuffer.h" +#include "renderbuffer.h" #include "utils.h" #include "vblank.h" @@ -355,6 +358,7 @@ mach64DestroyScreen( __DRIscreenPrivate *driScreen ) driScreen->private = NULL; } + /* Create and initialize the Mesa and driver specific pixmap buffer * data. */ @@ -364,16 +368,62 @@ mach64CreateBuffer( __DRIscreenPrivate *driScrnPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) { + mach64ScreenPtr screen = (mach64ScreenPtr) driScrnPriv->private; + if (isPixmap) { return GL_FALSE; /* not implemented */ } else { +#if 0 driDrawPriv->driverPrivate = (void *) _mesa_create_framebuffer( mesaVis, GL_FALSE, /* software depth buffer? */ mesaVis->stencilBits > 0, mesaVis->accumRedBits > 0, mesaVis->alphaBits > 0 ); +#else + struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); + + { + driRenderbuffer *frontRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->frontOffset, screen->frontPitch); + mach64SetSpanFunctions(frontRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); + } + + if (mesaVis->doubleBufferMode) { + driRenderbuffer *backRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->backOffset, screen->backPitch); + mach64SetSpanFunctions(backRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + } + + if (mesaVis->depthBits == 16) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp, + screen->depthOffset, screen->depthPitch); + mach64SetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else if (mesaVis->depthBits == 24) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp, + screen->depthOffset, screen->depthPitch); + mach64SetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + + _mesa_add_soft_renderbuffers(fb, + GL_FALSE, /* color */ + GL_FALSE, /* depth */ + mesaVis->stencilBits > 0, + mesaVis->accumRedBits > 0, + GL_FALSE, /* alpha */ + GL_FALSE /* aux */); + driDrawPriv->driverPrivate = (void *) fb; +#endif return (driDrawPriv->driverPrivate != NULL); } } diff --git a/src/mesa/drivers/dri/mach64/mach64_span.c b/src/mesa/drivers/dri/mach64/mach64_span.c index 3e553a90941..12849eebe01 100644 --- a/src/mesa/drivers/dri/mach64/mach64_span.c +++ b/src/mesa/drivers/dri/mach64/mach64_span.c @@ -200,15 +200,15 @@ static void mach64DDSetBuffer( GLcontext *ctx, mach64ContextPtr mmesa = MACH64_CONTEXT(ctx); switch ( bufferBit ) { - case DD_FRONT_LEFT_BIT: + case BUFFER_BIT_FRONT_LEFT: if (MACH64_DEBUG & DEBUG_VERBOSE_MSG) - fprintf(stderr,"%s: DD_FRONT_LEFT_BIT\n", __FUNCTION__); + fprintf(stderr,"%s: BUFFER_BIT_FRONT_LEFT\n", __FUNCTION__); mmesa->drawOffset = mmesa->readOffset = mmesa->mach64Screen->frontOffset; mmesa->drawPitch = mmesa->readPitch = mmesa->mach64Screen->frontPitch; break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: if (MACH64_DEBUG & DEBUG_VERBOSE_MSG) - fprintf(stderr,"%s: DD_BACK_LEFT_BIT\n", __FUNCTION__); + fprintf(stderr,"%s: BUFFER_BIT_BACK_LEFT\n", __FUNCTION__); mmesa->drawOffset = mmesa->readOffset = mmesa->mach64Screen->backOffset; mmesa->drawPitch = mmesa->readPitch = mmesa->mach64Screen->backPitch; break; @@ -220,12 +220,14 @@ static void mach64DDSetBuffer( GLcontext *ctx, void mach64DDInitSpanFuncs( GLcontext *ctx ) { +#if 0 mach64ContextPtr mmesa = MACH64_CONTEXT(ctx); +#endif struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); swdd->SetBuffer = mach64DDSetBuffer; - +#if 0 switch ( mmesa->mach64Screen->cpp ) { case 2: swdd->WriteRGBASpan = mach64WriteRGBASpan_RGB565; @@ -251,13 +253,15 @@ void mach64DDInitSpanFuncs( GLcontext *ctx ) default: break; } +#endif /* Depth buffer is always 16 bit */ +#if 0 swdd->ReadDepthSpan = mach64ReadDepthSpan_16; swdd->WriteDepthSpan = mach64WriteDepthSpan_16; swdd->ReadDepthPixels = mach64ReadDepthPixels_16; swdd->WriteDepthPixels = mach64WriteDepthPixels_16; - +#endif /* No hardware stencil buffer */ swdd->ReadStencilSpan = NULL; swdd->WriteStencilSpan = NULL; @@ -272,3 +276,58 @@ void mach64DDInitSpanFuncs( GLcontext *ctx ) swdd->ReadCI32Span = NULL; swdd->ReadCI32Pixels = NULL; } + + +/** + * Plug in the Get/Put routines for the given driRenderbuffer. + */ +void +mach64SetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) +{ + if (drb->Base.InternalFormat == GL_RGBA) { + if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { + drb->Base.GetRow = mach64ReadRGBASpan_RGB565; + drb->Base.GetValues = mach64ReadRGBAPixels_RGB565; + drb->Base.PutRow = mach64WriteRGBASpan_RGB565; + drb->Base.PutRowRGB = mach64WriteRGBSpan_RGB565; + drb->Base.PutMonoRow = mach64WriteMonoRGBASpan_RGB565; + drb->Base.PutValues = mach64WriteRGBAPixels_RGB565; + drb->Base.PutMonoValues = mach64WriteMonoRGBAPixels_RGB565; + } + else { + drb->Base.GetRow = mach64ReadRGBASpan_ARGB8888; + drb->Base.GetValues = mach64ReadRGBAPixels_ARGB8888; + drb->Base.PutRow = mach64WriteRGBASpan_ARGB8888; + drb->Base.PutRowRGB = mach64WriteRGBSpan_ARGB8888; + drb->Base.PutMonoRow = mach64WriteMonoRGBASpan_ARGB8888; + drb->Base.PutValues = mach64WriteRGBAPixels_ARGB8888; + drb->Base.PutMonoValues = mach64WriteMonoRGBAPixels_ARGB8888; + } + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + drb->Base.GetRow = mach64ReadDepthSpan_16; + drb->Base.GetValues = mach64ReadDepthPixels_16; + drb->Base.PutRow = mach64WriteDepthSpan_16; + drb->Base.PutMonoRow = mach64WriteMonoDepthSpan_16; + drb->Base.PutValues = mach64WriteDepthPixels_16; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + /* never */ + drb->Base.GetRow = NULL; + drb->Base.GetValues = NULL; + drb->Base.PutRow = NULL; + drb->Base.PutMonoRow = NULL; + drb->Base.PutValues = NULL; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + /* never */ + drb->Base.GetRow = NULL; + drb->Base.GetValues = NULL; + drb->Base.PutRow = NULL; + drb->Base.PutMonoRow = NULL; + drb->Base.PutValues = NULL; + drb->Base.PutMonoValues = NULL; + } +} diff --git a/src/mesa/drivers/dri/mach64/mach64_span.h b/src/mesa/drivers/dri/mach64/mach64_span.h index b83ac7c721f..0f4c766477d 100644 --- a/src/mesa/drivers/dri/mach64/mach64_span.h +++ b/src/mesa/drivers/dri/mach64/mach64_span.h @@ -31,6 +31,11 @@ #ifndef __MACH64_SPAN_H__ #define __MACH64_SPAN_H__ +#include "drirenderbuffer.h" + extern void mach64DDInitSpanFuncs( GLcontext *ctx ); +extern void +mach64SetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); + #endif diff --git a/src/mesa/drivers/dri/mach64/mach64_state.c b/src/mesa/drivers/dri/mach64/mach64_state.c index ea55124d916..d9b5725a638 100644 --- a/src/mesa/drivers/dri/mach64/mach64_state.c +++ b/src/mesa/drivers/dri/mach64/mach64_state.c @@ -732,18 +732,18 @@ static void mach64DDDrawBuffer( GLcontext *ctx, GLenum mode ) /* * _DrawDestMask is easier to cope with than . */ - switch ( ctx->Color._DrawDestMask[0] ) { - case DD_FRONT_LEFT_BIT: + switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) { + case BUFFER_BIT_FRONT_LEFT: FALLBACK( mmesa, MACH64_FALLBACK_DRAW_BUFFER, GL_FALSE ); mach64SetCliprects( ctx, GL_FRONT_LEFT ); if (MACH64_DEBUG & DEBUG_VERBOSE_MSG) - fprintf(stderr,"%s: DD_FRONT_LEFT_BIT\n", __FUNCTION__); + fprintf(stderr,"%s: BUFFER_BIT_FRONT_LEFT\n", __FUNCTION__); break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: FALLBACK( mmesa, MACH64_FALLBACK_DRAW_BUFFER, GL_FALSE ); mach64SetCliprects( ctx, GL_BACK_LEFT ); if (MACH64_DEBUG & DEBUG_VERBOSE_MSG) - fprintf(stderr,"%s: DD_BACK_LEFT_BIT\n", __FUNCTION__); + fprintf(stderr,"%s: BUFFER_BIT_BACK_LEFT\n", __FUNCTION__); break; default: /* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */ diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 9a3b331e8c3..6312997ce64 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -34,6 +34,8 @@ #include "matrix.h" #include "simple_list.h" #include "imports.h" +#include "framebuffer.h" +#include "renderbuffer.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -55,7 +57,6 @@ #include "mga_xmesa.h" #include "mga_dri.h" - #include "utils.h" #include "vblank.h" @@ -721,6 +722,8 @@ mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) { + mgaScreenPrivate *screen = (mgaScreenPrivate *) driScrnPriv->private; + if (isPixmap) { return GL_FALSE; /* not implemented */ } @@ -728,12 +731,81 @@ mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv, GLboolean swStencil = (mesaVis->stencilBits > 0 && mesaVis->depthBits != 24); +#if 0 driDrawPriv->driverPrivate = (void *) _mesa_create_framebuffer(mesaVis, GL_FALSE, /* software depth buffer? */ swStencil, mesaVis->accumRedBits > 0, mesaVis->alphaBits > 0 ); +#else + struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); + + { + driRenderbuffer *frontRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->frontOffset, screen->frontPitch); + mgaSetSpanFunctions(frontRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); + } + + if (mesaVis->doubleBufferMode) { + driRenderbuffer *backRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->backOffset, screen->backPitch); + mgaSetSpanFunctions(backRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + } + + if (mesaVis->depthBits == 16) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp, + screen->depthOffset, screen->depthPitch); + mgaSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else if (mesaVis->depthBits == 24) { + /* XXX is this right? */ + if (mesaVis->stencilBits) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp, + screen->depthOffset, screen->depthPitch); + mgaSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT32, screen->cpp, + screen->depthOffset, screen->depthPitch); + mgaSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + } + else if (mesaVis->depthBits == 32) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT32, screen->cpp, + screen->depthOffset, screen->depthPitch); + mgaSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + + if (mesaVis->stencilBits > 0 && !swStencil) { + driRenderbuffer *stencilRb + = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp, + screen->depthOffset, screen->depthPitch); + mgaSetSpanFunctions(stencilRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); + } + + _mesa_add_soft_renderbuffers(fb, + GL_FALSE, /* color */ + GL_FALSE, /* depth */ + swStencil, + mesaVis->accumRedBits > 0, + GL_FALSE, /* alpha */ + GL_FALSE /* aux */); + driDrawPriv->driverPrivate = (void *) fb; +#endif return (driDrawPriv->driverPrivate != NULL); } @@ -799,12 +871,12 @@ mgaMakeCurrent(__DRIcontextPrivate *driContextPriv, mmesa->driReadable = driReadPriv; - _mesa_make_current2(mmesa->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate); + _mesa_make_current(mmesa->glCtx, + (GLframebuffer *) driDrawPriv->driverPrivate, + (GLframebuffer *) driReadPriv->driverPrivate); } else { - _mesa_make_current(NULL, NULL); + _mesa_make_current(NULL, NULL, NULL); } return GL_TRUE; diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.h b/src/mesa/drivers/dri/mga/mga_xmesa.h index f78f806c771..51cc1295808 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.h +++ b/src/mesa/drivers/dri/mga/mga_xmesa.h @@ -83,6 +83,17 @@ typedef struct mga_screen_private_s { } mgaScreenPrivate; +/** + * mgaRenderbuffer, derived from Mesa's gl_renderbuffer + */ +typedef struct { + struct gl_renderbuffer Base; + /* XXX per-window info should go here */ + int foo, bar; +} mgaRenderbuffer; + + + #include "mgacontext.h" extern void mgaGetLock( mgaContextPtr mmesa, GLuint flags ); diff --git a/src/mesa/drivers/dri/mga/mgadd.c b/src/mesa/drivers/dri/mga/mgadd.c index e8436f23846..7310641efa3 100644 --- a/src/mesa/drivers/dri/mga/mgadd.c +++ b/src/mesa/drivers/dri/mga/mgadd.c @@ -28,6 +28,7 @@ #include "mtypes.h" +#include "framebuffer.h" #include "mm.h" #include "mgacontext.h" @@ -92,6 +93,6 @@ static void mgaBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height) void mgaInitDriverFuncs( struct dd_function_table *functions ) { functions->GetBufferSize = mgaBufferSize; - functions->ResizeBuffers = _swrast_alloc_buffers; + functions->ResizeBuffers = _mesa_resize_framebuffer; functions->GetString = mgaGetString; } diff --git a/src/mesa/drivers/dri/mga/mgaioctl.c b/src/mesa/drivers/dri/mga/mgaioctl.c index 097fcd6cbd1..29c06dcbbc4 100644 --- a/src/mesa/drivers/dri/mga/mgaioctl.c +++ b/src/mesa/drivers/dri/mga/mgaioctl.c @@ -175,30 +175,30 @@ mgaClear( GLcontext *ctx, GLbitfield mask, GLboolean all, FLUSH_BATCH( mmesa ); - if ( mask & DD_FRONT_LEFT_BIT ) { + if ( mask & BUFFER_BIT_FRONT_LEFT ) { flags |= MGA_FRONT; color_mask = mmesa->setup.plnwt; - mask &= ~DD_FRONT_LEFT_BIT; + mask &= ~BUFFER_BIT_FRONT_LEFT; } - if ( mask & DD_BACK_LEFT_BIT ) { + if ( mask & BUFFER_BIT_BACK_LEFT ) { flags |= MGA_BACK; color_mask = mmesa->setup.plnwt; - mask &= ~DD_BACK_LEFT_BIT; + mask &= ~BUFFER_BIT_BACK_LEFT; } - if ( (mask & DD_DEPTH_BIT) && ctx->Depth.Mask ) { + if ( (mask & BUFFER_BIT_DEPTH) && ctx->Depth.Mask ) { flags |= MGA_DEPTH; clear_depth = (mmesa->ClearDepth & mmesa->depth_clear_mask); depth_mask |= mmesa->depth_clear_mask; - mask &= ~DD_DEPTH_BIT; + mask &= ~BUFFER_BIT_DEPTH; } - if ( (mask & DD_STENCIL_BIT) && mmesa->hw_stencil ) { + if ( (mask & BUFFER_BIT_STENCIL) && mmesa->hw_stencil ) { flags |= MGA_DEPTH; clear_depth |= (ctx->Stencil.Clear & mmesa->stencil_clear_mask); depth_mask |= mmesa->stencil_clear_mask; - mask &= ~DD_STENCIL_BIT; + mask &= ~BUFFER_BIT_STENCIL; } if ( flags ) { diff --git a/src/mesa/drivers/dri/mga/mgaspan.c b/src/mesa/drivers/dri/mga/mgaspan.c index 4b2c5cd6829..4279dfd95bc 100644 --- a/src/mesa/drivers/dri/mga/mgaspan.c +++ b/src/mesa/drivers/dri/mga/mgaspan.c @@ -204,9 +204,9 @@ static void mgaDDSetBuffer(GLcontext *ctx, GLframebuffer *buffer, mgaContextPtr mmesa = MGA_CONTEXT(ctx); unsigned int offset; - assert((bufferBit == DD_FRONT_LEFT_BIT) || (bufferBit == DD_BACK_LEFT_BIT)); + assert((bufferBit == BUFFER_BIT_FRONT_LEFT) || (bufferBit == BUFFER_BIT_BACK_LEFT)); - offset = (bufferBit == DD_FRONT_LEFT_BIT) + offset = (bufferBit == BUFFER_BIT_FRONT_LEFT) ? mmesa->mgaScreen->frontOffset : mmesa->mgaScreen->backOffset; @@ -237,15 +237,17 @@ void mgaDDInitSpanFuncs( GLcontext *ctx ) switch (mmesa->mgaScreen->cpp) { case 2: +#if 0 mgaInitPointers_565( swdd ); - swdd->ReadDepthSpan = mgaReadDepthSpan_16; swdd->WriteDepthSpan = mgaWriteDepthSpan_16; swdd->ReadDepthPixels = mgaReadDepthPixels_16; swdd->WriteDepthPixels = mgaWriteDepthPixels_16; +#endif break; case 4: +#if 0 mgaInitPointers_8888( swdd ); if (!mmesa->hw_stencil) { @@ -264,6 +266,57 @@ void mgaDDInitSpanFuncs( GLcontext *ctx ) swdd->ReadStencilPixels = mgaReadStencilPixels_24_8; swdd->WriteStencilPixels = mgaWriteStencilPixels_24_8; } +#endif break; } } + + + +/** + * Plug in the Get/Put routines for the given driRenderbuffer. + */ +void +mgaSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) +{ + if (drb->Base.InternalFormat == GL_RGBA) { + if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { + mgaInitPointers_565(&drb->Base); + } + else { + mgaInitPointers_8888(&drb->Base); + } + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + drb->Base.GetRow = mgaReadDepthSpan_16; + drb->Base.GetValues = mgaReadDepthPixels_16; + drb->Base.PutRow = mgaWriteDepthSpan_16; + drb->Base.PutMonoRow = mgaWriteMonoDepthSpan_16; + drb->Base.PutValues = mgaWriteDepthPixels_16; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + drb->Base.GetRow = mgaReadDepthSpan_24_8; + drb->Base.GetValues = mgaReadDepthPixels_24_8; + drb->Base.PutRow = mgaWriteDepthSpan_24_8; + drb->Base.PutMonoRow = mgaWriteMonoDepthSpan_24_8; + drb->Base.PutValues = mgaWriteDepthPixels_24_8; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT32) { + drb->Base.GetRow = mgaReadDepthSpan_32; + drb->Base.GetValues = mgaReadDepthPixels_32; + drb->Base.PutRow = mgaWriteDepthSpan_32; + drb->Base.PutMonoRow = mgaWriteMonoDepthSpan_32; + drb->Base.PutValues = mgaWriteDepthPixels_32; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + drb->Base.GetRow = mgaReadStencilSpan_24_8; + drb->Base.GetValues = mgaReadStencilPixels_24_8; + drb->Base.PutRow = mgaWriteStencilSpan_24_8; + drb->Base.PutMonoRow = mgaWriteMonoStencilSpan_24_8; + drb->Base.PutValues = mgaWriteStencilPixels_24_8; + drb->Base.PutMonoValues = NULL; + } +} diff --git a/src/mesa/drivers/dri/mga/mgaspan.h b/src/mesa/drivers/dri/mga/mgaspan.h index 80583daca2d..f133a51c083 100644 --- a/src/mesa/drivers/dri/mga/mgaspan.h +++ b/src/mesa/drivers/dri/mga/mgaspan.h @@ -29,6 +29,12 @@ #ifndef _MGA_SPAN_H #define _MGA_SPAN_H +#include "drirenderbuffer.h" + extern void mgaDDInitSpanFuncs( GLcontext *ctx ); +extern void +mgaSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); + + #endif diff --git a/src/mesa/drivers/dri/mga/mgastate.c b/src/mesa/drivers/dri/mga/mgastate.c index 69cc0f33a70..72d5c9fb082 100644 --- a/src/mesa/drivers/dri/mga/mgastate.c +++ b/src/mesa/drivers/dri/mga/mgastate.c @@ -825,15 +825,15 @@ static void mgaDDDrawBuffer(GLcontext *ctx, GLenum mode ) /* * _DrawDestMask is easier to cope with than . */ - switch ( ctx->Color._DrawDestMask[0] ) { - case DD_FRONT_LEFT_BIT: + switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) { + case BUFFER_BIT_FRONT_LEFT: mmesa->setup.dstorg = mmesa->mgaScreen->frontOffset; mmesa->dirty |= MGA_UPLOAD_CONTEXT; mmesa->draw_buffer = MGA_FRONT; mgaXMesaSetFrontClipRects( mmesa ); FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: mmesa->setup.dstorg = mmesa->mgaScreen->backOffset; mmesa->draw_buffer = MGA_BACK; mmesa->dirty |= MGA_UPLOAD_CONTEXT; diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c index 2f417d9097f..587cd0496b6 100644 --- a/src/mesa/drivers/dri/r128/r128_context.c +++ b/src/mesa/drivers/dri/r128/r128_context.c @@ -337,13 +337,13 @@ r128MakeCurrent( __DRIcontextPrivate *driContextPriv, driDrawableInitVBlank( driDrawPriv, newR128Ctx->vblank_flags ); newR128Ctx->driDrawable = driDrawPriv; - _mesa_make_current2( newR128Ctx->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); + _mesa_make_current( newR128Ctx->glCtx, + (GLframebuffer *) driDrawPriv->driverPrivate, + (GLframebuffer *) driReadPriv->driverPrivate ); newR128Ctx->new_state |= R128_NEW_WINDOW | R128_NEW_CLIP; } else { - _mesa_make_current( 0, 0 ); + _mesa_make_current( NULL, NULL, NULL ); } return GL_TRUE; diff --git a/src/mesa/drivers/dri/r128/r128_dd.c b/src/mesa/drivers/dri/r128/r128_dd.c index 22b68467ac2..59480b25d8f 100644 --- a/src/mesa/drivers/dri/r128/r128_dd.c +++ b/src/mesa/drivers/dri/r128/r128_dd.c @@ -40,6 +40,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "swrast/swrast.h" #include "context.h" +#include "framebuffer.h" #include "utils.h" @@ -140,7 +141,7 @@ static void r128Finish( GLcontext *ctx ) void r128InitDriverFuncs( struct dd_function_table *functions ) { functions->GetBufferSize = r128GetBufferSize; - functions->ResizeBuffers = _swrast_alloc_buffers; + functions->ResizeBuffers = _mesa_resize_framebuffer; functions->GetString = r128GetString; functions->Finish = r128Finish; functions->Flush = r128Flush; diff --git a/src/mesa/drivers/dri/r128/r128_ioctl.c b/src/mesa/drivers/dri/r128/r128_ioctl.c index 2ae0f6fa6b8..fc017329ca2 100644 --- a/src/mesa/drivers/dri/r128/r128_ioctl.c +++ b/src/mesa/drivers/dri/r128/r128_ioctl.c @@ -429,25 +429,25 @@ static void r128Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, rmesa->new_state = save_state & ~R128_NEW_MASKS; } - if ( mask & DD_FRONT_LEFT_BIT ) { + if ( mask & BUFFER_BIT_FRONT_LEFT ) { flags |= R128_FRONT; - mask &= ~DD_FRONT_LEFT_BIT; + mask &= ~BUFFER_BIT_FRONT_LEFT; } - if ( mask & DD_BACK_LEFT_BIT ) { + if ( mask & BUFFER_BIT_BACK_LEFT ) { flags |= R128_BACK; - mask &= ~DD_BACK_LEFT_BIT; + mask &= ~BUFFER_BIT_BACK_LEFT; } - if ( ( mask & DD_DEPTH_BIT ) && ctx->Depth.Mask ) { + if ( ( mask & BUFFER_BIT_DEPTH ) && ctx->Depth.Mask ) { flags |= R128_DEPTH; - mask &= ~DD_DEPTH_BIT; + mask &= ~BUFFER_BIT_DEPTH; } #if 0 /* FIXME: Add stencil support */ - if ( mask & DD_STENCIL_BIT ) { + if ( mask & BUFFER_BIT_STENCIL ) { flags |= DRM_R128_DEPTH_BUFFER; - mask &= ~DD_STENCIL_BIT; + mask &= ~BUFFER_BIT_STENCIL; } #endif diff --git a/src/mesa/drivers/dri/r128/r128_lock.c b/src/mesa/drivers/dri/r128/r128_lock.c index f4b43d56c10..ea4ccfb2ec9 100644 --- a/src/mesa/drivers/dri/r128/r128_lock.c +++ b/src/mesa/drivers/dri/r128/r128_lock.c @@ -52,7 +52,7 @@ r128UpdatePageFlipping( r128ContextPtr rmesa ) rmesa->doPageFlip = rmesa->sarea->pfAllowPageFlip; - use_back = (rmesa->glCtx->Color._DrawDestMask[0] == DD_BACK_LEFT_BIT); + use_back = (rmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT); use_back ^= (rmesa->sarea->pfCurrentPage == 1); if ( R128_DEBUG & DEBUG_VERBOSE_API ) diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index 6bef391e962..bd0585b7734 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -37,10 +37,13 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r128_context.h" #include "r128_ioctl.h" +#include "r128_span.h" #include "r128_tris.h" #include "context.h" #include "imports.h" +#include "framebuffer.h" +#include "renderbuffer.h" #include "utils.h" #include "vblank.h" @@ -260,16 +263,62 @@ r128CreateBuffer( __DRIscreenPrivate *driScrnPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) { + r128ScreenPtr screen = (r128ScreenPtr) driScrnPriv->private; + if (isPixmap) { return GL_FALSE; /* not implemented */ } else { +#if 0 driDrawPriv->driverPrivate = (void *) _mesa_create_framebuffer( mesaVis, GL_FALSE, /* software depth buffer? */ mesaVis->stencilBits > 0, mesaVis->accumRedBits > 0, mesaVis->alphaBits > 0 ); +#else + struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); + + { + driRenderbuffer *frontRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->frontOffset, screen->frontPitch); + r128SetSpanFunctions(frontRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); + } + + if (mesaVis->doubleBufferMode) { + driRenderbuffer *backRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->backOffset, screen->backPitch); + r128SetSpanFunctions(backRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + } + + if (mesaVis->depthBits == 16) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp, + screen->depthOffset, screen->depthPitch); + r128SetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else if (mesaVis->depthBits == 24) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp, + screen->depthOffset, screen->depthPitch); + r128SetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + + _mesa_add_soft_renderbuffers(fb, + GL_FALSE, /* color */ + GL_FALSE, /* depth */ + mesaVis->stencilBits > 0, + mesaVis->accumRedBits > 0, + GL_FALSE, /* alpha */ + GL_FALSE /* aux */); + driDrawPriv->driverPrivate = (void *) fb; +#endif return (driDrawPriv->driverPrivate != NULL); } } diff --git a/src/mesa/drivers/dri/r128/r128_span.c b/src/mesa/drivers/dri/r128/r128_span.c index 457e371edce..b59706118e4 100644 --- a/src/mesa/drivers/dri/r128/r128_span.c +++ b/src/mesa/drivers/dri/r128/r128_span.c @@ -335,7 +335,7 @@ static void r128DDSetBuffer( GLcontext *ctx, r128ContextPtr rmesa = R128_CONTEXT(ctx); switch ( bufferBit ) { - case DD_FRONT_LEFT_BIT: + case BUFFER_BIT_FRONT_LEFT: if ( rmesa->sarea->pfCurrentPage == 1 ) { rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->backOffset; rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->backPitch; @@ -344,7 +344,7 @@ static void r128DDSetBuffer( GLcontext *ctx, rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->frontPitch; } break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: if ( rmesa->sarea->pfCurrentPage == 1 ) { rmesa->drawOffset = rmesa->readOffset = rmesa->r128Screen->frontOffset; rmesa->drawPitch = rmesa->readPitch = rmesa->r128Screen->frontPitch; @@ -368,11 +368,15 @@ void r128DDInitSpanFuncs( GLcontext *ctx ) switch ( rmesa->r128Screen->cpp ) { case 2: +#if 0 r128InitPointers_RGB565( swdd ); +#endif break; case 4: +#if 0 r128InitPointers_ARGB8888( swdd ); +#endif break; default: @@ -381,17 +385,21 @@ void r128DDInitSpanFuncs( GLcontext *ctx ) switch ( rmesa->glCtx->Visual.depthBits ) { case 16: +#if 0 swdd->ReadDepthSpan = r128ReadDepthSpan_16; swdd->WriteDepthSpan = r128WriteDepthSpan_16; swdd->ReadDepthPixels = r128ReadDepthPixels_16; swdd->WriteDepthPixels = r128WriteDepthPixels_16; +#endif break; case 24: +#if 0 swdd->ReadDepthSpan = r128ReadDepthSpan_24_8; swdd->WriteDepthSpan = r128WriteDepthSpan_24_8; swdd->ReadDepthPixels = r128ReadDepthPixels_24_8; swdd->WriteDepthPixels = r128WriteDepthPixels_24_8; +#endif break; default: @@ -406,3 +414,44 @@ void r128DDInitSpanFuncs( GLcontext *ctx ) swdd->ReadCI32Span = NULL; swdd->ReadCI32Pixels = NULL; } + + +/** + * Plug in the Get/Put routines for the given driRenderbuffer. + */ +void +r128SetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) +{ + if (drb->Base.InternalFormat == GL_RGBA) { + if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { + r128InitPointers_RGB565(&drb->Base); + } + else { + r128InitPointers_ARGB8888(&drb->Base); + } + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + drb->Base.GetRow = r128ReadDepthSpan_16; + drb->Base.GetValues = r128ReadDepthPixels_16; + drb->Base.PutRow = r128WriteDepthSpan_16; + drb->Base.PutMonoRow = r128WriteMonoDepthSpan_16; + drb->Base.PutValues = r128WriteDepthPixels_16; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + drb->Base.GetRow = r128ReadDepthSpan_24_8; + drb->Base.GetValues = r128ReadDepthPixels_24_8; + drb->Base.PutRow = r128WriteDepthSpan_24_8; + drb->Base.PutMonoRow = r128WriteMonoDepthSpan_24_8; + drb->Base.PutValues = r128WriteDepthPixels_24_8; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + drb->Base.GetRow = NULL; + drb->Base.GetValues = NULL; + drb->Base.PutRow = NULL; + drb->Base.PutMonoRow = NULL; + drb->Base.PutValues = NULL; + drb->Base.PutMonoValues = NULL; + } +} diff --git a/src/mesa/drivers/dri/r128/r128_span.h b/src/mesa/drivers/dri/r128/r128_span.h index 03de567b32e..fd7c2d1394a 100644 --- a/src/mesa/drivers/dri/r128/r128_span.h +++ b/src/mesa/drivers/dri/r128/r128_span.h @@ -36,6 +36,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __R128_SPAN_H__ #define __R128_SPAN_H__ +#include "drirenderbuffer.h" + extern void r128DDInitSpanFuncs( GLcontext *ctx ); +extern void +r128SetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); + #endif diff --git a/src/mesa/drivers/dri/r128/r128_state.c b/src/mesa/drivers/dri/r128/r128_state.c index 320865c67b4..29f490da89d 100644 --- a/src/mesa/drivers/dri/r128/r128_state.c +++ b/src/mesa/drivers/dri/r128/r128_state.c @@ -714,13 +714,13 @@ static void r128DDDrawBuffer( GLcontext *ctx, GLenum mode ) FLUSH_BATCH( rmesa ); /* - * _DrawDestMask is easier to cope with than . + * _ColorDrawBufferMask is easier to cope with than . */ - switch ( ctx->Color._DrawDestMask[0] ) { - case DD_FRONT_LEFT_BIT: + switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) { + case BUFFER_BIT_FRONT_LEFT: FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: FALLBACK( rmesa, R128_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; default: diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index de373ecc864..2b6827ef436 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -40,6 +40,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "imports.h" #include "matrix.h" #include "extensions.h" +#include "framebuffer.h" #include "state.h" #include "swrast/swrast.h" @@ -192,7 +193,7 @@ static const struct tnl_pipeline_stage *r200_pipeline[] = { static void r200InitDriverFuncs( struct dd_function_table *functions ) { functions->GetBufferSize = r200GetBufferSize; - functions->ResizeBuffers = _swrast_alloc_buffers; + functions->ResizeBuffers = _mesa_resize_framebuffer; functions->GetString = r200GetString; functions->Error = NULL; @@ -455,7 +456,9 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual, /* plug in a few more device driver functions */ /* XXX these should really go right after _mesa_init_driver_functions() */ r200InitPixelFuncs( ctx ); +#if 0 r200InitSpanFuncs( ctx ); +#endif r200InitTnlFuncs( ctx ); r200InitState( rmesa ); r200InitSwtcl( ctx ); @@ -533,7 +536,7 @@ void r200DestroyContext( __DRIcontextPrivate *driContextPriv ) /* check if we're deleting the currently bound context */ if (rmesa == current) { R200_FIREVERTICES( rmesa ); - _mesa_make_current2(NULL, NULL, NULL); + _mesa_make_current(NULL, NULL, NULL); } /* Free r200 context resources */ @@ -642,9 +645,9 @@ r200MakeCurrent( __DRIcontextPrivate *driContextPriv, r200UpdateViewportOffset( newCtx->glCtx ); } - _mesa_make_current2( newCtx->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); + _mesa_make_current( newCtx->glCtx, + (GLframebuffer *) driDrawPriv->driverPrivate, + (GLframebuffer *) driReadPriv->driverPrivate ); if (newCtx->vb.enabled) r200VtxfmtMakeCurrent( newCtx->glCtx ); @@ -655,7 +658,7 @@ r200MakeCurrent( __DRIcontextPrivate *driContextPriv, } else { if (R200_DEBUG & DEBUG_DRI) fprintf(stderr, "%s ctx is null\n", __FUNCTION__); - _mesa_make_current( NULL, NULL ); + _mesa_make_current( NULL, NULL, NULL ); } if (R200_DEBUG & DEBUG_DRI) diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c b/src/mesa/drivers/dri/r200/r200_ioctl.c index ff2acdb7b19..ad43158d64a 100644 --- a/src/mesa/drivers/dri/r200/r200_ioctl.c +++ b/src/mesa/drivers/dri/r200/r200_ioctl.c @@ -600,26 +600,26 @@ static void r200Clear( GLcontext *ctx, GLbitfield mask, GLboolean all, r200Flush( ctx ); - if ( mask & DD_FRONT_LEFT_BIT ) { + if ( mask & BUFFER_BIT_FRONT_LEFT ) { flags |= RADEON_FRONT; color_mask = rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK]; - mask &= ~DD_FRONT_LEFT_BIT; + mask &= ~BUFFER_BIT_FRONT_LEFT; } - if ( mask & DD_BACK_LEFT_BIT ) { + if ( mask & BUFFER_BIT_BACK_LEFT ) { flags |= RADEON_BACK; color_mask = rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK]; - mask &= ~DD_BACK_LEFT_BIT; + mask &= ~BUFFER_BIT_BACK_LEFT; } - if ( mask & DD_DEPTH_BIT ) { + if ( mask & BUFFER_BIT_DEPTH ) { flags |= RADEON_DEPTH; - mask &= ~DD_DEPTH_BIT; + mask &= ~BUFFER_BIT_DEPTH; } - if ( (mask & DD_STENCIL_BIT) && rmesa->state.stencil.hwBuffer ) { + if ( (mask & BUFFER_BIT_STENCIL) && rmesa->state.stencil.hwBuffer ) { flags |= RADEON_STENCIL; - mask &= ~DD_STENCIL_BIT; + mask &= ~BUFFER_BIT_STENCIL; } if ( mask ) { diff --git a/src/mesa/drivers/dri/r200/r200_lock.c b/src/mesa/drivers/dri/r200/r200_lock.c index 72b57ae5dc4..9b82c18d1fe 100644 --- a/src/mesa/drivers/dri/r200/r200_lock.c +++ b/src/mesa/drivers/dri/r200/r200_lock.c @@ -53,7 +53,7 @@ r200UpdatePageFlipping( r200ContextPtr rmesa ) int use_back; rmesa->doPageFlip = rmesa->sarea->pfState; - use_back = (rmesa->glCtx->Color._DrawDestMask[0] == DD_BACK_LEFT_BIT); + use_back = (rmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT); use_back ^= (rmesa->sarea->pfCurrentPage == 1); if (use_back) { @@ -101,7 +101,7 @@ void r200GetLock( r200ContextPtr rmesa, GLuint flags ) if ( rmesa->lastStamp != dPriv->lastStamp ) { r200UpdatePageFlipping( rmesa ); - if (rmesa->glCtx->Color._DrawDestMask[0] == DD_BACK_LEFT_BIT) + if (rmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT) r200SetCliprects( rmesa, GL_BACK_LEFT ); else r200SetCliprects( rmesa, GL_FRONT_LEFT ); diff --git a/src/mesa/drivers/dri/r200/r200_screen.c b/src/mesa/drivers/dri/r200/r200_screen.c index a8302a44b0f..d6024121b50 100644 --- a/src/mesa/drivers/dri/r200/r200_screen.c +++ b/src/mesa/drivers/dri/r200/r200_screen.c @@ -40,14 +40,18 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "glheader.h" #include "imports.h" #include "context.h" +#include "framebuffer.h" +#include "renderbuffer.h" #define STANDALONE_MMIO #include "r200_screen.h" #include "r200_context.h" #include "r200_ioctl.h" +#include "r200_span.h" #include "radeon_macros.h" #include "radeon_reg.h" +#include "drirenderbuffer.h" #include "utils.h" #include "vblank.h" #include "GL/internal/dri_interface.h" @@ -525,10 +529,9 @@ r200InitDriver( __DRIscreenPrivate *sPriv ) } - /** * Create and initialize the Mesa and driver specific pixmap buffer - * data. + * data. This is called to setup rendering to a particular window. * * \todo This function (and its interface) will need to be updated to support * pbuffers. @@ -539,6 +542,8 @@ r200CreateBuffer( __DRIscreenPrivate *driScrnPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) { + r200ScreenPtr screen = (r200ScreenPtr) driScrnPriv->private; + if (isPixmap) { return GL_FALSE; /* not implemented */ } @@ -548,12 +553,64 @@ r200CreateBuffer( __DRIscreenPrivate *driScrnPriv, const GLboolean swAccum = mesaVis->accumRedBits > 0; const GLboolean swStencil = mesaVis->stencilBits > 0 && mesaVis->depthBits != 24; +#if 0 driDrawPriv->driverPrivate = (void *) _mesa_create_framebuffer( mesaVis, swDepth, swStencil, swAccum, swAlpha ); +#else + struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); + + { + driRenderbuffer *frontRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->frontOffset, screen->frontPitch); + r200SetSpanFunctions(frontRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); + } + + if (mesaVis->doubleBufferMode) { + driRenderbuffer *backRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->backOffset, screen->backPitch); + r200SetSpanFunctions(backRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + } + + if (mesaVis->depthBits == 16) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp, + screen->depthOffset, screen->depthPitch); + r200SetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else if (mesaVis->depthBits == 24) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp, + screen->depthOffset, screen->depthPitch); + r200SetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + + if (mesaVis->stencilBits > 0 && !swStencil) { + driRenderbuffer *stencilRb + = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp, + screen->depthOffset, screen->depthPitch); + r200SetSpanFunctions(stencilRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); + } + + _mesa_add_soft_renderbuffers(fb, + GL_FALSE, /* color */ + swDepth, + swStencil, + swAccum, + swAlpha, + GL_FALSE /* aux */); + driDrawPriv->driverPrivate = (void *) fb; +#endif return (driDrawPriv->driverPrivate != NULL); } } diff --git a/src/mesa/drivers/dri/r200/r200_span.c b/src/mesa/drivers/dri/r200/r200_span.c index f2868cb2d21..09a9a440a87 100644 --- a/src/mesa/drivers/dri/r200/r200_span.c +++ b/src/mesa/drivers/dri/r200/r200_span.c @@ -47,7 +47,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define DBG 0 #define LOCAL_VARS \ - r200ContextPtr rmesa = R200_CONTEXT(ctx); \ + r200ContextPtr rmesa = R200_CONTEXT(ctx); \ r200ScreenPtr r200Screen = rmesa->r200Screen; \ __DRIscreenPrivate *sPriv = rmesa->dri.screen; \ __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; \ @@ -55,7 +55,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. GLuint height = dPriv->h; \ char *buf = (char *)(sPriv->pFB + \ rmesa->state.color.drawOffset + \ - (dPriv->x * r200Screen->cpp) + \ + (dPriv->x * r200Screen->cpp) + \ (dPriv->y * pitch)); \ char *read_buf = (char *)(sPriv->pFB + \ rmesa->state.pixel.readOffset + \ @@ -65,14 +65,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. (void) read_buf; (void) buf; (void) p #define LOCAL_DEPTH_VARS \ - r200ContextPtr rmesa = R200_CONTEXT(ctx); \ + r200ContextPtr rmesa = R200_CONTEXT(ctx); \ r200ScreenPtr r200Screen = rmesa->r200Screen; \ __DRIscreenPrivate *sPriv = rmesa->dri.screen; \ __DRIdrawablePrivate *dPriv = rmesa->dri.drawable; \ GLuint height = dPriv->h; \ GLuint xo = dPriv->x; \ GLuint yo = dPriv->y; \ - char *buf = (char *)(sPriv->pFB + r200Screen->depthOffset); \ + char *buf = (char *)(sPriv->pFB + r200Screen->depthOffset); \ (void) buf #define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS @@ -212,6 +212,7 @@ static GLuint r200_mba_z16( r200ContextPtr rmesa, GLint x, GLint y ) /* 16-bit depth buffer functions */ + #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)(buf + r200_mba_z16( rmesa, _x + xo, _y + yo )) = d; @@ -221,8 +222,10 @@ static GLuint r200_mba_z16( r200ContextPtr rmesa, GLint x, GLint y ) #define TAG(x) r200##x##_16 #include "depthtmp.h" + /* 24 bit depth, 8 bit stencil depthbuffer functions */ + #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint offset = r200_mba_z32( rmesa, _x + xo, _y + yo ); \ @@ -279,7 +282,7 @@ static void r200SetBuffer( GLcontext *ctx, r200ContextPtr rmesa = R200_CONTEXT(ctx); switch ( bufferBit ) { - case DD_FRONT_LEFT_BIT: + case BUFFER_BIT_FRONT_LEFT: if ( rmesa->doPageFlip && rmesa->sarea->pfCurrentPage == 1 ) { rmesa->state.pixel.readOffset = rmesa->r200Screen->backOffset; rmesa->state.pixel.readPitch = rmesa->r200Screen->backPitch; @@ -292,7 +295,7 @@ static void r200SetBuffer( GLcontext *ctx, rmesa->state.color.drawPitch = rmesa->r200Screen->frontPitch; } break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: if ( rmesa->doPageFlip && rmesa->sarea->pfCurrentPage == 1 ) { rmesa->state.pixel.readOffset = rmesa->r200Screen->frontOffset; rmesa->state.pixel.readPitch = rmesa->r200Screen->frontPitch; @@ -358,11 +361,15 @@ void r200InitSpanFuncs( GLcontext *ctx ) switch ( rmesa->r200Screen->cpp ) { case 2: +#if 0 r200InitPointers_RGB565( swdd ); +#endif break; case 4: +#if 0 r200InitPointers_ARGB8888( swdd ); +#endif break; default: @@ -371,22 +378,25 @@ void r200InitSpanFuncs( GLcontext *ctx ) switch ( rmesa->glCtx->Visual.depthBits ) { case 16: +#if 0 swdd->ReadDepthSpan = r200ReadDepthSpan_16; swdd->WriteDepthSpan = r200WriteDepthSpan_16; swdd->ReadDepthPixels = r200ReadDepthPixels_16; swdd->WriteDepthPixels = r200WriteDepthPixels_16; +#endif break; case 24: +#if 0 swdd->ReadDepthSpan = r200ReadDepthSpan_24_8; swdd->WriteDepthSpan = r200WriteDepthSpan_24_8; swdd->ReadDepthPixels = r200ReadDepthPixels_24_8; swdd->WriteDepthPixels = r200WriteDepthPixels_24_8; - swdd->ReadStencilSpan = r200ReadStencilSpan_24_8; swdd->WriteStencilSpan = r200WriteStencilSpan_24_8; swdd->ReadStencilPixels = r200ReadStencilPixels_24_8; swdd->WriteStencilPixels = r200WriteStencilPixels_24_8; +#endif break; default: @@ -396,3 +406,45 @@ void r200InitSpanFuncs( GLcontext *ctx ) swdd->SpanRenderStart = r200SpanRenderStart; swdd->SpanRenderFinish = r200SpanRenderFinish; } + + + +/** + * Plug in the Get/Put routines for the given driRenderbuffer. + */ +void +r200SetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) +{ + if (drb->Base.InternalFormat == GL_RGBA) { + if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { + r200InitPointers_RGB565(&drb->Base); + } + else { + r200InitPointers_ARGB8888(&drb->Base); + } + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + drb->Base.GetRow = r200ReadDepthSpan_16; + drb->Base.GetValues = r200ReadDepthPixels_16; + drb->Base.PutRow = r200WriteDepthSpan_16; + drb->Base.PutMonoRow = r200WriteMonoDepthSpan_16; + drb->Base.PutValues = r200WriteDepthPixels_16; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + drb->Base.GetRow = r200ReadDepthSpan_24_8; + drb->Base.GetValues = r200ReadDepthPixels_24_8; + drb->Base.PutRow = r200WriteDepthSpan_24_8; + drb->Base.PutMonoRow = r200WriteMonoDepthSpan_24_8; + drb->Base.PutValues = r200WriteDepthPixels_24_8; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + drb->Base.GetRow = r200ReadStencilSpan_24_8; + drb->Base.GetValues = r200ReadStencilPixels_24_8; + drb->Base.PutRow = r200WriteStencilSpan_24_8; + drb->Base.PutMonoRow = r200WriteMonoStencilSpan_24_8; + drb->Base.PutValues = r200WriteStencilPixels_24_8; + drb->Base.PutMonoValues = NULL; + } +} diff --git a/src/mesa/drivers/dri/r200/r200_span.h b/src/mesa/drivers/dri/r200/r200_span.h index 9ddf245b636..8b990955924 100644 --- a/src/mesa/drivers/dri/r200/r200_span.h +++ b/src/mesa/drivers/dri/r200/r200_span.h @@ -36,6 +36,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __R200_SPAN_H__ #define __R200_SPAN_H__ +#include "drirenderbuffer.h" + extern void r200InitSpanFuncs( GLcontext *ctx ); +extern void +r200SetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); + #endif diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index b0b0c889007..93f6dfc6d7a 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -1796,12 +1796,12 @@ static void r200DrawBuffer( GLcontext *ctx, GLenum mode ) /* * _DrawDestMask is easier to cope with than . */ - switch ( ctx->Color._DrawDestMask[0] ) { - case DD_FRONT_LEFT_BIT: + switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) { + case BUFFER_BIT_FRONT_LEFT: FALLBACK( rmesa, R200_FALLBACK_DRAW_BUFFER, GL_FALSE ); r200SetCliprects( rmesa, GL_FRONT_LEFT ); break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: FALLBACK( rmesa, R200_FALLBACK_DRAW_BUFFER, GL_FALSE ); r200SetCliprects( rmesa, GL_BACK_LEFT ); break; diff --git a/src/mesa/drivers/dri/radeon/Makefile b/src/mesa/drivers/dri/radeon/Makefile index b9f9186f593..af5f203f3cc 100644 --- a/src/mesa/drivers/dri/radeon/Makefile +++ b/src/mesa/drivers/dri/radeon/Makefile @@ -16,6 +16,7 @@ COMMON_SOURCES = \ ../common/vblank.c \ ../common/xmlconfig.c \ ../common/dri_util.c \ + ../common/drirenderbuffer.c \ ../common/glcontextmodes.c DRIVER_SOURCES = \ diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 037ea0f0036..60eecc741c8 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -42,6 +42,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "imports.h" #include "matrix.h" #include "extensions.h" +#include "framebuffer.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -182,7 +183,7 @@ static const struct tnl_pipeline_stage *radeon_pipeline[] = { static void radeonInitDriverFuncs( struct dd_function_table *functions ) { functions->GetBufferSize = radeonGetBufferSize; - functions->ResizeBuffers = _swrast_alloc_buffers; + functions->ResizeBuffers = _mesa_resize_framebuffer; functions->GetString = radeonGetString; } @@ -491,7 +492,7 @@ void radeonDestroyContext( __DRIcontextPrivate *driContextPriv ) /* check if we're deleting the currently bound context */ if (rmesa == current) { RADEON_FIREVERTICES( rmesa ); - _mesa_make_current2(NULL, NULL, NULL); + _mesa_make_current(NULL, NULL, NULL); } /* Free radeon context resources */ @@ -603,9 +604,9 @@ radeonMakeCurrent( __DRIcontextPrivate *driContextPriv, radeonUpdateViewportOffset( newCtx->glCtx ); } - _mesa_make_current2( newCtx->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); + _mesa_make_current( newCtx->glCtx, + (GLframebuffer *) driDrawPriv->driverPrivate, + (GLframebuffer *) driReadPriv->driverPrivate ); if (newCtx->vb.enabled) radeonVtxfmtMakeCurrent( newCtx->glCtx ); @@ -613,7 +614,7 @@ radeonMakeCurrent( __DRIcontextPrivate *driContextPriv, } else { if (RADEON_DEBUG & DEBUG_DRI) fprintf(stderr, "%s ctx is null\n", __FUNCTION__); - _mesa_make_current( NULL, NULL ); + _mesa_make_current( NULL, NULL, NULL ); } if (RADEON_DEBUG & DEBUG_DRI) diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.c b/src/mesa/drivers/dri/radeon/radeon_ioctl.c index cf7e9a8b27f..3e1fc4bafff 100644 --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.c +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.c @@ -1048,26 +1048,26 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask, GLboolean all, radeonFlush( ctx ); - if ( mask & DD_FRONT_LEFT_BIT ) { + if ( mask & BUFFER_BIT_FRONT_LEFT ) { flags |= RADEON_FRONT; color_mask = rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK]; - mask &= ~DD_FRONT_LEFT_BIT; + mask &= ~BUFFER_BIT_FRONT_LEFT; } - if ( mask & DD_BACK_LEFT_BIT ) { + if ( mask & BUFFER_BIT_BACK_LEFT ) { flags |= RADEON_BACK; color_mask = rmesa->hw.msk.cmd[MSK_RB3D_PLANEMASK]; - mask &= ~DD_BACK_LEFT_BIT; + mask &= ~BUFFER_BIT_BACK_LEFT; } - if ( mask & DD_DEPTH_BIT ) { + if ( mask & BUFFER_BIT_DEPTH ) { flags |= RADEON_DEPTH; - mask &= ~DD_DEPTH_BIT; + mask &= ~BUFFER_BIT_DEPTH; } - if ( (mask & DD_STENCIL_BIT) && rmesa->state.stencil.hwBuffer ) { + if ( (mask & BUFFER_BIT_STENCIL) && rmesa->state.stencil.hwBuffer ) { flags |= RADEON_STENCIL; - mask &= ~DD_STENCIL_BIT; + mask &= ~BUFFER_BIT_STENCIL; } if ( mask ) { diff --git a/src/mesa/drivers/dri/radeon/radeon_lock.c b/src/mesa/drivers/dri/radeon/radeon_lock.c index 7dab02e6b52..bb121fc587e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_lock.c +++ b/src/mesa/drivers/dri/radeon/radeon_lock.c @@ -56,7 +56,7 @@ radeonUpdatePageFlipping( radeonContextPtr rmesa ) rmesa->doPageFlip = rmesa->sarea->pfState; - use_back = (rmesa->glCtx->Color._DrawDestMask[0] == DD_BACK_LEFT_BIT); + use_back = (rmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT); use_back ^= (rmesa->sarea->pfCurrentPage == 1); if ( RADEON_DEBUG & DEBUG_VERBOSE ) @@ -108,7 +108,7 @@ void radeonGetLock( radeonContextPtr rmesa, GLuint flags ) if ( rmesa->lastStamp != dPriv->lastStamp ) { radeonUpdatePageFlipping( rmesa ); - if (rmesa->glCtx->Color._DrawDestMask[0] == DD_BACK_LEFT_BIT) + if (rmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT) radeonSetCliprects( rmesa, GL_BACK_LEFT ); else radeonSetCliprects( rmesa, GL_FRONT_LEFT ); diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index cfba8846383..edc92443668 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -38,15 +38,20 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "glheader.h" #include "imports.h" +#include "mtypes.h" +#include "framebuffer.h" +#include "renderbuffer.h" #define STANDALONE_MMIO #include "radeon_context.h" #include "radeon_screen.h" #include "radeon_macros.h" +#include "radeon_span.h" #include "utils.h" #include "context.h" #include "vblank.h" +#include "drirenderbuffer.h" #include "GL/internal/dri_interface.h" @@ -451,10 +456,8 @@ radeonInitDriver( __DRIscreenPrivate *sPriv ) } - /** - * Create and initialize the Mesa and driver specific pixmap buffer - * data. + * Create the Mesa framebuffer and renderbuffers for a given window/drawable. * * \todo This function (and its interface) will need to be updated to support * pbuffers. @@ -465,6 +468,8 @@ radeonCreateBuffer( __DRIscreenPrivate *driScrnPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) { + radeonScreenPtr screen = (radeonScreenPtr) driScrnPriv->private; + if (isPixmap) { return GL_FALSE; /* not implemented */ } @@ -474,12 +479,64 @@ radeonCreateBuffer( __DRIscreenPrivate *driScrnPriv, const GLboolean swAccum = mesaVis->accumRedBits > 0; const GLboolean swStencil = mesaVis->stencilBits > 0 && mesaVis->depthBits != 24; +#if 0 driDrawPriv->driverPrivate = (void *) _mesa_create_framebuffer( mesaVis, swDepth, swStencil, swAccum, swAlpha ); +#else + struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); + + { + driRenderbuffer *frontRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->frontOffset, screen->frontPitch); + radeonSetSpanFunctions(frontRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); + } + + if (mesaVis->doubleBufferMode) { + driRenderbuffer *backRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->backOffset, screen->backPitch); + radeonSetSpanFunctions(backRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + } + + if (mesaVis->depthBits == 16) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp, + screen->depthOffset, screen->depthPitch); + radeonSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else if (mesaVis->depthBits == 24) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp, + screen->depthOffset, screen->depthPitch); + radeonSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + + if (mesaVis->stencilBits > 0 && !swStencil) { + driRenderbuffer *stencilRb + = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp, + screen->depthOffset, screen->depthPitch); + radeonSetSpanFunctions(stencilRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); + } + + _mesa_add_soft_renderbuffers(fb, + GL_FALSE, /* color */ + swDepth, + swStencil, + swAccum, + swAlpha, + GL_FALSE /* aux */); + driDrawPriv->driverPrivate = (void *) fb; +#endif return (driDrawPriv->driverPrivate != NULL); } } diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.h b/src/mesa/drivers/dri/radeon/radeon_screen.h index b7ad8c0769c..b9cbeaac335 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.h +++ b/src/mesa/drivers/dri/radeon/radeon_screen.h @@ -100,7 +100,4 @@ typedef struct { driOptionCache optionCache; } radeonScreenRec, *radeonScreenPtr; -extern radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv ); -extern void radeonDestroyScreen( __DRIscreenPrivate *sPriv ); - #endif /* __RADEON_SCREEN_H__ */ diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 38ba5a50e50..9315543c15f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -313,7 +313,7 @@ static void radeonSetBuffer( GLcontext *ctx, radeonContextPtr rmesa = RADEON_CONTEXT(ctx); switch ( bufferBit ) { - case DD_FRONT_LEFT_BIT: + case BUFFER_BIT_FRONT_LEFT: if ( rmesa->sarea->pfCurrentPage == 1 ) { rmesa->state.pixel.readOffset = rmesa->radeonScreen->backOffset; rmesa->state.pixel.readPitch = rmesa->radeonScreen->backPitch; @@ -326,7 +326,7 @@ static void radeonSetBuffer( GLcontext *ctx, rmesa->state.color.drawPitch = rmesa->radeonScreen->frontPitch; } break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: if ( rmesa->sarea->pfCurrentPage == 1 ) { rmesa->state.pixel.readOffset = rmesa->radeonScreen->frontOffset; rmesa->state.pixel.readPitch = rmesa->radeonScreen->frontPitch; @@ -375,6 +375,7 @@ void radeonInitSpanFuncs( GLcontext *ctx ) switch ( rmesa->radeonScreen->cpp ) { case 2: +#if 0 swdd->WriteRGBASpan = radeonWriteRGBASpan_RGB565; swdd->WriteRGBSpan = radeonWriteRGBSpan_RGB565; swdd->WriteMonoRGBASpan = radeonWriteMonoRGBASpan_RGB565; @@ -382,9 +383,11 @@ void radeonInitSpanFuncs( GLcontext *ctx ) swdd->WriteMonoRGBAPixels = radeonWriteMonoRGBAPixels_RGB565; swdd->ReadRGBASpan = radeonReadRGBASpan_RGB565; swdd->ReadRGBAPixels = radeonReadRGBAPixels_RGB565; +#endif break; case 4: +#if 0 swdd->WriteRGBASpan = radeonWriteRGBASpan_ARGB8888; swdd->WriteRGBSpan = radeonWriteRGBSpan_ARGB8888; swdd->WriteMonoRGBASpan = radeonWriteMonoRGBASpan_ARGB8888; @@ -392,6 +395,7 @@ void radeonInitSpanFuncs( GLcontext *ctx ) swdd->WriteMonoRGBAPixels = radeonWriteMonoRGBAPixels_ARGB8888; swdd->ReadRGBASpan = radeonReadRGBASpan_ARGB8888; swdd->ReadRGBAPixels = radeonReadRGBAPixels_ARGB8888; +#endif break; default: @@ -400,13 +404,16 @@ void radeonInitSpanFuncs( GLcontext *ctx ) switch ( rmesa->glCtx->Visual.depthBits ) { case 16: +#if 0 swdd->ReadDepthSpan = radeonReadDepthSpan_16; swdd->WriteDepthSpan = radeonWriteDepthSpan_16; swdd->ReadDepthPixels = radeonReadDepthPixels_16; swdd->WriteDepthPixels = radeonWriteDepthPixels_16; +#endif break; case 24: +#if 0 swdd->ReadDepthSpan = radeonReadDepthSpan_24_8; swdd->WriteDepthSpan = radeonWriteDepthSpan_24_8; swdd->ReadDepthPixels = radeonReadDepthPixels_24_8; @@ -416,6 +423,7 @@ void radeonInitSpanFuncs( GLcontext *ctx ) swdd->WriteStencilSpan = radeonWriteStencilSpan_24_8; swdd->ReadStencilPixels = radeonReadStencilPixels_24_8; swdd->WriteStencilPixels = radeonWriteStencilPixels_24_8; +#endif break; default: @@ -425,3 +433,56 @@ void radeonInitSpanFuncs( GLcontext *ctx ) swdd->SpanRenderStart = radeonSpanRenderStart; swdd->SpanRenderFinish = radeonSpanRenderFinish; } + + +/** + * Plug in the Get/Put routines for the given driRenderbuffer. + */ +void +radeonSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) +{ + if (drb->Base.InternalFormat == GL_RGBA) { + if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { + drb->Base.GetRow = radeonReadRGBASpan_RGB565; + drb->Base.GetValues = radeonReadRGBAPixels_RGB565; + drb->Base.PutRow = radeonWriteRGBASpan_RGB565; + drb->Base.PutRowRGB = radeonWriteRGBSpan_RGB565; + drb->Base.PutMonoRow = radeonWriteMonoRGBASpan_RGB565; + drb->Base.PutValues = radeonWriteRGBAPixels_RGB565; + drb->Base.PutMonoValues = radeonWriteMonoRGBAPixels_RGB565; + } + else { + drb->Base.GetRow = radeonReadRGBASpan_ARGB8888; + drb->Base.GetValues = radeonReadRGBAPixels_ARGB8888; + drb->Base.PutRow = radeonWriteRGBASpan_ARGB8888; + drb->Base.PutRowRGB = radeonWriteRGBSpan_ARGB8888; + drb->Base.PutMonoRow = radeonWriteMonoRGBASpan_ARGB8888; + drb->Base.PutValues = radeonWriteRGBAPixels_ARGB8888; + drb->Base.PutMonoValues = radeonWriteMonoRGBAPixels_ARGB8888; + } + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + drb->Base.GetRow = radeonReadDepthSpan_16; + drb->Base.GetValues = radeonReadDepthPixels_16; + drb->Base.PutRow = radeonWriteDepthSpan_16; + drb->Base.PutMonoRow = radeonWriteMonoDepthSpan_16; + drb->Base.PutValues = radeonWriteDepthPixels_16; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + drb->Base.GetRow = radeonReadDepthSpan_24_8; + drb->Base.GetValues = radeonReadDepthPixels_24_8; + drb->Base.PutRow = radeonWriteDepthSpan_24_8; + drb->Base.PutMonoRow = radeonWriteMonoDepthSpan_24_8; + drb->Base.PutValues = radeonWriteDepthPixels_24_8; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + drb->Base.GetRow = radeonReadStencilSpan_24_8; + drb->Base.GetValues = radeonReadStencilPixels_24_8; + drb->Base.PutRow = radeonWriteStencilSpan_24_8; + drb->Base.PutMonoRow = radeonWriteMonoStencilSpan_24_8; + drb->Base.PutValues = radeonWriteStencilPixels_24_8; + drb->Base.PutMonoValues = NULL; + } +} diff --git a/src/mesa/drivers/dri/radeon/radeon_span.h b/src/mesa/drivers/dri/radeon/radeon_span.h index 097af4b1bf0..13b308e1c41 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.h +++ b/src/mesa/drivers/dri/radeon/radeon_span.h @@ -37,6 +37,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __RADEON_SPAN_H__ #define __RADEON_SPAN_H__ +#include "drirenderbuffer.h" + extern void radeonInitSpanFuncs( GLcontext *ctx ); +extern void radeonSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); + #endif diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c index 532458ebf4e..3a491f5ded1 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state.c +++ b/src/mesa/drivers/dri/radeon/radeon_state.c @@ -1661,12 +1661,12 @@ static void radeonDrawBuffer( GLcontext *ctx, GLenum mode ) /* * _DrawDestMask is easier to cope with than . */ - switch ( ctx->Color._DrawDestMask[0] ) { - case DD_FRONT_LEFT_BIT: + switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) { + case BUFFER_BIT_FRONT_LEFT: FALLBACK( rmesa, RADEON_FALLBACK_DRAW_BUFFER, GL_FALSE ); radeonSetCliprects( rmesa, GL_FRONT_LEFT ); break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: FALLBACK( rmesa, RADEON_FALLBACK_DRAW_BUFFER, GL_FALSE ); radeonSetCliprects( rmesa, GL_BACK_LEFT ); break; diff --git a/src/mesa/drivers/dri/s3v/s3v_context.h b/src/mesa/drivers/dri/s3v/s3v_context.h index 1c0bca3fb8f..b94fee6a8ee 100644 --- a/src/mesa/drivers/dri/s3v/s3v_context.h +++ b/src/mesa/drivers/dri/s3v/s3v_context.h @@ -16,6 +16,7 @@ #include "mtypes.h" #include "drm.h" #include "mm.h" +#include "drirenderbuffer.h" /* Flags for context */ #define S3V_FRONT_BUFFER 0x00000001 @@ -162,6 +163,7 @@ void s3vGetLock( s3vContextPtr vmesa, GLuint flags ); void s3vInitExtensions( GLcontext *ctx ); void s3vInitDriverFuncs( GLcontext *ctx ); void s3vInitSpanFuncs( GLcontext *ctx ); +void s3vSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); void s3vInitState( s3vContextPtr vmesa ); void s3vInitHW( s3vContextPtr vmesa ); void s3vInitStateFuncs( GLcontext *ctx ); diff --git a/src/mesa/drivers/dri/s3v/s3v_dd.c b/src/mesa/drivers/dri/s3v/s3v_dd.c index 3346c86a0c4..2c8e230f3ef 100644 --- a/src/mesa/drivers/dri/s3v/s3v_dd.c +++ b/src/mesa/drivers/dri/s3v/s3v_dd.c @@ -10,6 +10,7 @@ #endif #include "context.h" +#include "framebuffer.h" #include "swrast/swrast.h" #define S3V_DATE "20020207" @@ -96,7 +97,7 @@ void s3vInitDriverFuncs( GLcontext *ctx ) ctx->Driver.CopyPixels = _swrast_CopyPixels; ctx->Driver.DrawPixels = _swrast_DrawPixels; ctx->Driver.ReadPixels = _swrast_ReadPixels; - ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; + ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer; /* Swrast hooks for imaging extensions: */ diff --git a/src/mesa/drivers/dri/s3v/s3v_screen.h b/src/mesa/drivers/dri/s3v/s3v_screen.h index bbbffbb8e1a..0c4f69efac3 100644 --- a/src/mesa/drivers/dri/s3v/s3v_screen.h +++ b/src/mesa/drivers/dri/s3v/s3v_screen.h @@ -2,6 +2,8 @@ * Author: Max Lingua */ +#include "mtypes.h" + typedef struct _s3vRegion { drm_handle_t handle; drmSize size; @@ -34,3 +36,4 @@ typedef struct { int textureSize; int logTextureGranularity; } s3vScreenRec, *s3vScreenPtr; + diff --git a/src/mesa/drivers/dri/s3v/s3v_span.c b/src/mesa/drivers/dri/s3v/s3v_span.c index 6266d371052..e4a48ebfc84 100644 --- a/src/mesa/drivers/dri/s3v/s3v_span.c +++ b/src/mesa/drivers/dri/s3v/s3v_span.c @@ -232,10 +232,10 @@ static void s3vSetBuffer( GLcontext *ctx, GLframebuffer *colorBuffer, s3vContextPtr vmesa = S3V_CONTEXT(ctx); switch ( bufferBit ) { - case DD_FRONT_LEFT_BIT: + case BUFFER_BIT_FRONT_LEFT: vmesa->drawOffset = vmesa->readOffset = 0; break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: vmesa->drawOffset = vmesa->readOffset = vmesa->driScreen->fbHeight * vmesa->driScreen->fbWidth * vmesa->s3vScreen->cpp; @@ -251,6 +251,7 @@ void s3vInitSpanFuncs( GLcontext *ctx ) swdd->SetBuffer = s3vSetBuffer; +#if 0 switch ( vmesa->s3vScreen->cpp ) { case 2: swdd->WriteRGBASpan = s3vWriteRGBASpan_RGB555; @@ -279,14 +280,17 @@ void s3vInitSpanFuncs( GLcontext *ctx ) default: break; } +#endif switch ( vmesa->glCtx->Visual.depthBits ) { case 15: case 16: +#if 0 swdd->ReadDepthSpan = s3vReadDepthSpan_16; swdd->WriteDepthSpan = s3vWriteDepthSpan_16; swdd->ReadDepthPixels = s3vReadDepthPixels_16; swdd->WriteDepthPixels = s3vWriteDepthPixels_16; +#endif break; #if 0 @@ -307,3 +311,56 @@ void s3vInitSpanFuncs( GLcontext *ctx ) break; } } + + +/** + * Plug in the Get/Put routines for the given driRenderbuffer. + */ +void +s3vSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) +{ + if (drb->Base.InternalFormat == GL_RGBA) { + if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { + drb->Base.GetRow = s3vReadRGBASpan_RGB555; + drb->Base.GetValues = s3vReadRGBAPixels_RGB555; + drb->Base.PutRow = s3vWriteRGBASpan_RGB555; + drb->Base.PutRowRGB = s3vWriteRGBSpan_RGB555; + drb->Base.PutMonoRow = s3vWriteMonoRGBASpan_RGB555; + drb->Base.PutValues = s3vWriteRGBAPixels_RGB555; + drb->Base.PutMonoValues = s3vWriteMonoRGBAPixels_RGB555; + } + else { + drb->Base.GetRow = s3vReadRGBASpan_ARGB8888; + drb->Base.GetValues = s3vReadRGBAPixels_ARGB8888; + drb->Base.PutRow = s3vWriteRGBASpan_ARGB8888; + drb->Base.PutRowRGB = s3vWriteRGBSpan_ARGB8888; + drb->Base.PutMonoRow = s3vWriteMonoRGBASpan_ARGB8888; + drb->Base.PutValues = s3vWriteRGBAPixels_ARGB8888; + drb->Base.PutMonoValues = s3vWriteMonoRGBAPixels_ARGB8888; + } + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + drb->Base.GetRow = s3vReadDepthSpan_16; + drb->Base.GetValues = s3vReadDepthPixels_16; + drb->Base.PutRow = s3vWriteDepthSpan_16; + drb->Base.PutMonoRow = s3vWriteMonoDepthSpan_16; + drb->Base.PutValues = s3vWriteDepthPixels_16; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + drb->Base.GetRow = NULL; + drb->Base.GetValues = NULL; + drb->Base.PutRow = NULL; + drb->Base.PutMonoRow = NULL; + drb->Base.PutValues = NULL; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + drb->Base.GetRow = NULL; + drb->Base.GetValues = NULL; + drb->Base.PutRow = NULL; + drb->Base.PutMonoRow = NULL; + drb->Base.PutValues = NULL; + drb->Base.PutMonoValues = NULL; + } +} diff --git a/src/mesa/drivers/dri/s3v/s3v_state.c b/src/mesa/drivers/dri/s3v/s3v_state.c index f92859d4edc..84aaf4c5b13 100644 --- a/src/mesa/drivers/dri/s3v/s3v_state.c +++ b/src/mesa/drivers/dri/s3v/s3v_state.c @@ -117,8 +117,8 @@ static void s3vDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, DMAOUT(vmesa->DestXY); DMAFINISH(); - if (mask & DD_DEPTH_BIT) { /* depth */ - DEBUG(("DD_DEPTH_BIT\n")); + if (mask & BUFFER_BIT_DEPTH) { /* depth */ + DEBUG(("BUFFER_BIT_DEPTH\n")); _stride = ((cw+31)&~31) * 2; @@ -142,7 +142,7 @@ static void s3vDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, DMAFINISH(); DEBUG(("vmesa->ClearDepth = 0x%x\n", vmesa->ClearDepth)); - mask &= ~DD_DEPTH_BIT; + mask &= ~BUFFER_BIT_DEPTH; } if (!vmesa->NotClipped) { diff --git a/src/mesa/drivers/dri/s3v/s3v_xmesa.c b/src/mesa/drivers/dri/s3v/s3v_xmesa.c index 84072b14716..61d4cbccbd9 100644 --- a/src/mesa/drivers/dri/s3v/s3v_xmesa.c +++ b/src/mesa/drivers/dri/s3v/s3v_xmesa.c @@ -7,6 +7,8 @@ #include "context.h" #include "matrix.h" #include "s3v_dri.h" +#include "framebuffer.h" +#include "renderbuffer.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -57,10 +59,13 @@ s3vCreateBuffer( __DRIscreenPrivate *driScrnPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) { + s3vScreenPtr screen = (s3vScreenPtr) driScrnPriv->private; + if (isPixmap) { return GL_FALSE; /* not implemented */ } else { +#if 0 driDrawPriv->driverPrivate = (void *) _mesa_create_framebuffer(mesaVis, GL_FALSE, /* software depth buffer? */ @@ -68,6 +73,58 @@ s3vCreateBuffer( __DRIscreenPrivate *driScrnPriv, mesaVis->accumRedBits > 0, mesaVis->alphaBits > 0 ); +#else + struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); + + { + driRenderbuffer *frontRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->frontOffset, screen->frontPitch); + s3vSetSpanFunctions(frontRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); + } + + if (mesaVis->doubleBufferMode) { + driRenderbuffer *backRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->backOffset, screen->backPitch); + s3vSetSpanFunctions(backRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + } + + if (mesaVis->depthBits == 16) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp, + screen->depthOffset, screen->depthPitch); + s3vSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else if (mesaVis->depthBits == 24) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp, + screen->depthOffset, screen->depthPitch); + s3vSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + + /* no h/w stencil yet? + if (mesaVis->stencilBits > 0) { + driRenderbuffer *stencilRb + = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT); + s3vSetSpanFunctions(stencilRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); + } + */ + + _mesa_add_soft_renderbuffers(fb, + GL_FALSE, /* color */ + GL_FALSE, /* depth */ + mesaVis->stencilBits > 0, + mesaVis->accumRedBits > 0, + GL_FALSE, /* alpha */ + GL_FALSE /* aux */); + driDrawPriv->driverPrivate = (void *) fb; +#endif return (driDrawPriv->driverPrivate != NULL); } } @@ -205,7 +262,7 @@ s3vMakeCurrent(__DRIcontextPrivate *driContextPriv, */ /* - _mesa_make_current2( newVirgeCtx->glCtx, + _mesa_make_current( newVirgeCtx->glCtx, (GLframebuffer *) driDrawPriv->driverPrivate, (GLframebuffer *) driReadPriv->driverPrivate ); @@ -221,13 +278,11 @@ s3vMakeCurrent(__DRIcontextPrivate *driContextPriv, WRITE(newVirgeCtx->buf, S3VWindow, newVirgeCtx->Window); #endif - - newVirgeCtx->new_state |= S3V_NEW_WINDOW; /* FIXME */ - _mesa_make_current2( newVirgeCtx->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); + _mesa_make_current( newVirgeCtx->glCtx, + (GLframebuffer *) driDrawPriv->driverPrivate, + (GLframebuffer *) driReadPriv->driverPrivate ); if (!newVirgeCtx->glCtx->Viewport.Width) { _mesa_set_viewport(newVirgeCtx->glCtx, 0, 0, @@ -245,23 +300,23 @@ s3vMakeCurrent(__DRIcontextPrivate *driContextPriv, newVirgeCtx->new_state |= S3V_NEW_CLIP; - if (1) { - cx = dPriv->x; - cw = dPriv->w; - cy = dPriv->y; - ch = dPriv->h; - } - - x1 = y1 = 0; - x2 = cw-1; - y2 = ch-1; - -/* src_stride = vmesa->s3vScreen->w * vmesa->s3vScreen->cpp; - dest_stride = ((x2+31)&~31) * vmesa->s3vScreen->cpp; */ - src_stride = vmesa->driScreen->fbWidth * 2; - dest_stride = ((x2+31)&~31) * 2; + if (1) { + cx = dPriv->x; + cw = dPriv->w; + cy = dPriv->y; + ch = dPriv->h; + } + + x1 = y1 = 0; + x2 = cw-1; + y2 = ch-1; + + /* src_stride = vmesa->s3vScreen->w * vmesa->s3vScreen->cpp; + dest_stride = ((x2+31)&~31) * vmesa->s3vScreen->cpp; */ + src_stride = vmesa->driScreen->fbWidth * 2; + dest_stride = ((x2+31)&~31) * 2; } else { - _mesa_make_current( 0, 0 ); + _mesa_make_current( NULL, NULL, NULL ); } return GL_TRUE; diff --git a/src/mesa/drivers/dri/savage/savage_init.h b/src/mesa/drivers/dri/savage/savage_init.h index 9cf8e66b7c2..0dec397b7ba 100644 --- a/src/mesa/drivers/dri/savage/savage_init.h +++ b/src/mesa/drivers/dri/savage/savage_init.h @@ -80,6 +80,16 @@ typedef struct { } savageScreenPrivate; +/** + * savageRenderbuffer, derived from Mesa's gl_renderbuffer + */ +typedef struct { + struct gl_renderbuffer Base; + /* XXX per-window info should go here */ + int foo, bar; +} savageRenderbuffer; + + #include "savagecontext.h" extern void savageGetLock( savageContextPtr imesa, GLuint flags ); diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index 485bc77458d..aeb314681e9 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -29,7 +29,8 @@ #include "savagecontext.h" #include "context.h" #include "matrix.h" - +#include "framebuffer.h" +#include "renderbuffer.h" #include "simple_list.h" #include "utils.h" @@ -588,25 +589,85 @@ savageDestroyContext(__DRIcontextPrivate *driContextPriv) } } + static GLboolean savageCreateBuffer( __DRIscreenPrivate *driScrnPriv, __DRIdrawablePrivate *driDrawPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap) { + savageScreenPrivate *screen = (savageScreenPrivate *) driScrnPriv->private; + if (isPixmap) { return GL_FALSE; /* not implemented */ } else { GLboolean swStencil = mesaVis->stencilBits > 0 && mesaVis->depthBits != 24; - driDrawPriv->driverPrivate = (void *) +#if 0 + driDrawPriv->driverPrivate = (void *) _mesa_create_framebuffer(mesaVis, GL_FALSE, /* software depth buffer? */ swStencil, mesaVis->accumRedBits > 0, mesaVis->alphaBits > 0 ); +#else + struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); + /* + * XXX: this value needs to be set according to the config file + * setting. But we don't get that until we create a rendering + * context!!!! + */ + GLboolean float_depth = GL_FALSE; + + { + driRenderbuffer *frontRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->frontOffset, screen->aperturePitch); + savageSetSpanFunctions(frontRb, mesaVis, float_depth); + _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); + } + + if (mesaVis->doubleBufferMode) { + driRenderbuffer *backRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->backOffset, screen->aperturePitch); + savageSetSpanFunctions(backRb, mesaVis, float_depth); + _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + } - return (driDrawPriv->driverPrivate != NULL); + if (mesaVis->depthBits == 16) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp, + screen->depthOffset, screen->aperturePitch); + savageSetSpanFunctions(depthRb, mesaVis, float_depth); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else if (mesaVis->depthBits == 24) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp, + screen->depthOffset, screen->aperturePitch); + savageSetSpanFunctions(depthRb, mesaVis, float_depth); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + + if (mesaVis->stencilBits > 0 && !swStencil) { + driRenderbuffer *stencilRb + = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp, + screen->depthOffset, screen->aperturePitch); + savageSetSpanFunctions(stencilRb, mesaVis, float_depth); + _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); + } + + _mesa_add_soft_renderbuffers(fb, + GL_FALSE, /* color */ + GL_FALSE, /* depth */ + swStencil, + mesaVis->accumRedBits > 0, + GL_FALSE, /* alpha */ + GL_FALSE /* aux */); + driDrawPriv->driverPrivate = (void *) fb; +#endif + return (driDrawPriv->driverPrivate != NULL); } } @@ -670,11 +731,11 @@ static void savageXMesaWindowMoved( savageContextPtr imesa ) if (0) fprintf(stderr, "savageXMesaWindowMoved\n\n"); - switch (imesa->glCtx->Color._DrawDestMask[0]) { - case DD_FRONT_LEFT_BIT: + switch (imesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) { + case BUFFER_BIT_FRONT_LEFT: savageXMesaSetFrontClipRects( imesa ); break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: savageXMesaSetBackClipRects( imesa ); break; default: @@ -742,15 +803,15 @@ savageMakeCurrent(__DRIcontextPrivate *driContextPriv, imesa->mesa_drawable = driDrawPriv; imesa->dirty = ~0; - _mesa_make_current2(imesa->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate); + _mesa_make_current(imesa->glCtx, + (GLframebuffer *) driDrawPriv->driverPrivate, + (GLframebuffer *) driReadPriv->driverPrivate); savageXMesaWindowMoved( imesa ); } else { - _mesa_make_current(NULL, NULL); + _mesa_make_current(NULL, NULL, NULL); } return GL_TRUE; } diff --git a/src/mesa/drivers/dri/savage/savagedd.c b/src/mesa/drivers/dri/savage/savagedd.c index 639b335be78..72d7d33ce32 100644 --- a/src/mesa/drivers/dri/savage/savagedd.c +++ b/src/mesa/drivers/dri/savage/savagedd.c @@ -24,6 +24,7 @@ #include "mtypes.h" +#include "framebuffer.h" #include @@ -113,6 +114,6 @@ static void savageBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *heigh void savageDDInitDriverFuncs( GLcontext *ctx ) { ctx->Driver.GetBufferSize = savageBufferSize; - ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; + ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer; ctx->Driver.GetString = savageDDGetString; } diff --git a/src/mesa/drivers/dri/savage/savageioctl.c b/src/mesa/drivers/dri/savage/savageioctl.c index e68f58cccf4..30d008e1be8 100644 --- a/src/mesa/drivers/dri/savage/savageioctl.c +++ b/src/mesa/drivers/dri/savage/savageioctl.c @@ -367,28 +367,28 @@ static void savageDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, flags = 0; - if (mask & DD_FRONT_LEFT_BIT) { + if (mask & BUFFER_BIT_FRONT_LEFT) { flags |= SAVAGE_FRONT; - mask &= ~DD_FRONT_LEFT_BIT; + mask &= ~BUFFER_BIT_FRONT_LEFT; } - if (mask & DD_BACK_LEFT_BIT) { + if (mask & BUFFER_BIT_BACK_LEFT) { flags |= SAVAGE_BACK; - mask &= ~DD_BACK_LEFT_BIT; + mask &= ~BUFFER_BIT_BACK_LEFT; } - if ((mask & DD_DEPTH_BIT) && ctx->Depth.Mask) { + if ((mask & BUFFER_BIT_DEPTH) && ctx->Depth.Mask) { flags |= SAVAGE_DEPTH; depthMask |= (imesa->savageScreen->zpp == 2) ? 0xffffffff : 0x00ffffff; - mask &= ~DD_DEPTH_BIT; + mask &= ~BUFFER_BIT_DEPTH; } - if((mask & DD_STENCIL_BIT) && imesa->hw_stencil) + if((mask & BUFFER_BIT_STENCIL) && imesa->hw_stencil) { flags |= SAVAGE_DEPTH; depthMask |= 0xff000000; - mask &= ~DD_STENCIL_BIT; + mask &= ~BUFFER_BIT_STENCIL; } savageFlushVertices(imesa); diff --git a/src/mesa/drivers/dri/savage/savagespan.c b/src/mesa/drivers/dri/savage/savagespan.c index 4fad537ba62..acdfde097b5 100644 --- a/src/mesa/drivers/dri/savage/savagespan.c +++ b/src/mesa/drivers/dri/savage/savagespan.c @@ -230,9 +230,9 @@ static void savageDDSetBuffer(GLcontext *ctx, GLframebuffer *buffer, savageContextPtr imesa = SAVAGE_CONTEXT(ctx); char *map; - assert((bufferBit == DD_FRONT_LEFT_BIT) || (bufferBit == DD_BACK_LEFT_BIT)); + assert((bufferBit == BUFFER_BIT_FRONT_LEFT) || (bufferBit == BUFFER_BIT_BACK_LEFT)); - map = (bufferBit == DD_FRONT_LEFT_BIT) + map = (bufferBit == BUFFER_BIT_FRONT_LEFT) ? imesa->apertureBase[TARGET_FRONT] : imesa->apertureBase[TARGET_BACK]; @@ -306,15 +306,18 @@ void savageDDInitSpanFuncs( GLcontext *ctx ) swdd->SetBuffer = savageDDSetBuffer; +#if 0 switch (imesa->savageScreen->cpp) { case 2: savageInitPointers_565( swdd ); break; case 4: savageInitPointers_8888( swdd ); } +#endif switch (imesa->savageScreen->zpp) { case 2: +#if 0 if (imesa->float_depth) { swdd->ReadDepthSpan = savageReadDepthSpan_16f; swdd->WriteDepthSpan = savageWriteDepthSpan_16f; @@ -328,9 +331,10 @@ void savageDDInitSpanFuncs( GLcontext *ctx ) swdd->ReadDepthPixels = savageReadDepthPixels_16; swdd->WriteDepthPixels = savageWriteDepthPixels_16; } - +#endif break; - case 4: + case 4: +#if 0 if (imesa->float_depth) { swdd->ReadDepthSpan = savageReadDepthSpan_8_24f; swdd->WriteDepthSpan = savageWriteDepthSpan_8_24f; @@ -348,6 +352,7 @@ void savageDDInitSpanFuncs( GLcontext *ctx ) swdd->WriteStencilSpan = savageWriteStencilSpan_8_24; swdd->ReadStencilPixels = savageReadStencilPixels_8_24; swdd->WriteStencilPixels = savageWriteStencilPixels_8_24; +#endif break; } @@ -369,3 +374,64 @@ void savageDDInitSpanFuncs( GLcontext *ctx ) ctx->Driver.DrawPixels = savageDrawPixels; ctx->Driver.ReadPixels = savageReadPixels; } + + + +/** + * Plug in the Get/Put routines for the given driRenderbuffer. + */ +void +savageSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis, + GLboolean float_depth) +{ + if (drb->Base.InternalFormat == GL_RGBA) { + if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { + savageInitPointers_565(&drb->Base); + } + else { + savageInitPointers_8888(&drb->Base); + } + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + if (float_depth) { + drb->Base.GetRow = savageReadDepthSpan_16f; + drb->Base.GetValues = savageReadDepthPixels_16f; + drb->Base.PutRow = savageWriteDepthSpan_16f; + drb->Base.PutMonoRow = savageWriteMonoDepthSpan_16f; + drb->Base.PutValues = savageWriteDepthPixels_16f; + } + else { + drb->Base.GetRow = savageReadDepthSpan_16; + drb->Base.GetValues = savageReadDepthPixels_16; + drb->Base.PutRow = savageWriteDepthSpan_16; + drb->Base.PutMonoRow = savageWriteMonoDepthSpan_16; + drb->Base.PutValues = savageWriteDepthPixels_16; + } + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + if (float_depth) { + drb->Base.GetRow = savageReadDepthSpan_8_24f; + drb->Base.GetValues = savageReadDepthPixels_8_24f; + drb->Base.PutRow = savageWriteDepthSpan_8_24f; + drb->Base.PutMonoRow = savageWriteMonoDepthSpan_8_24f; + drb->Base.PutValues = savageWriteDepthPixels_8_24f; + } + else { + drb->Base.GetRow = savageReadDepthSpan_8_24; + drb->Base.GetValues = savageReadDepthPixels_8_24; + drb->Base.PutRow = savageWriteDepthSpan_8_24; + drb->Base.PutMonoRow = savageWriteMonoDepthSpan_8_24; + drb->Base.PutValues = savageWriteDepthPixels_8_24; + } + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + drb->Base.GetRow = savageReadStencilSpan_8_24; + drb->Base.GetValues = savageReadStencilPixels_8_24; + drb->Base.PutRow = savageWriteStencilSpan_8_24; + drb->Base.PutMonoRow = savageWriteMonoStencilSpan_8_24; + drb->Base.PutValues = savageWriteStencilPixels_8_24; + drb->Base.PutMonoValues = NULL; + } +} diff --git a/src/mesa/drivers/dri/savage/savagespan.h b/src/mesa/drivers/dri/savage/savagespan.h index cb3a1b52fd7..f6a312e820e 100644 --- a/src/mesa/drivers/dri/savage/savagespan.h +++ b/src/mesa/drivers/dri/savage/savagespan.h @@ -25,8 +25,16 @@ #ifndef _SAVAGE_SPAN_H #define _SAVAGE_SPAN_H +#include "drirenderbuffer.h" + + extern void savageDDInitSpanFuncs( GLcontext *ctx ); +extern void +savageSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis, + GLboolean float_depth); + + /* * Savage 16-bit float depth format with zExpOffset=16: * 4 bit unsigned exponent, 12 bit mantissa @@ -125,4 +133,5 @@ static __inline GLdouble savageDecodeFloat24( GLuint x ) } #undef _1 + #endif diff --git a/src/mesa/drivers/dri/savage/savagestate.c b/src/mesa/drivers/dri/savage/savagestate.c index 7b58c817a2f..567b9797336 100644 --- a/src/mesa/drivers/dri/savage/savagestate.c +++ b/src/mesa/drivers/dri/savage/savagestate.c @@ -644,8 +644,8 @@ static void savageDDDrawBuffer(GLcontext *ctx, GLenum mode ) /* * _DrawDestMask is easier to cope with than . */ - switch ( ctx->Color._DrawDestMask[0] ) { - case DD_FRONT_LEFT_BIT: + switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) { + case BUFFER_BIT_FRONT_LEFT: imesa->IsDouble = GL_FALSE; imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->frontOffset>>11; @@ -653,7 +653,7 @@ static void savageDDDrawBuffer(GLcontext *ctx, GLenum mode ) savageXMesaSetFrontClipRects( imesa ); FALLBACK( ctx, SAVAGE_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: imesa->IsDouble = GL_TRUE; imesa->regs.s4.destCtrl.ni.offset = imesa->savageScreen->backOffset>>11; imesa->NotFirstFrame = GL_FALSE; diff --git a/src/mesa/drivers/dri/sis/sis_clear.c b/src/mesa/drivers/dri/sis/sis_clear.c index 7ed71032931..ef4b561ca58 100644 --- a/src/mesa/drivers/dri/sis/sis_clear.c +++ b/src/mesa/drivers/dri/sis/sis_clear.c @@ -119,9 +119,9 @@ sisDDClear( GLcontext * ctx, GLbitfield mask, GLboolean all, /* Mask out any non-existent buffers */ if (ctx->Visual.depthBits == 0 || !ctx->Depth.Mask) - mask &= ~DD_DEPTH_BIT; + mask &= ~BUFFER_BIT_DEPTH; if (ctx->Visual.stencilBits == 0) - mask &= ~DD_STENCIL_BIT; + mask &= ~BUFFER_BIT_STENCIL; LOCK_HARDWARE(); @@ -132,21 +132,21 @@ sisDDClear( GLcontext * ctx, GLbitfield mask, GLboolean all, /* XXX: Appears to be broken with stencil. */ if ((smesa->current.hwCapEnable2 & (MASK_AlphaMaskWriteEnable | MASK_ColorMaskWriteEnable) && - (mask & (DD_BACK_LEFT_BIT | DD_FRONT_LEFT_BIT)) != 0) || - (ctx->Stencil.WriteMask[0] < 0xff && (mask & DD_STENCIL_BIT) != 0) ) + (mask & (BUFFER_BIT_BACK_LEFT | BUFFER_BIT_FRONT_LEFT)) != 0) || + (ctx->Stencil.WriteMask[0] < 0xff && (mask & BUFFER_BIT_STENCIL) != 0) ) { mask = sis_3D_Clear( ctx, mask, x1, y1, width1, height1 ); } - if ( mask & DD_FRONT_LEFT_BIT || mask & DD_BACK_LEFT_BIT) { + if ( mask & BUFFER_BIT_FRONT_LEFT || mask & BUFFER_BIT_BACK_LEFT) { sis_clear_color_buffer( ctx, mask, x1, y1, width1, height1 ); - mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT); + mask &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT); } - if (mask & (DD_DEPTH_BIT | DD_STENCIL_BIT)) { + if (mask & (BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL)) { if (smesa->depthbuffer != NULL) sis_clear_z_stencil_buffer( ctx, mask, x1, y1, width1, height1 ); - mask &= ~(DD_DEPTH_BIT | DD_STENCIL_BIT); + mask &= ~(BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL); } UNLOCK_HARDWARE(); @@ -204,9 +204,9 @@ sis_3D_Clear( GLcontext * ctx, GLbitfield mask, int count; drm_clip_rect_t *pExtents; - bClrColor = (mask & (DD_BACK_LEFT_BIT | DD_FRONT_LEFT_BIT)) != 0; - bClrDepth = (mask & DD_DEPTH_BIT) != 0; - bClrStencil = (mask & DD_STENCIL_BIT) != 0; + bClrColor = (mask & (BUFFER_BIT_BACK_LEFT | BUFFER_BIT_FRONT_LEFT)) != 0; + bClrDepth = (mask & BUFFER_BIT_DEPTH) != 0; + bClrStencil = (mask & BUFFER_BIT_STENCIL) != 0; if (smesa->GlobalFlag & GFLAG_RENDER_STATES) sis_update_render_state( smesa ); @@ -252,7 +252,7 @@ sis_3D_Clear( GLcontext * ctx, GLbitfield mask, dirtyflags |= GFLAG_STENCILSETTING; } - if (mask & DD_FRONT_LEFT_BIT) { + if (mask & BUFFER_BIT_FRONT_LEFT) { pExtents = smesa->driDrawable->pClipRects; count = smesa->driDrawable->numClipRects; } else { @@ -321,14 +321,14 @@ sis_3D_Clear( GLcontext * ctx, GLbitfield mask, mEndPrimitive(); - /* If DD_FRONT_LEFT_BIT is set, we've only cleared the front buffer so far */ - if ((mask & DD_FRONT_LEFT_BIT) != 0 && (mask & DD_BACK_LEFT_BIT) != 0) - sis_3D_Clear( ctx, DD_BACK_LEFT_BIT, x, y, width, height ); + /* If BUFFER_BIT_FRONT_LEFT is set, we've only cleared the front buffer so far */ + if ((mask & BUFFER_BIT_FRONT_LEFT) != 0 && (mask & BUFFER_BIT_BACK_LEFT) != 0) + sis_3D_Clear( ctx, BUFFER_BIT_BACK_LEFT, x, y, width, height ); smesa->GlobalFlag |= dirtyflags; - return mask & ~(DD_DEPTH_BIT | DD_STENCIL_BIT | DD_BACK_LEFT_BIT | - DD_FRONT_LEFT_BIT); + return mask & ~(BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL | BUFFER_BIT_BACK_LEFT | + BUFFER_BIT_FRONT_LEFT); } static void @@ -368,7 +368,7 @@ sis_clear_color_buffer( GLcontext *ctx, GLenum mask, GLint x, GLint y, ENGPACKET stEngPacket; /* Clear back buffer */ - if (mask & DD_BACK_LEFT_BIT) { + if (mask & BUFFER_BIT_BACK_LEFT) { smesa->cbClearPacket.stdwDestPos.wY = y; smesa->cbClearPacket.stdwDestPos.wX = x; smesa->cbClearPacket.stdwDim.wWidth = (GLshort) width; @@ -378,7 +378,7 @@ sis_clear_color_buffer( GLcontext *ctx, GLenum mask, GLint x, GLint y, sis_bitblt_clear_cmd( smesa, &smesa->cbClearPacket ); } - if ((mask & DD_FRONT_LEFT_BIT) == 0) + if ((mask & BUFFER_BIT_FRONT_LEFT) == 0) return; /* Clear front buffer */ diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c index 3b23b7df4e5..ac7fb56dbe1 100644 --- a/src/mesa/drivers/dri/sis/sis_context.c +++ b/src/mesa/drivers/dri/sis/sis_context.c @@ -306,14 +306,14 @@ sisMakeCurrent( __DRIcontextPrivate *driContextPriv, newSisCtx->driDrawable = driDrawPriv; - _mesa_make_current2( newSisCtx->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); + _mesa_make_current( newSisCtx->glCtx, + (GLframebuffer *) driDrawPriv->driverPrivate, + (GLframebuffer *) driReadPriv->driverPrivate ); sisUpdateBufferSize( newSisCtx ); sisUpdateClipping( newSisCtx->glCtx ); } else { - _mesa_make_current( 0, 0 ); + _mesa_make_current( NULL, NULL, NULL ); } return GL_TRUE; diff --git a/src/mesa/drivers/dri/sis/sis_dd.c b/src/mesa/drivers/dri/sis/sis_dd.c index 4049a106b60..4e64c17b3d3 100644 --- a/src/mesa/drivers/dri/sis/sis_dd.c +++ b/src/mesa/drivers/dri/sis/sis_dd.c @@ -41,6 +41,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_tris.h" #include "swrast/swrast.h" +#include "framebuffer.h" #include "utils.h" @@ -172,9 +173,9 @@ sisUpdateBufferSize( sisContextPtr smesa ) void sisInitDriverFuncs( struct dd_function_table *functions ) { - functions->GetBufferSize = sisGetBufferSize; - functions->ResizeBuffers = _swrast_alloc_buffers; - functions->GetString = sisGetString; - functions->Finish = sisFinish; - functions->Flush = sisFlush; + functions->GetBufferSize = sisGetBufferSize; + functions->ResizeBuffers = _mesa_resize_framebuffer; + functions->GetString = sisGetString; + functions->Finish = sisFinish; + functions->Flush = sisFlush; } diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c index 8ef6765dc3c..ccfa959c9af 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.c +++ b/src/mesa/drivers/dri/sis/sis_screen.c @@ -34,10 +34,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "context.h" #include "utils.h" #include "imports.h" +#include "framebuffer.h" +#include "renderbuffer.h" #include "sis_context.h" #include "sis_dri.h" #include "sis_lock.h" +#include "sis_span.h" #include "xmlpool.h" @@ -196,6 +199,7 @@ sisDestroyScreen( __DRIscreenPrivate *sPriv ) sPriv->private = NULL; } + /* Create and initialize the Mesa and driver specific pixmap buffer * data. */ @@ -205,15 +209,79 @@ sisCreateBuffer( __DRIscreenPrivate *driScrnPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) { + sisScreenPtr screen = (sisScreenPtr) driScrnPriv->private; + if (isPixmap) return GL_FALSE; /* not implemented */ +#if 0 driDrawPriv->driverPrivate = (void *)_mesa_create_framebuffer( mesaVis, GL_FALSE, /* software depth buffer? */ mesaVis->stencilBits > 0, mesaVis->accumRedBits > 0, mesaVis->alphaBits > 0 ); /* XXX */ +#else + struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); + + /* XXX double-check the Offset/Pitch parameters! */ + { + driRenderbuffer *frontRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + 0, driScrnPriv->fbStride); + sisSetSpanFunctions(frontRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); + } + + if (mesaVis->doubleBufferMode) { + driRenderbuffer *backRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + 0, driScrnPriv->fbStride); + sisSetSpanFunctions(backRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + } + + if (mesaVis->depthBits == 16) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp, + 0, driScrnPriv->fbStride); + sisSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else if (mesaVis->depthBits == 24) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp, + 0, driScrnPriv->fbStride); + sisSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else if (mesaVis->depthBits == 32) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT32, screen->cpp, + 0, driScrnPriv->fbStride); + sisSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + + /* no h/w stencil? + if (mesaVis->stencilBits > 0) { + driRenderbuffer *stencilRb + = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT); + sisSetSpanFunctions(stencilRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); + } + */ + + _mesa_add_soft_renderbuffers(fb, + GL_FALSE, /* color */ + GL_FALSE, /* depth */ + mesaVis->stencilBits > 0, + mesaVis->accumRedBits > 0, + GL_FALSE, /* alpha */ + GL_FALSE /* aux */); + driDrawPriv->driverPrivate = (void *) fb; +#endif + return (driDrawPriv->driverPrivate != NULL); } diff --git a/src/mesa/drivers/dri/sis/sis_span.c b/src/mesa/drivers/dri/sis/sis_span.c index 8f4b3af62ed..abf3d652c00 100644 --- a/src/mesa/drivers/dri/sis/sis_span.c +++ b/src/mesa/drivers/dri/sis/sis_span.c @@ -205,11 +205,11 @@ static void sisDDSetBuffer( GLcontext *ctx, sisContextPtr smesa = SIS_CONTEXT(ctx); switch ( bufferBit ) { - case DD_FRONT_LEFT_BIT: + case BUFFER_BIT_FRONT_LEFT: smesa->drawOffset = smesa->readOffset = smesa->frontOffset; smesa->drawPitch = smesa->readPitch = smesa->frontPitch; break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: smesa->drawOffset = smesa->readOffset = smesa->backOffset; smesa->drawPitch = smesa->readPitch = smesa->backPitch; break; @@ -246,6 +246,7 @@ sisDDInitSpanFuncs( GLcontext *ctx ) switch (smesa->zFormat) { case SiS_ZFORMAT_Z16: +#if 0 swdd->ReadDepthSpan = sisReadDepthSpan_16; swdd->ReadDepthPixels = sisReadDepthPixels_16; swdd->WriteDepthSpan = sisWriteDepthSpan_16; @@ -255,8 +256,10 @@ sisDDInitSpanFuncs( GLcontext *ctx ) swdd->ReadStencilPixels = NULL; swdd->WriteStencilSpan = NULL; swdd->WriteStencilPixels = NULL; +#endif break; case SiS_ZFORMAT_Z32: +#if 0 swdd->ReadDepthSpan = sisReadDepthSpan_32; swdd->ReadDepthPixels = sisReadDepthPixels_32; swdd->WriteDepthSpan = sisWriteDepthSpan_32; @@ -266,8 +269,10 @@ sisDDInitSpanFuncs( GLcontext *ctx ) swdd->ReadStencilPixels = NULL; swdd->WriteStencilSpan = NULL; swdd->WriteStencilPixels = NULL; +#endif break; case SiS_ZFORMAT_S8Z24: +#if 0 swdd->ReadDepthSpan = sisReadDepthSpan_24_8; swdd->ReadDepthPixels = sisReadDepthPixels_24_8; swdd->WriteDepthSpan = sisWriteDepthSpan_24_8; @@ -277,9 +282,11 @@ sisDDInitSpanFuncs( GLcontext *ctx ) swdd->ReadStencilPixels = sisReadStencilPixels_24_8; swdd->WriteStencilSpan = sisWriteStencilSpan_24_8; swdd->WriteStencilPixels = sisWriteStencilPixels_24_8; +#endif break; } +#if 0 switch ( smesa->bytesPerPixel ) { case 2: @@ -312,7 +319,70 @@ sisDDInitSpanFuncs( GLcontext *ctx ) swdd->WriteMonoCIPixels = NULL; swdd->ReadCI32Span = NULL; swdd->ReadCI32Pixels = NULL; +#endif swdd->SpanRenderStart = sisSpanRenderStart; swdd->SpanRenderFinish = sisSpanRenderFinish; } + + + +/** + * Plug in the Get/Put routines for the given driRenderbuffer. + */ +void +sisSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) +{ + if (drb->Base.InternalFormat == GL_RGBA) { + if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { + drb->Base.GetRow = sisReadRGBASpan_565; + drb->Base.GetValues = sisReadRGBAPixels_565; + drb->Base.PutRow = sisWriteRGBASpan_565; + drb->Base.PutRowRGB = sisWriteRGBSpan_565; + drb->Base.PutMonoRow = sisWriteMonoRGBASpan_565; + drb->Base.PutValues = sisWriteRGBAPixels_565; + drb->Base.PutMonoValues = sisWriteMonoRGBAPixels_565; + } + else { + drb->Base.GetRow = sisReadRGBASpan_8888; + drb->Base.GetValues = sisReadRGBAPixels_8888; + drb->Base.PutRow = sisWriteRGBASpan_8888; + drb->Base.PutRowRGB = sisWriteRGBSpan_8888; + drb->Base.PutMonoRow = sisWriteMonoRGBASpan_8888; + drb->Base.PutValues = sisWriteRGBAPixels_8888; + drb->Base.PutMonoValues = sisWriteMonoRGBAPixels_8888; + } + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + drb->Base.GetRow = sisReadDepthSpan_16; + drb->Base.GetValues = sisReadDepthPixels_16; + drb->Base.PutRow = sisWriteDepthSpan_16; + drb->Base.PutMonoRow = sisWriteMonoDepthSpan_16; + drb->Base.PutValues = sisWriteDepthPixels_16; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + drb->Base.GetRow = sisReadDepthSpan_24_8; + drb->Base.GetValues = sisReadDepthPixels_24_8; + drb->Base.PutRow = sisWriteDepthSpan_24_8; + drb->Base.PutMonoRow = sisWriteMonoDepthSpan_24_8; + drb->Base.PutValues = sisWriteDepthPixels_24_8; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT32) { + drb->Base.GetRow = sisReadDepthSpan_32; + drb->Base.GetValues = sisReadDepthPixels_32; + drb->Base.PutRow = sisWriteDepthSpan_32; + drb->Base.PutMonoRow = sisWriteMonoDepthSpan_32; + drb->Base.PutValues = sisWriteDepthPixels_32; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + drb->Base.GetRow = sisReadStencilSpan_24_8; + drb->Base.GetValues = sisReadStencilPixels_24_8; + drb->Base.PutRow = sisWriteStencilSpan_24_8; + drb->Base.PutMonoRow = sisWriteMonoStencilSpan_24_8; + drb->Base.PutValues = sisWriteStencilPixels_24_8; + drb->Base.PutMonoValues = NULL; + } +} diff --git a/src/mesa/drivers/dri/sis/sis_span.h b/src/mesa/drivers/dri/sis/sis_span.h index c9760e4d268..7c73bc6d3ad 100644 --- a/src/mesa/drivers/dri/sis/sis_span.h +++ b/src/mesa/drivers/dri/sis/sis_span.h @@ -32,9 +32,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __SIS_SPAN_H__ #define __SIS_SPAN_H__ +#include "drirenderbuffer.h" + + extern void sisSpanRenderStart( GLcontext *ctx ); extern void sisSpanRenderFinish( GLcontext *ctx ); extern void sisDDInitSpanFuncs( GLcontext *ctx ); +extern void +sisSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); + #endif diff --git a/src/mesa/drivers/dri/sis/sis_state.c b/src/mesa/drivers/dri/sis/sis_state.c index b269d694b0f..db58e9090bc 100644 --- a/src/mesa/drivers/dri/sis/sis_state.c +++ b/src/mesa/drivers/dri/sis/sis_state.c @@ -529,9 +529,9 @@ void sisDDDrawBuffer( GLcontext *ctx, GLenum mode ) /* * _DrawDestMask is easier to cope with than . */ - switch ( ctx->Color._DrawDestMask[0] ) { - case DD_FRONT_LEFT_BIT: - case DD_BACK_LEFT_BIT: + switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) { + case BUFFER_BIT_FRONT_LEFT: + case BUFFER_BIT_BACK_LEFT: FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; default: diff --git a/src/mesa/drivers/dri/sis/sis_tris.c b/src/mesa/drivers/dri/sis/sis_tris.c index 45a92e5e92b..3af70cf6532 100644 --- a/src/mesa/drivers/dri/sis/sis_tris.c +++ b/src/mesa/drivers/dri/sis/sis_tris.c @@ -805,7 +805,7 @@ static void sisRenderStart( GLcontext *ctx ) GLuint AGPParseSet = smesa->AGPParseSet; GLboolean tex_fallback = GL_FALSE; - if (ctx->Color._DrawDestMask[0] == DD_FRONT_LEFT_BIT && + if (ctx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT && smesa->driDrawable->numClipRects != 0) { multipass_cliprect(ctx, 0); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c index 2a9e23a1a6f..654ada59804 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c @@ -634,9 +634,9 @@ tdfxMakeCurrent( __DRIcontextPrivate *driContextPriv, /* Need to call _mesa_make_current2() in order to make sure API * dispatch is set correctly. */ - _mesa_make_current2( newCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); + _mesa_make_current( newCtx, + (GLframebuffer *) driDrawPriv->driverPrivate, + (GLframebuffer *) driReadPriv->driverPrivate ); return GL_TRUE; } /* [dBorca] tunnel2 requires this */ @@ -667,11 +667,11 @@ tdfxMakeCurrent( __DRIcontextPrivate *driContextPriv, UNLOCK_HARDWARE( newFx ); } - _mesa_make_current2( newCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); + _mesa_make_current( newCtx, + (GLframebuffer *) driDrawPriv->driverPrivate, + (GLframebuffer *) driReadPriv->driverPrivate ); } else { - _mesa_make_current( 0, 0 ); + _mesa_make_current( NULL, NULL, NULL ); } return GL_TRUE; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_dd.c b/src/mesa/drivers/dri/tdfx/tdfx_dd.c index 34e4babcf5e..02fbace5be8 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_dd.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_dd.c @@ -43,6 +43,7 @@ #include "context.h" #include "enums.h" +#include "framebuffer.h" #include "swrast/swrast.h" #if defined(USE_X86_ASM) #include "x86/common_x86_asm.h" @@ -257,7 +258,7 @@ void tdfxDDInitDriverFuncs( const __GLcontextModes *visual, functions->GetString = tdfxDDGetString; functions->GetBufferSize = tdfxDDGetBufferSize; - functions->ResizeBuffers = _swrast_alloc_buffers; + functions->ResizeBuffers = _mesa_resize_framebuffer; /* Accelerated paths */ diff --git a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c index 7ec6302cf15..6592ecccfba 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c @@ -175,7 +175,7 @@ tdfx_bitmap_R5G6B5(GLcontext * ctx, GLint px, GLint py, SCISSOR_BIT | STENCIL_BIT | MASKING_BIT | - ALPHABUF_BIT | MULTI_DRAW_BIT)) return GL_FALSE; + MULTI_DRAW_BIT)) return GL_FALSE; if (ctx->Scissor.Enabled) { /* This is a bit tricky, but by carefully adjusting the px, py, @@ -339,7 +339,7 @@ tdfx_bitmap_R8G8B8A8(GLcontext * ctx, GLint px, GLint py, SCISSOR_BIT | STENCIL_BIT | MASKING_BIT | - ALPHABUF_BIT | MULTI_DRAW_BIT)) return GL_FALSE; + MULTI_DRAW_BIT)) return GL_FALSE; if (ctx->Scissor.Enabled) { /* This is a bit tricky, but by carefully adjusting the px, py, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_render.c b/src/mesa/drivers/dri/tdfx/tdfx_render.c index 3ce91b9257b..56f5f147eeb 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_render.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_render.c @@ -51,7 +51,7 @@ static void tdfxClear( GLcontext *ctx, GLint x, GLint y, GLint width, GLint height ) { tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx; - GLbitfield softwareMask = mask & (DD_ACCUM_BIT); + GLbitfield softwareMask = mask & (BUFFER_BIT_ACCUM); const GLuint stencil_size = fxMesa->haveHwStencil ? fxMesa->glCtx->Visual.stencilBits : 0; @@ -67,14 +67,14 @@ static void tdfxClear( GLcontext *ctx, } /* we can't clear accum buffers */ - mask &= ~(DD_ACCUM_BIT); + mask &= ~(BUFFER_BIT_ACCUM); - if (mask & DD_STENCIL_BIT) { + if (mask & BUFFER_BIT_STENCIL) { if (!fxMesa->haveHwStencil || ctx->Stencil.WriteMask[0] != 0xff) { /* Napalm seems to have trouble with stencil write masks != 0xff */ /* do stencil clear in software */ - mask &= ~(DD_STENCIL_BIT); - softwareMask |= DD_STENCIL_BIT; + mask &= ~(BUFFER_BIT_STENCIL); + softwareMask |= BUFFER_BIT_STENCIL; } } @@ -82,8 +82,8 @@ static void tdfxClear( GLcontext *ctx, /* can only do color masking if running in 24/32bpp on Napalm */ if (ctx->Color.ColorMask[RCOMP] != ctx->Color.ColorMask[GCOMP] || ctx->Color.ColorMask[GCOMP] != ctx->Color.ColorMask[BCOMP]) { - softwareMask |= (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)); - mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT); + softwareMask |= (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)); + mask &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT); } } @@ -94,7 +94,7 @@ static void tdfxClear( GLcontext *ctx, * in the OGL state. */ LOCK_HARDWARE(fxMesa); - if (mask & DD_STENCIL_BIT) { + if (mask & BUFFER_BIT_STENCIL) { fxMesa->Glide.grStencilMask(/*ctx->Stencil.WriteMask*/ 0xff); /* set stencil ref value = desired clear value */ fxMesa->Glide.grStencilFunc(GR_CMP_ALWAYS, @@ -119,8 +119,8 @@ static void tdfxClear( GLcontext *ctx, * This could probably be done fancier but doing each possible case * explicitly is less error prone. */ - switch (mask & ~DD_STENCIL_BIT) { - case DD_BACK_LEFT_BIT | DD_DEPTH_BIT: + switch (mask & ~BUFFER_BIT_STENCIL) { + case BUFFER_BIT_BACK_LEFT | BUFFER_BIT_DEPTH: /* back buffer & depth */ FX_grColorMaskv_NoLock(ctx, true4); /* work around Voodoo3 bug */ fxMesa->Glide.grDepthMask(FXTRUE); @@ -139,7 +139,7 @@ static void tdfxClear( GLcontext *ctx, fxMesa->Glide.grDepthMask(FXFALSE); } break; - case DD_FRONT_LEFT_BIT | DD_DEPTH_BIT: + case BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_DEPTH: /* XXX it appears that the depth buffer isn't cleared when * glRenderBuffer(GR_BUFFER_FRONTBUFFER) is set. * This is a work-around/ @@ -173,7 +173,7 @@ static void tdfxClear( GLcontext *ctx, fxMesa->Glide.grDepthMask(FXFALSE); } break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: /* back buffer only */ fxMesa->Glide.grDepthMask(FXFALSE); fxMesa->Glide.grRenderBuffer(GR_BUFFER_BACKBUFFER); @@ -190,7 +190,7 @@ static void tdfxClear( GLcontext *ctx, fxMesa->Glide.grDepthMask(FXTRUE); } break; - case DD_FRONT_LEFT_BIT: + case BUFFER_BIT_FRONT_LEFT: /* front buffer only */ fxMesa->Glide.grDepthMask(FXFALSE); fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER); @@ -207,7 +207,7 @@ static void tdfxClear( GLcontext *ctx, fxMesa->Glide.grDepthMask(FXTRUE); } break; - case DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT: + case BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT: /* front and back */ fxMesa->Glide.grDepthMask(FXFALSE); fxMesa->Glide.grRenderBuffer(GR_BUFFER_BACKBUFFER); @@ -234,7 +234,7 @@ static void tdfxClear( GLcontext *ctx, fxMesa->Glide.grDepthMask(FXTRUE); } break; - case DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT | DD_DEPTH_BIT: + case BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT | BUFFER_BIT_DEPTH: /* clear front */ fxMesa->Glide.grDepthMask(FXFALSE); fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER); @@ -263,7 +263,7 @@ static void tdfxClear( GLcontext *ctx, fxMesa->Glide.grDepthMask(FXFALSE); } break; - case DD_DEPTH_BIT: + case BUFFER_BIT_DEPTH: /* just the depth buffer */ fxMesa->Glide.grRenderBuffer(GR_BUFFER_BACKBUFFER); FX_grColorMaskv_NoLock(ctx, false4); @@ -278,14 +278,14 @@ static void tdfxClear( GLcontext *ctx, fxMesa->Color.ClearAlpha, fxMesa->Depth.Clear); FX_grColorMaskv_NoLock(ctx, true4); - if (ctx->Color._DrawDestMask[0] & DD_FRONT_LEFT_BIT) + if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_FRONT_LEFT) fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER); if (!ctx->Depth.Test || !ctx->Depth.Mask) fxMesa->Glide.grDepthMask(FXFALSE); break; default: /* clear no color buffers or depth buffer but might clear stencil */ - if (stencil_size > 0 && (mask & DD_STENCIL_BIT)) { + if (stencil_size > 0 && (mask & BUFFER_BIT_STENCIL)) { /* XXX need this RenderBuffer call to work around Glide bug */ fxMesa->Glide.grRenderBuffer(GR_BUFFER_BACKBUFFER); fxMesa->Glide.grDepthMask(FXFALSE); @@ -298,14 +298,14 @@ static void tdfxClear( GLcontext *ctx, fxMesa->Glide.grDepthMask(FXTRUE); } FX_grColorMaskv_NoLock(ctx, true4); - if (ctx->Color._DrawDestMask[0] & DD_FRONT_LEFT_BIT) + if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_FRONT_LEFT) fxMesa->Glide.grRenderBuffer(GR_BUFFER_FRONTBUFFER); } } } END_CLIP_LOOP(fxMesa); - if (fxMesa->haveHwStencil && (mask & DD_STENCIL_BIT)) { + if (fxMesa->haveHwStencil && (mask & BUFFER_BIT_STENCIL)) { /* We changed the stencil state above. Signal that we need to * upload it again. */ diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index 7896811d997..500d5d3f3dd 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -38,9 +38,11 @@ #include "tdfx_context.h" #include "tdfx_lock.h" #include "tdfx_vb.h" +#include "tdfx_span.h" #include "tdfx_tris.h" #include "utils.h" - +#include "framebuffer.h" +#include "renderbuffer.h" #ifdef DEBUG_LOCKING char *prevLockFile = 0; @@ -137,16 +139,70 @@ tdfxCreateBuffer( __DRIscreenPrivate *driScrnPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) { + tdfxScreenPrivate *screen = (tdfxScreenPrivate *) driScrnPriv->private; + if (isPixmap) { return GL_FALSE; /* not implemented */ } else { +#if 0 driDrawPriv->driverPrivate = (void *) _mesa_create_framebuffer( mesaVis, GL_FALSE, /* software depth buffer? */ mesaVis->stencilBits > 0, mesaVis->accumRedBits > 0, GL_FALSE /* software alpha channel? */ ); +#else + struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); + + { + driRenderbuffer *frontRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->fbOffset, screen->width); + tdfxSetSpanFunctions(frontRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); + } + + if (mesaVis->doubleBufferMode) { + driRenderbuffer *backRb + = driNewRenderbuffer(GL_RGBA8, screen->cpp, + screen->backOffset, screen->width); + tdfxSetSpanFunctions(backRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + } + + if (mesaVis->depthBits == 16) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp, + screen->depthOffset, screen->width); + tdfxSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else if (mesaVis->depthBits == 24) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp, + screen->depthOffset, screen->width); + tdfxSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + + if (mesaVis->stencilBits > 0) { + driRenderbuffer *stencilRb + = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp, + screen->depthOffset, screen->width); + tdfxSetSpanFunctions(stencilRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); + } + + _mesa_add_soft_renderbuffers(fb, + GL_FALSE, /* color */ + GL_FALSE, /* depth */ + GL_FALSE, /*swStencil,*/ + mesaVis->accumRedBits > 0, + GL_FALSE, /* alpha */ + GL_FALSE /* aux */); + driDrawPriv->driverPrivate = (void *) fb; +#endif return (driDrawPriv->driverPrivate != NULL); } } diff --git a/src/mesa/drivers/dri/tdfx/tdfx_span.c b/src/mesa/drivers/dri/tdfx/tdfx_span.c index 1bcec634131..1fab811b74d 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_span.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_span.c @@ -596,11 +596,13 @@ GetFbParams(tdfxContextPtr fxMesa, PUT_WRAPPED_FB_DATA(ReadParamsp, type, x, y, value); \ } while (0) + static void -tdfxDDWriteDepthSpan(GLcontext * ctx, - GLuint n, GLint x, GLint y, const GLdepth depth[], +tdfxDDWriteDepthSpan(GLcontext * ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, const void *values, const GLubyte mask[]) { + const GLuint *depth = (const GLuint *) values; tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx; GLint bottom = fxMesa->y_offset + fxMesa->height - 1; GLuint depth_size = fxMesa->glCtx->Visual.depthBits; @@ -833,9 +835,24 @@ tdfxDDWriteDepthSpan(GLcontext * ctx, } static void -tdfxDDReadDepthSpan(GLcontext * ctx, - GLuint n, GLint x, GLint y, GLdepth depth[]) +tdfxDDWriteMonoDepthSpan(GLcontext * ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, const void *value, + const GLubyte mask[]) { + GLuint depthVal = *((GLuint *) value); + GLuint depths[MAX_WIDTH]; + GLuint i; + for (i = 0; i < n; i++) + depths[i] = depthVal; + tdfxDDWriteDepthSpan(ctx, rb, n, x, y, depths, mask); +} + + +static void +tdfxDDReadDepthSpan(GLcontext * ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, void *values) +{ + GLuint *depth = (GLuint *) values; tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx; GLint bottom = fxMesa->height + fxMesa->y_offset - 1; GLuint i; @@ -936,10 +953,11 @@ tdfxDDReadDepthSpan(GLcontext * ctx, static void -tdfxDDWriteDepthPixels(GLcontext * ctx, +tdfxDDWriteDepthPixels(GLcontext * ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], - const GLdepth depth[], const GLubyte mask[]) + const void *values, const GLubyte mask[]) { + const GLuint *depth = (const GLuint *) values; tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx; GLint bottom = fxMesa->height + fxMesa->y_offset - 1; GLuint i; @@ -1018,9 +1036,10 @@ tdfxDDWriteDepthPixels(GLcontext * ctx, static void -tdfxDDReadDepthPixels(GLcontext * ctx, GLuint n, - const GLint x[], const GLint y[], GLdepth depth[]) +tdfxDDReadDepthPixels(GLcontext * ctx, struct gl_renderbuffer *rb, GLuint n, + const GLint x[], const GLint y[], void *values) { + GLuint *depth = (GLuint *) values; tdfxContextPtr fxMesa = (tdfxContextPtr) ctx->DriverCtx; GLint bottom = fxMesa->height + fxMesa->y_offset - 1; GLuint i; @@ -1104,9 +1123,11 @@ tdfxDDReadDepthPixels(GLcontext * ctx, GLuint n, #define BUILD_ZS(z, s) (((s) << 24) | (z)) static void -write_stencil_span(GLcontext * ctx, GLuint n, GLint x, GLint y, - const GLstencil stencil[], const GLubyte mask[]) +write_stencil_span(GLcontext * ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *values, const GLubyte mask[]) { + const GLubyte *stencil = (const GLubyte *) values; tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); GrLfbInfo_t info; GrLfbInfo_t backBufferInfo; @@ -1161,9 +1182,25 @@ write_stencil_span(GLcontext * ctx, GLuint n, GLint x, GLint y, static void -read_stencil_span(GLcontext * ctx, GLuint n, GLint x, GLint y, - GLstencil stencil[]) +write_mono_stencil_span(GLcontext * ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *value, const GLubyte mask[]) { + GLbyte stencilVal = *((GLbyte *) value); + GLbyte stencils[MAX_WIDTH]; + GLuint i; + for (i = 0; i < n; i++) + stencils[i] = stencilVal; + write_stencil_span(ctx, rb, n, x, y, stencils, mask); +} + + +static void +read_stencil_span(GLcontext * ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + void *values) +{ + GLubyte *stencil = (GLubyte *) values; tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); GrLfbInfo_t info; GrLfbInfo_t backBufferInfo; @@ -1211,10 +1248,11 @@ read_stencil_span(GLcontext * ctx, GLuint n, GLint x, GLint y, static void -write_stencil_pixels(GLcontext * ctx, GLuint n, - const GLint x[], const GLint y[], - const GLstencil stencil[], const GLubyte mask[]) +write_stencil_pixels(GLcontext * ctx, struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + const void *values, const GLubyte mask[]) { + const GLubyte *stencil = (const GLubyte *) values; tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); GrLfbInfo_t info; GrLfbInfo_t backBufferInfo; @@ -1249,9 +1287,11 @@ write_stencil_pixels(GLcontext * ctx, GLuint n, static void -read_stencil_pixels(GLcontext * ctx, GLuint n, const GLint x[], - const GLint y[], GLstencil stencil[]) +read_stencil_pixels(GLcontext * ctx, struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + void *values) { + GLubyte *stencil = (GLubyte *) values; tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); GrLfbInfo_t info; GrLfbInfo_t backBufferInfo; @@ -1315,10 +1355,10 @@ static void tdfxDDSetBuffer( GLcontext *ctx, (void) buffer; switch ( bufferBit ) { - case DD_FRONT_LEFT_BIT: + case BUFFER_BIT_FRONT_LEFT: fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_FRONTBUFFER; break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_BACKBUFFER; break; default: @@ -1337,6 +1377,7 @@ void tdfxDDInitSpanFuncs( GLcontext *ctx ) swdd->SetBuffer = tdfxDDSetBuffer; +#if 0 if ( VISUAL_EQUALS_RGBA(ctx->Visual, 5, 6, 5, 0) ) { /* 16bpp mode */ @@ -1374,19 +1415,23 @@ void tdfxDDInitSpanFuncs( GLcontext *ctx ) { abort(); } +#endif if ( fxMesa->haveHwStencil ) { +#if 0 swdd->WriteStencilSpan = write_stencil_span; swdd->ReadStencilSpan = read_stencil_span; swdd->WriteStencilPixels = write_stencil_pixels; swdd->ReadStencilPixels = read_stencil_pixels; +#endif } +#if 0 swdd->WriteDepthSpan = tdfxDDWriteDepthSpan; swdd->WriteDepthPixels = tdfxDDWriteDepthPixels; swdd->ReadDepthSpan = tdfxDDReadDepthSpan; swdd->ReadDepthPixels = tdfxDDReadDepthPixels; - +#endif swdd->WriteCI8Span = NULL; swdd->WriteCI32Span = NULL; swdd->WriteMonoCISpan = NULL; @@ -1398,3 +1443,64 @@ void tdfxDDInitSpanFuncs( GLcontext *ctx ) swdd->SpanRenderStart = tdfxSpanRenderStart; swdd->SpanRenderFinish = tdfxSpanRenderFinish; } + + + +/** + * Plug in the Get/Put routines for the given driRenderbuffer. + */ +void +tdfxSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) +{ + if (drb->Base.InternalFormat == GL_RGBA) { + if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { + drb->Base.GetRow = tdfxReadRGBASpan_RGB565; + drb->Base.GetValues = tdfxReadRGBAPixels_RGB565; + drb->Base.PutRow = tdfxWriteRGBASpan_RGB565; + drb->Base.PutRowRGB = tdfxWriteRGBSpan_RGB565; + drb->Base.PutMonoRow = tdfxWriteMonoRGBASpan_RGB565; + drb->Base.PutValues = tdfxWriteRGBAPixels_RGB565; + drb->Base.PutMonoValues = tdfxWriteMonoRGBAPixels_RGB565; + } + else if (vis->redBits == 8 && vis->greenBits == 8 + && vis->blueBits == 8 && vis->alphaBits == 0) { + drb->Base.GetRow = tdfxReadRGBASpan_RGB888; + drb->Base.GetValues = tdfxReadRGBAPixels_RGB888; + drb->Base.PutRow = tdfxWriteRGBASpan_RGB888; + drb->Base.PutRowRGB = tdfxWriteRGBSpan_RGB888; + drb->Base.PutMonoRow = tdfxWriteMonoRGBASpan_RGB888; + drb->Base.PutValues = tdfxWriteRGBAPixels_RGB888; + drb->Base.PutMonoValues = tdfxWriteMonoRGBAPixels_RGB888; + } + else if (vis->redBits == 8 && vis->greenBits == 8 + && vis->blueBits == 8 && vis->alphaBits == 8) { + drb->Base.GetRow = tdfxReadRGBASpan_ARGB8888; + drb->Base.GetValues = tdfxReadRGBAPixels_ARGB8888; + drb->Base.PutRow = tdfxWriteRGBASpan_ARGB8888; + drb->Base.PutRowRGB = tdfxWriteRGBSpan_ARGB8888; + drb->Base.PutMonoRow = tdfxWriteMonoRGBASpan_ARGB8888; + drb->Base.PutValues = tdfxWriteRGBAPixels_ARGB8888; + drb->Base.PutMonoValues = tdfxWriteMonoRGBAPixels_ARGB8888; + } + else { + _mesa_problem(NULL, "problem in tdfxSetSpanFunctions"); + } + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16 || + drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + drb->Base.GetRow = tdfxDDReadDepthSpan; + drb->Base.GetValues = tdfxDDReadDepthPixels; + drb->Base.PutRow = tdfxDDWriteDepthSpan; + drb->Base.PutMonoRow = tdfxDDWriteMonoDepthSpan; + drb->Base.PutValues = tdfxDDWriteDepthPixels; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + drb->Base.GetRow = read_stencil_span; + drb->Base.GetValues = read_stencil_pixels; + drb->Base.PutRow = write_stencil_span; + drb->Base.PutMonoRow = write_mono_stencil_span; + drb->Base.PutValues = write_stencil_pixels; + drb->Base.PutMonoValues = NULL; + } +} diff --git a/src/mesa/drivers/dri/tdfx/tdfx_span.h b/src/mesa/drivers/dri/tdfx/tdfx_span.h index a95aad5dbf6..62044144f0a 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_span.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_span.h @@ -39,7 +39,11 @@ #define __TDFX_SPAN_H__ #include "context.h" +#include "drirenderbuffer.h" extern void tdfxDDInitSpanFuncs( GLcontext *ctx ); +extern void +tdfxSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); + #endif diff --git a/src/mesa/drivers/dri/tdfx/tdfx_state.c b/src/mesa/drivers/dri/tdfx/tdfx_state.c index cb3c1059bca..85d99bb05e7 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_state.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_state.c @@ -377,7 +377,7 @@ static void tdfxUpdateZMode( GLcontext *ctx ) mask = FXFALSE; /* zbuffer is not touched */ } - fxMesa->Depth.Clear = (FxU32) (ctx->DepthMaxF * ctx->Depth.Clear); + fxMesa->Depth.Clear = (FxU32) (ctx->DrawBuffer->_DepthMaxF * ctx->Depth.Clear); if ( fxMesa->Depth.Bias != bias ) { fxMesa->Depth.Bias = bias; @@ -1034,15 +1034,15 @@ static void tdfxDDDrawBuffer( GLcontext *ctx, GLenum mode ) FLUSH_BATCH( fxMesa ); /* - * _DrawDestMask is easier to cope with than . + * _ColorDrawBufferMask is easier to cope with than . */ - switch ( ctx->Color._DrawDestMask[0] ) { - case DD_FRONT_LEFT_BIT: + switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) { + case BUFFER_BIT_FRONT_LEFT: fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_FRONTBUFFER; fxMesa->new_state |= TDFX_NEW_RENDER; FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE ); break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_BACKBUFFER; fxMesa->new_state |= TDFX_NEW_RENDER; FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE ); diff --git a/src/mesa/drivers/dri/trident/trident_context.c b/src/mesa/drivers/dri/trident/trident_context.c index cbf2d1df562..744f384c623 100644 --- a/src/mesa/drivers/dri/trident/trident_context.c +++ b/src/mesa/drivers/dri/trident/trident_context.c @@ -39,11 +39,14 @@ #include "simple_list.h" #include "matrix.h" #include "extensions.h" +#include "framebuffer.h" +#include "renderbuffer.h" #if defined(USE_X86_ASM) #include "x86/common_x86_asm.h" #endif #include "simple_list.h" #include "mm.h" +#include "drirenderbuffer.h" #include "drivers/common/driverfuncs.h" #include "dri_util.h" @@ -197,10 +200,13 @@ tridentCreateBuffer( __DRIscreenPrivate *driScrnPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) { + tridentScreenPtr screen = (tridentScreenPtr) driScrnPriv->private; + if (isPixmap) { return GL_FALSE; /* not implemented */ } else { +#if 0 driDrawPriv->driverPrivate = (void *) _mesa_create_framebuffer(mesaVis, GL_FALSE, /* software depth buffer? */ @@ -208,6 +214,66 @@ tridentCreateBuffer( __DRIscreenPrivate *driScrnPriv, mesaVis->accumRedBits > 0, mesaVis->alphaBits > 0 ); +#else + struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); + + { + driRenderbuffer *frontRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->frontOffset, screen->frontPitch); + /* + tridentSetSpanFunctions(frontRb, mesaVis); + */ + _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); + } + + if (mesaVis->doubleBufferMode) { + driRenderbuffer *backRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->backOffset, screen->backPitch); + /* + tridentSetSpanFunctions(backRb, mesaVis); + */ + _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + } + + if (mesaVis->depthBits == 16) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp, + screen->depthOffset, screen->depthPitch); + /* + tridentSetSpanFunctions(depthRb, mesaVis); + */ + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else if (mesaVis->depthBits == 24) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp, + screen->depthOffset, screen->depthPitch); + /* + tridentSetSpanFunctions(depthRb, mesaVis); + */ + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + + /* no h/w stencil? + if (mesaVis->stencilBits > 0 && !swStencil) { + driRenderbuffer *stencilRb + = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT); + tridentSetSpanFunctions(stencilRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); + } + */ + + _mesa_add_soft_renderbuffers(fb, + GL_FALSE, /* color */ + GL_FALSE, /* depth */ + mesaVis->stencilBits > 0, + mesaVis->accumRedBits > 0, + GL_FALSE, /* alpha */ + GL_FALSE /* aux */); + driDrawPriv->driverPrivate = (void *) fb; +#endif return (driDrawPriv->driverPrivate != NULL); } } @@ -265,16 +331,16 @@ tridentMakeCurrent(__DRIcontextPrivate *driContextPriv, newCtx->drawOffset = newCtx->tridentScreen->backOffset; newCtx->drawPitch = newCtx->tridentScreen->backPitch; - _mesa_make_current2( newCtx->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); + _mesa_make_current( newCtx->glCtx, + (GLframebuffer *) driDrawPriv->driverPrivate, + (GLframebuffer *) driReadPriv->driverPrivate ); if (!newCtx->glCtx->Viewport.Width) { _mesa_set_viewport(newCtx->glCtx, 0, 0, driDrawPriv->w, driDrawPriv->h); } } else { - _mesa_make_current( 0, 0 ); + _mesa_make_current( NULL, NULL, NULL ); } return GL_TRUE; } diff --git a/src/mesa/drivers/dri/trident/trident_context.h b/src/mesa/drivers/dri/trident/trident_context.h index 74a3acb2ce1..7ebb5f2049b 100644 --- a/src/mesa/drivers/dri/trident/trident_context.h +++ b/src/mesa/drivers/dri/trident/trident_context.h @@ -117,6 +117,16 @@ typedef struct { tridentRegionRec mmio; } tridentScreenRec, *tridentScreenPtr; +/** + * tridentRenderbuffer, derived from Mesa's gl_renderbuffer + */ +typedef struct { + struct gl_renderbuffer Base; + /* XXX per-window info should go here */ + int foo, bar; +} tridentRenderbuffer; + + struct trident_context { GLcontext *glCtx; /* Mesa context */ diff --git a/src/mesa/drivers/dri/trident/trident_dd.c b/src/mesa/drivers/dri/trident/trident_dd.c index 390e6d8e414..8c3af200166 100644 --- a/src/mesa/drivers/dri/trident/trident_dd.c +++ b/src/mesa/drivers/dri/trident/trident_dd.c @@ -32,6 +32,7 @@ #include "swrast/swrast.h" #include "context.h" +#include "framebuffer.h" #define TRIDENT_DATE "20041223" @@ -115,7 +116,7 @@ void tridentDDInitDriverFuncs( GLcontext *ctx ) ctx->Driver.CopyPixels = _swrast_CopyPixels; ctx->Driver.DrawPixels = _swrast_DrawPixels; ctx->Driver.ReadPixels = _swrast_ReadPixels; - ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; + ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer; /* Swrast hooks for imaging extensions: */ diff --git a/src/mesa/drivers/dri/trident/trident_state.c b/src/mesa/drivers/dri/trident/trident_state.c index 2b9323f9912..76b2a8ef3c9 100644 --- a/src/mesa/drivers/dri/trident/trident_state.c +++ b/src/mesa/drivers/dri/trident/trident_state.c @@ -30,6 +30,7 @@ #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" +#include "framebuffer.h" #define TRIDENTPACKCOLOR332(r, g, b) \ (((r) & 0xe0) | (((g) & 0xe0) >> 3) | (((b) & 0xc0) >> 6)) @@ -165,19 +166,19 @@ static void tridentDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all, if ( tmesa->new_state ) tridentDDUpdateHWState( ctx ); - if ( mask & DD_FRONT_LEFT_BIT ) { + if ( mask & BUFFER_BIT_FRONT_LEFT ) { flags |= DRM_TRIDENT_FRONT; - mask &= ~DD_FRONT_LEFT_BIT; + mask &= ~BUFFER_BIT_FRONT_LEFT; } - if ( mask & DD_BACK_LEFT_BIT ) { + if ( mask & BUFFER_BIT_BACK_LEFT ) { flags |= DRM_TRIDENT_BACK; - mask &= ~DD_BACK_LEFT_BIT; + mask &= ~BUFFER_BIT_BACK_LEFT; } - if ( ( mask & DD_DEPTH_BIT ) && ctx->Depth.Mask ) { + if ( ( mask & BUFFER_BIT_DEPTH ) && ctx->Depth.Mask ) { flags |= DRM_TRIDENT_DEPTH; - mask &= ~DD_DEPTH_BIT; + mask &= ~BUFFER_BIT_DEPTH; } LOCK_HARDWARE(tmesa); @@ -543,7 +544,7 @@ void tridentDDInitStateFuncs( GLcontext *ctx ) ctx->Driver.CopyPixels = _swrast_CopyPixels; ctx->Driver.DrawPixels = _swrast_DrawPixels; ctx->Driver.ReadPixels = _swrast_ReadPixels; - ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; + ctx->Driver.ResizeBuffers = _mesa_resize_framebuffer; /* Swrast hooks for imaging extensions: */ diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c index 6d115025049..8bbcaccf692 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.c +++ b/src/mesa/drivers/dri/unichrome/via_context.c @@ -36,6 +36,7 @@ #include "state.h" #include "simple_list.h" #include "extensions.h" +#include "framebuffer.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -220,12 +221,17 @@ calculate_buffer_parameters( struct via_context *vmesa ) } -void viaReAllocateBuffers(GLframebuffer *drawbuffer) +void viaReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer, + GLuint width, GLuint height) { - GET_CURRENT_CONTEXT(ctx); struct via_context *vmesa = VIA_CONTEXT(ctx); +#if 0 _swrast_alloc_buffers( drawbuffer ); +#else + _mesa_resize_framebuffer(ctx, drawbuffer, width, height); +#endif + calculate_buffer_parameters( vmesa ); } @@ -581,7 +587,7 @@ viaDestroyContext(__DRIcontextPrivate *driContextPriv) /* check if we're deleting the currently bound context */ if (vmesa == current) { VIA_FLUSH_DMA(vmesa); - _mesa_make_current2(NULL, NULL, NULL); + _mesa_make_current(NULL, NULL, NULL); } if (vmesa) { @@ -622,8 +628,8 @@ void viaXMesaWindowMoved(struct via_context *vmesa) if (!dPriv) return; - switch (vmesa->glCtx->Color._DrawDestMask[0]) { - case DD_FRONT_LEFT_BIT: + switch (vmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) { + case BUFFER_BIT_FRONT_LEFT: if (dPriv->numBackClipRects == 0) { vmesa->numClipRects = dPriv->numClipRects; vmesa->pClipRects = dPriv->pClipRects; @@ -633,7 +639,7 @@ void viaXMesaWindowMoved(struct via_context *vmesa) vmesa->pClipRects = dPriv->pBackClipRects; } break; - case DD_BACK_LEFT_BIT: + case BUFFER_BIT_BACK_LEFT: vmesa->numClipRects = dPriv->numClipRects; vmesa->pClipRects = dPriv->pClipRects; break; @@ -700,9 +706,9 @@ viaMakeCurrent(__DRIcontextPrivate *driContextPriv, ctx->Driver.DrawBuffer( ctx, ctx->Color.DrawBuffer[0] ); } - _mesa_make_current2(vmesa->glCtx, - (GLframebuffer *)driDrawPriv->driverPrivate, - (GLframebuffer *)driReadPriv->driverPrivate); + _mesa_make_current(vmesa->glCtx, + (GLframebuffer *)driDrawPriv->driverPrivate, + (GLframebuffer *)driReadPriv->driverPrivate); viaXMesaWindowMoved(vmesa); ctx->Driver.Scissor(vmesa->glCtx, @@ -712,7 +718,7 @@ viaMakeCurrent(__DRIcontextPrivate *driContextPriv, vmesa->glCtx->Scissor.Height); } else { - _mesa_make_current(0,0); + _mesa_make_current(NULL, NULL, NULL); } return GL_TRUE; diff --git a/src/mesa/drivers/dri/unichrome/via_context.h b/src/mesa/drivers/dri/unichrome/via_context.h index 9db382d49cd..c1de1df8a95 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.h +++ b/src/mesa/drivers/dri/unichrome/via_context.h @@ -386,7 +386,7 @@ extern void viaEmitHwStateLocked(struct via_context *vmesa); extern void viaEmitScissorValues(struct via_context *vmesa, int box_nr, int emit); extern void viaXMesaSetBackClipRects(struct via_context *vmesa); extern void viaXMesaSetFrontClipRects(struct via_context *vmesa); -extern void viaReAllocateBuffers(GLframebuffer *drawbuffer); +extern void viaReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer, GLuint width, GLuint height); extern void viaXMesaWindowMoved(struct via_context *vmesa); extern GLboolean viaTexCombineState(struct via_context *vmesa, diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.c b/src/mesa/drivers/dri/unichrome/via_ioctl.c index b9997be1efb..651c5f6e315 100644 --- a/src/mesa/drivers/dri/unichrome/via_ioctl.c +++ b/src/mesa/drivers/dri/unichrome/via_ioctl.c @@ -214,31 +214,31 @@ static void viaClear(GLcontext *ctx, GLbitfield mask, GLboolean all, VIA_FLUSH_DMA(vmesa); - if (mask & DD_FRONT_LEFT_BIT) { + if (mask & BUFFER_BIT_FRONT_LEFT) { flag |= VIA_FRONT; - mask &= ~DD_FRONT_LEFT_BIT; + mask &= ~BUFFER_BIT_FRONT_LEFT; } - if (mask & DD_BACK_LEFT_BIT) { + if (mask & BUFFER_BIT_BACK_LEFT) { flag |= VIA_BACK; - mask &= ~DD_BACK_LEFT_BIT; + mask &= ~BUFFER_BIT_BACK_LEFT; } - if (mask & DD_DEPTH_BIT) { + if (mask & BUFFER_BIT_DEPTH) { flag |= VIA_DEPTH; clear_depth = (GLuint)(ctx->Depth.Clear * vmesa->ClearDepth); clear_depth_mask &= ~vmesa->depth_clear_mask; - mask &= ~DD_DEPTH_BIT; + mask &= ~BUFFER_BIT_DEPTH; } - if (mask & DD_STENCIL_BIT) { + if (mask & BUFFER_BIT_STENCIL) { if (vmesa->have_hw_stencil) { if (ctx->Stencil.WriteMask[0] == 0xff) { flag |= VIA_DEPTH; clear_depth &= ~0xff; clear_depth |= (ctx->Stencil.Clear & 0xff); clear_depth_mask &= ~vmesa->stencil_clear_mask; - mask &= ~DD_STENCIL_BIT; + mask &= ~BUFFER_BIT_STENCIL; } else { if (VIA_DEBUG & DEBUG_2D) @@ -252,9 +252,9 @@ static void viaClear(GLcontext *ctx, GLbitfield mask, GLboolean all, if (vmesa->viaScreen->bytesPerPixel == 2 && vmesa->ClearMask & 0xf0000000) { if (flag & VIA_FRONT) - mask |= DD_FRONT_LEFT_BIT; + mask |= BUFFER_BIT_FRONT_LEFT; if (flag & VIA_BACK) - mask |= DD_BACK_LEFT_BIT; + mask |= BUFFER_BIT_BACK_LEFT; flag &= ~(VIA_FRONT | VIA_BACK); } diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index dbe7a38c3d3..e302011665e 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -28,6 +28,8 @@ #include "dri_util.h" #include "glheader.h" #include "context.h" +#include "framebuffer.h" +#include "renderbuffer.h" #include "matrix.h" #include "simple_list.h" #include "vblank.h" @@ -212,12 +214,15 @@ viaDestroyScreen(__DRIscreenPrivate *sPriv) sPriv->private = NULL; } + static GLboolean viaCreateBuffer(__DRIscreenPrivate *driScrnPriv, __DRIdrawablePrivate *driDrawPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap) { + viaScreenPrivate *screen = (viaScreenPrivate *) driScrnPriv->private; + GLboolean swStencil = (mesaVis->stencilBits > 0 && mesaVis->depthBits != 24); @@ -238,13 +243,74 @@ viaCreateBuffer(__DRIscreenPrivate *driScrnPriv, return GL_FALSE; } else { +#if 0 driDrawPriv->driverPrivate = (void *) _mesa_create_framebuffer(mesaVis, GL_FALSE, /* software depth buffer? */ swStencil, mesaVis->accumRedBits > 0, GL_FALSE /* s/w alpha planes */); - +#else + struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); + + /* XXX check/fix the offset/pitch parameters! */ + { + driRenderbuffer *frontRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + 0, screen->width); + viaSetSpanFunctions(frontRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); + } + + if (mesaVis->doubleBufferMode) { + driRenderbuffer *backRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + 0, screen->width); + viaSetSpanFunctions(backRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + } + + if (mesaVis->depthBits == 16) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp, + 0, screen->width); + viaSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else if (mesaVis->depthBits == 24) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT24, screen->cpp, + 0, screen->width); + viaSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + else if (mesaVis->depthBits == 32) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT32, screen->cpp, + 0, screen->width); + viaSetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + + /* no h/w stencil? + if (mesaVis->stencilBits > 0 && !swStencil) { + driRenderbuffer *stencilRb + = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp, + screen->depthOffset, screen->depthPitch); + viaSetSpanFunctions(stencilRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); + } + */ + + _mesa_add_soft_renderbuffers(fb, + GL_FALSE, /* color */ + GL_FALSE, /* depth */ + swStencil, + mesaVis->accumRedBits > 0, + GL_FALSE, /* alpha */ + GL_FALSE /* aux */); + driDrawPriv->driverPrivate = (void *) fb; +#endif return (driDrawPriv->driverPrivate != NULL); } } diff --git a/src/mesa/drivers/dri/unichrome/via_screen.h b/src/mesa/drivers/dri/unichrome/via_screen.h index 01613eac211..8239960a632 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.h +++ b/src/mesa/drivers/dri/unichrome/via_screen.h @@ -72,6 +72,7 @@ typedef struct { driOptionCache optionCache; } viaScreenPrivate; + extern GLboolean viaCreateContext(const __GLcontextModes *mesaVis, __DRIcontextPrivate *driContextPriv, diff --git a/src/mesa/drivers/dri/unichrome/via_span.c b/src/mesa/drivers/dri/unichrome/via_span.c index e5e25f08c1c..0fbac9b506a 100644 --- a/src/mesa/drivers/dri/unichrome/via_span.c +++ b/src/mesa/drivers/dri/unichrome/via_span.c @@ -178,10 +178,10 @@ static void viaSetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, { struct via_context *vmesa = VIA_CONTEXT(ctx); - if (bufferBit == DD_FRONT_LEFT_BIT) { + if (bufferBit == BUFFER_BIT_FRONT_LEFT) { vmesa->drawBuffer = vmesa->readBuffer = &vmesa->front; } - else if (bufferBit == DD_BACK_LEFT_BIT) { + else if (bufferBit == BUFFER_BIT_BACK_LEFT) { vmesa->drawBuffer = vmesa->readBuffer = &vmesa->back; } else { @@ -207,10 +207,13 @@ void viaSpanRenderFinish( GLcontext *ctx ) void viaInitSpanFuncs(GLcontext *ctx) { +#if 0 struct via_context *vmesa = VIA_CONTEXT(ctx); +#endif struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); swdd->SetBuffer = viaSetBuffer; +#if 0 if (vmesa->viaScreen->bitsPerPixel == 16) { viaInitPointers_565( swdd ); } @@ -220,7 +223,8 @@ void viaInitSpanFuncs(GLcontext *ctx) else { assert(0); } - +#endif +#if 0 if (vmesa->glCtx->Visual.depthBits == 16) { swdd->ReadDepthSpan = viaReadDepthSpan_16; swdd->WriteDepthSpan = viaWriteDepthSpan_16; @@ -247,11 +251,12 @@ void viaInitSpanFuncs(GLcontext *ctx) swdd->ReadDepthPixels = viaReadDepthPixels_32; swdd->WriteDepthPixels = viaWriteDepthPixels_32; } +#endif swdd->SpanRenderStart = viaSpanRenderStart; swdd->SpanRenderFinish = viaSpanRenderFinish; - +#if 0 swdd->WriteCI8Span = NULL; swdd->WriteCI32Span = NULL; swdd->WriteMonoCISpan = NULL; @@ -259,4 +264,55 @@ void viaInitSpanFuncs(GLcontext *ctx) swdd->WriteMonoCIPixels = NULL; swdd->ReadCI32Span = NULL; swdd->ReadCI32Pixels = NULL; +#endif +} + + + +/** + * Plug in the Get/Put routines for the given driRenderbuffer. + */ +void +viaSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) +{ + if (drb->Base.InternalFormat == GL_RGBA) { + if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { + viaInitPointers_565(&drb->Base); + } + else { + viaInitPointers_8888(&drb->Base); + } + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + drb->Base.GetRow = viaReadDepthSpan_16; + drb->Base.GetValues = viaReadDepthPixels_16; + drb->Base.PutRow = viaWriteDepthSpan_16; + drb->Base.PutMonoRow = viaWriteMonoDepthSpan_16; + drb->Base.PutValues = viaWriteDepthPixels_16; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + drb->Base.GetRow = viaReadDepthSpan_24_8; + drb->Base.GetValues = viaReadDepthPixels_24_8; + drb->Base.PutRow = viaWriteDepthSpan_24_8; + drb->Base.PutMonoRow = viaWriteMonoDepthSpan_24_8; + drb->Base.PutValues = viaWriteDepthPixels_24_8; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT32) { + drb->Base.GetRow = viaReadDepthSpan_32; + drb->Base.GetValues = viaReadDepthPixels_32; + drb->Base.PutRow = viaWriteDepthSpan_32; + drb->Base.PutMonoRow = viaWriteMonoDepthSpan_32; + drb->Base.PutValues = viaWriteDepthPixels_32; + drb->Base.PutMonoValues = NULL; + } + else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + drb->Base.GetRow = viaReadStencilSpan_24_8; + drb->Base.GetValues = viaReadStencilPixels_24_8; + drb->Base.PutRow = viaWriteStencilSpan_24_8; + drb->Base.PutMonoRow = viaWriteMonoStencilSpan_24_8; + drb->Base.PutValues = viaWriteStencilPixels_24_8; + drb->Base.PutMonoValues = NULL; + } } diff --git a/src/mesa/drivers/dri/unichrome/via_span.h b/src/mesa/drivers/dri/unichrome/via_span.h index 71b3f82c03a..c3bd24b0e78 100644 --- a/src/mesa/drivers/dri/unichrome/via_span.h +++ b/src/mesa/drivers/dri/unichrome/via_span.h @@ -25,8 +25,13 @@ #ifndef _VIA_SPAN_H #define _VIA_SPAN_H +#include "drirenderbuffer.h" + extern void viaInitSpanFuncs(GLcontext *ctx); extern void viaSpanRenderStart( GLcontext *ctx ); extern void viaSpanRenderFinish( GLcontext *ctx ); +extern void +viaSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); + #endif diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index 4068216d448..c8d9375b624 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -46,7 +46,10 @@ #include "buffers.h" #include "context.h" #include "extensions.h" +#include "fbobject.h" +#include "framebuffer.h" #include "imports.h" +#include "renderbuffer.h" #include "texformat.h" #include "teximage.h" #include "texstore.h" @@ -84,15 +87,8 @@ struct GLFBDevBufferRec { GLFBDevVisualPtr visual; struct fb_fix_screeninfo fix; struct fb_var_screeninfo var; - void *frontStart; - void *backStart; - size_t size; + size_t size; /* color buffer size in bytes */ GLuint bytesPerPixel; - GLuint rowStride; /* in bytes */ - GLubyte *frontBottom; /* pointer to last row */ - GLubyte *backBottom; /* pointer to last row */ - GLubyte *curBottom; /* = frontBottom or backBottom */ - GLboolean mallocBackBuffer; }; /* @@ -106,6 +102,16 @@ struct GLFBDevContextRec { GLFBDevBufferPtr curBuffer; }; +/* + * Derived from Mesa's gl_renderbuffer class. + */ +struct GLFBDevRenderbufferRec { + struct gl_renderbuffer Base; + GLubyte *bottom; /* pointer to last row */ + GLuint rowStride; /* in bytes */ + GLboolean mallocedBuffer; +}; + #define GLFBDEV_CONTEXT(CTX) ((GLFBDevContextPtr) (CTX)) @@ -144,7 +150,7 @@ update_state( GLcontext *ctx, GLuint new_state ) static void get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) { - const GLFBDevBufferPtr fbdevbuffer = (GLFBDevBufferPtr) buffer; + const GLFBDevBufferPtr fbdevbuffer = GLFBDEV_BUFFER(buffer); *width = fbdevbuffer->var.xres_virtual; *height = fbdevbuffer->var.yres_virtual; } @@ -162,19 +168,7 @@ viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) static void set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit ) { - GLFBDevContextPtr fbdevctx = GLFBDEV_CONTEXT(ctx); - GLFBDevBufferPtr fbdevbuf = GLFBDEV_BUFFER(buffer); - fbdevctx->curBuffer = fbdevbuf; - switch (bufferBit) { - case DD_FRONT_LEFT_BIT: - fbdevbuf->curBottom = fbdevbuf->frontBottom; - break; - case DD_BACK_LEFT_BIT: - fbdevbuf->curBottom = fbdevbuf->backBottom; - break; - default: - _mesa_problem(ctx, "bad bufferBit in set_buffer()"); - } + /* this is a no-op when using the new gl_renderbuffer span functions. */ } @@ -184,96 +178,102 @@ set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit ) /* 24-bit BGR */ #define NAME(PREFIX) PREFIX##_B8G8R8 +#define FORMAT GL_RGBA8 #define SPAN_VARS \ - const GLFBDevContextPtr fbdevctx = GLFBDEV_CONTEXT(ctx); \ - const GLFBDevBufferPtr fbdevbuf = fbdevctx->curBuffer; + struct GLFBDevRenderbufferRec *frb = (struct GLFBDevRenderbufferRec *) rb; #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = fbdevbuf->curBottom - (Y) * fbdevbuf->rowStride + (X) * 3 + GLubyte *P = frb->bottom - (Y) * frb->rowStride + (X) * 3 #define INC_PIXEL_PTR(P) P += 3 -#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ - P[0] = B; P[1] = G; P[2] = R -#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ - P[0] = B; P[1] = G; P[2] = R -#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ - R = P[2]; G = P[1]; B = P[0]; A = CHAN_MAX +#define STORE_PIXEL(DST, X, Y, VALUE) \ + DST[0] = VALUE[BCOMP]; \ + DST[1] = VALUE[GCOMP]; \ + DST[2] = VALUE[RCOMP] +#define FETCH_PIXEL(DST, SRC) \ + DST[RCOMP] = SRC[2]; \ + DST[GCOMP] = SRC[1]; \ + DST[BCOMP] = SRC[0]; \ + DST[ACOMP] = CHAN_MAX -#include "swrast/s_spantemp.h" +#include "swrast/s_spantemp2.h" /* 32-bit BGRA */ #define NAME(PREFIX) PREFIX##_B8G8R8A8 +#define FORMAT GL_RGBA8 #define SPAN_VARS \ - const GLFBDevContextPtr fbdevctx = GLFBDEV_CONTEXT(ctx); \ - const GLFBDevBufferPtr fbdevbuf = fbdevctx->curBuffer; + struct GLFBDevRenderbufferRec *frb = (struct GLFBDevRenderbufferRec *) rb; #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = fbdevbuf->curBottom - (Y) * fbdevbuf->rowStride + (X) * 4 + GLubyte *P = frb->bottom - (Y) * frb->rowStride + (X) * 4 #define INC_PIXEL_PTR(P) P += 4 -#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ - P[0] = B; P[1] = G; P[2] = R; P[3] = 255 -#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ - P[0] = B; P[1] = G; P[2] = R; P[3] = A -#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ - R = P[2]; G = P[1]; B = P[0]; A = P[3] +#define STORE_PIXEL(DST, X, Y, VALUE) \ + DST[0] = VALUE[BCOMP]; \ + DST[1] = VALUE[GCOMP]; \ + DST[2] = VALUE[RCOMP]; \ + DST[3] = VALUE[ACOMP] +#define FETCH_PIXEL(DST, SRC) \ + DST[RCOMP] = SRC[2]; \ + DST[GCOMP] = SRC[1]; \ + DST[BCOMP] = SRC[0]; \ + DST[ACOMP] = SRC[3] -#include "swrast/s_spantemp.h" +#include "swrast/s_spantemp2.h" /* 16-bit BGR (XXX implement dithering someday) */ #define NAME(PREFIX) PREFIX##_B5G6R5 +#define FORMAT GL_RGBA8 #define SPAN_VARS \ - const GLFBDevContextPtr fbdevctx = GLFBDEV_CONTEXT(ctx); \ - const GLFBDevBufferPtr fbdevbuf = fbdevctx->curBuffer; + struct GLFBDevRenderbufferRec *frb = (struct GLFBDevRenderbufferRec *) rb; #define INIT_PIXEL_PTR(P, X, Y) \ - GLushort *P = (GLushort *) (fbdevbuf->curBottom - (Y) * fbdevbuf->rowStride + (X) * 2) + GLushort *P = (GLushort *) (frb->bottom - (Y) * frb->rowStride + (X) * 2) #define INC_PIXEL_PTR(P) P += 1 -#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ - *P = ( (((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | ((B) >> 3) ) -#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ - *P = ( (((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | ((B) >> 3) ) -#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ - R = ( (((*P) >> 8) & 0xf8) | (((*P) >> 11) & 0x7) ); \ - G = ( (((*P) >> 3) & 0xfc) | (((*P) >> 5) & 0x3) ); \ - B = ( (((*P) << 3) & 0xf8) | (((*P) ) & 0x7) ); \ - A = CHAN_MAX +#define STORE_PIXEL(DST, X, Y, VALUE) \ + DST[0] = ( (((VALUE[RCOMP]) & 0xf8) << 8) | (((VALUE[GCOMP]) & 0xfc) << 3) | ((VALUE[BCOMP]) >> 3) ) +#define FETCH_PIXEL(DST, SRC) \ + DST[RCOMP] = ( (((SRC[0]) >> 8) & 0xf8) | (((SRC[0]) >> 11) & 0x7) ); \ + DST[GCOMP] = ( (((SRC[0]) >> 3) & 0xfc) | (((SRC[0]) >> 5) & 0x3) ); \ + DST[BCOMP] = ( (((SRC[0]) << 3) & 0xf8) | (((SRC[0]) ) & 0x7) ); \ + DST[ACOMP] = CHAN_MAX -#include "swrast/s_spantemp.h" +#include "swrast/s_spantemp2.h" /* 15-bit BGR (XXX implement dithering someday) */ #define NAME(PREFIX) PREFIX##_B5G5R5 +#define FORMAT GL_RGBA8 #define SPAN_VARS \ - const GLFBDevContextPtr fbdevctx = GLFBDEV_CONTEXT(ctx); \ - const GLFBDevBufferPtr fbdevbuf = fbdevctx->curBuffer; + struct GLFBDevRenderbufferRec *frb = (struct GLFBDevRenderbufferRec *) rb; #define INIT_PIXEL_PTR(P, X, Y) \ - GLushort *P = (GLushort *) (fbdevbuf->curBottom - (Y) * fbdevbuf->rowStride + (X) * 2) + GLushort *P = (GLushort *) (frb->bottom - (Y) * frb->rowStride + (X) * 2) #define INC_PIXEL_PTR(P) P += 1 -#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ - *P = ( (((R) & 0xf8) << 7) | (((G) & 0xf8) << 2) | ((B) >> 3) ) -#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ - *P = ( (((R) & 0xf8) << 7) | (((G) & 0xf8) << 2) | ((B) >> 3) ) -#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ - R = ( (((*P) >> 7) & 0xf8) | (((*P) >> 10) & 0x7) ); \ - G = ( (((*P) >> 2) & 0xf8) | (((*P) >> 5) & 0x7) ); \ - B = ( (((*P) << 3) & 0xf8) | (((*P) ) & 0x7) ); \ - A = CHAN_MAX +#define STORE_PIXEL(DST, X, Y, VALUE) \ + DST[0] = ( (((VALUE[RCOMP]) & 0xf8) << 7) | (((VALUE[GCOMP]) & 0xf8) << 2) | ((VALUE[BCOMP]) >> 3) ) +#define FETCH_PIXEL(DST, SRC) \ + DST[RCOMP] = ( (((SRC[0]) >> 7) & 0xf8) | (((SRC[0]) >> 10) & 0x7) ); \ + DST[GCOMP] = ( (((SRC[0]) >> 2) & 0xf8) | (((SRC[0]) >> 5) & 0x7) ); \ + DST[BCOMP] = ( (((SRC[0]) << 3) & 0xf8) | (((SRC[0]) ) & 0x7) ); \ + DST[ACOMP] = CHAN_MAX -#include "swrast/s_spantemp.h" +#include "swrast/s_spantemp2.h" /* 8-bit color index */ #define NAME(PREFIX) PREFIX##_CI8 +#define FORMAT GL_COLOR_INDEX8_EXT #define SPAN_VARS \ - const GLFBDevContextPtr fbdevctx = GLFBDEV_CONTEXT(ctx); \ - const GLFBDevBufferPtr fbdevbuf = fbdevctx->curBuffer; + struct GLFBDevRenderbufferRec *frb = (struct GLFBDevRenderbufferRec *) rb; #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = fbdevbuf->curBottom - (Y) * fbdevbuf->rowStride + (X) + GLubyte *P = frb->bottom - (Y) * frb->rowStride + (X) #define INC_PIXEL_PTR(P) P += 1 -#define STORE_CI_PIXEL(P, CI) \ - P[0] = CI -#define FETCH_CI_PIXEL(CI, P) \ - CI = P[0] +#define STORE_PIXEL(DST, X, Y, VALUE) \ + *DST = VALUE[0] +#define FETCH_PIXEL(DST, SRC) \ + DST = SRC[0] + +#include "swrast/s_spantemp2.h" + + -#include "swrast/s_spantemp.h" /**********************************************************************/ /* Public API functions */ @@ -294,30 +294,30 @@ glFBDevGetString( int str ) } -const void * +const GLFBDevProc glFBDevGetProcAddress( const char *procName ) { struct name_address { const char *name; - const void *func; + const GLFBDevProc func; }; static const struct name_address functions[] = { - { "glFBDevGetString", (void *) glFBDevGetString }, - { "glFBDevGetProcAddress", (void *) glFBDevGetProcAddress }, - { "glFBDevCreateVisual", (void *) glFBDevCreateVisual }, - { "glFBDevDestroyVisual", (void *) glFBDevDestroyVisual }, - { "glFBDevGetVisualAttrib", (void *) glFBDevGetVisualAttrib }, - { "glFBDevCreateBuffer", (void *) glFBDevCreateBuffer }, - { "glFBDevDestroyBuffer", (void *) glFBDevDestroyBuffer }, - { "glFBDevGetBufferAttrib", (void *) glFBDevGetBufferAttrib }, - { "glFBDevGetCurrentDrawBuffer", (void *) glFBDevGetCurrentDrawBuffer }, - { "glFBDevGetCurrentReadBuffer", (void *) glFBDevGetCurrentReadBuffer }, - { "glFBDevSwapBuffers", (void *) glFBDevSwapBuffers }, - { "glFBDevCreateContext", (void *) glFBDevCreateContext }, - { "glFBDevDestroyContext", (void *) glFBDevDestroyContext }, - { "glFBDevGetContextAttrib", (void *) glFBDevGetContextAttrib }, - { "glFBDevGetCurrentContext", (void *) glFBDevGetCurrentContext }, - { "glFBDevMakeCurrent", (void *) glFBDevMakeCurrent }, + { "glFBDevGetString", (GLFBDevProc) glFBDevGetString }, + { "glFBDevGetProcAddress", (GLFBDevProc) glFBDevGetProcAddress }, + { "glFBDevCreateVisual", (GLFBDevProc) glFBDevCreateVisual }, + { "glFBDevDestroyVisual", (GLFBDevProc) glFBDevDestroyVisual }, + { "glFBDevGetVisualAttrib", (GLFBDevProc) glFBDevGetVisualAttrib }, + { "glFBDevCreateBuffer", (GLFBDevProc) glFBDevCreateBuffer }, + { "glFBDevDestroyBuffer", (GLFBDevProc) glFBDevDestroyBuffer }, + { "glFBDevGetBufferAttrib", (GLFBDevProc) glFBDevGetBufferAttrib }, + { "glFBDevGetCurrentDrawBuffer", (GLFBDevProc) glFBDevGetCurrentDrawBuffer }, + { "glFBDevGetCurrentReadBuffer", (GLFBDevProc) glFBDevGetCurrentReadBuffer }, + { "glFBDevSwapBuffers", (GLFBDevProc) glFBDevSwapBuffers }, + { "glFBDevCreateContext", (GLFBDevProc) glFBDevCreateContext }, + { "glFBDevDestroyContext", (GLFBDevProc) glFBDevDestroyContext }, + { "glFBDevGetContextAttrib", (GLFBDevProc) glFBDevGetContextAttrib }, + { "glFBDevGetCurrentContext", (GLFBDevProc) glFBDevGetCurrentContext }, + { "glFBDevMakeCurrent", (GLFBDevProc) glFBDevMakeCurrent }, { NULL, NULL } }; const struct name_address *entry; @@ -326,7 +326,7 @@ glFBDevGetProcAddress( const char *procName ) return entry->func; } } - return (const void *)_glapi_get_proc_address(procName); + return _glapi_get_proc_address(procName); } @@ -477,12 +477,101 @@ glFBDevDestroyVisual( GLFBDevVisualPtr visual ) int glFBDevGetVisualAttrib( const GLFBDevVisualPtr visual, int attrib) { + /* XXX unfinished */ (void) visual; (void) attrib; return -1; } +static void +delete_renderbuffer(struct gl_renderbuffer *rb) +{ + struct GLFBDevRenderbufferRec *frb = (struct GLFBDevRenderbufferRec *) rb; + if (frb->mallocedBuffer) { + _mesa_free(frb->Base.Data); + } + _mesa_free(frb); +} + + +static GLboolean +renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, + GLenum internalFormat, GLuint width, GLuint height) +{ + /* no-op: the renderbuffer storage is allocated just once when it's + * created. Never resized or reallocated. + */ + return GL_TRUE; +} + + +static struct GLFBDevRenderbufferRec * +new_glfbdev_renderbuffer(void *bufferStart, int pixelFormat) +{ + struct GLFBDevRenderbufferRec *rb = CALLOC_STRUCT(GLFBDevRenderbufferRec); + if (rb) { + GLuint name = 0; + _mesa_init_renderbuffer(&rb->Base, name); + + rb->Base.Delete = delete_renderbuffer; + rb->Base.AllocStorage = renderbuffer_storage; + + if (pixelFormat == PF_B8G8R8) { + rb->Base.GetRow = get_row_B8G8R8; + rb->Base.GetValues = get_values_B8G8R8; + rb->Base.PutRow = put_row_B8G8R8; + rb->Base.PutMonoRow = put_mono_row_B8G8R8; + rb->Base.PutValues = put_values_B8G8R8; + rb->Base.PutMonoValues = put_mono_values_B8G8R8; + } + else if (pixelFormat == PF_B8G8R8A8) { + rb->Base.GetRow = get_row_B8G8R8A8; + rb->Base.GetValues = get_values_B8G8R8A8; + rb->Base.PutRow = put_row_B8G8R8A8; + rb->Base.PutMonoRow = put_mono_row_B8G8R8A8; + rb->Base.PutValues = put_values_B8G8R8A8; + rb->Base.PutMonoValues = put_mono_values_B8G8R8A8; + } + else if (pixelFormat == PF_B5G6R5) { + rb->Base.GetRow = get_row_B5G6R5; + rb->Base.GetValues = get_values_B5G6R5; + rb->Base.PutRow = put_row_B5G6R5; + rb->Base.PutMonoRow = put_mono_row_B5G6R5; + rb->Base.PutValues = put_values_B5G6R5; + rb->Base.PutMonoValues = put_mono_values_B5G6R5; + } + else if (pixelFormat == PF_B5G5R5) { + rb->Base.GetRow = get_row_B5G5R5; + rb->Base.GetValues = get_values_B5G5R5; + rb->Base.PutRow = put_row_B5G5R5; + rb->Base.PutMonoRow = put_mono_row_B5G5R5; + rb->Base.PutValues = put_values_B5G5R5; + rb->Base.PutMonoValues = put_mono_values_B5G5R5; + } + else if (pixelFormat == PF_CI8) { + rb->Base.GetRow = get_row_CI8; + rb->Base.GetValues = get_values_CI8; + rb->Base.PutRow = put_row_CI8; + rb->Base.PutMonoRow = put_mono_row_CI8; + rb->Base.PutValues = put_values_CI8; + rb->Base.PutMonoValues = put_mono_values_CI8; + } + + if (pixelFormat == PF_CI8) { + rb->Base.InternalFormat = GL_COLOR_INDEX8_EXT; + rb->Base._BaseFormat = GL_COLOR_INDEX; + } + else { + rb->Base.InternalFormat = GL_RGBA; + rb->Base._BaseFormat = GL_RGBA; + } + rb->Base.DataType = GL_UNSIGNED_BYTE; + rb->Base.Data = bufferStart; + } + return rb; +} + GLFBDevBufferPtr glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo, @@ -490,6 +579,7 @@ glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo, const GLFBDevVisualPtr visual, void *frontBuffer, void *backBuffer, size_t size ) { + struct GLFBDevRenderbufferRec *frontrb, *backrb; GLFBDevBufferPtr buf; ASSERT(visual); @@ -512,45 +602,56 @@ glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo, if (!buf) return NULL; - _mesa_initialize_framebuffer(&buf->glframebuffer, &visual->glvisual, + /* basic framebuffer setup */ + _mesa_initialize_framebuffer(&buf->glframebuffer, &visual->glvisual); + /* add front renderbuffer */ + frontrb = new_glfbdev_renderbuffer(frontBuffer, visual->pixelFormat); + _mesa_add_renderbuffer(&buf->glframebuffer, BUFFER_FRONT_LEFT, + &frontrb->Base); + /* add back renderbuffer */ + if (visual->glvisual.doubleBufferMode) { + backrb = new_glfbdev_renderbuffer(backBuffer, visual->pixelFormat); + _mesa_add_renderbuffer(&buf->glframebuffer, BUFFER_BACK_LEFT, + &backrb->Base); + } + /* add software renderbuffers */ + _mesa_add_soft_renderbuffers(&buf->glframebuffer, + GL_FALSE, /* color */ visual->glvisual.haveDepthBuffer, visual->glvisual.haveStencilBuffer, visual->glvisual.haveAccumBuffer, - GL_FALSE); + GL_FALSE, /* alpha */ + GL_FALSE /* aux bufs */); + + buf->fix = *fixInfo; /* struct assignment */ buf->var = *varInfo; /* struct assignment */ buf->visual = visual; /* ptr assignment */ - buf->frontStart = frontBuffer; buf->size = size; buf->bytesPerPixel = visual->var.bits_per_pixel / 8; - buf->rowStride = visual->var.xres_virtual * buf->bytesPerPixel; - buf->frontBottom = (GLubyte *) buf->frontStart - + (visual->var.yres_virtual - 1) * buf->rowStride; + frontrb->rowStride = visual->var.xres_virtual * buf->bytesPerPixel; + frontrb->bottom = (GLubyte *) frontrb->Base.Data + + (visual->var.yres_virtual - 1) * frontrb->rowStride; if (visual->glvisual.doubleBufferMode) { - if (backBuffer) { - buf->backStart = backBuffer; - buf->mallocBackBuffer = GL_FALSE; - } - else { - buf->backStart = _mesa_malloc(size); - if (!buf->backStart) { + if (!backBuffer) { + /* malloc a back buffer */ + backrb->Base.Data = _mesa_malloc(size); + if (!backrb->Base.Data) { _mesa_free_framebuffer_data(&buf->glframebuffer); _mesa_free(buf); return NULL; } - buf->mallocBackBuffer = GL_TRUE; + backrb->mallocedBuffer = GL_TRUE; } - buf->backBottom = (GLubyte *) buf->backStart - + (visual->var.yres_virtual - 1) * buf->rowStride; - buf->curBottom = buf->backBottom; + backrb->rowStride = frontrb->rowStride; + backrb->bottom = (GLubyte *) backrb->Base.Data + + (visual->var.yres_virtual - 1) * backrb->rowStride; } else { - buf->backStart = NULL; - buf->mallocBackBuffer = GL_FALSE; - buf->backBottom = NULL; - buf->curBottom = buf->frontBottom; + backrb->bottom = NULL; + backrb->rowStride = 0; } return buf; @@ -567,9 +668,6 @@ glFBDevDestroyBuffer( GLFBDevBufferPtr buffer ) if (buffer == curDraw || buffer == curRead) { glFBDevMakeCurrent( NULL, NULL, NULL); } - if (buffer->mallocBackBuffer) { - _mesa_free(buffer->backStart); - } /* free the software depth, stencil, accum buffers */ _mesa_free_framebuffer_data(&buffer->glframebuffer); _mesa_free(buffer); @@ -612,6 +710,10 @@ void glFBDevSwapBuffers( GLFBDevBufferPtr buffer ) { GLFBDevContextPtr fbdevctx = glFBDevGetCurrentContext(); + struct GLFBDevRenderbufferRec *frontrb = (struct GLFBDevRenderbufferRec *) + buffer->glframebuffer.Attachment[BUFFER_FRONT_LEFT].Renderbuffer; + struct GLFBDevRenderbufferRec *backrb = (struct GLFBDevRenderbufferRec *) + buffer->glframebuffer.Attachment[BUFFER_BACK_LEFT].Renderbuffer; if (!buffer || !buffer->visual->glvisual.doubleBufferMode) return; @@ -622,9 +724,9 @@ glFBDevSwapBuffers( GLFBDevBufferPtr buffer ) _mesa_notifySwapBuffers(&fbdevctx->glcontext); } - ASSERT(buffer->frontStart); - ASSERT(buffer->backStart); - _mesa_memcpy(buffer->frontStart, buffer->backStart, buffer->size); + ASSERT(frontrb->Base.Data); + ASSERT(backrb->Base.Data); + _mesa_memcpy(frontrb->Base.Data, backrb->Base.Data, buffer->size); } @@ -670,54 +772,15 @@ glFBDevCreateContext( const GLFBDevVisualPtr visual, GLFBDevContextPtr share ) struct swrast_device_driver *swdd; swdd = _swrast_GetDeviceDriverReference( glctx ); swdd->SetBuffer = set_buffer; - if (visual->pixelFormat == PF_B8G8R8) { - swdd->WriteRGBASpan = write_rgba_span_B8G8R8; - swdd->WriteRGBSpan = write_rgb_span_B8G8R8; - swdd->WriteMonoRGBASpan = write_monorgba_span_B8G8R8; - swdd->WriteRGBAPixels = write_rgba_pixels_B8G8R8; - swdd->WriteMonoRGBAPixels = write_monorgba_pixels_B8G8R8; - swdd->ReadRGBASpan = read_rgba_span_B8G8R8; - swdd->ReadRGBAPixels = read_rgba_pixels_B8G8R8; - } - else if (visual->pixelFormat == PF_B8G8R8A8) { - swdd->WriteRGBASpan = write_rgba_span_B8G8R8A8; - swdd->WriteRGBSpan = write_rgb_span_B8G8R8A8; - swdd->WriteMonoRGBASpan = write_monorgba_span_B8G8R8A8; - swdd->WriteRGBAPixels = write_rgba_pixels_B8G8R8A8; - swdd->WriteMonoRGBAPixels = write_monorgba_pixels_B8G8R8A8; - swdd->ReadRGBASpan = read_rgba_span_B8G8R8A8; - swdd->ReadRGBAPixels = read_rgba_pixels_B8G8R8A8; - } - else if (visual->pixelFormat == PF_B5G6R5) { - swdd->WriteRGBASpan = write_rgba_span_B5G6R5; - swdd->WriteRGBSpan = write_rgb_span_B5G6R5; - swdd->WriteMonoRGBASpan = write_monorgba_span_B5G6R5; - swdd->WriteRGBAPixels = write_rgba_pixels_B5G6R5; - swdd->WriteMonoRGBAPixels = write_monorgba_pixels_B5G6R5; - swdd->ReadRGBASpan = read_rgba_span_B5G6R5; - swdd->ReadRGBAPixels = read_rgba_pixels_B5G6R5; - } - else if (visual->pixelFormat == PF_B5G5R5) { - swdd->WriteRGBASpan = write_rgba_span_B5G5R5; - swdd->WriteRGBSpan = write_rgb_span_B5G5R5; - swdd->WriteMonoRGBASpan = write_monorgba_span_B5G5R5; - swdd->WriteRGBAPixels = write_rgba_pixels_B5G5R5; - swdd->WriteMonoRGBAPixels = write_monorgba_pixels_B5G5R5; - swdd->ReadRGBASpan = read_rgba_span_B5G5R5; - swdd->ReadRGBAPixels = read_rgba_pixels_B5G5R5; - } - else if (visual->pixelFormat == PF_CI8) { - swdd->WriteCI32Span = write_index32_span_CI8; - swdd->WriteCI8Span = write_index8_span_CI8; - swdd->WriteMonoCISpan = write_monoindex_span_CI8; - swdd->WriteCI32Pixels = write_index_pixels_CI8; - swdd->WriteMonoCIPixels = write_monoindex_pixels_CI8; - swdd->ReadCI32Span = read_index_span_CI8; - swdd->ReadCI32Pixels = read_index_pixels_CI8; - } - else { - _mesa_printf("bad pixelformat: %d\n", visual->pixelFormat); - } + + /* no longer used */ + swdd->WriteRGBASpan = NULL; + swdd->WriteRGBSpan = NULL; + swdd->WriteMonoRGBASpan = NULL; + swdd->WriteRGBAPixels = NULL; + swdd->WriteMonoRGBAPixels = NULL; + swdd->ReadRGBASpan = NULL; + swdd->ReadRGBAPixels = NULL; } /* use default TCL pipeline */ @@ -740,7 +803,7 @@ glFBDevDestroyContext( GLFBDevContextPtr context ) if (context) { if (fbdevctx == context) { /* destroying current context */ - _mesa_make_current2(NULL, NULL, NULL); + _mesa_make_current(NULL, NULL, NULL); _mesa_notifyDestroy(&context->glcontext); } _mesa_free_context_data(&context->glcontext); @@ -780,16 +843,16 @@ glFBDevMakeCurrent( GLFBDevContextPtr context, context->visual != readBuffer->visual) { return 0; } - _mesa_make_current2( &context->glcontext, - &drawBuffer->glframebuffer, - &readBuffer->glframebuffer ); + _mesa_make_current( &context->glcontext, + &drawBuffer->glframebuffer, + &readBuffer->glframebuffer ); context->drawBuffer = drawBuffer; context->readBuffer = readBuffer; context->curBuffer = drawBuffer; } else { /* unbind */ - _mesa_make_current2( NULL, NULL, NULL ); + _mesa_make_current( NULL, NULL, NULL ); } return 1; diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 4ab4b6421fd..50022ee5485 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -441,7 +441,6 @@ fxDDDrawBitmap2 (GLcontext *ctx, GLint px, GLint py, /*CLIP_BIT |*/ /* clipping ok, below */ STENCIL_BIT | MASKING_BIT | - ALPHABUF_BIT | /* nope! see 565 span kludge */ MULTI_DRAW_BIT | OCCLUSION_BIT | /* nope! at least not yet */ TEXTURE_BIT | @@ -605,7 +604,6 @@ fxDDDrawBitmap4 (GLcontext *ctx, GLint px, GLint py, /*CLIP_BIT |*/ /* clipping ok, below */ STENCIL_BIT | /*MASKING_BIT |*/ /* masking ok, we're in 32bpp */ - /*ALPHABUF_BIT |*//* alpha ok, we're in 32bpp */ MULTI_DRAW_BIT | OCCLUSION_BIT | /* nope! at least not yet */ TEXTURE_BIT | @@ -1089,7 +1087,6 @@ fxDDDrawPixels555 (GLcontext * ctx, GLint x, GLint y, /*CLIP_BIT |*/ /* clipping ok, below */ STENCIL_BIT | MASKING_BIT | - ALPHABUF_BIT | MULTI_DRAW_BIT | OCCLUSION_BIT | /* nope! at least not yet */ TEXTURE_BIT | @@ -1224,7 +1221,6 @@ fxDDDrawPixels565 (GLcontext * ctx, GLint x, GLint y, /*CLIP_BIT |*/ /* clipping ok, below */ STENCIL_BIT | MASKING_BIT | - ALPHABUF_BIT | MULTI_DRAW_BIT | OCCLUSION_BIT | /* nope! at least not yet */ TEXTURE_BIT | @@ -1359,7 +1355,6 @@ fxDDDrawPixels565_rev (GLcontext * ctx, GLint x, GLint y, /*CLIP_BIT |*/ /* clipping ok, below */ STENCIL_BIT | MASKING_BIT | - ALPHABUF_BIT | MULTI_DRAW_BIT | OCCLUSION_BIT | /* nope! at least not yet */ TEXTURE_BIT | @@ -1494,7 +1489,6 @@ fxDDDrawPixels8888 (GLcontext * ctx, GLint x, GLint y, /*CLIP_BIT |*/ /* clipping ok, below */ STENCIL_BIT | /*MASKING_BIT |*/ /* masking ok, we're in 32bpp */ - /*ALPHABUF_BIT |*//* alpha ok, we're in 32bpp */ MULTI_DRAW_BIT | OCCLUSION_BIT | /* nope! at least not yet */ TEXTURE_BIT | diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 7aa5673256a..9eb0fcd9838 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -35,20 +35,13 @@ #include "glheader.h" #include "GL/osmesa.h" -#include "buffers.h" -#include "bufferobj.h" #include "context.h" -#include "colormac.h" -#include "depth.h" #include "extensions.h" +#include "framebuffer.h" +#include "fbobject.h" #include "imports.h" -#include "macros.h" -#include "matrix.h" #include "mtypes.h" -#include "texformat.h" -#include "texobj.h" -#include "teximage.h" -#include "texstore.h" +#include "renderbuffer.h" #include "array_cache/acache.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -133,10 +126,14 @@ set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit ) { /* separate read buffer not supported */ ASSERT(buffer == ctx->DrawBuffer); - ASSERT(bufferBit == DD_FRONT_LEFT_BIT); + ASSERT(bufferBit == BUFFER_BIT_FRONT_LEFT); } +/* + * Just return the current buffer size. + * There's no window to track the size of. + */ static void get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) { @@ -151,194 +148,150 @@ get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) } -static void -clear( GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height ) -{ - OSMesaContext osmesa = OSMESA_CONTEXT(ctx); - const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask; - - /* sanity check - we only have a front-left buffer */ - ASSERT((mask & (DD_FRONT_RIGHT_BIT | - DD_BACK_LEFT_BIT | - DD_BACK_RIGHT_BIT)) == 0); - - /* use optimized clear for common cases (clear whole buffer to black) */ - if (mask & DD_FRONT_LEFT_BIT) { - if (osmesa->format == OSMESA_COLOR_INDEX) { - if (ctx->Color.ClearIndex == 0 && - ctx->Color.IndexMask == (GLuint) ~0 && - osmesa->rowlength == osmesa->width && - all) { - /* clear whole buffer to zeros */ - _mesa_bzero(osmesa->buffer, - osmesa->width * osmesa->height * sizeof(GLchan)); - mask &= ~DD_FRONT_LEFT_BIT; - } - } - else { - /* RGB[A] format */ - if (*colorMask == 0xffffffff && - ctx->Color.ClearColor[0] == 0.0F && - ctx->Color.ClearColor[1] == 0.0F && - ctx->Color.ClearColor[2] == 0.0F && - ctx->Color.ClearColor[3] == 0.0F && - osmesa->rowlength == osmesa->width && - all) { - GLint bytesPerPixel; - /* clear whole buffer to black */ - if (osmesa->format == OSMESA_RGBA || - osmesa->format == OSMESA_BGRA || - osmesa->format == OSMESA_ARGB) - bytesPerPixel = 4 * sizeof(GLchan); - else if (osmesa->format == OSMESA_RGB || - osmesa->format == OSMESA_BGR) - bytesPerPixel = 3 * sizeof(GLchan); - else if (osmesa->format == OSMESA_RGB_565) - bytesPerPixel = sizeof(GLushort); - else { - _mesa_problem(ctx, "bad pixel format in osmesa_clear()"); - return; - } - _mesa_bzero(osmesa->buffer, - bytesPerPixel * osmesa->width * osmesa->height); - mask &= ~DD_FRONT_LEFT_BIT; - } - } - } - - if (mask) { - /* software fallback (spans) for everything else. */ - _swrast_Clear(ctx, mask, all, x, y, width, height); - } -} - - /**********************************************************************/ /***** Read/write spans/arrays of pixels *****/ /**********************************************************************/ - /* RGBA */ #define NAME(PREFIX) PREFIX##_RGBA +#define FORMAT GL_RGBA #define SPAN_VARS \ const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); #define INIT_PIXEL_PTR(P, X, Y) \ GLchan *P = osmesa->rowaddr[Y] + 4 * (X) #define INC_PIXEL_PTR(P) P += 4 #if CHAN_TYPE == GL_FLOAT -#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ - P[0] = MAX2((R), 0.0F); \ - P[1] = MAX2((G), 0.0F); \ - P[2] = MAX2((B), 0.0F); \ - P[3] = CHAN_MAXF -#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ - P[0] = MAX2((R), 0.0F); \ - P[1] = MAX2((G), 0.0F); \ - P[2] = MAX2((B), 0.0F); \ - P[3] = CLAMP((A), 0.0F, CHAN_MAXF) +#define STORE_PIXEL(DST, X, Y, VALUE) \ + DST[0] = MAX2((VALUE[RCOMP]), 0.0F); \ + DST[1] = MAX2((VALUE[GCOMP]), 0.0F); \ + DST[2] = MAX2((VALUE[BCOMP]), 0.0F); \ + DST[3] = CLAMP((VALUE[ACOMP]), 0.0F, CHAN_MAXF) #else -#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ - P[0] = R; P[1] = G; P[2] = B; P[3] = CHAN_MAX -#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ - P[0] = R; P[1] = G; P[2] = B; P[3] = A +#define STORE_PIXEL(DST, X, Y, VALUE) \ + DST[0] = VALUE[RCOMP]; \ + DST[1] = VALUE[GCOMP]; \ + DST[2] = VALUE[BCOMP]; \ + DST[3] = VALUE[ACOMP] #endif -#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ - R = P[0]; G = P[1]; B = P[2]; A = P[3] -#include "swrast/s_spantemp.h" +#define FETCH_PIXEL(DST, SRC) \ + DST[RCOMP] = SRC[0]; \ + DST[GCOMP] = SRC[1]; \ + DST[BCOMP] = SRC[2]; \ + DST[BCOMP] = SRC[3] +#include "swrast/s_spantemp2.h" /* BGRA */ #define NAME(PREFIX) PREFIX##_BGRA +#define FORMAT GL_RGBA #define SPAN_VARS \ const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); #define INIT_PIXEL_PTR(P, X, Y) \ GLchan *P = osmesa->rowaddr[Y] + 4 * (X) #define INC_PIXEL_PTR(P) P += 4 -#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ - P[2] = R; P[1] = G; P[0] = B; P[3] = CHAN_MAX -#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ - P[2] = R; P[1] = G; P[0] = B; P[3] = A -#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ - R = P[2]; G = P[1]; B = P[0]; A = P[3] -#include "swrast/s_spantemp.h" +#define STORE_PIXEL(DST, X, Y, VALUE) \ + DST[2] = VALUE[RCOMP]; \ + DST[1] = VALUE[GCOMP]; \ + DST[0] = VALUE[BCOMP]; \ + DST[3] = VALUE[ACOMP] +#define FETCH_PIXEL(DST, SRC) \ + DST[RCOMP] = SRC[2]; \ + DST[GCOMP] = SRC[1]; \ + DST[BCOMP] = SRC[0]; \ + DST[BCOMP] = SRC[3] +#include "swrast/s_spantemp2.h" /* ARGB */ #define NAME(PREFIX) PREFIX##_ARGB +#define FORMAT GL_RGBA #define SPAN_VARS \ const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); #define INIT_PIXEL_PTR(P, X, Y) \ GLchan *P = osmesa->rowaddr[Y] + 4 * (X) #define INC_PIXEL_PTR(P) P += 4 -#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ - P[1] = R; P[2] = G; P[3] = B; P[0] = CHAN_MAX -#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ - P[1] = R; P[2] = G; P[3] = B; P[0] = A -#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ - R = P[1]; G = P[2]; B = P[3]; A = P[0] -#include "swrast/s_spantemp.h" +#define STORE_PIXEL(DST, X, Y, VALUE) \ + DST[1] = VALUE[RCOMP]; \ + DST[2] = VALUE[GCOMP]; \ + DST[3] = VALUE[BCOMP]; \ + DST[0] = VALUE[ACOMP] +#define FETCH_PIXEL(DST, SRC) \ + DST[RCOMP] = SRC[1]; \ + DST[GCOMP] = SRC[2]; \ + DST[BCOMP] = SRC[3]; \ + DST[BCOMP] = SRC[0] +#include "swrast/s_spantemp2.h" /* RGB */ #define NAME(PREFIX) PREFIX##_RGB +#define FORMAT GL_RGBA #define SPAN_VARS \ const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); #define INIT_PIXEL_PTR(P, X, Y) \ - GLchan *P = osmesa->rowaddr[Y] + 3 * (X) + GLchan *P = osmesa->rowaddr[Y] + 4 * (X) #define INC_PIXEL_PTR(P) P += 3 -#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ - P[0] = R; P[1] = G; P[2] = B -#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ - P[0] = R; P[1] = G; P[2] = B -#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ - R = P[0]; G = P[1]; B = P[2]; A = CHAN_MAX -#include "swrast/s_spantemp.h" +#define STORE_PIXEL(DST, X, Y, VALUE) \ + DST[0] = VALUE[RCOMP]; \ + DST[1] = VALUE[GCOMP]; \ + DST[2] = VALUE[BCOMP] +#define FETCH_PIXEL(DST, SRC) \ + DST[RCOMP] = SRC[0]; \ + DST[GCOMP] = SRC[1]; \ + DST[BCOMP] = SRC[2]; \ + DST[BCOMP] = CHAN_MAX +#include "swrast/s_spantemp2.h" /* BGR */ #define NAME(PREFIX) PREFIX##_BGR +#define FORMAT GL_RGBA #define SPAN_VARS \ const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); #define INIT_PIXEL_PTR(P, X, Y) \ - GLchan *P = osmesa->rowaddr[Y] + 3 * (X) + GLchan *P = osmesa->rowaddr[Y] + 4 * (X) #define INC_PIXEL_PTR(P) P += 3 -#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ - P[0] = B; P[1] = G; P[2] = R -#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ - P[0] = B; P[1] = G; P[2] = R -#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ - B = P[0]; G = P[1]; R = P[2]; A = CHAN_MAX -#include "swrast/s_spantemp.h" +#define STORE_PIXEL(DST, X, Y, VALUE) \ + DST[2] = VALUE[RCOMP]; \ + DST[1] = VALUE[GCOMP]; \ + DST[0] = VALUE[BCOMP] +#define FETCH_PIXEL(DST, SRC) \ + DST[RCOMP] = SRC[2]; \ + DST[GCOMP] = SRC[1]; \ + DST[BCOMP] = SRC[0]; \ + DST[BCOMP] = CHAN_MAX +#include "swrast/s_spantemp2.h" /* 16-bit BGR */ #if CHAN_TYPE == GL_UNSIGNED_BYTE #define NAME(PREFIX) PREFIX##_RGB_565 +#define FORMAT GL_RGBA #define SPAN_VARS \ const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); #define INIT_PIXEL_PTR(P, X, Y) \ GLushort *P = (GLushort *) osmesa->rowaddr[Y] + (X) #define INC_PIXEL_PTR(P) P += 1 -#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ - *P = ( (((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | ((B) >> 3) ) -#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ - *P = ( (((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | ((B) >> 3) ) -#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ - R = ( (((*P) >> 8) & 0xf8) | (((*P) >> 11) & 0x7) ); \ - G = ( (((*P) >> 3) & 0xfc) | (((*P) >> 5) & 0x3) ); \ - B = ( (((*P) << 3) & 0xf8) | (((*P) ) & 0x7) ); \ - A = CHAN_MAX -#include "swrast/s_spantemp.h" -#endif +#define STORE_PIXEL(DST, X, Y, VALUE) \ + *DST = ( (((VALUE[RCOMP]) & 0xf8) << 8) | (((VALUE[GCOMP]) & 0xfc) << 3) | ((VALUE[BCOMP]) >> 3) ) +#define FETCH_PIXEL(DST, SRC) \ + DST[RCOMP] = ( (((*SRC) >> 8) & 0xf8) | (((*SRC) >> 11) & 0x7) ); \ + DST[GCOMP] = ( (((*SRC) >> 3) & 0xfc) | (((*SRC) >> 5) & 0x3) ); \ + DST[BCOMP] = ( (((*SRC) << 3) & 0xf8) | (((*SRC) ) & 0x7) ); \ + DST[ACOMP] = CHAN_MAX +#include "swrast/s_spantemp2.h" +#endif /* CHAN_TYPE == GL_UNSIGNED_BYTE */ /* color index */ #define NAME(PREFIX) PREFIX##_CI +#define FORMAT GL_COLOR_INDEX8_EXT #define SPAN_VARS \ const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); #define INIT_PIXEL_PTR(P, X, Y) \ - GLchan *P = osmesa->rowaddr[Y] + (X) + GLubyte *P = osmesa->rowaddr[Y] + (X) #define INC_PIXEL_PTR(P) P += 1 -#define STORE_CI_PIXEL(P, CI) \ - P[0] = CI -#define FETCH_CI_PIXEL(CI, P) \ - CI = P[0] -#include "swrast/s_spantemp.h" +#define STORE_PIXEL(DST, X, Y, VALUE) \ + *DST = VALUE[0] +#define FETCH_PIXEL(DST, SRC) \ + DST = SRC[0] +#include "swrast/s_spantemp2.h" + + /**********************************************************************/ @@ -631,102 +584,121 @@ osmesa_choose_line( GLcontext *ctx ) _SWRAST_NEW_RASTERMASK) -/* one-time, per-context initialization */ +/** + * Don't use _mesa_delete_renderbuffer since we can't free rb->Data. + */ static void -hook_in_driver_functions( GLcontext *ctx ) +osmesa_delete_renderbuffer(struct gl_renderbuffer *rb) { - OSMesaContext osmesa = OSMESA_CONTEXT(ctx); - SWcontext *swrast = SWRAST_CONTEXT( ctx ); - struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx ); - TNLcontext *tnl = TNL_CONTEXT(ctx); - - ASSERT((void *) osmesa == (void *) ctx->DriverCtx); - - /* use default TCL pipeline */ - tnl->Driver.RunPipeline = _tnl_run_pipeline; - - swdd->SetBuffer = set_buffer; - - /* RGB(A) span/pixel functions */ - if (osmesa->format == OSMESA_RGB) { - swdd->WriteRGBASpan = write_rgba_span_RGB; - swdd->WriteRGBSpan = write_rgb_span_RGB; - swdd->WriteMonoRGBASpan = write_monorgba_span_RGB; - swdd->WriteRGBAPixels = write_rgba_pixels_RGB; - swdd->WriteMonoRGBAPixels = write_monorgba_pixels_RGB; - swdd->ReadRGBASpan = read_rgba_span_RGB; - swdd->ReadRGBAPixels = read_rgba_pixels_RGB; + _mesa_free(rb); +} + + +/** + * Allocate renderbuffer storage. We don't actually allocate any storage + * since we're using a user-provided buffer. + * Just set up all the gl_renderbuffer methods. + */ +static GLboolean +osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, + GLenum internalFormat, GLuint width, GLuint height) +{ + const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); + + if (osmesa->format == OSMESA_RGBA) { + rb->GetRow = get_row_RGBA; + rb->GetValues = get_values_RGBA; + rb->PutRow = put_row_RGBA; + rb->PutMonoRow = put_mono_row_RGBA; + rb->PutValues = put_values_RGBA; + rb->PutMonoValues = put_mono_values_RGBA; + } + else if (osmesa->format == OSMESA_BGRA) { + rb->GetRow = get_row_BGRA; + rb->GetValues = get_values_BGRA; + rb->PutRow = put_row_BGRA; + rb->PutMonoRow = put_mono_row_BGRA; + rb->PutValues = put_values_BGRA; + rb->PutMonoValues = put_mono_values_BGRA; + } + else if (osmesa->format == OSMESA_ARGB) { + rb->GetRow = get_row_ARGB; + rb->GetValues = get_values_ARGB; + rb->PutRow = put_row_ARGB; + rb->PutMonoRow = put_mono_row_ARGB; + rb->PutValues = put_values_ARGB; + rb->PutMonoValues = put_mono_values_ARGB; + } + else if (osmesa->format == OSMESA_RGB) { + rb->GetRow = get_row_RGB; + rb->GetValues = get_values_RGB; + rb->PutRow = put_row_RGB; + rb->PutMonoRow = put_mono_row_RGB; + rb->PutValues = put_values_RGB; + rb->PutMonoValues = put_mono_values_RGB; } else if (osmesa->format == OSMESA_BGR) { - swdd->WriteRGBASpan = write_rgba_span_BGR; - swdd->WriteRGBSpan = write_rgb_span_BGR; - swdd->WriteMonoRGBASpan = write_monorgba_span_BGR; - swdd->WriteRGBAPixels = write_rgba_pixels_BGR; - swdd->WriteMonoRGBAPixels = write_monorgba_pixels_BGR; - swdd->ReadRGBASpan = read_rgba_span_BGR; - swdd->ReadRGBAPixels = read_rgba_pixels_BGR; + rb->GetRow = get_row_BGR; + rb->GetValues = get_values_BGR; + rb->PutRow = put_row_BGR; + rb->PutMonoRow = put_mono_row_BGR; + rb->PutValues = put_values_BGR; + rb->PutMonoValues = put_mono_values_BGR; } #if CHAN_TYPE == GL_UNSIGNED_BYTE else if (osmesa->format == OSMESA_RGB_565) { - swdd->WriteRGBASpan = write_rgba_span_RGB_565; - swdd->WriteRGBSpan = write_rgb_span_RGB_565; - swdd->WriteMonoRGBASpan = write_monorgba_span_RGB_565; - swdd->WriteRGBAPixels = write_rgba_pixels_RGB_565; - swdd->WriteMonoRGBAPixels = write_monorgba_pixels_RGB_565; - swdd->ReadRGBASpan = read_rgba_span_RGB_565; - swdd->ReadRGBAPixels = read_rgba_pixels_RGB_565; + rb->GetRow = get_row_RGB_565; + rb->GetValues = get_values_RGB_565; + rb->PutRow = put_row_RGB_565; + rb->PutMonoRow = put_mono_row_RGB_565; + rb->PutValues = put_values_RGB_565; + rb->PutMonoValues = put_mono_values_RGB_565; } #endif - else if (osmesa->format == OSMESA_RGBA) { - swdd->WriteRGBASpan = write_rgba_span_RGBA; - swdd->WriteRGBSpan = write_rgb_span_RGBA; - swdd->WriteMonoRGBASpan = write_monorgba_span_RGBA; - swdd->WriteRGBAPixels = write_rgba_pixels_RGBA; - swdd->WriteMonoRGBAPixels = write_monorgba_pixels_RGBA; - swdd->ReadRGBASpan = read_rgba_span_RGBA; - swdd->ReadRGBAPixels = read_rgba_pixels_RGBA; - } - else if (osmesa->format == OSMESA_BGRA) { - swdd->WriteRGBASpan = write_rgba_span_BGRA; - swdd->WriteRGBSpan = write_rgb_span_BGRA; - swdd->WriteMonoRGBASpan = write_monorgba_span_BGRA; - swdd->WriteRGBAPixels = write_rgba_pixels_BGRA; - swdd->WriteMonoRGBAPixels = write_monorgba_pixels_BGRA; - swdd->ReadRGBASpan = read_rgba_span_BGRA; - swdd->ReadRGBAPixels = read_rgba_pixels_BGRA; - } - else if (osmesa->format == OSMESA_ARGB) { - swdd->WriteRGBASpan = write_rgba_span_ARGB; - swdd->WriteRGBSpan = write_rgb_span_ARGB; - swdd->WriteMonoRGBASpan = write_monorgba_span_ARGB; - swdd->WriteRGBAPixels = write_rgba_pixels_ARGB; - swdd->WriteMonoRGBAPixels = write_monorgba_pixels_ARGB; - swdd->ReadRGBASpan = read_rgba_span_ARGB; - swdd->ReadRGBAPixels = read_rgba_pixels_ARGB; - } else if (osmesa->format == OSMESA_COLOR_INDEX) { - swdd->WriteCI32Span = write_index32_span_CI; - swdd->WriteCI8Span = write_index8_span_CI; - swdd->WriteMonoCISpan = write_monoindex_span_CI; - swdd->WriteCI32Pixels = write_index_pixels_CI; - swdd->WriteMonoCIPixels = write_monoindex_pixels_CI; - swdd->ReadCI32Span = read_index_span_CI; - swdd->ReadCI32Pixels = read_index_pixels_CI; + rb->GetRow = get_row_CI; + rb->GetValues = get_values_CI; + rb->PutRow = put_row_CI; + rb->PutMonoRow = put_mono_row_CI; + rb->PutValues = put_values_CI; + rb->PutMonoValues = put_mono_values_CI; } else { - _mesa_problem(ctx, "bad pixel format in osmesa_update_state!\n"); + _mesa_problem(ctx, "bad pixel format in osmesa renderbuffer_storage"); } - /* Extend the software rasterizer with our optimized line and triangle - * drawin functions. - */ - swrast->choose_line = osmesa_choose_line; - swrast->choose_triangle = osmesa_choose_triangle; - swrast->invalidate_line |= OSMESA_NEW_LINE; - swrast->invalidate_triangle |= OSMESA_NEW_TRIANGLE; + return GL_TRUE; } +/** + * Allocate a new renderbuffer tpo describe the user-provided color buffer. + */ +static struct gl_renderbuffer * +new_osmesa_renderbuffer(GLenum format) +{ + struct gl_renderbuffer *rb = CALLOC_STRUCT(gl_renderbuffer); + if (rb) { + const GLuint name = 0; + _mesa_init_renderbuffer(rb, name); + + rb->Delete = osmesa_delete_renderbuffer; + rb->AllocStorage = osmesa_renderbuffer_storage; + + if (format == OSMESA_COLOR_INDEX) { + rb->_BaseFormat = GL_COLOR_INDEX; + rb->InternalFormat = GL_COLOR_INDEX; + rb->DataType = GL_UNSIGNED_BYTE; + } + else { + rb->_BaseFormat = GL_RGBA; + rb->InternalFormat = GL_RGBA; + rb->DataType = CHAN_TYPE; + } + } + return rb; +} + /**********************************************************************/ @@ -901,7 +873,6 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, return NULL; } - osmesa = (OSMesaContext) CALLOC_STRUCT(osmesa_context); if (osmesa) { osmesa->gl_visual = _mesa_create_visual( rgbmode, @@ -931,7 +902,6 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, functions.GetString = get_string; functions.UpdateState = osmesa_update_state; functions.GetBufferSize = get_buffer_size; - functions.Clear = clear; if (!_mesa_initialize_context(&osmesa->mesa, osmesa->gl_visual, @@ -948,18 +918,24 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, _mesa_enable_1_4_extensions(&(osmesa->mesa)); _mesa_enable_1_5_extensions(&(osmesa->mesa)); - osmesa->gl_buffer = _mesa_create_framebuffer( osmesa->gl_visual, - (GLboolean) ( osmesa->gl_visual->depthBits > 0 ), - (GLboolean) ( osmesa->gl_visual->stencilBits > 0 ), - (GLboolean) ( osmesa->gl_visual->accumRedBits > 0 ), - GL_FALSE /* s/w alpha */ ); - + osmesa->gl_buffer = _mesa_create_framebuffer(osmesa->gl_visual); if (!osmesa->gl_buffer) { _mesa_destroy_visual( osmesa->gl_visual ); _mesa_free_context_data( &osmesa->mesa ); FREE(osmesa); return NULL; } + + _mesa_add_renderbuffer(osmesa->gl_buffer, BUFFER_FRONT_LEFT, + new_osmesa_renderbuffer(format)); + _mesa_add_soft_renderbuffers(osmesa->gl_buffer, + GL_FALSE, /* color */ + osmesa->gl_visual->haveDepthBuffer, + osmesa->gl_visual->haveStencilBuffer, + osmesa->gl_visual->haveAccumBuffer, + GL_FALSE, /* alpha */ + GL_FALSE /* aux */ ); + osmesa->format = format; osmesa->buffer = NULL; osmesa->width = 0; @@ -979,6 +955,9 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, /* Initialize the software rasterizer and helper modules. */ { GLcontext *ctx = &osmesa->mesa; + SWcontext *swrast; + struct swrast_device_driver *swdd; + TNLcontext *tnl; if (!_swrast_CreateContext( ctx ) || !_ac_CreateContext( ctx ) || @@ -991,7 +970,31 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, } _swsetup_Wakeup( ctx ); - hook_in_driver_functions( ctx ); + + /* use default TCL pipeline */ + tnl = TNL_CONTEXT(ctx); + tnl->Driver.RunPipeline = _tnl_run_pipeline; + + swdd = _swrast_GetDeviceDriverReference( ctx ); + swdd->SetBuffer = set_buffer; + + /* no longer used */ + swdd->WriteRGBASpan = NULL; + swdd->WriteRGBSpan = NULL; + swdd->WriteMonoRGBASpan = NULL; + swdd->WriteRGBAPixels = NULL; + swdd->WriteMonoRGBAPixels = NULL; + swdd->ReadRGBASpan = NULL; + swdd->ReadRGBAPixels = NULL; + + /* Extend the software rasterizer with our optimized line and triangle + * drawing functions. + */ + swrast = SWRAST_CONTEXT( ctx ); + swrast->choose_line = osmesa_choose_line; + swrast->choose_triangle = osmesa_choose_triangle; + swrast->invalidate_line |= OSMESA_NEW_LINE; + swrast->invalidate_triangle |= OSMESA_NEW_TRIANGLE; } } return osmesa; @@ -1117,7 +1120,7 @@ OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type, ctx->height = height; osmesa_update_state( &ctx->mesa, 0 ); - _mesa_make_current( &ctx->mesa, ctx->gl_buffer ); + _mesa_make_current( &ctx->mesa, ctx->gl_buffer, ctx->gl_buffer ); if (ctx->userRowLength) ctx->rowlength = ctx->userRowLength; @@ -1127,7 +1130,10 @@ OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type, compute_row_addresses( ctx ); /* this will make ensure we recognize the new buffer size */ + _mesa_resize_framebuffer(&ctx->mesa, ctx->gl_buffer, width, height); +#if 00 _mesa_ResizeBuffersMESA(); +#endif /* Added by Gerk Huisma: */ _tnl_MakeCurrent( &ctx->mesa, ctx->mesa.DrawBuffer, @@ -1225,7 +1231,13 @@ GLAPI GLboolean GLAPIENTRY OSMesaGetDepthBuffer( OSMesaContext c, GLint *width, GLint *height, GLint *bytesPerValue, void **buffer ) { - if ((!c->gl_buffer) || (!c->gl_buffer->DepthBuffer)) { + struct gl_renderbuffer *rb = NULL; + + if (c->gl_buffer) + rb = c->gl_buffer->Attachment[BUFFER_DEPTH].Renderbuffer; + + if (!rb || !rb->Data) { + /*if ((!c->gl_buffer) || (!c->gl_buffer->DepthBuffer)) {*/ *width = 0; *height = 0; *bytesPerValue = 0; @@ -1239,7 +1251,7 @@ OSMesaGetDepthBuffer( OSMesaContext c, GLint *width, GLint *height, *bytesPerValue = sizeof(GLushort); else *bytesPerValue = sizeof(GLuint); - *buffer = c->gl_buffer->DepthBuffer; + *buffer = rb->Data; return GL_TRUE; } } diff --git a/src/mesa/drivers/svga/svgamesa8.c b/src/mesa/drivers/svga/svgamesa8.c index 29fd4070b37..fd880ef85ad 100644 --- a/src/mesa/drivers/svga/svgamesa8.c +++ b/src/mesa/drivers/svga/svgamesa8.c @@ -1,4 +1,4 @@ -/* $Id: svgamesa8.c,v 1.8 2001/02/06 00:03:48 brianp Exp $ */ +/* $Id: svgamesa8.c,v 1.9 2005/05/04 20:11:39 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -98,7 +98,8 @@ void __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all, _swrast_Clear( ctx, mask, all, x, y, width, height ); } -void __write_ci32_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, +void __write_ci32_span8( const GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, const GLuint index[], const GLubyte mask[] ) { int i; @@ -109,7 +110,8 @@ void __write_ci32_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, } } -void __write_ci8_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, +void __write_ci8_span8( const GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, const GLubyte index[], const GLubyte mask[] ) { int i; @@ -121,8 +123,8 @@ void __write_ci8_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, } } -void __write_mono_ci_span8( const GLcontext *ctx, GLuint n, - GLint x, GLint y, +void __write_mono_ci_span8( const GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, GLuint colorIndex, const GLubyte mask[] ) { int i; @@ -133,7 +135,7 @@ void __write_mono_ci_span8( const GLcontext *ctx, GLuint n, } } -void __read_ci32_span8( const GLcontext *ctx, +void __read_ci32_span8( const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, GLuint index[]) { int i; @@ -142,7 +144,7 @@ void __read_ci32_span8( const GLcontext *ctx, } } -void __write_ci32_pixels8( const GLcontext *ctx, +void __write_ci32_pixels8( const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], const GLuint index[], const GLubyte mask[] ) { @@ -155,8 +157,8 @@ void __write_ci32_pixels8( const GLcontext *ctx, } -void __write_mono_ci_pixels8( const GLcontext *ctx, GLuint n, - const GLint x[], const GLint y[], +void __write_mono_ci_pixels8( const GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], GLuint colorIndex, const GLubyte mask[] ) { int i; @@ -167,7 +169,7 @@ void __write_mono_ci_pixels8( const GLcontext *ctx, GLuint n, } } -void __read_ci32_pixels8( const GLcontext *ctx, +void __read_ci32_pixels8( const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], GLuint index[], const GLubyte mask[] ) { diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index b0cb52846a1..e4dbc5acd97 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -417,11 +417,8 @@ create_glx_visual( Display *dpy, XVisualInfo *visinfo ) GL_TRUE, /* double */ GL_FALSE, /* stereo */ zBits, - 8 * sizeof(GLstencil), - 0 * sizeof(GLaccum), /* r */ - 0 * sizeof(GLaccum), /* g */ - 0 * sizeof(GLaccum), /* b */ - 0 * sizeof(GLaccum), /* a */ + STENCIL_BITS, + 0, 0, 0, 0, /* accum bits */ 0, /* level */ 0 /* numAux */ ); @@ -436,11 +433,11 @@ create_glx_visual( Display *dpy, XVisualInfo *visinfo ) GL_TRUE, /* double */ GL_FALSE, /* stereo */ zBits, - 8 * sizeof(GLstencil), - 8 * sizeof(GLaccum), /* r */ - 8 * sizeof(GLaccum), /* g */ - 8 * sizeof(GLaccum), /* b */ - 8 * sizeof(GLaccum), /* a */ + STENCIL_BITS, + ACCUM_BITS, /* r */ + ACCUM_BITS, /* g */ + ACCUM_BITS, /* b */ + ACCUM_BITS, /* a */ 0, /* level */ 0 /* numAux */ ); @@ -1231,6 +1228,11 @@ static XVisualInfo * Fake_glXChooseVisual( Display *dpy, int screen, int *list ) { XMesaVisual xmvis = choose_visual(dpy, screen, list, GL_FALSE); + { + int x; + glXGetConfig(dpy, xmvis->vishandle, GLX_RED_SIZE, &x); + } + if (xmvis) { #if 0 return xmvis->vishandle; @@ -1418,7 +1420,7 @@ Fake_glXCreateGLXPixmap( Display *dpy, XVisualInfo *visinfo, Pixmap pixmap ) if (!b) { return 0; } - return b->frontbuffer; + return b->frontxrb->pixmap; } @@ -1444,7 +1446,7 @@ Fake_glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visinfo, if (!b) { return 0; } - return b->frontbuffer; + return b->frontxrb->pixmap; } @@ -2096,7 +2098,7 @@ Fake_glXCreatePbuffer( Display *dpy, GLXFBConfig config, /* A GLXPbuffer handle must be an X Drawable because that's what * glXMakeCurrent takes. */ - return (GLXPbuffer) xmbuf->frontbuffer; + return (GLXPbuffer) xmbuf->frontxrb->pixmap; } @@ -2357,7 +2359,7 @@ Fake_glXCreateGLXPixmapWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, Pixm { XMesaVisual xmvis = (XMesaVisual) config; XMesaBuffer xmbuf = XMesaCreatePixmapBuffer(xmvis, pixmap, 0); - return xmbuf->frontbuffer; /* need to return an X ID */ + return xmbuf->frontxrb->pixmap; /* need to return an X ID */ } @@ -2451,7 +2453,7 @@ Fake_glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfigSGIX config, /* A GLXPbuffer handle must be an X Drawable because that's what * glXMakeCurrent takes. */ - return (GLXPbuffer) xmbuf->frontbuffer; + return (GLXPbuffer) xmbuf->frontxrb->pixmap; } diff --git a/src/mesa/drivers/x11/glxheader.h b/src/mesa/drivers/x11/glxheader.h index b5834003890..42637f4c14d 100644 --- a/src/mesa/drivers/x11/glxheader.h +++ b/src/mesa/drivers/x11/glxheader.h @@ -67,5 +67,4 @@ struct timespec; struct itimerspec; - #endif /*GLX_HEADER*/ diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 0e1f5c58ed4..99beb5c501c 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -65,11 +65,13 @@ #include "xmesaP.h" #include "context.h" #include "extensions.h" +#include "framebuffer.h" #include "glthread.h" #include "imports.h" #include "matrix.h" #include "mtypes.h" #include "macros.h" +#include "renderbuffer.h" #include "texformat.h" #include "texobj.h" #include "texstore.h" @@ -278,7 +280,7 @@ static int bits_per_pixel( XMesaVisual xmv ) /* grab the bits/pixel value */ bitsPerPixel = img->bits_per_pixel; /* free the XImage */ - FREE( img->data ); + _mesa_free( img->data ); img->data = NULL; XMesaDestroyImage( img ); return bitsPerPixel; @@ -343,18 +345,7 @@ alloc_xmesa_buffer(XMesaVisual vis, BufferType type, XMesaColormap cmap) b->type = type; b->cmap = cmap; - _mesa_initialize_framebuffer(&b->mesa_buffer, - &vis->mesa_visual, - vis->mesa_visual.depthBits > 0, - vis->mesa_visual.stencilBits > 0, - vis->mesa_visual.accumRedBits + - vis->mesa_visual.accumGreenBits + - vis->mesa_visual.accumBlueBits > 0, - vis->mesa_visual.alphaBits > 0 - /*v->mesa_visual.numAuxBuffers > 0*/ ); - /* XXX hack */ - if (vis->mesa_visual.numAuxBuffers > 0) - b->mesa_buffer.UseSoftwareAuxBuffers = GL_TRUE; + _mesa_initialize_framebuffer(&b->mesa_buffer, &vis->mesa_visual); /* determine back buffer implementation */ if (vis->mesa_visual.doubleBufferMode) { @@ -369,6 +360,30 @@ alloc_xmesa_buffer(XMesaVisual vis, BufferType type, XMesaColormap cmap) b->db_state = 0; } + /* Allocate the framebuffer's renderbuffers */ + assert(!b->mesa_buffer.Attachment[BUFFER_FRONT_LEFT].Renderbuffer); + assert(!b->mesa_buffer.Attachment[BUFFER_BACK_LEFT].Renderbuffer); + + /* front renderbuffer */ + b->frontxrb = xmesa_new_renderbuffer(NULL, 0, vis->mesa_visual.rgbMode); + _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_FRONT_LEFT, + &b->frontxrb->Base); + + /* back renderbuffer */ + if (vis->mesa_visual.doubleBufferMode) { + b->backxrb =xmesa_new_renderbuffer(NULL, 0, vis->mesa_visual.rgbMode); + _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_BACK_LEFT, + &b->backxrb->Base); + } + + _mesa_add_soft_renderbuffers(&b->mesa_buffer, + GL_FALSE, /* color */ + vis->mesa_visual.haveDepthBuffer, + vis->mesa_visual.haveStencilBuffer, + vis->mesa_visual.haveAccumBuffer, + vis->mesa_visual.alphaBits > 0, + vis->mesa_visual.numAuxBuffers > 0 ); + /* insert into linked list */ b->Next = XMesaBufferList; XMesaBufferList = b; @@ -426,7 +441,11 @@ static void free_xmesa_buffer(int client, XMesaBuffer buffer) } _mesa_free_framebuffer_data(&buffer->mesa_buffer); - FREE(buffer); + /* delete front/back renderbuffers */ + buffer->frontxrb->Base.Delete(&(buffer->frontxrb->Base)); + if (buffer->backxrb) + buffer->backxrb->Base.Delete(&(buffer->backxrb->Base)); + _mesa_free(buffer); return; } @@ -473,12 +492,13 @@ static int bitcount( unsigned long n ) -/* +/** * Allocate a shared memory XImage back buffer for the given XMesaBuffer. * Return: GL_TRUE if success, GL_FALSE if error */ #ifndef XFree86Server -static GLboolean alloc_shm_back_buffer( XMesaBuffer b ) +static GLboolean +alloc_shm_back_buffer(XMesaBuffer b, GLuint width, GLuint height) { #ifdef USE_XSHM /* @@ -490,40 +510,40 @@ static GLboolean alloc_shm_back_buffer( XMesaBuffer b ) GC gc; int (*old_handler)( XMesaDisplay *, XErrorEvent * ); - if (b->mesa_buffer.Width == 0 || b->mesa_buffer.Height == 0) { + if (width == 0 || height == 0) { /* this will be true the first time we're called on 'b' */ return GL_FALSE; } - b->backimage = XShmCreateImage(b->xm_visual->display, - b->xm_visual->visinfo->visual, - b->xm_visual->visinfo->depth, - ZPixmap, NULL, &b->shminfo, - b->mesa_buffer.Width, b->mesa_buffer.Height); - if (b->backimage == NULL) { + b->backxrb->ximage = XShmCreateImage(b->xm_visual->display, + b->xm_visual->visinfo->visual, + b->xm_visual->visinfo->depth, + ZPixmap, NULL, &b->shminfo, + width, height); + if (b->backxrb->ximage == NULL) { _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (XShmCreateImage), disabling."); b->shm = 0; return GL_FALSE; } - b->shminfo.shmid = shmget( IPC_PRIVATE, b->backimage->bytes_per_line - * b->backimage->height, IPC_CREAT|0777 ); + b->shminfo.shmid = shmget( IPC_PRIVATE, b->backxrb->ximage->bytes_per_line + * b->backxrb->ximage->height, IPC_CREAT|0777 ); if (b->shminfo.shmid < 0) { _mesa_warning(NULL, "shmget failed while allocating back buffer"); - XDestroyImage( b->backimage ); - b->backimage = NULL; + XDestroyImage( b->backxrb->ximage ); + b->backxrb->ximage = NULL; _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (shmget), disabling."); b->shm = 0; return GL_FALSE; } - b->shminfo.shmaddr = b->backimage->data + b->shminfo.shmaddr = b->backxrb->ximage->data = (char*)shmat( b->shminfo.shmid, 0, 0 ); if (b->shminfo.shmaddr == (char *) -1) { _mesa_warning(NULL, "shmat() failed while allocating back buffer"); - XDestroyImage( b->backimage ); + XDestroyImage( b->backxrb->ximage ); shmctl( b->shminfo.shmid, IPC_RMID, 0 ); - b->backimage = NULL; + b->backxrb->ximage = NULL; _mesa_warning(NULL, "alloc_back_buffer: Shared memory error (shmat), disabling."); b->shm = 0; return GL_FALSE; @@ -540,10 +560,10 @@ static GLboolean alloc_shm_back_buffer( XMesaBuffer b ) /* we are on a remote display, this error is normal, don't print it */ XFlush( b->xm_visual->display ); mesaXErrorFlag = 0; - XDestroyImage( b->backimage ); + XDestroyImage( b->backxrb->ximage ); shmdt( b->shminfo.shmaddr ); shmctl( b->shminfo.shmid, IPC_RMID, 0 ); - b->backimage = NULL; + b->backxrb->ximage = NULL; b->shm = 0; (void) XSetErrorHandler( old_handler ); return GL_FALSE; @@ -552,43 +572,23 @@ static GLboolean alloc_shm_back_buffer( XMesaBuffer b ) shmctl( b->shminfo.shmid, IPC_RMID, 0 ); /* nobody else needs it */ /* Finally, try an XShmPutImage to be really sure the extension works */ - gc = XCreateGC( b->xm_visual->display, b->frontbuffer, 0, NULL ); - XShmPutImage( b->xm_visual->display, b->frontbuffer, gc, - b->backimage, 0, 0, 0, 0, 1, 1 /*one pixel*/, False ); + gc = XCreateGC( b->xm_visual->display, b->frontxrb->pixmap, 0, NULL ); + XShmPutImage( b->xm_visual->display, b->frontxrb->pixmap, gc, + b->backxrb->ximage, 0, 0, 0, 0, 1, 1 /*one pixel*/, False ); XSync( b->xm_visual->display, False ); XFreeGC( b->xm_visual->display, gc ); (void) XSetErrorHandler( old_handler ); if (mesaXErrorFlag) { XFlush( b->xm_visual->display ); mesaXErrorFlag = 0; - XDestroyImage( b->backimage ); + XDestroyImage( b->backxrb->ximage ); shmdt( b->shminfo.shmaddr ); shmctl( b->shminfo.shmid, IPC_RMID, 0 ); - b->backimage = NULL; + b->backxrb->ximage = NULL; b->shm = 0; return GL_FALSE; } - if (b->backimage) { - int height = b->backimage->height; - /* Needed by PIXELADDR1 macro */ - b->ximage_width1 = b->backimage->bytes_per_line; - b->ximage_origin1 = (GLubyte *) b->backimage->data - + b->ximage_width1 * (height-1); - /* Needed by PIXELADDR2 macro */ - b->ximage_width2 = b->backimage->bytes_per_line / 2; - b->ximage_origin2 = (GLushort *) b->backimage->data - + b->ximage_width2 * (height-1); - /* Needed by PIXELADDR3 macro */ - b->ximage_width3 = b->backimage->bytes_per_line; - b->ximage_origin3 = (GLubyte *) b->backimage->data - + b->ximage_width3 * (height-1); - /* Needed by PIXELADDR4 macro */ - b->ximage_width4 = b->backimage->width; - b->ximage_origin4 = (GLuint *) b->backimage->data - + b->ximage_width4 * (height-1); - } - return GL_TRUE; #else /* Can't compile XSHM support */ @@ -603,77 +603,73 @@ static GLboolean alloc_shm_back_buffer( XMesaBuffer b ) * Setup an off-screen pixmap or Ximage to use as the back buffer. * Input: b - the X/Mesa buffer */ -void xmesa_alloc_back_buffer( XMesaBuffer b ) +void +xmesa_alloc_back_buffer( XMesaBuffer b, GLuint width, GLuint height ) { - if (b->db_state==BACK_XIMAGE) { - /* Deallocate the old backimage, if any */ - if (b->backimage) { + if (width == 0 || height == 0) + return; + + if (b->db_state == BACK_XIMAGE) { + /* Deallocate the old backxrb->ximage, if any */ + if (b->backxrb->ximage) { #if defined(USE_XSHM) && !defined(XFree86Server) if (b->shm) { XShmDetach( b->xm_visual->display, &b->shminfo ); - XDestroyImage( b->backimage ); + XDestroyImage( b->backxrb->ximage ); shmdt( b->shminfo.shmaddr ); } else #endif - XMesaDestroyImage( b->backimage ); - b->backimage = NULL; + XMesaDestroyImage( b->backxrb->ximage ); + b->backxrb->ximage = NULL; } /* Allocate new back buffer */ #ifdef XFree86Server { /* Allocate a regular XImage for the back buffer. */ - b->backimage = XMesaCreateImage(b->xm_visual->BitsPerPixel, - b->mesa_buffer.Width, - b->mesa_buffer.Height, NULL); + b->backxrb->ximage = XMesaCreateImage(b->xm_visual->BitsPerPixel, + width, height, NULL); #else - if (b->shm==0 || alloc_shm_back_buffer(b)==GL_FALSE) { + if (b->shm == 0 || !alloc_shm_back_buffer(b, width, height)) { /* Allocate a regular XImage for the back buffer. */ - b->backimage = XCreateImage( b->xm_visual->display, + b->backxrb->ximage = XCreateImage( b->xm_visual->display, b->xm_visual->visinfo->visual, GET_VISUAL_DEPTH(b->xm_visual), ZPixmap, 0, /* format, offset */ NULL, - b->mesa_buffer.Width, - b->mesa_buffer.Height, + width, height, 8, 0 ); /* pad, bytes_per_line */ #endif - if (!b->backimage) { + if (!b->backxrb->ximage) { _mesa_warning(NULL, "alloc_back_buffer: XCreateImage failed."); } - b->backimage->data = (char *) MALLOC( b->backimage->height - * b->backimage->bytes_per_line ); - if (!b->backimage->data) { + b->backxrb->ximage->data = (char *) MALLOC( b->backxrb->ximage->height + * b->backxrb->ximage->bytes_per_line ); + if (!b->backxrb->ximage->data) { _mesa_warning(NULL, "alloc_back_buffer: MALLOC failed."); - XMesaDestroyImage( b->backimage ); - b->backimage = NULL; + XMesaDestroyImage( b->backxrb->ximage ); + b->backxrb->ximage = NULL; } } - b->backpixmap = None; + b->backxrb->pixmap = None; + b->backxrb->ximage = b->backxrb->ximage; } else if (b->db_state==BACK_PIXMAP) { - XMesaPixmap old_pixmap = b->backpixmap; - int width = b->mesa_buffer.Width, height = b->mesa_buffer.Height; - if (!width) width = 1; if (!height) height = 1; /* Free the old back pixmap */ - if (b->backpixmap) { - XMesaFreePixmap( b->xm_visual->display, b->backpixmap ); + if (b->backxrb->pixmap) { + XMesaFreePixmap( b->xm_visual->display, b->backxrb->pixmap ); } /* Allocate new back pixmap */ - b->backpixmap = XMesaCreatePixmap( b->xm_visual->display, b->frontbuffer, + b->backxrb->pixmap = XMesaCreatePixmap( b->xm_visual->display, b->frontxrb->pixmap, width, height, GET_VISUAL_DEPTH(b->xm_visual) ); - b->backimage = NULL; - /* update other references to backpixmap */ - if (b->buffer==(XMesaDrawable)old_pixmap) { - b->buffer = (XMesaDrawable)b->backpixmap; - } + b->backxrb->ximage = NULL; } } @@ -747,7 +743,7 @@ noFaultXAllocColor( int client, || prevCmapSize != cmapSize || !ctable) { /* free previously cached color table */ if (ctable) - FREE(ctable); + _mesa_free(ctable); /* Get the color table from X */ ctable = (XMesaColor *) MALLOC(cmapSize * sizeof(XMesaColor)); assert(ctable); @@ -803,8 +799,8 @@ noFaultXAllocColor( int client, *alloced = 0; } #ifdef XFree86Server - FREE(ppixIn); - FREE(ctable); + _mesa_free(ppixIn); + _mesa_free(ctable); #else /* don't free table, save it for next time */ #endif @@ -1208,6 +1204,9 @@ static GLboolean initialize_visual_and_buffer( int client, XMesaDrawable window, XMesaColormap cmap ) { +#if NEW_RENDERBUFFER + struct xmesa_renderbuffer *front_xrb, *back_xrb; +#endif #ifndef XFree86Server XGCValues gcvalues; #endif @@ -1216,6 +1215,16 @@ static GLboolean initialize_visual_and_buffer( int client, assert(b->xm_visual == v); } +#if NEW_RENDERBUFFER + if (b) { + front_xrb = b->frontxrb; + back_xrb = b->backxrb; + } + else { + front_xrb = back_xrb = NULL; + } +#endif + /* Save true bits/pixel */ v->BitsPerPixel = bits_per_pixel(v); assert(v->BitsPerPixel > 0); @@ -1280,7 +1289,7 @@ static GLboolean initialize_visual_and_buffer( int client, if (b && window) { /* Do window-specific initializations */ - b->frontbuffer = window; + b->frontxrb->pixmap = window; /* Setup for single/double buffering */ if (v->mesa_visual.doubleBufferMode) { @@ -1288,17 +1297,7 @@ static GLboolean initialize_visual_and_buffer( int client, #ifndef XFree86Server b->shm = check_for_xshm( v->display ); #endif - xmesa_alloc_back_buffer( b ); - if (b->db_state==BACK_PIXMAP) { - b->buffer = (XMesaDrawable)b->backpixmap; - } - else { - b->buffer = XIMAGE; - } - } - else { - /* Single Buffered */ - b->buffer = b->frontbuffer; + xmesa_alloc_back_buffer(b, b->mesa_buffer.Width, b->mesa_buffer.Height); } /* X11 graphics contexts */ @@ -1340,7 +1339,7 @@ static GLboolean initialize_visual_and_buffer( int client, * Initialize whole stuff * Patch contributed by Jacques Leroy March 8, 1998. */ - if (v->hpcr_clear_flag && b->buffer!=XIMAGE) { + if (v->hpcr_clear_flag && back_xrb->pixmap) { int i; for (i=0; i<16; i++) { @@ -1380,9 +1379,11 @@ static GLboolean initialize_visual_and_buffer( int client, * Convert an RGBA color to a pixel value. */ unsigned long -xmesa_color_to_pixel( XMesaContext xmesa, GLubyte r, GLubyte g, GLubyte b, GLubyte a, - GLuint pixelFormat) +xmesa_color_to_pixel(GLcontext *ctx, + GLubyte r, GLubyte g, GLubyte b, GLubyte a, + GLuint pixelFormat) { + XMesaContext xmesa = XMESA_CONTEXT(ctx); switch (pixelFormat) { case PF_Index: return 0; @@ -1428,7 +1429,7 @@ xmesa_color_to_pixel( XMesaContext xmesa, GLubyte r, GLubyte g, GLubyte b, GLuby return p; } default: - _mesa_problem(NULL, "Bad pixel format in xmesa_color_to_pixel"); + _mesa_problem(ctx, "Bad pixel format in xmesa_color_to_pixel"); } return 0; } @@ -1536,14 +1537,14 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, */ v->display = display; - /* Save a copy of the XVisualInfo struct because the user may XFREE() + /* Save a copy of the XVisualInfo struct because the user may X_mesa_free() * the struct but we may need some of the information contained in it * at a later time. */ #ifndef XFree86Server v->visinfo = (XVisualInfo *) MALLOC(sizeof(*visinfo)); if(!v->visinfo) { - FREE(v); + _mesa_free(v); return NULL; } MEMCPY(v->visinfo, visinfo, sizeof(*visinfo)); @@ -1647,9 +1648,9 @@ void XMesaSetVisualDisplay( XMesaDisplay *dpy, XMesaVisual v ) void XMesaDestroyVisual( XMesaVisual v ) { #ifndef XFree86Server - FREE(v->visinfo); + _mesa_free(v->visinfo); #endif - FREE(v); + _mesa_free(v); } @@ -1687,7 +1688,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) if (!_mesa_initialize_context(mesaCtx, &v->mesa_visual, share_list ? &(share_list->mesa) : (GLcontext *) NULL, &functions, (void *) c)) { - FREE(c); + _mesa_free(c); return NULL; } @@ -1707,8 +1708,6 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) /* finish up xmesa context initializations */ c->swapbytes = CHECK_BYTE_ORDER(v) ? GL_FALSE : GL_TRUE; c->xm_visual = v; - c->xm_draw_buffer = NULL; /* set later by XMesaMakeCurrent */ - c->xm_read_buffer = NULL; /* set later by XMesaMakeCurrent */ c->xm_buffer = NULL; /* set later by XMesaMakeCurrent */ c->display = v->display; c->pixelformat = v->dithered_pf; /* Dithering is enabled by default */ @@ -1740,8 +1739,10 @@ void XMesaDestroyContext( XMesaContext c ) { GLcontext *mesaCtx = &c->mesa; #ifdef FX - if (c->xm_draw_buffer && c->xm_buffer->FXctx) - fxMesaDestroyContext(c->xm_draw_buffer->FXctx); + XMesaBuffer xmbuf = XMESA_BUFFER(mesaCtx->DrawBuffer); + + if (xmbuf && xmbuf->FXctx) + fxMesaDestroyContext(xmbuf->FXctx); #endif _swsetup_DestroyContext( mesaCtx ); _swrast_DestroyContext( mesaCtx ); @@ -1864,7 +1865,7 @@ XMesaCreateWindowBuffer2(XMesaVisual v, XMesaWindow w, XMesaContext c) if ((hw == GR_SSTTYPE_VOODOO) || (hw == GR_SSTTYPE_Voodoo2)) { b->FXctx = fxMesaCreateBestContext(0, b->mesa_buffer.Width, b->mesa_buffer.Height, attribs); - if ((v->undithered_pf!=PF_Index) && (b->backimage)) { + if ((v->undithered_pf!=PF_Index) && (b->backxrb->ximage)) { b->FXisHackUsable = b->FXctx ? GL_TRUE : GL_FALSE; if (b->FXctx && (fxEnvVar[0]=='w' || fxEnvVar[0]=='W')) { b->FXwindowHack = GL_TRUE; @@ -1989,27 +1990,27 @@ void XMesaDestroyBuffer( XMesaBuffer b ) int client = 0; #ifdef XFree86Server - if (b->frontbuffer) - client = CLIENT_ID(b->frontbuffer->id); + if (b->frontxrb->pixmap) + client = CLIENT_ID(b->frontxrb->pixmap->id); #endif if (b->gc) XMesaFreeGC( b->xm_visual->display, b->gc ); if (b->cleargc) XMesaFreeGC( b->xm_visual->display, b->cleargc ); if (b->swapgc) XMesaFreeGC( b->xm_visual->display, b->swapgc ); - if (b->backimage) { + if (b->backxrb->ximage) { #if defined(USE_XSHM) && !defined(XFree86Server) if (b->shm) { XShmDetach( b->xm_visual->display, &b->shminfo ); - XDestroyImage( b->backimage ); + XDestroyImage( b->backxrb->ximage ); shmdt( b->shminfo.shmaddr ); } else #endif - XMesaDestroyImage( b->backimage ); + XMesaDestroyImage( b->backxrb->ximage ); } - if (b->backpixmap) { - XMesaFreePixmap( b->xm_visual->display, b->backpixmap ); + if (b->backxrb->pixmap) { + XMesaFreePixmap( b->xm_visual->display, b->backxrb->pixmap ); if (b->xm_visual->hpcr_clear_flag) { XMesaFreePixmap( b->xm_visual->display, b->xm_visual->hpcr_clear_pixmap ); @@ -2017,7 +2018,7 @@ void XMesaDestroyBuffer( XMesaBuffer b ) } } if (b->rowimage) { - FREE( b->rowimage->data ); + _mesa_free( b->rowimage->data ); b->rowimage->data = NULL; XMesaDestroyImage( b->rowimage ); } @@ -2050,49 +2051,45 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer, if (drawBuffer->FXctx) { fxMesaMakeCurrent(drawBuffer->FXctx); - c->xm_draw_buffer = drawBuffer; - c->xm_read_buffer = readBuffer; c->xm_buffer = drawBuffer; return GL_TRUE; } #endif if (&(c->mesa) == _mesa_get_current_context() - && c->xm_draw_buffer == drawBuffer - && c->xm_read_buffer == readBuffer - && c->xm_draw_buffer->wasCurrent) { + && c->mesa.DrawBuffer == &drawBuffer->mesa_buffer + && c->mesa.ReadBuffer == &readBuffer->mesa_buffer + && ((XMesaBuffer) c->mesa.DrawBuffer)->wasCurrent) { /* same context and buffer, do nothing */ return GL_TRUE; } - c->xm_draw_buffer = drawBuffer; - c->xm_read_buffer = readBuffer; c->xm_buffer = drawBuffer; - _mesa_make_current2(&(c->mesa), - &drawBuffer->mesa_buffer, - &readBuffer->mesa_buffer); + _mesa_make_current(&(c->mesa), + &drawBuffer->mesa_buffer, + &readBuffer->mesa_buffer); if (c->xm_visual->mesa_visual.rgbMode) { /* * Must recompute and set these pixel values because colormap * can be different for different windows. */ - c->clearpixel = xmesa_color_to_pixel( c, + c->clearpixel = xmesa_color_to_pixel( &c->mesa, c->clearcolor[0], c->clearcolor[1], c->clearcolor[2], c->clearcolor[3], c->xm_visual->undithered_pf); - XMesaSetForeground(c->display, c->xm_draw_buffer->cleargc, c->clearpixel); + XMesaSetForeground(c->display, drawBuffer->cleargc, c->clearpixel); } /* Solution to Stephane Rehel's problem with glXReleaseBuffersMESA(): */ - c->xm_draw_buffer->wasCurrent = GL_TRUE; + drawBuffer->wasCurrent = GL_TRUE; } else { /* Detach */ - _mesa_make_current2( NULL, NULL, NULL ); + _mesa_make_current( NULL, NULL, NULL ); } return GL_TRUE; } @@ -2125,8 +2122,8 @@ XMesaBuffer XMesaGetCurrentBuffer( void ) { GET_CURRENT_CONTEXT(ctx); if (ctx) { - XMesaContext xmesa = XMESA_CONTEXT(ctx); - return xmesa->xm_draw_buffer; + XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); + return xmbuf; } else { return 0; @@ -2139,8 +2136,7 @@ XMesaBuffer XMesaGetCurrentReadBuffer( void ) { GET_CURRENT_CONTEXT(ctx); if (ctx) { - XMesaContext xmesa = XMESA_CONTEXT(ctx); - return xmesa->xm_read_buffer; + return (XMesaBuffer) (ctx->ReadBuffer); } else { return 0; @@ -2152,11 +2148,11 @@ GLboolean XMesaForceCurrent(XMesaContext c) { if (c) { if (&(c->mesa) != _mesa_get_current_context()) { - _mesa_make_current(&(c->mesa), &c->xm_draw_buffer->mesa_buffer); + _mesa_make_current(&c->mesa, c->mesa.DrawBuffer, c->mesa.ReadBuffer); } } else { - _mesa_make_current(NULL, NULL); + _mesa_make_current(NULL, NULL, NULL); } return GL_TRUE; } @@ -2165,7 +2161,7 @@ GLboolean XMesaForceCurrent(XMesaContext c) GLboolean XMesaLoseCurrent(XMesaContext c) { (void) c; - _mesa_make_current(NULL, NULL); + _mesa_make_current(NULL, NULL, NULL); return GL_TRUE; } @@ -2193,17 +2189,17 @@ GLboolean XMesaSetFXmode( GLint mode ) * oh, this is sooo wrong: ctx above is * really an fxMesaContext, not an XMesaContext */ - XMesaContext xmesa = XMESA_CONTEXT(ctx); + XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); if (mode == XMESA_FX_WINDOW) { - if (xmesa->xm_draw_buffer->FXisHackUsable) { + if (xmbuf->FXisHackUsable) { FX_grSstControl(GR_CONTROL_DEACTIVATE); - xmesa->xm_draw_buffer->FXwindowHack = GL_TRUE; + xmbuf->FXwindowHack = GL_TRUE; return GL_TRUE; } } else if (mode == XMESA_FX_FULLSCREEN) { FX_grSstControl(GR_CONTROL_ACTIVATE); - xmesa->xm_draw_buffer->FXwindowHack = GL_FALSE; + xmbuf->FXwindowHack = GL_FALSE; return GL_TRUE; } else { @@ -2235,13 +2231,13 @@ static void FXgetImage( XMesaBuffer b ) XMesaContext xmesa = XMESA_CONTEXT(ctx); #ifdef XFree86Server - x = b->frontbuffer->x; - y = b->frontbuffer->y; - width = b->frontbuffer->width; - height = b->frontbuffer->height; - depth = b->frontbuffer->depth; + x = b->frontxrb->pixmap->x; + y = b->frontxrb->pixmap->y; + width = b->frontxrb->pixmap->width; + height = b->frontxrb->pixmap->height; + depth = b->frontxrb->pixmap->depth; #else - XGetGeometry( b->xm_visual->display, b->frontbuffer, + XGetGeometry( b->xm_visual->display, b->frontxrb->pixmap, &root, &xpos, &ypos, &width, &height, &bw, &depth); #endif if (b->mesa_buffer.Width != width || b->mesa_buffer.Height != height) { @@ -2249,29 +2245,29 @@ static void FXgetImage( XMesaBuffer b ) b->mesa_buffer.Height = MIN2((int)height, b->FXctx->height); if (b->mesa_buffer.Width & 1) b->mesa_buffer.Width--; /* prevent odd width */ - xmesa_alloc_back_buffer( b ); + xmesa_alloc_back_buffer(b, b->mesa_buffer.Width, b->mesa_buffer.Height); } /* [dBorca] we're always in the right GR_COLORFORMAT... aren't we? */ /* grLfbWriteColorFormat(GR_COLORFORMAT_ARGB); */ if (b->xm_visual->undithered_pf==PF_5R6G5B) { /* Special case: 16bpp RGB */ - grLfbReadRegion( GR_BUFFER_FRONTBUFFER, /* src buffer */ + grLfbReadRegion( GR_BUFFER_FRONTXRB->PIXMAP, /* src buffer */ 0, b->FXctx->height - b->mesa_buffer.Height, /*pos*/ b->mesa_buffer.Width, b->mesa_buffer.Height, /* size */ b->mesa_buffer.Width * sizeof(GLushort), /* stride */ - b->backimage->data); /* dest buffer */ + b->backxrb->ximage->data); /* dest buffer */ } else if (b->xm_visual->dithered_pf==PF_Dither && GET_VISUAL_DEPTH(b->xm_visual)==8) { /* Special case: 8bpp RGB */ for (y=0;ymesa_buffer.Height;y++) { - GLubyte *ptr = (GLubyte*) b->backimage->data - + b->backimage->bytes_per_line * y; + GLubyte *ptr = (GLubyte*) b->backxrb->ximage->data + + b->backxrb->ximage->bytes_per_line * y; XDITHER_SETUP(y); /* read row from 3Dfx frame buffer */ - grLfbReadRegion( GR_BUFFER_FRONTBUFFER, + grLfbReadRegion( GR_BUFFER_FRONTXRB->PIXMAP, 0, b->FXctx->height-(b->mesa_buffer.Height-y), b->mesa_buffer.Width, 1, 0, @@ -2290,7 +2286,7 @@ static void FXgetImage( XMesaBuffer b ) /* General case: slow! */ for (y=0;ymesa_buffer.Height;y++) { /* read row from 3Dfx frame buffer */ - grLfbReadRegion( GR_BUFFER_FRONTBUFFER, + grLfbReadRegion( GR_BUFFER_FRONTXRB->PIXMAP, 0, b->FXctx->height-(b->mesa_buffer.Height-y), b->mesa_buffer.Width, 1, 0, @@ -2298,8 +2294,8 @@ static void FXgetImage( XMesaBuffer b ) /* write to XImage back buffer */ for (x=0;xmesa_buffer.Width;x++) { - XMesaPutPixel(b->backimage,x,y, - xmesa_color_to_pixel(xmesa, + XMesaPutPixel(b->backxrb->ximage,x,y, + xmesa_color_to_pixel(&c->mesa, (pixbuf[x] & 0xf800) >> 8, (pixbuf[x] & 0x07e0) >> 3, (pixbuf[x] & 0x001f) << 3, @@ -2338,14 +2334,14 @@ void XMesaSwapBuffers( XMesaBuffer b ) return; } #endif - if (b->backimage) { + if (b->backxrb->ximage) { /* Copy Ximage from host's memory to server's window */ #if defined(USE_XSHM) && !defined(XFree86Server) if (b->shm) { /*_glthread_LOCK_MUTEX(_xmesa_lock);*/ - XShmPutImage( b->xm_visual->display, b->frontbuffer, + XShmPutImage( b->xm_visual->display, b->frontxrb->pixmap, b->swapgc, - b->backimage, 0, 0, + b->backxrb->ximage, 0, 0, 0, 0, b->mesa_buffer.Width, b->mesa_buffer.Height, False ); /*_glthread_UNLOCK_MUTEX(_xmesa_lock);*/ @@ -2354,9 +2350,9 @@ void XMesaSwapBuffers( XMesaBuffer b ) #endif { /*_glthread_LOCK_MUTEX(_xmesa_lock);*/ - XMesaPutImage( b->xm_visual->display, b->frontbuffer, + XMesaPutImage( b->xm_visual->display, b->frontxrb->pixmap, b->swapgc, - b->backimage, 0, 0, + b->backxrb->ximage, 0, 0, 0, 0, b->mesa_buffer.Width, b->mesa_buffer.Height ); /*_glthread_UNLOCK_MUTEX(_xmesa_lock);*/ } @@ -2365,8 +2361,8 @@ void XMesaSwapBuffers( XMesaBuffer b ) /* Copy pixmap to window on server */ /*_glthread_LOCK_MUTEX(_xmesa_lock);*/ XMesaCopyArea( b->xm_visual->display, - b->backpixmap, /* source drawable */ - b->frontbuffer, /* dest. drawable */ + b->backxrb->pixmap, /* source drawable */ + b->frontxrb->pixmap, /* dest. drawable */ b->swapgc, 0, 0, b->mesa_buffer.Width, b->mesa_buffer.Height, 0, 0 /* dest region */ @@ -2405,14 +2401,14 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height ) return; } #endif - if (b->backimage) { + if (b->backxrb->ximage) { /* Copy Ximage from host's memory to server's window */ #if defined(USE_XSHM) && !defined(XFree86Server) if (b->shm) { /* XXX assuming width and height aren't too large! */ - XShmPutImage( b->xm_visual->display, b->frontbuffer, + XShmPutImage( b->xm_visual->display, b->frontxrb->pixmap, b->swapgc, - b->backimage, x, yTop, + b->backxrb->ximage, x, yTop, x, yTop, width, height, False ); /* wait for finished event??? */ } @@ -2420,17 +2416,17 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height ) #endif { /* XXX assuming width and height aren't too large! */ - XMesaPutImage( b->xm_visual->display, b->frontbuffer, + XMesaPutImage( b->xm_visual->display, b->frontxrb->pixmap, b->swapgc, - b->backimage, x, yTop, + b->backxrb->ximage, x, yTop, x, yTop, width, height ); } } else { /* Copy pixmap to window on server */ XMesaCopyArea( b->xm_visual->display, - b->backpixmap, /* source drawable */ - b->frontbuffer, /* dest. drawable */ + b->backxrb->pixmap, /* source drawable */ + b->frontxrb->pixmap, /* dest. drawable */ b->swapgc, x, yTop, width, height, /* source region */ x, yTop /* dest region */ @@ -2454,8 +2450,8 @@ GLboolean XMesaGetBackBuffer( XMesaBuffer b, XMesaImage **ximage ) { if (b->db_state) { - if (pixmap) *pixmap = b->backpixmap; - if (ximage) *ximage = b->backimage; + if (pixmap) *pixmap = b->backxrb->pixmap; + if (ximage) *ximage = b->backxrb->ximage; return GL_TRUE; } else { @@ -2477,7 +2473,9 @@ GLboolean XMesaGetBackBuffer( XMesaBuffer b, GLboolean XMesaGetDepthBuffer( XMesaBuffer b, GLint *width, GLint *height, GLint *bytesPerValue, void **buffer ) { - if (!b->mesa_buffer.DepthBuffer) { + struct gl_renderbuffer *rb + = b->mesa_buffer.Attachment[BUFFER_DEPTH].Renderbuffer; + if (!rb || !rb->Data) { *width = 0; *height = 0; *bytesPerValue = 0; @@ -2489,7 +2487,7 @@ GLboolean XMesaGetDepthBuffer( XMesaBuffer b, GLint *width, GLint *height, *height = b->mesa_buffer.Height; *bytesPerValue = b->mesa_buffer.Visual.depthBits <= 16 ? sizeof(GLushort) : sizeof(GLuint); - *buffer = b->mesa_buffer.DepthBuffer; + *buffer = rb->Data; return GL_TRUE; } } @@ -2528,7 +2526,7 @@ XMesaBuffer XMesaFindBuffer( XMesaDisplay *dpy, XMesaDrawable d ) { XMesaBuffer b; for (b=XMesaBufferList; b; b=b->Next) { - if (b->frontbuffer==d && b->display==dpy) { + if (b->frontxrb->pixmap==d && b->display==dpy) { return b; } } @@ -2546,12 +2544,12 @@ void XMesaGarbageCollect( void ) XMesaBuffer b, next; for (b=XMesaBufferList; b; b=next) { next = b->Next; - if (b->display && b->frontbuffer && b->type == WINDOW) { + if (b->display && b->frontxrb->pixmap && b->type == WINDOW) { #ifdef XFree86Server /* NOT_NEEDED */ #else XSync(b->display, False); - if (!window_exists( b->display, b->frontbuffer )) { + if (!window_exists( b->display, b->frontxrb->pixmap )) { /* found a dead window, free the ancillary info */ XMesaDestroyBuffer( b ); } @@ -2574,6 +2572,7 @@ unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) { + GLcontext *ctx = &xmesa->mesa; GLint r = (GLint) (red * 255.0F); GLint g = (GLint) (green * 255.0F); GLint b = (GLint) (blue * 255.0F); @@ -2634,7 +2633,8 @@ unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y, */ void XMesaResizeBuffers( XMesaBuffer b ) { - xmesa_resize_buffers( &(b->mesa_buffer) ); - +#if OLD_RENDERBUFFER && 0 + xmesa_resize_buffers(ctx, &(b->mesa_buffer), 0, 0 ); +#endif } diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c new file mode 100644 index 00000000000..9f481aaba12 --- /dev/null +++ b/src/mesa/drivers/x11/xm_buffer.c @@ -0,0 +1,111 @@ +/* + * Mesa 3-D graphics library + * Version: 6.3 + * + * Copyright (C) 1999-2005 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. + */ + + +#include "glxheader.h" +#include "GL/xmesa.h" +#include "xmesaP.h" +#include "imports.h" +#include "renderbuffer.h" + + +static void +xmesa_delete_renderbuffer(struct gl_renderbuffer *rb) +{ + /* XXX this routine should really delete the attached ximage, etc. */ +} + + +/** + * Reallocate renderbuffer storage. + * This is called when the window's resized. It'll get called once for + * the front color renderbuffer and again for the back color renderbuffer. + */ +static GLboolean +xmesa_alloc_storage(GLcontext *ctx, struct gl_renderbuffer *rb, + GLenum internalFormat, GLuint width, GLuint height) +{ + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; + + if (xrb->ximage) { + /* Needed by PIXELADDR1 macro */ + xrb->width1 = xrb->ximage->bytes_per_line; + xrb->origin1 = (GLubyte *) xrb->ximage->data + xrb->width1 * (height - 1); + + /* Needed by PIXELADDR2 macro */ + xrb->width2 = xrb->ximage->bytes_per_line / 2; + xrb->origin2 = (GLushort *) xrb->ximage->data + xrb->width2 * (height - 1); + + /* Needed by PIXELADDR3 macro */ + xrb->width3 = xrb->ximage->bytes_per_line; + xrb->origin3 = (GLubyte *) xrb->ximage->data + xrb->width3 * (height - 1); + + /* Needed by PIXELADDR4 macro */ + xrb->width4 = xrb->ximage->width; + xrb->origin4 = (GLuint *) xrb->ximage->data + xrb->width4 * (height - 1); + } + else { + assert(xrb->pixmap); + } + + /* for the FLIP macro: */ + xrb->bottom = height - 1; + + rb->Width = width; + rb->Height = height; + rb->InternalFormat = internalFormat; + + return GL_TRUE; +} + + +struct xmesa_renderbuffer * +xmesa_new_renderbuffer(GLcontext *ctx, GLuint name, GLboolean rgbMode) +{ + struct xmesa_renderbuffer *xrb = CALLOC_STRUCT(xmesa_renderbuffer); + if (xrb) { + GLuint name = 0; + _mesa_init_renderbuffer(&xrb->Base, name); + + xrb->Base.Delete = xmesa_delete_renderbuffer; + xrb->Base.AllocStorage = xmesa_alloc_storage; + + if (rgbMode) { + xrb->Base.InternalFormat = GL_RGBA; + xrb->Base._BaseFormat = GL_RGBA; + xrb->Base.DataType = GL_UNSIGNED_BYTE; + } + else { + xrb->Base.InternalFormat = GL_COLOR_INDEX; + xrb->Base._BaseFormat = GL_COLOR_INDEX; + xrb->Base.DataType = GL_UNSIGNED_INT; + } + xrb->Base.ComponentSizes[0] = 0; /* XXX fix? */ + } + return xrb; +} + + + + diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index 0588694ace8..f9eb877db97 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -31,6 +31,7 @@ #include "depth.h" #include "drawpix.h" #include "extensions.h" +#include "framebuffer.h" #include "macros.h" #include "image.h" #include "imports.h" @@ -43,9 +44,7 @@ #include "xmesaP.h" #include "array_cache/acache.h" #include "swrast/swrast.h" -#include "swrast/s_auxbuffer.h" #include "swrast/s_context.h" -#include "swrast/s_alphabuf.h" #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" #include "tnl/t_context.h" @@ -106,8 +105,8 @@ get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) unsigned int winwidth, winheight; #ifdef XFree86Server /* XFree86 GLX renderer */ - winwidth = MIN2(xmBuffer->frontbuffer->width, MAX_WIDTH); - winheight = MIN2(xmBuffer->frontbuffer->height, MAX_HEIGHT); + winwidth = MIN2(xmBuffer->frontxrb->pixmap->width, MAX_WIDTH); + winheight = MIN2(xmBuffer->frontxrb->pixmap->height, MAX_HEIGHT); #else Window root; int winx, winy; @@ -115,7 +114,7 @@ get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) _glthread_LOCK_MUTEX(_xmesa_lock); XSync(xmBuffer->xm_visual->display, 0); /* added for Chromium */ - XGetGeometry( xmBuffer->xm_visual->display, xmBuffer->frontbuffer, &root, + XGetGeometry( xmBuffer->xm_visual->display, xmBuffer->frontxrb->pixmap, &root, &winx, &winy, &winwidth, &winheight, &bw, &d ); _glthread_UNLOCK_MUTEX(_xmesa_lock); #endif @@ -152,29 +151,36 @@ finish_or_flush( GLcontext *ctx ) void xmesa_set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit ) { +#if 000 /* We can make this cast since the XMesaBuffer wraps GLframebuffer. * GLframebuffer is the first member in a XMesaBuffer struct. */ XMesaBuffer target = (XMesaBuffer) buffer; const XMesaContext xmesa = XMESA_CONTEXT(ctx); +#if NEW_RENDERBUFFER + if (buffer->Name != 0) + return; +#endif + /* This assignment tells the span/point/line/triangle functions * which XMesaBuffer to use. */ - xmesa->xm_buffer = target; + /* xmesa->xm_buffer = target;*/ /* * Now determine front vs back color buffer. */ - if (bufferBit == DD_FRONT_LEFT_BIT) { - target->buffer = target->frontbuffer; + if (bufferBit == BUFFER_BIT_FRONT_LEFT) { + target->buffer = target->frontxrb->pixmap; + printf("set get/put!\n"); xmesa_update_span_funcs(ctx); } - else if (bufferBit == DD_BACK_LEFT_BIT) { + else if (bufferBit == BUFFER_BIT_BACK_LEFT) { ASSERT(target->db_state); - if (target->backpixmap) { + if (target->backxrb->pixmap) { /* back buffer is a pixmap */ - target->buffer = (XMesaDrawable) target->backpixmap; + target->buffer = (XMesaDrawable) target->backxrb->pixmap; } else if (target->backimage) { /* back buffer is an XImage */ @@ -182,17 +188,19 @@ xmesa_set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit ) } else { /* No back buffer!!!! Must be out of memory, use front buffer */ - target->buffer = target->frontbuffer; + target->buffer = target->frontxrb->pixmap; } + printf("set get/put!\n"); xmesa_update_span_funcs(ctx); } - else if (bufferBit & (DD_AUX0_BIT | DD_AUX1_BIT | DD_AUX2_BIT | DD_AUX3_BIT)) { - _swrast_use_aux_buffer(ctx, buffer, bufferBit); + else if (bufferBit & (BUFFER_BIT_AUX0 | BUFFER_BIT_AUX1 | BUFFER_BIT_AUX2 | BUFFER_BIT_AUX3)) { + /*_swrast_use_aux_buffer(ctx, buffer, bufferBit);*/ } else { _mesa_problem(ctx, "invalid buffer 0x%x in set_buffer() in xm_dd.c"); return; } +#endif } @@ -200,31 +208,37 @@ xmesa_set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit ) static void clear_index( GLcontext *ctx, GLuint index ) { - const XMesaContext xmesa = XMESA_CONTEXT(ctx); - xmesa->clearpixel = (unsigned long) index; - XMesaSetForeground( xmesa->display, xmesa->xm_draw_buffer->cleargc, - (unsigned long) index ); + if (ctx->DrawBuffer->Name == 0) { + const XMesaContext xmesa = XMESA_CONTEXT(ctx); + XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); + xmesa->clearpixel = (unsigned long) index; + XMesaSetForeground( xmesa->display, xmbuf->cleargc, (unsigned long) index ); + } } static void clear_color( GLcontext *ctx, const GLfloat color[4] ) { - const XMesaContext xmesa = XMESA_CONTEXT(ctx); - CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[0], color[0]); - CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[1], color[1]); - CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[2], color[2]); - CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[3], color[3]); - xmesa->clearpixel = xmesa_color_to_pixel( xmesa, - xmesa->clearcolor[0], - xmesa->clearcolor[1], - xmesa->clearcolor[2], - xmesa->clearcolor[3], - xmesa->xm_visual->undithered_pf ); - _glthread_LOCK_MUTEX(_xmesa_lock); - XMesaSetForeground( xmesa->display, xmesa->xm_draw_buffer->cleargc, - xmesa->clearpixel ); - _glthread_UNLOCK_MUTEX(_xmesa_lock); + if (ctx->DrawBuffer->Name == 0) { + const XMesaContext xmesa = XMESA_CONTEXT(ctx); + XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); + + CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[2], color[2]); + CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[3], color[3]); + xmesa->clearpixel = xmesa_color_to_pixel( ctx, + xmesa->clearcolor[0], + xmesa->clearcolor[1], + xmesa->clearcolor[2], + xmesa->clearcolor[3], + xmesa->xm_visual->undithered_pf ); + _glthread_LOCK_MUTEX(_xmesa_lock); + XMesaSetForeground( xmesa->display, xmbuf->cleargc, + xmesa->clearpixel ); + _glthread_UNLOCK_MUTEX(_xmesa_lock); + } } @@ -234,7 +248,9 @@ static void index_mask( GLcontext *ctx, GLuint mask ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); - if (xmesa->xm_draw_buffer->buffer != XIMAGE) { + XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); + /* not sure this conditional is really needed */ + if (xmbuf->backxrb && xmbuf->backxrb->pixmap) { unsigned long m; if (mask==0xffffffff) { m = ((unsigned long)~0L); @@ -242,8 +258,8 @@ index_mask( GLcontext *ctx, GLuint mask ) else { m = (unsigned long) mask; } - XMesaSetPlaneMask( xmesa->display, xmesa->xm_draw_buffer->cleargc, m ); - XMesaSetPlaneMask( xmesa->display, xmesa->xm_draw_buffer->gc, m ); + XMesaSetPlaneMask( xmesa->display, xmbuf->cleargc, m ); + XMesaSetPlaneMask( xmesa->display, xmbuf->gc, m ); } } @@ -254,6 +270,7 @@ color_mask(GLcontext *ctx, GLboolean rmask, GLboolean gmask, GLboolean bmask, GLboolean amask) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); const int xclass = xmesa->xm_visual->mesa_visual.visualType; (void) amask; @@ -268,8 +285,8 @@ color_mask(GLcontext *ctx, if (gmask) m |= GET_GREENMASK(xmesa->xm_visual); if (bmask) m |= GET_BLUEMASK(xmesa->xm_visual); } - XMesaSetPlaneMask( xmesa->display, xmesa->xm_draw_buffer->cleargc, m ); - XMesaSetPlaneMask( xmesa->display, xmesa->xm_draw_buffer->gc, m ); + XMesaSetPlaneMask( xmesa->display, xmbuf->cleargc, m ); + XMesaSetPlaneMask( xmesa->display, xmbuf->gc, m ); } } @@ -280,62 +297,45 @@ color_mask(GLcontext *ctx, /**********************************************************************/ +/** + * Clear the front or back color buffer, if it's implemented with a pixmap. + */ static void -clear_front_pixmap( GLcontext *ctx, GLboolean all, - GLint x, GLint y, GLint width, GLint height ) +clear_pixmap(GLcontext *ctx, struct xmesa_renderbuffer *xrb, GLboolean all, + GLint x, GLint y, GLint width, GLint height) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); - if (all) { - XMesaFillRectangle( xmesa->display, xmesa->xm_draw_buffer->frontbuffer, - xmesa->xm_draw_buffer->cleargc, - 0, 0, - xmesa->xm_draw_buffer->mesa_buffer.Width + 1, - xmesa->xm_draw_buffer->mesa_buffer.Height + 1 ); - } - else { - XMesaFillRectangle( xmesa->display, xmesa->xm_draw_buffer->frontbuffer, - xmesa->xm_draw_buffer->cleargc, - x, xmesa->xm_draw_buffer->mesa_buffer.Height - y - height, - width, height ); - } -} + XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); + assert(xrb->pixmap == xmbuf->backxrb->pixmap || + xrb->pixmap == xmbuf->frontxrb->pixmap); -static void -clear_back_pixmap( GLcontext *ctx, GLboolean all, - GLint x, GLint y, GLint width, GLint height ) -{ - const XMesaContext xmesa = XMESA_CONTEXT(ctx); if (all) { - XMesaFillRectangle( xmesa->display, xmesa->xm_draw_buffer->backpixmap, - xmesa->xm_draw_buffer->cleargc, - 0, 0, - xmesa->xm_draw_buffer->mesa_buffer.Width + 1, - xmesa->xm_draw_buffer->mesa_buffer.Height + 1 ); + XMesaFillRectangle( xmesa->display, xrb->pixmap, xmbuf->cleargc, + 0, 0, xrb->Base.Width + 1, xrb->Base.Height + 1 ); } else { - XMesaFillRectangle( xmesa->display, xmesa->xm_draw_buffer->backpixmap, - xmesa->xm_draw_buffer->cleargc, - x, xmesa->xm_draw_buffer->mesa_buffer.Height - y - height, + XMesaFillRectangle( xmesa->display, xrb->pixmap, xmbuf->cleargc, + x, xrb->Base.Height - y - height, width, height ); } } static void -clear_8bit_ximage( GLcontext *ctx, GLboolean all, - GLint x, GLint y, GLint width, GLint height ) +clear_8bit_ximage( GLcontext *ctx, struct xmesa_renderbuffer *xrb, + GLboolean all, GLint x, GLint y, GLint width, GLint height ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + if (all) { - size_t n = xmesa->xm_draw_buffer->backimage->bytes_per_line - * xmesa->xm_draw_buffer->backimage->height; - MEMSET( xmesa->xm_draw_buffer->backimage->data, xmesa->clearpixel, n ); + const size_t n = xrb->ximage->bytes_per_line * xrb->Base.Height; + MEMSET( xrb->ximage->data, xmesa->clearpixel, n ); } else { GLint i; for (i=0;ixm_draw_buffer, x, y+i ); + GLubyte *ptr = PIXEL_ADDR1(xrb, x, y + i); MEMSET( ptr, xmesa->clearpixel, width ); } } @@ -343,14 +343,15 @@ clear_8bit_ximage( GLcontext *ctx, GLboolean all, static void -clear_HPCR_ximage( GLcontext *ctx, GLboolean all, - GLint x, GLint y, GLint width, GLint height ) +clear_HPCR_ximage( GLcontext *ctx, struct xmesa_renderbuffer *xrb, + GLboolean all, GLint x, GLint y, GLint width, GLint height ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + if (all) { - GLint i, c16 = (xmesa->xm_draw_buffer->backimage->bytes_per_line>>4)<<4; - GLubyte *ptr = (GLubyte *)xmesa->xm_draw_buffer->backimage->data; - for (i=0; ixm_draw_buffer->backimage->height; i++) { + GLint i, c16 = (xrb->ximage->bytes_per_line>>4)<<4; + GLubyte *ptr = (GLubyte *) xrb->ximage->data; + for (i = 0; i < xrb->Base.Height; i++) { GLint j; GLubyte *sptr = xmesa->xm_visual->hpcr_clear_ximage_pattern[0]; if (i&1) { @@ -375,7 +376,7 @@ clear_HPCR_ximage( GLcontext *ctx, GLboolean all, ptr[15] = sptr[15]; ptr += 16; } - for (; jxm_draw_buffer->backimage->bytes_per_line; j++) { + for (; j < xrb->ximage->bytes_per_line; j++) { *ptr = sptr[j&15]; ptr++; } @@ -384,9 +385,9 @@ clear_HPCR_ximage( GLcontext *ctx, GLboolean all, else { GLint i; for (i=y; ixm_draw_buffer, x, i ); + GLubyte *ptr = PIXEL_ADDR1( xrb, x, i ); int j; - GLubyte *sptr = xmesa->xm_visual->hpcr_clear_ximage_pattern[0]; + const GLubyte *sptr = xmesa->xm_visual->hpcr_clear_ximage_pattern[0]; if (i&1) { sptr += 16; } @@ -400,41 +401,40 @@ clear_HPCR_ximage( GLcontext *ctx, GLboolean all, static void -clear_16bit_ximage( GLcontext *ctx, GLboolean all, - GLint x, GLint y, GLint width, GLint height ) +clear_16bit_ximage( GLcontext *ctx, struct xmesa_renderbuffer *xrb, + GLboolean all, GLint x, GLint y, GLint width, GLint height) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); register GLuint pixel = (GLuint) xmesa->clearpixel; + if (xmesa->swapbytes) { pixel = ((pixel >> 8) & 0x00ff) | ((pixel << 8) & 0xff00); } + if (all) { - register GLuint n; - register GLuint *ptr4 = (GLuint *) xmesa->xm_draw_buffer->backimage->data; + GLuint *ptr4 = (GLuint *) xrb->ximage->data; if ((pixel & 0xff) == ((pixel >> 8) & 0xff)) { /* low and high bytes are equal so use memset() */ - n = xmesa->xm_draw_buffer->backimage->bytes_per_line - * xmesa->xm_draw_buffer->mesa_buffer.Height; + const GLuint n = xrb->ximage->bytes_per_line * xrb->Base.Height; MEMSET( ptr4, pixel & 0xff, n ); } else { + const GLuint n = xrb->ximage->bytes_per_line * xrb->Base.Height / 4; + GLuint i; pixel = pixel | (pixel<<16); - n = xmesa->xm_draw_buffer->backimage->bytes_per_line - * xmesa->xm_draw_buffer->mesa_buffer.Height / 4; - do { - *ptr4++ = pixel; - n--; - } while (n!=0); - - if ((xmesa->xm_draw_buffer->backimage->bytes_per_line * - xmesa->xm_draw_buffer->mesa_buffer.Height) & 0x2) + for (i = 0; i < n; i++) { + ptr4[i] = pixel; + } + ptr4 += n; + /* might be one last GLushort to set */ + if ((xrb->ximage->bytes_per_line * xrb->Base.Height) & 0x2) *(GLushort *)ptr4 = pixel & 0xffff; } } else { - register int i, j; + GLint i, j; for (j=0;jxm_draw_buffer, x, y+j ); + GLushort *ptr2 = PIXEL_ADDR2(xrb, x, y + j); for (i=0;i */ static void -clear_24bit_ximage( GLcontext *ctx, GLboolean all, - GLint x, GLint y, GLint width, GLint height ) +clear_24bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb, + GLboolean all, GLint x, GLint y, GLint width, GLint height) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); const GLubyte r = xmesa->clearcolor[0]; const GLubyte g = xmesa->clearcolor[1]; const GLubyte b = xmesa->clearcolor[2]; -#if 0 /* See below */ - register GLuint clearPixel; - if (xmesa->swapbytes) { - clearPixel = (b << 16) | (g << 8) | r; - } - else { - clearPixel = (r << 16) | (g << 8) | b; - } -#endif if (all) { - if (r==g && g==b) { + if (r == g && g == b) { /* same value for all three components (gray) */ - const GLint w3 = xmesa->xm_draw_buffer->mesa_buffer.Width * 3; - const GLint h = xmesa->xm_draw_buffer->mesa_buffer.Height; + const GLint w3 = xrb->Base.Width * 3; + const GLint h = xrb->Base.Height; GLint i; for (i = 0; i < h; i++) { - bgr_t *ptr3 = PIXELADDR3(xmesa->xm_draw_buffer, 0, i); + bgr_t *ptr3 = PIXEL_ADDR3(xrb, 0, i); MEMSET(ptr3, r, w3); } } else { /* the usual case */ - const GLint w = xmesa->xm_draw_buffer->mesa_buffer.Width; - const GLint h = xmesa->xm_draw_buffer->mesa_buffer.Height; + const GLint w = xrb->Base.Width; + const GLint h = xrb->Base.Height; GLint i, j; for (i = 0; i < h; i++) { - bgr_t *ptr3 = PIXELADDR3(xmesa->xm_draw_buffer, 0, i); + bgr_t *ptr3 = PIXEL_ADDR3(xrb, 0, i); for (j = 0; j < w; j++) { ptr3->r = r; ptr3->g = g; @@ -487,83 +478,15 @@ clear_24bit_ximage( GLcontext *ctx, GLboolean all, ptr3++; } } -#if 0 /* this code doesn't work for all window widths */ - register GLuint *ptr4 = (GLuint *) ptr3; - register GLuint px; - GLuint pixel4[3]; - register GLuint *p = pixel4; - pixel4[0] = clearPixel | (clearPixel << 24); - pixel4[1] = (clearPixel << 16) | (clearPixel >> 8); - pixel4[2] = (clearPixel << 8) | (clearPixel >> 16); - switch (3 & (int)(ptr3 - (bgr_t*) ptr4)){ - case 0: - break; - case 1: - px = *ptr4 & 0x00ffffff; - px |= pixel4[0] & 0xff000000; - *ptr4++ = px; - px = *ptr4 & 0xffff0000; - px |= pixel4[2] & 0x0000ffff; - *ptr4 = px; - if (0 == --n) - break; - case 2: - px = *ptr4 & 0x0000fffff; - px |= pixel4[1] & 0xffff0000; - *ptr4++ = px; - px = *ptr4 & 0xffffff00; - px |= pixel4[2] & 0x000000ff; - *ptr4 = px; - if (0 == --n) - break; - case 3: - px = *ptr4 & 0x000000ff; - px |= pixel4[2] & 0xffffff00; - *ptr4++ = px; - --n; - break; - } - while (n > 3) { - p = pixel4; - *ptr4++ = *p++; - *ptr4++ = *p++; - *ptr4++ = *p++; - n -= 4; - } - switch (n) { - case 3: - p = pixel4; - *ptr4++ = *p++; - *ptr4++ = *p++; - px = *ptr4 & 0xffffff00; - px |= clearPixel & 0xff; - *ptr4 = px; - break; - case 2: - p = pixel4; - *ptr4++ = *p++; - px = *ptr4 & 0xffff0000; - px |= *p & 0xffff; - *ptr4 = px; - break; - case 1: - px = *ptr4 & 0xff000000; - px |= *p & 0xffffff; - *ptr4 = px; - break; - case 0: - break; - } -#endif } } else { /* only clear subrect of color buffer */ - if (r==g && g==b) { + if (r == g && g == b) { /* same value for all three components (gray) */ GLint j; for (j=0;jxm_draw_buffer, x, y+j ); + bgr_t *ptr3 = PIXEL_ADDR3(xrb, x, y + j); MEMSET(ptr3, r, 3 * width); } } @@ -571,7 +494,7 @@ clear_24bit_ximage( GLcontext *ctx, GLboolean all, /* non-gray clear color */ GLint i, j; for (j = 0; j < height; j++) { - bgr_t *ptr3 = PIXELADDR3( xmesa->xm_draw_buffer, x, y+j ); + bgr_t *ptr3 = PIXEL_ADDR3(xrb, x, y + j); for (i = 0; i < width; i++) { ptr3->r = r; ptr3->g = g; @@ -579,115 +502,43 @@ clear_24bit_ximage( GLcontext *ctx, GLboolean all, ptr3++; } } -#if 0 /* this code might not always (seems ptr3 always == ptr4) */ - GLint j; - GLuint pixel4[3]; - pixel4[0] = clearPixel | (clearPixel << 24); - pixel4[1] = (clearPixel << 16) | (clearPixel >> 8); - pixel4[2] = (clearPixel << 8) | (clearPixel >> 16); - for (j=0;jxm_draw_buffer, x, y+j ); - register GLuint *ptr4 = (GLuint *)ptr3; - register GLuint *p, px; - GLuint w = width; - switch (3 & (int)(ptr3 - (bgr_t*) ptr4)){ - case 0: - break; - case 1: - px = *ptr4 & 0x00ffffff; - px |= pixel4[0] & 0xff000000; - *ptr4++ = px; - px = *ptr4 & 0xffff0000; - px |= pixel4[2] & 0x0000ffff; - *ptr4 = px; - if (0 == --w) - break; - case 2: - px = *ptr4 & 0x0000fffff; - px |= pixel4[1] & 0xffff0000; - *ptr4++ = px; - px = *ptr4 & 0xffffff00; - px |= pixel4[2] & 0x000000ff; - *ptr4 = px; - if (0 == --w) - break; - case 3: - px = *ptr4 & 0x000000ff; - px |= pixel4[2] & 0xffffff00; - *ptr4++ = px; - --w; - break; - } - while (w > 3){ - p = pixel4; - *ptr4++ = *p++; - *ptr4++ = *p++; - *ptr4++ = *p++; - w -= 4; - } - switch (w) { - case 3: - p = pixel4; - *ptr4++ = *p++; - *ptr4++ = *p++; - px = *ptr4 & 0xffffff00; - px |= *p & 0xff; - *ptr4 = px; - break; - case 2: - p = pixel4; - *ptr4++ = *p++; - px = *ptr4 & 0xffff0000; - px |= *p & 0xffff; - *ptr4 = px; - break; - case 1: - px = *ptr4 & 0xff000000; - px |= pixel4[0] & 0xffffff; - *ptr4 = px; - break; - case 0: - break; - } - } -#endif } } } static void -clear_32bit_ximage( GLcontext *ctx, GLboolean all, - GLint x, GLint y, GLint width, GLint height ) +clear_32bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb, + GLboolean all, GLint x, GLint y, GLint width, GLint height) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); register GLuint pixel = (GLuint) xmesa->clearpixel; + if (xmesa->swapbytes) { pixel = ((pixel >> 24) & 0x000000ff) | ((pixel >> 8) & 0x0000ff00) | ((pixel << 8) & 0x00ff0000) | ((pixel << 24) & 0xff000000); } + if (all) { - register GLint n = xmesa->xm_draw_buffer->mesa_buffer.Width - * xmesa->xm_draw_buffer->mesa_buffer.Height; - register GLuint *ptr4 = (GLuint *) xmesa->xm_draw_buffer->backimage->data; - if (pixel==0) { - MEMSET( ptr4, pixel, 4*n ); + const GLuint n = xrb->Base.Width * xrb->Base.Height; + GLuint *ptr4 = (GLuint *) xrb->ximage->data; + if (pixel == 0) { + _mesa_memset(ptr4, pixel, 4 * n); } else { - do { - *ptr4++ = pixel; - n--; - } while (n!=0); + GLuint i; + for (i = 0; i < n; i++) + ptr4[i] = pixel; } } else { - register int i, j; - for (j=0;jxm_draw_buffer, x, y+j ); - for (i=0;ixm_draw_buffer->backimage; - register int i, j; + XMesaImage *img = xrb->ximage; + GLint i, j; /* We can ignore 'all' here - x, y, width, height are always right */ (void) all; /* TODO: optimize this */ - y = FLIP(xmesa->xm_draw_buffer, y); + y = YFLIP(xrb, y); for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { XMesaPutPixel(img, x+i, y-j, xmesa->clearpixel); @@ -720,78 +571,62 @@ static void clear_buffers( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ) { - const XMesaContext xmesa = XMESA_CONTEXT(ctx); - const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask; - - if ((mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) && - xmesa->xm_draw_buffer->mesa_buffer.UseSoftwareAlphaBuffers && - ctx->Color.ColorMask[ACOMP]) { - _swrast_clear_alpha_buffers(ctx); - } - - /* we can't handle color or index masking */ - if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) { - if (mask & DD_FRONT_LEFT_BIT) { - ASSERT(xmesa->xm_draw_buffer->front_clear_func); - (*xmesa->xm_draw_buffer->front_clear_func)( ctx, all, x, y, width, height ); - mask &= ~DD_FRONT_LEFT_BIT; - } - if (mask & DD_BACK_LEFT_BIT) { - ASSERT(xmesa->xm_draw_buffer->back_clear_func); - (*xmesa->xm_draw_buffer->back_clear_func)( ctx, all, x, y, width, height ); - mask &= ~DD_BACK_LEFT_BIT; + if (ctx->DrawBuffer->Name == 0) { + /* this is a window system framebuffer */ + const GLuint *colorMask = (GLuint *) &ctx->Color.ColorMask; + XMesaBuffer b = (XMesaBuffer) ctx->DrawBuffer; + + /* we can't handle color or index masking */ + if (*colorMask == 0xffffffff && ctx->Color.IndexMask == 0xffffffff) { + if (mask & BUFFER_BIT_FRONT_LEFT) { + /* clear front color buffer */ + if (b->frontxrb == (struct xmesa_renderbuffer *) + ctx->DrawBuffer->Attachment[BUFFER_FRONT_LEFT].Renderbuffer) { + /* renderbuffer is not wrapped - great! */ + b->frontxrb->clearFunc(ctx, b->frontxrb, all, x, y, + width, height); + mask &= ~BUFFER_BIT_FRONT_LEFT; + } + else { + /* we can't directly clear an alpha-wrapped color buffer */ + } + } + if (mask & BUFFER_BIT_BACK_LEFT) { + /* clear back color buffer */ + if (b->backxrb == (struct xmesa_renderbuffer *) + ctx->DrawBuffer->Attachment[BUFFER_BACK_LEFT].Renderbuffer) { + /* renderbuffer is not wrapped - great! */ + b->backxrb->clearFunc(ctx, b->backxrb, all, x, y, + width, height); + mask &= ~BUFFER_BIT_BACK_LEFT; + } + } } } - if (mask) _swrast_Clear( ctx, mask, all, x, y, width, height ); } -/* - * When we detect that the user has resized the window this function will - * get called. Here we'll reallocate the back buffer, depth buffer, - * stencil buffer etc. to match the new window size. - * The buffer->Width and buffer->Height values will indicate the new size. +/** + * Called by ctx->Driver.ResizeBuffers() + * Resize the front/back colorbuffers to match the latest window size. */ void -xmesa_resize_buffers( GLframebuffer *buffer ) +xmesa_resize_buffers(GLcontext *ctx, GLframebuffer *buffer, + GLuint width, GLuint height) { - int height = (int) buffer->Height; /* We can do this cast because the first field in the XMesaBuffer * struct is a GLframebuffer struct. If this weren't true, we'd * need a pointer from the GLframebuffer to the XMesaBuffer. */ XMesaBuffer xmBuffer = (XMesaBuffer) buffer; - xmesa_alloc_back_buffer( xmBuffer ); - - /* Needed by FLIP macro */ - xmBuffer->bottom = height - 1; + xmesa_alloc_back_buffer(xmBuffer, width, height); - if (xmBuffer->backimage) { - /* Needed by PIXELADDR1 macro */ - xmBuffer->ximage_width1 = xmBuffer->backimage->bytes_per_line; - xmBuffer->ximage_origin1 = (GLubyte *) xmBuffer->backimage->data - + xmBuffer->ximage_width1 * (height-1); - - /* Needed by PIXELADDR2 macro */ - xmBuffer->ximage_width2 = xmBuffer->backimage->bytes_per_line / 2; - xmBuffer->ximage_origin2 = (GLushort *) xmBuffer->backimage->data - + xmBuffer->ximage_width2 * (height-1); - - /* Needed by PIXELADDR3 macro */ - xmBuffer->ximage_width3 = xmBuffer->backimage->bytes_per_line; - xmBuffer->ximage_origin3 = (GLubyte *) xmBuffer->backimage->data - + xmBuffer->ximage_width3 * (height-1); - - /* Needed by PIXELADDR4 macro */ - xmBuffer->ximage_width4 = xmBuffer->backimage->width; - xmBuffer->ximage_origin4 = (GLuint *) xmBuffer->backimage->data - + xmBuffer->ximage_width4 * (height-1); - } - - _swrast_alloc_buffers( buffer ); +#if NEW_RENDERBUFFER + _mesa_resize_framebuffer(ctx, buffer, width, height); +#endif } @@ -810,11 +645,14 @@ xmesa_DrawPixels_8R8G8B( GLcontext *ctx, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels ) { + struct xmesa_renderbuffer *xrb + = (struct xmesa_renderbuffer *) ctx->DrawBuffer->_ColorDrawBuffers[0][0]; + const XMesaContext xmesa = XMESA_CONTEXT(ctx); const SWcontext *swrast = SWRAST_CONTEXT( ctx ); XMesaDisplay *dpy = xmesa->xm_visual->display; - const XMesaDrawable buffer = xmesa->xm_draw_buffer->buffer; - const XMesaGC gc = xmesa->xm_draw_buffer->gc; + XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); + const XMesaGC gc = xmbuf->gc; ASSERT(dpy); ASSERT(gc); @@ -824,7 +662,7 @@ xmesa_DrawPixels_8R8G8B( GLcontext *ctx, if (swrast->NewState) _swrast_validate_derived( ctx ); - if (buffer && /* buffer != 0 means it's a Window or Pixmap */ + if (xrb->pixmap && format == GL_BGRA && type == GL_UNSIGNED_BYTE && (swrast->_RasterMask & ~CLIP_BIT) == 0 && /* no blend, z-test, etc */ @@ -882,8 +720,8 @@ xmesa_DrawPixels_8R8G8B( GLcontext *ctx, ximage.bits_per_pixel = 32; /* it seems we don't need to set the ximage.red/green/blue_mask fields */ /* flip Y axis for dest position */ - dstY = FLIP(xmesa->xm_draw_buffer, dstY) - h + 1; - XPutImage(dpy, buffer, gc, &ximage, 0, 0, dstX, dstY, w, h); + dstY = YFLIP(xrb, dstY) - h + 1; + XPutImage(dpy, xrb->pixmap, gc, &ximage, 0, 0, dstX, dstY, w, h); } if (unpack->BufferObj->Name) { @@ -913,11 +751,13 @@ xmesa_DrawPixels_5R6G5B( GLcontext *ctx, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels ) { + struct xmesa_renderbuffer *xrb + = (struct xmesa_renderbuffer *) ctx->DrawBuffer->_ColorDrawBuffers[0][0]; const XMesaContext xmesa = XMESA_CONTEXT(ctx); const SWcontext *swrast = SWRAST_CONTEXT( ctx ); XMesaDisplay *dpy = xmesa->xm_visual->display; - const XMesaDrawable buffer = xmesa->xm_draw_buffer->buffer; - const XMesaGC gc = xmesa->xm_draw_buffer->gc; + XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); + const XMesaGC gc = xmbuf->gc; ASSERT(dpy); ASSERT(gc); @@ -926,7 +766,7 @@ xmesa_DrawPixels_5R6G5B( GLcontext *ctx, if (swrast->NewState) _swrast_validate_derived( ctx ); - if (buffer && /* buffer != 0 means it's a Window or Pixmap */ + if (xrb->pixmap && format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 && !ctx->Color.DitherFlag && /* no dithering */ @@ -985,8 +825,8 @@ xmesa_DrawPixels_5R6G5B( GLcontext *ctx, ximage.bits_per_pixel = 16; /* it seems we don't need to set the ximage.red/green/blue_mask fields */ /* flip Y axis for dest position */ - dstY = FLIP(xmesa->xm_draw_buffer, dstY) - h + 1; - XPutImage(dpy, buffer, gc, &ximage, 0, 0, dstX, dstY, w, h); + dstY = YFLIP(xrb, dstY) - h + 1; + XPutImage(dpy, xrb->pixmap, gc, &ximage, 0, 0, dstX, dstY, w, h); } if (unpack->BufferObj->Name) { @@ -1016,9 +856,11 @@ xmesa_CopyPixels( GLcontext *ctx, const XMesaContext xmesa = XMESA_CONTEXT(ctx); const SWcontext *swrast = SWRAST_CONTEXT( ctx ); XMesaDisplay *dpy = xmesa->xm_visual->display; - const XMesaDrawable drawBuffer = xmesa->xm_draw_buffer->buffer; - const XMesaDrawable readBuffer = xmesa->xm_read_buffer->buffer; - const XMesaGC gc = xmesa->xm_draw_buffer->gc; + const XMesaGC gc = ((XMesaBuffer) ctx->DrawBuffer)->gc; + struct xmesa_renderbuffer *srcXrb = (struct xmesa_renderbuffer *) + ctx->ReadBuffer->_ColorReadBuffer; + struct xmesa_renderbuffer *dstXrb = (struct xmesa_renderbuffer *) + ctx->DrawBuffer->_ColorDrawBuffers[0][0]; ASSERT(dpy); ASSERT(gc); @@ -1028,8 +870,8 @@ xmesa_CopyPixels( GLcontext *ctx, if (ctx->Color.DrawBuffer[0] == GL_FRONT && ctx->Pixel.ReadBuffer == GL_FRONT && - drawBuffer && /* buffer != 0 means it's a Window or Pixmap */ - readBuffer && + srcXrb->pixmap && + dstXrb->pixmap && type == GL_COLOR && (swrast->_RasterMask & ~CLIP_BIT) == 0 && /* no blend, z-test, etc */ ctx->_ImageTransferState == 0 && /* no color tables, scale/bias, etc */ @@ -1038,9 +880,9 @@ xmesa_CopyPixels( GLcontext *ctx, /* Note: we don't do any special clipping work here. We could, * but X will do it for us. */ - srcy = FLIP(xmesa->xm_read_buffer, srcy) - height + 1; - desty = FLIP(xmesa->xm_draw_buffer, desty) - height + 1; - XCopyArea(dpy, readBuffer, drawBuffer, gc, + srcy = YFLIP(srcXrb, srcy) - height + 1; + desty = YFLIP(dstXrb, desty) - height + 1; + XCopyArea(dpy, srcXrb->pixmap, dstXrb->pixmap, gc, srcx, srcy, width, height, destx, desty); } else { @@ -1100,9 +942,89 @@ enable( GLcontext *ctx, GLenum pname, GLboolean state ) } -void xmesa_update_state( GLcontext *ctx, GLuint new_state ) +static void +clear_color_HPCR_ximage( GLcontext *ctx, const GLfloat color[4] ) +{ + int i; + const XMesaContext xmesa = XMESA_CONTEXT(ctx); + + CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[2], color[2]); + CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[3], color[3]); + + if (color[0] == 0.0 && color[1] == 0.0 && color[2] == 0.0) { + /* black is black */ + MEMSET( xmesa->xm_visual->hpcr_clear_ximage_pattern, 0x0 , + sizeof(xmesa->xm_visual->hpcr_clear_ximage_pattern)); + } + else { + /* build clear pattern */ + for (i=0; i<16; i++) { + xmesa->xm_visual->hpcr_clear_ximage_pattern[0][i] = + DITHER_HPCR(i, 0, + xmesa->clearcolor[0], + xmesa->clearcolor[1], + xmesa->clearcolor[2]); + xmesa->xm_visual->hpcr_clear_ximage_pattern[1][i] = + DITHER_HPCR(i, 1, + xmesa->clearcolor[0], + xmesa->clearcolor[1], + xmesa->clearcolor[2]); + } + } +} + + +static void +clear_color_HPCR_pixmap( GLcontext *ctx, const GLfloat color[4] ) +{ + int i; + const XMesaContext xmesa = XMESA_CONTEXT(ctx); + + CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[2], color[2]); + CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[3], color[3]); + + if (color[0] == 0.0 && color[1] == 0.0 && color[2] == 0.0) { + /* black is black */ + for (i=0; i<16; i++) { + XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 0, 0); + XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 1, 0); + } + } + else { + for (i=0; i<16; i++) { + XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 0, + DITHER_HPCR(i, 0, + xmesa->clearcolor[0], + xmesa->clearcolor[1], + xmesa->clearcolor[2])); + XMesaPutPixel(xmesa->xm_visual->hpcr_clear_ximage, i, 1, + DITHER_HPCR(i, 1, + xmesa->clearcolor[0], + xmesa->clearcolor[1], + xmesa->clearcolor[2])); + } + } + /* change tile pixmap content */ + XMesaPutImage(xmesa->display, + (XMesaDrawable)xmesa->xm_visual->hpcr_clear_pixmap, + XMESA_BUFFER(ctx->DrawBuffer)->cleargc, + xmesa->xm_visual->hpcr_clear_ximage, 0, 0, 0, 0, 16, 2); +} + + +/** + * Called when the driver should update it's state, based on the new_state + * flags. + */ +void +xmesa_update_state( GLcontext *ctx, GLuint new_state ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *front_xrb, *back_xrb; /* Propagate statechange information to swrast and swrast_setup * modules. The X11 driver has no internal GL-dependent state. @@ -1112,40 +1034,76 @@ void xmesa_update_state( GLcontext *ctx, GLuint new_state ) _tnl_InvalidateState( ctx, new_state ); _swsetup_InvalidateState( ctx, new_state ); + if (ctx->DrawBuffer->Name != 0) + return; - /* setup pointers to front and back buffer clear functions */ - xmesa->xm_draw_buffer->front_clear_func = clear_front_pixmap; - if (xmesa->xm_draw_buffer->backpixmap != XIMAGE) { - xmesa->xm_draw_buffer->back_clear_func = clear_back_pixmap; + front_xrb = XMESA_BUFFER(ctx->DrawBuffer)->frontxrb; + if (front_xrb) { + /* XXX check for relevant new_state flags */ + xmesa_set_renderbuffer_funcs(front_xrb, xmesa->pixelformat, + xmesa->xm_visual->BitsPerPixel); + /* setup pointers to front and back buffer clear functions */ + front_xrb->clearFunc = clear_pixmap; } - else { - switch (xmesa->xm_visual->BitsPerPixel) { - case 8: - if (xmesa->xm_visual->hpcr_clear_flag) { - xmesa->xm_draw_buffer->back_clear_func = clear_HPCR_ximage; - } - else { - xmesa->xm_draw_buffer->back_clear_func = clear_8bit_ximage; + + back_xrb = XMESA_BUFFER(ctx->DrawBuffer)->backxrb; + if (back_xrb) { + XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); + + /* XXX check for relevant new_state flags */ + xmesa_set_renderbuffer_funcs(back_xrb, xmesa->pixelformat, + xmesa->xm_visual->BitsPerPixel); + + if (xmbuf->backxrb->pixmap) { + back_xrb->clearFunc = clear_pixmap; + } + else { + switch (xmesa->xm_visual->BitsPerPixel) { + case 8: + if (xmesa->xm_visual->hpcr_clear_flag) { + back_xrb->clearFunc = clear_HPCR_ximage; + } + else { + back_xrb->clearFunc = clear_8bit_ximage; + } + break; + case 16: + back_xrb->clearFunc = clear_16bit_ximage; + break; + case 24: + back_xrb->clearFunc = clear_24bit_ximage; + break; + case 32: + back_xrb->clearFunc = clear_32bit_ximage; + break; + default: + back_xrb->clearFunc = clear_nbit_ximage; + break; } - break; - case 16: - xmesa->xm_draw_buffer->back_clear_func = clear_16bit_ximage; - break; - case 24: - xmesa->xm_draw_buffer->back_clear_func = clear_24bit_ximage; - break; - case 32: - xmesa->xm_draw_buffer->back_clear_func = clear_32bit_ximage; - break; - default: - xmesa->xm_draw_buffer->back_clear_func = clear_nbit_ximage; - break; } } - if (ctx->Color._DrawDestMask[0] & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) { +#if OLD_RENDERBUFFER && 0 + if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) { xmesa_update_span_funcs(ctx); } +#endif + + if (xmesa->xm_visual->hpcr_clear_flag) { + /* this depends on whether we're drawing to the front or back buffer */ + /* XXX FIX THIS! */ +#if 0 + if (pixmap) { + ctx->Driver.ClearColor = clear_color_HPCR_pixmap; + } + else { + ctx->Driver.ClearColor = clear_color_HPCR_ximage; + } +#else + (void) clear_color_HPCR_pixmap; + (void) clear_color_HPCR_ximage; +#endif + } } @@ -1208,17 +1166,36 @@ choose_tex_format( GLcontext *ctx, GLint internalFormat, /** * Called by glViewport. * This is a good time for us to poll the current X window size and adjust - * our ancillary (back color, depth, stencil, etc) buffers to match the - * current window size. Remember, we have no opportunity to respond to - * conventional X Resize/StructureNotify events since the X driver has no - * event loop. Thus, we poll. + * our renderbuffers to match the current window size. + * Remember, we have no opportunity to respond to conventional + * X Resize/StructureNotify events since the X driver has no event loop. + * Thus, we poll. * Note that this trick isn't fool-proof. If the application never calls * glViewport, our notion of the current window size may be incorrect. */ static void xmesa_viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) { +#if 1 + struct gl_framebuffer *fb = ctx->WinSysDrawBuffer; + GLuint newWidth, newHeight; + + /* + printf("%s before %d x %d\n", __FUNCTION__, fb->Width, fb->Height); + */ + + get_buffer_size(fb, &newWidth, &newHeight); + if (newWidth != fb->Width || newHeight != fb->Height) { + xmesa_resize_buffers(ctx, fb, newWidth, newHeight); + ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */ + } + /* + printf("%s after %d x %d\n", __FUNCTION__, fb->Width, fb->Height); + */ +#else + /* This also works: */ _mesa_ResizeBuffersMESA(); +#endif } diff --git a/src/mesa/drivers/x11/xm_line.c b/src/mesa/drivers/x11/xm_line.c index 24e09ce344f..43de9a98ab7 100644 --- a/src/mesa/drivers/x11/xm_line.c +++ b/src/mesa/drivers/x11/xm_line.c @@ -70,7 +70,7 @@ static void draw_points_ANY_pixmap( GLcontext *ctx, const SWvertex *vert ) xmesa->pixelformat); XMesaSetForeground( dpy, gc, pixel ); x = (GLint) vert->win[0]; - y = FLIP( xmesa->xm_buffer, (GLint) vert->win[1] ); + y = YFLIP( xrb, (GLint) vert->win[1] ); XMesaDrawPoint( dpy, buffer, gc, x, y); } else { @@ -78,7 +78,7 @@ static void draw_points_ANY_pixmap( GLcontext *ctx, const SWvertex *vert ) register int x, y; XMesaSetForeground( dpy, gc, vert->index ); x = (GLint) vert->win[0]; - y = FLIP( xmesa->xm_buffer, (GLint) vert->win[1] ); + y = YFLIP( xrb, (GLint) vert->win[1] ); XMesaDrawPoint( dpy, buffer, gc, x, y); } } @@ -117,18 +117,22 @@ void xmesa_choose_point( GLcontext *ctx ) /**********************************************************************/ +#define GET_XRB(XRB) struct xmesa_renderbuffer *XRB = \ + (struct xmesa_renderbuffer *) ctx->DrawBuffer->_ColorDrawBuffers[0][0] + + /* * Draw a flat-shaded, PF_TRUECOLOR line into an XImage. */ #define NAME flat_TRUECOLOR_line #define SETUP_CODE \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = vert1->color; \ - XMesaImage *img = xmesa->xm_buffer->backimage; \ unsigned long pixel; \ PACK_TRUECOLOR( pixel, color[0], color[1], color[2] ); #define CLIP_HACK 1 -#define PLOT(X,Y) XMesaPutPixel( img, X, FLIP(xmesa->xm_buffer, Y), pixel ); +#define PLOT(X,Y) XMesaPutPixel(xrb->ximage, X, YFLIP(xrb, Y), pixel ); #include "swrast/s_linetemp.h" @@ -138,12 +142,12 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_8A8B8G8R_line #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = vert1->color; \ GLuint pixel = PACK_8B8G8R( color[0], color[1], color[2] ); #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y) #define CLIP_HACK 1 #define PLOT(X,Y) *pixelPtr = pixel; #include "swrast/s_linetemp.h" @@ -155,12 +159,12 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_8A8R8G8B_line #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = vert1->color; \ GLuint pixel = PACK_8R8G8B( color[0], color[1], color[2] ); #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y) #define CLIP_HACK 1 #define PLOT(X,Y) *pixelPtr = pixel; #include "swrast/s_linetemp.h" @@ -172,12 +176,12 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_8R8G8B_line #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = vert1->color; \ GLuint pixel = PACK_8R8G8B( color[0], color[1], color[2] ); #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y) #define CLIP_HACK 1 #define PLOT(X,Y) *pixelPtr = pixel; #include "swrast/s_linetemp.h" @@ -189,11 +193,11 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_8R8G8B24_line #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = vert1->color; #define PIXEL_TYPE bgr_t -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR3(xrb, X, Y) #define CLIP_HACK 1 #define PLOT(X,Y) { \ pixelPtr->r = color[RCOMP]; \ @@ -209,12 +213,12 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_5R6G5B_line #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = vert1->color; \ GLushort pixel = PACK_5R6G5B( color[0], color[1], color[2] ); #define PIXEL_TYPE GLushort -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR2(xrb, X, Y) #define CLIP_HACK 1 #define PLOT(X,Y) *pixelPtr = pixel; #include "swrast/s_linetemp.h" @@ -226,11 +230,12 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_DITHER_5R6G5B_line #define SETUP_CODE \ + GET_XRB(xrb); \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ const GLubyte *color = vert1->color; #define PIXEL_TYPE GLushort -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR2(xrb, X, Y) #define CLIP_HACK 1 #define PLOT(X,Y) PACK_TRUEDITHER( *pixelPtr, X, Y, color[0], color[1], color[2] ); #include "swrast/s_linetemp.h" @@ -243,13 +248,13 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_DITHER8_line #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = vert1->color; \ GLint r = color[0], g = color[1], b = color[2]; \ DITHER_SETUP; #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X, Y) #define CLIP_HACK 1 #define PLOT(X,Y) *pixelPtr = DITHER(X,Y,r,g,b); #include "swrast/s_linetemp.h" @@ -261,14 +266,14 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_LOOKUP8_line #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = vert1->color; \ GLubyte pixel; \ LOOKUP_SETUP; \ pixel = (GLubyte) LOOKUP( color[0], color[1], color[2] ); #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X,Y) #define CLIP_HACK 1 #define PLOT(X,Y) *pixelPtr = pixel; #include "swrast/s_linetemp.h" @@ -280,12 +285,13 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_HPCR_line #define SETUP_CODE \ + GET_XRB(xrb); \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ const GLubyte *color = vert1->color; \ GLint r = color[0], g = color[1], b = color[2]; #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X,Y) #define CLIP_HACK 1 #define PLOT(X,Y) *pixelPtr = (GLubyte) DITHER_HPCR(X,Y,r,g,b); #include "swrast/s_linetemp.h" @@ -298,9 +304,9 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_TRUECOLOR_z_line #define SETUP_CODE \ + GET_XRB(xrb); \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ const GLubyte *color = vert1->color; \ - XMesaImage *img = xmesa->xm_buffer->backimage; \ unsigned long pixel; \ PACK_TRUECOLOR( pixel, color[0], color[1], color[2] ); #define INTERP_Z 1 @@ -309,7 +315,7 @@ void xmesa_choose_point( GLcontext *ctx ) #define PLOT(X,Y) \ if (Z < *zPtr) { \ *zPtr = Z; \ - XMesaPutPixel( img, X, FLIP(xmesa->xm_buffer, Y), pixel ); \ + XMesaPutPixel(xrb->ximage, X, YFLIP(xrb, Y), pixel); \ } #include "swrast/s_linetemp.h" @@ -320,14 +326,14 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_8A8B8G8R_z_line #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = vert1->color; \ GLuint pixel = PACK_8B8G8R( color[0], color[1], color[2] ); #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X,Y) #define CLIP_HACK 1 #define PLOT(X,Y) \ if (Z < *zPtr) { \ @@ -343,14 +349,14 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_8A8R8G8B_z_line #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = vert1->color; \ GLuint pixel = PACK_8R8G8B( color[0], color[1], color[2] ); #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X,Y) #define CLIP_HACK 1 #define PLOT(X,Y) \ if (Z < *zPtr) { \ @@ -366,14 +372,14 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_8R8G8B_z_line #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = vert1->color; \ GLuint pixel = PACK_8R8G8B( color[0], color[1], color[2] ); #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X,Y) #define CLIP_HACK 1 #define PLOT(X,Y) \ if (Z < *zPtr) { \ @@ -389,13 +395,13 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_8R8G8B24_z_line #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = vert1->color; #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define PIXEL_TYPE bgr_t -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR3(xrb, X,Y) #define CLIP_HACK 1 #define PLOT(X,Y) \ if (Z < *zPtr) { \ @@ -413,14 +419,14 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_5R6G5B_z_line #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = vert1->color; \ GLushort pixel = PACK_5R6G5B( color[0], color[1], color[2] ); #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define PIXEL_TYPE GLushort -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR2(xrb, X,Y) #define CLIP_HACK 1 #define PLOT(X,Y) \ if (Z < *zPtr) { \ @@ -436,13 +442,14 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_DITHER_5R6G5B_z_line #define SETUP_CODE \ + GET_XRB(xrb); \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ const GLubyte *color = vert1->color; #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define PIXEL_TYPE GLushort -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR2(xrb, X,Y) #define CLIP_HACK 1 #define PLOT(X,Y) \ if (Z < *zPtr) { \ @@ -458,15 +465,15 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_DITHER8_z_line #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = vert1->color; \ GLint r = color[0], g = color[1], b = color[2]; \ DITHER_SETUP; #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X,Y) #define CLIP_HACK 1 #define PLOT(X,Y) \ if (Z < *zPtr) { \ @@ -482,7 +489,7 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_LOOKUP8_z_line #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = vert1->color; \ GLubyte pixel; \ LOOKUP_SETUP; \ @@ -490,8 +497,8 @@ void xmesa_choose_point( GLcontext *ctx ) #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X,Y) #define CLIP_HACK 1 #define PLOT(X,Y) \ if (Z < *zPtr) { \ @@ -507,14 +514,15 @@ void xmesa_choose_point( GLcontext *ctx ) */ #define NAME flat_HPCR_z_line #define SETUP_CODE \ + GET_XRB(xrb); \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ const GLubyte *color = vert1->color; \ GLint r = color[0], g = color[1], b = color[2]; #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X,Y) #define CLIP_HACK 1 #define PLOT(X,Y) \ if (Z < *zPtr) { \ @@ -530,8 +538,11 @@ static swrast_line_func get_line_func( GLcontext *ctx ) XMesaContext xmesa = XMESA_CONTEXT(ctx); SWcontext *swrast = SWRAST_CONTEXT(ctx); int depth = GET_VISUAL_DEPTH(xmesa->xm_visual); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) + ctx->DrawBuffer->_ColorDrawBuffers[0][0]; - if ((ctx->Color._DrawDestMask[0] & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) ==0) + if ((ctx->DrawBuffer->_ColorDrawBufferMask[0] + & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) == 0) return (swrast_line_func) NULL; if (ctx->RenderMode != GL_RENDER) return (swrast_line_func) NULL; if (ctx->Line.SmoothFlag) return (swrast_line_func) NULL; @@ -540,7 +551,7 @@ static swrast_line_func get_line_func( GLcontext *ctx ) if (ctx->Line.StippleFlag) return (swrast_line_func) NULL; if (swrast->_RasterMask & MULTI_DRAW_BIT) return (swrast_line_func) NULL; - if (xmesa->xm_buffer->buffer==XIMAGE + if (xrb->ximage && swrast->_RasterMask==DEPTH_BIT && ctx->Depth.Func==GL_LESS && ctx->Depth.Mask==GL_TRUE @@ -571,7 +582,7 @@ static swrast_line_func get_line_func( GLcontext *ctx ) return (swrast_line_func)NULL; } } - if (xmesa->xm_buffer->buffer==XIMAGE + if (xrb->ximage && swrast->_RasterMask==0 && ctx->Line.Width==1.0F) { switch (xmesa->pixelformat) { diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c index b3b5970bdf9..88dbb0d0b30 100644 --- a/src/mesa/drivers/x11/xm_span.c +++ b/src/mesa/drivers/x11/xm_span.c @@ -164,10 +164,12 @@ static unsigned long read_pixel( XMesaDisplay *dpy, #define RGBA_SPAN_ARGS const GLcontext *ctx, \ + struct gl_renderbuffer *rb, \ GLuint n, GLint x, GLint y, \ CONST GLubyte rgba[][4], const GLubyte mask[] #define RGB_SPAN_ARGS const GLcontext *ctx, \ + struct gl_renderbuffer *rb, \ GLuint n, GLint x, GLint y, \ CONST GLubyte rgb[][3], const GLubyte mask[] @@ -181,12 +183,13 @@ static unsigned long read_pixel( XMesaDisplay *dpy, static void write_span_TRUECOLOR_pixmap( RGBA_SPAN_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { register GLuint i; for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { register GLuint i; for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; XDITHER_SETUP(y); - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; XDITHER_SETUP(y); - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; SETUP_1BIT; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; SETUP_1BIT; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; LOOKUP_SETUP; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; LOOKUP_SETUP; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_buffer->backimage; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_buffer->backimage; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_buffer->backimage; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_buffer->backimage; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLuint *ptr = PIXEL_ADDR4(xrb, x, y); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLuint *ptr = PIXEL_ADDR4(xrb, x, y); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLuint *ptr = PIXEL_ADDR4(xrb, x, y); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLuint *ptr = PIXEL_ADDR4(xrb, x, y); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLuint *ptr = PIXEL_ADDR4(xrb, x, y); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLubyte *ptr = (GLubyte *) PIXEL_ADDR3(xrb, x, y ); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLuint *ptr = PIXEL_ADDR4(xrb, x, y); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLubyte *ptr = (GLubyte *) PIXEL_ADDR3(xrb, x, y); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLushort *ptr = PIXEL_ADDR2(xrb, x, y); if (mask) { for (i=0;ixm_buffer, x, y ); - const GLint y2 = FLIP(xmesa->xm_buffer, y); + register GLushort *ptr = PIXEL_ADDR2(xrb, x, y); + const GLint y2 = YFLIP(xrb, y); + ASSERT(xrb->ximage); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLushort *ptr = PIXEL_ADDR2(xrb, x, y); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLushort *ptr = PIXEL_ADDR2(xrb, x, y ); if (mask) { for (i=0;ixm_buffer->backimage; register GLuint i; - int yy = FLIP(xmesa->xm_buffer, y); + int yy = YFLIP(xrb, y); XDITHER_SETUP(yy); if (mask) { for (i=0;ixm_buffer->backimage; register GLuint i; - int yy = FLIP(xmesa->xm_buffer, y); + int yy = YFLIP(xrb, y); XDITHER_SETUP(yy); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLubyte *ptr = PIXEL_ADDR1(xrb, x, y); XDITHER_SETUP(y); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLubyte *ptr = PIXEL_ADDR1(xrb, x, y); XDITHER_SETUP(y); if (mask) { for (i=0;ixm_buffer->backimage; register GLuint i; SETUP_1BIT; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_buffer->backimage; register GLuint i; SETUP_1BIT; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLubyte *ptr = PIXEL_ADDR1(xrb, x, y); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLubyte *ptr = PIXEL_ADDR1(xrb, x, y); if (mask) { for (i=0;ixm_buffer->backimage; register GLuint i; LOOKUP_SETUP; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_buffer->backimage; register GLuint i; LOOKUP_SETUP; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLubyte *ptr = PIXEL_ADDR1(xrb, x, y); LOOKUP_SETUP; if (mask) { for (i=0;ixm_buffer, x, y ); + register GLubyte *ptr = PIXEL_ADDR1(xrb, x, y); LOOKUP_SETUP; if (mask) { for (i=0;ixm_buffer->backimage; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_buffer->backimage; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLubyte *ptr = PIXEL_ADDR1(xrb, x, y); if (mask) { for (i=0;ixm_buffer, x, y ); + register GLubyte *ptr = PIXEL_ADDR1(xrb, x, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -2155,7 +2205,7 @@ static void write_pixels_TRUECOLOR_pixmap( RGBA_PIXEL_ARGS ) unsigned long p; PACK_TRUECOLOR( p, rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ); XMesaSetForeground( dpy, gc, p ); - XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) ); + XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -2167,6 +2217,7 @@ static void write_pixels_TRUECOLOR_pixmap( RGBA_PIXEL_ARGS ) static void write_pixels_TRUEDITHER_pixmap( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -2176,7 +2227,7 @@ static void write_pixels_TRUEDITHER_pixmap( RGBA_PIXEL_ARGS ) unsigned long p; PACK_TRUEDITHER(p, x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]); XMesaSetForeground( dpy, gc, p ); - XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) ); + XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -2188,6 +2239,7 @@ static void write_pixels_TRUEDITHER_pixmap( RGBA_PIXEL_ARGS ) static void write_pixels_8A8B8G8R_pixmap( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -2196,7 +2248,7 @@ static void write_pixels_8A8B8G8R_pixmap( RGBA_PIXEL_ARGS ) if (mask[i]) { XMesaSetForeground( dpy, gc, PACK_8A8B8G8R( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP], rgba[i][ACOMP] )); - XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) ); + XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -2207,6 +2259,7 @@ static void write_pixels_8A8B8G8R_pixmap( RGBA_PIXEL_ARGS ) static void write_pixels_8A8R8G8B_pixmap( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -2215,7 +2268,7 @@ static void write_pixels_8A8R8G8B_pixmap( RGBA_PIXEL_ARGS ) if (mask[i]) { XMesaSetForeground( dpy, gc, PACK_8A8R8G8B( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP], rgba[i][ACOMP] )); - XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) ); + XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -2226,6 +2279,7 @@ static void write_pixels_8A8R8G8B_pixmap( RGBA_PIXEL_ARGS ) static void write_pixels_8R8G8B_pixmap( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -2233,7 +2287,7 @@ static void write_pixels_8R8G8B_pixmap( RGBA_PIXEL_ARGS ) for (i=0;ixm_buffer, y[i]) ); + XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -2245,6 +2299,7 @@ static void write_pixels_8R8G8B_pixmap( RGBA_PIXEL_ARGS ) static void write_pixels_8R8G8B24_pixmap( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -2252,7 +2307,7 @@ static void write_pixels_8R8G8B24_pixmap( RGBA_PIXEL_ARGS ) for (i=0;ixm_buffer, y[i]) ); + XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -2264,6 +2319,7 @@ static void write_pixels_8R8G8B24_pixmap( RGBA_PIXEL_ARGS ) static void write_pixels_5R6G5B_pixmap( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -2271,7 +2327,7 @@ static void write_pixels_5R6G5B_pixmap( RGBA_PIXEL_ARGS ) for (i=0;ixm_buffer, y[i]) ); + XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -2283,6 +2339,7 @@ static void write_pixels_5R6G5B_pixmap( RGBA_PIXEL_ARGS ) static void write_pixels_DITHER_5R6G5B_pixmap( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -2292,7 +2349,7 @@ static void write_pixels_DITHER_5R6G5B_pixmap( RGBA_PIXEL_ARGS ) unsigned long p; PACK_TRUEDITHER(p, x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ); XMesaSetForeground( dpy, gc, p ); - XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) ); + XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -2304,6 +2361,7 @@ static void write_pixels_DITHER_5R6G5B_pixmap( RGBA_PIXEL_ARGS ) static void write_pixels_DITHER_pixmap( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -2313,7 +2371,7 @@ static void write_pixels_DITHER_pixmap( RGBA_PIXEL_ARGS ) if (mask[i]) { XMesaSetForeground( dpy, gc, DITHER(x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]) ); - XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) ); + XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -2325,6 +2383,7 @@ static void write_pixels_DITHER_pixmap( RGBA_PIXEL_ARGS ) static void write_pixels_1BIT_pixmap( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -2334,7 +2393,7 @@ static void write_pixels_1BIT_pixmap( RGBA_PIXEL_ARGS ) if (mask[i]) { XMesaSetForeground( dpy, gc, DITHER_1BIT( x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] )); - XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) ); + XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -2346,6 +2405,7 @@ static void write_pixels_1BIT_pixmap( RGBA_PIXEL_ARGS ) static void write_pixels_HPCR_pixmap( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -2354,7 +2414,7 @@ static void write_pixels_HPCR_pixmap( RGBA_PIXEL_ARGS ) if (mask[i]) { XMesaSetForeground( dpy, gc, DITHER_HPCR( x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] )); - XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) ); + XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -2366,6 +2426,7 @@ static void write_pixels_HPCR_pixmap( RGBA_PIXEL_ARGS ) static void write_pixels_LOOKUP_pixmap( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -2374,7 +2435,7 @@ static void write_pixels_LOOKUP_pixmap( RGBA_PIXEL_ARGS ) for (i=0;ixm_buffer, y[i]) ); + XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -2386,6 +2447,7 @@ static void write_pixels_LOOKUP_pixmap( RGBA_PIXEL_ARGS ) static void write_pixels_GRAYSCALE_pixmap( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -2393,7 +2455,7 @@ static void write_pixels_GRAYSCALE_pixmap( RGBA_PIXEL_ARGS ) for (i=0;ixm_buffer, y[i]) ); + XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -2405,13 +2467,14 @@ static void write_pixels_GRAYSCALE_pixmap( RGBA_PIXEL_ARGS ) static void write_pixels_TRUECOLOR_ximage( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaImage *img = xmesa->xm_buffer->backimage; register GLuint i; for (i=0;ixm_buffer, y[i]), p ); + XMesaPutPixel( img, x[i], YFLIP(xrb, y[i]), p ); } } } @@ -2423,13 +2486,14 @@ static void write_pixels_TRUECOLOR_ximage( RGBA_PIXEL_ARGS ) static void write_pixels_TRUEDITHER_ximage( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaImage *img = xmesa->xm_buffer->backimage; register GLuint i; for (i=0;ixm_buffer, y[i]), p ); + XMesaPutPixel( img, x[i], YFLIP(xrb, y[i]), p ); } } } @@ -2440,11 +2504,11 @@ static void write_pixels_TRUEDITHER_ximage( RGBA_PIXEL_ARGS ) */ static void write_pixels_8A8B8G8R_ximage( RGBA_PIXEL_ARGS ) { - const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; register GLuint i; for (i=0;ixm_buffer, x[i], y[i] ); + GLuint *ptr = PIXEL_ADDR4(xrb, x[i], y[i] ); *ptr = PACK_8A8B8G8R( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP], rgba[i][ACOMP] ); } } @@ -2455,11 +2519,11 @@ static void write_pixels_8A8B8G8R_ximage( RGBA_PIXEL_ARGS ) */ static void write_pixels_8A8R8G8B_ximage( RGBA_PIXEL_ARGS ) { - const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; register GLuint i; for (i=0;ixm_buffer, x[i], y[i] ); + GLuint *ptr = PIXEL_ADDR4(xrb, x[i], y[i]); *ptr = PACK_8A8R8G8B( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP], rgba[i][ACOMP] ); } } @@ -2471,11 +2535,11 @@ static void write_pixels_8A8R8G8B_ximage( RGBA_PIXEL_ARGS ) */ static void write_pixels_8R8G8B_ximage( RGBA_PIXEL_ARGS ) { - const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; register GLuint i; for (i=0;ixm_buffer, x[i], y[i] ); + GLuint *ptr = PIXEL_ADDR4(xrb, x[i], y[i]); *ptr = PACK_8R8G8B( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ); } } @@ -2487,11 +2551,11 @@ static void write_pixels_8R8G8B_ximage( RGBA_PIXEL_ARGS ) */ static void write_pixels_8R8G8B24_ximage( RGBA_PIXEL_ARGS ) { - const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; register GLuint i; for (i=0;ixm_buffer, x[i], y[i] ); + bgr_t *ptr = PIXEL_ADDR3(xrb, x[i], y[i] ); ptr->r = rgba[i][RCOMP]; ptr->g = rgba[i][GCOMP]; ptr->b = rgba[i][BCOMP]; @@ -2505,11 +2569,11 @@ static void write_pixels_8R8G8B24_ximage( RGBA_PIXEL_ARGS ) */ static void write_pixels_5R6G5B_ximage( RGBA_PIXEL_ARGS ) { - const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; register GLuint i; for (i=0;ixm_buffer, x[i], y[i] ); + GLushort *ptr = PIXEL_ADDR2(xrb, x[i], y[i] ); *ptr = PACK_5R6G5B( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ); } } @@ -2521,11 +2585,12 @@ static void write_pixels_5R6G5B_ximage( RGBA_PIXEL_ARGS ) */ static void write_pixels_DITHER_5R6G5B_ximage( RGBA_PIXEL_ARGS ) { + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; const XMesaContext xmesa = XMESA_CONTEXT(ctx); register GLuint i; for (i=0;ixm_buffer, x[i], y[i] ); + GLushort *ptr = PIXEL_ADDR2(xrb, x[i], y[i] ); PACK_TRUEDITHER( *ptr, x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ); } } @@ -2538,12 +2603,13 @@ static void write_pixels_DITHER_5R6G5B_ximage( RGBA_PIXEL_ARGS ) static void write_pixels_DITHER_ximage( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaImage *img = xmesa->xm_buffer->backimage; register GLuint i; DITHER_SETUP; for (i=0;ixm_buffer, y[i]), + XMesaPutPixel( img, x[i], YFLIP(xrb, y[i]), DITHER( x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ) ); } } @@ -2555,12 +2621,13 @@ static void write_pixels_DITHER_ximage( RGBA_PIXEL_ARGS ) */ static void write_pixels_DITHER8_ximage( RGBA_PIXEL_ARGS ) { + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; const XMesaContext xmesa = XMESA_CONTEXT(ctx); register GLuint i; DITHER_SETUP; for (i=0;ixm_buffer,x[i],y[i]); + GLubyte *ptr = PIXEL_ADDR1(xrb, x[i], y[i]); *ptr = (GLubyte) DITHER( x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ); } } @@ -2573,12 +2640,13 @@ static void write_pixels_DITHER8_ximage( RGBA_PIXEL_ARGS ) static void write_pixels_1BIT_ximage( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaImage *img = xmesa->xm_buffer->backimage; register GLuint i; SETUP_1BIT; for (i=0;ixm_buffer, y[i]), + XMesaPutPixel( img, x[i], YFLIP(xrb, y[i]), DITHER_1BIT( x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] )); } } @@ -2590,11 +2658,12 @@ static void write_pixels_1BIT_ximage( RGBA_PIXEL_ARGS ) */ static void write_pixels_HPCR_ximage( RGBA_PIXEL_ARGS ) { + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; const XMesaContext xmesa = XMESA_CONTEXT(ctx); register GLuint i; for (i=0;ixm_buffer,x[i],y[i]); + GLubyte *ptr = PIXEL_ADDR1(xrb, x[i], y[i]); *ptr = (GLubyte) DITHER_HPCR( x[i], y[i], rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ); } } @@ -2607,12 +2676,13 @@ static void write_pixels_HPCR_ximage( RGBA_PIXEL_ARGS ) static void write_pixels_LOOKUP_ximage( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaImage *img = xmesa->xm_buffer->backimage; register GLuint i; LOOKUP_SETUP; for (i=0;ixm_buffer, y[i]), LOOKUP(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]) ); + XMesaPutPixel( img, x[i], YFLIP(xrb, y[i]), LOOKUP(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]) ); } } } @@ -2623,12 +2693,13 @@ static void write_pixels_LOOKUP_ximage( RGBA_PIXEL_ARGS ) */ static void write_pixels_LOOKUP8_ximage( RGBA_PIXEL_ARGS ) { + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; const XMesaContext xmesa = XMESA_CONTEXT(ctx); register GLuint i; LOOKUP_SETUP; for (i=0;ixm_buffer,x[i],y[i]); + GLubyte *ptr = PIXEL_ADDR1(xrb, x[i], y[i]); *ptr = (GLubyte) LOOKUP( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ); } } @@ -2641,11 +2712,12 @@ static void write_pixels_LOOKUP8_ximage( RGBA_PIXEL_ARGS ) static void write_pixels_GRAYSCALE_ximage( RGBA_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaImage *img = xmesa->xm_buffer->backimage; register GLuint i; for (i=0;ixm_buffer, y[i]), + XMesaPutPixel( img, x[i], YFLIP(xrb, y[i]), GRAY_RGB( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ) ); } } @@ -2657,11 +2729,12 @@ static void write_pixels_GRAYSCALE_ximage( RGBA_PIXEL_ARGS ) */ static void write_pixels_GRAYSCALE8_ximage( RGBA_PIXEL_ARGS ) { + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; const XMesaContext xmesa = XMESA_CONTEXT(ctx); register GLuint i; for (i=0;ixm_buffer, x[i], y[i] ); + GLubyte *ptr = PIXEL_ADDR1(xrb, x[i], y[i] ); *ptr = (GLubyte) GRAY_RGB( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] ); } } @@ -2675,6 +2748,7 @@ static void write_pixels_GRAYSCALE8_ximage( RGBA_PIXEL_ARGS ) /**********************************************************************/ #define MONO_SPAN_ARGS const GLcontext *ctx, \ + struct gl_renderbuffer *rb, \ GLuint n, GLint x, GLint y, const GLchan color[4], \ const GLubyte mask[] @@ -2685,6 +2759,7 @@ static void write_pixels_GRAYSCALE8_ximage( RGBA_PIXEL_ARGS ) static void write_span_mono_pixmap( MONO_SPAN_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -2692,7 +2767,7 @@ static void write_span_mono_pixmap( MONO_SPAN_ARGS ) color[GCOMP], color[BCOMP], color[ACOMP], xmesa->pixelformat); register GLuint i; XMesaSetForeground( xmesa->display, gc, pixel ); - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); /* New code contributed by Jeff Epler and cleaned up by Keith * Whitwell. @@ -2719,17 +2794,19 @@ static void write_span_mono_pixmap( MONO_SPAN_ARGS ) -static void write_span_mono_index_pixmap( const GLcontext *ctx, GLuint n, - GLint x, GLint y, GLuint colorIndex, - const GLubyte mask[] ) +static void +write_span_mono_index_pixmap( const GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, GLuint colorIndex, + const GLubyte mask[] ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; XMesaSetForeground( xmesa->display, gc, colorIndex ); - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); for (i = 0 ; i < n ;) { GLuint start = i; @@ -2759,12 +2836,13 @@ static void write_span_mono_index_pixmap( const GLcontext *ctx, GLuint n, static void write_span_mono_TRUEDITHER_pixmap( MONO_SPAN_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; register GLuint i; - int yy = FLIP(xmesa->xm_buffer, y); + int yy = YFLIP(xrb, y); for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; register GLuint i; - int yy = FLIP(xmesa->xm_buffer, y); + int yy = YFLIP(xrb, y); XDITHER_SETUP(yy); for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; register GLuint i; SETUP_1BIT; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); for (i=0;ixm_buffer->backimage; register GLuint i; const unsigned long pixel = xmesa_color_to_pixel(xmesa, color[RCOMP], color[GCOMP], color[BCOMP], color[ACOMP], xmesa->pixelformat); - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); for (i=0;ixm_buffer->backimage; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); for (i=0;ixm_buffer->backimage; const GLint r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); for (i=0;ipixelformat); - ptr = PIXELADDR4( xmesa->xm_buffer, x, y ); + ptr = PIXEL_ADDR4(xrb, x, y ); for (i=0;ipixelformat); - ptr = PIXELADDR4( xmesa->xm_buffer, x, y ); + ptr = PIXEL_ADDR4(xrb, x, y ); for (i=0;ixm_buffer, x, y ); + GLuint *ptr = PIXEL_ADDR4(xrb, x, y ); GLuint i; for (i=0;ixm_buffer, x, y ); + bgr_t *ptr = PIXEL_ADDR3(xrb, x, y ); for (i=0;ixm_buffer->backimage; - int yy = FLIP(xmesa->xm_buffer, y); + int yy = YFLIP(xrb, y); register GLuint i; XDITHER_SETUP(yy); for (i=0;ixm_buffer,x,y); + register GLubyte *ptr = PIXEL_ADDR1(xrb, x, y); register GLuint i; XDITHER_SETUP(y); for (i=0;ixm_buffer,x,y); + register GLubyte *ptr = PIXEL_ADDR1(xrb, x, y); GLubyte pixel; LOOKUP_SETUP; pixel = LOOKUP(color[RCOMP], color[GCOMP], color[BCOMP]); @@ -3011,11 +3099,12 @@ static void write_span_mono_LOOKUP8_ximage( MONO_SPAN_ARGS ) static void write_span_mono_1BIT_ximage( MONO_SPAN_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; XMesaImage *img = xmesa->xm_buffer->backimage; register GLuint i; SETUP_1BIT; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); for (i=0;ixm_buffer,x,y); + register GLubyte *ptr = PIXEL_ADDR1(xrb, x, y); register GLuint i; for (i=0;ixm_buffer,x,y); + GLubyte *ptr = (GLubyte *) PIXEL_ADDR1(xrb, x, y); GLuint i; for (i=0;ixm_buffer, x, y ); + register GLushort *ptr = PIXEL_ADDR2(xrb, x, y ); const GLint r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -3102,19 +3196,19 @@ static void write_pixels_mono_pixmap( MONO_PIXEL_ARGS ) for (i=0;ixm_buffer, y[i]) ); + (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } -static void write_pixels_mono_index_pixmap(const GLcontext *ctx, - GLuint n, - const GLint x[], const GLint y[], - GLuint colorIndex, - const GLubyte mask[] ) +static void +write_pixels_mono_index_pixmap(const GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + GLuint colorIndex, const GLubyte mask[] ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -3123,7 +3217,7 @@ static void write_pixels_mono_index_pixmap(const GLcontext *ctx, for (i=0;ixm_buffer, y[i]) ); + (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -3135,6 +3229,7 @@ static void write_pixels_mono_index_pixmap(const GLcontext *ctx, static void write_pixels_mono_TRUEDITHER_pixmap( MONO_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -3146,7 +3241,7 @@ static void write_pixels_mono_TRUEDITHER_pixmap( MONO_PIXEL_ARGS ) PACK_TRUEDITHER(p, x[i], y[i], r, g, b); XMesaSetForeground( dpy, gc, p ); XMesaDrawPoint( dpy, buffer, gc, - (int) x[i], (int) FLIP(xmesa->xm_buffer, y[i]) ); + (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -3158,6 +3253,7 @@ static void write_pixels_mono_TRUEDITHER_pixmap( MONO_PIXEL_ARGS ) static void write_pixels_mono_DITHER_pixmap( MONO_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -3167,7 +3263,7 @@ static void write_pixels_mono_DITHER_pixmap( MONO_PIXEL_ARGS ) for (i=0;ixm_buffer, y[i]) ); + XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -3179,6 +3275,7 @@ static void write_pixels_mono_DITHER_pixmap( MONO_PIXEL_ARGS ) static void write_pixels_mono_1BIT_pixmap( MONO_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -3188,7 +3285,7 @@ static void write_pixels_mono_1BIT_pixmap( MONO_PIXEL_ARGS ) for (i=0;ixm_buffer, y[i]) ); + XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -3200,29 +3297,32 @@ static void write_pixels_mono_1BIT_pixmap( MONO_PIXEL_ARGS ) static void write_pixels_mono_ximage( MONO_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaImage *img = xmesa->xm_buffer->backimage; register GLuint i; const unsigned long pixel = xmesa_color_to_pixel(xmesa, color[RCOMP], color[GCOMP], color[BCOMP], color[ACOMP], xmesa->pixelformat); for (i=0;ixm_buffer, y[i]), pixel ); + XMesaPutPixel( img, x[i], YFLIP(xrb, y[i]), pixel ); } } } -static void write_pixels_mono_index_ximage( const GLcontext *ctx, GLuint n, - const GLint x[], const GLint y[], - GLuint colorIndex, - const GLubyte mask[] ) +static void +write_pixels_mono_index_ximage(const GLcontext *ctx, + struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + GLuint colorIndex, const GLubyte mask[] ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaImage *img = xmesa->xm_buffer->backimage; register GLuint i; for (i=0;ixm_buffer, y[i]), colorIndex ); + XMesaPutPixel( img, x[i], YFLIP(xrb, y[i]), colorIndex ); } } } @@ -3234,14 +3334,15 @@ static void write_pixels_mono_index_ximage( const GLcontext *ctx, GLuint n, static void write_pixels_mono_TRUEDITHER_ximage( MONO_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaImage *img = xmesa->xm_buffer->backimage; register GLuint i; const int r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; for (i=0;ixm_buffer, y[i]), r, g, b); - XMesaPutPixel( img, x[i], FLIP(xmesa->xm_buffer, y[i]), p ); + PACK_TRUEDITHER(p, x[i], YFLIP(xrb, y[i]), r, g, b); + XMesaPutPixel( img, x[i], YFLIP(xrb, y[i]), p ); } } } @@ -3253,13 +3354,13 @@ static void write_pixels_mono_TRUEDITHER_ximage( MONO_PIXEL_ARGS ) */ static void write_pixels_mono_8A8B8G8R_ximage( MONO_PIXEL_ARGS ) { - const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; const GLuint p = PACK_8A8B8G8R(color[RCOMP], color[GCOMP], color[BCOMP], color[ACOMP]); register GLuint i; for (i=0;ixm_buffer, x[i], y[i] ); + GLuint *ptr = PIXEL_ADDR4(xrb, x[i], y[i] ); *ptr = p; } } @@ -3270,13 +3371,13 @@ static void write_pixels_mono_8A8B8G8R_ximage( MONO_PIXEL_ARGS ) */ static void write_pixels_mono_8A8R8G8B_ximage( MONO_PIXEL_ARGS ) { - const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; const GLuint p = PACK_8A8R8G8B(color[RCOMP], color[GCOMP], color[BCOMP], color[ACOMP]); register GLuint i; for (i=0;ixm_buffer, x[i], y[i] ); + GLuint *ptr = PIXEL_ADDR4(xrb, x[i], y[i] ); *ptr = p; } } @@ -3287,12 +3388,12 @@ static void write_pixels_mono_8A8R8G8B_ximage( MONO_PIXEL_ARGS ) */ static void write_pixels_mono_8R8G8B_ximage( MONO_PIXEL_ARGS ) { - const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; register GLuint i; const GLuint p = PACK_8R8G8B(color[RCOMP], color[GCOMP], color[BCOMP]); for (i=0;ixm_buffer, x[i], y[i] ); + GLuint *ptr = PIXEL_ADDR4(xrb, x[i], y[i] ); *ptr = p; } } @@ -3304,12 +3405,12 @@ static void write_pixels_mono_8R8G8B_ximage( MONO_PIXEL_ARGS ) */ static void write_pixels_mono_8R8G8B24_ximage( MONO_PIXEL_ARGS ) { - const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; register GLuint i; for (i=0;ixm_buffer, x[i], y[i] ); + bgr_t *ptr = PIXEL_ADDR3(xrb, x[i], y[i] ); ptr->r = r; ptr->g = g; ptr->b = b; @@ -3324,13 +3425,14 @@ static void write_pixels_mono_8R8G8B24_ximage( MONO_PIXEL_ARGS ) static void write_pixels_mono_DITHER_ximage( MONO_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; XMesaImage *img = xmesa->xm_buffer->backimage; register GLuint i; DITHER_SETUP; for (i=0;ixm_buffer, y[i]), DITHER( x[i], y[i], r, g, b ) ); + XMesaPutPixel( img, x[i], YFLIP(xrb, y[i]), DITHER( x[i], y[i], r, g, b ) ); } } } @@ -3341,13 +3443,14 @@ static void write_pixels_mono_DITHER_ximage( MONO_PIXEL_ARGS ) */ static void write_pixels_mono_DITHER8_ximage( MONO_PIXEL_ARGS ) { + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; const XMesaContext xmesa = XMESA_CONTEXT(ctx); const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; register GLuint i; DITHER_SETUP; for (i=0;ixm_buffer,x[i],y[i]); + GLubyte *ptr = PIXEL_ADDR1(xrb, x[i], y[i]); *ptr = (GLubyte) DITHER( x[i], y[i], r, g, b ); } } @@ -3359,6 +3462,7 @@ static void write_pixels_mono_DITHER8_ximage( MONO_PIXEL_ARGS ) */ static void write_pixels_mono_LOOKUP8_ximage( MONO_PIXEL_ARGS ) { + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; const XMesaContext xmesa = XMESA_CONTEXT(ctx); register GLuint i; GLubyte pixel; @@ -3366,7 +3470,7 @@ static void write_pixels_mono_LOOKUP8_ximage( MONO_PIXEL_ARGS ) pixel = LOOKUP(color[RCOMP], color[GCOMP], color[BCOMP]); for (i=0;ixm_buffer,x[i],y[i]); + GLubyte *ptr = PIXEL_ADDR1(xrb, x[i], y[i]); *ptr = pixel; } } @@ -3380,13 +3484,14 @@ static void write_pixels_mono_LOOKUP8_ximage( MONO_PIXEL_ARGS ) static void write_pixels_mono_1BIT_ximage( MONO_PIXEL_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; XMesaImage *img = xmesa->xm_buffer->backimage; register GLuint i; SETUP_1BIT; for (i=0;ixm_buffer, y[i]), + XMesaPutPixel( img, x[i], YFLIP(xrb, y[i]), DITHER_1BIT( x[i], y[i], r, g, b )); } } @@ -3398,12 +3503,13 @@ static void write_pixels_mono_1BIT_ximage( MONO_PIXEL_ARGS ) */ static void write_pixels_mono_HPCR_ximage( MONO_PIXEL_ARGS ) { + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; const XMesaContext xmesa = XMESA_CONTEXT(ctx); const GLubyte r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; register GLuint i; for (i=0;ixm_buffer,x[i],y[i]); + GLubyte *ptr = PIXEL_ADDR1(xrb, x[i], y[i]); *ptr = DITHER_HPCR( x[i], y[i], r, g, b ); } } @@ -3415,12 +3521,13 @@ static void write_pixels_mono_HPCR_ximage( MONO_PIXEL_ARGS ) */ static void write_pixels_mono_GRAYSCALE8_ximage( MONO_PIXEL_ARGS ) { + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; const XMesaContext xmesa = XMESA_CONTEXT(ctx); register GLuint i; register GLubyte p = GRAY_RGB(color[RCOMP], color[GCOMP], color[BCOMP]); for (i=0;ixm_buffer,x[i],y[i]); + GLubyte *ptr = PIXEL_ADDR1(xrb, x[i], y[i]); *ptr = p; } } @@ -3432,12 +3539,13 @@ static void write_pixels_mono_GRAYSCALE8_ximage( MONO_PIXEL_ARGS ) */ static void write_pixels_mono_DITHER_5R6G5B_ximage( MONO_PIXEL_ARGS ) { + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; const XMesaContext xmesa = XMESA_CONTEXT(ctx); const int r = color[RCOMP], g = color[GCOMP], b = color[BCOMP]; register GLuint i; for (i=0;ixm_buffer, x[i], y[i] ); + GLushort *ptr = PIXEL_ADDR2(xrb, x[i], y[i] ); PACK_TRUEDITHER(*ptr, x[i], y[i], r, g, b); } } @@ -3449,11 +3557,11 @@ static void write_pixels_mono_DITHER_5R6G5B_ximage( MONO_PIXEL_ARGS ) /*** Write INDEX SPAN functions ***/ /**********************************************************************/ -#define INDEX_SPAN_ARGS const GLcontext *ctx, \ +#define INDEX_SPAN_ARGS const GLcontext *ctx, struct gl_renderbuffer *rb, \ GLuint n, GLint x, GLint y, const GLuint index[], \ const GLubyte mask[] -#define INDEX8_SPAN_ARGS const GLcontext *ctx, \ +#define INDEX8_SPAN_ARGS const GLcontext *ctx, struct gl_renderbuffer *rb, \ GLuint n, GLint x, GLint y, const GLubyte index[], \ const GLubyte mask[] @@ -3464,11 +3572,12 @@ static void write_pixels_mono_DITHER_5R6G5B_ximage( MONO_PIXEL_ARGS ) static void write_span_index_pixmap( INDEX_SPAN_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaDisplay *dpy = xmesa->xm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_buffer->backimage; register GLuint i; - y = FLIP(xmesa->xm_buffer, y); + y = YFLIP(xrb, y); if (mask) { for (i=0;ixm_buffer,x,y); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; + GLubyte *dst = PIXEL_ADDR1(xrb, x, y); if (mask) { GLuint i; for (i=0;ixm_visual->display; XMesaDrawable buffer = xmesa->xm_buffer->buffer; XMesaGC gc = xmesa->xm_buffer->gc; @@ -3604,7 +3719,7 @@ static void write_pixels_index_pixmap( INDEX_PIXELS_ARGS ) for (i=0;ixm_buffer, y[i]) ); + XMesaDrawPoint( dpy, buffer, gc, (int) x[i], (int) YFLIP(xrb, y[i]) ); } } } @@ -3616,11 +3731,12 @@ static void write_pixels_index_pixmap( INDEX_PIXELS_ARGS ) static void write_pixels_index_ximage( INDEX_PIXELS_ARGS ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaImage *img = xmesa->xm_buffer->backimage; register GLuint i; for (i=0;ixm_buffer, y[i]), (unsigned long) index[i] ); + XMesaPutPixel( img, x[i], YFLIP(xrb, y[i]), (unsigned long) index[i] ); } } } @@ -3651,7 +3767,7 @@ clip_for_xgetimage(XMesaContext xmesa, GLuint *n, GLint *x, GLint *y) GLint dx, dy; if (source->type == PBUFFER || source->type == PIXMAP) return 0; - XTranslateCoordinates(xmesa->display, source->buffer, rootWin, + XTranslateCoordinates(xmesa->display, source->frontbuffer, rootWin, *x, *y, &dx, &dy, &child); if (dx >= screenWidth) { /* totally clipped on right */ @@ -3680,14 +3796,16 @@ clip_for_xgetimage(XMesaContext xmesa, GLuint *n, GLint *x, GLint *y) /* * Read a horizontal span of color-index pixels. */ -static void read_index_span( const GLcontext *ctx, - GLuint n, GLint x, GLint y, GLuint index[] ) +static void +read_index_span(const GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, GLuint index[]) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaBuffer source = xmesa->xm_buffer; GLuint i; - y = FLIP(source, y); + y = YFLIP(xrb, y); if (source->buffer) { #ifndef XFree86Server @@ -3735,11 +3853,12 @@ static void read_index_span( const GLcontext *ctx, /* * Read a horizontal span of color pixels. */ -static void read_color_span( const GLcontext *ctx, - GLuint n, GLint x, GLint y, - GLubyte rgba[][4] ) +static void +read_color_span( const GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, GLubyte rgba[][4] ) { const XMesaContext xmesa = XMESA_CONTEXT(ctx); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) rb; XMesaBuffer source = xmesa->xm_buffer; if (source->buffer) { @@ -3751,11 +3870,11 @@ static void read_color_span( const GLcontext *ctx, span->data = (char *)MALLOC(span->height * span->bytes_per_line); error = (!span->data); (*xmesa->display->GetImage)(source->buffer, - x, FLIP(source, y), n, 1, ZPixmap, + x, YFLIP(xrb, y), n, 1, ZPixmap, ~0L, (pointer)span->data); #else int k; - y = FLIP(source, y); + y = YFLIP(xrb, y); k = clip_for_xgetimage(xmesa, &n, &x, &y); if (k < 0) return; @@ -3952,7 +4071,7 @@ static void read_color_span( const GLcontext *ctx, GLint bShift = xmesa->xm_visual->bshift; XMesaImage *img = source->backimage; GLuint i; - y = FLIP(source, y); + y = YFLIP(xrb, y); for (i=0;ixm_visual->PixelToR; const GLubyte *pixelToG = xmesa->xm_visual->PixelToG; const GLubyte *pixelToB = xmesa->xm_visual->PixelToB; - const GLushort *ptr2 = PIXELADDR2( source, x, y ); + const GLushort *ptr2 = PIXEL_ADDR2(xrb, x, y); GLuint i; #if defined(__i386__) /* word stores don't have to be on 4-byte boundaries */ const GLuint *ptr4 = (const GLuint *) ptr2; @@ -4013,7 +4132,7 @@ static void read_color_span( const GLcontext *ctx, break; case PF_8A8B8G8R: { - const GLuint *ptr4 = PIXELADDR4( source, x, y ); + const GLuint *ptr4 = PIXEL_ADDR4(xrb, x, y); GLuint i; for (i=0;ipixel_to_g; const GLubyte *bTable = source->pixel_to_b; if (GET_VISUAL_DEPTH(xmesa->xm_visual)==8) { - GLubyte *ptr1 = PIXELADDR1( source, x, y ); + GLubyte *ptr1 = PIXEL_ADDR1(xrb, x, y); GLuint i; for (i=0;ibackimage; GLuint i; - y = FLIP(source, y); + y = YFLIP(xrb, y); for (i=0;ibackimage; int bitFlip = xmesa->xm_visual->bitFlip; GLuint i; - y = FLIP(source, y); + y = YFLIP(xrb, y); for (i=0;ixm_buffer; @@ -4148,7 +4269,7 @@ static void read_index_pixels( const GLcontext *ctx, if (mask[i]) { indx[i] = (GLuint) read_pixel( xmesa->display, source->buffer, - x[i], FLIP(source, y[i]) ); + x[i], YFLIP(xrb, y[i]) ); } } } @@ -4156,7 +4277,7 @@ static void read_index_pixels( const GLcontext *ctx, XMesaImage *img = source->backimage; for (i=0;ixm_visual->display; register GLuint i; @@ -4193,7 +4316,7 @@ static void read_color_pixels( const GLcontext *ctx, for (i=0;i> rShift]; rgba[i][GCOMP] = pixelToG[(p & gMask) >> gShift]; rgba[i][BCOMP] = pixelToB[(p & bMask) >> bShift]; @@ -4206,7 +4329,7 @@ static void read_color_pixels( const GLcontext *ctx, for (i=0;i> 8) & 0xff); rgba[i][BCOMP] = (GLubyte) ((p >> 16) & 0xff); @@ -4218,7 +4341,7 @@ static void read_color_pixels( const GLcontext *ctx, for (i=0;i> 16) & 0xff); rgba[i][GCOMP] = (GLubyte) ((p >> 8) & 0xff); rgba[i][BCOMP] = (GLubyte) ( p & 0xff); @@ -4230,7 +4353,7 @@ static void read_color_pixels( const GLcontext *ctx, for (i=0;i> 16) & 0xff); rgba[i][GCOMP] = (GLubyte) ((p >> 8) & 0xff); rgba[i][BCOMP] = (GLubyte) ( p & 0xff); @@ -4242,7 +4365,7 @@ static void read_color_pixels( const GLcontext *ctx, for (i=0;i> 16) & 0xff); rgba[i][GCOMP] = (GLubyte) ((p >> 8) & 0xff); rgba[i][BCOMP] = (GLubyte) ( p & 0xff); @@ -4255,7 +4378,7 @@ static void read_color_pixels( const GLcontext *ctx, for (i=0;ibackimage) { + /* Read from XImage back buffer */ switch (xmesa->pixelformat) { case PF_Truecolor: case PF_Dither_True: @@ -4323,7 +4447,7 @@ static void read_color_pixels( const GLcontext *ctx, for (i=0;i> rShift]; rgba[i][GCOMP] = pixelToG[(p & gMask) >> gShift]; rgba[i][BCOMP] = pixelToB[(p & bMask) >> bShift]; @@ -4335,7 +4459,7 @@ static void read_color_pixels( const GLcontext *ctx, case PF_8A8B8G8R: for (i=0;i> 8) & 0xff); @@ -4347,7 +4471,7 @@ static void read_color_pixels( const GLcontext *ctx, case PF_8A8R8G8B: for (i=0;i> 16) & 0xff); rgba[i][GCOMP] = (GLubyte) ((p4 >> 8) & 0xff); @@ -4359,7 +4483,7 @@ static void read_color_pixels( const GLcontext *ctx, case PF_8R8G8B: for (i=0;i> 16) & 0xff); rgba[i][GCOMP] = (GLubyte) ((p4 >> 8) & 0xff); @@ -4371,7 +4495,7 @@ static void read_color_pixels( const GLcontext *ctx, case PF_8R8G8B24: for (i=0;ir; rgba[i][GCOMP] = ptr3->g; rgba[i][BCOMP] = ptr3->b; @@ -4382,7 +4506,7 @@ static void read_color_pixels( const GLcontext *ctx, case PF_HPCR: for (i=0;ixm_visual); struct swrast_device_driver *dd = _swrast_GetDeviceDriverReference( ctx ); + if (ctx->DrawBuffer->Name != 0) { + /* drawing to user framebuffer */ + dd->WriteCI32Span = NULL; + dd->WriteCI8Span = NULL; + dd->WriteMonoCISpan = NULL; + dd->WriteCI32Pixels = NULL; + dd->WriteMonoCIPixels = NULL; + dd->WriteRGBASpan = NULL; + dd->WriteRGBSpan = NULL; + dd->WriteMonoRGBASpan = NULL; + dd->WriteRGBAPixels = NULL; + dd->WriteMonoRGBAPixels = NULL; + dd->ReadCI32Span = NULL; + dd->ReadRGBASpan = NULL; + dd->ReadCI32Pixels = NULL; + dd->ReadRGBAPixels = NULL; + return; + } + /* * These drawing functions depend on color buffer config: */ @@ -4624,7 +4767,7 @@ void xmesa_update_span_funcs( GLcontext *ctx ) dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; break; default: - _mesa_problem(NULL,"Bad pixel format in xmesa_update_state (1)"); + _mesa_problem(ctx, "Bad pixel format in xmesa_update_state (1)"); return; } } @@ -4764,7 +4907,7 @@ void xmesa_update_span_funcs( GLcontext *ctx ) } break; default: - _mesa_problem(NULL,"Bad pixel format in xmesa_update_state (2)"); + _mesa_problem(ctx, "Bad pixel format in xmesa_update_state (2)"); return; } } @@ -4775,3 +4918,380 @@ void xmesa_update_span_funcs( GLcontext *ctx ) dd->ReadCI32Pixels = read_index_pixels; dd->ReadRGBAPixels = read_color_pixels; } + + +#if 000 +/** + * Initialize the renderbuffer's PutRow, GetRow, etc. functions + */ +static void +xmesa_set_renderbuffer_funcs(GLcontext *ctx, struct xmesa_renderbuffer *xrb, + GLboolean pixmap, enum pixel_format pixelformat) +{ +#if 0 + XMesaContext xmesa = XMESA_CONTEXT(ctx); + int depth = GET_VISUAL_DEPTH(xmesa->xm_visual); + +#endif + + switch (pixelformat) { + case PF_Index: + if (pixmap) { + /* + dd->WriteCI32Span = write_span_index_pixmap; + dd->WriteCI8Span = write_span_index8_pixmap; + dd->WriteMonoCISpan = write_span_mono_index_pixmap; + dd->WriteCI32Pixels = write_pixels_index_pixmap; + dd->WriteMonoCIPixels = write_pixels_mono_index_pixmap; + */ + } + else { + } + break; + case PF_Truecolor: + if (pixmap) { + /* + dd->WriteRGBASpan = write_span_TRUECOLOR_pixmap; + dd->WriteRGBSpan = write_span_rgb_TRUECOLOR_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_pixmap; + dd->WriteRGBAPixels = write_pixels_TRUECOLOR_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; + */ + } + else { + } + break; + case PF_Dither_True: + if (pixmap) { + /* + dd->WriteRGBASpan = write_span_TRUEDITHER_pixmap; + dd->WriteRGBSpan = write_span_rgb_TRUEDITHER_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_TRUEDITHER_pixmap; + dd->WriteRGBAPixels = write_pixels_TRUEDITHER_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_TRUEDITHER_pixmap; + */ + } + else { + } + break; + case PF_8A8B8G8R: + if (pixmap) { + /* + dd->WriteRGBASpan = write_span_8A8B8G8R_pixmap; + dd->WriteRGBSpan = write_span_rgb_8A8B8G8R_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_pixmap; + dd->WriteRGBAPixels = write_pixels_8A8B8G8R_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; + */ + } + else { + } + break; + case PF_8A8R8G8B: + if (pixmap) { + /* + dd->WriteRGBASpan = write_span_8A8R8G8B_pixmap; + dd->WriteRGBSpan = write_span_rgb_8A8R8G8B_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_pixmap; + dd->WriteRGBAPixels = write_pixels_8A8R8G8B_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; + */ + } + else { + } + break; + case PF_8R8G8B: + /* + dd->WriteRGBASpan = write_span_8R8G8B_pixmap; + dd->WriteRGBSpan = write_span_rgb_8R8G8B_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_pixmap; + dd->WriteRGBAPixels = write_pixels_8R8G8B_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; + */ + if (pixmap) { + xrb->Base.PutRow = put_row_8R8G8B_pixmap; + xrb->Base.PutMonoRow = put_mono_row_pixmap; + xrb->Base.PutValues = put_values_8R8G8B_pixmap; + xrb->Base.PutMonoValues = put_mono_values_pixmap; + } + break; + case PF_8R8G8B24: + if (pixmap) { + /* + dd->WriteRGBASpan = write_span_8R8G8B24_pixmap; + dd->WriteRGBSpan = write_span_rgb_8R8G8B24_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_pixmap; + dd->WriteRGBAPixels = write_pixels_8R8G8B24_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; + */ + } + else { + } + break; + case PF_5R6G5B: + if (pixmap) { + /* + dd->WriteRGBASpan = write_span_5R6G5B_pixmap; + dd->WriteRGBSpan = write_span_rgb_5R6G5B_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_pixmap; + dd->WriteRGBAPixels = write_pixels_5R6G5B_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; + */ + } + else { + } + break; + case PF_Dither_5R6G5B: + if (pixmap) { + /* + dd->WriteRGBASpan = write_span_DITHER_5R6G5B_pixmap; + dd->WriteRGBSpan = write_span_rgb_DITHER_5R6G5B_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_TRUEDITHER_pixmap; + dd->WriteRGBAPixels = write_pixels_DITHER_5R6G5B_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_TRUEDITHER_pixmap; + */ + } + else { + } + break; + case PF_Dither: + if (pixmap) { + /* + dd->WriteRGBASpan = write_span_DITHER_pixmap; + dd->WriteRGBSpan = write_span_rgb_DITHER_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_DITHER_pixmap; + dd->WriteRGBAPixels = write_pixels_DITHER_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_DITHER_pixmap; + */ + } + else { + } + break; + case PF_1Bit: + if (pixmap) { + /* + dd->WriteRGBASpan = write_span_1BIT_pixmap; + dd->WriteRGBSpan = write_span_rgb_1BIT_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_1BIT_pixmap; + dd->WriteRGBAPixels = write_pixels_1BIT_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_1BIT_pixmap; + */ + } + else { + } + break; + case PF_HPCR: + if (pixmap) { + /* + dd->WriteRGBASpan = write_span_HPCR_pixmap; + dd->WriteRGBSpan = write_span_rgb_HPCR_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_pixmap; + dd->WriteRGBAPixels = write_pixels_HPCR_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; + */ + } + else { + } + ctx->Driver.ClearColor = clear_color_HPCR_pixmap; + } + break; + case PF_Lookup: + if (pixmap) { + /* + dd->WriteRGBASpan = write_span_LOOKUP_pixmap; + dd->WriteRGBSpan = write_span_rgb_LOOKUP_pixmap; + dd->WriteRGBAPixels = write_pixels_LOOKUP_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; + */ + } + else { + } + break; + case PF_Grayscale: + if (pixmap) { + /* + dd->WriteRGBASpan = write_span_GRAYSCALE_pixmap; + dd->WriteRGBSpan = write_span_rgb_GRAYSCALE_pixmap; + dd->WriteMonoRGBASpan = write_span_mono_pixmap; + dd->WriteRGBAPixels = write_pixels_GRAYSCALE_pixmap; + dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap; + */ + } + else { + } + break; + default: + _mesa_problem(ctx, "Bad pixel format in xmesa_update_state (1)"); + return; + } + +#if 0000 +#if 0 + /* Generic RGB */ + dd->WriteRGBASpan = write_span_TRUECOLOR_ximage; + dd->WriteRGBSpan = write_span_rgb_TRUECOLOR_ximage; + dd->WriteMonoRGBASpan = write_span_mono_ximage; + dd->WriteRGBAPixels = write_pixels_TRUECOLOR_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_ximage; +#endif + break; + case PF_Dither_True: +#if 0 + dd->WriteRGBASpan = write_span_TRUEDITHER_ximage; + dd->WriteRGBSpan = write_span_rgb_TRUEDITHER_ximage; + dd->WriteMonoRGBASpan = write_span_mono_TRUEDITHER_ximage; + dd->WriteRGBAPixels = write_pixels_TRUEDITHER_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_TRUEDITHER_ximage; +#endif + break; + case PF_8A8B8G8R: +#if 0 + dd->WriteRGBASpan = write_span_8A8B8G8R_ximage; + dd->WriteRGBSpan = write_span_rgb_8A8B8G8R_ximage; + dd->WriteMonoRGBASpan = write_span_mono_8A8B8G8R_ximage; + dd->WriteRGBAPixels = write_pixels_8A8B8G8R_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_8A8B8G8R_ximage; +#endif + break; + case PF_8A8R8G8B: +#if 0 + dd->WriteRGBASpan = write_span_8A8R8G8B_ximage; + dd->WriteRGBSpan = write_span_rgb_8A8R8G8B_ximage; + dd->WriteMonoRGBASpan = write_span_mono_8A8R8G8B_ximage; + dd->WriteRGBAPixels = write_pixels_8A8R8G8B_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_8A8R8G8B_ximage; +#endif + break; + case PF_8R8G8B: +#if 0 + dd->WriteRGBASpan = write_span_8R8G8B_ximage; + dd->WriteRGBSpan = write_span_rgb_8R8G8B_ximage; + dd->WriteMonoRGBASpan = write_span_mono_8R8G8B_ximage; + dd->WriteRGBAPixels = write_pixels_8R8G8B_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_8R8G8B_ximage; +#endif + break; + case PF_8R8G8B24: +#if 0 + dd->WriteRGBASpan = write_span_8R8G8B24_ximage; + dd->WriteRGBSpan = write_span_rgb_8R8G8B24_ximage; + dd->WriteMonoRGBASpan = write_span_mono_8R8G8B24_ximage; + dd->WriteRGBAPixels = write_pixels_8R8G8B24_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_8R8G8B24_ximage; +#endif + break; + case PF_5R6G5B: +#if 0 + dd->WriteRGBASpan = write_span_5R6G5B_ximage; + dd->WriteRGBSpan = write_span_rgb_5R6G5B_ximage; + dd->WriteMonoRGBASpan = write_span_mono_ximage; + dd->WriteRGBAPixels = write_pixels_5R6G5B_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_ximage; +#endif + break; + case PF_Dither_5R6G5B: +#if 0 + dd->WriteRGBASpan = write_span_DITHER_5R6G5B_ximage; + dd->WriteRGBSpan = write_span_rgb_DITHER_5R6G5B_ximage; + dd->WriteMonoRGBASpan = write_span_mono_DITHER_5R6G5B_ximage; + dd->WriteRGBAPixels = write_pixels_DITHER_5R6G5B_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_DITHER_5R6G5B_ximage; +#endif + break; + case PF_Dither: +#if 0 + if (depth==8) { + dd->WriteRGBASpan = write_span_DITHER8_ximage; + dd->WriteRGBSpan = write_span_rgb_DITHER8_ximage; + dd->WriteMonoRGBASpan = write_span_mono_DITHER8_ximage; + dd->WriteRGBAPixels = write_pixels_DITHER8_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_DITHER8_ximage; + } + else { + dd->WriteRGBASpan = write_span_DITHER_ximage; + dd->WriteRGBSpan = write_span_rgb_DITHER_ximage; + dd->WriteMonoRGBASpan = write_span_mono_DITHER_ximage; + dd->WriteRGBAPixels = write_pixels_DITHER_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_DITHER_ximage; + } +#endif + break; + case PF_1Bit: +#if 0 + dd->WriteRGBASpan = write_span_1BIT_ximage; + dd->WriteRGBSpan = write_span_rgb_1BIT_ximage; + dd->WriteMonoRGBASpan = write_span_mono_1BIT_ximage; + dd->WriteRGBAPixels = write_pixels_1BIT_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_1BIT_ximage; +#endif + break; + case PF_HPCR: +#if 0 + dd->WriteRGBASpan = write_span_HPCR_ximage; + dd->WriteRGBSpan = write_span_rgb_HPCR_ximage; + dd->WriteMonoRGBASpan = write_span_mono_HPCR_ximage; + dd->WriteRGBAPixels = write_pixels_HPCR_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_HPCR_ximage; + if (xmesa->xm_visual->hpcr_clear_flag) { + ctx->Driver.ClearColor = clear_color_HPCR_ximage; + } +#endif + break; + case PF_Lookup: +#if 0 + if (depth==8) { + dd->WriteRGBASpan = write_span_LOOKUP8_ximage; + dd->WriteRGBSpan = write_rgb_LOOKUP8_ximage; + dd->WriteMonoRGBASpan = write_span_mono_LOOKUP8_ximage; + dd->WriteRGBAPixels = write_pixels_LOOKUP8_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_LOOKUP8_ximage; + } + else { + dd->WriteRGBASpan = write_span_LOOKUP_ximage; + dd->WriteRGBSpan = write_span_rgb_LOOKUP_ximage; + dd->WriteMonoRGBASpan = write_span_mono_ximage; + dd->WriteRGBAPixels = write_pixels_LOOKUP_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_ximage; + } +#endif + break; + case PF_Grayscale: +#if 0 + if (depth==8) { + dd->WriteRGBASpan = write_span_GRAYSCALE8_ximage; + dd->WriteRGBSpan = write_span_rgb_GRAYSCALE8_ximage; + dd->WriteMonoRGBASpan = write_span_mono_GRAYSCALE8_ximage; + dd->WriteRGBAPixels = write_pixels_GRAYSCALE8_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_GRAYSCALE8_ximage; + } + else { + dd->WriteRGBASpan = write_span_GRAYSCALE_ximage; + dd->WriteRGBSpan = write_span_rgb_GRAYSCALE_ximage; + dd->WriteMonoRGBASpan = write_span_mono_ximage; + dd->WriteRGBAPixels = write_pixels_GRAYSCALE_ximage; + dd->WriteMonoRGBAPixels = write_pixels_mono_ximage; + } +#endif + break; + default: + _mesa_problem(ctx, "Bad pixel format in xmesa_update_state (2)"); + return; + } + } +#endif + + + /* Pixel/span reading functions: */ +#if 0 + rb->ReadCI32Span = read_index_span; + dd->ReadRGBASpan = read_color_span; + dd->ReadCI32Pixels = read_index_pixels; + dd->ReadRGBAPixels = read_color_pixels; +#else + rb->GetRow = get_row_color; + rb->GetValues = get_values_color; +#endif +} + +#endif + diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c index 8fd22ccf4e8..8b5c39392a9 100644 --- a/src/mesa/drivers/x11/xm_tri.c +++ b/src/mesa/drivers/x11/xm_tri.c @@ -44,6 +44,9 @@ #include "swrast/s_triangle.h" +#define GET_XRB(XRB) struct xmesa_renderbuffer *XRB = \ + (struct xmesa_renderbuffer *) ctx->DrawBuffer->_ColorDrawBuffers[0][0] + /**********************************************************************/ /*** Triangle rendering ***/ @@ -59,10 +62,10 @@ #define INTERP_RGB 1 #define SETUP_CODE \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ - XMesaImage *img = xmesa->xm_buffer->backimage; + GET_XRB(xrb); #define RENDER_SPAN( span ) \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ GLuint i; \ for (i = 0; i < span.end; i++, x++) { \ const DEPTH_TYPE z = FixedToDepth(span.z); \ @@ -70,7 +73,7 @@ unsigned long p; \ PACK_TRUECOLOR(p, FixedToInt(span.red), \ FixedToInt(span.green), FixedToInt(span.blue)); \ - XMesaPutPixel(img, x, y, p); \ + XMesaPutPixel(xrb->ximage, x, y, p); \ zRow[i] = z; \ } \ span.red += span.redStep; \ @@ -91,12 +94,11 @@ #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y) #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ - + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ for (i = 0; i < span.end; i++) { \ @@ -123,11 +125,11 @@ #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y) #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ @@ -155,11 +157,11 @@ #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y) #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ @@ -187,11 +189,11 @@ #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR3(xrb, X, Y) #define PIXEL_TYPE bgr_t -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ for (i = 0; i < span.end; i++) { \ @@ -221,17 +223,17 @@ #define INTERP_RGB 1 #define SETUP_CODE \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ - XMesaImage *img = xmesa->xm_buffer->backimage; + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ for (i = 0; i < span.end; i++, x++) { \ const DEPTH_TYPE z = FixedToDepth(span.z); \ if (z < zRow[i]) { \ unsigned long p; \ PACK_TRUEDITHER(p, x, y, FixedToInt(span.red), \ FixedToInt(span.green), FixedToInt(span.blue)); \ - XMesaPutPixel(img, x, y, p); \ + XMesaPutPixel(xrb->ximage, x, y, p); \ zRow[i] = z; \ } \ span.red += span.redStep; \ @@ -250,11 +252,11 @@ #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR2(xrb, X, Y) #define PIXEL_TYPE GLushort -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ for (i = 0; i < span.end; i++) { \ @@ -280,14 +282,15 @@ #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR2(xrb, X, Y) #define PIXEL_TYPE GLushort -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); + XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ for (i = 0; i < span.end; i++, x++) { \ const DEPTH_TYPE z = FixedToDepth(span.z); \ if (z < zRow[i]) { \ @@ -311,14 +314,14 @@ #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X, Y) #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ XDITHER_SETUP(y); \ for (i = 0; i < span.end; i++, x++) { \ const DEPTH_TYPE z = FixedToDepth(span.z); \ @@ -344,11 +347,11 @@ #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define INTERP_RGB 1 #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ - XMesaImage *img = xmesa->xm_buffer->backimage; + GET_XRB(xrb); \ + XMesaImage *img = xrb->ximage; #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ XDITHER_SETUP(y); \ for (i = 0; i < span.end; i++, x++) { \ const DEPTH_TYPE z = FixedToDepth(span.z); \ @@ -374,11 +377,11 @@ #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X, Y) #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ LOOKUP_SETUP; \ @@ -405,14 +408,15 @@ #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X, Y) #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); + XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ for (i = 0; i < span.end; i++, x++) { \ const DEPTH_TYPE z = FixedToDepth(span.z); \ if (z < zRow[i]) { \ @@ -437,12 +441,13 @@ #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define SETUP_CODE \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ - XMesaImage *img = xmesa->xm_buffer->backimage; \ + GET_XRB(xrb); \ + XMesaImage *img = xrb->ximage; \ unsigned long pixel; \ PACK_TRUECOLOR(pixel, v2->color[0], v2->color[1], v2->color[2]); #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ for (i = 0; i < span.end; i++, x++) { \ const DEPTH_TYPE z = FixedToDepth(span.z); \ if (z < zRow[i]) { \ @@ -461,13 +466,12 @@ #define NAME flat_8A8B8G8R_z_triangle #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y) #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ - unsigned long p = PACK_8B8G8R( v2->color[0], \ - v2->color[1], v2->color[2] ); + GET_XRB(xrb); \ + GLuint p = PACK_8B8G8R( v2->color[0], v2->color[1], v2->color[2] ); #define RENDER_SPAN( span ) \ GLuint i; \ for (i = 0; i < span.end; i++) { \ @@ -488,13 +492,12 @@ #define NAME flat_8A8R8G8B_z_triangle #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y) #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ - unsigned long p = PACK_8R8G8B( v2->color[0], \ - v2->color[1], v2->color[2] ); + GET_XRB(xrb); \ + GLuint p = PACK_8R8G8B( v2->color[0], v2->color[1], v2->color[2] ); #define RENDER_SPAN( span ) \ GLuint i; \ for (i = 0; i < span.end; i++) { \ @@ -515,13 +518,12 @@ #define NAME flat_8R8G8B_z_triangle #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y) #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ - unsigned long p = PACK_8R8G8B( v2->color[0], \ - v2->color[1], v2->color[2] ); + GET_XRB(xrb); \ + GLuint p = PACK_8R8G8B( v2->color[0], v2->color[1], v2->color[2] ); #define RENDER_SPAN( span ) \ GLuint i; \ for (i = 0; i < span.end; i++) { \ @@ -529,9 +531,12 @@ if (z < zRow[i]) { \ pRow[i] = (PIXEL_TYPE) p; \ zRow[i] = z; \ + if (span.y == 100) printf("pass\n");\ } \ + else if (span.y == 100) printf("fail\n");\ span.z += span.zStep; \ } + #include "swrast/s_tritemp.h" @@ -542,11 +547,11 @@ #define NAME flat_8R8G8B24_z_triangle #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR3(xrb, X, Y) #define PIXEL_TYPE bgr_t -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = v2->color; #define RENDER_SPAN( span ) \ GLuint i; \ @@ -573,10 +578,11 @@ #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define SETUP_CODE \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ - XMesaImage *img = xmesa->xm_buffer->backimage; + GET_XRB(xrb); \ + XMesaImage *img = xrb->ximage; #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ for (i = 0; i < span.end; i++, x++) { \ const DEPTH_TYPE z = FixedToDepth(span.z); \ if (z < zRow[i]) { \ @@ -598,13 +604,12 @@ #define NAME flat_5R6G5B_z_triangle #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR2(xrb, X, Y) #define PIXEL_TYPE GLushort -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ - unsigned long p = PACK_5R6G5B( v2->color[0], \ - v2->color[1], v2->color[2] ); + GET_XRB(xrb); \ + GLushort p = PACK_5R6G5B( v2->color[0], v2->color[1], v2->color[2] ); #define RENDER_SPAN( span ) \ GLuint i; \ for (i = 0; i < span.end; i++) { \ @@ -625,15 +630,16 @@ #define NAME flat_DITHER_5R6G5B_z_triangle #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR2(xrb, X, Y) #define PIXEL_TYPE GLushort -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = v2->color; #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ for (i = 0; i < span.end; i++, x++) { \ const DEPTH_TYPE z = FixedToDepth(span.z); \ if (z < zRow[i]) { \ @@ -653,16 +659,16 @@ #define NAME flat_DITHER8_z_triangle #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X, Y) #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] ); #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ - FLAT_DITHER_ROW_SETUP(FLIP(xmesa->xm_buffer, y)); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ + FLAT_DITHER_ROW_SETUP(YFLIP(xrb, y)); \ for (i = 0; i < span.end; i++, x++) { \ const DEPTH_TYPE z = FixedToDepth(span.z); \ if (z < zRow[i]) { \ @@ -682,12 +688,12 @@ #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ - XMesaImage *img = xmesa->xm_buffer->backimage; \ + GET_XRB(xrb); \ + XMesaImage *img = xrb->ximage; \ FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] ); #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ FLAT_DITHER_ROW_SETUP(y); \ for (i = 0; i < span.end; i++, x++) { \ const DEPTH_TYPE z = FixedToDepth(span.z); \ @@ -708,17 +714,18 @@ #define NAME flat_HPCR_z_triangle #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X, Y) #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ GLubyte r = v2->color[0]; \ GLubyte g = v2->color[1]; \ GLubyte b = v2->color[2]; #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ for (i = 0; i < span.end; i++, x++) { \ const DEPTH_TYPE z = FixedToDepth(span.z); \ if (z < zRow[i]) { \ @@ -737,11 +744,11 @@ #define NAME flat_LOOKUP8_z_triangle #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X, Y) #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ LOOKUP_SETUP; \ GLubyte r = v2->color[0]; \ GLubyte g = v2->color[1]; \ @@ -768,10 +775,11 @@ #define INTERP_RGB 1 #define SETUP_CODE \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ - XMesaImage *img = xmesa->xm_buffer->backimage; + GET_XRB(xrb); \ + XMesaImage *img = xrb->ximage; #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ for (i = 0; i < span.end; i++, x++) { \ unsigned long p; \ PACK_TRUECOLOR(p, FixedToInt(span.red), \ @@ -790,11 +798,11 @@ */ #define NAME smooth_8A8B8G8R_triangle #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y) #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ for (i = 0; i < span.end; i++) { \ @@ -813,11 +821,11 @@ */ #define NAME smooth_8A8R8G8B_triangle #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y) #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ for (i = 0; i < span.end; i++) { \ @@ -836,11 +844,11 @@ */ #define NAME smooth_8R8G8B_triangle #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y) #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ for (i = 0; i < span.end; i++) { \ @@ -859,11 +867,11 @@ */ #define NAME smooth_8R8G8B24_triangle #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR3(xrb, X, Y) #define PIXEL_TYPE bgr_t -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ PIXEL_TYPE *pixel = pRow; \ @@ -886,10 +894,11 @@ #define INTERP_RGB 1 #define SETUP_CODE \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ - XMesaImage *img = xmesa->xm_buffer->backimage; + GET_XRB(xrb); \ + XMesaImage *img = xrb->ximage; #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ for (i = 0; i < span.end; i++, x++) { \ unsigned long p; \ PACK_TRUEDITHER(p, x, y, FixedToInt(span.red), \ @@ -908,11 +917,11 @@ */ #define NAME smooth_5R6G5B_triangle #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR2(xrb, X, Y) #define PIXEL_TYPE GLushort -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ for (i = 0; i < span.end; i++) { \ @@ -931,14 +940,15 @@ */ #define NAME smooth_DITHER_5R6G5B_triangle #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR2(xrb, X, Y) #define PIXEL_TYPE GLushort -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); + XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ for (i = 0; i < span.end; i++, x++) { \ PACK_TRUEDITHER(pRow[i], x, y, FixedToInt(span.red), \ FixedToInt(span.green), FixedToInt(span.blue)); \ @@ -955,14 +965,14 @@ */ #define NAME smooth_DITHER8_triangle #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X, Y) #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ XDITHER_SETUP(y); \ for (i = 0; i < span.end; i++, x++) { \ pRow[i] = (PIXEL_TYPE) XDITHER(x, FixedToInt(span.red), \ @@ -981,11 +991,11 @@ #define NAME smooth_DITHER_triangle #define INTERP_RGB 1 #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ - XMesaImage *img = xmesa->xm_buffer->backimage; + GET_XRB(xrb); \ + XMesaImage *img = xrb->ximage; #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ XDITHER_SETUP(y); \ for (i = 0; i < span.end; i++, x++) { \ unsigned long p = XDITHER(x, FixedToInt(span.red), \ @@ -1004,11 +1014,11 @@ */ #define NAME smooth_LOOKUP8_triangle #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X, Y) #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ LOOKUP_SETUP; \ @@ -1028,14 +1038,15 @@ */ #define NAME smooth_HPCR_triangle #define INTERP_RGB 1 -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X, Y) #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); + XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ for (i = 0; i < span.end; i++, x++) { \ pRow[i] = DITHER_HPCR(x, y, FixedToInt(span.red), \ FixedToInt(span.green), FixedToInt(span.blue)); \ @@ -1053,12 +1064,13 @@ #define NAME flat_TRUECOLOR_triangle #define SETUP_CODE \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ - XMesaImage *img = xmesa->xm_buffer->backimage; \ + GET_XRB(xrb); \ + XMesaImage *img = xrb->ximage; \ unsigned long pixel; \ PACK_TRUECOLOR(pixel, v2->color[0], v2->color[1], v2->color[2]); #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ for (i = 0; i < span.end; i++, x++) { \ XMesaPutPixel(img, x, y, pixel); \ } @@ -1070,11 +1082,11 @@ * XImage, flat, NON-depth-buffered, PF_8A8B8G8R triangle. */ #define NAME flat_8A8B8G8R_triangle -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y) #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ unsigned long p = PACK_8B8G8R( v2->color[0], \ v2->color[1], v2->color[2] ); #define RENDER_SPAN( span ) \ @@ -1090,11 +1102,11 @@ * XImage, flat, NON-depth-buffered, PF_8A8R8G8B triangle. */ #define NAME flat_8A8R8G8B_triangle -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y) #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ unsigned long p = PACK_8R8G8B( v2->color[0], \ v2->color[1], v2->color[2] ); #define RENDER_SPAN( span ) \ @@ -1110,11 +1122,11 @@ * XImage, flat, NON-depth-buffered, PF_8R8G8B triangle. */ #define NAME flat_8R8G8B_triangle -#define PIXEL_ADDRESS(X,Y) PIXELADDR4(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR4(xrb, X, Y) #define PIXEL_TYPE GLuint -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ unsigned long p = PACK_8R8G8B( v2->color[0], \ v2->color[1], v2->color[2] ); #define RENDER_SPAN( span ) \ @@ -1130,11 +1142,11 @@ * XImage, flat, NON-depth-buffered, PF_8R8G8B24 triangle. */ #define NAME flat_8R8G8B24_triangle -#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR3(xrb, X, Y) #define PIXEL_TYPE bgr_t -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = v2->color; #define RENDER_SPAN( span ) \ GLuint i; \ @@ -1154,10 +1166,11 @@ #define NAME flat_TRUEDITHER_triangle #define SETUP_CODE \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ - XMesaImage *img = xmesa->xm_buffer->backimage; + GET_XRB(xrb); \ + XMesaImage *img = xrb->ximage; #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ for (i = 0; i < span.end; i++, x++) { \ unsigned long p; \ PACK_TRUEDITHER(p, x, y, v2->color[0], \ @@ -1172,11 +1185,11 @@ * XImage, flat, NON-depth-buffered, PF_5R6G5B triangle. */ #define NAME flat_5R6G5B_triangle -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR2(xrb, X, Y) #define PIXEL_TYPE GLushort -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ unsigned long p = PACK_5R6G5B( v2->color[0], \ v2->color[1], v2->color[2] ); #define RENDER_SPAN( span ) \ @@ -1192,15 +1205,16 @@ * XImage, flat, NON-depth-buffered, PF_DITHER_5R6G5B triangle. */ #define NAME flat_DITHER_5R6G5B_triangle -#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR2(xrb, X, Y) #define PIXEL_TYPE GLushort -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ const GLubyte *color = v2->color; #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ for (i = 0; i < span.end; i++, x++) { \ PACK_TRUEDITHER(pRow[i], x, y, color[RCOMP], \ color[GCOMP], color[BCOMP]); \ @@ -1213,16 +1227,16 @@ * XImage, flat, NON-depth-buffered, 8-bit PF_DITHER triangle. */ #define NAME flat_DITHER8_triangle -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X, Y) #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] ); #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ - FLAT_DITHER_ROW_SETUP(FLIP(xmesa->xm_buffer, y)); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ + FLAT_DITHER_ROW_SETUP(YFLIP(xrb, y)); \ for (i = 0; i < span.end; i++, x++) { \ pRow[i] = (PIXEL_TYPE) FLAT_DITHER(x); \ } @@ -1235,12 +1249,12 @@ */ #define NAME flat_DITHER_triangle #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ - XMesaImage *img = xmesa->xm_buffer->backimage; \ + GET_XRB(xrb); \ + XMesaImage *img = xrb->ximage; \ FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] ); #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ FLAT_DITHER_ROW_SETUP(y); \ for (i = 0; i < span.end; i++, x++) { \ unsigned long p = FLAT_DITHER(x); \ @@ -1254,17 +1268,18 @@ * XImage, flat, NON-depth-buffered, 8-bit PF_HPCR triangle. */ #define NAME flat_HPCR_triangle -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X, Y) #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ GLubyte r = v2->color[0]; \ GLubyte g = v2->color[1]; \ GLubyte b = v2->color[2]; #define RENDER_SPAN( span ) \ GLuint i; \ - GLint x = span.x, y = FLIP(xmesa->xm_buffer, span.y); \ + GLint x = span.x, y = YFLIP(xrb, span.y); \ for (i = 0; i < span.end; i++, x++) { \ pRow[i] = (PIXEL_TYPE) DITHER_HPCR(x, y, r, g, b); \ } @@ -1276,11 +1291,11 @@ * XImage, flat, NON-depth-buffered, 8-bit PF_LOOKUP triangle. */ #define NAME flat_LOOKUP8_triangle -#define PIXEL_ADDRESS(X,Y) PIXELADDR1(xmesa->xm_buffer,X,Y) +#define PIXEL_ADDRESS(X,Y) PIXEL_ADDR1(xrb, X, Y) #define PIXEL_TYPE GLubyte -#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line) +#define BYTES_PER_ROW (xrb->ximage->bytes_per_line) #define SETUP_CODE \ - XMesaContext xmesa = XMESA_CONTEXT(ctx); \ + GET_XRB(xrb); \ LOOKUP_SETUP; \ GLubyte r = v2->color[0]; \ GLubyte g = v2->color[1]; \ @@ -1417,12 +1432,16 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx ) SWcontext *swrast = SWRAST_CONTEXT(ctx); XMesaContext xmesa = XMESA_CONTEXT(ctx); int depth = GET_VISUAL_DEPTH(xmesa->xm_visual); + struct xmesa_renderbuffer *xrb = (struct xmesa_renderbuffer *) + ctx->DrawBuffer->_ColorDrawBuffers[0][0]; + return NULL; #ifdef DEBUG triFuncName = NULL; #endif - if ((ctx->Color._DrawDestMask[0] & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) ==0) + if ((ctx->DrawBuffer->_ColorDrawBufferMask[0] + & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) == 0) return (swrast_tri_func) NULL; if (ctx->RenderMode != GL_RENDER) return (swrast_tri_func) NULL; if (ctx->Polygon.SmoothFlag) return (swrast_tri_func) NULL; @@ -1432,7 +1451,7 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx ) ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) return (swrast_tri_func) NULL; - if (xmesa->xm_buffer->buffer==XIMAGE) { + if (xrb->ximage) { if ( ctx->Light.ShadeModel==GL_SMOOTH && swrast->_RasterMask==DEPTH_BIT && ctx->Depth.Func==GL_LESS diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 43712ff21f8..8e6c9dd48a6 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 6.3 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -52,8 +52,11 @@ typedef struct { } bgr_t; +struct xmesa_renderbuffer; + + /* Function pointer for clearing color buffers */ -typedef void (*clear_func)( GLcontext *ctx, +typedef void (*ClearFunc)( GLcontext *ctx, struct xmesa_renderbuffer *xrb, GLboolean all, GLint x, GLint y, GLint width, GLint height ); @@ -131,8 +134,6 @@ struct xmesa_visual { struct xmesa_context { GLcontext mesa; /* the core library context (containment) */ XMesaVisual xm_visual; /* Describes the buffers */ - XMesaBuffer xm_draw_buffer; /* current draw framebuffer */ - XMesaBuffer xm_read_buffer; /* current read framebuffer */ XMesaBuffer xm_buffer; /* current span/point/line/triangle buffer */ XMesaDisplay *display; /* == xm_visual->display */ @@ -155,6 +156,30 @@ typedef enum { } BufferType; +struct xmesa_renderbuffer +{ + struct gl_renderbuffer Base; /* Base class */ + + XMesaDrawable pixmap; /* Either an X Window ID (front color buf) */ + /* or X Pixmap ID (back color buf) */ + + XMesaImage *ximage; /* The back buffer, if not using a Pixmap */ + + GLubyte *origin1; /* used for PIXEL_ADDR1 macro */ + GLint width1; + GLushort *origin2; /* used for PIXEL_ADDR2 macro */ + GLint width2; + GLubyte *origin3; /* used for PIXEL_ADDR3 macro */ + GLint width3; + GLuint *origin4; /* used for PIXEL_ADDR4 macro */ + GLint width4; + + GLint bottom; /* used for FLIP macro */ + + ClearFunc clearFunc; +}; + + /* * "Derived" from GLframebuffer. Basically corresponds to a GLXDrawable. */ @@ -166,12 +191,9 @@ struct xmesa_buffer { XMesaDisplay *display; BufferType type; /* window, pixmap, pbuffer or glxwindow */ - XMesaDrawable frontbuffer; /* either a window or pixmap */ - XMesaPixmap backpixmap; /* back buffer Pixmap */ - XMesaImage *backimage; /* back buffer simulated XImage */ - XMesaDrawable buffer; /* the current buffer, either equal to */ - /* frontbuffer, backpixmap or XIMAGE (None) */ + struct xmesa_renderbuffer *frontxrb; /* front color renderbuffer */ + struct xmesa_renderbuffer *backxrb; /* back color renderbuffer */ XMesaColormap cmap; /* the X colormap */ @@ -192,17 +214,6 @@ struct xmesa_buffer { #endif XMesaImage *rowimage; /* Used for optimized span writing */ - - GLint bottom; /* used for FLIP macro below */ - GLubyte *ximage_origin1; /* used for PIXELADDR1 macro */ - GLint ximage_width1; - GLushort *ximage_origin2; /* used for PIXELADDR2 macro */ - GLint ximage_width2; - GLubyte *ximage_origin3; /* used for PIXELADDR3 macro */ - GLint ximage_width3; - GLuint *ximage_origin4; /* used for PIXELADDR4 macro */ - GLint ximage_width4; - XMesaPixmap stipple_pixmap; /* For polygon stippling */ XMesaGC stipple_gc; /* For polygon stippling */ @@ -237,23 +248,15 @@ struct xmesa_buffer { fxMesaContext FXctx; #endif - /* functions for clearing the front and back color buffers */ - clear_func front_clear_func; - clear_func back_clear_func; - struct xmesa_buffer *Next; /* Linked list pointer: */ }; - -/* Values for xmesa->dest: */ +/* Values for xmesa->db_state: */ #define FRONT_PIXMAP 1 #define BACK_PIXMAP 2 #define BACK_XIMAGE 4 -/* Special value for X Drawable variables to indicate use of XImage instead */ -#define XIMAGE None - /* * If pixelformat==PF_TRUECOLOR: @@ -341,7 +344,7 @@ extern const int xmesa_kernel8[DITH_DY * DITH_DX]; /* Dither for random X,Y */ #define DITHER_SETUP \ int __d; \ - unsigned long *ctable = xmesa->xm_buffer->color_table; + unsigned long *ctable = XMESA_BUFFER(ctx->DrawBuffer)->color_table; #define DITHER( X, Y, R, G, B ) \ (__d = xmesa_kernel8[(((Y)&3)<<2) | ((X)&3)], \ @@ -352,7 +355,7 @@ extern const int xmesa_kernel8[DITH_DY * DITH_DX]; /* Dither for random X, fixed Y */ #define XDITHER_SETUP(Y) \ int __d; \ - unsigned long *ctable = xmesa->xm_buffer->color_table; \ + unsigned long *ctable = XMESA_BUFFER(ctx->DrawBuffer)->color_table; \ const int *kernel = &xmesa_kernel8[ ((Y)&3) << 2 ]; #define XDITHER( X, R, G, B ) \ @@ -370,7 +373,7 @@ extern const int xmesa_kernel8[DITH_DY * DITH_DX]; #define FLAT_DITHER_SETUP( R, G, B ) \ GLushort ditherValues[16]; \ { \ - unsigned long *ctable = xmesa->xm_buffer->color_table; \ + unsigned long *ctable = XMESA_BUFFER(ctx->DrawBuffer)->color_table; \ int msdr = (DITH_N*((DITH_R)-1)+1) * (R); \ int msdg = (DITH_N*((DITH_G)-1)+1) * (G); \ int msdb = (DITH_N*((DITH_B)-1)+1) * (B); \ @@ -395,7 +398,7 @@ extern const int xmesa_kernel8[DITH_DY * DITH_DX]; #define _dither_lookup(C, c) (((unsigned)((DITH_N * (C - 1) + 1) * c)) >> 12) #define LOOKUP_SETUP \ - unsigned long *ctable = xmesa->xm_buffer->color_table + unsigned long *ctable = XMESA_BUFFER(ctx->DrawBuffer)->color_table #define LOOKUP( R, G, B ) \ ctable[DITH_MIX(_dither_lookup(DITH_R, (R)), \ @@ -438,31 +441,31 @@ extern const int xmesa_kernel1[16]; /* * If pixelformat==PF_GRAYSCALE: */ -#define GRAY_RGB( R, G, B ) xmesa->xm_buffer->color_table[((R) + (G) + (B))/3] +#define GRAY_RGB( R, G, B ) XMESA_BUFFER(ctx->DrawBuffer)->color_table[((R) + (G) + (B))/3] /* * Converts a GL window Y coord to an X window Y coord: */ -#define FLIP(BUFFER, Y) ((BUFFER)->bottom-(Y)) +#define YFLIP(XRB, Y) ((XRB)->bottom - (Y)) /* - * Return the address of a 1, 2 or 4-byte pixel in the back XImage: + * Return the address of a 1, 2 or 4-byte pixel in the buffer's XImage: * X==0 is left, Y==0 is bottom. */ -#define PIXELADDR1( BUFFER, X, Y ) \ - ( (BUFFER)->ximage_origin1 - (Y) * (BUFFER)->ximage_width1 + (X) ) +#define PIXEL_ADDR1(XRB, X, Y) \ + ( (XRB)->origin1 - (Y) * (XRB)->width1 + (X) ) -#define PIXELADDR2( BUFFER, X, Y ) \ - ( (BUFFER)->ximage_origin2 - (Y) * (BUFFER)->ximage_width2 + (X) ) +#define PIXEL_ADDR2(XRB, X, Y) \ + ( (XRB)->origin2 - (Y) * (XRB)->width2 + (X) ) -#define PIXELADDR3( BUFFER, X, Y ) \ - ( (bgr_t *) ( (BUFFER)->ximage_origin3 - (Y) * (BUFFER)->ximage_width3 + 3 * (X) )) +#define PIXEL_ADDR3(XRB, X, Y) \ + ( (bgr_t *) ( (XRB)->origin3 - (Y) * (XRB)->width3 + 3 * (X) )) -#define PIXELADDR4( BUFFER, X, Y ) \ - ( (BUFFER)->ximage_origin4 - (Y) * (BUFFER)->ximage_width4 + (X) ) +#define PIXEL_ADDR4(XRB, X, Y) \ + ( (XRB)->origin4 - (Y) * (XRB)->width4 + (X) ) @@ -471,7 +474,13 @@ extern const int xmesa_kernel1[16]; * Return pointer to XMesaContext corresponding to a Mesa GLcontext. * Since we're using structure containment, it's just a cast!. */ -#define XMESA_CONTEXT(MESACTX) (XMesaContext) (MESACTX) +#define XMESA_CONTEXT(MESACTX) ((XMesaContext) (MESACTX)) + +/* + * Return pointer to XMesaBuffer corresponding to a Mesa GLframebuffer. + * Since we're using structure containment, it's just a cast!. + */ +#define XMESA_BUFFER(MESABUFF) ((XMesaBuffer) (MESABUFF)) @@ -479,21 +488,29 @@ extern const int xmesa_kernel1[16]; * External functions: */ +extern struct xmesa_renderbuffer * +xmesa_new_renderbuffer(GLcontext *ctx, GLuint name, GLboolean rgbMode); + extern unsigned long -xmesa_color_to_pixel( XMesaContext xmesa, +xmesa_color_to_pixel( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLuint pixelFormat ); -extern void xmesa_alloc_back_buffer( XMesaBuffer b ); +extern void +xmesa_alloc_back_buffer(XMesaBuffer b, GLuint width, GLuint height); -extern void xmesa_resize_buffers( GLframebuffer *buffer ); +extern void xmesa_resize_buffers(GLcontext *ctx, GLframebuffer *buffer, + GLuint width, GLuint height); extern void xmesa_init_driver_functions( XMesaVisual xmvisual, struct dd_function_table *driver ); extern void xmesa_update_state( GLcontext *ctx, GLuint new_state ); -extern void xmesa_update_span_funcs( GLcontext *ctx ); +extern void +xmesa_set_renderbuffer_funcs(struct xmesa_renderbuffer *xrb, + enum pixel_format pixelformat, GLint depth); + extern void xmesa_set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit ); diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c index 315bd33b61d..c1346bab4cd 100644 --- a/src/mesa/main/accum.c +++ b/src/mesa/main/accum.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 5.1 + * Version: 6.3 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -63,6 +63,19 @@ _mesa_Accum( GLenum op, GLfloat value ) return; } + switch (op) { + case GL_ADD: + case GL_MULT: + case GL_ACCUM: + case GL_LOAD: + case GL_RETURN: + /* OK */ + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glAccum(op)"); + return; + } + if (ctx->NewState) _mesa_update_state( ctx ); @@ -89,6 +102,8 @@ _mesa_Accum( GLenum op, GLfloat value ) ctx->Driver.Accum( ctx, op, value, xpos, ypos, width, height ); } + + void _mesa_init_accum( GLcontext *ctx ) { diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index d45593cc990..da6011c1cef 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -833,8 +833,13 @@ _mesa_PopAttrib(void) (GLboolean) (color->ColorMask[1] != 0), (GLboolean) (color->ColorMask[2] != 0), (GLboolean) (color->ColorMask[3] != 0)); +#if 0 _mesa_DrawBuffersARB(ctx->Const.MaxDrawBuffers, color->DrawBuffer); +#else + _mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers, + color->DrawBuffer, NULL); +#endif _mesa_set_enable(ctx, GL_ALPHA_TEST, color->AlphaEnabled); _mesa_AlphaFunc(color->AlphaFunc, color->AlphaRef); _mesa_set_enable(ctx, GL_BLEND, color->BlendEnabled); @@ -992,6 +997,8 @@ _mesa_PopAttrib(void) break; case GL_PIXEL_MODE_BIT: MEMCPY( &ctx->Pixel, attr->data, sizeof(struct gl_pixel_attrib) ); + /* XXX what other pixel state needs to be set by function calls? */ + _mesa_ReadBuffer(ctx->Pixel.ReadBuffer); ctx->NewState |= _NEW_PIXEL; break; case GL_POINT_BIT: diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index 8fadef61b48..61b2b17c0c3 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -570,11 +570,9 @@ void _mesa_init_color( GLcontext * ctx ) if (ctx->Visual.doubleBufferMode) { ctx->Color.DrawBuffer[0] = GL_BACK; - ctx->Color._DrawDestMask[0] = DD_BACK_LEFT_BIT; } else { ctx->Color.DrawBuffer[0] = GL_FRONT; - ctx->Color._DrawDestMask[0] = DD_FRONT_LEFT_BIT; } } diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 185d841f812..07b2341ff7a 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -900,7 +900,7 @@ _mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params) switch (pname) { case GL_BUFFER_SIZE_ARB: - *params = bufObj->Size; + *params = (GLint) bufObj->Size; break; case GL_BUFFER_USAGE_ARB: *params = bufObj->Usage; diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 41a1fdb7cca..12f58ff6621 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -29,16 +29,15 @@ #include "glheader.h" -#include "imports.h" #include "buffers.h" #include "colormac.h" #include "context.h" -#include "depth.h" #include "enums.h" #include "fbobject.h" -#include "stencil.h" #include "state.h" -#include "mtypes.h" + + +#define BAD_MASK ~0u #if _HAVE_FULL_GL @@ -133,12 +132,12 @@ _mesa_Clear( GLbitfield mask ) _mesa_update_state( ctx ); /* update _Xmin, etc */ } - if (ctx->RenderMode==GL_RENDER) { + if (ctx->RenderMode == GL_RENDER) { const GLint x = ctx->DrawBuffer->_Xmin; const GLint y = ctx->DrawBuffer->_Ymin; const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - GLbitfield ddMask; + GLbitfield bufferMask; /* don't clear depth buffer if depth writing disabled */ if (!ctx->Depth.Mask) @@ -146,20 +145,31 @@ _mesa_Clear( GLbitfield mask ) /* Build the bitmask to send to device driver's Clear function. * Note that the GL_COLOR_BUFFER_BIT flag will expand to 0, 1, 2 or 4 - * of the FRONT/BACK_LEFT/RIGHT_BIT flags. + * of the BUFFER_BIT_FRONT/BACK_LEFT/RIGHT flags, or one of the + * BUFFER_BIT_COLORn flags. */ - ddMask = 0; - if (mask & GL_COLOR_BUFFER_BIT) - ddMask |= ctx->Color._DrawDestMask[0]; - if ((mask & GL_DEPTH_BUFFER_BIT) && ctx->Visual.depthBits > 0) - ddMask |= GL_DEPTH_BUFFER_BIT; - if ((mask & GL_STENCIL_BUFFER_BIT) && ctx->Visual.stencilBits > 0) - ddMask |= GL_STENCIL_BUFFER_BIT; - if ((mask & GL_ACCUM_BUFFER_BIT) && ctx->Visual.accumRedBits > 0) - ddMask |= GL_ACCUM_BUFFER_BIT; + bufferMask = 0; + if (mask & GL_COLOR_BUFFER_BIT) { + bufferMask |= ctx->DrawBuffer->_ColorDrawBufferMask[0]; + } + + if ((mask & GL_DEPTH_BUFFER_BIT) + && ctx->DrawBuffer->Visual.haveDepthBuffer) { + bufferMask |= BUFFER_BIT_DEPTH; + } + + if ((mask & GL_STENCIL_BUFFER_BIT) + && ctx->DrawBuffer->Visual.haveStencilBuffer) { + bufferMask |= BUFFER_BIT_STENCIL; + } + + if ((mask & GL_ACCUM_BUFFER_BIT) + && ctx->DrawBuffer->Visual.haveAccumBuffer) { + bufferMask |= BUFFER_BIT_ACCUM; + } ASSERT(ctx->Driver.Clear); - ctx->Driver.Clear( ctx, ddMask, (GLboolean) !ctx->Scissor.Enabled, + ctx->Driver.Clear( ctx, bufferMask, (GLboolean) !ctx->Scissor.Enabled, x, y, width, height ); } } @@ -167,27 +177,41 @@ _mesa_Clear( GLbitfield mask ) /** - * Return bitmask of DD_* flags indicating which color buffers are - * available to the rendering context; + * Return bitmask of BUFFER_BIT_* flags indicating which color buffers are + * available to the rendering context. + * This depends on the framebuffer we're writing to. For window system + * framebuffers we look at the framebuffer's visual. But for user- + * create framebuffers we look at the number of supported color attachments. */ static GLuint -supported_buffer_bitmask(const GLcontext *ctx) +supported_buffer_bitmask(const GLcontext *ctx, GLuint framebufferID) { - GLuint mask = DD_FRONT_LEFT_BIT; /* always have this */ + GLuint mask = 0x0; GLint i; - if (ctx->Visual.stereoMode) { - mask |= DD_FRONT_RIGHT_BIT; - if (ctx->Visual.doubleBufferMode) { - mask |= DD_BACK_LEFT_BIT | DD_BACK_RIGHT_BIT; + if (framebufferID > 0) { + /* A user-created renderbuffer */ + ASSERT(ctx->Extensions.EXT_framebuffer_object); + for (i = 0; i < ctx->Const.MaxColorAttachments; i++) { + mask |= (BUFFER_BIT_COLOR0 << i); } } - else if (ctx->Visual.doubleBufferMode) { - mask |= DD_BACK_LEFT_BIT; - } + else { + /* A window system renderbuffer */ + mask = BUFFER_BIT_FRONT_LEFT; /* always have this */ + if (ctx->Visual.stereoMode) { + mask |= BUFFER_BIT_FRONT_RIGHT; + if (ctx->Visual.doubleBufferMode) { + mask |= BUFFER_BIT_BACK_LEFT | BUFFER_BIT_BACK_RIGHT; + } + } + else if (ctx->Visual.doubleBufferMode) { + mask |= BUFFER_BIT_BACK_LEFT; + } - for (i = 0; i < ctx->Visual.numAuxBuffers; i++) { - mask |= (DD_AUX0_BIT << i); + for (i = 0; i < ctx->Visual.numAuxBuffers; i++) { + mask |= (BUFFER_BIT_AUX0 << i); + } } return mask; @@ -196,45 +220,53 @@ supported_buffer_bitmask(const GLcontext *ctx) /** * Helper routine used by glDrawBuffer and glDrawBuffersARB. - * Given a GLenum naming (a) color buffer(s), return the corresponding - * bitmask of DD_* flags. + * Given a GLenum naming one or more color buffers (such as + * GL_FRONT_AND_BACK), return the corresponding bitmask of BUFFER_BIT_* flags. */ static GLuint draw_buffer_enum_to_bitmask(GLenum buffer) { switch (buffer) { - case GL_FRONT: - return DD_FRONT_LEFT_BIT | DD_FRONT_RIGHT_BIT; - case GL_BACK: - return DD_BACK_LEFT_BIT | DD_BACK_RIGHT_BIT; case GL_NONE: return 0; + case GL_FRONT: + return BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_FRONT_RIGHT; + case GL_BACK: + return BUFFER_BIT_BACK_LEFT | BUFFER_BIT_BACK_RIGHT; case GL_RIGHT: - return DD_FRONT_RIGHT_BIT | DD_BACK_RIGHT_BIT; + return BUFFER_BIT_FRONT_RIGHT | BUFFER_BIT_BACK_RIGHT; case GL_FRONT_RIGHT: - return DD_FRONT_RIGHT_BIT; + return BUFFER_BIT_FRONT_RIGHT; case GL_BACK_RIGHT: - return DD_BACK_RIGHT_BIT; + return BUFFER_BIT_BACK_RIGHT; case GL_BACK_LEFT: - return DD_BACK_LEFT_BIT; + return BUFFER_BIT_BACK_LEFT; case GL_FRONT_AND_BACK: - return DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT - | DD_FRONT_RIGHT_BIT | DD_BACK_RIGHT_BIT; + return BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT + | BUFFER_BIT_FRONT_RIGHT | BUFFER_BIT_BACK_RIGHT; case GL_LEFT: - return DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT; + return BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT; case GL_FRONT_LEFT: - return DD_FRONT_LEFT_BIT; + return BUFFER_BIT_FRONT_LEFT; case GL_AUX0: - return DD_AUX0_BIT; + return BUFFER_BIT_AUX0; case GL_AUX1: - return DD_AUX1_BIT; + return BUFFER_BIT_AUX1; case GL_AUX2: - return DD_AUX2_BIT; + return BUFFER_BIT_AUX2; case GL_AUX3: - return DD_AUX3_BIT; + return BUFFER_BIT_AUX3; + case GL_COLOR_ATTACHMENT0_EXT: + return BUFFER_BIT_COLOR0; + case GL_COLOR_ATTACHMENT1_EXT: + return BUFFER_BIT_COLOR1; + case GL_COLOR_ATTACHMENT2_EXT: + return BUFFER_BIT_COLOR2; + case GL_COLOR_ATTACHMENT3_EXT: + return BUFFER_BIT_COLOR3; default: /* error */ - return ~0; + return BAD_MASK; } } @@ -249,43 +281,48 @@ read_buffer_enum_to_bitmask(GLenum buffer) { switch (buffer) { case GL_FRONT: - return DD_FRONT_LEFT_BIT; + return BUFFER_BIT_FRONT_LEFT; case GL_BACK: - return DD_BACK_LEFT_BIT; + return BUFFER_BIT_BACK_LEFT; case GL_RIGHT: - return DD_FRONT_RIGHT_BIT; + return BUFFER_BIT_FRONT_RIGHT; case GL_FRONT_RIGHT: - return DD_FRONT_RIGHT_BIT; + return BUFFER_BIT_FRONT_RIGHT; case GL_BACK_RIGHT: - return DD_BACK_RIGHT_BIT; + return BUFFER_BIT_BACK_RIGHT; case GL_BACK_LEFT: - return DD_BACK_LEFT_BIT; + return BUFFER_BIT_BACK_LEFT; case GL_LEFT: - return DD_FRONT_LEFT_BIT; + return BUFFER_BIT_FRONT_LEFT; case GL_FRONT_LEFT: - return DD_FRONT_LEFT_BIT; + return BUFFER_BIT_FRONT_LEFT; case GL_AUX0: - return DD_AUX0_BIT; + return BUFFER_BIT_AUX0; case GL_AUX1: - return DD_AUX1_BIT; + return BUFFER_BIT_AUX1; case GL_AUX2: - return DD_AUX2_BIT; + return BUFFER_BIT_AUX2; case GL_AUX3: - return DD_AUX3_BIT; + return BUFFER_BIT_AUX3; + case GL_COLOR_ATTACHMENT0_EXT: + return BUFFER_BIT_COLOR0; + case GL_COLOR_ATTACHMENT1_EXT: + return BUFFER_BIT_COLOR1; + case GL_COLOR_ATTACHMENT2_EXT: + return BUFFER_BIT_COLOR2; + case GL_COLOR_ATTACHMENT3_EXT: + return BUFFER_BIT_COLOR3; default: /* error */ - return ~0; + return BAD_MASK; } } - /** * Specify which color buffers to draw into. * - * \param mode color buffer combination. - * - * \sa glDrawBuffer(). + * \param buffer color buffer, such as GL_LEFT or GL_FRONT_AND_BACK. * * Flushes the vertices and verifies the parameter and updates the * gl_colorbuffer_attrib::_DrawDestMask bitfield. Marks new color state in @@ -293,160 +330,180 @@ read_buffer_enum_to_bitmask(GLenum buffer) * dd_function_table::DrawBuffer callback. */ void GLAPIENTRY -_mesa_DrawBuffer( GLenum mode ) +_mesa_DrawBuffer(GLenum buffer) { + GLuint bufferID; + GLuint destMask; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex... */ - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glDrawBuffer %s\n", _mesa_lookup_enum_by_nr(mode)); + if (MESA_VERBOSE & VERBOSE_API) { + _mesa_debug(ctx, "glDrawBuffer %s\n", _mesa_lookup_enum_by_nr(buffer)); + } - if (ctx->Extensions.EXT_framebuffer_object && ctx->CurrentFramebuffer) { - /* Set drawbuffer for a framebuffer object */ - if (mode == GL_NONE) { - ctx->CurrentFramebuffer->DrawBuffer[0] = mode; - } - else { - const GLint k = mode - GL_COLOR_ATTACHMENT0_EXT; - if (k >= 0 && k < ctx->Const.MaxColorAttachments) { - /* XXX check that the attachment point's Type != GL_NONE */ - ctx->CurrentFramebuffer->DrawBuffer[0] = mode; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffer(mode)"); - return; - } - } + bufferID = ctx->DrawBuffer->Name; + + if (buffer == GL_NONE) { + destMask = 0x0; } else { - /* conventional behaviour */ - /* Do error checking and compute the _DrawDestMask bitfield. */ - GLenum destMask, supportedMask; - - destMask = draw_buffer_enum_to_bitmask(mode); - if (destMask == ~0u) { - _mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffer(mode)"); + const GLuint supportedMask = supported_buffer_bitmask(ctx, bufferID); + destMask = draw_buffer_enum_to_bitmask(buffer); + if (destMask == BAD_MASK) { + /* totally bogus buffer */ + _mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffer(buffer)"); return; } - - supportedMask = supported_buffer_bitmask(ctx); destMask &= supportedMask; - - if (destMask == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffer(mode)"); + if (destMask == 0x0) { + /* none of the named color buffers exist! */ + _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffer(buffer)"); return; } - - ctx->Color.DrawBuffer[0] = mode; - ctx->Color._DrawDestMask[0] = destMask; - ctx->NewState |= _NEW_COLOR; } - /* - * Call device driver function. - */ - if (ctx->Driver.DrawBuffer) - (*ctx->Driver.DrawBuffer)(ctx, mode); + /* if we get here, there's no error so set new state */ + _mesa_drawbuffers(ctx, 1, &buffer, &destMask); } /** * Called by glDrawBuffersARB; specifies the destination color buffers * for N fragment program color outputs. + * + * XXX This function is called by _mesa_PopAttrib() and we need to do + * some more work to deal with the current framebuffer binding state! */ void GLAPIENTRY _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers) { + GLint output; + GLuint usedBufferMask, supportedMask; + GLuint bufferID; + GLuint destMask[MAX_DRAW_BUFFERS]; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (!ctx->Extensions.ARB_draw_buffers) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffersARB"); + return; + } if (n < 1 || n > (GLsizei) ctx->Const.MaxDrawBuffers) { - _mesa_error(ctx, GL_INVALID_VALUE, "glDrawBuffersARB(n)" ); + _mesa_error(ctx, GL_INVALID_VALUE, "glDrawBuffersARB(n)"); return; } - if (ctx->Extensions.EXT_framebuffer_object && ctx->CurrentFramebuffer) { - /* Set drawbuffers for a framebuffer object */ - GLint i; - GLuint usedAttachments = 0x0; - for (i = 0; i < n; i++) { - if (buffers[i] == GL_NONE) { - /* OK */ - ctx->CurrentFramebuffer->DrawBuffer[i] = GL_NONE; - } - else { - const GLint k = buffers[i] - GL_COLOR_ATTACHMENT0_EXT; - if (k >= 0 && k < ctx->Const.MaxColorAttachments) { - /* XXX check that the attachment point's Type != GL_NONE */ - if ((1 << k) & usedAttachments) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glDrawBuffersARB(duplicated attachment)"); - return; - } - usedAttachments |= (1 << k); - ctx->CurrentFramebuffer->DrawBuffer[i] = buffers[i]; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffersARB(mode)"); - return; - } - } - } + bufferID = ctx->DrawBuffer->Name; + + supportedMask = supported_buffer_bitmask(ctx, bufferID); + usedBufferMask = 0x0; - /* set remaining color outputs to NONE */ - for (i = n; i < ctx->Const.MaxDrawBuffers; i++) { - ctx->CurrentFramebuffer->DrawBuffer[i] = GL_NONE; + /* complicated error checking... */ + for (output = 0; output < n; output++) { + if (buffers[output] == GL_NONE) { + destMask[output] = 0x0; } - } - else { - /* Conventional operation */ - GLint i; - GLuint usedBufferMask, supportedMask; - - supportedMask = supported_buffer_bitmask(ctx); - usedBufferMask = 0; - for (i = 0; i < n; i++) { - GLuint destMask = draw_buffer_enum_to_bitmask(buffers[i]); - if (destMask == ~0u ) { + else { + destMask[output] = draw_buffer_enum_to_bitmask(buffers[output]); + if (destMask[output] == BAD_MASK + || _mesa_bitcount(destMask[output]) > 1) { _mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffersARB(buffer)"); return; } - destMask &= supportedMask; - if (destMask == 0) { + destMask[output] &= supportedMask; + if (destMask[output] == 0) { _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffersARB(unsupported buffer)"); return; } - if (destMask & usedBufferMask) { + if (destMask[output] & usedBufferMask) { /* can't specify a dest buffer more than once! */ _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffersARB(duplicated buffer)"); return; } + /* update bitmask */ - usedBufferMask |= destMask; - /* save state */ - ctx->Color.DrawBuffer[i] = buffers[i]; - ctx->Color._DrawDestMask[i] = destMask; + usedBufferMask |= destMask[output]; } + } + + /* OK, if we get here, there were no errors so set the new state */ + _mesa_drawbuffers(ctx, n, buffers, destMask); +} + - /* set remaining color outputs to NONE */ - for (i = n; i < ctx->Const.MaxDrawBuffers; i++) { - ctx->Color.DrawBuffer[i] = GL_NONE; - ctx->Color._DrawDestMask[i] = 0; +/** + * Set color output state. Traditionally, there was only one color + * output, but fragment programs can now have several distinct color + * outputs (see GL_ARB_draw_buffers). This function sets the state + * for one such color output. + */ +static void +set_color_output(GLcontext *ctx, GLuint output, GLenum buffer, GLuint destMask) +{ + struct gl_framebuffer *fb = ctx->DrawBuffer; + + ASSERT(output < ctx->Const.MaxDrawBuffers); + + fb->ColorDrawBuffer[output] = buffer; + fb->_ColorDrawBufferMask[output] = destMask; + + if (fb->Name == 0) { + /* Set traditional state var */ + ctx->Color.DrawBuffer[output] = buffer; + } + + /* not really needed, will be set later */ + fb->_NumColorDrawBuffers[output] = 0; +} + + +/** + * Helper routine used by _mesa_DrawBuffer, _mesa_DrawBuffersARB and + * _mesa_PopAttrib to set drawbuffer state. + */ +void +_mesa_drawbuffers(GLcontext *ctx, GLsizei n, const GLenum *buffers, + const GLuint *destMask) +{ + GLuint mask[MAX_DRAW_BUFFERS]; + GLint output; + + if (!destMask) { + /* compute destMask values now */ + const GLuint bufferID = ctx->DrawBuffer->Name; + const GLuint supportedMask = supported_buffer_bitmask(ctx, bufferID); + for (output = 0; output < n; output++) { + mask[output] = draw_buffer_enum_to_bitmask(buffers[output]); + ASSERT(mask[output] != BAD_MASK); + mask[output] &= supportedMask; } + destMask = mask; + } + + for (output = 0; output < n; output++) { + set_color_output(ctx, output, buffers[output], destMask[output]); + } - ctx->NewState |= _NEW_COLOR; + /* set remaining color outputs to NONE */ + for (output = n; output < ctx->Const.MaxDrawBuffers; output++) { + set_color_output(ctx, output, GL_NONE, 0x0); } + ctx->NewState |= _NEW_COLOR; + /* * Call device driver function. */ if (ctx->Driver.DrawBuffers) - (*ctx->Driver.DrawBuffers)(ctx, n, buffers); + ctx->Driver.DrawBuffers(ctx, n, buffers); + else if (ctx->Driver.DrawBuffer) + ctx->Driver.DrawBuffer(ctx, buffers[0]); } + /** * Set the color buffer source for reading pixels. * @@ -454,60 +511,53 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers) * * \sa glReadBuffer(). * - * Verifies the parameter and updates gl_pixel_attrib::_ReadSrcMask. Marks - * new pixel state in __GLcontextRec::NewState and notifies the driver via - * dd_function_table::ReadBuffer. */ void GLAPIENTRY -_mesa_ReadBuffer( GLenum mode ) +_mesa_ReadBuffer(GLenum buffer) { + struct gl_framebuffer *fb; + GLuint srcMask, supportedMask; + GLuint bufferID; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + fb = ctx->ReadBuffer; + bufferID = fb->Name; + if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(mode)); + _mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(buffer)); - if (ctx->Extensions.EXT_framebuffer_object && ctx->CurrentFramebuffer) { - /* Set readbuffer for a framebuffer object */ - if (mode == GL_NONE) { - ctx->CurrentFramebuffer->ReadBuffer = mode; - } - else { - const GLint k = mode - GL_COLOR_ATTACHMENT0_EXT; - if (k >= 0 && k < ctx->Const.MaxColorAttachments) { - /* XXX check that the attachment point's Type != GL_NONE */ - ctx->CurrentFramebuffer->ReadBuffer = mode; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glReadBuffer(mode)"); - return; - } - } + if (bufferID > 0 && buffer == GL_NONE) { + /* legal! */ + srcMask = 0x0; } else { - /* conventional operation */ - GLuint srcMask, supportedMask; - - srcMask = read_buffer_enum_to_bitmask(mode); - if (srcMask == ~0u) { - _mesa_error(ctx, GL_INVALID_ENUM, "glReadBuffer(mode)"); + /* general case */ + srcMask = read_buffer_enum_to_bitmask(buffer); + if (srcMask == BAD_MASK) { + _mesa_error(ctx, GL_INVALID_ENUM, "glReadBuffer(buffer)"); return; } - supportedMask = supported_buffer_bitmask(ctx); + supportedMask = supported_buffer_bitmask(ctx, bufferID); if ((srcMask & supportedMask) == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glReadBuffer(mode)"); + _mesa_error(ctx, GL_INVALID_OPERATION, "glReadBuffer(buffer)"); return; } - ctx->Pixel._ReadSrcMask = srcMask; - ctx->Pixel.ReadBuffer = mode; - ctx->NewState |= _NEW_PIXEL; } + if (bufferID == 0) { + ctx->Pixel.ReadBuffer = buffer; + } + fb->ColorReadBuffer = buffer; + fb->_ColorReadBufferMask = srcMask; + + ctx->NewState |= _NEW_PIXEL; + /* * Call device driver function. */ if (ctx->Driver.ReadBuffer) - (*ctx->Driver.ReadBuffer)(ctx, mode); + (*ctx->Driver.ReadBuffer)(ctx, buffer); } @@ -524,53 +574,51 @@ _mesa_ReadBuffer( GLenum mode ) * \note This function may be called from within Mesa or called by the * user directly (see the GL_MESA_resize_buffers extension). */ +#if OLD_RENDERBUFFER +/* THIS FUNCTION IS OBSOLETE!!! + * See _mesa_resize_framebuffer + */ +#endif void GLAPIENTRY _mesa_ResizeBuffersMESA( void ) { GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx ); + if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glResizeBuffersMESA\n"); - if (ctx) { - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx ); - - if (ctx->DrawBuffer) { - GLuint buf_width, buf_height; - GLframebuffer *buffer = ctx->DrawBuffer; - - /* ask device driver for size of output buffer */ - (*ctx->Driver.GetBufferSize)( buffer, &buf_width, &buf_height ); + if (ctx->DrawBuffer && ctx->DrawBuffer->Name == 0) { + GLuint newWidth, newHeight; + GLframebuffer *buffer = ctx->DrawBuffer; - /* see if size of device driver's color buffer (window) has changed */ - if (buffer->Width == buf_width && buffer->Height == buf_height) - return; /* size is as expected */ + /* ask device driver for size of output buffer */ + ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight ); - buffer->Width = buf_width; - buffer->Height = buf_height; - - ctx->Driver.ResizeBuffers( buffer ); + /* see if size of device driver's color buffer (window) has changed */ + if (buffer->Width != newWidth || buffer->Height != newHeight) { + if (ctx->Driver.ResizeBuffers) + ctx->Driver.ResizeBuffers(ctx, buffer, newWidth, newHeight ); } + } - if (ctx->ReadBuffer && ctx->ReadBuffer != ctx->DrawBuffer) { - GLuint buf_width, buf_height; - GLframebuffer *buffer = ctx->ReadBuffer; - - /* ask device driver for size of read buffer */ - (*ctx->Driver.GetBufferSize)( buffer, &buf_width, &buf_height ); - - /* see if size of device driver's color buffer (window) has changed */ - if (buffer->Width == buf_width && buffer->Height == buf_height) - return; /* size is as expected */ + if (ctx->ReadBuffer && ctx->ReadBuffer != ctx->DrawBuffer + && ctx->ReadBuffer->Name == 0) { + GLuint newWidth, newHeight; + GLframebuffer *buffer = ctx->ReadBuffer; - buffer->Width = buf_width; - buffer->Height = buf_height; + /* ask device driver for size of read buffer */ + ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight ); - ctx->Driver.ResizeBuffers( buffer ); + /* see if size of device driver's color buffer (window) has changed */ + if (buffer->Width != newWidth || buffer->Height != newHeight) { + if (ctx->Driver.ResizeBuffers) + ctx->Driver.ResizeBuffers(ctx, buffer, newWidth, newHeight ); } - - ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */ } + + ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */ } @@ -641,56 +689,6 @@ _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height ) -/**********************************************************************/ -/** \name State management */ -/*@{*/ - - -/** - * Update the context's current drawing buffer's Xmin, Xmax, Ymin, Ymax fields. - * These values are computed from the buffer's width and height and - * the scissor box, if it's enabled. - * \param ctx the GL context. - */ -void -_mesa_update_draw_buffer_bounds(GLcontext *ctx) -{ - GLframebuffer *buffer = ctx->DrawBuffer; - - buffer->_Xmin = 0; - buffer->_Ymin = 0; - buffer->_Xmax = buffer->Width; - buffer->_Ymax = buffer->Height; - - if (ctx->Scissor.Enabled) { - if (ctx->Scissor.X > buffer->_Xmin) { - buffer->_Xmin = ctx->Scissor.X; - } - if (ctx->Scissor.Y > buffer->_Ymin) { - buffer->_Ymin = ctx->Scissor.Y; - } - if (ctx->Scissor.X + ctx->Scissor.Width < buffer->_Xmax) { - buffer->_Xmax = ctx->Scissor.X + ctx->Scissor.Width; - } - if (ctx->Scissor.Y + ctx->Scissor.Height < buffer->_Ymax) { - buffer->_Ymax = ctx->Scissor.Y + ctx->Scissor.Height; - } - /* finally, check for empty region */ - if (buffer->_Xmin > buffer->_Xmax) { - buffer->_Xmin = buffer->_Xmax; - } - if (buffer->_Ymin > buffer->_Ymax) { - buffer->_Ymin = buffer->_Ymax; - } - } - - ASSERT(buffer->_Xmin <= buffer->_Xmax); - ASSERT(buffer->_Ymin <= buffer->_Ymax); -} - -/*@}*/ - - /**********************************************************************/ /** \name Initialization */ /*@{*/ diff --git a/src/mesa/main/buffers.h b/src/mesa/main/buffers.h index c436e6bf511..0c7f68ee79e 100644 --- a/src/mesa/main/buffers.h +++ b/src/mesa/main/buffers.h @@ -52,6 +52,10 @@ _mesa_DrawBuffer( GLenum mode ); extern void GLAPIENTRY _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers); +extern void +_mesa_drawbuffers(GLcontext *ctx, GLsizei n, const GLenum *buffers, + const GLuint *destMask); + extern void GLAPIENTRY _mesa_ReadBuffer( GLenum mode ); @@ -64,9 +68,6 @@ _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height ); extern void GLAPIENTRY _mesa_SampleCoverageARB(GLclampf value, GLboolean invert); -extern void -_mesa_update_draw_buffer_bounds(GLcontext *ctx); - extern void _mesa_init_scissor(GLcontext *ctx); diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index 801c10b0810..456f8ce76a9 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -5,9 +5,9 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 6.3 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -71,7 +71,7 @@ /** Maximum pixel map lookup table size */ #define MAX_PIXEL_MAP_TABLE 256 -/** Maximum Number of auxillary color buffers */ +/** Maximum number of auxillary color buffers */ #define MAX_AUX_BUFFERS 4 /** Maximum order (degree) of curves */ @@ -223,7 +223,7 @@ /** For GL_EXT_framebuffer_object */ /*@{*/ -#define MAX_COLOR_ATTACHMENTS 4 +#define MAX_COLOR_ATTACHMENTS 8 /*@}*/ @@ -322,4 +322,9 @@ #define MAX_CLIPPED_VERTICES ((2 * (6 + MAX_CLIP_PLANES))+1) +/* XXX these are temporary */ +#define NEW_RENDERBUFFER 1 +#define OLD_RENDERBUFFER 1 + + #endif /* CONFIG_H */ diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 087cc64c336..eb2f2e0c817 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -91,6 +91,7 @@ #include "eval.h" #include "enums.h" #include "extensions.h" +#include "fbobject.h" #include "feedback.h" #include "fog.h" #include "get.h" @@ -492,13 +493,12 @@ _mesa_create_visual( GLboolean rgbFlag, /** * Makes some sanity checks and fills in the fields of the - * GLvisual structure with the given parameters. - * + * GLvisual object with the given parameters. If the caller needs + * to set additional fields, he should just probably init the whole GLvisual + * object himself. * \return GL_TRUE on success, or GL_FALSE on failure. * * \sa _mesa_create_visual() above for the parameter description. - * - * \note Need to add params for level and numAuxBuffers (at least) */ GLboolean _mesa_initialize_visual( GLvisual *vis, @@ -520,28 +520,22 @@ _mesa_initialize_visual( GLvisual *vis, { assert(vis); - /* This is to catch bad values from device drivers not updated for - * Mesa 3.3. Some device drivers just passed 1. That's a REALLY - * bad value now (a 1-bit depth buffer!?!). - */ - assert(depthBits == 0 || depthBits > 1); - if (depthBits < 0 || depthBits > 32) { return GL_FALSE; } - if (stencilBits < 0 || stencilBits > (GLint) (8 * sizeof(GLstencil))) { + if (stencilBits < 0 || stencilBits > STENCIL_BITS) { return GL_FALSE; } - if (accumRedBits < 0 || accumRedBits > (GLint) (8 * sizeof(GLaccum))) { + if (accumRedBits < 0 || accumRedBits > ACCUM_BITS) { return GL_FALSE; } - if (accumGreenBits < 0 || accumGreenBits > (GLint) (8 * sizeof(GLaccum))) { + if (accumGreenBits < 0 || accumGreenBits > ACCUM_BITS) { return GL_FALSE; } - if (accumBlueBits < 0 || accumBlueBits > (GLint) (8 * sizeof(GLaccum))) { + if (accumBlueBits < 0 || accumBlueBits > ACCUM_BITS) { return GL_FALSE; } - if (accumAlphaBits < 0 || accumAlphaBits > (GLint) (8 * sizeof(GLaccum))) { + if (accumAlphaBits < 0 || accumAlphaBits > ACCUM_BITS) { return GL_FALSE; } @@ -553,14 +547,16 @@ _mesa_initialize_visual( GLvisual *vis, vis->greenBits = greenBits; vis->blueBits = blueBits; vis->alphaBits = alphaBits; + vis->rgbBits = redBits + greenBits + blueBits; vis->indexBits = indexBits; vis->depthBits = depthBits; - vis->accumRedBits = (accumRedBits > 0) ? (8 * sizeof(GLaccum)) : 0; - vis->accumGreenBits = (accumGreenBits > 0) ? (8 * sizeof(GLaccum)) : 0; - vis->accumBlueBits = (accumBlueBits > 0) ? (8 * sizeof(GLaccum)) : 0; - vis->accumAlphaBits = (accumAlphaBits > 0) ? (8 * sizeof(GLaccum)) : 0; - vis->stencilBits = (stencilBits > 0) ? (8 * sizeof(GLstencil)) : 0; + vis->stencilBits = stencilBits; + + vis->accumRedBits = accumRedBits; + vis->accumGreenBits = accumGreenBits; + vis->accumBlueBits = accumBlueBits; + vis->accumAlphaBits = accumAlphaBits; vis->haveAccumBuffer = accumRedBits > 0; vis->haveDepthBuffer = depthBits > 0; @@ -569,6 +565,7 @@ _mesa_initialize_visual( GLvisual *vis, vis->numAuxBuffers = 0; vis->level = 0; vis->pixmapMode = 0; + vis->sampleBuffers = numSamples > 0 ? 1 : 0; vis->samples = numSamples; return GL_TRUE; @@ -591,160 +588,6 @@ _mesa_destroy_visual( GLvisual *vis ) /*@}*/ -/**********************************************************************/ -/** \name GL Framebuffer allocation/destruction */ -/**********************************************************************/ -/*@{*/ - -/** - * Allocate a GLframebuffer structure and initializes it via - * _mesa_initialize_framebuffer(). - * - * A GLframebuffer is a structure which encapsulates the depth, stencil and - * accum buffers and related parameters. - * - * Note that the actual depth/stencil/accum/etc buffers are not allocated - * at this time. It's up to the device driver and/or swrast module to - * allocate them as needed. - * - * \param visual a GLvisual pointer (we copy the struct contents) - * \param softwareDepth create/use a software depth buffer? - * \param softwareStencil create/use a software stencil buffer? - * \param softwareAccum create/use a software accum buffer? - * \param softwareAlpha create/use a software alpha buffer? - * - * \return pointer to new GLframebuffer struct or NULL if error. - * - * \note Need to add softwareAuxBuffers parameter. - */ -GLframebuffer * -_mesa_create_framebuffer( const GLvisual *visual, - GLboolean softwareDepth, - GLboolean softwareStencil, - GLboolean softwareAccum, - GLboolean softwareAlpha ) -{ - GLframebuffer *buffer = CALLOC_STRUCT(gl_frame_buffer); - assert(visual); - if (buffer) { - _mesa_initialize_framebuffer(buffer, visual, - softwareDepth, softwareStencil, - softwareAccum, softwareAlpha ); - } - return buffer; -} - - -/** - * Makes some sanity checks and fills in the fields of the - * GLframebuffer structure with the given parameters. - * - * \sa _mesa_create_framebuffer() above for the parameter description. - */ -void -_mesa_initialize_framebuffer( GLframebuffer *buffer, - const GLvisual *visual, - GLboolean softwareDepth, - GLboolean softwareStencil, - GLboolean softwareAccum, - GLboolean softwareAlpha ) -{ - GLboolean softwareAux = GL_FALSE; - assert(buffer); - assert(visual); - - _mesa_bzero(buffer, sizeof(GLframebuffer)); - - /* sanity checks */ - if (softwareDepth ) { - assert(visual->depthBits > 0); - } - if (softwareStencil) { - assert(visual->stencilBits > 0); - } - if (softwareAccum) { - assert(visual->rgbMode); - assert(visual->accumRedBits > 0); - assert(visual->accumGreenBits > 0); - assert(visual->accumBlueBits > 0); - } - if (softwareAlpha) { - assert(visual->rgbMode); - assert(visual->alphaBits > 0); - } - - buffer->Visual = *visual; - buffer->UseSoftwareDepthBuffer = softwareDepth; - buffer->UseSoftwareStencilBuffer = softwareStencil; - buffer->UseSoftwareAccumBuffer = softwareAccum; - buffer->UseSoftwareAlphaBuffers = softwareAlpha; - buffer->UseSoftwareAuxBuffers = softwareAux; -} - - -/** - * Free a framebuffer struct and its buffers. - * - * Calls _mesa_free_framebuffer_data() and frees the structure. - */ -void -_mesa_destroy_framebuffer( GLframebuffer *buffer ) -{ - if (buffer) { - _mesa_free_framebuffer_data(buffer); - FREE(buffer); - } -} - - -/** - * Free the data hanging off of \p buffer, but not \p buffer itself. - * - * \param buffer framebuffer. - * - * Frees all the buffers associated with the structure. - */ -void -_mesa_free_framebuffer_data( GLframebuffer *buffer ) -{ - if (!buffer) - return; - - if (buffer->UseSoftwareDepthBuffer && buffer->DepthBuffer) { - MESA_PBUFFER_FREE( buffer->DepthBuffer ); - buffer->DepthBuffer = NULL; - } - if (buffer->UseSoftwareAccumBuffer && buffer->Accum) { - MESA_PBUFFER_FREE( buffer->Accum ); - buffer->Accum = NULL; - } - if (buffer->UseSoftwareStencilBuffer && buffer->Stencil) { - MESA_PBUFFER_FREE( buffer->Stencil ); - buffer->Stencil = NULL; - } - if (buffer->UseSoftwareAlphaBuffers){ - if (buffer->FrontLeftAlpha) { - MESA_PBUFFER_FREE( buffer->FrontLeftAlpha ); - buffer->FrontLeftAlpha = NULL; - } - if (buffer->BackLeftAlpha) { - MESA_PBUFFER_FREE( buffer->BackLeftAlpha ); - buffer->BackLeftAlpha = NULL; - } - if (buffer->FrontRightAlpha) { - MESA_PBUFFER_FREE( buffer->FrontRightAlpha ); - buffer->FrontRightAlpha = NULL; - } - if (buffer->BackRightAlpha) { - MESA_PBUFFER_FREE( buffer->BackRightAlpha ); - buffer->BackRightAlpha = NULL; - } - } -} - -/*@}*/ - - /**********************************************************************/ /** \name Context allocation, initialization, destroying * @@ -1552,6 +1395,8 @@ _mesa_initialize_context( GLcontext *ctx, ctx->Visual = *visual; ctx->DrawBuffer = NULL; ctx->ReadBuffer = NULL; + ctx->WinSysDrawBuffer = NULL; + ctx->WinSysReadBuffer = NULL; /* Plug in driver functions and context pointer here. * This is important because when we call alloc_shared_state() below @@ -1662,7 +1507,7 @@ _mesa_free_context_data( GLcontext *ctx ) { /* if we're destroying the current context, unbind it first */ if (ctx == _mesa_get_current_context()) { - _mesa_make_current(NULL, NULL); + _mesa_make_current(NULL, NULL, NULL); } _mesa_free_lighting_data( ctx ); @@ -1877,20 +1722,6 @@ check_compatible(const GLcontext *ctx, const GLframebuffer *buffer) } -/** - * Set the current context, binding the given frame buffer to the context. - * - * \param newCtx new GL context. - * \param buffer framebuffer. - * - * Calls _mesa_make_current2() with \p buffer as read and write framebuffer. - */ -void -_mesa_make_current( GLcontext *newCtx, GLframebuffer *buffer ) -{ - _mesa_make_current2( newCtx, buffer, buffer ); -} - /** * Bind the given context to the given draw-buffer and read-buffer and * make it the current context for this thread. @@ -1911,11 +1742,11 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *buffer ) * troubleshooting. */ void -_mesa_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer, - GLframebuffer *readBuffer ) +_mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer, + GLframebuffer *readBuffer ) { if (MESA_VERBOSE) - _mesa_debug(newCtx, "_mesa_make_current2()\n"); + _mesa_debug(newCtx, "_mesa_make_current()\n"); /* Check that the context's and framebuffer's visuals are compatible. */ @@ -1936,7 +1767,6 @@ _mesa_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer, _glapi_set_context((void *) newCtx); ASSERT(_mesa_get_current_context() == newCtx); - if (!newCtx) { _glapi_set_dispatch(NULL); /* none current */ } @@ -1945,8 +1775,21 @@ _mesa_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer, if (drawBuffer && readBuffer) { /* TODO: check if newCtx and buffer's visual match??? */ + +#if NEW_RENDERBUFFER + ASSERT(drawBuffer->Name == 0); + ASSERT(readBuffer->Name == 0); + newCtx->WinSysDrawBuffer = drawBuffer; + newCtx->WinSysReadBuffer = readBuffer; + /* don't replace user-buffer bindings with window system buffer */ + if (!newCtx->DrawBuffer || newCtx->DrawBuffer->Name == 0) { + newCtx->DrawBuffer = drawBuffer; + newCtx->ReadBuffer = readBuffer; + } +#else newCtx->DrawBuffer = drawBuffer; newCtx->ReadBuffer = readBuffer; +#endif newCtx->NewState |= _NEW_BUFFERS; #if _HAVE_FULL_GL @@ -1956,9 +1799,9 @@ _mesa_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer, /* ask device driver for size of the buffer */ (*newCtx->Driver.GetBufferSize)(drawBuffer, &bufWidth, &bufHeight); /* set initial buffer size */ - drawBuffer->Width = bufWidth; - drawBuffer->Height = bufHeight; - newCtx->Driver.ResizeBuffers( drawBuffer ); + if (newCtx->Driver.ResizeBuffers) + newCtx->Driver.ResizeBuffers(newCtx, drawBuffer, + bufWidth, bufHeight); drawBuffer->Initialized = GL_TRUE; } @@ -1968,9 +1811,9 @@ _mesa_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer, /* ask device driver for size of the buffer */ (*newCtx->Driver.GetBufferSize)(readBuffer, &bufWidth, &bufHeight); /* set initial buffer size */ - readBuffer->Width = bufWidth; - readBuffer->Height = bufHeight; - newCtx->Driver.ResizeBuffers( readBuffer ); + if (newCtx->Driver.ResizeBuffers) + newCtx->Driver.ResizeBuffers(newCtx, readBuffer, + bufWidth, bufHeight); readBuffer->Initialized = GL_TRUE; } #endif diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index 4b041edc6d5..8b7e7c9952b 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -98,34 +98,6 @@ _mesa_destroy_visual( GLvisual *vis ); /*@}*/ -/**********************************************************************/ -/** \name Create/destroy a GLframebuffer. */ -/*@{*/ - -extern GLframebuffer * -_mesa_create_framebuffer( const GLvisual *visual, - GLboolean softwareDepth, - GLboolean softwareStencil, - GLboolean softwareAccum, - GLboolean softwareAlpha ); - -extern void -_mesa_initialize_framebuffer( GLframebuffer *fb, - const GLvisual *visual, - GLboolean softwareDepth, - GLboolean softwareStencil, - GLboolean softwareAccum, - GLboolean softwareAlpha ); - -extern void -_mesa_free_framebuffer_data( GLframebuffer *buffer ); - -extern void -_mesa_destroy_framebuffer( GLframebuffer *buffer ); - -/*@}*/ - - /**********************************************************************/ /** \name Create/destroy a GLcontext. */ /*@{*/ @@ -155,12 +127,8 @@ _mesa_copy_context(const GLcontext *src, GLcontext *dst, GLuint mask); extern void -_mesa_make_current( GLcontext *ctx, GLframebuffer *buffer ); - - -extern void -_mesa_make_current2( GLcontext *ctx, GLframebuffer *drawBuffer, - GLframebuffer *readBuffer ); +_mesa_make_current( GLcontext *ctx, GLframebuffer *drawBuffer, + GLframebuffer *readBuffer ); extern GLboolean _mesa_share_state(GLcontext *ctx, GLcontext *ctxToShare); diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 1d9d366014c..3746e4685c7 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -75,12 +75,10 @@ struct dd_function_table { GLuint *width, GLuint *height ); /** - * Resize the driver's depth/stencil/accum/back buffers to match the - * size given in the GLframebuffer struct. - * - * This is typically called when Mesa detects that a window size has changed. + * Resize the given framebuffer to the given size. */ - void (*ResizeBuffers)( GLframebuffer *buffer ); + void (*ResizeBuffers)( GLcontext *ctx, GLframebuffer *fb, + GLuint width, GLuint height); /** * Called whenever an error is generated. @@ -795,6 +793,13 @@ struct dd_function_table { /*@{*/ struct gl_framebuffer * (*NewFramebuffer)(GLcontext *ctx, GLuint name); struct gl_renderbuffer * (*NewRenderbuffer)(GLcontext *ctx, GLuint name); + void (*FramebufferRenderbuffer)(GLcontext *ctx, + struct gl_renderbuffer_attachment *att, + struct gl_renderbuffer *rb); + void (*RenderbufferTexture)(GLcontext *ctx, + struct gl_renderbuffer_attachment *att, + struct gl_texture_object *texObj, + GLenum texTarget, GLuint level, GLuint zoffset); /*@}*/ #endif diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c index 6c60222096a..aca471a06c8 100644 --- a/src/mesa/main/depth.c +++ b/src/mesa/main/depth.c @@ -162,13 +162,15 @@ void _mesa_init_depth( GLcontext * ctx ) ctx->Depth.Mask = GL_TRUE; ctx->Depth.OcclusionTest = GL_FALSE; + /* XXX this is now per-framebuffer state */ +#if 00 /* Z buffer stuff */ if (ctx->Visual.depthBits == 0) { /* Special case. Even if we don't have a depth buffer we need * good values for DepthMax for Z vertex transformation purposes * and for per-fragment fog computation. */ - ctx->DepthMax = 1 << 16; + ctx->DepthMax = (1 << 16) - 1; ctx->DepthMaxF = (GLfloat) ctx->DepthMax; } else if (ctx->Visual.depthBits < 32) { @@ -183,4 +185,5 @@ void _mesa_init_depth( GLcontext * ctx ) ctx->DepthMaxF = (GLfloat) ctx->DepthMax; } ctx->MRD = 1.0; /* Minimum resolvable depth value, for polygon offset */ +#endif } diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index effdb7702a7..2541d5c4af7 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -2850,7 +2850,8 @@ static void GLAPIENTRY save_PolygonOffset( GLfloat factor, GLfloat units ) static void GLAPIENTRY save_PolygonOffsetEXT( GLfloat factor, GLfloat bias ) { GET_CURRENT_CONTEXT(ctx); - save_PolygonOffset(factor, ctx->DepthMaxF * bias); + /* XXX mult by DepthMaxF here??? */ + save_PolygonOffset(factor, ctx->DrawBuffer->_DepthMaxF * bias); } @@ -7422,14 +7423,6 @@ static void GLAPIENTRY exec_UnlockArraysEXT( void ) ctx->Exec->UnlockArraysEXT( ); } -static void GLAPIENTRY exec_ResizeBuffersMESA( void ) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - ctx->Exec->ResizeBuffersMESA( ); -} - - static void GLAPIENTRY exec_ClientActiveTextureARB( GLenum target ) { GET_CURRENT_CONTEXT(ctx); @@ -7847,7 +7840,7 @@ _mesa_init_dlist_table( struct _glapi_table *table ) table->BlendFuncSeparateEXT = save_BlendFuncSeparateEXT; /* 196. GL_MESA_resize_buffers */ - table->ResizeBuffersMESA = exec_ResizeBuffersMESA; + table->ResizeBuffersMESA = _mesa_ResizeBuffersMESA; /* 197. GL_MESA_window_pos */ table->WindowPos2dMESA = save_WindowPos2dMESA; diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index f53ae05d171..671db68ce84 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -301,7 +301,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) break; case GL_DEPTH_TEST: - if (state && ctx->Visual.depthBits==0) { + if (state && ctx->DrawBuffer->Visual.depthBits == 0) { _mesa_warning(ctx,"glEnable(GL_DEPTH_TEST) but no depth buffer"); return; } @@ -575,7 +575,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) ctx->Texture.SharedPalette = state; break; case GL_STENCIL_TEST: - if (state && ctx->Visual.stencilBits==0) { + if (state && ctx->DrawBuffer->Visual.stencilBits == 0) { _mesa_warning(ctx, "glEnable(GL_STENCIL_TEST) but no stencil buffer"); return; @@ -591,7 +591,8 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) GLuint newenabled = texUnit->Enabled & ~TEXTURE_1D_BIT; if (state) newenabled |= TEXTURE_1D_BIT; - if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled) + if (!ctx->DrawBuffer->Visual.rgbMode + || texUnit->Enabled == newenabled) return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); texUnit->Enabled = newenabled; @@ -603,7 +604,8 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) GLuint newenabled = texUnit->Enabled & ~TEXTURE_2D_BIT; if (state) newenabled |= TEXTURE_2D_BIT; - if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled) + if (!ctx->DrawBuffer->Visual.rgbMode + || texUnit->Enabled == newenabled) return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); texUnit->Enabled = newenabled; @@ -615,7 +617,8 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) GLuint newenabled = texUnit->Enabled & ~TEXTURE_3D_BIT; if (state) newenabled |= TEXTURE_3D_BIT; - if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled) + if (!ctx->DrawBuffer->Visual.rgbMode + || texUnit->Enabled == newenabled) return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); texUnit->Enabled = newenabled; @@ -777,7 +780,8 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) CHECK_EXTENSION(ARB_texture_cube_map, cap); if (state) newenabled |= TEXTURE_CUBE_BIT; - if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled) + if (!ctx->DrawBuffer->Visual.rgbMode + || texUnit->Enabled == newenabled) return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); texUnit->Enabled = newenabled; @@ -938,7 +942,8 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) CHECK_EXTENSION(NV_texture_rectangle, cap); if (state) newenabled |= TEXTURE_RECT_BIT; - if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled) + if (!ctx->DrawBuffer->Visual.rgbMode + || texUnit->Enabled == newenabled) return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); texUnit->Enabled = newenabled; @@ -972,7 +977,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) /* GL_EXT_depth_bounds_test */ case GL_DEPTH_BOUNDS_TEST_EXT: CHECK_EXTENSION(EXT_depth_bounds_test, cap); - if (state && ctx->Visual.depthBits==0) { + if (state && ctx->DrawBuffer->Visual.depthBits == 0) { _mesa_warning(ctx, "glEnable(GL_DEPTH_BOUNDS_TEST_EXT) but no depth buffer"); return; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 5bbceb5ab7f..150492e7c30 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -227,7 +227,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.EXT_convolution = GL_TRUE; ctx->Extensions.EXT_depth_bounds_test = GL_TRUE; ctx->Extensions.EXT_fog_coord = GL_TRUE; - /*ctx->Extensions.EXT_framebuffer_object = GL_TRUE;*/ + ctx->Extensions.EXT_framebuffer_object = GL_TRUE; /*FALSE;*/ ctx->Extensions.EXT_histogram = GL_TRUE; ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE; ctx->Extensions.EXT_paletted_texture = GL_TRUE; diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 3480beaa47d..beaf4ed942c 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -31,7 +31,9 @@ #include "context.h" #include "fbobject.h" +#include "framebuffer.h" #include "hash.h" +#include "renderbuffer.h" #include "teximage.h" #include "texstore.h" @@ -94,103 +96,6 @@ lookup_framebuffer(GLcontext *ctx, GLuint id) } -/** - * Allocate a new gl_framebuffer. - * This is the default function for ctx->Driver.NewFramebuffer(). - */ -struct gl_framebuffer * -_mesa_new_framebuffer(GLcontext *ctx, GLuint name) -{ - struct gl_framebuffer *fb = CALLOC_STRUCT(gl_framebuffer); - if (fb) { - fb->Name = name; - fb->RefCount = 1; - fb->Delete = _mesa_delete_framebuffer; - } - return fb; -} - - -/** - * Delete a gl_framebuffer. - * This is the default function for framebuffer->Delete(). - */ -void -_mesa_delete_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) -{ - (void) ctx; - _mesa_free(fb); -} - - -/** - * Allocate the actual storage for a renderbuffer with the given format - * and dimensions. - * This is the default function for gl_renderbuffer->AllocStorage(). - * All incoming parameters will have already been checked for errors. - * If memory allocate fails, the function must call - * _mesa_error(GL_OUT_OF_MEMORY) and then return. - * \return GL_TRUE for success, GL_FALSE for failure. - */ -static GLboolean -alloc_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, - GLenum internalFormat, GLuint width, GLuint height) -{ - /* First, free any existing storage */ - if (rb->Data) { - _mesa_free(rb->Data); - } - - /* Now, allocate new storage */ - rb->Data = _mesa_malloc(width * height * 4); /* XXX fix size! */ - if (rb->Data == NULL) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glRenderbufferStorageEXT"); - return GL_FALSE; - } - - /* We set these fields now if the allocation worked */ - rb->Width = width; - rb->Height = height; - rb->InternalFormat = internalFormat; - - return GL_TRUE; -} - - -/** - * Allocate a new gl_renderbuffer. - * This is the default function for ctx->Driver.NewRenderbuffer(). - */ -struct gl_renderbuffer * -_mesa_new_renderbuffer(GLcontext *ctx, GLuint name) -{ - struct gl_renderbuffer *rb = CALLOC_STRUCT(gl_renderbuffer); - if (rb) { - rb->Name = name; - rb->RefCount = 1; - rb->Delete = _mesa_delete_renderbuffer; - rb->AllocStorage = alloc_renderbuffer_storage; - /* other fields are zero */ - } - return rb; -} - - -/** - * Delete a gl_framebuffer. - * This is the default function for framebuffer->Delete(). - */ -void -_mesa_delete_renderbuffer(GLcontext *ctx, struct gl_renderbuffer *rb) -{ - (void) ctx; - if (rb->Data) { - _mesa_free(rb->Data); - } - _mesa_free(rb); -} - - /** * Given a GL_*_ATTACHMENTn token, return a pointer to the corresponding * gl_renderbuffer_attachment object. @@ -221,11 +126,11 @@ get_attachment(GLcontext *ctx, struct gl_framebuffer *fb, GLenum attachment) if (i >= ctx->Const.MaxColorAttachments) { return NULL; } - return &fb->ColorAttachment[i]; + return &fb->Attachment[BUFFER_COLOR0 + i]; case GL_DEPTH_ATTACHMENT_EXT: - return &fb->DepthAttachment; + return &fb->Attachment[BUFFER_DEPTH]; case GL_STENCIL_ATTACHMENT_EXT: - return &fb->StencilAttachment; + return &fb->Attachment[BUFFER_STENCIL]; default: return NULL; } @@ -236,12 +141,17 @@ get_attachment(GLcontext *ctx, struct gl_framebuffer *fb, GLenum attachment) * Remove any texture or renderbuffer attached to the given attachment * point. Update reference counts, etc. */ -static void -remove_attachment(GLcontext *ctx, struct gl_renderbuffer_attachment *att) +void +_mesa_remove_attachment(GLcontext *ctx, struct gl_renderbuffer_attachment *att) { if (att->Type == GL_TEXTURE) { ASSERT(att->Texture); - ASSERT(!att->Renderbuffer); + if (att->Renderbuffer) { + /* delete/remove the 'wrapper' renderbuffer */ + /* XXX do we really want to do this??? */ + att->Renderbuffer->Delete(att->Renderbuffer); + att->Renderbuffer = NULL; + } att->Texture->RefCount--; if (att->Texture->RefCount == 0) { ctx->Driver.DeleteTexture(ctx, att->Texture); @@ -253,7 +163,7 @@ remove_attachment(GLcontext *ctx, struct gl_renderbuffer_attachment *att) ASSERT(!att->Texture); att->Renderbuffer->RefCount--; if (att->Renderbuffer->RefCount == 0) { - att->Renderbuffer->Delete(ctx, att->Renderbuffer); + att->Renderbuffer->Delete(att->Renderbuffer); } att->Renderbuffer = NULL; } @@ -266,13 +176,13 @@ remove_attachment(GLcontext *ctx, struct gl_renderbuffer_attachment *att) * Bind a texture object to an attachment point. * The previous binding, if any, will be removed first. */ -static void -set_texture_attachment(GLcontext *ctx, - struct gl_renderbuffer_attachment *att, - struct gl_texture_object *texObj, - GLenum texTarget, GLuint level, GLuint zoffset) +void +_mesa_set_texture_attachment(GLcontext *ctx, + struct gl_renderbuffer_attachment *att, + struct gl_texture_object *texObj, + GLenum texTarget, GLuint level, GLuint zoffset) { - remove_attachment(ctx, att); + _mesa_remove_attachment(ctx, att); att->Type = GL_TEXTURE; att->Texture = texObj; att->TextureLevel = level; @@ -284,6 +194,7 @@ set_texture_attachment(GLcontext *ctx, } att->Zoffset = zoffset; att->Complete = GL_FALSE; + texObj->RefCount++; /* XXX when we attach to a texture, we should probably set the @@ -297,12 +208,12 @@ set_texture_attachment(GLcontext *ctx, * Bind a renderbuffer to an attachment point. * The previous binding, if any, will be removed first. */ -static void -set_renderbuffer_attachment(GLcontext *ctx, - struct gl_renderbuffer_attachment *att, - struct gl_renderbuffer *rb) +void +_mesa_set_renderbuffer_attachment(GLcontext *ctx, + struct gl_renderbuffer_attachment *att, + struct gl_renderbuffer *rb) { - remove_attachment(ctx, att); + _mesa_remove_attachment(ctx, att); att->Type = GL_RENDERBUFFER_EXT; att->Renderbuffer = rb; att->Texture = NULL; /* just to be safe */ @@ -311,6 +222,26 @@ set_renderbuffer_attachment(GLcontext *ctx, } +/** + * Fallback for ctx->Driver.FramebufferRenderbuffer() + * Sets a framebuffer attachment to a particular renderbuffer. + * The framebuffer in question is ctx->DrawBuffer. + * \sa _mesa_renderbuffer_texture + */ +void +_mesa_framebuffer_renderbuffer(GLcontext *ctx, + struct gl_renderbuffer_attachment *att, + struct gl_renderbuffer *rb) +{ + if (rb) { + _mesa_set_renderbuffer_attachment(ctx, att, rb); + } + else { + _mesa_remove_attachment(ctx, att); + } +} + + /** * Test if an attachment point is complete and update its Complete field. * \param format if GL_COLOR, this is a color attachment point, @@ -326,15 +257,15 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, /* assume complete */ att->Complete = GL_TRUE; - if (att->Type == GL_NONE) - return; /* complete */ - /* Look for reasons why the attachment might be incomplete */ if (att->Type == GL_TEXTURE) { - struct gl_texture_object *texObj = att->Texture; + const struct gl_texture_object *texObj = att->Texture; struct gl_texture_image *texImage; - assert(texObj); + if (!texObj) { + att->Complete = GL_FALSE; + return; + } texImage = texObj->Image[att->CubeMapFace][att->TextureLevel]; if (!texImage) { @@ -351,13 +282,14 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, } if (format == GL_COLOR) { - if (texImage->Format != GL_RGB && texImage->Format != GL_RGBA) { + if (texImage->TexFormat->BaseFormat != GL_RGB && + texImage->TexFormat->BaseFormat != GL_RGBA) { att->Complete = GL_FALSE; return; } } else if (format == GL_DEPTH) { - if (texImage->Format != GL_DEPTH_COMPONENT) { + if (texImage->TexFormat->BaseFormat != GL_DEPTH_COMPONENT) { att->Complete = GL_FALSE; return; } @@ -368,9 +300,7 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, return; } } - else { - assert(att->Type == GL_RENDERBUFFER_EXT); - + else if (att->Type == GL_RENDERBUFFER_EXT) { if (att->Renderbuffer->Width < 1 || att->Renderbuffer->Height < 1) { att->Complete = GL_FALSE; return; @@ -396,53 +326,58 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, } } } + else { + ASSERT(att->Type == GL_NONE); + /* complete */ + return; + } } /** * Test if the given framebuffer object is complete and update its * Status field with the results. + * Also update the framebuffer's Width and Height fields if the + * framebuffer is complete. */ -static void -test_framebuffer_completeness(GLcontext *ctx, - struct gl_framebuffer *fb) +void +_mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) { - GLint i; GLuint numImages, width = 0, height = 0; GLenum intFormat = GL_NONE; - - /* Set to COMPLETE status, then try to find reasons for being incomplete */ - fb->Status = GL_FRAMEBUFFER_COMPLETE_EXT; + GLuint w = 0, h = 0; + GLint i; numImages = 0; + fb->Width = 0; + fb->Height = 0; /* Start at -2 to more easily loop over all attachment points */ - for (i = -2; i < ctx->Const.MaxColorAttachments; i++) { + for (i = -2; i < (GLint) ctx->Const.MaxColorAttachments; i++) { struct gl_renderbuffer_attachment *att; - GLuint w, h; GLenum f; if (i == -2) { - att = &fb->DepthAttachment; + att = &fb->Attachment[BUFFER_DEPTH]; test_attachment_completeness(ctx, GL_DEPTH, att); if (!att->Complete) { - fb->Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT; + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT; return; } } else if (i == -1) { - att = &fb->StencilAttachment; + att = &fb->Attachment[BUFFER_STENCIL]; test_attachment_completeness(ctx, GL_STENCIL, att); if (!att->Complete) { - fb->Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT; + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT; return; } } else { - att = &fb->ColorAttachment[i]; + att = &fb->Attachment[BUFFER_COLOR0 + i]; test_attachment_completeness(ctx, GL_COLOR, att); if (!att->Complete) { - fb->Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT; + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT; return; } } @@ -474,57 +409,63 @@ test_framebuffer_completeness(GLcontext *ctx, else { /* check that width, height, format are same */ if (w != width || h != height) { - fb->Status = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT; + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT; return; } - if (i >= 0 && f != intFormat) { - fb->Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT; + if (intFormat != GL_NONE && f != intFormat) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT; return; } - } } /* Check that all DrawBuffers are present */ for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) { - if (fb->DrawBuffer[i] != GL_NONE) { - struct gl_renderbuffer_attachment *att - = get_attachment(ctx, fb, fb->DrawBuffer[i]); + if (fb->ColorDrawBuffer[i] != GL_NONE) { + const struct gl_renderbuffer_attachment *att + = get_attachment(ctx, fb, fb->ColorDrawBuffer[i]); + assert(att); if (att->Type == GL_NONE) { - fb->Status = GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT; + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT; return; } } } /* Check that the ReadBuffer is present */ - if (fb->ReadBuffer != GL_NONE) { - struct gl_renderbuffer_attachment *att - = get_attachment(ctx, fb, fb->ReadBuffer); + if (fb->ColorReadBuffer != GL_NONE) { + const struct gl_renderbuffer_attachment *att + = get_attachment(ctx, fb, fb->ColorReadBuffer); + assert(att); if (att->Type == GL_NONE) { - fb->Status = GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT; + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT; return; } } if (numImages == 0) { - fb->Status = GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT; + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT; return; } -} + /* + * If we get here, the framebuffer is complete! + */ + fb->_Status = GL_FRAMEBUFFER_COMPLETE_EXT; + fb->Width = w; + fb->Height = h; +} GLboolean GLAPIENTRY _mesa_IsRenderbufferEXT(GLuint renderbuffer) { - const struct gl_renderbuffer *rb; GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - rb = lookup_renderbuffer(ctx, renderbuffer); - return rb ? GL_TRUE : GL_FALSE; + if (renderbuffer && lookup_renderbuffer(ctx, renderbuffer)) + return GL_TRUE; + else + return GL_FALSE; } @@ -535,6 +476,7 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); if (target != GL_RENDERBUFFER_EXT) { _mesa_error(ctx, GL_INVALID_ENUM, @@ -568,7 +510,7 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) if (oldRb) { oldRb->RefCount--; if (oldRb->RefCount == 0) { - oldRb->Delete(ctx, oldRb); + oldRb->Delete(oldRb); } } @@ -600,7 +542,7 @@ _mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers) */ rb->RefCount--; if (rb->RefCount == 0) { - rb->Delete(ctx, rb); + rb->Delete(rb); } } } @@ -694,6 +636,7 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); if (target != GL_RENDERBUFFER_EXT) { _mesa_error(ctx, GL_INVALID_ENUM, "glRenderbufferStorageEXT(target)"); @@ -741,6 +684,9 @@ _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, rb->_BaseFormat = GL_NONE; } + /* + test_framebuffer_completeness(ctx, fb); + */ /* XXX if this renderbuffer is attached anywhere, invalidate attachment * points??? */ @@ -787,23 +733,23 @@ _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) GLboolean GLAPIENTRY _mesa_IsFramebufferEXT(GLuint framebuffer) { - const struct gl_framebuffer *fb; GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - fb = lookup_framebuffer(ctx, framebuffer); - return fb ? GL_TRUE : GL_FALSE; + if (framebuffer && lookup_framebuffer(ctx, framebuffer)) + return GL_TRUE; + else + return GL_FALSE; } void GLAPIENTRY _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) { - struct gl_framebuffer *newFb, *oldFb; + struct gl_framebuffer *newFb, *newReadFb, *oldFb; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); if (target != GL_FRAMEBUFFER_EXT) { _mesa_error(ctx, GL_INVALID_ENUM, @@ -812,6 +758,7 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) } if (framebuffer) { + /* Binding a user-created framebuffer object */ newFb = lookup_framebuffer(ctx, framebuffer); if (newFb == &DummyFramebuffer) { /* ID was reserved, but no real framebuffer object made yet */ @@ -827,22 +774,29 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) _mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, newFb); } newFb->RefCount++; + newReadFb = newFb; } else { - newFb = NULL; + /* Binding the window system framebuffer (which was originally set + * with MakeCurrent). + */ + newFb = ctx->WinSysDrawBuffer; + newReadFb = ctx->WinSysReadBuffer; } - oldFb = ctx->CurrentFramebuffer; - if (oldFb) { + oldFb = ctx->DrawBuffer; + if (oldFb) { /* AND oldFb->Name != 0 */ oldFb->RefCount--; if (oldFb->RefCount == 0) { - oldFb->Delete(ctx, oldFb); + oldFb->Delete(oldFb); } } ASSERT(newFb != &DummyFramebuffer); - ctx->CurrentFramebuffer = newFb; + /* Note, we set both the GL_DRAW_BUFFER and GL_READ_BUFFER state: */ + ctx->DrawBuffer = newFb; + ctx->ReadBuffer = newReadFb; } @@ -859,6 +813,7 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) struct gl_framebuffer *fb; fb = lookup_framebuffer(ctx, framebuffers[i]); if (fb) { + ASSERT(fb == &DummyFramebuffer || fb->Name == framebuffers[i]); /* remove from hash table immediately, to free the ID */ _mesa_HashRemove(ctx->Shared->FrameBuffers, framebuffers[i]); @@ -868,7 +823,7 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) */ fb->RefCount--; if (fb->RefCount == 0) { - fb->Delete(ctx, fb); + fb->Delete(fb); } } } @@ -913,20 +868,20 @@ _mesa_CheckFramebufferStatusEXT(GLenum target) { GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FRAMEBUFFER_STATUS_ERROR_EXT); + ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0); if (target != GL_FRAMEBUFFER_EXT) { _mesa_error(ctx, GL_INVALID_ENUM, "glCheckFramebufferStatus(target)"); - return GL_FRAMEBUFFER_STATUS_ERROR_EXT; + return 0; /* formerly GL_FRAMEBUFFER_STATUS_ERROR_EXT */ } - if (!ctx->CurrentFramebuffer) { + if (ctx->DrawBuffer->Name == 0) { /* The window system / default framebuffer is always complete */ return GL_FRAMEBUFFER_COMPLETE_EXT; } - test_framebuffer_completeness(ctx, ctx->CurrentFramebuffer); - return ctx->CurrentFramebuffer->Status; + _mesa_test_framebuffer_completeness(ctx, ctx->DrawBuffer); + return ctx->DrawBuffer->_Status; } @@ -948,13 +903,14 @@ error_check_framebuffer_texture(GLcontext *ctx, GLuint dims, return GL_TRUE; } - if (ctx->CurrentFramebuffer == NULL) { + /* check framebuffer binding */ + if (ctx->DrawBuffer->Name == 0) { _mesa_error(ctx, GL_INVALID_OPERATION, "glFramebufferTexture%dDEXT", dims); return GL_TRUE; } - /* only check textarget, level if texture ID is non-zero*/ + /* only check textarget, level if texture ID is non-zero */ if (texture) { if ((dims == 1 && textarget != GL_TEXTURE_1D) || (dims == 3 && textarget != GL_TEXTURE_3D) || @@ -982,9 +938,11 @@ _mesa_FramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) { struct gl_renderbuffer_attachment *att; + struct gl_texture_object *texObj; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); /* XXX check */ if (error_check_framebuffer_texture(ctx, 1, target, attachment, textarget, texture, level)) @@ -992,7 +950,7 @@ _mesa_FramebufferTexture1DEXT(GLenum target, GLenum attachment, ASSERT(textarget == GL_TEXTURE_1D); - att = get_attachment(ctx, ctx->CurrentFramebuffer, attachment); + att = get_attachment(ctx, ctx->DrawBuffer, attachment); if (att == NULL) { _mesa_error(ctx, GL_INVALID_ENUM, "glFramebufferTexture1DEXT(attachment)"); @@ -1000,7 +958,7 @@ _mesa_FramebufferTexture1DEXT(GLenum target, GLenum attachment, } if (texture) { - struct gl_texture_object *texObj = (struct gl_texture_object *) + texObj = (struct gl_texture_object *) _mesa_HashLookup(ctx->Shared->TexObjects, texture); if (!texObj) { _mesa_error(ctx, GL_INVALID_VALUE, @@ -1012,13 +970,12 @@ _mesa_FramebufferTexture1DEXT(GLenum target, GLenum attachment, "glFramebufferTexture1DEXT(texture target)"); return; } - set_texture_attachment(ctx, att, texObj, textarget, level, 0); } else { - remove_attachment(ctx, att); + /* remove texture attachment */ + texObj = NULL; } - - /* XXX call a driver function to signal new attachment? */ + ctx->Driver.RenderbufferTexture(ctx, att, texObj, textarget, level, 0); } @@ -1027,9 +984,11 @@ _mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) { struct gl_renderbuffer_attachment *att; + struct gl_texture_object *texObj; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); /* XXX check */ if (error_check_framebuffer_texture(ctx, 2, target, attachment, textarget, texture, level)) @@ -1039,7 +998,7 @@ _mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment, textarget == GL_TEXTURE_RECTANGLE_ARB || IS_CUBE_FACE(textarget)); - att = get_attachment(ctx, ctx->CurrentFramebuffer, attachment); + att = get_attachment(ctx, ctx->DrawBuffer, attachment); if (att == NULL) { _mesa_error(ctx, GL_INVALID_ENUM, "glFramebufferTexture2DEXT(attachment)"); @@ -1047,7 +1006,7 @@ _mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment, } if (texture) { - struct gl_texture_object *texObj = (struct gl_texture_object *) + texObj = (struct gl_texture_object *) _mesa_HashLookup(ctx->Shared->TexObjects, texture); if (!texObj) { _mesa_error(ctx, GL_INVALID_VALUE, @@ -1063,12 +1022,12 @@ _mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment, "glFramebufferTexture2DEXT(texture target)"); return; } - set_texture_attachment(ctx, att, texObj, textarget, level, 0); } else { - remove_attachment(ctx, att); + /* remove texture attachment */ + texObj = NULL; } - + ctx->Driver.RenderbufferTexture(ctx, att, texObj, textarget, level, 0); } @@ -1078,9 +1037,11 @@ _mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment, GLint level, GLint zoffset) { struct gl_renderbuffer_attachment *att; + struct gl_texture_object *texObj; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); /* XXX check */ if (error_check_framebuffer_texture(ctx, 3, target, attachment, textarget, texture, level)) @@ -1088,7 +1049,7 @@ _mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment, ASSERT(textarget == GL_TEXTURE_3D); - att = get_attachment(ctx, ctx->CurrentFramebuffer, attachment); + att = get_attachment(ctx, ctx->DrawBuffer, attachment); if (att == NULL) { _mesa_error(ctx, GL_INVALID_ENUM, "glFramebufferTexture1DEXT(attachment)"); @@ -1097,7 +1058,7 @@ _mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment, if (texture) { const GLint maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1); - struct gl_texture_object *texObj = (struct gl_texture_object *) + texObj = (struct gl_texture_object *) _mesa_HashLookup(ctx->Shared->TexObjects, texture); if (!texObj) { _mesa_error(ctx, GL_INVALID_VALUE, @@ -1114,11 +1075,13 @@ _mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment, "glFramebufferTexture3DEXT(zoffset)"); return; } - set_texture_attachment(ctx, att, texObj, textarget, level, zoffset); } else { - remove_attachment(ctx, att); + /* remove texture attachment */ + texObj = NULL; } + ctx->Driver.RenderbufferTexture(ctx, att, texObj, textarget, + level, zoffset); } @@ -1128,9 +1091,11 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLuint renderbuffer) { struct gl_renderbuffer_attachment *att; + struct gl_renderbuffer *rb; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); if (target != GL_FRAMEBUFFER_EXT) { _mesa_error(ctx, GL_INVALID_ENUM, @@ -1139,17 +1104,17 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, } if (renderbufferTarget != GL_RENDERBUFFER_EXT) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferRenderbufferEXT(renderbufferTarget)"); + _mesa_error(ctx, GL_INVALID_ENUM, + "glFramebufferRenderbufferEXT(renderbufferTarget)"); return; } - if (ctx->CurrentFramebuffer == NULL) { + if (ctx->DrawBuffer->Name == 0) { _mesa_error(ctx, GL_INVALID_OPERATION, "glFramebufferRenderbufferEXT"); return; } - att = get_attachment(ctx, ctx->CurrentFramebuffer, attachment); + att = get_attachment(ctx, ctx->DrawBuffer, attachment); if (att == NULL) { _mesa_error(ctx, GL_INVALID_ENUM, "glFramebufferRenderbufferEXT(attachment)"); @@ -1157,18 +1122,22 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, } if (renderbuffer) { - struct gl_renderbuffer *rb; rb = lookup_renderbuffer(ctx, renderbuffer); if (!rb) { - _mesa_error(ctx, GL_INVALID_VALUE, + _mesa_error(ctx, GL_INVALID_OPERATION, "glFramebufferRenderbufferEXT(renderbuffer)"); return; } - set_renderbuffer_attachment(ctx, att, rb); } else { - remove_attachment(ctx, att); + /* remove renderbuffer attachment */ + rb = NULL; } + + assert(ctx->Driver.FramebufferRenderbuffer); + ctx->Driver.FramebufferRenderbuffer(ctx, att, rb); + + _mesa_update_framebuffer_visual(ctx->DrawBuffer); } @@ -1187,13 +1156,13 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, return; } - if (ctx->CurrentFramebuffer == NULL) { + if (ctx->DrawBuffer->Name == 0) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetFramebufferAttachmentParameterivEXT"); return; } - att = get_attachment(ctx, ctx->CurrentFramebuffer, attachment); + att = get_attachment(ctx, ctx->DrawBuffer, attachment); if (att == NULL) { _mesa_error(ctx, GL_INVALID_ENUM, "glGetFramebufferAttachmentParameterivEXT(attachment)"); diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h index 0241da2efc8..2c86ef93726 100644 --- a/src/mesa/main/fbobject.h +++ b/src/mesa/main/fbobject.h @@ -27,137 +27,28 @@ #define FBOBJECT_H -/** - * A renderbuffer stores colors or depth values or stencil values. - * A framebuffer object will have a collection of these. - * Data are read/written to the buffer with a handful of Get/Put functions. - * - * Instances of this object are allocated with the Driver's NewRenderbuffer - * hook. Drivers will likely wrap this class inside a driver-specific - * class to simulate inheritance. - */ -struct gl_renderbuffer -{ - GLuint Name; - GLint RefCount; - GLuint Width, Height; - GLenum InternalFormat; - GLenum _BaseFormat; /* Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or */ - /* GL_STENCIL_INDEX. */ - - GLenum DataType; /* GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, etc */ - GLvoid *Data; - - /* Delete this renderbuffer */ - void (*Delete)(GLcontext *ctx, struct gl_renderbuffer *rb); - - /* Allocate new storage for this renderbuffer */ - GLboolean (*AllocStorage)(GLcontext *ctx, struct gl_renderbuffer *rb, - GLenum internalFormat, - GLuint width, GLuint height); - - /* Return a pointer to the element/pixel at (x,y). - * Should return NULL if the buffer memory can't be directly addressed. - */ - void *(*GetPointer)(struct gl_renderbuffer *rb, GLint x, GLint y); - - /* Get/Read a row of values. - * The values will be of format _BaseFormat and type DataType. - */ - void (*GetRow)(struct gl_renderbuffer *rb, - GLint x, GLint y, GLuint count, void *values); - - /* Get/Read values at arbitrary locations - * The values will be of format _BaseFormat and type DataType. - */ - void (*GetValues)(struct gl_renderbuffer *rb, - const GLint x[], const GLint y[], - GLuint count, void *values); - - /* Put/Write a row of values - * The values will be of format _BaseFormat and type DataType. - */ - void (*PutRow)(struct gl_renderbuffer *rb, - GLint x, GLint y, GLuint count, - const void *values, const GLubyte *maek); - - /* Put/Write values at arbitrary locations - * The values will be of format _BaseFormat and type DataType. - */ - void (*PutValues)(struct gl_renderbuffer *rb, - const GLint x[], const GLint y[], GLuint count, - const void *values, const GLubyte *mask); -}; - - -/** - * A renderbuffer attachment point points to either a texture object - * (and specifies a mipmap level, cube face or 3D texture slice) or - * points to a renderbuffer. - */ -struct gl_renderbuffer_attachment -{ - GLenum Type; /* GL_NONE or GL_TEXTURE or GL_RENDERBUFFER_EXT */ - GLboolean Complete; - - /* IF Type == GL_RENDERBUFFER_EXT: */ - struct gl_renderbuffer *Renderbuffer; - - /* IF Type == GL_TEXTURE: */ - struct gl_texture_object *Texture; - GLuint TextureLevel; - GLuint CubeMapFace; /* 0 .. 5, for cube map textures */ - GLuint Zoffset; /* for 3D textures */ -}; - - -/** - * A framebuffer object is basically a collection of rendering buffers. - * (Though, a rendering buffer might actually be a texture image.) - * All the renderbuffers/textures which we reference must have the same - * width and height (and meet a few other requirements) in order for the - * framebufffer object to be "complete". - * - * Instances of this object are allocated with the Driver's Newframebuffer - * hook. Drivers will likely wrap this class inside a driver-specific - * class to simulate inheritance. - */ -struct gl_framebuffer -{ - GLuint Name; - GLint RefCount; - - GLenum Status; /* One of the GL_FRAMEBUFFER_(IN)COMPLETE_* tokens */ - - struct gl_renderbuffer_attachment ColorAttachment[MAX_COLOR_ATTACHMENTS]; - struct gl_renderbuffer_attachment DepthAttachment; - struct gl_renderbuffer_attachment StencilAttachment; - - /* In unextended OpenGL, these vars are part of the GL_COLOR_BUFFER - * attribute group and GL_PIXEL attribute group, respectively. - */ - GLenum DrawBuffer[MAX_DRAW_BUFFERS]; - GLenum ReadBuffer; - - GLuint _Width, _Height; - - /** Delete this framebuffer */ - void (*Delete)(GLcontext *ctx, struct gl_framebuffer *fb); -}; - - -extern struct gl_framebuffer * -_mesa_new_framebuffer(GLcontext *ctx, GLuint name); +extern void +_mesa_remove_attachment(GLcontext *ctx, + struct gl_renderbuffer_attachment *att); extern void -_mesa_delete_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb); +_mesa_set_texture_attachment(GLcontext *ctx, + struct gl_renderbuffer_attachment *att, + struct gl_texture_object *texObj, + GLenum texTarget, GLuint level, GLuint zoffset); -extern struct gl_renderbuffer * -_mesa_new_renderbuffer(GLcontext *ctx, GLuint name); +extern void +_mesa_set_renderbuffer_attachment(GLcontext *ctx, + struct gl_renderbuffer_attachment *att, + struct gl_renderbuffer *rb); extern void -_mesa_delete_renderbuffer(GLcontext *ctx, struct gl_renderbuffer *rb); +_mesa_framebuffer_renderbuffer(GLcontext *ctx, + struct gl_renderbuffer_attachment *att, + struct gl_renderbuffer *rb); +extern void +_mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb); extern GLboolean GLAPIENTRY _mesa_IsRenderbufferEXT(GLuint renderbuffer); diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c new file mode 100644 index 00000000000..c23c60948c9 --- /dev/null +++ b/src/mesa/main/framebuffer.c @@ -0,0 +1,513 @@ +/* + * Mesa 3-D graphics library + * Version: 6.3 + * + * Copyright (C) 1999-2005 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. + */ + + +/** + * Functions for allocating/managing framebuffers and renderbuffers. + * Also, routines for reading/writing renderbuffer data as ubytes, + * ushorts, uints, etc. + */ + + +#include "glheader.h" +#include "imports.h" +#include "context.h" +#include "mtypes.h" +#include "fbobject.h" +#include "framebuffer.h" +#include "renderbuffer.h" + + + +/** + * Compute/set the _DepthMax field for the given framebuffer. + * This value depends on the Z buffer resolution. + */ +static void +compute_depth_max(struct gl_framebuffer *fb) +{ + if (fb->Visual.depthBits == 0) { + /* Special case. Even if we don't have a depth buffer we need + * good values for DepthMax for Z vertex transformation purposes + * and for per-fragment fog computation. + */ + fb->_DepthMax = (1 << 16) - 1; + } + else if (fb->Visual.depthBits < 32) { + fb->_DepthMax = (1 << fb->Visual.depthBits) - 1; + } + else { + /* Special case since shift values greater than or equal to the + * number of bits in the left hand expression's type are undefined. + */ + fb->_DepthMax = 0xffffffff; + } + fb->_DepthMaxF = (GLfloat) fb->_DepthMax; + fb->_MRD = 1.0; /* Minimum resolvable depth value, for polygon offset */ +} + + +/** + * Create and initialize a gl_framebuffer object. + * This is intended for creating _window_system_ framebuffers, not generic + * framebuffer objects ala GL_EXT_framebuffer_object. + * + * \sa _mesa_new_framebuffer + */ +struct gl_framebuffer * +_mesa_create_framebuffer(const GLvisual *visual) +{ + struct gl_framebuffer *fb = CALLOC_STRUCT(gl_framebuffer); + assert(visual); + if (fb) { + _mesa_initialize_framebuffer(fb, visual); + } + return fb; +} + + +/** + * Allocate a new gl_framebuffer object. + * This is the default function for ctx->Driver.NewFramebuffer(). + * This is for allocating user-created framebuffers, not window-system + * framebuffers! + * \sa _mesa_create_framebuffer + */ +struct gl_framebuffer * +_mesa_new_framebuffer(GLcontext *ctx, GLuint name) +{ + struct gl_framebuffer *fb; + assert(name != 0); + fb = CALLOC_STRUCT(gl_framebuffer); + if (fb) { + fb->Name = name; + fb->RefCount = 1; + fb->Delete = _mesa_destroy_framebuffer; + fb->ColorDrawBuffer[0] = GL_COLOR_ATTACHMENT0_EXT; + fb->_ColorDrawBufferMask[0] = BUFFER_BIT_COLOR0; + fb->ColorReadBuffer = GL_COLOR_ATTACHMENT0_EXT; + fb->_ColorReadBufferMask = BUFFER_BIT_COLOR0; + fb->Delete = _mesa_destroy_framebuffer; + } + return fb; +} + + +/** + * Initialize a gl_framebuffer object. + * \sa _mesa_create_framebuffer + */ +void +_mesa_initialize_framebuffer(struct gl_framebuffer *fb, const GLvisual *visual) +{ + assert(fb); + assert(visual); + + _mesa_bzero(fb, sizeof(struct gl_framebuffer)); + + /* save the visual */ + fb->Visual = *visual; + + /* Init glRead/DrawBuffer state */ + if (visual->doubleBufferMode) { + fb->ColorDrawBuffer[0] = GL_BACK; + fb->_ColorDrawBufferMask[0] = BUFFER_BIT_BACK_LEFT; + fb->ColorReadBuffer = GL_BACK; + fb->_ColorReadBufferMask = BUFFER_BIT_BACK_LEFT; + } + else { + fb->ColorDrawBuffer[0] = GL_FRONT; + fb->_ColorDrawBufferMask[0] = BUFFER_BIT_FRONT_LEFT; + fb->ColorReadBuffer = GL_FRONT; + fb->_ColorReadBufferMask = BUFFER_BIT_FRONT_LEFT; + } + + fb->Delete = _mesa_destroy_framebuffer; + + compute_depth_max(fb); +} + + +/** + * Create/attach software-based renderbuffers to the given framebuffer. + * This is a helper routine for device drivers. Drivers can just as well + * call the individual _mesa_add_*_renderbuffer() routines directly. + */ +void +_mesa_add_soft_renderbuffers(struct gl_framebuffer *fb, + GLboolean color, + GLboolean depth, + GLboolean stencil, + GLboolean accum, + GLboolean alpha, + GLboolean aux) +{ + GLboolean frontLeft = GL_TRUE; + GLboolean backLeft = fb->Visual.doubleBufferMode; + GLboolean frontRight = fb->Visual.stereoMode; + GLboolean backRight = fb->Visual.stereoMode && fb->Visual.doubleBufferMode; + + if (color) { + if (fb->Visual.rgbMode) { + assert(fb->Visual.redBits == fb->Visual.greenBits); + assert(fb->Visual.redBits == fb->Visual.blueBits); + _mesa_add_color_renderbuffers(NULL, fb, + fb->Visual.redBits, + fb->Visual.alphaBits, + frontLeft, backLeft, + frontRight, backRight); + } + else { + _mesa_add_color_index_renderbuffers(NULL, fb, + fb->Visual.indexBits, + frontLeft, backLeft, + frontRight, backRight); + } + } + + if (depth) { + assert(fb->Visual.depthBits > 0); + _mesa_add_depth_renderbuffer(NULL, fb, fb->Visual.depthBits); + } + + if (stencil) { + assert(fb->Visual.stencilBits > 0); + _mesa_add_stencil_renderbuffer(NULL, fb, fb->Visual.stencilBits); + } + + if (accum) { + assert(fb->Visual.rgbMode); + assert(fb->Visual.accumRedBits > 0); + assert(fb->Visual.accumGreenBits > 0); + assert(fb->Visual.accumBlueBits > 0); + _mesa_add_accum_renderbuffer(NULL, fb, + fb->Visual.accumRedBits, + fb->Visual.accumGreenBits, + fb->Visual.accumBlueBits, + fb->Visual.accumAlphaBits); + } + + if (aux) { + assert(fb->Visual.rgbMode); + assert(fb->Visual.numAuxBuffers > 0); + _mesa_add_aux_renderbuffers(NULL, fb, fb->Visual.redBits, + fb->Visual.numAuxBuffers); + } + +#if 1 + if (alpha) { + assert(fb->Visual.rgbMode); + assert(fb->Visual.alphaBits > 0); + _mesa_add_alpha_renderbuffers(NULL, fb, fb->Visual.alphaBits, + frontLeft, backLeft, + frontRight, backRight); + } +#endif + +#if 0 + if (multisample) { + /* maybe someday */ + } +#endif +} + + +/** + * Deallocate buffer and everything attached to it. + */ +void +_mesa_destroy_framebuffer(struct gl_framebuffer *buffer) +{ + if (buffer) { + _mesa_free_framebuffer_data(buffer); + FREE(buffer); + } +} + + +/** + * Free all the data hanging off the given gl_framebuffer, but don't free + * the gl_framebuffer object itself. + */ +void +_mesa_free_framebuffer_data(struct gl_framebuffer *fb) +{ + GLuint i; + + assert(fb); + + for (i = 0; i < BUFFER_COUNT; i++) { + struct gl_renderbuffer_attachment *att = &fb->Attachment[i]; + if (att->Type == GL_RENDERBUFFER_EXT && att->Renderbuffer) { + struct gl_renderbuffer *rb = att->Renderbuffer; + rb->RefCount--; + if (rb->RefCount == 0) { + rb->Delete(rb); + } + } + att->Type = GL_NONE; + att->Renderbuffer = NULL; + } +} + + +/** + * Resize the given framebuffer's renderbuffers to the new width and height. + * This should only be used for window-system framebuffers, not + * user-created renderbuffers (i.e. made with GL_EXT_framebuffer_object). + * This will typically be called via ctx->Driver.ResizeBuffers() + */ +void +_mesa_resize_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb, + GLuint width, GLuint height) +{ + GLuint i; + + /* For window system framebuffers, Name is zero */ + assert(fb->Name == 0); + + for (i = 0; i < BUFFER_COUNT; i++) { + struct gl_renderbuffer_attachment *att = &fb->Attachment[i]; + if (att->Type == GL_RENDERBUFFER_EXT && att->Renderbuffer) { + struct gl_renderbuffer *rb = att->Renderbuffer; + /* only resize if size is changing */ + if (rb->Width != width || rb->Height != height) { + if (rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height)) { + rb->Width = width; + rb->Height = height; + } + else { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "Resizing framebuffer"); + } + } + } + } + + fb->Width = width; + fb->Height = height; +} + + +/** + * Examine all the framebuffer's renderbuffers to update the Width/Height + * fields of the framebuffer. If we have renderbuffers with different + * sizes, set the framebuffer's width and height to zero. + * Note: this is only intended for user-created framebuffers, not + * window-system framebuffes. + */ +static void +update_framebuffer_size(struct gl_framebuffer *fb) +{ + GLboolean haveSize = GL_FALSE; + GLuint i; + + /* user-created framebuffers only */ + assert(fb->Name); + + for (i = 0; i < BUFFER_COUNT; i++) { + struct gl_renderbuffer_attachment *att = &fb->Attachment[i]; + const struct gl_renderbuffer *rb = att->Renderbuffer; + if (rb) { + if (haveSize) { + if (rb->Width != fb->Width && rb->Height != fb->Height) { + /* size mismatch! */ + fb->Width = 0; + fb->Height = 0; + return; + } + } + else { + fb->Width = rb->Width; + fb->Height = rb->Height; + haveSize = GL_TRUE; + } + } + } +} + + +/** + * Update the context's current drawing buffer's Xmin, Xmax, Ymin, Ymax fields. + * These values are computed from the buffer's width and height and + * the scissor box, if it's enabled. + * \param ctx the GL context. + */ +void +_mesa_update_draw_buffer_bounds(GLcontext *ctx) +{ + struct gl_framebuffer *buffer = ctx->DrawBuffer; + + if (buffer->Name) { + /* user-created framebuffer size depends on the renderbuffers */ + update_framebuffer_size(buffer); + } + + buffer->_Xmin = 0; + buffer->_Ymin = 0; + buffer->_Xmax = buffer->Width; + buffer->_Ymax = buffer->Height; + + if (ctx->Scissor.Enabled) { + if (ctx->Scissor.X > buffer->_Xmin) { + buffer->_Xmin = ctx->Scissor.X; + } + if (ctx->Scissor.Y > buffer->_Ymin) { + buffer->_Ymin = ctx->Scissor.Y; + } + if (ctx->Scissor.X + ctx->Scissor.Width < buffer->_Xmax) { + buffer->_Xmax = ctx->Scissor.X + ctx->Scissor.Width; + } + if (ctx->Scissor.Y + ctx->Scissor.Height < buffer->_Ymax) { + buffer->_Ymax = ctx->Scissor.Y + ctx->Scissor.Height; + } + /* finally, check for empty region */ + if (buffer->_Xmin > buffer->_Xmax) { + buffer->_Xmin = buffer->_Xmax; + } + if (buffer->_Ymin > buffer->_Ymax) { + buffer->_Ymin = buffer->_Ymax; + } + } + + ASSERT(buffer->_Xmin <= buffer->_Xmax); + ASSERT(buffer->_Ymin <= buffer->_Ymax); +} + + +/** + * The glGet queries of the framebuffer red/green/blue size, stencil size, + * etc. are satisfied by the fields of ctx->DrawBuffer->Visual. These can + * change depending on the renderbuffer bindings. This function update's + * the given framebuffer's Visual from the current renderbuffer bindings. + * This is only intended for user-created framebuffers. + */ +void +_mesa_update_framebuffer_visual(struct gl_framebuffer *fb) +{ + assert(fb->Name != 0); + + _mesa_bzero(&fb->Visual, sizeof(fb->Visual)); + fb->Visual.rgbMode = GL_TRUE; + + if (fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer) { + fb->Visual.redBits + = fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer->ComponentSizes[0]; + fb->Visual.greenBits + = fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer->ComponentSizes[1]; + fb->Visual.blueBits + = fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer->ComponentSizes[2]; + fb->Visual.alphaBits + = fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer->ComponentSizes[3]; + fb->Visual.rgbBits + = fb->Visual.redBits + fb->Visual.greenBits + fb->Visual.blueBits; + fb->Visual.floatMode = GL_FALSE; + } + + if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) { + fb->Visual.haveDepthBuffer = GL_TRUE; + fb->Visual.depthBits + = fb->Attachment[BUFFER_DEPTH].Renderbuffer->ComponentSizes[0]; + } + + if (fb->Attachment[BUFFER_STENCIL].Renderbuffer) { + fb->Visual.haveStencilBuffer = GL_TRUE; + fb->Visual.stencilBits + = fb->Attachment[BUFFER_STENCIL].Renderbuffer->ComponentSizes[0]; + } + + compute_depth_max(fb); +} + + +/** + * Given a framebuffer and a buffer bit (like BUFFER_BIT_FRONT_LEFT), return + * the corresponding renderbuffer. + */ +static struct gl_renderbuffer * +get_renderbuffer(struct gl_framebuffer *fb, GLuint bufferBit) +{ + GLuint index; + for (index = 0; index < BUFFER_COUNT; index++) { + if ((1 << index) == bufferBit) { + return fb->Attachment[index].Renderbuffer; + } + } + _mesa_problem(NULL, "Bad bufferBit in get_renderbuffer"); + return NULL; +} + + +/** + * Update state related to the current draw/read framebuffers. + * If the current framebuffer is user-created, make sure it's complete. + */ +void +_mesa_update_framebuffer(GLcontext *ctx) +{ + struct gl_framebuffer *fb = ctx->DrawBuffer; + GLuint output; + + /* Completeness only matters for user-created framebuffers */ + if (fb->Name != 0) + _mesa_test_framebuffer_completeness(ctx, fb); + + /* + * Update the list of drawing renderbuffer pointers. + * Later, when we're rendering we'll loop from 0 to _NumColorDrawBuffers + * writing colors. We have a loop because glDrawBuffer(GL_FRONT_AND_BACK) + * can specify writing to two or four color buffers. + */ + for (output = 0; output < ctx->Const.MaxDrawBuffers; output++) { + GLuint bufferMask = fb->_ColorDrawBufferMask[output]; + GLuint count = 0; + GLuint bufferBit; + /* for each bit that's set in the bufferMask... */ + for (bufferBit = 1; bufferMask; bufferBit <<= 1) { + if (bufferBit & bufferMask) { + struct gl_renderbuffer *rb = get_renderbuffer(fb, bufferBit); + if (rb) { + fb->_ColorDrawBuffers[output][count] = rb; + fb->_ColorDrawBit[output][count] = bufferBit; + count++; + } + else { + _mesa_warning(ctx, "DrawBuffer names a missing buffer!"); + } + bufferMask &= ~bufferBit; + } + } + fb->_NumColorDrawBuffers[output] = count; + } + + /* + * Update the read renderbuffer pointer. + * Unlike the DrawBuffer, we can only read from one (or zero) color buffers. + */ + if (fb->_ColorReadBufferMask == 0x0) + fb->_ColorReadBuffer = NULL; /* legal! */ + else + fb->_ColorReadBuffer = get_renderbuffer(fb, fb->_ColorReadBufferMask); + + compute_depth_max(fb); +} diff --git a/src/mesa/main/framebuffer.h b/src/mesa/main/framebuffer.h new file mode 100644 index 00000000000..11b002877c9 --- /dev/null +++ b/src/mesa/main/framebuffer.h @@ -0,0 +1,67 @@ +/* + * Mesa 3-D graphics library + * Version: 6.3 + * + * Copyright (C) 1999-2005 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. + */ + + +#ifndef FRAMEBUFFER_H +#define FRAMEBUFFER_H + + +extern struct gl_framebuffer * +_mesa_create_framebuffer(const GLvisual *visual); + +extern struct gl_framebuffer * +_mesa_new_framebuffer(GLcontext *ctx, GLuint name); + +extern void +_mesa_initialize_framebuffer(struct gl_framebuffer *fb, const GLvisual *visual); + +extern void +_mesa_add_soft_renderbuffers(struct gl_framebuffer *fb, + GLboolean color, + GLboolean depth, + GLboolean stencil, + GLboolean accum, + GLboolean alpha, + GLboolean aux); + +extern void +_mesa_destroy_framebuffer(struct gl_framebuffer *buffer); + +extern void +_mesa_free_framebuffer_data(struct gl_framebuffer *buffer); + +extern void +_mesa_resize_framebuffer(GLcontext *ctx, struct gl_framebuffer *b, + GLuint width, GLuint height); + +extern void +_mesa_update_draw_buffer_bounds(GLcontext *ctx); + +extern void +_mesa_update_framebuffer_visual(struct gl_framebuffer *fb); + +extern void +_mesa_update_framebuffer(GLcontext *ctx); + +#endif /* FRAMEBUFFER_H */ diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 9b2981059cb..b6f08efc34d 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -91,16 +91,16 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) switch (pname) { case GL_ACCUM_RED_BITS: - params[0] = INT_TO_BOOLEAN(ctx->Visual.accumRedBits); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.accumRedBits); break; case GL_ACCUM_GREEN_BITS: - params[0] = INT_TO_BOOLEAN(ctx->Visual.accumGreenBits); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.accumGreenBits); break; case GL_ACCUM_BLUE_BITS: - params[0] = INT_TO_BOOLEAN(ctx->Visual.accumBlueBits); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.accumBlueBits); break; case GL_ACCUM_ALPHA_BITS: - params[0] = INT_TO_BOOLEAN(ctx->Visual.accumAlphaBits); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.accumAlphaBits); break; case GL_ACCUM_CLEAR_VALUE: params[0] = FLOAT_TO_BOOLEAN(ctx->Accum.ClearColor[0]); @@ -112,7 +112,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.AlphaBias); break; case GL_ALPHA_BITS: - params[0] = INT_TO_BOOLEAN(ctx->Visual.alphaBits); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.alphaBits); break; case GL_ALPHA_SCALE: params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.AlphaScale); @@ -133,7 +133,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = ctx->Eval.AutoNormal; break; case GL_AUX_BUFFERS: - params[0] = INT_TO_BOOLEAN(ctx->Visual.numAuxBuffers); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.numAuxBuffers); break; case GL_BLEND: params[0] = ctx->Color.BlendEnabled; @@ -172,7 +172,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.BlueBias); break; case GL_BLUE_BITS: - params[0] = INT_TO_BOOLEAN(ctx->Visual.blueBits); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.blueBits); break; case GL_BLUE_SCALE: params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.BlueScale); @@ -291,7 +291,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.DepthBias); break; case GL_DEPTH_BITS: - params[0] = INT_TO_BOOLEAN(ctx->Visual.depthBits); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.depthBits); break; case GL_DEPTH_CLEAR_VALUE: params[0] = FLOAT_TO_BOOLEAN(ctx->Depth.Clear); @@ -316,7 +316,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = ctx->Color.DitherFlag; break; case GL_DOUBLEBUFFER: - params[0] = ctx->Visual.doubleBufferMode; + params[0] = ctx->DrawBuffer->Visual.doubleBufferMode; break; case GL_DRAW_BUFFER: params[0] = ENUM_TO_BOOLEAN(ctx->Color.DrawBuffer[0]); @@ -367,19 +367,19 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.GreenBias); break; case GL_GREEN_BITS: - params[0] = INT_TO_BOOLEAN(ctx->Visual.greenBits); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.greenBits); break; case GL_GREEN_SCALE: params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.GreenScale); break; case GL_INDEX_BITS: - params[0] = INT_TO_BOOLEAN(ctx->Visual.indexBits); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.indexBits); break; case GL_INDEX_CLEAR_VALUE: params[0] = INT_TO_BOOLEAN(ctx->Color.ClearIndex); break; case GL_INDEX_MODE: - params[0] = !ctx->Visual.rgbMode; + params[0] = !ctx->DrawBuffer->Visual.rgbMode; break; case GL_INDEX_OFFSET: params[0] = INT_TO_BOOLEAN(ctx->Pixel.IndexOffset); @@ -794,7 +794,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.RedBias); break; case GL_RED_BITS: - params[0] = INT_TO_BOOLEAN( ctx->Visual.redBits ); + params[0] = INT_TO_BOOLEAN( ctx->DrawBuffer->Visual.redBits ); break; case GL_RED_SCALE: params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.RedScale); @@ -806,7 +806,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = ctx->Transform.RescaleNormals; break; case GL_RGBA_MODE: - params[0] = ctx->Visual.rgbMode; + params[0] = ctx->DrawBuffer->Visual.rgbMode; break; case GL_SCISSOR_BOX: params[0] = INT_TO_BOOLEAN(ctx->Scissor.X); @@ -827,7 +827,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = ctx->Texture.SharedPalette; break; case GL_STENCIL_BITS: - params[0] = INT_TO_BOOLEAN(ctx->Visual.stencilBits); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.stencilBits); break; case GL_STENCIL_CLEAR_VALUE: params[0] = INT_TO_BOOLEAN(ctx->Stencil.Clear); @@ -857,7 +857,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = INT_TO_BOOLEAN(ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]); break; case GL_STEREO: - params[0] = ctx->Visual.stereoMode; + params[0] = ctx->DrawBuffer->Visual.stereoMode; break; case GL_SUBPIXEL_BITS: params[0] = INT_TO_BOOLEAN(ctx->Const.SubPixelBits); @@ -1414,11 +1414,11 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) break; case GL_SAMPLE_BUFFERS_ARB: CHECK_EXTENSION_B(ARB_multisample, pname); - params[0] = INT_TO_BOOLEAN(0); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.sampleBuffers); break; case GL_SAMPLES_ARB: CHECK_EXTENSION_B(ARB_multisample, pname); - params[0] = INT_TO_BOOLEAN(0); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.samples); break; case GL_RASTER_POSITION_UNCLIPPED_IBM: CHECK_EXTENSION_B(IBM_rasterpos_clip, pname); @@ -1877,7 +1877,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) break; case GL_FRAMEBUFFER_BINDING_EXT: CHECK_EXTENSION_B(EXT_framebuffer_object, pname); - params[0] = INT_TO_BOOLEAN(ctx->CurrentFramebuffer ? ctx->CurrentFramebuffer->Name : 0); + params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Name); break; case GL_RENDERBUFFER_BINDING_EXT: CHECK_EXTENSION_B(EXT_framebuffer_object, pname); @@ -1935,16 +1935,16 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) switch (pname) { case GL_ACCUM_RED_BITS: - params[0] = (GLfloat)(ctx->Visual.accumRedBits); + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.accumRedBits); break; case GL_ACCUM_GREEN_BITS: - params[0] = (GLfloat)(ctx->Visual.accumGreenBits); + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.accumGreenBits); break; case GL_ACCUM_BLUE_BITS: - params[0] = (GLfloat)(ctx->Visual.accumBlueBits); + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.accumBlueBits); break; case GL_ACCUM_ALPHA_BITS: - params[0] = (GLfloat)(ctx->Visual.accumAlphaBits); + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.accumAlphaBits); break; case GL_ACCUM_CLEAR_VALUE: params[0] = ctx->Accum.ClearColor[0]; @@ -1956,7 +1956,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = ctx->Pixel.AlphaBias; break; case GL_ALPHA_BITS: - params[0] = (GLfloat)(ctx->Visual.alphaBits); + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.alphaBits); break; case GL_ALPHA_SCALE: params[0] = ctx->Pixel.AlphaScale; @@ -1977,7 +1977,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = BOOLEAN_TO_FLOAT(ctx->Eval.AutoNormal); break; case GL_AUX_BUFFERS: - params[0] = (GLfloat)(ctx->Visual.numAuxBuffers); + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.numAuxBuffers); break; case GL_BLEND: params[0] = BOOLEAN_TO_FLOAT(ctx->Color.BlendEnabled); @@ -2016,7 +2016,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = ctx->Pixel.BlueBias; break; case GL_BLUE_BITS: - params[0] = (GLfloat)(ctx->Visual.blueBits); + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.blueBits); break; case GL_BLUE_SCALE: params[0] = ctx->Pixel.BlueScale; @@ -2135,7 +2135,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = ctx->Pixel.DepthBias; break; case GL_DEPTH_BITS: - params[0] = (GLfloat)(ctx->Visual.depthBits); + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.depthBits); break; case GL_DEPTH_CLEAR_VALUE: params[0] = ctx->Depth.Clear; @@ -2160,7 +2160,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = BOOLEAN_TO_FLOAT(ctx->Color.DitherFlag); break; case GL_DOUBLEBUFFER: - params[0] = BOOLEAN_TO_FLOAT(ctx->Visual.doubleBufferMode); + params[0] = BOOLEAN_TO_FLOAT(ctx->DrawBuffer->Visual.doubleBufferMode); break; case GL_DRAW_BUFFER: params[0] = ENUM_TO_FLOAT(ctx->Color.DrawBuffer[0]); @@ -2211,19 +2211,19 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = ctx->Pixel.GreenBias; break; case GL_GREEN_BITS: - params[0] = (GLfloat)(ctx->Visual.greenBits); + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.greenBits); break; case GL_GREEN_SCALE: params[0] = ctx->Pixel.GreenScale; break; case GL_INDEX_BITS: - params[0] = (GLfloat)(ctx->Visual.indexBits); + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.indexBits); break; case GL_INDEX_CLEAR_VALUE: params[0] = (GLfloat)(ctx->Color.ClearIndex); break; case GL_INDEX_MODE: - params[0] = BOOLEAN_TO_FLOAT(!ctx->Visual.rgbMode); + params[0] = BOOLEAN_TO_FLOAT(!ctx->DrawBuffer->Visual.rgbMode); break; case GL_INDEX_OFFSET: params[0] = (GLfloat)(ctx->Pixel.IndexOffset); @@ -2638,7 +2638,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = ctx->Pixel.RedBias; break; case GL_RED_BITS: - params[0] = (GLfloat)( ctx->Visual.redBits ); + params[0] = (GLfloat)( ctx->DrawBuffer->Visual.redBits ); break; case GL_RED_SCALE: params[0] = ctx->Pixel.RedScale; @@ -2650,7 +2650,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = BOOLEAN_TO_FLOAT(ctx->Transform.RescaleNormals); break; case GL_RGBA_MODE: - params[0] = BOOLEAN_TO_FLOAT(ctx->Visual.rgbMode); + params[0] = BOOLEAN_TO_FLOAT(ctx->DrawBuffer->Visual.rgbMode); break; case GL_SCISSOR_BOX: params[0] = (GLfloat)(ctx->Scissor.X); @@ -2671,7 +2671,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = BOOLEAN_TO_FLOAT(ctx->Texture.SharedPalette); break; case GL_STENCIL_BITS: - params[0] = (GLfloat)(ctx->Visual.stencilBits); + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.stencilBits); break; case GL_STENCIL_CLEAR_VALUE: params[0] = (GLfloat)(ctx->Stencil.Clear); @@ -2701,7 +2701,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = (GLfloat)(ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]); break; case GL_STEREO: - params[0] = BOOLEAN_TO_FLOAT(ctx->Visual.stereoMode); + params[0] = BOOLEAN_TO_FLOAT(ctx->DrawBuffer->Visual.stereoMode); break; case GL_SUBPIXEL_BITS: params[0] = (GLfloat)(ctx->Const.SubPixelBits); @@ -3258,11 +3258,11 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) break; case GL_SAMPLE_BUFFERS_ARB: CHECK_EXTENSION_F(ARB_multisample, pname); - params[0] = (GLfloat)(0); + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.sampleBuffers); break; case GL_SAMPLES_ARB: CHECK_EXTENSION_F(ARB_multisample, pname); - params[0] = (GLfloat)(0); + params[0] = (GLfloat)(ctx->DrawBuffer->Visual.samples); break; case GL_RASTER_POSITION_UNCLIPPED_IBM: CHECK_EXTENSION_F(IBM_rasterpos_clip, pname); @@ -3721,7 +3721,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) break; case GL_FRAMEBUFFER_BINDING_EXT: CHECK_EXTENSION_F(EXT_framebuffer_object, pname); - params[0] = (GLfloat)(ctx->CurrentFramebuffer ? ctx->CurrentFramebuffer->Name : 0); + params[0] = (GLfloat)(ctx->DrawBuffer->Name); break; case GL_RENDERBUFFER_BINDING_EXT: CHECK_EXTENSION_F(EXT_framebuffer_object, pname); @@ -3779,16 +3779,16 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) switch (pname) { case GL_ACCUM_RED_BITS: - params[0] = ctx->Visual.accumRedBits; + params[0] = ctx->DrawBuffer->Visual.accumRedBits; break; case GL_ACCUM_GREEN_BITS: - params[0] = ctx->Visual.accumGreenBits; + params[0] = ctx->DrawBuffer->Visual.accumGreenBits; break; case GL_ACCUM_BLUE_BITS: - params[0] = ctx->Visual.accumBlueBits; + params[0] = ctx->DrawBuffer->Visual.accumBlueBits; break; case GL_ACCUM_ALPHA_BITS: - params[0] = ctx->Visual.accumAlphaBits; + params[0] = ctx->DrawBuffer->Visual.accumAlphaBits; break; case GL_ACCUM_CLEAR_VALUE: params[0] = FLOAT_TO_INT(ctx->Accum.ClearColor[0]); @@ -3800,7 +3800,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = IROUND(ctx->Pixel.AlphaBias); break; case GL_ALPHA_BITS: - params[0] = ctx->Visual.alphaBits; + params[0] = ctx->DrawBuffer->Visual.alphaBits; break; case GL_ALPHA_SCALE: params[0] = IROUND(ctx->Pixel.AlphaScale); @@ -3821,7 +3821,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = BOOLEAN_TO_INT(ctx->Eval.AutoNormal); break; case GL_AUX_BUFFERS: - params[0] = ctx->Visual.numAuxBuffers; + params[0] = ctx->DrawBuffer->Visual.numAuxBuffers; break; case GL_BLEND: params[0] = BOOLEAN_TO_INT(ctx->Color.BlendEnabled); @@ -3860,7 +3860,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = IROUND(ctx->Pixel.BlueBias); break; case GL_BLUE_BITS: - params[0] = ctx->Visual.blueBits; + params[0] = ctx->DrawBuffer->Visual.blueBits; break; case GL_BLUE_SCALE: params[0] = IROUND(ctx->Pixel.BlueScale); @@ -3979,7 +3979,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = IROUND(ctx->Pixel.DepthBias); break; case GL_DEPTH_BITS: - params[0] = ctx->Visual.depthBits; + params[0] = ctx->DrawBuffer->Visual.depthBits; break; case GL_DEPTH_CLEAR_VALUE: params[0] = IROUND(ctx->Depth.Clear); @@ -4004,7 +4004,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = BOOLEAN_TO_INT(ctx->Color.DitherFlag); break; case GL_DOUBLEBUFFER: - params[0] = BOOLEAN_TO_INT(ctx->Visual.doubleBufferMode); + params[0] = BOOLEAN_TO_INT(ctx->DrawBuffer->Visual.doubleBufferMode); break; case GL_DRAW_BUFFER: params[0] = ENUM_TO_INT(ctx->Color.DrawBuffer[0]); @@ -4055,19 +4055,19 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = IROUND(ctx->Pixel.GreenBias); break; case GL_GREEN_BITS: - params[0] = ctx->Visual.greenBits; + params[0] = ctx->DrawBuffer->Visual.greenBits; break; case GL_GREEN_SCALE: params[0] = IROUND(ctx->Pixel.GreenScale); break; case GL_INDEX_BITS: - params[0] = ctx->Visual.indexBits; + params[0] = ctx->DrawBuffer->Visual.indexBits; break; case GL_INDEX_CLEAR_VALUE: params[0] = ctx->Color.ClearIndex; break; case GL_INDEX_MODE: - params[0] = BOOLEAN_TO_INT(!ctx->Visual.rgbMode); + params[0] = BOOLEAN_TO_INT(!ctx->DrawBuffer->Visual.rgbMode); break; case GL_INDEX_OFFSET: params[0] = ctx->Pixel.IndexOffset; @@ -4482,7 +4482,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = IROUND(ctx->Pixel.RedBias); break; case GL_RED_BITS: - params[0] = ctx->Visual.redBits ; + params[0] = ctx->DrawBuffer->Visual.redBits ; break; case GL_RED_SCALE: params[0] = IROUND(ctx->Pixel.RedScale); @@ -4494,7 +4494,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = BOOLEAN_TO_INT(ctx->Transform.RescaleNormals); break; case GL_RGBA_MODE: - params[0] = BOOLEAN_TO_INT(ctx->Visual.rgbMode); + params[0] = BOOLEAN_TO_INT(ctx->DrawBuffer->Visual.rgbMode); break; case GL_SCISSOR_BOX: params[0] = ctx->Scissor.X; @@ -4515,7 +4515,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = BOOLEAN_TO_INT(ctx->Texture.SharedPalette); break; case GL_STENCIL_BITS: - params[0] = ctx->Visual.stencilBits; + params[0] = ctx->DrawBuffer->Visual.stencilBits; break; case GL_STENCIL_CLEAR_VALUE: params[0] = ctx->Stencil.Clear; @@ -4545,7 +4545,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]; break; case GL_STEREO: - params[0] = BOOLEAN_TO_INT(ctx->Visual.stereoMode); + params[0] = BOOLEAN_TO_INT(ctx->DrawBuffer->Visual.stereoMode); break; case GL_SUBPIXEL_BITS: params[0] = ctx->Const.SubPixelBits; @@ -5102,11 +5102,11 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) break; case GL_SAMPLE_BUFFERS_ARB: CHECK_EXTENSION_I(ARB_multisample, pname); - params[0] = 0; + params[0] = ctx->DrawBuffer->Visual.sampleBuffers; break; case GL_SAMPLES_ARB: CHECK_EXTENSION_I(ARB_multisample, pname); - params[0] = 0; + params[0] = ctx->DrawBuffer->Visual.samples; break; case GL_RASTER_POSITION_UNCLIPPED_IBM: CHECK_EXTENSION_I(IBM_rasterpos_clip, pname); @@ -5565,7 +5565,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) break; case GL_FRAMEBUFFER_BINDING_EXT: CHECK_EXTENSION_I(EXT_framebuffer_object, pname); - params[0] = ctx->CurrentFramebuffer ? ctx->CurrentFramebuffer->Name : 0; + params[0] = ctx->DrawBuffer->Name; break; case GL_RENDERBUFFER_BINDING_EXT: CHECK_EXTENSION_I(EXT_framebuffer_object, pname); diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index b3e6bc58559..8259972daa4 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -54,10 +54,14 @@ TypeStrings = { # - optional extension to check, or None (XXX this should be a list!) # StateVars = [ - ( "GL_ACCUM_RED_BITS", GLint, ["ctx->Visual.accumRedBits"], "", None ), - ( "GL_ACCUM_GREEN_BITS", GLint, ["ctx->Visual.accumGreenBits"], "", None ), - ( "GL_ACCUM_BLUE_BITS", GLint, ["ctx->Visual.accumBlueBits"], "", None ), - ( "GL_ACCUM_ALPHA_BITS", GLint, ["ctx->Visual.accumAlphaBits"], "", None ), + ( "GL_ACCUM_RED_BITS", GLint, ["ctx->DrawBuffer->Visual.accumRedBits"], + "", None ), + ( "GL_ACCUM_GREEN_BITS", GLint, ["ctx->DrawBuffer->Visual.accumGreenBits"], + "", None ), + ( "GL_ACCUM_BLUE_BITS", GLint, ["ctx->DrawBuffer->Visual.accumBlueBits"], + "", None ), + ( "GL_ACCUM_ALPHA_BITS", GLint, ["ctx->DrawBuffer->Visual.accumAlphaBits"], + "", None ), ( "GL_ACCUM_CLEAR_VALUE", GLfloatN, [ "ctx->Accum.ClearColor[0]", "ctx->Accum.ClearColor[1]", @@ -65,14 +69,16 @@ StateVars = [ "ctx->Accum.ClearColor[3]" ], "", None ), ( "GL_ALPHA_BIAS", GLfloat, ["ctx->Pixel.AlphaBias"], "", None ), - ( "GL_ALPHA_BITS", GLint, ["ctx->Visual.alphaBits"], "", None ), + ( "GL_ALPHA_BITS", GLint, ["ctx->DrawBuffer->Visual.alphaBits"], + "", None ), ( "GL_ALPHA_SCALE", GLfloat, ["ctx->Pixel.AlphaScale"], "", None ), ( "GL_ALPHA_TEST", GLboolean, ["ctx->Color.AlphaEnabled"], "", None ), ( "GL_ALPHA_TEST_FUNC", GLenum, ["ctx->Color.AlphaFunc"], "", None ), ( "GL_ALPHA_TEST_REF", GLfloatN, ["ctx->Color.AlphaRef"], "", None ), ( "GL_ATTRIB_STACK_DEPTH", GLint, ["ctx->AttribStackDepth"], "", None ), ( "GL_AUTO_NORMAL", GLboolean, ["ctx->Eval.AutoNormal"], "", None ), - ( "GL_AUX_BUFFERS", GLint, ["ctx->Visual.numAuxBuffers"], "", None ), + ( "GL_AUX_BUFFERS", GLint, ["ctx->DrawBuffer->Visual.numAuxBuffers"], + "", None ), ( "GL_BLEND", GLboolean, ["ctx->Color.BlendEnabled"], "", None ), ( "GL_BLEND_DST", GLenum, ["ctx->Color.BlendDstRGB"], "", None ), ( "GL_BLEND_SRC", GLenum, ["ctx->Color.BlendSrcRGB"], "", None ), @@ -89,7 +95,7 @@ StateVars = [ "ctx->Color.BlendColor[2]", "ctx->Color.BlendColor[3]"], "", None ), ( "GL_BLUE_BIAS", GLfloat, ["ctx->Pixel.BlueBias"], "", None ), - ( "GL_BLUE_BITS", GLint, ["ctx->Visual.blueBits"], "", None ), + ( "GL_BLUE_BITS", GLint, ["ctx->DrawBuffer->Visual.blueBits"], "", None ), ( "GL_BLUE_SCALE", GLfloat, ["ctx->Pixel.BlueScale"], "", None ), ( "GL_CLIENT_ATTRIB_STACK_DEPTH", GLint, ["ctx->ClientAttribStackDepth"], "", None ), @@ -165,7 +171,8 @@ StateVars = [ "ctx->Current.Attrib[VERT_ATTRIB_TEX0 + texUnit][3]"], "const GLuint texUnit = ctx->Texture.CurrentUnit;", None ), ( "GL_DEPTH_BIAS", GLfloat, ["ctx->Pixel.DepthBias"], "", None ), - ( "GL_DEPTH_BITS", GLint, ["ctx->Visual.depthBits"], "", None ), + ( "GL_DEPTH_BITS", GLint, ["ctx->DrawBuffer->Visual.depthBits"], + "", None ), ( "GL_DEPTH_CLEAR_VALUE", GLfloat, ["ctx->Depth.Clear"], "", None ), ( "GL_DEPTH_FUNC", GLenum, ["ctx->Depth.Func"], "", None ), ( "GL_DEPTH_RANGE", GLfloatN, @@ -174,7 +181,8 @@ StateVars = [ ( "GL_DEPTH_TEST", GLboolean, ["ctx->Depth.Test"], "", None ), ( "GL_DEPTH_WRITEMASK", GLboolean, ["ctx->Depth.Mask"], "", None ), ( "GL_DITHER", GLboolean, ["ctx->Color.DitherFlag"], "", None ), - ( "GL_DOUBLEBUFFER", GLboolean, ["ctx->Visual.doubleBufferMode"], "", None ), + ( "GL_DOUBLEBUFFER", GLboolean, + ["ctx->DrawBuffer->Visual.doubleBufferMode"], "", None ), ( "GL_DRAW_BUFFER", GLenum, ["ctx->Color.DrawBuffer[0]"], "", None ), ( "GL_EDGE_FLAG", GLboolean, ["ctx->Current.EdgeFlag"], "FLUSH_CURRENT(ctx, 0);", None ), @@ -194,11 +202,14 @@ StateVars = [ ( "GL_FOG_START", GLfloat, ["ctx->Fog.Start"], "", None ), ( "GL_FRONT_FACE", GLenum, ["ctx->Polygon.FrontFace"], "", None ), ( "GL_GREEN_BIAS", GLfloat, ["ctx->Pixel.GreenBias"], "", None ), - ( "GL_GREEN_BITS", GLint, ["ctx->Visual.greenBits"], "", None ), + ( "GL_GREEN_BITS", GLint, ["ctx->DrawBuffer->Visual.greenBits"], + "", None ), ( "GL_GREEN_SCALE", GLfloat, ["ctx->Pixel.GreenScale"], "", None ), - ( "GL_INDEX_BITS", GLint, ["ctx->Visual.indexBits"], "", None ), + ( "GL_INDEX_BITS", GLint, ["ctx->DrawBuffer->Visual.indexBits"], + "", None ), ( "GL_INDEX_CLEAR_VALUE", GLint, ["ctx->Color.ClearIndex"], "", None ), - ( "GL_INDEX_MODE", GLboolean, ["!ctx->Visual.rgbMode"], "", None ), + ( "GL_INDEX_MODE", GLboolean, ["!ctx->DrawBuffer->Visual.rgbMode"], + "", None ), ( "GL_INDEX_OFFSET", GLint, ["ctx->Pixel.IndexOffset"], "", None ), ( "GL_INDEX_SHIFT", GLint, ["ctx->Pixel.IndexShift"], "", None ), ( "GL_INDEX_WRITEMASK", GLint, ["ctx->Color.IndexMask"], "", None ), @@ -368,12 +379,13 @@ StateVars = [ ["ctx->ProjectionMatrixStack.Depth + 1"], "", None ), ( "GL_READ_BUFFER", GLenum, ["ctx->Pixel.ReadBuffer"], "", None ), ( "GL_RED_BIAS", GLfloat, ["ctx->Pixel.RedBias"], "", None ), - ( "GL_RED_BITS", GLint, [" ctx->Visual.redBits "], "", None ), + ( "GL_RED_BITS", GLint, [" ctx->DrawBuffer->Visual.redBits "], "", None ), ( "GL_RED_SCALE", GLfloat, ["ctx->Pixel.RedScale"], "", None ), ( "GL_RENDER_MODE", GLenum, ["ctx->RenderMode"], "", None ), ( "GL_RESCALE_NORMAL", GLboolean, ["ctx->Transform.RescaleNormals"], "", None ), - ( "GL_RGBA_MODE", GLboolean, ["ctx->Visual.rgbMode"], "", None ), + ( "GL_RGBA_MODE", GLboolean, ["ctx->DrawBuffer->Visual.rgbMode"], + "", None ), ( "GL_SCISSOR_BOX", GLint, ["ctx->Scissor.X", "ctx->Scissor.Y", @@ -384,7 +396,7 @@ StateVars = [ ( "GL_SHADE_MODEL", GLenum, ["ctx->Light.ShadeModel"], "", None ), ( "GL_SHARED_TEXTURE_PALETTE_EXT", GLboolean, ["ctx->Texture.SharedPalette"], "", None ), - ( "GL_STENCIL_BITS", GLint, ["ctx->Visual.stencilBits"], "", None ), + ( "GL_STENCIL_BITS", GLint, ["ctx->DrawBuffer->Visual.stencilBits"], "", None ), ( "GL_STENCIL_CLEAR_VALUE", GLint, ["ctx->Stencil.Clear"], "", None ), ( "GL_STENCIL_FAIL", GLenum, ["ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]"], "", None ), @@ -401,7 +413,8 @@ StateVars = [ ["ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]"], "", None ), ( "GL_STENCIL_WRITEMASK", GLint, ["ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]"], "", None ), - ( "GL_STEREO", GLboolean, ["ctx->Visual.stereoMode"], "", None ), + ( "GL_STEREO", GLboolean, ["ctx->DrawBuffer->Visual.stereoMode"], + "", None ), ( "GL_SUBPIXEL_BITS", GLint, ["ctx->Const.SubPixelBits"], "", None ), ( "GL_TEXTURE_1D", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_1D)"], "", None ), ( "GL_TEXTURE_2D", GLboolean, ["_mesa_IsEnabled(GL_TEXTURE_2D)"], "", None ), @@ -692,8 +705,10 @@ StateVars = [ ["ctx->Multisample.SampleCoverageValue"], "", "ARB_multisample" ), ( "GL_SAMPLE_COVERAGE_INVERT_ARB", GLboolean, ["ctx->Multisample.SampleCoverageInvert"], "", "ARB_multisample" ), - ( "GL_SAMPLE_BUFFERS_ARB", GLint, ["0"], "", "ARB_multisample" ), - ( "GL_SAMPLES_ARB", GLint, ["0"], "", "ARB_multisample" ), + ( "GL_SAMPLE_BUFFERS_ARB", GLint, + ["ctx->DrawBuffer->Visual.sampleBuffers"], "", "ARB_multisample" ), + ( "GL_SAMPLES_ARB", GLint, + ["ctx->DrawBuffer->Visual.samples"], "", "ARB_multisample" ), # GL_IBM_rasterpos_clip ( "GL_RASTER_POSITION_UNCLIPPED_IBM", GLboolean, @@ -953,8 +968,7 @@ StateVars = [ ( "GL_STENCIL_BACK_PASS_DEPTH_PASS", GLenum, ["ctx->Stencil.ZPassFunc[1]"], "", None ), # GL_EXT_framebuffer_object - ( "GL_FRAMEBUFFER_BINDING_EXT", GLint, - ["ctx->CurrentFramebuffer ? ctx->CurrentFramebuffer->Name : 0"], "", + ( "GL_FRAMEBUFFER_BINDING_EXT", GLint, ["ctx->DrawBuffer->Name"], "", "EXT_framebuffer_object" ), ( "GL_RENDERBUFFER_BINDING_EXT", GLint, ["ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0"], "", diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 70cbee5f3d0..2f0a1fa8c60 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -569,9 +569,12 @@ void _mesa_set_viewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height ) { + const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF; const GLfloat n = ctx->Viewport.Near; const GLfloat f = ctx->Viewport.Far; + ASSERT(depthMax > 0); + if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glViewport %d %d %d %d\n", x, y, width, height); @@ -606,8 +609,8 @@ _mesa_set_viewport( GLcontext *ctx, GLint x, GLint y, ctx->Viewport._WindowMap.m[MAT_TX] = ctx->Viewport._WindowMap.m[MAT_SX] + x; ctx->Viewport._WindowMap.m[MAT_SY] = (GLfloat) height / 2.0F; ctx->Viewport._WindowMap.m[MAT_TY] = ctx->Viewport._WindowMap.m[MAT_SY] + y; - ctx->Viewport._WindowMap.m[MAT_SZ] = ctx->DepthMaxF * ((f - n) / 2.0F); - ctx->Viewport._WindowMap.m[MAT_TZ] = ctx->DepthMaxF * ((f - n) / 2.0F + n); + ctx->Viewport._WindowMap.m[MAT_SZ] = depthMax * ((f - n) / 2.0F); + ctx->Viewport._WindowMap.m[MAT_TZ] = depthMax * ((f - n) / 2.0F + n); ctx->Viewport._WindowMap.flags = MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION; ctx->Viewport._WindowMap.type = MATRIX_3D_NO_ROT; ctx->NewState |= _NEW_VIEWPORT; @@ -636,10 +639,13 @@ _mesa_DepthRange( GLclampd nearval, GLclampd farval ) * specifies a linear mapping of the normalized z coords in * this range to window z coords. */ + GLfloat depthMax; GLfloat n, f; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + depthMax = ctx->DrawBuffer->_DepthMaxF; + if (MESA_VERBOSE&VERBOSE_API) _mesa_debug(ctx, "glDepthRange %f %f\n", nearval, farval); @@ -648,8 +654,8 @@ _mesa_DepthRange( GLclampd nearval, GLclampd farval ) ctx->Viewport.Near = n; ctx->Viewport.Far = f; - ctx->Viewport._WindowMap.m[MAT_SZ] = ctx->DepthMaxF * ((f - n) / 2.0F); - ctx->Viewport._WindowMap.m[MAT_TZ] = ctx->DepthMaxF * ((f - n) / 2.0F + n); + ctx->Viewport._WindowMap.m[MAT_SZ] = depthMax * ((f - n) / 2.0F); + ctx->Viewport._WindowMap.m[MAT_TZ] = depthMax * ((f - n) / 2.0F + n); ctx->NewState |= _NEW_VIEWPORT; if (ctx->Driver.DepthRange) { @@ -919,12 +925,14 @@ void _mesa_init_viewport( GLcontext *ctx ) ctx->Viewport.Far = 1.0; _math_matrix_ctr(&ctx->Viewport._WindowMap); +#if 0000 #define Sz 10 #define Tz 14 ctx->Viewport._WindowMap.m[Sz] = 0.5F * ctx->DepthMaxF; ctx->Viewport._WindowMap.m[Tz] = 0.5F * ctx->DepthMaxF; #undef Sz #undef Tz +#endif ctx->Viewport._WindowMap.flags = MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION; ctx->Viewport._WindowMap.type = MATRIX_3D_NO_ROT; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index b50bf0e4f1a..832166d2c07 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -65,16 +65,8 @@ #endif -/** - * Accumulation buffer data type. - */ -#if ACCUM_BITS==8 - typedef GLbyte GLaccum; -#elif ACCUM_BITS==16 - typedef GLshort GLaccum; -#elif ACCUM_BITS==32 - typedef GLfloat GLaccum; -#else +#if ACCUM_BITS != 16 +/* Software accum done with GLshort at this time */ # error "illegal number of accumulation bits" #endif @@ -139,13 +131,13 @@ typedef int GLfixed; */ /*@{*/ struct _mesa_HashTable; +struct gl_pixelstore_attrib; +struct gl_texture_format; struct gl_texture_image; struct gl_texture_object; typedef struct __GLcontextRec GLcontext; typedef struct __GLcontextModesRec GLvisual; -typedef struct gl_frame_buffer GLframebuffer; -struct gl_pixelstore_attrib; -struct gl_texture_format; +typedef struct gl_framebuffer GLframebuffer; /*@}*/ @@ -282,25 +274,53 @@ enum /** - * Bits for each basic buffer in a complete framebuffer. - * When glDrawBuffer(GL_FRONT_AND_BACK) is called (non-stereo), - * _DrawDestMask will be set to (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT), - * for example. Also passed to ctx->Driver.Clear() to indicate which - * buffers to clear. - */ -/*@{*/ -#define DD_FRONT_LEFT_BIT 0x1 -#define DD_FRONT_RIGHT_BIT 0x2 -#define DD_BACK_LEFT_BIT 0x4 -#define DD_BACK_RIGHT_BIT 0x8 -#define DD_AUX0_BIT 0x10 -#define DD_AUX1_BIT 0x20 -#define DD_AUX2_BIT 0x40 -#define DD_AUX3_BIT 0x80 -#define DD_DEPTH_BIT GL_DEPTH_BUFFER_BIT /* 0x00000100 */ -#define DD_ACCUM_BIT GL_ACCUM_BUFFER_BIT /* 0x00000200 */ -#define DD_STENCIL_BIT GL_STENCIL_BUFFER_BIT /* 0x00000400 */ -/*@}*/ + * Indexes for all renderbuffers + */ +enum { + BUFFER_FRONT_LEFT = 0, /* the four standard color buffers */ + BUFFER_BACK_LEFT = 1, + BUFFER_FRONT_RIGHT = 2, + BUFFER_BACK_RIGHT = 3, + BUFFER_AUX0 = 4, /* optional aux buffer */ + BUFFER_AUX1 = 5, + BUFFER_AUX2 = 6, + BUFFER_AUX3 = 7, + BUFFER_DEPTH = 8, + BUFFER_STENCIL = 9, + BUFFER_ACCUM = 10, + BUFFER_COLOR0 = 11, /* generic renderbuffers */ + BUFFER_COLOR1 = 12, + BUFFER_COLOR2 = 13, + BUFFER_COLOR3 = 14, + BUFFER_COLOR4 = 15, + BUFFER_COLOR5 = 16, + BUFFER_COLOR6 = 17, + BUFFER_COLOR7 = 18, + BUFFER_COUNT = 19 +}; + +/** + * Bit flags for all renderbuffers + */ +#define BUFFER_BIT_FRONT_LEFT (1 << BUFFER_FRONT_LEFT) +#define BUFFER_BIT_BACK_LEFT (1 << BUFFER_BACK_LEFT) +#define BUFFER_BIT_FRONT_RIGHT (1 << BUFFER_FRONT_RIGHT) +#define BUFFER_BIT_BACK_RIGHT (1 << BUFFER_BACK_RIGHT) +#define BUFFER_BIT_AUX0 (1 << BUFFER_AUX0) +#define BUFFER_BIT_AUX1 (1 << BUFFER_AUX1) +#define BUFFER_BIT_AUX2 (1 << BUFFER_AUX2) +#define BUFFER_BIT_AUX3 (1 << BUFFER_AUX3) +#define BUFFER_BIT_DEPTH (1 << BUFFER_DEPTH) +#define BUFFER_BIT_STENCIL (1 << BUFFER_STENCIL) +#define BUFFER_BIT_ACCUM (1 << BUFFER_ACCUM) +#define BUFFER_BIT_COLOR0 (1 << BUFFER_COLOR0) +#define BUFFER_BIT_COLOR1 (1 << BUFFER_COLOR1) +#define BUFFER_BIT_COLOR2 (1 << BUFFER_COLOR2) +#define BUFFER_BIT_COLOR3 (1 << BUFFER_COLOR3) +#define BUFFER_BIT_COLOR4 (1 << BUFFER_COLOR4) +#define BUFFER_BIT_COLOR5 (1 << BUFFER_COLOR5) +#define BUFFER_BIT_COLOR6 (1 << BUFFER_COLOR6) +#define BUFFER_BIT_COLOR7 (1 << BUFFER_COLOR7) /** @@ -484,7 +504,6 @@ struct gl_colorbuffer_attrib GLubyte ColorMask[4]; /**< Each flag is 0xff or 0x0 */ GLenum DrawBuffer[MAX_DRAW_BUFFERS]; /**< Which buffer to draw into */ - GLbitfield _DrawDestMask[MAX_DRAW_BUFFERS];/**< bitmask of DD_*_BIT bits */ /** * \name alpha testing @@ -885,11 +904,7 @@ struct gl_multisample_attrib */ struct gl_pixel_attrib { - GLenum ReadBuffer; /**< source buffer for glReadPixels()/glCopyPixels() */ - GLubyte _ReadSrcMask; /**< Not really a mask, but like _DrawDestMask - * - * May be: FRONT_LEFT_BIT, BACK_LEFT_BIT, - * FRONT_RIGHT_BIT or BACK_RIGHT_BIT. */ + GLenum ReadBuffer; /**< source buffer for glRead/CopyPixels() */ GLfloat RedBias, RedScale; GLfloat GreenBias, GreenScale; GLfloat BlueBias, BlueScale; @@ -973,7 +988,7 @@ struct gl_point_attrib GLfloat Threshold; /**< GL_EXT_point_parameters */ GLboolean _Attenuated; /**< True if Params != [1, 0, 0] */ GLboolean PointSprite; /**< GL_NV_point_sprite / GL_NV_point_sprite */ - GLboolean CoordReplace[MAX_TEXTURE_UNITS]; /**< GL_NV_point_sprite / GL_NV_point_sprite */ + GLboolean CoordReplace[MAX_TEXTURE_UNITS]; /**< GL_NV/ARB_point_sprite */ GLenum SpriteRMode; /**< GL_NV_point_sprite (only!) */ GLenum SpriteOrigin; /**< GL_ARB_point_sprite */ }; @@ -1136,6 +1151,10 @@ typedef void (*FetchTexelFuncF)( const struct gl_texture_image *texImage, GLfloat *texelOut ); +typedef void (*StoreTexelFunc)(struct gl_texture_image *texImage, + GLint col, GLint row, GLint img, + const void *texel); + /** * TexImage store function. This is called by the glTex[Sub]Image * functions and is responsible for converting the user-specified texture @@ -1191,6 +1210,8 @@ struct gl_texture_format FetchTexelFuncF FetchTexel2Df; FetchTexelFuncF FetchTexel3Df; /*@}*/ + + StoreTexelFunc StoreTexel; }; @@ -2001,64 +2022,174 @@ struct gl_shared_state }; + + /** - * Frame buffer. + * A renderbuffer stores colors or depth values or stencil values. + * A framebuffer object will have a collection of these. + * Data are read/written to the buffer with a handful of Get/Put functions. * - * A "frame buffer" is a color buffer and its optional ancillary buffers: - * depth, accum, stencil, and software-simulated alpha buffers. + * Instances of this object are allocated with the Driver's NewRenderbuffer + * hook. Drivers will likely wrap this class inside a driver-specific + * class to simulate inheritance. + */ +struct gl_renderbuffer +{ + GLuint Name; + GLint RefCount; + GLuint Width, Height; + GLenum InternalFormat; /* The user-specified value */ + GLenum _BaseFormat; /* Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or */ + /* GL_STENCIL_INDEX. */ + GLenum DataType; /* Type of values passed to the Get/Put functions */ + GLubyte ComponentSizes[4]; /* bits per component or channel */ + GLvoid *Data; + + /* Delete this renderbuffer */ + void (*Delete)(struct gl_renderbuffer *rb); + + /* Allocate new storage for this renderbuffer */ + GLboolean (*AllocStorage)(GLcontext *ctx, struct gl_renderbuffer *rb, + GLenum internalFormat, + GLuint width, GLuint height); + + /* Lock/Unlock are called before/after calling the Get/Put functions. + * Not sure this is the right place for these yet. + void (*Lock)(GLcontext *ctx, struct gl_renderbuffer *rb); + void (*Unlock)(GLcontext *ctx, struct gl_renderbuffer *rb); + */ + + /* Return a pointer to the element/pixel at (x,y). + * Should return NULL if the buffer memory can't be directly addressed. + */ + void *(*GetPointer)(GLcontext *ctx, struct gl_renderbuffer *rb, + GLint x, GLint y); + + /* Get/Read a row of values. + * The values will be of format _BaseFormat and type DataType. + */ + void (*GetRow)(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, void *values); + + /* Get/Read values at arbitrary locations. + * The values will be of format _BaseFormat and type DataType. + */ + void (*GetValues)(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], void *values); + + /* Put/Write a row of values. + * The values will be of format _BaseFormat and type DataType. + */ + void (*PutRow)(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask); + + /* Put/Write a row of RGB values. This is a special-case routine that's + * only used for RGBA renderbuffers when the source data is GL_RGB. That's + * a common case for glDrawPixels and some triangle routines. + * The values will be of format GL_RGB and type DataType. + */ + void (*PutRowRGB)(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask); + + + /* Put/Write a row of identical values. + * The values will be of format _BaseFormat and type DataType. + */ + void (*PutMonoRow)(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *value, const GLubyte *mask); + + /* Put/Write values at arbitrary locations. + * The values will be of format _BaseFormat and type DataType. + */ + void (*PutValues)(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], const void *values, + const GLubyte *mask); + /* Put/Write identical values at arbitrary locations. + * The values will be of format _BaseFormat and type DataType. + */ + void (*PutMonoValues)(GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint count, const GLint x[], const GLint y[], + const void *value, const GLubyte *mask); +}; + + +/** + * A renderbuffer attachment point points to either a texture object + * (and specifies a mipmap level, cube face or 3D texture slice) or + * points to a renderbuffer. + */ +struct gl_renderbuffer_attachment +{ + GLenum Type; /* GL_NONE or GL_TEXTURE or GL_RENDERBUFFER_EXT */ + GLboolean Complete; + + /* IF Type == GL_RENDERBUFFER_EXT: */ + struct gl_renderbuffer *Renderbuffer; + + /* IF Type == GL_TEXTURE: */ + struct gl_texture_object *Texture; + GLuint TextureLevel; + GLuint CubeMapFace; /* 0 .. 5, for cube map textures */ + GLuint Zoffset; /* for 3D textures */ +}; + + +/** + * A framebuffer is a collection of renderbuffers (color, depth, stencil, etc). * In C++ terms, think of this as a base class from which device drivers * will make derived classes. */ -struct gl_frame_buffer +struct gl_framebuffer { - GLvisual Visual; /**< The corresponding visual */ + GLuint Name; /* if zero, this is a window system framebuffer */ + GLint RefCount; - GLuint Width, Height; /**< size of frame buffer in pixels */ + GLvisual Visual; /**< The corresponding visual */ GLboolean Initialized; - GLboolean UseSoftwareDepthBuffer; - GLboolean UseSoftwareAccumBuffer; - GLboolean UseSoftwareStencilBuffer; - GLboolean UseSoftwareAlphaBuffers; - GLboolean UseSoftwareAuxBuffers; - - /** \name Software depth (aka Z) buffer */ - /*@{*/ - GLvoid *DepthBuffer; /**< array [Width*Height] of GLushort or GLuint*/ - /*@}*/ + GLuint Width, Height; /**< size of frame buffer in pixels */ - /** \name Software stencil buffer */ + /** \name Drawing bounds (Intersection of buffer size and scissor box) */ /*@{*/ - GLstencil *Stencil; /**< array [Width*Height] of GLstencil values */ + GLint _Xmin, _Xmax; /**< inclusive */ + GLint _Ymin, _Ymax; /**< exclusive */ /*@}*/ - /** \name Software accumulation buffer */ + /** \name Derived Z buffer stuff */ /*@{*/ - GLaccum *Accum; /**< array [4*Width*Height] of GLaccum values */ + GLuint _DepthMax; /**< Max depth buffer value */ + GLfloat _DepthMaxF; /**< Float max depth buffer value */ + GLfloat _MRD; /**< minimum resolvable difference in Z values */ /*@}*/ - /** \name Software alpha planes */ - /*@{*/ - GLchan *FrontLeftAlpha; /**< array [Width*Height] of GLchan */ - GLchan *BackLeftAlpha; /**< array [Width*Height] of GLchan */ - GLchan *FrontRightAlpha; /**< array [Width*Height] of GLchan */ - GLchan *BackRightAlpha; /**< array [Width*Height] of GLchan */ - /*@}*/ + GLenum _Status; /* One of the GL_FRAMEBUFFER_(IN)COMPLETE_* tokens */ - GLchan *AuxBuffers[MAX_AUX_BUFFERS]; + /* Array of all renderbuffer attachments, indexed by BUFFER_* tokens. */ + struct gl_renderbuffer_attachment Attachment[BUFFER_COUNT]; - /** - * \name Drawing bounds - * - * Intersection of window size and scissor box + /* In unextended OpenGL these vars are part of the GL_COLOR_BUFFER + * attribute group and GL_PIXEL attribute group, respectively. */ - /*@{*/ - GLint _Xmin; /**< inclusive */ - GLint _Ymin; /**< inclusive */ - GLint _Xmax; /**< exclusive */ - GLint _Ymax; /**< exclusive */ - /*@}*/ + GLenum ColorDrawBuffer[MAX_DRAW_BUFFERS]; + GLenum ColorReadBuffer; + + /* These are computed from ColorDrawBuffer and ColorReadBuffer */ + GLuint _ColorDrawBufferMask[MAX_DRAW_BUFFERS]; /* Mask of BUFFER_BIT_* flags */ + GLuint _ColorReadBufferMask; /* Zero or one of BUFFER_BIT_ flags */ + + /* These are computed from _Draw/ReadBufferMask, above. */ + GLuint _NumColorDrawBuffers[MAX_DRAW_BUFFERS]; + struct gl_renderbuffer *_ColorDrawBuffers[MAX_DRAW_BUFFERS][4]; + struct gl_renderbuffer *_ColorReadBuffer; + +#if OLD_RENDERBUFFER + /* XXX THIS IS TEMPORARY */ + GLuint _ColorDrawBit[MAX_DRAW_BUFFERS][4]; +#endif + + /** Delete this framebuffer */ + void (*Delete)(struct gl_framebuffer *fb); }; @@ -2545,6 +2676,8 @@ struct __GLcontextRec GLvisual Visual; GLframebuffer *DrawBuffer; /**< buffer for writing */ GLframebuffer *ReadBuffer; /**< buffer for reading */ + GLframebuffer *WinSysDrawBuffer; /**< set with MakeCurrent */ + GLframebuffer *WinSysReadBuffer; /**< set with MakeCurrent */ /** * Device driver function pointer table @@ -2663,7 +2796,7 @@ struct __GLcontextRec /*@}*/ #if FEATURE_EXT_framebuffer_object - struct gl_framebuffer *CurrentFramebuffer; + /*struct gl_framebuffer *CurrentFramebuffer;*/ struct gl_renderbuffer *CurrentRenderbuffer; #endif @@ -2696,14 +2829,6 @@ struct __GLcontextRec * We don't have a better way to communicate this value from * swrast_setup to swrast. */ - - /** \name Z buffer stuff */ - /*@{*/ - GLuint DepthMax; /**< Max depth buffer value */ - GLfloat DepthMaxF; /**< Float max depth buffer value */ - GLfloat MRD; /**< minimum resolvable difference in Z values */ - /*@}*/ - /** \name Color clamping (tentative part of GL_ARB_color_clamp_control) */ /*@{*/ GLboolean ClampFragmentColors; diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index 2b1434b62a4..6497813a826 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -2108,11 +2108,9 @@ _mesa_init_pixel( GLcontext *ctx ) if (ctx->Visual.doubleBufferMode) { ctx->Pixel.ReadBuffer = GL_BACK; - ctx->Pixel._ReadSrcMask = DD_BACK_LEFT_BIT; } else { ctx->Pixel.ReadBuffer = GL_FRONT; - ctx->Pixel._ReadSrcMask = DD_FRONT_LEFT_BIT; } /* Miscellaneous */ diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c index 6dbf81c37dd..b771408cf36 100644 --- a/src/mesa/main/polygon.c +++ b/src/mesa/main/polygon.c @@ -313,7 +313,8 @@ void GLAPIENTRY _mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias ) { GET_CURRENT_CONTEXT(ctx); - _mesa_PolygonOffset(factor, bias * ctx->DepthMaxF ); + /* XXX mult by DepthMaxF here??? */ + _mesa_PolygonOffset(factor, bias * ctx->DrawBuffer->_DepthMaxF ); } #endif diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index 23285d02757..507eb9f9843 100644 --- a/src/mesa/main/rastpos.c +++ b/src/mesa/main/rastpos.c @@ -466,7 +466,7 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) + ctx->Viewport._WindowMap.m[MAT_TY]); ctx->Current.RasterPos[2] = (ndc[2] * ctx->Viewport._WindowMap.m[MAT_SZ] + ctx->Viewport._WindowMap.m[MAT_TZ]) - / ctx->DepthMaxF; + / ctx->DrawBuffer->_DepthMaxF; ctx->Current.RasterPos[3] = clip[3]; /* compute raster distance */ diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c new file mode 100644 index 00000000000..7d21a8e3581 --- /dev/null +++ b/src/mesa/main/renderbuffer.c @@ -0,0 +1,1863 @@ +/* + * Mesa 3-D graphics library + * Version: 6.3 + * + * Copyright (C) 1999-2005 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. + */ + + +/** + * Functions for allocating/managing renderbuffers. + * Also, routines for reading/writing software-based renderbuffer data as + * ubytes, ushorts, uints, etc. + * + * The 'alpha8' renderbuffer is interesting. It's used to add a software-based + * alpha channel to RGB renderbuffers. This is done by wrapping the RGB + * renderbuffer with the alpha renderbuffer. We can do this because of the + * OO-nature of renderbuffers. + * + * Down the road we'll use this for run-time support of 8, 16 and 32-bit + * color channels. For example, Mesa may use 32-bit/float color channels + * internally (swrast) and use wrapper renderbuffers to convert 32-bit + * values down to 16 or 8-bit values for whatever kind of framebuffer we have. + */ + + +#include "glheader.h" +#include "imports.h" +#include "context.h" +#include "mtypes.h" +#include "fbobject.h" +#include "renderbuffer.h" + + +#define COLOR_INDEX32 0x424243 + + +/* + * Routines for get/put values in common buffer formats follow. + * Someday add support for arbitrary row stride to make them more + * flexible. + */ + +/********************************************************************** + * Functions for buffers of 1 X GLushort values. + * Typically stencil. + */ + +static void * +get_pointer_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, + GLint x, GLint y) +{ + if (!rb->Data) + return NULL; + ASSERT(rb->DataType == GL_UNSIGNED_BYTE); + return (GLubyte *) rb->Data + y * rb->Width + x; +} + + +static void +get_row_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, void *values) +{ + const GLubyte *src = (const GLubyte *) rb->Data + y * rb->Width + x; + ASSERT(rb->DataType == GL_UNSIGNED_BYTE); + _mesa_memcpy(values, src, count * sizeof(GLubyte)); +} + + +static void +get_values_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], void *values) +{ + GLubyte *dst = (GLubyte *) values; + GLuint i; + assert(rb->DataType == GL_UNSIGNED_BYTE); + for (i = 0; i < count; i++) { + const GLubyte *src = (GLubyte *) rb->Data + y[i] * rb->Width + x[i]; + dst[i] = *src; + } +} + + +static void +put_row_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask) +{ + const GLubyte *src = (const GLubyte *) values; + GLubyte *dst = (GLubyte *) rb->Data + y * rb->Width + x; + assert(rb->DataType == GL_UNSIGNED_BYTE); + if (mask) { + GLuint i; + for (i = 0; i < count; i++) { + if (mask[i]) { + dst[i] = src[i]; + } + } + } + else { + _mesa_memcpy(dst, values, count * sizeof(GLubyte)); + } +} + + +static void +put_mono_row_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *value, const GLubyte *mask) +{ + const GLubyte val = *((const GLubyte *) value); + GLubyte *dst = (GLubyte *) rb->Data + y * rb->Width + x; + assert(rb->DataType == GL_UNSIGNED_BYTE); + if (mask) { + GLuint i; + for (i = 0; i < count; i++) { + if (mask[i]) { + dst[i] = val; + } + } + } + else { + GLuint i; + for (i = 0; i < count; i++) { + dst[i] = val; + } + } +} + + +static void +put_values_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], + const void *values, const GLubyte *mask) +{ + const GLubyte *src = (const GLubyte *) values; + GLuint i; + assert(rb->DataType == GL_UNSIGNED_BYTE); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLubyte *dst = (GLubyte *) rb->Data + y[i] * rb->Width + x[i]; + *dst = src[i]; + } + } +} + + +static void +put_mono_values_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], + const void *value, const GLubyte *mask) +{ + const GLubyte val = *((const GLubyte *) value); + GLuint i; + assert(rb->DataType == GL_UNSIGNED_BYTE); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLubyte *dst = (GLubyte *) rb->Data + y[i] * rb->Width + x[i]; + *dst = val; + } + } +} + + +/********************************************************************** + * Functions for buffers of 1 X GLushort values. + * Typically depth/Z. + */ + +static void * +get_pointer_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, + GLint x, GLint y) +{ + if (!rb->Data) + return NULL; + ASSERT(rb->DataType == GL_UNSIGNED_SHORT); + ASSERT(rb->Width > 0); + return (GLushort *) rb->Data + y * rb->Width + x; +} + + +static void +get_row_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, void *values) +{ + const void *src = rb->GetPointer(ctx, rb, x, y); + ASSERT(rb->DataType == GL_UNSIGNED_SHORT); + _mesa_memcpy(values, src, count * sizeof(GLushort)); +} + + +static void +get_values_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], void *values) +{ + GLushort *dst = (GLushort *) values; + GLuint i; + ASSERT(rb->DataType == GL_UNSIGNED_SHORT); + for (i = 0; i < count; i++) { + const GLushort *src = (GLushort *) rb->Data + y[i] * rb->Width + x[i]; + dst[i] = *src; + } +} + + +static void +put_row_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask) +{ + const GLushort *src = (const GLushort *) values; + GLushort *dst = (GLushort *) rb->Data + y * rb->Width + x; + ASSERT(rb->DataType == GL_UNSIGNED_SHORT); + if (mask) { + GLuint i; + for (i = 0; i < count; i++) { + if (mask[i]) { + dst[i] = src[i]; + } + } + } + else { + _mesa_memcpy(dst, src, count * sizeof(GLushort)); + } +} + + +static void +put_mono_row_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *value, const GLubyte *mask) +{ + const GLushort val = *((const GLushort *) value); + GLushort *dst = (GLushort *) rb->Data + y * rb->Width + x; + ASSERT(rb->DataType == GL_UNSIGNED_SHORT); + if (mask) { + GLuint i; + for (i = 0; i < count; i++) { + if (mask[i]) { + dst[i] = val; + } + } + } + else { + GLuint i; + for (i = 0; i < count; i++) { + dst[i] = val; + } + } +} + + +static void +put_values_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], const void *values, + const GLubyte *mask) +{ + const GLushort *src = (const GLushort *) values; + GLuint i; + ASSERT(rb->DataType == GL_UNSIGNED_SHORT); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLushort *dst = (GLushort *) rb->Data + y[i] * rb->Width + x[i]; + *dst = src[i]; + } + } +} + + +static void +put_mono_values_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint count, const GLint x[], const GLint y[], + const void *value, const GLubyte *mask) +{ + const GLushort val = *((const GLushort *) value); + ASSERT(rb->DataType == GL_UNSIGNED_SHORT); + if (mask) { + GLuint i; + for (i = 0; i < count; i++) { + if (mask[i]) { + GLushort *dst = (GLushort *) rb->Data + y[i] * rb->Width + x[i]; + *dst = val; + } + } + } + else { + GLuint i; + for (i = 0; i < count; i++) { + GLushort *dst = (GLushort *) rb->Data + y[i] * rb->Width + x[i]; + *dst = val; + } + } +} + + +/********************************************************************** + * Functions for buffers of 1 X GLuint values. + * Typically depth/Z or color index. + */ + +static void * +get_pointer_uint(GLcontext *ctx, struct gl_renderbuffer *rb, + GLint x, GLint y) +{ + if (!rb->Data) + return NULL; + ASSERT(rb->DataType == GL_UNSIGNED_INT); + return (GLuint *) rb->Data + y * rb->Width + x; +} + + +static void +get_row_uint(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, void *values) +{ + const void *src = rb->GetPointer(ctx, rb, x, y); + ASSERT(rb->DataType == GL_UNSIGNED_INT); + _mesa_memcpy(values, src, count * sizeof(GLuint)); +} + + +static void +get_values_uint(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], void *values) +{ + GLuint *dst = (GLuint *) values; + GLuint i; + ASSERT(rb->DataType == GL_UNSIGNED_INT); + for (i = 0; i < count; i++) { + const GLuint *src = (GLuint *) rb->Data + y[i] * rb->Width + x[i]; + dst[i] = *src; + } +} + + +static void +put_row_uint(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask) +{ + const GLuint *src = (const GLuint *) values; + GLuint *dst = (GLuint *) rb->Data + y * rb->Width + x; + ASSERT(rb->DataType == GL_UNSIGNED_INT); + if (mask) { + GLuint i; + for (i = 0; i < count; i++) { + if (mask[i]) { + dst[i] = src[i]; + } + } + } + else { + _mesa_memcpy(dst, src, count * sizeof(GLuint)); + } +} + + +static void +put_mono_row_uint(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *value, const GLubyte *mask) +{ + const GLuint val = *((const GLuint *) value); + GLuint *dst = (GLuint *) rb->Data + y * rb->Width + x; + GLuint i; + ASSERT(rb->DataType == GL_UNSIGNED_INT); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst[i] = val; + } + } +} + + +static void +put_values_uint(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], const void *values, + const GLubyte *mask) +{ + const GLuint *src = (const GLuint *) values; + GLuint i; + ASSERT(rb->DataType == GL_UNSIGNED_INT); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLuint *dst = (GLuint *) rb->Data + y[i] * rb->Width + x[i]; + *dst = src[i]; + } + } +} + + +static void +put_mono_values_uint(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], const void *value, + const GLubyte *mask) +{ + const GLuint val = *((const GLuint *) value); + GLuint i; + ASSERT(rb->DataType == GL_UNSIGNED_INT); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLuint *dst = (GLuint *) rb->Data + y[i] * rb->Width + x[i]; + *dst = val; + } + } +} + + +/********************************************************************** + * Functions for buffers of 3 X GLubyte (or GLbyte) values. + * Typically color buffers. + * NOTE: the incoming and outgoing colors are RGBA! We ignore incoming + * alpha values and return 255 for outgoing alpha values. + */ + +static void * +get_pointer_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, + GLint x, GLint y) +{ + /* No direct access since this buffer is RGB but caller will be + * treating it as if it were RGBA. + */ + return NULL; +} + + +static void +get_row_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, void *values) +{ + const GLubyte *src = (const GLubyte *) rb->Data + 3 * (y * rb->Width + x); + GLubyte *dst = (GLubyte *) values; + GLuint i; + ASSERT(rb->DataType == GL_UNSIGNED_BYTE); + for (i = 0; i < count; i++) { + dst[i * 4 + 0] = src[i * 3 + 0]; + dst[i * 4 + 1] = src[i * 3 + 1]; + dst[i * 4 + 2] = src[i * 3 + 2]; + dst[i * 4 + 3] = 255; + } +} + + +static void +get_values_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], void *values) +{ + GLubyte *dst = (GLubyte *) values; + GLuint i; + assert(rb->DataType == GL_UNSIGNED_BYTE); + for (i = 0; i < count; i++) { + const GLubyte *src + = (GLubyte *) rb->Data + 3 * (y[i] * rb->Width + x[i]); + dst[i * 4 + 0] = src[0]; + dst[i * 4 + 1] = src[1]; + dst[i * 4 + 2] = src[2]; + dst[i * 4 + 3] = 255; + } +} + + +static void +put_row_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask) +{ + /* note: incoming values are RGB+A! */ + const GLubyte *src = (const GLubyte *) values; + GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->Width + x); + GLuint i; + assert(rb->DataType == GL_UNSIGNED_BYTE); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst[i * 3 + 0] = src[i * 4 + 0]; + dst[i * 3 + 1] = src[i * 4 + 1]; + dst[i * 3 + 2] = src[i * 4 + 2]; + } + } +} + + +static void +put_row_rgb_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask) +{ + /* note: incoming values are RGB+A! */ + const GLubyte *src = (const GLubyte *) values; + GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->Width + x); + GLuint i; + assert(rb->DataType == GL_UNSIGNED_BYTE); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst[i * 3 + 0] = src[i * 3 + 0]; + dst[i * 3 + 1] = src[i * 3 + 1]; + dst[i * 3 + 2] = src[i * 3 + 2]; + } + } +} + + +static void +put_mono_row_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *value, const GLubyte *mask) +{ + /* note: incoming value is RGB+A! */ + const GLubyte val0 = ((const GLubyte *) value)[0]; + const GLubyte val1 = ((const GLubyte *) value)[1]; + const GLubyte val2 = ((const GLubyte *) value)[2]; + GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->Width + x); + assert(rb->DataType == GL_UNSIGNED_BYTE); + if (!mask && val0 == val1 && val1 == val2) { + /* optimized case */ + _mesa_memset(dst, val0, 3 * count); + } + else { + GLuint i; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst[i * 3 + 0] = val0; + dst[i * 3 + 1] = val1; + dst[i * 3 + 2] = val2; + } + } + } +} + + +static void +put_values_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], const void *values, + const GLubyte *mask) +{ + /* note: incoming values are RGB+A! */ + const GLubyte *src = (const GLubyte *) values; + GLuint i; + assert(rb->DataType == GL_UNSIGNED_BYTE); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLubyte *dst = (GLubyte *) rb->Data + 3 * (y[i] * rb->Width + x[i]); + dst[0] = src[i * 4 + 0]; + dst[1] = src[i * 4 + 1]; + dst[2] = src[i * 4 + 2]; + } + } +} + + +static void +put_mono_values_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint count, const GLint x[], const GLint y[], + const void *value, const GLubyte *mask) +{ + /* note: incoming value is RGB+A! */ + const GLubyte val0 = ((const GLubyte *) value)[0]; + const GLubyte val1 = ((const GLubyte *) value)[1]; + const GLubyte val2 = ((const GLubyte *) value)[2]; + GLuint i; + assert(rb->DataType == GL_UNSIGNED_BYTE); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLubyte *dst = (GLubyte *) rb->Data + 3 * (y[i] * rb->Width + x[i]); + dst[0] = val0; + dst[1] = val1; + dst[2] = val2; + } + } +} + + +/********************************************************************** + * Functions for buffers of 4 X GLubyte (or GLbyte) values. + * Typically color buffers. + */ + +static void * +get_pointer_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, + GLint x, GLint y) +{ + if (!rb->Data) + return NULL; + ASSERT(rb->DataType == GL_UNSIGNED_BYTE); + return (GLubyte *) rb->Data + 4 * (y * rb->Width + x); +} + + +static void +get_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, void *values) +{ + const GLbyte *src = (const GLbyte *) rb->Data + 4 * (y * rb->Width + x); + ASSERT(rb->DataType == GL_UNSIGNED_BYTE); + _mesa_memcpy(values, src, 4 * count * sizeof(GLbyte)); +} + + +static void +get_values_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], void *values) +{ + /* treat 4*GLubyte as 1*GLuint */ + GLuint *dst = (GLuint *) values; + GLuint i; + assert(rb->DataType == GL_UNSIGNED_BYTE); + for (i = 0; i < count; i++) { + const GLuint *src = (GLuint *) rb->Data + (y[i] * rb->Width + x[i]); + dst[i] = *src; + } +} + + +static void +put_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask) +{ + /* treat 4*GLubyte as 1*GLuint */ + const GLuint *src = (const GLuint *) values; + GLuint *dst = (GLuint *) rb->Data + (y * rb->Width + x); + assert(rb->DataType == GL_UNSIGNED_BYTE); + if (mask) { + GLuint i; + for (i = 0; i < count; i++) { + if (mask[i]) { + dst[i] = src[i]; + } + } + } + else { + _mesa_memcpy(dst, src, 4 * count * sizeof(GLubyte)); + } +} + + +static void +put_row_rgb_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask) +{ + /* Store RGB values in RGBA buffer */ + const GLubyte *src = (const GLubyte *) values; + GLubyte *dst = (GLubyte *) rb->Data + 4 * (y * rb->Width + x); + GLuint i; + assert(rb->DataType == GL_UNSIGNED_BYTE); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst[i * 4 + 0] = src[i * 3 + 0]; + dst[i * 4 + 1] = src[i * 3 + 1]; + dst[i * 4 + 2] = src[i * 3 + 2]; + dst[i * 4 + 3] = 0xff; + } + } +} + + +static void +put_mono_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *value, const GLubyte *mask) +{ + /* treat 4*GLubyte as 1*GLuint */ + const GLuint val = *((const GLuint *) value); + GLuint *dst = (GLuint *) rb->Data + (y * rb->Width + x); + assert(rb->DataType == GL_UNSIGNED_BYTE); + if (!mask && val == 0) { + /* common case */ + _mesa_bzero(dst, count * 4 * sizeof(GLubyte)); + } + else { + /* general case */ + if (mask) { + GLuint i; + for (i = 0; i < count; i++) { + if (mask[i]) { + dst[i] = val; + } + } + } + else { + GLuint i; + for (i = 0; i < count; i++) { + dst[i] = val; + } + } + } +} + + +static void +put_values_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], const void *values, + const GLubyte *mask) +{ + /* treat 4*GLubyte as 1*GLuint */ + const GLuint *src = (const GLuint *) values; + GLuint i; + assert(rb->DataType == GL_UNSIGNED_BYTE); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLuint *dst = (GLuint *) rb->Data + (y[i] * rb->Width + x[i]); + *dst = src[i]; + } + } +} + + +static void +put_mono_values_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint count, const GLint x[], const GLint y[], + const void *value, const GLubyte *mask) +{ + /* treat 4*GLubyte as 1*GLuint */ + const GLuint val = *((const GLuint *) value); + GLuint i; + assert(rb->DataType == GL_UNSIGNED_BYTE); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLuint *dst = (GLuint *) rb->Data + (y[i] * rb->Width + x[i]); + *dst = val; + } + } +} + + +/********************************************************************** + * Functions for buffers of 4 X GLushort (or GLshort) values. + * Typically accum buffer. + */ + +static void * +get_pointer_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, + GLint x, GLint y) +{ + if (!rb->Data) + return NULL; + ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); + return (GLushort *) rb->Data + 4 * (y * rb->Width + x); +} + + +static void +get_row_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, void *values) +{ + const GLshort *src = (const GLshort *) rb->Data + 4 * (y * rb->Width + x); + ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); + _mesa_memcpy(values, src, 4 * count * sizeof(GLshort)); +} + + +static void +get_values_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], void *values) +{ + GLushort *dst = (GLushort *) values; + GLuint i; + ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); + for (i = 0; i < count; i++) { + const GLushort *src + = (GLushort *) rb->Data + 4 * (y[i] * rb->Width + x[i]); + dst[i] = *src; + } +} + + +static void +put_row_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask) +{ + const GLushort *src = (const GLushort *) values; + GLushort *dst = (GLushort *) rb->Data + 4 * (y * rb->Width + x); + ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); + if (mask) { + GLuint i; + for (i = 0; i < count; i++) { + if (mask[i]) { + dst[i * 4 + 0] = src[i * 4 + 0]; + dst[i * 4 + 1] = src[i * 4 + 1]; + dst[i * 4 + 2] = src[i * 4 + 2]; + dst[i * 4 + 3] = src[i * 4 + 3]; + } + } + } + else { + _mesa_memcpy(dst, src, 4 * count * sizeof(GLushort)); + } +} + + +static void +put_row_rgb_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask) +{ + /* Put RGB values in RGBA buffer */ + const GLushort *src = (const GLushort *) values; + GLushort *dst = (GLushort *) rb->Data + 4 * (y * rb->Width + x); + ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); + if (mask) { + GLuint i; + for (i = 0; i < count; i++) { + if (mask[i]) { + dst[i * 4 + 0] = src[i * 3 + 0]; + dst[i * 4 + 1] = src[i * 3 + 1]; + dst[i * 4 + 2] = src[i * 3 + 2]; + dst[i * 4 + 3] = 0xffff; + } + } + } + else { + _mesa_memcpy(dst, src, 4 * count * sizeof(GLushort)); + } +} + + +static void +put_mono_row_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *value, const GLubyte *mask) +{ + const GLushort val0 = ((const GLushort *) value)[0]; + const GLushort val1 = ((const GLushort *) value)[1]; + const GLushort val2 = ((const GLushort *) value)[2]; + const GLushort val3 = ((const GLushort *) value)[3]; + GLushort *dst = (GLushort *) rb->Data + 4 * (y * rb->Width + x); + ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); + if (!mask && val0 == 0 && val1 == 0 && val2 == 0 && val3 == 0) { + /* common case for clearing accum buffer */ + _mesa_bzero(dst, count * 4 * sizeof(GLushort)); + } + else { + GLuint i; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst[i * 4 + 0] = val0; + dst[i * 4 + 1] = val1; + dst[i * 4 + 2] = val2; + dst[i * 4 + 3] = val3; + } + } + } +} + + +static void +put_values_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], const void *values, + const GLubyte *mask) +{ + const GLushort *src = (const GLushort *) values; + GLuint i; + ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLushort *dst = (GLushort *) rb->Data + 4 * (y[i] * rb->Width + x[i]); + dst[0] = src[i * 4 + 0]; + dst[1] = src[i * 4 + 1]; + dst[2] = src[i * 4 + 2]; + dst[3] = src[i * 4 + 3]; + } + } +} + + +static void +put_mono_values_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint count, const GLint x[], const GLint y[], + const void *value, const GLubyte *mask) +{ + const GLushort val0 = ((const GLushort *) value)[0]; + const GLushort val1 = ((const GLushort *) value)[1]; + const GLushort val2 = ((const GLushort *) value)[2]; + const GLushort val3 = ((const GLushort *) value)[3]; + GLuint i; + ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLushort *dst = (GLushort *) rb->Data + 4 * (y[i] * rb->Width + x[i]); + dst[0] = val0; + dst[1] = val1; + dst[2] = val2; + dst[3] = val3; + } + } +} + + + +/** + * This is a software fallback for the gl_renderbuffer->AllocStorage + * function. + * Device drivers will typically override this function for the buffers + * which it manages (typically color buffers, Z and stencil). + * Other buffers (like software accumulation and aux buffers) which the driver + * doesn't manage can be handled with this function. + * + * This one multi-purpose function can allocate stencil, depth, accum, color + * or color-index buffers! + * + * This function also plugs in the appropriate GetPointer, Get/PutRow and + * Get/PutValues functions. + */ +static GLboolean +soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, + GLenum internalFormat, GLuint width, GLuint height) +{ + GLuint pixelSize; + + switch (internalFormat) { + case GL_RGB: + case GL_R3_G3_B2: + case GL_RGB4: + case GL_RGB5: + case GL_RGB8: + case GL_RGB10: + case GL_RGB12: + case GL_RGB16: + rb->_BaseFormat = GL_RGB; + rb->DataType = GL_UNSIGNED_BYTE; + rb->GetPointer = get_pointer_ubyte3; + rb->GetRow = get_row_ubyte3; + rb->GetValues = get_values_ubyte3; + rb->PutRow = put_row_ubyte3; + rb->PutRowRGB = put_row_rgb_ubyte3; + rb->PutMonoRow = put_mono_row_ubyte3; + rb->PutValues = put_values_ubyte3; + rb->PutMonoValues = put_mono_values_ubyte3; + rb->ComponentSizes[0] = 8 * sizeof(GLubyte); + rb->ComponentSizes[1] = 8 * sizeof(GLubyte); + rb->ComponentSizes[2] = 8 * sizeof(GLubyte); + rb->ComponentSizes[3] = 0; + pixelSize = 3 * sizeof(GLchan); + break; + case GL_RGBA: + case GL_RGBA2: + case GL_RGBA4: + case GL_RGB5_A1: + case GL_RGBA8: + rb->_BaseFormat = GL_RGBA; + rb->DataType = GL_UNSIGNED_BYTE; + rb->GetPointer = get_pointer_ubyte4; + rb->GetRow = get_row_ubyte4; + rb->GetValues = get_values_ubyte4; + rb->PutRow = put_row_ubyte4; + rb->PutRowRGB = put_row_rgb_ubyte4; + rb->PutMonoRow = put_mono_row_ubyte4; + rb->PutValues = put_values_ubyte4; + rb->PutMonoValues = put_mono_values_ubyte4; + rb->ComponentSizes[0] = 8 * sizeof(GLubyte); + rb->ComponentSizes[1] = 8 * sizeof(GLubyte); + rb->ComponentSizes[2] = 8 * sizeof(GLubyte); + rb->ComponentSizes[3] = 8 * sizeof(GLubyte); + pixelSize = 4 * sizeof(GLubyte); + break; + case GL_RGB10_A2: + case GL_RGBA12: + case GL_RGBA16: + rb->_BaseFormat = GL_RGBA; + rb->DataType = GL_UNSIGNED_SHORT; + rb->GetPointer = get_pointer_ushort4; + rb->GetRow = get_row_ushort4; + rb->GetValues = get_values_ushort4; + rb->PutRow = put_row_ushort4; + rb->PutRowRGB = put_row_rgb_ushort4; + rb->PutMonoRow = put_mono_row_ushort4; + rb->PutValues = put_values_ushort4; + rb->PutMonoValues = put_mono_values_ushort4; + rb->ComponentSizes[0] = 8 * sizeof(GLushort); + rb->ComponentSizes[1] = 8 * sizeof(GLushort); + rb->ComponentSizes[2] = 8 * sizeof(GLushort); + rb->ComponentSizes[3] = 8 * sizeof(GLushort); + pixelSize = 4 * sizeof(GLushort); + break; +#if 00 + case ALPHA8: + rb->_BaseFormat = GL_RGBA; /* Yes, not GL_ALPHA! */ + rb->DataType = GL_UNSIGNED_BYTE; + rb->GetPointer = get_pointer_alpha8; + rb->GetRow = get_row_alpha8; + rb->GetValues = get_values_alpha8; + rb->PutRow = put_row_alpha8; + rb->PutRowRGB = NULL; + rb->PutMonoRow = put_mono_row_alpha8; + rb->PutValues = put_values_alpha8; + rb->PutMonoValues = put_mono_values_alpha8; + rb->ComponentSizes[0] = 0; /*red*/ + rb->ComponentSizes[1] = 0; /*green*/ + rb->ComponentSizes[2] = 0; /*blue*/ + rb->ComponentSizes[3] = 8 * sizeof(GLubyte); + pixelSize = sizeof(GLubyte); + break; +#endif + case GL_STENCIL_INDEX: + case GL_STENCIL_INDEX1_EXT: + case GL_STENCIL_INDEX4_EXT: + case GL_STENCIL_INDEX8_EXT: + rb->_BaseFormat = GL_STENCIL_INDEX; + rb->DataType = GL_UNSIGNED_BYTE; + rb->GetPointer = get_pointer_ubyte; + rb->GetRow = get_row_ubyte; + rb->GetValues = get_values_ubyte; + rb->PutRow = put_row_ubyte; + rb->PutRowRGB = NULL; + rb->PutMonoRow = put_mono_row_ubyte; + rb->PutValues = put_values_ubyte; + rb->PutMonoValues = put_mono_values_ubyte; + rb->ComponentSizes[0] = 8 * sizeof(GLubyte); + pixelSize = sizeof(GLubyte); + break; + case GL_STENCIL_INDEX16_EXT: + rb->_BaseFormat = GL_STENCIL_INDEX; + rb->DataType = GL_UNSIGNED_SHORT; + rb->GetPointer = get_pointer_ushort; + rb->GetRow = get_row_ushort; + rb->GetValues = get_values_ushort; + rb->PutRow = put_row_ushort; + rb->PutRowRGB = NULL; + rb->PutMonoRow = put_mono_row_ushort; + rb->PutValues = put_values_ushort; + rb->PutMonoValues = put_mono_values_ushort; + rb->ComponentSizes[0] = 8 * sizeof(GLushort); + pixelSize = sizeof(GLushort); + break; + case GL_DEPTH_COMPONENT: + case GL_DEPTH_COMPONENT16: + rb->_BaseFormat = GL_DEPTH_COMPONENT; + rb->DataType = GL_UNSIGNED_SHORT; + rb->GetPointer = get_pointer_ushort; + rb->GetRow = get_row_ushort; + rb->GetValues = get_values_ushort; + rb->PutRow = put_row_ushort; + rb->PutRowRGB = NULL; + rb->PutMonoRow = put_mono_row_ushort; + rb->PutValues = put_values_ushort; + rb->PutMonoValues = put_mono_values_ushort; + rb->ComponentSizes[0] = 8 * sizeof(GLushort); + pixelSize = sizeof(GLushort); + break; + case GL_DEPTH_COMPONENT24: + case GL_DEPTH_COMPONENT32: + rb->_BaseFormat = GL_DEPTH_COMPONENT; + rb->DataType = GL_UNSIGNED_INT; + rb->GetPointer = get_pointer_uint; + rb->GetRow = get_row_uint; + rb->GetValues = get_values_uint; + rb->PutRow = put_row_uint; + rb->PutRowRGB = NULL; + rb->PutMonoRow = put_mono_row_uint; + rb->PutValues = put_values_uint; + rb->PutMonoValues = put_mono_values_uint; + rb->ComponentSizes[0] = 8 * sizeof(GLuint); + pixelSize = sizeof(GLuint); + break; + case GL_COLOR_INDEX8_EXT: + rb->_BaseFormat = GL_COLOR_INDEX; + rb->DataType = GL_UNSIGNED_BYTE; + rb->GetPointer = get_pointer_ubyte; + rb->GetRow = get_row_ubyte; + rb->GetValues = get_values_ubyte; + rb->PutRow = put_row_ubyte; + rb->PutRowRGB = NULL; + rb->PutMonoRow = put_mono_row_ubyte; + rb->PutValues = put_values_ubyte; + rb->PutMonoValues = put_mono_values_ubyte; + rb->ComponentSizes[0] = 8 * sizeof(GLubyte); + pixelSize = sizeof(GLubyte); + break; + case GL_COLOR_INDEX16_EXT: + rb->_BaseFormat = GL_COLOR_INDEX; + rb->DataType = GL_UNSIGNED_SHORT; + rb->GetPointer = get_pointer_ushort; + rb->GetRow = get_row_ushort; + rb->GetValues = get_values_ushort; + rb->PutRow = put_row_ushort; + rb->PutRowRGB = NULL; + rb->PutMonoRow = put_mono_row_ushort; + rb->PutValues = put_values_ushort; + rb->PutMonoValues = put_mono_values_ushort; + rb->ComponentSizes[0] = 8 * sizeof(GLushort); + pixelSize = sizeof(GLushort); + break; + case COLOR_INDEX32: + rb->_BaseFormat = GL_COLOR_INDEX; + rb->DataType = GL_UNSIGNED_INT; + rb->GetPointer = get_pointer_uint; + rb->GetRow = get_row_uint; + rb->GetValues = get_values_uint; + rb->PutRow = put_row_uint; + rb->PutRowRGB = NULL; + rb->PutMonoRow = put_mono_row_uint; + rb->PutValues = put_values_uint; + rb->PutMonoValues = put_mono_values_uint; + rb->ComponentSizes[0] = 8 * sizeof(GLuint); + pixelSize = sizeof(GLuint); + break; + default: + _mesa_problem(ctx, "Bad internalFormat in soft_renderbuffer_storage"); + return GL_FALSE; + } + + ASSERT(rb->DataType); + ASSERT(rb->GetPointer); + ASSERT(rb->GetRow); + ASSERT(rb->GetValues); + ASSERT(rb->PutRow); + ASSERT(rb->PutMonoRow); + ASSERT(rb->PutValues); + ASSERT(rb->PutMonoValues); + ASSERT(rb->ComponentSizes[0] > 0); + + /* free old buffer storage */ + if (rb->Data) + _mesa_free(rb->Data); + + /* allocate new buffer storage */ + rb->Data = _mesa_malloc(width * height * pixelSize); + if (rb->Data == NULL) { + rb->Width = 0; + rb->Height = 0; + _mesa_error(ctx, GL_OUT_OF_MEMORY, "software renderbuffer allocation"); + return GL_FALSE; + } + + rb->Width = width; + rb->Height = height; + rb->InternalFormat = internalFormat; + + return GL_TRUE; +} + + +/**********************************************************************/ +/**********************************************************************/ +/**********************************************************************/ + + +/** + * The alpha_renderbuffer class is used to augment an RGB renderbuffer with + * an alpha channel. The RGB buffer can be hardware-based. + * We basically wrap the RGB buffer. When PutRow is called (for example), + * we store the alpha values in this buffer, then pass on the PutRow call + * to the wrapped RGB buffer. + */ +struct alpha_renderbuffer +{ + struct gl_renderbuffer Base; /* the alpha buffer */ + struct gl_renderbuffer *RGBbuffer; /* the wrapped RGB buffer */ +}; + + +static GLboolean +alloc_storage_alpha8(GLcontext *ctx, struct gl_renderbuffer *rb, + GLenum internalFormat, GLuint width, GLuint height) +{ + struct alpha_renderbuffer *arb = (struct alpha_renderbuffer *) rb; + + /* first, pass the call to the wrapped RGB buffer */ + if (!arb->RGBbuffer->AllocStorage(ctx, arb->RGBbuffer, internalFormat, + width, height)) { + return GL_FALSE; + } + + /* next, resize my alpha buffer */ + if (arb->Base.Data) { + _mesa_free(arb->Base.Data); + } + + arb->Base.Data = _mesa_malloc(width * height * sizeof(GLubyte)); + if (arb->Base.Data == NULL) { + arb->Base.Width = 0; + arb->Base.Height = 0; + _mesa_error(ctx, GL_OUT_OF_MEMORY, "software alpha buffer allocation"); + return GL_FALSE; + } + + arb->Base.Width = width; + arb->Base.Height = height; + arb->Base.InternalFormat = internalFormat; + + return GL_TRUE; +} + + +/** + * Delete an alpha_renderbuffer object, as well as the wrapped RGB buffer. + */ +static void +delete_renderbuffer_alpha8(struct gl_renderbuffer *rb) +{ + struct alpha_renderbuffer *arb = (struct alpha_renderbuffer *) rb; + if (arb->Base.Data) { + _mesa_free(arb->Base.Data); + } + assert(arb->RGBbuffer); + arb->RGBbuffer->Delete(arb->RGBbuffer); + arb->RGBbuffer = NULL; + _mesa_free(arb); +} + + +static void * +get_pointer_alpha8(GLcontext *ctx, struct gl_renderbuffer *rb, + GLint x, GLint y) +{ + return NULL; /* don't allow direct access! */ +} + + +static void +get_row_alpha8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, void *values) +{ + /* NOTE: 'values' is RGBA format! */ + struct alpha_renderbuffer *arb = (struct alpha_renderbuffer *) rb; + const GLubyte *src = (const GLubyte *) rb->Data + y * rb->Width + x; + GLubyte *dst = (GLubyte *) values; + GLuint i; + ASSERT(rb->DataType == GL_UNSIGNED_BYTE); + /* first, pass the call to the wrapped RGB buffer */ + arb->RGBbuffer->GetRow(ctx, arb->RGBbuffer, count, x, y, values); + /* second, fill in alpha values from this buffer! */ + for (i = 0; i < count; i++) { + dst[i * 4 + 3] = src[i]; + } +} + + +static void +get_values_alpha8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], void *values) +{ + struct alpha_renderbuffer *arb = (struct alpha_renderbuffer *) rb; + GLubyte *dst = (GLubyte *) values; + GLuint i; + assert(rb->DataType == GL_UNSIGNED_BYTE); + /* first, pass the call to the wrapped RGB buffer */ + arb->RGBbuffer->GetValues(ctx, arb->RGBbuffer, count, x, y, values); + /* second, fill in alpha values from this buffer! */ + for (i = 0; i < count; i++) { + const GLubyte *src = (GLubyte *) rb->Data + y[i] * rb->Width + x[i]; + dst[i * 4 + 3] = *src; + } +} + + +static void +put_row_alpha8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask) +{ + struct alpha_renderbuffer *arb = (struct alpha_renderbuffer *) rb; + const GLubyte *src = (const GLubyte *) values; + GLubyte *dst = (GLubyte *) rb->Data + y * rb->Width + x; + GLuint i; + assert(rb->DataType == GL_UNSIGNED_BYTE); + /* first, pass the call to the wrapped RGB buffer */ + arb->RGBbuffer->PutRow(ctx, arb->RGBbuffer, count, x, y, values, mask); + /* second, store alpha in our buffer */ + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst[i] = src[i * 4 + 3]; + } + } +} + + +static void +put_row_rgb_alpha8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask) +{ + struct alpha_renderbuffer *arb = (struct alpha_renderbuffer *) rb; + const GLubyte *src = (const GLubyte *) values; + GLubyte *dst = (GLubyte *) rb->Data + y * rb->Width + x; + GLuint i; + assert(rb->DataType == GL_UNSIGNED_BYTE); + /* first, pass the call to the wrapped RGB buffer */ + arb->RGBbuffer->PutRowRGB(ctx, arb->RGBbuffer, count, x, y, values, mask); + /* second, store alpha in our buffer */ + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst[i] = src[i * 4 + 3]; + } + } +} + + +static void +put_mono_row_alpha8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *value, const GLubyte *mask) +{ + struct alpha_renderbuffer *arb = (struct alpha_renderbuffer *) rb; + const GLubyte val = ((const GLubyte *) value)[3]; + GLubyte *dst = (GLubyte *) rb->Data + y * rb->Width + x; + assert(rb->DataType == GL_UNSIGNED_BYTE); + /* first, pass the call to the wrapped RGB buffer */ + arb->RGBbuffer->PutMonoRow(ctx, arb->RGBbuffer, count, x, y, value, mask); + /* second, store alpha in our buffer */ + if (mask) { + GLuint i; + for (i = 0; i < count; i++) { + if (mask[i]) { + dst[i] = val; + } + } + } + else { + _mesa_memset(dst, val, count); + } +} + + +static void +put_values_alpha8(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], + const void *values, const GLubyte *mask) +{ + struct alpha_renderbuffer *arb = (struct alpha_renderbuffer *) rb; + const GLubyte *src = (const GLubyte *) values; + GLuint i; + assert(rb->DataType == GL_UNSIGNED_BYTE); + /* first, pass the call to the wrapped RGB buffer */ + arb->RGBbuffer->PutValues(ctx, arb->RGBbuffer, count, x, y, values, mask); + /* second, store alpha in our buffer */ + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLubyte *dst = (GLubyte *) rb->Data + y[i] * rb->Width + x[i]; + *dst = src[i * 4 + 3]; + } + } +} + + +static void +put_mono_values_alpha8(GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint count, const GLint x[], const GLint y[], + const void *value, const GLubyte *mask) +{ + struct alpha_renderbuffer *arb = (struct alpha_renderbuffer *) rb; + const GLubyte val = ((const GLubyte *) value)[3]; + GLuint i; + assert(rb->DataType == GL_UNSIGNED_BYTE); + /* first, pass the call to the wrapped RGB buffer */ + arb->RGBbuffer->PutValues(ctx, arb->RGBbuffer, count, x, y, value, mask); + /* second, store alpha in our buffer */ + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLubyte *dst = (GLubyte *) rb->Data + y[i] * rb->Width + x[i]; + *dst = val; + } + } +} + + + +/**********************************************************************/ +/**********************************************************************/ +/**********************************************************************/ + + +/** + * Default GetPointer routine. Always return NULL to indicate that + * direct buffer access is not supported. + */ +static void * +nop_get_pointer(GLcontext *ctx, struct gl_renderbuffer *rb, GLint x, GLint y) +{ + return NULL; +} + + +/** + * Initialize the fields of a gl_renderbuffer to default values. + */ +void +_mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name) +{ + rb->Name = name; + rb->RefCount = 1; + rb->Delete = _mesa_delete_renderbuffer; + + /* The rest of these should be set later by the caller of this function or + * the AllocStorage method: + */ + rb->AllocStorage = NULL; + + rb->Width = 0; + rb->Height = 0; + rb->InternalFormat = GL_NONE; + rb->_BaseFormat = GL_NONE; + rb->DataType = GL_NONE; + rb->ComponentSizes[0] = 0; + rb->ComponentSizes[1] = 0; + rb->ComponentSizes[2] = 0; + rb->ComponentSizes[3] = 0; + rb->Data = NULL; + + rb->GetPointer = nop_get_pointer; + rb->GetRow = NULL; + rb->GetValues = NULL; + rb->PutRow = NULL; + rb->PutRowRGB = NULL; + rb->PutMonoRow = NULL; + rb->PutValues = NULL; + rb->PutMonoValues = NULL; +} + + +/** + * Allocate a new gl_renderbuffer object. This can be used for user-created + * renderbuffers or window-system renderbuffers. + */ +struct gl_renderbuffer * +_mesa_new_renderbuffer(GLcontext *ctx, GLuint name) +{ + struct gl_renderbuffer *rb = CALLOC_STRUCT(gl_renderbuffer); + if (rb) { + _mesa_init_renderbuffer(rb, name); + } + return rb; +} + + +/** + * Delete a gl_framebuffer. + * This is the default function for framebuffer->Delete(). + */ +void +_mesa_delete_renderbuffer(struct gl_renderbuffer *rb) +{ + if (rb->Data) { + _mesa_free(rb->Data); + } + _mesa_free(rb); +} + + +/** + * Allocate a software-based renderbuffer. This is called via the + * ctx->Driver.NewRenderbuffer() function when the user creates a new + * renderbuffer. + */ +struct gl_renderbuffer * +_mesa_new_soft_renderbuffer(GLcontext *ctx, GLuint name) +{ + struct gl_renderbuffer *rb = _mesa_new_renderbuffer(ctx, name); + if (rb) { + rb->AllocStorage = soft_renderbuffer_storage; + /* Normally, one would setup the PutRow, GetRow, etc functions here. + * But we're doing that in the soft_renderbuffer_storage() function + * instead. + */ + } + return rb; +} + + +/** + * Add software-based color renderbuffers to the given framebuffer. + * This is a helper routine for device drivers when creating a + * window system framebuffer (not a user-created render/framebuffer). + * Once this function is called, you can basically forget about this + * renderbuffer; core Mesa will handle all the buffer management and + * rendering! + */ +GLboolean +_mesa_add_color_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, + GLuint rgbBits, GLuint alphaBits, + GLboolean frontLeft, GLboolean backLeft, + GLboolean frontRight, GLboolean backRight) +{ + GLuint b; + + if (rgbBits > 16 || alphaBits > 16) { + _mesa_problem(ctx, + "Unsupported bit depth in _mesa_add_color_renderbuffers"); + return GL_FALSE; + } + + assert(MAX_COLOR_ATTACHMENTS >= 4); + + for (b = BUFFER_FRONT_LEFT; b <= BUFFER_BACK_RIGHT; b++) { + struct gl_renderbuffer *rb; + + if (b == BUFFER_FRONT_LEFT && !frontLeft) + continue; + else if (b == BUFFER_BACK_LEFT && !backLeft) + continue; + else if (b == BUFFER_FRONT_RIGHT && !frontRight) + continue; + else if (b == BUFFER_BACK_RIGHT && !backRight) + continue; + + assert(fb->Attachment[b].Renderbuffer == NULL); + + rb = _mesa_new_renderbuffer(ctx, 0); + if (!rb) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating color buffer"); + return GL_FALSE; + } + + if (rgbBits <= 8) { + if (alphaBits) + rb->InternalFormat = GL_RGBA8; + else + rb->InternalFormat = GL_RGB8; + } + else { + assert(rgbBits <= 16); + if (alphaBits) + rb->InternalFormat = GL_RGBA16; + else + rb->InternalFormat = GL_RGBA16; /* don't really have RGB16 yet */ + } + + rb->AllocStorage = soft_renderbuffer_storage; + _mesa_add_renderbuffer(fb, b, rb); + } + + return GL_TRUE; +} + + +/** + * Add software-based color index renderbuffers to the given framebuffer. + * This is a helper routine for device drivers when creating a + * window system framebuffer (not a user-created render/framebuffer). + * Once this function is called, you can basically forget about this + * renderbuffer; core Mesa will handle all the buffer management and + * rendering! + */ +GLboolean +_mesa_add_color_index_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, + GLuint indexBits, + GLboolean frontLeft, GLboolean backLeft, + GLboolean frontRight, GLboolean backRight) +{ + GLuint b; + + if (indexBits > 8) { + _mesa_problem(ctx, + "Unsupported bit depth in _mesa_add_color_renderbuffers"); + return GL_FALSE; + } + + assert(MAX_COLOR_ATTACHMENTS >= 4); + + for (b = BUFFER_FRONT_LEFT; b <= BUFFER_BACK_RIGHT; b++) { + struct gl_renderbuffer *rb; + + if (b == BUFFER_FRONT_LEFT && !frontLeft) + continue; + else if (b == BUFFER_BACK_LEFT && !backLeft) + continue; + else if (b == BUFFER_FRONT_RIGHT && !frontRight) + continue; + else if (b == BUFFER_BACK_RIGHT && !backRight) + continue; + + assert(fb->Attachment[b].Renderbuffer == NULL); + + rb = _mesa_new_renderbuffer(ctx, 0); + if (!rb) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating color buffer"); + return GL_FALSE; + } + + if (indexBits <= 8) { + /* only support GLuint for now */ + /*rb->InternalFormat = GL_COLOR_INDEX8_EXT;*/ + rb->InternalFormat = COLOR_INDEX32; + } + else { + rb->InternalFormat = COLOR_INDEX32; + } + rb->AllocStorage = soft_renderbuffer_storage; + _mesa_add_renderbuffer(fb, b, rb); + } + + return GL_TRUE; +} + + +/** + * Add software-based alpha renderbuffers to the given framebuffer. + * This is a helper routine for device drivers when creating a + * window system framebuffer (not a user-created render/framebuffer). + * Once this function is called, you can basically forget about this + * renderbuffer; core Mesa will handle all the buffer management and + * rendering! + */ +GLboolean +_mesa_add_alpha_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, + GLuint alphaBits, + GLboolean frontLeft, GLboolean backLeft, + GLboolean frontRight, GLboolean backRight) +{ + GLuint b; + + /* for window system framebuffers only! */ + assert(fb->Name == 0); + + if (alphaBits > 8) { + _mesa_problem(ctx, + "Unsupported bit depth in _mesa_add_alpha_renderbuffers"); + return GL_FALSE; + } + + assert(MAX_COLOR_ATTACHMENTS >= 4); + + for (b = BUFFER_FRONT_LEFT; b <= BUFFER_BACK_RIGHT; b++) { + struct alpha_renderbuffer *arb; + + if (b == BUFFER_FRONT_LEFT && !frontLeft) + continue; + else if (b == BUFFER_BACK_LEFT && !backLeft) + continue; + else if (b == BUFFER_FRONT_RIGHT && !frontRight) + continue; + else if (b == BUFFER_BACK_RIGHT && !backRight) + continue; + + /* the RGB buffer to wrap must already exist!! */ + assert(fb->Attachment[b].Renderbuffer); + + /* only GLubyte supported for now */ + assert(fb->Attachment[b].Renderbuffer->DataType == GL_UNSIGNED_BYTE); + + arb = CALLOC_STRUCT(alpha_renderbuffer); + if (!arb) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating alpha buffer"); + return GL_FALSE; + } + + _mesa_init_renderbuffer(&arb->Base, 0); + + /* wrap the RGB buffer */ + arb->RGBbuffer = fb->Attachment[b].Renderbuffer; + + /* plug in my functions */ + arb->Base.InternalFormat = arb->RGBbuffer->InternalFormat; + arb->Base._BaseFormat = arb->RGBbuffer->_BaseFormat; + arb->Base.DataType = arb->RGBbuffer->DataType; + arb->Base.AllocStorage = alloc_storage_alpha8; + arb->Base.Delete = delete_renderbuffer_alpha8; + arb->Base.GetPointer = get_pointer_alpha8; + arb->Base.GetRow = get_row_alpha8; + arb->Base.GetValues = get_values_alpha8; + arb->Base.PutRow = put_row_alpha8; + arb->Base.PutRowRGB = put_row_rgb_alpha8; + arb->Base.PutMonoRow = put_mono_row_alpha8; + arb->Base.PutValues = put_values_alpha8; + arb->Base.PutMonoValues = put_mono_values_alpha8; + + /* clear the pointer to avoid assertion/sanity check failure later */ + fb->Attachment[b].Renderbuffer = NULL; + + /* plug the alpha renderbuffer into the colorbuffer attachment */ + _mesa_add_renderbuffer(fb, b, &arb->Base); + } + + return GL_TRUE; +} + + +/** + * Add a software-based depth renderbuffer to the given framebuffer. + * This is a helper routine for device drivers when creating a + * window system framebuffer (not a user-created render/framebuffer). + * Once this function is called, you can basically forget about this + * renderbuffer; core Mesa will handle all the buffer management and + * rendering! + */ +GLboolean +_mesa_add_depth_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, + GLuint depthBits) +{ + struct gl_renderbuffer *rb; + + if (depthBits > 32) { + _mesa_problem(ctx, + "Unsupported depthBits in _mesa_add_depth_renderbuffer"); + return GL_FALSE; + } + + assert(fb->Attachment[BUFFER_DEPTH].Renderbuffer == NULL); + + rb = _mesa_new_renderbuffer(ctx, 0); + if (!rb) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating depth buffer"); + return GL_FALSE; + } + + if (depthBits <= 16) { + rb->InternalFormat = GL_DEPTH_COMPONENT16; + } + else { + rb->InternalFormat = GL_DEPTH_COMPONENT32; + } + + rb->AllocStorage = soft_renderbuffer_storage; + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, rb); + + return GL_TRUE; +} + + +/** + * Add a software-based stencil renderbuffer to the given framebuffer. + * This is a helper routine for device drivers when creating a + * window system framebuffer (not a user-created render/framebuffer). + * Once this function is called, you can basically forget about this + * renderbuffer; core Mesa will handle all the buffer management and + * rendering! + */ +GLboolean +_mesa_add_stencil_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, + GLuint stencilBits) +{ + struct gl_renderbuffer *rb; + + if (stencilBits > 16) { + _mesa_problem(ctx, + "Unsupported stencilBits in _mesa_add_stencil_renderbuffer"); + return GL_FALSE; + } + + assert(fb->Attachment[BUFFER_STENCIL].Renderbuffer == NULL); + + rb = _mesa_new_renderbuffer(ctx, 0); + if (!rb) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating stencil buffer"); + return GL_FALSE; + } + + if (stencilBits <= 8) { + rb->InternalFormat = GL_STENCIL_INDEX8_EXT; + } + else { + /* not really supported (see s_stencil.c code) */ + rb->InternalFormat = GL_STENCIL_INDEX16_EXT; + } + + rb->AllocStorage = soft_renderbuffer_storage; + _mesa_add_renderbuffer(fb, BUFFER_STENCIL, rb); + + return GL_TRUE; +} + + +/** + * Add a software-based accumulation renderbuffer to the given framebuffer. + * This is a helper routine for device drivers when creating a + * window system framebuffer (not a user-created render/framebuffer). + * Once this function is called, you can basically forget about this + * renderbuffer; core Mesa will handle all the buffer management and + * rendering! + */ +GLboolean +_mesa_add_accum_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, + GLuint redBits, GLuint greenBits, + GLuint blueBits, GLuint alphaBits) +{ + struct gl_renderbuffer *rb; + + if (redBits > 16 || greenBits > 16 || blueBits > 16 || alphaBits > 16) { + _mesa_problem(ctx, + "Unsupported accumBits in _mesa_add_accum_renderbuffer"); + return GL_FALSE; + } + + assert(fb->Attachment[BUFFER_ACCUM].Renderbuffer == NULL); + + rb = _mesa_new_renderbuffer(ctx, 0); + if (!rb) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating accum buffer"); + return GL_FALSE; + } + + rb->InternalFormat = GL_RGBA16; + rb->AllocStorage = soft_renderbuffer_storage; + _mesa_add_renderbuffer(fb, BUFFER_ACCUM, rb); + + return GL_TRUE; +} + + + +/** + * Add a software-based accumulation renderbuffer to the given framebuffer. + * This is a helper routine for device drivers when creating a + * window system framebuffer (not a user-created render/framebuffer). + * Once this function is called, you can basically forget about this + * renderbuffer; core Mesa will handle all the buffer management and + * rendering! + * + * NOTE: color-index aux buffers not supported. + */ +GLboolean +_mesa_add_aux_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, + GLuint colorBits, GLuint numBuffers) +{ + GLuint i; + + if (colorBits > 16) { + _mesa_problem(ctx, + "Unsupported accumBits in _mesa_add_aux_renderbuffers"); + return GL_FALSE; + } + + assert(numBuffers < MAX_AUX_BUFFERS); + + for (i = 0; i < numBuffers; i++) { + struct gl_renderbuffer *rb = _mesa_new_renderbuffer(ctx, 0); + + assert(fb->Attachment[BUFFER_AUX0 + i].Renderbuffer == NULL); + + if (!rb) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating accum buffer"); + return GL_FALSE; + } + + if (colorBits <= 8) { + rb->InternalFormat = GL_RGBA8; + } + else { + rb->InternalFormat = GL_RGBA16; + } + + rb->AllocStorage = soft_renderbuffer_storage; + _mesa_add_renderbuffer(fb, BUFFER_AUX0 + i, rb); + } + return GL_TRUE; +} + + + +/** + * Attach a renderbuffer to a framebuffer. + */ +void +_mesa_add_renderbuffer(struct gl_framebuffer *fb, + GLuint bufferName, struct gl_renderbuffer *rb) +{ + assert(fb); + assert(rb); + /* there should be no previous renderbuffer on this attachment point! */ + assert(fb->Attachment[bufferName].Renderbuffer == NULL); + assert(bufferName < BUFFER_COUNT); + + /* winsys vs. user-created buffer cross check */ + if (fb->Name) { + assert(rb->Name); + } + else { + assert(!rb->Name); + } + + fb->Attachment[bufferName].Type = GL_RENDERBUFFER_EXT; + fb->Attachment[bufferName].Complete = GL_TRUE; + fb->Attachment[bufferName].Renderbuffer = rb; +} diff --git a/src/mesa/main/renderbuffer.h b/src/mesa/main/renderbuffer.h new file mode 100644 index 00000000000..5c11de7c8a3 --- /dev/null +++ b/src/mesa/main/renderbuffer.h @@ -0,0 +1,84 @@ +/* + * Mesa 3-D graphics library + * Version: 6.3 + * + * Copyright (C) 1999-2005 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. + */ + + +#ifndef RENDERBUFFER_H +#define RENDERBUFFER_H + + +extern void +_mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name); + +extern struct gl_renderbuffer * +_mesa_new_renderbuffer(GLcontext *ctx, GLuint name); + +extern void +_mesa_delete_renderbuffer(struct gl_renderbuffer *rb); + + +extern struct gl_renderbuffer * +_mesa_new_soft_renderbuffer(GLcontext *ctx, GLuint name); + + +extern GLboolean +_mesa_add_color_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, + GLuint rgbBits, GLuint alphaBits, + GLboolean frontLeft, GLboolean backLeft, + GLboolean frontRight, GLboolean backRight); + +extern GLboolean +_mesa_add_color_index_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, + GLuint indexBits, + GLboolean frontLeft, GLboolean backLeft, + GLboolean frontRight, GLboolean backRight); + +extern GLboolean +_mesa_add_alpha_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, + GLuint alphaBits, + GLboolean frontLeft, GLboolean backLeft, + GLboolean frontRight, GLboolean backRight); + +extern GLboolean +_mesa_add_depth_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, + GLuint depthBits); + +extern GLboolean +_mesa_add_stencil_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, + GLuint stencilBits); + + +extern GLboolean +_mesa_add_accum_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, + GLuint redBits, GLuint greenBits, + GLuint blueBits, GLuint alphaBits); + +extern GLboolean +_mesa_add_aux_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, + GLuint bits, GLuint numBuffers); + +extern void +_mesa_add_renderbuffer(struct gl_framebuffer *fb, + GLuint bufferName, struct gl_renderbuffer *rb); + +#endif /* RENDERBUFFER_H */ diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 540d3ce993c..561f5763a20 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -61,6 +61,7 @@ #if FEATURE_EXT_framebuffer_object #include "fbobject.h" #endif +#include "framebuffer.h" #include "hint.h" #include "histogram.h" #include "imports.h" @@ -974,6 +975,9 @@ _mesa_update_state( GLcontext *ctx ) if (new_state & (_NEW_PROGRAM|_NEW_TEXTURE|_NEW_TEXTURE_MATRIX)) _mesa_update_texture( ctx, new_state ); + if (new_state & (_NEW_BUFFERS | _NEW_COLOR | _NEW_PIXEL)) + _mesa_update_framebuffer(ctx); + if (new_state & (_NEW_SCISSOR|_NEW_BUFFERS)) _mesa_update_draw_buffer_bounds( ctx ); diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index a496cf8cbf3..3cbc7c88f8d 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -82,6 +82,13 @@ static void fetch_null_texelf( const struct gl_texture_image *texImage, _mesa_warning(NULL, "fetch_null_texelf() called!"); } +static void store_null_texel(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + /* no-op */ +} + + /***************************************************************/ /** \name Default GLchan-based formats */ @@ -107,6 +114,7 @@ const struct gl_texture_format _mesa_texformat_rgba = { fetch_texel_1d_f_rgba, /* FetchTexel1Df */ fetch_texel_2d_f_rgba, /* FetchTexel2Df */ fetch_texel_3d_f_rgba, /* FetchTexel3Df */ + store_texel_rgba /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb = { @@ -129,6 +137,7 @@ const struct gl_texture_format _mesa_texformat_rgb = { fetch_texel_1d_f_rgb, /* FetchTexel1Df */ fetch_texel_2d_f_rgb, /* FetchTexel2Df */ fetch_texel_3d_f_rgb, /* FetchTexel3Df */ + store_texel_rgb /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_alpha = { @@ -151,6 +160,7 @@ const struct gl_texture_format _mesa_texformat_alpha = { fetch_texel_1d_f_alpha, /* FetchTexel1Df */ fetch_texel_2d_f_alpha, /* FetchTexel2Df */ fetch_texel_3d_f_alpha, /* FetchTexel3Df */ + store_texel_alpha /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance = { @@ -173,6 +183,7 @@ const struct gl_texture_format _mesa_texformat_luminance = { fetch_texel_1d_f_luminance, /* FetchTexel1Df */ fetch_texel_2d_f_luminance, /* FetchTexel2Df */ fetch_texel_3d_f_luminance, /* FetchTexel3Df */ + store_texel_luminance /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance_alpha = { @@ -195,6 +206,7 @@ const struct gl_texture_format _mesa_texformat_luminance_alpha = { fetch_texel_1d_f_luminance_alpha, /* FetchTexel1Df */ fetch_texel_2d_f_luminance_alpha, /* FetchTexel2Df */ fetch_texel_3d_f_luminance_alpha, /* FetchTexel3Df */ + store_texel_luminance_alpha /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_intensity = { @@ -217,6 +229,7 @@ const struct gl_texture_format _mesa_texformat_intensity = { fetch_texel_1d_f_intensity, /* FetchTexel1Df */ fetch_texel_2d_f_intensity, /* FetchTexel2Df */ fetch_texel_3d_f_intensity, /* FetchTexel3Df */ + store_texel_intensity /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_depth_component_float32 = { @@ -239,6 +252,7 @@ const struct gl_texture_format _mesa_texformat_depth_component_float32 = { fetch_texel_1d_f_depth_component_f32,/* FetchTexel1Df */ fetch_texel_2d_f_depth_component_f32,/* FetchTexel2Df */ fetch_texel_3d_f_depth_component_f32,/* FetchTexel3Df */ + store_texel_depth_component_f32 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_depth_component16 = { @@ -261,6 +275,7 @@ const struct gl_texture_format _mesa_texformat_depth_component16 = { fetch_texel_1d_f_depth_component16, /* FetchTexel1Df */ fetch_texel_2d_f_depth_component16, /* FetchTexel2Df */ fetch_texel_3d_f_depth_component16, /* FetchTexel3Df */ + store_texel_depth_component16 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgba_float32 = { @@ -283,6 +298,7 @@ const struct gl_texture_format _mesa_texformat_rgba_float32 = { fetch_texel_1d_f_rgba_f32, /* FetchTexel1Df */ fetch_texel_2d_f_rgba_f32, /* FetchTexel2Df */ fetch_texel_3d_f_rgba_f32, /* FetchTexel3Df */ + store_texel_rgba_f32 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgba_float16 = { @@ -305,6 +321,7 @@ const struct gl_texture_format _mesa_texformat_rgba_float16 = { fetch_texel_1d_f_rgba_f16, /* FetchTexel1Df */ fetch_texel_2d_f_rgba_f16, /* FetchTexel2Df */ fetch_texel_3d_f_rgba_f16, /* FetchTexel3Df */ + store_texel_rgba_f16 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb_float32 = { @@ -327,6 +344,7 @@ const struct gl_texture_format _mesa_texformat_rgb_float32 = { fetch_texel_1d_f_rgb_f32, /* FetchTexel1Df */ fetch_texel_2d_f_rgb_f32, /* FetchTexel2Df */ fetch_texel_3d_f_rgb_f32, /* FetchTexel3Df */ + store_texel_rgb_f32 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb_float16 = { @@ -348,7 +366,8 @@ const struct gl_texture_format _mesa_texformat_rgb_float16 = { fetch_texel_3d_rgb_f16, /* FetchTexel1D */ fetch_texel_1d_f_rgb_f16, /* FetchTexel1Df */ fetch_texel_2d_f_rgb_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb_f16 /* FetchTexel3Df */ + fetch_texel_3d_f_rgb_f16, /* FetchTexel3Df */ + store_texel_rgb_f16 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_alpha_float32 = { @@ -370,7 +389,8 @@ const struct gl_texture_format _mesa_texformat_alpha_float32 = { fetch_texel_3d_alpha_f32, /* FetchTexel1D */ fetch_texel_1d_f_alpha_f32, /* FetchTexel1Df */ fetch_texel_2d_f_alpha_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_alpha_f32 /* FetchTexel3Df */ + fetch_texel_3d_f_alpha_f32, /* FetchTexel3Df */ + store_texel_alpha_f32 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_alpha_float16 = { @@ -392,7 +412,8 @@ const struct gl_texture_format _mesa_texformat_alpha_float16 = { fetch_texel_3d_alpha_f16, /* FetchTexel1D */ fetch_texel_1d_f_alpha_f16, /* FetchTexel1Df */ fetch_texel_2d_f_alpha_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_alpha_f16 /* FetchTexel3Df */ + fetch_texel_3d_f_alpha_f16, /* FetchTexel3Df */ + store_texel_alpha_f16 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance_float32 = { @@ -414,7 +435,8 @@ const struct gl_texture_format _mesa_texformat_luminance_float32 = { fetch_texel_3d_luminance_f32, /* FetchTexel3D */ fetch_texel_1d_f_luminance_f32, /* FetchTexel1Df */ fetch_texel_2d_f_luminance_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_luminance_f32 /* FetchTexel3Df */ + fetch_texel_3d_f_luminance_f32, /* FetchTexel3Df */ + store_texel_luminance_f32 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance_float16 = { @@ -436,7 +458,8 @@ const struct gl_texture_format _mesa_texformat_luminance_float16 = { fetch_texel_3d_luminance_f16, /* FetchTexel3D */ fetch_texel_1d_f_luminance_f16, /* FetchTexel1Df */ fetch_texel_2d_f_luminance_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_luminance_f16 /* FetchTexel3Df */ + fetch_texel_3d_f_luminance_f16, /* FetchTexel3Df */ + store_texel_luminance_f16 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance_alpha_float32 = { @@ -458,7 +481,8 @@ const struct gl_texture_format _mesa_texformat_luminance_alpha_float32 = { fetch_texel_3d_luminance_alpha_f32, /* FetchTexel3D */ fetch_texel_1d_f_luminance_alpha_f32,/* FetchTexel1Df */ fetch_texel_2d_f_luminance_alpha_f32,/* FetchTexel2Df */ - fetch_texel_3d_f_luminance_alpha_f32 /* FetchTexel3Df */ + fetch_texel_3d_f_luminance_alpha_f32,/* FetchTexel3Df */ + store_texel_luminance_alpha_f32 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance_alpha_float16 = { @@ -480,7 +504,8 @@ const struct gl_texture_format _mesa_texformat_luminance_alpha_float16 = { fetch_texel_3d_luminance_alpha_f16, /* FetchTexel3D */ fetch_texel_1d_f_luminance_alpha_f16,/* FetchTexel1Df */ fetch_texel_2d_f_luminance_alpha_f16,/* FetchTexel2Df */ - fetch_texel_3d_f_luminance_alpha_f16 /* FetchTexel3Df */ + fetch_texel_3d_f_luminance_alpha_f16,/* FetchTexel3Df */ + store_texel_luminance_alpha_f16 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_intensity_float32 = { @@ -502,7 +527,8 @@ const struct gl_texture_format _mesa_texformat_intensity_float32 = { fetch_texel_3d_intensity_f32, /* FetchTexel3D */ fetch_texel_1d_f_intensity_f32, /* FetchTexel1Df */ fetch_texel_2d_f_intensity_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_intensity_f32 /* FetchTexel3Df */ + fetch_texel_3d_f_intensity_f32, /* FetchTexel3Df */ + store_texel_intensity_f32 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_intensity_float16 = { @@ -524,7 +550,8 @@ const struct gl_texture_format _mesa_texformat_intensity_float16 = { fetch_texel_3d_intensity_f16, /* FetchTexel3D */ fetch_texel_1d_f_intensity_f16, /* FetchTexel1Df */ fetch_texel_2d_f_intensity_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_intensity_f16 /* FetchTexel3Df */ + fetch_texel_3d_f_intensity_f16, /* FetchTexel3Df */ + store_texel_intensity_f16 /* StoreTexel */ }; @@ -555,6 +582,7 @@ const struct gl_texture_format _mesa_texformat_rgba8888 = { fetch_texel_1d_f_rgba8888, /* FetchTexel1Df */ fetch_texel_2d_f_rgba8888, /* FetchTexel2Df */ fetch_texel_3d_f_rgba8888, /* FetchTexel3Df */ + store_texel_rgba8888 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgba8888_rev = { @@ -577,6 +605,7 @@ const struct gl_texture_format _mesa_texformat_rgba8888_rev = { fetch_texel_1d_f_rgba8888_rev, /* FetchTexel1Df */ fetch_texel_2d_f_rgba8888_rev, /* FetchTexel2Df */ fetch_texel_3d_f_rgba8888_rev, /* FetchTexel3Df */ + store_texel_rgba8888_rev /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb8888 = { @@ -599,6 +628,7 @@ const struct gl_texture_format _mesa_texformat_argb8888 = { fetch_texel_1d_f_argb8888, /* FetchTexel1Df */ fetch_texel_2d_f_argb8888, /* FetchTexel2Df */ fetch_texel_3d_f_argb8888, /* FetchTexel3Df */ + store_texel_argb8888 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb8888_rev = { @@ -621,6 +651,7 @@ const struct gl_texture_format _mesa_texformat_argb8888_rev = { fetch_texel_1d_f_argb8888_rev, /* FetchTexel1Df */ fetch_texel_2d_f_argb8888_rev, /* FetchTexel2Df */ fetch_texel_3d_f_argb8888_rev, /* FetchTexel3Df */ + store_texel_argb8888_rev /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb888 = { @@ -643,6 +674,7 @@ const struct gl_texture_format _mesa_texformat_rgb888 = { fetch_texel_1d_f_rgb888, /* FetchTexel1Df */ fetch_texel_2d_f_rgb888, /* FetchTexel2Df */ fetch_texel_3d_f_rgb888, /* FetchTexel3Df */ + store_texel_rgb888 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_bgr888 = { @@ -665,6 +697,7 @@ const struct gl_texture_format _mesa_texformat_bgr888 = { fetch_texel_1d_f_bgr888, /* FetchTexel1Df */ fetch_texel_2d_f_bgr888, /* FetchTexel2Df */ fetch_texel_3d_f_bgr888, /* FetchTexel3Df */ + store_texel_bgr888 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb565 = { @@ -687,6 +720,7 @@ const struct gl_texture_format _mesa_texformat_rgb565 = { fetch_texel_1d_f_rgb565, /* FetchTexel1Df */ fetch_texel_2d_f_rgb565, /* FetchTexel2Df */ fetch_texel_3d_f_rgb565, /* FetchTexel3Df */ + store_texel_rgb565 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb565_rev = { @@ -709,6 +743,7 @@ const struct gl_texture_format _mesa_texformat_rgb565_rev = { fetch_texel_1d_f_rgb565_rev, /* FetchTexel1Df */ fetch_texel_2d_f_rgb565_rev, /* FetchTexel2Df */ fetch_texel_3d_f_rgb565_rev, /* FetchTexel3Df */ + store_texel_rgb565_rev /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb4444 = { @@ -731,6 +766,7 @@ const struct gl_texture_format _mesa_texformat_argb4444 = { fetch_texel_1d_f_argb4444, /* FetchTexel1Df */ fetch_texel_2d_f_argb4444, /* FetchTexel2Df */ fetch_texel_3d_f_argb4444, /* FetchTexel3Df */ + store_texel_argb4444 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb4444_rev = { @@ -753,6 +789,7 @@ const struct gl_texture_format _mesa_texformat_argb4444_rev = { fetch_texel_1d_f_argb4444_rev, /* FetchTexel1Df */ fetch_texel_2d_f_argb4444_rev, /* FetchTexel2Df */ fetch_texel_3d_f_argb4444_rev, /* FetchTexel3Df */ + store_texel_argb4444_rev /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb1555 = { @@ -775,6 +812,7 @@ const struct gl_texture_format _mesa_texformat_argb1555 = { fetch_texel_1d_f_argb1555, /* FetchTexel1Df */ fetch_texel_2d_f_argb1555, /* FetchTexel2Df */ fetch_texel_3d_f_argb1555, /* FetchTexel3Df */ + store_texel_argb1555 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb1555_rev = { @@ -797,6 +835,7 @@ const struct gl_texture_format _mesa_texformat_argb1555_rev = { fetch_texel_1d_f_argb1555_rev, /* FetchTexel1Df */ fetch_texel_2d_f_argb1555_rev, /* FetchTexel2Df */ fetch_texel_3d_f_argb1555_rev, /* FetchTexel3Df */ + store_texel_argb1555_rev /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_al88 = { @@ -819,6 +858,7 @@ const struct gl_texture_format _mesa_texformat_al88 = { fetch_texel_1d_f_al88, /* FetchTexel1Df */ fetch_texel_2d_f_al88, /* FetchTexel2Df */ fetch_texel_3d_f_al88, /* FetchTexel3Df */ + store_texel_al88 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_al88_rev = { @@ -841,6 +881,7 @@ const struct gl_texture_format _mesa_texformat_al88_rev = { fetch_texel_1d_f_al88_rev, /* FetchTexel1Df */ fetch_texel_2d_f_al88_rev, /* FetchTexel2Df */ fetch_texel_3d_f_al88_rev, /* FetchTexel3Df */ + store_texel_al88_rev /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb332 = { @@ -863,6 +904,7 @@ const struct gl_texture_format _mesa_texformat_rgb332 = { fetch_texel_1d_f_rgb332, /* FetchTexel1Df */ fetch_texel_2d_f_rgb332, /* FetchTexel2Df */ fetch_texel_3d_f_rgb332, /* FetchTexel3Df */ + store_texel_rgb332 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_a8 = { @@ -885,6 +927,7 @@ const struct gl_texture_format _mesa_texformat_a8 = { fetch_texel_1d_f_a8, /* FetchTexel1Df */ fetch_texel_2d_f_a8, /* FetchTexel2Df */ fetch_texel_3d_f_a8, /* FetchTexel3Df */ + store_texel_a8 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_l8 = { @@ -907,6 +950,7 @@ const struct gl_texture_format _mesa_texformat_l8 = { fetch_texel_1d_f_l8, /* FetchTexel1Df */ fetch_texel_2d_f_l8, /* FetchTexel2Df */ fetch_texel_3d_f_l8, /* FetchTexel3Df */ + store_texel_l8 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_i8 = { @@ -929,6 +973,7 @@ const struct gl_texture_format _mesa_texformat_i8 = { fetch_texel_1d_f_i8, /* FetchTexel1Df */ fetch_texel_2d_f_i8, /* FetchTexel2Df */ fetch_texel_3d_f_i8, /* FetchTexel3Df */ + store_texel_i8 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_ci8 = { @@ -951,6 +996,7 @@ const struct gl_texture_format _mesa_texformat_ci8 = { fetch_texel_1d_f_ci8, /* FetchTexel1Df */ fetch_texel_2d_f_ci8, /* FetchTexel2Df */ fetch_texel_3d_f_ci8, /* FetchTexel3Df */ + store_texel_ci8 /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_ycbcr = { @@ -973,6 +1019,7 @@ const struct gl_texture_format _mesa_texformat_ycbcr = { fetch_texel_1d_f_ycbcr, /* FetchTexel1Df */ fetch_texel_2d_f_ycbcr, /* FetchTexel2Df */ fetch_texel_3d_f_ycbcr, /* FetchTexel3Df */ + store_texel_ycbcr /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_ycbcr_rev = { @@ -995,6 +1042,7 @@ const struct gl_texture_format _mesa_texformat_ycbcr_rev = { fetch_texel_1d_f_ycbcr_rev, /* FetchTexel1Df */ fetch_texel_2d_f_ycbcr_rev, /* FetchTexel2Df */ fetch_texel_3d_f_ycbcr_rev, /* FetchTexel3Df */ + store_texel_ycbcr_rev /* StoreTexel */ }; /*@}*/ @@ -1024,6 +1072,7 @@ const struct gl_texture_format _mesa_null_texformat = { fetch_null_texelf, /* FetchTexel1Df */ fetch_null_texelf, /* FetchTexel2Df */ fetch_null_texelf, /* FetchTexel3Df */ + store_null_texel /* StoreTexel */ }; /*@}*/ diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index 3df72291a11..73519298265 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -43,22 +43,22 @@ #if DIM == 1 -#define CHAN_SRC( t, i, j, k, sz ) \ +#define CHAN_ADDR( t, i, j, k, sz ) \ ((void) (j), (void) (k), \ ((GLchan *)(t)->Data + (i) * (sz))) -#define UBYTE_SRC( t, i, j, k, sz ) \ +#define UBYTE_ADDR( t, i, j, k, sz ) \ ((void) (j), (void) (k), \ ((GLubyte *)(t)->Data + (i) * (sz))) -#define USHORT_SRC( t, i, j, k ) \ +#define USHORT_ADDR( t, i, j, k ) \ ((void) (j), (void) (k), \ ((GLushort *)(t)->Data + (i))) -#define UINT_SRC( t, i, j, k ) \ +#define UINT_ADDR( t, i, j, k ) \ ((void) (j), (void) (k), \ ((GLuint *)(t)->Data + (i))) -#define FLOAT_SRC( t, i, j, k, sz ) \ +#define FLOAT_ADDR( t, i, j, k, sz ) \ ((void) (j), (void) (k), \ ((GLfloat *)(t)->Data + (i) * (sz))) -#define HALF_SRC( t, i, j, k, sz ) \ +#define HALF_ADDR( t, i, j, k, sz ) \ ((void) (j), (void) (k), \ ((GLhalfARB *)(t)->Data + (i) * (sz))) @@ -66,22 +66,22 @@ #elif DIM == 2 -#define CHAN_SRC( t, i, j, k, sz ) \ +#define CHAN_ADDR( t, i, j, k, sz ) \ ((void) (k), \ ((GLchan *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))) -#define UBYTE_SRC( t, i, j, k, sz ) \ +#define UBYTE_ADDR( t, i, j, k, sz ) \ ((void) (k), \ ((GLubyte *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))) -#define USHORT_SRC( t, i, j, k ) \ +#define USHORT_ADDR( t, i, j, k ) \ ((void) (k), \ ((GLushort *)(t)->Data + ((t)->RowStride * (j) + (i)))) -#define UINT_SRC( t, i, j, k ) \ +#define UINT_ADDR( t, i, j, k ) \ ((void) (k), \ ((GLuint *)(t)->Data + ((t)->RowStride * (j) + (i)))) -#define FLOAT_SRC( t, i, j, k, sz ) \ +#define FLOAT_ADDR( t, i, j, k, sz ) \ ((void) (k), \ ((GLfloat *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))) -#define HALF_SRC( t, i, j, k, sz ) \ +#define HALF_ADDR( t, i, j, k, sz ) \ ((void) (k), \ ((GLhalfARB *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))) @@ -89,22 +89,22 @@ #elif DIM == 3 -#define CHAN_SRC( t, i, j, k, sz ) \ +#define CHAN_ADDR( t, i, j, k, sz ) \ (GLchan *)(t)->Data + (((t)->Height * (k) + (j)) * \ (t)->RowStride + (i)) * (sz) -#define UBYTE_SRC( t, i, j, k, sz ) \ +#define UBYTE_ADDR( t, i, j, k, sz ) \ ((GLubyte *)(t)->Data + (((t)->Height * (k) + (j)) * \ (t)->RowStride + (i)) * (sz)) -#define USHORT_SRC( t, i, j, k ) \ +#define USHORT_ADDR( t, i, j, k ) \ ((GLushort *)(t)->Data + (((t)->Height * (k) + (j)) * \ (t)->RowStride + (i))) -#define UINT_SRC( t, i, j, k ) \ +#define UINT_ADDR( t, i, j, k ) \ ((GLuint *)(t)->Data + (((t)->Height * (k) + (j)) * \ (t)->RowStride + (i))) -#define FLOAT_SRC( t, i, j, k, sz ) \ +#define FLOAT_ADDR( t, i, j, k, sz ) \ ((GLfloat *)(t)->Data + (((t)->Height * (k) + (j)) * \ (t)->RowStride + (i)) * (sz)) -#define HALF_SRC( t, i, j, k, sz ) \ +#define HALF_ADDR( t, i, j, k, sz ) \ ((GLhalfARB *)(t)->Data + (((t)->Height * (k) + (j)) * \ (t)->RowStride + (i)) * (sz)) @@ -115,11 +115,13 @@ #endif +/* MESA_FORMAT_RGBA **********************************************************/ + /* Fetch texel from 1D, 2D or 3D RGBA texture, returning 4 GLchans */ static void FETCH(rgba)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); + const GLchan *src = CHAN_ADDR( texImage, i, j, k, 4 ); COPY_CHAN4( texel, src ); } @@ -127,19 +129,34 @@ static void FETCH(rgba)( const struct gl_texture_image *texImage, static void FETCH(f_rgba)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLchan *src = CHAN_SRC( texImage, i, j, k, 4 ); + const GLchan *src = CHAN_ADDR( texImage, i, j, k, 4 ); texel[RCOMP] = CHAN_TO_FLOAT(src[0]); texel[GCOMP] = CHAN_TO_FLOAT(src[1]); texel[BCOMP] = CHAN_TO_FLOAT(src[2]); texel[ACOMP] = CHAN_TO_FLOAT(src[3]); } +#if DIM == 3 +/* Store a GLchan RGBA texel */ +static void store_texel_rgba(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLchan *rgba = (const GLchan *) texel; + GLchan *dst = CHAN_ADDR(texImage, i, j, k, 4); + dst[0] = rgba[RCOMP]; + dst[1] = rgba[GCOMP]; + dst[2] = rgba[BCOMP]; + dst[3] = rgba[ACOMP]; +} +#endif + +/* MESA_FORMAT_RGB ***********************************************************/ /* Fetch texel from 1D, 2D or 3D RGB texture, returning 4 GLchans */ static void FETCH(rgb)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLchan *src = CHAN_SRC( texImage, i, j, k, 3 ); + const GLchan *src = CHAN_ADDR( texImage, i, j, k, 3 ); texel[RCOMP] = src[0]; texel[GCOMP] = src[1]; texel[BCOMP] = src[2]; @@ -150,18 +167,32 @@ static void FETCH(rgb)( const struct gl_texture_image *texImage, static void FETCH(f_rgb)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLchan *src = CHAN_SRC( texImage, i, j, k, 3 ); + const GLchan *src = CHAN_ADDR( texImage, i, j, k, 3 ); texel[RCOMP] = CHAN_TO_FLOAT(src[0]); texel[GCOMP] = CHAN_TO_FLOAT(src[1]); texel[BCOMP] = CHAN_TO_FLOAT(src[2]); texel[ACOMP] = 1.0F; } +#if DIM == 3 +static void store_texel_rgb(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLchan *rgba = (const GLchan *) texel; + GLchan *dst = CHAN_ADDR(texImage, i, j, k, 3); + dst[0] = rgba[RCOMP]; + dst[1] = rgba[GCOMP]; + dst[2] = rgba[BCOMP]; +} +#endif + +/* MESA_FORMAT_ALPHA *********************************************************/ + /* Fetch texel from 1D, 2D or 3D ALPHA texture, returning 4 GLchans */ static void FETCH(alpha)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLchan *src = CHAN_SRC( texImage, i, j, k, 1 ); + const GLchan *src = CHAN_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = 0; @@ -172,18 +203,30 @@ static void FETCH(alpha)( const struct gl_texture_image *texImage, static void FETCH(f_alpha)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLchan *src = CHAN_SRC( texImage, i, j, k, 1 ); + const GLchan *src = CHAN_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = 0.0; texel[ACOMP] = CHAN_TO_FLOAT(src[0]); } +#if DIM == 3 +static void store_texel_alpha(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLchan *rgba = (const GLchan *) texel; + GLchan *dst = CHAN_ADDR(texImage, i, j, k, 1); + dst[0] = rgba[ACOMP]; +} +#endif + +/* MESA_FORMAT_LUMINANCE *****************************************************/ + /* Fetch texel from 1D, 2D or 3D LUMIN texture, returning 4 GLchans */ static void FETCH(luminance)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLchan *src = CHAN_SRC( texImage, i, j, k, 1 ); + const GLchan *src = CHAN_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = src[0]; @@ -194,18 +237,30 @@ static void FETCH(luminance)( const struct gl_texture_image *texImage, static void FETCH(f_luminance)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLchan *src = CHAN_SRC( texImage, i, j, k, 1 ); + const GLchan *src = CHAN_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = CHAN_TO_FLOAT(src[0]); texel[ACOMP] = 1.0F; } +#if DIM == 3 +static void store_texel_luminance(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLchan *rgba = (const GLchan *) texel; + GLchan *dst = CHAN_ADDR(texImage, i, j, k, 1); + dst[0] = rgba[RCOMP]; +} +#endif + +/* MESA_FORMAT_LUMINANCE_ALPHA ***********************************************/ + /* Fetch texel from 1D, 2D or 3D L_A texture, returning 4 GLchans */ static void FETCH(luminance_alpha)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLchan *src = CHAN_SRC( texImage, i, j, k, 2 ); + const GLchan *src = CHAN_ADDR( texImage, i, j, k, 2 ); texel[RCOMP] = src[0]; texel[GCOMP] = src[0]; texel[BCOMP] = src[0]; @@ -216,19 +271,31 @@ static void FETCH(luminance_alpha)( const struct gl_texture_image *texImage, static void FETCH(f_luminance_alpha)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLchan *src = CHAN_SRC( texImage, i, j, k, 2 ); + const GLchan *src = CHAN_ADDR( texImage, i, j, k, 2 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = CHAN_TO_FLOAT(src[0]); texel[ACOMP] = CHAN_TO_FLOAT(src[1]); } +#if DIM == 3 +static void store_texel_luminance_alpha(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLchan *rgba = (const GLchan *) texel; + GLchan *dst = CHAN_ADDR(texImage, i, j, k, 2); + dst[0] = rgba[RCOMP]; + dst[1] = rgba[ACOMP]; +} +#endif + +/* MESA_FORMAT_INTENSITY *****************************************************/ /* Fetch texel from 1D, 2D or 3D INT. texture, returning 4 GLchans */ static void FETCH(intensity)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLchan *src = CHAN_SRC( texImage, i, j, k, 1 ); + const GLchan *src = CHAN_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = src[0]; texel[GCOMP] = src[0]; texel[BCOMP] = src[0]; @@ -239,13 +306,25 @@ static void FETCH(intensity)( const struct gl_texture_image *texImage, static void FETCH(f_intensity)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLchan *src = CHAN_SRC( texImage, i, j, k, 1 ); + const GLchan *src = CHAN_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = texel[ACOMP] = CHAN_TO_FLOAT(src[0]); } +#if DIM == 3 +static void store_texel_intensity(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLchan *rgba = (const GLchan *) texel; + GLchan *dst = CHAN_ADDR(texImage, i, j, k, 1); + dst[0] = rgba[RCOMP]; +} +#endif + + +/* MESA_FORMAT_DEPTH_COMPONENT_F32 *******************************************/ /* Fetch depth texel from 1D, 2D or 3D float32 DEPTH texture, * returning 1 GLfloat. @@ -254,56 +333,94 @@ static void FETCH(f_intensity)( const struct gl_texture_image *texImage, static void FETCH(f_depth_component_f32)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLfloat *src = FLOAT_SRC( texImage, i, j, k, 1 ); + const GLfloat *src = FLOAT_ADDR( texImage, i, j, k, 1 ); texel[0] = src[0]; } +#if DIM == 3 +static void store_texel_depth_component_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *depth = (const GLfloat *) texel; + GLfloat *dst = FLOAT_ADDR(texImage, i, j, k, 1); + dst[0] = *depth; +} +#endif + + +/* MESA_FORMAT_DEPTH_COMPONENT16 *********************************************/ /* Fetch depth texel from 1D, 2D or 3D float32 DEPTH texture, * returning 1 GLfloat. * Note: no GLchan version of this function. */ -static void FETCH(f_depth_component16)( const struct gl_texture_image *texImage, +static void FETCH(f_depth_component16)(const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLushort *src = USHORT_SRC( texImage, i, j, k ); + const GLushort *src = USHORT_ADDR( texImage, i, j, k ); texel[0] = src[0] * (1.0F / 65535.0F); } +#if DIM == 3 +static void store_texel_depth_component16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLushort *depth = (const GLushort *) texel; + GLushort *dst = USHORT_ADDR(texImage, i, j, k); + dst[0] = *depth; +} +#endif + -/* Fetch texel from 1D, 2D or 3D RGBA_FLOAT32 texture, - * returning 4 GLchans. +/* MESA_FORMAT_RGBA_F32 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D RGBA_FLOAT32 texture, returning 4 GLchans. */ static void FETCH(rgba_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) + GLint i, GLint j, GLint k, GLchan *texel ) { - const GLfloat *src = FLOAT_SRC( texImage, i, j, k, 4 ); + const GLfloat *src = FLOAT_ADDR( texImage, i, j, k, 4 ); UNCLAMPED_FLOAT_TO_CHAN(texel[RCOMP], src[0]); UNCLAMPED_FLOAT_TO_CHAN(texel[GCOMP], src[1]); UNCLAMPED_FLOAT_TO_CHAN(texel[BCOMP], src[2]); UNCLAMPED_FLOAT_TO_CHAN(texel[ACOMP], src[3]); } -/* Fetch texel from 1D, 2D or 3D RGBA_FLOAT32 texture, - * returning 4 GLfloats. +/* Fetch texel from 1D, 2D or 3D RGBA_FLOAT32 texture, returning 4 GLfloats. */ static void FETCH(f_rgba_f32)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLfloat *src = FLOAT_SRC( texImage, i, j, k, 4 ); + const GLfloat *src = FLOAT_ADDR( texImage, i, j, k, 4 ); texel[RCOMP] = src[0]; texel[GCOMP] = src[1]; texel[BCOMP] = src[2]; texel[ACOMP] = src[3]; } +#if DIM == 3 +static void store_texel_rgba_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *depth = (const GLfloat *) texel; + GLfloat *dst = FLOAT_ADDR(texImage, i, j, k, 1); + dst[0] = depth[RCOMP]; + dst[1] = depth[GCOMP]; + dst[2] = depth[BCOMP]; + dst[3] = depth[ACOMP]; +} +#endif + + +/* MESA_FORMAT_RGBA_F16 ******************************************************/ + /* Fetch texel from 1D, 2D or 3D RGBA_FLOAT16 texture, * returning 4 GLchans. */ static void FETCH(rgba_f16)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLhalfARB *src = HALF_SRC( texImage, i, j, k, 4 ); + const GLhalfARB *src = HALF_ADDR( texImage, i, j, k, 4 ); UNCLAMPED_FLOAT_TO_CHAN(texel[RCOMP], _mesa_half_to_float(src[0])); UNCLAMPED_FLOAT_TO_CHAN(texel[GCOMP], _mesa_half_to_float(src[1])); UNCLAMPED_FLOAT_TO_CHAN(texel[BCOMP], _mesa_half_to_float(src[2])); @@ -316,20 +433,32 @@ static void FETCH(rgba_f16)( const struct gl_texture_image *texImage, static void FETCH(f_rgba_f16)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLhalfARB *src = HALF_SRC( texImage, i, j, k, 4 ); + const GLhalfARB *src = HALF_ADDR( texImage, i, j, k, 4 ); texel[RCOMP] = _mesa_half_to_float(src[0]); texel[GCOMP] = _mesa_half_to_float(src[1]); texel[BCOMP] = _mesa_half_to_float(src[2]); texel[ACOMP] = _mesa_half_to_float(src[3]); } +#if DIM == 3 +static void store_texel_rgba_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *depth = (const GLfloat *) texel; + GLhalfARB *dst = HALF_ADDR(texImage, i, j, k, 1); + dst[0] = _mesa_float_to_half(*depth); +} +#endif + +/* MESA_FORMAT_RGB_F32 *******************************************************/ + /* Fetch texel from 1D, 2D or 3D RGB_FLOAT32 texture, * returning 4 GLchans. */ static void FETCH(rgb_f32)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLfloat *src = FLOAT_SRC( texImage, i, j, k, 3 ); + const GLfloat *src = FLOAT_ADDR( texImage, i, j, k, 3 ); UNCLAMPED_FLOAT_TO_CHAN(texel[RCOMP], src[0]); UNCLAMPED_FLOAT_TO_CHAN(texel[GCOMP], src[1]); UNCLAMPED_FLOAT_TO_CHAN(texel[BCOMP], src[2]); @@ -342,20 +471,33 @@ static void FETCH(rgb_f32)( const struct gl_texture_image *texImage, static void FETCH(f_rgb_f32)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLfloat *src = FLOAT_SRC( texImage, i, j, k, 3 ); + const GLfloat *src = FLOAT_ADDR( texImage, i, j, k, 3 ); texel[RCOMP] = src[0]; texel[GCOMP] = src[1]; texel[BCOMP] = src[2]; texel[ACOMP] = 1.0F; } +#if DIM == 3 +static void store_texel_rgb_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *depth = (const GLfloat *) texel; + GLfloat *dst = FLOAT_ADDR(texImage, i, j, k, 1); + dst[0] = *depth; +} +#endif + + +/* MESA_FORAMT_RGB_F16 *******************************************************/ + /* Fetch texel from 1D, 2D or 3D RGBA_FLOAT16 texture, * returning 4 GLchans. */ static void FETCH(rgb_f16)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLhalfARB *src = HALF_SRC( texImage, i, j, k, 3 ); + const GLhalfARB *src = HALF_ADDR( texImage, i, j, k, 3 ); UNCLAMPED_FLOAT_TO_CHAN(texel[RCOMP], _mesa_half_to_float(src[0])); UNCLAMPED_FLOAT_TO_CHAN(texel[GCOMP], _mesa_half_to_float(src[1])); UNCLAMPED_FLOAT_TO_CHAN(texel[BCOMP], _mesa_half_to_float(src[2])); @@ -368,20 +510,33 @@ static void FETCH(rgb_f16)( const struct gl_texture_image *texImage, static void FETCH(f_rgb_f16)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLhalfARB *src = HALF_SRC( texImage, i, j, k, 3 ); + const GLhalfARB *src = HALF_ADDR( texImage, i, j, k, 3 ); texel[RCOMP] = _mesa_half_to_float(src[0]); texel[GCOMP] = _mesa_half_to_float(src[1]); texel[BCOMP] = _mesa_half_to_float(src[2]); texel[ACOMP] = 1.0F; } +#if DIM == 3 +static void store_texel_rgb_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *depth = (const GLfloat *) texel; + GLhalfARB *dst = HALF_ADDR(texImage, i, j, k, 1); + dst[0] = _mesa_float_to_half(*depth); +} +#endif + + +/* MESA_FORMAT_ALPHA_F32 *****************************************************/ + /* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT32 texture, * returning 4 GLchans. */ static void FETCH(alpha_f32)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLfloat *src = FLOAT_SRC( texImage, i, j, k, 1 ); + const GLfloat *src = FLOAT_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = 0; @@ -394,20 +549,33 @@ static void FETCH(alpha_f32)( const struct gl_texture_image *texImage, static void FETCH(f_alpha_f32)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLfloat *src = FLOAT_SRC( texImage, i, j, k, 1 ); + const GLfloat *src = FLOAT_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = 0.0F; texel[ACOMP] = src[0]; } +#if DIM == 3 +static void store_texel_alpha_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLfloat *dst = FLOAT_ADDR(texImage, i, j, k, 1); + dst[0] = rgba[ACOMP]; +} +#endif + + +/* MESA_FORMAT_ALPHA_F32 *****************************************************/ + /* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT16 texture, * returning 4 GLchans. */ static void FETCH(alpha_f16)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLhalfARB *src = HALF_SRC( texImage, i, j, k, 1 ); + const GLhalfARB *src = HALF_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = 0; @@ -420,20 +588,33 @@ static void FETCH(alpha_f16)( const struct gl_texture_image *texImage, static void FETCH(f_alpha_f16)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLhalfARB *src = HALF_SRC( texImage, i, j, k, 1 ); + const GLhalfARB *src = HALF_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = 0.0F; texel[ACOMP] = _mesa_half_to_float(src[0]); } +#if DIM == 3 +static void store_texel_alpha_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLhalfARB *dst = HALF_ADDR(texImage, i, j, k, 1); + dst[0] = _mesa_float_to_half(rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_LUMINANCE_F32 *************************************************/ + /* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT32 texture, * returning 4 GLchans. */ static void FETCH(luminance_f32)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLfloat *src = FLOAT_SRC( texImage, i, j, k, 1 ); + const GLfloat *src = FLOAT_ADDR( texImage, i, j, k, 1 ); UNCLAMPED_FLOAT_TO_CHAN(texel[RCOMP], src[0]); texel[GCOMP] = texel[BCOMP] = texel[RCOMP]; @@ -446,20 +627,33 @@ static void FETCH(luminance_f32)( const struct gl_texture_image *texImage, static void FETCH(f_luminance_f32)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLfloat *src = FLOAT_SRC( texImage, i, j, k, 1 ); + const GLfloat *src = FLOAT_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = src[0]; texel[ACOMP] = 1.0F; } +#if DIM == 3 +static void store_texel_luminance_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLfloat *dst = FLOAT_ADDR(texImage, i, j, k, 1); + dst[0] = rgba[RCOMP]; +} +#endif + + +/* MESA_FORMAT_LUMINANCE_F16 *************************************************/ + /* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT16 texture, * returning 4 GLchans. */ static void FETCH(luminance_f16)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLhalfARB *src = HALF_SRC( texImage, i, j, k, 1 ); + const GLhalfARB *src = HALF_ADDR( texImage, i, j, k, 1 ); UNCLAMPED_FLOAT_TO_CHAN(texel[RCOMP], _mesa_half_to_float(src[0])); texel[GCOMP] = texel[BCOMP] = texel[RCOMP]; @@ -472,20 +666,33 @@ static void FETCH(luminance_f16)( const struct gl_texture_image *texImage, static void FETCH(f_luminance_f16)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLhalfARB *src = HALF_SRC( texImage, i, j, k, 1 ); + const GLhalfARB *src = HALF_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = _mesa_half_to_float(src[0]); texel[ACOMP] = 1.0F; } +#if DIM == 3 +static void store_texel_luminance_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLhalfARB *dst = HALF_ADDR(texImage, i, j, k, 1); + dst[0] = _mesa_float_to_half(rgba[RCOMP]); +} +#endif + + +/* MESA_FORMAT_LUMINANCE_ALPHA_F32 *******************************************/ + /* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT32 texture, * returning 4 GLchans. */ static void FETCH(luminance_alpha_f32)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLfloat *src = FLOAT_SRC( texImage, i, j, k, 2 ); + const GLfloat *src = FLOAT_ADDR( texImage, i, j, k, 2 ); UNCLAMPED_FLOAT_TO_CHAN(texel[RCOMP], src[0]); texel[GCOMP] = texel[BCOMP] = texel[RCOMP]; @@ -498,20 +705,34 @@ static void FETCH(luminance_alpha_f32)( const struct gl_texture_image *texImage, static void FETCH(f_luminance_alpha_f32)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLfloat *src = FLOAT_SRC( texImage, i, j, k, 2 ); + const GLfloat *src = FLOAT_ADDR( texImage, i, j, k, 2 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = src[0]; texel[ACOMP] = src[1]; } +#if DIM == 3 +static void store_texel_luminance_alpha_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLfloat *dst = FLOAT_ADDR(texImage, i, j, k, 2); + dst[0] = rgba[RCOMP]; + dst[1] = rgba[ACOMP]; +} +#endif + + +/* MESA_FORMAT_LUMINANCE_ALPHA_F16 *******************************************/ + /* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT16 texture, * returning 4 GLfloats. */ static void FETCH(luminance_alpha_f16)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLhalfARB *src = HALF_SRC( texImage, i, j, k, 2 ); + const GLhalfARB *src = HALF_ADDR( texImage, i, j, k, 2 ); UNCLAMPED_FLOAT_TO_CHAN(texel[RCOMP], _mesa_half_to_float(src[0])); texel[GCOMP] = texel[BCOMP] = texel[RCOMP]; @@ -524,20 +745,34 @@ static void FETCH(luminance_alpha_f16)( const struct gl_texture_image *texImage, static void FETCH(f_luminance_alpha_f16)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLhalfARB *src = HALF_SRC( texImage, i, j, k, 2 ); + const GLhalfARB *src = HALF_ADDR( texImage, i, j, k, 2 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = _mesa_half_to_float(src[0]); texel[ACOMP] = _mesa_half_to_float(src[1]); } +#if DIM == 3 +static void store_texel_luminance_alpha_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLhalfARB *dst = HALF_ADDR(texImage, i, j, k, 2); + dst[0] = _mesa_float_to_half(rgba[RCOMP]); + dst[1] = _mesa_float_to_half(rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_INTENSITY_F32 *************************************************/ + /* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT32 texture, * returning 4 GLchans. */ static void FETCH(intensity_f32)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLfloat *src = FLOAT_SRC( texImage, i, j, k, 1 ); + const GLfloat *src = FLOAT_ADDR( texImage, i, j, k, 1 ); UNCLAMPED_FLOAT_TO_CHAN(texel[RCOMP], src[0]); texel[GCOMP] = texel[BCOMP] = @@ -550,20 +785,33 @@ static void FETCH(intensity_f32)( const struct gl_texture_image *texImage, static void FETCH(f_intensity_f32)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLfloat *src = FLOAT_SRC( texImage, i, j, k, 1 ); + const GLfloat *src = FLOAT_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = texel[ACOMP] = src[0]; } +#if DIM == 3 +static void store_texel_intensity_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLfloat *dst = FLOAT_ADDR(texImage, i, j, k, 1); + dst[0] = rgba[RCOMP]; +} +#endif + + +/* MESA_FORMAT_INTENSITY_F16 *************************************************/ + /* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT16 texture, * returning 4 GLchans. */ static void FETCH(intensity_f16)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLhalfARB *src = HALF_SRC( texImage, i, j, k, 1 ); + const GLhalfARB *src = HALF_ADDR( texImage, i, j, k, 1 ); UNCLAMPED_FLOAT_TO_CHAN(texel[RCOMP], _mesa_half_to_float(src[0])); texel[GCOMP] = texel[BCOMP] = @@ -576,24 +824,37 @@ static void FETCH(intensity_f16)( const struct gl_texture_image *texImage, static void FETCH(f_intensity_f16)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLhalfARB *src = HALF_SRC( texImage, i, j, k, 1 ); + const GLhalfARB *src = HALF_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = texel[ACOMP] = _mesa_half_to_float(src[0]); } +#if DIM == 3 +static void store_texel_intensity_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLhalfARB *dst = HALF_ADDR(texImage, i, j, k, 1); + dst[0] = _mesa_float_to_half(rgba[RCOMP]); +} +#endif + + /* * Begin Hardware formats */ +/* MESA_FORMAT_RGBA8888 ******************************************************/ + /* Fetch texel from 1D, 2D or 3D rgba8888 texture, return 4 GLchans */ static void FETCH(rgba8888)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLuint s = *UINT_SRC( texImage, i, j, k ); + const GLuint s = *UINT_ADDR( texImage, i, j, k ); texel[RCOMP] = UBYTE_TO_CHAN( (s >> 24) ); texel[GCOMP] = UBYTE_TO_CHAN( (s >> 16) & 0xff ); texel[BCOMP] = UBYTE_TO_CHAN( (s >> 8) & 0xff ); @@ -604,19 +865,31 @@ static void FETCH(rgba8888)( const struct gl_texture_image *texImage, static void FETCH(f_rgba8888)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLuint s = *UINT_SRC( texImage, i, j, k ); + const GLuint s = *UINT_ADDR( texImage, i, j, k ); texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 24) ); texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); } +#if DIM == 3 +static void store_texel_rgba8888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = UINT_ADDR(texImage, i, j, k); + *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_RGBA888_REV ***************************************************/ /* Fetch texel from 1D, 2D or 3D abgr8888 texture, return 4 GLchans */ static void FETCH(rgba8888_rev)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLuint s = *UINT_SRC( texImage, i, j, k ); + const GLuint s = *UINT_ADDR( texImage, i, j, k ); texel[RCOMP] = UBYTE_TO_CHAN( (s ) & 0xff ); texel[GCOMP] = UBYTE_TO_CHAN( (s >> 8) & 0xff ); texel[BCOMP] = UBYTE_TO_CHAN( (s >> 16) & 0xff ); @@ -627,19 +900,31 @@ static void FETCH(rgba8888_rev)( const struct gl_texture_image *texImage, static void FETCH(f_rgba8888_rev)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLuint s = *UINT_SRC( texImage, i, j, k ); + const GLuint s = *UINT_ADDR( texImage, i, j, k ); texel[RCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); } +#if DIM == 3 +static void store_texel_rgba8888_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = UINT_ADDR(texImage, i, j, k); + *dst = PACK_COLOR_8888_REV(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_ARGB8888 ******************************************************/ /* Fetch texel from 1D, 2D or 3D argb8888 texture, return 4 GLchans */ static void FETCH(argb8888)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLuint s = *UINT_SRC( texImage, i, j, k ); + const GLuint s = *UINT_ADDR( texImage, i, j, k ); texel[RCOMP] = UBYTE_TO_CHAN( (s >> 16) & 0xff ); texel[GCOMP] = UBYTE_TO_CHAN( (s >> 8) & 0xff ); texel[BCOMP] = UBYTE_TO_CHAN( (s ) & 0xff ); @@ -650,43 +935,66 @@ static void FETCH(argb8888)( const struct gl_texture_image *texImage, static void FETCH(f_argb8888)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLuint s = *UINT_SRC( texImage, i, j, k ); + const GLuint s = *UINT_ADDR( texImage, i, j, k ); texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); texel[BCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); } +#if DIM == 3 +static void store_texel_argb8888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = UINT_ADDR(texImage, i, j, k); + *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_ARGB8888_REV **************************************************/ /* Fetch texel from 1D, 2D or 3D argb8888_rev texture, return 4 GLchans */ static void FETCH(argb8888_rev)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLuint s = *UINT_SRC( texImage, i, j, k ); + const GLuint s = *UINT_ADDR( texImage, i, j, k ); texel[RCOMP] = UBYTE_TO_CHAN( (s >> 8) & 0xff ); texel[GCOMP] = UBYTE_TO_CHAN( (s >> 16) & 0xff ); texel[BCOMP] = UBYTE_TO_CHAN( (s >> 24) ); texel[ACOMP] = UBYTE_TO_CHAN( (s ) & 0xff ); } - /* Fetch texel from 1D, 2D or 3D argb8888_rev texture, return 4 GLfloats */ static void FETCH(f_argb8888_rev)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLuint s = *UINT_SRC( texImage, i, j, k ); + const GLuint s = *UINT_ADDR( texImage, i, j, k ); texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 24) ); texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); } +#if DIM == 3 +static void store_texel_argb8888_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = UINT_ADDR(texImage, i, j, k); + *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_RGB888 ********************************************************/ /* Fetch texel from 1D, 2D or 3D rgb888 texture, return 4 GLchans */ static void FETCH(rgb888)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 3 ); + const GLubyte *src = UBYTE_ADDR( texImage, i, j, k, 3 ); texel[RCOMP] = UBYTE_TO_CHAN( src[2] ); texel[GCOMP] = UBYTE_TO_CHAN( src[1] ); texel[BCOMP] = UBYTE_TO_CHAN( src[0] ); @@ -697,19 +1005,33 @@ static void FETCH(rgb888)( const struct gl_texture_image *texImage, static void FETCH(f_rgb888)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 3 ); + const GLubyte *src = UBYTE_ADDR( texImage, i, j, k, 3 ); texel[RCOMP] = UBYTE_TO_FLOAT( src[2] ); texel[GCOMP] = UBYTE_TO_FLOAT( src[1] ); texel[BCOMP] = UBYTE_TO_FLOAT( src[0] ); texel[ACOMP] = 1.0F; } +#if DIM == 3 +static void store_texel_rgb888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = UBYTE_ADDR(texImage, i, j, k, 3); + dst[0] = rgba[RCOMP]; + dst[1] = rgba[GCOMP]; + dst[2] = rgba[BCOMP]; +} +#endif + + +/* MESA_FORMAT_BGR888 ********************************************************/ /* Fetch texel from 1D, 2D or 3D bgr888 texture, return 4 GLchans */ static void FETCH(bgr888)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 3 ); + const GLubyte *src = UBYTE_ADDR( texImage, i, j, k, 3 ); texel[RCOMP] = UBYTE_TO_CHAN( src[0] ); texel[GCOMP] = UBYTE_TO_CHAN( src[1] ); texel[BCOMP] = UBYTE_TO_CHAN( src[2] ); @@ -720,19 +1042,33 @@ static void FETCH(bgr888)( const struct gl_texture_image *texImage, static void FETCH(f_bgr888)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 3 ); + const GLubyte *src = UBYTE_ADDR( texImage, i, j, k, 3 ); texel[RCOMP] = UBYTE_TO_FLOAT( src[0] ); texel[GCOMP] = UBYTE_TO_FLOAT( src[1] ); texel[BCOMP] = UBYTE_TO_FLOAT( src[2] ); texel[ACOMP] = 1.0F; } +#if DIM == 3 +static void store_texel_bgr888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = UBYTE_ADDR(texImage, i, j, k, 3); + dst[0] = rgba[BCOMP]; + dst[1] = rgba[GCOMP]; + dst[2] = rgba[RCOMP]; +} +#endif + + +/* MESA_FORMAT_RGB565 ********************************************************/ /* Fetch texel from 1D, 2D or 3D rgb565 texture, return 4 GLchans */ static void FETCH(rgb565)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLushort *src = USHORT_SRC( texImage, i, j, k ); + const GLushort *src = USHORT_ADDR( texImage, i, j, k ); const GLushort s = *src; texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf8) * 255 / 0xf8 ); texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 3) & 0xfc) * 255 / 0xfc ); @@ -744,7 +1080,7 @@ static void FETCH(rgb565)( const struct gl_texture_image *texImage, static void FETCH(f_rgb565)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLushort *src = USHORT_SRC( texImage, i, j, k ); + const GLushort *src = USHORT_ADDR( texImage, i, j, k ); const GLushort s = *src; texel[RCOMP] = ((s >> 8) & 0xf8) * (1.0F / 248.0F); texel[GCOMP] = ((s >> 3) & 0xfc) * (1.0F / 252.0F); @@ -752,12 +1088,24 @@ static void FETCH(f_rgb565)( const struct gl_texture_image *texImage, texel[ACOMP] = 1.0F; } +#if DIM == 3 +static void store_texel_rgb565(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = USHORT_ADDR(texImage, i, j, k); + *dst = PACK_COLOR_565(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_RGB565_REV ****************************************************/ /* Fetch texel from 1D, 2D or 3D rgb565_rev texture, return 4 GLchans */ static void FETCH(rgb565_rev)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLushort *src = USHORT_SRC( texImage, i, j, k ); + const GLushort *src = USHORT_ADDR( texImage, i, j, k ); const GLushort s = (*src >> 8) | (*src << 8); /* byte swap */ texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf8) * 255 / 0xf8 ); texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 3) & 0xfc) * 255 / 0xfc ); @@ -769,7 +1117,7 @@ static void FETCH(rgb565_rev)( const struct gl_texture_image *texImage, static void FETCH(f_rgb565_rev)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLushort *src = USHORT_SRC( texImage, i, j, k ); + const GLushort *src = USHORT_ADDR( texImage, i, j, k ); const GLushort s = (*src >> 8) | (*src << 8); /* byte swap */ texel[RCOMP] = ((s >> 8) & 0xf8) * (1.0F / 248.0F); texel[GCOMP] = ((s >> 3) & 0xfc) * (1.0F / 252.0F); @@ -777,12 +1125,24 @@ static void FETCH(f_rgb565_rev)( const struct gl_texture_image *texImage, texel[ACOMP] = 1.0F; } +#if DIM == 3 +static void store_texel_rgb565_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = USHORT_ADDR(texImage, i, j, k); + *dst = PACK_COLOR_565(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP]); +} +#endif + + +/* MESA_FORMAT_ARGB4444 ******************************************************/ /* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */ static void FETCH(argb4444)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLushort *src = USHORT_SRC( texImage, i, j, k ); + const GLushort *src = USHORT_ADDR( texImage, i, j, k ); const GLushort s = *src; texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf ); texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf ); @@ -794,7 +1154,7 @@ static void FETCH(argb4444)( const struct gl_texture_image *texImage, static void FETCH(f_argb4444)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLushort *src = USHORT_SRC( texImage, i, j, k ); + const GLushort *src = USHORT_ADDR( texImage, i, j, k ); const GLushort s = *src; texel[RCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F); texel[GCOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F); @@ -802,12 +1162,24 @@ static void FETCH(f_argb4444)( const struct gl_texture_image *texImage, texel[ACOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F); } +#if DIM == 3 +static void store_texel_argb4444(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = USHORT_ADDR(texImage, i, j, k); + *dst = PACK_COLOR_4444(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_ARGB4444_REV **************************************************/ /* Fetch texel from 1D, 2D or 3D argb4444_rev texture, return 4 GLchans */ static void FETCH(argb4444_rev)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLushort s = *USHORT_SRC( texImage, i, j, k ); + const GLushort s = *USHORT_ADDR( texImage, i, j, k ); texel[RCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf ); texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 12) & 0xf) * 255 / 0xf ); texel[BCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf ); @@ -818,19 +1190,31 @@ static void FETCH(argb4444_rev)( const struct gl_texture_image *texImage, static void FETCH(f_argb4444_rev)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLushort s = *USHORT_SRC( texImage, i, j, k ); + const GLushort s = *USHORT_ADDR( texImage, i, j, k ); texel[RCOMP] = ((s ) & 0xf) * (1.0F / 15.0F); texel[GCOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F); texel[BCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F); texel[ACOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F); } +#if DIM == 3 +static void store_texel_argb4444_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = USHORT_ADDR(texImage, i, j, k); + *dst = PACK_COLOR_4444(rgba[ACOMP], rgba[BCOMP], rgba[GCOMP], rgba[RCOMP]); +} +#endif + + +/* MESA_FORMAT_ARGB1555 ******************************************************/ /* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */ static void FETCH(argb1555)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLushort *src = USHORT_SRC( texImage, i, j, k ); + const GLushort *src = USHORT_ADDR( texImage, i, j, k ); const GLushort s = *src; texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0x1f) * 255 / 0x1f ); texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0x1f) * 255 / 0x1f ); @@ -842,7 +1226,7 @@ static void FETCH(argb1555)( const struct gl_texture_image *texImage, static void FETCH(f_argb1555)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLushort *src = USHORT_SRC( texImage, i, j, k ); + const GLushort *src = USHORT_ADDR( texImage, i, j, k ); const GLushort s = *src; texel[RCOMP] = ((s >> 10) & 0x1f) * (1.0F / 31.0F); texel[GCOMP] = ((s >> 5) & 0x1f) * (1.0F / 31.0F); @@ -850,12 +1234,24 @@ static void FETCH(f_argb1555)( const struct gl_texture_image *texImage, texel[ACOMP] = ((s >> 15) & 0x01); } +#if DIM == 3 +static void store_texel_argb1555(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = USHORT_ADDR(texImage, i, j, k); + *dst = PACK_COLOR_1555(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_ARGB1555_REV **************************************************/ /* Fetch texel from 1D, 2D or 3D argb1555_rev texture, return 4 GLchans */ static void FETCH(argb1555_rev)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLushort *src = USHORT_SRC( texImage, i, j, k ); + const GLushort *src = USHORT_ADDR( texImage, i, j, k ); const GLushort s = (*src << 8) | (*src >> 8); /* byteswap */ texel[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0x1f) * 255 / 0x1f ); texel[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0x1f) * 255 / 0x1f ); @@ -867,7 +1263,7 @@ static void FETCH(argb1555_rev)( const struct gl_texture_image *texImage, static void FETCH(f_argb1555_rev)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLushort *src = USHORT_SRC( texImage, i, j, k ); + const GLushort *src = USHORT_ADDR( texImage, i, j, k ); const GLushort s = (*src << 8) | (*src >> 8); /* byteswap */ texel[RCOMP] = ((s >> 10) & 0x1f) * (1.0F / 31.0F); texel[GCOMP] = ((s >> 5) & 0x1f) * (1.0F / 31.0F); @@ -875,12 +1271,24 @@ static void FETCH(f_argb1555_rev)( const struct gl_texture_image *texImage, texel[ACOMP] = ((s >> 15) & 0x01); } +#if DIM == 3 +static void store_texel_argb1555_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = USHORT_ADDR(texImage, i, j, k); + *dst = PACK_COLOR_1555_REV(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_AL88 **********************************************************/ /* Fetch texel from 1D, 2D or 3D al88 texture, return 4 GLchans */ static void FETCH(al88)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLushort s = *USHORT_SRC( texImage, i, j, k ); + const GLushort s = *USHORT_ADDR( texImage, i, j, k ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = UBYTE_TO_CHAN( s & 0xff ); @@ -891,19 +1299,31 @@ static void FETCH(al88)( const struct gl_texture_image *texImage, static void FETCH(f_al88)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLushort s = *USHORT_SRC( texImage, i, j, k ); + const GLushort s = *USHORT_ADDR( texImage, i, j, k ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = UBYTE_TO_FLOAT( s & 0xff ); texel[ACOMP] = UBYTE_TO_FLOAT( s >> 8 ); } +#if DIM == 3 +static void store_texel_al88(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = USHORT_ADDR(texImage, i, j, k); + *dst = PACK_COLOR_88(rgba[ACOMP], rgba[RCOMP]); +} +#endif + + +/* MESA_FORMAT_AL88_REV ******************************************************/ /* Fetch texel from 1D, 2D or 3D al88_rev texture, return 4 GLchans */ static void FETCH(al88_rev)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLushort s = *USHORT_SRC( texImage, i, j, k ); + const GLushort s = *USHORT_ADDR( texImage, i, j, k ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = UBYTE_TO_CHAN( s >> 8 ); @@ -914,19 +1334,31 @@ static void FETCH(al88_rev)( const struct gl_texture_image *texImage, static void FETCH(f_al88_rev)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLushort s = *USHORT_SRC( texImage, i, j, k ); + const GLushort s = *USHORT_ADDR( texImage, i, j, k ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = UBYTE_TO_FLOAT( s >> 8 ); texel[ACOMP] = UBYTE_TO_FLOAT( s & 0xff ); } +#if DIM == 3 +static void store_texel_al88_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = USHORT_ADDR(texImage, i, j, k); + *dst = PACK_COLOR_88(rgba[RCOMP], rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_RGB332 ********************************************************/ /* Fetch texel from 1D, 2D or 3D rgb332 texture, return 4 GLchans */ static void FETCH(rgb332)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 1 ); + const GLubyte *src = UBYTE_ADDR( texImage, i, j, k, 1 ); const GLubyte s = *src; texel[RCOMP] = UBYTE_TO_CHAN( ((s ) & 0xe0) * 255 / 0xe0 ); texel[GCOMP] = UBYTE_TO_CHAN( ((s << 3) & 0xe0) * 255 / 0xe0 ); @@ -938,7 +1370,7 @@ static void FETCH(rgb332)( const struct gl_texture_image *texImage, static void FETCH(f_rgb332)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 1 ); + const GLubyte *src = UBYTE_ADDR( texImage, i, j, k, 1 ); const GLubyte s = *src; texel[RCOMP] = ((s ) & 0xe0) * (1.0F / 224.0F); texel[GCOMP] = ((s << 3) & 0xe0) * (1.0F / 224.0F); @@ -946,12 +1378,24 @@ static void FETCH(f_rgb332)( const struct gl_texture_image *texImage, texel[ACOMP] = 1.0F; } +#if DIM == 3 +static void store_texel_rgb332(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = UBYTE_ADDR(texImage, i, j, k, 1); + *dst = PACK_COLOR_332(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_A8 ************************************************************/ /* Fetch texel from 1D, 2D or 3D a8 texture, return 4 GLchans */ static void FETCH(a8)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 1 ); + const GLubyte *src = UBYTE_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = 0; @@ -962,19 +1406,31 @@ static void FETCH(a8)( const struct gl_texture_image *texImage, static void FETCH(f_a8)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 1 ); + const GLubyte *src = UBYTE_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = 0.0; texel[ACOMP] = UBYTE_TO_FLOAT( src[0] ); } +#if DIM == 3 +static void store_texel_a8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = UBYTE_ADDR(texImage, i, j, k, 1); + *dst = rgba[ACOMP]; +} +#endif + + +/* MESA_FORMAT_L8 ************************************************************/ /* Fetch texel from 1D, 2D or 3D l8 texture, return 4 GLchans */ static void FETCH(l8)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 1 ); + const GLubyte *src = UBYTE_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = UBYTE_TO_CHAN( src[0] ); @@ -985,19 +1441,31 @@ static void FETCH(l8)( const struct gl_texture_image *texImage, static void FETCH(f_l8)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 1 ); + const GLubyte *src = UBYTE_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = UBYTE_TO_FLOAT( src[0] ); texel[ACOMP] = 1.0F; } +#if DIM == 3 +static void store_texel_l8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = UBYTE_ADDR(texImage, i, j, k, 1); + *dst = rgba[RCOMP]; +} +#endif + + +/* MESA_FORMAT_I8 ************************************************************/ /* Fetch texel from 1D, 2D or 3D i8 texture, return 4 GLchans */ static void FETCH(i8)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 1 ); + const GLubyte *src = UBYTE_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = @@ -1008,13 +1476,25 @@ static void FETCH(i8)( const struct gl_texture_image *texImage, static void FETCH(f_i8)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 1 ); + const GLubyte *src = UBYTE_ADDR( texImage, i, j, k, 1 ); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = texel[ACOMP] = UBYTE_TO_FLOAT( src[0] ); } +#if DIM == 3 +static void store_texel_i8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = UBYTE_ADDR(texImage, i, j, k, 1); + *dst = rgba[RCOMP]; +} +#endif + + +/* MESA_FORMAT_CI8 ***********************************************************/ /* Fetch CI texel from 1D, 2D or 3D ci8 texture, lookup the index in a * color table, and return 4 GLchans. @@ -1022,7 +1502,7 @@ static void FETCH(f_i8)( const struct gl_texture_image *texImage, static void FETCH(ci8)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 1 ); + const GLubyte *src = UBYTE_ADDR( texImage, i, j, k, 1 ); const struct gl_color_table *palette; const GLchan *table; GLuint index; @@ -1101,6 +1581,18 @@ static void FETCH(f_ci8)( const struct gl_texture_image *texImage, texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); } +#if DIM == 3 +static void store_texel_ci8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *index = (const GLubyte *) texel; + GLubyte *dst = UBYTE_ADDR(texImage, i, j, k, 1); + *dst = *index; +} +#endif + + +/* MESA_FORMAT_YCBCR *********************************************************/ /* Fetch texel from 1D, 2D or 3D ycbcr texture, return 4 GLchans */ /* We convert YCbCr to RGB here */ @@ -1108,7 +1600,7 @@ static void FETCH(f_ci8)( const struct gl_texture_image *texImage, static void FETCH(ycbcr)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLushort *src0 = USHORT_SRC( texImage, (i & ~1), j, k ); /* even */ + const GLushort *src0 = USHORT_ADDR( texImage, (i & ~1), j, k ); /* even */ const GLushort *src1 = src0 + 1; /* odd */ const GLubyte y0 = (*src0 >> 8) & 0xff; /* luminance */ const GLubyte cb = *src0 & 0xff; /* chroma U */ @@ -1138,7 +1630,7 @@ static void FETCH(ycbcr)( const struct gl_texture_image *texImage, static void FETCH(f_ycbcr)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLushort *src0 = USHORT_SRC( texImage, (i & ~1), j, k ); /* even */ + const GLushort *src0 = USHORT_ADDR( texImage, (i & ~1), j, k ); /* even */ const GLushort *src1 = src0 + 1; /* odd */ const GLubyte y0 = (*src0 >> 8) & 0xff; /* luminance */ const GLubyte cb = *src0 & 0xff; /* chroma U */ @@ -1168,6 +1660,16 @@ static void FETCH(f_ycbcr)( const struct gl_texture_image *texImage, texel[ACOMP] = 1.0F; } +#if DIM == 3 +static void store_texel_ycbcr(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + /* XXX to do */ +} +#endif + + +/* MESA_FORMAT_YCBCR_REV *****************************************************/ /* Fetch texel from 1D, 2D or 3D ycbcr_rev texture, return 4 GLchans */ /* We convert YCbCr to RGB here */ @@ -1175,7 +1677,7 @@ static void FETCH(f_ycbcr)( const struct gl_texture_image *texImage, static void FETCH(ycbcr_rev)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texel ) { - const GLushort *src0 = USHORT_SRC( texImage, (i & ~1), j, k ); /* even */ + const GLushort *src0 = USHORT_ADDR( texImage, (i & ~1), j, k ); /* even */ const GLushort *src1 = src0 + 1; /* odd */ const GLubyte y0 = *src0 & 0xff; /* luminance */ const GLubyte cr = (*src0 >> 8) & 0xff; /* chroma V */ @@ -1205,7 +1707,7 @@ static void FETCH(ycbcr_rev)( const struct gl_texture_image *texImage, static void FETCH(f_ycbcr_rev)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLushort *src0 = USHORT_SRC( texImage, (i & ~1), j, k ); /* even */ + const GLushort *src0 = USHORT_ADDR( texImage, (i & ~1), j, k ); /* even */ const GLushort *src1 = src0 + 1; /* odd */ const GLubyte y0 = *src0 & 0xff; /* luminance */ const GLubyte cr = (*src0 >> 8) & 0xff; /* chroma V */ @@ -1235,13 +1737,21 @@ static void FETCH(f_ycbcr_rev)( const struct gl_texture_image *texImage, texel[ACOMP] = 1.0F; } +#if DIM == 3 +static void store_texel_ycbcr_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + /* XXX to do */ +} +#endif + -#undef CHAN_SRC -#undef UBYTE_SRC -#undef USHORT_SRC -#undef UINT_SRC -#undef FLOAT_SRC -#undef HALF_SRC +#undef CHAN_ADDR +#undef UBYTE_ADDR +#undef USHORT_ADDR +#undef UINT_ADDR +#undef FLOAT_ADDR +#undef HALF_ADDR #undef FETCH #undef DIM diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c new file mode 100644 index 00000000000..12afa93d01f --- /dev/null +++ b/src/mesa/main/texrender.c @@ -0,0 +1,197 @@ + +#include "context.h" +#include "fbobject.h" +#include "texrender.h" +#include "renderbuffer.h" + + +/* + * Render-to-texture code for GL_EXT_framebuffer_object + */ + + +/** + * Derived from gl_renderbuffer class + */ +struct texture_renderbuffer +{ + struct gl_renderbuffer Base; /* Base class object */ + struct gl_texture_image *TexImage; + StoreTexelFunc Store; + GLint Zoffset; +}; + + + +static void +texture_get_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, void *values) +{ + /* XXX unfinished */ +} + +static void +texture_get_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], void *values) +{ + /* XXX unfinished */ +} + +static void +texture_put_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask) +{ + const struct texture_renderbuffer *trb + = (const struct texture_renderbuffer *) rb; + const GLint z = trb->Zoffset; + const GLchan *rgba = (const GLchan *) values; + GLuint i; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + trb->Store(trb->TexImage, x + i, y, z, rgba); + } + rgba += 4; + } +} + +static void +texture_put_mono_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *value, const GLubyte *mask) +{ + const struct texture_renderbuffer *trb + = (const struct texture_renderbuffer *) rb; + const GLint z = trb->Zoffset; + const GLchan *rgba = (const GLchan *) value; + GLuint i; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + trb->Store(trb->TexImage, x + i, y, z, rgba); + } + } +} + +static void +texture_put_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], const void *values, + const GLubyte *mask) +{ + const struct texture_renderbuffer *trb + = (const struct texture_renderbuffer *) rb; + const GLint z = trb->Zoffset; + const GLchan *rgba = (const GLchan *) values; + GLuint i; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + trb->Store(trb->TexImage, x[i], y[i], z, rgba); + } + rgba += 4; + } +} + +static void +texture_put_mono_values(GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint count, const GLint x[], const GLint y[], + const void *value, const GLubyte *mask) +{ + const struct texture_renderbuffer *trb + = (const struct texture_renderbuffer *) rb; + const GLint z = trb->Zoffset; + const GLchan *rgba = (const GLchan *) value; + GLuint i; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + trb->Store(trb->TexImage, x[i], y[i], z, rgba); + } + } +} + + +static void +delete_texture_wrapper(struct gl_renderbuffer *rb) +{ + _mesa_free(rb); +} + + +/** + * If a render buffer attachment specifies a texture image, we'll use + * this function to make a gl_renderbuffer wrapper around the texture image. + * This allows other parts of Mesa to access the texture image as if it + * was a renderbuffer. + */ +static void +wrap_texture(GLcontext *ctx, struct gl_renderbuffer_attachment *att) +{ + struct texture_renderbuffer *trb; + const GLuint name = 0; + + ASSERT(att->Type == GL_TEXTURE); + ASSERT(att->Renderbuffer == NULL); + /* + ASSERT(att->Complete); + */ + + trb = CALLOC_STRUCT(texture_renderbuffer); + if (!trb) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "wrap_texture"); + return; + } + + _mesa_init_renderbuffer(&trb->Base, name); + + trb->TexImage = att->Texture->Image[att->CubeMapFace][att->TextureLevel]; + assert(trb->TexImage); + + trb->Store = trb->TexImage->TexFormat->StoreTexel; + assert(trb->Store); + + trb->Zoffset = att->Zoffset; + + trb->Base.Width = trb->TexImage->Width; + trb->Base.Height = trb->TexImage->Height; + trb->Base.InternalFormat = trb->TexImage->IntFormat; /* XXX fix? */ + trb->Base._BaseFormat = trb->TexImage->TexFormat->BaseFormat; + assert(trb->Base._BaseFormat == GL_RGB || + trb->Base._BaseFormat == GL_RGBA || + trb->Base._BaseFormat == GL_DEPTH_COMPONENT); + trb->Base.DataType = GL_UNSIGNED_BYTE; /* XXX fix! */ + trb->Base.Data = trb->TexImage->Data; + + trb->Base.GetRow = texture_get_row; + trb->Base.GetValues = texture_get_values; + trb->Base.PutRow = texture_put_row; + trb->Base.PutMonoRow = texture_put_mono_row; + trb->Base.PutValues = texture_put_values; + trb->Base.PutMonoValues = texture_put_mono_values; + + trb->Base.Delete = delete_texture_wrapper; + trb->Base.AllocStorage = NULL; /* illegal! */ + + att->Renderbuffer = &(trb->Base); +} + + + +/** + * Software fallback for ctx->Driver.RenderbufferTexture. + * This is called via the glRenderbufferTexture1D/2D/3D() functions. + * If we're unbinding a texture, texObj will be NULL. + * The framebuffer of interest is ctx->DrawBuffer. + * \sa _mesa_framebuffer_renderbuffer + */ +void +_mesa_renderbuffer_texture(GLcontext *ctx, + struct gl_renderbuffer_attachment *att, + struct gl_texture_object *texObj, + GLenum texTarget, GLuint level, GLuint zoffset) +{ + if (texObj) { + _mesa_set_texture_attachment(ctx, att, texObj, + texTarget, level, zoffset); + + wrap_texture(ctx, att); + } + else { + _mesa_remove_attachment(ctx, att); + } +} diff --git a/src/mesa/main/texrender.h b/src/mesa/main/texrender.h new file mode 100644 index 00000000000..6d8bc964141 --- /dev/null +++ b/src/mesa/main/texrender.h @@ -0,0 +1,12 @@ +#ifndef TEXRENDER_H +#define TEXRENDER_H + + +extern void +_mesa_renderbuffer_texture(GLcontext *ctx, + struct gl_renderbuffer_attachment *att, + struct gl_texture_object *texObj, + GLenum texTarget, GLuint level, GLuint zoffset); + + +#endif /* TEXRENDER_H */ diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 3a8ccb39847..02f2dbe69fe 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -2200,8 +2200,8 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, return; } - pixels = _mesa_validate_pbo_teximage(ctx, 1, width, 1, 1, format, type, pixels, - packing, "glTexImage1D"); + pixels = _mesa_validate_pbo_teximage(ctx, 1, width, 1, 1, format, type, + pixels, packing, "glTexImage1D"); if (!pixels) { /* Note: we check for a NULL image pointer here, _after_ we allocated * memory for the texture. That's what the GL spec calls for. @@ -2289,7 +2289,7 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, } pixels = _mesa_validate_pbo_teximage(ctx, 2, width, height, 1, format, type, - pixels, packing, "glTexImage2D"); + pixels, packing, "glTexImage2D"); if (!pixels) { /* Note: we check for a NULL image pointer here, _after_ we allocated * memory for the texture. That's what the GL spec calls for. @@ -2368,8 +2368,8 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, return; } - pixels = _mesa_validate_pbo_teximage(ctx, 3, width, height, depth, format, type, - pixels, packing, "glTexImage3D"); + pixels = _mesa_validate_pbo_teximage(ctx, 3, width, height, depth, format, + type, pixels, packing, "glTexImage3D"); if (!pixels) { /* Note: we check for a NULL image pointer here, _after_ we allocated * memory for the texture. That's what the GL spec calls for. @@ -2425,8 +2425,8 @@ _mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - pixels = _mesa_validate_pbo_teximage(ctx, 1, width, 1, 1, format, type, pixels, - packing, "glTexSubImage1D"); + pixels = _mesa_validate_pbo_teximage(ctx, 1, width, 1, 1, format, type, + pixels, packing, "glTexSubImage1D"); if (!pixels) return; @@ -2472,7 +2472,7 @@ _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_image *texImage) { pixels = _mesa_validate_pbo_teximage(ctx, 2, width, height, 1, format, type, - pixels, packing, "glTexSubImage2D"); + pixels, packing, "glTexSubImage2D"); if (!pixels) return; @@ -2523,8 +2523,9 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - pixels = _mesa_validate_pbo_teximage(ctx, 3, width, height, depth, format, type, - pixels, packing, "glTexSubImage3D"); + pixels = _mesa_validate_pbo_teximage(ctx, 3, width, height, depth, format, + type, pixels, packing, + "glTexSubImage3D"); if (!pixels) return; @@ -2625,8 +2626,9 @@ _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level, return; } - data = _mesa_validate_pbo_compressed_teximage(ctx, imageSize, data, &ctx->Unpack, - "glCompressedTexImage2D"); + data = _mesa_validate_pbo_compressed_teximage(ctx, imageSize, data, + &ctx->Unpack, + "glCompressedTexImage2D"); if (!data) return; @@ -2719,8 +2721,9 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, ASSERT((xoffset & 3) == 0); ASSERT((yoffset & 3) == 0); - data = _mesa_validate_pbo_compressed_teximage(ctx, imageSize, data, &ctx->Unpack, - "glCompressedTexSubImage2D"); + data = _mesa_validate_pbo_compressed_teximage(ctx, imageSize, data, + &ctx->Unpack, + "glCompressedTexSubImage2D"); if (!data) return; diff --git a/src/mesa/sources b/src/mesa/sources index 54cd290524a..8a649d7d478 100644 --- a/src/mesa/sources +++ b/src/mesa/sources @@ -26,6 +26,7 @@ MAIN_SOURCES = \ main/fbobject.c \ main/feedback.c \ main/fog.c \ + main/framebuffer.c \ main/get.c \ main/getstring.c \ main/hash.c \ @@ -41,6 +42,7 @@ MAIN_SOURCES = \ main/points.c \ main/polygon.c \ main/rastpos.c \ + main/renderbuffer.c \ main/state.c \ main/stencil.c \ main/texcompress.c \ @@ -49,6 +51,7 @@ MAIN_SOURCES = \ main/texenvprogram.c \ main/texformat.c \ main/teximage.c \ + main/texrender.c \ main/texobj.c \ main/texstate.c \ main/texstore.c \ @@ -79,9 +82,7 @@ SWRAST_SOURCES = \ swrast/s_aatriangle.c \ swrast/s_accum.c \ swrast/s_alpha.c \ - swrast/s_alphabuf.c \ swrast/s_atifragshader.c \ - swrast/s_auxbuffer.c \ swrast/s_bitmap.c \ swrast/s_blend.c \ swrast/s_buffers.c \ @@ -229,7 +230,7 @@ SPARC_SOURCES = \ SPARC_API = \ sparc/glapi_sparc.S -COMMON_DRIVER_SOURCES = \ +COMMON_DRIVER_SOURCES = \ drivers/common/driverfuncs.c X11_DRIVER_SOURCES = \ @@ -237,9 +238,10 @@ X11_DRIVER_SOURCES = \ drivers/x11/fakeglx.c \ drivers/x11/xfonts.c \ drivers/x11/xm_api.c \ + drivers/x11/xm_buffer.c \ drivers/x11/xm_dd.c \ drivers/x11/xm_line.c \ - drivers/x11/xm_span.c \ + drivers/x11/xm_span2.c \ drivers/x11/xm_tri.c OSMESA_DRIVER_SOURCES = \ diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c index 55ba8310590..b0af0f95d4f 100644 --- a/src/mesa/swrast/s_accum.c +++ b/src/mesa/swrast/s_accum.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.0.1 + * Version: 6.3 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -27,20 +27,23 @@ #include "context.h" #include "macros.h" #include "imports.h" +#include "fbobject.h" #include "s_accum.h" -#include "s_alphabuf.h" #include "s_context.h" #include "s_masking.h" #include "s_span.h" +#define ACCUM_SCALE16 32767.0 + + /* * Accumulation buffer notes * * Normally, accumulation buffer values are GLshorts with values in * [-32767, 32767] which represent floating point colors in [-1, 1], - * as suggested by the OpenGL specification. + * as defined by the OpenGL specification. * * We optimize for the common case used for full-scene antialiasing: * // start with accum buffer cleared to zero @@ -54,68 +57,61 @@ * In this scenario, we can simply store unscaled integer values in * the accum buffer instead of scaled integers. We'll also keep track * of the w value so when we do GL_RETURN we simply divide the accumulated - * values by n (=1/w). + * values by n (n=1/w). * This lets us avoid _many_ int->float->int conversions. */ -#if CHAN_BITS == 8 && ACCUM_BITS < 32 -#define USE_OPTIMIZED_ACCUM /* enable the optimization */ -#endif - - -void -_swrast_alloc_accum_buffer( GLframebuffer *buffer ) -{ - GET_CURRENT_CONTEXT(ctx); - GLint n; - - ASSERT(buffer->UseSoftwareAccumBuffer); - - if (buffer->Accum) { - MESA_PBUFFER_FREE( buffer->Accum ); - buffer->Accum = NULL; - } - - /* allocate accumulation buffer if not already present */ - n = buffer->Width * buffer->Height * 4 * sizeof(GLaccum); - buffer->Accum = (GLaccum *) MESA_PBUFFER_ALLOC( n ); - if (!buffer->Accum) { - /* unable to setup accumulation buffer */ - _mesa_error( NULL, GL_OUT_OF_MEMORY, "glAccum" ); - } - - if (ctx) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); - /* XXX these fields should probably be in the GLframebuffer */ -#ifdef USE_OPTIMIZED_ACCUM - swrast->_IntegerAccumMode = GL_TRUE; +#if CHAN_BITS == 8 && ACCUM_BITS <= 32 +/* enable the optimization */ +#define USE_OPTIMIZED_ACCUM 1 #else - swrast->_IntegerAccumMode = GL_FALSE; +#define USE_OPTIMIZED_ACCUM 0 #endif - swrast->_IntegerAccumScaler = 0.0; - } -} -/* +/** * This is called when we fall out of optimized/unscaled accum buffer mode. * That is, we convert each unscaled accum buffer value into a scaled value * representing the range[-1, 1]. */ -static void rescale_accum( GLcontext *ctx ) +static void +rescale_accum( GLcontext *ctx ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLuint n = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height * 4; + struct gl_renderbuffer *rb + = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer; const GLfloat s = swrast->_IntegerAccumScaler * (32767.0F / CHAN_MAXF); - GLaccum *accum = ctx->DrawBuffer->Accum; - GLuint i; + assert(rb); + assert(rb->_BaseFormat == GL_RGBA); + /* add other types in future? */ + assert(rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT); assert(swrast->_IntegerAccumMode); - assert(accum); - for (i = 0; i < n; i++) { - accum[i] = (GLaccum) (accum[i] * s); + if (rb->GetPointer(ctx, rb, 0, 0)) { + /* directly-addressable memory */ + GLuint y; + for (y = 0; y < rb->Height; y++) { + GLuint i; + GLshort *acc = (GLshort *) rb->GetPointer(ctx, rb, 0, y); + for (i = 0; i < 4 * rb->Width; i++) { + acc[i] = (GLshort) (acc[i] * s); + } + } + } + else { + /* use get/put row funcs */ + GLuint y; + for (y = 0; y < rb->Height; y++) { + GLshort accRow[MAX_WIDTH * 4]; + GLuint i; + rb->GetRow(ctx, rb, rb->Width, 0, y, accRow); + for (i = 0; i < 4 * rb->Width; i++) { + accRow[i] = (GLshort) (accRow[i] * s); + } + rb->PutRow(ctx, rb, rb->Width, 0, y, accRow, NULL); + } } swrast->_IntegerAccumMode = GL_FALSE; @@ -123,406 +119,472 @@ static void rescale_accum( GLcontext *ctx ) - - - -/* +/** * Clear the accumulation Buffer. */ void -_swrast_clear_accum_buffer( GLcontext *ctx ) +_swrast_clear_accum_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLuint buffersize; - GLfloat acc_scale; + GLuint x, y, width, height; - if (ctx->Visual.accumRedBits==0) { - /* No accumulation buffer! */ + if (ctx->Visual.accumRedBits == 0) { + /* No accumulation buffer! Not an error. */ return; } - if (sizeof(GLaccum)==1) { - acc_scale = 127.0; - } - else if (sizeof(GLaccum)==2) { - acc_scale = 32767.0; + assert(rb); + assert(rb->_BaseFormat == GL_RGBA); + /* add other types in future? */ + assert(rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT); + + /* bounds, with scissor */ + x = ctx->DrawBuffer->_Xmin; + y = ctx->DrawBuffer->_Ymin; + width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; + height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; + + if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) { + const GLfloat accScale = 32767.0; + GLshort clearVal[4]; + GLuint i; + + clearVal[0] = (GLshort) (ctx->Accum.ClearColor[0] * accScale); + clearVal[1] = (GLshort) (ctx->Accum.ClearColor[1] * accScale); + clearVal[2] = (GLshort) (ctx->Accum.ClearColor[2] * accScale); + clearVal[3] = (GLshort) (ctx->Accum.ClearColor[3] * accScale); + + for (i = 0; i < height; i++) { + rb->PutMonoRow(ctx, rb, width, x, y + i, clearVal, NULL); + } } else { - acc_scale = 1.0F; + /* someday support other sizes */ } - /* number of pixels */ - buffersize = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height; - - if (!ctx->DrawBuffer->Accum) { - /* try to alloc accumulation buffer */ - ctx->DrawBuffer->Accum = (GLaccum *) - MALLOC( buffersize * 4 * sizeof(GLaccum) ); + /* update optimized accum state vars */ + if (ctx->Accum.ClearColor[0] == 0.0 && ctx->Accum.ClearColor[1] == 0.0 && + ctx->Accum.ClearColor[2] == 0.0 && ctx->Accum.ClearColor[3] == 0.0) { +#if USE_OPTIMIZED_ACCUM + swrast->_IntegerAccumMode = GL_TRUE; +#else + swrast->_IntegerAccumMode = GL_FALSE; +#endif + swrast->_IntegerAccumScaler = 0.0; /* denotes empty accum buffer */ } + else { + swrast->_IntegerAccumMode = GL_FALSE; + } +} - if (ctx->DrawBuffer->Accum) { - if (ctx->Scissor.Enabled) { - /* Limit clear to scissor box */ - const GLaccum r = (GLaccum) (ctx->Accum.ClearColor[0] * acc_scale); - const GLaccum g = (GLaccum) (ctx->Accum.ClearColor[1] * acc_scale); - const GLaccum b = (GLaccum) (ctx->Accum.ClearColor[2] * acc_scale); - const GLaccum a = (GLaccum) (ctx->Accum.ClearColor[3] * acc_scale); - GLint i, j; - GLint width, height; - GLaccum *row; - /* size of region to clear */ - width = 4 * (ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin); - height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - /* ptr to first element to clear */ - row = ctx->DrawBuffer->Accum - + 4 * (ctx->DrawBuffer->_Ymin * ctx->DrawBuffer->Width - + ctx->DrawBuffer->_Xmin); - for (j=0;jDrawBuffer->Width; - } + +static void +accum_add(GLcontext *ctx, GLfloat value, + GLint xpos, GLint ypos, GLint width, GLint height ) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + struct gl_renderbuffer *rb + = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer; + + assert(rb); + + /* Leave optimized accum buffer mode */ + if (swrast->_IntegerAccumMode) + rescale_accum(ctx); + + if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) { + const GLshort incr = (GLshort) (value * ACCUM_SCALE16); + if (rb->GetPointer(ctx, rb, 0, 0)) { + GLint i, j; + for (i = 0; i < height; i++) { + GLshort *acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i); + for (j = 0; j < 4 * width; j++) { + acc[j] += incr; + } + } } else { - /* clear whole buffer */ - if (ctx->Accum.ClearColor[0]==0.0 && - ctx->Accum.ClearColor[1]==0.0 && - ctx->Accum.ClearColor[2]==0.0 && - ctx->Accum.ClearColor[3]==0.0) { - /* Black */ - _mesa_bzero( ctx->DrawBuffer->Accum, - buffersize * 4 * sizeof(GLaccum) ); - } - else { - /* Not black */ - const GLaccum r = (GLaccum) (ctx->Accum.ClearColor[0] * acc_scale); - const GLaccum g = (GLaccum) (ctx->Accum.ClearColor[1] * acc_scale); - const GLaccum b = (GLaccum) (ctx->Accum.ClearColor[2] * acc_scale); - const GLaccum a = (GLaccum) (ctx->Accum.ClearColor[3] * acc_scale); - GLaccum *acc = ctx->DrawBuffer->Accum; - GLuint i; - for (i=0;iGetRow(ctx, rb, width, xpos, ypos + i, accRow); + for (j = 0; j < 4 * width; j++) { + accRow[j] += incr; + } + rb->PutRow(ctx, rb, width, xpos, ypos + i, accRow, NULL); + } } + } + else { + /* other types someday */ + } +} - /* update optimized accum state vars */ - if (ctx->Accum.ClearColor[0] == 0.0 && ctx->Accum.ClearColor[1] == 0.0 && - ctx->Accum.ClearColor[2] == 0.0 && ctx->Accum.ClearColor[3] == 0.0) { -#ifdef USE_OPTIMIZED_ACCUM - swrast->_IntegerAccumMode = GL_TRUE; -#else - swrast->_IntegerAccumMode = GL_FALSE; -#endif - swrast->_IntegerAccumScaler = 0.0; /* denotes empty accum buffer */ + +static void +accum_mult(GLcontext *ctx, GLfloat mult, + GLint xpos, GLint ypos, GLint width, GLint height ) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + struct gl_renderbuffer *rb + = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer; + + assert(rb); + + /* Leave optimized accum buffer mode */ + if (swrast->_IntegerAccumMode) + rescale_accum(ctx); + + if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) { + if (rb->GetPointer(ctx, rb, 0, 0)) { + GLint i, j; + for (i = 0; i < height; i++) { + GLshort *acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i); + for (j = 0; j < 4 * width; j++) { + acc[j] = (GLshort) (acc[j] * mult); + } + } } else { - swrast->_IntegerAccumMode = GL_FALSE; + GLint i, j; + for (i = 0; i < height; i++) { + GLshort accRow[4 * MAX_WIDTH]; + rb->GetRow(ctx, rb, width, xpos, ypos + i, accRow); + for (j = 0; j < 4 * width; j++) { + accRow[j] = (GLshort) (accRow[j] * mult); + } + rb->PutRow(ctx, rb, width, xpos, ypos + i, accRow, NULL); + } } } + else { + /* other types someday */ + } } -void -_swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value, - GLint xpos, GLint ypos, - GLint width, GLint height ) +static void +accum_accum(GLcontext *ctx, GLfloat value, + GLint xpos, GLint ypos, GLint width, GLint height ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLuint width4; - GLfloat acc_scale; - GLchan rgba[MAX_WIDTH][4]; - const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask); + struct gl_renderbuffer *rb + = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer; + const GLboolean directAccess = (rb->GetPointer(ctx, rb, 0, 0) != NULL); + assert(rb); - if (SWRAST_CONTEXT(ctx)->NewState) - _swrast_validate_derived( ctx ); - - if (!ctx->DrawBuffer->Accum) { - _mesa_warning(ctx, - "Calling glAccum() without an accumulation " - "buffer (low memory?)"); + if (!ctx->ReadBuffer->_ColorReadBuffer) { + /* no read buffer - OK */ return; } - if (sizeof(GLaccum)==1) { - acc_scale = 127.0; - } - else if (sizeof(GLaccum)==2) { - acc_scale = 32767.0; - } - else { - acc_scale = 1.0F; - } - - width4 = 4 * width; + /* May have to leave optimized accum buffer mode */ + if (swrast->_IntegerAccumScaler == 0.0 && value > 0.0 && value <= 1.0) + swrast->_IntegerAccumScaler = value; + if (swrast->_IntegerAccumMode && value != swrast->_IntegerAccumScaler) + rescale_accum(ctx); - switch (op) { - case GL_ADD: - if (value != 0.0F) { - const GLaccum val = (GLaccum) (value * acc_scale); - GLint j; - /* Leave optimized accum buffer mode */ - if (swrast->_IntegerAccumMode) - rescale_accum(ctx); - for (j = 0; j < height; j++) { - GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + 4*xpos; - GLuint i; - for (i = 0; i < width4; i++) { - acc[i] += val; - } - ypos++; - } - } - break; + _swrast_use_read_buffer(ctx); - case GL_MULT: - if (value != 1.0F) { - GLint j; - /* Leave optimized accum buffer mode */ - if (swrast->_IntegerAccumMode) - rescale_accum(ctx); - for (j = 0; j < height; j++) { - GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + 4 * xpos; - GLuint i; - for (i = 0; i < width4; i++) { - acc[i] = (GLaccum) ( (GLfloat) acc[i] * value ); - } - ypos++; - } - } - break; - - case GL_ACCUM: - if (value == 0.0F) - return; + if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) { + const GLfloat scale = value * ACCUM_SCALE16 / CHAN_MAXF; + GLshort accumRow[4 * MAX_WIDTH]; + GLchan rgba[MAX_WIDTH][4]; + GLint i; - _swrast_use_read_buffer(ctx); - - /* May have to leave optimized accum buffer mode */ - if (swrast->_IntegerAccumScaler == 0.0 && value > 0.0 && value <= 1.0) - swrast->_IntegerAccumScaler = value; - if (swrast->_IntegerAccumMode && value != swrast->_IntegerAccumScaler) - rescale_accum(ctx); + for (i = 0; i < height; i++) { + GLshort *acc; + if (directAccess) { + acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i); + } + else { + rb->GetRow(ctx, rb, width, xpos, ypos + i, accumRow); + acc = accumRow; + } - RENDER_START(swrast,ctx); + /* read colors from color buffer */ + _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, width, + xpos, ypos + i, rgba); + /* do accumulation */ if (swrast->_IntegerAccumMode) { /* simply add integer color values into accum buffer */ GLint j; - GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos * 4; - assert(swrast->_IntegerAccumScaler > 0.0); - assert(swrast->_IntegerAccumScaler <= 1.0); - for (j = 0; j < height; j++) { - - GLint i, i4; - _swrast_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba); - for (i = i4 = 0; i < width; i++, i4+=4) { - acc[i4+0] += rgba[i][RCOMP]; - acc[i4+1] += rgba[i][GCOMP]; - acc[i4+2] += rgba[i][BCOMP]; - acc[i4+3] += rgba[i][ACOMP]; - } - acc += width4; - ypos++; + for (j = 0; j < width; j++) { + acc[j * 4 + 0] += rgba[j][RCOMP]; + acc[j * 4 + 1] += rgba[j][GCOMP]; + acc[j * 4 + 2] += rgba[j][BCOMP]; + acc[j * 4 + 3] += rgba[j][ACOMP]; } } else { /* scaled integer (or float) accum buffer */ - const GLfloat rscale = value * acc_scale / CHAN_MAXF; - const GLfloat gscale = value * acc_scale / CHAN_MAXF; - const GLfloat bscale = value * acc_scale / CHAN_MAXF; - const GLfloat ascale = value * acc_scale / CHAN_MAXF; GLint j; - for (j=0;jDrawBuffer->Accum + ypos * width4 + xpos * 4; - GLint i; - _swrast_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba); - for (i=0;iPutRow(ctx, rb, width, xpos, ypos + i, accumRow, NULL); + } + } + } + else { + /* other types someday */ + } - case GL_LOAD: - _swrast_use_read_buffer(ctx); + _swrast_use_draw_buffer(ctx); +} + + + +static void +accum_load(GLcontext *ctx, GLfloat value, + GLint xpos, GLint ypos, GLint width, GLint height ) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + struct gl_renderbuffer *rb + = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer; + const GLboolean directAccess = (rb->GetPointer(ctx, rb, 0, 0) != NULL); - /* This is a change to go into optimized accum buffer mode */ - if (value > 0.0 && value <= 1.0) { -#ifdef USE_OPTIMIZED_ACCUM - swrast->_IntegerAccumMode = GL_TRUE; + assert(rb); + + if (!ctx->ReadBuffer->_ColorReadBuffer) { + /* no read buffer - OK */ + return; + } + + /* This is a change to go into optimized accum buffer mode */ + if (value > 0.0 && value <= 1.0) { +#if USE_OPTIMIZED_ACCUM + swrast->_IntegerAccumMode = GL_TRUE; #else - swrast->_IntegerAccumMode = GL_FALSE; + swrast->_IntegerAccumMode = GL_FALSE; #endif - swrast->_IntegerAccumScaler = value; + swrast->_IntegerAccumScaler = value; + } + else { + swrast->_IntegerAccumMode = GL_FALSE; + swrast->_IntegerAccumScaler = 0.0; + } + + _swrast_use_read_buffer(ctx); + + if (rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT) { + const GLfloat scale = value * ACCUM_SCALE16 / CHAN_MAXF; + GLshort accumRow[4 * MAX_WIDTH]; + GLchan rgba[MAX_WIDTH][4]; + GLint i; + + for (i = 0; i < height; i++) { + GLshort *acc; + if (directAccess) { + acc = (GLshort *) rb->GetPointer(ctx, rb, xpos, ypos + i); } else { - swrast->_IntegerAccumMode = GL_FALSE; - swrast->_IntegerAccumScaler = 0.0; + rb->GetRow(ctx, rb, width, xpos, ypos + i, accumRow); + acc = accumRow; } - RENDER_START(swrast,ctx); + /* read colors from color buffer */ + _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, width, + xpos, ypos + i, rgba); + + /* do load */ if (swrast->_IntegerAccumMode) { - /* just copy values into accum buffer */ + /* just copy values in */ GLint j; - GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos * 4; assert(swrast->_IntegerAccumScaler > 0.0); assert(swrast->_IntegerAccumScaler <= 1.0); - for (j = 0; j < height; j++) { - GLint i, i4; - _swrast_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba); - for (i = i4 = 0; i < width; i++, i4 += 4) { - acc[i4+0] = rgba[i][RCOMP]; - acc[i4+1] = rgba[i][GCOMP]; - acc[i4+2] = rgba[i][BCOMP]; - acc[i4+3] = rgba[i][ACOMP]; - } - acc += width4; - ypos++; + for (j = 0; j < width; j++) { + acc[j * 4 + 0] = rgba[j][RCOMP]; + acc[j * 4 + 1] = rgba[j][GCOMP]; + acc[j * 4 + 2] = rgba[j][BCOMP]; + acc[j * 4 + 3] = rgba[j][ACOMP]; } } else { /* scaled integer (or float) accum buffer */ - const GLfloat rscale = value * acc_scale / CHAN_MAXF; - const GLfloat gscale = value * acc_scale / CHAN_MAXF; - const GLfloat bscale = value * acc_scale / CHAN_MAXF; - const GLfloat ascale = value * acc_scale / CHAN_MAXF; -#if 0 - const GLfloat d = 3.0 / acc_scale; /* XXX what's this? */ -#endif - GLint i, j; - for (j = 0; j < height; j++) { - GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos * 4; - _swrast_read_rgba_span(ctx, ctx->DrawBuffer, width, xpos, ypos, rgba); - for (i=0;iPutRow(ctx, rb, width, xpos, ypos + i, accumRow, NULL); + } + } + } + else { + /* other types someday */ + } - RENDER_FINISH(swrast,ctx); - break; + _swrast_use_draw_buffer(ctx); +} - case GL_RETURN: - /* May have to leave optimized accum buffer mode */ - if (swrast->_IntegerAccumMode && value != 1.0) - rescale_accum(ctx); - - RENDER_START(swrast,ctx); -#ifdef USE_OPTIMIZED_ACCUM - if (swrast->_IntegerAccumMode && swrast->_IntegerAccumScaler > 0) { - /* build lookup table to avoid many floating point multiplies */ - static GLchan multTable[32768]; - static GLfloat prevMult = 0.0; - const GLfloat mult = swrast->_IntegerAccumScaler; - const GLint max = MIN2((GLint) (256 / mult), 32767); - GLint j; - if (mult != prevMult) { - for (j = 0; j < max; j++) - multTable[j] = IROUND((GLfloat) j * mult); - prevMult = mult; - } - assert(swrast->_IntegerAccumScaler > 0.0); - assert(swrast->_IntegerAccumScaler <= 1.0); - for (j = 0; j < height; j++) { - const GLaccum *acc = ctx->DrawBuffer->Accum + ypos * width4 + xpos*4; - GLint i, i4; - for (i = i4 = 0; i < width; i++, i4 += 4) { - ASSERT(acc[i4+0] < max); - ASSERT(acc[i4+1] < max); - ASSERT(acc[i4+2] < max); - ASSERT(acc[i4+3] < max); - rgba[i][RCOMP] = multTable[acc[i4+0]]; - rgba[i][GCOMP] = multTable[acc[i4+1]]; - rgba[i][BCOMP] = multTable[acc[i4+2]]; - rgba[i][ACOMP] = multTable[acc[i4+3]]; - } - if (colorMask != 0xffffffff) { - _swrast_mask_rgba_array( ctx, width, xpos, ypos, rgba ); - } - (*swrast->Driver.WriteRGBASpan)( ctx, width, xpos, ypos, - (const GLchan (*)[4])rgba, NULL ); - if (ctx->DrawBuffer->UseSoftwareAlphaBuffers - && ctx->Color.ColorMask[ACOMP]) { - _swrast_write_alpha_span(ctx, width, xpos, ypos, - (CONST GLchan (*)[4]) rgba, NULL); - } - ypos++; +static void +accum_return(GLcontext *ctx, GLfloat value, + GLint xpos, GLint ypos, GLint width, GLint height ) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + struct gl_framebuffer *fb = ctx->DrawBuffer; + struct gl_renderbuffer *accumRb = fb->Attachment[BUFFER_ACCUM].Renderbuffer; + const GLboolean directAccess + = (accumRb->GetPointer(ctx, accumRb, 0, 0) != NULL); + const GLboolean masking = (!ctx->Color.ColorMask[RCOMP] || + !ctx->Color.ColorMask[GCOMP] || + !ctx->Color.ColorMask[BCOMP] || + !ctx->Color.ColorMask[ACOMP]); + + static GLchan multTable[32768]; + static GLfloat prevMult = 0.0; + const GLfloat mult = swrast->_IntegerAccumScaler; + const GLint max = MIN2((GLint) (256 / mult), 32767); + + /* May have to leave optimized accum buffer mode */ + if (swrast->_IntegerAccumMode && value != 1.0) + rescale_accum(ctx); + + if (swrast->_IntegerAccumMode && swrast->_IntegerAccumScaler > 0) { + /* build lookup table to avoid many floating point multiplies */ + GLint j; + assert(swrast->_IntegerAccumScaler <= 1.0); + if (mult != prevMult) { + for (j = 0; j < max; j++) + multTable[j] = IROUND((GLfloat) j * mult); + prevMult = mult; + } + } + + if (accumRb->DataType == GL_SHORT || + accumRb->DataType == GL_UNSIGNED_SHORT) { + const GLfloat scale = value * CHAN_MAXF / ACCUM_SCALE16; + GLuint buffer, i; + + /* XXX maybe transpose the 'i' and 'buffer' loops??? */ + for (i = 0; i < height; i++) { + GLchan rgba[MAX_WIDTH][4]; + GLshort accumRow[4 * MAX_WIDTH]; + GLshort *acc; + + if (directAccess) { + acc = (GLshort *) accumRb->GetPointer(ctx, accumRb, xpos, ypos +i); + } + else { + accumRb->GetRow(ctx, accumRb, width, xpos, ypos + i, accumRow); + acc = accumRow; + } + + /* get the colors to return */ + if (swrast->_IntegerAccumMode) { + GLint j; + for (j = 0; j < width; j++) { + ASSERT(acc[j * 4 + 0] < max); + ASSERT(acc[j * 4 + 1] < max); + ASSERT(acc[j * 4 + 2] < max); + ASSERT(acc[j * 4 + 3] < max); + rgba[j][RCOMP] = multTable[acc[j * 4 + 0]]; + rgba[j][GCOMP] = multTable[acc[j * 4 + 1]]; + rgba[j][BCOMP] = multTable[acc[j * 4 + 2]]; + rgba[j][ACOMP] = multTable[acc[j * 4 + 3]]; } } - else -#endif /* USE_OPTIMIZED_ACCUM */ - { + else { /* scaled integer (or float) accum buffer */ - const GLfloat rscale = value / acc_scale * CHAN_MAXF; - const GLfloat gscale = value / acc_scale * CHAN_MAXF; - const GLfloat bscale = value / acc_scale * CHAN_MAXF; - const GLfloat ascale = value / acc_scale * CHAN_MAXF; - GLint i, j; - for (j=0;jDrawBuffer->Accum + ypos * width4 + xpos*4; - for (i=0;iDriver.WriteRGBASpan)( ctx, width, xpos, ypos, - (const GLchan (*)[4])rgba, NULL ); - if (ctx->DrawBuffer->UseSoftwareAlphaBuffers - && ctx->Color.ColorMask[ACOMP]) { - _swrast_write_alpha_span(ctx, width, xpos, ypos, - (CONST GLchan (*)[4]) rgba, NULL); - } - ypos++; + GLint j; + for (j = 0; j < width; j++) { + GLint r = IROUND( (GLfloat) (acc[j * 4 + 0]) * scale ); + GLint g = IROUND( (GLfloat) (acc[j * 4 + 1]) * scale ); + GLint b = IROUND( (GLfloat) (acc[j * 4 + 2]) * scale ); + GLint a = IROUND( (GLfloat) (acc[j * 4 + 3]) * scale ); + rgba[j][RCOMP] = CLAMP( r, 0, CHAN_MAX ); + rgba[j][GCOMP] = CLAMP( g, 0, CHAN_MAX ); + rgba[j][BCOMP] = CLAMP( b, 0, CHAN_MAX ); + rgba[j][ACOMP] = CLAMP( a, 0, CHAN_MAX ); } + } + + /* store colors */ + for (buffer = 0; buffer < fb->_NumColorDrawBuffers[0]; buffer++) { + struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[0][buffer]; + if (masking) { + _swrast_mask_rgba_array(ctx, rb, width, xpos, ypos + i, rgba); + } +#if OLD_RENDERBUFFER + if (swrast->Driver.WriteRGBASpan) + swrast->Driver.WriteRGBASpan(ctx, rb, width, xpos, ypos + i, + (const GLchan (*)[4]) rgba, NULL); + else +#endif + rb->PutRow(ctx, rb, width, xpos, ypos + i, rgba, NULL); + } + } + } + else { + /* other types someday */ + } +} + + + +/** + * Software fallback for glAccum. + */ +void +_swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value, + GLint xpos, GLint ypos, + GLint width, GLint height ) + +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + + if (SWRAST_CONTEXT(ctx)->NewState) + _swrast_validate_derived( ctx ); + + if (!ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer) { + _mesa_warning(ctx, "Calling glAccum() without an accumulation buffer"); + return; + } + + RENDER_START(swrast, ctx); + + switch (op) { + case GL_ADD: + if (value != 0.0F) { + accum_add(ctx, value, xpos, ypos, width, height); } - RENDER_FINISH(swrast,ctx); break; - + case GL_MULT: + if (value != 1.0F) { + accum_mult(ctx, value, xpos, ypos, width, height); + } + break; + case GL_ACCUM: + if (value != 0.0F) { + accum_accum(ctx, value, xpos, ypos, width, height); + } + break; + case GL_LOAD: + accum_load(ctx, value, xpos, ypos, width, height); + break; + case GL_RETURN: + accum_return(ctx, value, xpos, ypos, width, height); + break; default: - _mesa_error( ctx, GL_INVALID_ENUM, "glAccum" ); + _mesa_problem(ctx, "invalid mode in _swrast_Accum()"); + break; } + + RENDER_FINISH(swrast, ctx); } diff --git a/src/mesa/swrast/s_accum.h b/src/mesa/swrast/s_accum.h index ac84fdec95b..97d2bef4c31 100644 --- a/src/mesa/swrast/s_accum.h +++ b/src/mesa/swrast/s_accum.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.0.1 + * Version: 6.3 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -28,15 +28,10 @@ #include "mtypes.h" -#include "swrast.h" extern void -_swrast_alloc_accum_buffer( GLframebuffer *buffer ); - - -extern void -_swrast_clear_accum_buffer( GLcontext *ctx ); +_swrast_clear_accum_buffer(GLcontext *ctx, struct gl_renderbuffer *rb); #endif diff --git a/src/mesa/swrast/s_alphabuf.c b/src/mesa/swrast/s_alphabuf.c deleted file mode 100644 index 5d8107c2d6b..00000000000 --- a/src/mesa/swrast/s_alphabuf.c +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2004 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. - */ - - -/* - * Software alpha planes. Many frame buffers don't have alpha bits so - * we simulate them in software. - */ - - -#include "glheader.h" -#include "colormac.h" -#include "context.h" -#include "imports.h" - -#include "s_context.h" -#include "s_alphabuf.h" - - -/* - * Allocate a new front and back alpha buffer. - */ -void -_swrast_alloc_alpha_buffers( GLframebuffer *buffer ) -{ - const GLint bytes = buffer->Width * buffer->Height * sizeof(GLchan); - - ASSERT(buffer->UseSoftwareAlphaBuffers); - - if (buffer->FrontLeftAlpha) { - MESA_PBUFFER_FREE( buffer->FrontLeftAlpha ); - } - buffer->FrontLeftAlpha = (GLchan *) MESA_PBUFFER_ALLOC( bytes ); - if (!buffer->FrontLeftAlpha) { - /* out of memory */ - _mesa_error( NULL, GL_OUT_OF_MEMORY, - "Couldn't allocate front-left alpha buffer" ); - } - - if (buffer->Visual.doubleBufferMode) { - if (buffer->BackLeftAlpha) { - MESA_PBUFFER_FREE( buffer->BackLeftAlpha ); - } - buffer->BackLeftAlpha = (GLchan *) MESA_PBUFFER_ALLOC( bytes ); - if (!buffer->BackLeftAlpha) { - /* out of memory */ - _mesa_error( NULL, GL_OUT_OF_MEMORY, - "Couldn't allocate back-left alpha buffer" ); - } - } - - if (buffer->Visual.stereoMode) { - if (buffer->FrontRightAlpha) { - MESA_PBUFFER_FREE( buffer->FrontRightAlpha ); - } - buffer->FrontRightAlpha = (GLchan *) MESA_PBUFFER_ALLOC( bytes ); - if (!buffer->FrontRightAlpha) { - /* out of memory */ - _mesa_error( NULL, GL_OUT_OF_MEMORY, - "Couldn't allocate front-right alpha buffer" ); - } - - if (buffer->Visual.doubleBufferMode) { - if (buffer->BackRightAlpha) { - MESA_PBUFFER_FREE( buffer->BackRightAlpha ); - } - buffer->BackRightAlpha = (GLchan *) MESA_PBUFFER_ALLOC( bytes ); - if (!buffer->BackRightAlpha) { - /* out of memory */ - _mesa_error( NULL, GL_OUT_OF_MEMORY, - "Couldn't allocate back-right alpha buffer" ); - } - } - } -} - - -/* - * Clear all the alpha buffers - */ -void -_swrast_clear_alpha_buffers( GLcontext *ctx ) -{ - GLchan aclear; - GLuint bufferBit; - - CLAMPED_FLOAT_TO_CHAN(aclear, ctx->Color.ClearColor[3]); - - ASSERT(ctx->DrawBuffer->UseSoftwareAlphaBuffers); - ASSERT(ctx->Color.ColorMask[ACOMP]); - - /* loop over four possible alpha buffers */ - for (bufferBit = 1; bufferBit <= 8; bufferBit = bufferBit << 1) { - if (bufferBit & ctx->Color._DrawDestMask[0]) { - GLchan *buffer; - if (bufferBit == DD_FRONT_LEFT_BIT) { - buffer = ctx->DrawBuffer->FrontLeftAlpha; - } - else if (bufferBit == DD_FRONT_RIGHT_BIT) { - buffer = ctx->DrawBuffer->FrontRightAlpha; - } - else if (bufferBit == DD_BACK_LEFT_BIT) { - buffer = ctx->DrawBuffer->BackLeftAlpha; - } - else { - buffer = ctx->DrawBuffer->BackRightAlpha; - } - - if (ctx->Scissor.Enabled) { - /* clear scissor region */ - GLint j; - GLint rowLen = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - GLint rows = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - GLint width = ctx->DrawBuffer->Width; - GLchan *aptr = buffer - + ctx->DrawBuffer->_Ymin * ctx->DrawBuffer->Width - + ctx->DrawBuffer->_Xmin; - for (j = 0; j < rows; j++) { -#if CHAN_BITS == 8 - MEMSET( aptr, aclear, rowLen ); -#elif CHAN_BITS == 16 - MEMSET16( aptr, aclear, rowLen ); -#else - GLint i; - for (i = 0; i < rowLen; i++) { - aptr[i] = aclear; - } -#endif - aptr += width; - } - } - else { - /* clear whole buffer */ - GLuint pixels = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height; -#if CHAN_BITS == 8 - MEMSET(buffer, aclear, pixels); -#elif CHAN_BITS == 16 - MEMSET16(buffer, aclear, pixels); -#else - GLuint i; - for (i = 0; i < pixels; i++) { - buffer[i] = aclear; - } -#endif - } - } - } -} - - - -static INLINE -GLchan *get_alpha_buffer( GLcontext *ctx ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - switch (swrast->CurrentBufferBit) { - case DD_FRONT_LEFT_BIT: - return ctx->DrawBuffer->FrontLeftAlpha; - case DD_BACK_LEFT_BIT: - return ctx->DrawBuffer->BackLeftAlpha; - case DD_FRONT_RIGHT_BIT: - return ctx->DrawBuffer->FrontRightAlpha; - case DD_BACK_RIGHT_BIT: - return ctx->DrawBuffer->BackRightAlpha; - default: - _mesa_problem(ctx, "Bad CurrentBuffer in get_alpha_buffer()"); - return (GLchan *) ctx->DrawBuffer->FrontLeftAlpha; - } -} - - -void -_swrast_write_alpha_span( GLcontext *ctx, GLuint n, GLint x, GLint y, - CONST GLchan rgba[][4], const GLubyte mask[] ) -{ - GLchan *buffer, *aptr; - GLuint i; - - buffer = get_alpha_buffer(ctx); - aptr = buffer + y * ctx->DrawBuffer->Width + x; - - if (mask) { - for (i=0;iDrawBuffer->Width + x; - - if (mask) { - for (i=0;iDrawBuffer->Width + x[i]; - *aptr = rgba[i][ACOMP]; - } - } - } - else { - for (i=0;iDrawBuffer->Width + x[i]; - *aptr = rgba[i][ACOMP]; - } - } -} - - -void -_swrast_write_mono_alpha_pixels( GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - GLchan alpha, const GLubyte mask[] ) -{ - GLchan *buffer; - GLuint i; - - buffer = get_alpha_buffer(ctx); - - if (mask) { - for (i=0;iDrawBuffer->Width + x[i]; - *aptr = alpha; - } - } - } - else { - for (i=0;iDrawBuffer->Width + x[i]; - *aptr = alpha; - } - } -} - - - -void -_swrast_read_alpha_span( GLcontext *ctx, - GLuint n, GLint x, GLint y, GLchan rgba[][4] ) -{ - const GLchan *buffer, *aptr; - GLuint i; - - buffer = get_alpha_buffer(ctx); - aptr = buffer + y * ctx->DrawBuffer->Width + x; - - for (i = 0; i < n; i++) - rgba[i][ACOMP] = *aptr++; -} - - -void -_swrast_read_alpha_pixels( GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - GLchan rgba[][4], const GLubyte mask[] ) -{ - const GLchan *buffer; - GLuint i; - - buffer = get_alpha_buffer(ctx); - - for (i = 0; i < n; i++) { - if (mask[i]) { - const GLchan *aptr = buffer + y[i] * ctx->DrawBuffer->Width + x[i]; - rgba[i][ACOMP] = *aptr; - } - } -} diff --git a/src/mesa/swrast/s_alphabuf.h b/src/mesa/swrast/s_alphabuf.h deleted file mode 100644 index f09bb91adbe..00000000000 --- a/src/mesa/swrast/s_alphabuf.h +++ /dev/null @@ -1,80 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 4.0.2 - * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * 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. - */ - - -#ifndef S_ALPHABUF_H -#define S_ALPHABUF_H - - -#include "mtypes.h" -#include "swrast.h" - - -extern void -_swrast_alloc_alpha_buffers( GLframebuffer *buffer ); - - -extern void -_swrast_clear_alpha_buffers( GLcontext *ctx ); - - -extern void -_swrast_write_alpha_span( GLcontext *ctx, GLuint n, GLint x, GLint y, - CONST GLchan rgba[][4], const GLubyte mask[] ); - - -extern void -_swrast_write_mono_alpha_span( GLcontext *ctx, - GLuint n, GLint x, GLint y, - GLchan alpha, const GLubyte mask[] ); - - - -extern void -_swrast_write_alpha_pixels( GLcontext* ctx, - GLuint n, const GLint x[], const GLint y[], - CONST GLchan rgba[][4], - const GLubyte mask[] ); - - -extern void -_swrast_write_mono_alpha_pixels( GLcontext* ctx, - GLuint n, const GLint x[], - const GLint y[], GLchan alpha, - const GLubyte mask[] ); - - -extern void -_swrast_read_alpha_span( GLcontext* ctx, - GLuint n, GLint x, GLint y, GLchan rgba[][4] ); - - -extern void -_swrast_read_alpha_pixels( GLcontext* ctx, - GLuint n, const GLint x[], const GLint y[], - GLchan rgba[][4], const GLubyte mask[] ); - - -#endif diff --git a/src/mesa/swrast/s_auxbuffer.c b/src/mesa/swrast/s_auxbuffer.c deleted file mode 100644 index b2224c8884b..00000000000 --- a/src/mesa/swrast/s_auxbuffer.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2004 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. - */ - - -#include "glheader.h" -#include "imports.h" - -#include "s_auxbuffer.h" -#include "s_context.h" - - - -/** - * Allocate memory for the software auxillary buffers associated with - * the given GLframebuffer. Free any currently allocated aux buffers - * first. - */ -void -_swrast_alloc_aux_buffers( GLframebuffer *buffer ) -{ - GLint i; - - ASSERT(buffer->UseSoftwareAuxBuffers); - - for (i = 0; i < buffer->Visual.numAuxBuffers; i++) { - if (buffer->AuxBuffers[i]) { - _mesa_free(buffer->AuxBuffers[i]); - buffer->AuxBuffers[i] = NULL; - } - - buffer->AuxBuffers[i] = (GLchan *) _mesa_malloc(buffer->Width - * buffer->Height * 4 * sizeof(GLchan)); - } -} - - - -/* RGBA */ -#define NAME(PREFIX) PREFIX##_aux -#define SPAN_VARS \ - const SWcontext *swrast = SWRAST_CONTEXT(ctx); -#define INIT_PIXEL_PTR(P, X, Y) \ - GLchan *P = swrast->CurAuxBuffer + ((Y) * ctx->DrawBuffer->Width + (X)) * 4; \ - assert(swrast->CurAuxBuffer); - -#define INC_PIXEL_PTR(P) P += 4 -#if CHAN_TYPE == GL_FLOAT -#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ - P[0] = MAX2((R), 0.0F); \ - P[1] = MAX2((G), 0.0F); \ - P[2] = MAX2((B), 0.0F); \ - P[3] = CHAN_MAXF -#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ - P[0] = MAX2((R), 0.0F); \ - P[1] = MAX2((G), 0.0F); \ - P[2] = MAX2((B), 0.0F); \ - P[3] = CLAMP((A), 0.0F, CHAN_MAXF) -#else -#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \ - P[0] = R; P[1] = G; P[2] = B; P[3] = CHAN_MAX -#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \ - P[0] = R; P[1] = G; P[2] = B; P[3] = A -#endif -#define FETCH_RGBA_PIXEL(R, G, B, A, P) \ - R = P[0]; G = P[1]; B = P[2]; A = P[3] -#include "swrast/s_spantemp.h" - - - -/** - * Called from driver's SetBuffer() function to choose an aux buffer. - */ -void -_swrast_use_aux_buffer(GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - (void) buffer; - - switch (bufferBit) { - case DD_AUX0_BIT: - ASSERT(buffer->Visual.numAuxBuffers >= 1); - swrast->CurAuxBuffer = ctx->DrawBuffer->AuxBuffers[0]; - break; - case DD_AUX1_BIT: - ASSERT(buffer->Visual.numAuxBuffers >= 2); - swrast->CurAuxBuffer = ctx->DrawBuffer->AuxBuffers[1]; - break; - case DD_AUX2_BIT: - ASSERT(buffer->Visual.numAuxBuffers >= 3); - swrast->CurAuxBuffer = ctx->DrawBuffer->AuxBuffers[2]; - break; - case DD_AUX3_BIT: - ASSERT(buffer->Visual.numAuxBuffers >= 4); - swrast->CurAuxBuffer = ctx->DrawBuffer->AuxBuffers[3]; - break; - default: - swrast->CurAuxBuffer = NULL; - } - - swrast->Driver.WriteRGBASpan = write_rgba_span_aux; - swrast->Driver.WriteRGBSpan = write_rgb_span_aux; - swrast->Driver.WriteMonoRGBASpan = write_monorgba_span_aux; - swrast->Driver.WriteRGBAPixels = write_rgba_pixels_aux; - swrast->Driver.WriteMonoRGBAPixels = write_monorgba_pixels_aux; - swrast->Driver.ReadRGBASpan = read_rgba_span_aux; - swrast->Driver.ReadRGBAPixels = read_rgba_pixels_aux; -} - diff --git a/src/mesa/swrast/s_auxbuffer.h b/src/mesa/swrast/s_auxbuffer.h deleted file mode 100644 index 48fb6951a18..00000000000 --- a/src/mesa/swrast/s_auxbuffer.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2004 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. - */ - - -#ifndef S_AUXBUFFER_H -#define S_AUXBUFFER_H - - -#include "context.h" - - -extern void -_swrast_alloc_aux_buffers( GLframebuffer *buffer ); - - -extern void -_swrast_use_aux_buffer(GLcontext *ctx, GLframebuffer *buffr, GLuint bufferBit); - - -#endif /* S_AUXBUFFER_H */ diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c index 1001d6f2124..f15c95710dc 100644 --- a/src/mesa/swrast/s_blend.c +++ b/src/mesa/swrast/s_blend.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.0 + * Version: 6.3 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -37,7 +37,6 @@ #include "colormac.h" #include "macros.h" -#include "s_alphabuf.h" #include "s_blend.h" #include "s_context.h" #include "s_span.h" @@ -847,8 +846,8 @@ void _swrast_choose_blend_func( GLcontext *ctx ) * pixel coordinates. */ void -_swrast_blend_span( GLcontext *ctx, const struct sw_span *span, - GLchan rgba[][4] ) +_swrast_blend_span(GLcontext *ctx, struct gl_renderbuffer *rb, + const struct sw_span *span, GLchan rgba[][4]) { SWcontext *swrast = SWRAST_CONTEXT(ctx); GLchan framebuffer[MAX_WIDTH][4]; @@ -860,19 +859,20 @@ _swrast_blend_span( GLcontext *ctx, const struct sw_span *span, /* Read span of current frame buffer pixels */ if (span->arrayMask & SPAN_XY) { /* array of x/y pixel coords */ - (*swrast->Driver.ReadRGBAPixels)( ctx, span->end, +#if OLD_RENDERBUFFER + if (swrast->Driver.ReadRGBAPixels) + (*swrast->Driver.ReadRGBAPixels)( ctx, rb, span->end, span->array->x, span->array->y, framebuffer, span->array->mask ); - if (swrast->_RasterMask & ALPHABUF_BIT) { - _swrast_read_alpha_pixels( ctx, span->end, - span->array->x, span->array->y, - framebuffer, span->array->mask ); - } + else +#endif + rb->GetValues(ctx, rb, span->end, span->array->x, span->array->y, + framebuffer); } else { /* horizontal run of pixels */ - _swrast_read_rgba_span( ctx, ctx->DrawBuffer, span->end, - span->x, span->y, framebuffer ); + _swrast_read_rgba_span(ctx, rb, span->end, span->x, span->y, + framebuffer); } SWRAST_CONTEXT(ctx)->BlendFunc( ctx, span->end, span->array->mask, rgba, diff --git a/src/mesa/swrast/s_blend.h b/src/mesa/swrast/s_blend.h index 11bf378e319..c9519321521 100644 --- a/src/mesa/swrast/s_blend.h +++ b/src/mesa/swrast/s_blend.h @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 4.1 + * Version: 6.3 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -32,14 +31,13 @@ #include "s_context.h" - extern void -_swrast_blend_span( GLcontext *ctx, const struct sw_span *span, - GLchan rgba[][4] ); +_swrast_blend_span(GLcontext *ctx, struct gl_renderbuffer *rb, + const struct sw_span *span, GLchan rgba[][4]); extern void -_swrast_choose_blend_func( GLcontext *ctx ); +_swrast_choose_blend_func(GLcontext *ctx); #endif diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c index d05c8dfbf9b..cf469f8c626 100644 --- a/src/mesa/swrast/s_buffers.c +++ b/src/mesa/swrast/s_buffers.c @@ -2,7 +2,7 @@ * Mesa 3-D graphics library * Version: 6.3 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -27,10 +27,10 @@ #include "colormac.h" #include "macros.h" #include "imports.h" +#include "mtypes.h" +#include "fbobject.h" #include "s_accum.h" -#include "s_alphabuf.h" -#include "s_auxbuffer.h" #include "s_context.h" #include "s_depth.h" #include "s_masking.h" @@ -38,98 +38,190 @@ /** - * Clear the color buffer when glColorMask or glIndexMask is in effect. - * We'll have specified which color buffer to clear by previously - * calling Driver.SetBuffer(). + * Clear the color buffer when glColorMask is in effect. */ static void -clear_color_buffer_with_masking( GLcontext *ctx ) +clear_rgba_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb) { SWcontext *swrast = SWRAST_CONTEXT(ctx); const GLint x = ctx->DrawBuffer->_Xmin; const GLint y = ctx->DrawBuffer->_Ymin; const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; + GLchan clearColor[4]; + GLint i; - if (ctx->Visual.rgbMode) { - /* RGBA mode */ - GLchan clearColor[4]; - GLint i; - CLAMPED_FLOAT_TO_CHAN(clearColor[RCOMP], ctx->Color.ClearColor[0]); - CLAMPED_FLOAT_TO_CHAN(clearColor[GCOMP], ctx->Color.ClearColor[1]); - CLAMPED_FLOAT_TO_CHAN(clearColor[BCOMP], ctx->Color.ClearColor[2]); - CLAMPED_FLOAT_TO_CHAN(clearColor[ACOMP], ctx->Color.ClearColor[3]); - for (i = 0; i < height; i++) { - GLchan rgba[MAX_WIDTH][4]; - GLint j; - for (j = 0; j < width; j++) { - COPY_CHAN4(rgba[j], clearColor); - } - _swrast_mask_rgba_array( ctx, width, x, y + i, rgba ); - (*swrast->Driver.WriteRGBASpan)( ctx, width, x, y + i, - (CONST GLchan (*)[4]) rgba, NULL ); + ASSERT(ctx->Visual.rgbMode); + + CLAMPED_FLOAT_TO_CHAN(clearColor[RCOMP], ctx->Color.ClearColor[0]); + CLAMPED_FLOAT_TO_CHAN(clearColor[GCOMP], ctx->Color.ClearColor[1]); + CLAMPED_FLOAT_TO_CHAN(clearColor[BCOMP], ctx->Color.ClearColor[2]); + CLAMPED_FLOAT_TO_CHAN(clearColor[ACOMP], ctx->Color.ClearColor[3]); + + for (i = 0; i < height; i++) { + GLchan rgba[MAX_WIDTH][4]; + GLint j; + for (j = 0; j < width; j++) { + COPY_CHAN4(rgba[j], clearColor); } + _swrast_mask_rgba_array( ctx, rb, width, x, y + i, rgba ); +#if NEW_RENDERBUFFER + if (rb->PutRow) { + rb->PutRow(ctx, rb, width, x, y + i, rgba, NULL); + } +#endif +#if OLD_RENDERBUFFER + else { + swrast->Driver.WriteRGBASpan(ctx, rb, width, x, y + i, + (CONST GLchan (*)[4]) rgba, NULL); + } +#endif } - else { - /* Color index mode */ - GLuint span[MAX_WIDTH]; - GLubyte mask[MAX_WIDTH]; - GLint i, j; - MEMSET( mask, 1, width ); - for (i=0;iColor.ClearIndex; - } - _swrast_mask_index_array( ctx, width, x, y + i, span ); - (*swrast->Driver.WriteCI32Span)( ctx, width, x, y + i, span, mask ); +} + + +/** + * Clear color index buffer with masking. + */ +static void +clear_ci_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb) +{ + const GLint x = ctx->DrawBuffer->_Xmin; + const GLint y = ctx->DrawBuffer->_Ymin; + const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; + const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; + GLuint span[MAX_WIDTH]; + GLubyte mask[MAX_WIDTH]; + GLint i, j; + + ASSERT(!ctx->Visual.rgbMode); + + MEMSET( mask, 1, width ); + for (i = 0; i < height;i++) { + for (j = 0; j < width;j++) { + span[j] = ctx->Color.ClearIndex; } + _swrast_mask_ci_array(ctx, rb, width, x, y + i, span); + ASSERT(rb->PutRow); + ASSERT(rb->DataType == GL_UNSIGNED_INT); + rb->PutRow(ctx, rb, width, x, y + i, span, mask); } } /** - * Clear a color buffer without index/channel masking. - * We'll have specified which color buffer to clear by previously - * calling Driver.SetBuffer(). + * Clear an rgba color buffer without channel masking. */ static void -clear_color_buffer(GLcontext *ctx) +clear_rgba_buffer(GLcontext *ctx, struct gl_renderbuffer *rb) { SWcontext *swrast = SWRAST_CONTEXT(ctx); const GLint x = ctx->DrawBuffer->_Xmin; const GLint y = ctx->DrawBuffer->_Ymin; const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - - if (ctx->Visual.rgbMode) { - /* RGBA mode */ + GLint i; + + ASSERT(ctx->Visual.rgbMode); + + ASSERT(ctx->Color.ColorMask[0] && + ctx->Color.ColorMask[1] && + ctx->Color.ColorMask[2] && + ctx->Color.ColorMask[3]); + +#if NEW_RENDERBUFFER + if (rb->PutMonoRow) { /* XXX assert this */ + GLubyte clear8[4]; + GLushort clear16[4]; + GLvoid *clearVal; + switch (rb->DataType) { + case GL_UNSIGNED_BYTE: + clear8[0] = FLOAT_TO_UBYTE(ctx->Color.ClearColor[0]); + clear8[1] = FLOAT_TO_UBYTE(ctx->Color.ClearColor[1]); + clear8[2] = FLOAT_TO_UBYTE(ctx->Color.ClearColor[2]); + clear8[3] = FLOAT_TO_UBYTE(ctx->Color.ClearColor[3]); + clearVal = clear8; + break; + case GL_UNSIGNED_SHORT: + clear16[0] = FLOAT_TO_USHORT(ctx->Color.ClearColor[0]); + clear16[1] = FLOAT_TO_USHORT(ctx->Color.ClearColor[1]); + clear16[2] = FLOAT_TO_USHORT(ctx->Color.ClearColor[2]); + clear16[3] = FLOAT_TO_USHORT(ctx->Color.ClearColor[3]); + clearVal = clear16; + break; + case GL_FLOAT: + clearVal = ctx->Color.ClearColor; + break; + default: + _mesa_problem(ctx, "Bad rb DataType in clear_color_buffer"); + return; + } + for (i = 0; i < height; i++) { + rb->PutMonoRow(ctx, rb, width, x, y + i, clearVal, NULL); + } + } +#endif +#if OLD_RENDERBUFFER + else { GLchan clearColor[4]; - GLint i; - CLAMPED_FLOAT_TO_CHAN(clearColor[RCOMP], ctx->Color.ClearColor[0]); CLAMPED_FLOAT_TO_CHAN(clearColor[GCOMP], ctx->Color.ClearColor[1]); CLAMPED_FLOAT_TO_CHAN(clearColor[BCOMP], ctx->Color.ClearColor[2]); CLAMPED_FLOAT_TO_CHAN(clearColor[ACOMP], ctx->Color.ClearColor[3]); - - ASSERT(*((GLuint *) &ctx->Color.ColorMask) == 0xffffffff); ASSERT(swrast->Driver.WriteRGBASpan); - for (i = 0; i < height; i++) { - (*swrast->Driver.WriteMonoRGBASpan)( ctx, width, x, y + i, - clearColor, NULL ); + swrast->Driver.WriteMonoRGBASpan(ctx, rb, width, x, y + i, + clearColor, NULL ); } } - else { - /* Color index mode */ +#endif +} + + +/** + * Clear color index buffer without masking. + */ +static void +clear_ci_buffer(GLcontext *ctx, struct gl_renderbuffer *rb) +{ + const GLint x = ctx->DrawBuffer->_Xmin; + const GLint y = ctx->DrawBuffer->_Ymin; + const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; + const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; + + ASSERT(!ctx->Visual.rgbMode); + + ASSERT((ctx->Color.IndexMask & ((1 << ctx->Visual.indexBits) - 1)) + == (GLuint) ((1 << ctx->Visual.indexBits) - 1)); + +#if NEW_RENDERBUFFER + if (rb->PutMonoRow) { /* XXX assert this */ + GLubyte clear8; + GLushort clear16; + GLuint clear32; + GLvoid *clearVal; GLint i; - ASSERT((ctx->Color.IndexMask & ((1 << ctx->Visual.indexBits) - 1)) - == (GLuint) ((1 << ctx->Visual.indexBits) - 1)); - ASSERT(swrast->Driver.WriteMonoCISpan); - for (i = 0; i < height; i++) { - (*swrast->Driver.WriteMonoCISpan)( ctx, width, x, y + i, - ctx->Color.ClearIndex, NULL); + switch (rb->DataType) { + case GL_UNSIGNED_BYTE: + clear8 = (GLubyte) ctx->Color.ClearIndex; + clearVal = &clear8; + break; + case GL_UNSIGNED_SHORT: + clear16 = (GLushort) ctx->Color.ClearIndex; + clearVal = &clear16; + break; + case GL_UNSIGNED_INT: + clear32 = ctx->Color.ClearIndex; + clearVal = &clear32; + break; + default: + _mesa_problem(ctx, "Bad rb DataType in clear_color_buffer"); + return; } + for (i = 0; i < height; i++) + rb->PutMonoRow(ctx, rb, width, x, y + i, clearVal, NULL); } +#endif } @@ -141,20 +233,46 @@ clear_color_buffer(GLcontext *ctx) static void clear_color_buffers(GLcontext *ctx) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask); - GLuint bufferBit; + GLboolean masking; + GLuint i; - /* loop over four possible dest color buffers */ - for (bufferBit = 1; bufferBit <= DD_AUX3_BIT; bufferBit <<= 1) { - if (bufferBit & ctx->Color._DrawDestMask[0]) { - (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit); + if (ctx->Visual.rgbMode) { + if (ctx->Color.ColorMask[0] && + ctx->Color.ColorMask[1] && + ctx->Color.ColorMask[2] && + ctx->Color.ColorMask[3]) { + masking = GL_FALSE; + } + else { + masking = GL_TRUE; + } + } + else { + const GLuint indexBits = (1 << ctx->Visual.indexBits) - 1; + if ((ctx->Color.IndexMask & indexBits) == indexBits) { + masking = GL_FALSE; + } + else { + masking = GL_TRUE; + } + } - if (colorMask != 0xffffffff) { - clear_color_buffer_with_masking(ctx); + for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers[0]; i++) { + struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][i]; + if (ctx->Visual.rgbMode) { + if (masking) { + clear_rgba_buffer_with_masking(ctx, rb); } else { - clear_color_buffer(ctx); + clear_rgba_buffer(ctx, rb); + } + } + else { + if (masking) { + clear_ci_buffer_with_masking(ctx, rb); + } + else { + clear_ci_buffer(ctx, rb); } } } @@ -171,26 +289,27 @@ clear_color_buffers(GLcontext *ctx) * \param all if GL_TRUE, clear whole buffer, else clear specified region. */ void -_swrast_Clear( GLcontext *ctx, GLbitfield mask, - GLboolean all, - GLint x, GLint y, GLint width, GLint height ) +_swrast_Clear(GLcontext *ctx, GLbitfield mask, + GLboolean all, GLint x, GLint y, GLint width, GLint height) { SWcontext *swrast = SWRAST_CONTEXT(ctx); + (void) all; (void) x; (void) y; (void) width; (void) height; -#ifdef DEBUG + +#ifdef DEBUG_FOO { const GLbitfield legalBits = - DD_FRONT_LEFT_BIT | - DD_FRONT_RIGHT_BIT | - DD_BACK_LEFT_BIT | - DD_BACK_RIGHT_BIT | - DD_DEPTH_BIT | - DD_STENCIL_BIT | - DD_ACCUM_BIT | - DD_AUX0_BIT | - DD_AUX1_BIT | - DD_AUX2_BIT | - DD_AUX3_BIT; + BUFFER_BIT_FRONT_LEFT | + BUFFER_BIT_FRONT_RIGHT | + BUFFER_BIT_BACK_LEFT | + BUFFER_BIT_BACK_RIGHT | + BUFFER_BIT_DEPTH | + BUFFER_BIT_STENCIL | + BUFFER_BIT_ACCUM | + BUFFER_BIT_AUX0 | + BUFFER_BIT_AUX1 | + BUFFER_BIT_AUX2 | + BUFFER_BIT_AUX3; assert((mask & (~legalBits)) == 0); } #endif @@ -199,22 +318,30 @@ _swrast_Clear( GLcontext *ctx, GLbitfield mask, /* do software clearing here */ if (mask) { - if (mask & ctx->Color._DrawDestMask[0]) { + if (mask & ctx->DrawBuffer->_ColorDrawBufferMask[0]) { clear_color_buffers(ctx); /* clear software-based alpha buffer(s) */ +#if OLD_RENDERBUFFER && 0 if (ctx->DrawBuffer->UseSoftwareAlphaBuffers && ctx->Color.ColorMask[ACOMP]) { _swrast_clear_alpha_buffers( ctx ); } +#endif } - if (mask & DD_DEPTH_BIT) { - _swrast_clear_depth_buffer(ctx); + if (mask & BUFFER_BIT_DEPTH) { + struct gl_renderbuffer *rb + = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; + _swrast_clear_depth_buffer(ctx, rb); } - if (mask & DD_ACCUM_BIT) { - _swrast_clear_accum_buffer(ctx); + if (mask & BUFFER_BIT_ACCUM) { + struct gl_renderbuffer *rb + = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer; + _swrast_clear_accum_buffer(ctx, rb); } - if (mask & DD_STENCIL_BIT) { - _swrast_clear_stencil_buffer(ctx); + if (mask & BUFFER_BIT_STENCIL) { + struct gl_renderbuffer *rb + = ctx->DrawBuffer->Attachment[BUFFER_STENCIL].Renderbuffer; + _swrast_clear_stencil_buffer(ctx, rb); } } @@ -222,33 +349,6 @@ _swrast_Clear( GLcontext *ctx, GLbitfield mask, } -/** - * Typically called via ctx->Driver.ResizeBuffers(). - * Reallocate all software-based depth/stencil/accum/etc buffers - * to match current window dimensions. - */ -void -_swrast_alloc_buffers( GLframebuffer *buffer ) -{ - /* Reallocate other buffers if needed. */ - if (buffer->UseSoftwareDepthBuffer) { - _swrast_alloc_depth_buffer( buffer ); - } - if (buffer->UseSoftwareStencilBuffer) { - _swrast_alloc_stencil_buffer( buffer ); - } - if (buffer->UseSoftwareAccumBuffer) { - _swrast_alloc_accum_buffer( buffer ); - } - if (buffer->UseSoftwareAlphaBuffers) { - _swrast_alloc_alpha_buffers( buffer ); - } - if (buffer->UseSoftwareAuxBuffers) { - _swrast_alloc_aux_buffers( buffer ); - } -} - - /* * Fallback for ctx->Driver.DrawBuffer() */ @@ -281,7 +381,7 @@ _swrast_use_read_buffer( GLcontext *ctx ) SWcontext *swrast = SWRAST_CONTEXT(ctx); /* Do this so the software-emulated alpha plane span functions work! */ - swrast->CurrentBufferBit = ctx->Pixel._ReadSrcMask; + swrast->CurrentBufferBit = ctx->ReadBuffer->_ColorReadBufferMask; /* Tell the device driver where to read/write spans */ swrast->Driver.SetBuffer(ctx, ctx->ReadBuffer, swrast->CurrentBufferBit); } @@ -307,25 +407,25 @@ _swrast_use_draw_buffer( GLcontext *ctx ) * we loop over multiple color buffers when needed. */ - if (ctx->Color._DrawDestMask[0] & DD_FRONT_LEFT_BIT) - swrast->CurrentBufferBit = DD_FRONT_LEFT_BIT; - else if (ctx->Color._DrawDestMask[0] & DD_BACK_LEFT_BIT) - swrast->CurrentBufferBit = DD_BACK_LEFT_BIT; - else if (ctx->Color._DrawDestMask[0] & DD_FRONT_RIGHT_BIT) - swrast->CurrentBufferBit = DD_FRONT_RIGHT_BIT; - else if (ctx->Color._DrawDestMask[0] & DD_BACK_RIGHT_BIT) - swrast->CurrentBufferBit = DD_BACK_RIGHT_BIT; - else if (ctx->Color._DrawDestMask[0] & DD_AUX0_BIT) - swrast->CurrentBufferBit = DD_AUX0_BIT; - else if (ctx->Color._DrawDestMask[0] & DD_AUX1_BIT) - swrast->CurrentBufferBit = DD_AUX1_BIT; - else if (ctx->Color._DrawDestMask[0] & DD_AUX2_BIT) - swrast->CurrentBufferBit = DD_AUX2_BIT; - else if (ctx->Color._DrawDestMask[0] & DD_AUX3_BIT) - swrast->CurrentBufferBit = DD_AUX3_BIT; + if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_FRONT_LEFT) + swrast->CurrentBufferBit = BUFFER_BIT_FRONT_LEFT; + else if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_BACK_LEFT) + swrast->CurrentBufferBit = BUFFER_BIT_BACK_LEFT; + else if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_FRONT_RIGHT) + swrast->CurrentBufferBit = BUFFER_BIT_FRONT_RIGHT; + else if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_BACK_RIGHT) + swrast->CurrentBufferBit = BUFFER_BIT_BACK_RIGHT; + else if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_AUX0) + swrast->CurrentBufferBit = BUFFER_BIT_AUX0; + else if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_AUX1) + swrast->CurrentBufferBit = BUFFER_BIT_AUX1; + else if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_AUX2) + swrast->CurrentBufferBit = BUFFER_BIT_AUX2; + else if (ctx->DrawBuffer->_ColorDrawBufferMask[0] & BUFFER_BIT_AUX3) + swrast->CurrentBufferBit = BUFFER_BIT_AUX3; else /* glDrawBuffer(GL_NONE) */ - swrast->CurrentBufferBit = DD_FRONT_LEFT_BIT; /* we always have this buffer */ + swrast->CurrentBufferBit = BUFFER_BIT_FRONT_LEFT; /* we always have this buffer */ swrast->Driver.SetBuffer(ctx, ctx->DrawBuffer, swrast->CurrentBufferBit); } diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index f6dcdbb9644..00c4ae4bc9c 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -73,11 +73,6 @@ _swrast_update_rasterflags( GLcontext *ctx ) if (ctx->Color.IndexLogicOpEnabled) rasterMask |= LOGIC_OP_BIT; } - if (ctx->DrawBuffer->UseSoftwareAlphaBuffers - && ctx->Color.ColorMask[ACOMP] - && ctx->Color.DrawBuffer != GL_NONE) - rasterMask |= ALPHABUF_BIT; - if ( ctx->Viewport.X < 0 || ctx->Viewport.X + ctx->Viewport.Width > (GLint) ctx->DrawBuffer->Width || ctx->Viewport.Y < 0 @@ -93,7 +88,9 @@ _swrast_update_rasterflags( GLcontext *ctx ) * MULTI_DRAW_BIT flag. Also set it if we're drawing to no * buffers or the RGBA or CI mask disables all writes. */ - if (_mesa_bitcount(ctx->Color._DrawDestMask[0]) != 1) { +#if NEW_RENDERBUFFER + if (ctx->DrawBuffer->_NumColorDrawBuffers[0] != 1) { +#endif /* more than one color buffer designated for writing (or zero buffers) */ rasterMask |= MULTI_DRAW_BIT; } @@ -446,26 +443,6 @@ _swrast_invalidate_state( GLcontext *ctx, GLuint new_state ) if (new_state & _SWRAST_NEW_TEXTURE_SAMPLE_FUNC) for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) swrast->TextureSample[i] = _swrast_validate_texture_sample; - - /* Debug checks */ - if (ctx->Visual.rgbMode) { - ASSERT(swrast->Driver.WriteRGBASpan); - ASSERT(swrast->Driver.WriteRGBSpan); - ASSERT(swrast->Driver.WriteMonoRGBASpan); - ASSERT(swrast->Driver.WriteRGBAPixels); - ASSERT(swrast->Driver.WriteMonoRGBAPixels); - ASSERT(swrast->Driver.ReadRGBASpan); - ASSERT(swrast->Driver.ReadRGBAPixels); - } - else { - ASSERT(swrast->Driver.WriteCI32Span); - ASSERT(swrast->Driver.WriteCI8Span); - ASSERT(swrast->Driver.WriteMonoCISpan); - ASSERT(swrast->Driver.WriteCI32Pixels); - ASSERT(swrast->Driver.WriteMonoCIPixels); - ASSERT(swrast->Driver.ReadCI32Span); - ASSERT(swrast->Driver.ReadCI32Pixels); - } } @@ -625,12 +602,12 @@ _swrast_CreateContext( GLcontext *ctx ) swrast->AllowPixelFog = GL_TRUE; if (ctx->Visual.doubleBufferMode) - swrast->CurrentBufferBit = DD_BACK_LEFT_BIT; + swrast->CurrentBufferBit = BUFFER_BIT_BACK_LEFT; else - swrast->CurrentBufferBit = DD_FRONT_LEFT_BIT; + swrast->CurrentBufferBit = BUFFER_FRONT_LEFT; /* Optimized Accum buffer */ - swrast->_IntegerAccumMode = GL_TRUE; + swrast->_IntegerAccumMode = GL_FALSE; swrast->_IntegerAccumScaler = 0.0; for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index 6eac3232b05..5f5efdc22ae 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -240,7 +240,6 @@ typedef void (*swrast_tri_func)( GLcontext *ctx, const SWvertex *, #define CLIP_BIT 0x020 /**< Scissor or window clip pixels */ #define STENCIL_BIT 0x040 /**< Stencil pixels */ #define MASKING_BIT 0x080 /**< Do glColorMask or glIndexMask */ -#define ALPHABUF_BIT 0x100 /**< Using software alpha buffer */ #define MULTI_DRAW_BIT 0x400 /**< Write to more than one color- */ /**< buffer or no buffers. */ #define OCCLUSION_BIT 0x800 /**< GL_HP_occlusion_test enabled */ @@ -294,8 +293,6 @@ typedef struct GLboolean _IntegerAccumMode; /**< Storing unscaled integers? */ GLfloat _IntegerAccumScaler; /**< Implicit scale factor */ - GLchan *CurAuxBuffer; - /* Working values: */ GLuint StippleCounter; /**< Line stipple counter */ diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index 7454cfd2d2b..3d6d91de51d 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -131,6 +131,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty) { SWcontext *swrast = SWRAST_CONTEXT(ctx); + struct gl_renderbuffer *drawRb = NULL; GLboolean quick_draw; GLint row; GLboolean changeBuffer; @@ -152,6 +153,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, && destx >= 0 && destx + width <= (GLint) ctx->DrawBuffer->Width) { quick_draw = GL_TRUE; + drawRb = ctx->DrawBuffer->_ColorDrawBuffers[0][0]; } else { quick_draw = GL_FALSE; @@ -185,8 +187,8 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, for (row = 0; row < height; row++) { GLchan rgba[MAX_WIDTH][4]; /* Read GLchan and convert to GLfloat */ - _swrast_read_rgba_span(ctx, ctx->ReadBuffer, width, srcx, - srcy + row, rgba); + _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, + width, srcx, srcy + row, rgba); chan_span_to_float(width, (CONST GLchan (*)[4]) rgba, (GLfloat (*)[4]) dest); dest += 4 * width; @@ -240,8 +242,14 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, dy = desty + row; if (quick_draw && dy >= 0 && dy < (GLint) ctx->DrawBuffer->Height) { - (*swrast->Driver.WriteRGBASpan)( ctx, width, destx, dy, - (const GLchan (*)[4])span.array->rgba, NULL ); +#if OLD_RENDERBUFFER + if (swrast->Driver.WriteRGBASpan) + swrast->Driver.WriteRGBASpan(ctx, drawRb, width, destx, dy, + (const GLchan (*)[4]) span.array->rgba, NULL); + else +#endif + drawRb->PutRow(ctx, drawRb, width, destx, dy, + span.array->rgba, NULL); } else if (zoom) { span.x = destx; @@ -271,6 +279,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty) { SWcontext *swrast = SWRAST_CONTEXT(ctx); + struct gl_renderbuffer *drawRb; GLchan *tmpImage,*p; GLboolean quick_draw; GLint sy, dy, stepy, j; @@ -280,6 +289,11 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, const GLuint transferOps = ctx->_ImageTransferState; struct sw_span span; + if (!ctx->ReadBuffer->_ColorReadBuffer) { + /* no readbuffer - OK */ + return; + } + INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA); if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { @@ -319,9 +333,11 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, && destx >= 0 && destx + width <= (GLint) ctx->DrawBuffer->Width) { quick_draw = GL_TRUE; + drawRb = ctx->DrawBuffer->_ColorDrawBuffers[0][0]; } else { quick_draw = GL_FALSE; + drawRb = NULL; } /* If read and draw buffer are different we must do buffer switching */ @@ -341,8 +357,8 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, /* read the source image */ p = tmpImage; for (j = 0; j < height; j++, ssy += stepy) { - _swrast_read_rgba_span( ctx, ctx->ReadBuffer, width, srcx, ssy, - (GLchan (*)[4]) p ); + _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, + width, srcx, ssy, (GLchan (*)[4]) p ); p += width * 4; } p = tmpImage; @@ -370,8 +386,8 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, if (changeBuffer) _swrast_use_read_buffer(ctx); ASSERT(width < MAX_WIDTH); - _swrast_read_rgba_span( ctx, ctx->ReadBuffer, width, srcx, sy, - span.array->rgba ); + _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, + width, srcx, sy, span.array->rgba ); if (changeBuffer) _swrast_use_draw_buffer(ctx); } @@ -397,8 +413,14 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, /* Write color span */ if (quick_draw && dy >= 0 && dy < (GLint) ctx->DrawBuffer->Height) { - (*swrast->Driver.WriteRGBASpan)( ctx, width, destx, dy, - (const GLchan (*)[4])span.array->rgba, NULL ); +#if OLD_RENDERBUFFER + if (swrast->Driver.WriteRGBASpan) + swrast->Driver.WriteRGBASpan(ctx, drawRb, width, destx, dy, + (const GLchan (*)[4])span.array->rgba, NULL); + else +#endif + drawRb->PutRow(ctx, drawRb, width, destx, dy, span.array->rgba, NULL); + } else if (zoom) { span.x = destx; @@ -435,6 +457,11 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, GLint overlapping; struct sw_span span; + if (!ctx->ReadBuffer->_ColorReadBuffer) { + /* no readbuffer - OK */ + return; + } + INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_INDEX); /* Determine if copy should be bottom-to-top or top-to-bottom */ @@ -481,7 +508,8 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, /* read the image */ p = tmpImage; for (j = 0; j < height; j++, ssy += stepy) { - _swrast_read_index_span( ctx, ctx->ReadBuffer, width, srcx, ssy, p ); + _swrast_read_index_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, + width, srcx, ssy, p ); p += width; } p = tmpImage; @@ -505,8 +533,8 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, else { if (changeBuffer) _swrast_use_read_buffer(ctx); - _swrast_read_index_span( ctx, ctx->ReadBuffer, width, srcx, sy, - span.array->index ); + _swrast_read_index_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, + width, srcx, sy, span.array->index ); if (changeBuffer) _swrast_use_draw_buffer(ctx); } @@ -543,6 +571,9 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty ) { + const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF; + struct gl_renderbuffer *readRb + = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; GLfloat *p, *tmpImage; GLint sy, dy, stepy; GLint i, j; @@ -550,6 +581,11 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, GLint overlapping; struct sw_span span; + if (!readRb) { + /* no readbuffer - OK */ + return; + } + INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_Z); if (!ctx->Visual.depthBits) { @@ -592,7 +628,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, } p = tmpImage; for (j = 0; j < height; j++, ssy += stepy) { - _swrast_read_depth_span_float(ctx, width, srcx, ssy, p); + _swrast_read_depth_span_float(ctx, readRb, width, srcx, ssy, p); p += width; } p = tmpImage; @@ -604,20 +640,21 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, for (j = 0; j < height; j++, sy += stepy, dy += stepy) { GLfloat depth[MAX_WIDTH]; - + float sum = 0; /* get depth values */ if (overlapping) { MEMCPY(depth, p, width * sizeof(GLfloat)); p += width; } else { - _swrast_read_depth_span_float(ctx, width, srcx, sy, depth); + _swrast_read_depth_span_float(ctx, readRb, width, srcx, sy, depth); } /* apply scale and bias */ for (i = 0; i < width; i++) { GLfloat d = depth[i] * ctx->Pixel.DepthScale + ctx->Pixel.DepthBias; - span.array->z[i] = (GLdepth) (CLAMP(d, 0.0F, 1.0F) * ctx->DepthMax); + sum += d; + span.array->z[i] = (GLdepth) (CLAMP(d, 0.0F, 1.0F) * depthMax); } /* write depth values */ @@ -650,6 +687,8 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy, GLint width, GLint height, GLint destx, GLint desty ) { + struct gl_renderbuffer *rb + = ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer; GLint sy, dy, stepy; GLint j; GLstencil *p, *tmpImage; @@ -662,6 +701,11 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy, return; } + if (!rb) { + /* no readbuffer - OK */ + return; + } + /* Determine if copy should be bottom-to-top or top-to-bottom */ if (srcy < desty) { /* top-down max-to-min */ @@ -693,7 +737,7 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy, } p = tmpImage; for (j = 0; j < height; j++, ssy += stepy) { - _swrast_read_stencil_span( ctx, width, srcx, ssy, p ); + _swrast_read_stencil_span( ctx, rb, width, srcx, ssy, p ); p += width; } p = tmpImage; @@ -712,7 +756,7 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy, p += width; } else { - _swrast_read_stencil_span( ctx, width, srcx, sy, stencil ); + _swrast_read_stencil_span( ctx, rb, width, srcx, sy, stencil ); } /* Apply shift, offset, look-up table */ diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index 0142fe15520..e36878e6fc8 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 5.1 + * Version: 6.3 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -27,51 +27,21 @@ #include "context.h" #include "macros.h" #include "imports.h" +#include "fbobject.h" #include "s_depth.h" #include "s_context.h" /** - * Return address of depth buffer value for given window coord. - */ -GLvoid * -_swrast_zbuffer_address(GLcontext *ctx, GLint x, GLint y) -{ - if (ctx->Visual.depthBits <= 16) - return (GLushort *) ctx->DrawBuffer->DepthBuffer - + ctx->DrawBuffer->Width * y + x; - else - return (GLuint *) ctx->DrawBuffer->DepthBuffer - + ctx->DrawBuffer->Width * y + x; -} - - -#define Z_ADDRESS16( CTX, X, Y ) \ - ( ((GLushort *) (CTX)->DrawBuffer->DepthBuffer) \ - + (CTX)->DrawBuffer->Width * (Y) + (X) ) - -#define Z_ADDRESS32( CTX, X, Y ) \ - ( ((GLuint *) (CTX)->DrawBuffer->DepthBuffer) \ - + (CTX)->DrawBuffer->Width * (Y) + (X) ) - - - -/**********************************************************************/ -/***** Depth Testing Functions *****/ -/**********************************************************************/ - - -/* - * Do depth test for an array of fragments. This is used both for - * software and hardware Z buffers. + * Do depth test for a horizontal span of fragments. * Input: zbuffer - array of z values in the zbuffer * z - array of fragment z values * Return: number of fragments which pass the test. */ static GLuint depth_test_span16( GLcontext *ctx, GLuint n, - GLushort zbuffer[], const GLdepth z[], GLubyte mask[] ) + GLushort zbuffer[], const GLuint z[], GLubyte mask[] ) { GLuint passed = 0; @@ -300,7 +270,7 @@ depth_test_span16( GLcontext *ctx, GLuint n, static GLuint depth_test_span32( GLcontext *ctx, GLuint n, - GLuint zbuffer[], const GLdepth z[], GLubyte mask[] ) + GLuint zbuffer[], const GLuint z[], GLubyte mask[] ) { GLuint passed = 0; @@ -529,74 +499,69 @@ depth_test_span32( GLcontext *ctx, GLuint n, /* - * Apply depth test to span of fragments. Hardware or software z buffer. + * Apply depth test to span of fragments. */ static GLuint depth_test_span( GLcontext *ctx, struct sw_span *span) { + struct gl_framebuffer *fb = ctx->DrawBuffer; + struct gl_renderbuffer *rb = fb->Attachment[BUFFER_DEPTH].Renderbuffer; const GLint x = span->x; const GLint y = span->y; - const GLuint n = span->end; - SWcontext *swrast = SWRAST_CONTEXT(ctx); + const GLuint count = span->end; + const GLuint *zValues = span->array->z; + GLubyte *mask = span->array->mask; + GLuint passed; ASSERT((span->arrayMask & SPAN_XY) == 0); ASSERT(span->arrayMask & SPAN_Z); - if (swrast->Driver.ReadDepthSpan) { - /* hardware-based depth buffer */ - GLdepth zbuffer[MAX_WIDTH]; - GLuint passed; - (*swrast->Driver.ReadDepthSpan)(ctx, n, x, y, zbuffer); - passed = depth_test_span32(ctx, n, zbuffer, span->array->z, - span->array->mask); - ASSERT(swrast->Driver.WriteDepthSpan); - (*swrast->Driver.WriteDepthSpan)(ctx, n, x, y, zbuffer, - span->array->mask); - if (passed < n) - span->writeAll = GL_FALSE; - return passed; - } - else { - GLuint passed; - /* software depth buffer */ - if (ctx->Visual.depthBits <= 16) { - GLushort *zptr = (GLushort *) Z_ADDRESS16(ctx, x, y); - passed = depth_test_span16(ctx, n, zptr, span->array->z, span->array->mask); + if (rb->GetPointer(ctx, rb, 0, 0)) { + /* Directly access buffer */ + if (ctx->DrawBuffer->Visual.depthBits <= 16) { + GLushort *zbuffer = (GLushort *) rb->GetPointer(ctx, rb, x, y); + passed = depth_test_span16(ctx, count, zbuffer, zValues, mask); } else { - GLuint *zptr = (GLuint *) Z_ADDRESS32(ctx, x, y); - passed = depth_test_span32(ctx, n, zptr, span->array->z, span->array->mask); + GLuint *zbuffer = (GLuint *) rb->GetPointer(ctx, rb, x, y); + passed = depth_test_span32(ctx, count, zbuffer, zValues, mask); } -#if 1 - if (passed < span->end) { - span->writeAll = GL_FALSE; + } + else { + /* read depth values from buffer, test, write back */ + if (rb->DataType == GL_UNSIGNED_SHORT) { + GLushort zbuffer[MAX_WIDTH]; + rb->GetRow(ctx, rb, count, x, y, zbuffer); + passed = depth_test_span16(ctx, count, zbuffer, zValues, mask ); + rb->PutRow(ctx, rb, count, x, y, zbuffer, NULL); } -#else - /* this causes a glDrawPixels(GL_DEPTH_COMPONENT) conformance failure */ - if (passed < span->end) { - span->writeAll = GL_FALSE; - if (passed == 0) { - span->end = 0; - return 0; - } - while (span->end > 0 && span->mask[span->end - 1] == 0) - span->end --; + else { + GLuint zbuffer[MAX_WIDTH]; + ASSERT(rb->DataType == GL_UNSIGNED_INT); + rb->GetRow(ctx, rb, count, x, y, zbuffer); + passed = depth_test_span32(ctx, count, zbuffer, zValues, mask ); + rb->PutRow(ctx, rb, count, x, y, zbuffer, NULL); } -#endif - return passed; } + + if (passed < count) { + span->writeAll = GL_FALSE; + } + return passed; } +#define Z_ADDRESS(X, Y) (zStart + (Y) * stride + (X)) + /* - * Do depth testing for an array of fragments using software Z buffer. + * Do depth testing for an array of fragments at assorted locations. */ static void -software_depth_test_pixels16( GLcontext *ctx, GLuint n, - const GLint x[], const GLint y[], - const GLdepth z[], GLubyte mask[] ) +direct_depth_test_pixels16(GLcontext *ctx, GLushort *zStart, GLuint stride, + GLuint n, const GLint x[], const GLint y[], + const GLuint z[], GLubyte mask[] ) { /* switch cases ordered from most frequent to less frequent */ switch (ctx->Depth.Func) { @@ -606,7 +571,7 @@ software_depth_test_pixels16( GLcontext *ctx, GLuint n, GLuint i; for (i=0; i= *zptr) { /* pass */ *zptr = z[i]; @@ -693,7 +658,7 @@ software_depth_test_pixels16( GLcontext *ctx, GLuint n, GLuint i; for (i=0; i= *zptr) { /* pass */ } @@ -711,7 +676,7 @@ software_depth_test_pixels16( GLcontext *ctx, GLuint n, GLuint i; for (i=0; i *zptr) { /* pass */ *zptr = z[i]; @@ -728,7 +693,7 @@ software_depth_test_pixels16( GLcontext *ctx, GLuint n, GLuint i; for (i=0; i *zptr) { /* pass */ } @@ -746,7 +711,7 @@ software_depth_test_pixels16( GLcontext *ctx, GLuint n, GLuint i; for (i=0; iDepth.Func) { @@ -852,7 +817,7 @@ software_depth_test_pixels32( GLcontext *ctx, GLuint n, GLuint i; for (i=0; i= *zptr) { /* pass */ *zptr = z[i]; @@ -939,7 +904,7 @@ software_depth_test_pixels32( GLcontext *ctx, GLuint n, GLuint i; for (i=0; i= *zptr) { /* pass */ } @@ -957,7 +922,7 @@ software_depth_test_pixels32( GLcontext *ctx, GLuint n, GLuint i; for (i=0; i *zptr) { /* pass */ *zptr = z[i]; @@ -974,7 +939,7 @@ software_depth_test_pixels32( GLcontext *ctx, GLuint n, GLuint i; for (i=0; i *zptr) { /* pass */ } @@ -992,7 +957,7 @@ software_depth_test_pixels32( GLcontext *ctx, GLuint n, GLuint i; for (i=0; iDepth.Func) { - case GL_LESS: - if (ctx->Depth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; i= zbuffer[i]) { - /* pass */ - zbuffer[i] = z[i]; - } - else { - /* fail */ - mask[i] = 0; - } - } - } - } - else { - /* Don't update Z buffer */ - GLuint i; - for (i=0; i= zbuffer[i]) { - /* pass */ - } - else { - /* fail */ - mask[i] = 0; - } - } - } - } - break; - case GL_GREATER: - if (ctx->Depth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; i zbuffer[i]) { - /* pass */ - zbuffer[i] = z[i]; - } - else { - /* fail */ - mask[i] = 0; - } - } - } - } - else { - /* Don't update Z buffer */ - GLuint i; - for (i=0; i zbuffer[i]) { - /* pass */ - } - else { - /* fail */ - mask[i] = 0; - } - } - } - } - break; - case GL_NOTEQUAL: - if (ctx->Depth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; iDepth.Mask) { - /* Update Z buffer */ - GLuint i; - for (i=0; iend; + struct gl_framebuffer *fb = ctx->DrawBuffer; + struct gl_renderbuffer *rb = fb->Attachment[BUFFER_DEPTH].Renderbuffer; + const GLuint count = span->end; const GLint *x = span->array->x; const GLint *y = span->array->y; - const GLdepth *z = span->array->z; + const GLuint *z = span->array->z; GLubyte *mask = span->array->mask; - if (swrast->Driver.ReadDepthPixels) { - /* read depth values from hardware Z buffer */ - GLdepth zbuffer[MAX_WIDTH]; - (*swrast->Driver.ReadDepthPixels)(ctx, n, x, y, zbuffer); - - hardware_depth_test_pixels( ctx, n, zbuffer, z, mask ); - - /* update hardware Z buffer with new values */ - assert(swrast->Driver.WriteDepthPixels); - (*swrast->Driver.WriteDepthPixels)(ctx, n, x, y, zbuffer, mask ); + if (rb->GetPointer(ctx, rb, 0, 0)) { + /* Directly access values */ + if (rb->DataType == GL_UNSIGNED_SHORT) { + GLushort *zStart = (GLushort *) rb->Data; + GLuint stride = rb->Width; + direct_depth_test_pixels16(ctx, zStart, stride, count, x, y, z, mask); + } + else { + GLuint *zStart = (GLuint *) rb->Data; + GLuint stride = rb->Width; + direct_depth_test_pixels32(ctx, zStart, stride, count, x, y, z, mask); + } } else { - /* software depth testing */ - if (ctx->Visual.depthBits <= 16) - software_depth_test_pixels16(ctx, n, x, y, z, mask); - else - software_depth_test_pixels32(ctx, n, x, y, z, mask); + /* read depth values from buffer, test, write back */ + if (rb->DataType == GL_UNSIGNED_SHORT) { + GLushort zbuffer[MAX_WIDTH]; + rb->GetValues(ctx, rb, count, x, y, zbuffer); + depth_test_span16(ctx, count, zbuffer, z, mask ); + rb->PutValues(ctx, rb, count, x, y, zbuffer, NULL); + } + else { + GLuint zbuffer[MAX_WIDTH]; + ASSERT(rb->DataType == GL_UNSIGNED_INT); + rb->GetValues(ctx, rb, count, x, y, zbuffer); + depth_test_span32(ctx, count, zbuffer, z, mask ); + rb->PutValues(ctx, rb, count, x, y, zbuffer, NULL); + } } - return n; /* not really correct, but OK */ + + return count; /* not really correct, but OK */ } @@ -1372,24 +1117,33 @@ _swrast_depth_test_span( GLcontext *ctx, struct sw_span *span) GLboolean _swrast_depth_bounds_test( GLcontext *ctx, struct sw_span *span ) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLdepth zMin = (GLdepth) (ctx->Depth.BoundsMin * ctx->DepthMaxF + 0.5F); - GLdepth zMax = (GLdepth) (ctx->Depth.BoundsMax * ctx->DepthMaxF + 0.5F); + struct gl_framebuffer *fb = ctx->DrawBuffer; + struct gl_renderbuffer *rb = fb->Attachment[BUFFER_DEPTH].Renderbuffer; + GLuint zMin = (GLuint) (ctx->Depth.BoundsMin * fb->_DepthMaxF + 0.5F); + GLuint zMax = (GLuint) (ctx->Depth.BoundsMax * fb->_DepthMaxF + 0.5F); GLubyte *mask = span->array->mask; + const GLuint count = span->end; GLuint i; GLboolean anyPass = GL_FALSE; - if (swrast->Driver.ReadDepthPixels) { - /* read depth values from hardware Z buffer */ - GLdepth zbuffer[MAX_WIDTH]; - ASSERT(span->end <= MAX_WIDTH); - if (span->arrayMask & SPAN_XY) - (*swrast->Driver.ReadDepthPixels)(ctx, span->end, span->array->x, - span->array->y, zbuffer); - else - (*swrast->Driver.ReadDepthSpan)(ctx, span->end, span->x, span->y, - zbuffer); - for (i = 0; i < span->end; i++) { + if (rb->DataType == GL_UNSIGNED_SHORT) { + /* get 16-bit values */ + GLushort zbuffer16[MAX_WIDTH], *zbuffer; + if (span->arrayMask & SPAN_XY) { + rb->GetValues(ctx, rb, count, span->array->x, span->array->y, zbuffer16); + zbuffer = zbuffer16; + } + else { + zbuffer = rb->GetPointer(ctx, rb, span->x, span->y); + if (!zbuffer) { + rb->GetRow(ctx, rb, count, span->x, span->y, zbuffer16); + zbuffer = zbuffer16; + } + } + assert(zbuffer); + + /* Now do the tests */ + for (i = 0; i < count; i++) { if (mask[i]) { if (zbuffer[i] < zMin || zbuffer[i] > zMax) mask[i] = GL_FALSE; @@ -1399,62 +1153,32 @@ _swrast_depth_bounds_test( GLcontext *ctx, struct sw_span *span ) } } else { - /* software Z buffer */ + /* get 32-bit values */ + GLuint zbuffer32[MAX_WIDTH], *zbuffer; if (span->arrayMask & SPAN_XY) { - if (ctx->Visual.depthBits <= 16) { - /* 16 bits / Z */ - for (i = 0; i < span->end; i++) { - if (mask[i]) { - const GLushort *zPtr = Z_ADDRESS16(ctx, span->array->x[i], - span->array->y[i]); - if (*zPtr < zMin || *zPtr > zMax) - mask[i] = GL_FALSE; - else - anyPass = GL_TRUE; - } - } - } - else { - /* 32 bits / Z */ - for (i = 0; i < span->end; i++) { - if (mask[i]) { - const GLuint *zPtr = Z_ADDRESS32(ctx, span->array->x[i], - span->array->y[i]); - if (*zPtr < zMin || *zPtr > zMax) - mask[i] = GL_FALSE; - else - anyPass = GL_TRUE; - } - } - } + rb->GetValues(ctx, rb, count, span->array->x, span->array->y, zbuffer32); + zbuffer = zbuffer32; } else { - if (ctx->Visual.depthBits <= 16) { - /* 16 bits / Z */ - const GLushort *zPtr = Z_ADDRESS16(ctx, span->x, span->y); - for (i = 0; i < span->end; i++) { - if (mask[i]) { - if (zPtr[i] < zMin || zPtr[i] > zMax) - mask[i] = GL_FALSE; - else - anyPass = GL_TRUE; - } - } + zbuffer = rb->GetPointer(ctx, rb, span->x, span->y); + if (!zbuffer) { + rb->GetRow(ctx, rb, count, span->x, span->y, zbuffer32); + zbuffer = zbuffer32; } - else { - /* 32 bits / Z */ - const GLuint *zPtr = Z_ADDRESS32(ctx, span->x, span->y); - for (i = 0; i < span->end; i++) { - if (mask[i]) { - if (zPtr[i] < zMin || zPtr[i] > zMax) - mask[i] = GL_FALSE; - else - anyPass = GL_TRUE; - } - } + } + assert(zbuffer); + + /* Now do the tests */ + for (i = 0; i < count; i++) { + if (mask[i]) { + if (zbuffer[i] < zMin || zbuffer[i] > zMax) + mask[i] = GL_FALSE; + else + anyPass = GL_TRUE; } } } + return anyPass; } @@ -1468,15 +1192,16 @@ _swrast_depth_bounds_test( GLcontext *ctx, struct sw_span *span ) /** * Read a span of depth values from the depth buffer. * This function does clipping before calling the device driver function. + * + * XXXX this is no longer a swrast function!!! + * */ void -_swrast_read_depth_span( GLcontext *ctx, - GLint n, GLint x, GLint y, GLdepth depth[] ) +_swrast_read_depth_span( GLcontext *ctx, struct gl_renderbuffer *rb, + GLint n, GLint x, GLint y, GLuint depth[] ) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - if (y < 0 || y >= (GLint) ctx->DrawBuffer->Height || - x + (GLint) n <= 0 || x >= (GLint) ctx->DrawBuffer->Width) { + if (y < 0 || y >= (GLint) rb->Height || + x + (GLint) n <= 0 || x >= (GLint) rb->Width) { /* span is completely outside framebuffer */ GLint i; for (i = 0; i < n; i++) @@ -1493,8 +1218,8 @@ _swrast_read_depth_span( GLcontext *ctx, n -= dx; depth += dx; } - if (x + n > (GLint) ctx->DrawBuffer->Width) { - GLint dx = x + n - (GLint) ctx->DrawBuffer->Width; + if (x + n > (GLint) rb->Width) { + GLint dx = x + n - (GLint) rb->Width; GLint i; for (i = 0; i < dx; i++) depth[n - i - 1] = 0; @@ -1504,292 +1229,127 @@ _swrast_read_depth_span( GLcontext *ctx, return; } - if (ctx->DrawBuffer->DepthBuffer) { - /* read from software depth buffer */ - if (ctx->Visual.depthBits <= 16) { - const GLushort *zptr = Z_ADDRESS16( ctx, x, y ); - GLint i; - for (i = 0; i < n; i++) { - depth[i] = zptr[i]; - } - } - else { - const GLuint *zptr = Z_ADDRESS32( ctx, x, y ); - GLint i; - for (i = 0; i < n; i++) { - depth[i] = zptr[i]; - } - } + /* we'll always return 32-bit values to our caller */ + if (!rb) { + _mesa_bzero(depth, n * sizeof(GLuint)); } - else if (swrast->Driver.ReadDepthSpan) { - /* read from hardware depth buffer */ - (*swrast->Driver.ReadDepthSpan)( ctx, n, x, y, depth ); + else if (rb->DataType == GL_UNSIGNED_INT) { + rb->GetRow(ctx, rb, x, y, n, depth); } else { - /* no depth buffer */ - _mesa_bzero(depth, n * sizeof(GLfloat)); + GLushort temp[MAX_WIDTH]; + GLuint i; + ASSERT(rb->DataType == GL_UNSIGNED_SHORT); + rb->GetRow(ctx, rb, n, x, y, temp); + for (i = 0; i < n; i++) { + depth[i] = temp[i]; + } } - } - - /** * Return a span of depth values from the depth buffer as floats in [0,1]. - * This is used for both hardware and software depth buffers. * Input: n - how many pixels * x,y - location of first pixel * Output: depth - the array of depth values */ void -_swrast_read_depth_span_float( GLcontext *ctx, - GLint n, GLint x, GLint y, GLfloat depth[] ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLfloat scale = 1.0F / ctx->DepthMaxF; - - if (y < 0 || y >= (GLint) ctx->DrawBuffer->Height || - x + (GLint) n <= 0 || x >= (GLint) ctx->DrawBuffer->Width) { - /* span is completely outside framebuffer */ - GLint i; - for (i = 0; i < n; i++) - depth[i] = 0.0F; - return; - } - - if (x < 0) { - GLint dx = -x; - GLint i; - for (i = 0; i < dx; i++) - depth[i] = 0.0F; - n -= dx; - x = 0; - } - if (x + n > (GLint) ctx->DrawBuffer->Width) { - GLint dx = x + n - (GLint) ctx->DrawBuffer->Width; - GLint i; - for (i = 0; i < dx; i++) - depth[n - i - 1] = 0.0F; - n -= dx; - } - if (n <= 0) { - return; - } - - if (ctx->DrawBuffer->DepthBuffer) { - /* read from software depth buffer */ - if (ctx->Visual.depthBits <= 16) { - const GLushort *zptr = Z_ADDRESS16( ctx, x, y ); - GLint i; - for (i = 0; i < n; i++) { - depth[i] = (GLfloat) zptr[i] * scale; - } - } - else { - const GLuint *zptr = Z_ADDRESS32( ctx, x, y ); - GLint i; - for (i = 0; i < n; i++) { - depth[i] = (GLfloat) zptr[i] * scale; - } - } - } - else if (swrast->Driver.ReadDepthSpan) { - /* read from hardware depth buffer */ - GLdepth d[MAX_WIDTH]; - GLint i; - assert(n <= MAX_WIDTH); - (*swrast->Driver.ReadDepthSpan)( ctx, n, x, y, d ); - for (i = 0; i < n; i++) { - depth[i] = d[i] * scale; - } - } - else { - /* no depth buffer */ - _mesa_bzero(depth, n * sizeof(GLfloat)); - } -} - - - -/**********************************************************************/ -/***** Allocate and Clear Depth Buffer *****/ -/**********************************************************************/ - - - -/** - * Allocate a new depth buffer. If there's already a depth buffer allocated - * it will be free()'d. The new depth buffer will be uninitialized. - */ -void -_swrast_alloc_depth_buffer( GLframebuffer *buffer ) +_swrast_read_depth_span_float( GLcontext *ctx, struct gl_renderbuffer *rb, + GLint n, GLint x, GLint y, GLfloat depth[] ) { - GLint bytesPerValue; - - ASSERT(buffer->UseSoftwareDepthBuffer); + const GLfloat scale = 1.0F / ctx->DrawBuffer->_DepthMaxF; + GLuint temp[MAX_WIDTH]; + GLint i; - /* deallocate current depth buffer if present */ - if (buffer->DepthBuffer) { - MESA_PBUFFER_FREE(buffer->DepthBuffer); - buffer->DepthBuffer = NULL; - } - - /* allocate new depth buffer, but don't initialize it */ - if (buffer->Visual.depthBits <= 16) - bytesPerValue = sizeof(GLushort); - else - bytesPerValue = sizeof(GLuint); + assert(n <= MAX_WIDTH); - buffer->DepthBuffer = MESA_PBUFFER_ALLOC(buffer->Width * buffer->Height - * bytesPerValue); - - if (!buffer->DepthBuffer) { - /* out of memory */ - GET_CURRENT_CONTEXT(ctx); - if (ctx) { - ctx->Depth.Test = GL_FALSE; - ctx->NewState |= _NEW_DEPTH; - _mesa_error(ctx, GL_OUT_OF_MEMORY, "Couldn't allocate depth buffer"); - } + _swrast_read_depth_span(ctx, rb, n, x, y, temp); + for (i = 0; i < n; i++) { + depth[i] = temp[i] * scale; } } /** - * Clear the depth buffer. If the depth buffer doesn't exist yet we'll - * allocate it now. - * This function is only called through Driver.clear_depth_buffer. + * Clear the depth buffer. + * XXX this is no longer a swrast function!!! */ void -_swrast_clear_depth_buffer( GLcontext *ctx ) +_swrast_clear_depth_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); + const GLuint clearValue + = (GLuint) (ctx->Depth.Clear * ctx->DrawBuffer->_DepthMaxF); + GLint x, y, width, height; - if (ctx->Visual.depthBits == 0 - || !ctx->Depth.Mask) { + if (!rb || !ctx->Depth.Mask) { /* no depth buffer, or writing to it is disabled */ return; } - if (swrast->Driver.WriteMonoDepthSpan) { - const GLdepth clearValue = (GLdepth)(ctx->Depth.Clear * ctx->DepthMax); - const GLint x = ctx->DrawBuffer->_Xmin; - const GLint y = ctx->DrawBuffer->_Ymin; - const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - GLint i; - - for (i = 0; i < height; i++) { - (*swrast->Driver.WriteMonoDepthSpan)( ctx, width, x, y + i, - clearValue, NULL ); - } - - return; - } - - if (!ctx->DrawBuffer->DepthBuffer) - return; - - /* The loops in this function have been written so the IRIX 5.3 - * C compiler can unroll them. Hopefully other compilers can too! - */ - - if (ctx->Scissor.Enabled) { - /* only clear scissor region */ - if (ctx->Visual.depthBits <= 16) { - const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->DepthMax); - const GLint rows = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - const GLint cols = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - const GLint rowStride = ctx->DrawBuffer->Width; - GLushort *dRow = (GLushort *) ctx->DrawBuffer->DepthBuffer - + ctx->DrawBuffer->_Ymin * rowStride + ctx->DrawBuffer->_Xmin; - GLint i, j; - for (i = 0; i < rows; i++) { - for (j = 0; j < cols; j++) { - dRow[j] = clearValue; + assert(rb->_BaseFormat == GL_DEPTH_COMPONENT); + + /* compute region to clear */ + x = ctx->DrawBuffer->_Xmin; + y = ctx->DrawBuffer->_Ymin; + width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; + height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; + + if (rb->GetPointer(ctx, rb, 0, 0)) { + /* Direct buffer access is possible. Either this is just malloc'd + * memory, or perhaps the driver mmap'd the zbuffer memory. + */ + if (rb->DataType == GL_UNSIGNED_SHORT) { + if (width == rb->Width && + (clearValue & 0xff) == ((clearValue >> 8) & 0xff)) { + /* optimized case */ + GLushort *dst = (GLushort *) rb->GetPointer(ctx, rb, x, y); + GLuint len = width * height * sizeof(GLushort); + _mesa_memset(dst, (clearValue & 0xff), len); + } + else { + /* general case */ + GLint i, j; + for (i = 0; i < height; i++) { + GLushort *dst = (GLushort *) rb->GetPointer(ctx, rb, x, y + i); + for (j = 0; j < width; j++) { + dst[j] = clearValue; + } } - dRow += rowStride; } } else { - const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->DepthMax); - const GLint rows = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - const GLint cols = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - const GLint rowStride = ctx->DrawBuffer->Width; - GLuint *dRow = (GLuint *) ctx->DrawBuffer->DepthBuffer - + ctx->DrawBuffer->_Ymin * rowStride + ctx->DrawBuffer->_Xmin; GLint i, j; - for (i = 0; i < rows; i++) { - for (j = 0; j < cols; j++) { - dRow[j] = clearValue; + ASSERT(rb->DataType == GL_UNSIGNED_INT); + for (i = 0; i < height; i++) { + GLuint *dst = (GLuint *) rb->GetPointer(ctx, rb, x, y + i); + for (j = 0; j < width; j++) { + dst[j] = clearValue; } - dRow += rowStride; } } } else { - /* clear whole buffer */ - if (ctx->Visual.depthBits <= 16) { - const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->DepthMax); - if ((clearValue & 0xff) == (clearValue >> 8)) { - if (clearValue == 0) { - _mesa_bzero(ctx->DrawBuffer->DepthBuffer, - 2*ctx->DrawBuffer->Width*ctx->DrawBuffer->Height); - } - else { - /* lower and upper bytes of clear_value are same, use MEMSET */ - MEMSET( ctx->DrawBuffer->DepthBuffer, clearValue & 0xff, - 2 * ctx->DrawBuffer->Width * ctx->DrawBuffer->Height); - } + /* Direct access not possible. Use PutRow to write new values. */ + if (rb->DataType == GL_UNSIGNED_SHORT) { + GLushort clearRow[MAX_WIDTH]; + GLint i, j; + for (j = 0; j < width; j++) { + clearRow[j] = clearValue; } - else { - GLushort *d = (GLushort *) ctx->DrawBuffer->DepthBuffer; - GLint n = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height; - while (n >= 16) { - d[0] = clearValue; d[1] = clearValue; - d[2] = clearValue; d[3] = clearValue; - d[4] = clearValue; d[5] = clearValue; - d[6] = clearValue; d[7] = clearValue; - d[8] = clearValue; d[9] = clearValue; - d[10] = clearValue; d[11] = clearValue; - d[12] = clearValue; d[13] = clearValue; - d[14] = clearValue; d[15] = clearValue; - d += 16; - n -= 16; - } - while (n > 0) { - *d++ = clearValue; - n--; - } + for (i = 0; i < height; i++) { + rb->PutRow(ctx, rb, width, x, y + i, clearRow, NULL); } } else { - /* >16 bit depth buffer */ - const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->DepthMax); - if (clearValue == 0) { - _mesa_bzero(ctx->DrawBuffer->DepthBuffer, - ctx->DrawBuffer->Width*ctx->DrawBuffer->Height*sizeof(GLuint)); + GLuint clearRow[MAX_WIDTH]; + GLint i, j; + assert(rb->DataType == GL_UNSIGNED_INT); + for (j = 0; j < width; j++) { + clearRow[j] = clearValue; } - else { - GLint n = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height; - GLuint *d = (GLuint *) ctx->DrawBuffer->DepthBuffer; - while (n >= 16) { - d[0] = clearValue; d[1] = clearValue; - d[2] = clearValue; d[3] = clearValue; - d[4] = clearValue; d[5] = clearValue; - d[6] = clearValue; d[7] = clearValue; - d[8] = clearValue; d[9] = clearValue; - d[10] = clearValue; d[11] = clearValue; - d[12] = clearValue; d[13] = clearValue; - d[14] = clearValue; d[15] = clearValue; - d += 16; - n -= 16; - } - while (n > 0) { - *d++ = clearValue; - n--; - } + for (i = 0; i < height; i++) { + rb->PutRow(ctx, rb, width, x, y + i, clearRow, NULL); } } } diff --git a/src/mesa/swrast/s_depth.h b/src/mesa/swrast/s_depth.h index b972a84c56f..2229e8a22df 100644 --- a/src/mesa/swrast/s_depth.h +++ b/src/mesa/swrast/s_depth.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 5.1 + * Version: 6.3 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -31,10 +31,6 @@ #include "s_context.h" -extern GLvoid * -_swrast_zbuffer_address(GLcontext *ctx, GLint x, GLint y); - - extern GLuint _swrast_depth_test_span( GLcontext *ctx, struct sw_span *span); @@ -44,21 +40,17 @@ _swrast_depth_bounds_test( GLcontext *ctx, struct sw_span *span ); extern void -_swrast_read_depth_span( GLcontext *ctx, - GLint n, GLint x, GLint y, GLdepth depth[] ); - - -extern void -_swrast_read_depth_span_float( GLcontext *ctx, GLint n, GLint x, GLint y, - GLfloat depth[] ); +_swrast_read_depth_span( GLcontext *ctx, struct gl_renderbuffer *rb, + GLint n, GLint x, GLint y, GLuint depth[] ); extern void -_swrast_alloc_depth_buffer( GLframebuffer *buffer ); +_swrast_read_depth_span_float( GLcontext *ctx, struct gl_renderbuffer *rb, + GLint n, GLint x, GLint y, GLfloat depth[] ); extern void -_swrast_clear_depth_buffer( GLcontext *ctx ); +_swrast_clear_depth_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ); #endif diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 5b0a24bfb29..bd9a14b1197 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -51,6 +51,9 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels) { +#if NEW_RENDERBUFFER + struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0]; +#endif SWcontext *swrast = SWRAST_CONTEXT(ctx); struct sw_span span; @@ -59,6 +62,9 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, if (!ctx->Current.RasterPosValid) { return GL_TRUE; /* no-op */ } + + if (swrast->_RasterMask & MULTI_DRAW_BIT) + return GL_FALSE; if (ctx->Depth.Test) _swrast_span_default_z(ctx, &span); @@ -164,8 +170,15 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, /* no zooming */ GLint row; for (row=0; rowDriver.WriteRGBASpan)(ctx, drawWidth, destX, destY, - (CONST GLchan (*)[4]) src, NULL); +#if OLD_RENDERBUFFER + if (swrast->Driver.WriteRGBASpan) + swrast->Driver.WriteRGBASpan(ctx, rb, drawWidth, + destX, destY, + (CONST GLchan (*)[4]) src, + NULL); + else +#endif + rb->PutRow(ctx, rb, drawWidth, destX, destY, src, NULL); src += rowLength * 4; destY++; } @@ -175,8 +188,15 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, GLint row; for (row=0; rowDriver.WriteRGBASpan)(ctx, drawWidth, destX, destY, - (CONST GLchan (*)[4]) src, NULL); +#if OLD_RENDERBUFFER + if (swrast->Driver.WriteRGBASpan) + swrast->Driver.WriteRGBASpan(ctx, rb, drawWidth, + destX, destY, + (CONST GLchan (*)[4]) src, + NULL); + else +#endif + rb->PutRow(ctx, rb, drawWidth, destX, destY, src, NULL); src += rowLength * 4; } } @@ -204,8 +224,15 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { GLint row; for (row=0; rowDriver.WriteRGBSpan)(ctx, drawWidth, destX, destY, - (CONST GLchan (*)[3]) src, NULL); +#if OLD_RENDERBUFFER + if (swrast->Driver.WriteRGBSpan) + (*swrast->Driver.WriteRGBSpan)(ctx, rb, drawWidth, + destX, destY, + (CONST GLchan (*)[3]) src, + NULL); + else +#endif + rb->PutRowRGB(ctx, rb, drawWidth, destX, destY, src, NULL); src += rowLength * 3; destY++; } @@ -215,8 +242,15 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, GLint row; for (row=0; rowDriver.WriteRGBSpan)(ctx, drawWidth, destX, destY, - (CONST GLchan (*)[3]) src, NULL); +#if OLD_RENDERBUFFER + if (swrast->Driver.WriteRGBASpan) + (*swrast->Driver.WriteRGBSpan)(ctx, rb, drawWidth, + destX, destY, + (CONST GLchan (*)[3]) src, + NULL); + else +#endif + rb->PutRowRGB(ctx, rb, drawWidth, destX, destY, src, NULL); src += rowLength * 3; } } @@ -252,8 +286,15 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, span.array->rgb[i][1] = src[i]; span.array->rgb[i][2] = src[i]; } - (*swrast->Driver.WriteRGBSpan)(ctx, drawWidth, destX, destY, +#if OLD_RENDERBUFFER + if (swrast->Driver.WriteRGBSpan) + (*swrast->Driver.WriteRGBSpan)(ctx, rb, drawWidth, + destX, destY, (CONST GLchan (*)[3]) span.array->rgb, NULL); + else +#endif + rb->PutRowRGB(ctx, rb, drawWidth, destX, destY, + span.array->rgb, NULL); src += rowLength; destY++; } @@ -270,8 +311,15 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, span.array->rgb[i][2] = src[i]; } destY--; - (*swrast->Driver.WriteRGBSpan)(ctx, drawWidth, destX, destY, +#if OLD_RENDERBUFFER + if (swrast->Driver.WriteRGBSpan) + (*swrast->Driver.WriteRGBSpan)(ctx, rb, drawWidth, + destX, destY, (CONST GLchan (*)[3]) span.array->rgb, NULL); + else +#endif + rb->PutRow(ctx, rb, drawWidth, destX, destY, + span.array->rgb, NULL); src += rowLength; } } @@ -316,8 +364,14 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, span.array->rgba[i][2] = *ptr++; span.array->rgba[i][3] = *ptr++; } - (*swrast->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY, +#if OLD_RENDERBUFFER + if (swrast->Driver.WriteRGBASpan) + swrast->Driver.WriteRGBASpan(ctx, rb, drawWidth, destX,destY, (CONST GLchan (*)[4]) span.array->rgba, NULL); + else +#endif + rb->PutRow(ctx, rb, drawWidth, destX, destY, + span.array->rgba, NULL); src += rowLength*2; destY++; } @@ -336,8 +390,14 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, span.array->rgba[i][3] = *ptr++; } destY--; - (*swrast->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY, +#if OLD_RENDERBUFFER + if (swrast->Driver.WriteRGBASpan) + swrast->Driver.WriteRGBASpan(ctx, rb, drawWidth, destX,destY, (CONST GLchan (*)[4]) span.array->rgba, NULL); + else +#endif + rb->PutRow(ctx, rb, drawWidth, destX, destY, + span.array->rgba, NULL); src += rowLength*2; } } @@ -376,8 +436,15 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, for (row=0; rowrgba); - (*swrast->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY, +#if OLD_RENDERBUFFER + if (swrast->Driver.WriteRGBASpan) + swrast->Driver.WriteRGBASpan(ctx, rb, drawWidth, destX,destY, (const GLchan (*)[4]) span.array->rgba, NULL); + else +#endif + rb->PutRow(ctx, rb, drawWidth, destX, destY, + span.array->rgba, NULL); + src += rowLength; destY++; } @@ -390,8 +457,14 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, ASSERT(drawWidth <= MAX_WIDTH); _mesa_map_ci8_to_rgba(ctx, drawWidth, src, span.array->rgba); destY--; - (*swrast->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY, +#if OLD_RENDERBUFFER + if (swrast->Driver.WriteRGBASpan) + swrast->Driver.WriteRGBASpan(ctx, rb, drawWidth, destX,destY, (CONST GLchan (*)[4]) span.array->rgba, NULL); + else +#endif + rb->PutRow(ctx, rb, drawWidth, destX, destY, + span.array->rgba, NULL); src += rowLength; } return GL_TRUE; @@ -419,8 +492,11 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y, if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { /* no zooming */ for (row=0; rowDriver.WriteCI8Span)(ctx, drawWidth, destX, destY, - src, NULL); + GLuint index32[MAX_WIDTH]; + GLint col; + for (col = 0; col < drawWidth; col++) + index32[col] = src[col]; + rb->PutRow(ctx, rb, drawWidth, destX, destY, index32, NULL); src += rowLength; destY++; } @@ -656,6 +732,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, } else { /* General case */ + const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF; GLint row, skipPixels = 0; /* in case width > MAX_WIDTH do the copy in chunks */ @@ -683,10 +760,9 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, zSrc, unpack); /* clamp depth values to [0,1] and convert from floats to ints */ { - const GLfloat zScale = ctx->DepthMaxF; GLuint i; for (i = 0; i < span.end; i++) { - span.array->z[i] = (GLdepth) (floatSpan[i] * zScale); + span.array->z[i] = (GLdepth) (floatSpan[i] * depthMax); } } if (zoom) { @@ -717,6 +793,7 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, const GLvoid *pixels ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); + struct gl_renderbuffer *rb = NULL; /* only used for quickDraw path */ const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; const GLint desty = y; GLboolean quickDraw; @@ -744,11 +821,14 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, if (SWRAST_CONTEXT(ctx)->_RasterMask == 0 && !zoom && x >= 0 && y >= 0 && x + width <= (GLint) ctx->DrawBuffer->Width - && y + height <= (GLint) ctx->DrawBuffer->Height) { + && y + height <= (GLint) ctx->DrawBuffer->Height + && ctx->DrawBuffer->_NumColorDrawBuffers[0] == 1) { quickDraw = GL_TRUE; + rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0]; } else { quickDraw = GL_FALSE; + rb = NULL; } if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { @@ -846,8 +926,14 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, /* draw the span */ if (quickDraw) { - (*swrast->Driver.WriteRGBASpan)(ctx, span.end, span.x, span.y, - (CONST GLchan (*)[4]) span.array->rgba, NULL); +#if OLD_RENDERBUFFER + if (swrast->Driver.WriteRGBASpan) + swrast->Driver.WriteRGBASpan(ctx, rb, span.end, span.x, span.y, + (CONST GLchan (*)[4]) span.array->rgba, NULL); + else +#endif + rb->PutRow(ctx, rb, span.end, span.x, span.y, + span.array->rgba, NULL); } else if (zoom) { _swrast_write_zoomed_rgba_span(ctx, &span, diff --git a/src/mesa/swrast/s_feedback.c b/src/mesa/swrast/s_feedback.c index 892c40db6a2..26cb05cd560 100644 --- a/src/mesa/swrast/s_feedback.c +++ b/src/mesa/swrast/s_feedback.c @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 5.1 + * Version: 6.3 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -54,7 +53,7 @@ static void feedback_vertex( GLcontext *ctx, win[0] = v->win[0]; win[1] = v->win[1]; - win[2] = v->win[2] / ctx->DepthMaxF; + win[2] = v->win[2] / ctx->DrawBuffer->_DepthMaxF; win[3] = 1.0F / v->win[3]; color[0] = CHAN_TO_FLOAT(pv->color[0]); @@ -138,7 +137,7 @@ void _swrast_select_triangle( GLcontext *ctx, const SWvertex *v2) { if (_swrast_culltriangle( ctx, v0, v1, v2 )) { - const GLfloat zs = 1.0F / ctx->DepthMaxF; + const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF; _mesa_update_hitflag( ctx, v0->win[2] * zs ); _mesa_update_hitflag( ctx, v1->win[2] * zs ); @@ -149,7 +148,7 @@ void _swrast_select_triangle( GLcontext *ctx, void _swrast_select_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 ) { - const GLfloat zs = 1.0F / ctx->DepthMaxF; + const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF; _mesa_update_hitflag( ctx, v0->win[2] * zs ); _mesa_update_hitflag( ctx, v1->win[2] * zs ); } @@ -157,6 +156,6 @@ void _swrast_select_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 void _swrast_select_point( GLcontext *ctx, const SWvertex *v ) { - const GLfloat zs = 1.0F / ctx->DepthMaxF; + const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF; _mesa_update_hitflag( ctx, v->win[2] * zs ); } diff --git a/src/mesa/swrast/s_imaging.c b/src/mesa/swrast/s_imaging.c index 088215d5350..5c79a7ba95e 100644 --- a/src/mesa/swrast/s_imaging.c +++ b/src/mesa/swrast/s_imaging.c @@ -41,6 +41,11 @@ _swrast_CopyColorTable( GLcontext *ctx, GLchan data[MAX_WIDTH][4]; struct gl_buffer_object *bufferSave; + if (!ctx->ReadBuffer->_ColorReadBuffer) { + /* no readbuffer - OK */ + return; + } + /* Select buffer to read from */ _swrast_use_read_buffer(ctx); @@ -48,7 +53,8 @@ _swrast_CopyColorTable( GLcontext *ctx, width = MAX_WIDTH; /* read the data from framebuffer */ - _swrast_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y, data ); + _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, + width, x, y, data ); /* Restore reading from draw buffer (the default) */ _swrast_use_draw_buffer(ctx); @@ -71,6 +77,11 @@ _swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start, GLchan data[MAX_WIDTH][4]; struct gl_buffer_object *bufferSave; + if (!ctx->ReadBuffer->_ColorReadBuffer) { + /* no readbuffer - OK */ + return; + } + /* Select buffer to read from */ _swrast_use_read_buffer(ctx); @@ -78,7 +89,8 @@ _swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start, width = MAX_WIDTH; /* read the data from framebuffer */ - _swrast_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y, data ); + _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, + width, x, y, data ); /* Restore reading from draw buffer (the default) */ _swrast_use_draw_buffer(ctx); @@ -103,14 +115,19 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, GLchan rgba[MAX_CONVOLUTION_WIDTH][4]; struct gl_buffer_object *bufferSave; + if (!ctx->ReadBuffer->_ColorReadBuffer) { + /* no readbuffer - OK */ + return; + } + /* Select buffer to read from */ _swrast_use_read_buffer(ctx); RENDER_START( swrast, ctx ); /* read the data from framebuffer */ - _swrast_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y, - (GLchan (*)[4]) rgba ); + _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, + width, x, y, (GLchan (*)[4]) rgba ); RENDER_FINISH( swrast, ctx ); @@ -141,6 +158,11 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, GLint i; struct gl_buffer_object *bufferSave; + if (!ctx->ReadBuffer->_ColorReadBuffer) { + /* no readbuffer - OK */ + return; + } + /* Select buffer to read from */ _swrast_use_read_buffer(ctx); @@ -148,8 +170,8 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, /* read pixels from framebuffer */ for (i = 0; i < height; i++) { - _swrast_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y + i, - (GLchan (*)[4]) rgba[i] ); + _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, + width, x, y + i, (GLchan (*)[4]) rgba[i] ); } RENDER_FINISH(swrast,ctx); diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h index efdf1490691..af7aeabf629 100644 --- a/src/mesa/swrast/s_linetemp.h +++ b/src/mesa/swrast/s_linetemp.h @@ -82,6 +82,7 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) #if defined(DEPTH_TYPE) const GLint depthBits = ctx->Visual.depthBits; const GLint fixedToDepthShift = depthBits <= 16 ? FIXED_SHIFT : 0; + struct gl_renderbuffer *zrb = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; #define FixedToDepth(F) ((F) >> fixedToDepthShift) GLint zPtrXstep, zPtrYstep; DEPTH_TYPE *zPtr; @@ -151,7 +152,7 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) return; #ifdef DEPTH_TYPE - zPtr = (DEPTH_TYPE *) _swrast_zbuffer_address(ctx, x0, y0); + zPtr = (DEPTH_TYPE *) zrb->GetPointer(ctx, zrb, x0, y0); #endif #ifdef PIXEL_ADDRESS pixelPtr = (PIXEL_TYPE *) PIXEL_ADDRESS(x0,y0); diff --git a/src/mesa/swrast/s_logic.c b/src/mesa/swrast/s_logic.c index ad27cb7b625..aabe18d9c9a 100644 --- a/src/mesa/swrast/s_logic.c +++ b/src/mesa/swrast/s_logic.c @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 4.1 + * Version: 6.3 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -29,133 +28,151 @@ #include "imports.h" #include "macros.h" -#include "s_alphabuf.h" #include "s_context.h" #include "s_logic.h" #include "s_span.h" +#define LOGIC_OP_LOOP(MODE) \ +do { \ + GLuint i; \ + switch (MODE) { \ + case GL_CLEAR: \ + for (i = 0; i < n; i++) { \ + if (mask[i]) { \ + src[i] = 0; \ + } \ + } \ + break; \ + case GL_SET: \ + for (i = 0; i < n; i++) { \ + if (mask[i]) { \ + src[i] = ~0; \ + } \ + } \ + break; \ + case GL_COPY: \ + /* do nothing */ \ + break; \ + case GL_COPY_INVERTED: \ + for (i = 0; i < n; i++) { \ + if (mask[i]) { \ + src[i] = ~src[i]; \ + } \ + } \ + break; \ + case GL_NOOP: \ + for (i = 0; i < n; i++) { \ + if (mask[i]) { \ + src[i] = dest[i]; \ + } \ + } \ + break; \ + case GL_INVERT: \ + for (i = 0; i < n; i++) { \ + if (mask[i]) { \ + src[i] = ~dest[i]; \ + } \ + } \ + break; \ + case GL_AND: \ + for (i = 0; i < n; i++) { \ + if (mask[i]) { \ + src[i] &= dest[i]; \ + } \ + } \ + break; \ + case GL_NAND: \ + for (i = 0; i < n; i++) { \ + if (mask[i]) { \ + src[i] = ~(src[i] & dest[i]); \ + } \ + } \ + break; \ + case GL_OR: \ + for (i = 0; i < n; i++) { \ + if (mask[i]) { \ + src[i] |= dest[i]; \ + } \ + } \ + break; \ + case GL_NOR: \ + for (i = 0; i < n; i++) { \ + if (mask[i]) { \ + src[i] = ~(src[i] | dest[i]); \ + } \ + } \ + break; \ + case GL_XOR: \ + for (i = 0; i < n; i++) { \ + if (mask[i]) { \ + src[i] ^= dest[i]; \ + } \ + } \ + break; \ + case GL_EQUIV: \ + for (i = 0; i < n; i++) { \ + if (mask[i]) { \ + src[i] = ~(src[i] ^ dest[i]); \ + } \ + } \ + break; \ + case GL_AND_REVERSE: \ + for (i = 0; i < n; i++) { \ + if (mask[i]) { \ + src[i] = src[i] & ~dest[i]; \ + } \ + } \ + break; \ + case GL_AND_INVERTED: \ + for (i = 0; i < n; i++) { \ + if (mask[i]) { \ + src[i] = ~src[i] & dest[i]; \ + } \ + } \ + break; \ + case GL_OR_REVERSE: \ + for (i = 0; i < n; i++) { \ + if (mask[i]) { \ + src[i] = src[i] | ~dest[i]; \ + } \ + } \ + break; \ + case GL_OR_INVERTED: \ + for (i = 0; i < n; i++) { \ + if (mask[i]) { \ + src[i] = ~src[i] | dest[i]; \ + } \ + } \ + break; \ + default: \ + _mesa_problem(ctx, "bad logicop mode");\ + } \ +} while (0) + + -/* - * Apply logic op to array of CI pixels. - */ static void -index_logicop( GLcontext *ctx, GLuint n, GLuint index[], const GLuint dest[], - const GLubyte mask[] ) +logicop_ubyte(GLcontext *ctx, GLuint n, GLubyte src[], const GLubyte dest[], + const GLubyte mask[]) { - GLuint i; - switch (ctx->Color.LogicOp) { - case GL_CLEAR: - for (i=0;iColor.LogicOp); +} + + +static void +logicop_ushort(GLcontext *ctx, GLuint n, GLushort src[], const GLushort dest[], + const GLubyte mask[]) +{ + LOGIC_OP_LOOP(ctx->Color.LogicOp); +} + + +static void +logicop_uint(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[], + const GLubyte mask[]) +{ + LOGIC_OP_LOOP(ctx->Color.LogicOp); } @@ -165,305 +182,35 @@ index_logicop( GLcontext *ctx, GLuint n, GLuint index[], const GLuint dest[], * used if the device driver can't do logic ops. */ void -_swrast_logicop_ci_span( GLcontext *ctx, const struct sw_span *span, - GLuint index[] ) +_swrast_logicop_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, + const struct sw_span *span, GLuint index[]) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); GLuint dest[MAX_WIDTH]; ASSERT(span->end < MAX_WIDTH); /* Read dest values from frame buffer */ if (span->arrayMask & SPAN_XY) { - (*swrast->Driver.ReadCI32Pixels)( ctx, span->end, - span->array->x, span->array->y, - dest, span->array->mask ); + ASSERT(rb->DataType == GL_UNSIGNED_INT); + rb->GetValues(ctx, rb, span->end, span->array->x, span->array->y, dest); } else { - (*swrast->Driver.ReadCI32Span)( ctx, span->end, span->x, span->y, dest ); + ASSERT(rb->DataType == GL_UNSIGNED_INT); + rb->GetRow(ctx, rb, span->end, span->x, span->y, dest); } - index_logicop( ctx, span->end, index, dest, span->array->mask ); + logicop_uint(ctx, span->end, index, dest, span->array->mask); } - -/* - * Apply logic operator to rgba pixels. - * Input: ctx - the context - * n - number of pixels - * mask - pixel mask array - * In/Out: src - incoming pixels which will be modified - * Input: dest - frame buffer values - * - * Note: Since the R, G, B, and A channels are all treated the same we - * process them as 4-byte GLuints instead of four GLubytes. - */ -static void -rgba_logicop_ui( const GLcontext *ctx, GLuint n, const GLubyte mask[], - GLuint src[], const GLuint dest[] ) -{ - GLuint i; - switch (ctx->Color.LogicOp) { - case GL_CLEAR: - for (i=0;iColor.LogicOp) { - case GL_CLEAR: - for (i=0;iarrayMask & SPAN_RGBA); if (span->arrayMask & SPAN_XY) { - (*swrast->Driver.ReadRGBAPixels)(ctx, span->end, - span->array->x, span->array->y, - dest, span->array->mask); - if (SWRAST_CONTEXT(ctx)->_RasterMask & ALPHABUF_BIT) { - _swrast_read_alpha_pixels(ctx, span->end, - span->array->x, span->array->y, - dest, span->array->mask); - } + swrast->Driver.ReadRGBAPixels(ctx, rb, span->end, + span->array->x, span->array->y, + dest, span->array->mask); } else { - _swrast_read_rgba_span(ctx, ctx->DrawBuffer, span->end, - span->x, span->y, dest); + _swrast_read_rgba_span(ctx, rb, span->end, span->x, span->y, dest); } - if (sizeof(GLchan) * 4 == sizeof(GLuint)) { - rgba_logicop_ui(ctx, span->end, span->array->mask, - (GLuint *) rgba, (const GLuint *) dest); - } - else { - rgba_logicop_chan(ctx, 4 * span->end, span->array->mask, - (GLchan *) rgba, (const GLchan *) dest); - } + /* NEW_RENDERBUFFER: XXX make this a runtime test */ +#if CHAN_TYPE == GL_UNSIGNED_BYTE + /* treat 4*GLubyte as GLuint */ + logicop_uint(ctx, span->end, (GLuint *) rgba, + (const GLuint *) dest, span->array->mask); +#elif CHAN_TYPE == GL_UNSIGNED_SHORT + logicop_ushort(ctx, 4 * span->end, (GLushort *) rgba, + (const GLushort *) dest, span->array->mask); +#elif CHAN_TYPE == GL_FLOAT + logicop_uint(ctx, 4 * span->end, (GLuint *) rgba, + (const GLuint *) dest, span->array->mask); +#endif + (void) logicop_ubyte; + (void) logicop_ushort; + (void) logicop_uint; } diff --git a/src/mesa/swrast/s_logic.h b/src/mesa/swrast/s_logic.h index 19ec9c3246f..ce5f183ff65 100644 --- a/src/mesa/swrast/s_logic.h +++ b/src/mesa/swrast/s_logic.h @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 4.1 + * Version: 6.3 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -33,13 +32,13 @@ extern void -_swrast_logicop_ci_span( GLcontext *ctx, const struct sw_span *span, - GLuint index[] ); +_swrast_logicop_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, + const struct sw_span *span, GLuint index[]); extern void -_swrast_logicop_rgba_span( GLcontext *ctx, const struct sw_span *span, - GLchan rgba[][4] ); +_swrast_logicop_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, + const struct sw_span *span, GLchan rgba[][4]); #endif diff --git a/src/mesa/swrast/s_masking.c b/src/mesa/swrast/s_masking.c index 3badb86007e..d5f60a69587 100644 --- a/src/mesa/swrast/s_masking.c +++ b/src/mesa/swrast/s_masking.c @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 4.1 + * Version: 6.3 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -33,7 +32,6 @@ #include "enums.h" #include "macros.h" -#include "s_alphabuf.h" #include "s_context.h" #include "s_masking.h" #include "s_span.h" @@ -41,8 +39,8 @@ void -_swrast_mask_rgba_span( GLcontext *ctx, const struct sw_span *span, - GLchan rgba[][4] ) +_swrast_mask_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, + const struct sw_span *span, GLchan rgba[][4]) { SWcontext *swrast = SWRAST_CONTEXT(ctx); GLchan dest[MAX_WIDTH][4]; @@ -64,15 +62,16 @@ _swrast_mask_rgba_span( GLcontext *ctx, const struct sw_span *span, ASSERT(span->arrayMask & SPAN_RGBA); if (span->arrayMask & SPAN_XY) { - (*swrast->Driver.ReadRGBAPixels)(ctx, n, span->array->x, span->array->y, +#if OLD_RENDERBUFFER + if (swrast->Driver.ReadRGBAPixels) + swrast->Driver.ReadRGBAPixels(ctx, rb, n, span->array->x, span->array->y, dest, span->array->mask); - if (SWRAST_CONTEXT(ctx)->_RasterMask & ALPHABUF_BIT) { - _swrast_read_alpha_pixels(ctx, n, span->array->x, span->array->y, - dest, span->array->mask); - } + else +#endif + rb->GetValues(ctx, rb, n, span->array->x, span->array->y, dest); } else { - _swrast_read_rgba_span(ctx, ctx->DrawBuffer, n, span->x, span->y, dest); + _swrast_read_rgba_span(ctx, rb, n, span->x, span->y, dest); } #if CHAN_BITS == 8 @@ -90,14 +89,12 @@ _swrast_mask_rgba_span( GLcontext *ctx, const struct sw_span *span, } - - /* * Apply glColorMask to a span of RGBA pixels. */ void -_swrast_mask_rgba_array( GLcontext *ctx, - GLuint n, GLint x, GLint y, GLchan rgba[][4] ) +_swrast_mask_rgba_array(GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, GLchan rgba[][4]) { GLchan dest[MAX_WIDTH][4]; GLuint i; @@ -109,7 +106,7 @@ _swrast_mask_rgba_array( GLcontext *ctx, GLuint *rgba32 = (GLuint *) rgba; GLuint *dest32 = (GLuint *) dest; - _swrast_read_rgba_span( ctx, ctx->DrawBuffer, n, x, y, dest ); + _swrast_read_rgba_span( ctx, rb, n, x, y, dest ); for (i = 0; i < n; i++) { rgba32[i] = (rgba32[i] & srcMask) | (dest32[i] & dstMask); } @@ -135,57 +132,46 @@ _swrast_mask_rgba_array( GLcontext *ctx, void -_swrast_mask_index_span( GLcontext *ctx, const struct sw_span *span, - GLuint index[] ) +_swrast_mask_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, + const struct sw_span *span, GLuint index[]) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLuint msrc = ctx->Color.IndexMask; - const GLuint mdest = ~msrc; - GLuint fbindexes[MAX_WIDTH]; + const GLuint srcMask = ctx->Color.IndexMask; + const GLuint dstMask = ~srcMask; + GLuint dest[MAX_WIDTH]; GLuint i; ASSERT(span->arrayMask & SPAN_INDEX); ASSERT(span->end < MAX_WIDTH); + ASSERT(rb->DataType == GL_UNSIGNED_INT); if (span->arrayMask & SPAN_XY) { - - (*swrast->Driver.ReadCI32Pixels)(ctx, span->end, span->array->x, - span->array->y, fbindexes, - span->array->mask); - - for (i = 0; i < span->end; i++) { - index[i] = (index[i] & msrc) | (fbindexes[i] & mdest); - } + rb->GetValues(ctx, rb, span->end, span->array->x, span->array->y, dest); } else { - _swrast_read_index_span(ctx, ctx->DrawBuffer, span->end, span->x, span->y, - fbindexes ); + _swrast_read_index_span(ctx, rb, span->end, span->x, span->y, dest); + } - for (i = 0; i < span->end; i++) { - index[i] = (index[i] & msrc) | (fbindexes[i] & mdest); - } + for (i = 0; i < span->end; i++) { + index[i] = (index[i] & srcMask) | (dest[i] & dstMask); } } - /* - * Apply glIndexMask to a span of CI pixels. + * Apply glIndexMask to an array of CI pixels. */ void -_swrast_mask_index_array( GLcontext *ctx, - GLuint n, GLint x, GLint y, GLuint index[] ) +_swrast_mask_ci_array(GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, GLuint index[]) { + const GLuint srcMask = ctx->Color.IndexMask; + const GLuint dstMask = ~srcMask; + GLuint dest[MAX_WIDTH]; GLuint i; - GLuint fbindexes[MAX_WIDTH]; - GLuint msrc, mdest; - - _swrast_read_index_span( ctx, ctx->DrawBuffer, n, x, y, fbindexes ); - msrc = ctx->Color.IndexMask; - mdest = ~msrc; + _swrast_read_index_span(ctx, rb, n, x, y, dest); for (i=0;idzdx / ctx->DepthMaxF; + src[2] = span->dzdx / ctx->DrawBuffer->_DepthMaxF; src[3] = span->dwdx; } else { src[0] = 0.0; src[1] = 1.0; - src[2] = span->dzdy / ctx->DepthMaxF; + src[2] = span->dzdy / ctx->DrawBuffer->_DepthMaxF; src[3] = span->dwdy; } break; @@ -1180,6 +1180,8 @@ execute_program( GLcontext *ctx, * while the NV extension says it's implementation dependant. */ fetch_texel( ctx, texcoord, 0.0F, inst->TexSrcUnit, color ); + if (color[3]) + printf("color[3] = %f\n", color[3]); store_vector4( inst, machine, color ); } break; @@ -1362,7 +1364,7 @@ init_machine( GLcontext *ctx, struct fp_machine *machine, GLfloat *wpos = machine->Inputs[FRAG_ATTRIB_WPOS]; wpos[0] = (GLfloat) span->x + col; wpos[1] = (GLfloat) span->y; - wpos[2] = (GLfloat) span->array->z[col] / ctx->DepthMaxF; + wpos[2] = (GLfloat) span->array->z[col] / ctx->DrawBuffer->_DepthMaxF; wpos[3] = span->w + col * span->dwdx; } if (inputsRead & (1 << FRAG_ATTRIB_COL0)) { @@ -1444,7 +1446,7 @@ _swrast_exec_fragment_program( GLcontext *ctx, struct sw_span *span ) } /* depth value */ if (program->OutputsWritten & (1 << FRAG_OUTPUT_DEPR)) - span->array->z[i] = IROUND(ctx->FragmentProgram.Machine.Outputs[FRAG_OUTPUT_DEPR][0] * ctx->DepthMaxF); + span->array->z[i] = IROUND(ctx->FragmentProgram.Machine.Outputs[FRAG_OUTPUT_DEPR][0] * ctx->DrawBuffer->_DepthMaxF); } } diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index 7d8112fb9b3..559fed5da6d 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -34,7 +34,6 @@ #include "imports.h" #include "pixel.h" -#include "s_alphabuf.h" #include "s_context.h" #include "s_depth.h" #include "s_span.h" @@ -52,7 +51,10 @@ read_index_pixels( GLcontext *ctx, GLenum type, GLvoid *pixels, const struct gl_pixelstore_attrib *packing ) { + struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; + /* SWcontext *swrast = SWRAST_CONTEXT(ctx); + */ GLint i, readWidth; /* error checking */ @@ -81,8 +83,8 @@ read_index_pixels( GLcontext *ctx, for (i = 0; i < height; i++) { GLuint index[MAX_WIDTH]; GLvoid *dest; - - (*swrast->Driver.ReadCI32Span)(ctx, readWidth, x, y + i, index); + ASSERT(rb->DataType == GL_UNSIGNED_INT); + rb->GetRow(ctx, rb, readWidth, x, y + i, index); dest = _mesa_image_address2d(packing, pixels, width, height, GL_COLOR_INDEX, type, i, 0); @@ -106,9 +108,16 @@ read_depth_pixels( GLcontext *ctx, GLenum type, GLvoid *pixels, const struct gl_pixelstore_attrib *packing ) { + struct gl_renderbuffer *rb + = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; GLint readWidth; GLboolean bias_or_scale; + if (!rb) { + /* no readbuffer - OK */ + return; + } + /* Error checking */ if (ctx->Visual.depthBits <= 0) { /* No depth buffer */ @@ -116,9 +125,6 @@ read_depth_pixels( GLcontext *ctx, return; } - /* XXX: width should never be > MAX_WIDTH since we did clipping earlier */ - readWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width; - if (type != GL_BYTE && type != GL_UNSIGNED_BYTE && type != GL_SHORT && @@ -130,6 +136,9 @@ read_depth_pixels( GLcontext *ctx, return; } + /* XXX: width should never be > MAX_WIDTH since we did clipping earlier */ + readWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width; + bias_or_scale = ctx->Pixel.DepthBias!=0.0 || ctx->Pixel.DepthScale!=1.0; if (type==GL_UNSIGNED_SHORT && ctx->Visual.depthBits == 16 @@ -141,7 +150,7 @@ read_depth_pixels( GLcontext *ctx, GLushort *dst = (GLushort*) _mesa_image_address2d(packing, pixels, width, height, GL_DEPTH_COMPONENT, type, j, 0); GLint i; - _swrast_read_depth_span(ctx, width, x, y, depth); + _swrast_read_depth_span(ctx, rb, width, x, y, depth); for (i = 0; i < width; i++) dst[i] = depth[i]; } @@ -153,7 +162,7 @@ read_depth_pixels( GLcontext *ctx, for (j=0;jReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer; GLint j, readWidth; + if (!rb) { + /* no readbuffer - OK */ + return; + } + if (type != GL_BYTE && type != GL_UNSIGNED_BYTE && type != GL_SHORT && @@ -199,21 +215,21 @@ read_stencil_pixels( GLcontext *ctx, return; } - /* XXX: width should never be > MAX_WIDTH since we did clipping earlier */ - readWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width; - if (ctx->Visual.stencilBits <= 0) { /* No stencil buffer */ _mesa_error( ctx, GL_INVALID_OPERATION, "glReadPixels" ); return; } + /* XXX: width should never be > MAX_WIDTH since we did clipping earlier */ + readWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width; + /* process image row by row */ for (j=0;jReadBuffer->_ColorReadBuffer; /* can't do scale, bias, mapping, etc */ if (ctx->_ImageTransferState) return GL_FALSE; @@ -285,12 +301,16 @@ read_fast_rgba_pixels( GLcontext *ctx, } for (row=0; rowDriver.ReadRGBASpan)(ctx, readWidth, srcX, srcY, +#if OLD_RENDERBUFFER && 0 + (*swrast->Driver.ReadRGBASpan)(ctx, rb, readWidth, srcX, srcY, (GLchan (*)[4]) dest); if (ctx->DrawBuffer->UseSoftwareAlphaBuffers) { _swrast_read_alpha_span(ctx, readWidth, srcX, srcY, (GLchan (*)[4]) dest); } +#else + rb->GetRow(ctx, rb, readWidth, srcX, srcY, dest); +#endif dest += rowLength * 4; srcY++; } @@ -315,22 +335,17 @@ read_rgba_pixels( GLcontext *ctx, GLenum format, GLenum type, GLvoid *pixels, const struct gl_pixelstore_attrib *packing ) { + struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; + /* SWcontext *swrast = SWRAST_CONTEXT(ctx); + */ GLint readWidth; - _swrast_use_read_buffer(ctx); - - /* Try optimized path first */ - if (read_fast_rgba_pixels( ctx, x, y, width, height, - format, type, pixels, packing )) { - - _swrast_use_draw_buffer(ctx); - return; /* done! */ + if (!rb) { + /* No readbuffer is OK with GL_EXT_framebuffer_object */ + return; } - /* XXX: width should never be > MAX_WIDTH since we did clipping earlier */ - readWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width; - /* do error checking on pixel type, format was already checked by caller */ switch (type) { case GL_UNSIGNED_BYTE: @@ -371,6 +386,20 @@ read_rgba_pixels( GLcontext *ctx, return; } + _swrast_use_read_buffer(ctx); + + /* Try optimized path first */ + if (read_fast_rgba_pixels( ctx, x, y, width, height, + format, type, pixels, packing )) { + + _swrast_use_draw_buffer(ctx); + return; /* done! */ + } + + /* XXX: width should never be > MAX_WIDTH since we did clipping earlier */ + readWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width; + + if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) { const GLuint transferOps = ctx->_ImageTransferState; GLfloat *dest, *src, *tmpImage, *convImage; @@ -393,11 +422,12 @@ read_rgba_pixels( GLcontext *ctx, for (row = 0; row < height; row++, y++) { GLchan rgba[MAX_WIDTH][4]; if (ctx->Visual.rgbMode) { - _swrast_read_rgba_span(ctx, ctx->ReadBuffer, readWidth, x, y, rgba); + _swrast_read_rgba_span(ctx, rb, readWidth, x, y, rgba); } else { GLuint index[MAX_WIDTH]; - (*swrast->Driver.ReadCI32Span)(ctx, readWidth, x, y, index); + ASSERT(rb->DataType == GL_UNSIGNED_INT); + rb->GetRow(ctx, rb, readWidth, x, y, index); if (ctx->Pixel.IndexShift != 0 || ctx->Pixel.IndexOffset !=0 ) { _mesa_map_ci(ctx, readWidth, index); } @@ -439,11 +469,12 @@ read_rgba_pixels( GLcontext *ctx, GLchan rgba[MAX_WIDTH][4]; GLvoid *dst; if (ctx->Visual.rgbMode) { - _swrast_read_rgba_span(ctx, ctx->ReadBuffer, readWidth, x, y, rgba); + _swrast_read_rgba_span(ctx, rb, readWidth, x, y, rgba); } else { GLuint index[MAX_WIDTH]; - (*swrast->Driver.ReadCI32Span)(ctx, readWidth, x, y, index); + ASSERT(rb->DataType == GL_UNSIGNED_INT); + rb->GetRow(ctx, rb, readWidth, x, y, index); if (ctx->Pixel.IndexShift != 0 || ctx->Pixel.IndexOffset != 0) { _mesa_map_ci(ctx, readWidth, index); } diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index e6afee1eaa0..6019eff9902 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -2,7 +2,7 @@ * Mesa 3-D graphics library * Version: 6.3 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -38,7 +38,6 @@ #include "s_atifragshader.h" #include "s_alpha.h" -#include "s_alphabuf.h" #include "s_blend.h" #include "s_context.h" #include "s_depth.h" @@ -58,10 +57,11 @@ void _swrast_span_default_z( GLcontext *ctx, struct sw_span *span ) { + const GLfloat depthMax = ctx->DrawBuffer->_DepthMaxF; if (ctx->Visual.depthBits <= 16) - span->z = FloatToFixed(ctx->Current.RasterPos[2] * ctx->DepthMax + 0.5F); + span->z = FloatToFixed(ctx->Current.RasterPos[2] * depthMax + 0.5F); else - span->z = (GLint) (ctx->Current.RasterPos[2] * ctx->DepthMax + 0.5F); + span->z = (GLint) (ctx->Current.RasterPos[2] * depthMax + 0.5F); span->zStep = 0; span->interpMask |= SPAN_Z; } @@ -235,6 +235,7 @@ interpolate_indexes(GLcontext *ctx, struct sw_span *span) } } span->arrayMask |= SPAN_INDEX; + span->interpMask &= ~SPAN_INDEX; } @@ -761,141 +762,22 @@ clip_span( GLcontext *ctx, struct sw_span *span ) } - /** - * Draw to more than one color buffer (or none). - */ -static void -multi_write_index_span( GLcontext *ctx, struct sw_span *span ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLuint bufferBit; - - /* loop over four possible dest color buffers */ - for (bufferBit = 1; bufferBit <= 8; bufferBit <<= 1) { - if (bufferBit & ctx->Color._DrawDestMask[0]) { - GLuint indexTmp[MAX_WIDTH]; - ASSERT(span->end < MAX_WIDTH); - - /* Set the current read/draw buffer */ - swrast->CurrentBufferBit = bufferBit; - (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit); - - /* make copy of incoming indexes */ - MEMCPY( indexTmp, span->array->index, span->end * sizeof(GLuint) ); - - if (ctx->Color.IndexLogicOpEnabled) { - _swrast_logicop_ci_span(ctx, span, indexTmp); - } - - if (ctx->Color.IndexMask != 0xffffffff) { - _swrast_mask_index_span(ctx, span, indexTmp); - } - - if (span->arrayMask & SPAN_XY) { - /* array of pixel coords */ - (*swrast->Driver.WriteCI32Pixels)(ctx, span->end, - span->array->x, span->array->y, - indexTmp, span->array->mask); - } - else { - /* horizontal run of pixels */ - (*swrast->Driver.WriteCI32Span)(ctx, span->end, span->x, span->y, - indexTmp, span->array->mask); - } - } - } - - /* restore default dest buffer */ - _swrast_use_draw_buffer(ctx); -} - - -/** - * Draw to more than one RGBA color buffer (or none). - * All fragment operations, up to (but not) blending/logicop should - * have been done first. - */ -static void -multi_write_rgba_span( GLcontext *ctx, struct sw_span *span ) -{ - const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask); - GLuint bufferBit; - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - ASSERT(colorMask != 0x0); - - if (ctx->Color.DrawBuffer == GL_NONE) - return; - - /* loop over four possible dest color buffers */ - for (bufferBit = 1; bufferBit <= 8; bufferBit <<= 1) { - if (bufferBit & ctx->Color._DrawDestMask[0]) { - GLchan rgbaTmp[MAX_WIDTH][4]; - ASSERT(span->end < MAX_WIDTH); - - /* Set the current read/draw buffer */ - swrast->CurrentBufferBit = bufferBit; - (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit); - - /* make copy of incoming colors */ - MEMCPY( rgbaTmp, span->array->rgba, 4 * span->end * sizeof(GLchan) ); - - if (ctx->Color._LogicOpEnabled) { - _swrast_logicop_rgba_span(ctx, span, rgbaTmp); - } - else if (ctx->Color.BlendEnabled) { - _swrast_blend_span(ctx, span, rgbaTmp); - } - - if (colorMask != 0xffffffff) { - _swrast_mask_rgba_span(ctx, span, rgbaTmp); - } - - if (span->arrayMask & SPAN_XY) { - /* array of pixel coords */ - (*swrast->Driver.WriteRGBAPixels)(ctx, span->end, - span->array->x, span->array->y, - (const GLchan (*)[4]) rgbaTmp, - span->array->mask); - if (SWRAST_CONTEXT(ctx)->_RasterMask & ALPHABUF_BIT) { - _swrast_write_alpha_pixels(ctx, span->end, - span->array->x, span->array->y, - (const GLchan (*)[4]) rgbaTmp, - span->array->mask); - } - } - else { - /* horizontal run of pixels */ - (*swrast->Driver.WriteRGBASpan)(ctx, span->end, span->x, span->y, - (const GLchan (*)[4]) rgbaTmp, - span->array->mask); - if (swrast->_RasterMask & ALPHABUF_BIT) { - _swrast_write_alpha_span(ctx, span->end, span->x, span->y, - (const GLchan (*)[4]) rgbaTmp, - span->array->mask); - } - } - } - } - - /* restore default dest buffer */ - _swrast_use_draw_buffer(ctx); -} - - - -/** - * This function may modify any of the array values in the span. + * Apply all the per-fragment opertions to a span of color index fragments + * and write them to the enabled color drawbuffers. + * The 'span' parameter can be considered to be const. Note that * span->interpMask and span->arrayMask may be changed but will be restored * to their original values before returning. */ void _swrast_write_index_span( GLcontext *ctx, struct sw_span *span) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); + const SWcontext *swrast = SWRAST_CONTEXT(ctx); + const struct gl_framebuffer *fb = ctx->DrawBuffer; + const GLuint output = 0; const GLuint origInterpMask = span->interpMask; const GLuint origArrayMask = span->arrayMask; + GLuint buf; ASSERT(span->end <= MAX_WIDTH); ASSERT(span->primitive == GL_POINT || span->primitive == GL_LINE || @@ -946,7 +828,7 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span) stipple_polygon_span(ctx, span); } - /* Depth test and stencil */ + /* Stencil and Z testing */ if (ctx->Depth.Test || ctx->Stencil.Enabled) { if (span->interpMask & SPAN_Z) _swrast_span_interpolate_z(ctx, span); @@ -960,6 +842,7 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span) else { ASSERT(ctx->Depth.Test); if (!_swrast_depth_test_span(ctx, span)) { + span->interpMask = origInterpMask; span->arrayMask = origArrayMask; return; } @@ -988,10 +871,13 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span) } /* Interpolate the color indexes if needed */ - if (span->interpMask & SPAN_INDEX) { - interpolate_indexes(ctx, span); - /* clear the bit - this allows the WriteMonoCISpan optimization below */ - span->interpMask &= ~SPAN_INDEX; + if (ctx->Fog.Enabled || + ctx->Color.IndexLogicOpEnabled || + ctx->Color.IndexMask != 0xffffffff || + (span->arrayMask & SPAN_COVERAGE)) { + if (span->interpMask & SPAN_INDEX) { + interpolate_indexes(ctx, span); + } } /* Fog */ @@ -1001,61 +887,111 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span) /* Antialias coverage application */ if (span->arrayMask & SPAN_COVERAGE) { - GLuint i; + const GLfloat *coverage = span->array->coverage; GLuint *index = span->array->index; - GLfloat *coverage = span->array->coverage; + GLuint i; for (i = 0; i < span->end; i++) { ASSERT(coverage[i] < 16); index[i] = (index[i] & ~0xf) | ((GLuint) coverage[i]); } } - if (swrast->_RasterMask & MULTI_DRAW_BIT) { - /* draw to zero or two or more buffers */ - multi_write_index_span(ctx, span); - } - else { - /* normal situation: draw to exactly one buffer */ - if (ctx->Color.IndexLogicOpEnabled) { - _swrast_logicop_ci_span(ctx, span, span->array->index); - } + /* Loop over drawing buffers */ + for (buf = 0; buf < fb->_NumColorDrawBuffers[output]; buf++) { + struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[output][buf]; + GLuint indexTemp[MAX_WIDTH], *index32; + + ASSERT(rb->_BaseFormat == GL_COLOR_INDEX); + + if (ctx->Color.IndexLogicOpEnabled || + ctx->Color.IndexMask != 0xffffffff) { + /* make copy of incoming indexes */ + MEMCPY(indexTemp, span->array->index, span->end * sizeof(GLuint)); - if (ctx->Color.IndexMask != 0xffffffff) { - _swrast_mask_index_span(ctx, span, span->array->index); + if (ctx->Color.IndexLogicOpEnabled) { + _swrast_logicop_ci_span(ctx, rb, span, indexTemp); + } + + if (ctx->Color.IndexMask != 0xffffffff) { + _swrast_mask_ci_span(ctx, rb, span, indexTemp); + } + index32 = indexTemp; + } + else { + index32 = span->array->index; } - /* write pixels */ - if (span->arrayMask & SPAN_XY) { - /* array of pixel coords */ - if ((span->interpMask & SPAN_INDEX) && span->indexStep == 0) { - /* all pixels have same color index */ - (*swrast->Driver.WriteMonoCIPixels)(ctx, span->end, - span->array->x, span->array->y, - FixedToInt(span->index), - span->array->mask); + if ((span->interpMask & SPAN_INDEX) && span->indexStep == 0) { + /* all fragments have same color index */ + GLubyte index8; + GLushort index16; + GLuint index32; + void *value; + + if (rb->DataType == GL_UNSIGNED_BYTE) { + index8 = FixedToInt(span->index); + value = &index8; + } + else if (rb->DataType == GL_UNSIGNED_SHORT) { + index16 = FixedToInt(span->index); + value = &index16; } else { - (*swrast->Driver.WriteCI32Pixels)(ctx, span->end, span->array->x, - span->array->y, span->array->index, - span->array->mask ); + ASSERT(rb->DataType == GL_UNSIGNED_INT); + index32 = FixedToInt(span->index); + value = &index32; + } + + if (span->arrayMask & SPAN_XY) { + rb->PutMonoValues(ctx, rb, span->end, span->array->x, + span->array->y, value, span->array->mask); + } + else { + rb->PutMonoRow(ctx, rb, span->end, span->x, span->y, + value, span->array->mask); } } else { - /* horizontal run of pixels */ - if ((span->interpMask & SPAN_INDEX) && span->indexStep == 0) { - /* all pixels have same color index */ - (*swrast->Driver.WriteMonoCISpan)(ctx, span->end, span->x, span->y, - FixedToInt(span->index), - span->array->mask); + /* each fragment is a different color */ + GLubyte index8[MAX_WIDTH]; + GLushort index16[MAX_WIDTH]; + void *values; + + if (rb->DataType == GL_UNSIGNED_BYTE) { + GLuint k; + for (k = 0; k < span->end; k++) { + index8[k] = (GLubyte) index32[k]; + } + values = index8; + } + else if (rb->DataType == GL_UNSIGNED_SHORT) { + GLuint k; + for (k = 0; k < span->end; k++) { + index16[k] = (GLushort) index32[k]; + } + values = index16; } else { - (*swrast->Driver.WriteCI32Span)(ctx, span->end, span->x, span->y, - span->array->index, - span->array->mask); + ASSERT(rb->DataType == GL_UNSIGNED_INT); + values = index32; + } + + if (span->arrayMask & SPAN_XY) { + rb->PutValues(ctx, rb, span->end, span->array->x, span->array->y, + values, span->array->mask); + } + else { + rb->PutRow(ctx, rb, span->end, span->x, span->y, + values, span->array->mask); } } } +#if OLD_RENDERBUFFER + /* restore default dest buffer */ + _swrast_use_draw_buffer(ctx); +#endif + span->interpMask = origInterpMask; span->arrayMask = origArrayMask; } @@ -1087,6 +1023,88 @@ add_colors(GLuint n, GLchan rgba[][4], GLchan specular[][4] ) } +/** + * XXX merge this code into the _swrast_write_rgba_span() routine! + * + * Draw to more than one RGBA color buffer (or none). + * All fragment operations, up to (but not) blending/logicop should + * have been done first. + */ +static void +multi_write_rgba_span( GLcontext *ctx, struct sw_span *span ) +{ + SWcontext *swrast = SWRAST_CONTEXT(ctx); + const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask); + struct gl_framebuffer *fb = ctx->DrawBuffer; + const GLuint output = 0; + GLuint i; + + ASSERT(span->end < MAX_WIDTH); + ASSERT(colorMask != 0x0); + + for (i = 0; i < fb->_NumColorDrawBuffers[output]; i++) { + struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[output][i]; + GLchan rgbaTmp[MAX_WIDTH][4]; + +#if OLD_RENDERBUFFER /* obsolete code */ + GLuint bufferBit = fb->_ColorDrawBit[output][i]; + /* Set the current read/draw buffer */ + swrast->CurrentBufferBit = bufferBit; + (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit); +#endif + + /* make copy of incoming colors */ + MEMCPY( rgbaTmp, span->array->rgba, 4 * span->end * sizeof(GLchan) ); + + if (ctx->Color._LogicOpEnabled) { + _swrast_logicop_rgba_span(ctx, rb, span, rgbaTmp); + } + else if (ctx->Color.BlendEnabled) { + _swrast_blend_span(ctx, rb, span, rgbaTmp); + } + + if (colorMask != 0xffffffff) { + _swrast_mask_rgba_span(ctx, rb, span, rgbaTmp); + } + + if (span->arrayMask & SPAN_XY) { + /* array of pixel coords */ + if (rb->PutValues) { + rb->PutValues(ctx, rb, span->end, span->array->x, + span->array->y, rgbaTmp, span->array->mask); + } +#if OLD_RENDERBUFFER + else { + swrast->Driver.WriteRGBAPixels(ctx, rb, span->end, + span->array->x, span->array->y, + (const GLchan (*)[4]) rgbaTmp, + span->array->mask); + } +#endif + } + else { + /* horizontal run of pixels */ + if (rb->PutRow) { + rb->PutRow(ctx, rb, span->end, span->x, span->y, rgbaTmp, + span->array->mask); + } +#if OLD_RENDERBUFFER + else { + swrast->Driver.WriteRGBASpan(ctx, rb, span->end, span->x, span->y, + (const GLchan (*)[4]) rgbaTmp, + span->array->mask); + } +#endif + } + } + +#if OLD_RENDERBUFFER + /* restore default dest buffer */ + _swrast_use_draw_buffer(ctx); +#endif +} + + /** * Apply all the per-fragment operations to a span. * This now includes texturing (_swrast_write_texture_span() is history). @@ -1194,7 +1212,7 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span) if (span->interpMask & SPAN_Z) _swrast_span_interpolate_z(ctx, span); - if (ctx->Stencil.Enabled) { + if (ctx->Stencil.Enabled && ctx->DrawBuffer->Visual.stencilBits > 0) { /* Combined Z/stencil tests */ if (!_swrast_stencil_and_ztest_span(ctx, span)) { span->interpMask = origInterpMask; @@ -1202,7 +1220,7 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span) return; } } - else { + else if (ctx->DrawBuffer->Visual.depthBits > 0) { /* Just regular depth testing */ ASSERT(ctx->Depth.Test); ASSERT(span->arrayMask & SPAN_Z); @@ -1302,41 +1320,54 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span) } else { /* normal: write to exactly one buffer */ + struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0]; + if (ctx->Color._LogicOpEnabled) { - _swrast_logicop_rgba_span(ctx, span, span->array->rgba); + _swrast_logicop_rgba_span(ctx, rb, span, span->array->rgba); } else if (ctx->Color.BlendEnabled) { - _swrast_blend_span(ctx, span, span->array->rgba); + _swrast_blend_span(ctx, rb, span, span->array->rgba); } /* Color component masking */ if (colorMask != 0xffffffff) { - _swrast_mask_rgba_span(ctx, span, span->array->rgba); + _swrast_mask_rgba_span(ctx, rb, span, span->array->rgba); } /* Finally, write the pixels to a color buffer */ if (span->arrayMask & SPAN_XY) { /* array of pixel coords */ - swrast->Driver.WriteRGBAPixels(ctx, span->end, span->array->x, + if (rb->PutValues) { + ASSERT(rb->_BaseFormat == GL_RGB || rb->_BaseFormat == GL_RGBA); + /* XXX check datatype */ + rb->PutValues(ctx, rb, span->end, span->array->x, span->array->y, + span->array->rgba, span->array->mask); + } +#ifdef OLD_RENDERBUFFER + else + { + swrast->Driver.WriteRGBAPixels(ctx, rb, span->end, span->array->x, span->array->y, (const GLchan (*)[4]) span->array->rgba, span->array->mask); - if (SWRAST_CONTEXT(ctx)->_RasterMask & ALPHABUF_BIT) { - _swrast_write_alpha_pixels(ctx, span->end, - span->array->x, span->array->y, - (const GLchan (*)[4]) span->array->rgba, - span->array->mask); } +#endif } else { /* horizontal run of pixels */ - swrast->Driver.WriteRGBASpan(ctx, span->end, span->x, span->y, + if (rb->PutRow) { + ASSERT(rb->_BaseFormat == GL_RGB || rb->_BaseFormat == GL_RGBA); + /* XXX check datatype */ + rb->PutRow(ctx, rb, span->end, span->x, span->y, span->array->rgba, + span->writeAll ? NULL : span->array->mask); + } +#ifdef OLD_RENDERBUFFER + else + { + swrast->Driver.WriteRGBASpan(ctx, rb, span->end, span->x, span->y, (const GLchan (*)[4]) span->array->rgba, span->writeAll ? NULL : span->array->mask); - if (swrast->_RasterMask & ALPHABUF_BIT) { - _swrast_write_alpha_span(ctx, span->end, span->x, span->y, - (const GLchan (*)[4]) span->array->rgba, - span->writeAll ? NULL : span->array->mask); } +#endif } } @@ -1351,16 +1382,16 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span) * reading ouside the buffer's boundaries. */ void -_swrast_read_rgba_span( GLcontext *ctx, GLframebuffer *buffer, +_swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, GLchan rgba[][4] ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLint bufWidth = (GLint) buffer->Width; - const GLint bufHeight = (GLint) buffer->Height; + const GLint bufWidth = (GLint) rb->Width; + const GLint bufHeight = (GLint) rb->Height; if (y < 0 || y >= bufHeight || x + (GLint) n < 0 || x >= bufWidth) { /* completely above, below, or right */ - /* XXX maybe leave undefined? */ + /* XXX maybe leave rgba values undefined? */ _mesa_bzero(rgba, 4 * n * sizeof(GLchan)); } else { @@ -1392,10 +1423,22 @@ _swrast_read_rgba_span( GLcontext *ctx, GLframebuffer *buffer, length = (GLint) n; } - (*swrast->Driver.ReadRGBASpan)( ctx, length, x + skip, y, rgba + skip ); - if (buffer->UseSoftwareAlphaBuffers) { - _swrast_read_alpha_span(ctx, length, x + skip, y, rgba + skip); + if (rb && rb->GetRow) { + assert(rb->_BaseFormat == GL_RGB || rb->_BaseFormat == GL_RGBA); + assert(rb->DataType == GL_UNSIGNED_BYTE); + rb->GetRow(ctx, rb, length, x + skip, y, rgba + skip); + } +#if OLD_RENDERBUFFER + else { + swrast->Driver.ReadRGBASpan(ctx, rb, length, x + skip, y, + rgba + skip); + /* + if (buffer->UseSoftwareAlphaBuffers) { + _swrast_read_alpha_span(ctx, length, x + skip, y, rgba + skip); + } + */ } +#endif } } @@ -1405,16 +1448,15 @@ _swrast_read_rgba_span( GLcontext *ctx, GLframebuffer *buffer, * reading ouside the buffer's boundaries. */ void -_swrast_read_index_span( GLcontext *ctx, GLframebuffer *buffer, - GLuint n, GLint x, GLint y, GLuint indx[] ) +_swrast_read_index_span( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, GLuint index[] ) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLint bufWidth = (GLint) buffer->Width; - const GLint bufHeight = (GLint) buffer->Height; + const GLint bufWidth = (GLint) rb->Width; + const GLint bufHeight = (GLint) rb->Height; if (y < 0 || y >= bufHeight || x + (GLint) n < 0 || x >= bufWidth) { /* completely above, below, or right */ - _mesa_bzero(indx, n * sizeof(GLuint)); + _mesa_bzero(index, n * sizeof(GLuint)); } else { GLint skip, length; @@ -1445,6 +1487,25 @@ _swrast_read_index_span( GLcontext *ctx, GLframebuffer *buffer, length = (GLint) n; } - (*swrast->Driver.ReadCI32Span)( ctx, length, skip + x, y, indx + skip ); + ASSERT(rb->GetRow); + ASSERT(rb->_BaseFormat == GL_COLOR_INDEX); + + if (rb->DataType == GL_UNSIGNED_BYTE) { + GLubyte index8[MAX_WIDTH]; + GLint i; + rb->GetRow(ctx, rb, length, x + skip, y, index8); + for (i = 0; i < length; i++) + index[skip + i] = index8[i]; + } + else if (rb->DataType == GL_UNSIGNED_SHORT) { + GLushort index16[MAX_WIDTH]; + GLint i; + rb->GetRow(ctx, rb, length, x + skip, y, index16); + for (i = 0; i < length; i++) + index[skip + i] = index16[i]; + } + else if (rb->DataType == GL_UNSIGNED_INT) { + rb->GetRow(ctx, rb, length, x + skip, y, index + skip); + } } } diff --git a/src/mesa/swrast/s_span.h b/src/mesa/swrast/s_span.h index 29c485c4d0c..789010bd7fc 100644 --- a/src/mesa/swrast/s_span.h +++ b/src/mesa/swrast/s_span.h @@ -2,7 +2,7 @@ * Mesa 3-D graphics library * Version: 6.3 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -60,11 +60,11 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span); extern void -_swrast_read_rgba_span( GLcontext *ctx, GLframebuffer *buffer, +_swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, GLchan rgba[][4] ); extern void -_swrast_read_index_span( GLcontext *ctx, GLframebuffer *buffer, +_swrast_read_index_span( GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, GLuint indx[] ); #endif diff --git a/src/mesa/swrast/s_spantemp.h b/src/mesa/swrast/s_spantemp.h index 1ce0b00bef9..5c67758035f 100644 --- a/src/mesa/swrast/s_spantemp.h +++ b/src/mesa/swrast/s_spantemp.h @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 5.1 + * Version: 6.3 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -52,12 +51,14 @@ #ifdef STORE_RGBA_PIXEL static void -NAME(write_rgba_span)( const GLcontext *ctx, GLuint n, GLint x, GLint y, - CONST GLchan rgba[][4], const GLubyte mask[] ) +NAME(write_rgba_span)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *values, const GLubyte mask[] ) { #ifdef SPAN_VARS SPAN_VARS #endif + const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; GLuint i; INIT_PIXEL_PTR(pixel, x, y); if (mask) { @@ -79,12 +80,14 @@ NAME(write_rgba_span)( const GLcontext *ctx, GLuint n, GLint x, GLint y, } static void -NAME(write_rgb_span)( const GLcontext *ctx, GLuint n, GLint x, GLint y, - CONST GLchan rgb[][3], const GLubyte mask[] ) +NAME(write_rgb_span)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *values, const GLubyte mask[] ) { #ifdef SPAN_VARS SPAN_VARS #endif + const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) values; GLuint i; INIT_PIXEL_PTR(pixel, x, y); if (mask) { @@ -106,12 +109,14 @@ NAME(write_rgb_span)( const GLcontext *ctx, GLuint n, GLint x, GLint y, } static void -NAME(write_monorgba_span)( const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLchan color[4], const GLubyte mask[] ) +NAME(write_monorgba_span)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *value, const GLubyte mask[] ) { #ifdef SPAN_VARS SPAN_VARS #endif + const GLubyte *color = (const GLubyte *) value; GLuint i; INIT_PIXEL_PTR(pixel, x, y); if (mask) { @@ -133,13 +138,14 @@ NAME(write_monorgba_span)( const GLcontext *ctx, GLuint n, GLint x, GLint y, } static void -NAME(write_rgba_pixels)( const GLcontext *ctx, GLuint n, - const GLint x[], const GLint y[], - CONST GLchan rgba[][4], const GLubyte mask[] ) +NAME(write_rgba_pixels)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], + const void *values, const GLubyte mask[] ) { #ifdef SPAN_VARS SPAN_VARS #endif + const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values; GLuint i; ASSERT(mask); for (i = 0; i < n; i++) { @@ -152,13 +158,14 @@ NAME(write_rgba_pixels)( const GLcontext *ctx, GLuint n, } static void -NAME(write_monorgba_pixels)( const GLcontext *ctx, +NAME(write_monorgba_pixels)( GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], - const GLchan color[4], const GLubyte mask[] ) + const void *value, const GLubyte mask[] ) { #ifdef SPAN_VARS SPAN_VARS #endif + const GLubyte *color = (const GLubyte *) value; GLuint i; ASSERT(mask); for (i = 0; i < n; i++) { @@ -171,12 +178,13 @@ NAME(write_monorgba_pixels)( const GLcontext *ctx, } static void -NAME(read_rgba_span)( const GLcontext *ctx, GLuint n, GLint x, GLint y, - GLchan rgba[][4] ) +NAME(read_rgba_span)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, void *values ) { #ifdef SPAN_VARS SPAN_VARS #endif + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; GLuint i; INIT_PIXEL_PTR(pixel, x, y); for (i = 0; i < n; i++) { @@ -187,21 +195,20 @@ NAME(read_rgba_span)( const GLcontext *ctx, GLuint n, GLint x, GLint y, } static void -NAME(read_rgba_pixels)( const GLcontext *ctx, +NAME(read_rgba_pixels)( GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], - GLchan rgba[][4], const GLubyte mask[] ) + void *values) { #ifdef SPAN_VARS SPAN_VARS #endif + GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; GLuint i; ASSERT(mask); for (i = 0; i < n; i++) { - if (mask[i]) { - INIT_PIXEL_PTR(pixel, x[i], y[i]); - FETCH_RGBA_PIXEL(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP], - rgba[i][ACOMP], pixel); - } + INIT_PIXEL_PTR(pixel, x[i], y[i]); + FETCH_RGBA_PIXEL(rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP], + rgba[i][ACOMP], pixel); } } @@ -213,38 +220,14 @@ NAME(read_rgba_pixels)( const GLcontext *ctx, #ifdef STORE_CI_PIXEL static void -NAME(write_index32_span)( const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLuint index[], const GLubyte mask[] ) -{ -#ifdef SPAN_VARS - SPAN_VARS -#endif - GLuint i; - INIT_PIXEL_PTR(pixel, x, y); - if (mask) { - for (i = 0; i < n; i++) { - if (mask[i]) { - STORE_CI_PIXEL(pixel, index[i]); - } - INC_PIXEL_PTR(pixel); - } - } - else { - for (i = 0; i < n; i++) { - STORE_CI_PIXEL(pixel, index[i]); - INC_PIXEL_PTR(pixel); - } - } -} - - -static void -NAME(write_index8_span)( const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLubyte index[], const GLubyte mask[] ) +NAME(write_index_span)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *values, const GLubyte mask[] ) { #ifdef SPAN_VARS SPAN_VARS #endif + const GLuint *index = (const GLuint *) values; GLuint i; INIT_PIXEL_PTR(pixel, x, y); if (mask) { @@ -265,12 +248,14 @@ NAME(write_index8_span)( const GLcontext *ctx, GLuint n, GLint x, GLint y, static void -NAME(write_monoindex_span)( const GLcontext *ctx, GLuint n, GLint x, GLint y, - GLuint colorIndex, const GLubyte mask[] ) +NAME(write_monoindex_span)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, + const void *value, const GLubyte mask[] ) { #ifdef SPAN_VARS SPAN_VARS #endif + GLuint colorIndex = *((GLuint *) value); GLuint i; INIT_PIXEL_PTR(pixel, x, y); if (mask) { @@ -291,13 +276,14 @@ NAME(write_monoindex_span)( const GLcontext *ctx, GLuint n, GLint x, GLint y, static void -NAME(write_index_pixels)( const GLcontext *ctx, +NAME(write_index_pixels)( GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], - const GLuint index[], const GLubyte mask[] ) + const void *values, const GLubyte mask[] ) { #ifdef SPAN_VARS SPAN_VARS #endif + const GLuint *index = (const GLuint *) values; GLuint i; ASSERT(mask); for (i = 0; i < n; i++) { @@ -310,13 +296,14 @@ NAME(write_index_pixels)( const GLcontext *ctx, static void -NAME(write_monoindex_pixels)( const GLcontext *ctx, +NAME(write_monoindex_pixels)( GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], - GLuint colorIndex, const GLubyte mask[] ) + const void *value, const GLubyte mask[] ) { #ifdef SPAN_VARS SPAN_VARS #endif + GLuint colorIndex = *((GLuint *) value); GLuint i; ASSERT(mask); for (i = 0; i < n; i++) { @@ -329,12 +316,13 @@ NAME(write_monoindex_pixels)( const GLcontext *ctx, static void -NAME(read_index_span)( const GLcontext *ctx, - GLuint n, GLint x, GLint y, GLuint index[] ) +NAME(read_index_span)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, void *values ) { #ifdef SPAN_VARS SPAN_VARS #endif + GLuint *index = (GLuint *) values; GLuint i; INIT_PIXEL_PTR(pixel, x, y); for (i = 0; i < n; i++) { @@ -345,20 +333,19 @@ NAME(read_index_span)( const GLcontext *ctx, static void -NAME(read_index_pixels)( const GLcontext *ctx, +NAME(read_index_pixels)( GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], - GLuint index[], const GLubyte mask[] ) + void *values ) { #ifdef SPAN_VARS SPAN_VARS #endif + GLuint *index = (GLuint *) values; GLuint i; ASSERT(mask); for (i = 0; i < n; i++) { - if (mask[i] ) { - INIT_PIXEL_PTR(pixel, x[i], y[i]); - FETCH_CI_PIXEL(index[i], pixel); - } + INIT_PIXEL_PTR(pixel, x[i], y[i]); + FETCH_CI_PIXEL(index[i], pixel); } } diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index 38182ad613b..84818771718 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 6.3 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -27,6 +27,7 @@ #include "context.h" #include "macros.h" #include "imports.h" +#include "fbobject.h" #include "s_context.h" #include "s_depth.h" @@ -50,14 +51,6 @@ ENDIF */ -/* - * Return the address of a stencil buffer value given the window coords: - */ -#define STENCIL_ADDRESS(X,Y) \ - (ctx->DrawBuffer->Stencil + ctx->DrawBuffer->Width * (Y) + (X)) - - - /** * Apply the given stencil operator to the array of stencil values. * Don't touch stencil[i] if mask[i] is zero. @@ -415,7 +408,8 @@ do_stencil_test( GLcontext *ctx, GLuint face, GLuint n, GLstencil stencil[], static GLboolean stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span, GLuint face) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); + struct gl_framebuffer *fb = ctx->DrawBuffer; + struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer; GLstencil stencilRow[MAX_WIDTH]; GLstencil *stencil; const GLuint n = span->end; @@ -431,19 +425,13 @@ stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span, GLuint face) ASSERT(span->arrayMask & SPAN_Z); } #endif - - /* Get initial stencil values */ - if (swrast->Driver.WriteStencilSpan) { - /* Get stencil values from the hardware stencil buffer */ - ASSERT(swrast->Driver.ReadStencilSpan); - (*swrast->Driver.ReadStencilSpan)(ctx, n, x, y, stencilRow); + + stencil = rb->GetPointer(ctx, rb, x, y); + if (!stencil) { + rb->GetRow(ctx, rb, n, x, y, stencilRow); stencil = stencilRow; } - else { - /* Get pointer into software stencil buffer */ - stencil = STENCIL_ADDRESS(x, y); - } - + /* * Apply the stencil test to the fragments. * failMask[i] is 1 if the stencil test failed. @@ -507,9 +495,8 @@ stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span, GLuint face) /* * Write updated stencil values back into hardware stencil buffer. */ - if (swrast->Driver.WriteStencilSpan) { - ASSERT(stencil == stencilRow); - (swrast->Driver.WriteStencilSpan)(ctx, n, x, y, stencil, mask ); + if (!rb->GetPointer(ctx, rb, 0, 0)) { + rb->PutRow(ctx, rb, n, x, y, stencil, mask); } span->writeAll = GL_FALSE; @@ -519,6 +506,12 @@ stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span, GLuint face) +/* + * Return the address of a stencil buffer value given the window coords: + */ +#define STENCIL_ADDRESS(X, Y) (stencilStart + (Y) * stride + (X)) + + /** * Apply the given stencil operator for each pixel in the array whose @@ -530,16 +523,21 @@ stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span, GLuint face) * mask - array [n] of flag: 1=apply operator, 0=don't apply operator */ static void -apply_stencil_op_to_pixels( const GLcontext *ctx, +apply_stencil_op_to_pixels( GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLenum oper, GLuint face, const GLubyte mask[] ) { + struct gl_framebuffer *fb = ctx->DrawBuffer; + struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer; const GLstencil ref = ctx->Stencil.Ref[face]; const GLstencil wrtmask = ctx->Stencil.WriteMask[face]; const GLstencil invmask = (GLstencil) (~wrtmask); GLuint i; + GLstencil *stencilStart = (GLubyte *) rb->Data; + const GLuint stride = rb->Width; - ASSERT(!SWRAST_CONTEXT(ctx)->Driver.WriteStencilSpan); /* software stencil buffer only! */ + ASSERT(rb->GetPointer(ctx, rb, 0, 0)); + ASSERT(sizeof(GLstencil) == 1); switch (oper) { case GL_KEEP: @@ -701,16 +699,18 @@ static GLboolean stencil_test_pixels( GLcontext *ctx, GLuint face, GLuint n, const GLint x[], const GLint y[], GLubyte mask[] ) { + const struct gl_framebuffer *fb = ctx->DrawBuffer; + struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer; GLubyte fail[MAX_WIDTH]; GLstencil r, s; GLuint i; GLboolean allfail = GL_FALSE; const GLuint valueMask = ctx->Stencil.ValueMask[face]; + const GLstencil *stencilStart = (GLstencil *) rb->Data; + const GLuint stride = rb->Width; - /* software stencil buffer only! */ - ASSERT(ctx->DrawBuffer->UseSoftwareStencilBuffer); - ASSERT(!SWRAST_CONTEXT(ctx)->Driver.ReadStencilSpan); - ASSERT(!SWRAST_CONTEXT(ctx)->Driver.WriteStencilSpan); + ASSERT(rb->GetPointer(ctx, rb, 0, 0)); + ASSERT(sizeof(GLstencil) == 1); /* * Perform stencil test. The results of this operation are stored @@ -740,7 +740,7 @@ stencil_test_pixels( GLcontext *ctx, GLuint face, GLuint n, r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask); for (i=0;iStencil.Ref[face] & valueMask); for (i=0;iStencil.Ref[face] & valueMask); for (i=0;i s) { /* passed */ @@ -800,7 +800,7 @@ stencil_test_pixels( GLcontext *ctx, GLuint face, GLuint n, r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask); for (i=0;i= s) { /* passed */ @@ -820,7 +820,7 @@ stencil_test_pixels( GLcontext *ctx, GLuint face, GLuint n, r = (GLstencil) (ctx->Stencil.Ref[face] & valueMask); for (i=0;iStencil.Ref[face] & valueMask); for (i=0;iDrawBuffer; + struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer; const GLuint n = span->end; const GLint *x = span->array->x; const GLint *y = span->array->y; GLubyte *mask = span->array->mask; - SWcontext *swrast = SWRAST_CONTEXT(ctx); ASSERT(span->arrayMask & SPAN_XY); ASSERT(ctx->Stencil.Enabled); ASSERT(n <= MAX_WIDTH); - if (swrast->Driver.WriteStencilPixels) { - /*** Hardware stencil buffer ***/ + if (!rb->GetPointer(ctx, rb, 0, 0)) { + /* No direct access */ GLstencil stencil[MAX_WIDTH]; GLubyte origMask[MAX_WIDTH]; - ASSERT(!ctx->DrawBuffer->UseSoftwareStencilBuffer); - ASSERT(swrast->Driver.ReadStencilPixels); - (*swrast->Driver.ReadStencilPixels)(ctx, n, x, y, stencil); + rb->GetValues(ctx, rb, n, x, y, stencil); MEMCPY(origMask, mask, n * sizeof(GLubyte)); @@ -950,14 +949,12 @@ stencil_and_ztest_pixels( GLcontext *ctx, struct sw_span *span, GLuint face ) } /* Write updated stencil values into hardware stencil buffer */ - (swrast->Driver.WriteStencilPixels)(ctx, n, x, y, stencil, origMask); + rb->PutValues(ctx, rb, n, x, y, stencil, origMask); return GL_TRUE; } else { - /*** Software stencil buffer ***/ - - ASSERT(ctx->DrawBuffer->UseSoftwareStencilBuffer); + /* Direct access to stencil buffer */ if (stencil_test_pixels(ctx, face, n, x, y, mask) == GL_FALSE) { /* all fragments failed the stencil test, we're done. */ @@ -1015,6 +1012,39 @@ _swrast_stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span) } +#if 0 +GLuint +clip_span(GLuint bufferWidth, GLuint bufferHeight, + GLint x, GLint y, GLuint *count) +{ + GLuint n = *count; + GLuint skipPixels = 0; + + if (y < 0 || y >= bufferHeight || x + n <= 0 || x >= bufferWidth) { + /* totally out of bounds */ + n = 0; + } + else { + /* left clip */ + if (x < 0) { + skipPixels = -x; + x = 0; + n -= skipPixels; + } + /* right clip */ + if (x + n > bufferWidth) { + GLint dx = x + n - bufferWidth; + n -= dx; + } + } + + *count = n; + + return skipPixels; +} +#endif + + /** * Return a span of stencil values from the stencil buffer. * Used for glRead/CopyPixels @@ -1023,14 +1053,10 @@ _swrast_stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span) * Output: stencil - the array of stencil values */ void -_swrast_read_stencil_span( GLcontext *ctx, - GLint n, GLint x, GLint y, GLstencil stencil[] ) +_swrast_read_stencil_span(GLcontext *ctx, struct gl_renderbuffer *rb, + GLint n, GLint x, GLint y, GLstencil stencil[]) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLint bufWidth = (GLint) ctx->DrawBuffer->Width; - const GLint bufHeight = (GLint) ctx->DrawBuffer->Height; - - if (y < 0 || y >= bufHeight || x + n <= 0 || x >= bufWidth) { + if (y < 0 || y >= rb->Height || x + n <= 0 || x >= rb->Width) { /* span is completely outside framebuffer */ return; /* undefined values OK */ } @@ -1041,29 +1067,15 @@ _swrast_read_stencil_span( GLcontext *ctx, n -= dx; stencil += dx; } - if (x + n > bufWidth) { - GLint dx = x + n - bufWidth; + if (x + n > rb->Width) { + GLint dx = x + n - rb->Width; n -= dx; } if (n <= 0) { return; } - - ASSERT(n >= 0); - if (swrast->Driver.ReadStencilSpan) { - (*swrast->Driver.ReadStencilSpan)( ctx, (GLuint) n, x, y, stencil ); - } - else if (ctx->DrawBuffer->Stencil) { - const GLstencil *s = STENCIL_ADDRESS( x, y ); -#if STENCIL_BITS == 8 - MEMCPY( stencil, s, n * sizeof(GLstencil) ); -#else - GLuint i; - for (i=0;iGetRow(ctx, rb, n, x, y, stencil); } @@ -1076,252 +1088,113 @@ _swrast_read_stencil_span( GLcontext *ctx, * stencil - the array of stencil values */ void -_swrast_write_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y, - const GLstencil stencil[] ) +_swrast_write_stencil_span(GLcontext *ctx, GLint n, GLint x, GLint y, + const GLstencil stencil[] ) { - SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLstencil *ssrc = stencil; - const GLint bufWidth = (GLint) ctx->DrawBuffer->Width; - const GLint bufHeight = (GLint) ctx->DrawBuffer->Height; + struct gl_framebuffer *fb = ctx->DrawBuffer; + struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer; - if (y < 0 || y >= bufHeight || x + n <= 0 || x >= bufWidth) { + if (y < 0 || y >= rb->Height || x + n <= 0 || x >= rb->Width) { /* span is completely outside framebuffer */ return; /* undefined values OK */ } - if (x < 0) { GLint dx = -x; x = 0; n -= dx; - ssrc += dx; + stencil += dx; } - if (x + n > bufWidth) { - GLint dx = x + n - bufWidth; + if (x + n > rb->Width) { + GLint dx = x + n - rb->Width; n -= dx; } if (n <= 0) { return; } - if (swrast->Driver.WriteStencilSpan) { - (*swrast->Driver.WriteStencilSpan)( ctx, n, x, y, ssrc, NULL ); - } - else if (ctx->DrawBuffer->Stencil) { - GLstencil *s = STENCIL_ADDRESS( x, y ); -#if STENCIL_BITS == 8 - MEMCPY( s, ssrc, n * sizeof(GLstencil) ); -#else - GLuint i; - for (i=0;iPutRow(ctx, rb, n, x, y, stencil, NULL); } /** - * Allocate a new stencil buffer. If there's an old one it will be - * deallocated first. The new stencil buffer will be uninitialized. + * Clear the stencil buffer. */ void -_swrast_alloc_stencil_buffer( GLframebuffer *buffer ) +_swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ) { - ASSERT(buffer->UseSoftwareStencilBuffer); - - /* deallocate current stencil buffer if present */ - if (buffer->Stencil) { - MESA_PBUFFER_FREE(buffer->Stencil); - buffer->Stencil = NULL; - } - - /* allocate new stencil buffer */ - buffer->Stencil = (GLstencil *) - MESA_PBUFFER_ALLOC(buffer->Width * buffer->Height * sizeof(GLstencil)); - if (!buffer->Stencil) { - /* out of memory */ - _mesa_error( NULL, GL_OUT_OF_MEMORY, "_swrast_alloc_stencil_buffer" ); - } -} + const GLstencil mask = ctx->Stencil.WriteMask[0]; + const GLstencil invMask = ~mask; + const GLstencil clearVal = (ctx->Stencil.Clear & mask); + GLint x, y, width, height; - - -/** - * Clear the software (malloc'd) stencil buffer. - */ -static void -clear_software_stencil_buffer( GLcontext *ctx ) -{ - if (ctx->Visual.stencilBits==0 || !ctx->DrawBuffer->Stencil) { - /* no stencil buffer */ + if (!rb || mask == 0) return; - } - - if (ctx->Scissor.Enabled) { - /* clear scissor region only */ - const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - if (ctx->Stencil.WriteMask[0] != STENCIL_MAX) { - /* must apply mask to the clear */ - GLint y; - for (y = ctx->DrawBuffer->_Ymin; y < ctx->DrawBuffer->_Ymax; y++) { - const GLstencil mask = ctx->Stencil.WriteMask[0]; - const GLstencil invMask = ~mask; - const GLstencil clearVal = (ctx->Stencil.Clear & mask); - GLstencil *stencil = STENCIL_ADDRESS( ctx->DrawBuffer->_Xmin, y ); - GLint i; - for (i = 0; i < width; i++) { - stencil[i] = (stencil[i] & invMask) | clearVal; - } - } - } - else { - /* no masking */ - GLint y; - for (y = ctx->DrawBuffer->_Ymin; y < ctx->DrawBuffer->_Ymax; y++) { - GLstencil *stencil = STENCIL_ADDRESS( ctx->DrawBuffer->_Xmin, y ); -#if STENCIL_BITS==8 - MEMSET( stencil, ctx->Stencil.Clear, width * sizeof(GLstencil) ); -#else - GLint i; - for (i = 0; i < width; i++) - stencil[i] = ctx->Stencil.Clear; -#endif - } - } - } - else { - /* clear whole stencil buffer */ - if (ctx->Stencil.WriteMask[0] != STENCIL_MAX) { - /* must apply mask to the clear */ - const GLuint n = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height; - GLstencil *stencil = ctx->DrawBuffer->Stencil; - const GLstencil mask = ctx->Stencil.WriteMask[0]; - const GLstencil invMask = ~mask; - const GLstencil clearVal = (ctx->Stencil.Clear & mask); - GLuint i; - for (i = 0; i < n; i++) { - stencil[i] = (stencil[i] & invMask) | clearVal; - } - } - else { - /* clear whole buffer without masking */ - const GLuint n = ctx->DrawBuffer->Width * ctx->DrawBuffer->Height; - GLstencil *stencil = ctx->DrawBuffer->Stencil; - -#if STENCIL_BITS==8 - MEMSET(stencil, ctx->Stencil.Clear, n * sizeof(GLstencil) ); -#else - GLuint i; - for (i = 0; i < n; i++) { - stencil[i] = ctx->Stencil.Clear; - } -#endif - } - } -} + ASSERT(rb->DataType == GL_UNSIGNED_BYTE); + ASSERT(rb->_BaseFormat == GL_STENCIL_INDEX); + /* compute region to clear */ + x = ctx->DrawBuffer->_Xmin; + y = ctx->DrawBuffer->_Ymin; + width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; + height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; -/** - * Clear the hardware (in graphics card) stencil buffer. - * This is done with the Driver.WriteStencilSpan() and Driver.ReadStencilSpan() - * functions. - * Actually, if there is a hardware stencil buffer it really should have - * been cleared in Driver.Clear()! However, if the hardware does not - * support scissored clears or masked clears (i.e. glStencilMask) then - * we have to use the span-based functions. - */ -static void -clear_hardware_stencil_buffer( GLcontext *ctx ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - ASSERT(swrast->Driver.WriteStencilSpan); - ASSERT(swrast->Driver.ReadStencilSpan); - - if (ctx->Scissor.Enabled) { - /* clear scissor region only */ - const GLint x = ctx->DrawBuffer->_Xmin; - const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; + if (rb->GetPointer(ctx, rb, 0, 0)) { + /* Direct buffer access */ if (ctx->Stencil.WriteMask[0] != STENCIL_MAX) { - /* must apply mask to the clear */ - GLint y; - for (y = ctx->DrawBuffer->_Ymin; y < ctx->DrawBuffer->_Ymax; y++) { - const GLstencil mask = ctx->Stencil.WriteMask[0]; - const GLstencil invMask = ~mask; - const GLstencil clearVal = (ctx->Stencil.Clear & mask); - GLstencil stencil[MAX_WIDTH]; - GLint i; - (*swrast->Driver.ReadStencilSpan)(ctx, width, x, y, stencil); - for (i = 0; i < width; i++) { - stencil[i] = (stencil[i] & invMask) | clearVal; + /* need to mask the clear */ + GLint i, j; + for (i = 0; i < height; i++) { + GLubyte *stencil = rb->GetPointer(ctx, rb, x, y + i); + for (j = 0; j < width; j++) { + stencil[j] = (stencil[j] & invMask) | clearVal; } - (*swrast->Driver.WriteStencilSpan)(ctx, width, x, y, stencil, NULL); } } else { - /* no masking */ - GLstencil stencil[MAX_WIDTH]; - GLint y, i; - for (i = 0; i < width; i++) { - stencil[i] = ctx->Stencil.Clear; + /* no bit masking */ + if (width == rb->Width && + rb->InternalFormat == GL_STENCIL_INDEX8_EXT) { + /* optimized case */ + GLubyte *stencil = rb->GetPointer(ctx, rb, x, y); + GLuint len = width * height * sizeof(GLubyte); + _mesa_memset(stencil, clearVal, len); } - for (y = ctx->DrawBuffer->_Ymin; y < ctx->DrawBuffer->_Ymax; y++) { - (*swrast->Driver.WriteStencilSpan)(ctx, width, x, y, stencil, NULL); + else { + /* general case */ + GLint i, j; + for (i = 0; i < height; i++) { + GLubyte *stencil = rb->GetPointer(ctx, rb, x, y + i); + for (j = 0; j < width; j++) { + stencil[j] = clearVal; + } + } } } } else { - /* clear whole stencil buffer */ + /* no direct access */ if (ctx->Stencil.WriteMask[0] != STENCIL_MAX) { - /* must apply mask to the clear */ - const GLstencil mask = ctx->Stencil.WriteMask[0]; - const GLstencil invMask = ~mask; - const GLstencil clearVal = (ctx->Stencil.Clear & mask); - const GLint width = ctx->DrawBuffer->Width; - const GLint height = ctx->DrawBuffer->Height; - const GLint x = ctx->DrawBuffer->_Xmin; - GLint y; - for (y = 0; y < height; y++) { - GLstencil stencil[MAX_WIDTH]; - GLint i; - (*swrast->Driver.ReadStencilSpan)(ctx, width, x, y, stencil); - for (i = 0; i < width; i++) { - stencil[i] = (stencil[i] & invMask) | clearVal; + /* need to mask the clear */ + GLint i, j; + for (i = 0; i < height; i++) { + GLubyte stencil[MAX_WIDTH]; + rb->GetRow(ctx, rb, width, x, y + i, stencil); + for (j = 0; j < width; j++) { + stencil[j] = (stencil[j] & invMask) | clearVal; } - (*swrast->Driver.WriteStencilSpan)(ctx, width, x, y, stencil, NULL); + rb->PutRow(ctx, rb, width, x, y + i, stencil, NULL); } } else { - /* clear whole buffer without masking */ - const GLint width = ctx->DrawBuffer->Width; - const GLint height = ctx->DrawBuffer->Height; - const GLint x = ctx->DrawBuffer->_Xmin; - GLstencil stencil[MAX_WIDTH]; - GLint y, i; - for (i = 0; i < width; i++) { - stencil[i] = ctx->Stencil.Clear; - } - for (y = 0; y < height; y++) { - (*swrast->Driver.WriteStencilSpan)(ctx, width, x, y, stencil, NULL); - } + /* no bit masking */ + const GLubyte clear8 = clearVal; + GLint i; + for (i = 0; i < height; i++) { + rb->PutMonoRow(ctx, rb, width, x, y + i, &clear8, NULL); + } } } } - - -/** - * Clear the stencil buffer (hardware or software). - */ -void -_swrast_clear_stencil_buffer( GLcontext *ctx ) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - if (swrast->Driver.WriteStencilSpan) { - ASSERT(swrast->Driver.ReadStencilSpan); - clear_hardware_stencil_buffer(ctx); - } - else { - clear_software_stencil_buffer(ctx); - } -} diff --git a/src/mesa/swrast/s_stencil.h b/src/mesa/swrast/s_stencil.h index 655f1dc3cf8..fabc25250da 100644 --- a/src/mesa/swrast/s_stencil.h +++ b/src/mesa/swrast/s_stencil.h @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 4.1 + * Version: 6.3 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -37,10 +36,9 @@ extern GLboolean _swrast_stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span); - extern void -_swrast_read_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y, - GLstencil stencil[] ); +_swrast_read_stencil_span(GLcontext *ctx, struct gl_renderbuffer *rb, + GLint n, GLint x, GLint y, GLstencil stencil[]); extern void @@ -49,11 +47,7 @@ _swrast_write_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y, extern void -_swrast_alloc_stencil_buffer( GLframebuffer *buffer ); - - -extern void -_swrast_clear_stencil_buffer( GLcontext *ctx ); +_swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ); #endif diff --git a/src/mesa/swrast/s_texstore.c b/src/mesa/swrast/s_texstore.c index fa6b74b7451..24470a73580 100644 --- a/src/mesa/swrast/s_texstore.c +++ b/src/mesa/swrast/s_texstore.c @@ -79,8 +79,8 @@ read_color_image( GLcontext *ctx, GLint x, GLint y, dst = image; stride = width * 4; for (i = 0; i < height; i++) { - _swrast_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y + i, - (GLchan (*)[4]) dst ); + _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer, + width, x, y + i, (GLchan (*)[4]) dst); dst += stride; } @@ -100,6 +100,8 @@ static GLfloat * read_depth_image( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height ) { + struct gl_renderbuffer *rb + = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; SWcontext *swrast = SWRAST_CONTEXT(ctx); GLfloat *image, *dst; GLint i; @@ -112,7 +114,7 @@ read_depth_image( GLcontext *ctx, GLint x, GLint y, dst = image; for (i = 0; i < height; i++) { - _swrast_read_depth_span_float(ctx, width, x, y + i, dst); + _swrast_read_depth_span_float(ctx, rb, width, x, y + i, dst); dst += width; } diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 4533980455e..48ec2836e8b 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -2,7 +2,7 @@ * Mesa 3-D graphics library * Version: 6.3 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -35,8 +35,6 @@ #include "imports.h" #include "macros.h" #include "texformat.h" -#include "teximage.h" -#include "texstate.h" #include "s_aatriangle.h" #include "s_context.h" @@ -151,6 +149,7 @@ _swrast_culltriangle( GLcontext *ctx, #define SETUP_CODE \ SWcontext *swrast = SWRAST_CONTEXT(ctx); \ + struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];\ struct gl_texture_object *obj = ctx->Texture.Unit[0].Current2D; \ const GLint b = obj->BaseLevel; \ const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \ @@ -179,9 +178,13 @@ _swrast_culltriangle( GLcontext *ctx, span.intTex[0] += span.intTexStep[0]; \ span.intTex[1] += span.intTexStep[1]; \ } \ - (*swrast->Driver.WriteRGBSpan)(ctx, span.end, span.x, span.y, \ + if (swrast->Driver.WriteRGBSpan) \ + swrast->Driver.WriteRGBSpan(ctx, rb, span.end, span.x, span.y, \ (CONST GLchan (*)[3]) span.array->rgb,\ - NULL ); + NULL ); \ + else \ + rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, span.array->rgb, NULL); + #include "s_tritemp.h" @@ -203,6 +206,7 @@ _swrast_culltriangle( GLcontext *ctx, #define SETUP_CODE \ SWcontext *swrast = SWRAST_CONTEXT(ctx); \ + struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][0];\ struct gl_texture_object *obj = ctx->Texture.Unit[0].Current2D; \ const GLint b = obj->BaseLevel; \ const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \ @@ -240,9 +244,13 @@ _swrast_culltriangle( GLcontext *ctx, span.intTex[1] += span.intTexStep[1]; \ span.z += span.zStep; \ } \ - (*swrast->Driver.WriteRGBSpan)(ctx, span.end, span.x, span.y, \ + if (swrast->Driver.WriteRGBSpan) \ + swrast->Driver.WriteRGBSpan(ctx, rb, span.end, span.x, span.y, \ (CONST GLchan (*)[3]) span.array->rgb,\ - span.array->mask ); + span.array->mask ); \ + else \ + rb->PutRowRGB(ctx, rb, span.end, span.x, span.y, span.array->rgb, NULL); + #include "s_tritemp.h" @@ -908,6 +916,8 @@ fast_persp_span(GLcontext *ctx, struct sw_span *span, #define NAME occlusion_zless_triangle #define INTERP_Z 1 #define SETUP_CODE \ + struct gl_renderbuffer *rb \ + = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; \ ASSERT(ctx->Depth.Test); \ ASSERT(!ctx->Depth.Mask); \ ASSERT(ctx->Depth.Func == GL_LESS); \ @@ -918,7 +928,7 @@ fast_persp_span(GLcontext *ctx, struct sw_span *span, if (ctx->Visual.depthBits <= 16) { \ GLuint i; \ const GLushort *zRow = (const GLushort *) \ - _swrast_zbuffer_address(ctx, span.x, span.y); \ + rb->GetPointer(ctx, rb, span.x, span.y); \ for (i = 0; i < span.end; i++) { \ GLdepth z = FixedToDepth(span.z); \ if (z < zRow[i]) { \ @@ -931,7 +941,7 @@ fast_persp_span(GLcontext *ctx, struct sw_span *span, else { \ GLuint i; \ const GLuint *zRow = (const GLuint *) \ - _swrast_zbuffer_address(ctx, span.x, span.y); \ + rb->GetPointer(ctx, rb, span.x, span.y); \ for (i = 0; i < span.end; i++) { \ if ((GLuint)span.z < zRow[i]) { \ ctx->OcclusionResult = GL_TRUE; \ diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h index 0be17ed0b38..fe19a3363f9 100644 --- a/src/mesa/swrast/s_tritemp.h +++ b/src/mesa/swrast/s_tritemp.h @@ -169,9 +169,9 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, } EdgeT; #ifdef INTERP_Z - const GLint depthBits = ctx->Visual.depthBits; + const GLint depthBits = ctx->DrawBuffer->Visual.depthBits; const GLint fixedToDepthShift = depthBits <= 16 ? FIXED_SHIFT : 0; - const GLfloat maxDepth = ctx->DepthMaxF; + const GLfloat maxDepth = ctx->DrawBuffer->_DepthMaxF; #define FixedToDepth(F) ((F) >> fixedToDepthShift) #endif EdgeT eMaj, eTop, eBot; @@ -688,6 +688,8 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #endif #ifdef INTERP_Z # ifdef DEPTH_TYPE + struct gl_renderbuffer *zrb + = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; DEPTH_TYPE *zRow = NULL; GLint dZRowOuter = 0, dZRowInner; /* offset in bytes */ # endif @@ -853,7 +855,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, } # ifdef DEPTH_TYPE zRow = (DEPTH_TYPE *) - _swrast_zbuffer_address(ctx, InterpToInt(fxLeftEdge), span.y); + zrb->GetPointer(ctx, zrb, InterpToInt(fxLeftEdge), span.y); dZRowOuter = (ctx->DrawBuffer->Width + idxOuter) * sizeof(DEPTH_TYPE); # endif } @@ -1065,7 +1067,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, /* ff = fixed-pt fragment */ const GLint right = InterpToInt(fxRightEdge); span.x = InterpToInt(fxLeftEdge); - if (right <= span.x) span.end = 0; else diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h index 8f249d94280..e1dbe0f512a 100644 --- a/src/mesa/swrast/swrast.h +++ b/src/mesa/swrast/swrast.h @@ -2,7 +2,7 @@ * Mesa 3-D graphics library * Version: 6.3 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -78,9 +78,6 @@ struct swrast_device_driver; /* These are the public-access functions exported from swrast. */ -extern void -_swrast_alloc_buffers( GLframebuffer *buffer ); - extern void _swrast_use_read_buffer( GLcontext *ctx ); @@ -260,7 +257,7 @@ _swrast_copy_texsubimage3d(GLcontext *ctx, * Unless otherwise noted, all functions are mandatory. */ struct swrast_device_driver { - +#if OLD_RENDERBUFFER void (*SetBuffer)(GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit); /* * Specifies the current color buffer for span/pixel writing/reading. @@ -274,7 +271,7 @@ struct swrast_device_driver { * DD_BACK_RIGHT_BIT - when using stereo and double buffering * DD_AUXn_BIT - if aux buffers are implemented */ - +#endif /*** *** Functions for synchronizing access to the framebuffer: @@ -297,10 +294,10 @@ struct swrast_device_driver { *** Functions for writing pixels to the frame buffer: ***/ - void (*WriteRGBASpan)( const GLcontext *ctx, + void (*WriteRGBASpan)( const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, CONST GLchan rgba[][4], const GLubyte mask[] ); - void (*WriteRGBSpan)( const GLcontext *ctx, + void (*WriteRGBSpan)( const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, CONST GLchan rgb[][3], const GLubyte mask[] ); /* Write a horizontal run of RGBA or RGB pixels. @@ -308,28 +305,33 @@ struct swrast_device_driver { * If mask is not null, only draw pixel [i] when mask [i] is true. */ - void (*WriteMonoRGBASpan)( const GLcontext *ctx, GLuint n, GLint x, GLint y, + void (*WriteMonoRGBASpan)( const GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, const GLchan color[4], const GLubyte mask[] ); /* Write a horizontal run of RGBA pixels all with the same color. * If mask is NULL, draw all pixels. * If mask is not null, only draw pixel [i] when mask [i] is true. */ - void (*WriteRGBAPixels)( const GLcontext *ctx, + void (*WriteRGBAPixels)( const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], CONST GLchan rgba[][4], const GLubyte mask[] ); /* Write array of RGBA pixels at random locations. */ void (*WriteMonoRGBAPixels)( const GLcontext *ctx, + struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], const GLchan color[4], const GLubyte mask[] ); /* Write an array of mono-RGBA pixels at random locations. */ - void (*WriteCI32Span)( const GLcontext *ctx, GLuint n, GLint x, GLint y, +#if OLD_RENDERBUFFER /* these are obsolete */ + void (*WriteCI32Span)( const GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, const GLuint index[], const GLubyte mask[] ); - void (*WriteCI8Span)( const GLcontext *ctx, GLuint n, GLint x, GLint y, + void (*WriteCI8Span)( const GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, const GLubyte index[], const GLubyte mask[] ); /* Write a horizontal run of CI pixels. One function is for 32bpp * indexes and the other for 8bpp pixels (the common case). You mus @@ -337,8 +339,8 @@ struct swrast_device_driver { * If mask is NULL, draw all pixels. * If mask is not null, only draw pixel [i] when mask [i] is true. */ - - void (*WriteMonoCISpan)( const GLcontext *ctx, GLuint n, GLint x, GLint y, + void (*WriteMonoCISpan)( const GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, GLuint colorIndex, const GLubyte mask[] ); /* Write a horizontal run of color index pixels using the color index * last specified by the Index() function. @@ -346,42 +348,40 @@ struct swrast_device_driver { * If mask is not null, only draw pixel [i] when mask [i] is true. */ - void (*WriteCI32Pixels)( const GLcontext *ctx, + void (*WriteCI32Pixels)( const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], const GLuint index[], const GLubyte mask[] ); /* * Write a random array of CI pixels. */ - - void (*WriteMonoCIPixels)( const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], + void (*WriteMonoCIPixels)( const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], GLuint colorIndex, const GLubyte mask[] ); /* Write a random array of color index pixels using the color index * last specified by the Index() function. */ - /*** *** Functions to read pixels from frame buffer: ***/ - void (*ReadCI32Span)( const GLcontext *ctx, + void (*ReadCI32Span)( const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, GLuint index[] ); /* Read a horizontal run of color index pixels. */ - void (*ReadRGBASpan)( const GLcontext *ctx, GLuint n, GLint x, GLint y, - GLchan rgba[][4] ); - /* Read a horizontal run of RGBA pixels. - */ - - void (*ReadCI32Pixels)( const GLcontext *ctx, + void (*ReadCI32Pixels)( const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], GLuint indx[], const GLubyte mask[] ); /* Read a random array of CI pixels. */ +#endif + + void (*ReadRGBASpan)( const GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, GLchan rgba[][4] ); + /* Read a horizontal run of RGBA pixels. + */ - void (*ReadRGBAPixels)( const GLcontext *ctx, + void (*ReadRGBAPixels)( const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, const GLint x[], const GLint y[], GLchan rgba[][4], const GLubyte mask[] ); /* Read a random array of RGBA pixels. @@ -396,34 +396,36 @@ struct swrast_device_driver { *** buffer is less than 32 bits deep then the extra upperbits are zero. ***/ - void (*WriteDepthSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y, + void (*WriteDepthSpan)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, const GLdepth depth[], const GLubyte mask[] ); /* Write a horizontal span of values into the depth buffer. Only write * depth[i] value if mask[i] is nonzero. */ - void (*WriteMonoDepthSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y, + void (*WriteMonoDepthSpan)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, const GLdepth depth, const GLubyte mask[] ); /* Write a horizontal run of depth values. * If mask is NULL, draw all pixels. * If mask is not null, only draw pixel [i] when mask [i] is true. */ - void (*ReadDepthSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y, - GLdepth depth[] ); + void (*ReadDepthSpan)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, GLdepth depth[] ); /* Read a horizontal span of values from the depth buffer. */ - void (*WriteDepthPixels)( GLcontext *ctx, GLuint n, - const GLint x[], const GLint y[], + void (*WriteDepthPixels)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], const GLdepth depth[], const GLubyte mask[] ); /* Write an array of randomly positioned depth values into the * depth buffer. Only write depth[i] value if mask[i] is nonzero. */ - void (*ReadDepthPixels)( GLcontext *ctx, GLuint n, - const GLint x[], const GLint y[], + void (*ReadDepthPixels)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], GLdepth depth[] ); /* Read an array of randomly positioned depth values from the depth buffer. */ @@ -435,20 +437,21 @@ struct swrast_device_driver { *** Either ALL or NONE of these functions must be implemented! ***/ - void (*WriteStencilSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y, + void (*WriteStencilSpan)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, const GLstencil stencil[], const GLubyte mask[] ); /* Write a horizontal span of stencil values into the stencil buffer. * If mask is NULL, write all stencil values. * Else, only write stencil[i] if mask[i] is non-zero. */ - void (*ReadStencilSpan)( GLcontext *ctx, GLuint n, GLint x, GLint y, - GLstencil stencil[] ); + void (*ReadStencilSpan)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, GLint x, GLint y, GLstencil stencil[] ); /* Read a horizontal span of stencil values from the stencil buffer. */ - void (*WriteStencilPixels)( GLcontext *ctx, GLuint n, - const GLint x[], const GLint y[], + void (*WriteStencilPixels)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], const GLstencil stencil[], const GLubyte mask[] ); /* Write an array of stencil values into the stencil buffer. @@ -456,8 +459,8 @@ struct swrast_device_driver { * Else, only write stencil[i] if mask[i] is non-zero. */ - void (*ReadStencilPixels)( GLcontext *ctx, GLuint n, - const GLint x[], const GLint y[], + void (*ReadStencilPixels)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint n, const GLint x[], const GLint y[], GLstencil stencil[] ); /* Read an array of stencil values from the stencil buffer. */ diff --git a/src/mesa/swrast_setup/ss_tritmp.h b/src/mesa/swrast_setup/ss_tritmp.h index 3465ad39129..34ea1e1e9de 100644 --- a/src/mesa/swrast_setup/ss_tritmp.h +++ b/src/mesa/swrast_setup/ss_tritmp.h @@ -101,7 +101,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (IND & SS_OFFSET_BIT) { - offset = ctx->Polygon.OffsetUnits * ctx->MRD; + offset = ctx->Polygon.OffsetUnits * ctx->DrawBuffer->_MRD; z[0] = v[0]->win[2]; z[1] = v[1]->win[2]; z[2] = v[2]->win[2]; diff --git a/src/mesa/tnl_dd/t_dd_tritmp.h b/src/mesa/tnl_dd/t_dd_tritmp.h index 6ba15cea02d..a822c38255e 100644 --- a/src/mesa/tnl_dd/t_dd_tritmp.h +++ b/src/mesa/tnl_dd/t_dd_tritmp.h @@ -1,9 +1,8 @@ - /* * Mesa 3-D graphics library - * Version: 3.5 + * Version: 6.3 * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -274,7 +273,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if ( bc < 0.0f ) bc = -bc; offset += MAX2( ac, bc ) * ctx->Polygon.OffsetFactor; } - offset *= REVERSE_DEPTH ? -ctx->MRD : ctx->MRD; + offset *= ctx->DrawBuffer->_MRD * (REVERSE_DEPTH ? -1.0 : 1.0); } } @@ -550,7 +549,7 @@ static void TAG(quad)( GLcontext *ctx, if ( bc < 0.0f ) bc = -bc; offset += MAX2( ac, bc ) * ctx->Polygon.OffsetFactor; } - offset *= REVERSE_DEPTH ? -ctx->MRD : ctx->MRD; + offset *= ctx->DrawBuffer->_MRD * (REVERSE_DEPTH ? -1.0 : 1.0); } } -- cgit v1.2.3 From db21f1c84f32d4bd7696774acb86f5480f5138cd Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Wed, 11 May 2005 22:01:20 +0000 Subject: The "P" suffix on APIENTRY and GLAPIENTRY is to be used for pointers to functions, not for functions that return pointers. Restore protoype for glGetString back to its correct form. --- include/GL/gl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 1426df481c2..335e454555e 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -104,7 +104,7 @@ #define APIENTRY GLAPIENTRY #endif -/* "P" suffix for when function returns a pointer */ +/* "P" suffix to be used for a pointer to a function */ #ifndef APIENTRYP #define APIENTRYP APIENTRY * #endif @@ -853,7 +853,7 @@ GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode ); GLAPI GLenum GLAPIENTRY glGetError( void ); -GLAPI const GLubyte GLAPIENTRYP glGetString( GLenum name ); +GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name ); GLAPI void GLAPIENTRY glFinish( void ); -- cgit v1.2.3 From 7012d01d888d482f2c6ad1180231a482026d213a Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Fri, 13 May 2005 18:31:35 +0000 Subject: First attempt at getting egl support up on dumb framebuffer. Seems to be mostly working. Not all of egl API is implemented. --- configs/linux-solo | 8 +- include/GLES/egl.h | 4 +- progs/egl/Makefile | 8 + progs/egl/demo1.c | 2 +- progs/egl/eglinfo.c | 3 +- src/egl/drivers/demo/demo.c | 10 +- src/egl/main/eglapi.c | 62 +++++- src/egl/main/eglconfig.c | 331 +++++++++++++++++++++++++++++++-- src/egl/main/eglconfig.h | 15 +- src/egl/main/eglcontext.c | 2 +- src/egl/main/egldisplay.c | 11 +- src/egl/main/egldisplay.h | 7 +- src/egl/main/egldriver.c | 6 +- src/egl/main/egldriver.h | 7 +- src/egl/main/eglmode.c | 27 ++- src/egl/main/eglmode.h | 7 +- src/egl/main/eglscreen.c | 70 ++++--- src/egl/main/eglscreen.h | 16 +- src/mesa/drivers/dri/Makefile.template | 3 +- src/mesa/drivers/dri/fb/Makefile | 3 +- src/mesa/drivers/dri/fb/fb_dri.c | 3 +- 21 files changed, 524 insertions(+), 81 deletions(-) (limited to 'include') diff --git a/configs/linux-solo b/configs/linux-solo index 9b739c29fd1..cd9d72050ea 100644 --- a/configs/linux-solo +++ b/configs/linux-solo @@ -15,16 +15,16 @@ CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math CXXFLAGS = $(DEFINES) -Wall -O3 -ansi -pedantic -fPIC # Library/program dependencies -DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl +DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl -L$(LIB_DIR) -lEGL -l$(GL_LIB) GL_LIB_DEPS = -lm -lpthread -ldl GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread # Directories -SRC_DIRS = mesa glx/mini glu glut/mini +SRC_DIRS = mesa egl glx/mini glu glut/mini DRIVER_DIRS = dri -PROGRAM_DIRS = miniglx +PROGRAM_DIRS = miniglx egl -#DRI_DIRS = fb ffb gamma sis savage +#DRI_DIRS = ffb gamma sis savage DRI_DIRS = i810 i830 i915 mach64 mga r128 r200 radeon tdfx unichrome fb diff --git a/include/GLES/egl.h b/include/GLES/egl.h index 64acb722a22..c4fc4ad543c 100644 --- a/include/GLES/egl.h +++ b/include/GLES/egl.h @@ -249,11 +249,13 @@ GLAPI EGLBoolean APIENTRY eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, GLAPI EGLBoolean APIENTRY eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value); GLAPI EGLBoolean APIENTRY eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens); GLAPI EGLSurface APIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); -GLAPI EGLBoolean APIENTRY eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface); +GLAPI EGLBoolean APIENTRY eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode); GLAPI EGLBoolean APIENTRY eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y); +GLAPI EGLBoolean APIENTRY eglQueryDisplayMESA(EGLDisplay dpy, EGLint attrib, EGLint *value); GLAPI EGLBoolean APIENTRY eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value); GLAPI EGLBoolean APIENTRY eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface); GLAPI EGLBoolean APIENTRY eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode); +GLAPI const char * APIENTRY eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode); #endif /* EGL_MESA_screen_surface */ diff --git a/progs/egl/Makefile b/progs/egl/Makefile index 27788663d74..55efcb473bb 100644 --- a/progs/egl/Makefile +++ b/progs/egl/Makefile @@ -10,6 +10,7 @@ HEADERS = $(TOP)/include/GLES/egl.h PROGRAMS = \ demo1 \ + demo2 \ eglinfo @@ -28,6 +29,13 @@ demo1.o: demo1.c $(HEADERS) $(CC) -c $(CFLAGS) -I$(TOP)/include demo1.c +demo2: demo2.o $(LIB_DIR)/libEGL.so + $(CC) demo2.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@ + +demo2.o: demo2.c $(HEADERS) + $(CC) -c $(CFLAGS) -I$(TOP)/include demo2.c + + eglinfo: eglinfo.o $(LIB_DIR)/libEGL.so $(CC) eglinfo.o -L$(LIB_DIR) -lEGL -o $@ diff --git a/progs/egl/demo1.c b/progs/egl/demo1.c index f656b547439..8c5a26f6862 100644 --- a/progs/egl/demo1.c +++ b/progs/egl/demo1.c @@ -46,7 +46,7 @@ main(int argc, char *argv[]) /* EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY); */ - EGLDisplay d = eglGetDisplay("!demo"); + EGLDisplay d = eglGetDisplay("!fb_dri"); assert(d); if (!eglInitialize(d, &maj, &min)) { diff --git a/progs/egl/eglinfo.c b/progs/egl/eglinfo.c index a80df6cd9f4..e907d136989 100644 --- a/progs/egl/eglinfo.c +++ b/progs/egl/eglinfo.c @@ -132,7 +132,8 @@ int main(int argc, char *argv[]) { int maj, min; - EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY); +// EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY); + EGLDisplay d = eglGetDisplay("!fb_dri"); if (!eglInitialize(d, &maj, &min)) { printf("eglinfo: eglInitialize failed\n"); diff --git a/src/egl/drivers/demo/demo.c b/src/egl/drivers/demo/demo.c index e5164d657f7..bb5ea194248 100644 --- a/src/egl/drivers/demo/demo.c +++ b/src/egl/drivers/demo/demo.c @@ -56,14 +56,14 @@ demoInitialize(_EGLDriver *drv, EGLDisplay dpy, EGLint *major, EGLint *minor) EGLint i; /* Create a screen */ - scrn = _eglNewScreen(); + scrn = calloc(1, sizeof(*scrn)); _eglAddScreen(disp, scrn); /* Create the screen's modes - silly example */ - _eglAddMode(scrn, 1600, 1200, 32, 72 * 1000); - _eglAddMode(scrn, 1280, 1024, 32, 72 * 1000); - _eglAddMode(scrn, 1280, 1024, 16, 72 * 1000); - _eglAddMode(scrn, 1024, 768, 32, 72 * 1000); + _eglAddMode(scrn, 1600, 1200, 72 * 1000); + _eglAddMode(scrn, 1280, 1024, 72 * 1000); + _eglAddMode(scrn, 1280, 1024, 72 * 1000); + _eglAddMode(scrn, 1024, 768, 72 * 1000); /* Create the display's visual configs - silly example */ for (i = 0; i < 4; i++) { diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index b0bd1eed6cf..0be901c125e 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -346,8 +346,18 @@ void (* APIENTRY eglGetProcAddress(const char *procname))() { "eglWaitGL", (_EGLProc) eglWaitGL }, { "eglWaitNative", (_EGLProc) eglWaitNative }, /* Extensions */ - { "eglShowSurfaceMESA", (_EGLProc) NULL }, - { "eglGetModesMESA", (_EGLProc) NULL }, + { "eglChooseModeMESA", (_EGLProc) eglChooseModeMESA }, + { "eglGetModesMESA", (_EGLProc) eglGetModesMESA }, + { "eglGetModeAttribMESA", (_EGLProc) eglGetModeAttribMESA }, + { "eglGetScreensMESA", (_EGLProc) eglGetScreensMESA }, + { "eglCreateScreenSurfaceMESA", (_EGLProc) eglCreateScreenSurfaceMESA }, + { "eglShowSurfaceMESA", (_EGLProc) eglShowSurfaceMESA }, + { "eglScreenPositionMESA", (_EGLProc) eglScreenPositionMESA }, + { "eglQueryDisplayMESA", (_EGLProc) eglQueryDisplayMESA }, + { "eglQueryScreenMESA", (_EGLProc) eglQueryScreenMESA }, + { "eglQueryScreenSurfaceMESA", (_EGLProc) eglQueryScreenSurfaceMESA }, + { "eglQueryScreenModeMESA", (_EGLProc) eglQueryScreenModeMESA }, + { "eglQueryModeStringMESA", (_EGLProc) eglQueryModeStringMESA }, { NULL, NULL } }; EGLint i; @@ -418,35 +428,67 @@ eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EG EGLSurface eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list) { - return EGL_FALSE; + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->CreateScreenSurfaceMESA(drv, dpy, config, attrib_list); } EGLBoolean -eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface) +eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode) { - return EGL_FALSE; + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->ShowSurfaceMESA(drv, dpy, screen, surface, mode); } EGLBoolean -eglScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA mode) +eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y) { - return EGL_FALSE; + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->ScreenPositionMESA(drv, dpy, screen, x, y); +} + + +EGLBoolean +eglQueryDisplayMESA(EGLDisplay dpy, EGLint attrib, EGLint *value) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->QueryDisplayMESA(drv, dpy, attrib, value); +} + + +EGLBoolean +eglQueryScreenMESA( EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->QueryScreenMESA(drv, dpy, screen, attribute, value); } EGLBoolean eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface) { - return EGL_FALSE; + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->QueryScreenSurfaceMESA(drv, dpy, screen, surface); } EGLBoolean -eglQueryScreenMESA( EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value) +eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode) { - return EGL_FALSE; + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->QueryScreenModeMESA(drv, dpy, screen, mode); } +const char * +eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + return drv->QueryModeStringMESA(drv, dpy, mode); +} + + + + + diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c index 0fb7e260723..ff9a647a8fc 100644 --- a/src/egl/main/eglconfig.c +++ b/src/egl/main/eglconfig.c @@ -1,4 +1,5 @@ #include +#include #include #include #include "eglconfig.h" @@ -19,19 +20,19 @@ _eglInitConfig(_EGLConfig *config, EGLint id) { memset(config, 0, sizeof(*config)); config->Handle = id; - SET_CONFIG_ATTRIB(config, EGL_CONFIG_ID, id); - SET_CONFIG_ATTRIB(config, EGL_BIND_TO_TEXTURE_RGB, EGL_DONT_CARE); - SET_CONFIG_ATTRIB(config, EGL_BIND_TO_TEXTURE_RGBA, EGL_DONT_CARE); - SET_CONFIG_ATTRIB(config, EGL_CONFIG_CAVEAT, EGL_DONT_CARE); - SET_CONFIG_ATTRIB(config, EGL_NATIVE_RENDERABLE, EGL_DONT_CARE); - SET_CONFIG_ATTRIB(config, EGL_NATIVE_VISUAL_TYPE, EGL_DONT_CARE); - SET_CONFIG_ATTRIB(config, EGL_MIN_SWAP_INTERVAL, EGL_DONT_CARE); - SET_CONFIG_ATTRIB(config, EGL_MAX_SWAP_INTERVAL, EGL_DONT_CARE); - SET_CONFIG_ATTRIB(config, EGL_SURFACE_TYPE, EGL_WINDOW_BIT); - SET_CONFIG_ATTRIB(config, EGL_TRANSPARENT_TYPE, EGL_NONE); - SET_CONFIG_ATTRIB(config, EGL_TRANSPARENT_RED_VALUE, EGL_DONT_CARE); - SET_CONFIG_ATTRIB(config, EGL_TRANSPARENT_GREEN_VALUE, EGL_DONT_CARE); - SET_CONFIG_ATTRIB(config, EGL_TRANSPARENT_BLUE_VALUE, EGL_DONT_CARE); + _eglSetConfigAtrib(config, EGL_CONFIG_ID, id); + _eglSetConfigAtrib(config, EGL_BIND_TO_TEXTURE_RGB, EGL_DONT_CARE); + _eglSetConfigAtrib(config, EGL_BIND_TO_TEXTURE_RGBA, EGL_DONT_CARE); + _eglSetConfigAtrib(config, EGL_CONFIG_CAVEAT, EGL_DONT_CARE); + _eglSetConfigAtrib(config, EGL_NATIVE_RENDERABLE, EGL_DONT_CARE); + _eglSetConfigAtrib(config, EGL_NATIVE_VISUAL_TYPE, EGL_DONT_CARE); + _eglSetConfigAtrib(config, EGL_MIN_SWAP_INTERVAL, EGL_DONT_CARE); + _eglSetConfigAtrib(config, EGL_MAX_SWAP_INTERVAL, EGL_DONT_CARE); + _eglSetConfigAtrib(config, EGL_SURFACE_TYPE, EGL_WINDOW_BIT); + _eglSetConfigAtrib(config, EGL_TRANSPARENT_TYPE, EGL_NONE); + _eglSetConfigAtrib(config, EGL_TRANSPARENT_RED_VALUE, EGL_DONT_CARE); + _eglSetConfigAtrib(config, EGL_TRANSPARENT_GREEN_VALUE, EGL_DONT_CARE); + _eglSetConfigAtrib(config, EGL_TRANSPARENT_BLUE_VALUE, EGL_DONT_CARE); } @@ -77,6 +78,79 @@ _eglAddConfig(_EGLDisplay *display, const _EGLConfig *config) } +extern void +_eglSetConfigAtrib(_EGLConfig *config, EGLint attr, EGLint val) +{ + config->Attrib[attr - FIRST_ATTRIB] = val; + + switch (attr) { + case EGL_BUFFER_SIZE: + config->glmode.rgbBits = val; + break; + case EGL_ALPHA_SIZE: + config->glmode.alphaBits = val; + break; + case EGL_BLUE_SIZE: + config->glmode.blueBits = val; + break; + case EGL_GREEN_SIZE: + config->glmode.greenBits = val; + break; + case EGL_RED_SIZE: + config->glmode.redBits = val; + break; + case EGL_DEPTH_SIZE: + config->glmode.depthBits = val; + break; + case EGL_STENCIL_SIZE: + config->glmode.stencilBits = val; + break; + case EGL_CONFIG_CAVEAT: + break; + case EGL_CONFIG_ID: + break; + case EGL_LEVEL: + break; + case EGL_MAX_PBUFFER_HEIGHT: + break; + case EGL_MAX_PBUFFER_PIXELS: + break; + case EGL_MAX_PBUFFER_WIDTH: + break; + case EGL_NATIVE_RENDERABLE: + break; + case EGL_NATIVE_VISUAL_ID: + break; + case EGL_NATIVE_VISUAL_TYPE: + break; + case EGL_SAMPLES: + break; + case EGL_SAMPLE_BUFFERS: + break; + case EGL_SURFACE_TYPE: + break; + case EGL_TRANSPARENT_TYPE: + break; + case EGL_TRANSPARENT_BLUE_VALUE: + break; + case EGL_TRANSPARENT_GREEN_VALUE: + break; + case EGL_TRANSPARENT_RED_VALUE: + break; + case EGL_NONE: + break; + case EGL_BIND_TO_TEXTURE_RGB: + break; + case EGL_BIND_TO_TEXTURE_RGBA: + break; + case EGL_MIN_SWAP_INTERVAL: + break; + case EGL_MAX_SWAP_INTERVAL: + break; + default: + break; + } +} /** * Parse the attrib_list to fill in the fields of the given _egl_config @@ -310,3 +384,234 @@ _eglGetConfigs(_EGLDriver *drv, EGLDisplay dpy, EGLConfig *configs, EGLint confi } return EGL_TRUE; } + + +/** + * Creates a set of \c __GLcontextModes that a driver will expose. + * + * A set of \c __GLcontextModes will be created based on the supplied + * parameters. The number of modes processed will be 2 * + * \c num_depth_stencil_bits * \c num_db_modes. + * + * For the most part, data is just copied from \c depth_bits, \c stencil_bits, + * \c db_modes, and \c visType into each \c __GLcontextModes element. + * However, the meanings of \c fb_format and \c fb_type require further + * explanation. The \c fb_format specifies which color components are in + * each pixel and what the default order is. For example, \c GL_RGB specifies + * that red, green, blue are available and red is in the "most significant" + * position and blue is in the "least significant". The \c fb_type specifies + * the bit sizes of each component and the actual ordering. For example, if + * \c GL_UNSIGNED_SHORT_5_6_5_REV is specified with \c GL_RGB, bits [15:11] + * are the blue value, bits [10:5] are the green value, and bits [4:0] are + * the red value. + * + * One sublte issue is the combination of \c GL_RGB or \c GL_BGR and either + * of the \c GL_UNSIGNED_INT_8_8_8_8 modes. The resulting mask values in the + * \c __GLcontextModes structure is \b identical to the \c GL_RGBA or + * \c GL_BGRA case, except the \c alphaMask is zero. This means that, as + * far as this routine is concerned, \c GL_RGB with \c GL_UNSIGNED_INT_8_8_8_8 + * still uses 32-bits. + * + * If in doubt, look at the tables used in the function. + * + * \param ptr_to_modes Pointer to a pointer to a linked list of + * \c __GLcontextModes. Upon completion, a pointer to + * the next element to be process will be stored here. + * If the function fails and returns \c GL_FALSE, this + * value will be unmodified, but some elements in the + * linked list may be modified. + * \param fb_format Format of the framebuffer. Currently only \c GL_RGB, + * \c GL_RGBA, \c GL_BGR, and \c GL_BGRA are supported. + * \param fb_type Type of the pixels in the framebuffer. Currently only + * \c GL_UNSIGNED_SHORT_5_6_5, + * \c GL_UNSIGNED_SHORT_5_6_5_REV, + * \c GL_UNSIGNED_INT_8_8_8_8, and + * \c GL_UNSIGNED_INT_8_8_8_8_REV are supported. + * \param depth_bits Array of depth buffer sizes to be exposed. + * \param stencil_bits Array of stencil buffer sizes to be exposed. + * \param num_depth_stencil_bits Number of entries in both \c depth_bits and + * \c stencil_bits. + * \param db_modes Array of buffer swap modes. If an element has a + * value of \c GLX_NONE, then it represents a + * single-buffered mode. Other valid values are + * \c GLX_SWAP_EXCHANGE_OML, \c GLX_SWAP_COPY_OML, and + * \c GLX_SWAP_UNDEFINED_OML. See the + * GLX_OML_swap_method extension spec for more details. + * \param num_db_modes Number of entries in \c db_modes. + * \param visType GLX visual type. Usually either \c GLX_TRUE_COLOR or + * \c GLX_DIRECT_COLOR. + * + * \returns + * \c GL_TRUE on success or \c GL_FALSE on failure. Currently the only + * cause of failure is a bad parameter (i.e., unsupported \c fb_format or + * \c fb_type). + * + * \todo + * There is currently no way to support packed RGB modes (i.e., modes with + * exactly 3 bytes per pixel) or floating-point modes. This could probably + * be done by creating some new, private enums with clever names likes + * \c GL_UNSIGNED_3BYTE_8_8_8, \c GL_4FLOAT_32_32_32_32, + * \c GL_4HALF_16_16_16_16, etc. We can cross that bridge when we come to it. + */ +GLboolean +_eglFillInConfigs(_EGLConfig * configs, + GLenum fb_format, GLenum fb_type, + const u_int8_t * depth_bits, const u_int8_t * stencil_bits, + unsigned num_depth_stencil_bits, + const GLenum * db_modes, unsigned num_db_modes, + int visType) { + static const u_int8_t bits_table[3][4] = { + /* R G B A */ + { 5, 6, 5, 0 }, /* Any GL_UNSIGNED_SHORT_5_6_5 */ + { 8, 8, 8, 0 }, /* Any RGB with any GL_UNSIGNED_INT_8_8_8_8 */ + { 8, 8, 8, 8 } /* Any RGBA with any GL_UNSIGNED_INT_8_8_8_8 */ + }; + + /* The following arrays are all indexed by the fb_type masked with 0x07. + * Given the four supported fb_type values, this results in valid array + * indices of 3, 4, 5, and 7. + */ + static const u_int32_t masks_table_rgb[8][4] = { + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000F800, 0x000007E0, 0x0000001F, 0x00000000}, /* 5_6_5 */ + {0x0000001F, 0x000007E0, 0x0000F800, 0x00000000}, /* 5_6_5_REV */ + {0xFF000000, 0x00FF0000, 0x0000FF00, 0x00000000}, /* 8_8_8_8 */ + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x000000FF, 0x0000FF00, 0x00FF0000, 0x00000000} /* 8_8_8_8_REV */ + }; + + static const u_int32_t masks_table_rgba[8][4] = { + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000F800, 0x000007E0, 0x0000001F, 0x00000000}, /* 5_6_5 */ + {0x0000001F, 0x000007E0, 0x0000F800, 0x00000000}, /* 5_6_5_REV */ + {0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF}, /* 8_8_8_8 */ + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000}, /* 8_8_8_8_REV */ + }; + + static const u_int32_t masks_table_bgr[8][4] = { + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000001F, 0x000007E0, 0x0000F800, 0x00000000}, /* 5_6_5 */ + {0x0000F800, 0x000007E0, 0x0000001F, 0x00000000}, /* 5_6_5_REV */ + {0x0000FF00, 0x00FF0000, 0xFF000000, 0x00000000}, /* 8_8_8_8 */ + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000}, /* 8_8_8_8_REV */ + }; + + static const u_int32_t masks_table_bgra[8][4] = { + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x0000001F, 0x000007E0, 0x0000F800, 0x00000000}, /* 5_6_5 */ + {0x0000F800, 0x000007E0, 0x0000001F, 0x00000000}, /* 5_6_5_REV */ + {0x0000FF00, 0x00FF0000, 0xFF000000, 0x000000FF}, /* 8_8_8_8 */ + {0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000}, /* 8_8_8_8_REV */ + }; + + static const u_int8_t bytes_per_pixel[8] = { + 0, 0, 0, 2, 2, 4, 0, 4 + }; + + const u_int8_t * bits; + const u_int32_t * masks; + const int index = fb_type & 0x07; + _EGLConfig *config; + unsigned i; + unsigned j; + unsigned k; + + if ( bytes_per_pixel[index] == 0 ) { + fprintf(stderr, "[%s:%u] Framebuffer type 0x%04x has 0 bytes per pixel.\n", + __FUNCTION__, __LINE__, fb_type); + return GL_FALSE; + } + + /* Valid types are GL_UNSIGNED_SHORT_5_6_5 and GL_UNSIGNED_INT_8_8_8_8 and + * the _REV versions. + * + * Valid formats are GL_RGBA, GL_RGB, and GL_BGRA. + */ + switch ( fb_format ) { + case GL_RGB: + bits = (bytes_per_pixel[index] == 2) ? bits_table[0] : bits_table[1]; + masks = masks_table_rgb[index]; + break; + + case GL_RGBA: + bits = (bytes_per_pixel[index] == 2) ? bits_table[0] : bits_table[2]; + masks = masks_table_rgba[index]; + break; + + case GL_BGR: + bits = (bytes_per_pixel[index] == 2) ? bits_table[0] : bits_table[1]; + masks = masks_table_bgr[index]; + break; + + case GL_BGRA: + bits = (bytes_per_pixel[index] == 2) ? bits_table[0] : bits_table[2]; + masks = masks_table_bgra[index]; + break; + + default: + fprintf(stderr, "[%s:%u] Framebuffer format 0x%04x is not GL_RGB, GL_RGBA, GL_BGR, or GL_BGRA.\n", + __FUNCTION__, __LINE__, fb_format); + return GL_FALSE; + } + + config = configs; + for (k = 0; k < num_depth_stencil_bits; k++) { + for (i = 0; i < num_db_modes; i++) { + for (j = 0; j < 2; j++) { + + _eglSetConfigAtrib(config, EGL_RED_SIZE, bits[0]); + _eglSetConfigAtrib(config, EGL_GREEN_SIZE, bits[1]); + _eglSetConfigAtrib(config, EGL_BLUE_SIZE, bits[2]); + _eglSetConfigAtrib(config, EGL_ALPHA_SIZE, bits[3]); + config->glmode.redMask = masks[0]; + config->glmode.greenMask = masks[1]; + config->glmode.blueMask = masks[2]; + config->glmode.alphaMask = masks[3]; + _eglSetConfigAtrib(config, EGL_BUFFER_SIZE, config->glmode.redBits + config->glmode.greenBits + + config->glmode.blueBits + config->glmode.alphaBits); + + config->glmode.accumRedBits = 16 * j; + config->glmode.accumGreenBits = 16 * j; + config->glmode.accumBlueBits = 16 * j; + config->glmode.accumAlphaBits = (masks[3] != 0) ? 16 * j : 0; + config->glmode.visualRating = (j == 0) ? GLX_NONE : GLX_SLOW_CONFIG; + + _eglSetConfigAtrib(config, EGL_STENCIL_SIZE, stencil_bits[k]); + _eglSetConfigAtrib(config, EGL_DEPTH_SIZE, depth_bits[k]); + + config->glmode.visualType = visType; + config->glmode.renderType = GLX_RGBA_BIT; + config->glmode.drawableType = GLX_WINDOW_BIT; + config->glmode.rgbMode = GL_TRUE; + + if (db_modes[i] == GLX_NONE) { + config->glmode.doubleBufferMode = GL_FALSE; + } else { + config->glmode.doubleBufferMode = GL_TRUE; + config->glmode.swapMethod = db_modes[i]; + } + + config->glmode.haveAccumBuffer = ((config->glmode.accumRedBits + + config->glmode.accumGreenBits + + config->glmode.accumBlueBits + + config->glmode.accumAlphaBits) > 0); + config->glmode.haveDepthBuffer = (config->glmode.depthBits > 0); + config->glmode.haveStencilBuffer = (config->glmode.stencilBits > 0); + + config++; + } + } + } + return GL_TRUE; +} diff --git a/src/egl/main/eglconfig.h b/src/egl/main/eglconfig.h index 874edcdfb6f..5d4d45856cf 100644 --- a/src/egl/main/eglconfig.h +++ b/src/egl/main/eglconfig.h @@ -3,6 +3,7 @@ #include "egltypedefs.h" +#include "GL/internal/glcore.h" #define MAX_ATTRIBS 100 @@ -13,11 +14,11 @@ struct _egl_config { EGLConfig Handle; /* the public/opaque handle which names this config */ EGLint Attrib[MAX_ATTRIBS]; + __GLcontextModes glmode; }; -#define SET_CONFIG_ATTRIB(CONF, ATTR, VAL) ((CONF)->Attrib[(ATTR) - FIRST_ATTRIB] = VAL) #define GET_CONFIG_ATTRIB(CONF, ATTR) ((CONF)->Attrib[(ATTR) - FIRST_ATTRIB]) @@ -33,6 +34,10 @@ extern _EGLConfig * _eglAddConfig(_EGLDisplay *display, const _EGLConfig *config); +extern void +_eglSetConfigAtrib(_EGLConfig *config, EGLint attr, EGLint val); + + extern EGLBoolean _eglParseConfigAttribs(_EGLConfig *config, const EGLint *attrib_list); @@ -57,4 +62,12 @@ extern EGLBoolean _eglGetConfigs(_EGLDriver *drv, EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); +extern GLboolean +_eglFillInConfigs( _EGLConfig *configs, + GLenum fb_format, GLenum fb_type, + const u_int8_t * depth_bits, const u_int8_t * stencil_bits, + unsigned num_depth_stencil_bits, + const GLenum * db_modes, unsigned num_db_modes, + int visType ); + #endif /* EGLCONFIG_INCLUDED */ diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c index e7d833e24ff..1d12a405cfc 100644 --- a/src/egl/main/eglcontext.c +++ b/src/egl/main/eglcontext.c @@ -15,7 +15,7 @@ void _eglInitContext(_EGLContext *ctx) { - /* just init to zer for now */ + /* just init to zero for now */ memset(ctx, 0, sizeof(_EGLContext)); } diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index 0f298108c34..53b4ba9c38e 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -62,10 +62,17 @@ _eglGetCurrentDisplay(void) void -_eglDeleteDisplay(_EGLDisplay *disp) +_eglCleanupDisplay(_EGLDisplay *disp) { /* XXX incomplete */ free(disp->Configs); - free(disp); + free(disp->Name); + /* driver deletes _EGLDisplay */ } + +EGLBoolean +_eglQueryDisplayMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint attrib, EGLint *value) +{ + return EGL_FALSE; +} diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h index 55555e67d8a..1a03fdd4ad9 100644 --- a/src/egl/main/egldisplay.h +++ b/src/egl/main/egldisplay.h @@ -33,7 +33,12 @@ _eglGetCurrentDisplay(void); extern void -_eglDeleteDisplay(_EGLDisplay *disp); +_eglCleanupDisplay(_EGLDisplay *disp); + + +extern EGLBoolean +_eglQueryDisplayMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint attrib, EGLint *value); + #endif /* EGLDISPLAY_INCLUDED */ diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c index 870c06205c6..e2120e383a8 100644 --- a/src/egl/main/egldriver.c +++ b/src/egl/main/egldriver.c @@ -12,7 +12,7 @@ #include "eglsurface.h" -const char *DefaultDriverName = "demo"; +const char *DefaultDriverName = "demodriver"; /** @@ -75,7 +75,7 @@ _eglOpenDriver(_EGLDisplay *dpy, const char *driverName) char driverFilename[1000]; /* XXX also prepend a directory path??? */ - sprintf(driverFilename, "%sdriver.so", driverName); + sprintf(driverFilename, "%s.so", driverName); #if 1 lib = dlopen(driverFilename, RTLD_NOW); @@ -189,9 +189,11 @@ _eglInitDriverFallbacks(_EGLDriver *drv) drv->CreateScreenSurfaceMESA = _eglCreateScreenSurfaceMESA; drv->ShowSurfaceMESA = _eglShowSurfaceMESA; drv->ScreenPositionMESA = _eglScreenPositionMESA; + drv->QueryDisplayMESA = _eglQueryDisplayMESA; drv->QueryScreenMESA = _eglQueryScreenMESA; drv->QueryScreenSurfaceMESA = _eglQueryScreenSurfaceMESA; drv->QueryScreenModeMESA = _eglQueryScreenModeMESA; + drv->QueryModeStringMESA = _eglQueryModeStringMESA; } diff --git a/src/egl/main/egldriver.h b/src/egl/main/egldriver.h index e93155967d6..45bee946d78 100644 --- a/src/egl/main/egldriver.h +++ b/src/egl/main/egldriver.h @@ -45,12 +45,13 @@ typedef EGLBoolean (*GetModesMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenM typedef EGLBoolean (*GetModeAttribMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value); typedef EGLBoolean (*GetScreensMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens); typedef EGLSurface (*CreateScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); -typedef EGLBoolean (*ShowSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface); +typedef EGLBoolean (*ShowSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface, EGLModeMESA mode); typedef EGLBoolean (*ScreenPositionMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y); +typedef EGLBoolean (*QueryDisplayMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLint attrib, EGLint *value); typedef EGLBoolean (*QueryScreenMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value); typedef EGLBoolean (*QueryScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface); typedef EGLBoolean (*QueryScreenModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode); - +typedef const char * (*QueryModeStringMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode); /** @@ -106,9 +107,11 @@ struct _egl_driver CreateScreenSurfaceMESA_t CreateScreenSurfaceMESA; ShowSurfaceMESA_t ShowSurfaceMESA; ScreenPositionMESA_t ScreenPositionMESA; + QueryDisplayMESA_t QueryDisplayMESA; QueryScreenMESA_t QueryScreenMESA; QueryScreenSurfaceMESA_t QueryScreenSurfaceMESA; QueryScreenModeMESA_t QueryScreenModeMESA; + QueryModeStringMESA_t QueryModeStringMESA; }; diff --git a/src/egl/main/eglmode.c b/src/egl/main/eglmode.c index 857fa380c6e..26ea6bd6054 100644 --- a/src/egl/main/eglmode.c +++ b/src/egl/main/eglmode.c @@ -1,5 +1,7 @@ #include #include +#include + #include "egldisplay.h" #include "egldriver.h" #include "eglmode.h" @@ -10,6 +12,16 @@ #define MIN2(A, B) (((A) < (B)) ? (A) : (B)) +static char * +my_strdup(const char *s) +{ + int l = strlen(s); + char *s2 = malloc(l + 1); + strcpy(s2, s); + return s2; +} + + /** * Given an EGLModeMESA handle, return the corresponding _EGLMode object * or null if non-existant. @@ -44,7 +56,7 @@ _eglLookupMode(EGLDisplay dpy, EGLModeMESA mode) */ _EGLMode * _eglAddMode(_EGLScreen *screen, EGLint width, EGLint height, - EGLint depth, EGLint refreshRate) + EGLint refreshRate, char *name) { EGLint n; _EGLMode *newModes; @@ -52,7 +64,6 @@ _eglAddMode(_EGLScreen *screen, EGLint width, EGLint height, assert(screen); assert(width > 0); assert(height > 0); - assert(depth > 0); assert(refreshRate > 0); n = screen->NumModes; @@ -62,9 +73,9 @@ _eglAddMode(_EGLScreen *screen, EGLint width, EGLint height, screen->Modes[n].Handle = n + 1; screen->Modes[n].Width = width; screen->Modes[n].Height = height; - screen->Modes[n].Depth = depth; screen->Modes[n].RefreshRate = refreshRate; screen->Modes[n].Stereo = EGL_FALSE; + screen->Modes[n].Name = my_strdup(name); screen->NumModes++; return screen->Modes + n; } @@ -176,3 +187,13 @@ _eglGetModeAttribMESA(_EGLDriver *drv, EGLDisplay dpy, } return EGL_TRUE; } + + +const char * +_eglQueryModeStringMESA(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode) +{ + _EGLMode *m = _eglLookupMode(dpy, mode); + return m->Name; +} + + diff --git a/src/egl/main/eglmode.h b/src/egl/main/eglmode.h index fa6d8e48fc1..71adef42ed4 100644 --- a/src/egl/main/eglmode.h +++ b/src/egl/main/eglmode.h @@ -11,9 +11,9 @@ struct _egl_mode { EGLModeMESA Handle; /* the public/opaque handle which names this mode */ EGLint Width, Height; /* size in pixels */ - EGLint Depth; /* bits per pixel */ EGLint RefreshRate; /* rate * 1000.0 */ EGLBoolean Stereo; + char *Name; /* Other possible attributes */ /* interlaced */ @@ -27,7 +27,7 @@ _eglLookupMode(EGLDisplay dpy, EGLModeMESA mode); extern _EGLMode * _eglAddMode(_EGLScreen *screen, EGLint width, EGLint height, - EGLint depth, EGLint refreshRate); + EGLint refreshRate, char *name); extern EGLBoolean @@ -46,5 +46,8 @@ _eglGetModeAttribMESA(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value); +extern const char * +_eglQueryModeStringMESA(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode); + #endif /* EGLMODE_INCLUDED */ diff --git a/src/egl/main/eglscreen.c b/src/egl/main/eglscreen.c index 66baa319529..406ad1b4fde 100644 --- a/src/egl/main/eglscreen.c +++ b/src/egl/main/eglscreen.c @@ -13,9 +13,12 @@ #include #include +#include + #include "egldisplay.h" #include "eglglobals.h" #include "eglmode.h" +#include "eglconfig.h" #include "eglsurface.h" #include "eglscreen.h" @@ -23,10 +26,11 @@ /** * Return a new _EGLScreen object. */ -_EGLScreen * -_eglNewScreen(void) +void +_eglInitScreen(_EGLScreen *screen) { - return (_EGLScreen *) calloc(1, sizeof(_EGLScreen)); + /* just init to zero for now */ + memset(screen, 0, sizeof(_EGLScreen)); } @@ -101,14 +105,10 @@ _eglGetScreensMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA *screens, } -/** - * Create a drawing surface which can be directly displayed on a screen. - */ EGLSurface -_eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, +_eglInitScreenSurfaceMESA(_EGLSurface *surf, _EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list) { - _EGLSurface *surf; EGLint width = 0, height = 0; EGLint i; @@ -132,11 +132,11 @@ _eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, return EGL_NO_SURFACE; } - surf = (_EGLSurface *) malloc(sizeof(_EGLSurface)); _eglInitSurface(surf); surf->Width = width; surf->Height = height; surf->Type = EGL_SCREEN_BIT_MESA; + surf->Config = _eglLookupConfig(drv, dpy, config); /* insert into hash table */ _eglSaveSurface(surf); @@ -146,6 +146,25 @@ _eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, } +/** + * Create a drawing surface which can be directly displayed on a screen. + */ +EGLSurface +_eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, + const EGLint *attrib_list) +{ + _EGLSurface *surf; + EGLSurface surface; + + surf = (_EGLSurface *) malloc(sizeof(_EGLSurface)); + surface = _eglInitScreenSurfaceMESA(surf, drv, dpy, config, attrib_list); + if (surface == EGL_NO_SURFACE) + free(surf); + + return surface; +} + + /** * Show the given surface on the named screen. * If surface is EGL_NO_SURFACE, disable the screen's output. @@ -155,31 +174,23 @@ _eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, */ EGLBoolean _eglShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, - EGLSurface surface) + EGLSurface surface, EGLModeMESA m) { _EGLScreen *scrn = _eglLookupScreen(dpy, screen); - _EGLMode *mode; + _EGLMode *mode = _eglLookupMode(dpy, m); if (!scrn) { _eglError(EGL_BAD_SCREEN_MESA, "eglShowSurfaceMESA"); return EGL_FALSE; } - - /* - * XXX: Check if the surface's configuration is compatible with the - * current screen mode. - */ - - mode = scrn->CurrentMode; - if (mode == EGL_NO_MODE_MESA) { - _eglError(EGL_BAD_MODE_MESA, "eglShowSurfaceMESA(no current mode)"); + if (!mode) { + _eglError(EGL_BAD_MODE_MESA, "eglShowSurfaceMESA"); return EGL_FALSE; } if (surface == EGL_NO_SURFACE) { scrn->CurrentSurface = NULL; - } - else { + } else { _EGLSurface *surf = _eglLookupSurface(surface); if (!surf || surf->Type != EGL_SCREEN_BIT_MESA) { _eglError(EGL_BAD_SURFACE, "eglShowSurfaceMESA"); @@ -192,8 +203,8 @@ _eglShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, } scrn->CurrentSurface = surf; + scrn->CurrentMode = mode; } - return EGL_TRUE; } @@ -299,11 +310,20 @@ _eglQueryScreenMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, } - void -_eglDeleteScreen(_EGLScreen *scrn) +_eglDestroyScreenModes(_EGLScreen *scrn) { free(scrn->Modes); +} + + +/** + * Default fallback routine - drivers should usually override this. + */ +void +_eglDestroyScreen(_EGLScreen *scrn) +{ + _eglDestroyScreenModes(scrn); free(scrn); } diff --git a/src/egl/main/eglscreen.h b/src/egl/main/eglscreen.h index 1d1856b96b7..1dff069f746 100644 --- a/src/egl/main/eglscreen.h +++ b/src/egl/main/eglscreen.h @@ -19,8 +19,8 @@ struct _egl_screen }; -extern _EGLScreen * -_eglNewScreen(void); +extern void +_eglInitScreen(_EGLScreen *screen); extern _EGLScreen * @@ -35,12 +35,16 @@ extern EGLBoolean _eglGetScreensMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens); +extern EGLSurface +_eglInitScreenSurfaceMESA(_EGLSurface *surf, _EGLDriver *drv, EGLDisplay dpy, EGLConfig config, + const EGLint *attrib_list); + extern EGLSurface _eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); extern EGLBoolean -_eglShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface); +_eglShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface, EGLModeMESA mode); extern EGLBoolean @@ -69,7 +73,11 @@ _eglQueryScreenMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLin extern void -_eglDeleteScreen(_EGLScreen *scrn); +_eglDestroyScreenModes(_EGLScreen *scrn); + + +extern void +_eglDestroyScreen(_EGLScreen *scrn); #endif /* EGLSCREEN_INCLUDED */ diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template index 81c045667d5..027572c692e 100644 --- a/src/mesa/drivers/dri/Makefile.template +++ b/src/mesa/drivers/dri/Makefile.template @@ -56,7 +56,8 @@ SHARED_INCLUDES = \ -I$(TOP)/src/mesa/transform \ -I$(TOP)/src/mesa/shader \ -I$(TOP)/src/mesa/swrast \ - -I$(TOP)/src/mesa/swrast_setup + -I$(TOP)/src/mesa/swrast_setup \ + -I$(TOP)/src/egl/main ##### RULES ##### diff --git a/src/mesa/drivers/dri/fb/Makefile b/src/mesa/drivers/dri/fb/Makefile index 618f024cc18..12465c9f43b 100644 --- a/src/mesa/drivers/dri/fb/Makefile +++ b/src/mesa/drivers/dri/fb/Makefile @@ -6,7 +6,8 @@ include $(TOP)/configs/current LIBNAME = fb_dri.so DRIVER_SOURCES = \ - fb_dri.c + fb_dri.c \ + fb_egl.c C_SOURCES = \ $(COMMON_SOURCES) \ diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c index 264f8f0b248..eafed1fe98f 100644 --- a/src/mesa/drivers/dri/fb/fb_dri.c +++ b/src/mesa/drivers/dri/fb/fb_dri.c @@ -58,6 +58,7 @@ #include "tnl/t_pipeline.h" #include "drivers/common/driverfuncs.h" +void fbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis); typedef struct { GLcontext *glCtx; /* Mesa context */ @@ -242,7 +243,7 @@ init_core_functions( struct dd_function_table *functions ) -static void +void fbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) { ASSERT(drb->Base.InternalFormat == GL_RGBA); -- cgit v1.2.3 From 8110df4f617cdcbaccb968365e87d32560033149 Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Sat, 14 May 2005 14:11:11 +0000 Subject: Fix compiler warning about missing parameter list --- include/GLES/egl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GLES/egl.h b/include/GLES/egl.h index c4fc4ad543c..9c5d1744ac7 100644 --- a/include/GLES/egl.h +++ b/include/GLES/egl.h @@ -196,7 +196,7 @@ GLAPI EGLDisplay APIENTRY eglGetDisplay (NativeDisplayType display); GLAPI EGLBoolean APIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor); GLAPI EGLBoolean APIENTRY eglTerminate (EGLDisplay dpy); GLAPI const char * APIENTRY eglQueryString (EGLDisplay dpy, EGLint name); -GLAPI void (* APIENTRY eglGetProcAddress (const char *procname))(); +GLAPI void (* APIENTRY eglGetProcAddress (const char *procname))(void); GLAPI EGLBoolean APIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); GLAPI EGLBoolean APIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); -- cgit v1.2.3 From 1c606a9aa1d1fa79fe5c92f42651385917322d5f Mon Sep 17 00:00:00 2001 From: Jon Smirl Date: Sat, 14 May 2005 14:54:38 +0000 Subject: Add empty placeholder for eglCopyContextMESA --- include/GLES/egl.h | 1 + src/egl/main/eglapi.c | 12 ++++++++++++ src/egl/main/eglcontext.c | 8 ++++++++ src/egl/main/eglcontext.h | 3 +++ src/egl/main/egldriver.h | 2 ++ 5 files changed, 26 insertions(+) (limited to 'include') diff --git a/include/GLES/egl.h b/include/GLES/egl.h index 9c5d1744ac7..adb56ec0a98 100644 --- a/include/GLES/egl.h +++ b/include/GLES/egl.h @@ -247,6 +247,7 @@ GLAPI EGLBoolean APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, Na GLAPI EGLBoolean APIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); GLAPI EGLBoolean APIENTRY eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); GLAPI EGLBoolean APIENTRY eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value); +GLAPI EGLBoolean APIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, unsigned long mask); GLAPI EGLBoolean APIENTRY eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens); GLAPI EGLSurface APIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); GLAPI EGLBoolean APIENTRY eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode); diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 0be901c125e..02b944f136c 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -349,6 +349,7 @@ void (* APIENTRY eglGetProcAddress(const char *procname))() { "eglChooseModeMESA", (_EGLProc) eglChooseModeMESA }, { "eglGetModesMESA", (_EGLProc) eglGetModesMESA }, { "eglGetModeAttribMESA", (_EGLProc) eglGetModeAttribMESA }, + { "eglCopyContextMESA", (_EGLProc) eglCopyContextMESA }, { "eglGetScreensMESA", (_EGLProc) eglGetScreensMESA }, { "eglCreateScreenSurfaceMESA", (_EGLProc) eglCreateScreenSurfaceMESA }, { "eglShowSurfaceMESA", (_EGLProc) eglShowSurfaceMESA }, @@ -414,6 +415,17 @@ eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint } +EGLBoolean APIENTRY +eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, unsigned long mask) +{ + _EGLDriver *drv = _eglLookupDriver(dpy); + if (drv) + return drv->CopyContextMESA(drv, dpy, source, dest, mask); + else + return EGL_FALSE; +} + + EGLBoolean eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens) { diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c index 1d12a405cfc..e878cc9d7cf 100644 --- a/src/egl/main/eglcontext.c +++ b/src/egl/main/eglcontext.c @@ -224,3 +224,11 @@ _eglMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface d, EGLSurface r, EGL return EGL_TRUE; } + + +EGLBoolean +_eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, EGLContext dest, unsigned long mask) +{ + return EGL_FALSE; +} + diff --git a/src/egl/main/eglcontext.h b/src/egl/main/eglcontext.h index 00635074201..d2c56fdb075 100644 --- a/src/egl/main/eglcontext.h +++ b/src/egl/main/eglcontext.h @@ -61,4 +61,7 @@ extern EGLBoolean _eglMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); +extern EGLBoolean +_eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, EGLContext dest, unsigned long mask); + #endif /* EGLCONTEXT_INCLUDED */ diff --git a/src/egl/main/egldriver.h b/src/egl/main/egldriver.h index 45bee946d78..bc5e4e2e618 100644 --- a/src/egl/main/egldriver.h +++ b/src/egl/main/egldriver.h @@ -43,6 +43,7 @@ typedef EGLBoolean (*WaitNative_t)(_EGLDriver *drv, EGLDisplay dpy, EGLint engin typedef EGLBoolean (*ChooseModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); typedef EGLBoolean (*GetModesMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint mode_size, EGLint *num_mode); typedef EGLBoolean (*GetModeAttribMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value); +typedef EGLBoolean (*CopyContextMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, EGLContext dest, unsigned long mask); typedef EGLBoolean (*GetScreensMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens); typedef EGLSurface (*CreateScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); typedef EGLBoolean (*ShowSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface, EGLModeMESA mode); @@ -103,6 +104,7 @@ struct _egl_driver ChooseModeMESA_t ChooseModeMESA; GetModesMESA_t GetModesMESA; GetModeAttribMESA_t GetModeAttribMESA; + CopyContextMESA_t CopyContextMESA; GetScreensMESA_t GetScreensMESA; CreateScreenSurfaceMESA_t CreateScreenSurfaceMESA; ShowSurfaceMESA_t ShowSurfaceMESA; -- cgit v1.2.3 From 72a313902bc8eca4b05641695877b255b9a5f06c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 May 2005 02:21:57 +0000 Subject: EGL_MESA_copy_context stuff --- include/GLES/egl.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GLES/egl.h b/include/GLES/egl.h index adb56ec0a98..9d7df401b53 100644 --- a/include/GLES/egl.h +++ b/include/GLES/egl.h @@ -247,7 +247,6 @@ GLAPI EGLBoolean APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, Na GLAPI EGLBoolean APIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); GLAPI EGLBoolean APIENTRY eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); GLAPI EGLBoolean APIENTRY eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value); -GLAPI EGLBoolean APIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, unsigned long mask); GLAPI EGLBoolean APIENTRY eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens); GLAPI EGLSurface APIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); GLAPI EGLBoolean APIENTRY eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode); @@ -261,10 +260,12 @@ GLAPI const char * APIENTRY eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA m #endif /* EGL_MESA_screen_surface */ +#ifndef EGL_MESA_copy_context +#define EGL_MESA_copy_context 1 +GLAPI EGLBoolean APIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask); - - +#endif /* EGL_MESA_copy_context */ #ifdef __cplusplus -- cgit v1.2.3 From 198d6d05b033ece21d094c46390ec0faa7612939 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 17 May 2005 13:22:13 +0000 Subject: remove eglQueryDisplayMESA() --- include/GLES/egl.h | 1 - src/egl/main/eglapi.c | 9 --------- src/egl/main/egldisplay.c | 7 ------- src/egl/main/egldriver.c | 1 - src/egl/main/egldriver.h | 2 -- 5 files changed, 20 deletions(-) (limited to 'include') diff --git a/include/GLES/egl.h b/include/GLES/egl.h index 9d7df401b53..d62786d03dc 100644 --- a/include/GLES/egl.h +++ b/include/GLES/egl.h @@ -251,7 +251,6 @@ GLAPI EGLBoolean APIENTRY eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *scree GLAPI EGLSurface APIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); GLAPI EGLBoolean APIENTRY eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode); GLAPI EGLBoolean APIENTRY eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y); -GLAPI EGLBoolean APIENTRY eglQueryDisplayMESA(EGLDisplay dpy, EGLint attrib, EGLint *value); GLAPI EGLBoolean APIENTRY eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value); GLAPI EGLBoolean APIENTRY eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface); GLAPI EGLBoolean APIENTRY eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode); diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index c5e67ed672a..87160c7f48f 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -354,7 +354,6 @@ void (* APIENTRY eglGetProcAddress(const char *procname))() { "eglCreateScreenSurfaceMESA", (_EGLProc) eglCreateScreenSurfaceMESA }, { "eglShowSurfaceMESA", (_EGLProc) eglShowSurfaceMESA }, { "eglScreenPositionMESA", (_EGLProc) eglScreenPositionMESA }, - { "eglQueryDisplayMESA", (_EGLProc) eglQueryDisplayMESA }, { "eglQueryScreenMESA", (_EGLProc) eglQueryScreenMESA }, { "eglQueryScreenSurfaceMESA", (_EGLProc) eglQueryScreenSurfaceMESA }, { "eglQueryScreenModeMESA", (_EGLProc) eglQueryScreenModeMESA }, @@ -461,14 +460,6 @@ eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y) } -EGLBoolean -eglQueryDisplayMESA(EGLDisplay dpy, EGLint attrib, EGLint *value) -{ - _EGLDriver *drv = _eglLookupDriver(dpy); - return drv->QueryDisplayMESA(drv, dpy, attrib, value); -} - - EGLBoolean eglQueryScreenMESA( EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value) { diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index 53b4ba9c38e..669a4d50841 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -69,10 +69,3 @@ _eglCleanupDisplay(_EGLDisplay *disp) free(disp->Name); /* driver deletes _EGLDisplay */ } - - -EGLBoolean -_eglQueryDisplayMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint attrib, EGLint *value) -{ - return EGL_FALSE; -} diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c index a52a7aa3c90..1aeefbbe48f 100644 --- a/src/egl/main/egldriver.c +++ b/src/egl/main/egldriver.c @@ -189,7 +189,6 @@ _eglInitDriverFallbacks(_EGLDriver *drv) drv->CreateScreenSurfaceMESA = _eglCreateScreenSurfaceMESA; drv->ShowSurfaceMESA = _eglShowSurfaceMESA; drv->ScreenPositionMESA = _eglScreenPositionMESA; - drv->QueryDisplayMESA = _eglQueryDisplayMESA; drv->QueryScreenMESA = _eglQueryScreenMESA; drv->QueryScreenSurfaceMESA = _eglQueryScreenSurfaceMESA; drv->QueryScreenModeMESA = _eglQueryScreenModeMESA; diff --git a/src/egl/main/egldriver.h b/src/egl/main/egldriver.h index cc6d0814bde..ecf630cb7d1 100644 --- a/src/egl/main/egldriver.h +++ b/src/egl/main/egldriver.h @@ -51,7 +51,6 @@ typedef EGLBoolean (*GetScreensMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScree typedef EGLSurface (*CreateScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); typedef EGLBoolean (*ShowSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface, EGLModeMESA mode); typedef EGLBoolean (*ScreenPositionMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y); -typedef EGLBoolean (*QueryDisplayMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLint attrib, EGLint *value); typedef EGLBoolean (*QueryScreenMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value); typedef EGLBoolean (*QueryScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface); typedef EGLBoolean (*QueryScreenModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode); @@ -112,7 +111,6 @@ struct _egl_driver CreateScreenSurfaceMESA_t CreateScreenSurfaceMESA; ShowSurfaceMESA_t ShowSurfaceMESA; ScreenPositionMESA_t ScreenPositionMESA; - QueryDisplayMESA_t QueryDisplayMESA; QueryScreenMESA_t QueryScreenMESA; QueryScreenSurfaceMESA_t QueryScreenSurfaceMESA; QueryScreenModeMESA_t QueryScreenModeMESA; -- cgit v1.2.3 From 2e081cd90ee0f4b05417de44e2df2dfec394490d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 31 May 2005 23:54:24 +0000 Subject: updated to version 28 --- include/GL/glext.h | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index b82879f18f7..df71de0be97 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -52,9 +52,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2005/01/20 */ +/* glext.h last updated 2005/05/31 */ /* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 26 +#define GL_GLEXT_VERSION 28 #ifndef GL_VERSION_1_2 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 @@ -2980,6 +2980,65 @@ extern "C" { /* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ #endif +#ifndef GL_EXT_framebuffer_object +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX_EXT 0x8D45 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 +#endif + +#ifndef GL_GREMEDY_string_marker +#endif + /*************************************************************/ @@ -6381,6 +6440,54 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLen #define GL_NV_vertex_program3 1 #endif +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint); +GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *); +GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *); +GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint); +GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *); +GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum); +GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGenerateMipmapEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +#endif + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); +#endif + #ifdef __cplusplus } -- cgit v1.2.3 From 5d5100aabcb1e9a740f1e69e8b01743b1c1d3ccd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 31 May 2005 23:54:44 +0000 Subject: remove temporary GL_EXT_framebuffer_object info --- include/GL/gl.h | 119 +------------------------------------------------------- 1 file changed, 1 insertion(+), 118 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 335e454555e..9554eff2721 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2,7 +2,7 @@ * Mesa 3-D graphics library * Version: 6.3 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -2235,123 +2235,6 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen #endif /* GL_ATI_blend_equation_separate */ -/* XXX this is temporary here! */ -#ifndef GL_EXT_framebuffer_object -#define GL_EXT_framebuffer_object - -GLAPI GLboolean GLAPIENTRY -glIsRenderbufferEXT(GLuint renderbuffer); - -GLAPI void GLAPIENTRY -glBindRenderbufferEXT(GLenum target, GLuint renderbuffer); - -GLAPI void GLAPIENTRY -glDeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers); - -GLAPI void GLAPIENTRY -glGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers); - -GLAPI void GLAPIENTRY -glRenderbufferStorageEXT(GLenum target, GLenum internalformat, - GLsizei width, GLsizei height); - -GLAPI void GLAPIENTRY -glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params); - -GLAPI GLboolean GLAPIENTRY -glIsFramebufferEXT(GLuint framebuffer); - -GLAPI void GLAPIENTRY -glBindFramebufferEXT(GLenum target, GLuint framebuffer); - -GLAPI void GLAPIENTRY -glDeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers); - -GLAPI void GLAPIENTRY -glGenFramebuffersEXT(GLsizei n, GLuint *framebuffers); - -GLAPI GLenum GLAPIENTRY -glCheckFramebufferStatusEXT(GLenum target); - -GLAPI void GLAPIENTRY -glFramebufferTexture1DEXT(GLenum target, GLenum attachment, - GLenum textarget, GLuint texture, GLint level); - -GLAPI void GLAPIENTRY -glFramebufferTexture2DEXT(GLenum target, GLenum attachment, - GLenum textarget, GLuint texture, GLint level); - -GLAPI void GLAPIENTRY -glFramebufferTexture3DEXT(GLenum target, GLenum attachment, - GLenum textarget, GLuint texture, - GLint level, GLint zoffset); - -GLAPI void GLAPIENTRY -glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, - GLenum renderbuffertarget, - GLuint renderbuffer); - -GLAPI void GLAPIENTRY -glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, - GLenum pname, GLint *params); - -GLAPI void GLAPIENTRY -glGenerateMipmapEXT(GLenum target); - - -#define GL_FRAMEBUFFER_EXT 0x8D40 -#define GL_RENDERBUFFER_EXT 0x8D41 -#define GL_STENCIL_INDEX_EXT 0x8D45 -#define GL_STENCIL_INDEX1_EXT 0x8D46 -#define GL_STENCIL_INDEX4_EXT 0x8D47 -#define GL_STENCIL_INDEX8_EXT 0x8D48 -#define GL_STENCIL_INDEX16_EXT 0x8D49 -#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 -#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 -#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 -#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 -#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD -#define GL_FRAMEBUFFER_STATUS_ERROR_EXT 0x8CDE -#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 -#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 - -#endif /* GL_EXT_framebuffer_object */ - - - /** ** NOTE!!!!! If you add new functions to this file, or update ** glext.h be sure to regenerate the gl_mangle.h file. See comments -- cgit v1.2.3 From d45cb9a83636e0e6c5800e247bc8b2899403d503 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 8 Jun 2005 02:18:22 +0000 Subject: regenerate for latest glext.h --- include/GL/gl_mangle.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index c8b0a117489..690eab5625f 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -62,11 +62,13 @@ #define glBindBufferARB MANGLE(BindBufferARB) #define glBindBuffer MANGLE(BindBuffer) #define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI) +#define glBindFramebufferEXT MANGLE(BindFramebufferEXT) #define glBindLightParameterEXT MANGLE(BindLightParameterEXT) #define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT) #define glBindParameterEXT MANGLE(BindParameterEXT) #define glBindProgramARB MANGLE(BindProgramARB) #define glBindProgramNV MANGLE(BindProgramNV) +#define glBindRenderbufferEXT MANGLE(BindRenderbufferEXT) #define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT) #define glBindTextureEXT MANGLE(BindTextureEXT) #define glBindTexture MANGLE(BindTexture) @@ -102,6 +104,7 @@ #define glBufferSubData MANGLE(BufferSubData) #define glCallList MANGLE(CallList) #define glCallLists MANGLE(CallLists) +#define glCheckFramebufferStatusEXT MANGLE(CheckFramebufferStatusEXT) #define glClampColorARB MANGLE(ClampColorARB) #define glClearAccum MANGLE(ClearAccum) #define glClearColor MANGLE(ClearColor) @@ -244,6 +247,7 @@ #define glDeleteFencesAPPLE MANGLE(DeleteFencesAPPLE) #define glDeleteFencesNV MANGLE(DeleteFencesNV) #define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI) +#define glDeleteFramebuffersEXT MANGLE(DeleteFramebuffersEXT) #define glDeleteLists MANGLE(DeleteLists) #define glDeleteObjectARB MANGLE(DeleteObjectARB) #define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV) @@ -252,6 +256,7 @@ #define glDeleteProgramsNV MANGLE(DeleteProgramsNV) #define glDeleteQueriesARB MANGLE(DeleteQueriesARB) #define glDeleteQueries MANGLE(DeleteQueries) +#define glDeleteRenderbuffersEXT MANGLE(DeleteRenderbuffersEXT) #define glDeleteShader MANGLE(DeleteShader) #define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT) #define glDeleteTextures MANGLE(DeleteTextures) @@ -365,6 +370,10 @@ #define glFragmentMaterialfvSGIX MANGLE(FragmentMaterialfvSGIX) #define glFragmentMaterialiSGIX MANGLE(FragmentMaterialiSGIX) #define glFragmentMaterialivSGIX MANGLE(FragmentMaterialivSGIX) +#define glFramebufferRenderbufferEXT MANGLE(FramebufferRenderbufferEXT) +#define glFramebufferTexture1DEXT MANGLE(FramebufferTexture1DEXT) +#define glFramebufferTexture2DEXT MANGLE(FramebufferTexture2DEXT) +#define glFramebufferTexture3DEXT MANGLE(FramebufferTexture3DEXT) #define glFrameZoomSGIX MANGLE(FrameZoomSGIX) #define glFreeObjectBufferATI MANGLE(FreeObjectBufferATI) #define glFrontFace MANGLE(FrontFace) @@ -372,15 +381,18 @@ #define glGenAsyncMarkersSGIX MANGLE(GenAsyncMarkersSGIX) #define glGenBuffersARB MANGLE(GenBuffersARB) #define glGenBuffers MANGLE(GenBuffers) +#define glGenerateMipmapEXT MANGLE(GenerateMipmapEXT) #define glGenFencesAPPLE MANGLE(GenFencesAPPLE) #define glGenFencesNV MANGLE(GenFencesNV) #define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI) +#define glGenFramebuffersEXT MANGLE(GenFramebuffersEXT) #define glGenLists MANGLE(GenLists) #define glGenOcclusionQueriesNV MANGLE(GenOcclusionQueriesNV) #define glGenProgramsARB MANGLE(GenProgramsARB) #define glGenProgramsNV MANGLE(GenProgramsNV) #define glGenQueriesARB MANGLE(GenQueriesARB) #define glGenQueries MANGLE(GenQueries) +#define glGenRenderbuffersEXT MANGLE(GenRenderbuffersEXT) #define glGenSymbolsEXT MANGLE(GenSymbolsEXT) #define glGenTexturesEXT MANGLE(GenTexturesEXT) #define glGenTextures MANGLE(GenTextures) @@ -438,6 +450,7 @@ #define glGetFragmentLightivSGIX MANGLE(GetFragmentLightivSGIX) #define glGetFragmentMaterialfvSGIX MANGLE(GetFragmentMaterialfvSGIX) #define glGetFragmentMaterialivSGIX MANGLE(GetFragmentMaterialivSGIX) +#define glGetFramebufferAttachmentParameterivEXT MANGLE(GetFramebufferAttachmentParameterivEXT) #define glGetHandleARB MANGLE(GetHandleARB) #define glGetHistogramEXT MANGLE(GetHistogramEXT) #define glGetHistogram MANGLE(GetHistogram) @@ -510,6 +523,7 @@ #define glGetQueryObjectiv MANGLE(GetQueryObjectiv) #define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB) #define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv) +#define glGetRenderbufferParameterivEXT MANGLE(GetRenderbufferParameterivEXT) #define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT) #define glGetSeparableFilter MANGLE(GetSeparableFilter) #define glGetShaderInfoLog MANGLE(GetShaderInfoLog) @@ -601,6 +615,7 @@ #define glIsEnabled MANGLE(IsEnabled) #define glIsFenceAPPLE MANGLE(IsFenceAPPLE) #define glIsFenceNV MANGLE(IsFenceNV) +#define glIsFramebufferEXT MANGLE(IsFramebufferEXT) #define glIsList MANGLE(IsList) #define glIsObjectBufferATI MANGLE(IsObjectBufferATI) #define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV) @@ -609,6 +624,7 @@ #define glIsProgramNV MANGLE(IsProgramNV) #define glIsQueryARB MANGLE(IsQueryARB) #define glIsQuery MANGLE(IsQuery) +#define glIsRenderbufferEXT MANGLE(IsRenderbufferEXT) #define glIsShader MANGLE(IsShader) #define glIsTextureEXT MANGLE(IsTextureEXT) #define glIsTexture MANGLE(IsTexture) @@ -895,6 +911,7 @@ #define glRects MANGLE(Rects) #define glRectsv MANGLE(Rectsv) #define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX) +#define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT) #define glRenderMode MANGLE(RenderMode) #define glReplacementCodePointerSUN MANGLE(ReplacementCodePointerSUN) #define glReplacementCodeubSUN MANGLE(ReplacementCodeubSUN) @@ -1003,6 +1020,7 @@ #define glStencilOpSeparateATI MANGLE(StencilOpSeparateATI) #define glStencilOpSeparate MANGLE(StencilOpSeparate) #define glStopInstrumentsSGIX MANGLE(StopInstrumentsSGIX) +#define glStringMarkerGREMEDY MANGLE(StringMarkerGREMEDY) #define glSwizzleEXT MANGLE(SwizzleEXT) #define glTagSampleBufferSGIX MANGLE(TagSampleBufferSGIX) #define glTangent3bEXT MANGLE(Tangent3bEXT) @@ -1448,5 +1466,6 @@ #define glWindowPos4sMESA MANGLE(WindowPos4sMESA) #define glWindowPos4svMESA MANGLE(WindowPos4svMESA) #define glWriteMaskEXT MANGLE(WriteMaskEXT) +gl.h:GLAPI void GLAPIENTRY #endif /* GL_MANGLE_H */ -- cgit v1.2.3 From 012de39c23524289453d977e2dc3ddac05f45538 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 8 Jun 2005 13:07:33 +0000 Subject: remove stray line --- include/GL/gl_mangle.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 690eab5625f..5364842708b 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -1466,6 +1466,5 @@ #define glWindowPos4sMESA MANGLE(WindowPos4sMESA) #define glWindowPos4svMESA MANGLE(WindowPos4svMESA) #define glWriteMaskEXT MANGLE(WriteMaskEXT) -gl.h:GLAPI void GLAPIENTRY #endif /* GL_MANGLE_H */ -- cgit v1.2.3 From 2c7336af4e92f29599c04822fcbd4db12a4c5cc5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 8 Jun 2005 13:35:07 +0000 Subject: put full prototype on one line to fix gl_mangle.h generation (Dave Reveman) --- include/GL/gl.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 9554eff2721..1ea97f39078 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2213,13 +2213,9 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data); -GLAPI void GLAPIENTRY -glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, - GLvoid *data); +GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data); -GLAPI void GLAPIENTRY -glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, - GLfloat *v); +GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v); #endif /* GL_MESA_program_debug */ -- cgit v1.2.3 From ee7ad16f3f06140ebbeb195540c15b7016003d62 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 8 Jun 2005 13:35:28 +0000 Subject: regenerated --- include/GL/gl_mangle.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 5364842708b..c1b443c6b0a 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -515,6 +515,7 @@ #define glGetProgramNamedParameterfvNV MANGLE(GetProgramNamedParameterfvNV) #define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV) #define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV) +#define glGetProgramRegisterfvMESA MANGLE(GetProgramRegisterfvMESA) #define glGetProgramStringARB MANGLE(GetProgramStringARB) #define glGetProgramStringNV MANGLE(GetProgramStringNV) #define glGetQueryivARB MANGLE(GetQueryivARB) @@ -852,6 +853,7 @@ #define glPrimitiveRestartNV MANGLE(PrimitiveRestartNV) #define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT) #define glPrioritizeTextures MANGLE(PrioritizeTextures) +#define glProgramCallbackMESA MANGLE(ProgramCallbackMESA) #define glProgramEnvParameter4dARB MANGLE(ProgramEnvParameter4dARB) #define glProgramEnvParameter4dvARB MANGLE(ProgramEnvParameter4dvARB) #define glProgramEnvParameter4fARB MANGLE(ProgramEnvParameter4fARB) -- cgit v1.2.3 From 23606a5704e41274c36f45c6cd6f40335ec66818 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 21 Jun 2005 14:30:46 +0000 Subject: updated to version 29 --- include/GL/glext.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index df71de0be97..7bb8e6e7cc7 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -52,9 +52,9 @@ extern "C" { /*************************************************************/ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2005/05/31 */ +/* glext.h last updated 2005/06/20 */ /* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 28 +#define GL_GLEXT_VERSION 29 #ifndef GL_VERSION_1_2 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 @@ -3023,7 +3023,6 @@ extern "C" { #define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 #define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 #define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 -#define GL_STENCIL_INDEX_EXT 0x8D45 #define GL_STENCIL_INDEX1_EXT 0x8D46 #define GL_STENCIL_INDEX4_EXT 0x8D47 #define GL_STENCIL_INDEX8_EXT 0x8D48 -- cgit v1.2.3 From c39bf5e273a4995a279ae2af59fc29e06ab47e29 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Sun, 24 Jul 2005 06:29:14 +0000 Subject: All elements of pre-DRI_NEW_INTERFACE_ONLY are removed. This allows 1,402 lines of code to be removed from Mesa (drivers and libGL). The big winner is dri_util.c. Primary changes are: 1. Remove all "deprecated" entry-points from the various structures in dri_interface.h. 2. Rename the remaining fields to removed "version numbers." So, bindContext3 becomes bindContext. Functions with "New" in the name (e.g., CreateNewContext) were *not* changed, but that is an option. Having "New" in the name is less annoying to me than having "3" in the name. 3. Remove all compatibility code that handles cases where the driver or the loader is too old to support the latest interfaces. 4. Append the API version to the __driCreateNewScreen function name. This is currently done by hand. In the future (i.e., the next time we make an incompatible change to the interface) we'll want to come up with a better way to do this. This prevents old loaders from being able to load new (incompatible) drivers. 5. Bump the API version to 20050722. All drivers (by way of dri_util.c) require this version. 6. All drivers are *required* to expose GLX_SGIX_fbconfig and GLX_OML_swap_method (or the moral equivalents). Support for these functions in implicit in the use of the "new" interface. 7. Some cases still exist that need to be compiled differently in a loader or core Mesa versus in a driver. These are identified by the define IN_DRI_DRIVER. --- configs/linux-dri | 2 +- include/GL/internal/dri_interface.h | 77 +-- src/glx/x11/Makefile | 8 +- src/glx/x11/dri_glx.c | 77 +-- src/glx/x11/glxclient.h | 26 +- src/glx/x11/glxcmds.c | 127 +---- src/glx/x11/glxext.c | 188 +------- src/glx/x11/glxextensions.c | 4 +- src/mesa/drivers/dri/common/dri_util.c | 629 ++----------------------- src/mesa/drivers/dri/common/dri_util.h | 20 +- src/mesa/drivers/dri/common/glcontextmodes.c | 8 +- src/mesa/drivers/dri/common/glcontextmodes.h | 4 +- src/mesa/drivers/dri/common/utils.c | 61 +-- src/mesa/drivers/dri/common/utils.h | 6 - src/mesa/drivers/dri/common/vblank.c | 4 +- src/mesa/drivers/dri/fb/fb_dri.c | 4 - src/mesa/drivers/dri/ffb/ffb_xmesa.c | 22 +- src/mesa/drivers/dri/ffb/server/ffb_dac.h | 2 - src/mesa/drivers/dri/i810/i810screen.c | 27 +- src/mesa/drivers/dri/i830/i830_screen.c | 46 +- src/mesa/drivers/dri/i915/intel_screen.c | 57 +-- src/mesa/drivers/dri/mach64/mach64_screen.c | 55 +-- src/mesa/drivers/dri/mga/mga_xmesa.c | 54 +-- src/mesa/drivers/dri/r128/r128_screen.c | 51 +- src/mesa/drivers/dri/r200/r200_screen.c | 66 +-- src/mesa/drivers/dri/r300/radeon_screen.c | 83 +--- src/mesa/drivers/dri/radeon/radeon_screen.c | 58 +-- src/mesa/drivers/dri/s3v/s3v_xmesa.c | 5 - src/mesa/drivers/dri/savage/savage_xmesa.c | 24 +- src/mesa/drivers/dri/sis/sis_screen.c | 28 +- src/mesa/drivers/dri/tdfx/tdfx_screen.c | 24 +- src/mesa/drivers/dri/trident/trident_context.c | 13 +- src/mesa/drivers/dri/unichrome/via_screen.c | 62 +-- src/mesa/x86/common_x86.c | 4 +- 34 files changed, 262 insertions(+), 1664 deletions(-) (limited to 'include') diff --git a/configs/linux-dri b/configs/linux-dri index 12ad6d7bd84..2eb2271be1d 100644 --- a/configs/linux-dri +++ b/configs/linux-dri @@ -22,7 +22,7 @@ ARCH_FLAGS ?= DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ -D_BSD_SOURCE -D_GNU_SOURCE \ - -DDRI_NEW_INTERFACE_ONLY -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 + -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 9c430469b29..3a704f6a72e 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -247,25 +247,6 @@ struct __DRIscreenRec { */ void (*destroyScreen)(__DRInativeDisplay *dpy, int scrn, void *screenPrivate); - /** - * Method to create the private DRI context data and initialize the - * context dependent methods. - * - * \sa __DRIscreenRec::createNewContext driCreateContext - * driCreateNewContext - * - * \deprecated - * This function has been replaced by \c __DRIscreenRec::createNewContext. - * New drivers will continue to export this method, but it will eventually - * (in the next XFree86 major relearse) go away. - */ -#ifndef DRI_NEW_INTERFACE_ONLY - void *(*createContext)(Display *dpy, XVisualInfo *vis, void *sharedPrivate, - __DRIcontext *pctx); -#else - void * createContext; -#endif /* DRI_NEW_INTERFACE_ONLY */ - /** * Method to create the private DRI drawable data and initialize the * drawable dependent methods. @@ -341,30 +322,6 @@ struct __DRIcontextRec { */ void (*destroyContext)(__DRInativeDisplay *dpy, int scrn, void *contextPrivate); - /** - * Method to bind a DRI drawable to a DRI graphics context. - * - * \deprecated Replaced by bindContext3. - */ -#ifndef DRI_NEW_INTERFACE_ONLY - Bool (*bindContext)(Display *dpy, int scrn, GLXDrawable draw, - GLXContext gc); -#else - void *bindContext; -#endif /* DRI_NEW_INTERFACE_ONLY */ - - /** - * Method to unbind a DRI drawable to a DRI graphics context. - * - * \deprecated Replaced by unbindContext3. - */ -#ifndef DRI_NEW_INTERFACE_ONLY - Bool (*unbindContext)(Display *dpy, int scrn, GLXDrawable draw, - GLXContext gc, int will_rebind); -#else - void *unbindContext; -#endif /* DRI_NEW_INTERFACE_ONLY */ - /** * Opaque pointer to private per context direct rendering data. * \c NULL if direct rendering is not supported on the display or @@ -372,32 +329,6 @@ struct __DRIcontextRec { */ void *private; - /** - * Method to bind a DRI drawable to a DRI graphics context. - * - * \since Internal API version 20030606. - * \deprecated Replaced by bindContext3. - */ -#ifndef DRI_NEW_INTERFACE_ONLY - Bool (*bindContext2)(Display *dpy, int scrn, GLXDrawable draw, - GLXDrawable read, GLXContext gc); -#else - void *bindContext2; -#endif /* DRI_NEW_INTERFACE_ONLY */ - - /** - * Method to unbind a DRI drawable from a DRI graphics context. - * - * \since Internal API version 20030606. - * \deprecated Replaced by unbindContext3. - */ -#ifndef DRI_NEW_INTERFACE_ONLY - Bool (*unbindContext2)(Display *dpy, int scrn, GLXDrawable draw, - GLXDrawable read, GLXContext gc); -#else - void *unbindContext2; -#endif /* DRI_NEW_INTERFACE_ONLY */ - /** * Pointer to the mode used to create this context. * @@ -408,17 +339,17 @@ struct __DRIcontextRec { /** * Method to bind a DRI drawable to a DRI graphics context. * - * \since Internal API version 20040415. + * \since Internal API version 20050722. */ - GLboolean (*bindContext3)(__DRInativeDisplay *dpy, int scrn, __DRIid draw, + GLboolean (*bindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw, __DRIid read, __DRIcontext *ctx); /** * Method to unbind a DRI drawable from a DRI graphics context. * - * \since Internal API version 20040415. + * \since Internal API version 20050722. */ - GLboolean (*unbindContext3)(__DRInativeDisplay *dpy, int scrn, __DRIid draw, + GLboolean (*unbindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw, __DRIid read, __DRIcontext *ctx); }; diff --git a/src/glx/x11/Makefile b/src/glx/x11/Makefile index 8982f01a155..bca2ee4ffa9 100644 --- a/src/glx/x11/Makefile +++ b/src/glx/x11/Makefile @@ -1,16 +1,12 @@ TOP = ../../.. include $(TOP)/configs/current -# This is a bit messy. We want this libGL to be capable of loading old -# interface drivers, so we have to turn off DRI_NEW_INTERFACE_ONLY. However, -# glcontextmodes.c is built elsewhere with DNIO on, so we symlink it across. -# -# Furthermore, context creation has evolved over the years, such that this +# Context creation has evolved over the years, such that this # code will not build with DNIO defined. When we finally drop old interface # support in libGL, we need to clean up both glxcmds.c and dri_interface.h. DEFINES += -DGLX_DIRECT_RENDERING -DGLXEXT -DXF86DRI -DGLX_USE_DLOPEN \ - -DGLX_USE_MESA -DXF86VIDMODE -D_REENTRANT -UDRI_NEW_INTERFACE_ONLY + -DGLX_USE_MESA -DXF86VIDMODE -D_REENTRANT -UIN_DRI_DRIVER C_SOURCES = \ $(TOP)/src/mesa/glapi/glapi.c \ diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c index 7ac80eb74d7..a4a389ce5d8 100644 --- a/src/glx/x11/dri_glx.c +++ b/src/glx/x11/dri_glx.c @@ -55,14 +55,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define RTLD_GLOBAL 0 #endif -#ifdef BUILT_IN_DRI_DRIVER - -extern void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config); - - -#else /* BUILT_IN_DRI_DRIVER */ - #ifndef DEFAULT_DRIVER_DIR /* this is normally defined in the Imakefile */ @@ -102,23 +94,6 @@ static void ErrorMessageF(const char *f, ...) } -/* - * We'll save a pointer to this function when we couldn't find a - * direct rendering driver for a given screen. - */ -static void *DummyCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config) -{ - (void) dpy; - (void) scrn; - (void) psc; - (void) numConfigs; - (void) config; - return NULL; -} - - - /** * Extract the ith directory path out of a colon-separated list of paths. No * more than \c dirLen characters, including the terminating \c NUL, will be @@ -181,6 +156,19 @@ ExtractDir(int index, const char *paths, int dirLen, char *dir) } +/** + * Versioned name of the expected \c __driCreateNewScreen function. + * + * The version of the last incompatible loader/driver inteface change is + * appended to the name of the \c __driCreateNewScreen function. This + * prevents loaders from trying to load drivers that are too old. + * + * \todo + * Create a macro or something so that this is automatically updated. + */ +static const char createNewScreenName[] = "__driCreateNewScreen_20050722"; + + /** * Try to \c dlopen the named driver. * @@ -249,18 +237,16 @@ static __DRIdriver *OpenDriver(const char *driverName) return NULL; /* out of memory! */ } - driver->createScreenFunc = (CreateScreenFunc) - dlsym(handle, "__driCreateScreen"); driver->createNewScreenFunc = (CreateNewScreenFunc) - dlsym(handle, "__driCreateNewScreen"); + dlsym(handle, createNewScreenName); - if ( (driver->createScreenFunc == NULL) - && (driver->createNewScreenFunc == NULL) ) { + if ( driver->createNewScreenFunc == NULL ) { /* If the driver doesn't have this symbol then something's * really, really wrong. */ - ErrorMessageF("Neither __driCreateScreen or __driCreateNewScreen " - "are defined in %s_dri.so!\n", driverName); + ErrorMessageF("%s not defined in %s_dri.so!\n" + "Your driver may be too old for this libGL.\n", + createNewScreenName, driverName); Xfree(driver); dlclose(handle); continue; @@ -379,9 +365,6 @@ const char *glXGetDriverConfig (const char *driverName) { } -#endif /* BUILT_IN_DRI_DRIVER */ - - /* This function isn't currently used. */ static void driDestroyDisplay(Display *dpy, void *private) @@ -420,7 +403,6 @@ void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp) */ pdisp->private = NULL; pdisp->destroyDisplay = NULL; - pdisp->createScreen = NULL; if (!XF86DRIQueryExtension(dpy, &eventBase, &errorBase)) { return NULL; @@ -441,17 +423,9 @@ void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp) pdisp->destroyDisplay = driDestroyDisplay; - /* allocate array of pointers to createScreen funcs */ - pdisp->createScreen = (CreateScreenFunc *) Xmalloc(numScreens * sizeof(void *)); - if (!pdisp->createScreen) { - Xfree(pdpyp); - return NULL; - } - - /* allocate array of pointers to createScreen funcs */ + /* allocate array of pointers to createNewScreen funcs */ pdisp->createNewScreen = (CreateNewScreenFunc *) Xmalloc(numScreens * sizeof(void *)); if (!pdisp->createNewScreen) { - Xfree(pdisp->createScreen); Xfree(pdpyp); return NULL; } @@ -460,20 +434,10 @@ void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp) pdpyp->libraryHandles = (void **) Xmalloc(numScreens * sizeof(void*)); if (!pdpyp->libraryHandles) { Xfree(pdisp->createNewScreen); - Xfree(pdisp->createScreen); Xfree(pdpyp); return NULL; } -#ifdef BUILT_IN_DRI_DRIVER - /* we'll statically bind to the built-in __driCreateScreen function */ - for (scrn = 0; scrn < numScreens; scrn++) { - pdisp->createScreen[scrn] = __driCreateScreen; - pdisp->createNewScreen[scrn] = NULL; - pdpyp->libraryHandles[scrn] = NULL; - } - -#else /* dynamically discover DRI drivers for all screens, saving each * driver's "__driCreateScreen" function pointer. That's the bootstrap * entrypoint for all DRI drivers. @@ -481,17 +445,14 @@ void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp) for (scrn = 0; scrn < numScreens; scrn++) { __DRIdriver *driver = driGetDriver(dpy, scrn); if (driver) { - pdisp->createScreen[scrn] = driver->createScreenFunc; pdisp->createNewScreen[scrn] = driver->createNewScreenFunc; pdpyp->libraryHandles[scrn] = driver->handle; } else { - pdisp->createScreen[scrn] = DummyCreateScreen; pdisp->createNewScreen[scrn] = NULL; pdpyp->libraryHandles[scrn] = NULL; } } -#endif return (void *)pdpyp; } diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index 83e1f27269a..b8241b8cf23 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -104,17 +104,6 @@ struct __DRIdisplayRec { */ void (*destroyDisplay)(Display *dpy, void *displayPrivate); - /** - * Methods to create the private DRI screen data and initialize the - * screen dependent methods. - * This is an array [indexed by screen number] of function pointers. - * - * \deprecated This array of function pointers has been replaced by - * \c __DRIdisplayRec::createNewScreen. - * \sa __DRIdisplayRec::createNewScreen - */ - CreateScreenFunc * createScreen; - /** * Opaque pointer to private per display direct rendering data. * \c NULL if direct rendering is not supported on this display. @@ -124,8 +113,6 @@ struct __DRIdisplayRec { /** * Array of pointers to methods to create and initialize the private DRI * screen data. - * - * \sa __DRIdisplayRec::createScreen */ CreateNewScreenFunc * createNewScreen; }; @@ -137,7 +124,6 @@ struct __DRIdisplayRec { struct __DRIdriverRec { const char *name; void *handle; - CreateScreenFunc createScreenFunc; CreateNewScreenFunc createNewScreenFunc; struct __DRIdriverRec *next; }; @@ -512,14 +498,6 @@ extern void __glFreeAttributeState(__GLXcontext *); * a pointer to the config data for that screen (if the screen supports GL). */ typedef struct __GLXscreenConfigsRec { - /** - * GLX visuals formated as \c __GLXvisualConfig structures. - */ - /*@{*/ - __GLXvisualConfig * old_configs; - int numOldConfigs; - /*@}*/ - /** * GLX extension string reported by the X-server. */ @@ -539,10 +517,10 @@ typedef struct __GLXscreenConfigsRec { #endif /** - * Linked list of configurations for this screen. This is intended to - * be a superset of \c old_configs. + * Linked list of configurations for this screen. */ __GLcontextModes *configs; + /** * Per-screen dynamic GLX extension tracking. The \c direct_support * field only contains enough bits for 64 extensions. Should libGL diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index b9fa4eeb451..5a16fb964d3 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -67,115 +67,6 @@ static const char __glXGLXClientVersion[] = "1.4"; #include "xf86dri.h" static Bool __glXWindowExists(Display *dpy, GLXDrawable draw); - -static void * DriverCreateContextWrapper( const __GLXscreenConfigs *psc, - Display *dpy, XVisualInfo *vis, void *shared, __DRIcontext *ctx, - const __GLcontextModes *fbconfig, int render_type ); - -#ifndef DRI_NEW_INTERFACE_ONLY -static Bool dummyBindContext2( Display *dpy, int scrn, - GLXDrawable draw, GLXDrawable read, GLXContext gc ); - -static Bool dummyUnbindContext2( Display *dpy, int scrn, - GLXDrawable draw, GLXDrawable read, GLXContext gc ); - -/****************************************************************************/ - -/** - * Used as glue when a driver does not support - * \c __DRIcontextRec::bindContext2. - * - * XXX .bindContext is only defined as a function pointer if - * !DRI_NEW_INTERFACE_ONLY. - * - * \sa DriverCreateContextWrapper, __DRIcontextRec::bindContext2 - */ -static Bool dummyBindContext2( Display *dpy, int scrn, - GLXDrawable draw, GLXDrawable read, - GLXContext gc ) -{ - assert( draw == read ); - return (*gc->driContext.bindContext)( dpy, scrn, draw, gc ); -} - -/** - * Used as glue when a driver does not support - * \c __DRIcontextRec::unbindContext2. - * - * XXX .unbindContext is only defined as a function pointer if - * !DRI_NEW_INTERFACE_ONLY. - * - * \sa DriverCreateContextWrapper, __DRIcontextRec::unbindContext2 - */ -static Bool dummyUnbindContext2( Display *dpy, int scrn, - GLXDrawable draw, GLXDrawable read, - GLXContext gc ) -{ - assert( draw == read ); - return (*gc->driContext.unbindContext)( dpy, scrn, draw, gc, GL_FALSE ); -} -#endif /* DRI_NEW_INTERFACE_ONLY */ - - -/****************************************************************************/ -/** - * Wrap the call to the driver's \c createContext function. - * - * The \c createContext function is wrapped because not all drivers support - * the "new" \c unbindContext2 and \c bindContext2 interfaces. libGL should - * not have to check to see which functions the driver supports. Instead, - * if either function is not supported it is wrapped. The wrappers test to - * make sure that both drawables are the same and pass control to the old - * interface. - * - * \sa dummyBindContext2, dummyUnbindContext2, - * __DRIcontextRec::bindContext2, __DRIcontextRec::unbindContext2 - */ - -static void * DriverCreateContextWrapper( const __GLXscreenConfigs *psc, - Display *dpy, XVisualInfo *vis, - void *shared, - __DRIcontext *ctx, - const __GLcontextModes *modes, - int render_type ) -{ - void * ctx_priv = NULL; - - if ( psc->driScreen.createNewContext != NULL ) { - assert( modes != NULL ); - ctx_priv = (*psc->driScreen.createNewContext)(dpy, modes, render_type, - shared, ctx); - - /* If the driver supports the createNewContext interface, then - * it MUST also support either the bindContext2 / unbindContext2 - * interface or the bindContext3 / unbindContext3 interface. - */ - - assert( (ctx_priv == NULL) || (ctx->unbindContext2 != NULL) - || (ctx->unbindContext3 != NULL) ); - assert( (ctx_priv == NULL) || (ctx->bindContext2 != NULL) - || (ctx->bindContext3 != NULL) ); - } -#ifndef DRI_NEW_INTERFACE_ONLY - else { - if ( vis != NULL ) { - ctx_priv = (*psc->driScreen.createContext)(dpy, vis, shared, ctx); - - if ( ctx_priv != NULL ) { - if ( ctx->unbindContext2 == NULL ) { - ctx->unbindContext2 = dummyUnbindContext2; - } - - if ( ctx->bindContext2 == NULL ) { - ctx->bindContext2 = dummyBindContext2; - } - } - } - } -#endif - - return ctx_priv; -} #endif @@ -469,10 +360,10 @@ CreateContext(Display *dpy, XVisualInfo *vis, if (psc && psc->driScreen.private) { void * const shared = (shareList != NULL) ? shareList->driContext.private : NULL; - gc->driContext.private = - DriverCreateContextWrapper( psc, dpy, vis, shared, - &gc->driContext, mode, - renderType ); + gc->driContext.private = + (*psc->driScreen.createNewContext)( dpy, mode, renderType, + shared, + &gc->driContext ); if (gc->driContext.private) { gc->isDirect = GL_TRUE; gc->screen = mode->screen; @@ -842,6 +733,12 @@ static Bool __glXIsDirect(Display *dpy, GLXContextID contextID) return reply.isDirect; } +/** + * \todo + * Shouldn't this function \b always return \c GL_FALSE when + * \c GLX_DIRECT_RENDERING is not defined? Do we really need to bother with + * the GLX protocol here at all? + */ PUBLIC Bool GLX_PREFIX(glXIsDirect)(Display *dpy, GLXContext gc) { if (!gc) { @@ -3052,8 +2949,10 @@ int __glXGetInternalVersion(void) * 20040415 - Added support for bindContext3 and unbindContext3. * 20040602 - Add __glXGetDrawableInfo. I though that was there * months ago. :( + * 20050722 - Gut all the old interfaces. This breaks compatability with + * any DRI driver built to any previous version. */ - return 20040602; + return 20050722; } diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c index 1d82af295fd..be6b84b262d 100644 --- a/src/glx/x11/glxext.c +++ b/src/glx/x11/glxext.c @@ -272,7 +272,6 @@ int __glXDebug = 0; */ int __glXCloseDisplay(Display *dpy, XExtCodes *codes); -static GLboolean FillInVisuals( __GLXscreenConfigs * psc ); /************************************************************************/ @@ -352,12 +351,6 @@ static void FreeScreenConfigs(__GLXdisplayPrivate *priv) if(psc->effectiveGLXexts) Xfree(psc->effectiveGLXexts); - if ( psc->old_configs != NULL ) { - Xfree( psc->old_configs ); - psc->old_configs = NULL; - psc->numOldConfigs = 0; - } - psc->configs = NULL; /* NOTE: just for paranoia */ } @@ -399,10 +392,6 @@ static int __glXFreeDisplayPrivate(XExtData *extension) priv->driDisplay.private = NULL; #endif -#ifdef GLX_DIRECT_RENDERING - XFree(priv->driDisplay.createScreen); -#endif - Xfree((char*) priv); return 0; } @@ -442,112 +431,6 @@ static Bool QueryVersion(Display *dpy, int opcode, int *major, int *minor) } -/** - * Determine if a \c __GLcontextModes structure has the right mojo to be - * converted to a \c __GLXvisualConfig to be sent to an "old" style DRI - * driver. - */ -#define MODE_HAS_MOJO(m) \ - ((m)->visualID != GLX_DONT_CARE) \ - && ((m)->sampleBuffers == 0) \ - && ((m)->samples == 0) \ - && (((m)->drawableType & GLX_WINDOW_BIT) != 0) \ - && (((m)->xRenderable == GL_TRUE) \ - || ((m)->xRenderable == GLX_DONT_CARE)) - - -/** - * Convert the FBConfigs associated with a screen into an array of - * \c __GLXvisualConfig structures. These structures are passed into DRI - * drivers that use the "old" interface. The old-style drivers had a fairly - * strict set of visual types that could be supported. FBConfigs that - * cannot be supported are not converted. - * - * \param psc Screen whose FBConfigs need to be swizzled. - * - * \returns - * If memory could be allocated and at least one FBConfig could be converted - * to a \c __GLXvisualConfig structure, \c GL_TRUE is returned. Otherwise, - * \c GL_FALSE is returned. - * - * \todo - * When the old DRI driver interface is no longer supported, this function - * can be removed. - */ -static GLboolean -FillInVisuals( __GLXscreenConfigs * psc ) -{ - __GLcontextModes *modes; - int glx_visual_count; - - - glx_visual_count = 0; - for ( modes = psc->configs ; modes != NULL ; modes = modes->next ) { - if ( MODE_HAS_MOJO( modes ) ) { - glx_visual_count++; - } - } - - psc->old_configs = (__GLXvisualConfig *) - Xmalloc( sizeof( __GLXvisualConfig ) * glx_visual_count ); - if ( psc->old_configs == NULL ) { - return GL_FALSE; - } - - glx_visual_count = 0; - for ( modes = psc->configs ; modes != NULL ; modes = modes->next ) { - if ( MODE_HAS_MOJO( modes ) ) { - -#define COPY_VALUE(src_tag,dst_tag) \ - psc->old_configs[glx_visual_count]. dst_tag = modes-> src_tag - - COPY_VALUE( visualID, vid ); - COPY_VALUE( rgbMode, rgba ); - COPY_VALUE( stereoMode, stereo ); - COPY_VALUE( doubleBufferMode, doubleBuffer ); - - psc->old_configs[glx_visual_count].class = - _gl_convert_to_x_visual_type( modes->visualType ); - - COPY_VALUE( level, level ); - COPY_VALUE( numAuxBuffers, auxBuffers ); - - COPY_VALUE( redBits, redSize ); - COPY_VALUE( greenBits, greenSize ); - COPY_VALUE( blueBits, blueSize ); - COPY_VALUE( alphaBits, alphaSize ); - COPY_VALUE( rgbBits, bufferSize ); - COPY_VALUE( accumRedBits, accumRedSize ); - COPY_VALUE( accumGreenBits, accumGreenSize ); - COPY_VALUE( accumBlueBits, accumBlueSize ); - COPY_VALUE( accumAlphaBits, accumAlphaSize ); - COPY_VALUE( depthBits, depthSize ); - COPY_VALUE( stencilBits, stencilSize ); - - COPY_VALUE( visualRating, visualRating ); - COPY_VALUE( transparentPixel, transparentPixel ); - COPY_VALUE( transparentRed, transparentRed ); - COPY_VALUE( transparentGreen, transparentGreen ); - COPY_VALUE( transparentBlue, transparentBlue ); - COPY_VALUE( transparentAlpha, transparentAlpha ); - COPY_VALUE( transparentIndex, transparentIndex ); - -#undef COPY_VALUE - - glx_visual_count++; - } - } - - psc->numOldConfigs = glx_visual_count; - if ( glx_visual_count == 0 ) { - Xfree( psc->old_configs ); - psc->old_configs = NULL; - } - - return (glx_visual_count != 0); -} - - void __glXInitializeVisualConfigFromTags( __GLcontextModes *config, int count, const INT32 *bp, Bool tagged_only, @@ -865,9 +748,9 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc, char *driverName; /* - * Get device name (like "tdfx") and the ddx version numbers. - * We'll check the version in each DRI driver's "createScreen" - * function. + * Get device name (like "tdfx") and the ddx version + * numbers. We'll check the version in each DRI driver's + * "createNewScreen" function. */ err_msg = "XF86DRIGetClientDriverName"; if (XF86DRIGetClientDriverName(dpy, scrn, @@ -910,8 +793,9 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc, if ( status == 0 ) { /* - * Map the SAREA region. Further mmap regions may be setup in - * each DRI driver's "createScreen" function. + * Map the SAREA region. Further mmap regions + * may be setup in each DRI driver's + * "createNewScreen" function. */ status = drmMap(fd, hSAREA, SAREA_MAX, &pSAREA); @@ -1156,6 +1040,9 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv) psc->ext_list_first_time = GL_TRUE; /* Initialize the direct rendering per screen data and functions */ if (priv->driDisplay.private != NULL) { + /* FIXME: Should it be some sort of an error if createNewScreen[i] + * FIXME: is NULL? + */ if (priv->driDisplay.createNewScreen && priv->driDisplay.createNewScreen[i]) { @@ -1165,21 +1052,6 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv) & priv->driDisplay, priv->driDisplay.createNewScreen[i] ); } - else if (priv->driDisplay.createScreen && - priv->driDisplay.createScreen[i]) { - /* screen initialization (bootstrap the driver) */ - if ( (psc->old_configs == NULL) - && !FillInVisuals(psc) ) { - FreeScreenConfigs(priv); - return GL_FALSE; - } - - psc->driScreen.screenConfigs = (void *)psc; - psc->driScreen.private = - (*(priv->driDisplay.createScreen[i]))(dpy, i, &psc->driScreen, - psc->numOldConfigs, - psc->old_configs); - } } #endif } @@ -1273,7 +1145,6 @@ __GLXdisplayPrivate *__glXInitialize(Display* dpy) /* Assinging zero here assures we'll never go direct */ dpyPriv->driDisplay.private = 0; dpyPriv->driDisplay.destroyDisplay = 0; - dpyPriv->driDisplay.createScreen = 0; } else { dpyPriv->driDisplay.private = @@ -1607,44 +1478,23 @@ static Bool SendMakeCurrentRequest( Display *dpy, CARD8 opcode, } +#ifdef GLX_DIRECT_RENDERING static Bool BindContextWrapper( Display *dpy, GLXContext gc, GLXDrawable draw, GLXDrawable read ) { -#ifdef GLX_DIRECT_RENDERING - if ( gc->driContext.bindContext3 != NULL ) { - return (*gc->driContext.bindContext3)(dpy, gc->screen, draw, read, - & gc->driContext); - } -#ifndef DRI_NEW_INTERFACE_ONLY - else { - return (*gc->driContext.bindContext2)(dpy, gc->screen, draw, read, - gc); - } -#endif -#endif - return GL_FALSE; + return (*gc->driContext.bindContext)(dpy, gc->screen, draw, read, + & gc->driContext); } -static Bool UnbindContextWrapper( Display *dpy, GLXContext gc ) +static Bool UnbindContextWrapper( GLXContext gc ) { -#ifdef GLX_DIRECT_RENDERING - if ( gc->driContext.unbindContext3 != NULL ) { - return (*gc->driContext.unbindContext3)(dpy, gc->screen, - gc->currentDrawable, - gc->currentReadable, - & gc->driContext ); - } -#ifndef DRI_NEW_INTERFACE_ONLY - else { - return (*gc->driContext.unbindContext2)(dpy, gc->screen, - gc->currentDrawable, - gc->currentReadable, gc); - } -#endif -#endif - return GL_FALSE; + return (*gc->driContext.unbindContext)(gc->currentDpy, gc->screen, + gc->currentDrawable, + gc->currentReadable, + & gc->driContext ); } +#endif /* GLX_DIRECT_RENDERING */ /* @@ -1707,7 +1557,7 @@ USED static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw, /* Unbind the old direct rendering context */ if (oldGC->isDirect) { if (oldGC->driContext.private) { - if (! UnbindContextWrapper( oldGC->currentDpy, oldGC )) { + if (! UnbindContextWrapper( oldGC )) { /* The make current failed. Just return GL_FALSE. */ return GL_FALSE; } diff --git a/src/glx/x11/glxextensions.c b/src/glx/x11/glxextensions.c index 31f7aee5cc6..7c5d9719a63 100644 --- a/src/glx/x11/glxextensions.c +++ b/src/glx/x11/glxextensions.c @@ -89,7 +89,7 @@ static const struct extension_info known_glx_extensions[] = { { GLX(NV_render_depth_texture), VER(0,0), N, N, N, N }, { GLX(NV_render_texture_rectangle), VER(0,0), N, N, N, N }, { GLX(NV_vertex_array_range), VER(0,0), N, N, N, Y }, /* Deprecated */ - { GLX(OML_swap_method), VER(0,0), Y, N, N, N }, + { GLX(OML_swap_method), VER(0,0), Y, Y, N, N }, { GLX(OML_sync_control), VER(0,0), Y, N, N, Y }, { GLX(SGI_cushion), VER(0,0), N, N, N, N }, { GLX(SGI_make_current_read), VER(1,3), Y, N, N, N }, @@ -99,7 +99,7 @@ static const struct extension_info known_glx_extensions[] = { { GLX(SGIS_color_range), VER(0,0), N, N, N, N }, { GLX(SGIS_multisample), VER(0,0), Y, Y, N, N }, { GLX(SGIX_dm_buffer), VER(0,0), N, N, N, N }, - { GLX(SGIX_fbconfig), VER(1,3), Y, N, N, N }, + { GLX(SGIX_fbconfig), VER(1,3), Y, Y, N, N }, { GLX(SGIX_pbuffer), VER(1,3), Y, N, N, N }, { GLX(SGIX_swap_barrier), VER(0,0), N, N, N, N }, { GLX(SGIX_swap_group), VER(0,0), N, N, N, N }, diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 0c07cc0c148..1483dc0445c 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -13,15 +13,6 @@ * * These functions are compiled into each DRI driver so libGL.so knows nothing * about them. - * - * \note - * When \c DRI_NEW_INTERFACE_ONLY is defined, code is built / not built so - * that only the "new" libGL-to-driver interfaces are supported. This breaks - * backwards compatability. However, this may be necessary when DRI drivers - * are built to be used in non-XFree86 environments. - * - * \todo There are still some places in the code that need to be wrapped with - * \c DRI_NEW_INTERFACE_ONLY. */ @@ -35,17 +26,8 @@ #define MAP_FAILED ((void *)-1) #endif -#ifndef DRI_NEW_INTERFACE_ONLY -# include -# include -# include -# include "xf86dri.h" -# define _mesa_malloc(b) Xmalloc(b) -# define _mesa_free(m) Xfree(m) -#else -# include "imports.h" -# define None 0 -#endif /* DRI_NEW_INTERFACE_ONLY */ +#include "imports.h" +#define None 0 #include "dri_util.h" #include "drm_sarea.h" @@ -99,27 +81,6 @@ static void *driCreateNewDrawable(__DRInativeDisplay *dpy, const __GLcontextMode static void driDestroyDrawable(__DRInativeDisplay *dpy, void *drawablePrivate); - - -#ifdef not_defined -static GLboolean driFeatureOn(const char *name) -{ - char *env = getenv(name); - - if (!env) return GL_FALSE; - if (!strcasecmp(env, "enable")) return GL_TRUE; - if (!strcasecmp(env, "1")) return GL_TRUE; - if (!strcasecmp(env, "on")) return GL_TRUE; - if (!strcasecmp(env, "true")) return GL_TRUE; - if (!strcasecmp(env, "t")) return GL_TRUE; - if (!strcasecmp(env, "yes")) return GL_TRUE; - if (!strcasecmp(env, "y")) return GL_TRUE; - - return GL_FALSE; -} -#endif /* not_defined */ - - /** * Print message to \c stderr if the \c LIBGL_DEBUG environment variable * is set. @@ -142,77 +103,8 @@ __driUtilMessage(const char *f, ...) } } -/* - * fd.o bug #1713: Some rare libGL's have __glXFindDRIScreen defined but do not - * export it via glXGetProcAddress. These are not supported anymore, so print - * an error message to that effect. - ajax 2004-10-26 - */ typedef __DRIscreen *(*PFNGLXFINDDRISCREEN)(__DRInativeDisplay *, int); - -static __DRIscreen *glx_find_dri_screen(__DRInativeDisplay *d, int i) -{ - PFNGLXFINDDRISCREEN findscreen = - (PFNGLXFINDDRISCREEN)glXGetProcAddress("__glXFindDRIScreen"); - - if (!findscreen) - { - __driUtilMessage("glXGetProcAddress(\"__glXFindDRIScreen\") failed!"); - __driUtilMessage("Your libGL is too old, please upgrade."); - return NULL; - } - else return findscreen(d, i); -} - -/*****************************************************************/ -/** \name Visual utility functions */ -/*****************************************************************/ -/*@{*/ - -#ifndef DRI_NEW_INTERFACE_ONLY -/** - * Find a \c __GLcontextModes structure matching the given visual ID. - * - * \param dpy Display to search for a matching configuration. - * \param scrn Screen number on \c dpy to be searched. - * \param vid Desired \c VisualID to find. - * - * \returns A pointer to a \c __GLcontextModes structure that matches \c vid, - * if found, or \c NULL if no match is found. - */ -static const __GLcontextModes * -findConfigMode(__DRInativeDisplay *dpy, int scrn, VisualID vid, - const __DRIscreen * pDRIScreen) -{ - if ( (pDRIScreen != NULL) && (pDRIScreen->private != NULL) ) { - const __DRIscreenPrivate * const psp = - (const __DRIscreenPrivate *) pDRIScreen->private; - - return _gl_context_modes_find_visual( psp->modes, vid ); - } - - return NULL; -} - - -/** - * This function is a hack to work-around old versions of libGL.so that - * do not export \c XF86DRICreateContextWithConfig. I would modify the - * code to just use this function, but the stand-alone driver (i.e., DRI - * drivers that are built to work without XFree86) shouldn't have to know - * about X structures like a \c Visual. - */ -static GLboolean -fake_XF86DRICreateContextWithConfig( __DRInativeDisplay* dpy, int screen, int configID, - XID* context, drm_context_t * hHWContext ) -{ - Visual vis; - - vis.visualid = configID; - return XF86DRICreateContext( dpy, screen, & vis, context, hHWContext ); -} -#endif /* DRI_NEW_INTERFACE_ONLY */ - -/*@}*/ +static PFNGLXFINDDRISCREEN glx_find_dri_screen = NULL; /*****************************************************************/ @@ -242,50 +134,6 @@ static __DRIdrawable *__driFindDrawable(void *drawHash, __DRIid draw) return pdraw; } -#ifndef DRI_NEW_INTERFACE_ONLY -static GLboolean __driWindowExistsFlag; - -static int __driWindowExistsErrorHandler(Display *dpy, XErrorEvent *xerr) -{ - if (xerr->error_code == BadWindow) { - __driWindowExistsFlag = GL_FALSE; - } - return 0; -} - -/** - * Determine if a window associated with a \c GLXDrawable exists on the - * X-server. - * - * \param dpy Display associated with the drawable to be queried. - * \param draw \c GLXDrawable to test. - * - * \returns \c GL_TRUE if a window exists that is associated with \c draw, - * otherwise \c GL_FALSE is returned. - * - * \warning This function is not currently thread-safe. - * - * \deprecated - * \c __glXWindowExists (from libGL) is prefered over this function. Starting - * with the next major release of XFree86, this function will be removed. - * Even now this function is no longer directly called. Instead it is called - * via a function pointer if and only if \c __glXWindowExists does not exist. - * - * \sa __glXWindowExists glXGetProcAddress window_exists - */ -static GLboolean __driWindowExists(Display *dpy, GLXDrawable draw) -{ - XWindowAttributes xwa; - int (*oldXErrorHandler)(Display *, XErrorEvent *); - - XSync(dpy, GL_FALSE); - __driWindowExistsFlag = GL_TRUE; - oldXErrorHandler = XSetErrorHandler(__driWindowExistsErrorHandler); - XGetWindowAttributes(dpy, draw, &xwa); /* dummy request */ - XSetErrorHandler(oldXErrorHandler); - return __driWindowExistsFlag; -} -#endif /* DRI_NEW_INTERFACE_ONLY */ /** * Find drawables in the local hash that have been destroyed on the @@ -341,7 +189,7 @@ static void __driGarbageCollectDrawables(void *drawHash) * While casting the opaque private pointers associated with the parameters * into their respective real types it also assures they are not \c NULL. */ -static GLboolean driUnbindContext3(__DRInativeDisplay *dpy, int scrn, +static GLboolean driUnbindContext(__DRInativeDisplay *dpy, int scrn, __DRIid draw, __DRIid read, __DRIcontext *ctx) { @@ -355,7 +203,7 @@ static GLboolean driUnbindContext3(__DRInativeDisplay *dpy, int scrn, /* ** Assume error checking is done properly in glXMakeCurrent before - ** calling driUnbindContext3. + ** calling driUnbindContext. */ if (ctx == NULL || draw == None || read == None) { @@ -363,7 +211,7 @@ static GLboolean driUnbindContext3(__DRInativeDisplay *dpy, int scrn, return GL_FALSE; } - pDRIScreen = glx_find_dri_screen(dpy, scrn); + pDRIScreen = (*glx_find_dri_screen)(dpy, scrn); if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { /* ERROR!!! */ return GL_FALSE; @@ -523,7 +371,7 @@ static GLboolean DoBindContext(__DRInativeDisplay *dpy, * for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent * function. */ -static GLboolean driBindContext3(__DRInativeDisplay *dpy, int scrn, +static GLboolean driBindContext(__DRInativeDisplay *dpy, int scrn, __DRIid draw, __DRIid read, __DRIcontext * ctx) { @@ -539,7 +387,7 @@ static GLboolean driBindContext3(__DRInativeDisplay *dpy, int scrn, return GL_FALSE; } - pDRIScreen = glx_find_dri_screen(dpy, scrn); + pDRIScreen = (*glx_find_dri_screen)(dpy, scrn); if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { /* ERROR!!! */ return GL_FALSE; @@ -548,79 +396,6 @@ static GLboolean driBindContext3(__DRInativeDisplay *dpy, int scrn, return DoBindContext( dpy, draw, read, ctx, ctx->mode, (__DRIscreenPrivate *)pDRIScreen->private ); } - - -#ifndef DRI_NEW_INTERFACE_ONLY -/** - * This function takes both a read buffer and a draw buffer. This is needed - * for \c glXMakeCurrentReadSGI or GLX 1.3's \c glXMakeContextCurrent - * function. - */ -static GLboolean driBindContext2(Display *dpy, int scrn, - GLXDrawable draw, GLXDrawable read, - GLXContext gc) -{ - __DRIscreen *pDRIScreen; - const __GLcontextModes *modes; - - /* - ** Assume error checking is done properly in glXMakeCurrent before - ** calling driBindContext. - */ - - if (gc == NULL || draw == None || read == None) { - /* ERROR!!! */ - return GL_FALSE; - } - - pDRIScreen = glx_find_dri_screen(dpy, scrn); - modes = (driCompareGLXAPIVersion( 20040317 ) >= 0) - ? gc->driContext.mode - : findConfigMode( dpy, scrn, gc->vid, pDRIScreen ); - - if ( modes == NULL ) { - /* ERROR!!! */ - return GL_FALSE; - } - - /* findConfigMode will return NULL if the DRI screen or screen private - * are NULL. - */ - assert( (pDRIScreen != NULL) && (pDRIScreen->private != NULL) ); - - return DoBindContext( dpy, draw, read, & gc->driContext, modes, - (__DRIscreenPrivate *)pDRIScreen->private ); -} - -static GLboolean driUnbindContext2(Display *dpy, int scrn, - GLXDrawable draw, GLXDrawable read, - GLXContext gc) -{ - return driUnbindContext3(dpy, scrn, draw, read, & gc->driContext); -} - -/* - * Simply call bind with the same GLXDrawable for the read and draw buffers. - */ -static GLboolean driBindContext(Display *dpy, int scrn, - GLXDrawable draw, GLXContext gc) -{ - return driBindContext2(dpy, scrn, draw, draw, gc); -} - - -/* - * Simply call bind with the same GLXDrawable for the read and draw buffers. - */ -static GLboolean driUnbindContext(Display *dpy, int scrn, - GLXDrawable draw, GLXContext gc, - int will_rebind) -{ - (void) will_rebind; - return driUnbindContext2( dpy, scrn, draw, draw, gc ); -} -#endif /* DRI_NEW_INTERFACE_ONLY */ - /*@}*/ @@ -803,7 +578,7 @@ static void *driCreateNewDrawable(__DRInativeDisplay *dpy, int renderType, const int *attrs) { - __DRIscreen * const pDRIScreen = glx_find_dri_screen(dpy, modes->screen); + __DRIscreen * const pDRIScreen = (*glx_find_dri_screen)(dpy, modes->screen); __DRIscreenPrivate *psp; __DRIdrawablePrivate *pdp; @@ -853,13 +628,9 @@ static void *driCreateNewDrawable(__DRInativeDisplay *dpy, pdp->getInfo = (PFNGLXGETDRAWABLEINFOPROC) glXGetProcAddress( (const GLubyte *) "__glXGetDrawableInfo" ); if ( pdp->getInfo == NULL ) { -#ifdef DRI_NEW_INTERFACE_ONLY (void)XF86DRIDestroyDrawable(dpy, modes->screen, pdp->draw); _mesa_free(pdp); return NULL; -#else - pdp->getInfo = (PFNGLXGETDRAWABLEINFOPROC) XF86DRIGetDrawableInfo; -#endif /* DRI_NEW_INTERFACE_ONLY */ } if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, modes, @@ -873,19 +644,18 @@ static void *driCreateNewDrawable(__DRInativeDisplay *dpy, pdraw->destroyDrawable = driDestroyDrawable; pdraw->swapBuffers = driSwapBuffers; /* called by glXSwapBuffers() */ - if ( driCompareGLXAPIVersion( 20030317 ) >= 0 ) { - pdraw->getSBC = driGetSBC; - pdraw->waitForSBC = driWaitForSBC; - pdraw->waitForMSC = driWaitForMSC; - pdraw->swapBuffersMSC = driSwapBuffersMSC; - pdraw->frameTracking = NULL; - pdraw->queryFrameTracking = driQueryFrameTracking; - - /* This special default value is replaced with the configured - * default value when the drawable is first bound to a direct - * rendering context. */ - pdraw->swap_interval = (unsigned)-1; - } + pdraw->getSBC = driGetSBC; + pdraw->waitForSBC = driWaitForSBC; + pdraw->waitForMSC = driWaitForMSC; + pdraw->swapBuffersMSC = driSwapBuffersMSC; + pdraw->frameTracking = NULL; + pdraw->queryFrameTracking = driQueryFrameTracking; + + /* This special default value is replaced with the configured + * default value when the drawable is first bound to a direct + * rendering context. + */ + pdraw->swap_interval = (unsigned)-1; pdp->swapBuffers = psp->DriverAPI.SwapBuffers; @@ -998,7 +768,7 @@ driCreateNewContext(__DRInativeDisplay *dpy, const __GLcontextModes *modes, __DRIscreenPrivate *psp; void * const shareCtx = (pshare != NULL) ? pshare->driverPrivate : NULL; - pDRIScreen = glx_find_dri_screen(dpy, modes->screen); + pDRIScreen = (*glx_find_dri_screen)(dpy, modes->screen); if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { /* ERROR!!! */ return NULL; @@ -1035,26 +805,8 @@ driCreateNewContext(__DRInativeDisplay *dpy, const __GLcontextModes *modes, } pctx->destroyContext = driDestroyContext; -#ifdef DRI_NEW_INTERFACE_ONLY - pctx->bindContext = NULL; - pctx->unbindContext = NULL; - pctx->bindContext2 = NULL; - pctx->unbindContext2 = NULL; - pctx->bindContext3 = driBindContext3; - pctx->unbindContext3 = driUnbindContext3; -#else - pctx->bindContext = (void *)driBindContext; - pctx->unbindContext = (void *)driUnbindContext; - if ( driCompareGLXAPIVersion( 20030606 ) >= 0 ) { - pctx->bindContext2 = (void *)driBindContext2; - pctx->unbindContext2 = (void *)driUnbindContext2; - } - - if ( driCompareGLXAPIVersion( 20040415 ) >= 0 ) { - pctx->bindContext3 = (void *)driBindContext3; - pctx->unbindContext3 = (void *)driUnbindContext3; - } -#endif + pctx->bindContext = driBindContext; + pctx->unbindContext = driUnbindContext; if ( !(*psp->DriverAPI.CreateContext)(modes, pcp, shareCtx) ) { (void)XF86DRIDestroyContext(dpy, modes->screen, pcp->contextID); @@ -1066,57 +818,6 @@ driCreateNewContext(__DRInativeDisplay *dpy, const __GLcontextModes *modes, return pcp; } - - -#ifndef DRI_NEW_INTERFACE_ONLY -/** - * Create the per-drawable private driver information. - * - * \param dpy the display handle. - * \param vis the visual information. - * \param sharedPrivate the shared context dependent methods or \c NULL if - * non-existent. - * \param pctx will receive the context dependent methods. - * - * \returns a opaque pointer to the per-context private information on success, or \c NULL - * on failure. - * - * \deprecated - * This function has been replaced by \c driCreateNewContext. In drivers - * built to work with XFree86, this function will continue to exist to support - * older versions of libGL. Starting with the next major relelase of XFree86, - * this function will be removed. - * - * \internal - * This function allocates and fills a __DRIcontextPrivateRec structure. It - * gets the visual, converts it into a __GLcontextModesRec and passes it - * to __DriverAPIRec::CreateContext to create the context. - */ -static void *driCreateContext(Display *dpy, XVisualInfo *vis, - void *sharedPrivate, __DRIcontext *pctx) -{ - __DRIscreen *pDRIScreen; - const __GLcontextModes *modes; - - pDRIScreen = glx_find_dri_screen(dpy, vis->screen); - if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { - /* ERROR!!! */ - return NULL; - } - - - /* Setup a __GLcontextModes struct corresponding to vis->visualid - * and create the rendering context. - */ - - modes = findConfigMode(dpy, vis->screen, vis->visualid, pDRIScreen); - return (modes == NULL) - ? NULL - : driCreateNewContext( dpy, modes, GLX_RGBA_TYPE, - sharedPrivate, pctx ); -} -#endif /* DRI_NEW_INTERFACE_ONLY */ - /*@}*/ @@ -1184,6 +885,11 @@ static void driDestroyScreen(__DRInativeDisplay *dpy, int scrn, void *screenPriv * \param internal_api_version Version of the internal interface between the * driver and libGL. * \param driverAPI Driver API functions used by other routines in dri_util.c. + * + * \note + * There is no need to check the minimum API version in this function. Since + * the \c __driCreateNewScreen function is versioned, it is impossible for a + * loader that is too old to even load this driver. */ __DRIscreenPrivate * __driUtilCreateNewScreen(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, @@ -1200,46 +906,23 @@ __driUtilCreateNewScreen(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, __DRIscreenPrivate *psp; -#ifdef DRI_NEW_INTERFACE_ONLY - if ( internal_api_version < 20040602 ) { - fprintf( stderr, "libGL error: libGL.so version (%08u) is too old. " - "20040602 or later is required.\n", internal_api_version ); - return NULL; - } -#else - if ( internal_api_version == 20031201 ) { - fprintf( stderr, "libGL error: libGL version 20031201 has critical " - "binary compatilibity bugs.\nlibGL error: You must upgrade " - "to use direct-rendering!\n" ); - return NULL; - } -#endif /* DRI_NEW_INTERFACE_ONLY */ - - window_exists = (PFNGLXWINDOWEXISTSPROC) glXGetProcAddress( (const GLubyte *) "__glXWindowExists" ); if ( window_exists == NULL ) { -#ifdef DRI_NEW_INTERFACE_ONLY - fprintf( stderr, "libGL error: libGL.so version (%08u) is too old. " - "20021128 or later is required.\n", internal_api_version ); return NULL; -#else - window_exists = (PFNGLXWINDOWEXISTSPROC) __driWindowExists; -#endif /* DRI_NEW_INTERFACE_ONLY */ + } + + glx_find_dri_screen = + (PFNGLXFINDDRISCREEN)glXGetProcAddress("__glXFindDRIScreen"); + if ( glx_find_dri_screen == NULL ) { + return NULL; } create_context_with_config = (PFNGLXCREATECONTEXTWITHCONFIGPROC) glXGetProcAddress( (const GLubyte *) "__glXCreateContextWithConfig" ); if ( create_context_with_config == NULL ) { -#ifdef DRI_NEW_INTERFACE_ONLY - fprintf( stderr, "libGL error: libGL.so version (%08u) is too old. " - "20031201 or later is required.\n", internal_api_version ); return NULL; -#else - create_context_with_config = (PFNGLXCREATECONTEXTWITHCONFIGPROC) - fake_XF86DRICreateContextWithConfig; -#endif /* DRI_NEW_INTERFACE_ONLY */ } api_ver = internal_api_version; @@ -1302,25 +985,10 @@ __driUtilCreateNewScreen(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, psp->dummyContextPriv.driScreenPriv = NULL; psc->destroyScreen = driDestroyScreen; -#ifndef DRI_NEW_INTERFACE_ONLY - psc->createContext = driCreateContext; -#else - psc->createContext = NULL; -#endif psc->createNewDrawable = driCreateNewDrawable; psc->getDrawable = driGetDrawable; -#ifdef DRI_NEW_INTERFACE_ONLY psc->getMSC = driGetMSC; psc->createNewContext = driCreateNewContext; -#else - if ( driCompareGLXAPIVersion( 20030317 ) >= 0 ) { - psc->getMSC = driGetMSC; - - if ( driCompareGLXAPIVersion( 20030824 ) >= 0 ) { - psc->createNewContext = driCreateNewContext; - } - } -#endif if ( (psp->DriverAPI.InitDriver != NULL) && !(*psp->DriverAPI.InitDriver)(psp) ) { @@ -1333,233 +1001,6 @@ __driUtilCreateNewScreen(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, } -#ifndef DRI_NEW_INTERFACE_ONLY -/** - * Utility function used to create a new driver-private screen structure. - * - * \param dpy Display pointer. - * \param scrn Index of the screen. - * \param psc DRI screen data (not driver private) - * \param numConfigs Number of visual configs pointed to by \c configs. - * \param configs Array of GLXvisualConfigs exported by the 2D driver. - * \param driverAPI Driver API functions used by other routines in dri_util.c. - * - * \deprecated - * This function has been replaced by \c __driUtilCreateNewScreen. In drivers - * built to work with XFree86, this function will continue to exist to support - * older versions of libGL. Starting with the next major relelase of XFree86, - * this function will be removed. - */ -__DRIscreenPrivate * -__driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *configs, - const struct __DriverAPIRec *driverAPI) -{ - int directCapable; - __DRIscreenPrivate *psp = NULL; - drm_handle_t hSAREA; - drmAddress pSAREA; - char *BusID; - __GLcontextModes *modes; - __GLcontextModes *temp; - int i; - __DRIversion ddx_version; - __DRIversion dri_version; - __DRIversion drm_version; - __DRIframebuffer framebuffer; - int fd = -1; - int status; - const char * err_msg; - const char * err_extra; - - - if (!XF86DRIQueryDirectRenderingCapable(dpy, scrn, &directCapable) - || !directCapable) { - return NULL; - } - - - /* Create the linked list of context modes, and populate it with the - * GLX visual information passed in by libGL. - */ - - modes = _gl_context_modes_create( numConfigs, sizeof(__GLcontextModes) ); - if ( modes == NULL ) { - return NULL; - } - - temp = modes; - for ( i = 0 ; i < numConfigs ; i++ ) { - assert( temp != NULL ); - _gl_copy_visual_to_context_mode( temp, & configs[i] ); - temp->screen = scrn; - - temp = temp->next; - } - - err_msg = "XF86DRIOpenConnection"; - err_extra = NULL; - - if (XF86DRIOpenConnection(dpy, scrn, &hSAREA, &BusID)) { - fd = drmOpen(NULL,BusID); - _mesa_free(BusID); /* No longer needed */ - - err_msg = "open DRM"; - err_extra = strerror( -fd ); - - if (fd >= 0) { - drm_magic_t magic; - - err_msg = "drmGetMagic"; - err_extra = NULL; - - if (!drmGetMagic(fd, &magic)) { - drmVersionPtr version = drmGetVersion(fd); - if (version) { - drm_version.major = version->version_major; - drm_version.minor = version->version_minor; - drm_version.patch = version->version_patchlevel; - drmFreeVersion(version); - } - else { - drm_version.major = -1; - drm_version.minor = -1; - drm_version.patch = -1; - } - - err_msg = "XF86DRIAuthConnection"; - if (XF86DRIAuthConnection(dpy, scrn, magic)) { - char *driverName; - - /* - * Get device name (like "tdfx") and the ddx version numbers. - * We'll check the version in each DRI driver's "createScreen" - * function. - */ - err_msg = "XF86DRIGetClientDriverName"; - if (XF86DRIGetClientDriverName(dpy, scrn, - &ddx_version.major, - &ddx_version.minor, - &ddx_version.patch, - &driverName)) { - - /* No longer needed. */ - _mesa_free( driverName ); - - /* - * Get the DRI X extension version. - */ - err_msg = "XF86DRIQueryVersion"; - if (XF86DRIQueryVersion(dpy, - &dri_version.major, - &dri_version.minor, - &dri_version.patch)) { - drm_handle_t hFB; - int junk; - - /* - * Get device-specific info. pDevPriv will point to a struct - * (such as DRIRADEONRec in xfree86/driver/ati/radeon_dri.h) - * that has information about the screen size, depth, pitch, - * ancilliary buffers, DRM mmap handles, etc. - */ - err_msg = "XF86DRIGetDeviceInfo"; - if (XF86DRIGetDeviceInfo(dpy, scrn, - &hFB, - &junk, - &framebuffer.size, - &framebuffer.stride, - &framebuffer.dev_priv_size, - &framebuffer.dev_priv)) { - framebuffer.width = DisplayWidth(dpy, scrn); - framebuffer.height = DisplayHeight(dpy, scrn); - - /* - * Map the framebuffer region. - */ - status = drmMap(fd, hFB, framebuffer.size, - (drmAddressPtr)&framebuffer.base); - - err_msg = "drmMap of framebuffer"; - err_extra = strerror( -status ); - - if ( status == 0 ) { - /* - * Map the SAREA region. Further mmap regions may be setup in - * each DRI driver's "createScreen" function. - */ - status = drmMap(fd, hSAREA, SAREA_MAX, - &pSAREA); - - err_msg = "drmMap of sarea"; - err_extra = strerror( -status ); - - if ( status == 0 ) { - PFNGLXGETINTERNALVERSIONPROC get_ver; - - get_ver = (PFNGLXGETINTERNALVERSIONPROC) - glXGetProcAddress( (const GLubyte *) "__glXGetInternalVersion" ); - - err_msg = "InitDriver"; - err_extra = NULL; - psp = __driUtilCreateNewScreen( dpy, scrn, psc, modes, - & ddx_version, - & dri_version, - & drm_version, - & framebuffer, - pSAREA, - fd, - (get_ver != NULL) ? (*get_ver)() : 1, - driverAPI ); - } - } - } - } - } - } - } - } - } - - if ( psp == NULL ) { - if ( pSAREA != MAP_FAILED ) { - (void)drmUnmap(pSAREA, SAREA_MAX); - } - - if ( framebuffer.base != MAP_FAILED ) { - (void)drmUnmap((drmAddress)framebuffer.base, framebuffer.size); - } - - if ( framebuffer.dev_priv != NULL ) { - _mesa_free(framebuffer.dev_priv); - } - - if ( fd >= 0 ) { - (void)drmClose(fd); - } - - if ( modes != NULL ) { - _gl_context_modes_destroy( modes ); - } - - (void)XF86DRICloseConnection(dpy, scrn); - - if ( err_extra != NULL ) { - fprintf(stderr, "libGL error: %s failed (%s)\n", err_msg, - err_extra); - } - else { - fprintf(stderr, "libGL error: %s failed\n", err_msg ); - } - - fprintf(stderr, "libGL error: reverting to (slow) indirect rendering\n"); - } - - return psp; -} -#endif /* DRI_NEW_INTERFACE_ONLY */ - - /** * Compare the current GLX API version with a driver supplied required version. * diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index 6ef1b114f9c..3e2aa1f52d8 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -51,11 +51,7 @@ #define CAPI /* XXX this should be globally defined somewhere */ -#ifdef DRI_NEW_INTERFACE_ONLY -# include -#else -# include "glxclient.h" -#endif /* DRI_NEW_INTERFACE_ONLY */ +#include #include "drm.h" #include "drm_sarea.h" #include "GL/internal/glcore.h" @@ -63,13 +59,6 @@ #define GLX_BAD_CONTEXT 5 -/* This is a temporary relic. Once all drivers are converted to support - * the new interface, it can go away. - */ -#ifdef DRI_NEW_INTERFACE_ONLY -#define USE_NEW_INTERFACE -#endif - typedef struct __DRIdisplayPrivateRec __DRIdisplayPrivate; typedef struct __DRIscreenPrivateRec __DRIscreenPrivate; typedef struct __DRIcontextPrivateRec __DRIcontextPrivate; @@ -552,13 +541,6 @@ extern __DRIscreenPrivate * __driUtilCreateNewScreen( __DRInativeDisplay *dpy, drm_sarea_t *pSAREA, int fd, int internal_api_version, const struct __DriverAPIRec *driverAPI ); -#ifndef DRI_NEW_INTERFACE_ONLY -extern __DRIscreenPrivate * -__driUtilCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config, - const struct __DriverAPIRec *driverAPI); -#endif /* DRI_NEW_INTERFACE_ONLY */ - /* Test the version of the internal GLX API. Returns a value like strcmp. */ extern int driCompareGLXAPIVersion( GLint required_version ); diff --git a/src/mesa/drivers/dri/common/glcontextmodes.c b/src/mesa/drivers/dri/common/glcontextmodes.c index c540e5baecd..73209a9b01d 100644 --- a/src/mesa/drivers/dri/common/glcontextmodes.c +++ b/src/mesa/drivers/dri/common/glcontextmodes.c @@ -31,7 +31,7 @@ * \author Ian Romanick */ -#ifdef DRI_NEW_INTERFACE_ONLY +#ifdef IN_DRI_DRIVER # include # include # include @@ -55,11 +55,11 @@ extern void __glXFree( void * ptr ); # define _mesa_malloc(b) Xmalloc(b) # define _mesa_free(m) Xfree(m) # endif /* XFree86Server */ -#endif /* DRI_NEW_INTERFACE_ONLY */ +#endif /* !defined(IN_DRI_DRIVER) */ #include "glcontextmodes.h" -#ifndef DRI_NEW_INTERFACE_ONLY +#if !defined(IN_DRI_DRIVER) #define NUM_VISUAL_TYPES 6 /** @@ -320,7 +320,7 @@ _gl_get_context_mode_data(const __GLcontextModes *mode, int attribute, return GLX_BAD_ATTRIBUTE; } } -#endif /* DRI_NEW_INTERFACE_ONLY */ +#endif /* !defined(IN_DRI_DRIVER) */ /** diff --git a/src/mesa/drivers/dri/common/glcontextmodes.h b/src/mesa/drivers/dri/common/glcontextmodes.h index 46b4c68dcaf..ce74287b3d8 100644 --- a/src/mesa/drivers/dri/common/glcontextmodes.h +++ b/src/mesa/drivers/dri/common/glcontextmodes.h @@ -32,14 +32,14 @@ #include "GL/internal/glcore.h" -#ifndef DRI_NEW_INTERFACE_ONLY +#if !defined(IN_DRI_DRIVER) extern GLint _gl_convert_from_x_visual_type( int visualType ); extern GLint _gl_convert_to_x_visual_type( int visualType ); extern void _gl_copy_visual_to_context_mode( __GLcontextModes * mode, const __GLXvisualConfig * config ); extern int _gl_get_context_mode_data( const __GLcontextModes *mode, int attribute, int *value_return ); -#endif /* DRI_NEW_INTERFACE_ONLY */ +#endif /* !defined(IN_DRI_DRIVER) */ extern __GLcontextModes * _gl_context_modes_create( unsigned count, size_t minimum_size ); diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index fcdb9956b7a..41367b85d85 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -35,10 +35,6 @@ #include "extensions.h" #include "utils.h" -#if !defined( DRI_NEW_INTERFACE_ONLY ) -#include "xf86dri.h" /* For XF86DRIQueryVersion prototype. */ -#endif - #if defined(USE_X86_ASM) #include "x86/common_x86_asm.h" #endif @@ -275,57 +271,6 @@ void driInitSingleExtension( GLcontext * ctx, } - - -#ifndef DRI_NEW_INTERFACE_ONLY -/** - * Utility function used by drivers to test the verions of other components. - * - * \deprecated - * All drivers using the new interface should use \c driCheckDriDdxVersions2 - * instead. This function is implemented using a call that is not available - * to drivers using the new interface. Furthermore, the information gained - * by this call (the DRI and DDX version information) is already provided to - * the driver via the new interface. - */ -GLboolean -driCheckDriDdxDrmVersions(__DRIscreenPrivate *sPriv, - const char * driver_name, - int dri_major, int dri_minor, - int ddx_major, int ddx_minor, - int drm_major, int drm_minor) -{ - static const char format[] = "%s DRI driver expected %s version %d.%d.x " - "but got version %d.%d.%d"; - int major, minor, patch; - - /* Check the DRI version */ - if (XF86DRIQueryVersion(sPriv->display, &major, &minor, &patch)) { - if (major != dri_major || minor < dri_minor) { - __driUtilMessage(format, driver_name, "DRI", dri_major, dri_minor, - major, minor, patch); - return GL_FALSE; - } - } - - /* Check that the DDX driver version is compatible */ - if (sPriv->ddxMajor != ddx_major || sPriv->ddxMinor < ddx_minor) { - __driUtilMessage(format, driver_name, "DDX", ddx_major, ddx_minor, - sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch); - return GL_FALSE; - } - - /* Check that the DRM driver version is compatible */ - if (sPriv->drmMajor != drm_major || sPriv->drmMinor < drm_minor) { - __driUtilMessage(format, driver_name, "DRM", drm_major, drm_minor, - sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch); - return GL_FALSE; - } - - return GL_TRUE; -} -#endif /* DRI_NEW_INTERFACE_ONLY */ - /** * Utility function used by drivers to test the verions of other components. * @@ -343,7 +288,11 @@ driCheckDriDdxDrmVersions(__DRIscreenPrivate *sPriv, * \returns \c GL_TRUE if all version requirements are met. Otherwise, * \c GL_FALSE is returned. * - * \sa __driCreateNewScreen, driCheckDriDdxDrmVersions, __driUtilMessage + * \sa __driCreateNewScreen, driCheckDriDdxDrmVersions2, __driUtilMessage + * + * \todo + * Now that the old \c driCheckDriDdxDrmVersions function is gone, this + * function and \c driCheckDriDdxDrmVersions2 should be renamed. */ GLboolean driCheckDriDdxDrmVersions3(const char * driver_name, diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h index be328df058f..6640229e475 100644 --- a/src/mesa/drivers/dri/common/utils.h +++ b/src/mesa/drivers/dri/common/utils.h @@ -90,12 +90,6 @@ extern void driInitExtensions( GLcontext * ctx, extern void driInitSingleExtension( GLcontext * ctx, const struct dri_extension * ext ); -#ifndef DRI_NEW_INTERFACE_ONLY -extern GLboolean driCheckDriDdxDrmVersions( __DRIscreenPrivate *sPriv, - const char * driver_name, int dri_major, int dri_minor, - int ddx_major, int ddx_minor, int drm_major, int drm_minor ); -#endif - extern GLboolean driCheckDriDdxDrmVersions2(const char * driver_name, const __DRIversion * driActual, const __DRIversion * driExpected, const __DRIversion * ddxActual, const __DRIversion * ddxExpected, diff --git a/src/mesa/drivers/dri/common/vblank.c b/src/mesa/drivers/dri/common/vblank.c index aaeaebb0362..eebe42d96a1 100644 --- a/src/mesa/drivers/dri/common/vblank.c +++ b/src/mesa/drivers/dri/common/vblank.c @@ -181,11 +181,9 @@ int driWaitForMSC32( __DRIdrawablePrivate *priv, GLuint driGetDefaultVBlankFlags( const driOptionCache *optionCache ) { - GLuint flags = 0; + GLuint flags = VBLANK_FLAG_INTERVAL; int vblank_mode; - flags |= (driCompareGLXAPIVersion( 20030317 ) >= 0) - ? VBLANK_FLAG_INTERVAL : 0; if ( driCheckOption( optionCache, "vblank_mode", DRI_ENUM ) ) vblank_mode = driQueryOptioni( optionCache, "vblank_mode" ); diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c index 01014f7efdb..6f4ffc078e5 100644 --- a/src/mesa/drivers/dri/fb/fb_dri.c +++ b/src/mesa/drivers/dri/fb/fb_dri.c @@ -73,9 +73,7 @@ typedef struct { #define FB_CONTEXT(ctx) ((fbContextPtr)(ctx->DriverCtx)) -#ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -#endif /* USE_NEW_INTERFACE */ static const GLubyte * get_string(GLcontext *ctx, GLenum pname) @@ -659,7 +657,6 @@ struct DRIDriverRec __driDriver = { __driHaltFBDev }; -#ifdef USE_NEW_INTERFACE static __GLcontextModes * fbFillInModes( unsigned pixel_bits, unsigned depth_bits, unsigned stencil_bits, GLboolean have_back_buffer ) @@ -793,4 +790,3 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc return (void *) psp; } -#endif /* USE_NEW_INTERFACE */ diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c index aced4a9253d..c516cae2f2d 100644 --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c +++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c @@ -616,23 +616,6 @@ static const struct __DriverAPIRec ffbAPI = { }; -/* - * This is the bootstrap function for the driver. - * The __driCreateScreen name is the symbol that libGL.so fetches. - * Return: pointer to a __DRIscreenPrivate. - */ -#if !defined(DRI_NEW_INTERFACE_ONLY) -void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config) -{ - __DRIscreenPrivate *psp; - psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &ffbAPI); - return (void *) psp; -} -#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */ - - -#ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; static __GLcontextModes * @@ -714,7 +697,6 @@ ffbFillInModes( unsigned pixel_bits, unsigned depth_bits, return modes; } -#endif /* USE_NEW_INTERFACE */ /** @@ -727,9 +709,8 @@ ffbFillInModes( unsigned pixel_bits, unsigned depth_bits, * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on * failure. */ -#ifdef USE_NEW_INTERFACE PUBLIC -void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -766,4 +747,3 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc return (void *) psp; } -#endif /* USE_NEW_INTERFACE */ diff --git a/src/mesa/drivers/dri/ffb/server/ffb_dac.h b/src/mesa/drivers/dri/ffb/server/ffb_dac.h index 5e4b5ff815d..08114282e51 100644 --- a/src/mesa/drivers/dri/ffb/server/ffb_dac.h +++ b/src/mesa/drivers/dri/ffb/server/ffb_dac.h @@ -26,9 +26,7 @@ #ifndef _FFB_DAC_H #define _FFB_DAC_H -#if defined( DRI_NEW_INTERFACE_ONLY ) #define Bool int -#endif /* FFB utilizes two different ramdac chips: * diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index f270df66b65..0eacdd75f07 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -54,11 +54,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "GL/internal/dri_interface.h" -#ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -#endif /* USE_NEW_INTERFACE */ -#ifdef USE_NEW_INTERFACE static __GLcontextModes *fill_in_modes( __GLcontextModes *modes, unsigned pixel_bits, unsigned depth_bits, @@ -122,9 +119,8 @@ static __GLcontextModes *fill_in_modes( __GLcontextModes *modes, return modes; } -#endif /* USE_NEW_INTERFACE */ -#ifdef USE_NEW_INTERFACE + static __GLcontextModes * i810FillInModes( unsigned pixel_bits, unsigned depth_bits, unsigned stencil_bits, GLboolean have_back_buffer ) @@ -189,8 +185,6 @@ i810FillInModes( unsigned pixel_bits, unsigned depth_bits, return modes; } -#endif /* USE_NEW_INTERFACE */ - /* static int i810_malloc_proxy_buf(drmBufMapPtr buffers) */ @@ -421,21 +415,6 @@ static const struct __DriverAPIRec i810API = { }; -/* - * This is the bootstrap function for the driver. - * The __driCreateScreen name is the symbol that libGL.so fetches. - * Return: pointer to a __DRIscreenPrivate. - */ -#if !defined(DRI_NEW_INTERFACE_ONLY) -void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config) -{ - __DRIscreenPrivate *psp; - psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &i810API); - return (void *) psp; -} -#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */ - /** * This is the bootstrap function for the driver. libGL supplies all of the * requisite information about the system, and the driver initializes itself. @@ -446,9 +425,8 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on * failure. */ -#ifdef USE_NEW_INTERFACE PUBLIC -void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -487,4 +465,3 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc return (void *) psp; } -#endif /* USE_NEW_INTERFACE */ diff --git a/src/mesa/drivers/dri/i830/i830_screen.c b/src/mesa/drivers/dri/i830/i830_screen.c index 82883d07f2a..99155c66007 100644 --- a/src/mesa/drivers/dri/i830/i830_screen.c +++ b/src/mesa/drivers/dri/i830/i830_screen.c @@ -67,9 +67,7 @@ DRI_CONF_BEGIN DRI_CONF_END; const GLuint __driNConfigOptions = 2; -#ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -#endif /*USE_NEW_INTERFACE*/ static int i830_malloc_proxy_buf(drmBufMapPtr buffers) { @@ -144,8 +142,15 @@ static GLboolean i830InitDriver(__DRIscreenPrivate *sPriv) { i830ScreenPrivate *i830Screen; I830DRIPtr gDRIPriv = (I830DRIPtr)sPriv->pDevPriv; + PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = + (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + void * const psc = sPriv->psc->screenConfigs; + if ( glx_enable_extension == NULL ) { + return GL_FALSE; + } + /* Allocate the private area */ i830Screen = (i830ScreenPrivate *)CALLOC(sizeof(i830ScreenPrivate)); if (!i830Screen) { @@ -281,20 +286,7 @@ static GLboolean i830InitDriver(__DRIscreenPrivate *sPriv) } #endif - if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) { - PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); - void * const psc = sPriv->psc->screenConfigs; - - if ( glx_enable_extension != NULL ) { - (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" ); - - if ( driCompareGLXAPIVersion( 20030915 ) >= 0 ) { - (*glx_enable_extension)( psc, "GLX_SGIX_fbconfig" ); - (*glx_enable_extension)( psc, "GLX_OML_swap_method" ); - } - } - } + (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" ); return GL_TRUE; } @@ -428,23 +420,6 @@ static const struct __DriverAPIRec i830API = { }; -/* - * This is the bootstrap function for the driver. - * The __driCreateScreen name is the symbol that libGL.so fetches. - * Return: pointer to a __DRIscreenPrivate. - */ -#if !defined(DRI_NEW_INTERFACE_ONLY) -void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config) -{ - __DRIscreenPrivate *psp; - psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &i830API); - return (void *) psp; -} -#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */ - - -#ifdef USE_NEW_INTERFACE static __GLcontextModes * i830FillInModes( unsigned pixel_bits, unsigned depth_bits, unsigned stencil_bits, GLboolean have_back_buffer ) @@ -515,7 +490,6 @@ i830FillInModes( unsigned pixel_bits, unsigned depth_bits, return modes; } -#endif /* USE_NEW_INTERFACE */ /** @@ -528,9 +502,8 @@ i830FillInModes( unsigned pixel_bits, unsigned depth_bits, * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on * failure. */ -#ifdef USE_NEW_INTERFACE PUBLIC -void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -571,4 +544,3 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc return (void *) psp; } -#endif /* USE_NEW_INTERFACE */ diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index d41cda1be77..5e3826a6886 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -54,9 +54,7 @@ DRI_CONF_BEGIN DRI_CONF_END; const GLuint __driNConfigOptions = 1; -#ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -#endif /*USE_NEW_INTERFACE*/ static void intelPrintDRIInfo(intelScreenPrivate *intelScreen, @@ -78,8 +76,15 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv) { intelScreenPrivate *intelScreen; I830DRIPtr gDRIPriv = (I830DRIPtr)sPriv->pDevPriv; + PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = + (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + void * const psc = sPriv->psc->screenConfigs; + if (glx_enable_extension == NULL) { + return GL_FALSE; + } + /* Allocate the private area */ intelScreen = (intelScreenPrivate *)CALLOC(sizeof(intelScreenPrivate)); if (!intelScreen) { @@ -195,28 +200,13 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv) } } - if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) { - PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); - void * const psc = sPriv->psc->screenConfigs; - - if (glx_enable_extension != NULL) { - (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" ); - - if ( driCompareGLXAPIVersion( 20030915 ) >= 0 ) { - (*glx_enable_extension)( psc, "GLX_SGIX_fbconfig" ); - (*glx_enable_extension)( psc, "GLX_OML_swap_method" ); - } - - if ( driCompareGLXAPIVersion( 20030818 ) >= 0 ) { - sPriv->psc->allocateMemory = (void *) intelAllocateMemoryMESA; - sPriv->psc->freeMemory = (void *) intelFreeMemoryMESA; - sPriv->psc->memoryOffset = (void *) intelGetMemoryOffsetMESA; + (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" ); + + sPriv->psc->allocateMemory = (void *) intelAllocateMemoryMESA; + sPriv->psc->freeMemory = (void *) intelFreeMemoryMESA; + sPriv->psc->memoryOffset = (void *) intelGetMemoryOffsetMESA; - (*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" ); - } - } - } + (*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" ); return GL_TRUE; } @@ -377,23 +367,7 @@ static const struct __DriverAPIRec intelAPI = { .SwapBuffersMSC = NULL }; -/* - * This is the bootstrap function for the driver. - * The __driCreateScreen name is the symbol that libGL.so fetches. - * Return: pointer to a __DRIscreenPrivate. - */ -#if !defined(DRI_NEW_INTERFACE_ONLY) -void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config) -{ - __DRIscreenPrivate *psp; - psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &intelAPI); - return (void *) psp; -} -#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */ - -#ifdef USE_NEW_INTERFACE static __GLcontextModes * intelFillInModes( unsigned pixel_bits, unsigned depth_bits, unsigned stencil_bits, GLboolean have_back_buffer ) @@ -466,7 +440,6 @@ intelFillInModes( unsigned pixel_bits, unsigned depth_bits, return modes; } -#endif /* USE_NEW_INTERFACE */ /** @@ -479,9 +452,8 @@ intelFillInModes( unsigned pixel_bits, unsigned depth_bits, * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on * failure. */ -#ifdef USE_NEW_INTERFACE PUBLIC -void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -522,4 +494,3 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc return (void *) psp; } -#endif /* USE_NEW_INTERFACE */ diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index d524a050e67..fd9acec36f4 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -67,11 +67,8 @@ static const GLuint __driNConfigOptions = 3; static const GLuint __driNConfigOptions = 2; #endif -#ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -#endif /* USE_NEW_INTERFACE */ -#ifdef USE_NEW_INTERFACE static __GLcontextModes * fill_in_modes( __GLcontextModes * modes, unsigned pixel_bits, unsigned depth_bits, @@ -136,10 +133,8 @@ static __GLcontextModes * fill_in_modes( __GLcontextModes * modes, return modes; } -#endif /* USE_NEW_INTERFACE */ -#ifdef USE_NEW_INTERFACE static __GLcontextModes * mach64FillInModes( unsigned pixel_bits, unsigned depth_bits, unsigned stencil_bits, GLboolean have_back_buffer ) @@ -204,7 +199,6 @@ mach64FillInModes( unsigned pixel_bits, unsigned depth_bits, return modes; } -#endif /* USE_NEW_INTERFACE */ /* Create the device specific screen private data struct. @@ -214,10 +208,18 @@ mach64CreateScreen( __DRIscreenPrivate *sPriv ) { mach64ScreenPtr mach64Screen; ATIDRIPtr serverInfo = (ATIDRIPtr)sPriv->pDevPriv; + PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = + (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + void * const psc = sPriv->psc->screenConfigs; + if ( MACH64_DEBUG & DEBUG_VERBOSE_DRI ) fprintf( stderr, "%s\n", __FUNCTION__ ); + if ( glx_enable_extension == NULL ) { + return NULL; + } + /* Allocate the private area */ mach64Screen = (mach64ScreenPtr) CALLOC( sizeof(*mach64Screen) ); if ( !mach64Screen ) return NULL; @@ -316,21 +318,15 @@ mach64CreateScreen( __DRIscreenPrivate *sPriv ) } mach64Screen->driScreen = sPriv; - if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) { - PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); - void * const psc = sPriv->psc->screenConfigs; - - if ( glx_enable_extension != NULL ) { - if ( mach64Screen->irq != 0 ) { - (*glx_enable_extension)( psc, "GLX_SGI_swap_control" ); - (*glx_enable_extension)( psc, "GLX_SGI_video_sync" ); - (*glx_enable_extension)( psc, "GLX_MESA_swap_control" ); - } - - (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); - } + + if ( mach64Screen->irq != 0 ) { + (*glx_enable_extension)( psc, "GLX_SGI_swap_control" ); + (*glx_enable_extension)( psc, "GLX_SGI_video_sync" ); + (*glx_enable_extension)( psc, "GLX_MESA_swap_control" ); } + + (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); + return mach64Screen; } @@ -492,21 +488,6 @@ static struct __DriverAPIRec mach64API = { }; -/* - * This is the bootstrap function for the driver. - * The __driCreateScreen name is the symbol that libGL.so fetches. - * Return: pointer to a __DRIscreenPrivate. - */ -#if !defined(DRI_NEW_INTERFACE_ONLY) -void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config) -{ - __DRIscreenPrivate *psp; - psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &mach64API); - return (void *) psp; -} -#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */ - /** * This is the bootstrap function for the driver. libGL supplies all of the * requisite information about the system, and the driver initializes itself. @@ -517,9 +498,8 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on * failure. */ -#ifdef USE_NEW_INTERFACE PUBLIC -void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -560,4 +540,3 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc return (void *) psp; } -#endif /* USE_NEW_INTERFACE */ diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 5dbcf546820..aaa4e25c103 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -104,9 +104,7 @@ DRI_CONF_BEGIN DRI_CONF_END; static const GLuint __driNConfigOptions = 6; -#ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -#endif /* USE_NEW_INTERFACE */ #ifndef MGA_DEBUG int MGA_DEBUG = 0; @@ -114,7 +112,6 @@ int MGA_DEBUG = 0; static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ); -#ifdef USE_NEW_INTERFACE static __GLcontextModes * mgaFillInModes( unsigned pixel_bits, unsigned depth_bits, unsigned stencil_bits, GLboolean have_back_buffer ) @@ -194,7 +191,6 @@ mgaFillInModes( unsigned pixel_bits, unsigned depth_bits, return modes; } -#endif /* USE_NEW_INTERFACE */ static GLboolean @@ -202,8 +198,15 @@ mgaInitDriver(__DRIscreenPrivate *sPriv) { mgaScreenPrivate *mgaScreen; MGADRIPtr serverInfo = (MGADRIPtr)sPriv->pDevPriv; + PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = + (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + void * const psc = sPriv->psc->screenConfigs; + if ( glx_enable_extension == NULL ) { + return GL_FALSE; + } + /* Allocate the private area */ mgaScreen = (mgaScreenPrivate *)MALLOC(sizeof(mgaScreenPrivate)); if (!mgaScreen) { @@ -232,24 +235,11 @@ mgaInitDriver(__DRIscreenPrivate *sPriv) } } - if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) { - PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); - void * const psc = sPriv->psc->screenConfigs; - - if ( glx_enable_extension != NULL ) { - (*glx_enable_extension)( psc, "GLX_MESA_swap_control" ); - (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); - (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" ); - (*glx_enable_extension)( psc, "GLX_SGI_swap_control" ); - (*glx_enable_extension)( psc, "GLX_SGI_video_sync" ); - - if ( driCompareGLXAPIVersion( 20030915 ) >= 0 ) { - (*glx_enable_extension)( psc, "GLX_SGIX_fbconfig" ); - (*glx_enable_extension)( psc, "GLX_OML_swap_method" ); - } - } - } + (*glx_enable_extension)( psc, "GLX_MESA_swap_control" ); + (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); + (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" ); + (*glx_enable_extension)( psc, "GLX_SGI_swap_control" ); + (*glx_enable_extension)( psc, "GLX_SGI_video_sync" ); if (serverInfo->chipset != MGA_CARD_TYPE_G200 && serverInfo->chipset != MGA_CARD_TYPE_G400) { @@ -948,22 +938,6 @@ static const struct __DriverAPIRec mgaAPI = { }; -/* - * This is the bootstrap function for the driver. - * The __driCreateScreen name is the symbol that libGL.so fetches. - * Return: pointer to a __DRIscreenPrivate. - */ -#if !defined(DRI_NEW_INTERFACE_ONLY) -void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config) -{ - __DRIscreenPrivate *psp; - psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &mgaAPI); - return (void *) psp; -} -#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */ - - /** * This is the bootstrap function for the driver. libGL supplies all of the * requisite information about the system, and the driver initializes itself. @@ -974,9 +948,8 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on * failure. */ -#ifdef USE_NEW_INTERFACE PUBLIC -void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -1017,7 +990,6 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc return (void *) psp; } -#endif /* USE_NEW_INTERFACE */ /** diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index bd0585b7734..a5c2a6d1542 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -88,9 +88,7 @@ static const GLuint __driNConfigOptions = 3; #define PCI_CHIP_RAGE128RL 0x524C #endif -#ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -#endif /* USE_NEW_INTERFACE */ /* Create the device specific screen private data struct. */ @@ -99,8 +97,15 @@ r128CreateScreen( __DRIscreenPrivate *sPriv ) { r128ScreenPtr r128Screen; R128DRIPtr r128DRIPriv = (R128DRIPtr)sPriv->pDevPriv; + PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = + (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + void * const psc = sPriv->psc->screenConfigs; + if ( glx_enable_extension == NULL ) { + return NULL; + } + /* Allocate the private area */ r128Screen = (r128ScreenPtr) CALLOC( sizeof(*r128Screen) ); if ( !r128Screen ) return NULL; @@ -211,21 +216,15 @@ r128CreateScreen( __DRIscreenPrivate *sPriv ) } r128Screen->driScreen = sPriv; - if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) { - PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); - void * const psc = sPriv->psc->screenConfigs; - - if ( glx_enable_extension != NULL ) { - if ( r128Screen->irq != 0 ) { - (*glx_enable_extension)( psc, "GLX_SGI_swap_control" ); - (*glx_enable_extension)( psc, "GLX_SGI_video_sync" ); - (*glx_enable_extension)( psc, "GLX_MESA_swap_control" ); - } - - (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); - } + + if ( r128Screen->irq != 0 ) { + (*glx_enable_extension)( psc, "GLX_SGI_swap_control" ); + (*glx_enable_extension)( psc, "GLX_SGI_video_sync" ); + (*glx_enable_extension)( psc, "GLX_MESA_swap_control" ); } + + (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); + return r128Screen; } @@ -392,23 +391,6 @@ static struct __DriverAPIRec r128API = { }; -#ifndef DRI_NEW_INTERFACE_ONLY -/* - * This is the bootstrap function for the driver. - * The __driCreateScreen name is the symbol that libGL.so fetches. - * Return: pointer to a __DRIscreenPrivate. - */ -void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config) -{ - __DRIscreenPrivate *psp; - psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &r128API); - return (void *) psp; -} -#endif /* DRI_NEW_INTERFACE_ONLY */ - - -#ifdef USE_NEW_INTERFACE static __GLcontextModes * r128FillInModes( unsigned pixel_bits, unsigned depth_bits, unsigned stencil_bits, GLboolean have_back_buffer ) @@ -501,7 +483,7 @@ r128FillInModes( unsigned pixel_bits, unsigned depth_bits, * failure. */ PUBLIC -void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -543,4 +525,3 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc return (void *) psp; } -#endif /* USE_NEW_INTERFACE */ diff --git a/src/mesa/drivers/dri/r200/r200_screen.c b/src/mesa/drivers/dri/r200/r200_screen.c index d6024121b50..014818ac1b6 100644 --- a/src/mesa/drivers/dri/r200/r200_screen.c +++ b/src/mesa/drivers/dri/r200/r200_screen.c @@ -136,15 +136,12 @@ static const GLuint __driNConfigOptions = 17; #endif -#ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -#endif /* USE_NEW_INTERFACE */ static r200ScreenPtr __r200Screen; static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ); -#ifdef USE_NEW_INTERFACE static __GLcontextModes * r200FillInModes( unsigned pixel_bits, unsigned depth_bits, unsigned stencil_bits, GLboolean have_back_buffer ) @@ -224,7 +221,6 @@ r200FillInModes( unsigned pixel_bits, unsigned depth_bits, return modes; } -#endif /* USE_NEW_INTERFACE */ /* Create the device specific screen private data struct. @@ -235,8 +231,15 @@ r200CreateScreen( __DRIscreenPrivate *sPriv ) r200ScreenPtr screen; RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv; unsigned char *RADEONMMIO; + PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = + (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + void * const psc = sPriv->psc->screenConfigs; + if ( glx_enable_extension == NULL ) { + return NULL; + } + /* Allocate the private area */ screen = (r200ScreenPtr) CALLOC( sizeof(*screen) ); if ( !screen ) { @@ -460,34 +463,20 @@ r200CreateScreen( __DRIscreenPrivate *sPriv ) screen->driScreen = sPriv; screen->sarea_priv_offset = dri_priv->sarea_priv_offset; - if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) { - PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); - void * const psc = sPriv->psc->screenConfigs; + if ( screen->irq != 0 ) { + (*glx_enable_extension)( psc, "GLX_SGI_swap_control" ); + (*glx_enable_extension)( psc, "GLX_SGI_video_sync" ); + (*glx_enable_extension)( psc, "GLX_MESA_swap_control" ); + } - if ( glx_enable_extension != NULL ) { - if ( screen->irq != 0 ) { - (*glx_enable_extension)( psc, "GLX_SGI_swap_control" ); - (*glx_enable_extension)( psc, "GLX_SGI_video_sync" ); - (*glx_enable_extension)( psc, "GLX_MESA_swap_control" ); - } + (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); - (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); + sPriv->psc->allocateMemory = (void *) r200AllocateMemoryMESA; + sPriv->psc->freeMemory = (void *) r200FreeMemoryMESA; + sPriv->psc->memoryOffset = (void *) r200GetMemoryOffsetMESA; - if ( driCompareGLXAPIVersion( 20030818 ) >= 0 ) { - sPriv->psc->allocateMemory = (void *) r200AllocateMemoryMESA; - sPriv->psc->freeMemory = (void *) r200FreeMemoryMESA; - sPriv->psc->memoryOffset = (void *) r200GetMemoryOffsetMESA; + (*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" ); - (*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" ); - } - - if ( driCompareGLXAPIVersion( 20030915 ) >= 0 ) { - (*glx_enable_extension)( psc, "GLX_SGIX_fbconfig" ); - (*glx_enable_extension)( psc, "GLX_OML_swap_method" ); - } - } - } return screen; } @@ -643,23 +632,6 @@ static const struct __DriverAPIRec r200API = { }; -/* - * This is the bootstrap function for the driver. - * The __driCreateScreen name is the symbol that libGL.so fetches. - * Return: pointer to a __DRIscreenPrivate. - * - */ -#if !defined(DRI_NEW_INTERFACE_ONLY) -void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config) -{ - __DRIscreenPrivate *psp; - psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &r200API); - return (void *) psp; -} -#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */ - - /** * This is the bootstrap function for the driver. libGL supplies all of the * requisite information about the system, and the driver initializes itself. @@ -670,9 +642,8 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on * failure. */ -#ifdef USE_NEW_INTERFACE PUBLIC -void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -713,7 +684,6 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc return (void *) psp; } -#endif /* USE_NEW_INTERFACE */ /** diff --git a/src/mesa/drivers/dri/r300/radeon_screen.c b/src/mesa/drivers/dri/r300/radeon_screen.c index a508c62e834..ea9b9ea2669 100644 --- a/src/mesa/drivers/dri/r300/radeon_screen.c +++ b/src/mesa/drivers/dri/r300/radeon_screen.c @@ -216,15 +216,12 @@ static const struct dri_debug_control debug_control[] = { #define PCI_CHIP_R420_JK 0x4a4b #endif -#ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -#endif /* USE_NEW_INTERFACE */ static radeonScreenPtr __radeonScreen; static int getSwapInfo(__DRIdrawablePrivate * dPriv, __DRIswapInfo * sInfo); -#ifdef USE_NEW_INTERFACE static __GLcontextModes *radeonFillInModes(unsigned pixel_bits, unsigned depth_bits, unsigned stencil_bits, @@ -304,7 +301,7 @@ static __GLcontextModes *radeonFillInModes(unsigned pixel_bits, return modes; } -#endif /* USE_NEW_INTERFACE */ + /* Create the device specific screen private data struct. */ @@ -313,6 +310,15 @@ static radeonScreenPtr radeonCreateScreen(__DRIscreenPrivate * sPriv) radeonScreenPtr screen; RADEONDRIPtr dri_priv = (RADEONDRIPtr) sPriv->pDevPriv; unsigned char *RADEONMMIO; + PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = + (PFNGLXSCRENABLEEXTENSIONPROC) + glXGetProcAddress((const GLubyte *) "__glXScrEnableExtension"); + void *const psc = sPriv->psc->screenConfigs; + + + if (glx_enable_extension == NULL) { + return NULL; + } /* Allocate the private area */ screen = (radeonScreenPtr) CALLOC(sizeof(*screen)); @@ -580,48 +586,22 @@ static radeonScreenPtr radeonCreateScreen(__DRIscreenPrivate * sPriv) screen->driScreen = sPriv; screen->sarea_priv_offset = dri_priv->sarea_priv_offset; - if (driCompareGLXAPIVersion(20030813) >= 0) { - PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) - glXGetProcAddress((const GLubyte *) - "__glXScrEnableExtension"); - void *const psc = sPriv->psc->screenConfigs; - - if (glx_enable_extension != NULL) { - if (screen->irq != 0) { - (*glx_enable_extension) (psc, - "GLX_SGI_swap_control"); - (*glx_enable_extension) (psc, - "GLX_SGI_video_sync"); - (*glx_enable_extension) (psc, - "GLX_MESA_swap_control"); - } + if (screen->irq != 0) { + (*glx_enable_extension) (psc, "GLX_SGI_swap_control"); + (*glx_enable_extension) (psc, "GLX_SGI_video_sync"); + (*glx_enable_extension) (psc, "GLX_MESA_swap_control"); + } - (*glx_enable_extension) (psc, - "GLX_MESA_swap_frame_usage"); + (*glx_enable_extension) (psc, "GLX_MESA_swap_frame_usage"); #if R200_MERGED - if (driCompareGLXAPIVersion(20030818) >= 0) { - sPriv->psc->allocateMemory = - (void *)r200AllocateMemoryMESA; - sPriv->psc->freeMemory = - (void *)r200FreeMemoryMESA; - sPriv->psc->memoryOffset = - (void *)r200GetMemoryOffsetMESA; - - (*glx_enable_extension) (psc, - "GLX_MESA_allocate_memory"); - } + sPriv->psc->allocateMemory = (void *)r200AllocateMemoryMESA; + sPriv->psc->freeMemory = (void *)r200FreeMemoryMESA; + sPriv->psc->memoryOffset = (void *)r200GetMemoryOffsetMESA; + + (*glx_enable_extension) (psc, "GLX_MESA_allocate_memory"); #endif - if (driCompareGLXAPIVersion(20030915) >= 0) { - (*glx_enable_extension) (psc, - "GLX_SGIX_fbconfig"); - (*glx_enable_extension) (psc, - "GLX_OML_swap_method"); - } - } - } return screen; } @@ -799,22 +779,6 @@ static const struct __DriverAPIRec radeonAPI = { .SwapBuffersMSC = NULL }; -/* - * This is the bootstrap function for the driver. - * The __driCreateScreen name is the symbol that libGL.so fetches. - * Return: pointer to a __DRIscreenPrivate. - * - */ -#if !defined(DRI_NEW_INTERFACE_ONLY) -void *__driCreateScreen(Display * dpy, int scrn, __DRIscreen * psc, - int numConfigs, __GLXvisualConfig * config) -{ - __DRIscreenPrivate *psp; - psp = - __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &radeonAPI); - return (void *)psp; -} -#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */ /** * This is the bootstrap function for the driver. libGL supplies all of the @@ -826,8 +790,7 @@ void *__driCreateScreen(Display * dpy, int scrn, __DRIscreen * psc, * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on * failure. */ -#ifdef USE_NEW_INTERFACE -void *__driCreateNewScreen(__DRInativeDisplay * dpy, int scrn, +void *__driCreateNewScreen_20050722(__DRInativeDisplay * dpy, int scrn, __DRIscreen * psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -871,7 +834,7 @@ void *__driCreateNewScreen(__DRInativeDisplay * dpy, int scrn, return (void *)psp; } -#endif /* USE_NEW_INTERFACE */ + /** * Get information about previous buffer swaps. diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index edc92443668..71da86f1d17 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -115,13 +115,10 @@ static const GLuint __driNConfigOptions = 13; #define PCI_CHIP_RS250_4437 0x4437 #endif -#ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -#endif /* USE_NEW_INTERFACE */ static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ); -#ifdef USE_NEW_INTERFACE static __GLcontextModes * radeonFillInModes( unsigned pixel_bits, unsigned depth_bits, unsigned stencil_bits, GLboolean have_back_buffer ) @@ -201,7 +198,7 @@ radeonFillInModes( unsigned pixel_bits, unsigned depth_bits, return modes; } -#endif /* USE_NEW_INTERFACE */ + /* Create the device specific screen private data struct. */ @@ -210,8 +207,15 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv ) radeonScreenPtr screen; RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv; unsigned char *RADEONMMIO; + PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = + (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + void * const psc = sPriv->psc->screenConfigs; + if ( glx_enable_extension == NULL ) { + return NULL; + } + /* Allocate the private area */ screen = (radeonScreenPtr) CALLOC( sizeof(*screen) ); if ( !screen ) { @@ -390,28 +394,14 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv ) dri_priv->log2GARTTexGran; } - if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) { - PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); - void * const psc = sPriv->psc->screenConfigs; - - if ( glx_enable_extension != NULL ) { - if ( screen->irq != 0 ) { - (*glx_enable_extension)( psc, "GLX_SGI_swap_control" ); - (*glx_enable_extension)( psc, "GLX_SGI_video_sync" ); - (*glx_enable_extension)( psc, "GLX_MESA_swap_control" ); - } - - (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); - - if ( driCompareGLXAPIVersion( 20030915 ) >= 0 ) { - (*glx_enable_extension)( psc, "GLX_SGIX_fbconfig" ); - (*glx_enable_extension)( psc, "GLX_OML_swap_method" ); - } - - } + if ( screen->irq != 0 ) { + (*glx_enable_extension)( psc, "GLX_SGI_swap_control" ); + (*glx_enable_extension)( psc, "GLX_SGI_video_sync" ); + (*glx_enable_extension)( psc, "GLX_MESA_swap_control" ); } + (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); + screen->driScreen = sPriv; screen->sarea_priv_offset = dri_priv->sarea_priv_offset; return screen; @@ -566,21 +556,6 @@ static struct __DriverAPIRec radeonAPI = { }; -/* - * This is the bootstrap function for the driver. - * The __driCreateScreen name is the symbol that libGL.so fetches. - * Return: pointer to a __DRIscreenPrivate. - */ -#if !defined(DRI_NEW_INTERFACE_ONLY) -void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config) -{ - __DRIscreenPrivate *psp; - psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &radeonAPI); - return (void *) psp; -} -#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */ - /** * This is the bootstrap function for the driver. libGL supplies all of the * requisite information about the system, and the driver initializes itself. @@ -591,9 +566,8 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on * failure. */ -#ifdef USE_NEW_INTERFACE PUBLIC -void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -634,7 +608,7 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc return (void *) psp; } -#endif /* USE_NEW_INTERFACE */ + /** * Get information about previous buffer swaps. diff --git a/src/mesa/drivers/dri/s3v/s3v_xmesa.c b/src/mesa/drivers/dri/s3v/s3v_xmesa.c index 61d4cbccbd9..4cdda1b5871 100644 --- a/src/mesa/drivers/dri/s3v/s3v_xmesa.c +++ b/src/mesa/drivers/dri/s3v/s3v_xmesa.c @@ -360,8 +360,3 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, return (void *) psp; } #endif - -void __driRegisterExtensions(void) -{ - /* No extensions */ -} diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index fd076affd63..355419a84a0 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -105,9 +105,7 @@ DRI_CONF_BEGIN DRI_CONF_END; static const GLuint __driNConfigOptions = 10; -#ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -#endif /* USE_NEW_INTERFACE */ static const struct dri_debug_control debug_control[] = { @@ -905,25 +903,6 @@ static const struct __DriverAPIRec savageAPI = { }; - -#ifndef DRI_NEW_INTERFACE_ONLY -/* - * This is the (old) bootstrap function for the driver. - * The __driCreateScreen name is the symbol that libGL.so fetches. - * Return: pointer to a __DRIscreenPrivate. - */ -void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config) -{ - __DRIscreenPrivate *psp; - psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &savageAPI); - return (void *) psp; -} -#endif /* DRI_NEW_INTERFACE_ONLY */ - - - -#ifdef USE_NEW_INTERFACE static __GLcontextModes * savageFillInModes( unsigned pixel_bits, unsigned depth_bits, unsigned stencil_bits, GLboolean have_back_buffer ) @@ -1019,7 +998,7 @@ savageFillInModes( unsigned pixel_bits, unsigned depth_bits, * failure. */ PUBLIC -void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -1060,4 +1039,3 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc return (void *) psp; } -#endif /* USE_NEW_INTERFACE */ diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c index e6c398f4e28..56585d3cdd2 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.c +++ b/src/mesa/drivers/dri/sis/sis_screen.c @@ -59,11 +59,8 @@ DRI_CONF_BEGIN DRI_CONF_END; static const GLuint __driNConfigOptions = 2; -#ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -#endif /* USE_NEW_INTERFACE */ -#ifdef USE_NEW_INTERFACE static __GLcontextModes * sisFillInModes(int bpp) { @@ -123,7 +120,7 @@ sisFillInModes(int bpp) return modes; } -#endif /* USE_NEW_INTERFACE */ + /* Create the device specific screen private data struct. */ @@ -133,11 +130,6 @@ sisCreateScreen( __DRIscreenPrivate *sPriv ) sisScreenPtr sisScreen; SISDRIPtr sisDRIPriv = (SISDRIPtr)sPriv->pDevPriv; -#ifndef USE_NEW_INTERFACE - /* XXX Should this still be around for the old interface? */ - if ( !driCheckDriDdxDrmVersions( sPriv, "SiS", 4, 0, 0, 1, 1, 0 ) ) - return NULL; -#endif /* Allocate the private area */ sisScreen = (sisScreenPtr)CALLOC( sizeof(*sisScreen) ); @@ -410,20 +402,6 @@ static struct __DriverAPIRec sisAPI = { }; -/* - * This is the bootstrap function for the driver. - * The __driCreateScreen name is the symbol that libGL.so fetches. - * Return: pointer to a __DRIscreenPrivate. - */ -#if !defined(DRI_NEW_INTERFACE_ONLY) -void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config) -{ - __DRIscreenPrivate *psp; - psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &sisAPI); - return (void *)psp; -} -#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */ /** * This is the bootstrap function for the driver. libGL supplies all of the @@ -435,9 +413,8 @@ void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on * failure. */ -#ifdef USE_NEW_INTERFACE PUBLIC -void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, +void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes *modes, const __DRIversion *ddx_version, @@ -475,4 +452,3 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, return (void *)psp; } -#endif /* USE_NEW_INTERFACE */ diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index f0efc278cb3..56fe39e7017 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -346,11 +346,6 @@ static const struct __DriverAPIRec tdfxAPI = { .SwapBuffersMSC = NULL }; -#ifdef USE_NEW_INTERFACE -/* - * new interface code, derived from radeon_screen.c - * XXX this may still be wrong - */ static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits, @@ -432,7 +427,7 @@ static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits, * failure. */ PUBLIC -void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -477,20 +472,3 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc return (void *)psp; } -#endif /* USE_NEW_INTERFACE */ - - -/* - * This is the bootstrap function for the driver. - * The __driCreateScreen name is the symbol that libGL.so fetches. - * Return: pointer to a __DRIscreenPrivate. - */ -#if !defined(DRI_NEW_INTERFACE_ONLY) -void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config) -{ - __DRIscreenPrivate *psp; - psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &tdfxAPI); - return (void *) psp; -} -#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */ diff --git a/src/mesa/drivers/dri/trident/trident_context.c b/src/mesa/drivers/dri/trident/trident_context.c index 744f384c623..9f3fb26342c 100644 --- a/src/mesa/drivers/dri/trident/trident_context.c +++ b/src/mesa/drivers/dri/trident/trident_context.c @@ -453,13 +453,9 @@ static struct __DriverAPIRec tridentAPI = { tridentUnbindContext, }; -#ifndef USE_NEW_INTERFACE -#error trident_dri.so is new-interface only. -#else - static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -PUBLIC void *__driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, +PUBLIC void *__driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, @@ -491,10 +487,3 @@ PUBLIC void *__driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, } return (void *) psp; } - -#endif - -void __driRegisterExtensions(void) -{ - /* No extensions */ -} diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index 914931593fa..4115434cf29 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -62,9 +62,7 @@ DRI_CONF_END; static const GLuint __driNConfigOptions = 3; -#ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -#endif /* USE_NEW_INTERFACE */ static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ); @@ -100,6 +98,15 @@ viaInitDriver(__DRIscreenPrivate *sPriv) { viaScreenPrivate *viaScreen; VIADRIPtr gDRIPriv = (VIADRIPtr)sPriv->pDevPriv; + PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = + (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( + (const GLubyte *) "__glXScrEnableExtension" ); + void * const psc = sPriv->psc->screenConfigs; + + + if ( glx_enable_extension == NULL ) { + return GL_FALSE; + } /* Allocate the private area */ @@ -170,30 +177,13 @@ viaInitDriver(__DRIscreenPrivate *sPriv) viaScreen->sareaPrivOffset = gDRIPriv->sarea_priv_offset; + if ( viaScreen->irqEnabled ) { + (*glx_enable_extension)( psc, "GLX_SGI_swap_control" ); + (*glx_enable_extension)( psc, "GLX_SGI_video_sync" ); + (*glx_enable_extension)( psc, "GLX_MESA_swap_control" ); + } - - if ( driCompareGLXAPIVersion( 20030813 ) >= 0 ) { - PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( - (const GLubyte *) "__glXScrEnableExtension" ); - void * const psc = sPriv->psc->screenConfigs; - - if ( glx_enable_extension != NULL ) { - if ( viaScreen->irqEnabled ) { - (*glx_enable_extension)( psc, "GLX_SGI_swap_control" ); - (*glx_enable_extension)( psc, "GLX_SGI_video_sync" ); - (*glx_enable_extension)( psc, "GLX_MESA_swap_control" ); - } - - (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); - - if ( driCompareGLXAPIVersion( 20030915 ) >= 0 ) { - (*glx_enable_extension)( psc, "GLX_SGIX_fbconfig" ); - (*glx_enable_extension)( psc, "GLX_OML_swap_method" ); - } - - } - } + (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); return GL_TRUE; } @@ -340,23 +330,6 @@ static struct __DriverAPIRec viaAPI = { }; -/* - * This is the bootstrap function for the driver. - * The __driCreateScreen name is the symbol that libGL.so fetches. - * Return: pointer to a __DRIscreenPrivate. - */ -#if !defined(DRI_NEW_INTERFACE_ONLY) -void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config) -{ - __DRIscreenPrivate *psp; - psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &viaAPI); - return (void *)psp; -} -#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */ - - -#ifdef USE_NEW_INTERFACE static __GLcontextModes * viaFillInModes( unsigned pixel_bits, GLboolean have_back_buffer ) { @@ -419,7 +392,6 @@ viaFillInModes( unsigned pixel_bits, GLboolean have_back_buffer ) return modes; } -#endif /* USE_NEW_INTERFACE */ /** @@ -432,9 +404,8 @@ viaFillInModes( unsigned pixel_bits, GLboolean have_back_buffer ) * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on * failure. */ -#ifdef USE_NEW_INTERFACE PUBLIC -void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, +void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, @@ -475,7 +446,6 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, fprintf(stderr, "%s - succeeded\n", __FUNCTION__); return (void *) psp; } -#endif /* USE_NEW_INTERFACE */ /** diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c index 79048a9f995..0ff7fd51a6d 100644 --- a/src/mesa/x86/common_x86.c +++ b/src/mesa/x86/common_x86.c @@ -102,7 +102,7 @@ extern void _mesa_test_os_sse_support( void ); extern void _mesa_test_os_sse_exception_support( void ); #if defined(__linux__) && defined(_POSIX_SOURCE) && defined(X86_FXSR_MAGIC) \ - && !defined(DRI_NEW_INTERFACE_ONLY) + && !defined(IN_DRI_DRIVER) static void sigill_handler( int signal, struct sigcontext sc ) { message( "SIGILL, " ); @@ -183,7 +183,7 @@ static LONG WINAPI ExceptionFilter(LPEXCEPTION_POINTERS exp) */ static void check_os_sse_support( void ) { -#if defined(__linux__) && !defined(DRI_NEW_INTERFACE_ONLY) +#if defined(__linux__) && !defined(IN_DRI_DRIVER) #if defined(_POSIX_SOURCE) && defined(X86_FXSR_MAGIC) struct sigaction saved_sigill; struct sigaction saved_sigfpe; -- cgit v1.2.3 From e9dbe58b8b541d0abb9be9e1000a63776abe678c Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Sun, 24 Jul 2005 07:38:23 +0000 Subject: Gut a few more dead bits. Replace uses of the CreateNewScreenFunc typedef (from glxclient.h) with PFNCREATENEWSCREEN (from dri_interface.h). Remove the prototype for __driCreateScreen and fix the prototype for __driCreateNewScreen (append the API version) in dri_interface.h. --- include/GL/internal/dri_interface.h | 9 +-------- src/glx/x11/dri_glx.c | 5 +++-- src/glx/x11/glxclient.h | 13 ++----------- src/glx/x11/glxext.c | 2 +- 4 files changed, 7 insertions(+), 22 deletions(-) (limited to 'include') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 3a704f6a72e..e5c5a7759d1 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -175,14 +175,7 @@ typedef void *(CREATENEWSCREENFUNC)(__DRInativeDisplay *dpy, int scrn, void * pSAREA, int fd, int internal_api_version, __GLcontextModes ** driver_modes); typedef CREATENEWSCREENFUNC* PFNCREATENEWSCREENFUNC; -extern CREATENEWSCREENFUNC __driCreateNewScreen; - -#ifndef DRI_NEW_INTERFACE_ONLY - -extern void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config); - -#endif /* DRI_NEW_INTERFACE_ONLY */ +extern CREATENEWSCREENFUNC __driCreateNewScreen_20050722; /** diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c index a4a389ce5d8..8cc0b62b023 100644 --- a/src/glx/x11/dri_glx.c +++ b/src/glx/x11/dri_glx.c @@ -237,7 +237,7 @@ static __DRIdriver *OpenDriver(const char *driverName) return NULL; /* out of memory! */ } - driver->createNewScreenFunc = (CreateNewScreenFunc) + driver->createNewScreenFunc = (PFNCREATENEWSCREENFUNC) dlsym(handle, createNewScreenName); if ( driver->createNewScreenFunc == NULL ) { @@ -424,7 +424,8 @@ void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp) pdisp->destroyDisplay = driDestroyDisplay; /* allocate array of pointers to createNewScreen funcs */ - pdisp->createNewScreen = (CreateNewScreenFunc *) Xmalloc(numScreens * sizeof(void *)); + pdisp->createNewScreen = (PFNCREATENEWSCREENFUNC *) + Xmalloc(numScreens * sizeof(void *)); if (!pdisp->createNewScreen) { Xfree(pdpyp); return NULL; diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index b8241b8cf23..6852fd066aa 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -84,15 +84,6 @@ typedef struct _glapi_table __GLapi; #include -typedef void *(*CreateScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config); - -typedef void *(*CreateNewScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc, - const __GLcontextModes * modes, const __DRIversion * ddx_version, - const __DRIversion * dri_version, const __DRIversion * drm_version, - const __DRIframebuffer * frame_buffer, void * pSAREA, - int fd, int internal_api_version, __GLcontextModes ** driver_modes); - /** * Display dependent methods. This structure is initialized during the @@ -114,7 +105,7 @@ struct __DRIdisplayRec { * Array of pointers to methods to create and initialize the private DRI * screen data. */ - CreateNewScreenFunc * createNewScreen; + PFNCREATENEWSCREENFUNC * createNewScreen; }; @@ -124,7 +115,7 @@ struct __DRIdisplayRec { struct __DRIdriverRec { const char *name; void *handle; - CreateNewScreenFunc createNewScreenFunc; + PFNCREATENEWSCREENFUNC createNewScreenFunc; struct __DRIdriverRec *next; }; diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c index be6b84b262d..1754efa0c26 100644 --- a/src/glx/x11/glxext.c +++ b/src/glx/x11/glxext.c @@ -688,7 +688,7 @@ filter_modes( __GLcontextModes ** server_modes, static void * CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc, __DRIdisplay * driDpy, - CreateNewScreenFunc createNewScreen) + PFNCREATENEWSCREENFUNC createNewScreen) { __DRIscreenPrivate *psp = NULL; #ifndef GLX_USE_APPLEGL -- cgit v1.2.3 From 5f1ba3e21b62cee1a4f900a2e6964728f3eeea9b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 26 Jul 2005 02:44:01 +0000 Subject: Fixes the glXGetProcAddress portion of the interface. Most of the functions that are currently obtained via glXGetProcAddress and all of the XF86DRI functions are replaced with a funciton table. This table will be passed to __driCreateNewScreen. One of the functions in the table is getProcAddress. This allows some loaders to expose functionality not in all loaders. This will be immediatly used for glxEnableExtension (formerly known to drivers as __glXScrEnableExtension). libGL (and in the future libglx) expose this function so that drivers can enable GLX extensions. libEGL should exposed eglEnableExtension to enable EGL extensions. The same function cannot be used for both because the extensions have different names and (possibly) different semantics. Drivers can optionally use one, both, or neither. The key parts are in the __DRIinterfaceMethodsRec structure in dri_interface.h. A pointer to one of these structures is passed into __driCreateNewScreen. Because of this, the version of the API is bumped to 20050725. Since the previous version(s) were never in a release, their existance is erased. I was actually a little surprised by how much code this cuts from the drivers. A lot of glXGetProcAddress calls disappear, and a lot of version checks go with them. Nice. The one thing I'm not sure of is removing __glXInitialize. For some reason that function was in the glXGetProcAddress table, but *nothing* in the Mesa tree used it. Did something with DRI conf. use this function? It seems odd... --- include/GL/internal/dri_interface.h | 160 +++++++++++++++++-------- src/glx/x11/dri_glx.c | 2 +- src/glx/x11/glxclient.h | 2 + src/glx/x11/glxcmds.c | 33 +---- src/glx/x11/glxext.c | 37 ++++++ src/mesa/drivers/dri/common/dri_util.c | 93 ++++---------- src/mesa/drivers/dri/common/dri_util.h | 20 ++-- src/mesa/drivers/dri/fb/fb_dri.c | 16 +-- src/mesa/drivers/dri/ffb/ffb_xmesa.c | 15 +-- src/mesa/drivers/dri/i810/i810screen.c | 19 ++- src/mesa/drivers/dri/i830/i830_screen.c | 24 ++-- src/mesa/drivers/dri/i915/intel_screen.c | 25 ++-- src/mesa/drivers/dri/mach64/mach64_screen.c | 24 ++-- src/mesa/drivers/dri/mga/mga_xmesa.c | 40 ++----- src/mesa/drivers/dri/mga/mgacontext.h | 2 - src/mesa/drivers/dri/mga/mgaioctl.c | 4 +- src/mesa/drivers/dri/r128/r128_screen.c | 24 ++-- src/mesa/drivers/dri/r200/r200_context.c | 14 +-- src/mesa/drivers/dri/r200/r200_context.h | 1 - src/mesa/drivers/dri/r200/r200_ioctl.c | 6 +- src/mesa/drivers/dri/r200/r200_screen.c | 24 ++-- src/mesa/drivers/dri/r300/radeon_context.c | 14 +-- src/mesa/drivers/dri/r300/radeon_context.h | 1 - src/mesa/drivers/dri/r300/radeon_ioctl.c | 6 +- src/mesa/drivers/dri/r300/radeon_screen.c | 32 +++-- src/mesa/drivers/dri/radeon/radeon_context.c | 14 +-- src/mesa/drivers/dri/radeon/radeon_context.h | 1 - src/mesa/drivers/dri/radeon/radeon_ioctl.c | 6 +- src/mesa/drivers/dri/radeon/radeon_screen.c | 24 ++-- src/mesa/drivers/dri/savage/savage_xmesa.c | 22 ++-- src/mesa/drivers/dri/sis/sis_screen.c | 16 ++- src/mesa/drivers/dri/tdfx/tdfx_screen.c | 13 +- src/mesa/drivers/dri/trident/trident_context.c | 55 +++------ src/mesa/drivers/dri/unichrome/via_context.c | 15 +-- src/mesa/drivers/dri/unichrome/via_context.h | 1 - src/mesa/drivers/dri/unichrome/via_ioctl.c | 6 +- src/mesa/drivers/dri/unichrome/via_screen.c | 22 ++-- 37 files changed, 365 insertions(+), 468 deletions(-) (limited to 'include') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index e5c5a7759d1..1b1aeba55f9 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -62,6 +62,7 @@ typedef struct __DRIdrawableRec __DRIdrawable; typedef struct __DRIdriverRec __DRIdriver; typedef struct __DRIframebufferRec __DRIframebuffer; typedef struct __DRIversionRec __DRIversion; +typedef struct __DRIinterfaceMethodsRec __DRIinterfaceMethods; typedef unsigned long __DRIid; typedef void __DRInativeDisplay; /*@}*/ @@ -74,38 +75,6 @@ typedef void __DRInativeDisplay; extern __DRIscreen *__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn); -/** - * Type of a pointer to \c __glXGetInternalVersion, as returned by - * \c glXGetProcAddress. - * - * \sa __glXGetInternalVersion, glXGetProcAddress - */ -typedef int (* PFNGLXGETINTERNALVERSIONPROC) ( void ); - -/** - * Type of a pointer to \c __glXWindowExists, as returned by - * \c glXGetProcAddress. - * - * \sa __glXWindowExists, glXGetProcAddress - */ -typedef GLboolean (* PFNGLXWINDOWEXISTSPROC) (__DRInativeDisplay *dpy, __DRIid draw); - -/** - * Type of a pointer to \c __glXGetUST, as returned by \c glXGetProcAddress. - * - * \sa __glXGetUST, glXGetProcAddress - */ -typedef int (* PFNGLXGETUSTPROC) ( int64_t * ust ); - -/** - * Type of pointer to \c __glXCreateContextModes, as returned by - * \c glXGetProcAddress. - * - * \sa _gl_context_modes_create, glXGetProcAddress - */ - -typedef __GLcontextModes * (* PFNGLXCREATECONTEXTMODES) ( unsigned count, - size_t minimum_bytes_per_struct ); /** * Type of a pointer to \c glXGetScreenDriver, as returned by @@ -135,19 +104,6 @@ typedef const char * (* PFNGLXGETDRIVERCONFIGPROC) (const char *driverName); */ typedef void (* PFNGLXSCRENABLEEXTENSIONPROC) ( void *psc, const char * name ); -/** - * Type of a pointer to \c __glXGetDrawableInfo, as returned by - * \c glXGetProcAddress. This function is used to get information about the - * position, size, and clip rects of a drawable. - * - * \sa __glXGetDrawableInfo, glXGetProcAddress - */ -typedef GLboolean (* PFNGLXGETDRAWABLEINFOPROC) ( __DRInativeDisplay *dpy, int scrn, - __DRIid draw, unsigned int * index, unsigned int * stamp, - int * x, int * y, int * width, int * height, - int * numClipRects, drm_clip_rect_t ** pClipRects, - int * backX, int * backY, - int * numBackClipRects, drm_clip_rect_t ** pBackClipRects ); /* Test for the xf86dri.h header file */ #ifndef _XF86DRI_H_ @@ -173,9 +129,10 @@ typedef void *(CREATENEWSCREENFUNC)(__DRInativeDisplay *dpy, int scrn, const __DRIversion * ddx_version, const __DRIversion * dri_version, const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer, void * pSAREA, int fd, int internal_api_version, + const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes); typedef CREATENEWSCREENFUNC* PFNCREATENEWSCREENFUNC; -extern CREATENEWSCREENFUNC __driCreateNewScreen_20050722; +extern CREATENEWSCREENFUNC __driCreateNewScreen_20050725; /** @@ -202,6 +159,113 @@ struct __DRIversionRec { int patch; /**< Patch-level. */ }; + +typedef void (*__DRIfuncPtr)(void); + +struct __DRIinterfaceMethodsRec { + /** + * Get pointer to named function. + */ + __DRIfuncPtr (*getProcAddress)( const char * proc_name ); + + /** + * Create a list of \c __GLcontextModes structures. + */ + __GLcontextModes * (*createContextModes)(unsigned count, + size_t minimum_bytes_per_struct); + + /** + * Destroy a list of \c __GLcontextModes structures. + * + * \todo + * Determine if the drivers actually need to call this. + */ + void (*destroyContextModes)( __GLcontextModes * modes ); + + /** + * Get the \c __DRIscreen for a given display and screen number. + */ + __DRIscreen *(*getScreen)(__DRInativeDisplay *dpy, int screenNum); + + + /** + * \name Client/server protocol functions. + * + * These functions implement the DRI client/server protocol for + * context and drawable operations. Platforms that do not implement + * the wire protocol (e.g., EGL) will implement glorified no-op functions. + */ + /*@{*/ + /** + * Determine if the specified window ID still exists. + * + * \note + * Implementations may assume that the driver will only pass an ID into + * this function that actually corresponds to a window. On + * implementations where windows can only be destroyed by the DRI driver + * (e.g., EGL), this function is allowed to always return \c GL_TRUE. + */ + GLboolean (*windowExists)(__DRInativeDisplay *dpy, __DRIid draw); + + /** + * Create the server-side portion of the GL context. + */ + GLboolean (* createContext)( __DRInativeDisplay *dpy, int screenNum, + int configID, void * contextID, drm_context_t * hw_context ); + + /** + * Destroy the server-side portion of the GL context. + */ + GLboolean (* destroyContext)( __DRInativeDisplay *dpy, int screenNum, + __DRIid context ); + + /** + * Create the server-side portion of the drawable. + */ + GLboolean (*createDrawable)( __DRInativeDisplay * ndpy, int screen, + __DRIid drawable, drm_drawable_t * hHWDrawable ); + + /** + * Destroy the server-side portion of the drawable. + */ + GLboolean (*destroyDrawable)( __DRInativeDisplay * ndpy, int screen, + __DRIid drawable ); + + /** + * This function is used to get information about the position, size, and + * clip rects of a drawable. + */ + GLboolean (* getDrawableInfo) ( __DRInativeDisplay *dpy, int scrn, + __DRIid draw, unsigned int * index, unsigned int * stamp, + int * x, int * y, int * width, int * height, + int * numClipRects, drm_clip_rect_t ** pClipRects, + int * backX, int * backY, + int * numBackClipRects, drm_clip_rect_t ** pBackClipRects ); + /*@}*/ + + + /** + * \name Timing related functions. + */ + /*@{*/ + /** + * Get the 64-bit unadjusted system time (UST). + */ + int (*getUST)(int64_t * ust); + + /** + * Get the media stream counter (MSC) rate. + * + * Matching the definition in GLX_OML_sync_control, this function returns + * the rate of the "media stream counter". In practical terms, this is + * the frame refresh rate of the display. + */ + GLboolean (*getMSCRate)(__DRInativeDisplay * dpy, __DRIid drawable, + int32_t * numerator, int32_t * denominator); + /*@}*/ +}; + + /** * Framebuffer information record. Used by libGL to communicate information * about the framebuffer to the driver's \c __driCreateNewScreen function. @@ -332,7 +396,7 @@ struct __DRIcontextRec { /** * Method to bind a DRI drawable to a DRI graphics context. * - * \since Internal API version 20050722. + * \since Internal API version 20050725. */ GLboolean (*bindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw, __DRIid read, __DRIcontext *ctx); @@ -340,7 +404,7 @@ struct __DRIcontextRec { /** * Method to unbind a DRI drawable from a DRI graphics context. * - * \since Internal API version 20050722. + * \since Internal API version 20050725. */ GLboolean (*unbindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw, __DRIid read, __DRIcontext *ctx); diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c index 8cc0b62b023..91ca875ff16 100644 --- a/src/glx/x11/dri_glx.c +++ b/src/glx/x11/dri_glx.c @@ -166,7 +166,7 @@ ExtractDir(int index, const char *paths, int dirLen, char *dir) * \todo * Create a macro or something so that this is automatically updated. */ -static const char createNewScreenName[] = "__driCreateNewScreen_20050722"; +static const char createNewScreenName[] = "__driCreateNewScreen_20050725"; /** diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h index 6852fd066aa..166673847c4 100644 --- a/src/glx/x11/glxclient.h +++ b/src/glx/x11/glxclient.h @@ -137,6 +137,8 @@ extern const char *glXGetScreenDriver (Display *dpy, int scrNum); extern const char *glXGetDriverConfig (const char *driverName); +extern Bool __glXWindowExists(Display *dpy, GLXDrawable draw); + #endif /************************************************************************/ diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index 5a16fb964d3..77f80e3f987 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -49,6 +49,7 @@ #ifdef GLX_DIRECT_RENDERING #include "indirect_init.h" #include "xf86vmode.h" +#include "xf86dri.h" #endif #include "glxextensions.h" #include "glcontextmodes.h" @@ -63,13 +64,6 @@ static const char __glXGLXClientVendorName[] = "SGI"; static const char __glXGLXClientVersion[] = "1.4"; -#if defined(GLX_DIRECT_RENDERING) -#include "xf86dri.h" - -static Bool __glXWindowExists(Display *dpy, GLXDrawable draw); -#endif - - /****************************************************************************/ /** * Get the __DRIdrawable for the drawable associated with a GLXContext @@ -2814,28 +2808,9 @@ static const struct name_address_pair GLX_functions[] = { GLX_FUNCTION( glXGetSyncValuesOML ), #ifdef GLX_DIRECT_RENDERING - /*** - *** Internal functions useful to DRI drivers - *** With this, the DRI drivers shouldn't need dlopen()/dlsym() to - *** access internal libGL functions which may or may not exist. - ***/ - GLX_FUNCTION( __glXInitialize ), - GLX_FUNCTION( __glXFindDRIScreen ), - GLX_FUNCTION( __glXGetInternalVersion ), - GLX_FUNCTION( __glXWindowExists ), - GLX_FUNCTION2( __glXCreateContextWithConfig, XF86DRICreateContextWithConfig ), - GLX_FUNCTION2( __glXGetDrawableInfo, XF86DRIGetDrawableInfo ), - /*** DRI configuration ***/ GLX_FUNCTION( glXGetScreenDriver ), GLX_FUNCTION( glXGetDriverConfig ), - - GLX_FUNCTION( __glXScrEnableExtension ), - - GLX_FUNCTION( __glXGetUST ), - - GLX_FUNCTION2( __glXCreateContextModes, _gl_context_modes_create ), - GLX_FUNCTION2( __glXDestroyContextModes, _gl_context_modes_destroy ), #endif { NULL, NULL } /* end of list */ @@ -2949,10 +2924,10 @@ int __glXGetInternalVersion(void) * 20040415 - Added support for bindContext3 and unbindContext3. * 20040602 - Add __glXGetDrawableInfo. I though that was there * months ago. :( - * 20050722 - Gut all the old interfaces. This breaks compatability with + * 20050725 - Gut all the old interfaces. This breaks compatability with * any DRI driver built to any previous version. */ - return 20050722; + return 20050725; } @@ -2986,7 +2961,7 @@ static int windowExistsErrorHandler(Display *dpy, XErrorEvent *xerr) * * \since Internal API version 20021128. */ -static Bool __glXWindowExists(Display *dpy, GLXDrawable draw) +Bool __glXWindowExists(Display *dpy, GLXDrawable draw) { XWindowAttributes xwa; int (*oldXErrorHandler)(Display *, XErrorEvent *); diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c index 1754efa0c26..66567b83138 100644 --- a/src/glx/x11/glxext.c +++ b/src/glx/x11/glxext.c @@ -667,6 +667,42 @@ filter_modes( __GLcontextModes ** server_modes, } +/** + * Implement \c __DRIinterfaceMethods::getProcAddress. + */ +static __DRIfuncPtr get_proc_address( const char * proc_name ) +{ + if (strcmp( proc_name, "glxEnableExtension" ) == 0) { + return (__DRIfuncPtr) __glXScrEnableExtension; + } + + return NULL; +} + + +/** + * Table of functions exported by the loader to the driver. + */ +static const __DRIinterfaceMethods interface_methods = { + get_proc_address, + + _gl_context_modes_create, + _gl_context_modes_destroy, + + __glXFindDRIScreen, + __glXWindowExists, + + XF86DRICreateContextWithConfig, + XF86DRIDestroyContext, + + XF86DRICreateDrawable, + XF86DRIDestroyDrawable, + XF86DRIGetDrawableInfo, + + __glXGetUST, + glXGetMscRateOML, +}; + /** * Perform the required libGL-side initialization and call the client-side @@ -819,6 +855,7 @@ CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc, pSAREA, fd, api_ver, + & interface_methods, & driver_modes ); filter_modes( & configs->configs, diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 1483dc0445c..c201d44c6c6 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -37,6 +37,10 @@ typedef GLboolean ( * PFNGLXGETMSCRATEOMLPROC) (__DRInativeDisplay *dpy, __DRIid drawable, int32_t *numerator, int32_t *denominator); #endif +/* This pointer *must* be set by the driver's __driCreateNewScreen funciton! + */ +const __DRIinterfaceMethods * dri_interface = NULL; + /** * Weak thread-safety dispatch pointer. Older versions of libGL will not have * this symbol, so a "weak" version is included here so that the driver will @@ -50,19 +54,6 @@ struct _glapi_table *_glapi_DispatchTSD __attribute__((weak)) = NULL; */ static const int empty_attribute_list[1] = { None }; -/** - * Function used to determine if a drawable (window) still exists. Ideally - * this function comes from libGL. With older versions of libGL from XFree86 - * we can fall-back to an internal version. - * - * \sa __driWindowExists __glXWindowExists - */ -static PFNGLXWINDOWEXISTSPROC window_exists; - -typedef GLboolean (*PFNGLXCREATECONTEXTWITHCONFIGPROC)( __DRInativeDisplay*, int, int, void *, - drm_context_t * ); - -static PFNGLXCREATECONTEXTWITHCONFIGPROC create_context_with_config; /** * Cached copy of the internal API version used by libGL and the client-side @@ -103,9 +94,6 @@ __driUtilMessage(const char *f, ...) } } -typedef __DRIscreen *(*PFNGLXFINDDRISCREEN)(__DRInativeDisplay *, int); -static PFNGLXFINDDRISCREEN glx_find_dri_screen = NULL; - /*****************************************************************/ /** \name Drawable list management */ @@ -151,7 +139,7 @@ static void __driGarbageCollectDrawables(void *drawHash) do { __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)pdraw->private; dpy = pdp->driScreenPriv->display; - if (! (*window_exists)(dpy, draw)) { + if (! (*dri_interface->windowExists)(dpy, draw)) { /* Destroy the local drawable data in the hash table, if the drawable no longer exists in the Xserver */ drmHashDelete(drawHash, draw); @@ -211,7 +199,7 @@ static GLboolean driUnbindContext(__DRInativeDisplay *dpy, int scrn, return GL_FALSE; } - pDRIScreen = (*glx_find_dri_screen)(dpy, scrn); + pDRIScreen = (*dri_interface->getScreen)(dpy, scrn); if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { /* ERROR!!! */ return GL_FALSE; @@ -387,7 +375,7 @@ static GLboolean driBindContext(__DRInativeDisplay *dpy, int scrn, return GL_FALSE; } - pDRIScreen = (*glx_find_dri_screen)(dpy, scrn); + pDRIScreen = (*dri_interface->getScreen)(dpy, scrn); if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { /* ERROR!!! */ return GL_FALSE; @@ -410,8 +398,8 @@ static GLboolean driBindContext(__DRInativeDisplay *dpy, int scrn, * \param pdp pointer to the private drawable information to update. * * This function basically updates the __DRIdrawablePrivate struct's - * cliprect information by calling \c __DRIDrawablePrivate::getInfo. This is - * usually called by the DRI_VALIDATE_DRAWABLE_INFO macro which + * cliprect information by calling \c __DRIinterfaceMethods::getDrawableInfo. + * This is usually called by the DRI_VALIDATE_DRAWABLE_INFO macro which * compares the __DRIdrwablePrivate pStamp and lastStamp values. If * the values are different that means we have to update the clipping * info. @@ -444,7 +432,7 @@ __driUtilUpdateDrawableInfo(__DRIdrawablePrivate *pdp) DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); if (!__driFindDrawable(psp->drawHash, pdp->draw) || - ! (*pdp->getInfo)(pdp->display, pdp->screen, pdp->draw, + ! (*dri_interface->getDrawableInfo)(pdp->display, pdp->screen, pdp->draw, &pdp->index, &pdp->lastStamp, &pdp->x, &pdp->y, &pdp->w, &pdp->h, &pdp->numClipRects, &pdp->pClipRects, @@ -578,7 +566,7 @@ static void *driCreateNewDrawable(__DRInativeDisplay *dpy, int renderType, const int *attrs) { - __DRIscreen * const pDRIScreen = (*glx_find_dri_screen)(dpy, modes->screen); + __DRIscreen * const pDRIScreen = (*dri_interface->getScreen)(dpy, modes->screen); __DRIscreenPrivate *psp; __DRIdrawablePrivate *pdp; @@ -599,7 +587,7 @@ static void *driCreateNewDrawable(__DRInativeDisplay *dpy, return NULL; } - if (!XF86DRICreateDrawable(dpy, modes->screen, draw, &pdp->hHWDrawable)) { + if (!(*dri_interface->createDrawable)(dpy, modes->screen, draw, &pdp->hHWDrawable)) { _mesa_free(pdp); return NULL; } @@ -625,17 +613,9 @@ static void *driCreateNewDrawable(__DRInativeDisplay *dpy, pdp->driScreenPriv = psp; pdp->driContextPriv = &psp->dummyContextPriv; - pdp->getInfo = (PFNGLXGETDRAWABLEINFOPROC) - glXGetProcAddress( (const GLubyte *) "__glXGetDrawableInfo" ); - if ( pdp->getInfo == NULL ) { - (void)XF86DRIDestroyDrawable(dpy, modes->screen, pdp->draw); - _mesa_free(pdp); - return NULL; - } - if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, modes, renderType == GLX_PIXMAP_BIT)) { - (void)XF86DRIDestroyDrawable(dpy, modes->screen, pdp->draw); + (void)(*dri_interface->destroyDrawable)(dpy, modes->screen, pdp->draw); _mesa_free(pdp); return NULL; } @@ -691,8 +671,8 @@ static void driDestroyDrawable(__DRInativeDisplay *dpy, void *drawablePrivate) if (pdp) { (*psp->DriverAPI.DestroyBuffer)(pdp); - if ((*window_exists)(dpy, pdp->draw)) - (void)XF86DRIDestroyDrawable(dpy, scrn, pdp->draw); + if ((*dri_interface->windowExists)(dpy, pdp->draw)) + (void)(*dri_interface->destroyDrawable)(dpy, scrn, pdp->draw); if (pdp->pClipRects) { _mesa_free(pdp->pClipRects); pdp->pClipRects = NULL; @@ -731,7 +711,7 @@ static void driDestroyContext(__DRInativeDisplay *dpy, int scrn, void *contextPr if (pcp) { (*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp); __driGarbageCollectDrawables(pcp->driScreenPriv->drawHash); - (void)XF86DRIDestroyContext(dpy, scrn, pcp->contextID); + (void) (*dri_interface->destroyContext)(dpy, scrn, pcp->contextID); _mesa_free(pcp); } } @@ -768,7 +748,7 @@ driCreateNewContext(__DRInativeDisplay *dpy, const __GLcontextModes *modes, __DRIscreenPrivate *psp; void * const shareCtx = (pshare != NULL) ? pshare->driverPrivate : NULL; - pDRIScreen = (*glx_find_dri_screen)(dpy, modes->screen); + pDRIScreen = (*dri_interface->getScreen)(dpy, modes->screen); if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) { /* ERROR!!! */ return NULL; @@ -781,7 +761,7 @@ driCreateNewContext(__DRInativeDisplay *dpy, const __GLcontextModes *modes, return NULL; } - if (! (*create_context_with_config)(dpy, modes->screen, modes->fbconfigID, + if (! (*dri_interface->createContext)(dpy, modes->screen, modes->fbconfigID, &pcp->contextID, &pcp->hHWContext)) { _mesa_free(pcp); return NULL; @@ -809,7 +789,8 @@ driCreateNewContext(__DRInativeDisplay *dpy, const __GLcontextModes *modes, pctx->unbindContext = driUnbindContext; if ( !(*psp->DriverAPI.CreateContext)(modes, pcp, shareCtx) ) { - (void)XF86DRIDestroyContext(dpy, modes->screen, pcp->contextID); + (void) (*dri_interface->destroyContext)(dpy, modes->screen, + pcp->contextID); _mesa_free(pcp); return NULL; } @@ -906,25 +887,6 @@ __driUtilCreateNewScreen(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, __DRIscreenPrivate *psp; - window_exists = (PFNGLXWINDOWEXISTSPROC) - glXGetProcAddress( (const GLubyte *) "__glXWindowExists" ); - - if ( window_exists == NULL ) { - return NULL; - } - - glx_find_dri_screen = - (PFNGLXFINDDRISCREEN)glXGetProcAddress("__glXFindDRIScreen"); - if ( glx_find_dri_screen == NULL ) { - return NULL; - } - - create_context_with_config = (PFNGLXCREATECONTEXTWITHCONFIGPROC) - glXGetProcAddress( (const GLubyte *) "__glXCreateContextWithConfig" ); - if ( create_context_with_config == NULL ) { - return NULL; - } - api_ver = internal_api_version; psp = (__DRIscreenPrivate *)_mesa_malloc(sizeof(__DRIscreenPrivate)); @@ -1033,15 +995,11 @@ driQueryFrameTracking( __DRInativeDisplay * dpy, void * priv, int64_t * sbc, int64_t * missedFrames, float * lastMissedUsage, float * usage ) { - static PFNGLXGETUSTPROC get_ust; __DRIswapInfo sInfo; int status; int64_t ust; __DRIdrawablePrivate * dpriv = (__DRIdrawablePrivate *) priv; - if ( get_ust == NULL ) { - get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" ); - } status = dpriv->driScreenPriv->DriverAPI.GetSwapInfo( dpriv, & sInfo ); if ( status == 0 ) { @@ -1049,7 +1007,7 @@ driQueryFrameTracking( __DRInativeDisplay * dpy, void * priv, *missedFrames = sInfo.swap_missed_count; *lastMissedUsage = sInfo.swap_missed_usage; - (*get_ust)( & ust ); + (*dri_interface->getUST)( & ust ); *usage = driCalculateSwapUsage( dpriv, sInfo.swap_ust, ust ); } @@ -1089,20 +1047,13 @@ float driCalculateSwapUsage( __DRIdrawablePrivate *dPriv, int64_t last_swap_ust, int64_t current_ust ) { - static PFNGLXGETMSCRATEOMLPROC get_msc_rate = NULL; int32_t n; int32_t d; int interval; float usage = 1.0; - if ( get_msc_rate == NULL ) { - get_msc_rate = (PFNGLXGETMSCRATEOMLPROC) - glXGetProcAddress( (const GLubyte *) "glXGetMscRateOML" ); - } - - if ( (get_msc_rate != NULL) - && get_msc_rate( dPriv->display, dPriv->draw, &n, &d ) ) { + if ( (*dri_interface->getMSCRate)( dPriv->display, dPriv->draw, &n, &d ) ) { interval = (dPriv->pdraw->swap_interval != 0) ? dPriv->pdraw->swap_interval : 1; diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index 3e2aa1f52d8..a5e907e7261 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -314,7 +314,7 @@ struct __DRIdrawablePrivateRec { * \name Display and screen information. * * Basically just need these for when the locking code needs to call - * __driUtilUpdateDrawableInfo() which calls XF86DRIGetDrawableInfo(). + * \c __driUtilUpdateDrawableInfo. */ /*@{*/ __DRInativeDisplay *display; @@ -325,12 +325,6 @@ struct __DRIdrawablePrivateRec { * Called via glXSwapBuffers(). */ void (*swapBuffers)( __DRIdrawablePrivate *dPriv ); - - /** - * Get information about the location, size, and clip rects of the - * drawable within the display. - */ - PFNGLXGETDRAWABLEINFOPROC getInfo; }; /** @@ -549,10 +543,12 @@ extern float driCalculateSwapUsage( __DRIdrawablePrivate *dPriv, int64_t last_swap_ust, int64_t current_ust ); -/* Test for the GLX header glx.h */ -#ifndef GLX -extern void -(*glXGetProcAddress(const GLubyte *procname))( void ); -#endif +/** + * Pointer to the \c __DRIinterfaceMethods passed to the driver by the loader. + * + * This pointer is set in the driver's \c __driCreateNewScreen function and + * is defined in dri_util.c. + */ +extern const __DRIinterfaceMethods * dri_interface; #endif /* _DRI_UTIL_H_ */ diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c index 6f4ffc078e5..e2ba66d2e7b 100644 --- a/src/mesa/drivers/dri/fb/fb_dri.c +++ b/src/mesa/drivers/dri/fb/fb_dri.c @@ -73,7 +73,6 @@ typedef struct { #define FB_CONTEXT(ctx) ((fbContextPtr)(ctx->DriverCtx)) -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; static const GLubyte * get_string(GLcontext *ctx, GLenum pname) @@ -706,7 +705,7 @@ fbFillInModes( unsigned pixel_bits, unsigned depth_bits, fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; } - modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) ); + modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) ); m = modes; if ( ! driFillInModes( & m, fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, @@ -777,15 +776,10 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc frame_buffer, pSAREA, fd, internal_api_version, &fbAPI); if ( psp != NULL ) { - create_context_modes = (PFNGLXCREATECONTEXTMODES) - glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" ); - if ( create_context_modes != NULL ) { - - *driver_modes = fbFillInModes( psp->fbBPP, - (psp->fbBPP == 16) ? 16 : 24, - (psp->fbBPP == 16) ? 0 : 8, - 1); - } + *driver_modes = fbFillInModes( psp->fbBPP, + (psp->fbBPP == 16) ? 16 : 24, + (psp->fbBPP == 16) ? 0 : 8, + 1); } return (void *) psp; diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c index c516cae2f2d..f49b40aa833 100644 --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c +++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c @@ -616,8 +616,6 @@ static const struct __DriverAPIRec ffbAPI = { }; -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; - static __GLcontextModes * ffbFillInModes( unsigned pixel_bits, unsigned depth_bits, unsigned stencil_bits, GLboolean have_back_buffer ) @@ -667,7 +665,7 @@ ffbFillInModes( unsigned pixel_bits, unsigned depth_bits, fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; } - modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) ); + modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) ); m = modes; if ( ! driFillInModes( & m, fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, @@ -710,7 +708,7 @@ ffbFillInModes( unsigned pixel_bits, unsigned depth_bits, * failure. */ PUBLIC -void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -718,6 +716,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, int internal_api_version, + const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes ) { @@ -726,6 +725,8 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 0, 0, 1 }; + dri_interface = interface; + if ( ! driCheckDriDdxDrmVersions2( "ffb", dri_version, & dri_expected, ddx_version, & ddx_expected, @@ -738,11 +739,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc frame_buffer, pSAREA, fd, internal_api_version, &ffbAPI); if ( psp != NULL ) { - create_context_modes = (PFNGLXCREATECONTEXTMODES) - glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" ); - if ( create_context_modes != NULL ) { - *driver_modes = ffbFillInModes( 32, 16, 0, GL_TRUE ); - } + *driver_modes = ffbFillInModes( 32, 16, 0, GL_TRUE ); } return (void *) psp; diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index 0eacdd75f07..1b9d4aa3699 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -54,8 +54,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "GL/internal/dri_interface.h" -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; - static __GLcontextModes *fill_in_modes( __GLcontextModes *modes, unsigned pixel_bits, unsigned depth_bits, @@ -158,7 +156,7 @@ i810FillInModes( unsigned pixel_bits, unsigned depth_bits, num_modes = depth_buffer_factor * back_buffer_factor * 4; - modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) ); + modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) ); m = modes; for ( i = 0 ; i < depth_buffer_factor ; i++ ) { m = fill_in_modes( m, pixel_bits, @@ -426,7 +424,7 @@ static const struct __DriverAPIRec i810API = { * failure. */ PUBLIC -void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -434,6 +432,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, int internal_api_version, + const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes ) { @@ -442,6 +441,8 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 1, 2, 0 }; + dri_interface = interface; + if ( ! driCheckDriDdxDrmVersions2( "i810", dri_version, & dri_expected, ddx_version, & ddx_expected, @@ -454,13 +455,9 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc frame_buffer, pSAREA, fd, internal_api_version, &i810API); if ( psp != NULL ) { - create_context_modes = (PFNGLXCREATECONTEXTMODES) - glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" ); - if ( create_context_modes != NULL ) { - *driver_modes = i810FillInModes( 16, - 16, 0, - 1); - } + *driver_modes = i810FillInModes( 16, + 16, 0, + 1); } return (void *) psp; diff --git a/src/mesa/drivers/dri/i830/i830_screen.c b/src/mesa/drivers/dri/i830/i830_screen.c index 99155c66007..c77657d6f06 100644 --- a/src/mesa/drivers/dri/i830/i830_screen.c +++ b/src/mesa/drivers/dri/i830/i830_screen.c @@ -67,7 +67,6 @@ DRI_CONF_BEGIN DRI_CONF_END; const GLuint __driNConfigOptions = 2; -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; static int i830_malloc_proxy_buf(drmBufMapPtr buffers) { @@ -143,7 +142,7 @@ static GLboolean i830InitDriver(__DRIscreenPrivate *sPriv) i830ScreenPrivate *i830Screen; I830DRIPtr gDRIPriv = (I830DRIPtr)sPriv->pDevPriv; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); void * const psc = sPriv->psc->screenConfigs; @@ -467,7 +466,7 @@ i830FillInModes( unsigned pixel_bits, unsigned depth_bits, fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; } - modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) ); + modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) ); m = modes; if ( ! driFillInModes( & m, fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, @@ -503,7 +502,7 @@ i830FillInModes( unsigned pixel_bits, unsigned depth_bits, * failure. */ PUBLIC -void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -511,6 +510,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, int internal_api_version, + const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes ) { @@ -519,6 +519,8 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 1, 3, 0 }; + dri_interface = interface; + if ( ! driCheckDriDdxDrmVersions2( "i830", dri_version, & dri_expected, ddx_version, & ddx_expected, @@ -531,15 +533,11 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc frame_buffer, pSAREA, fd, internal_api_version, &i830API); if ( psp != NULL ) { - create_context_modes = (PFNGLXCREATECONTEXTMODES) - glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" ); - if ( create_context_modes != NULL ) { - I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv; - *driver_modes = i830FillInModes( dri_priv->cpp * 8, - (dri_priv->cpp == 2) ? 16 : 24, - (dri_priv->cpp == 2) ? 0 : 8, - (dri_priv->backOffset != dri_priv->depthOffset) ); - } + I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv; + *driver_modes = i830FillInModes( dri_priv->cpp * 8, + (dri_priv->cpp == 2) ? 16 : 24, + (dri_priv->cpp == 2) ? 0 : 8, + (dri_priv->backOffset != dri_priv->depthOffset) ); } return (void *) psp; diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index 5e3826a6886..71a8aeba1e8 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -54,8 +54,6 @@ DRI_CONF_BEGIN DRI_CONF_END; const GLuint __driNConfigOptions = 1; -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; - static void intelPrintDRIInfo(intelScreenPrivate *intelScreen, __DRIscreenPrivate *sPriv, @@ -77,7 +75,7 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv) intelScreenPrivate *intelScreen; I830DRIPtr gDRIPriv = (I830DRIPtr)sPriv->pDevPriv; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); void * const psc = sPriv->psc->screenConfigs; @@ -417,7 +415,7 @@ intelFillInModes( unsigned pixel_bits, unsigned depth_bits, fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; } - modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) ); + modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) ); m = modes; if ( ! driFillInModes( & m, fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, @@ -453,7 +451,7 @@ intelFillInModes( unsigned pixel_bits, unsigned depth_bits, * failure. */ PUBLIC -void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -461,6 +459,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, int internal_api_version, + const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes ) { @@ -469,6 +468,8 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 1, 1, 0 }; + dri_interface = interface; + if ( ! driCheckDriDdxDrmVersions2( "i915", dri_version, & dri_expected, ddx_version, & ddx_expected, @@ -481,15 +482,11 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc frame_buffer, pSAREA, fd, internal_api_version, &intelAPI); if ( psp != NULL ) { - create_context_modes = (PFNGLXCREATECONTEXTMODES) - glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" ); - if ( create_context_modes != NULL ) { - I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv; - *driver_modes = intelFillInModes( dri_priv->cpp * 8, - (dri_priv->cpp == 2) ? 16 : 24, - (dri_priv->cpp == 2) ? 0 : 8, - (dri_priv->backOffset != dri_priv->depthOffset) ); - } + I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv; + *driver_modes = intelFillInModes( dri_priv->cpp * 8, + (dri_priv->cpp == 2) ? 16 : 24, + (dri_priv->cpp == 2) ? 0 : 8, + (dri_priv->backOffset != dri_priv->depthOffset) ); } return (void *) psp; diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index fd9acec36f4..91aa31eecc0 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -67,7 +67,6 @@ static const GLuint __driNConfigOptions = 3; static const GLuint __driNConfigOptions = 2; #endif -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; static __GLcontextModes * fill_in_modes( __GLcontextModes * modes, unsigned pixel_bits, @@ -173,7 +172,7 @@ mach64FillInModes( unsigned pixel_bits, unsigned depth_bits, num_modes = depth_buffer_factor * back_buffer_factor * 4; - modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) ); + modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) ); m = modes; for ( i = 0 ; i < depth_buffer_factor ; i++ ) { m = fill_in_modes( m, pixel_bits, @@ -209,7 +208,7 @@ mach64CreateScreen( __DRIscreenPrivate *sPriv ) mach64ScreenPtr mach64Screen; ATIDRIPtr serverInfo = (ATIDRIPtr)sPriv->pDevPriv; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); void * const psc = sPriv->psc->screenConfigs; @@ -499,7 +498,7 @@ static struct __DriverAPIRec mach64API = { * failure. */ PUBLIC -void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -507,6 +506,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, int internal_api_version, + const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes ) { @@ -515,6 +515,8 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 1, 0, 0 }; + dri_interface = interface; + if ( ! driCheckDriDdxDrmVersions2( "Mach64", dri_version, & dri_expected, ddx_version, & ddx_expected, @@ -527,15 +529,11 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc frame_buffer, pSAREA, fd, internal_api_version, &mach64API); if ( psp != NULL ) { - create_context_modes = (PFNGLXCREATECONTEXTMODES) - glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" ); - if ( create_context_modes != NULL ) { - ATIDRIPtr dri_priv = (ATIDRIPtr) psp->pDevPriv; - *driver_modes = mach64FillInModes( dri_priv->cpp * 8, - 16, - 0, - 1); - } + ATIDRIPtr dri_priv = (ATIDRIPtr) psp->pDevPriv; + *driver_modes = mach64FillInModes( dri_priv->cpp * 8, + 16, + 0, + 1); } return (void *) psp; diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index aaa4e25c103..e310f619586 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -104,8 +104,6 @@ DRI_CONF_BEGIN DRI_CONF_END; static const GLuint __driNConfigOptions = 6; -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; - #ifndef MGA_DEBUG int MGA_DEBUG = 0; #endif @@ -161,7 +159,7 @@ mgaFillInModes( unsigned pixel_bits, unsigned depth_bits, fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; } - modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) ); + modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) ); m = modes; if ( ! driFillInModes( & m, fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, @@ -199,7 +197,7 @@ mgaInitDriver(__DRIscreenPrivate *sPriv) mgaScreenPrivate *mgaScreen; MGADRIPtr serverInfo = (MGADRIPtr)sPriv->pDevPriv; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); void * const psc = sPriv->psc->screenConfigs; @@ -436,14 +434,6 @@ static const struct dri_debug_control debug_control[] = }; -static int -get_ust_nop( int64_t * ust ) -{ - *ust = 1; - return 0; -} - - static GLboolean mgaCreateContext( const __GLcontextModes *mesaVis, __DRIcontextPrivate *driContextPriv, @@ -654,12 +644,7 @@ mgaCreateContext( const __GLcontextModes *mesaVis, mmesa->vblank_flags = (mmesa->mgaScreen->irq == 0) ? VBLANK_FLAG_NO_IRQ : driGetDefaultVBlankFlags(&mmesa->optionCache); - mmesa->get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" ); - if ( mmesa->get_ust == NULL ) { - mmesa->get_ust = get_ust_nop; - } - - (*mmesa->get_ust)( & mmesa->swap_ust ); + (*dri_interface->getUST)( & mmesa->swap_ust ); if (driQueryOptionb(&mmesa->optionCache, "no_rast")) { fprintf(stderr, "disabling 3D acceleration\n"); @@ -949,7 +934,7 @@ static const struct __DriverAPIRec mgaAPI = { * failure. */ PUBLIC -void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -957,6 +942,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, int internal_api_version, + const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes ) { @@ -965,6 +951,8 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 3, 0, 0 }; + dri_interface = interface; + if ( ! driCheckDriDdxDrmVersions2( "MGA", dri_version, & dri_expected, ddx_version, & ddx_expected, @@ -977,15 +965,11 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc frame_buffer, pSAREA, fd, internal_api_version, &mgaAPI); if ( psp != NULL ) { - create_context_modes = (PFNGLXCREATECONTEXTMODES) - glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" ); - if ( create_context_modes != NULL ) { - MGADRIPtr dri_priv = (MGADRIPtr) psp->pDevPriv; - *driver_modes = mgaFillInModes( dri_priv->cpp * 8, - (dri_priv->cpp == 2) ? 16 : 24, - (dri_priv->cpp == 2) ? 0 : 8, - (dri_priv->backOffset != dri_priv->depthOffset) ); - } + MGADRIPtr dri_priv = (MGADRIPtr) psp->pDevPriv; + *driver_modes = mgaFillInModes( dri_priv->cpp * 8, + (dri_priv->cpp == 2) ? 16 : 24, + (dri_priv->cpp == 2) ? 0 : 8, + (dri_priv->backOffset != dri_priv->depthOffset) ); } return (void *) psp; diff --git a/src/mesa/drivers/dri/mga/mgacontext.h b/src/mesa/drivers/dri/mga/mgacontext.h index 1d8c5da6dae..81348b6c7f9 100644 --- a/src/mesa/drivers/dri/mga/mgacontext.h +++ b/src/mesa/drivers/dri/mga/mgacontext.h @@ -271,8 +271,6 @@ struct mga_context_t { uint32_t last_frame_fence; - PFNGLXGETUSTPROC get_ust; - /* Drawable, cliprect and scissor information */ int dirty_cliprects; /* which sets of cliprects are uptodate? */ diff --git a/src/mesa/drivers/dri/mga/mgaioctl.c b/src/mesa/drivers/dri/mga/mgaioctl.c index 62785f6344b..df253d15934 100644 --- a/src/mesa/drivers/dri/mga/mgaioctl.c +++ b/src/mesa/drivers/dri/mga/mgaioctl.c @@ -424,7 +424,7 @@ void mgaCopyBuffer( const __DRIdrawablePrivate *dPriv ) & missed_target ); if ( missed_target ) { mmesa->swap_missed_count++; - (void) (*mmesa->get_ust)( & mmesa->swap_missed_ust ); + (void) (*dri_interface->getUST)( & mmesa->swap_missed_ust ); } LOCK_HARDWARE( mmesa ); @@ -462,7 +462,7 @@ void mgaCopyBuffer( const __DRIdrawablePrivate *dPriv ) mmesa->dirty |= MGA_UPLOAD_CLIPRECTS; mmesa->swap_count++; - (void) (*mmesa->get_ust)( & mmesa->swap_ust ); + (void) (*dri_interface->getUST)( & mmesa->swap_ust ); } diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index a5c2a6d1542..f5d0287ed9f 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -88,7 +88,6 @@ static const GLuint __driNConfigOptions = 3; #define PCI_CHIP_RAGE128RL 0x524C #endif -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; /* Create the device specific screen private data struct. */ @@ -98,7 +97,7 @@ r128CreateScreen( __DRIscreenPrivate *sPriv ) r128ScreenPtr r128Screen; R128DRIPtr r128DRIPriv = (R128DRIPtr)sPriv->pDevPriv; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); void * const psc = sPriv->psc->screenConfigs; @@ -440,7 +439,7 @@ r128FillInModes( unsigned pixel_bits, unsigned depth_bits, fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; } - modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) ); + modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) ); m = modes; if ( ! driFillInModes( & m, fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, @@ -483,7 +482,7 @@ r128FillInModes( unsigned pixel_bits, unsigned depth_bits, * failure. */ PUBLIC -void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -491,6 +490,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, int internal_api_version, + const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes ) { @@ -500,6 +500,8 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc static const __DRIversion drm_expected = { 2, 2, 0 }; + dri_interface = interface; + if ( ! driCheckDriDdxDrmVersions2( "Rage128", dri_version, & dri_expected, ddx_version, & ddx_expected, @@ -512,15 +514,11 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc frame_buffer, pSAREA, fd, internal_api_version, &r128API); if ( psp != NULL ) { - create_context_modes = (PFNGLXCREATECONTEXTMODES) - glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" ); - if ( create_context_modes != NULL ) { - R128DRIPtr dri_priv = (R128DRIPtr) psp->pDevPriv; - *driver_modes = r128FillInModes( dri_priv->bpp, - (dri_priv->bpp == 16) ? 16 : 24, - (dri_priv->bpp == 16) ? 0 : 8, - (dri_priv->backOffset != dri_priv->depthOffset) ); - } + R128DRIPtr dri_priv = (R128DRIPtr) psp->pDevPriv; + *driver_modes = r128FillInModes( dri_priv->bpp, + (dri_priv->bpp == 16) ? 16 : 24, + (dri_priv->bpp == 16) ? 0 : 8, + (dri_priv->backOffset != dri_priv->depthOffset) ); } return (void *) psp; diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 7c543a55ec8..06834fb626e 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -249,14 +249,6 @@ static const struct dri_debug_control debug_control[] = }; -static int -get_ust_nop( int64_t * ust ) -{ - *ust = 1; - return 0; -} - - /* Create the device specific rendering context. */ GLboolean r200CreateContext( const __GLcontextModes *glVisual, @@ -509,11 +501,7 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual, rmesa->prefer_gart_client_texturing = (getenv("R200_GART_CLIENT_TEXTURES") != 0); - rmesa->get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" ); - if ( rmesa->get_ust == NULL ) { - rmesa->get_ust = get_ust_nop; - } - (*rmesa->get_ust)( & rmesa->swap_ust ); + (*dri_interface->getUST)( & rmesa->swap_ust ); #if DO_DEBUG diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h index 5e3fb2295d5..8169af709b7 100644 --- a/src/mesa/drivers/dri/r200/r200_context.h +++ b/src/mesa/drivers/dri/r200/r200_context.h @@ -912,7 +912,6 @@ struct r200_context { GLuint swap_count; GLuint swap_missed_count; - PFNGLXGETUSTPROC get_ust; /* r200_tcl.c */ diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c b/src/mesa/drivers/dri/r200/r200_ioctl.c index ad43158d64a..a2336ce4f3d 100644 --- a/src/mesa/drivers/dri/r200/r200_ioctl.c +++ b/src/mesa/drivers/dri/r200/r200_ioctl.c @@ -486,7 +486,7 @@ void r200CopyBuffer( const __DRIdrawablePrivate *dPriv ) rmesa->hw.all_dirty = GL_TRUE; rmesa->swap_count++; - (*rmesa->get_ust)( & ust ); + (*dri_interface->getUST)( & ust ); if ( missed_target ) { rmesa->swap_missed_count++; rmesa->swap_missed_ust = ust - rmesa->swap_ust; @@ -540,7 +540,7 @@ void r200PageFlip( const __DRIdrawablePrivate *dPriv ) driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target ); if ( missed_target ) { rmesa->swap_missed_count++; - (void) (*rmesa->get_ust)( & rmesa->swap_missed_ust ); + (void) (*dri_interface->getUST)( & rmesa->swap_missed_ust ); } LOCK_HARDWARE( rmesa ); @@ -554,7 +554,7 @@ void r200PageFlip( const __DRIdrawablePrivate *dPriv ) } rmesa->swap_count++; - (void) (*rmesa->get_ust)( & rmesa->swap_ust ); + (void) (*dri_interface->getUST)( & rmesa->swap_ust ); if ( rmesa->sarea->pfCurrentPage == 1 ) { rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset; diff --git a/src/mesa/drivers/dri/r200/r200_screen.c b/src/mesa/drivers/dri/r200/r200_screen.c index 014818ac1b6..ddb3a91b1dc 100644 --- a/src/mesa/drivers/dri/r200/r200_screen.c +++ b/src/mesa/drivers/dri/r200/r200_screen.c @@ -136,7 +136,6 @@ static const GLuint __driNConfigOptions = 17; #endif -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; static r200ScreenPtr __r200Screen; @@ -191,7 +190,7 @@ r200FillInModes( unsigned pixel_bits, unsigned depth_bits, fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; } - modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) ); + modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) ); m = modes; if ( ! driFillInModes( & m, fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, @@ -232,7 +231,7 @@ r200CreateScreen( __DRIscreenPrivate *sPriv ) RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv; unsigned char *RADEONMMIO; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); void * const psc = sPriv->psc->screenConfigs; @@ -643,7 +642,7 @@ static const struct __DriverAPIRec r200API = { * failure. */ PUBLIC -void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -651,6 +650,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, int internal_api_version, + const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes ) { @@ -659,6 +659,8 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 1, 5, 0 }; + dri_interface = interface; + if ( ! driCheckDriDdxDrmVersions3( "R200", dri_version, & dri_expected, ddx_version, & ddx_expected, @@ -671,15 +673,11 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc frame_buffer, pSAREA, fd, internal_api_version, &r200API); if ( psp != NULL ) { - create_context_modes = (PFNGLXCREATECONTEXTMODES) - glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" ); - if ( create_context_modes != NULL ) { - RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv; - *driver_modes = r200FillInModes( dri_priv->bpp, - (dri_priv->bpp == 16) ? 16 : 24, - (dri_priv->bpp == 16) ? 0 : 8, - (dri_priv->backOffset != dri_priv->depthOffset) ); - } + RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv; + *driver_modes = r200FillInModes( dri_priv->bpp, + (dri_priv->bpp == 16) ? 16 : 24, + (dri_priv->bpp == 16) ? 0 : 8, + (dri_priv->backOffset != dri_priv->depthOffset) ); } return (void *) psp; diff --git a/src/mesa/drivers/dri/r300/radeon_context.c b/src/mesa/drivers/dri/r300/radeon_context.c index 8c712dc2033..97507617cd7 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.c +++ b/src/mesa/drivers/dri/r300/radeon_context.c @@ -124,12 +124,6 @@ static void radeonInitDriverFuncs(struct dd_function_table *functions) } -static int get_ust_nop(int64_t * ust) -{ - *ust = 1; - return 0; -} - /** * Create and initialize all common fields of the context, * including the Mesa context itself. @@ -195,13 +189,7 @@ GLboolean radeonInitContext(radeonContextPtr radeon, radeon->vblank_flags = (radeon->radeonScreen->irq != 0) ? driGetDefaultVBlankFlags(&radeon->optionCache) : VBLANK_FLAG_NO_IRQ; - radeon->get_ust = - (PFNGLXGETUSTPROC) glXGetProcAddress((const GLubyte *) - "__glXGetUST"); - if (radeon->get_ust == NULL) { - radeon->get_ust = get_ust_nop; - } - (*radeon->get_ust) (&radeon->swap_ust); + (*dri_interface->getUST) (&radeon->swap_ust); return GL_TRUE; } diff --git a/src/mesa/drivers/dri/r300/radeon_context.h b/src/mesa/drivers/dri/r300/radeon_context.h index 84fcaee7181..189bc6ad021 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.h +++ b/src/mesa/drivers/dri/r300/radeon_context.h @@ -196,7 +196,6 @@ struct radeon_context { GLuint swap_count; GLuint swap_missed_count; - PFNGLXGETUSTPROC get_ust; /* Derived state */ struct radeon_state state; diff --git a/src/mesa/drivers/dri/r300/radeon_ioctl.c b/src/mesa/drivers/dri/r300/radeon_ioctl.c index 1f2f71c29ab..af489e2a842 100644 --- a/src/mesa/drivers/dri/r300/radeon_ioctl.c +++ b/src/mesa/drivers/dri/r300/radeon_ioctl.c @@ -208,7 +208,7 @@ void radeonCopyBuffer(const __DRIdrawablePrivate * dPriv) ((r300ContextPtr)radeon)->hw.all_dirty = GL_TRUE; radeon->swap_count++; - (*radeon->get_ust) (&ust); + (*dri_interface->getUST) (&ust); if (missed_target) { radeon->swap_missed_count++; radeon->swap_missed_ust = ust - radeon->swap_ust; @@ -266,7 +266,7 @@ void radeonPageFlip(const __DRIdrawablePrivate * dPriv) &missed_target); if (missed_target) { radeon->swap_missed_count++; - (void)(*radeon->get_ust) (&radeon->swap_missed_ust); + (void)(*dri_interface->getUST) (&radeon->swap_missed_ust); } LOCK_HARDWARE(radeon); @@ -280,7 +280,7 @@ void radeonPageFlip(const __DRIdrawablePrivate * dPriv) } radeon->swap_count++; - (void)(*radeon->get_ust) (&radeon->swap_ust); + (void)(*dri_interface->getUST) (&radeon->swap_ust); if (radeon->sarea->pfCurrentPage == 1) { radeon->state.color.drawOffset = radeon->radeonScreen->frontOffset; diff --git a/src/mesa/drivers/dri/r300/radeon_screen.c b/src/mesa/drivers/dri/r300/radeon_screen.c index ea9b9ea2669..34f5d84e361 100644 --- a/src/mesa/drivers/dri/r300/radeon_screen.c +++ b/src/mesa/drivers/dri/r300/radeon_screen.c @@ -216,7 +216,6 @@ static const struct dri_debug_control debug_control[] = { #define PCI_CHIP_R420_JK 0x4a4b #endif -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; static radeonScreenPtr __radeonScreen; @@ -271,7 +270,7 @@ static __GLcontextModes *radeonFillInModes(unsigned pixel_bits, fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; } - modes = (*create_context_modes) (num_modes, sizeof(__GLcontextModes)); + modes = (*dri_interface->createContextModes) (num_modes, sizeof(__GLcontextModes)); m = modes; if (!driFillInModes(&m, fb_format, fb_type, depth_bits_array, stencil_bits_array, @@ -312,7 +311,7 @@ static radeonScreenPtr radeonCreateScreen(__DRIscreenPrivate * sPriv) unsigned char *RADEONMMIO; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = (PFNGLXSCRENABLEEXTENSIONPROC) - glXGetProcAddress((const GLubyte *) "__glXScrEnableExtension"); + (*dri_interface->getProcAddress("glxEnableExtension")); void *const psc = sPriv->psc->screenConfigs; @@ -790,13 +789,14 @@ static const struct __DriverAPIRec radeonAPI = { * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on * failure. */ -void *__driCreateNewScreen_20050722(__DRInativeDisplay * dpy, int scrn, +void *__driCreateNewScreen_20050725(__DRInativeDisplay * dpy, int scrn, __DRIscreen * psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, int internal_api_version, + const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes) { __DRIscreenPrivate *psp; @@ -804,6 +804,8 @@ void *__driCreateNewScreen_20050722(__DRInativeDisplay * dpy, int scrn, static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 1, 11, 1 }; + dri_interface = interface; + if (!driCheckDriDdxDrmVersions3("R300", dri_version, &dri_expected, ddx_version, &ddx_expected, @@ -816,20 +818,14 @@ void *__driCreateNewScreen_20050722(__DRInativeDisplay * dpy, int scrn, frame_buffer, pSAREA, fd, internal_api_version, &radeonAPI); if (psp != NULL) { - create_context_modes = (PFNGLXCREATECONTEXTMODES) - glXGetProcAddress((const GLubyte *) - "__glXCreateContextModes"); - if (create_context_modes != NULL) { - RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv; - *driver_modes = radeonFillInModes(dri_priv->bpp, - (dri_priv->bpp == - 16) ? 16 : 24, - (dri_priv->bpp == - 16) ? 0 : 8, - (dri_priv->backOffset != - dri_priv-> - depthOffset)); - } + RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv; + *driver_modes = radeonFillInModes(dri_priv->bpp, + (dri_priv->bpp == + 16) ? 16 : 24, + (dri_priv->bpp == + 16) ? 0 : 8, + (dri_priv->backOffset != + dri_priv->depthOffset)); } return (void *)psp; diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index e6149e1a580..12f5f401151 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -213,14 +213,6 @@ static const struct dri_debug_control debug_control[] = }; -static int -get_ust_nop( int64_t * ust ) -{ - *ust = 1; - return 0; -} - - /* Create the device specific context. */ GLboolean @@ -450,11 +442,7 @@ radeonCreateContext( const __GLcontextModes *glVisual, rmesa->vblank_flags = (rmesa->radeonScreen->irq != 0) ? driGetDefaultVBlankFlags(&rmesa->optionCache) : VBLANK_FLAG_NO_IRQ; - rmesa->get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" ); - if ( rmesa->get_ust == NULL ) { - rmesa->get_ust = get_ust_nop; - } - (*rmesa->get_ust)( & rmesa->swap_ust ); + (*dri_interface->getUST)( & rmesa->swap_ust ); #if DO_DEBUG diff --git a/src/mesa/drivers/dri/radeon/radeon_context.h b/src/mesa/drivers/dri/radeon/radeon_context.h index 3019602b7cf..621a4c65574 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_context.h @@ -775,7 +775,6 @@ struct radeon_context { GLuint swap_count; GLuint swap_missed_count; - PFNGLXGETUSTPROC get_ust; /* radeon_tcl.c */ diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.c b/src/mesa/drivers/dri/radeon/radeon_ioctl.c index 3e1fc4bafff..53c5d5ca537 100644 --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.c +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.c @@ -935,7 +935,7 @@ void radeonCopyBuffer( const __DRIdrawablePrivate *dPriv ) UNLOCK_HARDWARE( rmesa ); rmesa->swap_count++; - (*rmesa->get_ust)( & ust ); + (*dri_interface->getUST)( & ust ); if ( missed_target ) { rmesa->swap_missed_count++; rmesa->swap_missed_ust = ust - rmesa->swap_ust; @@ -983,7 +983,7 @@ void radeonPageFlip( const __DRIdrawablePrivate *dPriv ) driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target ); if ( missed_target ) { rmesa->swap_missed_count++; - (void) (*rmesa->get_ust)( & rmesa->swap_missed_ust ); + (void) (*dri_interface->getUST)( & rmesa->swap_missed_ust ); } LOCK_HARDWARE( rmesa ); @@ -997,7 +997,7 @@ void radeonPageFlip( const __DRIdrawablePrivate *dPriv ) } rmesa->swap_count++; - (void) (*rmesa->get_ust)( & rmesa->swap_ust ); + (void) (*dri_interface->getUST)( & rmesa->swap_ust ); if ( rmesa->sarea->pfCurrentPage == 1 ) { rmesa->state.color.drawOffset = rmesa->radeonScreen->frontOffset; diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 71da86f1d17..9cd60875b1b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -115,7 +115,6 @@ static const GLuint __driNConfigOptions = 13; #define PCI_CHIP_RS250_4437 0x4437 #endif -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ); @@ -168,7 +167,7 @@ radeonFillInModes( unsigned pixel_bits, unsigned depth_bits, fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; } - modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) ); + modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) ); m = modes; if ( ! driFillInModes( & m, fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, @@ -208,7 +207,7 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv ) RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv; unsigned char *RADEONMMIO; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" ); + (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); void * const psc = sPriv->psc->screenConfigs; @@ -567,7 +566,7 @@ static struct __DriverAPIRec radeonAPI = { * failure. */ PUBLIC -void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -575,6 +574,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, int internal_api_version, + const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes ) { @@ -583,6 +583,8 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 1, 3, 0 }; + dri_interface = interface; + if ( ! driCheckDriDdxDrmVersions3( "Radeon", dri_version, & dri_expected, ddx_version, & ddx_expected, @@ -595,15 +597,11 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc frame_buffer, pSAREA, fd, internal_api_version, &radeonAPI); if ( psp != NULL ) { - create_context_modes = (PFNGLXCREATECONTEXTMODES) - glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" ); - if ( create_context_modes != NULL ) { - RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv; - *driver_modes = radeonFillInModes( dri_priv->bpp, - (dri_priv->bpp == 16) ? 16 : 24, - (dri_priv->bpp == 16) ? 0 : 8, - (dri_priv->backOffset != dri_priv->depthOffset) ); - } + RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv; + *driver_modes = radeonFillInModes( dri_priv->bpp, + (dri_priv->bpp == 16) ? 16 : 24, + (dri_priv->bpp == 16) ? 0 : 8, + (dri_priv->backOffset != dri_priv->depthOffset) ); } return (void *) psp; diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index 355419a84a0..bb8f015e760 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -105,7 +105,6 @@ DRI_CONF_BEGIN DRI_CONF_END; static const GLuint __driNConfigOptions = 10; -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; static const struct dri_debug_control debug_control[] = { @@ -955,7 +954,7 @@ savageFillInModes( unsigned pixel_bits, unsigned depth_bits, fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; } - modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) ); + modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) ); m = modes; if ( ! driFillInModes( & m, fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, @@ -998,7 +997,7 @@ savageFillInModes( unsigned pixel_bits, unsigned depth_bits, * failure. */ PUBLIC -void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -1006,6 +1005,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, int internal_api_version, + const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes ) { @@ -1014,6 +1014,8 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 2, 1, 0 }; + dri_interface = interface; + if ( ! driCheckDriDdxDrmVersions2( "Savage", dri_version, & dri_expected, ddx_version, & ddx_expected, @@ -1026,15 +1028,11 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc frame_buffer, pSAREA, fd, internal_api_version, &savageAPI); if ( psp != NULL ) { - create_context_modes = (PFNGLXCREATECONTEXTMODES) - glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" ); - if ( create_context_modes != NULL ) { - SAVAGEDRIPtr dri_priv = (SAVAGEDRIPtr)psp->pDevPriv; - *driver_modes = savageFillInModes( dri_priv->cpp*8, - (dri_priv->cpp == 2) ? 16 : 24, - (dri_priv->cpp == 2) ? 0 : 8, - (dri_priv->backOffset != dri_priv->depthOffset) ); - } + SAVAGEDRIPtr dri_priv = (SAVAGEDRIPtr)psp->pDevPriv; + *driver_modes = savageFillInModes( dri_priv->cpp*8, + (dri_priv->cpp == 2) ? 16 : 24, + (dri_priv->cpp == 2) ? 0 : 8, + (dri_priv->backOffset != dri_priv->depthOffset) ); } return (void *) psp; diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c index 56585d3cdd2..592852e9418 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.c +++ b/src/mesa/drivers/dri/sis/sis_screen.c @@ -59,7 +59,6 @@ DRI_CONF_BEGIN DRI_CONF_END; static const GLuint __driNConfigOptions = 2; -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; static __GLcontextModes * sisFillInModes(int bpp) @@ -100,7 +99,7 @@ sisFillInModes(int bpp) fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; } - modes = (*create_context_modes)(num_modes, sizeof(__GLcontextModes)); + modes = (*dri_interface->createContextModes)(num_modes, sizeof(__GLcontextModes)); m = modes; if (!driFillInModes(&m, fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, @@ -414,7 +413,7 @@ static struct __DriverAPIRec sisAPI = { * failure. */ PUBLIC -void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, +void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes *modes, const __DRIversion *ddx_version, @@ -423,6 +422,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, const __DRIframebuffer *frame_buffer, drmAddress pSAREA, int fd, int internal_api_version, + const __DRIinterfaceMethods * interface, __GLcontextModes **driver_modes ) { @@ -431,6 +431,8 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, static const __DRIversion dri_expected = {4, 0, 0}; static const __DRIversion drm_expected = {1, 0, 0}; + dri_interface = interface; + if (!driCheckDriDdxDrmVersions2("SiS", dri_version, &dri_expected, ddx_version, &ddx_expected, drm_version, &drm_expected)) { @@ -442,12 +444,8 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, frame_buffer, pSAREA, fd, internal_api_version, &sisAPI); if (psp != NULL) { - create_context_modes = (PFNGLXCREATECONTEXTMODES) - glXGetProcAddress((const GLubyte *)"__glXCreateContextModes"); - if (create_context_modes != NULL) { - SISDRIPtr dri_priv = (SISDRIPtr)psp->pDevPriv; - *driver_modes = sisFillInModes(dri_priv->bytesPerPixel * 8); - } + SISDRIPtr dri_priv = (SISDRIPtr)psp->pDevPriv; + *driver_modes = sisFillInModes(dri_priv->bytesPerPixel * 8); } return (void *)psp; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index 56fe39e7017..b373129646b 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -346,7 +346,6 @@ static const struct __DriverAPIRec tdfxAPI = { .SwapBuffersMSC = NULL }; -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits, unsigned depth_bits, @@ -368,7 +367,7 @@ static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits, num_modes = (depth_bits == 16) ? 32 : 16; - modes = (*create_context_modes)(num_modes, sizeof(__GLcontextModes)); + modes = (*dri_interface->createContextModes)(num_modes, sizeof(__GLcontextModes)); m = modes; for (i = 0; i <= 1; i++) { @@ -427,7 +426,7 @@ static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits, * failure. */ PUBLIC -void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -435,6 +434,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, int internal_api_version, + const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes ) { __DRIscreenPrivate *psp; @@ -442,6 +442,8 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 1, 0, 0 }; + dri_interface = interface; + if ( ! driCheckDriDdxDrmVersions2( "tdfx", dri_version, & dri_expected, ddx_version, & ddx_expected, @@ -454,10 +456,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc frame_buffer, pSAREA, fd, internal_api_version, &tdfxAPI); - create_context_modes = (PFNGLXCREATECONTEXTMODES) - glXGetProcAddress((const GLubyte *)"__glXCreateContextModes"); - - if (create_context_modes != NULL) { + if (psp != NULL) { /* divined from tdfx_dri.c, sketchy */ TDFXDRIPtr dri_priv = (TDFXDRIPtr) psp->pDevPriv; int bpp = (dri_priv->cpp > 2) ? 24 : 16; diff --git a/src/mesa/drivers/dri/trident/trident_context.c b/src/mesa/drivers/dri/trident/trident_context.c index 9f3fb26342c..0af70e96fc9 100644 --- a/src/mesa/drivers/dri/trident/trident_context.c +++ b/src/mesa/drivers/dri/trident/trident_context.c @@ -358,34 +358,6 @@ tridentScreenPtr tridentCreateScreen( __DRIscreenPrivate *sPriv ) TRIDENTDRIPtr tDRIPriv = (TRIDENTDRIPtr)sPriv->pDevPriv; tridentScreenPtr tridentScreen; -#if 0 - /* Check the DRI version */ - { - int major, minor, patch; - if ( XF86DRIQueryVersion( sPriv->display, &major, &minor, &patch ) ) { - if ( major != 3 || minor != 1 || patch < 0 ) { - __driUtilMessage( "r128 DRI driver expected DRI version 3.1.x but got version %d.%d.%d", major, minor, patch ); - return GL_FALSE; - } - } - } - - /* Check that the DDX driver version is compatible */ - if ( sPriv->ddxMajor != 4 || - sPriv->ddxMinor != 0 || - sPriv->ddxPatch < 0 ) { - __driUtilMessage( "r128 DRI driver expected DDX driver version 4.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch ); - return GL_FALSE; - } - - /* Check that the DRM driver version is compatible */ - if ( sPriv->drmMajor != 2 || - sPriv->drmMinor != 1 || - sPriv->drmPatch < 0 ) { - __driUtilMessage( "r128 DRI driver expected DRM driver version 2.1.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch ); - return GL_FALSE; - } -#endif /* Allocate the private area */ tridentScreen = (tridentScreenPtr) CALLOC( sizeof(*tridentScreen) ); @@ -453,9 +425,8 @@ static struct __DriverAPIRec tridentAPI = { tridentUnbindContext, }; -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -PUBLIC void *__driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, +PUBLIC void *__driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, @@ -464,10 +435,22 @@ PUBLIC void *__driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, int internal_api_version, + const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes ) { __DRIscreenPrivate *psp; - /* XXX version checks */ + static const __DRIversion ddx_expected = { 4, 0, 0 }; + static const __DRIversion dri_expected = { 3, 1, 0 }; + static const __DRIversion drm_expected = { 1, 0, 0 }; + + dri_interface = interface; + + if ( ! driCheckDriDdxDrmVersions2( "Trident", + dri_version, & dri_expected, + ddx_version, & ddx_expected, + drm_version, & drm_expected ) ) { + return NULL; + } psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL, ddx_version, dri_version, drm_version, @@ -475,14 +458,10 @@ PUBLIC void *__driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, internal_api_version, &tridentAPI); if ( psp != NULL ) { - create_context_modes = (PFNGLXCREATECONTEXTMODES) - glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" ); #if 0 - if ( create_context_modes != NULL ) { - TRIDENTDRIPtr dri_priv = (TRIDENTDRIPtr) psp->pDevPriv; - *driver_modes = tridentFillInModes( dri_priv->bytesPerPixel * 8, - GL_TRUE ); - } + TRIDENTDRIPtr dri_priv = (TRIDENTDRIPtr) psp->pDevPriv; + *driver_modes = tridentFillInModes( dri_priv->bytesPerPixel * 8, + GL_TRUE ); #endif } return (void *) psp; diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c index 4d673286712..ca31245b0fd 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.c +++ b/src/mesa/drivers/dri/unichrome/via_context.c @@ -342,12 +342,6 @@ FreeBuffer(struct via_context *vmesa) via_free_dma_buffer(vmesa); } -static int -get_ust_nop( int64_t * ust ) -{ - *ust = 1; - return 0; -} GLboolean viaCreateContext(const __GLcontextModes *visual, @@ -563,13 +557,8 @@ viaCreateContext(const __GLcontextModes *visual, if (getenv("VIA_PAGEFLIP")) vmesa->allowPageFlip = 1; - - vmesa->get_ust = - (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" ); - if ( vmesa->get_ust == NULL ) { - vmesa->get_ust = get_ust_nop; - } - vmesa->get_ust( &vmesa->swap_ust ); + + (*dri_interface->getUST)( &vmesa->swap_ust ); vmesa->regMMIOBase = (GLuint *)((GLuint)viaScreen->reg); diff --git a/src/mesa/drivers/dri/unichrome/via_context.h b/src/mesa/drivers/dri/unichrome/via_context.h index 54460d56f50..a4b1afc02bb 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.h +++ b/src/mesa/drivers/dri/unichrome/via_context.h @@ -320,7 +320,6 @@ struct via_context { GLuint swap_count; GLuint swap_missed_count; - PFNGLXGETUSTPROC get_ust; GLuint pfCurrentOffset; GLboolean allowPageFlip; diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.c b/src/mesa/drivers/dri/unichrome/via_ioctl.c index 651c5f6e315..435fd20f778 100644 --- a/src/mesa/drivers/dri/unichrome/via_ioctl.c +++ b/src/mesa/drivers/dri/unichrome/via_ioctl.c @@ -512,7 +512,7 @@ static void viaWaitIdleVBlank( const __DRIdrawablePrivate *dPriv, vmesa->vblank_flags, & missed_target ); if ( missed_target ) { vmesa->swap_missed_count++; - vmesa->get_ust( &vmesa->swap_missed_ust ); + (*dri_interface->getUST)( &vmesa->swap_missed_ust ); } } while (!viaCheckBreadcrumb(vmesa, value)); @@ -615,7 +615,7 @@ void viaCopyBuffer(const __DRIdrawablePrivate *dPriv) viaEmitBreadcrumbLocked(vmesa); UNLOCK_HARDWARE(vmesa); - vmesa->get_ust( &vmesa->swap_ust ); + (*dri_interface->getUST)( &vmesa->swap_ust ); } @@ -639,7 +639,7 @@ void viaPageFlip(const __DRIdrawablePrivate *dPriv) viaEmitBreadcrumbLocked(vmesa); UNLOCK_HARDWARE(vmesa); - vmesa->get_ust( &vmesa->swap_ust ); + (*dri_interface->getUST)( &vmesa->swap_ust ); /* KW: FIXME: When buffers are freed, could free frontbuffer by diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index 4115434cf29..8de73539259 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -62,8 +62,6 @@ DRI_CONF_END; static const GLuint __driNConfigOptions = 3; -static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; - static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ); static drmBufMapPtr via_create_empty_buffers(void) @@ -99,8 +97,7 @@ viaInitDriver(__DRIscreenPrivate *sPriv) viaScreenPrivate *viaScreen; VIADRIPtr gDRIPriv = (VIADRIPtr)sPriv->pDevPriv; PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = - (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( - (const GLubyte *) "__glXScrEnableExtension" ); + (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension")); void * const psc = sPriv->psc->screenConfigs; @@ -368,7 +365,7 @@ viaFillInModes( unsigned pixel_bits, GLboolean have_back_buffer ) fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; } - modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) ); + modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) ); m = modes; if ( ! driFillInModes( & m, fb_format, fb_type, depth_bits_array, stencil_bits_array, @@ -405,7 +402,7 @@ viaFillInModes( unsigned pixel_bits, GLboolean have_back_buffer ) * failure. */ PUBLIC -void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, +void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, @@ -414,6 +411,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, const __DRIframebuffer * frame_buffer, drmAddress pSAREA, int fd, int internal_api_version, + const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes ) { @@ -422,6 +420,8 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, static const __DRIversion dri_expected = { 4, 0, 0 }; static const __DRIversion drm_expected = { 2, 3, 0 }; + dri_interface = interface; + if ( ! driCheckDriDdxDrmVersions2( "Unichrome", dri_version, & dri_expected, ddx_version, & ddx_expected, @@ -434,13 +434,9 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, frame_buffer, pSAREA, fd, internal_api_version, &viaAPI); if ( psp != NULL ) { - create_context_modes = (PFNGLXCREATECONTEXTMODES) - glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" ); - if ( create_context_modes != NULL ) { - VIADRIPtr dri_priv = (VIADRIPtr) psp->pDevPriv; - *driver_modes = viaFillInModes( dri_priv->bytesPerPixel * 8, - GL_TRUE ); - } + VIADRIPtr dri_priv = (VIADRIPtr) psp->pDevPriv; + *driver_modes = viaFillInModes( dri_priv->bytesPerPixel * 8, + GL_TRUE ); } fprintf(stderr, "%s - succeeded\n", __FUNCTION__); -- cgit v1.2.3 From 5c6fd3dd4c1b8e95c4da8cc4a52aa310ad324d45 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 26 Jul 2005 05:57:24 +0000 Subject: No, really, get rid of all the remaining references to DRI_USE_NEW_INTERFACE. A couple other remnants of the old interfaces hit the dust too. Thanks Jon. :) --- configs/freebsd-dri | 2 +- configs/linux-solo | 11 ++++++----- configs/linux-solo-ia64 | 24 +----------------------- include/GL/internal/dri_interface.h | 27 ++++----------------------- src/glx/x11/glxext.c | 4 ++++ 5 files changed, 16 insertions(+), 52 deletions(-) (limited to 'include') diff --git a/configs/freebsd-dri b/configs/freebsd-dri index 2e360f96410..7d811a539ba 100644 --- a/configs/freebsd-dri +++ b/configs/freebsd-dri @@ -13,7 +13,7 @@ OPT_FLAGS = -O EXPAT_INCLUDES = -I/usr/local/include X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions -DEFINES = -DDRI_NEW_INTERFACE_ONLY -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 +DEFINES = -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC \ -ffast-math $(X11_INCLUDES) CXXFLAGS = $(DEFINES) -Wall -g -ansi -pedantic -fPIC diff --git a/configs/linux-solo b/configs/linux-solo index 8a9031a3363..37e13ee557c 100644 --- a/configs/linux-solo +++ b/configs/linux-solo @@ -11,20 +11,21 @@ CXX = g++ WARN_FLAGS = -Wall -Wundef OPT_FLAGS = -O3 -g PIC_FLAGS = -fPIC - + # Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. ARCH_FLAGS ?= DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ -D_BSD_SOURCE -D_GNU_SOURCE \ - -DDRI_NEW_INTERFACE_ONLY -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DDRM_USE_MALLOC + -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DDRM_USE_MALLOC -DIN_DRI_DRIVER -CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ - $(ASM_FLAGS) -std=c99 -ffast-math +CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ + $(ASM_FLAGS) -std=c99 -ffast-math CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) -ASM_SOURCES = + +ASM_SOURCES = # Library/program dependencies DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl -L$(LIB_DIR) -lEGL -l$(GL_LIB) diff --git a/configs/linux-solo-ia64 b/configs/linux-solo-ia64 index ec7a794e5a3..b2051fac855 100644 --- a/configs/linux-solo-ia64 +++ b/configs/linux-solo-ia64 @@ -1,29 +1,7 @@ # Configuration for linux-solo-ia64: Linux DRI hardware drivers for fbdev -include $(TOP)/configs/default +include $(TOP)/configs/linux-solo CONFIG_NAME = linux-solo-ia64 -# Compiler and flags -CC = gcc -CXX = g++ - -DEFINES = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE -DDRM_USE_MALLOC - -CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math - -CXXFLAGS = $(DEFINES) -Wall -O3 -ansi -pedantic -fPIC - - -# Library/program dependencies -DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl -GL_LIB_DEPS = -lm -lpthread -ldl -GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm -APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread - -# Directories -SRC_DIRS = mesa glx/mini glu glut/mini -DRIVER_DIRS = dri -PROGRAM_DIRS = miniglx - DRI_DIRS = fb mach64 mga r128 r200 radeon sis tdfx unichrome diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 1b1aeba55f9..08d3844266c 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -38,7 +38,7 @@ #ifndef DRI_INTERFACE_H #define DRI_INTERFACE_H -#ifndef DRI_NEW_INTERFACE_ONLY +#if 0 /*ndef DRI_NEW_INTERFACE_ONLY*/ # include # include # include "GL/glxint.h" @@ -72,10 +72,6 @@ typedef void __DRInativeDisplay; * \name Functions provided by the driver loader. */ /*@{*/ -extern __DRIscreen *__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn); - - - /** * Type of a pointer to \c glXGetScreenDriver, as returned by * \c glXGetProcAddress. This function is used to get the name of the DRI @@ -96,26 +92,11 @@ typedef const char * (* PFNGLXGETSCREENDRIVERPROC) (__DRInativeDisplay *dpy, int typedef const char * (* PFNGLXGETDRIVERCONFIGPROC) (const char *driverName); /** - * Type of a pointer to \c __glXScrEnableExtension, as returned by - * \c glXGetProcAddress. This function is used to enable a GLX extension - * on the specified screen. - * - * \sa __glXScrEnableExtension, glXGetProcAddress + * Type of a pointer to \c glxEnableExtension, as returned by + * \c __DRIinterfaceMethods::getProcAddress. This function is used to enable + * a GLX extension on the specified screen. */ typedef void (* PFNGLXSCRENABLEEXTENSIONPROC) ( void *psc, const char * name ); - - -/* Test for the xf86dri.h header file */ -#ifndef _XF86DRI_H_ -extern GLboolean XF86DRIDestroyContext( __DRInativeDisplay *dpy, int screen, - __DRIid context_id ); - -extern GLboolean XF86DRICreateDrawable( __DRInativeDisplay *dpy, int screen, - __DRIid drawable, drm_drawable_t *hHWDrawable ); - -extern GLboolean XF86DRIDestroyDrawable( __DRInativeDisplay *dpy, int screen, - __DRIid drawable); -#endif /*@}*/ diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c index 66567b83138..25be081b03d 100644 --- a/src/glx/x11/glxext.c +++ b/src/glx/x11/glxext.c @@ -111,6 +111,10 @@ static int _mesa_sparc_needs_init = 1; #define INIT_MESA_SPARC #endif +#ifdef GLX_DIRECT_RENDERING +static __DRIscreen *__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn); +#endif /* GLX_DIRECT_RENDERING */ + static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext gc); -- cgit v1.2.3 From 9f23a3a1bff6c8af93e651273c9887bbf119f555 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 28 Jul 2005 00:11:10 +0000 Subject: Fix SPARC assembly for 64-bit - The test for whether or not we're building for 64-bit is '#ifdef __arch64__'. This appears to be correct on both Linux and Solaris. - The test for Solaris is now '#if defined(SVR4) || defined(__SVR4) || defined(__svr4__)'. GCC 3.4.0 has all three defined on Solaris 9. - Enables assembly language clip routines. - Fixes to make GLSL code build on Solaris. - Update gl_SPARC_asm.py. --- configs/linux-sparc | 24 +- configs/sunos5-gcc | 30 +- include/GL/glxext.h | 11 +- src/mesa/glapi/gl_SPARC_asm.py | 33 +- src/mesa/glapi/glapi.c | 10 +- src/mesa/shader/grammar/grammar.c | 24 +- src/mesa/sparc/clip.S | 4 +- src/mesa/sparc/glapi_sparc.S | 21133 ++++-------------------------------- src/mesa/sparc/norm.S | 6 +- src/mesa/sparc/sparc.c | 8 +- src/mesa/sparc/sparc_matrix.h | 2 +- src/mesa/sparc/xform.S | 4 +- 12 files changed, 1961 insertions(+), 19328 deletions(-) (limited to 'include') diff --git a/configs/linux-sparc b/configs/linux-sparc index 564c5ba7f67..15e0b6d4bb4 100644 --- a/configs/linux-sparc +++ b/configs/linux-sparc @@ -7,10 +7,24 @@ CONFIG_NAME = linux-sparc # Compiler and flags CC = gcc CXX = g++ -CFLAGS = -O2 -ffast-math -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -CXXFLAGS = -O2 -ffast-math -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE + +WARN_FLAGS = -Wall +OPT_FLAGS = -O2 +PIC_FLAGS = -fPIC + +DEFINES = -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM + +X11_INCLUDES = -I/usr/X11R6/include + +CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ + $(ASM_FLAGS) -std=c99 -ffast-math + +CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) + GLUT_CFLAGS = -fexceptions -GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11 +EXTRA_LIB_PATH=-L/usr/X11R6/lib + +GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread +GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lm +GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lXt -lX11 diff --git a/configs/sunos5-gcc b/configs/sunos5-gcc index ba32c7e2d0a..7917c9b004d 100644 --- a/configs/sunos5-gcc +++ b/configs/sunos5-gcc @@ -4,18 +4,32 @@ include $(TOP)/configs/default CONFIG_NAME = sunos5-gcc -ASM_SOURCES = $(SPARC_SOURCES) $(SPARC_API) - # Compiler and flags CC = gcc CXX = g++ -CFLAGS = -O3 -I/usr/openwin/include -fPIC -fomit-frame-pointer -D_REENTRANT -DUSE_XSHM -DUSE_SPARC_ASM -CXXFLAGS = -O3 -I/usr/openwin/include -fPIC -fomit-frame-pointer -D_REENTRANT -DUSE_SPARC_ASM + +WARN_FLAGS = -Wall +OPT_FLAGS = -O3 -g -fomit-frame-pointer -pipe +PIC_FLAGS = -fPIC + +ARCH_FLAGS ?= + +DEFINES = -D_REENTRANT -DUSE_XSHM + +ASM_SOURCES = $(SPARC_SOURCES) $(SPARC_API) +ASM_FLAGS = -DUSE_SPARC_ASM + +CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ + $(ASM_FLAGS) -std=c99 -ffast-math -I/usr/openwin/include + +CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ + -I/usr/openwin/include + GLUT_CFLAGS = -fexceptions -DSOLARIS_2_4_BUG -GL_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm -GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm +# Library/program dependencies +EXTRA_LIB_PATH=-L/usr/openwin/lib + +GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXi -lm GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm -GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11 APP_LIB_DEPS = -L$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm - diff --git a/include/GL/glxext.h b/include/GL/glxext.h index 068f1c0667f..ed38b489d83 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -331,7 +331,16 @@ typedef struct { } GLXBufferClobberEventSGIX; #endif -#if defined(__UNIXOS2__) || defined(__SOL64__) +#if defined(__sun__) +#include +#if defined(__STDC__) +#if defined(__arch64__) +typedef long int int64_t; +#else +typedef long long int int64_t; +#endif /* __arch64__ */ +#endif /* __STDC__ */ +#elif defined(__UNIXOS2__) || defined(__SOL64__) typedef long int int32_t; typedef long long int int64_t; #elif defined( __VMS ) diff --git a/src/mesa/glapi/gl_SPARC_asm.py b/src/mesa/glapi/gl_SPARC_asm.py index 9be4849010d..1a8823cc405 100644 --- a/src/mesa/glapi/gl_SPARC_asm.py +++ b/src/mesa/glapi/gl_SPARC_asm.py @@ -40,15 +40,13 @@ class PrintGenericStubs(gl_XML.gl_print_base): def printRealHeader(self): print '#include "glapioffsets.h"' print '' - print '#define GLOBL_FN(x) .globl x ; .type x,#function' - print '' - print '#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__)))' + print '#ifdef __arch64__' print '# define GL_STUB(fn,off)\t\t\t\t\\' - print 'GLOBL_FN(fn) ; fn:\t\t\t\t\t\\' - print '\tsethi\t%hi(0x00000000), %g4 ;\t\t\t\\' - print '\tsethi\t%hi(0x00000000), %g1 ;\t\t\t\\' - print '\tor\t%g4, %lo(0x00000000), %g4 ;\t\t\\' - print '\tor\t%g1, %lo(0x00000000), %g1 ;\t\t\\' + print 'fn:\t\t\t\t\t\\' + print '\tsethi\t%hi(0xDEADBEEF), %g4 ;\t\t\t\\' + print '\tsethi\t%hi(0xDEADBEEF), %g1 ;\t\t\t\\' + print '\tor\t%g4, %lo(0xDEADBEEF), %g4 ;\t\t\\' + print '\tor\t%g1, %lo(0xDEADBEEF), %g1 ;\t\t\\' print '\tsllx\t%g4, 32, %g4 ;\t\t\t\t\\' print '\tldx\t[%g1 + %g4], %g1 ;\t\t\t\\' print '\tsethi\t%hi(8 * off), %g4 ;\t\t\t\\' @@ -58,19 +56,19 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '\tnop' print '#else' print '# define GL_STUB(fn,off)\t\t\t\t\\' - print 'GLOBL_FN(fn) ; fn:\t\t\t\t\t\\' - print '\tsethi\t%hi(0x00000000), %g1 ;\t\t\t\\' - print '\tld\t[%g1 + %lo(0x00000000)], %g1 ;\t\t\\' + print 'fn:\t\t\t\t\t\\' + print '\tsethi\t%hi(0xDEADBEEF), %g1 ;\t\t\t\\' + print '\tld\t[%g1 + %lo(0xDEADBEEF)], %g1 ;\t\t\\' print '\tld\t[%g1 + (4 * off)], %g5 ;\t\t\\' print '\tjmpl\t%g5, %g0 ;\t\t\t\t\\' print '\tnop' print '#endif' print '' - print '#define GL_STUB_ALIAS(fn,alias) GLOBL_FN(fn) ; fn = alias' + print '#define GL_STUB_ALIAS(fn,alias) fn = alias' print '' print '.text' print '.align 32' - print 'GLOBL_FN(__glapi_sparc_icache_flush)' + print '\t\t.globl __glapi_sparc_icache_flush ; .type __glapi_sparc_icache_flush,#function' print '__glapi_sparc_icache_flush: /* %o0 = insn_addr */' print '\tflush\t%o0' print '\tretl' @@ -83,7 +81,10 @@ class PrintGenericStubs(gl_XML.gl_print_base): def printBody(self, api): - print 'GLOBL_FN(_mesa_sparc_glapi_begin)' + for f in api.functionIterateByOffset(): + print '\t\t.globl gl%s ; .type gl%s,#function' % (f.name, f.name) + + print '\t\t.globl _mesa_sparc_glapi_begin ; .type _mesa_sparc_glapi_begin,#function' print '_mesa_sparc_glapi_begin:' print '' @@ -91,7 +92,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '\tGL_STUB(gl%s, _gloffset_%s)' % (f.name, f.name) print '' - print 'GLOBL_FN(_mesa_sparc_glapi_end)' + print '\t\t.globl _mesa_sparc_glapi_end ; .type _mesa_sparc_glapi_end,#function' print '_mesa_sparc_glapi_end:' print '' @@ -99,7 +100,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): for f in api.functionIterateByOffset(): for n in f.entry_points: if n != f.name: - print '\tGL_STUB_ALIAS(gl%s, gl%s)' % (n, f.name) + print '\t.globl gl%s ; .type gl%s,#function ; gl%s = gl%s' % (n, n, n, f.name) return diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index ff0199b833f..5132bebaef5 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -711,7 +711,7 @@ generate_entrypoint(GLuint functionOffset) return (_glapi_proc) code; #elif defined(USE_SPARC_ASM) -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) +#ifdef __arch64__ static const unsigned int insn_template[] = { 0x05000000, /* sethi %uhi(_glapi_Dispatch), %g2 */ 0x03000000, /* sethi %hi(_glapi_Dispatch), %g1 */ @@ -739,7 +739,7 @@ generate_entrypoint(GLuint functionOffset) if (code) { memcpy(code, insn_template, sizeof(insn_template)); -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) +#ifdef __arch64__ code[0] |= (glapi_addr >> (32 + 10)); code[1] |= ((glapi_addr & 0xffffffff) >> 10); __glapi_sparc_icache_flush(&code[0]); @@ -791,17 +791,17 @@ fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset) /* XXX this hasn't been tested! */ unsigned int *code = (unsigned int *) entrypoint; -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) +#ifdef __arch64__ code[6] = 0x05000000; /* sethi %hi(8 * glapioffset), %g2 */ code[7] = 0x8410a000; /* or %g2, %lo(8 * glapioffset), %g2 */ code[6] |= ((offset * 8) >> 10); code[7] |= ((offset * 8) & ((1 << 10) - 1)); __glapi_sparc_icache_flush(&code[6]); -#else /* __sparc_v9__ && !linux */ +#else /* __arch64__ */ code[2] = 0xc6006000; /* ld [%g1 + %lo(4*glapioffset)], %g3 */ code[2] |= (offset * 4); __glapi_sparc_icache_flush(&code[2]); -#endif /* __sparc_v9__ && !linux */ +#endif /* __arch64__ */ #else diff --git a/src/mesa/shader/grammar/grammar.c b/src/mesa/shader/grammar/grammar.c index 2d307f43fe6..0b767c02cd3 100644 --- a/src/mesa/shader/grammar/grammar.c +++ b/src/mesa/shader/grammar/grammar.c @@ -565,24 +565,24 @@ static void emit_destroy (emit **em) static unsigned int emit_size (emit *_E) { - unsigned int _N = 0; + unsigned int n = 0; while (_E != NULL) { if (_E->m_emit_dest == ed_output) { if (_E->m_emit_type == et_position) - _N += 4; /* position is a 32-bit unsigned integer */ + n += 4; /* position is a 32-bit unsigned integer */ else - _N++; + n++; } _E = _E->m_next; } - return _N; + return n; } -static int emit_push (emit *_E, byte *_P, byte _C, unsigned int _Pos, regbyte_ctx **_Ctx) +static int emit_push (emit *_E, byte *_P, byte c, unsigned int _Pos, regbyte_ctx **_Ctx) { while (_E != NULL) { @@ -591,7 +591,7 @@ static int emit_push (emit *_E, byte *_P, byte _C, unsigned int _Pos, regbyte_ct if (_E->m_emit_type == et_byte) *_P++ = _E->m_byte; else if (_E->m_emit_type == et_stream) - *_P++ = _C; + *_P++ = c; else /* _Em->type == et_position */ { *_P++ = (byte) (_Pos); @@ -614,7 +614,7 @@ static int emit_push (emit *_E, byte *_P, byte _C, unsigned int _Pos, regbyte_ct if (_E->m_emit_type == et_byte) new_rbc->m_current_value = _E->m_byte; else if (_E->m_emit_type == et_stream) - new_rbc->m_current_value = _C; + new_rbc->m_current_value = c; } _E = _E->m_next; @@ -1013,22 +1013,22 @@ static void bytepool_create (bytepool **by, int len) } } -static int bytepool_reserve (bytepool *by, unsigned int _N) +static int bytepool_reserve (bytepool *by, unsigned int n) { byte *_P; - if (_N <= by->_Siz) + if (n <= by->_Siz) return 0; /* byte pool can only grow and at least by doubling its size */ - _N = _N >= by->_Siz * 2 ? _N : by->_Siz * 2; + n = n >= by->_Siz * 2 ? n : by->_Siz * 2; /* reallocate the memory and adjust pointers to the new memory location */ - _P = (byte *) (mem_realloc (by->_F, sizeof (byte) * by->_Siz, sizeof (byte) * _N)); + _P = (byte *) (mem_realloc (by->_F, sizeof (byte) * by->_Siz, sizeof (byte) * n)); if (_P != NULL) { by->_F = _P; - by->_Siz = _N; + by->_Siz = n; return 0; } diff --git a/src/mesa/sparc/clip.S b/src/mesa/sparc/clip.S index 4b7e48f8e97..58c228ed151 100644 --- a/src/mesa/sparc/clip.S +++ b/src/mesa/sparc/clip.S @@ -2,7 +2,7 @@ * Clip testing in SPARC assembly */ -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) +#if __arch64__ #define LDPTR ldx #define V4F_DATA 0x00 #define V4F_START 0x08 @@ -25,7 +25,7 @@ #define VEC_SIZE_3 7 #define VEC_SIZE_4 15 -#ifdef SVR4 +#if defined(SVR4) || defined(__SVR4) || defined(__svr4__) /* Solaris requires this for 64-bit. */ .register %g2, #scratch .register %g3, #scratch diff --git a/src/mesa/sparc/glapi_sparc.S b/src/mesa/sparc/glapi_sparc.S index 7654c927d51..175a2819f73 100644 --- a/src/mesa/sparc/glapi_sparc.S +++ b/src/mesa/sparc/glapi_sparc.S @@ -1,14 +1,62 @@ -/* DO NOT EDIT - This file generated automatically with glsparcasm.py script */ +/* DO NOT EDIT - This file generated automatically by gl_SPARC_asm.py (from Mesa) script */ + +/* + * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * (C) Copyright IBM Corporation 2004 + * 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, sub license, + * 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 (including the next + * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL, IBM, + * AND/OR THEIR SUPPLIERS 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. + */ + #include "glapioffsets.h" -/* The _glapi_Dispatch symbol addresses get relocated into the - * sethi/or instruction sequences below at library init time. - */ +#ifdef __arch64__ +# define GL_STUB(fn,off) \ +fn: \ + sethi %hi(0x00000000), %g4 ; \ + sethi %hi(0x00000000), %g1 ; \ + or %g4, %lo(0x00000000), %g4 ; \ + or %g1, %lo(0x00000000), %g1 ; \ + sllx %g4, 32, %g4 ; \ + ldx [%g1 + %g4], %g1 ; \ + sethi %hi(8 * off), %g4 ; \ + or %g4, %lo(8 * off), %g4 ; \ + ldx [%g1 + %g4], %g5 ; \ + jmpl %g5, %g0 ; \ + nop +#else +# define GL_STUB(fn,off) \ +fn: \ + sethi %hi(0x00000000), %g1 ; \ + ld [%g1 + %lo(0x00000000)], %g1 ; \ + ld [%g1 + (4 * off)], %g5 ; \ + jmpl %g5, %g0 ; \ + nop +#endif +#define GL_STUB_ALIAS(fn,alias) fn = alias .text .align 32 -.globl __glapi_sparc_icache_flush + .globl __glapi_sparc_icache_flush ; .type __glapi_sparc_icache_flush,#function __glapi_sparc_icache_flush: /* %o0 = insn_addr */ flush %o0 retl @@ -17,19269 +65,1820 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */ .data .align 64 -.globl _mesa_sparc_glapi_begin -.type _mesa_sparc_glapi_begin,#function + .globl glNewList ; .type glNewList,#function + .globl glEndList ; .type glEndList,#function + .globl glCallList ; .type glCallList,#function + .globl glCallLists ; .type glCallLists,#function + .globl glDeleteLists ; .type glDeleteLists,#function + .globl glGenLists ; .type glGenLists,#function + .globl glListBase ; .type glListBase,#function + .globl glBegin ; .type glBegin,#function + .globl glBitmap ; .type glBitmap,#function + .globl glColor3b ; .type glColor3b,#function + .globl glColor3bv ; .type glColor3bv,#function + .globl glColor3d ; .type glColor3d,#function + .globl glColor3dv ; .type glColor3dv,#function + .globl glColor3f ; .type glColor3f,#function + .globl glColor3fv ; .type glColor3fv,#function + .globl glColor3i ; .type glColor3i,#function + .globl glColor3iv ; .type glColor3iv,#function + .globl glColor3s ; .type glColor3s,#function + .globl glColor3sv ; .type glColor3sv,#function + .globl glColor3ub ; .type glColor3ub,#function + .globl glColor3ubv ; .type glColor3ubv,#function + .globl glColor3ui ; .type glColor3ui,#function + .globl glColor3uiv ; .type glColor3uiv,#function + .globl glColor3us ; .type glColor3us,#function + .globl glColor3usv ; .type glColor3usv,#function + .globl glColor4b ; .type glColor4b,#function + .globl glColor4bv ; .type glColor4bv,#function + .globl glColor4d ; .type glColor4d,#function + .globl glColor4dv ; .type glColor4dv,#function + .globl glColor4f ; .type glColor4f,#function + .globl glColor4fv ; .type glColor4fv,#function + .globl glColor4i ; .type glColor4i,#function + .globl glColor4iv ; .type glColor4iv,#function + .globl glColor4s ; .type glColor4s,#function + .globl glColor4sv ; .type glColor4sv,#function + .globl glColor4ub ; .type glColor4ub,#function + .globl glColor4ubv ; .type glColor4ubv,#function + .globl glColor4ui ; .type glColor4ui,#function + .globl glColor4uiv ; .type glColor4uiv,#function + .globl glColor4us ; .type glColor4us,#function + .globl glColor4usv ; .type glColor4usv,#function + .globl glEdgeFlag ; .type glEdgeFlag,#function + .globl glEdgeFlagv ; .type glEdgeFlagv,#function + .globl glEnd ; .type glEnd,#function + .globl glIndexd ; .type glIndexd,#function + .globl glIndexdv ; .type glIndexdv,#function + .globl glIndexf ; .type glIndexf,#function + .globl glIndexfv ; .type glIndexfv,#function + .globl glIndexi ; .type glIndexi,#function + .globl glIndexiv ; .type glIndexiv,#function + .globl glIndexs ; .type glIndexs,#function + .globl glIndexsv ; .type glIndexsv,#function + .globl glNormal3b ; .type glNormal3b,#function + .globl glNormal3bv ; .type glNormal3bv,#function + .globl glNormal3d ; .type glNormal3d,#function + .globl glNormal3dv ; .type glNormal3dv,#function + .globl glNormal3f ; .type glNormal3f,#function + .globl glNormal3fv ; .type glNormal3fv,#function + .globl glNormal3i ; .type glNormal3i,#function + .globl glNormal3iv ; .type glNormal3iv,#function + .globl glNormal3s ; .type glNormal3s,#function + .globl glNormal3sv ; .type glNormal3sv,#function + .globl glRasterPos2d ; .type glRasterPos2d,#function + .globl glRasterPos2dv ; .type glRasterPos2dv,#function + .globl glRasterPos2f ; .type glRasterPos2f,#function + .globl glRasterPos2fv ; .type glRasterPos2fv,#function + .globl glRasterPos2i ; .type glRasterPos2i,#function + .globl glRasterPos2iv ; .type glRasterPos2iv,#function + .globl glRasterPos2s ; .type glRasterPos2s,#function + .globl glRasterPos2sv ; .type glRasterPos2sv,#function + .globl glRasterPos3d ; .type glRasterPos3d,#function + .globl glRasterPos3dv ; .type glRasterPos3dv,#function + .globl glRasterPos3f ; .type glRasterPos3f,#function + .globl glRasterPos3fv ; .type glRasterPos3fv,#function + .globl glRasterPos3i ; .type glRasterPos3i,#function + .globl glRasterPos3iv ; .type glRasterPos3iv,#function + .globl glRasterPos3s ; .type glRasterPos3s,#function + .globl glRasterPos3sv ; .type glRasterPos3sv,#function + .globl glRasterPos4d ; .type glRasterPos4d,#function + .globl glRasterPos4dv ; .type glRasterPos4dv,#function + .globl glRasterPos4f ; .type glRasterPos4f,#function + .globl glRasterPos4fv ; .type glRasterPos4fv,#function + .globl glRasterPos4i ; .type glRasterPos4i,#function + .globl glRasterPos4iv ; .type glRasterPos4iv,#function + .globl glRasterPos4s ; .type glRasterPos4s,#function + .globl glRasterPos4sv ; .type glRasterPos4sv,#function + .globl glRectd ; .type glRectd,#function + .globl glRectdv ; .type glRectdv,#function + .globl glRectf ; .type glRectf,#function + .globl glRectfv ; .type glRectfv,#function + .globl glRecti ; .type glRecti,#function + .globl glRectiv ; .type glRectiv,#function + .globl glRects ; .type glRects,#function + .globl glRectsv ; .type glRectsv,#function + .globl glTexCoord1d ; .type glTexCoord1d,#function + .globl glTexCoord1dv ; .type glTexCoord1dv,#function + .globl glTexCoord1f ; .type glTexCoord1f,#function + .globl glTexCoord1fv ; .type glTexCoord1fv,#function + .globl glTexCoord1i ; .type glTexCoord1i,#function + .globl glTexCoord1iv ; .type glTexCoord1iv,#function + .globl glTexCoord1s ; .type glTexCoord1s,#function + .globl glTexCoord1sv ; .type glTexCoord1sv,#function + .globl glTexCoord2d ; .type glTexCoord2d,#function + .globl glTexCoord2dv ; .type glTexCoord2dv,#function + .globl glTexCoord2f ; .type glTexCoord2f,#function + .globl glTexCoord2fv ; .type glTexCoord2fv,#function + .globl glTexCoord2i ; .type glTexCoord2i,#function + .globl glTexCoord2iv ; .type glTexCoord2iv,#function + .globl glTexCoord2s ; .type glTexCoord2s,#function + .globl glTexCoord2sv ; .type glTexCoord2sv,#function + .globl glTexCoord3d ; .type glTexCoord3d,#function + .globl glTexCoord3dv ; .type glTexCoord3dv,#function + .globl glTexCoord3f ; .type glTexCoord3f,#function + .globl glTexCoord3fv ; .type glTexCoord3fv,#function + .globl glTexCoord3i ; .type glTexCoord3i,#function + .globl glTexCoord3iv ; .type glTexCoord3iv,#function + .globl glTexCoord3s ; .type glTexCoord3s,#function + .globl glTexCoord3sv ; .type glTexCoord3sv,#function + .globl glTexCoord4d ; .type glTexCoord4d,#function + .globl glTexCoord4dv ; .type glTexCoord4dv,#function + .globl glTexCoord4f ; .type glTexCoord4f,#function + .globl glTexCoord4fv ; .type glTexCoord4fv,#function + .globl glTexCoord4i ; .type glTexCoord4i,#function + .globl glTexCoord4iv ; .type glTexCoord4iv,#function + .globl glTexCoord4s ; .type glTexCoord4s,#function + .globl glTexCoord4sv ; .type glTexCoord4sv,#function + .globl glVertex2d ; .type glVertex2d,#function + .globl glVertex2dv ; .type glVertex2dv,#function + .globl glVertex2f ; .type glVertex2f,#function + .globl glVertex2fv ; .type glVertex2fv,#function + .globl glVertex2i ; .type glVertex2i,#function + .globl glVertex2iv ; .type glVertex2iv,#function + .globl glVertex2s ; .type glVertex2s,#function + .globl glVertex2sv ; .type glVertex2sv,#function + .globl glVertex3d ; .type glVertex3d,#function + .globl glVertex3dv ; .type glVertex3dv,#function + .globl glVertex3f ; .type glVertex3f,#function + .globl glVertex3fv ; .type glVertex3fv,#function + .globl glVertex3i ; .type glVertex3i,#function + .globl glVertex3iv ; .type glVertex3iv,#function + .globl glVertex3s ; .type glVertex3s,#function + .globl glVertex3sv ; .type glVertex3sv,#function + .globl glVertex4d ; .type glVertex4d,#function + .globl glVertex4dv ; .type glVertex4dv,#function + .globl glVertex4f ; .type glVertex4f,#function + .globl glVertex4fv ; .type glVertex4fv,#function + .globl glVertex4i ; .type glVertex4i,#function + .globl glVertex4iv ; .type glVertex4iv,#function + .globl glVertex4s ; .type glVertex4s,#function + .globl glVertex4sv ; .type glVertex4sv,#function + .globl glClipPlane ; .type glClipPlane,#function + .globl glColorMaterial ; .type glColorMaterial,#function + .globl glCullFace ; .type glCullFace,#function + .globl glFogf ; .type glFogf,#function + .globl glFogfv ; .type glFogfv,#function + .globl glFogi ; .type glFogi,#function + .globl glFogiv ; .type glFogiv,#function + .globl glFrontFace ; .type glFrontFace,#function + .globl glHint ; .type glHint,#function + .globl glLightf ; .type glLightf,#function + .globl glLightfv ; .type glLightfv,#function + .globl glLighti ; .type glLighti,#function + .globl glLightiv ; .type glLightiv,#function + .globl glLightModelf ; .type glLightModelf,#function + .globl glLightModelfv ; .type glLightModelfv,#function + .globl glLightModeli ; .type glLightModeli,#function + .globl glLightModeliv ; .type glLightModeliv,#function + .globl glLineStipple ; .type glLineStipple,#function + .globl glLineWidth ; .type glLineWidth,#function + .globl glMaterialf ; .type glMaterialf,#function + .globl glMaterialfv ; .type glMaterialfv,#function + .globl glMateriali ; .type glMateriali,#function + .globl glMaterialiv ; .type glMaterialiv,#function + .globl glPointSize ; .type glPointSize,#function + .globl glPolygonMode ; .type glPolygonMode,#function + .globl glPolygonStipple ; .type glPolygonStipple,#function + .globl glScissor ; .type glScissor,#function + .globl glShadeModel ; .type glShadeModel,#function + .globl glTexParameterf ; .type glTexParameterf,#function + .globl glTexParameterfv ; .type glTexParameterfv,#function + .globl glTexParameteri ; .type glTexParameteri,#function + .globl glTexParameteriv ; .type glTexParameteriv,#function + .globl glTexImage1D ; .type glTexImage1D,#function + .globl glTexImage2D ; .type glTexImage2D,#function + .globl glTexEnvf ; .type glTexEnvf,#function + .globl glTexEnvfv ; .type glTexEnvfv,#function + .globl glTexEnvi ; .type glTexEnvi,#function + .globl glTexEnviv ; .type glTexEnviv,#function + .globl glTexGend ; .type glTexGend,#function + .globl glTexGendv ; .type glTexGendv,#function + .globl glTexGenf ; .type glTexGenf,#function + .globl glTexGenfv ; .type glTexGenfv,#function + .globl glTexGeni ; .type glTexGeni,#function + .globl glTexGeniv ; .type glTexGeniv,#function + .globl glFeedbackBuffer ; .type glFeedbackBuffer,#function + .globl glSelectBuffer ; .type glSelectBuffer,#function + .globl glRenderMode ; .type glRenderMode,#function + .globl glInitNames ; .type glInitNames,#function + .globl glLoadName ; .type glLoadName,#function + .globl glPassThrough ; .type glPassThrough,#function + .globl glPopName ; .type glPopName,#function + .globl glPushName ; .type glPushName,#function + .globl glDrawBuffer ; .type glDrawBuffer,#function + .globl glClear ; .type glClear,#function + .globl glClearAccum ; .type glClearAccum,#function + .globl glClearIndex ; .type glClearIndex,#function + .globl glClearColor ; .type glClearColor,#function + .globl glClearStencil ; .type glClearStencil,#function + .globl glClearDepth ; .type glClearDepth,#function + .globl glStencilMask ; .type glStencilMask,#function + .globl glColorMask ; .type glColorMask,#function + .globl glDepthMask ; .type glDepthMask,#function + .globl glIndexMask ; .type glIndexMask,#function + .globl glAccum ; .type glAccum,#function + .globl glDisable ; .type glDisable,#function + .globl glEnable ; .type glEnable,#function + .globl glFinish ; .type glFinish,#function + .globl glFlush ; .type glFlush,#function + .globl glPopAttrib ; .type glPopAttrib,#function + .globl glPushAttrib ; .type glPushAttrib,#function + .globl glMap1d ; .type glMap1d,#function + .globl glMap1f ; .type glMap1f,#function + .globl glMap2d ; .type glMap2d,#function + .globl glMap2f ; .type glMap2f,#function + .globl glMapGrid1d ; .type glMapGrid1d,#function + .globl glMapGrid1f ; .type glMapGrid1f,#function + .globl glMapGrid2d ; .type glMapGrid2d,#function + .globl glMapGrid2f ; .type glMapGrid2f,#function + .globl glEvalCoord1d ; .type glEvalCoord1d,#function + .globl glEvalCoord1dv ; .type glEvalCoord1dv,#function + .globl glEvalCoord1f ; .type glEvalCoord1f,#function + .globl glEvalCoord1fv ; .type glEvalCoord1fv,#function + .globl glEvalCoord2d ; .type glEvalCoord2d,#function + .globl glEvalCoord2dv ; .type glEvalCoord2dv,#function + .globl glEvalCoord2f ; .type glEvalCoord2f,#function + .globl glEvalCoord2fv ; .type glEvalCoord2fv,#function + .globl glEvalMesh1 ; .type glEvalMesh1,#function + .globl glEvalPoint1 ; .type glEvalPoint1,#function + .globl glEvalMesh2 ; .type glEvalMesh2,#function + .globl glEvalPoint2 ; .type glEvalPoint2,#function + .globl glAlphaFunc ; .type glAlphaFunc,#function + .globl glBlendFunc ; .type glBlendFunc,#function + .globl glLogicOp ; .type glLogicOp,#function + .globl glStencilFunc ; .type glStencilFunc,#function + .globl glStencilOp ; .type glStencilOp,#function + .globl glDepthFunc ; .type glDepthFunc,#function + .globl glPixelZoom ; .type glPixelZoom,#function + .globl glPixelTransferf ; .type glPixelTransferf,#function + .globl glPixelTransferi ; .type glPixelTransferi,#function + .globl glPixelStoref ; .type glPixelStoref,#function + .globl glPixelStorei ; .type glPixelStorei,#function + .globl glPixelMapfv ; .type glPixelMapfv,#function + .globl glPixelMapuiv ; .type glPixelMapuiv,#function + .globl glPixelMapusv ; .type glPixelMapusv,#function + .globl glReadBuffer ; .type glReadBuffer,#function + .globl glCopyPixels ; .type glCopyPixels,#function + .globl glReadPixels ; .type glReadPixels,#function + .globl glDrawPixels ; .type glDrawPixels,#function + .globl glGetBooleanv ; .type glGetBooleanv,#function + .globl glGetClipPlane ; .type glGetClipPlane,#function + .globl glGetDoublev ; .type glGetDoublev,#function + .globl glGetError ; .type glGetError,#function + .globl glGetFloatv ; .type glGetFloatv,#function + .globl glGetIntegerv ; .type glGetIntegerv,#function + .globl glGetLightfv ; .type glGetLightfv,#function + .globl glGetLightiv ; .type glGetLightiv,#function + .globl glGetMapdv ; .type glGetMapdv,#function + .globl glGetMapfv ; .type glGetMapfv,#function + .globl glGetMapiv ; .type glGetMapiv,#function + .globl glGetMaterialfv ; .type glGetMaterialfv,#function + .globl glGetMaterialiv ; .type glGetMaterialiv,#function + .globl glGetPixelMapfv ; .type glGetPixelMapfv,#function + .globl glGetPixelMapuiv ; .type glGetPixelMapuiv,#function + .globl glGetPixelMapusv ; .type glGetPixelMapusv,#function + .globl glGetPolygonStipple ; .type glGetPolygonStipple,#function + .globl glGetString ; .type glGetString,#function + .globl glGetTexEnvfv ; .type glGetTexEnvfv,#function + .globl glGetTexEnviv ; .type glGetTexEnviv,#function + .globl glGetTexGendv ; .type glGetTexGendv,#function + .globl glGetTexGenfv ; .type glGetTexGenfv,#function + .globl glGetTexGeniv ; .type glGetTexGeniv,#function + .globl glGetTexImage ; .type glGetTexImage,#function + .globl glGetTexParameterfv ; .type glGetTexParameterfv,#function + .globl glGetTexParameteriv ; .type glGetTexParameteriv,#function + .globl glGetTexLevelParameterfv ; .type glGetTexLevelParameterfv,#function + .globl glGetTexLevelParameteriv ; .type glGetTexLevelParameteriv,#function + .globl glIsEnabled ; .type glIsEnabled,#function + .globl glIsList ; .type glIsList,#function + .globl glDepthRange ; .type glDepthRange,#function + .globl glFrustum ; .type glFrustum,#function + .globl glLoadIdentity ; .type glLoadIdentity,#function + .globl glLoadMatrixf ; .type glLoadMatrixf,#function + .globl glLoadMatrixd ; .type glLoadMatrixd,#function + .globl glMatrixMode ; .type glMatrixMode,#function + .globl glMultMatrixf ; .type glMultMatrixf,#function + .globl glMultMatrixd ; .type glMultMatrixd,#function + .globl glOrtho ; .type glOrtho,#function + .globl glPopMatrix ; .type glPopMatrix,#function + .globl glPushMatrix ; .type glPushMatrix,#function + .globl glRotated ; .type glRotated,#function + .globl glRotatef ; .type glRotatef,#function + .globl glScaled ; .type glScaled,#function + .globl glScalef ; .type glScalef,#function + .globl glTranslated ; .type glTranslated,#function + .globl glTranslatef ; .type glTranslatef,#function + .globl glViewport ; .type glViewport,#function + .globl glArrayElement ; .type glArrayElement,#function + .globl glBindTexture ; .type glBindTexture,#function + .globl glColorPointer ; .type glColorPointer,#function + .globl glDisableClientState ; .type glDisableClientState,#function + .globl glDrawArrays ; .type glDrawArrays,#function + .globl glDrawElements ; .type glDrawElements,#function + .globl glEdgeFlagPointer ; .type glEdgeFlagPointer,#function + .globl glEnableClientState ; .type glEnableClientState,#function + .globl glIndexPointer ; .type glIndexPointer,#function + .globl glIndexub ; .type glIndexub,#function + .globl glIndexubv ; .type glIndexubv,#function + .globl glInterleavedArrays ; .type glInterleavedArrays,#function + .globl glNormalPointer ; .type glNormalPointer,#function + .globl glPolygonOffset ; .type glPolygonOffset,#function + .globl glTexCoordPointer ; .type glTexCoordPointer,#function + .globl glVertexPointer ; .type glVertexPointer,#function + .globl glAreTexturesResident ; .type glAreTexturesResident,#function + .globl glCopyTexImage1D ; .type glCopyTexImage1D,#function + .globl glCopyTexImage2D ; .type glCopyTexImage2D,#function + .globl glCopyTexSubImage1D ; .type glCopyTexSubImage1D,#function + .globl glCopyTexSubImage2D ; .type glCopyTexSubImage2D,#function + .globl glDeleteTextures ; .type glDeleteTextures,#function + .globl glGenTextures ; .type glGenTextures,#function + .globl glGetPointerv ; .type glGetPointerv,#function + .globl glIsTexture ; .type glIsTexture,#function + .globl glPrioritizeTextures ; .type glPrioritizeTextures,#function + .globl glTexSubImage1D ; .type glTexSubImage1D,#function + .globl glTexSubImage2D ; .type glTexSubImage2D,#function + .globl glPopClientAttrib ; .type glPopClientAttrib,#function + .globl glPushClientAttrib ; .type glPushClientAttrib,#function + .globl glBlendColor ; .type glBlendColor,#function + .globl glBlendEquation ; .type glBlendEquation,#function + .globl glDrawRangeElements ; .type glDrawRangeElements,#function + .globl glColorTable ; .type glColorTable,#function + .globl glColorTableParameterfv ; .type glColorTableParameterfv,#function + .globl glColorTableParameteriv ; .type glColorTableParameteriv,#function + .globl glCopyColorTable ; .type glCopyColorTable,#function + .globl glGetColorTable ; .type glGetColorTable,#function + .globl glGetColorTableParameterfv ; .type glGetColorTableParameterfv,#function + .globl glGetColorTableParameteriv ; .type glGetColorTableParameteriv,#function + .globl glColorSubTable ; .type glColorSubTable,#function + .globl glCopyColorSubTable ; .type glCopyColorSubTable,#function + .globl glConvolutionFilter1D ; .type glConvolutionFilter1D,#function + .globl glConvolutionFilter2D ; .type glConvolutionFilter2D,#function + .globl glConvolutionParameterf ; .type glConvolutionParameterf,#function + .globl glConvolutionParameterfv ; .type glConvolutionParameterfv,#function + .globl glConvolutionParameteri ; .type glConvolutionParameteri,#function + .globl glConvolutionParameteriv ; .type glConvolutionParameteriv,#function + .globl glCopyConvolutionFilter1D ; .type glCopyConvolutionFilter1D,#function + .globl glCopyConvolutionFilter2D ; .type glCopyConvolutionFilter2D,#function + .globl glGetConvolutionFilter ; .type glGetConvolutionFilter,#function + .globl glGetConvolutionParameterfv ; .type glGetConvolutionParameterfv,#function + .globl glGetConvolutionParameteriv ; .type glGetConvolutionParameteriv,#function + .globl glGetSeparableFilter ; .type glGetSeparableFilter,#function + .globl glSeparableFilter2D ; .type glSeparableFilter2D,#function + .globl glGetHistogram ; .type glGetHistogram,#function + .globl glGetHistogramParameterfv ; .type glGetHistogramParameterfv,#function + .globl glGetHistogramParameteriv ; .type glGetHistogramParameteriv,#function + .globl glGetMinmax ; .type glGetMinmax,#function + .globl glGetMinmaxParameterfv ; .type glGetMinmaxParameterfv,#function + .globl glGetMinmaxParameteriv ; .type glGetMinmaxParameteriv,#function + .globl glHistogram ; .type glHistogram,#function + .globl glMinmax ; .type glMinmax,#function + .globl glResetHistogram ; .type glResetHistogram,#function + .globl glResetMinmax ; .type glResetMinmax,#function + .globl glTexImage3D ; .type glTexImage3D,#function + .globl glTexSubImage3D ; .type glTexSubImage3D,#function + .globl glCopyTexSubImage3D ; .type glCopyTexSubImage3D,#function + .globl glActiveTextureARB ; .type glActiveTextureARB,#function + .globl glClientActiveTextureARB ; .type glClientActiveTextureARB,#function + .globl glMultiTexCoord1dARB ; .type glMultiTexCoord1dARB,#function + .globl glMultiTexCoord1dvARB ; .type glMultiTexCoord1dvARB,#function + .globl glMultiTexCoord1fARB ; .type glMultiTexCoord1fARB,#function + .globl glMultiTexCoord1fvARB ; .type glMultiTexCoord1fvARB,#function + .globl glMultiTexCoord1iARB ; .type glMultiTexCoord1iARB,#function + .globl glMultiTexCoord1ivARB ; .type glMultiTexCoord1ivARB,#function + .globl glMultiTexCoord1sARB ; .type glMultiTexCoord1sARB,#function + .globl glMultiTexCoord1svARB ; .type glMultiTexCoord1svARB,#function + .globl glMultiTexCoord2dARB ; .type glMultiTexCoord2dARB,#function + .globl glMultiTexCoord2dvARB ; .type glMultiTexCoord2dvARB,#function + .globl glMultiTexCoord2fARB ; .type glMultiTexCoord2fARB,#function + .globl glMultiTexCoord2fvARB ; .type glMultiTexCoord2fvARB,#function + .globl glMultiTexCoord2iARB ; .type glMultiTexCoord2iARB,#function + .globl glMultiTexCoord2ivARB ; .type glMultiTexCoord2ivARB,#function + .globl glMultiTexCoord2sARB ; .type glMultiTexCoord2sARB,#function + .globl glMultiTexCoord2svARB ; .type glMultiTexCoord2svARB,#function + .globl glMultiTexCoord3dARB ; .type glMultiTexCoord3dARB,#function + .globl glMultiTexCoord3dvARB ; .type glMultiTexCoord3dvARB,#function + .globl glMultiTexCoord3fARB ; .type glMultiTexCoord3fARB,#function + .globl glMultiTexCoord3fvARB ; .type glMultiTexCoord3fvARB,#function + .globl glMultiTexCoord3iARB ; .type glMultiTexCoord3iARB,#function + .globl glMultiTexCoord3ivARB ; .type glMultiTexCoord3ivARB,#function + .globl glMultiTexCoord3sARB ; .type glMultiTexCoord3sARB,#function + .globl glMultiTexCoord3svARB ; .type glMultiTexCoord3svARB,#function + .globl glMultiTexCoord4dARB ; .type glMultiTexCoord4dARB,#function + .globl glMultiTexCoord4dvARB ; .type glMultiTexCoord4dvARB,#function + .globl glMultiTexCoord4fARB ; .type glMultiTexCoord4fARB,#function + .globl glMultiTexCoord4fvARB ; .type glMultiTexCoord4fvARB,#function + .globl glMultiTexCoord4iARB ; .type glMultiTexCoord4iARB,#function + .globl glMultiTexCoord4ivARB ; .type glMultiTexCoord4ivARB,#function + .globl glMultiTexCoord4sARB ; .type glMultiTexCoord4sARB,#function + .globl glMultiTexCoord4svARB ; .type glMultiTexCoord4svARB,#function + .globl glLoadTransposeMatrixfARB ; .type glLoadTransposeMatrixfARB,#function + .globl glLoadTransposeMatrixdARB ; .type glLoadTransposeMatrixdARB,#function + .globl glMultTransposeMatrixfARB ; .type glMultTransposeMatrixfARB,#function + .globl glMultTransposeMatrixdARB ; .type glMultTransposeMatrixdARB,#function + .globl glSampleCoverageARB ; .type glSampleCoverageARB,#function + .globl glDrawBuffersARB ; .type glDrawBuffersARB,#function + .globl glPolygonOffsetEXT ; .type glPolygonOffsetEXT,#function + .globl glGetTexFilterFuncSGIS ; .type glGetTexFilterFuncSGIS,#function + .globl glTexFilterFuncSGIS ; .type glTexFilterFuncSGIS,#function + .globl glGetHistogramEXT ; .type glGetHistogramEXT,#function + .globl glGetHistogramParameterfvEXT ; .type glGetHistogramParameterfvEXT,#function + .globl glGetHistogramParameterivEXT ; .type glGetHistogramParameterivEXT,#function + .globl glGetMinmaxEXT ; .type glGetMinmaxEXT,#function + .globl glGetMinmaxParameterfvEXT ; .type glGetMinmaxParameterfvEXT,#function + .globl glGetMinmaxParameterivEXT ; .type glGetMinmaxParameterivEXT,#function + .globl glGetConvolutionFilterEXT ; .type glGetConvolutionFilterEXT,#function + .globl glGetConvolutionParameterfvEXT ; .type glGetConvolutionParameterfvEXT,#function + .globl glGetConvolutionParameterivEXT ; .type glGetConvolutionParameterivEXT,#function + .globl glGetSeparableFilterEXT ; .type glGetSeparableFilterEXT,#function + .globl glGetColorTableSGI ; .type glGetColorTableSGI,#function + .globl glGetColorTableParameterfvSGI ; .type glGetColorTableParameterfvSGI,#function + .globl glGetColorTableParameterivSGI ; .type glGetColorTableParameterivSGI,#function + .globl glPixelTexGenSGIX ; .type glPixelTexGenSGIX,#function + .globl glPixelTexGenParameteriSGIS ; .type glPixelTexGenParameteriSGIS,#function + .globl glPixelTexGenParameterivSGIS ; .type glPixelTexGenParameterivSGIS,#function + .globl glPixelTexGenParameterfSGIS ; .type glPixelTexGenParameterfSGIS,#function + .globl glPixelTexGenParameterfvSGIS ; .type glPixelTexGenParameterfvSGIS,#function + .globl glGetPixelTexGenParameterivSGIS ; .type glGetPixelTexGenParameterivSGIS,#function + .globl glGetPixelTexGenParameterfvSGIS ; .type glGetPixelTexGenParameterfvSGIS,#function + .globl glTexImage4DSGIS ; .type glTexImage4DSGIS,#function + .globl glTexSubImage4DSGIS ; .type glTexSubImage4DSGIS,#function + .globl glAreTexturesResidentEXT ; .type glAreTexturesResidentEXT,#function + .globl glGenTexturesEXT ; .type glGenTexturesEXT,#function + .globl glIsTextureEXT ; .type glIsTextureEXT,#function + .globl glDetailTexFuncSGIS ; .type glDetailTexFuncSGIS,#function + .globl glGetDetailTexFuncSGIS ; .type glGetDetailTexFuncSGIS,#function + .globl glSharpenTexFuncSGIS ; .type glSharpenTexFuncSGIS,#function + .globl glGetSharpenTexFuncSGIS ; .type glGetSharpenTexFuncSGIS,#function + .globl glSampleMaskSGIS ; .type glSampleMaskSGIS,#function + .globl glSamplePatternSGIS ; .type glSamplePatternSGIS,#function + .globl glColorPointerEXT ; .type glColorPointerEXT,#function + .globl glEdgeFlagPointerEXT ; .type glEdgeFlagPointerEXT,#function + .globl glIndexPointerEXT ; .type glIndexPointerEXT,#function + .globl glNormalPointerEXT ; .type glNormalPointerEXT,#function + .globl glTexCoordPointerEXT ; .type glTexCoordPointerEXT,#function + .globl glVertexPointerEXT ; .type glVertexPointerEXT,#function + .globl glSpriteParameterfSGIX ; .type glSpriteParameterfSGIX,#function + .globl glSpriteParameterfvSGIX ; .type glSpriteParameterfvSGIX,#function + .globl glSpriteParameteriSGIX ; .type glSpriteParameteriSGIX,#function + .globl glSpriteParameterivSGIX ; .type glSpriteParameterivSGIX,#function + .globl glPointParameterfEXT ; .type glPointParameterfEXT,#function + .globl glPointParameterfvEXT ; .type glPointParameterfvEXT,#function + .globl glGetInstrumentsSGIX ; .type glGetInstrumentsSGIX,#function + .globl glInstrumentsBufferSGIX ; .type glInstrumentsBufferSGIX,#function + .globl glPollInstrumentsSGIX ; .type glPollInstrumentsSGIX,#function + .globl glReadInstrumentsSGIX ; .type glReadInstrumentsSGIX,#function + .globl glStartInstrumentsSGIX ; .type glStartInstrumentsSGIX,#function + .globl glStopInstrumentsSGIX ; .type glStopInstrumentsSGIX,#function + .globl glFrameZoomSGIX ; .type glFrameZoomSGIX,#function + .globl glTagSampleBufferSGIX ; .type glTagSampleBufferSGIX,#function + .globl glReferencePlaneSGIX ; .type glReferencePlaneSGIX,#function + .globl glFlushRasterSGIX ; .type glFlushRasterSGIX,#function + .globl glGetListParameterfvSGIX ; .type glGetListParameterfvSGIX,#function + .globl glGetListParameterivSGIX ; .type glGetListParameterivSGIX,#function + .globl glListParameterfSGIX ; .type glListParameterfSGIX,#function + .globl glListParameterfvSGIX ; .type glListParameterfvSGIX,#function + .globl glListParameteriSGIX ; .type glListParameteriSGIX,#function + .globl glListParameterivSGIX ; .type glListParameterivSGIX,#function + .globl glFragmentColorMaterialSGIX ; .type glFragmentColorMaterialSGIX,#function + .globl glFragmentLightfSGIX ; .type glFragmentLightfSGIX,#function + .globl glFragmentLightfvSGIX ; .type glFragmentLightfvSGIX,#function + .globl glFragmentLightiSGIX ; .type glFragmentLightiSGIX,#function + .globl glFragmentLightivSGIX ; .type glFragmentLightivSGIX,#function + .globl glFragmentLightModelfSGIX ; .type glFragmentLightModelfSGIX,#function + .globl glFragmentLightModelfvSGIX ; .type glFragmentLightModelfvSGIX,#function + .globl glFragmentLightModeliSGIX ; .type glFragmentLightModeliSGIX,#function + .globl glFragmentLightModelivSGIX ; .type glFragmentLightModelivSGIX,#function + .globl glFragmentMaterialfSGIX ; .type glFragmentMaterialfSGIX,#function + .globl glFragmentMaterialfvSGIX ; .type glFragmentMaterialfvSGIX,#function + .globl glFragmentMaterialiSGIX ; .type glFragmentMaterialiSGIX,#function + .globl glFragmentMaterialivSGIX ; .type glFragmentMaterialivSGIX,#function + .globl glGetFragmentLightfvSGIX ; .type glGetFragmentLightfvSGIX,#function + .globl glGetFragmentLightivSGIX ; .type glGetFragmentLightivSGIX,#function + .globl glGetFragmentMaterialfvSGIX ; .type glGetFragmentMaterialfvSGIX,#function + .globl glGetFragmentMaterialivSGIX ; .type glGetFragmentMaterialivSGIX,#function + .globl glLightEnviSGIX ; .type glLightEnviSGIX,#function + .globl glVertexWeightfEXT ; .type glVertexWeightfEXT,#function + .globl glVertexWeightfvEXT ; .type glVertexWeightfvEXT,#function + .globl glVertexWeightPointerEXT ; .type glVertexWeightPointerEXT,#function + .globl glFlushVertexArrayRangeNV ; .type glFlushVertexArrayRangeNV,#function + .globl glVertexArrayRangeNV ; .type glVertexArrayRangeNV,#function + .globl glCombinerParameterfvNV ; .type glCombinerParameterfvNV,#function + .globl glCombinerParameterfNV ; .type glCombinerParameterfNV,#function + .globl glCombinerParameterivNV ; .type glCombinerParameterivNV,#function + .globl glCombinerParameteriNV ; .type glCombinerParameteriNV,#function + .globl glCombinerInputNV ; .type glCombinerInputNV,#function + .globl glCombinerOutputNV ; .type glCombinerOutputNV,#function + .globl glFinalCombinerInputNV ; .type glFinalCombinerInputNV,#function + .globl glGetCombinerInputParameterfvNV ; .type glGetCombinerInputParameterfvNV,#function + .globl glGetCombinerInputParameterivNV ; .type glGetCombinerInputParameterivNV,#function + .globl glGetCombinerOutputParameterfvNV ; .type glGetCombinerOutputParameterfvNV,#function + .globl glGetCombinerOutputParameterivNV ; .type glGetCombinerOutputParameterivNV,#function + .globl glGetFinalCombinerInputParameterfvNV ; .type glGetFinalCombinerInputParameterfvNV,#function + .globl glGetFinalCombinerInputParameterivNV ; .type glGetFinalCombinerInputParameterivNV,#function + .globl glResizeBuffersMESA ; .type glResizeBuffersMESA,#function + .globl glWindowPos2dMESA ; .type glWindowPos2dMESA,#function + .globl glWindowPos2dvMESA ; .type glWindowPos2dvMESA,#function + .globl glWindowPos2fMESA ; .type glWindowPos2fMESA,#function + .globl glWindowPos2fvMESA ; .type glWindowPos2fvMESA,#function + .globl glWindowPos2iMESA ; .type glWindowPos2iMESA,#function + .globl glWindowPos2ivMESA ; .type glWindowPos2ivMESA,#function + .globl glWindowPos2sMESA ; .type glWindowPos2sMESA,#function + .globl glWindowPos2svMESA ; .type glWindowPos2svMESA,#function + .globl glWindowPos3dMESA ; .type glWindowPos3dMESA,#function + .globl glWindowPos3dvMESA ; .type glWindowPos3dvMESA,#function + .globl glWindowPos3fMESA ; .type glWindowPos3fMESA,#function + .globl glWindowPos3fvMESA ; .type glWindowPos3fvMESA,#function + .globl glWindowPos3iMESA ; .type glWindowPos3iMESA,#function + .globl glWindowPos3ivMESA ; .type glWindowPos3ivMESA,#function + .globl glWindowPos3sMESA ; .type glWindowPos3sMESA,#function + .globl glWindowPos3svMESA ; .type glWindowPos3svMESA,#function + .globl glWindowPos4dMESA ; .type glWindowPos4dMESA,#function + .globl glWindowPos4dvMESA ; .type glWindowPos4dvMESA,#function + .globl glWindowPos4fMESA ; .type glWindowPos4fMESA,#function + .globl glWindowPos4fvMESA ; .type glWindowPos4fvMESA,#function + .globl glWindowPos4iMESA ; .type glWindowPos4iMESA,#function + .globl glWindowPos4ivMESA ; .type glWindowPos4ivMESA,#function + .globl glWindowPos4sMESA ; .type glWindowPos4sMESA,#function + .globl glWindowPos4svMESA ; .type glWindowPos4svMESA,#function + .globl glBlendFuncSeparateEXT ; .type glBlendFuncSeparateEXT,#function + .globl glIndexMaterialEXT ; .type glIndexMaterialEXT,#function + .globl glIndexFuncEXT ; .type glIndexFuncEXT,#function + .globl glLockArraysEXT ; .type glLockArraysEXT,#function + .globl glUnlockArraysEXT ; .type glUnlockArraysEXT,#function + .globl glCullParameterdvEXT ; .type glCullParameterdvEXT,#function + .globl glCullParameterfvEXT ; .type glCullParameterfvEXT,#function + .globl glHintPGI ; .type glHintPGI,#function + .globl glFogCoordfEXT ; .type glFogCoordfEXT,#function + .globl glFogCoordfvEXT ; .type glFogCoordfvEXT,#function + .globl glFogCoorddEXT ; .type glFogCoorddEXT,#function + .globl glFogCoorddvEXT ; .type glFogCoorddvEXT,#function + .globl glFogCoordPointerEXT ; .type glFogCoordPointerEXT,#function + .globl glGetColorTableEXT ; .type glGetColorTableEXT,#function + .globl glGetColorTableParameterivEXT ; .type glGetColorTableParameterivEXT,#function + .globl glGetColorTableParameterfvEXT ; .type glGetColorTableParameterfvEXT,#function + .globl glTbufferMask3DFX ; .type glTbufferMask3DFX,#function + .globl glCompressedTexImage3DARB ; .type glCompressedTexImage3DARB,#function + .globl glCompressedTexImage2DARB ; .type glCompressedTexImage2DARB,#function + .globl glCompressedTexImage1DARB ; .type glCompressedTexImage1DARB,#function + .globl glCompressedTexSubImage3DARB ; .type glCompressedTexSubImage3DARB,#function + .globl glCompressedTexSubImage2DARB ; .type glCompressedTexSubImage2DARB,#function + .globl glCompressedTexSubImage1DARB ; .type glCompressedTexSubImage1DARB,#function + .globl glGetCompressedTexImageARB ; .type glGetCompressedTexImageARB,#function + .globl glSecondaryColor3bEXT ; .type glSecondaryColor3bEXT,#function + .globl glSecondaryColor3bvEXT ; .type glSecondaryColor3bvEXT,#function + .globl glSecondaryColor3dEXT ; .type glSecondaryColor3dEXT,#function + .globl glSecondaryColor3dvEXT ; .type glSecondaryColor3dvEXT,#function + .globl glSecondaryColor3fEXT ; .type glSecondaryColor3fEXT,#function + .globl glSecondaryColor3fvEXT ; .type glSecondaryColor3fvEXT,#function + .globl glSecondaryColor3iEXT ; .type glSecondaryColor3iEXT,#function + .globl glSecondaryColor3ivEXT ; .type glSecondaryColor3ivEXT,#function + .globl glSecondaryColor3sEXT ; .type glSecondaryColor3sEXT,#function + .globl glSecondaryColor3svEXT ; .type glSecondaryColor3svEXT,#function + .globl glSecondaryColor3ubEXT ; .type glSecondaryColor3ubEXT,#function + .globl glSecondaryColor3ubvEXT ; .type glSecondaryColor3ubvEXT,#function + .globl glSecondaryColor3uiEXT ; .type glSecondaryColor3uiEXT,#function + .globl glSecondaryColor3uivEXT ; .type glSecondaryColor3uivEXT,#function + .globl glSecondaryColor3usEXT ; .type glSecondaryColor3usEXT,#function + .globl glSecondaryColor3usvEXT ; .type glSecondaryColor3usvEXT,#function + .globl glSecondaryColorPointerEXT ; .type glSecondaryColorPointerEXT,#function + .globl glAreProgramsResidentNV ; .type glAreProgramsResidentNV,#function + .globl glBindProgramNV ; .type glBindProgramNV,#function + .globl glDeleteProgramsNV ; .type glDeleteProgramsNV,#function + .globl glExecuteProgramNV ; .type glExecuteProgramNV,#function + .globl glGenProgramsNV ; .type glGenProgramsNV,#function + .globl glGetProgramParameterdvNV ; .type glGetProgramParameterdvNV,#function + .globl glGetProgramParameterfvNV ; .type glGetProgramParameterfvNV,#function + .globl glGetProgramivNV ; .type glGetProgramivNV,#function + .globl glGetProgramStringNV ; .type glGetProgramStringNV,#function + .globl glGetTrackMatrixivNV ; .type glGetTrackMatrixivNV,#function + .globl glGetVertexAttribdvARB ; .type glGetVertexAttribdvARB,#function + .globl glGetVertexAttribfvARB ; .type glGetVertexAttribfvARB,#function + .globl glGetVertexAttribivARB ; .type glGetVertexAttribivARB,#function + .globl glGetVertexAttribPointervNV ; .type glGetVertexAttribPointervNV,#function + .globl glIsProgramNV ; .type glIsProgramNV,#function + .globl glLoadProgramNV ; .type glLoadProgramNV,#function + .globl glProgramParameter4dNV ; .type glProgramParameter4dNV,#function + .globl glProgramParameter4dvNV ; .type glProgramParameter4dvNV,#function + .globl glProgramParameter4fNV ; .type glProgramParameter4fNV,#function + .globl glProgramParameter4fvNV ; .type glProgramParameter4fvNV,#function + .globl glProgramParameters4dvNV ; .type glProgramParameters4dvNV,#function + .globl glProgramParameters4fvNV ; .type glProgramParameters4fvNV,#function + .globl glRequestResidentProgramsNV ; .type glRequestResidentProgramsNV,#function + .globl glTrackMatrixNV ; .type glTrackMatrixNV,#function + .globl glVertexAttribPointerNV ; .type glVertexAttribPointerNV,#function + .globl glVertexAttrib1dARB ; .type glVertexAttrib1dARB,#function + .globl glVertexAttrib1dvARB ; .type glVertexAttrib1dvARB,#function + .globl glVertexAttrib1fARB ; .type glVertexAttrib1fARB,#function + .globl glVertexAttrib1fvARB ; .type glVertexAttrib1fvARB,#function + .globl glVertexAttrib1sARB ; .type glVertexAttrib1sARB,#function + .globl glVertexAttrib1svARB ; .type glVertexAttrib1svARB,#function + .globl glVertexAttrib2dARB ; .type glVertexAttrib2dARB,#function + .globl glVertexAttrib2dvARB ; .type glVertexAttrib2dvARB,#function + .globl glVertexAttrib2fARB ; .type glVertexAttrib2fARB,#function + .globl glVertexAttrib2fvARB ; .type glVertexAttrib2fvARB,#function + .globl glVertexAttrib2sARB ; .type glVertexAttrib2sARB,#function + .globl glVertexAttrib2svARB ; .type glVertexAttrib2svARB,#function + .globl glVertexAttrib3dARB ; .type glVertexAttrib3dARB,#function + .globl glVertexAttrib3dvARB ; .type glVertexAttrib3dvARB,#function + .globl glVertexAttrib3fARB ; .type glVertexAttrib3fARB,#function + .globl glVertexAttrib3fvARB ; .type glVertexAttrib3fvARB,#function + .globl glVertexAttrib3sARB ; .type glVertexAttrib3sARB,#function + .globl glVertexAttrib3svARB ; .type glVertexAttrib3svARB,#function + .globl glVertexAttrib4dARB ; .type glVertexAttrib4dARB,#function + .globl glVertexAttrib4dvARB ; .type glVertexAttrib4dvARB,#function + .globl glVertexAttrib4fARB ; .type glVertexAttrib4fARB,#function + .globl glVertexAttrib4fvARB ; .type glVertexAttrib4fvARB,#function + .globl glVertexAttrib4sARB ; .type glVertexAttrib4sARB,#function + .globl glVertexAttrib4svARB ; .type glVertexAttrib4svARB,#function + .globl glVertexAttrib4NubARB ; .type glVertexAttrib4NubARB,#function + .globl glVertexAttrib4NubvARB ; .type glVertexAttrib4NubvARB,#function + .globl glVertexAttribs1dvNV ; .type glVertexAttribs1dvNV,#function + .globl glVertexAttribs1fvNV ; .type glVertexAttribs1fvNV,#function + .globl glVertexAttribs1svNV ; .type glVertexAttribs1svNV,#function + .globl glVertexAttribs2dvNV ; .type glVertexAttribs2dvNV,#function + .globl glVertexAttribs2fvNV ; .type glVertexAttribs2fvNV,#function + .globl glVertexAttribs2svNV ; .type glVertexAttribs2svNV,#function + .globl glVertexAttribs3dvNV ; .type glVertexAttribs3dvNV,#function + .globl glVertexAttribs3fvNV ; .type glVertexAttribs3fvNV,#function + .globl glVertexAttribs3svNV ; .type glVertexAttribs3svNV,#function + .globl glVertexAttribs4dvNV ; .type glVertexAttribs4dvNV,#function + .globl glVertexAttribs4fvNV ; .type glVertexAttribs4fvNV,#function + .globl glVertexAttribs4svNV ; .type glVertexAttribs4svNV,#function + .globl glVertexAttribs4ubvNV ; .type glVertexAttribs4ubvNV,#function + .globl glPointParameteriNV ; .type glPointParameteriNV,#function + .globl glPointParameterivNV ; .type glPointParameterivNV,#function + .globl glMultiDrawArraysEXT ; .type glMultiDrawArraysEXT,#function + .globl glMultiDrawElementsEXT ; .type glMultiDrawElementsEXT,#function + .globl glActiveStencilFaceEXT ; .type glActiveStencilFaceEXT,#function + .globl glDeleteFencesNV ; .type glDeleteFencesNV,#function + .globl glGenFencesNV ; .type glGenFencesNV,#function + .globl glIsFenceNV ; .type glIsFenceNV,#function + .globl glTestFenceNV ; .type glTestFenceNV,#function + .globl glGetFenceivNV ; .type glGetFenceivNV,#function + .globl glFinishFenceNV ; .type glFinishFenceNV,#function + .globl glSetFenceNV ; .type glSetFenceNV,#function + .globl glVertexAttrib4bvARB ; .type glVertexAttrib4bvARB,#function + .globl glVertexAttrib4ivARB ; .type glVertexAttrib4ivARB,#function + .globl glVertexAttrib4ubvARB ; .type glVertexAttrib4ubvARB,#function + .globl glVertexAttrib4usvARB ; .type glVertexAttrib4usvARB,#function + .globl glVertexAttrib4uivARB ; .type glVertexAttrib4uivARB,#function + .globl glVertexAttrib4NbvARB ; .type glVertexAttrib4NbvARB,#function + .globl glVertexAttrib4NsvARB ; .type glVertexAttrib4NsvARB,#function + .globl glVertexAttrib4NivARB ; .type glVertexAttrib4NivARB,#function + .globl glVertexAttrib4NusvARB ; .type glVertexAttrib4NusvARB,#function + .globl glVertexAttrib4NuivARB ; .type glVertexAttrib4NuivARB,#function + .globl glVertexAttribPointerARB ; .type glVertexAttribPointerARB,#function + .globl glEnableVertexAttribArrayARB ; .type glEnableVertexAttribArrayARB,#function + .globl glDisableVertexAttribArrayARB ; .type glDisableVertexAttribArrayARB,#function + .globl glProgramStringARB ; .type glProgramStringARB,#function + .globl glProgramEnvParameter4dARB ; .type glProgramEnvParameter4dARB,#function + .globl glProgramEnvParameter4dvARB ; .type glProgramEnvParameter4dvARB,#function + .globl glProgramEnvParameter4fARB ; .type glProgramEnvParameter4fARB,#function + .globl glProgramEnvParameter4fvARB ; .type glProgramEnvParameter4fvARB,#function + .globl glProgramLocalParameter4dARB ; .type glProgramLocalParameter4dARB,#function + .globl glProgramLocalParameter4dvARB ; .type glProgramLocalParameter4dvARB,#function + .globl glProgramLocalParameter4fARB ; .type glProgramLocalParameter4fARB,#function + .globl glProgramLocalParameter4fvARB ; .type glProgramLocalParameter4fvARB,#function + .globl glGetProgramEnvParameterdvARB ; .type glGetProgramEnvParameterdvARB,#function + .globl glGetProgramEnvParameterfvARB ; .type glGetProgramEnvParameterfvARB,#function + .globl glGetProgramLocalParameterdvARB ; .type glGetProgramLocalParameterdvARB,#function + .globl glGetProgramLocalParameterfvARB ; .type glGetProgramLocalParameterfvARB,#function + .globl glGetProgramivARB ; .type glGetProgramivARB,#function + .globl glGetProgramStringARB ; .type glGetProgramStringARB,#function + .globl glProgramNamedParameter4fNV ; .type glProgramNamedParameter4fNV,#function + .globl glProgramNamedParameter4dNV ; .type glProgramNamedParameter4dNV,#function + .globl glProgramNamedParameter4fvNV ; .type glProgramNamedParameter4fvNV,#function + .globl glProgramNamedParameter4dvNV ; .type glProgramNamedParameter4dvNV,#function + .globl glGetProgramNamedParameterfvNV ; .type glGetProgramNamedParameterfvNV,#function + .globl glGetProgramNamedParameterdvNV ; .type glGetProgramNamedParameterdvNV,#function + .globl glBindBufferARB ; .type glBindBufferARB,#function + .globl glBufferDataARB ; .type glBufferDataARB,#function + .globl glBufferSubDataARB ; .type glBufferSubDataARB,#function + .globl glDeleteBuffersARB ; .type glDeleteBuffersARB,#function + .globl glGenBuffersARB ; .type glGenBuffersARB,#function + .globl glGetBufferParameterivARB ; .type glGetBufferParameterivARB,#function + .globl glGetBufferPointervARB ; .type glGetBufferPointervARB,#function + .globl glGetBufferSubDataARB ; .type glGetBufferSubDataARB,#function + .globl glIsBufferARB ; .type glIsBufferARB,#function + .globl glMapBufferARB ; .type glMapBufferARB,#function + .globl glUnmapBufferARB ; .type glUnmapBufferARB,#function + .globl glDepthBoundsEXT ; .type glDepthBoundsEXT,#function + .globl glGenQueriesARB ; .type glGenQueriesARB,#function + .globl glDeleteQueriesARB ; .type glDeleteQueriesARB,#function + .globl glIsQueryARB ; .type glIsQueryARB,#function + .globl glBeginQueryARB ; .type glBeginQueryARB,#function + .globl glEndQueryARB ; .type glEndQueryARB,#function + .globl glGetQueryivARB ; .type glGetQueryivARB,#function + .globl glGetQueryObjectivARB ; .type glGetQueryObjectivARB,#function + .globl glGetQueryObjectuivARB ; .type glGetQueryObjectuivARB,#function + .globl glMultiModeDrawArraysIBM ; .type glMultiModeDrawArraysIBM,#function + .globl glMultiModeDrawElementsIBM ; .type glMultiModeDrawElementsIBM,#function + .globl glBlendEquationSeparateEXT ; .type glBlendEquationSeparateEXT,#function + .globl glDeleteObjectARB ; .type glDeleteObjectARB,#function + .globl glGetHandleARB ; .type glGetHandleARB,#function + .globl glDetachObjectARB ; .type glDetachObjectARB,#function + .globl glCreateShaderObjectARB ; .type glCreateShaderObjectARB,#function + .globl glShaderSourceARB ; .type glShaderSourceARB,#function + .globl glCompileShaderARB ; .type glCompileShaderARB,#function + .globl glCreateProgramObjectARB ; .type glCreateProgramObjectARB,#function + .globl glAttachObjectARB ; .type glAttachObjectARB,#function + .globl glLinkProgramARB ; .type glLinkProgramARB,#function + .globl glUseProgramObjectARB ; .type glUseProgramObjectARB,#function + .globl glValidateProgramARB ; .type glValidateProgramARB,#function + .globl glUniform1fARB ; .type glUniform1fARB,#function + .globl glUniform2fARB ; .type glUniform2fARB,#function + .globl glUniform3fARB ; .type glUniform3fARB,#function + .globl glUniform4fARB ; .type glUniform4fARB,#function + .globl glUniform1iARB ; .type glUniform1iARB,#function + .globl glUniform2iARB ; .type glUniform2iARB,#function + .globl glUniform3iARB ; .type glUniform3iARB,#function + .globl glUniform4iARB ; .type glUniform4iARB,#function + .globl glUniform1fvARB ; .type glUniform1fvARB,#function + .globl glUniform2fvARB ; .type glUniform2fvARB,#function + .globl glUniform3fvARB ; .type glUniform3fvARB,#function + .globl glUniform4fvARB ; .type glUniform4fvARB,#function + .globl glUniform1ivARB ; .type glUniform1ivARB,#function + .globl glUniform2ivARB ; .type glUniform2ivARB,#function + .globl glUniform3ivARB ; .type glUniform3ivARB,#function + .globl glUniform4ivARB ; .type glUniform4ivARB,#function + .globl glUniformMatrix2fvARB ; .type glUniformMatrix2fvARB,#function + .globl glUniformMatrix3fvARB ; .type glUniformMatrix3fvARB,#function + .globl glUniformMatrix4fvARB ; .type glUniformMatrix4fvARB,#function + .globl glGetObjectParameterfvARB ; .type glGetObjectParameterfvARB,#function + .globl glGetObjectParameterivARB ; .type glGetObjectParameterivARB,#function + .globl glGetInfoLogARB ; .type glGetInfoLogARB,#function + .globl glGetAttachedObjectsARB ; .type glGetAttachedObjectsARB,#function + .globl glGetUniformLocationARB ; .type glGetUniformLocationARB,#function + .globl glGetActiveUniformARB ; .type glGetActiveUniformARB,#function + .globl glGetUniformfvARB ; .type glGetUniformfvARB,#function + .globl glGetUniformivARB ; .type glGetUniformivARB,#function + .globl glGetShaderSourceARB ; .type glGetShaderSourceARB,#function + .globl glBindAttribLocationARB ; .type glBindAttribLocationARB,#function + .globl glGetActiveAttribARB ; .type glGetActiveAttribARB,#function + .globl glGetAttribLocationARB ; .type glGetAttribLocationARB,#function + .globl glGetVertexAttribdvNV ; .type glGetVertexAttribdvNV,#function + .globl glGetVertexAttribfvNV ; .type glGetVertexAttribfvNV,#function + .globl glGetVertexAttribivNV ; .type glGetVertexAttribivNV,#function + .globl glVertexAttrib1dNV ; .type glVertexAttrib1dNV,#function + .globl glVertexAttrib1dvNV ; .type glVertexAttrib1dvNV,#function + .globl glVertexAttrib1fNV ; .type glVertexAttrib1fNV,#function + .globl glVertexAttrib1fvNV ; .type glVertexAttrib1fvNV,#function + .globl glVertexAttrib1sNV ; .type glVertexAttrib1sNV,#function + .globl glVertexAttrib1svNV ; .type glVertexAttrib1svNV,#function + .globl glVertexAttrib2dNV ; .type glVertexAttrib2dNV,#function + .globl glVertexAttrib2dvNV ; .type glVertexAttrib2dvNV,#function + .globl glVertexAttrib2fNV ; .type glVertexAttrib2fNV,#function + .globl glVertexAttrib2fvNV ; .type glVertexAttrib2fvNV,#function + .globl glVertexAttrib2sNV ; .type glVertexAttrib2sNV,#function + .globl glVertexAttrib2svNV ; .type glVertexAttrib2svNV,#function + .globl glVertexAttrib3dNV ; .type glVertexAttrib3dNV,#function + .globl glVertexAttrib3dvNV ; .type glVertexAttrib3dvNV,#function + .globl glVertexAttrib3fNV ; .type glVertexAttrib3fNV,#function + .globl glVertexAttrib3fvNV ; .type glVertexAttrib3fvNV,#function + .globl glVertexAttrib3sNV ; .type glVertexAttrib3sNV,#function + .globl glVertexAttrib3svNV ; .type glVertexAttrib3svNV,#function + .globl glVertexAttrib4dNV ; .type glVertexAttrib4dNV,#function + .globl glVertexAttrib4dvNV ; .type glVertexAttrib4dvNV,#function + .globl glVertexAttrib4fNV ; .type glVertexAttrib4fNV,#function + .globl glVertexAttrib4fvNV ; .type glVertexAttrib4fvNV,#function + .globl glVertexAttrib4sNV ; .type glVertexAttrib4sNV,#function + .globl glVertexAttrib4svNV ; .type glVertexAttrib4svNV,#function + .globl glVertexAttrib4ubNV ; .type glVertexAttrib4ubNV,#function + .globl glVertexAttrib4ubvNV ; .type glVertexAttrib4ubvNV,#function + .globl glGenFragmentShadersATI ; .type glGenFragmentShadersATI,#function + .globl glBindFragmentShaderATI ; .type glBindFragmentShaderATI,#function + .globl glDeleteFragmentShaderATI ; .type glDeleteFragmentShaderATI,#function + .globl glBeginFragmentShaderATI ; .type glBeginFragmentShaderATI,#function + .globl glEndFragmentShaderATI ; .type glEndFragmentShaderATI,#function + .globl glPassTexCoordATI ; .type glPassTexCoordATI,#function + .globl glSampleMapATI ; .type glSampleMapATI,#function + .globl glColorFragmentOp1ATI ; .type glColorFragmentOp1ATI,#function + .globl glColorFragmentOp2ATI ; .type glColorFragmentOp2ATI,#function + .globl glColorFragmentOp3ATI ; .type glColorFragmentOp3ATI,#function + .globl glAlphaFragmentOp1ATI ; .type glAlphaFragmentOp1ATI,#function + .globl glAlphaFragmentOp2ATI ; .type glAlphaFragmentOp2ATI,#function + .globl glAlphaFragmentOp3ATI ; .type glAlphaFragmentOp3ATI,#function + .globl glSetFragmentShaderConstantATI ; .type glSetFragmentShaderConstantATI,#function + .globl glIsRenderbufferEXT ; .type glIsRenderbufferEXT,#function + .globl glBindRenderbufferEXT ; .type glBindRenderbufferEXT,#function + .globl glDeleteRenderbuffersEXT ; .type glDeleteRenderbuffersEXT,#function + .globl glGenRenderbuffersEXT ; .type glGenRenderbuffersEXT,#function + .globl glRenderbufferStorageEXT ; .type glRenderbufferStorageEXT,#function + .globl glGetRenderbufferParameterivEXT ; .type glGetRenderbufferParameterivEXT,#function + .globl glIsFramebufferEXT ; .type glIsFramebufferEXT,#function + .globl glBindFramebufferEXT ; .type glBindFramebufferEXT,#function + .globl glDeleteFramebuffersEXT ; .type glDeleteFramebuffersEXT,#function + .globl glGenFramebuffersEXT ; .type glGenFramebuffersEXT,#function + .globl glCheckFramebufferStatusEXT ; .type glCheckFramebufferStatusEXT,#function + .globl glFramebufferTexture1DEXT ; .type glFramebufferTexture1DEXT,#function + .globl glFramebufferTexture2DEXT ; .type glFramebufferTexture2DEXT,#function + .globl glFramebufferTexture3DEXT ; .type glFramebufferTexture3DEXT,#function + .globl glFramebufferRenderbufferEXT ; .type glFramebufferRenderbufferEXT,#function + .globl glGetFramebufferAttachmentParameterivEXT ; .type glGetFramebufferAttachmentParameterivEXT,#function + .globl glGenerateMipmapEXT ; .type glGenerateMipmapEXT,#function + .globl glStencilFuncSeparate ; .type glStencilFuncSeparate,#function + .globl glStencilOpSeparate ; .type glStencilOpSeparate,#function + .globl glStencilMaskSeparate ; .type glStencilMaskSeparate,#function + .globl _mesa_sparc_glapi_begin ; .type _mesa_sparc_glapi_begin,#function _mesa_sparc_glapi_begin: -.globl glNewList -.type glNewList,#function -glNewList: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_NewList), %g2 - or %g2, %lo(8 * _gloffset_NewList), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_NewList)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEndList -.type glEndList,#function -glEndList: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EndList), %g2 - or %g2, %lo(8 * _gloffset_EndList), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EndList)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCallList -.type glCallList,#function -glCallList: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CallList), %g2 - or %g2, %lo(8 * _gloffset_CallList), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CallList)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCallLists -.type glCallLists,#function -glCallLists: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CallLists), %g2 - or %g2, %lo(8 * _gloffset_CallLists), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CallLists)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDeleteLists -.type glDeleteLists,#function -glDeleteLists: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DeleteLists), %g2 - or %g2, %lo(8 * _gloffset_DeleteLists), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DeleteLists)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGenLists -.type glGenLists,#function -glGenLists: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GenLists), %g2 - or %g2, %lo(8 * _gloffset_GenLists), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GenLists)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glListBase -.type glListBase,#function -glListBase: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ListBase), %g2 - or %g2, %lo(8 * _gloffset_ListBase), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ListBase)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBegin -.type glBegin,#function -glBegin: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Begin), %g2 - or %g2, %lo(8 * _gloffset_Begin), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Begin)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBitmap -.type glBitmap,#function -glBitmap: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Bitmap), %g2 - or %g2, %lo(8 * _gloffset_Bitmap), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Bitmap)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor3b -.type glColor3b,#function -glColor3b: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color3b), %g2 - or %g2, %lo(8 * _gloffset_Color3b), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color3b)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor3bv -.type glColor3bv,#function -glColor3bv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color3bv), %g2 - or %g2, %lo(8 * _gloffset_Color3bv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color3bv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor3d -.type glColor3d,#function -glColor3d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color3d), %g2 - or %g2, %lo(8 * _gloffset_Color3d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color3d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor3dv -.type glColor3dv,#function -glColor3dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color3dv), %g2 - or %g2, %lo(8 * _gloffset_Color3dv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color3dv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor3f -.type glColor3f,#function -glColor3f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color3f), %g2 - or %g2, %lo(8 * _gloffset_Color3f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color3f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor3fv -.type glColor3fv,#function -glColor3fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color3fv), %g2 - or %g2, %lo(8 * _gloffset_Color3fv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color3fv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor3i -.type glColor3i,#function -glColor3i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color3i), %g2 - or %g2, %lo(8 * _gloffset_Color3i), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color3i)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor3iv -.type glColor3iv,#function -glColor3iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color3iv), %g2 - or %g2, %lo(8 * _gloffset_Color3iv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color3iv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor3s -.type glColor3s,#function -glColor3s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color3s), %g2 - or %g2, %lo(8 * _gloffset_Color3s), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color3s)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor3sv -.type glColor3sv,#function -glColor3sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color3sv), %g2 - or %g2, %lo(8 * _gloffset_Color3sv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color3sv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor3ub -.type glColor3ub,#function -glColor3ub: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color3ub), %g2 - or %g2, %lo(8 * _gloffset_Color3ub), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color3ub)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor3ubv -.type glColor3ubv,#function -glColor3ubv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color3ubv), %g2 - or %g2, %lo(8 * _gloffset_Color3ubv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color3ubv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor3ui -.type glColor3ui,#function -glColor3ui: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color3ui), %g2 - or %g2, %lo(8 * _gloffset_Color3ui), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color3ui)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor3uiv -.type glColor3uiv,#function -glColor3uiv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color3uiv), %g2 - or %g2, %lo(8 * _gloffset_Color3uiv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color3uiv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor3us -.type glColor3us,#function -glColor3us: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color3us), %g2 - or %g2, %lo(8 * _gloffset_Color3us), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color3us)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor3usv -.type glColor3usv,#function -glColor3usv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color3usv), %g2 - or %g2, %lo(8 * _gloffset_Color3usv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color3usv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor4b -.type glColor4b,#function -glColor4b: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color4b), %g2 - or %g2, %lo(8 * _gloffset_Color4b), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color4b)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor4bv -.type glColor4bv,#function -glColor4bv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color4bv), %g2 - or %g2, %lo(8 * _gloffset_Color4bv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color4bv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor4d -.type glColor4d,#function -glColor4d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color4d), %g2 - or %g2, %lo(8 * _gloffset_Color4d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color4d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor4dv -.type glColor4dv,#function -glColor4dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color4dv), %g2 - or %g2, %lo(8 * _gloffset_Color4dv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color4dv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor4f -.type glColor4f,#function -glColor4f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color4f), %g2 - or %g2, %lo(8 * _gloffset_Color4f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color4f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor4fv -.type glColor4fv,#function -glColor4fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color4fv), %g2 - or %g2, %lo(8 * _gloffset_Color4fv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color4fv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor4i -.type glColor4i,#function -glColor4i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color4i), %g2 - or %g2, %lo(8 * _gloffset_Color4i), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color4i)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor4iv -.type glColor4iv,#function -glColor4iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color4iv), %g2 - or %g2, %lo(8 * _gloffset_Color4iv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color4iv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor4s -.type glColor4s,#function -glColor4s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color4s), %g2 - or %g2, %lo(8 * _gloffset_Color4s), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color4s)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor4sv -.type glColor4sv,#function -glColor4sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color4sv), %g2 - or %g2, %lo(8 * _gloffset_Color4sv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color4sv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor4ub -.type glColor4ub,#function -glColor4ub: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color4ub), %g2 - or %g2, %lo(8 * _gloffset_Color4ub), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color4ub)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor4ubv -.type glColor4ubv,#function -glColor4ubv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color4ubv), %g2 - or %g2, %lo(8 * _gloffset_Color4ubv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color4ubv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor4ui -.type glColor4ui,#function -glColor4ui: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color4ui), %g2 - or %g2, %lo(8 * _gloffset_Color4ui), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color4ui)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor4uiv -.type glColor4uiv,#function -glColor4uiv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color4uiv), %g2 - or %g2, %lo(8 * _gloffset_Color4uiv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color4uiv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor4us -.type glColor4us,#function -glColor4us: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color4us), %g2 - or %g2, %lo(8 * _gloffset_Color4us), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color4us)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColor4usv -.type glColor4usv,#function -glColor4usv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Color4usv), %g2 - or %g2, %lo(8 * _gloffset_Color4usv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Color4usv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEdgeFlag -.type glEdgeFlag,#function -glEdgeFlag: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EdgeFlag), %g2 - or %g2, %lo(8 * _gloffset_EdgeFlag), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EdgeFlag)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEdgeFlagv -.type glEdgeFlagv,#function -glEdgeFlagv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EdgeFlagv), %g2 - or %g2, %lo(8 * _gloffset_EdgeFlagv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EdgeFlagv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEnd -.type glEnd,#function -glEnd: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_End), %g2 - or %g2, %lo(8 * _gloffset_End), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_End)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIndexd -.type glIndexd,#function -glIndexd: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Indexd), %g2 - or %g2, %lo(8 * _gloffset_Indexd), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Indexd)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIndexdv -.type glIndexdv,#function -glIndexdv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Indexdv), %g2 - or %g2, %lo(8 * _gloffset_Indexdv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Indexdv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIndexf -.type glIndexf,#function -glIndexf: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Indexf), %g2 - or %g2, %lo(8 * _gloffset_Indexf), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Indexf)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIndexfv -.type glIndexfv,#function -glIndexfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Indexfv), %g2 - or %g2, %lo(8 * _gloffset_Indexfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Indexfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIndexi -.type glIndexi,#function -glIndexi: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Indexi), %g2 - or %g2, %lo(8 * _gloffset_Indexi), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Indexi)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIndexiv -.type glIndexiv,#function -glIndexiv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Indexiv), %g2 - or %g2, %lo(8 * _gloffset_Indexiv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Indexiv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIndexs -.type glIndexs,#function -glIndexs: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Indexs), %g2 - or %g2, %lo(8 * _gloffset_Indexs), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Indexs)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIndexsv -.type glIndexsv,#function -glIndexsv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Indexsv), %g2 - or %g2, %lo(8 * _gloffset_Indexsv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Indexsv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glNormal3b -.type glNormal3b,#function -glNormal3b: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Normal3b), %g2 - or %g2, %lo(8 * _gloffset_Normal3b), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Normal3b)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glNormal3bv -.type glNormal3bv,#function -glNormal3bv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Normal3bv), %g2 - or %g2, %lo(8 * _gloffset_Normal3bv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Normal3bv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glNormal3d -.type glNormal3d,#function -glNormal3d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Normal3d), %g2 - or %g2, %lo(8 * _gloffset_Normal3d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Normal3d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glNormal3dv -.type glNormal3dv,#function -glNormal3dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Normal3dv), %g2 - or %g2, %lo(8 * _gloffset_Normal3dv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Normal3dv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glNormal3f -.type glNormal3f,#function -glNormal3f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Normal3f), %g2 - or %g2, %lo(8 * _gloffset_Normal3f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Normal3f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glNormal3fv -.type glNormal3fv,#function -glNormal3fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Normal3fv), %g2 - or %g2, %lo(8 * _gloffset_Normal3fv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Normal3fv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glNormal3i -.type glNormal3i,#function -glNormal3i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Normal3i), %g2 - or %g2, %lo(8 * _gloffset_Normal3i), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Normal3i)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glNormal3iv -.type glNormal3iv,#function -glNormal3iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Normal3iv), %g2 - or %g2, %lo(8 * _gloffset_Normal3iv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Normal3iv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glNormal3s -.type glNormal3s,#function -glNormal3s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Normal3s), %g2 - or %g2, %lo(8 * _gloffset_Normal3s), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Normal3s)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glNormal3sv -.type glNormal3sv,#function -glNormal3sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Normal3sv), %g2 - or %g2, %lo(8 * _gloffset_Normal3sv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Normal3sv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos2d -.type glRasterPos2d,#function -glRasterPos2d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos2d), %g2 - or %g2, %lo(8 * _gloffset_RasterPos2d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos2d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos2dv -.type glRasterPos2dv,#function -glRasterPos2dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos2dv), %g2 - or %g2, %lo(8 * _gloffset_RasterPos2dv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos2dv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos2f -.type glRasterPos2f,#function -glRasterPos2f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos2f), %g2 - or %g2, %lo(8 * _gloffset_RasterPos2f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos2f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos2fv -.type glRasterPos2fv,#function -glRasterPos2fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos2fv), %g2 - or %g2, %lo(8 * _gloffset_RasterPos2fv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos2fv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos2i -.type glRasterPos2i,#function -glRasterPos2i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos2i), %g2 - or %g2, %lo(8 * _gloffset_RasterPos2i), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos2i)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos2iv -.type glRasterPos2iv,#function -glRasterPos2iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos2iv), %g2 - or %g2, %lo(8 * _gloffset_RasterPos2iv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos2iv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos2s -.type glRasterPos2s,#function -glRasterPos2s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos2s), %g2 - or %g2, %lo(8 * _gloffset_RasterPos2s), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos2s)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos2sv -.type glRasterPos2sv,#function -glRasterPos2sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos2sv), %g2 - or %g2, %lo(8 * _gloffset_RasterPos2sv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos2sv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos3d -.type glRasterPos3d,#function -glRasterPos3d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos3d), %g2 - or %g2, %lo(8 * _gloffset_RasterPos3d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos3d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos3dv -.type glRasterPos3dv,#function -glRasterPos3dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos3dv), %g2 - or %g2, %lo(8 * _gloffset_RasterPos3dv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos3dv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos3f -.type glRasterPos3f,#function -glRasterPos3f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos3f), %g2 - or %g2, %lo(8 * _gloffset_RasterPos3f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos3f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos3fv -.type glRasterPos3fv,#function -glRasterPos3fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos3fv), %g2 - or %g2, %lo(8 * _gloffset_RasterPos3fv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos3fv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos3i -.type glRasterPos3i,#function -glRasterPos3i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos3i), %g2 - or %g2, %lo(8 * _gloffset_RasterPos3i), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos3i)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos3iv -.type glRasterPos3iv,#function -glRasterPos3iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos3iv), %g2 - or %g2, %lo(8 * _gloffset_RasterPos3iv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos3iv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos3s -.type glRasterPos3s,#function -glRasterPos3s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos3s), %g2 - or %g2, %lo(8 * _gloffset_RasterPos3s), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos3s)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos3sv -.type glRasterPos3sv,#function -glRasterPos3sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos3sv), %g2 - or %g2, %lo(8 * _gloffset_RasterPos3sv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos3sv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos4d -.type glRasterPos4d,#function -glRasterPos4d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos4d), %g2 - or %g2, %lo(8 * _gloffset_RasterPos4d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos4d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos4dv -.type glRasterPos4dv,#function -glRasterPos4dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos4dv), %g2 - or %g2, %lo(8 * _gloffset_RasterPos4dv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos4dv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos4f -.type glRasterPos4f,#function -glRasterPos4f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos4f), %g2 - or %g2, %lo(8 * _gloffset_RasterPos4f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos4f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos4fv -.type glRasterPos4fv,#function -glRasterPos4fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos4fv), %g2 - or %g2, %lo(8 * _gloffset_RasterPos4fv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos4fv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos4i -.type glRasterPos4i,#function -glRasterPos4i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos4i), %g2 - or %g2, %lo(8 * _gloffset_RasterPos4i), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos4i)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos4iv -.type glRasterPos4iv,#function -glRasterPos4iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos4iv), %g2 - or %g2, %lo(8 * _gloffset_RasterPos4iv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos4iv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos4s -.type glRasterPos4s,#function -glRasterPos4s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos4s), %g2 - or %g2, %lo(8 * _gloffset_RasterPos4s), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos4s)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRasterPos4sv -.type glRasterPos4sv,#function -glRasterPos4sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RasterPos4sv), %g2 - or %g2, %lo(8 * _gloffset_RasterPos4sv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RasterPos4sv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRectd -.type glRectd,#function -glRectd: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Rectd), %g2 - or %g2, %lo(8 * _gloffset_Rectd), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Rectd)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRectdv -.type glRectdv,#function -glRectdv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Rectdv), %g2 - or %g2, %lo(8 * _gloffset_Rectdv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Rectdv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRectf -.type glRectf,#function -glRectf: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Rectf), %g2 - or %g2, %lo(8 * _gloffset_Rectf), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Rectf)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRectfv -.type glRectfv,#function -glRectfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Rectfv), %g2 - or %g2, %lo(8 * _gloffset_Rectfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Rectfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRecti -.type glRecti,#function -glRecti: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Recti), %g2 - or %g2, %lo(8 * _gloffset_Recti), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Recti)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRectiv -.type glRectiv,#function -glRectiv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Rectiv), %g2 - or %g2, %lo(8 * _gloffset_Rectiv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Rectiv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRects -.type glRects,#function -glRects: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Rects), %g2 - or %g2, %lo(8 * _gloffset_Rects), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Rects)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRectsv -.type glRectsv,#function -glRectsv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Rectsv), %g2 - or %g2, %lo(8 * _gloffset_Rectsv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Rectsv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord1d -.type glTexCoord1d,#function -glTexCoord1d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord1d), %g2 - or %g2, %lo(8 * _gloffset_TexCoord1d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord1d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord1dv -.type glTexCoord1dv,#function -glTexCoord1dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord1dv), %g2 - or %g2, %lo(8 * _gloffset_TexCoord1dv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord1dv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord1f -.type glTexCoord1f,#function -glTexCoord1f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord1f), %g2 - or %g2, %lo(8 * _gloffset_TexCoord1f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord1f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord1fv -.type glTexCoord1fv,#function -glTexCoord1fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord1fv), %g2 - or %g2, %lo(8 * _gloffset_TexCoord1fv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord1fv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord1i -.type glTexCoord1i,#function -glTexCoord1i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord1i), %g2 - or %g2, %lo(8 * _gloffset_TexCoord1i), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord1i)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord1iv -.type glTexCoord1iv,#function -glTexCoord1iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord1iv), %g2 - or %g2, %lo(8 * _gloffset_TexCoord1iv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord1iv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord1s -.type glTexCoord1s,#function -glTexCoord1s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord1s), %g2 - or %g2, %lo(8 * _gloffset_TexCoord1s), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord1s)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord1sv -.type glTexCoord1sv,#function -glTexCoord1sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord1sv), %g2 - or %g2, %lo(8 * _gloffset_TexCoord1sv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord1sv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord2d -.type glTexCoord2d,#function -glTexCoord2d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord2d), %g2 - or %g2, %lo(8 * _gloffset_TexCoord2d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord2d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord2dv -.type glTexCoord2dv,#function -glTexCoord2dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord2dv), %g2 - or %g2, %lo(8 * _gloffset_TexCoord2dv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord2dv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord2f -.type glTexCoord2f,#function -glTexCoord2f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord2f), %g2 - or %g2, %lo(8 * _gloffset_TexCoord2f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord2f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord2fv -.type glTexCoord2fv,#function -glTexCoord2fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord2fv), %g2 - or %g2, %lo(8 * _gloffset_TexCoord2fv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord2fv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord2i -.type glTexCoord2i,#function -glTexCoord2i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord2i), %g2 - or %g2, %lo(8 * _gloffset_TexCoord2i), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord2i)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord2iv -.type glTexCoord2iv,#function -glTexCoord2iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord2iv), %g2 - or %g2, %lo(8 * _gloffset_TexCoord2iv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord2iv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord2s -.type glTexCoord2s,#function -glTexCoord2s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord2s), %g2 - or %g2, %lo(8 * _gloffset_TexCoord2s), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord2s)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord2sv -.type glTexCoord2sv,#function -glTexCoord2sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord2sv), %g2 - or %g2, %lo(8 * _gloffset_TexCoord2sv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord2sv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord3d -.type glTexCoord3d,#function -glTexCoord3d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord3d), %g2 - or %g2, %lo(8 * _gloffset_TexCoord3d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord3d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord3dv -.type glTexCoord3dv,#function -glTexCoord3dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord3dv), %g2 - or %g2, %lo(8 * _gloffset_TexCoord3dv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord3dv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord3f -.type glTexCoord3f,#function -glTexCoord3f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord3f), %g2 - or %g2, %lo(8 * _gloffset_TexCoord3f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord3f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord3fv -.type glTexCoord3fv,#function -glTexCoord3fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord3fv), %g2 - or %g2, %lo(8 * _gloffset_TexCoord3fv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord3fv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord3i -.type glTexCoord3i,#function -glTexCoord3i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord3i), %g2 - or %g2, %lo(8 * _gloffset_TexCoord3i), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord3i)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord3iv -.type glTexCoord3iv,#function -glTexCoord3iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord3iv), %g2 - or %g2, %lo(8 * _gloffset_TexCoord3iv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord3iv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord3s -.type glTexCoord3s,#function -glTexCoord3s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord3s), %g2 - or %g2, %lo(8 * _gloffset_TexCoord3s), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord3s)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord3sv -.type glTexCoord3sv,#function -glTexCoord3sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord3sv), %g2 - or %g2, %lo(8 * _gloffset_TexCoord3sv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord3sv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord4d -.type glTexCoord4d,#function -glTexCoord4d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord4d), %g2 - or %g2, %lo(8 * _gloffset_TexCoord4d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord4d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord4dv -.type glTexCoord4dv,#function -glTexCoord4dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord4dv), %g2 - or %g2, %lo(8 * _gloffset_TexCoord4dv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord4dv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord4f -.type glTexCoord4f,#function -glTexCoord4f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord4f), %g2 - or %g2, %lo(8 * _gloffset_TexCoord4f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord4f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord4fv -.type glTexCoord4fv,#function -glTexCoord4fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord4fv), %g2 - or %g2, %lo(8 * _gloffset_TexCoord4fv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord4fv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord4i -.type glTexCoord4i,#function -glTexCoord4i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord4i), %g2 - or %g2, %lo(8 * _gloffset_TexCoord4i), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord4i)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord4iv -.type glTexCoord4iv,#function -glTexCoord4iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord4iv), %g2 - or %g2, %lo(8 * _gloffset_TexCoord4iv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord4iv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord4s -.type glTexCoord4s,#function -glTexCoord4s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord4s), %g2 - or %g2, %lo(8 * _gloffset_TexCoord4s), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord4s)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoord4sv -.type glTexCoord4sv,#function -glTexCoord4sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoord4sv), %g2 - or %g2, %lo(8 * _gloffset_TexCoord4sv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoord4sv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex2d -.type glVertex2d,#function -glVertex2d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex2d), %g2 - or %g2, %lo(8 * _gloffset_Vertex2d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex2d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex2dv -.type glVertex2dv,#function -glVertex2dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex2dv), %g2 - or %g2, %lo(8 * _gloffset_Vertex2dv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex2dv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex2f -.type glVertex2f,#function -glVertex2f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex2f), %g2 - or %g2, %lo(8 * _gloffset_Vertex2f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex2f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex2fv -.type glVertex2fv,#function -glVertex2fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex2fv), %g2 - or %g2, %lo(8 * _gloffset_Vertex2fv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex2fv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex2i -.type glVertex2i,#function -glVertex2i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex2i), %g2 - or %g2, %lo(8 * _gloffset_Vertex2i), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex2i)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex2iv -.type glVertex2iv,#function -glVertex2iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex2iv), %g2 - or %g2, %lo(8 * _gloffset_Vertex2iv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex2iv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex2s -.type glVertex2s,#function -glVertex2s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex2s), %g2 - or %g2, %lo(8 * _gloffset_Vertex2s), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex2s)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex2sv -.type glVertex2sv,#function -glVertex2sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex2sv), %g2 - or %g2, %lo(8 * _gloffset_Vertex2sv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex2sv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex3d -.type glVertex3d,#function -glVertex3d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex3d), %g2 - or %g2, %lo(8 * _gloffset_Vertex3d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex3d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex3dv -.type glVertex3dv,#function -glVertex3dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex3dv), %g2 - or %g2, %lo(8 * _gloffset_Vertex3dv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex3dv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex3f -.type glVertex3f,#function -glVertex3f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex3f), %g2 - or %g2, %lo(8 * _gloffset_Vertex3f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex3f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex3fv -.type glVertex3fv,#function -glVertex3fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex3fv), %g2 - or %g2, %lo(8 * _gloffset_Vertex3fv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex3fv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex3i -.type glVertex3i,#function -glVertex3i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex3i), %g2 - or %g2, %lo(8 * _gloffset_Vertex3i), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex3i)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex3iv -.type glVertex3iv,#function -glVertex3iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex3iv), %g2 - or %g2, %lo(8 * _gloffset_Vertex3iv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex3iv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex3s -.type glVertex3s,#function -glVertex3s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex3s), %g2 - or %g2, %lo(8 * _gloffset_Vertex3s), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex3s)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex3sv -.type glVertex3sv,#function -glVertex3sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex3sv), %g2 - or %g2, %lo(8 * _gloffset_Vertex3sv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex3sv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex4d -.type glVertex4d,#function -glVertex4d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex4d), %g2 - or %g2, %lo(8 * _gloffset_Vertex4d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex4d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex4dv -.type glVertex4dv,#function -glVertex4dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex4dv), %g2 - or %g2, %lo(8 * _gloffset_Vertex4dv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex4dv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex4f -.type glVertex4f,#function -glVertex4f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex4f), %g2 - or %g2, %lo(8 * _gloffset_Vertex4f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex4f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex4fv -.type glVertex4fv,#function -glVertex4fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex4fv), %g2 - or %g2, %lo(8 * _gloffset_Vertex4fv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex4fv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex4i -.type glVertex4i,#function -glVertex4i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex4i), %g2 - or %g2, %lo(8 * _gloffset_Vertex4i), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex4i)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex4iv -.type glVertex4iv,#function -glVertex4iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex4iv), %g2 - or %g2, %lo(8 * _gloffset_Vertex4iv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex4iv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex4s -.type glVertex4s,#function -glVertex4s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex4s), %g2 - or %g2, %lo(8 * _gloffset_Vertex4s), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex4s)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertex4sv -.type glVertex4sv,#function -glVertex4sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Vertex4sv), %g2 - or %g2, %lo(8 * _gloffset_Vertex4sv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Vertex4sv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glClipPlane -.type glClipPlane,#function -glClipPlane: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ClipPlane), %g2 - or %g2, %lo(8 * _gloffset_ClipPlane), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ClipPlane)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColorMaterial -.type glColorMaterial,#function -glColorMaterial: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ColorMaterial), %g2 - or %g2, %lo(8 * _gloffset_ColorMaterial), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ColorMaterial)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCullFace -.type glCullFace,#function -glCullFace: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CullFace), %g2 - or %g2, %lo(8 * _gloffset_CullFace), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CullFace)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFogf -.type glFogf,#function -glFogf: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Fogf), %g2 - or %g2, %lo(8 * _gloffset_Fogf), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Fogf)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFogfv -.type glFogfv,#function -glFogfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Fogfv), %g2 - or %g2, %lo(8 * _gloffset_Fogfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Fogfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFogi -.type glFogi,#function -glFogi: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Fogi), %g2 - or %g2, %lo(8 * _gloffset_Fogi), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Fogi)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFogiv -.type glFogiv,#function -glFogiv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Fogiv), %g2 - or %g2, %lo(8 * _gloffset_Fogiv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Fogiv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFrontFace -.type glFrontFace,#function -glFrontFace: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FrontFace), %g2 - or %g2, %lo(8 * _gloffset_FrontFace), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FrontFace)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glHint -.type glHint,#function -glHint: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Hint), %g2 - or %g2, %lo(8 * _gloffset_Hint), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Hint)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLightf -.type glLightf,#function -glLightf: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Lightf), %g2 - or %g2, %lo(8 * _gloffset_Lightf), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Lightf)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLightfv -.type glLightfv,#function -glLightfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Lightfv), %g2 - or %g2, %lo(8 * _gloffset_Lightfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Lightfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLighti -.type glLighti,#function -glLighti: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Lighti), %g2 - or %g2, %lo(8 * _gloffset_Lighti), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Lighti)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLightiv -.type glLightiv,#function -glLightiv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Lightiv), %g2 - or %g2, %lo(8 * _gloffset_Lightiv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Lightiv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLightModelf -.type glLightModelf,#function -glLightModelf: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LightModelf), %g2 - or %g2, %lo(8 * _gloffset_LightModelf), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LightModelf)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLightModelfv -.type glLightModelfv,#function -glLightModelfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LightModelfv), %g2 - or %g2, %lo(8 * _gloffset_LightModelfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LightModelfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLightModeli -.type glLightModeli,#function -glLightModeli: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LightModeli), %g2 - or %g2, %lo(8 * _gloffset_LightModeli), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LightModeli)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLightModeliv -.type glLightModeliv,#function -glLightModeliv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LightModeliv), %g2 - or %g2, %lo(8 * _gloffset_LightModeliv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LightModeliv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLineStipple -.type glLineStipple,#function -glLineStipple: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LineStipple), %g2 - or %g2, %lo(8 * _gloffset_LineStipple), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LineStipple)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLineWidth -.type glLineWidth,#function -glLineWidth: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LineWidth), %g2 - or %g2, %lo(8 * _gloffset_LineWidth), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LineWidth)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMaterialf -.type glMaterialf,#function -glMaterialf: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Materialf), %g2 - or %g2, %lo(8 * _gloffset_Materialf), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Materialf)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMaterialfv -.type glMaterialfv,#function -glMaterialfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Materialfv), %g2 - or %g2, %lo(8 * _gloffset_Materialfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Materialfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMateriali -.type glMateriali,#function -glMateriali: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Materiali), %g2 - or %g2, %lo(8 * _gloffset_Materiali), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Materiali)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMaterialiv -.type glMaterialiv,#function -glMaterialiv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Materialiv), %g2 - or %g2, %lo(8 * _gloffset_Materialiv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Materialiv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPointSize -.type glPointSize,#function -glPointSize: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PointSize), %g2 - or %g2, %lo(8 * _gloffset_PointSize), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PointSize)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPolygonMode -.type glPolygonMode,#function -glPolygonMode: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PolygonMode), %g2 - or %g2, %lo(8 * _gloffset_PolygonMode), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PolygonMode)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPolygonStipple -.type glPolygonStipple,#function -glPolygonStipple: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PolygonStipple), %g2 - or %g2, %lo(8 * _gloffset_PolygonStipple), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PolygonStipple)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glScissor -.type glScissor,#function -glScissor: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Scissor), %g2 - or %g2, %lo(8 * _gloffset_Scissor), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Scissor)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glShadeModel -.type glShadeModel,#function -glShadeModel: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ShadeModel), %g2 - or %g2, %lo(8 * _gloffset_ShadeModel), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ShadeModel)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexParameterf -.type glTexParameterf,#function -glTexParameterf: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexParameterf), %g2 - or %g2, %lo(8 * _gloffset_TexParameterf), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexParameterf)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexParameterfv -.type glTexParameterfv,#function -glTexParameterfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexParameterfv), %g2 - or %g2, %lo(8 * _gloffset_TexParameterfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexParameterfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexParameteri -.type glTexParameteri,#function -glTexParameteri: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexParameteri), %g2 - or %g2, %lo(8 * _gloffset_TexParameteri), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexParameteri)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexParameteriv -.type glTexParameteriv,#function -glTexParameteriv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexParameteriv), %g2 - or %g2, %lo(8 * _gloffset_TexParameteriv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexParameteriv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexImage1D -.type glTexImage1D,#function -glTexImage1D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexImage1D), %g2 - or %g2, %lo(8 * _gloffset_TexImage1D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexImage1D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexImage2D -.type glTexImage2D,#function -glTexImage2D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexImage2D), %g2 - or %g2, %lo(8 * _gloffset_TexImage2D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexImage2D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexEnvf -.type glTexEnvf,#function -glTexEnvf: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexEnvf), %g2 - or %g2, %lo(8 * _gloffset_TexEnvf), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexEnvf)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexEnvfv -.type glTexEnvfv,#function -glTexEnvfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexEnvfv), %g2 - or %g2, %lo(8 * _gloffset_TexEnvfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexEnvfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexEnvi -.type glTexEnvi,#function -glTexEnvi: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexEnvi), %g2 - or %g2, %lo(8 * _gloffset_TexEnvi), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexEnvi)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexEnviv -.type glTexEnviv,#function -glTexEnviv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexEnviv), %g2 - or %g2, %lo(8 * _gloffset_TexEnviv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexEnviv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexGend -.type glTexGend,#function -glTexGend: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexGend), %g2 - or %g2, %lo(8 * _gloffset_TexGend), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexGend)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexGendv -.type glTexGendv,#function -glTexGendv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexGendv), %g2 - or %g2, %lo(8 * _gloffset_TexGendv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexGendv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexGenf -.type glTexGenf,#function -glTexGenf: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexGenf), %g2 - or %g2, %lo(8 * _gloffset_TexGenf), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexGenf)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexGenfv -.type glTexGenfv,#function -glTexGenfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexGenfv), %g2 - or %g2, %lo(8 * _gloffset_TexGenfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexGenfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexGeni -.type glTexGeni,#function -glTexGeni: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexGeni), %g2 - or %g2, %lo(8 * _gloffset_TexGeni), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexGeni)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexGeniv -.type glTexGeniv,#function -glTexGeniv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexGeniv), %g2 - or %g2, %lo(8 * _gloffset_TexGeniv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexGeniv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFeedbackBuffer -.type glFeedbackBuffer,#function -glFeedbackBuffer: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FeedbackBuffer), %g2 - or %g2, %lo(8 * _gloffset_FeedbackBuffer), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FeedbackBuffer)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSelectBuffer -.type glSelectBuffer,#function -glSelectBuffer: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SelectBuffer), %g2 - or %g2, %lo(8 * _gloffset_SelectBuffer), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SelectBuffer)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRenderMode -.type glRenderMode,#function -glRenderMode: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RenderMode), %g2 - or %g2, %lo(8 * _gloffset_RenderMode), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RenderMode)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glInitNames -.type glInitNames,#function -glInitNames: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_InitNames), %g2 - or %g2, %lo(8 * _gloffset_InitNames), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_InitNames)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLoadName -.type glLoadName,#function -glLoadName: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LoadName), %g2 - or %g2, %lo(8 * _gloffset_LoadName), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LoadName)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPassThrough -.type glPassThrough,#function -glPassThrough: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PassThrough), %g2 - or %g2, %lo(8 * _gloffset_PassThrough), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PassThrough)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPopName -.type glPopName,#function -glPopName: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PopName), %g2 - or %g2, %lo(8 * _gloffset_PopName), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PopName)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPushName -.type glPushName,#function -glPushName: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PushName), %g2 - or %g2, %lo(8 * _gloffset_PushName), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PushName)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDrawBuffer -.type glDrawBuffer,#function -glDrawBuffer: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DrawBuffer), %g2 - or %g2, %lo(8 * _gloffset_DrawBuffer), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DrawBuffer)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glClear -.type glClear,#function -glClear: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Clear), %g2 - or %g2, %lo(8 * _gloffset_Clear), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Clear)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glClearAccum -.type glClearAccum,#function -glClearAccum: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ClearAccum), %g2 - or %g2, %lo(8 * _gloffset_ClearAccum), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ClearAccum)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glClearIndex -.type glClearIndex,#function -glClearIndex: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ClearIndex), %g2 - or %g2, %lo(8 * _gloffset_ClearIndex), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ClearIndex)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glClearColor -.type glClearColor,#function -glClearColor: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ClearColor), %g2 - or %g2, %lo(8 * _gloffset_ClearColor), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ClearColor)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glClearStencil -.type glClearStencil,#function -glClearStencil: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ClearStencil), %g2 - or %g2, %lo(8 * _gloffset_ClearStencil), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ClearStencil)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glClearDepth -.type glClearDepth,#function -glClearDepth: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ClearDepth), %g2 - or %g2, %lo(8 * _gloffset_ClearDepth), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ClearDepth)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glStencilMask -.type glStencilMask,#function -glStencilMask: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_StencilMask), %g2 - or %g2, %lo(8 * _gloffset_StencilMask), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_StencilMask)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColorMask -.type glColorMask,#function -glColorMask: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ColorMask), %g2 - or %g2, %lo(8 * _gloffset_ColorMask), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ColorMask)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDepthMask -.type glDepthMask,#function -glDepthMask: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DepthMask), %g2 - or %g2, %lo(8 * _gloffset_DepthMask), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DepthMask)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIndexMask -.type glIndexMask,#function -glIndexMask: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_IndexMask), %g2 - or %g2, %lo(8 * _gloffset_IndexMask), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_IndexMask)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glAccum -.type glAccum,#function -glAccum: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Accum), %g2 - or %g2, %lo(8 * _gloffset_Accum), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Accum)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDisable -.type glDisable,#function -glDisable: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Disable), %g2 - or %g2, %lo(8 * _gloffset_Disable), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Disable)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEnable -.type glEnable,#function -glEnable: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Enable), %g2 - or %g2, %lo(8 * _gloffset_Enable), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Enable)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFinish -.type glFinish,#function -glFinish: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Finish), %g2 - or %g2, %lo(8 * _gloffset_Finish), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Finish)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFlush -.type glFlush,#function -glFlush: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Flush), %g2 - or %g2, %lo(8 * _gloffset_Flush), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Flush)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPopAttrib -.type glPopAttrib,#function -glPopAttrib: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PopAttrib), %g2 - or %g2, %lo(8 * _gloffset_PopAttrib), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PopAttrib)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPushAttrib -.type glPushAttrib,#function -glPushAttrib: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PushAttrib), %g2 - or %g2, %lo(8 * _gloffset_PushAttrib), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PushAttrib)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMap1d -.type glMap1d,#function -glMap1d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Map1d), %g2 - or %g2, %lo(8 * _gloffset_Map1d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Map1d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMap1f -.type glMap1f,#function -glMap1f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Map1f), %g2 - or %g2, %lo(8 * _gloffset_Map1f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Map1f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMap2d -.type glMap2d,#function -glMap2d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Map2d), %g2 - or %g2, %lo(8 * _gloffset_Map2d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Map2d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMap2f -.type glMap2f,#function -glMap2f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Map2f), %g2 - or %g2, %lo(8 * _gloffset_Map2f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Map2f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMapGrid1d -.type glMapGrid1d,#function -glMapGrid1d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MapGrid1d), %g2 - or %g2, %lo(8 * _gloffset_MapGrid1d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MapGrid1d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMapGrid1f -.type glMapGrid1f,#function -glMapGrid1f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MapGrid1f), %g2 - or %g2, %lo(8 * _gloffset_MapGrid1f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MapGrid1f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMapGrid2d -.type glMapGrid2d,#function -glMapGrid2d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MapGrid2d), %g2 - or %g2, %lo(8 * _gloffset_MapGrid2d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MapGrid2d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMapGrid2f -.type glMapGrid2f,#function -glMapGrid2f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MapGrid2f), %g2 - or %g2, %lo(8 * _gloffset_MapGrid2f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MapGrid2f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEvalCoord1d -.type glEvalCoord1d,#function -glEvalCoord1d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EvalCoord1d), %g2 - or %g2, %lo(8 * _gloffset_EvalCoord1d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EvalCoord1d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEvalCoord1dv -.type glEvalCoord1dv,#function -glEvalCoord1dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EvalCoord1dv), %g2 - or %g2, %lo(8 * _gloffset_EvalCoord1dv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EvalCoord1dv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEvalCoord1f -.type glEvalCoord1f,#function -glEvalCoord1f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EvalCoord1f), %g2 - or %g2, %lo(8 * _gloffset_EvalCoord1f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EvalCoord1f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEvalCoord1fv -.type glEvalCoord1fv,#function -glEvalCoord1fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EvalCoord1fv), %g2 - or %g2, %lo(8 * _gloffset_EvalCoord1fv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EvalCoord1fv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEvalCoord2d -.type glEvalCoord2d,#function -glEvalCoord2d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EvalCoord2d), %g2 - or %g2, %lo(8 * _gloffset_EvalCoord2d), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EvalCoord2d)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEvalCoord2dv -.type glEvalCoord2dv,#function -glEvalCoord2dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EvalCoord2dv), %g2 - or %g2, %lo(8 * _gloffset_EvalCoord2dv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EvalCoord2dv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEvalCoord2f -.type glEvalCoord2f,#function -glEvalCoord2f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EvalCoord2f), %g2 - or %g2, %lo(8 * _gloffset_EvalCoord2f), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EvalCoord2f)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEvalCoord2fv -.type glEvalCoord2fv,#function -glEvalCoord2fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EvalCoord2fv), %g2 - or %g2, %lo(8 * _gloffset_EvalCoord2fv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EvalCoord2fv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEvalMesh1 -.type glEvalMesh1,#function -glEvalMesh1: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EvalMesh1), %g2 - or %g2, %lo(8 * _gloffset_EvalMesh1), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EvalMesh1)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEvalPoint1 -.type glEvalPoint1,#function -glEvalPoint1: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EvalPoint1), %g2 - or %g2, %lo(8 * _gloffset_EvalPoint1), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EvalPoint1)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEvalMesh2 -.type glEvalMesh2,#function -glEvalMesh2: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EvalMesh2), %g2 - or %g2, %lo(8 * _gloffset_EvalMesh2), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EvalMesh2)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEvalPoint2 -.type glEvalPoint2,#function -glEvalPoint2: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EvalPoint2), %g2 - or %g2, %lo(8 * _gloffset_EvalPoint2), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EvalPoint2)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glAlphaFunc -.type glAlphaFunc,#function -glAlphaFunc: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_AlphaFunc), %g2 - or %g2, %lo(8 * _gloffset_AlphaFunc), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_AlphaFunc)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBlendFunc -.type glBlendFunc,#function -glBlendFunc: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BlendFunc), %g2 - or %g2, %lo(8 * _gloffset_BlendFunc), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BlendFunc)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLogicOp -.type glLogicOp,#function -glLogicOp: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LogicOp), %g2 - or %g2, %lo(8 * _gloffset_LogicOp), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LogicOp)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glStencilFunc -.type glStencilFunc,#function -glStencilFunc: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_StencilFunc), %g2 - or %g2, %lo(8 * _gloffset_StencilFunc), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_StencilFunc)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glStencilOp -.type glStencilOp,#function -glStencilOp: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_StencilOp), %g2 - or %g2, %lo(8 * _gloffset_StencilOp), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_StencilOp)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDepthFunc -.type glDepthFunc,#function -glDepthFunc: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DepthFunc), %g2 - or %g2, %lo(8 * _gloffset_DepthFunc), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DepthFunc)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPixelZoom -.type glPixelZoom,#function -glPixelZoom: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PixelZoom), %g2 - or %g2, %lo(8 * _gloffset_PixelZoom), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PixelZoom)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPixelTransferf -.type glPixelTransferf,#function -glPixelTransferf: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PixelTransferf), %g2 - or %g2, %lo(8 * _gloffset_PixelTransferf), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PixelTransferf)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPixelTransferi -.type glPixelTransferi,#function -glPixelTransferi: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PixelTransferi), %g2 - or %g2, %lo(8 * _gloffset_PixelTransferi), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PixelTransferi)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPixelStoref -.type glPixelStoref,#function -glPixelStoref: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PixelStoref), %g2 - or %g2, %lo(8 * _gloffset_PixelStoref), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PixelStoref)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPixelStorei -.type glPixelStorei,#function -glPixelStorei: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PixelStorei), %g2 - or %g2, %lo(8 * _gloffset_PixelStorei), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PixelStorei)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPixelMapfv -.type glPixelMapfv,#function -glPixelMapfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PixelMapfv), %g2 - or %g2, %lo(8 * _gloffset_PixelMapfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PixelMapfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPixelMapuiv -.type glPixelMapuiv,#function -glPixelMapuiv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PixelMapuiv), %g2 - or %g2, %lo(8 * _gloffset_PixelMapuiv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PixelMapuiv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPixelMapusv -.type glPixelMapusv,#function -glPixelMapusv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PixelMapusv), %g2 - or %g2, %lo(8 * _gloffset_PixelMapusv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PixelMapusv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glReadBuffer -.type glReadBuffer,#function -glReadBuffer: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ReadBuffer), %g2 - or %g2, %lo(8 * _gloffset_ReadBuffer), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ReadBuffer)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyPixels -.type glCopyPixels,#function -glCopyPixels: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyPixels), %g2 - or %g2, %lo(8 * _gloffset_CopyPixels), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyPixels)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glReadPixels -.type glReadPixels,#function -glReadPixels: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ReadPixels), %g2 - or %g2, %lo(8 * _gloffset_ReadPixels), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ReadPixels)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDrawPixels -.type glDrawPixels,#function -glDrawPixels: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DrawPixels), %g2 - or %g2, %lo(8 * _gloffset_DrawPixels), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DrawPixels)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetBooleanv -.type glGetBooleanv,#function -glGetBooleanv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetBooleanv), %g2 - or %g2, %lo(8 * _gloffset_GetBooleanv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetBooleanv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetClipPlane -.type glGetClipPlane,#function -glGetClipPlane: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetClipPlane), %g2 - or %g2, %lo(8 * _gloffset_GetClipPlane), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetClipPlane)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetDoublev -.type glGetDoublev,#function -glGetDoublev: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetDoublev), %g2 - or %g2, %lo(8 * _gloffset_GetDoublev), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetDoublev)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetError -.type glGetError,#function -glGetError: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetError), %g2 - or %g2, %lo(8 * _gloffset_GetError), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetError)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetFloatv -.type glGetFloatv,#function -glGetFloatv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetFloatv), %g2 - or %g2, %lo(8 * _gloffset_GetFloatv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetFloatv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetIntegerv -.type glGetIntegerv,#function -glGetIntegerv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetIntegerv), %g2 - or %g2, %lo(8 * _gloffset_GetIntegerv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetIntegerv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetLightfv -.type glGetLightfv,#function -glGetLightfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetLightfv), %g2 - or %g2, %lo(8 * _gloffset_GetLightfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetLightfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetLightiv -.type glGetLightiv,#function -glGetLightiv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetLightiv), %g2 - or %g2, %lo(8 * _gloffset_GetLightiv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetLightiv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetMapdv -.type glGetMapdv,#function -glGetMapdv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetMapdv), %g2 - or %g2, %lo(8 * _gloffset_GetMapdv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetMapdv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetMapfv -.type glGetMapfv,#function -glGetMapfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetMapfv), %g2 - or %g2, %lo(8 * _gloffset_GetMapfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetMapfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetMapiv -.type glGetMapiv,#function -glGetMapiv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetMapiv), %g2 - or %g2, %lo(8 * _gloffset_GetMapiv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetMapiv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetMaterialfv -.type glGetMaterialfv,#function -glGetMaterialfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetMaterialfv), %g2 - or %g2, %lo(8 * _gloffset_GetMaterialfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetMaterialfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetMaterialiv -.type glGetMaterialiv,#function -glGetMaterialiv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetMaterialiv), %g2 - or %g2, %lo(8 * _gloffset_GetMaterialiv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetMaterialiv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetPixelMapfv -.type glGetPixelMapfv,#function -glGetPixelMapfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetPixelMapfv), %g2 - or %g2, %lo(8 * _gloffset_GetPixelMapfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetPixelMapfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetPixelMapuiv -.type glGetPixelMapuiv,#function -glGetPixelMapuiv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetPixelMapuiv), %g2 - or %g2, %lo(8 * _gloffset_GetPixelMapuiv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetPixelMapuiv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetPixelMapusv -.type glGetPixelMapusv,#function -glGetPixelMapusv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetPixelMapusv), %g2 - or %g2, %lo(8 * _gloffset_GetPixelMapusv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetPixelMapusv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetPolygonStipple -.type glGetPolygonStipple,#function -glGetPolygonStipple: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetPolygonStipple), %g2 - or %g2, %lo(8 * _gloffset_GetPolygonStipple), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetPolygonStipple)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetString -.type glGetString,#function -glGetString: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetString), %g2 - or %g2, %lo(8 * _gloffset_GetString), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetString)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetTexEnvfv -.type glGetTexEnvfv,#function -glGetTexEnvfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetTexEnvfv), %g2 - or %g2, %lo(8 * _gloffset_GetTexEnvfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetTexEnvfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetTexEnviv -.type glGetTexEnviv,#function -glGetTexEnviv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetTexEnviv), %g2 - or %g2, %lo(8 * _gloffset_GetTexEnviv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetTexEnviv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetTexGendv -.type glGetTexGendv,#function -glGetTexGendv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetTexGendv), %g2 - or %g2, %lo(8 * _gloffset_GetTexGendv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetTexGendv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetTexGenfv -.type glGetTexGenfv,#function -glGetTexGenfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetTexGenfv), %g2 - or %g2, %lo(8 * _gloffset_GetTexGenfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetTexGenfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetTexGeniv -.type glGetTexGeniv,#function -glGetTexGeniv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetTexGeniv), %g2 - or %g2, %lo(8 * _gloffset_GetTexGeniv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetTexGeniv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetTexImage -.type glGetTexImage,#function -glGetTexImage: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetTexImage), %g2 - or %g2, %lo(8 * _gloffset_GetTexImage), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetTexImage)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetTexParameterfv -.type glGetTexParameterfv,#function -glGetTexParameterfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetTexParameterfv), %g2 - or %g2, %lo(8 * _gloffset_GetTexParameterfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetTexParameterfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetTexParameteriv -.type glGetTexParameteriv,#function -glGetTexParameteriv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetTexParameteriv), %g2 - or %g2, %lo(8 * _gloffset_GetTexParameteriv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetTexParameteriv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetTexLevelParameterfv -.type glGetTexLevelParameterfv,#function -glGetTexLevelParameterfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetTexLevelParameterfv), %g2 - or %g2, %lo(8 * _gloffset_GetTexLevelParameterfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetTexLevelParameterfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetTexLevelParameteriv -.type glGetTexLevelParameteriv,#function -glGetTexLevelParameteriv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetTexLevelParameteriv), %g2 - or %g2, %lo(8 * _gloffset_GetTexLevelParameteriv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetTexLevelParameteriv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIsEnabled -.type glIsEnabled,#function -glIsEnabled: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_IsEnabled), %g2 - or %g2, %lo(8 * _gloffset_IsEnabled), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_IsEnabled)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIsList -.type glIsList,#function -glIsList: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_IsList), %g2 - or %g2, %lo(8 * _gloffset_IsList), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_IsList)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDepthRange -.type glDepthRange,#function -glDepthRange: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DepthRange), %g2 - or %g2, %lo(8 * _gloffset_DepthRange), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DepthRange)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFrustum -.type glFrustum,#function -glFrustum: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Frustum), %g2 - or %g2, %lo(8 * _gloffset_Frustum), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Frustum)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLoadIdentity -.type glLoadIdentity,#function -glLoadIdentity: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LoadIdentity), %g2 - or %g2, %lo(8 * _gloffset_LoadIdentity), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LoadIdentity)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLoadMatrixf -.type glLoadMatrixf,#function -glLoadMatrixf: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LoadMatrixf), %g2 - or %g2, %lo(8 * _gloffset_LoadMatrixf), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LoadMatrixf)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLoadMatrixd -.type glLoadMatrixd,#function -glLoadMatrixd: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LoadMatrixd), %g2 - or %g2, %lo(8 * _gloffset_LoadMatrixd), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LoadMatrixd)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMatrixMode -.type glMatrixMode,#function -glMatrixMode: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MatrixMode), %g2 - or %g2, %lo(8 * _gloffset_MatrixMode), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MatrixMode)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultMatrixf -.type glMultMatrixf,#function -glMultMatrixf: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultMatrixf), %g2 - or %g2, %lo(8 * _gloffset_MultMatrixf), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultMatrixf)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultMatrixd -.type glMultMatrixd,#function -glMultMatrixd: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultMatrixd), %g2 - or %g2, %lo(8 * _gloffset_MultMatrixd), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultMatrixd)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glOrtho -.type glOrtho,#function -glOrtho: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Ortho), %g2 - or %g2, %lo(8 * _gloffset_Ortho), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Ortho)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPopMatrix -.type glPopMatrix,#function -glPopMatrix: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PopMatrix), %g2 - or %g2, %lo(8 * _gloffset_PopMatrix), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PopMatrix)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPushMatrix -.type glPushMatrix,#function -glPushMatrix: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PushMatrix), %g2 - or %g2, %lo(8 * _gloffset_PushMatrix), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PushMatrix)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRotated -.type glRotated,#function -glRotated: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Rotated), %g2 - or %g2, %lo(8 * _gloffset_Rotated), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Rotated)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRotatef -.type glRotatef,#function -glRotatef: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Rotatef), %g2 - or %g2, %lo(8 * _gloffset_Rotatef), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Rotatef)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glScaled -.type glScaled,#function -glScaled: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Scaled), %g2 - or %g2, %lo(8 * _gloffset_Scaled), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Scaled)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glScalef -.type glScalef,#function -glScalef: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Scalef), %g2 - or %g2, %lo(8 * _gloffset_Scalef), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Scalef)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTranslated -.type glTranslated,#function -glTranslated: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Translated), %g2 - or %g2, %lo(8 * _gloffset_Translated), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Translated)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTranslatef -.type glTranslatef,#function -glTranslatef: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Translatef), %g2 - or %g2, %lo(8 * _gloffset_Translatef), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Translatef)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glViewport -.type glViewport,#function -glViewport: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Viewport), %g2 - or %g2, %lo(8 * _gloffset_Viewport), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Viewport)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glArrayElement -.type glArrayElement,#function -glArrayElement: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ArrayElement), %g2 - or %g2, %lo(8 * _gloffset_ArrayElement), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ArrayElement)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColorPointer -.type glColorPointer,#function -glColorPointer: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ColorPointer), %g2 - or %g2, %lo(8 * _gloffset_ColorPointer), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ColorPointer)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDisableClientState -.type glDisableClientState,#function -glDisableClientState: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DisableClientState), %g2 - or %g2, %lo(8 * _gloffset_DisableClientState), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DisableClientState)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDrawArrays -.type glDrawArrays,#function -glDrawArrays: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DrawArrays), %g2 - or %g2, %lo(8 * _gloffset_DrawArrays), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DrawArrays)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDrawElements -.type glDrawElements,#function -glDrawElements: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DrawElements), %g2 - or %g2, %lo(8 * _gloffset_DrawElements), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DrawElements)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEdgeFlagPointer -.type glEdgeFlagPointer,#function -glEdgeFlagPointer: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EdgeFlagPointer), %g2 - or %g2, %lo(8 * _gloffset_EdgeFlagPointer), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EdgeFlagPointer)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEnableClientState -.type glEnableClientState,#function -glEnableClientState: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EnableClientState), %g2 - or %g2, %lo(8 * _gloffset_EnableClientState), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EnableClientState)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetPointerv -.type glGetPointerv,#function -glGetPointerv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetPointerv), %g2 - or %g2, %lo(8 * _gloffset_GetPointerv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetPointerv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIndexPointer -.type glIndexPointer,#function -glIndexPointer: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_IndexPointer), %g2 - or %g2, %lo(8 * _gloffset_IndexPointer), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_IndexPointer)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glInterleavedArrays -.type glInterleavedArrays,#function -glInterleavedArrays: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_InterleavedArrays), %g2 - or %g2, %lo(8 * _gloffset_InterleavedArrays), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_InterleavedArrays)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glNormalPointer -.type glNormalPointer,#function -glNormalPointer: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_NormalPointer), %g2 - or %g2, %lo(8 * _gloffset_NormalPointer), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_NormalPointer)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoordPointer -.type glTexCoordPointer,#function -glTexCoordPointer: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoordPointer), %g2 - or %g2, %lo(8 * _gloffset_TexCoordPointer), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoordPointer)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexPointer -.type glVertexPointer,#function -glVertexPointer: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexPointer), %g2 - or %g2, %lo(8 * _gloffset_VertexPointer), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexPointer)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPolygonOffset -.type glPolygonOffset,#function -glPolygonOffset: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PolygonOffset), %g2 - or %g2, %lo(8 * _gloffset_PolygonOffset), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PolygonOffset)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyTexImage1D -.type glCopyTexImage1D,#function -glCopyTexImage1D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyTexImage1D), %g2 - or %g2, %lo(8 * _gloffset_CopyTexImage1D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyTexImage1D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyTexImage2D -.type glCopyTexImage2D,#function -glCopyTexImage2D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyTexImage2D), %g2 - or %g2, %lo(8 * _gloffset_CopyTexImage2D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyTexImage2D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyTexSubImage1D -.type glCopyTexSubImage1D,#function -glCopyTexSubImage1D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyTexSubImage1D), %g2 - or %g2, %lo(8 * _gloffset_CopyTexSubImage1D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyTexSubImage1D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyTexSubImage2D -.type glCopyTexSubImage2D,#function -glCopyTexSubImage2D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyTexSubImage2D), %g2 - or %g2, %lo(8 * _gloffset_CopyTexSubImage2D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyTexSubImage2D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexSubImage1D -.type glTexSubImage1D,#function -glTexSubImage1D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexSubImage1D), %g2 - or %g2, %lo(8 * _gloffset_TexSubImage1D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexSubImage1D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexSubImage2D -.type glTexSubImage2D,#function -glTexSubImage2D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexSubImage2D), %g2 - or %g2, %lo(8 * _gloffset_TexSubImage2D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexSubImage2D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glAreTexturesResident -.type glAreTexturesResident,#function -glAreTexturesResident: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_AreTexturesResident), %g2 - or %g2, %lo(8 * _gloffset_AreTexturesResident), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_AreTexturesResident)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBindTexture -.type glBindTexture,#function -glBindTexture: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BindTexture), %g2 - or %g2, %lo(8 * _gloffset_BindTexture), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BindTexture)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDeleteTextures -.type glDeleteTextures,#function -glDeleteTextures: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DeleteTextures), %g2 - or %g2, %lo(8 * _gloffset_DeleteTextures), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DeleteTextures)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGenTextures -.type glGenTextures,#function -glGenTextures: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GenTextures), %g2 - or %g2, %lo(8 * _gloffset_GenTextures), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GenTextures)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIsTexture -.type glIsTexture,#function -glIsTexture: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_IsTexture), %g2 - or %g2, %lo(8 * _gloffset_IsTexture), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_IsTexture)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPrioritizeTextures -.type glPrioritizeTextures,#function -glPrioritizeTextures: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PrioritizeTextures), %g2 - or %g2, %lo(8 * _gloffset_PrioritizeTextures), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PrioritizeTextures)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIndexub -.type glIndexub,#function -glIndexub: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Indexub), %g2 - or %g2, %lo(8 * _gloffset_Indexub), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Indexub)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIndexubv -.type glIndexubv,#function -glIndexubv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Indexubv), %g2 - or %g2, %lo(8 * _gloffset_Indexubv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Indexubv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPopClientAttrib -.type glPopClientAttrib,#function -glPopClientAttrib: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PopClientAttrib), %g2 - or %g2, %lo(8 * _gloffset_PopClientAttrib), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PopClientAttrib)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPushClientAttrib -.type glPushClientAttrib,#function -glPushClientAttrib: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PushClientAttrib), %g2 - or %g2, %lo(8 * _gloffset_PushClientAttrib), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PushClientAttrib)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBlendColor -.type glBlendColor,#function -glBlendColor: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BlendColor), %g2 - or %g2, %lo(8 * _gloffset_BlendColor), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BlendColor)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBlendEquation -.type glBlendEquation,#function -glBlendEquation: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BlendEquation), %g2 - or %g2, %lo(8 * _gloffset_BlendEquation), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BlendEquation)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDrawRangeElements -.type glDrawRangeElements,#function -glDrawRangeElements: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DrawRangeElements), %g2 - or %g2, %lo(8 * _gloffset_DrawRangeElements), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DrawRangeElements)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColorTable -.type glColorTable,#function -glColorTable: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ColorTable), %g2 - or %g2, %lo(8 * _gloffset_ColorTable), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ColorTable)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColorTableParameterfv -.type glColorTableParameterfv,#function -glColorTableParameterfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ColorTableParameterfv), %g2 - or %g2, %lo(8 * _gloffset_ColorTableParameterfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ColorTableParameterfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColorTableParameteriv -.type glColorTableParameteriv,#function -glColorTableParameteriv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ColorTableParameteriv), %g2 - or %g2, %lo(8 * _gloffset_ColorTableParameteriv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ColorTableParameteriv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyColorTable -.type glCopyColorTable,#function -glCopyColorTable: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyColorTable), %g2 - or %g2, %lo(8 * _gloffset_CopyColorTable), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyColorTable)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetColorTable -.type glGetColorTable,#function -glGetColorTable: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetColorTable), %g2 - or %g2, %lo(8 * _gloffset_GetColorTable), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetColorTable)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetColorTableParameterfv -.type glGetColorTableParameterfv,#function -glGetColorTableParameterfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetColorTableParameterfv), %g2 - or %g2, %lo(8 * _gloffset_GetColorTableParameterfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetColorTableParameterfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetColorTableParameteriv -.type glGetColorTableParameteriv,#function -glGetColorTableParameteriv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetColorTableParameteriv), %g2 - or %g2, %lo(8 * _gloffset_GetColorTableParameteriv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetColorTableParameteriv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColorSubTable -.type glColorSubTable,#function -glColorSubTable: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ColorSubTable), %g2 - or %g2, %lo(8 * _gloffset_ColorSubTable), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ColorSubTable)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyColorSubTable -.type glCopyColorSubTable,#function -glCopyColorSubTable: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyColorSubTable), %g2 - or %g2, %lo(8 * _gloffset_CopyColorSubTable), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyColorSubTable)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glConvolutionFilter1D -.type glConvolutionFilter1D,#function -glConvolutionFilter1D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ConvolutionFilter1D), %g2 - or %g2, %lo(8 * _gloffset_ConvolutionFilter1D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ConvolutionFilter1D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glConvolutionFilter2D -.type glConvolutionFilter2D,#function -glConvolutionFilter2D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ConvolutionFilter2D), %g2 - or %g2, %lo(8 * _gloffset_ConvolutionFilter2D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ConvolutionFilter2D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glConvolutionParameterf -.type glConvolutionParameterf,#function -glConvolutionParameterf: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ConvolutionParameterf), %g2 - or %g2, %lo(8 * _gloffset_ConvolutionParameterf), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ConvolutionParameterf)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glConvolutionParameterfv -.type glConvolutionParameterfv,#function -glConvolutionParameterfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ConvolutionParameterfv), %g2 - or %g2, %lo(8 * _gloffset_ConvolutionParameterfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ConvolutionParameterfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glConvolutionParameteri -.type glConvolutionParameteri,#function -glConvolutionParameteri: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ConvolutionParameteri), %g2 - or %g2, %lo(8 * _gloffset_ConvolutionParameteri), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ConvolutionParameteri)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glConvolutionParameteriv -.type glConvolutionParameteriv,#function -glConvolutionParameteriv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ConvolutionParameteriv), %g2 - or %g2, %lo(8 * _gloffset_ConvolutionParameteriv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ConvolutionParameteriv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyConvolutionFilter1D -.type glCopyConvolutionFilter1D,#function -glCopyConvolutionFilter1D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyConvolutionFilter1D), %g2 - or %g2, %lo(8 * _gloffset_CopyConvolutionFilter1D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyConvolutionFilter1D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyConvolutionFilter2D -.type glCopyConvolutionFilter2D,#function -glCopyConvolutionFilter2D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyConvolutionFilter2D), %g2 - or %g2, %lo(8 * _gloffset_CopyConvolutionFilter2D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyConvolutionFilter2D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetConvolutionFilter -.type glGetConvolutionFilter,#function -glGetConvolutionFilter: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetConvolutionFilter), %g2 - or %g2, %lo(8 * _gloffset_GetConvolutionFilter), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetConvolutionFilter)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetConvolutionParameterfv -.type glGetConvolutionParameterfv,#function -glGetConvolutionParameterfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetConvolutionParameterfv), %g2 - or %g2, %lo(8 * _gloffset_GetConvolutionParameterfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetConvolutionParameterfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetConvolutionParameteriv -.type glGetConvolutionParameteriv,#function -glGetConvolutionParameteriv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetConvolutionParameteriv), %g2 - or %g2, %lo(8 * _gloffset_GetConvolutionParameteriv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetConvolutionParameteriv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetSeparableFilter -.type glGetSeparableFilter,#function -glGetSeparableFilter: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetSeparableFilter), %g2 - or %g2, %lo(8 * _gloffset_GetSeparableFilter), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetSeparableFilter)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSeparableFilter2D -.type glSeparableFilter2D,#function -glSeparableFilter2D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SeparableFilter2D), %g2 - or %g2, %lo(8 * _gloffset_SeparableFilter2D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SeparableFilter2D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetHistogram -.type glGetHistogram,#function -glGetHistogram: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetHistogram), %g2 - or %g2, %lo(8 * _gloffset_GetHistogram), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetHistogram)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetHistogramParameterfv -.type glGetHistogramParameterfv,#function -glGetHistogramParameterfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetHistogramParameterfv), %g2 - or %g2, %lo(8 * _gloffset_GetHistogramParameterfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetHistogramParameterfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetHistogramParameteriv -.type glGetHistogramParameteriv,#function -glGetHistogramParameteriv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetHistogramParameteriv), %g2 - or %g2, %lo(8 * _gloffset_GetHistogramParameteriv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetHistogramParameteriv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetMinmax -.type glGetMinmax,#function -glGetMinmax: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetMinmax), %g2 - or %g2, %lo(8 * _gloffset_GetMinmax), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetMinmax)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetMinmaxParameterfv -.type glGetMinmaxParameterfv,#function -glGetMinmaxParameterfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetMinmaxParameterfv), %g2 - or %g2, %lo(8 * _gloffset_GetMinmaxParameterfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetMinmaxParameterfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetMinmaxParameteriv -.type glGetMinmaxParameteriv,#function -glGetMinmaxParameteriv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetMinmaxParameteriv), %g2 - or %g2, %lo(8 * _gloffset_GetMinmaxParameteriv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetMinmaxParameteriv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glHistogram -.type glHistogram,#function -glHistogram: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Histogram), %g2 - or %g2, %lo(8 * _gloffset_Histogram), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Histogram)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMinmax -.type glMinmax,#function -glMinmax: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Minmax), %g2 - or %g2, %lo(8 * _gloffset_Minmax), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Minmax)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glResetHistogram -.type glResetHistogram,#function -glResetHistogram: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ResetHistogram), %g2 - or %g2, %lo(8 * _gloffset_ResetHistogram), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ResetHistogram)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glResetMinmax -.type glResetMinmax,#function -glResetMinmax: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ResetMinmax), %g2 - or %g2, %lo(8 * _gloffset_ResetMinmax), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ResetMinmax)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexImage3D -.type glTexImage3D,#function -glTexImage3D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexImage3D), %g2 - or %g2, %lo(8 * _gloffset_TexImage3D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexImage3D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexSubImage3D -.type glTexSubImage3D,#function -glTexSubImage3D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexSubImage3D), %g2 - or %g2, %lo(8 * _gloffset_TexSubImage3D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexSubImage3D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyTexSubImage3D -.type glCopyTexSubImage3D,#function -glCopyTexSubImage3D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyTexSubImage3D), %g2 - or %g2, %lo(8 * _gloffset_CopyTexSubImage3D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyTexSubImage3D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glActiveTextureARB -.type glActiveTextureARB,#function -glActiveTextureARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ActiveTextureARB), %g2 - or %g2, %lo(8 * _gloffset_ActiveTextureARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ActiveTextureARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glClientActiveTextureARB -.type glClientActiveTextureARB,#function -glClientActiveTextureARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ClientActiveTextureARB), %g2 - or %g2, %lo(8 * _gloffset_ClientActiveTextureARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ClientActiveTextureARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord1dARB -.type glMultiTexCoord1dARB,#function -glMultiTexCoord1dARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord1dARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord1dARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord1dARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord1dvARB -.type glMultiTexCoord1dvARB,#function -glMultiTexCoord1dvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord1dvARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord1dvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord1dvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord1fARB -.type glMultiTexCoord1fARB,#function -glMultiTexCoord1fARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord1fARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord1fARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord1fARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord1fvARB -.type glMultiTexCoord1fvARB,#function -glMultiTexCoord1fvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord1fvARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord1fvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord1fvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord1iARB -.type glMultiTexCoord1iARB,#function -glMultiTexCoord1iARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord1iARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord1iARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord1iARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord1ivARB -.type glMultiTexCoord1ivARB,#function -glMultiTexCoord1ivARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord1ivARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord1ivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord1ivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord1sARB -.type glMultiTexCoord1sARB,#function -glMultiTexCoord1sARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord1sARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord1sARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord1sARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord1svARB -.type glMultiTexCoord1svARB,#function -glMultiTexCoord1svARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord1svARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord1svARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord1svARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord2dARB -.type glMultiTexCoord2dARB,#function -glMultiTexCoord2dARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord2dARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord2dARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord2dARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord2dvARB -.type glMultiTexCoord2dvARB,#function -glMultiTexCoord2dvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord2dvARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord2dvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord2dvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord2fARB -.type glMultiTexCoord2fARB,#function -glMultiTexCoord2fARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord2fARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord2fARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord2fARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord2fvARB -.type glMultiTexCoord2fvARB,#function -glMultiTexCoord2fvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord2fvARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord2fvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord2fvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord2iARB -.type glMultiTexCoord2iARB,#function -glMultiTexCoord2iARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord2iARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord2iARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord2iARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord2ivARB -.type glMultiTexCoord2ivARB,#function -glMultiTexCoord2ivARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord2ivARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord2ivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord2ivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord2sARB -.type glMultiTexCoord2sARB,#function -glMultiTexCoord2sARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord2sARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord2sARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord2sARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord2svARB -.type glMultiTexCoord2svARB,#function -glMultiTexCoord2svARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord2svARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord2svARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord2svARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord3dARB -.type glMultiTexCoord3dARB,#function -glMultiTexCoord3dARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord3dARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord3dARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord3dARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord3dvARB -.type glMultiTexCoord3dvARB,#function -glMultiTexCoord3dvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord3dvARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord3dvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord3dvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord3fARB -.type glMultiTexCoord3fARB,#function -glMultiTexCoord3fARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord3fARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord3fARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord3fARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord3fvARB -.type glMultiTexCoord3fvARB,#function -glMultiTexCoord3fvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord3fvARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord3fvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord3fvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord3iARB -.type glMultiTexCoord3iARB,#function -glMultiTexCoord3iARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord3iARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord3iARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord3iARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord3ivARB -.type glMultiTexCoord3ivARB,#function -glMultiTexCoord3ivARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord3ivARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord3ivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord3ivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord3sARB -.type glMultiTexCoord3sARB,#function -glMultiTexCoord3sARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord3sARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord3sARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord3sARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord3svARB -.type glMultiTexCoord3svARB,#function -glMultiTexCoord3svARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord3svARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord3svARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord3svARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord4dARB -.type glMultiTexCoord4dARB,#function -glMultiTexCoord4dARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord4dARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord4dARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord4dARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord4dvARB -.type glMultiTexCoord4dvARB,#function -glMultiTexCoord4dvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord4dvARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord4dvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord4dvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord4fARB -.type glMultiTexCoord4fARB,#function -glMultiTexCoord4fARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord4fARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord4fARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord4fARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord4fvARB -.type glMultiTexCoord4fvARB,#function -glMultiTexCoord4fvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord4fvARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord4fvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord4fvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord4iARB -.type glMultiTexCoord4iARB,#function -glMultiTexCoord4iARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord4iARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord4iARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord4iARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord4ivARB -.type glMultiTexCoord4ivARB,#function -glMultiTexCoord4ivARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord4ivARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord4ivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord4ivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord4sARB -.type glMultiTexCoord4sARB,#function -glMultiTexCoord4sARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord4sARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord4sARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord4sARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord4svARB -.type glMultiTexCoord4svARB,#function -glMultiTexCoord4svARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord4svARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord4svARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord4svARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLoadTransposeMatrixfARB -.type glLoadTransposeMatrixfARB,#function -glLoadTransposeMatrixfARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LoadTransposeMatrixfARB), %g2 - or %g2, %lo(8 * _gloffset_LoadTransposeMatrixfARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LoadTransposeMatrixfARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLoadTransposeMatrixdARB -.type glLoadTransposeMatrixdARB,#function -glLoadTransposeMatrixdARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LoadTransposeMatrixdARB), %g2 - or %g2, %lo(8 * _gloffset_LoadTransposeMatrixdARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LoadTransposeMatrixdARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultTransposeMatrixfARB -.type glMultTransposeMatrixfARB,#function -glMultTransposeMatrixfARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultTransposeMatrixfARB), %g2 - or %g2, %lo(8 * _gloffset_MultTransposeMatrixfARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultTransposeMatrixfARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultTransposeMatrixdARB -.type glMultTransposeMatrixdARB,#function -glMultTransposeMatrixdARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultTransposeMatrixdARB), %g2 - or %g2, %lo(8 * _gloffset_MultTransposeMatrixdARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultTransposeMatrixdARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSampleCoverageARB -.type glSampleCoverageARB,#function -glSampleCoverageARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SampleCoverageARB), %g2 - or %g2, %lo(8 * _gloffset_SampleCoverageARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SampleCoverageARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl gl__unused413 -.type gl__unused413,#function -gl__unused413: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset___unused413), %g2 - or %g2, %lo(8 * _gloffset___unused413), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset___unused413)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCompressedTexImage3DARB -.type glCompressedTexImage3DARB,#function -glCompressedTexImage3DARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CompressedTexImage3DARB), %g2 - or %g2, %lo(8 * _gloffset_CompressedTexImage3DARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CompressedTexImage3DARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCompressedTexImage2DARB -.type glCompressedTexImage2DARB,#function -glCompressedTexImage2DARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CompressedTexImage2DARB), %g2 - or %g2, %lo(8 * _gloffset_CompressedTexImage2DARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CompressedTexImage2DARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCompressedTexImage1DARB -.type glCompressedTexImage1DARB,#function -glCompressedTexImage1DARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CompressedTexImage1DARB), %g2 - or %g2, %lo(8 * _gloffset_CompressedTexImage1DARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CompressedTexImage1DARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCompressedTexSubImage3DARB -.type glCompressedTexSubImage3DARB,#function -glCompressedTexSubImage3DARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CompressedTexSubImage3DARB), %g2 - or %g2, %lo(8 * _gloffset_CompressedTexSubImage3DARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CompressedTexSubImage3DARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCompressedTexSubImage2DARB -.type glCompressedTexSubImage2DARB,#function -glCompressedTexSubImage2DARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CompressedTexSubImage2DARB), %g2 - or %g2, %lo(8 * _gloffset_CompressedTexSubImage2DARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CompressedTexSubImage2DARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCompressedTexSubImage1DARB -.type glCompressedTexSubImage1DARB,#function -glCompressedTexSubImage1DARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CompressedTexSubImage1DARB), %g2 - or %g2, %lo(8 * _gloffset_CompressedTexSubImage1DARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CompressedTexSubImage1DARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetCompressedTexImageARB -.type glGetCompressedTexImageARB,#function -glGetCompressedTexImageARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetCompressedTexImageARB), %g2 - or %g2, %lo(8 * _gloffset_GetCompressedTexImageARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetCompressedTexImageARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glActiveTexture -.type glActiveTexture,#function -glActiveTexture: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ActiveTextureARB), %g2 - or %g2, %lo(8 * _gloffset_ActiveTextureARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ActiveTextureARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glClientActiveTexture -.type glClientActiveTexture,#function -glClientActiveTexture: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ClientActiveTextureARB), %g2 - or %g2, %lo(8 * _gloffset_ClientActiveTextureARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ClientActiveTextureARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord1d -.type glMultiTexCoord1d,#function -glMultiTexCoord1d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord1dARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord1dARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord1dARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord1dv -.type glMultiTexCoord1dv,#function -glMultiTexCoord1dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord1dvARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord1dvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord1dvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord1f -.type glMultiTexCoord1f,#function -glMultiTexCoord1f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord1fARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord1fARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord1fARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord1fv -.type glMultiTexCoord1fv,#function -glMultiTexCoord1fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord1fvARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord1fvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord1fvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord1i -.type glMultiTexCoord1i,#function -glMultiTexCoord1i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord1iARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord1iARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord1iARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord1iv -.type glMultiTexCoord1iv,#function -glMultiTexCoord1iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord1ivARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord1ivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord1ivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord1s -.type glMultiTexCoord1s,#function -glMultiTexCoord1s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord1sARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord1sARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord1sARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord1sv -.type glMultiTexCoord1sv,#function -glMultiTexCoord1sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord1svARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord1svARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord1svARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord2d -.type glMultiTexCoord2d,#function -glMultiTexCoord2d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord2dARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord2dARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord2dARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord2dv -.type glMultiTexCoord2dv,#function -glMultiTexCoord2dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord2dvARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord2dvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord2dvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord2f -.type glMultiTexCoord2f,#function -glMultiTexCoord2f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord2fARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord2fARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord2fARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord2fv -.type glMultiTexCoord2fv,#function -glMultiTexCoord2fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord2fvARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord2fvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord2fvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord2i -.type glMultiTexCoord2i,#function -glMultiTexCoord2i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord2iARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord2iARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord2iARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord2iv -.type glMultiTexCoord2iv,#function -glMultiTexCoord2iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord2ivARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord2ivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord2ivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord2s -.type glMultiTexCoord2s,#function -glMultiTexCoord2s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord2sARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord2sARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord2sARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord2sv -.type glMultiTexCoord2sv,#function -glMultiTexCoord2sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord2svARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord2svARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord2svARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord3d -.type glMultiTexCoord3d,#function -glMultiTexCoord3d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord3dARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord3dARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord3dARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord3dv -.type glMultiTexCoord3dv,#function -glMultiTexCoord3dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord3dvARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord3dvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord3dvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord3f -.type glMultiTexCoord3f,#function -glMultiTexCoord3f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord3fARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord3fARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord3fARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord3fv -.type glMultiTexCoord3fv,#function -glMultiTexCoord3fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord3fvARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord3fvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord3fvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord3i -.type glMultiTexCoord3i,#function -glMultiTexCoord3i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord3iARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord3iARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord3iARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord3iv -.type glMultiTexCoord3iv,#function -glMultiTexCoord3iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord3ivARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord3ivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord3ivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord3s -.type glMultiTexCoord3s,#function -glMultiTexCoord3s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord3sARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord3sARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord3sARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord3sv -.type glMultiTexCoord3sv,#function -glMultiTexCoord3sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord3svARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord3svARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord3svARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord4d -.type glMultiTexCoord4d,#function -glMultiTexCoord4d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord4dARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord4dARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord4dARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord4dv -.type glMultiTexCoord4dv,#function -glMultiTexCoord4dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord4dvARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord4dvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord4dvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord4f -.type glMultiTexCoord4f,#function -glMultiTexCoord4f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord4fARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord4fARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord4fARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord4fv -.type glMultiTexCoord4fv,#function -glMultiTexCoord4fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord4fvARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord4fvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord4fvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord4i -.type glMultiTexCoord4i,#function -glMultiTexCoord4i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord4iARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord4iARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord4iARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord4iv -.type glMultiTexCoord4iv,#function -glMultiTexCoord4iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord4ivARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord4ivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord4ivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord4s -.type glMultiTexCoord4s,#function -glMultiTexCoord4s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord4sARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord4sARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord4sARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiTexCoord4sv -.type glMultiTexCoord4sv,#function -glMultiTexCoord4sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiTexCoord4svARB), %g2 - or %g2, %lo(8 * _gloffset_MultiTexCoord4svARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiTexCoord4svARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLoadTransposeMatrixf -.type glLoadTransposeMatrixf,#function -glLoadTransposeMatrixf: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LoadTransposeMatrixfARB), %g2 - or %g2, %lo(8 * _gloffset_LoadTransposeMatrixfARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LoadTransposeMatrixfARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLoadTransposeMatrixd -.type glLoadTransposeMatrixd,#function -glLoadTransposeMatrixd: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LoadTransposeMatrixdARB), %g2 - or %g2, %lo(8 * _gloffset_LoadTransposeMatrixdARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LoadTransposeMatrixdARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultTransposeMatrixf -.type glMultTransposeMatrixf,#function -glMultTransposeMatrixf: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultTransposeMatrixfARB), %g2 - or %g2, %lo(8 * _gloffset_MultTransposeMatrixfARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultTransposeMatrixfARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultTransposeMatrixd -.type glMultTransposeMatrixd,#function -glMultTransposeMatrixd: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultTransposeMatrixdARB), %g2 - or %g2, %lo(8 * _gloffset_MultTransposeMatrixdARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultTransposeMatrixdARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSampleCoverage -.type glSampleCoverage,#function -glSampleCoverage: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SampleCoverageARB), %g2 - or %g2, %lo(8 * _gloffset_SampleCoverageARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SampleCoverageARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCompressedTexImage3D -.type glCompressedTexImage3D,#function -glCompressedTexImage3D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CompressedTexImage3DARB), %g2 - or %g2, %lo(8 * _gloffset_CompressedTexImage3DARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CompressedTexImage3DARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCompressedTexImage2D -.type glCompressedTexImage2D,#function -glCompressedTexImage2D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CompressedTexImage2DARB), %g2 - or %g2, %lo(8 * _gloffset_CompressedTexImage2DARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CompressedTexImage2DARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCompressedTexImage1D -.type glCompressedTexImage1D,#function -glCompressedTexImage1D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CompressedTexImage1DARB), %g2 - or %g2, %lo(8 * _gloffset_CompressedTexImage1DARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CompressedTexImage1DARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCompressedTexSubImage3D -.type glCompressedTexSubImage3D,#function -glCompressedTexSubImage3D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CompressedTexSubImage3DARB), %g2 - or %g2, %lo(8 * _gloffset_CompressedTexSubImage3DARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CompressedTexSubImage3DARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCompressedTexSubImage2D -.type glCompressedTexSubImage2D,#function -glCompressedTexSubImage2D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CompressedTexSubImage2DARB), %g2 - or %g2, %lo(8 * _gloffset_CompressedTexSubImage2DARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CompressedTexSubImage2DARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCompressedTexSubImage1D -.type glCompressedTexSubImage1D,#function -glCompressedTexSubImage1D: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CompressedTexSubImage1DARB), %g2 - or %g2, %lo(8 * _gloffset_CompressedTexSubImage1DARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CompressedTexSubImage1DARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetCompressedTexImage -.type glGetCompressedTexImage,#function -glGetCompressedTexImage: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetCompressedTexImageARB), %g2 - or %g2, %lo(8 * _gloffset_GetCompressedTexImageARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetCompressedTexImageARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBlendColorEXT -.type glBlendColorEXT,#function -glBlendColorEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BlendColor), %g2 - or %g2, %lo(8 * _gloffset_BlendColor), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BlendColor)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPolygonOffsetEXT -.type glPolygonOffsetEXT,#function -glPolygonOffsetEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PolygonOffsetEXT), %g2 - or %g2, %lo(8 * _gloffset_PolygonOffsetEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PolygonOffsetEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexImage3DEXT -.type glTexImage3DEXT,#function -glTexImage3DEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexImage3D), %g2 - or %g2, %lo(8 * _gloffset_TexImage3D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexImage3D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexSubImage3DEXT -.type glTexSubImage3DEXT,#function -glTexSubImage3DEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexSubImage3D), %g2 - or %g2, %lo(8 * _gloffset_TexSubImage3D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexSubImage3D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetTexFilterFuncSGIS -.type glGetTexFilterFuncSGIS,#function -glGetTexFilterFuncSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetTexFilterFuncSGIS), %g2 - or %g2, %lo(8 * _gloffset_GetTexFilterFuncSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetTexFilterFuncSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexFilterFuncSGIS -.type glTexFilterFuncSGIS,#function -glTexFilterFuncSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexFilterFuncSGIS), %g2 - or %g2, %lo(8 * _gloffset_TexFilterFuncSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexFilterFuncSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexSubImage1DEXT -.type glTexSubImage1DEXT,#function -glTexSubImage1DEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexSubImage1D), %g2 - or %g2, %lo(8 * _gloffset_TexSubImage1D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexSubImage1D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexSubImage2DEXT -.type glTexSubImage2DEXT,#function -glTexSubImage2DEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexSubImage2D), %g2 - or %g2, %lo(8 * _gloffset_TexSubImage2D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexSubImage2D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyTexImage1DEXT -.type glCopyTexImage1DEXT,#function -glCopyTexImage1DEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyTexImage1D), %g2 - or %g2, %lo(8 * _gloffset_CopyTexImage1D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyTexImage1D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyTexImage2DEXT -.type glCopyTexImage2DEXT,#function -glCopyTexImage2DEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyTexImage2D), %g2 - or %g2, %lo(8 * _gloffset_CopyTexImage2D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyTexImage2D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyTexSubImage1DEXT -.type glCopyTexSubImage1DEXT,#function -glCopyTexSubImage1DEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyTexSubImage1D), %g2 - or %g2, %lo(8 * _gloffset_CopyTexSubImage1D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyTexSubImage1D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyTexSubImage2DEXT -.type glCopyTexSubImage2DEXT,#function -glCopyTexSubImage2DEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyTexSubImage2D), %g2 - or %g2, %lo(8 * _gloffset_CopyTexSubImage2D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyTexSubImage2D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyTexSubImage3DEXT -.type glCopyTexSubImage3DEXT,#function -glCopyTexSubImage3DEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyTexSubImage3D), %g2 - or %g2, %lo(8 * _gloffset_CopyTexSubImage3D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyTexSubImage3D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetHistogramEXT -.type glGetHistogramEXT,#function -glGetHistogramEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetHistogramEXT), %g2 - or %g2, %lo(8 * _gloffset_GetHistogramEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetHistogramEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetHistogramParameterfvEXT -.type glGetHistogramParameterfvEXT,#function -glGetHistogramParameterfvEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetHistogramParameterfvEXT), %g2 - or %g2, %lo(8 * _gloffset_GetHistogramParameterfvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetHistogramParameterfvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetHistogramParameterivEXT -.type glGetHistogramParameterivEXT,#function -glGetHistogramParameterivEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetHistogramParameterivEXT), %g2 - or %g2, %lo(8 * _gloffset_GetHistogramParameterivEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetHistogramParameterivEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetMinmaxEXT -.type glGetMinmaxEXT,#function -glGetMinmaxEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetMinmaxEXT), %g2 - or %g2, %lo(8 * _gloffset_GetMinmaxEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetMinmaxEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetMinmaxParameterfvEXT -.type glGetMinmaxParameterfvEXT,#function -glGetMinmaxParameterfvEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetMinmaxParameterfvEXT), %g2 - or %g2, %lo(8 * _gloffset_GetMinmaxParameterfvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetMinmaxParameterfvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetMinmaxParameterivEXT -.type glGetMinmaxParameterivEXT,#function -glGetMinmaxParameterivEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetMinmaxParameterivEXT), %g2 - or %g2, %lo(8 * _gloffset_GetMinmaxParameterivEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetMinmaxParameterivEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glHistogramEXT -.type glHistogramEXT,#function -glHistogramEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Histogram), %g2 - or %g2, %lo(8 * _gloffset_Histogram), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Histogram)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMinmaxEXT -.type glMinmaxEXT,#function -glMinmaxEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_Minmax), %g2 - or %g2, %lo(8 * _gloffset_Minmax), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_Minmax)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glResetHistogramEXT -.type glResetHistogramEXT,#function -glResetHistogramEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ResetHistogram), %g2 - or %g2, %lo(8 * _gloffset_ResetHistogram), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ResetHistogram)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glResetMinmaxEXT -.type glResetMinmaxEXT,#function -glResetMinmaxEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ResetMinmax), %g2 - or %g2, %lo(8 * _gloffset_ResetMinmax), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ResetMinmax)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glConvolutionFilter1DEXT -.type glConvolutionFilter1DEXT,#function -glConvolutionFilter1DEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ConvolutionFilter1D), %g2 - or %g2, %lo(8 * _gloffset_ConvolutionFilter1D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ConvolutionFilter1D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glConvolutionFilter2DEXT -.type glConvolutionFilter2DEXT,#function -glConvolutionFilter2DEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ConvolutionFilter2D), %g2 - or %g2, %lo(8 * _gloffset_ConvolutionFilter2D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ConvolutionFilter2D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glConvolutionParameterfEXT -.type glConvolutionParameterfEXT,#function -glConvolutionParameterfEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ConvolutionParameterf), %g2 - or %g2, %lo(8 * _gloffset_ConvolutionParameterf), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ConvolutionParameterf)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glConvolutionParameterfvEXT -.type glConvolutionParameterfvEXT,#function -glConvolutionParameterfvEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ConvolutionParameterfv), %g2 - or %g2, %lo(8 * _gloffset_ConvolutionParameterfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ConvolutionParameterfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glConvolutionParameteriEXT -.type glConvolutionParameteriEXT,#function -glConvolutionParameteriEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ConvolutionParameteri), %g2 - or %g2, %lo(8 * _gloffset_ConvolutionParameteri), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ConvolutionParameteri)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glConvolutionParameterivEXT -.type glConvolutionParameterivEXT,#function -glConvolutionParameterivEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ConvolutionParameteriv), %g2 - or %g2, %lo(8 * _gloffset_ConvolutionParameteriv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ConvolutionParameteriv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyConvolutionFilter1DEXT -.type glCopyConvolutionFilter1DEXT,#function -glCopyConvolutionFilter1DEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyConvolutionFilter1D), %g2 - or %g2, %lo(8 * _gloffset_CopyConvolutionFilter1D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyConvolutionFilter1D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyConvolutionFilter2DEXT -.type glCopyConvolutionFilter2DEXT,#function -glCopyConvolutionFilter2DEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyConvolutionFilter2D), %g2 - or %g2, %lo(8 * _gloffset_CopyConvolutionFilter2D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyConvolutionFilter2D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetConvolutionFilterEXT -.type glGetConvolutionFilterEXT,#function -glGetConvolutionFilterEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetConvolutionFilterEXT), %g2 - or %g2, %lo(8 * _gloffset_GetConvolutionFilterEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetConvolutionFilterEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetConvolutionParameterfvEXT -.type glGetConvolutionParameterfvEXT,#function -glGetConvolutionParameterfvEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetConvolutionParameterfvEXT), %g2 - or %g2, %lo(8 * _gloffset_GetConvolutionParameterfvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetConvolutionParameterfvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetConvolutionParameterivEXT -.type glGetConvolutionParameterivEXT,#function -glGetConvolutionParameterivEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetConvolutionParameterivEXT), %g2 - or %g2, %lo(8 * _gloffset_GetConvolutionParameterivEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetConvolutionParameterivEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetSeparableFilterEXT -.type glGetSeparableFilterEXT,#function -glGetSeparableFilterEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetSeparableFilterEXT), %g2 - or %g2, %lo(8 * _gloffset_GetSeparableFilterEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetSeparableFilterEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSeparableFilter2DEXT -.type glSeparableFilter2DEXT,#function -glSeparableFilter2DEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SeparableFilter2D), %g2 - or %g2, %lo(8 * _gloffset_SeparableFilter2D), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SeparableFilter2D)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColorTableSGI -.type glColorTableSGI,#function -glColorTableSGI: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ColorTable), %g2 - or %g2, %lo(8 * _gloffset_ColorTable), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ColorTable)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColorTableParameterfvSGI -.type glColorTableParameterfvSGI,#function -glColorTableParameterfvSGI: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ColorTableParameterfv), %g2 - or %g2, %lo(8 * _gloffset_ColorTableParameterfv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ColorTableParameterfv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColorTableParameterivSGI -.type glColorTableParameterivSGI,#function -glColorTableParameterivSGI: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ColorTableParameteriv), %g2 - or %g2, %lo(8 * _gloffset_ColorTableParameteriv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ColorTableParameteriv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyColorTableSGI -.type glCopyColorTableSGI,#function -glCopyColorTableSGI: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyColorTable), %g2 - or %g2, %lo(8 * _gloffset_CopyColorTable), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyColorTable)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetColorTableSGI -.type glGetColorTableSGI,#function -glGetColorTableSGI: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetColorTableSGI), %g2 - or %g2, %lo(8 * _gloffset_GetColorTableSGI), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetColorTableSGI)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetColorTableParameterfvSGI -.type glGetColorTableParameterfvSGI,#function -glGetColorTableParameterfvSGI: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetColorTableParameterfvSGI), %g2 - or %g2, %lo(8 * _gloffset_GetColorTableParameterfvSGI), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetColorTableParameterfvSGI)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetColorTableParameterivSGI -.type glGetColorTableParameterivSGI,#function -glGetColorTableParameterivSGI: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetColorTableParameterivSGI), %g2 - or %g2, %lo(8 * _gloffset_GetColorTableParameterivSGI), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetColorTableParameterivSGI)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPixelTexGenSGIX -.type glPixelTexGenSGIX,#function -glPixelTexGenSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PixelTexGenSGIX), %g2 - or %g2, %lo(8 * _gloffset_PixelTexGenSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PixelTexGenSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPixelTexGenParameteriSGIS -.type glPixelTexGenParameteriSGIS,#function -glPixelTexGenParameteriSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PixelTexGenParameteriSGIS), %g2 - or %g2, %lo(8 * _gloffset_PixelTexGenParameteriSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PixelTexGenParameteriSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPixelTexGenParameterivSGIS -.type glPixelTexGenParameterivSGIS,#function -glPixelTexGenParameterivSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PixelTexGenParameterivSGIS), %g2 - or %g2, %lo(8 * _gloffset_PixelTexGenParameterivSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PixelTexGenParameterivSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPixelTexGenParameterfSGIS -.type glPixelTexGenParameterfSGIS,#function -glPixelTexGenParameterfSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PixelTexGenParameterfSGIS), %g2 - or %g2, %lo(8 * _gloffset_PixelTexGenParameterfSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PixelTexGenParameterfSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPixelTexGenParameterfvSGIS -.type glPixelTexGenParameterfvSGIS,#function -glPixelTexGenParameterfvSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PixelTexGenParameterfvSGIS), %g2 - or %g2, %lo(8 * _gloffset_PixelTexGenParameterfvSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PixelTexGenParameterfvSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetPixelTexGenParameterivSGIS -.type glGetPixelTexGenParameterivSGIS,#function -glGetPixelTexGenParameterivSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetPixelTexGenParameterivSGIS), %g2 - or %g2, %lo(8 * _gloffset_GetPixelTexGenParameterivSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetPixelTexGenParameterivSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetPixelTexGenParameterfvSGIS -.type glGetPixelTexGenParameterfvSGIS,#function -glGetPixelTexGenParameterfvSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetPixelTexGenParameterfvSGIS), %g2 - or %g2, %lo(8 * _gloffset_GetPixelTexGenParameterfvSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetPixelTexGenParameterfvSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexImage4DSGIS -.type glTexImage4DSGIS,#function -glTexImage4DSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexImage4DSGIS), %g2 - or %g2, %lo(8 * _gloffset_TexImage4DSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexImage4DSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexSubImage4DSGIS -.type glTexSubImage4DSGIS,#function -glTexSubImage4DSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexSubImage4DSGIS), %g2 - or %g2, %lo(8 * _gloffset_TexSubImage4DSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexSubImage4DSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glAreTexturesResidentEXT -.type glAreTexturesResidentEXT,#function -glAreTexturesResidentEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_AreTexturesResidentEXT), %g2 - or %g2, %lo(8 * _gloffset_AreTexturesResidentEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_AreTexturesResidentEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBindTextureEXT -.type glBindTextureEXT,#function -glBindTextureEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BindTexture), %g2 - or %g2, %lo(8 * _gloffset_BindTexture), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BindTexture)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDeleteTexturesEXT -.type glDeleteTexturesEXT,#function -glDeleteTexturesEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DeleteTextures), %g2 - or %g2, %lo(8 * _gloffset_DeleteTextures), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DeleteTextures)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGenTexturesEXT -.type glGenTexturesEXT,#function -glGenTexturesEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GenTexturesEXT), %g2 - or %g2, %lo(8 * _gloffset_GenTexturesEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GenTexturesEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIsTextureEXT -.type glIsTextureEXT,#function -glIsTextureEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_IsTextureEXT), %g2 - or %g2, %lo(8 * _gloffset_IsTextureEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_IsTextureEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPrioritizeTexturesEXT -.type glPrioritizeTexturesEXT,#function -glPrioritizeTexturesEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PrioritizeTextures), %g2 - or %g2, %lo(8 * _gloffset_PrioritizeTextures), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PrioritizeTextures)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDetailTexFuncSGIS -.type glDetailTexFuncSGIS,#function -glDetailTexFuncSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DetailTexFuncSGIS), %g2 - or %g2, %lo(8 * _gloffset_DetailTexFuncSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DetailTexFuncSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetDetailTexFuncSGIS -.type glGetDetailTexFuncSGIS,#function -glGetDetailTexFuncSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetDetailTexFuncSGIS), %g2 - or %g2, %lo(8 * _gloffset_GetDetailTexFuncSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetDetailTexFuncSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSharpenTexFuncSGIS -.type glSharpenTexFuncSGIS,#function -glSharpenTexFuncSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SharpenTexFuncSGIS), %g2 - or %g2, %lo(8 * _gloffset_SharpenTexFuncSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SharpenTexFuncSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetSharpenTexFuncSGIS -.type glGetSharpenTexFuncSGIS,#function -glGetSharpenTexFuncSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetSharpenTexFuncSGIS), %g2 - or %g2, %lo(8 * _gloffset_GetSharpenTexFuncSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetSharpenTexFuncSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSampleMaskSGIS -.type glSampleMaskSGIS,#function -glSampleMaskSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SampleMaskSGIS), %g2 - or %g2, %lo(8 * _gloffset_SampleMaskSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SampleMaskSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSamplePatternSGIS -.type glSamplePatternSGIS,#function -glSamplePatternSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SamplePatternSGIS), %g2 - or %g2, %lo(8 * _gloffset_SamplePatternSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SamplePatternSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glArrayElementEXT -.type glArrayElementEXT,#function -glArrayElementEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ArrayElement), %g2 - or %g2, %lo(8 * _gloffset_ArrayElement), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ArrayElement)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColorPointerEXT -.type glColorPointerEXT,#function -glColorPointerEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ColorPointerEXT), %g2 - or %g2, %lo(8 * _gloffset_ColorPointerEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ColorPointerEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDrawArraysEXT -.type glDrawArraysEXT,#function -glDrawArraysEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DrawArrays), %g2 - or %g2, %lo(8 * _gloffset_DrawArrays), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DrawArrays)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEdgeFlagPointerEXT -.type glEdgeFlagPointerEXT,#function -glEdgeFlagPointerEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EdgeFlagPointerEXT), %g2 - or %g2, %lo(8 * _gloffset_EdgeFlagPointerEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EdgeFlagPointerEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetPointervEXT -.type glGetPointervEXT,#function -glGetPointervEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetPointerv), %g2 - or %g2, %lo(8 * _gloffset_GetPointerv), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetPointerv)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIndexPointerEXT -.type glIndexPointerEXT,#function -glIndexPointerEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_IndexPointerEXT), %g2 - or %g2, %lo(8 * _gloffset_IndexPointerEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_IndexPointerEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glNormalPointerEXT -.type glNormalPointerEXT,#function -glNormalPointerEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_NormalPointerEXT), %g2 - or %g2, %lo(8 * _gloffset_NormalPointerEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_NormalPointerEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTexCoordPointerEXT -.type glTexCoordPointerEXT,#function -glTexCoordPointerEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TexCoordPointerEXT), %g2 - or %g2, %lo(8 * _gloffset_TexCoordPointerEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TexCoordPointerEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexPointerEXT -.type glVertexPointerEXT,#function -glVertexPointerEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexPointerEXT), %g2 - or %g2, %lo(8 * _gloffset_VertexPointerEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexPointerEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBlendEquationEXT -.type glBlendEquationEXT,#function -glBlendEquationEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BlendEquation), %g2 - or %g2, %lo(8 * _gloffset_BlendEquation), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BlendEquation)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSpriteParameterfSGIX -.type glSpriteParameterfSGIX,#function -glSpriteParameterfSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SpriteParameterfSGIX), %g2 - or %g2, %lo(8 * _gloffset_SpriteParameterfSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SpriteParameterfSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSpriteParameterfvSGIX -.type glSpriteParameterfvSGIX,#function -glSpriteParameterfvSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SpriteParameterfvSGIX), %g2 - or %g2, %lo(8 * _gloffset_SpriteParameterfvSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SpriteParameterfvSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSpriteParameteriSGIX -.type glSpriteParameteriSGIX,#function -glSpriteParameteriSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SpriteParameteriSGIX), %g2 - or %g2, %lo(8 * _gloffset_SpriteParameteriSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SpriteParameteriSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSpriteParameterivSGIX -.type glSpriteParameterivSGIX,#function -glSpriteParameterivSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SpriteParameterivSGIX), %g2 - or %g2, %lo(8 * _gloffset_SpriteParameterivSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SpriteParameterivSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPointParameterfEXT -.type glPointParameterfEXT,#function -glPointParameterfEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PointParameterfEXT), %g2 - or %g2, %lo(8 * _gloffset_PointParameterfEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PointParameterfEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPointParameterfvEXT -.type glPointParameterfvEXT,#function -glPointParameterfvEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PointParameterfvEXT), %g2 - or %g2, %lo(8 * _gloffset_PointParameterfvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PointParameterfvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPointParameterfARB -.type glPointParameterfARB,#function -glPointParameterfARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PointParameterfEXT), %g2 - or %g2, %lo(8 * _gloffset_PointParameterfEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PointParameterfEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPointParameterfvARB -.type glPointParameterfvARB,#function -glPointParameterfvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PointParameterfvEXT), %g2 - or %g2, %lo(8 * _gloffset_PointParameterfvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PointParameterfvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPointParameterfSGIS -.type glPointParameterfSGIS,#function -glPointParameterfSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PointParameterfEXT), %g2 - or %g2, %lo(8 * _gloffset_PointParameterfEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PointParameterfEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPointParameterfvSGIS -.type glPointParameterfvSGIS,#function -glPointParameterfvSGIS: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PointParameterfvEXT), %g2 - or %g2, %lo(8 * _gloffset_PointParameterfvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PointParameterfvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetInstrumentsSGIX -.type glGetInstrumentsSGIX,#function -glGetInstrumentsSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetInstrumentsSGIX), %g2 - or %g2, %lo(8 * _gloffset_GetInstrumentsSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetInstrumentsSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glInstrumentsBufferSGIX -.type glInstrumentsBufferSGIX,#function -glInstrumentsBufferSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_InstrumentsBufferSGIX), %g2 - or %g2, %lo(8 * _gloffset_InstrumentsBufferSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_InstrumentsBufferSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPollInstrumentsSGIX -.type glPollInstrumentsSGIX,#function -glPollInstrumentsSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PollInstrumentsSGIX), %g2 - or %g2, %lo(8 * _gloffset_PollInstrumentsSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PollInstrumentsSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glReadInstrumentsSGIX -.type glReadInstrumentsSGIX,#function -glReadInstrumentsSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ReadInstrumentsSGIX), %g2 - or %g2, %lo(8 * _gloffset_ReadInstrumentsSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ReadInstrumentsSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glStartInstrumentsSGIX -.type glStartInstrumentsSGIX,#function -glStartInstrumentsSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_StartInstrumentsSGIX), %g2 - or %g2, %lo(8 * _gloffset_StartInstrumentsSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_StartInstrumentsSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glStopInstrumentsSGIX -.type glStopInstrumentsSGIX,#function -glStopInstrumentsSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_StopInstrumentsSGIX), %g2 - or %g2, %lo(8 * _gloffset_StopInstrumentsSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_StopInstrumentsSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFrameZoomSGIX -.type glFrameZoomSGIX,#function -glFrameZoomSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FrameZoomSGIX), %g2 - or %g2, %lo(8 * _gloffset_FrameZoomSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FrameZoomSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTagSampleBufferSGIX -.type glTagSampleBufferSGIX,#function -glTagSampleBufferSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TagSampleBufferSGIX), %g2 - or %g2, %lo(8 * _gloffset_TagSampleBufferSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TagSampleBufferSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glReferencePlaneSGIX -.type glReferencePlaneSGIX,#function -glReferencePlaneSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ReferencePlaneSGIX), %g2 - or %g2, %lo(8 * _gloffset_ReferencePlaneSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ReferencePlaneSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFlushRasterSGIX -.type glFlushRasterSGIX,#function -glFlushRasterSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FlushRasterSGIX), %g2 - or %g2, %lo(8 * _gloffset_FlushRasterSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FlushRasterSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColorSubTableEXT -.type glColorSubTableEXT,#function -glColorSubTableEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ColorSubTable), %g2 - or %g2, %lo(8 * _gloffset_ColorSubTable), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ColorSubTable)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCopyColorSubTableEXT -.type glCopyColorSubTableEXT,#function -glCopyColorSubTableEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CopyColorSubTable), %g2 - or %g2, %lo(8 * _gloffset_CopyColorSubTable), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CopyColorSubTable)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glHintPGI -.type glHintPGI,#function -glHintPGI: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_HintPGI), %g2 - or %g2, %lo(8 * _gloffset_HintPGI), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_HintPGI)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glColorTableEXT -.type glColorTableEXT,#function -glColorTableEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ColorTable), %g2 - or %g2, %lo(8 * _gloffset_ColorTable), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ColorTable)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetColorTableEXT -.type glGetColorTableEXT,#function -glGetColorTableEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetColorTableEXT), %g2 - or %g2, %lo(8 * _gloffset_GetColorTableEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetColorTableEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetColorTableParameterivEXT -.type glGetColorTableParameterivEXT,#function -glGetColorTableParameterivEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetColorTableParameterivEXT), %g2 - or %g2, %lo(8 * _gloffset_GetColorTableParameterivEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetColorTableParameterivEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetColorTableParameterfvEXT -.type glGetColorTableParameterfvEXT,#function -glGetColorTableParameterfvEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetColorTableParameterfvEXT), %g2 - or %g2, %lo(8 * _gloffset_GetColorTableParameterfvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetColorTableParameterfvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetListParameterfvSGIX -.type glGetListParameterfvSGIX,#function -glGetListParameterfvSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetListParameterfvSGIX), %g2 - or %g2, %lo(8 * _gloffset_GetListParameterfvSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetListParameterfvSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetListParameterivSGIX -.type glGetListParameterivSGIX,#function -glGetListParameterivSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetListParameterivSGIX), %g2 - or %g2, %lo(8 * _gloffset_GetListParameterivSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetListParameterivSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glListParameterfSGIX -.type glListParameterfSGIX,#function -glListParameterfSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ListParameterfSGIX), %g2 - or %g2, %lo(8 * _gloffset_ListParameterfSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ListParameterfSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glListParameterfvSGIX -.type glListParameterfvSGIX,#function -glListParameterfvSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ListParameterfvSGIX), %g2 - or %g2, %lo(8 * _gloffset_ListParameterfvSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ListParameterfvSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glListParameteriSGIX -.type glListParameteriSGIX,#function -glListParameteriSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ListParameteriSGIX), %g2 - or %g2, %lo(8 * _gloffset_ListParameteriSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ListParameteriSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glListParameterivSGIX -.type glListParameterivSGIX,#function -glListParameterivSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ListParameterivSGIX), %g2 - or %g2, %lo(8 * _gloffset_ListParameterivSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ListParameterivSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIndexMaterialEXT -.type glIndexMaterialEXT,#function -glIndexMaterialEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_IndexMaterialEXT), %g2 - or %g2, %lo(8 * _gloffset_IndexMaterialEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_IndexMaterialEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIndexFuncEXT -.type glIndexFuncEXT,#function -glIndexFuncEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_IndexFuncEXT), %g2 - or %g2, %lo(8 * _gloffset_IndexFuncEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_IndexFuncEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLockArraysEXT -.type glLockArraysEXT,#function -glLockArraysEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LockArraysEXT), %g2 - or %g2, %lo(8 * _gloffset_LockArraysEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LockArraysEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glUnlockArraysEXT -.type glUnlockArraysEXT,#function -glUnlockArraysEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_UnlockArraysEXT), %g2 - or %g2, %lo(8 * _gloffset_UnlockArraysEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_UnlockArraysEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCullParameterdvEXT -.type glCullParameterdvEXT,#function -glCullParameterdvEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CullParameterdvEXT), %g2 - or %g2, %lo(8 * _gloffset_CullParameterdvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CullParameterdvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCullParameterfvEXT -.type glCullParameterfvEXT,#function -glCullParameterfvEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CullParameterfvEXT), %g2 - or %g2, %lo(8 * _gloffset_CullParameterfvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CullParameterfvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFragmentColorMaterialSGIX -.type glFragmentColorMaterialSGIX,#function -glFragmentColorMaterialSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FragmentColorMaterialSGIX), %g2 - or %g2, %lo(8 * _gloffset_FragmentColorMaterialSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FragmentColorMaterialSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFragmentLightfSGIX -.type glFragmentLightfSGIX,#function -glFragmentLightfSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FragmentLightfSGIX), %g2 - or %g2, %lo(8 * _gloffset_FragmentLightfSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FragmentLightfSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFragmentLightfvSGIX -.type glFragmentLightfvSGIX,#function -glFragmentLightfvSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FragmentLightfvSGIX), %g2 - or %g2, %lo(8 * _gloffset_FragmentLightfvSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FragmentLightfvSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFragmentLightiSGIX -.type glFragmentLightiSGIX,#function -glFragmentLightiSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FragmentLightiSGIX), %g2 - or %g2, %lo(8 * _gloffset_FragmentLightiSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FragmentLightiSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFragmentLightivSGIX -.type glFragmentLightivSGIX,#function -glFragmentLightivSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FragmentLightivSGIX), %g2 - or %g2, %lo(8 * _gloffset_FragmentLightivSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FragmentLightivSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFragmentLightModelfSGIX -.type glFragmentLightModelfSGIX,#function -glFragmentLightModelfSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FragmentLightModelfSGIX), %g2 - or %g2, %lo(8 * _gloffset_FragmentLightModelfSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FragmentLightModelfSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFragmentLightModelfvSGIX -.type glFragmentLightModelfvSGIX,#function -glFragmentLightModelfvSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FragmentLightModelfvSGIX), %g2 - or %g2, %lo(8 * _gloffset_FragmentLightModelfvSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FragmentLightModelfvSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFragmentLightModeliSGIX -.type glFragmentLightModeliSGIX,#function -glFragmentLightModeliSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FragmentLightModeliSGIX), %g2 - or %g2, %lo(8 * _gloffset_FragmentLightModeliSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FragmentLightModeliSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFragmentLightModelivSGIX -.type glFragmentLightModelivSGIX,#function -glFragmentLightModelivSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FragmentLightModelivSGIX), %g2 - or %g2, %lo(8 * _gloffset_FragmentLightModelivSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FragmentLightModelivSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFragmentMaterialfSGIX -.type glFragmentMaterialfSGIX,#function -glFragmentMaterialfSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FragmentMaterialfSGIX), %g2 - or %g2, %lo(8 * _gloffset_FragmentMaterialfSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FragmentMaterialfSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFragmentMaterialfvSGIX -.type glFragmentMaterialfvSGIX,#function -glFragmentMaterialfvSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FragmentMaterialfvSGIX), %g2 - or %g2, %lo(8 * _gloffset_FragmentMaterialfvSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FragmentMaterialfvSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFragmentMaterialiSGIX -.type glFragmentMaterialiSGIX,#function -glFragmentMaterialiSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FragmentMaterialiSGIX), %g2 - or %g2, %lo(8 * _gloffset_FragmentMaterialiSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FragmentMaterialiSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFragmentMaterialivSGIX -.type glFragmentMaterialivSGIX,#function -glFragmentMaterialivSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FragmentMaterialivSGIX), %g2 - or %g2, %lo(8 * _gloffset_FragmentMaterialivSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FragmentMaterialivSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetFragmentLightfvSGIX -.type glGetFragmentLightfvSGIX,#function -glGetFragmentLightfvSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetFragmentLightfvSGIX), %g2 - or %g2, %lo(8 * _gloffset_GetFragmentLightfvSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetFragmentLightfvSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetFragmentLightivSGIX -.type glGetFragmentLightivSGIX,#function -glGetFragmentLightivSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetFragmentLightivSGIX), %g2 - or %g2, %lo(8 * _gloffset_GetFragmentLightivSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetFragmentLightivSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetFragmentMaterialfvSGIX -.type glGetFragmentMaterialfvSGIX,#function -glGetFragmentMaterialfvSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetFragmentMaterialfvSGIX), %g2 - or %g2, %lo(8 * _gloffset_GetFragmentMaterialfvSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetFragmentMaterialfvSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetFragmentMaterialivSGIX -.type glGetFragmentMaterialivSGIX,#function -glGetFragmentMaterialivSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetFragmentMaterialivSGIX), %g2 - or %g2, %lo(8 * _gloffset_GetFragmentMaterialivSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetFragmentMaterialivSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLightEnviSGIX -.type glLightEnviSGIX,#function -glLightEnviSGIX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LightEnviSGIX), %g2 - or %g2, %lo(8 * _gloffset_LightEnviSGIX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LightEnviSGIX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDrawRangeElementsEXT -.type glDrawRangeElementsEXT,#function -glDrawRangeElementsEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DrawRangeElements), %g2 - or %g2, %lo(8 * _gloffset_DrawRangeElements), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DrawRangeElements)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3bEXT -.type glSecondaryColor3bEXT,#function -glSecondaryColor3bEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3bEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3bEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3bEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3bvEXT -.type glSecondaryColor3bvEXT,#function -glSecondaryColor3bvEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3bvEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3bvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3bvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3dEXT -.type glSecondaryColor3dEXT,#function -glSecondaryColor3dEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3dEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3dEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3dEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3dvEXT -.type glSecondaryColor3dvEXT,#function -glSecondaryColor3dvEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3dvEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3dvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3dvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3fEXT -.type glSecondaryColor3fEXT,#function -glSecondaryColor3fEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3fEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3fEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3fEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3fvEXT -.type glSecondaryColor3fvEXT,#function -glSecondaryColor3fvEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3fvEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3fvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3fvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3iEXT -.type glSecondaryColor3iEXT,#function -glSecondaryColor3iEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3iEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3iEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3iEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3ivEXT -.type glSecondaryColor3ivEXT,#function -glSecondaryColor3ivEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3ivEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3ivEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3ivEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3sEXT -.type glSecondaryColor3sEXT,#function -glSecondaryColor3sEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3sEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3sEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3sEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3svEXT -.type glSecondaryColor3svEXT,#function -glSecondaryColor3svEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3svEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3svEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3svEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3ubEXT -.type glSecondaryColor3ubEXT,#function -glSecondaryColor3ubEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3ubEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3ubEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3ubEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3ubvEXT -.type glSecondaryColor3ubvEXT,#function -glSecondaryColor3ubvEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3ubvEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3ubvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3ubvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3uiEXT -.type glSecondaryColor3uiEXT,#function -glSecondaryColor3uiEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3uiEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3uiEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3uiEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3uivEXT -.type glSecondaryColor3uivEXT,#function -glSecondaryColor3uivEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3uivEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3uivEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3uivEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3usEXT -.type glSecondaryColor3usEXT,#function -glSecondaryColor3usEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3usEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3usEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3usEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3usvEXT -.type glSecondaryColor3usvEXT,#function -glSecondaryColor3usvEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3usvEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3usvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3usvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColorPointerEXT -.type glSecondaryColorPointerEXT,#function -glSecondaryColorPointerEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColorPointerEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColorPointerEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColorPointerEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiDrawArraysEXT -.type glMultiDrawArraysEXT,#function -glMultiDrawArraysEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiDrawArraysEXT), %g2 - or %g2, %lo(8 * _gloffset_MultiDrawArraysEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiDrawArraysEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiDrawElementsEXT -.type glMultiDrawElementsEXT,#function -glMultiDrawElementsEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiDrawElementsEXT), %g2 - or %g2, %lo(8 * _gloffset_MultiDrawElementsEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiDrawElementsEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFogCoordfEXT -.type glFogCoordfEXT,#function -glFogCoordfEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FogCoordfEXT), %g2 - or %g2, %lo(8 * _gloffset_FogCoordfEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FogCoordfEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFogCoordfvEXT -.type glFogCoordfvEXT,#function -glFogCoordfvEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FogCoordfvEXT), %g2 - or %g2, %lo(8 * _gloffset_FogCoordfvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FogCoordfvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFogCoorddEXT -.type glFogCoorddEXT,#function -glFogCoorddEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FogCoorddEXT), %g2 - or %g2, %lo(8 * _gloffset_FogCoorddEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FogCoorddEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFogCoorddvEXT -.type glFogCoorddvEXT,#function -glFogCoorddvEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FogCoorddvEXT), %g2 - or %g2, %lo(8 * _gloffset_FogCoorddvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FogCoorddvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFogCoordPointerEXT -.type glFogCoordPointerEXT,#function -glFogCoordPointerEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FogCoordPointerEXT), %g2 - or %g2, %lo(8 * _gloffset_FogCoordPointerEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FogCoordPointerEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBlendFuncSeparateEXT -.type glBlendFuncSeparateEXT,#function -glBlendFuncSeparateEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BlendFuncSeparateEXT), %g2 - or %g2, %lo(8 * _gloffset_BlendFuncSeparateEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BlendFuncSeparateEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBlendFuncSeparateINGR -.type glBlendFuncSeparateINGR,#function -glBlendFuncSeparateINGR: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BlendFuncSeparateEXT), %g2 - or %g2, %lo(8 * _gloffset_BlendFuncSeparateEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BlendFuncSeparateEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexWeightfEXT -.type glVertexWeightfEXT,#function -glVertexWeightfEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexWeightfEXT), %g2 - or %g2, %lo(8 * _gloffset_VertexWeightfEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexWeightfEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexWeightfvEXT -.type glVertexWeightfvEXT,#function -glVertexWeightfvEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexWeightfvEXT), %g2 - or %g2, %lo(8 * _gloffset_VertexWeightfvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexWeightfvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexWeightPointerEXT -.type glVertexWeightPointerEXT,#function -glVertexWeightPointerEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexWeightPointerEXT), %g2 - or %g2, %lo(8 * _gloffset_VertexWeightPointerEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexWeightPointerEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFlushVertexArrayRangeNV -.type glFlushVertexArrayRangeNV,#function -glFlushVertexArrayRangeNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FlushVertexArrayRangeNV), %g2 - or %g2, %lo(8 * _gloffset_FlushVertexArrayRangeNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FlushVertexArrayRangeNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexArrayRangeNV -.type glVertexArrayRangeNV,#function -glVertexArrayRangeNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexArrayRangeNV), %g2 - or %g2, %lo(8 * _gloffset_VertexArrayRangeNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexArrayRangeNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCombinerParameterfvNV -.type glCombinerParameterfvNV,#function -glCombinerParameterfvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CombinerParameterfvNV), %g2 - or %g2, %lo(8 * _gloffset_CombinerParameterfvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CombinerParameterfvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCombinerParameterfNV -.type glCombinerParameterfNV,#function -glCombinerParameterfNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CombinerParameterfNV), %g2 - or %g2, %lo(8 * _gloffset_CombinerParameterfNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CombinerParameterfNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCombinerParameterivNV -.type glCombinerParameterivNV,#function -glCombinerParameterivNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CombinerParameterivNV), %g2 - or %g2, %lo(8 * _gloffset_CombinerParameterivNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CombinerParameterivNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCombinerParameteriNV -.type glCombinerParameteriNV,#function -glCombinerParameteriNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CombinerParameteriNV), %g2 - or %g2, %lo(8 * _gloffset_CombinerParameteriNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CombinerParameteriNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCombinerInputNV -.type glCombinerInputNV,#function -glCombinerInputNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CombinerInputNV), %g2 - or %g2, %lo(8 * _gloffset_CombinerInputNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CombinerInputNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glCombinerOutputNV -.type glCombinerOutputNV,#function -glCombinerOutputNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_CombinerOutputNV), %g2 - or %g2, %lo(8 * _gloffset_CombinerOutputNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_CombinerOutputNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFinalCombinerInputNV -.type glFinalCombinerInputNV,#function -glFinalCombinerInputNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FinalCombinerInputNV), %g2 - or %g2, %lo(8 * _gloffset_FinalCombinerInputNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FinalCombinerInputNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetCombinerInputParameterfvNV -.type glGetCombinerInputParameterfvNV,#function -glGetCombinerInputParameterfvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetCombinerInputParameterfvNV), %g2 - or %g2, %lo(8 * _gloffset_GetCombinerInputParameterfvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetCombinerInputParameterfvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetCombinerInputParameterivNV -.type glGetCombinerInputParameterivNV,#function -glGetCombinerInputParameterivNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetCombinerInputParameterivNV), %g2 - or %g2, %lo(8 * _gloffset_GetCombinerInputParameterivNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetCombinerInputParameterivNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetCombinerOutputParameterfvNV -.type glGetCombinerOutputParameterfvNV,#function -glGetCombinerOutputParameterfvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetCombinerOutputParameterfvNV), %g2 - or %g2, %lo(8 * _gloffset_GetCombinerOutputParameterfvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetCombinerOutputParameterfvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetCombinerOutputParameterivNV -.type glGetCombinerOutputParameterivNV,#function -glGetCombinerOutputParameterivNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetCombinerOutputParameterivNV), %g2 - or %g2, %lo(8 * _gloffset_GetCombinerOutputParameterivNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetCombinerOutputParameterivNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetFinalCombinerInputParameterfvNV -.type glGetFinalCombinerInputParameterfvNV,#function -glGetFinalCombinerInputParameterfvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetFinalCombinerInputParameterfvNV), %g2 - or %g2, %lo(8 * _gloffset_GetFinalCombinerInputParameterfvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetFinalCombinerInputParameterfvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetFinalCombinerInputParameterivNV -.type glGetFinalCombinerInputParameterivNV,#function -glGetFinalCombinerInputParameterivNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetFinalCombinerInputParameterivNV), %g2 - or %g2, %lo(8 * _gloffset_GetFinalCombinerInputParameterivNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetFinalCombinerInputParameterivNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glResizeBuffersMESA -.type glResizeBuffersMESA,#function -glResizeBuffersMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ResizeBuffersMESA), %g2 - or %g2, %lo(8 * _gloffset_ResizeBuffersMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ResizeBuffersMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2dMESA -.type glWindowPos2dMESA,#function -glWindowPos2dMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2dMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2dMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2dMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2dvMESA -.type glWindowPos2dvMESA,#function -glWindowPos2dvMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2dvMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2dvMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2dvMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2fMESA -.type glWindowPos2fMESA,#function -glWindowPos2fMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2fMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2fMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2fMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2fvMESA -.type glWindowPos2fvMESA,#function -glWindowPos2fvMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2fvMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2fvMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2fvMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2iMESA -.type glWindowPos2iMESA,#function -glWindowPos2iMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2iMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2iMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2iMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2ivMESA -.type glWindowPos2ivMESA,#function -glWindowPos2ivMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2ivMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2ivMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2ivMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2sMESA -.type glWindowPos2sMESA,#function -glWindowPos2sMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2sMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2sMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2sMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2svMESA -.type glWindowPos2svMESA,#function -glWindowPos2svMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2svMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2svMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2svMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3dMESA -.type glWindowPos3dMESA,#function -glWindowPos3dMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3dMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3dMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3dMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3dvMESA -.type glWindowPos3dvMESA,#function -glWindowPos3dvMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3dvMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3dvMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3dvMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3fMESA -.type glWindowPos3fMESA,#function -glWindowPos3fMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3fMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3fMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3fMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3fvMESA -.type glWindowPos3fvMESA,#function -glWindowPos3fvMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3fvMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3fvMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3fvMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3iMESA -.type glWindowPos3iMESA,#function -glWindowPos3iMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3iMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3iMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3iMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3ivMESA -.type glWindowPos3ivMESA,#function -glWindowPos3ivMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3ivMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3ivMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3ivMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3sMESA -.type glWindowPos3sMESA,#function -glWindowPos3sMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3sMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3sMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3sMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3svMESA -.type glWindowPos3svMESA,#function -glWindowPos3svMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3svMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3svMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3svMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos4dMESA -.type glWindowPos4dMESA,#function -glWindowPos4dMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos4dMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos4dMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos4dMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos4dvMESA -.type glWindowPos4dvMESA,#function -glWindowPos4dvMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos4dvMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos4dvMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos4dvMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos4fMESA -.type glWindowPos4fMESA,#function -glWindowPos4fMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos4fMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos4fMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos4fMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos4fvMESA -.type glWindowPos4fvMESA,#function -glWindowPos4fvMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos4fvMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos4fvMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos4fvMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos4iMESA -.type glWindowPos4iMESA,#function -glWindowPos4iMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos4iMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos4iMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos4iMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos4ivMESA -.type glWindowPos4ivMESA,#function -glWindowPos4ivMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos4ivMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos4ivMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos4ivMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos4sMESA -.type glWindowPos4sMESA,#function -glWindowPos4sMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos4sMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos4sMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos4sMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos4svMESA -.type glWindowPos4svMESA,#function -glWindowPos4svMESA: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos4svMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos4svMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos4svMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiModeDrawArraysIBM -.type glMultiModeDrawArraysIBM,#function -glMultiModeDrawArraysIBM: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiModeDrawArraysIBM), %g2 - or %g2, %lo(8 * _gloffset_MultiModeDrawArraysIBM), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiModeDrawArraysIBM)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiModeDrawElementsIBM -.type glMultiModeDrawElementsIBM,#function -glMultiModeDrawElementsIBM: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiModeDrawElementsIBM), %g2 - or %g2, %lo(8 * _gloffset_MultiModeDrawElementsIBM), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiModeDrawElementsIBM)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTbufferMask3DFX -.type glTbufferMask3DFX,#function -glTbufferMask3DFX: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TbufferMask3DFX), %g2 - or %g2, %lo(8 * _gloffset_TbufferMask3DFX), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TbufferMask3DFX)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSampleMaskEXT -.type glSampleMaskEXT,#function -glSampleMaskEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SampleMaskSGIS), %g2 - or %g2, %lo(8 * _gloffset_SampleMaskSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SampleMaskSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSamplePatternEXT -.type glSamplePatternEXT,#function -glSamplePatternEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SamplePatternSGIS), %g2 - or %g2, %lo(8 * _gloffset_SamplePatternSGIS), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SamplePatternSGIS)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2dARB -.type glWindowPos2dARB,#function -glWindowPos2dARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2dMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2dMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2dMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2fARB -.type glWindowPos2fARB,#function -glWindowPos2fARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2fMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2fMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2fMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2iARB -.type glWindowPos2iARB,#function -glWindowPos2iARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2iMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2iMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2iMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2sARB -.type glWindowPos2sARB,#function -glWindowPos2sARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2sMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2sMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2sMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2dvARB -.type glWindowPos2dvARB,#function -glWindowPos2dvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2dvMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2dvMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2dvMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2fvARB -.type glWindowPos2fvARB,#function -glWindowPos2fvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2fvMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2fvMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2fvMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2ivARB -.type glWindowPos2ivARB,#function -glWindowPos2ivARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2ivMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2ivMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2ivMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2svARB -.type glWindowPos2svARB,#function -glWindowPos2svARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2svMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2svMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2svMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3dARB -.type glWindowPos3dARB,#function -glWindowPos3dARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3dMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3dMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3dMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3fARB -.type glWindowPos3fARB,#function -glWindowPos3fARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3fMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3fMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3fMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3iARB -.type glWindowPos3iARB,#function -glWindowPos3iARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3iMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3iMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3iMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3sARB -.type glWindowPos3sARB,#function -glWindowPos3sARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3sMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3sMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3sMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3dvARB -.type glWindowPos3dvARB,#function -glWindowPos3dvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3dvMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3dvMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3dvMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3fvARB -.type glWindowPos3fvARB,#function -glWindowPos3fvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3fvMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3fvMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3fvMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3ivARB -.type glWindowPos3ivARB,#function -glWindowPos3ivARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3ivMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3ivMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3ivMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3svARB -.type glWindowPos3svARB,#function -glWindowPos3svARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3svMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3svMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3svMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glAreProgramsResidentNV -.type glAreProgramsResidentNV,#function -glAreProgramsResidentNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_AreProgramsResidentNV), %g2 - or %g2, %lo(8 * _gloffset_AreProgramsResidentNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_AreProgramsResidentNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBindProgramNV -.type glBindProgramNV,#function -glBindProgramNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BindProgramNV), %g2 - or %g2, %lo(8 * _gloffset_BindProgramNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BindProgramNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDeleteProgramsNV -.type glDeleteProgramsNV,#function -glDeleteProgramsNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DeleteProgramsNV), %g2 - or %g2, %lo(8 * _gloffset_DeleteProgramsNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DeleteProgramsNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glExecuteProgramNV -.type glExecuteProgramNV,#function -glExecuteProgramNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ExecuteProgramNV), %g2 - or %g2, %lo(8 * _gloffset_ExecuteProgramNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ExecuteProgramNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGenProgramsNV -.type glGenProgramsNV,#function -glGenProgramsNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GenProgramsNV), %g2 - or %g2, %lo(8 * _gloffset_GenProgramsNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GenProgramsNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetProgramParameterdvNV -.type glGetProgramParameterdvNV,#function -glGetProgramParameterdvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetProgramParameterdvNV), %g2 - or %g2, %lo(8 * _gloffset_GetProgramParameterdvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetProgramParameterdvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetProgramParameterfvNV -.type glGetProgramParameterfvNV,#function -glGetProgramParameterfvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetProgramParameterfvNV), %g2 - or %g2, %lo(8 * _gloffset_GetProgramParameterfvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetProgramParameterfvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetProgramivNV -.type glGetProgramivNV,#function -glGetProgramivNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetProgramivNV), %g2 - or %g2, %lo(8 * _gloffset_GetProgramivNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetProgramivNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetProgramStringNV -.type glGetProgramStringNV,#function -glGetProgramStringNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetProgramStringNV), %g2 - or %g2, %lo(8 * _gloffset_GetProgramStringNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetProgramStringNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetTrackMatrixivNV -.type glGetTrackMatrixivNV,#function -glGetTrackMatrixivNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetTrackMatrixivNV), %g2 - or %g2, %lo(8 * _gloffset_GetTrackMatrixivNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetTrackMatrixivNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetVertexAttribdvNV -.type glGetVertexAttribdvNV,#function -glGetVertexAttribdvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetVertexAttribdvNV), %g2 - or %g2, %lo(8 * _gloffset_GetVertexAttribdvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetVertexAttribdvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetVertexAttribfvNV -.type glGetVertexAttribfvNV,#function -glGetVertexAttribfvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetVertexAttribfvNV), %g2 - or %g2, %lo(8 * _gloffset_GetVertexAttribfvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetVertexAttribfvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetVertexAttribivNV -.type glGetVertexAttribivNV,#function -glGetVertexAttribivNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetVertexAttribivNV), %g2 - or %g2, %lo(8 * _gloffset_GetVertexAttribivNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetVertexAttribivNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetVertexAttribPointervNV -.type glGetVertexAttribPointervNV,#function -glGetVertexAttribPointervNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetVertexAttribPointervNV), %g2 - or %g2, %lo(8 * _gloffset_GetVertexAttribPointervNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetVertexAttribPointervNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIsProgramNV -.type glIsProgramNV,#function -glIsProgramNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_IsProgramNV), %g2 - or %g2, %lo(8 * _gloffset_IsProgramNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_IsProgramNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glLoadProgramNV -.type glLoadProgramNV,#function -glLoadProgramNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_LoadProgramNV), %g2 - or %g2, %lo(8 * _gloffset_LoadProgramNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_LoadProgramNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramParameter4dNV -.type glProgramParameter4dNV,#function -glProgramParameter4dNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramParameter4dNV), %g2 - or %g2, %lo(8 * _gloffset_ProgramParameter4dNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramParameter4dNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramParameter4dvNV -.type glProgramParameter4dvNV,#function -glProgramParameter4dvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramParameter4dvNV), %g2 - or %g2, %lo(8 * _gloffset_ProgramParameter4dvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramParameter4dvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramParameter4fNV -.type glProgramParameter4fNV,#function -glProgramParameter4fNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramParameter4fNV), %g2 - or %g2, %lo(8 * _gloffset_ProgramParameter4fNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramParameter4fNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramParameter4fvNV -.type glProgramParameter4fvNV,#function -glProgramParameter4fvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramParameter4fvNV), %g2 - or %g2, %lo(8 * _gloffset_ProgramParameter4fvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramParameter4fvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramParameters4dvNV -.type glProgramParameters4dvNV,#function -glProgramParameters4dvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramParameters4dvNV), %g2 - or %g2, %lo(8 * _gloffset_ProgramParameters4dvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramParameters4dvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramParameters4fvNV -.type glProgramParameters4fvNV,#function -glProgramParameters4fvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramParameters4fvNV), %g2 - or %g2, %lo(8 * _gloffset_ProgramParameters4fvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramParameters4fvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glRequestResidentProgramsNV -.type glRequestResidentProgramsNV,#function -glRequestResidentProgramsNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_RequestResidentProgramsNV), %g2 - or %g2, %lo(8 * _gloffset_RequestResidentProgramsNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_RequestResidentProgramsNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTrackMatrixNV -.type glTrackMatrixNV,#function -glTrackMatrixNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TrackMatrixNV), %g2 - or %g2, %lo(8 * _gloffset_TrackMatrixNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TrackMatrixNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttribPointerNV -.type glVertexAttribPointerNV,#function -glVertexAttribPointerNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttribPointerNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttribPointerNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttribPointerNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib1dNV -.type glVertexAttrib1dNV,#function -glVertexAttrib1dNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib1dNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib1dNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib1dNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib1dvNV -.type glVertexAttrib1dvNV,#function -glVertexAttrib1dvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib1dvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib1dvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib1dvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib1fNV -.type glVertexAttrib1fNV,#function -glVertexAttrib1fNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib1fNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib1fNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib1fNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib1fvNV -.type glVertexAttrib1fvNV,#function -glVertexAttrib1fvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib1fvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib1fvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib1fvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib1sNV -.type glVertexAttrib1sNV,#function -glVertexAttrib1sNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib1sNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib1sNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib1sNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib1svNV -.type glVertexAttrib1svNV,#function -glVertexAttrib1svNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib1svNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib1svNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib1svNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib2dNV -.type glVertexAttrib2dNV,#function -glVertexAttrib2dNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib2dNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib2dNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib2dNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib2dvNV -.type glVertexAttrib2dvNV,#function -glVertexAttrib2dvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib2dvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib2dvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib2dvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib2fNV -.type glVertexAttrib2fNV,#function -glVertexAttrib2fNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib2fNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib2fNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib2fNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib2fvNV -.type glVertexAttrib2fvNV,#function -glVertexAttrib2fvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib2fvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib2fvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib2fvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib2sNV -.type glVertexAttrib2sNV,#function -glVertexAttrib2sNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib2sNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib2sNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib2sNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib2svNV -.type glVertexAttrib2svNV,#function -glVertexAttrib2svNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib2svNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib2svNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib2svNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib3dNV -.type glVertexAttrib3dNV,#function -glVertexAttrib3dNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib3dNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib3dNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib3dNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib3dvNV -.type glVertexAttrib3dvNV,#function -glVertexAttrib3dvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib3dvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib3dvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib3dvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib3fNV -.type glVertexAttrib3fNV,#function -glVertexAttrib3fNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib3fNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib3fNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib3fNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib3fvNV -.type glVertexAttrib3fvNV,#function -glVertexAttrib3fvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib3fvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib3fvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib3fvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib3sNV -.type glVertexAttrib3sNV,#function -glVertexAttrib3sNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib3sNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib3sNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib3sNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib3svNV -.type glVertexAttrib3svNV,#function -glVertexAttrib3svNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib3svNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib3svNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib3svNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4dNV -.type glVertexAttrib4dNV,#function -glVertexAttrib4dNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4dNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4dNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4dNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4dvNV -.type glVertexAttrib4dvNV,#function -glVertexAttrib4dvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4dvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4dvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4dvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4fNV -.type glVertexAttrib4fNV,#function -glVertexAttrib4fNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4fNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4fNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4fNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4fvNV -.type glVertexAttrib4fvNV,#function -glVertexAttrib4fvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4fvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4fvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4fvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4sNV -.type glVertexAttrib4sNV,#function -glVertexAttrib4sNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4sNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4sNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4sNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4svNV -.type glVertexAttrib4svNV,#function -glVertexAttrib4svNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4svNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4svNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4svNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4ubNV -.type glVertexAttrib4ubNV,#function -glVertexAttrib4ubNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4ubNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4ubNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4ubNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4ubvNV -.type glVertexAttrib4ubvNV,#function -glVertexAttrib4ubvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4ubvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4ubvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4ubvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttribs1dvNV -.type glVertexAttribs1dvNV,#function -glVertexAttribs1dvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttribs1dvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttribs1dvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttribs1dvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttribs1fvNV -.type glVertexAttribs1fvNV,#function -glVertexAttribs1fvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttribs1fvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttribs1fvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttribs1fvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttribs1svNV -.type glVertexAttribs1svNV,#function -glVertexAttribs1svNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttribs1svNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttribs1svNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttribs1svNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttribs2dvNV -.type glVertexAttribs2dvNV,#function -glVertexAttribs2dvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttribs2dvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttribs2dvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttribs2dvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttribs2fvNV -.type glVertexAttribs2fvNV,#function -glVertexAttribs2fvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttribs2fvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttribs2fvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttribs2fvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttribs2svNV -.type glVertexAttribs2svNV,#function -glVertexAttribs2svNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttribs2svNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttribs2svNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttribs2svNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttribs3dvNV -.type glVertexAttribs3dvNV,#function -glVertexAttribs3dvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttribs3dvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttribs3dvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttribs3dvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttribs3fvNV -.type glVertexAttribs3fvNV,#function -glVertexAttribs3fvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttribs3fvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttribs3fvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttribs3fvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttribs3svNV -.type glVertexAttribs3svNV,#function -glVertexAttribs3svNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttribs3svNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttribs3svNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttribs3svNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttribs4dvNV -.type glVertexAttribs4dvNV,#function -glVertexAttribs4dvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttribs4dvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttribs4dvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttribs4dvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttribs4fvNV -.type glVertexAttribs4fvNV,#function -glVertexAttribs4fvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttribs4fvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttribs4fvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttribs4fvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttribs4svNV -.type glVertexAttribs4svNV,#function -glVertexAttribs4svNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttribs4svNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttribs4svNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttribs4svNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttribs4ubvNV -.type glVertexAttribs4ubvNV,#function -glVertexAttribs4ubvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttribs4ubvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttribs4ubvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttribs4ubvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPointParameteriNV -.type glPointParameteriNV,#function -glPointParameteriNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PointParameteriNV), %g2 - or %g2, %lo(8 * _gloffset_PointParameteriNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PointParameteriNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPointParameterivNV -.type glPointParameterivNV,#function -glPointParameterivNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PointParameterivNV), %g2 - or %g2, %lo(8 * _gloffset_PointParameterivNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PointParameterivNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBlendFuncSeparate -.type glBlendFuncSeparate,#function -glBlendFuncSeparate: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BlendFuncSeparateEXT), %g2 - or %g2, %lo(8 * _gloffset_BlendFuncSeparateEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BlendFuncSeparateEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFogCoordf -.type glFogCoordf,#function -glFogCoordf: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FogCoordfEXT), %g2 - or %g2, %lo(8 * _gloffset_FogCoordfEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FogCoordfEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFogCoordfv -.type glFogCoordfv,#function -glFogCoordfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FogCoordfvEXT), %g2 - or %g2, %lo(8 * _gloffset_FogCoordfvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FogCoordfvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFogCoordd -.type glFogCoordd,#function -glFogCoordd: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FogCoorddEXT), %g2 - or %g2, %lo(8 * _gloffset_FogCoorddEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FogCoorddEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFogCoorddv -.type glFogCoorddv,#function -glFogCoorddv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FogCoorddvEXT), %g2 - or %g2, %lo(8 * _gloffset_FogCoorddvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FogCoorddvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFogCoordPointer -.type glFogCoordPointer,#function -glFogCoordPointer: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FogCoordPointerEXT), %g2 - or %g2, %lo(8 * _gloffset_FogCoordPointerEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FogCoordPointerEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiDrawArrays -.type glMultiDrawArrays,#function -glMultiDrawArrays: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiDrawArraysEXT), %g2 - or %g2, %lo(8 * _gloffset_MultiDrawArraysEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiDrawArraysEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMultiDrawElements -.type glMultiDrawElements,#function -glMultiDrawElements: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MultiDrawElementsEXT), %g2 - or %g2, %lo(8 * _gloffset_MultiDrawElementsEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MultiDrawElementsEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPointParameterf -.type glPointParameterf,#function -glPointParameterf: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PointParameterfEXT), %g2 - or %g2, %lo(8 * _gloffset_PointParameterfEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PointParameterfEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPointParameterfv -.type glPointParameterfv,#function -glPointParameterfv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PointParameterfvEXT), %g2 - or %g2, %lo(8 * _gloffset_PointParameterfvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PointParameterfvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPointParameteri -.type glPointParameteri,#function -glPointParameteri: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PointParameteriNV), %g2 - or %g2, %lo(8 * _gloffset_PointParameteriNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PointParameteriNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glPointParameteriv -.type glPointParameteriv,#function -glPointParameteriv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_PointParameterivNV), %g2 - or %g2, %lo(8 * _gloffset_PointParameterivNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_PointParameterivNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3b -.type glSecondaryColor3b,#function -glSecondaryColor3b: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3bEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3bEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3bEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3bv -.type glSecondaryColor3bv,#function -glSecondaryColor3bv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3bvEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3bvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3bvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3d -.type glSecondaryColor3d,#function -glSecondaryColor3d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3dEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3dEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3dEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3dv -.type glSecondaryColor3dv,#function -glSecondaryColor3dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3dvEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3dvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3dvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3f -.type glSecondaryColor3f,#function -glSecondaryColor3f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3fEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3fEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3fEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3fv -.type glSecondaryColor3fv,#function -glSecondaryColor3fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3fvEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3fvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3fvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3i -.type glSecondaryColor3i,#function -glSecondaryColor3i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3iEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3iEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3iEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3iv -.type glSecondaryColor3iv,#function -glSecondaryColor3iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3ivEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3ivEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3ivEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3s -.type glSecondaryColor3s,#function -glSecondaryColor3s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3sEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3sEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3sEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3sv -.type glSecondaryColor3sv,#function -glSecondaryColor3sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3svEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3svEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3svEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3ub -.type glSecondaryColor3ub,#function -glSecondaryColor3ub: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3ubEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3ubEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3ubEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3ubv -.type glSecondaryColor3ubv,#function -glSecondaryColor3ubv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3ubvEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3ubvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3ubvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3ui -.type glSecondaryColor3ui,#function -glSecondaryColor3ui: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3uiEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3uiEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3uiEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3uiv -.type glSecondaryColor3uiv,#function -glSecondaryColor3uiv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3uivEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3uivEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3uivEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3us -.type glSecondaryColor3us,#function -glSecondaryColor3us: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3usEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3usEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3usEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColor3usv -.type glSecondaryColor3usv,#function -glSecondaryColor3usv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColor3usvEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColor3usvEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColor3usvEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSecondaryColorPointer -.type glSecondaryColorPointer,#function -glSecondaryColorPointer: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SecondaryColorPointerEXT), %g2 - or %g2, %lo(8 * _gloffset_SecondaryColorPointerEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SecondaryColorPointerEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2d -.type glWindowPos2d,#function -glWindowPos2d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2dMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2dMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2dMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2dv -.type glWindowPos2dv,#function -glWindowPos2dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2dvMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2dvMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2dvMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2f -.type glWindowPos2f,#function -glWindowPos2f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2fMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2fMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2fMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2fv -.type glWindowPos2fv,#function -glWindowPos2fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2fvMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2fvMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2fvMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2i -.type glWindowPos2i,#function -glWindowPos2i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2iMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2iMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2iMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2iv -.type glWindowPos2iv,#function -glWindowPos2iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2ivMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2ivMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2ivMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2s -.type glWindowPos2s,#function -glWindowPos2s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2sMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2sMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2sMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos2sv -.type glWindowPos2sv,#function -glWindowPos2sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos2svMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos2svMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos2svMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3d -.type glWindowPos3d,#function -glWindowPos3d: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3dMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3dMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3dMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3dv -.type glWindowPos3dv,#function -glWindowPos3dv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3dvMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3dvMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3dvMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3f -.type glWindowPos3f,#function -glWindowPos3f: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3fMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3fMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3fMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3fv -.type glWindowPos3fv,#function -glWindowPos3fv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3fvMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3fvMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3fvMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3i -.type glWindowPos3i,#function -glWindowPos3i: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3iMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3iMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3iMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3iv -.type glWindowPos3iv,#function -glWindowPos3iv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3ivMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3ivMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3ivMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3s -.type glWindowPos3s,#function -glWindowPos3s: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3sMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3sMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3sMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glWindowPos3sv -.type glWindowPos3sv,#function -glWindowPos3sv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_WindowPos3svMESA), %g2 - or %g2, %lo(8 * _gloffset_WindowPos3svMESA), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_WindowPos3svMESA)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glActiveStencilFaceEXT -.type glActiveStencilFaceEXT,#function -glActiveStencilFaceEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ActiveStencilFaceEXT), %g2 - or %g2, %lo(8 * _gloffset_ActiveStencilFaceEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ActiveStencilFaceEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDeleteFencesNV -.type glDeleteFencesNV,#function -glDeleteFencesNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DeleteFencesNV), %g2 - or %g2, %lo(8 * _gloffset_DeleteFencesNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DeleteFencesNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGenFencesNV -.type glGenFencesNV,#function -glGenFencesNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GenFencesNV), %g2 - or %g2, %lo(8 * _gloffset_GenFencesNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GenFencesNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIsFenceNV -.type glIsFenceNV,#function -glIsFenceNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_IsFenceNV), %g2 - or %g2, %lo(8 * _gloffset_IsFenceNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_IsFenceNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glTestFenceNV -.type glTestFenceNV,#function -glTestFenceNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_TestFenceNV), %g2 - or %g2, %lo(8 * _gloffset_TestFenceNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_TestFenceNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetFenceivNV -.type glGetFenceivNV,#function -glGetFenceivNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetFenceivNV), %g2 - or %g2, %lo(8 * _gloffset_GetFenceivNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetFenceivNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glFinishFenceNV -.type glFinishFenceNV,#function -glFinishFenceNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_FinishFenceNV), %g2 - or %g2, %lo(8 * _gloffset_FinishFenceNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_FinishFenceNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glSetFenceNV -.type glSetFenceNV,#function -glSetFenceNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_SetFenceNV), %g2 - or %g2, %lo(8 * _gloffset_SetFenceNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_SetFenceNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib1sARB -.type glVertexAttrib1sARB,#function -glVertexAttrib1sARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib1sNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib1sNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib1sNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib1fARB -.type glVertexAttrib1fARB,#function -glVertexAttrib1fARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib1fNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib1fNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib1fNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib1dARB -.type glVertexAttrib1dARB,#function -glVertexAttrib1dARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib1dNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib1dNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib1dNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib2sARB -.type glVertexAttrib2sARB,#function -glVertexAttrib2sARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib2sNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib2sNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib2sNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib2fARB -.type glVertexAttrib2fARB,#function -glVertexAttrib2fARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib2fNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib2fNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib2fNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib2dARB -.type glVertexAttrib2dARB,#function -glVertexAttrib2dARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib2dNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib2dNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib2dNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib3sARB -.type glVertexAttrib3sARB,#function -glVertexAttrib3sARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib3sNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib3sNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib3sNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib3fARB -.type glVertexAttrib3fARB,#function -glVertexAttrib3fARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib3fNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib3fNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib3fNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib3dARB -.type glVertexAttrib3dARB,#function -glVertexAttrib3dARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib3dNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib3dNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib3dNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4sARB -.type glVertexAttrib4sARB,#function -glVertexAttrib4sARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4sNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4sNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4sNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4fARB -.type glVertexAttrib4fARB,#function -glVertexAttrib4fARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4fNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4fNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4fNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4dARB -.type glVertexAttrib4dARB,#function -glVertexAttrib4dARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4dNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4dNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4dNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4NubARB -.type glVertexAttrib4NubARB,#function -glVertexAttrib4NubARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4ubNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4ubNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4ubNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib1svARB -.type glVertexAttrib1svARB,#function -glVertexAttrib1svARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib1svNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib1svNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib1svNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib1fvARB -.type glVertexAttrib1fvARB,#function -glVertexAttrib1fvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib1fvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib1fvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib1fvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib1dvARB -.type glVertexAttrib1dvARB,#function -glVertexAttrib1dvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib1dvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib1dvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib1dvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib2svARB -.type glVertexAttrib2svARB,#function -glVertexAttrib2svARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib2svNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib2svNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib2svNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib2fvARB -.type glVertexAttrib2fvARB,#function -glVertexAttrib2fvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib2fvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib2fvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib2fvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib2dvARB -.type glVertexAttrib2dvARB,#function -glVertexAttrib2dvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib2dvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib2dvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib2dvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib3svARB -.type glVertexAttrib3svARB,#function -glVertexAttrib3svARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib3svNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib3svNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib3svNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib3fvARB -.type glVertexAttrib3fvARB,#function -glVertexAttrib3fvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib3fvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib3fvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib3fvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib3dvARB -.type glVertexAttrib3dvARB,#function -glVertexAttrib3dvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib3dvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib3dvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib3dvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4bvARB -.type glVertexAttrib4bvARB,#function -glVertexAttrib4bvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4bvARB), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4bvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4bvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4svARB -.type glVertexAttrib4svARB,#function -glVertexAttrib4svARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4svNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4svNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4svNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4ivARB -.type glVertexAttrib4ivARB,#function -glVertexAttrib4ivARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4ivARB), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4ivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4ivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4ubvARB -.type glVertexAttrib4ubvARB,#function -glVertexAttrib4ubvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4ubvARB), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4ubvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4ubvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4usvARB -.type glVertexAttrib4usvARB,#function -glVertexAttrib4usvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4usvARB), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4usvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4usvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4uivARB -.type glVertexAttrib4uivARB,#function -glVertexAttrib4uivARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4uivARB), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4uivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4uivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4fvARB -.type glVertexAttrib4fvARB,#function -glVertexAttrib4fvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4fvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4fvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4fvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4dvARB -.type glVertexAttrib4dvARB,#function -glVertexAttrib4dvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4dvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4dvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4dvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4NbvARB -.type glVertexAttrib4NbvARB,#function -glVertexAttrib4NbvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4NbvARB), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4NbvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4NbvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4NsvARB -.type glVertexAttrib4NsvARB,#function -glVertexAttrib4NsvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4NsvARB), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4NsvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4NsvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4NivARB -.type glVertexAttrib4NivARB,#function -glVertexAttrib4NivARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4NivARB), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4NivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4NivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4NubvARB -.type glVertexAttrib4NubvARB,#function -glVertexAttrib4NubvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4ubvNV), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4ubvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4ubvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4NusvARB -.type glVertexAttrib4NusvARB,#function -glVertexAttrib4NusvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4NusvARB), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4NusvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4NusvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttrib4NuivARB -.type glVertexAttrib4NuivARB,#function -glVertexAttrib4NuivARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttrib4NuivARB), %g2 - or %g2, %lo(8 * _gloffset_VertexAttrib4NuivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttrib4NuivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glVertexAttribPointerARB -.type glVertexAttribPointerARB,#function -glVertexAttribPointerARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_VertexAttribPointerARB), %g2 - or %g2, %lo(8 * _gloffset_VertexAttribPointerARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_VertexAttribPointerARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEnableVertexAttribArrayARB -.type glEnableVertexAttribArrayARB,#function -glEnableVertexAttribArrayARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EnableVertexAttribArrayARB), %g2 - or %g2, %lo(8 * _gloffset_EnableVertexAttribArrayARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EnableVertexAttribArrayARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDisableVertexAttribArrayARB -.type glDisableVertexAttribArrayARB,#function -glDisableVertexAttribArrayARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DisableVertexAttribArrayARB), %g2 - or %g2, %lo(8 * _gloffset_DisableVertexAttribArrayARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DisableVertexAttribArrayARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramStringARB -.type glProgramStringARB,#function -glProgramStringARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramStringARB), %g2 - or %g2, %lo(8 * _gloffset_ProgramStringARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramStringARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBindProgramARB -.type glBindProgramARB,#function -glBindProgramARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BindProgramNV), %g2 - or %g2, %lo(8 * _gloffset_BindProgramNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BindProgramNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDeleteProgramsARB -.type glDeleteProgramsARB,#function -glDeleteProgramsARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DeleteProgramsNV), %g2 - or %g2, %lo(8 * _gloffset_DeleteProgramsNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DeleteProgramsNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGenProgramsARB -.type glGenProgramsARB,#function -glGenProgramsARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GenProgramsNV), %g2 - or %g2, %lo(8 * _gloffset_GenProgramsNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GenProgramsNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIsProgramARB -.type glIsProgramARB,#function -glIsProgramARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_IsProgramNV), %g2 - or %g2, %lo(8 * _gloffset_IsProgramNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_IsProgramNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramEnvParameter4dARB -.type glProgramEnvParameter4dARB,#function -glProgramEnvParameter4dARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramEnvParameter4dARB), %g2 - or %g2, %lo(8 * _gloffset_ProgramEnvParameter4dARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramEnvParameter4dARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramEnvParameter4dvARB -.type glProgramEnvParameter4dvARB,#function -glProgramEnvParameter4dvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramEnvParameter4dvARB), %g2 - or %g2, %lo(8 * _gloffset_ProgramEnvParameter4dvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramEnvParameter4dvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramEnvParameter4fARB -.type glProgramEnvParameter4fARB,#function -glProgramEnvParameter4fARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramEnvParameter4fARB), %g2 - or %g2, %lo(8 * _gloffset_ProgramEnvParameter4fARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramEnvParameter4fARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramEnvParameter4fvARB -.type glProgramEnvParameter4fvARB,#function -glProgramEnvParameter4fvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramEnvParameter4fvARB), %g2 - or %g2, %lo(8 * _gloffset_ProgramEnvParameter4fvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramEnvParameter4fvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramLocalParameter4dARB -.type glProgramLocalParameter4dARB,#function -glProgramLocalParameter4dARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramLocalParameter4dARB), %g2 - or %g2, %lo(8 * _gloffset_ProgramLocalParameter4dARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramLocalParameter4dARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramLocalParameter4dvARB -.type glProgramLocalParameter4dvARB,#function -glProgramLocalParameter4dvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramLocalParameter4dvARB), %g2 - or %g2, %lo(8 * _gloffset_ProgramLocalParameter4dvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramLocalParameter4dvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramLocalParameter4fARB -.type glProgramLocalParameter4fARB,#function -glProgramLocalParameter4fARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramLocalParameter4fARB), %g2 - or %g2, %lo(8 * _gloffset_ProgramLocalParameter4fARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramLocalParameter4fARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramLocalParameter4fvARB -.type glProgramLocalParameter4fvARB,#function -glProgramLocalParameter4fvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramLocalParameter4fvARB), %g2 - or %g2, %lo(8 * _gloffset_ProgramLocalParameter4fvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramLocalParameter4fvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetProgramEnvParameterdvARB -.type glGetProgramEnvParameterdvARB,#function -glGetProgramEnvParameterdvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetProgramEnvParameterdvARB), %g2 - or %g2, %lo(8 * _gloffset_GetProgramEnvParameterdvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetProgramEnvParameterdvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetProgramEnvParameterfvARB -.type glGetProgramEnvParameterfvARB,#function -glGetProgramEnvParameterfvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetProgramEnvParameterfvARB), %g2 - or %g2, %lo(8 * _gloffset_GetProgramEnvParameterfvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetProgramEnvParameterfvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetProgramLocalParameterdvARB -.type glGetProgramLocalParameterdvARB,#function -glGetProgramLocalParameterdvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetProgramLocalParameterdvARB), %g2 - or %g2, %lo(8 * _gloffset_GetProgramLocalParameterdvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetProgramLocalParameterdvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetProgramLocalParameterfvARB -.type glGetProgramLocalParameterfvARB,#function -glGetProgramLocalParameterfvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetProgramLocalParameterfvARB), %g2 - or %g2, %lo(8 * _gloffset_GetProgramLocalParameterfvARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetProgramLocalParameterfvARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetProgramivARB -.type glGetProgramivARB,#function -glGetProgramivARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetProgramivARB), %g2 - or %g2, %lo(8 * _gloffset_GetProgramivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetProgramivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetProgramStringARB -.type glGetProgramStringARB,#function -glGetProgramStringARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetProgramStringARB), %g2 - or %g2, %lo(8 * _gloffset_GetProgramStringARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetProgramStringARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetVertexAttribdvARB -.type glGetVertexAttribdvARB,#function -glGetVertexAttribdvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetVertexAttribdvNV), %g2 - or %g2, %lo(8 * _gloffset_GetVertexAttribdvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetVertexAttribdvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetVertexAttribfvARB -.type glGetVertexAttribfvARB,#function -glGetVertexAttribfvARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetVertexAttribfvNV), %g2 - or %g2, %lo(8 * _gloffset_GetVertexAttribfvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetVertexAttribfvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetVertexAttribivARB -.type glGetVertexAttribivARB,#function -glGetVertexAttribivARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetVertexAttribivNV), %g2 - or %g2, %lo(8 * _gloffset_GetVertexAttribivNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetVertexAttribivNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetVertexAttribPointervARB -.type glGetVertexAttribPointervARB,#function -glGetVertexAttribPointervARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetVertexAttribPointervNV), %g2 - or %g2, %lo(8 * _gloffset_GetVertexAttribPointervNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetVertexAttribPointervNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramNamedParameter4fNV -.type glProgramNamedParameter4fNV,#function -glProgramNamedParameter4fNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramNamedParameter4fNV), %g2 - or %g2, %lo(8 * _gloffset_ProgramNamedParameter4fNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramNamedParameter4fNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramNamedParameter4dNV -.type glProgramNamedParameter4dNV,#function -glProgramNamedParameter4dNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramNamedParameter4dNV), %g2 - or %g2, %lo(8 * _gloffset_ProgramNamedParameter4dNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramNamedParameter4dNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramNamedParameter4fvNV -.type glProgramNamedParameter4fvNV,#function -glProgramNamedParameter4fvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramNamedParameter4fvNV), %g2 - or %g2, %lo(8 * _gloffset_ProgramNamedParameter4fvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramNamedParameter4fvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glProgramNamedParameter4dvNV -.type glProgramNamedParameter4dvNV,#function -glProgramNamedParameter4dvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_ProgramNamedParameter4dvNV), %g2 - or %g2, %lo(8 * _gloffset_ProgramNamedParameter4dvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_ProgramNamedParameter4dvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetProgramNamedParameterfvNV -.type glGetProgramNamedParameterfvNV,#function -glGetProgramNamedParameterfvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetProgramNamedParameterfvNV), %g2 - or %g2, %lo(8 * _gloffset_GetProgramNamedParameterfvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetProgramNamedParameterfvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetProgramNamedParameterdvNV -.type glGetProgramNamedParameterdvNV,#function -glGetProgramNamedParameterdvNV: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetProgramNamedParameterdvNV), %g2 - or %g2, %lo(8 * _gloffset_GetProgramNamedParameterdvNV), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetProgramNamedParameterdvNV)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBindBufferARB -.type glBindBufferARB,#function -glBindBufferARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BindBufferARB), %g2 - or %g2, %lo(8 * _gloffset_BindBufferARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BindBufferARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBufferDataARB -.type glBufferDataARB,#function -glBufferDataARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BufferDataARB), %g2 - or %g2, %lo(8 * _gloffset_BufferDataARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BufferDataARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBufferSubDataARB -.type glBufferSubDataARB,#function -glBufferSubDataARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BufferSubDataARB), %g2 - or %g2, %lo(8 * _gloffset_BufferSubDataARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BufferSubDataARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDeleteBuffersARB -.type glDeleteBuffersARB,#function -glDeleteBuffersARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DeleteBuffersARB), %g2 - or %g2, %lo(8 * _gloffset_DeleteBuffersARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DeleteBuffersARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGenBuffersARB -.type glGenBuffersARB,#function -glGenBuffersARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GenBuffersARB), %g2 - or %g2, %lo(8 * _gloffset_GenBuffersARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GenBuffersARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetBufferParameterivARB -.type glGetBufferParameterivARB,#function -glGetBufferParameterivARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetBufferParameterivARB), %g2 - or %g2, %lo(8 * _gloffset_GetBufferParameterivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetBufferParameterivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetBufferPointervARB -.type glGetBufferPointervARB,#function -glGetBufferPointervARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetBufferPointervARB), %g2 - or %g2, %lo(8 * _gloffset_GetBufferPointervARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetBufferPointervARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetBufferSubDataARB -.type glGetBufferSubDataARB,#function -glGetBufferSubDataARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetBufferSubDataARB), %g2 - or %g2, %lo(8 * _gloffset_GetBufferSubDataARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetBufferSubDataARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIsBufferARB -.type glIsBufferARB,#function -glIsBufferARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_IsBufferARB), %g2 - or %g2, %lo(8 * _gloffset_IsBufferARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_IsBufferARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMapBufferARB -.type glMapBufferARB,#function -glMapBufferARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MapBufferARB), %g2 - or %g2, %lo(8 * _gloffset_MapBufferARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MapBufferARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glUnmapBufferARB -.type glUnmapBufferARB,#function -glUnmapBufferARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_UnmapBufferARB), %g2 - or %g2, %lo(8 * _gloffset_UnmapBufferARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_UnmapBufferARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDepthBoundsEXT -.type glDepthBoundsEXT,#function -glDepthBoundsEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DepthBoundsEXT), %g2 - or %g2, %lo(8 * _gloffset_DepthBoundsEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DepthBoundsEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGenQueriesARB -.type glGenQueriesARB,#function -glGenQueriesARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GenQueriesARB), %g2 - or %g2, %lo(8 * _gloffset_GenQueriesARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GenQueriesARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDeleteQueriesARB -.type glDeleteQueriesARB,#function -glDeleteQueriesARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DeleteQueriesARB), %g2 - or %g2, %lo(8 * _gloffset_DeleteQueriesARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DeleteQueriesARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIsQueryARB -.type glIsQueryARB,#function -glIsQueryARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_IsQueryARB), %g2 - or %g2, %lo(8 * _gloffset_IsQueryARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_IsQueryARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBeginQueryARB -.type glBeginQueryARB,#function -glBeginQueryARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BeginQueryARB), %g2 - or %g2, %lo(8 * _gloffset_BeginQueryARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BeginQueryARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEndQueryARB -.type glEndQueryARB,#function -glEndQueryARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EndQueryARB), %g2 - or %g2, %lo(8 * _gloffset_EndQueryARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EndQueryARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetQueryivARB -.type glGetQueryivARB,#function -glGetQueryivARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetQueryivARB), %g2 - or %g2, %lo(8 * _gloffset_GetQueryivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetQueryivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetQueryObjectivARB -.type glGetQueryObjectivARB,#function -glGetQueryObjectivARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetQueryObjectivARB), %g2 - or %g2, %lo(8 * _gloffset_GetQueryObjectivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetQueryObjectivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetQueryObjectuivARB -.type glGetQueryObjectuivARB,#function -glGetQueryObjectuivARB: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetQueryObjectuivARB), %g2 - or %g2, %lo(8 * _gloffset_GetQueryObjectuivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetQueryObjectuivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBindBuffer -.type glBindBuffer,#function -glBindBuffer: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BindBufferARB), %g2 - or %g2, %lo(8 * _gloffset_BindBufferARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BindBufferARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBufferData -.type glBufferData,#function -glBufferData: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BufferDataARB), %g2 - or %g2, %lo(8 * _gloffset_BufferDataARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BufferDataARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBufferSubData -.type glBufferSubData,#function -glBufferSubData: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BufferSubDataARB), %g2 - or %g2, %lo(8 * _gloffset_BufferSubDataARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BufferSubDataARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDeleteBuffers -.type glDeleteBuffers,#function -glDeleteBuffers: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DeleteBuffersARB), %g2 - or %g2, %lo(8 * _gloffset_DeleteBuffersARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DeleteBuffersARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGenBuffers -.type glGenBuffers,#function -glGenBuffers: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GenBuffersARB), %g2 - or %g2, %lo(8 * _gloffset_GenBuffersARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GenBuffersARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetBufferParameteriv -.type glGetBufferParameteriv,#function -glGetBufferParameteriv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetBufferParameterivARB), %g2 - or %g2, %lo(8 * _gloffset_GetBufferParameterivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetBufferParameterivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetBufferPointerv -.type glGetBufferPointerv,#function -glGetBufferPointerv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetBufferPointervARB), %g2 - or %g2, %lo(8 * _gloffset_GetBufferPointervARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetBufferPointervARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetBufferSubData -.type glGetBufferSubData,#function -glGetBufferSubData: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetBufferSubDataARB), %g2 - or %g2, %lo(8 * _gloffset_GetBufferSubDataARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetBufferSubDataARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIsBuffer -.type glIsBuffer,#function -glIsBuffer: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_IsBufferARB), %g2 - or %g2, %lo(8 * _gloffset_IsBufferARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_IsBufferARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glMapBuffer -.type glMapBuffer,#function -glMapBuffer: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_MapBufferARB), %g2 - or %g2, %lo(8 * _gloffset_MapBufferARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_MapBufferARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glUnmapBuffer -.type glUnmapBuffer,#function -glUnmapBuffer: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_UnmapBufferARB), %g2 - or %g2, %lo(8 * _gloffset_UnmapBufferARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_UnmapBufferARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGenQueries -.type glGenQueries,#function -glGenQueries: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GenQueriesARB), %g2 - or %g2, %lo(8 * _gloffset_GenQueriesARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GenQueriesARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glDeleteQueries -.type glDeleteQueries,#function -glDeleteQueries: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_DeleteQueriesARB), %g2 - or %g2, %lo(8 * _gloffset_DeleteQueriesARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_DeleteQueriesARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glIsQuery -.type glIsQuery,#function -glIsQuery: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_IsQueryARB), %g2 - or %g2, %lo(8 * _gloffset_IsQueryARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_IsQueryARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBeginQuery -.type glBeginQuery,#function -glBeginQuery: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BeginQueryARB), %g2 - or %g2, %lo(8 * _gloffset_BeginQueryARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BeginQueryARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glEndQuery -.type glEndQuery,#function -glEndQuery: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_EndQueryARB), %g2 - or %g2, %lo(8 * _gloffset_EndQueryARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_EndQueryARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetQueryiv -.type glGetQueryiv,#function -glGetQueryiv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetQueryivARB), %g2 - or %g2, %lo(8 * _gloffset_GetQueryivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetQueryivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetQueryObjectiv -.type glGetQueryObjectiv,#function -glGetQueryObjectiv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetQueryObjectivARB), %g2 - or %g2, %lo(8 * _gloffset_GetQueryObjectivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetQueryObjectivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glGetQueryObjectuiv -.type glGetQueryObjectuiv,#function -glGetQueryObjectuiv: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_GetQueryObjectuivARB), %g2 - or %g2, %lo(8 * _gloffset_GetQueryObjectuivARB), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_GetQueryObjectuivARB)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBlendEquationSeparateEXT -.type glBlendEquationSeparateEXT,#function -glBlendEquationSeparateEXT: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BlendEquationSeparateEXT), %g2 - or %g2, %lo(8 * _gloffset_BlendEquationSeparateEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BlendEquationSeparateEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - -.globl glBlendEquationSeparateATI -.type glBlendEquationSeparateATI,#function -glBlendEquationSeparateATI: -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) - sethi %hi(0x00000000), %g2 - sethi %hi(0x00000000), %g1 - or %g2, %lo(0x00000000), %g2 - or %g1, %lo(0x00000000), %g1 - sllx %g2, 32, %g2 - ldx [%g1 + %g2], %g1 - sethi %hi(8 * _gloffset_BlendEquationSeparateEXT), %g2 - or %g2, %lo(8 * _gloffset_BlendEquationSeparateEXT), %g2 - ldx [%g1 + %g2], %g3 -#else - sethi %hi(0x00000000), %g1 - ld [%g1 + %lo(0x00000000)], %g1 - ld [%g1 + (4 * _gloffset_BlendEquationSeparateEXT)], %g3 -#endif - jmpl %g3, %g0 - nop - nop - -.globl _mesa_sparc_glapi_end -.type _mesa_sparc_glapi_end,#function + GL_STUB(glNewList, _gloffset_NewList) + GL_STUB(glEndList, _gloffset_EndList) + GL_STUB(glCallList, _gloffset_CallList) + GL_STUB(glCallLists, _gloffset_CallLists) + GL_STUB(glDeleteLists, _gloffset_DeleteLists) + GL_STUB(glGenLists, _gloffset_GenLists) + GL_STUB(glListBase, _gloffset_ListBase) + GL_STUB(glBegin, _gloffset_Begin) + GL_STUB(glBitmap, _gloffset_Bitmap) + GL_STUB(glColor3b, _gloffset_Color3b) + GL_STUB(glColor3bv, _gloffset_Color3bv) + GL_STUB(glColor3d, _gloffset_Color3d) + GL_STUB(glColor3dv, _gloffset_Color3dv) + GL_STUB(glColor3f, _gloffset_Color3f) + GL_STUB(glColor3fv, _gloffset_Color3fv) + GL_STUB(glColor3i, _gloffset_Color3i) + GL_STUB(glColor3iv, _gloffset_Color3iv) + GL_STUB(glColor3s, _gloffset_Color3s) + GL_STUB(glColor3sv, _gloffset_Color3sv) + GL_STUB(glColor3ub, _gloffset_Color3ub) + GL_STUB(glColor3ubv, _gloffset_Color3ubv) + GL_STUB(glColor3ui, _gloffset_Color3ui) + GL_STUB(glColor3uiv, _gloffset_Color3uiv) + GL_STUB(glColor3us, _gloffset_Color3us) + GL_STUB(glColor3usv, _gloffset_Color3usv) + GL_STUB(glColor4b, _gloffset_Color4b) + GL_STUB(glColor4bv, _gloffset_Color4bv) + GL_STUB(glColor4d, _gloffset_Color4d) + GL_STUB(glColor4dv, _gloffset_Color4dv) + GL_STUB(glColor4f, _gloffset_Color4f) + GL_STUB(glColor4fv, _gloffset_Color4fv) + GL_STUB(glColor4i, _gloffset_Color4i) + GL_STUB(glColor4iv, _gloffset_Color4iv) + GL_STUB(glColor4s, _gloffset_Color4s) + GL_STUB(glColor4sv, _gloffset_Color4sv) + GL_STUB(glColor4ub, _gloffset_Color4ub) + GL_STUB(glColor4ubv, _gloffset_Color4ubv) + GL_STUB(glColor4ui, _gloffset_Color4ui) + GL_STUB(glColor4uiv, _gloffset_Color4uiv) + GL_STUB(glColor4us, _gloffset_Color4us) + GL_STUB(glColor4usv, _gloffset_Color4usv) + GL_STUB(glEdgeFlag, _gloffset_EdgeFlag) + GL_STUB(glEdgeFlagv, _gloffset_EdgeFlagv) + GL_STUB(glEnd, _gloffset_End) + GL_STUB(glIndexd, _gloffset_Indexd) + GL_STUB(glIndexdv, _gloffset_Indexdv) + GL_STUB(glIndexf, _gloffset_Indexf) + GL_STUB(glIndexfv, _gloffset_Indexfv) + GL_STUB(glIndexi, _gloffset_Indexi) + GL_STUB(glIndexiv, _gloffset_Indexiv) + GL_STUB(glIndexs, _gloffset_Indexs) + GL_STUB(glIndexsv, _gloffset_Indexsv) + GL_STUB(glNormal3b, _gloffset_Normal3b) + GL_STUB(glNormal3bv, _gloffset_Normal3bv) + GL_STUB(glNormal3d, _gloffset_Normal3d) + GL_STUB(glNormal3dv, _gloffset_Normal3dv) + GL_STUB(glNormal3f, _gloffset_Normal3f) + GL_STUB(glNormal3fv, _gloffset_Normal3fv) + GL_STUB(glNormal3i, _gloffset_Normal3i) + GL_STUB(glNormal3iv, _gloffset_Normal3iv) + GL_STUB(glNormal3s, _gloffset_Normal3s) + GL_STUB(glNormal3sv, _gloffset_Normal3sv) + GL_STUB(glRasterPos2d, _gloffset_RasterPos2d) + GL_STUB(glRasterPos2dv, _gloffset_RasterPos2dv) + GL_STUB(glRasterPos2f, _gloffset_RasterPos2f) + GL_STUB(glRasterPos2fv, _gloffset_RasterPos2fv) + GL_STUB(glRasterPos2i, _gloffset_RasterPos2i) + GL_STUB(glRasterPos2iv, _gloffset_RasterPos2iv) + GL_STUB(glRasterPos2s, _gloffset_RasterPos2s) + GL_STUB(glRasterPos2sv, _gloffset_RasterPos2sv) + GL_STUB(glRasterPos3d, _gloffset_RasterPos3d) + GL_STUB(glRasterPos3dv, _gloffset_RasterPos3dv) + GL_STUB(glRasterPos3f, _gloffset_RasterPos3f) + GL_STUB(glRasterPos3fv, _gloffset_RasterPos3fv) + GL_STUB(glRasterPos3i, _gloffset_RasterPos3i) + GL_STUB(glRasterPos3iv, _gloffset_RasterPos3iv) + GL_STUB(glRasterPos3s, _gloffset_RasterPos3s) + GL_STUB(glRasterPos3sv, _gloffset_RasterPos3sv) + GL_STUB(glRasterPos4d, _gloffset_RasterPos4d) + GL_STUB(glRasterPos4dv, _gloffset_RasterPos4dv) + GL_STUB(glRasterPos4f, _gloffset_RasterPos4f) + GL_STUB(glRasterPos4fv, _gloffset_RasterPos4fv) + GL_STUB(glRasterPos4i, _gloffset_RasterPos4i) + GL_STUB(glRasterPos4iv, _gloffset_RasterPos4iv) + GL_STUB(glRasterPos4s, _gloffset_RasterPos4s) + GL_STUB(glRasterPos4sv, _gloffset_RasterPos4sv) + GL_STUB(glRectd, _gloffset_Rectd) + GL_STUB(glRectdv, _gloffset_Rectdv) + GL_STUB(glRectf, _gloffset_Rectf) + GL_STUB(glRectfv, _gloffset_Rectfv) + GL_STUB(glRecti, _gloffset_Recti) + GL_STUB(glRectiv, _gloffset_Rectiv) + GL_STUB(glRects, _gloffset_Rects) + GL_STUB(glRectsv, _gloffset_Rectsv) + GL_STUB(glTexCoord1d, _gloffset_TexCoord1d) + GL_STUB(glTexCoord1dv, _gloffset_TexCoord1dv) + GL_STUB(glTexCoord1f, _gloffset_TexCoord1f) + GL_STUB(glTexCoord1fv, _gloffset_TexCoord1fv) + GL_STUB(glTexCoord1i, _gloffset_TexCoord1i) + GL_STUB(glTexCoord1iv, _gloffset_TexCoord1iv) + GL_STUB(glTexCoord1s, _gloffset_TexCoord1s) + GL_STUB(glTexCoord1sv, _gloffset_TexCoord1sv) + GL_STUB(glTexCoord2d, _gloffset_TexCoord2d) + GL_STUB(glTexCoord2dv, _gloffset_TexCoord2dv) + GL_STUB(glTexCoord2f, _gloffset_TexCoord2f) + GL_STUB(glTexCoord2fv, _gloffset_TexCoord2fv) + GL_STUB(glTexCoord2i, _gloffset_TexCoord2i) + GL_STUB(glTexCoord2iv, _gloffset_TexCoord2iv) + GL_STUB(glTexCoord2s, _gloffset_TexCoord2s) + GL_STUB(glTexCoord2sv, _gloffset_TexCoord2sv) + GL_STUB(glTexCoord3d, _gloffset_TexCoord3d) + GL_STUB(glTexCoord3dv, _gloffset_TexCoord3dv) + GL_STUB(glTexCoord3f, _gloffset_TexCoord3f) + GL_STUB(glTexCoord3fv, _gloffset_TexCoord3fv) + GL_STUB(glTexCoord3i, _gloffset_TexCoord3i) + GL_STUB(glTexCoord3iv, _gloffset_TexCoord3iv) + GL_STUB(glTexCoord3s, _gloffset_TexCoord3s) + GL_STUB(glTexCoord3sv, _gloffset_TexCoord3sv) + GL_STUB(glTexCoord4d, _gloffset_TexCoord4d) + GL_STUB(glTexCoord4dv, _gloffset_TexCoord4dv) + GL_STUB(glTexCoord4f, _gloffset_TexCoord4f) + GL_STUB(glTexCoord4fv, _gloffset_TexCoord4fv) + GL_STUB(glTexCoord4i, _gloffset_TexCoord4i) + GL_STUB(glTexCoord4iv, _gloffset_TexCoord4iv) + GL_STUB(glTexCoord4s, _gloffset_TexCoord4s) + GL_STUB(glTexCoord4sv, _gloffset_TexCoord4sv) + GL_STUB(glVertex2d, _gloffset_Vertex2d) + GL_STUB(glVertex2dv, _gloffset_Vertex2dv) + GL_STUB(glVertex2f, _gloffset_Vertex2f) + GL_STUB(glVertex2fv, _gloffset_Vertex2fv) + GL_STUB(glVertex2i, _gloffset_Vertex2i) + GL_STUB(glVertex2iv, _gloffset_Vertex2iv) + GL_STUB(glVertex2s, _gloffset_Vertex2s) + GL_STUB(glVertex2sv, _gloffset_Vertex2sv) + GL_STUB(glVertex3d, _gloffset_Vertex3d) + GL_STUB(glVertex3dv, _gloffset_Vertex3dv) + GL_STUB(glVertex3f, _gloffset_Vertex3f) + GL_STUB(glVertex3fv, _gloffset_Vertex3fv) + GL_STUB(glVertex3i, _gloffset_Vertex3i) + GL_STUB(glVertex3iv, _gloffset_Vertex3iv) + GL_STUB(glVertex3s, _gloffset_Vertex3s) + GL_STUB(glVertex3sv, _gloffset_Vertex3sv) + GL_STUB(glVertex4d, _gloffset_Vertex4d) + GL_STUB(glVertex4dv, _gloffset_Vertex4dv) + GL_STUB(glVertex4f, _gloffset_Vertex4f) + GL_STUB(glVertex4fv, _gloffset_Vertex4fv) + GL_STUB(glVertex4i, _gloffset_Vertex4i) + GL_STUB(glVertex4iv, _gloffset_Vertex4iv) + GL_STUB(glVertex4s, _gloffset_Vertex4s) + GL_STUB(glVertex4sv, _gloffset_Vertex4sv) + GL_STUB(glClipPlane, _gloffset_ClipPlane) + GL_STUB(glColorMaterial, _gloffset_ColorMaterial) + GL_STUB(glCullFace, _gloffset_CullFace) + GL_STUB(glFogf, _gloffset_Fogf) + GL_STUB(glFogfv, _gloffset_Fogfv) + GL_STUB(glFogi, _gloffset_Fogi) + GL_STUB(glFogiv, _gloffset_Fogiv) + GL_STUB(glFrontFace, _gloffset_FrontFace) + GL_STUB(glHint, _gloffset_Hint) + GL_STUB(glLightf, _gloffset_Lightf) + GL_STUB(glLightfv, _gloffset_Lightfv) + GL_STUB(glLighti, _gloffset_Lighti) + GL_STUB(glLightiv, _gloffset_Lightiv) + GL_STUB(glLightModelf, _gloffset_LightModelf) + GL_STUB(glLightModelfv, _gloffset_LightModelfv) + GL_STUB(glLightModeli, _gloffset_LightModeli) + GL_STUB(glLightModeliv, _gloffset_LightModeliv) + GL_STUB(glLineStipple, _gloffset_LineStipple) + GL_STUB(glLineWidth, _gloffset_LineWidth) + GL_STUB(glMaterialf, _gloffset_Materialf) + GL_STUB(glMaterialfv, _gloffset_Materialfv) + GL_STUB(glMateriali, _gloffset_Materiali) + GL_STUB(glMaterialiv, _gloffset_Materialiv) + GL_STUB(glPointSize, _gloffset_PointSize) + GL_STUB(glPolygonMode, _gloffset_PolygonMode) + GL_STUB(glPolygonStipple, _gloffset_PolygonStipple) + GL_STUB(glScissor, _gloffset_Scissor) + GL_STUB(glShadeModel, _gloffset_ShadeModel) + GL_STUB(glTexParameterf, _gloffset_TexParameterf) + GL_STUB(glTexParameterfv, _gloffset_TexParameterfv) + GL_STUB(glTexParameteri, _gloffset_TexParameteri) + GL_STUB(glTexParameteriv, _gloffset_TexParameteriv) + GL_STUB(glTexImage1D, _gloffset_TexImage1D) + GL_STUB(glTexImage2D, _gloffset_TexImage2D) + GL_STUB(glTexEnvf, _gloffset_TexEnvf) + GL_STUB(glTexEnvfv, _gloffset_TexEnvfv) + GL_STUB(glTexEnvi, _gloffset_TexEnvi) + GL_STUB(glTexEnviv, _gloffset_TexEnviv) + GL_STUB(glTexGend, _gloffset_TexGend) + GL_STUB(glTexGendv, _gloffset_TexGendv) + GL_STUB(glTexGenf, _gloffset_TexGenf) + GL_STUB(glTexGenfv, _gloffset_TexGenfv) + GL_STUB(glTexGeni, _gloffset_TexGeni) + GL_STUB(glTexGeniv, _gloffset_TexGeniv) + GL_STUB(glFeedbackBuffer, _gloffset_FeedbackBuffer) + GL_STUB(glSelectBuffer, _gloffset_SelectBuffer) + GL_STUB(glRenderMode, _gloffset_RenderMode) + GL_STUB(glInitNames, _gloffset_InitNames) + GL_STUB(glLoadName, _gloffset_LoadName) + GL_STUB(glPassThrough, _gloffset_PassThrough) + GL_STUB(glPopName, _gloffset_PopName) + GL_STUB(glPushName, _gloffset_PushName) + GL_STUB(glDrawBuffer, _gloffset_DrawBuffer) + GL_STUB(glClear, _gloffset_Clear) + GL_STUB(glClearAccum, _gloffset_ClearAccum) + GL_STUB(glClearIndex, _gloffset_ClearIndex) + GL_STUB(glClearColor, _gloffset_ClearColor) + GL_STUB(glClearStencil, _gloffset_ClearStencil) + GL_STUB(glClearDepth, _gloffset_ClearDepth) + GL_STUB(glStencilMask, _gloffset_StencilMask) + GL_STUB(glColorMask, _gloffset_ColorMask) + GL_STUB(glDepthMask, _gloffset_DepthMask) + GL_STUB(glIndexMask, _gloffset_IndexMask) + GL_STUB(glAccum, _gloffset_Accum) + GL_STUB(glDisable, _gloffset_Disable) + GL_STUB(glEnable, _gloffset_Enable) + GL_STUB(glFinish, _gloffset_Finish) + GL_STUB(glFlush, _gloffset_Flush) + GL_STUB(glPopAttrib, _gloffset_PopAttrib) + GL_STUB(glPushAttrib, _gloffset_PushAttrib) + GL_STUB(glMap1d, _gloffset_Map1d) + GL_STUB(glMap1f, _gloffset_Map1f) + GL_STUB(glMap2d, _gloffset_Map2d) + GL_STUB(glMap2f, _gloffset_Map2f) + GL_STUB(glMapGrid1d, _gloffset_MapGrid1d) + GL_STUB(glMapGrid1f, _gloffset_MapGrid1f) + GL_STUB(glMapGrid2d, _gloffset_MapGrid2d) + GL_STUB(glMapGrid2f, _gloffset_MapGrid2f) + GL_STUB(glEvalCoord1d, _gloffset_EvalCoord1d) + GL_STUB(glEvalCoord1dv, _gloffset_EvalCoord1dv) + GL_STUB(glEvalCoord1f, _gloffset_EvalCoord1f) + GL_STUB(glEvalCoord1fv, _gloffset_EvalCoord1fv) + GL_STUB(glEvalCoord2d, _gloffset_EvalCoord2d) + GL_STUB(glEvalCoord2dv, _gloffset_EvalCoord2dv) + GL_STUB(glEvalCoord2f, _gloffset_EvalCoord2f) + GL_STUB(glEvalCoord2fv, _gloffset_EvalCoord2fv) + GL_STUB(glEvalMesh1, _gloffset_EvalMesh1) + GL_STUB(glEvalPoint1, _gloffset_EvalPoint1) + GL_STUB(glEvalMesh2, _gloffset_EvalMesh2) + GL_STUB(glEvalPoint2, _gloffset_EvalPoint2) + GL_STUB(glAlphaFunc, _gloffset_AlphaFunc) + GL_STUB(glBlendFunc, _gloffset_BlendFunc) + GL_STUB(glLogicOp, _gloffset_LogicOp) + GL_STUB(glStencilFunc, _gloffset_StencilFunc) + GL_STUB(glStencilOp, _gloffset_StencilOp) + GL_STUB(glDepthFunc, _gloffset_DepthFunc) + GL_STUB(glPixelZoom, _gloffset_PixelZoom) + GL_STUB(glPixelTransferf, _gloffset_PixelTransferf) + GL_STUB(glPixelTransferi, _gloffset_PixelTransferi) + GL_STUB(glPixelStoref, _gloffset_PixelStoref) + GL_STUB(glPixelStorei, _gloffset_PixelStorei) + GL_STUB(glPixelMapfv, _gloffset_PixelMapfv) + GL_STUB(glPixelMapuiv, _gloffset_PixelMapuiv) + GL_STUB(glPixelMapusv, _gloffset_PixelMapusv) + GL_STUB(glReadBuffer, _gloffset_ReadBuffer) + GL_STUB(glCopyPixels, _gloffset_CopyPixels) + GL_STUB(glReadPixels, _gloffset_ReadPixels) + GL_STUB(glDrawPixels, _gloffset_DrawPixels) + GL_STUB(glGetBooleanv, _gloffset_GetBooleanv) + GL_STUB(glGetClipPlane, _gloffset_GetClipPlane) + GL_STUB(glGetDoublev, _gloffset_GetDoublev) + GL_STUB(glGetError, _gloffset_GetError) + GL_STUB(glGetFloatv, _gloffset_GetFloatv) + GL_STUB(glGetIntegerv, _gloffset_GetIntegerv) + GL_STUB(glGetLightfv, _gloffset_GetLightfv) + GL_STUB(glGetLightiv, _gloffset_GetLightiv) + GL_STUB(glGetMapdv, _gloffset_GetMapdv) + GL_STUB(glGetMapfv, _gloffset_GetMapfv) + GL_STUB(glGetMapiv, _gloffset_GetMapiv) + GL_STUB(glGetMaterialfv, _gloffset_GetMaterialfv) + GL_STUB(glGetMaterialiv, _gloffset_GetMaterialiv) + GL_STUB(glGetPixelMapfv, _gloffset_GetPixelMapfv) + GL_STUB(glGetPixelMapuiv, _gloffset_GetPixelMapuiv) + GL_STUB(glGetPixelMapusv, _gloffset_GetPixelMapusv) + GL_STUB(glGetPolygonStipple, _gloffset_GetPolygonStipple) + GL_STUB(glGetString, _gloffset_GetString) + GL_STUB(glGetTexEnvfv, _gloffset_GetTexEnvfv) + GL_STUB(glGetTexEnviv, _gloffset_GetTexEnviv) + GL_STUB(glGetTexGendv, _gloffset_GetTexGendv) + GL_STUB(glGetTexGenfv, _gloffset_GetTexGenfv) + GL_STUB(glGetTexGeniv, _gloffset_GetTexGeniv) + GL_STUB(glGetTexImage, _gloffset_GetTexImage) + GL_STUB(glGetTexParameterfv, _gloffset_GetTexParameterfv) + GL_STUB(glGetTexParameteriv, _gloffset_GetTexParameteriv) + GL_STUB(glGetTexLevelParameterfv, _gloffset_GetTexLevelParameterfv) + GL_STUB(glGetTexLevelParameteriv, _gloffset_GetTexLevelParameteriv) + GL_STUB(glIsEnabled, _gloffset_IsEnabled) + GL_STUB(glIsList, _gloffset_IsList) + GL_STUB(glDepthRange, _gloffset_DepthRange) + GL_STUB(glFrustum, _gloffset_Frustum) + GL_STUB(glLoadIdentity, _gloffset_LoadIdentity) + GL_STUB(glLoadMatrixf, _gloffset_LoadMatrixf) + GL_STUB(glLoadMatrixd, _gloffset_LoadMatrixd) + GL_STUB(glMatrixMode, _gloffset_MatrixMode) + GL_STUB(glMultMatrixf, _gloffset_MultMatrixf) + GL_STUB(glMultMatrixd, _gloffset_MultMatrixd) + GL_STUB(glOrtho, _gloffset_Ortho) + GL_STUB(glPopMatrix, _gloffset_PopMatrix) + GL_STUB(glPushMatrix, _gloffset_PushMatrix) + GL_STUB(glRotated, _gloffset_Rotated) + GL_STUB(glRotatef, _gloffset_Rotatef) + GL_STUB(glScaled, _gloffset_Scaled) + GL_STUB(glScalef, _gloffset_Scalef) + GL_STUB(glTranslated, _gloffset_Translated) + GL_STUB(glTranslatef, _gloffset_Translatef) + GL_STUB(glViewport, _gloffset_Viewport) + GL_STUB(glArrayElement, _gloffset_ArrayElement) + GL_STUB(glBindTexture, _gloffset_BindTexture) + GL_STUB(glColorPointer, _gloffset_ColorPointer) + GL_STUB(glDisableClientState, _gloffset_DisableClientState) + GL_STUB(glDrawArrays, _gloffset_DrawArrays) + GL_STUB(glDrawElements, _gloffset_DrawElements) + GL_STUB(glEdgeFlagPointer, _gloffset_EdgeFlagPointer) + GL_STUB(glEnableClientState, _gloffset_EnableClientState) + GL_STUB(glIndexPointer, _gloffset_IndexPointer) + GL_STUB(glIndexub, _gloffset_Indexub) + GL_STUB(glIndexubv, _gloffset_Indexubv) + GL_STUB(glInterleavedArrays, _gloffset_InterleavedArrays) + GL_STUB(glNormalPointer, _gloffset_NormalPointer) + GL_STUB(glPolygonOffset, _gloffset_PolygonOffset) + GL_STUB(glTexCoordPointer, _gloffset_TexCoordPointer) + GL_STUB(glVertexPointer, _gloffset_VertexPointer) + GL_STUB(glAreTexturesResident, _gloffset_AreTexturesResident) + GL_STUB(glCopyTexImage1D, _gloffset_CopyTexImage1D) + GL_STUB(glCopyTexImage2D, _gloffset_CopyTexImage2D) + GL_STUB(glCopyTexSubImage1D, _gloffset_CopyTexSubImage1D) + GL_STUB(glCopyTexSubImage2D, _gloffset_CopyTexSubImage2D) + GL_STUB(glDeleteTextures, _gloffset_DeleteTextures) + GL_STUB(glGenTextures, _gloffset_GenTextures) + GL_STUB(glGetPointerv, _gloffset_GetPointerv) + GL_STUB(glIsTexture, _gloffset_IsTexture) + GL_STUB(glPrioritizeTextures, _gloffset_PrioritizeTextures) + GL_STUB(glTexSubImage1D, _gloffset_TexSubImage1D) + GL_STUB(glTexSubImage2D, _gloffset_TexSubImage2D) + GL_STUB(glPopClientAttrib, _gloffset_PopClientAttrib) + GL_STUB(glPushClientAttrib, _gloffset_PushClientAttrib) + GL_STUB(glBlendColor, _gloffset_BlendColor) + GL_STUB(glBlendEquation, _gloffset_BlendEquation) + GL_STUB(glDrawRangeElements, _gloffset_DrawRangeElements) + GL_STUB(glColorTable, _gloffset_ColorTable) + GL_STUB(glColorTableParameterfv, _gloffset_ColorTableParameterfv) + GL_STUB(glColorTableParameteriv, _gloffset_ColorTableParameteriv) + GL_STUB(glCopyColorTable, _gloffset_CopyColorTable) + GL_STUB(glGetColorTable, _gloffset_GetColorTable) + GL_STUB(glGetColorTableParameterfv, _gloffset_GetColorTableParameterfv) + GL_STUB(glGetColorTableParameteriv, _gloffset_GetColorTableParameteriv) + GL_STUB(glColorSubTable, _gloffset_ColorSubTable) + GL_STUB(glCopyColorSubTable, _gloffset_CopyColorSubTable) + GL_STUB(glConvolutionFilter1D, _gloffset_ConvolutionFilter1D) + GL_STUB(glConvolutionFilter2D, _gloffset_ConvolutionFilter2D) + GL_STUB(glConvolutionParameterf, _gloffset_ConvolutionParameterf) + GL_STUB(glConvolutionParameterfv, _gloffset_ConvolutionParameterfv) + GL_STUB(glConvolutionParameteri, _gloffset_ConvolutionParameteri) + GL_STUB(glConvolutionParameteriv, _gloffset_ConvolutionParameteriv) + GL_STUB(glCopyConvolutionFilter1D, _gloffset_CopyConvolutionFilter1D) + GL_STUB(glCopyConvolutionFilter2D, _gloffset_CopyConvolutionFilter2D) + GL_STUB(glGetConvolutionFilter, _gloffset_GetConvolutionFilter) + GL_STUB(glGetConvolutionParameterfv, _gloffset_GetConvolutionParameterfv) + GL_STUB(glGetConvolutionParameteriv, _gloffset_GetConvolutionParameteriv) + GL_STUB(glGetSeparableFilter, _gloffset_GetSeparableFilter) + GL_STUB(glSeparableFilter2D, _gloffset_SeparableFilter2D) + GL_STUB(glGetHistogram, _gloffset_GetHistogram) + GL_STUB(glGetHistogramParameterfv, _gloffset_GetHistogramParameterfv) + GL_STUB(glGetHistogramParameteriv, _gloffset_GetHistogramParameteriv) + GL_STUB(glGetMinmax, _gloffset_GetMinmax) + GL_STUB(glGetMinmaxParameterfv, _gloffset_GetMinmaxParameterfv) + GL_STUB(glGetMinmaxParameteriv, _gloffset_GetMinmaxParameteriv) + GL_STUB(glHistogram, _gloffset_Histogram) + GL_STUB(glMinmax, _gloffset_Minmax) + GL_STUB(glResetHistogram, _gloffset_ResetHistogram) + GL_STUB(glResetMinmax, _gloffset_ResetMinmax) + GL_STUB(glTexImage3D, _gloffset_TexImage3D) + GL_STUB(glTexSubImage3D, _gloffset_TexSubImage3D) + GL_STUB(glCopyTexSubImage3D, _gloffset_CopyTexSubImage3D) + GL_STUB(glActiveTextureARB, _gloffset_ActiveTextureARB) + GL_STUB(glClientActiveTextureARB, _gloffset_ClientActiveTextureARB) + GL_STUB(glMultiTexCoord1dARB, _gloffset_MultiTexCoord1dARB) + GL_STUB(glMultiTexCoord1dvARB, _gloffset_MultiTexCoord1dvARB) + GL_STUB(glMultiTexCoord1fARB, _gloffset_MultiTexCoord1fARB) + GL_STUB(glMultiTexCoord1fvARB, _gloffset_MultiTexCoord1fvARB) + GL_STUB(glMultiTexCoord1iARB, _gloffset_MultiTexCoord1iARB) + GL_STUB(glMultiTexCoord1ivARB, _gloffset_MultiTexCoord1ivARB) + GL_STUB(glMultiTexCoord1sARB, _gloffset_MultiTexCoord1sARB) + GL_STUB(glMultiTexCoord1svARB, _gloffset_MultiTexCoord1svARB) + GL_STUB(glMultiTexCoord2dARB, _gloffset_MultiTexCoord2dARB) + GL_STUB(glMultiTexCoord2dvARB, _gloffset_MultiTexCoord2dvARB) + GL_STUB(glMultiTexCoord2fARB, _gloffset_MultiTexCoord2fARB) + GL_STUB(glMultiTexCoord2fvARB, _gloffset_MultiTexCoord2fvARB) + GL_STUB(glMultiTexCoord2iARB, _gloffset_MultiTexCoord2iARB) + GL_STUB(glMultiTexCoord2ivARB, _gloffset_MultiTexCoord2ivARB) + GL_STUB(glMultiTexCoord2sARB, _gloffset_MultiTexCoord2sARB) + GL_STUB(glMultiTexCoord2svARB, _gloffset_MultiTexCoord2svARB) + GL_STUB(glMultiTexCoord3dARB, _gloffset_MultiTexCoord3dARB) + GL_STUB(glMultiTexCoord3dvARB, _gloffset_MultiTexCoord3dvARB) + GL_STUB(glMultiTexCoord3fARB, _gloffset_MultiTexCoord3fARB) + GL_STUB(glMultiTexCoord3fvARB, _gloffset_MultiTexCoord3fvARB) + GL_STUB(glMultiTexCoord3iARB, _gloffset_MultiTexCoord3iARB) + GL_STUB(glMultiTexCoord3ivARB, _gloffset_MultiTexCoord3ivARB) + GL_STUB(glMultiTexCoord3sARB, _gloffset_MultiTexCoord3sARB) + GL_STUB(glMultiTexCoord3svARB, _gloffset_MultiTexCoord3svARB) + GL_STUB(glMultiTexCoord4dARB, _gloffset_MultiTexCoord4dARB) + GL_STUB(glMultiTexCoord4dvARB, _gloffset_MultiTexCoord4dvARB) + GL_STUB(glMultiTexCoord4fARB, _gloffset_MultiTexCoord4fARB) + GL_STUB(glMultiTexCoord4fvARB, _gloffset_MultiTexCoord4fvARB) + GL_STUB(glMultiTexCoord4iARB, _gloffset_MultiTexCoord4iARB) + GL_STUB(glMultiTexCoord4ivARB, _gloffset_MultiTexCoord4ivARB) + GL_STUB(glMultiTexCoord4sARB, _gloffset_MultiTexCoord4sARB) + GL_STUB(glMultiTexCoord4svARB, _gloffset_MultiTexCoord4svARB) + GL_STUB(glLoadTransposeMatrixfARB, _gloffset_LoadTransposeMatrixfARB) + GL_STUB(glLoadTransposeMatrixdARB, _gloffset_LoadTransposeMatrixdARB) + GL_STUB(glMultTransposeMatrixfARB, _gloffset_MultTransposeMatrixfARB) + GL_STUB(glMultTransposeMatrixdARB, _gloffset_MultTransposeMatrixdARB) + GL_STUB(glSampleCoverageARB, _gloffset_SampleCoverageARB) + GL_STUB(glDrawBuffersARB, _gloffset_DrawBuffersARB) + GL_STUB(glPolygonOffsetEXT, _gloffset_PolygonOffsetEXT) + GL_STUB(glGetTexFilterFuncSGIS, _gloffset_GetTexFilterFuncSGIS) + GL_STUB(glTexFilterFuncSGIS, _gloffset_TexFilterFuncSGIS) + GL_STUB(glGetHistogramEXT, _gloffset_GetHistogramEXT) + GL_STUB(glGetHistogramParameterfvEXT, _gloffset_GetHistogramParameterfvEXT) + GL_STUB(glGetHistogramParameterivEXT, _gloffset_GetHistogramParameterivEXT) + GL_STUB(glGetMinmaxEXT, _gloffset_GetMinmaxEXT) + GL_STUB(glGetMinmaxParameterfvEXT, _gloffset_GetMinmaxParameterfvEXT) + GL_STUB(glGetMinmaxParameterivEXT, _gloffset_GetMinmaxParameterivEXT) + GL_STUB(glGetConvolutionFilterEXT, _gloffset_GetConvolutionFilterEXT) + GL_STUB(glGetConvolutionParameterfvEXT, _gloffset_GetConvolutionParameterfvEXT) + GL_STUB(glGetConvolutionParameterivEXT, _gloffset_GetConvolutionParameterivEXT) + GL_STUB(glGetSeparableFilterEXT, _gloffset_GetSeparableFilterEXT) + GL_STUB(glGetColorTableSGI, _gloffset_GetColorTableSGI) + GL_STUB(glGetColorTableParameterfvSGI, _gloffset_GetColorTableParameterfvSGI) + GL_STUB(glGetColorTableParameterivSGI, _gloffset_GetColorTableParameterivSGI) + GL_STUB(glPixelTexGenSGIX, _gloffset_PixelTexGenSGIX) + GL_STUB(glPixelTexGenParameteriSGIS, _gloffset_PixelTexGenParameteriSGIS) + GL_STUB(glPixelTexGenParameterivSGIS, _gloffset_PixelTexGenParameterivSGIS) + GL_STUB(glPixelTexGenParameterfSGIS, _gloffset_PixelTexGenParameterfSGIS) + GL_STUB(glPixelTexGenParameterfvSGIS, _gloffset_PixelTexGenParameterfvSGIS) + GL_STUB(glGetPixelTexGenParameterivSGIS, _gloffset_GetPixelTexGenParameterivSGIS) + GL_STUB(glGetPixelTexGenParameterfvSGIS, _gloffset_GetPixelTexGenParameterfvSGIS) + GL_STUB(glTexImage4DSGIS, _gloffset_TexImage4DSGIS) + GL_STUB(glTexSubImage4DSGIS, _gloffset_TexSubImage4DSGIS) + GL_STUB(glAreTexturesResidentEXT, _gloffset_AreTexturesResidentEXT) + GL_STUB(glGenTexturesEXT, _gloffset_GenTexturesEXT) + GL_STUB(glIsTextureEXT, _gloffset_IsTextureEXT) + GL_STUB(glDetailTexFuncSGIS, _gloffset_DetailTexFuncSGIS) + GL_STUB(glGetDetailTexFuncSGIS, _gloffset_GetDetailTexFuncSGIS) + GL_STUB(glSharpenTexFuncSGIS, _gloffset_SharpenTexFuncSGIS) + GL_STUB(glGetSharpenTexFuncSGIS, _gloffset_GetSharpenTexFuncSGIS) + GL_STUB(glSampleMaskSGIS, _gloffset_SampleMaskSGIS) + GL_STUB(glSamplePatternSGIS, _gloffset_SamplePatternSGIS) + GL_STUB(glColorPointerEXT, _gloffset_ColorPointerEXT) + GL_STUB(glEdgeFlagPointerEXT, _gloffset_EdgeFlagPointerEXT) + GL_STUB(glIndexPointerEXT, _gloffset_IndexPointerEXT) + GL_STUB(glNormalPointerEXT, _gloffset_NormalPointerEXT) + GL_STUB(glTexCoordPointerEXT, _gloffset_TexCoordPointerEXT) + GL_STUB(glVertexPointerEXT, _gloffset_VertexPointerEXT) + GL_STUB(glSpriteParameterfSGIX, _gloffset_SpriteParameterfSGIX) + GL_STUB(glSpriteParameterfvSGIX, _gloffset_SpriteParameterfvSGIX) + GL_STUB(glSpriteParameteriSGIX, _gloffset_SpriteParameteriSGIX) + GL_STUB(glSpriteParameterivSGIX, _gloffset_SpriteParameterivSGIX) + GL_STUB(glPointParameterfEXT, _gloffset_PointParameterfEXT) + GL_STUB(glPointParameterfvEXT, _gloffset_PointParameterfvEXT) + GL_STUB(glGetInstrumentsSGIX, _gloffset_GetInstrumentsSGIX) + GL_STUB(glInstrumentsBufferSGIX, _gloffset_InstrumentsBufferSGIX) + GL_STUB(glPollInstrumentsSGIX, _gloffset_PollInstrumentsSGIX) + GL_STUB(glReadInstrumentsSGIX, _gloffset_ReadInstrumentsSGIX) + GL_STUB(glStartInstrumentsSGIX, _gloffset_StartInstrumentsSGIX) + GL_STUB(glStopInstrumentsSGIX, _gloffset_StopInstrumentsSGIX) + GL_STUB(glFrameZoomSGIX, _gloffset_FrameZoomSGIX) + GL_STUB(glTagSampleBufferSGIX, _gloffset_TagSampleBufferSGIX) + GL_STUB(glReferencePlaneSGIX, _gloffset_ReferencePlaneSGIX) + GL_STUB(glFlushRasterSGIX, _gloffset_FlushRasterSGIX) + GL_STUB(glGetListParameterfvSGIX, _gloffset_GetListParameterfvSGIX) + GL_STUB(glGetListParameterivSGIX, _gloffset_GetListParameterivSGIX) + GL_STUB(glListParameterfSGIX, _gloffset_ListParameterfSGIX) + GL_STUB(glListParameterfvSGIX, _gloffset_ListParameterfvSGIX) + GL_STUB(glListParameteriSGIX, _gloffset_ListParameteriSGIX) + GL_STUB(glListParameterivSGIX, _gloffset_ListParameterivSGIX) + GL_STUB(glFragmentColorMaterialSGIX, _gloffset_FragmentColorMaterialSGIX) + GL_STUB(glFragmentLightfSGIX, _gloffset_FragmentLightfSGIX) + GL_STUB(glFragmentLightfvSGIX, _gloffset_FragmentLightfvSGIX) + GL_STUB(glFragmentLightiSGIX, _gloffset_FragmentLightiSGIX) + GL_STUB(glFragmentLightivSGIX, _gloffset_FragmentLightivSGIX) + GL_STUB(glFragmentLightModelfSGIX, _gloffset_FragmentLightModelfSGIX) + GL_STUB(glFragmentLightModelfvSGIX, _gloffset_FragmentLightModelfvSGIX) + GL_STUB(glFragmentLightModeliSGIX, _gloffset_FragmentLightModeliSGIX) + GL_STUB(glFragmentLightModelivSGIX, _gloffset_FragmentLightModelivSGIX) + GL_STUB(glFragmentMaterialfSGIX, _gloffset_FragmentMaterialfSGIX) + GL_STUB(glFragmentMaterialfvSGIX, _gloffset_FragmentMaterialfvSGIX) + GL_STUB(glFragmentMaterialiSGIX, _gloffset_FragmentMaterialiSGIX) + GL_STUB(glFragmentMaterialivSGIX, _gloffset_FragmentMaterialivSGIX) + GL_STUB(glGetFragmentLightfvSGIX, _gloffset_GetFragmentLightfvSGIX) + GL_STUB(glGetFragmentLightivSGIX, _gloffset_GetFragmentLightivSGIX) + GL_STUB(glGetFragmentMaterialfvSGIX, _gloffset_GetFragmentMaterialfvSGIX) + GL_STUB(glGetFragmentMaterialivSGIX, _gloffset_GetFragmentMaterialivSGIX) + GL_STUB(glLightEnviSGIX, _gloffset_LightEnviSGIX) + GL_STUB(glVertexWeightfEXT, _gloffset_VertexWeightfEXT) + GL_STUB(glVertexWeightfvEXT, _gloffset_VertexWeightfvEXT) + GL_STUB(glVertexWeightPointerEXT, _gloffset_VertexWeightPointerEXT) + GL_STUB(glFlushVertexArrayRangeNV, _gloffset_FlushVertexArrayRangeNV) + GL_STUB(glVertexArrayRangeNV, _gloffset_VertexArrayRangeNV) + GL_STUB(glCombinerParameterfvNV, _gloffset_CombinerParameterfvNV) + GL_STUB(glCombinerParameterfNV, _gloffset_CombinerParameterfNV) + GL_STUB(glCombinerParameterivNV, _gloffset_CombinerParameterivNV) + GL_STUB(glCombinerParameteriNV, _gloffset_CombinerParameteriNV) + GL_STUB(glCombinerInputNV, _gloffset_CombinerInputNV) + GL_STUB(glCombinerOutputNV, _gloffset_CombinerOutputNV) + GL_STUB(glFinalCombinerInputNV, _gloffset_FinalCombinerInputNV) + GL_STUB(glGetCombinerInputParameterfvNV, _gloffset_GetCombinerInputParameterfvNV) + GL_STUB(glGetCombinerInputParameterivNV, _gloffset_GetCombinerInputParameterivNV) + GL_STUB(glGetCombinerOutputParameterfvNV, _gloffset_GetCombinerOutputParameterfvNV) + GL_STUB(glGetCombinerOutputParameterivNV, _gloffset_GetCombinerOutputParameterivNV) + GL_STUB(glGetFinalCombinerInputParameterfvNV, _gloffset_GetFinalCombinerInputParameterfvNV) + GL_STUB(glGetFinalCombinerInputParameterivNV, _gloffset_GetFinalCombinerInputParameterivNV) + GL_STUB(glResizeBuffersMESA, _gloffset_ResizeBuffersMESA) + GL_STUB(glWindowPos2dMESA, _gloffset_WindowPos2dMESA) + GL_STUB(glWindowPos2dvMESA, _gloffset_WindowPos2dvMESA) + GL_STUB(glWindowPos2fMESA, _gloffset_WindowPos2fMESA) + GL_STUB(glWindowPos2fvMESA, _gloffset_WindowPos2fvMESA) + GL_STUB(glWindowPos2iMESA, _gloffset_WindowPos2iMESA) + GL_STUB(glWindowPos2ivMESA, _gloffset_WindowPos2ivMESA) + GL_STUB(glWindowPos2sMESA, _gloffset_WindowPos2sMESA) + GL_STUB(glWindowPos2svMESA, _gloffset_WindowPos2svMESA) + GL_STUB(glWindowPos3dMESA, _gloffset_WindowPos3dMESA) + GL_STUB(glWindowPos3dvMESA, _gloffset_WindowPos3dvMESA) + GL_STUB(glWindowPos3fMESA, _gloffset_WindowPos3fMESA) + GL_STUB(glWindowPos3fvMESA, _gloffset_WindowPos3fvMESA) + GL_STUB(glWindowPos3iMESA, _gloffset_WindowPos3iMESA) + GL_STUB(glWindowPos3ivMESA, _gloffset_WindowPos3ivMESA) + GL_STUB(glWindowPos3sMESA, _gloffset_WindowPos3sMESA) + GL_STUB(glWindowPos3svMESA, _gloffset_WindowPos3svMESA) + GL_STUB(glWindowPos4dMESA, _gloffset_WindowPos4dMESA) + GL_STUB(glWindowPos4dvMESA, _gloffset_WindowPos4dvMESA) + GL_STUB(glWindowPos4fMESA, _gloffset_WindowPos4fMESA) + GL_STUB(glWindowPos4fvMESA, _gloffset_WindowPos4fvMESA) + GL_STUB(glWindowPos4iMESA, _gloffset_WindowPos4iMESA) + GL_STUB(glWindowPos4ivMESA, _gloffset_WindowPos4ivMESA) + GL_STUB(glWindowPos4sMESA, _gloffset_WindowPos4sMESA) + GL_STUB(glWindowPos4svMESA, _gloffset_WindowPos4svMESA) + GL_STUB(glBlendFuncSeparateEXT, _gloffset_BlendFuncSeparateEXT) + GL_STUB(glIndexMaterialEXT, _gloffset_IndexMaterialEXT) + GL_STUB(glIndexFuncEXT, _gloffset_IndexFuncEXT) + GL_STUB(glLockArraysEXT, _gloffset_LockArraysEXT) + GL_STUB(glUnlockArraysEXT, _gloffset_UnlockArraysEXT) + GL_STUB(glCullParameterdvEXT, _gloffset_CullParameterdvEXT) + GL_STUB(glCullParameterfvEXT, _gloffset_CullParameterfvEXT) + GL_STUB(glHintPGI, _gloffset_HintPGI) + GL_STUB(glFogCoordfEXT, _gloffset_FogCoordfEXT) + GL_STUB(glFogCoordfvEXT, _gloffset_FogCoordfvEXT) + GL_STUB(glFogCoorddEXT, _gloffset_FogCoorddEXT) + GL_STUB(glFogCoorddvEXT, _gloffset_FogCoorddvEXT) + GL_STUB(glFogCoordPointerEXT, _gloffset_FogCoordPointerEXT) + GL_STUB(glGetColorTableEXT, _gloffset_GetColorTableEXT) + GL_STUB(glGetColorTableParameterivEXT, _gloffset_GetColorTableParameterivEXT) + GL_STUB(glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfvEXT) + GL_STUB(glTbufferMask3DFX, _gloffset_TbufferMask3DFX) + GL_STUB(glCompressedTexImage3DARB, _gloffset_CompressedTexImage3DARB) + GL_STUB(glCompressedTexImage2DARB, _gloffset_CompressedTexImage2DARB) + GL_STUB(glCompressedTexImage1DARB, _gloffset_CompressedTexImage1DARB) + GL_STUB(glCompressedTexSubImage3DARB, _gloffset_CompressedTexSubImage3DARB) + GL_STUB(glCompressedTexSubImage2DARB, _gloffset_CompressedTexSubImage2DARB) + GL_STUB(glCompressedTexSubImage1DARB, _gloffset_CompressedTexSubImage1DARB) + GL_STUB(glGetCompressedTexImageARB, _gloffset_GetCompressedTexImageARB) + GL_STUB(glSecondaryColor3bEXT, _gloffset_SecondaryColor3bEXT) + GL_STUB(glSecondaryColor3bvEXT, _gloffset_SecondaryColor3bvEXT) + GL_STUB(glSecondaryColor3dEXT, _gloffset_SecondaryColor3dEXT) + GL_STUB(glSecondaryColor3dvEXT, _gloffset_SecondaryColor3dvEXT) + GL_STUB(glSecondaryColor3fEXT, _gloffset_SecondaryColor3fEXT) + GL_STUB(glSecondaryColor3fvEXT, _gloffset_SecondaryColor3fvEXT) + GL_STUB(glSecondaryColor3iEXT, _gloffset_SecondaryColor3iEXT) + GL_STUB(glSecondaryColor3ivEXT, _gloffset_SecondaryColor3ivEXT) + GL_STUB(glSecondaryColor3sEXT, _gloffset_SecondaryColor3sEXT) + GL_STUB(glSecondaryColor3svEXT, _gloffset_SecondaryColor3svEXT) + GL_STUB(glSecondaryColor3ubEXT, _gloffset_SecondaryColor3ubEXT) + GL_STUB(glSecondaryColor3ubvEXT, _gloffset_SecondaryColor3ubvEXT) + GL_STUB(glSecondaryColor3uiEXT, _gloffset_SecondaryColor3uiEXT) + GL_STUB(glSecondaryColor3uivEXT, _gloffset_SecondaryColor3uivEXT) + GL_STUB(glSecondaryColor3usEXT, _gloffset_SecondaryColor3usEXT) + GL_STUB(glSecondaryColor3usvEXT, _gloffset_SecondaryColor3usvEXT) + GL_STUB(glSecondaryColorPointerEXT, _gloffset_SecondaryColorPointerEXT) + GL_STUB(glAreProgramsResidentNV, _gloffset_AreProgramsResidentNV) + GL_STUB(glBindProgramNV, _gloffset_BindProgramNV) + GL_STUB(glDeleteProgramsNV, _gloffset_DeleteProgramsNV) + GL_STUB(glExecuteProgramNV, _gloffset_ExecuteProgramNV) + GL_STUB(glGenProgramsNV, _gloffset_GenProgramsNV) + GL_STUB(glGetProgramParameterdvNV, _gloffset_GetProgramParameterdvNV) + GL_STUB(glGetProgramParameterfvNV, _gloffset_GetProgramParameterfvNV) + GL_STUB(glGetProgramivNV, _gloffset_GetProgramivNV) + GL_STUB(glGetProgramStringNV, _gloffset_GetProgramStringNV) + GL_STUB(glGetTrackMatrixivNV, _gloffset_GetTrackMatrixivNV) + GL_STUB(glGetVertexAttribdvARB, _gloffset_GetVertexAttribdvARB) + GL_STUB(glGetVertexAttribfvARB, _gloffset_GetVertexAttribfvARB) + GL_STUB(glGetVertexAttribivARB, _gloffset_GetVertexAttribivARB) + GL_STUB(glGetVertexAttribPointervNV, _gloffset_GetVertexAttribPointervNV) + GL_STUB(glIsProgramNV, _gloffset_IsProgramNV) + GL_STUB(glLoadProgramNV, _gloffset_LoadProgramNV) + GL_STUB(glProgramParameter4dNV, _gloffset_ProgramParameter4dNV) + GL_STUB(glProgramParameter4dvNV, _gloffset_ProgramParameter4dvNV) + GL_STUB(glProgramParameter4fNV, _gloffset_ProgramParameter4fNV) + GL_STUB(glProgramParameter4fvNV, _gloffset_ProgramParameter4fvNV) + GL_STUB(glProgramParameters4dvNV, _gloffset_ProgramParameters4dvNV) + GL_STUB(glProgramParameters4fvNV, _gloffset_ProgramParameters4fvNV) + GL_STUB(glRequestResidentProgramsNV, _gloffset_RequestResidentProgramsNV) + GL_STUB(glTrackMatrixNV, _gloffset_TrackMatrixNV) + GL_STUB(glVertexAttribPointerNV, _gloffset_VertexAttribPointerNV) + GL_STUB(glVertexAttrib1dARB, _gloffset_VertexAttrib1dARB) + GL_STUB(glVertexAttrib1dvARB, _gloffset_VertexAttrib1dvARB) + GL_STUB(glVertexAttrib1fARB, _gloffset_VertexAttrib1fARB) + GL_STUB(glVertexAttrib1fvARB, _gloffset_VertexAttrib1fvARB) + GL_STUB(glVertexAttrib1sARB, _gloffset_VertexAttrib1sARB) + GL_STUB(glVertexAttrib1svARB, _gloffset_VertexAttrib1svARB) + GL_STUB(glVertexAttrib2dARB, _gloffset_VertexAttrib2dARB) + GL_STUB(glVertexAttrib2dvARB, _gloffset_VertexAttrib2dvARB) + GL_STUB(glVertexAttrib2fARB, _gloffset_VertexAttrib2fARB) + GL_STUB(glVertexAttrib2fvARB, _gloffset_VertexAttrib2fvARB) + GL_STUB(glVertexAttrib2sARB, _gloffset_VertexAttrib2sARB) + GL_STUB(glVertexAttrib2svARB, _gloffset_VertexAttrib2svARB) + GL_STUB(glVertexAttrib3dARB, _gloffset_VertexAttrib3dARB) + GL_STUB(glVertexAttrib3dvARB, _gloffset_VertexAttrib3dvARB) + GL_STUB(glVertexAttrib3fARB, _gloffset_VertexAttrib3fARB) + GL_STUB(glVertexAttrib3fvARB, _gloffset_VertexAttrib3fvARB) + GL_STUB(glVertexAttrib3sARB, _gloffset_VertexAttrib3sARB) + GL_STUB(glVertexAttrib3svARB, _gloffset_VertexAttrib3svARB) + GL_STUB(glVertexAttrib4dARB, _gloffset_VertexAttrib4dARB) + GL_STUB(glVertexAttrib4dvARB, _gloffset_VertexAttrib4dvARB) + GL_STUB(glVertexAttrib4fARB, _gloffset_VertexAttrib4fARB) + GL_STUB(glVertexAttrib4fvARB, _gloffset_VertexAttrib4fvARB) + GL_STUB(glVertexAttrib4sARB, _gloffset_VertexAttrib4sARB) + GL_STUB(glVertexAttrib4svARB, _gloffset_VertexAttrib4svARB) + GL_STUB(glVertexAttrib4NubARB, _gloffset_VertexAttrib4NubARB) + GL_STUB(glVertexAttrib4NubvARB, _gloffset_VertexAttrib4NubvARB) + GL_STUB(glVertexAttribs1dvNV, _gloffset_VertexAttribs1dvNV) + GL_STUB(glVertexAttribs1fvNV, _gloffset_VertexAttribs1fvNV) + GL_STUB(glVertexAttribs1svNV, _gloffset_VertexAttribs1svNV) + GL_STUB(glVertexAttribs2dvNV, _gloffset_VertexAttribs2dvNV) + GL_STUB(glVertexAttribs2fvNV, _gloffset_VertexAttribs2fvNV) + GL_STUB(glVertexAttribs2svNV, _gloffset_VertexAttribs2svNV) + GL_STUB(glVertexAttribs3dvNV, _gloffset_VertexAttribs3dvNV) + GL_STUB(glVertexAttribs3fvNV, _gloffset_VertexAttribs3fvNV) + GL_STUB(glVertexAttribs3svNV, _gloffset_VertexAttribs3svNV) + GL_STUB(glVertexAttribs4dvNV, _gloffset_VertexAttribs4dvNV) + GL_STUB(glVertexAttribs4fvNV, _gloffset_VertexAttribs4fvNV) + GL_STUB(glVertexAttribs4svNV, _gloffset_VertexAttribs4svNV) + GL_STUB(glVertexAttribs4ubvNV, _gloffset_VertexAttribs4ubvNV) + GL_STUB(glPointParameteriNV, _gloffset_PointParameteriNV) + GL_STUB(glPointParameterivNV, _gloffset_PointParameterivNV) + GL_STUB(glMultiDrawArraysEXT, _gloffset_MultiDrawArraysEXT) + GL_STUB(glMultiDrawElementsEXT, _gloffset_MultiDrawElementsEXT) + GL_STUB(glActiveStencilFaceEXT, _gloffset_ActiveStencilFaceEXT) + GL_STUB(glDeleteFencesNV, _gloffset_DeleteFencesNV) + GL_STUB(glGenFencesNV, _gloffset_GenFencesNV) + GL_STUB(glIsFenceNV, _gloffset_IsFenceNV) + GL_STUB(glTestFenceNV, _gloffset_TestFenceNV) + GL_STUB(glGetFenceivNV, _gloffset_GetFenceivNV) + GL_STUB(glFinishFenceNV, _gloffset_FinishFenceNV) + GL_STUB(glSetFenceNV, _gloffset_SetFenceNV) + GL_STUB(glVertexAttrib4bvARB, _gloffset_VertexAttrib4bvARB) + GL_STUB(glVertexAttrib4ivARB, _gloffset_VertexAttrib4ivARB) + GL_STUB(glVertexAttrib4ubvARB, _gloffset_VertexAttrib4ubvARB) + GL_STUB(glVertexAttrib4usvARB, _gloffset_VertexAttrib4usvARB) + GL_STUB(glVertexAttrib4uivARB, _gloffset_VertexAttrib4uivARB) + GL_STUB(glVertexAttrib4NbvARB, _gloffset_VertexAttrib4NbvARB) + GL_STUB(glVertexAttrib4NsvARB, _gloffset_VertexAttrib4NsvARB) + GL_STUB(glVertexAttrib4NivARB, _gloffset_VertexAttrib4NivARB) + GL_STUB(glVertexAttrib4NusvARB, _gloffset_VertexAttrib4NusvARB) + GL_STUB(glVertexAttrib4NuivARB, _gloffset_VertexAttrib4NuivARB) + GL_STUB(glVertexAttribPointerARB, _gloffset_VertexAttribPointerARB) + GL_STUB(glEnableVertexAttribArrayARB, _gloffset_EnableVertexAttribArrayARB) + GL_STUB(glDisableVertexAttribArrayARB, _gloffset_DisableVertexAttribArrayARB) + GL_STUB(glProgramStringARB, _gloffset_ProgramStringARB) + GL_STUB(glProgramEnvParameter4dARB, _gloffset_ProgramEnvParameter4dARB) + GL_STUB(glProgramEnvParameter4dvARB, _gloffset_ProgramEnvParameter4dvARB) + GL_STUB(glProgramEnvParameter4fARB, _gloffset_ProgramEnvParameter4fARB) + GL_STUB(glProgramEnvParameter4fvARB, _gloffset_ProgramEnvParameter4fvARB) + GL_STUB(glProgramLocalParameter4dARB, _gloffset_ProgramLocalParameter4dARB) + GL_STUB(glProgramLocalParameter4dvARB, _gloffset_ProgramLocalParameter4dvARB) + GL_STUB(glProgramLocalParameter4fARB, _gloffset_ProgramLocalParameter4fARB) + GL_STUB(glProgramLocalParameter4fvARB, _gloffset_ProgramLocalParameter4fvARB) + GL_STUB(glGetProgramEnvParameterdvARB, _gloffset_GetProgramEnvParameterdvARB) + GL_STUB(glGetProgramEnvParameterfvARB, _gloffset_GetProgramEnvParameterfvARB) + GL_STUB(glGetProgramLocalParameterdvARB, _gloffset_GetProgramLocalParameterdvARB) + GL_STUB(glGetProgramLocalParameterfvARB, _gloffset_GetProgramLocalParameterfvARB) + GL_STUB(glGetProgramivARB, _gloffset_GetProgramivARB) + GL_STUB(glGetProgramStringARB, _gloffset_GetProgramStringARB) + GL_STUB(glProgramNamedParameter4fNV, _gloffset_ProgramNamedParameter4fNV) + GL_STUB(glProgramNamedParameter4dNV, _gloffset_ProgramNamedParameter4dNV) + GL_STUB(glProgramNamedParameter4fvNV, _gloffset_ProgramNamedParameter4fvNV) + GL_STUB(glProgramNamedParameter4dvNV, _gloffset_ProgramNamedParameter4dvNV) + GL_STUB(glGetProgramNamedParameterfvNV, _gloffset_GetProgramNamedParameterfvNV) + GL_STUB(glGetProgramNamedParameterdvNV, _gloffset_GetProgramNamedParameterdvNV) + GL_STUB(glBindBufferARB, _gloffset_BindBufferARB) + GL_STUB(glBufferDataARB, _gloffset_BufferDataARB) + GL_STUB(glBufferSubDataARB, _gloffset_BufferSubDataARB) + GL_STUB(glDeleteBuffersARB, _gloffset_DeleteBuffersARB) + GL_STUB(glGenBuffersARB, _gloffset_GenBuffersARB) + GL_STUB(glGetBufferParameterivARB, _gloffset_GetBufferParameterivARB) + GL_STUB(glGetBufferPointervARB, _gloffset_GetBufferPointervARB) + GL_STUB(glGetBufferSubDataARB, _gloffset_GetBufferSubDataARB) + GL_STUB(glIsBufferARB, _gloffset_IsBufferARB) + GL_STUB(glMapBufferARB, _gloffset_MapBufferARB) + GL_STUB(glUnmapBufferARB, _gloffset_UnmapBufferARB) + GL_STUB(glDepthBoundsEXT, _gloffset_DepthBoundsEXT) + GL_STUB(glGenQueriesARB, _gloffset_GenQueriesARB) + GL_STUB(glDeleteQueriesARB, _gloffset_DeleteQueriesARB) + GL_STUB(glIsQueryARB, _gloffset_IsQueryARB) + GL_STUB(glBeginQueryARB, _gloffset_BeginQueryARB) + GL_STUB(glEndQueryARB, _gloffset_EndQueryARB) + GL_STUB(glGetQueryivARB, _gloffset_GetQueryivARB) + GL_STUB(glGetQueryObjectivARB, _gloffset_GetQueryObjectivARB) + GL_STUB(glGetQueryObjectuivARB, _gloffset_GetQueryObjectuivARB) + GL_STUB(glMultiModeDrawArraysIBM, _gloffset_MultiModeDrawArraysIBM) + GL_STUB(glMultiModeDrawElementsIBM, _gloffset_MultiModeDrawElementsIBM) + GL_STUB(glBlendEquationSeparateEXT, _gloffset_BlendEquationSeparateEXT) + GL_STUB(glDeleteObjectARB, _gloffset_DeleteObjectARB) + GL_STUB(glGetHandleARB, _gloffset_GetHandleARB) + GL_STUB(glDetachObjectARB, _gloffset_DetachObjectARB) + GL_STUB(glCreateShaderObjectARB, _gloffset_CreateShaderObjectARB) + GL_STUB(glShaderSourceARB, _gloffset_ShaderSourceARB) + GL_STUB(glCompileShaderARB, _gloffset_CompileShaderARB) + GL_STUB(glCreateProgramObjectARB, _gloffset_CreateProgramObjectARB) + GL_STUB(glAttachObjectARB, _gloffset_AttachObjectARB) + GL_STUB(glLinkProgramARB, _gloffset_LinkProgramARB) + GL_STUB(glUseProgramObjectARB, _gloffset_UseProgramObjectARB) + GL_STUB(glValidateProgramARB, _gloffset_ValidateProgramARB) + GL_STUB(glUniform1fARB, _gloffset_Uniform1fARB) + GL_STUB(glUniform2fARB, _gloffset_Uniform2fARB) + GL_STUB(glUniform3fARB, _gloffset_Uniform3fARB) + GL_STUB(glUniform4fARB, _gloffset_Uniform4fARB) + GL_STUB(glUniform1iARB, _gloffset_Uniform1iARB) + GL_STUB(glUniform2iARB, _gloffset_Uniform2iARB) + GL_STUB(glUniform3iARB, _gloffset_Uniform3iARB) + GL_STUB(glUniform4iARB, _gloffset_Uniform4iARB) + GL_STUB(glUniform1fvARB, _gloffset_Uniform1fvARB) + GL_STUB(glUniform2fvARB, _gloffset_Uniform2fvARB) + GL_STUB(glUniform3fvARB, _gloffset_Uniform3fvARB) + GL_STUB(glUniform4fvARB, _gloffset_Uniform4fvARB) + GL_STUB(glUniform1ivARB, _gloffset_Uniform1ivARB) + GL_STUB(glUniform2ivARB, _gloffset_Uniform2ivARB) + GL_STUB(glUniform3ivARB, _gloffset_Uniform3ivARB) + GL_STUB(glUniform4ivARB, _gloffset_Uniform4ivARB) + GL_STUB(glUniformMatrix2fvARB, _gloffset_UniformMatrix2fvARB) + GL_STUB(glUniformMatrix3fvARB, _gloffset_UniformMatrix3fvARB) + GL_STUB(glUniformMatrix4fvARB, _gloffset_UniformMatrix4fvARB) + GL_STUB(glGetObjectParameterfvARB, _gloffset_GetObjectParameterfvARB) + GL_STUB(glGetObjectParameterivARB, _gloffset_GetObjectParameterivARB) + GL_STUB(glGetInfoLogARB, _gloffset_GetInfoLogARB) + GL_STUB(glGetAttachedObjectsARB, _gloffset_GetAttachedObjectsARB) + GL_STUB(glGetUniformLocationARB, _gloffset_GetUniformLocationARB) + GL_STUB(glGetActiveUniformARB, _gloffset_GetActiveUniformARB) + GL_STUB(glGetUniformfvARB, _gloffset_GetUniformfvARB) + GL_STUB(glGetUniformivARB, _gloffset_GetUniformivARB) + GL_STUB(glGetShaderSourceARB, _gloffset_GetShaderSourceARB) + GL_STUB(glBindAttribLocationARB, _gloffset_BindAttribLocationARB) + GL_STUB(glGetActiveAttribARB, _gloffset_GetActiveAttribARB) + GL_STUB(glGetAttribLocationARB, _gloffset_GetAttribLocationARB) + GL_STUB(glGetVertexAttribdvNV, _gloffset_GetVertexAttribdvNV) + GL_STUB(glGetVertexAttribfvNV, _gloffset_GetVertexAttribfvNV) + GL_STUB(glGetVertexAttribivNV, _gloffset_GetVertexAttribivNV) + GL_STUB(glVertexAttrib1dNV, _gloffset_VertexAttrib1dNV) + GL_STUB(glVertexAttrib1dvNV, _gloffset_VertexAttrib1dvNV) + GL_STUB(glVertexAttrib1fNV, _gloffset_VertexAttrib1fNV) + GL_STUB(glVertexAttrib1fvNV, _gloffset_VertexAttrib1fvNV) + GL_STUB(glVertexAttrib1sNV, _gloffset_VertexAttrib1sNV) + GL_STUB(glVertexAttrib1svNV, _gloffset_VertexAttrib1svNV) + GL_STUB(glVertexAttrib2dNV, _gloffset_VertexAttrib2dNV) + GL_STUB(glVertexAttrib2dvNV, _gloffset_VertexAttrib2dvNV) + GL_STUB(glVertexAttrib2fNV, _gloffset_VertexAttrib2fNV) + GL_STUB(glVertexAttrib2fvNV, _gloffset_VertexAttrib2fvNV) + GL_STUB(glVertexAttrib2sNV, _gloffset_VertexAttrib2sNV) + GL_STUB(glVertexAttrib2svNV, _gloffset_VertexAttrib2svNV) + GL_STUB(glVertexAttrib3dNV, _gloffset_VertexAttrib3dNV) + GL_STUB(glVertexAttrib3dvNV, _gloffset_VertexAttrib3dvNV) + GL_STUB(glVertexAttrib3fNV, _gloffset_VertexAttrib3fNV) + GL_STUB(glVertexAttrib3fvNV, _gloffset_VertexAttrib3fvNV) + GL_STUB(glVertexAttrib3sNV, _gloffset_VertexAttrib3sNV) + GL_STUB(glVertexAttrib3svNV, _gloffset_VertexAttrib3svNV) + GL_STUB(glVertexAttrib4dNV, _gloffset_VertexAttrib4dNV) + GL_STUB(glVertexAttrib4dvNV, _gloffset_VertexAttrib4dvNV) + GL_STUB(glVertexAttrib4fNV, _gloffset_VertexAttrib4fNV) + GL_STUB(glVertexAttrib4fvNV, _gloffset_VertexAttrib4fvNV) + GL_STUB(glVertexAttrib4sNV, _gloffset_VertexAttrib4sNV) + GL_STUB(glVertexAttrib4svNV, _gloffset_VertexAttrib4svNV) + GL_STUB(glVertexAttrib4ubNV, _gloffset_VertexAttrib4ubNV) + GL_STUB(glVertexAttrib4ubvNV, _gloffset_VertexAttrib4ubvNV) + GL_STUB(glGenFragmentShadersATI, _gloffset_GenFragmentShadersATI) + GL_STUB(glBindFragmentShaderATI, _gloffset_BindFragmentShaderATI) + GL_STUB(glDeleteFragmentShaderATI, _gloffset_DeleteFragmentShaderATI) + GL_STUB(glBeginFragmentShaderATI, _gloffset_BeginFragmentShaderATI) + GL_STUB(glEndFragmentShaderATI, _gloffset_EndFragmentShaderATI) + GL_STUB(glPassTexCoordATI, _gloffset_PassTexCoordATI) + GL_STUB(glSampleMapATI, _gloffset_SampleMapATI) + GL_STUB(glColorFragmentOp1ATI, _gloffset_ColorFragmentOp1ATI) + GL_STUB(glColorFragmentOp2ATI, _gloffset_ColorFragmentOp2ATI) + GL_STUB(glColorFragmentOp3ATI, _gloffset_ColorFragmentOp3ATI) + GL_STUB(glAlphaFragmentOp1ATI, _gloffset_AlphaFragmentOp1ATI) + GL_STUB(glAlphaFragmentOp2ATI, _gloffset_AlphaFragmentOp2ATI) + GL_STUB(glAlphaFragmentOp3ATI, _gloffset_AlphaFragmentOp3ATI) + GL_STUB(glSetFragmentShaderConstantATI, _gloffset_SetFragmentShaderConstantATI) + GL_STUB(glIsRenderbufferEXT, _gloffset_IsRenderbufferEXT) + GL_STUB(glBindRenderbufferEXT, _gloffset_BindRenderbufferEXT) + GL_STUB(glDeleteRenderbuffersEXT, _gloffset_DeleteRenderbuffersEXT) + GL_STUB(glGenRenderbuffersEXT, _gloffset_GenRenderbuffersEXT) + GL_STUB(glRenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT) + GL_STUB(glGetRenderbufferParameterivEXT, _gloffset_GetRenderbufferParameterivEXT) + GL_STUB(glIsFramebufferEXT, _gloffset_IsFramebufferEXT) + GL_STUB(glBindFramebufferEXT, _gloffset_BindFramebufferEXT) + GL_STUB(glDeleteFramebuffersEXT, _gloffset_DeleteFramebuffersEXT) + GL_STUB(glGenFramebuffersEXT, _gloffset_GenFramebuffersEXT) + GL_STUB(glCheckFramebufferStatusEXT, _gloffset_CheckFramebufferStatusEXT) + GL_STUB(glFramebufferTexture1DEXT, _gloffset_FramebufferTexture1DEXT) + GL_STUB(glFramebufferTexture2DEXT, _gloffset_FramebufferTexture2DEXT) + GL_STUB(glFramebufferTexture3DEXT, _gloffset_FramebufferTexture3DEXT) + GL_STUB(glFramebufferRenderbufferEXT, _gloffset_FramebufferRenderbufferEXT) + GL_STUB(glGetFramebufferAttachmentParameterivEXT, _gloffset_GetFramebufferAttachmentParameterivEXT) + GL_STUB(glGenerateMipmapEXT, _gloffset_GenerateMipmapEXT) + GL_STUB(glStencilFuncSeparate, _gloffset_StencilFuncSeparate) + GL_STUB(glStencilOpSeparate, _gloffset_StencilOpSeparate) + GL_STUB(glStencilMaskSeparate, _gloffset_StencilMaskSeparate) + + .globl _mesa_sparc_glapi_end ; .type _mesa_sparc_glapi_end,#function _mesa_sparc_glapi_end: + .globl glArrayElementEXT ; .type glArrayElementEXT,#function ; glArrayElementEXT = glArrayElement + .globl glBindTextureEXT ; .type glBindTextureEXT,#function ; glBindTextureEXT = glBindTexture + .globl glDrawArraysEXT ; .type glDrawArraysEXT,#function ; glDrawArraysEXT = glDrawArrays + .globl glCopyTexImage1DEXT ; .type glCopyTexImage1DEXT,#function ; glCopyTexImage1DEXT = glCopyTexImage1D + .globl glCopyTexImage2DEXT ; .type glCopyTexImage2DEXT,#function ; glCopyTexImage2DEXT = glCopyTexImage2D + .globl glCopyTexSubImage1DEXT ; .type glCopyTexSubImage1DEXT,#function ; glCopyTexSubImage1DEXT = glCopyTexSubImage1D + .globl glCopyTexSubImage2DEXT ; .type glCopyTexSubImage2DEXT,#function ; glCopyTexSubImage2DEXT = glCopyTexSubImage2D + .globl glDeleteTexturesEXT ; .type glDeleteTexturesEXT,#function ; glDeleteTexturesEXT = glDeleteTextures + .globl glGetPointervEXT ; .type glGetPointervEXT,#function ; glGetPointervEXT = glGetPointerv + .globl glPrioritizeTexturesEXT ; .type glPrioritizeTexturesEXT,#function ; glPrioritizeTexturesEXT = glPrioritizeTextures + .globl glTexSubImage1DEXT ; .type glTexSubImage1DEXT,#function ; glTexSubImage1DEXT = glTexSubImage1D + .globl glTexSubImage2DEXT ; .type glTexSubImage2DEXT,#function ; glTexSubImage2DEXT = glTexSubImage2D + .globl glBlendColorEXT ; .type glBlendColorEXT,#function ; glBlendColorEXT = glBlendColor + .globl glBlendEquationEXT ; .type glBlendEquationEXT,#function ; glBlendEquationEXT = glBlendEquation + .globl glDrawRangeElementsEXT ; .type glDrawRangeElementsEXT,#function ; glDrawRangeElementsEXT = glDrawRangeElements + .globl glColorTableSGI ; .type glColorTableSGI,#function ; glColorTableSGI = glColorTable + .globl glColorTableEXT ; .type glColorTableEXT,#function ; glColorTableEXT = glColorTable + .globl glColorTableParameterfvSGI ; .type glColorTableParameterfvSGI,#function ; glColorTableParameterfvSGI = glColorTableParameterfv + .globl glColorTableParameterivSGI ; .type glColorTableParameterivSGI,#function ; glColorTableParameterivSGI = glColorTableParameteriv + .globl glCopyColorTableSGI ; .type glCopyColorTableSGI,#function ; glCopyColorTableSGI = glCopyColorTable + .globl glColorSubTableEXT ; .type glColorSubTableEXT,#function ; glColorSubTableEXT = glColorSubTable + .globl glCopyColorSubTableEXT ; .type glCopyColorSubTableEXT,#function ; glCopyColorSubTableEXT = glCopyColorSubTable + .globl glConvolutionFilter1DEXT ; .type glConvolutionFilter1DEXT,#function ; glConvolutionFilter1DEXT = glConvolutionFilter1D + .globl glConvolutionFilter2DEXT ; .type glConvolutionFilter2DEXT,#function ; glConvolutionFilter2DEXT = glConvolutionFilter2D + .globl glConvolutionParameterfEXT ; .type glConvolutionParameterfEXT,#function ; glConvolutionParameterfEXT = glConvolutionParameterf + .globl glConvolutionParameterfvEXT ; .type glConvolutionParameterfvEXT,#function ; glConvolutionParameterfvEXT = glConvolutionParameterfv + .globl glConvolutionParameteriEXT ; .type glConvolutionParameteriEXT,#function ; glConvolutionParameteriEXT = glConvolutionParameteri + .globl glConvolutionParameterivEXT ; .type glConvolutionParameterivEXT,#function ; glConvolutionParameterivEXT = glConvolutionParameteriv + .globl glCopyConvolutionFilter1DEXT ; .type glCopyConvolutionFilter1DEXT,#function ; glCopyConvolutionFilter1DEXT = glCopyConvolutionFilter1D + .globl glCopyConvolutionFilter2DEXT ; .type glCopyConvolutionFilter2DEXT,#function ; glCopyConvolutionFilter2DEXT = glCopyConvolutionFilter2D + .globl glSeparableFilter2DEXT ; .type glSeparableFilter2DEXT,#function ; glSeparableFilter2DEXT = glSeparableFilter2D + .globl glHistogramEXT ; .type glHistogramEXT,#function ; glHistogramEXT = glHistogram + .globl glMinmaxEXT ; .type glMinmaxEXT,#function ; glMinmaxEXT = glMinmax + .globl glResetHistogramEXT ; .type glResetHistogramEXT,#function ; glResetHistogramEXT = glResetHistogram + .globl glResetMinmaxEXT ; .type glResetMinmaxEXT,#function ; glResetMinmaxEXT = glResetMinmax + .globl glTexImage3DEXT ; .type glTexImage3DEXT,#function ; glTexImage3DEXT = glTexImage3D + .globl glTexSubImage3DEXT ; .type glTexSubImage3DEXT,#function ; glTexSubImage3DEXT = glTexSubImage3D + .globl glCopyTexSubImage3DEXT ; .type glCopyTexSubImage3DEXT,#function ; glCopyTexSubImage3DEXT = glCopyTexSubImage3D + .globl glActiveTexture ; .type glActiveTexture,#function ; glActiveTexture = glActiveTextureARB + .globl glClientActiveTexture ; .type glClientActiveTexture,#function ; glClientActiveTexture = glClientActiveTextureARB + .globl glMultiTexCoord1d ; .type glMultiTexCoord1d,#function ; glMultiTexCoord1d = glMultiTexCoord1dARB + .globl glMultiTexCoord1dv ; .type glMultiTexCoord1dv,#function ; glMultiTexCoord1dv = glMultiTexCoord1dvARB + .globl glMultiTexCoord1f ; .type glMultiTexCoord1f,#function ; glMultiTexCoord1f = glMultiTexCoord1fARB + .globl glMultiTexCoord1fv ; .type glMultiTexCoord1fv,#function ; glMultiTexCoord1fv = glMultiTexCoord1fvARB + .globl glMultiTexCoord1i ; .type glMultiTexCoord1i,#function ; glMultiTexCoord1i = glMultiTexCoord1iARB + .globl glMultiTexCoord1iv ; .type glMultiTexCoord1iv,#function ; glMultiTexCoord1iv = glMultiTexCoord1ivARB + .globl glMultiTexCoord1s ; .type glMultiTexCoord1s,#function ; glMultiTexCoord1s = glMultiTexCoord1sARB + .globl glMultiTexCoord1sv ; .type glMultiTexCoord1sv,#function ; glMultiTexCoord1sv = glMultiTexCoord1svARB + .globl glMultiTexCoord2d ; .type glMultiTexCoord2d,#function ; glMultiTexCoord2d = glMultiTexCoord2dARB + .globl glMultiTexCoord2dv ; .type glMultiTexCoord2dv,#function ; glMultiTexCoord2dv = glMultiTexCoord2dvARB + .globl glMultiTexCoord2f ; .type glMultiTexCoord2f,#function ; glMultiTexCoord2f = glMultiTexCoord2fARB + .globl glMultiTexCoord2fv ; .type glMultiTexCoord2fv,#function ; glMultiTexCoord2fv = glMultiTexCoord2fvARB + .globl glMultiTexCoord2i ; .type glMultiTexCoord2i,#function ; glMultiTexCoord2i = glMultiTexCoord2iARB + .globl glMultiTexCoord2iv ; .type glMultiTexCoord2iv,#function ; glMultiTexCoord2iv = glMultiTexCoord2ivARB + .globl glMultiTexCoord2s ; .type glMultiTexCoord2s,#function ; glMultiTexCoord2s = glMultiTexCoord2sARB + .globl glMultiTexCoord2sv ; .type glMultiTexCoord2sv,#function ; glMultiTexCoord2sv = glMultiTexCoord2svARB + .globl glMultiTexCoord3d ; .type glMultiTexCoord3d,#function ; glMultiTexCoord3d = glMultiTexCoord3dARB + .globl glMultiTexCoord3dv ; .type glMultiTexCoord3dv,#function ; glMultiTexCoord3dv = glMultiTexCoord3dvARB + .globl glMultiTexCoord3f ; .type glMultiTexCoord3f,#function ; glMultiTexCoord3f = glMultiTexCoord3fARB + .globl glMultiTexCoord3fv ; .type glMultiTexCoord3fv,#function ; glMultiTexCoord3fv = glMultiTexCoord3fvARB + .globl glMultiTexCoord3i ; .type glMultiTexCoord3i,#function ; glMultiTexCoord3i = glMultiTexCoord3iARB + .globl glMultiTexCoord3iv ; .type glMultiTexCoord3iv,#function ; glMultiTexCoord3iv = glMultiTexCoord3ivARB + .globl glMultiTexCoord3s ; .type glMultiTexCoord3s,#function ; glMultiTexCoord3s = glMultiTexCoord3sARB + .globl glMultiTexCoord3sv ; .type glMultiTexCoord3sv,#function ; glMultiTexCoord3sv = glMultiTexCoord3svARB + .globl glMultiTexCoord4d ; .type glMultiTexCoord4d,#function ; glMultiTexCoord4d = glMultiTexCoord4dARB + .globl glMultiTexCoord4dv ; .type glMultiTexCoord4dv,#function ; glMultiTexCoord4dv = glMultiTexCoord4dvARB + .globl glMultiTexCoord4f ; .type glMultiTexCoord4f,#function ; glMultiTexCoord4f = glMultiTexCoord4fARB + .globl glMultiTexCoord4fv ; .type glMultiTexCoord4fv,#function ; glMultiTexCoord4fv = glMultiTexCoord4fvARB + .globl glMultiTexCoord4i ; .type glMultiTexCoord4i,#function ; glMultiTexCoord4i = glMultiTexCoord4iARB + .globl glMultiTexCoord4iv ; .type glMultiTexCoord4iv,#function ; glMultiTexCoord4iv = glMultiTexCoord4ivARB + .globl glMultiTexCoord4s ; .type glMultiTexCoord4s,#function ; glMultiTexCoord4s = glMultiTexCoord4sARB + .globl glMultiTexCoord4sv ; .type glMultiTexCoord4sv,#function ; glMultiTexCoord4sv = glMultiTexCoord4svARB + .globl glLoadTransposeMatrixf ; .type glLoadTransposeMatrixf,#function ; glLoadTransposeMatrixf = glLoadTransposeMatrixfARB + .globl glLoadTransposeMatrixd ; .type glLoadTransposeMatrixd,#function ; glLoadTransposeMatrixd = glLoadTransposeMatrixdARB + .globl glMultTransposeMatrixf ; .type glMultTransposeMatrixf,#function ; glMultTransposeMatrixf = glMultTransposeMatrixfARB + .globl glMultTransposeMatrixd ; .type glMultTransposeMatrixd,#function ; glMultTransposeMatrixd = glMultTransposeMatrixdARB + .globl glSampleCoverage ; .type glSampleCoverage,#function ; glSampleCoverage = glSampleCoverageARB + .globl glDrawBuffersATI ; .type glDrawBuffersATI,#function ; glDrawBuffersATI = glDrawBuffersARB + .globl glSampleMaskEXT ; .type glSampleMaskEXT,#function ; glSampleMaskEXT = glSampleMaskSGIS + .globl glSamplePatternEXT ; .type glSamplePatternEXT,#function ; glSamplePatternEXT = glSamplePatternSGIS + .globl glPointParameterf ; .type glPointParameterf,#function ; glPointParameterf = glPointParameterfEXT + .globl glPointParameterfARB ; .type glPointParameterfARB,#function ; glPointParameterfARB = glPointParameterfEXT + .globl glPointParameterfSGIS ; .type glPointParameterfSGIS,#function ; glPointParameterfSGIS = glPointParameterfEXT + .globl glPointParameterfv ; .type glPointParameterfv,#function ; glPointParameterfv = glPointParameterfvEXT + .globl glPointParameterfvARB ; .type glPointParameterfvARB,#function ; glPointParameterfvARB = glPointParameterfvEXT + .globl glPointParameterfvSGIS ; .type glPointParameterfvSGIS,#function ; glPointParameterfvSGIS = glPointParameterfvEXT + .globl glWindowPos2d ; .type glWindowPos2d,#function ; glWindowPos2d = glWindowPos2dMESA + .globl glWindowPos2dARB ; .type glWindowPos2dARB,#function ; glWindowPos2dARB = glWindowPos2dMESA + .globl glWindowPos2dv ; .type glWindowPos2dv,#function ; glWindowPos2dv = glWindowPos2dvMESA + .globl glWindowPos2dvARB ; .type glWindowPos2dvARB,#function ; glWindowPos2dvARB = glWindowPos2dvMESA + .globl glWindowPos2f ; .type glWindowPos2f,#function ; glWindowPos2f = glWindowPos2fMESA + .globl glWindowPos2fARB ; .type glWindowPos2fARB,#function ; glWindowPos2fARB = glWindowPos2fMESA + .globl glWindowPos2fv ; .type glWindowPos2fv,#function ; glWindowPos2fv = glWindowPos2fvMESA + .globl glWindowPos2fvARB ; .type glWindowPos2fvARB,#function ; glWindowPos2fvARB = glWindowPos2fvMESA + .globl glWindowPos2i ; .type glWindowPos2i,#function ; glWindowPos2i = glWindowPos2iMESA + .globl glWindowPos2iARB ; .type glWindowPos2iARB,#function ; glWindowPos2iARB = glWindowPos2iMESA + .globl glWindowPos2iv ; .type glWindowPos2iv,#function ; glWindowPos2iv = glWindowPos2ivMESA + .globl glWindowPos2ivARB ; .type glWindowPos2ivARB,#function ; glWindowPos2ivARB = glWindowPos2ivMESA + .globl glWindowPos2s ; .type glWindowPos2s,#function ; glWindowPos2s = glWindowPos2sMESA + .globl glWindowPos2sARB ; .type glWindowPos2sARB,#function ; glWindowPos2sARB = glWindowPos2sMESA + .globl glWindowPos2sv ; .type glWindowPos2sv,#function ; glWindowPos2sv = glWindowPos2svMESA + .globl glWindowPos2svARB ; .type glWindowPos2svARB,#function ; glWindowPos2svARB = glWindowPos2svMESA + .globl glWindowPos3d ; .type glWindowPos3d,#function ; glWindowPos3d = glWindowPos3dMESA + .globl glWindowPos3dARB ; .type glWindowPos3dARB,#function ; glWindowPos3dARB = glWindowPos3dMESA + .globl glWindowPos3dv ; .type glWindowPos3dv,#function ; glWindowPos3dv = glWindowPos3dvMESA + .globl glWindowPos3dvARB ; .type glWindowPos3dvARB,#function ; glWindowPos3dvARB = glWindowPos3dvMESA + .globl glWindowPos3f ; .type glWindowPos3f,#function ; glWindowPos3f = glWindowPos3fMESA + .globl glWindowPos3fARB ; .type glWindowPos3fARB,#function ; glWindowPos3fARB = glWindowPos3fMESA + .globl glWindowPos3fv ; .type glWindowPos3fv,#function ; glWindowPos3fv = glWindowPos3fvMESA + .globl glWindowPos3fvARB ; .type glWindowPos3fvARB,#function ; glWindowPos3fvARB = glWindowPos3fvMESA + .globl glWindowPos3i ; .type glWindowPos3i,#function ; glWindowPos3i = glWindowPos3iMESA + .globl glWindowPos3iARB ; .type glWindowPos3iARB,#function ; glWindowPos3iARB = glWindowPos3iMESA + .globl glWindowPos3iv ; .type glWindowPos3iv,#function ; glWindowPos3iv = glWindowPos3ivMESA + .globl glWindowPos3ivARB ; .type glWindowPos3ivARB,#function ; glWindowPos3ivARB = glWindowPos3ivMESA + .globl glWindowPos3s ; .type glWindowPos3s,#function ; glWindowPos3s = glWindowPos3sMESA + .globl glWindowPos3sARB ; .type glWindowPos3sARB,#function ; glWindowPos3sARB = glWindowPos3sMESA + .globl glWindowPos3sv ; .type glWindowPos3sv,#function ; glWindowPos3sv = glWindowPos3svMESA + .globl glWindowPos3svARB ; .type glWindowPos3svARB,#function ; glWindowPos3svARB = glWindowPos3svMESA + .globl glBlendFuncSeparate ; .type glBlendFuncSeparate,#function ; glBlendFuncSeparate = glBlendFuncSeparateEXT + .globl glBlendFuncSeparateINGR ; .type glBlendFuncSeparateINGR,#function ; glBlendFuncSeparateINGR = glBlendFuncSeparateEXT + .globl glFogCoordf ; .type glFogCoordf,#function ; glFogCoordf = glFogCoordfEXT + .globl glFogCoordfv ; .type glFogCoordfv,#function ; glFogCoordfv = glFogCoordfvEXT + .globl glFogCoordd ; .type glFogCoordd,#function ; glFogCoordd = glFogCoorddEXT + .globl glFogCoorddv ; .type glFogCoorddv,#function ; glFogCoorddv = glFogCoorddvEXT + .globl glFogCoordPointer ; .type glFogCoordPointer,#function ; glFogCoordPointer = glFogCoordPointerEXT + .globl glCompressedTexImage3D ; .type glCompressedTexImage3D,#function ; glCompressedTexImage3D = glCompressedTexImage3DARB + .globl glCompressedTexImage2D ; .type glCompressedTexImage2D,#function ; glCompressedTexImage2D = glCompressedTexImage2DARB + .globl glCompressedTexImage1D ; .type glCompressedTexImage1D,#function ; glCompressedTexImage1D = glCompressedTexImage1DARB + .globl glCompressedTexSubImage3D ; .type glCompressedTexSubImage3D,#function ; glCompressedTexSubImage3D = glCompressedTexSubImage3DARB + .globl glCompressedTexSubImage2D ; .type glCompressedTexSubImage2D,#function ; glCompressedTexSubImage2D = glCompressedTexSubImage2DARB + .globl glCompressedTexSubImage1D ; .type glCompressedTexSubImage1D,#function ; glCompressedTexSubImage1D = glCompressedTexSubImage1DARB + .globl glGetCompressedTexImage ; .type glGetCompressedTexImage,#function ; glGetCompressedTexImage = glGetCompressedTexImageARB + .globl glSecondaryColor3b ; .type glSecondaryColor3b,#function ; glSecondaryColor3b = glSecondaryColor3bEXT + .globl glSecondaryColor3bv ; .type glSecondaryColor3bv,#function ; glSecondaryColor3bv = glSecondaryColor3bvEXT + .globl glSecondaryColor3d ; .type glSecondaryColor3d,#function ; glSecondaryColor3d = glSecondaryColor3dEXT + .globl glSecondaryColor3dv ; .type glSecondaryColor3dv,#function ; glSecondaryColor3dv = glSecondaryColor3dvEXT + .globl glSecondaryColor3f ; .type glSecondaryColor3f,#function ; glSecondaryColor3f = glSecondaryColor3fEXT + .globl glSecondaryColor3fv ; .type glSecondaryColor3fv,#function ; glSecondaryColor3fv = glSecondaryColor3fvEXT + .globl glSecondaryColor3i ; .type glSecondaryColor3i,#function ; glSecondaryColor3i = glSecondaryColor3iEXT + .globl glSecondaryColor3iv ; .type glSecondaryColor3iv,#function ; glSecondaryColor3iv = glSecondaryColor3ivEXT + .globl glSecondaryColor3s ; .type glSecondaryColor3s,#function ; glSecondaryColor3s = glSecondaryColor3sEXT + .globl glSecondaryColor3sv ; .type glSecondaryColor3sv,#function ; glSecondaryColor3sv = glSecondaryColor3svEXT + .globl glSecondaryColor3ub ; .type glSecondaryColor3ub,#function ; glSecondaryColor3ub = glSecondaryColor3ubEXT + .globl glSecondaryColor3ubv ; .type glSecondaryColor3ubv,#function ; glSecondaryColor3ubv = glSecondaryColor3ubvEXT + .globl glSecondaryColor3ui ; .type glSecondaryColor3ui,#function ; glSecondaryColor3ui = glSecondaryColor3uiEXT + .globl glSecondaryColor3uiv ; .type glSecondaryColor3uiv,#function ; glSecondaryColor3uiv = glSecondaryColor3uivEXT + .globl glSecondaryColor3us ; .type glSecondaryColor3us,#function ; glSecondaryColor3us = glSecondaryColor3usEXT + .globl glSecondaryColor3usv ; .type glSecondaryColor3usv,#function ; glSecondaryColor3usv = glSecondaryColor3usvEXT + .globl glSecondaryColorPointer ; .type glSecondaryColorPointer,#function ; glSecondaryColorPointer = glSecondaryColorPointerEXT + .globl glBindProgramARB ; .type glBindProgramARB,#function ; glBindProgramARB = glBindProgramNV + .globl glDeleteProgramsARB ; .type glDeleteProgramsARB,#function ; glDeleteProgramsARB = glDeleteProgramsNV + .globl glGenProgramsARB ; .type glGenProgramsARB,#function ; glGenProgramsARB = glGenProgramsNV + .globl glGetVertexAttribPointervARB ; .type glGetVertexAttribPointervARB,#function ; glGetVertexAttribPointervARB = glGetVertexAttribPointervNV + .globl glIsProgramARB ; .type glIsProgramARB,#function ; glIsProgramARB = glIsProgramNV + .globl glPointParameteri ; .type glPointParameteri,#function ; glPointParameteri = glPointParameteriNV + .globl glPointParameteriv ; .type glPointParameteriv,#function ; glPointParameteriv = glPointParameterivNV + .globl glMultiDrawArrays ; .type glMultiDrawArrays,#function ; glMultiDrawArrays = glMultiDrawArraysEXT + .globl glMultiDrawElements ; .type glMultiDrawElements,#function ; glMultiDrawElements = glMultiDrawElementsEXT + .globl glBindBuffer ; .type glBindBuffer,#function ; glBindBuffer = glBindBufferARB + .globl glBufferData ; .type glBufferData,#function ; glBufferData = glBufferDataARB + .globl glBufferSubData ; .type glBufferSubData,#function ; glBufferSubData = glBufferSubDataARB + .globl glDeleteBuffers ; .type glDeleteBuffers,#function ; glDeleteBuffers = glDeleteBuffersARB + .globl glGenBuffers ; .type glGenBuffers,#function ; glGenBuffers = glGenBuffersARB + .globl glGetBufferParameteriv ; .type glGetBufferParameteriv,#function ; glGetBufferParameteriv = glGetBufferParameterivARB + .globl glGetBufferPointerv ; .type glGetBufferPointerv,#function ; glGetBufferPointerv = glGetBufferPointervARB + .globl glGetBufferSubData ; .type glGetBufferSubData,#function ; glGetBufferSubData = glGetBufferSubDataARB + .globl glIsBuffer ; .type glIsBuffer,#function ; glIsBuffer = glIsBufferARB + .globl glMapBuffer ; .type glMapBuffer,#function ; glMapBuffer = glMapBufferARB + .globl glUnmapBuffer ; .type glUnmapBuffer,#function ; glUnmapBuffer = glUnmapBufferARB + .globl glGenQueries ; .type glGenQueries,#function ; glGenQueries = glGenQueriesARB + .globl glDeleteQueries ; .type glDeleteQueries,#function ; glDeleteQueries = glDeleteQueriesARB + .globl glIsQuery ; .type glIsQuery,#function ; glIsQuery = glIsQueryARB + .globl glBeginQuery ; .type glBeginQuery,#function ; glBeginQuery = glBeginQueryARB + .globl glEndQuery ; .type glEndQuery,#function ; glEndQuery = glEndQueryARB + .globl glGetQueryiv ; .type glGetQueryiv,#function ; glGetQueryiv = glGetQueryivARB + .globl glGetQueryObjectiv ; .type glGetQueryObjectiv,#function ; glGetQueryObjectiv = glGetQueryObjectivARB + .globl glGetQueryObjectuiv ; .type glGetQueryObjectuiv,#function ; glGetQueryObjectuiv = glGetQueryObjectuivARB + .globl glBlendEquationSeparateATI ; .type glBlendEquationSeparateATI,#function ; glBlendEquationSeparateATI = glBlendEquationSeparateEXT diff --git a/src/mesa/sparc/norm.S b/src/mesa/sparc/norm.S index 876d7e310b1..713cd5b3754 100644 --- a/src/mesa/sparc/norm.S +++ b/src/mesa/sparc/norm.S @@ -1,8 +1,8 @@ -/* $Id: norm.S,v 1.4 2004/11/22 19:27:40 brianp Exp $ */ +/* $Id: norm.S,v 1.5 2005/07/28 00:11:11 idr Exp $ */ #include "sparc_matrix.h" -#ifdef SVR4 +#if defined(SVR4) || defined(__SVR4) || defined(__svr4__) /* Solaris requires this for 64-bit. */ .register %g2, #scratch .register %g3, #scratch @@ -10,7 +10,7 @@ .text -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) +#ifdef __arch64__ #define STACK_VAR_OFF (2047 + (8 * 16)) #else #define STACK_VAR_OFF (4 * 16) diff --git a/src/mesa/sparc/sparc.c b/src/mesa/sparc/sparc.c index 2a073749102..b7fe360d2c6 100644 --- a/src/mesa/sparc/sparc.c +++ b/src/mesa/sparc/sparc.c @@ -110,13 +110,9 @@ void _mesa_init_all_sparc_transform_asm(void) ASSIGN_XFORM_GROUP(sparc, 3) ASSIGN_XFORM_GROUP(sparc, 4) -#if 0 - /* Disabled for now. See Mesa bug report # 544665. Evidently these - * functions are using SPARC registers that shouldn't be touched. - */ _mesa_clip_tab[4] = _mesa_sparc_cliptest_points4; _mesa_clip_np_tab[4] = _mesa_sparc_cliptest_points4_np; -#endif + #if 0 /* disable these too. See bug 673938 */ _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE] = @@ -162,7 +158,7 @@ void _mesa_init_sparc_glapi_relocs(void) disp_addr = (unsigned long) &_glapi_Dispatch; while (insn_ptr < end_ptr) { -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) +#ifdef __arch64__ insn_ptr[0] |= (disp_addr >> (32 + 10)); insn_ptr[1] |= ((disp_addr & 0xffffffff) >> 10); __glapi_sparc_icache_flush(&insn_ptr[0]); diff --git a/src/mesa/sparc/sparc_matrix.h b/src/mesa/sparc/sparc_matrix.h index d74b4874530..f677d9bda13 100644 --- a/src/mesa/sparc/sparc_matrix.h +++ b/src/mesa/sparc/sparc_matrix.h @@ -5,7 +5,7 @@ #ifndef _SPARC_MATRIX_H #define _SPARC_MATRIX_H -#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__))) +#ifdef __arch64__ #define LDPTR ldx #define MAT_M 0x00 #define MAT_INV 0x08 diff --git a/src/mesa/sparc/xform.S b/src/mesa/sparc/xform.S index 769a9c16faa..f44ec794e94 100644 --- a/src/mesa/sparc/xform.S +++ b/src/mesa/sparc/xform.S @@ -1,4 +1,4 @@ -/* $Id: xform.S,v 1.3 2004/04/26 10:10:25 alanh Exp $ */ +/* $Id: xform.S,v 1.4 2005/07/28 00:11:11 idr Exp $ */ /* TODO * @@ -18,7 +18,7 @@ #include "sparc_matrix.h" -#ifdef SVR4 +#if defined(SVR4) || defined(__SVR4) || defined(__svr4__) /* Solaris requires this for 64-bit. */ .register %g2, #scratch .register %g3, #scratch -- cgit v1.2.3 From 1585c234e0db4bfb7cd85c4111594f6da1582e6f Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 28 Jul 2005 00:29:51 +0000 Subject: Major rip-up of internal function insertion interface. The old _glapi_add_entrypoint has been replaced by a new routine called _glapi_add_dispatch. This new routine dynamically assignes dispatch offsets to functions added. This allows IHVs to add support for extension functions that do not have assigned dispatch offsets. It also means that a driver has no idea what offset will be assigned to a function. The vast majority of the changes in this commit account for that. An additional table, driDispatchRemapTable, is added. Functions not in the Linux OpenGL ABI (i.e., anything not in GL 1.2 + ARB_multitexture) has a fixed offset in this new table. The entry in this table specifies the offset in of the function in the real dispatch table. The internal interface was also bumped from version 20050725 to 20050727. This has been tested with various programs in progs/demos on: radeon (Radeon Mobility M6) r128 (Rage 128 Pro) mga (G400) --- include/GL/internal/dri_interface.h | 6 +- src/glx/x11/dri_glx.c | 2 +- src/glx/x11/glxcmds.c | 4 +- src/mesa/drivers/dri/common/extension_helper.h | 1655 ++++++++++++------------ src/mesa/drivers/dri/common/utils.c | 54 +- src/mesa/drivers/dri/common/utils.h | 8 +- src/mesa/drivers/dri/ffb/ffb_xmesa.c | 2 +- src/mesa/drivers/dri/i810/i810screen.c | 2 +- src/mesa/drivers/dri/i830/i830_context.c | 2 +- src/mesa/drivers/dri/i830/i830_screen.c | 13 +- src/mesa/drivers/dri/i915/i830_context.c | 4 +- src/mesa/drivers/dri/i915/i915_context.c | 4 +- src/mesa/drivers/dri/i915/intel_context.c | 2 +- src/mesa/drivers/dri/i915/intel_screen.c | 13 +- src/mesa/drivers/dri/mach64/mach64_screen.c | 2 +- src/mesa/drivers/dri/mga/mga_xmesa.c | 16 +- src/mesa/drivers/dri/r128/r128_context.c | 2 +- src/mesa/drivers/dri/r128/r128_screen.c | 14 +- src/mesa/drivers/dri/r200/r200_context.c | 8 +- src/mesa/drivers/dri/r200/r200_screen.c | 20 +- src/mesa/drivers/dri/r300/r300_context.c | 2 +- src/mesa/drivers/dri/r300/radeon_screen.c | 12 +- src/mesa/drivers/dri/radeon/radeon_context.c | 2 +- src/mesa/drivers/dri/radeon/radeon_screen.c | 14 +- src/mesa/drivers/dri/savage/savage_xmesa.c | 16 +- src/mesa/drivers/dri/sis/sis_context.c | 2 +- src/mesa/drivers/dri/sis/sis_screen.c | 2 +- src/mesa/drivers/dri/tdfx/tdfx_context.c | 4 +- src/mesa/drivers/dri/tdfx/tdfx_screen.c | 16 +- src/mesa/drivers/dri/trident/trident_context.c | 2 +- src/mesa/drivers/dri/unichrome/via_context.c | 2 +- src/mesa/drivers/dri/unichrome/via_screen.c | 13 +- src/mesa/glapi/dispatch.h | 1646 ++++++++++++++++++++++- src/mesa/glapi/extension_helper.py | 35 +- src/mesa/glapi/gl_offsets.py | 6 + src/mesa/glapi/gl_table.py | 42 +- src/mesa/glapi/glapi.c | 312 +++-- src/mesa/glapi/glapi.h | 11 +- src/mesa/glapi/glapioffsets.h | 1 + src/mesa/glapi/glapitable.h | 2 + src/mesa/main/mtypes.h | 5 +- src/mesa/main/vtxfmt.c | 7 +- 42 files changed, 2993 insertions(+), 994 deletions(-) (limited to 'include') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 08d3844266c..f4098ba8d91 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -113,7 +113,7 @@ typedef void *(CREATENEWSCREENFUNC)(__DRInativeDisplay *dpy, int scrn, const __DRIinterfaceMethods * interface, __GLcontextModes ** driver_modes); typedef CREATENEWSCREENFUNC* PFNCREATENEWSCREENFUNC; -extern CREATENEWSCREENFUNC __driCreateNewScreen_20050725; +extern CREATENEWSCREENFUNC __driCreateNewScreen_20050727; /** @@ -377,7 +377,7 @@ struct __DRIcontextRec { /** * Method to bind a DRI drawable to a DRI graphics context. * - * \since Internal API version 20050725. + * \since Internal API version 20050727. */ GLboolean (*bindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw, __DRIid read, __DRIcontext *ctx); @@ -385,7 +385,7 @@ struct __DRIcontextRec { /** * Method to unbind a DRI drawable from a DRI graphics context. * - * \since Internal API version 20050725. + * \since Internal API version 20050727. */ GLboolean (*unbindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw, __DRIid read, __DRIcontext *ctx); diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c index 91ca875ff16..6ebf21d4028 100644 --- a/src/glx/x11/dri_glx.c +++ b/src/glx/x11/dri_glx.c @@ -166,7 +166,7 @@ ExtractDir(int index, const char *paths, int dirLen, char *dir) * \todo * Create a macro or something so that this is automatically updated. */ -static const char createNewScreenName[] = "__driCreateNewScreen_20050725"; +static const char createNewScreenName[] = "__driCreateNewScreen_20050727"; /** diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index 39e5f11e43b..fbb6e7b3681 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -2886,10 +2886,10 @@ int __glXGetInternalVersion(void) * 20040415 - Added support for bindContext3 and unbindContext3. * 20040602 - Add __glXGetDrawableInfo. I though that was there * months ago. :( - * 20050725 - Gut all the old interfaces. This breaks compatability with + * 20050727 - Gut all the old interfaces. This breaks compatability with * any DRI driver built to any previous version. */ - return 20050725; + return 20050727; } diff --git a/src/mesa/drivers/dri/common/extension_helper.h b/src/mesa/drivers/dri/common/extension_helper.h index 39384ca31b4..4a6606819cf 100644 --- a/src/mesa/drivers/dri/common/extension_helper.h +++ b/src/mesa/drivers/dri/common/extension_helper.h @@ -26,6 +26,7 @@ */ #include "utils.h" +#include "dispatch.h" #ifndef NULL # define NULL 0 @@ -4579,1308 +4580,1308 @@ static const char WindowPos2fMESA_names[] = #if defined(need_GL_3DFX_tbuffer) static const struct dri_extension_function GL_3DFX_tbuffer_functions[] = { - { TbufferMask3DFX_names, 553 }, - { NULL, 0 } + { TbufferMask3DFX_names, TbufferMask3DFX_remap_index, 553 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_ARB_draw_buffers) static const struct dri_extension_function GL_ARB_draw_buffers_functions[] = { - { DrawBuffersARB_names, 413 }, - { NULL, 0 } + { DrawBuffersARB_names, DrawBuffersARB_remap_index, 413 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_ARB_matrix_palette) static const struct dri_extension_function GL_ARB_matrix_palette_functions[] = { - { MatrixIndexusvARB_names, -1 }, - { MatrixIndexuivARB_names, -1 }, - { CurrentPaletteMatrixARB_names, -1 }, - { MatrixIndexubvARB_names, -1 }, - { MatrixIndexPointerARB_names, -1 }, - { NULL, 0 } + { MatrixIndexusvARB_names, MatrixIndexusvARB_remap_index, -1 }, + { MatrixIndexuivARB_names, MatrixIndexuivARB_remap_index, -1 }, + { CurrentPaletteMatrixARB_names, CurrentPaletteMatrixARB_remap_index, -1 }, + { MatrixIndexubvARB_names, MatrixIndexubvARB_remap_index, -1 }, + { MatrixIndexPointerARB_names, MatrixIndexPointerARB_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_ARB_multisample) static const struct dri_extension_function GL_ARB_multisample_functions[] = { - { SampleCoverageARB_names, 412 }, - { NULL, 0 } + { SampleCoverageARB_names, SampleCoverageARB_remap_index, 412 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_ARB_occlusion_query) static const struct dri_extension_function GL_ARB_occlusion_query_functions[] = { - { BeginQueryARB_names, 703 }, - { GetQueryivARB_names, 705 }, - { GetQueryObjectivARB_names, 706 }, - { EndQueryARB_names, 704 }, - { GetQueryObjectuivARB_names, 707 }, - { DeleteQueriesARB_names, 701 }, - { IsQueryARB_names, 702 }, - { GenQueriesARB_names, 700 }, - { NULL, 0 } + { BeginQueryARB_names, BeginQueryARB_remap_index, 703 }, + { GetQueryivARB_names, GetQueryivARB_remap_index, 705 }, + { GetQueryObjectivARB_names, GetQueryObjectivARB_remap_index, 706 }, + { EndQueryARB_names, EndQueryARB_remap_index, 704 }, + { GetQueryObjectuivARB_names, GetQueryObjectuivARB_remap_index, 707 }, + { DeleteQueriesARB_names, DeleteQueriesARB_remap_index, 701 }, + { IsQueryARB_names, IsQueryARB_remap_index, 702 }, + { GenQueriesARB_names, GenQueriesARB_remap_index, 700 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_ARB_point_parameters) static const struct dri_extension_function GL_ARB_point_parameters_functions[] = { - { PointParameterfEXT_names, 458 }, - { PointParameterfvEXT_names, 459 }, - { NULL, 0 } + { PointParameterfEXT_names, PointParameterfEXT_remap_index, 458 }, + { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, 459 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_ARB_shader_objects) static const struct dri_extension_function GL_ARB_shader_objects_functions[] = { - { UniformMatrix3fvARB_names, 739 }, - { Uniform2fARB_names, 723 }, - { Uniform2ivARB_names, 735 }, - { UniformMatrix4fvARB_names, 740 }, - { CreateProgramObjectARB_names, 717 }, - { Uniform3iARB_names, 728 }, - { CreateShaderObjectARB_names, 714 }, - { AttachObjectARB_names, 718 }, - { UniformMatrix2fvARB_names, 738 }, - { GetAttachedObjectsARB_names, 744 }, - { Uniform3fvARB_names, 732 }, - { GetHandleARB_names, 712 }, - { GetActiveUniformARB_names, 746 }, - { GetUniformivARB_names, 748 }, - { Uniform2fvARB_names, 731 }, - { DeleteObjectARB_names, 711 }, - { UseProgramObjectARB_names, 720 }, - { Uniform3ivARB_names, 736 }, - { CompileShaderARB_names, 716 }, - { Uniform4fARB_names, 725 }, - { LinkProgramARB_names, 719 }, - { ShaderSourceARB_names, 715 }, - { Uniform4ivARB_names, 737 }, - { Uniform1ivARB_names, 734 }, - { ValidateProgramARB_names, 721 }, - { Uniform1iARB_names, 726 }, - { Uniform4fvARB_names, 733 }, - { GetUniformfvARB_names, 747 }, - { DetachObjectARB_names, 713 }, - { Uniform4iARB_names, 729 }, - { Uniform2iARB_names, 727 }, - { GetObjectParameterivARB_names, 742 }, - { GetUniformLocationARB_names, 745 }, - { GetShaderSourceARB_names, 749 }, - { Uniform1fARB_names, 722 }, - { Uniform1fvARB_names, 730 }, - { Uniform3fARB_names, 724 }, - { GetObjectParameterfvARB_names, 741 }, - { GetInfoLogARB_names, 743 }, - { NULL, 0 } + { UniformMatrix3fvARB_names, UniformMatrix3fvARB_remap_index, 739 }, + { Uniform2fARB_names, Uniform2fARB_remap_index, 723 }, + { Uniform2ivARB_names, Uniform2ivARB_remap_index, 735 }, + { UniformMatrix4fvARB_names, UniformMatrix4fvARB_remap_index, 740 }, + { CreateProgramObjectARB_names, CreateProgramObjectARB_remap_index, 717 }, + { Uniform3iARB_names, Uniform3iARB_remap_index, 728 }, + { CreateShaderObjectARB_names, CreateShaderObjectARB_remap_index, 714 }, + { AttachObjectARB_names, AttachObjectARB_remap_index, 718 }, + { UniformMatrix2fvARB_names, UniformMatrix2fvARB_remap_index, 738 }, + { GetAttachedObjectsARB_names, GetAttachedObjectsARB_remap_index, 744 }, + { Uniform3fvARB_names, Uniform3fvARB_remap_index, 732 }, + { GetHandleARB_names, GetHandleARB_remap_index, 712 }, + { GetActiveUniformARB_names, GetActiveUniformARB_remap_index, 746 }, + { GetUniformivARB_names, GetUniformivARB_remap_index, 748 }, + { Uniform2fvARB_names, Uniform2fvARB_remap_index, 731 }, + { DeleteObjectARB_names, DeleteObjectARB_remap_index, 711 }, + { UseProgramObjectARB_names, UseProgramObjectARB_remap_index, 720 }, + { Uniform3ivARB_names, Uniform3ivARB_remap_index, 736 }, + { CompileShaderARB_names, CompileShaderARB_remap_index, 716 }, + { Uniform4fARB_names, Uniform4fARB_remap_index, 725 }, + { LinkProgramARB_names, LinkProgramARB_remap_index, 719 }, + { ShaderSourceARB_names, ShaderSourceARB_remap_index, 715 }, + { Uniform4ivARB_names, Uniform4ivARB_remap_index, 737 }, + { Uniform1ivARB_names, Uniform1ivARB_remap_index, 734 }, + { ValidateProgramARB_names, ValidateProgramARB_remap_index, 721 }, + { Uniform1iARB_names, Uniform1iARB_remap_index, 726 }, + { Uniform4fvARB_names, Uniform4fvARB_remap_index, 733 }, + { GetUniformfvARB_names, GetUniformfvARB_remap_index, 747 }, + { DetachObjectARB_names, DetachObjectARB_remap_index, 713 }, + { Uniform4iARB_names, Uniform4iARB_remap_index, 729 }, + { Uniform2iARB_names, Uniform2iARB_remap_index, 727 }, + { GetObjectParameterivARB_names, GetObjectParameterivARB_remap_index, 742 }, + { GetUniformLocationARB_names, GetUniformLocationARB_remap_index, 745 }, + { GetShaderSourceARB_names, GetShaderSourceARB_remap_index, 749 }, + { Uniform1fARB_names, Uniform1fARB_remap_index, 722 }, + { Uniform1fvARB_names, Uniform1fvARB_remap_index, 730 }, + { Uniform3fARB_names, Uniform3fARB_remap_index, 724 }, + { GetObjectParameterfvARB_names, GetObjectParameterfvARB_remap_index, 741 }, + { GetInfoLogARB_names, GetInfoLogARB_remap_index, 743 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_ARB_texture_compression) static const struct dri_extension_function GL_ARB_texture_compression_functions[] = { - { CompressedTexSubImage2DARB_names, 558 }, - { CompressedTexImage3DARB_names, 554 }, - { CompressedTexImage1DARB_names, 556 }, - { CompressedTexSubImage1DARB_names, 559 }, - { CompressedTexSubImage3DARB_names, 557 }, - { CompressedTexImage2DARB_names, 555 }, - { GetCompressedTexImageARB_names, 560 }, - { NULL, 0 } + { CompressedTexSubImage2DARB_names, CompressedTexSubImage2DARB_remap_index, 558 }, + { CompressedTexImage3DARB_names, CompressedTexImage3DARB_remap_index, 554 }, + { CompressedTexImage1DARB_names, CompressedTexImage1DARB_remap_index, 556 }, + { CompressedTexSubImage1DARB_names, CompressedTexSubImage1DARB_remap_index, 559 }, + { CompressedTexSubImage3DARB_names, CompressedTexSubImage3DARB_remap_index, 557 }, + { CompressedTexImage2DARB_names, CompressedTexImage2DARB_remap_index, 555 }, + { GetCompressedTexImageARB_names, GetCompressedTexImageARB_remap_index, 560 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_ARB_transpose_matrix) static const struct dri_extension_function GL_ARB_transpose_matrix_functions[] = { - { MultTransposeMatrixdARB_names, 411 }, - { LoadTransposeMatrixdARB_names, 409 }, - { MultTransposeMatrixfARB_names, 410 }, - { LoadTransposeMatrixfARB_names, 408 }, - { NULL, 0 } + { MultTransposeMatrixdARB_names, MultTransposeMatrixdARB_remap_index, 411 }, + { LoadTransposeMatrixdARB_names, LoadTransposeMatrixdARB_remap_index, 409 }, + { MultTransposeMatrixfARB_names, MultTransposeMatrixfARB_remap_index, 410 }, + { LoadTransposeMatrixfARB_names, LoadTransposeMatrixfARB_remap_index, 408 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_ARB_vertex_blend) static const struct dri_extension_function GL_ARB_vertex_blend_functions[] = { - { WeightubvARB_names, -1 }, - { WeightivARB_names, -1 }, - { WeightPointerARB_names, -1 }, - { WeightfvARB_names, -1 }, - { WeightbvARB_names, -1 }, - { WeightusvARB_names, -1 }, - { VertexBlendARB_names, -1 }, - { WeightsvARB_names, -1 }, - { WeightdvARB_names, -1 }, - { WeightuivARB_names, -1 }, - { NULL, 0 } + { WeightubvARB_names, WeightubvARB_remap_index, -1 }, + { WeightivARB_names, WeightivARB_remap_index, -1 }, + { WeightPointerARB_names, WeightPointerARB_remap_index, -1 }, + { WeightfvARB_names, WeightfvARB_remap_index, -1 }, + { WeightbvARB_names, WeightbvARB_remap_index, -1 }, + { WeightusvARB_names, WeightusvARB_remap_index, -1 }, + { VertexBlendARB_names, VertexBlendARB_remap_index, -1 }, + { WeightsvARB_names, WeightsvARB_remap_index, -1 }, + { WeightdvARB_names, WeightdvARB_remap_index, -1 }, + { WeightuivARB_names, WeightuivARB_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_ARB_vertex_buffer_object) static const struct dri_extension_function GL_ARB_vertex_buffer_object_functions[] = { - { GetBufferSubDataARB_names, 695 }, - { BufferSubDataARB_names, 690 }, - { BufferDataARB_names, 689 }, - { GetBufferPointervARB_names, 694 }, - { GetBufferParameterivARB_names, 693 }, - { MapBufferARB_names, 697 }, - { IsBufferARB_names, 696 }, - { DeleteBuffersARB_names, 691 }, - { UnmapBufferARB_names, 698 }, - { BindBufferARB_names, 688 }, - { GenBuffersARB_names, 692 }, - { NULL, 0 } + { GetBufferSubDataARB_names, GetBufferSubDataARB_remap_index, 695 }, + { BufferSubDataARB_names, BufferSubDataARB_remap_index, 690 }, + { BufferDataARB_names, BufferDataARB_remap_index, 689 }, + { GetBufferPointervARB_names, GetBufferPointervARB_remap_index, 694 }, + { GetBufferParameterivARB_names, GetBufferParameterivARB_remap_index, 693 }, + { MapBufferARB_names, MapBufferARB_remap_index, 697 }, + { IsBufferARB_names, IsBufferARB_remap_index, 696 }, + { DeleteBuffersARB_names, DeleteBuffersARB_remap_index, 691 }, + { UnmapBufferARB_names, UnmapBufferARB_remap_index, 698 }, + { BindBufferARB_names, BindBufferARB_remap_index, 688 }, + { GenBuffersARB_names, GenBuffersARB_remap_index, 692 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_ARB_vertex_program) static const struct dri_extension_function GL_ARB_vertex_program_functions[] = { - { ProgramEnvParameter4dvARB_names, 669 }, - { VertexAttrib2fARB_names, 611 }, - { VertexAttrib3fARB_names, 617 }, - { VertexAttrib1svARB_names, 608 }, - { VertexAttrib4NusvARB_names, 662 }, - { DisableVertexAttribArrayARB_names, 666 }, - { ProgramLocalParameter4dARB_names, 672 }, - { VertexAttrib1fARB_names, 605 }, - { VertexAttrib4NbvARB_names, 659 }, - { VertexAttrib1sARB_names, 607 }, - { GetProgramLocalParameterfvARB_names, 679 }, - { VertexAttrib3dvARB_names, 616 }, - { ProgramEnvParameter4fvARB_names, 671 }, - { GetVertexAttribivARB_names, 590 }, - { VertexAttrib4ivARB_names, 655 }, - { VertexAttrib4bvARB_names, 654 }, - { VertexAttrib3dARB_names, 615 }, - { VertexAttrib4fARB_names, 623 }, - { VertexAttrib4fvARB_names, 624 }, - { ProgramLocalParameter4dvARB_names, 673 }, - { VertexAttrib4usvARB_names, 657 }, - { VertexAttrib2dARB_names, 609 }, - { VertexAttrib1dvARB_names, 604 }, - { GetVertexAttribfvARB_names, 589 }, - { VertexAttrib4ubvARB_names, 656 }, - { ProgramEnvParameter4fARB_names, 670 }, - { VertexAttrib4sARB_names, 625 }, - { VertexAttrib2dvARB_names, 610 }, - { VertexAttrib2fvARB_names, 612 }, - { VertexAttrib4NivARB_names, 661 }, - { GetProgramStringARB_names, 681 }, - { VertexAttrib4NuivARB_names, 663 }, - { IsProgramNV_names, 592 }, - { ProgramEnvParameter4dARB_names, 668 }, - { VertexAttrib1dARB_names, 603 }, - { VertexAttrib3svARB_names, 620 }, - { GetVertexAttribdvARB_names, 588 }, - { VertexAttrib4dvARB_names, 622 }, - { VertexAttribPointerARB_names, 664 }, - { VertexAttrib4NsvARB_names, 660 }, - { VertexAttrib3fvARB_names, 618 }, - { VertexAttrib4NubARB_names, 627 }, - { GetProgramEnvParameterfvARB_names, 677 }, - { ProgramLocalParameter4fvARB_names, 675 }, - { DeleteProgramsNV_names, 580 }, - { GetVertexAttribPointervNV_names, 591 }, - { VertexAttrib4dARB_names, 621 }, - { GetProgramLocalParameterdvARB_names, 678 }, - { GetProgramivARB_names, 680 }, - { VertexAttrib3sARB_names, 619 }, - { ProgramStringARB_names, 667 }, - { ProgramLocalParameter4fARB_names, 674 }, - { EnableVertexAttribArrayARB_names, 665 }, - { VertexAttrib4uivARB_names, 658 }, - { BindProgramNV_names, 579 }, - { VertexAttrib4svARB_names, 626 }, - { VertexAttrib2svARB_names, 614 }, - { VertexAttrib4NubvARB_names, 628 }, - { GetProgramEnvParameterdvARB_names, 676 }, - { VertexAttrib2sARB_names, 613 }, - { VertexAttrib1fvARB_names, 606 }, - { GenProgramsNV_names, 582 }, - { NULL, 0 } + { ProgramEnvParameter4dvARB_names, ProgramEnvParameter4dvARB_remap_index, 669 }, + { VertexAttrib2fARB_names, VertexAttrib2fARB_remap_index, 611 }, + { VertexAttrib3fARB_names, VertexAttrib3fARB_remap_index, 617 }, + { VertexAttrib1svARB_names, VertexAttrib1svARB_remap_index, 608 }, + { VertexAttrib4NusvARB_names, VertexAttrib4NusvARB_remap_index, 662 }, + { DisableVertexAttribArrayARB_names, DisableVertexAttribArrayARB_remap_index, 666 }, + { ProgramLocalParameter4dARB_names, ProgramLocalParameter4dARB_remap_index, 672 }, + { VertexAttrib1fARB_names, VertexAttrib1fARB_remap_index, 605 }, + { VertexAttrib4NbvARB_names, VertexAttrib4NbvARB_remap_index, 659 }, + { VertexAttrib1sARB_names, VertexAttrib1sARB_remap_index, 607 }, + { GetProgramLocalParameterfvARB_names, GetProgramLocalParameterfvARB_remap_index, 679 }, + { VertexAttrib3dvARB_names, VertexAttrib3dvARB_remap_index, 616 }, + { ProgramEnvParameter4fvARB_names, ProgramEnvParameter4fvARB_remap_index, 671 }, + { GetVertexAttribivARB_names, GetVertexAttribivARB_remap_index, 590 }, + { VertexAttrib4ivARB_names, VertexAttrib4ivARB_remap_index, 655 }, + { VertexAttrib4bvARB_names, VertexAttrib4bvARB_remap_index, 654 }, + { VertexAttrib3dARB_names, VertexAttrib3dARB_remap_index, 615 }, + { VertexAttrib4fARB_names, VertexAttrib4fARB_remap_index, 623 }, + { VertexAttrib4fvARB_names, VertexAttrib4fvARB_remap_index, 624 }, + { ProgramLocalParameter4dvARB_names, ProgramLocalParameter4dvARB_remap_index, 673 }, + { VertexAttrib4usvARB_names, VertexAttrib4usvARB_remap_index, 657 }, + { VertexAttrib2dARB_names, VertexAttrib2dARB_remap_index, 609 }, + { VertexAttrib1dvARB_names, VertexAttrib1dvARB_remap_index, 604 }, + { GetVertexAttribfvARB_names, GetVertexAttribfvARB_remap_index, 589 }, + { VertexAttrib4ubvARB_names, VertexAttrib4ubvARB_remap_index, 656 }, + { ProgramEnvParameter4fARB_names, ProgramEnvParameter4fARB_remap_index, 670 }, + { VertexAttrib4sARB_names, VertexAttrib4sARB_remap_index, 625 }, + { VertexAttrib2dvARB_names, VertexAttrib2dvARB_remap_index, 610 }, + { VertexAttrib2fvARB_names, VertexAttrib2fvARB_remap_index, 612 }, + { VertexAttrib4NivARB_names, VertexAttrib4NivARB_remap_index, 661 }, + { GetProgramStringARB_names, GetProgramStringARB_remap_index, 681 }, + { VertexAttrib4NuivARB_names, VertexAttrib4NuivARB_remap_index, 663 }, + { IsProgramNV_names, IsProgramNV_remap_index, 592 }, + { ProgramEnvParameter4dARB_names, ProgramEnvParameter4dARB_remap_index, 668 }, + { VertexAttrib1dARB_names, VertexAttrib1dARB_remap_index, 603 }, + { VertexAttrib3svARB_names, VertexAttrib3svARB_remap_index, 620 }, + { GetVertexAttribdvARB_names, GetVertexAttribdvARB_remap_index, 588 }, + { VertexAttrib4dvARB_names, VertexAttrib4dvARB_remap_index, 622 }, + { VertexAttribPointerARB_names, VertexAttribPointerARB_remap_index, 664 }, + { VertexAttrib4NsvARB_names, VertexAttrib4NsvARB_remap_index, 660 }, + { VertexAttrib3fvARB_names, VertexAttrib3fvARB_remap_index, 618 }, + { VertexAttrib4NubARB_names, VertexAttrib4NubARB_remap_index, 627 }, + { GetProgramEnvParameterfvARB_names, GetProgramEnvParameterfvARB_remap_index, 677 }, + { ProgramLocalParameter4fvARB_names, ProgramLocalParameter4fvARB_remap_index, 675 }, + { DeleteProgramsNV_names, DeleteProgramsNV_remap_index, 580 }, + { GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, 591 }, + { VertexAttrib4dARB_names, VertexAttrib4dARB_remap_index, 621 }, + { GetProgramLocalParameterdvARB_names, GetProgramLocalParameterdvARB_remap_index, 678 }, + { GetProgramivARB_names, GetProgramivARB_remap_index, 680 }, + { VertexAttrib3sARB_names, VertexAttrib3sARB_remap_index, 619 }, + { ProgramStringARB_names, ProgramStringARB_remap_index, 667 }, + { ProgramLocalParameter4fARB_names, ProgramLocalParameter4fARB_remap_index, 674 }, + { EnableVertexAttribArrayARB_names, EnableVertexAttribArrayARB_remap_index, 665 }, + { VertexAttrib4uivARB_names, VertexAttrib4uivARB_remap_index, 658 }, + { BindProgramNV_names, BindProgramNV_remap_index, 579 }, + { VertexAttrib4svARB_names, VertexAttrib4svARB_remap_index, 626 }, + { VertexAttrib2svARB_names, VertexAttrib2svARB_remap_index, 614 }, + { VertexAttrib4NubvARB_names, VertexAttrib4NubvARB_remap_index, 628 }, + { GetProgramEnvParameterdvARB_names, GetProgramEnvParameterdvARB_remap_index, 676 }, + { VertexAttrib2sARB_names, VertexAttrib2sARB_remap_index, 613 }, + { VertexAttrib1fvARB_names, VertexAttrib1fvARB_remap_index, 606 }, + { GenProgramsNV_names, GenProgramsNV_remap_index, 582 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_ARB_vertex_shader) static const struct dri_extension_function GL_ARB_vertex_shader_functions[] = { - { GetActiveAttribARB_names, 751 }, - { GetAttribLocationARB_names, 752 }, - { BindAttribLocationARB_names, 750 }, - { NULL, 0 } + { GetActiveAttribARB_names, GetActiveAttribARB_remap_index, 751 }, + { GetAttribLocationARB_names, GetAttribLocationARB_remap_index, 752 }, + { BindAttribLocationARB_names, BindAttribLocationARB_remap_index, 750 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_ARB_window_pos) static const struct dri_extension_function GL_ARB_window_pos_functions[] = { - { WindowPos3fMESA_names, 523 }, - { WindowPos2dvMESA_names, 514 }, - { WindowPos2svMESA_names, 520 }, - { WindowPos3dMESA_names, 521 }, - { WindowPos2fvMESA_names, 516 }, - { WindowPos2dMESA_names, 513 }, - { WindowPos3dvMESA_names, 522 }, - { WindowPos3fvMESA_names, 524 }, - { WindowPos2iMESA_names, 517 }, - { WindowPos3sMESA_names, 527 }, - { WindowPos2ivMESA_names, 518 }, - { WindowPos2sMESA_names, 519 }, - { WindowPos3iMESA_names, 525 }, - { WindowPos3ivMESA_names, 526 }, - { WindowPos3svMESA_names, 528 }, - { WindowPos2fMESA_names, 515 }, - { NULL, 0 } + { WindowPos3fMESA_names, WindowPos3fMESA_remap_index, 523 }, + { WindowPos2dvMESA_names, WindowPos2dvMESA_remap_index, 514 }, + { WindowPos2svMESA_names, WindowPos2svMESA_remap_index, 520 }, + { WindowPos3dMESA_names, WindowPos3dMESA_remap_index, 521 }, + { WindowPos2fvMESA_names, WindowPos2fvMESA_remap_index, 516 }, + { WindowPos2dMESA_names, WindowPos2dMESA_remap_index, 513 }, + { WindowPos3dvMESA_names, WindowPos3dvMESA_remap_index, 522 }, + { WindowPos3fvMESA_names, WindowPos3fvMESA_remap_index, 524 }, + { WindowPos2iMESA_names, WindowPos2iMESA_remap_index, 517 }, + { WindowPos3sMESA_names, WindowPos3sMESA_remap_index, 527 }, + { WindowPos2ivMESA_names, WindowPos2ivMESA_remap_index, 518 }, + { WindowPos2sMESA_names, WindowPos2sMESA_remap_index, 519 }, + { WindowPos3iMESA_names, WindowPos3iMESA_remap_index, 525 }, + { WindowPos3ivMESA_names, WindowPos3ivMESA_remap_index, 526 }, + { WindowPos3svMESA_names, WindowPos3svMESA_remap_index, 528 }, + { WindowPos2fMESA_names, WindowPos2fMESA_remap_index, 515 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_ATI_blend_equation_separate) static const struct dri_extension_function GL_ATI_blend_equation_separate_functions[] = { - { BlendEquationSeparateEXT_names, 710 }, - { NULL, 0 } + { BlendEquationSeparateEXT_names, BlendEquationSeparateEXT_remap_index, 710 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_ATI_draw_buffers) static const struct dri_extension_function GL_ATI_draw_buffers_functions[] = { - { DrawBuffersARB_names, 413 }, - { NULL, 0 } + { DrawBuffersARB_names, DrawBuffersARB_remap_index, 413 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_ATI_fragment_shader) static const struct dri_extension_function GL_ATI_fragment_shader_functions[] = { - { ColorFragmentOp3ATI_names, 791 }, - { ColorFragmentOp2ATI_names, 790 }, - { DeleteFragmentShaderATI_names, 784 }, - { SetFragmentShaderConstantATI_names, 795 }, - { SampleMapATI_names, 788 }, - { AlphaFragmentOp2ATI_names, 793 }, - { AlphaFragmentOp1ATI_names, 792 }, - { ColorFragmentOp1ATI_names, 789 }, - { AlphaFragmentOp3ATI_names, 794 }, - { PassTexCoordATI_names, 787 }, - { BeginFragmentShaderATI_names, 785 }, - { BindFragmentShaderATI_names, 783 }, - { GenFragmentShadersATI_names, 782 }, - { EndFragmentShaderATI_names, 786 }, - { NULL, 0 } + { ColorFragmentOp3ATI_names, ColorFragmentOp3ATI_remap_index, 791 }, + { ColorFragmentOp2ATI_names, ColorFragmentOp2ATI_remap_index, 790 }, + { DeleteFragmentShaderATI_names, DeleteFragmentShaderATI_remap_index, 784 }, + { SetFragmentShaderConstantATI_names, SetFragmentShaderConstantATI_remap_index, 795 }, + { SampleMapATI_names, SampleMapATI_remap_index, 788 }, + { AlphaFragmentOp2ATI_names, AlphaFragmentOp2ATI_remap_index, 793 }, + { AlphaFragmentOp1ATI_names, AlphaFragmentOp1ATI_remap_index, 792 }, + { ColorFragmentOp1ATI_names, ColorFragmentOp1ATI_remap_index, 789 }, + { AlphaFragmentOp3ATI_names, AlphaFragmentOp3ATI_remap_index, 794 }, + { PassTexCoordATI_names, PassTexCoordATI_remap_index, 787 }, + { BeginFragmentShaderATI_names, BeginFragmentShaderATI_remap_index, 785 }, + { BindFragmentShaderATI_names, BindFragmentShaderATI_remap_index, 783 }, + { GenFragmentShadersATI_names, GenFragmentShadersATI_remap_index, 782 }, + { EndFragmentShaderATI_names, EndFragmentShaderATI_remap_index, 786 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_blend_color) static const struct dri_extension_function GL_EXT_blend_color_functions[] = { - { BlendColor_names, 336 }, - { NULL, 0 } + { BlendColor_names, -1, 336 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_blend_equation_separate) static const struct dri_extension_function GL_EXT_blend_equation_separate_functions[] = { - { BlendEquationSeparateEXT_names, 710 }, - { NULL, 0 } + { BlendEquationSeparateEXT_names, BlendEquationSeparateEXT_remap_index, 710 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_blend_func_separate) static const struct dri_extension_function GL_EXT_blend_func_separate_functions[] = { - { BlendFuncSeparateEXT_names, 537 }, - { NULL, 0 } + { BlendFuncSeparateEXT_names, BlendFuncSeparateEXT_remap_index, 537 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_blend_minmax) static const struct dri_extension_function GL_EXT_blend_minmax_functions[] = { - { BlendEquation_names, 337 }, - { NULL, 0 } + { BlendEquation_names, -1, 337 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_color_subtable) static const struct dri_extension_function GL_EXT_color_subtable_functions[] = { - { ColorSubTable_names, 346 }, - { CopyColorSubTable_names, 347 }, - { NULL, 0 } + { ColorSubTable_names, -1, 346 }, + { CopyColorSubTable_names, -1, 347 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_compiled_vertex_array) static const struct dri_extension_function GL_EXT_compiled_vertex_array_functions[] = { - { UnlockArraysEXT_names, 541 }, - { LockArraysEXT_names, 540 }, - { NULL, 0 } + { UnlockArraysEXT_names, UnlockArraysEXT_remap_index, 541 }, + { LockArraysEXT_names, LockArraysEXT_remap_index, 540 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_convolution) static const struct dri_extension_function GL_EXT_convolution_functions[] = { - { ConvolutionFilter1D_names, 348 }, - { CopyConvolutionFilter1D_names, 354 }, - { ConvolutionFilter2D_names, 349 }, - { ConvolutionParameteriv_names, 353 }, - { ConvolutionParameterfv_names, 351 }, - { GetSeparableFilterEXT_names, 426 }, - { GetConvolutionFilterEXT_names, 423 }, - { GetConvolutionParameterfvEXT_names, 424 }, - { SeparableFilter2D_names, 360 }, - { ConvolutionParameteri_names, 352 }, - { ConvolutionParameterf_names, 350 }, - { GetConvolutionParameterivEXT_names, 425 }, - { CopyConvolutionFilter2D_names, 355 }, - { NULL, 0 } + { ConvolutionFilter1D_names, -1, 348 }, + { CopyConvolutionFilter1D_names, -1, 354 }, + { ConvolutionFilter2D_names, -1, 349 }, + { ConvolutionParameteriv_names, -1, 353 }, + { ConvolutionParameterfv_names, -1, 351 }, + { GetSeparableFilterEXT_names, GetSeparableFilterEXT_remap_index, 426 }, + { GetConvolutionFilterEXT_names, GetConvolutionFilterEXT_remap_index, 423 }, + { GetConvolutionParameterfvEXT_names, GetConvolutionParameterfvEXT_remap_index, 424 }, + { SeparableFilter2D_names, -1, 360 }, + { ConvolutionParameteri_names, -1, 352 }, + { ConvolutionParameterf_names, -1, 350 }, + { GetConvolutionParameterivEXT_names, GetConvolutionParameterivEXT_remap_index, 425 }, + { CopyConvolutionFilter2D_names, -1, 355 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_coordinate_frame) static const struct dri_extension_function GL_EXT_coordinate_frame_functions[] = { - { Binormal3fEXT_names, -1 }, - { TangentPointerEXT_names, -1 }, - { Binormal3ivEXT_names, -1 }, - { Tangent3sEXT_names, -1 }, - { Tangent3fvEXT_names, -1 }, - { Tangent3dvEXT_names, -1 }, - { Binormal3bvEXT_names, -1 }, - { Binormal3dEXT_names, -1 }, - { Tangent3fEXT_names, -1 }, - { Binormal3sEXT_names, -1 }, - { Tangent3ivEXT_names, -1 }, - { Tangent3dEXT_names, -1 }, - { Binormal3svEXT_names, -1 }, - { Binormal3dvEXT_names, -1 }, - { Tangent3iEXT_names, -1 }, - { Tangent3bvEXT_names, -1 }, - { Binormal3fvEXT_names, -1 }, - { Tangent3bEXT_names, -1 }, - { BinormalPointerEXT_names, -1 }, - { Tangent3svEXT_names, -1 }, - { Binormal3bEXT_names, -1 }, - { Binormal3iEXT_names, -1 }, - { NULL, 0 } + { Binormal3fEXT_names, Binormal3fEXT_remap_index, -1 }, + { TangentPointerEXT_names, TangentPointerEXT_remap_index, -1 }, + { Binormal3ivEXT_names, Binormal3ivEXT_remap_index, -1 }, + { Tangent3sEXT_names, Tangent3sEXT_remap_index, -1 }, + { Tangent3fvEXT_names, Tangent3fvEXT_remap_index, -1 }, + { Tangent3dvEXT_names, Tangent3dvEXT_remap_index, -1 }, + { Binormal3bvEXT_names, Binormal3bvEXT_remap_index, -1 }, + { Binormal3dEXT_names, Binormal3dEXT_remap_index, -1 }, + { Tangent3fEXT_names, Tangent3fEXT_remap_index, -1 }, + { Binormal3sEXT_names, Binormal3sEXT_remap_index, -1 }, + { Tangent3ivEXT_names, Tangent3ivEXT_remap_index, -1 }, + { Tangent3dEXT_names, Tangent3dEXT_remap_index, -1 }, + { Binormal3svEXT_names, Binormal3svEXT_remap_index, -1 }, + { Binormal3dvEXT_names, Binormal3dvEXT_remap_index, -1 }, + { Tangent3iEXT_names, Tangent3iEXT_remap_index, -1 }, + { Tangent3bvEXT_names, Tangent3bvEXT_remap_index, -1 }, + { Binormal3fvEXT_names, Binormal3fvEXT_remap_index, -1 }, + { Tangent3bEXT_names, Tangent3bEXT_remap_index, -1 }, + { BinormalPointerEXT_names, BinormalPointerEXT_remap_index, -1 }, + { Tangent3svEXT_names, Tangent3svEXT_remap_index, -1 }, + { Binormal3bEXT_names, Binormal3bEXT_remap_index, -1 }, + { Binormal3iEXT_names, Binormal3iEXT_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_copy_texture) static const struct dri_extension_function GL_EXT_copy_texture_functions[] = { - { CopyTexSubImage3D_names, 373 }, - { CopyTexImage2D_names, 324 }, - { CopyTexImage1D_names, 323 }, - { CopyTexSubImage2D_names, 326 }, - { CopyTexSubImage1D_names, 325 }, - { NULL, 0 } + { CopyTexSubImage3D_names, -1, 373 }, + { CopyTexImage2D_names, -1, 324 }, + { CopyTexImage1D_names, -1, 323 }, + { CopyTexSubImage2D_names, -1, 326 }, + { CopyTexSubImage1D_names, -1, 325 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_cull_vertex) static const struct dri_extension_function GL_EXT_cull_vertex_functions[] = { - { CullParameterdvEXT_names, 542 }, - { CullParameterfvEXT_names, 543 }, - { NULL, 0 } + { CullParameterdvEXT_names, CullParameterdvEXT_remap_index, 542 }, + { CullParameterfvEXT_names, CullParameterfvEXT_remap_index, 543 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_depth_bounds_test) static const struct dri_extension_function GL_EXT_depth_bounds_test_functions[] = { - { DepthBoundsEXT_names, 699 }, - { NULL, 0 } + { DepthBoundsEXT_names, DepthBoundsEXT_remap_index, 699 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_draw_range_elements) static const struct dri_extension_function GL_EXT_draw_range_elements_functions[] = { - { DrawRangeElements_names, 338 }, - { NULL, 0 } + { DrawRangeElements_names, -1, 338 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_fog_coord) static const struct dri_extension_function GL_EXT_fog_coord_functions[] = { - { FogCoorddEXT_names, 547 }, - { FogCoordfEXT_names, 545 }, - { FogCoordPointerEXT_names, 549 }, - { FogCoordfvEXT_names, 546 }, - { FogCoorddvEXT_names, 548 }, - { NULL, 0 } + { FogCoorddEXT_names, FogCoorddEXT_remap_index, 547 }, + { FogCoordfEXT_names, FogCoordfEXT_remap_index, 545 }, + { FogCoordPointerEXT_names, FogCoordPointerEXT_remap_index, 549 }, + { FogCoordfvEXT_names, FogCoordfvEXT_remap_index, 546 }, + { FogCoorddvEXT_names, FogCoorddvEXT_remap_index, 548 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_framebuffer_object) static const struct dri_extension_function GL_EXT_framebuffer_object_functions[] = { - { GenerateMipmapEXT_names, 812 }, - { IsRenderbufferEXT_names, 796 }, - { RenderbufferStorageEXT_names, 800 }, - { CheckFramebufferStatusEXT_names, 806 }, - { DeleteRenderbuffersEXT_names, 798 }, - { FramebufferTexture3DEXT_names, 809 }, - { FramebufferRenderbufferEXT_names, 810 }, - { FramebufferTexture1DEXT_names, 807 }, - { BindFramebufferEXT_names, 803 }, - { GenRenderbuffersEXT_names, 799 }, - { IsFramebufferEXT_names, 802 }, - { FramebufferTexture2DEXT_names, 808 }, - { GetFramebufferAttachmentParameterivEXT_names, 811 }, - { DeleteFramebuffersEXT_names, 804 }, - { GenFramebuffersEXT_names, 805 }, - { BindRenderbufferEXT_names, 797 }, - { GetRenderbufferParameterivEXT_names, 801 }, - { NULL, 0 } + { GenerateMipmapEXT_names, GenerateMipmapEXT_remap_index, 812 }, + { IsRenderbufferEXT_names, IsRenderbufferEXT_remap_index, 796 }, + { RenderbufferStorageEXT_names, RenderbufferStorageEXT_remap_index, 800 }, + { CheckFramebufferStatusEXT_names, CheckFramebufferStatusEXT_remap_index, 806 }, + { DeleteRenderbuffersEXT_names, DeleteRenderbuffersEXT_remap_index, 798 }, + { FramebufferTexture3DEXT_names, FramebufferTexture3DEXT_remap_index, 809 }, + { FramebufferRenderbufferEXT_names, FramebufferRenderbufferEXT_remap_index, 810 }, + { FramebufferTexture1DEXT_names, FramebufferTexture1DEXT_remap_index, 807 }, + { BindFramebufferEXT_names, BindFramebufferEXT_remap_index, 803 }, + { GenRenderbuffersEXT_names, GenRenderbuffersEXT_remap_index, 799 }, + { IsFramebufferEXT_names, IsFramebufferEXT_remap_index, 802 }, + { FramebufferTexture2DEXT_names, FramebufferTexture2DEXT_remap_index, 808 }, + { GetFramebufferAttachmentParameterivEXT_names, GetFramebufferAttachmentParameterivEXT_remap_index, 811 }, + { DeleteFramebuffersEXT_names, DeleteFramebuffersEXT_remap_index, 804 }, + { GenFramebuffersEXT_names, GenFramebuffersEXT_remap_index, 805 }, + { BindRenderbufferEXT_names, BindRenderbufferEXT_remap_index, 797 }, + { GetRenderbufferParameterivEXT_names, GetRenderbufferParameterivEXT_remap_index, 801 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_histogram) static const struct dri_extension_function GL_EXT_histogram_functions[] = { - { Histogram_names, 367 }, - { GetHistogramParameterivEXT_names, 419 }, - { ResetHistogram_names, 369 }, - { GetMinmaxEXT_names, 420 }, - { GetHistogramParameterfvEXT_names, 418 }, - { GetHistogramEXT_names, 417 }, - { GetMinmaxParameterfvEXT_names, 421 }, - { ResetMinmax_names, 370 }, - { GetMinmaxParameterivEXT_names, 422 }, - { Minmax_names, 368 }, - { NULL, 0 } + { Histogram_names, -1, 367 }, + { GetHistogramParameterivEXT_names, GetHistogramParameterivEXT_remap_index, 419 }, + { ResetHistogram_names, -1, 369 }, + { GetMinmaxEXT_names, GetMinmaxEXT_remap_index, 420 }, + { GetHistogramParameterfvEXT_names, GetHistogramParameterfvEXT_remap_index, 418 }, + { GetHistogramEXT_names, GetHistogramEXT_remap_index, 417 }, + { GetMinmaxParameterfvEXT_names, GetMinmaxParameterfvEXT_remap_index, 421 }, + { ResetMinmax_names, -1, 370 }, + { GetMinmaxParameterivEXT_names, GetMinmaxParameterivEXT_remap_index, 422 }, + { Minmax_names, -1, 368 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_index_func) static const struct dri_extension_function GL_EXT_index_func_functions[] = { - { IndexFuncEXT_names, 539 }, - { NULL, 0 } + { IndexFuncEXT_names, IndexFuncEXT_remap_index, 539 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_index_material) static const struct dri_extension_function GL_EXT_index_material_functions[] = { - { IndexMaterialEXT_names, 538 }, - { NULL, 0 } + { IndexMaterialEXT_names, IndexMaterialEXT_remap_index, 538 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_light_texture) static const struct dri_extension_function GL_EXT_light_texture_functions[] = { - { ApplyTextureEXT_names, -1 }, - { TextureMaterialEXT_names, -1 }, - { TextureLightEXT_names, -1 }, - { NULL, 0 } + { ApplyTextureEXT_names, ApplyTextureEXT_remap_index, -1 }, + { TextureMaterialEXT_names, TextureMaterialEXT_remap_index, -1 }, + { TextureLightEXT_names, TextureLightEXT_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_multi_draw_arrays) static const struct dri_extension_function GL_EXT_multi_draw_arrays_functions[] = { - { MultiDrawElementsEXT_names, 645 }, - { MultiDrawArraysEXT_names, 644 }, - { NULL, 0 } + { MultiDrawElementsEXT_names, MultiDrawElementsEXT_remap_index, 645 }, + { MultiDrawArraysEXT_names, MultiDrawArraysEXT_remap_index, 644 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_multisample) static const struct dri_extension_function GL_EXT_multisample_functions[] = { - { SampleMaskSGIS_names, 446 }, - { SamplePatternSGIS_names, 447 }, - { NULL, 0 } + { SampleMaskSGIS_names, SampleMaskSGIS_remap_index, 446 }, + { SamplePatternSGIS_names, SamplePatternSGIS_remap_index, 447 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_paletted_texture) static const struct dri_extension_function GL_EXT_paletted_texture_functions[] = { - { GetColorTableParameterivEXT_names, 551 }, - { GetColorTableEXT_names, 550 }, - { ColorTable_names, 339 }, - { GetColorTableParameterfvEXT_names, 552 }, - { NULL, 0 } + { GetColorTableParameterivEXT_names, GetColorTableParameterivEXT_remap_index, 551 }, + { GetColorTableEXT_names, GetColorTableEXT_remap_index, 550 }, + { ColorTable_names, -1, 339 }, + { GetColorTableParameterfvEXT_names, GetColorTableParameterfvEXT_remap_index, 552 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_pixel_transform) static const struct dri_extension_function GL_EXT_pixel_transform_functions[] = { - { PixelTransformParameterfvEXT_names, -1 }, - { PixelTransformParameteriEXT_names, -1 }, - { PixelTransformParameterfEXT_names, -1 }, - { PixelTransformParameterivEXT_names, -1 }, - { NULL, 0 } + { PixelTransformParameterfvEXT_names, PixelTransformParameterfvEXT_remap_index, -1 }, + { PixelTransformParameteriEXT_names, PixelTransformParameteriEXT_remap_index, -1 }, + { PixelTransformParameterfEXT_names, PixelTransformParameterfEXT_remap_index, -1 }, + { PixelTransformParameterivEXT_names, PixelTransformParameterivEXT_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_point_parameters) static const struct dri_extension_function GL_EXT_point_parameters_functions[] = { - { PointParameterfEXT_names, 458 }, - { PointParameterfvEXT_names, 459 }, - { NULL, 0 } + { PointParameterfEXT_names, PointParameterfEXT_remap_index, 458 }, + { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, 459 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_polygon_offset) static const struct dri_extension_function GL_EXT_polygon_offset_functions[] = { - { PolygonOffsetEXT_names, 414 }, - { NULL, 0 } + { PolygonOffsetEXT_names, PolygonOffsetEXT_remap_index, 414 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_secondary_color) static const struct dri_extension_function GL_EXT_secondary_color_functions[] = { - { SecondaryColor3iEXT_names, 567 }, - { SecondaryColor3bEXT_names, 561 }, - { SecondaryColor3bvEXT_names, 562 }, - { SecondaryColor3sEXT_names, 569 }, - { SecondaryColor3dEXT_names, 563 }, - { SecondaryColorPointerEXT_names, 577 }, - { SecondaryColor3uiEXT_names, 573 }, - { SecondaryColor3usvEXT_names, 576 }, - { SecondaryColor3ivEXT_names, 568 }, - { SecondaryColor3fvEXT_names, 566 }, - { SecondaryColor3ubvEXT_names, 572 }, - { SecondaryColor3uivEXT_names, 574 }, - { SecondaryColor3dvEXT_names, 564 }, - { SecondaryColor3usEXT_names, 575 }, - { SecondaryColor3ubEXT_names, 571 }, - { SecondaryColor3fEXT_names, 565 }, - { SecondaryColor3svEXT_names, 570 }, - { NULL, 0 } + { SecondaryColor3iEXT_names, SecondaryColor3iEXT_remap_index, 567 }, + { SecondaryColor3bEXT_names, SecondaryColor3bEXT_remap_index, 561 }, + { SecondaryColor3bvEXT_names, SecondaryColor3bvEXT_remap_index, 562 }, + { SecondaryColor3sEXT_names, SecondaryColor3sEXT_remap_index, 569 }, + { SecondaryColor3dEXT_names, SecondaryColor3dEXT_remap_index, 563 }, + { SecondaryColorPointerEXT_names, SecondaryColorPointerEXT_remap_index, 577 }, + { SecondaryColor3uiEXT_names, SecondaryColor3uiEXT_remap_index, 573 }, + { SecondaryColor3usvEXT_names, SecondaryColor3usvEXT_remap_index, 576 }, + { SecondaryColor3ivEXT_names, SecondaryColor3ivEXT_remap_index, 568 }, + { SecondaryColor3fvEXT_names, SecondaryColor3fvEXT_remap_index, 566 }, + { SecondaryColor3ubvEXT_names, SecondaryColor3ubvEXT_remap_index, 572 }, + { SecondaryColor3uivEXT_names, SecondaryColor3uivEXT_remap_index, 574 }, + { SecondaryColor3dvEXT_names, SecondaryColor3dvEXT_remap_index, 564 }, + { SecondaryColor3usEXT_names, SecondaryColor3usEXT_remap_index, 575 }, + { SecondaryColor3ubEXT_names, SecondaryColor3ubEXT_remap_index, 571 }, + { SecondaryColor3fEXT_names, SecondaryColor3fEXT_remap_index, 565 }, + { SecondaryColor3svEXT_names, SecondaryColor3svEXT_remap_index, 570 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_stencil_two_side) static const struct dri_extension_function GL_EXT_stencil_two_side_functions[] = { - { ActiveStencilFaceEXT_names, 646 }, - { NULL, 0 } + { ActiveStencilFaceEXT_names, ActiveStencilFaceEXT_remap_index, 646 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_subtexture) static const struct dri_extension_function GL_EXT_subtexture_functions[] = { - { TexSubImage1D_names, 332 }, - { TexSubImage2D_names, 333 }, - { NULL, 0 } + { TexSubImage1D_names, -1, 332 }, + { TexSubImage2D_names, -1, 333 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_texture3D) static const struct dri_extension_function GL_EXT_texture3D_functions[] = { - { TexImage3D_names, 371 }, - { TexSubImage3D_names, 372 }, - { NULL, 0 } + { TexImage3D_names, -1, 371 }, + { TexSubImage3D_names, -1, 372 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_texture_object) static const struct dri_extension_function GL_EXT_texture_object_functions[] = { - { PrioritizeTextures_names, 331 }, - { DeleteTextures_names, 327 }, - { GenTexturesEXT_names, 440 }, - { AreTexturesResidentEXT_names, 439 }, - { BindTexture_names, 307 }, - { IsTextureEXT_names, 441 }, - { NULL, 0 } + { PrioritizeTextures_names, -1, 331 }, + { DeleteTextures_names, -1, 327 }, + { GenTexturesEXT_names, GenTexturesEXT_remap_index, 440 }, + { AreTexturesResidentEXT_names, AreTexturesResidentEXT_remap_index, 439 }, + { BindTexture_names, -1, 307 }, + { IsTextureEXT_names, IsTextureEXT_remap_index, 441 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_texture_perturb_normal) static const struct dri_extension_function GL_EXT_texture_perturb_normal_functions[] = { - { TextureNormalEXT_names, -1 }, - { NULL, 0 } + { TextureNormalEXT_names, TextureNormalEXT_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_vertex_array) static const struct dri_extension_function GL_EXT_vertex_array_functions[] = { - { IndexPointerEXT_names, 450 }, - { NormalPointerEXT_names, 451 }, - { VertexPointerEXT_names, 453 }, - { TexCoordPointerEXT_names, 452 }, - { EdgeFlagPointerEXT_names, 449 }, - { ArrayElement_names, 306 }, - { ColorPointerEXT_names, 448 }, - { GetPointerv_names, 329 }, - { DrawArrays_names, 310 }, - { NULL, 0 } + { IndexPointerEXT_names, IndexPointerEXT_remap_index, 450 }, + { NormalPointerEXT_names, NormalPointerEXT_remap_index, 451 }, + { VertexPointerEXT_names, VertexPointerEXT_remap_index, 453 }, + { TexCoordPointerEXT_names, TexCoordPointerEXT_remap_index, 452 }, + { EdgeFlagPointerEXT_names, EdgeFlagPointerEXT_remap_index, 449 }, + { ArrayElement_names, -1, 306 }, + { ColorPointerEXT_names, ColorPointerEXT_remap_index, 448 }, + { GetPointerv_names, -1, 329 }, + { DrawArrays_names, -1, 310 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_EXT_vertex_weighting) static const struct dri_extension_function GL_EXT_vertex_weighting_functions[] = { - { VertexWeightfvEXT_names, 495 }, - { VertexWeightfEXT_names, 494 }, - { VertexWeightPointerEXT_names, 496 }, - { NULL, 0 } + { VertexWeightfvEXT_names, VertexWeightfvEXT_remap_index, 495 }, + { VertexWeightfEXT_names, VertexWeightfEXT_remap_index, 494 }, + { VertexWeightPointerEXT_names, VertexWeightPointerEXT_remap_index, 496 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_HP_image_transform) static const struct dri_extension_function GL_HP_image_transform_functions[] = { - { GetImageTransformParameterfvHP_names, -1 }, - { ImageTransformParameterfHP_names, -1 }, - { ImageTransformParameterfvHP_names, -1 }, - { ImageTransformParameteriHP_names, -1 }, - { GetImageTransformParameterivHP_names, -1 }, - { ImageTransformParameterivHP_names, -1 }, - { NULL, 0 } + { GetImageTransformParameterfvHP_names, GetImageTransformParameterfvHP_remap_index, -1 }, + { ImageTransformParameterfHP_names, ImageTransformParameterfHP_remap_index, -1 }, + { ImageTransformParameterfvHP_names, ImageTransformParameterfvHP_remap_index, -1 }, + { ImageTransformParameteriHP_names, ImageTransformParameteriHP_remap_index, -1 }, + { GetImageTransformParameterivHP_names, GetImageTransformParameterivHP_remap_index, -1 }, + { ImageTransformParameterivHP_names, ImageTransformParameterivHP_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_IBM_multimode_draw_arrays) static const struct dri_extension_function GL_IBM_multimode_draw_arrays_functions[] = { - { MultiModeDrawArraysIBM_names, 708 }, - { MultiModeDrawElementsIBM_names, 709 }, - { NULL, 0 } + { MultiModeDrawArraysIBM_names, MultiModeDrawArraysIBM_remap_index, 708 }, + { MultiModeDrawElementsIBM_names, MultiModeDrawElementsIBM_remap_index, 709 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_IBM_vertex_array_lists) static const struct dri_extension_function GL_IBM_vertex_array_lists_functions[] = { - { SecondaryColorPointerListIBM_names, -1 }, - { NormalPointerListIBM_names, -1 }, - { FogCoordPointerListIBM_names, -1 }, - { VertexPointerListIBM_names, -1 }, - { ColorPointerListIBM_names, -1 }, - { TexCoordPointerListIBM_names, -1 }, - { IndexPointerListIBM_names, -1 }, - { EdgeFlagPointerListIBM_names, -1 }, - { NULL, 0 } + { SecondaryColorPointerListIBM_names, SecondaryColorPointerListIBM_remap_index, -1 }, + { NormalPointerListIBM_names, NormalPointerListIBM_remap_index, -1 }, + { FogCoordPointerListIBM_names, FogCoordPointerListIBM_remap_index, -1 }, + { VertexPointerListIBM_names, VertexPointerListIBM_remap_index, -1 }, + { ColorPointerListIBM_names, ColorPointerListIBM_remap_index, -1 }, + { TexCoordPointerListIBM_names, TexCoordPointerListIBM_remap_index, -1 }, + { IndexPointerListIBM_names, IndexPointerListIBM_remap_index, -1 }, + { EdgeFlagPointerListIBM_names, EdgeFlagPointerListIBM_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_INGR_blend_func_separate) static const struct dri_extension_function GL_INGR_blend_func_separate_functions[] = { - { BlendFuncSeparateEXT_names, 537 }, - { NULL, 0 } + { BlendFuncSeparateEXT_names, BlendFuncSeparateEXT_remap_index, 537 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_INTEL_parallel_arrays) static const struct dri_extension_function GL_INTEL_parallel_arrays_functions[] = { - { VertexPointervINTEL_names, -1 }, - { ColorPointervINTEL_names, -1 }, - { NormalPointervINTEL_names, -1 }, - { TexCoordPointervINTEL_names, -1 }, - { NULL, 0 } + { VertexPointervINTEL_names, VertexPointervINTEL_remap_index, -1 }, + { ColorPointervINTEL_names, ColorPointervINTEL_remap_index, -1 }, + { NormalPointervINTEL_names, NormalPointervINTEL_remap_index, -1 }, + { TexCoordPointervINTEL_names, TexCoordPointervINTEL_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_MESA_resize_buffers) static const struct dri_extension_function GL_MESA_resize_buffers_functions[] = { - { ResizeBuffersMESA_names, 512 }, - { NULL, 0 } + { ResizeBuffersMESA_names, ResizeBuffersMESA_remap_index, 512 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_MESA_window_pos) static const struct dri_extension_function GL_MESA_window_pos_functions[] = { - { WindowPos3fMESA_names, 523 }, - { WindowPos2dvMESA_names, 514 }, - { WindowPos4svMESA_names, 536 }, - { WindowPos2svMESA_names, 520 }, - { WindowPos3dMESA_names, 521 }, - { WindowPos2fvMESA_names, 516 }, - { WindowPos4dMESA_names, 529 }, - { WindowPos2dMESA_names, 513 }, - { WindowPos4ivMESA_names, 534 }, - { WindowPos4fMESA_names, 531 }, - { WindowPos3dvMESA_names, 522 }, - { WindowPos3fvMESA_names, 524 }, - { WindowPos4dvMESA_names, 530 }, - { WindowPos2iMESA_names, 517 }, - { WindowPos3sMESA_names, 527 }, - { WindowPos4sMESA_names, 535 }, - { WindowPos2ivMESA_names, 518 }, - { WindowPos2sMESA_names, 519 }, - { WindowPos3iMESA_names, 525 }, - { WindowPos3ivMESA_names, 526 }, - { WindowPos4iMESA_names, 533 }, - { WindowPos4fvMESA_names, 532 }, - { WindowPos3svMESA_names, 528 }, - { WindowPos2fMESA_names, 515 }, - { NULL, 0 } + { WindowPos3fMESA_names, WindowPos3fMESA_remap_index, 523 }, + { WindowPos2dvMESA_names, WindowPos2dvMESA_remap_index, 514 }, + { WindowPos4svMESA_names, WindowPos4svMESA_remap_index, 536 }, + { WindowPos2svMESA_names, WindowPos2svMESA_remap_index, 520 }, + { WindowPos3dMESA_names, WindowPos3dMESA_remap_index, 521 }, + { WindowPos2fvMESA_names, WindowPos2fvMESA_remap_index, 516 }, + { WindowPos4dMESA_names, WindowPos4dMESA_remap_index, 529 }, + { WindowPos2dMESA_names, WindowPos2dMESA_remap_index, 513 }, + { WindowPos4ivMESA_names, WindowPos4ivMESA_remap_index, 534 }, + { WindowPos4fMESA_names, WindowPos4fMESA_remap_index, 531 }, + { WindowPos3dvMESA_names, WindowPos3dvMESA_remap_index, 522 }, + { WindowPos3fvMESA_names, WindowPos3fvMESA_remap_index, 524 }, + { WindowPos4dvMESA_names, WindowPos4dvMESA_remap_index, 530 }, + { WindowPos2iMESA_names, WindowPos2iMESA_remap_index, 517 }, + { WindowPos3sMESA_names, WindowPos3sMESA_remap_index, 527 }, + { WindowPos4sMESA_names, WindowPos4sMESA_remap_index, 535 }, + { WindowPos2ivMESA_names, WindowPos2ivMESA_remap_index, 518 }, + { WindowPos2sMESA_names, WindowPos2sMESA_remap_index, 519 }, + { WindowPos3iMESA_names, WindowPos3iMESA_remap_index, 525 }, + { WindowPos3ivMESA_names, WindowPos3ivMESA_remap_index, 526 }, + { WindowPos4iMESA_names, WindowPos4iMESA_remap_index, 533 }, + { WindowPos4fvMESA_names, WindowPos4fvMESA_remap_index, 532 }, + { WindowPos3svMESA_names, WindowPos3svMESA_remap_index, 528 }, + { WindowPos2fMESA_names, WindowPos2fMESA_remap_index, 515 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_NV_evaluators) static const struct dri_extension_function GL_NV_evaluators_functions[] = { - { GetMapAttribParameterivNV_names, -1 }, - { MapControlPointsNV_names, -1 }, - { MapParameterfvNV_names, -1 }, - { EvalMapsNV_names, -1 }, - { GetMapAttribParameterfvNV_names, -1 }, - { MapParameterivNV_names, -1 }, - { GetMapParameterivNV_names, -1 }, - { GetMapParameterfvNV_names, -1 }, - { GetMapControlPointsNV_names, -1 }, - { NULL, 0 } + { GetMapAttribParameterivNV_names, GetMapAttribParameterivNV_remap_index, -1 }, + { MapControlPointsNV_names, MapControlPointsNV_remap_index, -1 }, + { MapParameterfvNV_names, MapParameterfvNV_remap_index, -1 }, + { EvalMapsNV_names, EvalMapsNV_remap_index, -1 }, + { GetMapAttribParameterfvNV_names, GetMapAttribParameterfvNV_remap_index, -1 }, + { MapParameterivNV_names, MapParameterivNV_remap_index, -1 }, + { GetMapParameterivNV_names, GetMapParameterivNV_remap_index, -1 }, + { GetMapParameterfvNV_names, GetMapParameterfvNV_remap_index, -1 }, + { GetMapControlPointsNV_names, GetMapControlPointsNV_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_NV_fence) static const struct dri_extension_function GL_NV_fence_functions[] = { - { GenFencesNV_names, 648 }, - { TestFenceNV_names, 650 }, - { IsFenceNV_names, 649 }, - { DeleteFencesNV_names, 647 }, - { SetFenceNV_names, 653 }, - { GetFenceivNV_names, 651 }, - { FinishFenceNV_names, 652 }, - { NULL, 0 } + { GenFencesNV_names, GenFencesNV_remap_index, 648 }, + { TestFenceNV_names, TestFenceNV_remap_index, 650 }, + { IsFenceNV_names, IsFenceNV_remap_index, 649 }, + { DeleteFencesNV_names, DeleteFencesNV_remap_index, 647 }, + { SetFenceNV_names, SetFenceNV_remap_index, 653 }, + { GetFenceivNV_names, GetFenceivNV_remap_index, 651 }, + { FinishFenceNV_names, FinishFenceNV_remap_index, 652 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_NV_fragment_program) static const struct dri_extension_function GL_NV_fragment_program_functions[] = { - { GetProgramNamedParameterdvNV_names, 687 }, - { GetProgramNamedParameterfvNV_names, 686 }, - { ProgramNamedParameter4fNV_names, 682 }, - { ProgramNamedParameter4fvNV_names, 684 }, - { ProgramNamedParameter4dvNV_names, 685 }, - { ProgramNamedParameter4dNV_names, 683 }, - { NULL, 0 } + { GetProgramNamedParameterdvNV_names, GetProgramNamedParameterdvNV_remap_index, 687 }, + { GetProgramNamedParameterfvNV_names, GetProgramNamedParameterfvNV_remap_index, 686 }, + { ProgramNamedParameter4fNV_names, ProgramNamedParameter4fNV_remap_index, 682 }, + { ProgramNamedParameter4fvNV_names, ProgramNamedParameter4fvNV_remap_index, 684 }, + { ProgramNamedParameter4dvNV_names, ProgramNamedParameter4dvNV_remap_index, 685 }, + { ProgramNamedParameter4dNV_names, ProgramNamedParameter4dNV_remap_index, 683 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_NV_point_sprite) static const struct dri_extension_function GL_NV_point_sprite_functions[] = { - { PointParameteriNV_names, 642 }, - { PointParameterivNV_names, 643 }, - { NULL, 0 } + { PointParameteriNV_names, PointParameteriNV_remap_index, 642 }, + { PointParameterivNV_names, PointParameterivNV_remap_index, 643 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_NV_register_combiners) static const struct dri_extension_function GL_NV_register_combiners_functions[] = { - { CombinerParameterfvNV_names, 499 }, - { GetCombinerOutputParameterfvNV_names, 508 }, - { FinalCombinerInputNV_names, 505 }, - { GetCombinerInputParameterfvNV_names, 506 }, - { GetCombinerOutputParameterivNV_names, 509 }, - { CombinerOutputNV_names, 504 }, - { CombinerParameteriNV_names, 502 }, - { GetFinalCombinerInputParameterivNV_names, 511 }, - { CombinerInputNV_names, 503 }, - { CombinerParameterfNV_names, 500 }, - { GetFinalCombinerInputParameterfvNV_names, 510 }, - { GetCombinerInputParameterivNV_names, 507 }, - { CombinerParameterivNV_names, 501 }, - { NULL, 0 } + { CombinerParameterfvNV_names, CombinerParameterfvNV_remap_index, 499 }, + { GetCombinerOutputParameterfvNV_names, GetCombinerOutputParameterfvNV_remap_index, 508 }, + { FinalCombinerInputNV_names, FinalCombinerInputNV_remap_index, 505 }, + { GetCombinerInputParameterfvNV_names, GetCombinerInputParameterfvNV_remap_index, 506 }, + { GetCombinerOutputParameterivNV_names, GetCombinerOutputParameterivNV_remap_index, 509 }, + { CombinerOutputNV_names, CombinerOutputNV_remap_index, 504 }, + { CombinerParameteriNV_names, CombinerParameteriNV_remap_index, 502 }, + { GetFinalCombinerInputParameterivNV_names, GetFinalCombinerInputParameterivNV_remap_index, 511 }, + { CombinerInputNV_names, CombinerInputNV_remap_index, 503 }, + { CombinerParameterfNV_names, CombinerParameterfNV_remap_index, 500 }, + { GetFinalCombinerInputParameterfvNV_names, GetFinalCombinerInputParameterfvNV_remap_index, 510 }, + { GetCombinerInputParameterivNV_names, GetCombinerInputParameterivNV_remap_index, 507 }, + { CombinerParameterivNV_names, CombinerParameterivNV_remap_index, 501 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_NV_register_combiners2) static const struct dri_extension_function GL_NV_register_combiners2_functions[] = { - { CombinerStageParameterfvNV_names, -1 }, - { GetCombinerStageParameterfvNV_names, -1 }, - { NULL, 0 } + { CombinerStageParameterfvNV_names, CombinerStageParameterfvNV_remap_index, -1 }, + { GetCombinerStageParameterfvNV_names, GetCombinerStageParameterfvNV_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_NV_vertex_array_range) static const struct dri_extension_function GL_NV_vertex_array_range_functions[] = { - { FlushVertexArrayRangeNV_names, 497 }, - { VertexArrayRangeNV_names, 498 }, - { NULL, 0 } + { FlushVertexArrayRangeNV_names, FlushVertexArrayRangeNV_remap_index, 497 }, + { VertexArrayRangeNV_names, VertexArrayRangeNV_remap_index, 498 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_NV_vertex_program) static const struct dri_extension_function GL_NV_vertex_program_functions[] = { - { ProgramParameter4fNV_names, 596 }, - { VertexAttrib4ubvNV_names, 781 }, - { VertexAttrib4svNV_names, 779 }, - { VertexAttribs1dvNV_names, 629 }, - { ProgramParameter4dvNV_names, 595 }, - { VertexAttrib4fNV_names, 776 }, - { VertexAttrib2dNV_names, 762 }, - { VertexAttrib4ubNV_names, 780 }, - { VertexAttribs3dvNV_names, 635 }, - { VertexAttribs4fvNV_names, 639 }, - { VertexAttrib2sNV_names, 766 }, - { VertexAttribs3fvNV_names, 636 }, - { ProgramParameter4dNV_names, 594 }, - { LoadProgramNV_names, 593 }, - { VertexAttrib4fvNV_names, 777 }, - { VertexAttrib3fNV_names, 770 }, - { VertexAttribs2dvNV_names, 632 }, - { GetProgramParameterfvNV_names, 584 }, - { VertexAttrib3dNV_names, 768 }, - { VertexAttrib2fvNV_names, 765 }, - { VertexAttrib2dvNV_names, 763 }, - { VertexAttrib1dvNV_names, 757 }, - { ProgramParameter4fvNV_names, 597 }, - { VertexAttrib1svNV_names, 761 }, - { VertexAttribs2svNV_names, 634 }, - { GetVertexAttribivNV_names, 755 }, - { GetVertexAttribfvNV_names, 754 }, - { VertexAttrib2svNV_names, 767 }, - { VertexAttribs1fvNV_names, 630 }, - { IsProgramNV_names, 592 }, - { VertexAttrib4sNV_names, 778 }, - { VertexAttrib2fNV_names, 764 }, - { RequestResidentProgramsNV_names, 600 }, - { ExecuteProgramNV_names, 581 }, - { VertexAttribPointerNV_names, 602 }, - { TrackMatrixNV_names, 601 }, - { GetProgramParameterdvNV_names, 583 }, - { VertexAttrib3sNV_names, 772 }, - { GetTrackMatrixivNV_names, 587 }, - { VertexAttrib3svNV_names, 773 }, - { ProgramParameters4fvNV_names, 599 }, - { GetProgramivNV_names, 585 }, - { GetVertexAttribdvNV_names, 753 }, - { VertexAttrib3fvNV_names, 771 }, - { VertexAttribs2fvNV_names, 633 }, - { VertexAttrib1fvNV_names, 759 }, - { DeleteProgramsNV_names, 580 }, - { GetVertexAttribPointervNV_names, 591 }, - { GetProgramStringNV_names, 586 }, - { VertexAttribs4dvNV_names, 638 }, - { ProgramParameters4dvNV_names, 598 }, - { VertexAttrib1fNV_names, 758 }, - { VertexAttrib4dNV_names, 774 }, - { VertexAttribs4ubvNV_names, 641 }, - { VertexAttribs3svNV_names, 637 }, - { VertexAttrib1sNV_names, 760 }, - { BindProgramNV_names, 579 }, - { AreProgramsResidentNV_names, 578 }, - { VertexAttrib3dvNV_names, 769 }, - { VertexAttrib1dNV_names, 756 }, - { VertexAttribs4svNV_names, 640 }, - { VertexAttribs1svNV_names, 631 }, - { GenProgramsNV_names, 582 }, - { VertexAttrib4dvNV_names, 775 }, - { NULL, 0 } + { ProgramParameter4fNV_names, ProgramParameter4fNV_remap_index, 596 }, + { VertexAttrib4ubvNV_names, VertexAttrib4ubvNV_remap_index, 781 }, + { VertexAttrib4svNV_names, VertexAttrib4svNV_remap_index, 779 }, + { VertexAttribs1dvNV_names, VertexAttribs1dvNV_remap_index, 629 }, + { ProgramParameter4dvNV_names, ProgramParameter4dvNV_remap_index, 595 }, + { VertexAttrib4fNV_names, VertexAttrib4fNV_remap_index, 776 }, + { VertexAttrib2dNV_names, VertexAttrib2dNV_remap_index, 762 }, + { VertexAttrib4ubNV_names, VertexAttrib4ubNV_remap_index, 780 }, + { VertexAttribs3dvNV_names, VertexAttribs3dvNV_remap_index, 635 }, + { VertexAttribs4fvNV_names, VertexAttribs4fvNV_remap_index, 639 }, + { VertexAttrib2sNV_names, VertexAttrib2sNV_remap_index, 766 }, + { VertexAttribs3fvNV_names, VertexAttribs3fvNV_remap_index, 636 }, + { ProgramParameter4dNV_names, ProgramParameter4dNV_remap_index, 594 }, + { LoadProgramNV_names, LoadProgramNV_remap_index, 593 }, + { VertexAttrib4fvNV_names, VertexAttrib4fvNV_remap_index, 777 }, + { VertexAttrib3fNV_names, VertexAttrib3fNV_remap_index, 770 }, + { VertexAttribs2dvNV_names, VertexAttribs2dvNV_remap_index, 632 }, + { GetProgramParameterfvNV_names, GetProgramParameterfvNV_remap_index, 584 }, + { VertexAttrib3dNV_names, VertexAttrib3dNV_remap_index, 768 }, + { VertexAttrib2fvNV_names, VertexAttrib2fvNV_remap_index, 765 }, + { VertexAttrib2dvNV_names, VertexAttrib2dvNV_remap_index, 763 }, + { VertexAttrib1dvNV_names, VertexAttrib1dvNV_remap_index, 757 }, + { ProgramParameter4fvNV_names, ProgramParameter4fvNV_remap_index, 597 }, + { VertexAttrib1svNV_names, VertexAttrib1svNV_remap_index, 761 }, + { VertexAttribs2svNV_names, VertexAttribs2svNV_remap_index, 634 }, + { GetVertexAttribivNV_names, GetVertexAttribivNV_remap_index, 755 }, + { GetVertexAttribfvNV_names, GetVertexAttribfvNV_remap_index, 754 }, + { VertexAttrib2svNV_names, VertexAttrib2svNV_remap_index, 767 }, + { VertexAttribs1fvNV_names, VertexAttribs1fvNV_remap_index, 630 }, + { IsProgramNV_names, IsProgramNV_remap_index, 592 }, + { VertexAttrib4sNV_names, VertexAttrib4sNV_remap_index, 778 }, + { VertexAttrib2fNV_names, VertexAttrib2fNV_remap_index, 764 }, + { RequestResidentProgramsNV_names, RequestResidentProgramsNV_remap_index, 600 }, + { ExecuteProgramNV_names, ExecuteProgramNV_remap_index, 581 }, + { VertexAttribPointerNV_names, VertexAttribPointerNV_remap_index, 602 }, + { TrackMatrixNV_names, TrackMatrixNV_remap_index, 601 }, + { GetProgramParameterdvNV_names, GetProgramParameterdvNV_remap_index, 583 }, + { VertexAttrib3sNV_names, VertexAttrib3sNV_remap_index, 772 }, + { GetTrackMatrixivNV_names, GetTrackMatrixivNV_remap_index, 587 }, + { VertexAttrib3svNV_names, VertexAttrib3svNV_remap_index, 773 }, + { ProgramParameters4fvNV_names, ProgramParameters4fvNV_remap_index, 599 }, + { GetProgramivNV_names, GetProgramivNV_remap_index, 585 }, + { GetVertexAttribdvNV_names, GetVertexAttribdvNV_remap_index, 753 }, + { VertexAttrib3fvNV_names, VertexAttrib3fvNV_remap_index, 771 }, + { VertexAttribs2fvNV_names, VertexAttribs2fvNV_remap_index, 633 }, + { VertexAttrib1fvNV_names, VertexAttrib1fvNV_remap_index, 759 }, + { DeleteProgramsNV_names, DeleteProgramsNV_remap_index, 580 }, + { GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, 591 }, + { GetProgramStringNV_names, GetProgramStringNV_remap_index, 586 }, + { VertexAttribs4dvNV_names, VertexAttribs4dvNV_remap_index, 638 }, + { ProgramParameters4dvNV_names, ProgramParameters4dvNV_remap_index, 598 }, + { VertexAttrib1fNV_names, VertexAttrib1fNV_remap_index, 758 }, + { VertexAttrib4dNV_names, VertexAttrib4dNV_remap_index, 774 }, + { VertexAttribs4ubvNV_names, VertexAttribs4ubvNV_remap_index, 641 }, + { VertexAttribs3svNV_names, VertexAttribs3svNV_remap_index, 637 }, + { VertexAttrib1sNV_names, VertexAttrib1sNV_remap_index, 760 }, + { BindProgramNV_names, BindProgramNV_remap_index, 579 }, + { AreProgramsResidentNV_names, AreProgramsResidentNV_remap_index, 578 }, + { VertexAttrib3dvNV_names, VertexAttrib3dvNV_remap_index, 769 }, + { VertexAttrib1dNV_names, VertexAttrib1dNV_remap_index, 756 }, + { VertexAttribs4svNV_names, VertexAttribs4svNV_remap_index, 640 }, + { VertexAttribs1svNV_names, VertexAttribs1svNV_remap_index, 631 }, + { GenProgramsNV_names, GenProgramsNV_remap_index, 582 }, + { VertexAttrib4dvNV_names, VertexAttrib4dvNV_remap_index, 775 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_PGI_misc_hints) static const struct dri_extension_function GL_PGI_misc_hints_functions[] = { - { HintPGI_names, 544 }, - { NULL, 0 } + { HintPGI_names, HintPGI_remap_index, 544 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIS_detail_texture) static const struct dri_extension_function GL_SGIS_detail_texture_functions[] = { - { GetDetailTexFuncSGIS_names, 443 }, - { DetailTexFuncSGIS_names, 442 }, - { NULL, 0 } + { GetDetailTexFuncSGIS_names, GetDetailTexFuncSGIS_remap_index, 443 }, + { DetailTexFuncSGIS_names, DetailTexFuncSGIS_remap_index, 442 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIS_fog_function) static const struct dri_extension_function GL_SGIS_fog_function_functions[] = { - { FogFuncSGIS_names, -1 }, - { GetFogFuncSGIS_names, -1 }, - { NULL, 0 } + { FogFuncSGIS_names, FogFuncSGIS_remap_index, -1 }, + { GetFogFuncSGIS_names, GetFogFuncSGIS_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIS_multisample) static const struct dri_extension_function GL_SGIS_multisample_functions[] = { - { SampleMaskSGIS_names, 446 }, - { SamplePatternSGIS_names, 447 }, - { NULL, 0 } + { SampleMaskSGIS_names, SampleMaskSGIS_remap_index, 446 }, + { SamplePatternSGIS_names, SamplePatternSGIS_remap_index, 447 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIS_pixel_texture) static const struct dri_extension_function GL_SGIS_pixel_texture_functions[] = { - { PixelTexGenParameterfvSGIS_names, 434 }, - { GetPixelTexGenParameterivSGIS_names, 435 }, - { PixelTexGenParameteriSGIS_names, 431 }, - { PixelTexGenParameterivSGIS_names, 432 }, - { PixelTexGenParameterfSGIS_names, 433 }, - { GetPixelTexGenParameterfvSGIS_names, 436 }, - { NULL, 0 } + { PixelTexGenParameterfvSGIS_names, PixelTexGenParameterfvSGIS_remap_index, 434 }, + { GetPixelTexGenParameterivSGIS_names, GetPixelTexGenParameterivSGIS_remap_index, 435 }, + { PixelTexGenParameteriSGIS_names, PixelTexGenParameteriSGIS_remap_index, 431 }, + { PixelTexGenParameterivSGIS_names, PixelTexGenParameterivSGIS_remap_index, 432 }, + { PixelTexGenParameterfSGIS_names, PixelTexGenParameterfSGIS_remap_index, 433 }, + { GetPixelTexGenParameterfvSGIS_names, GetPixelTexGenParameterfvSGIS_remap_index, 436 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIS_point_parameters) static const struct dri_extension_function GL_SGIS_point_parameters_functions[] = { - { PointParameterfEXT_names, 458 }, - { PointParameterfvEXT_names, 459 }, - { NULL, 0 } + { PointParameterfEXT_names, PointParameterfEXT_remap_index, 458 }, + { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, 459 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIS_sharpen_texture) static const struct dri_extension_function GL_SGIS_sharpen_texture_functions[] = { - { GetSharpenTexFuncSGIS_names, 445 }, - { SharpenTexFuncSGIS_names, 444 }, - { NULL, 0 } + { GetSharpenTexFuncSGIS_names, GetSharpenTexFuncSGIS_remap_index, 445 }, + { SharpenTexFuncSGIS_names, SharpenTexFuncSGIS_remap_index, 444 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIS_texture4D) static const struct dri_extension_function GL_SGIS_texture4D_functions[] = { - { TexImage4DSGIS_names, 437 }, - { TexSubImage4DSGIS_names, 438 }, - { NULL, 0 } + { TexImage4DSGIS_names, TexImage4DSGIS_remap_index, 437 }, + { TexSubImage4DSGIS_names, TexSubImage4DSGIS_remap_index, 438 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIS_texture_color_mask) static const struct dri_extension_function GL_SGIS_texture_color_mask_functions[] = { - { TextureColorMaskSGIS_names, -1 }, - { NULL, 0 } + { TextureColorMaskSGIS_names, TextureColorMaskSGIS_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIS_texture_filter4) static const struct dri_extension_function GL_SGIS_texture_filter4_functions[] = { - { GetTexFilterFuncSGIS_names, 415 }, - { TexFilterFuncSGIS_names, 416 }, - { NULL, 0 } + { GetTexFilterFuncSGIS_names, GetTexFilterFuncSGIS_remap_index, 415 }, + { TexFilterFuncSGIS_names, TexFilterFuncSGIS_remap_index, 416 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIX_async) static const struct dri_extension_function GL_SGIX_async_functions[] = { - { AsyncMarkerSGIX_names, -1 }, - { FinishAsyncSGIX_names, -1 }, - { PollAsyncSGIX_names, -1 }, - { DeleteAsyncMarkersSGIX_names, -1 }, - { IsAsyncMarkerSGIX_names, -1 }, - { GenAsyncMarkersSGIX_names, -1 }, - { NULL, 0 } + { AsyncMarkerSGIX_names, AsyncMarkerSGIX_remap_index, -1 }, + { FinishAsyncSGIX_names, FinishAsyncSGIX_remap_index, -1 }, + { PollAsyncSGIX_names, PollAsyncSGIX_remap_index, -1 }, + { DeleteAsyncMarkersSGIX_names, DeleteAsyncMarkersSGIX_remap_index, -1 }, + { IsAsyncMarkerSGIX_names, IsAsyncMarkerSGIX_remap_index, -1 }, + { GenAsyncMarkersSGIX_names, GenAsyncMarkersSGIX_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIX_flush_raster) static const struct dri_extension_function GL_SGIX_flush_raster_functions[] = { - { FlushRasterSGIX_names, 469 }, - { NULL, 0 } + { FlushRasterSGIX_names, FlushRasterSGIX_remap_index, 469 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIX_fragment_lighting) static const struct dri_extension_function GL_SGIX_fragment_lighting_functions[] = { - { FragmentMaterialfvSGIX_names, 486 }, - { FragmentLightModelivSGIX_names, 484 }, - { FragmentLightiSGIX_names, 479 }, - { GetFragmentMaterialfvSGIX_names, 491 }, - { FragmentMaterialfSGIX_names, 485 }, - { GetFragmentLightivSGIX_names, 490 }, - { FragmentLightModeliSGIX_names, 483 }, - { FragmentLightivSGIX_names, 480 }, - { GetFragmentMaterialivSGIX_names, 492 }, - { FragmentLightModelfSGIX_names, 481 }, - { FragmentColorMaterialSGIX_names, 476 }, - { FragmentMaterialiSGIX_names, 487 }, - { LightEnviSGIX_names, 493 }, - { FragmentLightModelfvSGIX_names, 482 }, - { FragmentLightfvSGIX_names, 478 }, - { FragmentLightfSGIX_names, 477 }, - { GetFragmentLightfvSGIX_names, 489 }, - { FragmentMaterialivSGIX_names, 488 }, - { NULL, 0 } + { FragmentMaterialfvSGIX_names, FragmentMaterialfvSGIX_remap_index, 486 }, + { FragmentLightModelivSGIX_names, FragmentLightModelivSGIX_remap_index, 484 }, + { FragmentLightiSGIX_names, FragmentLightiSGIX_remap_index, 479 }, + { GetFragmentMaterialfvSGIX_names, GetFragmentMaterialfvSGIX_remap_index, 491 }, + { FragmentMaterialfSGIX_names, FragmentMaterialfSGIX_remap_index, 485 }, + { GetFragmentLightivSGIX_names, GetFragmentLightivSGIX_remap_index, 490 }, + { FragmentLightModeliSGIX_names, FragmentLightModeliSGIX_remap_index, 483 }, + { FragmentLightivSGIX_names, FragmentLightivSGIX_remap_index, 480 }, + { GetFragmentMaterialivSGIX_names, GetFragmentMaterialivSGIX_remap_index, 492 }, + { FragmentLightModelfSGIX_names, FragmentLightModelfSGIX_remap_index, 481 }, + { FragmentColorMaterialSGIX_names, FragmentColorMaterialSGIX_remap_index, 476 }, + { FragmentMaterialiSGIX_names, FragmentMaterialiSGIX_remap_index, 487 }, + { LightEnviSGIX_names, LightEnviSGIX_remap_index, 493 }, + { FragmentLightModelfvSGIX_names, FragmentLightModelfvSGIX_remap_index, 482 }, + { FragmentLightfvSGIX_names, FragmentLightfvSGIX_remap_index, 478 }, + { FragmentLightfSGIX_names, FragmentLightfSGIX_remap_index, 477 }, + { GetFragmentLightfvSGIX_names, GetFragmentLightfvSGIX_remap_index, 489 }, + { FragmentMaterialivSGIX_names, FragmentMaterialivSGIX_remap_index, 488 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIX_framezoom) static const struct dri_extension_function GL_SGIX_framezoom_functions[] = { - { FrameZoomSGIX_names, 466 }, - { NULL, 0 } + { FrameZoomSGIX_names, FrameZoomSGIX_remap_index, 466 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIX_igloo_interface) static const struct dri_extension_function GL_SGIX_igloo_interface_functions[] = { - { IglooInterfaceSGIX_names, -1 }, - { NULL, 0 } + { IglooInterfaceSGIX_names, IglooInterfaceSGIX_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIX_instruments) static const struct dri_extension_function GL_SGIX_instruments_functions[] = { - { ReadInstrumentsSGIX_names, 463 }, - { GetInstrumentsSGIX_names, 460 }, - { StartInstrumentsSGIX_names, 464 }, - { StopInstrumentsSGIX_names, 465 }, - { InstrumentsBufferSGIX_names, 461 }, - { PollInstrumentsSGIX_names, 462 }, - { NULL, 0 } + { ReadInstrumentsSGIX_names, ReadInstrumentsSGIX_remap_index, 463 }, + { GetInstrumentsSGIX_names, GetInstrumentsSGIX_remap_index, 460 }, + { StartInstrumentsSGIX_names, StartInstrumentsSGIX_remap_index, 464 }, + { StopInstrumentsSGIX_names, StopInstrumentsSGIX_remap_index, 465 }, + { InstrumentsBufferSGIX_names, InstrumentsBufferSGIX_remap_index, 461 }, + { PollInstrumentsSGIX_names, PollInstrumentsSGIX_remap_index, 462 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIX_list_priority) static const struct dri_extension_function GL_SGIX_list_priority_functions[] = { - { ListParameterfSGIX_names, 472 }, - { GetListParameterivSGIX_names, 471 }, - { GetListParameterfvSGIX_names, 470 }, - { ListParameteriSGIX_names, 474 }, - { ListParameterfvSGIX_names, 473 }, - { ListParameterivSGIX_names, 475 }, - { NULL, 0 } + { ListParameterfSGIX_names, ListParameterfSGIX_remap_index, 472 }, + { GetListParameterivSGIX_names, GetListParameterivSGIX_remap_index, 471 }, + { GetListParameterfvSGIX_names, GetListParameterfvSGIX_remap_index, 470 }, + { ListParameteriSGIX_names, ListParameteriSGIX_remap_index, 474 }, + { ListParameterfvSGIX_names, ListParameterfvSGIX_remap_index, 473 }, + { ListParameterivSGIX_names, ListParameterivSGIX_remap_index, 475 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIX_pixel_texture) static const struct dri_extension_function GL_SGIX_pixel_texture_functions[] = { - { PixelTexGenSGIX_names, 430 }, - { NULL, 0 } + { PixelTexGenSGIX_names, PixelTexGenSGIX_remap_index, 430 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIX_polynomial_ffd) static const struct dri_extension_function GL_SGIX_polynomial_ffd_functions[] = { - { LoadIdentityDeformationMapSGIX_names, -1 }, - { DeformationMap3dSGIX_names, -1 }, - { DeformSGIX_names, -1 }, - { DeformationMap3fSGIX_names, -1 }, - { NULL, 0 } + { LoadIdentityDeformationMapSGIX_names, LoadIdentityDeformationMapSGIX_remap_index, -1 }, + { DeformationMap3dSGIX_names, DeformationMap3dSGIX_remap_index, -1 }, + { DeformSGIX_names, DeformSGIX_remap_index, -1 }, + { DeformationMap3fSGIX_names, DeformationMap3fSGIX_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIX_reference_plane) static const struct dri_extension_function GL_SGIX_reference_plane_functions[] = { - { ReferencePlaneSGIX_names, 468 }, - { NULL, 0 } + { ReferencePlaneSGIX_names, ReferencePlaneSGIX_remap_index, 468 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIX_sprite) static const struct dri_extension_function GL_SGIX_sprite_functions[] = { - { SpriteParameterfvSGIX_names, 455 }, - { SpriteParameteriSGIX_names, 456 }, - { SpriteParameterfSGIX_names, 454 }, - { SpriteParameterivSGIX_names, 457 }, - { NULL, 0 } + { SpriteParameterfvSGIX_names, SpriteParameterfvSGIX_remap_index, 455 }, + { SpriteParameteriSGIX_names, SpriteParameteriSGIX_remap_index, 456 }, + { SpriteParameterfSGIX_names, SpriteParameterfSGIX_remap_index, 454 }, + { SpriteParameterivSGIX_names, SpriteParameterivSGIX_remap_index, 457 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGIX_tag_sample_buffer) static const struct dri_extension_function GL_SGIX_tag_sample_buffer_functions[] = { - { TagSampleBufferSGIX_names, 467 }, - { NULL, 0 } + { TagSampleBufferSGIX_names, TagSampleBufferSGIX_remap_index, 467 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SGI_color_table) static const struct dri_extension_function GL_SGI_color_table_functions[] = { - { GetColorTableParameterfvSGI_names, 428 }, - { ColorTableParameteriv_names, 341 }, - { ColorTable_names, 339 }, - { CopyColorTable_names, 342 }, - { ColorTableParameterfv_names, 340 }, - { GetColorTableParameterivSGI_names, 429 }, - { GetColorTableSGI_names, 427 }, - { NULL, 0 } + { GetColorTableParameterfvSGI_names, GetColorTableParameterfvSGI_remap_index, 428 }, + { ColorTableParameteriv_names, -1, 341 }, + { ColorTable_names, -1, 339 }, + { CopyColorTable_names, -1, 342 }, + { ColorTableParameterfv_names, -1, 340 }, + { GetColorTableParameterivSGI_names, GetColorTableParameterivSGI_remap_index, 429 }, + { GetColorTableSGI_names, GetColorTableSGI_remap_index, 427 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SUNX_constant_data) static const struct dri_extension_function GL_SUNX_constant_data_functions[] = { - { FinishTextureSUNX_names, -1 }, - { NULL, 0 } + { FinishTextureSUNX_names, FinishTextureSUNX_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SUN_global_alpha) static const struct dri_extension_function GL_SUN_global_alpha_functions[] = { - { GlobalAlphaFactorubSUN_names, -1 }, - { GlobalAlphaFactoriSUN_names, -1 }, - { GlobalAlphaFactordSUN_names, -1 }, - { GlobalAlphaFactoruiSUN_names, -1 }, - { GlobalAlphaFactorbSUN_names, -1 }, - { GlobalAlphaFactorfSUN_names, -1 }, - { GlobalAlphaFactorusSUN_names, -1 }, - { GlobalAlphaFactorsSUN_names, -1 }, - { NULL, 0 } + { GlobalAlphaFactorubSUN_names, GlobalAlphaFactorubSUN_remap_index, -1 }, + { GlobalAlphaFactoriSUN_names, GlobalAlphaFactoriSUN_remap_index, -1 }, + { GlobalAlphaFactordSUN_names, GlobalAlphaFactordSUN_remap_index, -1 }, + { GlobalAlphaFactoruiSUN_names, GlobalAlphaFactoruiSUN_remap_index, -1 }, + { GlobalAlphaFactorbSUN_names, GlobalAlphaFactorbSUN_remap_index, -1 }, + { GlobalAlphaFactorfSUN_names, GlobalAlphaFactorfSUN_remap_index, -1 }, + { GlobalAlphaFactorusSUN_names, GlobalAlphaFactorusSUN_remap_index, -1 }, + { GlobalAlphaFactorsSUN_names, GlobalAlphaFactorsSUN_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SUN_mesh_array) static const struct dri_extension_function GL_SUN_mesh_array_functions[] = { - { DrawMeshArraysSUN_names, -1 }, - { NULL, 0 } + { DrawMeshArraysSUN_names, DrawMeshArraysSUN_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SUN_triangle_list) static const struct dri_extension_function GL_SUN_triangle_list_functions[] = { - { ReplacementCodeubSUN_names, -1 }, - { ReplacementCodeubvSUN_names, -1 }, - { ReplacementCodeuivSUN_names, -1 }, - { ReplacementCodeusvSUN_names, -1 }, - { ReplacementCodePointerSUN_names, -1 }, - { ReplacementCodeusSUN_names, -1 }, - { ReplacementCodeuiSUN_names, -1 }, - { NULL, 0 } + { ReplacementCodeubSUN_names, ReplacementCodeubSUN_remap_index, -1 }, + { ReplacementCodeubvSUN_names, ReplacementCodeubvSUN_remap_index, -1 }, + { ReplacementCodeuivSUN_names, ReplacementCodeuivSUN_remap_index, -1 }, + { ReplacementCodeusvSUN_names, ReplacementCodeusvSUN_remap_index, -1 }, + { ReplacementCodePointerSUN_names, ReplacementCodePointerSUN_remap_index, -1 }, + { ReplacementCodeusSUN_names, ReplacementCodeusSUN_remap_index, -1 }, + { ReplacementCodeuiSUN_names, ReplacementCodeuiSUN_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_SUN_vertex) static const struct dri_extension_function GL_SUN_vertex_functions[] = { - { ReplacementCodeuiColor3fVertex3fvSUN_names, -1 }, - { TexCoord4fColor4fNormal3fVertex4fvSUN_names, -1 }, - { TexCoord2fColor4ubVertex3fvSUN_names, -1 }, - { ReplacementCodeuiVertex3fvSUN_names, -1 }, - { ReplacementCodeuiTexCoord2fVertex3fvSUN_names, -1 }, - { ReplacementCodeuiNormal3fVertex3fSUN_names, -1 }, - { Color4ubVertex3fvSUN_names, -1 }, - { Color4ubVertex3fSUN_names, -1 }, - { TexCoord2fVertex3fSUN_names, -1 }, - { TexCoord2fColor4fNormal3fVertex3fSUN_names, -1 }, - { TexCoord2fNormal3fVertex3fvSUN_names, -1 }, - { ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN_names, -1 }, - { ReplacementCodeuiTexCoord2fVertex3fSUN_names, -1 }, - { Color3fVertex3fSUN_names, -1 }, - { ReplacementCodeuiNormal3fVertex3fvSUN_names, -1 }, - { Color3fVertex3fvSUN_names, -1 }, - { Color4fNormal3fVertex3fvSUN_names, -1 }, - { ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_names, -1 }, - { ReplacementCodeuiColor4fNormal3fVertex3fvSUN_names, -1 }, - { ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN_names, -1 }, - { TexCoord2fColor3fVertex3fSUN_names, -1 }, - { TexCoord4fColor4fNormal3fVertex4fSUN_names, -1 }, - { Color4ubVertex2fvSUN_names, -1 }, - { Normal3fVertex3fSUN_names, -1 }, - { ReplacementCodeuiColor4fNormal3fVertex3fSUN_names, -1 }, - { TexCoord2fNormal3fVertex3fSUN_names, -1 }, - { TexCoord2fVertex3fvSUN_names, -1 }, - { Color4ubVertex2fSUN_names, -1 }, - { ReplacementCodeuiColor4ubVertex3fSUN_names, -1 }, - { TexCoord2fColor4ubVertex3fSUN_names, -1 }, - { Normal3fVertex3fvSUN_names, -1 }, - { Color4fNormal3fVertex3fSUN_names, -1 }, - { TexCoord2fColor4fNormal3fVertex3fvSUN_names, -1 }, - { ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN_names, -1 }, - { ReplacementCodeuiColor4ubVertex3fvSUN_names, -1 }, - { ReplacementCodeuiColor3fVertex3fSUN_names, -1 }, - { TexCoord4fVertex4fSUN_names, -1 }, - { TexCoord2fColor3fVertex3fvSUN_names, -1 }, - { TexCoord4fVertex4fvSUN_names, -1 }, - { ReplacementCodeuiVertex3fSUN_names, -1 }, - { NULL, 0 } + { ReplacementCodeuiColor3fVertex3fvSUN_names, ReplacementCodeuiColor3fVertex3fvSUN_remap_index, -1 }, + { TexCoord4fColor4fNormal3fVertex4fvSUN_names, TexCoord4fColor4fNormal3fVertex4fvSUN_remap_index, -1 }, + { TexCoord2fColor4ubVertex3fvSUN_names, TexCoord2fColor4ubVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiVertex3fvSUN_names, ReplacementCodeuiVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiTexCoord2fVertex3fvSUN_names, ReplacementCodeuiTexCoord2fVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiNormal3fVertex3fSUN_names, ReplacementCodeuiNormal3fVertex3fSUN_remap_index, -1 }, + { Color4ubVertex3fvSUN_names, Color4ubVertex3fvSUN_remap_index, -1 }, + { Color4ubVertex3fSUN_names, Color4ubVertex3fSUN_remap_index, -1 }, + { TexCoord2fVertex3fSUN_names, TexCoord2fVertex3fSUN_remap_index, -1 }, + { TexCoord2fColor4fNormal3fVertex3fSUN_names, TexCoord2fColor4fNormal3fVertex3fSUN_remap_index, -1 }, + { TexCoord2fNormal3fVertex3fvSUN_names, TexCoord2fNormal3fVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN_names, ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN_remap_index, -1 }, + { ReplacementCodeuiTexCoord2fVertex3fSUN_names, ReplacementCodeuiTexCoord2fVertex3fSUN_remap_index, -1 }, + { Color3fVertex3fSUN_names, Color3fVertex3fSUN_remap_index, -1 }, + { ReplacementCodeuiNormal3fVertex3fvSUN_names, ReplacementCodeuiNormal3fVertex3fvSUN_remap_index, -1 }, + { Color3fVertex3fvSUN_names, Color3fVertex3fvSUN_remap_index, -1 }, + { Color4fNormal3fVertex3fvSUN_names, Color4fNormal3fVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_names, ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiColor4fNormal3fVertex3fvSUN_names, ReplacementCodeuiColor4fNormal3fVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN_names, ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN_remap_index, -1 }, + { TexCoord2fColor3fVertex3fSUN_names, TexCoord2fColor3fVertex3fSUN_remap_index, -1 }, + { TexCoord4fColor4fNormal3fVertex4fSUN_names, TexCoord4fColor4fNormal3fVertex4fSUN_remap_index, -1 }, + { Color4ubVertex2fvSUN_names, Color4ubVertex2fvSUN_remap_index, -1 }, + { Normal3fVertex3fSUN_names, Normal3fVertex3fSUN_remap_index, -1 }, + { ReplacementCodeuiColor4fNormal3fVertex3fSUN_names, ReplacementCodeuiColor4fNormal3fVertex3fSUN_remap_index, -1 }, + { TexCoord2fNormal3fVertex3fSUN_names, TexCoord2fNormal3fVertex3fSUN_remap_index, -1 }, + { TexCoord2fVertex3fvSUN_names, TexCoord2fVertex3fvSUN_remap_index, -1 }, + { Color4ubVertex2fSUN_names, Color4ubVertex2fSUN_remap_index, -1 }, + { ReplacementCodeuiColor4ubVertex3fSUN_names, ReplacementCodeuiColor4ubVertex3fSUN_remap_index, -1 }, + { TexCoord2fColor4ubVertex3fSUN_names, TexCoord2fColor4ubVertex3fSUN_remap_index, -1 }, + { Normal3fVertex3fvSUN_names, Normal3fVertex3fvSUN_remap_index, -1 }, + { Color4fNormal3fVertex3fSUN_names, Color4fNormal3fVertex3fSUN_remap_index, -1 }, + { TexCoord2fColor4fNormal3fVertex3fvSUN_names, TexCoord2fColor4fNormal3fVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN_names, ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN_remap_index, -1 }, + { ReplacementCodeuiColor4ubVertex3fvSUN_names, ReplacementCodeuiColor4ubVertex3fvSUN_remap_index, -1 }, + { ReplacementCodeuiColor3fVertex3fSUN_names, ReplacementCodeuiColor3fVertex3fSUN_remap_index, -1 }, + { TexCoord4fVertex4fSUN_names, TexCoord4fVertex4fSUN_remap_index, -1 }, + { TexCoord2fColor3fVertex3fvSUN_names, TexCoord2fColor3fVertex3fvSUN_remap_index, -1 }, + { TexCoord4fVertex4fvSUN_names, TexCoord4fVertex4fvSUN_remap_index, -1 }, + { ReplacementCodeuiVertex3fSUN_names, ReplacementCodeuiVertex3fSUN_remap_index, -1 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_VERSION_1_3) static const struct dri_extension_function GL_VERSION_1_3_functions[] = { - { SampleCoverageARB_names, 412 }, - { MultiTexCoord3sARB_names, 398 }, - { ActiveTextureARB_names, 374 }, - { CompressedTexSubImage2DARB_names, 558 }, - { CompressedTexImage3DARB_names, 554 }, - { MultiTexCoord1fvARB_names, 379 }, - { MultTransposeMatrixdARB_names, 411 }, - { CompressedTexImage1DARB_names, 556 }, - { MultiTexCoord3dARB_names, 392 }, - { MultiTexCoord2iARB_names, 388 }, - { MultiTexCoord2svARB_names, 391 }, - { MultiTexCoord2fARB_names, 386 }, - { LoadTransposeMatrixdARB_names, 409 }, - { MultiTexCoord3fvARB_names, 395 }, - { MultiTexCoord4sARB_names, 406 }, - { MultiTexCoord2dvARB_names, 385 }, - { MultiTexCoord1svARB_names, 383 }, - { MultiTexCoord3svARB_names, 399 }, - { MultiTexCoord4iARB_names, 404 }, - { MultiTexCoord3iARB_names, 396 }, - { MultiTexCoord1dARB_names, 376 }, - { MultiTexCoord3dvARB_names, 393 }, - { MultiTexCoord3ivARB_names, 397 }, - { MultiTexCoord2sARB_names, 390 }, - { MultiTexCoord4ivARB_names, 405 }, - { CompressedTexSubImage1DARB_names, 559 }, - { ClientActiveTextureARB_names, 375 }, - { CompressedTexSubImage3DARB_names, 557 }, - { MultiTexCoord2dARB_names, 384 }, - { MultiTexCoord4dvARB_names, 401 }, - { MultiTexCoord4fvARB_names, 403 }, - { MultiTexCoord3fARB_names, 394 }, - { MultTransposeMatrixfARB_names, 410 }, - { CompressedTexImage2DARB_names, 555 }, - { MultiTexCoord4dARB_names, 400 }, - { MultiTexCoord1sARB_names, 382 }, - { MultiTexCoord1dvARB_names, 377 }, - { MultiTexCoord1ivARB_names, 381 }, - { MultiTexCoord2ivARB_names, 389 }, - { MultiTexCoord1iARB_names, 380 }, - { GetCompressedTexImageARB_names, 560 }, - { MultiTexCoord4svARB_names, 407 }, - { MultiTexCoord1fARB_names, 378 }, - { MultiTexCoord4fARB_names, 402 }, - { LoadTransposeMatrixfARB_names, 408 }, - { MultiTexCoord2fvARB_names, 387 }, - { NULL, 0 } + { SampleCoverageARB_names, SampleCoverageARB_remap_index, 412 }, + { MultiTexCoord3sARB_names, -1, 398 }, + { ActiveTextureARB_names, -1, 374 }, + { CompressedTexSubImage2DARB_names, CompressedTexSubImage2DARB_remap_index, 558 }, + { CompressedTexImage3DARB_names, CompressedTexImage3DARB_remap_index, 554 }, + { MultiTexCoord1fvARB_names, -1, 379 }, + { MultTransposeMatrixdARB_names, MultTransposeMatrixdARB_remap_index, 411 }, + { CompressedTexImage1DARB_names, CompressedTexImage1DARB_remap_index, 556 }, + { MultiTexCoord3dARB_names, -1, 392 }, + { MultiTexCoord2iARB_names, -1, 388 }, + { MultiTexCoord2svARB_names, -1, 391 }, + { MultiTexCoord2fARB_names, -1, 386 }, + { LoadTransposeMatrixdARB_names, LoadTransposeMatrixdARB_remap_index, 409 }, + { MultiTexCoord3fvARB_names, -1, 395 }, + { MultiTexCoord4sARB_names, -1, 406 }, + { MultiTexCoord2dvARB_names, -1, 385 }, + { MultiTexCoord1svARB_names, -1, 383 }, + { MultiTexCoord3svARB_names, -1, 399 }, + { MultiTexCoord4iARB_names, -1, 404 }, + { MultiTexCoord3iARB_names, -1, 396 }, + { MultiTexCoord1dARB_names, -1, 376 }, + { MultiTexCoord3dvARB_names, -1, 393 }, + { MultiTexCoord3ivARB_names, -1, 397 }, + { MultiTexCoord2sARB_names, -1, 390 }, + { MultiTexCoord4ivARB_names, -1, 405 }, + { CompressedTexSubImage1DARB_names, CompressedTexSubImage1DARB_remap_index, 559 }, + { ClientActiveTextureARB_names, -1, 375 }, + { CompressedTexSubImage3DARB_names, CompressedTexSubImage3DARB_remap_index, 557 }, + { MultiTexCoord2dARB_names, -1, 384 }, + { MultiTexCoord4dvARB_names, -1, 401 }, + { MultiTexCoord4fvARB_names, -1, 403 }, + { MultiTexCoord3fARB_names, -1, 394 }, + { MultTransposeMatrixfARB_names, MultTransposeMatrixfARB_remap_index, 410 }, + { CompressedTexImage2DARB_names, CompressedTexImage2DARB_remap_index, 555 }, + { MultiTexCoord4dARB_names, -1, 400 }, + { MultiTexCoord1sARB_names, -1, 382 }, + { MultiTexCoord1dvARB_names, -1, 377 }, + { MultiTexCoord1ivARB_names, -1, 381 }, + { MultiTexCoord2ivARB_names, -1, 389 }, + { MultiTexCoord1iARB_names, -1, 380 }, + { GetCompressedTexImageARB_names, GetCompressedTexImageARB_remap_index, 560 }, + { MultiTexCoord4svARB_names, -1, 407 }, + { MultiTexCoord1fARB_names, -1, 378 }, + { MultiTexCoord4fARB_names, -1, 402 }, + { LoadTransposeMatrixfARB_names, LoadTransposeMatrixfARB_remap_index, 408 }, + { MultiTexCoord2fvARB_names, -1, 387 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_VERSION_1_4) static const struct dri_extension_function GL_VERSION_1_4_functions[] = { - { PointParameteriNV_names, 642 }, - { SecondaryColor3iEXT_names, 567 }, - { WindowPos3fMESA_names, 523 }, - { WindowPos2dvMESA_names, 514 }, - { SecondaryColor3bEXT_names, 561 }, - { PointParameterfEXT_names, 458 }, - { FogCoorddEXT_names, 547 }, - { FogCoordfEXT_names, 545 }, - { WindowPos2svMESA_names, 520 }, - { WindowPos3dMESA_names, 521 }, - { PointParameterfvEXT_names, 459 }, - { WindowPos2fvMESA_names, 516 }, - { SecondaryColor3bvEXT_names, 562 }, - { SecondaryColor3sEXT_names, 569 }, - { SecondaryColor3dEXT_names, 563 }, - { WindowPos2dMESA_names, 513 }, - { SecondaryColorPointerEXT_names, 577 }, - { SecondaryColor3uiEXT_names, 573 }, - { SecondaryColor3usvEXT_names, 576 }, - { WindowPos3dvMESA_names, 522 }, - { PointParameterivNV_names, 643 }, - { WindowPos3fvMESA_names, 524 }, - { SecondaryColor3ivEXT_names, 568 }, - { WindowPos2iMESA_names, 517 }, - { SecondaryColor3fvEXT_names, 566 }, - { WindowPos3sMESA_names, 527 }, - { WindowPos2ivMESA_names, 518 }, - { MultiDrawElementsEXT_names, 645 }, - { WindowPos2sMESA_names, 519 }, - { FogCoordPointerEXT_names, 549 }, - { SecondaryColor3ubvEXT_names, 572 }, - { SecondaryColor3uivEXT_names, 574 }, - { WindowPos3iMESA_names, 525 }, - { SecondaryColor3dvEXT_names, 564 }, - { MultiDrawArraysEXT_names, 644 }, - { SecondaryColor3usEXT_names, 575 }, - { FogCoordfvEXT_names, 546 }, - { SecondaryColor3ubEXT_names, 571 }, - { BlendFuncSeparateEXT_names, 537 }, - { SecondaryColor3fEXT_names, 565 }, - { WindowPos3ivMESA_names, 526 }, - { SecondaryColor3svEXT_names, 570 }, - { FogCoorddvEXT_names, 548 }, - { WindowPos3svMESA_names, 528 }, - { WindowPos2fMESA_names, 515 }, - { NULL, 0 } + { PointParameteriNV_names, PointParameteriNV_remap_index, 642 }, + { SecondaryColor3iEXT_names, SecondaryColor3iEXT_remap_index, 567 }, + { WindowPos3fMESA_names, WindowPos3fMESA_remap_index, 523 }, + { WindowPos2dvMESA_names, WindowPos2dvMESA_remap_index, 514 }, + { SecondaryColor3bEXT_names, SecondaryColor3bEXT_remap_index, 561 }, + { PointParameterfEXT_names, PointParameterfEXT_remap_index, 458 }, + { FogCoorddEXT_names, FogCoorddEXT_remap_index, 547 }, + { FogCoordfEXT_names, FogCoordfEXT_remap_index, 545 }, + { WindowPos2svMESA_names, WindowPos2svMESA_remap_index, 520 }, + { WindowPos3dMESA_names, WindowPos3dMESA_remap_index, 521 }, + { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, 459 }, + { WindowPos2fvMESA_names, WindowPos2fvMESA_remap_index, 516 }, + { SecondaryColor3bvEXT_names, SecondaryColor3bvEXT_remap_index, 562 }, + { SecondaryColor3sEXT_names, SecondaryColor3sEXT_remap_index, 569 }, + { SecondaryColor3dEXT_names, SecondaryColor3dEXT_remap_index, 563 }, + { WindowPos2dMESA_names, WindowPos2dMESA_remap_index, 513 }, + { SecondaryColorPointerEXT_names, SecondaryColorPointerEXT_remap_index, 577 }, + { SecondaryColor3uiEXT_names, SecondaryColor3uiEXT_remap_index, 573 }, + { SecondaryColor3usvEXT_names, SecondaryColor3usvEXT_remap_index, 576 }, + { WindowPos3dvMESA_names, WindowPos3dvMESA_remap_index, 522 }, + { PointParameterivNV_names, PointParameterivNV_remap_index, 643 }, + { WindowPos3fvMESA_names, WindowPos3fvMESA_remap_index, 524 }, + { SecondaryColor3ivEXT_names, SecondaryColor3ivEXT_remap_index, 568 }, + { WindowPos2iMESA_names, WindowPos2iMESA_remap_index, 517 }, + { SecondaryColor3fvEXT_names, SecondaryColor3fvEXT_remap_index, 566 }, + { WindowPos3sMESA_names, WindowPos3sMESA_remap_index, 527 }, + { WindowPos2ivMESA_names, WindowPos2ivMESA_remap_index, 518 }, + { MultiDrawElementsEXT_names, MultiDrawElementsEXT_remap_index, 645 }, + { WindowPos2sMESA_names, WindowPos2sMESA_remap_index, 519 }, + { FogCoordPointerEXT_names, FogCoordPointerEXT_remap_index, 549 }, + { SecondaryColor3ubvEXT_names, SecondaryColor3ubvEXT_remap_index, 572 }, + { SecondaryColor3uivEXT_names, SecondaryColor3uivEXT_remap_index, 574 }, + { WindowPos3iMESA_names, WindowPos3iMESA_remap_index, 525 }, + { SecondaryColor3dvEXT_names, SecondaryColor3dvEXT_remap_index, 564 }, + { MultiDrawArraysEXT_names, MultiDrawArraysEXT_remap_index, 644 }, + { SecondaryColor3usEXT_names, SecondaryColor3usEXT_remap_index, 575 }, + { FogCoordfvEXT_names, FogCoordfvEXT_remap_index, 546 }, + { SecondaryColor3ubEXT_names, SecondaryColor3ubEXT_remap_index, 571 }, + { BlendFuncSeparateEXT_names, BlendFuncSeparateEXT_remap_index, 537 }, + { SecondaryColor3fEXT_names, SecondaryColor3fEXT_remap_index, 565 }, + { WindowPos3ivMESA_names, WindowPos3ivMESA_remap_index, 526 }, + { SecondaryColor3svEXT_names, SecondaryColor3svEXT_remap_index, 570 }, + { FogCoorddvEXT_names, FogCoorddvEXT_remap_index, 548 }, + { WindowPos3svMESA_names, WindowPos3svMESA_remap_index, 528 }, + { WindowPos2fMESA_names, WindowPos2fMESA_remap_index, 515 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_VERSION_1_5) static const struct dri_extension_function GL_VERSION_1_5_functions[] = { - { BeginQueryARB_names, 703 }, - { GetBufferSubDataARB_names, 695 }, - { BufferSubDataARB_names, 690 }, - { GetQueryivARB_names, 705 }, - { GetQueryObjectivARB_names, 706 }, - { BufferDataARB_names, 689 }, - { EndQueryARB_names, 704 }, - { GetBufferPointervARB_names, 694 }, - { GetQueryObjectuivARB_names, 707 }, - { GetBufferParameterivARB_names, 693 }, - { DeleteQueriesARB_names, 701 }, - { IsQueryARB_names, 702 }, - { MapBufferARB_names, 697 }, - { GenQueriesARB_names, 700 }, - { IsBufferARB_names, 696 }, - { DeleteBuffersARB_names, 691 }, - { UnmapBufferARB_names, 698 }, - { BindBufferARB_names, 688 }, - { GenBuffersARB_names, 692 }, - { NULL, 0 } + { BeginQueryARB_names, BeginQueryARB_remap_index, 703 }, + { GetBufferSubDataARB_names, GetBufferSubDataARB_remap_index, 695 }, + { BufferSubDataARB_names, BufferSubDataARB_remap_index, 690 }, + { GetQueryivARB_names, GetQueryivARB_remap_index, 705 }, + { GetQueryObjectivARB_names, GetQueryObjectivARB_remap_index, 706 }, + { BufferDataARB_names, BufferDataARB_remap_index, 689 }, + { EndQueryARB_names, EndQueryARB_remap_index, 704 }, + { GetBufferPointervARB_names, GetBufferPointervARB_remap_index, 694 }, + { GetQueryObjectuivARB_names, GetQueryObjectuivARB_remap_index, 707 }, + { GetBufferParameterivARB_names, GetBufferParameterivARB_remap_index, 693 }, + { DeleteQueriesARB_names, DeleteQueriesARB_remap_index, 701 }, + { IsQueryARB_names, IsQueryARB_remap_index, 702 }, + { MapBufferARB_names, MapBufferARB_remap_index, 697 }, + { GenQueriesARB_names, GenQueriesARB_remap_index, 700 }, + { IsBufferARB_names, IsBufferARB_remap_index, 696 }, + { DeleteBuffersARB_names, DeleteBuffersARB_remap_index, 691 }, + { UnmapBufferARB_names, UnmapBufferARB_remap_index, 698 }, + { BindBufferARB_names, BindBufferARB_remap_index, 688 }, + { GenBuffersARB_names, GenBuffersARB_remap_index, 692 }, + { NULL, 0, 0 } }; #endif #if defined(need_GL_VERSION_2_0) static const struct dri_extension_function GL_VERSION_2_0_functions[] = { - { StencilMaskSeparate_names, 815 }, - { StencilOpSeparate_names, 814 }, - { StencilFuncSeparate_names, 813 }, - { NULL, 0 } + { StencilMaskSeparate_names, StencilMaskSeparate_remap_index, 815 }, + { StencilOpSeparate_names, StencilOpSeparate_remap_index, 814 }, + { StencilFuncSeparate_names, StencilFuncSeparate_remap_index, 813 }, + { NULL, 0, 0 } }; #endif diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 41367b85d85..b6fb06ffac9 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -34,6 +34,9 @@ #include "mtypes.h" #include "extensions.h" #include "utils.h" +#include "dispatch.h" + +unsigned driDispatchRemapTable[ driDispatchRemapTable_size ]; #if defined(USE_X86_ASM) #include "x86/common_x86_asm.h" @@ -176,6 +179,30 @@ driGetRendererString( char * buffer, const char * hardware_name, +#define need_GL_ARB_multisample +#define need_GL_ARB_transpose_matrix +#define need_GL_ARB_window_pos +#define need_GL_EXT_compiled_vertex_array +#define need_GL_EXT_polygon_offset +#define need_GL_EXT_texture_object +#define need_GL_EXT_vertex_array +#define need_GL_MESA_window_pos + +#include "extension_helper.h" + +static const struct dri_extension all_mesa_extensions[] = { + { "GL_ARB_multisample", GL_ARB_multisample_functions }, + { "GL_ARB_transpose_matrix", GL_ARB_transpose_matrix_functions }, + { "GL_ARB_window_pos", GL_ARB_window_pos_functions }, + { "GL_EXT_compiled_vertex_array", GL_EXT_compiled_vertex_array_functions }, + { "GL_EXT_polygon_offset", GL_EXT_polygon_offset_functions }, + { "GL_EXT_texture_object", GL_EXT_texture_object_functions }, + { "GL_EXT_vertex_array", GL_EXT_vertex_array_functions }, + { "GL_MESA_window_pos", GL_MESA_window_pos_functions }, + { NULL, NULL } +}; + + /** * Enable extensions supported by the driver. * @@ -189,9 +216,15 @@ void driInitExtensions( GLcontext * ctx, const struct dri_extension * extensions_to_enable, GLboolean enable_imaging ) { + static int first_time = 1; unsigned i; - if ( enable_imaging ) { + if ( first_time ) { + first_time = 0; + driInitExtensions( ctx, all_mesa_extensions, GL_FALSE ); + } + + if ( (ctx != NULL) && enable_imaging ) { _mesa_enable_imaging_extensions( ctx ); } @@ -220,12 +253,14 @@ void driInitSingleExtension( GLcontext * ctx, { unsigned i; + if ( ext->functions != NULL ) { for ( i = 0 ; ext->functions[i].strings != NULL ; i++ ) { const char * functions[16]; const char * parameter_signature; const char * str = ext->functions[i].strings; unsigned j; + unsigned offset; /* Separate the parameter signature from the rest of the string. @@ -260,14 +295,23 @@ void driInitSingleExtension( GLcontext * ctx, /* Add each entry-point to the dispatch table. */ - for ( j = 0 ; functions[j] != NULL ; j++ ) { - _glapi_add_entrypoint( functions[j], - ext->functions[i].offset ); + offset = _glapi_add_dispatch( functions, parameter_signature ); + if ( ext->functions[i].remap_index != -1 ) { + driDispatchRemapTable[ ext->functions[i].remap_index ] = offset; + } + + if ( (ext->functions[i].offset != -1) + && (ext->functions[i].offset != offset) ) { + fprintf(stderr, "DISPATCH ERROR! %s -> %u != %u\n", functions[0], + driDispatchRemapTable[ ext->functions[i].remap_index ], + ext->functions[i].offset); } } } - _mesa_enable_extension( ctx, ext->name ); + if ( ctx != NULL ) { + _mesa_enable_extension( ctx, ext->name ); + } } diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h index 6640229e475..26d178f7478 100644 --- a/src/mesa/drivers/dri/common/utils.h +++ b/src/mesa/drivers/dri/common/utils.h @@ -54,10 +54,16 @@ struct dri_extension_function { const char * strings; + /** + * Location in the remap table where the dispatch offset should be + * stored. + */ + int remap_index; + /** * Offset of the function in the dispatch table. */ - unsigned offset; + int offset; }; /** diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c index f49b40aa833..e260e1de24b 100644 --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c +++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c @@ -708,7 +708,7 @@ ffbFillInModes( unsigned pixel_bits, unsigned depth_bits, * failure. */ PUBLIC -void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index 1b9d4aa3699..7c5f38e3586 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -424,7 +424,7 @@ static const struct __DriverAPIRec i810API = { * failure. */ PUBLIC -void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, diff --git a/src/mesa/drivers/dri/i830/i830_context.c b/src/mesa/drivers/dri/i830/i830_context.c index d408e47c4af..45fcbd2e3b6 100644 --- a/src/mesa/drivers/dri/i830/i830_context.c +++ b/src/mesa/drivers/dri/i830/i830_context.c @@ -149,7 +149,7 @@ static void i830BufferSize(GLframebuffer *buffer, /* Extension strings exported by the i830 driver. */ -static const struct dri_extension card_extensions[] = +const struct dri_extension card_extensions[] = { { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, diff --git a/src/mesa/drivers/dri/i830/i830_screen.c b/src/mesa/drivers/dri/i830/i830_screen.c index c77657d6f06..b1a5618f410 100644 --- a/src/mesa/drivers/dri/i830/i830_screen.c +++ b/src/mesa/drivers/dri/i830/i830_screen.c @@ -67,6 +67,7 @@ DRI_CONF_BEGIN DRI_CONF_END; const GLuint __driNConfigOptions = 2; +extern const struct dri_extension card_extensions[]; static int i830_malloc_proxy_buf(drmBufMapPtr buffers) { @@ -502,7 +503,7 @@ i830FillInModes( unsigned pixel_bits, unsigned depth_bits, * failure. */ PUBLIC -void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -538,6 +539,16 @@ void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIsc (dri_priv->cpp == 2) ? 16 : 24, (dri_priv->cpp == 2) ? 0 : 8, (dri_priv->backOffset != dri_priv->depthOffset) ); + + /* Calling driInitExtensions here, with a NULL context pointer, does not actually + * enable the extensions. It just makes sure that all the dispatch offsets for all + * the extensions that *might* be enables are known. This is needed because the + * dispatch offsets need to be known when _mesa_context_create is called, but we can't + * enable the extensions until we have a context pointer. + * + * Hello chicken. Hello egg. How are you two today? + */ + driInitExtensions( NULL, card_extensions, GL_FALSE ); } return (void *) psp; diff --git a/src/mesa/drivers/dri/i915/i830_context.c b/src/mesa/drivers/dri/i915/i830_context.c index c817397db57..6088db67e20 100644 --- a/src/mesa/drivers/dri/i915/i830_context.c +++ b/src/mesa/drivers/dri/i915/i830_context.c @@ -38,7 +38,7 @@ * Mesa's Driver Functions ***************************************/ -static const struct dri_extension card_extensions[] = +static const struct dri_extension i830_extensions[] = { { "GL_ARB_texture_env_crossbar", NULL }, { NULL, NULL } @@ -109,7 +109,7 @@ GLboolean i830CreateContext( const __GLcontextModes *mesaVis, intel->verts = TNL_CONTEXT(ctx)->clipspace.vertex_buf; - driInitExtensions( ctx, card_extensions, GL_FALSE ); + driInitExtensions( ctx, i830_extensions, GL_FALSE ); i830InitState( i830 ); diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index 66628365a66..42f91241b26 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -45,7 +45,7 @@ * Mesa's Driver Functions ***************************************/ -static const struct dri_extension card_extensions[] = +static const struct dri_extension i915_extensions[] = { { "GL_ARB_depth_texture", NULL }, { "GL_ARB_fragment_program", NULL }, @@ -166,7 +166,7 @@ GLboolean i915CreateContext( const __GLcontextModes *mesaVis, ctx->Const.MaxFragmentProgramAddressRegs = 0; /* I don't think we have one */ - driInitExtensions( ctx, card_extensions, GL_FALSE ); + driInitExtensions( ctx, i915_extensions, GL_FALSE ); _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12, diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c index d30136a7d5d..4639105e1f8 100644 --- a/src/mesa/drivers/dri/i915/intel_context.c +++ b/src/mesa/drivers/dri/i915/intel_context.c @@ -153,7 +153,7 @@ static void intelBufferSize(GLframebuffer *buffer, * It appears that ARB_texture_env_crossbar has "disappeared" compared to the * old i830-specific driver. */ -static const struct dri_extension card_extensions[] = +const struct dri_extension card_extensions[] = { { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index ca8f34657ca..e474850c634 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -54,6 +54,7 @@ DRI_CONF_BEGIN DRI_CONF_END; const GLuint __driNConfigOptions = 1; +extern const struct dri_extension card_extensions[]; static void intelPrintDRIInfo(intelScreenPrivate *intelScreen, __DRIscreenPrivate *sPriv, @@ -457,7 +458,7 @@ intelFillInModes( unsigned pixel_bits, unsigned depth_bits, * failure. */ PUBLIC -void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -493,6 +494,16 @@ void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIsc (dri_priv->cpp == 2) ? 16 : 24, (dri_priv->cpp == 2) ? 0 : 8, (dri_priv->backOffset != dri_priv->depthOffset) ); + + /* Calling driInitExtensions here, with a NULL context pointer, does not actually + * enable the extensions. It just makes sure that all the dispatch offsets for all + * the extensions that *might* be enables are known. This is needed because the + * dispatch offsets need to be known when _mesa_context_create is called, but we can't + * enable the extensions until we have a context pointer. + * + * Hello chicken. Hello egg. How are you two today? + */ + driInitExtensions( NULL, card_extensions, GL_FALSE ); } return (void *) psp; diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index 91aa31eecc0..df1ed92fe7d 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -498,7 +498,7 @@ static struct __DriverAPIRec mach64API = { * failure. */ PUBLIC -void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index e310f619586..ef080b5695a 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -934,7 +934,7 @@ static const struct __DriverAPIRec mgaAPI = { * failure. */ PUBLIC -void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -970,6 +970,20 @@ void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIsc (dri_priv->cpp == 2) ? 16 : 24, (dri_priv->cpp == 2) ? 0 : 8, (dri_priv->backOffset != dri_priv->depthOffset) ); + + /* Calling driInitExtensions here, with a NULL context pointer, does not actually + * enable the extensions. It just makes sure that all the dispatch offsets for all + * the extensions that *might* be enables are known. This is needed because the + * dispatch offsets need to be known when _mesa_context_create is called, but we can't + * enable the extensions until we have a context pointer. + * + * Hello chicken. Hello egg. How are you two today? + */ + driInitExtensions( NULL, card_extensions, GL_FALSE ); + driInitExtensions( NULL, g400_extensions, GL_FALSE ); + driInitSingleExtension( NULL, ARB_vp_extension ); + driInitExtensions( NULL, NV_vp_extensions, GL_FALSE ); + } return (void *) psp; diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c index c0036c14908..f071bbecbfd 100644 --- a/src/mesa/drivers/dri/r128/r128_context.c +++ b/src/mesa/drivers/dri/r128/r128_context.c @@ -71,7 +71,7 @@ int R128_DEBUG = 0; #define need_GL_EXT_blend_minmax #include "extension_helper.h" -static const struct dri_extension card_extensions[] = +const struct dri_extension card_extensions[] = { { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index f5d0287ed9f..b6177bf691d 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -75,6 +75,8 @@ static const GLuint __driNConfigOptions = 4; static const GLuint __driNConfigOptions = 3; #endif +extern const struct dri_extension card_extensions[]; + #if 1 /* Including xf86PciInfo.h introduces a bunch of errors... */ @@ -482,7 +484,7 @@ r128FillInModes( unsigned pixel_bits, unsigned depth_bits, * failure. */ PUBLIC -void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -519,6 +521,16 @@ void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIsc (dri_priv->bpp == 16) ? 16 : 24, (dri_priv->bpp == 16) ? 0 : 8, (dri_priv->backOffset != dri_priv->depthOffset) ); + + /* Calling driInitExtensions here, with a NULL context pointer, does not actually + * enable the extensions. It just makes sure that all the dispatch offsets for all + * the extensions that *might* be enables are known. This is needed because the + * dispatch offsets need to be known when _mesa_context_create is called, but we can't + * enable the extensions until we have a context pointer. + * + * Hello chicken. Hello egg. How are you two today? + */ + driInitExtensions( NULL, card_extensions, GL_FALSE ); } return (void *) psp; diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 06834fb626e..fc5cf5a33f3 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -131,7 +131,7 @@ static const GLubyte *r200GetString( GLcontext *ctx, GLenum name ) /* Extension strings exported by the R200 driver. */ -static const struct dri_extension card_extensions[] = +const struct dri_extension card_extensions[] = { { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, @@ -162,17 +162,17 @@ static const struct dri_extension card_extensions[] = { NULL, NULL } }; -static const struct dri_extension blend_extensions[] = { +const struct dri_extension blend_extensions[] = { { "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions }, { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions }, { NULL, NULL } }; -static const struct dri_extension ARB_vp_extension[] = { +const struct dri_extension ARB_vp_extension[] = { { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions } }; -static const struct dri_extension NV_vp_extension[] = { +const struct dri_extension NV_vp_extension[] = { { "GL_NV_vertex_program", GL_NV_vertex_program_functions } }; diff --git a/src/mesa/drivers/dri/r200/r200_screen.c b/src/mesa/drivers/dri/r200/r200_screen.c index ddb3a91b1dc..f0e09d5fc4e 100644 --- a/src/mesa/drivers/dri/r200/r200_screen.c +++ b/src/mesa/drivers/dri/r200/r200_screen.c @@ -90,6 +90,11 @@ DRI_CONF_BEGIN DRI_CONF_END; static const GLuint __driNConfigOptions = 17; +extern const struct dri_extension card_extensions[]; +extern const struct dri_extension blend_extensions[]; +extern const struct dri_extension ARB_vp_extension[]; +extern const struct dri_extension NV_vp_extension[]; + #if 1 /* Including xf86PciInfo.h introduces a bunch of errors... */ @@ -642,7 +647,7 @@ static const struct __DriverAPIRec r200API = { * failure. */ PUBLIC -void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -678,6 +683,19 @@ void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIsc (dri_priv->bpp == 16) ? 16 : 24, (dri_priv->bpp == 16) ? 0 : 8, (dri_priv->backOffset != dri_priv->depthOffset) ); + + /* Calling driInitExtensions here, with a NULL context pointer, does not actually + * enable the extensions. It just makes sure that all the dispatch offsets for all + * the extensions that *might* be enables are known. This is needed because the + * dispatch offsets need to be known when _mesa_context_create is called, but we can't + * enable the extensions until we have a context pointer. + * + * Hello chicken. Hello egg. How are you two today? + */ + driInitExtensions( NULL, card_extensions, GL_FALSE ); + driInitExtensions( NULL, blend_extensions, GL_FALSE ); + driInitSingleExtension( NULL, ARB_vp_extension ); + driInitSingleExtension( NULL, NV_vp_extension ); } return (void *) psp; diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 9100ac2565b..b3017372fe6 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -73,7 +73,7 @@ int hw_tcl_on=0; #define need_GL_EXT_blend_minmax #include "extension_helper.h" -static const struct dri_extension card_extensions[] = { +const struct dri_extension card_extensions[] = { {"GL_ARB_multisample", GL_ARB_multisample_functions}, {"GL_ARB_multitexture", NULL}, {"GL_ARB_texture_border_clamp", NULL}, diff --git a/src/mesa/drivers/dri/r300/radeon_screen.c b/src/mesa/drivers/dri/r300/radeon_screen.c index bc65dd81b8a..18919ddeb12 100644 --- a/src/mesa/drivers/dri/r300/radeon_screen.c +++ b/src/mesa/drivers/dri/r300/radeon_screen.c @@ -132,6 +132,7 @@ DRI_CONF_BEGIN DRI_CONF_END; static const GLuint __driR300NConfigOptions = 13; +extern const struct dri_extension card_extensions[]; #ifndef RADEON_DEBUG int RADEON_DEBUG = 0; @@ -789,7 +790,7 @@ static const struct __DriverAPIRec radeonAPI = { * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on * failure. */ -void *__driCreateNewScreen_20050725(__DRInativeDisplay * dpy, int scrn, +void *__driCreateNewScreen_20050727(__DRInativeDisplay * dpy, int scrn, __DRIscreen * psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -826,6 +827,15 @@ void *__driCreateNewScreen_20050725(__DRInativeDisplay * dpy, int scrn, 16) ? 0 : 8, (dri_priv->backOffset != dri_priv->depthOffset)); + /* Calling driInitExtensions here, with a NULL context pointer, does not actually + * enable the extensions. It just makes sure that all the dispatch offsets for all + * the extensions that *might* be enables are known. This is needed because the + * dispatch offsets need to be known when _mesa_context_create is called, but we can't + * enable the extensions until we have a context pointer. + * + * Hello chicken. Hello egg. How are you two today? + */ + driInitExtensions( NULL, card_extensions, GL_FALSE ); } return (void *)psp; diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 12f5f401151..c96f38e0abb 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -125,7 +125,7 @@ static const GLubyte *radeonGetString( GLcontext *ctx, GLenum name ) /* Extension strings exported by the R100 driver. */ -static const struct dri_extension card_extensions[] = +const struct dri_extension card_extensions[] = { { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 9cd60875b1b..0a2bb7e9161 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -83,6 +83,8 @@ DRI_CONF_BEGIN DRI_CONF_END; static const GLuint __driNConfigOptions = 13; +extern const struct dri_extension card_extensions[]; + #if 1 /* Including xf86PciInfo.h introduces a bunch of errors... */ @@ -566,7 +568,7 @@ static struct __DriverAPIRec radeonAPI = { * failure. */ PUBLIC -void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -602,6 +604,16 @@ void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIsc (dri_priv->bpp == 16) ? 16 : 24, (dri_priv->bpp == 16) ? 0 : 8, (dri_priv->backOffset != dri_priv->depthOffset) ); + + /* Calling driInitExtensions here, with a NULL context pointer, does not actually + * enable the extensions. It just makes sure that all the dispatch offsets for all + * the extensions that *might* be enables are known. This is needed because the + * dispatch offsets need to be known when _mesa_context_create is called, but we can't + * enable the extensions until we have a context pointer. + * + * Hello chicken. Hello egg. How are you two today? + */ + driInitExtensions( NULL, card_extensions, GL_FALSE ); } return (void *) psp; diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index bb8f015e760..fa20d10edb3 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -128,7 +128,7 @@ unsigned long time_sum=0; struct timeval tv_s1,tv_f1; #endif -static const struct dri_extension common_extensions[] = +static const struct dri_extension card_extensions[] = { { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, @@ -534,7 +534,7 @@ savageCreateContext( const __GLcontextModes *mesaVis, debug_control ); #endif - driInitExtensions( ctx, common_extensions, GL_TRUE ); + driInitExtensions( ctx, card_extensions, GL_TRUE ); if (savageScreen->chipset >= S3_SAVAGE4) driInitExtensions( ctx, s4_extensions, GL_FALSE ); if (ctx->Mesa_DXTn || @@ -997,7 +997,7 @@ savageFillInModes( unsigned pixel_bits, unsigned depth_bits, * failure. */ PUBLIC -void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -1033,6 +1033,16 @@ void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIsc (dri_priv->cpp == 2) ? 16 : 24, (dri_priv->cpp == 2) ? 0 : 8, (dri_priv->backOffset != dri_priv->depthOffset) ); + + /* Calling driInitExtensions here, with a NULL context pointer, does not actually + * enable the extensions. It just makes sure that all the dispatch offsets for all + * the extensions that *might* be enables are known. This is needed because the + * dispatch offsets need to be known when _mesa_context_create is called, but we can't + * enable the extensions until we have a context pointer. + * + * Hello chicken. Hello egg. How are you two today? + */ + driInitExtensions( NULL, card_extensions, GL_FALSE ); } return (void *) psp; diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c index 2c544524587..6f48eed721e 100644 --- a/src/mesa/drivers/dri/sis/sis_context.c +++ b/src/mesa/drivers/dri/sis/sis_context.c @@ -64,7 +64,7 @@ int GlobalCurrentHwcx = -1; int GlobalHwcxCountBase = 1; int GlobalCmdQueueLen = 0; -static const struct dri_extension card_extensions[] = +const struct dri_extension card_extensions[] = { { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c index 592852e9418..174a74169ce 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.c +++ b/src/mesa/drivers/dri/sis/sis_screen.c @@ -413,7 +413,7 @@ static struct __DriverAPIRec sisAPI = { * failure. */ PUBLIC -void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, +void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes *modes, const __DRIversion *ddx_version, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c index 724416197f2..d90d4f06b96 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c @@ -83,7 +83,7 @@ /** * Common extension strings exported by all cards */ -static const struct dri_extension card_extensions[] = +const struct dri_extension card_extensions[] = { { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_texture_mirrored_repeat", NULL }, @@ -123,7 +123,7 @@ static const struct dri_extension card_extensions[] = /** * Extension strings exported only by Naplam (e.g., Voodoo4 & Voodoo5) cards. */ -static const struct dri_extension napalm_extensions[] = +const struct dri_extension napalm_extensions[] = { { "GL_ARB_texture_compression", GL_ARB_texture_compression_functions }, { "GL_ARB_texture_env_combine", NULL }, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index b373129646b..0da4d7e3c2e 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -65,6 +65,9 @@ DRI_CONF_END; static const GLuint __driNConfigOptions = 1; +extern const struct dri_extension card_extensions[]; +extern const struct dri_extension napalm_extensions[]; + static GLboolean tdfxCreateScreen( __DRIscreenPrivate *sPriv ) { @@ -426,7 +429,7 @@ static __GLcontextModes *tdfxFillInModes(unsigned pixel_bits, * failure. */ PUBLIC -void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, +void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, const __DRIversion * dri_version, @@ -467,6 +470,17 @@ void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIsc *driver_modes = tdfxFillInModes(bpp, (bpp == 16) ? 16 : 24, (bpp == 16) ? 0 : 8, (dri_priv->backOffset!=dri_priv->depthOffset)); + + /* Calling driInitExtensions here, with a NULL context pointer, does not actually + * enable the extensions. It just makes sure that all the dispatch offsets for all + * the extensions that *might* be enables are known. This is needed because the + * dispatch offsets need to be known when _mesa_context_create is called, but we can't + * enable the extensions until we have a context pointer. + * + * Hello chicken. Hello egg. How are you two today? + */ + driInitExtensions( NULL, card_extensions, GL_FALSE ); + driInitExtensions( NULL, napalm_extensions, GL_FALSE ); } return (void *)psp; diff --git a/src/mesa/drivers/dri/trident/trident_context.c b/src/mesa/drivers/dri/trident/trident_context.c index 0af70e96fc9..8d0717937e8 100644 --- a/src/mesa/drivers/dri/trident/trident_context.c +++ b/src/mesa/drivers/dri/trident/trident_context.c @@ -426,7 +426,7 @@ static struct __DriverAPIRec tridentAPI = { }; -PUBLIC void *__driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, +PUBLIC void *__driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c index ca31245b0fd..abcdcd70a5e 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.c +++ b/src/mesa/drivers/dri/unichrome/via_context.c @@ -251,7 +251,7 @@ static void viaBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height) /* Extension strings exported by the Unichrome driver. */ -static const struct dri_extension card_extensions[] = +const struct dri_extension card_extensions[] = { { "GL_ARB_multisample", GL_ARB_multisample_functions }, { "GL_ARB_multitexture", NULL }, diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index 8de73539259..2ae2322f8ac 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -61,6 +61,7 @@ DRI_CONF_BEGIN DRI_CONF_END; static const GLuint __driNConfigOptions = 3; +extern const struct dri_extension card_extensions[]; static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ); @@ -402,7 +403,7 @@ viaFillInModes( unsigned pixel_bits, GLboolean have_back_buffer ) * failure. */ PUBLIC -void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, +void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, const __GLcontextModes * modes, const __DRIversion * ddx_version, @@ -437,6 +438,16 @@ void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, VIADRIPtr dri_priv = (VIADRIPtr) psp->pDevPriv; *driver_modes = viaFillInModes( dri_priv->bytesPerPixel * 8, GL_TRUE ); + + /* Calling driInitExtensions here, with a NULL context pointer, does not actually + * enable the extensions. It just makes sure that all the dispatch offsets for all + * the extensions that *might* be enables are known. This is needed because the + * dispatch offsets need to be known when _mesa_context_create is called, but we can't + * enable the extensions until we have a context pointer. + * + * Hello chicken. Hello egg. How are you two today? + */ + driInitExtensions( NULL, card_extensions, GL_FALSE ); } fprintf(stderr, "%s - succeeded\n", __FUNCTION__); diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h index 3295598e2d1..1e61edcf9f4 100644 --- a/src/mesa/glapi/dispatch.h +++ b/src/mesa/glapi/dispatch.h @@ -44,7 +44,7 @@ #define GET_by_offset(disp, offset) \ (((_glapi_proc *)(disp))[offset]) #define SET_by_offset(disp, offset, fn) \ - ((((_glapi_proc *)(disp))[offset]) = fn) + ((((_glapi_proc *)(disp))[offset]) = (_glapi_proc) fn) #define CALL_NewList(disp, parameters) (*((disp)->NewList)) parameters #define GET_NewList(disp) ((disp)->NewList) @@ -1270,6 +1270,9 @@ #define CALL_MultiTexCoord4svARB(disp, parameters) (*((disp)->MultiTexCoord4svARB)) parameters #define GET_MultiTexCoord4svARB(disp) ((disp)->MultiTexCoord4svARB) #define SET_MultiTexCoord4svARB(disp, fn) ((disp)->MultiTexCoord4svARB = fn) + +#if !defined(IN_DRI_DRIVER) + #define CALL_LoadTransposeMatrixfARB(disp, parameters) (*((disp)->LoadTransposeMatrixfARB)) parameters #define GET_LoadTransposeMatrixfARB(disp) ((disp)->LoadTransposeMatrixfARB) #define SET_LoadTransposeMatrixfARB(disp, fn) ((disp)->LoadTransposeMatrixfARB = fn) @@ -2495,4 +2498,1645 @@ #define GET_StencilMaskSeparate(disp) ((disp)->StencilMaskSeparate) #define SET_StencilMaskSeparate(disp, fn) ((disp)->StencilMaskSeparate = fn) +#else + +#define driDispatchRemapTable_size 408 +extern unsigned driDispatchRemapTable[ driDispatchRemapTable_size ]; + +#define LoadTransposeMatrixfARB_remap_index 0 +#define LoadTransposeMatrixdARB_remap_index 1 +#define MultTransposeMatrixfARB_remap_index 2 +#define MultTransposeMatrixdARB_remap_index 3 +#define SampleCoverageARB_remap_index 4 +#define DrawBuffersARB_remap_index 5 +#define PolygonOffsetEXT_remap_index 6 +#define GetTexFilterFuncSGIS_remap_index 7 +#define TexFilterFuncSGIS_remap_index 8 +#define GetHistogramEXT_remap_index 9 +#define GetHistogramParameterfvEXT_remap_index 10 +#define GetHistogramParameterivEXT_remap_index 11 +#define GetMinmaxEXT_remap_index 12 +#define GetMinmaxParameterfvEXT_remap_index 13 +#define GetMinmaxParameterivEXT_remap_index 14 +#define GetConvolutionFilterEXT_remap_index 15 +#define GetConvolutionParameterfvEXT_remap_index 16 +#define GetConvolutionParameterivEXT_remap_index 17 +#define GetSeparableFilterEXT_remap_index 18 +#define GetColorTableSGI_remap_index 19 +#define GetColorTableParameterfvSGI_remap_index 20 +#define GetColorTableParameterivSGI_remap_index 21 +#define PixelTexGenSGIX_remap_index 22 +#define PixelTexGenParameteriSGIS_remap_index 23 +#define PixelTexGenParameterivSGIS_remap_index 24 +#define PixelTexGenParameterfSGIS_remap_index 25 +#define PixelTexGenParameterfvSGIS_remap_index 26 +#define GetPixelTexGenParameterivSGIS_remap_index 27 +#define GetPixelTexGenParameterfvSGIS_remap_index 28 +#define TexImage4DSGIS_remap_index 29 +#define TexSubImage4DSGIS_remap_index 30 +#define AreTexturesResidentEXT_remap_index 31 +#define GenTexturesEXT_remap_index 32 +#define IsTextureEXT_remap_index 33 +#define DetailTexFuncSGIS_remap_index 34 +#define GetDetailTexFuncSGIS_remap_index 35 +#define SharpenTexFuncSGIS_remap_index 36 +#define GetSharpenTexFuncSGIS_remap_index 37 +#define SampleMaskSGIS_remap_index 38 +#define SamplePatternSGIS_remap_index 39 +#define ColorPointerEXT_remap_index 40 +#define EdgeFlagPointerEXT_remap_index 41 +#define IndexPointerEXT_remap_index 42 +#define NormalPointerEXT_remap_index 43 +#define TexCoordPointerEXT_remap_index 44 +#define VertexPointerEXT_remap_index 45 +#define SpriteParameterfSGIX_remap_index 46 +#define SpriteParameterfvSGIX_remap_index 47 +#define SpriteParameteriSGIX_remap_index 48 +#define SpriteParameterivSGIX_remap_index 49 +#define PointParameterfEXT_remap_index 50 +#define PointParameterfvEXT_remap_index 51 +#define GetInstrumentsSGIX_remap_index 52 +#define InstrumentsBufferSGIX_remap_index 53 +#define PollInstrumentsSGIX_remap_index 54 +#define ReadInstrumentsSGIX_remap_index 55 +#define StartInstrumentsSGIX_remap_index 56 +#define StopInstrumentsSGIX_remap_index 57 +#define FrameZoomSGIX_remap_index 58 +#define TagSampleBufferSGIX_remap_index 59 +#define ReferencePlaneSGIX_remap_index 60 +#define FlushRasterSGIX_remap_index 61 +#define GetListParameterfvSGIX_remap_index 62 +#define GetListParameterivSGIX_remap_index 63 +#define ListParameterfSGIX_remap_index 64 +#define ListParameterfvSGIX_remap_index 65 +#define ListParameteriSGIX_remap_index 66 +#define ListParameterivSGIX_remap_index 67 +#define FragmentColorMaterialSGIX_remap_index 68 +#define FragmentLightfSGIX_remap_index 69 +#define FragmentLightfvSGIX_remap_index 70 +#define FragmentLightiSGIX_remap_index 71 +#define FragmentLightivSGIX_remap_index 72 +#define FragmentLightModelfSGIX_remap_index 73 +#define FragmentLightModelfvSGIX_remap_index 74 +#define FragmentLightModeliSGIX_remap_index 75 +#define FragmentLightModelivSGIX_remap_index 76 +#define FragmentMaterialfSGIX_remap_index 77 +#define FragmentMaterialfvSGIX_remap_index 78 +#define FragmentMaterialiSGIX_remap_index 79 +#define FragmentMaterialivSGIX_remap_index 80 +#define GetFragmentLightfvSGIX_remap_index 81 +#define GetFragmentLightivSGIX_remap_index 82 +#define GetFragmentMaterialfvSGIX_remap_index 83 +#define GetFragmentMaterialivSGIX_remap_index 84 +#define LightEnviSGIX_remap_index 85 +#define VertexWeightfEXT_remap_index 86 +#define VertexWeightfvEXT_remap_index 87 +#define VertexWeightPointerEXT_remap_index 88 +#define FlushVertexArrayRangeNV_remap_index 89 +#define VertexArrayRangeNV_remap_index 90 +#define CombinerParameterfvNV_remap_index 91 +#define CombinerParameterfNV_remap_index 92 +#define CombinerParameterivNV_remap_index 93 +#define CombinerParameteriNV_remap_index 94 +#define CombinerInputNV_remap_index 95 +#define CombinerOutputNV_remap_index 96 +#define FinalCombinerInputNV_remap_index 97 +#define GetCombinerInputParameterfvNV_remap_index 98 +#define GetCombinerInputParameterivNV_remap_index 99 +#define GetCombinerOutputParameterfvNV_remap_index 100 +#define GetCombinerOutputParameterivNV_remap_index 101 +#define GetFinalCombinerInputParameterfvNV_remap_index 102 +#define GetFinalCombinerInputParameterivNV_remap_index 103 +#define ResizeBuffersMESA_remap_index 104 +#define WindowPos2dMESA_remap_index 105 +#define WindowPos2dvMESA_remap_index 106 +#define WindowPos2fMESA_remap_index 107 +#define WindowPos2fvMESA_remap_index 108 +#define WindowPos2iMESA_remap_index 109 +#define WindowPos2ivMESA_remap_index 110 +#define WindowPos2sMESA_remap_index 111 +#define WindowPos2svMESA_remap_index 112 +#define WindowPos3dMESA_remap_index 113 +#define WindowPos3dvMESA_remap_index 114 +#define WindowPos3fMESA_remap_index 115 +#define WindowPos3fvMESA_remap_index 116 +#define WindowPos3iMESA_remap_index 117 +#define WindowPos3ivMESA_remap_index 118 +#define WindowPos3sMESA_remap_index 119 +#define WindowPos3svMESA_remap_index 120 +#define WindowPos4dMESA_remap_index 121 +#define WindowPos4dvMESA_remap_index 122 +#define WindowPos4fMESA_remap_index 123 +#define WindowPos4fvMESA_remap_index 124 +#define WindowPos4iMESA_remap_index 125 +#define WindowPos4ivMESA_remap_index 126 +#define WindowPos4sMESA_remap_index 127 +#define WindowPos4svMESA_remap_index 128 +#define BlendFuncSeparateEXT_remap_index 129 +#define IndexMaterialEXT_remap_index 130 +#define IndexFuncEXT_remap_index 131 +#define LockArraysEXT_remap_index 132 +#define UnlockArraysEXT_remap_index 133 +#define CullParameterdvEXT_remap_index 134 +#define CullParameterfvEXT_remap_index 135 +#define HintPGI_remap_index 136 +#define FogCoordfEXT_remap_index 137 +#define FogCoordfvEXT_remap_index 138 +#define FogCoorddEXT_remap_index 139 +#define FogCoorddvEXT_remap_index 140 +#define FogCoordPointerEXT_remap_index 141 +#define GetColorTableEXT_remap_index 142 +#define GetColorTableParameterivEXT_remap_index 143 +#define GetColorTableParameterfvEXT_remap_index 144 +#define TbufferMask3DFX_remap_index 145 +#define CompressedTexImage3DARB_remap_index 146 +#define CompressedTexImage2DARB_remap_index 147 +#define CompressedTexImage1DARB_remap_index 148 +#define CompressedTexSubImage3DARB_remap_index 149 +#define CompressedTexSubImage2DARB_remap_index 150 +#define CompressedTexSubImage1DARB_remap_index 151 +#define GetCompressedTexImageARB_remap_index 152 +#define SecondaryColor3bEXT_remap_index 153 +#define SecondaryColor3bvEXT_remap_index 154 +#define SecondaryColor3dEXT_remap_index 155 +#define SecondaryColor3dvEXT_remap_index 156 +#define SecondaryColor3fEXT_remap_index 157 +#define SecondaryColor3fvEXT_remap_index 158 +#define SecondaryColor3iEXT_remap_index 159 +#define SecondaryColor3ivEXT_remap_index 160 +#define SecondaryColor3sEXT_remap_index 161 +#define SecondaryColor3svEXT_remap_index 162 +#define SecondaryColor3ubEXT_remap_index 163 +#define SecondaryColor3ubvEXT_remap_index 164 +#define SecondaryColor3uiEXT_remap_index 165 +#define SecondaryColor3uivEXT_remap_index 166 +#define SecondaryColor3usEXT_remap_index 167 +#define SecondaryColor3usvEXT_remap_index 168 +#define SecondaryColorPointerEXT_remap_index 169 +#define AreProgramsResidentNV_remap_index 170 +#define BindProgramNV_remap_index 171 +#define DeleteProgramsNV_remap_index 172 +#define ExecuteProgramNV_remap_index 173 +#define GenProgramsNV_remap_index 174 +#define GetProgramParameterdvNV_remap_index 175 +#define GetProgramParameterfvNV_remap_index 176 +#define GetProgramivNV_remap_index 177 +#define GetProgramStringNV_remap_index 178 +#define GetTrackMatrixivNV_remap_index 179 +#define GetVertexAttribdvARB_remap_index 180 +#define GetVertexAttribfvARB_remap_index 181 +#define GetVertexAttribivARB_remap_index 182 +#define GetVertexAttribPointervNV_remap_index 183 +#define IsProgramNV_remap_index 184 +#define LoadProgramNV_remap_index 185 +#define ProgramParameter4dNV_remap_index 186 +#define ProgramParameter4dvNV_remap_index 187 +#define ProgramParameter4fNV_remap_index 188 +#define ProgramParameter4fvNV_remap_index 189 +#define ProgramParameters4dvNV_remap_index 190 +#define ProgramParameters4fvNV_remap_index 191 +#define RequestResidentProgramsNV_remap_index 192 +#define TrackMatrixNV_remap_index 193 +#define VertexAttribPointerNV_remap_index 194 +#define VertexAttrib1dARB_remap_index 195 +#define VertexAttrib1dvARB_remap_index 196 +#define VertexAttrib1fARB_remap_index 197 +#define VertexAttrib1fvARB_remap_index 198 +#define VertexAttrib1sARB_remap_index 199 +#define VertexAttrib1svARB_remap_index 200 +#define VertexAttrib2dARB_remap_index 201 +#define VertexAttrib2dvARB_remap_index 202 +#define VertexAttrib2fARB_remap_index 203 +#define VertexAttrib2fvARB_remap_index 204 +#define VertexAttrib2sARB_remap_index 205 +#define VertexAttrib2svARB_remap_index 206 +#define VertexAttrib3dARB_remap_index 207 +#define VertexAttrib3dvARB_remap_index 208 +#define VertexAttrib3fARB_remap_index 209 +#define VertexAttrib3fvARB_remap_index 210 +#define VertexAttrib3sARB_remap_index 211 +#define VertexAttrib3svARB_remap_index 212 +#define VertexAttrib4dARB_remap_index 213 +#define VertexAttrib4dvARB_remap_index 214 +#define VertexAttrib4fARB_remap_index 215 +#define VertexAttrib4fvARB_remap_index 216 +#define VertexAttrib4sARB_remap_index 217 +#define VertexAttrib4svARB_remap_index 218 +#define VertexAttrib4NubARB_remap_index 219 +#define VertexAttrib4NubvARB_remap_index 220 +#define VertexAttribs1dvNV_remap_index 221 +#define VertexAttribs1fvNV_remap_index 222 +#define VertexAttribs1svNV_remap_index 223 +#define VertexAttribs2dvNV_remap_index 224 +#define VertexAttribs2fvNV_remap_index 225 +#define VertexAttribs2svNV_remap_index 226 +#define VertexAttribs3dvNV_remap_index 227 +#define VertexAttribs3fvNV_remap_index 228 +#define VertexAttribs3svNV_remap_index 229 +#define VertexAttribs4dvNV_remap_index 230 +#define VertexAttribs4fvNV_remap_index 231 +#define VertexAttribs4svNV_remap_index 232 +#define VertexAttribs4ubvNV_remap_index 233 +#define PointParameteriNV_remap_index 234 +#define PointParameterivNV_remap_index 235 +#define MultiDrawArraysEXT_remap_index 236 +#define MultiDrawElementsEXT_remap_index 237 +#define ActiveStencilFaceEXT_remap_index 238 +#define DeleteFencesNV_remap_index 239 +#define GenFencesNV_remap_index 240 +#define IsFenceNV_remap_index 241 +#define TestFenceNV_remap_index 242 +#define GetFenceivNV_remap_index 243 +#define FinishFenceNV_remap_index 244 +#define SetFenceNV_remap_index 245 +#define VertexAttrib4bvARB_remap_index 246 +#define VertexAttrib4ivARB_remap_index 247 +#define VertexAttrib4ubvARB_remap_index 248 +#define VertexAttrib4usvARB_remap_index 249 +#define VertexAttrib4uivARB_remap_index 250 +#define VertexAttrib4NbvARB_remap_index 251 +#define VertexAttrib4NsvARB_remap_index 252 +#define VertexAttrib4NivARB_remap_index 253 +#define VertexAttrib4NusvARB_remap_index 254 +#define VertexAttrib4NuivARB_remap_index 255 +#define VertexAttribPointerARB_remap_index 256 +#define EnableVertexAttribArrayARB_remap_index 257 +#define DisableVertexAttribArrayARB_remap_index 258 +#define ProgramStringARB_remap_index 259 +#define ProgramEnvParameter4dARB_remap_index 260 +#define ProgramEnvParameter4dvARB_remap_index 261 +#define ProgramEnvParameter4fARB_remap_index 262 +#define ProgramEnvParameter4fvARB_remap_index 263 +#define ProgramLocalParameter4dARB_remap_index 264 +#define ProgramLocalParameter4dvARB_remap_index 265 +#define ProgramLocalParameter4fARB_remap_index 266 +#define ProgramLocalParameter4fvARB_remap_index 267 +#define GetProgramEnvParameterdvARB_remap_index 268 +#define GetProgramEnvParameterfvARB_remap_index 269 +#define GetProgramLocalParameterdvARB_remap_index 270 +#define GetProgramLocalParameterfvARB_remap_index 271 +#define GetProgramivARB_remap_index 272 +#define GetProgramStringARB_remap_index 273 +#define ProgramNamedParameter4fNV_remap_index 274 +#define ProgramNamedParameter4dNV_remap_index 275 +#define ProgramNamedParameter4fvNV_remap_index 276 +#define ProgramNamedParameter4dvNV_remap_index 277 +#define GetProgramNamedParameterfvNV_remap_index 278 +#define GetProgramNamedParameterdvNV_remap_index 279 +#define BindBufferARB_remap_index 280 +#define BufferDataARB_remap_index 281 +#define BufferSubDataARB_remap_index 282 +#define DeleteBuffersARB_remap_index 283 +#define GenBuffersARB_remap_index 284 +#define GetBufferParameterivARB_remap_index 285 +#define GetBufferPointervARB_remap_index 286 +#define GetBufferSubDataARB_remap_index 287 +#define IsBufferARB_remap_index 288 +#define MapBufferARB_remap_index 289 +#define UnmapBufferARB_remap_index 290 +#define DepthBoundsEXT_remap_index 291 +#define GenQueriesARB_remap_index 292 +#define DeleteQueriesARB_remap_index 293 +#define IsQueryARB_remap_index 294 +#define BeginQueryARB_remap_index 295 +#define EndQueryARB_remap_index 296 +#define GetQueryivARB_remap_index 297 +#define GetQueryObjectivARB_remap_index 298 +#define GetQueryObjectuivARB_remap_index 299 +#define MultiModeDrawArraysIBM_remap_index 300 +#define MultiModeDrawElementsIBM_remap_index 301 +#define BlendEquationSeparateEXT_remap_index 302 +#define DeleteObjectARB_remap_index 303 +#define GetHandleARB_remap_index 304 +#define DetachObjectARB_remap_index 305 +#define CreateShaderObjectARB_remap_index 306 +#define ShaderSourceARB_remap_index 307 +#define CompileShaderARB_remap_index 308 +#define CreateProgramObjectARB_remap_index 309 +#define AttachObjectARB_remap_index 310 +#define LinkProgramARB_remap_index 311 +#define UseProgramObjectARB_remap_index 312 +#define ValidateProgramARB_remap_index 313 +#define Uniform1fARB_remap_index 314 +#define Uniform2fARB_remap_index 315 +#define Uniform3fARB_remap_index 316 +#define Uniform4fARB_remap_index 317 +#define Uniform1iARB_remap_index 318 +#define Uniform2iARB_remap_index 319 +#define Uniform3iARB_remap_index 320 +#define Uniform4iARB_remap_index 321 +#define Uniform1fvARB_remap_index 322 +#define Uniform2fvARB_remap_index 323 +#define Uniform3fvARB_remap_index 324 +#define Uniform4fvARB_remap_index 325 +#define Uniform1ivARB_remap_index 326 +#define Uniform2ivARB_remap_index 327 +#define Uniform3ivARB_remap_index 328 +#define Uniform4ivARB_remap_index 329 +#define UniformMatrix2fvARB_remap_index 330 +#define UniformMatrix3fvARB_remap_index 331 +#define UniformMatrix4fvARB_remap_index 332 +#define GetObjectParameterfvARB_remap_index 333 +#define GetObjectParameterivARB_remap_index 334 +#define GetInfoLogARB_remap_index 335 +#define GetAttachedObjectsARB_remap_index 336 +#define GetUniformLocationARB_remap_index 337 +#define GetActiveUniformARB_remap_index 338 +#define GetUniformfvARB_remap_index 339 +#define GetUniformivARB_remap_index 340 +#define GetShaderSourceARB_remap_index 341 +#define BindAttribLocationARB_remap_index 342 +#define GetActiveAttribARB_remap_index 343 +#define GetAttribLocationARB_remap_index 344 +#define GetVertexAttribdvNV_remap_index 345 +#define GetVertexAttribfvNV_remap_index 346 +#define GetVertexAttribivNV_remap_index 347 +#define VertexAttrib1dNV_remap_index 348 +#define VertexAttrib1dvNV_remap_index 349 +#define VertexAttrib1fNV_remap_index 350 +#define VertexAttrib1fvNV_remap_index 351 +#define VertexAttrib1sNV_remap_index 352 +#define VertexAttrib1svNV_remap_index 353 +#define VertexAttrib2dNV_remap_index 354 +#define VertexAttrib2dvNV_remap_index 355 +#define VertexAttrib2fNV_remap_index 356 +#define VertexAttrib2fvNV_remap_index 357 +#define VertexAttrib2sNV_remap_index 358 +#define VertexAttrib2svNV_remap_index 359 +#define VertexAttrib3dNV_remap_index 360 +#define VertexAttrib3dvNV_remap_index 361 +#define VertexAttrib3fNV_remap_index 362 +#define VertexAttrib3fvNV_remap_index 363 +#define VertexAttrib3sNV_remap_index 364 +#define VertexAttrib3svNV_remap_index 365 +#define VertexAttrib4dNV_remap_index 366 +#define VertexAttrib4dvNV_remap_index 367 +#define VertexAttrib4fNV_remap_index 368 +#define VertexAttrib4fvNV_remap_index 369 +#define VertexAttrib4sNV_remap_index 370 +#define VertexAttrib4svNV_remap_index 371 +#define VertexAttrib4ubNV_remap_index 372 +#define VertexAttrib4ubvNV_remap_index 373 +#define GenFragmentShadersATI_remap_index 374 +#define BindFragmentShaderATI_remap_index 375 +#define DeleteFragmentShaderATI_remap_index 376 +#define BeginFragmentShaderATI_remap_index 377 +#define EndFragmentShaderATI_remap_index 378 +#define PassTexCoordATI_remap_index 379 +#define SampleMapATI_remap_index 380 +#define ColorFragmentOp1ATI_remap_index 381 +#define ColorFragmentOp2ATI_remap_index 382 +#define ColorFragmentOp3ATI_remap_index 383 +#define AlphaFragmentOp1ATI_remap_index 384 +#define AlphaFragmentOp2ATI_remap_index 385 +#define AlphaFragmentOp3ATI_remap_index 386 +#define SetFragmentShaderConstantATI_remap_index 387 +#define IsRenderbufferEXT_remap_index 388 +#define BindRenderbufferEXT_remap_index 389 +#define DeleteRenderbuffersEXT_remap_index 390 +#define GenRenderbuffersEXT_remap_index 391 +#define RenderbufferStorageEXT_remap_index 392 +#define GetRenderbufferParameterivEXT_remap_index 393 +#define IsFramebufferEXT_remap_index 394 +#define BindFramebufferEXT_remap_index 395 +#define DeleteFramebuffersEXT_remap_index 396 +#define GenFramebuffersEXT_remap_index 397 +#define CheckFramebufferStatusEXT_remap_index 398 +#define FramebufferTexture1DEXT_remap_index 399 +#define FramebufferTexture2DEXT_remap_index 400 +#define FramebufferTexture3DEXT_remap_index 401 +#define FramebufferRenderbufferEXT_remap_index 402 +#define GetFramebufferAttachmentParameterivEXT_remap_index 403 +#define GenerateMipmapEXT_remap_index 404 +#define StencilFuncSeparate_remap_index 405 +#define StencilOpSeparate_remap_index 406 +#define StencilMaskSeparate_remap_index 407 + +#define CALL_LoadTransposeMatrixfARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index], parameters) +#define GET_LoadTransposeMatrixfARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index]) +#define SET_LoadTransposeMatrixfARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index], fn) +#define CALL_LoadTransposeMatrixdARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], parameters) +#define GET_LoadTransposeMatrixdARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index]) +#define SET_LoadTransposeMatrixdARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], fn) +#define CALL_MultTransposeMatrixfARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[MultTransposeMatrixfARB_remap_index], parameters) +#define GET_MultTransposeMatrixfARB(disp) GET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixfARB_remap_index]) +#define SET_MultTransposeMatrixfARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixfARB_remap_index], fn) +#define CALL_MultTransposeMatrixdARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[MultTransposeMatrixdARB_remap_index], parameters) +#define GET_MultTransposeMatrixdARB(disp) GET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixdARB_remap_index]) +#define SET_MultTransposeMatrixdARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixdARB_remap_index], fn) +#define CALL_SampleCoverageARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampf, GLboolean)), driDispatchRemapTable[SampleCoverageARB_remap_index], parameters) +#define GET_SampleCoverageARB(disp) GET_by_offset(disp, driDispatchRemapTable[SampleCoverageARB_remap_index]) +#define SET_SampleCoverageARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleCoverageARB_remap_index], fn) +#define CALL_DrawBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLenum *)), driDispatchRemapTable[DrawBuffersARB_remap_index], parameters) +#define GET_DrawBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[DrawBuffersARB_remap_index]) +#define SET_DrawBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DrawBuffersARB_remap_index], fn) +#define CALL_PolygonOffsetEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat)), driDispatchRemapTable[PolygonOffsetEXT_remap_index], parameters) +#define GET_PolygonOffsetEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index]) +#define SET_PolygonOffsetEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index], fn) +#define CALL_GetTexFilterFuncSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetTexFilterFuncSGIS_remap_index], parameters) +#define GET_GetTexFilterFuncSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[GetTexFilterFuncSGIS_remap_index]) +#define SET_GetTexFilterFuncSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTexFilterFuncSGIS_remap_index], fn) +#define CALL_TexFilterFuncSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLsizei, const GLfloat *)), driDispatchRemapTable[TexFilterFuncSGIS_remap_index], parameters) +#define GET_TexFilterFuncSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[TexFilterFuncSGIS_remap_index]) +#define SET_TexFilterFuncSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TexFilterFuncSGIS_remap_index], fn) +#define CALL_GetHistogramEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLboolean, GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetHistogramEXT_remap_index], parameters) +#define GET_GetHistogramEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetHistogramEXT_remap_index]) +#define SET_GetHistogramEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetHistogramEXT_remap_index], fn) +#define CALL_GetHistogramParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetHistogramParameterfvEXT_remap_index], parameters) +#define GET_GetHistogramParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetHistogramParameterfvEXT_remap_index]) +#define SET_GetHistogramParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetHistogramParameterfvEXT_remap_index], fn) +#define CALL_GetHistogramParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetHistogramParameterivEXT_remap_index], parameters) +#define GET_GetHistogramParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetHistogramParameterivEXT_remap_index]) +#define SET_GetHistogramParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetHistogramParameterivEXT_remap_index], fn) +#define CALL_GetMinmaxEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLboolean, GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetMinmaxEXT_remap_index], parameters) +#define GET_GetMinmaxEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetMinmaxEXT_remap_index]) +#define SET_GetMinmaxEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetMinmaxEXT_remap_index], fn) +#define CALL_GetMinmaxParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetMinmaxParameterfvEXT_remap_index], parameters) +#define GET_GetMinmaxParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetMinmaxParameterfvEXT_remap_index]) +#define SET_GetMinmaxParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetMinmaxParameterfvEXT_remap_index], fn) +#define CALL_GetMinmaxParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetMinmaxParameterivEXT_remap_index], parameters) +#define GET_GetMinmaxParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetMinmaxParameterivEXT_remap_index]) +#define SET_GetMinmaxParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetMinmaxParameterivEXT_remap_index], fn) +#define CALL_GetConvolutionFilterEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetConvolutionFilterEXT_remap_index], parameters) +#define GET_GetConvolutionFilterEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetConvolutionFilterEXT_remap_index]) +#define SET_GetConvolutionFilterEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetConvolutionFilterEXT_remap_index], fn) +#define CALL_GetConvolutionParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetConvolutionParameterfvEXT_remap_index], parameters) +#define GET_GetConvolutionParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetConvolutionParameterfvEXT_remap_index]) +#define SET_GetConvolutionParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetConvolutionParameterfvEXT_remap_index], fn) +#define CALL_GetConvolutionParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetConvolutionParameterivEXT_remap_index], parameters) +#define GET_GetConvolutionParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetConvolutionParameterivEXT_remap_index]) +#define SET_GetConvolutionParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetConvolutionParameterivEXT_remap_index], fn) +#define CALL_GetSeparableFilterEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *)), driDispatchRemapTable[GetSeparableFilterEXT_remap_index], parameters) +#define GET_GetSeparableFilterEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetSeparableFilterEXT_remap_index]) +#define SET_GetSeparableFilterEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetSeparableFilterEXT_remap_index], fn) +#define CALL_GetColorTableSGI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetColorTableSGI_remap_index], parameters) +#define GET_GetColorTableSGI(disp) GET_by_offset(disp, driDispatchRemapTable[GetColorTableSGI_remap_index]) +#define SET_GetColorTableSGI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetColorTableSGI_remap_index], fn) +#define CALL_GetColorTableParameterfvSGI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetColorTableParameterfvSGI_remap_index], parameters) +#define GET_GetColorTableParameterfvSGI(disp) GET_by_offset(disp, driDispatchRemapTable[GetColorTableParameterfvSGI_remap_index]) +#define SET_GetColorTableParameterfvSGI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetColorTableParameterfvSGI_remap_index], fn) +#define CALL_GetColorTableParameterivSGI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetColorTableParameterivSGI_remap_index], parameters) +#define GET_GetColorTableParameterivSGI(disp) GET_by_offset(disp, driDispatchRemapTable[GetColorTableParameterivSGI_remap_index]) +#define SET_GetColorTableParameterivSGI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetColorTableParameterivSGI_remap_index], fn) +#define CALL_PixelTexGenSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[PixelTexGenSGIX_remap_index], parameters) +#define GET_PixelTexGenSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenSGIX_remap_index]) +#define SET_PixelTexGenSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenSGIX_remap_index], fn) +#define CALL_PixelTexGenParameteriSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index], parameters) +#define GET_PixelTexGenParameteriSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index]) +#define SET_PixelTexGenParameteriSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index], fn) +#define CALL_PixelTexGenParameterivSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index], parameters) +#define GET_PixelTexGenParameterivSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index]) +#define SET_PixelTexGenParameterivSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index], fn) +#define CALL_PixelTexGenParameterfSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index], parameters) +#define GET_PixelTexGenParameterfSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index]) +#define SET_PixelTexGenParameterfSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index], fn) +#define CALL_PixelTexGenParameterfvSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index], parameters) +#define GET_PixelTexGenParameterfvSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index]) +#define SET_PixelTexGenParameterfvSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index], fn) +#define CALL_GetPixelTexGenParameterivSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint *)), driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index], parameters) +#define GET_GetPixelTexGenParameterivSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index]) +#define SET_GetPixelTexGenParameterivSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index], fn) +#define CALL_GetPixelTexGenParameterfvSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index], parameters) +#define GET_GetPixelTexGenParameterfvSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index]) +#define SET_GetPixelTexGenParameterfvSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index], fn) +#define CALL_TexImage4DSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *)), driDispatchRemapTable[TexImage4DSGIS_remap_index], parameters) +#define GET_TexImage4DSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[TexImage4DSGIS_remap_index]) +#define SET_TexImage4DSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TexImage4DSGIS_remap_index], fn) +#define CALL_TexSubImage4DSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *)), driDispatchRemapTable[TexSubImage4DSGIS_remap_index], parameters) +#define GET_TexSubImage4DSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[TexSubImage4DSGIS_remap_index]) +#define SET_TexSubImage4DSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TexSubImage4DSGIS_remap_index], fn) +#define CALL_AreTexturesResidentEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLsizei, const GLuint *, GLboolean *)), driDispatchRemapTable[AreTexturesResidentEXT_remap_index], parameters) +#define GET_AreTexturesResidentEXT(disp) GET_by_offset(disp, driDispatchRemapTable[AreTexturesResidentEXT_remap_index]) +#define SET_AreTexturesResidentEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AreTexturesResidentEXT_remap_index], fn) +#define CALL_GenTexturesEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenTexturesEXT_remap_index], parameters) +#define GET_GenTexturesEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenTexturesEXT_remap_index]) +#define SET_GenTexturesEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenTexturesEXT_remap_index], fn) +#define CALL_IsTextureEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsTextureEXT_remap_index], parameters) +#define GET_IsTextureEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IsTextureEXT_remap_index]) +#define SET_IsTextureEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsTextureEXT_remap_index], fn) +#define CALL_DetailTexFuncSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, const GLfloat *)), driDispatchRemapTable[DetailTexFuncSGIS_remap_index], parameters) +#define GET_DetailTexFuncSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[DetailTexFuncSGIS_remap_index]) +#define SET_DetailTexFuncSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DetailTexFuncSGIS_remap_index], fn) +#define CALL_GetDetailTexFuncSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[GetDetailTexFuncSGIS_remap_index], parameters) +#define GET_GetDetailTexFuncSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[GetDetailTexFuncSGIS_remap_index]) +#define SET_GetDetailTexFuncSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetDetailTexFuncSGIS_remap_index], fn) +#define CALL_SharpenTexFuncSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, const GLfloat *)), driDispatchRemapTable[SharpenTexFuncSGIS_remap_index], parameters) +#define GET_SharpenTexFuncSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[SharpenTexFuncSGIS_remap_index]) +#define SET_SharpenTexFuncSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SharpenTexFuncSGIS_remap_index], fn) +#define CALL_GetSharpenTexFuncSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[GetSharpenTexFuncSGIS_remap_index], parameters) +#define GET_GetSharpenTexFuncSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[GetSharpenTexFuncSGIS_remap_index]) +#define SET_GetSharpenTexFuncSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetSharpenTexFuncSGIS_remap_index], fn) +#define CALL_SampleMaskSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampf, GLboolean)), driDispatchRemapTable[SampleMaskSGIS_remap_index], parameters) +#define GET_SampleMaskSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[SampleMaskSGIS_remap_index]) +#define SET_SampleMaskSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleMaskSGIS_remap_index], fn) +#define CALL_SamplePatternSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[SamplePatternSGIS_remap_index], parameters) +#define GET_SamplePatternSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[SamplePatternSGIS_remap_index]) +#define SET_SamplePatternSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SamplePatternSGIS_remap_index], fn) +#define CALL_ColorPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[ColorPointerEXT_remap_index], parameters) +#define GET_ColorPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ColorPointerEXT_remap_index]) +#define SET_ColorPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorPointerEXT_remap_index], fn) +#define CALL_EdgeFlagPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLsizei, const GLboolean *)), driDispatchRemapTable[EdgeFlagPointerEXT_remap_index], parameters) +#define GET_EdgeFlagPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[EdgeFlagPointerEXT_remap_index]) +#define SET_EdgeFlagPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EdgeFlagPointerEXT_remap_index], fn) +#define CALL_IndexPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[IndexPointerEXT_remap_index], parameters) +#define GET_IndexPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IndexPointerEXT_remap_index]) +#define SET_IndexPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IndexPointerEXT_remap_index], fn) +#define CALL_NormalPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[NormalPointerEXT_remap_index], parameters) +#define GET_NormalPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[NormalPointerEXT_remap_index]) +#define SET_NormalPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[NormalPointerEXT_remap_index], fn) +#define CALL_TexCoordPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[TexCoordPointerEXT_remap_index], parameters) +#define GET_TexCoordPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[TexCoordPointerEXT_remap_index]) +#define SET_TexCoordPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TexCoordPointerEXT_remap_index], fn) +#define CALL_VertexPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexPointerEXT_remap_index], parameters) +#define GET_VertexPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[VertexPointerEXT_remap_index]) +#define SET_VertexPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexPointerEXT_remap_index], fn) +#define CALL_SpriteParameterfSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[SpriteParameterfSGIX_remap_index], parameters) +#define GET_SpriteParameterfSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[SpriteParameterfSGIX_remap_index]) +#define SET_SpriteParameterfSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SpriteParameterfSGIX_remap_index], fn) +#define CALL_SpriteParameterfvSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[SpriteParameterfvSGIX_remap_index], parameters) +#define GET_SpriteParameterfvSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[SpriteParameterfvSGIX_remap_index]) +#define SET_SpriteParameterfvSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SpriteParameterfvSGIX_remap_index], fn) +#define CALL_SpriteParameteriSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[SpriteParameteriSGIX_remap_index], parameters) +#define GET_SpriteParameteriSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[SpriteParameteriSGIX_remap_index]) +#define SET_SpriteParameteriSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SpriteParameteriSGIX_remap_index], fn) +#define CALL_SpriteParameterivSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[SpriteParameterivSGIX_remap_index], parameters) +#define GET_SpriteParameterivSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[SpriteParameterivSGIX_remap_index]) +#define SET_SpriteParameterivSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SpriteParameterivSGIX_remap_index], fn) +#define CALL_PointParameterfEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[PointParameterfEXT_remap_index], parameters) +#define GET_PointParameterfEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterfEXT_remap_index]) +#define SET_PointParameterfEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterfEXT_remap_index], fn) +#define CALL_PointParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[PointParameterfvEXT_remap_index], parameters) +#define GET_PointParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterfvEXT_remap_index]) +#define SET_PointParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterfvEXT_remap_index], fn) +#define CALL_GetInstrumentsSGIX(disp, parameters) CALL_by_offset(disp, (GLint (GLAPIENTRYP)(void)), driDispatchRemapTable[GetInstrumentsSGIX_remap_index], parameters) +#define GET_GetInstrumentsSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[GetInstrumentsSGIX_remap_index]) +#define SET_GetInstrumentsSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetInstrumentsSGIX_remap_index], fn) +#define CALL_InstrumentsBufferSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLint *)), driDispatchRemapTable[InstrumentsBufferSGIX_remap_index], parameters) +#define GET_InstrumentsBufferSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[InstrumentsBufferSGIX_remap_index]) +#define SET_InstrumentsBufferSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[InstrumentsBufferSGIX_remap_index], fn) +#define CALL_PollInstrumentsSGIX(disp, parameters) CALL_by_offset(disp, (GLint (GLAPIENTRYP)(GLint *)), driDispatchRemapTable[PollInstrumentsSGIX_remap_index], parameters) +#define GET_PollInstrumentsSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[PollInstrumentsSGIX_remap_index]) +#define SET_PollInstrumentsSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PollInstrumentsSGIX_remap_index], fn) +#define CALL_ReadInstrumentsSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint)), driDispatchRemapTable[ReadInstrumentsSGIX_remap_index], parameters) +#define GET_ReadInstrumentsSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[ReadInstrumentsSGIX_remap_index]) +#define SET_ReadInstrumentsSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ReadInstrumentsSGIX_remap_index], fn) +#define CALL_StartInstrumentsSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[StartInstrumentsSGIX_remap_index], parameters) +#define GET_StartInstrumentsSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[StartInstrumentsSGIX_remap_index]) +#define SET_StartInstrumentsSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StartInstrumentsSGIX_remap_index], fn) +#define CALL_StopInstrumentsSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint)), driDispatchRemapTable[StopInstrumentsSGIX_remap_index], parameters) +#define GET_StopInstrumentsSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[StopInstrumentsSGIX_remap_index]) +#define SET_StopInstrumentsSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StopInstrumentsSGIX_remap_index], fn) +#define CALL_FrameZoomSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint)), driDispatchRemapTable[FrameZoomSGIX_remap_index], parameters) +#define GET_FrameZoomSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[FrameZoomSGIX_remap_index]) +#define SET_FrameZoomSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FrameZoomSGIX_remap_index], fn) +#define CALL_TagSampleBufferSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[TagSampleBufferSGIX_remap_index], parameters) +#define GET_TagSampleBufferSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[TagSampleBufferSGIX_remap_index]) +#define SET_TagSampleBufferSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TagSampleBufferSGIX_remap_index], fn) +#define CALL_ReferencePlaneSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[ReferencePlaneSGIX_remap_index], parameters) +#define GET_ReferencePlaneSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[ReferencePlaneSGIX_remap_index]) +#define SET_ReferencePlaneSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ReferencePlaneSGIX_remap_index], fn) +#define CALL_FlushRasterSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[FlushRasterSGIX_remap_index], parameters) +#define GET_FlushRasterSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[FlushRasterSGIX_remap_index]) +#define SET_FlushRasterSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FlushRasterSGIX_remap_index], fn) +#define CALL_GetListParameterfvSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetListParameterfvSGIX_remap_index], parameters) +#define GET_GetListParameterfvSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[GetListParameterfvSGIX_remap_index]) +#define SET_GetListParameterfvSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetListParameterfvSGIX_remap_index], fn) +#define CALL_GetListParameterivSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetListParameterivSGIX_remap_index], parameters) +#define GET_GetListParameterivSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[GetListParameterivSGIX_remap_index]) +#define SET_GetListParameterivSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetListParameterivSGIX_remap_index], fn) +#define CALL_ListParameterfSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLfloat)), driDispatchRemapTable[ListParameterfSGIX_remap_index], parameters) +#define GET_ListParameterfSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[ListParameterfSGIX_remap_index]) +#define SET_ListParameterfSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ListParameterfSGIX_remap_index], fn) +#define CALL_ListParameterfvSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, const GLfloat *)), driDispatchRemapTable[ListParameterfvSGIX_remap_index], parameters) +#define GET_ListParameterfvSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[ListParameterfvSGIX_remap_index]) +#define SET_ListParameterfvSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ListParameterfvSGIX_remap_index], fn) +#define CALL_ListParameteriSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint)), driDispatchRemapTable[ListParameteriSGIX_remap_index], parameters) +#define GET_ListParameteriSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[ListParameteriSGIX_remap_index]) +#define SET_ListParameteriSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ListParameteriSGIX_remap_index], fn) +#define CALL_ListParameterivSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, const GLint *)), driDispatchRemapTable[ListParameterivSGIX_remap_index], parameters) +#define GET_ListParameterivSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[ListParameterivSGIX_remap_index]) +#define SET_ListParameterivSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ListParameterivSGIX_remap_index], fn) +#define CALL_FragmentColorMaterialSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum)), driDispatchRemapTable[FragmentColorMaterialSGIX_remap_index], parameters) +#define GET_FragmentColorMaterialSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[FragmentColorMaterialSGIX_remap_index]) +#define SET_FragmentColorMaterialSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FragmentColorMaterialSGIX_remap_index], fn) +#define CALL_FragmentLightfSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat)), driDispatchRemapTable[FragmentLightfSGIX_remap_index], parameters) +#define GET_FragmentLightfSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[FragmentLightfSGIX_remap_index]) +#define SET_FragmentLightfSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FragmentLightfSGIX_remap_index], fn) +#define CALL_FragmentLightfvSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, const GLfloat *)), driDispatchRemapTable[FragmentLightfvSGIX_remap_index], parameters) +#define GET_FragmentLightfvSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[FragmentLightfvSGIX_remap_index]) +#define SET_FragmentLightfvSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FragmentLightfvSGIX_remap_index], fn) +#define CALL_FragmentLightiSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint)), driDispatchRemapTable[FragmentLightiSGIX_remap_index], parameters) +#define GET_FragmentLightiSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[FragmentLightiSGIX_remap_index]) +#define SET_FragmentLightiSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FragmentLightiSGIX_remap_index], fn) +#define CALL_FragmentLightivSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, const GLint *)), driDispatchRemapTable[FragmentLightivSGIX_remap_index], parameters) +#define GET_FragmentLightivSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[FragmentLightivSGIX_remap_index]) +#define SET_FragmentLightivSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FragmentLightivSGIX_remap_index], fn) +#define CALL_FragmentLightModelfSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[FragmentLightModelfSGIX_remap_index], parameters) +#define GET_FragmentLightModelfSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[FragmentLightModelfSGIX_remap_index]) +#define SET_FragmentLightModelfSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FragmentLightModelfSGIX_remap_index], fn) +#define CALL_FragmentLightModelfvSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[FragmentLightModelfvSGIX_remap_index], parameters) +#define GET_FragmentLightModelfvSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[FragmentLightModelfvSGIX_remap_index]) +#define SET_FragmentLightModelfvSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FragmentLightModelfvSGIX_remap_index], fn) +#define CALL_FragmentLightModeliSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[FragmentLightModeliSGIX_remap_index], parameters) +#define GET_FragmentLightModeliSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[FragmentLightModeliSGIX_remap_index]) +#define SET_FragmentLightModeliSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FragmentLightModeliSGIX_remap_index], fn) +#define CALL_FragmentLightModelivSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[FragmentLightModelivSGIX_remap_index], parameters) +#define GET_FragmentLightModelivSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[FragmentLightModelivSGIX_remap_index]) +#define SET_FragmentLightModelivSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FragmentLightModelivSGIX_remap_index], fn) +#define CALL_FragmentMaterialfSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat)), driDispatchRemapTable[FragmentMaterialfSGIX_remap_index], parameters) +#define GET_FragmentMaterialfSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[FragmentMaterialfSGIX_remap_index]) +#define SET_FragmentMaterialfSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FragmentMaterialfSGIX_remap_index], fn) +#define CALL_FragmentMaterialfvSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, const GLfloat *)), driDispatchRemapTable[FragmentMaterialfvSGIX_remap_index], parameters) +#define GET_FragmentMaterialfvSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[FragmentMaterialfvSGIX_remap_index]) +#define SET_FragmentMaterialfvSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FragmentMaterialfvSGIX_remap_index], fn) +#define CALL_FragmentMaterialiSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint)), driDispatchRemapTable[FragmentMaterialiSGIX_remap_index], parameters) +#define GET_FragmentMaterialiSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[FragmentMaterialiSGIX_remap_index]) +#define SET_FragmentMaterialiSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FragmentMaterialiSGIX_remap_index], fn) +#define CALL_FragmentMaterialivSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, const GLint *)), driDispatchRemapTable[FragmentMaterialivSGIX_remap_index], parameters) +#define GET_FragmentMaterialivSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[FragmentMaterialivSGIX_remap_index]) +#define SET_FragmentMaterialivSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FragmentMaterialivSGIX_remap_index], fn) +#define CALL_GetFragmentLightfvSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetFragmentLightfvSGIX_remap_index], parameters) +#define GET_GetFragmentLightfvSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[GetFragmentLightfvSGIX_remap_index]) +#define SET_GetFragmentLightfvSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFragmentLightfvSGIX_remap_index], fn) +#define CALL_GetFragmentLightivSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetFragmentLightivSGIX_remap_index], parameters) +#define GET_GetFragmentLightivSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[GetFragmentLightivSGIX_remap_index]) +#define SET_GetFragmentLightivSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFragmentLightivSGIX_remap_index], fn) +#define CALL_GetFragmentMaterialfvSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetFragmentMaterialfvSGIX_remap_index], parameters) +#define GET_GetFragmentMaterialfvSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[GetFragmentMaterialfvSGIX_remap_index]) +#define SET_GetFragmentMaterialfvSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFragmentMaterialfvSGIX_remap_index], fn) +#define CALL_GetFragmentMaterialivSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetFragmentMaterialivSGIX_remap_index], parameters) +#define GET_GetFragmentMaterialivSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[GetFragmentMaterialivSGIX_remap_index]) +#define SET_GetFragmentMaterialivSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFragmentMaterialivSGIX_remap_index], fn) +#define CALL_LightEnviSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[LightEnviSGIX_remap_index], parameters) +#define GET_LightEnviSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[LightEnviSGIX_remap_index]) +#define SET_LightEnviSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LightEnviSGIX_remap_index], fn) +#define CALL_VertexWeightfEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat)), driDispatchRemapTable[VertexWeightfEXT_remap_index], parameters) +#define GET_VertexWeightfEXT(disp) GET_by_offset(disp, driDispatchRemapTable[VertexWeightfEXT_remap_index]) +#define SET_VertexWeightfEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexWeightfEXT_remap_index], fn) +#define CALL_VertexWeightfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[VertexWeightfvEXT_remap_index], parameters) +#define GET_VertexWeightfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[VertexWeightfvEXT_remap_index]) +#define SET_VertexWeightfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexWeightfvEXT_remap_index], fn) +#define CALL_VertexWeightPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexWeightPointerEXT_remap_index], parameters) +#define GET_VertexWeightPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[VertexWeightPointerEXT_remap_index]) +#define SET_VertexWeightPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexWeightPointerEXT_remap_index], fn) +#define CALL_FlushVertexArrayRangeNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index], parameters) +#define GET_FlushVertexArrayRangeNV(disp) GET_by_offset(disp, driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index]) +#define SET_FlushVertexArrayRangeNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index], fn) +#define CALL_VertexArrayRangeNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLvoid *)), driDispatchRemapTable[VertexArrayRangeNV_remap_index], parameters) +#define GET_VertexArrayRangeNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexArrayRangeNV_remap_index]) +#define SET_VertexArrayRangeNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexArrayRangeNV_remap_index], fn) +#define CALL_CombinerParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[CombinerParameterfvNV_remap_index], parameters) +#define GET_CombinerParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterfvNV_remap_index]) +#define SET_CombinerParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterfvNV_remap_index], fn) +#define CALL_CombinerParameterfNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[CombinerParameterfNV_remap_index], parameters) +#define GET_CombinerParameterfNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterfNV_remap_index]) +#define SET_CombinerParameterfNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterfNV_remap_index], fn) +#define CALL_CombinerParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[CombinerParameterivNV_remap_index], parameters) +#define GET_CombinerParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterivNV_remap_index]) +#define SET_CombinerParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterivNV_remap_index], fn) +#define CALL_CombinerParameteriNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[CombinerParameteriNV_remap_index], parameters) +#define GET_CombinerParameteriNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameteriNV_remap_index]) +#define SET_CombinerParameteriNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameteriNV_remap_index], fn) +#define CALL_CombinerInputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[CombinerInputNV_remap_index], parameters) +#define GET_CombinerInputNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerInputNV_remap_index]) +#define SET_CombinerInputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerInputNV_remap_index], fn) +#define CALL_CombinerOutputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean)), driDispatchRemapTable[CombinerOutputNV_remap_index], parameters) +#define GET_CombinerOutputNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerOutputNV_remap_index]) +#define SET_CombinerOutputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerOutputNV_remap_index], fn) +#define CALL_FinalCombinerInputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[FinalCombinerInputNV_remap_index], parameters) +#define GET_FinalCombinerInputNV(disp) GET_by_offset(disp, driDispatchRemapTable[FinalCombinerInputNV_remap_index]) +#define SET_FinalCombinerInputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FinalCombinerInputNV_remap_index], fn) +#define CALL_GetCombinerInputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index], parameters) +#define GET_GetCombinerInputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index]) +#define SET_GetCombinerInputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index], fn) +#define CALL_GetCombinerInputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index], parameters) +#define GET_GetCombinerInputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index]) +#define SET_GetCombinerInputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index], fn) +#define CALL_GetCombinerOutputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index], parameters) +#define GET_GetCombinerOutputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index]) +#define SET_GetCombinerOutputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index], fn) +#define CALL_GetCombinerOutputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index], parameters) +#define GET_GetCombinerOutputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index]) +#define SET_GetCombinerOutputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index], fn) +#define CALL_GetFinalCombinerInputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index], parameters) +#define GET_GetFinalCombinerInputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index]) +#define SET_GetFinalCombinerInputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index], fn) +#define CALL_GetFinalCombinerInputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index], parameters) +#define GET_GetFinalCombinerInputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index]) +#define SET_GetFinalCombinerInputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index], fn) +#define CALL_ResizeBuffersMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[ResizeBuffersMESA_remap_index], parameters) +#define GET_ResizeBuffersMESA(disp) GET_by_offset(disp, driDispatchRemapTable[ResizeBuffersMESA_remap_index]) +#define SET_ResizeBuffersMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ResizeBuffersMESA_remap_index], fn) +#define CALL_WindowPos2dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble)), driDispatchRemapTable[WindowPos2dMESA_remap_index], parameters) +#define GET_WindowPos2dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2dMESA_remap_index]) +#define SET_WindowPos2dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2dMESA_remap_index], fn) +#define CALL_WindowPos2dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos2dvMESA_remap_index], parameters) +#define GET_WindowPos2dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2dvMESA_remap_index]) +#define SET_WindowPos2dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2dvMESA_remap_index], fn) +#define CALL_WindowPos2fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat)), driDispatchRemapTable[WindowPos2fMESA_remap_index], parameters) +#define GET_WindowPos2fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2fMESA_remap_index]) +#define SET_WindowPos2fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2fMESA_remap_index], fn) +#define CALL_WindowPos2fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos2fvMESA_remap_index], parameters) +#define GET_WindowPos2fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2fvMESA_remap_index]) +#define SET_WindowPos2fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2fvMESA_remap_index], fn) +#define CALL_WindowPos2iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint)), driDispatchRemapTable[WindowPos2iMESA_remap_index], parameters) +#define GET_WindowPos2iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2iMESA_remap_index]) +#define SET_WindowPos2iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2iMESA_remap_index], fn) +#define CALL_WindowPos2ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos2ivMESA_remap_index], parameters) +#define GET_WindowPos2ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2ivMESA_remap_index]) +#define SET_WindowPos2ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2ivMESA_remap_index], fn) +#define CALL_WindowPos2sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort)), driDispatchRemapTable[WindowPos2sMESA_remap_index], parameters) +#define GET_WindowPos2sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2sMESA_remap_index]) +#define SET_WindowPos2sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2sMESA_remap_index], fn) +#define CALL_WindowPos2svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos2svMESA_remap_index], parameters) +#define GET_WindowPos2svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2svMESA_remap_index]) +#define SET_WindowPos2svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2svMESA_remap_index], fn) +#define CALL_WindowPos3dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[WindowPos3dMESA_remap_index], parameters) +#define GET_WindowPos3dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3dMESA_remap_index]) +#define SET_WindowPos3dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3dMESA_remap_index], fn) +#define CALL_WindowPos3dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos3dvMESA_remap_index], parameters) +#define GET_WindowPos3dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3dvMESA_remap_index]) +#define SET_WindowPos3dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3dvMESA_remap_index], fn) +#define CALL_WindowPos3fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[WindowPos3fMESA_remap_index], parameters) +#define GET_WindowPos3fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3fMESA_remap_index]) +#define SET_WindowPos3fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3fMESA_remap_index], fn) +#define CALL_WindowPos3fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos3fvMESA_remap_index], parameters) +#define GET_WindowPos3fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3fvMESA_remap_index]) +#define SET_WindowPos3fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3fvMESA_remap_index], fn) +#define CALL_WindowPos3iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[WindowPos3iMESA_remap_index], parameters) +#define GET_WindowPos3iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3iMESA_remap_index]) +#define SET_WindowPos3iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3iMESA_remap_index], fn) +#define CALL_WindowPos3ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos3ivMESA_remap_index], parameters) +#define GET_WindowPos3ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3ivMESA_remap_index]) +#define SET_WindowPos3ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3ivMESA_remap_index], fn) +#define CALL_WindowPos3sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort)), driDispatchRemapTable[WindowPos3sMESA_remap_index], parameters) +#define GET_WindowPos3sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3sMESA_remap_index]) +#define SET_WindowPos3sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3sMESA_remap_index], fn) +#define CALL_WindowPos3svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos3svMESA_remap_index], parameters) +#define GET_WindowPos3svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3svMESA_remap_index]) +#define SET_WindowPos3svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3svMESA_remap_index], fn) +#define CALL_WindowPos4dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[WindowPos4dMESA_remap_index], parameters) +#define GET_WindowPos4dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4dMESA_remap_index]) +#define SET_WindowPos4dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4dMESA_remap_index], fn) +#define CALL_WindowPos4dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos4dvMESA_remap_index], parameters) +#define GET_WindowPos4dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4dvMESA_remap_index]) +#define SET_WindowPos4dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4dvMESA_remap_index], fn) +#define CALL_WindowPos4fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[WindowPos4fMESA_remap_index], parameters) +#define GET_WindowPos4fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4fMESA_remap_index]) +#define SET_WindowPos4fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4fMESA_remap_index], fn) +#define CALL_WindowPos4fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos4fvMESA_remap_index], parameters) +#define GET_WindowPos4fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4fvMESA_remap_index]) +#define SET_WindowPos4fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4fvMESA_remap_index], fn) +#define CALL_WindowPos4iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint)), driDispatchRemapTable[WindowPos4iMESA_remap_index], parameters) +#define GET_WindowPos4iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4iMESA_remap_index]) +#define SET_WindowPos4iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4iMESA_remap_index], fn) +#define CALL_WindowPos4ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos4ivMESA_remap_index], parameters) +#define GET_WindowPos4ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4ivMESA_remap_index]) +#define SET_WindowPos4ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4ivMESA_remap_index], fn) +#define CALL_WindowPos4sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[WindowPos4sMESA_remap_index], parameters) +#define GET_WindowPos4sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4sMESA_remap_index]) +#define SET_WindowPos4sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4sMESA_remap_index], fn) +#define CALL_WindowPos4svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos4svMESA_remap_index], parameters) +#define GET_WindowPos4svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4svMESA_remap_index]) +#define SET_WindowPos4svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4svMESA_remap_index], fn) +#define CALL_BlendFuncSeparateEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[BlendFuncSeparateEXT_remap_index], parameters) +#define GET_BlendFuncSeparateEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlendFuncSeparateEXT_remap_index]) +#define SET_BlendFuncSeparateEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlendFuncSeparateEXT_remap_index], fn) +#define CALL_IndexMaterialEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum)), driDispatchRemapTable[IndexMaterialEXT_remap_index], parameters) +#define GET_IndexMaterialEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IndexMaterialEXT_remap_index]) +#define SET_IndexMaterialEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IndexMaterialEXT_remap_index], fn) +#define CALL_IndexFuncEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLclampf)), driDispatchRemapTable[IndexFuncEXT_remap_index], parameters) +#define GET_IndexFuncEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IndexFuncEXT_remap_index]) +#define SET_IndexFuncEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IndexFuncEXT_remap_index], fn) +#define CALL_LockArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei)), driDispatchRemapTable[LockArraysEXT_remap_index], parameters) +#define GET_LockArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[LockArraysEXT_remap_index]) +#define SET_LockArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LockArraysEXT_remap_index], fn) +#define CALL_UnlockArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[UnlockArraysEXT_remap_index], parameters) +#define GET_UnlockArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[UnlockArraysEXT_remap_index]) +#define SET_UnlockArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UnlockArraysEXT_remap_index], fn) +#define CALL_CullParameterdvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLdouble *)), driDispatchRemapTable[CullParameterdvEXT_remap_index], parameters) +#define GET_CullParameterdvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CullParameterdvEXT_remap_index]) +#define SET_CullParameterdvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CullParameterdvEXT_remap_index], fn) +#define CALL_CullParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[CullParameterfvEXT_remap_index], parameters) +#define GET_CullParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CullParameterfvEXT_remap_index]) +#define SET_CullParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CullParameterfvEXT_remap_index], fn) +#define CALL_HintPGI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[HintPGI_remap_index], parameters) +#define GET_HintPGI(disp) GET_by_offset(disp, driDispatchRemapTable[HintPGI_remap_index]) +#define SET_HintPGI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[HintPGI_remap_index], fn) +#define CALL_FogCoordfEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat)), driDispatchRemapTable[FogCoordfEXT_remap_index], parameters) +#define GET_FogCoordfEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordfEXT_remap_index]) +#define SET_FogCoordfEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordfEXT_remap_index], fn) +#define CALL_FogCoordfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[FogCoordfvEXT_remap_index], parameters) +#define GET_FogCoordfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordfvEXT_remap_index]) +#define SET_FogCoordfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordfvEXT_remap_index], fn) +#define CALL_FogCoorddEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble)), driDispatchRemapTable[FogCoorddEXT_remap_index], parameters) +#define GET_FogCoorddEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoorddEXT_remap_index]) +#define SET_FogCoorddEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoorddEXT_remap_index], fn) +#define CALL_FogCoorddvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[FogCoorddvEXT_remap_index], parameters) +#define GET_FogCoorddvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoorddvEXT_remap_index]) +#define SET_FogCoorddvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoorddvEXT_remap_index], fn) +#define CALL_FogCoordPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[FogCoordPointerEXT_remap_index], parameters) +#define GET_FogCoordPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordPointerEXT_remap_index]) +#define SET_FogCoordPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordPointerEXT_remap_index], fn) +#define CALL_GetColorTableEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetColorTableEXT_remap_index], parameters) +#define GET_GetColorTableEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetColorTableEXT_remap_index]) +#define SET_GetColorTableEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetColorTableEXT_remap_index], fn) +#define CALL_GetColorTableParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetColorTableParameterivEXT_remap_index], parameters) +#define GET_GetColorTableParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetColorTableParameterivEXT_remap_index]) +#define SET_GetColorTableParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetColorTableParameterivEXT_remap_index], fn) +#define CALL_GetColorTableParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetColorTableParameterfvEXT_remap_index], parameters) +#define GET_GetColorTableParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetColorTableParameterfvEXT_remap_index]) +#define SET_GetColorTableParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetColorTableParameterfvEXT_remap_index], fn) +#define CALL_TbufferMask3DFX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[TbufferMask3DFX_remap_index], parameters) +#define GET_TbufferMask3DFX(disp) GET_by_offset(disp, driDispatchRemapTable[TbufferMask3DFX_remap_index]) +#define SET_TbufferMask3DFX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TbufferMask3DFX_remap_index], fn) +#define CALL_CompressedTexImage3DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage3DARB_remap_index], parameters) +#define GET_CompressedTexImage3DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage3DARB_remap_index]) +#define SET_CompressedTexImage3DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage3DARB_remap_index], fn) +#define CALL_CompressedTexImage2DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage2DARB_remap_index], parameters) +#define GET_CompressedTexImage2DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage2DARB_remap_index]) +#define SET_CompressedTexImage2DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage2DARB_remap_index], fn) +#define CALL_CompressedTexImage1DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage1DARB_remap_index], parameters) +#define GET_CompressedTexImage1DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage1DARB_remap_index]) +#define SET_CompressedTexImage1DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage1DARB_remap_index], fn) +#define CALL_CompressedTexSubImage3DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index], parameters) +#define GET_CompressedTexSubImage3DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index]) +#define SET_CompressedTexSubImage3DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index], fn) +#define CALL_CompressedTexSubImage2DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index], parameters) +#define GET_CompressedTexSubImage2DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index]) +#define SET_CompressedTexSubImage2DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index], fn) +#define CALL_CompressedTexSubImage1DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index], parameters) +#define GET_CompressedTexSubImage1DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index]) +#define SET_CompressedTexSubImage1DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index], fn) +#define CALL_GetCompressedTexImageARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLvoid *)), driDispatchRemapTable[GetCompressedTexImageARB_remap_index], parameters) +#define GET_GetCompressedTexImageARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetCompressedTexImageARB_remap_index]) +#define SET_GetCompressedTexImageARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCompressedTexImageARB_remap_index], fn) +#define CALL_SecondaryColor3bEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLbyte, GLbyte, GLbyte)), driDispatchRemapTable[SecondaryColor3bEXT_remap_index], parameters) +#define GET_SecondaryColor3bEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bEXT_remap_index]) +#define SET_SecondaryColor3bEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bEXT_remap_index], fn) +#define CALL_SecondaryColor3bvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLbyte *)), driDispatchRemapTable[SecondaryColor3bvEXT_remap_index], parameters) +#define GET_SecondaryColor3bvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bvEXT_remap_index]) +#define SET_SecondaryColor3bvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bvEXT_remap_index], fn) +#define CALL_SecondaryColor3dEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[SecondaryColor3dEXT_remap_index], parameters) +#define GET_SecondaryColor3dEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dEXT_remap_index]) +#define SET_SecondaryColor3dEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dEXT_remap_index], fn) +#define CALL_SecondaryColor3dvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[SecondaryColor3dvEXT_remap_index], parameters) +#define GET_SecondaryColor3dvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dvEXT_remap_index]) +#define SET_SecondaryColor3dvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dvEXT_remap_index], fn) +#define CALL_SecondaryColor3fEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[SecondaryColor3fEXT_remap_index], parameters) +#define GET_SecondaryColor3fEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fEXT_remap_index]) +#define SET_SecondaryColor3fEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fEXT_remap_index], fn) +#define CALL_SecondaryColor3fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[SecondaryColor3fvEXT_remap_index], parameters) +#define GET_SecondaryColor3fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fvEXT_remap_index]) +#define SET_SecondaryColor3fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fvEXT_remap_index], fn) +#define CALL_SecondaryColor3iEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[SecondaryColor3iEXT_remap_index], parameters) +#define GET_SecondaryColor3iEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3iEXT_remap_index]) +#define SET_SecondaryColor3iEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3iEXT_remap_index], fn) +#define CALL_SecondaryColor3ivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[SecondaryColor3ivEXT_remap_index], parameters) +#define GET_SecondaryColor3ivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ivEXT_remap_index]) +#define SET_SecondaryColor3ivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ivEXT_remap_index], fn) +#define CALL_SecondaryColor3sEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort)), driDispatchRemapTable[SecondaryColor3sEXT_remap_index], parameters) +#define GET_SecondaryColor3sEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3sEXT_remap_index]) +#define SET_SecondaryColor3sEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3sEXT_remap_index], fn) +#define CALL_SecondaryColor3svEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[SecondaryColor3svEXT_remap_index], parameters) +#define GET_SecondaryColor3svEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3svEXT_remap_index]) +#define SET_SecondaryColor3svEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3svEXT_remap_index], fn) +#define CALL_SecondaryColor3ubEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[SecondaryColor3ubEXT_remap_index], parameters) +#define GET_SecondaryColor3ubEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubEXT_remap_index]) +#define SET_SecondaryColor3ubEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubEXT_remap_index], fn) +#define CALL_SecondaryColor3ubvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLubyte *)), driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index], parameters) +#define GET_SecondaryColor3ubvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index]) +#define SET_SecondaryColor3ubvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index], fn) +#define CALL_SecondaryColor3uiEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLuint)), driDispatchRemapTable[SecondaryColor3uiEXT_remap_index], parameters) +#define GET_SecondaryColor3uiEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uiEXT_remap_index]) +#define SET_SecondaryColor3uiEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uiEXT_remap_index], fn) +#define CALL_SecondaryColor3uivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLuint *)), driDispatchRemapTable[SecondaryColor3uivEXT_remap_index], parameters) +#define GET_SecondaryColor3uivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uivEXT_remap_index]) +#define SET_SecondaryColor3uivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uivEXT_remap_index], fn) +#define CALL_SecondaryColor3usEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLushort, GLushort, GLushort)), driDispatchRemapTable[SecondaryColor3usEXT_remap_index], parameters) +#define GET_SecondaryColor3usEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usEXT_remap_index]) +#define SET_SecondaryColor3usEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usEXT_remap_index], fn) +#define CALL_SecondaryColor3usvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLushort *)), driDispatchRemapTable[SecondaryColor3usvEXT_remap_index], parameters) +#define GET_SecondaryColor3usvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usvEXT_remap_index]) +#define SET_SecondaryColor3usvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usvEXT_remap_index], fn) +#define CALL_SecondaryColorPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[SecondaryColorPointerEXT_remap_index], parameters) +#define GET_SecondaryColorPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColorPointerEXT_remap_index]) +#define SET_SecondaryColorPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColorPointerEXT_remap_index], fn) +#define CALL_AreProgramsResidentNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLsizei, const GLuint *, GLboolean *)), driDispatchRemapTable[AreProgramsResidentNV_remap_index], parameters) +#define GET_AreProgramsResidentNV(disp) GET_by_offset(disp, driDispatchRemapTable[AreProgramsResidentNV_remap_index]) +#define SET_AreProgramsResidentNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AreProgramsResidentNV_remap_index], fn) +#define CALL_BindProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindProgramNV_remap_index], parameters) +#define GET_BindProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[BindProgramNV_remap_index]) +#define SET_BindProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindProgramNV_remap_index], fn) +#define CALL_DeleteProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteProgramsNV_remap_index], parameters) +#define GET_DeleteProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteProgramsNV_remap_index]) +#define SET_DeleteProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteProgramsNV_remap_index], fn) +#define CALL_ExecuteProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ExecuteProgramNV_remap_index], parameters) +#define GET_ExecuteProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[ExecuteProgramNV_remap_index]) +#define SET_ExecuteProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ExecuteProgramNV_remap_index], fn) +#define CALL_GenProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenProgramsNV_remap_index], parameters) +#define GET_GenProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[GenProgramsNV_remap_index]) +#define SET_GenProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenProgramsNV_remap_index], fn) +#define CALL_GetProgramParameterdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetProgramParameterdvNV_remap_index], parameters) +#define GET_GetProgramParameterdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramParameterdvNV_remap_index]) +#define SET_GetProgramParameterdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramParameterdvNV_remap_index], fn) +#define CALL_GetProgramParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetProgramParameterfvNV_remap_index], parameters) +#define GET_GetProgramParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramParameterfvNV_remap_index]) +#define SET_GetProgramParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramParameterfvNV_remap_index], fn) +#define CALL_GetProgramivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetProgramivNV_remap_index], parameters) +#define GET_GetProgramivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramivNV_remap_index]) +#define SET_GetProgramivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramivNV_remap_index], fn) +#define CALL_GetProgramStringNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLubyte *)), driDispatchRemapTable[GetProgramStringNV_remap_index], parameters) +#define GET_GetProgramStringNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramStringNV_remap_index]) +#define SET_GetProgramStringNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramStringNV_remap_index], fn) +#define CALL_GetTrackMatrixivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLint *)), driDispatchRemapTable[GetTrackMatrixivNV_remap_index], parameters) +#define GET_GetTrackMatrixivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetTrackMatrixivNV_remap_index]) +#define SET_GetTrackMatrixivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTrackMatrixivNV_remap_index], fn) +#define CALL_GetVertexAttribdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetVertexAttribdvARB_remap_index], parameters) +#define GET_GetVertexAttribdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvARB_remap_index]) +#define SET_GetVertexAttribdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvARB_remap_index], fn) +#define CALL_GetVertexAttribfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetVertexAttribfvARB_remap_index], parameters) +#define GET_GetVertexAttribfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvARB_remap_index]) +#define SET_GetVertexAttribfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvARB_remap_index], fn) +#define CALL_GetVertexAttribivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetVertexAttribivARB_remap_index], parameters) +#define GET_GetVertexAttribivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivARB_remap_index]) +#define SET_GetVertexAttribivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivARB_remap_index], fn) +#define CALL_GetVertexAttribPointervNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLvoid **)), driDispatchRemapTable[GetVertexAttribPointervNV_remap_index], parameters) +#define GET_GetVertexAttribPointervNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribPointervNV_remap_index]) +#define SET_GetVertexAttribPointervNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribPointervNV_remap_index], fn) +#define CALL_IsProgramNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsProgramNV_remap_index], parameters) +#define GET_IsProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[IsProgramNV_remap_index]) +#define SET_IsProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsProgramNV_remap_index], fn) +#define CALL_LoadProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLubyte *)), driDispatchRemapTable[LoadProgramNV_remap_index], parameters) +#define GET_LoadProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[LoadProgramNV_remap_index]) +#define SET_LoadProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadProgramNV_remap_index], fn) +#define CALL_ProgramParameter4dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramParameter4dNV_remap_index], parameters) +#define GET_ProgramParameter4dNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameter4dNV_remap_index]) +#define SET_ProgramParameter4dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameter4dNV_remap_index], fn) +#define CALL_ProgramParameter4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramParameter4dvNV_remap_index], parameters) +#define GET_ProgramParameter4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameter4dvNV_remap_index]) +#define SET_ProgramParameter4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameter4dvNV_remap_index], fn) +#define CALL_ProgramParameter4fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramParameter4fNV_remap_index], parameters) +#define GET_ProgramParameter4fNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameter4fNV_remap_index]) +#define SET_ProgramParameter4fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameter4fNV_remap_index], fn) +#define CALL_ProgramParameter4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramParameter4fvNV_remap_index], parameters) +#define GET_ProgramParameter4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameter4fvNV_remap_index]) +#define SET_ProgramParameter4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameter4fvNV_remap_index], fn) +#define CALL_ProgramParameters4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramParameters4dvNV_remap_index], parameters) +#define GET_ProgramParameters4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameters4dvNV_remap_index]) +#define SET_ProgramParameters4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameters4dvNV_remap_index], fn) +#define CALL_ProgramParameters4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramParameters4fvNV_remap_index], parameters) +#define GET_ProgramParameters4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameters4fvNV_remap_index]) +#define SET_ProgramParameters4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameters4fvNV_remap_index], fn) +#define CALL_RequestResidentProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[RequestResidentProgramsNV_remap_index], parameters) +#define GET_RequestResidentProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[RequestResidentProgramsNV_remap_index]) +#define SET_RequestResidentProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[RequestResidentProgramsNV_remap_index], fn) +#define CALL_TrackMatrixNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLenum)), driDispatchRemapTable[TrackMatrixNV_remap_index], parameters) +#define GET_TrackMatrixNV(disp) GET_by_offset(disp, driDispatchRemapTable[TrackMatrixNV_remap_index]) +#define SET_TrackMatrixNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TrackMatrixNV_remap_index], fn) +#define CALL_VertexAttribPointerNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLint, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexAttribPointerNV_remap_index], parameters) +#define GET_VertexAttribPointerNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerNV_remap_index]) +#define SET_VertexAttribPointerNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerNV_remap_index], fn) +#define CALL_VertexAttrib1dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble)), driDispatchRemapTable[VertexAttrib1dARB_remap_index], parameters) +#define GET_VertexAttrib1dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dARB_remap_index]) +#define SET_VertexAttrib1dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dARB_remap_index], fn) +#define CALL_VertexAttrib1dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib1dvARB_remap_index], parameters) +#define GET_VertexAttrib1dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvARB_remap_index]) +#define SET_VertexAttrib1dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvARB_remap_index], fn) +#define CALL_VertexAttrib1fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat)), driDispatchRemapTable[VertexAttrib1fARB_remap_index], parameters) +#define GET_VertexAttrib1fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fARB_remap_index]) +#define SET_VertexAttrib1fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fARB_remap_index], fn) +#define CALL_VertexAttrib1fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib1fvARB_remap_index], parameters) +#define GET_VertexAttrib1fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvARB_remap_index]) +#define SET_VertexAttrib1fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvARB_remap_index], fn) +#define CALL_VertexAttrib1sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort)), driDispatchRemapTable[VertexAttrib1sARB_remap_index], parameters) +#define GET_VertexAttrib1sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sARB_remap_index]) +#define SET_VertexAttrib1sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sARB_remap_index], fn) +#define CALL_VertexAttrib1svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib1svARB_remap_index], parameters) +#define GET_VertexAttrib1svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svARB_remap_index]) +#define SET_VertexAttrib1svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svARB_remap_index], fn) +#define CALL_VertexAttrib2dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib2dARB_remap_index], parameters) +#define GET_VertexAttrib2dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dARB_remap_index]) +#define SET_VertexAttrib2dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dARB_remap_index], fn) +#define CALL_VertexAttrib2dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib2dvARB_remap_index], parameters) +#define GET_VertexAttrib2dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvARB_remap_index]) +#define SET_VertexAttrib2dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvARB_remap_index], fn) +#define CALL_VertexAttrib2fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib2fARB_remap_index], parameters) +#define GET_VertexAttrib2fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fARB_remap_index]) +#define SET_VertexAttrib2fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fARB_remap_index], fn) +#define CALL_VertexAttrib2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib2fvARB_remap_index], parameters) +#define GET_VertexAttrib2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvARB_remap_index]) +#define SET_VertexAttrib2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvARB_remap_index], fn) +#define CALL_VertexAttrib2sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib2sARB_remap_index], parameters) +#define GET_VertexAttrib2sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sARB_remap_index]) +#define SET_VertexAttrib2sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sARB_remap_index], fn) +#define CALL_VertexAttrib2svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib2svARB_remap_index], parameters) +#define GET_VertexAttrib2svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svARB_remap_index]) +#define SET_VertexAttrib2svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svARB_remap_index], fn) +#define CALL_VertexAttrib3dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib3dARB_remap_index], parameters) +#define GET_VertexAttrib3dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dARB_remap_index]) +#define SET_VertexAttrib3dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dARB_remap_index], fn) +#define CALL_VertexAttrib3dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib3dvARB_remap_index], parameters) +#define GET_VertexAttrib3dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvARB_remap_index]) +#define SET_VertexAttrib3dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvARB_remap_index], fn) +#define CALL_VertexAttrib3fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib3fARB_remap_index], parameters) +#define GET_VertexAttrib3fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fARB_remap_index]) +#define SET_VertexAttrib3fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fARB_remap_index], fn) +#define CALL_VertexAttrib3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib3fvARB_remap_index], parameters) +#define GET_VertexAttrib3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvARB_remap_index]) +#define SET_VertexAttrib3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvARB_remap_index], fn) +#define CALL_VertexAttrib3sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib3sARB_remap_index], parameters) +#define GET_VertexAttrib3sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sARB_remap_index]) +#define SET_VertexAttrib3sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sARB_remap_index], fn) +#define CALL_VertexAttrib3svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib3svARB_remap_index], parameters) +#define GET_VertexAttrib3svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svARB_remap_index]) +#define SET_VertexAttrib3svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svARB_remap_index], fn) +#define CALL_VertexAttrib4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib4dARB_remap_index], parameters) +#define GET_VertexAttrib4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dARB_remap_index]) +#define SET_VertexAttrib4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dARB_remap_index], fn) +#define CALL_VertexAttrib4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib4dvARB_remap_index], parameters) +#define GET_VertexAttrib4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvARB_remap_index]) +#define SET_VertexAttrib4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvARB_remap_index], fn) +#define CALL_VertexAttrib4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib4fARB_remap_index], parameters) +#define GET_VertexAttrib4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fARB_remap_index]) +#define SET_VertexAttrib4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fARB_remap_index], fn) +#define CALL_VertexAttrib4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib4fvARB_remap_index], parameters) +#define GET_VertexAttrib4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvARB_remap_index]) +#define SET_VertexAttrib4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvARB_remap_index], fn) +#define CALL_VertexAttrib4sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib4sARB_remap_index], parameters) +#define GET_VertexAttrib4sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sARB_remap_index]) +#define SET_VertexAttrib4sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sARB_remap_index], fn) +#define CALL_VertexAttrib4svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4svARB_remap_index], parameters) +#define GET_VertexAttrib4svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svARB_remap_index]) +#define SET_VertexAttrib4svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svARB_remap_index], fn) +#define CALL_VertexAttrib4NubARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[VertexAttrib4NubARB_remap_index], parameters) +#define GET_VertexAttrib4NubARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubARB_remap_index]) +#define SET_VertexAttrib4NubARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubARB_remap_index], fn) +#define CALL_VertexAttrib4NubvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4NubvARB_remap_index], parameters) +#define GET_VertexAttrib4NubvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubvARB_remap_index]) +#define SET_VertexAttrib4NubvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubvARB_remap_index], fn) +#define CALL_VertexAttribs1dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs1dvNV_remap_index], parameters) +#define GET_VertexAttribs1dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1dvNV_remap_index]) +#define SET_VertexAttribs1dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1dvNV_remap_index], fn) +#define CALL_VertexAttribs1fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs1fvNV_remap_index], parameters) +#define GET_VertexAttribs1fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1fvNV_remap_index]) +#define SET_VertexAttribs1fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1fvNV_remap_index], fn) +#define CALL_VertexAttribs1svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs1svNV_remap_index], parameters) +#define GET_VertexAttribs1svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1svNV_remap_index]) +#define SET_VertexAttribs1svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1svNV_remap_index], fn) +#define CALL_VertexAttribs2dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs2dvNV_remap_index], parameters) +#define GET_VertexAttribs2dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2dvNV_remap_index]) +#define SET_VertexAttribs2dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2dvNV_remap_index], fn) +#define CALL_VertexAttribs2fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs2fvNV_remap_index], parameters) +#define GET_VertexAttribs2fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2fvNV_remap_index]) +#define SET_VertexAttribs2fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2fvNV_remap_index], fn) +#define CALL_VertexAttribs2svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs2svNV_remap_index], parameters) +#define GET_VertexAttribs2svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2svNV_remap_index]) +#define SET_VertexAttribs2svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2svNV_remap_index], fn) +#define CALL_VertexAttribs3dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs3dvNV_remap_index], parameters) +#define GET_VertexAttribs3dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3dvNV_remap_index]) +#define SET_VertexAttribs3dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3dvNV_remap_index], fn) +#define CALL_VertexAttribs3fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs3fvNV_remap_index], parameters) +#define GET_VertexAttribs3fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3fvNV_remap_index]) +#define SET_VertexAttribs3fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3fvNV_remap_index], fn) +#define CALL_VertexAttribs3svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs3svNV_remap_index], parameters) +#define GET_VertexAttribs3svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3svNV_remap_index]) +#define SET_VertexAttribs3svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3svNV_remap_index], fn) +#define CALL_VertexAttribs4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs4dvNV_remap_index], parameters) +#define GET_VertexAttribs4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4dvNV_remap_index]) +#define SET_VertexAttribs4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4dvNV_remap_index], fn) +#define CALL_VertexAttribs4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs4fvNV_remap_index], parameters) +#define GET_VertexAttribs4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4fvNV_remap_index]) +#define SET_VertexAttribs4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4fvNV_remap_index], fn) +#define CALL_VertexAttribs4svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs4svNV_remap_index], parameters) +#define GET_VertexAttribs4svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4svNV_remap_index]) +#define SET_VertexAttribs4svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4svNV_remap_index], fn) +#define CALL_VertexAttribs4ubvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *)), driDispatchRemapTable[VertexAttribs4ubvNV_remap_index], parameters) +#define GET_VertexAttribs4ubvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4ubvNV_remap_index]) +#define SET_VertexAttribs4ubvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4ubvNV_remap_index], fn) +#define CALL_PointParameteriNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[PointParameteriNV_remap_index], parameters) +#define GET_PointParameteriNV(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameteriNV_remap_index]) +#define SET_PointParameteriNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameteriNV_remap_index], fn) +#define CALL_PointParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[PointParameterivNV_remap_index], parameters) +#define GET_PointParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterivNV_remap_index]) +#define SET_PointParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterivNV_remap_index], fn) +#define CALL_MultiDrawArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint *, GLsizei *, GLsizei)), driDispatchRemapTable[MultiDrawArraysEXT_remap_index], parameters) +#define GET_MultiDrawArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[MultiDrawArraysEXT_remap_index]) +#define SET_MultiDrawArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiDrawArraysEXT_remap_index], fn) +#define CALL_MultiDrawElementsEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLsizei *, GLenum, const GLvoid **, GLsizei)), driDispatchRemapTable[MultiDrawElementsEXT_remap_index], parameters) +#define GET_MultiDrawElementsEXT(disp) GET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsEXT_remap_index]) +#define SET_MultiDrawElementsEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsEXT_remap_index], fn) +#define CALL_ActiveStencilFaceEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[ActiveStencilFaceEXT_remap_index], parameters) +#define GET_ActiveStencilFaceEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ActiveStencilFaceEXT_remap_index]) +#define SET_ActiveStencilFaceEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ActiveStencilFaceEXT_remap_index], fn) +#define CALL_DeleteFencesNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteFencesNV_remap_index], parameters) +#define GET_DeleteFencesNV(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFencesNV_remap_index]) +#define SET_DeleteFencesNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFencesNV_remap_index], fn) +#define CALL_GenFencesNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenFencesNV_remap_index], parameters) +#define GET_GenFencesNV(disp) GET_by_offset(disp, driDispatchRemapTable[GenFencesNV_remap_index]) +#define SET_GenFencesNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFencesNV_remap_index], fn) +#define CALL_IsFenceNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsFenceNV_remap_index], parameters) +#define GET_IsFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[IsFenceNV_remap_index]) +#define SET_IsFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsFenceNV_remap_index], fn) +#define CALL_TestFenceNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[TestFenceNV_remap_index], parameters) +#define GET_TestFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[TestFenceNV_remap_index]) +#define SET_TestFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TestFenceNV_remap_index], fn) +#define CALL_GetFenceivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetFenceivNV_remap_index], parameters) +#define GET_GetFenceivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFenceivNV_remap_index]) +#define SET_GetFenceivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFenceivNV_remap_index], fn) +#define CALL_FinishFenceNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[FinishFenceNV_remap_index], parameters) +#define GET_FinishFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[FinishFenceNV_remap_index]) +#define SET_FinishFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FinishFenceNV_remap_index], fn) +#define CALL_SetFenceNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum)), driDispatchRemapTable[SetFenceNV_remap_index], parameters) +#define GET_SetFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[SetFenceNV_remap_index]) +#define SET_SetFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SetFenceNV_remap_index], fn) +#define CALL_VertexAttrib4bvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLbyte *)), driDispatchRemapTable[VertexAttrib4bvARB_remap_index], parameters) +#define GET_VertexAttrib4bvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4bvARB_remap_index]) +#define SET_VertexAttrib4bvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4bvARB_remap_index], fn) +#define CALL_VertexAttrib4ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLint *)), driDispatchRemapTable[VertexAttrib4ivARB_remap_index], parameters) +#define GET_VertexAttrib4ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ivARB_remap_index]) +#define SET_VertexAttrib4ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ivARB_remap_index], fn) +#define CALL_VertexAttrib4ubvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4ubvARB_remap_index], parameters) +#define GET_VertexAttrib4ubvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvARB_remap_index]) +#define SET_VertexAttrib4ubvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvARB_remap_index], fn) +#define CALL_VertexAttrib4usvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLushort *)), driDispatchRemapTable[VertexAttrib4usvARB_remap_index], parameters) +#define GET_VertexAttrib4usvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4usvARB_remap_index]) +#define SET_VertexAttrib4usvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4usvARB_remap_index], fn) +#define CALL_VertexAttrib4uivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLuint *)), driDispatchRemapTable[VertexAttrib4uivARB_remap_index], parameters) +#define GET_VertexAttrib4uivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4uivARB_remap_index]) +#define SET_VertexAttrib4uivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4uivARB_remap_index], fn) +#define CALL_VertexAttrib4NbvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLbyte *)), driDispatchRemapTable[VertexAttrib4NbvARB_remap_index], parameters) +#define GET_VertexAttrib4NbvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NbvARB_remap_index]) +#define SET_VertexAttrib4NbvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NbvARB_remap_index], fn) +#define CALL_VertexAttrib4NsvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4NsvARB_remap_index], parameters) +#define GET_VertexAttrib4NsvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NsvARB_remap_index]) +#define SET_VertexAttrib4NsvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NsvARB_remap_index], fn) +#define CALL_VertexAttrib4NivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLint *)), driDispatchRemapTable[VertexAttrib4NivARB_remap_index], parameters) +#define GET_VertexAttrib4NivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NivARB_remap_index]) +#define SET_VertexAttrib4NivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NivARB_remap_index], fn) +#define CALL_VertexAttrib4NusvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLushort *)), driDispatchRemapTable[VertexAttrib4NusvARB_remap_index], parameters) +#define GET_VertexAttrib4NusvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NusvARB_remap_index]) +#define SET_VertexAttrib4NusvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NusvARB_remap_index], fn) +#define CALL_VertexAttrib4NuivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLuint *)), driDispatchRemapTable[VertexAttrib4NuivARB_remap_index], parameters) +#define GET_VertexAttrib4NuivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NuivARB_remap_index]) +#define SET_VertexAttrib4NuivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NuivARB_remap_index], fn) +#define CALL_VertexAttribPointerARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexAttribPointerARB_remap_index], parameters) +#define GET_VertexAttribPointerARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerARB_remap_index]) +#define SET_VertexAttribPointerARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerARB_remap_index], fn) +#define CALL_EnableVertexAttribArrayARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index], parameters) +#define GET_EnableVertexAttribArrayARB(disp) GET_by_offset(disp, driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index]) +#define SET_EnableVertexAttribArrayARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index], fn) +#define CALL_DisableVertexAttribArrayARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index], parameters) +#define GET_DisableVertexAttribArrayARB(disp) GET_by_offset(disp, driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index]) +#define SET_DisableVertexAttribArrayARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index], fn) +#define CALL_ProgramStringARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[ProgramStringARB_remap_index], parameters) +#define GET_ProgramStringARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramStringARB_remap_index]) +#define SET_ProgramStringARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramStringARB_remap_index], fn) +#define CALL_ProgramEnvParameter4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index], parameters) +#define GET_ProgramEnvParameter4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index]) +#define SET_ProgramEnvParameter4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index], fn) +#define CALL_ProgramEnvParameter4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index], parameters) +#define GET_ProgramEnvParameter4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index]) +#define SET_ProgramEnvParameter4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index], fn) +#define CALL_ProgramEnvParameter4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index], parameters) +#define GET_ProgramEnvParameter4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index]) +#define SET_ProgramEnvParameter4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index], fn) +#define CALL_ProgramEnvParameter4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index], parameters) +#define GET_ProgramEnvParameter4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index]) +#define SET_ProgramEnvParameter4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index], fn) +#define CALL_ProgramLocalParameter4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index], parameters) +#define GET_ProgramLocalParameter4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index]) +#define SET_ProgramLocalParameter4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index], fn) +#define CALL_ProgramLocalParameter4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index], parameters) +#define GET_ProgramLocalParameter4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index]) +#define SET_ProgramLocalParameter4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index], fn) +#define CALL_ProgramLocalParameter4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index], parameters) +#define GET_ProgramLocalParameter4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index]) +#define SET_ProgramLocalParameter4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index], fn) +#define CALL_ProgramLocalParameter4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index], parameters) +#define GET_ProgramLocalParameter4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index]) +#define SET_ProgramLocalParameter4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index], fn) +#define CALL_GetProgramEnvParameterdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble *)), driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index], parameters) +#define GET_GetProgramEnvParameterdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index]) +#define SET_GetProgramEnvParameterdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index], fn) +#define CALL_GetProgramEnvParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat *)), driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index], parameters) +#define GET_GetProgramEnvParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index]) +#define SET_GetProgramEnvParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index], fn) +#define CALL_GetProgramLocalParameterdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble *)), driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index], parameters) +#define GET_GetProgramLocalParameterdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index]) +#define SET_GetProgramLocalParameterdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index], fn) +#define CALL_GetProgramLocalParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat *)), driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index], parameters) +#define GET_GetProgramLocalParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index]) +#define SET_GetProgramLocalParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index], fn) +#define CALL_GetProgramivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetProgramivARB_remap_index], parameters) +#define GET_GetProgramivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramivARB_remap_index]) +#define SET_GetProgramivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramivARB_remap_index], fn) +#define CALL_GetProgramStringARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetProgramStringARB_remap_index], parameters) +#define GET_GetProgramStringARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramStringARB_remap_index]) +#define SET_GetProgramStringARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramStringARB_remap_index], fn) +#define CALL_ProgramNamedParameter4fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index], parameters) +#define GET_ProgramNamedParameter4fNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index]) +#define SET_ProgramNamedParameter4fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index], fn) +#define CALL_ProgramNamedParameter4dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index], parameters) +#define GET_ProgramNamedParameter4dNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index]) +#define SET_ProgramNamedParameter4dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index], fn) +#define CALL_ProgramNamedParameter4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, const GLfloat *)), driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index], parameters) +#define GET_ProgramNamedParameter4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index]) +#define SET_ProgramNamedParameter4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index], fn) +#define CALL_ProgramNamedParameter4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, const GLdouble *)), driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index], parameters) +#define GET_ProgramNamedParameter4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index]) +#define SET_ProgramNamedParameter4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index], fn) +#define CALL_GetProgramNamedParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLfloat *)), driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index], parameters) +#define GET_GetProgramNamedParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index]) +#define SET_GetProgramNamedParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index], fn) +#define CALL_GetProgramNamedParameterdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLdouble *)), driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index], parameters) +#define GET_GetProgramNamedParameterdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index]) +#define SET_GetProgramNamedParameterdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index], fn) +#define CALL_BindBufferARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindBufferARB_remap_index], parameters) +#define GET_BindBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[BindBufferARB_remap_index]) +#define SET_BindBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindBufferARB_remap_index], fn) +#define CALL_BufferDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizeiptrARB, const GLvoid *, GLenum)), driDispatchRemapTable[BufferDataARB_remap_index], parameters) +#define GET_BufferDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[BufferDataARB_remap_index]) +#define SET_BufferDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BufferDataARB_remap_index], fn) +#define CALL_BufferSubDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *)), driDispatchRemapTable[BufferSubDataARB_remap_index], parameters) +#define GET_BufferSubDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[BufferSubDataARB_remap_index]) +#define SET_BufferSubDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BufferSubDataARB_remap_index], fn) +#define CALL_DeleteBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteBuffersARB_remap_index], parameters) +#define GET_DeleteBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteBuffersARB_remap_index]) +#define SET_DeleteBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteBuffersARB_remap_index], fn) +#define CALL_GenBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenBuffersARB_remap_index], parameters) +#define GET_GenBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[GenBuffersARB_remap_index]) +#define SET_GenBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenBuffersARB_remap_index], fn) +#define CALL_GetBufferParameterivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetBufferParameterivARB_remap_index], parameters) +#define GET_GetBufferParameterivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferParameterivARB_remap_index]) +#define SET_GetBufferParameterivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferParameterivARB_remap_index], fn) +#define CALL_GetBufferPointervARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLvoid **)), driDispatchRemapTable[GetBufferPointervARB_remap_index], parameters) +#define GET_GetBufferPointervARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferPointervARB_remap_index]) +#define SET_GetBufferPointervARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferPointervARB_remap_index], fn) +#define CALL_GetBufferSubDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *)), driDispatchRemapTable[GetBufferSubDataARB_remap_index], parameters) +#define GET_GetBufferSubDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferSubDataARB_remap_index]) +#define SET_GetBufferSubDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferSubDataARB_remap_index], fn) +#define CALL_IsBufferARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsBufferARB_remap_index], parameters) +#define GET_IsBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[IsBufferARB_remap_index]) +#define SET_IsBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsBufferARB_remap_index], fn) +#define CALL_MapBufferARB(disp, parameters) CALL_by_offset(disp, (GLvoid * (GLAPIENTRYP)(GLenum, GLenum)), driDispatchRemapTable[MapBufferARB_remap_index], parameters) +#define GET_MapBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[MapBufferARB_remap_index]) +#define SET_MapBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MapBufferARB_remap_index], fn) +#define CALL_UnmapBufferARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[UnmapBufferARB_remap_index], parameters) +#define GET_UnmapBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[UnmapBufferARB_remap_index]) +#define SET_UnmapBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UnmapBufferARB_remap_index], fn) +#define CALL_DepthBoundsEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampd, GLclampd)), driDispatchRemapTable[DepthBoundsEXT_remap_index], parameters) +#define GET_DepthBoundsEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DepthBoundsEXT_remap_index]) +#define SET_DepthBoundsEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DepthBoundsEXT_remap_index], fn) +#define CALL_GenQueriesARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenQueriesARB_remap_index], parameters) +#define GET_GenQueriesARB(disp) GET_by_offset(disp, driDispatchRemapTable[GenQueriesARB_remap_index]) +#define SET_GenQueriesARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenQueriesARB_remap_index], fn) +#define CALL_DeleteQueriesARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteQueriesARB_remap_index], parameters) +#define GET_DeleteQueriesARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteQueriesARB_remap_index]) +#define SET_DeleteQueriesARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteQueriesARB_remap_index], fn) +#define CALL_IsQueryARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsQueryARB_remap_index], parameters) +#define GET_IsQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[IsQueryARB_remap_index]) +#define SET_IsQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsQueryARB_remap_index], fn) +#define CALL_BeginQueryARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BeginQueryARB_remap_index], parameters) +#define GET_BeginQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[BeginQueryARB_remap_index]) +#define SET_BeginQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BeginQueryARB_remap_index], fn) +#define CALL_EndQueryARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[EndQueryARB_remap_index], parameters) +#define GET_EndQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[EndQueryARB_remap_index]) +#define SET_EndQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EndQueryARB_remap_index], fn) +#define CALL_GetQueryivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetQueryivARB_remap_index], parameters) +#define GET_GetQueryivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryivARB_remap_index]) +#define SET_GetQueryivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryivARB_remap_index], fn) +#define CALL_GetQueryObjectivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetQueryObjectivARB_remap_index], parameters) +#define GET_GetQueryObjectivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectivARB_remap_index]) +#define SET_GetQueryObjectivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectivARB_remap_index], fn) +#define CALL_GetQueryObjectuivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint *)), driDispatchRemapTable[GetQueryObjectuivARB_remap_index], parameters) +#define GET_GetQueryObjectuivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectuivARB_remap_index]) +#define SET_GetQueryObjectuivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectuivARB_remap_index], fn) +#define CALL_MultiModeDrawArraysIBM(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint)), driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index], parameters) +#define GET_MultiModeDrawArraysIBM(disp) GET_by_offset(disp, driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index]) +#define SET_MultiModeDrawArraysIBM(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index], fn) +#define CALL_MultiModeDrawElementsIBM(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLenum *, const GLsizei *, GLenum, const GLvoid * const *, GLsizei, GLint)), driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index], parameters) +#define GET_MultiModeDrawElementsIBM(disp) GET_by_offset(disp, driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index]) +#define SET_MultiModeDrawElementsIBM(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index], fn) +#define CALL_BlendEquationSeparateEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum)), driDispatchRemapTable[BlendEquationSeparateEXT_remap_index], parameters) +#define GET_BlendEquationSeparateEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlendEquationSeparateEXT_remap_index]) +#define SET_BlendEquationSeparateEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlendEquationSeparateEXT_remap_index], fn) +#define CALL_DeleteObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[DeleteObjectARB_remap_index], parameters) +#define GET_DeleteObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteObjectARB_remap_index]) +#define SET_DeleteObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteObjectARB_remap_index], fn) +#define CALL_GetHandleARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[GetHandleARB_remap_index], parameters) +#define GET_GetHandleARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetHandleARB_remap_index]) +#define SET_GetHandleARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetHandleARB_remap_index], fn) +#define CALL_DetachObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLhandleARB)), driDispatchRemapTable[DetachObjectARB_remap_index], parameters) +#define GET_DetachObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[DetachObjectARB_remap_index]) +#define SET_DetachObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DetachObjectARB_remap_index], fn) +#define CALL_CreateShaderObjectARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CreateShaderObjectARB_remap_index], parameters) +#define GET_CreateShaderObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[CreateShaderObjectARB_remap_index]) +#define SET_CreateShaderObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateShaderObjectARB_remap_index], fn) +#define CALL_ShaderSourceARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, const GLcharARB **, const GLint *)), driDispatchRemapTable[ShaderSourceARB_remap_index], parameters) +#define GET_ShaderSourceARB(disp) GET_by_offset(disp, driDispatchRemapTable[ShaderSourceARB_remap_index]) +#define SET_ShaderSourceARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ShaderSourceARB_remap_index], fn) +#define CALL_CompileShaderARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[CompileShaderARB_remap_index], parameters) +#define GET_CompileShaderARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompileShaderARB_remap_index]) +#define SET_CompileShaderARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompileShaderARB_remap_index], fn) +#define CALL_CreateProgramObjectARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(void)), driDispatchRemapTable[CreateProgramObjectARB_remap_index], parameters) +#define GET_CreateProgramObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[CreateProgramObjectARB_remap_index]) +#define SET_CreateProgramObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateProgramObjectARB_remap_index], fn) +#define CALL_AttachObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLhandleARB)), driDispatchRemapTable[AttachObjectARB_remap_index], parameters) +#define GET_AttachObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[AttachObjectARB_remap_index]) +#define SET_AttachObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AttachObjectARB_remap_index], fn) +#define CALL_LinkProgramARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[LinkProgramARB_remap_index], parameters) +#define GET_LinkProgramARB(disp) GET_by_offset(disp, driDispatchRemapTable[LinkProgramARB_remap_index]) +#define SET_LinkProgramARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LinkProgramARB_remap_index], fn) +#define CALL_UseProgramObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[UseProgramObjectARB_remap_index], parameters) +#define GET_UseProgramObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[UseProgramObjectARB_remap_index]) +#define SET_UseProgramObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UseProgramObjectARB_remap_index], fn) +#define CALL_ValidateProgramARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[ValidateProgramARB_remap_index], parameters) +#define GET_ValidateProgramARB(disp) GET_by_offset(disp, driDispatchRemapTable[ValidateProgramARB_remap_index]) +#define SET_ValidateProgramARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ValidateProgramARB_remap_index], fn) +#define CALL_Uniform1fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat)), driDispatchRemapTable[Uniform1fARB_remap_index], parameters) +#define GET_Uniform1fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1fARB_remap_index]) +#define SET_Uniform1fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1fARB_remap_index], fn) +#define CALL_Uniform2fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat)), driDispatchRemapTable[Uniform2fARB_remap_index], parameters) +#define GET_Uniform2fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2fARB_remap_index]) +#define SET_Uniform2fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2fARB_remap_index], fn) +#define CALL_Uniform3fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[Uniform3fARB_remap_index], parameters) +#define GET_Uniform3fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3fARB_remap_index]) +#define SET_Uniform3fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3fARB_remap_index], fn) +#define CALL_Uniform4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[Uniform4fARB_remap_index], parameters) +#define GET_Uniform4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4fARB_remap_index]) +#define SET_Uniform4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4fARB_remap_index], fn) +#define CALL_Uniform1iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint)), driDispatchRemapTable[Uniform1iARB_remap_index], parameters) +#define GET_Uniform1iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1iARB_remap_index]) +#define SET_Uniform1iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1iARB_remap_index], fn) +#define CALL_Uniform2iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[Uniform2iARB_remap_index], parameters) +#define GET_Uniform2iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2iARB_remap_index]) +#define SET_Uniform2iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2iARB_remap_index], fn) +#define CALL_Uniform3iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint)), driDispatchRemapTable[Uniform3iARB_remap_index], parameters) +#define GET_Uniform3iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3iARB_remap_index]) +#define SET_Uniform3iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3iARB_remap_index], fn) +#define CALL_Uniform4iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint, GLint)), driDispatchRemapTable[Uniform4iARB_remap_index], parameters) +#define GET_Uniform4iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4iARB_remap_index]) +#define SET_Uniform4iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4iARB_remap_index], fn) +#define CALL_Uniform1fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform1fvARB_remap_index], parameters) +#define GET_Uniform1fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1fvARB_remap_index]) +#define SET_Uniform1fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1fvARB_remap_index], fn) +#define CALL_Uniform2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform2fvARB_remap_index], parameters) +#define GET_Uniform2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2fvARB_remap_index]) +#define SET_Uniform2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2fvARB_remap_index], fn) +#define CALL_Uniform3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform3fvARB_remap_index], parameters) +#define GET_Uniform3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3fvARB_remap_index]) +#define SET_Uniform3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3fvARB_remap_index], fn) +#define CALL_Uniform4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform4fvARB_remap_index], parameters) +#define GET_Uniform4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4fvARB_remap_index]) +#define SET_Uniform4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4fvARB_remap_index], fn) +#define CALL_Uniform1ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform1ivARB_remap_index], parameters) +#define GET_Uniform1ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1ivARB_remap_index]) +#define SET_Uniform1ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1ivARB_remap_index], fn) +#define CALL_Uniform2ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform2ivARB_remap_index], parameters) +#define GET_Uniform2ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2ivARB_remap_index]) +#define SET_Uniform2ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2ivARB_remap_index], fn) +#define CALL_Uniform3ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform3ivARB_remap_index], parameters) +#define GET_Uniform3ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3ivARB_remap_index]) +#define SET_Uniform3ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3ivARB_remap_index], fn) +#define CALL_Uniform4ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform4ivARB_remap_index], parameters) +#define GET_Uniform4ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4ivARB_remap_index]) +#define SET_Uniform4ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4ivARB_remap_index], fn) +#define CALL_UniformMatrix2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2fvARB_remap_index], parameters) +#define GET_UniformMatrix2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2fvARB_remap_index]) +#define SET_UniformMatrix2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2fvARB_remap_index], fn) +#define CALL_UniformMatrix3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3fvARB_remap_index], parameters) +#define GET_UniformMatrix3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3fvARB_remap_index]) +#define SET_UniformMatrix3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3fvARB_remap_index], fn) +#define CALL_UniformMatrix4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4fvARB_remap_index], parameters) +#define GET_UniformMatrix4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4fvARB_remap_index]) +#define SET_UniformMatrix4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4fvARB_remap_index], fn) +#define CALL_GetObjectParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLenum, GLfloat *)), driDispatchRemapTable[GetObjectParameterfvARB_remap_index], parameters) +#define GET_GetObjectParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetObjectParameterfvARB_remap_index]) +#define SET_GetObjectParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetObjectParameterfvARB_remap_index], fn) +#define CALL_GetObjectParameterivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLenum, GLint *)), driDispatchRemapTable[GetObjectParameterivARB_remap_index], parameters) +#define GET_GetObjectParameterivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetObjectParameterivARB_remap_index]) +#define SET_GetObjectParameterivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetObjectParameterivARB_remap_index], fn) +#define CALL_GetInfoLogARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *)), driDispatchRemapTable[GetInfoLogARB_remap_index], parameters) +#define GET_GetInfoLogARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetInfoLogARB_remap_index]) +#define SET_GetInfoLogARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetInfoLogARB_remap_index], fn) +#define CALL_GetAttachedObjectsARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *)), driDispatchRemapTable[GetAttachedObjectsARB_remap_index], parameters) +#define GET_GetAttachedObjectsARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttachedObjectsARB_remap_index]) +#define SET_GetAttachedObjectsARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttachedObjectsARB_remap_index], fn) +#define CALL_GetUniformLocationARB(disp, parameters) CALL_by_offset(disp, (GLint (GLAPIENTRYP)(GLhandleARB, const GLcharARB *)), driDispatchRemapTable[GetUniformLocationARB_remap_index], parameters) +#define GET_GetUniformLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformLocationARB_remap_index]) +#define SET_GetUniformLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformLocationARB_remap_index], fn) +#define CALL_GetActiveUniformARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *)), driDispatchRemapTable[GetActiveUniformARB_remap_index], parameters) +#define GET_GetActiveUniformARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetActiveUniformARB_remap_index]) +#define SET_GetActiveUniformARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetActiveUniformARB_remap_index], fn) +#define CALL_GetUniformfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLint, GLfloat *)), driDispatchRemapTable[GetUniformfvARB_remap_index], parameters) +#define GET_GetUniformfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformfvARB_remap_index]) +#define SET_GetUniformfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformfvARB_remap_index], fn) +#define CALL_GetUniformivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLint, GLint *)), driDispatchRemapTable[GetUniformivARB_remap_index], parameters) +#define GET_GetUniformivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformivARB_remap_index]) +#define SET_GetUniformivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformivARB_remap_index], fn) +#define CALL_GetShaderSourceARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *)), driDispatchRemapTable[GetShaderSourceARB_remap_index], parameters) +#define GET_GetShaderSourceARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderSourceARB_remap_index]) +#define SET_GetShaderSourceARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderSourceARB_remap_index], fn) +#define CALL_BindAttribLocationARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, const GLcharARB *)), driDispatchRemapTable[BindAttribLocationARB_remap_index], parameters) +#define GET_BindAttribLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[BindAttribLocationARB_remap_index]) +#define SET_BindAttribLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindAttribLocationARB_remap_index], fn) +#define CALL_GetActiveAttribARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *)), driDispatchRemapTable[GetActiveAttribARB_remap_index], parameters) +#define GET_GetActiveAttribARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetActiveAttribARB_remap_index]) +#define SET_GetActiveAttribARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetActiveAttribARB_remap_index], fn) +#define CALL_GetAttribLocationARB(disp, parameters) CALL_by_offset(disp, (GLint (GLAPIENTRYP)(GLhandleARB, const GLcharARB *)), driDispatchRemapTable[GetAttribLocationARB_remap_index], parameters) +#define GET_GetAttribLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttribLocationARB_remap_index]) +#define SET_GetAttribLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttribLocationARB_remap_index], fn) +#define CALL_GetVertexAttribdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetVertexAttribdvNV_remap_index], parameters) +#define GET_GetVertexAttribdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvNV_remap_index]) +#define SET_GetVertexAttribdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvNV_remap_index], fn) +#define CALL_GetVertexAttribfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetVertexAttribfvNV_remap_index], parameters) +#define GET_GetVertexAttribfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvNV_remap_index]) +#define SET_GetVertexAttribfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvNV_remap_index], fn) +#define CALL_GetVertexAttribivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetVertexAttribivNV_remap_index], parameters) +#define GET_GetVertexAttribivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivNV_remap_index]) +#define SET_GetVertexAttribivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivNV_remap_index], fn) +#define CALL_VertexAttrib1dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble)), driDispatchRemapTable[VertexAttrib1dNV_remap_index], parameters) +#define GET_VertexAttrib1dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dNV_remap_index]) +#define SET_VertexAttrib1dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dNV_remap_index], fn) +#define CALL_VertexAttrib1dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib1dvNV_remap_index], parameters) +#define GET_VertexAttrib1dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvNV_remap_index]) +#define SET_VertexAttrib1dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvNV_remap_index], fn) +#define CALL_VertexAttrib1fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat)), driDispatchRemapTable[VertexAttrib1fNV_remap_index], parameters) +#define GET_VertexAttrib1fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fNV_remap_index]) +#define SET_VertexAttrib1fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fNV_remap_index], fn) +#define CALL_VertexAttrib1fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib1fvNV_remap_index], parameters) +#define GET_VertexAttrib1fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvNV_remap_index]) +#define SET_VertexAttrib1fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvNV_remap_index], fn) +#define CALL_VertexAttrib1sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort)), driDispatchRemapTable[VertexAttrib1sNV_remap_index], parameters) +#define GET_VertexAttrib1sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sNV_remap_index]) +#define SET_VertexAttrib1sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sNV_remap_index], fn) +#define CALL_VertexAttrib1svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib1svNV_remap_index], parameters) +#define GET_VertexAttrib1svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svNV_remap_index]) +#define SET_VertexAttrib1svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svNV_remap_index], fn) +#define CALL_VertexAttrib2dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib2dNV_remap_index], parameters) +#define GET_VertexAttrib2dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dNV_remap_index]) +#define SET_VertexAttrib2dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dNV_remap_index], fn) +#define CALL_VertexAttrib2dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib2dvNV_remap_index], parameters) +#define GET_VertexAttrib2dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvNV_remap_index]) +#define SET_VertexAttrib2dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvNV_remap_index], fn) +#define CALL_VertexAttrib2fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib2fNV_remap_index], parameters) +#define GET_VertexAttrib2fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fNV_remap_index]) +#define SET_VertexAttrib2fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fNV_remap_index], fn) +#define CALL_VertexAttrib2fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib2fvNV_remap_index], parameters) +#define GET_VertexAttrib2fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvNV_remap_index]) +#define SET_VertexAttrib2fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvNV_remap_index], fn) +#define CALL_VertexAttrib2sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib2sNV_remap_index], parameters) +#define GET_VertexAttrib2sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sNV_remap_index]) +#define SET_VertexAttrib2sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sNV_remap_index], fn) +#define CALL_VertexAttrib2svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib2svNV_remap_index], parameters) +#define GET_VertexAttrib2svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svNV_remap_index]) +#define SET_VertexAttrib2svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svNV_remap_index], fn) +#define CALL_VertexAttrib3dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib3dNV_remap_index], parameters) +#define GET_VertexAttrib3dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dNV_remap_index]) +#define SET_VertexAttrib3dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dNV_remap_index], fn) +#define CALL_VertexAttrib3dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib3dvNV_remap_index], parameters) +#define GET_VertexAttrib3dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvNV_remap_index]) +#define SET_VertexAttrib3dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvNV_remap_index], fn) +#define CALL_VertexAttrib3fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib3fNV_remap_index], parameters) +#define GET_VertexAttrib3fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fNV_remap_index]) +#define SET_VertexAttrib3fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fNV_remap_index], fn) +#define CALL_VertexAttrib3fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib3fvNV_remap_index], parameters) +#define GET_VertexAttrib3fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvNV_remap_index]) +#define SET_VertexAttrib3fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvNV_remap_index], fn) +#define CALL_VertexAttrib3sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib3sNV_remap_index], parameters) +#define GET_VertexAttrib3sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sNV_remap_index]) +#define SET_VertexAttrib3sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sNV_remap_index], fn) +#define CALL_VertexAttrib3svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib3svNV_remap_index], parameters) +#define GET_VertexAttrib3svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svNV_remap_index]) +#define SET_VertexAttrib3svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svNV_remap_index], fn) +#define CALL_VertexAttrib4dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib4dNV_remap_index], parameters) +#define GET_VertexAttrib4dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dNV_remap_index]) +#define SET_VertexAttrib4dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dNV_remap_index], fn) +#define CALL_VertexAttrib4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib4dvNV_remap_index], parameters) +#define GET_VertexAttrib4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvNV_remap_index]) +#define SET_VertexAttrib4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvNV_remap_index], fn) +#define CALL_VertexAttrib4fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib4fNV_remap_index], parameters) +#define GET_VertexAttrib4fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fNV_remap_index]) +#define SET_VertexAttrib4fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fNV_remap_index], fn) +#define CALL_VertexAttrib4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib4fvNV_remap_index], parameters) +#define GET_VertexAttrib4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvNV_remap_index]) +#define SET_VertexAttrib4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvNV_remap_index], fn) +#define CALL_VertexAttrib4sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib4sNV_remap_index], parameters) +#define GET_VertexAttrib4sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sNV_remap_index]) +#define SET_VertexAttrib4sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sNV_remap_index], fn) +#define CALL_VertexAttrib4svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4svNV_remap_index], parameters) +#define GET_VertexAttrib4svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svNV_remap_index]) +#define SET_VertexAttrib4svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svNV_remap_index], fn) +#define CALL_VertexAttrib4ubNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[VertexAttrib4ubNV_remap_index], parameters) +#define GET_VertexAttrib4ubNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubNV_remap_index]) +#define SET_VertexAttrib4ubNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubNV_remap_index], fn) +#define CALL_VertexAttrib4ubvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4ubvNV_remap_index], parameters) +#define GET_VertexAttrib4ubvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvNV_remap_index]) +#define SET_VertexAttrib4ubvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvNV_remap_index], fn) +#define CALL_GenFragmentShadersATI(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[GenFragmentShadersATI_remap_index], parameters) +#define GET_GenFragmentShadersATI(disp) GET_by_offset(disp, driDispatchRemapTable[GenFragmentShadersATI_remap_index]) +#define SET_GenFragmentShadersATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFragmentShadersATI_remap_index], fn) +#define CALL_BindFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[BindFragmentShaderATI_remap_index], parameters) +#define GET_BindFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[BindFragmentShaderATI_remap_index]) +#define SET_BindFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindFragmentShaderATI_remap_index], fn) +#define CALL_DeleteFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteFragmentShaderATI_remap_index], parameters) +#define GET_DeleteFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFragmentShaderATI_remap_index]) +#define SET_DeleteFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFragmentShaderATI_remap_index], fn) +#define CALL_BeginFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[BeginFragmentShaderATI_remap_index], parameters) +#define GET_BeginFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[BeginFragmentShaderATI_remap_index]) +#define SET_BeginFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BeginFragmentShaderATI_remap_index], fn) +#define CALL_EndFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[EndFragmentShaderATI_remap_index], parameters) +#define GET_EndFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[EndFragmentShaderATI_remap_index]) +#define SET_EndFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EndFragmentShaderATI_remap_index], fn) +#define CALL_PassTexCoordATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLenum)), driDispatchRemapTable[PassTexCoordATI_remap_index], parameters) +#define GET_PassTexCoordATI(disp) GET_by_offset(disp, driDispatchRemapTable[PassTexCoordATI_remap_index]) +#define SET_PassTexCoordATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PassTexCoordATI_remap_index], fn) +#define CALL_SampleMapATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLenum)), driDispatchRemapTable[SampleMapATI_remap_index], parameters) +#define GET_SampleMapATI(disp) GET_by_offset(disp, driDispatchRemapTable[SampleMapATI_remap_index]) +#define SET_SampleMapATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleMapATI_remap_index], fn) +#define CALL_ColorFragmentOp1ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp1ATI_remap_index], parameters) +#define GET_ColorFragmentOp1ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp1ATI_remap_index]) +#define SET_ColorFragmentOp1ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp1ATI_remap_index], fn) +#define CALL_ColorFragmentOp2ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp2ATI_remap_index], parameters) +#define GET_ColorFragmentOp2ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp2ATI_remap_index]) +#define SET_ColorFragmentOp2ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp2ATI_remap_index], fn) +#define CALL_ColorFragmentOp3ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp3ATI_remap_index], parameters) +#define GET_ColorFragmentOp3ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp3ATI_remap_index]) +#define SET_ColorFragmentOp3ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp3ATI_remap_index], fn) +#define CALL_AlphaFragmentOp1ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index], parameters) +#define GET_AlphaFragmentOp1ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index]) +#define SET_AlphaFragmentOp1ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index], fn) +#define CALL_AlphaFragmentOp2ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index], parameters) +#define GET_AlphaFragmentOp2ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index]) +#define SET_AlphaFragmentOp2ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index], fn) +#define CALL_AlphaFragmentOp3ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index], parameters) +#define GET_AlphaFragmentOp3ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index]) +#define SET_AlphaFragmentOp3ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index], fn) +#define CALL_SetFragmentShaderConstantATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index], parameters) +#define GET_SetFragmentShaderConstantATI(disp) GET_by_offset(disp, driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index]) +#define SET_SetFragmentShaderConstantATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index], fn) +#define CALL_IsRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsRenderbufferEXT_remap_index], parameters) +#define GET_IsRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IsRenderbufferEXT_remap_index]) +#define SET_IsRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsRenderbufferEXT_remap_index], fn) +#define CALL_BindRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindRenderbufferEXT_remap_index], parameters) +#define GET_BindRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BindRenderbufferEXT_remap_index]) +#define SET_BindRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindRenderbufferEXT_remap_index], fn) +#define CALL_DeleteRenderbuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index], parameters) +#define GET_DeleteRenderbuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index]) +#define SET_DeleteRenderbuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index], fn) +#define CALL_GenRenderbuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenRenderbuffersEXT_remap_index], parameters) +#define GET_GenRenderbuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenRenderbuffersEXT_remap_index]) +#define SET_GenRenderbuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenRenderbuffersEXT_remap_index], fn) +#define CALL_RenderbufferStorageEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLsizei, GLsizei)), driDispatchRemapTable[RenderbufferStorageEXT_remap_index], parameters) +#define GET_RenderbufferStorageEXT(disp) GET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageEXT_remap_index]) +#define SET_RenderbufferStorageEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageEXT_remap_index], fn) +#define CALL_GetRenderbufferParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index], parameters) +#define GET_GetRenderbufferParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index]) +#define SET_GetRenderbufferParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index], fn) +#define CALL_IsFramebufferEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsFramebufferEXT_remap_index], parameters) +#define GET_IsFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IsFramebufferEXT_remap_index]) +#define SET_IsFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsFramebufferEXT_remap_index], fn) +#define CALL_BindFramebufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindFramebufferEXT_remap_index], parameters) +#define GET_BindFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BindFramebufferEXT_remap_index]) +#define SET_BindFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindFramebufferEXT_remap_index], fn) +#define CALL_DeleteFramebuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteFramebuffersEXT_remap_index], parameters) +#define GET_DeleteFramebuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFramebuffersEXT_remap_index]) +#define SET_DeleteFramebuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFramebuffersEXT_remap_index], fn) +#define CALL_GenFramebuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenFramebuffersEXT_remap_index], parameters) +#define GET_GenFramebuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenFramebuffersEXT_remap_index]) +#define SET_GenFramebuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFramebuffersEXT_remap_index], fn) +#define CALL_CheckFramebufferStatusEXT(disp, parameters) CALL_by_offset(disp, (GLenum (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index], parameters) +#define GET_CheckFramebufferStatusEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index]) +#define SET_CheckFramebufferStatusEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index], fn) +#define CALL_FramebufferTexture1DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint)), driDispatchRemapTable[FramebufferTexture1DEXT_remap_index], parameters) +#define GET_FramebufferTexture1DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture1DEXT_remap_index]) +#define SET_FramebufferTexture1DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture1DEXT_remap_index], fn) +#define CALL_FramebufferTexture2DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint)), driDispatchRemapTable[FramebufferTexture2DEXT_remap_index], parameters) +#define GET_FramebufferTexture2DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture2DEXT_remap_index]) +#define SET_FramebufferTexture2DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture2DEXT_remap_index], fn) +#define CALL_FramebufferTexture3DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint, GLint)), driDispatchRemapTable[FramebufferTexture3DEXT_remap_index], parameters) +#define GET_FramebufferTexture3DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture3DEXT_remap_index]) +#define SET_FramebufferTexture3DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture3DEXT_remap_index], fn) +#define CALL_FramebufferRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint)), driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index], parameters) +#define GET_FramebufferRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index]) +#define SET_FramebufferRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index], fn) +#define CALL_GetFramebufferAttachmentParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index], parameters) +#define GET_GetFramebufferAttachmentParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index]) +#define SET_GetFramebufferAttachmentParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index], fn) +#define CALL_GenerateMipmapEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[GenerateMipmapEXT_remap_index], parameters) +#define GET_GenerateMipmapEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenerateMipmapEXT_remap_index]) +#define SET_GenerateMipmapEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenerateMipmapEXT_remap_index], fn) +#define CALL_StencilFuncSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint, GLuint)), driDispatchRemapTable[StencilFuncSeparate_remap_index], parameters) +#define GET_StencilFuncSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index]) +#define SET_StencilFuncSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index], fn) +#define CALL_StencilOpSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[StencilOpSeparate_remap_index], parameters) +#define GET_StencilOpSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index]) +#define SET_StencilOpSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index], fn) +#define CALL_StencilMaskSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[StencilMaskSeparate_remap_index], parameters) +#define GET_StencilMaskSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilMaskSeparate_remap_index]) +#define SET_StencilMaskSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilMaskSeparate_remap_index], fn) + +#endif /* !defined(IN_DRI_DRIVER) */ + #endif /* !defined( _DISPATCH_H_ ) */ diff --git a/src/mesa/glapi/extension_helper.py b/src/mesa/glapi/extension_helper.py index 21f5b56fbbd..a2a16a8b364 100644 --- a/src/mesa/glapi/extension_helper.py +++ b/src/mesa/glapi/extension_helper.py @@ -102,6 +102,24 @@ vtxfmt = [ "EvalMesh2", \ ] +def all_entrypoints_in_abi(f, abi, api): + for n in f.entry_points: + [category, num] = api.get_category_for_name( n ) + if category not in abi: + return 0 + + return 1 + + +def any_entrypoints_in_abi(f, abi, api): + for n in f.entry_points: + [category, num] = api.get_category_for_name( n ) + if category in abi: + return 1 + + return 0 + + def condition_for_function(f, abi, all_not_in_ABI): """Create a C-preprocessor condition for the function. @@ -133,6 +151,7 @@ class PrintGlExtensionGlue(gl_XML.gl_print_base): def printRealHeader(self): print '#include "utils.h"' + print '#include "dispatch.h"' print '' return @@ -178,7 +197,7 @@ class PrintGlExtensionGlue(gl_XML.gl_print_base): if not category_list.has_key(c): category_list[ c ] = [] - category_list[ c ].append( [f.name, f.offset] ) + category_list[ c ].append( f ) print ' "";' print '#endif' @@ -190,9 +209,17 @@ class PrintGlExtensionGlue(gl_XML.gl_print_base): for category in keys: print '#if defined(need_%s)' % (category) print 'static const struct dri_extension_function %s_functions[] = {' % (category) - for [function, offset] in category_list[ category ]: - print ' { %s_names, %d },' % (function, offset) - print ' { NULL, 0 }' + + for f in category_list[ category ]: + if any_entrypoints_in_abi(f, abi, api): + index_name = "-1" + else: + index_name = "%s_remap_index" % (f.name) + + print ' { %s_names, %s, %d },' % (f.name, index_name, f.offset) + + + print ' { NULL, 0, 0 }' print '};' print '#endif' print '' diff --git a/src/mesa/glapi/gl_offsets.py b/src/mesa/glapi/gl_offsets.py index dfd7fda9d77..6f6be2069c2 100644 --- a/src/mesa/glapi/gl_offsets.py +++ b/src/mesa/glapi/gl_offsets.py @@ -41,8 +41,14 @@ class PrintGlOffsets(gl_XML.gl_print_base): return def printBody(self, api): + last_static = 0 for f in api.functionIterateByOffset(): print '#define _gloffset_%s %d' % (f.name, f.offset) + if f.offset > last_static: + last_static = f.offset + + print '#define _gloffset_FIRST_DYNAMIC %d' % (last_static + 1) + return def show_usage(): diff --git a/src/mesa/glapi/gl_table.py b/src/mesa/glapi/gl_table.py index d585b43cde5..864ac8a8c3e 100644 --- a/src/mesa/glapi/gl_table.py +++ b/src/mesa/glapi/gl_table.py @@ -52,6 +52,8 @@ class PrintGlTable(gl_XML.gl_print_base): print '#define GLAPIENTRYP' print '#endif' print '' + print 'typedef void (*_glapi_proc)(void); /* generic function pointer */' + print '' print 'struct _glapi_table' print '{' return @@ -93,15 +95,9 @@ class PrintRemapTable(gl_XML.gl_print_base): print '#define GET_by_offset(disp, offset) \\' print ' (((_glapi_proc *)(disp))[offset])' print '#define SET_by_offset(disp, offset, fn) \\' - print ' ((((_glapi_proc *)(disp))[offset]) = fn)' + print ' ((((_glapi_proc *)(disp))[offset]) = (_glapi_proc) fn)' print '' - for f in api.functionIterateByOffset(): - print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name) - print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name) - print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name) - return - abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] functions = [] @@ -116,26 +112,44 @@ class PrintRemapTable(gl_XML.gl_print_base): abi_functions.append( f ) - print 'struct _mesa_dispatch_remap_table {' + for f in abi_functions: + print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name) + print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name) + print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name) + + + print '' + print '#if !defined(IN_DRI_DRIVER)' + print '' for [f, index] in functions: - print ' unsigned %s;' % (f.name) + print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name) + print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name) + print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name) - print '};' print '' - print '/* %u functions need remapping. */' % (count) + print '#else' + print '' + print '#define driDispatchRemapTable_size %u' % (count) + print 'extern unsigned driDispatchRemapTable[ driDispatchRemapTable_size ];' print '' - for f in abi_functions: - print '#define CALL_%s(disp, parameters) (*disp->%s) parameters' % (f.name, f.name) + for [f, index] in functions: + print '#define %s_remap_index %u' % (f.name, index) + print '' for [f, index] in functions: arg_string = gl_XML.create_parameter_string( f.parameters, 0 ) cast = '%s (GLAPIENTRYP)(%s)' % (f.return_type, arg_string) - print '#define CALL_%s(disp, parameters) (* (%s) (((_glapi_proc *)disp)[dispatch_remap.%s])) parameters' % (f.name, cast, f.name) + print '#define CALL_%s(disp, parameters) CALL_by_offset(disp, (%s), driDispatchRemapTable[%s_remap_index], parameters)' % (f.name, cast, f.name) + print '#define GET_%s(disp) GET_by_offset(disp, driDispatchRemapTable[%s_remap_index])' % (f.name, f.name) + print '#define SET_%s(disp, fn) SET_by_offset(disp, driDispatchRemapTable[%s_remap_index], fn)' % (f.name, f.name) + + print '' + print '#endif /* !defined(IN_DRI_DRIVER) */' return diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index 5132bebaef5..47a1f164582 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -671,14 +671,52 @@ get_static_proc_name( GLuint offset ) #define DISPATCH_TABLE_SIZE (sizeof(struct _glapi_table) / sizeof(void *) + MAX_EXTENSION_FUNCS) -struct name_address_offset { - const char *Name; - _glapi_proc Address; - GLuint Offset; +/** + * Track information about a function added to the GL API. + */ +struct _glapi_function { + /** + * Name of the function. + */ + const char * name; + + + /** + * Text string that describes the types of the parameters passed to the + * named function. Parameter types are converted to characters using the + * following rules: + * - 'i' for \c GLint, \c GLuint, and \c GLenum + * - 'p' for any pointer type + * - 'f' for \c GLfloat and \c GLclampf + * - 'd' for \c GLdouble and \c GLclampd + */ + const char * parameter_signature; + + + /** + * Offset in the dispatch table where the pointer to the real function is + * located. If the driver has not requested that the named function be + * added to the dispatch table, this will have the value ~0. + */ + unsigned dispatch_offset; + + + /** + * Pointer to the dispatch stub for the named function. + * + * \todo + * The semantic of this field should be changed slightly. Currently, it + * is always expected to be non-\c NULL. However, it would be better to + * only allocate the entry-point stub when the application requests the + * function via \c glXGetProcAddress. This would save memory for all the + * functions that the driver exports but that the application never wants + * to call. + */ + _glapi_proc dispatch_stub; }; -static struct name_address_offset ExtEntryTable[MAX_EXTENSION_FUNCS]; +static struct _glapi_function ExtEntryTable[MAX_EXTENSION_FUNCS]; static GLuint NumExtEntryPoints = 0; #ifdef USE_SPARC_ASM @@ -814,76 +852,189 @@ fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset) /** - * Add a new extension function entrypoint. - * Return: GL_TRUE = success or GL_FALSE = failure + * Generate new entrypoint + * + * Use a temporary dispatch offset of ~0 (i.e. -1). Later, when the driver + * calls \c _glapi_add_dispatch we'll put in the proper offset. If that + * never happens, and the user calls this function, he'll segfault. That's + * what you get when you try calling a GL function that doesn't really exist. + * + * \param funcName Name of the function to create an entry-point for. + * + * \sa _glapi_add_entrypoint */ -PUBLIC GLboolean -_glapi_add_entrypoint(const char *funcName, GLuint offset) + +static struct _glapi_function * +add_function_name( const char * funcName ) { - /* trivial rejection test */ + struct _glapi_function * entry = NULL; + + if (NumExtEntryPoints < MAX_EXTENSION_FUNCS) { + _glapi_proc entrypoint = generate_entrypoint(~0); + if (entrypoint != NULL) { + entry = & ExtEntryTable[NumExtEntryPoints]; + + ExtEntryTable[NumExtEntryPoints].name = str_dup(funcName); + ExtEntryTable[NumExtEntryPoints].parameter_signature = NULL; + ExtEntryTable[NumExtEntryPoints].dispatch_offset = ~0; + ExtEntryTable[NumExtEntryPoints].dispatch_stub = entrypoint; + NumExtEntryPoints++; + } + } + + return entry; +} + + +/** + * Fill-in the dispatch stub for the named function. + * + * This function is intended to be called by a hardware driver. When called, + * a dispatch stub may be created created for the function. A pointer to this + * dispatch function will be returned by glXGetProcAddress. + * + * \param function_names Array of pointers to function names that should + * share a common dispatch offset. + * \param parameter_signature String representing the types of the parameters + * passed to the named function. Parameter types + * are converted to characters using the following + * rules: + * - 'i' for \c GLint, \c GLuint, and \c GLenum + * - 'p' for any pointer type + * - 'f' for \c GLfloat and \c GLclampf + * - 'd' for \c GLdouble and \c GLclampd + * + * \returns + * The offset in the dispatch table of the named function. A pointer to the + * driver's implementation of the named function should be stored at + * \c dispatch_table[\c offset]. + * + * \sa glXGetProcAddress + * + * \warning + * This function can only handle up to 8 names at a time. As far as I know, + * the maximum number of names ever associated with an existing GL function is + * 4 (\c glPointParameterfSGIS, \c glPointParameterfEXT, + * \c glPointParameterfARB, and \c glPointParameterf), so this should not be + * too painful of a limitation. + * + * \todo + * Determine whether or not \c parameter_signature should be allowed to be + * \c NULL. It doesn't seem like much of a hardship for drivers to have to + * pass in an empty string. + * + * \todo + * Determine if code should be added to reject function names that start with + * 'glX'. + * + * \bug + * Add code to compare \c parameter_signature with the parameter signature of + * a static function. In order to do that, we need to find a way to \b get + * the parameter signature of a static function. + */ + +PUBLIC int +_glapi_add_dispatch( const char * const * function_names, + const char * parameter_signature ) +{ + static int next_dynamic_offset = _gloffset_FIRST_DYNAMIC; + const char * const real_sig = (parameter_signature != NULL) + ? parameter_signature : ""; + struct _glapi_function * entry[8]; + GLboolean is_static[8]; + unsigned i; + unsigned j; + int offset = ~0; + int new_offset; + + + (void) memset( is_static, 0, sizeof( is_static ) ); + (void) memset( entry, 0, sizeof( entry ) ); + + for ( i = 0 ; function_names[i] != NULL ; i++ ) { + /* Do some trivial validation on the name of the function. + */ + #ifdef MANGLE - if (!funcName || funcName[0] != 'm' || funcName[1] != 'g' || funcName[2] != 'l') - return GL_FALSE; + if (!function_names[i] || function_names[i][0] != 'm' || function_names[i][1] != 'g' || function_names[i][2] != 'l') + return GL_FALSE; #else - if (!funcName || funcName[0] != 'g' || funcName[1] != 'l') - return GL_FALSE; + if (!function_names[i] || function_names[i][0] != 'g' || function_names[i][1] != 'l') + return GL_FALSE; #endif - - /* first check if the named function is already statically present */ - { - GLint index = get_static_proc_offset(funcName); - if (index >= 0) { - return (GLboolean) ((GLuint) index == offset); /* bad offset! */ + + + /* Determine if the named function already exists. If the function does + * exist, it must have the same parameter signature as the function + * being added. + */ + + new_offset = get_static_proc_offset(function_names[i]); + if (new_offset >= 0) { + /* FIXME: Make sure the parameter signatures match! How do we get + * FIXME: the parameter signature for static functions? + */ + + if ( (offset != ~0) && (new_offset != offset) ) { + return -1; + } + + is_static[i] = GL_TRUE; + offset = new_offset; } - } - - /* See if this function has already been dynamically added */ - { - GLuint i; - for (i = 0; i < NumExtEntryPoints; i++) { - if (strcmp(ExtEntryTable[i].Name, funcName) == 0) { - /* function already registered */ - if (ExtEntryTable[i].Offset == offset) { - return GL_TRUE; /* offsets match */ - } - else if (ExtEntryTable[i].Offset == (GLuint) ~0 - && offset < DISPATCH_TABLE_SIZE) { - /* need to patch-up the dispatch code */ - if (offset != (GLuint) ~0) { - fill_in_entrypoint_offset(ExtEntryTable[i].Address, offset); - ExtEntryTable[i].Offset = offset; - } - return GL_TRUE; - } - else { - return GL_FALSE; /* bad offset! */ - } - } + + + for ( j = 0 ; j < NumExtEntryPoints ; j++ ) { + if (strcmp(ExtEntryTable[j].name, function_names[i]) == 0) { + /* The offset may be ~0 if the function name was added by + * glXGetProcAddress but never filled in by the driver. + */ + + if (ExtEntryTable[j].dispatch_offset != ~0) { + if (strcmp(real_sig, ExtEntryTable[j].parameter_signature) + != 0) { + return -1; + } + + if ( (offset != ~0) && (ExtEntryTable[j].dispatch_offset != offset) ) { + return -1; + } + + offset = ExtEntryTable[j].dispatch_offset; + } + + entry[i] = & ExtEntryTable[j]; + break; + } } } - /* This is a new function, try to add it. */ - if (NumExtEntryPoints >= MAX_EXTENSION_FUNCS || - offset >= DISPATCH_TABLE_SIZE) { - /* No space left */ - return GL_FALSE; + + if (offset == ~0) { + offset = next_dynamic_offset; + next_dynamic_offset++; } - else { - _glapi_proc entrypoint = generate_entrypoint(offset); - if (!entrypoint) - return GL_FALSE; /* couldn't generate assembly */ - /* OK! */ - ExtEntryTable[NumExtEntryPoints].Name = str_dup(funcName); - ExtEntryTable[NumExtEntryPoints].Offset = offset; - ExtEntryTable[NumExtEntryPoints].Address = entrypoint; - NumExtEntryPoints++; - return GL_TRUE; /* success */ - } + for ( i = 0 ; function_names[i] != NULL ; i++ ) { + if (! is_static[i] ) { + if (entry[i] == NULL) { + entry[i] = add_function_name( function_names[i] ); + if (entry[i] == NULL) { + /* FIXME: Possible memory leak here. + */ + return -1; + } + } + - /* should never get here, silence compiler warnings */ - return GL_FALSE; + entry[i]->parameter_signature = str_dup(real_sig); + fill_in_entrypoint_offset(entry[i]->dispatch_stub, offset); + entry[i]->dispatch_offset = offset; + } + } + + return offset; } @@ -896,8 +1047,8 @@ _glapi_get_proc_offset(const char *funcName) /* search extension functions first */ GLuint i; for (i = 0; i < NumExtEntryPoints; i++) { - if (strcmp(ExtEntryTable[i].Name, funcName) == 0) { - return ExtEntryTable[i].Offset; + if (strcmp(ExtEntryTable[i].name, funcName) == 0) { + return ExtEntryTable[i].dispatch_offset; } } @@ -915,6 +1066,7 @@ _glapi_get_proc_offset(const char *funcName) PUBLIC _glapi_proc _glapi_get_proc_address(const char *funcName) { + struct _glapi_function * entry; GLuint i; #ifdef MANGLE @@ -927,8 +1079,8 @@ _glapi_get_proc_address(const char *funcName) /* search extension functions first */ for (i = 0; i < NumExtEntryPoints; i++) { - if (strcmp(ExtEntryTable[i].Name, funcName) == 0) { - return ExtEntryTable[i].Address; + if (strcmp(ExtEntryTable[i].name, funcName) == 0) { + return ExtEntryTable[i].dispatch_stub; } } @@ -939,28 +1091,8 @@ _glapi_get_proc_address(const char *funcName) return func; } - /* generate new entrypoint - use a temporary dispatch offset of - * ~0 (i.e. -1). Later, when the driver calls _glapi_add_entrypoint() - * we'll put in the proper offset. If that never happens, and the - * user calls this function, he'll segfault. That's what you get - * when you try calling a GL function that doesn't really exist. - */ - if (NumExtEntryPoints < MAX_EXTENSION_FUNCS) { - _glapi_proc entrypoint = generate_entrypoint(~0); - if (!entrypoint) - return GL_FALSE; - - ExtEntryTable[NumExtEntryPoints].Name = str_dup(funcName); - ExtEntryTable[NumExtEntryPoints].Offset = ~0; - ExtEntryTable[NumExtEntryPoints].Address = entrypoint; - NumExtEntryPoints++; - - return entrypoint; - } - else { - /* no space for new functions! */ - return NULL; - } + entry = add_function_name(funcName); + return (entry == NULL) ? NULL : entry->dispatch_stub; } @@ -983,8 +1115,8 @@ _glapi_get_proc_name(GLuint offset) /* search added extension functions */ for (i = 0; i < NumExtEntryPoints; i++) { - if (ExtEntryTable[i].Offset == offset) { - return ExtEntryTable[i].Name; + if (ExtEntryTable[i].dispatch_offset == offset) { + return ExtEntryTable[i].name; } } return NULL; diff --git a/src/mesa/glapi/glapi.h b/src/mesa/glapi/glapi.h index c334203394f..eb26ebf87b5 100644 --- a/src/mesa/glapi/glapi.h +++ b/src/mesa/glapi/glapi.h @@ -46,13 +46,10 @@ #include "GL/gl.h" - -struct _glapi_table; +#include "glapitable.h" typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...); -typedef void (*_glapi_proc)(void); /* generic function pointer */ - #if defined (GLX_USE_TLS) @@ -140,9 +137,9 @@ extern void _glapi_check_table(const struct _glapi_table *table); -extern GLboolean -_glapi_add_entrypoint(const char *funcName, GLuint offset); - +extern int +_glapi_add_dispatch( const char * const * function_names, + const char * parameter_signature ); extern GLint _glapi_get_proc_offset(const char *funcName); diff --git a/src/mesa/glapi/glapioffsets.h b/src/mesa/glapi/glapioffsets.h index f7e9c95bd88..262b69e67dd 100644 --- a/src/mesa/glapi/glapioffsets.h +++ b/src/mesa/glapi/glapioffsets.h @@ -845,5 +845,6 @@ #define _gloffset_StencilFuncSeparate 813 #define _gloffset_StencilOpSeparate 814 #define _gloffset_StencilMaskSeparate 815 +#define _gloffset_FIRST_DYNAMIC 816 #endif /* !defined( _GLAPI_OFFSETS_H_ ) */ diff --git a/src/mesa/glapi/glapitable.h b/src/mesa/glapi/glapitable.h index a450311e625..b4c70bdaae9 100644 --- a/src/mesa/glapi/glapitable.h +++ b/src/mesa/glapi/glapitable.h @@ -33,6 +33,8 @@ #define GLAPIENTRYP #endif +typedef void (*_glapi_proc)(void); /* generic function pointer */ + struct _glapi_table { void (GLAPIENTRYP NewList)(GLuint list, GLenum mode); /* 0 */ diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 6c036da8743..956fc9971e8 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2598,7 +2598,10 @@ struct gl_tnl_module * On restore, only need to swap these functions back in. */ /*@{*/ - void *Swapped[NUM_VERTEX_FORMAT_ENTRIES][2]; + struct { + _glapi_proc * location; + _glapi_proc function; + } Swapped[NUM_VERTEX_FORMAT_ENTRIES]; GLuint SwapCount; /*@}*/ }; diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 0d285cb26c9..dcb684837c8 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -49,15 +49,14 @@ { \ GET_CURRENT_CONTEXT(ctx); \ struct gl_tnl_module *tnl = &(ctx->TnlModule); \ - typedef void (*func_ptr_t)(void); \ \ ASSERT( tnl->Current ); \ ASSERT( tnl->SwapCount < NUM_VERTEX_FORMAT_ENTRIES ); \ \ /* Save the swapped function's dispatch entry so it can be */ \ /* restored later. */ \ - tnl->Swapped[tnl->SwapCount][0] = (void *)&(GET_ ## FUNC (ctx->Exec)); \ - *(func_ptr_t *)(tnl->Swapped[tnl->SwapCount]+1) = (func_ptr_t)TAG(FUNC); \ + tnl->Swapped[tnl->SwapCount].location = (_glapi_proc *) & (GET_ ## FUNC (ctx->Exec)); \ + tnl->Swapped[tnl->SwapCount].function = (_glapi_proc)TAG(FUNC); \ tnl->SwapCount++; \ \ if ( 0 ) \ @@ -177,7 +176,7 @@ void _mesa_restore_exec_vtxfmt( GLcontext *ctx ) /* Restore the neutral tnl module wrapper. */ for ( i = 0 ; i < tnl->SwapCount ; i++ ) { - *(void **)tnl->Swapped[i][0] = tnl->Swapped[i][1]; + *(tnl->Swapped[i].location) = tnl->Swapped[i].function; } tnl->SwapCount = 0; -- cgit v1.2.3 From 68679d2b9e526a351c37c89c78ec50e36f2c9087 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 28 Jul 2005 20:55:26 +0000 Subject: Remove '#if 0' block that was accidentally left in. --- include/GL/internal/dri_interface.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index f4098ba8d91..e63415db026 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -38,12 +38,6 @@ #ifndef DRI_INTERFACE_H #define DRI_INTERFACE_H -#if 0 /*ndef DRI_NEW_INTERFACE_ONLY*/ -# include -# include -# include "GL/glxint.h" -#endif - #include #include #include -- cgit v1.2.3 From 160b3284dd3cdad106ad9aebf5fed7e9ff7b142b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 15 Aug 2005 23:25:33 +0000 Subject: include stdint.h if WIN32 and GNUC (Colin Harrison). Patch forwarded to SGI. --- include/GL/glxext.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/GL/glxext.h b/include/GL/glxext.h index ed38b489d83..589d1ef363e 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -347,6 +347,8 @@ typedef long long int int64_t; #include #elif defined(__SCO__) || defined(__USLC__) #include +#elif defined(WIN32) && defined(__GNUC__) +#include #endif #ifndef GLX_VERSION_1_3 -- cgit v1.2.3 From c799e9ec248c5381ba7c1d806f7c1a4dd85698ad Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 2 Sep 2005 13:43:26 +0000 Subject: added GL_EXT_timer_query token --- include/GL/gl.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 1ea97f39078..36a93791a90 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2231,6 +2231,15 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen #endif /* GL_ATI_blend_equation_separate */ +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 + +#define GL_TIME_ELAPSED_EXT 0x88BF + +#endif /* GL_EXT_timer_query */ + + + /** ** NOTE!!!!! If you add new functions to this file, or update ** glext.h be sure to regenerate the gl_mangle.h file. See comments -- cgit v1.2.3 From f66084b834ce37e7f0143e456df1265cd343a674 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Mon, 5 Sep 2005 14:48:39 +0000 Subject: Add support for memory contexts (Thomas Kaltofen). Cleanup compilation warnings. --- include/GL/wmesa.h | 4 ++-- src/mesa/drivers/windows/gdi/wgl.c | 30 +++++++++++++--------------- src/mesa/drivers/windows/gdi/wmesa.c | 35 +++++++++++++++++++-------------- src/mesa/drivers/windows/gdi/wmesadef.h | 2 -- 4 files changed, 36 insertions(+), 35 deletions(-) (limited to 'include') diff --git a/include/GL/wmesa.h b/include/GL/wmesa.h index 0a6e8b64246..66f3dbe82f0 100644 --- a/include/GL/wmesa.h +++ b/include/GL/wmesa.h @@ -78,7 +78,7 @@ typedef struct wmesa_context *WMesaContext; * appropriate colormap. * * Input: - * hWnd - Window handle + * hDC - Windows device or memory context * Pal - Palette to use * rgb_flag - GL_TRUE = RGB mode, * GL_FALSE = color index mode @@ -91,7 +91,7 @@ typedef struct wmesa_context *WMesaContext; * * Return: a WMesa_context or NULL if error. */ -extern WMesaContext WMesaCreateContext(HWND hWnd,HPALETTE* pPal, +extern WMesaContext WMesaCreateContext(HDC hDC,HPALETTE* pPal, GLboolean rgb_flag, GLboolean db_flag, GLboolean alpha_flag); diff --git a/src/mesa/drivers/windows/gdi/wgl.c b/src/mesa/drivers/windows/gdi/wgl.c index 2d3f696fb55..1f69f73f9a8 100644 --- a/src/mesa/drivers/windows/gdi/wgl.c +++ b/src/mesa/drivers/windows/gdi/wgl.c @@ -1,4 +1,4 @@ -/* $Id: wgl.c,v 1.9 2005/07/01 15:56:14 kschultz Exp $ */ +/* $Id: wgl.c,v 1.10 2005/09/05 14:48:39 kschultz Exp $ */ /* * This library is free software; you can redistribute it and/or @@ -34,6 +34,7 @@ * we get the right export linkage. */ #define _GDI32_ #include +#include "glapi.h" #include "GL/wmesa.h" /* protos for wmesa* functions */ @@ -155,12 +156,7 @@ static unsigned curPFD = 0; WINGDIAPI HGLRC GLAPIENTRY wglCreateContext(HDC hdc) { - HWND hWnd; int i = 0; - if(!(hWnd = WindowFromDC(hdc))) { - SetLastError(0); - return(NULL); - } if (!ctx_count) { for(i=0;iwidth != width || Current->height != height) { Current->width = width; Current->height = height; @@ -899,9 +898,6 @@ wmesa_resize_buffers(GLcontext *ctx, GLframebuffer *buffer, wmDeleteBackingStore(Current); wmCreateBackingStore(Current, width, height); } - GetClientRect(Current->Window, &CR); - Current->width = CR.right; - Current->height = CR.bottom; } _mesa_resize_framebuffer(ctx, buffer, width, height); } @@ -954,13 +950,12 @@ static void wmesa_update_state(GLcontext *ctx, GLuint new_state) /***** WMESA Functions *****/ /**********************************************************************/ -WMesaContext WMesaCreateContext(HWND hWnd, +WMesaContext WMesaCreateContext(HDC hDC, HPALETTE* Pal, GLboolean rgb_flag, GLboolean db_flag, GLboolean alpha_flag) { - RECT CR; WMesaContext c; struct dd_function_table functions; struct gl_renderbuffer *rb; @@ -974,12 +969,18 @@ WMesaContext WMesaCreateContext(HWND hWnd, c = CALLOC_STRUCT(wmesa_context); if (!c) return NULL; - - c->Window = hWnd; - c->hDC = GetDC(hWnd); - GetClientRect(c->Window, &CR); - c->width = CR.right; - c->height = CR.bottom; + + /* Support memory and device contexts */ + if(WindowFromDC(hDC) != NULL) + { + c->hDC = GetDC(WindowFromDC(hDC)); + } + else + { + c->hDC = hDC; + } + c->width = GetDeviceCaps(c->hDC, HORZRES); + c->height = GetDeviceCaps(c->hDC, VERTRES); c->clearPen = CreatePen(PS_SOLID, 1, 0); c->clearBrush = CreateSolidBrush(0); @@ -997,7 +998,7 @@ WMesaContext WMesaCreateContext(HWND hWnd, 8,8,8, /* color RGB */ alpha_flag ? 8 : 0, /* color A */ 0, /* index bits */ - 16, /* depth_bits */ + DEFAULT_SOFTWARE_DEPTH_BITS, /* depth_bits */ 8, /* stencil_bits */ 16,16,16, /* accum RGB */ alpha_flag ? 16 : 0, /* accum A */ @@ -1133,7 +1134,11 @@ void WMesaDestroyContext( void ) WMesaMakeCurrent(NULL); - ReleaseDC(c->Window, c->hDC); + /* Release for device, not memory contexts */ + if(WindowFromDC(c->hDC) != NULL) + { + ReleaseDC(WindowFromDC(c->hDC), c->hDC); + } DeleteObject(c->clearPen); DeleteObject(c->clearBrush); diff --git a/src/mesa/drivers/windows/gdi/wmesadef.h b/src/mesa/drivers/windows/gdi/wmesadef.h index 9aa0ab20b79..a9d0a447def 100644 --- a/src/mesa/drivers/windows/gdi/wmesadef.h +++ b/src/mesa/drivers/windows/gdi/wmesadef.h @@ -12,8 +12,6 @@ typedef struct wmesa_context{ GLcontext *gl_ctx; /* The core GL/Mesa context */ GLvisual *gl_visual; /* Describes the buffers */ GLframebuffer *gl_buffer; /* Depth, stencil, accum, etc buffers*/ - - HWND Window; HDC hDC; COLORREF clearColorRef; HPEN clearPen; -- cgit v1.2.3 From 2eef2eca872e3fbff5c2876507b4cdff8e86c3a6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 11 Sep 2005 01:45:04 +0000 Subject: Silence some warnings. --- include/GL/glfbdev.h | 6 +++--- src/mesa/drivers/fbdev/glfbdev.c | 13 +++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/GL/glfbdev.h b/include/GL/glfbdev.h index 6af3ac31427..d2b12815c9f 100644 --- a/include/GL/glfbdev.h +++ b/include/GL/glfbdev.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 5.1 + * Version: 6.5 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -65,7 +65,7 @@ glFBDevGetString( int str ); typedef void (*GLFBDevProc)(); -extern const GLFBDevProc +extern GLFBDevProc glFBDevGetProcAddress( const char *procName ); diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index 7f66c46fd90..01b178fb126 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 6.5 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -38,6 +38,7 @@ * 24 bits | ? 0x312 0x315 0x318 ? 0x31B 0x31F * 32 bits | ? ? ? ? 0x164 ? */ + #ifdef USE_GLFBDEV_DRIVER #include "glheader.h" @@ -286,7 +287,7 @@ glFBDevGetString( int str ) } -const GLFBDevProc +GLFBDevProc glFBDevGetProcAddress( const char *procName ) { struct name_address { @@ -513,6 +514,7 @@ new_glfbdev_renderbuffer(void *bufferStart, int pixelFormat) rb->Base.GetRow = get_row_B8G8R8; rb->Base.GetValues = get_values_B8G8R8; rb->Base.PutRow = put_row_B8G8R8; + rb->Base.PutRowRGB = put_row_rgb_B8G8R8; rb->Base.PutMonoRow = put_mono_row_B8G8R8; rb->Base.PutValues = put_values_B8G8R8; rb->Base.PutMonoValues = put_mono_values_B8G8R8; @@ -521,6 +523,7 @@ new_glfbdev_renderbuffer(void *bufferStart, int pixelFormat) rb->Base.GetRow = get_row_B8G8R8A8; rb->Base.GetValues = get_values_B8G8R8A8; rb->Base.PutRow = put_row_B8G8R8A8; + rb->Base.PutRowRGB = put_row_rgb_B8G8R8A8; rb->Base.PutMonoRow = put_mono_row_B8G8R8A8; rb->Base.PutValues = put_values_B8G8R8A8; rb->Base.PutMonoValues = put_mono_values_B8G8R8A8; @@ -529,6 +532,7 @@ new_glfbdev_renderbuffer(void *bufferStart, int pixelFormat) rb->Base.GetRow = get_row_B5G6R5; rb->Base.GetValues = get_values_B5G6R5; rb->Base.PutRow = put_row_B5G6R5; + rb->Base.PutRowRGB = put_row_rgb_B5G6R5; rb->Base.PutMonoRow = put_mono_row_B5G6R5; rb->Base.PutValues = put_values_B5G6R5; rb->Base.PutMonoValues = put_mono_values_B5G6R5; @@ -537,6 +541,7 @@ new_glfbdev_renderbuffer(void *bufferStart, int pixelFormat) rb->Base.GetRow = get_row_B5G5R5; rb->Base.GetValues = get_values_B5G5R5; rb->Base.PutRow = put_row_B5G5R5; + rb->Base.PutRowRGB = put_row_rgb_B5G5R5; rb->Base.PutMonoRow = put_mono_row_B5G5R5; rb->Base.PutValues = put_values_B5G5R5; rb->Base.PutMonoValues = put_mono_values_B5G5R5; @@ -834,4 +839,4 @@ glFBDevMakeCurrent( GLFBDevContextPtr context, return 1; } -#endif +#endif /* USE_GLFBDEV_DRIVER */ -- cgit v1.2.3 From 1b5d3d647e3abe89b11f6ac9ba66327050d0750e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Sep 2005 02:28:00 +0000 Subject: added GL_EXT_packed_depth_stencil --- include/GL/gl.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 36a93791a90..bc41cd554ad 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2239,6 +2239,16 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen #endif /* GL_EXT_timer_query */ +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 + +#endif /* GL_EXT_packed_depth_stencil */ + /** ** NOTE!!!!! If you add new functions to this file, or update -- cgit v1.2.3 From 3e9c099088424c149931dcf546ae0a4d9ac2ae76 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 8 Nov 2005 14:44:07 +0000 Subject: remove a bunch of extension stuff that's in glxext.h --- include/GL/glx.h | 152 ++----------------------------------------------------- 1 file changed, 5 insertions(+), 147 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index ab0467c1886..7d399e76be1 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5 * * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. * @@ -302,138 +302,6 @@ extern void (*glXGetProcAddress(const GLubyte *procname))( void ); #else -/* - * 28. GLX_EXT_visual_info extension - */ -#ifndef GLX_EXT_visual_info -#define GLX_EXT_visual_info 1 - -#define GLX_X_VISUAL_TYPE_EXT 0x22 -#define GLX_TRANSPARENT_TYPE_EXT 0x23 -#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 -#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 -#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 -#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 -#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 -#define GLX_TRUE_COLOR_EXT 0x8002 -#define GLX_DIRECT_COLOR_EXT 0x8003 -#define GLX_PSEUDO_COLOR_EXT 0x8004 -#define GLX_STATIC_COLOR_EXT 0x8005 -#define GLX_GRAY_SCALE_EXT 0x8006 -#define GLX_STATIC_GRAY_EXT 0x8007 -#define GLX_NONE_EXT 0x8000 -#define GLX_TRANSPARENT_RGB_EXT 0x8008 -#define GLX_TRANSPARENT_INDEX_EXT 0x8009 - -#endif /* 28. GLX_EXT_visual_info extension */ - - - -/* - * 41. GLX_SGI_video_sync - */ -#ifndef GLX_SGI_video_sync -#define GLX_SGI_video_sync 1 - -extern int glXGetVideoSyncSGI(unsigned int *count); -extern int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count); - -#endif /* GLX_SGI_video_sync */ - - - -/* - * 42. GLX_EXT_visual_rating - */ -#ifndef GLX_EXT_visual_rating -#define GLX_EXT_visual_rating 1 - -#define GLX_VISUAL_CAVEAT_EXT 0x20 -/*#define GLX_NONE_EXT 0x8000*/ -#define GLX_SLOW_VISUAL_EXT 0x8001 -#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D - -#endif /* GLX_EXT_visual_rating */ - - - -/* - * 47. GLX_EXT_import_context - */ -#ifndef GLX_EXT_import_context -#define GLX_EXT_import_context 1 - -#define GLX_SHARE_CONTEXT_EXT 0x800A -#define GLX_VISUAL_ID_EXT 0x800B -#define GLX_SCREEN_EXT 0x800C - -extern void glXFreeContextEXT(Display *dpy, GLXContext context); - -extern GLXContextID glXGetContextIDEXT(const GLXContext context); - -extern Display *glXGetCurrentDisplayEXT(void); - -extern GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID); - -extern int glXQueryContextInfoEXT(Display *dpy, GLXContext context, - int attribute,int *value); - -#endif /* GLX_EXT_import_context */ - - - -/* - * 215. GLX_MESA_copy_sub_buffer - */ -#ifndef GLX_MESA_copy_sub_buffer -#define GLX_MESA_copy_sub_buffer 1 - -extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable, - int x, int y, int width, int height ); - -#endif - - - -/* - * 216. GLX_MESA_pixmap_colormap - */ -#ifndef GLX_MESA_pixmap_colormap -#define GLX_MESA_pixmap_colormap 1 - -extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual, - Pixmap pixmap, Colormap cmap ); - -#endif /* GLX_MESA_pixmap_colormap */ - - - -/* - * 217. GLX_MESA_release_buffers - */ -#ifndef GLX_MESA_release_buffers -#define GLX_MESA_release_buffers 1 - -extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d ); - -#endif /* GLX_MESA_release_buffers */ - - - -/* - * 218. GLX_MESA_set_3dfx_mode - */ -#ifndef GLX_MESA_set_3dfx_mode -#define GLX_MESA_set_3dfx_mode 1 - -#define GLX_3DFX_WINDOW_MODE_MESA 0x1 -#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 - -extern Bool glXSet3DfxModeMESA( int mode ); - -#endif /* GLX_MESA_set_3dfx_mode */ - - /* * ARB 2. GLX_ARB_get_proc_address @@ -441,7 +309,8 @@ extern Bool glXSet3DfxModeMESA( int mode ); #ifndef GLX_ARB_get_proc_address #define GLX_ARB_get_proc_address 1 -extern void (*glXGetProcAddressARB(const GLubyte *procName))(); +typedef void (*__GLXextFuncPtr)(void); +extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *); #endif /* GLX_ARB_get_proc_address */ @@ -469,19 +338,6 @@ typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer); #endif /* GLX_NV_vertex_array_range */ - -/* - * ???. GLX_MESA_agp_offset - */ -#ifndef GLX_MESA_agp_offset -#define GLX_MESA_agp_offset 1 - -extern GLuint glXGetAGPOffsetMESA(const GLvoid *pointer); -typedef GLuint (* PFNGLXGETAGPOFFSETMESAPROC) (const GLvoid *pointer); - -#endif /* GLX_MESA_agp_offset */ - - /* * ???. GLX_MESA_allocate_memory */ @@ -497,8 +353,10 @@ typedef GLuint (* PFNGLXGETMEMORYOFFSETMESAPROC) (Display *dpy, int scrn, const #endif /* GLX_MESA_allocate_memory */ + /* * ARB ?. GLX_ARB_render_texture + * XXX This was never finalized! */ #ifndef GLX_ARB_render_texture #define GLX_ARB_render_texture 1 -- cgit v1.2.3 From ba3da6154c324cc916845bc5de3de077d0b59ffc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 12 Nov 2005 18:44:29 +0000 Subject: Added OSMesaColorClamp(), bug 4917 --- include/GL/osmesa.h | 13 +++++++++++-- src/mesa/drivers/osmesa/osmesa.c | 16 ++++++++++++++++ src/mesa/main/blend.c | 3 +++ src/mesa/main/context.c | 6 ------ src/mesa/main/image.c | 2 +- src/mesa/main/mtypes.h | 9 +++------ src/mesa/swrast/s_context.c | 6 ++++++ src/mesa/swrast/s_context.h | 1 + src/mesa/swrast/s_span.c | 14 ++++++++++++++ 9 files changed, 55 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h index ef645905c4d..c5057819402 100644 --- a/include/GL/osmesa.h +++ b/include/GL/osmesa.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 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"), @@ -267,6 +267,15 @@ GLAPI OSMESAproc GLAPIENTRY OSMesaGetProcAddress( const char *funcName ); + +/** + * Enable/disable color clamping, off by default. + * New in Mesa 6.5 + */ +GLAPI void GLAPIENTRY +OSMesaColorClamp(GLboolean enable); + + #if defined(__BEOS__) || defined(__QUICKDRAW__) #pragma export off #endif diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index e4cb27d1163..9d74c33988c 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1255,3 +1255,19 @@ OSMesaGetProcAddress( const char *funcName ) } return _glapi_get_proc_address(funcName); } + + +GLAPI void GLAPIENTRY +OSMesaColorClamp(GLboolean enable) +{ + OSMesaContext osmesa = OSMesaGetCurrentContext(); + + if (enable == GL_TRUE) { + osmesa->mesa.Color.ClampFragmentColor = GL_TRUE; + } + else { + osmesa->mesa.Color.ClampFragmentColor = GL_FIXED_ONLY_ARB; + } +} + + diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index 61b2b17c0c3..aebc70421ab 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -574,6 +574,9 @@ void _mesa_init_color( GLcontext * ctx ) else { ctx->Color.DrawBuffer[0] = GL_FRONT; } + + ctx->Color.ClampFragmentColor = GL_FIXED_ONLY_ARB; + ctx->Color.ClampReadColor = GL_FIXED_ONLY_ARB; } /*@}*/ diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 698dbd33bfb..b25300a0b0e 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1090,12 +1090,6 @@ init_attrib_groups( GLcontext *ctx ) ctx->NewState = _NEW_ALL; ctx->ErrorValue = (GLenum) GL_NO_ERROR; ctx->_Facing = 0; -#if CHAN_TYPE == GL_FLOAT - ctx->ClampFragmentColors = GL_FALSE; /* XXX temporary */ -#else - ctx->ClampFragmentColors = GL_TRUE; -#endif - ctx->ClampVertexColors = GL_TRUE; return GL_TRUE; } diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index b9a032307c2..0a117a967b6 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1079,7 +1079,7 @@ _mesa_pack_rgba_span_float( GLcontext *ctx, if (dstFormat == GL_LUMINANCE || dstFormat == GL_LUMINANCE_ALPHA) { /* compute luminance values */ - if (ctx->ClampFragmentColors) { + if (ctx->Color.ClampReadColor == GL_TRUE) { for (i = 0; i < n; i++) { GLfloat sum = rgba[i][RCOMP] + rgba[i][GCOMP] + rgba[i][BCOMP]; luminance[i] = CLAMP(sum, 0.0F, 1.0F); diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 1a90583295c..17978e7135a 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -536,6 +536,9 @@ struct gl_colorbuffer_attrib /*@}*/ GLboolean DitherFlag; /**< Dither enable flag */ + + GLenum ClampFragmentColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */ + GLenum ClampReadColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */ }; @@ -2896,12 +2899,6 @@ struct __GLcontextRec * We don't have a better way to communicate this value from * swrast_setup to swrast. */ - /** \name Color clamping (tentative part of GL_ARB_color_clamp_control) */ - /*@{*/ - GLboolean ClampFragmentColors; - GLboolean ClampVertexColors; - /*@}*/ - /** \name For debugging/development only */ /*@{*/ GLboolean FirstTimeCurrent; diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 186fda0949f..9d283b0589e 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -105,6 +105,12 @@ _swrast_update_rasterflags( GLcontext *ctx ) rasterMask |= ATIFRAGSHADER_BIT; } +#if CHAN_TYPE == GL_FLOAT + if (ctx->Color.ClampFragmentColor == GL_TRUE) { + rasterMask |= CLAMPING_BIT; + } +#endif + SWRAST_CONTEXT(ctx)->_RasterMask = rasterMask; } diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index 3d738819e94..5cfe7627a5d 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -245,6 +245,7 @@ typedef void (*swrast_tri_func)( GLcontext *ctx, const SWvertex *, #define TEXTURE_BIT 0x1000 /**< Texturing really enabled */ #define FRAGPROG_BIT 0x2000 /**< Fragment program enabled */ #define ATIFRAGSHADER_BIT 0x4000 /**< ATI Fragment shader enabled */ +#define CLAMPING_BIT 0x8000 /**< Clamp colors to [0,1] */ /*@}*/ #define _SWRAST_NEW_RASTERMASK (_NEW_BUFFERS| \ diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index fbff31b90e3..1cf743ae483 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1276,6 +1276,20 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span) } } + /* Clamp color/alpha values over the range [0.0, 1.0] before storage */ +#if CHAN_TYPE == GL_FLOAT + if (ctx->Color.ClampFragmentColor) { + GLchan (*rgba)[4] = span->array->rgba; + GLuint i; + for (i = 0; i < span->end; i++) { + rgba[i][RCOMP] = CLAMP(rgba[i][RCOMP], 0.0, CHAN_MAXF); + rgba[i][GCOMP] = CLAMP(rgba[i][GCOMP], 0.0, CHAN_MAXF); + rgba[i][BCOMP] = CLAMP(rgba[i][BCOMP], 0.0, CHAN_MAXF); + rgba[i][ACOMP] = CLAMP(rgba[i][ACOMP], 0.0, CHAN_MAXF); + } + } +#endif + if (swrast->_RasterMask & MULTI_DRAW_BIT) { /* need to do blend/logicop separately for each color buffer */ multi_write_rgba_span(ctx, span); -- cgit v1.2.3 From 96f216565e09032021bafa7a805aa7707777fda1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 29 Nov 2005 23:01:43 +0000 Subject: assorted fixes for server-side direct rendering (bug 5199) --- include/GL/internal/dri_interface.h | 1 - src/mesa/drivers/dri/common/dri_util.c | 6 +++--- src/mesa/drivers/dri/common/dri_util.h | 1 + src/mesa/drivers/dri/common/glcontextmodes.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index e63415db026..0f3555b576e 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -39,7 +39,6 @@ #define DRI_INTERFACE_H #include -#include #include /** diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 421f24ccb1c..d7640759dee 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -133,9 +133,8 @@ static void __driGarbageCollectDrawables(void *drawHash) __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)pdraw->private; dpy = pdp->driScreenPriv->display; if (! (*dri_interface->windowExists)(dpy, draw)) { - /* Destroy the local drawable data in the hash table, if the - drawable no longer exists in the Xserver */ - drmHashDelete(drawHash, draw); + /* Destroy the local drawable data, if the drawable no + longer exists in the Xserver */ (*pdraw->destroyDrawable)(dpy, pdraw->private); _mesa_free(pdraw); } @@ -667,6 +666,7 @@ driDestroyDrawable(__DRInativeDisplay *dpy, void *drawablePrivate) (*psp->DriverAPI.DestroyBuffer)(pdp); if ((*dri_interface->windowExists)(dpy, pdp->draw)) (void)(*dri_interface->destroyDrawable)(dpy, scrn, pdp->draw); + drmHashDelete(psp->drawHash, pdp->draw); if (pdp->pClipRects) { _mesa_free(pdp->pClipRects); pdp->pClipRects = NULL; diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index a5e907e7261..b9b38f39cd6 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -54,6 +54,7 @@ #include #include "drm.h" #include "drm_sarea.h" +#include "xf86drm.h" #include "GL/internal/glcore.h" #include "GL/internal/dri_interface.h" diff --git a/src/mesa/drivers/dri/common/glcontextmodes.c b/src/mesa/drivers/dri/common/glcontextmodes.c index 4bff387ae0a..5e9e352f2c6 100644 --- a/src/mesa/drivers/dri/common/glcontextmodes.c +++ b/src/mesa/drivers/dri/common/glcontextmodes.c @@ -157,8 +157,8 @@ _gl_copy_visual_to_context_mode( __GLcontextModes * mode, mode->greenMask = config->greenMask; mode->blueMask = config->blueMask; mode->alphaMask = config->alphaMask; - mode->rgbBits = config->bufferSize; - mode->indexBits = config->bufferSize; + mode->rgbBits = mode->rgbMode ? config->bufferSize : 0; + mode->indexBits = mode->colorIndexMode ? config->bufferSize : 0; mode->accumRedBits = config->accumRedSize; mode->accumGreenBits = config->accumGreenSize; -- cgit v1.2.3 From 0fa8c59e646b214ea61c077f723e8ffe1cc06733 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 7 Dec 2005 14:48:19 +0000 Subject: Updates for GL_EXT_timer_query: New GLint64EXT and GLuint64EXT types (use C99's long long types). New glGetQueryObject[u]i64vEXT() functions. --- include/GL/gl.h | 18 + src/mesa/drivers/dri/common/extension_helper.h | 22 + src/mesa/drivers/x11/xm_dd.c | 21 +- src/mesa/drivers/x11/xmesaP.h | 4 +- src/mesa/glapi/dispatch.h | 16 +- src/mesa/glapi/gl_API.xml | 16 + src/mesa/glapi/glapioffsets.h | 6 +- src/mesa/glapi/glapitable.h | 2 + src/mesa/glapi/glapitemp.h | 12 + src/mesa/glapi/glprocs.h | 360 +- src/mesa/main/enums.c | 4165 ++++++++++++------------ src/mesa/main/mtypes.h | 2 +- src/mesa/main/occlude.c | 101 +- src/mesa/main/occlude.h | 6 + src/mesa/main/state.c | 4 + src/mesa/x86/glapi_x86.S | 2 + 16 files changed, 2477 insertions(+), 2280 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index bc41cd554ad..75c61672444 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2231,14 +2231,32 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen #endif /* GL_ATI_blend_equation_separate */ + #ifndef GL_EXT_timer_query #define GL_EXT_timer_query 1 +/* Define 64-bit types */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + typedef long long int GLint64EXT; + typedef unsigned long long int GLuint64EXT; +#else + /* this might actually be a 32-bit type */ + typedef long int GLint64_EXT; + typedef unsigned long int GLuint64_EXT; +#endif + #define GL_TIME_ELAPSED_EXT 0x88BF +GLAPI void GLAPIENTRY glGetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params); +GLAPI void GLAPIENTRY glGetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params); + +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); + #endif /* GL_EXT_timer_query */ + #ifndef GL_EXT_packed_depth_stencil #define GL_EXT_packed_depth_stencil 1 diff --git a/src/mesa/drivers/dri/common/extension_helper.h b/src/mesa/drivers/dri/common/extension_helper.h index 4a6606819cf..a1f3fa3f29f 100644 --- a/src/mesa/drivers/dri/common/extension_helper.h +++ b/src/mesa/drivers/dri/common/extension_helper.h @@ -1421,6 +1421,13 @@ static const char VertexAttribs2dvNV_names[] = ""; #endif +#if defined(need_GL_EXT_timer_query) +static const char GetQueryObjectui64vEXT_names[] = + "iip\0" /* Parameter signature */ + "glGetQueryObjectui64vEXT\0" + ""; +#endif + #if defined(need_GL_VERSION_1_3) static const char MultiTexCoord3fvARB_names[] = "ip\0" /* Parameter signature */ @@ -1957,6 +1964,13 @@ static const char WindowPos3dvMESA_names[] = ""; #endif +#if defined(need_GL_EXT_timer_query) +static const char GetQueryObjecti64vEXT_names[] = + "iip\0" /* Parameter signature */ + "glGetQueryObjecti64vEXT\0" + ""; +#endif + #if defined(need_GL_VERSION_1_3) static const char MultiTexCoord1dARB_names[] = "id\0" /* Parameter signature */ @@ -5179,6 +5193,14 @@ static const struct dri_extension_function GL_EXT_texture_perturb_normal_functio }; #endif +#if defined(need_GL_EXT_timer_query) +static const struct dri_extension_function GL_EXT_timer_query_functions[] = { + { GetQueryObjectui64vEXT_names, GetQueryObjectui64vEXT_remap_index, 817 }, + { GetQueryObjecti64vEXT_names, GetQueryObjecti64vEXT_remap_index, 816 }, + { NULL, 0, 0 } +}; +#endif + #if defined(need_GL_EXT_vertex_array) static const struct dri_extension_function GL_EXT_vertex_array_functions[] = { { IndexPointerEXT_names, IndexPointerEXT_remap_index, 450 }, diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index d0016b86927..50382602a1b 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -1183,14 +1183,14 @@ xmesa_begin_query(GLcontext *ctx, GLenum target, struct gl_query_object *q) #ifdef __VMS #define suseconds_t unsigned int #endif -static unsigned int +static GLuint64EXT time_diff(const struct timeval *t0, const struct timeval *t1) { - time_t seconds0 = t0->tv_sec & 0xff; /* 0 .. 255 seconds */ - time_t seconds1 = t1->tv_sec & 0xff; /* 0 .. 255 seconds */ - suseconds_t useconds0 = seconds0 * 1000000 + t0->tv_usec; - suseconds_t useconds1 = seconds1 * 1000000 + t1->tv_usec; - return useconds1 - useconds0; + GLuint64EXT seconds0 = t0->tv_sec & 0xff; /* 0 .. 255 seconds */ + GLuint64EXT seconds1 = t1->tv_sec & 0xff; /* 0 .. 255 seconds */ + GLuint64EXT nanosec0 = (seconds0 * 1000000 + t0->tv_usec) * 1000; + GLuint64EXT nanosec1 = (seconds1 * 1000000 + t1->tv_usec) * 1000; + return nanosec1 - nanosec0; } @@ -1200,14 +1200,9 @@ xmesa_end_query(GLcontext *ctx, GLenum target, struct gl_query_object *q) if (target == GL_TIME_ELAPSED_EXT) { struct xmesa_query_object *xq = (struct xmesa_query_object *) q; struct timeval endTime; - unsigned int dt; (void) gettimeofday(&endTime, NULL); - dt = time_diff(&xq->StartTime, &endTime); - /* clamp if we'd overflow a 32-bit unsigned int */ - if (dt >= 0xffffffffU / 1000U) - q->Result = 0xffffffffU; - else - q->Result = dt * 1000; /* result is in nanoseconds! */ + /* result is in nanoseconds! */ + q->Result = time_diff(&xq->StartTime, &endTime); } q->Ready = GL_TRUE; } diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index efe88a00442..5b9311ff873 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -551,8 +551,10 @@ extern void XMesaReset( void ); #ifdef XFree86Server #define ENABLE_EXT_timer_query 0 +#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#define ENABLE_EXT_timer_query 1 /* should have 64-bit GLuint64EXT */ #else -#define ENABLE_EXT_timer_query 1 +#define ENABLE_EXT_timer_query 0 /* may not have 64-bit GLuint64EXT */ #endif #endif diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h index 9a456b5409d..b2b06a837e6 100644 --- a/src/mesa/glapi/dispatch.h +++ b/src/mesa/glapi/dispatch.h @@ -2506,10 +2506,16 @@ #define CALL_StencilMaskSeparate(disp, parameters) (*((disp)->StencilMaskSeparate)) parameters #define GET_StencilMaskSeparate(disp) ((disp)->StencilMaskSeparate) #define SET_StencilMaskSeparate(disp, fn) ((disp)->StencilMaskSeparate = fn) +#define CALL_GetQueryObjecti64vEXT(disp, parameters) (*((disp)->GetQueryObjecti64vEXT)) parameters +#define GET_GetQueryObjecti64vEXT(disp) ((disp)->GetQueryObjecti64vEXT) +#define SET_GetQueryObjecti64vEXT(disp, fn) ((disp)->GetQueryObjecti64vEXT = fn) +#define CALL_GetQueryObjectui64vEXT(disp, parameters) (*((disp)->GetQueryObjectui64vEXT)) parameters +#define GET_GetQueryObjectui64vEXT(disp) ((disp)->GetQueryObjectui64vEXT) +#define SET_GetQueryObjectui64vEXT(disp, fn) ((disp)->GetQueryObjectui64vEXT = fn) #else -#define driDispatchRemapTable_size 408 +#define driDispatchRemapTable_size 410 extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define LoadTransposeMatrixfARB_remap_index 0 @@ -2920,6 +2926,8 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define StencilFuncSeparate_remap_index 405 #define StencilOpSeparate_remap_index 406 #define StencilMaskSeparate_remap_index 407 +#define GetQueryObjecti64vEXT_remap_index 408 +#define GetQueryObjectui64vEXT_remap_index 409 #define CALL_LoadTransposeMatrixfARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index], parameters) #define GET_LoadTransposeMatrixfARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index]) @@ -4145,6 +4153,12 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define CALL_StencilMaskSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[StencilMaskSeparate_remap_index], parameters) #define GET_StencilMaskSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilMaskSeparate_remap_index]) #define SET_StencilMaskSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilMaskSeparate_remap_index], fn) +#define CALL_GetQueryObjecti64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint64EXT *)), driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], parameters) +#define GET_GetQueryObjecti64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index]) +#define SET_GetQueryObjecti64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], fn) +#define CALL_GetQueryObjectui64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint64EXT *)), driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], parameters) +#define GET_GetQueryObjectui64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index]) +#define SET_GetQueryObjectui64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], fn) #endif /* !defined(IN_DRI_DRIVER) */ diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml index 4f9d8c474e0..e473f1d5a42 100644 --- a/src/mesa/glapi/gl_API.xml +++ b/src/mesa/glapi/gl_API.xml @@ -11482,4 +11482,20 @@ + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/glapioffsets.h b/src/mesa/glapi/glapioffsets.h index 9e266450e9e..40ccd3af02d 100644 --- a/src/mesa/glapi/glapioffsets.h +++ b/src/mesa/glapi/glapioffsets.h @@ -848,7 +848,9 @@ #define _gloffset_StencilFuncSeparate 813 #define _gloffset_StencilOpSeparate 814 #define _gloffset_StencilMaskSeparate 815 -#define _gloffset_FIRST_DYNAMIC 816 +#define _gloffset_GetQueryObjecti64vEXT 816 +#define _gloffset_GetQueryObjectui64vEXT 817 +#define _gloffset_FIRST_DYNAMIC 818 #else @@ -1260,6 +1262,8 @@ #define _gloffset_StencilFuncSeparate driDispatchRemapTable[StencilFuncSeparate_remap_index] #define _gloffset_StencilOpSeparate driDispatchRemapTable[StencilOpSeparate_remap_index] #define _gloffset_StencilMaskSeparate driDispatchRemapTable[StencilMaskSeparate_remap_index] +#define _gloffset_GetQueryObjecti64vEXT driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index] +#define _gloffset_GetQueryObjectui64vEXT driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index] #endif /* !defined(IN_DRI_DRIVER) */ diff --git a/src/mesa/glapi/glapitable.h b/src/mesa/glapi/glapitable.h index b4c70bdaae9..1524e2aa8a8 100644 --- a/src/mesa/glapi/glapitable.h +++ b/src/mesa/glapi/glapitable.h @@ -853,6 +853,8 @@ struct _glapi_table void (GLAPIENTRYP StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); /* 813 */ void (GLAPIENTRYP StencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); /* 814 */ void (GLAPIENTRYP StencilMaskSeparate)(GLenum face, GLuint mask); /* 815 */ + void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 816 */ + void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 817 */ }; #endif /* !defined( _GLAPI_TABLE_H_ ) */ diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index 70bb05ec6ce..d473774703b 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -5040,6 +5040,16 @@ KEYWORD1 void KEYWORD2 NAME(StencilMaskSeparate)(GLenum face, GLuint mask) DISPATCH(StencilMaskSeparate, (face, mask), (F, "glStencilMaskSeparate(0x%x, %d);\n", face, mask)); } +KEYWORD1 void KEYWORD2 NAME(GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params) +{ + DISPATCH(GetQueryObjecti64vEXT, (id, pname, params), (F, "glGetQueryObjecti64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); +} + +KEYWORD1 void KEYWORD2 NAME(GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params) +{ + DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); +} + #endif /* defined( NAME ) */ @@ -5870,6 +5880,8 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(StencilFuncSeparate), TABLE_ENTRY(StencilOpSeparate), TABLE_ENTRY(StencilMaskSeparate), + TABLE_ENTRY(GetQueryObjecti64vEXT), + TABLE_ENTRY(GetQueryObjectui64vEXT), /* A whole bunch of no-op functions. These might be called * when someone tries to call a dynamically-registered * extension function without a current rendering context. diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h index 596a3e4cf9a..b8d175abf40 100644 --- a/src/mesa/glapi/glprocs.h +++ b/src/mesa/glapi/glprocs.h @@ -862,6 +862,8 @@ static const char gl_string_table[] = "glStencilFuncSeparate\0" "glStencilOpSeparate\0" "glStencilMaskSeparate\0" + "glGetQueryObjecti64vEXT\0" + "glGetQueryObjectui64vEXT\0" "glArrayElementEXT\0" "glBindTextureEXT\0" "glDrawArraysEXT\0" @@ -1859,184 +1861,186 @@ static const glprocs_table_t static_functions[] = { NAME_FUNC_OFFSET( 14607, glStencilFuncSeparate, _gloffset_StencilFuncSeparate ), NAME_FUNC_OFFSET( 14629, glStencilOpSeparate, _gloffset_StencilOpSeparate ), NAME_FUNC_OFFSET( 14649, glStencilMaskSeparate, _gloffset_StencilMaskSeparate ), - NAME_FUNC_OFFSET( 14671, glArrayElementEXT, _gloffset_ArrayElement ), - NAME_FUNC_OFFSET( 14689, glBindTextureEXT, _gloffset_BindTexture ), - NAME_FUNC_OFFSET( 14706, glDrawArraysEXT, _gloffset_DrawArrays ), - NAME_FUNC_OFFSET( 14722, glCopyTexImage1DEXT, _gloffset_CopyTexImage1D ), - NAME_FUNC_OFFSET( 14742, glCopyTexImage2DEXT, _gloffset_CopyTexImage2D ), - NAME_FUNC_OFFSET( 14762, glCopyTexSubImage1DEXT, _gloffset_CopyTexSubImage1D ), - NAME_FUNC_OFFSET( 14785, glCopyTexSubImage2DEXT, _gloffset_CopyTexSubImage2D ), - NAME_FUNC_OFFSET( 14808, glDeleteTexturesEXT, _gloffset_DeleteTextures ), - NAME_FUNC_OFFSET( 14828, glGetPointervEXT, _gloffset_GetPointerv ), - NAME_FUNC_OFFSET( 14845, glPrioritizeTexturesEXT, _gloffset_PrioritizeTextures ), - NAME_FUNC_OFFSET( 14869, glTexSubImage1DEXT, _gloffset_TexSubImage1D ), - NAME_FUNC_OFFSET( 14888, glTexSubImage2DEXT, _gloffset_TexSubImage2D ), - NAME_FUNC_OFFSET( 14907, glBlendColorEXT, _gloffset_BlendColor ), - NAME_FUNC_OFFSET( 14923, glBlendEquationEXT, _gloffset_BlendEquation ), - NAME_FUNC_OFFSET( 14942, glDrawRangeElementsEXT, _gloffset_DrawRangeElements ), - NAME_FUNC_OFFSET( 14965, glColorTableSGI, _gloffset_ColorTable ), - NAME_FUNC_OFFSET( 14981, glColorTableEXT, _gloffset_ColorTable ), - NAME_FUNC_OFFSET( 14997, glColorTableParameterfvSGI, _gloffset_ColorTableParameterfv ), - NAME_FUNC_OFFSET( 15024, glColorTableParameterivSGI, _gloffset_ColorTableParameteriv ), - NAME_FUNC_OFFSET( 15051, glCopyColorTableSGI, _gloffset_CopyColorTable ), - NAME_FUNC_OFFSET( 15071, glColorSubTableEXT, _gloffset_ColorSubTable ), - NAME_FUNC_OFFSET( 15090, glCopyColorSubTableEXT, _gloffset_CopyColorSubTable ), - NAME_FUNC_OFFSET( 15113, glConvolutionFilter1DEXT, _gloffset_ConvolutionFilter1D ), - NAME_FUNC_OFFSET( 15138, glConvolutionFilter2DEXT, _gloffset_ConvolutionFilter2D ), - NAME_FUNC_OFFSET( 15163, glConvolutionParameterfEXT, _gloffset_ConvolutionParameterf ), - NAME_FUNC_OFFSET( 15190, glConvolutionParameterfvEXT, _gloffset_ConvolutionParameterfv ), - NAME_FUNC_OFFSET( 15218, glConvolutionParameteriEXT, _gloffset_ConvolutionParameteri ), - NAME_FUNC_OFFSET( 15245, glConvolutionParameterivEXT, _gloffset_ConvolutionParameteriv ), - NAME_FUNC_OFFSET( 15273, glCopyConvolutionFilter1DEXT, _gloffset_CopyConvolutionFilter1D ), - NAME_FUNC_OFFSET( 15302, glCopyConvolutionFilter2DEXT, _gloffset_CopyConvolutionFilter2D ), - NAME_FUNC_OFFSET( 15331, glSeparableFilter2DEXT, _gloffset_SeparableFilter2D ), - NAME_FUNC_OFFSET( 15354, glHistogramEXT, _gloffset_Histogram ), - NAME_FUNC_OFFSET( 15369, glMinmaxEXT, _gloffset_Minmax ), - NAME_FUNC_OFFSET( 15381, glResetHistogramEXT, _gloffset_ResetHistogram ), - NAME_FUNC_OFFSET( 15401, glResetMinmaxEXT, _gloffset_ResetMinmax ), - NAME_FUNC_OFFSET( 15418, glTexImage3DEXT, _gloffset_TexImage3D ), - NAME_FUNC_OFFSET( 15434, glTexSubImage3DEXT, _gloffset_TexSubImage3D ), - NAME_FUNC_OFFSET( 15453, glCopyTexSubImage3DEXT, _gloffset_CopyTexSubImage3D ), - NAME_FUNC_OFFSET( 15476, glActiveTexture, _gloffset_ActiveTextureARB ), - NAME_FUNC_OFFSET( 15492, glClientActiveTexture, _gloffset_ClientActiveTextureARB ), - NAME_FUNC_OFFSET( 15514, glMultiTexCoord1d, _gloffset_MultiTexCoord1dARB ), - NAME_FUNC_OFFSET( 15532, glMultiTexCoord1dv, _gloffset_MultiTexCoord1dvARB ), - NAME_FUNC_OFFSET( 15551, glMultiTexCoord1f, _gloffset_MultiTexCoord1fARB ), - NAME_FUNC_OFFSET( 15569, glMultiTexCoord1fv, _gloffset_MultiTexCoord1fvARB ), - NAME_FUNC_OFFSET( 15588, glMultiTexCoord1i, _gloffset_MultiTexCoord1iARB ), - NAME_FUNC_OFFSET( 15606, glMultiTexCoord1iv, _gloffset_MultiTexCoord1ivARB ), - NAME_FUNC_OFFSET( 15625, glMultiTexCoord1s, _gloffset_MultiTexCoord1sARB ), - NAME_FUNC_OFFSET( 15643, glMultiTexCoord1sv, _gloffset_MultiTexCoord1svARB ), - NAME_FUNC_OFFSET( 15662, glMultiTexCoord2d, _gloffset_MultiTexCoord2dARB ), - NAME_FUNC_OFFSET( 15680, glMultiTexCoord2dv, _gloffset_MultiTexCoord2dvARB ), - NAME_FUNC_OFFSET( 15699, glMultiTexCoord2f, _gloffset_MultiTexCoord2fARB ), - NAME_FUNC_OFFSET( 15717, glMultiTexCoord2fv, _gloffset_MultiTexCoord2fvARB ), - NAME_FUNC_OFFSET( 15736, glMultiTexCoord2i, _gloffset_MultiTexCoord2iARB ), - NAME_FUNC_OFFSET( 15754, glMultiTexCoord2iv, _gloffset_MultiTexCoord2ivARB ), - NAME_FUNC_OFFSET( 15773, glMultiTexCoord2s, _gloffset_MultiTexCoord2sARB ), - NAME_FUNC_OFFSET( 15791, glMultiTexCoord2sv, _gloffset_MultiTexCoord2svARB ), - NAME_FUNC_OFFSET( 15810, glMultiTexCoord3d, _gloffset_MultiTexCoord3dARB ), - NAME_FUNC_OFFSET( 15828, glMultiTexCoord3dv, _gloffset_MultiTexCoord3dvARB ), - NAME_FUNC_OFFSET( 15847, glMultiTexCoord3f, _gloffset_MultiTexCoord3fARB ), - NAME_FUNC_OFFSET( 15865, glMultiTexCoord3fv, _gloffset_MultiTexCoord3fvARB ), - NAME_FUNC_OFFSET( 15884, glMultiTexCoord3i, _gloffset_MultiTexCoord3iARB ), - NAME_FUNC_OFFSET( 15902, glMultiTexCoord3iv, _gloffset_MultiTexCoord3ivARB ), - NAME_FUNC_OFFSET( 15921, glMultiTexCoord3s, _gloffset_MultiTexCoord3sARB ), - NAME_FUNC_OFFSET( 15939, glMultiTexCoord3sv, _gloffset_MultiTexCoord3svARB ), - NAME_FUNC_OFFSET( 15958, glMultiTexCoord4d, _gloffset_MultiTexCoord4dARB ), - NAME_FUNC_OFFSET( 15976, glMultiTexCoord4dv, _gloffset_MultiTexCoord4dvARB ), - NAME_FUNC_OFFSET( 15995, glMultiTexCoord4f, _gloffset_MultiTexCoord4fARB ), - NAME_FUNC_OFFSET( 16013, glMultiTexCoord4fv, _gloffset_MultiTexCoord4fvARB ), - NAME_FUNC_OFFSET( 16032, glMultiTexCoord4i, _gloffset_MultiTexCoord4iARB ), - NAME_FUNC_OFFSET( 16050, glMultiTexCoord4iv, _gloffset_MultiTexCoord4ivARB ), - NAME_FUNC_OFFSET( 16069, glMultiTexCoord4s, _gloffset_MultiTexCoord4sARB ), - NAME_FUNC_OFFSET( 16087, glMultiTexCoord4sv, _gloffset_MultiTexCoord4svARB ), - NAME_FUNC_OFFSET( 16106, glLoadTransposeMatrixf, _gloffset_LoadTransposeMatrixfARB ), - NAME_FUNC_OFFSET( 16129, glLoadTransposeMatrixd, _gloffset_LoadTransposeMatrixdARB ), - NAME_FUNC_OFFSET( 16152, glMultTransposeMatrixf, _gloffset_MultTransposeMatrixfARB ), - NAME_FUNC_OFFSET( 16175, glMultTransposeMatrixd, _gloffset_MultTransposeMatrixdARB ), - NAME_FUNC_OFFSET( 16198, glSampleCoverage, _gloffset_SampleCoverageARB ), - NAME_FUNC_OFFSET( 16215, glDrawBuffersATI, _gloffset_DrawBuffersARB ), - NAME_FUNC_OFFSET( 16232, glSampleMaskEXT, _gloffset_SampleMaskSGIS ), - NAME_FUNC_OFFSET( 16248, glSamplePatternEXT, _gloffset_SamplePatternSGIS ), - NAME_FUNC_OFFSET( 16267, glPointParameterf, _gloffset_PointParameterfEXT ), - NAME_FUNC_OFFSET( 16285, glPointParameterfARB, _gloffset_PointParameterfEXT ), - NAME_FUNC_OFFSET( 16306, glPointParameterfSGIS, _gloffset_PointParameterfEXT ), - NAME_FUNC_OFFSET( 16328, glPointParameterfv, _gloffset_PointParameterfvEXT ), - NAME_FUNC_OFFSET( 16347, glPointParameterfvARB, _gloffset_PointParameterfvEXT ), - NAME_FUNC_OFFSET( 16369, glPointParameterfvSGIS, _gloffset_PointParameterfvEXT ), - NAME_FUNC_OFFSET( 16392, glWindowPos2d, _gloffset_WindowPos2dMESA ), - NAME_FUNC_OFFSET( 16406, glWindowPos2dARB, _gloffset_WindowPos2dMESA ), - NAME_FUNC_OFFSET( 16423, glWindowPos2dv, _gloffset_WindowPos2dvMESA ), - NAME_FUNC_OFFSET( 16438, glWindowPos2dvARB, _gloffset_WindowPos2dvMESA ), - NAME_FUNC_OFFSET( 16456, glWindowPos2f, _gloffset_WindowPos2fMESA ), - NAME_FUNC_OFFSET( 16470, glWindowPos2fARB, _gloffset_WindowPos2fMESA ), - NAME_FUNC_OFFSET( 16487, glWindowPos2fv, _gloffset_WindowPos2fvMESA ), - NAME_FUNC_OFFSET( 16502, glWindowPos2fvARB, _gloffset_WindowPos2fvMESA ), - NAME_FUNC_OFFSET( 16520, glWindowPos2i, _gloffset_WindowPos2iMESA ), - NAME_FUNC_OFFSET( 16534, glWindowPos2iARB, _gloffset_WindowPos2iMESA ), - NAME_FUNC_OFFSET( 16551, glWindowPos2iv, _gloffset_WindowPos2ivMESA ), - NAME_FUNC_OFFSET( 16566, glWindowPos2ivARB, _gloffset_WindowPos2ivMESA ), - NAME_FUNC_OFFSET( 16584, glWindowPos2s, _gloffset_WindowPos2sMESA ), - NAME_FUNC_OFFSET( 16598, glWindowPos2sARB, _gloffset_WindowPos2sMESA ), - NAME_FUNC_OFFSET( 16615, glWindowPos2sv, _gloffset_WindowPos2svMESA ), - NAME_FUNC_OFFSET( 16630, glWindowPos2svARB, _gloffset_WindowPos2svMESA ), - NAME_FUNC_OFFSET( 16648, glWindowPos3d, _gloffset_WindowPos3dMESA ), - NAME_FUNC_OFFSET( 16662, glWindowPos3dARB, _gloffset_WindowPos3dMESA ), - NAME_FUNC_OFFSET( 16679, glWindowPos3dv, _gloffset_WindowPos3dvMESA ), - NAME_FUNC_OFFSET( 16694, glWindowPos3dvARB, _gloffset_WindowPos3dvMESA ), - NAME_FUNC_OFFSET( 16712, glWindowPos3f, _gloffset_WindowPos3fMESA ), - NAME_FUNC_OFFSET( 16726, glWindowPos3fARB, _gloffset_WindowPos3fMESA ), - NAME_FUNC_OFFSET( 16743, glWindowPos3fv, _gloffset_WindowPos3fvMESA ), - NAME_FUNC_OFFSET( 16758, glWindowPos3fvARB, _gloffset_WindowPos3fvMESA ), - NAME_FUNC_OFFSET( 16776, glWindowPos3i, _gloffset_WindowPos3iMESA ), - NAME_FUNC_OFFSET( 16790, glWindowPos3iARB, _gloffset_WindowPos3iMESA ), - NAME_FUNC_OFFSET( 16807, glWindowPos3iv, _gloffset_WindowPos3ivMESA ), - NAME_FUNC_OFFSET( 16822, glWindowPos3ivARB, _gloffset_WindowPos3ivMESA ), - NAME_FUNC_OFFSET( 16840, glWindowPos3s, _gloffset_WindowPos3sMESA ), - NAME_FUNC_OFFSET( 16854, glWindowPos3sARB, _gloffset_WindowPos3sMESA ), - NAME_FUNC_OFFSET( 16871, glWindowPos3sv, _gloffset_WindowPos3svMESA ), - NAME_FUNC_OFFSET( 16886, glWindowPos3svARB, _gloffset_WindowPos3svMESA ), - NAME_FUNC_OFFSET( 16904, glBlendFuncSeparate, _gloffset_BlendFuncSeparateEXT ), - NAME_FUNC_OFFSET( 16924, glBlendFuncSeparateINGR, _gloffset_BlendFuncSeparateEXT ), - NAME_FUNC_OFFSET( 16948, glFogCoordf, _gloffset_FogCoordfEXT ), - NAME_FUNC_OFFSET( 16960, glFogCoordfv, _gloffset_FogCoordfvEXT ), - NAME_FUNC_OFFSET( 16973, glFogCoordd, _gloffset_FogCoorddEXT ), - NAME_FUNC_OFFSET( 16985, glFogCoorddv, _gloffset_FogCoorddvEXT ), - NAME_FUNC_OFFSET( 16998, glFogCoordPointer, _gloffset_FogCoordPointerEXT ), - NAME_FUNC_OFFSET( 17016, glCompressedTexImage3D, _gloffset_CompressedTexImage3DARB ), - NAME_FUNC_OFFSET( 17039, glCompressedTexImage2D, _gloffset_CompressedTexImage2DARB ), - NAME_FUNC_OFFSET( 17062, glCompressedTexImage1D, _gloffset_CompressedTexImage1DARB ), - NAME_FUNC_OFFSET( 17085, glCompressedTexSubImage3D, _gloffset_CompressedTexSubImage3DARB ), - NAME_FUNC_OFFSET( 17111, glCompressedTexSubImage2D, _gloffset_CompressedTexSubImage2DARB ), - NAME_FUNC_OFFSET( 17137, glCompressedTexSubImage1D, _gloffset_CompressedTexSubImage1DARB ), - NAME_FUNC_OFFSET( 17163, glGetCompressedTexImage, _gloffset_GetCompressedTexImageARB ), - NAME_FUNC_OFFSET( 17187, glSecondaryColor3b, _gloffset_SecondaryColor3bEXT ), - NAME_FUNC_OFFSET( 17206, glSecondaryColor3bv, _gloffset_SecondaryColor3bvEXT ), - NAME_FUNC_OFFSET( 17226, glSecondaryColor3d, _gloffset_SecondaryColor3dEXT ), - NAME_FUNC_OFFSET( 17245, glSecondaryColor3dv, _gloffset_SecondaryColor3dvEXT ), - NAME_FUNC_OFFSET( 17265, glSecondaryColor3f, _gloffset_SecondaryColor3fEXT ), - NAME_FUNC_OFFSET( 17284, glSecondaryColor3fv, _gloffset_SecondaryColor3fvEXT ), - NAME_FUNC_OFFSET( 17304, glSecondaryColor3i, _gloffset_SecondaryColor3iEXT ), - NAME_FUNC_OFFSET( 17323, glSecondaryColor3iv, _gloffset_SecondaryColor3ivEXT ), - NAME_FUNC_OFFSET( 17343, glSecondaryColor3s, _gloffset_SecondaryColor3sEXT ), - NAME_FUNC_OFFSET( 17362, glSecondaryColor3sv, _gloffset_SecondaryColor3svEXT ), - NAME_FUNC_OFFSET( 17382, glSecondaryColor3ub, _gloffset_SecondaryColor3ubEXT ), - NAME_FUNC_OFFSET( 17402, glSecondaryColor3ubv, _gloffset_SecondaryColor3ubvEXT ), - NAME_FUNC_OFFSET( 17423, glSecondaryColor3ui, _gloffset_SecondaryColor3uiEXT ), - NAME_FUNC_OFFSET( 17443, glSecondaryColor3uiv, _gloffset_SecondaryColor3uivEXT ), - NAME_FUNC_OFFSET( 17464, glSecondaryColor3us, _gloffset_SecondaryColor3usEXT ), - NAME_FUNC_OFFSET( 17484, glSecondaryColor3usv, _gloffset_SecondaryColor3usvEXT ), - NAME_FUNC_OFFSET( 17505, glSecondaryColorPointer, _gloffset_SecondaryColorPointerEXT ), - NAME_FUNC_OFFSET( 17529, glBindProgramARB, _gloffset_BindProgramNV ), - NAME_FUNC_OFFSET( 17546, glDeleteProgramsARB, _gloffset_DeleteProgramsNV ), - NAME_FUNC_OFFSET( 17566, glGenProgramsARB, _gloffset_GenProgramsNV ), - NAME_FUNC_OFFSET( 17583, glGetVertexAttribPointervARB, _gloffset_GetVertexAttribPointervNV ), - NAME_FUNC_OFFSET( 17612, glIsProgramARB, _gloffset_IsProgramNV ), - NAME_FUNC_OFFSET( 17627, glPointParameteri, _gloffset_PointParameteriNV ), - NAME_FUNC_OFFSET( 17645, glPointParameteriv, _gloffset_PointParameterivNV ), - NAME_FUNC_OFFSET( 17664, glMultiDrawArrays, _gloffset_MultiDrawArraysEXT ), - NAME_FUNC_OFFSET( 17682, glMultiDrawElements, _gloffset_MultiDrawElementsEXT ), - NAME_FUNC_OFFSET( 17702, glBindBuffer, _gloffset_BindBufferARB ), - NAME_FUNC_OFFSET( 17715, glBufferData, _gloffset_BufferDataARB ), - NAME_FUNC_OFFSET( 17728, glBufferSubData, _gloffset_BufferSubDataARB ), - NAME_FUNC_OFFSET( 17744, glDeleteBuffers, _gloffset_DeleteBuffersARB ), - NAME_FUNC_OFFSET( 17760, glGenBuffers, _gloffset_GenBuffersARB ), - NAME_FUNC_OFFSET( 17773, glGetBufferParameteriv, _gloffset_GetBufferParameterivARB ), - NAME_FUNC_OFFSET( 17796, glGetBufferPointerv, _gloffset_GetBufferPointervARB ), - NAME_FUNC_OFFSET( 17816, glGetBufferSubData, _gloffset_GetBufferSubDataARB ), - NAME_FUNC_OFFSET( 17835, glIsBuffer, _gloffset_IsBufferARB ), - NAME_FUNC_OFFSET( 17846, glMapBuffer, _gloffset_MapBufferARB ), - NAME_FUNC_OFFSET( 17858, glUnmapBuffer, _gloffset_UnmapBufferARB ), - NAME_FUNC_OFFSET( 17872, glGenQueries, _gloffset_GenQueriesARB ), - NAME_FUNC_OFFSET( 17885, glDeleteQueries, _gloffset_DeleteQueriesARB ), - NAME_FUNC_OFFSET( 17901, glIsQuery, _gloffset_IsQueryARB ), - NAME_FUNC_OFFSET( 17911, glBeginQuery, _gloffset_BeginQueryARB ), - NAME_FUNC_OFFSET( 17924, glEndQuery, _gloffset_EndQueryARB ), - NAME_FUNC_OFFSET( 17935, glGetQueryiv, _gloffset_GetQueryivARB ), - NAME_FUNC_OFFSET( 17948, glGetQueryObjectiv, _gloffset_GetQueryObjectivARB ), - NAME_FUNC_OFFSET( 17967, glGetQueryObjectuiv, _gloffset_GetQueryObjectuivARB ), - NAME_FUNC_OFFSET( 17987, glBlendEquationSeparateATI, _gloffset_BlendEquationSeparateEXT ), + NAME_FUNC_OFFSET( 14671, glGetQueryObjecti64vEXT, _gloffset_GetQueryObjecti64vEXT ), + NAME_FUNC_OFFSET( 14695, glGetQueryObjectui64vEXT, _gloffset_GetQueryObjectui64vEXT ), + NAME_FUNC_OFFSET( 14720, glArrayElementEXT, _gloffset_ArrayElement ), + NAME_FUNC_OFFSET( 14738, glBindTextureEXT, _gloffset_BindTexture ), + NAME_FUNC_OFFSET( 14755, glDrawArraysEXT, _gloffset_DrawArrays ), + NAME_FUNC_OFFSET( 14771, glCopyTexImage1DEXT, _gloffset_CopyTexImage1D ), + NAME_FUNC_OFFSET( 14791, glCopyTexImage2DEXT, _gloffset_CopyTexImage2D ), + NAME_FUNC_OFFSET( 14811, glCopyTexSubImage1DEXT, _gloffset_CopyTexSubImage1D ), + NAME_FUNC_OFFSET( 14834, glCopyTexSubImage2DEXT, _gloffset_CopyTexSubImage2D ), + NAME_FUNC_OFFSET( 14857, glDeleteTexturesEXT, _gloffset_DeleteTextures ), + NAME_FUNC_OFFSET( 14877, glGetPointervEXT, _gloffset_GetPointerv ), + NAME_FUNC_OFFSET( 14894, glPrioritizeTexturesEXT, _gloffset_PrioritizeTextures ), + NAME_FUNC_OFFSET( 14918, glTexSubImage1DEXT, _gloffset_TexSubImage1D ), + NAME_FUNC_OFFSET( 14937, glTexSubImage2DEXT, _gloffset_TexSubImage2D ), + NAME_FUNC_OFFSET( 14956, glBlendColorEXT, _gloffset_BlendColor ), + NAME_FUNC_OFFSET( 14972, glBlendEquationEXT, _gloffset_BlendEquation ), + NAME_FUNC_OFFSET( 14991, glDrawRangeElementsEXT, _gloffset_DrawRangeElements ), + NAME_FUNC_OFFSET( 15014, glColorTableSGI, _gloffset_ColorTable ), + NAME_FUNC_OFFSET( 15030, glColorTableEXT, _gloffset_ColorTable ), + NAME_FUNC_OFFSET( 15046, glColorTableParameterfvSGI, _gloffset_ColorTableParameterfv ), + NAME_FUNC_OFFSET( 15073, glColorTableParameterivSGI, _gloffset_ColorTableParameteriv ), + NAME_FUNC_OFFSET( 15100, glCopyColorTableSGI, _gloffset_CopyColorTable ), + NAME_FUNC_OFFSET( 15120, glColorSubTableEXT, _gloffset_ColorSubTable ), + NAME_FUNC_OFFSET( 15139, glCopyColorSubTableEXT, _gloffset_CopyColorSubTable ), + NAME_FUNC_OFFSET( 15162, glConvolutionFilter1DEXT, _gloffset_ConvolutionFilter1D ), + NAME_FUNC_OFFSET( 15187, glConvolutionFilter2DEXT, _gloffset_ConvolutionFilter2D ), + NAME_FUNC_OFFSET( 15212, glConvolutionParameterfEXT, _gloffset_ConvolutionParameterf ), + NAME_FUNC_OFFSET( 15239, glConvolutionParameterfvEXT, _gloffset_ConvolutionParameterfv ), + NAME_FUNC_OFFSET( 15267, glConvolutionParameteriEXT, _gloffset_ConvolutionParameteri ), + NAME_FUNC_OFFSET( 15294, glConvolutionParameterivEXT, _gloffset_ConvolutionParameteriv ), + NAME_FUNC_OFFSET( 15322, glCopyConvolutionFilter1DEXT, _gloffset_CopyConvolutionFilter1D ), + NAME_FUNC_OFFSET( 15351, glCopyConvolutionFilter2DEXT, _gloffset_CopyConvolutionFilter2D ), + NAME_FUNC_OFFSET( 15380, glSeparableFilter2DEXT, _gloffset_SeparableFilter2D ), + NAME_FUNC_OFFSET( 15403, glHistogramEXT, _gloffset_Histogram ), + NAME_FUNC_OFFSET( 15418, glMinmaxEXT, _gloffset_Minmax ), + NAME_FUNC_OFFSET( 15430, glResetHistogramEXT, _gloffset_ResetHistogram ), + NAME_FUNC_OFFSET( 15450, glResetMinmaxEXT, _gloffset_ResetMinmax ), + NAME_FUNC_OFFSET( 15467, glTexImage3DEXT, _gloffset_TexImage3D ), + NAME_FUNC_OFFSET( 15483, glTexSubImage3DEXT, _gloffset_TexSubImage3D ), + NAME_FUNC_OFFSET( 15502, glCopyTexSubImage3DEXT, _gloffset_CopyTexSubImage3D ), + NAME_FUNC_OFFSET( 15525, glActiveTexture, _gloffset_ActiveTextureARB ), + NAME_FUNC_OFFSET( 15541, glClientActiveTexture, _gloffset_ClientActiveTextureARB ), + NAME_FUNC_OFFSET( 15563, glMultiTexCoord1d, _gloffset_MultiTexCoord1dARB ), + NAME_FUNC_OFFSET( 15581, glMultiTexCoord1dv, _gloffset_MultiTexCoord1dvARB ), + NAME_FUNC_OFFSET( 15600, glMultiTexCoord1f, _gloffset_MultiTexCoord1fARB ), + NAME_FUNC_OFFSET( 15618, glMultiTexCoord1fv, _gloffset_MultiTexCoord1fvARB ), + NAME_FUNC_OFFSET( 15637, glMultiTexCoord1i, _gloffset_MultiTexCoord1iARB ), + NAME_FUNC_OFFSET( 15655, glMultiTexCoord1iv, _gloffset_MultiTexCoord1ivARB ), + NAME_FUNC_OFFSET( 15674, glMultiTexCoord1s, _gloffset_MultiTexCoord1sARB ), + NAME_FUNC_OFFSET( 15692, glMultiTexCoord1sv, _gloffset_MultiTexCoord1svARB ), + NAME_FUNC_OFFSET( 15711, glMultiTexCoord2d, _gloffset_MultiTexCoord2dARB ), + NAME_FUNC_OFFSET( 15729, glMultiTexCoord2dv, _gloffset_MultiTexCoord2dvARB ), + NAME_FUNC_OFFSET( 15748, glMultiTexCoord2f, _gloffset_MultiTexCoord2fARB ), + NAME_FUNC_OFFSET( 15766, glMultiTexCoord2fv, _gloffset_MultiTexCoord2fvARB ), + NAME_FUNC_OFFSET( 15785, glMultiTexCoord2i, _gloffset_MultiTexCoord2iARB ), + NAME_FUNC_OFFSET( 15803, glMultiTexCoord2iv, _gloffset_MultiTexCoord2ivARB ), + NAME_FUNC_OFFSET( 15822, glMultiTexCoord2s, _gloffset_MultiTexCoord2sARB ), + NAME_FUNC_OFFSET( 15840, glMultiTexCoord2sv, _gloffset_MultiTexCoord2svARB ), + NAME_FUNC_OFFSET( 15859, glMultiTexCoord3d, _gloffset_MultiTexCoord3dARB ), + NAME_FUNC_OFFSET( 15877, glMultiTexCoord3dv, _gloffset_MultiTexCoord3dvARB ), + NAME_FUNC_OFFSET( 15896, glMultiTexCoord3f, _gloffset_MultiTexCoord3fARB ), + NAME_FUNC_OFFSET( 15914, glMultiTexCoord3fv, _gloffset_MultiTexCoord3fvARB ), + NAME_FUNC_OFFSET( 15933, glMultiTexCoord3i, _gloffset_MultiTexCoord3iARB ), + NAME_FUNC_OFFSET( 15951, glMultiTexCoord3iv, _gloffset_MultiTexCoord3ivARB ), + NAME_FUNC_OFFSET( 15970, glMultiTexCoord3s, _gloffset_MultiTexCoord3sARB ), + NAME_FUNC_OFFSET( 15988, glMultiTexCoord3sv, _gloffset_MultiTexCoord3svARB ), + NAME_FUNC_OFFSET( 16007, glMultiTexCoord4d, _gloffset_MultiTexCoord4dARB ), + NAME_FUNC_OFFSET( 16025, glMultiTexCoord4dv, _gloffset_MultiTexCoord4dvARB ), + NAME_FUNC_OFFSET( 16044, glMultiTexCoord4f, _gloffset_MultiTexCoord4fARB ), + NAME_FUNC_OFFSET( 16062, glMultiTexCoord4fv, _gloffset_MultiTexCoord4fvARB ), + NAME_FUNC_OFFSET( 16081, glMultiTexCoord4i, _gloffset_MultiTexCoord4iARB ), + NAME_FUNC_OFFSET( 16099, glMultiTexCoord4iv, _gloffset_MultiTexCoord4ivARB ), + NAME_FUNC_OFFSET( 16118, glMultiTexCoord4s, _gloffset_MultiTexCoord4sARB ), + NAME_FUNC_OFFSET( 16136, glMultiTexCoord4sv, _gloffset_MultiTexCoord4svARB ), + NAME_FUNC_OFFSET( 16155, glLoadTransposeMatrixf, _gloffset_LoadTransposeMatrixfARB ), + NAME_FUNC_OFFSET( 16178, glLoadTransposeMatrixd, _gloffset_LoadTransposeMatrixdARB ), + NAME_FUNC_OFFSET( 16201, glMultTransposeMatrixf, _gloffset_MultTransposeMatrixfARB ), + NAME_FUNC_OFFSET( 16224, glMultTransposeMatrixd, _gloffset_MultTransposeMatrixdARB ), + NAME_FUNC_OFFSET( 16247, glSampleCoverage, _gloffset_SampleCoverageARB ), + NAME_FUNC_OFFSET( 16264, glDrawBuffersATI, _gloffset_DrawBuffersARB ), + NAME_FUNC_OFFSET( 16281, glSampleMaskEXT, _gloffset_SampleMaskSGIS ), + NAME_FUNC_OFFSET( 16297, glSamplePatternEXT, _gloffset_SamplePatternSGIS ), + NAME_FUNC_OFFSET( 16316, glPointParameterf, _gloffset_PointParameterfEXT ), + NAME_FUNC_OFFSET( 16334, glPointParameterfARB, _gloffset_PointParameterfEXT ), + NAME_FUNC_OFFSET( 16355, glPointParameterfSGIS, _gloffset_PointParameterfEXT ), + NAME_FUNC_OFFSET( 16377, glPointParameterfv, _gloffset_PointParameterfvEXT ), + NAME_FUNC_OFFSET( 16396, glPointParameterfvARB, _gloffset_PointParameterfvEXT ), + NAME_FUNC_OFFSET( 16418, glPointParameterfvSGIS, _gloffset_PointParameterfvEXT ), + NAME_FUNC_OFFSET( 16441, glWindowPos2d, _gloffset_WindowPos2dMESA ), + NAME_FUNC_OFFSET( 16455, glWindowPos2dARB, _gloffset_WindowPos2dMESA ), + NAME_FUNC_OFFSET( 16472, glWindowPos2dv, _gloffset_WindowPos2dvMESA ), + NAME_FUNC_OFFSET( 16487, glWindowPos2dvARB, _gloffset_WindowPos2dvMESA ), + NAME_FUNC_OFFSET( 16505, glWindowPos2f, _gloffset_WindowPos2fMESA ), + NAME_FUNC_OFFSET( 16519, glWindowPos2fARB, _gloffset_WindowPos2fMESA ), + NAME_FUNC_OFFSET( 16536, glWindowPos2fv, _gloffset_WindowPos2fvMESA ), + NAME_FUNC_OFFSET( 16551, glWindowPos2fvARB, _gloffset_WindowPos2fvMESA ), + NAME_FUNC_OFFSET( 16569, glWindowPos2i, _gloffset_WindowPos2iMESA ), + NAME_FUNC_OFFSET( 16583, glWindowPos2iARB, _gloffset_WindowPos2iMESA ), + NAME_FUNC_OFFSET( 16600, glWindowPos2iv, _gloffset_WindowPos2ivMESA ), + NAME_FUNC_OFFSET( 16615, glWindowPos2ivARB, _gloffset_WindowPos2ivMESA ), + NAME_FUNC_OFFSET( 16633, glWindowPos2s, _gloffset_WindowPos2sMESA ), + NAME_FUNC_OFFSET( 16647, glWindowPos2sARB, _gloffset_WindowPos2sMESA ), + NAME_FUNC_OFFSET( 16664, glWindowPos2sv, _gloffset_WindowPos2svMESA ), + NAME_FUNC_OFFSET( 16679, glWindowPos2svARB, _gloffset_WindowPos2svMESA ), + NAME_FUNC_OFFSET( 16697, glWindowPos3d, _gloffset_WindowPos3dMESA ), + NAME_FUNC_OFFSET( 16711, glWindowPos3dARB, _gloffset_WindowPos3dMESA ), + NAME_FUNC_OFFSET( 16728, glWindowPos3dv, _gloffset_WindowPos3dvMESA ), + NAME_FUNC_OFFSET( 16743, glWindowPos3dvARB, _gloffset_WindowPos3dvMESA ), + NAME_FUNC_OFFSET( 16761, glWindowPos3f, _gloffset_WindowPos3fMESA ), + NAME_FUNC_OFFSET( 16775, glWindowPos3fARB, _gloffset_WindowPos3fMESA ), + NAME_FUNC_OFFSET( 16792, glWindowPos3fv, _gloffset_WindowPos3fvMESA ), + NAME_FUNC_OFFSET( 16807, glWindowPos3fvARB, _gloffset_WindowPos3fvMESA ), + NAME_FUNC_OFFSET( 16825, glWindowPos3i, _gloffset_WindowPos3iMESA ), + NAME_FUNC_OFFSET( 16839, glWindowPos3iARB, _gloffset_WindowPos3iMESA ), + NAME_FUNC_OFFSET( 16856, glWindowPos3iv, _gloffset_WindowPos3ivMESA ), + NAME_FUNC_OFFSET( 16871, glWindowPos3ivARB, _gloffset_WindowPos3ivMESA ), + NAME_FUNC_OFFSET( 16889, glWindowPos3s, _gloffset_WindowPos3sMESA ), + NAME_FUNC_OFFSET( 16903, glWindowPos3sARB, _gloffset_WindowPos3sMESA ), + NAME_FUNC_OFFSET( 16920, glWindowPos3sv, _gloffset_WindowPos3svMESA ), + NAME_FUNC_OFFSET( 16935, glWindowPos3svARB, _gloffset_WindowPos3svMESA ), + NAME_FUNC_OFFSET( 16953, glBlendFuncSeparate, _gloffset_BlendFuncSeparateEXT ), + NAME_FUNC_OFFSET( 16973, glBlendFuncSeparateINGR, _gloffset_BlendFuncSeparateEXT ), + NAME_FUNC_OFFSET( 16997, glFogCoordf, _gloffset_FogCoordfEXT ), + NAME_FUNC_OFFSET( 17009, glFogCoordfv, _gloffset_FogCoordfvEXT ), + NAME_FUNC_OFFSET( 17022, glFogCoordd, _gloffset_FogCoorddEXT ), + NAME_FUNC_OFFSET( 17034, glFogCoorddv, _gloffset_FogCoorddvEXT ), + NAME_FUNC_OFFSET( 17047, glFogCoordPointer, _gloffset_FogCoordPointerEXT ), + NAME_FUNC_OFFSET( 17065, glCompressedTexImage3D, _gloffset_CompressedTexImage3DARB ), + NAME_FUNC_OFFSET( 17088, glCompressedTexImage2D, _gloffset_CompressedTexImage2DARB ), + NAME_FUNC_OFFSET( 17111, glCompressedTexImage1D, _gloffset_CompressedTexImage1DARB ), + NAME_FUNC_OFFSET( 17134, glCompressedTexSubImage3D, _gloffset_CompressedTexSubImage3DARB ), + NAME_FUNC_OFFSET( 17160, glCompressedTexSubImage2D, _gloffset_CompressedTexSubImage2DARB ), + NAME_FUNC_OFFSET( 17186, glCompressedTexSubImage1D, _gloffset_CompressedTexSubImage1DARB ), + NAME_FUNC_OFFSET( 17212, glGetCompressedTexImage, _gloffset_GetCompressedTexImageARB ), + NAME_FUNC_OFFSET( 17236, glSecondaryColor3b, _gloffset_SecondaryColor3bEXT ), + NAME_FUNC_OFFSET( 17255, glSecondaryColor3bv, _gloffset_SecondaryColor3bvEXT ), + NAME_FUNC_OFFSET( 17275, glSecondaryColor3d, _gloffset_SecondaryColor3dEXT ), + NAME_FUNC_OFFSET( 17294, glSecondaryColor3dv, _gloffset_SecondaryColor3dvEXT ), + NAME_FUNC_OFFSET( 17314, glSecondaryColor3f, _gloffset_SecondaryColor3fEXT ), + NAME_FUNC_OFFSET( 17333, glSecondaryColor3fv, _gloffset_SecondaryColor3fvEXT ), + NAME_FUNC_OFFSET( 17353, glSecondaryColor3i, _gloffset_SecondaryColor3iEXT ), + NAME_FUNC_OFFSET( 17372, glSecondaryColor3iv, _gloffset_SecondaryColor3ivEXT ), + NAME_FUNC_OFFSET( 17392, glSecondaryColor3s, _gloffset_SecondaryColor3sEXT ), + NAME_FUNC_OFFSET( 17411, glSecondaryColor3sv, _gloffset_SecondaryColor3svEXT ), + NAME_FUNC_OFFSET( 17431, glSecondaryColor3ub, _gloffset_SecondaryColor3ubEXT ), + NAME_FUNC_OFFSET( 17451, glSecondaryColor3ubv, _gloffset_SecondaryColor3ubvEXT ), + NAME_FUNC_OFFSET( 17472, glSecondaryColor3ui, _gloffset_SecondaryColor3uiEXT ), + NAME_FUNC_OFFSET( 17492, glSecondaryColor3uiv, _gloffset_SecondaryColor3uivEXT ), + NAME_FUNC_OFFSET( 17513, glSecondaryColor3us, _gloffset_SecondaryColor3usEXT ), + NAME_FUNC_OFFSET( 17533, glSecondaryColor3usv, _gloffset_SecondaryColor3usvEXT ), + NAME_FUNC_OFFSET( 17554, glSecondaryColorPointer, _gloffset_SecondaryColorPointerEXT ), + NAME_FUNC_OFFSET( 17578, glBindProgramARB, _gloffset_BindProgramNV ), + NAME_FUNC_OFFSET( 17595, glDeleteProgramsARB, _gloffset_DeleteProgramsNV ), + NAME_FUNC_OFFSET( 17615, glGenProgramsARB, _gloffset_GenProgramsNV ), + NAME_FUNC_OFFSET( 17632, glGetVertexAttribPointervARB, _gloffset_GetVertexAttribPointervNV ), + NAME_FUNC_OFFSET( 17661, glIsProgramARB, _gloffset_IsProgramNV ), + NAME_FUNC_OFFSET( 17676, glPointParameteri, _gloffset_PointParameteriNV ), + NAME_FUNC_OFFSET( 17694, glPointParameteriv, _gloffset_PointParameterivNV ), + NAME_FUNC_OFFSET( 17713, glMultiDrawArrays, _gloffset_MultiDrawArraysEXT ), + NAME_FUNC_OFFSET( 17731, glMultiDrawElements, _gloffset_MultiDrawElementsEXT ), + NAME_FUNC_OFFSET( 17751, glBindBuffer, _gloffset_BindBufferARB ), + NAME_FUNC_OFFSET( 17764, glBufferData, _gloffset_BufferDataARB ), + NAME_FUNC_OFFSET( 17777, glBufferSubData, _gloffset_BufferSubDataARB ), + NAME_FUNC_OFFSET( 17793, glDeleteBuffers, _gloffset_DeleteBuffersARB ), + NAME_FUNC_OFFSET( 17809, glGenBuffers, _gloffset_GenBuffersARB ), + NAME_FUNC_OFFSET( 17822, glGetBufferParameteriv, _gloffset_GetBufferParameterivARB ), + NAME_FUNC_OFFSET( 17845, glGetBufferPointerv, _gloffset_GetBufferPointervARB ), + NAME_FUNC_OFFSET( 17865, glGetBufferSubData, _gloffset_GetBufferSubDataARB ), + NAME_FUNC_OFFSET( 17884, glIsBuffer, _gloffset_IsBufferARB ), + NAME_FUNC_OFFSET( 17895, glMapBuffer, _gloffset_MapBufferARB ), + NAME_FUNC_OFFSET( 17907, glUnmapBuffer, _gloffset_UnmapBufferARB ), + NAME_FUNC_OFFSET( 17921, glGenQueries, _gloffset_GenQueriesARB ), + NAME_FUNC_OFFSET( 17934, glDeleteQueries, _gloffset_DeleteQueriesARB ), + NAME_FUNC_OFFSET( 17950, glIsQuery, _gloffset_IsQueryARB ), + NAME_FUNC_OFFSET( 17960, glBeginQuery, _gloffset_BeginQueryARB ), + NAME_FUNC_OFFSET( 17973, glEndQuery, _gloffset_EndQueryARB ), + NAME_FUNC_OFFSET( 17984, glGetQueryiv, _gloffset_GetQueryivARB ), + NAME_FUNC_OFFSET( 17997, glGetQueryObjectiv, _gloffset_GetQueryObjectivARB ), + NAME_FUNC_OFFSET( 18016, glGetQueryObjectuiv, _gloffset_GetQueryObjectuivARB ), + NAME_FUNC_OFFSET( 18036, glBlendEquationSeparateATI, _gloffset_BlendEquationSeparateEXT ), NAME_FUNC_OFFSET( -1, NULL, 0 ) }; diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 08522cdf7bf..3487797d7fe 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -456,7 +456,7 @@ static const char enum_string_table[] = "GL_FOG_COORD_ARRAY_POINTER\0" "GL_FOG_COORD_ARRAY_STRIDE\0" "GL_FOG_COORD_ARRAY_TYPE\0" - "GL_FOG_COORD_SOURCE\0" + "GL_FOG_COORD_SRC\0" "GL_FOG_DENSITY\0" "GL_FOG_DISTANCE_MODE_NV\0" "GL_FOG_END\0" @@ -502,6 +502,7 @@ static const char enum_string_table[] = "GL_GENERATE_MIPMAP_HINT_SGIS\0" "GL_GENERATE_MIPMAP_SGIS\0" "GL_GEQUAL\0" + "GL_GL_TIME_ELAPSED_EXT\0" "GL_GREATER\0" "GL_GREEN\0" "GL_GREEN_BIAS\0" @@ -1649,7 +1650,7 @@ static const char enum_string_table[] = "GL_ZOOM_Y\0" ; -static const enum_elt all_enums[1612] = +static const enum_elt all_enums[1613] = { { 0, 0x00000600 }, /* GL_2D */ { 6, 0x00001407 }, /* GL_2_BYTES */ @@ -2072,1277 +2073,1278 @@ static const enum_elt all_enums[1612] = { 8319, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ { 8346, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ { 8372, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ - { 8396, 0x00008450 }, /* GL_FOG_COORD_SOURCE */ - { 8416, 0x00000B62 }, /* GL_FOG_DENSITY */ - { 8431, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ - { 8455, 0x00000B64 }, /* GL_FOG_END */ - { 8466, 0x00000C54 }, /* GL_FOG_HINT */ - { 8478, 0x00000B61 }, /* GL_FOG_INDEX */ - { 8491, 0x00000B65 }, /* GL_FOG_MODE */ - { 8503, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ - { 8522, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ - { 8547, 0x00000B63 }, /* GL_FOG_START */ - { 8560, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ - { 8578, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ - { 8602, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ - { 8625, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ - { 8667, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ - { 8709, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ - { 8758, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ - { 8810, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ - { 8854, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ - { 8881, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ - { 8909, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ - { 8928, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ - { 8969, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - { 9010, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - { 9052, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - { 9103, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - { 9141, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ - { 9190, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - { 9232, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - { 9264, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ - { 9295, 0x00000404 }, /* GL_FRONT */ - { 9304, 0x00000408 }, /* GL_FRONT_AND_BACK */ - { 9322, 0x00000B46 }, /* GL_FRONT_FACE */ - { 9336, 0x00000400 }, /* GL_FRONT_LEFT */ - { 9350, 0x00000401 }, /* GL_FRONT_RIGHT */ - { 9365, 0x00008006 }, /* GL_FUNC_ADD */ - { 9377, 0x00008006 }, /* GL_FUNC_ADD_EXT */ - { 9393, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ - { 9418, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ - { 9447, 0x0000800A }, /* GL_FUNC_SUBTRACT */ - { 9464, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ - { 9485, 0x00008191 }, /* GL_GENERATE_MIPMAP */ - { 9504, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ - { 9528, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ - { 9557, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ - { 9581, 0x00000206 }, /* GL_GEQUAL */ - { 9591, 0x00000204 }, /* GL_GREATER */ - { 9602, 0x00001904 }, /* GL_GREEN */ - { 9611, 0x00000D19 }, /* GL_GREEN_BIAS */ - { 9625, 0x00000D53 }, /* GL_GREEN_BITS */ - { 9639, 0x00000D18 }, /* GL_GREEN_SCALE */ - { 9654, 0x00008000 }, /* GL_HINT_BIT */ - { 9666, 0x00008024 }, /* GL_HISTOGRAM */ - { 9679, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ - { 9703, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ - { 9731, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ - { 9754, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ - { 9781, 0x00008024 }, /* GL_HISTOGRAM_EXT */ - { 9798, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ - { 9818, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ - { 9842, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ - { 9866, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ - { 9894, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - { 9922, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ - { 9954, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ - { 9976, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ - { 10002, 0x0000802D }, /* GL_HISTOGRAM_SINK */ - { 10020, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ - { 10042, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ - { 10061, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ - { 10084, 0x0000862A }, /* GL_IDENTITY_NV */ - { 10099, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ - { 10119, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - { 10159, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - { 10197, 0x00001E02 }, /* GL_INCR */ - { 10205, 0x00008507 }, /* GL_INCR_WRAP */ - { 10218, 0x00008507 }, /* GL_INCR_WRAP_EXT */ - { 10235, 0x00008077 }, /* GL_INDEX_ARRAY */ - { 10250, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - { 10280, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ - { 10314, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ - { 10337, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ - { 10359, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ - { 10379, 0x00000D51 }, /* GL_INDEX_BITS */ - { 10393, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ - { 10414, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ - { 10432, 0x00000C30 }, /* GL_INDEX_MODE */ - { 10446, 0x00000D13 }, /* GL_INDEX_OFFSET */ - { 10462, 0x00000D12 }, /* GL_INDEX_SHIFT */ - { 10477, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ - { 10496, 0x00001404 }, /* GL_INT */ - { 10503, 0x00008049 }, /* GL_INTENSITY */ - { 10516, 0x0000804C }, /* GL_INTENSITY12 */ - { 10531, 0x0000804C }, /* GL_INTENSITY12_EXT */ - { 10550, 0x0000804D }, /* GL_INTENSITY16 */ - { 10565, 0x0000804D }, /* GL_INTENSITY16_EXT */ - { 10584, 0x0000804A }, /* GL_INTENSITY4 */ - { 10598, 0x0000804A }, /* GL_INTENSITY4_EXT */ - { 10616, 0x0000804B }, /* GL_INTENSITY8 */ - { 10630, 0x0000804B }, /* GL_INTENSITY8_EXT */ - { 10648, 0x00008049 }, /* GL_INTENSITY_EXT */ - { 10665, 0x00008575 }, /* GL_INTERPOLATE */ - { 10680, 0x00008575 }, /* GL_INTERPOLATE_ARB */ - { 10699, 0x00008575 }, /* GL_INTERPOLATE_EXT */ - { 10718, 0x00008B53 }, /* GL_INT_VEC2_ARB */ - { 10734, 0x00008B54 }, /* GL_INT_VEC3_ARB */ - { 10750, 0x00008B55 }, /* GL_INT_VEC4_ARB */ - { 10766, 0x00000500 }, /* GL_INVALID_ENUM */ - { 10782, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ - { 10819, 0x00000502 }, /* GL_INVALID_OPERATION */ - { 10840, 0x00000501 }, /* GL_INVALID_VALUE */ - { 10857, 0x0000862B }, /* GL_INVERSE_NV */ - { 10871, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ - { 10895, 0x0000150A }, /* GL_INVERT */ - { 10905, 0x00001E00 }, /* GL_KEEP */ - { 10913, 0x00000406 }, /* GL_LEFT */ - { 10921, 0x00000203 }, /* GL_LEQUAL */ - { 10931, 0x00000201 }, /* GL_LESS */ - { 10939, 0x00004000 }, /* GL_LIGHT0 */ - { 10949, 0x00004001 }, /* GL_LIGHT1 */ - { 10959, 0x00004002 }, /* GL_LIGHT2 */ - { 10969, 0x00004003 }, /* GL_LIGHT3 */ - { 10979, 0x00004004 }, /* GL_LIGHT4 */ - { 10989, 0x00004005 }, /* GL_LIGHT5 */ - { 10999, 0x00004006 }, /* GL_LIGHT6 */ - { 11009, 0x00004007 }, /* GL_LIGHT7 */ - { 11019, 0x00000B50 }, /* GL_LIGHTING */ - { 11031, 0x00000040 }, /* GL_LIGHTING_BIT */ - { 11047, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ - { 11070, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - { 11099, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ - { 11132, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - { 11160, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ - { 11184, 0x00001B01 }, /* GL_LINE */ - { 11192, 0x00002601 }, /* GL_LINEAR */ - { 11202, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ - { 11224, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - { 11254, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - { 11285, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ - { 11309, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ - { 11334, 0x00000001 }, /* GL_LINES */ - { 11343, 0x00000004 }, /* GL_LINE_BIT */ - { 11355, 0x00000002 }, /* GL_LINE_LOOP */ - { 11368, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ - { 11388, 0x00000B20 }, /* GL_LINE_SMOOTH */ - { 11403, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ - { 11423, 0x00000B24 }, /* GL_LINE_STIPPLE */ - { 11439, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ - { 11463, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ - { 11486, 0x00000003 }, /* GL_LINE_STRIP */ - { 11500, 0x00000702 }, /* GL_LINE_TOKEN */ - { 11514, 0x00000B21 }, /* GL_LINE_WIDTH */ - { 11528, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ - { 11554, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ - { 11574, 0x00000B32 }, /* GL_LIST_BASE */ - { 11587, 0x00020000 }, /* GL_LIST_BIT */ - { 11599, 0x00000B33 }, /* GL_LIST_INDEX */ - { 11613, 0x00000B30 }, /* GL_LIST_MODE */ - { 11626, 0x00000101 }, /* GL_LOAD */ - { 11634, 0x00000BF1 }, /* GL_LOGIC_OP */ - { 11646, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ - { 11663, 0x00001909 }, /* GL_LUMINANCE */ - { 11676, 0x00008041 }, /* GL_LUMINANCE12 */ - { 11691, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ - { 11714, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ - { 11741, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ - { 11763, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ - { 11789, 0x00008041 }, /* GL_LUMINANCE12_EXT */ - { 11808, 0x00008042 }, /* GL_LUMINANCE16 */ - { 11823, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ - { 11846, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ - { 11873, 0x00008042 }, /* GL_LUMINANCE16_EXT */ - { 11892, 0x0000803F }, /* GL_LUMINANCE4 */ - { 11906, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ - { 11927, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ - { 11952, 0x0000803F }, /* GL_LUMINANCE4_EXT */ - { 11970, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ - { 11991, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ - { 12016, 0x00008040 }, /* GL_LUMINANCE8 */ - { 12030, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ - { 12051, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ - { 12076, 0x00008040 }, /* GL_LUMINANCE8_EXT */ - { 12094, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ - { 12113, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ - { 12129, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ - { 12149, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ - { 12171, 0x00000D91 }, /* GL_MAP1_INDEX */ - { 12185, 0x00000D92 }, /* GL_MAP1_NORMAL */ - { 12200, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ - { 12224, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ - { 12248, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ - { 12272, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ - { 12296, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ - { 12313, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ - { 12330, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - { 12358, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - { 12387, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - { 12416, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - { 12445, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - { 12474, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - { 12503, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - { 12532, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - { 12560, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - { 12588, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - { 12616, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - { 12644, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - { 12672, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - { 12700, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - { 12728, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - { 12756, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - { 12784, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ - { 12800, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ - { 12820, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ - { 12842, 0x00000DB1 }, /* GL_MAP2_INDEX */ - { 12856, 0x00000DB2 }, /* GL_MAP2_NORMAL */ - { 12871, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ - { 12895, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ - { 12919, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ - { 12943, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ - { 12967, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ - { 12984, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ - { 13001, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - { 13029, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - { 13058, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - { 13087, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - { 13116, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - { 13145, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - { 13174, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - { 13203, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - { 13231, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - { 13259, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - { 13287, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - { 13315, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - { 13343, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - { 13371, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ - { 13399, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - { 13427, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - { 13455, 0x00000D10 }, /* GL_MAP_COLOR */ - { 13468, 0x00000D11 }, /* GL_MAP_STENCIL */ - { 13483, 0x000088C0 }, /* GL_MATRIX0_ARB */ - { 13498, 0x00008630 }, /* GL_MATRIX0_NV */ - { 13512, 0x000088CA }, /* GL_MATRIX10_ARB */ - { 13528, 0x000088CB }, /* GL_MATRIX11_ARB */ - { 13544, 0x000088CC }, /* GL_MATRIX12_ARB */ - { 13560, 0x000088CD }, /* GL_MATRIX13_ARB */ - { 13576, 0x000088CE }, /* GL_MATRIX14_ARB */ - { 13592, 0x000088CF }, /* GL_MATRIX15_ARB */ - { 13608, 0x000088D0 }, /* GL_MATRIX16_ARB */ - { 13624, 0x000088D1 }, /* GL_MATRIX17_ARB */ - { 13640, 0x000088D2 }, /* GL_MATRIX18_ARB */ - { 13656, 0x000088D3 }, /* GL_MATRIX19_ARB */ - { 13672, 0x000088C1 }, /* GL_MATRIX1_ARB */ - { 13687, 0x00008631 }, /* GL_MATRIX1_NV */ - { 13701, 0x000088D4 }, /* GL_MATRIX20_ARB */ - { 13717, 0x000088D5 }, /* GL_MATRIX21_ARB */ - { 13733, 0x000088D6 }, /* GL_MATRIX22_ARB */ - { 13749, 0x000088D7 }, /* GL_MATRIX23_ARB */ - { 13765, 0x000088D8 }, /* GL_MATRIX24_ARB */ - { 13781, 0x000088D9 }, /* GL_MATRIX25_ARB */ - { 13797, 0x000088DA }, /* GL_MATRIX26_ARB */ - { 13813, 0x000088DB }, /* GL_MATRIX27_ARB */ - { 13829, 0x000088DC }, /* GL_MATRIX28_ARB */ - { 13845, 0x000088DD }, /* GL_MATRIX29_ARB */ - { 13861, 0x000088C2 }, /* GL_MATRIX2_ARB */ - { 13876, 0x00008632 }, /* GL_MATRIX2_NV */ - { 13890, 0x000088DE }, /* GL_MATRIX30_ARB */ - { 13906, 0x000088DF }, /* GL_MATRIX31_ARB */ - { 13922, 0x000088C3 }, /* GL_MATRIX3_ARB */ - { 13937, 0x00008633 }, /* GL_MATRIX3_NV */ - { 13951, 0x000088C4 }, /* GL_MATRIX4_ARB */ - { 13966, 0x00008634 }, /* GL_MATRIX4_NV */ - { 13980, 0x000088C5 }, /* GL_MATRIX5_ARB */ - { 13995, 0x00008635 }, /* GL_MATRIX5_NV */ - { 14009, 0x000088C6 }, /* GL_MATRIX6_ARB */ - { 14024, 0x00008636 }, /* GL_MATRIX6_NV */ - { 14038, 0x000088C7 }, /* GL_MATRIX7_ARB */ - { 14053, 0x00008637 }, /* GL_MATRIX7_NV */ - { 14067, 0x000088C8 }, /* GL_MATRIX8_ARB */ - { 14082, 0x000088C9 }, /* GL_MATRIX9_ARB */ - { 14097, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ - { 14123, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - { 14157, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - { 14188, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - { 14221, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - { 14252, 0x00000BA0 }, /* GL_MATRIX_MODE */ - { 14267, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ - { 14289, 0x00008008 }, /* GL_MAX */ - { 14296, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ - { 14319, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ - { 14345, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - { 14378, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - { 14404, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 14438, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ - { 14457, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - { 14486, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - { 14518, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 14554, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ - { 14594, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ - { 14620, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ - { 14650, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ - { 14675, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ - { 14704, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - { 14733, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ - { 14766, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ - { 14790, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ - { 14814, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ - { 14838, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ - { 14863, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ - { 14881, 0x00008008 }, /* GL_MAX_EXT */ - { 14892, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ - { 14931, 0x00000D31 }, /* GL_MAX_LIGHTS */ - { 14945, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ - { 14965, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - { 15003, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - { 15032, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ - { 15056, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ - { 15084, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ - { 15107, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 15144, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 15180, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - { 15207, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - { 15236, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - { 15270, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - { 15306, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - { 15333, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - { 15365, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - { 15401, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - { 15430, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - { 15459, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ - { 15487, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - { 15525, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 15569, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 15612, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 15646, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 15685, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 15722, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 15760, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 15803, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 15846, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - { 15876, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - { 15907, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 15943, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 15979, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ - { 16009, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - { 16043, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ - { 16076, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - { 16105, 0x00008504 }, /* GL_MAX_SHININESS_NV */ - { 16125, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ - { 16149, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ - { 16175, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ - { 16206, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ - { 16230, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - { 16264, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ - { 16284, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ - { 16311, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ - { 16332, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ - { 16357, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ - { 16382, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ - { 16417, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ - { 16443, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ - { 16469, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ - { 16507, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ - { 16544, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ - { 16568, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ - { 16589, 0x00008007 }, /* GL_MIN */ - { 16596, 0x0000802E }, /* GL_MINMAX */ - { 16606, 0x0000802E }, /* GL_MINMAX_EXT */ - { 16620, 0x0000802F }, /* GL_MINMAX_FORMAT */ - { 16637, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ - { 16658, 0x00008030 }, /* GL_MINMAX_SINK */ - { 16673, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ - { 16692, 0x00008007 }, /* GL_MIN_EXT */ - { 16703, 0x00008370 }, /* GL_MIRRORED_REPEAT */ - { 16722, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ - { 16745, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ - { 16768, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ - { 16788, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ - { 16808, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - { 16838, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ - { 16866, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - { 16894, 0x00001700 }, /* GL_MODELVIEW */ - { 16907, 0x00001700 }, /* GL_MODELVIEW0_ARB */ - { 16925, 0x0000872A }, /* GL_MODELVIEW10_ARB */ - { 16944, 0x0000872B }, /* GL_MODELVIEW11_ARB */ - { 16963, 0x0000872C }, /* GL_MODELVIEW12_ARB */ - { 16982, 0x0000872D }, /* GL_MODELVIEW13_ARB */ - { 17001, 0x0000872E }, /* GL_MODELVIEW14_ARB */ - { 17020, 0x0000872F }, /* GL_MODELVIEW15_ARB */ - { 17039, 0x00008730 }, /* GL_MODELVIEW16_ARB */ - { 17058, 0x00008731 }, /* GL_MODELVIEW17_ARB */ - { 17077, 0x00008732 }, /* GL_MODELVIEW18_ARB */ - { 17096, 0x00008733 }, /* GL_MODELVIEW19_ARB */ - { 17115, 0x0000850A }, /* GL_MODELVIEW1_ARB */ - { 17133, 0x00008734 }, /* GL_MODELVIEW20_ARB */ - { 17152, 0x00008735 }, /* GL_MODELVIEW21_ARB */ - { 17171, 0x00008736 }, /* GL_MODELVIEW22_ARB */ - { 17190, 0x00008737 }, /* GL_MODELVIEW23_ARB */ - { 17209, 0x00008738 }, /* GL_MODELVIEW24_ARB */ - { 17228, 0x00008739 }, /* GL_MODELVIEW25_ARB */ - { 17247, 0x0000873A }, /* GL_MODELVIEW26_ARB */ - { 17266, 0x0000873B }, /* GL_MODELVIEW27_ARB */ - { 17285, 0x0000873C }, /* GL_MODELVIEW28_ARB */ - { 17304, 0x0000873D }, /* GL_MODELVIEW29_ARB */ - { 17323, 0x00008722 }, /* GL_MODELVIEW2_ARB */ - { 17341, 0x0000873E }, /* GL_MODELVIEW30_ARB */ - { 17360, 0x0000873F }, /* GL_MODELVIEW31_ARB */ - { 17379, 0x00008723 }, /* GL_MODELVIEW3_ARB */ - { 17397, 0x00008724 }, /* GL_MODELVIEW4_ARB */ - { 17415, 0x00008725 }, /* GL_MODELVIEW5_ARB */ - { 17433, 0x00008726 }, /* GL_MODELVIEW6_ARB */ - { 17451, 0x00008727 }, /* GL_MODELVIEW7_ARB */ - { 17469, 0x00008728 }, /* GL_MODELVIEW8_ARB */ - { 17487, 0x00008729 }, /* GL_MODELVIEW9_ARB */ - { 17505, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ - { 17525, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ - { 17552, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ - { 17577, 0x00002100 }, /* GL_MODULATE */ - { 17589, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ - { 17609, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ - { 17636, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ - { 17661, 0x00000103 }, /* GL_MULT */ - { 17669, 0x0000809D }, /* GL_MULTISAMPLE */ - { 17684, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ - { 17704, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ - { 17723, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ - { 17742, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ - { 17766, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ - { 17789, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - { 17819, 0x00002A25 }, /* GL_N3F_V3F */ - { 17830, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ - { 17850, 0x0000150E }, /* GL_NAND */ - { 17858, 0x00002600 }, /* GL_NEAREST */ - { 17869, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - { 17900, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - { 17932, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ - { 17957, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ - { 17983, 0x00000200 }, /* GL_NEVER */ - { 17992, 0x00001102 }, /* GL_NICEST */ - { 18002, 0x00000000 }, /* GL_NONE */ - { 18010, 0x00001505 }, /* GL_NOOP */ - { 18018, 0x00001508 }, /* GL_NOR */ - { 18025, 0x00000BA1 }, /* GL_NORMALIZE */ - { 18038, 0x00008075 }, /* GL_NORMAL_ARRAY */ - { 18054, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - { 18085, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ - { 18120, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ - { 18144, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ - { 18167, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ - { 18188, 0x00008511 }, /* GL_NORMAL_MAP */ - { 18202, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ - { 18220, 0x00008511 }, /* GL_NORMAL_MAP_NV */ - { 18237, 0x00000205 }, /* GL_NOTEQUAL */ - { 18249, 0x00000000 }, /* GL_NO_ERROR */ - { 18261, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - { 18295, 0x000086A2 }, /* GL_NUM_TEXTURE_COMPRESSED_FORMATS_ARB */ - { 18333, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ - { 18365, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ - { 18407, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ - { 18437, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ - { 18477, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ - { 18508, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ - { 18537, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ - { 18565, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ - { 18595, 0x00002401 }, /* GL_OBJECT_LINEAR */ - { 18612, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ - { 18638, 0x00002501 }, /* GL_OBJECT_PLANE */ - { 18654, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ - { 18689, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ - { 18711, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ - { 18730, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ - { 18760, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ - { 18781, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ - { 18809, 0x00000001 }, /* GL_ONE */ - { 18816, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ - { 18844, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ - { 18876, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ - { 18904, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ - { 18936, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ - { 18959, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ - { 18982, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ - { 19005, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ - { 19028, 0x00008598 }, /* GL_OPERAND0_ALPHA */ - { 19046, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ - { 19068, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ - { 19090, 0x00008590 }, /* GL_OPERAND0_RGB */ - { 19106, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ - { 19126, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ - { 19146, 0x00008599 }, /* GL_OPERAND1_ALPHA */ - { 19164, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ - { 19186, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ - { 19208, 0x00008591 }, /* GL_OPERAND1_RGB */ - { 19224, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ - { 19244, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ - { 19264, 0x0000859A }, /* GL_OPERAND2_ALPHA */ - { 19282, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ - { 19304, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ - { 19326, 0x00008592 }, /* GL_OPERAND2_RGB */ - { 19342, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ - { 19362, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ - { 19382, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ - { 19403, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ - { 19422, 0x00001507 }, /* GL_OR */ - { 19428, 0x00000A01 }, /* GL_ORDER */ - { 19437, 0x0000150D }, /* GL_OR_INVERTED */ - { 19452, 0x0000150B }, /* GL_OR_REVERSE */ - { 19466, 0x00000505 }, /* GL_OUT_OF_MEMORY */ - { 19483, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ - { 19501, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ - { 19522, 0x00008758 }, /* GL_PACK_INVERT_MESA */ - { 19542, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ - { 19560, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ - { 19579, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ - { 19599, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ - { 19619, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ - { 19637, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ - { 19656, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ - { 19681, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ - { 19705, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ - { 19726, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ - { 19748, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ - { 19770, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ - { 19795, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ - { 19819, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ - { 19840, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ - { 19862, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ - { 19884, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ - { 19906, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ - { 19937, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ - { 19957, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - { 19982, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ - { 20002, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - { 20027, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ - { 20047, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - { 20072, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ - { 20092, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - { 20117, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ - { 20137, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - { 20162, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ - { 20182, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - { 20207, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ - { 20227, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - { 20252, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ - { 20272, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - { 20297, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ - { 20317, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - { 20342, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ - { 20362, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - { 20387, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ - { 20405, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ - { 20438, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ - { 20463, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ - { 20498, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ - { 20525, 0x00001B00 }, /* GL_POINT */ - { 20534, 0x00000000 }, /* GL_POINTS */ - { 20544, 0x00000002 }, /* GL_POINT_BIT */ - { 20557, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ - { 20587, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ - { 20621, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ - { 20655, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ - { 20690, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ - { 20719, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ - { 20752, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ - { 20785, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ - { 20819, 0x00000B11 }, /* GL_POINT_SIZE */ - { 20833, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ - { 20859, 0x00008127 }, /* GL_POINT_SIZE_MAX */ - { 20877, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ - { 20899, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ - { 20921, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ - { 20944, 0x00008126 }, /* GL_POINT_SIZE_MIN */ - { 20962, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ - { 20984, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ - { 21006, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ - { 21029, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ - { 21049, 0x00000B10 }, /* GL_POINT_SMOOTH */ - { 21065, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ - { 21086, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ - { 21106, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ - { 21135, 0x00008861 }, /* GL_POINT_SPRITE_NV */ - { 21154, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ - { 21180, 0x00000701 }, /* GL_POINT_TOKEN */ - { 21195, 0x00000009 }, /* GL_POLYGON */ - { 21206, 0x00000008 }, /* GL_POLYGON_BIT */ - { 21221, 0x00000B40 }, /* GL_POLYGON_MODE */ - { 21237, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ - { 21260, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ - { 21285, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ - { 21308, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ - { 21331, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ - { 21355, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ - { 21379, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ - { 21397, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ - { 21420, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ - { 21439, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ - { 21462, 0x00000703 }, /* GL_POLYGON_TOKEN */ - { 21479, 0x00001203 }, /* GL_POSITION */ - { 21491, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - { 21523, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ - { 21559, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - { 21592, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ - { 21629, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - { 21660, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ - { 21695, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - { 21727, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ - { 21763, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - { 21796, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - { 21828, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ - { 21864, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - { 21897, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ - { 21934, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - { 21964, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ - { 21998, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - { 22029, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ - { 22064, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - { 22095, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ - { 22130, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - { 22162, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ - { 22198, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - { 22228, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ - { 22262, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - { 22293, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ - { 22328, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - { 22360, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - { 22391, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ - { 22426, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - { 22458, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ - { 22494, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ - { 22523, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ - { 22556, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ - { 22586, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ - { 22620, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - { 22659, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - { 22692, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - { 22732, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - { 22766, 0x00008578 }, /* GL_PREVIOUS */ - { 22778, 0x00008578 }, /* GL_PREVIOUS_ARB */ - { 22794, 0x00008578 }, /* GL_PREVIOUS_EXT */ - { 22810, 0x00008577 }, /* GL_PRIMARY_COLOR */ - { 22827, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ - { 22848, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ - { 22869, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 22902, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 22934, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ - { 22957, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ - { 22980, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ - { 23010, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ - { 23039, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ - { 23067, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ - { 23089, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - { 23117, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - { 23145, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ - { 23167, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ - { 23188, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 23228, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 23267, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 23297, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 23332, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 23365, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 23399, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 23438, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 23477, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ - { 23499, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ - { 23525, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ - { 23549, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ - { 23572, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ - { 23594, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ - { 23615, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ - { 23636, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ - { 23663, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 23695, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 23727, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - { 23762, 0x00001701 }, /* GL_PROJECTION */ - { 23776, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ - { 23797, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ - { 23823, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ - { 23844, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ - { 23863, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ - { 23886, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - { 23925, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - { 23963, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ - { 23983, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ - { 24007, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ - { 24027, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ - { 24051, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ - { 24071, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - { 24104, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ - { 24130, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ - { 24160, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - { 24191, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ - { 24221, 0x00002003 }, /* GL_Q */ - { 24226, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ - { 24251, 0x00000007 }, /* GL_QUADS */ - { 24260, 0x00008614 }, /* GL_QUAD_MESH_SUN */ - { 24277, 0x00000008 }, /* GL_QUAD_STRIP */ - { 24291, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ - { 24313, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ - { 24339, 0x00008866 }, /* GL_QUERY_RESULT */ - { 24355, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ - { 24375, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ - { 24401, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ - { 24431, 0x00002002 }, /* GL_R */ - { 24436, 0x00002A10 }, /* GL_R3_G3_B2 */ - { 24448, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - { 24481, 0x00000C02 }, /* GL_READ_BUFFER */ - { 24496, 0x000088B8 }, /* GL_READ_ONLY */ - { 24509, 0x000088B8 }, /* GL_READ_ONLY_ARB */ - { 24526, 0x000088BA }, /* GL_READ_WRITE */ - { 24540, 0x000088BA }, /* GL_READ_WRITE_ARB */ - { 24558, 0x00001903 }, /* GL_RED */ - { 24565, 0x00008016 }, /* GL_REDUCE */ - { 24575, 0x00008016 }, /* GL_REDUCE_EXT */ - { 24589, 0x00000D15 }, /* GL_RED_BIAS */ - { 24601, 0x00000D52 }, /* GL_RED_BITS */ - { 24613, 0x00000D14 }, /* GL_RED_SCALE */ - { 24626, 0x00008512 }, /* GL_REFLECTION_MAP */ - { 24644, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ - { 24666, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ - { 24687, 0x00001C00 }, /* GL_RENDER */ - { 24697, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ - { 24725, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ - { 24745, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ - { 24772, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - { 24808, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ - { 24834, 0x00001F01 }, /* GL_RENDERER */ - { 24846, 0x00000C40 }, /* GL_RENDER_MODE */ - { 24861, 0x00002901 }, /* GL_REPEAT */ - { 24871, 0x00001E01 }, /* GL_REPLACE */ - { 24882, 0x00008062 }, /* GL_REPLACE_EXT */ - { 24897, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ - { 24920, 0x0000803A }, /* GL_RESCALE_NORMAL */ - { 24938, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ - { 24960, 0x00000102 }, /* GL_RETURN */ - { 24970, 0x00001907 }, /* GL_RGB */ - { 24977, 0x00008052 }, /* GL_RGB10 */ - { 24986, 0x00008059 }, /* GL_RGB10_A2 */ - { 24998, 0x00008059 }, /* GL_RGB10_A2_EXT */ - { 25014, 0x00008052 }, /* GL_RGB10_EXT */ - { 25027, 0x00008053 }, /* GL_RGB12 */ - { 25036, 0x00008053 }, /* GL_RGB12_EXT */ - { 25049, 0x00008054 }, /* GL_RGB16 */ - { 25058, 0x00008054 }, /* GL_RGB16_EXT */ - { 25071, 0x0000804E }, /* GL_RGB2_EXT */ - { 25083, 0x0000804F }, /* GL_RGB4 */ - { 25091, 0x0000804F }, /* GL_RGB4_EXT */ - { 25103, 0x000083A1 }, /* GL_RGB4_S3TC */ - { 25116, 0x00008050 }, /* GL_RGB5 */ - { 25124, 0x00008057 }, /* GL_RGB5_A1 */ - { 25135, 0x00008057 }, /* GL_RGB5_A1_EXT */ - { 25150, 0x00008050 }, /* GL_RGB5_EXT */ - { 25162, 0x00008051 }, /* GL_RGB8 */ - { 25170, 0x00008051 }, /* GL_RGB8_EXT */ - { 25182, 0x00001908 }, /* GL_RGBA */ - { 25190, 0x0000805A }, /* GL_RGBA12 */ - { 25200, 0x0000805A }, /* GL_RGBA12_EXT */ - { 25214, 0x0000805B }, /* GL_RGBA16 */ - { 25224, 0x0000805B }, /* GL_RGBA16_EXT */ - { 25238, 0x00008055 }, /* GL_RGBA2 */ - { 25247, 0x00008055 }, /* GL_RGBA2_EXT */ - { 25260, 0x00008056 }, /* GL_RGBA4 */ - { 25269, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ - { 25288, 0x00008056 }, /* GL_RGBA4_EXT */ - { 25301, 0x000083A3 }, /* GL_RGBA4_S3TC */ - { 25315, 0x00008058 }, /* GL_RGBA8 */ - { 25324, 0x00008058 }, /* GL_RGBA8_EXT */ - { 25337, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ - { 25355, 0x00000C31 }, /* GL_RGBA_MODE */ - { 25368, 0x000083A2 }, /* GL_RGBA_S3TC */ - { 25381, 0x000083A0 }, /* GL_RGB_S3TC */ - { 25393, 0x00008573 }, /* GL_RGB_SCALE */ - { 25406, 0x00008573 }, /* GL_RGB_SCALE_ARB */ - { 25423, 0x00008573 }, /* GL_RGB_SCALE_EXT */ - { 25440, 0x00000407 }, /* GL_RIGHT */ - { 25449, 0x00002000 }, /* GL_S */ - { 25454, 0x000080A9 }, /* GL_SAMPLES */ - { 25465, 0x000086B4 }, /* GL_SAMPLES_3DFX */ - { 25481, 0x000080A9 }, /* GL_SAMPLES_ARB */ - { 25496, 0x00008914 }, /* GL_SAMPLES_PASSED */ - { 25514, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ - { 25536, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - { 25564, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ - { 25596, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ - { 25619, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ - { 25646, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ - { 25664, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ - { 25687, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ - { 25709, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ - { 25728, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ - { 25751, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ - { 25777, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ - { 25807, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ - { 25832, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ - { 25861, 0x00080000 }, /* GL_SCISSOR_BIT */ - { 25876, 0x00000C10 }, /* GL_SCISSOR_BOX */ - { 25891, 0x00000C11 }, /* GL_SCISSOR_TEST */ - { 25907, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ - { 25932, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - { 25972, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 26016, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - { 26049, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - { 26079, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - { 26111, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - { 26141, 0x00001C02 }, /* GL_SELECT */ - { 26151, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ - { 26179, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ - { 26204, 0x00008012 }, /* GL_SEPARABLE_2D */ - { 26220, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ - { 26247, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ - { 26278, 0x0000150F }, /* GL_SET */ - { 26285, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ - { 26306, 0x00000B54 }, /* GL_SHADE_MODEL */ - { 26321, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ - { 26344, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - { 26374, 0x00001601 }, /* GL_SHININESS */ - { 26387, 0x00001402 }, /* GL_SHORT */ - { 26396, 0x000081F9 }, /* GL_SINGLE_COLOR */ - { 26412, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ - { 26432, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ - { 26451, 0x00001D01 }, /* GL_SMOOTH */ - { 26461, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ - { 26494, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ - { 26521, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ - { 26554, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ - { 26581, 0x00008588 }, /* GL_SOURCE0_ALPHA */ - { 26598, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ - { 26619, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ - { 26640, 0x00008580 }, /* GL_SOURCE0_RGB */ - { 26655, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ - { 26674, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ - { 26693, 0x00008589 }, /* GL_SOURCE1_ALPHA */ - { 26710, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ - { 26731, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ - { 26752, 0x00008581 }, /* GL_SOURCE1_RGB */ - { 26767, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ - { 26786, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ - { 26805, 0x0000858A }, /* GL_SOURCE2_ALPHA */ - { 26822, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ - { 26843, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ - { 26864, 0x00008582 }, /* GL_SOURCE2_RGB */ - { 26879, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ - { 26898, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ - { 26917, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ - { 26937, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ - { 26955, 0x00001202 }, /* GL_SPECULAR */ - { 26967, 0x00002402 }, /* GL_SPHERE_MAP */ - { 26981, 0x00001206 }, /* GL_SPOT_CUTOFF */ - { 26996, 0x00001204 }, /* GL_SPOT_DIRECTION */ - { 27014, 0x00001205 }, /* GL_SPOT_EXPONENT */ - { 27031, 0x00008588 }, /* GL_SRC0_ALPHA */ - { 27045, 0x00008580 }, /* GL_SRC0_RGB */ - { 27057, 0x00008589 }, /* GL_SRC1_ALPHA */ - { 27071, 0x00008581 }, /* GL_SRC1_RGB */ - { 27083, 0x0000858A }, /* GL_SRC2_ALPHA */ - { 27097, 0x00008582 }, /* GL_SRC2_RGB */ - { 27109, 0x00000302 }, /* GL_SRC_ALPHA */ - { 27122, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ - { 27144, 0x00000300 }, /* GL_SRC_COLOR */ - { 27157, 0x00000503 }, /* GL_STACK_OVERFLOW */ - { 27175, 0x00000504 }, /* GL_STACK_UNDERFLOW */ - { 27194, 0x000088E6 }, /* GL_STATIC_COPY */ - { 27209, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ - { 27228, 0x000088E4 }, /* GL_STATIC_DRAW */ - { 27243, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ - { 27262, 0x000088E5 }, /* GL_STATIC_READ */ - { 27277, 0x000088E5 }, /* GL_STATIC_READ_ARB */ - { 27296, 0x00001802 }, /* GL_STENCIL */ - { 27307, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ - { 27333, 0x00000D57 }, /* GL_STENCIL_BITS */ - { 27349, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ - { 27371, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ - { 27394, 0x00000B94 }, /* GL_STENCIL_FAIL */ - { 27410, 0x00000B92 }, /* GL_STENCIL_FUNC */ - { 27426, 0x00001901 }, /* GL_STENCIL_INDEX */ - { 27443, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ - { 27466, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ - { 27488, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ - { 27510, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ - { 27532, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ - { 27553, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ - { 27580, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ - { 27607, 0x00000B97 }, /* GL_STENCIL_REF */ - { 27622, 0x00000B90 }, /* GL_STENCIL_TEST */ - { 27638, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ - { 27667, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ - { 27689, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ - { 27710, 0x00000C33 }, /* GL_STEREO */ - { 27720, 0x000088E2 }, /* GL_STREAM_COPY */ - { 27735, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ - { 27754, 0x000088E0 }, /* GL_STREAM_DRAW */ - { 27769, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ - { 27788, 0x000088E1 }, /* GL_STREAM_READ */ - { 27803, 0x000088E1 }, /* GL_STREAM_READ_ARB */ - { 27822, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ - { 27839, 0x000084E7 }, /* GL_SUBTRACT */ - { 27851, 0x000084E7 }, /* GL_SUBTRACT_ARB */ - { 27867, 0x00002001 }, /* GL_T */ - { 27872, 0x00002A2A }, /* GL_T2F_C3F_V3F */ - { 27887, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ - { 27906, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ - { 27922, 0x00002A2B }, /* GL_T2F_N3F_V3F */ - { 27937, 0x00002A27 }, /* GL_T2F_V3F */ - { 27948, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ - { 27967, 0x00002A28 }, /* GL_T4F_V4F */ - { 27978, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ - { 28001, 0x00001702 }, /* GL_TEXTURE */ - { 28012, 0x000084C0 }, /* GL_TEXTURE0 */ - { 28024, 0x000084C0 }, /* GL_TEXTURE0_ARB */ - { 28040, 0x000084C1 }, /* GL_TEXTURE1 */ - { 28052, 0x000084CA }, /* GL_TEXTURE10 */ - { 28065, 0x000084CA }, /* GL_TEXTURE10_ARB */ - { 28082, 0x000084CB }, /* GL_TEXTURE11 */ - { 28095, 0x000084CB }, /* GL_TEXTURE11_ARB */ - { 28112, 0x000084CC }, /* GL_TEXTURE12 */ - { 28125, 0x000084CC }, /* GL_TEXTURE12_ARB */ - { 28142, 0x000084CD }, /* GL_TEXTURE13 */ - { 28155, 0x000084CD }, /* GL_TEXTURE13_ARB */ - { 28172, 0x000084CE }, /* GL_TEXTURE14 */ - { 28185, 0x000084CE }, /* GL_TEXTURE14_ARB */ - { 28202, 0x000084CF }, /* GL_TEXTURE15 */ - { 28215, 0x000084CF }, /* GL_TEXTURE15_ARB */ - { 28232, 0x000084D0 }, /* GL_TEXTURE16 */ - { 28245, 0x000084D0 }, /* GL_TEXTURE16_ARB */ - { 28262, 0x000084D1 }, /* GL_TEXTURE17 */ - { 28275, 0x000084D1 }, /* GL_TEXTURE17_ARB */ - { 28292, 0x000084D2 }, /* GL_TEXTURE18 */ - { 28305, 0x000084D2 }, /* GL_TEXTURE18_ARB */ - { 28322, 0x000084D3 }, /* GL_TEXTURE19 */ - { 28335, 0x000084D3 }, /* GL_TEXTURE19_ARB */ - { 28352, 0x000084C1 }, /* GL_TEXTURE1_ARB */ - { 28368, 0x000084C2 }, /* GL_TEXTURE2 */ - { 28380, 0x000084D4 }, /* GL_TEXTURE20 */ - { 28393, 0x000084D4 }, /* GL_TEXTURE20_ARB */ - { 28410, 0x000084D5 }, /* GL_TEXTURE21 */ - { 28423, 0x000084D5 }, /* GL_TEXTURE21_ARB */ - { 28440, 0x000084D6 }, /* GL_TEXTURE22 */ - { 28453, 0x000084D6 }, /* GL_TEXTURE22_ARB */ - { 28470, 0x000084D7 }, /* GL_TEXTURE23 */ - { 28483, 0x000084D7 }, /* GL_TEXTURE23_ARB */ - { 28500, 0x000084D8 }, /* GL_TEXTURE24 */ - { 28513, 0x000084D8 }, /* GL_TEXTURE24_ARB */ - { 28530, 0x000084D9 }, /* GL_TEXTURE25 */ - { 28543, 0x000084D9 }, /* GL_TEXTURE25_ARB */ - { 28560, 0x000084DA }, /* GL_TEXTURE26 */ - { 28573, 0x000084DA }, /* GL_TEXTURE26_ARB */ - { 28590, 0x000084DB }, /* GL_TEXTURE27 */ - { 28603, 0x000084DB }, /* GL_TEXTURE27_ARB */ - { 28620, 0x000084DC }, /* GL_TEXTURE28 */ - { 28633, 0x000084DC }, /* GL_TEXTURE28_ARB */ - { 28650, 0x000084DD }, /* GL_TEXTURE29 */ - { 28663, 0x000084DD }, /* GL_TEXTURE29_ARB */ - { 28680, 0x000084C2 }, /* GL_TEXTURE2_ARB */ - { 28696, 0x000084C3 }, /* GL_TEXTURE3 */ - { 28708, 0x000084DE }, /* GL_TEXTURE30 */ - { 28721, 0x000084DE }, /* GL_TEXTURE30_ARB */ - { 28738, 0x000084DF }, /* GL_TEXTURE31 */ - { 28751, 0x000084DF }, /* GL_TEXTURE31_ARB */ - { 28768, 0x000084C3 }, /* GL_TEXTURE3_ARB */ - { 28784, 0x000084C4 }, /* GL_TEXTURE4 */ - { 28796, 0x000084C4 }, /* GL_TEXTURE4_ARB */ - { 28812, 0x000084C5 }, /* GL_TEXTURE5 */ - { 28824, 0x000084C5 }, /* GL_TEXTURE5_ARB */ - { 28840, 0x000084C6 }, /* GL_TEXTURE6 */ - { 28852, 0x000084C6 }, /* GL_TEXTURE6_ARB */ - { 28868, 0x000084C7 }, /* GL_TEXTURE7 */ - { 28880, 0x000084C7 }, /* GL_TEXTURE7_ARB */ - { 28896, 0x000084C8 }, /* GL_TEXTURE8 */ - { 28908, 0x000084C8 }, /* GL_TEXTURE8_ARB */ - { 28924, 0x000084C9 }, /* GL_TEXTURE9 */ - { 28936, 0x000084C9 }, /* GL_TEXTURE9_ARB */ - { 28952, 0x00000DE0 }, /* GL_TEXTURE_1D */ - { 28966, 0x00000DE1 }, /* GL_TEXTURE_2D */ - { 28980, 0x0000806F }, /* GL_TEXTURE_3D */ - { 28994, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ - { 29016, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ - { 29042, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ - { 29064, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ - { 29086, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ - { 29108, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ - { 29130, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ - { 29158, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ - { 29190, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - { 29223, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ - { 29255, 0x00040000 }, /* GL_TEXTURE_BIT */ - { 29270, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ - { 29291, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ - { 29316, 0x00001005 }, /* GL_TEXTURE_BORDER */ - { 29334, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ - { 29358, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - { 29389, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - { 29419, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - { 29449, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - { 29484, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - { 29515, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 29553, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ - { 29580, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - { 29612, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - { 29646, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ - { 29670, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ - { 29698, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ - { 29722, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ - { 29750, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - { 29783, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ - { 29807, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ - { 29829, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ - { 29851, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ - { 29877, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ - { 29911, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - { 29944, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ - { 29981, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ - { 30009, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ - { 30041, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ - { 30064, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - { 30102, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ - { 30144, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - { 30175, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - { 30203, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - { 30233, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - { 30261, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ - { 30281, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ - { 30305, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - { 30336, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ - { 30371, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - { 30402, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ - { 30437, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - { 30468, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ - { 30503, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - { 30534, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ - { 30569, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - { 30600, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ - { 30635, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - { 30666, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ - { 30701, 0x00008071 }, /* GL_TEXTURE_DEPTH */ - { 30718, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ - { 30740, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ - { 30766, 0x00002300 }, /* GL_TEXTURE_ENV */ - { 30781, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ - { 30802, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ - { 30822, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ - { 30848, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ - { 30868, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ - { 30885, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ - { 30902, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ - { 30919, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ - { 30936, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ - { 30961, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ - { 30983, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ - { 31009, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ - { 31027, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ - { 31053, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ - { 31079, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ - { 31109, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ - { 31136, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ - { 31161, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ - { 31181, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ - { 31205, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - { 31232, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - { 31259, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - { 31286, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ - { 31312, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ - { 31342, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ - { 31364, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ - { 31382, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - { 31412, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - { 31440, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - { 31468, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - { 31496, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ - { 31517, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ - { 31536, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ - { 31558, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ - { 31577, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ - { 31597, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ - { 31622, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ - { 31646, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ - { 31666, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ - { 31690, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ - { 31710, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ - { 31733, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ - { 31758, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - { 31792, 0x00001000 }, /* GL_TEXTURE_WIDTH */ - { 31809, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ - { 31827, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ - { 31845, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ - { 31863, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ - { 31882, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - { 31911, 0x00001000 }, /* GL_TRANSFORM_BIT */ - { 31928, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ - { 31954, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ - { 31984, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - { 32016, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - { 32046, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ - { 32080, 0x0000862C }, /* GL_TRANSPOSE_NV */ - { 32096, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - { 32127, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ - { 32162, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - { 32190, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ - { 32222, 0x00000004 }, /* GL_TRIANGLES */ - { 32235, 0x00000006 }, /* GL_TRIANGLE_FAN */ - { 32251, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ - { 32272, 0x00000005 }, /* GL_TRIANGLE_STRIP */ - { 32290, 0x00000001 }, /* GL_TRUE */ - { 32298, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ - { 32318, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ - { 32341, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ - { 32361, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ - { 32382, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ - { 32404, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ - { 32426, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ - { 32446, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ - { 32467, 0x00001401 }, /* GL_UNSIGNED_BYTE */ - { 32484, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - { 32511, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ - { 32534, 0x00001405 }, /* GL_UNSIGNED_INT */ - { 32550, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ - { 32577, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ - { 32601, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - { 32632, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ - { 32656, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - { 32684, 0x00001403 }, /* GL_UNSIGNED_SHORT */ - { 32702, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - { 32732, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - { 32758, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - { 32788, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - { 32814, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ - { 32838, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - { 32866, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - { 32894, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ - { 32921, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - { 32953, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ - { 32984, 0x00002A20 }, /* GL_V2F */ - { 32991, 0x00002A21 }, /* GL_V3F */ - { 32998, 0x00001F00 }, /* GL_VENDOR */ - { 33008, 0x00001F02 }, /* GL_VERSION */ - { 33019, 0x00008074 }, /* GL_VERTEX_ARRAY */ - { 33035, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - { 33066, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ - { 33101, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ - { 33125, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ - { 33146, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ - { 33169, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ - { 33190, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - { 33217, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - { 33245, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - { 33273, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - { 33301, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - { 33329, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - { 33357, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - { 33385, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - { 33412, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - { 33439, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - { 33466, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - { 33493, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - { 33520, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - { 33547, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - { 33574, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - { 33601, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - { 33628, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - { 33666, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ - { 33708, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ - { 33743, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ - { 33781, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ - { 33816, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ - { 33848, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ - { 33882, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ - { 33914, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ - { 33934, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ - { 33956, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ - { 33985, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ - { 34006, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ - { 34039, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ - { 34071, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ - { 34102, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ - { 34132, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ - { 34153, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ - { 34180, 0x00000BA2 }, /* GL_VIEWPORT */ - { 34192, 0x00000800 }, /* GL_VIEWPORT_BIT */ - { 34208, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ - { 34228, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - { 34259, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ - { 34294, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - { 34322, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - { 34347, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - { 34374, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - { 34399, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ - { 34423, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ - { 34442, 0x000088B9 }, /* GL_WRITE_ONLY */ - { 34456, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ - { 34474, 0x00001506 }, /* GL_XOR */ - { 34481, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ - { 34500, 0x00008757 }, /* GL_YCBCR_MESA */ - { 34514, 0x00000000 }, /* GL_ZERO */ - { 34522, 0x00000D16 }, /* GL_ZOOM_X */ - { 34532, 0x00000D17 }, /* GL_ZOOM_Y */ + { 8396, 0x00008450 }, /* GL_FOG_COORD_SRC */ + { 8413, 0x00000B62 }, /* GL_FOG_DENSITY */ + { 8428, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ + { 8452, 0x00000B64 }, /* GL_FOG_END */ + { 8463, 0x00000C54 }, /* GL_FOG_HINT */ + { 8475, 0x00000B61 }, /* GL_FOG_INDEX */ + { 8488, 0x00000B65 }, /* GL_FOG_MODE */ + { 8500, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ + { 8519, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ + { 8544, 0x00000B63 }, /* GL_FOG_START */ + { 8557, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ + { 8575, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ + { 8599, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ + { 8622, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ + { 8664, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ + { 8706, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ + { 8755, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ + { 8807, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ + { 8851, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ + { 8878, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ + { 8906, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ + { 8925, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ + { 8966, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + { 9007, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + { 9049, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + { 9100, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + { 9138, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ + { 9187, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + { 9229, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + { 9261, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ + { 9292, 0x00000404 }, /* GL_FRONT */ + { 9301, 0x00000408 }, /* GL_FRONT_AND_BACK */ + { 9319, 0x00000B46 }, /* GL_FRONT_FACE */ + { 9333, 0x00000400 }, /* GL_FRONT_LEFT */ + { 9347, 0x00000401 }, /* GL_FRONT_RIGHT */ + { 9362, 0x00008006 }, /* GL_FUNC_ADD */ + { 9374, 0x00008006 }, /* GL_FUNC_ADD_EXT */ + { 9390, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ + { 9415, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ + { 9444, 0x0000800A }, /* GL_FUNC_SUBTRACT */ + { 9461, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ + { 9482, 0x00008191 }, /* GL_GENERATE_MIPMAP */ + { 9501, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ + { 9525, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ + { 9554, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ + { 9578, 0x00000206 }, /* GL_GEQUAL */ + { 9588, 0x000088BF }, /* GL_GL_TIME_ELAPSED_EXT */ + { 9611, 0x00000204 }, /* GL_GREATER */ + { 9622, 0x00001904 }, /* GL_GREEN */ + { 9631, 0x00000D19 }, /* GL_GREEN_BIAS */ + { 9645, 0x00000D53 }, /* GL_GREEN_BITS */ + { 9659, 0x00000D18 }, /* GL_GREEN_SCALE */ + { 9674, 0x00008000 }, /* GL_HINT_BIT */ + { 9686, 0x00008024 }, /* GL_HISTOGRAM */ + { 9699, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ + { 9723, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ + { 9751, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ + { 9774, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ + { 9801, 0x00008024 }, /* GL_HISTOGRAM_EXT */ + { 9818, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ + { 9838, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ + { 9862, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ + { 9886, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ + { 9914, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + { 9942, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ + { 9974, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ + { 9996, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ + { 10022, 0x0000802D }, /* GL_HISTOGRAM_SINK */ + { 10040, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ + { 10062, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ + { 10081, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ + { 10104, 0x0000862A }, /* GL_IDENTITY_NV */ + { 10119, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ + { 10139, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + { 10179, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + { 10217, 0x00001E02 }, /* GL_INCR */ + { 10225, 0x00008507 }, /* GL_INCR_WRAP */ + { 10238, 0x00008507 }, /* GL_INCR_WRAP_EXT */ + { 10255, 0x00008077 }, /* GL_INDEX_ARRAY */ + { 10270, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + { 10300, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ + { 10334, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ + { 10357, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ + { 10379, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ + { 10399, 0x00000D51 }, /* GL_INDEX_BITS */ + { 10413, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ + { 10434, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ + { 10452, 0x00000C30 }, /* GL_INDEX_MODE */ + { 10466, 0x00000D13 }, /* GL_INDEX_OFFSET */ + { 10482, 0x00000D12 }, /* GL_INDEX_SHIFT */ + { 10497, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ + { 10516, 0x00001404 }, /* GL_INT */ + { 10523, 0x00008049 }, /* GL_INTENSITY */ + { 10536, 0x0000804C }, /* GL_INTENSITY12 */ + { 10551, 0x0000804C }, /* GL_INTENSITY12_EXT */ + { 10570, 0x0000804D }, /* GL_INTENSITY16 */ + { 10585, 0x0000804D }, /* GL_INTENSITY16_EXT */ + { 10604, 0x0000804A }, /* GL_INTENSITY4 */ + { 10618, 0x0000804A }, /* GL_INTENSITY4_EXT */ + { 10636, 0x0000804B }, /* GL_INTENSITY8 */ + { 10650, 0x0000804B }, /* GL_INTENSITY8_EXT */ + { 10668, 0x00008049 }, /* GL_INTENSITY_EXT */ + { 10685, 0x00008575 }, /* GL_INTERPOLATE */ + { 10700, 0x00008575 }, /* GL_INTERPOLATE_ARB */ + { 10719, 0x00008575 }, /* GL_INTERPOLATE_EXT */ + { 10738, 0x00008B53 }, /* GL_INT_VEC2_ARB */ + { 10754, 0x00008B54 }, /* GL_INT_VEC3_ARB */ + { 10770, 0x00008B55 }, /* GL_INT_VEC4_ARB */ + { 10786, 0x00000500 }, /* GL_INVALID_ENUM */ + { 10802, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ + { 10839, 0x00000502 }, /* GL_INVALID_OPERATION */ + { 10860, 0x00000501 }, /* GL_INVALID_VALUE */ + { 10877, 0x0000862B }, /* GL_INVERSE_NV */ + { 10891, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ + { 10915, 0x0000150A }, /* GL_INVERT */ + { 10925, 0x00001E00 }, /* GL_KEEP */ + { 10933, 0x00000406 }, /* GL_LEFT */ + { 10941, 0x00000203 }, /* GL_LEQUAL */ + { 10951, 0x00000201 }, /* GL_LESS */ + { 10959, 0x00004000 }, /* GL_LIGHT0 */ + { 10969, 0x00004001 }, /* GL_LIGHT1 */ + { 10979, 0x00004002 }, /* GL_LIGHT2 */ + { 10989, 0x00004003 }, /* GL_LIGHT3 */ + { 10999, 0x00004004 }, /* GL_LIGHT4 */ + { 11009, 0x00004005 }, /* GL_LIGHT5 */ + { 11019, 0x00004006 }, /* GL_LIGHT6 */ + { 11029, 0x00004007 }, /* GL_LIGHT7 */ + { 11039, 0x00000B50 }, /* GL_LIGHTING */ + { 11051, 0x00000040 }, /* GL_LIGHTING_BIT */ + { 11067, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ + { 11090, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + { 11119, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ + { 11152, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + { 11180, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ + { 11204, 0x00001B01 }, /* GL_LINE */ + { 11212, 0x00002601 }, /* GL_LINEAR */ + { 11222, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ + { 11244, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + { 11274, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + { 11305, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ + { 11329, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ + { 11354, 0x00000001 }, /* GL_LINES */ + { 11363, 0x00000004 }, /* GL_LINE_BIT */ + { 11375, 0x00000002 }, /* GL_LINE_LOOP */ + { 11388, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ + { 11408, 0x00000B20 }, /* GL_LINE_SMOOTH */ + { 11423, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ + { 11443, 0x00000B24 }, /* GL_LINE_STIPPLE */ + { 11459, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ + { 11483, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ + { 11506, 0x00000003 }, /* GL_LINE_STRIP */ + { 11520, 0x00000702 }, /* GL_LINE_TOKEN */ + { 11534, 0x00000B21 }, /* GL_LINE_WIDTH */ + { 11548, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ + { 11574, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ + { 11594, 0x00000B32 }, /* GL_LIST_BASE */ + { 11607, 0x00020000 }, /* GL_LIST_BIT */ + { 11619, 0x00000B33 }, /* GL_LIST_INDEX */ + { 11633, 0x00000B30 }, /* GL_LIST_MODE */ + { 11646, 0x00000101 }, /* GL_LOAD */ + { 11654, 0x00000BF1 }, /* GL_LOGIC_OP */ + { 11666, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ + { 11683, 0x00001909 }, /* GL_LUMINANCE */ + { 11696, 0x00008041 }, /* GL_LUMINANCE12 */ + { 11711, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ + { 11734, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ + { 11761, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ + { 11783, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ + { 11809, 0x00008041 }, /* GL_LUMINANCE12_EXT */ + { 11828, 0x00008042 }, /* GL_LUMINANCE16 */ + { 11843, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ + { 11866, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ + { 11893, 0x00008042 }, /* GL_LUMINANCE16_EXT */ + { 11912, 0x0000803F }, /* GL_LUMINANCE4 */ + { 11926, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ + { 11947, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ + { 11972, 0x0000803F }, /* GL_LUMINANCE4_EXT */ + { 11990, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ + { 12011, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ + { 12036, 0x00008040 }, /* GL_LUMINANCE8 */ + { 12050, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ + { 12071, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ + { 12096, 0x00008040 }, /* GL_LUMINANCE8_EXT */ + { 12114, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ + { 12133, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ + { 12149, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ + { 12169, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ + { 12191, 0x00000D91 }, /* GL_MAP1_INDEX */ + { 12205, 0x00000D92 }, /* GL_MAP1_NORMAL */ + { 12220, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ + { 12244, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ + { 12268, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ + { 12292, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ + { 12316, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ + { 12333, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ + { 12350, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + { 12378, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + { 12407, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + { 12436, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + { 12465, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + { 12494, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + { 12523, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + { 12552, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + { 12580, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + { 12608, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + { 12636, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + { 12664, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + { 12692, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + { 12720, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + { 12748, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + { 12776, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + { 12804, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ + { 12820, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ + { 12840, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ + { 12862, 0x00000DB1 }, /* GL_MAP2_INDEX */ + { 12876, 0x00000DB2 }, /* GL_MAP2_NORMAL */ + { 12891, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ + { 12915, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ + { 12939, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ + { 12963, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ + { 12987, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ + { 13004, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ + { 13021, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + { 13049, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + { 13078, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + { 13107, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + { 13136, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + { 13165, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + { 13194, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + { 13223, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + { 13251, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + { 13279, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + { 13307, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + { 13335, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + { 13363, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + { 13391, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ + { 13419, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + { 13447, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + { 13475, 0x00000D10 }, /* GL_MAP_COLOR */ + { 13488, 0x00000D11 }, /* GL_MAP_STENCIL */ + { 13503, 0x000088C0 }, /* GL_MATRIX0_ARB */ + { 13518, 0x00008630 }, /* GL_MATRIX0_NV */ + { 13532, 0x000088CA }, /* GL_MATRIX10_ARB */ + { 13548, 0x000088CB }, /* GL_MATRIX11_ARB */ + { 13564, 0x000088CC }, /* GL_MATRIX12_ARB */ + { 13580, 0x000088CD }, /* GL_MATRIX13_ARB */ + { 13596, 0x000088CE }, /* GL_MATRIX14_ARB */ + { 13612, 0x000088CF }, /* GL_MATRIX15_ARB */ + { 13628, 0x000088D0 }, /* GL_MATRIX16_ARB */ + { 13644, 0x000088D1 }, /* GL_MATRIX17_ARB */ + { 13660, 0x000088D2 }, /* GL_MATRIX18_ARB */ + { 13676, 0x000088D3 }, /* GL_MATRIX19_ARB */ + { 13692, 0x000088C1 }, /* GL_MATRIX1_ARB */ + { 13707, 0x00008631 }, /* GL_MATRIX1_NV */ + { 13721, 0x000088D4 }, /* GL_MATRIX20_ARB */ + { 13737, 0x000088D5 }, /* GL_MATRIX21_ARB */ + { 13753, 0x000088D6 }, /* GL_MATRIX22_ARB */ + { 13769, 0x000088D7 }, /* GL_MATRIX23_ARB */ + { 13785, 0x000088D8 }, /* GL_MATRIX24_ARB */ + { 13801, 0x000088D9 }, /* GL_MATRIX25_ARB */ + { 13817, 0x000088DA }, /* GL_MATRIX26_ARB */ + { 13833, 0x000088DB }, /* GL_MATRIX27_ARB */ + { 13849, 0x000088DC }, /* GL_MATRIX28_ARB */ + { 13865, 0x000088DD }, /* GL_MATRIX29_ARB */ + { 13881, 0x000088C2 }, /* GL_MATRIX2_ARB */ + { 13896, 0x00008632 }, /* GL_MATRIX2_NV */ + { 13910, 0x000088DE }, /* GL_MATRIX30_ARB */ + { 13926, 0x000088DF }, /* GL_MATRIX31_ARB */ + { 13942, 0x000088C3 }, /* GL_MATRIX3_ARB */ + { 13957, 0x00008633 }, /* GL_MATRIX3_NV */ + { 13971, 0x000088C4 }, /* GL_MATRIX4_ARB */ + { 13986, 0x00008634 }, /* GL_MATRIX4_NV */ + { 14000, 0x000088C5 }, /* GL_MATRIX5_ARB */ + { 14015, 0x00008635 }, /* GL_MATRIX5_NV */ + { 14029, 0x000088C6 }, /* GL_MATRIX6_ARB */ + { 14044, 0x00008636 }, /* GL_MATRIX6_NV */ + { 14058, 0x000088C7 }, /* GL_MATRIX7_ARB */ + { 14073, 0x00008637 }, /* GL_MATRIX7_NV */ + { 14087, 0x000088C8 }, /* GL_MATRIX8_ARB */ + { 14102, 0x000088C9 }, /* GL_MATRIX9_ARB */ + { 14117, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ + { 14143, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + { 14177, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + { 14208, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + { 14241, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + { 14272, 0x00000BA0 }, /* GL_MATRIX_MODE */ + { 14287, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ + { 14309, 0x00008008 }, /* GL_MAX */ + { 14316, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ + { 14339, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ + { 14365, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + { 14398, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + { 14424, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 14458, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ + { 14477, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + { 14506, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + { 14538, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ + { 14574, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ + { 14614, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ + { 14640, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ + { 14670, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ + { 14695, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ + { 14724, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + { 14753, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ + { 14786, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ + { 14810, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ + { 14834, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ + { 14858, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ + { 14883, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ + { 14901, 0x00008008 }, /* GL_MAX_EXT */ + { 14912, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ + { 14951, 0x00000D31 }, /* GL_MAX_LIGHTS */ + { 14965, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ + { 14985, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + { 15023, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + { 15052, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ + { 15076, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ + { 15104, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ + { 15127, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 15164, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 15200, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + { 15227, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + { 15256, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + { 15290, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + { 15326, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + { 15353, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + { 15385, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + { 15421, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + { 15450, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + { 15479, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ + { 15507, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + { 15545, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 15589, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 15632, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 15666, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 15705, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 15742, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 15780, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 15823, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 15866, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + { 15896, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + { 15927, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 15963, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 15999, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ + { 16029, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + { 16063, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ + { 16096, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + { 16125, 0x00008504 }, /* GL_MAX_SHININESS_NV */ + { 16145, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ + { 16169, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ + { 16195, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ + { 16226, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ + { 16250, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + { 16284, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ + { 16304, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ + { 16331, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ + { 16352, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ + { 16377, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ + { 16402, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ + { 16437, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ + { 16463, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ + { 16489, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ + { 16527, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ + { 16564, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ + { 16588, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ + { 16609, 0x00008007 }, /* GL_MIN */ + { 16616, 0x0000802E }, /* GL_MINMAX */ + { 16626, 0x0000802E }, /* GL_MINMAX_EXT */ + { 16640, 0x0000802F }, /* GL_MINMAX_FORMAT */ + { 16657, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ + { 16678, 0x00008030 }, /* GL_MINMAX_SINK */ + { 16693, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ + { 16712, 0x00008007 }, /* GL_MIN_EXT */ + { 16723, 0x00008370 }, /* GL_MIRRORED_REPEAT */ + { 16742, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ + { 16765, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ + { 16788, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ + { 16808, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ + { 16828, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + { 16858, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ + { 16886, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + { 16914, 0x00001700 }, /* GL_MODELVIEW */ + { 16927, 0x00001700 }, /* GL_MODELVIEW0_ARB */ + { 16945, 0x0000872A }, /* GL_MODELVIEW10_ARB */ + { 16964, 0x0000872B }, /* GL_MODELVIEW11_ARB */ + { 16983, 0x0000872C }, /* GL_MODELVIEW12_ARB */ + { 17002, 0x0000872D }, /* GL_MODELVIEW13_ARB */ + { 17021, 0x0000872E }, /* GL_MODELVIEW14_ARB */ + { 17040, 0x0000872F }, /* GL_MODELVIEW15_ARB */ + { 17059, 0x00008730 }, /* GL_MODELVIEW16_ARB */ + { 17078, 0x00008731 }, /* GL_MODELVIEW17_ARB */ + { 17097, 0x00008732 }, /* GL_MODELVIEW18_ARB */ + { 17116, 0x00008733 }, /* GL_MODELVIEW19_ARB */ + { 17135, 0x0000850A }, /* GL_MODELVIEW1_ARB */ + { 17153, 0x00008734 }, /* GL_MODELVIEW20_ARB */ + { 17172, 0x00008735 }, /* GL_MODELVIEW21_ARB */ + { 17191, 0x00008736 }, /* GL_MODELVIEW22_ARB */ + { 17210, 0x00008737 }, /* GL_MODELVIEW23_ARB */ + { 17229, 0x00008738 }, /* GL_MODELVIEW24_ARB */ + { 17248, 0x00008739 }, /* GL_MODELVIEW25_ARB */ + { 17267, 0x0000873A }, /* GL_MODELVIEW26_ARB */ + { 17286, 0x0000873B }, /* GL_MODELVIEW27_ARB */ + { 17305, 0x0000873C }, /* GL_MODELVIEW28_ARB */ + { 17324, 0x0000873D }, /* GL_MODELVIEW29_ARB */ + { 17343, 0x00008722 }, /* GL_MODELVIEW2_ARB */ + { 17361, 0x0000873E }, /* GL_MODELVIEW30_ARB */ + { 17380, 0x0000873F }, /* GL_MODELVIEW31_ARB */ + { 17399, 0x00008723 }, /* GL_MODELVIEW3_ARB */ + { 17417, 0x00008724 }, /* GL_MODELVIEW4_ARB */ + { 17435, 0x00008725 }, /* GL_MODELVIEW5_ARB */ + { 17453, 0x00008726 }, /* GL_MODELVIEW6_ARB */ + { 17471, 0x00008727 }, /* GL_MODELVIEW7_ARB */ + { 17489, 0x00008728 }, /* GL_MODELVIEW8_ARB */ + { 17507, 0x00008729 }, /* GL_MODELVIEW9_ARB */ + { 17525, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ + { 17545, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ + { 17572, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ + { 17597, 0x00002100 }, /* GL_MODULATE */ + { 17609, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ + { 17629, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ + { 17656, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ + { 17681, 0x00000103 }, /* GL_MULT */ + { 17689, 0x0000809D }, /* GL_MULTISAMPLE */ + { 17704, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ + { 17724, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ + { 17743, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ + { 17762, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ + { 17786, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ + { 17809, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + { 17839, 0x00002A25 }, /* GL_N3F_V3F */ + { 17850, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ + { 17870, 0x0000150E }, /* GL_NAND */ + { 17878, 0x00002600 }, /* GL_NEAREST */ + { 17889, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + { 17920, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + { 17952, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ + { 17977, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ + { 18003, 0x00000200 }, /* GL_NEVER */ + { 18012, 0x00001102 }, /* GL_NICEST */ + { 18022, 0x00000000 }, /* GL_NONE */ + { 18030, 0x00001505 }, /* GL_NOOP */ + { 18038, 0x00001508 }, /* GL_NOR */ + { 18045, 0x00000BA1 }, /* GL_NORMALIZE */ + { 18058, 0x00008075 }, /* GL_NORMAL_ARRAY */ + { 18074, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + { 18105, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ + { 18140, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ + { 18164, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ + { 18187, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ + { 18208, 0x00008511 }, /* GL_NORMAL_MAP */ + { 18222, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ + { 18240, 0x00008511 }, /* GL_NORMAL_MAP_NV */ + { 18257, 0x00000205 }, /* GL_NOTEQUAL */ + { 18269, 0x00000000 }, /* GL_NO_ERROR */ + { 18281, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + { 18315, 0x000086A2 }, /* GL_NUM_TEXTURE_COMPRESSED_FORMATS_ARB */ + { 18353, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ + { 18385, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ + { 18427, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ + { 18457, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ + { 18497, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ + { 18528, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ + { 18557, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ + { 18585, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ + { 18615, 0x00002401 }, /* GL_OBJECT_LINEAR */ + { 18632, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ + { 18658, 0x00002501 }, /* GL_OBJECT_PLANE */ + { 18674, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ + { 18709, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ + { 18731, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ + { 18750, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ + { 18780, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ + { 18801, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ + { 18829, 0x00000001 }, /* GL_ONE */ + { 18836, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + { 18864, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ + { 18896, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ + { 18924, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ + { 18956, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ + { 18979, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ + { 19002, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ + { 19025, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ + { 19048, 0x00008598 }, /* GL_OPERAND0_ALPHA */ + { 19066, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ + { 19088, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ + { 19110, 0x00008590 }, /* GL_OPERAND0_RGB */ + { 19126, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ + { 19146, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ + { 19166, 0x00008599 }, /* GL_OPERAND1_ALPHA */ + { 19184, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ + { 19206, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ + { 19228, 0x00008591 }, /* GL_OPERAND1_RGB */ + { 19244, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ + { 19264, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ + { 19284, 0x0000859A }, /* GL_OPERAND2_ALPHA */ + { 19302, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ + { 19324, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ + { 19346, 0x00008592 }, /* GL_OPERAND2_RGB */ + { 19362, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ + { 19382, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ + { 19402, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ + { 19423, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ + { 19442, 0x00001507 }, /* GL_OR */ + { 19448, 0x00000A01 }, /* GL_ORDER */ + { 19457, 0x0000150D }, /* GL_OR_INVERTED */ + { 19472, 0x0000150B }, /* GL_OR_REVERSE */ + { 19486, 0x00000505 }, /* GL_OUT_OF_MEMORY */ + { 19503, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ + { 19521, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ + { 19542, 0x00008758 }, /* GL_PACK_INVERT_MESA */ + { 19562, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ + { 19580, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ + { 19599, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ + { 19619, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ + { 19639, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ + { 19657, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ + { 19676, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ + { 19701, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ + { 19725, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ + { 19746, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ + { 19768, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ + { 19790, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ + { 19815, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ + { 19839, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ + { 19860, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ + { 19882, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ + { 19904, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ + { 19926, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ + { 19957, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ + { 19977, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + { 20002, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ + { 20022, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + { 20047, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ + { 20067, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + { 20092, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ + { 20112, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + { 20137, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ + { 20157, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + { 20182, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ + { 20202, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + { 20227, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ + { 20247, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + { 20272, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ + { 20292, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + { 20317, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ + { 20337, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + { 20362, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ + { 20382, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + { 20407, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ + { 20425, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ + { 20458, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ + { 20483, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ + { 20518, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ + { 20545, 0x00001B00 }, /* GL_POINT */ + { 20554, 0x00000000 }, /* GL_POINTS */ + { 20564, 0x00000002 }, /* GL_POINT_BIT */ + { 20577, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ + { 20607, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ + { 20641, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ + { 20675, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ + { 20710, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ + { 20739, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ + { 20772, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ + { 20805, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ + { 20839, 0x00000B11 }, /* GL_POINT_SIZE */ + { 20853, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ + { 20879, 0x00008127 }, /* GL_POINT_SIZE_MAX */ + { 20897, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ + { 20919, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ + { 20941, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ + { 20964, 0x00008126 }, /* GL_POINT_SIZE_MIN */ + { 20982, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ + { 21004, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ + { 21026, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ + { 21049, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ + { 21069, 0x00000B10 }, /* GL_POINT_SMOOTH */ + { 21085, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ + { 21106, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ + { 21126, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ + { 21155, 0x00008861 }, /* GL_POINT_SPRITE_NV */ + { 21174, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ + { 21200, 0x00000701 }, /* GL_POINT_TOKEN */ + { 21215, 0x00000009 }, /* GL_POLYGON */ + { 21226, 0x00000008 }, /* GL_POLYGON_BIT */ + { 21241, 0x00000B40 }, /* GL_POLYGON_MODE */ + { 21257, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ + { 21280, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ + { 21305, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ + { 21328, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ + { 21351, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ + { 21375, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ + { 21399, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ + { 21417, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ + { 21440, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ + { 21459, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ + { 21482, 0x00000703 }, /* GL_POLYGON_TOKEN */ + { 21499, 0x00001203 }, /* GL_POSITION */ + { 21511, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + { 21543, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ + { 21579, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + { 21612, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ + { 21649, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + { 21680, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ + { 21715, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + { 21747, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ + { 21783, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + { 21816, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + { 21848, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ + { 21884, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + { 21917, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ + { 21954, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + { 21984, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ + { 22018, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + { 22049, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ + { 22084, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + { 22115, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ + { 22150, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + { 22182, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ + { 22218, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + { 22248, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ + { 22282, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + { 22313, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ + { 22348, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + { 22380, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + { 22411, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ + { 22446, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + { 22478, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ + { 22514, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ + { 22543, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ + { 22576, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ + { 22606, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ + { 22640, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + { 22679, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + { 22712, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + { 22752, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + { 22786, 0x00008578 }, /* GL_PREVIOUS */ + { 22798, 0x00008578 }, /* GL_PREVIOUS_ARB */ + { 22814, 0x00008578 }, /* GL_PREVIOUS_EXT */ + { 22830, 0x00008577 }, /* GL_PRIMARY_COLOR */ + { 22847, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ + { 22868, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ + { 22889, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 22922, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 22954, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ + { 22977, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ + { 23000, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ + { 23030, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ + { 23059, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ + { 23087, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ + { 23109, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + { 23137, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + { 23165, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ + { 23187, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ + { 23208, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 23248, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 23287, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 23317, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 23352, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 23385, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 23419, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 23458, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 23497, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ + { 23519, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ + { 23545, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ + { 23569, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ + { 23592, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ + { 23614, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ + { 23635, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ + { 23656, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ + { 23683, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 23715, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 23747, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + { 23782, 0x00001701 }, /* GL_PROJECTION */ + { 23796, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ + { 23817, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ + { 23843, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ + { 23864, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ + { 23883, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ + { 23906, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + { 23945, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + { 23983, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ + { 24003, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ + { 24027, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ + { 24047, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ + { 24071, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ + { 24091, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + { 24124, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ + { 24150, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ + { 24180, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + { 24211, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ + { 24241, 0x00002003 }, /* GL_Q */ + { 24246, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ + { 24271, 0x00000007 }, /* GL_QUADS */ + { 24280, 0x00008614 }, /* GL_QUAD_MESH_SUN */ + { 24297, 0x00000008 }, /* GL_QUAD_STRIP */ + { 24311, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ + { 24333, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ + { 24359, 0x00008866 }, /* GL_QUERY_RESULT */ + { 24375, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ + { 24395, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ + { 24421, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ + { 24451, 0x00002002 }, /* GL_R */ + { 24456, 0x00002A10 }, /* GL_R3_G3_B2 */ + { 24468, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + { 24501, 0x00000C02 }, /* GL_READ_BUFFER */ + { 24516, 0x000088B8 }, /* GL_READ_ONLY */ + { 24529, 0x000088B8 }, /* GL_READ_ONLY_ARB */ + { 24546, 0x000088BA }, /* GL_READ_WRITE */ + { 24560, 0x000088BA }, /* GL_READ_WRITE_ARB */ + { 24578, 0x00001903 }, /* GL_RED */ + { 24585, 0x00008016 }, /* GL_REDUCE */ + { 24595, 0x00008016 }, /* GL_REDUCE_EXT */ + { 24609, 0x00000D15 }, /* GL_RED_BIAS */ + { 24621, 0x00000D52 }, /* GL_RED_BITS */ + { 24633, 0x00000D14 }, /* GL_RED_SCALE */ + { 24646, 0x00008512 }, /* GL_REFLECTION_MAP */ + { 24664, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ + { 24686, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ + { 24707, 0x00001C00 }, /* GL_RENDER */ + { 24717, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ + { 24745, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ + { 24765, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ + { 24792, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ + { 24828, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ + { 24854, 0x00001F01 }, /* GL_RENDERER */ + { 24866, 0x00000C40 }, /* GL_RENDER_MODE */ + { 24881, 0x00002901 }, /* GL_REPEAT */ + { 24891, 0x00001E01 }, /* GL_REPLACE */ + { 24902, 0x00008062 }, /* GL_REPLACE_EXT */ + { 24917, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ + { 24940, 0x0000803A }, /* GL_RESCALE_NORMAL */ + { 24958, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ + { 24980, 0x00000102 }, /* GL_RETURN */ + { 24990, 0x00001907 }, /* GL_RGB */ + { 24997, 0x00008052 }, /* GL_RGB10 */ + { 25006, 0x00008059 }, /* GL_RGB10_A2 */ + { 25018, 0x00008059 }, /* GL_RGB10_A2_EXT */ + { 25034, 0x00008052 }, /* GL_RGB10_EXT */ + { 25047, 0x00008053 }, /* GL_RGB12 */ + { 25056, 0x00008053 }, /* GL_RGB12_EXT */ + { 25069, 0x00008054 }, /* GL_RGB16 */ + { 25078, 0x00008054 }, /* GL_RGB16_EXT */ + { 25091, 0x0000804E }, /* GL_RGB2_EXT */ + { 25103, 0x0000804F }, /* GL_RGB4 */ + { 25111, 0x0000804F }, /* GL_RGB4_EXT */ + { 25123, 0x000083A1 }, /* GL_RGB4_S3TC */ + { 25136, 0x00008050 }, /* GL_RGB5 */ + { 25144, 0x00008057 }, /* GL_RGB5_A1 */ + { 25155, 0x00008057 }, /* GL_RGB5_A1_EXT */ + { 25170, 0x00008050 }, /* GL_RGB5_EXT */ + { 25182, 0x00008051 }, /* GL_RGB8 */ + { 25190, 0x00008051 }, /* GL_RGB8_EXT */ + { 25202, 0x00001908 }, /* GL_RGBA */ + { 25210, 0x0000805A }, /* GL_RGBA12 */ + { 25220, 0x0000805A }, /* GL_RGBA12_EXT */ + { 25234, 0x0000805B }, /* GL_RGBA16 */ + { 25244, 0x0000805B }, /* GL_RGBA16_EXT */ + { 25258, 0x00008055 }, /* GL_RGBA2 */ + { 25267, 0x00008055 }, /* GL_RGBA2_EXT */ + { 25280, 0x00008056 }, /* GL_RGBA4 */ + { 25289, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ + { 25308, 0x00008056 }, /* GL_RGBA4_EXT */ + { 25321, 0x000083A3 }, /* GL_RGBA4_S3TC */ + { 25335, 0x00008058 }, /* GL_RGBA8 */ + { 25344, 0x00008058 }, /* GL_RGBA8_EXT */ + { 25357, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ + { 25375, 0x00000C31 }, /* GL_RGBA_MODE */ + { 25388, 0x000083A2 }, /* GL_RGBA_S3TC */ + { 25401, 0x000083A0 }, /* GL_RGB_S3TC */ + { 25413, 0x00008573 }, /* GL_RGB_SCALE */ + { 25426, 0x00008573 }, /* GL_RGB_SCALE_ARB */ + { 25443, 0x00008573 }, /* GL_RGB_SCALE_EXT */ + { 25460, 0x00000407 }, /* GL_RIGHT */ + { 25469, 0x00002000 }, /* GL_S */ + { 25474, 0x000080A9 }, /* GL_SAMPLES */ + { 25485, 0x000086B4 }, /* GL_SAMPLES_3DFX */ + { 25501, 0x000080A9 }, /* GL_SAMPLES_ARB */ + { 25516, 0x00008914 }, /* GL_SAMPLES_PASSED */ + { 25534, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ + { 25556, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + { 25584, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ + { 25616, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ + { 25639, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ + { 25666, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ + { 25684, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ + { 25707, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ + { 25729, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ + { 25748, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ + { 25771, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ + { 25797, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ + { 25827, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ + { 25852, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ + { 25881, 0x00080000 }, /* GL_SCISSOR_BIT */ + { 25896, 0x00000C10 }, /* GL_SCISSOR_BOX */ + { 25911, 0x00000C11 }, /* GL_SCISSOR_TEST */ + { 25927, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ + { 25952, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + { 25992, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ + { 26036, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + { 26069, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + { 26099, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + { 26131, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + { 26161, 0x00001C02 }, /* GL_SELECT */ + { 26171, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ + { 26199, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ + { 26224, 0x00008012 }, /* GL_SEPARABLE_2D */ + { 26240, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ + { 26267, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ + { 26298, 0x0000150F }, /* GL_SET */ + { 26305, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ + { 26326, 0x00000B54 }, /* GL_SHADE_MODEL */ + { 26341, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ + { 26364, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + { 26394, 0x00001601 }, /* GL_SHININESS */ + { 26407, 0x00001402 }, /* GL_SHORT */ + { 26416, 0x000081F9 }, /* GL_SINGLE_COLOR */ + { 26432, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ + { 26452, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ + { 26471, 0x00001D01 }, /* GL_SMOOTH */ + { 26481, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ + { 26514, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ + { 26541, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ + { 26574, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ + { 26601, 0x00008588 }, /* GL_SOURCE0_ALPHA */ + { 26618, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ + { 26639, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ + { 26660, 0x00008580 }, /* GL_SOURCE0_RGB */ + { 26675, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ + { 26694, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ + { 26713, 0x00008589 }, /* GL_SOURCE1_ALPHA */ + { 26730, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ + { 26751, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ + { 26772, 0x00008581 }, /* GL_SOURCE1_RGB */ + { 26787, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ + { 26806, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ + { 26825, 0x0000858A }, /* GL_SOURCE2_ALPHA */ + { 26842, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ + { 26863, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ + { 26884, 0x00008582 }, /* GL_SOURCE2_RGB */ + { 26899, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ + { 26918, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ + { 26937, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ + { 26957, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ + { 26975, 0x00001202 }, /* GL_SPECULAR */ + { 26987, 0x00002402 }, /* GL_SPHERE_MAP */ + { 27001, 0x00001206 }, /* GL_SPOT_CUTOFF */ + { 27016, 0x00001204 }, /* GL_SPOT_DIRECTION */ + { 27034, 0x00001205 }, /* GL_SPOT_EXPONENT */ + { 27051, 0x00008588 }, /* GL_SRC0_ALPHA */ + { 27065, 0x00008580 }, /* GL_SRC0_RGB */ + { 27077, 0x00008589 }, /* GL_SRC1_ALPHA */ + { 27091, 0x00008581 }, /* GL_SRC1_RGB */ + { 27103, 0x0000858A }, /* GL_SRC2_ALPHA */ + { 27117, 0x00008582 }, /* GL_SRC2_RGB */ + { 27129, 0x00000302 }, /* GL_SRC_ALPHA */ + { 27142, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ + { 27164, 0x00000300 }, /* GL_SRC_COLOR */ + { 27177, 0x00000503 }, /* GL_STACK_OVERFLOW */ + { 27195, 0x00000504 }, /* GL_STACK_UNDERFLOW */ + { 27214, 0x000088E6 }, /* GL_STATIC_COPY */ + { 27229, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ + { 27248, 0x000088E4 }, /* GL_STATIC_DRAW */ + { 27263, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ + { 27282, 0x000088E5 }, /* GL_STATIC_READ */ + { 27297, 0x000088E5 }, /* GL_STATIC_READ_ARB */ + { 27316, 0x00001802 }, /* GL_STENCIL */ + { 27327, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ + { 27353, 0x00000D57 }, /* GL_STENCIL_BITS */ + { 27369, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ + { 27391, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ + { 27414, 0x00000B94 }, /* GL_STENCIL_FAIL */ + { 27430, 0x00000B92 }, /* GL_STENCIL_FUNC */ + { 27446, 0x00001901 }, /* GL_STENCIL_INDEX */ + { 27463, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ + { 27486, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ + { 27508, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ + { 27530, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ + { 27552, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ + { 27573, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ + { 27600, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ + { 27627, 0x00000B97 }, /* GL_STENCIL_REF */ + { 27642, 0x00000B90 }, /* GL_STENCIL_TEST */ + { 27658, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + { 27687, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ + { 27709, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ + { 27730, 0x00000C33 }, /* GL_STEREO */ + { 27740, 0x000088E2 }, /* GL_STREAM_COPY */ + { 27755, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ + { 27774, 0x000088E0 }, /* GL_STREAM_DRAW */ + { 27789, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ + { 27808, 0x000088E1 }, /* GL_STREAM_READ */ + { 27823, 0x000088E1 }, /* GL_STREAM_READ_ARB */ + { 27842, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ + { 27859, 0x000084E7 }, /* GL_SUBTRACT */ + { 27871, 0x000084E7 }, /* GL_SUBTRACT_ARB */ + { 27887, 0x00002001 }, /* GL_T */ + { 27892, 0x00002A2A }, /* GL_T2F_C3F_V3F */ + { 27907, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ + { 27926, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ + { 27942, 0x00002A2B }, /* GL_T2F_N3F_V3F */ + { 27957, 0x00002A27 }, /* GL_T2F_V3F */ + { 27968, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ + { 27987, 0x00002A28 }, /* GL_T4F_V4F */ + { 27998, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ + { 28021, 0x00001702 }, /* GL_TEXTURE */ + { 28032, 0x000084C0 }, /* GL_TEXTURE0 */ + { 28044, 0x000084C0 }, /* GL_TEXTURE0_ARB */ + { 28060, 0x000084C1 }, /* GL_TEXTURE1 */ + { 28072, 0x000084CA }, /* GL_TEXTURE10 */ + { 28085, 0x000084CA }, /* GL_TEXTURE10_ARB */ + { 28102, 0x000084CB }, /* GL_TEXTURE11 */ + { 28115, 0x000084CB }, /* GL_TEXTURE11_ARB */ + { 28132, 0x000084CC }, /* GL_TEXTURE12 */ + { 28145, 0x000084CC }, /* GL_TEXTURE12_ARB */ + { 28162, 0x000084CD }, /* GL_TEXTURE13 */ + { 28175, 0x000084CD }, /* GL_TEXTURE13_ARB */ + { 28192, 0x000084CE }, /* GL_TEXTURE14 */ + { 28205, 0x000084CE }, /* GL_TEXTURE14_ARB */ + { 28222, 0x000084CF }, /* GL_TEXTURE15 */ + { 28235, 0x000084CF }, /* GL_TEXTURE15_ARB */ + { 28252, 0x000084D0 }, /* GL_TEXTURE16 */ + { 28265, 0x000084D0 }, /* GL_TEXTURE16_ARB */ + { 28282, 0x000084D1 }, /* GL_TEXTURE17 */ + { 28295, 0x000084D1 }, /* GL_TEXTURE17_ARB */ + { 28312, 0x000084D2 }, /* GL_TEXTURE18 */ + { 28325, 0x000084D2 }, /* GL_TEXTURE18_ARB */ + { 28342, 0x000084D3 }, /* GL_TEXTURE19 */ + { 28355, 0x000084D3 }, /* GL_TEXTURE19_ARB */ + { 28372, 0x000084C1 }, /* GL_TEXTURE1_ARB */ + { 28388, 0x000084C2 }, /* GL_TEXTURE2 */ + { 28400, 0x000084D4 }, /* GL_TEXTURE20 */ + { 28413, 0x000084D4 }, /* GL_TEXTURE20_ARB */ + { 28430, 0x000084D5 }, /* GL_TEXTURE21 */ + { 28443, 0x000084D5 }, /* GL_TEXTURE21_ARB */ + { 28460, 0x000084D6 }, /* GL_TEXTURE22 */ + { 28473, 0x000084D6 }, /* GL_TEXTURE22_ARB */ + { 28490, 0x000084D7 }, /* GL_TEXTURE23 */ + { 28503, 0x000084D7 }, /* GL_TEXTURE23_ARB */ + { 28520, 0x000084D8 }, /* GL_TEXTURE24 */ + { 28533, 0x000084D8 }, /* GL_TEXTURE24_ARB */ + { 28550, 0x000084D9 }, /* GL_TEXTURE25 */ + { 28563, 0x000084D9 }, /* GL_TEXTURE25_ARB */ + { 28580, 0x000084DA }, /* GL_TEXTURE26 */ + { 28593, 0x000084DA }, /* GL_TEXTURE26_ARB */ + { 28610, 0x000084DB }, /* GL_TEXTURE27 */ + { 28623, 0x000084DB }, /* GL_TEXTURE27_ARB */ + { 28640, 0x000084DC }, /* GL_TEXTURE28 */ + { 28653, 0x000084DC }, /* GL_TEXTURE28_ARB */ + { 28670, 0x000084DD }, /* GL_TEXTURE29 */ + { 28683, 0x000084DD }, /* GL_TEXTURE29_ARB */ + { 28700, 0x000084C2 }, /* GL_TEXTURE2_ARB */ + { 28716, 0x000084C3 }, /* GL_TEXTURE3 */ + { 28728, 0x000084DE }, /* GL_TEXTURE30 */ + { 28741, 0x000084DE }, /* GL_TEXTURE30_ARB */ + { 28758, 0x000084DF }, /* GL_TEXTURE31 */ + { 28771, 0x000084DF }, /* GL_TEXTURE31_ARB */ + { 28788, 0x000084C3 }, /* GL_TEXTURE3_ARB */ + { 28804, 0x000084C4 }, /* GL_TEXTURE4 */ + { 28816, 0x000084C4 }, /* GL_TEXTURE4_ARB */ + { 28832, 0x000084C5 }, /* GL_TEXTURE5 */ + { 28844, 0x000084C5 }, /* GL_TEXTURE5_ARB */ + { 28860, 0x000084C6 }, /* GL_TEXTURE6 */ + { 28872, 0x000084C6 }, /* GL_TEXTURE6_ARB */ + { 28888, 0x000084C7 }, /* GL_TEXTURE7 */ + { 28900, 0x000084C7 }, /* GL_TEXTURE7_ARB */ + { 28916, 0x000084C8 }, /* GL_TEXTURE8 */ + { 28928, 0x000084C8 }, /* GL_TEXTURE8_ARB */ + { 28944, 0x000084C9 }, /* GL_TEXTURE9 */ + { 28956, 0x000084C9 }, /* GL_TEXTURE9_ARB */ + { 28972, 0x00000DE0 }, /* GL_TEXTURE_1D */ + { 28986, 0x00000DE1 }, /* GL_TEXTURE_2D */ + { 29000, 0x0000806F }, /* GL_TEXTURE_3D */ + { 29014, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ + { 29036, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ + { 29062, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ + { 29084, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ + { 29106, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ + { 29128, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ + { 29150, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ + { 29178, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ + { 29210, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + { 29243, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ + { 29275, 0x00040000 }, /* GL_TEXTURE_BIT */ + { 29290, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ + { 29311, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ + { 29336, 0x00001005 }, /* GL_TEXTURE_BORDER */ + { 29354, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ + { 29378, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + { 29409, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + { 29439, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + { 29469, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + { 29504, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + { 29535, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 29573, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ + { 29600, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + { 29632, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + { 29666, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ + { 29690, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ + { 29718, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ + { 29742, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ + { 29770, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + { 29803, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ + { 29827, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ + { 29849, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ + { 29871, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ + { 29897, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ + { 29931, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + { 29964, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ + { 30001, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ + { 30029, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ + { 30061, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ + { 30084, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + { 30122, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ + { 30164, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + { 30195, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + { 30223, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + { 30253, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + { 30281, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ + { 30301, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ + { 30325, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + { 30356, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ + { 30391, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + { 30422, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ + { 30457, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + { 30488, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ + { 30523, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + { 30554, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ + { 30589, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + { 30620, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ + { 30655, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + { 30686, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ + { 30721, 0x00008071 }, /* GL_TEXTURE_DEPTH */ + { 30738, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ + { 30760, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ + { 30786, 0x00002300 }, /* GL_TEXTURE_ENV */ + { 30801, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ + { 30822, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ + { 30842, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ + { 30868, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ + { 30888, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ + { 30905, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ + { 30922, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ + { 30939, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ + { 30956, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ + { 30981, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ + { 31003, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ + { 31029, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ + { 31047, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ + { 31073, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ + { 31099, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ + { 31129, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ + { 31156, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ + { 31181, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ + { 31201, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ + { 31225, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + { 31252, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + { 31279, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + { 31306, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ + { 31332, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ + { 31362, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ + { 31384, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ + { 31402, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + { 31432, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + { 31460, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + { 31488, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + { 31516, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ + { 31537, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ + { 31556, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ + { 31578, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ + { 31597, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ + { 31617, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ + { 31642, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ + { 31666, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ + { 31686, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ + { 31710, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ + { 31730, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ + { 31753, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ + { 31778, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + { 31812, 0x00001000 }, /* GL_TEXTURE_WIDTH */ + { 31829, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ + { 31847, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ + { 31865, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ + { 31883, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ + { 31902, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + { 31931, 0x00001000 }, /* GL_TRANSFORM_BIT */ + { 31948, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ + { 31974, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ + { 32004, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + { 32036, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + { 32066, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ + { 32100, 0x0000862C }, /* GL_TRANSPOSE_NV */ + { 32116, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + { 32147, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ + { 32182, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + { 32210, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ + { 32242, 0x00000004 }, /* GL_TRIANGLES */ + { 32255, 0x00000006 }, /* GL_TRIANGLE_FAN */ + { 32271, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ + { 32292, 0x00000005 }, /* GL_TRIANGLE_STRIP */ + { 32310, 0x00000001 }, /* GL_TRUE */ + { 32318, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ + { 32338, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ + { 32361, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ + { 32381, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ + { 32402, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ + { 32424, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ + { 32446, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ + { 32466, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ + { 32487, 0x00001401 }, /* GL_UNSIGNED_BYTE */ + { 32504, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + { 32531, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ + { 32554, 0x00001405 }, /* GL_UNSIGNED_INT */ + { 32570, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ + { 32597, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ + { 32621, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + { 32652, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ + { 32676, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + { 32704, 0x00001403 }, /* GL_UNSIGNED_SHORT */ + { 32722, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + { 32752, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + { 32778, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + { 32808, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + { 32834, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ + { 32858, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + { 32886, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + { 32914, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ + { 32941, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + { 32973, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ + { 33004, 0x00002A20 }, /* GL_V2F */ + { 33011, 0x00002A21 }, /* GL_V3F */ + { 33018, 0x00001F00 }, /* GL_VENDOR */ + { 33028, 0x00001F02 }, /* GL_VERSION */ + { 33039, 0x00008074 }, /* GL_VERTEX_ARRAY */ + { 33055, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + { 33086, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ + { 33121, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ + { 33145, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ + { 33166, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ + { 33189, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ + { 33210, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + { 33237, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + { 33265, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + { 33293, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + { 33321, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + { 33349, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + { 33377, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + { 33405, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + { 33432, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + { 33459, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + { 33486, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + { 33513, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + { 33540, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + { 33567, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + { 33594, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + { 33621, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + { 33648, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + { 33686, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ + { 33728, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ + { 33763, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ + { 33801, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ + { 33836, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ + { 33868, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ + { 33902, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ + { 33934, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ + { 33954, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ + { 33976, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ + { 34005, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ + { 34026, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ + { 34059, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ + { 34091, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ + { 34122, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ + { 34152, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ + { 34173, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ + { 34200, 0x00000BA2 }, /* GL_VIEWPORT */ + { 34212, 0x00000800 }, /* GL_VIEWPORT_BIT */ + { 34228, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ + { 34248, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + { 34279, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ + { 34314, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + { 34342, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + { 34367, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + { 34394, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + { 34419, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ + { 34443, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ + { 34462, 0x000088B9 }, /* GL_WRITE_ONLY */ + { 34476, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ + { 34494, 0x00001506 }, /* GL_XOR */ + { 34501, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ + { 34520, 0x00008757 }, /* GL_YCBCR_MESA */ + { 34534, 0x00000000 }, /* GL_ZERO */ + { 34542, 0x00000D16 }, /* GL_ZOOM_X */ + { 34552, 0x00000D17 }, /* GL_ZOOM_Y */ }; -static const unsigned reduced_enums[1232] = +static const unsigned reduced_enums[1233] = { 26, /* GL_ALL_CLIENT_ATTRIB_BITS */ 389, /* GL_FALSE */ - 561, /* GL_LINES */ - 563, /* GL_LINE_LOOP */ - 570, /* GL_LINE_STRIP */ - 1515, /* GL_TRIANGLES */ - 1518, /* GL_TRIANGLE_STRIP */ - 1516, /* GL_TRIANGLE_FAN */ - 1112, /* GL_QUADS */ - 1114, /* GL_QUAD_STRIP */ - 1002, /* GL_POLYGON */ - 1014, /* GL_POLYGON_STIPPLE_BIT */ - 968, /* GL_PIXEL_MODE_BIT */ - 548, /* GL_LIGHTING_BIT */ + 562, /* GL_LINES */ + 564, /* GL_LINE_LOOP */ + 571, /* GL_LINE_STRIP */ + 1516, /* GL_TRIANGLES */ + 1519, /* GL_TRIANGLE_STRIP */ + 1517, /* GL_TRIANGLE_FAN */ + 1113, /* GL_QUADS */ + 1115, /* GL_QUAD_STRIP */ + 1003, /* GL_POLYGON */ + 1015, /* GL_POLYGON_STIPPLE_BIT */ + 969, /* GL_PIXEL_MODE_BIT */ + 549, /* GL_LIGHTING_BIT */ 405, /* GL_FOG_BIT */ 8, /* GL_ACCUM */ - 579, /* GL_LOAD */ - 1152, /* GL_RETURN */ - 841, /* GL_MULT */ + 580, /* GL_LOAD */ + 1153, /* GL_RETURN */ + 842, /* GL_MULT */ 19, /* GL_ADD */ - 857, /* GL_NEVER */ - 538, /* GL_LESS */ + 858, /* GL_NEVER */ + 539, /* GL_LESS */ 379, /* GL_EQUAL */ - 537, /* GL_LEQUAL */ - 467, /* GL_GREATER */ - 872, /* GL_NOTEQUAL */ + 538, /* GL_LEQUAL */ + 468, /* GL_GREATER */ + 873, /* GL_NOTEQUAL */ 466, /* GL_GEQUAL */ 42, /* GL_ALWAYS */ - 1276, /* GL_SRC_COLOR */ - 901, /* GL_ONE_MINUS_SRC_COLOR */ - 1274, /* GL_SRC_ALPHA */ - 900, /* GL_ONE_MINUS_SRC_ALPHA */ + 1277, /* GL_SRC_COLOR */ + 902, /* GL_ONE_MINUS_SRC_COLOR */ + 1275, /* GL_SRC_ALPHA */ + 901, /* GL_ONE_MINUS_SRC_ALPHA */ 359, /* GL_DST_ALPHA */ - 898, /* GL_ONE_MINUS_DST_ALPHA */ + 899, /* GL_ONE_MINUS_DST_ALPHA */ 360, /* GL_DST_COLOR */ - 899, /* GL_ONE_MINUS_DST_COLOR */ - 1275, /* GL_SRC_ALPHA_SATURATE */ + 900, /* GL_ONE_MINUS_DST_COLOR */ + 1276, /* GL_SRC_ALPHA_SATURATE */ 454, /* GL_FRONT_LEFT */ 455, /* GL_FRONT_RIGHT */ 64, /* GL_BACK_LEFT */ 65, /* GL_BACK_RIGHT */ 451, /* GL_FRONT */ 63, /* GL_BACK */ - 536, /* GL_LEFT */ - 1192, /* GL_RIGHT */ + 537, /* GL_LEFT */ + 1193, /* GL_RIGHT */ 452, /* GL_FRONT_AND_BACK */ 58, /* GL_AUX0 */ 59, /* GL_AUX1 */ 60, /* GL_AUX2 */ 61, /* GL_AUX3 */ - 528, /* GL_INVALID_ENUM */ - 531, /* GL_INVALID_VALUE */ - 530, /* GL_INVALID_OPERATION */ - 1277, /* GL_STACK_OVERFLOW */ - 1278, /* GL_STACK_UNDERFLOW */ - 926, /* GL_OUT_OF_MEMORY */ - 529, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ + 529, /* GL_INVALID_ENUM */ + 532, /* GL_INVALID_VALUE */ + 531, /* GL_INVALID_OPERATION */ + 1278, /* GL_STACK_OVERFLOW */ + 1279, /* GL_STACK_UNDERFLOW */ + 927, /* GL_OUT_OF_MEMORY */ + 530, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ 0, /* GL_2D */ 2, /* GL_3D */ 3, /* GL_3D_COLOR */ 4, /* GL_3D_COLOR_TEXTURE */ 6, /* GL_4D_COLOR_TEXTURE */ - 946, /* GL_PASS_THROUGH_TOKEN */ - 1001, /* GL_POINT_TOKEN */ - 571, /* GL_LINE_TOKEN */ - 1015, /* GL_POLYGON_TOKEN */ + 947, /* GL_PASS_THROUGH_TOKEN */ + 1002, /* GL_POINT_TOKEN */ + 572, /* GL_LINE_TOKEN */ + 1016, /* GL_POLYGON_TOKEN */ 69, /* GL_BITMAP_TOKEN */ 358, /* GL_DRAW_PIXEL_TOKEN */ 248, /* GL_COPY_PIXEL_TOKEN */ - 564, /* GL_LINE_RESET_TOKEN */ + 565, /* GL_LINE_RESET_TOKEN */ 382, /* GL_EXP */ 383, /* GL_EXP2 */ 279, /* GL_CW */ 106, /* GL_CCW */ 127, /* GL_COEFF */ - 923, /* GL_ORDER */ + 924, /* GL_ORDER */ 315, /* GL_DOMAIN */ 256, /* GL_CURRENT_COLOR */ 259, /* GL_CURRENT_INDEX */ @@ -3354,33 +3356,33 @@ static const unsigned reduced_enums[1232] = 272, /* GL_CURRENT_RASTER_POSITION */ 273, /* GL_CURRENT_RASTER_POSITION_VALID */ 270, /* GL_CURRENT_RASTER_DISTANCE */ - 995, /* GL_POINT_SMOOTH */ - 984, /* GL_POINT_SIZE */ - 994, /* GL_POINT_SIZE_RANGE */ - 985, /* GL_POINT_SIZE_GRANULARITY */ - 565, /* GL_LINE_SMOOTH */ - 572, /* GL_LINE_WIDTH */ - 574, /* GL_LINE_WIDTH_RANGE */ - 573, /* GL_LINE_WIDTH_GRANULARITY */ - 567, /* GL_LINE_STIPPLE */ - 568, /* GL_LINE_STIPPLE_PATTERN */ - 569, /* GL_LINE_STIPPLE_REPEAT */ - 578, /* GL_LIST_MODE */ - 732, /* GL_MAX_LIST_NESTING */ - 575, /* GL_LIST_BASE */ - 577, /* GL_LIST_INDEX */ - 1004, /* GL_POLYGON_MODE */ - 1011, /* GL_POLYGON_SMOOTH */ - 1013, /* GL_POLYGON_STIPPLE */ + 996, /* GL_POINT_SMOOTH */ + 985, /* GL_POINT_SIZE */ + 995, /* GL_POINT_SIZE_RANGE */ + 986, /* GL_POINT_SIZE_GRANULARITY */ + 566, /* GL_LINE_SMOOTH */ + 573, /* GL_LINE_WIDTH */ + 575, /* GL_LINE_WIDTH_RANGE */ + 574, /* GL_LINE_WIDTH_GRANULARITY */ + 568, /* GL_LINE_STIPPLE */ + 569, /* GL_LINE_STIPPLE_PATTERN */ + 570, /* GL_LINE_STIPPLE_REPEAT */ + 579, /* GL_LIST_MODE */ + 733, /* GL_MAX_LIST_NESTING */ + 576, /* GL_LIST_BASE */ + 578, /* GL_LIST_INDEX */ + 1005, /* GL_POLYGON_MODE */ + 1012, /* GL_POLYGON_SMOOTH */ + 1014, /* GL_POLYGON_STIPPLE */ 367, /* GL_EDGE_FLAG */ 249, /* GL_CULL_FACE */ 250, /* GL_CULL_FACE_MODE */ 453, /* GL_FRONT_FACE */ - 547, /* GL_LIGHTING */ - 552, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - 553, /* GL_LIGHT_MODEL_TWO_SIDE */ - 549, /* GL_LIGHT_MODEL_AMBIENT */ - 1230, /* GL_SHADE_MODEL */ + 548, /* GL_LIGHTING */ + 553, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + 554, /* GL_LIGHT_MODEL_TWO_SIDE */ + 550, /* GL_LIGHT_MODEL_AMBIENT */ + 1231, /* GL_SHADE_MODEL */ 158, /* GL_COLOR_MATERIAL_FACE */ 159, /* GL_COLOR_MATERIAL_PARAMETER */ 157, /* GL_COLOR_MATERIAL */ @@ -3397,24 +3399,24 @@ static const unsigned reduced_enums[1232] = 292, /* GL_DEPTH_CLEAR_VALUE */ 303, /* GL_DEPTH_FUNC */ 12, /* GL_ACCUM_CLEAR_VALUE */ - 1301, /* GL_STENCIL_TEST */ - 1289, /* GL_STENCIL_CLEAR_VALUE */ - 1291, /* GL_STENCIL_FUNC */ - 1303, /* GL_STENCIL_VALUE_MASK */ - 1290, /* GL_STENCIL_FAIL */ - 1298, /* GL_STENCIL_PASS_DEPTH_FAIL */ - 1299, /* GL_STENCIL_PASS_DEPTH_PASS */ - 1300, /* GL_STENCIL_REF */ - 1304, /* GL_STENCIL_WRITEMASK */ - 705, /* GL_MATRIX_MODE */ - 862, /* GL_NORMALIZE */ - 1593, /* GL_VIEWPORT */ - 836, /* GL_MODELVIEW_STACK_DEPTH */ - 1094, /* GL_PROJECTION_STACK_DEPTH */ - 1495, /* GL_TEXTURE_STACK_DEPTH */ - 834, /* GL_MODELVIEW_MATRIX */ - 1093, /* GL_PROJECTION_MATRIX */ - 1480, /* GL_TEXTURE_MATRIX */ + 1302, /* GL_STENCIL_TEST */ + 1290, /* GL_STENCIL_CLEAR_VALUE */ + 1292, /* GL_STENCIL_FUNC */ + 1304, /* GL_STENCIL_VALUE_MASK */ + 1291, /* GL_STENCIL_FAIL */ + 1299, /* GL_STENCIL_PASS_DEPTH_FAIL */ + 1300, /* GL_STENCIL_PASS_DEPTH_PASS */ + 1301, /* GL_STENCIL_REF */ + 1305, /* GL_STENCIL_WRITEMASK */ + 706, /* GL_MATRIX_MODE */ + 863, /* GL_NORMALIZE */ + 1594, /* GL_VIEWPORT */ + 837, /* GL_MODELVIEW_STACK_DEPTH */ + 1095, /* GL_PROJECTION_STACK_DEPTH */ + 1496, /* GL_TEXTURE_STACK_DEPTH */ + 835, /* GL_MODELVIEW_MATRIX */ + 1094, /* GL_PROJECTION_MATRIX */ + 1481, /* GL_TEXTURE_MATRIX */ 56, /* GL_ATTRIB_STACK_DEPTH */ 117, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ 39, /* GL_ALPHA_TEST */ @@ -3424,161 +3426,161 @@ static const unsigned reduced_enums[1232] = 73, /* GL_BLEND_DST */ 80, /* GL_BLEND_SRC */ 70, /* GL_BLEND */ - 581, /* GL_LOGIC_OP_MODE */ - 506, /* GL_INDEX_LOGIC_OP */ + 582, /* GL_LOGIC_OP_MODE */ + 507, /* GL_INDEX_LOGIC_OP */ 156, /* GL_COLOR_LOGIC_OP */ 62, /* GL_AUX_BUFFERS */ 325, /* GL_DRAW_BUFFER */ - 1124, /* GL_READ_BUFFER */ - 1213, /* GL_SCISSOR_BOX */ - 1214, /* GL_SCISSOR_TEST */ - 505, /* GL_INDEX_CLEAR_VALUE */ - 510, /* GL_INDEX_WRITEMASK */ + 1125, /* GL_READ_BUFFER */ + 1214, /* GL_SCISSOR_BOX */ + 1215, /* GL_SCISSOR_TEST */ + 506, /* GL_INDEX_CLEAR_VALUE */ + 511, /* GL_INDEX_WRITEMASK */ 153, /* GL_COLOR_CLEAR_VALUE */ 185, /* GL_COLOR_WRITEMASK */ - 507, /* GL_INDEX_MODE */ - 1186, /* GL_RGBA_MODE */ + 508, /* GL_INDEX_MODE */ + 1187, /* GL_RGBA_MODE */ 324, /* GL_DOUBLEBUFFER */ - 1305, /* GL_STEREO */ - 1145, /* GL_RENDER_MODE */ - 947, /* GL_PERSPECTIVE_CORRECTION_HINT */ - 996, /* GL_POINT_SMOOTH_HINT */ - 566, /* GL_LINE_SMOOTH_HINT */ - 1012, /* GL_POLYGON_SMOOTH_HINT */ + 1306, /* GL_STEREO */ + 1146, /* GL_RENDER_MODE */ + 948, /* GL_PERSPECTIVE_CORRECTION_HINT */ + 997, /* GL_POINT_SMOOTH_HINT */ + 567, /* GL_LINE_SMOOTH_HINT */ + 1013, /* GL_POLYGON_SMOOTH_HINT */ 425, /* GL_FOG_HINT */ - 1461, /* GL_TEXTURE_GEN_S */ - 1462, /* GL_TEXTURE_GEN_T */ - 1460, /* GL_TEXTURE_GEN_R */ - 1459, /* GL_TEXTURE_GEN_Q */ - 960, /* GL_PIXEL_MAP_I_TO_I */ - 966, /* GL_PIXEL_MAP_S_TO_S */ - 962, /* GL_PIXEL_MAP_I_TO_R */ - 958, /* GL_PIXEL_MAP_I_TO_G */ - 956, /* GL_PIXEL_MAP_I_TO_B */ - 954, /* GL_PIXEL_MAP_I_TO_A */ - 964, /* GL_PIXEL_MAP_R_TO_R */ - 952, /* GL_PIXEL_MAP_G_TO_G */ - 950, /* GL_PIXEL_MAP_B_TO_B */ - 948, /* GL_PIXEL_MAP_A_TO_A */ - 961, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - 967, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - 963, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - 959, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - 957, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - 955, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - 965, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - 953, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - 951, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - 949, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - 1527, /* GL_UNPACK_SWAP_BYTES */ - 1522, /* GL_UNPACK_LSB_FIRST */ - 1523, /* GL_UNPACK_ROW_LENGTH */ - 1526, /* GL_UNPACK_SKIP_ROWS */ - 1525, /* GL_UNPACK_SKIP_PIXELS */ - 1520, /* GL_UNPACK_ALIGNMENT */ - 935, /* GL_PACK_SWAP_BYTES */ - 930, /* GL_PACK_LSB_FIRST */ - 931, /* GL_PACK_ROW_LENGTH */ - 934, /* GL_PACK_SKIP_ROWS */ - 933, /* GL_PACK_SKIP_PIXELS */ - 927, /* GL_PACK_ALIGNMENT */ - 658, /* GL_MAP_COLOR */ - 659, /* GL_MAP_STENCIL */ - 509, /* GL_INDEX_SHIFT */ - 508, /* GL_INDEX_OFFSET */ - 1134, /* GL_RED_SCALE */ - 1132, /* GL_RED_BIAS */ - 1610, /* GL_ZOOM_X */ - 1611, /* GL_ZOOM_Y */ - 471, /* GL_GREEN_SCALE */ - 469, /* GL_GREEN_BIAS */ + 1462, /* GL_TEXTURE_GEN_S */ + 1463, /* GL_TEXTURE_GEN_T */ + 1461, /* GL_TEXTURE_GEN_R */ + 1460, /* GL_TEXTURE_GEN_Q */ + 961, /* GL_PIXEL_MAP_I_TO_I */ + 967, /* GL_PIXEL_MAP_S_TO_S */ + 963, /* GL_PIXEL_MAP_I_TO_R */ + 959, /* GL_PIXEL_MAP_I_TO_G */ + 957, /* GL_PIXEL_MAP_I_TO_B */ + 955, /* GL_PIXEL_MAP_I_TO_A */ + 965, /* GL_PIXEL_MAP_R_TO_R */ + 953, /* GL_PIXEL_MAP_G_TO_G */ + 951, /* GL_PIXEL_MAP_B_TO_B */ + 949, /* GL_PIXEL_MAP_A_TO_A */ + 962, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + 968, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + 964, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + 960, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + 958, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + 956, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + 966, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + 954, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + 952, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + 950, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + 1528, /* GL_UNPACK_SWAP_BYTES */ + 1523, /* GL_UNPACK_LSB_FIRST */ + 1524, /* GL_UNPACK_ROW_LENGTH */ + 1527, /* GL_UNPACK_SKIP_ROWS */ + 1526, /* GL_UNPACK_SKIP_PIXELS */ + 1521, /* GL_UNPACK_ALIGNMENT */ + 936, /* GL_PACK_SWAP_BYTES */ + 931, /* GL_PACK_LSB_FIRST */ + 932, /* GL_PACK_ROW_LENGTH */ + 935, /* GL_PACK_SKIP_ROWS */ + 934, /* GL_PACK_SKIP_PIXELS */ + 928, /* GL_PACK_ALIGNMENT */ + 659, /* GL_MAP_COLOR */ + 660, /* GL_MAP_STENCIL */ + 510, /* GL_INDEX_SHIFT */ + 509, /* GL_INDEX_OFFSET */ + 1135, /* GL_RED_SCALE */ + 1133, /* GL_RED_BIAS */ + 1611, /* GL_ZOOM_X */ + 1612, /* GL_ZOOM_Y */ + 472, /* GL_GREEN_SCALE */ + 470, /* GL_GREEN_BIAS */ 86, /* GL_BLUE_SCALE */ 84, /* GL_BLUE_BIAS */ 38, /* GL_ALPHA_SCALE */ 36, /* GL_ALPHA_BIAS */ 305, /* GL_DEPTH_SCALE */ 286, /* GL_DEPTH_BIAS */ - 728, /* GL_MAX_EVAL_ORDER */ - 731, /* GL_MAX_LIGHTS */ - 713, /* GL_MAX_CLIP_PLANES */ - 773, /* GL_MAX_TEXTURE_SIZE */ - 737, /* GL_MAX_PIXEL_MAP_TABLE */ - 709, /* GL_MAX_ATTRIB_STACK_DEPTH */ - 734, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - 735, /* GL_MAX_NAME_STACK_DEPTH */ - 763, /* GL_MAX_PROJECTION_STACK_DEPTH */ - 774, /* GL_MAX_TEXTURE_STACK_DEPTH */ - 784, /* GL_MAX_VIEWPORT_DIMS */ - 710, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - 1312, /* GL_SUBPIXEL_BITS */ - 504, /* GL_INDEX_BITS */ - 1133, /* GL_RED_BITS */ - 470, /* GL_GREEN_BITS */ + 729, /* GL_MAX_EVAL_ORDER */ + 732, /* GL_MAX_LIGHTS */ + 714, /* GL_MAX_CLIP_PLANES */ + 774, /* GL_MAX_TEXTURE_SIZE */ + 738, /* GL_MAX_PIXEL_MAP_TABLE */ + 710, /* GL_MAX_ATTRIB_STACK_DEPTH */ + 735, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + 736, /* GL_MAX_NAME_STACK_DEPTH */ + 764, /* GL_MAX_PROJECTION_STACK_DEPTH */ + 775, /* GL_MAX_TEXTURE_STACK_DEPTH */ + 785, /* GL_MAX_VIEWPORT_DIMS */ + 711, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + 1313, /* GL_SUBPIXEL_BITS */ + 505, /* GL_INDEX_BITS */ + 1134, /* GL_RED_BITS */ + 471, /* GL_GREEN_BITS */ 85, /* GL_BLUE_BITS */ 37, /* GL_ALPHA_BITS */ 287, /* GL_DEPTH_BITS */ - 1287, /* GL_STENCIL_BITS */ + 1288, /* GL_STENCIL_BITS */ 14, /* GL_ACCUM_RED_BITS */ 13, /* GL_ACCUM_GREEN_BITS */ 10, /* GL_ACCUM_BLUE_BITS */ 9, /* GL_ACCUM_ALPHA_BITS */ - 850, /* GL_NAME_STACK_DEPTH */ + 851, /* GL_NAME_STACK_DEPTH */ 57, /* GL_AUTO_NORMAL */ - 604, /* GL_MAP1_COLOR_4 */ - 607, /* GL_MAP1_INDEX */ - 608, /* GL_MAP1_NORMAL */ - 609, /* GL_MAP1_TEXTURE_COORD_1 */ - 610, /* GL_MAP1_TEXTURE_COORD_2 */ - 611, /* GL_MAP1_TEXTURE_COORD_3 */ - 612, /* GL_MAP1_TEXTURE_COORD_4 */ - 613, /* GL_MAP1_VERTEX_3 */ - 614, /* GL_MAP1_VERTEX_4 */ - 631, /* GL_MAP2_COLOR_4 */ - 634, /* GL_MAP2_INDEX */ - 635, /* GL_MAP2_NORMAL */ - 636, /* GL_MAP2_TEXTURE_COORD_1 */ - 637, /* GL_MAP2_TEXTURE_COORD_2 */ - 638, /* GL_MAP2_TEXTURE_COORD_3 */ - 639, /* GL_MAP2_TEXTURE_COORD_4 */ - 640, /* GL_MAP2_VERTEX_3 */ - 641, /* GL_MAP2_VERTEX_4 */ - 605, /* GL_MAP1_GRID_DOMAIN */ - 606, /* GL_MAP1_GRID_SEGMENTS */ - 632, /* GL_MAP2_GRID_DOMAIN */ - 633, /* GL_MAP2_GRID_SEGMENTS */ - 1389, /* GL_TEXTURE_1D */ - 1390, /* GL_TEXTURE_2D */ + 605, /* GL_MAP1_COLOR_4 */ + 608, /* GL_MAP1_INDEX */ + 609, /* GL_MAP1_NORMAL */ + 610, /* GL_MAP1_TEXTURE_COORD_1 */ + 611, /* GL_MAP1_TEXTURE_COORD_2 */ + 612, /* GL_MAP1_TEXTURE_COORD_3 */ + 613, /* GL_MAP1_TEXTURE_COORD_4 */ + 614, /* GL_MAP1_VERTEX_3 */ + 615, /* GL_MAP1_VERTEX_4 */ + 632, /* GL_MAP2_COLOR_4 */ + 635, /* GL_MAP2_INDEX */ + 636, /* GL_MAP2_NORMAL */ + 637, /* GL_MAP2_TEXTURE_COORD_1 */ + 638, /* GL_MAP2_TEXTURE_COORD_2 */ + 639, /* GL_MAP2_TEXTURE_COORD_3 */ + 640, /* GL_MAP2_TEXTURE_COORD_4 */ + 641, /* GL_MAP2_VERTEX_3 */ + 642, /* GL_MAP2_VERTEX_4 */ + 606, /* GL_MAP1_GRID_DOMAIN */ + 607, /* GL_MAP1_GRID_SEGMENTS */ + 633, /* GL_MAP2_GRID_DOMAIN */ + 634, /* GL_MAP2_GRID_SEGMENTS */ + 1390, /* GL_TEXTURE_1D */ + 1391, /* GL_TEXTURE_2D */ 392, /* GL_FEEDBACK_BUFFER_POINTER */ 393, /* GL_FEEDBACK_BUFFER_SIZE */ 394, /* GL_FEEDBACK_BUFFER_TYPE */ - 1223, /* GL_SELECTION_BUFFER_POINTER */ - 1224, /* GL_SELECTION_BUFFER_SIZE */ - 1498, /* GL_TEXTURE_WIDTH */ - 1466, /* GL_TEXTURE_HEIGHT */ - 1422, /* GL_TEXTURE_COMPONENTS */ - 1406, /* GL_TEXTURE_BORDER_COLOR */ - 1405, /* GL_TEXTURE_BORDER */ + 1224, /* GL_SELECTION_BUFFER_POINTER */ + 1225, /* GL_SELECTION_BUFFER_SIZE */ + 1499, /* GL_TEXTURE_WIDTH */ + 1467, /* GL_TEXTURE_HEIGHT */ + 1423, /* GL_TEXTURE_COMPONENTS */ + 1407, /* GL_TEXTURE_BORDER_COLOR */ + 1406, /* GL_TEXTURE_BORDER */ 316, /* GL_DONT_CARE */ 390, /* GL_FASTEST */ - 858, /* GL_NICEST */ + 859, /* GL_NICEST */ 43, /* GL_AMBIENT */ 313, /* GL_DIFFUSE */ - 1263, /* GL_SPECULAR */ - 1016, /* GL_POSITION */ - 1266, /* GL_SPOT_DIRECTION */ - 1267, /* GL_SPOT_EXPONENT */ - 1265, /* GL_SPOT_CUTOFF */ + 1264, /* GL_SPECULAR */ + 1017, /* GL_POSITION */ + 1267, /* GL_SPOT_DIRECTION */ + 1268, /* GL_SPOT_EXPONENT */ + 1266, /* GL_SPOT_CUTOFF */ 223, /* GL_CONSTANT_ATTENUATION */ - 556, /* GL_LINEAR_ATTENUATION */ - 1111, /* GL_QUADRATIC_ATTENUATION */ + 557, /* GL_LINEAR_ATTENUATION */ + 1112, /* GL_QUADRATIC_ATTENUATION */ 198, /* GL_COMPILE */ 199, /* GL_COMPILE_AND_EXECUTE */ 101, /* GL_BYTE */ - 1528, /* GL_UNSIGNED_BYTE */ - 1234, /* GL_SHORT */ - 1537, /* GL_UNSIGNED_SHORT */ - 511, /* GL_INT */ - 1531, /* GL_UNSIGNED_INT */ + 1529, /* GL_UNSIGNED_BYTE */ + 1235, /* GL_SHORT */ + 1538, /* GL_UNSIGNED_SHORT */ + 512, /* GL_INT */ + 1532, /* GL_UNSIGNED_INT */ 397, /* GL_FLOAT */ 1, /* GL_2_BYTES */ 5, /* GL_3_BYTES */ @@ -3589,284 +3591,284 @@ static const unsigned reduced_enums[1232] = 47, /* GL_AND_REVERSE */ 246, /* GL_COPY */ 46, /* GL_AND_INVERTED */ - 860, /* GL_NOOP */ - 1606, /* GL_XOR */ - 922, /* GL_OR */ - 861, /* GL_NOR */ + 861, /* GL_NOOP */ + 1607, /* GL_XOR */ + 923, /* GL_OR */ + 862, /* GL_NOR */ 380, /* GL_EQUIV */ - 534, /* GL_INVERT */ - 925, /* GL_OR_REVERSE */ + 535, /* GL_INVERT */ + 926, /* GL_OR_REVERSE */ 247, /* GL_COPY_INVERTED */ - 924, /* GL_OR_INVERTED */ - 851, /* GL_NAND */ - 1228, /* GL_SET */ + 925, /* GL_OR_INVERTED */ + 852, /* GL_NAND */ + 1229, /* GL_SET */ 377, /* GL_EMISSION */ - 1233, /* GL_SHININESS */ + 1234, /* GL_SHININESS */ 44, /* GL_AMBIENT_AND_DIFFUSE */ 155, /* GL_COLOR_INDEXES */ - 801, /* GL_MODELVIEW */ - 1092, /* GL_PROJECTION */ - 1324, /* GL_TEXTURE */ + 802, /* GL_MODELVIEW */ + 1093, /* GL_PROJECTION */ + 1325, /* GL_TEXTURE */ 128, /* GL_COLOR */ 284, /* GL_DEPTH */ - 1285, /* GL_STENCIL */ + 1286, /* GL_STENCIL */ 154, /* GL_COLOR_INDEX */ - 1292, /* GL_STENCIL_INDEX */ + 1293, /* GL_STENCIL_INDEX */ 293, /* GL_DEPTH_COMPONENT */ - 1129, /* GL_RED */ - 468, /* GL_GREEN */ + 1130, /* GL_RED */ + 469, /* GL_GREEN */ 83, /* GL_BLUE */ 27, /* GL_ALPHA */ - 1153, /* GL_RGB */ - 1172, /* GL_RGBA */ - 582, /* GL_LUMINANCE */ - 603, /* GL_LUMINANCE_ALPHA */ + 1154, /* GL_RGB */ + 1173, /* GL_RGBA */ + 583, /* GL_LUMINANCE */ + 604, /* GL_LUMINANCE_ALPHA */ 68, /* GL_BITMAP */ - 973, /* GL_POINT */ - 554, /* GL_LINE */ + 974, /* GL_POINT */ + 555, /* GL_LINE */ 395, /* GL_FILL */ - 1138, /* GL_RENDER */ + 1139, /* GL_RENDER */ 391, /* GL_FEEDBACK */ - 1222, /* GL_SELECT */ + 1223, /* GL_SELECT */ 396, /* GL_FLAT */ - 1238, /* GL_SMOOTH */ - 535, /* GL_KEEP */ - 1147, /* GL_REPLACE */ - 495, /* GL_INCR */ + 1239, /* GL_SMOOTH */ + 536, /* GL_KEEP */ + 1148, /* GL_REPLACE */ + 496, /* GL_INCR */ 281, /* GL_DECR */ - 1550, /* GL_VENDOR */ - 1144, /* GL_RENDERER */ - 1551, /* GL_VERSION */ + 1551, /* GL_VENDOR */ + 1145, /* GL_RENDERER */ + 1552, /* GL_VERSION */ 384, /* GL_EXTENSIONS */ - 1193, /* GL_S */ - 1315, /* GL_T */ - 1121, /* GL_R */ - 1110, /* GL_Q */ - 837, /* GL_MODULATE */ + 1194, /* GL_S */ + 1316, /* GL_T */ + 1122, /* GL_R */ + 1111, /* GL_Q */ + 838, /* GL_MODULATE */ 280, /* GL_DECAL */ - 1456, /* GL_TEXTURE_ENV_MODE */ - 1455, /* GL_TEXTURE_ENV_COLOR */ - 1454, /* GL_TEXTURE_ENV */ + 1457, /* GL_TEXTURE_ENV_MODE */ + 1456, /* GL_TEXTURE_ENV_COLOR */ + 1455, /* GL_TEXTURE_ENV */ 385, /* GL_EYE_LINEAR */ - 884, /* GL_OBJECT_LINEAR */ - 1264, /* GL_SPHERE_MAP */ - 1458, /* GL_TEXTURE_GEN_MODE */ - 886, /* GL_OBJECT_PLANE */ + 885, /* GL_OBJECT_LINEAR */ + 1265, /* GL_SPHERE_MAP */ + 1459, /* GL_TEXTURE_GEN_MODE */ + 887, /* GL_OBJECT_PLANE */ 386, /* GL_EYE_PLANE */ - 852, /* GL_NEAREST */ - 555, /* GL_LINEAR */ - 856, /* GL_NEAREST_MIPMAP_NEAREST */ - 560, /* GL_LINEAR_MIPMAP_NEAREST */ - 855, /* GL_NEAREST_MIPMAP_LINEAR */ - 559, /* GL_LINEAR_MIPMAP_LINEAR */ - 1479, /* GL_TEXTURE_MAG_FILTER */ - 1487, /* GL_TEXTURE_MIN_FILTER */ - 1500, /* GL_TEXTURE_WRAP_S */ - 1501, /* GL_TEXTURE_WRAP_T */ + 853, /* GL_NEAREST */ + 556, /* GL_LINEAR */ + 857, /* GL_NEAREST_MIPMAP_NEAREST */ + 561, /* GL_LINEAR_MIPMAP_NEAREST */ + 856, /* GL_NEAREST_MIPMAP_LINEAR */ + 560, /* GL_LINEAR_MIPMAP_LINEAR */ + 1480, /* GL_TEXTURE_MAG_FILTER */ + 1488, /* GL_TEXTURE_MIN_FILTER */ + 1501, /* GL_TEXTURE_WRAP_S */ + 1502, /* GL_TEXTURE_WRAP_T */ 107, /* GL_CLAMP */ - 1146, /* GL_REPEAT */ - 1010, /* GL_POLYGON_OFFSET_UNITS */ - 1009, /* GL_POLYGON_OFFSET_POINT */ - 1008, /* GL_POLYGON_OFFSET_LINE */ - 1122, /* GL_R3_G3_B2 */ - 1548, /* GL_V2F */ - 1549, /* GL_V3F */ + 1147, /* GL_REPEAT */ + 1011, /* GL_POLYGON_OFFSET_UNITS */ + 1010, /* GL_POLYGON_OFFSET_POINT */ + 1009, /* GL_POLYGON_OFFSET_LINE */ + 1123, /* GL_R3_G3_B2 */ + 1549, /* GL_V2F */ + 1550, /* GL_V3F */ 104, /* GL_C4UB_V2F */ 105, /* GL_C4UB_V3F */ 102, /* GL_C3F_V3F */ - 849, /* GL_N3F_V3F */ + 850, /* GL_N3F_V3F */ 103, /* GL_C4F_N3F_V3F */ - 1320, /* GL_T2F_V3F */ - 1322, /* GL_T4F_V4F */ - 1318, /* GL_T2F_C4UB_V3F */ - 1316, /* GL_T2F_C3F_V3F */ - 1319, /* GL_T2F_N3F_V3F */ - 1317, /* GL_T2F_C4F_N3F_V3F */ - 1321, /* GL_T4F_C4F_N3F_V4F */ + 1321, /* GL_T2F_V3F */ + 1323, /* GL_T4F_V4F */ + 1319, /* GL_T2F_C4UB_V3F */ + 1317, /* GL_T2F_C3F_V3F */ + 1320, /* GL_T2F_N3F_V3F */ + 1318, /* GL_T2F_C4F_N3F_V3F */ + 1322, /* GL_T4F_C4F_N3F_V4F */ 120, /* GL_CLIP_PLANE0 */ 121, /* GL_CLIP_PLANE1 */ 122, /* GL_CLIP_PLANE2 */ 123, /* GL_CLIP_PLANE3 */ 124, /* GL_CLIP_PLANE4 */ 125, /* GL_CLIP_PLANE5 */ - 539, /* GL_LIGHT0 */ - 540, /* GL_LIGHT1 */ - 541, /* GL_LIGHT2 */ - 542, /* GL_LIGHT3 */ - 543, /* GL_LIGHT4 */ - 544, /* GL_LIGHT5 */ - 545, /* GL_LIGHT6 */ - 546, /* GL_LIGHT7 */ - 472, /* GL_HINT_BIT */ + 540, /* GL_LIGHT0 */ + 541, /* GL_LIGHT1 */ + 542, /* GL_LIGHT2 */ + 543, /* GL_LIGHT3 */ + 544, /* GL_LIGHT4 */ + 545, /* GL_LIGHT5 */ + 546, /* GL_LIGHT6 */ + 547, /* GL_LIGHT7 */ + 473, /* GL_HINT_BIT */ 225, /* GL_CONSTANT_COLOR */ - 896, /* GL_ONE_MINUS_CONSTANT_COLOR */ + 897, /* GL_ONE_MINUS_CONSTANT_COLOR */ 220, /* GL_CONSTANT_ALPHA */ - 894, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + 895, /* GL_ONE_MINUS_CONSTANT_ALPHA */ 71, /* GL_BLEND_COLOR */ 456, /* GL_FUNC_ADD */ - 785, /* GL_MIN */ - 707, /* GL_MAX */ + 786, /* GL_MIN */ + 708, /* GL_MAX */ 76, /* GL_BLEND_EQUATION */ 460, /* GL_FUNC_SUBTRACT */ 458, /* GL_FUNC_REVERSE_SUBTRACT */ 228, /* GL_CONVOLUTION_1D */ 229, /* GL_CONVOLUTION_2D */ - 1225, /* GL_SEPARABLE_2D */ + 1226, /* GL_SEPARABLE_2D */ 232, /* GL_CONVOLUTION_BORDER_MODE */ 236, /* GL_CONVOLUTION_FILTER_SCALE */ 234, /* GL_CONVOLUTION_FILTER_BIAS */ - 1130, /* GL_REDUCE */ + 1131, /* GL_REDUCE */ 238, /* GL_CONVOLUTION_FORMAT */ 242, /* GL_CONVOLUTION_WIDTH */ 240, /* GL_CONVOLUTION_HEIGHT */ - 720, /* GL_MAX_CONVOLUTION_WIDTH */ - 718, /* GL_MAX_CONVOLUTION_HEIGHT */ - 1049, /* GL_POST_CONVOLUTION_RED_SCALE */ - 1045, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - 1040, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - 1036, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - 1047, /* GL_POST_CONVOLUTION_RED_BIAS */ - 1043, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - 1038, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - 1034, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - 473, /* GL_HISTOGRAM */ - 1096, /* GL_PROXY_HISTOGRAM */ - 489, /* GL_HISTOGRAM_WIDTH */ - 479, /* GL_HISTOGRAM_FORMAT */ - 485, /* GL_HISTOGRAM_RED_SIZE */ - 481, /* GL_HISTOGRAM_GREEN_SIZE */ - 476, /* GL_HISTOGRAM_BLUE_SIZE */ - 474, /* GL_HISTOGRAM_ALPHA_SIZE */ - 483, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - 487, /* GL_HISTOGRAM_SINK */ - 786, /* GL_MINMAX */ - 788, /* GL_MINMAX_FORMAT */ - 790, /* GL_MINMAX_SINK */ - 1323, /* GL_TABLE_TOO_LARGE_EXT */ - 1530, /* GL_UNSIGNED_BYTE_3_3_2 */ - 1539, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - 1541, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - 1535, /* GL_UNSIGNED_INT_8_8_8_8 */ - 1532, /* GL_UNSIGNED_INT_10_10_10_2 */ - 1007, /* GL_POLYGON_OFFSET_FILL */ - 1006, /* GL_POLYGON_OFFSET_FACTOR */ - 1005, /* GL_POLYGON_OFFSET_BIAS */ - 1150, /* GL_RESCALE_NORMAL */ + 721, /* GL_MAX_CONVOLUTION_WIDTH */ + 719, /* GL_MAX_CONVOLUTION_HEIGHT */ + 1050, /* GL_POST_CONVOLUTION_RED_SCALE */ + 1046, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + 1041, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + 1037, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + 1048, /* GL_POST_CONVOLUTION_RED_BIAS */ + 1044, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + 1039, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + 1035, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + 474, /* GL_HISTOGRAM */ + 1097, /* GL_PROXY_HISTOGRAM */ + 490, /* GL_HISTOGRAM_WIDTH */ + 480, /* GL_HISTOGRAM_FORMAT */ + 486, /* GL_HISTOGRAM_RED_SIZE */ + 482, /* GL_HISTOGRAM_GREEN_SIZE */ + 477, /* GL_HISTOGRAM_BLUE_SIZE */ + 475, /* GL_HISTOGRAM_ALPHA_SIZE */ + 484, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + 488, /* GL_HISTOGRAM_SINK */ + 787, /* GL_MINMAX */ + 789, /* GL_MINMAX_FORMAT */ + 791, /* GL_MINMAX_SINK */ + 1324, /* GL_TABLE_TOO_LARGE_EXT */ + 1531, /* GL_UNSIGNED_BYTE_3_3_2 */ + 1540, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + 1542, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + 1536, /* GL_UNSIGNED_INT_8_8_8_8 */ + 1533, /* GL_UNSIGNED_INT_10_10_10_2 */ + 1008, /* GL_POLYGON_OFFSET_FILL */ + 1007, /* GL_POLYGON_OFFSET_FACTOR */ + 1006, /* GL_POLYGON_OFFSET_BIAS */ + 1151, /* GL_RESCALE_NORMAL */ 32, /* GL_ALPHA4 */ 34, /* GL_ALPHA8 */ 28, /* GL_ALPHA12 */ 30, /* GL_ALPHA16 */ - 593, /* GL_LUMINANCE4 */ - 599, /* GL_LUMINANCE8 */ - 583, /* GL_LUMINANCE12 */ - 589, /* GL_LUMINANCE16 */ - 594, /* GL_LUMINANCE4_ALPHA4 */ - 597, /* GL_LUMINANCE6_ALPHA2 */ - 600, /* GL_LUMINANCE8_ALPHA8 */ - 586, /* GL_LUMINANCE12_ALPHA4 */ - 584, /* GL_LUMINANCE12_ALPHA12 */ - 590, /* GL_LUMINANCE16_ALPHA16 */ - 512, /* GL_INTENSITY */ - 517, /* GL_INTENSITY4 */ - 519, /* GL_INTENSITY8 */ - 513, /* GL_INTENSITY12 */ - 515, /* GL_INTENSITY16 */ - 1162, /* GL_RGB2_EXT */ - 1163, /* GL_RGB4 */ - 1166, /* GL_RGB5 */ - 1170, /* GL_RGB8 */ - 1154, /* GL_RGB10 */ - 1158, /* GL_RGB12 */ - 1160, /* GL_RGB16 */ - 1177, /* GL_RGBA2 */ - 1179, /* GL_RGBA4 */ - 1167, /* GL_RGB5_A1 */ - 1183, /* GL_RGBA8 */ - 1155, /* GL_RGB10_A2 */ - 1173, /* GL_RGBA12 */ - 1175, /* GL_RGBA16 */ - 1492, /* GL_TEXTURE_RED_SIZE */ - 1464, /* GL_TEXTURE_GREEN_SIZE */ - 1403, /* GL_TEXTURE_BLUE_SIZE */ - 1392, /* GL_TEXTURE_ALPHA_SIZE */ - 1477, /* GL_TEXTURE_LUMINANCE_SIZE */ - 1468, /* GL_TEXTURE_INTENSITY_SIZE */ - 1148, /* GL_REPLACE_EXT */ - 1100, /* GL_PROXY_TEXTURE_1D */ - 1102, /* GL_PROXY_TEXTURE_2D */ - 1496, /* GL_TEXTURE_TOO_LARGE_EXT */ - 1489, /* GL_TEXTURE_PRIORITY */ - 1494, /* GL_TEXTURE_RESIDENT */ - 1395, /* GL_TEXTURE_BINDING_1D */ - 1396, /* GL_TEXTURE_BINDING_2D */ - 1397, /* GL_TEXTURE_BINDING_3D */ - 932, /* GL_PACK_SKIP_IMAGES */ - 928, /* GL_PACK_IMAGE_HEIGHT */ - 1524, /* GL_UNPACK_SKIP_IMAGES */ - 1521, /* GL_UNPACK_IMAGE_HEIGHT */ - 1391, /* GL_TEXTURE_3D */ - 1104, /* GL_PROXY_TEXTURE_3D */ - 1451, /* GL_TEXTURE_DEPTH */ - 1499, /* GL_TEXTURE_WRAP_R */ - 708, /* GL_MAX_3D_TEXTURE_SIZE */ - 1552, /* GL_VERTEX_ARRAY */ - 863, /* GL_NORMAL_ARRAY */ + 594, /* GL_LUMINANCE4 */ + 600, /* GL_LUMINANCE8 */ + 584, /* GL_LUMINANCE12 */ + 590, /* GL_LUMINANCE16 */ + 595, /* GL_LUMINANCE4_ALPHA4 */ + 598, /* GL_LUMINANCE6_ALPHA2 */ + 601, /* GL_LUMINANCE8_ALPHA8 */ + 587, /* GL_LUMINANCE12_ALPHA4 */ + 585, /* GL_LUMINANCE12_ALPHA12 */ + 591, /* GL_LUMINANCE16_ALPHA16 */ + 513, /* GL_INTENSITY */ + 518, /* GL_INTENSITY4 */ + 520, /* GL_INTENSITY8 */ + 514, /* GL_INTENSITY12 */ + 516, /* GL_INTENSITY16 */ + 1163, /* GL_RGB2_EXT */ + 1164, /* GL_RGB4 */ + 1167, /* GL_RGB5 */ + 1171, /* GL_RGB8 */ + 1155, /* GL_RGB10 */ + 1159, /* GL_RGB12 */ + 1161, /* GL_RGB16 */ + 1178, /* GL_RGBA2 */ + 1180, /* GL_RGBA4 */ + 1168, /* GL_RGB5_A1 */ + 1184, /* GL_RGBA8 */ + 1156, /* GL_RGB10_A2 */ + 1174, /* GL_RGBA12 */ + 1176, /* GL_RGBA16 */ + 1493, /* GL_TEXTURE_RED_SIZE */ + 1465, /* GL_TEXTURE_GREEN_SIZE */ + 1404, /* GL_TEXTURE_BLUE_SIZE */ + 1393, /* GL_TEXTURE_ALPHA_SIZE */ + 1478, /* GL_TEXTURE_LUMINANCE_SIZE */ + 1469, /* GL_TEXTURE_INTENSITY_SIZE */ + 1149, /* GL_REPLACE_EXT */ + 1101, /* GL_PROXY_TEXTURE_1D */ + 1103, /* GL_PROXY_TEXTURE_2D */ + 1497, /* GL_TEXTURE_TOO_LARGE_EXT */ + 1490, /* GL_TEXTURE_PRIORITY */ + 1495, /* GL_TEXTURE_RESIDENT */ + 1396, /* GL_TEXTURE_BINDING_1D */ + 1397, /* GL_TEXTURE_BINDING_2D */ + 1398, /* GL_TEXTURE_BINDING_3D */ + 933, /* GL_PACK_SKIP_IMAGES */ + 929, /* GL_PACK_IMAGE_HEIGHT */ + 1525, /* GL_UNPACK_SKIP_IMAGES */ + 1522, /* GL_UNPACK_IMAGE_HEIGHT */ + 1392, /* GL_TEXTURE_3D */ + 1105, /* GL_PROXY_TEXTURE_3D */ + 1452, /* GL_TEXTURE_DEPTH */ + 1500, /* GL_TEXTURE_WRAP_R */ + 709, /* GL_MAX_3D_TEXTURE_SIZE */ + 1553, /* GL_VERTEX_ARRAY */ + 864, /* GL_NORMAL_ARRAY */ 129, /* GL_COLOR_ARRAY */ - 498, /* GL_INDEX_ARRAY */ - 1430, /* GL_TEXTURE_COORD_ARRAY */ + 499, /* GL_INDEX_ARRAY */ + 1431, /* GL_TEXTURE_COORD_ARRAY */ 368, /* GL_EDGE_FLAG_ARRAY */ - 1556, /* GL_VERTEX_ARRAY_SIZE */ - 1558, /* GL_VERTEX_ARRAY_TYPE */ - 1557, /* GL_VERTEX_ARRAY_STRIDE */ - 868, /* GL_NORMAL_ARRAY_TYPE */ - 867, /* GL_NORMAL_ARRAY_STRIDE */ + 1557, /* GL_VERTEX_ARRAY_SIZE */ + 1559, /* GL_VERTEX_ARRAY_TYPE */ + 1558, /* GL_VERTEX_ARRAY_STRIDE */ + 869, /* GL_NORMAL_ARRAY_TYPE */ + 868, /* GL_NORMAL_ARRAY_STRIDE */ 133, /* GL_COLOR_ARRAY_SIZE */ 135, /* GL_COLOR_ARRAY_TYPE */ 134, /* GL_COLOR_ARRAY_STRIDE */ - 503, /* GL_INDEX_ARRAY_TYPE */ - 502, /* GL_INDEX_ARRAY_STRIDE */ - 1434, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - 1436, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - 1435, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + 504, /* GL_INDEX_ARRAY_TYPE */ + 503, /* GL_INDEX_ARRAY_STRIDE */ + 1435, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + 1437, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + 1436, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ 372, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - 1555, /* GL_VERTEX_ARRAY_POINTER */ - 866, /* GL_NORMAL_ARRAY_POINTER */ + 1556, /* GL_VERTEX_ARRAY_POINTER */ + 867, /* GL_NORMAL_ARRAY_POINTER */ 132, /* GL_COLOR_ARRAY_POINTER */ - 501, /* GL_INDEX_ARRAY_POINTER */ - 1433, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + 502, /* GL_INDEX_ARRAY_POINTER */ + 1434, /* GL_TEXTURE_COORD_ARRAY_POINTER */ 371, /* GL_EDGE_FLAG_ARRAY_POINTER */ - 842, /* GL_MULTISAMPLE */ - 1199, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - 1201, /* GL_SAMPLE_ALPHA_TO_ONE */ - 1206, /* GL_SAMPLE_COVERAGE */ - 1203, /* GL_SAMPLE_BUFFERS */ - 1194, /* GL_SAMPLES */ - 1210, /* GL_SAMPLE_COVERAGE_VALUE */ - 1208, /* GL_SAMPLE_COVERAGE_INVERT */ + 843, /* GL_MULTISAMPLE */ + 1200, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + 1202, /* GL_SAMPLE_ALPHA_TO_ONE */ + 1207, /* GL_SAMPLE_COVERAGE */ + 1204, /* GL_SAMPLE_BUFFERS */ + 1195, /* GL_SAMPLES */ + 1211, /* GL_SAMPLE_COVERAGE_VALUE */ + 1209, /* GL_SAMPLE_COVERAGE_INVERT */ 160, /* GL_COLOR_MATRIX */ 162, /* GL_COLOR_MATRIX_STACK_DEPTH */ - 715, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - 1032, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - 1028, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - 1023, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - 1019, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - 1030, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - 1026, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - 1021, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - 1017, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - 1413, /* GL_TEXTURE_COLOR_TABLE_SGI */ - 1105, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - 1415, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + 716, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + 1033, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + 1029, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + 1024, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + 1020, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + 1031, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + 1027, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + 1022, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + 1018, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + 1414, /* GL_TEXTURE_COLOR_TABLE_SGI */ + 1106, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + 1416, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ 75, /* GL_BLEND_DST_RGB */ 82, /* GL_BLEND_SRC_RGB */ 74, /* GL_BLEND_DST_ALPHA */ 81, /* GL_BLEND_SRC_ALPHA */ 166, /* GL_COLOR_TABLE */ - 1042, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - 1025, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - 1095, /* GL_PROXY_COLOR_TABLE */ - 1099, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - 1098, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + 1043, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + 1026, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + 1096, /* GL_PROXY_COLOR_TABLE */ + 1100, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + 1099, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ 182, /* GL_COLOR_TABLE_SCALE */ 169, /* GL_COLOR_TABLE_BIAS */ 172, /* GL_COLOR_TABLE_FORMAT */ @@ -3879,86 +3881,86 @@ static const unsigned reduced_enums[1232] = 176, /* GL_COLOR_TABLE_INTENSITY_SIZE */ 66, /* GL_BGR */ 67, /* GL_BGRA */ - 727, /* GL_MAX_ELEMENTS_VERTICES */ - 726, /* GL_MAX_ELEMENTS_INDICES */ - 1467, /* GL_TEXTURE_INDEX_SIZE_EXT */ + 728, /* GL_MAX_ELEMENTS_VERTICES */ + 727, /* GL_MAX_ELEMENTS_INDICES */ + 1468, /* GL_TEXTURE_INDEX_SIZE_EXT */ 126, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - 990, /* GL_POINT_SIZE_MIN */ - 986, /* GL_POINT_SIZE_MAX */ - 980, /* GL_POINT_FADE_THRESHOLD_SIZE */ - 976, /* GL_POINT_DISTANCE_ATTENUATION */ + 991, /* GL_POINT_SIZE_MIN */ + 987, /* GL_POINT_SIZE_MAX */ + 981, /* GL_POINT_FADE_THRESHOLD_SIZE */ + 977, /* GL_POINT_DISTANCE_ATTENUATION */ 108, /* GL_CLAMP_TO_BORDER */ 111, /* GL_CLAMP_TO_EDGE */ - 1488, /* GL_TEXTURE_MIN_LOD */ - 1486, /* GL_TEXTURE_MAX_LOD */ - 1394, /* GL_TEXTURE_BASE_LEVEL */ - 1485, /* GL_TEXTURE_MAX_LEVEL */ - 492, /* GL_IGNORE_BORDER_HP */ + 1489, /* GL_TEXTURE_MIN_LOD */ + 1487, /* GL_TEXTURE_MAX_LOD */ + 1395, /* GL_TEXTURE_BASE_LEVEL */ + 1486, /* GL_TEXTURE_MAX_LEVEL */ + 493, /* GL_IGNORE_BORDER_HP */ 224, /* GL_CONSTANT_BORDER_HP */ - 1149, /* GL_REPLICATE_BORDER_HP */ + 1150, /* GL_REPLICATE_BORDER_HP */ 230, /* GL_CONVOLUTION_BORDER_COLOR */ - 891, /* GL_OCCLUSION_TEST_HP */ - 892, /* GL_OCCLUSION_TEST_RESULT_HP */ - 557, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - 1407, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - 1409, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - 1411, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - 1412, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1410, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - 1408, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - 711, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - 712, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1052, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - 1054, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - 1051, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - 1053, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - 1475, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - 1476, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - 1474, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + 892, /* GL_OCCLUSION_TEST_HP */ + 893, /* GL_OCCLUSION_TEST_RESULT_HP */ + 558, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + 1408, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + 1410, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + 1412, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + 1413, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1411, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + 1409, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + 712, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + 713, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1053, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + 1055, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + 1052, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + 1054, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + 1476, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + 1477, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + 1475, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ 462, /* GL_GENERATE_MIPMAP */ 463, /* GL_GENERATE_MIPMAP_HINT */ 428, /* GL_FOG_OFFSET_SGIX */ 429, /* GL_FOG_OFFSET_VALUE_SGIX */ - 1421, /* GL_TEXTURE_COMPARE_SGIX */ - 1420, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - 1471, /* GL_TEXTURE_LEQUAL_R_SGIX */ - 1463, /* GL_TEXTURE_GEQUAL_R_SGIX */ + 1422, /* GL_TEXTURE_COMPARE_SGIX */ + 1421, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + 1472, /* GL_TEXTURE_LEQUAL_R_SGIX */ + 1464, /* GL_TEXTURE_GEQUAL_R_SGIX */ 294, /* GL_DEPTH_COMPONENT16 */ 297, /* GL_DEPTH_COMPONENT24 */ 300, /* GL_DEPTH_COMPONENT32 */ 251, /* GL_CULL_VERTEX_EXT */ 253, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ 252, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - 1603, /* GL_WRAP_BORDER_SUN */ - 1414, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - 550, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - 1235, /* GL_SINGLE_COLOR */ - 1226, /* GL_SEPARATE_SPECULAR_COLOR */ - 1232, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - 1529, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - 1542, /* GL_UNSIGNED_SHORT_5_6_5 */ - 1543, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - 1540, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - 1538, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - 1536, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - 1534, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - 1483, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - 1484, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - 1482, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - 793, /* GL_MIRRORED_REPEAT */ - 1188, /* GL_RGB_S3TC */ - 1165, /* GL_RGB4_S3TC */ - 1187, /* GL_RGBA_S3TC */ - 1182, /* GL_RGBA4_S3TC */ - 1185, /* GL_RGBA_DXT5_S3TC */ - 1180, /* GL_RGBA4_DXT5_S3TC */ + 1604, /* GL_WRAP_BORDER_SUN */ + 1415, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + 551, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + 1236, /* GL_SINGLE_COLOR */ + 1227, /* GL_SEPARATE_SPECULAR_COLOR */ + 1233, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + 1530, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + 1543, /* GL_UNSIGNED_SHORT_5_6_5 */ + 1544, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + 1541, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + 1539, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + 1537, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + 1535, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + 1484, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + 1485, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + 1483, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + 794, /* GL_MIRRORED_REPEAT */ + 1189, /* GL_RGB_S3TC */ + 1166, /* GL_RGB4_S3TC */ + 1188, /* GL_RGBA_S3TC */ + 1183, /* GL_RGBA4_S3TC */ + 1186, /* GL_RGBA_DXT5_S3TC */ + 1181, /* GL_RGBA4_DXT5_S3TC */ 217, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ 212, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ 213, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ 214, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - 854, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - 853, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - 558, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + 855, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + 854, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + 559, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ 415, /* GL_FOG_COORDINATE_SOURCE */ 407, /* GL_FOG_COORD */ 431, /* GL_FRAGMENT_DEPTH */ @@ -3969,286 +3971,286 @@ static const unsigned reduced_enums[1232] = 409, /* GL_FOG_COORDINATE_ARRAY */ 164, /* GL_COLOR_SUM */ 275, /* GL_CURRENT_SECONDARY_COLOR */ - 1219, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - 1221, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - 1220, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - 1218, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - 1215, /* GL_SECONDARY_COLOR_ARRAY */ + 1220, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + 1222, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + 1221, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + 1219, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + 1216, /* GL_SECONDARY_COLOR_ARRAY */ 24, /* GL_ALIASED_POINT_SIZE_RANGE */ 23, /* GL_ALIASED_LINE_WIDTH_RANGE */ - 1325, /* GL_TEXTURE0 */ - 1327, /* GL_TEXTURE1 */ - 1349, /* GL_TEXTURE2 */ - 1371, /* GL_TEXTURE3 */ - 1377, /* GL_TEXTURE4 */ - 1379, /* GL_TEXTURE5 */ - 1381, /* GL_TEXTURE6 */ - 1383, /* GL_TEXTURE7 */ - 1385, /* GL_TEXTURE8 */ - 1387, /* GL_TEXTURE9 */ - 1328, /* GL_TEXTURE10 */ - 1330, /* GL_TEXTURE11 */ - 1332, /* GL_TEXTURE12 */ - 1334, /* GL_TEXTURE13 */ - 1336, /* GL_TEXTURE14 */ - 1338, /* GL_TEXTURE15 */ - 1340, /* GL_TEXTURE16 */ - 1342, /* GL_TEXTURE17 */ - 1344, /* GL_TEXTURE18 */ - 1346, /* GL_TEXTURE19 */ - 1350, /* GL_TEXTURE20 */ - 1352, /* GL_TEXTURE21 */ - 1354, /* GL_TEXTURE22 */ - 1356, /* GL_TEXTURE23 */ - 1358, /* GL_TEXTURE24 */ - 1360, /* GL_TEXTURE25 */ - 1362, /* GL_TEXTURE26 */ - 1364, /* GL_TEXTURE27 */ - 1366, /* GL_TEXTURE28 */ - 1368, /* GL_TEXTURE29 */ - 1372, /* GL_TEXTURE30 */ - 1374, /* GL_TEXTURE31 */ + 1326, /* GL_TEXTURE0 */ + 1328, /* GL_TEXTURE1 */ + 1350, /* GL_TEXTURE2 */ + 1372, /* GL_TEXTURE3 */ + 1378, /* GL_TEXTURE4 */ + 1380, /* GL_TEXTURE5 */ + 1382, /* GL_TEXTURE6 */ + 1384, /* GL_TEXTURE7 */ + 1386, /* GL_TEXTURE8 */ + 1388, /* GL_TEXTURE9 */ + 1329, /* GL_TEXTURE10 */ + 1331, /* GL_TEXTURE11 */ + 1333, /* GL_TEXTURE12 */ + 1335, /* GL_TEXTURE13 */ + 1337, /* GL_TEXTURE14 */ + 1339, /* GL_TEXTURE15 */ + 1341, /* GL_TEXTURE16 */ + 1343, /* GL_TEXTURE17 */ + 1345, /* GL_TEXTURE18 */ + 1347, /* GL_TEXTURE19 */ + 1351, /* GL_TEXTURE20 */ + 1353, /* GL_TEXTURE21 */ + 1355, /* GL_TEXTURE22 */ + 1357, /* GL_TEXTURE23 */ + 1359, /* GL_TEXTURE24 */ + 1361, /* GL_TEXTURE25 */ + 1363, /* GL_TEXTURE26 */ + 1365, /* GL_TEXTURE27 */ + 1367, /* GL_TEXTURE28 */ + 1369, /* GL_TEXTURE29 */ + 1373, /* GL_TEXTURE30 */ + 1375, /* GL_TEXTURE31 */ 16, /* GL_ACTIVE_TEXTURE */ 114, /* GL_CLIENT_ACTIVE_TEXTURE */ - 775, /* GL_MAX_TEXTURE_UNITS */ - 1508, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - 1511, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - 1513, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - 1505, /* GL_TRANSPOSE_COLOR_MATRIX */ - 1313, /* GL_SUBTRACT */ - 766, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + 776, /* GL_MAX_TEXTURE_UNITS */ + 1509, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + 1512, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + 1514, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + 1506, /* GL_TRANSPOSE_COLOR_MATRIX */ + 1314, /* GL_SUBTRACT */ + 767, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ 200, /* GL_COMPRESSED_ALPHA */ 204, /* GL_COMPRESSED_LUMINANCE */ 205, /* GL_COMPRESSED_LUMINANCE_ALPHA */ 202, /* GL_COMPRESSED_INTENSITY */ 208, /* GL_COMPRESSED_RGB */ 209, /* GL_COMPRESSED_RGBA */ - 1428, /* GL_TEXTURE_COMPRESSION_HINT */ - 1490, /* GL_TEXTURE_RECTANGLE_ARB */ - 1400, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - 1108, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - 764, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + 1429, /* GL_TEXTURE_COMPRESSION_HINT */ + 1491, /* GL_TEXTURE_RECTANGLE_ARB */ + 1401, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + 1109, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + 765, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ 306, /* GL_DEPTH_STENCIL_NV */ - 1533, /* GL_UNSIGNED_INT_24_8_NV */ - 771, /* GL_MAX_TEXTURE_LOD_BIAS */ - 1481, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - 772, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - 1457, /* GL_TEXTURE_FILTER_CONTROL */ - 1472, /* GL_TEXTURE_LOD_BIAS */ + 1534, /* GL_UNSIGNED_INT_24_8_NV */ + 772, /* GL_MAX_TEXTURE_LOD_BIAS */ + 1482, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + 773, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + 1458, /* GL_TEXTURE_FILTER_CONTROL */ + 1473, /* GL_TEXTURE_LOD_BIAS */ 187, /* GL_COMBINE4 */ - 767, /* GL_MAX_SHININESS_NV */ - 768, /* GL_MAX_SPOT_EXPONENT_NV */ - 496, /* GL_INCR_WRAP */ + 768, /* GL_MAX_SHININESS_NV */ + 769, /* GL_MAX_SPOT_EXPONENT_NV */ + 497, /* GL_INCR_WRAP */ 282, /* GL_DECR_WRAP */ - 813, /* GL_MODELVIEW1_ARB */ - 869, /* GL_NORMAL_MAP */ - 1135, /* GL_REFLECTION_MAP */ - 1437, /* GL_TEXTURE_CUBE_MAP */ - 1398, /* GL_TEXTURE_BINDING_CUBE_MAP */ - 1445, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - 1439, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - 1447, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - 1441, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - 1449, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - 1443, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - 1106, /* GL_PROXY_TEXTURE_CUBE_MAP */ - 722, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - 848, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + 814, /* GL_MODELVIEW1_ARB */ + 870, /* GL_NORMAL_MAP */ + 1136, /* GL_REFLECTION_MAP */ + 1438, /* GL_TEXTURE_CUBE_MAP */ + 1399, /* GL_TEXTURE_BINDING_CUBE_MAP */ + 1446, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + 1440, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + 1448, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + 1442, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + 1450, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + 1444, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + 1107, /* GL_PROXY_TEXTURE_CUBE_MAP */ + 723, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + 849, /* GL_MULTISAMPLE_FILTER_HINT_NV */ 423, /* GL_FOG_DISTANCE_MODE_NV */ 388, /* GL_EYE_RADIAL_NV */ 387, /* GL_EYE_PLANE_ABSOLUTE_NV */ 186, /* GL_COMBINE */ 193, /* GL_COMBINE_RGB */ 188, /* GL_COMBINE_ALPHA */ - 1189, /* GL_RGB_SCALE */ + 1190, /* GL_RGB_SCALE */ 20, /* GL_ADD_SIGNED */ - 522, /* GL_INTERPOLATE */ + 523, /* GL_INTERPOLATE */ 219, /* GL_CONSTANT */ - 1058, /* GL_PRIMARY_COLOR */ - 1055, /* GL_PREVIOUS */ - 1246, /* GL_SOURCE0_RGB */ - 1252, /* GL_SOURCE1_RGB */ - 1258, /* GL_SOURCE2_RGB */ - 1262, /* GL_SOURCE3_RGB_NV */ - 1243, /* GL_SOURCE0_ALPHA */ - 1249, /* GL_SOURCE1_ALPHA */ - 1255, /* GL_SOURCE2_ALPHA */ - 1261, /* GL_SOURCE3_ALPHA_NV */ - 905, /* GL_OPERAND0_RGB */ - 911, /* GL_OPERAND1_RGB */ - 917, /* GL_OPERAND2_RGB */ - 921, /* GL_OPERAND3_RGB_NV */ - 902, /* GL_OPERAND0_ALPHA */ - 908, /* GL_OPERAND1_ALPHA */ - 914, /* GL_OPERAND2_ALPHA */ - 920, /* GL_OPERAND3_ALPHA_NV */ - 1607, /* GL_YCBCR_422_APPLE */ - 1544, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - 1546, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - 1237, /* GL_SLICE_ACCUM_SUN */ - 1113, /* GL_QUAD_MESH_SUN */ - 1517, /* GL_TRIANGLE_MESH_SUN */ - 1584, /* GL_VERTEX_PROGRAM_ARB */ - 1592, /* GL_VERTEX_STATE_PROGRAM_NV */ - 1577, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ - 1580, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ - 1581, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ - 1582, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ + 1059, /* GL_PRIMARY_COLOR */ + 1056, /* GL_PREVIOUS */ + 1247, /* GL_SOURCE0_RGB */ + 1253, /* GL_SOURCE1_RGB */ + 1259, /* GL_SOURCE2_RGB */ + 1263, /* GL_SOURCE3_RGB_NV */ + 1244, /* GL_SOURCE0_ALPHA */ + 1250, /* GL_SOURCE1_ALPHA */ + 1256, /* GL_SOURCE2_ALPHA */ + 1262, /* GL_SOURCE3_ALPHA_NV */ + 906, /* GL_OPERAND0_RGB */ + 912, /* GL_OPERAND1_RGB */ + 918, /* GL_OPERAND2_RGB */ + 922, /* GL_OPERAND3_RGB_NV */ + 903, /* GL_OPERAND0_ALPHA */ + 909, /* GL_OPERAND1_ALPHA */ + 915, /* GL_OPERAND2_ALPHA */ + 921, /* GL_OPERAND3_ALPHA_NV */ + 1608, /* GL_YCBCR_422_APPLE */ + 1545, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + 1547, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + 1238, /* GL_SLICE_ACCUM_SUN */ + 1114, /* GL_QUAD_MESH_SUN */ + 1518, /* GL_TRIANGLE_MESH_SUN */ + 1585, /* GL_VERTEX_PROGRAM_ARB */ + 1593, /* GL_VERTEX_STATE_PROGRAM_NV */ + 1578, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ + 1581, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ + 1582, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ + 1583, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ 277, /* GL_CURRENT_VERTEX_ATTRIB_ARB */ - 1071, /* GL_PROGRAM_LENGTH_ARB */ - 1085, /* GL_PROGRAM_STRING_ARB */ - 835, /* GL_MODELVIEW_PROJECTION_NV */ - 491, /* GL_IDENTITY_NV */ - 532, /* GL_INVERSE_NV */ - 1510, /* GL_TRANSPOSE_NV */ - 533, /* GL_INVERSE_TRANSPOSE_NV */ - 750, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - 749, /* GL_MAX_PROGRAM_MATRICES_ARB */ - 661, /* GL_MATRIX0_NV */ - 673, /* GL_MATRIX1_NV */ - 685, /* GL_MATRIX2_NV */ - 689, /* GL_MATRIX3_NV */ - 691, /* GL_MATRIX4_NV */ - 693, /* GL_MATRIX5_NV */ - 695, /* GL_MATRIX6_NV */ - 697, /* GL_MATRIX7_NV */ + 1072, /* GL_PROGRAM_LENGTH_ARB */ + 1086, /* GL_PROGRAM_STRING_ARB */ + 836, /* GL_MODELVIEW_PROJECTION_NV */ + 492, /* GL_IDENTITY_NV */ + 533, /* GL_INVERSE_NV */ + 1511, /* GL_TRANSPOSE_NV */ + 534, /* GL_INVERSE_TRANSPOSE_NV */ + 751, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + 750, /* GL_MAX_PROGRAM_MATRICES_ARB */ + 662, /* GL_MATRIX0_NV */ + 674, /* GL_MATRIX1_NV */ + 686, /* GL_MATRIX2_NV */ + 690, /* GL_MATRIX3_NV */ + 692, /* GL_MATRIX4_NV */ + 694, /* GL_MATRIX5_NV */ + 696, /* GL_MATRIX6_NV */ + 698, /* GL_MATRIX7_NV */ 263, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ 260, /* GL_CURRENT_MATRIX_ARB */ - 1587, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ - 1589, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ - 1083, /* GL_PROGRAM_PARAMETER_NV */ - 1579, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ - 1087, /* GL_PROGRAM_TARGET_NV */ - 1084, /* GL_PROGRAM_RESIDENT_NV */ - 1502, /* GL_TRACK_MATRIX_NV */ - 1503, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - 1585, /* GL_VERTEX_PROGRAM_BINDING_NV */ - 1065, /* GL_PROGRAM_ERROR_POSITION_ARB */ + 1588, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ + 1590, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ + 1084, /* GL_PROGRAM_PARAMETER_NV */ + 1580, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ + 1088, /* GL_PROGRAM_TARGET_NV */ + 1085, /* GL_PROGRAM_RESIDENT_NV */ + 1503, /* GL_TRACK_MATRIX_NV */ + 1504, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + 1586, /* GL_VERTEX_PROGRAM_BINDING_NV */ + 1066, /* GL_PROGRAM_ERROR_POSITION_ARB */ 291, /* GL_DEPTH_CLAMP_NV */ - 1559, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - 1566, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - 1567, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - 1568, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - 1569, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - 1570, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - 1571, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - 1572, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - 1573, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - 1574, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - 1560, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - 1561, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - 1562, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - 1563, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - 1564, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - 1565, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - 615, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - 622, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - 623, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - 624, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - 625, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - 626, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - 627, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - 628, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - 629, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - 630, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - 616, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - 617, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - 618, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - 619, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - 620, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - 621, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - 642, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - 649, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - 650, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - 651, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - 652, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - 653, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - 654, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - 1064, /* GL_PROGRAM_BINDING_ARB */ - 656, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - 657, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - 643, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - 644, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - 645, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - 646, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - 647, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - 648, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - 1426, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - 1423, /* GL_TEXTURE_COMPRESSED */ - 874, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + 1560, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + 1567, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + 1568, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + 1569, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + 1570, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + 1571, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + 1572, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + 1573, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + 1574, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + 1575, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + 1561, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + 1562, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + 1563, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + 1564, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + 1565, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + 1566, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + 616, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + 623, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + 624, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + 625, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + 626, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + 627, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + 628, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + 629, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + 630, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + 631, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + 617, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + 618, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + 619, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + 620, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + 621, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + 622, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + 643, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + 650, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + 651, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + 652, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + 653, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + 654, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + 655, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + 1065, /* GL_PROGRAM_BINDING_ARB */ + 657, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + 658, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + 644, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + 645, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + 646, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + 647, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + 648, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + 649, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + 1427, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + 1424, /* GL_TEXTURE_COMPRESSED */ + 875, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ 218, /* GL_COMPRESSED_TEXTURE_FORMATS */ - 783, /* GL_MAX_VERTEX_UNITS_ARB */ + 784, /* GL_MAX_VERTEX_UNITS_ARB */ 18, /* GL_ACTIVE_VERTEX_UNITS_ARB */ - 1602, /* GL_WEIGHT_SUM_UNITY_ARB */ - 1583, /* GL_VERTEX_BLEND_ARB */ + 1603, /* GL_WEIGHT_SUM_UNITY_ARB */ + 1584, /* GL_VERTEX_BLEND_ARB */ 278, /* GL_CURRENT_WEIGHT_ARB */ - 1601, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - 1600, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - 1599, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - 1598, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - 1595, /* GL_WEIGHT_ARRAY_ARB */ + 1602, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + 1601, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + 1600, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + 1599, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + 1596, /* GL_WEIGHT_ARRAY_ARB */ 317, /* GL_DOT3_RGB */ 318, /* GL_DOT3_RGBA */ 216, /* GL_COMPRESSED_RGB_FXT1_3DFX */ 211, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - 843, /* GL_MULTISAMPLE_3DFX */ - 1204, /* GL_SAMPLE_BUFFERS_3DFX */ - 1195, /* GL_SAMPLES_3DFX */ - 824, /* GL_MODELVIEW2_ARB */ - 827, /* GL_MODELVIEW3_ARB */ - 828, /* GL_MODELVIEW4_ARB */ - 829, /* GL_MODELVIEW5_ARB */ - 830, /* GL_MODELVIEW6_ARB */ - 831, /* GL_MODELVIEW7_ARB */ - 832, /* GL_MODELVIEW8_ARB */ - 833, /* GL_MODELVIEW9_ARB */ - 803, /* GL_MODELVIEW10_ARB */ - 804, /* GL_MODELVIEW11_ARB */ - 805, /* GL_MODELVIEW12_ARB */ - 806, /* GL_MODELVIEW13_ARB */ - 807, /* GL_MODELVIEW14_ARB */ - 808, /* GL_MODELVIEW15_ARB */ - 809, /* GL_MODELVIEW16_ARB */ - 810, /* GL_MODELVIEW17_ARB */ - 811, /* GL_MODELVIEW18_ARB */ - 812, /* GL_MODELVIEW19_ARB */ - 814, /* GL_MODELVIEW20_ARB */ - 815, /* GL_MODELVIEW21_ARB */ - 816, /* GL_MODELVIEW22_ARB */ - 817, /* GL_MODELVIEW23_ARB */ - 818, /* GL_MODELVIEW24_ARB */ - 819, /* GL_MODELVIEW25_ARB */ - 820, /* GL_MODELVIEW26_ARB */ - 821, /* GL_MODELVIEW27_ARB */ - 822, /* GL_MODELVIEW28_ARB */ - 823, /* GL_MODELVIEW29_ARB */ - 825, /* GL_MODELVIEW30_ARB */ - 826, /* GL_MODELVIEW31_ARB */ + 844, /* GL_MULTISAMPLE_3DFX */ + 1205, /* GL_SAMPLE_BUFFERS_3DFX */ + 1196, /* GL_SAMPLES_3DFX */ + 825, /* GL_MODELVIEW2_ARB */ + 828, /* GL_MODELVIEW3_ARB */ + 829, /* GL_MODELVIEW4_ARB */ + 830, /* GL_MODELVIEW5_ARB */ + 831, /* GL_MODELVIEW6_ARB */ + 832, /* GL_MODELVIEW7_ARB */ + 833, /* GL_MODELVIEW8_ARB */ + 834, /* GL_MODELVIEW9_ARB */ + 804, /* GL_MODELVIEW10_ARB */ + 805, /* GL_MODELVIEW11_ARB */ + 806, /* GL_MODELVIEW12_ARB */ + 807, /* GL_MODELVIEW13_ARB */ + 808, /* GL_MODELVIEW14_ARB */ + 809, /* GL_MODELVIEW15_ARB */ + 810, /* GL_MODELVIEW16_ARB */ + 811, /* GL_MODELVIEW17_ARB */ + 812, /* GL_MODELVIEW18_ARB */ + 813, /* GL_MODELVIEW19_ARB */ + 815, /* GL_MODELVIEW20_ARB */ + 816, /* GL_MODELVIEW21_ARB */ + 817, /* GL_MODELVIEW22_ARB */ + 818, /* GL_MODELVIEW23_ARB */ + 819, /* GL_MODELVIEW24_ARB */ + 820, /* GL_MODELVIEW25_ARB */ + 821, /* GL_MODELVIEW26_ARB */ + 822, /* GL_MODELVIEW27_ARB */ + 823, /* GL_MODELVIEW28_ARB */ + 824, /* GL_MODELVIEW29_ARB */ + 826, /* GL_MODELVIEW30_ARB */ + 827, /* GL_MODELVIEW31_ARB */ 322, /* GL_DOT3_RGB_EXT */ 320, /* GL_DOT3_RGBA_EXT */ - 797, /* GL_MIRROR_CLAMP_EXT */ - 800, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - 838, /* GL_MODULATE_ADD_ATI */ - 839, /* GL_MODULATE_SIGNED_ADD_ATI */ - 840, /* GL_MODULATE_SUBTRACT_ATI */ - 1608, /* GL_YCBCR_MESA */ - 929, /* GL_PACK_INVERT_MESA */ + 798, /* GL_MIRROR_CLAMP_EXT */ + 801, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + 839, /* GL_MODULATE_ADD_ATI */ + 840, /* GL_MODULATE_SIGNED_ADD_ATI */ + 841, /* GL_MODULATE_SUBTRACT_ATI */ + 1609, /* GL_YCBCR_MESA */ + 930, /* GL_PACK_INVERT_MESA */ 97, /* GL_BUFFER_SIZE */ 99, /* GL_BUFFER_USAGE */ 432, /* GL_FRAGMENT_PROGRAM_ARB */ - 1062, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 1090, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 1089, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - 1074, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 1080, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 1079, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 739, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 762, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 761, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - 752, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 758, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 757, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 724, /* GL_MAX_DRAW_BUFFERS_ARB */ + 1063, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 1091, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 1090, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + 1075, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 1081, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 1080, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 740, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 763, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 762, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + 753, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 759, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 758, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 725, /* GL_MAX_DRAW_BUFFERS_ARB */ 326, /* GL_DRAW_BUFFER0_ARB */ 340, /* GL_DRAW_BUFFER1_ARB */ 342, /* GL_DRAW_BUFFER2_ARB */ @@ -4266,155 +4268,156 @@ static const unsigned reduced_enums[1232] = 336, /* GL_DRAW_BUFFER14_ARB */ 338, /* GL_DRAW_BUFFER15_ARB */ 77, /* GL_BLEND_EQUATION_ALPHA_EXT */ - 706, /* GL_MATRIX_PALETTE_ARB */ - 733, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - 736, /* GL_MAX_PALETTE_MATRICES_ARB */ + 707, /* GL_MATRIX_PALETTE_ARB */ + 734, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + 737, /* GL_MAX_PALETTE_MATRICES_ARB */ 266, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - 700, /* GL_MATRIX_INDEX_ARRAY_ARB */ + 701, /* GL_MATRIX_INDEX_ARRAY_ARB */ 261, /* GL_CURRENT_MATRIX_INDEX_ARB */ - 702, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - 704, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - 703, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - 701, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - 1452, /* GL_TEXTURE_DEPTH_SIZE */ + 703, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + 705, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + 704, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + 702, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + 1453, /* GL_TEXTURE_DEPTH_SIZE */ 310, /* GL_DEPTH_TEXTURE_MODE */ - 1418, /* GL_TEXTURE_COMPARE_MODE */ - 1416, /* GL_TEXTURE_COMPARE_FUNC */ + 1419, /* GL_TEXTURE_COMPARE_MODE */ + 1417, /* GL_TEXTURE_COMPARE_FUNC */ 196, /* GL_COMPARE_R_TO_TEXTURE */ - 997, /* GL_POINT_SPRITE_ARB */ + 998, /* GL_POINT_SPRITE_ARB */ 244, /* GL_COORD_REPLACE_ARB */ - 1000, /* GL_POINT_SPRITE_R_MODE_NV */ - 1115, /* GL_QUERY_COUNTER_BITS */ + 1001, /* GL_POINT_SPRITE_R_MODE_NV */ + 1116, /* GL_QUERY_COUNTER_BITS */ 267, /* GL_CURRENT_QUERY */ - 1117, /* GL_QUERY_RESULT */ - 1119, /* GL_QUERY_RESULT_AVAILABLE */ - 780, /* GL_MAX_VERTEX_ATTRIBS_ARB */ - 1578, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ + 1118, /* GL_QUERY_RESULT */ + 1120, /* GL_QUERY_RESULT_AVAILABLE */ + 781, /* GL_MAX_VERTEX_ATTRIBS_ARB */ + 1579, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ 308, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ 307, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - 769, /* GL_MAX_TEXTURE_COORDS_ARB */ - 770, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ - 1067, /* GL_PROGRAM_ERROR_STRING_ARB */ - 1069, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - 1068, /* GL_PROGRAM_FORMAT_ARB */ - 1497, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + 770, /* GL_MAX_TEXTURE_COORDS_ARB */ + 771, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ + 1068, /* GL_PROGRAM_ERROR_STRING_ARB */ + 1070, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + 1069, /* GL_PROGRAM_FORMAT_ARB */ + 1498, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ 289, /* GL_DEPTH_BOUNDS_TEST_EXT */ 288, /* GL_DEPTH_BOUNDS_EXT */ 48, /* GL_ARRAY_BUFFER */ 373, /* GL_ELEMENT_ARRAY_BUFFER */ 50, /* GL_ARRAY_BUFFER_BINDING */ 375, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - 1553, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - 864, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + 1554, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + 865, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ 130, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - 499, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - 1431, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + 500, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + 1432, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ 369, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - 1216, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + 1217, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ 410, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - 1596, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - 1575, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - 1070, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - 745, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - 1076, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 754, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 1088, /* GL_PROGRAM_TEMPORARIES_ARB */ - 760, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - 1078, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 756, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 1082, /* GL_PROGRAM_PARAMETERS_ARB */ - 759, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - 1077, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - 755, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - 1063, /* GL_PROGRAM_ATTRIBS_ARB */ - 740, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - 1075, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - 753, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - 1061, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - 738, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - 1073, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 751, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 746, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - 742, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - 1091, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - 1507, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - 1125, /* GL_READ_ONLY */ - 1604, /* GL_WRITE_ONLY */ - 1127, /* GL_READ_WRITE */ + 1597, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + 1576, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + 1071, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + 746, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + 1077, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 755, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 1089, /* GL_PROGRAM_TEMPORARIES_ARB */ + 761, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + 1079, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 757, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 1083, /* GL_PROGRAM_PARAMETERS_ARB */ + 760, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + 1078, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + 756, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + 1064, /* GL_PROGRAM_ATTRIBS_ARB */ + 741, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + 1076, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + 754, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + 1062, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + 739, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + 1074, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 752, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 747, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + 743, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + 1092, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + 1508, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + 1126, /* GL_READ_ONLY */ + 1605, /* GL_WRITE_ONLY */ + 1128, /* GL_READ_WRITE */ 91, /* GL_BUFFER_ACCESS */ 93, /* GL_BUFFER_MAPPED */ 95, /* GL_BUFFER_MAP_POINTER */ - 660, /* GL_MATRIX0_ARB */ - 672, /* GL_MATRIX1_ARB */ - 684, /* GL_MATRIX2_ARB */ - 688, /* GL_MATRIX3_ARB */ - 690, /* GL_MATRIX4_ARB */ - 692, /* GL_MATRIX5_ARB */ - 694, /* GL_MATRIX6_ARB */ - 696, /* GL_MATRIX7_ARB */ - 698, /* GL_MATRIX8_ARB */ - 699, /* GL_MATRIX9_ARB */ - 662, /* GL_MATRIX10_ARB */ - 663, /* GL_MATRIX11_ARB */ - 664, /* GL_MATRIX12_ARB */ - 665, /* GL_MATRIX13_ARB */ - 666, /* GL_MATRIX14_ARB */ - 667, /* GL_MATRIX15_ARB */ - 668, /* GL_MATRIX16_ARB */ - 669, /* GL_MATRIX17_ARB */ - 670, /* GL_MATRIX18_ARB */ - 671, /* GL_MATRIX19_ARB */ - 674, /* GL_MATRIX20_ARB */ - 675, /* GL_MATRIX21_ARB */ - 676, /* GL_MATRIX22_ARB */ - 677, /* GL_MATRIX23_ARB */ - 678, /* GL_MATRIX24_ARB */ - 679, /* GL_MATRIX25_ARB */ - 680, /* GL_MATRIX26_ARB */ - 681, /* GL_MATRIX27_ARB */ - 682, /* GL_MATRIX28_ARB */ - 683, /* GL_MATRIX29_ARB */ - 686, /* GL_MATRIX30_ARB */ - 687, /* GL_MATRIX31_ARB */ - 1308, /* GL_STREAM_DRAW */ - 1310, /* GL_STREAM_READ */ - 1306, /* GL_STREAM_COPY */ - 1281, /* GL_STATIC_DRAW */ - 1283, /* GL_STATIC_READ */ - 1279, /* GL_STATIC_COPY */ + 467, /* GL_GL_TIME_ELAPSED_EXT */ + 661, /* GL_MATRIX0_ARB */ + 673, /* GL_MATRIX1_ARB */ + 685, /* GL_MATRIX2_ARB */ + 689, /* GL_MATRIX3_ARB */ + 691, /* GL_MATRIX4_ARB */ + 693, /* GL_MATRIX5_ARB */ + 695, /* GL_MATRIX6_ARB */ + 697, /* GL_MATRIX7_ARB */ + 699, /* GL_MATRIX8_ARB */ + 700, /* GL_MATRIX9_ARB */ + 663, /* GL_MATRIX10_ARB */ + 664, /* GL_MATRIX11_ARB */ + 665, /* GL_MATRIX12_ARB */ + 666, /* GL_MATRIX13_ARB */ + 667, /* GL_MATRIX14_ARB */ + 668, /* GL_MATRIX15_ARB */ + 669, /* GL_MATRIX16_ARB */ + 670, /* GL_MATRIX17_ARB */ + 671, /* GL_MATRIX18_ARB */ + 672, /* GL_MATRIX19_ARB */ + 675, /* GL_MATRIX20_ARB */ + 676, /* GL_MATRIX21_ARB */ + 677, /* GL_MATRIX22_ARB */ + 678, /* GL_MATRIX23_ARB */ + 679, /* GL_MATRIX24_ARB */ + 680, /* GL_MATRIX25_ARB */ + 681, /* GL_MATRIX26_ARB */ + 682, /* GL_MATRIX27_ARB */ + 683, /* GL_MATRIX28_ARB */ + 684, /* GL_MATRIX29_ARB */ + 687, /* GL_MATRIX30_ARB */ + 688, /* GL_MATRIX31_ARB */ + 1309, /* GL_STREAM_DRAW */ + 1311, /* GL_STREAM_READ */ + 1307, /* GL_STREAM_COPY */ + 1282, /* GL_STATIC_DRAW */ + 1284, /* GL_STATIC_READ */ + 1280, /* GL_STATIC_COPY */ 363, /* GL_DYNAMIC_DRAW */ 365, /* GL_DYNAMIC_READ */ 361, /* GL_DYNAMIC_COPY */ - 970, /* GL_PIXEL_PACK_BUFFER_EXT */ - 972, /* GL_PIXEL_UNPACK_BUFFER_EXT */ - 969, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ - 971, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ - 743, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - 741, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - 744, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - 748, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - 747, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - 1302, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + 971, /* GL_PIXEL_PACK_BUFFER_EXT */ + 973, /* GL_PIXEL_UNPACK_BUFFER_EXT */ + 970, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ + 972, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ + 744, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + 742, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + 745, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + 749, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + 748, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + 1303, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ 15, /* GL_ACTIVE_STENCIL_FACE_EXT */ - 798, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - 1197, /* GL_SAMPLES_PASSED */ + 799, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + 1198, /* GL_SAMPLES_PASSED */ 433, /* GL_FRAGMENT_SHADER_ARB */ - 1591, /* GL_VERTEX_SHADER_ARB */ - 1081, /* GL_PROGRAM_OBJECT_ARB */ - 1229, /* GL_SHADER_OBJECT_ARB */ - 730, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ - 782, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ - 779, /* GL_MAX_VARYING_FLOATS_ARB */ - 781, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ - 717, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ - 889, /* GL_OBJECT_TYPE_ARB */ - 888, /* GL_OBJECT_SUBTYPE_ARB */ + 1592, /* GL_VERTEX_SHADER_ARB */ + 1082, /* GL_PROGRAM_OBJECT_ARB */ + 1230, /* GL_SHADER_OBJECT_ARB */ + 731, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ + 783, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ + 780, /* GL_MAX_VARYING_FLOATS_ARB */ + 782, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ + 718, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ + 890, /* GL_OBJECT_TYPE_ARB */ + 889, /* GL_OBJECT_SUBTYPE_ARB */ 401, /* GL_FLOAT_VEC2_ARB */ 402, /* GL_FLOAT_VEC3_ARB */ 403, /* GL_FLOAT_VEC4_ARB */ - 525, /* GL_INT_VEC2_ARB */ - 526, /* GL_INT_VEC3_ARB */ - 527, /* GL_INT_VEC4_ARB */ + 526, /* GL_INT_VEC2_ARB */ + 527, /* GL_INT_VEC3_ARB */ + 528, /* GL_INT_VEC4_ARB */ 87, /* GL_BOOL_ARB */ 88, /* GL_BOOL_VEC2_ARB */ 89, /* GL_BOOL_VEC3_ARB */ @@ -4422,32 +4425,32 @@ static const unsigned reduced_enums[1232] = 398, /* GL_FLOAT_MAT2_ARB */ 399, /* GL_FLOAT_MAT3_ARB */ 400, /* GL_FLOAT_MAT4_ARB */ - 882, /* GL_OBJECT_DELETE_STATUS_ARB */ - 881, /* GL_OBJECT_COMPILE_STATUS_ARB */ - 885, /* GL_OBJECT_LINK_STATUS_ARB */ - 890, /* GL_OBJECT_VALIDATE_STATUS_ARB */ - 883, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ - 880, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ - 878, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ - 879, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ - 887, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ - 876, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ - 877, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ - 938, /* GL_PALETTE4_RGB8_OES */ - 940, /* GL_PALETTE4_RGBA8_OES */ - 936, /* GL_PALETTE4_R5_G6_B5_OES */ - 939, /* GL_PALETTE4_RGBA4_OES */ - 937, /* GL_PALETTE4_RGB5_A1_OES */ - 943, /* GL_PALETTE8_RGB8_OES */ - 945, /* GL_PALETTE8_RGBA8_OES */ - 941, /* GL_PALETTE8_R5_G6_B5_OES */ - 944, /* GL_PALETTE8_RGBA4_OES */ - 942, /* GL_PALETTE8_RGB5_A1_OES */ - 494, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - 493, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - 998, /* GL_POINT_SPRITE_COORD_ORIGIN */ + 883, /* GL_OBJECT_DELETE_STATUS_ARB */ + 882, /* GL_OBJECT_COMPILE_STATUS_ARB */ + 886, /* GL_OBJECT_LINK_STATUS_ARB */ + 891, /* GL_OBJECT_VALIDATE_STATUS_ARB */ + 884, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ + 881, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ + 879, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ + 880, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ + 888, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ + 877, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ + 878, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ + 939, /* GL_PALETTE4_RGB8_OES */ + 941, /* GL_PALETTE4_RGBA8_OES */ + 937, /* GL_PALETTE4_R5_G6_B5_OES */ + 940, /* GL_PALETTE4_RGBA4_OES */ + 938, /* GL_PALETTE4_RGB5_A1_OES */ + 944, /* GL_PALETTE8_RGB8_OES */ + 946, /* GL_PALETTE8_RGBA8_OES */ + 942, /* GL_PALETTE8_R5_G6_B5_OES */ + 945, /* GL_PALETTE8_RGBA4_OES */ + 943, /* GL_PALETTE8_RGB5_A1_OES */ + 495, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + 494, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + 999, /* GL_POINT_SPRITE_COORD_ORIGIN */ 439, /* GL_FRAMEBUFFER_BINDING_EXT */ - 1139, /* GL_RENDERBUFFER_BINDING_EXT */ + 1140, /* GL_RENDERBUFFER_BINDING_EXT */ 435, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ 434, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ 438, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ @@ -4463,7 +4466,7 @@ static const unsigned reduced_enums[1232] = 448, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ 450, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ 449, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - 714, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + 715, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ 136, /* GL_COLOR_ATTACHMENT0_EXT */ 143, /* GL_COLOR_ATTACHMENT1_EXT */ 144, /* GL_COLOR_ATTACHMENT2_EXT */ @@ -4481,24 +4484,24 @@ static const unsigned reduced_enums[1232] = 141, /* GL_COLOR_ATTACHMENT14_EXT */ 142, /* GL_COLOR_ATTACHMENT15_EXT */ 285, /* GL_DEPTH_ATTACHMENT_EXT */ - 1286, /* GL_STENCIL_ATTACHMENT_EXT */ + 1287, /* GL_STENCIL_ATTACHMENT_EXT */ 441, /* GL_FRAMEBUFFER_EXT */ - 1140, /* GL_RENDERBUFFER_EXT */ - 1143, /* GL_RENDERBUFFER_WIDTH_EXT */ - 1141, /* GL_RENDERBUFFER_HEIGHT_EXT */ - 1142, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - 1297, /* GL_STENCIL_INDEX_EXT */ - 1294, /* GL_STENCIL_INDEX1_EXT */ - 1295, /* GL_STENCIL_INDEX4_EXT */ - 1296, /* GL_STENCIL_INDEX8_EXT */ - 1293, /* GL_STENCIL_INDEX16_EXT */ + 1141, /* GL_RENDERBUFFER_EXT */ + 1144, /* GL_RENDERBUFFER_WIDTH_EXT */ + 1142, /* GL_RENDERBUFFER_HEIGHT_EXT */ + 1143, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ + 1298, /* GL_STENCIL_INDEX_EXT */ + 1295, /* GL_STENCIL_INDEX1_EXT */ + 1296, /* GL_STENCIL_INDEX4_EXT */ + 1297, /* GL_STENCIL_INDEX8_EXT */ + 1294, /* GL_STENCIL_INDEX16_EXT */ 381, /* GL_EVAL_BIT */ - 1123, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - 576, /* GL_LIST_BIT */ - 1402, /* GL_TEXTURE_BIT */ - 1212, /* GL_SCISSOR_BIT */ + 1124, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + 577, /* GL_LIST_BIT */ + 1403, /* GL_TEXTURE_BIT */ + 1213, /* GL_SCISSOR_BIT */ 25, /* GL_ALL_ATTRIB_BITS */ - 845, /* GL_MULTISAMPLE_BIT */ + 846, /* GL_MULTISAMPLE_BIT */ }; #define Elements(x) sizeof(x)/sizeof(*x) @@ -4542,7 +4545,7 @@ const char *_mesa_lookup_enum_by_nr( int nr ) { unsigned * i; - i = (unsigned *)_mesa_bsearch( & nr, reduced_enums, Elements(reduced_enums), + i = (unsigned *)bsearch( & nr, reduced_enums, Elements(reduced_enums), sizeof(reduced_enums[0]), (cfunc) compar_nr ); if ( i != NULL ) { @@ -4560,7 +4563,7 @@ int _mesa_lookup_enum_by_name( const char *symbol ) enum_elt * f = NULL; if ( symbol != NULL ) { - f = (enum_elt *)_mesa_bsearch( symbol, all_enums, Elements(all_enums), + f = (enum_elt *)bsearch( symbol, all_enums, Elements(all_enums), sizeof( enum_elt ), (cfunc) compar_name ); } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 4841e6a1515..3a7ae03b459 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1931,7 +1931,7 @@ struct gl_ati_fragment_shader_state struct gl_query_object { GLuint Id; - GLuint Result; /* the counter */ + GLuint64EXT Result; /* the counter */ GLboolean Active; /* inside Begin/EndQuery */ GLboolean Ready; /* result is ready */ }; diff --git a/src/mesa/main/occlude.c b/src/mesa/main/occlude.c index 53981d67c39..483ca5d0c41 100644 --- a/src/mesa/main/occlude.c +++ b/src/mesa/main/occlude.c @@ -331,7 +331,7 @@ _mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params) if (!q || q->Active) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetQueryObjectivARB(id=%d is active)", id); + "glGetQueryObjectivARB(id=%d is invalid or active)", id); return; } @@ -344,7 +344,13 @@ _mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params) */ ASSERT(ctx->Driver.EndQuery); } - *params = q->Result; + /* if result is too large for returned type, clamp to max value */ + if (q->Result > 0x7fffffff) { + *params = 0x7fffffff; + } + else { + *params = q->Result; + } break; case GL_QUERY_RESULT_AVAILABLE_ARB: /* XXX revisit when we have a hardware implementation! */ @@ -369,7 +375,7 @@ _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) if (!q || q->Active) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetQueryObjectuivARB(id=%d is active)", id); + "glGetQueryObjectuivARB(id=%d is invalid or active)", id); return; } @@ -382,7 +388,13 @@ _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) */ ASSERT(ctx->Driver.EndQuery); } - *params = q->Result; + /* if result is too large for returned type, clamp to max value */ + if (q->Result > 0xffffffff) { + *params = 0xffffffff; + } + else { + *params = q->Result; + } break; case GL_QUERY_RESULT_AVAILABLE_ARB: /* XXX revisit when we have a hardware implementation! */ @@ -395,6 +407,87 @@ _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) } +/** + * New with GL_EXT_timer_query + */ +void GLAPIENTRY +_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params) +{ + struct gl_query_object *q = NULL; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (id) + q = lookup_query_object(ctx, id); + + if (!q || q->Active) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetQueryObjectui64vARB(id=%d is invalid or active)", id); + return; + } + + switch (pname) { + case GL_QUERY_RESULT_ARB: + while (!q->Ready) { + /* Wait for the query to finish! */ + /* If using software rendering, the result will always be ready + * by time we get here. Otherwise, we must be using hardware! + */ + ASSERT(ctx->Driver.EndQuery); + } + *params = q->Result; + break; + case GL_QUERY_RESULT_AVAILABLE_ARB: + /* XXX revisit when we have a hardware implementation! */ + *params = q->Ready; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjecti64vARB(pname)"); + return; + } +} + + +/** + * New with GL_EXT_timer_query + */ +void GLAPIENTRY +_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params) +{ + struct gl_query_object *q = NULL; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (id) + q = lookup_query_object(ctx, id); + + if (!q || q->Active) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetQueryObjectuui64vARB(id=%d is invalid or active)", id); + return; + } + + switch (pname) { + case GL_QUERY_RESULT_ARB: + while (!q->Ready) { + /* Wait for the query to finish! */ + /* If using software rendering, the result will always be ready + * by time we get here. Otherwise, we must be using hardware! + */ + ASSERT(ctx->Driver.EndQuery); + } + *params = q->Result; + break; + case GL_QUERY_RESULT_AVAILABLE_ARB: + /* XXX revisit when we have a hardware implementation! */ + *params = q->Ready; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjectui64vARB(pname)"); + return; + } +} + /** * Allocate/init the context state related to query objects. diff --git a/src/mesa/main/occlude.h b/src/mesa/main/occlude.h index cecf7cb2b9e..ada8cf83560 100644 --- a/src/mesa/main/occlude.h +++ b/src/mesa/main/occlude.h @@ -60,5 +60,11 @@ _mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params); extern void GLAPIENTRY _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params); +extern void GLAPIENTRY +_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params); + +extern void GLAPIENTRY +_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params); + #endif /* OCCLUDE_H */ diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 562a0c5a451..57fa4a836c8 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -797,6 +797,10 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_GetFramebufferAttachmentParameterivEXT(exec, _mesa_GetFramebufferAttachmentParameterivEXT); SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT); #endif + + /* GL_EXT_timer_query */ + SET_GetQueryObjecti64vEXT(exec, _mesa_GetQueryObjecti64vEXT); + SET_GetQueryObjectui64vEXT(exec, _mesa_GetQueryObjectui64vEXT); } diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index 231027ed661..de23b501b77 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -957,6 +957,8 @@ GLNAME(gl_dispatch_functions_start): GL_STUB(StencilFuncSeparate, _gloffset_StencilFuncSeparate, StencilFuncSeparate@16) GL_STUB(StencilOpSeparate, _gloffset_StencilOpSeparate, StencilOpSeparate@16) GL_STUB(StencilMaskSeparate, _gloffset_StencilMaskSeparate, StencilMaskSeparate@8) + GL_STUB(GetQueryObjecti64vEXT, _gloffset_GetQueryObjecti64vEXT, GetQueryObjecti64vEXT@12) + GL_STUB(GetQueryObjectui64vEXT, _gloffset_GetQueryObjectui64vEXT, GetQueryObjectui64vEXT@12) GL_STUB_ALIAS(ArrayElementEXT, _gloffset_ArrayElement, ArrayElementEXT@4, ArrayElement, ArrayElement@4) GL_STUB_ALIAS(BindTextureEXT, _gloffset_BindTexture, BindTextureEXT@8, BindTexture, BindTexture@8) GL_STUB_ALIAS(DrawArraysEXT, _gloffset_DrawArrays, DrawArraysEXT@12, DrawArrays, DrawArrays@12) -- cgit v1.2.3 From 4c3443b460748c1406b91baa5ffe20e3cbe9e61c Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Thu, 8 Dec 2005 04:32:02 +0000 Subject: handle 64-bit types for Windows. --- include/GL/gl.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 75c61672444..5b6733c851f 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2239,6 +2239,9 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L typedef long long int GLint64EXT; typedef unsigned long long int GLuint64EXT; +#elif defined(_WIN32) + typedef __int64 GLint64EXT; + typedef unsigned __int64 GLuint64EXT; #else /* this might actually be a 32-bit type */ typedef long int GLint64_EXT; -- cgit v1.2.3 From 5262c225ba9eb90fc2a357c40a93a5bba2dd602a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 8 Dec 2005 14:10:59 +0000 Subject: remove stray _ from GL[u]int64_EXT --- include/GL/gl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 5b6733c851f..c4becf5a14f 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2244,8 +2244,8 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen typedef unsigned __int64 GLuint64EXT; #else /* this might actually be a 32-bit type */ - typedef long int GLint64_EXT; - typedef unsigned long int GLuint64_EXT; + typedef long int GLint64EXT; + typedef unsigned long int GLuint64EXT; #endif #define GL_TIME_ELAPSED_EXT 0x88BF -- cgit v1.2.3 From 5abc246f8d56b52a7aaaa5458e655456e9e420a8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 8 Dec 2005 14:51:36 +0000 Subject: bump version number --- include/GL/osmesa.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/osmesa.h b/include/GL/osmesa.h index c5057819402..56fa23ce81f 100644 --- a/include/GL/osmesa.h +++ b/include/GL/osmesa.h @@ -61,7 +61,7 @@ extern "C" { #define OSMESA_MAJOR_VERSION 6 -#define OSMESA_MINOR_VERSION 3 +#define OSMESA_MINOR_VERSION 5 #define OSMESA_PATCH_VERSION 0 @@ -270,7 +270,7 @@ OSMesaGetProcAddress( const char *funcName ); /** * Enable/disable color clamping, off by default. - * New in Mesa 6.5 + * New in Mesa 6.4.2 */ GLAPI void GLAPIENTRY OSMesaColorClamp(GLboolean enable); -- cgit v1.2.3 From 215aa20f5ce28f8398a742685afd7461a5081d49 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 10 Dec 2005 17:54:36 +0000 Subject: rename eglShowSurfaceMESA, add EGL_SCREEN_POSITION_GRANULARITY_MESA --- include/GLES/egl.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/GLES/egl.h b/include/GLES/egl.h index d62786d03dc..3f3730cd948 100644 --- a/include/GLES/egl.h +++ b/include/GLES/egl.h @@ -235,21 +235,23 @@ GLAPI EGLBoolean APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, Na #ifndef EGL_MESA_screen_surface #define EGL_MESA_screen_surface 1 -#define EGL_BAD_SCREEN_MESA 0x4000 -#define EGL_BAD_MODE_MESA 0x4001 -#define EGL_SCREEN_COUNT_MESA 0x4002 -#define EGL_SCREEN_POSITION_MESA 0x4003 -#define EGL_MODE_ID_MESA 0x4004 -#define EGL_REFRESH_RATE_MESA 0x4005 -#define EGL_OPTIMAL_MODE_MESA 0x4006 -#define EGL_SCREEN_BIT_MESA 0x08 +#define EGL_BAD_SCREEN_MESA 0x4000 +#define EGL_BAD_MODE_MESA 0x4001 +#define EGL_SCREEN_COUNT_MESA 0x4002 +#define EGL_SCREEN_POSITION_MESA 0x4003 +#define EGL_SCREEN_POSITION_GRANULARITY_MESA 0x4004 +#define EGL_MODE_ID_MESA 0x4005 +#define EGL_REFRESH_RATE_MESA 0x4006 +#define EGL_OPTIMAL_MESA 0x4007 +#define EGL_INTERLACED_MESA 0x4008 +#define EGL_SCREEN_BIT_MESA 0x08 GLAPI EGLBoolean APIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); GLAPI EGLBoolean APIENTRY eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); GLAPI EGLBoolean APIENTRY eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value); GLAPI EGLBoolean APIENTRY eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens); GLAPI EGLSurface APIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); -GLAPI EGLBoolean APIENTRY eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode); +GLAPI EGLBoolean APIENTRY eglShowScreenSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode); GLAPI EGLBoolean APIENTRY eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y); GLAPI EGLBoolean APIENTRY eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value); GLAPI EGLBoolean APIENTRY eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface); -- cgit v1.2.3 From b6d7a0c5a56d8a861225ea6dd58b0096ca440328 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 14 Dec 2005 14:23:37 +0000 Subject: regenerate to pick up glGetQueryObject[u]i64vEXT funcs --- include/GL/gl_mangle.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index c1b443c6b0a..8e6faa67b27 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -520,8 +520,10 @@ #define glGetProgramStringNV MANGLE(GetProgramStringNV) #define glGetQueryivARB MANGLE(GetQueryivARB) #define glGetQueryiv MANGLE(GetQueryiv) +#define glGetQueryObjecti64vEXT MANGLE(GetQueryObjecti64vEXT) #define glGetQueryObjectivARB MANGLE(GetQueryObjectivARB) #define glGetQueryObjectiv MANGLE(GetQueryObjectiv) +#define glGetQueryObjectui64vEXT MANGLE(GetQueryObjectui64vEXT) #define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB) #define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv) #define glGetRenderbufferParameterivEXT MANGLE(GetRenderbufferParameterivEXT) -- cgit v1.2.3 From f3cf636e571eaa719ea79a1076f2e11a9b9a43fa Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 25 Jan 2006 17:33:13 +0000 Subject: WGL_ARB_extensions_string extension --- include/GL/mesa_wgl.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/GL/mesa_wgl.h b/include/GL/mesa_wgl.h index 21473763ed5..acc7eac2a71 100644 --- a/include/GL/mesa_wgl.h +++ b/include/GL/mesa_wgl.h @@ -111,6 +111,15 @@ WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDE WGLAPI int GLAPIENTRY GetPixelFormat(HDC); WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *); + +#ifndef WGL_ARB_extensions_string +#define WGL_ARB_extensions_string 1 + +WGLAPI const char * GLAPIENTRY wglGetExtensionsStringARB(HDC hdc); + +#endif /* WGL_ARB_extensions_string */ + + #ifdef _MSC_VER # pragma warning( pop ) #endif -- cgit v1.2.3 From 640ef7f8908a3c25390125f5727d154ca66c9505 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 5 Feb 2006 16:39:19 +0000 Subject: EGL 1.2 tokens/functions/etc. --- include/GLES/egl.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GLES/egl.h b/include/GLES/egl.h index 3f3730cd948..f18c86ca62d 100644 --- a/include/GLES/egl.h +++ b/include/GLES/egl.h @@ -64,9 +64,7 @@ ** Versioning and extensions */ #define EGL_VERSION_1_0 1 -#if 0 #define EGL_VERSION_1_1 1 -#endif /* ** Boolean @@ -269,6 +267,56 @@ GLAPI EGLBoolean APIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source, #endif /* EGL_MESA_copy_context */ +/* XXX this is preliminary! */ +#ifndef EGL_VERSION_1_2 +#define EGL_VERSION_1_2 1 + +typedef int EGLenum; +typedef int EGLClientBuffer; + +#define EGL_DISPLAY_SCALING 10000 +#define EGL_UNKNOWN ((EGLint)-1) + +#define EGL_OPENGL_ES_BIT 0x1 +#define EGL_OPENVG_BIT 0x2 + +#define EGL_OPENGL_ES_API 0x30A0 +#define EGL_OPENVG_API 0x30A1 + +#define EGL_LUMINANCE_SIZE 0x303D +#define EGL_ALPHA_MASK_SIZE 0x303E +#define EGL_COLOR_BUFFER_TYPE 0x303F +#define EGL_RENDERABLE_TYPE 0x3040 + +#define EGL_SINGLE_BUFFER 0x3085 +#define EGL_RENDER_BUFFER 0x3086 +#define EGL_COLORSPACE 0x3087 +#define EGL_ALPHA_FORMAT 0x3088 +#define EGL_COLORSPACE_sRGB 0x3089 +#define EGL_COLORSPACE_LINEAR 0x308A +#define EGL_ALPHA_FORMAT_NONPRE 0x308B +#define EGL_ALPHA_FORMAT_PRE 0x308C +#define EGL_CLIENT_APIS 0x308D +#define EGL_RGB_BUFFER 0x308E +#define EGL_LUMINANCE_BUFFER 0x308F +#define EGL_HORIZONTAL_RESOLUTION 0x3090 +#define EGL_VERTICAL_RESOLUTION 0x3091 +#define EGL_PIXEL_ASPECT_RATIO 0x3092 +#define EGL_SWAP_BEHAVIOR 0x3093 +#define EGL_BUFFER_PRESERVED 0x3094 +#define EGL_BUFFER_DESTROYED 0x3095 +#define EGL_OPENVG_IMAGE 0x3096 +#define EGL_CONTEXT_CLIENT_TYPE 0x3097 + +GLAPI EGLBoolean APIENTRY eglBindAPI(EGLenum api); +GLAPI EGLenum APIENTRY eglQueryAPI(void); +GLAPI EGLBoolean APIENTRY eglWaitClient(void); +GLAPI EGLBoolean APIENTRY eglReleaseThread(void); +GLAPI EGLSurface APIENTRY eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); + +#endif /* EGL_VERSION_1_2 */ + + #ifdef __cplusplus } #endif -- cgit v1.2.3 From 44a2e96729b730693f314b43e3d861b326968b5c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 23 Feb 2006 15:36:39 +0000 Subject: include inttypes.h if __osf__ defined (Randall Hand) --- include/GL/glxext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glxext.h b/include/GL/glxext.h index 589d1ef363e..fa58593e318 100644 --- a/include/GL/glxext.h +++ b/include/GL/glxext.h @@ -331,7 +331,7 @@ typedef struct { } GLXBufferClobberEventSGIX; #endif -#if defined(__sun__) +#if defined(__sun__) || defined(__osf__) #include #if defined(__STDC__) #if defined(__arch64__) -- cgit v1.2.3 From a23109760923fd57fa6a652d85d245fef00bfabf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 1 Mar 2006 01:54:59 +0000 Subject: GL_EXT_framebuffer_blit tokens/functions --- include/GL/gl.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index c4becf5a14f..75b24dcc31d 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2260,6 +2260,28 @@ typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pnam +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 + +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA + +GLAPI void GLAPIENTRY +glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter); + +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) + (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter); + +#endif /* GL_EXT_framebuffer_blit */ + + + #ifndef GL_EXT_packed_depth_stencil #define GL_EXT_packed_depth_stencil 1 -- cgit v1.2.3 From 9c32af5bb24d531d7140590085e229b7381747f8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 9 Mar 2006 16:27:35 +0000 Subject: Add prototypes for GLX_MESA_swap_frame_usage, GLX_MESA_swap_control, and GLX_EXT_texture_from_pixmap to silence warnings while compiling glxcmds.c XXX: Need to add the new tokens for GLX_EXT_texture_from_pixmap!!! --- include/GL/glx.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 7d399e76be1..d0b2a811131 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -379,6 +379,60 @@ extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attr #endif /* GLX_NV_float_buffer */ + +/* + * #?. GLX_MESA_swap_frame_usage + */ +#ifndef GLX_MESA_swap_frame_usage +#define GLX_MESA_swap_frame_usage 1 + +extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage); +extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable); +extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable); +extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage); + +typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage); +typedef int (*PFNGLXBEGINFRAMETRACKINGMESA)(Display *dpy, GLXDrawable drawable); +typedef int (*PFNGLXENDFRAMETRACKINGMESA)(Display *dpy, GLXDrawable drawable); +typedef int (*PFNGLXQUERYFRAMETRACKINGMESA)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage); + +#endif /* GLX_MESA_swap_frame_usage */ + + + +/* + * #?. GLX_MESA_swap_control + */ +#ifndef GLX_MESA_swap_control +#define GLX_MESA_swap_control 1 + +extern int glXSwapIntervalMESA(unsigned int interval); +extern int glXGetSwapIntervalMESA(void); + +typedef int (*PFNGLXSWAPINTERVALMESA)(unsigned int interval); +typedef int (*PFNGLXGETSWAPINTERVALMESA)(void); + +#endif /* GLX_MESA_swap_control */ + + + +/* + * #?. GLX_EXT_texture_from_pixmap + * XXX not finished? + */ +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_EXT_texture_from_pixmap 1 + +/* XXX need enums/tokens! */ + +extern Bool glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer); +extern Bool glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer); + +#endif /* GLX_EXT_texture_from_pixmap */ + + + + /*** Should these go here, or in another header? */ /* ** GLX Events -- cgit v1.2.3 From 4cbd16ed3ffecd743b4921fab3a65f8510d151c9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 26 Mar 2006 05:09:03 +0000 Subject: fix some PFNGL* typedefs --- include/GL/glx.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index d0b2a811131..f471d55e1f6 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -392,9 +392,9 @@ extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable); extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage); typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage); -typedef int (*PFNGLXBEGINFRAMETRACKINGMESA)(Display *dpy, GLXDrawable drawable); -typedef int (*PFNGLXENDFRAMETRACKINGMESA)(Display *dpy, GLXDrawable drawable); -typedef int (*PFNGLXQUERYFRAMETRACKINGMESA)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage); +typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable); +typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable); +typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage); #endif /* GLX_MESA_swap_frame_usage */ @@ -409,8 +409,8 @@ typedef int (*PFNGLXQUERYFRAMETRACKINGMESA)(Display *dpy, GLXDrawable drawable, extern int glXSwapIntervalMESA(unsigned int interval); extern int glXGetSwapIntervalMESA(void); -typedef int (*PFNGLXSWAPINTERVALMESA)(unsigned int interval); -typedef int (*PFNGLXGETSWAPINTERVALMESA)(void); +typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval); +typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void); #endif /* GLX_MESA_swap_control */ -- cgit v1.2.3 From a8c9ecfab005088b1b201abc9d04f5169d1b3b64 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Thu, 30 Mar 2006 07:53:15 +0000 Subject: Fixes from Brian --- include/GL/wmesa.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/GL/wmesa.h b/include/GL/wmesa.h index 66f3dbe82f0..1c959a6792c 100644 --- a/include/GL/wmesa.h +++ b/include/GL/wmesa.h @@ -100,15 +100,14 @@ extern WMesaContext WMesaCreateContext(HDC hDC,HPALETTE* pPal, /* * Destroy a rendering context as returned by WMesaCreateContext() */ -/*extern void WMesaDestroyContext( WMesaContext ctx );*/ -extern void WMesaDestroyContext( void ); +extern void WMesaDestroyContext( WMesaContext ctx ); /* * Make the specified context the current one. */ -extern void WMesaMakeCurrent( WMesaContext ctx ); +extern void WMesaMakeCurrent( WMesaContext ctx, HDC hdc ); /* @@ -121,7 +120,7 @@ extern WMesaContext WMesaGetCurrentContext( void ); * Swap the front and back buffers for the current context. No action * taken if the context is not double buffered. */ -extern void WMesaSwapBuffers(void); +extern void WMesaSwapBuffers(HDC hdc); /* -- cgit v1.2.3 From 8ea3353ec3fa29f0eb2269b54fff6834f97a8c08 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 30 Mar 2006 14:20:26 +0000 Subject: XMesaDrawLine macro, not currently used --- include/GL/xmesa_x.h | 1 + include/GL/xmesa_xf86.h | 12 ++++++++++++ 2 files changed, 13 insertions(+) (limited to 'include') diff --git a/include/GL/xmesa_x.h b/include/GL/xmesa_x.h index 1455c88adbc..721d8b51070 100644 --- a/include/GL/xmesa_x.h +++ b/include/GL/xmesa_x.h @@ -64,6 +64,7 @@ typedef XColor XMesaColor; #define XMesaDrawPoint XDrawPoint #define XMesaDrawPoints XDrawPoints +#define XMesaDrawLine XDrawLine #define XMesaFillRectangle XFillRectangle #define XMesaPutImage XPutImage #define XMesaCopyArea XCopyArea diff --git a/include/GL/xmesa_xf86.h b/include/GL/xmesa_xf86.h index 63a8e57dbca..3c3d2047dcd 100644 --- a/include/GL/xmesa_xf86.h +++ b/include/GL/xmesa_xf86.h @@ -95,6 +95,18 @@ do { \ (*gc->ops->PolyPoint)(__b, __gc, __m, __n, __p); \ } while (0) +#define XMesaDrawLine(__d, __b, __gc, __x0, __y0, __x1, __y1) \ +do { \ + XMesaPoint __p[2]; \ + (void) __d; \ + __p[0].x = __x0; \ + __p[0].y = __y0; \ + __p[1].x = __x1; \ + __p[1].y = __y1; \ + ValidateGC(__b, __gc); \ + (*gc->ops->PolyLines)(__b, __gc, CoordModeOrigin, 2, __p); \ +} while (0) + #define XMesaFillRectangle(__d,__b,__gc,__x,__y,__w,__h) \ do { \ xRectangle __r[1]; \ -- cgit v1.2.3 From f2ad1b60c0da11283b399008f491792790cea294 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 31 Mar 2006 15:48:04 +0000 Subject: Dave Reveman's patch for GLX_MESA_copy_sub_buffer support --- include/GL/internal/dri_interface.h | 8 +++ src/glx/x11/glxcmds.c | 70 +++++++++++++++++++++++---- src/glx/x11/glxextensions.c | 2 +- src/mesa/drivers/dri/common/dri_util.c | 10 ++++ src/mesa/drivers/dri/common/dri_util.h | 2 + src/mesa/drivers/dri/i915/intel_batchbuffer.c | 53 ++++++++++++++------ src/mesa/drivers/dri/i915/intel_batchbuffer.h | 3 +- src/mesa/drivers/dri/i915/intel_context.c | 25 +++++++++- src/mesa/drivers/dri/i915/intel_screen.c | 4 +- src/mesa/drivers/dri/i915/intel_screen.h | 3 ++ src/mesa/drivers/dri/r200/r200_context.c | 26 +++++++++- src/mesa/drivers/dri/r200/r200_context.h | 2 + src/mesa/drivers/dri/r200/r200_ioctl.c | 56 +++++++++++++++------ src/mesa/drivers/dri/r200/r200_ioctl.h | 3 +- src/mesa/drivers/dri/r300/radeon_context.c | 27 ++++++++++- src/mesa/drivers/dri/r300/radeon_context.h | 2 + src/mesa/drivers/dri/r300/radeon_ioctl.c | 59 +++++++++++++++------- src/mesa/drivers/dri/r300/radeon_ioctl.h | 3 +- src/mesa/drivers/dri/radeon/radeon_context.c | 27 ++++++++++- src/mesa/drivers/dri/radeon/radeon_context.h | 2 + src/mesa/drivers/dri/radeon/radeon_ioctl.c | 54 +++++++++++++++------ src/mesa/drivers/dri/radeon/radeon_ioctl.h | 3 +- src/mesa/drivers/dri/radeon/radeon_screen.c | 8 ++- 23 files changed, 371 insertions(+), 81 deletions(-) (limited to 'include') diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 0f3555b576e..c204ecfe622 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -472,6 +472,14 @@ struct __DRIdrawableRec { * \since Internal API version 20030317. */ unsigned swap_interval; + + /** + * Used by drivers that implement the GLX_MESA_copy_sub_buffer extension. + * + * \since Internal API version 20060314. + */ + void (*copySubBuffer)(__DRInativeDisplay *dpy, void *drawablePrivate, + int x, int y, int w, int h); }; #endif diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index d4f579d01ac..16f7e96150a 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -2570,18 +2570,69 @@ PUBLIC GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual, return 0; } - +#define X_GLXvop_CopySubBufferMESA 5154 /* temporary */ PUBLIC void glXCopySubBufferMESA(Display *dpy, GLXDrawable drawable, int x, int y, int width, int height) { - (void) dpy; - (void) drawable; - (void) x; - (void) y; - (void) width; - (void) height; -} + xGLXVendorPrivateReq *req; + GLXContext gc; + GLXContextTag tag; + CARD32 *drawable_ptr; + INT32 *x_ptr, *y_ptr, *w_ptr, *h_ptr; + CARD8 opcode; + +#ifdef GLX_DIRECT_RENDERING + int screen; + __DRIdrawable *pdraw = GetDRIDrawable( dpy, drawable, & screen ); + if ( pdraw != NULL ) { + __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen ); + if ( __glXExtensionBitIsEnabled( psc, MESA_copy_sub_buffer_bit ) ) { + (*pdraw->copySubBuffer)(dpy, pdraw->private, x, y, width, height); + } + + return; + } +#endif + + opcode = __glXSetupForCommand(dpy); + if (!opcode) + return; + /* + ** The calling thread may or may not have a current context. If it + ** does, send the context tag so the server can do a flush. + */ + gc = __glXGetCurrentContext(); + if ((gc != NULL) && (dpy == gc->currentDpy) && + ((drawable == gc->currentDrawable) || + (drawable == gc->currentReadable)) ) { + tag = gc->currentContextTag; + } else { + tag = 0; + } + + LockDisplay(dpy); + GetReqExtra(GLXVendorPrivate, sizeof(CARD32) + sizeof(INT32) * 4,req); + req->reqType = opcode; + req->glxCode = X_GLXVendorPrivate; + req->vendorCode = X_GLXvop_CopySubBufferMESA; + req->contextTag = tag; + + drawable_ptr = (CARD32 *) (req + 1); + x_ptr = (INT32 *) (drawable_ptr + 1); + y_ptr = (INT32 *) (drawable_ptr + 2); + w_ptr = (INT32 *) (drawable_ptr + 3); + h_ptr = (INT32 *) (drawable_ptr + 4); + + *drawable_ptr = drawable; + *x_ptr = x; + *y_ptr = y; + *w_ptr = width; + *h_ptr = height; + + UnlockDisplay(dpy); + SyncHandle(); +} PUBLIC Bool glXSet3DfxModeMESA( int mode ) { @@ -2973,8 +3024,9 @@ int __glXGetInternalVersion(void) * months ago. :( * 20050727 - Gut all the old interfaces. This breaks compatability with * any DRI driver built to any previous version. + * 20060314 - Added support for GLX_MESA_copy_sub_buffer. */ - return 20050727; + return 20060314; } diff --git a/src/glx/x11/glxextensions.c b/src/glx/x11/glxextensions.c index 0cee71f6c3a..c3bc93009aa 100644 --- a/src/glx/x11/glxextensions.c +++ b/src/glx/x11/glxextensions.c @@ -79,7 +79,7 @@ static const struct extension_info known_glx_extensions[] = { { GLX(EXT_visual_rating), VER(0,0), Y, Y, N, N }, { GLX(MESA_agp_offset), VER(0,0), N, N, N, Y }, /* Deprecated */ { GLX(MESA_allocate_memory), VER(0,0), Y, N, N, Y }, - { GLX(MESA_copy_sub_buffer), VER(0,0), N, N, N, N }, /* Deprecated? */ + { GLX(MESA_copy_sub_buffer), VER(0,0), Y, N, N, N }, { GLX(MESA_pixmap_colormap), VER(0,0), N, N, N, N }, /* Deprecated */ { GLX(MESA_release_buffers), VER(0,0), N, N, N, N }, /* Deprecated */ { GLX(MESA_set_3dfx_mode), VER(0,0), N, N, N, N }, /* Deprecated */ diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 883a89c8886..d68837b545a 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -547,6 +547,13 @@ static int64_t driSwapBuffersMSC( __DRInativeDisplay * dpy, void *drawablePriv, remainder ); } +static void driCopySubBuffer( __DRInativeDisplay *dpy, void *drawablePrivate, + int x, int y, int w, int h) +{ + __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; + dPriv->driScreenPriv->DriverAPI.CopySubBuffer(dPriv, x, y, w, h); + (void) dpy; +} /** * This is called via __DRIscreenRec's createNewDrawable pointer. @@ -623,6 +630,9 @@ static void *driCreateNewDrawable(__DRInativeDisplay *dpy, pdraw->frameTracking = NULL; pdraw->queryFrameTracking = driQueryFrameTracking; + if (driCompareGLXAPIVersion (20060314) >= 0) + pdraw->copySubBuffer = driCopySubBuffer; + /* This special default value is replaced with the configured * default value when the drawable is first bound to a direct * rendering context. diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index b9b38f39cd6..14c24a0efaa 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -189,6 +189,8 @@ struct __DriverAPIRec { int64_t (*SwapBuffersMSC)( __DRIdrawablePrivate *priv, int64_t target_msc, int64_t divisor, int64_t remainder ); /*@}*/ + void (*CopySubBuffer)(__DRIdrawablePrivate *driDrawPriv, + int x, int y, int w, int h); }; diff --git a/src/mesa/drivers/dri/i915/intel_batchbuffer.c b/src/mesa/drivers/dri/i915/intel_batchbuffer.c index 508900de308..974a2497e1d 100644 --- a/src/mesa/drivers/dri/i915/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/i915/intel_batchbuffer.c @@ -366,7 +366,8 @@ static void intelWaitForFrameCompletion( intelContextPtr intel ) /* * Copy the back buffer to the front buffer. */ -void intelCopyBuffer( const __DRIdrawablePrivate *dPriv ) +void intelCopyBuffer( const __DRIdrawablePrivate *dPriv, + const drm_clip_rect_t *rect) { intelContextPtr intel; GLboolean missed_target; @@ -385,15 +386,19 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv ) LOCK_HARDWARE( intel ); intelWaitForFrameCompletion( intel ); - UNLOCK_HARDWARE( intel ); - driWaitForVBlank( dPriv, &intel->vbl_seq, intel->vblank_flags, & missed_target ); - LOCK_HARDWARE( intel ); + if (!rect) + { + UNLOCK_HARDWARE( intel ); + driWaitForVBlank( dPriv, &intel->vbl_seq, intel->vblank_flags, & missed_target ); + LOCK_HARDWARE( intel ); + } { const intelScreenPrivate *intelScreen = intel->intelScreen; const __DRIdrawablePrivate *dPriv = intel->driDrawable; const int nbox = dPriv->numClipRects; const drm_clip_rect_t *pbox = dPriv->pClipRects; + drm_clip_rect_t box; const int cpp = intelScreen->cpp; const int pitch = intelScreen->front.pitch; /* in bytes */ int i; @@ -429,18 +434,35 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv ) continue; } + box = *pbox; + + if (rect) + { + if (rect->x1 > box.x1) + box.x1 = rect->x1; + if (rect->y1 > box.y1) + box.y1 = rect->y1; + if (rect->x2 < box.x2) + box.x2 = rect->x2; + if (rect->y2 < box.y2) + box.y2 = rect->y2; + + if (box.x1 > box.x2 || box.y1 > box.y2) + continue; + } + BEGIN_BATCH( 8); OUT_BATCH( CMD ); OUT_BATCH( BR13 ); - OUT_BATCH( (pbox->y1 << 16) | pbox->x1 ); - OUT_BATCH( (pbox->y2 << 16) | pbox->x2 ); + OUT_BATCH( (box.y1 << 16) | box.x1 ); + OUT_BATCH( (box.y2 << 16) | box.x2 ); if (intel->sarea->pf_current_page == 0) OUT_BATCH( intelScreen->front.offset ); else OUT_BATCH( intelScreen->back.offset ); - OUT_BATCH( (pbox->y1 << 16) | pbox->x1 ); + OUT_BATCH( (box.y1 << 16) | box.x1 ); OUT_BATCH( BR13 & 0xffff ); if (intel->sarea->pf_current_page == 0) @@ -454,14 +476,17 @@ void intelCopyBuffer( const __DRIdrawablePrivate *dPriv ) intelFlushBatchLocked( intel, GL_TRUE, GL_TRUE, GL_TRUE ); UNLOCK_HARDWARE( intel ); - intel->swap_count++; - (*dri_interface->getUST)(&ust); - if (missed_target) { - intel->swap_missed_count++; - intel->swap_missed_ust = ust - intel->swap_ust; - } + if (!rect) + { + intel->swap_count++; + (*dri_interface->getUST)(&ust); + if (missed_target) { + intel->swap_missed_count++; + intel->swap_missed_ust = ust - intel->swap_ust; + } - intel->swap_ust = ust; + intel->swap_ust = ust; + } } diff --git a/src/mesa/drivers/dri/i915/intel_batchbuffer.h b/src/mesa/drivers/dri/i915/intel_batchbuffer.h index dcc63b23c8d..b0aed89af55 100644 --- a/src/mesa/drivers/dri/i915/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/i915/intel_batchbuffer.h @@ -75,7 +75,8 @@ extern void intelRestartInlinePrimitive( intelContextPtr intel ); extern GLuint *intelEmitInlinePrimitiveLocked(intelContextPtr intel, int primitive, int dwords, int vertex_size); -extern void intelCopyBuffer( const __DRIdrawablePrivate *dpriv ); +extern void intelCopyBuffer( const __DRIdrawablePrivate *dpriv, + const drm_clip_rect_t *rect); extern void intelClearWithBlit(GLcontext *ctx, GLbitfield mask, GLboolean all, GLint cx1, GLint cy1, GLint cw, GLint ch); diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c index c79ce9661c1..7dbc2c8739b 100644 --- a/src/mesa/drivers/dri/i915/intel_context.c +++ b/src/mesa/drivers/dri/i915/intel_context.c @@ -722,7 +722,7 @@ void intelSwapBuffers( __DRIdrawablePrivate *dPriv ) if ( 0 /*intel->doPageFlip*/ ) { /* doPageFlip is never set !!! */ intelPageFlip( dPriv ); } else { - intelCopyBuffer( dPriv ); + intelCopyBuffer( dPriv, NULL ); } if (screen->current_rotation != 0) { intelRotateWindow(intel, dPriv, BUFFER_BIT_FRONT_LEFT); @@ -734,6 +734,29 @@ void intelSwapBuffers( __DRIdrawablePrivate *dPriv ) } } +void intelCopySubBuffer( __DRIdrawablePrivate *dPriv, + int x, int y, int w, int h ) +{ + if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { + intelContextPtr intel; + GLcontext *ctx; + intel = (intelContextPtr) dPriv->driContextPriv->driverPrivate; + ctx = &intel->ctx; + if (ctx->Visual.doubleBufferMode) { + intelScreenPrivate *screen = intel->intelScreen; + drm_clip_rect_t rect; + rect.x1 = x + dPriv->x; + rect.y1 = (dPriv->h - y - h) + dPriv->y; + rect.x2 = rect.x1 + w; + rect.y2 = rect.y1 + h; + _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */ + intelCopyBuffer( dPriv, &rect ); + } + } else { + /* XXX this shouldn't be an error but we can't handle it for now */ + fprintf(stderr, "%s: drawable has no context!\n", __FUNCTION__); + } +} void intelInitState( GLcontext *ctx ) { diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index 9ee44ea0860..c8649d8243a 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -341,6 +341,7 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv) (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); (*glx_enable_extension)( psc, "GLX_SGI_make_current_read" ); (*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" ); + (*glx_enable_extension)( psc, "GLX_MESA_copy_sub_buffer" ); } sPriv->psc->allocateMemory = (void *) intelAllocateMemoryMESA; @@ -534,7 +535,8 @@ static const struct __DriverAPIRec intelAPI = { .GetMSC = driGetMSC32, .WaitForMSC = driWaitForMSC32, .WaitForSBC = NULL, - .SwapBuffersMSC = NULL + .SwapBuffersMSC = NULL, + .CopySubBuffer = intelCopySubBuffer }; diff --git a/src/mesa/drivers/dri/i915/intel_screen.h b/src/mesa/drivers/dri/i915/intel_screen.h index 0cdcc140445..24cfd9bf8b2 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.h +++ b/src/mesa/drivers/dri/i915/intel_screen.h @@ -106,4 +106,7 @@ intelMakeCurrent(__DRIcontextPrivate *driContextPriv, extern void intelSwapBuffers(__DRIdrawablePrivate *dPriv); +extern void +intelCopySubBuffer( __DRIdrawablePrivate *dPriv, int x, int y, int w, int h ); + #endif diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 0d7df499c09..e4d9e264bf9 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -637,7 +637,7 @@ r200SwapBuffers( __DRIdrawablePrivate *dPriv ) r200PageFlip( dPriv ); } else { - r200CopyBuffer( dPriv ); + r200CopyBuffer( dPriv, NULL ); } } } @@ -647,6 +647,30 @@ r200SwapBuffers( __DRIdrawablePrivate *dPriv ) } } +void +r200CopySubBuffer( __DRIdrawablePrivate *dPriv, + int x, int y, int w, int h ) +{ + if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { + r200ContextPtr rmesa; + GLcontext *ctx; + rmesa = (r200ContextPtr) dPriv->driContextPriv->driverPrivate; + ctx = rmesa->glCtx; + if (ctx->Visual.doubleBufferMode) { + drm_clip_rect_t rect; + rect.x1 = x + dPriv->x; + rect.y1 = (dPriv->h - y - h) + dPriv->y; + rect.x2 = rect.x1 + w; + rect.y2 = rect.y1 + h; + _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */ + r200CopyBuffer( dPriv, &rect ); + } + } + else { + /* XXX this shouldn't be an error but we can't handle it for now */ + _mesa_problem(NULL, "%s: drawable has no context!", __FUNCTION__); + } +} /* Force the context `c' to be the current context and associate with it * buffer `b'. diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h index eee72bdacbb..faf1b96a2b8 100644 --- a/src/mesa/drivers/dri/r200/r200_context.h +++ b/src/mesa/drivers/dri/r200/r200_context.h @@ -1006,6 +1006,8 @@ extern GLboolean r200CreateContext( const __GLcontextModes *glVisual, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate); extern void r200SwapBuffers( __DRIdrawablePrivate *dPriv ); +extern void r200CopySubBuffer( __DRIdrawablePrivate * dPriv, + int x, int y, int w, int h ); extern GLboolean r200MakeCurrent( __DRIcontextPrivate *driContextPriv, __DRIdrawablePrivate *driDrawPriv, __DRIdrawablePrivate *driReadPriv ); diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c b/src/mesa/drivers/dri/r200/r200_ioctl.c index 5a2f7e2ad61..ae0f35cb398 100644 --- a/src/mesa/drivers/dri/r200/r200_ioctl.c +++ b/src/mesa/drivers/dri/r200/r200_ioctl.c @@ -420,7 +420,8 @@ static void r200WaitForFrameCompletion( r200ContextPtr rmesa ) /* Copy the back color buffer to the front color buffer. */ -void r200CopyBuffer( const __DRIdrawablePrivate *dPriv ) +void r200CopyBuffer( const __DRIdrawablePrivate *dPriv, + const drm_clip_rect_t *rect) { r200ContextPtr rmesa; GLint nbox, i, ret; @@ -446,9 +447,12 @@ void r200CopyBuffer( const __DRIdrawablePrivate *dPriv ) * request at a time. */ r200WaitForFrameCompletion( rmesa ); - UNLOCK_HARDWARE( rmesa ); - driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target ); - LOCK_HARDWARE( rmesa ); + if (!rect) + { + UNLOCK_HARDWARE( rmesa ); + driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target ); + LOCK_HARDWARE( rmesa ); + } nbox = dPriv->numClipRects; /* must be in locked region */ @@ -459,8 +463,27 @@ void r200CopyBuffer( const __DRIdrawablePrivate *dPriv ) GLint n = 0; for ( ; i < nr ; i++ ) { - *b++ = box[i]; - n++; + + *b = box[i]; + + if (rect) + { + if (rect->x1 > b->x1) + b->x1 = rect->x1; + if (rect->y1 > b->y1) + b->y1 = rect->y1; + if (rect->x2 < b->x2) + b->x2 = rect->x2; + if (rect->y2 < b->y2) + b->y2 = rect->y2; + + if (b->x1 < b->x2 && b->y1 < b->y2) + b++; + } + else + b++; + + n++; } rmesa->sarea->nbox = n; @@ -474,18 +497,21 @@ void r200CopyBuffer( const __DRIdrawablePrivate *dPriv ) } UNLOCK_HARDWARE( rmesa ); - rmesa->hw.all_dirty = GL_TRUE; + if (!rect) + { + rmesa->hw.all_dirty = GL_TRUE; - rmesa->swap_count++; - (*dri_interface->getUST)( & ust ); - if ( missed_target ) { - rmesa->swap_missed_count++; - rmesa->swap_missed_ust = ust - rmesa->swap_ust; - } + rmesa->swap_count++; + (*dri_interface->getUST)( & ust ); + if ( missed_target ) { + rmesa->swap_missed_count++; + rmesa->swap_missed_ust = ust - rmesa->swap_ust; + } - rmesa->swap_ust = ust; + rmesa->swap_ust = ust; - sched_yield(); + sched_yield(); + } } void r200PageFlip( const __DRIdrawablePrivate *dPriv ) diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.h b/src/mesa/drivers/dri/r200/r200_ioctl.h index cf4188afe89..f53752739d2 100644 --- a/src/mesa/drivers/dri/r200/r200_ioctl.h +++ b/src/mesa/drivers/dri/r200/r200_ioctl.h @@ -90,7 +90,8 @@ extern void r200ReleaseDmaRegion( r200ContextPtr rmesa, struct r200_dma_region *region, const char *caller ); -extern void r200CopyBuffer( const __DRIdrawablePrivate *drawable ); +extern void r200CopyBuffer( const __DRIdrawablePrivate *drawable, + const drm_clip_rect_t *rect); extern void r200PageFlip( const __DRIdrawablePrivate *drawable ); extern void r200Flush( GLcontext *ctx ); extern void r200Finish( GLcontext *ctx ); diff --git a/src/mesa/drivers/dri/r300/radeon_context.c b/src/mesa/drivers/dri/r300/radeon_context.c index 0a957816dbf..4e351dd66b0 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.c +++ b/src/mesa/drivers/dri/r300/radeon_context.c @@ -231,7 +231,7 @@ void radeonSwapBuffers(__DRIdrawablePrivate * dPriv) if (radeon->doPageFlip) { radeonPageFlip(dPriv); } else { - radeonCopyBuffer(dPriv); + radeonCopyBuffer(dPriv, NULL); } } } else { @@ -241,6 +241,31 @@ void radeonSwapBuffers(__DRIdrawablePrivate * dPriv) } } +void radeonCopySubBuffer(__DRIdrawablePrivate * dPriv, + int x, int y, int w, int h ) +{ + if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { + radeonContextPtr radeon; + GLcontext *ctx; + + radeon = (radeonContextPtr) dPriv->driContextPriv->driverPrivate; + ctx = radeon->glCtx; + + if (ctx->Visual.doubleBufferMode) { + drm_clip_rect_t rect; + rect.x1 = x + dPriv->x; + rect.y1 = (dPriv->h - y - h) + dPriv->y; + rect.x2 = rect.x1 + w; + rect.y2 = rect.y1 + h; + _mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */ + radeonCopyBuffer(dPriv, &rect); + } + } else { + /* XXX this shouldn't be an error but we can't handle it for now */ + _mesa_problem(NULL, "%s: drawable has no context!", + __FUNCTION__); + } +} /* Force the context `c' to be the current context and associate with it * buffer `b'. diff --git a/src/mesa/drivers/dri/r300/radeon_context.h b/src/mesa/drivers/dri/r300/radeon_context.h index 671c14df030..4eeb4edcfd4 100644 --- a/src/mesa/drivers/dri/r300/radeon_context.h +++ b/src/mesa/drivers/dri/r300/radeon_context.h @@ -203,6 +203,8 @@ struct radeon_context { #define RADEON_CONTEXT(glctx) ((radeonContextPtr)(ctx->DriverCtx)) extern void radeonSwapBuffers(__DRIdrawablePrivate * dPriv); +extern void radeonCopySubBuffer(__DRIdrawablePrivate * dPriv, + int x, int y, int w, int h); extern GLboolean radeonInitContext(radeonContextPtr radeon, struct dd_function_table* functions, const __GLcontextModes * glVisual, diff --git a/src/mesa/drivers/dri/r300/radeon_ioctl.c b/src/mesa/drivers/dri/r300/radeon_ioctl.c index f5627628783..798e83c0107 100644 --- a/src/mesa/drivers/dri/r300/radeon_ioctl.c +++ b/src/mesa/drivers/dri/r300/radeon_ioctl.c @@ -164,7 +164,8 @@ static void radeonWaitForFrameCompletion(radeonContextPtr radeon) /* Copy the back color buffer to the front color buffer. */ -void radeonCopyBuffer(const __DRIdrawablePrivate * dPriv) +void radeonCopyBuffer(const __DRIdrawablePrivate * dPriv, + const drm_clip_rect_t * rect) { radeonContextPtr radeon; GLint nbox, i, ret; @@ -193,10 +194,13 @@ void radeonCopyBuffer(const __DRIdrawablePrivate * dPriv) * request at a time. */ radeonWaitForFrameCompletion(radeon); - UNLOCK_HARDWARE(radeon); - driWaitForVBlank(dPriv, &radeon->vbl_seq, radeon->vblank_flags, - &missed_target); - LOCK_HARDWARE(radeon); + if (!rect) + { + UNLOCK_HARDWARE(radeon); + driWaitForVBlank(dPriv, &radeon->vbl_seq, radeon->vblank_flags, + &missed_target); + LOCK_HARDWARE(radeon); + } nbox = dPriv->numClipRects; /* must be in locked region */ @@ -206,9 +210,28 @@ void radeonCopyBuffer(const __DRIdrawablePrivate * dPriv) drm_clip_rect_t *b = radeon->sarea->boxes; GLint n = 0; - for (; i < nr; i++) { - *b++ = box[i]; - n++; + for ( ; i < nr ; i++ ) { + + *b = box[i]; + + if (rect) + { + if (rect->x1 > b->x1) + b->x1 = rect->x1; + if (rect->y1 > b->y1) + b->y1 = rect->y1; + if (rect->x2 < b->x2) + b->x2 = rect->x2; + if (rect->y2 < b->y2) + b->y2 = rect->y2; + + if (b->x1 < b->x2 && b->y1 < b->y2) + b++; + } + else + b++; + + n++; } radeon->sarea->nbox = n; @@ -223,22 +246,24 @@ void radeonCopyBuffer(const __DRIdrawablePrivate * dPriv) } UNLOCK_HARDWARE(radeon); - - if (IS_R200_CLASS(radeon->radeonScreen)) + if (!rect) + { + if (IS_R200_CLASS(radeon->radeonScreen)) ((r200ContextPtr)radeon)->hw.all_dirty = GL_TRUE; - else + else ((r300ContextPtr)radeon)->hw.all_dirty = GL_TRUE; - radeon->swap_count++; - (*dri_interface->getUST) (&ust); - if (missed_target) { + radeon->swap_count++; + (*dri_interface->getUST) (&ust); + if (missed_target) { radeon->swap_missed_count++; radeon->swap_missed_ust = ust - radeon->swap_ust; - } + } - radeon->swap_ust = ust; + radeon->swap_ust = ust; - sched_yield(); + sched_yield(); + } } void radeonPageFlip(const __DRIdrawablePrivate * dPriv) diff --git a/src/mesa/drivers/dri/r300/radeon_ioctl.h b/src/mesa/drivers/dri/r300/radeon_ioctl.h index 4ddd776602d..b53767510e8 100644 --- a/src/mesa/drivers/dri/r300/radeon_ioctl.h +++ b/src/mesa/drivers/dri/r300/radeon_ioctl.h @@ -44,7 +44,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r200_context.h" #include "radeon_drm.h" -extern void radeonCopyBuffer(const __DRIdrawablePrivate * drawable); +extern void radeonCopyBuffer(const __DRIdrawablePrivate * drawable, + const drm_clip_rect_t * rect); extern void radeonPageFlip(const __DRIdrawablePrivate * drawable); extern void radeonFlush(GLcontext * ctx); extern void radeonFinish(GLcontext * ctx); diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index f546731ad44..791d1a37bc0 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -572,7 +572,7 @@ radeonSwapBuffers( __DRIdrawablePrivate *dPriv ) radeonPageFlip( dPriv ); } else { - radeonCopyBuffer( dPriv ); + radeonCopyBuffer( dPriv, NULL ); } } } @@ -582,6 +582,31 @@ radeonSwapBuffers( __DRIdrawablePrivate *dPriv ) } } +void radeonCopySubBuffer(__DRIdrawablePrivate * dPriv, + int x, int y, int w, int h ) +{ + if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { + radeonContextPtr radeon; + GLcontext *ctx; + + radeon = (radeonContextPtr) dPriv->driContextPriv->driverPrivate; + ctx = radeon->glCtx; + + if (ctx->Visual.doubleBufferMode) { + drm_clip_rect_t rect; + rect.x1 = x + dPriv->x; + rect.y1 = (dPriv->h - y - h) + dPriv->y; + rect.x2 = rect.x1 + w; + rect.y2 = rect.y1 + h; + _mesa_notifySwapBuffers(ctx); /* flush pending rendering comands */ + radeonCopyBuffer(dPriv, &rect); + } + } else { + /* XXX this shouldn't be an error but we can't handle it for now */ + _mesa_problem(NULL, "%s: drawable has no context!", + __FUNCTION__); + } +} /* Make context `c' the current context and bind it to the given * drawing and reading surfaces. diff --git a/src/mesa/drivers/dri/radeon/radeon_context.h b/src/mesa/drivers/dri/radeon/radeon_context.h index 09fa948ccba..9abd8667308 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_context.h @@ -850,6 +850,8 @@ extern GLboolean radeonCreateContext(const __GLcontextModes *glVisual, __DRIcontextPrivate *driContextPriv, void *sharedContextPrivate); extern void radeonSwapBuffers( __DRIdrawablePrivate *dPriv ); +extern void radeonCopySubBuffer(__DRIdrawablePrivate * dPriv, + int x, int y, int w, int h); extern GLboolean radeonMakeCurrent( __DRIcontextPrivate *driContextPriv, __DRIdrawablePrivate *driDrawPriv, __DRIdrawablePrivate *driReadPriv ); diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.c b/src/mesa/drivers/dri/radeon/radeon_ioctl.c index fa22cbd6f92..53f6f57057b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.c +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.c @@ -875,7 +875,8 @@ static void radeonWaitForFrameCompletion( radeonContextPtr rmesa ) /* Copy the back color buffer to the front color buffer. */ -void radeonCopyBuffer( const __DRIdrawablePrivate *dPriv ) +void radeonCopyBuffer( const __DRIdrawablePrivate *dPriv, + const drm_clip_rect_t *rect) { radeonContextPtr rmesa; GLint nbox, i, ret; @@ -899,9 +900,12 @@ void radeonCopyBuffer( const __DRIdrawablePrivate *dPriv ) * request at a time. */ radeonWaitForFrameCompletion( rmesa ); - UNLOCK_HARDWARE( rmesa ); - driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target ); - LOCK_HARDWARE( rmesa ); + if (!rect) + { + UNLOCK_HARDWARE( rmesa ); + driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target ); + LOCK_HARDWARE( rmesa ); + } nbox = dPriv->numClipRects; /* must be in locked region */ @@ -912,8 +916,27 @@ void radeonCopyBuffer( const __DRIdrawablePrivate *dPriv ) GLint n = 0; for ( ; i < nr ; i++ ) { - *b++ = box[i]; - n++; + + *b = box[i]; + + if (rect) + { + if (rect->x1 > b->x1) + b->x1 = rect->x1; + if (rect->y1 > b->y1) + b->y1 = rect->y1; + if (rect->x2 < b->x2) + b->x2 = rect->x2; + if (rect->y2 < b->y2) + b->y2 = rect->y2; + + if (b->x1 < b->x2 && b->y1 < b->y2) + b++; + } + else + b++; + + n++; } rmesa->sarea->nbox = n; @@ -927,15 +950,18 @@ void radeonCopyBuffer( const __DRIdrawablePrivate *dPriv ) } UNLOCK_HARDWARE( rmesa ); - rmesa->swap_count++; - (*dri_interface->getUST)( & ust ); - if ( missed_target ) { - rmesa->swap_missed_count++; - rmesa->swap_missed_ust = ust - rmesa->swap_ust; + if (!rect) + { + rmesa->swap_count++; + (*dri_interface->getUST)( & ust ); + if ( missed_target ) { + rmesa->swap_missed_count++; + rmesa->swap_missed_ust = ust - rmesa->swap_ust; + } + + rmesa->swap_ust = ust; + rmesa->hw.all_dirty = GL_TRUE; } - - rmesa->swap_ust = ust; - rmesa->hw.all_dirty = GL_TRUE; } void radeonPageFlip( const __DRIdrawablePrivate *dPriv ) diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.h b/src/mesa/drivers/dri/radeon/radeon_ioctl.h index dd7ed19b847..335ed77c9ad 100644 --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.h +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.h @@ -87,7 +87,8 @@ extern void radeonReleaseDmaRegion( radeonContextPtr rmesa, struct radeon_dma_region *region, const char *caller ); -extern void radeonCopyBuffer( const __DRIdrawablePrivate *drawable ); +extern void radeonCopyBuffer( const __DRIdrawablePrivate *drawable, + const drm_clip_rect_t *rect); extern void radeonPageFlip( const __DRIdrawablePrivate *drawable ); extern void radeonFlush( GLcontext *ctx ); extern void radeonFinish( GLcontext *ctx ); diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index a93cfb3821c..5257e541e5f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -716,6 +716,8 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) (*glx_enable_extension)( psc, "GLX_MESA_swap_frame_usage" ); if (IS_R200_CLASS(screen)) (*glx_enable_extension)( psc, "GLX_MESA_allocate_memory" ); + + (*glx_enable_extension)( psc, "GLX_MESA_copy_sub_buffer" ); } #if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200) @@ -923,7 +925,8 @@ static struct __DriverAPIRec radeonAPI = { .GetMSC = driGetMSC32, .WaitForMSC = driWaitForMSC32, .WaitForSBC = NULL, - .SwapBuffersMSC = NULL + .SwapBuffersMSC = NULL, + .CopySubBuffer = radeonCopySubBuffer, }; #else static const struct __DriverAPIRec r200API = { @@ -940,7 +943,8 @@ static const struct __DriverAPIRec r200API = { .GetMSC = driGetMSC32, .WaitForMSC = driWaitForMSC32, .WaitForSBC = NULL, - .SwapBuffersMSC = NULL + .SwapBuffersMSC = NULL, + .CopySubBuffer = r200CopySubBuffer }; #endif -- cgit v1.2.3 From 9305cba6a7dfe539e5c3b01f7b16fcf60cf20900 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 31 Mar 2006 17:31:22 +0000 Subject: bump version/date --- include/GL/gl.h | 4 ++-- include/GL/glx.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 75b24dcc31d..aca62af39bf 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.3 + * Version: 6.5 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), diff --git a/include/GL/glx.h b/include/GL/glx.h index f471d55e1f6..1f5d778e34b 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -2,7 +2,7 @@ * Mesa 3-D graphics library * Version: 6.5 * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2006 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"), -- cgit v1.2.3 From 3a3e63dc4fc8b34de7e61607d0d69cf3a77255ca Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Fri, 31 Mar 2006 20:53:12 +0000 Subject: DMesa now uses OSMesa as a back-end. --- Makefile.DJ | 11 +- docs/README.DJ | 26 +- include/GL/dmesa.h | 12 +- src/glut/dos/window.c | 6 +- src/mesa/Makefile.DJ | 4 +- src/mesa/drivers/dos/blit.S | 845 ++++++++++++++++++++++- src/mesa/drivers/dos/dmesa.c | 1428 +++++---------------------------------- src/mesa/drivers/dos/dpmi.c | 4 +- src/mesa/drivers/dos/internal.h | 36 +- src/mesa/drivers/dos/null.c | 8 +- src/mesa/drivers/dos/null.h | 4 +- src/mesa/drivers/dos/vesa.c | 800 +++++++++++++--------- src/mesa/drivers/dos/vesa.h | 22 +- src/mesa/drivers/dos/vga.c | 67 +- src/mesa/drivers/dos/vga.h | 4 +- src/mesa/drivers/dos/video.c | 343 ++-------- src/mesa/drivers/dos/video.h | 15 +- src/mesa/drivers/dos/virtual.S | 489 -------------- 18 files changed, 1700 insertions(+), 2424 deletions(-) delete mode 100644 src/mesa/drivers/dos/virtual.S (limited to 'include') diff --git a/Makefile.DJ b/Makefile.DJ index 78ebf43efb9..deaac09d181 100644 --- a/Makefile.DJ +++ b/Makefile.DJ @@ -20,9 +20,9 @@ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# DOS/DJGPP makefile v1.6 for Mesa +# DOS/DJGPP makefile for Mesa # -# Copyright (C) 2002 - Daniel Borca +# Author: Daniel Borca # Email : dborca@users.sourceforge.net # Web : http://www.geocities.com/dborca @@ -31,9 +31,6 @@ # Available options: # # Environment variables: -# GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++) -# or `mesa'. -# default = mesa # GLIDE path to Glide3 SDK; used with FX. # default = $(TOP)/glide3 # FX=1 build for 3dfx Glide3. Note that this disables @@ -57,8 +54,6 @@ .PHONY : all libgl libglu libglut clean realclean -GLU ?= mesa - CFLAGS = -Wall -W -pedantic CFLAGS += -O2 -ffast-math @@ -75,7 +70,7 @@ all: libgl libglu libglut libgl: lib $(MAKE) -f Makefile.DJ -C src/mesa libglu: lib - $(MAKE) -f Makefile.DJ -C src/glu/$(GLU) + $(MAKE) -f Makefile.DJ -C src/glu/sgi libglut: lib $(MAKE) -f Makefile.DJ -C src/glut/dos diff --git a/docs/README.DJ b/docs/README.DJ index 7180223c248..8038c287642 100644 --- a/docs/README.DJ +++ b/docs/README.DJ @@ -1,4 +1,4 @@ - Mesa 6.3 DOS/DJGPP Port v1.7 + Mesa 6.5 DOS/DJGPP Port v1.8 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -7,8 +7,7 @@ Description: ~~~~~~~~~~~~ Well, guess what... this is the DOS port of Mesa 6.3, for DJGPP fans... Whoa! -The driver has its origins in ddsample.c, written by Brian Paul and found by me -in Mesa 3.4.2. +The driver uses OSMesa to draw off screen, and then blits the buffer. @@ -32,9 +31,6 @@ Available options: Environment variables: CPU optimize for the given processor. default = pentium - GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++) - or `mesa'. - default = mesa GLIDE path to Glide3 SDK; used with FX. default = $(TOP)/glide3 FX=1 build for 3dfx Glide3. Note that this disables @@ -56,11 +52,9 @@ Available options: Tested on: - CPU: AMD Athlon XP 1800+ - Mainboard: GA-7VTXE w/ 512 MB DDRAM - Video card: Voodoo5 6000 AGP w/ 128 MB SDRAM - DJGPP: djdev 2.04 + gcc v3.4.3 + make v3.80 - OS: DOS and Win98SE + Video card: Radeon 9500 + DJGPP: djdev 2.04 + gcc v4.1.0 + make v3.80 + OS: DOS, Win98SE, WinXP (using Videoport driver) @@ -98,7 +92,7 @@ FAQ: Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better... A) Is that a question? If you have a 3dfx Voodoo (any model), you're lucky (check http://sourceforge.net/projects/glide for the DJGPP port). - If you haven't, sorry; everything is done in software. Suggestions? + If you haven't, sorry; everything is done in software. Q) I tried to set refresh rate w/ DMesa, but without success. A) Refresh rate control works only for VESA 3.0 and the 3dfx driver (in @@ -107,7 +101,8 @@ FAQ: Q) I made a simple application and it does nothing. It exits right away. Not even a blank screen. - A) Pure software drivers (VESA/VGA/NUL) support only double-buffered modes. + A) Software drivers (VESA/VGA/NUL) must to be constructed as single-buffered + visuals. However, DMesaSwapBuffers must be called to get any output. A) Another weird "feature" is that buffer width must be multiple of 8 (I'm a lazy programmer and I found that the easiest way to keep buffer handling at peak performance ;-). @@ -265,6 +260,11 @@ v1.7 (???-2005) * no more GLX sources in DOS GLUT * made GLUT timer callbacks less accurate but safer +v1.8 (apr-2006) + * killed lots of code, the driver is now a front-end to OSMesa + * fixed problem with WinNT (http://www.volny.cz/martin.sulak/) + - removed 3dfx Glide3 support (temporarily?) + Contact: diff --git a/include/GL/dmesa.h b/include/GL/dmesa.h index e67b3426f93..358082e3ea1 100644 --- a/include/GL/dmesa.h +++ b/include/GL/dmesa.h @@ -23,9 +23,9 @@ */ /* - * DOS/DJGPP device driver v1.7 for Mesa + * DOS/DJGPP device driver for Mesa * - * Copyright (C) 2002 - Daniel Borca + * Author: Daniel Borca * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca */ @@ -35,7 +35,7 @@ #define DMESA_H_included #define DMESA_MAJOR_VERSION 6 -#define DMESA_MINOR_VERSION 3 +#define DMESA_MINOR_VERSION 5 /* Sample Usage: * @@ -138,7 +138,7 @@ void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue); /* * DMesa functions */ -typedef void (*DMesaProc) (void); +typedef void (*DMesaProc) (); DMesaProc DMesaGetProcAddress (const char *name); /* @@ -149,8 +149,8 @@ DMesaProc DMesaGetProcAddress (const char *name); #define DMESA_GET_VIDEO_MODES 0x0300 #define DMESA_GET_BUFFER_ADDR 0x0400 -#define DMESA_DRIVER_SWDB_BIT 0x1 /* software double-buffered */ -#define DMESA_DRIVER_LLWO_BIT 0x2 /* lower-left window origin */ +#define DMESA_DRIVER_DBL_BIT 0x1 /* double-buffered */ +#define DMESA_DRIVER_YUP_BIT 0x2 /* lower-left window origin */ int DMesaGetIntegerv (GLenum pname, GLint *params); #ifdef __cplusplus diff --git a/src/glut/dos/window.c b/src/glut/dos/window.c index b922746a9e2..610cf36dcc6 100644 --- a/src/glut/dos/window.c +++ b/src/glut/dos/window.c @@ -66,6 +66,10 @@ glutCreateWindow (const char *title) int i; int m8width = (_glut_default.width + 7) & ~7; + if (!(_glut_default.mode & GLUT_DOUBLE)) { + return 0; + } + /* We set the Visual once. This will be our desktop (graphic mode). * We should do this in the `glutInit' code, but we don't have any idea * about its geometry. Supposedly, when we are about to create one @@ -73,7 +77,7 @@ glutCreateWindow (const char *title) */ if (!visual) { if ((visual=DMesaCreateVisual(_glut_default.x + m8width, _glut_default.y + _glut_default.height, _glut_visual.bpp, _glut_visual.refresh, - _glut_default.mode & GLUT_DOUBLE, + GLUT_SINGLE, !(_glut_default.mode & GLUT_INDEX), (_glut_default.mode & GLUT_ALPHA ) ? _glut_visual.alpha : 0, (_glut_default.mode & GLUT_DEPTH ) ? _glut_visual.depth : 0, diff --git a/src/mesa/Makefile.DJ b/src/mesa/Makefile.DJ index 53c4370703e..06a13fb1abd 100644 --- a/src/mesa/Makefile.DJ +++ b/src/mesa/Makefile.DJ @@ -103,8 +103,8 @@ DRIVER_SOURCES += \ $(GLIDE_DRIVER_SOURCES) else DRIVER_SOURCES += \ + $(OSMESA_DRIVER_SOURCES) \ drivers/dos/video.c \ - drivers/dos/virtual.S \ drivers/dos/vesa.c \ drivers/dos/blit.S \ drivers/dos/vga.c \ @@ -112,8 +112,6 @@ DRIVER_SOURCES += \ drivers/dos/dpmi.c endif -#DRIVER_SOURCES += $(OSMESA_DRIVER_SOURCES) - SOURCES = $(CORE_SOURCES) $(X86_SOURCES) $(COMMON_DRIVER_SOURCES) $(DRIVER_SOURCES) OBJECTS = $(addsuffix .o,$(basename $(SOURCES))) diff --git a/src/mesa/drivers/dos/blit.S b/src/mesa/drivers/dos/blit.S index f5888c7e395..02dc8400d8d 100644 --- a/src/mesa/drivers/dos/blit.S +++ b/src/mesa/drivers/dos/blit.S @@ -23,9 +23,9 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa + * DOS/DJGPP device driver for Mesa * - * Copyright (C) 2002 - Borca Daniel + * Author: Daniel Borca * Email : dborca@yahoo.com * Web : http://www.geocities.com/dborca */ @@ -197,3 +197,844 @@ _vesa_l_dump_virtual_mmx: emms #endif ret + + + +#define CVT_32_TO_16(s, tmp) \ + /* SRC = bbbbbbbbggggggggrrrrrrrr******** */\ + movl %e##s##x, %tmp ;\ + /* TMP = bbbbbbbbggggggggrrrrrrrr******** */\ + shrb $2, %s##h ;\ + /* SRC = bbbbbbbbgggggg00rrrrrrrr******** */\ + andl $0xF80000, %tmp ;\ + /* TMP = 0000000000000000000rrrrr00000000 */\ + shrw $3, %s##x ;\ + /* SRC = bbbbbgggggg00000rrrrrrrr******** */\ + shrl $8, %tmp ;\ + /* TMP = 00000000000rrrrr0000000000000000 */\ + orl %tmp, %e##s##x ;\ + /* SRC = bbbbbggggggrrrrrrrrrrrrr******** */ + +#define CVT_32_TO_15(s, tmp) \ + /* SRC = bbbbbbbbggggggggrrrrrrrr******** */\ + movl %e##s##x, %tmp ;\ + /* TMP = bbbbbbbbggggggggrrrrrrrr******** */\ + shrb $3, %s##h ;\ + /* SRC = bbbbbbbbgggggg00rrrrrrrr******** */\ + andl $0xF80000, %tmp ;\ + /* TMP = 0000000000000000000rrrrr00000000 */\ + shrw $3, %s##x ;\ + /* SRC = bbbbbgggggg00000rrrrrrrr******** */\ + shrl $9, %tmp ;\ + /* TMP = 00000000000rrrrr0000000000000000 */\ + orl %tmp, %e##s##x ;\ + /* SRC = bbbbbggggggrrrrrrrrrrrrr******** */ + +#define CVT_16_TO_15(src, tmp) \ + /* SRC = bbbbbggggggrrrrrBBBBBGGGGGGRRRRR */\ + movl %src, %tmp ;\ + /* TMP = bbbbbggggggrrrrrBBBBBGGGGGGRRRRR */\ + andl $0x1F001F, %src ;\ + /* SRC = bbbbb00000000000BBBBB00000000000 */\ + andl $0xFFC0FFC0, %tmp ;\ + /* TMP = 000000gggggrrrrr000000GGGGGRRRRR */\ + shrl %tmp ;\ + /* TMP = 00000gggggrrrrr000000GGGGGRRRRR0 */\ + orl %tmp, %src ;\ + /* SRC = bbbbbgggggrrrrr0BBBBBGGGGGRRRRR0 */\ + + + +/* transform BGRA to BGR */ + .p2align 5,,31 + .global _vesa_l_dump_32_to_24 +_vesa_l_dump_32_to_24: + pushl %ebx + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %ecx + 1: + movl (%esi), %eax + addl $4, %esi + movw %ax, %fs:(%edi) + shrl $16, %eax + movb %al, %fs:2(%edi) + addl $3, %edi + subl $3, %ecx + jnz 1b + popl %ecx + addl %ebx, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %ebx + ret + +/* transform BGRA to B5G6R5 */ + .p2align 5,,31 + .global _vesa_l_dump_32_to_16 +_vesa_l_dump_32_to_16: + pushl %ebp + pushl %ebx + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %ecx + 1: + movl (%esi), %eax + addl $4, %esi + CVT_32_TO_16(a, ebp) + movw %ax, %fs:(%edi) + addl $2, %edi + subl $2, %ecx + jnz 1b + popl %ecx + addl %ebx, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %ebx + popl %ebp + ret + +/* transform BGRA to B5G5R5 */ + .p2align 5,,31 + .global _vesa_l_dump_32_to_15 +_vesa_l_dump_32_to_15: + pushl %ebp + pushl %ebx + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %ecx + 1: + movl (%esi), %eax + addl $4, %esi + CVT_32_TO_15(a, ebp) + movw %ax, %fs:(%edi) + addl $2, %edi + subl $2, %ecx + jnz 1b + popl %ecx + addl %ebx, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %ebx + popl %ebp + ret + +/* transform BGRA to fake8 */ + .p2align 5,,31 + .global _vesa_l_dump_32_to_8 +_vesa_l_dump_32_to_8: + pushl %ebp + pushl %ebx + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %edx + pushl %ecx + pushl %ebx + 1: + movl (%esi), %eax + addl $4, %esi +#if 1 + xorl %ebx, %ebx + movl %eax, %edx + movb %ah, %bl + shrl $16, %edx + andl $0xFF, %edx + andl $0xFF, %eax + + movb _array_b(%eax), %al + movb _array_r(%edx), %dl + movb _array_g(%ebx), %bl + + imull $36, %eax + imull $6, %ebx + addl %edx, %eax + addl %ebx, %eax +#endif + movb %al, %fs:(%edi) + incl %edi + decl %ecx + jnz 1b + popl %ebx + popl %ecx + popl %edx + addl %ebx, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %ebx + popl %ebp + ret + +/* transform BGR to BGRx */ + .p2align 5,,31 + .global _vesa_l_dump_24_to_32 +_vesa_l_dump_24_to_32: + pushl %ebx + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %ecx + 1: + movl (%esi), %eax + addl $3, %esi + movl %eax, %fs:(%edi) + addl $4, %edi + subl $4, %ecx + jnz 1b + popl %ecx + addl %ebx, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %ebx + ret + +/* transform BGR to fake8 */ + .p2align 5,,31 + .global _vesa_l_dump_24_to_8 +_vesa_l_dump_24_to_8: + pushl %ebp + pushl %ebx + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %edx + pushl %ecx + pushl %ebx + 1: + movl (%esi), %eax + addl $3, %esi +#if 1 + xorl %ebx, %ebx + movl %eax, %edx + movb %ah, %bl + shrl $16, %edx + andl $0xFF, %edx + andl $0xFF, %eax + + movb _array_b(%eax), %al + movb _array_r(%edx), %dl + movb _array_g(%ebx), %bl + + imull $36, %eax + imull $6, %ebx + addl %edx, %eax + addl %ebx, %eax +#endif + movb %al, %fs:(%edi) + incl %edi + decl %ecx + jnz 1b + popl %ebx + popl %ecx + popl %edx + addl %ebx, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %ebx + popl %ebp + ret + +/* transform B5G6R5 to B5G5R5 */ + .p2align 5,,31 + .global _vesa_l_dump_16_to_15 +_vesa_l_dump_16_to_15: + pushl %ebp + pushl %ebx + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %ecx + 1: + movl (%esi), %eax + addl $4, %esi + CVT_16_TO_15(eax, ebp) + movl %eax, %fs:(%edi) + addl $4, %edi + subl $4, %ecx + jnz 1b + popl %ecx + addl %ebx, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %ebx + popl %ebp + ret + +/* transform B5G6R5 to fake8 */ + .p2align 5,,31 + .global _vesa_l_dump_16_to_8 +_vesa_l_dump_16_to_8: + pushl %ebp + pushl %ebx + pushl %esi + pushl %edi + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vl_current_stride, %ecx + movl _vl_current_height, %edx + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %ecx + pushl %ebx + 1: + movl (%esi), %eax + addl $4, %esi +#if 1 + movl %eax, %ebx + andl $0xFFFF, %eax + shrl $16, %ebx + movb _tab_16_8(%eax), %al + movb _tab_16_8(%ebx), %ah +#endif + movw %ax, %fs:(%edi) + addl $2, %edi + subl $2, %ecx + jnz 1b + popl %ebx + popl %ecx + addl %ebx, %edi + decl %edx + jnz 0b + popl %edi + popl %esi + popl %ebx + popl %ebp + ret + + + + .p2align 5,,31 + .global _vesa_b_dump_32_to_24 +_vesa_b_dump_32_to_24: + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + movl $0x00FFFFFF, %ebx + .balign 4 + 0: + pushl %eax + pushl %ecx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + pushl %ebx + incl %edx + xorl %ebx, %ebx + call *_vesa_swbank + popl %ebx + subl %ebp, %edi + .balign 4 + 2: + movb (%esi), %al /* XXX too many accesses */ + incl %esi + rorl $8, %ebx + jnc 2b + movb %al, %fs:(%edi) + incl %edi + decl %ecx + jnz 1b + popl %ecx + popl %eax + addl _vl_current_delta, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + + .p2align 5,,31 + .global _vesa_b_dump_32_to_16 +_vesa_b_dump_32_to_16: + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + .balign 4 + 0: + pushl %eax + pushl %ecx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + incl %edx + xorl %ebx, %ebx + call *_vesa_swbank + subl %ebp, %edi + .balign 4 + 2: + movl (%esi), %eax + addl $4, %esi + CVT_32_TO_16(a, ebx) + movw %ax, %fs:(%edi) + addl $2, %edi + subl $2, %ecx + jnz 1b + popl %ecx + popl %eax + addl _vl_current_delta, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + + .p2align 5,,31 + .global _vesa_b_dump_32_to_15 +_vesa_b_dump_32_to_15: + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + .balign 4 + 0: + pushl %eax + pushl %ecx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + incl %edx + xorl %ebx, %ebx + call *_vesa_swbank + subl %ebp, %edi + .balign 4 + 2: + movl (%esi), %eax + addl $4, %esi + CVT_32_TO_15(a, ebx) + movw %ax, %fs:(%edi) + addl $2, %edi + subl $2, %ecx + jnz 1b + popl %ecx + popl %eax + addl _vl_current_delta, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + + .p2align 5,,31 + .global _vesa_b_dump_32_to_8 +_vesa_b_dump_32_to_8: + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + .balign 4 + 0: + pushl %eax + pushl %ecx + pushl %edx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + popl %edx + incl %edx + pushl %edx + xorl %ebx, %ebx + call *_vesa_swbank + subl %ebp, %edi + .balign 4 + 2: + movl (%esi), %eax + addl $4, %esi +#if 1 + xorl %ebx, %ebx + movl %eax, %edx + movb %ah, %bl + shrl $16, %edx + andl $0xFF, %edx + andl $0xFF, %eax + + movb _array_b(%eax), %al + movb _array_r(%edx), %dl + movb _array_g(%ebx), %bl + + imull $36, %eax + imull $6, %ebx + addl %edx, %eax + addl %ebx, %eax +#endif + movb %al, %fs:(%edi) + incl %edi + decl %ecx + jnz 1b + popl %edx + popl %ecx + popl %eax + addl _vl_current_delta, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + + .p2align 5,,31 + .global _vesa_b_dump_24_to_32 +_vesa_b_dump_24_to_32: + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %eax + pushl %ecx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + pushl %ebx + incl %edx + xorl %ebx, %ebx + call *_vesa_swbank + popl %ebx + subl %ebp, %edi + .balign 4 + 2: + movl (%esi), %eax + addl $3, %esi + movl %eax, %fs:(%edi) + addl $4, %edi + subl $4, %ecx + jnz 1b + popl %ecx + popl %eax + addl %ebx, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + + .p2align 5,,31 + .global _vesa_b_dump_24_to_8 +_vesa_b_dump_24_to_8: + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + .balign 4 + 0: + pushl %eax + pushl %ecx + pushl %edx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + popl %edx + incl %edx + pushl %edx + xorl %ebx, %ebx + call *_vesa_swbank + subl %ebp, %edi + .balign 4 + 2: + movl (%esi), %eax + addl $3, %esi +#if 1 + xorl %ebx, %ebx + movl %eax, %edx + movb %ah, %bl + shrl $16, %edx + andl $0xFF, %edx + andl $0xFF, %eax + + movb _array_b(%eax), %al + movb _array_r(%edx), %dl + movb _array_g(%ebx), %bl + + imull $36, %eax + imull $6, %ebx + addl %edx, %eax + addl %ebx, %eax +#endif + movb %al, %fs:(%edi) + incl %edi + decl %ecx + jnz 1b + popl %edx + popl %ecx + popl %eax + addl _vl_current_delta, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + + .p2align 5,,31 + .global _vesa_b_dump_16_to_15 +_vesa_b_dump_16_to_15: + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + .balign 4 + 0: + pushl %eax + pushl %ecx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + incl %edx + xorl %ebx, %ebx + call *_vesa_swbank + subl %ebp, %edi + .balign 4 + 2: + movw (%esi), %ax + addl $2, %esi + CVT_16_TO_15(eax, ebx) + movw %ax, %fs:(%edi) + addl $2, %edi + subl $2, %ecx + jnz 1b + popl %ecx + popl %eax + addl _vl_current_delta, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + ret + + .p2align 5,,31 + .global _vesa_b_dump_16_to_8 +_vesa_b_dump_16_to_8: + pushl %ebx + pushl %esi + pushl %edi + pushl %ebp + movl _vl_video_selector, %fs + movl _vl_current_draw_buffer, %esi + movl _vl_current_offset, %edi + movl _vesa_gran_shift, %ecx + movl _vesa_gran_mask, %ebp + movl %edi, %edx + xorl %ebx, %ebx + andl %ebp, %edi + shrl %cl, %edx + incl %ebp + call *_vesa_swbank + movl _vl_current_stride, %ecx + movl _vl_current_height, %eax + movl _vl_current_delta, %ebx + .balign 4 + 0: + pushl %eax + pushl %ecx + .balign 4 + 1: + cmpl %ebp, %edi + jb 2f + pushl %ebx + incl %edx + xorl %ebx, %ebx + call *_vesa_swbank + popl %ebx + subl %ebp, %edi + .balign 4 + 2: + movw (%esi), %ax + addl $2, %esi +#if 1 + andl $0xFFFF, %eax + movb _tab_16_8(%eax), %al +#endif + movb %al, %fs:(%edi) + addl $1, %edi + subl $1, %ecx + jnz 1b + popl %ecx + popl %eax + addl %ebx, %edi + decl %eax + jnz 0b + popl %ebp + popl %edi + popl %esi + popl %ebx + ret diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index 719f4ec54da..ee87e638529 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -23,922 +23,60 @@ */ /* - * DOS/DJGPP device driver v1.7 for Mesa + * DOS/DJGPP device driver for Mesa * - * Copyright (c) 2003 - Daniel Borca + * Author: Daniel Borca * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca */ -#include "glheader.h" #include "context.h" #include "imports.h" -#ifndef FX -#include "bufferobj.h" -#include "buffers.h" -#include "extensions.h" -#include "macros.h" -#include "matrix.h" #include "mtypes.h" -#include "texformat.h" -#include "teximage.h" -#include "texstore.h" -#include "array_cache/acache.h" -#include "swrast/s_context.h" -#include "swrast/s_depth.h" -#include "swrast/s_lines.h" -#include "swrast/s_triangle.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" -#include "drivers/common/driverfuncs.h" + #include "video.h" -#else /* FX */ -#include "GL/fxmesa.h" -#endif /* FX */ +#include "GL/osmesa.h" #include "GL/dmesa.h" -#define SWTC 0 /* SW texture compression */ - - /* - * In C++ terms, this class derives from the GLvisual class. - * Add system-specific fields to it. + * This has nothing to do with Mesa Visual structure. + * We keep this one around for backwards compatibility, + * and to store video mode data for DMesaCreateContext. */ struct dmesa_visual { - GLvisual gl_visual; - GLboolean sw_alpha; /* use Mesa's alpha buffer? */ - int z_buffer; /* Z=buffer: 0=no, 1=SW, -1=HW */ + GLenum format; /* OSMesa framebuffer format */ + GLint depthBits; + GLint stencilBits; + GLint accumBits; }; /* - * In C++ terms, this class derives from the GLframebuffer class. - * Add system-specific fields to it. + * This has nothing to do with Mesa Buffer structure. + * We keep this one around for backwards compatibility, + * and to store various data. */ struct dmesa_buffer { - GLframebuffer gl_buffer; /* The depth, stencil, accum, etc buffers */ - void *the_window; /* your window handle, etc */ - - int xpos, ypos; /* position */ - int width, height; /* size in pixels */ + int xpos, ypos; /* position */ + int width, height; /* size in pixels */ + GLenum type; + void *the_window; /* your window handle, etc */ }; /* - * In C++ terms, this class derives from the GLcontext class. - * Add system-specific fields to it. + * This has nothing to do with Mesa Context structure. + * We keep this one around for backwards compatibility, + * and to store real off-screen context. */ struct dmesa_context { - GLcontext gl_ctx; /* the core library context */ - DMesaVisual visual; - DMesaBuffer buffer; - GLuint ClearColor; - GLuint ClearIndex; - /* etc... */ + OSMesaContext osmesa; + DMesaBuffer buffer; }; -/* - * SPAN FUNCTIONS - * XXX: These need to be updated to take the new gl_renderbuffer parameter - * introduced in Mesa 6.3. That parameter will indicate whether the front - * or back color buffer is to be read/written. - */ - -#ifndef FX -/**************************************************************************** - * Read/Write pixels - ***************************************************************************/ -#define FLIP(y) (dmesa->buffer->height - (y) - 1) -#define FLIP2(y) (_b_ - (y)) - -#define DSTRIDE dmesa->buffer->width - -/**************************************************************************** - * RGB[A] - ***************************************************************************/ -static void -write_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLubyte rgba[][4], const GLubyte mask[]) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, offset; - - offset = DSTRIDE * FLIP(y) + x; - if (mask) { - /* draw some pixels */ - for (i = 0; i < n; i++, offset++) { - if (mask[i]) { - vl_putpixel(offset, vl_mixrgba(rgba[i])); - } - } - } else { - /* draw all pixels */ - for (i = 0; i < n; i++, offset++) { - vl_putpixel(offset, vl_mixrgba(rgba[i])); - } - } -} - - -static void -write_rgb_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLubyte rgb[][3], const GLubyte mask[]) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, offset; - - offset = DSTRIDE * FLIP(y) + x; - if (mask) { - /* draw some pixels */ - for (i = 0; i < n; i++, offset++) { - if (mask[i]) { - vl_putpixel(offset, vl_mixrgb(rgb[i])); - } - } - } else { - /* draw all pixels */ - for (i = 0; i < n; i++, offset++) { - vl_putpixel(offset, vl_mixrgb(rgb[i])); - } - } -} - - -static void -write_mono_rgba_span (const GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLchan color[4], const GLubyte mask[]) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, offset, rgba = vl_mixrgba(color); - - offset = DSTRIDE * FLIP(y) + x; - if (mask) { - /* draw some pixels */ - for (i = 0; i < n; i++, offset++) { - if (mask[i]) { - vl_putpixel(offset, rgba); - } - } - } else { - /* draw all pixels */ - for (i = 0; i < n; i++, offset++) { - vl_putpixel(offset, rgba); - } - } -} - - -static void -read_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y, - GLubyte rgba[][4]) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, offset; - - offset = DSTRIDE * FLIP(y) + x; - /* read all pixels */ - for (i = 0; i < n; i++, offset++) { - vl_getrgba(offset, rgba[i]); - } -} - - -static void -write_rgba_pixels (const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - const GLubyte rgba[][4], const GLubyte mask[]) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, _w_ = DSTRIDE, _b_ = dmesa->buffer->height - 1; - - if (mask) { - /* draw some pixels */ - for (i = 0; i < n; i++) { - if (mask[i]) { - vl_putpixel(FLIP2(y[i])*_w_ + x[i], vl_mixrgba(rgba[i])); - } - } - } else { - /* draw all pixels */ - for (i = 0; i < n; i++) { - vl_putpixel(FLIP2(y[i])*_w_ + x[i], vl_mixrgba(rgba[i])); - } - } -} - - -static void -write_mono_rgba_pixels (const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - const GLchan color[4], const GLubyte mask[]) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, _w_ = DSTRIDE, _b_ = dmesa->buffer->height - 1, rgba = vl_mixrgba(color); - - if (mask) { - /* draw some pixels */ - for (i = 0; i < n; i++) { - if (mask[i]) { - vl_putpixel(FLIP2(y[i])*_w_ + x[i], rgba); - } - } - } else { - /* draw all pixels */ - for (i = 0; i < n; i++) { - vl_putpixel(FLIP2(y[i])*_w_ + x[i], rgba); - } - } -} - - -static void -read_rgba_pixels (const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - GLubyte rgba[][4], const GLubyte mask[]) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, _w_ = DSTRIDE, _b_ = dmesa->buffer->height - 1; - - if (mask) { - /* read some pixels */ - for (i = 0; i < n; i++) { - if (mask[i]) { - vl_getrgba(FLIP2(y[i])*_w_ + x[i], rgba[i]); - } - } - } else { - /* read all pixels */ - for (i = 0; i < n; i++) { - vl_getrgba(FLIP2(y[i])*_w_ + x[i], rgba[i]); - } - } -} - - -/**************************************************************************** - * Index - ***************************************************************************/ -static void -write_index_span (const GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const GLuint index[], const GLubyte mask[]) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, offset; - - offset = DSTRIDE * FLIP(y) + x; - if (mask) { - /* draw some pixels */ - for (i = 0; i < n; i++, offset++) { - if (mask[i]) { - vl_putpixel(offset, index[i]); - } - } - } else { - /* draw all pixels */ - for (i = 0; i < n; i++, offset++) { - vl_putpixel(offset, index[i]); - } - } -} - - -static void -write_index8_span (const GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const GLubyte index[], const GLubyte mask[]) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, offset; - - offset = DSTRIDE * FLIP(y) + x; - if (mask) { - /* draw some pixels */ - for (i = 0; i < n; i++, offset++) { - if (mask[i]) { - vl_putpixel(offset, index[i]); - } - } - } else { - /* draw all pixels */ - for (i = 0; i < n; i++, offset++) { - vl_putpixel(offset, index[i]); - } - } -} - - -static void -write_mono_index_span (const GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - GLuint colorIndex, const GLubyte mask[]) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, offset; - - offset = DSTRIDE * FLIP(y) + x; - if (mask) { - /* draw some pixels */ - for (i = 0; i < n; i++, offset++) { - if (mask[i]) { - vl_putpixel(offset, colorIndex); - } - } - } else { - /* draw all pixels */ - for (i = 0; i < n; i++, offset++) { - vl_putpixel(offset, colorIndex); - } - } -} - - -static void -read_index_span (const GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, GLuint index[]) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, offset; - - offset = DSTRIDE * FLIP(y) + x; - /* read all pixels */ - for (i = 0; i < n; i++, offset++) { - index[i] = vl_getpixel(offset); - } -} - - -static void -write_index_pixels (const GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, const GLint x[], const GLint y[], - const GLuint index[], const GLubyte mask[]) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, _w_ = DSTRIDE, _b_ = dmesa->buffer->height - 1; - - if (mask) { - /* draw some pixels */ - for (i = 0; i < n; i++) { - if (mask[i]) { - vl_putpixel(FLIP2(y[i])*_w_ + x[i], index[i]); - } - } - } else { - /* draw all pixels */ - for (i = 0; i < n; i++) { - vl_putpixel(FLIP2(y[i])*_w_ + x[i], index[i]); - } - } -} - - -static void -write_mono_index_pixels (const GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, const GLint x[], const GLint y[], - GLuint colorIndex, const GLubyte mask[]) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, _w_ = DSTRIDE, _b_ = dmesa->buffer->height - 1; - - if (mask) { - /* draw some pixels */ - for (i = 0; i < n; i++) { - if (mask[i]) { - vl_putpixel(FLIP2(y[i])*_w_ + x[i], colorIndex); - } - } - } else { - /* draw all pixels */ - for (i = 0; i < n; i++) { - vl_putpixel(FLIP2(y[i])*_w_ + x[i], colorIndex); - } - } -} - - -static void -read_index_pixels (const GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, const GLint x[], const GLint y[], - GLuint index[], const GLubyte mask[]) -{ - const DMesaContext dmesa = (DMesaContext)ctx; - GLuint i, _w_ = DSTRIDE, _b_ = dmesa->buffer->height - 1; - - if (mask) { - /* read some pixels */ - for (i = 0; i < n; i++) { - if (mask[i]) { - index[i] = vl_getpixel(FLIP2(y[i])*_w_ + x[i]); - } - } - } else { - /* read all pixels */ - for (i = 0; i < n; i++) { - index[i] = vl_getpixel(FLIP2(y[i])*_w_ + x[i]); - } - } -} - - -/**************************************************************************** - * Z-buffer - ***************************************************************************/ - - -/**************************************************************************** - * Optimized triangle rendering - ***************************************************************************/ - -/* - * NON-depth-buffered flat triangle. - */ -#define NAME tri_rgb_flat - -#define SETUP_CODE \ - const DMesaContext dmesa = (DMesaContext)ctx;\ - GLuint _b_ = dmesa->buffer->height - 1; \ - GLuint _w_ = dmesa->buffer->width; \ - GLuint rgb = vl_mixrgb(v2->color); - -#define RENDER_SPAN(span) \ - GLuint i, offset = FLIP2(span.y)*_w_ + span.x;\ - for (i = 0; i < span.end; i++, offset++) { \ - vl_putpixel(offset, rgb); \ - } - -#include "swrast/s_tritemp.h" - - -/* - * Z-less flat triangle. - */ -#define NAME tri_rgb_flat_zless - -#define INTERP_Z 1 -#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE - -#define SETUP_CODE \ - const DMesaContext dmesa = (DMesaContext)ctx; \ - GLuint _b_ = dmesa->buffer->height - 1; \ - GLuint _w_ = dmesa->buffer->width; \ - GLuint rgb = vl_mixrgb(v2->color); - -#define RENDER_SPAN(span) \ - GLuint i, offset = FLIP2(span.y)*_w_ + span.x;\ - for (i = 0; i < span.end; i++, offset++) { \ - const DEPTH_TYPE z = FixedToDepth(span.z);\ - if (z < zRow[i]) { \ - vl_putpixel(offset, rgb); \ - zRow[i] = z; \ - } \ - span.z += span.zStep; \ - } - -#include "swrast/s_tritemp.h" - - -/* - * NON-depth-buffered iterated triangle. - */ -#define NAME tri_rgb_iter - -#define INTERP_RGB 1 - -#define SETUP_CODE \ - const DMesaContext dmesa = (DMesaContext)ctx;\ - GLuint _b_ = dmesa->buffer->height - 1; \ - GLuint _w_ = dmesa->buffer->width; - -#define RENDER_SPAN(span) \ - GLuint i, offset = FLIP2(span.y)*_w_ + span.x; \ - for (i = 0; i < span.end; i++, offset++) { \ - vl_putpixel(offset, vl_mixfix(span.red, span.green, span.blue)); \ - span.red += span.redStep; \ - span.green += span.greenStep; \ - span.blue += span.blueStep; \ - } - -#include "swrast/s_tritemp.h" - - -/* - * Z-less iterated triangle. - */ -#define NAME tri_rgb_iter_zless - -#define INTERP_Z 1 -#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define INTERP_RGB 1 - -#define SETUP_CODE \ - const DMesaContext dmesa = (DMesaContext)ctx;\ - GLuint _b_ = dmesa->buffer->height - 1; \ - GLuint _w_ = dmesa->buffer->width; - -#define RENDER_SPAN(span) \ - GLuint i, offset = FLIP2(span.y)*_w_ + span.x; \ - for (i = 0; i < span.end; i++, offset++) { \ - const DEPTH_TYPE z = FixedToDepth(span.z); \ - if (z < zRow[i]) { \ - vl_putpixel(offset, vl_mixfix(span.red, span.green, span.blue));\ - zRow[i] = z; \ - } \ - span.red += span.redStep; \ - span.green += span.greenStep; \ - span.blue += span.blueStep; \ - span.z += span.zStep; \ - } - -#include "swrast/s_tritemp.h" - - -/* - * Analyze context state to see if we can provide a fast triangle function - * Otherwise, return NULL. - */ -static swrast_tri_func -dmesa_choose_tri_function (GLcontext *ctx) -{ - const SWcontext *swrast = SWRAST_CONTEXT(ctx); - - if ((ctx->RenderMode != GL_RENDER) - || (ctx->Polygon.SmoothFlag) - || (ctx->Polygon.StippleFlag) - || (ctx->Texture._EnabledUnits) - || (swrast->_RasterMask & MULTI_DRAW_BIT) - || (ctx->Polygon.CullFlag && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)) { - return (swrast_tri_func)NULL; - } - - if (swrast->_RasterMask==DEPTH_BIT - && ctx->Depth.Func==GL_LESS - && ctx->Depth.Mask==GL_TRUE - && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS) { - return (ctx->Light.ShadeModel==GL_SMOOTH) ? tri_rgb_iter_zless : tri_rgb_flat_zless; - } - - if (swrast->_RasterMask==0) { /* no depth test */ - return (ctx->Light.ShadeModel==GL_SMOOTH) ? tri_rgb_iter : tri_rgb_flat; - } - - return (swrast_tri_func)NULL; -} - - -/* Override for the swrast triangle-selection function. Try to use one - * of our internal triangle functions, otherwise fall back to the - * standard swrast functions. - */ -static void -dmesa_choose_tri (GLcontext *ctx) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - if (!(swrast->Triangle=dmesa_choose_tri_function(ctx))) { - _swrast_choose_triangle(ctx); - } -} - - -/**************************************************************************** - * Optimized line rendering - ***************************************************************************/ - -/* - * NON-depth-buffered flat line. - */ -#define NAME line_rgb_flat - -#define INTERP_XY 1 -#define CLIP_HACK 1 - -#define SETUP_CODE \ - const DMesaContext dmesa = (DMesaContext)ctx;\ - GLuint _b_ = dmesa->buffer->height - 1; \ - GLuint _w_ = dmesa->buffer->width; \ - GLuint rgb = vl_mixrgb(vert1->color); - -#define PLOT(X,Y) vl_putpixel(FLIP2(Y) * _w_ + X, rgb); - -#include "swrast/s_linetemp.h" - - -/* - * Z-less flat line. - */ -#define NAME line_rgb_flat_zless - -#define INTERP_XY 1 -#define INTERP_Z 1 -#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define CLIP_HACK 1 - -#define SETUP_CODE \ - const DMesaContext dmesa = (DMesaContext)ctx;\ - GLuint _b_ = dmesa->buffer->height - 1; \ - GLuint _w_ = dmesa->buffer->width; \ - GLuint rgb = vl_mixrgb(vert1->color); - -#define PLOT(X,Y) \ - if (Z < *zPtr) { \ - *zPtr = Z; \ - vl_putpixel(FLIP2(Y) * _w_ + X, rgb); \ - } - -#include "swrast/s_linetemp.h" - - -/* - * NON-depth-buffered iterated line. - */ -#define line_rgb_iter NULL - - -/* - * Z-less iterated line. - */ -#define line_rgb_iter_zless NULL - - -/* - * Analyze context state to see if we can provide a fast line function - * Otherwise, return NULL. - */ -static swrast_line_func -dmesa_choose_line_function (GLcontext *ctx) -{ - const SWcontext *swrast = SWRAST_CONTEXT(ctx); - - if ((ctx->RenderMode != GL_RENDER) - || (ctx->Line.SmoothFlag) - || (ctx->Texture._EnabledUnits) - || (ctx->Line.StippleFlag) - || (swrast->_RasterMask & MULTI_DRAW_BIT) - || (ctx->Line.Width!=1.0F)) { - return (swrast_line_func)NULL; - } - - if (swrast->_RasterMask==DEPTH_BIT - && ctx->Depth.Func==GL_LESS - && ctx->Depth.Mask==GL_TRUE - && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS) { - return (ctx->Light.ShadeModel==GL_SMOOTH) ? line_rgb_iter_zless : line_rgb_flat_zless; - } - - if (swrast->_RasterMask==0) { /* no depth test */ - return (ctx->Light.ShadeModel==GL_SMOOTH) ? line_rgb_iter : line_rgb_flat; - } - - return (swrast_line_func)NULL; -} - - -/* Override for the swrast line-selection function. Try to use one - * of our internal line functions, otherwise fall back to the - * standard swrast functions. - */ -static void -dmesa_choose_line (GLcontext *ctx) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - if (!(swrast->Line=dmesa_choose_line_function(ctx))) { - _swrast_choose_line(ctx); - } -} - - -/**************************************************************************** - * Miscellaneous device driver funcs - ***************************************************************************/ -static const struct gl_texture_format * -choose_tex_format (GLcontext *ctx, GLint internalFormat, - GLenum format, GLenum type) -{ - switch (internalFormat) { - case GL_COMPRESSED_RGB_ARB: - return &_mesa_texformat_rgb; - case GL_COMPRESSED_RGBA_ARB: - return &_mesa_texformat_rgba; - default: - return _mesa_choose_tex_format(ctx, internalFormat, format, type); - } -} - - -static void -clear_index (GLcontext *ctx, GLuint index) -{ - ((DMesaContext)ctx)->ClearIndex = index; -} - - -static void -clear_color (GLcontext *ctx, const GLfloat color[4]) -{ - GLubyte col[4]; - CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); - CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); - CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]); - CLAMPED_FLOAT_TO_UBYTE(col[3], color[3]); - ((DMesaContext)ctx)->ClearColor = vl_mixrgba(col); -} - - -static void -clear (GLcontext *ctx, GLbitfield mask, GLboolean all, - GLint x, GLint y, GLint width, GLint height) -{ - const DMesaContext c = (DMesaContext)ctx; - const GLuint *colorMask = (GLuint *)&ctx->Color.ColorMask; - - /* - * Clear the specified region of the buffers indicated by 'mask' - * using the clear color or index as specified by one of the two - * functions above. - * If all==GL_TRUE, clear whole buffer, else just clear region defined - * by x,y,width,height - */ - - /* we can't handle color or index masking */ - if ((*colorMask == 0xffffffff) && (ctx->Color.IndexMask == 0xffffffff)) { - if (mask & DD_BACK_LEFT_BIT) { - int color = ((GLvisual *)(c->visual))->rgbMode ? c->ClearColor : c->ClearIndex; - - if (all) { - vl_clear(color); - } else { - vl_rect(x, c->buffer->height - y - height, width, height, color); - } - - mask &= ~DD_BACK_LEFT_BIT; - } - } - - if (mask) { - _swrast_Clear(ctx, mask, all, x, y, width, height); - } -} - - -/* - * Return the width and height of the current buffer. - * If anything special has to been done when the buffer/window is - * resized, do it now. - */ -static void -get_buffer_size (GLframebuffer *buffer, GLuint *width, GLuint *height) -{ - DMesaBuffer b = (DMesaBuffer)buffer; - - *width = b->width; - *height = b->height; -} - - -static void -viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) -{ - /* poll for window size change and realloc software Z/stencil/etc if needed */ - _mesa_ResizeBuffersMESA(); -} - - -static const GLubyte * -get_string (GLcontext *ctx, GLenum name) -{ - switch (name) { - case GL_RENDERER: - return (const GLubyte *)"Mesa DJGPP"; - default: - return NULL; - } -} - - -static void -finish (GLcontext *ctx) -{ - /* - * XXX todo - OPTIONAL FUNCTION: implements glFinish if possible - */ -} - - -static void -flush (GLcontext *ctx) -{ - /* - * XXX todo - OPTIONAL FUNCTION: implements glFlush if possible - */ -} - - -/**************************************************************************** - * State - ***************************************************************************/ -#define DMESA_NEW_LINE (_NEW_LINE | \ - _NEW_TEXTURE | \ - _NEW_LIGHT | \ - _NEW_DEPTH | \ - _NEW_RENDERMODE | \ - _SWRAST_NEW_RASTERMASK) - -#define DMESA_NEW_TRIANGLE (_NEW_POLYGON | \ - _NEW_TEXTURE | \ - _NEW_LIGHT | \ - _NEW_DEPTH | \ - _NEW_RENDERMODE | \ - _SWRAST_NEW_RASTERMASK) - -/* Extend the software rasterizer with our line and triangle - * functions. - */ -static void -dmesa_register_swrast_functions (GLcontext *ctx) -{ - SWcontext *swrast = SWRAST_CONTEXT(ctx); - - swrast->choose_line = dmesa_choose_line; - swrast->choose_triangle = dmesa_choose_tri; - - swrast->InvalidateLineMask |= DMESA_NEW_LINE; - swrast->InvalidateTriangleMask |= DMESA_NEW_TRIANGLE; -} - - -static void -dmesa_update_state (GLcontext *ctx, GLuint new_state) -{ - /* Propagate statechange information to swrast and swrast_setup - * modules. The DMesa driver has no internal GL-dependent state. - */ - _swrast_InvalidateState( ctx, new_state ); - _ac_InvalidateState( ctx, new_state ); - _tnl_InvalidateState( ctx, new_state ); - _swsetup_InvalidateState( ctx, new_state ); -} - - -/* Initialize the device driver function table with the functions - * we implement in this driver. - */ -static void -dmesa_init_driver_functions (DMesaVisual visual, - struct dd_function_table *driver) -{ - driver->UpdateState = dmesa_update_state; - driver->GetString = get_string; - driver->GetBufferSize = get_buffer_size; - driver->Viewport = viewport; - driver->Flush = flush; - driver->Finish = finish; - driver->Clear = clear; - driver->ClearColor = clear_color; - driver->ClearIndex = clear_index; -#if SWTC - driver->ChooseTextureFormat = choose_tex_format; -#endif -} - - -/* Setup pointers and other driver state that is constant for the life - * of a context. - */ -static void -dmesa_init_pointers (GLcontext *ctx) -{ - struct swrast_device_driver *dd = _swrast_GetDeviceDriverReference(ctx); - - /* The span functions should be in `dmesa_update_state', but I'm - * pretty sure they will never change during the life of the Visual - */ - - /* Index span/pixel functions */ - dd->WriteCI32Span = write_index_span; - dd->WriteCI8Span = write_index8_span; - dd->WriteMonoCISpan = write_mono_index_span; - dd->WriteCI32Pixels = write_index_pixels; - dd->WriteMonoCIPixels = write_mono_index_pixels; - dd->ReadCI32Span = read_index_span; - dd->ReadCI32Pixels = read_index_pixels; - - /* RGB(A) span/pixel functions */ - dd->WriteRGBASpan = write_rgba_span; - dd->WriteRGBSpan = write_rgb_span; - dd->WriteMonoRGBASpan = write_mono_rgba_span; - dd->WriteRGBAPixels = write_rgba_pixels; - dd->WriteMonoRGBAPixels = write_mono_rgba_pixels; - dd->ReadRGBASpan = read_rgba_span; - dd->ReadRGBAPixels = read_rgba_pixels; -} -#endif /* FX */ +static DMesaContext ctx; /**************************************************************************** @@ -960,131 +98,50 @@ DMesaCreateVisual (GLint width, GLint stencilSize, GLint accumSize) { - DMesaVisual v; - GLint redBits, greenBits, blueBits, alphaBits, indexBits; - GLboolean sw_alpha; - - alphaBits = 0; - - if (!rgbFlag) { - indexBits = 8; - redBits = 0; - greenBits = 0; - blueBits = 0; - } else { - indexBits = 0; - switch (colDepth) { - case 8: - redBits = 8; - greenBits = 8; - blueBits = 8; - break; - case 15: - alphaBits = 1; - redBits = 5; - greenBits = 5; - blueBits = 5; - break; - case 16: - redBits = 5; - greenBits = 6; - blueBits = 5; - break; - case 32: - alphaBits = 8; - case 24: - redBits = 8; - greenBits = 8; - blueBits = 8; - break; - default: - return NULL; - } - } - - /* Okay, - * `alphaBits' is what we can provide - * `alphaSize' is what app requests - * - * Note that alpha buffering is required only if destination alpha is used - * in alpha blending; alpha blending modes that do not use destination alpha - * can be used w/o alpha buffer. - * - * We will use whatever ALPHA app requests. Later, in `CreateBuffer' we'll - * instruct Mesa to use its own ALPHA buffer, by passing a non-FALSE value - * for ALPHA to `_mesa_initialize_framebuffer'. - * - * Basically, 32bit modes provide ALPHA storage, but can we rely on this? - */ - alphaBits = alphaSize; - sw_alpha = (alphaBits > 0); - -#ifndef FX - if (!dbFlag) { - return NULL; - } - if ((colDepth=vl_video_init(width, height, colDepth, rgbFlag, refresh)) <= 0) { - return NULL; - } -#else /* FX */ - if (!rgbFlag) { - return NULL; - } else { - char *env; - - if ((env = getenv("MESA_FX_INFO")) && (env[0] == 'r')) { - freopen("MESA.LOG", "w", stderr); - } - - if (refresh && (((env = getenv("FX_GLIDE_REFRESH")) == NULL) || !atoi(env))) { - /* if we are passed non-zero value for refresh, we need to override - * default refresh rate. However, if FX_GLIDE_REFRESH is already set - * to 0, we won't override it, because it has a special meaning for - * DJGPP Glide3x (switch via VESA, using BIOS default refresh). - */ - char tmp[32]; - sprintf(tmp, "FX_GLIDE_REFRESH=%u", refresh); - putenv(tmp); - } - } -#endif /* FX */ - - if ((v=(DMesaVisual)CALLOC_STRUCT(dmesa_visual)) != NULL) { - /* Create core visual */ - _mesa_initialize_visual((GLvisual *)v, - rgbFlag, /* rgb */ - dbFlag, - GL_FALSE, /* stereo */ - redBits, - greenBits, - blueBits, - alphaBits, - indexBits, /* indexBits */ - depthSize, - stencilSize, - accumSize, /* accumRed */ - accumSize, /* accumGreen */ - accumSize, /* accumBlue */ - alphaBits?accumSize:0, /* accumAlpha */ - 1); /* numSamples */ - -#ifndef FX - v->sw_alpha = sw_alpha; - v->z_buffer = (depthSize > 0) ? 1 : 0; -#endif - } - - return v; + DMesaVisual visual; + GLenum format; + int fbbits; + + if (dbFlag) { + return NULL; + } + + if (!rgbFlag) { + format = OSMESA_COLOR_INDEX; + fbbits = 8; + } else if (alphaSize) { + format = OSMESA_BGRA; + fbbits = 32; + } else if (colDepth == 15 || colDepth == 16) { + format = OSMESA_RGB_565; + fbbits = 16; + } else { + format = OSMESA_BGR; + fbbits = 24; + } + + if ((visual = (DMesaVisual)CALLOC_STRUCT(dmesa_visual)) == NULL) { + return NULL; + } + + if (vl_video_init(width, height, colDepth, rgbFlag, refresh, fbbits) <= 0) { + FREE(visual); + return NULL; + } + + visual->format = format; + visual->depthBits = depthSize; + visual->stencilBits = stencilSize; + visual->accumBits = accumSize; + return visual; } void -DMesaDestroyVisual (DMesaVisual v) +DMesaDestroyVisual (DMesaVisual visual) { -#ifndef FX vl_video_exit(); -#endif - _mesa_destroy_visual((GLvisual *)v); + FREE(visual); } @@ -1093,248 +150,168 @@ DMesaCreateBuffer (DMesaVisual visual, GLint xpos, GLint ypos, GLint width, GLint height) { -#ifndef FX - DMesaBuffer b; - - if ((b=(DMesaBuffer)CALLOC_STRUCT(dmesa_buffer)) != NULL) { - _mesa_initialize_framebuffer((GLframebuffer *)b, - (GLvisual *)visual, - visual->z_buffer == 1, - ((GLvisual *)visual)->stencilBits > 0, - ((GLvisual *)visual)->accumRedBits > 0, - visual->sw_alpha); - b->xpos = xpos; - b->ypos = ypos; - b->width = width; - b->height = height; - } - - return b; -#else /* FX */ - - GLvisual *v = (GLvisual *)visual; - int i = 0, fx_attrib[32]; - - if (v->doubleBufferMode) fx_attrib[i++] = FXMESA_DOUBLEBUFFER; - if (v->depthBits > 0) { fx_attrib[i++] = FXMESA_DEPTH_SIZE; fx_attrib[i++] = v->depthBits; } - if (v->stencilBits > 0) { fx_attrib[i++] = FXMESA_STENCIL_SIZE; fx_attrib[i++] = v->stencilBits; } - if (v->accumRedBits > 0) { fx_attrib[i++] = FXMESA_ACCUM_SIZE; fx_attrib[i++] = v->accumRedBits; } - if (v->alphaBits) { fx_attrib[i++] = FXMESA_ALPHA_SIZE; fx_attrib[i++] = v->alphaBits; } - fx_attrib[i++] = FXMESA_COLORDEPTH; - fx_attrib[i++] = v->redBits + v->greenBits + v->blueBits; - fx_attrib[i] = FXMESA_NONE; - - return (DMesaBuffer)fxMesaCreateBestContext(-1, width, height, fx_attrib); -#endif /* FX */ + DMesaBuffer buffer; + GLenum type; + int bytesPerPixel; + + switch (visual->format) { + case OSMESA_COLOR_INDEX: + bytesPerPixel = 1; + type = CHAN_TYPE; + break; + case OSMESA_RGB_565: + bytesPerPixel = 2; + type = GL_UNSIGNED_SHORT_5_6_5; + break; + case OSMESA_BGR: + bytesPerPixel = 3; + type = CHAN_TYPE; + break; + default: + bytesPerPixel = 4; + type = CHAN_TYPE; + } + + if ((buffer = (DMesaBuffer)CALLOC_STRUCT(dmesa_buffer)) != NULL) { + buffer->xpos = xpos; + buffer->ypos = ypos; + buffer->width = width; + buffer->height = height; + buffer->type = type; + buffer->the_window = MALLOC(width * height * bytesPerPixel + 1); + if (buffer->the_window == NULL) { + FREE(buffer); + buffer = NULL; + } + } + + return buffer; } void -DMesaDestroyBuffer (DMesaBuffer b) +DMesaDestroyBuffer (DMesaBuffer buffer) { -#ifndef FX - if (b->the_window != NULL) { - free(b->the_window); - } - _mesa_destroy_framebuffer((GLframebuffer *)b); -#else - fxMesaDestroyContext((fxMesaContext)b); -#endif + FREE(buffer->the_window); + FREE(buffer); } DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share) { - GLcontext *c; -#ifndef FX - TNLcontext *tnl; - struct dd_function_table functions; - - if ((c=(GLcontext *)CALLOC_STRUCT(dmesa_context)) != NULL) { - /* Initialize device driver function table */ - _mesa_init_driver_functions(&functions); - /* override with our functions */ - dmesa_init_driver_functions(visual, &functions); - - _mesa_initialize_context(c, - (GLvisual *)visual, - (GLcontext *)share, - &functions, - (void *)c); - - _mesa_enable_sw_extensions(c); - _mesa_enable_1_3_extensions(c); - _mesa_enable_1_4_extensions(c); - _mesa_enable_1_5_extensions(c); - _mesa_enable_2_0_extensions(c); -#if SWTC - if (c->Mesa_DXTn) { - _mesa_enable_extension(c, "GL_EXT_texture_compression_s3tc"); - _mesa_enable_extension(c, "GL_S3_s3tc"); - } - _mesa_enable_extension(c, "GL_3DFX_texture_compression_FXT1"); -#endif - - /* you probably have to do a bunch of other initializations here. */ - ((DMesaContext)c)->visual = visual; - - /* Initialize the software rasterizer and helper modules. - */ - _swrast_CreateContext(c); - _ac_CreateContext(c); - _tnl_CreateContext(c); - _swsetup_CreateContext(c); - /* tnl setup */ - tnl = TNL_CONTEXT(c); - tnl->Driver.RunPipeline = _tnl_run_pipeline; - /* swrast setup */ - if (((GLvisual *)visual)->rgbMode) dmesa_register_swrast_functions(c); - dmesa_init_pointers(c); - _swsetup_Wakeup(c); - } - -#else /* FX */ - c = (GLcontext *)0xdeadbeef; -#endif /* FX */ - - return (DMesaContext)c; + DMesaContext dmesa; + if ((dmesa = (DMesaContext)CALLOC_STRUCT(dmesa_context)) != NULL) { + dmesa->osmesa = OSMesaCreateContextExt( + visual->format, + visual->depthBits, + visual->stencilBits, + visual->accumBits, + (share != NULL) ? share->osmesa : NULL); + if (dmesa->osmesa == NULL) { + FREE(dmesa); + dmesa = NULL; + } + } + return dmesa; } void -DMesaDestroyContext (DMesaContext c) +DMesaDestroyContext (DMesaContext dmesa) { -#ifndef FX - if (c) { - _swsetup_DestroyContext((GLcontext *)c); - _swrast_DestroyContext((GLcontext *)c); - _tnl_DestroyContext((GLcontext *)c); - _ac_DestroyContext((GLcontext *)c); - _mesa_destroy_context((GLcontext *)c); - } -#endif + OSMesaDestroyContext(dmesa->osmesa); + FREE(dmesa); } GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos) { -#ifndef FX - GET_CURRENT_CONTEXT(ctx); - DMesaBuffer b = ((DMesaContext)ctx)->buffer; + const DMesaContext dmesa = DMesaGetCurrentContext(); + DMesaBuffer b = dmesa->buffer; - if (vl_sync_buffer(&b->the_window, xpos, ypos, b->width, b->height) == 0) { - b->xpos = xpos; - b->ypos = ypos; - return GL_TRUE; - } -#endif + if (vl_sync_buffer(&b->the_window, xpos, ypos, b->width, b->height) == 0) { + b->xpos = xpos; + b->ypos = ypos; + return GL_TRUE; + } - return GL_FALSE; + return GL_FALSE; } GLboolean DMesaResizeBuffer (GLint width, GLint height) { -#ifndef FX - GET_CURRENT_CONTEXT(ctx); - DMesaBuffer b = ((DMesaContext)ctx)->buffer; + const DMesaContext dmesa = DMesaGetCurrentContext(); + DMesaBuffer b = dmesa->buffer; - if (vl_sync_buffer(&b->the_window, b->xpos, b->ypos, width, height) == 0) { - b->width = width; - b->height = height; - return GL_TRUE; - } -#endif + if (vl_sync_buffer(&b->the_window, b->xpos, b->ypos, width, height) == 0) { + b->width = width; + b->height = height; + return GL_TRUE; + } - return GL_FALSE; + return GL_FALSE; } -/* - * Make the specified context and buffer the current one. - */ GLboolean -DMesaMakeCurrent (DMesaContext c, DMesaBuffer b) +DMesaMakeCurrent (DMesaContext dmesa, DMesaBuffer buffer) { -#ifndef FX - if ((c != NULL) && (b != NULL)) { - if (vl_sync_buffer(&b->the_window, b->xpos, b->ypos, b->width, b->height) != 0) { - return GL_FALSE; - } - - c->buffer = b; - - _mesa_make_current((GLcontext *)c, (GLframebuffer *)b); - } - else { - /* Detach */ - _mesa_make_current(NULL, NULL); - } - -#else - fxMesaMakeCurrent((fxMesaContext)b); -#endif - - return GL_TRUE; + if (dmesa == NULL || buffer == NULL) { + ctx = NULL; + return GL_TRUE; + } + if (OSMesaMakeCurrent(dmesa->osmesa, buffer->the_window, + buffer->type, + buffer->width, buffer->height) && + vl_sync_buffer(&buffer->the_window, buffer->xpos, buffer->ypos, buffer->width, buffer->height) == 0) { + OSMesaPixelStore(OSMESA_Y_UP, GL_FALSE); + dmesa->buffer = buffer; + ctx = dmesa; + return GL_TRUE; + } + return GL_FALSE; } void -DMesaSwapBuffers (DMesaBuffer b) +DMesaSwapBuffers (DMesaBuffer buffer) { - /* copy/swap back buffer to front if applicable */ -#ifndef FX - GET_CURRENT_CONTEXT(ctx); - _mesa_notifySwapBuffers(ctx); - vl_flip(); -#else - fxMesaSwapBuffers(); -#endif + /* copy/swap back buffer to front if applicable */ + GET_CURRENT_CONTEXT(ctx); + _mesa_notifySwapBuffers(ctx); + vl_flip(); + (void)buffer; } void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue) { -#ifndef FX - vl_setCI(ndx, red, green, blue); -#endif + vl_setCI(ndx, red, green, blue); } DMesaContext DMesaGetCurrentContext (void) { - GET_CURRENT_CONTEXT(ctx); - -#ifndef FX -#else - if (ctx != NULL) { - ctx = (GLcontext *)0xdeadbeef; - } -#endif - - return (DMesaContext)ctx; + return ctx; } DMesaBuffer DMesaGetCurrentBuffer (void) { - const DMesaContext dmesa = DMesaGetCurrentContext(); + const DMesaContext dmesa = DMesaGetCurrentContext(); - if (dmesa == NULL) { - return NULL; - } + if (dmesa != NULL) { + return dmesa->buffer; + } -#ifndef FX - return dmesa->buffer; -#else - return (DMesaBuffer)fxMesaGetCurrentContext(); -#endif + return NULL; } @@ -1355,61 +332,28 @@ DMesaGetProcAddress (const char *name) int DMesaGetIntegerv (GLenum pname, GLint *params) { - switch (pname) { - case DMESA_GET_SCREEN_SIZE: - #ifndef FX - vl_get(VL_GET_SCREEN_SIZE, params); - #else - fxGetScreenGeometry(¶ms[0], ¶ms[1]); - #endif - break; - case DMESA_GET_DRIVER_CAPS: - #ifndef FX - params[0] = DMESA_DRIVER_SWDB_BIT; - #else - params[0] = DMESA_DRIVER_LLWO_BIT; - #endif - break; - case DMESA_GET_VIDEO_MODES: - #ifndef FX - return vl_get(VL_GET_VIDEO_MODES, params); - #else - return -1; /* TODO */ - #endif - case DMESA_GET_BUFFER_ADDR: { - #ifndef FX - DMesaContext c = (DMesaContext)DMesaGetCurrentContext(); - if (c != NULL) { - DMesaBuffer b = c->buffer; - if (b != NULL) { - params[0] = (GLint)b->the_window; - } - } - break; - #else - return -1; - #endif - } - default: - return -1; - } - - return 0; + switch (pname) { + case DMESA_GET_SCREEN_SIZE: + vl_get(VL_GET_SCREEN_SIZE, params); + break; + case DMESA_GET_DRIVER_CAPS: + params[0] = 0; + break; + case DMESA_GET_VIDEO_MODES: + return vl_get(VL_GET_VIDEO_MODES, params); + case DMESA_GET_BUFFER_ADDR: { + const DMesaContext dmesa = DMesaGetCurrentContext(); + if (dmesa != NULL) { + DMesaBuffer b = dmesa->buffer; + if (b != NULL) { + params[0] = (GLint)b->the_window; + } + } + break; + } + default: + return -1; + } + + return 0; } - - -#if SWTC && (((__DJGPP__ << 8) | __DJGPP_MINOR__) >= 0x204) -#include - -extern_asm(___dj_assert); -extern_asm(_free); -extern_asm(_malloc); -extern_asm(_memset); - -DXE_EXPORT_TABLE_AUTO (___dxe_eta___dxtn) - DXE_EXPORT_ASM (___dj_assert) - DXE_EXPORT_ASM (_free) - DXE_EXPORT_ASM (_malloc) - DXE_EXPORT_ASM (_memset) -DXE_EXPORT_END -#endif diff --git a/src/mesa/drivers/dos/dpmi.c b/src/mesa/drivers/dos/dpmi.c index b2cef04ac8f..bd33b8856cf 100644 --- a/src/mesa/drivers/dos/dpmi.c +++ b/src/mesa/drivers/dos/dpmi.c @@ -23,9 +23,9 @@ */ /* - * DOS/DJGPP device driver v1.5 for Mesa + * DOS/DJGPP device driver for Mesa * - * Copyright (C) 2002 - Borca Daniel + * Author: Daniel Borca * Email : dborca@yahoo.com * Web : http://www.geocities.com/dborca */ diff --git a/src/mesa/drivers/dos/internal.h b/src/mesa/drivers/dos/internal.h index 85b94d3773d..0fa7c772223 100644 --- a/src/mesa/drivers/dos/internal.h +++ b/src/mesa/drivers/dos/internal.h @@ -23,9 +23,9 @@ */ /* - * DOS/DJGPP device driver v1.6 for Mesa + * DOS/DJGPP device driver for Mesa * - * Copyright (C) 2002 - Borca Daniel + * Author: Daniel Borca * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca */ @@ -54,6 +54,8 @@ typedef unsigned long word32; #define _16_ *(word16 *)& #define _32_ *(word32 *)& +typedef void (*BLTFUNC) (void); + /* * video mode structure @@ -75,7 +77,7 @@ typedef struct vl_mode { */ typedef struct { vl_mode *(*init) (void); - int (*entermode) (vl_mode *p, int refresh); + int (*entermode) (vl_mode *p, int refresh, int fbbits); void (*blit) (void); void (*setCI_f) (int index, float red, float green, float blue); void (*setCI_i) (int index, int red, int green, int blue); @@ -100,32 +102,4 @@ void _remove_selector (int *segment); int _can_mmx (void); -/* - * asm routines to deal with virtual buffering - */ -extern void v_clear8 (int color); -#define v_clear15 v_clear16 -extern void v_clear16 (int color); -extern void v_clear24 (int color); -extern void v_clear32 (int color); - -extern void v_clear8_mmx (int color); -#define v_clear15_mmx v_clear16_mmx -extern void v_clear16_mmx (int color); -extern void v_clear24_mmx (int color); -extern void v_clear32_mmx (int color); - -extern void v_rect8 (int x, int y, int width, int height, int color); -#define v_rect15 v_rect16 -extern void v_rect16 (int x, int y, int width, int height, int color); -extern void v_rect24 (int x, int y, int width, int height, int color); -extern void v_rect32 (int x, int y, int width, int height, int color); - -extern void v_putpixel8 (unsigned int offset, int color); -#define v_putpixel15 v_putpixel16 -extern void v_putpixel16 (unsigned int offset, int color); -extern void v_putpixel24 (unsigned int offset, int color); -extern void v_putpixel32 (unsigned int offset, int color); - - #endif diff --git a/src/mesa/drivers/dos/null.c b/src/mesa/drivers/dos/null.c index 369255a4222..55846299fbb 100644 --- a/src/mesa/drivers/dos/null.c +++ b/src/mesa/drivers/dos/null.c @@ -23,9 +23,9 @@ */ /* - * DOS/DJGPP device driver v1.7 for Mesa + * DOS/DJGPP device driver for Mesa * - * Copyright (C) 2002 - Borca Daniel + * Author: Daniel Borca * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca */ @@ -137,13 +137,13 @@ null_fini (void) * Note: - */ static int -null_entermode (vl_mode *p, int refresh) +null_entermode (vl_mode *p, int refresh, int fbbits) { NUL.blit = null_blit_nop; return 0; - (void)(p && refresh); /* silence compiler warning */ + (void)(p && refresh && fbbits); /* silence compiler warning */ } diff --git a/src/mesa/drivers/dos/null.h b/src/mesa/drivers/dos/null.h index a38accc8570..bbdc7966e07 100644 --- a/src/mesa/drivers/dos/null.h +++ b/src/mesa/drivers/dos/null.h @@ -23,9 +23,9 @@ */ /* - * DOS/DJGPP device driver v1.6 for Mesa + * DOS/DJGPP device driver for Mesa * - * Copyright (C) 2002 - Borca Daniel + * Author: Daniel Borca * Email : dborca@yahoo.com * Web : http://www.geocities.com/dborca */ diff --git a/src/mesa/drivers/dos/vesa.c b/src/mesa/drivers/dos/vesa.c index cd48a24bfb4..3fdd3e25db4 100644 --- a/src/mesa/drivers/dos/vesa.c +++ b/src/mesa/drivers/dos/vesa.c @@ -23,9 +23,9 @@ */ /* - * DOS/DJGPP device driver v1.6 for Mesa + * DOS/DJGPP device driver for Mesa * - * Copyright (C) 2002 - Borca Daniel + * Author: Daniel Borca * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca */ @@ -86,16 +86,16 @@ unsigned int vesa_gran_mask, vesa_gran_shift; * VESA 3.0 CRTC timings structure */ typedef struct CRTCInfoBlock { - unsigned short HorizontalTotal; - unsigned short HorizontalSyncStart; - unsigned short HorizontalSyncEnd; - unsigned short VerticalTotal; - unsigned short VerticalSyncStart; - unsigned short VerticalSyncEnd; - unsigned char Flags; - unsigned long PixelClock; /* units of Hz */ - unsigned short RefreshRate; /* units of 0.01 Hz */ - unsigned char reserved[40]; + unsigned short HorizontalTotal; + unsigned short HorizontalSyncStart; + unsigned short HorizontalSyncEnd; + unsigned short VerticalTotal; + unsigned short VerticalSyncStart; + unsigned short VerticalSyncEnd; + unsigned char Flags; + unsigned long PixelClock; /* units of Hz */ + unsigned short RefreshRate; /* units of 0.01 Hz */ + unsigned char reserved[40]; } __PACKED__ CRTCInfoBlock; #define HNEG (1 << 2) @@ -113,116 +113,122 @@ typedef struct CRTCInfoBlock { static vl_mode * vesa_init (void) { - __dpmi_regs r; - word16 *p; - vl_mode *q; - char vesa_info[512], tmp[512]; - int maxsize = 0; - word32 linearfb = 0; - - if (vesa_ver) { - return modes; - } - - _farpokel(_stubinfo->ds_selector, 0, 0x32454256); - r.x.ax = 0x4f00; - r.x.di = 0; - r.x.es = _stubinfo->ds_segment; - __dpmi_int(0x10, &r); - movedata(_stubinfo->ds_selector, 0, _my_ds(), (unsigned)vesa_info, 512); - if ((r.x.ax != 0x004f) || ((_32_ vesa_info[V_SIGN]) != 0x41534556)) { - return NULL; - } - - p = (word16 *)(((_16_ vesa_info[V_MODE_SEG])<<4) + (_16_ vesa_info[V_MODE_OFS])); - q = modes; - do { - if ((q->mode=_farpeekw(__djgpp_dos_sel, (unsigned long)(p++))) == 0xffff) { - break; - } - - r.x.ax = 0x4f01; - r.x.cx = q->mode; - r.x.di = 512; - r.x.es = _stubinfo->ds_segment; - __dpmi_int(0x10, &r); - movedata(_stubinfo->ds_selector, 512, _my_ds(), (unsigned)tmp, 256); - switch (tmp[M_BPP]) { - case 16: - q->bpp = tmp[M_RED] + tmp[M_GREEN] + tmp[M_BLUE]; - break; - case 8: - case 15: - case 24: - case 32: - q->bpp = tmp[M_BPP]; - break; - default: - q->bpp = 0; - } - if ((r.x.ax == 0x004f) && ((tmp[M_ATTR] & 0x11) == 0x11) && q->bpp) { - q->xres = _16_ tmp[M_XRES]; - q->yres = _16_ tmp[M_YRES]; - q->scanlen = _16_ tmp[M_SCANLEN]; - q->gran = (_16_ tmp[M_GRAN])<<10; - if (tmp[M_ATTR] & 0x80) { - vl_mode *q1 = q + 1; - *q1 = *q++; - linearfb = _32_ tmp[M_PHYS_PTR]; - q->mode |= 0x4000; - } - if (maxsize < (q->scanlen * q->yres)) { - maxsize = q->scanlen * q->yres; - } - q++; - } - } while (TRUE); - - if (q == modes) { - return NULL; - } - if (linearfb) { - maxsize = (maxsize + 0xfffUL) & ~0xfffUL; - if (_create_selector(&linear_selector, linearfb, maxsize)) { - return NULL; - } - } - if (_create_selector(&banked_selector, 0xa0000, modes[0].gran)) { - _remove_selector(&linear_selector); - return NULL; - } - - for (q = modes; q->mode != 0xffff; q++) { - q->sel = (q->mode & 0x4000) ? linear_selector : banked_selector; - } - - if (vesa_info[V_MAJOR] >= 2) { - r.x.ax = 0x4f0a; - r.x.bx = 0; - __dpmi_int(0x10, &r); - if (r.x.ax == 0x004f) { - vesa_pmcode = (word16 *)malloc(r.x.cx); - if (vesa_pmcode != NULL) { - movedata(__djgpp_dos_sel, (r.x.es << 4) + r.x.di, _my_ds(), (unsigned)vesa_pmcode, r.x.cx); - if (vesa_pmcode[3]) { - p = (word16 *)((long)vesa_pmcode + vesa_pmcode[3]); - while (*p++ != 0xffff) { - } - } else { - p = NULL; - } - if (p && (*p != 0xffff)) { - free(vesa_pmcode); - vesa_pmcode = NULL; - } else { - vesa_swbank = (void *)((long)vesa_pmcode + vesa_pmcode[0]); - } - } - } - } - - vesa_ver = _16_ vesa_info[V_MINOR]; - return modes; + __dpmi_regs r; + word16 *p; + vl_mode *q; + char vesa_info[512], tmp[512]; + int maxsize = 0; + word32 linearfb = 0; + + if (vesa_ver) { + return modes; + } + + _farpokel(_stubinfo->ds_selector, 0, 0x32454256); + r.x.ax = 0x4f00; + r.x.di = 0; + r.x.es = _stubinfo->ds_segment; + __dpmi_int(0x10, &r); + movedata(_stubinfo->ds_selector, 0, _my_ds(), (unsigned)vesa_info, 512); + if ((r.x.ax != 0x004f) || ((_32_ vesa_info[V_SIGN]) != 0x41534556)) { + return NULL; + } + + p = (word16 *)(((_16_ vesa_info[V_MODE_SEG]) << 4) + (_16_ vesa_info[V_MODE_OFS])); + q = modes; + do { + if ((q->mode = _farpeekw(__djgpp_dos_sel, (unsigned long)(p++))) == 0xffff) { + break; + } + + r.x.ax = 0x4f01; + r.x.cx = q->mode; + r.x.di = 512; + r.x.es = _stubinfo->ds_segment; + __dpmi_int(0x10, &r); + movedata(_stubinfo->ds_selector, 512, _my_ds(), (unsigned)tmp, 256); + switch (tmp[M_BPP]) { + case 16: + q->bpp = tmp[M_RED] + tmp[M_GREEN] + tmp[M_BLUE]; + break; + case 8: + case 15: + case 24: + case 32: + q->bpp = tmp[M_BPP]; + break; + default: + q->bpp = 0; + } + if ((r.x.ax == 0x004f) && ((tmp[M_ATTR] & 0x11) == 0x11) && q->bpp) { + q->xres = _16_ tmp[M_XRES]; + q->yres = _16_ tmp[M_YRES]; + q->scanlen = _16_ tmp[M_SCANLEN]; + q->gran = (_16_ tmp[M_GRAN]) << 10; + if (tmp[M_ATTR] & 0x80) { + vl_mode *q1 = q + 1; + *q1 = *q++; + linearfb = _32_ tmp[M_PHYS_PTR]; + q->mode |= 0x4000; + } + if (maxsize < (q->scanlen * q->yres)) { + maxsize = q->scanlen * q->yres; + } + q++; + } + } while (TRUE); + + if (q == modes) { + return NULL; + } + if (_create_selector(&banked_selector, 0xa0000, modes[0].gran)) { + return NULL; + } + if (linearfb) { + maxsize = ((maxsize + 0xfffUL) & ~0xfffUL); + if (_create_selector(&linear_selector, linearfb, maxsize)) { + linear_selector = banked_selector; + } + } + + for (q = modes; q->mode != 0xffff; q++) { + q->sel = banked_selector; + if (q->mode & 0x4000) { + if (linear_selector != banked_selector) { + q->sel = linear_selector; + } else { + q->mode &= ~0x4000; + } + } + } + + if (vesa_info[V_MAJOR] >= 2) { + r.x.ax = 0x4f0a; + r.x.bx = 0; + __dpmi_int(0x10, &r); + if (r.x.ax == 0x004f) { + vesa_pmcode = (word16 *)malloc(r.x.cx); + if (vesa_pmcode != NULL) { + movedata(__djgpp_dos_sel, (r.x.es << 4) + r.x.di, _my_ds(), (unsigned)vesa_pmcode, r.x.cx); + if (vesa_pmcode[3]) { + p = (word16 *)((long)vesa_pmcode + vesa_pmcode[3]); + while (*p++ != 0xffff) { + } + } else { + p = NULL; + } + if (p && (*p != 0xffff)) { + free(vesa_pmcode); + vesa_pmcode = NULL; + } else { + vesa_swbank = (void *)((long)vesa_pmcode + vesa_pmcode[0]); + } + } + } + } + + vesa_ver = _16_ vesa_info[V_MINOR]; + return modes; } @@ -236,14 +242,14 @@ vesa_init (void) static void vesa_fini (void) { - if (vesa_ver) { - _remove_selector(&linear_selector); - _remove_selector(&banked_selector); - if (vesa_pmcode != NULL) { - free(vesa_pmcode); - vesa_pmcode = NULL; - } - } + if (vesa_ver) { + _remove_selector(&linear_selector); + _remove_selector(&banked_selector); + if (vesa_pmcode != NULL) { + free(vesa_pmcode); + vesa_pmcode = NULL; + } + } } @@ -257,15 +263,15 @@ vesa_fini (void) static unsigned long _closest_pixclk (int mode_no, unsigned long vclk) { - __dpmi_regs r; + __dpmi_regs r; - r.x.ax = 0x4F0B; - r.h.bl = 0; - r.d.ecx = vclk; - r.x.dx = mode_no; - __dpmi_int(0x10, &r); + r.x.ax = 0x4F0B; + r.h.bl = 0; + r.d.ecx = vclk; + r.x.dx = mode_no; + __dpmi_int(0x10, &r); - return (r.x.ax == 0x004f) ? r.d.ecx : 0; + return (r.x.ax == 0x004f) ? r.d.ecx : 0; } @@ -279,77 +285,253 @@ _closest_pixclk (int mode_no, unsigned long vclk) static void _crtc_timing (CRTCInfoBlock *crtc, int xres, int yres, int xadjust, int yadjust) { - int HTotal, VTotal; - int HDisp, VDisp; - int HSS, VSS; - int HSE, VSE; - int HSWidth, VSWidth; - int SS, SE; - int doublescan = FALSE; - - if (yres < 400) { - doublescan = TRUE; - yres *= 2; - } - - HDisp = xres; - HTotal = (int)(HDisp * 1.27) & ~0x7; - HSWidth = (int)((HTotal - HDisp) / 5) & ~0x7; - HSS = HDisp + 16; - HSE = HSS + HSWidth; - VDisp = yres; - VTotal = VDisp * 1.07; - VSWidth = (VTotal / 100) + 1; - VSS = VDisp + ((int)(VTotal - VDisp) / 5) + 1; - VSE = VSS + VSWidth; - - SS = HSS + xadjust; - SE = HSE + xadjust; - - if (xadjust < 0) { - if (SS < (HDisp + 8)) { - SS = HDisp + 8; - SE = SS + HSWidth; - } - } else { - if ((HTotal - 24) < SE) { - SE = HTotal - 24; - SS = SE - HSWidth; - } - } - - HSS = SS; - HSE = SE; - - SS = VSS + yadjust; - SE = VSE + yadjust; - - if (yadjust < 0) { - if (SS < (VDisp + 3)) { - SS = VDisp + 3; - SE = SS + VSWidth; - } - } else { - if ((VTotal - 4) < SE) { - SE = VTotal - 4; - SS = SE - VSWidth; - } - } - - VSS = SS; - VSE = SE; - - crtc->HorizontalTotal = HTotal; - crtc->HorizontalSyncStart = HSS; - crtc->HorizontalSyncEnd = HSE; - crtc->VerticalTotal = VTotal; - crtc->VerticalSyncStart = VSS; - crtc->VerticalSyncEnd = VSE; - crtc->Flags = HNEG | VNEG; - - if (doublescan) { - crtc->Flags |= DOUBLESCAN; - } + int HTotal, VTotal; + int HDisp, VDisp; + int HSS, VSS; + int HSE, VSE; + int HSWidth, VSWidth; + int SS, SE; + int doublescan = FALSE; + + if (yres < 400) { + doublescan = TRUE; + yres *= 2; + } + + HDisp = xres; + HTotal = (int)(HDisp * 1.27) & ~0x7; + HSWidth = (int)((HTotal - HDisp) / 5) & ~0x7; + HSS = HDisp + 16; + HSE = HSS + HSWidth; + VDisp = yres; + VTotal = VDisp * 1.07; + VSWidth = (VTotal / 100) + 1; + VSS = VDisp + ((int)(VTotal - VDisp) / 5) + 1; + VSE = VSS + VSWidth; + + SS = HSS + xadjust; + SE = HSE + xadjust; + + if (xadjust < 0) { + if (SS < (HDisp + 8)) { + SS = HDisp + 8; + SE = SS + HSWidth; + } + } else { + if ((HTotal - 24) < SE) { + SE = HTotal - 24; + SS = SE - HSWidth; + } + } + + HSS = SS; + HSE = SE; + + SS = VSS + yadjust; + SE = VSE + yadjust; + + if (yadjust < 0) { + if (SS < (VDisp + 3)) { + SS = VDisp + 3; + SE = SS + VSWidth; + } + } else { + if ((VTotal - 4) < SE) { + SE = VTotal - 4; + SS = SE - VSWidth; + } + } + + VSS = SS; + VSE = SE; + + crtc->HorizontalTotal = HTotal; + crtc->HorizontalSyncStart = HSS; + crtc->HorizontalSyncEnd = HSE; + crtc->VerticalTotal = VTotal; + crtc->VerticalSyncStart = VSS; + crtc->VerticalSyncEnd = VSE; + crtc->Flags = HNEG | VNEG; + + if (doublescan) { + crtc->Flags |= DOUBLESCAN; + } +} + + +/* Desc: Attempts to choose a suitable blitter. + * + * In : ptr to mode structure, software framebuffer bits + * Out : blitter funciton, or NULL + * + * Note: - + */ +static BLTFUNC +_choose_blitter (vl_mode *p, int fbbits) +{ + BLTFUNC blitter; + + if (p->mode & 0x4000) { + blitter = _can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual; + switch (p->bpp) { + case 8: + switch (fbbits) { + case 8: + break; + case 16: + blitter = vesa_l_dump_16_to_8; + break; + case 24: + blitter = vesa_l_dump_24_to_8; + break; + case 32: + blitter = vesa_l_dump_32_to_8; + break; + case 15: + default: + return NULL; + } + break; + case 15: + switch (fbbits) { + case 16: + blitter = vesa_l_dump_16_to_15; + break; + case 32: + blitter = vesa_l_dump_32_to_15; + break; + case 8: + case 15: + case 24: + default: + return NULL; + } + break; + case 16: + switch (fbbits) { + case 16: + break; + case 32: + blitter = vesa_l_dump_32_to_16; + break; + case 8: + case 15: + case 24: + default: + return NULL; + } + break; + case 24: + switch (fbbits) { + case 24: + break; + case 32: + blitter = vesa_l_dump_32_to_24; + break; + case 8: + case 15: + case 16: + default: + return NULL; + } + break; + case 32: + switch (fbbits) { + case 24: + blitter = vesa_l_dump_24_to_32; + break; + case 32: + break; + case 8: + case 15: + case 16: + default: + return NULL; + } + break; + } + } else { + blitter = vesa_b_dump_virtual; + switch (p->bpp) { + case 8: + switch (fbbits) { + case 8: + break; + case 16: + blitter = vesa_b_dump_16_to_8; + break; + case 24: + blitter = vesa_b_dump_24_to_8; + break; + case 32: + blitter = vesa_b_dump_32_to_8; + break; + case 15: + default: + return NULL; + } + break; + case 15: + switch (fbbits) { + case 16: + blitter = vesa_b_dump_16_to_15; + break; + case 32: + blitter = vesa_b_dump_32_to_15; + break; + case 8: + case 15: + case 24: + default: + return NULL; + } + break; + case 16: + switch (fbbits) { + case 16: + break; + case 32: + blitter = vesa_b_dump_32_to_16; + break; + case 8: + case 15: + case 24: + default: + return NULL; + } + break; + case 24: + switch (fbbits) { + case 24: + break; + case 32: + blitter = vesa_b_dump_32_to_24; + break; + case 8: + case 15: + case 16: + default: + return NULL; + } + break; + case 32: + switch (fbbits) { + case 24: + blitter = vesa_b_dump_24_to_32; + break; + case 32: + break; + case 8: + case 15: + case 16: + default: + return NULL; + } + break; + } + } + + return blitter; } @@ -361,74 +543,76 @@ _crtc_timing (CRTCInfoBlock *crtc, int xres, int yres, int xadjust, int yadjust) * Note: - */ static int -vesa_entermode (vl_mode *p, int refresh) +vesa_entermode (vl_mode *p, int refresh, int fbbits) { - __dpmi_regs r; - - if (p->mode & 0x4000) { - VESA.blit = _can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual; - } else { - VESA.blit = vesa_b_dump_virtual; - { int n; for (vesa_gran_shift=0, n=p->gran; n; vesa_gran_shift++, n>>=1) ; } - vesa_gran_mask = (1 << (--vesa_gran_shift)) - 1; - if ((unsigned)p->gran != (vesa_gran_mask+1)) { - return !0; - } - } - - if (oldmode == -1) { - r.x.ax = 0x4f03; - __dpmi_int(0x10, &r); - oldmode = r.x.bx; - } - - r.x.ax = 0x4f02; - r.x.bx = p->mode; - - if (refresh && ((vesa_ver>>8) >= 3)) { - /* VESA 3.0 stuff for controlling the refresh rate */ - CRTCInfoBlock crtc; - unsigned long vclk; - double f0; - - _crtc_timing(&crtc, p->xres, p->yres, 0, 0); - - vclk = (double)crtc.HorizontalTotal * crtc.VerticalTotal * refresh; - vclk = _closest_pixclk(p->mode, vclk); - - if (vclk != 0) { - f0 = (double)vclk / (crtc.HorizontalTotal * crtc.VerticalTotal); - /*_current_refresh_rate = (int)(f0 + 0.5);*/ - - crtc.PixelClock = vclk; - crtc.RefreshRate = refresh * 100; - - movedata(_my_ds(), (unsigned)&crtc, _stubinfo->ds_selector, 0, sizeof(crtc)); - - r.x.di = 0; - r.x.es = _stubinfo->ds_segment; - r.x.bx |= 0x0800; - } - } - - __dpmi_int(0x10, &r); - if (r.x.ax != 0x004f) { - return !0; - } - - if (p->bpp == 8) { - r.x.ax = 0x4f08; - r.x.bx = 0x0800; - __dpmi_int(0x10, &r); - if (r.x.ax == 0x004f) { - r.x.ax = 0x4f08; - r.h.bl = 0x01; - __dpmi_int(0x10, &r); - vesa_color_precision = r.h.bh; - } - } - - return 0; + __dpmi_regs r; + + if (!(p->mode & 0x4000)) { + { int n; for (vesa_gran_shift = 0, n = p->gran; n; vesa_gran_shift++, n >>= 1); } + vesa_gran_mask = (1 << (--vesa_gran_shift)) - 1; + if ((unsigned)p->gran != (vesa_gran_mask + 1)) { + return !0; + } + } + + VESA.blit = _choose_blitter(p, fbbits); + if (VESA.blit == NULL) { + return !0; + } + + if (oldmode == -1) { + r.x.ax = 0x4f03; + __dpmi_int(0x10, &r); + oldmode = r.x.bx; + } + + r.x.ax = 0x4f02; + r.x.bx = p->mode; + + if (refresh && ((vesa_ver >> 8) >= 3)) { + /* VESA 3.0 stuff for controlling the refresh rate */ + CRTCInfoBlock crtc; + unsigned long vclk; + double f0; + + _crtc_timing(&crtc, p->xres, p->yres, 0, 0); + + vclk = (double)crtc.HorizontalTotal * crtc.VerticalTotal * refresh; + vclk = _closest_pixclk(p->mode, vclk); + + if (vclk != 0) { + f0 = (double)vclk / (crtc.HorizontalTotal * crtc.VerticalTotal); + /*_current_refresh_rate = (int)(f0 + 0.5);*/ + + crtc.PixelClock = vclk; + crtc.RefreshRate = refresh * 100; + + movedata(_my_ds(), (unsigned)&crtc, _stubinfo->ds_selector, 0, sizeof(crtc)); + + r.x.di = 0; + r.x.es = _stubinfo->ds_segment; + r.x.bx |= 0x0800; + } + } + + __dpmi_int(0x10, &r); + if (r.x.ax != 0x004f) { + return !0; + } + + if (p->bpp == 8) { + r.x.ax = 0x4f08; + r.x.bx = 0x0800; + __dpmi_int(0x10, &r); + if (r.x.ax == 0x004f) { + r.x.ax = 0x4f08; + r.h.bl = 0x01; + __dpmi_int(0x10, &r); + vesa_color_precision = r.h.bh; + } + } + + return 0; } @@ -442,14 +626,18 @@ vesa_entermode (vl_mode *p, int refresh) static void vesa_restore (void) { - __dpmi_regs r; - - if (oldmode != -1) { - r.x.ax = 0x4f02; - r.x.bx = oldmode; - __dpmi_int(0x10, &r); - oldmode = -1; - } + __dpmi_regs r; + + if (oldmode != -1) { + if (oldmode < 0x100) { + __asm("int $0x10"::"a"(oldmode)); + } else { + r.x.ax = 0x4f02; + r.x.bx = oldmode; + __dpmi_int(0x10, &r); + } + oldmode = -1; + } } @@ -464,17 +652,17 @@ static void vesa_setCI_i (int index, int red, int green, int blue) { #if 0 - __asm("\n\ + __asm("\n\ movw $0x1010, %%ax \n\ movb %1, %%dh \n\ movb %2, %%ch \n\ int $0x10 \n\ "::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); #else - outportb(0x03C8, index); - outportb(0x03C9, red); - outportb(0x03C9, green); - outportb(0x03C9, blue); + outportb(0x03C8, index); + outportb(0x03C9, red); + outportb(0x03C9, green); + outportb(0x03C9, blue); #endif } @@ -489,9 +677,9 @@ vesa_setCI_i (int index, int red, int green, int blue) static void vesa_setCI_f (int index, float red, float green, float blue) { - float max = (1 << vesa_color_precision) - 1; + float max = (1 << vesa_color_precision) - 1; - vesa_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); + vesa_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); } @@ -505,14 +693,14 @@ vesa_setCI_f (int index, float red, float green, float blue) static int vesa_get (int pname, int *params) { - switch (pname) { - case VL_GET_CI_PREC: - params[0] = vesa_color_precision; - break; - default: - return -1; - } - return 0; + switch (pname) { + case VL_GET_CI_PREC: + params[0] = vesa_color_precision; + break; + default: + return -1; + } + return 0; } @@ -520,12 +708,12 @@ vesa_get (int pname, int *params) * the driver */ vl_driver VESA = { - vesa_init, - vesa_entermode, - NULL, - vesa_setCI_f, - vesa_setCI_i, - vesa_get, - vesa_restore, - vesa_fini + vesa_init, + vesa_entermode, + NULL, + vesa_setCI_f, + vesa_setCI_i, + vesa_get, + vesa_restore, + vesa_fini }; diff --git a/src/mesa/drivers/dos/vesa.h b/src/mesa/drivers/dos/vesa.h index 9287697c370..4b3c3ab8329 100644 --- a/src/mesa/drivers/dos/vesa.h +++ b/src/mesa/drivers/dos/vesa.h @@ -23,9 +23,9 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa + * DOS/DJGPP device driver for Mesa * - * Copyright (C) 2002 - Borca Daniel + * Author: Daniel Borca * Email : dborca@yahoo.com * Web : http://www.geocities.com/dborca */ @@ -42,6 +42,24 @@ extern void vesa_b_dump_virtual (void); extern void vesa_l_dump_virtual (void); extern void vesa_l_dump_virtual_mmx (void); +extern void vesa_l_dump_32_to_24 (void); +extern void vesa_l_dump_32_to_16 (void); +extern void vesa_l_dump_32_to_15 (void); +extern void vesa_l_dump_32_to_8 (void); +extern void vesa_l_dump_24_to_32 (void); +extern void vesa_l_dump_24_to_8 (void); +extern void vesa_l_dump_16_to_15 (void); +extern void vesa_l_dump_16_to_8 (void); + +extern void vesa_b_dump_32_to_24 (void); +extern void vesa_b_dump_32_to_16 (void); +extern void vesa_b_dump_32_to_15 (void); +extern void vesa_b_dump_32_to_8 (void); +extern void vesa_b_dump_24_to_32 (void); +extern void vesa_b_dump_24_to_8 (void); +extern void vesa_b_dump_16_to_15 (void); +extern void vesa_b_dump_16_to_8 (void); + extern vl_driver VESA; #endif diff --git a/src/mesa/drivers/dos/vga.c b/src/mesa/drivers/dos/vga.c index 27758f14d25..5a6447dd87b 100644 --- a/src/mesa/drivers/dos/vga.c +++ b/src/mesa/drivers/dos/vga.c @@ -23,9 +23,9 @@ */ /* - * DOS/DJGPP device driver v1.7 for Mesa + * DOS/DJGPP device driver for Mesa * - * Copyright (C) 2002 - Borca Daniel + * Author: Daniel Borca * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca */ @@ -123,6 +123,41 @@ vga_fini (void) } +/* Desc: Attempts to choose a suitable blitter. + * + * In : ptr to mode structure, software framebuffer bits + * Out : blitter funciton, or NULL + * + * Note: - + */ +static BLTFUNC +_choose_blitter (vl_mode *p, int fbbits) +{ + BLTFUNC blitter; + + switch (fbbits) { + case 8: + blitter = _can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual; + break; + case 16: + blitter = vesa_l_dump_16_to_8; + break; + case 24: + blitter = vesa_l_dump_24_to_8; + break; + case 32: + blitter = vesa_l_dump_32_to_8; + break; + default: + return NULL; + } + + return blitter; + + (void)p; +} + + /* Desc: Attempts to enter specified video mode. * * In : ptr to mode structure, refresh rate @@ -131,27 +166,31 @@ vga_fini (void) * Note: - */ static int -vga_entermode (vl_mode *p, int refresh) +vga_entermode (vl_mode *p, int refresh, int fbbits) { - if (!(p->mode & 0x4000)) { - return -1; - } - VGA.blit = _can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual; + if (!(p->mode & 0x4000)) { + return -1; + } - if (oldmode == -1) { - __asm("\n\ + VGA.blit = _choose_blitter(p, fbbits); + if (VGA.blit == NULL) { + return !0; + } + + if (oldmode == -1) { + __asm("\n\ movb $0x0f, %%ah \n\ int $0x10 \n\ andl $0xff, %%eax \n\ movl %%eax, %0 \n\ - ":"=g"(oldmode)::"%eax", "%ebx"); - } + ":"=g"(oldmode)::"%eax", "%ebx"); + } - __asm("int $0x10"::"a"(p->mode&0xff)); + __asm("int $0x10"::"a"(p->mode&0xff)); - return 0; + return 0; - (void)refresh; /* silence compiler warning */ + (void)refresh; /* silence compiler warning */ } diff --git a/src/mesa/drivers/dos/vga.h b/src/mesa/drivers/dos/vga.h index aeb8faddaed..7c17625a3ca 100644 --- a/src/mesa/drivers/dos/vga.h +++ b/src/mesa/drivers/dos/vga.h @@ -23,9 +23,9 @@ */ /* - * DOS/DJGPP device driver v1.3 for Mesa + * DOS/DJGPP device driver for Mesa * - * Copyright (C) 2002 - Borca Daniel + * Author: Daniel Borca * Email : dborca@yahoo.com * Web : http://www.geocities.com/dborca */ diff --git a/src/mesa/drivers/dos/video.c b/src/mesa/drivers/dos/video.c index 60370afc8ef..468207fbf6f 100644 --- a/src/mesa/drivers/dos/video.c +++ b/src/mesa/drivers/dos/video.c @@ -23,9 +23,9 @@ */ /* - * DOS/DJGPP device driver v1.6 for Mesa + * DOS/DJGPP device driver for Mesa * - * Copyright (C) 2002 - Borca Daniel + * Author: Daniel Borca * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca * @@ -53,17 +53,25 @@ int vl_current_stride, vl_current_width, vl_current_height, vl_current_bytes; int vl_current_offset, vl_current_delta; -#if HUGE_LOOKUP -/* These lookup tables are used to extract RGB values in [0,255] - * from 15/16-bit pixel values. - */ -static unsigned char pix15r[0x8000]; -static unsigned char pix15g[0x8000]; -static unsigned char pix15b[0x8000]; -static unsigned char pix16r[0x10000]; -static unsigned char pix16g[0x10000]; -static unsigned char pix16b[0x10000]; -#else +void (*vl_flip) (void); + + +/* FakeColor data */ +#define R_CNT 6 +#define G_CNT 6 +#define B_CNT 6 + +#define R_BIAS 7 +#define G_BIAS 7 +#define B_BIAS 7 + +static word32 VGAPalette[256]; +word8 array_r[256]; +word8 array_g[256]; +word8 array_b[256]; +word8 tab_16_8[0x10000]; + + /* lookup table for scaling 5 bit colors up to 8 bits */ static int _rgb_scale_5[32] = { 0, 8, 16, 25, 33, 41, 49, 58, @@ -71,7 +79,6 @@ static int _rgb_scale_5[32] = { 132, 140, 148, 156, 165, 173, 181, 189, 197, 206, 214, 222, 230, 239, 247, 255 }; -#endif /* lookup table for scaling 6 bit colors up to 8 bits */ static int _rgb_scale_6[64] = { @@ -85,92 +92,6 @@ static int _rgb_scale_6[64] = { 227, 231, 235, 239, 243, 247, 251, 255 }; -/* FakeColor data */ -#define R_CNT 6 -#define G_CNT 6 -#define B_CNT 6 - -#define R_BIAS 7 -#define G_BIAS 7 -#define B_BIAS 7 - -static word32 VGAPalette[256]; -static word8 array_r[256]; -static word8 array_g[256]; -static word8 array_b[256]; - - -int (*vl_mixfix) (fixed r, fixed g, fixed b); -int (*vl_mixrgb) (const unsigned char rgb[]); -int (*vl_mixrgba) (const unsigned char rgba[]); -void (*vl_getrgba) (unsigned int offset, unsigned char rgba[4]); -int (*vl_getpixel) (unsigned int offset); -void (*vl_clear) (int color); -void (*vl_rect) (int x, int y, int width, int height, int color); -void (*vl_flip) (void); -void (*vl_putpixel) (unsigned int offset, int color); - - -/* Desc: color composition (w/o ALPHA) - * - * In : R, G, B - * Out : color - * - * Note: - - */ -static int -vl_mixfix8fake (fixed r, fixed g, fixed b) -{ - return array_b[b>>FIXED_SHIFT]*G_CNT*R_CNT - + array_g[g>>FIXED_SHIFT]*R_CNT - + array_r[r>>FIXED_SHIFT]; -} -#define vl_mixfix8 vl_mixfix8fake -static int -vl_mixfix15 (fixed r, fixed g, fixed b) -{ - return ((r>>(3+FIXED_SHIFT))<<10) - |((g>>(3+FIXED_SHIFT))<<5) - | (b>>(3+FIXED_SHIFT)); -} -static int -vl_mixfix16 (fixed r, fixed g, fixed b) -{ - return ((r>>(3+FIXED_SHIFT))<<11) - |((g>>(2+FIXED_SHIFT))<<5) - | (b>>(3+FIXED_SHIFT)); -} -#define vl_mixfix24 vl_mixfix32 -static int -vl_mixfix32 (fixed r, fixed g, fixed b) -{ - return ((r>>FIXED_SHIFT)<<16) - |((g>>FIXED_SHIFT)<<8) - | (b>>FIXED_SHIFT); -} - - -/* Desc: color composition (w/ ALPHA) - * - * In : array of integers (R, G, B, A) - * Out : color - * - * Note: - - */ -#define vl_mixrgba8 vl_mixrgb8fake -#define vl_mixrgba15 vl_mixrgb15 -#define vl_mixrgba16 vl_mixrgb16 -#define vl_mixrgba24 vl_mixrgb24 -static int -vl_mixrgba32 (const unsigned char rgba[]) -{ - /* Hack alert: - * currently, DMesa uses Mesa's alpha buffer; - * so we don't really care about alpha value here... - */ - return /*(rgba[3]<<24) | */(rgba[0]<<16) | (rgba[1]<<8) | (rgba[2]); -} - /* Desc: color composition (w/o ALPHA) * @@ -180,29 +101,12 @@ vl_mixrgba32 (const unsigned char rgba[]) * Note: - */ static int -vl_mixrgb8fake (const unsigned char rgb[]) +v_mixrgb8fake (const unsigned char rgb[]) { return array_b[rgb[2]]*G_CNT*R_CNT + array_g[rgb[1]]*R_CNT + array_r[rgb[0]]; } -#define vl_mixrgb8 vl_mixrgb8fake -static int -vl_mixrgb15 (const unsigned char rgb[]) -{ - return ((rgb[0]>>3)<<10) | ((rgb[1]>>3)<<5) | (rgb[2]>>3); -} -static int -vl_mixrgb16 (const unsigned char rgb[]) -{ - return ((rgb[0]>>3)<<11) | ((rgb[1]>>2)<<5) | (rgb[2]>>3); -} -#define vl_mixrgb24 vl_mixrgb32 -static int -vl_mixrgb32 (const unsigned char rgb[]) -{ - return (rgb[0]<<16) | (rgb[1]<<8) | (rgb[2]); -} /* Desc: color decomposition @@ -213,102 +117,43 @@ vl_mixrgb32 (const unsigned char rgb[]) * Note: uses current read buffer */ static void -v_getrgba8fake6 (unsigned int offset, unsigned char rgba[4]) +v_getrgb8fake6 (unsigned int offset, unsigned char rgb[]) { word32 c = VGAPalette[((word8 *)vl_current_read_buffer)[offset]]; - rgba[0] = _rgb_scale_6[(c >> 16) & 0x3F]; - rgba[1] = _rgb_scale_6[(c >> 8) & 0x3F]; - rgba[2] = _rgb_scale_6[ c & 0x3F]; - /*rgba[3] = c >> 24;*/ /* dummy alpha; we have separate SW alpha, so ignore */ + rgb[0] = _rgb_scale_6[(c >> 16) & 0x3F]; + rgb[1] = _rgb_scale_6[(c >> 8) & 0x3F]; + rgb[2] = _rgb_scale_6[ c & 0x3F]; } static void -v_getrgba8fake8 (unsigned int offset, unsigned char rgba[4]) +v_getrgb8fake8 (unsigned int offset, unsigned char rgb[]) { word32 c = VGAPalette[((word8 *)vl_current_read_buffer)[offset]]; - rgba[0] = c >> 16; - rgba[1] = c >> 8; - rgba[2] = c; - /*rgba[3] = c >> 24;*/ /* dummy alpha; we have separate SW alpha, so ignore */ -} -#define v_getrgba8 v_getrgba8fake6 -static void -v_getrgba15 (unsigned int offset, unsigned char rgba[4]) -{ - word32 c = ((word16 *)vl_current_read_buffer)[offset]; -#if HUGE_LOOKUP - c &= 0x7fff; - rgba[0] = pix15r[c]; - rgba[1] = pix15g[c]; - rgba[2] = pix15b[c]; -#else - rgba[0] = _rgb_scale_5[(c >> 10) & 0x1F]; - rgba[1] = _rgb_scale_5[(c >> 5) & 0x1F]; - rgba[2] = _rgb_scale_5[ c & 0x1F]; -#endif - /*rgba[3] = 255;*/ /* dummy alpha; we have separate SW alpha, so ignore */ -} -static void -v_getrgba16 (unsigned int offset, unsigned char rgba[4]) -{ - word32 c = ((word16 *)vl_current_read_buffer)[offset]; -#if HUGE_LOOKUP - rgba[0] = pix16r[c]; - rgba[1] = pix16g[c]; - rgba[2] = pix16b[c]; -#else - rgba[0] = _rgb_scale_5[(c >> 11) & 0x1F]; - rgba[1] = _rgb_scale_6[(c >> 5) & 0x3F]; - rgba[2] = _rgb_scale_5[ c & 0x1F]; -#endif - /*rgba[3] = 255;*/ /* dummy alpha; we have separate SW alpha, so ignore */ -} -static void -v_getrgba24 (unsigned int offset, unsigned char rgba[4]) -{ - word32 c = *(word32 *)((long)vl_current_read_buffer+offset*3); - rgba[0] = c >> 16; - rgba[1] = c >> 8; - rgba[2] = c; - /*rgba[3] = 255;*/ /* dummy alpha; we have separate SW alpha, so ignore */ -} -static void -v_getrgba32 (unsigned int offset, unsigned char rgba[4]) -{ - word32 c = ((word32 *)vl_current_read_buffer)[offset]; - rgba[0] = c >> 16; - rgba[1] = c >> 8; - rgba[2] = c; - /*rgba[3] = c >> 24;*/ /* dummy alpha; we have separate SW alpha, so ignore */ + rgb[0] = c >> 16; + rgb[1] = c >> 8; + rgb[2] = c; } -/* Desc: pixel retrieval +/* Desc: create R5G6B5 to FakeColor table lookup * - * In : pixel offset - * Out : pixel value + * In : - + * Out : - * - * Note: uses current read buffer + * Note: - */ -static int -v_getpixel8 (unsigned int offset) -{ - return ((word8 *)vl_current_read_buffer)[offset]; -} -#define v_getpixel15 v_getpixel16 -static int -v_getpixel16 (unsigned int offset) -{ - return ((word16 *)vl_current_read_buffer)[offset]; -} -static int -v_getpixel24 (unsigned int offset) -{ - return *(word32 *)((long)vl_current_read_buffer+offset*3); -} -static int -v_getpixel32 (unsigned int offset) +static void +init_tab_16_8 (void) { - return ((word32 *)vl_current_read_buffer)[offset]; + int i; + for (i = 0; i < 0x10000; i++) { + unsigned char rgb[3]; + rgb[0] = _rgb_scale_5[(i >> 11) & 0x1F]; + rgb[1] = _rgb_scale_6[(i >> 5) & 0x3F]; + rgb[2] = _rgb_scale_5[ i & 0x1F]; + tab_16_8[i] = v_mixrgb8fake(rgb); + } + (void)v_getrgb8fake6; + (void)v_getrgb8fake8; } @@ -379,54 +224,6 @@ fake_buildpalette (int bits) } -#if HUGE_LOOKUP -/* Desc: initialize lookup arrays - * - * In : - - * Out : - - * - * Note: - - */ -void -v_init_pixeltables (void) -{ - unsigned int pixel; - - for (pixel = 0; pixel <= 0xffff; pixel++) { - unsigned int r, g, b; - - if (pixel <= 0x7fff) { - /* 15bit */ - r = (pixel & 0x7c00) >> 8; - g = (pixel & 0x03E0) >> 3; - b = (pixel & 0x001F) << 2; - - r = (unsigned int)(((double)r * 255. / 0x7c) + 0.5); - g = (unsigned int)(((double)g * 255. / 0x7c) + 0.5); - b = (unsigned int)(((double)b * 255. / 0x7c) + 0.5); - - pix15r[pixel] = r; - pix15g[pixel] = g; - pix15b[pixel] = b; - } - - /* 16bit */ - r = (pixel & 0xF800) >> 8; - g = (pixel & 0x07E0) >> 3; - b = (pixel & 0x001F) << 3; - - r = (unsigned int)(((double)r * 255. / 0xF8) + 0.5); - g = (unsigned int)(((double)g * 255. / 0xFC) + 0.5); - b = (unsigned int)(((double)b * 255. / 0xF8) + 0.5); - - pix16r[pixel] = r; - pix16g[pixel] = g; - pix16b[pixel] = b; - } -} -#endif - - /* Desc: initialize hardware * * In : - @@ -471,7 +268,7 @@ v_init_hw (void) int vl_sync_buffer (void **buffer, int x, int y, int width, int height) { - if ((width & 7) || (x < 0) || (y < 0) || (x+width > video_mode->xres) || (y+height > video_mode->yres)) { + if ((/*XXX*/width & 7) || (x < 0) || (y < 0) || (x+width > video_mode->xres) || (y+height > video_mode->yres)) { return -1; } else { void *newbuf = *buffer; @@ -553,38 +350,21 @@ vl_setup_mode (vl_mode *p) return -1; } -#define INITPTR(bpp) \ - vl_putpixel = v_putpixel##bpp; \ - vl_getrgba = v_getrgba##bpp; \ - vl_getpixel = v_getpixel##bpp; \ - vl_rect = v_rect##bpp; \ - vl_mixfix = vl_mixfix##bpp; \ - vl_mixrgb = vl_mixrgb##bpp; \ - vl_mixrgba = vl_mixrgba##bpp; \ - vl_clear = _can_mmx() ? v_clear##bpp##_mmx : v_clear##bpp - switch (p->bpp) { case 8: - INITPTR(8); break; case 15: - INITPTR(15); break; case 16: - INITPTR(16); break; case 24: - INITPTR(24); break; case 32: - INITPTR(32); break; default: return -1; } -#undef INITPTR - video_mode = p; video_bypp = (p->bpp+7)/8; video_scanlen = p->scanlen; @@ -618,7 +398,7 @@ vl_video_exit (void) * Note: - */ int -vl_video_init (int width, int height, int bpp, int rgb, int refresh) +vl_video_init (int width, int height, int bpp, int rgb, int refresh, int fbbits) { int fake; vl_mode *p, *q; @@ -630,11 +410,6 @@ vl_video_init (int width, int height, int bpp, int rgb, int refresh) } else if (bpp == 8) { fake = 1; } -#if HUGE_LOOKUP - else if (bpp < 24) { - v_init_pixeltables(); - } -#endif /* initialize hardware */ if ((q = v_init_hw()) == NULL) { @@ -651,18 +426,16 @@ vl_video_init (int width, int height, int bpp, int rgb, int refresh) } } - /* setup and enter mode */ - if ((vl_setup_mode(p) == 0) && (drv->entermode(p, refresh) == 0)) { - vl_flip = drv->blit; - if (fake) { - drv->get(VL_GET_CI_PREC, (int *)(&min)); - fake_buildpalette(min); - if (min == 8) { - vl_getrgba = v_getrgba8fake8; - } - } - return bpp; - } + /* setup and enter mode */ + if ((vl_setup_mode(p) == 0) && (drv->entermode(p, refresh, fbbits) == 0)) { + vl_flip = drv->blit; + if (fake) { + drv->get(VL_GET_CI_PREC, (int *)(&min)); + fake_buildpalette(min); + init_tab_16_8(); + } + return bpp; + } /* abort */ return 0; diff --git a/src/mesa/drivers/dos/video.h b/src/mesa/drivers/dos/video.h index e928f19c373..e0841167429 100644 --- a/src/mesa/drivers/dos/video.h +++ b/src/mesa/drivers/dos/video.h @@ -23,9 +23,9 @@ */ /* - * DOS/DJGPP device driver v1.5 for Mesa + * DOS/DJGPP device driver for Mesa * - * Copyright (C) 2002 - Borca Daniel + * Author: Daniel Borca * Email : dborca@users.sourceforge.net * Web : http://www.geocities.com/dborca */ @@ -43,16 +43,7 @@ typedef int fixed; #define VL_GET_SCREEN_SIZE 0x0202 #define VL_GET_VIDEO_MODES 0x0300 -extern int (*vl_mixfix) (fixed r, fixed g, fixed b); -extern int (*vl_mixrgb) (const unsigned char rgb[]); -extern int (*vl_mixrgba) (const unsigned char rgba[]); -extern void (*vl_getrgba) (unsigned int offset, unsigned char rgba[4]); - -extern void (*vl_clear) (int color); -extern void (*vl_rect) (int x, int y, int width, int height, int color); extern void (*vl_flip) (void); -extern void (*vl_putpixel) (unsigned int offset, int color); -extern int (*vl_getpixel) (unsigned int offset); void vl_setCI (int index, float red, float green, float blue); @@ -60,6 +51,6 @@ int vl_sync_buffer (void **buffer, int x, int y, int width, int height); int vl_get (int pname, int *params); void vl_video_exit (void); -int vl_video_init (int width, int height, int bpp, int rgb, int refresh); +int vl_video_init (int width, int height, int bpp, int rgb, int refresh, int fbbits); #endif diff --git a/src/mesa/drivers/dos/virtual.S b/src/mesa/drivers/dos/virtual.S deleted file mode 100644 index c5cc1fe86f8..00000000000 --- a/src/mesa/drivers/dos/virtual.S +++ /dev/null @@ -1,489 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver v1.3 for Mesa - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - - .file "virtual.S" - -/* - * extern void *vl_current_draw_buffer; - * extern int vl_current_width, vl_current_bytes; - */ - - .text - -/* Desc: void v_clear8 (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_clear8 -_v_clear8: - movl 4(%esp), %eax - movb %al, %ah - pushw %ax - pushw %ax - popl %eax - jmp _v_clear_common - -/* Desc: void v_clear16 (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_clear16 -_v_clear16: - movl 4(%esp), %eax - pushw %ax - pushw %ax - popl %eax - jmp _v_clear_common - -/* Desc: void v_clear32 (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_clear32 -_v_clear32: - movl 4(%esp), %eax - .balign 4 -_v_clear_common: - movl _vl_current_bytes, %ecx - movl _vl_current_draw_buffer, %edx - shrl $2, %ecx - .balign 4 - 0: - movl %eax, (%edx) - addl $4, %edx - decl %ecx - jnz 0b - ret - -/* Desc: void v_clear8_mmx (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_clear8_mmx -_v_clear8_mmx: -#ifdef USE_MMX_ASM - movd 4(%esp), %mm0 - punpcklbw %mm0, %mm0 - punpcklwd %mm0, %mm0 - jmp _v_clear_common_mmx -#endif - -/* Desc: void v_clear16_mmx (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_clear16_mmx -_v_clear16_mmx: -#ifdef USE_MMX_ASM - movd 4(%esp), %mm0 - punpcklwd %mm0, %mm0 - jmp _v_clear_common_mmx -#endif - -/* Desc: void v_clear32_mmx (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_clear32_mmx -_v_clear32_mmx: -#ifdef USE_MMX_ASM - movd 4(%esp), %mm0 - .balign 4 -_v_clear_common_mmx: - punpckldq %mm0, %mm0 - movl _vl_current_bytes, %ecx - movl _vl_current_draw_buffer, %edx - shrl $3, %ecx - .balign 4 - 0: - movq %mm0, (%edx) - addl $8, %edx - decl %ecx - jnz 0b - emms -#endif - ret - -/* Desc: void v_clear24 (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_clear24 -_v_clear24: - movl $0xaaaaaaab, %eax - mull _vl_current_bytes - movl 4(%esp), %eax - movl %edx, %ecx - pushl %ebx - movl _vl_current_draw_buffer, %edx - shrl %ecx - movb 10(%esp), %bl - .balign 4 - 0: - movw %ax, (%edx) - movb %bl, 2(%edx) - addl $3, %edx - decl %ecx - jnz 0b - popl %ebx - ret - -/* Desc: void v_clear24_mmx (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_clear24_mmx -_v_clear24_mmx: -#ifdef USE_MMX_ASM - movl 4(%esp), %eax - movl %eax, %edx - movl %eax, %ecx - shll $16, %edx - rorl $8, %ecx - movw %cx, %dx - rorl $16, %ecx - movb %dh, %cl - shll $8, %eax - movb %ch, %al - rorl $8, %eax - - pushl %edx - pushl %eax - movq (%esp), %mm0 - pushl %ecx - movq (%esp), %mm1 - pushl %edx - movq (%esp), %mm2 - - movl $0xaaaaaaab, %eax - mull _vl_current_bytes - movl %edx, %ecx - movl _vl_current_draw_buffer, %edx - shrl $4, %ecx - .balign 4 - 0: - movq %mm0, (%edx) - movq %mm1, 8(%edx) - movq %mm2, 16(%edx) - addl $24, %edx - decl %ecx - jnz 0b - emms - addl $16, %esp -#endif - ret - -/* Desc: void v_rect8 (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_rect8 -_v_rect8: - cld - pushl %esi - pushl %edi - movl 28(%esp), %eax - movl _vl_current_width, %esi - movl 16(%esp), %edi - movb %al, %ah - movl 20(%esp), %ecx - imull %esi, %edi - movl 24(%esp), %edx - subl %ecx, %esi - addl 12(%esp), %edi - pushw %ax - pushw %ax - pushl %ds - popl %es - addl _vl_current_draw_buffer, %edi - popl %eax - pushl %ebx - movl %ecx, %ebx - andl $3, %ebx - .balign 4 - 0: - pushl %ecx - .balign 4 - 1: - shrl $2, %ecx - rep; stosl - testl %ebx, %ebx - jz 2f - movl %ebx, %ecx - rep; stosb - .balign 4 - 2: - popl %ecx - addl %esi, %edi - decl %edx - jnz 0b - popl %ebx - popl %edi - popl %esi - ret - -/* Desc: void v_rect16 (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_rect16 -_v_rect16: - cld - pushl %esi - pushl %edi - movl 28(%esp), %eax - movl _vl_current_width, %esi - movl 16(%esp), %edi - movl 20(%esp), %ecx - imull %esi, %edi - movl 24(%esp), %edx - subl %ecx, %esi - addl 12(%esp), %edi - pushw %ax - shll %esi - pushw %ax - shll %edi - pushl %ds - popl %es - addl _vl_current_draw_buffer, %edi - popl %eax - .balign 4 - 0: - pushl %ecx - .balign 4 - 1: - shrl %ecx - rep; stosl - jnc 2f - stosw - .balign 4 - 2: - popl %ecx - addl %esi, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - ret - -/* Desc: void v_rect24 (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_rect24 -_v_rect24: - pushl %esi - pushl %edi - movl 28(%esp), %eax - movl _vl_current_width, %esi - movl 16(%esp), %edi - movl 20(%esp), %ecx - imull %esi, %edi - movl 24(%esp), %edx - subl %ecx, %esi - addl 12(%esp), %edi - leal (%esi, %esi, 2), %esi - pushl %ebx - leal (%edi, %edi, 2), %edi - movl %eax, %ebx - addl _vl_current_draw_buffer, %edi - shrl $16, %ebx - .balign 4 - 0: - pushl %ecx - .balign 4 - 1: - movw %ax, (%edi) - movb %bl, 2(%edi) - addl $3, %edi - decl %ecx - jnz 1b - popl %ecx - addl %esi, %edi - decl %edx - jnz 0b - popl %ebx - popl %edi - popl %esi - ret - -/* Desc: void v_rect32 (int color); - * - * In : color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_rect32 -_v_rect32: - pushl %esi - pushl %edi - movl _vl_current_width, %esi - movl 16(%esp), %edi - movl 20(%esp), %ecx - imull %esi, %edi - movl 24(%esp), %edx - subl %ecx, %esi - addl 12(%esp), %edi - shll $2, %esi - shll $2, %edi - movl 28(%esp), %eax - addl _vl_current_draw_buffer, %edi - .balign 4 - 0: - pushl %ecx - .balign 4 - 1: - movl %eax, (%edi) - addl $4, %edi - decl %ecx - jnz 1b - popl %ecx - addl %esi, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - ret - -/* Desc: void v_putpixel8 (unsigned int offset, int color); - * - * In : offset within buffer, color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_putpixel8 -_v_putpixel8: - movl 8(%esp), %ecx - movl 4(%esp), %edx - movl _vl_current_draw_buffer, %eax - movb %cl, (%eax,%edx) - ret - -/* Desc: void v_putpixel16 (unsigned int offset, int color); - * - * In : offset within buffer, color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_putpixel16 -_v_putpixel16: - movl 8(%esp), %ecx - movl 4(%esp), %edx - movl _vl_current_draw_buffer, %eax - movw %cx, (%eax,%edx,2) - ret - -/* Desc: void v_putpixel24 (unsigned int offset, int color); - * - * In : offset within buffer, color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_putpixel24 -_v_putpixel24: - movl 4(%esp), %eax - movl 8(%esp), %edx - movl _vl_current_draw_buffer, %ecx - leal (%eax,%eax,2), %eax - movw %dx, (%ecx,%eax) - shrl $16, %edx - movb %dl, 2(%ecx,%eax) - ret - -/* Desc: void v_putpixel32 (unsigned int offset, int color); - * - * In : offset within buffer, color - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _v_putpixel32 -_v_putpixel32: - movl 8(%esp), %ecx - movl 4(%esp), %edx - movl _vl_current_draw_buffer, %eax - movl %ecx, (%eax,%edx,4) - ret -- cgit v1.2.3 From ea2b71106178280903935f784de8abdabd1ab50f Mon Sep 17 00:00:00 2001 From: David Reveman Date: Tue, 11 Apr 2006 12:19:06 +0000 Subject: Add attrib_list to glXBindTexImageEXT --- include/GL/glx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 1f5d778e34b..f4cc50b90f4 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -425,7 +425,7 @@ typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void); /* XXX need enums/tokens! */ -extern Bool glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer); +extern Bool glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list); extern Bool glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer); #endif /* GLX_EXT_texture_from_pixmap */ -- cgit v1.2.3 From ba23f699f03e45a7519cb41cc853deba686ff8d9 Mon Sep 17 00:00:00 2001 From: David Reveman Date: Tue, 11 Apr 2006 12:21:48 +0000 Subject: FBConfig support for EXT_tfp --- include/GL/internal/glcore.h | 18 ++++++++++++++ src/glx/x11/glxext.c | 15 ++++++++++++ src/mesa/drivers/dri/common/glcontextmodes.c | 36 +++++++++++++++++++++++++++- 3 files changed, 68 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/internal/glcore.h b/include/GL/internal/glcore.h index 48748d91e8f..b2224b753ec 100644 --- a/include/GL/internal/glcore.h +++ b/include/GL/internal/glcore.h @@ -137,6 +137,13 @@ typedef struct __GLcontextModesRec { GLint swapMethod; GLint screen; + + /* EXT_texture_from_pixmap */ + GLint bindToTextureRgb; + GLint bindToTextureRgba; + GLint bindToMipmapTexture; + GLint bindToTextureTargets; + GLint yInverted; } __GLcontextModes; /* Several fields of __GLcontextModes can take these as values. Since @@ -166,6 +173,17 @@ typedef struct __GLcontextModesRec { #define GLX_PIXMAP_BIT 0x00000002 #define GLX_PBUFFER_BIT 0x00000004 +#define GLX_Y_INVERTED_EXT 0x6009 +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x600A +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x600B +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x600C +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x600D + +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 + + /************************************************************************/ /* diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c index 14d5ffa4f96..d687a6f5ba9 100644 --- a/src/glx/x11/glxext.c +++ b/src/glx/x11/glxext.c @@ -595,6 +595,21 @@ __glXInitializeVisualConfigFromTags( __GLcontextModes *config, int count, case GLX_SAMPLES_SGIS: config->samples = *bp++; break; + case GLX_BIND_TO_TEXTURE_RGB_EXT: + config->bindToTextureRgb = *bp++; + break; + case GLX_BIND_TO_TEXTURE_RGBA_EXT: + config->bindToTextureRgba = *bp++; + break; + case GLX_BIND_TO_MIPMAP_TEXTURE_EXT: + config->bindToMipmapTexture = *bp++; + break; + case GLX_BIND_TO_TEXTURE_TARGETS_EXT: + config->bindToTextureTargets = *bp++; + break; + case GLX_Y_INVERTED_EXT: + config->yInverted = *bp++; + break; case None: i = count; break; diff --git a/src/mesa/drivers/dri/common/glcontextmodes.c b/src/mesa/drivers/dri/common/glcontextmodes.c index f9e6715fcd2..edb04463f61 100644 --- a/src/mesa/drivers/dri/common/glcontextmodes.c +++ b/src/mesa/drivers/dri/common/glcontextmodes.c @@ -182,6 +182,15 @@ _gl_copy_visual_to_context_mode( __GLcontextModes * mode, mode->transparentIndex = config->transparentIndex; mode->swapMethod = GLX_SWAP_UNDEFINED_OML; + + mode->bindToTextureRgb = (mode->rgbMode) ? GL_TRUE : GL_FALSE; + mode->bindToTextureRgba = (mode->rgbMode && mode->alphaBits) ? + GL_TRUE : GL_FALSE; + mode->bindToMipmapTexture = mode->rgbMode ? GL_TRUE : GL_FALSE; + mode->bindToTextureTargets = mode->rgbMode ? + GLX_TEXTURE_1D_BIT_EXT | GLX_TEXTURE_2D_BIT_EXT | + GLX_TEXTURE_RECTANGLE_BIT_EXT : 0; + mode->yInverted = GL_FALSE; } @@ -313,6 +322,21 @@ _gl_get_context_mode_data(const __GLcontextModes *mode, int attribute, case GLX_SAMPLES_SGIS: *value_return = mode->samples; return 0; + case GLX_BIND_TO_TEXTURE_RGB_EXT: + *value_return = mode->bindToTextureRgb; + return 0; + case GLX_BIND_TO_TEXTURE_RGBA_EXT: + *value_return = mode->bindToTextureRgba; + return 0; + case GLX_BIND_TO_MIPMAP_TEXTURE_EXT: + *value_return = mode->bindToMipmapTexture; + return 0; + case GLX_BIND_TO_TEXTURE_TARGETS_EXT: + *value_return = mode->bindToTextureTargets; + return 0; + case GLX_Y_INVERTED_EXT: + *value_return = mode->yInverted; + return 0; /* Applications are NOT allowed to query GLX_VISUAL_SELECT_GROUP_SGIX. * It is ONLY for communication between the GLX client and the GLX @@ -383,6 +407,11 @@ _gl_context_modes_create( unsigned count, size_t minimum_size ) (*next)->xRenderable = GLX_DONT_CARE; (*next)->fbconfigID = GLX_DONT_CARE; (*next)->swapMethod = GLX_SWAP_UNDEFINED_OML; + (*next)->bindToTextureRgb = GLX_DONT_CARE; + (*next)->bindToTextureRgba = GLX_DONT_CARE; + (*next)->bindToMipmapTexture = GLX_DONT_CARE; + (*next)->bindToTextureTargets = 0; + (*next)->yInverted = GLX_DONT_CARE; next = & ((*next)->next); } @@ -495,5 +524,10 @@ _gl_context_modes_are_same( const __GLcontextModes * a, (a->maxPbufferPixels == b->maxPbufferPixels) && (a->optimalPbufferWidth == b->optimalPbufferWidth) && (a->optimalPbufferHeight == b->optimalPbufferHeight) && - (a->swapMethod == b->swapMethod) ); + (a->swapMethod == b->swapMethod) && + (a->bindToTextureRgb == b->bindToTextureRgb) && + (a->bindToTextureRgba == b->bindToTextureRgba) && + (a->bindToMipmapTexture == b->bindToMipmapTexture) && + (a->bindToTextureTargets == b->bindToTextureTargets) && + (a->yInverted == b->yInverted) ); } -- cgit v1.2.3 From 015762455764e3b467f0df769d51d0ed0ea3ee2c Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 1 May 2006 22:25:18 +0000 Subject: Update function signatures for EXT_tfp entrypoints. --- include/GL/glx.h | 4 ++-- src/glx/x11/glxcmds.c | 20 ++++++++------------ 2 files changed, 10 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index f4cc50b90f4..165d105b882 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -425,8 +425,8 @@ typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void); /* XXX need enums/tokens! */ -extern Bool glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list); -extern Bool glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer); +extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list); +extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer); #endif /* GLX_EXT_texture_from_pixmap */ diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index c34bbc5d215..d0f5e9a3629 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -2641,7 +2641,7 @@ PUBLIC Bool glXSet3DfxModeMESA( int mode ) } /*@}*/ -PUBLIC Bool glXBindTexImageEXT(Display *dpy, +PUBLIC void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list) @@ -2656,7 +2656,7 @@ PUBLIC Bool glXBindTexImageEXT(Display *dpy, unsigned int i; if (gc == NULL) - return False; + return; i = 0; if (attrib_list) { @@ -2666,12 +2666,12 @@ PUBLIC Bool glXBindTexImageEXT(Display *dpy, #ifdef GLX_DIRECT_RENDERING if (gc->isDirect) - return False; + return; #endif opcode = __glXSetupForCommand(dpy); if (!opcode) - return False; + return; LockDisplay(dpy); GetReqExtra(GLXVendorPrivate, 12 + 8 * i,req); @@ -2701,11 +2701,9 @@ PUBLIC Bool glXBindTexImageEXT(Display *dpy, UnlockDisplay(dpy); SyncHandle(); - - return True; } -PUBLIC Bool glXReleaseTexImageEXT(Display *dpy, +PUBLIC void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer) { @@ -2716,16 +2714,16 @@ PUBLIC Bool glXReleaseTexImageEXT(Display *dpy, CARD8 opcode; if (gc == NULL) - return False; + return; #ifdef GLX_DIRECT_RENDERING if (gc->isDirect) - return False; + return; #endif opcode = __glXSetupForCommand(dpy); if (!opcode) - return False; + return; LockDisplay(dpy); GetReqExtra(GLXVendorPrivate, sizeof(CARD32)+sizeof(INT32),req); @@ -2742,8 +2740,6 @@ PUBLIC Bool glXReleaseTexImageEXT(Display *dpy, UnlockDisplay(dpy); SyncHandle(); - - return True; } /** -- cgit v1.2.3 From bea7fe57c1f9720ea70654e8302d143579caa39a Mon Sep 17 00:00:00 2001 From: David Reveman Date: Tue, 2 May 2006 08:54:39 +0000 Subject: Update to final EXT_tfp tokens --- include/GL/internal/glcore.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/GL/internal/glcore.h b/include/GL/internal/glcore.h index b2224b753ec..ff1beb71831 100644 --- a/include/GL/internal/glcore.h +++ b/include/GL/internal/glcore.h @@ -173,11 +173,11 @@ typedef struct __GLcontextModesRec { #define GLX_PIXMAP_BIT 0x00000002 #define GLX_PBUFFER_BIT 0x00000004 -#define GLX_Y_INVERTED_EXT 0x6009 -#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x600A -#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x600B -#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x600C -#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x600D +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 #define GLX_TEXTURE_1D_BIT_EXT 0x00000001 #define GLX_TEXTURE_2D_BIT_EXT 0x00000002 -- cgit v1.2.3 From efbf170cfbb0ad8ad8a480a0be581b0908b53138 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 May 2006 18:19:54 +0000 Subject: updated GLX_EXT_texture_from_pixmap tokens (Dave Reveman) --- include/GL/glx.h | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/GL/glx.h b/include/GL/glx.h index 165d105b882..c70a29497cf 100644 --- a/include/GL/glx.h +++ b/include/GL/glx.h @@ -423,7 +423,44 @@ typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void); #ifndef GLX_EXT_texture_from_pixmap #define GLX_EXT_texture_from_pixmap 1 -/* XXX need enums/tokens! */ +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 + +#define GLX_TEXTURE_FORMAT_EXT 0x20D5 +#define GLX_TEXTURE_TARGET_EXT 0x20D6 +#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 + +#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 +#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 +#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA + +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 + +#define GLX_TEXTURE_1D_EXT 0x20DB +#define GLX_TEXTURE_2D_EXT 0x20DC +#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD + +#define GLX_FRONT_LEFT_EXT 0x20DE +#define GLX_FRONT_RIGHT_EXT 0x20DF +#define GLX_BACK_LEFT_EXT 0x20E0 +#define GLX_BACK_RIGHT_EXT 0x20E1 +#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT +#define GLX_BACK_EXT GLX_BACK_LEFT_EXT +#define GLX_AUX0_EXT 0x20E2 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX6_EXT 0x20E8 +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX9_EXT 0x20EB extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list); extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer); -- cgit v1.2.3 From c8f8fbecd7e3b858d1fcbe64bb0ed3e2295f2d5d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 12 Jun 2006 19:47:44 +0000 Subject: remove const qualifier from glGenVertexArraysAPPLE() parameter --- include/GL/glext.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/GL/glext.h b/include/GL/glext.h index 7bb8e6e7cc7..78fca0be1bb 100644 --- a/include/GL/glext.h +++ b/include/GL/glext.h @@ -6154,12 +6154,12 @@ typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint); GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, GLuint *); GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays); typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); #endif -- cgit v1.2.3 From bd0bfd1dc2430d80a7563ae2af0667633277ab00 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 20 Jun 2006 14:52:22 +0000 Subject: reorder a few token definitions --- include/GL/gl.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index aca62af39bf..65797b023dc 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.5 + * Version: 6.5.1 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -441,16 +441,16 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_OR_INVERTED 0x150D /* Stencil */ -#define GL_STENCIL_TEST 0x0B90 -#define GL_STENCIL_WRITEMASK 0x0B98 #define GL_STENCIL_BITS 0x0D57 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 #define GL_STENCIL_FUNC 0x0B92 #define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_REF 0x0B97 #define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 #define GL_STENCIL_INDEX 0x1901 #define GL_KEEP 0x1E00 #define GL_REPLACE 0x1E01 @@ -500,16 +500,16 @@ typedef double GLclampd; /* double precision float in [0,1] */ /* Implementation limits */ #define GL_MAX_LIST_NESTING 0x0B31 -#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 -#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 -#define GL_MAX_NAME_STACK_DEPTH 0x0D37 -#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 -#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 #define GL_MAX_EVAL_ORDER 0x0D30 #define GL_MAX_LIGHTS 0x0D31 #define GL_MAX_CLIP_PLANES 0x0D32 #define GL_MAX_TEXTURE_SIZE 0x0D33 #define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 #define GL_MAX_VIEWPORT_DIMS 0x0D3A #define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B @@ -567,22 +567,22 @@ typedef double GLclampd; /* double precision float in [0,1] */ #define GL_MAP2_GRID_DOMAIN 0x0DD2 #define GL_MAP2_GRID_SEGMENTS 0x0DD3 #define GL_COEFF 0x0A00 -#define GL_DOMAIN 0x0A02 #define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 /* Hints */ -#define GL_FOG_HINT 0x0C54 -#define GL_LINE_SMOOTH_HINT 0x0C52 #define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 #define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 #define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 #define GL_DONT_CARE 0x1100 #define GL_FASTEST 0x1101 #define GL_NICEST 0x1102 /* Scissor box */ -#define GL_SCISSOR_TEST 0x0C11 #define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 /* Pixel Mode / Transfer */ #define GL_MAP_COLOR 0x0D10 @@ -687,8 +687,8 @@ typedef double GLclampd; /* double precision float in [0,1] */ /* Errors */ #define GL_NO_ERROR 0x0 -#define GL_INVALID_VALUE 0x0501 #define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 #define GL_INVALID_OPERATION 0x0502 #define GL_STACK_OVERFLOW 0x0503 #define GL_STACK_UNDERFLOW 0x0504 -- cgit v1.2.3 From 90d7b9c9eb94d9e215642407b99dbc5f30ce2a55 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 1 Aug 2006 16:06:08 +0000 Subject: Move GL_MESA_shader_debug from glext.h to gl.h. --- include/GL/gl_mangle.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 8e6faa67b27..58178f35b67 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -108,6 +108,7 @@ #define glClampColorARB MANGLE(ClampColorARB) #define glClearAccum MANGLE(ClearAccum) #define glClearColor MANGLE(ClearColor) +#define glClearDebugLogMESA MANGLE(ClearDebugLogMESA) #define glClearDepth MANGLE(ClearDepth) #define glClearIndex MANGLE(ClearIndex) #define glClear MANGLE(Clear) @@ -230,6 +231,7 @@ #define glCopyTexSubImage2D MANGLE(CopyTexSubImage2D) #define glCopyTexSubImage3DEXT MANGLE(CopyTexSubImage3DEXT) #define glCopyTexSubImage3D MANGLE(CopyTexSubImage3D) +#define glCreateDebugObjectMESA MANGLE(CreateDebugObjectMESA) #define glCreateProgram MANGLE(CreateProgram) #define glCreateProgramObjectARB MANGLE(CreateProgramObjectARB) #define glCreateShader MANGLE(CreateShader) @@ -438,6 +440,8 @@ #define glGetConvolutionParameterfv MANGLE(GetConvolutionParameterfv) #define glGetConvolutionParameterivEXT MANGLE(GetConvolutionParameterivEXT) #define glGetConvolutionParameteriv MANGLE(GetConvolutionParameteriv) +#define glGetDebugLogLengthMESA MANGLE(GetDebugLogLengthMESA) +#define glGetDebugLogMESA MANGLE(GetDebugLogMESA) #define glGetDetailTexFuncSGIS MANGLE(GetDetailTexFuncSGIS) #define glGetDoublev MANGLE(GetDoublev) #define glGetError MANGLE(GetError) @@ -1470,5 +1474,6 @@ #define glWindowPos4sMESA MANGLE(WindowPos4sMESA) #define glWindowPos4svMESA MANGLE(WindowPos4svMESA) #define glWriteMaskEXT MANGLE(WriteMaskEXT) +gl.h:GLAPI void GLAPIENTRY #endif /* GL_MANGLE_H */ -- cgit v1.2.3 From 6c071592ab2c249e875edef4c61c13e1005b8fcb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 3 Aug 2006 03:23:05 +0000 Subject: added GL_EXT_texture_sRGB --- include/GL/gl.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'include') diff --git a/include/GL/gl.h b/include/GL/gl.h index 65797b023dc..baab557a53b 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2152,6 +2152,26 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh +#if GL_ARB_shader_objects + +#ifndef GL_MESA_shader_debug +#define GL_MESA_shader_debug 1 + +#define GL_DEBUG_OBJECT_MESA 0x8759 +#define GL_DEBUG_PRINT_MESA 0x875A +#define GL_DEBUG_ASSERT_MESA 0x875B + +GLAPI GLhandleARB APIENTRY glCreateDebugObjectMESA (GLvoid); +GLAPI GLvoid APIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType); +GLAPI GLvoid APIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength, + GLsizei *length, GLcharARB *debugLog); +GLAPI GLsizei APIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType); + +#endif /* GL_MESA_shader_debug */ + +#endif /* GL_ARB_shader_objects */ + + /* * ???. GL_MESA_trace * XXX obsolete @@ -2293,6 +2313,29 @@ typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) #endif /* GL_EXT_packed_depth_stencil */ +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 + +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F + +#endif /* GL_EXT_texture_sRGB */ + + /** ** NOTE!!!!! If you add new functions to this file, or update ** glext.h be sure to regenerate the gl_mangle.h file. See comments -- cgit v1.2.3 From 4b1e6a4b587a3b8839aaf4afcdd88995ff2b47a5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 7 Aug 2006 14:09:13 +0000 Subject: remove stray text from previous check-in --- include/GL/gl_mangle.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h index 58178f35b67..2104d15c96e 100644 --- a/include/GL/gl_mangle.h +++ b/include/GL/gl_mangle.h @@ -1474,6 +1474,5 @@ #define glWindowPos4sMESA MANGLE(WindowPos4sMESA) #define glWindowPos4svMESA MANGLE(WindowPos4svMESA) #define glWriteMaskEXT MANGLE(WriteMaskEXT) -gl.h:GLAPI void GLAPIENTRY #endif /* GL_MANGLE_H */ -- cgit v1.2.3 From 7196cddb3a404292858101f9cd1a5061e422d2c1 Mon Sep 17 00:00:00 2001 From: Sean D'Epagnier Date: Thu, 10 Aug 2006 10:21:17 +0000 Subject: Added initial multisampling support to glfbdev driver. Fully implemented glutGameMode, and added vidresize stubs to make Added support for glutReshapeDisplay to change video mode but not lose current mesa context. implementation glut 5 complient. Fixed many minor bugs Updated docs --- docs/glfbdev-driver.html | 2 +- include/GL/glfbdev.h | 1 + src/glut/fbdev/Makefile | 7 +- src/glut/fbdev/colormap.c | 7 +- src/glut/fbdev/cursor.c | 10 +- src/glut/fbdev/ext.c | 1 - src/glut/fbdev/fbdev.c | 465 ++++++++++++++++++++++++++------------- src/glut/fbdev/gamemode.c | 268 ++++++++++++++++++++-- src/glut/fbdev/input.c | 94 ++++---- src/glut/fbdev/internal.h | 20 +- src/glut/fbdev/menu.c | 42 ++-- src/glut/fbdev/state.c | 13 +- src/glut/fbdev/vidresize.c | 55 +++++ src/mesa/drivers/fbdev/glfbdev.c | 53 ++--- 14 files changed, 748 insertions(+), 290 deletions(-) create mode 100644 src/glut/fbdev/vidresize.c (limited to 'include') diff --git a/docs/glfbdev-driver.html b/docs/glfbdev-driver.html index f191b390fbe..981df7c088a 100644 --- a/docs/glfbdev-driver.html +++ b/docs/glfbdev-driver.html @@ -70,7 +70,7 @@ tty group as well

4. Using fbdevglut

Almost all of the programs in the progs directory use glut, and they compile with fbdevglut. -Currently glBlendFunc is not working with glFBDev. +

To compile the redbook sample programs:

diff --git a/include/GL/glfbdev.h b/include/GL/glfbdev.h
index d2b12815c9f..4e25e7b0566 100644
--- a/include/GL/glfbdev.h
+++ b/include/GL/glfbdev.h
@@ -49,6 +49,7 @@ typedef struct GLFBDevContextRec *GLFBDevContextPtr;
 #define GLFBDEV_STENCIL_SIZE    103
 #define GLFBDEV_ACCUM_SIZE      104
 #define GLFBDEV_LEVEL           105
+#define GLFBDEV_MULTISAMPLE     106
 #define GLFBDEV_NONE              0
 
 /* For glFBDevGetString */
diff --git a/src/glut/fbdev/Makefile b/src/glut/fbdev/Makefile
index 39a48f36343..4f70efe2794 100644
--- a/src/glut/fbdev/Makefile
+++ b/src/glut/fbdev/Makefile
@@ -6,8 +6,8 @@ include $(TOP)/configs/current
 GLX_SHARED = $(TOP)/src/glut/glx
 SHAPES = $(TOP)/src/glut/mini
 
-GLUT_MAJOR = 3
-GLUT_MINOR = 7
+GLUT_MAJOR = 5
+GLUT_MINOR = 0
 GLUT_TINY = 1
 
 INCLUDES = -I$(TOP)/include -I$(GLX_SHARED)
@@ -22,7 +22,8 @@ CORE_SOURCES = \
 	state.c \
 	input.c \
 	callback.c \
-	gamemode.c
+	gamemode.c \
+	vidresize.c
 
 GLX_SHARED_SOURCES = \
 	$(GLX_SHARED)/glut_8x13.c \
diff --git a/src/glut/fbdev/colormap.c b/src/glut/fbdev/colormap.c
index 9a6dea20dc9..157296d15c1 100644
--- a/src/glut/fbdev/colormap.c
+++ b/src/glut/fbdev/colormap.c
@@ -29,7 +29,6 @@
 #include 
 
 #include 
-#include 
 #include 
 
 #include "internal.h"
@@ -53,9 +52,9 @@ static void FindReverseMap(int r, int g, int b)
    unsigned int minv = -1, mini = 0;
    for(i=0; i<256; i++) {
       int val = 0;
-      val += abs(r-(ColorMap.red[i]>>shift));
-      val += abs(g-(ColorMap.green[i]>>shift));
-      val += abs(b-(ColorMap.blue[i]>>shift));
+      val += abs(r-(RedColorMap[i]>>shift));
+      val += abs(g-(GreenColorMap[i]>>shift));
+      val += abs(b-(BlueColorMap[i]>>shift));
       if(val < minv) {
 	 minv = val;
 	 mini = i;
diff --git a/src/glut/fbdev/cursor.c b/src/glut/fbdev/cursor.c
index b753a5c9ff5..06ae2d6f54e 100644
--- a/src/glut/fbdev/cursor.c
+++ b/src/glut/fbdev/cursor.c
@@ -44,7 +44,7 @@ static unsigned char *MouseBuffer;
 
 void InitializeCursor(void)
 {
-   if((MouseBuffer = malloc(CURSOR_WIDTH * CURSOR_HEIGHT
+   if(!MouseBuffer && (MouseBuffer = malloc(CURSOR_WIDTH * CURSOR_HEIGHT
 			    * VarInfo.bits_per_pixel / 8)) == NULL) {
       sprintf(exiterror, "malloc failure\n");
       exit(0);
@@ -216,10 +216,10 @@ void SwapCursor(void)
       if(miny < 0)
 	 miny = 0;
 	
-      if(minx + sizex > VarInfo.xres)
-	 sizex = VarInfo.xres - minx;
-      if(miny + sizey > VarInfo.yres)
-	 sizey = VarInfo.yres - miny;
+      if(minx + sizex > VarInfo.xres - CURSOR_WIDTH)
+	 sizex = VarInfo.xres - CURSOR_WIDTH - minx;
+      if(miny + sizey > VarInfo.yres - CURSOR_HEIGHT)
+	 sizey = VarInfo.yres - CURSOR_HEIGHT - miny;
       off = FixedInfo.line_length * miny
 	 + minx * VarInfo.bits_per_pixel / 8;
       stride = (sizex + CURSOR_WIDTH) * VarInfo.bits_per_pixel / 8;
diff --git a/src/glut/fbdev/ext.c b/src/glut/fbdev/ext.c
index 1746bf33e9c..4a3c185a16d 100644
--- a/src/glut/fbdev/ext.c
+++ b/src/glut/fbdev/ext.c
@@ -25,7 +25,6 @@
  */
 
 #include 
-#include 
 #include 
 
 #include "internal.h"
diff --git a/src/glut/fbdev/fbdev.c b/src/glut/fbdev/fbdev.c
index fcbd4f8da28..ce7d187b66d 100644
--- a/src/glut/fbdev/fbdev.c
+++ b/src/glut/fbdev/fbdev.c
@@ -22,6 +22,9 @@
  * Library for glut using mesa fbdev driver
  *
  * Written by Sean D'Epagnier (c) 2006
+ * 
+ * To improve on this library, maybe support subwindows or overlays,
+ * I (sean at depagnier dot com) will do my best to help.
  */
 
 #include 
@@ -41,16 +44,15 @@
 #include 
 
 #include 
-#include 
 #include 
 
 #include "internal.h"
 
 #define FBMODES "/etc/fb.modes"
 
-
 struct fb_fix_screeninfo FixedInfo;
-struct fb_var_screeninfo VarInfo, OrigVarInfo;
+struct fb_var_screeninfo VarInfo;
+static struct fb_var_screeninfo OrigVarInfo;
 
 static int DesiredDepth = 0;
 
@@ -64,9 +66,9 @@ struct GlutTimer *GlutTimers = NULL;
 struct timeval StartTime;
 
 /* per window data */
-static GLFBDevContextPtr Context;
-static GLFBDevBufferPtr Buffer;
-static GLFBDevVisualPtr Visual;
+GLFBDevContextPtr Context;
+GLFBDevBufferPtr Buffer;
+GLFBDevVisualPtr Visual;
 
 int Redisplay;
 int Visible;
@@ -75,13 +77,9 @@ int Active;
 /* we have to poll to see if we are visible
    on a framebuffer that is not active */
 int VisiblePoll;
+int Swapping, VTSwitch;
 static int FramebufferIndex;
 
-static int RequiredWidth;
-static int RequiredHeight;
-static int InitialWidthHint;
-static int InitialHeightHint;
-
 static int Initialized;
 
 char exiterror[256];
@@ -105,6 +103,9 @@ void TestVisible(void) {
 
 static void Cleanup(void)
 {
+   if(GameMode)
+      glutLeaveGameMode();
+
    if(ConsoleFD != -1)
       RestoreVT();
 
@@ -136,7 +137,7 @@ static void Cleanup(void)
 
    if(exiterror[0])
       fprintf(stderr, "[glfbdev glut] %s", exiterror);
-}
+ }
 
 static void CrashHandler(int sig)
 {
@@ -162,10 +163,9 @@ static void removeArgs(int *argcp, char **argv, int num)
 
 void glutInit (int *argcp, char **argv)
 {
-   int i;
-   int nomouse = 0;
-   int nokeyboard = 0;
-   int usestdin = 0;
+   int i, nomouse = 0, nokeyboard = 0, usestdin = 0;
+   int RequiredWidth = 0, RequiredHeight;
+   char *fbdev;
 
    /* parse out args */
    for (i = 1; i < *argcp;) {
@@ -242,6 +242,61 @@ void glutInit (int *argcp, char **argv)
    if(nokeyboard == 0)
       InitializeVT(usestdin);
 
+   fbdev = getenv("FRAMEBUFFER");
+   if(fbdev) {
+#ifdef MULTIHEAD
+      if(!sscanf(fbdev, "/dev/fb%d", &FramebufferIndex))
+	 if(!sscanf(fbdev, "/dev/fb/%d", &FramebufferIndex))
+	    sprintf(exiterror, "Could not determine Framebuffer index!\n");
+#endif
+   } else {
+      static char fb[128];
+      struct fb_con2fbmap confb;
+      int fd = open("/dev/fb0", O_RDWR);
+
+      FramebufferIndex = 0;
+
+      confb.console = CurrentVT;
+      if(ioctl(fd, FBIOGET_CON2FBMAP, &confb) != -1)
+	 FramebufferIndex = confb.framebuffer;
+      sprintf(fb, "/dev/fb%d", FramebufferIndex);
+      fbdev = fb;
+      close(fd);
+   }
+
+   /* open the framebuffer device */
+   FrameBufferFD = open(fbdev, O_RDWR);
+   if (FrameBufferFD < 0) {
+      sprintf(exiterror, "Error opening %s: %s\n", fbdev, strerror(errno));
+      exit(0);
+   }
+
+   /* Get the fixed screen info */
+   if (ioctl(FrameBufferFD, FBIOGET_FSCREENINFO, &FixedInfo)) {
+      sprintf(exiterror, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n",
+	      strerror(errno));
+      exit(0);
+   }
+
+   /* get the variable screen info */
+   if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &OrigVarInfo)) {
+      sprintf(exiterror, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n",
+	      strerror(errno));
+      exit(0);
+   }
+
+   /* operate on a copy */
+   VarInfo = OrigVarInfo;
+
+   /* set the depth, resolution, etc */
+   if(RequiredWidth)
+      if(!ParseFBModes(RequiredWidth, RequiredWidth, RequiredHeight,
+		       RequiredHeight, 0, MAX_VSYNC)) {
+	 sprintf(exiterror, "No mode (%dx%d) found in "FBMODES"\n",
+		 RequiredWidth, RequiredHeight);
+	 exit(0);
+      }
+
    Initialized = 1;
 }
 
@@ -250,17 +305,109 @@ void glutInitDisplayMode (unsigned int mode)
    DisplayMode = mode;
 }
 
+static const char *GetStrVal(const char *p, int *set, int min, int max)
+{
+   char *endptr;
+   int comp = *p, val;
+
+   if(p[1] == '=')
+      p++;
+
+   if(*p == '\0')
+      return p;
+
+   val = strtol(p+1, &endptr, 10);
+
+   if(endptr == p+1)
+      return p;
+
+   switch(comp) {
+   case '!':
+      if(val == min)
+	 val = max;
+      else
+	 val = min;
+      break;
+   case '<':
+      val = min;
+      break;
+   case '>':
+      val = max;
+      break;
+   }
+
+   if(val < min || val > max) {
+      sprintf(exiterror, "display string value out of range\n");
+      exit(0);
+   }
+
+   *set = val;
+
+   return endptr;
+}
+
+static void SetAttrib(int val, int attr)
+{
+   if(val)
+      DisplayMode |= attr;
+   else
+      DisplayMode &= ~attr;
+}
+
+void glutInitDisplayString(const char *string)
+{
+   const char *p = string;
+   int val;
+   while(*p) {
+      if(*p == ' ')
+	 p++;
+      else
+      if(memcmp(p, "acca", 4) == 0) {
+	 p = GetStrVal(p+4, &AccumSize, 1, 32);
+	 SetAttrib(AccumSize, GLUT_ACCUM);
+      } else
+      if(memcmp(p, "acc", 3) == 0) {
+	 p = GetStrVal(p+3, &AccumSize, 1, 32);
+	 SetAttrib(AccumSize, GLUT_ACCUM);
+      } else
+      if(memcmp(p, "depth", 5) == 0) {
+	 p = GetStrVal(p+5, &DepthSize, 12, 32);
+	 SetAttrib(DepthSize, GLUT_DEPTH);
+      } else
+      if(memcmp(p, "double", 6) == 0) {
+	 val = 1;
+	 p = GetStrVal(p+6, &val, 0, 1);
+	 SetAttrib(val, GLUT_DOUBLE);
+      } else
+      if(memcmp(p, "index", 5) == 0) {
+	 val = 1;
+	 p = GetStrVal(p+5, &val, 0, 1);
+	 SetAttrib(val, GLUT_INDEX);
+      } else
+      if(memcmp(p, "stencil", 7) == 0) {
+	 p = GetStrVal(p+7, &StencilSize, 0, 1);
+	 SetAttrib(StencilSize, GLUT_STENCIL);
+      } else
+      if(memcmp(p, "samples", 7) == 0) {
+	 NumSamples = 1;
+	 p = GetStrVal(p+7, &NumSamples, 0, 16);
+	 SetAttrib(NumSamples, GLUT_MULTISAMPLE);
+      } else
+      if(p = strchr(p, ' '))
+         p++;
+      else
+	 break;
+   }
+}
+
 void glutInitWindowPosition (int x, int y)
 {
 }
 
 void glutInitWindowSize (int width, int height)
 {
-   InitialWidthHint = width;
-   InitialHeightHint = height;
 }
 
-
 static void ProcessTimers(void)
 {
    if(GlutTimers && GlutTimers->time < glutGet(GLUT_ELAPSED_TIME)) {
@@ -289,10 +436,12 @@ void glutMainLoop(void)
       else
 	 if(VisiblePoll)
 	    TestVisible();
+	 else
+	    usleep(1);
 
       if(IdleFunc)
 	 IdleFunc();
-
+      
       if(VisibleSwitch) {
 	 VisibleSwitch = 0;
 	 if(VisibilityFunc)
@@ -314,7 +463,7 @@ void glutMainLoop(void)
    }
 }
 
-static void ParseFBModes(void)
+int ParseFBModes(int minw, int maxw, int minh, int maxh, int minf, int maxf)
 {
    char buf[1024];
    struct fb_var_screeninfo vi = VarInfo;
@@ -322,44 +471,34 @@ static void ParseFBModes(void)
    FILE *fbmodes = fopen(FBMODES, "r");
 
    if(!fbmodes) {
-      sprintf(exiterror, "Warning: could not open "
-	      FBMODES" using current mode\n");
-      return;
+      sprintf(exiterror, "Warning: could not open "FBMODES"\n");
+      return 0;
    }
 
-   if(InitialWidthHint == 0 && InitialHeightHint == 0
-      && RequiredWidth == 0)
-      return; /* use current mode */
-
    while(fgets(buf, sizeof buf, fbmodes)) {
       char *c;
-      int v;
+      int v, bpp, freq;
 
       if(!(c = strstr(buf, "geometry")))
 	 continue;
       v = sscanf(c, "geometry %d %d %d %d %d", &vi.xres, &vi.yres,
-		 &vi.xres_virtual, &vi.yres_virtual, &vi.bits_per_pixel);
+		 &vi.xres_virtual, &vi.yres_virtual, &bpp);
       if(v != 5)
 	 continue;
 
-      /* now we have to decide what is best */
-      if(RequiredWidth) {
-	 if(RequiredWidth != vi.xres || RequiredHeight != vi.yres)
+      if(maxw < minw) {
+	 if(maxw < vi.xres && minw > vi.xres)
 	    continue;
-      } else {
-	 if(VarInfo.xres < vi.xres && VarInfo.xres < InitialWidthHint)
-	    v++;
-	 if(VarInfo.xres > vi.xres && vi.xres > InitialWidthHint)
-	    v++;
-
-	 if(VarInfo.yres < vi.yres && VarInfo.yres < InitialHeightHint)
-	    v++;
-	 if(VarInfo.yres > vi.yres && vi.yres > InitialHeightHint)
-	    v++;
-
-	 if(v < 7)
+      } else
+	 if(maxw < vi.xres || minw > vi.xres)
+	    continue;
+
+      if(maxh < minh) {
+	 if(maxh < vi.yres && minh > vi.yres)
+	    continue;
+      } else
+	 if(maxh < vi.yres || minh > vi.yres)
 	    continue;
-      }
 
       fgets(buf, sizeof buf, fbmodes);
       if(!(c = strstr(buf, "timings")))
@@ -368,103 +507,34 @@ static void ParseFBModes(void)
       v = sscanf(c, "timings %d %d %d %d %d %d %d", &vi.pixclock,
 		 &vi.left_margin, &vi.right_margin, &vi.upper_margin,
 		 &vi.lower_margin, &vi.hsync_len, &vi.vsync_len);
+
       if(v != 7)
 	 continue;
 
-      VarInfo = vi; /* finally found a better mode */
-      if(RequiredWidth) {
-	 fclose(fbmodes);
-	 return;
-      }
+      freq = 1E12/vi.pixclock
+	 /(vi.left_margin + vi.xres + vi.right_margin + vi.hsync_len)
+	 /(vi.upper_margin + vi.yres + vi.lower_margin + vi.vsync_len);
+
+      if(maxf < minf) {
+	 if(maxf < freq && minf > freq)
+	    continue;
+      } else
+	 if(maxf < freq || minf > freq)
+	    continue;
+
+      VarInfo = vi;
+      fclose(fbmodes);
+      return 1;
    }
 
    fclose(fbmodes);
 
-   if(RequiredWidth) {
-      sprintf(exiterror, "No mode (%dx%d) found in "FBMODES"\n",
-	      RequiredWidth, RequiredHeight);
-      exit(0);
-   }
+   return 0;
 }
 
 /* ---------- Window Management ----------*/
-int glutCreateWindow (const char *title)
+void SetVideoMode(void)
 {
-   char *fbdev;
-   int attribs[9], i, mask, size;
-
-   if(Initialized == 0) {
-      int argc = 0;
-      char *argv[] = {NULL};
-      glutInit(&argc, argv);
-   }
-
-   if(Context)
-      return 0;
-
-   fbdev = getenv("FRAMEBUFFER");
-   if(fbdev) {
-#ifdef MULTIHEAD
-      if(!sscanf(fbdev, "/dev/fb%d", &FramebufferIndex))
-	 if(!sscanf(fbdev, "/dev/fb/%d", &FramebufferIndex))
-	    sprintf(exiterror, "Could not determine Framebuffer index!\n");
-#endif
-   } else {
-      static char fb[128];
-      struct fb_con2fbmap confb;
-      int fd = open("/dev/fb0", O_RDWR);
-
-      FramebufferIndex = 0;
-
-      confb.console = CurrentVT;
-      if(ioctl(fd, FBIOGET_CON2FBMAP, &confb) != -1)
-	 FramebufferIndex = confb.framebuffer;
-      sprintf(fb, "/dev/fb%d", FramebufferIndex);
-      fbdev = fb;
-      close(fd);
-   }
-
-   /* open the framebuffer device */
-   FrameBufferFD = open(fbdev, O_RDWR);
-   if (FrameBufferFD < 0) {
-      sprintf(exiterror, "Error opening %s: %s\n", fbdev, strerror(errno));
-      exit(0);
-   }
-
-   /* Get the fixed screen info */
-   if (ioctl(FrameBufferFD, FBIOGET_FSCREENINFO, &FixedInfo)) {
-      sprintf(exiterror, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n",
-	      strerror(errno));
-      exit(0);
-   }
-
-   /* get the variable screen info */
-   if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &OrigVarInfo)) {
-      sprintf(exiterror, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n",
-	      strerror(errno));
-      exit(0);
-   }
-
-   /* operate on a copy */
-   VarInfo = OrigVarInfo;
-
-   /* set the depth, resolution, etc */
-   ParseFBModes();
-
-   if(DisplayMode & GLUT_INDEX)
-      VarInfo.bits_per_pixel = 8;
-   else
-      if(VarInfo.bits_per_pixel == 8)
-	 VarInfo.bits_per_pixel = 32;
-    
-   if (DesiredDepth)
-      VarInfo.bits_per_pixel = DesiredDepth;
-
-   VarInfo.xoffset = 0;
-   VarInfo.yoffset = 0;
-   VarInfo.nonstd = 0;
-   VarInfo.vmode &= ~FB_VMODE_YWRAP; /* turn off scrolling */
-
    /* set new variable screen info */
    if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) {
       sprintf(exiterror, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n",
@@ -498,8 +568,16 @@ int glutCreateWindow (const char *title)
 
    /* initialize colormap */
    LoadColorMap();
+}
+
+void CreateBuffer()
+{
+   int size = VarInfo.xres_virtual * VarInfo.yres_virtual
+                              * VarInfo.bits_per_pixel / 8;
 
    /* mmap the framebuffer into our address space */
+   if(FrameBuffer)
+      munmap(FrameBuffer, FixedInfo.smem_len);
    FrameBuffer = mmap(0, FixedInfo.smem_len, PROT_READ | PROT_WRITE, 
 		      MAP_SHARED, FrameBufferFD, 0);
    if (FrameBuffer == MAP_FAILED) {
@@ -508,8 +586,30 @@ int glutCreateWindow (const char *title)
       exit(0);
    }
 
-   mask = DisplayMode;
-   for(i=0; i<8 && mask; i++) {
+   if(DisplayMode & GLUT_DOUBLE) {
+      free(BackBuffer);
+      if(!(BackBuffer = malloc(size))) {
+	 sprintf(exiterror, "Failed to allocate double buffer\n");
+	 exit(0);
+      }
+   } else
+      BackBuffer = FrameBuffer;
+
+   if(Buffer)
+      glFBDevDestroyBuffer(Buffer);
+
+   if(!(Buffer = glFBDevCreateBuffer( &FixedInfo, &VarInfo, Visual,
+				      FrameBuffer, BackBuffer, size))) {
+      sprintf(exiterror, "Failure to create Buffer\n");
+      exit(0);
+   }
+}
+
+void CreateVisual(void)
+{
+   int i, mask = DisplayMode;
+   int attribs[20];
+   for(i=0; i
+#include 
 
 #include 
 
@@ -35,44 +33,274 @@
 
 #include "internal.h"
 
-void glutGameModeString(const char *string)
+int GameMode;
+
+static int ModePossible, DispChanged;
+static struct fb_var_screeninfo NormVarInfo, GameVarInfo;
+
+static GLFBDevContextPtr GameContext;
+static GLFBDevVisualPtr NormVisual;
+
+/* storage for non-gamemode callbacks */
+void (*KeyFuncs[2])(unsigned char key, int x, int y);
+static void (*NormFuncs[8])();
+
+static const char*SetOpers(const char *p, unsigned int *min, unsigned int *max)
 {
-   
+   char *endptr;
+   int comp = *p, val, neq = 0;
+
+   if(p[1] == '=') {
+      neq = 0;
+      p++;
+   }
+
+   val = strtol(p+1, &endptr, 10);
+   if(endptr == p+1)
+      return p;
+
+   switch(comp) {
+   case '=':
+      *min = *max = val;
+      break;
+   case '!':
+      *min = val + 1;
+      *max = val - 1;
+      break;
+   case '<':
+      *max = val - neq;
+      break;
+   case '>':
+      *min = val + neq;
+      break;
+   }
+   return endptr;
 }
 
+void glutGameModeString(const char *string)
+{
+   const char *p = string;
+   unsigned int minb = 15, maxb = 32;
+   unsigned int minw = 0, maxw = -1;
+   unsigned int minh, maxh = -1;
+   unsigned int minf = 0, maxf = MAX_VSYNC;
+   char *endptr;
+   int count = -1, val;
+
+   ModePossible = 0;
+
+   if(DisplayMode & GLUT_INDEX)
+      minb = maxb = 8;
+
+ again:
+   count++;
+   if((val = strtol(p, &endptr, 10)) && *endptr=='x') {
+      maxw = minw = val;
+      p = endptr + 1;
+      maxh = minh = strtol(p, &endptr, 10);
+      p = endptr;
+      goto again;
+   }
+
+   if(*p == ':') {
+      minb = strtol(p+1, &endptr, 10);
+      p = endptr;
+      if(DisplayMode & GLUT_INDEX) {
+	 if(minb != 8)
+	    return;
+      } else
+	 if(minb != 15 && minb != 16 && minb != 24 && minb != 32)
+	    return;
+      maxb = minb;
+      goto again;
+   }
+
+   if(*p == '@') {
+      minf = strtol(p+1, &endptr, 10) - 5;
+      maxf = minf + 10;
+      p = endptr;
+      goto again;
+   }
+
+   if(count == 0)
+      while(*p) {
+	 if(*p == ' ')
+	    p++;
+	 else
+	 if(memcmp(p, "bpp", 3) == 0)
+	    p = SetOpers(p+3, &minb, &maxb);
+	 else
+	 if(memcmp(p, "height", 6) == 0)
+	    p = SetOpers(p+6, &minh, &maxh);
+	 else
+	 if(memcmp(p, "hertz", 5) == 0)
+	    p = SetOpers(p+5, &minf, &maxf);
+	 else
+	 if(memcmp(p, "width", 5) == 0)
+	    p = SetOpers(p+5, &minw, &maxw);
+	 else
+	 if(p = strchr(p, ' '))
+	    p++;
+	 else
+	    break;
+   }
+
+   NormVarInfo = VarInfo;
+   if(!ParseFBModes(minw, maxw, minh, maxh, minf, maxf))
+      return;
+
+   GameVarInfo = VarInfo;
+   VarInfo = NormVarInfo;
+
+   /* determine optimal bitdepth, make sure we have enough video memory */
+   if(VarInfo.bits_per_pixel && VarInfo.bits_per_pixel <= maxb)
+      GameVarInfo.bits_per_pixel = VarInfo.bits_per_pixel;
+   else
+      GameVarInfo.bits_per_pixel = maxb;
+
+   while(FixedInfo.smem_len < GameVarInfo.xres * GameVarInfo.yres
+	 * GameVarInfo.bits_per_pixel / 8) {
+      if(GameVarInfo.bits_per_pixel < minb)
+	 return;
+      GameVarInfo.bits_per_pixel = ((GameVarInfo.bits_per_pixel+1)/8)*8-8;
+   }
+  
+   ModePossible = 1;
+}
+   
 int glutEnterGameMode(void)
 {
    if(ActiveMenu)
       return 0;
+
+   if(!ModePossible)
+      return 0;
+
+   if(GameMode) {
+      if(!memcmp(&GameVarInfo, &VarInfo, sizeof VarInfo)) {
+	 DispChanged = 0;
+	 return 1;
+      }
+      glutLeaveGameMode();
+   }
+
+   if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &GameVarInfo))
+      return 0;
+
+   NormVarInfo = VarInfo;
+   VarInfo = GameVarInfo;
+
+   NormVisual = Visual;
+   SetVideoMode();
+   CreateVisual();
+   CreateBuffer();
+
+   if(!(GameContext = glFBDevCreateContext(Visual, NULL))) {
+      sprintf(exiterror, "Failure to create Context\n");
+      exit(0);
+   }
+
+   if(!glFBDevMakeCurrent( GameContext, Buffer, Buffer )) {
+      sprintf(exiterror, "Failure to Make Game Current\n");
+      exit(0);
+   }
+
+   InitializeCursor();
+
+   KeyFuncs[0] = KeyboardFunc;
+   KeyFuncs[1] = KeyboardUpFunc;
+
+   NormFuncs[0] = DisplayFunc;
+   NormFuncs[1] = ReshapeFunc;
+   NormFuncs[2] = MouseFunc;
+   NormFuncs[3] = MotionFunc;
+   NormFuncs[4] = PassiveMotionFunc;
+   NormFuncs[5] = VisibilityFunc;
+   NormFuncs[6] = SpecialFunc;
+   NormFuncs[7] = SpecialUpFunc;
+
+   DisplayFunc = NULL;
+   ReshapeFunc = NULL;
+   KeyboardFunc = NULL;
+   KeyboardUpFunc = NULL;
+   MouseFunc = NULL;
+   MotionFunc = NULL;
+   PassiveMotionFunc = NULL;
+   VisibilityFunc = NULL;
+   SpecialFunc = SpecialUpFunc = NULL;
+
+   DispChanged = 1;
+   GameMode = 1;
+   Visible = 1;
+   VisibleSwitch = 1;
+   Redisplay = 1;
    return 1;
 }
 
 void glutLeaveGameMode(void)
 {
+   if(!GameMode)
+      return;
+
+   glFBDevDestroyContext(GameContext);
+   glFBDevDestroyVisual(Visual);
+
+   VarInfo = NormVarInfo;
+   Visual = NormVisual;
+   
+   if(Visual) {
+      SetVideoMode();
+      CreateBuffer();
+   
+      if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) {
+	 sprintf(exiterror, "Failure to Make Current\n");
+	 exit(0);
+      }
+      
+      Redisplay = 1;
+   }
+
+   KeyboardFunc = KeyFuncs[0];
+   KeyboardUpFunc = KeyFuncs[1];
+
+
+   DisplayFunc = NormFuncs[0];
+   ReshapeFunc = NormFuncs[1];
+   MouseFunc = NormFuncs[2];
+   MotionFunc = NormFuncs[3];
+   PassiveMotionFunc = NormFuncs[4];
+   VisibilityFunc = NormFuncs[5];
+   SpecialFunc = NormFuncs[6];
+   SpecialUpFunc = NormFuncs[7];
+
+   GameMode = 0;
 }
 
 int glutGameModeGet(GLenum mode) {
    switch(mode) {
    case GLUT_GAME_MODE_ACTIVE:
-      return 1;
+      return GameMode;
    case GLUT_GAME_MODE_POSSIBLE:
-      return 1;
+      return ModePossible;
+   case GLUT_GAME_MODE_DISPLAY_CHANGED:
+      return DispChanged;
+   }
+
+   if(!ModePossible)
+      return -1;
+   
+   switch(mode) {
    case GLUT_GAME_MODE_WIDTH:
-      return VarInfo.xres;
+      return GameVarInfo.xres;
    case GLUT_GAME_MODE_HEIGHT:
-      return VarInfo.yres;
+      return GameVarInfo.yres;
    case GLUT_GAME_MODE_PIXEL_DEPTH:
-      return VarInfo.bits_per_pixel;
+      return GameVarInfo.bits_per_pixel;
    case GLUT_GAME_MODE_REFRESH_RATE:
-      if(VarInfo.pixclock) {
-	 int htotal = VarInfo.left_margin + VarInfo.xres
-	    + VarInfo.right_margin + VarInfo.hsync_len;
-	 int vtotal = VarInfo.upper_margin + VarInfo.yres
-	    + VarInfo.lower_margin + VarInfo.vsync_len;
-	 return 1E12/VarInfo.pixclock/htotal/vtotal;
-      }
-      return 0;
-   case GLUT_GAME_MODE_DISPLAY_CHANGED:
-      return 0;
+      return 1E12/GameVarInfo.pixclock
+	 / (GameVarInfo.left_margin + GameVarInfo.xres
+	   + GameVarInfo.right_margin + GameVarInfo.hsync_len)
+	 / (GameVarInfo.upper_margin + GameVarInfo.yres 
+	   + GameVarInfo.lower_margin + GameVarInfo.vsync_len);
    }
 }
diff --git a/src/glut/fbdev/input.c b/src/glut/fbdev/input.c
index 7daec8c9143..4fbd94d0701 100644
--- a/src/glut/fbdev/input.c
+++ b/src/glut/fbdev/input.c
@@ -126,8 +126,11 @@ static void KeyboardHandler(int sig)
    if(!release && labelval >= K_F1 && labelval <= K_F12)
       if(KeyboardModifiers & GLUT_ACTIVE_ALT) {
 	 /* VT switch, we must do it */
-	 if(ioctl(ConsoleFD, VT_ACTIVATE, labelval - K_F1 + 1) < 0)
-	    sprintf(exiterror, "Error switching console\n");
+	 if(Swapping)
+	    VTSwitch = labelval - K_F1 + 1;
+	 else
+	    if(ioctl(ConsoleFD, VT_ACTIVATE, labelval - K_F1 + 1) < 0)
+	       sprintf(exiterror, "Error switching console\n");
 	 return;
       }
    write(kbdpipe[1], &code, 1);
@@ -456,6 +459,7 @@ static int ReadMouse(void)
 	    PassiveMotionFunc(MouseX, MouseY);
 
       EraseCursor();
+
       if(ActiveMenu)
 	 Redisplay = 1;
       else
@@ -515,14 +519,17 @@ void InitializeVT(int usestdin)
    struct vt_mode vt;
    char console[128];
 
-   /* terminos settings for straight-through mode */
+   signal(SIGIO, SIG_IGN);
+
+   /* save old terminos settings */
    if (tcgetattr(0, &OldTermios) < 0) {
       sprintf(exiterror, "tcgetattr failed\n");
       exit(0);
    }
 
    tio = OldTermios;
-  
+
+   /* terminos settings for straight-through mode */  
    tio.c_lflag &= ~(ICANON | ECHO  | ISIG);
    tio.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | IXOFF | IXON);
    tio.c_iflag |= IGNBRK;
@@ -607,8 +614,8 @@ void InitializeVT(int usestdin)
    }
 
    /* use SIGIO so VT switching can work if the program is locked */
-   if(ConsoleFD)
    signal(SIGIO, KeyboardHandler);
+
    pipe(kbdpipe);
 
    if(fcntl(kbdpipe[0], F_SETFL, O_NONBLOCK | O_ASYNC) < 0) {
@@ -642,64 +649,63 @@ void InitializeVT(int usestdin)
 
 void RestoreVT(void)
 {
-   if(ConsoleFD >= 0)
-      if (tcsetattr(0, TCSANOW, &OldTermios) < 0)
-	 fprintf(stderr, "tcsetattr failed\n");
+   if(ConsoleFD < 0)
+      return;
 
-   if(ConsoleFD > 0) {
-      /* restore keyboard state */
-      if (ioctl(ConsoleFD, VT_SETMODE, &OldVTMode) < 0)
-	 fprintf(stderr, "Failed to set vtmode\n");
+   if (tcsetattr(0, TCSANOW, &OldTermios) < 0)
+      fprintf(stderr, "tcsetattr failed\n");
 
-      if (ioctl(ConsoleFD, KDSKBMODE, OldKDMode) < 0)
-	 fprintf(stderr, "ioctl KDSKBMODE failed!\n");
+   if(ConsoleFD == 0)
+       return;
 
-      /* if we were in text mode, switching to graphics and back restores
-	 the colormap */
-      if(ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0)
-	 fprintf(stderr, "ioctl KDSETMODE failed!\n");
+   /* restore keyboard state */
+   if (ioctl(ConsoleFD, VT_SETMODE, &OldVTMode) < 0)
+      fprintf(stderr, "Failed to set vtmode\n");
 
-      if(ioctl(ConsoleFD, KDSETMODE, OldMode) < 0)
-	 fprintf(stderr, "ioctl KDSETMODE failed!\n");
+   if (ioctl(ConsoleFD, KDSKBMODE, OldKDMode) < 0)
+      fprintf(stderr, "ioctl KDSKBMODE failed!\n");
 
-      close(ConsoleFD);
-   }
+   if(ioctl(ConsoleFD, KDSETMODE, OldMode) < 0)
+      fprintf(stderr, "ioctl KDSETMODE failed!\n");
+   
+   close(ConsoleFD);
 }
 
 void InitializeMouse(void)
 {
 #ifdef HAVE_GPM
-   if(GpmMouse) {
+   if(!GpmMouse)
+#endif
+   {
+      const char *mousedev = getenv("MOUSE");
+      if(!mousedev)
+	 mousedev = MOUSEDEV;
+      if((MouseFD = open(mousedev, O_RDONLY)) >= 0) {
+	 if(!MouseSpeed)
+	    MouseSpeed = 1;
+	 NumMouseButtons = 3;
+	 return;
+      }
+   }
+#ifdef HAVE_GPM
+   {
       Gpm_Connect conn;  
       int c;
       conn.eventMask  = ~0;   /* Want to know about all the events */
       conn.defaultMask = 0;   /* don't handle anything by default  */
       conn.minMod     = 0;    /* want everything                   */
       conn.maxMod     = ~0;   /* all modifiers included            */
-      if(Gpm_Open(&conn, 0) == -1) {
-	 fprintf(stderr, "Cannot open gpmctl. Continuing without Mouse\n");
+      if(Gpm_Open(&conn, 0) != -1) {
+	 if(!MouseSpeed)
+	    MouseSpeed = 8;
+	 NumMouseButtons = 3;
 	 return;
       }
-	
-      if(!MouseSpeed)
-	 MouseSpeed = 5;
-   } else
+      fprintf(stderr, "Cannot open gpmctl.\n");
+   }
 #endif
-      {
-	 const char *mousedev = getenv("MOUSE");
-	 if(!mousedev)
-	    mousedev = MOUSEDEV;
-	 if((MouseFD = open(mousedev, O_RDONLY)) < 0) {
-	    fprintf(stderr,"Cannot open %s.\n"
-		    "Continuing without Mouse\n", MOUSEDEV);
-	    return;
-	 }
-
-	 if(!MouseSpeed)
-	    MouseSpeed = 1;
-      }
-
-   NumMouseButtons = 3;
+   fprintf(stderr,"Cannot open %s.\n"
+	   "Continuing without Mouse\n", MOUSEDEV);
 }
 
 void CloseMouse(void)
diff --git a/src/glut/fbdev/internal.h b/src/glut/fbdev/internal.h
index ca5dc1a6397..082cd4f6f3a 100644
--- a/src/glut/fbdev/internal.h
+++ b/src/glut/fbdev/internal.h
@@ -26,6 +26,7 @@
 
 #include 
 #include 
+#include 
 
 #define MULTIHEAD   /* enable multihead hacks,
 		       it allows the program to continue drawing
@@ -34,16 +35,23 @@
 		       screen corruption that requires C-l to fix */
 #define HAVE_GPM
 
+#define MAX_VSYNC 200
+
 /* this causes these symbols to not be exported */
 #pragma GCC visibility push(hidden)
 
+
+/* --------- fbdev ------------ */
 extern int Redisplay;
 extern int Visible;
 extern int VisibleSwitch;
 extern int Active;
 extern int VisiblePoll;
+extern int Swapping, VTSwitch;
 
 void TestVisible(void);
+int ParseFBModes(int, int, int, int, int, int);
+void CreateVisual(void);
 
 extern int FrameBufferFD;
 extern unsigned char *FrameBuffer;
@@ -53,7 +61,11 @@ extern int DisplayMode;
 extern char exiterror[256];
 
 extern struct fb_fix_screeninfo FixedInfo;
-extern struct fb_var_screeninfo VarInfo, OrigVarInfo;
+extern struct fb_var_screeninfo VarInfo;
+
+extern GLFBDevContextPtr Context;
+extern GLFBDevBufferPtr Buffer;
+extern GLFBDevVisualPtr Visual;
 
 /* --- colormap --- */
 #define REVERSECMAPSIZELOG 3
@@ -65,6 +77,7 @@ extern unsigned short RedColorMap[256],
 extern unsigned char ReverseColorMap[REVERSECMAPSIZE]
                                     [REVERSECMAPSIZE]
                                     [REVERSECMAPSIZE];
+void LoadOldColorMap(void);
 void LoadColorMap(void);
 void UnloadColorMap(void);
 void RestoreColorMap(void);
@@ -108,7 +121,7 @@ void OpenMenu(void);
 void CloseMenu(void);
 
 /* --- state --- */
-extern int AccumSize, DepthSize, StencilSize;
+extern int AccumSize, DepthSize, StencilSize, NumSamples;
 extern struct timeval StartTime;
 extern int KeyboardModifiers;
 
@@ -156,4 +169,7 @@ struct GlutTimer {
 
 extern struct GlutTimer *GlutTimers;
 
+/* ------- Game Mode -------- */
+extern int GameMode;
+
 #pragma GCC visibility pop
diff --git a/src/glut/fbdev/menu.c b/src/glut/fbdev/menu.c
index 8ac0ed39879..f5a5ef75434 100644
--- a/src/glut/fbdev/menu.c
+++ b/src/glut/fbdev/menu.c
@@ -42,7 +42,6 @@ int ActiveMenu;
 int CurrentMenu;
 
 static double MenuProjection[16];
-static double MenuModelview[16];
 
 static int AttachedMenus[3];
 static int NumMenus = 1;
@@ -55,14 +54,8 @@ void InitializeMenus(void)
    glPushMatrix();
    glLoadIdentity();
    gluOrtho2D(0.0, VarInfo.xres, VarInfo.yres, 0.0);
-   glMatrixMode(GL_MODELVIEW);
-   glPushMatrix();
-   glLoadIdentity();
-   glViewport(0, 0, VarInfo.xres, VarInfo.yres);
    glGetDoublev(GL_PROJECTION_MATRIX, MenuProjection);
-   glGetDoublev(GL_MODELVIEW_MATRIX, MenuModelview);
-   glPopMatrix();
-   glMatrixMode(GL_PROJECTION);
+
    glPopMatrix();
    glPopAttrib();
 }
@@ -72,7 +65,7 @@ void FreeMenus(void)
    int i, j;
 	
    for(i = 1; i= *y && MouseY < *y + MENU_FONT_HEIGHT &&
 	 MouseX >= x && MouseX < x + Menus[menu].width) {
 	 a = 1;
@@ -133,18 +127,26 @@ static int DrawMenu(int menu, int x, int *y)
 
 void DrawMenus(void)
 {
-   int x = Menus[ActiveMenu].x;
-   int y = Menus[ActiveMenu].y;
+   int x, y;
+
+   if(GameMode)
+      return;
+
+   x = Menus[ActiveMenu].x;
+   y = Menus[ActiveMenu].y;
 
    /* save old settings */
-   glPushAttrib(-1);
+   glPushAttrib(GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT
+		| GL_ENABLE_BIT | GL_VIEWPORT_BIT);
 
    glMatrixMode(GL_MODELVIEW);
    glPushMatrix();
-   glLoadMatrixd(MenuModelview);
+   glLoadIdentity();
+
    glMatrixMode(GL_PROJECTION);
    glPushMatrix();
    glLoadMatrixd(MenuProjection);
+   glViewport(0, 0, VarInfo.xres, VarInfo.yres);
 
    glDisable(GL_DEPTH_TEST);
    glDisable(GL_ALPHA_TEST);
@@ -153,7 +155,7 @@ void DrawMenus(void)
    glDisable(GL_TEXTURE_2D);
    glEnable(GL_COLOR_LOGIC_OP);
    glLogicOp(GL_AND_REVERSE);
-    
+
    if(DrawMenu(ActiveMenu, x, &y))
       Menus[ActiveMenu].selected = -1;
     
@@ -171,8 +173,14 @@ void OpenMenu(void)
       MenuStatusFunc(GLUT_MENU_IN_USE, MouseX, MouseY);
    if(MenuStateFunc)
       MenuStateFunc(GLUT_MENU_IN_USE);
-   Menus[ActiveMenu].x = MouseX - Menus[ActiveMenu].width/2;
-   Menus[ActiveMenu].y = MouseY - Menus[ActiveMenu].NumItems*MENU_FONT_HEIGHT/2;
+   Menus[ActiveMenu].x = MouseX-Menus[ActiveMenu].width/2;
+
+   if(Menus[ActiveMenu].x < 0)
+      Menus[ActiveMenu].x = 0;
+   if(Menus[ActiveMenu].x + Menus[ActiveMenu].width >= VarInfo.xres)
+     Menus[ActiveMenu].x = VarInfo.xres - Menus[ActiveMenu].width - 1;
+
+   Menus[ActiveMenu].y = MouseY-Menus[ActiveMenu].NumItems*MENU_FONT_HEIGHT/2;
    Menus[ActiveMenu].selected = -1;
 }
 
diff --git a/src/glut/fbdev/state.c b/src/glut/fbdev/state.c
index dadd2ad7200..bca675c52c4 100644
--- a/src/glut/fbdev/state.c
+++ b/src/glut/fbdev/state.c
@@ -37,6 +37,7 @@
 int AccumSize = 16; /* per channel size of accumulation buffer */
 int DepthSize = DEFAULT_SOFTWARE_DEPTH_BITS;
 int StencilSize = STENCIL_BITS;
+int NumSamples = 4;
 
 int glutGet(GLenum state)
 {
@@ -89,7 +90,7 @@ int glutGet(GLenum state)
 	 return 256;
       return 0;
    case GLUT_WINDOW_NUM_SAMPLES:
-      return 0;
+      return NumSamples;
    case GLUT_WINDOW_STEREO:
       return 0;
    case GLUT_WINDOW_CURSOR:
@@ -174,16 +175,6 @@ int glutDeviceGet(GLenum info)
    return -1;
 }
 
-int glutVideoResizeGet(GLenum param)
-{
-   switch(param) {
-   case GLUT_VIDEO_RESIZE_POSSIBLE:
-      return 0;
-      
-   }
-   return -1;
-}
-
 int glutGetModifiers(void){
    return KeyboardModifiers;
 }
diff --git a/src/glut/fbdev/vidresize.c b/src/glut/fbdev/vidresize.c
new file mode 100644
index 00000000000..960b0186233
--- /dev/null
+++ b/src/glut/fbdev/vidresize.c
@@ -0,0 +1,55 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  6.5
+ * Copyright (C) 1995-2006  Brian Paul
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*
+ * Library for glut using mesa fbdev driver
+ *
+ * Written by Sean D'Epagnier (c) 2006
+ */
+
+/* Notice, if you know how to implement these functions correctly
+   please proceed */
+
+#include 
+
+#include 
+
+#include "internal.h"
+
+int glutVideoResizeGet(GLenum param)
+{
+   return 0;
+}
+
+void glutSetupVideoResizing(void)
+{
+}
+
+void glutStopVideoResizing(void)
+{
+}
+
+void glutVideoResize(int x, int y, int width, int height)
+{
+}
+
+void glutVideoPan(int x, int y, int width, int height)
+{
+}
diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c
index 412c09955f8..21b6165bb14 100644
--- a/src/mesa/drivers/fbdev/glfbdev.c
+++ b/src/mesa/drivers/fbdev/glfbdev.c
@@ -281,7 +281,7 @@ glFBDevGetString( int str )
    case GLFBDEV_VENDOR:
       return "Mesa Project";
    case GLFBDEV_VERSION:
-      return "1.0.0";
+      return "1.0.1";
    default:
       return NULL;
    }
@@ -372,6 +372,10 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo,
       case GLFBDEV_LEVEL:
          /* ignored for now */
          break;
+      case GLFBDEV_MULTISAMPLE:
+	 numSamples = attrib[1];
+	 attrib++;
+         break;
       default:
          /* unexpected token */
          _mesa_free(vis);
@@ -420,13 +424,6 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo,
       }
       else {
          _mesa_problem(NULL, "Unsupported fbdev RGB visual/bitdepth!\n");
-         /*
-         printf("fixInfo->visual = 0x%x\n", fixInfo->visual);
-         printf("varInfo->bits_per_pixel = %d\n", varInfo->bits_per_pixel);
-         printf("varInfo->red.offset = %d\n", varInfo->red.offset);
-         printf("varInfo->green.offset = %d\n", varInfo->green.offset);
-         printf("varInfo->blue.offset = %d\n", varInfo->blue.offset);
-         */
          _mesa_free(vis);
          return NULL;
       }
@@ -586,7 +583,6 @@ new_glfbdev_renderbuffer(void *bufferStart, const GLFBDevVisualPtr visual)
    return rb;
 }
 
-
 GLFBDevBufferPtr
 glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo,
                      const struct fb_var_screeninfo *varInfo,
@@ -600,6 +596,11 @@ glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo,
    ASSERT(frontBuffer);
    ASSERT(size > 0);
 
+   /* this is to update the visual if there was a resize and the
+      buffer is created again */
+   visual->var = *varInfo;
+   visual->fix = *fixInfo;
+
    if (visual->fix.visual != fixInfo->visual ||
        visual->fix.type != fixInfo->type ||
        visual->var.bits_per_pixel != varInfo->bits_per_pixel ||
@@ -624,7 +625,21 @@ glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo,
                           &frontrb->Base);
    /* add back renderbuffer */
    if (visual->glvisual.doubleBufferMode) {
+      int malloced = !backBuffer;
+      if (malloced) {
+         /* malloc a back buffer */
+         backBuffer = _mesa_malloc(size);
+         if (!backBuffer) {
+            _mesa_free_framebuffer_data(&buf->glframebuffer);
+            _mesa_free(buf);
+            return NULL;
+         }
+      }
+
       backrb = new_glfbdev_renderbuffer(backBuffer, visual);
+      if(malloced)
+	 backrb->mallocedBuffer = GL_TRUE;
+
       _mesa_add_renderbuffer(&buf->glframebuffer, BUFFER_BACK_LEFT,
                              &backrb->Base);
    }
@@ -637,32 +652,12 @@ glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo,
                                 GL_FALSE, /* alpha */
                                 GL_FALSE /* aux bufs */);
 
-
-
    buf->fix = *fixInfo;   /* struct assignment */
    buf->var = *varInfo;   /* struct assignment */
    buf->visual = visual;  /* ptr assignment */
    buf->size = size;
    buf->bytesPerPixel = visual->var.bits_per_pixel / 8;
 
-   if (visual->glvisual.doubleBufferMode) {
-      if (!backBuffer) {
-         /* malloc a back buffer */
-         backrb->Base.Data = _mesa_malloc(size);
-         if (!backrb->Base.Data) {
-            _mesa_free_framebuffer_data(&buf->glframebuffer);
-            _mesa_free(buf);
-            return NULL;
-         }
-         backrb->mallocedBuffer = GL_TRUE;
-      }
-   }
-   /* this causes segfault:
-   else {
-      backrb->bottom = NULL;
-      backrb->rowStride = 0;
-      }*/
-
    return buf;
 }
 
-- 
cgit v1.2.3


From 56f349515c75a93923255ba1eb7cdae67b432a53 Mon Sep 17 00:00:00 2001
From: Ian Romanick 
Date: Fri, 11 Aug 2006 22:26:49 +0000
Subject: Convert comment header for __GLcontextModesRec to Doxygen style.

---
 include/GL/internal/glcore.h | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

(limited to 'include')

diff --git a/include/GL/internal/glcore.h b/include/GL/internal/glcore.h
index ff1beb71831..d5cbd3b2a5c 100644
--- a/include/GL/internal/glcore.h
+++ b/include/GL/internal/glcore.h
@@ -64,12 +64,18 @@ typedef struct __GLinterfaceRec __GLinterface;
 ** and used by the "operating system".
 */
 
-/*
-** Mode and limit information for a context.  This information is
-** kept around in the context so that values can be used during
-** command execution, and for returning information about the
-** context to the application.
-*/
+/**
+ * Mode and limit information for a context.  This information is
+ * kept around in the context so that values can be used during
+ * command execution, and for returning information about the
+ * context to the application.
+ * 
+ * Instances of this structure are shared by the driver and the loader.  To
+ * maintain binary compatability, new fields \b must be added only to the
+ * end of the structure.
+ * 
+ * \sa _gl_context_modes_create
+ */
 typedef struct __GLcontextModesRec {
     struct __GLcontextModesRec * next;
 
-- 
cgit v1.2.3


From 32a9e9be0c9626fb15ae7c721a15bcf19330e13a Mon Sep 17 00:00:00 2001
From: Ian Romanick 
Date: Sat, 12 Aug 2006 00:05:54 +0000
Subject: Fix white-space problem in the prototype for glBlitFramebufferEXT
 that prevented gl_mangle.h from picking it up.

---
 include/GL/gl.h        | 3 +--
 include/GL/gl_mangle.h | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)

(limited to 'include')

diff --git a/include/GL/gl.h b/include/GL/gl.h
index baab557a53b..9dfec325f54 100644
--- a/include/GL/gl.h
+++ b/include/GL/gl.h
@@ -2288,8 +2288,7 @@ typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pnam
 #define GL_DRAW_FRAMEBUFFER_BINDING_EXT        0x8CA6
 #define GL_READ_FRAMEBUFFER_BINDING_EXT        0x8CAA
 
-GLAPI void GLAPIENTRY
-glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+GLAPI void GLAPIENTRY glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
                      GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
                      GLbitfield mask, GLenum filter);
 
diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h
index 2104d15c96e..c8d2c42b46b 100644
--- a/include/GL/gl_mangle.h
+++ b/include/GL/gl_mangle.h
@@ -98,6 +98,7 @@
 #define glBlendFuncSeparateEXT		MANGLE(BlendFuncSeparateEXT)
 #define glBlendFuncSeparateINGR		MANGLE(BlendFuncSeparateINGR)
 #define glBlendFuncSeparate		MANGLE(BlendFuncSeparate)
+#define glBlitFramebufferEXT		MANGLE(BlitFramebufferEXT)
 #define glBufferDataARB		MANGLE(BufferDataARB)
 #define glBufferData		MANGLE(BufferData)
 #define glBufferSubDataARB		MANGLE(BufferSubDataARB)
-- 
cgit v1.2.3


From 37b5b01217ab725a91c9dbb600dfe9e21c34151b Mon Sep 17 00:00:00 2001
From: Brian Paul 
Date: Tue, 15 Aug 2006 14:28:03 +0000
Subject: s/GLvoid/void/ to fix gcc 4.2 issue (bug 7875)

---
 include/GL/gl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'include')

diff --git a/include/GL/gl.h b/include/GL/gl.h
index 9dfec325f54..25f90e30860 100644
--- a/include/GL/gl.h
+++ b/include/GL/gl.h
@@ -2161,7 +2161,7 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh
 #define GL_DEBUG_PRINT_MESA               0x875A
 #define GL_DEBUG_ASSERT_MESA              0x875B
 
-GLAPI GLhandleARB APIENTRY glCreateDebugObjectMESA (GLvoid);
+GLAPI GLhandleARB APIENTRY glCreateDebugObjectMESA (void);
 GLAPI GLvoid APIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
 GLAPI GLvoid APIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
                                          GLsizei *length, GLcharARB *debugLog);
-- 
cgit v1.2.3


From 8c41c757fe8efa04df0dd5cdfb33a75b84891c19 Mon Sep 17 00:00:00 2001
From: Ian Romanick 
Date: Tue, 15 Aug 2006 16:47:34 +0000
Subject: Add support for GL_EXT_gpu_program_parameters.  Any driver that
 enables either GL_ARB_vertex_program or GL_ARB_fragment_program should enable
 this extension as well.

---
 include/GL/gl.h                                |  18 ++
 include/GL/gl_mangle.h                         |   2 +
 src/mesa/drivers/dri/common/extension_helper.h |  22 ++
 src/mesa/glapi/dispatch.h                      |  16 +-
 src/mesa/glapi/gl_API.xml                      |  16 ++
 src/mesa/glapi/glapioffsets.h                  |   6 +-
 src/mesa/glapi/glapitable.h                    |   2 +
 src/mesa/glapi/glapitemp.h                     |  12 +
 src/mesa/glapi/glprocs.h                       | 360 +++++++++++++------------
 src/mesa/main/dlist.c                          |  70 +++++
 src/mesa/main/extensions.c                     |   4 +
 src/mesa/main/mtypes.h                         |   1 +
 src/mesa/main/state.c                          |   6 +
 src/mesa/shader/arbprogram.c                   |  88 ++++++
 src/mesa/shader/arbprogram.h                   |  10 +
 src/mesa/sparc/glapi_sparc.S                   |   4 +
 src/mesa/x86-64/glapi_x86-64.S                 |  90 +++++++
 src/mesa/x86/glapi_x86.S                       |   2 +
 18 files changed, 549 insertions(+), 180 deletions(-)

(limited to 'include')

diff --git a/include/GL/gl.h b/include/GL/gl.h
index 25f90e30860..40f3b9da777 100644
--- a/include/GL/gl.h
+++ b/include/GL/gl.h
@@ -2312,6 +2312,24 @@ typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC)
 #endif /* GL_EXT_packed_depth_stencil */
 
 
+#ifndef GL_EXT_gpu_program_parameters
+#define GL_EXT_gpu_program_parameters 1
+
+GLAPI void GLAPIENTRY glProgramEnvParameters4fvEXT(GLenum target,
+    GLuint index, GLsizei count, const GLfloat *params); 
+
+GLAPI void GLAPIENTRY glProgramLocalParameters4fvEXT(GLenum target,
+    GLuint index, GLsizei count, const GLfloat *params); 
+
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)
+       (GLenum target, GLuint index, GLsizei count, const GLfloat *params); 
+
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)
+       (GLenum target, GLuint index, GLsizei count, const GLfloat *params); 
+
+#endif /* GL_EXT_gpu_program_parameters */
+
+
 #ifndef GL_EXT_texture_sRGB
 #define GL_EXT_texture_sRGB 1
 
diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h
index c8d2c42b46b..2e6558def1a 100644
--- a/include/GL/gl_mangle.h
+++ b/include/GL/gl_mangle.h
@@ -865,10 +865,12 @@
 #define glProgramEnvParameter4dvARB		MANGLE(ProgramEnvParameter4dvARB)
 #define glProgramEnvParameter4fARB		MANGLE(ProgramEnvParameter4fARB)
 #define glProgramEnvParameter4fvARB		MANGLE(ProgramEnvParameter4fvARB)
+#define glProgramEnvParameters4fvEXT		MANGLE(ProgramEnvParameters4fvEXT)
 #define glProgramLocalParameter4dARB		MANGLE(ProgramLocalParameter4dARB)
 #define glProgramLocalParameter4dvARB		MANGLE(ProgramLocalParameter4dvARB)
 #define glProgramLocalParameter4fARB		MANGLE(ProgramLocalParameter4fARB)
 #define glProgramLocalParameter4fvARB		MANGLE(ProgramLocalParameter4fvARB)
+#define glProgramLocalParameters4fvEXT		MANGLE(ProgramLocalParameters4fvEXT)
 #define glProgramNamedParameter4dNV		MANGLE(ProgramNamedParameter4dNV)
 #define glProgramNamedParameter4dvNV		MANGLE(ProgramNamedParameter4dvNV)
 #define glProgramNamedParameter4fNV		MANGLE(ProgramNamedParameter4fNV)
diff --git a/src/mesa/drivers/dri/common/extension_helper.h b/src/mesa/drivers/dri/common/extension_helper.h
index 61708582caf..5cf83a9c9b2 100644
--- a/src/mesa/drivers/dri/common/extension_helper.h
+++ b/src/mesa/drivers/dri/common/extension_helper.h
@@ -2372,6 +2372,13 @@ static const char MultiTexCoord4ivARB_names[] =
     "";
 #endif
 
+#if defined(need_GL_EXT_gpu_program_parameters)
+static const char ProgramLocalParameters4fvEXT_names[] = 
+    "iiip\0" /* Parameter signature */
+    "glProgramLocalParameters4fvEXT\0"
+    "";
+#endif
+
 #if defined(need_GL_NV_evaluators)
 static const char GetMapAttribParameterfvNV_names[] = 
     "iiip\0" /* Parameter signature */
@@ -2507,6 +2514,13 @@ static const char GenVertexArraysAPPLE_names[] =
     "";
 #endif
 
+#if defined(need_GL_EXT_gpu_program_parameters)
+static const char ProgramEnvParameters4fvEXT_names[] = 
+    "iiip\0" /* Parameter signature */
+    "glProgramEnvParameters4fvEXT\0"
+    "";
+#endif
+
 #if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos)
 static const char WindowPos2iMESA_names[] = 
     "ii\0" /* Parameter signature */
@@ -5118,6 +5132,14 @@ static const struct dri_extension_function GL_EXT_framebuffer_object_functions[]
 };
 #endif
 
+#if defined(need_GL_EXT_gpu_program_parameters)
+static const struct dri_extension_function GL_EXT_gpu_program_parameters_functions[] = {
+    { ProgramLocalParameters4fvEXT_names, ProgramLocalParameters4fvEXT_remap_index, -1 },
+    { ProgramEnvParameters4fvEXT_names, ProgramEnvParameters4fvEXT_remap_index, -1 },
+    { NULL, 0, 0 }
+};
+#endif
+
 #if defined(need_GL_EXT_histogram)
 static const struct dri_extension_function GL_EXT_histogram_functions[] = {
     { Histogram_names, -1, 367 },
diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h
index cccfc3f0aa5..deb0f9e731d 100644
--- a/src/mesa/glapi/dispatch.h
+++ b/src/mesa/glapi/dispatch.h
@@ -2527,10 +2527,16 @@
 #define CALL_IsVertexArrayAPPLE(disp, parameters) (*((disp)->IsVertexArrayAPPLE)) parameters
 #define GET_IsVertexArrayAPPLE(disp) ((disp)->IsVertexArrayAPPLE)
 #define SET_IsVertexArrayAPPLE(disp, fn) ((disp)->IsVertexArrayAPPLE = fn)
+#define CALL_ProgramEnvParameters4fvEXT(disp, parameters) (*((disp)->ProgramEnvParameters4fvEXT)) parameters
+#define GET_ProgramEnvParameters4fvEXT(disp) ((disp)->ProgramEnvParameters4fvEXT)
+#define SET_ProgramEnvParameters4fvEXT(disp, fn) ((disp)->ProgramEnvParameters4fvEXT = fn)
+#define CALL_ProgramLocalParameters4fvEXT(disp, parameters) (*((disp)->ProgramLocalParameters4fvEXT)) parameters
+#define GET_ProgramLocalParameters4fvEXT(disp) ((disp)->ProgramLocalParameters4fvEXT)
+#define SET_ProgramLocalParameters4fvEXT(disp, fn) ((disp)->ProgramLocalParameters4fvEXT = fn)
 
 #else
 
-#define driDispatchRemapTable_size 415
+#define driDispatchRemapTable_size 417
 extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
 
 #define LoadTransposeMatrixfARB_remap_index 0
@@ -2948,6 +2954,8 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
 #define DeleteVertexArraysAPPLE_remap_index 412
 #define GenVertexArraysAPPLE_remap_index 413
 #define IsVertexArrayAPPLE_remap_index 414
+#define ProgramEnvParameters4fvEXT_remap_index 415
+#define ProgramLocalParameters4fvEXT_remap_index 416
 
 #define CALL_LoadTransposeMatrixfARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index], parameters)
 #define GET_LoadTransposeMatrixfARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index])
@@ -4194,6 +4202,12 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
 #define CALL_IsVertexArrayAPPLE(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsVertexArrayAPPLE_remap_index], parameters)
 #define GET_IsVertexArrayAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[IsVertexArrayAPPLE_remap_index])
 #define SET_IsVertexArrayAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsVertexArrayAPPLE_remap_index], fn)
+#define CALL_ProgramEnvParameters4fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index], parameters)
+#define GET_ProgramEnvParameters4fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index])
+#define SET_ProgramEnvParameters4fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index], fn)
+#define CALL_ProgramLocalParameters4fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index], parameters)
+#define GET_ProgramLocalParameters4fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index])
+#define SET_ProgramLocalParameters4fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index], fn)
 
 #endif /* !defined(IN_DRI_DRIVER) */
 
diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml
index d5e299add98..419d3bc880c 100644
--- a/src/mesa/glapi/gl_API.xml
+++ b/src/mesa/glapi/gl_API.xml
@@ -11551,4 +11551,20 @@
     
 
 
+
+    
+        
+	
+	
+	
+    	
+
+    
+        
+	
+	
+	
+    	
+
+
 
diff --git a/src/mesa/glapi/glapioffsets.h b/src/mesa/glapi/glapioffsets.h
index 9d3e8960ba4..9b571299c55 100644
--- a/src/mesa/glapi/glapioffsets.h
+++ b/src/mesa/glapi/glapioffsets.h
@@ -855,7 +855,9 @@
 #define _gloffset_DeleteVertexArraysAPPLE 820
 #define _gloffset_GenVertexArraysAPPLE 821
 #define _gloffset_IsVertexArrayAPPLE 822
-#define _gloffset_FIRST_DYNAMIC 823
+#define _gloffset_ProgramEnvParameters4fvEXT 823
+#define _gloffset_ProgramLocalParameters4fvEXT 824
+#define _gloffset_FIRST_DYNAMIC 825
 
 #else
 
@@ -1274,6 +1276,8 @@
 #define _gloffset_DeleteVertexArraysAPPLE driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index]
 #define _gloffset_GenVertexArraysAPPLE driDispatchRemapTable[GenVertexArraysAPPLE_remap_index]
 #define _gloffset_IsVertexArrayAPPLE driDispatchRemapTable[IsVertexArrayAPPLE_remap_index]
+#define _gloffset_ProgramEnvParameters4fvEXT driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index]
+#define _gloffset_ProgramLocalParameters4fvEXT driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index]
 
 #endif /* !defined(IN_DRI_DRIVER) */
 
diff --git a/src/mesa/glapi/glapitable.h b/src/mesa/glapi/glapitable.h
index d35630043b7..6ca49ee458f 100644
--- a/src/mesa/glapi/glapitable.h
+++ b/src/mesa/glapi/glapitable.h
@@ -860,6 +860,8 @@ struct _glapi_table
    void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 820 */
    void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 821 */
    GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 822 */
+   void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 823 */
+   void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 824 */
 };
 
 #endif /* !defined( _GLAPI_TABLE_H_ ) */
diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h
index 50c19aec1d6..442fccf2955 100644
--- a/src/mesa/glapi/glapitemp.h
+++ b/src/mesa/glapi/glapitemp.h
@@ -5075,6 +5075,16 @@ KEYWORD1 GLboolean KEYWORD2 NAME(IsVertexArrayAPPLE)(GLuint array)
    RETURN_DISPATCH(IsVertexArrayAPPLE, (array), (F, "glIsVertexArrayAPPLE(%d);\n", array));
 }
 
+KEYWORD1 void KEYWORD2 NAME(ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
+{
+   DISPATCH(ProgramEnvParameters4fvEXT, (target, index, count, params), (F, "glProgramEnvParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params));
+}
+
+KEYWORD1 void KEYWORD2 NAME(ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
+{
+   DISPATCH(ProgramLocalParameters4fvEXT, (target, index, count, params), (F, "glProgramLocalParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params));
+}
+
 
 #endif /* defined( NAME ) */
 
@@ -5912,6 +5922,8 @@ static _glapi_proc DISPATCH_TABLE_NAME[] = {
    TABLE_ENTRY(DeleteVertexArraysAPPLE),
    TABLE_ENTRY(GenVertexArraysAPPLE),
    TABLE_ENTRY(IsVertexArrayAPPLE),
+   TABLE_ENTRY(ProgramEnvParameters4fvEXT),
+   TABLE_ENTRY(ProgramLocalParameters4fvEXT),
    /* A whole bunch of no-op functions.  These might be called
     * when someone tries to call a dynamically-registered
     * extension function without a current rendering context.
diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h
index 1c72f6fd2da..3a858ca0e74 100644
--- a/src/mesa/glapi/glprocs.h
+++ b/src/mesa/glapi/glprocs.h
@@ -869,6 +869,8 @@ static const char gl_string_table[] =
     "glDeleteVertexArraysAPPLE\0"
     "glGenVertexArraysAPPLE\0"
     "glIsVertexArrayAPPLE\0"
+    "glProgramEnvParameters4fvEXT\0"
+    "glProgramLocalParameters4fvEXT\0"
     "glArrayElementEXT\0"
     "glBindTextureEXT\0"
     "glDrawArraysEXT\0"
@@ -1873,184 +1875,186 @@ static const glprocs_table_t static_functions[] = {
     NAME_FUNC_OFFSET( 14764, glDeleteVertexArraysAPPLE, _gloffset_DeleteVertexArraysAPPLE ),
     NAME_FUNC_OFFSET( 14790, glGenVertexArraysAPPLE, _gloffset_GenVertexArraysAPPLE ),
     NAME_FUNC_OFFSET( 14813, glIsVertexArrayAPPLE, _gloffset_IsVertexArrayAPPLE ),
-    NAME_FUNC_OFFSET( 14834, glArrayElementEXT, _gloffset_ArrayElement ),
-    NAME_FUNC_OFFSET( 14852, glBindTextureEXT, _gloffset_BindTexture ),
-    NAME_FUNC_OFFSET( 14869, glDrawArraysEXT, _gloffset_DrawArrays ),
-    NAME_FUNC_OFFSET( 14885, glCopyTexImage1DEXT, _gloffset_CopyTexImage1D ),
-    NAME_FUNC_OFFSET( 14905, glCopyTexImage2DEXT, _gloffset_CopyTexImage2D ),
-    NAME_FUNC_OFFSET( 14925, glCopyTexSubImage1DEXT, _gloffset_CopyTexSubImage1D ),
-    NAME_FUNC_OFFSET( 14948, glCopyTexSubImage2DEXT, _gloffset_CopyTexSubImage2D ),
-    NAME_FUNC_OFFSET( 14971, glDeleteTexturesEXT, _gloffset_DeleteTextures ),
-    NAME_FUNC_OFFSET( 14991, glGetPointervEXT, _gloffset_GetPointerv ),
-    NAME_FUNC_OFFSET( 15008, glPrioritizeTexturesEXT, _gloffset_PrioritizeTextures ),
-    NAME_FUNC_OFFSET( 15032, glTexSubImage1DEXT, _gloffset_TexSubImage1D ),
-    NAME_FUNC_OFFSET( 15051, glTexSubImage2DEXT, _gloffset_TexSubImage2D ),
-    NAME_FUNC_OFFSET( 15070, glBlendColorEXT, _gloffset_BlendColor ),
-    NAME_FUNC_OFFSET( 15086, glBlendEquationEXT, _gloffset_BlendEquation ),
-    NAME_FUNC_OFFSET( 15105, glDrawRangeElementsEXT, _gloffset_DrawRangeElements ),
-    NAME_FUNC_OFFSET( 15128, glColorTableSGI, _gloffset_ColorTable ),
-    NAME_FUNC_OFFSET( 15144, glColorTableEXT, _gloffset_ColorTable ),
-    NAME_FUNC_OFFSET( 15160, glColorTableParameterfvSGI, _gloffset_ColorTableParameterfv ),
-    NAME_FUNC_OFFSET( 15187, glColorTableParameterivSGI, _gloffset_ColorTableParameteriv ),
-    NAME_FUNC_OFFSET( 15214, glCopyColorTableSGI, _gloffset_CopyColorTable ),
-    NAME_FUNC_OFFSET( 15234, glColorSubTableEXT, _gloffset_ColorSubTable ),
-    NAME_FUNC_OFFSET( 15253, glCopyColorSubTableEXT, _gloffset_CopyColorSubTable ),
-    NAME_FUNC_OFFSET( 15276, glConvolutionFilter1DEXT, _gloffset_ConvolutionFilter1D ),
-    NAME_FUNC_OFFSET( 15301, glConvolutionFilter2DEXT, _gloffset_ConvolutionFilter2D ),
-    NAME_FUNC_OFFSET( 15326, glConvolutionParameterfEXT, _gloffset_ConvolutionParameterf ),
-    NAME_FUNC_OFFSET( 15353, glConvolutionParameterfvEXT, _gloffset_ConvolutionParameterfv ),
-    NAME_FUNC_OFFSET( 15381, glConvolutionParameteriEXT, _gloffset_ConvolutionParameteri ),
-    NAME_FUNC_OFFSET( 15408, glConvolutionParameterivEXT, _gloffset_ConvolutionParameteriv ),
-    NAME_FUNC_OFFSET( 15436, glCopyConvolutionFilter1DEXT, _gloffset_CopyConvolutionFilter1D ),
-    NAME_FUNC_OFFSET( 15465, glCopyConvolutionFilter2DEXT, _gloffset_CopyConvolutionFilter2D ),
-    NAME_FUNC_OFFSET( 15494, glSeparableFilter2DEXT, _gloffset_SeparableFilter2D ),
-    NAME_FUNC_OFFSET( 15517, glHistogramEXT, _gloffset_Histogram ),
-    NAME_FUNC_OFFSET( 15532, glMinmaxEXT, _gloffset_Minmax ),
-    NAME_FUNC_OFFSET( 15544, glResetHistogramEXT, _gloffset_ResetHistogram ),
-    NAME_FUNC_OFFSET( 15564, glResetMinmaxEXT, _gloffset_ResetMinmax ),
-    NAME_FUNC_OFFSET( 15581, glTexImage3DEXT, _gloffset_TexImage3D ),
-    NAME_FUNC_OFFSET( 15597, glTexSubImage3DEXT, _gloffset_TexSubImage3D ),
-    NAME_FUNC_OFFSET( 15616, glCopyTexSubImage3DEXT, _gloffset_CopyTexSubImage3D ),
-    NAME_FUNC_OFFSET( 15639, glActiveTexture, _gloffset_ActiveTextureARB ),
-    NAME_FUNC_OFFSET( 15655, glClientActiveTexture, _gloffset_ClientActiveTextureARB ),
-    NAME_FUNC_OFFSET( 15677, glMultiTexCoord1d, _gloffset_MultiTexCoord1dARB ),
-    NAME_FUNC_OFFSET( 15695, glMultiTexCoord1dv, _gloffset_MultiTexCoord1dvARB ),
-    NAME_FUNC_OFFSET( 15714, glMultiTexCoord1f, _gloffset_MultiTexCoord1fARB ),
-    NAME_FUNC_OFFSET( 15732, glMultiTexCoord1fv, _gloffset_MultiTexCoord1fvARB ),
-    NAME_FUNC_OFFSET( 15751, glMultiTexCoord1i, _gloffset_MultiTexCoord1iARB ),
-    NAME_FUNC_OFFSET( 15769, glMultiTexCoord1iv, _gloffset_MultiTexCoord1ivARB ),
-    NAME_FUNC_OFFSET( 15788, glMultiTexCoord1s, _gloffset_MultiTexCoord1sARB ),
-    NAME_FUNC_OFFSET( 15806, glMultiTexCoord1sv, _gloffset_MultiTexCoord1svARB ),
-    NAME_FUNC_OFFSET( 15825, glMultiTexCoord2d, _gloffset_MultiTexCoord2dARB ),
-    NAME_FUNC_OFFSET( 15843, glMultiTexCoord2dv, _gloffset_MultiTexCoord2dvARB ),
-    NAME_FUNC_OFFSET( 15862, glMultiTexCoord2f, _gloffset_MultiTexCoord2fARB ),
-    NAME_FUNC_OFFSET( 15880, glMultiTexCoord2fv, _gloffset_MultiTexCoord2fvARB ),
-    NAME_FUNC_OFFSET( 15899, glMultiTexCoord2i, _gloffset_MultiTexCoord2iARB ),
-    NAME_FUNC_OFFSET( 15917, glMultiTexCoord2iv, _gloffset_MultiTexCoord2ivARB ),
-    NAME_FUNC_OFFSET( 15936, glMultiTexCoord2s, _gloffset_MultiTexCoord2sARB ),
-    NAME_FUNC_OFFSET( 15954, glMultiTexCoord2sv, _gloffset_MultiTexCoord2svARB ),
-    NAME_FUNC_OFFSET( 15973, glMultiTexCoord3d, _gloffset_MultiTexCoord3dARB ),
-    NAME_FUNC_OFFSET( 15991, glMultiTexCoord3dv, _gloffset_MultiTexCoord3dvARB ),
-    NAME_FUNC_OFFSET( 16010, glMultiTexCoord3f, _gloffset_MultiTexCoord3fARB ),
-    NAME_FUNC_OFFSET( 16028, glMultiTexCoord3fv, _gloffset_MultiTexCoord3fvARB ),
-    NAME_FUNC_OFFSET( 16047, glMultiTexCoord3i, _gloffset_MultiTexCoord3iARB ),
-    NAME_FUNC_OFFSET( 16065, glMultiTexCoord3iv, _gloffset_MultiTexCoord3ivARB ),
-    NAME_FUNC_OFFSET( 16084, glMultiTexCoord3s, _gloffset_MultiTexCoord3sARB ),
-    NAME_FUNC_OFFSET( 16102, glMultiTexCoord3sv, _gloffset_MultiTexCoord3svARB ),
-    NAME_FUNC_OFFSET( 16121, glMultiTexCoord4d, _gloffset_MultiTexCoord4dARB ),
-    NAME_FUNC_OFFSET( 16139, glMultiTexCoord4dv, _gloffset_MultiTexCoord4dvARB ),
-    NAME_FUNC_OFFSET( 16158, glMultiTexCoord4f, _gloffset_MultiTexCoord4fARB ),
-    NAME_FUNC_OFFSET( 16176, glMultiTexCoord4fv, _gloffset_MultiTexCoord4fvARB ),
-    NAME_FUNC_OFFSET( 16195, glMultiTexCoord4i, _gloffset_MultiTexCoord4iARB ),
-    NAME_FUNC_OFFSET( 16213, glMultiTexCoord4iv, _gloffset_MultiTexCoord4ivARB ),
-    NAME_FUNC_OFFSET( 16232, glMultiTexCoord4s, _gloffset_MultiTexCoord4sARB ),
-    NAME_FUNC_OFFSET( 16250, glMultiTexCoord4sv, _gloffset_MultiTexCoord4svARB ),
-    NAME_FUNC_OFFSET( 16269, glLoadTransposeMatrixf, _gloffset_LoadTransposeMatrixfARB ),
-    NAME_FUNC_OFFSET( 16292, glLoadTransposeMatrixd, _gloffset_LoadTransposeMatrixdARB ),
-    NAME_FUNC_OFFSET( 16315, glMultTransposeMatrixf, _gloffset_MultTransposeMatrixfARB ),
-    NAME_FUNC_OFFSET( 16338, glMultTransposeMatrixd, _gloffset_MultTransposeMatrixdARB ),
-    NAME_FUNC_OFFSET( 16361, glSampleCoverage, _gloffset_SampleCoverageARB ),
-    NAME_FUNC_OFFSET( 16378, glDrawBuffersATI, _gloffset_DrawBuffersARB ),
-    NAME_FUNC_OFFSET( 16395, glSampleMaskEXT, _gloffset_SampleMaskSGIS ),
-    NAME_FUNC_OFFSET( 16411, glSamplePatternEXT, _gloffset_SamplePatternSGIS ),
-    NAME_FUNC_OFFSET( 16430, glPointParameterf, _gloffset_PointParameterfEXT ),
-    NAME_FUNC_OFFSET( 16448, glPointParameterfARB, _gloffset_PointParameterfEXT ),
-    NAME_FUNC_OFFSET( 16469, glPointParameterfSGIS, _gloffset_PointParameterfEXT ),
-    NAME_FUNC_OFFSET( 16491, glPointParameterfv, _gloffset_PointParameterfvEXT ),
-    NAME_FUNC_OFFSET( 16510, glPointParameterfvARB, _gloffset_PointParameterfvEXT ),
-    NAME_FUNC_OFFSET( 16532, glPointParameterfvSGIS, _gloffset_PointParameterfvEXT ),
-    NAME_FUNC_OFFSET( 16555, glWindowPos2d, _gloffset_WindowPos2dMESA ),
-    NAME_FUNC_OFFSET( 16569, glWindowPos2dARB, _gloffset_WindowPos2dMESA ),
-    NAME_FUNC_OFFSET( 16586, glWindowPos2dv, _gloffset_WindowPos2dvMESA ),
-    NAME_FUNC_OFFSET( 16601, glWindowPos2dvARB, _gloffset_WindowPos2dvMESA ),
-    NAME_FUNC_OFFSET( 16619, glWindowPos2f, _gloffset_WindowPos2fMESA ),
-    NAME_FUNC_OFFSET( 16633, glWindowPos2fARB, _gloffset_WindowPos2fMESA ),
-    NAME_FUNC_OFFSET( 16650, glWindowPos2fv, _gloffset_WindowPos2fvMESA ),
-    NAME_FUNC_OFFSET( 16665, glWindowPos2fvARB, _gloffset_WindowPos2fvMESA ),
-    NAME_FUNC_OFFSET( 16683, glWindowPos2i, _gloffset_WindowPos2iMESA ),
-    NAME_FUNC_OFFSET( 16697, glWindowPos2iARB, _gloffset_WindowPos2iMESA ),
-    NAME_FUNC_OFFSET( 16714, glWindowPos2iv, _gloffset_WindowPos2ivMESA ),
-    NAME_FUNC_OFFSET( 16729, glWindowPos2ivARB, _gloffset_WindowPos2ivMESA ),
-    NAME_FUNC_OFFSET( 16747, glWindowPos2s, _gloffset_WindowPos2sMESA ),
-    NAME_FUNC_OFFSET( 16761, glWindowPos2sARB, _gloffset_WindowPos2sMESA ),
-    NAME_FUNC_OFFSET( 16778, glWindowPos2sv, _gloffset_WindowPos2svMESA ),
-    NAME_FUNC_OFFSET( 16793, glWindowPos2svARB, _gloffset_WindowPos2svMESA ),
-    NAME_FUNC_OFFSET( 16811, glWindowPos3d, _gloffset_WindowPos3dMESA ),
-    NAME_FUNC_OFFSET( 16825, glWindowPos3dARB, _gloffset_WindowPos3dMESA ),
-    NAME_FUNC_OFFSET( 16842, glWindowPos3dv, _gloffset_WindowPos3dvMESA ),
-    NAME_FUNC_OFFSET( 16857, glWindowPos3dvARB, _gloffset_WindowPos3dvMESA ),
-    NAME_FUNC_OFFSET( 16875, glWindowPos3f, _gloffset_WindowPos3fMESA ),
-    NAME_FUNC_OFFSET( 16889, glWindowPos3fARB, _gloffset_WindowPos3fMESA ),
-    NAME_FUNC_OFFSET( 16906, glWindowPos3fv, _gloffset_WindowPos3fvMESA ),
-    NAME_FUNC_OFFSET( 16921, glWindowPos3fvARB, _gloffset_WindowPos3fvMESA ),
-    NAME_FUNC_OFFSET( 16939, glWindowPos3i, _gloffset_WindowPos3iMESA ),
-    NAME_FUNC_OFFSET( 16953, glWindowPos3iARB, _gloffset_WindowPos3iMESA ),
-    NAME_FUNC_OFFSET( 16970, glWindowPos3iv, _gloffset_WindowPos3ivMESA ),
-    NAME_FUNC_OFFSET( 16985, glWindowPos3ivARB, _gloffset_WindowPos3ivMESA ),
-    NAME_FUNC_OFFSET( 17003, glWindowPos3s, _gloffset_WindowPos3sMESA ),
-    NAME_FUNC_OFFSET( 17017, glWindowPos3sARB, _gloffset_WindowPos3sMESA ),
-    NAME_FUNC_OFFSET( 17034, glWindowPos3sv, _gloffset_WindowPos3svMESA ),
-    NAME_FUNC_OFFSET( 17049, glWindowPos3svARB, _gloffset_WindowPos3svMESA ),
-    NAME_FUNC_OFFSET( 17067, glBlendFuncSeparate, _gloffset_BlendFuncSeparateEXT ),
-    NAME_FUNC_OFFSET( 17087, glBlendFuncSeparateINGR, _gloffset_BlendFuncSeparateEXT ),
-    NAME_FUNC_OFFSET( 17111, glFogCoordf, _gloffset_FogCoordfEXT ),
-    NAME_FUNC_OFFSET( 17123, glFogCoordfv, _gloffset_FogCoordfvEXT ),
-    NAME_FUNC_OFFSET( 17136, glFogCoordd, _gloffset_FogCoorddEXT ),
-    NAME_FUNC_OFFSET( 17148, glFogCoorddv, _gloffset_FogCoorddvEXT ),
-    NAME_FUNC_OFFSET( 17161, glFogCoordPointer, _gloffset_FogCoordPointerEXT ),
-    NAME_FUNC_OFFSET( 17179, glCompressedTexImage3D, _gloffset_CompressedTexImage3DARB ),
-    NAME_FUNC_OFFSET( 17202, glCompressedTexImage2D, _gloffset_CompressedTexImage2DARB ),
-    NAME_FUNC_OFFSET( 17225, glCompressedTexImage1D, _gloffset_CompressedTexImage1DARB ),
-    NAME_FUNC_OFFSET( 17248, glCompressedTexSubImage3D, _gloffset_CompressedTexSubImage3DARB ),
-    NAME_FUNC_OFFSET( 17274, glCompressedTexSubImage2D, _gloffset_CompressedTexSubImage2DARB ),
-    NAME_FUNC_OFFSET( 17300, glCompressedTexSubImage1D, _gloffset_CompressedTexSubImage1DARB ),
-    NAME_FUNC_OFFSET( 17326, glGetCompressedTexImage, _gloffset_GetCompressedTexImageARB ),
-    NAME_FUNC_OFFSET( 17350, glSecondaryColor3b, _gloffset_SecondaryColor3bEXT ),
-    NAME_FUNC_OFFSET( 17369, glSecondaryColor3bv, _gloffset_SecondaryColor3bvEXT ),
-    NAME_FUNC_OFFSET( 17389, glSecondaryColor3d, _gloffset_SecondaryColor3dEXT ),
-    NAME_FUNC_OFFSET( 17408, glSecondaryColor3dv, _gloffset_SecondaryColor3dvEXT ),
-    NAME_FUNC_OFFSET( 17428, glSecondaryColor3f, _gloffset_SecondaryColor3fEXT ),
-    NAME_FUNC_OFFSET( 17447, glSecondaryColor3fv, _gloffset_SecondaryColor3fvEXT ),
-    NAME_FUNC_OFFSET( 17467, glSecondaryColor3i, _gloffset_SecondaryColor3iEXT ),
-    NAME_FUNC_OFFSET( 17486, glSecondaryColor3iv, _gloffset_SecondaryColor3ivEXT ),
-    NAME_FUNC_OFFSET( 17506, glSecondaryColor3s, _gloffset_SecondaryColor3sEXT ),
-    NAME_FUNC_OFFSET( 17525, glSecondaryColor3sv, _gloffset_SecondaryColor3svEXT ),
-    NAME_FUNC_OFFSET( 17545, glSecondaryColor3ub, _gloffset_SecondaryColor3ubEXT ),
-    NAME_FUNC_OFFSET( 17565, glSecondaryColor3ubv, _gloffset_SecondaryColor3ubvEXT ),
-    NAME_FUNC_OFFSET( 17586, glSecondaryColor3ui, _gloffset_SecondaryColor3uiEXT ),
-    NAME_FUNC_OFFSET( 17606, glSecondaryColor3uiv, _gloffset_SecondaryColor3uivEXT ),
-    NAME_FUNC_OFFSET( 17627, glSecondaryColor3us, _gloffset_SecondaryColor3usEXT ),
-    NAME_FUNC_OFFSET( 17647, glSecondaryColor3usv, _gloffset_SecondaryColor3usvEXT ),
-    NAME_FUNC_OFFSET( 17668, glSecondaryColorPointer, _gloffset_SecondaryColorPointerEXT ),
-    NAME_FUNC_OFFSET( 17692, glBindProgramARB, _gloffset_BindProgramNV ),
-    NAME_FUNC_OFFSET( 17709, glDeleteProgramsARB, _gloffset_DeleteProgramsNV ),
-    NAME_FUNC_OFFSET( 17729, glGenProgramsARB, _gloffset_GenProgramsNV ),
-    NAME_FUNC_OFFSET( 17746, glGetVertexAttribPointervARB, _gloffset_GetVertexAttribPointervNV ),
-    NAME_FUNC_OFFSET( 17775, glIsProgramARB, _gloffset_IsProgramNV ),
-    NAME_FUNC_OFFSET( 17790, glPointParameteri, _gloffset_PointParameteriNV ),
-    NAME_FUNC_OFFSET( 17808, glPointParameteriv, _gloffset_PointParameterivNV ),
-    NAME_FUNC_OFFSET( 17827, glMultiDrawArrays, _gloffset_MultiDrawArraysEXT ),
-    NAME_FUNC_OFFSET( 17845, glMultiDrawElements, _gloffset_MultiDrawElementsEXT ),
-    NAME_FUNC_OFFSET( 17865, glBindBuffer, _gloffset_BindBufferARB ),
-    NAME_FUNC_OFFSET( 17878, glBufferData, _gloffset_BufferDataARB ),
-    NAME_FUNC_OFFSET( 17891, glBufferSubData, _gloffset_BufferSubDataARB ),
-    NAME_FUNC_OFFSET( 17907, glDeleteBuffers, _gloffset_DeleteBuffersARB ),
-    NAME_FUNC_OFFSET( 17923, glGenBuffers, _gloffset_GenBuffersARB ),
-    NAME_FUNC_OFFSET( 17936, glGetBufferParameteriv, _gloffset_GetBufferParameterivARB ),
-    NAME_FUNC_OFFSET( 17959, glGetBufferPointerv, _gloffset_GetBufferPointervARB ),
-    NAME_FUNC_OFFSET( 17979, glGetBufferSubData, _gloffset_GetBufferSubDataARB ),
-    NAME_FUNC_OFFSET( 17998, glIsBuffer, _gloffset_IsBufferARB ),
-    NAME_FUNC_OFFSET( 18009, glMapBuffer, _gloffset_MapBufferARB ),
-    NAME_FUNC_OFFSET( 18021, glUnmapBuffer, _gloffset_UnmapBufferARB ),
-    NAME_FUNC_OFFSET( 18035, glGenQueries, _gloffset_GenQueriesARB ),
-    NAME_FUNC_OFFSET( 18048, glDeleteQueries, _gloffset_DeleteQueriesARB ),
-    NAME_FUNC_OFFSET( 18064, glIsQuery, _gloffset_IsQueryARB ),
-    NAME_FUNC_OFFSET( 18074, glBeginQuery, _gloffset_BeginQueryARB ),
-    NAME_FUNC_OFFSET( 18087, glEndQuery, _gloffset_EndQueryARB ),
-    NAME_FUNC_OFFSET( 18098, glGetQueryiv, _gloffset_GetQueryivARB ),
-    NAME_FUNC_OFFSET( 18111, glGetQueryObjectiv, _gloffset_GetQueryObjectivARB ),
-    NAME_FUNC_OFFSET( 18130, glGetQueryObjectuiv, _gloffset_GetQueryObjectuivARB ),
-    NAME_FUNC_OFFSET( 18150, glBlendEquationSeparateATI, _gloffset_BlendEquationSeparateEXT ),
+    NAME_FUNC_OFFSET( 14834, glProgramEnvParameters4fvEXT, _gloffset_ProgramEnvParameters4fvEXT ),
+    NAME_FUNC_OFFSET( 14863, glProgramLocalParameters4fvEXT, _gloffset_ProgramLocalParameters4fvEXT ),
+    NAME_FUNC_OFFSET( 14894, glArrayElementEXT, _gloffset_ArrayElement ),
+    NAME_FUNC_OFFSET( 14912, glBindTextureEXT, _gloffset_BindTexture ),
+    NAME_FUNC_OFFSET( 14929, glDrawArraysEXT, _gloffset_DrawArrays ),
+    NAME_FUNC_OFFSET( 14945, glCopyTexImage1DEXT, _gloffset_CopyTexImage1D ),
+    NAME_FUNC_OFFSET( 14965, glCopyTexImage2DEXT, _gloffset_CopyTexImage2D ),
+    NAME_FUNC_OFFSET( 14985, glCopyTexSubImage1DEXT, _gloffset_CopyTexSubImage1D ),
+    NAME_FUNC_OFFSET( 15008, glCopyTexSubImage2DEXT, _gloffset_CopyTexSubImage2D ),
+    NAME_FUNC_OFFSET( 15031, glDeleteTexturesEXT, _gloffset_DeleteTextures ),
+    NAME_FUNC_OFFSET( 15051, glGetPointervEXT, _gloffset_GetPointerv ),
+    NAME_FUNC_OFFSET( 15068, glPrioritizeTexturesEXT, _gloffset_PrioritizeTextures ),
+    NAME_FUNC_OFFSET( 15092, glTexSubImage1DEXT, _gloffset_TexSubImage1D ),
+    NAME_FUNC_OFFSET( 15111, glTexSubImage2DEXT, _gloffset_TexSubImage2D ),
+    NAME_FUNC_OFFSET( 15130, glBlendColorEXT, _gloffset_BlendColor ),
+    NAME_FUNC_OFFSET( 15146, glBlendEquationEXT, _gloffset_BlendEquation ),
+    NAME_FUNC_OFFSET( 15165, glDrawRangeElementsEXT, _gloffset_DrawRangeElements ),
+    NAME_FUNC_OFFSET( 15188, glColorTableSGI, _gloffset_ColorTable ),
+    NAME_FUNC_OFFSET( 15204, glColorTableEXT, _gloffset_ColorTable ),
+    NAME_FUNC_OFFSET( 15220, glColorTableParameterfvSGI, _gloffset_ColorTableParameterfv ),
+    NAME_FUNC_OFFSET( 15247, glColorTableParameterivSGI, _gloffset_ColorTableParameteriv ),
+    NAME_FUNC_OFFSET( 15274, glCopyColorTableSGI, _gloffset_CopyColorTable ),
+    NAME_FUNC_OFFSET( 15294, glColorSubTableEXT, _gloffset_ColorSubTable ),
+    NAME_FUNC_OFFSET( 15313, glCopyColorSubTableEXT, _gloffset_CopyColorSubTable ),
+    NAME_FUNC_OFFSET( 15336, glConvolutionFilter1DEXT, _gloffset_ConvolutionFilter1D ),
+    NAME_FUNC_OFFSET( 15361, glConvolutionFilter2DEXT, _gloffset_ConvolutionFilter2D ),
+    NAME_FUNC_OFFSET( 15386, glConvolutionParameterfEXT, _gloffset_ConvolutionParameterf ),
+    NAME_FUNC_OFFSET( 15413, glConvolutionParameterfvEXT, _gloffset_ConvolutionParameterfv ),
+    NAME_FUNC_OFFSET( 15441, glConvolutionParameteriEXT, _gloffset_ConvolutionParameteri ),
+    NAME_FUNC_OFFSET( 15468, glConvolutionParameterivEXT, _gloffset_ConvolutionParameteriv ),
+    NAME_FUNC_OFFSET( 15496, glCopyConvolutionFilter1DEXT, _gloffset_CopyConvolutionFilter1D ),
+    NAME_FUNC_OFFSET( 15525, glCopyConvolutionFilter2DEXT, _gloffset_CopyConvolutionFilter2D ),
+    NAME_FUNC_OFFSET( 15554, glSeparableFilter2DEXT, _gloffset_SeparableFilter2D ),
+    NAME_FUNC_OFFSET( 15577, glHistogramEXT, _gloffset_Histogram ),
+    NAME_FUNC_OFFSET( 15592, glMinmaxEXT, _gloffset_Minmax ),
+    NAME_FUNC_OFFSET( 15604, glResetHistogramEXT, _gloffset_ResetHistogram ),
+    NAME_FUNC_OFFSET( 15624, glResetMinmaxEXT, _gloffset_ResetMinmax ),
+    NAME_FUNC_OFFSET( 15641, glTexImage3DEXT, _gloffset_TexImage3D ),
+    NAME_FUNC_OFFSET( 15657, glTexSubImage3DEXT, _gloffset_TexSubImage3D ),
+    NAME_FUNC_OFFSET( 15676, glCopyTexSubImage3DEXT, _gloffset_CopyTexSubImage3D ),
+    NAME_FUNC_OFFSET( 15699, glActiveTexture, _gloffset_ActiveTextureARB ),
+    NAME_FUNC_OFFSET( 15715, glClientActiveTexture, _gloffset_ClientActiveTextureARB ),
+    NAME_FUNC_OFFSET( 15737, glMultiTexCoord1d, _gloffset_MultiTexCoord1dARB ),
+    NAME_FUNC_OFFSET( 15755, glMultiTexCoord1dv, _gloffset_MultiTexCoord1dvARB ),
+    NAME_FUNC_OFFSET( 15774, glMultiTexCoord1f, _gloffset_MultiTexCoord1fARB ),
+    NAME_FUNC_OFFSET( 15792, glMultiTexCoord1fv, _gloffset_MultiTexCoord1fvARB ),
+    NAME_FUNC_OFFSET( 15811, glMultiTexCoord1i, _gloffset_MultiTexCoord1iARB ),
+    NAME_FUNC_OFFSET( 15829, glMultiTexCoord1iv, _gloffset_MultiTexCoord1ivARB ),
+    NAME_FUNC_OFFSET( 15848, glMultiTexCoord1s, _gloffset_MultiTexCoord1sARB ),
+    NAME_FUNC_OFFSET( 15866, glMultiTexCoord1sv, _gloffset_MultiTexCoord1svARB ),
+    NAME_FUNC_OFFSET( 15885, glMultiTexCoord2d, _gloffset_MultiTexCoord2dARB ),
+    NAME_FUNC_OFFSET( 15903, glMultiTexCoord2dv, _gloffset_MultiTexCoord2dvARB ),
+    NAME_FUNC_OFFSET( 15922, glMultiTexCoord2f, _gloffset_MultiTexCoord2fARB ),
+    NAME_FUNC_OFFSET( 15940, glMultiTexCoord2fv, _gloffset_MultiTexCoord2fvARB ),
+    NAME_FUNC_OFFSET( 15959, glMultiTexCoord2i, _gloffset_MultiTexCoord2iARB ),
+    NAME_FUNC_OFFSET( 15977, glMultiTexCoord2iv, _gloffset_MultiTexCoord2ivARB ),
+    NAME_FUNC_OFFSET( 15996, glMultiTexCoord2s, _gloffset_MultiTexCoord2sARB ),
+    NAME_FUNC_OFFSET( 16014, glMultiTexCoord2sv, _gloffset_MultiTexCoord2svARB ),
+    NAME_FUNC_OFFSET( 16033, glMultiTexCoord3d, _gloffset_MultiTexCoord3dARB ),
+    NAME_FUNC_OFFSET( 16051, glMultiTexCoord3dv, _gloffset_MultiTexCoord3dvARB ),
+    NAME_FUNC_OFFSET( 16070, glMultiTexCoord3f, _gloffset_MultiTexCoord3fARB ),
+    NAME_FUNC_OFFSET( 16088, glMultiTexCoord3fv, _gloffset_MultiTexCoord3fvARB ),
+    NAME_FUNC_OFFSET( 16107, glMultiTexCoord3i, _gloffset_MultiTexCoord3iARB ),
+    NAME_FUNC_OFFSET( 16125, glMultiTexCoord3iv, _gloffset_MultiTexCoord3ivARB ),
+    NAME_FUNC_OFFSET( 16144, glMultiTexCoord3s, _gloffset_MultiTexCoord3sARB ),
+    NAME_FUNC_OFFSET( 16162, glMultiTexCoord3sv, _gloffset_MultiTexCoord3svARB ),
+    NAME_FUNC_OFFSET( 16181, glMultiTexCoord4d, _gloffset_MultiTexCoord4dARB ),
+    NAME_FUNC_OFFSET( 16199, glMultiTexCoord4dv, _gloffset_MultiTexCoord4dvARB ),
+    NAME_FUNC_OFFSET( 16218, glMultiTexCoord4f, _gloffset_MultiTexCoord4fARB ),
+    NAME_FUNC_OFFSET( 16236, glMultiTexCoord4fv, _gloffset_MultiTexCoord4fvARB ),
+    NAME_FUNC_OFFSET( 16255, glMultiTexCoord4i, _gloffset_MultiTexCoord4iARB ),
+    NAME_FUNC_OFFSET( 16273, glMultiTexCoord4iv, _gloffset_MultiTexCoord4ivARB ),
+    NAME_FUNC_OFFSET( 16292, glMultiTexCoord4s, _gloffset_MultiTexCoord4sARB ),
+    NAME_FUNC_OFFSET( 16310, glMultiTexCoord4sv, _gloffset_MultiTexCoord4svARB ),
+    NAME_FUNC_OFFSET( 16329, glLoadTransposeMatrixf, _gloffset_LoadTransposeMatrixfARB ),
+    NAME_FUNC_OFFSET( 16352, glLoadTransposeMatrixd, _gloffset_LoadTransposeMatrixdARB ),
+    NAME_FUNC_OFFSET( 16375, glMultTransposeMatrixf, _gloffset_MultTransposeMatrixfARB ),
+    NAME_FUNC_OFFSET( 16398, glMultTransposeMatrixd, _gloffset_MultTransposeMatrixdARB ),
+    NAME_FUNC_OFFSET( 16421, glSampleCoverage, _gloffset_SampleCoverageARB ),
+    NAME_FUNC_OFFSET( 16438, glDrawBuffersATI, _gloffset_DrawBuffersARB ),
+    NAME_FUNC_OFFSET( 16455, glSampleMaskEXT, _gloffset_SampleMaskSGIS ),
+    NAME_FUNC_OFFSET( 16471, glSamplePatternEXT, _gloffset_SamplePatternSGIS ),
+    NAME_FUNC_OFFSET( 16490, glPointParameterf, _gloffset_PointParameterfEXT ),
+    NAME_FUNC_OFFSET( 16508, glPointParameterfARB, _gloffset_PointParameterfEXT ),
+    NAME_FUNC_OFFSET( 16529, glPointParameterfSGIS, _gloffset_PointParameterfEXT ),
+    NAME_FUNC_OFFSET( 16551, glPointParameterfv, _gloffset_PointParameterfvEXT ),
+    NAME_FUNC_OFFSET( 16570, glPointParameterfvARB, _gloffset_PointParameterfvEXT ),
+    NAME_FUNC_OFFSET( 16592, glPointParameterfvSGIS, _gloffset_PointParameterfvEXT ),
+    NAME_FUNC_OFFSET( 16615, glWindowPos2d, _gloffset_WindowPos2dMESA ),
+    NAME_FUNC_OFFSET( 16629, glWindowPos2dARB, _gloffset_WindowPos2dMESA ),
+    NAME_FUNC_OFFSET( 16646, glWindowPos2dv, _gloffset_WindowPos2dvMESA ),
+    NAME_FUNC_OFFSET( 16661, glWindowPos2dvARB, _gloffset_WindowPos2dvMESA ),
+    NAME_FUNC_OFFSET( 16679, glWindowPos2f, _gloffset_WindowPos2fMESA ),
+    NAME_FUNC_OFFSET( 16693, glWindowPos2fARB, _gloffset_WindowPos2fMESA ),
+    NAME_FUNC_OFFSET( 16710, glWindowPos2fv, _gloffset_WindowPos2fvMESA ),
+    NAME_FUNC_OFFSET( 16725, glWindowPos2fvARB, _gloffset_WindowPos2fvMESA ),
+    NAME_FUNC_OFFSET( 16743, glWindowPos2i, _gloffset_WindowPos2iMESA ),
+    NAME_FUNC_OFFSET( 16757, glWindowPos2iARB, _gloffset_WindowPos2iMESA ),
+    NAME_FUNC_OFFSET( 16774, glWindowPos2iv, _gloffset_WindowPos2ivMESA ),
+    NAME_FUNC_OFFSET( 16789, glWindowPos2ivARB, _gloffset_WindowPos2ivMESA ),
+    NAME_FUNC_OFFSET( 16807, glWindowPos2s, _gloffset_WindowPos2sMESA ),
+    NAME_FUNC_OFFSET( 16821, glWindowPos2sARB, _gloffset_WindowPos2sMESA ),
+    NAME_FUNC_OFFSET( 16838, glWindowPos2sv, _gloffset_WindowPos2svMESA ),
+    NAME_FUNC_OFFSET( 16853, glWindowPos2svARB, _gloffset_WindowPos2svMESA ),
+    NAME_FUNC_OFFSET( 16871, glWindowPos3d, _gloffset_WindowPos3dMESA ),
+    NAME_FUNC_OFFSET( 16885, glWindowPos3dARB, _gloffset_WindowPos3dMESA ),
+    NAME_FUNC_OFFSET( 16902, glWindowPos3dv, _gloffset_WindowPos3dvMESA ),
+    NAME_FUNC_OFFSET( 16917, glWindowPos3dvARB, _gloffset_WindowPos3dvMESA ),
+    NAME_FUNC_OFFSET( 16935, glWindowPos3f, _gloffset_WindowPos3fMESA ),
+    NAME_FUNC_OFFSET( 16949, glWindowPos3fARB, _gloffset_WindowPos3fMESA ),
+    NAME_FUNC_OFFSET( 16966, glWindowPos3fv, _gloffset_WindowPos3fvMESA ),
+    NAME_FUNC_OFFSET( 16981, glWindowPos3fvARB, _gloffset_WindowPos3fvMESA ),
+    NAME_FUNC_OFFSET( 16999, glWindowPos3i, _gloffset_WindowPos3iMESA ),
+    NAME_FUNC_OFFSET( 17013, glWindowPos3iARB, _gloffset_WindowPos3iMESA ),
+    NAME_FUNC_OFFSET( 17030, glWindowPos3iv, _gloffset_WindowPos3ivMESA ),
+    NAME_FUNC_OFFSET( 17045, glWindowPos3ivARB, _gloffset_WindowPos3ivMESA ),
+    NAME_FUNC_OFFSET( 17063, glWindowPos3s, _gloffset_WindowPos3sMESA ),
+    NAME_FUNC_OFFSET( 17077, glWindowPos3sARB, _gloffset_WindowPos3sMESA ),
+    NAME_FUNC_OFFSET( 17094, glWindowPos3sv, _gloffset_WindowPos3svMESA ),
+    NAME_FUNC_OFFSET( 17109, glWindowPos3svARB, _gloffset_WindowPos3svMESA ),
+    NAME_FUNC_OFFSET( 17127, glBlendFuncSeparate, _gloffset_BlendFuncSeparateEXT ),
+    NAME_FUNC_OFFSET( 17147, glBlendFuncSeparateINGR, _gloffset_BlendFuncSeparateEXT ),
+    NAME_FUNC_OFFSET( 17171, glFogCoordf, _gloffset_FogCoordfEXT ),
+    NAME_FUNC_OFFSET( 17183, glFogCoordfv, _gloffset_FogCoordfvEXT ),
+    NAME_FUNC_OFFSET( 17196, glFogCoordd, _gloffset_FogCoorddEXT ),
+    NAME_FUNC_OFFSET( 17208, glFogCoorddv, _gloffset_FogCoorddvEXT ),
+    NAME_FUNC_OFFSET( 17221, glFogCoordPointer, _gloffset_FogCoordPointerEXT ),
+    NAME_FUNC_OFFSET( 17239, glCompressedTexImage3D, _gloffset_CompressedTexImage3DARB ),
+    NAME_FUNC_OFFSET( 17262, glCompressedTexImage2D, _gloffset_CompressedTexImage2DARB ),
+    NAME_FUNC_OFFSET( 17285, glCompressedTexImage1D, _gloffset_CompressedTexImage1DARB ),
+    NAME_FUNC_OFFSET( 17308, glCompressedTexSubImage3D, _gloffset_CompressedTexSubImage3DARB ),
+    NAME_FUNC_OFFSET( 17334, glCompressedTexSubImage2D, _gloffset_CompressedTexSubImage2DARB ),
+    NAME_FUNC_OFFSET( 17360, glCompressedTexSubImage1D, _gloffset_CompressedTexSubImage1DARB ),
+    NAME_FUNC_OFFSET( 17386, glGetCompressedTexImage, _gloffset_GetCompressedTexImageARB ),
+    NAME_FUNC_OFFSET( 17410, glSecondaryColor3b, _gloffset_SecondaryColor3bEXT ),
+    NAME_FUNC_OFFSET( 17429, glSecondaryColor3bv, _gloffset_SecondaryColor3bvEXT ),
+    NAME_FUNC_OFFSET( 17449, glSecondaryColor3d, _gloffset_SecondaryColor3dEXT ),
+    NAME_FUNC_OFFSET( 17468, glSecondaryColor3dv, _gloffset_SecondaryColor3dvEXT ),
+    NAME_FUNC_OFFSET( 17488, glSecondaryColor3f, _gloffset_SecondaryColor3fEXT ),
+    NAME_FUNC_OFFSET( 17507, glSecondaryColor3fv, _gloffset_SecondaryColor3fvEXT ),
+    NAME_FUNC_OFFSET( 17527, glSecondaryColor3i, _gloffset_SecondaryColor3iEXT ),
+    NAME_FUNC_OFFSET( 17546, glSecondaryColor3iv, _gloffset_SecondaryColor3ivEXT ),
+    NAME_FUNC_OFFSET( 17566, glSecondaryColor3s, _gloffset_SecondaryColor3sEXT ),
+    NAME_FUNC_OFFSET( 17585, glSecondaryColor3sv, _gloffset_SecondaryColor3svEXT ),
+    NAME_FUNC_OFFSET( 17605, glSecondaryColor3ub, _gloffset_SecondaryColor3ubEXT ),
+    NAME_FUNC_OFFSET( 17625, glSecondaryColor3ubv, _gloffset_SecondaryColor3ubvEXT ),
+    NAME_FUNC_OFFSET( 17646, glSecondaryColor3ui, _gloffset_SecondaryColor3uiEXT ),
+    NAME_FUNC_OFFSET( 17666, glSecondaryColor3uiv, _gloffset_SecondaryColor3uivEXT ),
+    NAME_FUNC_OFFSET( 17687, glSecondaryColor3us, _gloffset_SecondaryColor3usEXT ),
+    NAME_FUNC_OFFSET( 17707, glSecondaryColor3usv, _gloffset_SecondaryColor3usvEXT ),
+    NAME_FUNC_OFFSET( 17728, glSecondaryColorPointer, _gloffset_SecondaryColorPointerEXT ),
+    NAME_FUNC_OFFSET( 17752, glBindProgramARB, _gloffset_BindProgramNV ),
+    NAME_FUNC_OFFSET( 17769, glDeleteProgramsARB, _gloffset_DeleteProgramsNV ),
+    NAME_FUNC_OFFSET( 17789, glGenProgramsARB, _gloffset_GenProgramsNV ),
+    NAME_FUNC_OFFSET( 17806, glGetVertexAttribPointervARB, _gloffset_GetVertexAttribPointervNV ),
+    NAME_FUNC_OFFSET( 17835, glIsProgramARB, _gloffset_IsProgramNV ),
+    NAME_FUNC_OFFSET( 17850, glPointParameteri, _gloffset_PointParameteriNV ),
+    NAME_FUNC_OFFSET( 17868, glPointParameteriv, _gloffset_PointParameterivNV ),
+    NAME_FUNC_OFFSET( 17887, glMultiDrawArrays, _gloffset_MultiDrawArraysEXT ),
+    NAME_FUNC_OFFSET( 17905, glMultiDrawElements, _gloffset_MultiDrawElementsEXT ),
+    NAME_FUNC_OFFSET( 17925, glBindBuffer, _gloffset_BindBufferARB ),
+    NAME_FUNC_OFFSET( 17938, glBufferData, _gloffset_BufferDataARB ),
+    NAME_FUNC_OFFSET( 17951, glBufferSubData, _gloffset_BufferSubDataARB ),
+    NAME_FUNC_OFFSET( 17967, glDeleteBuffers, _gloffset_DeleteBuffersARB ),
+    NAME_FUNC_OFFSET( 17983, glGenBuffers, _gloffset_GenBuffersARB ),
+    NAME_FUNC_OFFSET( 17996, glGetBufferParameteriv, _gloffset_GetBufferParameterivARB ),
+    NAME_FUNC_OFFSET( 18019, glGetBufferPointerv, _gloffset_GetBufferPointervARB ),
+    NAME_FUNC_OFFSET( 18039, glGetBufferSubData, _gloffset_GetBufferSubDataARB ),
+    NAME_FUNC_OFFSET( 18058, glIsBuffer, _gloffset_IsBufferARB ),
+    NAME_FUNC_OFFSET( 18069, glMapBuffer, _gloffset_MapBufferARB ),
+    NAME_FUNC_OFFSET( 18081, glUnmapBuffer, _gloffset_UnmapBufferARB ),
+    NAME_FUNC_OFFSET( 18095, glGenQueries, _gloffset_GenQueriesARB ),
+    NAME_FUNC_OFFSET( 18108, glDeleteQueries, _gloffset_DeleteQueriesARB ),
+    NAME_FUNC_OFFSET( 18124, glIsQuery, _gloffset_IsQueryARB ),
+    NAME_FUNC_OFFSET( 18134, glBeginQuery, _gloffset_BeginQueryARB ),
+    NAME_FUNC_OFFSET( 18147, glEndQuery, _gloffset_EndQueryARB ),
+    NAME_FUNC_OFFSET( 18158, glGetQueryiv, _gloffset_GetQueryivARB ),
+    NAME_FUNC_OFFSET( 18171, glGetQueryObjectiv, _gloffset_GetQueryObjectivARB ),
+    NAME_FUNC_OFFSET( 18190, glGetQueryObjectuiv, _gloffset_GetQueryObjectuivARB ),
+    NAME_FUNC_OFFSET( 18210, glBlendEquationSeparateATI, _gloffset_BlendEquationSeparateEXT ),
     NAME_FUNC_OFFSET( -1, NULL, 0 )
 };
 
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 46e33a11d9d..83200d86b4a 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -4467,6 +4467,38 @@ save_ProgramLocalParameter4fvARB(GLenum target, GLuint index,
 }
 
 
+static void GLAPIENTRY
+save_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
+				  const GLfloat *params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+   if (count > 0) {
+      unsigned i;
+      const GLfloat * p = params;
+
+      for (i = 0 ; i < count ; i++) {
+	 n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
+	 if (n) {
+	    n[1].e = target;
+	    n[2].ui = index;
+	    n[3].f = p[0];
+	    n[4].f = p[1];
+	    n[5].f = p[2];
+	    n[6].f = p[3];
+	    p += 4;
+	 }
+      }
+   }
+
+   if (ctx->ExecuteFlag) {
+      CALL_ProgramLocalParameters4fvEXT(ctx->Exec, (target, index, count, params));
+   }
+}
+
+
 static void GLAPIENTRY
 save_ProgramLocalParameter4dARB(GLenum target, GLuint index,
                                 GLdouble x, GLdouble y,
@@ -4669,6 +4701,38 @@ save_ProgramEnvParameter4fvARB(GLenum target, GLuint index,
 }
 
 
+static void GLAPIENTRY
+save_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
+				const GLfloat * params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+
+   if (count > 0) {
+      unsigned i;
+      const GLfloat * p = params;
+
+      for (i = 0 ; i < count ; i++) {
+	 n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
+	 if (n) {
+	    n[1].e = target;
+	    n[2].ui = index;
+	    n[3].f = p[0];
+	    n[4].f = p[1];
+	    n[5].f = p[2];
+	    n[6].f = p[3];
+	    p += 4;
+	 }
+      }
+   }
+
+   if (ctx->ExecuteFlag) {
+      CALL_ProgramEnvParameters4fvEXT(ctx->Exec, (target, index, count, params));
+   }
+}
+
+
 static void GLAPIENTRY
 save_ProgramEnvParameter4dARB(GLenum target, GLuint index,
                               GLdouble x, GLdouble y, GLdouble z, GLdouble w)
@@ -8154,6 +8218,12 @@ _mesa_init_dlist_table(struct _glapi_table *table)
 
    /* 299. GL_EXT_blend_equation_separate */
    SET_BlendEquationSeparateEXT(table, save_BlendEquationSeparateEXT);
+
+   /* GL_EXT_gpu_program_parmaeters */
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+   SET_ProgramEnvParameters4fvEXT(table, save_ProgramEnvParameters4fvEXT);
+   SET_ProgramLocalParameters4fvEXT(table, save_ProgramLocalParameters4fvEXT);
+#endif
 }
 
 
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 151753943a6..5edf9a7dd65 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -94,6 +94,7 @@ static const struct {
    { OFF, "GL_EXT_framebuffer_object",         F(EXT_framebuffer_object) },
    { OFF, "GL_EXT_framebuffer_blit",           F(EXT_framebuffer_blit) },
    { OFF, "GL_EXT_fog_coord",                  F(EXT_fog_coord) },
+   { OFF, "GL_EXT_gpu_program_parameters",     F(EXT_gpu_program_parameters) },
    { OFF, "GL_EXT_histogram",                  F(EXT_histogram) },
    { OFF, "GL_EXT_multi_draw_arrays",          F(EXT_multi_draw_arrays) },
    { OFF, "GL_EXT_packed_depth_stencil",       F(EXT_packed_depth_stencil) },
@@ -284,6 +285,9 @@ _mesa_enable_sw_extensions(GLcontext *ctx)
    ctx->Extensions.SGIX_depth_texture = GL_TRUE;
    ctx->Extensions.SGIX_shadow = GL_TRUE;
    ctx->Extensions.SGIX_shadow_ambient = GL_TRUE;
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+   ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE;
+#endif
 }
 
 
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 49befa262fa..2bb6d93c390 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2450,6 +2450,7 @@ struct gl_extensions
    GLboolean EXT_framebuffer_object;
    GLboolean EXT_fog_coord;
    GLboolean EXT_framebuffer_blit;
+   GLboolean EXT_gpu_program_parameters;
    GLboolean EXT_histogram;
    GLboolean EXT_multi_draw_arrays;
    GLboolean EXT_paletted_texture;
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 0b7214f9dd0..7009db2b332 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -797,6 +797,12 @@ _mesa_init_exec_table(struct _glapi_table *exec)
 #if FEATURE_EXT_framebuffer_blit
    SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT);
 #endif
+
+   /* GL_EXT_gpu_program_parmaeters */
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+   SET_ProgramEnvParameters4fvEXT(exec, _mesa_ProgramEnvParameters4fvEXT);
+   SET_ProgramLocalParameters4fvEXT(exec, _mesa_ProgramLocalParameters4fvEXT);
+#endif
 }
 
 
diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c
index 346263d8668..89f2d20cc9a 100644
--- a/src/mesa/shader/arbprogram.c
+++ b/src/mesa/shader/arbprogram.c
@@ -276,6 +276,50 @@ _mesa_ProgramEnvParameter4fvARB(GLenum target, GLuint index,
 }
 
 
+void GLAPIENTRY
+_mesa_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
+				 const GLfloat *params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   unsigned i;
+   GLfloat * dest;
+   ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+   FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+
+   if (count <= 0) {
+      _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameters4fv(count)");
+   }
+
+   if (target == GL_FRAGMENT_PROGRAM_ARB
+       && ctx->Extensions.ARB_fragment_program) {
+      if ((index + count) > ctx->Const.FragmentProgram.MaxEnvParams) {
+         _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameters4fv(index + count)");
+         return;
+      }
+      dest = ctx->FragmentProgram.Parameters[index];
+   }
+   else if (target == GL_VERTEX_PROGRAM_ARB
+       && ctx->Extensions.ARB_vertex_program) {
+      if ((index + count) > ctx->Const.VertexProgram.MaxEnvParams) {
+         _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameters4fv(index + count)");
+         return;
+      }
+      dest = ctx->VertexProgram.Parameters[index];
+   }
+   else {
+      _mesa_error(ctx, GL_INVALID_ENUM, "glProgramEnvParameters4fv(target)");
+      return;
+   }
+
+   for ( i = 0 ; i < count ; i++ ) {
+      COPY_4V(dest, params);
+      params += 4;
+      dest += 4;
+   }
+}
+
+
 void GLAPIENTRY
 _mesa_GetProgramEnvParameterdvARB(GLenum target, GLuint index,
                                   GLdouble *params)
@@ -383,6 +427,50 @@ _mesa_ProgramLocalParameter4fvARB(GLenum target, GLuint index,
 }
 
 
+void GLAPIENTRY
+_mesa_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
+				   const GLfloat *params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_program *prog;
+   unsigned i;
+   ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+   FLUSH_VERTICES(ctx, _NEW_PROGRAM);
+
+   if (count <= 0) {
+      _mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameters4fv(count)");
+   }
+
+   if (target == GL_FRAGMENT_PROGRAM_ARB
+       && ctx->Extensions.ARB_fragment_program) {
+      if ((index + count) > ctx->Const.FragmentProgram.MaxLocalParams) {
+         _mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameters4fvEXT(index + count)");
+         return;
+      }
+      prog = &(ctx->FragmentProgram.Current->Base);
+   }
+   else if (target == GL_VERTEX_PROGRAM_ARB
+            && ctx->Extensions.ARB_vertex_program) {
+      if ((index + count) > ctx->Const.VertexProgram.MaxLocalParams) {
+         _mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameters4fvEXT(index + count)");
+         return;
+      }
+      prog = &(ctx->VertexProgram.Current->Base);
+   }
+   else {
+      _mesa_error(ctx, GL_INVALID_ENUM, "glProgramLocalParameters4fvEXT(target)");
+      return;
+   }
+
+   for (i = 0; i < count; i++) {
+      ASSERT((index + i) < MAX_PROGRAM_LOCAL_PARAMS);
+      COPY_4V(prog->LocalParams[index + i], params);
+      params += 4;
+   }
+}
+
+
 /**
  * Note, this function is also used by the GL_NV_fragment_program extension.
  */
diff --git a/src/mesa/shader/arbprogram.h b/src/mesa/shader/arbprogram.h
index e1b99ab686f..54a14bbb9f8 100644
--- a/src/mesa/shader/arbprogram.h
+++ b/src/mesa/shader/arbprogram.h
@@ -76,6 +76,11 @@ _mesa_ProgramEnvParameter4fvARB(GLenum target, GLuint index,
                                 const GLfloat *params);
 
 
+extern void GLAPIENTRY
+_mesa_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
+				 const GLfloat *params);
+
+
 extern void GLAPIENTRY
 _mesa_ProgramLocalParameter4dARB(GLenum target, GLuint index,
                                  GLdouble x, GLdouble y,
@@ -97,6 +102,11 @@ _mesa_ProgramLocalParameter4fvARB(GLenum target, GLuint index,
                                   const GLfloat *params);
 
 
+extern void GLAPIENTRY
+_mesa_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
+				   const GLfloat *params);
+
+
 extern void GLAPIENTRY
 _mesa_GetProgramEnvParameterdvARB(GLenum target, GLuint index,
                                   GLdouble *params);
diff --git a/src/mesa/sparc/glapi_sparc.S b/src/mesa/sparc/glapi_sparc.S
index b947ec2250d..864c650700c 100644
--- a/src/mesa/sparc/glapi_sparc.S
+++ b/src/mesa/sparc/glapi_sparc.S
@@ -888,6 +888,8 @@ __glapi_sparc_icache_flush: /* %o0 = insn_addr */
 		.globl glDeleteVertexArraysAPPLE ; .type glDeleteVertexArraysAPPLE,#function
 		.globl glGenVertexArraysAPPLE ; .type glGenVertexArraysAPPLE,#function
 		.globl glIsVertexArrayAPPLE ; .type glIsVertexArrayAPPLE,#function
+		.globl glProgramEnvParameters4fvEXT ; .type glProgramEnvParameters4fvEXT,#function
+		.globl glProgramLocalParameters4fvEXT ; .type glProgramLocalParameters4fvEXT,#function
 		.globl _mesa_sparc_glapi_begin ; .type _mesa_sparc_glapi_begin,#function
 _mesa_sparc_glapi_begin:
 
@@ -1714,6 +1716,8 @@ _mesa_sparc_glapi_begin:
 	GL_STUB(glDeleteVertexArraysAPPLE, _gloffset_DeleteVertexArraysAPPLE)
 	GL_STUB(glGenVertexArraysAPPLE, _gloffset_GenVertexArraysAPPLE)
 	GL_STUB(glIsVertexArrayAPPLE, _gloffset_IsVertexArrayAPPLE)
+	GL_STUB(glProgramEnvParameters4fvEXT, _gloffset_ProgramEnvParameters4fvEXT)
+	GL_STUB(glProgramLocalParameters4fvEXT, _gloffset_ProgramLocalParameters4fvEXT)
 
 		.globl _mesa_sparc_glapi_end ; .type _mesa_sparc_glapi_end,#function
 _mesa_sparc_glapi_end:
diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S
index d0ecb086025..39896eb2b96 100644
--- a/src/mesa/x86-64/glapi_x86-64.S
+++ b/src/mesa/x86-64/glapi_x86-64.S
@@ -31068,6 +31068,96 @@ GL_PREFIX(IsVertexArrayAPPLE):
 #endif /* defined(GLX_USE_TLS) */
 	.size	GL_PREFIX(IsVertexArrayAPPLE), .-GL_PREFIX(IsVertexArrayAPPLE)
 
+	.p2align	4,,15
+	.globl	GL_PREFIX(ProgramEnvParameters4fvEXT)
+	.type	GL_PREFIX(ProgramEnvParameters4fvEXT), @function
+GL_PREFIX(ProgramEnvParameters4fvEXT):
+#if defined(GLX_USE_TLS)
+	call	_x86_64_get_dispatch@PLT
+	movq	6584(%rax), %r11
+	jmp	*%r11
+#elif defined(PTHREADS)
+	pushq	%rdi
+	pushq	%rsi
+	pushq	%rdx
+	pushq	%rcx
+	pushq	%rbp
+	call	_x86_64_get_dispatch@PLT
+	popq	%rbp
+	popq	%rcx
+	popq	%rdx
+	popq	%rsi
+	popq	%rdi
+	movq	6584(%rax), %r11
+	jmp	*%r11
+#else
+	movq	_glapi_Dispatch(%rip), %rax
+	testq	%rax, %rax
+	je	1f
+	movq	6584(%rax), %r11
+	jmp	*%r11
+1:
+	pushq	%rdi
+	pushq	%rsi
+	pushq	%rdx
+	pushq	%rcx
+	pushq	%rbp
+	call	_glapi_get_dispatch
+	popq	%rbp
+	popq	%rcx
+	popq	%rdx
+	popq	%rsi
+	popq	%rdi
+	movq	6584(%rax), %r11
+	jmp	*%r11
+#endif /* defined(GLX_USE_TLS) */
+	.size	GL_PREFIX(ProgramEnvParameters4fvEXT), .-GL_PREFIX(ProgramEnvParameters4fvEXT)
+
+	.p2align	4,,15
+	.globl	GL_PREFIX(ProgramLocalParameters4fvEXT)
+	.type	GL_PREFIX(ProgramLocalParameters4fvEXT), @function
+GL_PREFIX(ProgramLocalParameters4fvEXT):
+#if defined(GLX_USE_TLS)
+	call	_x86_64_get_dispatch@PLT
+	movq	6592(%rax), %r11
+	jmp	*%r11
+#elif defined(PTHREADS)
+	pushq	%rdi
+	pushq	%rsi
+	pushq	%rdx
+	pushq	%rcx
+	pushq	%rbp
+	call	_x86_64_get_dispatch@PLT
+	popq	%rbp
+	popq	%rcx
+	popq	%rdx
+	popq	%rsi
+	popq	%rdi
+	movq	6592(%rax), %r11
+	jmp	*%r11
+#else
+	movq	_glapi_Dispatch(%rip), %rax
+	testq	%rax, %rax
+	je	1f
+	movq	6592(%rax), %r11
+	jmp	*%r11
+1:
+	pushq	%rdi
+	pushq	%rsi
+	pushq	%rdx
+	pushq	%rcx
+	pushq	%rbp
+	call	_glapi_get_dispatch
+	popq	%rbp
+	popq	%rcx
+	popq	%rdx
+	popq	%rsi
+	popq	%rdi
+	movq	6592(%rax), %r11
+	jmp	*%r11
+#endif /* defined(GLX_USE_TLS) */
+	.size	GL_PREFIX(ProgramLocalParameters4fvEXT), .-GL_PREFIX(ProgramLocalParameters4fvEXT)
+
 	.globl GL_PREFIX(ArrayElementEXT) ; .set GL_PREFIX(ArrayElementEXT), GL_PREFIX(ArrayElement)
 	.globl GL_PREFIX(BindTextureEXT) ; .set GL_PREFIX(BindTextureEXT), GL_PREFIX(BindTexture)
 	.globl GL_PREFIX(DrawArraysEXT) ; .set GL_PREFIX(DrawArraysEXT), GL_PREFIX(DrawArrays)
diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S
index 3c44749d256..85d691acb4e 100644
--- a/src/mesa/x86/glapi_x86.S
+++ b/src/mesa/x86/glapi_x86.S
@@ -964,6 +964,8 @@ GLNAME(gl_dispatch_functions_start):
 	GL_STUB(DeleteVertexArraysAPPLE, _gloffset_DeleteVertexArraysAPPLE, DeleteVertexArraysAPPLE@8)
 	GL_STUB(GenVertexArraysAPPLE, _gloffset_GenVertexArraysAPPLE, GenVertexArraysAPPLE@8)
 	GL_STUB(IsVertexArrayAPPLE, _gloffset_IsVertexArrayAPPLE, IsVertexArrayAPPLE@4)
+	GL_STUB(ProgramEnvParameters4fvEXT, _gloffset_ProgramEnvParameters4fvEXT, ProgramEnvParameters4fvEXT@16)
+	GL_STUB(ProgramLocalParameters4fvEXT, _gloffset_ProgramLocalParameters4fvEXT, ProgramLocalParameters4fvEXT@16)
 	GL_STUB_ALIAS(ArrayElementEXT, _gloffset_ArrayElement, ArrayElementEXT@4, ArrayElement, ArrayElement@4)
 	GL_STUB_ALIAS(BindTextureEXT, _gloffset_BindTexture, BindTextureEXT@8, BindTexture, BindTexture@8)
 	GL_STUB_ALIAS(DrawArraysEXT, _gloffset_DrawArrays, DrawArraysEXT@12, DrawArrays, DrawArrays@12)
-- 
cgit v1.2.3


From 3cd07d2c390099ca0f9b2e27a548920f880715c4 Mon Sep 17 00:00:00 2001
From: Brian Paul 
Date: Wed, 30 Aug 2006 23:46:41 +0000
Subject: latest version from OpenGL ARB

---
 include/GL/glext.h  | 206 ++++++++++++++++++++++++++++++++++++++++++++++++++--
 include/GL/glxext.h |  53 +++++++++++---
 2 files changed, 243 insertions(+), 16 deletions(-)

(limited to 'include')

diff --git a/include/GL/glext.h b/include/GL/glext.h
index 78fca0be1bb..c5111b895c8 100644
--- a/include/GL/glext.h
+++ b/include/GL/glext.h
@@ -52,9 +52,9 @@ extern "C" {
 /*************************************************************/
 
 /* Header file version number, required by OpenGL ABI for Linux */
-/* glext.h last updated 2005/06/20 */
-/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
-#define GL_GLEXT_VERSION 29
+/* glext.h last updated 2006/08/30 */
+/* Current version at http://www.opengl.org/registry/ */
+#define GL_GLEXT_VERSION 34
 
 #ifndef GL_VERSION_1_2
 #define GL_UNSIGNED_BYTE_3_3_2            0x8032
@@ -459,6 +459,32 @@ extern "C" {
 #define GL_STENCIL_BACK_WRITEMASK         0x8CA5
 #endif
 
+#ifndef GL_VERSION_2_1
+#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
+#define GL_PIXEL_PACK_BUFFER              0x88EB
+#define GL_PIXEL_UNPACK_BUFFER            0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING      0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING    0x88EF
+#define GL_FLOAT_MAT2x3                   0x8B65
+#define GL_FLOAT_MAT2x4                   0x8B66
+#define GL_FLOAT_MAT3x2                   0x8B67
+#define GL_FLOAT_MAT3x4                   0x8B68
+#define GL_FLOAT_MAT4x2                   0x8B69
+#define GL_FLOAT_MAT4x3                   0x8B6A
+#define GL_SRGB                           0x8C40
+#define GL_SRGB8                          0x8C41
+#define GL_SRGB_ALPHA                     0x8C42
+#define GL_SRGB8_ALPHA8                   0x8C43
+#define GL_SLUMINANCE_ALPHA               0x8C44
+#define GL_SLUMINANCE8_ALPHA8             0x8C45
+#define GL_SLUMINANCE                     0x8C46
+#define GL_SLUMINANCE8                    0x8C47
+#define GL_COMPRESSED_SRGB                0x8C48
+#define GL_COMPRESSED_SRGB_ALPHA          0x8C49
+#define GL_COMPRESSED_SLUMINANCE          0x8C4A
+#define GL_COMPRESSED_SLUMINANCE_ALPHA    0x8C4B
+#endif
+
 #ifndef GL_ARB_multitexture
 #define GL_TEXTURE0_ARB                   0x84C0
 #define GL_TEXTURE1_ARB                   0x84C1
@@ -3038,6 +3064,64 @@ extern "C" {
 #ifndef GL_GREMEDY_string_marker
 #endif
 
+#ifndef GL_EXT_packed_depth_stencil
+#define GL_DEPTH_STENCIL_EXT              0x84F9
+#define GL_UNSIGNED_INT_24_8_EXT          0x84FA
+#define GL_DEPTH24_STENCIL8_EXT           0x88F0
+#define GL_TEXTURE_STENCIL_SIZE_EXT       0x88F1
+#endif
+
+#ifndef GL_EXT_stencil_clear_tag
+#define GL_STENCIL_TAG_BITS_EXT           0x88F2
+#define GL_STENCIL_CLEAR_TAG_VALUE_EXT    0x88F3
+#endif
+
+#ifndef GL_EXT_texture_sRGB
+#define GL_SRGB_EXT                       0x8C40
+#define GL_SRGB8_EXT                      0x8C41
+#define GL_SRGB_ALPHA_EXT                 0x8C42
+#define GL_SRGB8_ALPHA8_EXT               0x8C43
+#define GL_SLUMINANCE_ALPHA_EXT           0x8C44
+#define GL_SLUMINANCE8_ALPHA8_EXT         0x8C45
+#define GL_SLUMINANCE_EXT                 0x8C46
+#define GL_SLUMINANCE8_EXT                0x8C47
+#define GL_COMPRESSED_SRGB_EXT            0x8C48
+#define GL_COMPRESSED_SRGB_ALPHA_EXT      0x8C49
+#define GL_COMPRESSED_SLUMINANCE_EXT      0x8C4A
+#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B
+#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT  0x8C4C
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
+#endif
+
+#ifndef GL_EXT_framebuffer_blit
+#define GL_READ_FRAMEBUFFER_EXT           0x8CA8
+#define GL_DRAW_FRAMEBUFFER_EXT           0x8CA9
+#define GL_READ_FRAMEBUFFER_BINDING_EXT   GL_FRAMEBUFFER_BINDING_EXT
+#define GL_DRAW_FRAMEBUFFER_BINDING_EXT   0x8CAA
+#endif
+
+#ifndef GL_EXT_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_EXT       0x8CAB
+#endif
+
+#ifndef GL_MESAX_texture_stack
+#define GL_TEXTURE_1D_STACK_MESAX         0x8759
+#define GL_TEXTURE_2D_STACK_MESAX         0x875A
+#define GL_PROXY_TEXTURE_1D_STACK_MESAX   0x875B
+#define GL_PROXY_TEXTURE_2D_STACK_MESAX   0x875C
+#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D
+#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E
+#endif
+
+#ifndef GL_EXT_timer_query
+#define GL_TIME_ELAPSED_EXT               0x88BF
+#endif
+
+#ifndef GL_EXT_gpu_program_parameters
+#endif
+
 
 /*************************************************************/
 
@@ -3074,6 +3158,44 @@ typedef unsigned short GLhalfARB;
 typedef unsigned short GLhalfNV;
 #endif
 
+#ifndef GLEXT_64_TYPES_DEFINED
+/* This code block is duplicated in glext.h, so must be protected */
+#define GLEXT_64_TYPES_DEFINED
+/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
+/* (as used in the GLX_OML_sync_control extension). */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#include 
+#elif defined(__sun__)
+#include 
+#if defined(__STDC__)
+#if defined(__arch64__)
+typedef long int int64_t;
+typedef unsigned long int uint64_t;
+#else
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#endif /* __arch64__ */
+#endif /* __STDC__ */
+#elif defined( __VMS )
+#include 
+#elif defined(__SCO__) || defined(__USLC__)
+#include 
+#elif defined(__UNIXOS2__) || defined(__SOL64__)
+typedef long int int32_t;
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#elif defined(WIN32) && defined(__GNUC__)
+#include 
+#else
+#include      /* Fallback option */
+#endif
+#endif
+
+#ifndef GL_EXT_timer_query
+typedef int64_t GLint64EXT;
+typedef uint64_t GLuint64EXT;
+#endif
+
 #ifndef GL_VERSION_1_2
 #define GL_VERSION_1_2 1
 #ifdef GL_GLEXT_PROTOTYPES
@@ -3586,6 +3708,24 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort
 typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
 #endif
 
+#ifndef GL_VERSION_2_1
+#define GL_VERSION_2_1 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniformMatrix2x3fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3x2fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix2x4fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4x2fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3x4fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4x3fv (GLint, GLsizei, GLboolean, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#endif
+
 #ifndef GL_ARB_multitexture
 #define GL_ARB_multitexture 1
 #ifdef GL_GLEXT_PROTOTYPES
@@ -4293,8 +4433,8 @@ typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum f
 typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
 #endif
 
-#ifndef GL_EXT_color_matrix
-#define GL_EXT_color_matrix 1
+#ifndef GL_SGI_color_matrix
+#define GL_SGI_color_matrix 1
 #endif
 
 #ifndef GL_SGI_color_table
@@ -6487,6 +6627,62 @@ GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *);
 typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
 #endif
 
+#ifndef GL_EXT_packed_depth_stencil
+#define GL_EXT_packed_depth_stencil 1
+#endif
+
+#ifndef GL_EXT_stencil_clear_tag
+#define GL_EXT_stencil_clear_tag 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStencilClearTagEXT (GLsizei, GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag);
+#endif
+
+#ifndef GL_EXT_texture_sRGB
+#define GL_EXT_texture_sRGB 1
+#endif
+
+#ifndef GL_EXT_framebuffer_blit
+#define GL_EXT_framebuffer_blit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlitFramebufferEXT (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+
+#ifndef GL_EXT_framebuffer_multisample
+#define GL_EXT_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_MESAX_texture_stack
+#define GL_MESAX_texture_stack 1
+#endif
+
+#ifndef GL_EXT_timer_query
+#define GL_EXT_timer_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint, GLenum, GLint64EXT *);
+GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint, GLenum, GLuint64EXT *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);
+#endif
+
+#ifndef GL_EXT_gpu_program_parameters
+#define GL_EXT_gpu_program_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+#endif
+
 
 #ifdef __cplusplus
 }
diff --git a/include/GL/glxext.h b/include/GL/glxext.h
index fa58593e318..662d4a1aeb4 100644
--- a/include/GL/glxext.h
+++ b/include/GL/glxext.h
@@ -52,9 +52,9 @@ extern "C" {
 /*************************************************************/
 
 /* Header file version number, required by OpenGL ABI for Linux */
-/* glxext.h last updated 2004/07/26 */
-/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
-#define GLX_GLXEXT_VERSION 6
+/* glxext.h last updated 2006/08/30 */
+/* Current version at http://www.opengl.org/registry/ */
+#define GLX_GLXEXT_VERSION 14
 
 #ifndef GLX_VERSION_1_3
 #define GLX_WINDOW_BIT                     0x00000001
@@ -128,6 +128,11 @@ extern "C" {
 #define GLX_SAMPLES_ARB                    100001
 #endif
 
+#ifndef GLX_ARB_fbconfig_float
+#define GLX_RGBA_FLOAT_TYPE_ARB            0x20B9
+#define GLX_RGBA_FLOAT_BIT_ARB             0x00000004
+#endif
+
 #ifndef GLX_SGIS_multisample
 #define GLX_SAMPLE_BUFFERS_SGIS            100000
 #define GLX_SAMPLES_SGIS                   100001
@@ -282,7 +287,11 @@ extern "C" {
 #ifndef GLX_OML_sync_control
 #endif
 
-#ifndef GLX_SGIX_hyperpipe_group
+#ifndef GLX_NV_float_buffer
+#define GLX_FLOAT_COMPONENTS_NV            0x20B0
+#endif
+
+#ifndef GLX_SGIX_hyperpipe
 #define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
 #define GLX_BAD_HYPERPIPE_CONFIG_SGIX      91
 #define GLX_BAD_HYPERPIPE_SGIX             92
@@ -331,24 +340,37 @@ typedef struct {
 } GLXBufferClobberEventSGIX;
 #endif
 
-#if defined(__sun__) || defined(__osf__)
+#ifndef GLEXT_64_TYPES_DEFINED
+/* This code block is duplicated in glxext.h, so must be protected */
+#define GLEXT_64_TYPES_DEFINED
+/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
+/* (as used in the GLX_OML_sync_control extension). */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#include 
+#elif defined(__sun__)
 #include 
 #if defined(__STDC__)
 #if defined(__arch64__)
 typedef long int int64_t;
+typedef unsigned long int uint64_t;
 #else
-typedef long long int int64_t;   
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
 #endif /* __arch64__ */
 #endif /* __STDC__ */
-#elif defined(__UNIXOS2__) || defined(__SOL64__)
-typedef long int int32_t;
-typedef long long int int64_t;
 #elif defined( __VMS )
 #include 
 #elif defined(__SCO__) || defined(__USLC__)
 #include 
+#elif defined(__UNIXOS2__) || defined(__SOL64__)
+typedef long int int32_t;
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
 #elif defined(WIN32) && defined(__GNUC__)
 #include 
+#else
+#include      /* Fallback option */
+#endif
 #endif
 
 #ifndef GLX_VERSION_1_3
@@ -413,6 +435,10 @@ typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procNam
 #define GLX_ARB_multisample 1
 #endif
 
+#ifndef GLX_ARB_fbconfig_float
+#define GLX_ARB_fbconfig_float 1
+#endif
+
 #ifndef GLX_SGIS_multisample
 #define GLX_SGIS_multisample 1
 #endif
@@ -631,8 +657,12 @@ typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, i
 typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
 #endif
 
-#ifndef GLX_SGIX_hyperpipe_group
-#define GLX_SGIX_hyperpipe_group 1
+#ifndef GLX_NV_float_buffer
+#define GLX_NV_float_buffer 1
+#endif
+
+#ifndef GLX_SGIX_hyperpipe
+#define GLX_SGIX_hyperpipe 1
 
 typedef struct {
     char    pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
@@ -686,6 +716,7 @@ extern unsigned int glXGetAGPOffsetMESA (const void *);
 typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
 #endif
 
+
 #ifdef __cplusplus
 }
 #endif
-- 
cgit v1.2.3


From 7986cfbee019fbdfce8bb0a86d7b7e633e541014 Mon Sep 17 00:00:00 2001
From: Brian Paul 
Date: Wed, 30 Aug 2006 23:50:31 +0000
Subject: remove extension defines/protos that are now in glext.h

---
 include/GL/gl.h | 101 --------------------------------------------------------
 1 file changed, 101 deletions(-)

(limited to 'include')

diff --git a/include/GL/gl.h b/include/GL/gl.h
index 40f3b9da777..6d706d67298 100644
--- a/include/GL/gl.h
+++ b/include/GL/gl.h
@@ -2252,107 +2252,6 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen
 
 
 
-#ifndef GL_EXT_timer_query
-#define GL_EXT_timer_query 1
-
-/* Define 64-bit types */
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-   typedef long long int GLint64EXT;
-   typedef unsigned long long int GLuint64EXT;
-#elif defined(_WIN32)
-   typedef __int64 GLint64EXT;
-   typedef unsigned __int64 GLuint64EXT;
-#else
-   /* this might actually be a 32-bit type */
-   typedef long int GLint64EXT;
-   typedef unsigned long int GLuint64EXT;
-#endif
-
-#define GL_TIME_ELAPSED_EXT  0x88BF
-
-GLAPI void GLAPIENTRY glGetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params);
-GLAPI void GLAPIENTRY glGetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params);
-
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);
-typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);
-
-#endif /* GL_EXT_timer_query */
-
-
-
-#ifndef GL_EXT_framebuffer_blit
-#define GL_EXT_framebuffer_blit 1
-
-#define GL_READ_FRAMEBUFFER_EXT                0x8CA8
-#define GL_DRAW_FRAMEBUFFER_EXT                0x8CA9
-#define GL_DRAW_FRAMEBUFFER_BINDING_EXT        0x8CA6
-#define GL_READ_FRAMEBUFFER_BINDING_EXT        0x8CAA
-
-GLAPI void GLAPIENTRY glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
-                     GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
-                     GLbitfield mask, GLenum filter);
-
-typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC)
-        (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
-         GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
-         GLbitfield mask, GLenum filter);
-
-#endif /* GL_EXT_framebuffer_blit */
-
-
-
-#ifndef GL_EXT_packed_depth_stencil
-#define GL_EXT_packed_depth_stencil 1
-
-#define GL_DEPTH_STENCIL_EXT          0x84F9
-#define GL_UNSIGNED_INT_24_8_EXT      0x84FA
-#define GL_DEPTH24_STENCIL8_EXT       0x88F0
-#define GL_TEXTURE_STENCIL_SIZE_EXT   0x88F1
-
-#endif /* GL_EXT_packed_depth_stencil */
-
-
-#ifndef GL_EXT_gpu_program_parameters
-#define GL_EXT_gpu_program_parameters 1
-
-GLAPI void GLAPIENTRY glProgramEnvParameters4fvEXT(GLenum target,
-    GLuint index, GLsizei count, const GLfloat *params); 
-
-GLAPI void GLAPIENTRY glProgramLocalParameters4fvEXT(GLenum target,
-    GLuint index, GLsizei count, const GLfloat *params); 
-
-typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)
-       (GLenum target, GLuint index, GLsizei count, const GLfloat *params); 
-
-typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)
-       (GLenum target, GLuint index, GLsizei count, const GLfloat *params); 
-
-#endif /* GL_EXT_gpu_program_parameters */
-
-
-#ifndef GL_EXT_texture_sRGB
-#define GL_EXT_texture_sRGB 1
-
-#define GL_SRGB_EXT                                       0x8C40
-#define GL_SRGB8_EXT                                      0x8C41
-#define GL_SRGB_ALPHA_EXT                                 0x8C42
-#define GL_SRGB8_ALPHA8_EXT                               0x8C43
-#define GL_SLUMINANCE_ALPHA_EXT                           0x8C44
-#define GL_SLUMINANCE8_ALPHA8_EXT                         0x8C45
-#define GL_SLUMINANCE_EXT                                 0x8C46
-#define GL_SLUMINANCE8_EXT                                0x8C47
-#define GL_COMPRESSED_SRGB_EXT                            0x8C48
-#define GL_COMPRESSED_SRGB_ALPHA_EXT                      0x8C49
-#define GL_COMPRESSED_SLUMINANCE_EXT                      0x8C4A
-#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT                0x8C4B
-#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT                  0x8C4C
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT            0x8C4D
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT            0x8C4E
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT            0x8C4F
-
-#endif /* GL_EXT_texture_sRGB */
-
-
 /**
  ** NOTE!!!!!  If you add new functions to this file, or update
  ** glext.h be sure to regenerate the gl_mangle.h file.  See comments
-- 
cgit v1.2.3


From 8cf3c85fd7896be396ff5aa84829a4e74a0935cb Mon Sep 17 00:00:00 2001
From: Jouk Jansen 
Date: Mon, 4 Sep 2006 06:22:39 +0000
Subject:    OpenVMS compile support update

 Modified Files:
 	Mesa/include/GL/vms_x_fix.h
---
 include/GL/vms_x_fix.h | 1 +
 1 file changed, 1 insertion(+)

(limited to 'include')

diff --git a/include/GL/vms_x_fix.h b/include/GL/vms_x_fix.h
index db754f65563..d31b421bb34 100644
--- a/include/GL/vms_x_fix.h
+++ b/include/GL/vms_x_fix.h
@@ -8,6 +8,7 @@
  *                                                                         *
  ***************************************************************************/
 
+
 #ifndef VMS_X_FIX
 #define VMS_X_FIX
 
-- 
cgit v1.2.3


From e08557ad8ad165c72088d83d43c44d62e380e5de Mon Sep 17 00:00:00 2001
From: Jouk Jansen 
Date: Mon, 4 Sep 2006 06:26:08 +0000
Subject:  OpenVMS compile support update  (previous commit did send the wrong
 file to the CVS)

 Modified Files:
 	Mesa/include/GL/vms_x_fix.h
---
 include/GL/vms_x_fix.h | 763 +++++++++++++++++++++++++++++++++++--------------
 1 file changed, 553 insertions(+), 210 deletions(-)

(limited to 'include')

diff --git a/include/GL/vms_x_fix.h b/include/GL/vms_x_fix.h
index d31b421bb34..24cba473d84 100644
--- a/include/GL/vms_x_fix.h
+++ b/include/GL/vms_x_fix.h
@@ -1,34 +1,51 @@
 /***************************************************************************
  *                                                                         *
- * Repair definitions of Xlib when compileing with /name=(as_is) on VMS    *
+ * Author : Jouk Jansen (joukj@hrem.nano.tudelft.nl)                       *
  *                                                                         *
- * Author : Jouk Jansen (joukj@hrem.stm.tudelft.nl)                        *
+ * Last revision : 31 August 2006                                          *
  *                                                                         *
- * Last revision : 22 August 2000                                          *
+ * Repair definitions of Runtime library functions when compiling with     *
+ * /name=(as_is) on OpenVMS                                                *
  *                                                                         *
  ***************************************************************************/
 
-
 #ifndef VMS_X_FIX
 #define VMS_X_FIX
 
-#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE 
+#define decw$_select DECW$_SELECT
+#define DtSaverGetWindows DTSAVERGETWINDOWS
+#define MrmFetchWidget MRMFETCHWIDGET
+#define MrmInitialize MRMINITIALIZE
+#define MrmOpenHierarchy MRMOPENHIERARCHY
+#define MrmRegisterNames MRMREGISTERNAMES
+#define XAddExtension XADDEXTENSION
+#define XAddHosts XADDHOSTS
 #define XAllocClassHint XALLOCCLASSHINT
 #define XAllocColor XALLOCCOLOR
 #define XAllocColorCells XALLOCCOLORCELLS
+#define XAllocIconSize XALLOCICONSIZE
+#define XAllocNamedColor XALLOCNAMEDCOLOR
 #define XAllocSizeHints XALLOCSIZEHINTS
+#define XAllocStandardColormap XALLOCSTANDARDCOLORMAP
 #define XAllocWMHints XALLOCWMHINTS
+#define XAllowEvents XALLOWEVENTS
 #define XAutoRepeatOff XAUTOREPEATOFF
 #define XAutoRepeatOn XAUTOREPEATON
 #define XBaseFontNameListOfFontSet XBASEFONTNAMELISTOFFONTSET
 #define XBell XBELL
 #define XBitmapPad XBITMAPPAD
+#define XBlackPixel XBLACKPIXEL
+#define XBlackPixelOfScreen XBLACKPIXELOFSCREEN
+#define XCellsOfScreen XCELLSOFSCREEN
 #define XChangeActivePointerGrab XCHANGEACTIVEPOINTERGRAB
 #define XChangeGC XCHANGEGC
+#define XChangeKeyboardControl XCHANGEKEYBOARDCONTROL
+#define XChangePointerControl XCHANGEPOINTERCONTROL
 #define XChangeProperty XCHANGEPROPERTY
 #define XChangeWindowAttributes XCHANGEWINDOWATTRIBUTES
 #define XCheckIfEvent XCHECKIFEVENT
 #define XCheckMaskEvent XCHECKMASKEVENT
+#define XCheckTypedEvent XCHECKTYPEDEVENT
 #define XCheckTypedWindowEvent XCHECKTYPEDWINDOWEVENT
 #define XCheckWindowEvent XCHECKWINDOWEVENT
 #define XClearArea XCLEARAREA
@@ -39,6 +56,7 @@
 #define XConfigureWindow XCONFIGUREWINDOW
 #define XConvertSelection XCONVERTSELECTION
 #define XCopyArea XCOPYAREA
+#define XCopyColormapAndFree XCOPYCOLORMAPANDFREE
 #define XCopyGC XCOPYGC
 #define XCopyPlane XCOPYPLANE
 #define XCreateBitmapFromData XCREATEBITMAPFROMDATA
@@ -46,6 +64,7 @@
 #define XCreateFontCursor XCREATEFONTCURSOR
 #define XCreateFontSet XCREATEFONTSET
 #define XCreateGC XCREATEGC
+#define XCreateGlyphCursor XCREATEGLYPHCURSOR
 #define XCreateIC XCREATEIC
 #define XCreateImage XCREATEIMAGE
 #define XCreatePixmap XCREATEPIXMAP
@@ -54,15 +73,35 @@
 #define XCreateRegion XCREATEREGION
 #define XCreateSimpleWindow XCREATESIMPLEWINDOW
 #define XCreateWindow XCREATEWINDOW
+#define XDefaultColormap XDEFAULTCOLORMAP
+#define XDefaultColormapOfScreen XDEFAULTCOLORMAPOFSCREEN
+#define XDefaultDepth XDEFAULTDEPTH
+#define XDefaultDepthOfScreen XDEFAULTDEPTHOFSCREEN
+#define XDefaultGC XDEFAULTGC
+#define XDefaultRootWindow XDEFAULTROOTWINDOW
+#define XDefaultScreen XDEFAULTSCREEN
 #define XDefaultScreenOfDisplay XDEFAULTSCREENOFDISPLAY
+#define XDefaultVisual XDEFAULTVISUAL
+#define XDefaultVisualOfScreen XDEFAULTVISUALOFSCREEN
 #define XDefineCursor XDEFINECURSOR
+#define XDeleteContext XDELETECONTEXT
 #define XDeleteProperty XDELETEPROPERTY
 #define XDestroyIC XDESTROYIC
 #define XDestroyRegion XDESTROYREGION
+#define XDestroySubwindows XDESTROYSUBWINDOWS
 #define XDestroyWindow XDESTROYWINDOW
+#define XDisableAccessControl XDISABLEACCESSCONTROL
+#define XDisplayCells XDISPLAYCELLS
+#define XDisplayHeight XDISPLAYHEIGHT
+#define XDisplayKeycodes XDISPLAYKEYCODES
 #define XDisplayName XDISPLAYNAME
+#define XDisplayOfIM XDISPLAYOFIM
 #define XDisplayOfScreen XDISPLAYOFSCREEN
+#define XDisplayString XDISPLAYSTRING
+#define XDisplayWidth XDISPLAYWIDTH
+#define XDoesBackingStore XDOESBACKINGSTORE
 #define XDrawArc XDRAWARC
+#define XDrawArcs XDRAWARCS
 #define XDrawImageString XDRAWIMAGESTRING
 #define XDrawImageString16 XDRAWIMAGESTRING16
 #define XDrawLine XDRAWLINE
@@ -70,24 +109,38 @@
 #define XDrawPoint XDRAWPOINT
 #define XDrawPoints XDRAWPOINTS
 #define XDrawRectangle XDRAWRECTANGLE
+#define XDrawRectangles XDRAWRECTANGLES
 #define XDrawSegments XDRAWSEGMENTS
 #define XDrawString XDRAWSTRING
 #define XDrawString16 XDRAWSTRING16
+#define XDrawText XDRAWTEXT
+#define XDrawText16 XDRAWTEXT16
+#define XESetCloseDisplay XESETCLOSEDISPLAY
 #define XEmptyRegion XEMPTYREGION
+#define XEnableAccessControl XENABLEACCESSCONTROL
 #define XEqualRegion XEQUALREGION
 #define XEventsQueued XEVENTSQUEUED
+#define XExtendedMaxRequestSize XEXTENDEDMAXREQUESTSIZE
 #define XExtentsOfFontSet XEXTENTSOFFONTSET
+#define XFetchBuffer XFETCHBUFFER
+#define XFetchBytes XFETCHBYTES
+#define XFetchName XFETCHNAME
 #define XFillArc XFILLARC
+#define XFillArcs XFILLARCS
 #define XFillPolygon XFILLPOLYGON
 #define XFillRectangle XFILLRECTANGLE
 #define XFillRectangles XFILLRECTANGLES
 #define XFilterEvent XFILTEREVENT
+#define XFindContext XFINDCONTEXT
 #define XFlush XFLUSH
 #define XFontsOfFontSet XFONTSOFFONTSET
+#define XForceScreenSaver XFORCESCREENSAVER
 #define XFree XFREE
 #define XFreeColormap XFREECOLORMAP
 #define XFreeColors XFREECOLORS
 #define XFreeCursor XFREECURSOR
+#define XFreeDeviceList XFREEDEVICELIST
+#define XFreeDeviceState XFREEDEVICESTATE
 #define XFreeFont XFREEFONT
 #define XFreeFontInfo XFREEFONTINFO
 #define XFreeFontNames XFREEFONTNAMES
@@ -96,82 +149,138 @@
 #define XFreeModifiermap XFREEMODIFIERMAP
 #define XFreePixmap XFREEPIXMAP
 #define XFreeStringList XFREESTRINGLIST
+#define XGContextFromGC XGCONTEXTFROMGC
+#define XGeometry XGEOMETRY
 #define XGetAtomName XGETATOMNAME
+#define XGetClassHint XGETCLASSHINT
+#define XGetCommand XGETCOMMAND
 #define XGetDefault XGETDEFAULT
 #define XGetErrorDatabaseText XGETERRORDATABASETEXT
 #define XGetErrorText XGETERRORTEXT
+#define XGetExtensionVersion XGETEXTENSIONVERSION
 #define XGetFontProperty XGETFONTPROPERTY
 #define XGetGCValues XGETGCVALUES
 #define XGetGeometry XGETGEOMETRY
 #define XGetICValues XGETICVALUES
 #define XGetIMValues XGETIMVALUES
+#define XGetIconName XGETICONNAME
+#define XGetIconSizes XGETICONSIZES
 #define XGetImage XGETIMAGE
+#define XGetInputFocus XGETINPUTFOCUS
 #define XGetKeyboardControl XGETKEYBOARDCONTROL
+#define XGetKeyboardMapping XGETKEYBOARDMAPPING
 #define XGetModifierMapping XGETMODIFIERMAPPING
 #define XGetMotionEvents XGETMOTIONEVENTS
 #define XGetNormalHints XGETNORMALHINTS
+#define XGetPointerControl XGETPOINTERCONTROL
+#define XGetPointerMapping XGETPOINTERMAPPING
+#define XGetRGBColormaps XGETRGBCOLORMAPS
+#define XGetScreenSaver XGETSCREENSAVER
 #define XGetSelectionOwner XGETSELECTIONOWNER
+#define XGetStandardColormap XGETSTANDARDCOLORMAP
 #define XGetSubImage XGETSUBIMAGE
+#define XGetTextProperty XGETTEXTPROPERTY
 #define XGetVisualInfo XGETVISUALINFO
 #define XGetWMColormapWindows XGETWMCOLORMAPWINDOWS
 #define XGetWMHints XGETWMHINTS
+#define XGetWMIconName XGETWMICONNAME
 #define XGetWMName XGETWMNAME
 #define XGetWMNormalHints XGETWMNORMALHINTS
 #define XGetWindowAttributes XGETWINDOWATTRIBUTES
 #define XGetWindowProperty XGETWINDOWPROPERTY
+#define XGrabButton XGRABBUTTON
 #define XGrabKeyboard XGRABKEYBOARD
 #define XGrabPointer XGRABPOINTER
 #define XGrabServer XGRABSERVER
+#define XHeightMMOfScreen XHEIGHTMMOFSCREEN
 #define XHeightOfScreen XHEIGHTOFSCREEN
+#define XIconifyWindow XICONIFYWINDOW
 #define XIfEvent XIFEVENT
+#define XInitExtension XINITEXTENSION
+#define XInitImage XINITIMAGE
+#define XInstallColormap XINSTALLCOLORMAP
 #define XInternAtom XINTERNATOM
+#define XInternAtoms XINTERNATOMS
 #define XIntersectRegion XINTERSECTREGION
 #define XKeycodeToKeysym XKEYCODETOKEYSYM
 #define XKeysymToKeycode XKEYSYMTOKEYCODE
 #define XKeysymToString XKEYSYMTOSTRING
+#define XKillClient XKILLCLIENT
+#define XListDepths XLISTDEPTHS
 #define XListFonts XLISTFONTS
 #define XListFontsWithInfo XLISTFONTSWITHINFO
+#define XListHosts XLISTHOSTS
+#define XListInputDevices XLISTINPUTDEVICES
+#define XListInstalledColormaps XLISTINSTALLEDCOLORMAPS
 #define XListPixmapFormats XLISTPIXMAPFORMATS
 #define XListProperties XLISTPROPERTIES
+#define XLoadFont XLOADFONT
 #define XLoadQueryFont XLOADQUERYFONT
+#define XLookupColor XLOOKUPCOLOR
+#define XLookupKeysym XLOOKUPKEYSYM
 #define XLookupString XLOOKUPSTRING
 #define XLowerWindow XLOWERWINDOW
 #define XMapRaised XMAPRAISED
+#define XMapSubwindows XMAPSUBWINDOWS
 #define XMapWindow XMAPWINDOW
+#define XMaskEvent XMASKEVENT
 #define XMatchVisualInfo XMATCHVISUALINFO
+#define XMaxRequestSize XMAXREQUESTSIZE
+#define XMissingExtension XMISSINGEXTENSION
 #define XMoveResizeWindow XMOVERESIZEWINDOW
 #define XMoveWindow XMOVEWINDOW
 #define XNextEvent XNEXTEVENT
+#define XNextRequest XNEXTREQUEST
+#define XNoOp XNOOP
 #define XOffsetRegion XOFFSETREGION
+#define XOpenDevice XOPENDEVICE
 #define XOpenDisplay XOPENDISPLAY
 #define XOpenIM XOPENIM
 #define XParseColor XPARSECOLOR
 #define XParseGeometry XPARSEGEOMETRY
 #define XPeekEvent XPEEKEVENT
+#define XPeekIfEvent XPEEKIFEVENT
 #define XPending XPENDING
 #define XPointInRegion XPOINTINREGION
 #define XPolygonRegion XPOLYGONREGION
 #define XPutBackEvent XPUTBACKEVENT
 #define XPutImage XPUTIMAGE
+#define XQLength XQLENGTH
+#define XQueryBestCursor XQUERYBESTCURSOR
+#define XQueryBestStipple XQUERYBESTSTIPPLE
 #define XQueryColor XQUERYCOLOR
 #define XQueryColors XQUERYCOLORS
+#define XQueryDeviceState XQUERYDEVICESTATE
 #define XQueryExtension XQUERYEXTENSION
+#define XQueryFont XQUERYFONT
+#define XQueryKeymap XQUERYKEYMAP
 #define XQueryPointer XQUERYPOINTER
 #define XQueryTree XQUERYTREE
 #define XRaiseWindow XRAISEWINDOW
+#define XReadBitmapFile XREADBITMAPFILE
+#define XRecolorCursor XRECOLORCURSOR
 #define XReconfigureWMWindow XRECONFIGUREWMWINDOW
 #define XRectInRegion XRECTINREGION
 #define XRefreshKeyboardMapping XREFRESHKEYBOARDMAPPING
+#define XRemoveHosts XREMOVEHOSTS
 #define XReparentWindow XREPARENTWINDOW
+#define XResetScreenSaver XRESETSCREENSAVER
 #define XResizeWindow XRESIZEWINDOW
+#define XResourceManagerString XRESOURCEMANAGERSTRING
 #define XRestackWindows XRESTACKWINDOWS
+#define XRotateBuffers XROTATEBUFFERS
+#define XRootWindow XROOTWINDOW
 #define XRootWindowOfScreen XROOTWINDOWOFSCREEN
+#define XSaveContext XSAVECONTEXT
 #define XScreenNumberOfScreen XSCREENNUMBEROFSCREEN
+#define XScreenOfDisplay XSCREENOFDISPLAY
 #define XSelectAsyncEvent XSELECTASYNCEVENT
 #define XSelectAsyncInput XSELECTASYNCINPUT
+#define XSelectExtensionEvent XSELECTEXTENSIONEVENT
 #define XSelectInput XSELECTINPUT
 #define XSendEvent XSENDEVENT
 #define XServerVendor XSERVERVENDOR
+#define XSetArcMode XSETARCMODE
 #define XSetBackground XSETBACKGROUND
 #define XSetClassHint XSETCLASSHINT
 #define XSetClipMask XSETCLIPMASK
@@ -181,6 +290,8 @@
 #define XSetCommand XSETCOMMAND
 #define XSetDashes XSETDASHES
 #define XSetErrorHandler XSETERRORHANDLER
+#define XSetExtensionErrorHandler XSETEXTENSIONERRORHANDLER
+#define XSetFillRule XSETFILLRULE
 #define XSetFillStyle XSETFILLSTYLE
 #define XSetFont XSETFONT
 #define XSetForeground XSETFOREGROUND
@@ -189,17 +300,25 @@
 #define XSetICFocus XSETICFOCUS
 #define XSetICValues XSETICVALUES
 #define XSetIOErrorHandler XSETIOERRORHANDLER
+#define XSetIconName XSETICONNAME
 #define XSetInputFocus XSETINPUTFOCUS
 #define XSetLineAttributes XSETLINEATTRIBUTES
 #define XSetLocaleModifiers XSETLOCALEMODIFIERS
 #define XSetNormalHints XSETNORMALHINTS
+#define XSetPlaneMask XSETPLANEMASK
 #define XSetRegion XSETREGION
+#define XSetRGBColormaps XSETRGBCOLORMAPS
+#define XSetScreenSaver XSETSCREENSAVER
 #define XSetSelectionOwner XSETSELECTIONOWNER
+#define XSetStandardProperties XSETSTANDARDPROPERTIES
+#define XSetState XSETSTATE
 #define XSetStipple XSETSTIPPLE
 #define XSetSubwindowMode XSETSUBWINDOWMODE
 #define XSetTSOrigin XSETTSORIGIN
+#define XSetTextProperty XSETTEXTPROPERTY
 #define XSetTile XSETTILE
 #define XSetTransientForHint XSETTRANSIENTFORHINT
+#define XSetWMClientMachine XSETWMCLIENTMACHINE
 #define XSetWMColormapWindows XSETWMCOLORMAPWINDOWS
 #define XSetWMHints XSETWMHINTS
 #define XSetWMIconName XSETWMICONNAME
@@ -207,16 +326,32 @@
 #define XSetWMNormalHints XSETWMNORMALHINTS
 #define XSetWMProperties XSETWMPROPERTIES
 #define XSetWMProtocols XSETWMPROTOCOLS
+#define XSetWMSizeHints XSETWMSIZEHINTS
 #define XSetWindowBackground XSETWINDOWBACKGROUND
 #define XSetWindowBackgroundPixmap XSETWINDOWBACKGROUNDPIXMAP
+#define XSetWindowBorder XSETWINDOWBORDER
+#define XSetWindowBorderPixmap XSETWINDOWBORDERPIXMAP
+#define XSetWindowBorderWidth XSETWINDOWBORDERWIDTH
 #define XSetWindowColormap XSETWINDOWCOLORMAP
 #define XShapeCombineMask XSHAPECOMBINEMASK
 #define XShapeCombineRectangles XSHAPECOMBINERECTANGLES
 #define XShapeGetRectangles XSHAPEGETRECTANGLES
+#define XShapeQueryExtension XSHAPEQUERYEXTENSION
+#define XShmAttach XSHMATTACH
+#define XShmCreateImage XSHMCREATEIMAGE
+#define XShmCreatePixmap XSHMCREATEPIXMAP
+#define XShmDetach XSHMDETACH
+#define XShmGetEventBase XSHMGETEVENTBASE
+#define XShmPutImage XSHMPUTIMAGE
+#define XShmQueryExtension XSHMQUERYEXTENSION
+#define XShmQueryVersion XSHMQUERYVERSION
 #define XShrinkRegion XSHRINKREGION
+#define XStoreBuffer XSTOREBUFFER
+#define XStoreBytes XSTOREBYTES
 #define XStoreColor XSTORECOLOR
 #define XStoreColors XSTORECOLORS
 #define XStoreName XSTORENAME
+#define XStringListToTextProperty XSTRINGLISTTOTEXTPROPERTY
 #define XStringToKeysym XSTRINGTOKEYSYM
 #define XSubtractRegion XSUBTRACTREGION
 #define XSupportsLocale XSUPPORTSLOCALE
@@ -224,48 +359,81 @@
 #define XSynchronize XSYNCHRONIZE
 #define XTextExtents XTEXTEXTENTS
 #define XTextExtents16 XTEXTEXTENTS16
+#define XTextPropertyToStringList XTEXTPROPERTYTOSTRINGLIST
 #define XTextWidth XTEXTWIDTH
 #define XTextWidth16 XTEXTWIDTH16
 #define XTranslateCoordinates XTRANSLATECOORDINATES
 #define XUndefineCursor XUNDEFINECURSOR
+#define XUngrabButton XUNGRABBUTTON
 #define XUngrabKeyboard XUNGRABKEYBOARD
 #define XUngrabPointer XUNGRABPOINTER
 #define XUngrabServer XUNGRABSERVER
+#define XUninstallColormap XUNINSTALLCOLORMAP
 #define XUnionRectWithRegion XUNIONRECTWITHREGION
 #define XUnionRegion XUNIONREGION
+#define XUniqueContext XUNIQUECONTEXT
+#define XUnloadFont XUNLOADFONT
 #define XUnmapWindow XUNMAPWINDOW
-#define _XUnregisterFilter _XUNREGISTERFILTER
 #define XUnsetICFocus XUNSETICFOCUS
 #define XVaCreateNestedList XVACREATENESTEDLIST
 #define XVisualIDFromVisual XVISUALIDFROMVISUAL
+#define XWMGeometry XWMGEOMETRY
+#define XWarpPointer XWARPPOINTER
+#define XWhitePixel XWHITEPIXEL
+#define XWhitePixelOfScreen XWHITEPIXELOFSCREEN
+#define XWidthMMOfScreen XWIDTHMMOFSCREEN
 #define XWidthOfScreen XWIDTHOFSCREEN
 #define XWindowEvent XWINDOWEVENT
 #define XWithdrawWindow XWITHDRAWWINDOW
 #define XXorRegion XXORREGION
+#define XcmsQueryColor XCMSQUERYCOLOR
+#define XdbeAllocateBackBufferName XDBEALLOCATEBACKBUFFERNAME
+#define XdbeFreeVisualInfo XDBEFREEVISUALINFO
+#define XdbeGetVisualInfo XDBEGETVISUALINFO
+#define XdbeQueryExtension XDBEQUERYEXTENSION
+#define XdbeSwapBuffers XDBESWAPBUFFERS
+#define XextAddDisplay XEXTADDDISPLAY
+#define XextFindDisplay XEXTFINDDISPLAY
+#define XextRemoveDisplay XEXTREMOVEDISPLAY
+#define XkbSetDetectableAutoRepeat XKBSETDETECTABLEAUTOREPEAT
+#define XmActivateProtocol XMACTIVATEPROTOCOL
 #define XmAddProtocolCallback XMADDPROTOCOLCALLBACK
 #define XmAddProtocols XMADDPROTOCOLS
 #define XmChangeColor XMCHANGECOLOR
 #define XmClipboardCopy XMCLIPBOARDCOPY
+#define XmClipboardCopyByName XMCLIPBOARDCOPYBYNAME
 #define XmClipboardEndCopy XMCLIPBOARDENDCOPY
+#define XmClipboardEndRetrieve XMCLIPBOARDENDRETRIEVE
+#define XmClipboardInquireCount XMCLIPBOARDINQUIRECOUNT
+#define XmClipboardInquireFormat XMCLIPBOARDINQUIREFORMAT
 #define XmClipboardInquireLength XMCLIPBOARDINQUIRELENGTH
 #define XmClipboardLock XMCLIPBOARDLOCK
 #define XmClipboardRetrieve XMCLIPBOARDRETRIEVE
 #define XmClipboardStartCopy XMCLIPBOARDSTARTCOPY
+#define XmClipboardStartRetrieve XMCLIPBOARDSTARTRETRIEVE
 #define XmClipboardUnlock XMCLIPBOARDUNLOCK
+#define XmCommandError XMCOMMANDERROR
+#define XmCommandGetChild XMCOMMANDGETCHILD
+#define XmCommandSetValue XMCOMMANDSETVALUE
 #define XmCreateArrowButton XMCREATEARROWBUTTON
 #define XmCreateArrowButtonGadget XMCREATEARROWBUTTONGADGET
+#define XmCreateBulletinBoardDialog XMCREATEBULLETINBOARDDIALOG
 #define XmCreateCascadeButton XMCREATECASCADEBUTTON
+#define XmCreateCascadeButtonGadget XMCREATECASCADEBUTTONGADGET
 #define XmCreateDialogShell XMCREATEDIALOGSHELL
 #define XmCreateDragIcon XMCREATEDRAGICON
 #define XmCreateDrawingArea XMCREATEDRAWINGAREA
 #define XmCreateDrawnButton XMCREATEDRAWNBUTTON
+#define XmCreateErrorDialog XMCREATEERRORDIALOG
 #define XmCreateFileSelectionBox XMCREATEFILESELECTIONBOX
 #define XmCreateFileSelectionDialog XMCREATEFILESELECTIONDIALOG
 #define XmCreateForm XMCREATEFORM
 #define XmCreateFormDialog XMCREATEFORMDIALOG
 #define XmCreateFrame XMCREATEFRAME
 #define XmCreateInformationDialog XMCREATEINFORMATIONDIALOG
+#define XmCreateLabel XMCREATELABEL
 #define XmCreateLabelGadget XMCREATELABELGADGET
+#define XmCreateList XMCREATELIST
 #define XmCreateMainWindow XMCREATEMAINWINDOW
 #define XmCreateMenuBar XMCREATEMENUBAR
 #define XmCreateMessageBox XMCREATEMESSAGEBOX
@@ -288,11 +456,15 @@
 #define XmCreateSelectionDialog XMCREATESELECTIONDIALOG
 #define XmCreateSeparator XMCREATESEPARATOR
 #define XmCreateSeparatorGadget XMCREATESEPARATORGADGET
+#define XmCreateSimpleMenuBar XMCREATESIMPLEMENUBAR
 #define XmCreateTemplateDialog XMCREATETEMPLATEDIALOG
 #define XmCreateText XMCREATETEXT
 #define XmCreateTextField XMCREATETEXTFIELD
 #define XmCreateToggleButton XMCREATETOGGLEBUTTON
 #define XmCreateToggleButtonGadget XMCREATETOGGLEBUTTONGADGET
+#define XmCreateWarningDialog XMCREATEWARNINGDIALOG
+#define XmCvtCTToXmString XMCVTCTTOXMSTRING
+#define XmDestroyPixmap XMDESTROYPIXMAP
 #define XmDragStart XMDRAGSTART
 #define XmDropSiteRegister XMDROPSITEREGISTER
 #define XmDropSiteUnregister XMDROPSITEUNREGISTER
@@ -314,8 +486,10 @@
 #define XmFontListInitFontContext XMFONTLISTINITFONTCONTEXT
 #define XmFontListNextEntry XMFONTLISTNEXTENTRY
 #define XmGetColors XMGETCOLORS
+#define XmGetColorCalculation XMGETCOLORCALCULATION
 #define XmGetFocusWidget XMGETFOCUSWIDGET
 #define XmGetMenuCursor XMGETMENUCURSOR
+#define XmGetPixmap XMGETPIXMAP
 #define XmGetPixmapByDepth XMGETPIXMAPBYDEPTH
 #define XmGetTearOffControl XMGETTEAROFFCONTROL
 #define XmGetXmDisplay XMGETXMDISPLAY
@@ -325,12 +499,15 @@
 #define XmImSetValues XMIMSETVALUES
 #define XmImUnregister XMIMUNREGISTER
 #define XmImUnsetFocus XMIMUNSETFOCUS
+#define XmInstallImage XMINSTALLIMAGE
 #define XmInternAtom XMINTERNATOM
 #define XmIsMotifWMRunning XMISMOTIFWMRUNNING
 #define XmListAddItem XMLISTADDITEM
 #define XmListAddItemUnselected XMLISTADDITEMUNSELECTED
+#define XmListAddItems XMLISTADDITEMS
 #define XmListAddItemsUnselected XMLISTADDITEMSUNSELECTED
 #define XmListDeleteAllItems XMLISTDELETEALLITEMS
+#define XmListDeleteItem XMLISTDELETEITEM
 #define XmListDeleteItemsPos XMLISTDELETEITEMSPOS
 #define XmListDeletePos XMLISTDELETEPOS
 #define XmListDeselectAllItems XMLISTDESELECTALLITEMS
@@ -338,7 +515,11 @@
 #define XmListGetKbdItemPos XMLISTGETKBDITEMPOS
 #define XmListGetMatchPos XMLISTGETMATCHPOS
 #define XmListGetSelectedPos XMLISTGETSELECTEDPOS
+#define XmListItemExists XMLISTITEMEXISTS
+#define XmListItemPos XMLISTITEMPOS
 #define XmListPosSelected XMLISTPOSSELECTED
+#define XmListReplaceItems XMLISTREPLACEITEMS
+#define XmListReplaceItemsPos XMLISTREPLACEITEMSPOS
 #define XmListSelectItem XMLISTSELECTITEM
 #define XmListSelectPos XMLISTSELECTPOS
 #define XmListSetBottomPos XMLISTSETBOTTOMPOS
@@ -353,13 +534,18 @@
 #define XmProcessTraversal XMPROCESSTRAVERSAL
 #define XmQmotif XMQMOTIF
 #define XmRemoveProtocolCallback XMREMOVEPROTOCOLCALLBACK
+#define XmRemoveProtocols XMREMOVEPROTOCOLS
+#define XmRemoveTabGroup XMREMOVETABGROUP
 #define XmRepTypeGetId XMREPTYPEGETID
 #define XmRepTypeGetRecord XMREPTYPEGETRECORD
+#define XmRepTypeInstallTearOffModelCon XMREPTYPEINSTALLTEAROFFMODELCON
 #define XmRepTypeRegister XMREPTYPEREGISTER
 #define XmRepTypeValidValue XMREPTYPEVALIDVALUE
+#define XmScrollBarGetValues XMSCROLLBARGETVALUES
 #define XmScrollBarSetValues XMSCROLLBARSETVALUES
 #define XmScrolledWindowSetAreas XMSCROLLEDWINDOWSETAREAS
 #define XmSelectionBoxGetChild XMSELECTIONBOXGETCHILD
+#define XmSetColorCalculation XMSETCOLORCALCULATION
 #define XmStringByteCompare XMSTRINGBYTECOMPARE
 #define XmStringCompare XMSTRINGCOMPARE
 #define XmStringConcat XMSTRINGCONCAT
@@ -381,18 +567,34 @@
 #define XmStringLtoRCreate XMSTRINGLTORCREATE
 #define XmStringNConcat XMSTRINGNCONCAT
 #define XmStringSegmentCreate XMSTRINGSEGMENTCREATE
+#define XmStringSeparatorCreate XMSTRINGSEPARATORCREATE
 #define XmStringWidth XMSTRINGWIDTH
 #define XmTextClearSelection XMTEXTCLEARSELECTION
+#define XmTextCopy XMTEXTCOPY
+#define XmTextCut XMTEXTCUT
+#define XmTextFieldClearSelection XMTEXTFIELDCLEARSELECTION
+#define XmTextFieldCopy XMTEXTFIELDCOPY
+#define XmTextFieldCut XMTEXTFIELDCUT
 #define XmTextFieldGetEditable XMTEXTFIELDGETEDITABLE
 #define XmTextFieldGetInsertionPosition XMTEXTFIELDGETINSERTIONPOSITION
 #define XmTextFieldGetLastPosition XMTEXTFIELDGETLASTPOSITION
+#define XmTextFieldGetMaxLength XMTEXTFIELDGETMAXLENGTH
 #define XmTextFieldGetSelection XMTEXTFIELDGETSELECTION
+#define XmTextFieldGetSelectionPosition XMTEXTFIELDGETSELECTIONPOSITION
 #define XmTextFieldGetString XMTEXTFIELDGETSTRING
 #define XmTextFieldInsert XMTEXTFIELDINSERT
+#define XmTextFieldPaste XMTEXTFIELDPASTE
 #define XmTextFieldRemove XMTEXTFIELDREMOVE
+#define XmTextFieldReplace XMTEXTFIELDREPLACE
+#define XmTextFieldSetAddMode XMTEXTFIELDSETADDMODE
+#define XmTextFieldSetHighlight XMTEXTFIELDSETHIGHLIGHT
+#define XmTextFieldSetInsertionPosition XMTEXTFIELDSETINSERTIONPOSITION
+#define XmTextFieldSetMaxLength XMTEXTFIELDSETMAXLENGTH
 #define XmTextFieldSetSelection XMTEXTFIELDSETSELECTION
 #define XmTextFieldSetString XMTEXTFIELDSETSTRING
+#define XmTextFieldShowPosition XMTEXTFIELDSHOWPOSITION
 #define XmTextGetCursorPosition XMTEXTGETCURSORPOSITION
+#define XmTextGetEditable XMTEXTGETEDITABLE
 #define XmTextGetInsertionPosition XMTEXTGETINSERTIONPOSITION
 #define XmTextGetLastPosition XMTEXTGETLASTPOSITION
 #define XmTextGetMaxLength XMTEXTGETMAXLENGTH
@@ -400,17 +602,23 @@
 #define XmTextGetSelectionPosition XMTEXTGETSELECTIONPOSITION
 #define XmTextGetString XMTEXTGETSTRING
 #define XmTextInsert XMTEXTINSERT
+#define XmTextPaste XMTEXTPASTE
+#define XmTextPosToXY XMTEXTPOSTOXY
 #define XmTextRemove XMTEXTREMOVE
 #define XmTextReplace XMTEXTREPLACE
 #define XmTextSetCursorPosition XMTEXTSETCURSORPOSITION
+#define XmTextSetEditable XMTEXTSETEDITABLE
 #define XmTextSetHighlight XMTEXTSETHIGHLIGHT
 #define XmTextSetInsertionPosition XMTEXTSETINSERTIONPOSITION
 #define XmTextSetSelection XMTEXTSETSELECTION
 #define XmTextSetString XMTEXTSETSTRING
+#define XmTextSetTopCharacter XMTEXTSETTOPCHARACTER
+#define XmTextShowPosition XMTEXTSHOWPOSITION
 #define XmToggleButtonGadgetGetState XMTOGGLEBUTTONGADGETGETSTATE
 #define XmToggleButtonGadgetSetState XMTOGGLEBUTTONGADGETSETSTATE
 #define XmToggleButtonGetState XMTOGGLEBUTTONGETSTATE
 #define XmToggleButtonSetState XMTOGGLEBUTTONSETSTATE
+#define XmUninstallImage XMUNINSTALLIMAGE
 #define XmUpdateDisplay XMUPDATEDISPLAY
 #define XmVaCreateSimpleRadioBox XMVACREATESIMPLERADIOBOX
 #define XmbDrawString XMBDRAWSTRING
@@ -421,71 +629,135 @@
 #define XmbTextExtents XMBTEXTEXTENTS
 #define XmbTextListToTextProperty XMBTEXTLISTTOTEXTPROPERTY
 #define XmbTextPropertyToTextList XMBTEXTPROPERTYTOTEXTLIST
+#define XmbufCreateBuffers XMBUFCREATEBUFFERS
+#define XmbufDestroyBuffers XMBUFDESTROYBUFFERS
+#define XmbufDisplayBuffers XMBUFDISPLAYBUFFERS
+#define XmbufQueryExtension XMBUFQUERYEXTENSION
+#define Xmemory_free XMEMORY_FREE
+#define Xmemory_malloc XMEMORY_MALLOC
 #define XmuClientWindow XMUCLIENTWINDOW
+#define XmuConvertStandardSelection XMUCONVERTSTANDARDSELECTION
+#define XmuCvtStringToBitmap XMUCVTSTRINGTOBITMAP
+#define XmuInternAtom XMUINTERNATOM
+#define XmuInternStrings XMUINTERNSTRINGS
+#define XmuLookupStandardColormap XMULOOKUPSTANDARDCOLORMAP
 #define XmuPrintDefaultErrorMessage XMUPRINTDEFAULTERRORMESSAGE
+#define XrmCombineDatabase XRMCOMBINEDATABASE
+#define XrmCombineFileDatabase XRMCOMBINEFILEDATABASE
+#define XrmDestroyDatabase XRMDESTROYDATABASE
 #define XrmGetDatabase XRMGETDATABASE
+#define XrmGetFileDatabase XRMGETFILEDATABASE
 #define XrmGetResource XRMGETRESOURCE
+#define XrmGetStringDatabase XRMGETSTRINGDATABASE
+#define XrmInitialize XRMINITIALIZE
+#define XrmMergeDatabases XRMMERGEDATABASES
+#define XrmParseCommand XRMPARSECOMMAND
+#define XrmPermStringToQuark XRMPERMSTRINGTOQUARK
+#define XrmPutFileDatabase XRMPUTFILEDATABASE
+#define XrmPutLineResource XRMPUTLINERESOURCE
 #define XrmPutStringResource XRMPUTSTRINGRESOURCE
+#define XrmQGetResource XRMQGETRESOURCE
+#define XrmQPutStringResource XRMQPUTSTRINGRESOURCE
 #define XrmQuarkToString XRMQUARKTOSTRING
+#define XrmSetDatabase XRMSETDATABASE
+#define XrmStringToBindingQuarkList XRMSTRINGTOBINDINGQUARKLIST
 #define XrmStringToQuark XRMSTRINGTOQUARK
 #define XtAddCallback XTADDCALLBACK
 #define XtAddCallbacks XTADDCALLBACKS
+#define XtAddConverter XTADDCONVERTER
 #define XtAddEventHandler XTADDEVENTHANDLER
+#define XtAddExposureToRegion XTADDEXPOSURETOREGION
 #define XtAddGrab XTADDGRAB
+#define XtAddRawEventHandler XTADDRAWEVENTHANDLER
 #define XtAllocateGC XTALLOCATEGC
 #define XtAppAddActions XTAPPADDACTIONS
 #define XtAppAddInput XTAPPADDINPUT
 #define XtAppAddTimeOut XTAPPADDTIMEOUT
+#define XtAppAddWorkProc XTAPPADDWORKPROC
 #define XtAppCreateShell XTAPPCREATESHELL
+#define XtAppError XTAPPERROR
+#define XtAppErrorMsg XTAPPERRORMSG
+#define XtAppGetErrorDatabase XTAPPGETERRORDATABASE
+#define XtAppGetErrorDatabaseText XTAPPGETERRORDATABASETEXT
+#define XtAppSetErrorMsgHandler XTAPPSETERRORMSGHANDLER
 #define XtAppInitialize XTAPPINITIALIZE
+#define XtAppMainLoop XTAPPMAINLOOP
 #define XtAppNextEvent XTAPPNEXTEVENT
 #define XtAppPeekEvent XTAPPPEEKEVENT
 #define XtAppPending XTAPPPENDING
 #define XtAppProcessEvent XTAPPPROCESSEVENT
 #define XtAppSetErrorHandler XTAPPSETERRORHANDLER
 #define XtAppSetFallbackResources XTAPPSETFALLBACKRESOURCES
+#define XtAppSetTypeConverter XTAPPSETTYPECONVERTER
 #define XtAppSetWarningHandler XTAPPSETWARNINGHANDLER
+#define XtAppWarningMsg XTAPPWARNINGMSG
 #define XtAppSetWarningMsgHandler XTAPPSETWARNINGMSGHANDLER
 #define XtAppWarning XTAPPWARNING
+#define XtAugmentTranslations XTAUGMENTTRANSLATIONS
 #define XtCallActionProc XTCALLACTIONPROC
 #define XtCallCallbackList XTCALLCALLBACKLIST
 #define XtCallCallbacks XTCALLCALLBACKS
+#define XtCallConverter XTCALLCONVERTER
+#define XtCalloc XTCALLOC 
+#ifndef NOXTDISPLAY
+#define XtClass XTCLASS
+#endif
+#define XtCloseDisplay XTCLOSEDISPLAY
 #define XtConfigureWidget XTCONFIGUREWIDGET
+#define XtConvert XTCONVERT
 #define XtConvertAndStore XTCONVERTANDSTORE
 #define XtCreateApplicationContext XTCREATEAPPLICATIONCONTEXT
 #define XtCreateManagedWidget XTCREATEMANAGEDWIDGET
 #define XtCreatePopupShell XTCREATEPOPUPSHELL
 #define XtCreateWidget XTCREATEWIDGET
+#define XtCreateWindow XTCREATEWINDOW
+#define XtCvtStringToFont XTCVTSTRINGTOFONT
 #define XtDatabase XTDATABASE
+#define XtDestroyApplicationContext XTDESTROYAPPLICATIONCONTEXT
 #define XtDestroyWidget XTDESTROYWIDGET
 #define XtDisownSelection XTDISOWNSELECTION
 #define XtDispatchEvent XTDISPATCHEVENT
+#ifndef NOXTDISPLAY
+#define XtDisplay XTDISPLAY
+#endif
+#define XtDisplayInitialize XTDISPLAYINITIALIZE
 #define XtDisplayOfObject XTDISPLAYOFOBJECT
 #define XtDisplayStringConvWarning XTDISPLAYSTRINGCONVWARNING
 #define XtDisplayToApplicationContext XTDISPLAYTOAPPLICATIONCONTEXT
-#define XtAppAddWorkProc XTAPPADDWORKPROC
-#define XtRemoveWorkProc XTREMOVEWORKPROC
+#define XtError XTERROR
+#define XtErrorMsg XTERRORMSG
 #define XtFree XTFREE
 #define XtGetActionKeysym XTGETACTIONKEYSYM
 #define XtGetActionList XTGETACTIONLIST
 #define XtGetApplicationNameAndClass XTGETAPPLICATIONNAMEANDCLASS
 #define XtGetApplicationResources XTGETAPPLICATIONRESOURCES
+#define XtGetClassExtension XTGETCLASSEXTENSION
+#define XtGetConstraintResourceList XTGETCONSTRAINTRESOURCELIST
 #define XtGetGC XTGETGC
 #define XtGetMultiClickTime XTGETMULTICLICKTIME
+#define XtGetResourceList XTGETRESOURCELIST
 #define XtGetSelectionValue XTGETSELECTIONVALUE
 #define XtGetSelectionValues XTGETSELECTIONVALUES
 #define XtGetSubresources XTGETSUBRESOURCES
 #define XtGetValues XTGETVALUES
+#define XtGrabButton XTGRABBUTTON
 #define XtGrabKeyboard XTGRABKEYBOARD
 #define XtGrabPointer XTGRABPOINTER
 #define XtHasCallbacks XTHASCALLBACKS
+#define XtInitialize XTINITIALIZE
 #define XtInitializeWidgetClass XTINITIALIZEWIDGETCLASS
 #define XtInsertEventHandler XTINSERTEVENTHANDLER
+#define XtInsertRawEventHandler XTINSERTRAWEVENTHANDLER
+#define XtInstallAccelerators XTINSTALLACCELERATORS
 #define XtIsManaged XTISMANAGED
 #define XtIsObject XTISOBJECT
+#ifndef NOXTDISPLAY
+#define XtIsRealized XTISREALIZED
+#endif
 #define XtIsSensitive XTISSENSITIVE
 #define XtIsSubclass XTISSUBCLASS
 #define XtLastTimestampProcessed XTLASTTIMESTAMPPROCESSED
+#define XtMainLoop XTMAINLOOP
 #define XtMakeGeometryRequest XTMAKEGEOMETRYREQUEST
 #define XtMakeResizeRequest XTMAKERESIZEREQUEST
 #define XtMalloc XTMALLOC
@@ -495,15 +767,23 @@
 #define XtMoveWidget XTMOVEWIDGET
 #define XtName XTNAME
 #define XtNameToWidget XTNAMETOWIDGET
+#define XtOpenApplication XTOPENAPPLICATION
 #define XtOpenDisplay XTOPENDISPLAY
 #define XtOverrideTranslations XTOVERRIDETRANSLATIONS
 #define XtOwnSelection XTOWNSELECTION
+#ifndef NOXTDISPLAY
+#define XtParent XTPARENT
+#endif
+#define XtParseAcceleratorTable XTPARSEACCELERATORTABLE
 #define XtParseTranslationTable XTPARSETRANSLATIONTABLE
 #define XtPopdown XTPOPDOWN
 #define XtPopup XTPOPUP
+#define XtPopupSpringLoaded XTPOPUPSPRINGLOADED
 #define XtQueryGeometry XTQUERYGEOMETRY
 #define XtRealizeWidget XTREALIZEWIDGET
 #define XtRealloc XTREALLOC
+#define XtRegisterDrawable _XTREGISTERWINDOW
+#define XtRegisterGrabAction XTREGISTERGRABACTION
 #define XtReleaseGC XTRELEASEGC
 #define XtRemoveAllCallbacks XTREMOVEALLCALLBACKS
 #define XtRemoveCallback XTREMOVECALLBACK
@@ -511,37 +791,72 @@
 #define XtRemoveGrab XTREMOVEGRAB
 #define XtRemoveInput XTREMOVEINPUT
 #define XtRemoveTimeOut XTREMOVETIMEOUT
+#define XtRemoveWorkProc XTREMOVEWORKPROC
 #define XtResizeWidget XTRESIZEWIDGET
 #define XtResolvePathname XTRESOLVEPATHNAME
+#ifndef NOXTDISPLAY
+#define XtScreen XTSCREEN
+#endif
+#define XtScreenDatabase XTSCREENDATABASE
+#define XtScreenOfObject XTSCREENOFOBJECT
+#define XtSessionReturnToken XTSESSIONRETURNTOKEN
+#define XtSetErrorHandler XTSETERRORHANDLER
 #define XtSetKeyboardFocus XTSETKEYBOARDFOCUS
+#define XtSetLanguageProc XTSETLANGUAGEPROC
 #define XtSetMappedWhenManaged XTSETMAPPEDWHENMANAGED
 #define XtSetSensitive XTSETSENSITIVE
 #define XtSetTypeConverter XTSETTYPECONVERTER
 #define XtSetValues XTSETVALUES
 #define XtShellStrings XTSHELLSTRINGS
+#define XtStringConversionWarning XTSTRINGCONVERSIONWARNING 
 #define XtStrings XTSTRINGS
 #define XtToolkitInitialize XTTOOLKITINITIALIZE
 #define XtTranslateCoords XTTRANSLATECOORDS
 #define XtTranslateKeycode XTTRANSLATEKEYCODE
+#define XtUngrabButton XTUNGRABBUTTON
 #define XtUngrabKeyboard XTUNGRABKEYBOARD
 #define XtUngrabPointer XTUNGRABPOINTER
 #define XtUnmanageChild XTUNMANAGECHILD
 #define XtUnmanageChildren XTUNMANAGECHILDREN
 #define XtUnrealizeWidget XTUNREALIZEWIDGET
+#define XtUnregisterDrawable _XTUNREGISTERWINDOW
+#define XtVaAppCreateShell XTVAAPPCREATESHELL
 #define XtVaCreateManagedWidget XTVACREATEMANAGEDWIDGET
+#define XtVaCreatePopupShell XTVACREATEPOPUPSHELL
 #define XtVaCreateWidget XTVACREATEWIDGET
+#define XtVaGetApplicationResources XTVAGETAPPLICATIONRESOURCES
 #define XtVaGetValues XTVAGETVALUES
 #define XtVaSetValues XTVASETVALUES
 #define XtWarning XTWARNING
+#define XtWarningMsg XTWARNINGMSG
 #define XtWidgetToApplicationContext XTWIDGETTOAPPLICATIONCONTEXT
+#ifndef NOXTDISPLAY
+#define XtWindow XTWINDOW
+#endif
 #define XtWindowOfObject XTWINDOWOFOBJECT
 #define XtWindowToWidget XTWINDOWTOWIDGET
+#define XwcDrawImageString XWCDRAWIMAGESTRING
 #define XwcDrawString XWCDRAWSTRING
 #define XwcFreeStringList XWCFREESTRINGLIST
 #define XwcTextEscapement XWCTEXTESCAPEMENT
 #define XwcTextExtents XWCTEXTEXTENTS
 #define XwcTextListToTextProperty XWCTEXTLISTTOTEXTPROPERTY
+#define XwcLookupString XWCLOOKUPSTRING
 #define XwcTextPropertyToTextList XWCTEXTPROPERTYTOTEXTLIST
+#define _XAllocTemp _XALLOCTEMP
+#define _XDeqAsyncHandler _XDEQASYNCHANDLER
+#define _XEatData _XEATDATA
+#define _XFlush _XFLUSH
+#define _XFreeTemp _XFREETEMP
+#define _XGetAsyncReply _XGETASYNCREPLY 
+#define _XInitImageFuncPtrs _XINITIMAGEFUNCPTRS
+#define _XRead _XREAD
+#define _XReadPad _XREADPAD
+#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE 
+#define _XReply _XREPLY
+#define _XSend _XSEND
+#define _XUnregisterFilter _XUNREGISTERFILTER
+#define _XVIDtoVisual _XVIDTOVISUAL
 #define _XmBottomShadowColorDefault _XMBOTTOMSHADOWCOLORDEFAULT
 #define _XmClearBorder _XMCLEARBORDER
 #define _XmConfigureObject _XMCONFIGUREOBJECT
@@ -558,6 +873,7 @@
 #define _XmGrabKeyboard _XMGRABKEYBOARD
 #define _XmGrabPointer _XMGRABPOINTER
 #define _XmInheritClass _XMINHERITCLASS
+#define _XmInputForGadget _XMINPUTFORGADGET
 #define _XmInputInGadget _XMINPUTINGADGET
 #define _XmMakeGeometryRequest _XMMAKEGEOMETRYREQUEST
 #define _XmMenuPopDown _XMMENUPOPDOWN
@@ -580,116 +896,86 @@
 #define _XmTopShadowColorDefault _XMTOPSHADOWCOLORDEFAULT
 #define _Xm_fastPtr _XM_FASTPTR
 #define _XtCheckSubclassFlag _XTCHECKSUBCLASSFLAG
+#define _XtCopyFromArg _XTCOPYFROMARG
+#define _XtCountVaList _XTCOUNTVALIST
 #define _XtInherit _XTINHERIT
 #define _XtInheritTranslations _XTINHERITTRANSLATIONS
+#define _XtIsSubclassOf _XTISSUBCLASSOF
+#define _XtVaToArgList _XTVATOARGLIST
 #define applicationShellWidgetClass APPLICATIONSHELLWIDGETCLASS
+#define cli$dcl_parse CLI$DCL_PARSE
+#define cli$get_value CLI$GET_VALUE
+#define cli$present  CLI$PRESENT
+#define compositeClassRec COMPOSITECLASSREC
 #define compositeWidgetClass COMPOSITEWIDGETCLASS
+#define constraintClassRec CONSTRAINTCLASSREC
+#define constraintWidgetClass CONSTRAINTWIDGETCLASS
+#define coreWidgetClass COREWIDGETCLASS
+#define exe$getspi EXE$GETSPI
+#define lbr$close LBR$CLOSE
+#define lbr$get_header LBR$GET_HEADER
+#define lbr$get_index LBR$GET_INDEX
+#define lbr$get_record LBR$GET_RECORD
+#define lbr$ini_control LBR$INI_CONTROL
+#define lbr$lookup_key LBR$LOOKUP_KEY
+#define lbr$open LBR$OPEN
+#define lbr$output_help LBR$OUTPUT_HELP
+#define lib$add_times LIB$ADD_TIMES
+#define lib$addx LIB$ADDX
+#define lib$create_dir LIB$CREATE_DIR
+#define lib$create_vm_zone LIB$CREATE_VM_ZONE
+#define lib$cvt_from_internal_time LIB$CVT_FROM_INTERNAL_TIME
+#define lib$cvt_htb LIB$CVT_HTB
+#define lib$cvt_vectim LIB$CVT_VECTIM
+#define lib$day LIB$DAY
+#define lib$day_of_week LIB$DAY_OF_WEEK
+#define lib$delete_symbol LIB$DELETE_SYMBOL
+#define lib$delete_vm_zone LIB$DELETE_VM_ZONE
+#define lib$disable_ctrl LIB$DISABLE_CTRL
+#define lib$ediv LIB$EDIV
+#define lib$emul LIB$EMUL
+#define lib$enable_ctrl LIB$ENABLE_CTRL
+#define lib$find_vm_zone LIB$FIND_VM_ZONE
+#define lib$format_date_time LIB$FORMAT_DATE_TIME
+#define lib$free_timer LIB$FREE_TIMER
+#define lib$free_vm LIB$FREE_VM
+#define lib$get_ef LIB$GET_EF
+#define lib$get_foreign LIB$GET_FOREIGN
+#define lib$get_input LIB$GET_INPUT
+#define lib$get_users_language LIB$GET_USERS_LANGUAGE
+#define lib$get_vm LIB$GET_VM
+#define lib$get_symbol LIB$GET_SYMBOL
+#define lib$getdvi LIB$GETDVI
+#define lib$init_date_time_context LIB$INIT_DATE_TIME_CONTEXT
+#define lib$init_timer LIB$INIT_TIMER
+#define lib$find_file LIB$FIND_FILE
+#define lib$find_file_end LIB$FIND_FILE_END
+#define lib$find_image_symbol LIB$FIND_IMAGE_SYMBOL
+#define lib$mult_delta_time LIB$MULT_DELTA_TIME
+#define lib$put_output LIB$PUT_OUTPUT
+#define lib$rename_file LIB$RENAME_FILE
+#define lib$reset_vm_zone LIB$RESET_VM_ZONE
+#define lib$set_symbol LIB$SET_SYMBOL
+#define lib$sfree1_dd LIB$SFREE1_DD
+#define lib$show_vm LIB$SHOW_VM
+#define lib$show_vm_zone LIB$SHOW_VM_ZONE
+#define lib$spawn LIB$SPAWN
+#define lib$stat_timer LIB$STAT_TIMER
+#define lib$subx LIB$SUBX
+#define lib$sub_times LIB$SUB_TIMES
+#define lib$wait LIB$WAIT
+#define mail$send_add_address MAIL$SEND_ADD_ADDRESS
+#define mail$send_add_attribute MAIL$SEND_ADD_ATTRIBUTE
+#define mail$send_add_bodypart MAIL$SEND_ADD_BODYPART
+#define mail$send_begin MAIL$SEND_BEGIN
+#define mail$send_end MAIL$SEND_END
+#define mail$send_message MAIL$SEND_MESSAGE
+#define ncs$convert NCS$CONVERT
+#define ncs$get_cf NCS$GET_CF
+#define objectClass OBJECTCLASS
+#define objectClassRec OBJECTCLASSREC
+#define overrideShellClassRec OVERRIDESHELLCLASSREC
 #define overrideShellWidgetClass OVERRIDESHELLWIDGETCLASS
-#define shellWidgetClass SHELLWIDGETCLASS
-#define topLevelShellClassRec TOPLEVELSHELLCLASSREC
-#define topLevelShellWidgetClass TOPLEVELSHELLWIDGETCLASS
-#define transientShellWidgetClass TRANSIENTSHELLWIDGETCLASS
-#define vendorShellClassRec VENDORSHELLCLASSREC
-#define vendorShellWidgetClass VENDORSHELLWIDGETCLASS
-#define wmShellWidgetClass WMSHELLWIDGETCLASS
-#define xmArrowButtonWidgetClass XMARROWBUTTONWIDGETCLASS
-#define xmCascadeButtonClassRec XMCASCADEBUTTONCLASSREC
-#define xmCascadeButtonGadgetClass XMCASCADEBUTTONGADGETCLASS
-#define xmCascadeButtonWidgetClass XMCASCADEBUTTONWIDGETCLASS
-#define xmDialogShellWidgetClass XMDIALOGSHELLWIDGETCLASS
-#define xmDrawingAreaWidgetClass XMDRAWINGAREAWIDGETCLASS
-#define xmDrawnButtonWidgetClass XMDRAWNBUTTONWIDGETCLASS
-#define xmFileSelectionBoxWidgetClass XMFILESELECTIONBOXWIDGETCLASS
-#define xmFormWidgetClass XMFORMWIDGETCLASS
-#define xmFrameWidgetClass XMFRAMEWIDGETCLASS
-#define xmGadgetClass XMGADGETCLASS
-#define xmLabelGadgetClass XMLABELGADGETCLASS
-#define xmLabelWidgetClass XMLABELWIDGETCLASS
-#define xmListWidgetClass XMLISTWIDGETCLASS
-#define xmMainWindowWidgetClass XMMAINWINDOWWIDGETCLASS
-#define xmManagerClassRec XMMANAGERCLASSREC
-#define xmManagerWidgetClass XMMANAGERWIDGETCLASS
-#define xmMenuShellWidgetClass XMMENUSHELLWIDGETCLASS
-#define xmMessageBoxWidgetClass XMMESSAGEBOXWIDGETCLASS
-#define xmPrimitiveClassRec XMPRIMITIVECLASSREC
-#define xmPrimitiveWidgetClass XMPRIMITIVEWIDGETCLASS
-#define xmPushButtonClassRec XMPUSHBUTTONCLASSREC
-#define xmPushButtonGadgetClass XMPUSHBUTTONGADGETCLASS
-#define xmPushButtonWidgetClass XMPUSHBUTTONWIDGETCLASS
-#define xmRowColumnWidgetClass XMROWCOLUMNWIDGETCLASS
-#define xmSashWidgetClass XMSASHWIDGETCLASS
-#define xmScrollBarWidgetClass XMSCROLLBARWIDGETCLASS
-#define xmScrolledWindowClassRec XMSCROLLEDWINDOWCLASSREC
-#define xmScrolledWindowWidgetClass XMSCROLLEDWINDOWWIDGETCLASS
-#define xmSeparatorGadgetClass XMSEPARATORGADGETCLASS
-#define xmSeparatorWidgetClass XMSEPARATORWIDGETCLASS
-#define xmTextFieldWidgetClass XMTEXTFIELDWIDGETCLASS
-#define xmTextWidgetClass XMTEXTWIDGETCLASS
-#define xmToggleButtonGadgetClass XMTOGGLEBUTTONGADGETCLASS
-#define xmToggleButtonWidgetClass XMTOGGLEBUTTONWIDGETCLASS
-#define XtRegisterDrawable _XTREGISTERWINDOW
-#define XtUnregisterDrawable _XTUNREGISTERWINDOW
-#define XQueryFont XQUERYFONT
-#define XSetPlaneMask XSETPLANEMASK
-#define XChangeKeyboardControl XCHANGEKEYBOARDCONTROL
-#define XDestroySubwindows XDESTROYSUBWINDOWS
-#define XFreeDeviceList XFREEDEVICELIST
-#define XFreeDeviceState XFREEDEVICESTATE
-#define XGetExtensionVersion XGETEXTENSIONVERSION
-#define XGetRGBColormaps XGETRGBCOLORMAPS
-#define XIconifyWindow XICONIFYWINDOW
-#define XInstallColormap XINSTALLCOLORMAP
-#define XListInputDevices XLISTINPUTDEVICES
-#define XLookupKeysym XLOOKUPKEYSYM
-#define XOpenDevice XOPENDEVICE
-#define XQueryDeviceState XQUERYDEVICESTATE
-#define XSelectExtensionEvent XSELECTEXTENSIONEVENT
-#define XWarpPointer XWARPPOINTER
-#define XmuLookupStandardColormap XMULOOKUPSTANDARDCOLORMAP
-#define XAllocNamedColor XALLOCNAMEDCOLOR
-#define XBlackPixelOfScreen XBLACKPIXELOFSCREEN
-#define XDefaultColormap XDEFAULTCOLORMAP
-#define XDefaultColormapOfScreen XDEFAULTCOLORMAPOFSCREEN
-#define XDefaultDepth XDEFAULTDEPTH
-#define XDefaultScreen XDEFAULTSCREEN
-#define XDefaultVisual XDEFAULTVISUAL
-#define XSetIconName XSETICONNAME
-#define XtInitialize XTINITIALIZE
-#define XtMainLoop XTMAINLOOP
-#define DtSaverGetWindows DTSAVERGETWINDOWS
-#define XAddHosts XADDHOSTS
-#define XDisableAccessControl XDISABLEACCESSCONTROL
-#define XEnableAccessControl XENABLEACCESSCONTROL
-#define XFillArcs XFILLARCS
-#define XForceScreenSaver XFORCESCREENSAVER
-#define XGetScreenSaver XGETSCREENSAVER
-#define XListHosts XLISTHOSTS
-#define XReadBitmapFile XREADBITMAPFILE
-#define XRemoveHosts XREMOVEHOSTS
-#define XResetScreenSaver XRESETSCREENSAVER
-#define XResourceManagerString XRESOURCEMANAGERSTRING
-#define XSetScreenSaver XSETSCREENSAVER
-#define XStringListToTextProperty XSTRINGLISTTOTEXTPROPERTY
-#define XrmDestroyDatabase XRMDESTROYDATABASE
-#define XrmGetFileDatabase XRMGETFILEDATABASE
-#define XrmGetStringDatabase XRMGETSTRINGDATABASE
-#define XrmInitialize XRMINITIALIZE
-#define XrmMergeDatabases XRMMERGEDATABASES
-#define XrmParseCommand XRMPARSECOMMAND
-#define XrmPutLineResource XRMPUTLINERESOURCE
-#define XrmQPutStringResource XRMQPUTSTRINGRESOURCE
-#define XrmStringToBindingQuarkList XRMSTRINGTOBINDINGQUARKLIST
-#define XrmStringToQuark XRMSTRINGTOQUARK
-#define XmCreateLabel XMCREATELABEL
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-extern void XtFree(char*);
-#ifdef __cplusplus
-}
-#endif
-
 #define pthread_attr_create PTHREAD_ATTR_CREATE
 #define pthread_attr_delete PTHREAD_ATTR_DELETE
 #define pthread_attr_destroy PTHREAD_ATTR_DESTROY
@@ -699,6 +985,7 @@ extern void XtFree(char*);
 #define pthread_attr_getprio PTHREAD_ATTR_GETPRIO
 #define pthread_attr_getsched PTHREAD_ATTR_GETSCHED
 #define pthread_attr_getschedparam PTHREAD_ATTR_GETSCHEDPARAM
+#define pthread_attr_getschedpolicy PTHREAD_ATTR_GETSCHEDPOLICY
 #define pthread_attr_getstacksize PTHREAD_ATTR_GETSTACKSIZE
 #define pthread_attr_init PTHREAD_ATTR_INIT
 #define pthread_attr_setdetach_np PTHREAD_ATTR_SETDETACH_NP
@@ -709,6 +996,9 @@ extern void XtFree(char*);
 #define pthread_attr_setsched PTHREAD_ATTR_SETSCHED
 #define pthread_attr_setschedparam PTHREAD_ATTR_SETSCHEDPARAM
 #define pthread_attr_setschedpolicy PTHREAD_ATTR_SETSCHEDPOLICY
+#ifndef pthread_attr_setscope
+# define pthread_attr_setscope PTHREAD_ATTR_SETSCOPE
+#endif
 #define pthread_attr_setstacksize PTHREAD_ATTR_SETSTACKSIZE
 #define pthread_cancel PTHREAD_CANCEL
 #define pthread_cancel_e PTHREAD_CANCEL_E
@@ -729,8 +1019,10 @@ extern void XtFree(char*);
 #define pthread_equal PTHREAD_EQUAL
 #define pthread_exc_fetch_fp_np PTHREAD_EXC_FETCH_FP_NP
 #define pthread_exc_handler_np PTHREAD_EXC_HANDLER_NP
+#define pthread_exc_matches_np PTHREAD_EXC_MATCHES_NP
 #define pthread_exc_pop_ctx_np PTHREAD_EXC_POP_CTX_NP
 #define pthread_exc_push_ctx_np PTHREAD_EXC_PUSH_CTX_NP
+#define pthread_exc_raise_np PTHREAD_EXC_RAISE_NP
 #define pthread_exc_savecontext_np PTHREAD_EXC_SAVECONTEXT_NP
 #define pthread_exit PTHREAD_EXIT
 #define pthread_get_expiration_np PTHREAD_GET_EXPIRATION_NP
@@ -741,8 +1033,9 @@ extern void XtFree(char*);
 #define pthread_getunique_np PTHREAD_GETUNIQUE_NP
 #define pthread_join PTHREAD_JOIN
 #define pthread_join32 PTHREAD_JOIN32
-#define pthread_keycreate PTHREAD_KEYCREATE
 #define pthread_key_create PTHREAD_KEY_CREATE
+#define pthread_key_delete PTHREAD_KEY_DELETE
+#define pthread_keycreate PTHREAD_KEYCREATE
 #define pthread_kill PTHREAD_KILL
 #define pthread_lock_global_np PTHREAD_LOCK_GLOBAL_NP
 #define pthread_mutex_destroy PTHREAD_MUTEX_DESTROY
@@ -763,6 +1056,7 @@ extern void XtFree(char*);
 #define pthread_setasynccancel PTHREAD_SETASYNCCANCEL
 #define pthread_setcancel PTHREAD_SETCANCEL
 #define pthread_setcancelstate PTHREAD_SETCANCELSTATE
+#define pthread_setcanceltype PTHREAD_SETCANCELTYPE
 #define pthread_setprio PTHREAD_SETPRIO
 #define pthread_setschedparam PTHREAD_SETSCHEDPARAM
 #define pthread_setscheduler PTHREAD_SETSCHEDULER
@@ -772,110 +1066,159 @@ extern void XtFree(char*);
 #define pthread_unlock_global_np PTHREAD_UNLOCK_GLOBAL_NP
 #define pthread_yield PTHREAD_YIELD
 #define pthread_yield_np PTHREAD_YIELD_NP
-#define XDefaultRootWindow XDEFAULTROOTWINDOW
-#define XDisplayCells XDISPLAYCELLS
-#define XMaxRequestSize XMAXREQUESTSIZE
-#define XScreenOfDisplay XSCREENOFDISPLAY
-#define XSetFillRule XSETFILLRULE
-#define XmActivateProtocol XMACTIVATEPROTOCOL
-#define XmCreateBulletinBoardDialog XMCREATEBULLETINBOARDDIALOG
-#define XmCreateErrorDialog XMCREATEERRORDIALOG
-#define XmCreateWarningDialog XMCREATEWARNINGDIALOG
-#define XmCvtCTToXmString XMCVTCTTOXMSTRING
-#define XmDestroyPixmap XMDESTROYPIXMAP
-#define XmGetPixmap XMGETPIXMAP
-#define XmInstallImage XMINSTALLIMAGE
-#define XmListAddItems XMLISTADDITEMS
-#define XmListDeleteItem XMLISTDELETEITEM
-#define XmListItemExists XMLISTITEMEXISTS
-#define XmListItemPos XMLISTITEMPOS
-#define XmListReplaceItems XMLISTREPLACEITEMS
-#define XmListReplaceItemsPos XMLISTREPLACEITEMSPOS
-#define XmRemoveProtocols XMREMOVEPROTOCOLS
-#define XmRemoveTabGroup XMREMOVETABGROUP
-#define XmSetColorCalculation XMSETCOLORCALCULATION
-#define XmTextCopy XMTEXTCOPY
-#define XmTextCut XMTEXTCUT
-#define XmTextFieldClearSelection XMTEXTFIELDCLEARSELECTION
-#define XmTextFieldCopy XMTEXTFIELDCOPY
-#define XmTextFieldCut XMTEXTFIELDCUT
-#define XmTextFieldGetMaxLength XMTEXTFIELDGETMAXLENGTH
-#define XmTextFieldGetSelectionPosition XMTEXTFIELDGETSELECTIONPOSITION
-#define XmTextFieldPaste XMTEXTFIELDPASTE
-#define XmTextFieldReplace XMTEXTFIELDREPLACE
-#define XmTextFieldSetAddMode XMTEXTFIELDSETADDMODE
-#define XmTextFieldSetHighlight XMTEXTFIELDSETHIGHLIGHT
-#define XmTextFieldSetInsertionPosition XMTEXTFIELDSETINSERTIONPOSITION
-#define XmTextFieldSetMaxLength XMTEXTFIELDSETMAXLENGTH
-#define XmTextFieldShowPosition XMTEXTFIELDSHOWPOSITION
-#define XmTextGetEditable XMTEXTGETEDITABLE
-#define XmTextPaste XMTEXTPASTE
-#define XmTextPosToXY XMTEXTPOSTOXY
-#define XmTextSetEditable XMTEXTSETEDITABLE
-#define XmTextShowPosition XMTEXTSHOWPOSITION
-#define XmUninstallImage XMUNINSTALLIMAGE
-#define XmuCvtStringToBitmap XMUCVTSTRINGTOBITMAP
-#define XrmPutFileDatabase XRMPUTFILEDATABASE
-#define XtAddConverter XTADDCONVERTER
-#define XtError XTERROR
-#define XtVaCreatePopupShell XTVACREATEPOPUPSHELL
-#define pthread_attr_getschedpolicy PTHREAD_ATTR_GETSCHEDPOLICY
-#define pthread_key_delete PTHREAD_KEY_DELETE
-#define xmBulletinBoardWidgetClass XMBULLETINBOARDWIDGETCLASS
-#define xmScaleWidgetClass XMSCALEWIDGETCLASS
-#define XtDisplay XTDISPLAY
-#define XtScreen XTSCREEN
-#define XAllocIconSize XALLOCICONSIZE
-#define XAllocStandardColormap XALLOCSTANDARDCOLORMAP
-#define XAllowEvents XALLOWEVENTS
-#define XBlackPixel XBLACKPIXEL
-#define XCopyColormapAndFree XCOPYCOLORMAPANDFREE
-#define XDefaultGC XDEFAULTGC
-#define XDisplayHeight XDISPLAYHEIGHT
-#define XDisplayWidth XDISPLAYWIDTH
-#define XGetCommand XGETCOMMAND
-#define XGetIconSizes XGETICONSIZES
-#define XKillClient XKILLCLIENT
-#define XListInstalledColormaps XLISTINSTALLEDCOLORMAPS
-#define XRootWindow XROOTWINDOW
-#define XWMGeometry XWMGEOMETRY
-#define XWhitePixel XWHITEPIXEL
-#define XrmCombineDatabase XRMCOMBINEDATABASE
-#define XrmCombineFileDatabase XRMCOMBINEFILEDATABASE
-#define XSetStandardProperties XSETSTANDARDPROPERTIES
-#define XSetState XSETSTATE
-#define XDrawRectangles XDRAWRECTANGLES
-#define XGrabButton XGRABBUTTON
-#define XLookupColor XLOOKUPCOLOR
-#define XMapSubwindows XMAPSUBWINDOWS
-#define XRecolorCursor XRECOLORCURSOR
-#define XStoreBytes XSTOREBYTES
-#define XUngrabButton XUNGRABBUTTON
-#define XUninstallColormap XUNINSTALLCOLORMAP
-#define lib$wait LIB$WAIT
-#define lib$find_file LIB$FIND_FILE
-#define lib$find_file_end LIB$FIND_FILE_END
-#define lib$set_symbol LIB$SET_SYMBOL
-#define lib$sfree1_dd LIB$SFREE1_DD
-#define lib$spawn LIB$SPAWN
+#define rectObjClass RECTOBJCLASS
+#define rectObjClassRec RECTOBJCLASSREC
+#define sessionShellWidgetClass SESSIONSHELLWIDGETCLASS
+#define shellWidgetClass SHELLWIDGETCLASS
+#define shmat SHMAT
+#define shmctl SHMCTL
+#define shmdt SHMDT
+#define shmget SHMGET
+#define smg$create_key_table SMG$CREATE_KEY_TABLE
+#define smg$create_virtual_keyboard SMG$CREATE_VIRTUAL_KEYBOARD
+#define smg$read_composed_line SMG$READ_COMPOSED_LINE
+#define sys$add_ident SYS$ADD_IDENT
+#define sys$asctoid SYS$ASCTOID
 #define sys$assign SYS$ASSIGN
+#define sys$bintim SYS$BINTIM
+#define sys$cancel SYS$CANCEL
+#define sys$cantim SYS$CANTIM
+#define sys$check_access SYS$CHECK_ACCESS
+#define sys$close SYS$CLOSE
+#define sys$connect SYS$CONNECT
+#define sys$create SYS$CREATE
+#define sys$create_user_profile SYS$CREATE_USER_PROFILE
 #define sys$crembx SYS$CREMBX
+#define sys$creprc SYS$CREPRC
+#define sys$crmpsc SYS$CRMPSC
 #define sys$dassgn SYS$DASSGN
+#define sys$dclast SYS$DCLAST
 #define sys$dclexh SYS$DCLEXH
+#define sys$delprc SYS$DELPRC
+#define sys$deq SYS$DEQ
+#define sys$dgblsc SYS$DGBLSC
+#define sys$display SYS$DISPLAY
+#define sys$enq SYS$ENQ
+#define sys$enqw SYS$ENQW
+#define sys$erase SYS$ERASE
+#define sys$fao SYS$FAO
+#define sys$faol SYS$FAOL
+#define sys$find_held SYS$FIND_HELD
+#define sys$finish_rdb SYS$FINISH_RDB
+#define sys$flush SYS$FLUSH
+#define sys$forcex SYS$FORCEX
+#define sys$get SYS$GET
+#define sys$get_security SYS$GET_SECURITY
 #define sys$getdviw SYS$GETDVIW
+#define sys$getjpi SYS$GETJPI
+#define sys$getjpiw SYS$GETJPIW
+#define sys$getlkiw SYS$GETLKIW
+#define sys$getmsg SYS$GETMSG
+#define sys$getsyi SYS$GETSYI
 #define sys$getsyiw SYS$GETSYIW
+#define sys$gettim SYS$GETTIM
+#define sys$getuai SYS$GETUAI
+#define sys$grantid SYS$GRANTID
+#define sys$hash_password SYS$HASH_PASSWORD
+#define sys$hiber SYS$HIBER
+#define sys$mgblsc SYS$MGBLSC
+#define sys$numtim SYS$NUMTIM
+#define sys$open SYS$OPEN
+#define sys$parse SYS$PARSE
+#define sys$parse_acl SYS$PARSE_ACL
+#define sys$parse_acl SYS$PARSE_ACL
+#define sys$persona_assume SYS$PERSONA_ASSUME
+#define sys$persona_create SYS$PERSONA_CREATE
+#define sys$persona_delete SYS$PERSONA_DELETE
+#define sys$process_scan SYS$PROCESS_SCAN
+#define sys$put SYS$PUT
 #define sys$qio SYS$QIO
 #define sys$qiow SYS$QIOW
+#define sys$read SYS$READ
+#define sys$resched SYS$RESCHED
+#define sys$rewind SYS$REWIND
+#define sys$search SYS$SEARCH
+#define sys$set_security SYS$SET_SECURITY
+#define sys$setast SYS$SETAST
 #define sys$setef SYS$SETEF
+#define sys$setimr SYS$SETIMR
+#define sys$setpri SYS$SETPRI
+#define sys$setprn SYS$SETPRN
+#define sys$setprv SYS$SETPRV
+#define sys$setswm SYS$SETSWM
+#define sys$setuai SYS$SETUAI
+#define sys$sndopr SYS$SNDOPR
 #define sys$synch SYS$SYNCH
-#define XDrawText XDRAWTEXT
-#define XtCloseDisplay XTCLOSEDISPLAY
-#define XtDestroyApplicationContext XTDESTROYAPPLICATIONCONTEXT
-#define lib$ediv LIB$EDIV
-#define lib$subx LIB$SUBX
-#define sys$bintim SYS$BINTIM
-#define sys$gettim SYS$GETTIM
-#define XFetchName XFETCHNAME
-#define XPeekIfEvent XPEEKIFEVENT
-#define XQueryKeymap XQUERYKEYMAP
+#define sys$trnlnm SYS$TRNLNM
+#define sys$update SYS$UPDATE
+#define sys$wake SYS$WAKE
+#define sys$write SYS$WRITE
+#define topLevelShellClassRec TOPLEVELSHELLCLASSREC
+#define topLevelShellWidgetClass TOPLEVELSHELLWIDGETCLASS
+#define transientShellWidgetClass TRANSIENTSHELLWIDGETCLASS
+#define vendorShellClassRec VENDORSHELLCLASSREC
+#define vendorShellWidgetClass VENDORSHELLWIDGETCLASS
+#define widgetClass WIDGETCLASS
+#define widgetClassRec WIDGETCLASSREC
+#define wmShellClassRec WMSHELLCLASSREC
+#define wmShellWidgetClass WMSHELLWIDGETCLASS
+#define x$soft_ast_lib_lock X$SOFT_AST_LIB_LOCK
+#define x$soft_ast_lock_depth X$SOFT_AST_LOCK_DEPTH
+#define x$soft_reenable_asts X$SOFT_REENABLE_ASTS
+#define xmArrowButtonWidgetClass XMARROWBUTTONWIDGETCLASS
+#define xmBulletinBoardWidgetClass XMBULLETINBOARDWIDGETCLASS
+#define xmCascadeButtonClassRec XMCASCADEBUTTONCLASSREC
+#define xmCascadeButtonGadgetClass XMCASCADEBUTTONGADGETCLASS
+#define xmCascadeButtonWidgetClass XMCASCADEBUTTONWIDGETCLASS
+#define xmCommandWidgetClass XMCOMMANDWIDGETCLASS
+#define xmDialogShellWidgetClass XMDIALOGSHELLWIDGETCLASS
+#define xmDrawingAreaWidgetClass XMDRAWINGAREAWIDGETCLASS
+#define xmDrawnButtonWidgetClass XMDRAWNBUTTONWIDGETCLASS
+#define xmFileSelectionBoxWidgetClass XMFILESELECTIONBOXWIDGETCLASS
+#define xmFormWidgetClass XMFORMWIDGETCLASS
+#define xmFrameWidgetClass XMFRAMEWIDGETCLASS
+#define xmGadgetClass XMGADGETCLASS
+#define xmLabelGadgetClass XMLABELGADGETCLASS
+#define xmLabelWidgetClass XMLABELWIDGETCLASS
+#define xmListWidgetClass XMLISTWIDGETCLASS
+#define xmMainWindowWidgetClass XMMAINWINDOWWIDGETCLASS
+#define xmManagerClassRec XMMANAGERCLASSREC
+#define xmManagerWidgetClass XMMANAGERWIDGETCLASS
+#define xmMenuShellWidgetClass XMMENUSHELLWIDGETCLASS
+#define xmMessageBoxWidgetClass XMMESSAGEBOXWIDGETCLASS
+#define xmPrimitiveClassRec XMPRIMITIVECLASSREC
+#define xmPrimitiveWidgetClass XMPRIMITIVEWIDGETCLASS
+#define xmPushButtonClassRec XMPUSHBUTTONCLASSREC
+#define xmPushButtonGadgetClass XMPUSHBUTTONGADGETCLASS
+#define xmPushButtonWidgetClass XMPUSHBUTTONWIDGETCLASS
+#define xmRowColumnWidgetClass XMROWCOLUMNWIDGETCLASS
+#define xmSashWidgetClass XMSASHWIDGETCLASS
+#define xmScaleWidgetClass XMSCALEWIDGETCLASS
+#define xmScrollBarWidgetClass XMSCROLLBARWIDGETCLASS
+#define xmScrolledWindowClassRec XMSCROLLEDWINDOWCLASSREC
+#define xmScrolledWindowWidgetClass XMSCROLLEDWINDOWWIDGETCLASS
+#define xmSeparatorGadgetClass XMSEPARATORGADGETCLASS
+#define xmSeparatorWidgetClass XMSEPARATORWIDGETCLASS
+#define xmTextFieldWidgetClass XMTEXTFIELDWIDGETCLASS
+#define xmTextWidgetClass XMTEXTWIDGETCLASS
+#define xmToggleButtonGadgetClass XMTOGGLEBUTTONGADGETCLASS
+#define xmToggleButtonWidgetClass XMTOGGLEBUTTONWIDGETCLASS
+
+#if (__VMS_VER < 80200000) 
+# define SetReqLen(req,n,badlen) \
+    if ((req->length + n) > (unsigned)65535) { \
+	    n = badlen; \
+	    req->length += n; \
+    } else \
+	req->length += n
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern void XtFree(char*);
+#ifdef __cplusplus
+}
+#endif
+
 #endif
-- 
cgit v1.2.3


From a3a640171f12de91202b5dc4777ffd53be10a0aa Mon Sep 17 00:00:00 2001
From: Brian Paul 
Date: Sat, 16 Sep 2006 04:10:56 +0000
Subject: added #ifdef tests for Windows for int64_t, uint64_t

---
 include/GL/glext.h | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'include')

diff --git a/include/GL/glext.h b/include/GL/glext.h
index c5111b895c8..8cc4502ac95 100644
--- a/include/GL/glext.h
+++ b/include/GL/glext.h
@@ -3184,6 +3184,10 @@ typedef unsigned long long int uint64_t;
 typedef long int int32_t;
 typedef long long int int64_t;
 typedef unsigned long long int uint64_t;
+#elif defined(WIN32) && defined(_MSC_VER)
+typedef long int int32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
 #elif defined(WIN32) && defined(__GNUC__)
 #include 
 #else
-- 
cgit v1.2.3


From 5ab9dcd761a42042b769f021b122d53e49d890b1 Mon Sep 17 00:00:00 2001
From: Brian Paul 
Date: Mon, 9 Oct 2006 16:09:30 +0000
Subject: return void instead of GLvoid for glClearDebugLogMESA(),
 glGetDebugLogMESA()

---
 include/GL/gl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'include')

diff --git a/include/GL/gl.h b/include/GL/gl.h
index 6d706d67298..5b30e3f3865 100644
--- a/include/GL/gl.h
+++ b/include/GL/gl.h
@@ -2162,8 +2162,8 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh
 #define GL_DEBUG_ASSERT_MESA              0x875B
 
 GLAPI GLhandleARB APIENTRY glCreateDebugObjectMESA (void);
-GLAPI GLvoid APIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
-GLAPI GLvoid APIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
+GLAPI void APIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
+GLAPI void APIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
                                          GLsizei *length, GLcharARB *debugLog);
 GLAPI GLsizei APIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
 
-- 
cgit v1.2.3


From 9e4a06a48232f013f1c400426c2df60e2ee83744 Mon Sep 17 00:00:00 2001
From: Brian Paul 
Date: Fri, 3 Nov 2006 18:29:39 +0000
Subject: added 1.3/1.4 function mangling

---
 include/GL/glx_mangle.h | 58 +++++++++++++++++++++++++++++++++++--------------
 1 file changed, 42 insertions(+), 16 deletions(-)

(limited to 'include')

diff --git a/include/GL/glx_mangle.h b/include/GL/glx_mangle.h
index d0b47d94e73..4439a96b5d2 100644
--- a/include/GL/glx_mangle.h
+++ b/include/GL/glx_mangle.h
@@ -1,21 +1,25 @@
 /*
  * Mesa 3-D graphics library
- * Version:  4.1
- * Copyright (C) 1995-1998  Brian Paul
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Version:  6.5
+ * 
+ * Copyright (C) 1999-2006  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.
  */
 
 
@@ -48,6 +52,28 @@
 #define glXGetVideoSyncSGI mglXGetVideoSyncSGI
 #define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI
 
+/* GLX 1.2 */
+#define glXGetCurrentDisplay mglXGetCurrentDisplay 
+
+/* GLX 1.3 */
+#define glXChooseFBConfig mglXChooseFBConfig          
+#define glXGetFBConfigAttrib mglXGetFBConfigAttrib       
+#define glXGetFBConfigs mglXGetFBConfigs            
+#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig   
+#define glXCreateWindow mglXCreateWindow            
+#define glXDestroyWindow mglXDestroyWindow           
+#define glXCreatePixmap mglXCreatePixmap            
+#define glXDestroyPixmap mglXDestroyPixmap           
+#define glXCreatePbuffer mglXCreatePbuffer           
+#define glXDestroyPbuffer mglXDestroyPbuffer          
+#define glXQueryDrawable mglXQueryDrawable           
+#define glXCreateNewContext mglXCreateNewContext        
+#define glXMakeContextCurrent mglXMakeContextCurrent      
+#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable  
+#define glXQueryContext mglXQueryContext            
+#define glXSelectEvent mglXSelectEvent             
+#define glXGetSelectedEvent mglXGetSelectedEvent    
+
 /* GLX 1.4 */
 #define glXGetProcAddress mglXGetProcAddress
 
-- 
cgit v1.2.3


From bb69d3af36482a2b69731733de727a31ab75b0ab Mon Sep 17 00:00:00 2001
From: Brian Paul 
Date: Thu, 16 Nov 2006 16:13:43 +0000
Subject: remove obsolete GL_MESA_trace stuff

---
 include/GL/gl.h | 31 -------------------------------
 1 file changed, 31 deletions(-)

(limited to 'include')

diff --git a/include/GL/gl.h b/include/GL/gl.h
index 5b30e3f3865..78a00aeb8b3 100644
--- a/include/GL/gl.h
+++ b/include/GL/gl.h
@@ -2172,37 +2172,6 @@ GLAPI GLsizei APIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType,
 #endif /* GL_ARB_shader_objects */
 
 
-/*
- * ???. GL_MESA_trace
- * XXX obsolete
- */
-#ifndef GL_MESA_trace
-#define GL_MESA_trace 1
-
-#define GL_TRACE_ALL_BITS_MESA			0xFFFF
-#define GL_TRACE_OPERATIONS_BIT_MESA		0x0001
-#define GL_TRACE_PRIMITIVES_BIT_MESA		0x0002
-#define GL_TRACE_ARRAYS_BIT_MESA		0x0004
-#define GL_TRACE_TEXTURES_BIT_MESA		0x0008
-#define GL_TRACE_PIXELS_BIT_MESA		0x0010
-#define GL_TRACE_ERRORS_BIT_MESA		0x0020
-#define GL_TRACE_MASK_MESA			0x8755
-#define GL_TRACE_NAME_MESA			0x8756
-
-GLAPI void GLAPIENTRY glEnableTraceMESA( GLbitfield mask );
-GLAPI void GLAPIENTRY glDisableTraceMESA( GLbitfield mask );
-GLAPI void GLAPIENTRY glNewTraceMESA( GLbitfield mask, const GLubyte * traceName );
-GLAPI void GLAPIENTRY glEndTraceMESA( void );
-GLAPI void GLAPIENTRY glTraceAssertAttribMESA( GLbitfield attribMask );
-GLAPI void GLAPIENTRY glTraceCommentMESA( const GLubyte * comment );
-GLAPI void GLAPIENTRY glTraceTextureMESA( GLuint name, const GLubyte* comment );
-GLAPI void GLAPIENTRY glTraceListMESA( GLuint name, const GLubyte* comment );
-GLAPI void GLAPIENTRY glTracePointerMESA( GLvoid* pointer, const GLubyte* comment );
-GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid* last, const GLubyte* comment );
-
-#endif /* GL_MESA_trace */
-
-
 /*
  * ???. GL_MESA_packed_depth_stencil
  * XXX obsolete
-- 
cgit v1.2.3


From f7436f4c8a8864de934d564d7a5cba813bf72a83 Mon Sep 17 00:00:00 2001
From: Brian Paul 
Date: Thu, 16 Nov 2006 16:13:55 +0000
Subject: regenerate from gl.h

---
 include/GL/gl_mangle.h | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

(limited to 'include')

diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h
index 2e6558def1a..7416d5372cd 100644
--- a/include/GL/gl_mangle.h
+++ b/include/GL/gl_mangle.h
@@ -274,7 +274,6 @@
 #define glDetailTexFuncSGIS		MANGLE(DetailTexFuncSGIS)
 #define glDisableClientState		MANGLE(DisableClientState)
 #define glDisable		MANGLE(Disable)
-#define glDisableTraceMESA		MANGLE(DisableTraceMESA)
 #define glDisableVariantClientStateEXT		MANGLE(DisableVariantClientStateEXT)
 #define glDisableVertexAttribArrayARB		MANGLE(DisableVertexAttribArrayARB)
 #define glDisableVertexAttribArray		MANGLE(DisableVertexAttribArray)
@@ -302,7 +301,6 @@
 #define glElementPointerATI		MANGLE(ElementPointerATI)
 #define glEnableClientState		MANGLE(EnableClientState)
 #define glEnable		MANGLE(Enable)
-#define glEnableTraceMESA		MANGLE(EnableTraceMESA)
 #define glEnableVariantClientStateEXT		MANGLE(EnableVariantClientStateEXT)
 #define glEnableVertexAttribArrayARB		MANGLE(EnableVertexAttribArrayARB)
 #define glEnableVertexAttribArray		MANGLE(EnableVertexAttribArray)
@@ -312,7 +310,6 @@
 #define glEndOcclusionQueryNV		MANGLE(EndOcclusionQueryNV)
 #define glEndQueryARB		MANGLE(EndQueryARB)
 #define glEndQuery		MANGLE(EndQuery)
-#define glEndTraceMESA		MANGLE(EndTraceMESA)
 #define glEndVertexShaderEXT		MANGLE(EndVertexShaderEXT)
 #define glEvalCoord1d		MANGLE(EvalCoord1d)
 #define glEvalCoord1dv		MANGLE(EvalCoord1dv)
@@ -781,7 +778,6 @@
 #define glMultTransposeMatrixf		MANGLE(MultTransposeMatrixf)
 #define glNewList		MANGLE(NewList)
 #define glNewObjectBufferATI		MANGLE(NewObjectBufferATI)
-#define glNewTraceMESA		MANGLE(NewTraceMESA)
 #define glNormal3b		MANGLE(Normal3b)
 #define glNormal3bv		MANGLE(Normal3bv)
 #define glNormal3d		MANGLE(Normal3d)
@@ -923,6 +919,7 @@
 #define glRectsv		MANGLE(Rectsv)
 #define glReferencePlaneSGIX		MANGLE(ReferencePlaneSGIX)
 #define glRenderbufferStorageEXT		MANGLE(RenderbufferStorageEXT)
+#define glRenderbufferStorageMultisampleEXT		MANGLE(RenderbufferStorageMultisampleEXT)
 #define glRenderMode		MANGLE(RenderMode)
 #define glReplacementCodePointerSUN		MANGLE(ReplacementCodePointerSUN)
 #define glReplacementCodeubSUN		MANGLE(ReplacementCodeubSUN)
@@ -1022,6 +1019,7 @@
 #define glSpriteParameteriSGIX		MANGLE(SpriteParameteriSGIX)
 #define glSpriteParameterivSGIX		MANGLE(SpriteParameterivSGIX)
 #define glStartInstrumentsSGIX		MANGLE(StartInstrumentsSGIX)
+#define glStencilClearTagEXT		MANGLE(StencilClearTagEXT)
 #define glStencilFunc		MANGLE(StencilFunc)
 #define glStencilFuncSeparateATI		MANGLE(StencilFuncSeparateATI)
 #define glStencilFuncSeparate		MANGLE(StencilFuncSeparate)
@@ -1140,12 +1138,6 @@
 #define glTextureLightEXT		MANGLE(TextureLightEXT)
 #define glTextureMaterialEXT		MANGLE(TextureMaterialEXT)
 #define glTextureNormalEXT		MANGLE(TextureNormalEXT)
-#define glTraceAssertAttribMESA		MANGLE(TraceAssertAttribMESA)
-#define glTraceCommentMESA		MANGLE(TraceCommentMESA)
-#define glTraceListMESA		MANGLE(TraceListMESA)
-#define glTracePointerMESA		MANGLE(TracePointerMESA)
-#define glTracePointerRangeMESA		MANGLE(TracePointerRangeMESA)
-#define glTraceTextureMESA		MANGLE(TraceTextureMESA)
 #define glTrackMatrixNV		MANGLE(TrackMatrixNV)
 #define glTranslated		MANGLE(Translated)
 #define glTranslatef		MANGLE(Translatef)
@@ -1183,10 +1175,16 @@
 #define glUniform4iv		MANGLE(Uniform4iv)
 #define glUniformMatrix2fvARB		MANGLE(UniformMatrix2fvARB)
 #define glUniformMatrix2fv		MANGLE(UniformMatrix2fv)
+#define glUniformMatrix2x3fv		MANGLE(UniformMatrix2x3fv)
+#define glUniformMatrix2x4fv		MANGLE(UniformMatrix2x4fv)
 #define glUniformMatrix3fvARB		MANGLE(UniformMatrix3fvARB)
 #define glUniformMatrix3fv		MANGLE(UniformMatrix3fv)
+#define glUniformMatrix3x2fv		MANGLE(UniformMatrix3x2fv)
+#define glUniformMatrix3x4fv		MANGLE(UniformMatrix3x4fv)
 #define glUniformMatrix4fvARB		MANGLE(UniformMatrix4fvARB)
 #define glUniformMatrix4fv		MANGLE(UniformMatrix4fv)
+#define glUniformMatrix4x2fv		MANGLE(UniformMatrix4x2fv)
+#define glUniformMatrix4x3fv		MANGLE(UniformMatrix4x3fv)
 #define glUnlockArraysEXT		MANGLE(UnlockArraysEXT)
 #define glUnmapBufferARB		MANGLE(UnmapBufferARB)
 #define glUnmapBuffer		MANGLE(UnmapBuffer)
-- 
cgit v1.2.3


From 744c3a367b8adeb54433a8636813b8f7bfb4b8bc Mon Sep 17 00:00:00 2001
From: Brian Paul 
Date: Mon, 27 Nov 2006 16:50:10 +0000
Subject: get rid of meaningless XFree86LOADER test (bug 9144)

---
 include/GL/internal/glcore.h | 3 ---
 1 file changed, 3 deletions(-)

(limited to 'include')

diff --git a/include/GL/internal/glcore.h b/include/GL/internal/glcore.h
index d5cbd3b2a5c..ca3cf5be572 100644
--- a/include/GL/internal/glcore.h
+++ b/include/GL/internal/glcore.h
@@ -1,4 +1,3 @@
-/* $XFree86: xc/lib/GL/include/GL/internal/glcore.h,v 1.7 2001/03/25 05:32:00 tsi Exp $ */
 #ifndef __gl_core_h_
 #define __gl_core_h_
 
@@ -37,9 +36,7 @@
 **
 */
 
-#ifndef XFree86LOADER
 #include 
-#endif
 
 #ifdef CAPI
 #undef CAPI
-- 
cgit v1.2.3